diff --git a/.gitignore b/.gitignore index e68865d..4b2079d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .eslintrc.json -.vscode \ No newline at end of file +.vscode +/node_modules \ No newline at end of file diff --git a/README.md b/README.md index 6173284..3df7ba7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Estonian Land Board 3D Web Application - +![JavaScript Badge](https://img.shields.io/badge/JavaScript-F7DF1E?logo=javascript&logoColor=000&style=flat) +![ArcGIS Badge](https://img.shields.io/badge/ArcGIS-2C7AC3?logo=arcgis&logoColor=fff&style=flat) +![Vite Badge](https://img.shields.io/badge/Vite-646CFF?logo=vite&logoColor=fff&style=flat) ## Introduction Using ArcGIS Maps SDK for JavaScript. \ This is not an official application. Official application can be found at: https://3d.maaamet.ee/kaart/ diff --git a/app.js b/app.js index 2ae3ece..488a77d 100644 --- a/app.js +++ b/app.js @@ -13,353 +13,344 @@ // TODO uurida mis state on ja kuidas seda kasutada, et teha tühi basemap võimalus kasutajale, ilmselt peab basemaps ka eraldi parameetrina välja tooma // TODO ilmselt peab muutma activeBasemap hübriidiks vms -require([ - "esri/widgets/CoordinateConversion/support/Conversion", - - "./modules/layers.js", - "./modules/scene.js", - "./modules/layerList.js", - "./modules/coordinate.js", - "./modules/lineOfSight.js", - "./modules/search.js", - "./modules/sketch.js", - "./modules/daylight.js", - "./modules/elevationProfile.js", - "./modules/measurement.js", - "./modules/shadowCast.js", - "./modules/slice.js", - - "./modules/locate.js", - - "./modules/elevation.js", - - "./modules/goToLocation.js", - "esri/widgets/Measurement", - "./modules/mediaQuery.js", -], ( - Conversion, - - initLayers, - initScene, - initLayerList, - initCoordinates, - initLoS, - initSearch, - initSketch, - initDaylight, - initElevationProfile, - initMeasurement, - initShadowCast, - initSlice, - - initLocate, - - initELevation, - goToLocation, - Measurement, - initMediaQuery -) => { - /************************************************************ - * Init scene (/w layers) and view - ************************************************************/ - // const mediaQuery = window.matchMedia('(max-width: 768px)'); - // initMediaQuery.handleMediaQueryChange(mediaQuery) - // mediaQuery.addEventListener(initMediaQuery.handleMediaQueryChange); - - const graphicsLayer = initLayers.setupGraphicsLayer(); - - const communicationTower = initLayers.setupInternalLayer( - "66e382030b224ffa999249a4d1cbbf4f", - "Sidemastid" +// Esri imports +import Conversion from "@arcgis/core/widgets/CoordinateConversion/support/Conversion.js"; +import Measurement from "@arcgis/core/widgets/Measurement.js"; + +// Local imports +import { + setupGraphicsLayer, + setupInternalLayer, + setupWMSLayer, + getGeologyLayers, + setupGroupLayer, + taimkateWorkaround, + getVisibleLayers, + compareVisibleLayers, +} from "./modules/layers.js"; +import { setupWebScene, setupWebView } from "./modules/scene.js"; +import { + setupLayerListMain, + setupLayerListWMS, + setupBasemapGallery, + loadWMStile, + getLayerInfo, +} from "./modules/layerList"; +import { setupCoordinateWidget, setupNewFormat } from "./modules/coordinate.js"; +import { setupLoS, getStartPoint } from "./modules/lineOfSight.js"; +import { + setupCustomSearchSource, + setupSearchWidget, +} from "./modules/search.js"; +import { setupSketch } from "./modules/sketch.js"; +import { setupDaylight } from "./modules/daylight.js"; +import { setupElevationProfile } from "./modules/elevationProfile.js"; +import { setupMeasurement } from "./modules/measurement.js"; +import { setupShadowCast } from "./modules/shadowCast.js"; +import { setupSlice } from "./modules/slice.js"; +import { setupLocate } from "./modules/locate.js"; +import { + elevationManipulation, + setupElevationLayer, +} from "./modules/elevation.js"; +import { + getUndergroundInfo, + getLayerVisibility, + getElevationVisibility, + getLocation, + copyTextToClipboard, + createURL, + setupViewPoint, +} from "./modules/goToLocation.js"; + +/************************************************************ + * Init scene (/w layers) and view + ************************************************************/ +// const mediaQuery = window.matchMedia('(max-width: 768px)'); +// initMediaQuery.handleMediaQueryChange(mediaQuery) +// mediaQuery.addEventListener(initMediaQuery.handleMediaQueryChange); + +const graphicsLayer = setupGraphicsLayer(); + +const communicationTower = setupInternalLayer( + "66e382030b224ffa999249a4d1cbbf4f", + "Sidemastid" +); + +const ortofotoWMS = setupWMSLayer(); + +const scene = setupWebScene( + "92d29869db444e28beab584f696b86c3", + graphicsLayer, + ortofotoWMS +); + +const geologyScene = setupWebScene("da15a55042b54c31b0208ba98c1647fc"); + +const geologyView = setupWebView(geologyScene); + +const apDTM = setupElevationLayer( + "https://tiles.arcgis.com/tiles/ZYGCYltwz5ExeoGm/arcgis/rest/services/APR_50m_Eesti_tif/ImageServer", + "Aluspõhi 50m" +); +const akDTM = setupElevationLayer( + "https://tiles.arcgis.com/tiles/ZYGCYltwz5ExeoGm/arcgis/rest/services/AKR_50m_2/ImageServer", + "Aluskord 50m" +); + +const view = setupWebView(scene); + +view.when(() => { + /************************************** + * Geology layer setup + **************************************/ + const geologyLayers = getGeologyLayers(geologyView); + const boreholes = geologyLayers.items.find( + (layer) => layer.title === "Puurkaevud/puuraugud" ); + const constructionGeology = geologyLayers.items.find( + (layer) => layer.title === "Ehitusgeoloogia" + ); + const geologyWMS = geologyLayers.items.find( + (layer) => layer.title === "Geoloogia WMS" + ); + geologyWMS.visible = false; - const ortofotoWMS = initLayers.setupWMSLayer(); + // Adding other DTM layers layers + view.map.ground.layers.addMany([apDTM, akDTM]); - const scene = initScene.setupWebScene( - "92d29869db444e28beab584f696b86c3", - graphicsLayer, - ortofotoWMS - ); + /************************************** + * Desc info + **************************************/ - const geologyScene = initScene.setupWebScene( - "da15a55042b54c31b0208ba98c1647fc" - ); + // TODO kui kakskeelseks teha, siis peaks ilmselt läbi portaali ära kaotama ja tekstid kuhugi lisama + const { description } = scene.portalItem; + const itemDesc = document.querySelector("#item-description"); + itemDesc.innerHTML = description; - const geologyView = initScene.setupWebView(geologyScene); + /************************************** + * Built-in UI components + **************************************/ + view.ui.move("zoom", "top-right"); + view.ui.move("navigation-toggle", "top-right"); + view.ui.move("compass", "top-right"); - const apDTM = initELevation.setupElevationLayer( - "https://tiles.arcgis.com/tiles/ZYGCYltwz5ExeoGm/arcgis/rest/services/APR_50m_Eesti_tif/ImageServer", - "Aluspõhi 50m" - ); - const akDTM = initELevation.setupElevationLayer( - "https://tiles.arcgis.com/tiles/ZYGCYltwz5ExeoGm/arcgis/rest/services/AKR_50m_2/ImageServer", - "Aluskord 50m" - ); + /************************************** + * Line of Sight analysis custom + **************************************/ + getStartPoint(view); - const view = initScene.setupWebView(scene); - - view.when(() => { - /************************************** - * Geology layer setup - **************************************/ - const geologyLayers = initLayers.getGeologyLayers(geologyView); - const boreholes = geologyLayers.items.find( - (layer) => layer.title === "Puurkaevud/puuraugud" - ); - const constructionGeology = geologyLayers.items.find( - (layer) => layer.title === "Ehitusgeoloogia" - ); - const geologyWMS = geologyLayers.items.find( - (layer) => layer.title === "Geoloogia WMS" - ); - geologyWMS.visible = false; - - // Adding other DTM layers layers - view.map.ground.layers.addMany([apDTM, akDTM]); - - /************************************** - * Desc info - **************************************/ - - // TODO kui kakskeelseks teha, siis peaks ilmselt läbi portaali ära kaotama ja tekstid kuhugi lisama - const { description } = scene.portalItem; - const itemDesc = document.querySelector("#item-description"); - itemDesc.innerHTML = description; + /************************************** + * Reworking taimkate logic + **************************************/ - /************************************** - * Built-in UI components - **************************************/ - view.ui.move("zoom", "top-right"); - view.ui.move("navigation-toggle", "top-right"); - view.ui.move("compass", "top-right"); - - /************************************** - * Line of Sight analysis custom - **************************************/ - initLoS.getStartPoint(view); + const treeGroupLayer = setupGroupLayer("Taimkate", "exclusive"); - /************************************** - * Reworking taimkate logic - **************************************/ + taimkateWorkaround(treeGroupLayer, view); - const treeGroupLayer = initLayers.setupGroupLayer("Taimkate", "exclusive"); + // Add the GroupLayer to view + view.map.add(treeGroupLayer); - initLayers.taimkateWorkaround(treeGroupLayer, view); + /************************************** + * Layerlist from scene + **************************************/ + const layerList = setupLayerListMain(view); - // Add the GroupLayer to view - view.map.add(treeGroupLayer); + getLayerInfo(layerList, view); - /************************************** - * Layerlist from scene - **************************************/ - const layerList = initLayerList.setupLayerListMain(view); + /************************************** + * WMS layerlist gallery + **************************************/ + const wmsLayerList = setupLayerListWMS(view); - initLayerList.getLayerInfo(layerList, view); + getLayerInfo(wmsLayerList, view); - /************************************** - * WMS layerlist gallery - **************************************/ - const wmsLayerList = initLayerList.setupLayerListWMS(view); + /************************************** + * Basemap gallery + **************************************/ + const basemaps = setupBasemapGallery(view); - initLayerList.getLayerInfo(wmsLayerList, view); + loadWMStile(basemaps, view); - /************************************** - * Basemap gallery - **************************************/ - const basemaps = initLayerList.setupBasemapGallery(view); + /************************************** + * Geology layer group + **************************************/ - initLayerList.loadWMStile(basemaps, view); + // Creating a geology layer group + const geologyGroupLayer = setupGroupLayer("Geoloogia", "independent"); + geologyGroupLayer.addMany([boreholes, constructionGeology]); - /************************************** - * Geology layer group - **************************************/ + // Adding a geology layer group to view + view.map.add(geologyGroupLayer); - // Creating a geology layer group - const geologyGroupLayer = initLayers.setupGroupLayer( - "Geoloogia", - "independent" - ); - geologyGroupLayer.addMany([boreholes, constructionGeology]); + // Geology WMS + view.map.add(geologyWMS); - // Adding a geology layer group to view - view.map.add(geologyGroupLayer); + // TODO exxaggeration ka tuua üle - aga see veits keerulisem + /************************************** + * Elevation toolbox + **************************************/ - // Geology WMS - view.map.add(geologyWMS); + elevationManipulation(view); - // TODO exxaggeration ka tuua üle - aga see veits keerulisem - /************************************** - * Elevation toolbox - **************************************/ + /************************************** + * Coordinate tool + **************************************/ + const ccWidget = setupCoordinateWidget(view); + const newFormat = setupNewFormat(); + ccWidget.formats.add(newFormat); - initELevation.elevationManipulation(view); + ccWidget.conversions.splice(0, 0, new Conversion({ format: newFormat })); - /************************************** - * Coordinate tool - **************************************/ - const ccWidget = initCoordinates.setupCoordinateWidget(view); - const newFormat = initCoordinates.setupNewFormat(); - ccWidget.formats.add(newFormat); - - ccWidget.conversions.splice(0, 0, new Conversion({ format: newFormat })); - - view.ui.add(ccWidget, "bottom-right"); - - /************************************** - * Initialize the LineOfSight widget - **************************************/ - initLoS.setupLoS(view); + view.ui.add(ccWidget, "bottom-right"); - /************************************** - * Initialize the Search Widget - **************************************/ - const customSearchSource = initSearch.setupCustomSearchSource(); - initSearch.setupSearchWidget(view, customSearchSource); + /************************************** + * Initialize the LineOfSight widget + **************************************/ + setupLoS(view); - /************************************** - * Initialize daylight - **************************************/ + /************************************** + * Initialize the Search Widget + **************************************/ + const customSearchSource = setupCustomSearchSource(); + setupSearchWidget(view, customSearchSource); - initDaylight.setupDaylight(view); - - /************************************** - * Elevation profile - **************************************/ - - initElevationProfile.setupElevationProfile(view); - - /************************************** - * Measurement 3D - **************************************/ - const measurement = new Measurement({ - view, - container: "measurement-container", - }); - - initMeasurement.setupMeasurement(measurement); + /************************************** + * Initialize daylight + **************************************/ - /************************************** - * Slicing - **************************************/ + setupDaylight(view); - initSlice.setupSlice(view); - - /************************************** - * Locate - **************************************/ - const locate = initLocate.setupLocate(view); - - view.ui.add(locate, "top-right"); - - /************************************** - * Sketching - **************************************/ - - initSketch.setupSketch(view, graphicsLayer); - - /************************************** - * Reordering layers - **************************************/ - - // Reordering for on-the-fly layers - view.map.reorder(treeGroupLayer, 6); - view.map.reorder(geologyGroupLayer, 6); - view.map.reorder(geologyWMS, -1); - - // Replacing sidemastid location, adding to correct group - const rajatisedGroup = view.map.findLayerById("180fa46104d-layer-35"); - rajatisedGroup.add(communicationTower); - - /************************************** - * Collecting visible layers before modification and rerendering - **************************************/ - const initVisibleLayers = initLayers.getVisibleLayers(view); - - /************************************** - * Calcite CSS/JS - **************************************/ - - // TODO võiks ka eraldi calcite funktsioonideks kirjutada - const shadowCast = initShadowCast.setupShadowCast(view); - - let activeWidget; - - const handleActionBarClick = ({ target }) => { - if (target.tagName !== "CALCITE-ACTION") { - return; - } - - if (activeWidget) { - document.querySelector( - `[data-action-id=${activeWidget}]` - ).active = false; - document.querySelector(`[data-panel-id=${activeWidget}]`).hidden = true; - } - - const nextWidget = target.dataset.actionId; - if (nextWidget !== activeWidget) { - document.querySelector(`[data-action-id=${nextWidget}]`).active = true; - document.querySelector(`[data-panel-id=${nextWidget}]`).hidden = false; - activeWidget = nextWidget; - } else { - activeWidget = null; - } - - if (nextWidget === "shadowCast") { - shadowCast.visible = !shadowCast.visible; - } - - if (nextWidget === "share") { - const visibleLayersCurrently = initLayers.getVisibleLayers(view); - - const [regularLayers, elevationChanged] = - initLayers.compareVisibleLayers( - initVisibleLayers, - visibleLayersCurrently - ); - console.log(regularLayers); - console.log(elevationChanged); - - const sharedLocation = goToLocation.createURL( - view, - regularLayers, - elevationChanged - ); - goToLocation.copyTextToClipboard(sharedLocation); - - // Displaying popup - const shareMapAlert = document.getElementById("share-map-alert"); - shareMapAlert.open = "true"; - } - }; + /************************************** + * Elevation profile + **************************************/ + + setupElevationProfile(view); + + /************************************** + * Measurement 3D + **************************************/ + const measurement = new Measurement({ + view, + container: "measurement-container", + }); + + setupMeasurement(measurement); + + /************************************** + * Slicing + **************************************/ + + setupSlice(view); + + /************************************** + * Locate + **************************************/ + const locate = setupLocate(view); + + view.ui.add(locate, "top-right"); + + /************************************** + * Sketching + **************************************/ + + setupSketch(view, graphicsLayer); + + /************************************** + * Reordering layers + **************************************/ + + // Reordering for on-the-fly layers + view.map.reorder(treeGroupLayer, 6); + view.map.reorder(geologyGroupLayer, 6); + view.map.reorder(geologyWMS, -1); + + // Replacing sidemastid location, adding to correct group + const rajatisedGroup = view.map.findLayerById("180fa46104d-layer-35"); + rajatisedGroup.add(communicationTower); - document - .querySelector("calcite-action-bar") - .addEventListener("click", handleActionBarClick); - - let actionBarExpanded = false; - - document.addEventListener("calciteActionBarToggle", (event) => { - actionBarExpanded = !actionBarExpanded; - view.padding = { - left: actionBarExpanded ? 135 : 49, - }; - }); - - /************************************** - * Parsing URL if sharing is used - **************************************/ - - // Going to specified location at runtime - const locationArray = goToLocation.getLocation(); - goToLocation.getUndergroundInfo(view); - goToLocation.getLayerVisibility(view); - goToLocation.getElevationVisibility(view); - - if (locationArray !== null) { - const viewpoint = goToLocation.setupViewPoint(locationArray); - view.goTo(viewpoint, { animate: false }); - console.log(basemaps) + /************************************** + * Collecting visible layers before modification and rerendering + **************************************/ + const initVisibleLayers = getVisibleLayers(view); + + /************************************** + * Calcite CSS/JS + **************************************/ + + // TODO võiks ka eraldi calcite funktsioonideks kirjutada + const shadowCast = setupShadowCast(view); + + let activeWidget; + + const handleActionBarClick = ({ target }) => { + if (target.tagName !== "CALCITE-ACTION") { + return; + } + + if (activeWidget) { + document.querySelector(`[data-action-id=${activeWidget}]`).active = false; + document.querySelector(`[data-panel-id=${activeWidget}]`).hidden = true; + } + + const nextWidget = target.dataset.actionId; + if (nextWidget !== activeWidget) { + document.querySelector(`[data-action-id=${nextWidget}]`).active = true; + document.querySelector(`[data-panel-id=${nextWidget}]`).hidden = false; + activeWidget = nextWidget; + } else { + activeWidget = null; + } + + if (nextWidget === "shadowCast") { + shadowCast.visible = !shadowCast.visible; } + + if (nextWidget === "share") { + const visibleLayersCurrently = getVisibleLayers(view); + + const [regularLayers, elevationChanged] = compareVisibleLayers( + initVisibleLayers, + visibleLayersCurrently + ); + console.log(regularLayers); + console.log(elevationChanged); + + const sharedLocation = createURL(view, regularLayers, elevationChanged); + copyTextToClipboard(sharedLocation); + + // Displaying popup + const shareMapAlert = document.getElementById("share-map-alert"); + shareMapAlert.open = "true"; + } + }; + + document + .querySelector("calcite-action-bar") + .addEventListener("click", handleActionBarClick); + + let actionBarExpanded = false; + + document.addEventListener("calciteActionBarToggle", (event) => { + actionBarExpanded = !actionBarExpanded; + view.padding = { + left: actionBarExpanded ? 135 : 49, + }; }); + + /************************************** + * Parsing URL if sharing is used + **************************************/ + + // Going to specified location at runtime + const locationArray = getLocation(); + getUndergroundInfo(view); + getLayerVisibility(view); + getElevationVisibility(view); + + if (locationArray !== null) { + const viewpoint = setupViewPoint(locationArray); + view.goTo(viewpoint, { animate: false }); + console.log(basemaps); + } }); diff --git a/dist/assets/AnalysisToolBase-3A13PdgS.js b/dist/assets/AnalysisToolBase-3A13PdgS.js new file mode 100644 index 0000000..1678c25 --- /dev/null +++ b/dist/assets/AnalysisToolBase-3A13PdgS.js @@ -0,0 +1 @@ +import{e as s,y as i,c as a,d as r,A as o}from"./index-J0iiHjMT.js";import{l}from"./InteractiveToolBase-WDic4GPF.js";let t=class extends l{constructor(e){super(e)}initialize(){this.addHandles(r(()=>this.analysisViewData.visible,e=>this.visible=e,o))}deactivate(){this.onDeactivate(),this.created||this.analysis.clear()}resetCreated(){this._set("created",!1)}};s([i({constructOnly:!0})],t.prototype,"analysis",void 0),s([i()],t.prototype,"analysisViewData",void 0),t=s([a("esri.views.interactive.AnalysisToolBase")],t);export{t as a}; diff --git a/dist/assets/AnalysisView3D-jkk3JIRT.js b/dist/assets/AnalysisView3D-jkk3JIRT.js new file mode 100644 index 0000000..0b45294 --- /dev/null +++ b/dist/assets/AnalysisView3D-jkk3JIRT.js @@ -0,0 +1 @@ +import{cZ as o,a2 as s,e as t,y as i,c as a}from"./index-J0iiHjMT.js";const p=n=>{let e=class extends o(n){constructor(){super(...arguments),this.parent=null,this._userInteractive=!1,this._interactiveViewModelCount=0}get interactive(){return this._interactiveViewModelCount>0||this._userInteractive}set interactive(r){this._userInteractive=r}get updating(){return!1}get visible(){return this.parent==null||this.parent.visible&&!this.parent.suspended}set visible(r){this._overrideIfSome("visible",r)}forceInteractiveForViewModel(){return this._interactiveViewModelCount++,s(()=>this._interactiveViewModelCount--)}};return t([i({readOnly:!0})],e.prototype,"type",void 0),t([i({constructOnly:!0})],e.prototype,"analysis",void 0),t([i({constructOnly:!0})],e.prototype,"parent",void 0),t([i({constructOnly:!0})],e.prototype,"view",void 0),t([i({type:Boolean})],e.prototype,"interactive",null),t([i()],e.prototype,"_userInteractive",void 0),t([i({readOnly:!0})],e.prototype,"updating",null),t([i()],e.prototype,"visible",null),t([i()],e.prototype,"_interactiveViewModelCount",void 0),e=t([a("esri.views.3d.analysis.AnalysisView3D")],e),e};export{p as s}; diff --git a/dist/assets/AnchorElementViewModel-SDYg-P9c.js b/dist/assets/AnchorElementViewModel-SDYg-P9c.js new file mode 100644 index 0000000..99397f6 --- /dev/null +++ b/dist/assets/AnchorElementViewModel-SDYg-P9c.js @@ -0,0 +1 @@ +import{K as c,F as l,d as r,e as o,y as i,c as a}from"./index-J0iiHjMT.js";let t=class extends c.EventedAccessor{constructor(n){super(n),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([l(()=>{const e=this.screenLocationEnabled?this.view:null;return e?[e.size,e.type==="3d"?e.camera:e.viewpoint]:null},()=>this.notifyChange("screenLocation")),r(()=>this.screenLocation,(e,s)=>{e!=null&&s!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:n,view:e,screenLocationEnabled:s}=this;return s&&n!=null&&e!=null&&e.ready?e.toScreen(n):null}};o([i()],t.prototype,"location",void 0),o([i()],t.prototype,"screenLocation",null),o([i()],t.prototype,"screenLocationEnabled",void 0),o([i()],t.prototype,"view",void 0),t=o([a("esri.widgets.support.AnchorElementViewModel")],t);const p=t;export{p as c}; diff --git a/dist/assets/AreaMeasurement2D-5lnD5-Sk.js b/dist/assets/AreaMeasurement2D-5lnD5-Sk.js new file mode 100644 index 0000000..08c5c14 --- /dev/null +++ b/dist/assets/AreaMeasurement2D-5lnD5-Sk.js @@ -0,0 +1 @@ +import{e as a,y as o,c as U,Q as R,kw as I,kx as P,d as $,P as T,n as M,d$ as Q,T as W,O as X,S as L,bX as Y,hS as q,a8 as Z,c1 as ee,ky as te,kz as se,kA as ie,J as z,N as B,kB as C,kC as f,e1 as v,ar as k,kD as A,kE as H,l as re,kF as b,kG as S,kH as O,kI as ae,aD as ne,kJ as oe,hx as V,cy as E,cK as le,cF as ue,cG as me,cB as ce,kK as he,kL as D,w as pe,e0 as de,kM as x,hl as ve,hn as N,ao as ye,kN as j,kO as we}from"./index-J0iiHjMT.js";import{l as _e}from"./Draw-DYxsSuyr.js";import{l as fe,d as ge,v as be,x as $e}from"./InteractiveToolBase-WDic4GPF.js";import{S as ke}from"./GraphicManipulator-ku6oRBpa.js";import{n as Le,u as Me}from"./MeasurementWidgetContent-d8uX7Gw_.js";import"./SnappingVisualizer2D-NnEm1PvQ.js";import"./SnappingContext-6K6JmvvY.js";import"./PointSnappingHint-ULetRXiW.js";import"./EditGeometryOperations-TPE5Wzab.js";import"./SnappingOperation-2U48wt1k.js";import"./surfaceCoordinateSystems-siQq4eBA.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./SnappingDragPipelineStep-THHIXt-p.js";import"./drawUtils-woTYaREB.js";import"./drapedUtils-9db1OpTX.js";const y=1e5;let w=class extends fe{constructor(e){super(e),this._drawActive=!1,this._measurementLayer=new R({internal:!0,listMode:"hide",visible:!1}),this._manipulatorLayer=new R({internal:!0,listMode:"hide",visible:!1}),this._vertices=[],this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null}initialize(){I("esri/core/t9n/Units").then(t=>{this.messages=t}),this.addHandles(P(async()=>{this.messages=await I("esri/core/t9n/Units")}));const e=this.view;this._draw=new _e({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer]),e.focus(),this.addHandles([$(()=>[this.unit,this.geodesicDistanceThreshold,this.messages],()=>{this._updateGraphics()},T),$(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const t=this._vertices.map(({coord:i})=>i);for(const{handle:i}of this._vertices)i.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(t)})])}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=M(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=M(this._measurementLayer),this._manipulatorLayer=M(this._manipulatorLayer),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}onActivate(){this._drawActive||this._vertices.length!==0||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const e=this._draw.create("polyline",{mode:"click"});e.on(["vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],t=>this._updateSketch(t.vertices)),e.on("draw-complete",()=>this._stopSketch())}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const t=this.view.spatialReference;if(t&&(!K(t)||Q())){for(;this._vertices.length>e.length;){const{handle:i,manipulator:r}=this._vertices.pop();i.remove(),this.manipulators.remove(r)}for(let i=this._vertices.length;i{s.next(be(this.view)).next($e(n.graphic,X.Local)).next(()=>{const c=n.graphic.geometry;this._vertices[i].coord=[c.x,c.y],this._updateGraphics()})});this._vertices.push({manipulator:l,coord:[r,u],handle:m})}if(this._vertices.length){const i=this._vertices.length-1,r=this._vertices[i],[u,l]=e[i];r.coord[0]===u&&r.coord[1]===l||(r.coord=[u,l],r.manipulator.graphic.geometry=new W({x:u,y:l,spatialReference:t}));const m=this._drawActive?this._vertices[i].manipulator:null;this.manipulators.forEach(({manipulator:n})=>{n.interactive=m==null||n!==m})}this._updateGraphics()}}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=Se(this._vertices.map(({coord:d})=>d),this.view.spatialReference,this.geodesicDistanceThreshold);if(!e)return;const{measurement:t,fillGeometry:i,outlineGeometry:r}=e;this._set("measurement",t);const u=t?De(this.messages,t,this.unit):null;if(this._set("measurementLabel",u),!i&&!r)return;let l,m,n;const{graphics:s}=this._measurementLayer,c=s.length===3,{effectiveTheme:h}=this.view;c?(l=s.at(0),m=s.at(1),n=s.at(2)):(l=new L({symbol:new Y({color:q(h.accentColor,.3),outline:null})}),m=new L({symbol:new Z({color:h.accentColor,width:2})}),n=new L({symbol:new ee({color:h.textColor,font:new te({size:14,family:"sans-serif"}),haloColor:q(se(h.textColor,ie.Low),.5),haloSize:2})}),s.removeAll(),s.addMany([l,m,n])),l.geometry=i,m.geometry=r,n.geometry=i==null?void 0:i.centroid,n.symbol.text=(u==null?void 0:u.area)??""}};function Ae(e,t,i){const u={style:"circle",color:q(t.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},l=new z({...u,size:8}),m=new z({...u,size:1.5*8}),n=new L({geometry:e,symbol:l});return new ke({view:t,layer:i,graphic:n,focusedSymbol:m})}function Se(e,t,i){if(e.length===2){const c=new B({paths:e,spatialReference:t});let h;if(t!=null&&t.isGeographic)if(C(t))h=f(c,y);else{const d=v(c,k.WGS84),g=f(d,y);h=v(g,t)}else if(t!=null&&t.isWebMercator)h=A(c,y,"meters");else if(H(c,"meters")>=i){const d=v(c,k.WGS84),g=f(d,y);h=v(g,t)}else h=c;return{measurement:null,fillGeometry:null,outlineGeometry:h}}e.push(e[0]);const r=new B({paths:[e],spatialReference:t}),u=new re({rings:[e],spatialReference:t});let l,m,n=null,s=null;if(t!=null&&t.isGeographic)if(C(t)){if(n=f(r,y),s=f(u,y),s=b(s),!s)return null;l=S([r],"meters")[0],m=O([s],"square-meters")[0]}else{const c=k.WGS84,h=v(r,c),d=v(u,c);if(n=f(h,y),s=f(d,y),s=b(s),!s)return null;l=S([h],"meters")[0],m=O([s],"square-meters")[0],n=v(n,t),s=v(s,t)}else if(t!=null&&t.isWebMercator){if(n=A(r,y,"meters"),s=A(u,y,"meters"),s=b(s),!s)return null;l=ae(r,"meters"),m=ne(s,"square-meters")}else{const c=H(r,"meters");if(c>=i){const h=k.WGS84,d=v(r,h),g=v(u,h);if(n=f(d,y),s=f(g,y),s=b(s),!s)return null;l=S([d],"meters")[0],m=O([s],"square-meters")[0],n=v(n,t),s=v(s,t)}else{if(n=r,s=b(u),!s)return null;l=c,m=oe(s,"square-meters")}}return{measurement:{geometry:s,area:m,perimeter:l},fillGeometry:s,outlineGeometry:n}}function Oe(e){return e!=null}function K(e){if(!e)return!1;const{isGeographic:t,isWebMercator:i,isWGS84:r}=e;return t&&!r&&!C(e)||!t&&!i}function De(e,t,i){if(!t||!e)return null;const r={area:null,perimeter:null},{area:u,perimeter:l}=t;switch(i){case"metric":r.area=ue(e,u,"square-meters");break;case"imperial":r.area=le(e,u,"square-meters");break;default:{const n=V(u,"square-meters",i);r.area=E(e,n,i);break}}const m=xe(i);if(m)switch(m){case"metric":r.perimeter=ce(e,l,"meters");break;case"imperial":r.perimeter=me(e,l,"meters");break;default:{const n=V(l,"meters",m);r.perimeter=E(e,n,m);break}}else r.perimeter="";return r}function xe(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}a([o()],w.prototype,"_drawActive",void 0),a([o({readOnly:!0})],w.prototype,"cursor",null),a([o({value:!0})],w.prototype,"editable",null),a([o({type:Number})],w.prototype,"geodesicDistanceThreshold",void 0),a([o({readOnly:!0})],w.prototype,"measurement",void 0),a([o({readOnly:!0})],w.prototype,"measurementLabel",void 0),a([o()],w.prototype,"messages",void 0),a([o()],w.prototype,"unit",void 0),a([o({constructOnly:!0})],w.prototype,"view",void 0),w=a([U("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],w);let _=class extends Le{constructor(e){super(e),this.supportedViewType="2d",this.unsupportedErrorMessage="AreaMeasurement2DViewModel is only supported in 2D views.",this.geodesicDistanceThreshold=1e5}initialize(){this.addHandles([$(()=>{var e;return(e=this.view)==null?void 0:e.spatialReference},()=>this.clear()),$(()=>this.unit,e=>{this.tool!=null&&(this.tool.unit=e)},T),$(()=>this.geodesicDistanceThreshold,e=>{this.tool!=null&&(this.tool.geodesicDistanceThreshold=e)},T)])}get measurement(){return this.tool!=null?this.tool.measurement:null}get measurementLabel(){return this.tool!=null?this.tool.measurementLabel:null}get state(){var e;return this.disabled||this.view==null||!Oe(this.view.spatialReference)?"disabled":(e=this.tool)!=null&&e.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(e){this._overrideIfSome("unit",this._validateUnit(e))}get unitOptions(){return D}set unitOptions(e){this._overrideIfSome("unitOptions",this._validateUnits(e))}async start(){const e=this.view;e!=null&&(await pe(()=>e.ready),K(e.spatialReference)&&await de()),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new w({view:this.view,visible:this.visible,geodesicDistanceThreshold:this.geodesicDistanceThreshold,unit:this.unit})}_validateUnit(e){const{unitOptions:t,defaultUnit:i}=this;return e!=null&&t.includes(e)?e:t.includes(i)?i:t.length>0?t[0]:i}_validateUnits(e){if(e==null)return[];const t=e.filter(i=>D.includes(i));return t.length===0?D.slice():t}};a([o(he)],_.prototype,"defaultUnit",void 0),a([o({type:Number})],_.prototype,"geodesicDistanceThreshold",void 0),a([o({readOnly:!0})],_.prototype,"measurement",null),a([o({readOnly:!0})],_.prototype,"measurementLabel",null),a([o({readOnly:!0})],_.prototype,"state",null),a([o({type:String})],_.prototype,"unit",null),a([o({type:[String]})],_.prototype,"unitOptions",null),_=a([U("esri.widgets.AreaMeasurement2D.AreaMeasurement2DViewModel")],_);const F=_,J="esri-area-measurement-2d",G={base:J,newMeasurementButton:`${J}__clear-button`,widgetIcon:we.measureArea};let p=class extends ve{constructor(e,t){super(e,t),this.iconClass=G.widgetIcon,this.icon=null,this.messages=null,this.messagesUnits=null,this.messagesCommon=null,this.viewModel=new F}get active(){return this.viewModel.active}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const{messages:e,messagesCommon:t,messagesUnits:i,unit:r,unitOptions:u,viewModel:l,visible:m}=this,{active:n,measurementLabel:s,state:c,supported:h}=l;return N("div",{"aria-label":e.widgetLabel,class:this.classes(G.base,j.widget,j.panel),key:this,role:"presentation"},m?N(Me,{active:n,measurementItems:[{key:"area",title:i==null?void 0:i.measures.area,value:s==null?void 0:s.area},{key:"perimeter",title:e.perimeter,value:s==null?void 0:s.perimeter}],messages:{...e,notApplicable:t.notApplicable},newMeasurementButtonClass:G.newMeasurementButton,state:c,supported:h,unit:r,unitOptions:u,onNewMeasurementClick:()=>{ye(l.start())},onUnitChange:d=>{this.unit=d}}):null)}};a([o({readOnly:!0})],p.prototype,"active",null),a([o()],p.prototype,"iconClass",void 0),a([o()],p.prototype,"icon",void 0),a([o()],p.prototype,"label",null),a([o(),x("esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D")],p.prototype,"messages",void 0),a([o(),x("esri/core/t9n/Units")],p.prototype,"messagesUnits",void 0),a([o(),x("esri/t9n/common")],p.prototype,"messagesCommon",void 0),a([o()],p.prototype,"uiStrings",void 0),a([o()],p.prototype,"unit",null),a([o()],p.prototype,"unitOptions",null),a([o()],p.prototype,"view",null),a([o({type:F})],p.prototype,"viewModel",void 0),a([o({type:Boolean})],p.prototype,"visible",null),p=a([U("esri.widgets.AreaMeasurement2D")],p);const Je=p;export{Je as default}; diff --git a/dist/assets/AreaMeasurement3D-GOBHGg9B.js b/dist/assets/AreaMeasurement3D-GOBHGg9B.js new file mode 100644 index 0000000..550d77a --- /dev/null +++ b/dist/assets/AreaMeasurement3D-GOBHGg9B.js @@ -0,0 +1 @@ +import{e as a,y as n,l as J,kL as M,c as f,l2 as X,Z as Y,fo as Z,aa as x,aX as Q,aY as tt,i3 as $,n as w,aJ as et,nk as A,kn as it,d as _,C as st,oc as at,ab as k,kz as nt,k as ot,gD as rt,an as v,T as C,A as P,nn as lt,ao as S,kS as L,kK as pt,kM as b,hl as ht,hn as H,kN as U,kO as ut}from"./index-J0iiHjMT.js";import{W as T}from"./measurementUtils-St7B-HxA.js";import{O as dt}from"./SnappingVisualizer3D-KWlqByBu.js";import{F as gt,A as ct}from"./dragEventPipeline3D-4CqrlxD2.js";import{w as E,e as I,$ as R}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";import{c as mt}from"./Laserlines.glsl-nvjcCsAw.js";import{i as G,d as _t}from"./InteractiveToolBase-WDic4GPF.js";import{a as yt}from"./AnalysisToolBase-3A13PdgS.js";import{V as wt,p as vt,w as Mt}from"./EditGeometryOperations-TPE5Wzab.js";import{a as ft}from"./SceneSnappingManagerPool-OpebO9Di.js";import{e as Vt}from"./SnappingContext-6K6JmvvY.js";import{f as bt}from"./SnappingDragPipelineStep-THHIXt-p.js";import{p as Dt}from"./SnappingOperation-2U48wt1k.js";import{u as Pt}from"./InteractiveAnalysisViewModel-RI-qFGDH.js";import{u as St}from"./MeasurementWidgetContent-d8uX7Gw_.js";import"./ExtendedLineVisualElement-YbjiXiBG.js";import"./vec4f32-NvfHy9q7.js";import"./EngineVisualElement-eZNKTKsI.js";import"./VisualElement-kjYXz27t.js";import"./PointVisualElement-bX-_4FqS.js";import"./Object3DVisualElement-TMb7y_wl.js";import"./RightAngleQuadVisualElement-y_W8r903.js";import"./drawUtils-woTYaREB.js";import"./PointSnappingHint-ULetRXiW.js";import"./dehydratedFeatureComparison-hdPq-zad.js";let m=class extends X{constructor(e){super(e),this.type="area-measurement",this.unit=null}set geometry(e){e!=null?(e.rings.length>1&&Y.getLogger(this).warn("Measuring polygons with multiple rings is not supported."),this._set("geometry",e.clone())):this._set("geometry",null)}get requiredPropertiesForEditing(){if(this.geometry!=null&&this.geometry.rings.length===1){const e=this.geometry.rings[0];if(e.length<=2||!Z(e[0],e[e.length-1]))return[null]}return[this.geometry]}clear(){this.geometry=null}};a([n({type:["area-measurement"]})],m.prototype,"type",void 0),a([n({value:null,type:J})],m.prototype,"geometry",null),a([n({type:M,value:null})],m.prototype,"unit",void 0),a([n({readOnly:!0})],m.prototype,"requiredPropertiesForEditing",null),m=a([f("esri.analysis.AreaMeasurementAnalysis")],m);const N=m;class Ot{constructor(e,i=null){this.screenPoint=e,this.result=i}}class xt{constructor(e,i){this.scenePoint=e,this.mapPoint=i}}class $t{constructor(e){this.vertexManipulators=[],this._destroyed=!1,this._isManipulatorsOwner=!0,this._visible=!0,this._listenerHandles=null,this._tempHandlePosition=x();const{analysisViewData:i,manipulators:s,toolState:r,view:o,visible:l}=e;this._analysisViewData=i,this._toolState=r,s!=null?(this._manipulators=s,this._isManipulatorsOwner=!1):this._manipulators=new G,this._view=o,this._intersector=Q(o.state.viewingMode),this._intersector.options.store=tt.MIN;const p=E(this._handleColor),d=[new I($(p,1,32,32))],c=new R({view:o,renderObjects:d});c.available=!1,c.radius=z,c.interactive=!1,this._manipulators.add(c),this._cursorManipulator=c,this._cursorManipulatorMaterial=p,this._laserLine=new mt({view:o,attached:!0,style:{glowWidth:kt,glowFalloff:Ct,innerWidth:Lt},isDecoration:!0}),this._updateVisibility(l??!0)}destroy(){this._listenerHandles=w(this._listenerHandles),this._isManipulatorsOwner?this._manipulators=w(this._manipulators):this._manipulators=null,this._laserLine=w(this._laserLine),this._destroyed=!0}get destroyed(){return this._destroyed}get visible(){return this._visible}set visible(e){e?this.show():this.hide()}get testData(){const e=this._laserLine.testData;return{laserLineRenderer:e!=null?{heightManifoldEnabled:e.heightManifoldEnabled,heightManifoldTarget:e.heightManifoldTarget,pointDistanceEnabled:e.pointDistanceEnabled,pointDistanceOrigin:e.pointDistanceOrigin,pointDistanceTarget:e.pointDistanceTarget,lineVerticalPlaneEnabled:e.lineVerticalPlaneEnabled}:{heightManifoldEnabled:!1,heightManifoldTarget:null,pointDistanceEnabled:!1,pointDistanceOrigin:null,pointDistanceTarget:null,lineVerticalPlaneEnabled:!1}}}show(){this._setVisibility(!0)}hide(){this._setVisibility(!1)}_setVisibility(e){this._destroyed||this._visible===e||this._updateVisibility(e)}_updateVisibility(e){this._visible=e,this._laserLine.visible=e,e?(this._initializeListeners(),this._updateAll()):(this._destroyListeners(),this.vertexManipulators.forEach(({manipulator:i})=>this._removeVertexManipulator(i)),this.vertexManipulators=[],this._view.cursor=null)}vertexHandleAt(e,i){const s=this._manipulators.intersect(e,i);return s==null?void 0:s.metadata}pick(e){const i=this._view.spatialReference,s=et(e.screenPoint);this._view.sceneIntersectionHelper.intersectToolIntersectorScreen(s,this._intersector);const r=this._intersector.results.min,o=x();if(!r.getIntersectionPoint(o))return null;const l=this._view.renderCoordsHelper.fromRenderCoords(o,i);return l==null?null:new xt(o,l)}_updateAll(){this._visible&&(this._updateVertexManipulators(),this._updateLaserLine())}_createVertexManipulator(){const e=E(this._handleColor),i=[new I($(e,1,32,32))],s=new R({view:this._view,renderObjects:i});return s.radius=z,this._manipulators.add(s),{manipulator:s,material:e}}_removeVertexManipulator(e){this._manipulators.remove(e)}_updateVertexManipulators(){const{viewData:e}=this._analysisViewData,i=this._analysisViewData.path?this._analysisViewData.path.vertices:[],s=this.vertexManipulators;At(s,i.length,()=>this._createVertexManipulator(),({manipulator:r})=>this._removeVertexManipulator(r)),s.forEach(({manipulator:r},o)=>{r.metadata=i[o],r.renderLocation=e.positionsRenderCoords[o],r.cursor=o===0&&this._toolState.polygonState==="drawing"?"crosshair":null}),this._toolState.polygonState==="drawing"&&this._analysisViewData.stagedPoint!=null?(this._cursorManipulator.available=!0,this._cursorManipulator.location=this._analysisViewData.stagedPoint):this._cursorManipulator.available=!1}get _handleColor(){return A(this._view.effectiveTheme.accentColor,.5)}_getFocusPoint(){const{lastDraggedVertex:e}=this._analysisViewData;switch(this._toolState.polygonState){case"drawing":return this._analysisViewData.stagedPoint!=null?this._analysisViewData.stagedPoint:e!=null?this._analysisViewData.path.getVertexPositionAsPoint(e):this._analysisViewData.path.lastPoint;case"editing":return e!=null?this._analysisViewData.path.getVertexPositionAsPoint(e):null;default:return this._analysisViewData.stagedPoint}}_updateLaserLine(){const e=this._toolState.polygonState!=="measured"&&this._toolState.active,i=this._getFocusPoint();if(e&&i!=null){const s=this._tempHandlePosition;this._view.renderCoordsHelper.toRenderCoords(i,s),this._laserLine.heightManifoldTarget=s}else this._laserLine.heightManifoldTarget=null}_initializeListeners(){this._listenerHandles=new it,this._listenerHandles.add([_(()=>this._toolState.polygonState,()=>this._updateLaserLine()),_(()=>this._analysisViewData.viewData,()=>this._updateAll(),st),_(()=>({lastDraggedVertex:this._analysisViewData.lastDraggedVertex,cursorPoint:this._analysisViewData.stagedPoint}),()=>this._updateLaserLine()),_(()=>this._toolState.active,()=>this._updateAll()),_(()=>this._view.effectiveTheme.accentColor,e=>{const i=A(e,.5);for(const{material:d}of this.vertexManipulators)d.setParameters({color:i});this._cursorManipulatorMaterial.setParameters({color:i});const s=k.toUnitRGB(e),r=k.toUnitRGB(nt(e)),o=.75*e.a,l=this._laserLine,p=l.style;l.style={...p,glowColor:s,innerColor:r,globalAlpha:o}},{initial:!0,equals:at})])}_destroyListeners(){this._listenerHandles=w(this._listenerHandles)}}function At(t,e,i,s){for(;t.lengthe;)s(t.pop());else t.length=e}const kt=8,Ct=8,Lt=1,z=5;let u=class extends yt{constructor(t){super(t),this._updatingHandles=new ot,this.polygonState="initial",this.manipulators=new G,this._getSnappingContext=rt(e=>new Vt({elevationInfo:{mode:"absolute-height",offset:0},pointer:e,editGeometryOperations:new wt(new vt("point",Mt(!0,!1,this.view.spatialReference))),visualizer:new dt}))}initialize(){const{view:t,analysisViewData:e,manipulators:i,visible:s}=this;this.measurementView=new $t({view:t,analysisViewData:e,toolState:this,manipulators:i,visible:s});const r=ft(t);this._snappingManagerResult=r,this.addHandles(r),this._snappingOperation=new Dt({view:t}),this._updatingHandles.add(()=>this.stagedPoint,o=>{this.analysisViewData.stagedPoint=o!=null?v(o,new C):null},P),lt(this,()=>{const o=this.view.inputManager.latestPointerType??"mouse",l=this._getSnappingContext(o);this._updatingHandles.addPromise(S(this._snappingOperation.resnap(this._snappingManager,l)))}),this._setupManipulators(),this.addHandles([_(()=>this.state,o=>{o==="measured"&&this.finishToolCreation()},P),this.analysisViewData.path.on("change",()=>{const o=this.analysisViewData.path;this.polygonState!=="initial"||o.isEmptyPolygon||(o.isValidPolygon?this.polygonState="measured":this.polygonState="drawing")})])}destroy(){this.measurementView.destroy(),this._set("measurementView",null),this._updatingHandles=w(this._updatingHandles)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){return this.analysisViewData.path.numVertices===0?"ready":this.analysisViewData.path.isValidPolygon&&this.polygonState!=="editing"?"measured":"measuring"}get cursor(){return this.state==="ready"||this.polygonState==="drawing"?"crosshair":null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get stagedPoint(){return this._snappingOperation.stagedPoint}set stagedPoint(t){this._snappingOperation.stagedPoint=t}get snappingOptions(){return this._snappingManager.options}finishMeasurement(){const{path:t}=this.analysisViewData;t.numVertices<3?(t.clear(),this.polygonState="initial"):(t.close(),this.polygonState="measured"),this._resetSnappingState()}onShow(){this.measurementView.show()}onHide(){this.measurementView.hide()}onDeactivate(){this._resetSnappingState()}onInputEvent(t){switch(t.type){case"immediate-double-click":this._handleImmediateDoubleClick(t);break;case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t);break;case"drag":this._handleDrag(t);break;case"key-down":this._handleKeyDown(t)}}_setupManipulators(){const t=i=>i.events.on("grab-changed",()=>{if(this.analysisViewData.path.isValidPolygon){const s=this.manipulators.some(r=>r.manipulator.grabbing);this.polygonState=s?"editing":"measured"}}),e=i=>{this.addHandles([_t(i,(s,r,o,l)=>{const p=ct(s),d=s.metadata,c=this._snappingManager,V=this._getSnappingContext(l),q=this._updatingHandles,{snappingStep:K,cancelSnapping:W}=bt({snappingManager:c,snappingContext:V,updatingHandles:q});o=o.next(p).next(y=>(this.analysisViewData.lastDraggedVertex=null,this.analysisViewData.path.setVertexPosition(d,O),s.location=O,y)).next(W),r.next(p).next(gt(this.view)).next(...K).next(y=>{s.location=y.mapEnd,this.analysisViewData.lastDraggedVertex=y.action==="end"?null:d,this.analysisViewData.path.setVertexPosition(d,v(y.mapEnd))});const O=v(this.analysisViewData.path.getVertexPositionAsPoint(d))}),t(i)],i)};this.manipulators.forEach(({manipulator:i})=>{e(i)}),this.addHandles([this.manipulators.on("after-add",({item:{manipulator:i}})=>{e(i)}),this.manipulators.on("after-remove",({item:{manipulator:i}})=>this.removeHandles(i))])}_handleImmediateDoubleClick(t){T(t)&&(this.polygonState==="drawing"&&this.finishMeasurement(),t.stopPropagation())}_handleDrag(t){this.polygonState==="editing"&&t.stopPropagation()}_handleImmediateClick(t){if(!T(t))return;const e=L(t),{pointerType:i}=t;if(this.active)switch(this.polygonState){case"initial":if(this._addVertexAt(e,i))return this.stagedPoint=null,this.polygonState="drawing",void t.stopPropagation();break;case"drawing":{const s=this.measurementView.vertexHandleAt(e,i);if(s==null){if(this._addVertexAt(e,i))return this.stagedPoint=null,void t.stopPropagation()}else s.index===0&&(this.finishMeasurement(),t.stopPropagation());break}}t.pointerType==="mouse"&&this._hoverAt(e)}_handlePointerMove(t){if(t.pointerType==="mouse"){const e=L(t);this._hoverAt(e)}}_handleKeyDown(t){const{path:e}=this.analysisViewData;t.key==="Enter"&&this.polygonState==="drawing"&&e.numVertices>=3&&(this.stagedPoint=null,this.finishMeasurement(),t.stopPropagation())}_hoverAt(t){const{polygonState:e}=this;if(this.active&&(e==="initial"||e==="drawing")){const i=this._pick(t);if((i==null?void 0:i.mapPoint)!=null){const s=this._getSnappingContext("mouse");this._updatingHandles.addPromise(S(this._snappingOperation.snap({point:i.mapPoint},this._snappingManager,s)))}}else this.stagedPoint=null}_addVertexAt(t,e){const i=this._pick(t);if((i==null?void 0:i.mapPoint)!=null){const{mapPoint:s}=i,r=this._getSnappingContext(e),o=this._snappingOperation.update({point:s},this._snappingManager,r),l=v(o,new C);return this.analysisViewData.path.add(l),!0}return!1}_pick(t){const e=new Ot(t);return this.measurementView.pick(e)}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}get test(){return{snappingManager:this._snappingManager}}};a([n({readOnly:!0})],u.prototype,"state",null),a([n()],u.prototype,"polygonState",void 0),a([n({readOnly:!0})],u.prototype,"cursor",null),a([n()],u.prototype,"measurementView",void 0),a([n({constructOnly:!0})],u.prototype,"view",void 0),a([n({constructOnly:!0})],u.prototype,"analysis",void 0),a([n({constructOnly:!0})],u.prototype,"analysisViewData",void 0),a([n({readOnly:!0})],u.prototype,"manipulators",void 0),a([n()],u.prototype,"updating",null),a([n()],u.prototype,"stagedPoint",null),a([n()],u.prototype,"snappingOptions",null),u=a([f("esri.views.3d.interactive.measurementTools.areaMeasurement3D.AreaMeasurement3DTool")],u);const Ht=u;let g=class extends Pt{constructor(t){super(t),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="AreaMeasurement3DViewModel is only supported in 3D views.",this._userUnitOptions=null,this._userUnit=null}initialize(){this.addHandles(_(()=>({analysis:this.analysis,unit:this.unit}),({analysis:t,unit:e})=>{t!=null&&(t.unit=e)},P))}get state(){return this.disabled||!this.ready?"disabled":this.tool==null?"ready":this.tool.state}get measurement(){if(this.tool==null||this.disabled||this.tool.destroyed)return null;const{analysisView:t}=this;if(t==null)return null;const e=t.analysisVisualization,i=e.viewData,s=i.measurementData,r=s.validMeasurement,o=i.mode==="euclidean",l=(o?s.intersectingSegments:s.geodesicIntersectingSegments).size===0,p=l?r?"available":"unavailable":"invalid";return{mode:o?"euclidean":"geodesic",area:{text:l&&r?e.areaLabel:null,state:p},perimeterLength:{text:l&&r?e.perimeterLengthLabel:null,state:p}}}set unitOptions(t){this._userUnitOptions=t,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(t){this._userUnit=t?this._findSelectableUnit(t,this._userUnit):null}get unit(){return this._userUnit!=null?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}constructAnalysis(){return new N}constructTool(){return new Ht({view:this.view,analysis:this.analysis,analysisViewData:this.analysisView,visible:this.visible})}_findSelectableUnit(t,e){const{unitOptions:i}=this;return i.includes(t)?t:e!=null?this._findSelectableUnit(e):i[0]}_filteredOrAllUnits(t){if(t==null)return M.slice();const e=t.filter(i=>M.includes(i));return e.length===0?M.slice():e}};a([n({type:N})],g.prototype,"analysis",void 0),a([n({readOnly:!0})],g.prototype,"state",null),a([n({readOnly:!0})],g.prototype,"measurement",null),a([n()],g.prototype,"unitOptions",null),a([n()],g.prototype,"unit",null),a([n(pt)],g.prototype,"defaultUnit",void 0),a([n()],g.prototype,"_userUnit",void 0),g=a([f("esri.widgets.AreaMeasurement3D.AreaMeasurement3DViewModel")],g);const j=g,F="esri-area-measurement-3d",D={base:F,newMeasurementButton:`${F}__clear-button`,widgetIcon:ut.measureArea};let h=class extends ht{constructor(t,e){super(t,e),this.iconClass=D.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.viewModel=new j}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(t){this.viewModel.analysis=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}render(){const{messages:t,messagesCommon:e,messagesUnits:i,unit:s,unitOptions:r,viewModel:o}=this,{active:l,measurement:p,state:d,supported:c}=o;return H("div",{"aria-label":this.messages.widgetLabel,class:this.classes(D.base,U.widget,U.panel),key:this,role:"presentation"},this.visible?H(St,{active:l,measurementItems:[{key:"direct",title:i.measures.area,value:B(p==null?void 0:p.area)},{key:"perimeter",title:t.perimeterLength,value:B(p==null?void 0:p.perimeterLength)}],messages:{...t,notApplicable:e.notApplicable},newMeasurementButtonClass:D.newMeasurementButton,state:d,supported:c,unit:s,unitOptions:r,onNewMeasurementClick:()=>{S(this.viewModel.start())},onUnitChange:V=>{this.unit=V}}):null)}};function B(t){return(t==null?void 0:t.state)==="available"?t.text:null}a([n()],h.prototype,"view",null),a([n()],h.prototype,"visible",null),a([n()],h.prototype,"active",null),a([n({constructOnly:!0,nonNullable:!0})],h.prototype,"analysis",null),a([n()],h.prototype,"iconClass",void 0),a([n()],h.prototype,"icon",void 0),a([n()],h.prototype,"label",null),a([n(),b("esri/widgets/AreaMeasurement3D/t9n/AreaMeasurement3D")],h.prototype,"messages",void 0),a([n(),b("esri/t9n/common")],h.prototype,"messagesCommon",void 0),a([n(),b("esri/core/t9n/Units")],h.prototype,"messagesUnits",void 0),a([n()],h.prototype,"uiStrings",void 0),a([n({type:j})],h.prototype,"viewModel",void 0),a([n()],h.prototype,"unitOptions",null),a([n()],h.prototype,"unit",null),h=a([f("esri.widgets.AreaMeasurement3D")],h);const re=h;export{re as default}; diff --git a/dist/assets/AreaMeasurementAnalysisView3D-AasBQOV-.js b/dist/assets/AreaMeasurementAnalysisView3D-AasBQOV-.js new file mode 100644 index 0000000..1040f38 --- /dev/null +++ b/dist/assets/AreaMeasurementAnalysisView3D-AasBQOV-.js @@ -0,0 +1,26 @@ +import{aE as Me,at as Q,bn as q,aU as T,aF as Ve,aa as p,ou as Re,cs as J,ct as xe,y$ as Oe,cp as I,a9 as ne,az as Ie,nw as Ee,z0 as oe,aG as Te,bb as We,hL as ae,ax as D,au as Y,cT as le,z1 as Ue,mJ as je,rt as ke,kc as he,sY as de,cS as Fe,ar as qe,pl as He,ay as Z,aA as Ne,i5 as Be,e as a,y as d,c as K,p as ie,d as R,C as ce,cu as Ke,cv as Xe,Z as Ye,K as Ze,ek as ue,z2 as Qe,A as ee,i4 as Je,T as et,xz as tt,xE as st,bf as H,xy as pe,xH as it,yH as rt,xF as ge,xD as nt,xK as W,xM as ot,de as at,y7 as lt,uY as U,xO as ht,xP as dt,y6 as ct,xQ as ut,xS as pt,ym as gt,xU as mt,xV as _t,xW as yt,xL as V,xN as ft,y9 as vt,xA as me,lX as j,yb as Lt,yc as Ct,x_ as wt,x$ as St,oW as Ge,bi as N,b2 as x,rv as Pt,b4 as _e,b5 as ye,s_ as bt,by as At,bz as fe,kY as $t,nk as ve,kz as Le,kA as Mt,hS as Ce,bA as Vt,kZ as xt,kx as Gt,P as Dt,n as P,z3 as zt,hx as Rt,bw as Ot,cz as It,z4 as Et,z5 as Tt,z6 as Wt,z7 as Ut,kw as jt,kK as kt}from"./index-J0iiHjMT.js";import{s as Ft}from"./AnalysisView3D-jkk3JIRT.js";import{e as te}from"./interfaces-tkyofe_Z.js";import{T as qt,d as Ht,M as Nt,G as Bt,w as Kt,b as Xt,S as Yt,L as Zt}from"./measurementUtils-St7B-HxA.js";import{t as se,a as Qt}from"./UnitNormalizer-19C91v_m.js";import{U as we}from"./euclideanAreaMeasurementUtils-zmzttSyV.js";import{t as Jt,u as E}from"./LineVisualElement-4BP10o6v.js";import{V as Se,p as es,w as ts,l as ss}from"./EditGeometryOperations-TPE5Wzab.js";import{h as Pe}from"./quantityFormatUtils-NiAiojad.js";import{g as be,_ as is,m as rs}from"./Segment-hN2uWAPW.js";import{a as ns}from"./Object3DVisualElement-TMb7y_wl.js";import"./measurementUtils-84-ZBArh.js";import"./VisualElement-kjYXz27t.js";import"./TextOverlayItem-eCjvS6IO.js";function Ae(t,e,s,i,r){Me(k,t),Q(F,t,e),q(k,s,k,r),q(F,s,F,r),T(i,F,k),Ve(i,i)}const k=p(),F=p();class os{get numVertices(){return this._length}get hasStagedVertex(){return this._hasCursorPoint}constructor(e,s){this.validMeasurement=!1,this.positionsWorldCoords=[],this.positionsRenderCoords=[],this.positionsProjectedWorldCoords=[],this.positionsFittedRenderCoords=[],this.positionsGeographic=[],this.positionsSpherical=[],this.positionsStereographic=[],this.pathSegmentLengths=[],this.geodesicPathSegmentLengths=[],this.perimeterSegmentLengths=[],this.intersectingSegments=new Set,this.geodesicIntersectingSegments=new Set,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.areaCentroidWorldCoords=p(),this.areaCentroidRenderCoords=p(),this.geodesicAreaCentroidRenderCoords=p(),this.area=null,this.geodesicArea=null,this.pathLength=null,this.geodesicPathLength=null,this.perimeterLength=null,this._length=0,this._centroidRenderCoords=p(),this._planeWorldCoords=Re(),this._worldUp=p(),this._worldTangent=p(),this._frame=[p(),p(),p()],this._pathVersion=-1,this._hasCursorPoint=!1,this._mode=null,this._tempU=p(),this._tempV=p(),this._tempVec3=p(),this._tempSphere={center:p(),radius:0},this._sceneView=e,this.unitNormalizer=s}update(e,s,i,r,n,o){const l=s!=null,h=this._pathVersion===e.version,u=this._hasCursorPoint===l,c=this._mode===n;return!(h&&!o&&u&&c&&e.isValidPolygon)&&(this._pathVersion=e.version,this._hasCursorPoint=l,this._updateCursorSegmentLength(e,s),this._update(e,s,i,r,n),!0)}_update(e,s,i,r,n){const o=this.unitNormalizer,l=this._sceneView.renderSpatialReference,h=this.unitNormalizer.spatialReference;let u=e.numVertices;const c=!(s==null||s.equals(e.lastPoint)||u>2&&s.equals(e.firstPoint));c&&(u+=1);const g=!e.polygonIsClosed&&u>2,m=e.polygonIsClosed||g;this._resize(u);const y=J(i.spatialReference),b=xe(i.spatialReference,y)&&Oe(i.spatialReference),{positionsGeographic:C,positionsWorldCoords:$,positionsRenderCoords:A,positionsSpherical:G}=this,O=(f,v)=>{as(i.elevationProvider,f),Z(f,$[v],h),Z(f,A[v],l),b&&(Ne(f,C[v]),Z(f,G[v],y),Ve(G[v],G[v]))};e.forEachVertexPosition((f,v)=>O(f,v)),c&&O(s,u-1);const S=this._updatePathLengths(m);if(this.pathLength=this._length>1?I(o.normalizeDistance(S),"meters"):null,b){const f=this._updateGeodesicPathLengths(m,h);this.geodesicPathLength=this._length>1?I(f,"meters"):null}else this.geodesicPathLength=null;if(this._updateMode(n),!m)return this.area=null,this.geodesicArea=null,this.perimeterLength=null,this.triangleIndices=null,this.geodesicTriangleIndices=null,this.intersectingSegments.clear(),this.geodesicIntersectingSegments.clear(),void(this.validMeasurement=!1);this._updateAreaAndPerimeterLength(i,o,l,h,r),b&&this._updateGeodesicArea(i),this.validMeasurement=!0}getData(){return{validMeasurement:this.validMeasurement,numVertices:this.numVertices,hasStagedVertex:this.hasStagedVertex,positionsWorldCoords:this.positionsWorldCoords,positionsRenderCoords:this.positionsRenderCoords,positionsProjectedWorldCoords:this.positionsProjectedWorldCoords,positionsFittedRenderCoords:this.positionsFittedRenderCoords,positionsGeographic:this.positionsGeographic,positionsSpherical:this.positionsSpherical,positionsStereographic:this.positionsStereographic,pathSegmentLengths:this.pathSegmentLengths,geodesicPathSegmentLengths:this.geodesicPathSegmentLengths,perimeterSegmentLengths:this.perimeterSegmentLengths,intersectingSegments:this.intersectingSegments,geodesicIntersectingSegments:this.geodesicIntersectingSegments,triangleIndices:this.triangleIndices,geodesicTriangleIndices:this.geodesicTriangleIndices,areaCentroidWorldCoords:this.areaCentroidWorldCoords,areaCentroidRenderCoords:this.areaCentroidRenderCoords,geodesicAreaCentroidRenderCoords:this.geodesicAreaCentroidRenderCoords,fittingMode:this.fittingMode,area:this.area,geodesicArea:this.geodesicArea,pathLength:this.pathLength,geodesicPathLength:this.geodesicPathLength,perimeterLength:this.perimeterLength,unitNormalizer:this.unitNormalizer,actualMeasurementMode:this.actualMeasurementMode}}_resize(e){for(e2&&Ht(l,g),this.fittingMode=this._selectFittingMode(g,l,this._worldUp,n);let y=0;if(this.fittingMode==="horizontal"){let S=-1/0;h.forEach((f,v)=>{const re=o.getAltitude(h[v]);re>S&&(S=re,y=v)})}const b=l[y];let C=g,$=this._worldTangent;this.fittingMode==="horizontal"?C=this._worldUp:this.fittingMode==="vertical"&&(C=this._tempVec3,$=this._worldUp,oe(g,this._worldUp,C)),Me(this._frame[2],C),oe($,C,this._frame[0]),Te(this._frame[1],this._frame[0],this._frame[2]),We(this._frame[1],this._frame[1]);const A=this._tempVec3,G=this._tempU,O=this._tempV;for(let S=0;S0?I(s.normalizeDistance(this._updatePerimeterLengths()),"meters"):null,se(c,this.areaCentroidRenderCoords),q(this.areaCentroidRenderCoords,i,this.areaCentroidWorldCoords,r),this._updateIntersectingSegments(),this.area=this.intersectingSegments.size===0?le(s.normalizeArea(this._computeArea()),"square-meters"):null}_updateGeodesicArea(e){const{renderCoordsHelper:s,spatialReference:i}=e,{positionsSpherical:r,positionsStereographic:n}=this,o=this._tempVec3,l=Nt(r,o);if(!l)return void(this.geodesicArea=null);const h=this._tempU,u=this._tempV;Ue(o,h,u);for(let c=0;cMath.abs(Kt(e,c))).reduce((c,g)=>Math.max(c,g),0);Xt(s,this._tempSphere);const o=n/(2*this._tempSphere.radius),l=oMath.cos(He(r.verticalAngleThreshold))?"horizontal":"vertical"),u}_updateCursorSegmentLength(e,s){const i=e.lastPoint;e.isValidPolygon||i==null||s==null?(this.geodesicStagedSegmentLength=null,this.stagedSegmentLength=null):(this.geodesicStagedSegmentLength=I(Yt(i,s),"meters"),this.stagedSegmentLength=I(this.unitNormalizer.normalizeDistance(Zt(i,s,this.unitNormalizer.spatialReference)),"meters"))}_updateMode(e){if(e===te.Auto){this.actualMeasurementMode="euclidean";let s=0;this.geodesicPathLength!=null&&(s+=this.geodesicPathLength.value),s>ls&&(this.actualMeasurementMode="geodesic")}else this.actualMeasurementMode=e===te.Euclidean?"euclidean":"geodesic";this.geodesicPathLength==null&&(this.actualMeasurementMode="euclidean"),this._mode=e}}function as(t,e){e.hasZ||(e.z=Be(t,e,"ground")??0)}const ls=1e5;let z=class extends ie{constructor(t){super(t)}initialize(){const t=this.view.spatialReference,e=J(t),s=e===Ke?Xe:e,i=!t||xe(t,s)?s:t,r=new Qt(i);this._measurementDataManager=new os(this.view,r),this.addHandles([this.analysisViewData.path.on("change",()=>this._update()),R(()=>this.analysisViewData.stagedPoint,()=>this._update(),ce),R(()=>this.analysisViewData.mode,()=>this._update(),ce)]),this._update()}_update(t=!1){const{analysisViewData:e,view:s}=this,i={maxRelativeErrorCoplanar:.005,maxRelativeErrorAlmostCoplanar:.01,verticalAngleThreshold:80};this._measurementDataManager.update(e.path,e.stagedPoint,s,i,e.mode,t)&&(e.measurementData=this._measurementDataManager.getData())}};a([d({constructOnly:!0})],z.prototype,"view",void 0),a([d({constructOnly:!0})],z.prototype,"analysis",void 0),a([d({constructOnly:!0})],z.prototype,"analysisViewData",void 0),z=a([K("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementController")],z);const De="esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurement3DPathHelper",hs=Ye.getLogger(De);let w=class extends Ze.EventedAccessor{constructor(t={}){super(t),this._version=0,this._internalGeometryChange=!1,this._extent=ue()}set areaMeasurement(t){this._set("areaMeasurement",t),t!=null&&this.view!=null&&this._initialize(t,this.view)}set view(t){this._set("view",t),t!=null&&this.areaMeasurement!=null&&this._initialize(this.areaMeasurement,t)}get constructed(){return this.areaMeasurement!=null&&this.view!=null}get version(){return this._version}get isEmptyPolygon(){return!this.constructed||this._editGeometry.components.length===0}get isValidPolygon(){return this.constructed&&this.polygonIsClosed}get extent(){if(this.constructed&&this._editGeometry.components.length>0&&this._editGeometry.components[0].vertices.length>0){const t=ue(this._extent);return this.forEachVertex(e=>{Qe(t,e.pos)}),t}return null}get spatialReference(){return this.constructed?this._editGeometry.coordinateHelper.spatialReference:null}_initialize(t,e){this.removeAllHandles(),this.addHandles(R(()=>t.geometry,()=>{this._updateEditGeometryFromModelGeometry(t,e)},ee)),this._makeDirty(!0)}_makeDirty(t=!1){this.notifyChange("polygonIsClosed"),this.notifyChange("isValidPolygon"),this.notifyChange("initialized"),this.notifyChange("extent"),t&&this.notifyChange("numVertices")}_updateEditGeometryFromModelGeometry(t,e){if(this._version++,this._internalGeometryChange)return;this.removeHandles("EditGeometry");let s=t.geometry;if(s!=null){const i=Je(s,e.spatialReference);i==null&&Jt(t,s.spatialReference,hs),s=i}this._editGeometryOperations=s!=null?Se.fromGeometry(s,e.state.viewingMode):new Se(new es("polygon",ts(!0,!1,e.spatialReference))),this._makeDirty(!0),this.emit("change"),this.addHandles(this._editGeometry.on("change",i=>{this._makeDirty(i.addedVertices!=null||i.removedVertices!=null),this._internalGeometryChange=!0,t.geometry=this.numVertices>0?this._editGeometry.geometry:null,this._internalGeometryChange=!1}),"EditGeometry")}get _editGeometry(){return this._editGeometryOperations.data}get vertices(){const t=[];return this.forEachVertex(e=>{t.push(e)}),t}get numVertices(){return this.constructed&&this._editGeometry.components.length>0?this._editGeometry.components[0].vertices.length:0}get polygonIsClosed(){return this._editGeometry.components.length>0&&this._editGeometry.components[0].isClosed()}get firstPoint(){if(this.constructed&&this._editGeometry.components.length>0){const t=this._editGeometry.components[0].getFirstVertex();if(t!=null)return this._editGeometry.coordinateHelper.vectorToPoint(t.pos)}return null}get lastPoint(){if(this.constructed&&this._editGeometry.components.length>0){const t=this._editGeometry.components[0].getLastVertex();if(t!=null)return this._editGeometry.coordinateHelper.vectorToPoint(t.pos)}return null}getVertex(t){if(!this.constructed||this._editGeometry.components.length===0||this._editGeometry.components[0].vertices.length===0)return null;const e=this._editGeometry.components[0].vertices[0];let s=e;do{if(s.index===t)return s;s=s.rightEdge.rightVertex}while(s!==e&&s!=null);return null}getVertexPositionAsPoint(t){return this._editGeometry.coordinateHelper.vectorToPoint(t.pos)}getVertexPositionAsPointFromIndex(t){return this._editGeometry.coordinateHelper.vectorToPoint(this.getVertex(t).pos)}forEachVertex(t){this.constructed&&this._editGeometry.components.length>0&&this._editGeometry.components[0].iterateVertices(t)}forEachVertexPosition(t){const e=this._editGeometry.coordinateHelper;this.forEachVertex((s,i)=>{e.vectorToPoint(s.pos,$e),t($e,i)})}clear(){this.areaMeasurement!=null&&(this.areaMeasurement.geometry=null)}add(t){if(!this.constructed)return null;if(this._editGeometry.components.length===0){const s=this.view;this._editGeometry.components.push(new ss(s.spatialReference,s.state.viewingMode))}const e=this._editGeometryOperations.appendVertex(this._editGeometry.coordinateHelper.pointToVector(t));return this.emit("change"),e}close(){if(!this.constructed||this._editGeometry.components.length===0)return null;const t=this._editGeometryOperations.closeComponent(this._editGeometry.components[0]);return this.emit("change"),t}ensureContains(t,e=""){let s=!1;if(this._editGeometry.components.forEach(i=>{i.iterateVertices(r=>{r===t&&(s=!0)})}),!s)throw new Error(`vertex doesnt exist ${e}`);return s}setVertexPosition(t,e){if(!this.constructed)return null;const s=this._editGeometryOperations.setVertexPosition(t,this._editGeometry.coordinateHelper.pointToVector(e));return this.emit("change"),s}equals(t){if(this.numVertices!==t.numVertices)return!1;let e=!0;return this.forEachVertexPosition((s,i)=>{const r=t.getVertexPositionAsPointFromIndex(i);s.equals(r)||(e=!1)}),!!e}};a([d({value:null})],w.prototype,"areaMeasurement",null),a([d({value:null})],w.prototype,"view",null),a([d()],w.prototype,"isEmptyPolygon",null),a([d()],w.prototype,"isValidPolygon",null),a([d()],w.prototype,"extent",null),a([d()],w.prototype,"spatialReference",null),a([d()],w.prototype,"numVertices",null),a([d()],w.prototype,"polygonIsClosed",null),w=a([K(De)],w);const $e=new et;function ze(t){const e=new tt,{vertex:s,fragment:i}=e;return st(s,t),e.attributes.add(H.POSITION,"vec3"),e.attributes.add(H.UV0,"vec2"),e.varyings.add("vUV","vec2"),t.multipassEnabled&&e.varyings.add("depth","float"),s.code.add(pe` + void main(void) { + vUV = uv0; + ${t.multipassEnabled?"depth = (view * vec4(position, 1.0)).z;":""} + gl_Position = proj * view * vec4(position, 1.0); + } + `),e.include(it,t),i.uniforms.add(new rt("size",r=>r.size)),i.uniforms.add(new ge("color1",r=>r.color1)),i.uniforms.add(new ge("color2",r=>r.color2)),i.include(nt),i.code.add(pe` + void main() { + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + vec2 uvScaled = vUV / (2.0 * size); + + vec2 uv = fract(uvScaled - 0.25); + vec2 ab = clamp((abs(uv - 0.5) - 0.25) / fwidth(uvScaled), -0.5, 0.5); + float fade = smoothstep(0.25, 0.5, max(fwidth(uvScaled.x), fwidth(uvScaled.y))); + float t = mix(abs(ab.x + ab.y), 0.5, fade); + + fragColor = mix(color2, color1, t); + ${t.transparencyPassType===W.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `),e}const ds=Object.freeze(Object.defineProperty({__proto__:null,build:ze},Symbol.toStringTag,{value:"Module"}));class X extends ht{initializeProgram(e){return new dt(e.rctx,X.shader.get().build(this.configuration),ct)}_setPipelineState(e){const s=this.configuration,i=e===W.NONE,r=e===W.FrontFace;return ut({blending:s.transparent?i?us:pt(e):null,depthTest:{func:gt(e)},depthWrite:i?s.writeDepth?mt:null:_t(e),colorWrite:yt,polygonOffset:i||r?s.polygonOffset?cs:null:{factor:-1,units:-25}})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}X.shader=new ot(ds,()=>at(()=>Promise.resolve().then(()=>vs),void 0));const cs={factor:0,units:-25},us=lt(U.SRC_ALPHA,U.ONE,U.ONE_MINUS_SRC_ALPHA,U.ONE_MINUS_SRC_ALPHA);class M extends ft{constructor(){super(...arguments),this.transparencyPassType=W.NONE,this.transparent=!1,this.writeDepth=!0,this.polygonOffset=!1,this.multipassEnabled=!1,this.cullAboveGround=!1}}a([V({count:W.COUNT})],M.prototype,"transparencyPassType",void 0),a([V()],M.prototype,"transparent",void 0),a([V()],M.prototype,"writeDepth",void 0),a([V()],M.prototype,"polygonOffset",void 0),a([V()],M.prototype,"multipassEnabled",void 0),a([V()],M.prototype,"cullAboveGround",void 0),a([V({constValue:!1})],M.prototype,"occlusionPass",void 0);class ps extends vt{constructor(e){super(e,new ms),this._configuration=new M}getConfiguration(e,s){return this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.transparencyPassType=s.transparencyPassType,this._configuration.multipassEnabled=s.multipassEnabled,this._configuration.cullAboveGround=s.multipassTerrain.cullAboveGround,this._configuration}produces(e,s){return s===me.Color||s===me.Alpha?e===(this.parameters.transparent?this.parameters.writeDepth?j.TRANSPARENT_MATERIAL:j.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:j.OPAQUE_MATERIAL)||e===j.DRAPED_MATERIAL:!1}createGLMaterial(e){return new gs(e)}createBufferWriter(){return new Lt(Ct)}}class gs extends wt{beginSlot(e){return this.ensureTechnique(X,e)}}class ms extends St{constructor(){super(...arguments),this.size=Ge(1,1),this.color1=N(.75,.75,.75,1),this.color2=N(.5,.5,.5,1),this.transparent=!1,this.writeDepth=!0,this.polygonOffset=!1}}class _s extends ns{constructor(e){super(e),this._checkerBoardMaterial=null,this._renderOccluded=x.OccludeAndTransparent,this._geometry=null,this._size=Ge(1,1),this._color1=N(1,.5,0,.5),this._color2=N(1,1,1,.5),this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get size(){return this._size}set size(e){Pt(this._size,e),this._updateMaterial()}get color1(){return this._color1}set color1(e){_e(e,this._color1)||(ye(this._color1,e),this._updateMaterial())}get color2(){return this._color2}set color2(e){_e(e,this._color2)||(ye(this._color2,e),this._updateMaterial())}_updateMaterial(){this._checkerBoardMaterial!=null&&this._checkerBoardMaterial.setParameters({size:this._size,color1:this._color1,color2:this._color2,renderOccluded:this._renderOccluded})}createExternalResources(){this._checkerBoardMaterial=new ps({size:this._size,color1:this._color1,color2:this._color2,transparent:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:x.OccludeAndTransparent,isDecoration:this.isDecoration})}destroyExternalResources(){this._checkerBoardMaterial=null}forEachExternalMaterial(e){this._checkerBoardMaterial!=null&&e(this._checkerBoardMaterial)}createGeometries(e){if(this._geometry==null||this._checkerBoardMaterial==null)return;const s=ys;bt(s,this.transform);const i=this._geometry,r=[],n=p();i.position.forEach(h=>{T(n,h,s),r.push(n[0],n[1],n[2])});const o=[];i.uv.forEach(h=>{o.push(h[0],h[1])});const l=new At(this._checkerBoardMaterial,[[H.POSITION,new fe(r,i.triangleIndices,3,!0)],[H.UV0,new fe(o,i.triangleIndices,2,!0)]]);e.addGeometry(l)}}const ys=p();let L=class extends ie{get _parameters(){const{accentColor:t,textColor:e}=this.view.effectiveTheme,s=$t(t),i=ve(t,.5),r=ve(Le(t),.5),n=Le(e,Mt.Low);return{accentColor:s,transparentAccentColor:i,transparentContrastColor:r,intersectingLineColor:[1,.2,0,1],textColor:e,textBackgroundColor:Ce(n,.6),textCalloutColor:Ce(n,.5),pathLineWidth:3,perimeterLineWidth:2,projectionLineWidth:2,projectionLineStippleSize:5,labelDistance:25}}get visible(){return this.analysisViewData.visible}get testData(){return{labels:{area:this._areaLabel,perimeterLength:this._perimeterLengthLabel}}}constructor(t){super(t),this._path=null,this._intersectedPath=null,this._perimeter=null,this._intersectedPerimeter=null,this._projectionLines=null,this._measurementArea=null,this._areaLabel=null,this._perimeterLengthLabel=null,this._pathSegments=[],this._perimeterSegments=[],this._origin=p(),this._originTransform=Vt(),this.messages=null,this.viewData=fs,this.areaLabel=null,this.perimeterLengthLabel=null,this.loadingMessages=!0}initialize(){const{analysisViewData:t,_parameters:e,view:s}=this;this._path=new E({view:s,attached:!0,width:e.pathLineWidth,polygonOffset:!0,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),this._intersectedPath=new E({view:s,attached:!0,width:e.pathLineWidth,polygonOffset:!0,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),this._perimeter=new E({view:s,attached:!0,width:e.perimeterLineWidth,polygonOffset:!0,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),this._intersectedPerimeter=new E({view:s,attached:!0,width:e.perimeterLineWidth,color:e.intersectingLineColor,polygonOffset:!0,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),this._projectionLines=new E({view:s,attached:!0,width:e.projectionLineWidth,stipplePattern:xt(e.projectionLineStippleSize),polygonOffset:!0,renderOccluded:x.OccludeAndTransparent,isDecoration:!0}),this._measurementArea=new _s({view:s,attached:!0,isDecoration:!0});const i={attached:!0,view:s,isDecoration:!0};this._areaLabel=new be({...i,fontSize:B.Large}),this._perimeterLengthLabel=new be({...i,fontSize:B.Small}),this.addHandles([R(()=>[t.mode,this.visible,t.unit,t.measurementData,t.stagedPoint],()=>this._update(),ee),R(()=>{var r;return(r=s.state)==null?void 0:r.camera},()=>this._updateLabels(),ee),Gt(()=>this._updateMessageBundle()),R(()=>this._parameters,({accentColor:r,transparentAccentColor:n,transparentContrastColor:o,textColor:l,textBackgroundColor:h,textCalloutColor:u})=>{const{_path:c,_intersectedPath:g,_perimeter:m,_projectionLines:y,_measurementArea:b,_areaLabel:C,_perimeterLengthLabel:$}=this;c.color=r,g.color=r,m.color=r,y.color=r,b.color1=n,b.color2=o,C.textColor=l,C.backgroundColor=h,C.calloutColor=u,$.textColor=l,$.backgroundColor=h,$.calloutColor=u},Dt)]),this._updateMessageBundle()}destroy(){this._measurementArea=P(this._measurementArea),this._path=P(this._path),this._intersectedPath=P(this._intersectedPath),this._perimeter=P(this._perimeter),this._intersectedPerimeter=P(this._intersectedPerimeter),this._areaLabel=P(this._areaLabel),this._perimeterLengthLabel=P(this._perimeterLengthLabel),this._projectionLines=P(this._projectionLines),this.set("view",null)}_update(){if(this.destroyed||!this.view.ready||!this.view.renderCoordsHelper)return;const{analysisViewData:{measurementData:t},analysisViewData:e}=this;t!=null&&(this._updateViewData(t,e.path,e.stagedPoint),this._updateOrigin(),this._updatePathSegments(),this._updatePerimeterSegments(),this._updateArea(),this._updateProjectionLines(),this._updateLabels())}_updateViewData(t,e,s){const i=t.validMeasurement,r=t.actualMeasurementMode==="geodesic",n=r?t.geodesicArea:t.area;let o=1;if(n){const h=this._toPreferredAreaUnit(n,this.analysisViewData.unit);o=zt(Math.sqrt(h.value)/Math.sqrt(300)),o*=Math.sqrt(Rt(1,h.unit,"square-meters")),o/=t.unitNormalizer.normalizeDistance(1)}const l={validMeasurement:i,numVertices:t.numVertices,hasStagedVertex:t.hasStagedVertex,path:e,pathVersion:e.version,stagedPoint:s,measurementData:t,mode:t.actualMeasurementMode,positionsGeographic:t.positionsGeographic,positionsRenderCoords:t.positionsRenderCoords,positionsProjected:t.positionsProjectedWorldCoords,positionsFittedRenderCoords:t.positionsFittedRenderCoords,intersectingSegments:r?t.geodesicIntersectingSegments:t.intersectingSegments,triangleIndices:r?t.geodesicTriangleIndices:t.triangleIndices,fittingMode:t.fittingMode,areaCentroid:r?t.geodesicAreaCentroidRenderCoords:t.areaCentroidRenderCoords,pathLengthLabelSegmentIndex:i?0:e.numVertices-2,perimeterLengthLabelSegmentIndex:0,checkerSize:o};this._set("viewData",l)}_updateOrigin(){const t=this.viewData;se(t.positionsRenderCoords,this._origin),Ot(this._originTransform,this._origin),this._measurementArea.transform=this._originTransform,this._projectionLines.transform=this._originTransform}_createSegments(t){const e=this.viewData,s=this.view.renderCoordsHelper.spatialReference,i=e.mode,r=[],n=[],o=[],l=e.numVertices,h=e.validMeasurement?l:l-1;for(let c=0;c=2?u=r[r.length-2]:e.hasStagedVertex&&h>=1&&(u=r[r.length-1]),{all:r,nonIntersecting:n,intersecting:o,stagedSegment:u}}_updatePathSegments(){const{visible:t}=this,e=this._createSegments("positionsRenderCoords");this._path.setGeometryFromSegments(e.nonIntersecting,this._origin),this._path.visible=t,this._intersectedPath.setGeometryFromSegments(e.intersecting,this._origin),this._intersectedPath.visible=t,this._pathSegments=e.all}_updatePerimeterSegments(){const t=this.visible&&this.viewData.mode==="euclidean",e=this._createSegments("positionsFittedRenderCoords");this._perimeter.setGeometryFromSegments(e.nonIntersecting,this._origin),this._perimeter.visible=t,this._intersectedPerimeter.setGeometryFromSegments(e.intersecting,this._origin),this._intersectedPerimeter.visible=t,this._perimeterSegments=e.all}_updateArea(){const t=this.viewData;switch(t.mode){case"euclidean":this._updateAreaEuclidean(t);break;case"geodesic":this._updateAreaGeodesic()}}_updateAreaEuclidean(t){const e=this.visible;t.validMeasurement&&t.intersectingSegments.size===0&&t.triangleIndices?(this._measurementArea.geometry={uv:t.positionsProjected,position:t.positionsFittedRenderCoords,triangleIndices:t.triangleIndices},this._measurementArea.size=[t.checkerSize,t.checkerSize],this._measurementArea.visible=e):this._measurementArea.visible=!1}_updateAreaGeodesic(){this._measurementArea.visible=!1}_updateProjectionLines(){const t=this.viewData,e=this.visible,s=t.mode,i=t.numVertices;if(i>0&&t.validMeasurement&&s==="euclidean"){const r=[];for(let n=0;n{this.messages=t,this.view&&this._update()}).finally(()=>{this.loadingMessages=!1})}};var B;a([d()],L.prototype,"_parameters",null),a([d()],L.prototype,"view",void 0),a([d()],L.prototype,"messages",void 0),a([d()],L.prototype,"analysis",void 0),a([d()],L.prototype,"viewData",void 0),a([d()],L.prototype,"analysisViewData",void 0),a([d({readOnly:!0})],L.prototype,"areaLabel",void 0),a([d({readOnly:!0})],L.prototype,"perimeterLengthLabel",void 0),a([d()],L.prototype,"loadingMessages",void 0),a([d()],L.prototype,"visible",null),L=a([K("esri.views.3d.analysis.AreaMeasurement.support.AreaMeasurementVisualization")],L),function(t){t[t.Small=12]="Small",t[t.Large=16]="Large"}(B||(B={}));const fs={validMeasurement:!1,numVertices:0,hasStagedVertex:!1,path:null,pathVersion:-1,stagedPoint:null,measurementData:null,mode:null,positionsGeographic:null,positionsRenderCoords:null,positionsProjected:null,positionsFittedRenderCoords:null,intersectingSegments:null,triangleIndices:null,fittingMode:null,areaCentroid:null,pathLengthLabelSegmentIndex:null,perimeterLengthLabelSegmentIndex:null,checkerSize:null};let _=class extends Ft(ie){constructor(t){super(t),this.type="area-measurement-view-3d",this.analysis=null,this.measurementData=null,this.lastDraggedVertex=null,this.stagedPoint=null,this.mode=te.Auto}initialize(){const{analysis:t,view:e}=this;this.path=new w({view:e,areaMeasurement:t}),this.analysisVisualization=new L({view:e,analysis:t,analysisViewData:this}),this.analysisController=new z({view:e,analysis:t,analysisViewData:this})}destroy(){this.analysisController=P(this.analysisController),this.analysisVisualization=P(this.analysisVisualization),this.path.destroy()}get updating(){var t;return!!((t=this.analysisVisualization)!=null&&t.loadingMessages)}get result(){const{measurementData:t}=this;return t==null?{area:null,mode:null,perimeter:null}:t.actualMeasurementMode==="euclidean"?{area:t.area,perimeter:t.perimeterLength,mode:"euclidean"}:{area:t.geodesicArea,perimeter:t.pathLength,mode:"geodesic"}}get viewData(){return this.analysisVisualization.viewData}get validMeasurement(){return this.path.isValidPolygon}get unit(){return this.analysis.unit??this._defaultUnit}get testData(){return{visualization:this.analysisVisualization,controller:this.analysisController}}};a([d({readOnly:!0})],_.prototype,"type",void 0),a([d({constructOnly:!0,nonNullable:!0})],_.prototype,"analysis",void 0),a([d()],_.prototype,"updating",null),a([d()],_.prototype,"analysisVisualization",void 0),a([d()],_.prototype,"analysisController",void 0),a([d()],_.prototype,"result",null),a([d()],_.prototype,"measurementData",void 0),a([d()],_.prototype,"viewData",null),a([d()],_.prototype,"validMeasurement",null),a([d()],_.prototype,"path",void 0),a([d()],_.prototype,"lastDraggedVertex",void 0),a([d()],_.prototype,"stagedPoint",void 0),a([d()],_.prototype,"mode",void 0),a([d()],_.prototype,"unit",null),a([d(kt)],_.prototype,"_defaultUnit",void 0),_=a([K("esri.views.3d.analysis.AreaMeasurementAnalysisView3D")],_);const Rs=_,vs=Object.freeze(Object.defineProperty({__proto__:null,build:ze},Symbol.toStringTag,{value:"Module"}));export{Rs as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/AttachmentInfo-kbEMEIl0.js b/dist/assets/AttachmentInfo-kbEMEIl0.js new file mode 100644 index 0000000..d8041fc --- /dev/null +++ b/dist/assets/AttachmentInfo-kbEMEIl0.js @@ -0,0 +1 @@ +import{e as o,y as e,ey as s,c as u,dr as f}from"./index-J0iiHjMT.js";function y(n){const{exifInfo:r,exifName:l,tagName:i}=n;if(!r||!l||!i)return null;const a=r.find(p=>p.name===l);return a?c({tagName:i,tags:a.tags}):null}function c(n){const{tagName:r,tags:l}=n;if(!l||!r)return null;const i=l.find(a=>a.name===r);return(i==null?void 0:i.value)||null}var d;const m={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let t=d=class extends f{constructor(n){super(n),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:n}=this,r=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return m[r]||null}clone(){return new d({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=d=o([u("esri.layers.support.AttachmentInfo")],t);const h=t;export{h as l}; diff --git a/dist/assets/BaseDynamicLayerView3D-aiAW9HKo.js b/dist/assets/BaseDynamicLayerView3D-aiAW9HKo.js new file mode 100644 index 0000000..9945da4 --- /dev/null +++ b/dist/assets/BaseDynamicLayerView3D-aiAW9HKo.js @@ -0,0 +1 @@ +import{e as r,c as e}from"./index-J0iiHjMT.js";import{N as o}from"./DynamicLayerView3D-4lztpXo0.js";import"./LayerView3D-iOx2MD1g.js";import"./projectExtentUtils-TwA6ooHn.js";import"./ImageMaterial.glsl-TdPtjVc_.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";let t=class extends o{constructor(){super(...arguments),this.type="base-dynamic-3d"}};t=r([e("esri.views.3d.layers.BaseDynamicLayerView3D")],t);const d=t;export{d as default}; diff --git a/dist/assets/BaseProcessor-nWGHAt7P.js b/dist/assets/BaseProcessor-nWGHAt7P.js new file mode 100644 index 0000000..655130b --- /dev/null +++ b/dist/assets/BaseProcessor-nWGHAt7P.js @@ -0,0 +1 @@ +import{e as o,y as r,c as u,p as y}from"./index-J0iiHjMT.js";function f(s,c,p,i){const e=s.clone(),n=1<=n?(e.col=l-n,e.world+=1):e.col=l,e.row=a,e}let t=class extends y{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const s=this.tileStore.tileScheme.spatialReference;return s&&s.toJSON()||null}};o([r({readOnly:!0})],t.prototype,"supportsTileUpdates",null),o([r({constructOnly:!0})],t.prototype,"remoteClient",void 0),o([r({constructOnly:!0})],t.prototype,"service",void 0),o([r()],t.prototype,"spatialReference",null),o([r({constructOnly:!0})],t.prototype,"tileInfo",void 0),o([r({constructOnly:!0})],t.prototype,"tileStore",void 0),t=o([u("esri.views.2d.layers.features.processors.BaseProcessor")],t);const v=t;export{f as o,v as p}; diff --git a/dist/assets/BidiEngine-8z8MVveq.js b/dist/assets/BidiEngine-8z8MVveq.js new file mode 100644 index 0000000..e40841e --- /dev/null +++ b/dist/assets/BidiEngine-8z8MVveq.js @@ -0,0 +1 @@ +const I=[["(",")"],[")","("],["<",">"],[">","<"],["[","]"],["]","["],["{","}"],["}","{"],["«","»"],["»","«"],["‹","›"],["›","‹"],["⁽","⁾"],["⁾","⁽"],["₍","₎"],["₎","₍"],["≤","≥"],["≥","≤"],["〈","〉"],["〉","〈"],["﹙","﹚"],["﹚","﹙"],["﹛","﹜"],["﹜","﹛"],["﹝","﹞"],["﹞","﹝"],["﹤","﹥"],["﹥","﹤"]],V=["آ","أ","إ","ا"],$=["ﻵ","ﻷ","ﻹ","ﻻ"],tt=["ﻶ","ﻸ","ﻺ","ﻼ"],k=["ا","ب","ت","ث","ج","ح","خ","د","ذ","ر","ز","س","ش","ص","ض","ط","ظ","ع","غ","ف","ق","ك","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ل","م","ن","ه","و","ي","إ","أ","آ","ة","ى","ی","ئ","ؤ"],rt=["ﺍ","ﺏ","ﺕ","ﺙ","ﺝ","ﺡ","ﺥ","ﺩ","ﺫ","ﺭ","ﺯ","ﺱ","ﺵ","ﺹ","ﺽ","ﻁ","ﻅ","ﻉ","ﻍ","ﻑ","ﻕ","ﻙ","ﻝ","ﻡ","ﻥ","ﻩ","ﻭ","ﻱ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯼ","ﺉ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺉ","ﺅ"],et=["ﺎ","ﺐ","ﺖ","ﺚ","ﺞ","ﺢ","ﺦ","ﺪ","ﺬ","ﺮ","ﺰ","ﺲ","ﺶ","ﺺ","ﺾ","ﻂ","ﻆ","ﻊ","ﻎ","ﻒ","ﻖ","ﻚ","ﻞ","ﻢ","ﻦ","ﻪ","ﻮ","ﻲ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯽ","ﺊ","ﺆ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺊ","ﺆ"],nt=["ﺎ","ﺒ","ﺘ","ﺜ","ﺠ","ﺤ","ﺨ","ﺪ","ﺬ","ﺮ","ﺰ","ﺴ","ﺸ","ﺼ","ﻀ","ﻄ","ﻈ","ﻌ","ﻐ","ﻔ","ﻘ","ﻜ","ﻠ","ﻤ","ﻨ","ﻬ","ﻮ","ﻴ","ﺈ","ﺄ","ﺂ","ﺔ","ﻰ","ﯿ","ﺌ","ﺆ","ﹱ","ﹲ","ﹴ","ﹷ","ﹹ","ﹻ","ﹽ","ﹿ","ﺀ","ﺌ","ﺆ"],ot=["ﺍ","ﺑ","ﺗ","ﺛ","ﺟ","ﺣ","ﺧ","ﺩ","ﺫ","ﺭ","ﺯ","ﺳ","ﺷ","ﺻ","ﺿ","ﻃ","ﻇ","ﻋ","ﻏ","ﻓ","ﻗ","ﻛ","ﻟ","ﻣ","ﻧ","ﻫ","ﻭ","ﻳ","ﺇ","ﺃ","ﺁ","ﺓ","ﻯ","ﯾ","ﺋ","ﺅ","ﹰ","ﹲ","ﹴ","ﹶ","ﹸ","ﹺ","ﹼ","ﹾ","ﺀ","ﺋ","ﺅ"],z=["ء","آ","أ","ؤ","إ","ا","ة","د","ذ","ر","ز","و","ى"],it=["ً","ً","ٌ","؟","ٍ","؟","َ","َ","ُ","ُ","ِ","ِ","ّ","ّ","ْ","ْ","ء","آ","آ","أ","أ","ؤ","ؤ","إ","إ","ئ","ئ","ئ","ئ","ا","ا","ب","ب","ب","ب","ة","ة","ت","ت","ت","ت","ث","ث","ث","ث","ج","ج","ج","ج","ح","ح","ح","ح","خ","خ","خ","خ","د","د","ذ","ذ","ر","ر","ز","ز","س","س","س","س","ش","ش","ش","ش","ص","ص","ص","ص","ض","ض","ض","ض","ط","ط","ط","ط","ظ","ظ","ظ","ظ","ع","ع","ع","ع","غ","غ","غ","غ","ف","ف","ف","ف","ق","ق","ق","ق","ك","ك","ك","ك","ل","ل","ل","ل","م","م","م","م","ن","ن","ن","ن","ه","ه","ه","ه","و","و","ى","ى","ي","ي","ي","ي","ﻵ","ﻶ","ﻷ","ﻸ","ﻹ","ﻺ","ﻻ","ﻼ","؟","؟","؟"],q=["ء","ف"],ut=["غ","ي"],st=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],at=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],e=0,s=1,h=2,B=3,t=4,_=5,j=6,r=7,m=8,R=9,b=10,T=11,n=12,ft=13,ct=14,lt=15,ht=16,Tt=17,l=18,At=["UBAT_L","UBAT_R","UBAT_EN","UBAT_AN","UBAT_ON","UBAT_B","UBAT_S","UBAT_AL","UBAT_WS","UBAT_CS","UBAT_ES","UBAT_ET","UBAT_NSM","UBAT_LRE","UBAT_RLE","UBAT_PDF","UBAT_LRO","UBAT_RLO","UBAT_BN"],p=100,Lt=[p+0,e,e,e,e,p+1,p+2,p+3,s,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,p+4,t,t,t,e,t,e,t,e,t,t,t,e,e,t,t,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,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,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,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,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,t,t,t,t,t,t,t,t,t,e,e,t,t,e,e,t,t,e,e,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,p+5,r,r,p+6,p+7],gt=[[l,l,l,l,l,l,l,l,l,j,_,j,m,_,l,l,l,l,l,l,l,l,l,l,l,l,l,l,_,_,_,j,m,t,t,T,T,T,t,t,t,t,t,b,R,b,R,R,h,h,h,h,h,h,h,h,h,h,R,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,l,l,l,l,l,l,_,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,l,R,t,T,T,T,T,t,t,t,t,e,t,t,l,t,t,T,T,h,h,t,e,t,t,t,h,e,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,e,e,e,e,e,e,e],[e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,e,e,e,e,e,e,e,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,e,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,s,n,s,n,n,s,n,n,s,n,t,t,t,t,t,t,t,t,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,t,t,t,t,t,s,s,s,s,s,t,t,t,t,t,t,t,t,t,t,t],[B,B,B,B,t,t,t,t,r,T,T,r,R,r,t,t,n,n,n,n,n,n,n,n,n,n,n,r,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,B,B,B,B,B,B,B,B,B,B,T,B,B,r,r,r,n,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,B,t,n,n,n,n,n,n,r,r,n,n,t,n,n,n,n,r,r,h,h,h,h,h,h,h,h,h,h,r,r,r,r,r,r],[r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,r,r,n,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,n,n,n,n,n,n,n,n,n,n,n,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,s,n,n,n,n,n,n,n,n,n,s,s,t,t,t,t,s,t,t,t,t,t],[m,m,m,m,m,m,m,m,m,m,m,l,l,l,e,s,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,m,_,ft,ct,lt,ht,Tt,R,T,T,T,T,T,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,R,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,m,l,l,l,l,l,t,t,t,t,t,l,l,l,l,l,l,h,e,t,t,h,h,h,h,h,h,b,b,t,t,t,e,h,h,h,h,h,h,h,h,h,h,b,b,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,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,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t],[e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,t,t,t,t,t,s,n,s,s,s,s,s,s,s,s,s,s,b,s,s,s,s,s,s,s,s,s,s,s,s,s,t,s,s,s,s,s,t,s,t,s,s,t,s,s,t,s,s,s,s,s,s,s,s,s,s,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r],[n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,n,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,t,n,n,n,n,n,n,n,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,t,t,t,t,t,t,t,t,R,t,R,t,t,R,t,t,t,t,t,t,t,t,t,T,t,t,b,b,t,t,t,t,t,T,T,t,t,t,t,t,r,r,r,r,r,t,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,r,t,t,l],[t,t,t,T,T,T,t,t,t,t,t,b,R,b,R,R,h,h,h,h,h,h,h,h,h,h,R,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,t,t,t,t,t,t,t,t,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,t,t,t,e,e,e,e,e,e,t,t,e,e,e,e,e,e,t,t,e,e,e,e,e,e,t,t,e,e,e,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,t,t]];class Pt{constructor(){this.inputFormat="ILYNN",this.outputFormat="VLNNN",this.sourceToTarget=[],this.targetToSource=[],this.levels=[]}bidiTransform(o,u,a){if(this.sourceToTarget=[],this.targetToSource=[],!o)return"";if(Ot(this.sourceToTarget,this.targetToSource,o.length),!this.checkParameters(u,a))return o;u=this.inputFormat,a=this.outputFormat;let f=o;const c=It,L=H(u.charAt(1)),A=H(a.charAt(1)),g=(u.charAt(0)==="I"?"L":u.charAt(0))+L,d=(a.charAt(0)==="I"?"L":a.charAt(0))+A,U=u.charAt(2)+a.charAt(2);c.defInFormat=g,c.defOutFormat=d,c.defSwap=U;const w=E(o,g,d,U,c);let N=!1;return a.charAt(1)==="R"?N=!0:a.charAt(1)!=="C"&&a.charAt(1)!=="D"||(N=this.checkContextual(w)==="rtl"),this.sourceToTarget=F,this.targetToSource=xt(this.sourceToTarget),P=this.targetToSource,f=u.charAt(3)===a.charAt(3)?w:a.charAt(3)==="S"?Bt(N,w,!0):Rt(w,N,!0),this.sourceToTarget=F,this.targetToSource=P,this.levels=y,f}_inputFormatSetter(o){if(!J.test(o))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.inputFormat=o}_outputFormatSetter(o){if(!J.test(o))throw new Error("dojox/string/BidiEngine: the bidi layout string is wrong!");this.outputFormat=o}checkParameters(o,u){return o?this._inputFormatSetter(o):o=this.inputFormat,u?this._outputFormatSetter(u):u=this.outputFormat,o!==u}checkContextual(o){let u=D(o);if(u!=="ltr"&&u!=="rtl"){try{u=document.dir.toLowerCase()}catch{}u!=="ltr"&&u!=="rtl"&&(u="ltr")}return u}hasBidiChar(o){return Dt.test(o)}}function E(i,o,u,a,f){const c=dt(i,{inFormat:o,outFormat:u,swap:a},f);if(c.inFormat===c.outFormat)return i;o=c.inFormat,u=c.outFormat,a=c.swap;const L=o.substring(0,1),A=o.substring(1,4),g=u.substring(0,1),d=u.substring(1,4);if(f.inFormat=o,f.outFormat=u,f.swap=a,L==="L"&&u==="VLTR"){if(A==="LTR")return f.dir=C,S(i,f);if(A==="RTL")return f.dir=O,S(i,f)}if(L==="V"&&g==="V")return f.dir=A==="RTL"?O:C,Y(i,f);if(L==="L"&&u==="VRTL")return A==="LTR"?(f.dir=C,i=S(i,f)):(f.dir=O,i=S(i,f)),Y(i);if(o==="VLTR"&&u==="LLTR")return f.dir=C,S(i,f);if(L==="V"&&g==="L"&&A!==d)return i=Y(i),A==="RTL"?E(i,"LLTR","VLTR",a,f):E(i,"LRTL","VRTL",a,f);if(o==="VRTL"&&u==="LRTL")return E(i,"LRTL","VRTL",a,f);if(L==="L"&&g==="L"){const U=f.swap;return f.swap=U.substr(0,1)+"N",A==="RTL"?(f.dir=O,i=S(i,f),f.swap="N"+U.substr(1,2),f.dir=C,i=S(i,f)):(f.dir=C,i=S(i,f),f.swap="N"+U.substr(1,2),i=E(i,"VLTR","LRTL",f.swap,f)),i}return i}function dt(i,o,u){if(o.inFormat===void 0&&(o.inFormat=u.defInFormat),o.outFormat===void 0&&(o.outFormat=u.defOutFormat),o.swap===void 0&&(o.swap=u.defSwap),o.inFormat===o.outFormat)return o;const a=o.inFormat.substring(0,1),f=o.outFormat.substring(0,1);let c,L=o.inFormat.substring(1,4),A=o.outFormat.substring(1,4);return L.charAt(0)==="C"&&(c=D(i),L=c==="ltr"||c==="rtl"?c.toUpperCase():o.inFormat.charAt(2)==="L"?"LTR":"RTL",o.inFormat=a+L),A.charAt(0)==="C"&&(c=D(i),c==="rtl"?A="RTL":c==="ltr"?(c=mt(i),A=c.toUpperCase()):A=o.outFormat.charAt(2)==="L"?"LTR":"RTL",o.outFormat=f+A),o}function Bt(i,o,u){if(o.length===0)return"";i===void 0&&(i=!0),u===void 0&&(u=!0);const a=(o=String(o)).split("");let f=0,c=1,L=a.length;i||(f=a.length-1,c=-1,L=1);const A=Ut(a,f,c,L,u);let g="";for(let d=0;d-1?(X(P,d,!i,-1),F.splice(d,1)):g+=a[d];return g}function Ut(i,o,u,a,f){let c=0;const L=[];let A=0;for(let g=o;g*u="ﹰ"&&f[c]<"\uFEFF"){const A=i.charCodeAt(c);f[c]>="ﻵ"&&f[c]<="ﻼ"?(o?(c>0&&u&&f[c-1]===" "?a=a.substring(0,a.length-1)+"ل":(a+="ل",L=!0),a+=V[(A-65269)/2]):(a+=V[(A-65269)/2],a+="ل",c+10)if(N===16){for(let v=L;v-1){for(let v=L;v=0&&i[c]===m;c--)o[c]=a.dir}}function bt(i,o,u){if(u.hiLevel!==0&&u.swap.substr(0,1)!==u.swap.substr(1,2))for(let a=0;a>8];return u=q[o]&&i<=ut[o])return!0;return!1}function Z(i,o,u,a){for(;o*u=i){for(c=U+1;c=i;)c++;for(L=U,A=c-1;L(f.lastArabic=!1,e),UBAT_R:()=>(f.lastArabic=!1,s),UBAT_ON:()=>t,UBAT_AN:()=>B,UBAT_EN:()=>f.lastArabic?B:h,UBAT_AL:()=>(f.lastArabic=!0,f.hasUbatAl=!0,s),UBAT_WS:()=>t,UBAT_CS:()=>{let L,A;return a<1||a+1>=o.length||(L=u[a-1])!==h&&L!==B||(A=o[a+1])!==h&&A!==B?t:(f.lastArabic&&(A=B),A===L?A:t)},UBAT_ES:()=>(a>0?u[a-1]:_)===h&&a+1{if(a>0&&u[a-1]===h)return h;if(f.lastArabic)return t;let L=a+1;const A=o.length;for(;L{if(f.inFormat==="VLTR"){const L=o.length;let A=a+1;for(;A=1425&&g<=2303||g===64286,U=o[A];if(d&&(U===s||U===r))return s}}return a<1||o[a-1]===_?t:u[a-1]},UBAT_B:()=>(f.lastArabic=!0,f.hasUbatB=!0,f.dir),UBAT_S:()=>(f.hasUbatS=!0,t),UBAT_LRE:()=>(f.lastArabic=!1,t),UBAT_RLE:()=>(f.lastArabic=!1,t),UBAT_LRO:()=>(f.lastArabic=!1,t),UBAT_RLO:()=>(f.lastArabic=!1,t),UBAT_PDF:()=>(f.lastArabic=!1,t),UBAT_BN:()=>t}[At[c]]()}function Nt(i){let o,u=0,a=I.length-1;for(;u<=a;)if(o=Math.floor((u+a)/2),iI[o][0]))return I[o][1];u=o+1}return i}function vt(i){for(let o=0;o="ً"&&i<="ٕ"}function H(i){return i==="L"?"LTR":i==="R"?"RTL":i==="C"?"CLR":i==="D"?"CRL":""}function Vt(i,o,u,a){for(;o*uo||!u&&i[f]===o)&&(i[f]+=a)}let F=[],P=[],y=[];const It={dir:0,defInFormat:"LLTR",defoutFormat:"VLTR",defSwap:"YN",inFormat:"LLTR",outFormat:"VLTR",swap:"YN",hiLevel:0,lastArabic:!1,hasUbatAl:!1,hasBlockSep:!1,hasSegSep:!1,defOutFormat:""},jt=5,kt=6,C=0,O=1,J=/^[(I|V)][(L|R|C|D)][(Y|N)][(S|N)][N]$/,Dt=/[\u0591-\u06ff\ufb1d-\ufefc]/;export{Pt as C}; diff --git a/dist/assets/BingMapsLayer-d48O8tVq.js b/dist/assets/BingMapsLayer-d48O8tVq.js new file mode 100644 index 0000000..320b602 --- /dev/null +++ b/dist/assets/BingMapsLayer-d48O8tVq.js @@ -0,0 +1 @@ +import{dK as f,dO as j,dL as x,e$ as b,ar as c,dT as B,ae as U,bW as h,f2 as M,E as u,e as r,y as s,c as T,ig as P,c7 as $,dp as R,dM as k,dP as I,T as L,f0 as a}from"./index-J0iiHjMT.js";var v;const y=new P("0/0/0",0,0,0,void 0);let d=v=class extends f(j(x($))){constructor(){super(...arguments),this.tileInfo=b.create({spatialReference:c.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new B(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,c.WebMercator),this.spatialReference=c.WebMercator}getTileBounds(e,t,i,l){const n=l||U();return y.level=e,y.row=t,y.col=i,y.extent=n,this.tileInfo.updateTileInfo(y),y.extent=void 0,n}fetchTile(e,t,i,l={}){const{signal:n}=l,p=this.getTileUrl(e,t,i),g={responseType:"image",signal:n,query:{...this.refreshParameters}};return h(p??"",g).then(m=>m.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:n}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return M(S,e,t,i,n)}const p=this.getTileUrl(e,t,i)??"",g={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:m}=await h(p,g);return M(m,e,t,i,n)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};r([s({type:b})],d.prototype,"tileInfo",void 0),r([s({type:["show","hide"]})],d.prototype,"listMode",void 0),r([s({readOnly:!0,value:"base-tile"})],d.prototype,"type",void 0),r([s({nonNullable:!0})],d.prototype,"fullExtent",void 0),r([s()],d.prototype,"spatialReference",void 0),d=v=r([T("esri.layers.BaseTileLayer")],d);const _=d,w=new R({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),O="https://dev.virtualearth.net";let o=class extends f(k(I(_))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new b({size:[256,256],dpi:96,origin:new L({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:c.WebMercator}),spatialReference:c.WebMercator,lods:[new a({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new a({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new a({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new a({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new a({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new a({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new a({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new a({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new a({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new a({level:10,resolution:152.874056570411,scale:577790.554289}),new a({level:11,resolution:76.4370282850732,scale:288895.277144}),new a({level:12,resolution:38.2185141425366,scale:144447.638572}),new a({level:13,resolution:19.1092570712683,scale:72223.819286}),new a({level:14,resolution:9.55462853563415,scale:36111.909643}),new a({level:15,resolution:4.77731426794937,scale:18055.954822}),new a({level:16,resolution:2.38865713397468,scale:9027.977411}),new a({level:17,resolution:1.19432856685505,scale:4513.988705}),new a({level:18,resolution:.597164283559817,scale:2256.994353}),new a({level:19,resolution:.298582141647617,scale:1128.497176}),new a({level:20,resolution:.1492910708238085,scale:564.248588})]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],n=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",n).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return h(`${O}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return h(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let n=e;n>0;n--){let p=0;const g=1<({minX:s[0],minY:s[1],maxX:s[2],maxY:s[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const s=new Array(this._idByBounds.size);let d=0;this._idByBounds.forEach((n,e)=>{s[d++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(s)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(s=>this._idByBounds.has(s))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const s=h();for(const d of this._boundsById.values())d&&(s[0]=Math.min(d[0],s[0]),s[1]=Math.min(d[1],s[1]),s[2]=Math.max(d[2],s[2]),s[3]=Math.max(d[3],s[3]));return s}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(s){const d=this._boundsById.get(s);this._boundsById.delete(s),d&&(this._idByBounds.delete(d),this._indexInvalid||this._index.remove(d))}forEachInBounds(s,d){this._loadIndex(),l(this._index,s,n=>d(this._idByBounds.get(n)))}get(s){return this._boundsById.get(s)}has(s){return this._boundsById.has(s)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(s,d){if(!this._indexInvalid){const n=this._boundsById.get(s);n&&(this._index.remove(n),this._idByBounds.delete(n))}this._boundsById.set(s,d),d&&(this._idByBounds.set(d,s),this._indexInvalid||(this._boundsToLoad.push(d),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as o}; diff --git a/dist/assets/Box-gJ8-sOXE.js b/dist/assets/Box-gJ8-sOXE.js new file mode 100644 index 0000000..a3d3706 --- /dev/null +++ b/dist/assets/Box-gJ8-sOXE.js @@ -0,0 +1 @@ +import{l as B,N as K,hp as P,T as v,hq as nt,J as S,bX as D,a8 as ct,K as lt,L as Q,ae as k,R as U,af as F,F as pt,d as b,n as V,S as R,I as _t,e as d,y as g,_ as ut,A as dt,P as gt,c as vt}from"./index-J0iiHjMT.js";import{i as x,s as O,a as mt,m as yt}from"./drawUtils-woTYaREB.js";import{l as ft,U as Gt}from"./GraphicMover-DhG5Ib7v.js";import{d as bt}from"./settings-YeKUIkGh.js";import{i as xt,p as wt}from"./ExtentTooltipInfos-LPjFe37b.js";import{u as q,m as z}from"./Tooltip-ON77BKb3.js";import{r as St}from"./TranslateTooltipInfos-J6BygtUO.js";import"./featureUtils-itZGjo5c.js";import"./GraphicManipulator-ku6oRBpa.js";import"./drapedUtils-9db1OpTX.js";import"./euclideanLengthMeasurementUtils-VQw5qWk6.js";import"./measurementUtils-84-ZBArh.js";import"./quantityFormatUtils-NiAiojad.js";function L(t,i,e,s){const o=[];for(const a of t){const h=a.slice(0);o.push(h);const c=i*(a[0]-s.x)-e*(a[1]-s.y)+s.x,r=e*(a[0]-s.x)+i*(a[1]-s.y)+s.y;h[0]=c,h[1]=r}return o}function H(t,i,e){const{hasM:s,hasZ:o,spatialReference:a}=t,h=i*Math.PI/180,c=Math.cos(h),r=Math.sin(h);if("xmin"in t&&(e=e??t.center,t=new B({spatialReference:a,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})),"paths"in t){e=e??t.extent.center;const l=[];for(const n of t.paths)l.push(L(n,c,r,e));return new K({hasM:s,hasZ:o,spatialReference:a,paths:l})}if("rings"in t){e=e??t.extent.center;const l=[];for(const n of t.rings){const p=P(n),m=L(n,c,r,e);P(m)!==p&&m.reverse(),l.push(m)}return new B({hasM:s,hasZ:o,spatialReference:a,rings:l})}if("x"in t){e=e??t;const l=new v({x:c*(t.x-e.x)-r*(t.y-e.y)+e.x,y:r*(t.x-e.x)+c*(t.y-e.y)+e.y,spatialReference:a});return t.z!=null&&(l.z=t.z),t.m!=null&&(l.m=t.m),l}return"points"in t?(e=e??t.extent.center,new nt({hasM:s,hasZ:o,points:L(t.points,c,r,e),spatialReference:a})):null}class kt{constructor(i,e,s,o){this.graphics=i,this.mover=e,this.dx=s,this.dy=o,this.type="move-start"}}class Rt{constructor(i,e,s,o){this.graphics=i,this.mover=e,this.dx=s,this.dy=o,this.type="move"}}class Z{constructor(i,e,s,o){this.graphics=i,this.mover=e,this.dx=s,this.dy=o,this.type="move-stop"}}class Mt{constructor(i,e,s){this.graphics=i,this.mover=e,this.angle=s,this.type="rotate-start"}}class It{constructor(i,e,s){this.graphics=i,this.mover=e,this.angle=s,this.type="rotate"}}class j{constructor(i,e,s){this.graphics=i,this.mover=e,this.angle=s,this.type="rotate-stop"}}class Ct{constructor(i,e,s,o){this.graphics=i,this.mover=e,this.xScale=s,this.yScale=o,this.type="scale-start"}}class Ot{constructor(i,e,s,o){this.graphics=i,this.mover=e,this.xScale=s,this.yScale=o,this.type="scale"}}class J{constructor(i,e,s,o){this.graphics=i,this.mover=e,this.xScale=s,this.yScale=o,this.type="scale-stop"}}const _=bt.transformGraphics,Ht={centerIndicator:new S({style:"cross",size:_.center.size,color:_.center.color}),fill:{default:new D({color:_.fill.color,outline:{color:_.fill.outlineColor,join:"round",width:1}}),active:new D({color:_.fill.stagedColor,outline:{color:_.fill.outlineColor,join:"round",style:"dash",width:1}})},handles:{default:new S({style:"square",size:_.vertex.size,color:_.vertex.color,outline:{color:_.vertex.outlineColor,width:1}}),hover:new S({style:"square",size:_.vertex.hoverSize,color:_.vertex.hoverColor,outline:{color:_.vertex.hoverOutlineColor,width:1}})},rotator:{default:new S({style:"circle",size:_.vertex.size,color:_.vertex.color,outline:{color:_.vertex.outlineColor,width:1}}),hover:new S({style:"circle",size:_.vertex.hoverSize,color:_.vertex.hoverColor,outline:{color:_.vertex.hoverOutlineColor,width:1}})},rotatorLine:new ct({color:_.line.color,width:1})};let u=class extends lt.EventedAccessor{constructor(t){super(t),this._activeHandleGraphic=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._centerGraphic=null,this._backgroundGraphic=null,this._vertexGraphics=[],this._rotateHandleGraphic=null,this._rotateGraphicOffset=20,this._angleOfRotation=0,this._rotateLineGraphic=null,this._startInfo=null,this._tooltip=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this.type="box",this.callbacks={onMoveStart(){},onMove(){},onMoveStop(){},onScaleStart(){},onScale(){},onScaleStop(){},onRotateStart(){},onRotate(){},onRotateStop(){},onGraphicClick(){}},this.enableMovement=!0,this.enableRotation=!0,this.enableScaling=!0,this.graphics=[],this.highlightsEnabled=!0,this.layer=null,this.preserveAspectRatio=!1,this.showCenterGraphic=!0,this.symbols=Ht,this.tooltipOptions=new Q,this.view=null,this._getBounds=(()=>{const i=k();return(e,s)=>{e[0]=Number.POSITIVE_INFINITY,e[1]=Number.POSITIVE_INFINITY,e[2]=Number.NEGATIVE_INFINITY,e[3]=Number.NEGATIVE_INFINITY;for(const o of s){if(!o)continue;let a,h,c,r;if(o.type==="point")a=c=o.x,h=r=o.y;else if(o.type==="multipoint"){const l=U(o);[a,h,c,r]=F(i,[l])}else if(o.type==="extent")[a,h,c,r]=[o.xmin,o.ymin,o.xmax,o.ymax];else{const l=U(o);[a,h,c,r]=F(i,l)}e[0]=Math.min(a,e[0]),e[1]=Math.min(h,e[1]),e[2]=Math.max(c,e[2]),e[3]=Math.max(r,e[3])}return e}})()}initialize(){const t=this.view;this._highlightHelper=new ft({view:t}),this._tooltip=new q({view:t}),this._setup(),this.addHandles([pt(()=>t==null?void 0:t.ready,()=>{const{layer:i,view:e}=this;ut(e,i)},{once:!0,initial:!0}),b(()=>this.preserveAspectRatio,()=>{this._activeHandleGraphic&&(this._scaleGraphic(this._activeHandleGraphic),this._updateGraphics(),this._updateTooltip(this._activeHandleGraphic))}),b(()=>t==null?void 0:t.scale,()=>{this._updateRotateGraphic(),this._updateRotateLineGraphic()}),b(()=>this.graphics,()=>this.refresh()),b(()=>this.layer,(i,e)=>{e&&this._resetGraphics(e),this.refresh()}),b(()=>this.highlightsEnabled,()=>{var i;(i=this._highlightHelper)==null||i.removeAll(),this._setUpHighlights()}),b(()=>this.tooltipOptions.enabled,i=>{this._tooltip=i?new q({view:this.view}):V(this._tooltip)},dt),b(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),gt),this.on("move-start",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onMoveStart)==null?void 0:s.call(e,i)}),this.on("move",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onMove)==null?void 0:s.call(e,i)}),this.on("move-stop",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onMoveStop)==null?void 0:s.call(e,i)}),this.on("rotate-start",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onRotateStart)==null?void 0:s.call(e,i)}),this.on("rotate",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onRotate)==null?void 0:s.call(e,i)}),this.on("rotate-stop",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onRotateStop)==null?void 0:s.call(e,i)}),this.on("scale-start",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onScaleStart)==null?void 0:s.call(e,i)}),this.on("scale",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onScale)==null?void 0:s.call(e,i)}),this.on("scale-stop",i=>{var e,s;return(s=(e=this.callbacks)==null?void 0:e.onScaleStop)==null?void 0:s.call(e,i)})])}destroy(){this._reset(),this._tooltip=V(this._tooltip)}get state(){var e;const t=((e=this.view)==null?void 0:e.ready)??!1,i=this.graphics.length&&this.layer;return t&&i?"active":t?"ready":"disabled"}isUIGraphic(t){return this._vertexGraphics.includes(t)||t===this._backgroundGraphic||t===this._centerGraphic||t===this._rotateHandleGraphic||t===this._rotateLineGraphic}move(t,i){if(this._mover&&this.graphics.length){for(const e of this.graphics){const s=e.geometry,o=x(s,t,i,this.view);e.geometry=o}this.refresh(),this.emit("move-stop",new Z(this.graphics,null,t,i))}}scale(t,i){if(this._mover&&this.graphics.length){for(const e of this.graphics){const s=e.geometry,o=O(s,t,i);e.geometry=o}this.refresh(),this.emit("scale-stop",new J(this.graphics,null,t,i))}}rotate(t,i){if(this._mover&&this.graphics.length){if(!i){const e=this._vertexGraphics[1].geometry.x,s=this._vertexGraphics[3].geometry.y;i=new v(e,s,this.view.spatialReference)}for(const e of this.graphics){const s=e.geometry,o=H(s,t,i);e.geometry=o}this.refresh(),this.emit("rotate-stop",new j(this.graphics,null,t))}}refresh(){this._reset(),this._setup()}reset(){this.graphics=[]}_setup(){this.state==="active"&&(this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._updateGraphics())}_reset(){var t;(t=this._highlightHelper)==null||t.removeAll(),this._resetGraphicStateVars(),this._resetGraphics(),this._updateTooltip(),this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetGraphicStateVars(){this._startInfo=null,this._activeHandleGraphic=null,this._totalDx=0,this._totalDy=0,this._xScale=1,this._yScale=1,this._angleOfRotation=0}_resetGraphics(t){(t=t||this.layer)&&(t.removeMany(this._vertexGraphics),t.remove(this._backgroundGraphic),t.remove(this._centerGraphic),t.remove(this._rotateHandleGraphic),t.remove(this._rotateLineGraphic)),this._vertexGraphics=[],this._backgroundGraphic=null,this._centerGraphic=null,this._rotateHandleGraphic=null,this._rotateLineGraphic=null}_setupMover(){let t=[];this.enableScaling&&(t=t.concat(this._vertexGraphics)),this.enableMovement&&(t=t.concat(this.graphics,this._backgroundGraphic)),this.enableRotation&&t.push(this._rotateHandleGraphic),this.showCenterGraphic&&t.push(this._centerGraphic),this._mover=new Gt({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,view:this.view,graphics:t,callbacks:{onGraphicClick:i=>this._onGraphicClickCallback(i),onGraphicMoveStart:i=>this._onGraphicMoveStartCallback(i),onGraphicMove:i=>this._onGraphicMoveCallback(i),onGraphicMoveStop:i=>this._onGraphicMoveStopCallback(i),onGraphicPointerOver:i=>this._onGraphicPointerOverCallback(i),onGraphicPointerOut:i=>this._onGraphicPointerOutCallback(i)}})}_getStartInfo(t){const[i,e,s,o]=this._getBoxBounds(k()),a=Math.abs(s-i),h=Math.abs(o-e),c=(s+i)/2,r=(o+e)/2,{x:l,y:n}=t.geometry;return{width:a,height:h,centerX:c,centerY:r,startX:l,startY:n,graphicInfos:this._getGraphicInfos(),box:this._backgroundGraphic.geometry,rotate:this._rotateHandleGraphic.geometry}}_getGraphicInfos(){return this.graphics.map(t=>this._getGraphicInfo(t))}_getGraphicInfo(t){const i=t.geometry,[e,s,o,a]=this._getBounds(k(),[i]);return{width:Math.abs(o-e),height:Math.abs(a-s),centerX:(o+e)/2,centerY:(a+s)/2,geometry:i}}_onGraphicClickCallback(t){t.viewEvent.stopPropagation(),this.emit("graphic-click",t),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(t)}_onGraphicMoveStartCallback(t){const{_angleOfRotation:i,_xScale:e,_yScale:s,_backgroundGraphic:o,_vertexGraphics:a,_rotateHandleGraphic:h,symbols:c}=this,r=t.graphic;this._resetGraphicStateVars(),this._hideGraphicsBeforeUpdate(),o.symbol=c.fill.active,this._startInfo=this._getStartInfo(r),this._updateTooltip(r,t.viewEvent),r===h?(this.view.cursor="grabbing",this.emit("rotate-start",new Mt(this.graphics,r,i))):a.includes(r)?(this._activeHandleGraphic=r,this.emit("scale-start",new Ct(this.graphics,r,e,s))):this.emit("move-start",new kt(this.graphics,r,t.dx,t.dy))}_onGraphicMoveCallback(t){const i=t.graphic;if(this._startInfo)if(this._vertexGraphics.includes(i))this._scaleGraphic(i),this._updateTooltip(i,t.viewEvent),this.emit("scale",new Ot(this.graphics,i,this._xScale,this._yScale));else if(i===this._rotateHandleGraphic)this._rotateGraphic(i),this._updateTooltip(i,t.viewEvent),this.emit("rotate",new It(this.graphics,i,this._angleOfRotation));else{const{dx:e,dy:s}=t;this._totalDx+=e,this._totalDy+=s,this._moveGraphic(i,e,s),this._updateTooltip(i,t.viewEvent),this.emit("move",new Rt(this.graphics,i,e,s))}}_onGraphicMoveStopCallback(t){const i=t.graphic;if(!this._startInfo)return void this.refresh();const{_angleOfRotation:e,_totalDx:s,_totalDy:o,_xScale:a,_yScale:h,_vertexGraphics:c,_rotateHandleGraphic:r}=this;this.refresh(),i===r?(this.view.cursor="pointer",this.emit("rotate-stop",new j(this.graphics,i,e))):c.includes(i)?this.emit("scale-stop",new J(this.graphics,i,a,h)):this.emit("move-stop",new Z(this.graphics,i,s,o))}_onGraphicPointerOverCallback(t){const{_backgroundGraphic:i,_vertexGraphics:e,graphics:s,_rotateHandleGraphic:o,symbols:a,view:h}=this,c=t.graphic;if(this._hoveredGraphic=c,c===o)return o.symbol=a.rotator.hover,h.cursor="pointer",void this._updateTooltip(c);if(s.includes(c)||c===i)return void(h.cursor="move");if(!e.includes(c))return void(h.cursor="pointer");this._updateTooltip(c),t.graphic.symbol=a.handles.hover;const r=h.rotation;let l,n=t.index;switch(n<8&&(r>=0&&r<45?n%=8:n=r>=45&&r<90?(n+1)%8:r>=90&&r<135?(n+2)%8:r>=135&&r<180?(n+3)%8:r>=180&&r<225?(n+4)%8:r>=225&&r<270?(n+5)%8:r>=270&&r<315?(n+6)%8:(n+7)%8),n){case 0:case 4:l="nwse-resize";break;case 1:case 5:l="ns-resize";break;case 2:case 6:l="nesw-resize";break;case 3:case 7:l="ew-resize";break;default:l="pointer"}h.cursor=l}_onGraphicPointerOutCallback(t){const{_vertexGraphics:i,_rotateHandleGraphic:e,symbols:s,view:o}=this;this._hoveredGraphic=null,t.graphic===e?e.symbol=s.rotator.default:i.includes(t.graphic)&&(t.graphic.symbol=s.handles.default),o.cursor="default",this._updateTooltip()}_scaleGraphic(t){var Y;const{_startInfo:i,_vertexGraphics:e,preserveAspectRatio:s,view:o}=this,{centerX:a,centerY:h,startX:c,startY:r}=i,{resolution:l,transform:n}=o.state,p=e.indexOf(t);p!==1&&p!==5||this._updateX(t,a),p!==3&&p!==7||this._updateY(t,h);const{x:m,y}=t.geometry,T=n[0]*m+n[2]*y+n[4],$=n[1]*m+n[3]*y+n[5],M=((Y=i.graphicInfos)==null?void 0:Y.map(w=>w.geometry))??[];if(s){const w=n[0]*a+n[2]*h+n[4],I=n[1]*a+n[3]*h+n[5],f=n[0]*c+n[2]*r+n[4],G=n[1]*c+n[3]*r+n[5];this._xScale=this._yScale=mt(w,I,f,G,T,$);for(const C of M){const E=M.indexOf(C);this.graphics[E].geometry=O(C,this._xScale,this._yScale,[a,h])}this._updateBackgroundGraphic()}else{const{width:w,height:I}=i;let f=m-c,G=r-y;if(p===1||p===5?f=0:p!==3&&p!==7||(G=0),f===0&&G===0)return;const C=w+(c>a?f:-1*f),E=I+(ry.geometry))??[];for(const y of p){const T=p.indexOf(y),$=H(y,this._angleOfRotation,l);this.graphics[T].geometry=$}this._backgroundGraphic.geometry=H(a,this._angleOfRotation,l),this._rotateHandleGraphic.geometry=H(h,this._angleOfRotation,l)}_moveGraphic(t,i,e){if(this.graphics.includes(t)){const s=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=x(s,i,e,this.view);for(const o of this.graphics)o!==t&&(o.geometry=x(o.geometry,i,e,this.view))}else if(t===this._centerGraphic){const s=this._backgroundGraphic.geometry;this._backgroundGraphic.geometry=x(s,i,e,this.view)}if(t===this._backgroundGraphic||t===this._centerGraphic)for(const s of this.graphics)s.geometry=x(s.geometry,i,e,this.view)}_setUpHighlights(){var t;this.highlightsEnabled&&this.graphics.length&&((t=this._highlightHelper)==null||t.add(this.graphics))}_setupGraphics(){const{_graphicAttributes:t,symbols:i}=this;this._centerGraphic=new R(null,i.centerIndicator,t),this.showCenterGraphic&&this.layer.add(this._centerGraphic),this._backgroundGraphic=new R(null,i.fill.default,t),this.layer.add(this._backgroundGraphic),this._rotateLineGraphic=new R(null,i.rotatorLine,t),this._rotateHandleGraphic=new R(null,i.rotator.default,t),this.enableRotation&&!this._hasExtentGraphic()&&this.layer.addMany([this._rotateLineGraphic,this._rotateHandleGraphic]);for(let e=0;e<8;e++)this._vertexGraphics.push(new R(null,i.handles.default,t));this.enableScaling&&this.layer.addMany(this._vertexGraphics)}_updateSymbolsForTheme(){var i,e;const t=this.view.effectiveTheme.accentColor;this.symbols={...this.symbols,fill:{active:(i=this.symbols.fill.active)==null?void 0:i.clone().set("outline.color",t),default:(e=this.symbols.fill.default)==null?void 0:e.clone().set("outline.color",t)},handles:{...this.symbols.handles,default:this.symbols.handles.default.clone().set("outline.color",t)},rotator:{...this.symbols.rotator,default:this.symbols.rotator.default.clone().set("outline.color",t)},rotatorLine:this.symbols.rotatorLine.clone().set("color",t)};for(const s of this._vertexGraphics)s.symbol=s===this._hoveredGraphic?this.symbols.handles.hover:this.symbols.handles.default;this._backgroundGraphic.symbol=this.symbols.fill.default,this._rotateHandleGraphic.symbol=this._rotateHandleGraphic===this._hoveredGraphic?this.symbols.rotator.hover:this.symbols.rotator.default,this._rotateLineGraphic.symbol=this.symbols.rotatorLine}_updateGraphics(){this._updateBackgroundGraphic(),this._updateHandleGraphics(),this._updateCenterGraphic(),this._updateRotateGraphic(),this._updateRotateLineGraphic()}_hideGraphicsBeforeUpdate(){this._centerGraphic.visible=!1,this._rotateHandleGraphic.visible=!1,this._rotateLineGraphic.visible=!1,this._vertexGraphics.forEach(t=>t.visible=!1)}_updateHandleGraphics(){const t=this._getCoordinates(!0);this._vertexGraphics.forEach((i,e)=>{const[s,o]=t[e];this._updateXY(i,s,o)})}_updateBackgroundGraphic(){const t=this._getCoordinates();this._backgroundGraphic.geometry=new B({rings:t,spatialReference:this.view.spatialReference})}_updateCenterGraphic(){const[t,i,e,s]=this._getBoxBounds(k()),o=(e+t)/2,a=(s+i)/2;this._centerGraphic.geometry=new v(o,a,this.view.spatialReference)}_updateRotateGraphic(){if(!this._vertexGraphics.length)return;const{x:t,y:i}=this._vertexGraphics[1].geometry,e=i+this.view.state.resolution*this._rotateGraphicOffset;this._rotateHandleGraphic.geometry=new v(t,e,this.view.spatialReference)}_updateRotateLineGraphic(){var e;if(!this._vertexGraphics.length||!((e=this._rotateHandleGraphic)!=null&&e.geometry))return;const t=this._vertexGraphics[1].geometry,i=this._rotateHandleGraphic.geometry;this._rotateLineGraphic.geometry=new K({paths:[[t.x,t.y],[i.x,i.y]],spatialReference:this.view.spatialReference})}_updateXY(t,i,e){t.geometry=new v(i,e,this.view.spatialReference)}_updateX(t,i){const e=t.geometry.y;t.geometry=new v(i,e,this.view.spatialReference)}_updateY(t,i){const e=t.geometry.x;t.geometry=new v(e,i,this.view.spatialReference)}_hasExtentGraphic(){return this.graphics.some(t=>(t==null?void 0:t.geometry)!=null&&t.geometry.type==="extent")}_getBoxBounds(t){const i=this.graphics.map(e=>e.geometry);return this._getBounds(t,i)}_getCoordinates(t){const[i,e,s,o]=this._getBoxBounds(k());if(t){const a=(i+s)/2,h=(o+e)/2;return[[i,o],[a,o],[s,o],[s,h],[s,e],[a,e],[i,e],[i,h]]}return[[i,o],[s,o],[s,e],[i,e]]}_updateTooltip(t,i){if(this._tooltip==null)return;if(!t)return void this._tooltip.clear();const{_backgroundGraphic:e,graphics:s,_vertexGraphics:o,_rotateHandleGraphic:a}=this;t===a?this._updateRotateTooltip():o.includes(t)?this._updateScaleTooltip():(s.includes(t)||t===e)&&this._updateMoveTooltip(i)}_updateRotateTooltip(){this._tooltip!=null&&(this._tooltip.info=new xt({tooltipOptions:this.tooltipOptions,angle:-this._angleOfRotation}))}_updateScaleTooltip(){const{_tooltip:t,_xScale:i,_yScale:e,tooltipOptions:s,view:o}=this;if(t==null)return;const a=o.spatialReference,h=this._getCoordinates(),c=new v(h[0][0],h[0][1],a),r=new v(h[1][0],h[1][1],a),l=new v(h[2][0],h[2][1],a),n=z(c,r),p=z(r,l);if(n==null||p==null)return;const m=Math.abs(i),y=Math.abs(e);t.info=new wt({tooltipOptions:s,xScale:m,yScale:y,xSize:n,ySize:p})}_updateMoveTooltip(t){const{_tooltip:i,tooltipOptions:e,view:s}=this;if(i==null)return;const o=new St({tooltipOptions:e});if(t){const{x:a,y:h}=t.origin,c=s.toMap(t),r=s.toMap({x:a,y:h}),l=z(r,c);o.distance=l??_t}i.info=o}};d([g()],u.prototype,"_tooltip",void 0),d([g({readOnly:!0})],u.prototype,"type",void 0),d([g()],u.prototype,"callbacks",void 0),d([g()],u.prototype,"enableMovement",void 0),d([g()],u.prototype,"enableRotation",void 0),d([g()],u.prototype,"enableScaling",void 0),d([g()],u.prototype,"graphics",void 0),d([g()],u.prototype,"highlightsEnabled",void 0),d([g()],u.prototype,"layer",void 0),d([g()],u.prototype,"preserveAspectRatio",void 0),d([g()],u.prototype,"showCenterGraphic",void 0),d([g({readOnly:!0})],u.prototype,"state",null),d([g()],u.prototype,"symbols",void 0),d([g({type:Q})],u.prototype,"tooltipOptions",void 0),d([g({constructOnly:!0})],u.prototype,"view",void 0),u=d([vt("esri.views.draw.support.Box")],u);const Ft=u;export{Ft as default}; diff --git a/dist/assets/BuildingComponentSublayer-j8wian8V.js b/dist/assets/BuildingComponentSublayer-j8wian8V.js new file mode 100644 index 0000000..f7eebde --- /dev/null +++ b/dist/assets/BuildingComponentSublayer-j8wian8V.js @@ -0,0 +1 @@ +import{m,e as t,y as r,dt as y,ey as v,ih as u,c as h,ii as b,Z as L,ij as w,cZ as F,eQ as I,ik as S,il as O,bW as j,im as x,ca as T,fH as q,fI as $,fG as E,io as Q,E as p,S as P,ip as A,iq as D,ir as N,is as R,dT as U,ar as _,hs as B,it as C,iu as Z,iv as M,iw as K,dp as k,ix as G}from"./index-J0iiHjMT.js";import g from"./FeatureLayer--S4epFk-.js";let n=class extends m(b){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,this.visible=!0,this.opacity=1}readTitle(e,s){return typeof s.alias=="string"?s.alias:typeof s.name=="string"?s.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([r({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],n.prototype,"title",void 0),t([y("service","title",["alias","name"])],n.prototype,"readTitle",null),t([r()],n.prototype,"layer",void 0),t([r({type:v,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),t([y("service","id")],n.prototype,"readIdOnlyOnce",null),t([r(u(String))],n.prototype,"modelName",void 0),t([r(u(Boolean))],n.prototype,"isEmpty",void 0),t([r({type:Boolean,nonNullable:!0})],n.prototype,"legendEnabled",void 0),t([r({type:Boolean,json:{name:"visibility",write:!0}})],n.prototype,"visible",void 0),t([r({type:Number,json:{write:!0}})],n.prototype,"opacity",void 0),n=t([h("esri.layers.buildingSublayers.BuildingSublayer")],n);const V=n,f="esri.layers.buildingSublayers.BuildingComponentSublayer",H=L.getLogger(f),c=G();let i=class extends w.LoadableMixin(F(V)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){var e,s;return this.layer?{path:`${(e=this.layer.parsedUrl)==null?void 0:e.path}/sublayers/${this.id}`,query:(s=this.layer.parsedUrl)==null?void 0:s.query}:{path:""}}get fieldsIndex(){return new I(this.fields)}readAssociatedLayer(e,s){const a=this.layer.associatedFeatureServiceItem,o=s.associatedLayerID;return a!=null&&typeof o=="number"?new g({portalItem:a,layerId:o}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const s=e!=null?e.signal:null,a=this._fetchService(s).then(()=>{this.indexInfo=S(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,H,s)});return this.addResolvingPromise(a),Promise.resolve(this)}createPopupTemplate(e){return O(this,e)}async _fetchService(e){const s=(await j(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(s,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,s){var o,l,d;const a=(l=(o=this.getFeatureType(s==null?void 0:s.feature))==null?void 0:o.domains)==null?void 0:l[e];return a&&a.type!=="inherited"?a:((d=this.getField(e))==null?void 0:d.domain)??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:x,{query:s,data:{supportsZ:a,supportsM:o,isVersioned:l}}=e;return{query:s,data:{supportsZ:a,supportsM:o,isVersioned:l}}}createQuery(){const e=new T;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,s){return this._getAssociatedLayerForQuery().then(a=>a.queryExtent(e||this.createQuery(),s))}queryFeatureCount(e,s){return this._getAssociatedLayerForQuery().then(a=>a.queryFeatureCount(e||this.createQuery(),s))}queryFeatures(e,s){return this._getAssociatedLayerForQuery().then(a=>a.queryFeatures(e||this.createQuery(),s)).then(a=>{if(a!=null&&a.features)for(const o of a.features)o.layer=this.layer,o.sourceLayer=this;return a})}queryObjectIds(e,s){return this._getAssociatedLayerForQuery().then(a=>a.queryObjectIds(e||this.createQuery(),s))}async queryCachedAttributes(e,s){const a=q(this.fieldsIndex,await $(this,E(this)));return Q(this.parsedUrl.path,this.attributeStorageInfo,e,s,a)}async queryCachedFeature(e,s){const a=await this.queryCachedAttributes(e,[s]);if(!a||a.length===0)throw new p("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const o=new P;return o.attributes=a[0],o.layer=this,o.sourceLayer=this,o}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new p("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new p("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r({type:A,readOnly:!0})],i.prototype,"nodePages",void 0),t([r({type:[D],readOnly:!0})],i.prototype,"materialDefinitions",void 0),t([r({type:[N],readOnly:!0})],i.prototype,"textureSetDefinitions",void 0),t([r({type:[R],readOnly:!0})],i.prototype,"geometryDefinitions",void 0),t([r({readOnly:!0})],i.prototype,"serviceUpdateTimeStamp",void 0),t([r({readOnly:!0})],i.prototype,"store",void 0),t([r({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],i.prototype,"rootNode",void 0),t([r({readOnly:!0})],i.prototype,"attributeStorageInfo",void 0),t([r(c.fields)],i.prototype,"fields",void 0),t([r({readOnly:!0})],i.prototype,"fieldsIndex",null),t([r({readOnly:!0,type:g})],i.prototype,"associatedLayer",void 0),t([y("service","associatedLayer",["associatedLayerID"])],i.prototype,"readAssociatedLayer",null),t([r(c.outFields)],i.prototype,"outFields",void 0),t([r({type:String,readOnly:!0})],i.prototype,"objectIdField",null),t([r({readOnly:!0,type:String,json:{read:!1}})],i.prototype,"displayField",null),t([r({readOnly:!0,type:String})],i.prototype,"apiKey",null),t([r({readOnly:!0,type:U})],i.prototype,"fullExtent",null),t([r({readOnly:!0,type:_})],i.prototype,"spatialReference",null),t([r({readOnly:!0})],i.prototype,"version",null),t([r({readOnly:!0,type:B})],i.prototype,"elevationInfo",null),t([r({readOnly:!0,type:Number})],i.prototype,"minScale",null),t([r({readOnly:!0,type:Number})],i.prototype,"maxScale",null),t([r({readOnly:!0,type:Number})],i.prototype,"effectiveScaleRange",null),t([r({type:["hide","show"],json:{write:!0}})],i.prototype,"listMode",void 0),t([r({types:C,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],i.prototype,"renderer",void 0),t([r({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r(Z)],i.prototype,"popupEnabled",void 0),t([r({type:M,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],i.prototype,"popupTemplate",void 0),t([r({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],i.prototype,"normalReferenceFrame",void 0),t([r({readOnly:!0,json:{read:!1}})],i.prototype,"defaultPopupTemplate",null),t([r()],i.prototype,"types",null),t([r()],i.prototype,"typeIdField",null),t([r({json:{write:!1}}),K(new k({"3DObject":"3d-object",Point:"point"}))],i.prototype,"layerType",void 0),t([r()],i.prototype,"geometryType",null),t([r()],i.prototype,"profile",null),t([r({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",null),i=t([h(f)],i);const J=i;export{J as C,V as n}; diff --git a/dist/assets/BuildingGroupSublayer-xf_JzVTh.js b/dist/assets/BuildingGroupSublayer-xf_JzVTh.js new file mode 100644 index 0000000..59061a2 --- /dev/null +++ b/dist/assets/BuildingGroupSublayer-xf_JzVTh.js @@ -0,0 +1 @@ +import{e as i,y as l,c,V as p,dm as b,dn as g}from"./index-J0iiHjMT.js";import{n as h,C as f}from"./BuildingComponentSublayer-j8wian8V.js";var a;const y={type:p,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:d}}},read:!1}};function d(e,o,s){if(e&&Array.isArray(e))return new p(e.map(r=>{const u=m(r);if(u){const t=new u;return t.read(r,s),t}return s!=null&&s.messages&&r&&s.messages.push(new b("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(r.type||"unknown")+"' are not supported",{definition:r,context:s})),null}))}let n=a=class extends h{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return g(this,e=>a.forEachSublayer(this.sublayers,o=>{o.type!=="building-group"&&e(o)}))}};function m(e){return e.layerType==="group"?n:f}i([l({type:["hide","show","hide-children"],json:{write:!0}})],n.prototype,"listMode",void 0),i([l(y)],n.prototype,"sublayers",void 0),n=a=i([c("esri.layers.buildingSublayers.BuildingGroupSublayer")],n),function(e){function o(s,r){s.forEach(u=>{r(u),u.type==="building-group"&&o(u.sublayers,r)})}e.sublayersProperty=y,e.readSublayers=d,e.forEachSublayer=o}(n||(n={}));const v=n;export{v as d}; diff --git a/dist/assets/BuildingSceneLayer-YaRBOuhA.js b/dist/assets/BuildingSceneLayer-YaRBOuhA.js new file mode 100644 index 0000000..ad1a230 --- /dev/null +++ b/dist/assets/BuildingSceneLayer-YaRBOuhA.js @@ -0,0 +1 @@ +import{e as t,y as s,c as a,dr as u,bI as y,V as j,iw as D,qb as G,p5 as Y,ij as ee,cZ as te,Z as b,bW as re,iO as se,em as ie,dM as oe,dN as le,dO as ae,dP as ne,en as pe,fP as ye,E as P,h6 as de,dQ as ue,ew as ce,iP as q,di as he,iQ as V,iR as ge,iS as ve,dt as K,qc as me,dV as fe,ih as be,iH as Se,c7 as we,ar as $e}from"./index-J0iiHjMT.js";import{C}from"./BuildingComponentSublayer-j8wian8V.js";import{d as c}from"./BuildingGroupSublayer-xf_JzVTh.js";import"./FeatureLayer--S4epFk-.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./queryZScale-IaMm02_2.js";import"./FeatureSet-d4S1oKME.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";import"./TopFeaturesQuery-E6D2tV-x.js";let S=class extends u{constructor(){super(...arguments),this.type=null}};t([s({type:String,readOnly:!0,json:{write:!0}})],S.prototype,"type",void 0),S=t([a("esri.layers.support.BuildingFilterAuthoringInfo")],S);const W=S;var T;let g=T=class extends u{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new T({filterType:this.filterType,filterValues:y(this.filterValues)})}};t([s({type:String,json:{write:!0}})],g.prototype,"filterType",void 0),t([s({type:[String],json:{write:!0}})],g.prototype,"filterValues",void 0),g=T=t([a("esri.layers.support.BuildingFilterAuthoringInfoType")],g);const Oe=g;var F;const xe=j.ofType(Oe);let w=F=class extends u{clone(){return new F({filterTypes:y(this.filterTypes)})}};t([s({type:xe,json:{write:!0}})],w.prototype,"filterTypes",void 0),w=F=t([a("esri.layers.support.BuildingFilterAuthoringInfoBlock")],w);const je=w;var _;const Be=j.ofType(je);let v=_=class extends W{constructor(){super(...arguments),this.type="checkbox"}clone(){return new _({filterBlocks:y(this.filterBlocks)})}};t([s({type:["checkbox"]})],v.prototype,"type",void 0),t([s({type:Be,json:{write:!0}})],v.prototype,"filterBlocks",void 0),v=_=t([a("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],v);const H=v;let $=class extends u{};t([s({readOnly:!0,json:{read:!1}})],$.prototype,"type",void 0),$=t([a("esri.layers.support.BuildingFilterMode")],$);const B=$;var A;let O=A=class extends B{constructor(){super(...arguments),this.type="solid"}clone(){return new A}};t([s({type:["solid"],readOnly:!0,json:{write:!0}})],O.prototype,"type",void 0),O=A=t([a("esri.layers.support.BuildingFilterModeSolid")],O);const E=O;var k;let m=k=class extends B{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new k({edges:y(this.edges)})}};t([D({wireFrame:"wire-frame"})],m.prototype,"type",void 0),t([s(G)],m.prototype,"edges",void 0),m=k=t([a("esri.layers.support.BuildingFilterModeWireFrame")],m);const J=m;var L;let x=L=class extends B{constructor(){super(...arguments),this.type="x-ray"}clone(){return new L}};t([s({type:["x-ray"],readOnly:!0,json:{write:!0}})],x.prototype,"type",void 0),x=L=t([a("esri.layers.support.BuildingFilterModeXRay")],x);const U=x;var M;const Ie={nonNullable:!0,types:{key:"type",base:B,typeMap:{solid:E,"wire-frame":J,"x-ray":U}},json:{read:e=>{switch(e==null?void 0:e.type){case"solid":return E.fromJSON(e);case"wireFrame":return J.fromJSON(e);case"x-ray":return U.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let h=M=class extends u{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new E,this.title=""}clone(){return new M({filterExpression:this.filterExpression,filterMode:y(this.filterMode),title:this.title})}};t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"filterExpression",void 0),t([s(Ie)],h.prototype,"filterMode",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"title",void 0),h=M=t([a("esri.layers.support.BuildingFilterBlock")],h);const Te=h;var N;const Fe=j.ofType(Te);let d=N=class extends u{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=Y(),this.name=null}clone(){return new N({description:this.description,filterBlocks:y(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:y(this.filterAuthoringInfo)})}};t([s({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([s({type:Fe,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"filterBlocks",void 0),t([s({types:{key:"type",base:W,typeMap:{checkbox:H}},json:{read:e=>(e==null?void 0:e.type)==="checkbox"?H.fromJSON(e):null,write:!0}})],d.prototype,"filterAuthoringInfo",void 0),t([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"id",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"name",void 0),d=N=t([a("esri.layers.support.BuildingFilter")],d);const _e=d;let p=class extends u{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([s({type:String})],p.prototype,"fieldName",void 0),t([s({type:String})],p.prototype,"modelName",void 0),t([s({type:String})],p.prototype,"label",void 0),t([s({type:Number})],p.prototype,"min",void 0),t([s({type:Number})],p.prototype,"max",void 0),t([s({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],p.prototype,"mostFrequentValues",void 0),t([s({type:[Number]})],p.prototype,"subLayerIds",void 0),p=t([a("esri.layers.support.BuildingFieldStatistics")],p);let f=class extends ee.LoadableMixin(te(u)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(b.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await re(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([s({constructOnly:!0,type:String})],f.prototype,"url",void 0),t([s({readOnly:!0,type:[p],json:{read:{source:"summary"}}})],f.prototype,"fields",null),f=t([a("esri.layers.support.BuildingSummaryStatistics")],f);const Z=f,z=j.ofType(_e),X=y(c.sublayersProperty);var Q;const I=(Q=X.json)==null?void 0:Q.origins;I&&(I["web-scene"]={type:[C],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},I["portal-item"]={type:[C],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let i=class extends se(ie(oe(le(ae(ne(pe(we))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new ye({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new z,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const l=c.readSublayers(e,r,o);return c.forEachSublayer(l,n=>n.layer=this),this._sublayerOverrides&&(this.applySublayerOverrides(l,this._sublayerOverrides),this._sublayerOverrides=null),l}applySublayerOverrides(e,{overrides:r,context:o}){c.forEachSublayer(e,l=>l.read(r.get(l.id),o))}readSublayerOverrides(e,r){var l;const o=new Map;for(const n of e)n!=null&&typeof n=="object"&&typeof n.id=="number"?o.set(n.id,n):(l=r.messages)==null||l.push(new P("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:n}));return{overrides:o,context:r}}writeSublayerOverrides(e,r,o){const l=[];c.forEachSublayer(this.sublayers,n=>{const R=n.write({},o);Object.keys(R).length>1&&l.push(R)}),l.length>0&&(r.sublayers=l)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach(o=>{r.sublayers.push(y(o))})}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(r.origin==="web-scene"||r.origin==="portal-item")&&e!=null&&Array.isArray(e.sublayers)){const o=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,o):this._sublayerOverrides=o}}readSummaryStatistics(e,r){var o;if(typeof r.statisticsHRef=="string"){const l=de((o=this.parsedUrl)==null?void 0:o.path,r.statisticsHRef);return new Z({url:l})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(ue).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return ce(this,e=>{c.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(q.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(q.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new P("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await he(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){b.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";V(b.getLogger(this),ge(r,"absolute-height",e)),V(b.getLogger(this),ve(r,e))}};t([s({type:["BuildingSceneLayer"]})],i.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],i.prototype,"allSublayers",void 0),t([s(X)],i.prototype,"sublayers",void 0),t([K("service","sublayers")],i.prototype,"readSublayers",null),t([s({type:z,nonNullable:!0,json:{write:!0}})],i.prototype,"filters",void 0),t([s({type:String,json:{write:!0}})],i.prototype,"activeFilterId",void 0),t([s({readOnly:!0,type:Z})],i.prototype,"summaryStatistics",void 0),t([K("summaryStatistics",["statisticsHRef"])],i.prototype,"readSummaryStatistics",null),t([s({type:[String],json:{read:!1}})],i.prototype,"outFields",void 0),t([s(me)],i.prototype,"fullExtent",void 0),t([s(fe)],i.prototype,"legendEnabled",void 0),t([s({type:["show","hide","hide-children"]})],i.prototype,"listMode",void 0),t([s(be($e))],i.prototype,"spatialReference",void 0),t([s(Se)],i.prototype,"elevationInfo",null),t([s({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([s()],i.prototype,"associatedFeatureServiceItem",void 0),i=t([a("esri.layers.BuildingSceneLayer")],i);const Xe=i;export{Xe as default}; diff --git a/dist/assets/BuildingSceneLayerView3D-jychJ4lg.js b/dist/assets/BuildingSceneLayerView3D-jychJ4lg.js new file mode 100644 index 0000000..b673753 --- /dev/null +++ b/dist/assets/BuildingSceneLayerView3D-jychJ4lg.js @@ -0,0 +1,3 @@ +import{cZ as Q,m as P,K as A,e as n,y as a,c as _,od as O,oe as G,i6 as B,p as M,fR as N,P as F,Z as y,jV as U,nK as m,fH as E,S as b,fI as H,fG as v,fJ as W,E as x,ca as V,ai as j,fU as T,dC as k,V as S,of as z,a as D,d as $,A as I,f as X,og as K,gH as Y,bH as Z,fv as J,fi as ee}from"./index-J0iiHjMT.js";import"./BuildingGroupSublayer-xf_JzVTh.js";import{x as te}from"./WhereClause-XAMIZ4-B.js";import"./BuildingComponentSublayer-j8wian8V.js";import{E as re,c as ie,a as se}from"./I3SMeshView3D-OXYwZo0p.js";import{L as C,d as le,l as ne,o as ae}from"./I3SQueryFeatureStore-CLo7XXT-.js";import{t as oe}from"./DefinitionExpressionSceneLayerView-oAOUEjm-.js";import{n as ue}from"./LayerView3D-iOx2MD1g.js";import{u as de}from"./LayerView-efDufa6j.js";import"./TimeOnly-ljWtUK7N.js";import"./FeatureLayer--S4epFk-.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./queryZScale-IaMm02_2.js";import"./FeatureSet-d4S1oKME.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";import"./TopFeaturesQuery-E6D2tV-x.js";import"./I3SOverrides-5dCbMm3h.js";import"./I3SNode-5SPByfpU.js";import"./ReactiveSet-HLstcUcf.js";import"./meshFeatureSet-Mcou8mDC.js";import"./External-GV0jSEES.js";import"./FeatureLayerView3D-t6NDkLO0.js";import"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./EventedSet-JGlFrfoR.js";import"./RefreshableLayerView-Pd4dLcWr.js";import"./SceneModification-dyp2M_Yg.js";import"./SceneLayerWorker-o7OZRrjZ.js";const L=(e,t)=>{let r=class extends Q(P(A.EventedMixin(e))){constructor(i){super(i),this.sublayer=null,this.parent=null,this.view=null}initialize(){}get suspended(){return!this.canResume()}get updating(){return!this.suspended&&this.isUpdating()}get visible(){var i;return!!((i=this.sublayer)!=null&&i.visible)}set visible(i){this._overrideIfSome("visible",i)}get fullOpacity(){var s,l;const i=u=>u??1;return i((s=this.sublayer)==null?void 0:s.opacity)*i((l=this.parent)==null?void 0:l.fullOpacity)}canResume(){var i,s;return!((i=this.parent)!=null&&i.suspended)&&((s=this.view)==null?void 0:s.ready)&&this.visible||!1}isUpdating(){return!1}};return n([a()],r.prototype,"sublayer",void 0),n([a()],r.prototype,"parent",void 0),n([a({readOnly:!0})],r.prototype,"suspended",null),n([a({type:Boolean,readOnly:!0})],r.prototype,"updating",null),n([a()],r.prototype,"view",void 0),n([a()],r.prototype,"visible",null),n([a()],r.prototype,"fullOpacity",null),r=n([_("esri.views.3d.layers.BuildingSublayerView3D")],r),r};var p;(function(e){e[e.Solid=0]="Solid",e[e.WireFrame=1]="WireFrame",e[e.XRay=2]="XRay"})(p||(p={}));const q=.15,pe=.5*q;function he(e){switch(e.filterMode.type){case"solid":return{mode:p.Solid};case"wire-frame":return{mode:p.WireFrame,edgeMaterial:O(e.filterMode.edges,{})};case"x-ray":return{mode:p.XRay}}}function R(e,t){if(t==null)return e.color[3]=0,e.edgeMaterial=null,void(e.pickable=!1);switch(t.mode){case p.Solid:return;case p.WireFrame:return e.color[3]=0,e.edgeMaterial=t.edgeMaterial,void(e.pickable=!1);case p.XRay:return e.color[0]=1,e.color[1]=1,e.color[2]=1,e.color[3]*=q,e.colorMixMode=G.Replace,e.castShadows=!1,e.pickable=!1,void(e.edgeMaterial=ye(e.edgeMaterial))}}function ye(e){return e==null?null:(g.lastMaterial!==e&&(g.cachedMaterial=ce(e),g.lastMaterial=e),g.cachedMaterial)}function ce(e){const t=B(e.color);return t[3]*=pe,{...e,color:t}}const g={cachedMaterial:null,lastMaterial:null};class f extends M{constructor(){super(...arguments),this.sublayer=null}get updating(){return!1}get suspended(){return!1}get availableFields(){return[]}get filter(){return null}set filter(t){throw new Error("Not implemented")}queryFeatures(t,r){throw new Error("Not implemented")}queryObjectIds(t,r){throw new Error("Not implemented")}queryFeatureCount(t,r){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(t,r){throw new Error("Not implemented")}highlight(t){throw new Error("Not implemented")}}n([a()],f.prototype,"sublayer",void 0),n([a()],f.prototype,"availableFields",null),n([a()],f.prototype,"filter",null);let o=class extends oe(re(L(f))){constructor(){super(...arguments),this.type="building-component-sublayer-3d",this.layerView=null,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!1,this.requiredFields=[],this.progressiveLoadFactor=1,this._queryEngine=null}get i3slayer(){return this.sublayer}get layerUid(){return this.sublayer.layer.uid}get sublayerUid(){return this.sublayer.uid}get layerId(){return this.sublayer.layer.id}get sublayerId(){return this.sublayer.id}get layerPopupEnabledAndHasTemplate(){var e,t;return this.sublayer.popupEnabled&&N(this.sublayer,(t=(e=this.layerView)==null?void 0:e.view.popup)==null?void 0:t.defaultPopupTemplateEnabled)}initialize(){this._updatingHandles.add(()=>[this.sublayer.renderer,this.definitionExpressionFields,this.filterExpressionFields],()=>this._updateRequiredFields()),this._updatingHandles.add(()=>this.sublayer.renderer,t=>this._rendererChange(t),F);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this._filter!=null?this._filter.sortedObjectIds:null,e),this._updatingHandles.add(()=>this._filter!=null?this._filter.parsedWhereClause:null,e),this._updatingHandles.add(()=>[this._filter!=null?this._filter.parsedGeometry:null,this.filter!=null?this.filter.spatialRelationship:null],()=>this._geometryFilterChange()),this._updatingHandles.add(()=>this.parsedFilterExpressions,()=>this._updateSymbologyOverride(),F),this.addResolvingPromise(this._updateRequiredFields())}get lodFactor(){return this.view.qualitySettings.sceneService.object.lodFactor}get parsedFilterExpressions(){return this.sublayer.modelName!=="Overview"&&this.layerView?this.layerView.filterExpressions.map(([e,t])=>{let r;try{r=te.create(e,this.sublayer.fieldsIndex)}catch(l){return y.getLogger(this).error("Failed to parse filterExpression: "+l),null}if(!r.isStandardized)return y.getLogger(this).error("filterExpression is using non standard function"),null;const i=[],s=r.fieldNames;return U(s,this.sublayer.fields,{missingFields:i}),i.length>0?(y.getLogger(this).error(`filterExpression references unknown fields: ${i.join(", ")}`),null):[r,t]}).filter(e=>e!=null):[]}get filter(){return this._filter!=null?this._filter.viewFilter:null}set filter(e){e!=null&&C.checkSupport(e)?this._filter!=null?this._filter.viewFilter=e:this._filter=new C({viewFilter:e,layerFieldsIndex:this.sublayer.fieldsIndex,loadAsyncModule:t=>this._loadAsyncModule(t),addSqlFilter:(t,r)=>this.addSqlFilter(t,r,this.logError)}):this._filter=null}isUpdating(){return super.isUpdating()||this._filter!=null&&this._filter.updating}_updateSymbologyOverride(){const e=this.parsedFilterExpressions;e.length>0?this._setSymbologyOverride((t,r)=>{for(const[i,s]of e)try{if(i.testFeature(t))return R(r,s)}catch(l){this.logError(l)}return R(r,null)},this.filterExpressionFields):this._setSymbologyOverride(null,null)}get filterExpressionFields(){return m(this.sublayer.fieldsIndex,this.parsedFilterExpressions.reduce((e,[t])=>e.concat(t.fieldNames),new Array))}get availableFields(){const e=this.sublayer,t=e.fieldsIndex;let r=this.requiredFields;if(e.outFields||e.layer.outFields){const i=[...e.outFields||[],...e.layer.outFields||[]];r=[...E(t,i),...r]}return m(t,r)}_createLayerGraphic(e){const t=new b(null,null,e);return t.layer=this.sublayer.layer,t.sourceLayer=this.sublayer,t}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}async fetchPopupFeatures(e,t){const r=this._validateFetchPopupFeatures(t);if(r)throw r;if(!(t!=null&&t.clientGraphics)||t.clientGraphics.length===0)return[];const i=[],s=[],l=this.sublayer.associatedLayer!=null?await this.sublayer.associatedLayer.load():this.sublayer,u=E(this.sublayer.fieldsIndex,await H(l,v(this.sublayer,t))),c=new Set;for(const h of t.clientGraphics)W(u,h,c)?s.push(h):i.push(h);return s.length===0?i:(this.sublayer.associatedLayer!=null&&await this.sublayer.associatedLayer.load().catch(()=>y.getLogger(this).warn("Failed to load associated feature layer. Displaying popup attributes from cached attributes.")),this.whenGraphicAttributes(s,Array.from(c)).catch(()=>s).then(h=>i.concat(h)))}async _updateRequiredFields(){const e=m(this.sublayer.fieldsIndex,[...this.sublayer.renderer?await this.sublayer.renderer.getRequiredFields(this.sublayer.fieldsIndex):[],...this.definitionExpressionFields||[],...this.filterExpressionFields||[]]);this._set("requiredFields",e)}_validateFetchPopupFeatures(e){const{sublayer:t}=this,{popupEnabled:r}=t;return r?v(t,e)?void 0:new x("buildingscenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{sublayer:t}):new x("buildingscenelayerview3d:fetchPopupFeatures","Popups are disabled",{sublayer:t})}getFilters(){const e=super.getFilters();return this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this._filter!=null&&this._filter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter!=null?this.filter.createQuery(e):new V(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t==null?void 0:t.signal).then(r=>{if(!(r!=null&&r.features))return r;const i=this.sublayer,s=i.layer;for(const l of r.features)l.layer=s,l.sourceLayer=i;return r})}queryObjectIds(e,t){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t==null?void 0:t.signal)}_ensureQueryEngine(){return this._queryEngine==null&&(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=ie(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new le({layerView:this,priority:j.FEATURE_QUERY_ENGINE,spatialIndex:new ne({featureAdapter:new ae({objectIdField:this.sublayer.objectIdField,attributeStorageInfo:this.sublayer.attributeStorageInfo,getFeatureExtent:e}),forAllFeatures:(t,r)=>this._forAllFeatures((i,s,l)=>t({id:i,index:s,meta:l}),r,se.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:T(this.sublayer),viewSpatialReference:this.view.spatialReference})})}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():V.from(e))}};n([a()],o.prototype,"i3slayer",null),n([a()],o.prototype,"layerView",void 0),n([a()],o.prototype,"lodFactor",null),n([a({readOnly:!0})],o.prototype,"parsedFilterExpressions",null),n([a({type:k})],o.prototype,"filter",null),n([a()],o.prototype,"_filter",void 0),n([a({type:[String],readOnly:!0})],o.prototype,"filterExpressionFields",null),n([a({type:[String],readOnly:!0})],o.prototype,"requiredFields",void 0),n([a({type:[String],readOnly:!0})],o.prototype,"availableFields",null),o=n([_("esri.views.3d.layers.BuildingComponentSublayerView3D")],o);const ge=o;class w extends de{constructor(t){super(t),this.layer=null,this.sublayerViews=null}highlight(t){throw new Error("Not implemented")}}n([a()],w.prototype,"layer",void 0),n([a()],w.prototype,"sublayerViews",void 0);const fe=L(M);let d=class extends ue(w){constructor(e){super(e),this.type="building-scene-3d",this.sublayerViews=new S,this._abortController=new AbortController,this._loadingComponents=0,this._pendingWhenSublayerViews=new Map,this.ignoresMemoryFactor=!1}get filterExpression(){var i;const e=this.layer.activeFilterId,t=e!=null?this.layer.filters.find(s=>s.id===e):null,r=t!=null?(i=t.filterBlocks)==null?void 0:i.find(s=>s.filterMode.type==="solid"):null;return r?r.filterExpression:null}get filterExpressions(){const e=this.layer.activeFilterId,t=e!=null?this.layer.filters.find(r=>r.id===e):null;return t!=null&&t.filterBlocks?t.filterBlocks.toArray().map(r=>[r.filterExpression??"",he(r)]):[]}get updatingProgressValue(){const e=this.sublayerViews,t=this._loadingComponents+(e?e.length:0);return e.reduce((r,i)=>r+i.updatingProgress,0)/t}isUpdating(){return this._loadingComponents>0||this.sublayerViews&&this.sublayerViews.some(e=>e.updating)}initialize(){z(this.layer.spatialReference,this.view.spatialReference,this.view.viewingMode),this._initializeSubLayerViews(this.layer.sublayers,this)}destroy(){this.sublayerViews&&(this.sublayerViews.forEach(e=>e.destroy()),this.sublayerViews=null),this._abortController=D(this._abortController)}_initializeSubLayerViews(e,t){const r=this,i=this.view;e.forEach(s=>{if(!s.isEmpty)if(s.type==="building-group"){const l=new fe({sublayer:s,view:i,parent:t});this._initializeSubLayerViews(s.sublayers,l)}else s.geometryType==="mesh"&&(this._loadingComponents++,s.load({signal:this._abortController.signal}).then(()=>{const l=new ge({sublayer:s,layerView:r,view:i,parent:t});this.sublayerViews.push(l);const u=this._pendingWhenSublayerViews.get(s);if(u){for(const c of u)c.resolve(l);this._pendingWhenSublayerViews.delete(s)}this.addHandles([$(()=>l.updating,()=>this.notifyChange("updating"),I),$(()=>l.updatingProgress,()=>this.notifyChange("updatingProgressValue"),I)])}).catch(l=>{X(l)||y.getLogger(this).error(`Error while creating view for sublayer ${s.id} +Layer: ${this.layer.url} +`,l)}).then(()=>{this._loadingComponents--,this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}))})}getGraphicFromIntersectorTarget(e){for(const t of this.sublayerViews.items)if(t.sublayer.uid===e.sublayerUid)return t.getGraphicFromIntersectorTarget(e);return null}async fetchPopupFeatures(e,t){if(!(t!=null&&t.clientGraphics)||t.clientGraphics.length===0)return[];const r=K(t.clientGraphics,s=>s.sourceLayer),i=[];for(const[s,l]of r){const u=this._findComponent(s);u!=null&&i.push(u.fetchPopupFeatures(e,{...t,clientGraphics:l}))}return(await Y(i)).flat()}whenGraphicBounds(e){const t=this._findComponent(e.sourceLayer);return t==null?Promise.reject():t.whenGraphicBounds(e)}getAABBFromIntersectorTarget(e){for(const t of this.sublayerViews.items)if(t.sublayer.uid===e.sublayerUid)return t.getAABBFromIntersectorTarget(e);return null}async whenSublayerView(e){const t=this._findComponent(e);if(t!=null)return t;const r=this._pendingWhenSublayerViews.get(e),i=Z();return r?r.push(i):this._pendingWhenSublayerViews.set(e,[i]),i.promise}_findComponent(e){return this.sublayerViews.find(t=>e===t.sublayer)}highlight(e){e instanceof b?e=[e]:e instanceof S&&(e=e.toArray());const t=[];if(Array.isArray(e)&&e.length>0&&e[0]instanceof b){const r=e,i=new Map;for(const s of r){let l=i.get(s.sourceLayer);l==null&&(l=[],i.set(s.sourceLayer,l)),l.push(s)}this.sublayerViews.forEach(s=>{const l=i.get(s.sublayer);l&&t.push(s.highlight(l))})}return J(t)}get usedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.usedMemory,0)}get unloadedMemory(){return this.sublayerViews.reduce((e,t)=>e+t.unloadedMemory,0)}};n([a()],d.prototype,"sublayerViews",void 0),n([a({readOnly:!0})],d.prototype,"filterExpression",null),n([a({readOnly:!0})],d.prototype,"filterExpressions",null),n([a(ee)],d.prototype,"updatingProgress",void 0),n([a({readOnly:!0,dependsOn:[]})],d.prototype,"updatingProgressValue",null),d=n([_("esri.views.3d.layers.BuildingSceneLayerView3D")],d);const bt=d;export{bt as default}; diff --git a/dist/assets/Button-1STHXt3M.js b/dist/assets/Button-1STHXt3M.js new file mode 100644 index 0000000..659eebe --- /dev/null +++ b/dist/assets/Button-1STHXt3M.js @@ -0,0 +1 @@ +import{V as f,Q as R,l as _,j as u,b as T,p as g}from"./Theme-QNc_77AM.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,l=t/Math.abs(s),c=i/Math.abs(e);if(_(t)&&_(i)){let b=Math.min(t,i)/2,r=u(this.get("cornerRadiusTL",8),b),n=u(this.get("cornerRadiusTR",8),b),o=u(this.get("cornerRadiusBR",8),b),h=u(this.get("cornerRadiusBL",8),b),d=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,d),n=g(n,0,d),o=g(o,0,d),h=g(h,0,d);const a=this._display;a.moveTo(r*l,0),a.lineTo(t-n*l,0),n>0&&a.arcTo(t,0,t,n*c,n),a.lineTo(t,i-o*c),o>0&&a.arcTo(t,i,t-o*l,i,o),a.lineTo(h*l,i),h>0&&a.arcTo(0,i,0,i-h*c,h),a.lineTo(0,r*c),r>0&&a.arcTo(0,0,r*l,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])}))}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as n,m as o}; diff --git a/dist/assets/CIMSymbolRasterizer-o8gx_uXl.js b/dist/assets/CIMSymbolRasterizer-o8gx_uXl.js new file mode 100644 index 0000000..76ed75c --- /dev/null +++ b/dist/assets/CIMSymbolRasterizer-o8gx_uXl.js @@ -0,0 +1 @@ +import{mb as G,gX as J,fW as j,mc as B,gZ as Q,s as V,md as Z,me as M,gO as D,mf as K,bW as $,ab as ee,mg as te,mh as Y}from"./index-J0iiHjMT.js";import{d as ae,n as F,a as N,t as q,b as re,r as ie,l as se,e as ne,j as oe,V as ce,Q as he}from"./cimAnalyzer-DtyBzAGI.js";import{r as le,e as me}from"./rasterizingUtils-6P0UGdzr.js";import"./labelPoint-ysDT9nFH.js";import"./TileClipper-NSFZXMR1.js";import"./definitions-DqQMJYPH.js";import"./number-sTjsTbdA.js";import"./BidiEngine-8z8MVveq.js";class ge{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(e){return this._resourceMap.get(e)??null}async fetchResource(e,t){const o=this._resourceMap.get(e);if(o)return{width:o.width,height:o.height};let a=this._inFlightResourceMap.get(e);return a?a.then(r=>({width:r.width,height:r.height})):(a=G(e,t),this._inFlightResourceMap.set(e,a),a.then(r=>(this._inFlightResourceMap.delete(e),this._resourceMap.set(e,r),{width:r.width,height:r.height}),()=>({width:0,height:0})))}deleteResource(e){this._inFlightResourceMap.delete(e),this._resourceMap.delete(e)}loadFont(e){return J(e)}}const ue=512;class fe{constructor(e){this._resourceManager=e,this._lazyRasterizationCanvas=null}dispose(){this._lazyRasterizationCanvas=null}get _rasterizationCanvas(){return this._lazyRasterizationCanvas==null&&(this._lazyRasterizationCanvas=document.createElement("canvas"),this._lazyRasterizationCanvas.getContext("2d",{willReadFrequently:!0})),this._lazyRasterizationCanvas}rasterizeJSONResource(e,t,o){if(e.type==="simple-fill"||e.type==="esriSFS"){const[i,l,p]=le(this._rasterizationCanvas,e.style,t);return{size:[l,p],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:j(Math.ceil(t))}}if(e.type==="simple-line"||e.type==="esriSLS"||e.type==="line"&&e.dashTemplate){let i,l;if(e.type==="simple-line"||e.type==="esriSLS")switch(i=ae(e.style,e.cap),e.cap){case"butt":l="Butt";break;case"square":l="Square";break;default:l="Round"}else i=e.dashTemplate,l=e.cim.capStyle;const[p,f,d]=me(i,l);return{size:[f,d],image:new Uint32Array(p.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}let a,r=null,c=null,n=1;if(e.type==="simple-marker"||e.type==="esriSMS"||e.type==="line-marker"?(a=F.fromSimpleMarker(e),c=N(a)):e.cim&&e.cim.type==="CIMHatchFill"?(a=F.fromCIMHatchFill(e.cim,t),r=new q(a.frame.xmin,-a.frame.ymax,a.frame.xmax-a.frame.xmin,a.frame.ymax-a.frame.ymin),n=t):e.cim.markerPlacement&&e.cim.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"?(a=F.fromCIMInsidePolygon(e.cim),r=new q(a.frame.xmin,-a.frame.ymax,a.frame.xmax-a.frame.xmin,a.frame.ymax-a.frame.ymin)):(a=e.cim,e.avoidSDFRasterization||(c=N(a))),c&&!o){const[i,l,p]=re(c);return i?{size:[l,p],image:new Uint32Array(i.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:n}:null}const[s,y,m,g,u]=F.rasterize(this._rasterizationCanvas,a,r,this._resourceManager,!o);return s?{size:[y,m],image:new Uint32Array(s.buffer),sdf:!1,simplePattern:!1,anchorX:g,anchorY:u}:null}rasterizeImageResource(e,t,o,a){this._rasterizationCanvas.width=e,this._rasterizationCanvas.height=t;const r=this._rasterizationCanvas.getContext("2d");o instanceof ImageData?r.putImageData(o,0,0):(o.setAttribute("width",`${e}px`),o.setAttribute("height",`${t}px`),r.drawImage(o,0,0,e,t));const c=r.getImageData(0,0,e,t),n=new Uint8Array(c.data);if(a){for(const i of a)if(i&&i.oldColor&&i.oldColor.length===4&&i.newColor&&i.newColor.length===4){const[l,p,f,d]=i.oldColor,[z,h,I,w]=i.newColor;if(l===z&&p===h&&f===I&&d===w)continue;for(let C=0;C=u||g>=u){const i=m/g;i>1?(m=u,g=Math.round(u/i)):(g=u,m=Math.round(u*i)),y=new Uint8Array(4*m*g);const l=new Uint8ClampedArray(y.buffer);B(n,e,t,l,m,g,!1)}return{size:[m,g],image:new Uint32Array(y.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}}const T=b=>b!=null&&b.scaleFactor?b.scaleFactor:1,de=96/72;class Ie{constructor(e,t){this._spatialReference=e,this._avoidSDF=t,this._resourceCache=new Map,this._lazyImageDataCanvas=null,this._pictureMarkerCache=new Map,this._textRasterizer=new ie,this._cimResourceManager=new ge,this._rasterizer=new fe(this._cimResourceManager)}get _imageDataCanvas(){return this._lazyImageDataCanvas??(this._lazyImageDataCanvas=document.createElement("canvas")),this._lazyImageDataCanvas}get _imageDataContext(){return this._imageDataCanvas.getContext("2d",{willReadFrequently:!0})}get resourceManager(){return this._cimResourceManager}async rasterizeCIMSymbolAsync(e,t,o,a,r,c,n,s,y){if(!e)return null;const{data:m}=e;if(!m||m.type!=="CIMSymbolReference"||!m.symbol)return null;const{symbol:g}=m;c||(c=Q(g));const u=await se.resolveSymbolOverrides(m,t,this._spatialReference,r,c,n,s),i=this._imageDataCanvas,l=this._cimResourceManager,p=[];F.fetchResources(u,l,p),F.fetchFonts(u,l,p),p.length>0&&await Promise.all(p);const{width:f,height:d}=o,z=ye(c,f,d,a),h=F.getEnvelope(u,z,l);if(!h)return null;const I=(window.devicePixelRatio||1)*de;let w=1,C=0,R=0;switch(g.type){case"CIMPointSymbol":case"CIMTextSymbol":{let k=1;h.width>f&&(k=f/h.width);let _=1;h.height>d&&(_=d/h.height),a==="preview"&&(h.widthd)&&(w=d/h.height),R=h.y+h.height/2;const k=h.x*w+f/2,_=(h.x+h.width)*w+f/2,{paths:x}=z;x[0][0][0]-=k/w,x[0][2][0]-=(_-f)/w}break;case"CIMPolygonSymbol":{C=h.x+h.width/2,R=h.y+h.height/2;const k=h.x*w+f/2,_=(h.x+h.width)*w+f/2,x=h.y*w+d/2,X=(h.y+h.height)*w+d/2,{rings:S}=z;k<0&&(S[0][0][0]-=k,S[0][3][0]-=k,S[0][4][0]-=k),x<0&&(S[0][0][1]+=x,S[0][1][1]+=x,S[0][4][1]+=x),_>f&&(S[0][1][0]-=_-f,S[0][2][0]-=_-f),X>d&&(S[0][2][1]+=X-d,S[0][3][1]+=X-d)}}i.width=f*I,i.height=d*I;const v=1;i.width+=2*v,i.height+=2*v;const P=this._imageDataContext,A=he.createIdentity();return A.translate(-C,-R),A.scale(w*I,-w*I),A.translate(f*I/2+v,d*I/2+v),P.clearRect(0,0,i.width,i.height),new ne(P,l,A,!0).drawSymbol(u,z),P.getImageData(0,0,i.width,i.height)}async analyzeCIMSymbol3D(e,t,o,a,r){const c=[],n=t?{geometryType:a,spatialReference:this._spatialReference,fields:t}:null,s=[];F.fetchFonts(e.data.symbol,this._cimResourceManager,s),await Promise.all(s);const y=new oe(this._cimResourceManager,n);let m;await y.analyzeSymbolReference(e.data,this._avoidSDF,c),V(r);for(const g of c)g.cim.type!=="CIMPictureMarker"&&g.cim.type!=="CIMPictureFill"&&g.cim.type!=="CIMPictureStroke"||(m||(m=[]),m.push(this._fetchPictureMarkerResource(g,r))),o&&g.type==="text"&&typeof g.text=="string"&&g.text.includes("[")&&(g.text=Z(o,g.text,g.cim.textCase));return m&&await Promise.all(m),c}rasterizeCIMSymbol3D(e,t,o,a,r,c){const n=[];for(const s of e){a&&typeof a.scaleFactor=="function"&&(a.scaleFactor=a.scaleFactor(t,r,c));const y=this._getRasterizedResource(s,t,o,a,r,c);if(!y)continue;let m=0,g=y.anchorX||0,u=y.anchorY||0,i=!1,l=0,p=0;if(o==="esriGeometryPoint"){const f=T(a);if(l=M(s.offsetX,t,r,c)*f||0,p=M(s.offsetY,t,r,c)*f||0,s.type==="marker")m=M(s.rotation,t,r,c)||0,i=s.rotateClockwise??!1;else if(s.type==="text"){if(m=M(s.angle,t,r,c)||0,s.horizontalAlignment!==void 0)switch(s.horizontalAlignment){case"left":g=-.5;break;case"right":g=.5;break;default:g=0}if(s.verticalAlignment!==void 0)switch(s.verticalAlignment){case"top":u=.5;break;case"bottom":u=-.5;break;case"baseline":u=-.25;break;default:u=0}}}y!=null&&n.push({angle:m,rotateClockWise:i,anchorX:g,anchorY:u,offsetX:l,offsetY:p,rasterizedResource:y})}return this.getSymbolImage(n)}getSymbolImage(e){const t=document.createElement("canvas"),o=t.getContext("2d");let a=0,r=0,c=0,n=0;const s=[];for(let u=0;uc?v:c,n=P>n?P:n;const A=o.createImageData(l.size[0],l.size[1]);A.data.set(new Uint8ClampedArray(l.image.buffer));const k={offsetX:f,offsetY:d,rotateClockwise:I,angle:w,rasterizedImage:A,anchorX:z,anchorY:h};s.push(k)}t.width=c-a,t.height=n-r;const y=-a,m=n;for(let u=0;u1?D(t):D(t)/r:a.width,n=t?r>1?D(t)*r:D(t):a.height;return{image:this._imageTo32Array(a,c,n,o),width:c,height:n}}}function ye(b,e,t,o){const r=-e/2+1,c=e/2-1,n=t/2-1,s=-t/2+1;switch(b){case"esriGeometryPoint":return{x:0,y:0};case"esriGeometryPolyline":return{paths:[[[r,0],[0,0],[c,0]]]};default:return o==="legend"?{rings:[[[r,n],[c,0],[c,s],[r,s],[r,n]]]}:{rings:[[[r,n],[c,n],[c,s],[r,s],[r,n]]]}}}function pe(b,e,t,o){let a,r;return typeof b.materialHash=="function"?(a=(0,b.materialHash)(e,t,o),r=ce(b.cim,b.materialOverrides)):(a=b.materialHash,r=b.cim),{analyzedCIM:r,hash:a}}export{Ie as CIMSymbolRasterizer}; diff --git a/dist/assets/CSVLayer-tIBvmg-7.js b/dist/assets/CSVLayer-tIBvmg-7.js new file mode 100644 index 0000000..e9e8cc9 --- /dev/null +++ b/dist/assets/CSVLayer-tIBvmg-7.js @@ -0,0 +1 @@ +import{e as i,y as r,c as h,ij as v,ah as w,dT as S,g1 as O,dJ as F,dt as b,iz as I,iA as q,ar as N,dQ as _,bV as J,ca as l,E as y}from"./index-J0iiHjMT.js";import j from"./FeatureLayer--S4epFk-.js";import{d as C}from"./FeatureSet-d4S1oKME.js";import{l as P}from"./clientSideDefaults-F-CNnR0g.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./queryZScale-IaMm02_2.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";import"./TopFeaturesQuery-E6D2tV-x.js";import"./QueryEngineCapabilities-PzVpW5yD.js";let a=class extends v{constructor(e){super(e),this.type="csv",this.refresh=w(async t=>{await this.load();const{extent:o,timeExtent:n}=await this._connection.invoke("refresh",t);return o&&(this.sourceJSON.extent=o),n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const o=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return C.fromJSON(o)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const o=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:o.count,extent:S.fromJSON(o.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _startWorker(e){this._connection=await O("CSVSourceWorker",{strategy:F("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{url:t,delimiter:o,fields:n,latitudeField:m,longitudeField:f,spatialReference:u,timeInfo:d}=this.loadOptions,c=await this._connection.invoke("load",{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:o,fields:n==null?void 0:n.map(g=>g.toJSON()),latitudeField:m,longitudeField:f,spatialReference:u==null?void 0:u.toJSON(),timeInfo:d==null?void 0:d.toJSON()}},{signal:e});this.locationInfo=c.locationInfo,this.sourceJSON=c.layerDefinition,this.delimiter=c.delimiter}};i([r()],a.prototype,"type",void 0),i([r()],a.prototype,"loadOptions",void 0),i([r()],a.prototype,"customParameters",void 0),i([r()],a.prototype,"locationInfo",void 0),i([r()],a.prototype,"sourceJSON",void 0),i([r()],a.prototype,"delimiter",void 0),a=i([h("esri.layers.graphics.sources.CSVSource")],a);function p(e,t){throw new y(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let s=class extends j{constructor(...e){super(...e),this.geometryType="point",this.capabilities=P(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=N.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(_).then(async()=>this.initLayerProperties(await this.createGraphicsSource(t)));return this.addResolvingPromise(o),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(e,t){var o,n;return t.showLabels!=null?t.showLabels:!!((n=(o=t.layerDefinition)==null?void 0:o.drawingInfo)!=null&&n.labelingInfo)}set url(e){if(!e)return void this._set("url",e);const t=J(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async createGraphicsSource(e){const t=new a({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",t),await t.load({signal:e}),this.read({locationInfo:t.locationInfo,columnDelimiter:t.delimiter},{origin:"service",url:this.parsedUrl}),t}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(l.from(e)||this.createQuery())).then(o=>{if(o!=null&&o.features)for(const n of o.features)n.layer=n.sourceLayer=this;return o})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(l.from(e)||this.createQuery()))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(l.from(e)||this.createQuery()))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(l.from(e)||this.createQuery()))}read(e,t){super.read(e,t),t&&t.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(e,t){return super.write(e,{...t,writeLayerSchema:!0})}clone(){throw new y("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return p(this,"csv-layer:save")}async saveAs(e,t){return p(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],s.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],s.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],s.prototype,"isTable",null),i([b("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],s.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],s.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],s.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],s.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],s.prototype,"operationalLayerType",void 0),i([r()],s.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],s.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:a,readOnly:!0})],s.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],s.prototype,"type",void 0),i([r({json:{read:I,write:{isRequired:!0,ignoreOrigin:!0,writer:q}}})],s.prototype,"url",null),s=i([h("esri.layers.CSVLayer")],s);const H=s;export{H as default}; diff --git a/dist/assets/CSVLayerView3D-t0wtEtZq.js b/dist/assets/CSVLayerView3D-t0wtEtZq.js new file mode 100644 index 0000000..2dd011a --- /dev/null +++ b/dist/assets/CSVLayerView3D-t0wtEtZq.js @@ -0,0 +1 @@ +import{e as r,y as o,c as p}from"./index-J0iiHjMT.js";import{_ as i}from"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./LayerView3D-iOx2MD1g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";let t=class extends i{constructor(){super(...arguments),this.type="csv-3d"}};r([o()],t.prototype,"layer",void 0),t=r([p("esri.views.3d.layers.CSVLayerView3D")],t);const F=t;export{F as default}; diff --git a/dist/assets/CSVSourceWorker-GlkXsKJn.js b/dist/assets/CSVSourceWorker-GlkXsKJn.js new file mode 100644 index 0000000..26da709 --- /dev/null +++ b/dist/assets/CSVSourceWorker-GlkXsKJn.js @@ -0,0 +1,4 @@ +import{k0 as j,eX as _,ff as R,E as I,b as V,f as P,Z as L,bV as A,bW as Q,eQ as w,eR as E,ga as G,al as M,eF as Z,k1 as Y,k2 as B,ar as J,eZ as W,e_ as U,eV as H,dh as K}from"./index-J0iiHjMT.js";import{e as X,n as z}from"./date-be_IQzZd.js";import{t as ee}from"./json-v6EOeNTY.js";import{m as te}from"./FeatureStore-X-AIJLo2.js";import{W as ie,x as ne}from"./QueryEngine-8tLWlkSE.js";import{i as se,o as re}from"./clientSideDefaults-F-CNnR0g.js";import"./BoundsStore-wmwfHjhp.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";const T=/^\s*"([\S\s]*)"\s*$/,S=/""/g,O=` +`,oe=[","," ",";","|"," "];function*$(s,t,e){let i=0;for(;i<=s.length;){const n=s.indexOf(t,i),r=s.substring(i,n>-1?n:void 0);i+=r.length+t.length,e&&!r.trim()||(yield r)}}function q(s){const t=s.includes(`\r +`)?`\r +`:O;return $(s,t,!0)}function C(s,t){return $(s,t,!1)}function ae(s,t,e){s=s.trim(),t=t==null?void 0:t.trim();const i=[],n=Array.from(new Set([e==null?void 0:e.delimiter,...oe])).filter(o=>o!=null);for(const o of n){const a=N(s,o).length,u=N(t,o).length??a;a>1&&i.push({weight:Math.min(a,u),delimiter:o})}const r=i.sort(({weight:o},{weight:a})=>a-o).map(({delimiter:o})=>o);for(const o of r){const a=le(v(s,o).names,e==null?void 0:e.longitudeField,e==null?void 0:e.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:r[0],locationInfo:null}}function*k(s,t,e,i=()=>Object.create(null)){const n=q(s);n.next();let r="",o="",a=0,u=i(),d=0;e:for(const h of n){const m=C(h,e);for(const y of m)if(r+=o+y,o="",a+=D(y),a%2==0){if(a>0){const g=T.exec(r);if(!g){u=i(),d=0,r="",a=0;continue e}u[t[d]]=g[1].replaceAll(S,'"'),d++}else u[t[d]]=r,d++;r="",a=0}else o=e;a===0?(yield u,u=i(),d=0):o=O}}function v(s,t){const e=N(s,t).filter(n=>n!=null),i=e.map(n=>_(n));for(let n=i.length-1;n>=0;n--)i[n]||(i.splice(n,1),e.splice(n,1));return{names:i,aliases:e}}function N(s,t){if(!(s!=null&&s.length))return[];const e=[];let i="",n="",r=0;const o=C(s,t);for(const a of o)if(i+=n+a,n="",r+=D(a),r%2==0){if(r>0){const u=T.exec(i);u&&e.push(u[1].replaceAll(S,'"'))}else e.push(i);i="",r=0}else n=t;return e}function D(s){let t=0,e=0;for(e=s.indexOf('"',e);e>=0;)t++,e=s.indexOf('"',e+1);return t}function le(s,t,e){var o,a;t=(o=_(t))==null?void 0:o.toLowerCase(),e=(a=_(e))==null?void 0:a.toLowerCase();const i=s.map(u=>u.toLowerCase()),n=t?s[i.indexOf(t)]:null,r=e?s[i.indexOf(e)]:null;return{longitudeFieldName:n||s[i.indexOf(fe.find(u=>i.includes(u)))],latitudeFieldName:r||s[i.indexOf(de.find(u=>i.includes(u)))]}}function ce(s,t,e,i,n){const r=[],o=k(s,e,t),a=[];for(const u of o){if(a.length===10)break;a.push(u)}for(let u=0;uy[d]))){case"integer":m="esriFieldTypeInteger";break;case"double":m="esriFieldTypeDouble";break;case"date":m="esriFieldTypeDate";break;default:m="esriFieldTypeString"}r.push({name:d,type:m,alias:h,length:R(m)})}}return r}function ue(s){if(!s.length)return"string";const t=/[^+\-.,0-9]/;return s.map(e=>{if(e!==""){if(!t.test(e)){let i=x(e);if(!isNaN(i))return/[.,]/.test(e)||!Number.isInteger(i)||i>214783647||i<-214783648?"double":"integer";if(e.includes("E")&&(i=Number(e),!Number.isNaN(i)||e.includes(",")&&(e=e.replace(",","."),i=Number(e),!Number.isNaN(i))))return"double"}return X(e)?"date":"string"}}).reduce((e,i)=>e===void 0?i:i===void 0?e:e===i?i:e==="string"||i==="string"?"string":e==="double"||i==="double"?"double":void 0)}const x=function(){const s=j(),t=new RegExp("^"+s.regexp+"$"),e=new RegExp("["+s.group+"\\s\\xa0]","g"),i=s.factor;return n=>{const r=t.exec(n);if(s.factor=i,!r)return NaN;let o=r[1];if(!r[1]){if(!r[2])return NaN;o=r[2],s.factor*=-1}return o=o.replace(e,"").replace(s.decimal,"."),+o*s.factor}}(),de=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],fe=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],me=re("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(t,e){this.x=t,this.y=e}}class ve{constructor(){this._queryEngine=null,this._snapshotFeatures=async t=>{const e=await this._fetch(t);return this._createFeatures(e)}}destroy(){var t;(t=this._queryEngine)==null||t.destroy(),this._queryEngine=null}async load(t,e={}){var u;this._loadOptions=t;const[i]=await Promise.all([this._fetch(e.signal),this._checkProjection((u=t==null?void 0:t.parsingOptions)==null?void 0:u.spatialReference)]),n=ge(i,t);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const r=await this._createFeatures(i);this._queryEngine.featureStore.addMany(r);const{fullExtent:o,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=o,a){const{start:d,end:h}=a;n.layerDefinition.timeInfo.timeExtent=[d,h]}return n}async applyEdits(){throw new I("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(t,e.signal)}async queryFeatureCount(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(t,e.signal)}async queryObjectIds(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(t,e.signal)}async queryExtent(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(t,e.signal)}async querySnapping(t,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(t,e.signal)}async refresh(t){var n;this._loadOptions.customParameters=t,(n=this._snapshotTask)==null||n.abort(),this._snapshotTask=V(this._snapshotFeatures),this._snapshotTask.promise.then(r=>{this._queryEngine.featureStore.clear(),r&&this._queryEngine.featureStore.addMany(r)},r=>{this._queryEngine.featureStore.clear(),P(r)||L.getLogger("esri.layers.CSVLayer").error(new I("csv-layer:refresh","An error occurred during refresh",{error:r}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:i}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:i}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:e,customParameters:i}=this._loadOptions;if(!e)throw new I("csv-layer:invalid-source","url not defined");const n=A(e);return(await Q(n.path,{query:{...n.query,...i},responseType:"text",signal:t})).data}_createQueryEngine(t){const{objectIdField:e,fields:i,extent:n,timeInfo:r}=t.layerDefinition,o=new te({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new ie({fieldsIndex:w.fromLayerJSON({fields:i,dateFieldsTimeReference:{timeZoneIANA:E}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:r,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:o})}async _createFeatures(t){const{latitudeFieldName:e,longitudeFieldName:i}=this._locationInfo,{objectIdField:n,fieldsIndex:r,spatialReference:o}=this._queryEngine;let a=[];const u=[],d=r.fields.filter(l=>l.name!==n).map(l=>l.name);let h=0;const m={};for(const l of r.fields)if(l.type!=="esriFieldTypeOID"&&l.type!=="esriFieldTypeGlobalID"){const p=G(l);p!==void 0&&(m[l.name]=p)}const y=k(t,d,this._delimiter,se(m,n));for(const l of y){const p=this._parseCoordinateValue(l[e]),F=this._parseCoordinateValue(l[i]);if(F!=null&&p!=null&&!isNaN(p)&&!isNaN(F)){l[e]=p,l[i]=F;for(const c in l)if(c!==e&&c!==i){if(r.isDateField(c))l[c]=z(l[c]);else if(r.isNumericField(c)){const f=x(l[c]);isNaN(f)?l[c]=null:l[c]=f}}l[n]=h,h++,a.push(new ye(F,p)),u.push(l)}}if(!M({wkid:4326},o))if(Z(o))for(const l of a)[l.x,l.y]=Y(l.x,l.y,he);else a=B(ee,a,J.WGS84,o,null,null);const g=[];for(let l=0;l181)&&(e=parseFloat(t)),e}async _checkProjection(t){try{await ne(H,t)}catch{throw new I("csv-layer:projection-not-supported","Projection not supported")}}}function ge(s,t){var l,p,F;const e=t.parsingOptions||{},i={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=i.layerDefinition={name:K(t.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:E},drawingInfo:me,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:4326}}},r=q(s),o=(l=r.next().value)==null?void 0:l.trim(),a=(p=r.next().value)==null?void 0:p.trim();if(!o)throw new I("csv-layer:empty-csv","CSV is empty",{csv:s});const{delimiter:u,locationInfo:d}=ae(o,a,e);if(!u)throw new I("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:o,secondLine:a,parsingOptions:e});if(!d)throw new I("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:o,secondLine:a,parsingOptions:e});i.locationInfo=d,i.delimiter=u;const{names:h,aliases:m}=v(o,u),y=ce(s,i.delimiter,h,m,i.locationInfo);if((F=e.fields)!=null&&F.length){const c=new w(e.fields);for(const f of y){const b=c.get(f.name);b&&Object.assign(f,b)}}if(!y.some(c=>c.type==="esriFieldTypeOID"&&(n.objectIdField=c.name,!0))){const c={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=c.name,y.unshift(c)}n.fields=y;const g=new w(n.fields);if(i.locationInfo&&(i.locationInfo.latitudeFieldName=g.get(i.locationInfo.latitudeFieldName).name,i.locationInfo.longitudeFieldName=g.get(i.locationInfo.longitudeFieldName).name),n.timeInfo){const c=n.timeInfo;if(c.startTimeField){const f=g.get(c.startTimeField);f?(c.startTimeField=f.name,f.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const f=g.get(c.endTimeField);f?(c.endTimeField=f.name,f.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const f=g.get(c.trackIdField);c.trackIdField=f?f.name:null}c.startTimeField||c.endTimeField||(n.timeInfo=null)}return i}export{ve as default}; diff --git a/dist/assets/ColorSet-j9kKRPwP.js b/dist/assets/ColorSet-j9kKRPwP.js new file mode 100644 index 0000000..b77674f --- /dev/null +++ b/dist/assets/ColorSet-j9kKRPwP.js @@ -0,0 +1 @@ +import{E as c,Z as h}from"./Theme-QNc_77AM.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,i=this.get("passOptions"),P=this.get("reuse");for(let a=g;a1;)n-=1;let s=o.s+(i.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(i.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as s}; diff --git a/dist/assets/CustomParametersMixin-Y1bOcayO.js b/dist/assets/CustomParametersMixin-Y1bOcayO.js new file mode 100644 index 0000000..4e88b6c --- /dev/null +++ b/dist/assets/CustomParametersMixin-Y1bOcayO.js @@ -0,0 +1 @@ +import{e as r,y as o,c as i}from"./index-J0iiHjMT.js";const a=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{a as o}; diff --git a/dist/assets/DefaultTheme-T7-VnRhA.js b/dist/assets/DefaultTheme-T7-VnRhA.js new file mode 100644 index 0000000..b696596 --- /dev/null +++ b/dist/assets/DefaultTheme-T7-VnRhA.js @@ -0,0 +1 @@ +import{i as R,Z as i,x as c,X as n,Y as r,A as h,C as u}from"./Theme-QNc_77AM.js";function a(g,s,o,d){g.set(s,o.get(d)),o.on(d,p=>{g.set(s,p)})}class A extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:h.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("Graphics",["button","icon"]),"stroke",o,"primaryButtonText"),a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}}}export{a as l,A as s}; diff --git a/dist/assets/DefinitionExpressionSceneLayerView-oAOUEjm-.js b/dist/assets/DefinitionExpressionSceneLayerView-oAOUEjm-.js new file mode 100644 index 0000000..a32019a --- /dev/null +++ b/dist/assets/DefinitionExpressionSceneLayerView-oAOUEjm-.js @@ -0,0 +1 @@ +import{e as o,y as a,c as d,Z as t,jV as l}from"./index-J0iiHjMT.js";import{x as f}from"./WhereClause-XAMIZ4-B.js";const h="updating";function x(s){return s==="updating"?null:s}function g(s){return s==="updating"}const c=s=>{let n=class extends s{constructor(){super(...arguments),this._definitionExpressionErrors=0,this._maxDefinitionExpressionErrors=20,this.logError=r=>{this._definitionExpressionErrors0?(t.getLogger(this).error(`definitionExpression references unknown fields: ${i.join(", ")}`),null):(this._definitionExpressionErrors=0,e)}catch(e){return t.getLogger(this).error("Failed to parse definitionExpression: "+e),null}}get definitionExpressionFields(){return this.parsedDefinitionExpression?this.parsedDefinitionExpression.fieldNames:[]}_evaluateClause(r,e){try{return r.testFeature(e)}catch(i){return this.logError(i),!1}}_addDefinitionExpressionToQuery(r){if(!this.parsedDefinitionExpression)return r;const e=this.i3slayer.definitionExpression,i=r.clone();return i.where?i.where=`(${e}) AND (${i.where})`:i.where=e,i}};return o([a()],n.prototype,"i3slayer",void 0),o([a({readOnly:!0})],n.prototype,"parsedDefinitionExpression",null),o([a({readOnly:!0})],n.prototype,"definitionExpressionFields",null),n=o([d("esri.views.3d.layers.support.DefinitionExpressionSceneLayerView")],n),n};export{x as a,h as n,c as t,g as u}; diff --git a/dist/assets/DeleteForwardEditsParameters-DGoRlX6R.js b/dist/assets/DeleteForwardEditsParameters-DGoRlX6R.js new file mode 100644 index 0000000..e48f84e --- /dev/null +++ b/dist/assets/DeleteForwardEditsParameters-DGoRlX6R.js @@ -0,0 +1 @@ +import{e as s,y as r,c as n,dr as m,g0 as p}from"./index-J0iiHjMT.js";var o;let e=o=class extends m{static from(t){return p(o,t)}constructor(t){super(t),this.sessionId=void 0,this.moment=null}};s([r({type:String,json:{write:!0}})],e.prototype,"sessionId",void 0),s([r({type:Date,json:{type:Number,write:{writer:(t,i)=>{i.moment=t?t.getTime():null}}}})],e.prototype,"moment",void 0),e=o=s([n("esri.rest.versionManagement.gdbVersion.support.PostParameters")],e);const d=e;export{d as default}; diff --git a/dist/assets/DimensionAnalysisView3D-W2fgoQBr.js b/dist/assets/DimensionAnalysisView3D-W2fgoQBr.js new file mode 100644 index 0000000..1aed901 --- /dev/null +++ b/dist/assets/DimensionAnalysisView3D-W2fgoQBr.js @@ -0,0 +1 @@ +import{rh as Ht,ri as zt,cz as tt,aa as b,aE as T,br as g,nw as Rt,o3 as Le,pl as Ge,h9 as Ie,q3 as k,aG as F,ax as E,pU as it,bv as X,aF as kt,bA as De,cM as de,an as Y,rj as Ue,bB as Vt,cP as Me,e as d,y as u,c as G,p as Z,rk as fe,fw as ae,rl as Et,d as v,A as x,hx as Lt,Z as nt,ab as j,hS as Gt,kz as It,q8 as at,i3 as Ut,b8 as ee,au as se,rm as R,ou as Ft,P as te,rn as jt,gO as A,T as W,iC as we,aV as Pe,aT as be,aU as st,o1 as Fe,aq as ot,ro as Bt,aQ as rt,bx as lt,as as dt,b2 as P,b6 as q,b1 as ce,cQ as qt,ag as Nt,by as Wt,bf as je,bz as Be,kn as ct,k as Xt,gD as Zt,kZ as ue,C as Ce,nn as Kt,ao as qe,n as Te,F as xe,rp as Oe,aX as Qt,aY as Yt,a2 as ut,X as Ne,rq as Jt,ak as ei,nZ as ti,bw as ii,rr as pt,i7 as ni,i8 as ai,rs as si,o8 as K,kx as oi,kw as ri,V as li,a as We}from"./index-J0iiHjMT.js";import{s as di}from"./AnalysisView3D-jkk3JIRT.js";import{t as _,r as ci,u as ui}from"./LengthDimension-A_HnPDNi.js";import{m as B,g as pi}from"./Segment-hN2uWAPW.js";import{x as mi,z as hi}from"./euclideanLengthMeasurementUtils-VQw5qWk6.js";import{$ as _e,w as gi,e as H,D as mt,F as fi,M as Ae,O as re}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";import{F as _i,H as ht,A as He}from"./dragEventPipeline3D-4CqrlxD2.js";import{g as gt}from"./ImageMaterial.glsl-TdPtjVc_.js";import{d as oe,R as ze,U as vi}from"./InteractiveToolBase-WDic4GPF.js";import{l as yi}from"./Factory-m-O4WAoG.js";import{O as Si}from"./SnappingVisualizer3D-KWlqByBu.js";import{u as I,r as Mi,t as wi}from"./LineVisualElement-4BP10o6v.js";import{d as Pi}from"./VerticesVisualElement-oQAA_hbc.js";import{V as bi,p as Ci,w as Oi}from"./EditGeometryOperations-TPE5Wzab.js";import{a as $i}from"./SceneSnappingManagerPool-OpebO9Di.js";import{e as Di}from"./SnappingContext-6K6JmvvY.js";import{f as Ti}from"./SnappingDragPipelineStep-THHIXt-p.js";import{p as xi}from"./SnappingOperation-2U48wt1k.js";import{a as Ai}from"./AnalysisToolBase-3A13PdgS.js";import{h as Hi}from"./quantityFormatUtils-NiAiojad.js";import{r as zi,t as Ri}from"./vec4f32-NvfHy9q7.js";import{a as ki}from"./Object3DVisualElement-TMb7y_wl.js";import{a as Vi,v as Ei,l as Li}from"./analysisViewUtils-AQaQeJpR.js";import"./VisualElement-kjYXz27t.js";import"./TextOverlayItem-eCjvS6IO.js";import"./measurementUtils-84-ZBArh.js";import"./drawUtils-woTYaREB.js";import"./ExtendedLineVisualElement-YbjiXiBG.js";import"./EngineVisualElement-eZNKTKsI.js";import"./Laserlines.glsl-nvjcCsAw.js";import"./PointVisualElement-bX-_4FqS.js";import"./RightAngleQuadVisualElement-y_W8r903.js";import"./PointSnappingHint-ULetRXiW.js";import"./dehydratedFeatureComparison-hdPq-zad.js";function Gi(e,t,i){if(e==null)return null;const n=e.dimensionSegment.startRenderSpace,a=e.dimensionSegment.endRenderSpace,s=mi(n,a,e.spatialReference);if(s==null)return null;const o=t===_.Vertical?Ht(s.value,s.unit,i):zt(s.value,s.unit,i);return tt(s,o)}function pe(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:i,dimension:{offset:n,measureType:a,orientation:s}}=e;return{elevationAlignedStartPoint:t,elevationAlignedEndPoint:i,offset:n,measureType:a,orientation:s}}function me({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,offset:i,measureType:n,orientation:a},s,o=null){if(e==null||t==null)return null;const l=_t(o!=null?o.directSegment:new B,{elevationAlignedStartPoint:e,elevationAlignedEndPoint:t},s),r=o!=null?o.primaryOffsetAxis:b();ve(r,{measureType:n,elevationAlignedStartPoint:e,elevationAlignedEndPoint:t,directSegment:l,orientation:a,renderCoordsHelper:s});const c=o!=null?o.dimensionSegment:new B;return Re({elevationAlignedStartPoint:e,elevationAlignedEndPoint:t})&&n===_.Vertical?(T(c.startRenderSpace,l.startRenderSpace),T(c.endRenderSpace,l.endRenderSpace)):vt(c,{offsetAxis:r,offset:i,relativeToSegment:l,renderCoordsHelper:s}),{directSegment:l,dimensionSegment:c,primaryOffsetAxis:r,spatialReference:s.spatialReference}}function Xe(e,t,i,n){return t===ie.Start?(T(e.startRenderSpace,i.startRenderSpace),T(e.endRenderSpace,n.startRenderSpace)):(T(e.startRenderSpace,i.endRenderSpace),T(e.endRenderSpace,n.endRenderSpace)),e}var ie;function Ii(e,t,i,n){de(e.startRenderSpace,t.startRenderSpace,i,n),de(e.endRenderSpace,t.endRenderSpace,i,n)}function ft(e,t,i,n){switch(t){case _.Direct:return _t(e,i,n);case _.Horizontal:case _.Vertical:{const{elevationAlignedStartPoint:a,elevationAlignedEndPoint:s,dimension:o,geometry:l}=i;let r;o.measureType===_.Direct?(r=Ui(l,n)===a.z>s.z,t===_.Horizontal&&(r=!r)):r=!Fi(l);const[c,p]=r?[a,s]:[s,a],h=Y(p,ji);return t===_.Horizontal?h.z=c.z:(h.x=c.x,h.y=c.y),n.toRenderCoords(c,e.startRenderSpace),n.toRenderCoords(h,e.endRenderSpace),e}}}function _t(e,t,i){return i.toRenderCoords(t.elevationAlignedStartPoint,e.startRenderSpace),i.toRenderCoords(t.elevationAlignedEndPoint,e.endRenderSpace),e}function Ui(e,t){const i=e.directSegment.eval(.5,g.get()),n=t.worldUpAtPosition(i,g.get()),a=e.dimensionSegment.eval(.5,g.get()),s=k(g.get(),a,i);return!it(s,X)&&E(s,n)>0}function Fi(e){const{startRenderSpace:t,endRenderSpace:i}=e.dimensionSegment,{startRenderSpace:n,endRenderSpace:a}=e.directSegment;return Ue(n,t)s?[o,n]:[n,o]}function ye(e,t,i){const n=t.directSegment.eval(.5,g.get());return i.worldUpAtPosition(n,e)}function ke(e,t){const{startRenderSpace:i,endRenderSpace:n}=t.directSegment;return k(e,n,i)}function Ve(e,t,i={invert:!1}){const{startRenderSpace:n,endRenderSpace:a}=t.dimensionSegment;return i.invert?k(e,n,a):k(e,a,n)}function $e(e,t){const i=e.directSegment.eval(.5,g.get());return t.headingAtPosition(i,e.primaryOffsetAxis)}function Wi(e,t){return Me(Ve(Xi,e))/t**2}const Xi=b();function yt(e){const{elevationAlignedStartPoint:t,elevationAlignedEndPoint:i}=e;if(t==null||i==null)return!1;const n=hi(t,i);return n!=null&&tt(n,"meters").value>St}const St=1e5;function ne(e){return e.geometry!=null}let U=class extends Z{constructor(t){super(t)}initialize(){const t=fe(()=>this.analysisViewData.computations,({computation:i})=>this._watchComputation(i));this.addHandles(ae(t))}get analysis(){return this.analysisViewData.analysis}get _defaultUnit(){return Et(this.view)}_watchComputation(t){return v(()=>pe(t),i=>{const{measureType:n}=i;if(yt(i)&&n!==_.Direct){const s=Math.round(Lt(St,"meters","kilometers"));return nt.getLogger(this).warnOnce(`A ${n} dimension in the analysis (id: '${this.analysis.id}') will not display, because only direct dimensions can measure lengths greater than ${s} km. Update the measureType of the affected dimension to "direct" to display it.`),void(t.geometry=null)}const a=me(i,this.view.renderCoordsHelper,t.geometry);t.geometry=a,t.result.length=Gi(a,n,this._defaultUnit)},x)}};d([u({constructOnly:!0})],U.prototype,"analysisViewData",void 0),d([u({constructOnly:!0})],U.prototype,"view",void 0),d([u()],U.prototype,"analysis",null),d([u()],U.prototype,"_defaultUnit",null),U=d([G("esri.views.3d.analysis.Dimension.support.DimensionController")],U);function he(e){return Gt(e.accentColor,.5)}function Zi(e){return It(e.accentColor)}const Mt=5,Ki=new j([127,127,127,.5]),wt=.8,Qi=4,Yi=6,Ji=.1,Pt=.5,en=18,tn=2,nn=.3,an=2,sn=.25,on=20,rn=5,Ze=5,Ke=10,ln=2500,dn=50,cn=2;class un{constructor(t){this.start=t.start,this.end=t.end,this.offset=t.offset,this.heading=t.heading,this.rotation=t.rotation,this.direct=t.direct,this.horizontal=t.horizontal,this.vertical=t.vertical}manipulatorName(t){return Object.keys(this).find(i=>this.hasOwnProperty(i)&&t===this[i])}values(){return[this.start,this.end,this.offset,this.heading,this.rotation,this.direct,this.horizontal,this.vertical]}forEachMeasureTypeManipulator(t){for(const i of ci)t(this.manipulatorForMeasureType(i),i)}manipulatorForMeasureType(t){switch(t){case _.Direct:return this.direct;case _.Horizontal:return this.horizontal;case _.Vertical:return this.vertical}}}class pn extends _e{constructor(t,i){const n=gi(j.toUnitRGBA(he(t.effectiveTheme))),a=[new H(Ut(n,1,32,32),V)];super({view:t,renderObjects:a,metadata:i.metadata,available:!1,grabCursor:"crosshair",radius:Mt,collisionPriority:1}),this._themeHandle=v(()=>({color:j.toUnitRGBA(he(t.effectiveTheme))}),s=>n.setParameters(s))}destroy(){this._themeHandle.remove(),super.destroy()}}function mn(e,t){const i=[ce(-.5,0,0),ce(.5,0,0)],n=ee(t.unfocusedMaterial,i.map(s=>se(b(),s,Pt))),a=n.instantiate({material:t.focusedMaterial});return new _e({view:e,renderObjects:[new H(n,R.Unfocused|R.Selected|V),new H(a,R.Focused|V)],collisionType:{type:"line",paths:[i]},radius:Ee(t.lineSizePt)/2,metadata:t.metadata,available:!1,...mt})}class Qe extends _e{constructor(t,{lineSizePt:i,material:n,metadata:a}){super({view:t,autoScaleRenderObjects:!1,collisionPriority:1,metadata:a}),this._options={calloutColor:Ft(),lineSizePt:i,material:n},this._themeHandle=v(()=>j.toUnitRGBA(he(t.effectiveTheme)),s=>{this._options.calloutColor=s,Je(this,Ye({...this._options,metadata:this.metadata}))},te)}update({lineSizePt:t,material:i}){this._options.lineSizePt=t,this._options.material=i,Je(this,Ye({...this._options,metadata:this.metadata}))}destroy(){this._themeHandle.remove(),super.destroy()}}function Ye({calloutColor:e,lineSizePt:t,material:i,metadata:n}){return{calloutLength:.25*jt*wt*A(t)+en,calloutColor:e,calloutWidth:tn,customStateMask:V,discScale:nn,focusMultiplier:an,material:i,metadata:n}}function hn(e,t){const i=[ce(-.5,0,0),ce(.5,0,0)],n=ee(t.thinOffsetManipulatorMaterial,i),a=ee(t.unfocusedMaterial,i.map(o=>se(b(),o,Pt))),s=a.instantiate({material:t.focusedMaterial});return new _e({view:e,renderObjects:[new H(a,R.Unfocused|V),new H(s,R.Focused|V),new H(n,V)],collisionType:{type:"line",paths:[i]},radius:Ee(t.lineSizePt)/2,available:!1,metadata:t.metadata,...mt})}function gn(e,{isStart:t,createSnappingPipelineStep:i,dimension:n,onUpdate:a,view:s}){const o=t?"startPoint":"endPoint";return[oe(e,(r,c,p,h)=>{const m=He(r),{snappingStep:S,cancelSnapping:f}=i(h);p=p.next(m).next(ze(n,[o,"measureType","orientation"])).next(f),c.next(m).next(_i(s)).next(...S).next(M=>{const y=Y(M.mapEnd,new W);a(o==="startPoint"?{startPoint:y}:{endPoint:y})})})]}function fn(e,{computation:t,view:i}){return[oe(e,(n,a,s)=>{if(!ne(t)||!n.selected)return;const{geometry:o,dimension:l}=t,r=He(n);a.next(r).next(Ct(i,l,o.dimensionSegment,o.primaryOffsetAxis)),s.next(r).next(ze(l,["offset"]))})]}function _n(e,{computation:t,view:i}){return[oe(e,(n,a,s)=>{bt({cancel:s,computation:t,settingHeading:!0,steps:a,view:i})})]}function vn(e,{computation:t,view:i}){return[oe(e,(n,a,s)=>{bt({cancel:s,computation:t,settingHeading:!1,steps:a,view:i})}),e.events.on("immediate-click",n=>{yn(n,t,i)})]}function yn(e,t,i){const{dimension:n,geometry:a}=t;if(n.orientation===90||n.orientation===270)return n.orientation=0,void e.stopPropagation();if(a==null)return;const{renderCoordsHelper:s}=i,o=me({...pe(t),orientation:90},s),l=me({...pe(t),orientation:270},s);if(o==null||l==null)return;const r=$e(o,s),c=$e(l,s),p=Ot(a,i),h=we.shortestSignedDiff(p,r),m=we.shortestSignedDiff(p,c);n.orientation=Math.abs(h){f.action==="start"&&T(c,f.renderStart);const M=qt(m),y=fi(c,f.renderEnd,p,M);let L=S-Nt(y);n||(L=Sn(L)),l.orientation=L}),t.next(ze(l,["orientation"]))}function Sn(e){const t=we.normalize(e)%90;return t{if(l.action!=="start"||!ne(t))return;const{dimension:r,geometry:c}=t;a=r.measureType,s=r.offset,o=r.orientation;const p=T(g.get(),e.renderLocation);r.measureType=i,r.offset=Bi(p,i,c,n.renderCoordsHelper),r.orientation=0}),oe(e,(l,r,c)=>{if(!ne(t))return;const{geometry:p,dimension:h}=t,{renderCoordsHelper:m}=n,S=ft(xt,i,t,m),f=ve(g.get(),{measureType:i,directSegment:p.directSegment,renderCoordsHelper:m}),M=He(l);r.next(M).next(Ct(n,h,S,f)),c.next(M).next(y=>(h.measureType=a,h.offset=s,h.orientation=o,y))})]}function Ct(e,t,i,n){const a=st(g.get(),i.endRenderSpace,i.startRenderSpace);F(a,a,n);const s=Pe(i.startRenderSpace,a,be()),o=Pe(i.startRenderSpace,n,be()),l=t.offset;let r,c=0;const p=new vi;return p.next(ht(e,s)).next(h=>{h.action==="start"&&(c=Fe(o,h.renderStart));const m=(Fe(o,h.renderEnd)-c)*e.renderCoordsHelper.unitInMeters;t.offset=l+m,r=h}),h=>(p.execute(h),r)}function Ot(e,t){const{directSegment:i}=e,{renderCoordsHelper:n}=t,a=ye(g.get(),e,n),s=ke(g.get(),e),o=F(g.get(),s,a),{viewForward:l}=t.state.camera;E(o,l)>0&&se(o,o,-1);const r=i.eval(.5,g.get());return n.headingAtPosition(r,o)}function wn(e,t,i){const{dimensionSegment:n,primaryOffsetAxis:a}=t,s=Ve(J,t),o=ot(s,X)?Bt(ge):Ae(s,a,X,ge),l=Math.max(rt(s),Ji/i.unitInMeters);lt(o,o,dt(J,l,l,l)),e.modelTransform=o,e.renderLocation=n.eval(.5,J)}function Pn(e,t,i){$t(e,t,i,{forHeading:!0})}function bn(e,t,i){$t(e,t,i,{forHeading:!1})}function $t(e,t,i,{forHeading:n}){const{dimension:a,geometry:s}=t,{primaryOffsetAxis:o}=s,l=se(Cn,o,a.offset>=0?1:-1),r=Tt(On,{forHeading:n,geometry:s,renderCoordsHelper:i});F(r,r,l);const c=Ae(l,r,X,ge);e.modelTransform=c,e.renderLocation=Dt(J,s,s.dimensionSegment,i)}const Cn=b(),On=b();function $n(e,t,i,n){const{geometry:a}=t,s=ft(xt,i,t,n),o=ve(J,{measureType:i,directSegment:a.directSegment,renderCoordsHelper:n}),l=k(Se,s.endRenderSpace,s.startRenderSpace),r=Ae(l,o,X,ge),c=rt(l);lt(r,r,dt(Se,c,c,c)),e.modelTransform=r,e.renderLocation=s.eval(.5,Se)}function Dt(e,t,i,n){const{startRenderSpace:a,endRenderSpace:s}=i,o=Dn(t,n)?a:s;return T(e,o)}function Tt(e,{forHeading:t,geometry:i,renderCoordsHelper:n}){return t?ye(e,i,n):Ve(e,i,{invert:!0})}function Dn(e,t){const i=ke(Tn,e),n=ye(xn,e,t);return E(i,n)>0}const Tn=b(),xn=b();function An(e){return A(e)+Qi}function Ee(e){return A(e)+Yi}function Je(e,t){var S;const i=t.material??new gt({transparent:!0,writeDepth:!1,textureId:(S=t.texture)==null?void 0:S.id,renderOccluded:P.Opaque,isDecoration:!0}),n=t.focusMultiplier??re.focusMultiplier,a=t.calloutLength??re.calloutLength,s=re.discRadius*(t.discScale??1),o=s*n,l=(f,M)=>{const y=[0,1,2,2,3,0];return new Wt(M,[[je.POSITION,new Be([a-f,-f,0,a+f,-f,0,a+f,f,0,a-f,f,0],y,3,!0)],[je.UV0,new Be([0,0,1,0,1,1,0,1],y,2,!0)]])},r=t.calloutWidth??re.calloutWidth,c=new q({width:r,color:t.calloutColor,renderOccluded:P.OccludeAndTransparent,isDecoration:!0}),p=ee(c,[[0,0,0],[a-s,0,0]]),h=ee(c,[[0,0,0],[a-o,0,0]]),m=t.customStateMask??at.None;e.collisionType={type:"disc",direction:[0,0,1],offset:[a,0,0]},e.focusMultiplier=n,e.metadata=t.metadata,e.radius=s,e.renderObjects=[new H(l(s,i),R.Unfocused|m),new H(p,R.Unfocused|m),new H(l(o,i),R.Focused|m),new H(h,R.Focused|m)]}const V=at.Custom1,J=b(),Se=b(),ge=De(),xt=new B;var D;function Hn(e,t){return{enabled:t.effectiveFeatureEnabled,elevationAlignedStartPoint:e.elevationAlignedStartPoint,elevationAlignedEndPoint:e.elevationAlignedEndPoint,geometry:e.geometry}}function zn(e,t){if(yt(e))return D.Direct;if(!e.enabled)return null;const{geometry:i}=e;if(i==null||ot(i.directSegment.startRenderSpace,i.directSegment.endRenderSpace))return null;const{camera:n}=t.state,a=ye(g.get(),i,t.renderCoordsHelper),s=ke(g.get(),i),o=se(g.get(),a,E(s,a)),l=st(g.get(),s,o),r=Me(l),c=Me(o),{startRenderSpace:p,endRenderSpace:h}=i.directSegment,m=Math.max(n.computeScreenPixelSizeAt(p)*Ke,n.computeScreenPixelSizeAt(h)*Ke)**2;return r{"startPoint"in t?r.startPoint=t.startPoint:"endPoint"in t&&(r.endPoint=t.endPoint)};if(n==null)h(),c!=null&&p!=null&&(r.measureType=p.measureType,r.orientation=p.orientation);else switch(r.measureType=_.Direct,n){case D.Horizontal:if(n!==c&&(r.orientation=0),"startPoint"in t){const m=t.startPoint;m!=null&&(m.z=s.z),r.startPoint=m}else if("endPoint"in t){const m=t.endPoint;m!=null&&(m.z=a.z),r.endPoint=m}break;case D.Vertical:if(n!==c&&(r.orientation=Ot(o,l)),"startPoint"in t){const m=t.startPoint;m!=null&&(m.x=s.x,m.y=s.y),r.startPoint=m}else if("endPoint"in t){const m=t.endPoint;m!=null&&(m.x=a.x,m.y=a.y),r.endPoint=m}break;case D.Direct:n!==c&&p!=null&&(r.orientation=p.orientation),h()}e.previousConstraint=n,e.unconstrainedGeometry=o}(function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.Direct=2]="Direct"})(D||(D={}));let w=class extends Z{constructor(e){super(e),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new ct,this._orientationManipulatorTexture=null,this._updatingHandles=new Xt,this._getSnappingContext=Zt(n=>new Di({elevationInfo:{mode:"absolute-height",offset:0},pointer:n,editGeometryOperations:new bi(new Ci("point",Oi(!0,!1,this.view.spatialReference))),visualizer:new Si}));const{view:t}=e;this._snappingManagerResult=$i(t),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:ue(2)}),this._constraintSnappingIndicator=new I({view:t,attached:!0,width:1,renderOccluded:P.OccludeAndTransparent,stipplePattern:ue(5),isDecoration:!0});const i=j.toUnitRGBA(Ki);this._stagedStartIndicator=new Pi({view:t,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:e.view.renderCoordsHelper.spatialReference,color:i,size:2*Mt,outlineSize:0,renderOccluded:P.OccludeAndTransparent,isDecoration:!0})}initialize(){var n;const{view:e}=this;this._snappingOperation=new xi({view:e});const t=!((n=e._stage)!=null&&n.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result);this._orientationManipulatorMaterial=new gt({transparent:!0,writeDepth:!1,renderOccluded:P.Opaque,isDecoration:!0}),this.addHandles(v(()=>({accentColor:he(e.effectiveTheme),contrastColor:Zi(e.effectiveTheme)}),({accentColor:a,contrastColor:s})=>{const o=this._orientationManipulatorTexture,l=yi(e.textures,{accentColor:a,contrastColor:s,preMultiplyAlpha:t});this._orientationManipulatorMaterial.setParameters({textureId:l.texture.id}),this._orientationManipulatorTexture=l,o==null||o.release();const r=j.toUnitRGBA(a);this._unfocusedOffsetManipulatorMaterial.setParameters({color:r}),this._focusedOffsetManipulatorMaterial.setParameters({color:r}),this._thinOffsetManipulatorMaterial.setParameters({color:r}),this._constraintSnappingIndicator.color=r},te));const i=fe(()=>this.analysisViewData.computations,({computation:a})=>this._createManipulators(a));this.addHandles(ae(i)),this.addHandles([v(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:a,stagedComputation:s})=>{if(s==null||a==null)return;const o=Y(a,new W);this._applyPointUpdate(s,{endPoint:o})},Ce),v(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(a,s)=>{const{stagedDimension:o,selectedComputation:l,firstGrabbedManipulator:r}=a;if(o===(s==null?void 0:s.stagedDimension)&&r===(s==null?void 0:s.firstGrabbedManipulator)){for(const c of[l,s==null?void 0:s.selectedComputation])if(c!=null){const p=this._computationManipulators.get(c);p!=null&&this._updateManipulators(c,p,a)}}else for(const[c,p]of this._computationManipulators)this._updateManipulators(c,p,a)},x),v(()=>this.analysis.style.lineSize,a=>{this._updateManipulatorStyle(a)},te),v(()=>this.view.state.camera,()=>{this._stagedComputation!=null&&this._updateStagedDimensionOffset(this._stagedComputation)}),v(()=>{const a=this._stagedComputation;if(!a)return null;const s=a.elevationAlignedStartPoint,o=b();return s!=null&&this.view.renderCoordsHelper.toRenderCoords(s,o)?o:null},a=>{a!=null?(this._stagedStartIndicator.vertices=[a],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),Kt(this,()=>{const a=this._activeComputation,s=this._stagedComputation;if(a==null||s!=null){const o=this.view.inputManager.latestPointerType??"mouse",l=this._getSnappingContext(o);this._updatingHandles.addPromise(qe(this._snappingOperation.resnap(this._snappingManager,l)))}if(a!=null){const{start:o,end:l}=this._computationManipulators.get(a);if(o.grabbing||l.grabbing){const r=o.grabbing?"start":"end",c=this._computeConstraint(a);Rn(a,r,{constraint:c,view:this.view})}}})}destroy(){var e;this._snappingOperation=Te(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),(e=this._orientationManipulatorTexture)==null||e.release()}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(this._stagedComputation!=null)return this._stagedComputation;const{selectedComputation:e}=this.analysisViewData;return this.hasGrabbedManipulators&&e!=null?e:null}get _stagedComputation(){var i;const e=this._stagedDimension,t=(i=this.analysisViewData.computations.at(-1))==null?void 0:i.computation;return e==null||t==null||t.dimension!==e?null:t}get _constraintHandles(){return[xe(()=>this.analysisViewData.selectedComputation,e=>{e.previousConstraint=this._computeConstraint(e)},{...x,equals:Oe}),v(()=>{const e=this._activeComputation;if(e==null)return null;const{measureType:t,orientation:i}=e.dimension;return{measureType:t,orientation:i,computation:e}},(e,t)=>{if(e!=null&&t==null){const{measureType:i,orientation:n,computation:a}=e;switch(a.previousConstraint){case D.Horizontal:a.preConstraintProperties={measureType:_.Horizontal,orientation:0};break;case D.Vertical:a.preConstraintProperties={measureType:_.Vertical,orientation:0};break;case D.Direct:a.preConstraintProperties={measureType:_.Direct,orientation:n};break;default:a.preConstraintProperties={measureType:i,orientation:n}}}e==null&&t!=null&&(t.computation.preConstraintProperties=null)},Ce)]}get _snappingIndicatorHandles(){const e="snapping-indicator-event-handles";return[v(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:t,activeComputation:i})=>{const n=this._constraintSnappingIndicator;if(this.removeHandles(e),i!=null)if(i===t)n.attached=!0;else{const{start:a,end:s}=this._computationManipulators.get(i),o=()=>{n.attached=a.grabbing||s.grabbing};o(),this.addHandles([a.events.on("grab-changed",o),s.events.on("grab-changed",o)],e)}else n.attached=!1}),v(()=>{const t=this._activeComputation;return t!=null?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:i})=>{const n=this._constraintSnappingIndicator;t!=null&&i!=null&&i!==D.Direct?(n.visible=!0,n.setGeometryFromSegment(t.directSegment)):n.visible=!1})]}removeStaged(){return this._stagedDimension!=null&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(e){const{_stagedDimension:t}=this;if(t==null){const i=this._onUnstagedClick(e);return this.analysis.dimensions.add(i),null}return this._onStagedClick(e),t}onPointerMove({mapPoint:e,pointerType:t}){if(t==="touch")return;const i=this._getSnappingContext(t);this._updatingHandles.addPromise(qe(this._snappingOperation.snap({point:e},this._snappingManager,i)))}onManipulatorSelectionChanged(){this.analysisViewData.selectedComputation!=null&&(this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null))}_onUnstagedClick({mapPoint:e,pointerType:t}){let i=e;if(t==="mouse"){const a=this._getSnappingContext(t);i=this._snappingManager.update({point:e,context:a})}const n=new ui({startPoint:Y(i,new W),endPoint:null,measureType:_.Horizontal});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:e,pointerType:t}){const i=this._stagedComputation;if(i==null)return;let n=e;if(t==="mouse"){const s=this._getSnappingContext(t);n=this._snappingManager.update({point:e,context:s})}const a=Y(n,new W);this._applyPointUpdate(i,{endPoint:a}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(e){const t=this._setupPointManipulator(e,{isStart:!0}),i=this._setupPointManipulator(e,{isStart:!1}),n=this._setupOffsetManipulator(e),a=this._setupHeadingManipulator(e),s=this._setupRotationManipulator(e),o=this._setupMeasureTypeManipulator(e,_.Direct),l=this._setupMeasureTypeManipulator(e,_.Horizontal),r=this._setupMeasureTypeManipulator(e,_.Vertical),c=new un({start:t,end:i,offset:n,heading:a,rotation:s,direct:o,horizontal:l,vertical:r});return this._setupComputationToManipulatorsSync(e,c),this._computationManipulators.set(e,c),this.manipulators.addMany(c.values()),{manipulators:c,remove:()=>{this._computationHandles.remove(e),this._computationManipulators.delete(e);for(const p of c.values())this.manipulators.remove(p)}}}_setupComputationToManipulatorsSync(e,t){this._computationHandles.add([v(()=>e.geometry,()=>this._updateManipulators(e,t),{...x,equals:Oe})],e)}_setupPointManipulator(e,t){const{view:i}=this,{dimension:n}=e,a=new pn(i,{metadata:n}),s=gn(a,{isStart:t.isStart,createSnappingPipelineStep:o=>Ti({snappingContext:this._getSnappingContext(o),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:n,onUpdate:o=>this._applyPointUpdate(e,o),view:i});return this._computationHandles.add(s,e),a}_setupOffsetManipulator(e){const{view:t}=this,i=mn(t,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:e.dimension}),n=fn(i,{computation:e,view:t});return this._computationHandles.add(n,e),i}_setupHeadingManipulator(e){const{view:t}=this,i=new Qe(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),n=_n(i,{computation:e,view:t});return this._computationHandles.add(n,e),i}_setupRotationManipulator(e){const{view:t}=this,i=new Qe(t,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:e.dimension}),n=vn(i,{computation:e,view:t});return this._computationHandles.add(n,e),i}_setupMeasureTypeManipulator(e,t){const{view:i}=this,n=hn(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:e.dimension}),a=Mn(n,{computation:e,manipulatorMeasureType:t,view:i});return this._computationHandles.add(a,e),n}_updateManipulators(e,t,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:n,selectedComputation:a,firstGrabbedManipulator:s}=i,{start:o,end:l,offset:r,heading:c,rotation:p}=t,h=a===e,m=ne(e),{dimension:S}=e;for(const y of t.values()){const L=m&&n==null&&(s==null||y===s);y===r?(y.available=L,y.selected=h):y.available=L&&h}if(!m)return;this._computeConstraint(e)!=null?t.forEachMeasureTypeManipulator(y=>y.available=!1):t.manipulatorForMeasureType(S.measureType).available=!1;for(const y of[c,p])S.measureType===_.Direct&&S.offset!==0||(y.available=!1);Re(e)?p.available=!1:c.available=!1;const{geometry:f}=e;o.renderLocation=f.directSegment.startRenderSpace,l.renderLocation=f.directSegment.endRenderSpace;const{renderCoordsHelper:M}=this.view;wn(r,f,M),c.available&&Pn(c,e,M),p.available&&bn(p,e,M),t.forEachMeasureTypeManipulator((y,L)=>{y.available&&$n(y,e,L,M)})}_updateManipulatorStyle(e){const t=An(e),i=Ee(e),n={lineSizePt:e,material:this._orientationManipulatorMaterial};for(const{offset:a,heading:s,rotation:o}of this._computationManipulators.values())a.radius=i/2,s.update(n),o.update(n);this._unfocusedOffsetManipulatorMaterial.setParameters({width:t}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(e,t){const{view:i}=this,n=pe(e);"startPoint"in t&&(n.elevationAlignedStartPoint=t.startPoint),"endPoint"in t&&(n.elevationAlignedEndPoint=t.endPoint);const a=me(n,i.renderCoordsHelper);if(a==null)return;const s=this._computeConstraint({...n,geometry:a});At(e,t,{...n,constraint:s,unconstrainedGeometry:a,view:i}),e===this._stagedComputation&&this._updateStagedDimensionOffset(e)}_updateStagedDimensionOffset(e){if(e.geometry==null)return;e.geometry.directSegment.eval(.5,et);const t=this.view.state.camera.computeScreenPixelSizeAt(et);e.dimension.offset=dn*t}_computeConstraint(e){return zn(Hn(e,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new q({width:1,renderOccluded:P.OccludeAndTransparent,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get testInfo(){const e=t=>{var i;return(i=this.analysisViewData.computations.find(({computation:n})=>n.dimension===t))==null?void 0:i.computation};return{disableManipulatorPartialOcclusion:()=>{this._stagedStartIndicator.renderOccluded=P.Occlude,this.manipulators.forEach(({manipulator:t})=>{for(const{geometry:i}of t.renderObjects)i.material.setParameters({renderOccluded:P.Occlude})})},getManipulatorsForDimension:t=>this._computationManipulators.get(e(t)),getComputationForDimension:t=>e(t),getConstraintForDimension:t=>{const i=e(t);return i!=null?this._computeConstraint(i):null},stagedDimension:this._stagedDimension,stagedStartIndicator:this._stagedStartIndicator,constraintSnappingIndicator:this._constraintSnappingIndicator,snappingManager:this._snappingManager}}};d([u({constructOnly:!0})],w.prototype,"analysis",void 0),d([u({constructOnly:!0})],w.prototype,"analysisViewData",void 0),d([u({constructOnly:!0})],w.prototype,"manipulators",void 0),d([u({constructOnly:!0})],w.prototype,"parentTool",void 0),d([u({constructOnly:!0,nonNullable:!0})],w.prototype,"view",void 0),d([u({readOnly:!0})],w.prototype,"updating",null),d([u()],w.prototype,"firstGrabbedManipulator",null),d([u()],w.prototype,"hasGrabbedManipulators",null),d([u()],w.prototype,"snappingOptions",null),d([u()],w.prototype,"_stagedDimension",void 0),d([u()],w.prototype,"_activeComputation",null),d([u()],w.prototype,"_stagedComputation",null),w=d([G("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],w);const et=b();var N;(function(e){e.Ready="ready",e.Creating="creating",e.Created="created"})(N||(N={}));let O=class extends Ai{constructor(e){super(e),this.automaticManipulatorSelection=!1,this.removeIncompleteOnCancel=!1,this._pointerMoveTimerMs=ln,this._prevPointerMoveTimeout=null}initialize(){this._intersector=Qt(this.view.state.viewingMode),this._intersector.options.store=Yt.MIN,this._lengthDimensionSubTool=new w({analysis:this.analysis,analysisViewData:this.analysisViewData,manipulators:this.manipulators,parentTool:this,view:this.view}),this.addHandles([ae(this._lengthDimensionSubTool),ut(()=>this._clearPointerMoveTimeout()),v(()=>this.state,e=>{e===N.Created&&this.finishToolCreation()},x),xe(()=>this.firstGrabbedManipulator,e=>{this.selectedDimension=e.metadata},x),v(()=>this.selectedDimension,()=>this._resetPointerMoveTimeout(),x)])}get state(){return this.analysis.dimensions.some(e=>e.type==="length")?this._activeSubTool!=null?N.Creating:N.Created:N.Ready}get updating(){return this._lengthDimensionSubTool.updating}get cursor(){return this.active?"crosshair":null}get selectedDimension(){return this.analysisViewData.selectedDimension}set selectedDimension(e){this.analysisViewData.selectedDimension=e}onInputEvent(e){switch(e.type){case"immediate-click":this._clickHandler(e);break;case"immediate-double-click":this._doubleClickHandler(e);break;case"pointer-move":this._pointerMoveHandler(e);break;case"key-down":if(Ne.cancel===e.key){if(this._activeSubTool!=null&&this._activeSubTool.removeStaged())return void e.stopPropagation();this.active||(this.selectedDimension=null)}else Ne.delete.includes(e.key)&&this._deleteKeyHandler()}}onActivate(){this._activeSubTool=this._lengthDimensionSubTool}onDeactivate(){this._activeSubTool!=null&&(this._activeSubTool.onDeactivate(),this._activeSubTool=null)}onShow(){this._resetPointerMoveTimeout()}onManipulatorSelectionChanged(){this._lengthDimensionSubTool.onManipulatorSelectionChanged()}onHide(){this.selectedDimension=null}_clickHandler(e){if(this.hasFocusedManipulators)return void e.stopPropagation();if(this._activeSubTool==null)return;const t=this._intersectScreen(e);t!=null&&(this.selectedDimension=this._activeSubTool.onClick({mapPoint:t,pointerType:e.pointerType}),e.stopPropagation())}_doubleClickHandler(e){this.active&&(this.view.activeTool=null,e.stopPropagation())}_pointerMoveHandler(e){if(this._resetPointerMoveTimeout(),this._activeSubTool==null||this.hasFocusedManipulators)return;const t=this._intersectScreen(e);t!=null&&this._activeSubTool.onPointerMove({mapPoint:t,pointerType:e.pointerType})}_deleteKeyHandler(){this._activeSubTool!=null&&this._activeSubTool.removeStaged(),this._removeSelected()}_intersectScreen(e){const t=Jt(e);this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector);const i=this._intersector.results.min,n=g.get();return i.getIntersectionPoint(n)?this.view.renderCoordsHelper.fromRenderCoords(n,this.view.spatialReference):null}_removeSelected(){this.selectedDimension!=null&&(this.analysis.dimensions.remove(this.selectedDimension),this.selectedDimension=null)}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=ei(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.manipulators.forEach(e=>e.manipulator.state|=V),this._prevPointerMoveTimeout=ti.setTimeout(()=>{this.manipulators.forEach(e=>e.manipulator.state&=~V)},this._pointerMoveTimerMs)}get testInfo(){return{...this._lengthDimensionSubTool.testInfo,setManipulatorAutoHideDelay:e=>{this._pointerMoveTimerMs=e,this._resetPointerMoveTimeout()}}}};d([u({constructOnly:!0})],O.prototype,"view",void 0),d([u({constructOnly:!0})],O.prototype,"analysis",void 0),d([u({readOnly:!0})],O.prototype,"state",null),d([u({readOnly:!0})],O.prototype,"updating",null),d([u({readOnly:!0})],O.prototype,"cursor",null),d([u({constructOnly:!0})],O.prototype,"analysisViewData",void 0),d([u()],O.prototype,"selectedDimension",null),d([u()],O.prototype,"automaticManipulatorSelection",void 0),d([u()],O.prototype,"_activeSubTool",void 0),d([u()],O.prototype,"_lengthDimensionSubTool",void 0),O=d([G("esri.views.3d.analysis.Dimension.DimensionTool")],O);class kn extends ki{constructor(t,i){super(t),this._hasExternalMaterial=!1,this._renderOccluded=P.OccludeAndTransparent,this._width=1,this._color=zi(1,0,1,1),this._placement="end",this._markerPrimitive="arrow",this._material=i,this._hasExternalMaterial=i!=null,this.applyProperties(t)}setGeometryFromSegment(t,i){const n=t.endRenderSpace;this.transform=ii(Vn,n),this._normal=i;const{points:a}=t.createRenderGeometry(n,this.view.renderCoordsHelper);this.geometry=[a]}get renderOccluded(){return this._material!=null?this._material.parameters.renderOccluded:this._renderOccluded}set renderOccluded(t){this._renderOccluded=t,this._material!=null&&this._material.setParameters({renderOccluded:t})}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this.recreateGeometry()}get normal(){return this._normal}set normal(t){this._normal=t,this.recreateGeometry()}get width(){return this._material!=null?this._material.parameters.width:this._width}set width(t){this._width=t,this._material!=null&&this._material.setParameters({width:t})}get color(){return this._material!=null?this._material.parameters.color:this._color}set color(t){this._color=Ri(t),this._material!=null&&this._material.setParameters({color:this._color})}get placement(){return this._material!=null?this._material.parameters.placement:this._placement}set placement(t){this._placement=t,this._material!=null&&this._material.setParameters({placement:this._placement})}get markerPrimitive(){var t;return((t=this._material)==null?void 0:t.parameters.markerPrimitive)??this._markerPrimitive}set markerPrimitive(t){this._markerPrimitive=t,this._material!=null&&this._material.setParameters({markerPrimitive:t})}createExternalResources(){this._hasExternalMaterial||(this._material=new pt({width:this._width,color:this._color,placement:this._placement,renderOccluded:this._renderOccluded,markerPrimitive:this._markerPrimitive,isDecoration:this.isDecoration}))}destroyExternalResources(){this._hasExternalMaterial||(this._material=null)}createGeometries(t){for(const i of ni(this.geometry,this.normal)){const n=ai(this._material,i);t.addGeometry(n)}}forEachExternalMaterial(t){this._hasExternalMaterial||t(this._material)}}const Vn=De();let En=class{set visible(t){for(const i of this._visualElements.values())i.attached=t}constructor(t){this.destroyed=!1,this._handles=new ct,this._messages=null,this._labelSegment=new B;const{analysis:i,computation:n,view:a,messages:s,isDecoration:o}=t;this.analysis=i,this.computation=n,this.view=a,this._messages=s;const l=t.visible,r={view:a,attached:l,isDecoration:o},{fontSize:c,textColor:p,textBackgroundColor:h}=i.style;this._visualElements=new Un({marker:new kn(r,t.markerMaterial),dimension:new I(r,t.dimensionLineMaterial),startOffset:new I(r,t.offsetLineMaterial),endOffset:new I(r,t.offsetLineMaterial),dimensionSmall:new I(r,t.smallDimensionLineMaterial),startOffsetSmall:new I(r,t.smallOffsetLineMaterial),endOffsetSmall:new I(r,t.smallOffsetLineMaterial),label:new pi({view:a,attached:l,distance:0,geometry:{type:"segment",sampleLocation:"center",segment:this._labelSegment,callout:!1},fontSize:A(c),textColor:p.clone(),backgroundColor:h.clone(),isDecoration:o})}),this._handles.add([v(()=>n.geometry,m=>{this.updateCameraDependentElements(a.state.camera,m,i.style),n.geometry!=null&&this._updateLines(n.geometry)},{...te,equals:Oe}),v(()=>n.length,m=>this._updateLabelContent(m),te)])}destroy(){this.destroyed=!0,this._handles=Te(this._handles);for(const t of this._visualElements.values())t.destroy()}get testInfo(){return{dimensionVisualElement:this._visualElements.dimension,label:this._visualElements.label}}_updateLines(t){const i=Xe(Ln,ie.Start,t.directSegment,t.dimensionSegment),n=Xe(Gn,ie.End,t.directSegment,t.dimensionSegment),a=this._visualElements;a.marker.setGeometryFromSegment(t.dimensionSegment,t.primaryOffsetAxis),a.dimension.setGeometryFromSegment(t.dimensionSegment),a.startOffset.setGeometryFromSegment(i),a.endOffset.setGeometryFromSegment(n),a.dimensionSmall.setGeometryFromSegment(t.dimensionSegment),a.startOffsetSmall.setGeometryFromSegment(i),a.endOffsetSmall.setGeometryFromSegment(n)}updateCameraDependentElements(t,i,n){const a=this._visualElements;if(i==null){for(const M of a.values())M.visible=!1;return}const s=t.computeScreenPixelSizeAt(i.dimensionSegment.eval(.5,In)),o=Wi(i,s),l=o<(A(n.lineSize)*cn)**2,r=!l;a.marker.visible=r,a.dimension.visible=r,a.startOffset.visible=r,a.endOffset.visible=r,a.dimensionSmall.visible=l,a.startOffsetSmall.visible=l,a.endOffsetSmall.visible=l;const c=A(n.fontSize)*rn,{label:p}=a;if(p.visible=o>=c**2,!p.visible)return;const{dimensionSegment:h,primaryOffsetAxis:m}=i,{offset:S}=this.computation.dimension,f=(Math.sign(S)>=0?1:-1)*this._labelOffsetPx(n)*s;Ii(this._labelSegment,h,m,f),p.updateLabelPosition()}updateLabelStyle(t){const{label:i}=this._visualElements;i.fontSize=A(t.fontSize),i.textColor=t.textColor,i.backgroundColor=t.textBackgroundColor}updateUnitsMessages(t){this._messages=t;const{length:i}=this.computation;this._updateLabelContent(i)}_updateLabelContent(t){const{label:i}=this._visualElements;t!=null&&this._messages!=null?i.text=Hi(this._messages,t,t.unit):i.text=""}_labelOffsetPx(t){return 1.5*A(t.fontSize)+on+A(t.lineSize/2)}};const Ln=new B,Gn=new B,In=b();class Un{constructor(t){this.marker=t.marker,this.dimension=t.dimension,this.startOffset=t.startOffset,this.endOffset=t.endOffset,this.dimensionSmall=t.dimensionSmall,this.startOffsetSmall=t.startOffsetSmall,this.endOffsetSmall=t.endOffsetSmall,this.label=t.label}values(){return[this.marker,this.dimension,this.startOffset,this.endOffset,this.dimensionSmall,this.startOffsetSmall,this.endOffsetSmall,this.label]}}let z=class extends Z{get analysis(){return this.analysisViewData.analysis}get visible(){return this.analysisViewData.visible}constructor(e){super(e),this.loadingMessages=!1,this._messages=null}initialize(){const e=this.isDecoration;this._markerMaterial=new pt({width:1,anchor:si.Tip,color:K,placement:"begin-end",worldSpace:!0,hideOnShortSegments:!0,hasTip:!0,renderOccluded:P.OccludeAndTransparent,markerPrimitive:"triangle",isDecoration:e}),this._dimensionLineMaterial=new q({width:1,color:K,renderOccluded:P.OccludeAndTransparent,markerParameters:this._markerMaterial.parameters,isDecoration:e}),this._offsetLineMaterial=new q({width:1,color:K,renderOccluded:P.OccludeAndTransparent,stipplePattern:ue(5),isDecoration:e}),this._smallDimensionLineMaterial=new q({width:1,color:K,renderOccluded:P.OccludeAndTransparent,isDecoration:e}),this._smallOffsetLineMaterial=new q({width:1,color:K,renderOccluded:P.OccludeAndTransparent,stipplePattern:ue(5),isDecoration:e});for(const i of this._lineMaterials())this.view._stage.add(i),this.addHandles(ut(()=>{var n;(n=this.view._stage)==null||n.remove(i)}));const t=fe(()=>this.analysisViewData.computations,({computation:i})=>this._createVisualization(i));this._dimensionVisualizations=t,this.addHandles([ae(t),v(()=>j.toUnitRGBA(this.analysis.style.color),i=>{for(const n of this._lineMaterials())n.setParameters({color:i})},x),v(()=>this.analysis.style.lineSize,i=>{const n=A(i);this._markerMaterial.setParameters({width:n*wt}),this._dimensionLineMaterial.setParameters({width:n,markerParameters:this._markerMaterial.parameters});const a=Math.max(n*sn,1);this._offsetLineMaterial.setParameters({width:a})},x),v(()=>({camera:this.view.state.camera,style:Fn(this.analysis)}),({camera:i,style:n})=>{for(const{visualization:a}of this._dimensionVisualizations)a.updateCameraDependentElements(i,a.computation.geometry,n),a.updateLabelStyle(n)}),v(()=>this.visible,i=>{for(const{visualization:n}of this._dimensionVisualizations)n.visible=i})]),this.addHandles([oi(()=>this._updateMessageBundle()),xe(()=>!this.loadingMessages,()=>{for(const{visualization:i}of this._dimensionVisualizations)i.updateUnitsMessages(this._messages)},Ce)]),this._updateMessageBundle()}get testInfo(){return{visualizations:this._dimensionVisualizations.items.map(({visualization:e})=>e),disablePartialOcclusion:()=>{for(const e of this._lineMaterials())e.setParameters({renderOccluded:P.Occlude})}}}_createVisualization(e){const t=new En({analysis:this.analysis,computation:e,view:this.view,visible:this.visible,markerMaterial:this._markerMaterial,dimensionLineMaterial:this._dimensionLineMaterial,offsetLineMaterial:this._offsetLineMaterial,smallDimensionLineMaterial:this._smallDimensionLineMaterial,smallOffsetLineMaterial:this._smallOffsetLineMaterial,messages:this._messages,isDecoration:this.isDecoration});return{visualization:t,remove:()=>t.destroy()}}_lineMaterials(){return[this._markerMaterial,this._dimensionLineMaterial,this._offsetLineMaterial,this._smallDimensionLineMaterial,this._smallOffsetLineMaterial]}async _updateMessageBundle(){this.loadingMessages=!0;try{this._messages=await ri("esri/core/t9n/Units")}finally{this.loadingMessages=!1}}};function Fn(e){const{fontSize:t,lineSize:i,textColor:n,textBackgroundColor:a}=e.style;return{fontSize:t,lineSize:i,textBackgroundColor:a.clone(),textColor:n.clone()}}d([u({constructOnly:!0})],z.prototype,"analysisViewData",void 0),d([u({constructOnly:!0,nonNullable:!0})],z.prototype,"view",void 0),d([u({constructOnly:!0})],z.prototype,"isDecoration",void 0),d([u()],z.prototype,"analysis",null),d([u()],z.prototype,"visible",null),d([u()],z.prototype,"loadingMessages",void 0),z=d([G("esri.views.3d.analysis.Dimension.DimensionVisualization")],z);let Q=class extends Z{constructor(e){super(e),this.dimension=null,this.length=null}};d([u({constructOnly:!0,nonNullable:!0})],Q.prototype,"dimension",void 0),d([u()],Q.prototype,"length",void 0),Q=d([G("esri.views.3d.analysis.LengthDimensionResult")],Q);const jn=Q;let $=class extends Z{constructor(e){super(e),this.geometry=null,this.unconstrainedGeometry=null,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}normalizeCtorArgs(e){const{dimension:t,...i}=e;return{result:new jn({dimension:t}),...i}}initialize(){this.addHandles([v(()=>this.dimension.startPoint,e=>this.elevationAlignedStartPoint=this.projectAndAlignPoint(e),x),v(()=>this.dimension.endPoint,e=>this.elevationAlignedEndPoint=this.projectAndAlignPoint(e),x)])}get dimension(){return this.result.dimension}get length(){return this.result.length}};d([u({constructOnly:!0,nonNullable:!0})],$.prototype,"result",void 0),d([u({constructOnly:!0,nonNullable:!0})],$.prototype,"projectAndAlignPoint",void 0),d([u()],$.prototype,"dimension",null),d([u()],$.prototype,"length",null),d([u()],$.prototype,"geometry",void 0),d([u()],$.prototype,"unconstrainedGeometry",void 0),d([u()],$.prototype,"elevationAlignedStartPoint",void 0),d([u()],$.prototype,"elevationAlignedEndPoint",void 0),d([u()],$.prototype,"preConstraintProperties",void 0),d([u()],$.prototype,"previousConstraint",void 0),$=d([G("esri.views.3d.analysis.LengthDimensionComputation")],$);const Bn=e=>{let t=class extends e{constructor(...i){super(...i),this.analysis=null,this.tool=null,this.selectedDimension=null,this.interactive=!1,this.visible=null}get results(){return new li}createLengthDimensions(i){throw new Error("Method not implemented.")}};return d([u({constructOnly:!0})],t.prototype,"view",void 0),d([u({constructOnly:!0,nonNullable:!0})],t.prototype,"analysis",void 0),d([u()],t.prototype,"tool",void 0),d([u({readOnly:!0})],t.prototype,"results",null),d([u()],t.prototype,"selectedDimension",void 0),d([u()],t.prototype,"interactive",void 0),d([u()],t.prototype,"visible",void 0),t=d([G("esri.views.analysis.DimensionAnalysisView")],t),t};let C=class extends Bn(di(Z)){constructor(e){super(e),this.type="dimension-view-3d",this.tool=null,this.selectedDimension=null,this._dimensionsToComputations=new Map,this._placementTask=null,this._projectAndAlignPoint=null}initialize(){this._projectAndAlignPoint=t=>{if(t==null)return null;const{spatialReference:i,elevationProvider:n}=this.view,a=Mi(t,i,n);return a==null&&wi(this.analysis,t.spatialReference,nt.getLogger(this)),a};const e=fe(()=>this.analysis.dimensions,t=>this._createComputation(t));this.computations=e,this.addHandles([Vi(this,O),ae(e)]),this._analysisVisualization=new z({analysisViewData:this,view:this.view,isDecoration:!this.parent}),this._analysisController=new U({analysisViewData:this,view:this.view})}destroy(){this._placementTask=We(this._placementTask),this._analysisVisualization=Te(this._analysisVisualization),Ei(this)}get updating(){var e;return((e=this._analysisVisualization)==null?void 0:e.loadingMessages)??!1}get results(){return this.analysis.dimensions.map(e=>this._dimensionsToComputations.get(e).result)}get selectedComputation(){const{selectedDimension:e}=this;return e==null?null:this._dimensionsToComputations.get(e)}get testInfo(){return{visualization:this._analysisVisualization,controller:this._analysisController}}async createLengthDimensions(e){return this.selectedDimension=null,this._placementTask=We(this._placementTask),this._placementTask=Li(this,e),this._placementTask.promise}_createComputation(e){const{_dimensionsToComputations:t}=this,i=new $({dimension:e,projectAndAlignPoint:this._projectAndAlignPoint});return t.set(e,i),{computation:i,remove:()=>this._removeComputation(i)}}_removeComputation(e){const{dimension:t}=e;t===this.selectedDimension&&(this.selectedDimension=null),this._dimensionsToComputations.delete(t),e.destroy()}};d([u({readOnly:!0})],C.prototype,"type",void 0),d([u()],C.prototype,"tool",void 0),d([u()],C.prototype,"updating",null),d([u({readOnly:!0})],C.prototype,"results",null),d([u()],C.prototype,"computations",void 0),d([u()],C.prototype,"selectedDimension",void 0),d([u()],C.prototype,"selectedComputation",null),d([u()],C.prototype,"_analysisVisualization",void 0),d([u()],C.prototype,"_analysisController",void 0),d([u()],C.prototype,"_dimensionsToComputations",void 0),d([u()],C.prototype,"_placementTask",void 0),C=d([G("esri.views.3d.analysis.DimensionAnalysisView3D")],C);const $a=C;export{$a as default}; diff --git a/dist/assets/DimensionLayer-WWUzEsQc.js b/dist/assets/DimensionLayer-WWUzEsQc.js new file mode 100644 index 0000000..59d2d5e --- /dev/null +++ b/dist/assets/DimensionLayer-WWUzEsQc.js @@ -0,0 +1 @@ +import{iB as R,ab as u,e as t,y as n,ey as y,l1 as f,a4 as $,c as m,iE as O,V as x,fs as N,l2 as j,d as b,A as v,ef as E,l3 as S,dT as g,dM as q,dP as D,du as k,c7 as z}from"./index-J0iiHjMT.js";import{u as P}from"./LengthDimension-A_HnPDNi.js";let r=class extends R(O){constructor(e){super(e),this.type="simple",this.color=new u("black"),this.lineSize=2,this.fontSize=10,this.textColor=new u("black"),this.textBackgroundColor=new u([255,255,255,.6])}};t([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:u,nonNullable:!0,json:{type:[y],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:f,nonNullable:!0,range:{min:$(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:f,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:u,nonNullable:!0,json:{type:[y],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:u,nonNullable:!0,json:{type:[y],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const h=r,c=x.ofType(P);let l=class extends j{constructor(e){super(e),this.type="dimension",this.style=new h,this.extent=null}initialize(){this.addHandles(b(()=>this._computeExtent(),e=>{(e==null?void 0:e.pending)==null&&this._set("extent",e!=null?e.extent:null)},v))}get dimensions(){return this._get("dimensions")||new c}set dimensions(e){this._set("dimensions",E(e,this.dimensions,c))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,s)=>(e.push(s.startPoint,s.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const s=[];for(const o of this.dimensions)o.startPoint!=null&&s.push(o.startPoint),o.endPoint!=null&&s.push(o.endPoint);const a=S(s,e);if(a.pending!=null)return{pending:a.pending,extent:null};let d=null;return a.geometries!=null&&(d=a.geometries.reduce((o,p)=>o==null?p!=null?g.fromPoint(p):null:p!=null?o.union(g.fromPoint(p)):o,null)),{pending:null,extent:d}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],l.prototype,"type",void 0),t([n({cast:N,type:c,nonNullable:!0})],l.prototype,"dimensions",null),t([n({readOnly:!0})],l.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:h}},nonNullable:!0})],l.prototype,"style",void 0),t([n({value:null,readOnly:!0})],l.prototype,"extent",void 0),t([n({readOnly:!0})],l.prototype,"requiredPropertiesForEditing",null),l=t([m("esri.analysis.DimensionAnalysis")],l);const w=l;let i=class extends q(D(z)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new w,this.opacity=1,e){const{source:s,style:a}=e;s&&a&&(s.style=a)}}initialize(){this.addHandles([b(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},v)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new w)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,s,a,d){s.dimensions=e.filter(({startPoint:o,endPoint:p})=>o!=null&&p!=null).map(o=>o.toJSON(d)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],i.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],i.prototype,"source",void 0),t([n({readOnly:!0})],i.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:h}},json:{write:{ignoreOrigin:!0}}})],i.prototype,"style",null),t([n({readOnly:!0})],i.prototype,"fullExtent",null),t([n({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],i.prototype,"opacity",void 0),t([n({type:["show","hide"]})],i.prototype,"listMode",void 0),t([n({type:x.ofType(P),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],i.prototype,"dimensions",null),t([k("web-scene","dimensions")],i.prototype,"writeDimensions",null),i=t([m("esri.layers.DimensionLayer")],i);const T=i;export{T as default}; diff --git a/dist/assets/DimensionLayerView3D-sKnmIRMF.js b/dist/assets/DimensionLayerView3D-sKnmIRMF.js new file mode 100644 index 0000000..48f447c --- /dev/null +++ b/dist/assets/DimensionLayerView3D-sKnmIRMF.js @@ -0,0 +1,7 @@ +import{e as a,y as t,c as y,V as h,jP as w,d as u,A as d,E as V,b as c,n as p,a as _,g as m,de as v}from"./index-J0iiHjMT.js";import{n as A}from"./LayerView3D-iOx2MD1g.js";import{u as f}from"./LayerView-efDufa6j.js";const D=i=>{let s=class extends i{constructor(...e){super(...e),this.layer=null}get interactive(){return this.analysisView!=null&&this.analysisView.interactive}set interactive(e){this.analysisView!=null&&(this.analysisView.interactive=e)}get results(){return this.analysisView!=null?this.analysisView.results:new h}get selectedDimension(){return this.analysisView!=null?this.analysisView.selectedDimension:null}set selectedDimension(e){this.analysisView!=null&&(this.analysisView.selectedDimension=e)}async createLengthDimensions(e){if(this.analysisView==null)throw w();await this.analysisView.createLengthDimensions(e)}};return a([t()],s.prototype,"layer",void 0),a([t()],s.prototype,"interactive",null),a([t({readOnly:!0})],s.prototype,"results",null),a([t()],s.prototype,"selectedDimension",null),a([t()],s.prototype,"analysisView",void 0),s=a([y("esri.views.layers.DimensionLayerView")],s),s},o="analysis-view-handles";let n=class extends A(D(f)){constructor(i){super(i),this.type="dimension-3d",this._analysisModule=null}initialize(){this.addHandles(u(()=>this.layer.source,i=>{this._destroyAnalysisView(),i!=null&&this._createAnalysisView(i)},d),o)}destroy(){this.removeHandles(o),this._destroyAnalysisView()}isUpdating(){return this._createAnalysisViewTask!=null||this.analysisView!=null&&this.analysisView.updating}async whenAnalysisView(){if(this.analysisView!=null)return this.analysisView;if(this._createAnalysisViewTask!=null)return this._createAnalysisViewTask.promise;throw new V("layerview:no-analysisview-for-analysis","The analysis has not been set on the DimensionLayer of this layer view")}_createAnalysisView(i){const s=c(async e=>(this.analysisView=await this._createAnalysisViewPromise(i,e),this._createAnalysisViewTask===s&&(this._createAnalysisViewTask=null),this.analysisView));this.addResolvingPromise(s.promise),this._createAnalysisViewTask=s}_destroyAnalysisView(){this.analysisView=p(this.analysisView),this._createAnalysisViewTask=_(this._createAnalysisViewTask)}async _createAnalysisViewPromise(i,s){let e=this._analysisModule;if(e==null){const r=await this._loadAnalysisModule();this._analysisModule=r,e=r}const l=new e.default({analysis:i,view:this.view,parent:this});if(await l.when(),m(s))throw l.destroy(),w();return l}_loadAnalysisModule(){return v(()=>import("./DimensionAnalysisView3D-W2fgoQBr.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]))}};a([t()],n.prototype,"type",void 0),a([t()],n.prototype,"analysisView",void 0),a([t()],n.prototype,"_createAnalysisViewTask",void 0),n=a([y("esri.views.3d.layers.DimensionLayerView3D")],n);const $=n;export{$ as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/DimensionAnalysisView3D-W2fgoQBr.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/AnalysisView3D-jkk3JIRT.js","assets/LengthDimension-A_HnPDNi.js","assets/Segment-hN2uWAPW.js","assets/VisualElement-kjYXz27t.js","assets/TextOverlayItem-eCjvS6IO.js","assets/euclideanLengthMeasurementUtils-VQw5qWk6.js","assets/measurementUtils-84-ZBArh.js","assets/ShadedColorMaterial.glsl-Fp4o6LjC.js","assets/dragEventPipeline3D-4CqrlxD2.js","assets/InteractiveToolBase-WDic4GPF.js","assets/drawUtils-woTYaREB.js","assets/ImageMaterial.glsl-TdPtjVc_.js","assets/Factory-m-O4WAoG.js","assets/SnappingVisualizer3D-KWlqByBu.js","assets/ExtendedLineVisualElement-YbjiXiBG.js","assets/vec4f32-NvfHy9q7.js","assets/EngineVisualElement-eZNKTKsI.js","assets/Laserlines.glsl-nvjcCsAw.js","assets/PointVisualElement-bX-_4FqS.js","assets/Object3DVisualElement-TMb7y_wl.js","assets/RightAngleQuadVisualElement-y_W8r903.js","assets/SnappingContext-6K6JmvvY.js","assets/PointSnappingHint-ULetRXiW.js","assets/LineVisualElement-4BP10o6v.js","assets/VerticesVisualElement-oQAA_hbc.js","assets/EditGeometryOperations-TPE5Wzab.js","assets/SceneSnappingManagerPool-OpebO9Di.js","assets/SnappingDragPipelineStep-THHIXt-p.js","assets/dehydratedFeatureComparison-hdPq-zad.js","assets/SnappingOperation-2U48wt1k.js","assets/AnalysisToolBase-3A13PdgS.js","assets/quantityFormatUtils-NiAiojad.js","assets/analysisViewUtils-AQaQeJpR.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/DirectLineMeasurement3D-3Pkkgamv.js b/dist/assets/DirectLineMeasurement3D-3Pkkgamv.js new file mode 100644 index 0000000..7e87a0c --- /dev/null +++ b/dist/assets/DirectLineMeasurement3D-3Pkkgamv.js @@ -0,0 +1 @@ +import{e as i,y as n,T as H,kP as V,c as L,l2 as it,p as nt,d as D,n as A,ab as z,kz as st,nk as at,b9 as rt,nl as lt,nm as ot,P as $,aa as x,i3 as ut,k as dt,gD as ht,A as q,nn as pt,kS as G,i5 as ct,an as gt,kK as mt,kM as I,hl as vt,hn as R,ao as yt,kN as F,kO as wt}from"./index-J0iiHjMT.js";import{W as _t}from"./measurementUtils-St7B-HxA.js";import{O as bt}from"./SnappingVisualizer3D-KWlqByBu.js";import{G as Pt,F as ft,A as Dt}from"./dragEventPipeline3D-4CqrlxD2.js";import{e as Mt}from"./interfaces-tkyofe_Z.js";import{e as W}from"./interfaces-lHX1zDRv.js";import{$ as B,w as Lt,e as St}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";import{c as Vt}from"./Laserlines.glsl-nvjcCsAw.js";import{a as Ot}from"./AnalysisToolBase-3A13PdgS.js";import{V as $t,p as xt,w as Ct}from"./EditGeometryOperations-TPE5Wzab.js";import{d as Tt,R as Ut}from"./InteractiveToolBase-WDic4GPF.js";import{a as Ht}from"./SceneSnappingManagerPool-OpebO9Di.js";import{e as At}from"./SnappingContext-6K6JmvvY.js";import{f as kt}from"./SnappingDragPipelineStep-THHIXt-p.js";import{u as Et}from"./InteractiveAnalysisViewModel-RI-qFGDH.js";import{u as zt}from"./MeasurementWidgetContent-d8uX7Gw_.js";import"./ExtendedLineVisualElement-YbjiXiBG.js";import"./vec4f32-NvfHy9q7.js";import"./EngineVisualElement-eZNKTKsI.js";import"./VisualElement-kjYXz27t.js";import"./PointVisualElement-bX-_4FqS.js";import"./Object3DVisualElement-TMb7y_wl.js";import"./RightAngleQuadVisualElement-y_W8r903.js";import"./drawUtils-woTYaREB.js";import"./PointSnappingHint-ULetRXiW.js";import"./dehydratedFeatureComparison-hdPq-zad.js";let f=class extends it{constructor(t){super(t),this.type="direct-line-measurement",this.startPoint=null,this.endPoint=null,this.unit=null}get requiredPropertiesForEditing(){return[this.startPoint,this.endPoint]}clear(){this.startPoint=null,this.endPoint=null}};i([n({type:["direct-line-measurement"]})],f.prototype,"type",void 0),i([n({type:H})],f.prototype,"startPoint",void 0),i([n({type:H})],f.prototype,"endPoint",void 0),i([n({type:V,value:null})],f.prototype,"unit",void 0),i([n({readOnly:!0})],f.prototype,"requiredPropertiesForEditing",null),f=i([L("esri.analysis.DirectLineMeasurementAnalysis")],f);const j=f;var M;(function(t){t.Manipulators="manipulators",t.AnalysisViewDestroyed="analysis-view-destroyed",t.AnalysisView="analysis-view"})(M||(M={}));let d=class extends nt{constructor(t){super(t),this.cursorPoint=null,this._visible=!1,this._laserLine=null,this.laserLineEnabled=!0,this._lastDraggedHandle=null}initialize(){this._laserLine=new Vt({view:this.view,attached:!0,isDecoration:!0}),this._updateVisibility(this._visible),this._connectToAnalysisView(),this.addHandles(D(()=>this._params,({laserLineGlowColor:t,laserLineInnerColor:e,laserLineGlobalAlpha:s})=>{const a=this._laserLine,l=a.style;a.style={...l,innerColor:e,glowColor:t,globalAlpha:s}}))}destroy(){this._laserLine=A(this._laserLine)}get _params(){const{accentColor:t}=this.view.effectiveTheme;return{laserLineGlowColor:z.toUnitRGB(t),laserLineGlowWidth:8,laserLineGlowFalloff:8,laserLineInnerColor:z.toUnitRGB(st(t)),laserLineInnerWidth:.75,laserLineGlobalAlpha:.75*t.a,handleColor:at(t,.5),handleRadius:5}}get visible(){return this._visible}set visible(t){t?this.show():this.hide()}get testData(){const t=this._laserLine.testData,e=this.analysisViewData.testData;return{labels:e==null?void 0:e.labels,stripeLength:e==null?void 0:e.stripeLength,laserLineRenderer:{heightManifoldEnabled:t!=null&&t.heightManifoldEnabled,heightManifoldTarget:t!=null?t.heightManifoldTarget:null,pointDistanceEnabled:t!=null&&t.pointDistanceEnabled,pointDistanceOrigin:t!=null?t.pointDistanceOrigin:null,pointDistanceTarget:t!=null?t.pointDistanceTarget:null,lineVerticalPlaneEnabled:t!=null&&t.lineVerticalPlaneEnabled}}}get _cursorPosition(){const t=x(),e=this.cursorPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _startPosition(){const t=x(),e=this.analysis.startPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _endPosition(){const t=x(),e=this.analysis.endPoint;return e&&this.view.renderCoordsHelper.toRenderCoords(e,t),t}get _laserLineParams(){const t=this._focusPosition,{active:e,lineState:s}=this.toolState,a=this.analysisViewData,l=this.laserLineEnabled&&!!t&&s!=="measured"&&e;if(!l||!this.visible||a==null||a.destroyed)return{heightManifoldTarget:null,pointDistanceLine:null,lineVerticalPlaneSegment:null};const o=a.actualVisualizedMeasurement,r=this.view.viewingMode!=="local"&&l&&!!this.analysis.startPoint&&o==="geodesic",h=l&&a.viewMode===W.Triangle;return{heightManifoldTarget:o==="euclidean"?t:null,pointDistanceLine:r?this._pointDistanceLine:null,lineVerticalPlaneSegment:h?rt(this._startPosition,this._endPosition):null}}get _focusPosition(){const{lineState:t}=this.toolState,e=this.analysisViewData,s=e!=null&&!e.destroyed&&e.measurementMode===Mt.Euclidean&&e.viewMode===W.Direct;switch(t){case"drawing":return s?this._startPosition:this.analysis.endPoint?this._endPosition:this._startPosition;case"editing":return s?this._lastDraggedHandle==="start"?this._endPosition:this._startPosition:this._lastDraggedHandle==="start"?this._startPosition:this._endPosition;default:return this.cursorPoint!=null?this._cursorPosition:null}}get _pointDistanceLine(){return{origin:this.toolState.lineState==="drawing"||this._lastDraggedHandle==="end"?this._startPosition:this._endPosition,target:this._focusPosition}}createManipulators(){const t=this._params,{view:e}=this,s=()=>{const u=Lt(t.handleColor),P=[new St(ut(u,1,32,32))],_=new B({view:e,renderObjects:P});return _.available=!1,_.radius=t.handleRadius,[_,u]},[a,l]=s(),[o,r]=s(),h=new B({view:this.view});h.available=!1,h.interactive=!1,this.analysis.startPoint!=null&&(a.location=this.analysis.startPoint,a.available=!0),this.analysis.endPoint!=null&&(o.location=this.analysis.endPoint,o.available=!0);const g=()=>{let u=this._lastDraggedHandle;a.grabbing&&!o.grabbing&&(u="start"),o.grabbing&&!a.grabbing&&(u="end"),a.grabbing||o.grabbing||(u=null),this._lastDraggedHandle=u},b=a.events.on("grab-changed",g),w=o.events.on("grab-changed",g);return this.addHandles([b,w,D(()=>ot(this._params.handleColor),u=>{l.setParameters({color:u}),r.setParameters({color:u})},{equals:lt})],M.Manipulators),{start:a,end:o,cursor:h}}show(){this.destroyed||this._visible||this._updateVisibility(!0)}hide(){!this.destroyed&&this._visible&&this._updateVisibility(!1)}_connectToAnalysisView(){this.removeHandles(M.AnalysisView),this.addHandles([D(()=>{var t;return(t=this.analysisViewData)==null?void 0:t.destroyed},t=>{t&&this.removeHandles(M.AnalysisView)},$),D(()=>[this.toolState.lineState==="measured",this.analysisViewData],([t,e])=>{e==null||e.destroyed||(e.allowVisualElementsOrientationChange=!t)},$),D(()=>this._laserLineParams,t=>{const e=this._laserLine;e.heightManifoldTarget=t.heightManifoldTarget,e.pointDistanceLine=t.pointDistanceLine,e.lineVerticalPlaneSegment=t.lineVerticalPlaneSegment},$)],M.AnalysisView)}_updateVisibility(t){this.initialized&&(this._visible=t,t?this._laserLine.style={innerColor:this._params.laserLineInnerColor,innerWidth:this._params.laserLineInnerWidth,glowColor:this._params.laserLineGlowColor,glowWidth:this._params.laserLineGlowWidth,glowFalloff:this._params.laserLineGlowFalloff,globalAlpha:this._params.laserLineGlobalAlpha}:this.view.cursor=null,this._laserLine.visible=t)}};i([n({constructOnly:!0})],d.prototype,"view",void 0),i([n()],d.prototype,"_params",null),i([n({constructOnly:!0})],d.prototype,"analysis",void 0),i([n({constructOnly:!0})],d.prototype,"analysisViewData",void 0),i([n()],d.prototype,"cursorPoint",void 0),i([n()],d.prototype,"toolState",void 0),i([n()],d.prototype,"visible",null),i([n()],d.prototype,"testData",null),i([n()],d.prototype,"_visible",void 0),i([n()],d.prototype,"_laserLine",void 0),i([n({constructOnly:!0})],d.prototype,"laserLineEnabled",void 0),i([n()],d.prototype,"_cursorPosition",null),i([n()],d.prototype,"_startPosition",null),i([n()],d.prototype,"_endPosition",null),i([n()],d.prototype,"_lastDraggedHandle",void 0),i([n()],d.prototype,"_laserLineParams",null),i([n()],d.prototype,"_focusPosition",null),i([n()],d.prototype,"_pointDistanceLine",null),d=i([L("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DView")],d);let p=class extends Ot{constructor(t){super(t),this._updatingHandles=new dt,this._emulatedDrag=null,this.lineState="initial",this.startPointSurfaceLocation=null,this.endPointSurfaceLocation=null,this.cursorPointSurfaceLocation=null,this.startManipulator=null,this.endManipulator=null,this.cursorManipulator=null,this._getSnappingContext=ht(e=>new At({elevationInfo:{mode:"absolute-height",offset:0},pointer:e,editGeometryOperations:new $t(new xt("point",Ct(!0,!1,this.view.spatialReference))),visualizer:new bt}))}initialize(){const{view:t,analysis:e,analysisViewData:s,visible:a}=this;this.measurementView=new d({toolState:this,view:t,analysis:e,analysisViewData:s,visible:a});const l=Ht(t);this._snappingManagerResult=l,this.addHandles(l);const{start:o,end:r,cursor:h}=this.measurementView.createManipulators(),g=(w,u,P)=>Tt(w,(_,J,S,k)=>{const E=Dt(_),Q=this._snappingManager,X=this._getSnappingContext(k),Y=this._updatingHandles,{lineState:Z}=this;S=S.next(E).next(Ut(this,[P,u])).next(m=>{if(u!=="cursorPoint"){const v=this.analysis[u];v!=null&&(_.location=v)}return m});const tt=ft(this.view),et=m=>{const v=tt(m);return v||this.lineState!=="drawing"&&this.lineState!=="initial"||(this[u]=null,this[P]=null),v};let O=J.next(E).next(et);if(k!=="touch"||Z==="editing"){const{snappingStep:m,cancelSnapping:v}=kt({snappingManager:Q,snappingContext:X,updatingHandles:Y});S=S.next(v),O=O.next(...m)}O.next(m=>m.action!=="start"?m:null).next(m=>{const v=gt(m.mapEnd,new H);this[u]=v,_.location=v,this[P]=this._surfaceLocation(v,m.surfaceType)})}),b=w=>w.events.on("grab-changed",()=>{const u=o.grabbing||r.grabbing;this.lineState=u?"editing":"measured"});this.addHandles([g(o,"startPoint","startPointSurfaceLocation"),g(r,"endPoint","endPointSurfaceLocation"),g(h,"cursorPoint","cursorPointSurfaceLocation"),b(o),b(r)]),this.manipulators.add(o),this.manipulators.add(r),this.manipulators.add(h),this.startManipulator=o,this.endManipulator=r,this.cursorManipulator=h,this.addHandles(D(()=>this.state,w=>{w==="measured"&&this.finishToolCreation()},q)),pt(this)}destroy(){this._updatingHandles=A(this._updatingHandles),this.measurementView=A(this.measurementView)}get _snappingManager(){return this._snappingManagerResult.snappingManager}get state(){const{analysis:t}=this;if(t.startPoint==null&&t.endPoint==null)return"ready";const{lineState:e}=this;return this.validMeasurement&&e!=="editing"&&e!=="drawing"?"measured":"measuring"}get cursor(){return this.state==="ready"||this.lineState==="drawing"?"crosshair":null}get startPoint(){return this.analysis.startPoint}set startPoint(t){this.analysis.startPoint=t}get endPoint(){return this.analysis.endPoint}set endPoint(t){this.analysis.endPoint=t}get cursorPoint(){return this.measurementView.cursorPoint}set cursorPoint(t){this.measurementView.cursorPoint=t}get snappingOptions(){return this._snappingManager.options}get validMeasurement(){return this.analysis.startPoint!=null&&this.analysis.endPoint!=null}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}onShow(){this.measurementView.show(),this._updateManipulatorAvailability()}onHide(){this.measurementView.hide()}onDeactivate(){var t;(t=this._emulatedDrag)==null||t.cancel(),this._emulatedDrag=null}onInputEvent(t){switch(t.type){case"immediate-click":this._handleImmediateClick(t);break;case"pointer-move":this._handlePointerMove(t)}this._updateManipulatorAvailability()}_handlePointerMove(t){var h,g;if(!this.active||this.view.navigating)return;const{pointerType:e}=t;if(e!=="mouse")return;const s=G(t),{lineState:a,cursorManipulator:l,endManipulator:o}=this;let r=!1;this.cursorPoint==null&&((h=this._emulatedDrag)==null||h.cancel(),this._emulatedDrag=C(l,e,s),r=!0),a==="initial"&&((g=this._emulatedDrag)==null||g.update(s),r=!0),a==="drawing"&&(o.events.emit("drag",{action:"update",start:s,screenPoint:s}),r=!0),r&&t.stopPropagation()}_handleImmediateClick(t){var g,b,w,u,P;if(!this.active||!_t(t))return;const e=G(t),{pointerType:s}=t,{cursorManipulator:a,startManipulator:l,endManipulator:o,lineState:r}=this;let h=!1;switch(this.cursorPoint==null&&((g=this._emulatedDrag)==null||g.cancel(),this._emulatedDrag=C(a,s,e)),r){case"initial":if((b=this._emulatedDrag)==null||b.update(e),this.cursorPoint!=null){(w=this._emulatedDrag)==null||w.end(e),this._emulatedDrag=null;const{cursorPoint:_}=this;this.startPoint=_,this.startPointSurfaceLocation=this.cursorPointSurfaceLocation,l.location=_,l.interactive=!1,o.interactive=!1,this.lineState="drawing",this._emulatedDrag=C(o,s,e),h=!0}break;case"drawing":(u=this._emulatedDrag)==null||u.update(e),this.endPoint!=null&&((P=this._emulatedDrag)==null||P.end(e),this._emulatedDrag=null,l.interactive=!0,o.interactive=!0,this.lineState="measured",h=!0)}h&&t.stopPropagation()}_surfaceLocation(t,e){return e===Pt.GROUND?"on-the-surface":(t.z??0)>=this._getElevation(t)?"above-the-surface":"below-the-surface"}_updateManipulatorAvailability(){this.startManipulator.available=this.analysis.startPoint!=null,this.endManipulator.available=this.analysis.endPoint!=null}_getElevation(t){return this.view.basemapTerrain.ready?ct(this.view.elevationProvider,t)??0:0}get test(){return{snappingManager:this._snappingManager}}};function C(t,e,s){return t.events.emit("drag",{action:"start",pointerType:e,start:s,screenPoint:s}),{update:a=>t.events.emit("drag",{action:"update",start:a,screenPoint:a}),end:a=>t.events.emit("drag",{action:"end",start:a,screenPoint:a}),cancel:()=>t.events.emit("drag",{action:"cancel"})}}i([n({readOnly:!0})],p.prototype,"state",null),i([n()],p.prototype,"lineState",void 0),i([n({readOnly:!0})],p.prototype,"cursor",null),i([n()],p.prototype,"startPoint",null),i([n()],p.prototype,"endPoint",null),i([n()],p.prototype,"cursorPoint",null),i([n({constructOnly:!0})],p.prototype,"analysis",void 0),i([n({constructOnly:!0})],p.prototype,"analysisViewData",void 0),i([n()],p.prototype,"measurementView",void 0),i([n({constructOnly:!0})],p.prototype,"view",void 0),i([n({readOnly:!0})],p.prototype,"validMeasurement",null),i([n({value:null})],p.prototype,"startPointSurfaceLocation",void 0),i([n({value:null})],p.prototype,"endPointSurfaceLocation",void 0),i([n({value:null})],p.prototype,"cursorPointSurfaceLocation",void 0),i([n()],p.prototype,"updating",null),p=i([L("esri.views.3d.interactive.measurementTools.directLineMeasurement3D.DirectLineMeasurement3DTool")],p);const Gt=p;let y=class extends Et{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="DirectLineMeasurement3DViewModel is only supported in 3D views.",this._userUnit=null,this._userUnitOptions=null}initialize(){this.addHandles(D(()=>({analysis:this.analysis,unit:this.unit}),({analysis:e,unit:s})=>{e!=null&&(e.unit=s)},q))}get state(){return this.disabled||!this.ready?"disabled":this.tool==null?"ready":this.tool.state}get measurement(){if(this.tool==null)return null;const e={mode:"euclidean",directDistance:{text:null,state:"unavailable"},horizontalDistance:{text:null,state:"unavailable"},verticalDistance:{text:null,state:"unavailable"}},{analysisViewData:s}=this.tool;if(s==null)return e;const a=s.actualVisualizedMeasurement,l=s.result!=null?"available":"unavailable";switch(a){case"euclidean":return{mode:"euclidean",directDistance:{text:s.directLabelText,state:l},horizontalDistance:{text:s.horizontalLabelText,state:l},verticalDistance:{text:s.verticalLabelText,state:l}};case"geodesic":return{mode:"geodesic",directDistance:{text:null,state:"unavailable"},horizontalDistance:{text:s.horizontalLabelText,state:l},verticalDistance:{text:s.verticalLabelText,state:l}};default:return e}}set unitOptions(e){this._userUnitOptions=e,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(e){this._userUnit=e?this._findSelectableUnit(e,this._userUnit):null}get unit(){return this._userUnit?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}constructAnalysis(){return new j}constructTool(){return new Gt({view:this.view,analysis:this.analysis,analysisViewData:this.analysisView,visible:this.visible})}_findSelectableUnit(e,s){const a=this.unitOptions;return a.includes(e)?e:s?this._findSelectableUnit(s):a[0]}_filteredOrAllUnits(e){if(!e)return V.slice();const s=e.filter(a=>V.includes(a));return s.length===0?V.slice():s}};i([n({type:j})],y.prototype,"analysis",void 0),i([n({readOnly:!0})],y.prototype,"state",null),i([n({readOnly:!0})],y.prototype,"measurement",null),i([n()],y.prototype,"unitOptions",null),i([n()],y.prototype,"unit",null),i([n(mt)],y.prototype,"defaultUnit",void 0),i([n()],y.prototype,"_userUnit",void 0),i([n()],y.prototype,"_userUnitOptions",void 0),y=i([L("esri.widgets.DirectLineMeasurement3D.DirectLineMeasurement3DViewModel")],y);const K=y,N="esri-direct-line-measurement-3d",T={base:N,newMeasurementButton:`${N}__clear-button`,widgetIcon:wt.measureLine};let c=class extends vt{constructor(t,e){super(t,e),this.iconClass=T.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.viewModel=new K}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(t){this.viewModel.analysis=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}render(){const{messages:t,messagesCommon:e,unit:s,unitOptions:a,viewModel:l}=this,{active:o,measurement:r,state:h,supported:g}=l;return R("div",{"aria-label":this.messages.widgetLabel,class:this.classes(T.base,F.widget,F.panel),key:this,role:"presentation"},this.visible?R(zt,{active:o,measurementItems:[{key:"direct",title:t.direct,value:U(r==null?void 0:r.directDistance)},{key:"horizontal",title:t.horizontal,value:U(r==null?void 0:r.horizontalDistance)},{key:"vertical",title:t.vertical,value:U(r==null?void 0:r.verticalDistance)}],messages:{...t,notApplicable:e==null?void 0:e.notApplicable},newMeasurementButtonClass:T.newMeasurementButton,state:h,supported:g,unit:s,unitOptions:a,onNewMeasurementClick:()=>{yt(this.viewModel.start())},onUnitChange:b=>{this.unit=b}}):null)}};function U(t){return(t==null?void 0:t.state)==="available"?t.text:null}i([n()],c.prototype,"view",null),i([n()],c.prototype,"visible",null),i([n()],c.prototype,"active",null),i([n({constructOnly:!0,nonNullable:!0})],c.prototype,"analysis",null),i([n()],c.prototype,"iconClass",void 0),i([n()],c.prototype,"icon",void 0),i([n()],c.prototype,"label",null),i([n(),I("esri/widgets/DirectLineMeasurement3D/t9n/DirectLineMeasurement3D")],c.prototype,"messages",void 0),i([n(),I("esri/t9n/common")],c.prototype,"messagesCommon",void 0),i([n()],c.prototype,"uiStrings",void 0),i([n({type:K})],c.prototype,"viewModel",void 0),i([n()],c.prototype,"unitOptions",null),i([n()],c.prototype,"unit",null),c=i([L("esri.widgets.DirectLineMeasurement3D")],c);const ce=c;export{ce as default}; diff --git a/dist/assets/DirectLineMeasurementAnalysisView3D-AgdgP6Nj.js b/dist/assets/DirectLineMeasurementAnalysisView3D-AgdgP6Nj.js new file mode 100644 index 0000000..27f8157 --- /dev/null +++ b/dist/assets/DirectLineMeasurementAnalysisView3D-AgdgP6Nj.js @@ -0,0 +1,39 @@ +import{Z as Me,e as o,y as d,c as ce,p as de,aa as b,cs as De,ct as ge,d as C,A as O,ay as Q,az as le,z8 as k,N as Te,kB as Re,kG as Ge,kI as je,aA as pe,aB as ke,cu as Ne,cv as He,aH as Ie,xz as Ue,xE as We,xx as q,bf as L,xy as X,xF as K,xM as Fe,de as Be,xL as Y,xK as he,xO as Qe,xP as qe,y6 as Xe,xQ as Ke,xR as Ye,xS as Ze,lZ as Je,xU as et,xW as tt,uS as it,xN as st,y0 as nt,xY as at,xA as _e,lX as me,x_ as rt,x$ as ot,bi as Z,as as J,aF as ee,aU as Oe,aG as lt,h9 as te,bA as ct,b2 as j,ou as ve,nl as ye,b5 as be,kn as dt,n as f,br as N,b8 as ht,kY as we,nk as ut,kz as fe,kA as gt,hS as Le,kZ as ie,kx as pt,P as _t,au as mt,at as vt,cz as se,z6 as yt,z3 as bt,hx as wt,kw as ft,pL as Pe,pl as Lt,j_ as Ve,lL as ue,kK as Pt}from"./index-J0iiHjMT.js";import{s as Ct}from"./AnalysisView3D-jkk3JIRT.js";import{e as T}from"./interfaces-tkyofe_Z.js";import{r as At,t as Et,u as H}from"./LineVisualElement-4BP10o6v.js";import{a as zt,i as ne}from"./UnitNormalizer-19C91v_m.js";import{h as I,R as ae,y as St,L as re,d as Ot}from"./quantityFormatUtils-NiAiojad.js";import{e as y,o as S}from"./interfaces-lHX1zDRv.js";import{g as oe,_ as Ce,m as G,C as Ae}from"./Segment-hN2uWAPW.js";import{a as Vt}from"./Object3DVisualElement-TMb7y_wl.js";import{z as $t}from"./RightAngleQuadVisualElement-y_W8r903.js";import"./VisualElement-kjYXz27t.js";import"./TextOverlayItem-eCjvS6IO.js";import"./EngineVisualElement-eZNKTKsI.js";const $e="esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementController",xt=Me.getLogger($e),Mt=1e5;let x=class extends de{constructor(e){super(e),this._unitNormalizer=new zt,this._tempStartPosition=b(),this._tempEndPosition=b(),this._tempCornerPosition=b()}initialize(){const e=this.view.spatialReference,i=De(e),s=i===Ne?He:i;this._sphericalPCPF=s;const n=ge(e,s);this._unitNormalizer.spatialReference=n?s:e,this.addHandles([C(()=>({viewData:this.viewData,startPoint:this.analysis.startPoint}),({viewData:a,startPoint:r})=>{a.elevationAlignedStartPoint=this._applyProjectionAndElevationAlignment(r)},O),C(()=>({viewData:this.viewData,endPoint:this.analysis.endPoint}),({viewData:a,endPoint:r})=>{a.elevationAlignedEndPoint=this._applyProjectionAndElevationAlignment(r)},O),C(()=>({result:this._computedResult,viewData:this.viewData}),({result:a,viewData:r})=>{r.result=a},O)])}_applyProjectionAndElevationAlignment(e){if(e==null)return e;const{spatialReference:i,elevationProvider:s}=this.view;return At(e,i,s)??(Et(this.analysis,e.spatialReference,xt),null)}get _computedResult(){const{elevationAlignedStartPoint:e,elevationAlignedEndPoint:i,measurementMode:s}=this.viewData;if(e==null||i==null)return null;const n=this._euclideanDistances(e,i),a=this._geodesicDistance(e,i,n.horizontal.value),r=s===T.Geodesic||s===T.Auto&&n.horizontal.value>Mt?"geodesic":"euclidean";return{mode:r,distance:r==="euclidean"?n.direct:a,directDistance:n.direct,horizontalDistance:n.horizontal,verticalDistance:n.vertical,geodesicDistance:a}}_euclideanDistances(e,i){const s=e.clone();s.z=i.z;const n=this._tempStartPosition,a=this._tempEndPosition,r=this._tempCornerPosition,u=this.view.spatialReference,c=this._sphericalPCPF,h=ge(u,c)?c:u;Q(e,n,h),Q(i,a,h),Q(s,r,h);const l=le(n,a),g=le(r,a),m=Math.abs(i.z-e.z),p=P=>this._unitNormalizer.normalizeDistance(P),A=p(l),M=p(g),E=p(m);return{direct:k(A,"meters"),horizontal:k(M,"meters"),vertical:k(E,"meters")}}_geodesicDistance(e,i,s){const n=e.spatialReference,a=new Te({spatialReference:n});a.addPath([e,i]);const r=n.isGeographic&&Re(n)?Ge([a],"meters")[0]:n.isWebMercator?je(a,"meters"):null,u=r??this._fallbackGeodesicDistance(e,i,s);return k(u,"meters")}_fallbackGeodesicDistance(e,i,s){if(pe(e,Ee)&&pe(i,ze)){const n=new Ie;return ke(n,Ee,ze),n.distance}return s}};o([d()],x.prototype,"view",void 0),o([d()],x.prototype,"analysis",void 0),o([d()],x.prototype,"viewData",void 0),o([d()],x.prototype,"_computedResult",null),x=o([ce($e)],x);const Ee=b(),ze=b();function xe(t){const e=new Ue,{vertex:i,fragment:s}=e;We(i,t),i.uniforms.add(new q("width",a=>a.width)),e.attributes.add(L.POSITION,"vec3"),e.attributes.add(L.NORMAL,"vec3"),e.attributes.add(L.UV0,"vec2"),e.attributes.add(L.AUXPOS1,"float"),e.varyings.add("vtc","vec2"),e.varyings.add("vlength","float"),e.varyings.add("vradius","float"),i.code.add(X`void main(void) { +vec3 bitangent = normal; +vtc = uv0; +vlength = auxpos1; +vradius = 0.5 * width; +vec4 pos = view * vec4(position + vradius * bitangent * uv0.y, 1.0); +gl_Position = proj * pos; +}`),s.uniforms.add(new q("outlineSize",a=>a.outlineSize),new K("outlineColor",a=>a.outlineColor),new q("stripeLength",a=>a.stripeLength),new K("stripeEvenColor",a=>a.stripeEvenColor),new K("stripeOddColor",a=>a.stripeOddColor));const n=1/Math.sqrt(2);return s.code.add(X` + const float INV_SQRT2 = ${X.float(n)}; + + vec4 arrowColor(vec2 tc, float len) { + float d = INV_SQRT2 * (tc.x - abs(tc.y)); + d = min(d, INV_SQRT2 * (len - tc.x - abs(tc.y))); + d = min(d, 1.0 - abs(tc.y)); + + if (d < 0.0) { + return vec4(0.0); + } else if (d < outlineSize) { + return outlineColor; + } else { + return fract(0.5 / stripeLength * tc.x * vradius) >= 0.5 ? stripeOddColor : stripeEvenColor; + } + } + + void main(void) { + vec2 ntc = vec2(vtc.x / vradius, vtc.y); + vec4 color = arrowColor(ntc, vlength / vradius); + if (color.a == 0.0) { + discard; + } + fragColor = color; + } + `),e}const Dt=Object.freeze(Object.defineProperty({__proto__:null,build:xe},Symbol.toStringTag,{value:"Module"}));class W extends Qe{constructor(e,i,s){super(e,i,s)}initializeProgram(e){return new qe(e.rctx,W.shader.get().build(this.configuration),Xe)}_setPipelineState(e){const i=e===he.NONE,s=this.configuration;return Ke({blending:s.transparent?i?Ye:Ze(e):null,polygonOffset:this.configuration.polygonOffsetEnabled?{factor:0,units:-4}:null,depthTest:{func:Je.LESS},depthWrite:et,colorWrite:tt})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}get primitiveType(){return it.TRIANGLE_STRIP}}W.shader=new Fe(Dt,()=>Be(()=>Promise.resolve().then(()=>Zt),void 0));let U=class extends st{constructor(){super(...arguments),this.polygonOffsetEnabled=!1,this.transparent=!1,this.transparencyPassType=he.NONE}};o([Y()],U.prototype,"polygonOffsetEnabled",void 0),o([Y()],U.prototype,"transparent",void 0),o([Y({count:he.COUNT})],U.prototype,"transparencyPassType",void 0);class Tt extends at{constructor(e){super(e,new Gt),this._configuration=new U}getConfiguration(e,i){return this._configuration.polygonOffsetEnabled=this.parameters.polygonOffset,this._configuration.transparent=this._transparent,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration}intersect(){}produces(e,i){return i===_e.Color||i===_e.Alpha?e===(this._transparent?me.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL:me.OPAQUE_MATERIAL):!1}createGLMaterial(e){return new Rt(e)}createBufferWriter(){return new Wt}get _transparent(){const{parameters:e}=this;return e.outlineColor[3]<1||e.stripeEvenColor[3]<1||e.stripeOddColor[3]<1}}class Rt extends rt{beginSlot(e){return this.ensureTechnique(W,e)}}class Gt extends ot{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=Z(1,.5,0,1),this.stripeEvenColor=Z(1,1,1,1),this.stripeOddColor=Z(1,.5,0,1),this.stripeLength=1,this.polygonOffset=!1}}const jt=nt().vec3f(L.POSITION).vec3f(L.NORMAL).vec2f(L.UV0).f32(L.AUXPOS1),kt=b(),Nt=b(),Ht=b(),It=b(),Ut=b();let Wt=class{constructor(){this.vertexBufferLayout=jt}elementCount(e){return 2*(e.attributes.get(L.POSITION).indices.length/2+1)}write(e,i,s,n,a){const{data:r,indices:u}=s.attributes.get(L.POSITION),c=s.attributes.get(L.NORMAL).data,h=r.length/3;u&&u.length!==2*(h-1)&&console.warn("MeasurementArrowMaterial does not support indices");const l=kt,g=Nt,m=Ht,p=It,A=Ut,M=n.position,E=n.normal,P=n.uv0;let z=0;for(let w=0;wthis.view.state.camera,()=>{this._viewChanged()}))}destroyExternalResources(){this._arrowMaterial=null,this._handles=f(this._handles)}forEachExternalMaterial(e){e(this._arrowMaterial)}createGeometries(e){var s;if(((s=this._geometry)==null?void 0:s.startRenderSpace)==null||this._geometry.endRenderSpace==null)return;const i=this._createArrowGeometry(this._geometry.startRenderSpace,this._geometry.endRenderSpace,this._origin,this._geometry);i.transformation=this._originTransform,e.addGeometry(i),this._viewChanged()}_createArrowGeometry(e,i,s,n){const a=this.view.renderCoordsHelper,r=[],u=[],c=(h,l)=>{const g=N.get();Oe(g,h,s),r.push(g),u.push(l)};if(n.type==="euclidean"){n.eval(.5,this._arrowCenter);const h=N.get();a.worldUpAtPosition(this._arrowCenter,h),c(e,h),c(i,h)}else{n.eval(.5,this._arrowCenter);const h=this._arrowSubdivisions+1&-2;for(let l=0;l{const{elevationAlignedStartPoint:l,elevationAlignedEndPoint:g}=this.analysisView,m=this.view;return{view:m,camera:m.state.camera,viewMode:this.viewMode,elevationAlignedStartPoint:l,elevationAlignedEndPoint:g,orientation:this._actualVisualElementsOrientation,visualizedMeasurement:this.actualVisualizedMeasurement,stripeLength:this._measurementArrowStripeLength}},l=>this._updateGeometryAndViewMode(l),O),C(()=>({visible:this.visible,viewMode:this.viewMode}),l=>this._updateVisualElementVisibility(l),O),C(()=>({text:this._labelsText,visualizedMeasurement:this.actualVisualizedMeasurement}),l=>this._updateLabelText(l),O),C(()=>({visible:this.visible,viewMode:this.viewMode}),l=>this._updateLabelVisibility(l),O),C(()=>this._measurementArrowStripeLength,l=>this._updateSegmentStripeLength(l),O),pt(async()=>this._updateMessageBundle()),C(()=>this._parameters,({textBackgroundColor:l,textCalloutColor:g,textColor:m,translucentAccentColor:p,accentColor:A,contrastColor:M})=>{const{_segmentLabel:E,_verticalLabel:P,_horizontalLabel:z,_triangleVisualElement:F,_rightAngleQuad:w,_projectedGeodesicLine:R,_geodesicStartHint:B,_geodesicEndHint:V,_segmentVisualElement:$}=this;E.backgroundColor=l,E.calloutColor=g,E.textColor=m,P.backgroundColor=l,P.calloutColor=g,P.textColor=m,z.backgroundColor=l,z.calloutColor=g,z.textColor=m,F.color=p,w.color=p,R.color=p,B.color=p,V.color=p,$.color=A,$.contrastColor=M},_t)]),this._updateMessageBundle()}destroy(){this._segmentVisualElement=f(this._segmentVisualElement),this._triangleVisualElement=f(this._triangleVisualElement),this._rightAngleQuad=f(this._rightAngleQuad),this._projectedGeodesicLine=f(this._projectedGeodesicLine),this._geodesicStartHint=f(this._geodesicStartHint),this._geodesicEndHint=f(this._geodesicEndHint),this._segmentLabel=f(this._segmentLabel),this._verticalLabel=f(this._verticalLabel),this._horizontalLabel=f(this._horizontalLabel),this.set("view",null)}_updateVisualElementVisibility({visible:t,viewMode:e}){if(this._segmentVisualElement.visible=!1,this._triangleVisualElement.visible=!1,this._rightAngleQuad.visible=!1,this._projectedGeodesicLine.visible=!1,this._geodesicStartHint.visible=!1,this._geodesicEndHint.visible=!1,t)switch(e){case y.None:break;case y.Direct:this._segmentVisualElement.visible=!0;break;case y.Triangle:this._segmentVisualElement.visible=!0,this._triangleVisualElement.visible=!0,this._rightAngleQuad.visible=!0;break;case y.ProjectedGeodesic:this._segmentVisualElement.visible=!0,this._projectedGeodesicLine.visible=!0,this._geodesicStartHint.visible=!0,this._geodesicEndHint.visible=!0}}_updateGeometryAndViewMode({view:t,camera:e,viewMode:i,elevationAlignedStartPoint:s,elevationAlignedEndPoint:n,orientation:a,visualizedMeasurement:r,stripeLength:u}){const c=t.renderCoordsHelper;if(c==null||s==null||n==null||s.equals(n))return;let h=this._startPosition,l=this._endPosition;c.toRenderCoords(s,h),c.toRenderCoords(n,l);const g=a===S.AboveSegment?1:-1,m=g*(c.getAltitude(l)-c.getAltitude(h));m<0&&(h=this._endPosition,l=this._startPosition);const p=r==="geodesic"?new Ce(this._startPosition,this._endPosition,c.spatialReference):new G(this._startPosition,this._endPosition);switch(this._segmentVisualElement.geometry=p,this._updateSegmentStripeLength(u),i){case y.Direct:this._updateSegment(p,a);break;case y.Triangle:this._updateSegmentAndTriangle({view:t,camera:e,segment:p,orientation:a,startPosition:h,endPosition:l,deltaSign:g,altitudeDelta:m});break;case y.ProjectedGeodesic:this._updateSegmentAndProjection({view:t,orientation:a,startPosition:h,endPosition:l})}}_updateSegment(t,e){this._segmentLabel.anchor=e===S.AboveSegment?"top":"bottom",this._segmentLabel.geometry={type:"segment",segment:t,sampleLocation:"center"}}_updateSegmentAndTriangle({view:{renderCoordsHelper:t},camera:e,segment:i,orientation:s,startPosition:n,endPosition:a,deltaSign:r,altitudeDelta:u}){const c=this._cornerPosition;t.worldUpAtPosition(n,c),mt(c,c,r*Math.abs(u)),vt(c,c,n),this._triangleVisualElement.geometry=[[[n[0],n[1],n[2]],[c[0],c[1],c[2]],[a[0],a[1],a[2]]]],this._rightAngleQuad.geometry={previous:n,center:c,next:a};const h=new G(n,c),l=new G(c,a),g=Bt(n,a,c,s,e);this._segmentLabel.anchor=g.segment,this._segmentLabel.geometry={type:"segment",segment:i,sampleLocation:"center"},this._verticalLabel.geometry={type:"segment",segment:h,sampleLocation:"center"},this._verticalLabel.anchor=g.vertical,this._horizontalLabel.geometry={type:"segment",segment:l,sampleLocation:"center"},this._horizontalLabel.anchor=g.horizontal}_updateSegmentAndProjection({view:{renderCoordsHelper:t},orientation:e,startPosition:i,endPosition:s}){t.setAltitude(this._startPositionAtSeaLevel,0,i),t.setAltitude(this._endPositionAtSeaLevel,0,s);const n=new Ce(this._startPositionAtSeaLevel,this._endPositionAtSeaLevel,t.spatialReference);this._projectedGeodesicLine.setGeometryFromSegment(n),this._geodesicStartHint.setGeometryFromSegment(new G(this._startPositionAtSeaLevel,i)),this._geodesicEndHint.setGeometryFromSegment(new G(this._endPositionAtSeaLevel,s)),this._segmentLabel.geometry={type:"segment",segment:n,sampleLocation:"center"},this._segmentLabel.anchor=e===S.AboveSegment?"top":"bottom"}_updateLabelText({text:t,visualizedMeasurement:e}){t!=null?(this._segmentLabel.text=e==="euclidean"?t.euclideanDistance:t.geodesicDistance,this._horizontalLabel.text=t.horizontalDistance,this._verticalLabel.text=t.verticalDistance):(this._segmentLabel.text=null,this._horizontalLabel.text=null,this._verticalLabel.text=null),this.notifyChange("labels")}_updateLabelVisibility({visible:t,viewMode:e}){const i=this._segmentLabel,s=this._horizontalLabel,n=this._verticalLabel;if(i.visible=!1,s.visible=!1,n.visible=!1,t)switch(e){case y.Direct:i.visible=!0;break;case y.Triangle:i.visible=!0,s.visible=!0,n.visible=!0;break;case y.ProjectedGeodesic:i.visible=!0;case y.None:}}get _labelsText(){if(this.destroyed)return null;const t=this.messages,e=this.analysisView.result;if(e==null||t==null)return null;const{directDistance:i,horizontalDistance:s,verticalDistance:n,geodesicDistance:a}=e,r=this.analysisView.unit,u=c=>({euclideanDistance:"",geodesicDistance:"",horizontalDistance:"",verticalDistance:"",...c});switch(r){case"metric":return u({euclideanDistance:i&&re(t,i),geodesicDistance:a&&re(t,a),horizontalDistance:s&&re(t,s),verticalDistance:n&&Ot(t,n)});case"imperial":return u({euclideanDistance:i&&ae(t,i),geodesicDistance:a&&ae(t,a),horizontalDistance:s&&ae(t,s),verticalDistance:n&&St(t,n)});default:return u({euclideanDistance:i&&I(t,i,r),geodesicDistance:a&&I(t,a,r),horizontalDistance:s&&I(t,s,r),verticalDistance:n&&I(t,n,r)})}}_updateSegmentStripeLength(t){const e=this._segmentVisualElement;t!=null?(e.stripeLength=t,e.stripesEnabled=!0):e.stripesEnabled=!1}get _actualVisualElementsOrientation(){if(this._triangleOrientationOverride!=null)return this._triangleOrientationOverride;const t=this.visualElementOrientation;return t===S.Auto?this.view.state.camera.aboveGround?S.AboveSegment:S.BelowSegment:t}_requiresGeodesicGuideAt(t){const e=this.view;if(!(e!=null&&e.state))return!1;const i=e.state.camera,s=e.renderCoordsHelper;if(!s)return!1;const n=i.computeScreenPixelSizeAt(t);return s.getAltitude(t)/n>=10}get _measurementArrowStripeLength(){const{result:t,unit:e}=this.analysisView;if(t==null)return null;let i=null;const s=t.directDistance;switch(e){case"metric":i=s&&se(s,"meters");break;case"imperial":i=s&&se(s,yt(s.value,s.unit));break;default:i=s&&se(s,e)}return i==null?null:bt(i.value/30)*wt(1,i.unit,"meters")}_updateMessageBundle(){this.loadingMessages=!0,ft("esri/core/t9n/Units").then(t=>{this.messages=t}).finally(()=>{this.loadingMessages=!1})}get testData(){var t;return{labels:this.labels,stripeLength:(t=this._segmentVisualElement)==null?void 0:t.stripeLength}}};function Bt(t,e,i,s,n){const a=Qt,r=qt;n.projectToRenderScreen(i,a),n.projectToRenderScreen(e,r);const u={segment:"bottom",horizontal:"top",vertical:a[0]=Se){const l=Math.sign(c[1])===Math.sign(h[1]);u.segment=l?Ae(u.vertical):u.vertical}else{const l=Yt;ne(i,e,l,n),Pe(l,h)>=Se&&(u.segment=Math.sign(l[0])===Math.sign(h[0])?Ae(u.horizontal):u.horizontal)}}if(s===S.BelowSegment){const c=h=>h==="top"?"bottom":"top";u.segment=c(u.segment),u.horizontal=c(u.horizontal),u.vertical=c(u.vertical)}return u}o([d()],v.prototype,"_parameters",null),o([d()],v.prototype,"_triangleOrientationOverride",void 0),o([d()],v.prototype,"messages",void 0),o([d()],v.prototype,"view",void 0),o([d()],v.prototype,"analysis",void 0),o([d()],v.prototype,"analysisView",void 0),o([d()],v.prototype,"loadingMessages",void 0),o([d()],v.prototype,"visible",null),o([d()],v.prototype,"viewMode",null),o([d()],v.prototype,"actualVisualizedMeasurement",null),o([d()],v.prototype,"visualElementOrientation",void 0),o([d()],v.prototype,"triangleCollapseRatioThreshold",void 0),o([d()],v.prototype,"allowVisualElementsOrientationChange",null),o([d()],v.prototype,"labels",null),o([d()],v.prototype,"_labelsText",null),o([d()],v.prototype,"_actualVisualElementsOrientation",null),o([d()],v.prototype,"_measurementArrowStripeLength",null),v=o([ce("esri.views.3d.analysis.DirectLineMeasurement.DirectLineMeasurementVisualization")],v);const Se=Math.cos(Lt(12)),Qt=Ve(),qt=Ve(),Xt=ue(),Kt=ue(),Yt=ue();let _=class extends Ct(de){constructor(t){super(t),this.type="direct-line-measurement-view-3d",this.analysis=null,this.result=null,this.measurementMode=T.Auto,this.elevationAlignedStartPoint=null,this.elevationAlignedEndPoint=null}initialize(){const t=this.view,e=this.analysis;this._analysisVisualization=new v({view:t,analysis:e,analysisView:this}),this._analysisController=new x({view:t,analysis:e,viewData:this})}destroy(){this._analysisController=f(this._analysisController),this._analysisVisualization=f(this._analysisVisualization)}get updating(){var t;return!!((t=this._analysisVisualization)!=null&&t.loadingMessages)}get viewMode(){return this._analysisVisualization.viewMode}get actualVisualizedMeasurement(){return this._analysisVisualization.actualVisualizedMeasurement}get visualElementOrientation(){return this._analysisVisualization.visualElementOrientation}set visualElementOrientation(t){this._analysisVisualization.visualElementOrientation=t}get allowVisualElementsOrientationChange(){return this._analysisVisualization.allowVisualElementsOrientationChange}set allowVisualElementsOrientationChange(t){this._analysisVisualization.allowVisualElementsOrientationChange=t}get triangleCollapseRatioThreshold(){return this._analysisVisualization.triangleCollapseRatioThreshold}set triangleCollapseRatioThreshold(t){this._analysisVisualization.triangleCollapseRatioThreshold=t}get directLabelText(){var t;return((t=this._analysisVisualization.labels.direct)==null?void 0:t.text)??""}get horizontalLabelText(){var t;return((t=this._analysisVisualization.labels.horizontal)==null?void 0:t.text)??""}get verticalLabelText(){var t;return((t=this._analysisVisualization.labels.vertical)==null?void 0:t.text)??""}get unit(){return this.analysis.unit??this._defaultUnit}get testData(){var t;return this.destroyed?{labels:null,stripeLength:null,visualization:null,controller:null}:{...(t=this._analysisVisualization)==null?void 0:t.testData,visualization:this._analysisVisualization,controller:this._analysisController}}};o([d()],_.prototype,"updating",null),o([d({readOnly:!0})],_.prototype,"type",void 0),o([d({constructOnly:!0,nonNullable:!0})],_.prototype,"analysis",void 0),o([d()],_.prototype,"result",void 0),o([d()],_.prototype,"measurementMode",void 0),o([d()],_.prototype,"elevationAlignedStartPoint",void 0),o([d()],_.prototype,"elevationAlignedEndPoint",void 0),o([d({readOnly:!0})],_.prototype,"viewMode",null),o([d({readOnly:!0})],_.prototype,"actualVisualizedMeasurement",null),o([d()],_.prototype,"visualElementOrientation",null),o([d()],_.prototype,"allowVisualElementsOrientationChange",null),o([d()],_.prototype,"triangleCollapseRatioThreshold",null),o([d({readOnly:!0})],_.prototype,"directLabelText",null),o([d({readOnly:!0})],_.prototype,"horizontalLabelText",null),o([d({readOnly:!0})],_.prototype,"verticalLabelText",null),o([d()],_.prototype,"_analysisVisualization",void 0),o([d()],_.prototype,"_analysisController",void 0),o([d()],_.prototype,"unit",null),o([d(Pt)],_.prototype,"_defaultUnit",void 0),_=o([ce("esri.views.3d.analysis.DirectLineMeasurementAnalysisView3D")],_);const mi=_,Zt=Object.freeze(Object.defineProperty({__proto__:null,build:xe},Symbol.toStringTag,{value:"Module"}));export{mi as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/DistanceMeasurement2D-0EP_w-h3.js b/dist/assets/DistanceMeasurement2D-0EP_w-h3.js new file mode 100644 index 0000000..00d8559 --- /dev/null +++ b/dist/assets/DistanceMeasurement2D-0EP_w-h3.js @@ -0,0 +1 @@ +import{e as s,y as i,c as k,Q as x,kw as T,kx as W,d as y,P as S,n as f,T as A,O as j,S as D,a3 as q,kz as I,c1 as F,hS as E,kA as J,ky as K,J as R,N as Q,kB as H,kG as b,kC as M,e1 as w,ar as U,kI as X,kD as Y,kE as Z,cy as ee,hx as te,cG as se,cB as ie,kK as re,kP as L,w as ne,e0 as oe,kM as G,hl as ae,hn as B,ao as le,kN as z,kO as he}from"./index-J0iiHjMT.js";import{l as ce}from"./Draw-DYxsSuyr.js";import{l as ue,d as me,v as de,x as pe}from"./InteractiveToolBase-WDic4GPF.js";import{S as ve}from"./GraphicManipulator-ku6oRBpa.js";import{n as ye,u as we}from"./MeasurementWidgetContent-d8uX7Gw_.js";import"./SnappingVisualizer2D-NnEm1PvQ.js";import"./SnappingContext-6K6JmvvY.js";import"./PointSnappingHint-ULetRXiW.js";import"./EditGeometryOperations-TPE5Wzab.js";import"./SnappingOperation-2U48wt1k.js";import"./surfaceCoordinateSystems-siQq4eBA.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./SnappingDragPipelineStep-THHIXt-p.js";import"./drawUtils-woTYaREB.js";import"./drapedUtils-9db1OpTX.js";const g=1e5;let m=class extends ue{constructor(e){super(e),this._drawActive=!1,this._measurementLayer=new x({internal:!0,listMode:"hide",visible:!1}),this._manipulatorLayer=new x({internal:!0,listMode:"hide",visible:!1}),this._vertices=[],this.geodesicDistanceThreshold=1e5,this.measurement=null,this.measurementLabel=null}initialize(){T("esri/core/t9n/Units").then(t=>{this.messages=t}),this.addHandles(W(async()=>{this.messages=await T("esri/core/t9n/Units")}));const e=this.view;this._draw=new ce({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer]),e.focus(),this.addHandles([y(()=>[this.unit,this.geodesicDistanceThreshold,this.messages],()=>{this._updatePolylines()},S),y(()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor],()=>{if(!this._vertices.length)return;const t=this._vertices.map(({coord:r})=>r);for(const{handle:r}of this._vertices)r.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(t)})])}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=f(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=f(this._measurementLayer),this._manipulatorLayer=f(this._manipulatorLayer),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}onActivate(){this._drawActive||this._vertices.length!==0||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const e=this._draw.create("polyline",{mode:"click"});e.on(["vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],t=>this._updateSketch(t.vertices)),e.on("draw-complete",()=>{this._stopSketch()})}_stopSketch(){this.manipulators.forEach(({manipulator:e})=>{e.interactive=!0}),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const{spatialReference:t}=this.view;for(;this._vertices.length>e.length;){const{handle:n,manipulator:u}=this._vertices.pop();n.remove(),this.manipulators.remove(u)}for(let n=this._vertices.length;n{V.next(de(this.view)).next(pe(C.graphic,j.Local)).next(()=>{const O=C.graphic.geometry;this._vertices[n].coord=[O.x,O.y],this._updatePolylines()})});this._vertices.push({manipulator:v,coord:[u,p],handle:_})}const r=this._vertices.length-1,o=this._vertices[r],[l,a]=e[r];o.coord[0]===l&&o.coord[1]===a||(o.coord=[l,a],o.manipulator.graphic.geometry=new A({x:l,y:a,spatialReference:t}));const h=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach(({manipulator:n})=>{n.interactive=h==null||n!==h}),this._updatePolylines()}_updatePolylines(){var v;if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=this._vertices.map(({coord:_})=>_),{measurement:t,drawing:r,original:o}=_e(e,this.view.spatialReference,this.geodesicDistanceThreshold);this._set("measurement",t);const l=Me(this.messages,t,this.unit);let a,h;this._set("measurementLabel",l);const{graphics:n}=this._measurementLayer,u=n.length===2,{effectiveTheme:p}=this.view;u?(a=n.at(0),h=n.at(1)):(a=new D({symbol:new q({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[14,12],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:3.5,color:I(p.accentColor).toArray()},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:5,color:p.accentColor.toArray()}]}}})}),h=new D({symbol:new F({color:p.textColor,haloColor:E(I(p.textColor,J.Low),.5),haloSize:2,font:new K({size:14,family:"sans-serif"})})}),n.removeAll(),n.addMany([a,h])),a.geometry=r,h.geometry=(v=o.extent)==null?void 0:v.center,h.symbol.text=l}};function ge(e,t,r){const o=E(t.effectiveTheme.accentColor,.5),l={type:"simple-line",width:0},a=8,h=new R({style:"circle",color:o,size:a,outline:l}),n=new R({style:"circle",color:o,size:1.5*a,outline:l}),u=new D({geometry:e,symbol:h});return new ve({view:t,layer:r,graphic:u,focusedSymbol:n})}function _e(e,t,r){const o=new Q({paths:[e],spatialReference:t});let l,a;if(t.isGeographic)if(H(t))l=b([o],"meters")[0],a=M(o,g);else{const h=w(o,U.WGS84),n=M(h,g);l=b([h],"meters")[0],a=w(n,t)}else if(t.isWebMercator)l=X(o,"meters"),a=Y(o,g,"meters");else{const h=Z(o,"meters");if(h>=r){const n=w(o,U.WGS84),u=M(n,g);l=b([n],"meters")[0],a=w(u,t)}else l=h,a=o}return{measurement:{geometry:a,length:l},original:o,drawing:a}}function fe(e){return e!=null}function be(e){if(!e)return!1;const{isGeographic:t,isWebMercator:r,isWGS84:o}=e;return t&&!o&&!H(e)||!t&&!r}function Me(e,t,r){if(!t||!e)return"";switch(r){case"metric":return ie(e,t.length,"meters");case"imperial":return se(e,t.length,"meters");default:return ee(e,te(t.length,"meters",r),r)}}s([i()],m.prototype,"_drawActive",void 0),s([i({readOnly:!0})],m.prototype,"cursor",null),s([i({value:!0})],m.prototype,"editable",null),s([i({type:Number})],m.prototype,"geodesicDistanceThreshold",void 0),s([i({readOnly:!0})],m.prototype,"measurement",void 0),s([i({readOnly:!0})],m.prototype,"measurementLabel",void 0),s([i()],m.prototype,"messages",void 0),s([i()],m.prototype,"unit",void 0),s([i({constructOnly:!0})],m.prototype,"view",void 0),m=s([k("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DTool")],m);let d=class extends ye{constructor(e){super(e),this.supportedViewType="2d",this.unsupportedErrorMessage="DistanceMeasurement2DViewModel is only supported in 2D views.",this.geodesicDistanceThreshold=1e5}initialize(){this.addHandles([y(()=>{var e;return(e=this.view)==null?void 0:e.spatialReference},()=>this.clear()),y(()=>this.unit,e=>{this.tool!=null&&(this.tool.unit=e)},S),y(()=>this.geodesicDistanceThreshold,e=>{this.tool!=null&&(this.tool.geodesicDistanceThreshold=e)},S)])}get measurement(){return this.tool!=null?this.tool.measurement:null}get measurementLabel(){return this.tool!=null?this.tool.measurementLabel:null}get state(){var e;return this.disabled||this.view==null||!fe((e=this.view)==null?void 0:e.spatialReference)?"disabled":this.tool!=null&&this.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(e){this._overrideIfSome("unit",this._validateUnit(e))}get unitOptions(){return L}set unitOptions(e){this._overrideIfSome("unitOptions",this._validateUnits(e))}async start(){const e=this.view;e!=null&&(await ne(()=>e.ready),be(e.spatialReference)&&await oe()),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new m({view:this.view,visible:this.visible,geodesicDistanceThreshold:this.geodesicDistanceThreshold,unit:this.unit})}_validateUnit(e){const{unitOptions:t,defaultUnit:r}=this;return e!=null&&t.includes(e)?e:t.includes(r)?r:t.length>0?t[0]:r}_validateUnits(e){if(e==null)return[];const t=e.filter(r=>L.includes(r));return t.length===0?L.slice():t}};s([i(re)],d.prototype,"defaultUnit",void 0),s([i({type:Number})],d.prototype,"geodesicDistanceThreshold",void 0),s([i({readOnly:!0})],d.prototype,"measurement",null),s([i({readOnly:!0})],d.prototype,"measurementLabel",null),s([i({readOnly:!0})],d.prototype,"state",null),s([i({type:String})],d.prototype,"unit",null),s([i({type:[String]})],d.prototype,"unitOptions",null),d=s([k("esri.widgets.DistanceMeasurement2D.DistanceMeasurement2DViewModel")],d);const N=d,P="esri-distance-measurement-2d",$={base:P,newMeasurementButton:`${P}__clear-button`,widgetIcon:he.measureLine};let c=class extends ae{constructor(e,t){super(e,t),this.iconClass=$.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.viewModel=new N}get active(){return this.viewModel.active}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const{messages:e,messagesCommon:t,unit:r,unitOptions:o,viewModel:l}=this,{active:a,measurementLabel:h,state:n,supported:u}=l;return B("div",{"aria-label":this.messages.widgetLabel,class:this.classes($.base,z.widget,z.panel),key:this,role:"presentation"},this.visible?B(we,{active:a,measurementItems:[{key:"distance",title:e.distance,value:h}],messages:{...e,notApplicable:t.notApplicable},newMeasurementButtonClass:$.newMeasurementButton,state:n,supported:u,unit:r,unitOptions:o,onNewMeasurementClick:()=>{le(this.viewModel.start())},onUnitChange:p=>{this.unit=p}}):null)}};s([i({readOnly:!0})],c.prototype,"active",null),s([i()],c.prototype,"iconClass",void 0),s([i()],c.prototype,"icon",void 0),s([i()],c.prototype,"label",null),s([i()],c.prototype,"uiStrings",void 0),s([i(),G("esri/widgets/DistanceMeasurement2D/t9n/DistanceMeasurement2D")],c.prototype,"messages",void 0),s([i(),G("esri/t9n/common")],c.prototype,"messagesCommon",void 0),s([i()],c.prototype,"unit",null),s([i()],c.prototype,"unitOptions",null),s([i()],c.prototype,"view",null),s([i({type:N})],c.prototype,"viewModel",void 0),s([i({type:Boolean})],c.prototype,"visible",null),c=s([k("esri.widgets.DistanceMeasurement2D")],c);const ze=c;export{ze as default}; diff --git a/dist/assets/Draw-DYxsSuyr.js b/dist/assets/Draw-DYxsSuyr.js new file mode 100644 index 0000000..2944b25 --- /dev/null +++ b/dist/assets/Draw-DYxsSuyr.js @@ -0,0 +1 @@ +import{K as C,Q as U,O as b,n as y,bI as G,aR as S,bB as Z,ao as M,e as n,y as r,c as u,$ as s,kS as p,X as a,T as x,np as R,p as $}from"./index-J0iiHjMT.js";import{S as K}from"./SnappingVisualizer2D-NnEm1PvQ.js";import{w as z,V as A,p as E,l as D}from"./EditGeometryOperations-TPE5Wzab.js";import{e as F}from"./SnappingContext-6K6JmvvY.js";import{p as N}from"./SnappingOperation-2U48wt1k.js";import{k as B,o as Y,r as Q,c as k,e as I,F as X}from"./surfaceCoordinateSystems-siQq4eBA.js";import{l as j}from"./InteractiveToolBase-WDic4GPF.js";var P;let l=P=class extends C.EventedAccessor{constructor(e){super(e),this._hasZ=null,this._cursorScreenPoint=null,this._activePointerId=null,this._stagedVertexUnsnapped=null,this._lastVertexUnsnapped=null,this._viewHandlesKey="view-handles",this._undoRedoHandlesKey="undo-redo-handles",this._drawToolHandlesKey="draw-tool",this._nativeEventHistory={undoStack:[],redoStack:[]},this.interactiveUndoDisabled=!1,this.history=[],this.redoHistory=[],this.snapToScene=!1,this.view=null,this.elevationInfo=null,this.defaultZ=0,this._coordinateHelper=z(!!e.hasZ,!1,e.view.spatialReference),this._snappingManager=e.snappingManager,this._editGeometryOperations=new A(new E(e.editGeometryType??"polygon",this._coordinateHelper)),this._snappingGraphicsLayer=new U({id:P.SNAPPING_GRAPHICS_LAYER_ID,listMode:"hide",internal:!0}),this._snappingContext=new F({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:"mouse",visualizer:new K(this._snappingGraphicsLayer)}),this._activeComponent=new D(e.view.spatialReference,b.Local),this._editGeometryOperations.data.components.push(this._activeComponent)}normalizeCtorArgs(e){const t={...e};return delete t.editGeometryType,t}initialize(){this._snappingOperation=new N({view:this.view}),this.view.type==="2d"&&this.view.map.layers.add(this._snappingGraphicsLayer)}destroy(){this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy(),this._snappingManager!=null&&this._snappingManager.doneSnapping(),this._snappingOperation=y(this._snappingOperation),this._editGeometryOperations.destroy()}get _committedVertices(){return this._editGeometryOperations.data.components[0].vertices.map(e=>e.pos)}get vertices(){return this._stagedVertex!=null?[...this._committedVertices,this._coordinateHelper.pointToArray(this._stagedVertex)]:this._committedVertices}get hasZ(){return this._hasZ!=null?this._hasZ:this.view.type==="3d"}set hasZ(e){this._hasZ=e,this.notifyChange("hasZ")}get _stagedVertex(){return this._snappingOperation.stagedPoint}set _stagedVertex(e){this._snappingOperation.stagedPoint=G(e)}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this.canUndo&&this._editGeometryOperations.undo()}redo(){this.canRedo&&this._editGeometryOperations.redo()}getCoordsFromScreenPoint(e){const t=e&&this.screenToMap(e);return t==null?null:t.hasZ?[t.x,t.y,t.z]:[t.x,t.y]}getCoordsAndPointFromScreenPoint(e){const t=this.screenToMap(e);return t==null?null:t.hasZ?{vertex:[t.x,t.y,t.z],mapPoint:t}:{vertex:[t.x,t.y],mapPoint:t}}screenToMap(e){let t=null;if(this.view.type==="3d")if(this.hasZ){const i=this.elevationInfo??q;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(S(e.x,e.y),i,this._getGeometryZValue())}else{const i=this.elevationInfo??J;t=this.view.sceneIntersectionHelper.intersectElevationFromScreen(S(e.x,e.y),i,0),t!=null&&(t.z=void 0)}else t=this.view.toMap(e),t!=null&&(t.z=this.hasZ?this._getGeometryZValue():void 0);return t}_pushCursorVertex(e,t){const i=Z(e[0],e[1],void 0,this.view.spatialReference);this._stagedVertexUnsnapped=i;const o=this._snappingManager;if(o==null)return this._stagedVertex=i,void t();M(this._snappingOperation.snap({point:i},o,this._snappingContext)).then(()=>{t()})}_popCursorVertex(){this._stagedVertexUnsnapped=null,this._stagedVertex=null}_getGeometryZValue(){return this.defaultZ}_abortSnapping(){this._snappingOperation.abort()}_isDuplicateOfLastVertex(e){var d;const t=(d=this._editGeometryOperations.data.components[0].getLastVertex())==null?void 0:d.pos;if(t&&e[0]===t[0]&&e[1]===t[1])return!0;const{x:i,y:o}=this._coordinateHelper.vectorToDehydratedPoint(e);return this._lastVertexUnsnapped!=null&&i===this._lastVertexUnsnapped.x&&o===this._lastVertexUnsnapped.y}_shouldHandlePointerEvent(e){return this._isPrimaryPointerAction(e)&&(this._activePointerId==null||this._activePointerId===e.pointerId)}_vertexAddHandler(e){const t=this._stagedVertex!=null?this._coordinateHelper.pointToArray(this._stagedVertex):this.getCoordsFromScreenPoint(this._cursorScreenPoint);t!=null&&this._addVertex(t,e.native)}_drawCompleteHandler(e){this._completeDrawing(e.native)}_isPrimaryPointerAction(e){return e.pointerType!=="mouse"||e.button===0}};l.SNAPPING_GRAPHICS_LAYER_ID="DrawAction-snapping-graphics-layer",n([r({readOnly:!0})],l.prototype,"vertices",null),n([r({type:Boolean,nonNullable:!0})],l.prototype,"interactiveUndoDisabled",void 0),n([r({readOnly:!0})],l.prototype,"history",void 0),n([r({readOnly:!0})],l.prototype,"redoHistory",void 0),n([r()],l.prototype,"snapToScene",void 0),n([r()],l.prototype,"view",void 0),n([r()],l.prototype,"elevationInfo",void 0),n([r({nonNullable:!0})],l.prototype,"defaultZ",void 0),n([r()],l.prototype,"hasZ",null),n([r()],l.prototype,"_snappingOperation",void 0),n([r()],l.prototype,"_stagedVertex",null),l=P=n([u("esri.views.draw.DrawAction")],l);const q={mode:"absolute-height",offset:0},J={mode:"on-the-ground",offset:0},O=l;class c{constructor(t,i,o,d){this.view=t,this.native=i,this.vertexIndex=o,this.vertices=d,this.defaultPrevented=!1,this.type="vertex-add"}preventDefault(){this.defaultPrevented=!0}}class f{constructor(t,i,o,d){this.view=t,this.native=i,this.vertexIndex=o,this.vertices=d,this.defaultPrevented=!1,this.type="vertex-remove"}preventDefault(){this.defaultPrevented=!0}}class _{constructor(t,i,o,d,L=null){this.view=t,this.native=i,this.vertexIndex=o,this.vertices=d,this.mapPoint=L,this.coordinates=null,this.defaultPrevented=!1,this.type="cursor-update",this.coordinates=d.length===1?d[0]:null}preventDefault(){this.defaultPrevented=!0}}class v{constructor(t,i){this.native=t,this.vertices=i,this.coordinates=null,this.defaultPrevented=!1,this.type="draw-complete",this.coordinates=i.length===1?i[0]:null}preventDefault(){this.defaultPrevented=!0}}let V=class extends O{constructor(e){super(e),this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1}initialize(){this._addViewHandles(),this._addUndoRedoHandles()}destroy(){this._removeViewHandles(),this._removeUndoRedoHandles(),this.emit("destroy")}undo(){super.undo(),this.notifyChange("vertices")}redo(){super.redo(),this.notifyChange("vertices")}complete(){this._completeDrawing()}_addViewHandles(){this._removeViewHandles(),this.addHandles([this.view.on("click",e=>{e.stopPropagation()},s.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=p(e),e.pointerType==="touch"&&this._updateCursor(e.native))},s.TOOL),this.view.on("pointer-move",e=>{this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._abortSnapping(),this._cursorScreenPoint=p(e),e.pointerType!=="touch"&&this._updateCursor(e.native)},s.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._addVertexOnPointerUp=!1)},s.TOOL),this.view.on("pointer-up",e=>{if(this._shouldHandlePointerEvent(e))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp)this._vertexAddHandler(e);else{const t=e.pointerType==="touch";this._updateCursor(e.native,t)}},s.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},s.TOOL),this.view.on("double-click",e=>{e.stopPropagation(),this._drawCompleteHandler(e)},s.TOOL),this.view.on("double-click",["Control"],e=>{e.stopPropagation(),this._drawCompleteHandler(e)},s.TOOL),this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t===a.vertexAdd&&!i&&this._cursorScreenPoint?(e.stopPropagation(),this._abortSnapping(),this._vertexAddHandler(e)):t!==a.complete||i?t!==a.undo||this.interactiveUndoDisabled||i?t!==a.redo||this.interactiveUndoDisabled||i?t!==a.pan||i||e.stopPropagation():(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e))},s.TOOL),this.view.on("key-up",e=>{e.key===a.pan&&e.stopPropagation()},s.TOOL)],this._viewHandlesKey)}_addUndoRedoHandles(){this._removeUndoRedoHandles(),this.addHandles([this._editGeometryOperations.on("vertex-remove",e=>{if(this.notifyChange("vertices"),e.operation==="undo"){const t=this._nativeEventHistory.undoStack.pop();this._nativeEventHistory.redoStack.push(t);const i=[...this._committedVertices];this._stagedVertex!=null&&i.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new f(this.view,t,e.vertices[0].index,i))}}),this._editGeometryOperations.on("vertex-add",e=>{if(this.notifyChange("vertices"),e.operation==="apply"){const t=this._nativeEventHistory.undoStack[this._nativeEventHistory.undoStack.length],i=this._committedVertices.length-1,o=new c(this.view,t,i,this.vertices);this.emit("vertex-add",o),o.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if(e.operation==="redo"){const t=this._nativeEventHistory.redoStack.pop();this._nativeEventHistory.undoStack.push(t);const i=[...this._committedVertices];this._stagedVertex!=null&&i.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new c(this.view,t,e.vertices[0].index,i))}})],this._undoRedoHandlesKey)}_removeViewHandles(){this.removeHandles(this._viewHandlesKey)}_removeUndoRedoHandles(){this.removeHandles(this._undoRedoHandlesKey)}_addVertex(e,t){const i=this._coordinateHelper.arrayToVector(e);if(this._isDuplicateOfLastVertex(i))return;this._popCursorVertex(),this._editGeometryOperations.appendVertex(i);const o=t||new Event("placeholder");this._nativeEventHistory.undoStack.push(o)}_updateCursor(e,t=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const i=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);i==null||t||this._pushCursorVertex(i.vertex,()=>this.emit("cursor-update",new _(this.view,e,this._activeComponent.vertices.length,this.vertices,this._stagedVertex!=null?new x(this._stagedVertex):null)))}_completeDrawing(e){if(this._activePointerId=null,this._popCursorVertex(),this._abortSnapping(),this._snappingManager!=null&&this._snappingManager.doneSnapping(),this.vertices.length<1)return;const t=new v(e,this.vertices);this.emit("draw-complete",t),t.defaultPrevented||this._removeViewHandles()}};V=n([u("esri.views.draw.MultipointDrawAction")],V);let h=class extends C.EventedMixin(j){constructor(t){super(t),this.defaultZ=0,this.elevationInfo=null,this.hasZ=!0,this.mode=null,this.snapToScene=null,this.type="draw-3d"}initialize(){const t=this.view,i=R(this.hasZ,this.elevationInfo);this.drawOperation=new B({view:t,manipulators:this.manipulators,geometryType:this.geometryType,drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:t.type==="3d"?new Y(t,i):null,elevationDrawSurface:t.type==="3d"?new Q(i,this.defaultZ,t):null,hasM:!1,elevationInfo:i}),this.addHandles([this.drawOperation.on("vertex-add",o=>this.onVertexAdd(o)),this.drawOperation.on("vertex-remove",o=>this.onVertexRemove(o)),this.drawOperation.on("vertex-update",o=>this.onVertexUpdate(o)),this.drawOperation.on("cursor-update",o=>this.onCursorUpdate(o)),this.drawOperation.on("complete",o=>this.onComplete(o))]),this.finishToolCreation()}destroy(){this.drawOperation=y(this.drawOperation),this._set("view",null)}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}get updating(){var t;return((t=this.drawOperation)==null?void 0:t.updating)??!1}completeCreateOperation(){this.drawOperation.complete()}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}getVertexCoords(){return this.drawOperation.vertices}onInputEvent(t){this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}onComplete(t){this.emit("complete",t)}onCursorUpdate(t){this.emit("cursor-update",t)}onVertexAdd(t){this.emit("vertex-add",t)}onVertexRemove(t){this.emit("vertex-remove",t)}onVertexUpdate(t){this.emit("vertex-update",t)}};n([r({constructOnly:!0,nonNullable:!0})],h.prototype,"defaultZ",void 0),n([r()],h.prototype,"drawOperation",void 0),n([r({constructOnly:!0})],h.prototype,"elevationInfo",void 0),n([r({value:!0})],h.prototype,"enabled",null),n([r({constructOnly:!0})],h.prototype,"geometryType",void 0),n([r({constructOnly:!0})],h.prototype,"hasZ",void 0),n([r({constructOnly:!0})],h.prototype,"mode",void 0),n([r()],h.prototype,"snapToScene",void 0),n([r({readOnly:!0})],h.prototype,"type",void 0),n([r({readOnly:!0})],h.prototype,"updating",null),n([r({constructOnly:!0,nonNullable:!0})],h.prototype,"view",void 0),h=n([u("esri.views.draw.DrawTool")],h);let T=class extends O{constructor(t){super(t),this._addVertexOnPointerUp=!1}initialize(){this.view.type==="2d"?this._addViewHandles():this._addDrawTool()}destroy(){this.view.type==="2d"?this._removeViewHandles():this._removeDrawTool(),this.emit("destroy")}complete(){this.view.type==="2d"?this._cursorScreenPoint&&this._completeDrawing():this._drawTool.completeCreateOperation()}_addViewHandles(){this._removeViewHandles(),this.addHandles([this.view.on("pointer-down",t=>{this._shouldHandlePointerEvent(t)&&(this._abortSnapping(),this._activePointerId=t.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=p(t),t.pointerType==="touch"&&this._updateCursor(t.native))},s.TOOL),this.view.on("pointer-move",t=>{this._abortSnapping(),this._cursorScreenPoint=p(t),t.pointerType!=="touch"&&this._updateCursor(t.native)},s.TOOL),this.view.on("pointer-drag",t=>{this._shouldHandlePointerEvent(t)&&(this._abortSnapping(),this._addVertexOnPointerUp=!1)},s.TOOL),this.view.on("pointer-up",t=>{if(this._shouldHandlePointerEvent(t))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp)t.stopPropagation(),this._vertexAddHandler(t);else{const i=t.pointerType==="touch";this._updateCursor(t.native,i)}},s.TOOL),this.view.on("drag",["Shift"],t=>{t.stopPropagation()},s.TOOL),this.view.on("key-down",t=>{t.key===a.complete&&this._cursorScreenPoint&&(this._abortSnapping(),this._vertexAddHandler(t))},s.TOOL)],this._viewHandlesKey)}_removeViewHandles(){this.removeHandles(this._viewHandlesKey)}_addDrawTool(){this._drawTool=new h({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"point",mode:"click"}),this.view.addAndActivateTool(this._drawTool),this.addHandles([this._drawTool.on("cursor-update",t=>{t.vertices.length===1&&this.emit("cursor-update",new _(this.view,null,t.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("complete",t=>{this.emit("draw-complete",new v(null,this._drawTool.getVertexCoords())),this._removeDrawTool()})],this._drawToolHandlesKey)}_removeDrawTool(){this.removeHandles(this._drawToolHandlesKey),this.view.tools.remove(this._drawTool),this._drawTool=null}_addVertex(t){const i=this._coordinateHelper.arrayToVector(t);this._isDuplicateOfLastVertex(i)||(this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(i),this.notifyChange("vertices"),this._completeDrawing())}_updateCursor(t,i=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const o=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);o==null||i||this._pushCursorVertex(o.vertex,()=>this.emit("cursor-update",new _(this.view,t,this._activeComponent.vertices.length,this.vertices,this._stagedVertex!=null?new x(this._stagedVertex):null)))}_completeDrawing(t){this._activePointerId=null,this._popCursorVertex(),this._abortSnapping(),this._snappingManager!=null&&this._snappingManager.doneSnapping();const i=new v(t,this.vertices);this.emit("draw-complete",i),i.defaultPrevented||this._removeViewHandles()}};T=n([u("esri.views.draw.PointDrawAction")],T);let w=class extends O{constructor(t){super(t),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this.mode=I}initialize(){this.view.type==="2d"?(this._addViewHandles(),this._addUndoRedoHandles()):this._addDrawTool()}destroy(){this.view.type==="2d"?(this._removeViewHandles(),this._removeUndoRedoHandles()):this._removeDrawTool(),this.emit("destroy")}get _dragEnabled(){return this.mode==="freehand"||this.mode==="hybrid"}get _clickEnabled(){return this.mode==="click"||this.mode==="hybrid"}undo(){super.undo(),this.notifyChange("vertices")}redo(){super.redo(),this.notifyChange("vertices")}complete(){this.view.type==="2d"?this._completeDrawing():this._drawTool.completeCreateOperation()}_getGeometryZValue(){return this.hasZ&&this.vertices.length>0?this.vertices[0][2]:this.defaultZ}_addViewHandles(){this._removeViewHandles(),this.addHandles([this.view.on("click",t=>{t.stopPropagation()},s.TOOL),this.view.on("pointer-down",t=>{this._shouldHandlePointerEvent(t)&&(this._abortSnapping(),this._activePointerId=t.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=p(t),t.pointerType==="touch"&&this._updateCursor(t.native))},s.TOOL),this.view.on("pointer-move",t=>{this._abortSnapping(),this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._cursorScreenPoint=p(t),t.pointerType!=="touch"&&this._updateCursor(t.native)},s.TOOL),this.view.on("pointer-drag",t=>{this._shouldHandlePointerEvent(t)&&(this._abortSnapping(),this._cursorScreenPoint=p(t),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(t):this._addVertexOnPointerUp=!1)},s.TOOL),this.view.on("pointer-up",t=>{if(this._shouldHandlePointerEvent(t))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp){if(!this._clickEnabled)return this.vertices.length===1&&this.vertices.pop(),void this._drawCompleteHandler(t);this._vertexAddHandler(t)}else{const i=t.pointerType==="touch";this._updateCursor(t.native,i)}},s.TOOL),this.view.on("drag",t=>{this._dragEnabled&&this._activePointerId!=null&&!this._panEnabled&&t.stopPropagation()},s.TOOL),this.view.on("drag",["Shift"],t=>{t.stopPropagation()},s.TOOL),this.view.on("double-click",t=>{t.stopPropagation(),this._drawCompleteHandler(t)},s.TOOL),this.view.on("double-click",["Control"],t=>{t.stopPropagation(),this._drawCompleteHandler(t)},s.TOOL),this.view.on("key-down",t=>{const{key:i,repeat:o}=t;i===a.vertexAdd&&!o&&this._cursorScreenPoint?(t.stopPropagation(),this._abortSnapping(),this._vertexAddHandler(t)):i!==a.complete||o?i!==a.undo||this.interactiveUndoDisabled||o?i!==a.redo||this.interactiveUndoDisabled||o?i!==a.pan||o||(t.stopPropagation(),this._panEnabled=!0):(t.stopPropagation(),this.redo()):(t.stopPropagation(),this.undo()):(t.stopPropagation(),this._drawCompleteHandler(t))},s.TOOL),this.view.on("key-up",t=>{t.key===a.pan&&(t.stopPropagation(),this._panEnabled=!1)},s.TOOL)],this._viewHandlesKey)}_addUndoRedoHandles(){this._removeUndoRedoHandles(),this.addHandles([this._editGeometryOperations.on("vertex-remove",t=>{if(this.notifyChange("vertices"),t.operation==="undo"){const i=this._nativeEventHistory.undoStack.pop();this._nativeEventHistory.redoStack.push(i);const o=[...this._committedVertices];this._stagedVertex!=null&&o.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new f(this.view,i,t.vertices[0].index,o))}}),this._editGeometryOperations.on("vertex-add",t=>{if(this.notifyChange("vertices"),t.operation==="apply"){const i=this._nativeEventHistory.undoStack[this._nativeEventHistory.undoStack.length],o=this._committedVertices.length-1,d=new c(this.view,i,o,this.vertices);this.emit("vertex-add",d),d.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if(t.operation==="redo"){const i=this._nativeEventHistory.redoStack.pop();this._nativeEventHistory.undoStack.push(i);const o=[...this._committedVertices];this._stagedVertex!=null&&o.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new c(this.view,i,t.vertices[0].index,o))}})],this._undoRedoHandlesKey)}_removeViewHandles(){this.removeHandles(this._viewHandlesKey)}_removeUndoRedoHandles(){this.removeHandles(this._undoRedoHandlesKey)}_addDrawTool(){this._drawTool=new h({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polygon",mode:this.mode}),this.view.addAndActivateTool(this._drawTool),this._drawTool.on("vertex-add",t=>{t.vertices.length===1&&this.emit("vertex-add",new c(this.view,null,t.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("cursor-update",t=>{t.vertices.length===1&&this.emit("cursor-update",new _(this.view,null,t.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("complete",t=>{this.emit("draw-complete",new v(null,this._drawTool.getVertexCoords())),this._removeDrawTool()})}_removeDrawTool(){this.removeHandles(this._drawToolHandlesKey),this.view.tools.remove(this._drawTool),this._drawTool=y(this._drawTool)}_addVertex(t,i){const o=this._coordinateHelper.arrayToVector(t);if(this._isDuplicateOfLastVertex(o))return;this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(o);const d=i||new Event("placeholder");this._nativeEventHistory.undoStack.push(d)}_updateCursor(t,i=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const o=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);o==null||i||this._pushCursorVertex(o.vertex,()=>this.emit("cursor-update",new _(this.view,t,this._activeComponent.vertices.length,this.vertices,this._stagedVertex!=null?new x(this._stagedVertex):null)))}_completeDrawing(t){if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<3)return;this._abortSnapping(),this._snappingManager!=null&&this._snappingManager.doneSnapping();const i=new v(t,this.vertices);this.emit("draw-complete",i),i.defaultPrevented||this._removeViewHandles()}};n([r()],w.prototype,"_dragEnabled",null),n([r()],w.prototype,"_clickEnabled",null),n([r({type:k})],w.prototype,"mode",void 0),w=n([u("esri.views.draw.PolygonDrawAction")],w);let g=class extends O{constructor(e){super(e),this._panEnabled=!1,this._popVertexOnPointerMove=!1,this._addVertexOnPointerUp=!1,this.mode=I}initialize(){this.view.type==="2d"?(this._addViewHandles(),this._addUndoRedoHandles()):this._addDrawTool()}destroy(){this.view.type==="2d"?(this._removeViewHandles(),this._removeUndoRedoHandles()):this._removeDrawTool(),this.emit("destroy")}get _clickEnabled(){return this.mode==="click"||this.mode==="hybrid"}get _dragEnabled(){return this.mode==="freehand"||this.mode==="hybrid"}undo(){super.undo(),this.notifyChange("vertices")}redo(){super.redo(),this.notifyChange("vertices")}complete(){this.view.type==="2d"?this._completeDrawing():this._drawTool.completeCreateOperation()}_addViewHandles(){this._removeViewHandles(),this.addHandles([this.view.on("click",e=>{e.stopPropagation()},s.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&!this._panEnabled&&(this._abortSnapping(),this._activePointerId=e.pointerId,this._addVertexOnPointerUp=!0,this._cursorScreenPoint=p(e),e.pointerType==="touch"&&this._updateCursor(e.native))},s.TOOL),this.view.on("pointer-move",e=>{this._popVertexOnPointerMove&&(this.undo(),this._popVertexOnPointerMove=!1),this._abortSnapping(),this._cursorScreenPoint=p(e),e.pointerType!=="touch"&&this._updateCursor(e.native)},s.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._cursorScreenPoint=p(e),this._dragEnabled&&!this._panEnabled?this._vertexAddHandler(e):this._addVertexOnPointerUp=!1)},s.TOOL),this.view.on("pointer-up",e=>{if(this._shouldHandlePointerEvent(e))if(this._abortSnapping(),this._activePointerId=null,this._addVertexOnPointerUp){if(!this._clickEnabled)return this.vertices.length===1&&this.vertices.pop(),void this._drawCompleteHandler(e);this._vertexAddHandler(e)}else{const t=e.pointerType==="touch";this._updateCursor(e.native,t)}},s.TOOL),this.view.on("drag",e=>{this._dragEnabled&&this._activePointerId!=null&&!this._panEnabled&&e.stopPropagation()},s.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},s.TOOL),this.view.on("double-click",e=>{e.stopPropagation(),this._drawCompleteHandler(e)},s.TOOL),this.view.on("double-click",["Control"],e=>{e.stopPropagation(),this._drawCompleteHandler(e)},s.TOOL),this.view.on("key-down",e=>{const{key:t,repeat:i}=e;t===a.vertexAdd&&!i&&this._cursorScreenPoint?(e.stopPropagation(),this._abortSnapping(),this._vertexAddHandler(e)):t!==a.complete||i?t!==a.undo||this.interactiveUndoDisabled||i?t!==a.redo||this.interactiveUndoDisabled||i?t!==a.pan||i||(e.stopPropagation(),this._panEnabled=!0):(e.stopPropagation(),this.redo()):(e.stopPropagation(),this.undo()):(e.stopPropagation(),this._drawCompleteHandler(e))},s.TOOL),this.view.on("key-up",e=>{e.key===a.pan&&(e.stopPropagation(),this._panEnabled=!1)},s.TOOL)],this._viewHandlesKey)}_addUndoRedoHandles(){this._removeUndoRedoHandles(),this.addHandles([this._editGeometryOperations.on("vertex-remove",e=>{if(this.notifyChange("vertices"),e.operation==="undo"){const t=this._nativeEventHistory.undoStack.pop();this._nativeEventHistory.redoStack.push(t);const i=[...this._committedVertices];this._stagedVertex!=null&&i.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("undo",new f(this.view,t,e.vertices[0].index,i))}}),this._editGeometryOperations.on("vertex-add",e=>{if(this.notifyChange("vertices"),e.operation==="apply"){const t=this._nativeEventHistory.undoStack[this._nativeEventHistory.undoStack.length],i=this._committedVertices.length-1,o=new c(this.view,t,i,this.vertices);this.emit("vertex-add",o),o.defaultPrevented&&(this._popVertexOnPointerMove=!0)}else if(e.operation==="redo"){const t=this._nativeEventHistory.redoStack.pop();this._nativeEventHistory.undoStack.push(t);const i=[...this._committedVertices];this._stagedVertex!=null&&i.push(this._coordinateHelper.pointToArray(this._stagedVertex)),this.emit("redo",new c(this.view,t,e.vertices[0].index,i))}})],this._undoRedoHandlesKey)}_removeViewHandles(){this.removeHandles(this._viewHandlesKey)}_removeUndoRedoHandles(){this.removeHandles(this._undoRedoHandlesKey)}_addDrawTool(){this._drawTool=new h({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"polyline",mode:this.mode}),this.view.addAndActivateTool(this._drawTool),this.addHandles([this._drawTool.on("vertex-add",e=>{e.vertices.length===1&&this.emit("vertex-add",new c(this.view,null,e.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("cursor-update",e=>{e.vertices.length===1&&this.emit("cursor-update",new _(this.view,null,e.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("complete",e=>{this.emit("draw-complete",new v(null,this._drawTool.getVertexCoords())),this._removeDrawTool()})],this._drawToolHandlesKey)}_removeDrawTool(){this.removeHandles(this._drawToolHandlesKey),this.view.tools.remove(this._drawTool),this._drawTool=y(this._drawTool)}_addVertex(e,t){const i=this._coordinateHelper.arrayToVector(e);if(this._isDuplicateOfLastVertex(i))return;this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(i);const o=t||new Event("placeholder");this._nativeEventHistory.undoStack.push(o)}_updateCursor(e,t=!1){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const i=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);i==null||t||this._pushCursorVertex(i.vertex,()=>this.emit("cursor-update",new _(this.view,e,this._activeComponent.vertices.length,this.vertices,this._stagedVertex!=null?new x(this._stagedVertex):null)))}_completeDrawing(e){if(this._activePointerId=null,this._popCursorVertex(),this._committedVertices.length<2)return;this._abortSnapping(),this._snappingManager!=null&&this._snappingManager.doneSnapping();const t=new v(e,this.vertices);this.emit("draw-complete",t),t.defaultPrevented||this._removeViewHandles()}};n([r()],g.prototype,"_clickEnabled",null),n([r()],g.prototype,"_dragEnabled",null),n([r({type:k})],g.prototype,"mode",void 0),g=n([u("esri.views.draw.PolylineDrawAction")],g);const W=["freehand","click"];let H=class extends O{constructor(e){super(e),this._isDragging=!1,this._panEnabled=!1,this._addVertexOnPointerUp=!1,this.viewAlignedCoordinateSystem=null,this.mode="freehand"}initialize(){this.view.type==="2d"?this._addViewHandles():this._addDrawTool()}destroy(){this.view.type==="2d"?this._removeViewHandles():this._removeDrawTool(),this.emit("destroy")}complete(){this.view.type==="2d"?this._completeDrawing():this._drawTool.completeCreateOperation()}_getGeometryZValue(){return this.hasZ&&this.vertices.length>0?this.vertices[0][2]:this.defaultZ}_addViewHandles(){this._removeViewHandles(),this.mode==="click"?this.addHandles(this._getClickModeViewHandles(),this._viewHandlesKey):this.addHandles(this._getDragModeViewHandles(),this._viewHandlesKey)}_getDragModeViewHandles(){return[this.view.on("immediate-click",e=>{e.stopPropagation(),e.mapPoint&&!this._panEnabled&&this.getCoordsFromScreenPoint(p(e))!=null&&(this._vertexAddHandler(e),this._drawCompleteHandler(e))},s.TOOL),this.view.on("pointer-down",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._panEnabled||(this._resetGeometry(),this._addVertexOnPointerUp=!0,this._cursorScreenPoint=p(e),this._activePointerId=e.pointerId,this._vertexAddHandler(e),this._isDragging=!1,e.pointerType==="touch"&&this._updateCursor(e.native)))},s.TOOL),this.view.on("pointer-move",e=>{this._abortSnapping(),this._activePointerId==null&&e.pointerType!=="touch"&&(this._cursorScreenPoint=p(e),this._updateCursor(e.native))},s.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._isDragging=!0,this._cursorScreenPoint=p(e),this._updateCursor(e.native))},s.TOOL),this.view.on("pointer-up",e=>{this._shouldHandlePointerEvent(e)&&this._addVertexOnPointerUp&&(this._abortSnapping(),this._activePointerId=null,this._isDragging&&this._vertexAddHandler(e),this._committedVertices.length===2&&this._drawCompleteHandler(e),this._isDragging=!1)},s.TOOL),this.view.on("key-down",e=>{e.key===a.complete&&this._cursorScreenPoint?(this._abortSnapping(),this._vertexAddHandler(e),this._drawCompleteHandler(e)):e.key===a.pan&&(this._panEnabled=!0)},s.TOOL),this.view.on("key-up",e=>{e.key===a.pan&&(this._panEnabled=!1)},s.TOOL),this.view.on("drag",e=>{this._activePointerId!=null&&e.stopPropagation()},s.TOOL),this.view.on("drag",["Shift"],e=>{e.stopPropagation()},s.TOOL)]}_getClickModeViewHandles(){return[this.view.on("pointer-down",e=>{this._abortSnapping(),this._cursorScreenPoint=p(e),this._activePointerId=e.pointerId,this._isDragging=!1,e.pointerType==="touch"&&this._updateCursor(e.native)},s.TOOL),this.view.on("pointer-move",e=>{this._abortSnapping(),this._cursorScreenPoint=p(e),this._activePointerId==null&&e.pointerType!=="touch"&&this._updateCursor(e.native)},s.TOOL),this.view.on("pointer-drag",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._isDragging=!0)},s.TOOL),this.view.on("pointer-up",e=>{this._shouldHandlePointerEvent(e)&&(this._abortSnapping(),this._activePointerId=null,e.stopPropagation(),this._isDragging||this._vertexAddHandler(e),this.vertices.length!==2||this._isDragging||this._drawCompleteHandler(e),this._isDragging=!1)},s.TOOL),this.view.on("key-down",e=>{e.key===a.vertexAdd&&this._cursorScreenPoint&&(this._vertexAddHandler(e),this.vertices.length===2&&this._drawCompleteHandler(e)),e.key===a.complete&&this._cursorScreenPoint&&this.vertices.length===2&&(this._vertexAddHandler(e),this._drawCompleteHandler(e))},s.TOOL)]}_removeViewHandles(){this.removeHandles(this._viewHandlesKey)}_addDrawTool(){this._drawTool=new h({view:this.view,elevationInfo:this.elevationInfo,hasZ:this.hasZ,geometryType:"segment",mode:this.mode}),this.view.addAndActivateTool(this._drawTool),this.addHandles([this._drawTool.on("vertex-add",e=>{e.vertices.length===1&&this.emit("vertex-add",new c(this.view,null,e.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("cursor-update",e=>{e.vertices.length===1&&this.emit("cursor-update",new _(this.view,null,e.vertices[0].vertexIndex,this._drawTool.getVertexCoords()))}),this._drawTool.on("complete",e=>{this.emit("draw-complete",new v(null,this._drawTool.getVertexCoords())),this._removeDrawTool()})],this._drawToolHandlesKey)}_removeDrawTool(){this.removeHandles(this._drawToolHandlesKey),this.view.tools.remove(this._drawTool),this._drawTool=y(this._drawTool)}_addVertex(e,t){const i=this._coordinateHelper.arrayToVector(e);if(this._isDuplicateOfLastVertex(i))return;this._lastVertexUnsnapped=this._stagedVertexUnsnapped,this._popCursorVertex(),this._editGeometryOperations.appendVertex(i),this._committedVertices.length===1&&(this.viewAlignedCoordinateSystem=X(this.view,this._committedVertices[0]));const o=this._committedVertices.length-1,d=new c(this.view,t,o,this.vertices);this.emit("vertex-add",d)}_updateCursor(e){if(this._popCursorVertex(),!this._cursorScreenPoint)return;const t=this.getCoordsAndPointFromScreenPoint(this._cursorScreenPoint);t!=null&&this._pushCursorVertex(t.vertex,()=>this.emit("cursor-update",new _(this.view,e,this._activeComponent.vertices.length,this.vertices,this._stagedVertex!=null?new x(this._stagedVertex):null)))}_completeDrawing(e){if(this._activePointerId=null,this._popCursorVertex(),this._cursorScreenPoint=null,this._isDragging=!1,this._abortSnapping(),this._snappingManager!=null&&this._snappingManager.doneSnapping(),this.vertices.length<1)return;const t=new v(e,this.vertices);this.emit("draw-complete",t),t.defaultPrevented||this._removeViewHandles()}_resetGeometry(){this._editGeometryOperations.destroy(),this._editGeometryOperations=new A(new E("polygon",this._coordinateHelper)),this._activeComponent=new D(this._coordinateHelper.spatialReference,b.Local),this._editGeometryOperations.data.components.push(this._activeComponent)}};n([r({type:W})],H.prototype,"mode",void 0),H=n([u("esri/views/2d/engine/markup/SegmentDrawAction")],H);let m=class extends ${constructor(){super(...arguments),this.activeAction=null,this.type="draw",this.view=null}destroy(){this.activeAction&&(this.activeAction.destroy(),this.activeAction=null)}create(e,t){this.reset();const i={view:this.view,...t};switch(e){case"point":i.editGeometryType="point",this.activeAction=new T(i);break;case"polyline":i.editGeometryType="polyline",this.activeAction=new g(i);break;case"multipoint":i.editGeometryType="polygon",this.activeAction=new V(i);break;case"polygon":i.editGeometryType="polygon",this.activeAction=new w(i);break;case"rectangle":case"circle":case"ellipse":case"triangle":i.editGeometryType="polygon",this.activeAction=new H(i)}return this.activeAction}complete(){this.activeAction&&this.activeAction.complete(),this.activeAction=null}reset(){this.activeAction&&this.activeAction.destroy(),this.activeAction=null}};n([r()],m.prototype,"activeAction",void 0),n([r({readOnly:!0})],m.prototype,"type",void 0),n([r()],m.prototype,"view",void 0),m=n([u("esri.views.draw.Draw")],m);const pe=m;export{pe as l}; diff --git a/dist/assets/DynamicLayerView3D-4lztpXo0.js b/dist/assets/DynamicLayerView3D-4lztpXo0.js new file mode 100644 index 0000000..74deb39 --- /dev/null +++ b/dist/assets/DynamicLayerView3D-4lztpXo0.js @@ -0,0 +1 @@ +import{jI as S,jJ as v,jK as V,jL as q,h$ as F,jM as W,by as Z,bf as M,bz as b,c3 as k,G as B,ah as J,f as $,Z as y,a2 as K,eB as Q,ae as O,dT as j,jN as Y,jO as X,a as N,fZ as ee,g as te,jP as ae,jQ as C,s as D,fu as L,fz as ie,fA as H,jR as se,jS as x,b7 as re,jT as ne,jU as oe,w as le,e as w,y as R,c as he}from"./index-J0iiHjMT.js";import{n as de}from"./LayerView3D-iOx2MD1g.js";import{l as ce}from"./projectExtentUtils-TwA6ooHn.js";import{g as ue}from"./ImageMaterial.glsl-TdPtjVc_.js";import{u as ge}from"./LayerView-efDufa6j.js";import{a as me}from"./RefreshableLayerView-Pd4dLcWr.js";function fe(a,e,t){const i=S(a)/v(a),s={width:t,height:t};return i>1.0001?s.height=t/i:i<.9999&&(s.width=t*i),s.width=Math.round(s.width/(S(a)/S(e))),s.height=Math.round(s.height/(v(a)/v(e))),s}function z(a,e){return V(a,[[e[0],e[1],-1],[e[2],e[1],-1],[e[2],e[3],-1],[e[0],e[3],-1]])}function pe(a,e,t){if(!q(e,t))return z(a,t);const i=[e[1]-t[1],Math.min(e[3],t[3])-Math.max(e[1],t[1]),t[3]-e[3],123456],s=[e[0]-t[0],Math.min(e[2],t[2])-Math.max(e[0],t[0]),t[2]-e[2],123456],l=t[2]-t[0],n=t[3]-t[1],r=s[0]>0&&s[2]>0?3:2,h=i[0]>0&&i[2]>0?3:2,o=(h+1)*(r+1),c=F(3*o),u=W(2*o),d=new Array(6*(h*r-1));let E=0,I=0,P=0,g=0,f=0;for(let p=0;p<4;p++){const T=i[p];if(T<=0)continue;let A=0;for(let _=0;_<4;_++){const G=s[_];G<=0||(c[I++]=t[0]+A,c[I++]=t[1]+E,c[I++]=-1,u[P++]=A/l,u[P++]=E/n,_<3&&p<3&&(_!==1||p!==1)&&(d[f++]=g,d[f++]=g+1,d[f++]=g+r+1,d[f++]=g+1,d[f++]=g+r+2,d[f++]=g+r+1),g++,A+=G)}E+=T}const U=new Array(d.length);return new Z(a,[[M.POSITION,new b(c,d,3,!0)],[M.NORMAL,new b(_e,U,3,!0)],[M.UV0,new b(u,d,2,!0)]])}const _e=[0,0,1];let m=class extends me(de(ge)){constructor(){super(...arguments),this.drapeSourceType=k.RasterImage,this.updatePolicy=B.SYNC,this.fullExtentInLocalViewSpatialReference=null,this.maximumDataResolution=null,this._images=new Array,this._extents=new Array,this._overlays=new Array,this.updateWhenStationary=!0,this._drapeSourceRenderer=null,this.refreshDebounced=J(async a=>{this.destroyed||await this._doRefresh(a).catch(e=>{$(e)||y.getLogger(this).error(e)})},2e3)}initialize(){this._drapeSourceRenderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this),this.addHandles(K(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))),this.addResolvingPromise(ce(this).then(a=>this._set("fullExtentInLocalViewSpatialReference",a))),this._updatingHandles.add(()=>this.suspended,()=>this._suspendedChangeHandler()),this.addHandles(this.view.resourceController.scheduler.registerIdleStateCallbacks(()=>{this._isScaleRangeActive()&&this.notifyChange("suspended")},()=>{})),this._isScaleRangeLayer()&&this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.notifyChange("suspended"))}destroy(){this.clear()}setDrapingExtent(a,e){this._spatialReference=e,a.forEach((t,i)=>{this._overlays[i]=t,this._updateImageExtent(t,i)})}_updateImageExtent(a,e){const t=this._clippedExtent(a.extent,we);if(t==null)return;const i=fe(a.extent,t,a.resolution);let s=a.pixelRatio*this.view.state.pixelRatio;const{layer:l}=this;if("imageMaxWidth"in l&&l.imageMaxWidth!=null||"imageMaxHeight"in l&&l.imageMaxHeight!=null){const r=l.imageMaxWidth,h=l.imageMaxHeight;if(i.width>r){const o=r/i.width;i.height=Math.floor(i.height*o),i.width=r,s*=o}if(i.height>h){const o=h/i.height;i.width=Math.floor(i.width*o),i.height=h,s*=o}}const n=this._extents[e];n&&Q(n.extent,t)&&this._imageSizeEquals(t,n.imageSize,i)||(this._extents[e]={extent:O(t),imageSize:i,pixelRatio:s},this.suspended||this._fetch(e).catch(r=>{$(r)||y.getLogger(this).error(r)}))}clear(){for(let a=0;a0&&i>e)return!1}return!0}async processResult(a,e,t){(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement)&&(a.image=e)}findExtentInfoAt(a){for(const e of this._extents){const t=e.extent;if(new j(t[0],t[1],t[2],t[3],this._spatialReference).contains(a))return e}return null}getFetchOptions(){}async redraw(a,e){await Y(this._images,async(t,i)=>{t&&(await a(t,e),await this._createStageObjects(i,t.image,e))})}_imageSizeEquals(a,e,t){if(!this.maximumDataResolution)return!1;const i=S(a)/this.maximumDataResolution.x,s=v(a)/this.maximumDataResolution.y,l=i/e.width,n=s/e.height,r=i/t.width,h=s/t.height,o=Math.abs(l-r),c=Math.abs(n-h),u=X.TESTS_DISABLE_OPTIMIZATIONS?0:1.5;return o<=u&&c<=u}async _fetch(a,e){if(this.suspended)return;const t=this._extents[a],i=t.extent;this._images[a]||(this._images[a]={texture:null,material:null,renderGeometry:null,loadingPromise:null,loadingAbortController:null,image:null,pixelData:null,renderExtent:O(i)});const s=this._images[a];s.loadingAbortController=N(s.loadingAbortController);const l=new j(i[0],i[1],i[2],i[3],this._spatialReference);if(l.width===0||l.height===0)return void this._clearImage(a);const n=new AbortController;s.loadingAbortController=n,ee(e,()=>n.abort());const r=n.signal,h=this._waitFetchReady(r).then(async()=>{const o={requestAsImageElement:!0,pixelRatio:this._overlays[a].pixelRatio,...this.getFetchOptions(),signal:r},{height:c,width:u}=t.imageSize;return this.layer.fetchImage(l,u,c,o)}).then(o=>{if(te(r))throw y.getLogger(this).warnOnce("A call to fetchImage resolved even though the request was aborted. fetchImage should not resolve if options.signal.aborted is true."),ae();return this.processResult(s,o)}).then(()=>{C(s.renderExtent,i)});s.loadingPromise=h,await this._updatingHandles.addPromise(h.then(async()=>{D(r),await this._createStageObjects(a,s.image,r)}).catch(o=>{throw o&&!$(o)&&y.getLogger(this).error(o),o}).finally(()=>{h===s.loadingPromise&&(s.loadingPromise=null,s.loadingAbortController=null)}))}_clearImage(a){const e=this._images[a];if(e){e.renderGeometry!=null&&(this._drapeSourceRenderer.removeGeometries([e.renderGeometry],L.UPDATE),e.renderGeometry=null);const t=this.view._stage,i=e.texture;i==null||i.unload(),t.remove(i),e.texture=null,t.remove(e.material),e.material=null,e.loadingAbortController=N(e.loadingAbortController),e.loadingPromise=null,e.image=null,e.pixelData=null}}async _createStageObjects(a,e,t){const i=this.view._stage,s=this._images[a],l=()=>{var n;(n=s.texture)==null||n.unload(),i.remove(s.texture),s.texture=null,s.renderGeometry&&(this._drapeSourceRenderer.removeGeometries([s.renderGeometry],L.UPDATE),s.renderGeometry=null)};if(e){const n=new ie(e,{width:e.width,height:e.height,preMultiplyAlpha:!0,wrap:{s:H.CLAMP_TO_EDGE,t:H.CLAMP_TO_EDGE}});let r;if(await se(this._images[a===x.INNER?x.OUTER:x.INNER].loadingPromise),D(t),l(),await i.schedule(()=>n.load(i.renderView.renderingContext),t),i.add(n),s.texture=n,s.material==null?(s.material=new ue({transparent:!0,textureId:n.id}),i.add(s.material)):s.material.setParameters({textureId:n.id}),a===x.INNER)r=z(s.material,s.renderExtent);else{const h=this._images[0].renderExtent;if(!h)return void l();r=pe(s.material,h,s.renderExtent)}s.renderGeometry=new re(r),s.renderGeometry.localOrigin=this._overlays[a].renderLocalOrigin,this._drapeSourceRenderer.addGeometries([s.renderGeometry],L.UPDATE)}else l(),i.remove(s.material),s.material=null}_isScaleRangeLayer(){return"effectiveScaleRange"in this.layer}_isScaleRangeActive(){const a=this.layer;if(!this._isScaleRangeLayer())return!1;const{minScale:e,maxScale:t}=a.effectiveScaleRange;return ne(e,t)}_clippedExtent(a,e){if(this.view.viewingMode!=="local")return C(e,a);const t=this.view.basemapTerrain;return t.ready?oe(a,t.extent,e):C(e,a)}_suspendedChangeHandler(){this.suspended?this.clear():this.refreshDebounced()}async _waitFetchReady(a){await le(()=>this.view.stationary,a),D(a)}};w([R()],m.prototype,"layer",void 0),w([R()],m.prototype,"suspended",void 0),w([R({readOnly:!0})],m.prototype,"fullExtentInLocalViewSpatialReference",void 0),w([R()],m.prototype,"updating",void 0),m=w([he("esri.views.3d.layers.DynamicLayerView3D")],m);const Ie=m,we=O();export{Ie as N}; diff --git a/dist/assets/EdgeProcessingWorker-V8L8etpG.js b/dist/assets/EdgeProcessingWorker-V8L8etpG.js new file mode 100644 index 0000000..3fe9692 --- /dev/null +++ b/dist/assets/EdgeProcessingWorker-V8L8etpG.js @@ -0,0 +1 @@ +import{g2 as d,g3 as c,g4 as l,g5 as r,g6 as g,g7 as f,g8 as p}from"./index-J0iiHjMT.js";class I{async extract(e){const t=o(e),n=d(t),i=[t.data.buffer];return{result:h(n,i),transferList:i}}async extractComponentsEdgeLocations(e){const t=o(e),n=c(t.data,t.skipDeduplicate,t.indices,t.indicesLength),i=l(n,m,u),a=[];return{result:r(i.regular.instancesData,a),transferList:a}}async extractEdgeLocations(e){const t=o(e),n=c(t.data,t.skipDeduplicate,t.indices,t.indicesLength),i=l(n,D,u),a=[];return{result:r(i.regular.instancesData,a),transferList:a}}}function o(s){return{data:g.createView(s.dataBuffer),indices:s.indicesType==="Uint32Array"?new Uint32Array(s.indices):s.indicesType==="Uint16Array"?new Uint16Array(s.indices):s.indices,indicesLength:s.indicesLength,writerSettings:s.writerSettings,skipDeduplicate:s.skipDeduplicate}}function h(s,e){return e.push(s.regular.lodInfo.lengths.buffer),e.push(s.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:r(s.regular.instancesData,e),lodInfo:{lengths:s.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:r(s.silhouette.instancesData,e),lodInfo:{lengths:s.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:s.averageEdgeLength}}class L{allocate(e){return f.createBuffer(e)}trim(e,t){return e.slice(0,t)}write(e,t,n){e.position0.setVec(t,n.position0),e.position1.setVec(t,n.position1)}}class w{allocate(e){return p.createBuffer(e)}trim(e,t){return e.slice(0,t)}write(e,t,n){e.position0.setVec(t,n.position0),e.position1.setVec(t,n.position1),e.componentIndex.set(t,n.componentIndex)}}const D=new L,m=new w,u={allocate:()=>null,write:()=>{},trim:()=>null};export{I as default}; diff --git a/dist/assets/EditGeometryOperations-TPE5Wzab.js b/dist/assets/EditGeometryOperations-TPE5Wzab.js new file mode 100644 index 0000000..99f1ed0 --- /dev/null +++ b/dist/assets/EditGeometryOperations-TPE5Wzab.js @@ -0,0 +1 @@ +import{a9 as V,oW as Z,T as E,oV as ce,rt as te,ru as le,rv as de,as as T,aa as c,rw as pe,b1 as R,hP as ue,az as ie,qa as _e,aE as w,pU as L,ou as ge,bi as S,rx as fe,i1 as me,b5 as xe,ry as ye,e4 as ve,O as Ve,K as se,N as Ee,l as Te,fo as $,qM as De,aT as B,rz as H,rA as we,ax as b,bb as q,aG as G,aF as A,at as D,aV as Pe,o1 as C,rB as Me,rC as F,a0 as j,hJ as Ae,pL as Ce,au as Ze,rD as W,rE as I,rF as Re,cQ as X,pl as $e,rG as ze,oU as Se,pK as K,a2 as be}from"./index-J0iiHjMT.js";var l;(function(n){n[n.Z=0]="Z",n[n.M=1]="M"})(l||(l={}));class Ge{constructor(e){this.spatialReference=e}createVector(){return this._tag(V())}pointToVector(e){return this._tag(Z(e.x,e.y))}arrayToVector(e){return this._tag(Z(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new E){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new E){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,s){return ce(s,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return te(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(le(e))}copy(e,t){return de(t,e)}fromXYZ(e){return this._tag(Z(e[0],e[1]))}toXYZ(e,t=c()){return T(t,e[0],e[1],0)}pointToXYZ(e,t=c()){return T(t,e.x,e.y,0)}equals(e,t){return pe(e,t)}_tag(e){return e}}class Q{constructor(e,t){this._valueType=e,this.spatialReference=t}createVector(){return this._tag(c())}pointToVector(e){return this._tag(R(e.x,e.y,this._valueType===l.Z?e.z:e.m))}arrayToVector(e){return this._tag(R(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return this._valueType===l.Z?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,t=new E){return t.x=e[0],t.y=e[1],t.z=this._valueType===l.Z?e[2]:void 0,t.m=this._valueType===l.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new E){return t.x=e[0],t.y=e[1],t.z=this._valueType===l.Z?e[2]:void 0,t.m=this._valueType===l.M?e[2]:void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){const i=this._valueType===l.Z,s=this._valueType===l.M;return t.x=e[0],t.y=e[1],t.z=i?e[2]:void 0,t.m=s?e[2]:void 0,t.hasZ=i,t.hasM=s,t.spatialReference=this.spatialReference,t}lerp(e,t,i,s){return ue(s,e,t,i)}addDelta(e,t,i,s){e[0]+=t,e[1]+=i,this._valueType===l.Z&&(e[2]+=s)}distance(e,t){return this._valueType===l.Z?ie(e,t):te(e,t)}getZ(e,t=void 0){return this._valueType===l.Z?e[2]:t}hasZ(){return this._valueType===l.Z}getM(e,t=void 0){return this._valueType===l.M?e[2]:t}hasM(){return this._valueType===l.M}clone(e){return this._tag(_e(e))}copy(e,t){return w(t,e)}fromXYZ(e,t=0,i=0){return this._tag(R(e[0],e[1],this._valueType===l.Z?e.length>2?e[2]:t:i))}toXYZ(e,t=c()){return T(t,e[0],e[1],this._valueType===l.Z?e[2]:0)}pointToXYZ(e,t=c()){return T(t,e.x,e.y,this._valueType===l.Z?e.z??0:0)}equals(e,t){return L(e,t)}_tag(e){return e}}class Ie{constructor(e){this.spatialReference=e}createVector(){return this._tag(ge())}pointToVector(e){return this._tag(S(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(S(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new E){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new E){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"}){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,s){return fe(s,e,t,i)}addDelta(e,t,i,s){e[0]+=t,e[1]+=i,e[2]+=s}distance(e,t){return ie(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(me(e))}copy(e,t){return xe(t,e)}fromXYZ(e,t=0,i=0){return this._tag(S(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=c()){return T(t,e[0],e[1],e[2])}pointToXYZ(e,t=c()){return T(t,e.x,e.y,e.z??0)}equals(e,t){return ye(e,t)}_tag(e){return e}}function Xe(n,e,t){return n&&e?new Ie(t):e?new Q(l.M,t):n?new Q(l.Z,t):new Ge(t)}function Ue(n,e){if(!e.supported)return;let t=1/0,i=-1/0;const s=e.upperBoundX-e.lowerBoundX;n.forEach(o=>{let a=o.pos[0];for(;ae.upperBoundX;)a-=s;t=Math.min(t,a),i=Math.max(i,a),o.pos[0]=a});const r=i-t;s-r{o.pos[0]<0&&(o.pos[0]+=s)})}function Le(n,e){const t=ve(n);return e===Ve.Global&&t?{supported:!0,lowerBoundX:t.valid[0],upperBoundX:t.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}class P{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}}let x=class{constructor(e,t,i){this.component=e,this.leftVertex=t,this.rightVertex=i,this.type="edge",t.rightEdge=this,i.leftEdge=this}};class U{constructor(e,t){this._spatialReference=e,this._viewingMode=t,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||Ue(this.vertices,Le(this._spatialReference,this._viewingMode))}updateVertexIndex(e,t){if(this.vertices.length===0)return;const i=this.vertices[0];let s=null,r=e,o=t;do s=r,s.index=o++,r=s.rightEdge?s.rightEdge.rightVertex:null;while(r!=null&&r!==i);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.length===0?null:this.vertices[0]}getLastVertex(){return this.vertices.length===0?null:this.vertices[this.vertices.length-1]}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(e,t){const i=this.vertices[e];this.vertices[e]=this.vertices[t],this.vertices[t]=i}iterateVertices(e){if(this.vertices.length===0)return;const t=this.vertices[0];let i=t;do e(i,i.index),i=i.rightEdge!=null?i.rightEdge.rightVertex:null;while(i!==t&&i!=null)}}class Y extends se{constructor(e,t){super(),this.type=e,this.coordinateHelper=t,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon()}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}notifyChanges(e){this._dirty=!0,this.emit("change",e)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const e=[],t=this.coordinateHelper.vectorToArray;for(const i of this.components){if(i.vertices.length<1)continue;const s=[];let r=i.vertices.find(a=>a.leftEdge==null);const o=r;do s.push(t(r.pos)),r=r.rightEdge?r.rightEdge.rightVertex:null;while(r&&r!==o);e.push(s)}return new Ee({paths:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[],t=this.coordinateHelper.vectorToArray;for(const i of this.components){if(i.vertices.length<1)continue;const s=[],r=i.vertices[0];let o=r;const a=o;do s.push(t(o.pos)),o=o.rightEdge!=null?o.rightEdge.rightVertex:null;while(o&&o!==a);i.isClosed()&&s.push(t(r.pos)),e.push(s)}return new Te({rings:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(e,t){const i=e.spatialReference,s=Xe(e.hasZ,e.hasM,i),r=new Y(e.type,s);switch(e.type){case"polygon":{const o=e.rings;for(let a=0;a2&&$(p[0],p[p.length-1]),v=y?p.length-1:p.length;for(let d=0;dthis.operation.apply(e)),this._editGeometry.components.forEach(e=>e.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(e=>this.operation.undo(e)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(e){if(this._undone||e._vertices.length!==this._vertices.length)return!1;for(let t=0;tthis.operation.accumulate(t,e.operation)),this.operation.accumulateParams(e.operation),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var g;(function(n){n[n.CUMULATIVE=0]="CUMULATIVE",n[n.REPLACE=1]="REPLACE"})(g||(g={}));let Ne=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const s=this._removeVertex(i);s!=null&&t.push(s)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){var e;(e=this.removedVertices)==null||e.forEach(t=>{this._undoRemoveVertex(t)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},s=e.leftEdge,r=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),s&&(t.edges.splice(t.edges.indexOf(s),1),s.leftVertex.rightEdge=null),r&&(t.edges.splice(t.edges.indexOf(r),1),r.rightVertex.leftEdge=null),e.index===0&&r&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(r.rightVertex),0),s&&r&&(i.createdEdge=new x(t,s.leftVertex,r.rightVertex),t.edges.push(i.createdEdge)),r&&t.updateVertexIndex(r.rightVertex,r.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,s=t.leftEdge,r=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),s&&(i.edges.push(s),s.leftVertex.rightEdge=s),r&&(i.edges.push(r),r.rightVertex.leftEdge=r),i.updateVertexIndex(t,t.index)}};class ke{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,s=t.leftVertex,r=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new P(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new x(i,s,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),s.rightEdge=this._left,this._right==null&&(this._right=new x(i,this.createdVertex,r)),i.edges.push(this._right),r.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,s.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,s=this.createdVertex.rightEdge,r=i==null?void 0:i.leftVertex,o=s==null?void 0:s.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),r&&(r.rightEdge=e),o&&(o.leftEdge=e),r&&t.updateVertexIndex(r,r.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}}let Be=class ne{constructor(e,t,i){this._editGeometry=e,this._vertex=t,this._pos=i}apply(){const e=this._originalPosition==null;e&&(this._originalPosition=this._vertex.pos),this._apply(e?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(e){return e instanceof ne&&e._vertex===this._vertex&&(this._pos=e._pos,this._apply("apply"),!0)}_apply(e){this._vertex.pos=this._pos,this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:e,updatedVertices:[this._vertex]})}};class He{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new x(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(De(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}}let qe=class oe{constructor(e,t,i,s){this._helper=e,this.dx=t,this.dy=i,this.dz=s}_move(e,t,i,s){this._helper.addDelta(e.pos,t,i,s)}apply(e){this._move(e,this.dx,this.dy,this.dz)}undo(e){this._move(e,-this.dx,-this.dy,-this.dz)}canAccumulate(e){return e instanceof oe}accumulate(e,t){this._move(e,t.dx,t.dy,t.dz)}accumulateParams(e){this.dx+=e.dx,this.dy+=e.dy,this.dz+=e.dz}};class z{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(e,t,i,s=0,r=M.IMMEDIATE){this._helper=e,this._planeType=t,this._edge=i,this.distance=s,this._plane=B(),this._offsetPlane=B(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,r===M.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){var r,o,a,p;const e=this._toXYZ(this._edge.leftVertex.pos),t=this._toXYZ((o=(r=this._edge.leftVertex.leftEdge)==null?void 0:r.leftVertex)==null?void 0:o.pos),i=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ((p=(a=this._edge.rightVertex.rightEdge)==null?void 0:a.rightVertex)==null?void 0:p.pos);this._edgeDirection=H(c(),e,i),this._left=this._computeNeighbor(e,t,this._edgeDirection),this._right=this._computeNeighbor(i,s,this._edgeDirection)}_toXYZ(e){return e!=null?this._helper.toXYZ(e):null}_pointToXYZ(e){return this._toXYZ(this._helper.pointToVector(e))}_computeNeighbor(e,t,i){if(t==null)return{start:e,end:t,direction:R(-i[1],i[0],0),isOriginalDirection:!0};const s=H(c(),e,t),r=!this._passesBisectingAngleThreshold(s,i);return{start:e,end:t,direction:r?this._bisectVectorsPerpendicular(i,s):s,isOriginalDirection:!r}}_passesBisectingAngleThreshold(e,t){const i=Math.abs(we(t,e));return i>=J&&i<=Math.PI-J}_bisectVectorsPerpendicular(e,t){const i=b(e,t)<0?e:q(c(),e),s=Math.abs(b(i,t));if(!(s1-ee))return this._bisectDirection(i,t);const r=G(c(),i,[0,0,1]);return A(r,r)}_bisectDirection(e,t){const i=D(c(),e,t);return A(i,i)}_initializePlane(){const e=this._computeNormalDirection(this._left),t=this._computeNormalDirection(this._right);b(e,t)<0&&q(t,t),Pe(this._left.start,this._bisectDirection(e,t),this._plane)}_computeNormalDirection(e){const t=G(c(),e.direction,this._edgeDirection);A(t,t);const i=G(c(),this._edgeDirection,t);return this._planeType===O.XY&&(i[2]=0),A(i,i)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(C(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(C(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(e){e<=0&&(this._minDistance=Math.max(this._minDistance,e)),e>=0&&(this._maxDistance=Math.min(this._maxDistance,e))}_updateIntersectDistanceConstraint(e){const t=X(e),i=this._edgeDirection,s=D(c(),this._left.start,this._left.direction),r=D(c(),this._right.start,this._right.direction),o=this._pointInBasis2D(V(),t,i,this._left.start),a=this._pointInBasis2D(V(),t,i,s),p=this._pointInBasis2D(V(),t,i,this._right.start),h=this._pointInBasis2D(V(),t,i,r),[y]=Me({start:a,end:o,type:F.LINE},{start:h,end:p,type:F.LINE});if(!y)return;const v=j(V(),o,a);Ae(v,v);const u=j(V(),y,a),d=Ce(v,u),_=D(c(),s,Ze(c(),this._left.direction,-d)),f=C(e,_);this._updateDistanceConstraint(f)}_pointInBasis2D(e,t,i,s){return e[0]=W(t,s),e[1]=W(i,s),e}_offset(e,t){Number.isFinite(this._minDistance)&&(t=Math.max(this._minDistance,t)),Number.isFinite(this._maxDistance)&&(t=Math.min(this._maxDistance,t)),I(this._offsetPlane,this._plane),this._offsetPlane[3]-=t;const i=(r,o,a)=>o!=null&&ze(this._offsetPlane,r,D(c(),r,o),a),s=c();(e===this._edge.leftVertex?i(this._left.start,this._left.direction,s):i(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(e.pos)),e.pos)}selectArrowFromStartPoint(e){this._selectedArrow=Re(this.plane,this._pointToXYZ(e))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(e){return C(this.plane,this._pointToXYZ(e))}apply(e){this._offset(e,this.distance)}undo(e){this._offset(e,0)}canAccumulate(e){return e instanceof z&&this._edge.leftVertex.index===e._edge.leftVertex.index&&this._edge.rightVertex.index===e._edge.rightVertex.index&&this._edge.component===e._edge.component&&this._maybeEqualsVec3(this._left.direction,e._left.direction)&&this._maybeEqualsVec3(this._right.direction,e._right.direction)&&L(X(this._plane),X(e._plane))}accumulate(e,t){const i=this._plane[3]-t._plane[3]+t.distance;this._offset(e,i)}accumulateParams(e){const t=e.distance-e._plane[3];this.distance=t+this._plane[3]}clone(){const e=new z(this._helper,this._planeType,this._edge,this.distance,M.DEFERRED);return I(e._plane,this._plane),I(e._offsetPlane,this._offsetPlane),e._maxDistance=this._maxDistance,e._minDistance=this._minDistance,e._left=this._cloneNeighbor(this._left),e._right=this._cloneNeighbor(this._right),e._edgeDirection=w(c(),this._edgeDirection),e}_maybeEqualsVec3(e,t){return e==null&&t==null||e!=null&&t!=null&&L(e,t)}_cloneNeighbor({start:e,end:t,direction:i,isOriginalDirection:s}){return{start:w(c(),e),end:t!=null?w(c(),t):null,direction:w(c(),i),isOriginalDirection:s}}}const J=$e(15),ee=.001;var O,M;(function(n){n[n.XYZ=0]="XYZ",n[n.XY=1]="XY"})(O||(O={})),function(n){n[n.IMMEDIATE=0]="IMMEDIATE",n[n.DEFERRED=1]="DEFERRED"}(M||(M={}));class N{constructor(e,t,i=g.CUMULATIVE){this.origin=e,this.angle=t,this._accumulationType=i}_rotate(e,t){Se(e.pos,e.pos,this.origin,t)}apply(e){this._rotate(e,this.angle)}undo(e){this._rotate(e,-this.angle)}canAccumulate(e){return e instanceof N&&$(this.origin,e.origin)}accumulate(e,t){const i=t._accumulationType===g.REPLACE;this._rotate(e,i?t.angle-this.angle:t.angle)}accumulateParams(e){const t=e._accumulationType===g.REPLACE;this.angle=t?e.angle:this.angle+e.angle}}class k{constructor(e,t,i,s,r=g.CUMULATIVE){this.origin=e,this.axis1=t,this.factor1=i,this.factor2=s,this._accumulationType=r,this.axis2=Z(t[1],-t[0])}_scale(e,t,i){K(e.pos,e.pos,this.origin,this.axis1,t),K(e.pos,e.pos,this.origin,this.axis2,i)}apply(e){this._scale(e,this.factor1,this.factor2)}undo(e){this._scale(e,1/this.factor1,1/this.factor2)}canAccumulate(e){return e instanceof k&&$(this.origin,e.origin)&&$(this.axis1,e.axis1)}accumulate(e,t){t._accumulationType===g.REPLACE?this._scale(e,t.factor1/this.factor1,t.factor2/this.factor2):this._scale(e,t.factor1,t.factor2)}accumulateParams(e){const t=e._accumulationType===g.REPLACE;this.factor1=t?e.factor1:this.factor1*e.factor1,this.factor2=t?e.factor2:this.factor2*e.factor2}}class Fe{constructor(){this._operations=[],this._closed=!1}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}}class ae extends se{constructor(e){super(),this.data=e,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",t=>{t.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:t.addedVertices,operation:t.operation}),t.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:t.removedVertices,operation:t.operation}),t.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:t.updatedVertices,operation:t.operation})})}destroy(){this._listener.remove()}splitEdge(e,t){return this._apply(new ke(this.data,e,t))}updateVertices(e,t,i=m.ACCUMULATE_STEPS){return this._apply(new Ye(this.data,e,t),i)}moveVertices(e,t,i,s,r=m.ACCUMULATE_STEPS){return this.updateVertices(e,new qe(this.data.coordinateHelper,t,i,s),r)}scaleVertices(e,t,i,s,r,o=m.ACCUMULATE_STEPS,a=g.CUMULATIVE){return this.updateVertices(e,new k(t,i,s,r,a),o)}rotateVertices(e,t,i,s=m.ACCUMULATE_STEPS,r=g.CUMULATIVE){return this.updateVertices(e,new N(t,i,r),s)}removeVertices(e){return this._apply(new Ne(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return this.data.components.length===0?null:this._apply(new Oe(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new Be(this.data,e,t))}offsetEdge(e,t,i,s=m.ACCUMULATE_STEPS){return this.updateVertices([t.leftVertex,t.rightVertex],new z(this.data.coordinateHelper,e,t,i),s)}closeComponent(e){return this.data.components.includes(e)?this._apply(new He(this.data,e)):null}canRemoveVertex(e){return e.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new Fe;return this._apply(e),be(()=>e.close())}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=m.ACCUMULATE_STEPS){return t!==m.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}static fromGeometry(e,t){return new ae(Y.fromGeometry(e,t))}}export{m as E,z as N,ae as V,qe as a,k as c,g as e,U as l,Y as p,N as s,Ye as t,Xe as w,O as y}; diff --git a/dist/assets/ElevationLayerView3D-aDJhr4Zv.js b/dist/assets/ElevationLayerView3D-aDJhr4Zv.js new file mode 100644 index 0000000..63dba05 --- /dev/null +++ b/dist/assets/ElevationLayerView3D-aDJhr4Zv.js @@ -0,0 +1 @@ +import{E as c,e as i,y,c as h}from"./index-J0iiHjMT.js";import{n as u}from"./LayerView3D-iOx2MD1g.js";import{o as v}from"./TiledLayerView3D-Av58zTxG.js";import{u as f}from"./LayerView-efDufa6j.js";let e=class extends v(u(f)){constructor(){super(...arguments),this.type="elevation-3d"}get tileInfo(){return this.layer.tileInfo}initialize(){var r,s,l,a,n;const t=(s=(r=this.view)==null?void 0:r.map)==null?void 0:s.allLayers,d=t&&t.includes(this.layer),o=(n=(a=(l=this.view)==null?void 0:l.map)==null?void 0:a.ground)==null?void 0:n.layers,m=o&&o.includes(this.layer);if(d&&!m){const p=new c("layerview:elevation-layer-only","3D elevation layer '"+this.layer.id+"' can only be added to layers in map.ground");this.addResolvingPromise(Promise.reject(p))}this._addTilingSchemeMatchPromise()}};i([y()],e.prototype,"layer",void 0),i([y()],e.prototype,"tileInfo",null),e=i([h("esri.views.3d.layers.ElevationLayerView3D")],e);const x=e;export{x as default}; diff --git a/dist/assets/ElevationProfileView2D-KdZmS2un.js b/dist/assets/ElevationProfileView2D-KdZmS2un.js new file mode 100644 index 0000000..39ca514 --- /dev/null +++ b/dist/assets/ElevationProfileView2D-KdZmS2un.js @@ -0,0 +1 @@ +import{a as r,ak as d,b as p,s as u,km as g,kn as _,d as l,A as o,n as a,ko as v}from"./index-J0iiHjMT.js";import{a as m}from"./HoveredPoints-BD2phuV6.js";import"./AnchorElementViewModel-SDYg-P9c.js";class c{constructor(t){this._params=t,this._highlightTask=null,this._highlightHandle=null}destroy(){this.remove()}remove(){this._highlightTask=r(this._highlightTask),this._highlightHandle=d(this._highlightHandle)}update(t){if(this.remove(),t==null||!w(t))return;const i=t.layer;this._highlightTask=p(async e=>{const h=await this._params.view.whenLayerView(i);u(e);const n=g(h)?h:null;n&&(this._highlightHandle=n.highlight(t))})}}function w(s){return s.geometry!=null&&s.geometry.type==="polyline"}class P{constructor(t,i){this._handles=new _,this._inputRepresentation=new c({view:t}),this._hoveredPoints=new m({view:t}),this._handles.add([l(()=>i.viewModel.hoveredPoints,e=>this._hoveredPoints.update(e),o),l(()=>{const{state:e,highlightEnabled:h,viewModel:n}=i;return{input:n.input,state:e,highlightEnabled:h}},e=>this._updateInputRepresentation(e),o)])}destroy(){this._handles=a(this._handles),this._inputRepresentation=a(this._inputRepresentation),this._hoveredPoints=a(this._hoveredPoints)}_updateInputRepresentation({input:t,state:i,highlightEnabled:e}){i===v.Selected&&e?this._inputRepresentation.update(t):this._inputRepresentation.remove()}}export{P as ElevationProfileView2D}; diff --git a/dist/assets/ElevationProfileView3D-bd56oGje.js b/dist/assets/ElevationProfileView3D-bd56oGje.js new file mode 100644 index 0000000..4428e12 --- /dev/null +++ b/dist/assets/ElevationProfileView3D-bd56oGje.js @@ -0,0 +1 @@ +import{a as y,ak as _,b as $,s as E,km as D,aP as R,b2 as b,d as h,fw as H,fv as L,e as m,y as v,c as P,p as k,ma as T,A as d,i1 as z,ab as V,N as G,gL as O,kn as S,n as c,ko as f}from"./index-J0iiHjMT.js";import{a as I}from"./HoveredPoints-BD2phuV6.js";import{z as M,w,e as x}from"./GraphicState-2UcU5UAX.js";import"./AnchorElementViewModel-SDYg-P9c.js";import"./ExtendedLineVisualElement-YbjiXiBG.js";import"./vec4f32-NvfHy9q7.js";import"./EngineVisualElement-eZNKTKsI.js";import"./VisualElement-kjYXz27t.js";import"./Laserlines.glsl-nvjcCsAw.js";let A=class{constructor(e){this._params=e,this._highlightTask=null,this._highlightHandle=null,this._visualElementHandle=null,this._settings=new M({getTheme:()=>this._params.view.effectiveTheme})}destroy(){this.remove()}remove(){this._highlightTask=y(this._highlightTask),this._highlightHandle=_(this._highlightHandle),this._visualElementHandle=_(this._visualElementHandle)}showHighlight(e){if(this.remove(),e==null||!g(e))return;const i=e.layer;this._highlightTask=$(async t=>{const n=await this._params.view.whenLayerView(i);E(t),D(n)&&(this._highlightHandle=n.highlight(e))})}showReshaping(e){if(this.remove(),e==null)return;const i=this._params.view,t=new w({view:i,geometry:g(e)?e.geometry:null,attached:!1,elevationInfo:R(e),renderOccluded:b.OccludeAndTransparentStencil,isDecoration:!0}),n=new x({graphic:e}),s=[h(()=>n.isDraped,o=>{t.isDraped=o}),n.on("changed",()=>{t.geometry=g(e)?e.geometry:null}),i.trackGraphicState(n),i.maskOccludee(e),H(t)];this._settings.visualElements.lineGraphics.outline.apply(t),t.attached=!0,this._visualElementHandle=L(s)}};function g(a){return a.geometry!=null&&a.geometry.type==="polyline"}const C=100;let p=class extends k{constructor(a){super(a),this._chartData=null,this._visualElements=[]}initialize(){const a=T(e=>{this._update(e)},C);this.addHandles([h(()=>({spatialReference:this.view.spatialReference,chartData:this._chartData}),a,d),a])}destroy(){this._destroyVisualElements()}remove(){this._destroyVisualElements()}update(a){this._chartData=a}_update(a){const{chartData:e}=a;if(e==null)return this.remove();if(!e.refined)return;const i=this._visualElements,t=e.lines.filter(l=>l.viewVisualizationEnabled),n=t.length;for(;i.length>n;)i.pop().destroy();const s=O().profileLinesStyle3D;for(;i.lengtha.destroy()),this._visualElements.length=0}};m([v()],p.prototype,"view",void 0),m([v()],p.prototype,"_chartData",void 0),p=m([P("esri.widgets.ElevationProfile.support.ProfileLines3D")],p);class Q{constructor(e,i){this._handles=new S,this._inputRepresentation=new A({view:e}),this._hoveredPoints=new I({view:e}),this._profileLines=new p({view:e}),this._handles.add([h(()=>i.viewModel.hoveredPoints,t=>this._hoveredPoints.update(t),d),h(()=>{const{state:t,editable:n,highlightEnabled:s,viewModel:o}=i,l=o.input;return l&&(l.commitProperty("geometry"),l.commitProperty("layer")),{input:l,state:t,editable:n,highlightEnabled:s}},t=>this._updateInputRepresentation(t),d),h(()=>i.viewModel.chartData,t=>this._profileLines.update(t),d),h(()=>{var t;return(t=i.viewModel.input)==null?void 0:t.geometry},()=>{this._profileLines.remove()},d)])}destroy(){this._handles=c(this._handles),this._inputRepresentation=c(this._inputRepresentation),this._hoveredPoints=c(this._hoveredPoints),this._profileLines=c(this._profileLines)}_updateInputRepresentation({input:e,state:i,editable:t,highlightEnabled:n}){const s=this._inputRepresentation;if(!n)return s.remove();i===f.Selected?s.showHighlight(e):i!==f.Created||t?s.remove():s.showReshaping(e)}}export{Q as ElevationProfileView3D}; diff --git a/dist/assets/ElevationSamplerWorker-_kiMcA-u.js b/dist/assets/ElevationSamplerWorker-_kiMcA-u.js new file mode 100644 index 0000000..85e9e06 --- /dev/null +++ b/dist/assets/ElevationSamplerWorker-_kiMcA-u.js @@ -0,0 +1 @@ +import{g9 as p,dJ as h}from"./index-J0iiHjMT.js";import{s as l}from"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";class f{async createIndex(t,n){var c;const r=new Array;if(!((c=t.vertexAttributes)!=null&&c.position))return new l;const a=this._createMeshData(t),o=n!=null?await n.invoke("createIndexThread",a,{transferList:r}):this.createIndexThread(a).result;return this._createPooledRBush().fromJSON(o)}createIndexThread(t){const n=new Float64Array(t.position),r=this._createPooledRBush();return t.components?this._createIndexComponentsThread(r,n,t.components.map(a=>new Uint32Array(a))):this._createIndexAllThread(r,n)}_createIndexAllThread(t,n){const r=new Array(n.length/9);let a=0;for(let o=0;o!r.faces)?{position:n}:{position:n,components:t.components.map(r=>r.faces)}}_createPooledRBush(){return new l(9,h("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function m(e,t,n,r){return{minX:Math.min(e[t],e[n],e[r]),maxX:Math.max(e[t],e[n],e[r]),minY:Math.min(e[t+1],e[n+1],e[r+1]),maxY:Math.max(e[t+1],e[n+1],e[r+1]),p0:[e[t],e[t+1],e[t+2]],p1:[e[n],e[n+1],e[n+2]],p2:[e[r],e[r+1],e[r+2]]}}export{f as default}; diff --git a/dist/assets/EngineVisualElement-eZNKTKsI.js b/dist/assets/EngineVisualElement-eZNKTKsI.js new file mode 100644 index 0000000..f6e04bd --- /dev/null +++ b/dist/assets/EngineVisualElement-eZNKTKsI.js @@ -0,0 +1 @@ +import{m,c3 as v,G as y,hQ as p,e as h,y as d,c as b,p as G,fu as l,kW as t,bD as g,bE as w,d as D,P as x}from"./index-J0iiHjMT.js";import{t as F}from"./VisualElement-kjYXz27t.js";class f{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1,this._renderGroup=p.Outline}destroy(){this._destroyResources()}get resources(){return this._resources!=null?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncGeometriesToRenderer())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}get renderGroup(){return this._renderGroup}set renderGroup(e){var r;this._renderGroup=e;const s=(r=this._resources)==null?void 0:r.layerView;s&&(s.renderGroup=e)}recreate(){this.attached&&this._createResources()}recreateGeometry(){this._resourceFactory.recreateGeometry?this._resources!=null&&(this._ensureRenderGeometriesRemoved(),this._resourceFactory.recreateGeometry(this._resources.external),this._syncGeometriesToRenderer()):this.recreate()}_createOrDestroyResources(){this._attached?this._resources==null&&this._createResources():this._destroyResources()}_createResources(){var i;this._destroyResources();const e=this._resourceFactory.createResources(),s=new o({view:this._resourceFactory.view,renderGroup:this._renderGroup}),r=(i=this._resourceFactory.view.basemapTerrain)==null?void 0:i.overlayManager;this._resources={layerView:new o({view:this._resourceFactory.view,renderGroup:this._renderGroup}),external:e,geometriesAdded:!1},r&&(this._resources.drapeSourceRenderer=r.registerGeometryDrapeSource(s)),this._syncGeometriesToRenderer()}_destroyResources(){var s;if(this._resources==null)return;this._ensureRenderGeometriesRemoved();const e=(s=this._resourceFactory.view.basemapTerrain)==null?void 0:s.overlayManager;e&&e.unregisterDrapeSource(this._resources.layerView),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncGeometriesToRenderer(){this._visible?this._ensureRenderGeometriesAdded():this._ensureRenderGeometriesRemoved()}_ensureRenderGeometriesRemoved(){var e;((e=this._resources)==null?void 0:e.drapeSourceRenderer)!=null&&this._resources.geometriesAdded&&(this._resources.drapeSourceRenderer.removeGeometries(this._resources.external.geometries,l.UPDATE),this._resources.geometriesAdded=!1)}_ensureRenderGeometriesAdded(){var e;((e=this._resources)==null?void 0:e.drapeSourceRenderer)!=null&&(this._resources.geometriesAdded||(this._resources.drapeSourceRenderer.addGeometries(this._resources.external.geometries,l.UPDATE),this._resources.geometriesAdded=!0))}}let o=class extends m(G){constructor(a){super(a),this.drapeSourceType=v.Features,this.updatePolicy=y.SYNC,this.renderGroup=p.Outline}};h([d({constructOnly:!0})],o.prototype,"view",void 0),h([d({readOnly:!0})],o.prototype,"drapeSourceType",void 0),h([d()],o.prototype,"renderGroup",void 0),o=h([b("DrapedVisualElementLayerView")],o);class j{constructor(e){this._resourceFactory=e,this._resources=null,this._visible=!0,this._attached=!1}destroy(){this._destroyResources()}get object(){return this._resources!=null?this._resources.object:null}get resources(){return this._resources!=null?this._resources.external:null}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this._syncVisible())}get attached(){return this._attached}set attached(e){e!==this._attached&&(this._attached=e,this._createOrDestroyResources())}recreate(){this.attached&&this._createResources()}recreateGeometry(){if(!this._resourceFactory.recreateGeometry)return void this.recreate();const e=this._resourceFactory.view._stage;if(this._resources==null||!e)return;const s=this._resources.object;this._resources.external.forEach(r=>{r.type!==t.Mesh&&r.type!==t.Line&&r.type!==t.Point||e.remove(r)}),s.removeAllGeometries(),this._resourceFactory.recreateGeometry(this._resources.external,s,this._resources.layer),this._resources.external.forEach(r=>{r.type!==t.Mesh&&r.type!==t.Line&&r.type!==t.Point||e.add(r)})}_createOrDestroyResources(){this._attached?this._resources||this._createResources():this._destroyResources()}_createResources(){this._destroyResources();const e=this._resourceFactory,s=e.view,r=s._stage;if(!r)return;const i=new g(r,{pickable:!1,updatePolicy:y.SYNC}),u=new w({castShadow:!1}),n=e.createResources(u,i);n.forEach(c=>{r.add(c),c.type===t.Texture&&c.load(r.renderView.renderingContext)}),r.add(u),i.add(u);const _=e.cameraChanged,R=_?D(()=>s.state.camera,c=>_(c),x):null;this._resources={layer:i,object:u,external:n,cameraHandle:R},this._syncVisible()}_destroyResources(){var s;if(this._resources==null)return;const e=this._resourceFactory.view._stage;e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this._resources.external.forEach(r=>{e.remove(r),r.type===t.Texture&&r.unload()})),this._resources.object.dispose(),(s=this._resources.cameraHandle)==null||s.remove(),this._resourceFactory.destroyResources(this._resources.external),this._resources=null}_syncVisible(){this._resources!=null&&(this._resources.object.visible=this._visible)}}class V extends F{constructor(e){super(e),this._isDraped=!1,this.object3dResources=new j(this.createObject3DResourceFactory(e.view)),this.drapedResources=new f(this.createDrapedResourceFactory(e.view)),this.isDraped=e.isDraped??!1}get isDraped(){return this._isDraped}set isDraped(e){e!==this._isDraped&&(this._isDraped=e,this.object3dResources.attached=this.attached&&!e,this.drapedResources.attached=this.attached&&e)}get renderGroup(){return this.drapedResources.renderGroup}set renderGroup(e){this.drapedResources.renderGroup=e}createResources(){this.object3dResources.attached=!this._isDraped,this.drapedResources.attached=this._isDraped}destroyResources(){this.object3dResources.attached=!1,this.drapedResources.attached=!1}recreate(){this.object3dResources.recreate(),this.drapedResources.recreate()}recreateGeometry(){this.object3dResources.recreateGeometry(),this.drapedResources.recreateGeometry()}destroy(){this.object3dResources.destroy(),this.drapedResources.destroy(),super.destroy()}updateVisibility(e){this.object3dResources.visible=e,this.drapedResources.visible=e}}export{V as t}; diff --git a/dist/assets/EventedSet-JGlFrfoR.js b/dist/assets/EventedSet-JGlFrfoR.js new file mode 100644 index 0000000..750b74e --- /dev/null +++ b/dist/assets/EventedSet-JGlFrfoR.js @@ -0,0 +1 @@ +import{K as h,fq as r,fr as i}from"./index-J0iiHjMT.js";class d extends h{constructor(){super(...arguments),this._set=new Set}clear(){if(this._set.size>0){const e=this.toArray();this._set.clear(),this.emit("after-changes",{type:r.REMOVE}),this.emit("change",{added:[],removed:e})}}get length(){return this._set.size}addMany(e){if(e.length!==0){for(const t of e)this._set.add(t);this.emit("after-changes",{type:r.ADD}),this.emit("change",{added:e,removed:[]})}}remove(e){this._set.delete(e)&&(this.emit("after-changes",{type:r.REMOVE}),this.emit("change",{added:[],removed:[e]}))}removeMany(e){const t=[];for(const s of e)this._set.delete(s)&&t.push(s);t.length>0&&(this.emit("after-changes",{type:r.REMOVE}),this.emit("change",{added:[],removed:t}))}toArray(){return[...this._set]}find(e){let t;return i(this._set,s=>!!e(s)&&(t=s,!0)),t}forEach(e){this._set.forEach(t=>e(t))}}export{d as r}; diff --git a/dist/assets/ExtendedLineVisualElement-YbjiXiBG.js b/dist/assets/ExtendedLineVisualElement-YbjiXiBG.js new file mode 100644 index 0000000..07f0dca --- /dev/null +++ b/dist/assets/ExtendedLineVisualElement-YbjiXiBG.js @@ -0,0 +1 @@ +import{a$ as C,b0 as P,aI as G,aa as o,b1 as S,b2 as u,aE as p,aU as T,b3 as f,aq as D,b4 as y,b5 as g,b6 as O,b7 as j,b8 as v,b9 as E,ba as M,bb as V,bc as I,bd as W,be as F,bf as m,bg as L,bh as _}from"./index-J0iiHjMT.js";import{r as w,t as N}from"./vec4f32-NvfHy9q7.js";import{t as $}from"./EngineVisualElement-eZNKTKsI.js";import{c as U}from"./Laserlines.glsl-nvjcCsAw.js";class B extends ${constructor(e){super(e),this._ray=G(),this._isWorldDown=!1,this._start=o(),this._end=S(1,0,0),this._width=1,this._color=w(1,0,1,1),this._polygonOffset=!1,this._writeDepthEnabled=!0,this._innerWidth=0,this._innerColor=w(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._stipplePreferContinuous=!0,this._falloff=0,this._extensionType=a.LINE,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=u.OccludeAndTransparent,this._fadedExtensions=x,this._laserline=new U({view:this.view,isDecoration:e.isDecoration}),this.applyProperties(e)}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:t=>this._createObject3DResources(t),destroyResources:t=>this._destroyExternalResources(t),recreateGeometry:(t,s)=>this._recreateObject3DGeometry(t,s),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:t=>this._destroyExternalResources(t),recreateGeometry:t=>this._recreateDrapedGeometry(t)}}updateVisibility(e){super.updateVisibility(e),this._laserline.visible=e}onAttachedChange(){this._laserline.attached=this._laserlineAttached}setStartEndFromWorldDownAtLocation(e){this._isWorldDown=!0,p(this._start,e),this.view.renderCoordsHelper.worldUpAtPosition(e,this._end),T(this._end,e,this._end),f(this._start,this._end,this._ray),this._updateGeometry()}get start(){return this._start}set start(e){this._isWorldDown=!1,D(this._start,e)||(p(this._start,e),f(this._start,this._end,this._ray),this._updateGeometry())}get end(){return this._end}set end(e){this._isWorldDown=!1,D(this._end,e)||(p(this._end,e),f(this._start,this._end,this._ray),this._updateGeometry())}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){y(e,this._color)||(g(this._color,e),this._updateMaterial())}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){e!==this._polygonOffset&&(this._polygonOffset=e,this._updateMaterial())}get writeDepthEnabled(){return this._writeDepthEnabled}set writeDepthEnabled(e){this._writeDepthEnabled!==e&&(this._writeDepthEnabled=e,this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){y(e,this._innerColor)||(g(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e!=null&&this._stippleOffColor!=null&&y(e,this._stippleOffColor)||(this._stippleOffColor=e!=null?N(e):null,this._updateMaterial())}get stipplePreferContinuous(){return this._stipplePreferContinuous}set stipplePreferContinuous(e){e!==this._stipplePreferContinuous&&(this._stipplePreferContinuous=e,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get extensionType(){return this._extensionType}set extensionType(e){e!==this._extensionType&&(this._extensionType=e,this.recreateGeometry())}get _laserlineAttached(){return this._laserlineEnabled&&this._laserlineStyle!=null&&this.attached&&!this.isDraped}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===u.OccludeAndTransparentStencil?u.OccludeAndTransparent:this._renderOccluded}get fadedExtensions(){return this._fadedExtensions}set fadedExtensions(e){this._fadedExtensions=e??x,this.recreateGeometry()}_updateMaterial(){var t,s;const{materialParameters:e}=this;(t=this.object3dResources.resources)==null||t.material.setParameters(e),(s=this.drapedResources.resources)==null||s.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:this._stipplePreferContinuous,innerWidth:this._innerWidth,innerColor:this._innerColor,falloff:this._falloff,hasPolygonOffset:this._polygonOffset,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration,writeDepth:this._writeDepthEnabled}}_createObject3DResources(e){const t=new O(this.materialParameters),s=new Array;return this._createObject3DGeometry(t,e,s),{material:t,geometries:s,forEach:r=>{r(t),s.forEach(r)}}}_destroyExternalResources(e){e.geometries=[]}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,s){const r=this._createGeometry(e);s.push(r),t.addGeometry(r),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new O(this.materialParameters);return{material:e,geometries:[this._createDrapedGeometry(e)]}}_recreateDrapedGeometry(e){e.geometries=[this._createDrapedGeometry(e.material)]}_createDrapedGeometry(e){const t=this._createGeometry(e);return this._updateVerticesDraped(t),new j(t)}_createGeometry(e){const t=this.extensionType===a.FADED,s=t?[o(),o(),o(),o()]:[o(),o()];return v(e,s,null,t?[1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0]:null)}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this._lineSegment;this._updateVertexAttributesObject3D(e,t),this._laserline.intersectsLine=t}_updateVerticesDraped(e){this._updateVertexAttributesDraped(e,this._lineSegment)}get _lineSegment(){return this._extensionType===a.FADED?this._updateLineSegmentFinite(A):this._updateLineSegmentInfinite(this._extensionType,A)}_updateLineSegmentFinite(e){return E(this._start,this._end,e)}_updateLineSegmentInfinite(e,t){const s=this.view.state.camera;switch(M(this._ray,l),e){case a.LINE:l.c0=-Number.MAX_VALUE;break;case a.RAY:case a.GROUND_RAY:{const i=this._ray.origin,c=this.view.elevationProvider.getElevation(i[0],i[1],i[2],this.view.renderCoordsHelper.spatialReference,"ground")??0,b=this.view.renderCoordsHelper.getAltitude(i);this._isWorldDown&&be.equals(t))}isOnService(r){return this.parts.every(e=>e.isOnService(r))}makeHash(){let r="";for(const e of this.parts)r+=e.partHash;return r}async toBlob(r){const{parts:e}=this;if(e.length===1)return e[0].toBlob(r);const t=await Promise.all(e.map(a=>a.toBlob(r)));return p(r),new Blob(t)}}class H{constructor(r,e){this.partUrl=r,this.partHash=e}equals(r){return this===r||this.partUrl===r.partUrl&&this.partHash===r.partHash}isOnService(r){return this.partUrl.startsWith(`${r.path}/assets/`)}async toBlob(r){const{data:e}=await g(this.partUrl,{responseType:"blob"});return p(r),e}}function M(s){return $(s==null?void 0:s.source)}function u(s){return Array.isArray(s)?s.every(r=>r instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,f=/\.(gltf|glb)/i;function $(s){return s?Array.isArray(s)?s.some(l):l(s):!1}function l(s){if(s instanceof File){const{type:r,name:e}=s;return c.test(r)||f.test(e)}return c.test(s.assetMimeType)||f.test(s.assetName)}function O(s,r){if(!s)return!1;const{source:e}=s;return T(e,r)}function U(s,r){if(s===r)return!0;const{source:e}=s,{source:t}=r;if(e===t)return!0;if(u(e)&&u(t)){if(e.length!==t.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...t].sort(a);for(let n=0;n0&&e.every(t=>h(t,r))}return h(s,r)}function h(s,r){return s instanceof m&&s.isOnService(r)}function q(s,r){return s instanceof File?N(s,r):A(s.assetMimeType,r)??v(s.assetName,r)}function S(s){return Array.isArray(s)?s:[s]}function d(s){return!!s.original}export{S as A,q as N,O as h,m as i,H as o,M as u,d as v,U as y}; diff --git a/dist/assets/Factory-m-O4WAoG.js b/dist/assets/Factory-m-O4WAoG.js new file mode 100644 index 0000000..35f86b4 --- /dev/null +++ b/dist/assets/Factory-m-O4WAoG.js @@ -0,0 +1,5 @@ +import{fz as r}from"./index-J0iiHjMT.js";const s="theme-style";function m(c,t){return u(M(g(N(c),t)),t.size)}function g(c,{accentColor:t,contrastColor:o}){const a=t.toHex(),i=t.a,n=o.toHex(),e=o.a,l=c.getElementsByTagNameNS("http://www.w3.org/2000/svg","style").namedItem(s);return l&&(l.innerHTML=` + .contrast-fill { fill: ${n}; fill-opacity: ${e}; } + .contrast-stroke { stroke: ${n}; stroke-opacity: ${e}; } + .accent-fill { fill: ${a}; fill-opacity: ${i}; } + .accent-stroke { stroke: ${a}; stroke-opacity: ${i}; }`),c}function N(c){const t=c.split(",")[1],o=atob(t);return new DOMParser().parseFromString(o,"image/svg+xml")}function M(c){const t=new XMLSerializer().serializeToString(c);return`data:image/svg+xml;base64,${btoa(t)}`}function u(c,t){const o=new Image(t,t);return o.src=c,o}const j="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxwYXRoIGQ9Ik0yOCAwYTI4IDI4IDAgMSAxIDAgNTYgMjggMjggMCAwIDEgMC01NnoiIGNsYXNzPSJhY2NlbnQtZmlsbCIvPjxwYXRoIHN0cm9rZS13aWR0aD0iNC45OSIgZD0iTTIwLjA1IDQwLjg2YTE1LjA1IDE1LjA1IDAgMCAwIDE3LjE0LTEuNSAxNS4wNSAxNS4wNSAwIDAgMCA0LjQ3LTE2LjY1IDE1LjA1IDE1LjA1IDAgMCAwLTIyLjcyLTcuMTUgMTUuMDUgMTUuMDUgMCAwIDAtNS41IDcuMTUiIGNsYXNzPSJjb250cmFzdC1zdHJva2UiLz48cGF0aCBkPSJtMTAuOTcgMzUuNTcgNS4zOCAxMi4wNyA3Ljc5LTEzLjQ3LTEzLjE3IDEuNHoiIGNsYXNzPSJjb250cmFzdC1maWxsIi8+PC9zdmc+",L="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1NiIgaGVpZ2h0PSI1NiIgZmlsbD0ibm9uZSIgdmVyc2lvbj0iMi4wIj48c3R5bGUgaWQ9InRoZW1lLXN0eWxlIj4uY29udHJhc3QtZmlsbHtmaWxsOiNmZmZ9LmNvbnRyYXN0LXN0cm9rZXtzdHJva2U6I2ZmZn0uYWNjZW50LWZpbGx7ZmlsbDojZmY3ZjAwO2ZpbGwtb3BhY2l0eTouNX08L3N0eWxlPjxjaXJjbGUgY3g9IjM5LjQ3OCIgY3k9IjMuMDc4IiByPSIyOCIgY2xhc3M9ImFjY2VudC1maWxsIiB0cmFuc2Zvcm09InJvdGF0ZSg0MC41NDIpIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSI1IiBkPSJtNy4wNzQgMzAuMDUzIDI5LjM5NyAxMS45ODUtMy42NzMtMzMuNDkzIiBjbGFzcz0iY29udHJhc3Qtc3Ryb2tlIi8+PHBhdGggc3Ryb2tlLXdpZHRoPSIyLjk5NiIgZD0iTTI0LjUwNCAyMy4yMDdhMTEuOTgyIDExLjk4MiAwIDAgMC05LjggNy41MDciIGNsYXNzPSJjb250cmFzdC1zdHJva2UgY29udHJhc3QtZmlsbCIvPjxwYXRoIGQ9Im0yOS44MTggMjIuODA4LTYuMTg0IDQuNi0uNTQxLTguMzY0eiIgY2xhc3M9ImNvbnRyYXN0LWZpbGwiLz48L3N2Zz4=",I=64;function b(c,t){const{accentColor:o,contrastColor:a,preMultiplyAlpha:i}=t;return c.fromData(`heading-rotate:[accent:${o},contrast:${a},size:${I}]`,()=>new r(m(j,{accentColor:o,contrastColor:a,size:I}),{mipmap:!0,reloadable:!0,preMultiplyAlpha:i}))}function y(c,t){const{accentColor:o,contrastColor:a,preMultiplyAlpha:i}=t;return c.fromData(`tilt-rotate:[accent:${o},contrast:${a},size:${I}]`,()=>new r(m(L,{accentColor:o,contrastColor:a,size:I}),{mipmap:!0,reloadable:!0,preMultiplyAlpha:i}))}export{b as l,y as n}; diff --git a/dist/assets/FeatureCollectionSnappingSource-AwpfuxVk.js b/dist/assets/FeatureCollectionSnappingSource-AwpfuxVk.js new file mode 100644 index 0000000..a2e4e19 --- /dev/null +++ b/dist/assets/FeatureCollectionSnappingSource-AwpfuxVk.js @@ -0,0 +1 @@ +import{p as E,gC as F,d as h,P as d,fl as V,gD as C,gE as D,gF as $,s as p,e as o,y as r,c as A,gG as I}from"./index-J0iiHjMT.js";import{o as G,a as P}from"./queryEngineUtils-0F1SWi13.js";import{i as v,r as q,n as S}from"./symbologySnappingCandidates-Sz0MFOvR.js";import"./VertexSnappingCandidate-sgrBHAMS.js";import"./PointSnappingHint-ULetRXiW.js";let a=class extends E{get availability(){return 1}get updating(){return this.layerSource.updating}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,i=e!=null&&e.type==="3d";if(!i||t.type==="subtype-group")return v();const n=async(l,s)=>(await I(e.whenLayerView(t),s)).elevationAlignPointsInFeatures(l,s);return v(i,{elevationInfo:t.elevationInfo,alignPointsInFeatures:n})}get _snappingElevationFilter(){const{view:e}=this,t=e!=null&&e.type==="3d"&&this.layerSource.layer.type!=="subtype-group";return q(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource;return e!=null&&e.type==="3d"&&t.type!=="subtype-group"?S(this._symbologySnappingSupported,async(i,n)=>{const l=await e.whenLayerView(t);return p(n),l.queryForSymbologySnapping({candidates:i,spatialReference:e.spatialReference},n)}):S()}get _symbologySnappingSupported(){return this._layerView3D!=null&&this._layerView3D.symbologySnappingSupported}initialize(){const{view:e}=this,{layer:t}=this.layerSource;e!=null&&e.type==="3d"&&t.type!=="subtype-group"&&(e.whenLayerView(t).then(i=>this._layerView3D=i),this.addHandles([e.elevationProvider.on("elevation-change",({context:i})=>{const{elevationInfo:n}=t;F(i,n)&&this._snappingElevationAligner.notifyElevationSourceChange()}),h(()=>t.elevationInfo,()=>this._snappingElevationAligner.notifyElevationSourceChange(),d),h(()=>{var i;return this._layerView3D!=null?(i=this._layerView3D.processor)==null?void 0:i.renderer:null},()=>this._symbologySnappingFetcher.notifySymbologyChange(),d),V(()=>{var i;return(i=this._layerView3D)==null?void 0:i.layer},["edits","apply-edits","graphic-update"],()=>this._symbologySnappingFetcher.notifySymbologyChange())]))}constructor(e){super(e),this.view=null,this._layerView3D=null,this._memoizedMakeGetGroundElevation=C(G)}refresh(){}async fetchCandidates(e,t){var c;const{layer:i}=this.layerSource,n=i.source;if(!(n!=null&&n.querySnapping))return[];const l=D(i),s=$(e,((c=this.view)==null?void 0:c.type)??"2d",l),w=await n.querySnapping(s,{signal:t});p(t);const g=e.coordinateHelper.spatialReference,y=await this._snappingElevationAligner.alignCandidates(w.candidates,g,t);p(t);const u=await this._symbologySnappingFetcher.fetch(y,t);p(t);const m=u.length===0?y:[...y,...u],_=this._snappingElevationFilter.filter(s,m),f=this._memoizedMakeGetGroundElevation(this.view,g);return _.map(b=>P(b,f))}};o([r({constructOnly:!0})],a.prototype,"layerSource",void 0),o([r({constructOnly:!0})],a.prototype,"view",void 0),o([r()],a.prototype,"_snappingElevationAligner",null),o([r()],a.prototype,"_snappingElevationFilter",null),o([r()],a.prototype,"_symbologySnappingFetcher",null),o([r()],a.prototype,"_layerView3D",void 0),o([r()],a.prototype,"_symbologySnappingSupported",null),a=o([A("esri.views.interactive.snapping.featureSources.FeatureCollectionSnappingSource")],a);export{a as FeatureCollectionSnappingSource}; diff --git a/dist/assets/FeatureEffect-5bEV-xG1.js b/dist/assets/FeatureEffect-5bEV-xG1.js new file mode 100644 index 0000000..4969b52 --- /dev/null +++ b/dist/assets/FeatureEffect-5bEV-xG1.js @@ -0,0 +1 @@ +import{e as s,y as u,dC as y,dD as c,c as E,dE as h,dF as b,dr as x,E as f}from"./index-J0iiHjMT.js";var n;const a={read:{reader:h},write:{writer:b,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},p={read:{reader:h},write:{writer:b,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},w={name:"showExcludedLabels",default:!0};let r=n=class extends x{constructor(l){super(l),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(l,e){var d,i;const t=super.write(l,e);if(e!=null&&e.origin){if(t.filter){const o=Object.keys(t.filter);if(o.length>1||o[0]!=="where")return(d=e.messages)==null||d.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in t)return(i=e.messages)==null||i.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return t}clone(){return new n({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};s([u({type:y,json:{write:{allowNull:!0,writer(l,e,t,d){const i=l==null?void 0:l.write({},d);i&&Object.keys(i).length!==0?c(t,i,e):c(t,null,e)}}}})],r.prototype,"filter",void 0),s([u({json:{write:!0,origins:{"web-map":a,"portal-item":a}}})],r.prototype,"includedEffect",void 0),s([u({json:{write:!0,origins:{"web-map":p,"portal-item":p}}})],r.prototype,"excludedEffect",void 0),s([u({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":w,"portal-item":w}}})],r.prototype,"excludedLabelsVisible",void 0),r=n=s([E("esri.layers.support.FeatureEffect")],r);const v=r;export{v as w}; diff --git a/dist/assets/FeatureEffectLayer-oBa8pIG5.js b/dist/assets/FeatureEffectLayer-oBa8pIG5.js new file mode 100644 index 0000000..1f714d9 --- /dev/null +++ b/dist/assets/FeatureEffectLayer-oBa8pIG5.js @@ -0,0 +1 @@ +import{e as t,y as s,c as i}from"./index-J0iiHjMT.js";import{w as a}from"./FeatureEffect-5bEV-xG1.js";const r={write:{allowNull:!0}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s({type:a,json:{origins:{"web-map":r,"portal-item":r}}})],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p}; diff --git a/dist/assets/FeatureFilter-w5_DYl72.js b/dist/assets/FeatureFilter-w5_DYl72.js new file mode 100644 index 0000000..5cba616 --- /dev/null +++ b/dist/assets/FeatureFilter-w5_DYl72.js @@ -0,0 +1 @@ +import{Z as m,kv as u,E as p,ae as c,ca as _,eL as y}from"./index-J0iiHjMT.js";import{a as f,v as w,t as I}from"./QueryEngine-8tLWlkSE.js";import{I as b}from"./Pipeline--6jAENf8.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./StreamFeatureManager-QrKJ84_c.js";import"./quickselect-UFB0jJTZ.js";import"./labelPoint-ysDT9nFH.js";import"./ogcFeatureUtils-dtzP0u64.js";import"./geojson-fSjaGZrp.js";import"./date-be_IQzZd.js";import"./clientSideDefaults-F-CNnR0g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./createConnection-4ppGVnSc.js";import"./definitions-DqQMJYPH.js";import"./enums-uQoFEhYh.js";import"./number-sTjsTbdA.js";import"./geohashUtils-U0jvYCSY.js";const d=m.getLogger("esri.views.2d.layers.features.support.whereUtils"),g={getAttribute:(r,e)=>r.readAttribute(e)};async function T(r,e){try{const t=await u(r,e);if(!t.isStandardized){const i=new p("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);d.error(i)}return i=>{const s=i.readArcadeFeature();return t.testFeature(s,g)}}catch{return d.warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",r),i=>!0}}const a=1,v=2;class C{constructor(e){this._geometryBounds=c(),this._idToVisibility=new Map,this._serviceInfo=e}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,a)}setTrue(e){const t=[],i=[],s=new Set(e);return this._idToVisibility.forEach((h,o)=>{const l=!!(this._idToVisibility.get(o)&a),n=s.has(o);!l&&n?t.push(o):l&&!n&&i.push(o),this._idToVisibility.set(o,n?a|v:0)}),{show:t,hide:i}}createQuery(){const{geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:h}=this;return _.fromJSON({geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:h})}async update(e,t){this._hash=JSON.stringify(e);const i=await f(e,null,t);await Promise.all([this._setGeometryFilter(i),this._setIdFilter(i),this._setAttributeFilter(i),this._setTimeFilter(i)])}async _setAttributeFilter(e){if(!(e!=null&&e.where))return this._clause=null,void(this.where=null);this._clause=await T(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=(e==null?void 0:e.objectIds)&&new Set(e.objectIds),this._idsToHide=(e==null?void 0:e.hiddenIds)&&new Set(e.hiddenIds),this.objectIds=e==null?void 0:e.objectIds}async _setGeometryFilter(e){if(!(e!=null&&e.geometry))return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,i=e.spatialRel||"esriSpatialRelIntersects",s=await w(i,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);y(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=i}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e==null?void 0:e.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=I(this._serviceInfo.timeInfo,e.timeExtent,b);else{const t=new p("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);m.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){var t,i;return(!((t=this._idsToHide)!=null&&t.size)||!this._idsToHide.has(e.getObjectId()))&&(!((i=this._idsToShow)!=null&&i.size)||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readHydratedGeometry();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,i)=>{t&a||(this._idToVisibility.set(i,a),e.push(i))}),e}}export{C as default}; diff --git a/dist/assets/FeatureLayer--S4epFk-.js b/dist/assets/FeatureLayer--S4epFk-.js new file mode 100644 index 0000000..254df4b --- /dev/null +++ b/dist/assets/FeatureLayer--S4epFk-.js @@ -0,0 +1,7 @@ +import{ij as H,cZ as U,E as f,dT as B,l as K,g1 as Y,dJ as X,Z as T,j5 as L,e as a,mq as ee,S as x,iy as te,y as n,c as E,V as C,p as ie,jp as re,dK as se,el as ae,dO as oe,dL as ne,em as le,dM as ue,dN as de,dP as pe,en as ye,dq as ce,ar as he,ah as me,dQ as fe,jq as ge,jr as be,dD as I,mr as we,ms as ve,bV as _e,h6 as P,iF as R,ja as Fe,jb as Se,js as Te,df as Ie,mt as Ee,jt as je,ju as $e,jv as De,mu as Oe,il as qe,gG as Ce,de as G,jh as Me,ji as Le,jw as xe,jx as Pe,jy as Re,ca as Ge,jz as Ae,jA as Ne,jB as Je,jC as Ve,jD as ke,jc as _,bW as Qe,iG as We,dl as Ze,jE as ze,dt as y,mv as He,iY as Ue,du as j,mw as A,dU as Be,iI as Ke,iJ as Ye,iK as $,mx as N,bI as D,jH as Xe,dV as et,my as tt,iu as it,iv as rt,iM as st,it as at,iN as ot,f6 as nt,jF as lt,ix as ut,c7 as dt,mz as pt}from"./index-J0iiHjMT.js";import{D as yt,y as ct}from"./FeatureLayerBase-jpFp8gE3.js";import{i as ht}from"./editsZScale-Wgw9kbYG.js";import{t as J}from"./queryZScale-IaMm02_2.js";import{d as k}from"./FeatureSet-d4S1oKME.js";import{o as mt}from"./CustomParametersMixin-Y1bOcayO.js";import{p as ft}from"./FeatureEffectLayer-oBa8pIG5.js";import{c as gt}from"./FeatureReductionLayer-RlitE1N6.js";import{c as bt}from"./OrderedLayer-M7k5gLgx.js";import{p as Q}from"./FeatureTemplate-kUgbbA00.js";import{n as W}from"./FeatureType-MpRe7WJj.js";import{a as wt}from"./serviceCapabilitiesUtils-26KpT1VN.js";import{e as vt}from"./versionUtils-4v9zIDlv.js";import{S as F}from"./TopFeaturesQuery-E6D2tV-x.js";import"./FeatureEffect-5bEV-xG1.js";let _t=0,g=class extends H.LoadableMixin(U(C)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}get _workerGeometryType(){var t;const e=(t=this.layer)==null?void 0:t.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);J(e,this.layer.spatialReference,i);const r=k.fromJSON(i);if(!this._requiresClientGraphicMapping())return r;const s=this.layer.objectIdField;for(const l of r.features){const u=l.attributes[s],c=this._idToClientGraphic.get(u);c&&(l.geometry=c.geometry)}return r.geometryType=this.layer.geometryType,r}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new f("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return J(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(i=>({count:i.count,extent:B.fromJSON(i.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new f("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const r=[],s=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const m=l(d);m!=null&&r.push(m)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(s.push(this._serializeFeature(d)),u){const m=l(d);m!=null&&u.set(m,d)}}ht(i?i.features:null,s,this.layer.spatialReference);const{fullExtent:c,featureEditResults:p}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:s,deletes:r});return this.fullExtent=c,i&&i.finish(p.uidToObjectId),this._updateClientGraphicIds(u,p),this._createEditsResult(p)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const i=[];for(const{geometry:r}of e)r==null||r.type!=="mesh"||r.hasExtent||r.loaded||i.push(r.load({signal:t}));i.length&&await Promise.all(i)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const i of t.updateResults){if(!i.success)continue;const r=e.get(i.objectId);r!=null&&this._addIdToClientGraphic(r)}for(const i of t.deleteResults)i.success&&this._idToClientGraphic.delete(i.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new f("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let r=null;for(let l=0;l{T.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),w.preventDefault()}));const m={features:d.features,fields:t==null?void 0:t.map(w=>w.toJSON()),geometryType:L.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&s,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:r,spatialReference:p?null:i&&i.toJSON(),timeInfo:(u==null?void 0:u.toJSON())??null,dateFieldsTimeZone:c},b=await this._connection.invoke("load",m,{signal:e});for(const w of b.warnings)T.getLogger(this.layer).warn("#load()",`${w.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:w});b.featureErrors.length&&T.getLogger(this.layer).warn("#load()",`Encountered ${b.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:b.featureErrors});const M=b.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=L.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(b.assignedObjectIds)}};a([ee({Type:x,ensureType:te(x)})],g.prototype,"itemType",void 0),a([n()],g.prototype,"type",void 0),a([n({constructOnly:!0})],g.prototype,"layer",void 0),a([n({readOnly:!0})],g.prototype,"_workerGeometryType",null),a([n()],g.prototype,"sourceJSON",void 0),g=a([E("esri.layers.graphics.sources.MemorySource")],g);let v=class extends ie{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};a([n()],v.prototype,"updating",void 0),a([n()],v.prototype,"status",void 0),v=a([E("esri.layers.support.PublishingInfo")],v);const Ft=v,Z="esri.layers.mixins.PublishableLayer",St=Symbol(Z),Tt=e=>{var t;let i=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const r=this._get("publishingInfo");if(r)return r;const s=new Ft;return this._checkPublishingStatus(s),s}_checkPublishingStatus(r){let u=0;const c=async d=>{let m;r.updating=!0;try{m=await this.fetchPublishingStatus()}catch{m="unavailable"}m!=="published"&&m!=="unavailable"||(r.status==="publishing"&&this.refresh(),p.remove()),r.status=m,r.updating=!1,p.removed||(u=setTimeout(c,d,d+125))},p={removed:!1,remove(){this.removed=!0,clearTimeout(u)}};this.when().catch(()=>p.remove()),c(250),this.addHandles(p)}};return t=St,a([n({readOnly:!0,clonable:!1})],i.prototype,"publishingInfo",null),i=a([E(Z)],i),i},h="FeatureLayer",z="esri.layers.FeatureLayer",It=T.getLogger(z);function S(e,t){return new f("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function V(e){return e&&e instanceof C}const O=ut();function q(e,t,i){const r=!!(i!=null&&i.writeLayerSchema);return{enabled:r,ignoreOrigin:r}}let o=class extends yt(gt(ft(Tt(re(se(bt(ae(oe(ne(le(ue(de(pe(mt(ye(ce(dt))))))))))))))))){constructor(...e){super(...e),this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=he.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=me(async(t,i,r)=>{const{save:s,saveAs:l}=await G(()=>import("./featureLayerUtils-o55B7eEP.js"),__vite__mapDeps([0,1,2,3,4,5,6]));switch(t){case _.SAVE:return s(this,i);case _.SAVE_AS:return l(this,r,i)}})}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){var r;const t=e!=null?e.signal:null;if((r=this.portalItem)!=null&&r.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(s=>this.initLayerProperties(s))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(fe).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const s=await this._fetchFirstValidLayerId(t);s!=null&&(this.layerId=s)}if(!this.url&&!this._hasMemorySource())throw new f("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ge(this,"load",e));return this.addResolvingPromise(i),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,wt(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){var e;return!(this.loaded&&!((e=this.capabilities)!=null&&e.operations.supportsEditing))&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,r){this._writeEditingEnabled(e,t,!0,r)}get effectiveEditingEnabled(){return be(this)}readIsTable(e,t){return(t=(t==null?void 0:t.layerDefinition)??t).type==="Table"||!t.geometryType}writeIsTable(e,t,i,r){r!=null&&r.writeLayerSchema&&I(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return we(t.layerDefinition||t)}readObjectIdField(e,t){return ve(t.layerDefinition||t)}get parsedUrl(){const e=_e(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=P(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=P(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){R(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){var s;t=t.layerDefinition||t;const r=(s=t.drawingInfo)==null?void 0:s.renderer;if(r){const l=Fe(r,t,i)??void 0;return l||It.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),l}return Se(t,i)}set source(e){const t=this._get("source");t!==e&&(V(t)&&this._resetMemorySource(t),V(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof C?new g({layer:this,items:e}):e:null}readSource(e,t){const i=k.fromJSON(t.featureSet);return new g({layer:this,items:(i==null?void 0:i.features)??[]})}readTemplates(e,t){const i=t.editFieldsInfo,r=i==null?void 0:i.creatorField,s=i==null?void 0:i.editorField;return e=e==null?void 0:e.map(l=>Q.fromJSON(l)),this._fixTemplates(e,r),this._fixTemplates(e,s),e}readTitle(e,t){var s,l,u;const i=((s=t.layerDefinition)==null?void 0:s.name)??t.name,r=t.title||((l=t.layerDefinition)==null?void 0:l.title);if(i){const c=(u=this.portalItem)==null?void 0:u.title;if(this.sublayerTitleMode==="item-title")return this.url?Te(this.url,i):i;let p=i;if(!p&&this.url){const d=Ie(this.url);d!=null&&(p=d.title)}return p?(this.sublayerTitleMode==="item-title-and-service-name"&&c&&c!==p&&(p=c+" - "+p),Ee(p)):void 0}if(this.sublayerTitleMode==="item-title"&&r)return r}readTitleFromWebMap(e,t){var i;return t.title||((i=t.layerDefinition)==null?void 0:i.name)}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const r=t.fields.find(s=>s.name.toLowerCase()===i);r&&(i=r.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,r=i==null?void 0:i.creatorField,s=i==null?void 0:i.editorField;return e==null?void 0:e.map(l=>(l=W.fromJSON(l),this._fixTemplates(l.templates,r),this._fixTemplates(l.templates,s),l))}readVisible(e,t){var i;return((i=t.layerDefinition)==null?void 0:i.defaultVisibility)!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return je(this,e,t,h)}async updateAttachment(e,t,i){return $e(this,e,t,i,h)}async applyEdits(e,t){return De(this,e,t)}async uploadAssets(e,t){return Oe(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return qe(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await Ce(G(()=>import("./FeatureLayerSource-AZE5JEq3.js"),__vite__mapDeps([7,1,2,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=Me(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,i=Le(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){return xe(this,e,t,h)}async fetchRecomputedExtents(e){return Pe(this,e,h)}getFeatureType(e){const{typeIdField:t,types:i}=this;if(!t||!e)return null;const r=e.attributes?e.attributes[t]:void 0;if(r==null)return null;let s=null;return i==null||i.some(l=>{const{id:u}=l;return u!=null&&(u.toString()===r.toString()&&(s=l),!!s)}),s}getFieldDomain(e,t){const i=t==null?void 0:t.feature,r=this.getFeatureType(i);if(r){const s=r.domains&&r.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return Re(this,e,t,h)}async queryFeatures(e,t){const i=await this.load(),r=await i.source.queryFeatures(Ge.from(e)??i.createQuery(),t);if(r!=null&&r.features)for(const s of r.features)s.layer=s.sourceLayer=i;return r}async queryObjectIds(e,t){return Ae(this,e,t,h)}async queryFeatureCount(e,t){return Ne(this,e,t,h)}async queryExtent(e,t){return Je(this,e,t,h)}async queryRelatedFeatures(e,t){return Ve(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return ke(this,e,t,h)}async queryTopFeatures(e,t){var l;const{source:i,capabilities:r}=await this.load();if(!i.queryTopFeatures||!((l=r==null?void 0:r.query)!=null&&l.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopFeatures capability");const s=await i.queryTopFeatures(F.from(e),t);if(s!=null&&s.features)for(const u of s.features)u.layer=u.sourceLayer=this;return s}async queryTopObjectIds(e,t){const{source:i,capabilities:r}=await this.load();if(!i.queryTopObjectIds||!(r!=null&&r.query.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopObjectIds capability");return i.queryTopObjectIds(F.from(e),t)}async queryTopFeaturesExtent(e,t){var s;const{source:i,capabilities:r}=await this.load();if(!i.queryTopExtents||!((s=r==null?void 0:r.query)!=null&&s.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryTopExtents capability");return i.queryTopExtents(F.from(e),t)}async queryTopFeatureCount(e,t){var s;const{source:i,capabilities:r}=await this.load();if(!i.queryTopCount||!((s=r==null?void 0:r.query)!=null&&s.supportsTopFeaturesQuery))throw new f(h,"Layer source does not support queryFeatureCount capability");return i.queryTopCount(F.from(e),t)}read(e,t){const i=e.featureCollection;if(i){this.resourceInfo=e;const r=i.layers;r&&r.length===1&&(super.read(r[0],t),i.showLegend!=null&&super.read({showLegend:i.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:(t==null?void 0:t.origin)??void 0,writeLayerSchema:(t==null?void 0:t.writeLayerSchema)??this._hasMemorySource()};const{origin:i,layerContainerType:r,messages:s}=t;if(this.dynamicDataSource)return s==null||s.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((i==="web-map"||i==="web-scene")&&r!=="tables")return s==null||s.push(S(this,`a table source can only be written to tables, not ${r}`)),null;if(this._hasMemorySource())return s==null||s.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(i==="web-map"||i==="web-scene")&&r==="tables")return s==null||s.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new f(h,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){var t;return!!this.loaded&&(((t=this.source)==null?void 0:t.type)==="memory"||vt(this,e))}async save(e){return this._debouncedSaveOperations(_.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(_.SAVE_AS,t,e)}_readEditingEnabled(e,t,i){var s;let r=(s=e.layerDefinition)==null?void 0:s.capabilities;return r?this._hasEditingCapability(r):(r=e.capabilities,t&&(i==null?void 0:i.origin)==="web-map"&&!this._hasMemorySource()&&r?this._hasEditingCapability(r):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,i,r){var s,l;if(!e){const u=(l=(s=this.capabilities)==null?void 0:s.operations)!=null&&l.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",u,t),i&&!(r!=null&&r.writeLayerSchema)&&(t.capabilities=u)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return Qe(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const i=t.data;if(i)return this.findFirstValidLayerId(i)})}async initLayerProperties(e){var t;return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(t=this.portalItem)==null?void 0:t.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),R(this.renderer,this.fieldsIndex),We(this.timeInfo,this.fieldsIndex),Ze(this,{origin:"service"})}async hasDataChanged(){return ze(this)}async fetchPublishingStatus(){const e=this.source;return e!=null&&e.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){var t,i;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||(i=this.fields)!=null&&i.some(r=>r.type==="geometry")||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(i=>{var s;const r=(s=i.prototype)==null?void 0:s.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new f("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new f("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this.addHandles([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};a([y("service","capabilities")],o.prototype,"readCapabilities",null),a([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),a([n({readOnly:!0})],o.prototype,"createQueryVersion",null),a([n({json:{read:{source:"layerDefinition.copyrightText"}}})],o.prototype,"copyright",void 0),a([n({json:{read:{source:"layerDefinition.displayField"}}})],o.prototype,"displayField",void 0),a([n({types:He,readOnly:!0})],o.prototype,"defaultSymbol",void 0),a([n({type:Ue})],o.prototype,"dynamicDataSource",void 0),a([n({type:Boolean})],o.prototype,"editingEnabled",null),a([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],o.prototype,"readEditingEnabled",null),a([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],o.prototype,"readEditingEnabledFromWebMap",null),a([j(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],o.prototype,"writeEditingEnabled",null),a([j("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],o.prototype,"writeEditingEnabledToWebMap",null),a([n({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),a([n({...O.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],o.prototype,"fields",void 0),a([n(O.fieldsIndex)],o.prototype,"fieldsIndex",void 0),a([n({type:ct,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),a([n({json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,i){const r=e?A.toJSON(e):null;r&&I(i,r,t)}}}},read:{source:"layerDefinition.geometryType",reader:A.read}}})],o.prototype,"geometryType",void 0),a([n({json:{read:{source:"layerDefinition.hasM"}}})],o.prototype,"hasM",void 0),a([n({json:{read:{source:"layerDefinition.hasZ"}}})],o.prototype,"hasZ",void 0),a([n(Be)],o.prototype,"id",void 0),a([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"infoFor3D",void 0),a([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],o.prototype,"isTable",void 0),a([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],o.prototype,"readIsTable",null),a([j("web-map","isTable")],o.prototype,"writeIsTable",null),a([n(Ke)],o.prototype,"labelsVisible",void 0),a([n({type:[Ye],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:$,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:$,write:{enabled:!0,layerContainerTypes:N}}},name:"layerDefinition.drawingInfo.labelingInfo",read:$,write:!0}})],o.prototype,"labelingInfo",void 0),a([n((()=>{const e=D(Xe);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,i,r){I(r,pt(t),i)}}},e})())],o.prototype,"opacity",void 0),a([n(et)],o.prototype,"legendEnabled",void 0),a([n({type:["show","hide"],json:(()=>{const e=D(tt.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],o.prototype,"listMode",void 0),a([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdField",null),a([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],o.prototype,"objectIdField",void 0),a([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdField",null),a([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),a([n(O.outFields)],o.prototype,"outFields",void 0),a([n({readOnly:!0})],o.prototype,"parsedUrl",null),a([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),a([n(it)],o.prototype,"popupEnabled",void 0),a([n({type:rt,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),a([n({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),a([n({types:st,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:at,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:N,overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}})],o.prototype,"renderer",null),a([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],o.prototype,"readRenderer",null),a([n()],o.prototype,"resourceInfo",void 0),a([n((()=>{const e=D(ot);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],o.prototype,"screenSizePerspectiveEnabled",void 0),a([n({clonable:!1})],o.prototype,"source",null),a([nt("source")],o.prototype,"castSource",null),a([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],o.prototype,"readSource",null),a([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],o.prototype,"spatialReference",void 0),a([n({type:Number})],o.prototype,"subtypeCode",void 0),a([n({type:[Q]})],o.prototype,"templates",void 0),a([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],o.prototype,"readTemplates",null),a([n({type:lt})],o.prototype,"timeInfo",void 0),a([n()],o.prototype,"title",void 0),a([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],o.prototype,"readTitle",null),a([y("web-map","title",["layerDefinition.name","title"])],o.prototype,"readTitleFromWebMap",null),a([n({type:String})],o.prototype,"sublayerTitleMode",void 0),a([n({json:{read:!1}})],o.prototype,"type",void 0),a([n({type:String})],o.prototype,"typeIdField",void 0),a([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([n({type:[W]})],o.prototype,"types",void 0),a([y("service","types",["types"]),y("types",["layerDefinition.types"])],o.prototype,"readTypes",null),a([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],o.prototype,"visible",void 0),a([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],o.prototype,"readVisible",null),o=a([E(z)],o);const Jt=o;export{Jt as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/featureLayerUtils-o55B7eEP.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/utils-rBsg-VY8.js","assets/jsonContext-cWV_-jAj.js","assets/fetchService-wPWKuma6.js","assets/requestPresets-18nzHK5y.js","assets/FeatureLayerSource-AZE5JEq3.js","assets/External-GV0jSEES.js","assets/editingSupport-EiPa9PKq.js","assets/clientSideDefaults-F-CNnR0g.js","assets/QueryEngineCapabilities-PzVpW5yD.js","assets/QueryTask-91TvtrTt.js","assets/executeForIds-wXO8-pll.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/queryZScale-IaMm02_2.js","assets/executeQueryJSON-ACj9qY0y.js","assets/FeatureSet-d4S1oKME.js","assets/executeQueryPBF-vdaOUMid.js","assets/editsZScale-Wgw9kbYG.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/FeatureLayerBase-jpFp8gE3.js b/dist/assets/FeatureLayerBase-jpFp8gE3.js new file mode 100644 index 0000000..352161f --- /dev/null +++ b/dist/assets/FeatureLayerBase-jpFp8gE3.js @@ -0,0 +1 @@ +import{e,y as t,c as p,dr as g,dt as l,du as u,Z as Ee,u$ as Ne,ds as Fe,um as ce,v0 as Be,bI as V,v1 as Le,f6 as Te,dq as N,ex as q,uw as Ue,uv as Ae,dp as Oe,iH as Ce,lk as Ge,mx as We,dT as Qe,mw as Pe,v2 as Ze,V as me,jd as He,je as qe,ar as he,dW as Je,v3 as ze,mr as Ke,ms as _e,v4 as Xe,v5 as Ye,v6 as et}from"./index-J0iiHjMT.js";import{a as tt}from"./serviceCapabilitiesUtils-26KpT1VN.js";var J;let I=J=class extends g{constructor(i){super(i),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new J({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([t({type:String,json:{write:!0}})],I.prototype,"expression",void 0),e([t({type:String,json:{write:!0}})],I.prototype,"name",void 0),e([t({type:["boolean","date","number","string"],json:{write:!0}})],I.prototype,"returnType",void 0),e([t({type:String,json:{write:!0}})],I.prototype,"title",void 0),I=J=e([p("esri.form.ExpressionInfo")],I);const it=I;let E=class extends g{constructor(o){super(o),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([t({type:String,json:{write:!0}})],E.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],E.prototype,"label",void 0),e([t()],E.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],E.prototype,"visibilityExpression",void 0),E=e([p("esri.form.elements.Element")],E);const D=E;var z;let B=z=class extends g{constructor(i){super(i),this.type=null}clone(){return new z({type:this.type})}};e([t({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],B.prototype,"type",void 0),B=z=e([p("esri.form.elements.inputs.AttachmentInput")],B);const ot=B;var K;let F=K=class extends D{constructor(i){super(i),this.attachmentKeyword=null,this.editableExpression=null,this.input=null,this.type="attachment"}clone(){return new K({attachmentKeyword:this.attachmentKeyword,description:this.description,editableExpression:this.editableExpression,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};e([t({type:String,json:{write:!0}})],F.prototype,"attachmentKeyword",void 0),e([t({type:String,json:{write:!0}})],F.prototype,"editableExpression",void 0),e([t({type:ot,json:{read:{source:"inputType"},write:{target:"inputType"}}})],F.prototype,"input",void 0),e([t({type:["attachment"],json:{read:!1,write:!0}})],F.prototype,"type",void 0),F=K=e([p("esri.form.elements.AttachmentElement")],F);const ve=F;let L=class extends g{constructor(o){super(o),this.type=null}};e([t()],L.prototype,"type",void 0),L=e([p("esri.form.elements.inputs.Input")],L);const $=L;let k=class extends ${constructor(i){super(i),this.maxLength=null,this.minLength=0}};e([t({type:Number,json:{write:!0}})],k.prototype,"maxLength",void 0),e([t({type:Number,json:{write:!0}})],k.prototype,"minLength",void 0),k=e([p("esri.form.elements.inputs.TextInput")],k);const ue=k;var _;let U=_=class extends ue{constructor(i){super(i),this.type="barcode-scanner"}clone(){return new _({maxLength:this.maxLength,minLength:this.minLength})}};e([t({type:["barcode-scanner"],json:{read:!1,write:!0}})],U.prototype,"type",void 0),U=_=e([p("esri.form.elements.inputs.BarcodeScannerInput")],U);const rt=U;var X;let T=X=class extends ${constructor(i){super(i),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new X({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([t({type:String,json:{write:!0}})],T.prototype,"noValueOptionLabel",void 0),e([t({type:Boolean,json:{write:!0}})],T.prototype,"showNoValueOption",void 0),e([t({type:["combo-box"],json:{read:!1,write:!0}})],T.prototype,"type",void 0),T=X=e([p("esri.form.elements.inputs.ComboBoxInput")],T);const st=T;var Y;function we(i){return i??null}function xe(i){return i??null}let w=Y=class extends ${constructor(i){super(i),this.max=null,this.min=null,this.type="date-picker"}readMax(i,o){return we(o.max)}writeMax(i,o){o.max=xe(i)}readMin(i,o){return we(o.min)}writeMin(i,o){o.min=xe(i)}clone(){return new Y({max:this.max,min:this.min})}};e([t({type:String,json:{type:String,write:!0}})],w.prototype,"max",void 0),e([l("max")],w.prototype,"readMax",null),e([u("max")],w.prototype,"writeMax",null),e([t({type:String,json:{type:String,write:!0}})],w.prototype,"min",void 0),e([l("min")],w.prototype,"readMin",null),e([u("min")],w.prototype,"writeMin",null),e([t({type:["date-picker"],json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=Y=e([p("esri.form.elements.inputs.DatePickerInput")],w);const nt=w;var ee;function G(i){return i??null}function W(i){return i??null}let d=ee=class extends ${constructor(i){super(i),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(i,o){return G(o.max)}writeMax(i,o){o.max=W(i)}readMin(i,o){return G(o.min)}writeMin(i,o){o.min=W(i)}readTimeResolution(i,o){return G(o.timeResolution)}writeTimeResolution(i,o){o.timeResolution=W(i)}clone(){return new ee({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([t({type:Boolean,json:{write:!0}})],d.prototype,"includeTimeOffset",void 0),e([t({type:String,json:{type:String,write:!0}})],d.prototype,"max",void 0),e([l("max")],d.prototype,"readMax",null),e([u("max")],d.prototype,"writeMax",null),e([t({type:String,json:{type:String,write:!0}})],d.prototype,"min",void 0),e([l("min")],d.prototype,"readMin",null),e([u("min")],d.prototype,"writeMin",null),e([t({type:String,json:{type:String,write:!0}})],d.prototype,"timeResolution",void 0),e([l("timeResolution")],d.prototype,"readTimeResolution",null),e([u("timeResolution")],d.prototype,"writeTimeResolution",null),e([t({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],d.prototype,"type",void 0),d=ee=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],d);const pt=d;var te;function fe(i){return i!=null?new Date(i):null}function ge(i){return i?i.getTime():null}let h=te=class extends ${constructor(i){super(i),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(i,o){return fe(o.max)}writeMax(i,o){o.max=ge(i)}readMin(i,o){return fe(o.min)}writeMin(i,o){o.min=ge(i)}clone(){return new te({includeTime:this.includeTime,max:this.max,min:this.min})}};e([t({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([t({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([u("max")],h.prototype,"writeMax",null),e([t({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([u("min")],h.prototype,"writeMin",null),e([t({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=te=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const lt=h;var ie;let O=ie=class extends ${constructor(i){super(i),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new ie({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([t({type:String,json:{write:!0}})],O.prototype,"noValueOptionLabel",void 0),e([t({type:Boolean,json:{write:!0}})],O.prototype,"showNoValueOption",void 0),e([t({type:["radio-buttons"],json:{read:!1,write:!0}})],O.prototype,"type",void 0),O=ie=e([p("esri.form.elements.inputs.RadioButtonsInput")],O);const at=O;var oe;let M=oe=class extends ${constructor(i){super(i),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new oe({offValue:this.offValue,onValue:this.onValue})}};e([t({type:[String,Number],json:{write:!0}})],M.prototype,"offValue",void 0),e([t({type:[String,Number],json:{write:!0}})],M.prototype,"onValue",void 0),e([t({type:["switch"],json:{read:!1,write:!0}})],M.prototype,"type",void 0),M=oe=e([p("esri.form.elements.inputs.SwitchInput")],M);const dt=M;var re;let A=re=class extends ue{constructor(i){super(i),this.type="text-area"}clone(){return new re({maxLength:this.maxLength,minLength:this.minLength})}};e([t({type:["text-area"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=re=e([p("esri.form.elements.inputs.TextAreaInput")],A);const ut=A;var se;let C=se=class extends ue{constructor(i){super(i),this.type="text-box"}clone(){return new se({maxLength:this.maxLength,minLength:this.minLength})}};e([t({type:["text-box"],json:{read:!1,write:!0}})],C.prototype,"type",void 0),C=se=e([p("esri.form.elements.inputs.TextBoxInput")],C);const yt=C;var ne;function Q(i){return i??null}function P(i){return i??null}let y=ne=class extends ${constructor(i){super(i),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(i,o){return Q(o.max)}writeMax(i,o){o.max=P(i)}readMin(i,o){return Q(o.min)}writeMin(i,o){o.min=P(i)}readTimeResolution(i,o){return Q(o.timeResolution)}writeTimeResolution(i,o){o.timeResolution=P(i)}clone(){return new ne({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([t({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([u("max")],y.prototype,"writeMax",null),e([t({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([u("min")],y.prototype,"writeMin",null),e([t({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([u("timeResolution")],y.prototype,"writeTimeResolution",null),e([t({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=ne=e([p("esri.form.elements.inputs.TimePickerInput")],y);const ct=y,mt={base:$,key:"type",typeMap:{"barcode-scanner":rt,"combo-box":st,"date-picker":nt,"datetime-picker":lt,"datetimeoffset-picker":pt,"radio-buttons":at,switch:dt,"text-area":ut,"text-box":yt,"time-picker":ct}};var pe;const Me="esri.form.elements.FieldElement",be=Ee.getLogger(Me);let c=pe=class extends D{constructor(i){super(i),this.domain=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}get editable(){return ce(be,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._get("editable")??!0}set editable(i){ce(be,"editable",{replacement:"editableExpression",version:"4.26",warnOnce:!0}),this._set("editable",i)}clone(){return new pe({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};e([t({types:Ne,json:{read:{reader:Fe},write:!0}})],c.prototype,"domain",void 0),e([t({type:Boolean,json:{write:!0}})],c.prototype,"editable",null),e([t({type:String,json:{write:!0}})],c.prototype,"editableExpression",void 0),e([t({type:String,json:{write:!0}})],c.prototype,"fieldName",void 0),e([t({type:String,json:{write:!0}})],c.prototype,"hint",void 0),e([t({types:mt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],c.prototype,"input",void 0),e([t({type:String,json:{write:!0}})],c.prototype,"requiredExpression",void 0),e([t({type:String,json:{read:!1,write:!0}})],c.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],c.prototype,"valueExpression",void 0),c=pe=e([p(Me)],c);const je=c;var le;let b=le=class extends D{constructor(i){super(i),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new le({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:V(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([t({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([t({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([t({type:[Be],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([t({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([t({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=le=e([p("esri.form.elements.RelationshipElement")],b);const Se=b;function Re(i){return{typesWithGroup:{base:D,key:"type",typeMap:{attachment:ve,field:je,group:i,relationship:Se}},typesWithoutGroup:{base:D,key:"type",typeMap:{attachment:ve,field:je,relationship:Se}}}}function Ve(i,o,s=!0){if(!i)return null;const r=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return i.filter(n=>r[n.type]).map(n=>r[n.type].fromJSON(n))}function De(i,o,s=!0){if(!i)return null;const r=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return i.filter(n=>r[n.type]).map(n=>n.toJSON())}function ke(i,o,s=!0){return i?i.map(r=>Le(s?o.typesWithGroup:o.typesWithoutGroup,r)):null}var ae;let x=ae=class extends D{constructor(i){super(i),this.elements=null,this.initialState="expanded",this.type="group"}castElements(i){return ke(i,Z,!1)}readElements(i,o){return Ve(o.formElements,Z,!1)}writeElements(i,o){o.formElements=De(i,Z,!1)}clone(){return new ae({description:this.description,elements:V(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([t({json:{write:!0}})],x.prototype,"elements",void 0),e([Te("elements")],x.prototype,"castElements",null),e([l("elements",["formElements"])],x.prototype,"readElements",null),e([u("elements")],x.prototype,"writeElements",null),e([t({type:["collapsed","expanded"],json:{write:!0}})],x.prototype,"initialState",void 0),e([t({type:String,json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=ae=e([p("esri.form.elements.GroupElement")],x);const Z=Re(x),ht=x;var de;const H=Re(ht);let v=de=class extends g{constructor(i){super(i),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(i){return ke(i,H)}readElements(i,o){return Ve(o.formElements,H)}writeElements(i,o){o.formElements=De(i,H)}clone(){return new de({description:this.description,expressionInfos:V(this.expressionInfos),elements:V(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};e([t({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([t({json:{write:!0}})],v.prototype,"elements",void 0),e([Te("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([u("elements")],v.prototype,"writeElements",null),e([t({type:[it],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=de=e([p("esri.form.FormTemplate")],v);const $t=v;let j=class extends N(g){constructor(o){super(o),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([t()],j.prototype,"creatorField",void 0),e([t()],j.prototype,"creationDateField",void 0),e([t()],j.prototype,"editorField",void 0),e([t()],j.prototype,"editDateField",void 0),e([t()],j.prototype,"realm",void 0),e([t(q("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const vt=j;let f=class extends N(g){constructor(o){super(o)}};e([t({constructOnly:!0,json:{write:!0}})],f.prototype,"name",void 0),e([t({constructOnly:!0,json:{write:!0}})],f.prototype,"fields",void 0),e([t({constructOnly:!0,json:{write:!0}})],f.prototype,"isAscending",void 0),e([t({constructOnly:!0,json:{write:!0}})],f.prototype,"indexType",void 0),e([t({constructOnly:!0,json:{write:!0}})],f.prototype,"isUnique",void 0),e([t({constructOnly:!0,json:{write:!0}})],f.prototype,"description",void 0),f=e([p("esri.layers.support.FeatureIndex")],f);let R=class extends N(g){constructor(o){super(o),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([t({type:String,json:{read:{source:"shapeAreaFieldName"}}})],R.prototype,"shapeAreaField",void 0),e([t({type:String,json:{read:{source:"shapeLengthFieldName"}}})],R.prototype,"shapeLengthField",void 0),e([t({type:String,json:{read:i=>Ue.read(i)||Ae.read(i)}})],R.prototype,"units",void 0),R=e([p("esri.layers.support.GeometryFieldsInfo")],R);const wt=R,$e=new Oe({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),Ie=new Oe({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let m=class extends N(g){constructor(i){super(i),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};e([t({json:{read:$e.read,write:$e.write}})],m.prototype,"cardinality",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"composite",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"id",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"keyField",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"keyFieldInRelationshipTable",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"name",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"relatedTableId",void 0),e([t({json:{read:!0,write:!0}})],m.prototype,"relationshipTableId",void 0),e([t({json:{read:Ie.read,write:Ie.write}})],m.prototype,"role",void 0),m=e([p("esri.layers.support.Relationship")],m);const xt=m;let S=class extends N(g){constructor(i){super(i),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(i){if(!i)return null;const o={};for(const s of Object.keys(i))o[s]=Fe(i[s]);return o}writeDomains(i,o){var r;if(!i)return;const s={};for(const n of Object.keys(i))i[n]&&(s[n]=(r=i[n])==null?void 0:r.toJSON());o.domains=s}};e([t({type:Number,json:{write:!0}})],S.prototype,"code",void 0),e([t({type:Object,json:{write:!0}})],S.prototype,"defaultValues",void 0),e([t({json:{write:!0}})],S.prototype,"domains",void 0),e([l("domains")],S.prototype,"readDomains",null),e([u("domains")],S.prototype,"writeDomains",null),e([t({type:String,json:{write:!0}})],S.prototype,"name",void 0),S=e([p("esri.layers.support.Subtype")],S);const ft=S,Tt=i=>{let o=class extends i{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(me.ofType(f)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=he.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:n,editing:a}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||n.supportsEditing&&!(a.supportsUpdateByOthers&&a.supportsUpdateByAnonymous&&a.supportsDeleteByOthers&&a.supportsDeleteByAnonymous))return"load"}return this.userHasUpdateItemPrivileges?ze(this)?"load":this.hasUpdateItemRestrictions?s.operations.supportsQuery?"editing":"load":null:this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions?"editing":null}readCapabilitiesFromService(s,r){return tt(r,this.url)}readEditingInfo(s,r){const{editingInfo:n}=r;return n?{lastEditDate:n.lastEditDate!=null?new Date(n.lastEditDate):null}:null}get effectiveCapabilities(){var ye;const s=this.capabilities;if(!s)return null;const r=V(s),{operations:n,editing:a}=r;return(ye=this.sourceJSON)!=null&&ye.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(n.supportsQuery=!0),r):this.userHasUpdateItemPrivileges?(n.supportsAdd=n.supportsDelete=n.supportsEditing=n.supportsQuery=n.supportsUpdate=a.supportsDeleteByOthers=a.supportsGeometryUpdate=a.supportsUpdateByOthers=!0,r):(this.userHasFullEditingPrivileges&&n.supportsEditing&&(n.supportsAdd=n.supportsDelete=n.supportsUpdate=a.supportsGeometryUpdate=!0),r)}readGlobalIdFieldFromService(s,r){return Ke(r)}get hasFullEditingRestrictions(){var a;const s=this.capabilities;if(!s||(a=this.sourceJSON)!=null&&a.isMultiServicesView)return!1;const{operations:r,editing:n}=s;return r.supportsEditing&&!(r.supportsAdd&&r.supportsDelete&&r.supportsUpdate&&n.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){var a;const s=this.capabilities;if(!s)return!1;const{operations:r,editing:n}=s;return(a=this.sourceJSON)!=null&&a.isMultiServicesView?!r.supportsQuery:!(r.supportsAdd&&r.supportsDelete&&r.supportsEditing&&r.supportsQuery&&r.supportsUpdate&&n.supportsDeleteByOthers&&n.supportsGeometryUpdate&&n.supportsUpdateByOthers)}readIsTableFromService(s,r){return r.type==="Table"}readMaxScale(s,r){return r.effectiveMaxScale||s||0}readMinScale(s,r){return r.effectiveMinScale||s||0}readObjectIdFieldFromService(s,r){return _e(r)}readServiceDefinitionExpression(s,r){return r.definitionQuery||r.definitionExpression}set url(s){const r=Xe({layer:this,url:s,nonStandardUrlAllowed:!0,logger:Ee.getLogger(this)});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(s,r,n,a){Ye(this,s,null,r,a)}readVersion(s,r){return et(r)}};return e([t({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([t({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([t({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([t(q("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([t({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([t({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([t({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([t({readOnly:!0,type:vt})],o.prototype,"editFieldsInfo",void 0),e([t({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([t({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([t((()=>{const s=V(Ce),r=s.json.origins;return r["web-map"]={read:!1,write:!1},r["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([t({type:Ge,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:We}}}}})],o.prototype,"floorInfo",void 0),e([t({type:Qe,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([t()],o.prototype,"gdbVersion",void 0),e([t({readOnly:!0,type:wt,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([t({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:Pe.read}}}})],o.prototype,"geometryType",void 0),e([t({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([t({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([t({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([t({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([t({readOnly:!0,type:Ze})],o.prototype,"heightModelInfo",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([t({type:me.ofType(f),readOnly:!0})],o.prototype,"indexes",void 0),e([t({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([t({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([t(He)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([t(qe)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([t({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([t(q("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([t({type:[xt],readOnly:!0})],o.prototype,"relationships",void 0),e([t({type:Boolean})],o.prototype,"returnM",void 0),e([t({type:Boolean})],o.prototype,"returnZ",void 0),e([t({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([t({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([t({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([t()],o.prototype,"sourceJSON",void 0),e([t({type:he,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([t({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([t({type:[ft],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([t({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([t(Je)],o.prototype,"url",null),e([u("url")],o.prototype,"writeUrl",null),e([t({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{Tt as D,$t as y}; diff --git a/dist/assets/FeatureLayerSource-AZE5JEq3.js b/dist/assets/FeatureLayerSource-AZE5JEq3.js new file mode 100644 index 0000000..e76ffef --- /dev/null +++ b/dist/assets/FeatureLayerSource-AZE5JEq3.js @@ -0,0 +1,7 @@ +import{bw as Q,ln as V,mi as G,bA as W,fd as H,e1 as Z,mj as j,mk as z,Z as $,E as F,S as X,dy as Y,dp as L,e as _,y as T,c as B,ij as K,ah as tt,dJ as C,jq as x,bW as y,e3 as M,ml as et,mm as at,mn as st,kt as rt,dT as nt,ev as it,dv as ot,h6 as U,de as ut,mo as lt,dD as dt,dQ as ct,bM as pt,ar as ht,mp as yt,ca as mt}from"./index-J0iiHjMT.js";import{v as ft}from"./External-GV0jSEES.js";import{isFeatureIdentifierArrayWithGlobalId as gt,isFeatureIdentifierArrayWithObjectId as bt}from"./editingSupport-EiPa9PKq.js";import{o as wt}from"./clientSideDefaults-F-CNnR0g.js";import{x as Rt}from"./QueryTask-91TvtrTt.js";import{s as St}from"./executeQueryJSON-ACj9qY0y.js";import{i as qt}from"./editsZScale-Wgw9kbYG.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./executeForIds-wXO8-pll.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./executeQueryPBF-vdaOUMid.js";import"./FeatureSet-d4S1oKME.js";function At(t){const{vertexSpace:e}=t;if(e.isRelative)return t.clone();const{anchor:a}=t,s=a.clone(),r=Q(It,[-s.x,-s.y,-s.z]),n=new V({origin:[s.x,s.y,s.z]}),i=t.cloneWithVertexSpace(n),{position:o}=i.vertexAttributes;return i.vertexAttributes.position=G(new Float64Array(o.length),o,r),i.vertexAttributesChanged(),i}const It=W();async function P(t,e,a){const{geometry:s}=e,r={...e.attributes};if(a!=null&&(s==null?void 0:s.type)==="mesh"){const{transformFieldRoles:n}=a,{origin:i,spatialReference:o,transform:u}=s,l=t.spatialReference;await H(o,l);const c=Z(i,l);if(r[n.originX]=c.x,r[n.originY]=c.y,r[n.originZ]=c.z??0,u!=null){const{translation:p,scale:h,rotation:m}=u,{vertexSpace:R}=s,d=R.isGeoreferenced?1:j(o)/j(l);r[n.translationX]=p[0]*d,r[n.translationY]=p[2]*d,r[n.translationZ]=-p[1]*d,r[n.scaleX]=h[0],r[n.scaleY]=h[2],r[n.scaleZ]=h[1],r[n.rotationX]=m[0],r[n.rotationY]=m[2],r[n.rotationZ]=-m[1],r[n.rotationDeg]=m[3]}return{attributes:r}}return s==null?{attributes:r}:s.type==="mesh"||s.type==="extent"?null:{geometry:s.toJSON(),attributes:r}}async function Ft(t,e){const a=await Promise.all((e.addAttachments??[]).map(n=>D(t,n))),s=await Promise.all((e.updateAttachments??[]).map(n=>D(t,n))),r=e.deleteAttachments??[];return a.length||s.length||r.length?{adds:a,updates:s,deletes:[...r]}:null}async function D(t,e){var c;const{feature:a,attachment:s}=e,{globalId:r,name:n,contentType:i,data:o,uploadId:u}=s,l={globalId:r};if(a&&("attributes"in a?l.parentGlobalId=(c=a.attributes)==null?void 0:c[t.globalIdField]:a.globalId&&(l.parentGlobalId=a.globalId)),u)l.uploadId=u;else if(o){const p=await z(o);p&&(l.contentType=p.mediaType,l.data=p.data),o instanceof File&&(l.name=o.name)}return n&&(l.name=n),i&&(l.contentType=i),l}function Ot(t,e,a){if(!e||e.length===0)return[];if(a&>(e))return e.map(r=>r.globalId);if(bt(e))return e.map(r=>r.objectId);const s=a?t.globalIdField:t.objectIdField;return s?e.map(r=>r.getAttribute(s)):[]}function Et(t){var r,n,i;const e=t==null?void 0:t.assetMaps;if(e){for(const o of e.addResults)o.success||$.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${o.globalId}.`);for(const o of e.updateResults)o.success||$.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${o.globalId}.`)}const a=t==null?void 0:t.attachments,s={addFeatureResults:((r=t==null?void 0:t.addResults)==null?void 0:r.map(w))??[],updateFeatureResults:((n=t==null?void 0:t.updateResults)==null?void 0:n.map(w))??[],deleteFeatureResults:((i=t==null?void 0:t.deleteResults)==null?void 0:i.map(w))??[],addAttachmentResults:a!=null&&a.addResults?a.addResults.map(w):[],updateAttachmentResults:a!=null&&a.updateResults?a.updateResults.map(w):[],deleteAttachmentResults:a!=null&&a.deleteResults?a.deleteResults.map(w):[]};return t!=null&&t.editMoment&&(s.editMoment=t.editMoment),s}function w(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new F("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function v(t,e){return new X({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function _t(t,e){var a,s,r;return{adds:((a=t==null?void 0:t.adds)==null?void 0:a.map(n=>v(n,e)))||[],updates:((s=t==null?void 0:t.updates)==null?void 0:s.map(n=>({original:v(n[0],e),current:v(n[1],e)})))||[],deletes:((r=t==null?void 0:t.deletes)==null?void 0:r.map(n=>v(n,e)))||[],spatialReference:e}}function xt(t){const e=t.details.raw,a=+e.code,s=+e.extendedCode;return a===500&&(s===-2147217144||s===-2147467261)}const vt=new L({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$t=new Set(["Feature Layer","Oriented Imagery Layer","Table"]),Tt=new L({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let A=class extends K{constructor(){super(...arguments),this.type="feature-layer",this.refresh=tt(async()=>{var a,s;await this.load();const t=(a=this.sourceJSON.editingInfo)==null?void 0:a.lastEditDate;if(t==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==((s=this.sourceJSON.editingInfo)==null?void 0:s.lastEditDate);return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}get queryTask(){var l;const{capabilities:t,parsedUrl:e,dynamicDataSource:a,infoFor3D:s,gdbVersion:r,spatialReference:n,fieldsIndex:i}=this.layer,o=C("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF)&&s==null,u=((l=t==null?void 0:t.operations)==null?void 0:l.supportsQueryAttachments)??!1;return new Rt({url:e.path,pbfSupported:o,fieldsIndex:i,infoFor3D:s,dynamicDataSource:a,gdbVersion:r,sourceSpatialReference:n,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await x(a,"editing");const s=t.attributes[a.objectIdField],r=a.parsedUrl.path+"/"+s+"/addAttachment",n=this._getLayerRequestOptions(),i=this._getFormDataForAttachment(e,n.query);try{const o=await y(r,{body:i});return w(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(s,o)}}async updateAttachment(t,e,a){await this.load();const{layer:s}=this;await x(s,"editing");const r=t.attributes[s.objectIdField],n=s.parsedUrl.path+"/"+r+"/updateAttachment",i=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,i.query);try{const u=await y(n,{body:o});return w(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(r,u)}}async applyEdits(t,e){var g,q,E,N,J,k;await this.load();const{layer:a}=this;await x(a,"editing");const s=a.infoFor3D,r=s!=null,n=r||((e==null?void 0:e.globalIdUsed)??!1),i=r?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=((g=t.addFeatures)==null?void 0:g.map(b=>P(this.layer,b,s)))??[],u=(await Promise.all(o)).filter(M),l=((q=t.updateFeatures)==null?void 0:q.map(b=>P(this.layer,b,s)))??[],c=(await Promise.all(l)).filter(M),p=Ot(this.layer,t.deleteFeatures,n);qt(u,c,a.spatialReference);const h=await Ft(this.layer,t),m=a.capabilities.editing.supportsAsyncApplyEdits&&r,R=(e==null?void 0:e.gdbVersion)||a.gdbVersion,d={gdbVersion:R,rollbackOnFailure:e==null?void 0:e.rollbackOnFailureEnabled,useGlobalIds:n,returnEditMoment:e==null?void 0:e.returnEditMoment,usePreviousEditMoment:e==null?void 0:e.usePreviousEditMoment,async:m};await et(this.layer.url,R,!0);const O=at(this.layer.url,R||null);e!=null&&e.returnServiceEditsOption?(d.edits=JSON.stringify([{id:a.layerId,adds:u,updates:c,deletes:p,attachments:h,assetMaps:i}]),d.returnServiceEditsOption=vt.toJSON(e==null?void 0:e.returnServiceEditsOption),d.returnServiceEditsInSourceSR=e==null?void 0:e.returnServiceEditsInSourceSR):(d.adds=u.length?JSON.stringify(u):null,d.updates=c.length?JSON.stringify(c):null,d.deletes=p.length?n?JSON.stringify(p):p.join(","):null,d.attachments=h&&JSON.stringify(h),d.assetMaps=i!=null?JSON.stringify(i):void 0);const f=this._getLayerRequestOptions({method:"post",query:d});O&&(f.authMode="immediate",f.query.returnEditMoment=!0,f.query.sessionId=st);const S=e!=null&&e.returnServiceEditsOption?a.url:a.parsedUrl.path;let I;try{I=m?await this._asyncApplyEdits(S+"/applyEdits",f):await y(S+"/applyEdits",f)}catch(b){if(!xt(b))throw b;f.authMode="immediate",I=m?await this._asyncApplyEdits(S+"/applyEdits",f):await y(S+"/applyEdits",f)}if(!((E=a.capabilities.operations)!=null&&E.supportsEditing)&&((J=(N=a.effectiveCapabilities)==null?void 0:N.operations)!=null&&J.supportsEditing)){const b=(k=rt)==null?void 0:k.findCredential(a.url);await(b==null?void 0:b.refreshToken())}return this._createEditsResult(I)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await x(a,"editing");const s=t.attributes[a.objectIdField],r=a.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await y(r,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(w)}catch(n){throw this._createAttachmentErrorResult(s,n)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:s,url:r}=this.layer,{data:n}=await y(`${r}/${s}`,a),{id:i,extent:o,fullExtent:u,timeExtent:l}=n,c=o||u;return{id:i,fullExtent:c&&nt.fromJSON(c),timeExtent:l&&it.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){var s;await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return(s=t.outStatistics)!=null&&s.length&&a.features.length&&a.features.forEach(r=>{var i;const n=r.attributes;(i=t.outStatistics)==null||i.forEach(({outStatisticFieldName:o})=>{if(o){const u=o.toLowerCase();u&&u in n&&o!==u&&(n[o]=n[u],delete n[u])}})}),a}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!ot(this.layer.url))return"unavailable";const t=U(this.layer.url,"status"),e=await y(t,{query:{f:"json"}});return Tt.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await ut(()=>import("./uploadAssets-aQgp-D__.js"),__vite__mapDeps([0,1,2,3]));return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}async _asyncApplyEdits(t,e){const a=(await y(t,e)).data.statusUrl;for(;;){const s=(await y(a,{query:{f:"json"},responseType:"json"})).data;switch(s.status){case"Completed":return y(s.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new F("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new F("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await lt(Mt)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const s={};C("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),e!=null&&e.cacheBust&&(s._ts=Date.now());const{data:r}=await y(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:e==null?void 0:e.signal}));t=r}this.sourceJSON=await this._patchServiceJSON(t,e==null?void 0:e.signal);const a=t.type;if(!$t.has(a))throw new F("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){var a;if(t.type!=="Table"&&t.geometryType&&!((a=t==null?void 0:t.drawingInfo)!=null&&a.renderer)&&!t.defaultSymbol){const s=wt(t.geometryType).renderer;dt("drawingInfo.renderer",s,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:s}=await y(this.layer.url,this._getLayerRequestOptions({signal:e}));s.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){ct(s)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!(e!=null&&e.length))return null;const a=await this._filterRedundantAssetMaps(e);if(!(e!=null&&e.length))return null;const s=new Array,r=new Map;for(const n of a){const{geometry:i}=n,{vertexSpace:o}=i;if(o.isRelative)s.push(i);else{const u=At(i);r.set(u,i),n.geometry=u,s.push(u)}}await this.uploadAssets(s);for(const[n,i]of r)i.addExternalSources(n.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(a),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,s=this.layer.parsedUrl;for(const r of t){const n=r.geometry,{metadata:i}=n,o=i.getExternalSourcesOnService(s),u=r.getAttribute(a);if(o.length===0){$.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=o.find(ft)??o[0],{vertexSpace:c}=n,p=c.isGeoreferenced?["PROJECT_VERTICES"]:[];for(const h of l)h.parts.length===1?e.push({globalId:pt(),parentGlobalId:u,assetName:h.assetName,assetHash:h.parts[0].partHash,flags:p}):$.getLogger(this).error(`Skipping asset ${h.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,s=[];let r=null;if(Array.isArray(e))for(const i of e)s.push({id:i.id,editedFeatures:i.editedFeatures}),i.id===a&&(r={addResults:i.addResults??[],updateResults:i.updateResults??[],deleteResults:i.deleteResults??[],attachments:i.attachments,editMoment:i.editMoment});else r=e;const n=Et(r);if(s.length>0){n.editedFeatureResults=[];for(const i of s){const{editedFeatures:o}=i,u=o!=null&&o.spatialReference?new ht(o.spatialReference):null;n.editedFeatureResults.push({layerId:i.id,editedFeatures:_t(o,u)})}}return n}_createAttachmentErrorResult(t,e){var r;const a=((r=e.details.messages)==null?void 0:r[0])||e.message,s=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new F("feature-layer-source:attachment-failure",a,{code:s})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const s in e){const r=e[s];r!=null&&(a.set?a.set(s,r):a.append(s,r))}return a}_getLayerRequestOptions(t={}){const{parsedUrl:e,gdbVersion:a,dynamicDataSource:s}=this.layer;return{...t,query:{gdbVersion:a,layer:s?JSON.stringify({source:s}):void 0,...e.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _filterRedundantAssetMaps(t){const{layer:e}=this,{globalIdField:a,infoFor3D:s,parsedUrl:r}=e;if(s==null||a==null)return t;const n=yt(s);if(n==null)return t;const i=U(r.path,`../${n.id}`),o=new Array,u=new Array;for(const d of t)d.geometry.metadata.getExternalSourcesOnService(r).length>0?u.push(d):o.push(d);const l=u.map(d=>d.getAttribute(a)).filter(M);if(l.length===0)return t;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=s,h=new mt;h.where=`${c} IN (${l.map(d=>`'${d}'`)})`,h.outFields=[p,c],h.returnGeometry=!1;const m=await St(i,h),{features:R}=m;return R.length===0?t:[...o,...u.filter(d=>{const O=d.getAttribute(a);if(!O)return!0;const{metadata:f}=d.geometry,S=R.filter(g=>g.getAttribute(c)===O);if(S.length===0)return!0;const I=S.map(g=>g.getAttribute(p));return f.getExternalSourcesOnService(r).flatMap(({source:g})=>g.flatMap(q=>q.parts.map(E=>E.partHash))).some(g=>I.every(q=>g!==q))})]}};_([T()],A.prototype,"type",void 0),_([T({constructOnly:!0})],A.prototype,"layer",void 0),_([T({readOnly:!0})],A.prototype,"queryTask",null),A=_([B("esri.layers.graphics.sources.FeatureLayerSource")],A);const Mt=1e3,zt=A;export{zt as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/uploadAssets-aQgp-D__.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/External-GV0jSEES.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/FeatureLayerView3D-t6NDkLO0.js b/dist/assets/FeatureLayerView3D-t6NDkLO0.js new file mode 100644 index 0000000..82e27c5 --- /dev/null +++ b/dist/assets/FeatureLayerView3D-t6NDkLO0.js @@ -0,0 +1 @@ +import{e as i,y as a,c as s,fn as m,bK as l,E as o,ct as n}from"./index-J0iiHjMT.js";import{_ as y}from"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./LayerView3D-iOx2MD1g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";let t=class extends y{constructor(){super(...arguments),this.type="feature-3d",this.direct3DObjectFeatureLayerDisplayEnabled=m()}initialize(){var p;const{layer:e,view:r}=this;(p=l(e))!=null&&p.operations.supportsQuery||this.addResolvingPromise(Promise.reject(new o("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e}))),e.infoFor3D!=null&&(this.direct3DObjectFeatureLayerDisplayEnabled?this._set("suspendResumeExtentMode","computed"):this.addResolvingPromise(Promise.reject(new o("featurelayerview3d:unsupported-geometry-type",`Unsupported geometry type ${e.geometryType}`)))),e.geometryType!=="mesh"||n(e.spatialReference,r.spatialReference)||this.addResolvingPromise(Promise.reject(new o("layerview:spatial-reference-incompatible","The spatial references of the feature layer is incompatible with the spatial reference of the view")))}get featureSpatialReference(){var e,r;return(r=(e=this.view.featureTiles)==null?void 0:e.tilingScheme)==null?void 0:r.spatialReference}};i([a({constructOnly:!0})],t.prototype,"direct3DObjectFeatureLayerDisplayEnabled",void 0),i([a()],t.prototype,"layer",void 0),t=i([s("esri.views.3d.layers.FeatureLayerView3D")],t);const A=t;export{A as default}; diff --git a/dist/assets/FeatureLayerViewBase3D-VurTj7t3.js b/dist/assets/FeatureLayerViewBase3D-VurTj7t3.js new file mode 100644 index 0000000..a0c7b39 --- /dev/null +++ b/dist/assets/FeatureLayerViewBase3D-VurTj7t3.js @@ -0,0 +1 @@ +import{ar as S,ls as B,dw as U,S as k,nI as N,e as o,y as l,c as g,p as v,s as J,jP as z,nJ as L,n as M,Z as Y,dC as K,jW as W,d as P,A as C,fl as T,nK as D,fH as Q,ca as V,fS as j,d6 as X,nL as A,nM as ee,nN as Z,nO as te,nP as re,nH as q,nQ as O,E as b,fG as R,d1 as se,fI as ie,G as _,P as G,F as ae,nR as oe,fi as ne}from"./index-J0iiHjMT.js";import{I as le,E as ue,T as ce}from"./HeatmapDensity.glsl-y7dUg--m.js";import{n as de}from"./LayerView3D-iOx2MD1g.js";import{E as pe,c as he}from"./query-rG0aX6cE.js";import{r as ye}from"./EventedSet-JGlFrfoR.js";import{w as me}from"./FeatureEffect-5bEV-xG1.js";import{u as fe}from"./LayerView-efDufa6j.js";import{a as ge}from"./RefreshableLayerView-Pd4dLcWr.js";class Fe{constructor(r){this._controller=r,this._handle=new _e(e=>r.schedule(e))}destroy(){this._handle.destroy()}invoke(r,e){return r.buffer&&r.buffer.byteLength!==0?(r.options.sourceSpatialReference&&r.options.sourceSpatialReference instanceof S&&(r.options={...r.options,sourceSpatialReference:r.options.sourceSpatialReference.toJSON()}),this._handle.invoke(r,e).then(s=>{let i=0,a=0;const d=S.fromJSON(s.spatialReference);s.spatialReference=d;const n=async c=>{if(s.fields){for(;in(u))}for(;an(h))}return s};return this._controller.schedule(c=>n(c))})):Promise.resolve(null)}}function we(t){switch(t.type){case"polyline":t.paths.reduce((r,e)=>r+e.length,0)r.map(e=>[e[0],e[1],e[2]])):t.paths.map(r=>r.map(e=>[e[0],e[1]])));break;case"polygon":t.rings.reduce((r,e)=>r+e.length,0)r.map(e=>[e[0],e[1],e[2]])):t.rings.map(r=>r.map(e=>[e[0],e[1]])))}}let _e=class extends B{constructor(r){super("PBFDecoderWorker","_parseFeatureQuery",{_parseFeatureQuery:e=>[e.buffer]},r)}},f=class extends v{constructor(t){super(t)}get queryFeaturesDehydrated(){var i;const t=this.layer.capabilities,r=t&&t.query,e=r&&r.supportsFormatPBF,s=this.layer.parsedUrl;if(e){this._decoder==null&&(this._decoder=new Fe(this.controller));const a={sourceSpatialReference:((i=this.layer.spatialReference)==null?void 0:i.toJSON())??null,applyTransform:!0,maxStringAttributeLength:1024};return(d,n)=>pe(s,d,"pbf",this._createRequestOptions(n)).then(c=>(J(n),this._decoder!=null?this._decoder.invoke({buffer:c.data,options:a},n.signal):Promise.reject(z())))}return(a,d)=>he(s,a,this.layer.spatialReference,this._createRequestOptions(d)).then(n=>L(n.data))}queryFeatureCount(t,r){return this.layer.queryFeatureCount(t,r)}destroy(){this._decoder=M(this._decoder)}_createRequestOptions(t){return{...t,query:{...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query}}}};o([l({constructOnly:!0})],f.prototype,"layer",void 0),o([l({constructOnly:!0})],f.prototype,"controller",void 0),o([l({readOnly:!0})],f.prototype,"queryFeaturesDehydrated",null),f=o([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],f);let F=class extends v{constructor(t){super(t)}queryFeaturesDehydrated(t,r){return this.layer.queryFeatures(t,r)}queryFeatureCount(t,r){return this.layer.queryFeatureCount(t,r)}};o([l({constructOnly:!0})],F.prototype,"layer",void 0),o([l({readOnly:!0})],F.prototype,"queryFeaturesDehydrated",null),F=o([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceMeshQuery3D")],F);let x=class extends v{constructor(t){super(t)}queryFeaturesDehydrated(t,r){return this.layer.queryFeatures(t,r)}};o([l({constructOnly:!0})],x.prototype,"layer",void 0),x=o([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileServiceQuery3D")],x);let w=class extends v{constructor(t){super(t)}queryFeaturesDehydrated(t,r){return this.source.queryFeaturesJSON(t,r).then(L,e=>{if(e&&e.name==="query-features-json:unsupported")return this.layer.queryFeatures(t,r);throw e})}queryFeatureCount(t,r){return this.layer.queryFeatureCount(t,r)}};function be(t,r){return t.type==="feature"&&t.source.type==="feature-layer"?t.infoFor3D!=null?new F({layer:t}):new f({layer:t,controller:r}):t.type==="feature"&&t.source.type==="memory"||t.type==="csv"||t.type==="geojson"||t.type==="oriented-imagery"||t.type==="wfs"?new w({layer:t,source:t.source}):t.type==="ogc-feature"?new x({layer:t}):null}o([l({constructOnly:!0})],w.prototype,"layer",void 0),o([l({constructOnly:!0})],w.prototype,"source",void 0),w=o([g("esri.views.3d.layers.support.featureTileQuery3D.FeatureTileClientQuery3D")],w);class xe{constructor(r){this._memoryCache=null,this._capabilities=null;const e=r.layerView.layer;this._layerView=r.layerView,this.objectIdField=e.objectIdField,this.globalIdField="globalIdField"in e?e.globalIdField:null,this._returnZ=r.returnZ,this._returnM=r.returnM;const s=this._layerView.view.resourceController;this.query=be(e,s.normal),s&&this._memoryCacheEnabled&&(this._memoryCache=s.memoryController.newCache(`fl-${e.uid}`))}get _memoryCacheEnabled(){switch(this._layerView.layer.source.type){case"feature-layer":case"ogc-feature":case"oriented-imagery":return!0;case"csv":case"geojson":case"memory":case"wfs":return!1}}destroy(){this._memoryCache=M(this._memoryCache),this.query.destroy()}createQuery(){const r=this._layerView.layer.createQuery();return r.outFields=this._layerView.availableFields,r.returnZ=this._returnZ,r.returnM=this._returnM,r.outSpatialReference=this.tilingScheme.spatialReference,r}get memoryCache(){return this._memoryCache}get viewingMode(){return this._layerView.view.state.viewingMode}get tilingScheme(){return this._layerView.view.featureTiles.tilingScheme}get scheduler(){const r=this._layerView.view.resourceController;return r?r.scheduler:null}get geometryType(){return this._layerView.layer.geometryType}get fullExtent(){return this._layerView.layer.fullExtent}get tileMaxRecordCount(){return this._layerView.layer.capabilities.query.tileMaxRecordCount}get maxRecordCount(){return this._layerView.layer.capabilities.query.maxRecordCount}get capabilities(){return this._capabilities!=null||(this._capabilities=le(this._layerView.layer)),this._capabilities}logFetchError(r,e){r.error("#fetchTile()",this._layerView.layer,(e==null?void 0:e.message)??e)}}const H="esri.views.layers.FeatureLayerView",E=Y.getLogger(H),ve=t=>{let r=class extends t{constructor(...e){super(...e),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([P(()=>{var s;const e=this.layer;return[(s=e==null?void 0:e.elevationInfo)==null?void 0:s.featureExpressionInfo,e&&"displayField"in e?e.displayField:null,e&&"timeInfo"in e&&e.timeInfo,e&&"renderer"in e&&e.renderer,e&&"labelingInfo"in e&&e.labelingInfo,e&&"floorInfo"in e&&e.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),C),T(()=>{var e;return(e=this.view)==null?void 0:e.floors},"change",()=>this._handleRequiredFieldsChange()),T(()=>{const e=this.layer;return e&&"sublayers"in e?e.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){const{layer:e,layer:{fieldsIndex:s},requiredFields:i}=this;return"outFields"in e&&e.outFields?D(s,[...Q(s,e.outFields),...i]):D(s,i)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(e){this._override("featureEffect",e)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){E.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(e){throw new Error("missing implementation")}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},s=this.filter!=null?this.filter.createQuery(e):new V(e);if(this.layer.type==="feature"){const i=j(this);i!=null&&(s.where=s.where?`(${s.where}) AND (${i})`:i)}return this.timeExtent!=null&&(s.timeExtent=s.timeExtent!=null?s.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),s}createAggregateQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new V(e)}queryFeatures(e,s){throw new Error("missing implementation")}queryObjectIds(e,s){throw new Error("missing implementation")}queryFeatureCount(e,s){throw new Error("missing implementation")}queryExtent(e,s){throw new Error("missing implementation")}async fetchPopupFeatures(e,s){const i=this.validateFetchPopupFeatures(s);if(i)throw i;return this.fetchClientPopupFeatures(s)}_loadArcadeModules(e){var s;return(s=e.expressionInfos)!=null&&s.length||Array.isArray(e.content)&&e.content.some(i=>i.type==="expression")?X():Promise.resolve()}_handleRequiredFieldsChange(){const e=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",e),e.then(()=>{this._updatingRequiredFieldsPromise===e&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const e=this.view.type==="3d",{layer:s,layer:{fieldsIndex:i,objectIdField:a}}=this,d="renderer"in s&&s.renderer,n="orderBy"in s&&s.orderBy,c="featureReduction"in s?s.featureReduction:null,u=new Set,h=await Promise.allSettled([d?d.collectRequiredFields(u,i):null,A(u,s),e?ee(u,s):null,this.filter!=null?Z(u,s,this.filter):null,this.featureEffect!=null?Z(u,s,this.featureEffect.filter):null,c?te(u,s,c):null,n?re(u,s,n):null]);if("timeInfo"in s&&s.timeInfo&&this.timeExtent&&q(u,s.fieldsIndex,[s.timeInfo.startField,s.timeInfo.endField]),s.type==="feature"&&(s.floorInfo&&q(u,s.fieldsIndex,[s.floorInfo.floorField]),e&&s.infoFor3D!=null&&(s.globalIdField==null&&E.error("globalIdField missing on 3DObjectFeatureLayer"),q(u,s.fieldsIndex,[s.globalIdField]))),s.type==="subtype-group"){O(u,i,s.subtypeField);const y=s.sublayers.map(I=>{var $;return Promise.all([($=I.renderer)==null?void 0:$.collectRequiredFields(u,i),A(u,I)])});await Promise.allSettled(y)}for(const y of h)y.status==="rejected"&&E.error(y.reason);O(u,i,a),e&&"displayField"in s&&s.displayField&&O(u,i,s.displayField);const m=Array.from(u).sort();this._set("requiredFields",m)}validateFetchPopupFeatures(e){if(e==null)return null;for(const s of e.clientGraphics??[]){const i=s.layer;if("popupEnabled"in i&&!i.popupEnabled)return new b("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i});if(s.isAggregate){const a="featureReduction"in i?i.featureReduction:null;if(!(a&&"popupTemplate"in a&&a.popupEnabled&&a.popupTemplate))return new b("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:i})}else if("popupTemplate"in i&&!R(i,e))return new b("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:i})}}async fetchClientPopupFeatures(e){const s=e!=null?e.clientGraphics:null;if(!s||s.length===0)return[];const i=new Array(s.length),a=new Map,d=await this.createPopupQuery(e);for(let n=0;nn.layer):[this.layer];for(const n of d){if(!("popupEnabled"in n))continue;const c=R(n,e);if(c==null)continue;const u=await this._loadArcadeModules(c),h=u&&u.arcadeUtils.hasGeometryOperations(c);a=!(this.layer.geometryType!=="point"&&!h);const m=await ie(this.layer,c);for(const y of m)i.add(y)}if(s.returnGeometry=a,s.returnZ=a,s.returnM=a,s.outFields=Array.from(i),s.outSpatialReference=this.view.spatialReference,this.layer.type==="feature"){const n=j(this);n!=null&&(s.where=s.where?`(${s.where}) AND (${n})`:n)}return s}canResume(){return!!super.canResume()&&(this.timeExtent==null||!this.timeExtent.isEmpty)}};return o([l()],r.prototype,"_updatingRequiredFieldsPromise",void 0),o([l({readOnly:!0})],r.prototype,"availableFields",null),o([l({readOnly:!0})],r.prototype,"dataUpdating",void 0),o([l({type:me})],r.prototype,"featureEffect",null),o([l({type:K})],r.prototype,"filter",void 0),o([l(W)],r.prototype,"timeExtent",void 0),o([l()],r.prototype,"layer",void 0),o([l({type:Number})],r.prototype,"maximumNumberOfFeatures",null),o([l({readOnly:!0,type:Boolean})],r.prototype,"maximumNumberOfFeaturesExceeded",null),o([l({readOnly:!0})],r.prototype,"requiredFields",void 0),o([l()],r.prototype,"suspended",void 0),o([l()],r.prototype,"view",void 0),r=o([g(H)],r),r};let p=class extends ge(ue(ve(de(fe)))){constructor(t){super(t),this._controllerTotal=0,this._processorTotal=0,this.suspendResumeExtentMode="data"}initialize(){this.addHandles(P(()=>this._updatingRequiredFieldsPromise,t=>this._updatingHandles.addPromise(t),C))}destroy(){this._updatingHandles.removeAll(),this._fetcherContext=M(this._fetcherContext)}get maximumNumberOfFeatures(){var t;return((t=this.controller)==null?void 0:t.maximumNumberOfFeatures)??this._get("maximumNumberOfFeatures")}set maximumNumberOfFeatures(t){this._set("maximumNumberOfFeatures",t),this.controller&&(this.controller.maximumNumberOfFeatures=t)}get maximumNumberOfFeaturesExceeded(){return!!this.controller&&!(this.suspended||!this.controller.maximumNumberOfFeaturesExceeded)}get updatingProgressValue(){var e,s;let t=0;if((e=this.controller)!=null&&e.updating){const i=this.controller.updatingRemaining,a=Math.max(this.controller.updatingTotal,this._controllerTotal);a>0&&(t=(a-i)/a,this._controllerTotal=a)}let r=0;if((s=this.processor)!=null&&s.updating){const i=this.processor.updatingRemaining,a=Math.max(i,this._processorTotal);a>0&&(r=(a-i)/a,this._processorTotal=a)}return .5*(t+r)}get updatePolicy(){if(!this.controller)return _.ASYNC;switch(this.controller.mode){case"snapshot":{const t=qe.get(this.layer.geometryType);return t==null||this.controller.serviceDataCount>t?_.ASYNC:_.SYNC}case"tiles":return _.ASYNC}}get hasZ(){const t=this.layer,r=t.capabilities&&t.capabilities.data;return!(!r||!r.supportsZ)&&("returnZ"in t&&t.returnZ!=null?t.returnZ:r.supportsZ)}get hasM(){const t=this.layer,r=t.capabilities&&t.capabilities.data;return!(!r||!r.supportsM)&&"returnM"in t&&t.returnM!=null&&t.returnM}setVisibility(t,r){var e;(e=this.processor)==null||e.setObjectIdVisibility(t,r)}createQuery(){return super.createQuery()}queryFeatures(t,r){const e=()=>super.queryFeatures(t,r);return this.layer.geometryType==="mesh"?this._queryFeaturesMesh(this._ensureQuery(t),e):e()}beforeSetController(t){t.maximumNumberOfFeatures=this.maximumNumberOfFeatures}createController(){this._fetcherContext=new xe({layerView:this,returnZ:this.hasZ,returnM:this.hasM});const t=new ce({layerView:this,context:this._fetcherContext,graphics:new ye,extent:this.clippingExtent});return this._updatingHandles.add(()=>t.serviceDataExtent,r=>{this.processor&&(this.processor.dataExtent=r)},G),this.addHandles(P(()=>this.suspended,r=>{r?t.suspend():t.resume()},C)),this._updatingHandles.add(()=>{var r;return(r=this.processor)==null?void 0:r.displayFeatureLimit},r=>t.displayFeatureLimit=r,G),this.addHandles(ae(()=>!this.updating,()=>{this._controllerTotal=0,this._processorTotal=0})),t}async doRefresh(t){t&&!this.suspended&&this.controller&&this.controller.refetch(),this.processor.refreshFilter()}get usedMemory(){var t,r;return(((t=this.processor)==null?void 0:t.usedMemory)??0)+(((r=this.controller)==null?void 0:r.memoryForUnusedFeatures)??0)}get unloadedMemory(){var i,a,d,n;const t=((i=this.processor)==null?void 0:i.unprocessedMemoryEstimate)??0,r=((a=this.controller)==null?void 0:a.expectedFeatureDiff)??0,e=((d=this.processor)==null?void 0:d.loadedFeatures)??0,s=e+r>0?e/(e+r):1;return t+r*(((n=this.processor)==null?void 0:n.usedMemoryPerFeature)??0)*s}get ignoresMemoryFactor(){var t;return(t=this.controller)==null?void 0:t.hasMaximumNumberOfFeaturesOverride}async _queryFeaturesMesh(t,r){await this._validateQueryFeaturesMesh(t);const e=await r();if(t!=null&&t.outStatistics||this.graphics3DProcessor==null)return e;const s=this.layer.objectIdField,i=this.graphics3DProcessor.graphics3DGraphicsByObjectID,a=[];for(const d of e.features)if(d.geometry){const n=i.get(d.attributes[s]);n&&(d.geometry=oe(n.graphic.geometry),a.push(d))}else a.push(d);return e.features=a,e}async _validateQueryFeaturesMesh(t){if(!t)return;const r=s=>{throw new b("feature-layer-view:unsupported-query",`Queries on Mesh feature collection layers do not support '${s}'`)},e=["quantizationParameters","geometryPrecision","maxAllowableOffset"];for(const s of e)t[s]!=null&&r(s);"returnM"in t&&t.returnM&&r("returnM"),"returnCentroid"in t&&t.returnCentroid&&r("returnCentroid"),t.outSpatialReference==null||t.outSpatialReference.equals(this.view.spatialReference)||r("outSpatialReference")}get performanceInfo(){var s,i,a,d;const t=(s=this.controller)==null?void 0:s.displayFeatureLimit,r=t!=null?t.averageSymbolComplexity:void 0,e=r!=null?`f:${r.verticesPerFeature},v:${r.verticesPerCoordinate}`:"n/a";return{...this._getResourceInfo(),partial:this.maximumNumberOfFeaturesExceeded,mode:((i=this.controller)==null?void 0:i.mode)??"n/a",symbolComplexity:e,nodes:((a=this.controller)==null?void 0:a.tileDescriptors.length)??0,...((d=this.controller)==null?void 0:d.performanceInfo)??{storedFeatures:0,totalVertices:0}}}get test(){var t;return{updatePolicy:this.updatePolicy,controller:this.controller,loadedGraphics:(t=this.controller)==null?void 0:t.graphics}}};o([l()],p.prototype,"layer",void 0),o([l()],p.prototype,"controller",void 0),o([l()],p.prototype,"_controllerTotal",void 0),o([l()],p.prototype,"_processorTotal",void 0),o([l()],p.prototype,"maximumNumberOfFeatures",null),o([l()],p.prototype,"maximumNumberOfFeaturesExceeded",null),o([l(ne)],p.prototype,"updatingProgress",void 0),o([l({readOnly:!0})],p.prototype,"updatingProgressValue",null),o([l({readOnly:!0})],p.prototype,"updatePolicy",null),o([l({readOnly:!0})],p.prototype,"hasZ",null),o([l({readOnly:!0})],p.prototype,"hasM",null),o([l()],p.prototype,"suspendResumeExtentMode",void 0),p=o([g("esri.views.3d.layers.FeatureLayerViewBase3D")],p);const qe=new Map([["point",5e3],["polygon",500],["polyline",1e3]]),Ne=p;export{Ne as _}; diff --git a/dist/assets/FeatureReductionLayer-RlitE1N6.js b/dist/assets/FeatureReductionLayer-RlitE1N6.js new file mode 100644 index 0000000..dc398b2 --- /dev/null +++ b/dist/assets/FeatureReductionLayer-RlitE1N6.js @@ -0,0 +1 @@ +import{dq as Q,e as r,y as l,c as g,dr as T,bI as c,iw as A,iJ as D,iI as L,iu as N,iv as B,du as E,iM as O,dt as $,oA as I,dD as J,ja as z,jb as U,l1 as b,oB as W,jg as X,oC as G,mx as Y,oD as q,oE as M,Z as ee,dJ as H,oF as te,oG as w,oH as Z,E as ie,d as se,C as ne}from"./index-J0iiHjMT.js";let h=class extends Q(T){constructor(t){super(t),this.expression=null,this.title=null,this.returnType=null}};r([l({type:String,json:{write:!0}})],h.prototype,"expression",void 0),r([l({type:String,json:{write:!0}})],h.prototype,"title",void 0),r([l({type:String,json:{write:!0}})],h.prototype,"returnType",void 0),h=r([g("esri.layers.support.ExpressionInfo")],h);const V=h;var F;let f=F=class extends T{constructor(e){super(e),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new F({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:c(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};r([l({type:Boolean,json:{write:!0}})],f.prototype,"isAutoGenerated",void 0),r([l({type:String,json:{write:!0}})],f.prototype,"name",void 0),r([l({type:String,json:{write:!0}})],f.prototype,"alias",void 0),r([l({type:String,json:{write:!0}})],f.prototype,"onStatisticField",void 0),r([l({type:V,json:{write:!0}})],f.prototype,"onStatisticExpression",void 0),r([l({type:String,json:{write:!0}})],f.prototype,"statisticType",void 0),f=F=r([g("esri.layers.support.AggregateField")],f);const m=f;var _;const re="esri.layers.support.FeatureReductionBinning";let d=_=class extends I{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(e,t,s){const n=e.filter(o=>o.statisticType!=="avg_angle").map(o=>o.toJSON());J(s,n,t)}readRenderer(e,t,s){var o;const n=(o=t.drawingInfo)==null?void 0:o.renderer;return n?z(n,t,s)??void 0:U(t,s)}clone(){return new _({fields:c(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:c(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:c(this.popupTemplate),renderer:c(this.renderer)})}};r([A({binning:"binning"})],d.prototype,"type",void 0),r([A({geohash:"geohash"})],d.prototype,"binType",void 0),r([l({type:Number,range:{min:1,max:9},json:{write:!0}})],d.prototype,"fixedBinLevel",void 0),r([l({type:[D],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],d.prototype,"labelingInfo",void 0),r([l(L)],d.prototype,"labelsVisible",void 0),r([l({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],d.prototype,"maxScale",void 0),r([l(N)],d.prototype,"popupEnabled",void 0),r([l({type:B,json:{name:"popupInfo",write:!0}})],d.prototype,"popupTemplate",void 0),r([l({type:[m],json:{write:!0}})],d.prototype,"fields",void 0),r([E("fields")],d.prototype,"writeFields",null),r([l({types:O,json:{write:{target:"drawingInfo.renderer"}}})],d.prototype,"renderer",void 0),r([$("renderer",["drawingInfo.renderer"])],d.prototype,"readRenderer",null),d=_=r([g(re)],d);const K=d;var j;const oe="esri.layers.support.FeatureReductionCluster";function C(e){var t;return e.type==="simple"&&!((t=e.visualVariables)!=null&&t.length)}let p=j=class extends T{constructor(e){super(e),this.type="cluster",this.clusterRadius=b("80px"),this.clusterMinSize=b("12px"),this.clusterMaxSize=b("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(e,t,s){var o,i;const n=(o=t.drawingInfo)==null?void 0:o.renderer;return(i=n==null?void 0:n.authoringInfo)!=null&&i.isAutoGenerated?null:n?C(n)?null:z(n,t,s)??void 0:U(t,s)}readSymbol(e,t,s){var o,i;const n=(o=t.drawingInfo)==null?void 0:o.renderer;if((i=n==null?void 0:n.authoringInfo)!=null&&i.isAutoGenerated)return null;if(n&&C(n)){const a=z(n,t,s);return a==null?void 0:a.symbol}return null}writeSymbol(e,t,s,n){var i,a;const o=(a=(i=this.renderer)==null?void 0:i.authoringInfo)==null?void 0:a.isAutoGenerated;if(!this.renderer||o){const v=new X({symbol:e});t.drawingInfo={renderer:v.write({},n)}}}writeFields(e,t,s){const n=e.filter(o=>o.statisticType!=="avg_angle").map(o=>o.toJSON());J(s,n,t)}readFields(e,t,s){return e.filter(n=>!n.isAutoGenerated).map(n=>m.fromJSON(n))}clone(){return new j({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:c(this.labelingInfo),labelsVisible:this.labelsVisible,fields:c(this.fields),maxScale:this.maxScale,renderer:c(this.renderer),symbol:c(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:c(this.popupTemplate)})}};r([l({type:["cluster"],readOnly:!0,json:{write:!0}})],p.prototype,"type",void 0),r([l({type:Number,cast:e=>e==="auto"?e:b(e),json:{write:!0}})],p.prototype,"clusterRadius",void 0),r([l({type:Number,cast:b,json:{write:!0}})],p.prototype,"clusterMinSize",void 0),r([l({type:Number,cast:b,json:{write:!0}})],p.prototype,"clusterMaxSize",void 0),r([l({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],p.prototype,"maxScale",void 0),r([l(N)],p.prototype,"popupEnabled",void 0),r([l({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],p.prototype,"popupTemplate",void 0),r([l({types:O,json:{write:{target:"drawingInfo.renderer"}}})],p.prototype,"renderer",void 0),r([$("renderer",["drawingInfo.renderer"])],p.prototype,"readRenderer",null),r([l({types:W})],p.prototype,"symbol",void 0),r([$("symbol",["drawingInfo.renderer"])],p.prototype,"readSymbol",null),r([E("symbol")],p.prototype,"writeSymbol",null),r([l({type:[D],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],p.prototype,"labelingInfo",void 0),r([l(L)],p.prototype,"labelsVisible",void 0),r([l({type:[m],json:{write:!0}})],p.prototype,"fields",void 0),r([E("fields")],p.prototype,"writeFields",null),r([$("fields")],p.prototype,"readFields",null),p=j=r([g(oe)],p);const P=p,k={key:"type",base:I,typeMap:{cluster:P,binning:K}},le={types:{key:"type",base:I,typeMap:{selection:G,cluster:P,binning:K}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:k},"portal-item":{types:k},"web-scene":{types:{key:"type",base:I,typeMap:{selection:G}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:Y}}}}};var R;let S=R=class extends q{writeLevels(e,t,s){for(const n in e){const o=this.levels[n];return void(t.stops=o)}}clone(){var e,t;return new R({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:M(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:M(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:(e=this.stops)==null?void 0:e.map(s=>s.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:(t=this.legendOptions)==null?void 0:t.clone(),levels:c(this.levels)})}};r([l()],S.prototype,"levels",void 0),r([E("levels")],S.prototype,"writeLevels",null),S=R=r([g("esri.views.2d.engine.LevelDependentSizeVariable")],S);const ae=ee.getLogger("esri.views.2d.layers.support.clusterUtils");H.add("esri-cluster-arcade-enabled",!0);const ue=H("esri-cluster-arcade-enabled"),pe=(e,t,s,n,o)=>{const i=t.clone();if(!ye(i))return i;if(i.authoringInfo||(i.authoringInfo=new te),i.authoringInfo.isAutoGenerated=!0,"visualVariables"in i){const a=(i.visualVariables||[]).filter(u=>u.valueExpression!=="$view.scale"),v=de(a);a.forEach(u=>{u.type==="rotation"?u.field?u.field=y(e,u.field,"avg_angle","number"):u.valueExpression&&(u.field=x(e,u.valueExpression,"avg_angle","number"),u.valueExpression=null):u.normalizationField?(u.field=y(e,u.field,"avg_norm","number",u.normalizationField),u.normalizationField=null):u.field?u.field=y(e,u.field,"avg","number"):u.valueExpression&&(u.field=x(e,u.valueExpression,"avg","number"),u.valueExpression=null)}),v==null&&!ce(a)&&o&&(a.push(fe(s,n)),i.dynamicClusterSize=!0),i.visualVariables=a}switch(i.type){case"simple":break;case"pie-chart":for(const a of i.attributes)a.field?a.field=y(e,a.field,"sum","number"):a.valueExpression&&(a.field=x(e,a.valueExpression,"sum","number"),a.valueExpression=null);break;case"unique-value":i.field?i.field=y(e,i.field,"mode","string"):i.valueExpression&&(i.field=x(e,i.valueExpression,"mode","string"),i.valueExpression=null);break;case"class-breaks":i.normalizationField?(i.field=y(e,i.field,"avg_norm","number",i.normalizationField),i.normalizationField=null):i.field?i.field=y(e,i.field,"avg","number"):i.valueExpression&&(i.field=x(e,i.valueExpression,"avg","number"),i.valueExpression=null)}return i},de=e=>{for(const t of e)if(t.type==="size")return t;return null},ce=e=>{for(const t of e)if(t.field==="cluster_count")return!0;return!1},fe=(e,t)=>{const s=[new w({value:0,size:0}),new w({value:1})];if(t==null)return new q({field:"cluster_count",stops:[...s,new w({value:2,size:0})]});const n=Object.keys(t).reduce((o,i)=>({...o,[i]:[...s,new w({value:Math.max(2,t[i].minValue),size:e.clusterMinSize}),new w({value:Math.max(3,t[i].maxValue),size:e.clusterMaxSize})]}),{});return new S({field:"cluster_count",levels:n})},ye=e=>{const t=s=>ae.error(new ie("Unsupported-renderer",s,{renderer:e}));if(!e)return!1;switch(e.type){case"unique-value":if(e.field2||e.field3)return t("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(e.normalizationField){const s=e.normalizationType;if(s!=="field")return t(`FeatureReductionCluster does not support a normalizationType of ${s}`),!1}break;case"simple":case"pie-chart":break;default:return t(`FeatureReductionCluster does not support renderers of type ${e.type}`),!1}if(!ue){if("valueExpression"in e&&e.valueExpression)return t("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in e&&e.visualVariables||[]).some(s=>!(!("valueExpression"in s)||!s.valueExpression)))return t("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function me(e,t,s){switch(e){case"sum":return`cluster_sum_${t}`;case"avg":case"avg_angle":return`cluster_avg_${t}`;case"mode":return`cluster_type_${t}`;case"avg_norm":{const n=s,o="field",i=t.toLowerCase()+",norm:"+o+","+n.toLowerCase();return"cluster_avg_"+Z(i)}}}function x(e,t,s,n){const o=Z(t),i=s==="mode"?`cluster_type_${o}`:s==="sum"?`cluster_sum_${o}`:`cluster_avg_${o}`;return e.some(a=>a.name===i)||e.push(new m({name:i,isAutoGenerated:!0,onStatisticExpression:new V({expression:t,returnType:n}),statisticType:s})),i}function y(e,t,s,n,o){if(t==="cluster_count"||e.some(a=>a.name===t))return t;const i=me(s,t,o);return e.some(a=>a.name===i)||(s==="avg_norm"?e.push(new m({name:i,isAutoGenerated:!0,onStatisticExpression:new V({expression:`$feature.${t} / $feature.${o}`,returnType:n}),statisticType:"avg"})):e.push(new m({name:i,isAutoGenerated:!0,onStatisticField:t,statisticType:s}))),i}const be=e=>{let t=class extends e{constructor(...s){super(...s),this.addHandles(se(()=>this.renderer,()=>{if(this.featureReduction){const n=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",n)}},ne))}set featureReduction(s){const n=this._normalizeFeatureReduction(s);this._set("featureReduction",n)}set renderer(s){}_normalizeFeatureReduction(s){var v;if((s==null?void 0:s.type)!=="cluster")return s;const n=s.clone(),o=[new m({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],i=(n.fields??[]).filter(u=>!u.isAutoGenerated);if(s.renderer&&!((v=s.renderer.authoringInfo)!=null&&v.isAutoGenerated))return n.fields=[...o,...i],n;if(s.symbol)return n.fields=[...o,...i],n.renderer=null,n;if(!this.renderer)return s;const a=pe(o,this.renderer,s,null,!1);return n.fields=[...o,...i],n.renderer=a,n}};return r([l(le)],t.prototype,"featureReduction",null),t=r([g("esri.layers.mixins.FeatureReductionLayer")],t),t};export{be as c}; diff --git a/dist/assets/FeatureServiceSnappingSource-El1DZ1LB.js b/dist/assets/FeatureServiceSnappingSource-El1DZ1LB.js new file mode 100644 index 0000000..d23fceb --- /dev/null +++ b/dist/assets/FeatureServiceSnappingSource-El1DZ1LB.js @@ -0,0 +1,9 @@ +import{nX as W,os as J,ot as G,as as Z,ou as q,e as s,y as a,c as I,p as O,ov as B,d as _,C as j,ig as F,P as m,ow as Q,a2 as X,l as K,eD as Y,k as L,ah as ee,a as te,bB as ie,gG as ne,e3 as N,fe as se,ls as re,mH as ae,e$ as oe,T as le,f0 as de,ox as ue,oy as pe,gD as he,s as V,gC as ce,ao as f,fl as ye,fw as A,A as fe,oz as ge,b as _e,de as ve}from"./index-J0iiHjMT.js";import{o as we,a as Se}from"./queryEngineUtils-0F1SWi13.js";import{d as me}from"./TileTreeDebugger-2DVbY5sQ.js";import"./VertexSnappingCandidate-sgrBHAMS.js";import"./PointSnappingHint-ULetRXiW.js";function b(e,t){return J(t.extent,U),G(U,Z(Ie,e.x,e.y,0))}const U=W(),Ie=q();let y=class extends O{get tiles(){const t=this.tilesCoveringView,n=this.pointOfInterest!=null?this.pointOfInterest:this.view.center;return t.sort((r,i)=>b(n,r)-b(n,i)),t}_scaleEnabled(){return B(this.view.scale,this.layer.minScale||0,this.layer.maxScale||0)}get tilesCoveringView(){if(!this.view.ready||!this.view.featuresTilingScheme||!this.view.state||this.tileInfo==null)return[];if(!this._scaleEnabled)return[];const{spans:t,lodInfo:n}=this.view.featuresTilingScheme.getTileCoverage(this.view.state,0),{level:r}=n,i=[];for(const{row:o,colFrom:l,colTo:v}of t)for(let d=l;d<=v;d++){const u=n.normalizeCol(d),S=new F(null,r,o,u);this.tileInfo.updateTileInfo(S),i.push(S)}return i}get tileInfo(){var t;return((t=this.view.featuresTilingScheme)==null?void 0:t.tileInfo)??null}get tileSize(){return this.tileInfo!=null?this.tileInfo.size[0]:256}constructor(t){super(t),this.pointOfInterest=null}initialize(){this.addHandles(_(()=>{var t,n;return(n=(t=this.view)==null?void 0:t.state)==null?void 0:n.viewpoint},()=>this.notifyChange("tilesCoveringView"),j))}};s([a({readOnly:!0})],y.prototype,"tiles",null),s([a({readOnly:!0})],y.prototype,"_scaleEnabled",null),s([a({readOnly:!0})],y.prototype,"tilesCoveringView",null),s([a({readOnly:!0})],y.prototype,"tileInfo",null),s([a({readOnly:!0})],y.prototype,"tileSize",null),s([a({constructOnly:!0})],y.prototype,"view",void 0),s([a({constructOnly:!0})],y.prototype,"layer",void 0),s([a()],y.prototype,"pointOfInterest",void 0),y=s([I("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles2D")],y);let g=class extends O{get tiles(){const e=this.tilesCoveringView,t=this._effectivePointOfInterest;if(t!=null){const n=e.map(r=>b(t,r));for(let r=1;rn[r])return e.sort((i,o)=>b(t,i)-b(t,o)),e.slice()}return e}get tilesCoveringView(){var e,t;return this._filterTiles((t=(e=this.view.featureTiles)==null?void 0:e.tiles)==null?void 0:t.toArray()).map(He)}get tileInfo(){var e;return((e=this.view.featureTiles)==null?void 0:e.tilingScheme.toTileInfo())??null}get tileSize(){var e;return((e=this.view.featureTiles)==null?void 0:e.tileSize)??256}get _effectivePointOfInterest(){var t;const e=this.pointOfInterest;return e??((t=this.view.pointsOfInterest)==null?void 0:t.focus.location)}constructor(e){super(e),this.pointOfInterest=null}initialize(){this.addHandles(_(()=>this.view.featureTiles,e=>{this.removeHandles(D),e&&this.addHandles(e.addClient(),D)},m))}_filterTiles(e){return e==null?[]:e.filter(t=>Math.abs(t.measures.screenRect[3]-t.measures.screenRect[1])>be&&t.measures.visibility===Q.VISIBLE_ON_SURFACE)}};function He({lij:[e,t,n],extent:r}){return new F(`${e}/${t}/${n}`,e,t,n,r)}s([a({readOnly:!0})],g.prototype,"tiles",null),s([a({readOnly:!0})],g.prototype,"tilesCoveringView",null),s([a({readOnly:!0})],g.prototype,"tileInfo",null),s([a({readOnly:!0})],g.prototype,"tileSize",null),s([a({constructOnly:!0})],g.prototype,"view",void 0),s([a()],g.prototype,"pointOfInterest",void 0),s([a()],g.prototype,"_effectivePointOfInterest",null),g=s([I("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiles3D")],g);const be=50,D="feature-tiles";let k=class extends me{constructor(e){super(e)}initialize(){const e=setInterval(()=>this._fetchDebugInfo(),2e3);this.addHandles(X(()=>clearInterval(e)))}getTiles(){if(!this._debugInfo)return[];const e=new Map,t=new Map;this._debugInfo.storedTiles.forEach(i=>{e.set(i.data.id,i.featureCount)}),this._debugInfo.pendingTiles.forEach(i=>{e.set(i.data.id,i.featureCount),t.set(i.data.id,i.state)});const n=i=>{const o=t.get(i),l=e.get(i)??"?";return o?`${o}:${l} +${i}`:`store:${l} +${i}`},r=new Map;return this._debugInfo.storedTiles.forEach(i=>{r.set(i.data.id,i.data)}),this._debugInfo.pendingTiles.forEach(i=>{r.set(i.data.id,i.data)}),Array.from(r.values()).map(i=>({lij:[i.level,i.row,i.col],geometry:K.fromExtent(Y(i.extent,this.view.spatialReference)),label:n(i.id)}))}_fetchDebugInfo(){this.handle.getDebugInfo(null).then(e=>{this._debugInfo=e,this.update()})}};s([a({constructOnly:!0})],k.prototype,"handle",void 0),k=s([I("esri.views.interactive.snapping.featureSources.WorkerTileTreeDebugger")],k);let c=class extends O{get updating(){return this._updatingHandles.updating||this._workerHandleUpdating}constructor(e){super(e),this._updatingHandles=new L,this._suspendController=null,this.schedule=null,this.hasZ=!1,this.elevationAlignPointsInFeatures=async t=>{const n=[];for(const{points:r}of t.pointsInFeatures)for(const{z:i}of r)n.push(i);return{elevations:n,drapedObjectIds:new Set,failedObjectIds:new Set}},this.queryForSymbologySnapping=async()=>({candidates:[],sourceCandidateIndices:[]}),this.availability=0,this._workerHandleUpdating=!0,this._editId=0,this.updateOutFields=ee(async(t,n)=>{await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateOutFields",[...t],n)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},n))})}destroy(){this._suspendController=te(this._suspendController),this._workerHandle.destroy(),this._updatingHandles.destroy()}initialize(){this._workerHandle=new Oe(this.schedule,{alignElevation:async(e,{signal:t})=>({result:await this.elevationAlignPointsInFeatures(e.query,t)}),getSymbologyCandidates:async(e,{signal:t})=>({result:await this.queryForSymbologySnapping(e,t)})}),this.addHandles([this._workerHandle.on("notify-updating",({updating:e})=>this._workerHandleUpdating=e),this._workerHandle.on("notify-availability",({availability:e})=>this._set("availability",e))])}async setup(e,t){var i;const n=this._serviceInfoFromLayer(e.layer);if(n==null)return;const r={configuration:this._convertConfiguration(e.configuration),serviceInfo:n,spatialReference:e.spatialReference.toJSON(),hasZ:this.hasZ,elevationInfo:(i=e.layer.elevationInfo)==null?void 0:i.toJSON()};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("setup",r,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async configure(e,t){const n=this._convertConfiguration(e);await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("configure",n,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async refresh(e){await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("refresh",{},e)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},e))}async fetchCandidates(e,t){const{point:n,filter:r,coordinateHelper:i}=e,o={...e,point:ie(n[0],n[1],n[2],i.spatialReference.toJSON()),filter:r==null?void 0:r.toJSON()};return this._workerHandle.invoke(o,t)}async updateTiles(e,t){const n={tiles:e.tiles,tileInfo:e.tileInfo!=null?e.tileInfo.toJSON():null,tileSize:e.tileSize};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("updateTiles",n,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}async applyEdits(e,t){var l,v,d;const n=this._editId++,r={id:n};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("beginApplyEdits",r,t));const i=await this._updatingHandles.addPromise(ne(e.result,t)),o={id:n,edits:{addedFeatures:((l=i.addedFeatures)==null?void 0:l.map(({objectId:u})=>u).filter(N))??[],deletedFeatures:((v=i.deletedFeatures)==null?void 0:v.map(({objectId:u,globalId:S})=>({objectId:u,globalId:S})))??[],updatedFeatures:((d=i.updatedFeatures)==null?void 0:d.map(({objectId:u})=>u).filter(N))??[]}};await this._updatingHandles.addPromise(this._workerHandle.invokeMethod("endApplyEdits",o,t)),this._updatingHandles.addPromise(this._workerHandle.invokeMethod("whenNotUpdating",{},t))}getDebugInfo(e){return this._workerHandle.invokeMethod("getDebugInfo",{},e)}async notifyElevationSourceChange(){await this._workerHandle.invokeMethod("notifyElevationSourceChange",{})}async notifySymbologyChange(){await this._workerHandle.invokeMethod("notifySymbologyChange",{})}async setSymbologySnappingSupported(e){await this._workerHandle.invokeMethod("setSymbologySnappingSupported",e)}async setSuspended(e){var t;(t=this._suspendController)==null||t.abort(),this._suspendController=new AbortController,await this._workerHandle.invokeMethod("setSuspended",e,this._suspendController.signal)}_convertConfiguration(e){return{filter:e.filter!=null?e.filter.toJSON():null,customParameters:e.customParameters,viewType:e.viewType}}_serviceInfoFromLayer(e){var t,n;return e.geometryType==="multipatch"||e.geometryType==="mesh"?null:{url:((t=e.parsedUrl)==null?void 0:t.path)??"",fieldsIndex:e.fieldsIndex.toJSON(),geometryType:se.toJSON(e.geometryType),capabilities:e.capabilities,objectIdField:e.objectIdField,globalIdField:e.globalIdField,spatialReference:e.spatialReference.toJSON(),timeInfo:(n=e.timeInfo)==null?void 0:n.toJSON()}}};s([a({constructOnly:!0})],c.prototype,"schedule",void 0),s([a({constructOnly:!0})],c.prototype,"hasZ",void 0),s([a({constructOnly:!0})],c.prototype,"elevationAlignPointsInFeatures",void 0),s([a({constructOnly:!0})],c.prototype,"queryForSymbologySnapping",void 0),s([a({readOnly:!0})],c.prototype,"updating",null),s([a({readOnly:!0})],c.prototype,"availability",void 0),s([a()],c.prototype,"_workerHandleUpdating",void 0),c=s([I("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorkerHandle")],c);class Oe extends re{constructor(t,n){super("FeatureServiceSnappingSourceWorker","fetchCandidates",{},t,{strategy:"dedicated",client:n})}}let w=class extends O{get tiles(){return[new F("0/0/0",0,0,0,ae(-1e8,-1e8,1e8,1e8))]}get tileInfo(){return new oe({origin:new le({x:-1e8,y:1e8,spatialReference:this.layer.spatialReference}),size:[512,512],lods:[new de({level:0,scale:1,resolution:390625})],spatialReference:this.layer.spatialReference})}get tileSize(){return this.tileInfo.size[0]}constructor(e){super(e),this.pointOfInterest=null}};s([a({readOnly:!0})],w.prototype,"tiles",null),s([a({readOnly:!0})],w.prototype,"tileInfo",null),s([a({readOnly:!0})],w.prototype,"tileSize",null),s([a({constructOnly:!0})],w.prototype,"layer",void 0),s([a()],w.prototype,"pointOfInterest",void 0),w=s([I("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTilesSimple")],w);let p=class extends O{get _updateTilesParameters(){return{tiles:this._tilesOfInterest.tiles,tileInfo:this._tilesOfInterest.tileInfo,tileSize:this._tilesOfInterest.tileSize}}get _layerView(){var e;return(e=this.view)==null?void 0:e.allLayerViews.find(t=>t.layer===this._layer)}get _isSuspended(){var e;return ue(this._layer)&&!this._layer.sublayers.find(t=>t.visible)?!0:!!this.view&&(((e=this._layerView)==null?void 0:e.suspended)!==!1||!this.layerSource.enabled)}get updating(){var e;return((e=this._workerHandle)==null?void 0:e.updating)||this._updatingHandles.updating}get _outFields(){var S,T,C,$,P,E,M,x;const{view:e,_layerView:t,layerSource:n}=this,{layer:r}=n,{fieldsIndex:i,timeInfo:o,floorInfo:l,subtypeField:v}=r,d=t&&"filter"in t?t.filter:null,u=d!=null&&d.where&&d.where!=="1=1"?this._getOrLoadWhereFields(d.where,i):[];if(d!=null&&d.timeExtent&&o){const{startField:h,endField:H}=o,z=((S=i.get(h))==null?void 0:S.name)??h,R=((T=i.get(H))==null?void 0:T.name)??H;z&&u.push(z),R&&u.push(R)}if(e!=null&&e.map&&pe(e.map)&&((C=e.map.utilityNetworks)!=null&&C.find(h=>h.isUtilityLayer(r)))){const h=($=r.fieldsIndex.get("assetGroup"))==null?void 0:$.name,H=(P=r.fieldsIndex.get("assetType"))==null?void 0:P.name;h&&H&&(u.push(h),u.push(H))}if(r&&(l!=null&&l.floorField)&&((E=e==null?void 0:e.floors)!=null&&E.length)){const h=((M=i.get(l.floorField))==null?void 0:M.name)??l.floorField;h&&u.push(h)}if(v){const h=((x=i.get(v))==null?void 0:x.name)??v;h&&u.push(h)}return new Set(u)}get configuration(){const{view:e}=this,t=e!=null?e.type:"2d";return{filter:this._layer.createQuery(),customParameters:this._layer.customParameters,viewType:t}}get availability(){var e;return((e=this._workerHandle)==null?void 0:e.availability)??0}get _layer(){return this.layerSource.layer}constructor(e){super(e),this._updatingHandles=new L,this._workerHandle=null,this._debug=null,this._memoizedMakeGetGroundElevation=he(we)}initialize(){let e;const t=this.view;if(t!=null)switch(t.type){case"2d":this._tilesOfInterest=new y({view:t,layer:this._layer}),e=this._workerHandle=new c;break;case"3d":{const{resourceController:n}=t,r=this._layer;this._tilesOfInterest=new g({view:t}),e=this._workerHandle=new c({schedule:i=>n.immediate.schedule(i),hasZ:this._layer.hasZ&&(this._layer.returnZ??!0),elevationAlignPointsInFeatures:async(i,o)=>{const l=await t.whenLayerView(r);return V(o),l.elevationAlignPointsInFeatures(i,o)},queryForSymbologySnapping:async(i,o)=>{const l=await t.whenLayerView(r);return V(o),l.queryForSymbologySnapping(i,o)}}),this.addHandles([t.elevationProvider.on("elevation-change",({context:i})=>{const{elevationInfo:o}=r;ce(i,o)&&f(e.notifyElevationSourceChange())}),_(()=>r.elevationInfo,()=>f(e.notifyElevationSourceChange()),m),_(()=>{var i,o;return(o=(i=this._layerView)==null?void 0:i.processor)==null?void 0:o.renderer},()=>f(e.notifySymbologyChange()),m),_(()=>{var i;return((i=this._layerView)==null?void 0:i.symbologySnappingSupported)??!1},i=>f(e.setSymbologySnappingSupported(i)),m),ye(()=>{var i;return(i=this._layerView)==null?void 0:i.layer},["edits","apply-edits","graphic-update"],()=>e.notifySymbologyChange())]);break}}else this._tilesOfInterest=new w({layer:this._layer}),e=this._workerHandle=new c;this.addHandles([A(e)]),f(e.setup({layer:this._layer,spatialReference:this.spatialReference,configuration:this.configuration},null)),this._updatingHandles.add(()=>this._updateTilesParameters,()=>f(e.updateTiles(this._updateTilesParameters,null)),m),this.addHandles([_(()=>this.configuration,n=>f(e.configure(n,null)),j),_(()=>this._outFields,n=>f(e.updateOutFields(n)),m),_(()=>this._isSuspended,n=>f(e.setSuspended(n)),fe)]),t!=null&&this.addHandles(_(()=>ge.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES,n=>{n&&!this._debug?(this._debug=new k({view:t,handle:e}),this.addHandles(A(this._debug),"debug")):!n&&this._debug&&this.removeHandles("debug")},m)),this.addHandles(this.layerSource.layer.on("apply-edits",n=>{f(e.applyEdits(n,null))}))}destroy(){this._updatingHandles.destroy()}refresh(){var e;(e=this._workerHandle)==null||e.refresh(null)}async fetchCandidates(e,t){const{coordinateHelper:n,point:r}=e;this._tilesOfInterest.pointOfInterest=n.arrayToPoint(r);const i=this._memoizedMakeGetGroundElevation(this.view,n.spatialReference);return(await this._workerHandle.fetchCandidates({...e},t)).candidates.map(o=>Se(o,i))}getDebugInfo(e){return this._workerHandle.getDebugInfo(e)}_getOrLoadWhereFields(e,t){const{_whereModule:n}=this;if(!this._loadWhereModuleTask&&!n){const r=_e(async()=>{const i=await ve(()=>import("./WhereClause-XAMIZ4-B.js").then(o=>o.W),__vite__mapDeps([0,1,2,3]));return this._whereModule=i.WhereClause,this._whereModule});return this._loadWhereModuleTask=r,this._updatingHandles.addPromise(r.promise),[]}if(!n)return[];try{return n.create(e,t).fieldNames}catch{return[]}}};s([a({constructOnly:!0})],p.prototype,"spatialReference",void 0),s([a({constructOnly:!0})],p.prototype,"layerSource",void 0),s([a({constructOnly:!0})],p.prototype,"view",void 0),s([a()],p.prototype,"_tilesOfInterest",void 0),s([a({readOnly:!0})],p.prototype,"_updateTilesParameters",null),s([a()],p.prototype,"_layerView",null),s([a()],p.prototype,"_isSuspended",null),s([a({readOnly:!0})],p.prototype,"updating",null),s([a()],p.prototype,"_outFields",null),s([a({readOnly:!0})],p.prototype,"configuration",null),s([a({readOnly:!0})],p.prototype,"availability",null),s([a()],p.prototype,"_loadWhereModuleTask",void 0),s([a()],p.prototype,"_whereModule",void 0),p=s([I("esri.views.interactive.snapping.featureSources.FeatureServiceSnappingSource")],p);export{p as FeatureServiceSnappingSource}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/WhereClause-XAMIZ4-B.js","assets/TimeOnly-ljWtUK7N.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/FeatureServiceSnappingSourceWorker-TBw9rhlL.js b/dist/assets/FeatureServiceSnappingSourceWorker-TBw9rhlL.js new file mode 100644 index 0000000..d21eb2d --- /dev/null +++ b/dist/assets/FeatureServiceSnappingSourceWorker-TBw9rhlL.js @@ -0,0 +1 @@ +import{e as l,y as u,c as v,p as x,ae as J,b as w,nS as P,j4 as R,jL as H,oh as D,oi as Z,oj as I,k as O,fo as W,C as L,F as K,dv as X,ca as T,dT as Y,dQ as tt,Z as et,a2 as st,ok as it,ol as rt,om as nt,eD as at,on as ot,oo as $,ej as lt,e$ as S,op as ut,oq as N,or as V,ig as ht,K as dt,bH as U,s as f,ar as E,hs as ct,d as M,w as pt,dy as _t}from"./index-J0iiHjMT.js";import{m as ft}from"./FeatureStore-X-AIJLo2.js";import{W as gt}from"./QueryEngine-8tLWlkSE.js";import{i as j,r as z,n as q}from"./symbologySnappingCandidates-Sz0MFOvR.js";import{a as yt}from"./pbfQueryUtils-pWizwTQZ.js";import{x as mt,f as Ft,c as Et,S as Tt}from"./query-rG0aX6cE.js";import{o as Ct}from"./BoundsStore-wmwfHjhp.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";let C=class extends x{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(t,s){this._pending.push({promise:t,callback:s}),this._pending.length===1&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const t=this._pending[0];t.promise.then(s=>t.callback(s)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};l([u()],C.prototype,"updating",void 0),C=l([v("esri.core.AsyncSequence")],C);class St{constructor(t,s){this.data=t,this.resolution=s,this.state={type:a.CREATED},this.alive=!0}process(t){switch(this.state.type){case a.CREATED:return this.state=this._gotoFetchCount(this.state,t),this.state.task.promise.then(t.resume,t.resume);case a.FETCH_COUNT:break;case a.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,t),this.state.task.promise.then(t.resume,t.resume);case a.FETCH_FEATURES:break;case a.FETCHED_FEATURES:this.state=this._goToDone(this.state,t);case a.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case a.CREATED:case a.FETCH_COUNT:return 0;case a.FETCHED_COUNT:return this.state.featureCount;case a.FETCH_FEATURES:return this.state.previous.featureCount;case a.FETCHED_FEATURES:return this.state.features.length;case a.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case a.CREATED:return"created";case a.FETCH_COUNT:return"fetch-count";case a.FETCHED_COUNT:return"fetched-count";case a.FETCH_FEATURES:return"fetch-features";case a.FETCHED_FEATURES:return"fetched-features";case a.DONE:return"done"}}_gotoFetchCount(t,s){return{type:a.FETCH_COUNT,previous:t,task:w(async i=>{const r=await P(s.fetchCount(this,i));this.state.type===a.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,r.ok?r.value:1/0))})}}_gotoFetchedCount(t,s){return{type:a.FETCHED_COUNT,featureCount:s,previous:t}}_gotoFetchFeatures(t,s){return{type:a.FETCH_FEATURES,previous:t,task:w(async i=>{const r=await P(s.fetchFeatures(this,t.featureCount,i));this.state.type===a.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))})}}_gotoFetchedFeatures(t,s){return{type:a.FETCHED_FEATURES,previous:t,features:s}}_goToDone(t,s){return s.finish(this,t.features),{type:a.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:a.CREATED},t.type){case a.CREATED:case a.FETCHED_COUNT:case a.FETCHED_FEATURES:case a.DONE:break;case a.FETCH_COUNT:case a.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(R(t,B),H(this.data.extent,B))}}var a;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(a||(a={}));const B=J();let d=class extends x{get _minimumVerticesPerFeature(){var t;switch((t=this.store)==null?void 0:t.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const t=new Set;return this.objectIdField&&t.add(this.objectIdField),this.globalIdField&&t.add(this.globalIdField),t}set outFields(t){const s=this._get("outFields"),i=D(t,this._mandatoryOutFields);Z(i,s)||(this._set("outFields",i),I(i,s)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(t){const s=this._get("filter"),i=this._filterProperties(t);JSON.stringify(s)!==JSON.stringify(i)&&this._set("filter",i)}set customParameters(t){const s=this._get("customParameters");JSON.stringify(s)!==JSON.stringify(t)&&this._set("customParameters",t)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(t){const s=this._get("tileInfo");s!==t&&(t!=null&&s!=null&&JSON.stringify(t)===JSON.stringify(s)||(this._set("tileInfo",t),this.store.tileInfo=t))}set tileSize(t){this._get("tileSize")!==t&&this._set("tileSize",t)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(t){super(t),this.suspended=!0,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new O,this._pendingEdits=new C,this._pendingEditsAbortController=new AbortController}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(t,s)=>{W(t,s,({id:i},{id:r})=>i===r)||this._process()},L),this.addHandles(K(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._process()}applyEdits(t){this._pendingEdits.push(t,async s=>{if(s.addedFeatures.length===0&&s.updatedFeatures.length===0&&s.deletedFeatures.length===0)return;for(const[,r]of this._pendingTiles)r.reset();const i={...s,deletedFeatures:s.deletedFeatures.map(({objectId:r,globalId:n})=>r&&r!==-1?r:this._lookupObjectIdByGlobalId(n))};await this._updatingHandles.addPromise(this.store.processEdits(i,(r,n)=>this._queryFeaturesById(r,n),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!X(this.url))return;const t=w(async s=>{var i;try{const r=await mt(this.url,new T({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:s});this.store.extent=Y.fromJSON((i=r.data)==null?void 0:i.extent)}catch(r){tt(r),et.getLogger(this).warn("Failed to fetch data extent",r)}});this._updatingHandles.addPromise(t.promise.then(()=>this._process())),this.addHandles(st(()=>t.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(t=>t.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,t]of this._pendingTiles)t.alive=!1}_createPendingTiles(){if(this.suspended)return;const t=this._collectMissingTilesInfo();if(this._setAvailability(t==null?1:t.coveredArea/t.fullArea),t!=null)for(const{data:s,resolution:i}of t.missingTiles){const r=this._pendingTiles.get(s.id);r?(r.resolution=i,r.alive=!0):this._createPendingTile(s,i)}}_collectMissingTilesInfo(){let t=null;for(let s=this.tilesOfInterest.length-1;s>=0;s--){const i=this.tilesOfInterest[s],r=this.store.process(i,(n,o)=>this._verifyTileComplexity(n,o),this.outFields);t==null?t=r:t.prepend(r)}return t}_deletePendingTiles(){for(const[,t]of this._pendingTiles)t.alive||this._deletePendingTile(t)}_processPendingTiles(){const t={fetchCount:(s,i)=>this._fetchCount(s,i),fetchFeatures:(s,i,r)=>this._fetchFeatures(s,i,r),finish:(s,i)=>this._finishPendingTile(s,i),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(t))for(const[,s]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(s.data),s.resolution)&&this._updatingHandles.addPromise(s.process(t))}_verifyTileComplexity(t,s){return this._verifyVertexComplexity(t)&&this._verifyFeatureDensity(t,s)}_verifyVertexComplexity(t){return t*this._minimumVerticesPerFeature{t===n.attributes[s]&&(r=n.objectId??n.attributes[i])}),r==null)throw new Error(`Expected to find a feature with globalId ${t}`);return r}_queryFeaturesById(t,s){const i=this._createFeaturesQuery();return i.objectIds=t,this._queryFeatures(i,s)}_queryFeatures(t,s){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(t,s):this._queryFeaturesJSON(t,s)}async _queryFeaturesPBF(t,s){const{sourceSpatialReference:i}=this,{data:r}=await Ft(this.url,t,new yt({sourceSpatialReference:i}),{query:this._configuration.customParameters,timeout:b,signal:s});return it(r)}async _queryFeaturesJSON(t,s){const{sourceSpatialReference:i}=this,{data:r}=await Et(this.url,t,i,{query:this._configuration.customParameters,timeout:b,signal:s});return rt(r,this.objectIdField)}_createCountQuery(t){const s=this._createBaseQuery(t);return this.capabilities.query.supportsCacheHint&&(s.cacheHint=!0),s}_createFeaturesQuery(t=null){var n;const s=this._createBaseQuery(t),i=(t==null?void 0:t.data)!=null?this.store.getAttributesForTile((n=t==null?void 0:t.data)==null?void 0:n.id):null,r=D(nt(this.outFields,i??new Set),this._mandatoryOutFields);return s.outFields=Array.from(r),s.returnGeometry=!0,t!=null&&(this.capabilities.query.supportsResultType?s.resultType="tile":this.capabilities.query.supportsCacheHint&&(s.cacheHint=!0)),s}_createBaseQuery(t){const s=new T({returnZ:this.hasZ,returnM:!1,geometry:this.tileInfo!=null&&t!=null?at(t.data.extent,this.tileInfo.spatialReference):void 0}),i=this._configuration.filter;return i!=null&&(s.where=i.where,s.gdbVersion=i.gdbVersion,s.timeExtent=i.timeExtent),s.outSpatialReference=this.spatialReference,s}_setPagingParameters(t,s,i){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:r,supportsCacheHint:n,tileMaxRecordCount:o,maxRecordCount:h,supportsResultType:c}=this.capabilities.query,p=r?T.MAX_MAX_RECORD_COUNT_FACTOR:1,_=p*((c||n)&&o?o:h||vt);return t.start=s,r?(t.maxRecordCountFactor=Math.min(p,Math.ceil(i/_)),t.num=Math.min(i,t.maxRecordCountFactor*_)):t.num=Math.min(i,_),!0}};l([u({constructOnly:!0})],d.prototype,"url",void 0),l([u({constructOnly:!0})],d.prototype,"objectIdField",void 0),l([u({constructOnly:!0})],d.prototype,"globalIdField",void 0),l([u({constructOnly:!0})],d.prototype,"capabilities",void 0),l([u({constructOnly:!0})],d.prototype,"sourceSpatialReference",void 0),l([u({constructOnly:!0})],d.prototype,"spatialReference",void 0),l([u({constructOnly:!0})],d.prototype,"store",void 0),l([u({readOnly:!0})],d.prototype,"_minimumVerticesPerFeature",null),l([u()],d.prototype,"_mandatoryOutFields",null),l([u()],d.prototype,"outFields",null),l([u()],d.prototype,"suspended",void 0),l([u()],d.prototype,"filter",null),l([u()],d.prototype,"customParameters",null),l([u({readOnly:!0})],d.prototype,"_configuration",null),l([u()],d.prototype,"tileInfo",null),l([u()],d.prototype,"tileSize",null),l([u()],d.prototype,"tilesOfInterest",void 0),l([u({readOnly:!0})],d.prototype,"updating",null),l([u({readOnly:!0})],d.prototype,"updatingExcludingEdits",null),l([u({readOnly:!0})],d.prototype,"availability",void 0),l([u()],d.prototype,"hasZ",null),d=l([v("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],d);const vt=2e3,b=6e5,bt=1e6,wt=25,It=1;class Ot{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let y=class extends x{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*ot.MEGABYTES,this._tileBounds=new Ct,this._tiles=new Ot,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=J()}add(e,t){var r;for(const n of t)this._referenceFeature(n.objectId);const s=this.featureStore.upsertMany(t),i=s.map(n=>new Set(Object.keys(n.attributes))).reduce((n,o)=>$(n,o),new Set(Object.keys(((r=s[0])==null?void 0:r.attributes)??[])));this._addTileStorage(e,new Set(s.map(n=>n.objectId)),At(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,n=>this._removeTileStorage(n))}getAttributesForTile(e){var t;return e?(t=this._tiles.get(e))==null?void 0:t.attributeKeys:null}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new Ht(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===m.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const[,t]of this._tiles){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const h=lt(this._tmpBoundingRect,o.geometry,r,n);h!=null&&this._tileBounds.forEachInBounds(h,c=>{const p=this._tiles.get(c);this.featureStore.add(o);const _=o.objectId;p.objectIds.has(_)||(p.objectIds.add(_),this._referenceFeature(_),this._tileFeatureCounts.set(p.data.id,p.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!H(R(this.extent,this._tmpBoundingRect),e.extent))return new A(e);const i=this.getAttributesForTile(e.id);if(I(s,i))return new A(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await Tt(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new k(e.level,e.row,e.col);return t.updateTileInfo(s,S.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{var n;const r=(n=this._tiles.get(i))==null?void 0:n.data;r&&this._tilesAreRelated(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_tilesAreRelated(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.level>r,o=t.col>>r,h=e.row<<1,c=o-(e.col<<1)+(n-h<<1),p=e.children[c];if(p!=null)this._populateChildren(p,t,s,i);else{const _=new k(e.level+1,n,o);s.updateTileInfo(_,S.ExtrapolateOptions.POWER_OF_TWO),e.children[c]=_,this._populateChildren(_,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,h=o*o;let c=0;for(let p=0;p{const n=this._tiles.get(r.id);if(n){s=s?$(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&h),o):this._collectMissingTilesRecurse(c,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?m.ADDED:m.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),m.REMOVED):(t>0&&this._refCounts.set(e,t),m.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(e=>`${e.data.id}:[${Array.from(e.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(e=>`${e}:${this._refCounts.get(e)}`)}}};function At(e){return e.reduce((t,s)=>t+xt(s),0)}function xt(e){return 32+Rt(e.geometry)+ut(e.attributes)}function Rt(e){if(e==null)return 0;const t=N(e.lengths,4);return 32+N(e.coords,8)+t}l([u({constructOnly:!0})],y.prototype,"featureStore",void 0),l([u()],y.prototype,"tileInfo",void 0),l([u()],y.prototype,"extent",void 0),l([u()],y.prototype,"maximumByteSize",void 0),y=l([v("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],y);class Ht{constructor(t,s,i,r){this.data=t,this.objectIds=s,this.byteSize=i,this.attributeKeys=r}}let k=class{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}};class A{constructor(t,s=[]){this.missingTiles=s,this.fullArea=0,this.coveredArea=0,this.fullArea=V(t.extent),this.coveredArea=this.fullArea}prepend(t){this.missingTiles=t.missingTiles.concat(this.missingTiles),this.coveredArea+=t.coveredArea,this.fullArea+=t.fullArea}}let Pt=class{constructor(t,s,i){this._tileInfo=t,this._extent=null,this.info=new A(s),i!=null&&(this._extent=R(i))}addMissing(t,s,i,r){const n=new ht(null,t,s,i);this._tileInfo.updateTileInfo(n,S.ExtrapolateOptions.POWER_OF_TWO),n.extent==null||this._extent!=null&&!H(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:r}),this.info.coveredArea-=V(n.extent))}};const Dt=.18751;var m;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(m||(m={}));let F=class extends dt.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=U(),this._elevationAligner=j(),this._elevationFilter=z(),this._symbologyCandidatesFetcher=q(),this._updatingHandles=new O,this._editsUpdatingHandles=new O,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return f(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return f(t),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){var e,t,s;(e=this._featureFetcher)==null||e.destroy(),(t=this._queryEngine)==null||t.destroy(),(s=this._featureStore)==null||s.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=E.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new ft({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new gt({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new d({store:new y({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:E.fromJSON(e.serviceInfo.spatialReference)});const h=e.configuration.viewType==="3d";return this._elevationAligner=j(h,{elevationInfo:e.elevationInfo!=null?ct.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=z(h),this.addHandles([M(()=>this._featureFetcher.availability,c=>this.emit("notify-availability",{availability:c}),L),M(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),g}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),f(t),this._featureFetcher.suspended=e,g}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),f(t),this._featureFetcher.outFields=new Set(e??[]),g}async fetchCandidates(e,t){await this._whenSetup.promise,f(t);const s=$t(e),i=t==null?void 0:t.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);f(i);const n=await this._elevationAligner.alignCandidates(r.candidates,E.fromJSON(e.point.spatialReference)??E.WGS84,i);f(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);f(i);const h=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,h)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),f(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?S.fromJSON(e.tileInfo):null,g}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),f(t),this._featureFetcher.refresh(),g}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),f(t),await pt(()=>!this.updatingExcludingEdits,t),f(t),g}async getDebugInfo(e,t){return f(t),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(e,t){this._updatingHandles.addPromise(this._whenSetup.promise),f(t);const s=U();return this._pendingApplyEdits.set(e.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),g}async endApplyEdits(e,t){const s=this._pendingApplyEdits.get(e.id);return s&&s.resolve(e.edits),f(t),g}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),g}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),g}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=q(e,this._getSymbologyCandidates),g}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?T.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};l([u({readOnly:!0})],F.prototype,"updating",null),l([u({readOnly:!0})],F.prototype,"updatingExcludingEdits",null),l([u()],F.prototype,"_isInitializing",void 0),F=l([v("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],F);const re=F;function $t(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,h={geometry:e.filter.geometry?_t(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:h}}const g={result:{}};export{re as default}; diff --git a/dist/assets/FeatureSet-d4S1oKME.js b/dist/assets/FeatureSet-d4S1oKME.js new file mode 100644 index 0000000..09bd40b --- /dev/null +++ b/dist/assets/FeatureSet-d4S1oKME.js @@ -0,0 +1 @@ +import{dp as F,e as h,y as g,S as N,dt as S,dw as P,du as T,dx as j,ar as w,c as q,dr as J,dy as O,bI as M,dz as v}from"./index-J0iiHjMT.js";var z;const G=new F({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let m=z=class extends J{constructor(r){super(r),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(r,a){var s;const o=w.fromJSON(a.spatialReference),e=[];for(let t=0;t0)for(let o=0;oMath.round((n-e)/a),l=n=>Math.round((s-n)/o),u=this.features,f=this._getQuantizationFunction(this.geometryType,t,l);for(let n=0,y=u.length;np*t+e,f=p=>s-p*l;let n=null,y=null;if(this.hasZ&&((c=o==null?void 0:o.scale)==null?void 0:c[2])!=null){const{translate:[,,p],scale:[,,R]}=o;n=x=>x*R+p}if(this.hasM&&((d=o==null?void 0:o.scale)==null?void 0:d[3])!=null){const{translate:[,,,p],scale:[,,,R]}=o;y=x=>x==null?x:x*R+p}const i=this._getHydrationFunction(r,u,f,n,y);for(const{geometry:p}of a)p!=null&&i&&i(p);return this.transform=null,this}_quantizePoints(r,a,o){let e,s;const t=[];for(let l=0,u=r.length;l0){const n=a(f[0]),y=o(f[1]);n===e&&y===s||(t.push([n-e,y-s]),e=n,s=y)}else e=a(f[0]),s=o(f[1]),t.push([e,s])}return t.length>0?t:null}_getQuantizationFunction(r,a,o){return r==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):r==="polyline"||r==="polygon"?e=>{const s=v(e)?e.rings:e.paths,t=[];for(let l=0,u=s.length;l0?(v(e)?e.rings=t:e.paths=t,e):null}:r==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:r==="extent"?e=>e:null}_getHydrationFunction(r,a,o,e,s){return r==="point"?t=>{t.x=a(t.x),t.y=o(t.y),e&&(t.z=e(t.z))}:r==="polyline"||r==="polygon"?t=>{const l=v(t)?t.rings:t.paths;let u,f;for(let n=0,y=l.length;n0?(u+=p[0],f+=p[1]):(u=p[0],f=p[1]),p[0]=a(u),p[1]=o(f)}}if(e&&s)for(let n=0,y=l.length;n{t.xmin=a(t.xmin),t.ymin=o(t.ymin),t.xmax=a(t.xmax),t.ymax=o(t.ymax),e&&t.zmax!=null&&t.zmin!=null&&(t.zmax=e(t.zmax),t.zmin=e(t.zmin)),s&&t.mmax!=null&&t.mmin!=null&&(t.mmax=s(t.mmax),t.mmin=s(t.mmin))}:r==="multipoint"?t=>{const l=t.points;let u,f;for(let n=0,y=l.length;n0?(u+=i[0],f+=i[1]):(u=i[0],f=i[1]),i[0]=a(u),i[1]=o(f)}if(e&&s)for(let n=0,y=l.length;n({enabled:r})}}})],m.prototype,"exceededTransferLimit",void 0),h([g({type:[N],json:{write:!0}})],m.prototype,"features",void 0),h([S("features")],m.prototype,"readFeatures",null),h([g({type:[P],json:{write:!0}})],m.prototype,"fields",void 0),h([g({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:G.read}}})],m.prototype,"geometryType",void 0),h([T("geometryType")],m.prototype,"writeGeometryType",null),h([g({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],m.prototype,"hasM",void 0),h([g({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],m.prototype,"hasZ",void 0),h([g({types:j,json:{write:!0}})],m.prototype,"queryGeometry",void 0),h([S("queryGeometry")],m.prototype,"readQueryGeometry",null),h([g({type:w,json:{write:!0}})],m.prototype,"spatialReference",void 0),h([T("spatialReference")],m.prototype,"writeSpatialReference",null),h([g({json:{write:!0}})],m.prototype,"transform",void 0),m=z=h([q("esri.rest.support.FeatureSet")],m),m.prototype.toJSON.isDefaultToJSON=!0;const $=m;export{$ as d}; diff --git a/dist/assets/FeatureStore-X-AIJLo2.js b/dist/assets/FeatureStore-X-AIJLo2.js new file mode 100644 index 0000000..f4dcdd0 --- /dev/null +++ b/dist/assets/FeatureStore-X-AIJLo2.js @@ -0,0 +1 @@ +import{eh as u,K as f,e3 as l,ei as m,Z as a,E as n,ej as d,ae as h}from"./index-J0iiHjMT.js";import{o as g}from"./BoundsStore-wmwfHjhp.js";import{h as _}from"./QueryEngine-8tLWlkSE.js";import{o as y}from"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";const I=u();class S{constructor(e){this.geometryInfo=e,this._boundsStore=new g,this._featuresById=new Map,this._markedIds=new Set,this.events=new f,this.featureAdapter=y}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{t.geometry!=null&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(e){if(this.fullBounds==null)return null;const[t,s,r,o]=this.fullBounds;return{xmin:t,ymin:s,xmax:r,ymax:o,spatialReference:_(e)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}upsertMany(e){const t=e.map(s=>this._upsert(s));return this._emitChanged(),t.filter(l)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const s=this._featuresById.get(t);s&&this._remove(s)}this._emitChanged()}forEachBounds(e,t){for(const s of e){const r=this._boundsStore.get(s.objectId);r&&t(m(I,r))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,s=>{t(this._featuresById.get(s))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,s)=>{this._markedIds.has(s)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){var o,i;if(!e)return;const t=e.objectId;if(t==null)return void a.getLogger("esri.layers.graphics.data.FeatureStore").error(new n("featurestore:invalid-feature","feature id is missing",{feature:e}));const s=this._featuresById.get(t);let r;if(this._markedIds.add(t),s?(e.displayId=s.displayId,r=this._boundsStore.get(t),this._boundsStore.delete(t)):this.onFeatureAdd!=null&&this.onFeatureAdd(e),!((i=(o=e.geometry)==null?void 0:o.coords)!=null&&i.length))return this._boundsStore.set(t,null),void this._featuresById.set(t,e);r=d(r??h(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(t,r),this._featuresById.set(t,e)}_upsert(e){const t=e==null?void 0:e.objectId;if(t==null)return a.getLogger("esri.layers.graphics.data.FeatureStore").error(new n("featurestore:invalid-feature","feature id is missing",{feature:e})),null;const s=this._featuresById.get(t);if(!s)return this._add(e),e;this._markedIds.add(t);const{geometry:r,attributes:o}=e;for(const i in o)s.attributes[i]=o[i];return r&&(s.geometry=r,this._boundsStore.set(t,d(h(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(e){this.onFeatureRemove!=null&&this.onFeatureRemove(e);const t=e.objectId;return this._markedIds.delete(t),this._boundsStore.delete(t),this._featuresById.delete(t),e}}export{S as m}; diff --git a/dist/assets/FeatureTemplate-kUgbbA00.js b/dist/assets/FeatureTemplate-kUgbbA00.js new file mode 100644 index 0000000..fcf3797 --- /dev/null +++ b/dist/assets/FeatureTemplate-kUgbbA00.js @@ -0,0 +1 @@ +import{dp as l,dq as a,e as o,y as r,c as s,dr as n}from"./index-J0iiHjMT.js";const t=new l({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let e=class extends a(n){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([s("esri.layers.support.FeatureTemplate")],e);const p=e;export{p}; diff --git a/dist/assets/FeatureTileTree3DDebugger-ZBfyCqfy.js b/dist/assets/FeatureTileTree3DDebugger-ZBfyCqfy.js new file mode 100644 index 0000000..ad658e1 --- /dev/null +++ b/dist/assets/FeatureTileTree3DDebugger-ZBfyCqfy.js @@ -0,0 +1 @@ +import{k as d,P as g,e as r,y as s,l,c as p}from"./index-J0iiHjMT.js";import{d as c}from"./TileTreeDebugger-2DVbY5sQ.js";let i=class extends c{get updating(){var t;return((t=this._watchUpdatingTracking)==null?void 0:t.updating)??!1}constructor(t){super(t),this._watchUpdatingTracking=new d}initialize(){const{featureTiles:t}=this.view;this.addHandles(t.addClient()),this._watchUpdatingTracking.addOnCollectionChange(()=>t==null?void 0:t.tiles,()=>this.update(),g)}destroy(){this._watchUpdatingTracking.destroy()}getTiles(){const t=e=>{const[a,o,n]=e.lij;return l.fromExtent(this.view.featureTiles.tilingScheme.getExtentGeometry(a,o,n))};return this.view.featureTiles.tiles.toArray().sort((e,a)=>e.loadPriority-a.loadPriority).map(e=>({...e,geometry:t(e)}))}};r([s()],i.prototype,"_watchUpdatingTracking",void 0),r([s()],i.prototype,"updating",null),r([s()],i.prototype,"view",void 0),i=r([p("esri.views.3d.layers.support.FeatureTileTree3DDebugger")],i);export{i as FeatureTileTree3DDebugger}; diff --git a/dist/assets/FeatureType-MpRe7WJj.js b/dist/assets/FeatureType-MpRe7WJj.js new file mode 100644 index 0000000..fb751f7 --- /dev/null +++ b/dist/assets/FeatureType-MpRe7WJj.js @@ -0,0 +1 @@ +import{dq as p,ds as d,e as s,y as i,dt as l,du as m,c,dr as u}from"./index-J0iiHjMT.js";import{p as y}from"./FeatureTemplate-kUgbbA00.js";let t=class extends p(u){constructor(o){super(o),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(o){const r={};for(const e of Object.keys(o))r[e]=d(o[e]);return r}writeDomains(o,r){var a;const e={};for(const n of Object.keys(o))o[n]&&(e[n]=(a=o[n])==null?void 0:a.toJSON());r.domains=e}};s([i({json:{write:!0}})],t.prototype,"id",void 0),s([i({json:{write:!0}})],t.prototype,"name",void 0),s([i({json:{write:!0}})],t.prototype,"domains",void 0),s([l("domains")],t.prototype,"readDomains",null),s([m("domains")],t.prototype,"writeDomains",null),s([i({type:[y],json:{write:!0}})],t.prototype,"templates",void 0),t=s([c("esri.layers.support.FeatureType")],t);const w=t;export{w as n}; diff --git a/dist/assets/FloatingArrow-BghsONry.js b/dist/assets/FloatingArrow-BghsONry.js new file mode 100644 index 0000000..a35cb42 --- /dev/null +++ b/dist/assets/FloatingArrow-BghsONry.js @@ -0,0 +1,5 @@ +import{t as i}from"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const h={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},w={width:12,height:6,strokeWidth:1},$=({floatingLayout:n,key:c,ref:l})=>{const{width:t,height:o,strokeWidth:r}=w,e=t/2,a=n==="vertical",s=`M0,0 H${t} L${t-e},${o} Q${e},${o} ${e},${o} Z`;return i("svg",{"aria-hidden":"true",class:h.arrow,height:t,key:c,viewBox:`0 0 ${t} ${t+(a?0:r)}`,width:t+(a?r:0),ref:l},r>0&&i("path",{class:h.arrowStroke,d:s,fill:"none","stroke-width":r+1}),i("path",{d:s,stroke:"none"}))};export{$ as F}; diff --git a/dist/assets/GeoJSONLayer-T9kwyVNs.js b/dist/assets/GeoJSONLayer-T9kwyVNs.js new file mode 100644 index 0000000..3d63421 --- /dev/null +++ b/dist/assets/GeoJSONLayer-T9kwyVNs.js @@ -0,0 +1,7 @@ +import{e as i,y as s,c as b,ij as _,ah as $,dT as I,E as m,l as j,g1 as w,dJ as J,fe as O,Z as f,dK as N,el as R,dO as P,dL as q,dM as T,dN as k,dP as D,ar as F,dQ as L,iF as g,iG as G,bV as v,de as Z,il as Q,ca as c,ex as C,iH as V,dw as z,dU as M,iI as U,iJ as W,iK as A,dV as B,iL as K,iu as H,iv as X,iM as Y,it as ee,iN as te,dW as ie,ix as re,c7 as se}from"./index-J0iiHjMT.js";import{l as oe}from"./clientSideDefaults-F-CNnR0g.js";import{d as ne}from"./FeatureSet-d4S1oKME.js";import{o as ae}from"./CustomParametersMixin-Y1bOcayO.js";import{p as le}from"./FeatureEffectLayer-oBa8pIG5.js";import{c as de}from"./FeatureReductionLayer-RlitE1N6.js";import{c as ue}from"./OrderedLayer-M7k5gLgx.js";import{p as pe}from"./FeatureTemplate-kUgbbA00.js";import{n as he}from"./FeatureType-MpRe7WJj.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./FeatureEffect-5bEV-xG1.js";let p=class extends _{constructor(){super(...arguments),this.type="geojson",this.refresh=$(async e=>{await this.load();const{extent:t,timeExtent:r}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,r&&(this.sourceJSON.timeInfo.timeExtent=[r.start,r.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(r=>ne.fromJSON(r))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(r=>({count:r.count,extent:I.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new m("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,r=[],a=[],l=[];if(e.addFeatures)for(const n of e.addFeatures)r.push(this._serializeFeature(n));if(e.deleteFeatures)for(const n of e.deleteFeatures)"objectId"in n&&n.objectId!=null?a.push(n.objectId):"attributes"in n&&n.attributes[t]!=null&&a.push(n.attributes[t]);if(e.updateFeatures)for(const n of e.updateFeatures)l.push(this._serializeFeature(n));return this._connection.invoke("applyEdits",{adds:r,updates:l,deletes:a}).then(({extent:n,timeExtent:d,featureEditResults:u})=>(this.sourceJSON.extent=n,d&&(this.sourceJSON.timeInfo.timeExtent=[d.start,d.end]),this._createEditsResult(u)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,r=this._geometryForSerialization(e);return r?{geometry:r.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return t==null?null:t.type==="mesh"||t.type==="extent"?j.fromExtent(t.extent):t}async _startWorker(e){this._connection=await w("GeoJSONSourceWorker",{strategy:J("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:r,hasZ:a,geometryType:l,objectIdField:n,url:d,timeInfo:u,customParameters:E}=this.layer,S=this.layer.originOf("spatialReference")==="defaults",x={url:d,customParameters:E,fields:t&&t.map(y=>y.toJSON()),geometryType:O.toJSON(l),hasZ:a,objectIdField:n,timeInfo:u?u.toJSON():null,spatialReference:S?null:r&&r.toJSON()},h=await this._connection.invoke("load",x,{signal:e});for(const y of h.warnings)f.getLogger(this.layer).warn("#load()",`$${y.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:y});h.featureErrors.length&&f.getLogger(this.layer).warn("#load()",`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=oe(this.sourceJSON.hasZ,!0)}};i([s()],p.prototype,"capabilities",void 0),i([s()],p.prototype,"type",void 0),i([s({constructOnly:!0})],p.prototype,"layer",void 0),i([s()],p.prototype,"sourceJSON",void 0),p=i([b("esri.layers.graphics.sources.GeoJSONSource")],p);const ce=re();let o=class extends ue(ae(de(le(N(R(P(q(T(k(D(se))))))))))){constructor(e){super(e),this.copyright=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new p({layer:this}),this.spatialReference=F.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson",this.typeIdField=null,this.types=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(L).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),g(this.renderer,this.fieldsIndex),G(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?v(this.url):null}set renderer(e){g(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=v(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:r}=await Z(()=>import("./editingSupport-EiPa9PKq.js"),__vite__mapDeps([0,1,2]));await this.load();const a=await r(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),a}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Q(this,e)}createQuery(){var l;const e=new c,t=(l=this.capabilities)==null?void 0:l.data;e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:r,timeExtent:a}=this;return e.timeExtent=r!=null&&a!=null?a.offset(-r.value,r.unit):a||null,e}getFieldDomain(e,t){let r,a=!1;const l=t==null?void 0:t.feature,n=l==null?void 0:l.attributes,d=this.typeIdField&&(n==null?void 0:n[this.typeIdField]);return d!=null&&this.types&&(a=this.types.some(u=>u.id==d&&(r=u.domains&&u.domains[e],r&&r.type==="inherited"&&(r=this._getLayerDomain(e)),!0))),a||r||(r=this._getLayerDomain(e)),r}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery(),t)).then(r=>{if(r!=null&&r.features)for(const a of r.features)a.layer=a.sourceLayer=this;return r})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(c.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_getLayerDomain(e){if(!this.fields)return null;let t=null;return this.fields.some(r=>(r.name===e&&(t=r.domain),!!t)),t}};i([s({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),i([s({type:String})],o.prototype,"copyright",void 0),i([s({readOnly:!0})],o.prototype,"createQueryVersion",null),i([s(C("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),i([s({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:String})],o.prototype,"displayField",void 0),i([s({type:Boolean})],o.prototype,"editingEnabled",void 0),i([s(V)],o.prototype,"elevationInfo",void 0),i([s({type:[z],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),i([s(ce.fieldsIndex)],o.prototype,"fieldsIndex",void 0),i([s({type:I,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),i([s({type:["point","polygon","polyline","multipoint"],json:{read:{reader:O.read}}})],o.prototype,"geometryType",void 0),i([s({type:Boolean})],o.prototype,"hasZ",void 0),i([s(M)],o.prototype,"id",void 0),i([s({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([s(U)],o.prototype,"labelsVisible",void 0),i([s({type:[W],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:A},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(B)],o.prototype,"legendEnabled",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),i([s(K)],o.prototype,"opacity",void 0),i([s({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),i([s({readOnly:!0})],o.prototype,"parsedUrl",null),i([s(H)],o.prototype,"popupEnabled",void 0),i([s({type:X,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({types:Y,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:ee}}}})],o.prototype,"renderer",null),i([s(te)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({readOnly:!0})],o.prototype,"source",void 0),i([s({type:F})],o.prototype,"spatialReference",void 0),i([s({type:[pe]})],o.prototype,"templates",void 0),i([s()],o.prototype,"title",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),i([s({type:[he]})],o.prototype,"types",void 0),i([s(ie)],o.prototype,"url",null),o=i([b("esri.layers.GeoJSONLayer")],o);const xe=o;export{xe as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/editingSupport-EiPa9PKq.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/GeoJSONLayerView3D-4MSCbPJp.js b/dist/assets/GeoJSONLayerView3D-4MSCbPJp.js new file mode 100644 index 0000000..cc1d230 --- /dev/null +++ b/dist/assets/GeoJSONLayerView3D-4MSCbPJp.js @@ -0,0 +1 @@ +import{e as o,y as r,c as p}from"./index-J0iiHjMT.js";import{_ as i}from"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./LayerView3D-iOx2MD1g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";let t=class extends i{constructor(){super(...arguments),this.type="geojson-3d"}};o([r()],t.prototype,"layer",void 0),t=o([p("esri.views.3d.layers.GeoJSONLayerView3D")],t);const A=t;export{A as default}; diff --git a/dist/assets/GeoJSONSourceWorker-Sd5A35h-.js b/dist/assets/GeoJSONSourceWorker-Sd5A35h-.js new file mode 100644 index 0000000..a72a89a --- /dev/null +++ b/dist/assets/GeoJSONSourceWorker-Sd5A35h-.js @@ -0,0 +1 @@ +import{eV as _,eQ as R,E as I,eP as Q,ga as C,ff as v,eR as Z,b as P,f as A,Z as G,al as N,eU as M,eT as z,bW as W,gb as O,gc as B,gd as J,ge as L}from"./index-J0iiHjMT.js";import{m as U}from"./FeatureStore-X-AIJLo2.js";import{W as V,x as E,j as b}from"./QueryEngine-8tLWlkSE.js";import{I as H,N as K,E as Y}from"./geojson-fSjaGZrp.js";import{o as X,a as ee,i as te}from"./clientSideDefaults-F-CNnR0g.js";import{I as se,p as T,d as w,f as F,w as k}from"./sourceUtils-zbywPEXK.js";import"./BoundsStore-wmwfHjhp.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./date-be_IQzZd.js";const ie={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class be{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const n=[],[s]=await Promise.all([e.url?this._fetch(t==null?void 0:t.signal):null,this._checkProjection(e.spatialReference)]),i=H(s,{geometryType:e.geometryType}),o=e.fields||i.fields||[],d=e.hasZ!=null?e.hasZ:i.hasZ,p=i.geometryType;let y=e.objectIdField||i.objectIdFieldName||"__OBJECTID";const m=e.spatialReference||_;let r=e.timeInfo;o===i.fields&&i.unknownFields.length>0&&n.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:i.unknownFields}});const l=new R(o);let u=l.get(y);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,y=u.name):(u={alias:y,name:y,type:i.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(u));const h={};for(const a of o){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),!a.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!Q.jsonValues.includes(a.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==u.name){const g=C(a);g!==void 0&&(h[a.name]=g)}a.length==null&&(a.length=v(a))}if(r){if(r.startTimeField){const a=l.get(r.startTimeField);a?(r.startTimeField=a.name,a.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const a=l.get(r.endTimeField);a?(r.endTimeField=a.name,a.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const a=l.get(r.trackIdField);a?r.trackIdField=a.name:(r.trackIdField=null,n.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(n.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=null)}const c=p?X(p):void 0,j=l.dateFields.length?{timeZoneIANA:Z}:null,f={warnings:n,featureErrors:[],layerDefinition:{...ie,drawingInfo:c??void 0,templates:ee(h),extent:void 0,geometryType:p,objectIdField:y,fields:o,hasZ:!!d,timeInfo:r,dateFieldsTimeReference:j}};this._queryEngine=new V({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:r,dateFieldsTimeReference:j}),geometryType:p,hasM:!1,hasZ:d,objectIdField:y,spatialReference:m,timeInfo:r,featureStore:new U({geometryType:p,hasM:!1,hasZ:d}),cacheSpatialQueries:!0});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=te(h,y);const x=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const $=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany($);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:a,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[a,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([se(t,n),E(e.adds,t),E(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var s;this._loadOptions.customParameters=e,(s=this._snapshotTask)==null||s.abort(),this._snapshotTask=P(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const o=this._normalizeFeatures(i);o&&this._queryEngine.featureStore.addMany(o)},i=>{this._queryEngine.featureStore.clear(),A(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:n}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:n}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:n,objectIdField:s}=this._queryEngine,i=K(e,{geometryType:t,hasZ:n,objectIdField:s});if(!N(this._queryEngine.spatialReference,_))for(const o of i)o.geometry!=null&&(o.geometry=M(b(z(o.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return i}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:n}=this._loadOptions,s=(await W(t,{responseType:"json",query:{...n},signal:e})).data;return Y(s),s}_normalizeFeatures(e,t){const{objectIdField:n,fieldsIndex:s}=this._queryEngine,i=[];for(const o of e){const d=this._createDefaultAttributes(),p=T(s,d,o.attributes,!0);p?t==null||t.push(p):(this._assignObjectId(d,o.attributes,!0),o.attributes=d,o.objectId=d[n],i.push(o))}return i}async _applyEdits(e){const{adds:t,updates:n,deletes:s}=e,i={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t!=null&&t.length&&this._applyAddEdits(i,t),n!=null&&n.length&&this._applyUpdateEdits(i,n),s==null?void 0:s.length){for(const p of s)i.deleteResults.push(w(p));this._queryEngine.featureStore.removeManyById(s)}const{fullExtent:o,timeExtent:d}=await this._queryEngine.fetchRecomputedExtents();return{extent:o,timeExtent:d,featureEditResults:i}}_applyAddEdits(e,t){const{addResults:n}=e,{geometryType:s,hasM:i,hasZ:o,objectIdField:d,spatialReference:p,featureStore:y,fieldsIndex:m}=this._queryEngine,r=[];for(const l of t){if(l.geometry&&s!==O(l.geometry)){n.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),h=T(m,u,l.attributes);if(h)n.push(h);else{if(this._assignObjectId(u,l.attributes),l.attributes=u,l.uid!=null){const c=l.attributes[d];e.uidToObjectId[l.uid]=c}if(l.geometry!=null){const c=l.geometry.spatialReference??p;l.geometry=b(k(l.geometry,c),c,p)}r.push(l),n.push(w(l.attributes[d]))}}y.addMany(B([],r,s,o,i,d))}_applyUpdateEdits({updateResults:e},t){const{geometryType:n,hasM:s,hasZ:i,objectIdField:o,spatialReference:d,featureStore:p,fieldsIndex:y}=this._queryEngine;for(const m of t){const{attributes:r,geometry:l}=m,u=r==null?void 0:r[o];if(u==null){e.push(F(`Identifier field ${o} missing`));continue}if(!p.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const h=J(p.getFeature(u),n,i,s);if(l!=null){if(n!==O(l)){e.push(F("Incorrect geometry type."));continue}const c=l.spatialReference??d;h.geometry=b(k(l,c),c,d)}if(r){const c=T(y,h.attributes,r);if(c){e.push(c);continue}}p.add(L(h,n,i,s,o)),e.push(w(u))}}_createObjectIdGenerator(e,t){const n=e.fieldsIndex.get(e.objectIdField);if(n.type==="esriFieldTypeString")return()=>n.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const i of t)i.objectId&&(s=Math.max(s,i.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,n=!1){const s=this._queryEngine.objectIdField;e[s]=n&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{be as default}; diff --git a/dist/assets/GeoRSSLayer-hfhcgYql.js b/dist/assets/GeoRSSLayer-hfhcgYql.js new file mode 100644 index 0000000..92d5d30 --- /dev/null +++ b/dist/assets/GeoRSSLayer-hfhcgYql.js @@ -0,0 +1 @@ +import{dK as y,dL as p,dM as d,dN as u,dO as c,dP as h,dh as S,dQ as m,bW as g,dR as v,dS as f,e as o,y as s,dt as b,dT as C,dU as G,dV as $,dW as P,c as R,dX as n,a8 as _,dY as k,J as w,bX as x,c7 as j}from"./index-J0iiHjMT.js";const F=["atom","xml"],M={base:n,key:"type",typeMap:{"simple-line":_},errorContext:"symbol"},E={base:n,key:"type",typeMap:{"picture-marker":k,"simple-marker":w},errorContext:"symbol"},L={base:n,key:"type",typeMap:{"simple-fill":x},errorContext:"symbol"};let t=class extends y(p(d(u(c(h(j)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(i=>{var a;const l=i.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&((a=l.outline)!=null&&a.style.includes("esriSFS"))&&(l.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?S(this.url,F)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(m).then(()=>this._fetchService(r)).then(i=>{this.read(i,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:i}=await g(f.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:v(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return i}_hasGeometry(e){var r;return((r=this.featureCollections)==null?void 0:r.some(i=>{var l,a;return((l=i.featureSet)==null?void 0:l.geometryType)===e&&((a=i.featureSet.features)==null?void 0:a.length)>0}))??!1}};o([s()],t.prototype,"description",void 0),o([s()],t.prototype,"featureCollections",void 0),o([b("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([s({type:C,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([s(G)],t.prototype,"id",void 0),o([s($)],t.prototype,"legendEnabled",void 0),o([s({types:M,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([s({type:["show","hide"]})],t.prototype,"listMode",void 0),o([s({types:E,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([s({types:L,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([s({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([s(P)],t.prototype,"url",void 0),o([s({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([s({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([R("esri.layers.GeoRSSLayer")],t);const O=t;export{O as default}; diff --git a/dist/assets/GeometryUtils-K2DOc0l8.js b/dist/assets/GeometryUtils-K2DOc0l8.js new file mode 100644 index 0000000..e8677f8 --- /dev/null +++ b/dist/assets/GeometryUtils-K2DOc0l8.js @@ -0,0 +1 @@ +const r=.7111111111111111;function u(t,n){return(t%=n)>=0?t:t+n}function c(t){return u(t*r,256)}export{c}; diff --git a/dist/assets/GraphicManipulator-ku6oRBpa.js b/dist/assets/GraphicManipulator-ku6oRBpa.js new file mode 100644 index 0000000..dc87eb0 --- /dev/null +++ b/dist/assets/GraphicManipulator-ku6oRBpa.js @@ -0,0 +1 @@ +import{gO as u,e as a,p as x,hr as D,hs as w,K as G,d as z,C as M,ht as I,aJ as f,hu as _,ct as H,e1 as E,ay as L,az as O,y as n,c as R,aa as k,aR as X}from"./index-J0iiHjMT.js";import{i as Y}from"./drapedUtils-9db1OpTX.js";function J(e){let s=0,i=0,t=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(l=>{l.type==="CIMVectorMarker"&&l.anchorPoint&&(Math.abs(l.anchorPoint.x)>s&&(s=l.anchorPoint.x),Math.abs(l.anchorPoint.y)>i&&(i=l.anchorPoint.y),l.size!=null&&l.size>t&&(t=l.size))}),s=u(s),i=u(i),t=u(t),{offsetX:s,offsetY:i,size:t}):{offsetX:s,offsetY:i,size:t}}let o=class extends x{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,s=e&&"elevationInfo"in e?e.elevationInfo:null,i=D(this.graphic),t=s?s.offset:0;return new w({mode:i,offset:t})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new G.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const s=this.graphic;if(s.visible===!1)return null;const i=s.geometry;if(i==null)return null;const t=this._get("focusedSymbol"),l=t??s.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,l):this._intersectDistance3D(this.view,e,s)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=z(()=>{var e;return(e=this.graphic)==null?void 0:e.symbol},e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},M)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,s,i,t){var g,d;if((t=t||I(i))==null)return null;const l=1;let h=this._circleCollisionCache;if(i.type==="point"&&t.type==="cim"&&((g=t.data.symbol)==null?void 0:g.type)==="CIMPointSymbol"&&t.data.symbol.symbolLayers){const{offsetX:c,offsetY:r,size:y}=J(t),b=f(s,v),p=y/2,m=e.toScreen(i),C=m.x+c,P=m.y+r;return _(b,[C,P])this._highlight(s))}remove(i){const e=!i||Array.isArray(i)?i:[i];e!=null&&e.length&&e.forEach(s=>this._unhighlight(s))}removeAll(){this.removeAllHandles()}_highlight(i){const e=O(this.view,i.layer);M(e)&&this.addHandles(e.highlight(i),b(i))}_unhighlight(i){i&&this.removeHandles(b(i))}};l([p()],f.prototype,"view",void 0),f=l([E("esri.views.draw.support.HighlightHelper")],f);const L=f;class V{constructor(i,e,s,h,r){this.graphic=i,this.index=e,this.x=s,this.y=h,this.viewEvent=r,this.type="graphic-click"}}class C{constructor(i,e,s,h,r){this.graphic=i,this.index=e,this.x=s,this.y=h,this.viewEvent=r,this.type="graphic-double-click"}}class z{constructor(i,e,s,h,r,a,o,d,v,g){this.graphic=i,this.allGraphics=e,this.index=s,this.x=h,this.y=r,this.dx=a,this.dy=o,this.totalDx=d,this.totalDy=v,this.viewEvent=g,this.defaultPrevented=!1,this.type="graphic-move-start"}preventDefault(){this.defaultPrevented=!0}}class F{constructor(i,e,s,h,r,a,o,d,v,g){this.graphic=i,this.allGraphics=e,this.index=s,this.x=h,this.y=r,this.dx=a,this.dy=o,this.totalDx=d,this.totalDy=v,this.viewEvent=g,this.defaultPrevented=!1,this.type="graphic-move"}preventDefault(){this.defaultPrevented=!0}}class j{constructor(i,e,s,h,r,a,o,d,v,g){this.graphic=i,this.allGraphics=e,this.index=s,this.x=h,this.y=r,this.dx=a,this.dy=o,this.totalDx=d,this.totalDy=v,this.viewEvent=g,this.defaultPrevented=!1,this.type="graphic-move-stop"}preventDefault(){this.defaultPrevented=!0}}class q{constructor(i,e,s,h,r){this.graphic=i,this.index=e,this.x=s,this.y=h,this.viewEvent=r,this.type="graphic-pointer-over"}}class x{constructor(i,e,s,h,r){this.graphic=i,this.index=e,this.x=s,this.y=h,this.viewEvent=r,this.type="graphic-pointer-out"}}class X{constructor(i,e,s,h,r){this.graphic=i,this.index=e,this.x=s,this.y=h,this.viewEvent=r,this.type="graphic-pointer-down"}}class J{constructor(i,e,s,h,r){this.graphic=i,this.index=e,this.x=s,this.y=h,this.viewEvent=r,this.type="graphic-pointer-up"}}const k="indicator-symbols";let n=class extends P.EventedAccessor{constructor(t){super(t),this._activeGraphic=null,this._dragEvent=null,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._manipulators=[],this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.indicatorsEnabled=!1,this.layer=new D({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.view=null}initialize(){U(this.view,this.layer),this._highlightHelper=new L({view:this.view}),this.refresh(),this.addHandles([m(()=>this.graphics.length,()=>this.refresh()),A(()=>{var t;return(t=this.view)==null?void 0:t.ready},()=>{this.addHandles([this.view.on("immediate-click",t=>this._clickHandler(t),y.TOOL),this.view.on("double-click",t=>this._doubleClickHandler(t),y.TOOL),this.view.on("pointer-down",t=>this._pointerDownHandler(t),y.TOOL),this.view.on("pointer-move",t=>this._pointerMoveHandler(t),y.TOOL),this.view.on("pointer-up",t=>this._pointerUpHandler(t),y.TOOL),this.view.on("drag",t=>this._dragHandler(t),y.TOOL),this.view.on("key-down",t=>this._keyDownHandler(t),y.TOOL)])},{once:!0,initial:!0}),m(()=>this.view,t=>{this._highlightHelper.removeAll(),this._highlightHelper.view=t})])}destroy(){var t;this._removeIndicators(),(t=this.view.map)==null||t.remove(this.layer),this.layer.destroy(),this.reset(),this._manipulators.forEach(i=>i.destroy()),this._manipulators=null}set highlightsEnabled(t){var i,e;(i=this._highlightHelper)==null||i.removeAll(),this._set("highlightsEnabled",t),t&&((e=this._highlightHelper)==null||e.add(this.graphics))}get state(){const t=this.view.ready,i=this.graphics.length>0,e=this._activeGraphic;return t&&i?e?"moving":"active":t?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(t,i){const e=this.graphics[t];e&&(e.set("geometry",i),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._setUpManipulators(),this._syncLayerViews()}_clickHandler(t){const i=this._findTargetGraphic(_(t));if(i){const e=new V(i,this.graphics.indexOf(i),t.x,t.y,t);this.emit("graphic-click",e),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(e)}}_doubleClickHandler(t){const i=this._findTargetGraphic(_(t));if(i){const e=new C(i,this.graphics.indexOf(i),t.x,t.y,t);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick&&this.callbacks.onGraphicDoubleClick(e)}}_pointerDownHandler(t){const i=this._findTargetGraphic(_(t));if(i){this._activeGraphic=i;const{x:e,y:s}=t,h=new X(i,this.graphics.indexOf(i),e,s,t);this.emit("graphic-pointer-down",h),this.callbacks.onGraphicPointerDown&&this.callbacks.onGraphicPointerDown(h)}else this._activeGraphic=null}_pointerUpHandler(t){if(this._activeGraphic){const{x:i,y:e}=t,s=this.graphics.indexOf(this._activeGraphic),h=new J(this._activeGraphic,s,i,e,t);this.emit("graphic-pointer-up",h),this.callbacks.onGraphicPointerUp&&this.callbacks.onGraphicPointerUp(h)}}_pointerMoveHandler(t){if(this._dragEvent)return;const i=this._findTargetGraphic(_(t));if(i){const{x:e,y:s}=t;if(this._hoverGraphic){if(this._hoverGraphic===i)return;const a=this.graphics.indexOf(this._hoverGraphic),o=new x(this.graphics[a],a,e,s,t);this._hoverGraphic=null,this.emit("graphic-pointer-out",o),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(o)}const h=this.graphics.indexOf(i),r=new q(i,h,e,s,t);return this._hoverGraphic=i,this.emit("graphic-pointer-over",r),void(this.callbacks.onGraphicPointerOver&&this.callbacks.onGraphicPointerOver(r))}if(this._hoverGraphic){const{x:e,y:s}=t,h=this.graphics.indexOf(this._hoverGraphic),r=new x(this.graphics[h],h,e,s,t);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut&&this.callbacks.onGraphicPointerOut(r)}}_dragHandler(t){var w;if(t.action!=="start"&&!this._dragEvent||!((w=this._activeGraphic)!=null&&w.geometry))return;t.action==="start"&&this._removeIndicators(),t.stopPropagation();const{action:i,x:e,y:s}=t,h=this.graphics.indexOf(this._activeGraphic),r=this._dragEvent?e-this._dragEvent.x:0,a=this._dragEvent?s-this._dragEvent.y:0,o=e-t.origin.x,d=s-t.origin.y,v=i==="start"?this._activeGraphic.geometry:this._initialDragGeometry,g=G(v,o,d,this.view);if(this._activeGraphic.geometry=g,this.enableMoveAllGraphics&&this.graphics.forEach(c=>{c!==this._activeGraphic&&(c.geometry=G(c.geometry,r,a,this.view))}),this._dragEvent=t,i==="start"){this._initialDragGeometry=$(v);const c=new z(this._activeGraphic,this.graphics,h,e,s,r,a,o,d,t);this.emit("graphic-move-start",c),this.callbacks.onGraphicMoveStart&&this.callbacks.onGraphicMoveStart(c),c.defaultPrevented&&this._activeGraphic.set("geometry",v)}else if(i==="update"){const c=new F(this._activeGraphic,this.graphics,h,e,s,r,a,o,d,t);this.emit("graphic-move",c),this.callbacks.onGraphicMove&&this.callbacks.onGraphicMove(c),c.defaultPrevented&&(this._activeGraphic.geometry=v)}else{const c=new j(this._activeGraphic,this.graphics,h,e,s,r,a,o,d,t);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",c),this.callbacks.onGraphicMoveStop&&this.callbacks.onGraphicMoveStop(c),c.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(t){t.key!=="a"&&t.key!=="d"&&t.key!=="n"||this.state!=="moving"||t.stopPropagation()}_findTargetGraphic(t){const i=this.view.toMap(t),e=this.graphics;let s=null,h=Number.MAX_VALUE;this._syncLayerViews();const r=this._layerViews.flatMap(a=>"graphicsViews"in a?Array.from(a.graphicsViews(),o=>o.hitTest(i)).flat():a.graphicsView.hitTest(i)).filter(a=>e.includes(a)).sort((a,o)=>e.indexOf(a)-e.indexOf(o));return r.length?r[0]:(this._manipulators.forEach(a=>{const o=a.intersectionDistance(t);o!=null&&oe.destroy()),this._manipulators=t.length?t.map(e=>new I({graphic:e,view:i})):[]}_setUpHighlights(){this.highlightsEnabled&&this._highlightHelper.add(this.graphics)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const t of this.graphics){const i=t.clone();i.symbol=this._getSymbolForIndicator(t),this._indicators.push(i),this.addHandles(m(()=>t.symbol,()=>this._setUpIndicators()),k)}this.layer.addMany(this._indicators)}}_removeIndicators(){this.removeHandles(k),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach(t=>t.destroy()),this._indicators=[])}_getSymbolForIndicator(t){if(t.symbol==null)return null;switch(t.symbol.type){case"cim":return new u({style:"circle",size:12,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:e,yoffset:s,height:h,width:r}=t.symbol,a=h===r?r:Math.max(h,r);return new u({xoffset:e,yoffset:s,size:a,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:e,yoffset:s,size:h,style:r}=t.symbol;return new u({xoffset:e,yoffset:s,style:r==="circle"?"circle":"square",size:h+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new S({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new T({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=t.symbol;return new u({xoffset:e,yoffset:s,size:12,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}};l([p()],n.prototype,"_activeGraphic",void 0),l([p({readOnly:!0})],n.prototype,"type",void 0),l([p()],n.prototype,"callbacks",void 0),l([p()],n.prototype,"enableMoveAllGraphics",void 0),l([p()],n.prototype,"graphics",void 0),l([p({value:!1})],n.prototype,"highlightsEnabled",null),l([p()],n.prototype,"indicatorsEnabled",void 0),l([p()],n.prototype,"layer",void 0),l([p({readOnly:!0})],n.prototype,"state",null),l([p()],n.prototype,"view",void 0),n=l([E("esri.views.draw.support.GraphicMover")],n);const K=n,Y=Object.freeze(Object.defineProperty({__proto__:null,default:K},Symbol.toStringTag,{value:"Module"}));export{Y as G,K as U,L as l}; diff --git a/dist/assets/GraphicState-2UcU5UAX.js b/dist/assets/GraphicState-2UcU5UAX.js new file mode 100644 index 0000000..3bdb5d6 --- /dev/null +++ b/dist/assets/GraphicState-2UcU5UAX.js @@ -0,0 +1 @@ +import{e as l,p as E,kz as T,ab as n,y as a,c as D,b2 as o,kX as x,hS as _,kY as d,kZ as M,bB as F,K as S,b4 as O,b5 as v,as as j,at as I,au as k,b6 as b,k_ as B,b7 as H,i8 as R,bf as q,h$ as U,gn as L,bo as N,k$ as V,bq as Y,hs as K,l0 as X,aa as W}from"./index-J0iiHjMT.js";import{V as $}from"./ExtendedLineVisualElement-YbjiXiBG.js";import{r as A,t as Z}from"./vec4f32-NvfHy9q7.js";import{t as J}from"./EngineVisualElement-eZNKTKsI.js";import{c as Q}from"./Laserlines.glsl-nvjcCsAw.js";const f=.3;function g(s,e){e&&Object.assign(s,e)}class ee{constructor(e){this.height=90,this.coneHeight=40,this.coneWidth=23,this.width=3,this.renderOccluded=o.Opaque,this.color=e.accent}}class C{constructor({colors:e,...t}){this.size=11,this.outlineSize=1,this.collisionPadding=9,this.color=e.accent,this.outlineColor=e.outline,this.renderOccluded=o.Opaque,this.hoverOutlineColor=e.selectedOutline,g(this,t)}applyColor(e){this._apply(this.color,e)}applyOutline(e){this._apply(this.outlineColor,e)}applyHoverOutline(e){this._apply(this.hoverOutlineColor,e)}_apply(e,t){t.setParameters({color:d(e),renderOccluded:this.renderOccluded})}}let te=class{constructor({colors:e,...t}){this.size=40,this.height=.2,this.offset=.25,this.collisionPadding=2,this.renderOccluded=o.Transparent,this.minSquaredEdgeLength=900,this.color=_(e.accent,.5),this.hoverColor=e.accent,g(this,t)}applyColor(e){this._apply(this.color,e)}applyHover(e){this._apply(this.hoverColor,e)}_apply(e,t){t.setParameters({color:d(e),renderOccluded:this.renderOccluded})}};class re{constructor(e){this.vertex=new C({colors:e,color:e.accent,outlineColor:e.outline}),this.edge=new C({colors:e,color:x(_(e.accent,2/3),.5),outlineColor:_(e.outline,.5),size:8,collisionPadding:8}),this.selected=new C({colors:e,color:e.selected,outlineColor:e.outline}),this.edgeOffset=new te({colors:e})}}class w{constructor({colors:e,...t}){this.width=1.5,this.stipplePattern=M(3.3),this.falloff=0,this.innerWidth=1.5,this.renderOccluded=o.OccludeAndTransparent,this.color=e.selected,this.stippleOffColor=e.outline,this.innerColor=e.selected,g(this,t)}apply(e){e.color=d(this.color),e.width=this.width,e.stipplePattern=this.stipplePattern,e.stippleOffColor=d(this.stippleOffColor),e.falloff=this.falloff,e.innerWidth=this.innerWidth,e.innerColor=d(this.innerColor),e.renderOccluded=this.renderOccluded}}class se{constructor({colors:e,...t}){this.size=4,this.outlineSize=1,this.shape="square",this.color=e.selected,this.outlineColor=e.outline,g(this,t)}apply(e){e.color=d(this.color),e.size=this.size,e.outlineSize=this.outlineSize,e.outlineColor=d(this.outlineColor),e.primitive=this.shape}}class y{constructor({colors:e,...t}){this.innerWidth=1,this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=f,this.globalAlphaContrastBoost=1.5,this.radius=3,this.innerColor=e.selected,this.glowColor=e.accent,this.heightFillColor=e.accent,g(this,t)}apply(e,t=1){const r={glowColor:n.toUnitRGB(this.glowColor),glowFalloff:this.glowFalloff,glowWidth:this.glowWidth,innerColor:n.toUnitRGB(this.innerColor),innerWidth:this.innerWidth,globalAlpha:this.globalAlpha*t*this.glowColor.a,globalAlphaContrastBoost:this.globalAlphaContrastBoost,intersectsLineRadius:this.radius};"style"in e?e.style=r:e.laserlineStyle=r}}class ie{constructor(e){this.outline=new w({colors:e,color:e.stippleOff,renderOccluded:o.OccludeAndTransparentStencil,stippleOffColor:e.stippleOn,innerWidth:0}),this.staged=new w({colors:e,color:e.stippleOn,renderOccluded:o.OccludeAndTransparentStencil,innerColor:e.stagedSolid,stippleOffColor:e.stippleOff}),this.shadowStyle=new y({colors:e,globalAlpha:f,glowColor:e.accent,glowFalloff:8,glowWidth:8,innerColor:e.selected,innerWidth:1})}}class le{constructor(e){this.outline=new se({colors:e,color:e.selected,outlineColor:e.outline,outlineSize:1,shape:"circle",size:4}),this.shadowStyle=new y({colors:e,globalAlpha:f,glowColor:e.accent,glowFalloff:1.5,glowWidth:6,innerColor:e.selected,innerWidth:1,radius:2})}}class oe extends w{constructor({colors:e,...t}){super({colors:e}),this.extensionType=$.GROUND_RAY,g(this,t)}}class ne{constructor(e){this.laserlineAlphaMultiplier=1.5,this.heightPlaneAngleCutoff=20,this.lineGraphics=new ie(e),this.pointGraphics=new le(e),this.heightPlane=new y({colors:e,globalAlpha:f,glowColor:e.accent,glowFalloff:8,glowWidth:8,innerColor:e.selected,innerWidth:1}),this.heightBox=new y({colors:e,globalAlpha:f,glowColor:e.accent,glowFalloff:8,glowWidth:8,innerColor:e.selected,innerWidth:0,heightFillColor:e.accent}),this.zVerticalLine=new oe({colors:e,color:_(e.accent,5*f/3),falloff:2,innerColor:_(e.selected,0),renderOccluded:o.OccludeAndTransparent,stipplePattern:null,width:5,extensionType:$.GROUND_RAY})}}let c=class extends E{constructor(e){super(e)}get colors(){const e=this.getTheme().accentColor,t=e.a;return{accent:e,contrast:T(e),selected:n.fromArray([255,255,255,t]),selectedOutline:n.fromArray([255,255,255,t]),staged:n.fromArray([12,207,255,t]),stagedSolid:n.fromArray([12,207,255,1]),outline:n.fromArray([0,0,0,.5*t]),stippleOn:n.fromArray([255,255,255,1]),stippleOff:n.fromArray([0,0,0,.5])}}get visualElements(){return new ne(this.colors)}get manipulators(){return new re(this.colors)}get zManipulator(){return new ee(this.colors)}};l([a()],c.prototype,"colors",null),l([a()],c.prototype,"visualElements",null),l([a()],c.prototype,"manipulators",null),l([a()],c.prototype,"zManipulator",null),l([a()],c.prototype,"getTheme",void 0),c=l([D("esri.views.3d.interactive.editingTools.settings.Settings")],c);class ge extends J{constructor(e){super(e),this._attachmentOrigin=F(0,0,0,null),this._attachmentOriginDirty=!0,this.events=new S,this._geometry=null,this._width=1,this._color=A(1,0,1,1),this._innerWidth=0,this._innerColor=A(1,1,1,1),this._stipplePattern=null,this._stippleOffColor=null,this._falloff=0,this._elevationInfo=null,this._laserlineStyle=null,this._laserlineEnabled=!1,this._renderOccluded=o.OccludeAndTransparentStencil,this._attachmentOrigin.spatialReference=e.view.spatialReference,this._laserline=new Q({view:e.view,isDecoration:e.isDecoration}),this.applyProperties(e),this.attached=e.attached??!0}destroy(){this._laserline.destroy(),super.destroy()}createObject3DResourceFactory(e){return{view:e,createResources:t=>this._createObject3DResources(t),destroyResources:t=>this._destroyExternalResources(t),recreateGeometry:(t,r)=>{t.geometries.length=0,this._recreateGeometry(r,t.material,t.geometries)}}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:t=>this._destroyExternalResources(t),recreateGeometry:t=>{t.geometries=this._createRenderGeometriesDraped(t.material),this._attachmentOriginChanged()}}}get _laserlineAttached(){return this.attached&&this.visible&&this._laserlineStyle!=null&&!this.isDraped&&this.laserlineEnabled}onAttachedChange(e){this._laserline.attached=this._laserlineAttached,e&&this._attachmentOriginChanged()}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get color(){return this._color}set color(e){O(e,this._color)||(v(this._color,e),this._updateMaterial())}get innerWidth(){return this._innerWidth}set innerWidth(e){e!==this._innerWidth&&(this._innerWidth=e,this._updateMaterial())}get innerColor(){return this._innerColor}set innerColor(e){O(e,this._innerColor)||(v(this._innerColor,e),this._updateMaterial())}get stipplePattern(){return this._stipplePattern}set stipplePattern(e){const t=e!=null!=(this._stipplePattern!=null);this._stipplePattern=e,t?this.recreate():this._updateMaterial()}get stippleOffColor(){return this._stippleOffColor}set stippleOffColor(e){e&&this._stippleOffColor&&O(e,this._stippleOffColor)||(this._stippleOffColor=e?Z(e):null,this._updateMaterial())}get falloff(){return this._falloff}set falloff(e){e!==this._falloff&&(this._falloff=e,this._updateMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get laserlineStyle(){return this._laserlineStyle}set laserlineStyle(e){this._laserlineStyle=e,this._laserline.attached=this._laserlineAttached,e!=null&&(this._laserline.style=e)}get laserlineEnabled(){return this._laserlineEnabled}set laserlineEnabled(e){this._laserlineEnabled!==e&&(this._laserlineEnabled=e,this._laserline.attached=this._laserlineAttached)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}get attachmentOrigin(){var r;if(!this._attachmentOriginDirty)return this._attachmentOrigin;const e=(r=this.object3dResources.resources)==null?void 0:r.geometries;if(!e||e.length===0)return null;j(p,0,0,0);let t=0;for(const i of e)i.computeAttachmentOrigin(P)&&(I(p,p,P),t++);return t===0?null:(k(p,p,1/t),this.view.renderCoordsHelper.fromRenderCoords(p,this._attachmentOrigin),this._attachmentOriginDirty=!1,this._attachmentOrigin)}_updateMaterial(){this.object3dResources.resources!=null&&this.object3dResources.resources.material.setParameters(this._materialParameters),this.drapedResources.resources!=null&&this.drapedResources.resources.material.setParameters(this._materialParameters)}get _isClosed(){return this.geometry!=null&&this.geometry.type==="polygon"}get _materialParameters(){return{width:this._width,color:this._color,stippleOffColor:this._stippleOffColor,stipplePattern:this._stipplePattern,stipplePreferContinuous:!1,isClosed:this._isClosed,falloff:this._falloff,innerColor:this._innerColor,innerWidth:this._innerWidth,join:"round",hasPolygonOffset:!0,renderOccluded:this._normalizedRenderOccluded,isDecoration:this.isDecoration}}get _normalizedRenderOccluded(){return this.isDraped&&this._renderOccluded===o.OccludeAndTransparentStencil?o.OccludeAndTransparent:this._renderOccluded}_recreateGeometry(e,t,r){this._createRenderGeometries(t,r);for(const i of r)e.addGeometry(i);this._attachmentOriginChanged()}_attachmentOriginChanged(){this._attachmentOriginDirty=!0,this.events.emit("attachment-origin-changed")}_destroyExternalResources(e){e.geometries=[]}_createObject3DResources(e){const t=new b(this._materialParameters),r=new Array;return this._recreateGeometry(e,t,r),{material:t,geometries:r,forEach:i=>{i(t),r.forEach(i)}}}_createDrapedResources(){const e=new b(this._materialParameters);return{material:e,geometries:this._createRenderGeometriesDraped(e)}}_createRenderGeometriesDraped(e){const{geometry:t,view:r}=this,i=r.basemapTerrain.spatialReference;return t==null||i==null?[]:B(t,i).lines.map(({position:h})=>{const m={overlayInfo:{spatialReference:i,renderCoordsHelper:r.renderCoordsHelper},attributeData:{position:h},removeDuplicateStartEnd:this._isClosed};return new H(R(e,m))})}calculateMapBounds(e){if(this.object3dResources.resources==null)return!1;const t=this.view.renderCoordsHelper;for(const r of this.object3dResources.resources.geometries){const i=r.attributes.get(q.POSITION),h=U(i.data.length);L(i.data,t.spatialReference,0,h,this.view.spatialReference,0,i.data.length/3),N(e,h)}return!0}_createRenderGeometries(e,t){const r=this.geometry;if(r==null)return;const i=V(r,this.view.elevationProvider,this.view.renderCoordsHelper,Y.fromElevationInfo(this.elevationInfo??new K({mode:X(r,null)}))),h=new Array;for(const{position:m,mapPositions:z}of i.lines){const G={mapPositions:z,attributeData:{position:m},removeDuplicateStartEnd:this._isClosed};t.push(R(e,G)),h.push(m)}this._laserline.pathVerticalPlane=h}}const P=W(),p=W();let u=class extends S.EventedAccessor{constructor(s){super(s),this.tracking=!1,this.displaying=!1,this.isDraped=!1}};l([a({constructOnly:!0})],u.prototype,"graphic",void 0),l([a()],u.prototype,"tracking",void 0),l([a()],u.prototype,"displaying",void 0),l([a()],u.prototype,"isDraped",void 0),u=l([D("esri.views.3d.layers.graphics.GraphicState")],u);export{u as e,ge as w,c as z}; diff --git a/dist/assets/Graphics3DObjectStates--mMi4sdi.js b/dist/assets/Graphics3DObjectStates--mMi4sdi.js new file mode 100644 index 0000000..8f4fa6f --- /dev/null +++ b/dist/assets/Graphics3DObjectStates--mMi4sdi.js @@ -0,0 +1 @@ +import{bY as ze,jo as Me,rH as ke,jn as He,rI as Be,jm as Ne,rJ as We,V as qe,rK as Ye,rL as Ze,rM as Xe,rN as Je,eh as te,e as o,y as h,c as L,p as V,K as ie,p_ as F,aS as Qe,e_ as Ke,eZ as et,rO as Ue,rP as tt,jR as it,s as k,n as v,rQ as st,qM as rt,a2 as se,dJ as at,ei as je,aX as nt,aY as ot,rR as $e,dA as lt,lU as ht,Z as re,fN as J,mM as dt,aE as ne,fO as ct,ek as pt,aa as U,G as f,rS as yt,rT as oe,rU as ut,rV as gt,dT as mt,aj as le,cd as Q,rW as _t,rX as E,rY as R,rZ as bt,r_ as ft,i9 as he,ia as de,d as S,F as vt,fl as St,A as Ct,re as Fe,ai as B,ak as ce,E as T,bD as wt,lt as Gt,r$ as ae,s0 as xt,bH as It,s1 as Et,w as Rt,as as pe,bn as ye,at as ue,au as Dt,T as Ot,s2 as Pt,c4 as ge,s3 as At,s4 as Lt,al as Vt,s5 as me,s6 as _e,f as N,s7 as Ut,lx as jt,fR as $t,s8 as Ft,s9 as be,c1 as Tt,ct as zt,c8 as W,sa as Mt,sb as kt,sc as Ht,sd as Bt,d6 as Nt,c7 as Wt,e3 as fe,jk as ve,se as q,f7 as qt,ae as H,sf as Yt,l9 as Zt,sg as Xt,gn as Se,k as Jt,q5 as Ce,ov as we,jQ as Ge,or as Y,ez as Qt,sh as xe,si as Kt,sj as ei,C as ti,P as ii,mJ as Ie,c9 as Ee}from"./index-J0iiHjMT.js";import{o as j}from"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import{s as si}from"./PooledRBush-o8tLYBG5.js";const ri=ze.fromSimpleMarkerSymbol(Me),ai=ke.fromSimpleLineSymbol(He),ni=Be.fromSimpleFillSymbol(Ne),oi=new We({symbolLayers:new qe([new Ye({material:{color:Ze},edges:new Xe({size:"1px",color:Je})})])});function li(t){if(t==null)return null;switch(t.type){case"mesh":return oi;case"point":case"multipoint":return ri;case"polyline":return ai;case"polygon":case"extent":return ni}return null}let hi=class{constructor(e,i,s){this.maximumTotalNumberOfVertices=e,this.maximumNumberOfFeatures=i,this.averageSymbolComplexity=s}};const Re=te();let x=class extends V{constructor(e){super(e),this.events=new ie,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.featureAdapter={getAttribute:(i,s)=>"graphic"in i?i.graphic.attributes[s]:j.getAttribute(i,s),getAttributes:i=>"graphic"in i?i.graphic.attributes:j.getAttributes(i),getObjectId:i=>"graphic"in i?F(i.graphic,this.objectIdField)??void 0:j.getObjectId(i),getGeometry:i=>"graphic"in i?i.getAsOptimizedGeometry(this.hasZ,this.hasM):j.getGeometry(i),getCentroid:(i,s)=>{if("graphic"in i){let r=null;i.centroid!=null?r=i.centroid:i.graphic.geometry.type==="point"&&Qe(i.graphic.geometry,De,this.viewSpatialReference)&&(r=De);const a=new Array(2+(s.hasZ?1:0)+(s.hasM?1:0));return r==null?(a[0]=0,a[1]=0,a[2]=0,a[3]=0):(a[0]=r.x,a[1]=r.y,s.hasZ&&(a[2]=r.hasZ?r.z:0),s.hasM&&(a[s.hasZ?3:2]=r.hasM?r.m:0)),new Ke([],a)}return j.getCentroid(i,s)},cloneWithGeometry:(i,s)=>"graphic"in i?new et(s,this.featureAdapter.getAttributes(i),null,this.featureAdapter.getObjectId(i)):j.cloneWithGeometry(i,s)}}forEachInBounds(e,i){this.getSpatialIndex().forEachInBounds(e,i)}forEachBounds(e,i){const s=this.getSpatialIndex();for(const r of e){const a=this.featureAdapter.getObjectId(r);s.getBounds(a,Re)!=null&&i(Re)}}};o([h({constructOnly:!0})],x.prototype,"getSpatialIndex",void 0),o([h({constructOnly:!0})],x.prototype,"forEach",void 0),o([h({constructOnly:!0})],x.prototype,"hasZ",void 0),o([h({constructOnly:!0})],x.prototype,"hasM",void 0),o([h({constructOnly:!0})],x.prototype,"objectIdField",void 0),o([h({constructOnly:!0})],x.prototype,"viewSpatialReference",void 0),o([h({constructOnly:!0})],x.prototype,"featureSpatialReference",void 0),x=o([L("esri.views.3d.layers.graphics.Graphics3DFeatureStore")],x);const De={type:"point",x:0,y:0,hasZ:!1,hasM:!1,spatialReference:null};let di=class extends Ue{constructor(e,i,s){super(e,i,s),this._calloutSymbolLayer=null,this.symbol.hasVisibleCallout()&&(this._calloutSymbolLayer=tt(this.symbol,i))}async doLoad(e){var s;const i=this._calloutSymbolLayer?it(this._calloutSymbolLayer.load()):null;try{await super.doLoad(e),k(e)}catch(r){throw(s=this._calloutSymbolLayer)==null||s.abortLoad(),r}i&&await i}destroy(){super.destroy(),this._calloutSymbolLayer=v(this._calloutSymbolLayer)}createGraphics3DGraphic(e,i){const s=super.createGraphics3DGraphic(e,i);if(this._calloutSymbolLayer!=null&&s!=null){const r=this._createCalloutGraphic(e);r&&s.setCalloutGraphic(r)}return s}globalPropertyChanged(e,i){return!!super.globalPropertyChanged(e,i)&&(!this._calloutSymbolLayer||this._calloutSymbolLayer.globalPropertyChanged(e,i,s=>s.calloutLayer))}updateGeometry(e,i){const s=super.updateGeometry(e,i);if(s&&this._calloutSymbolLayer){const r=e.calloutLayer;if(r)return this._calloutSymbolLayer.updateGeometry(r,i)}return s}_createCalloutGraphic(e){const i=e.renderingInfo;return e.renderingInfo=new st(i.renderer,i.symbol),this._calloutSymbolLayer.createGraphics3DGraphic(e)}};function ci(t,e,i){return t.type==="point-3d"?new di(t,e,i):new Ue(t,e,i)}let pi=class{constructor(e){var s;this._graphicsCore=e,this._idToState=new Map,this._states=new Set;const i=(s=e.owner.layer)==null?void 0:s.objectIdField;i?(this._getGraphicId=r=>F(r,i),this._getGraphics3DGraphicById=r=>this._graphicsCore.getGraphics3DGraphicByObjectId(r)):(this._getGraphicId=r=>r.uid,this._getGraphics3DGraphicById=r=>this._graphicsCore.getGraphics3DGraphicById(r))}destroy(){this._idToState.clear(),this._states.forEach((e,i)=>this.remove(i))}add(e){const i=se(()=>this.remove(e));if(this._states.has(e))return i;const s=this._getGraphicId(e.graphic),r=this._getGraphics3DGraphicById(s);return this._states.has(e)||this._states.add(e),this._ensureStateList(s).push(e),e.displaying=r!=null&&r.isVisible(),e.isDraped=r!=null&&r.isDraped,e.tracking=!0,r!=null&&e.emit("changed"),i}remove(e){if(this._states.has(e)){if(this._idToState.size){const i=this._getGraphicId(e.graphic),s=this._idToState.get(i);s&&(rt(s,e),s.length===0&&this._idToState.delete(i))}this._states.delete(e),e.tracking=!1,e.displaying=!1}}addGraphic(e){this._forEachState(e,i=>{i.displaying=e.isVisible(),i.isDraped=e.isDraped,i.emit("changed")})}removeGraphic(e){this._forEachState(e,i=>{i.displaying=!1,i.isDraped=!1})}updateGraphicGeometry(e){this._forEachState(e,i=>i.emit("changed"))}updateGraphicVisibility(e){this._forEachState(e,i=>i.displaying=e.isVisible())}allGraphicsDeleted(){this._states.forEach(e=>{e.displaying=!1})}_ensureStateList(e){const i=this._idToState.get(e);if(i)return i;const s=new Array;return this._idToState.set(e,s),s}_forEachState(e,i){if(this._states.size===0||this._idToState.size===0)return;const s=this._getGraphicId(e.graphic),r=this._idToState.get(s);r!=null&&r.forEach(i)}},O=class extends V{constructor(t){super(t),this._index=new si(9,at("esri-csp-restrictions")?e=>({minX:e.extent[0],minY:e.extent[1],maxX:e.extent[2],maxY:e.extent[3]}):[".extent[0]",".extent[1]",".extent[2]",".extent[3]"]),this._missing=new Set,this._boundsByFeature=new Map,this.spatialReference=null,this.hasZ=null,this.hasM=null,this.objectIdField=null,this.updating=!1}setup(t){this._addMany(t)}destroy(){this._missing.clear(),this._index=v(this._index),this._boundsByFeature.clear(),this._boundsByFeature=null}update(){this._missing.size>0&&(this._addMany(Array.from(this._missing.values())),this.updating=!1,this._missing.clear())}get updatingRemaining(){return this._missing.size}queryGraphicUIDsInExtent(t,e,i){e!=null&&e.equals(this.spatialReference)&&(w.minX=t[0],w.minY=t[1],w.maxX=t[2],w.maxY=t[3],this.update(),this._index.search(w,s=>i(s.graphic.uid)))}add(t){this._missing.add(t),this.updating=!0}remove(t){if(this._missing.delete(t))return void(this.updating=this._missing.size>0);this._index.remove(t);const e=F(t.graphic,this._get("objectIdField"));e!=null&&this._boundsByFeature.delete(e)}_addMany(t){if(t.length===0)return;const e=this._get("objectIdField");for(const i of t){i.computeExtent(this.spatialReference);const s=F(i.graphic,e);s!=null&&this._boundsByFeature.set(s,i.extent)}this._index.load(t)}clear(){this._index.clear(),this._missing.clear(),this._boundsByFeature.clear(),this.updating=!1}forEachInBounds(t,e){w.minX=t[0],w.minY=t[1],w.maxX=t[2],w.maxY=t[3],this.update(),this._index.search(w,i=>{e(i)})}getBounds(t,e){this.update();const i=this._boundsByFeature.get(t);return i?je(e,i):null}};o([h({constructOnly:!0})],O.prototype,"spatialReference",void 0),o([h({constructOnly:!0})],O.prototype,"hasZ",void 0),o([h({constructOnly:!0})],O.prototype,"hasM",void 0),o([h({constructOnly:!0})],O.prototype,"objectIdField",void 0),o([h()],O.prototype,"updating",void 0),o([h({readOnly:!0})],O.prototype,"updatingRemaining",null),O=o([L("esri.views.3d.layers.graphics.SpatialIndex2D")],O);const w={minX:0,minY:0,maxX:0,maxY:0},yi=1;let A=class extends ie.EventedMixin(V){get spatialReference(){var e;return(e=this.view)==null?void 0:e.spatialReference}constructor(e){super(e),this._elevationOffset=0,this._layerHandlesKey="layerHandles"}initialize(){this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersectLayers=[this.stageLayer],this._intersector=nt(this.view.state.viewingMode),this._intersector.options.store=ot.MIN;const e=this._computeLayerExtent(this.spatialReference,this.stageLayer);this._zmin=e[2],this._zmax=e[5];const i=this.stageLayer.events;this.addHandles([i.on("layerObjectAdded",({object:s})=>this._objectChanged(s)),i.on("layerObjectRemoved",({object:s})=>this._objectChanged(s)),i.on("geometryAdded",({object:s})=>this._objectChanged(s)),i.on("geometryRemoved",({object:s})=>this._objectChanged(s)),i.on("attributesChanged",({attribute:s,object:r})=>$e(s)&&this._objectChanged(r)),i.on("transformationChanged",s=>this._objectChanged(s))],this._layerHandlesKey)}dispose(){this.removeHandles(this._layerHandlesKey)}elevationInfoChanged(){const e=this.layer!=null?this.layer.elevationInfo:null;if(e!=null&&e.mode!=="on-the-ground"){const i=lt(this.layer.spatialReference),s=ht(e.unit??"meters");this._elevationOffset=(e.offset??0)*s/i}else this._elevationOffset=0}getElevation(e,i,s,r){if(_[0]=e,_[1]=i,_[2]=s,!this._renderCoordsHelper.toRenderCoords(_,r,_))return re.getLogger(this).error("could not project point for elevation alignment"),null;const a=this._elevationOffset,n=this._zmin+a,d=this._zmax+a;this._renderCoordsHelper.setAltitude(Oe,d,_),this._renderCoordsHelper.setAltitude(Pe,n,_);const l=c=>!!c.lastValidElevationBB;return this._intersector.reset(Oe,Pe,null),this._intersector.intersect(this._intersectLayers,null,yi,null,l),this._intersector.results.min.getIntersectionPoint(_)?this._renderCoordsHelper.getAltitude(_):null}_objectChanged(e){const i=this.spatialReference;if(!e.lastValidElevationBB||!i)return;J(D);const s=e.lastValidElevationBB;s.isEmpty()||this._expandExtent(i,s.min,s.max,D);const{min:r,max:a}=e.boundingVolumeWorldSpace;this._expandExtent(i,r,a,D),dt(D,K),this._zmin=Math.min(this._zmin,D[2]),this._zmax=Math.max(this._zmax,D[5]),Z.extent=K,Z.spatialReference=i,this.emit("elevation-change",Z),ne(s.min,r),ne(s.max,a)}_computeLayerExtent(e,i){return J(D),e!=null&&i.objects.forAll(s=>this._expandExtent(e,s.boundingVolumeWorldSpace.min,s.boundingVolumeWorldSpace.max,D)),D}_expandExtent(e,i,s,r){for(let a=0;a<8;++a)_[0]=1&a?i[0]:s[0],_[1]=2&a?i[1]:s[1],_[2]=4&a?i[2]:s[2],this._renderCoordsHelper.fromRenderCoords(_,_,e),ct(r,_);return r}};o([h({constructOnly:!0})],A.prototype,"layer",void 0),o([h({constructOnly:!0})],A.prototype,"stageLayer",void 0),o([h({constructOnly:!0})],A.prototype,"view",void 0),o([h()],A.prototype,"spatialReference",null),A=o([L("esri.views.3d.layers.support.StageLayerElevationProvider")],A);const D=J(),K=pt(),Z={spatialReference:null,extent:K,context:"scene"},_=U(),Oe=U(),Pe=U();var ee;const X=U(),ui=te(),Te="esri.views.3d.layers.graphics.Graphics3DCore",b=re.getLogger(Te);let p=ee=class extends V{get _viewSpatialReference(){return this.owner.view.spatialReference}get spatialIndex(){var t;return this._spatialIndex||(this._spatialIndex=new O({objectIdField:(t=this.owner.layer)==null?void 0:t.objectIdField,spatialReference:this._viewSpatialReference,hasZ:!!this.hasZ,hasM:!!this.hasM}),this._spatialIndex.setup(Array.from(this.graphics3DGraphics.values()))),this._spatialIndex.update(),this._spatialIndex}get numberOfGraphics(){return this._numberOfGraphics}get effectiveUpdatePolicy(){return this.currentRenderer!=null&&this.currentRenderer.type==="dictionary"?f.ASYNC:this._forcedUpdatePolicy??this.preferredUpdatePolicy}get featureStore(){return this._featureStore}get initializePromise(){return this._initializePromise}get scaleVisibility(){return this._scaleVisibility}get elevationAlignment(){return this._elevationAlignment}get objectStates(){return this._objectStates}get filterVisibility(){return this._filterVisibility}get updating(){var t,e,i;return!!(this._graphicsWaitingForSymbol.size>0||this.running||(t=this._elevationAlignment)!=null&&t.updating||(e=this._scaleVisibility)!=null&&e.updating||(i=this._filterVisibility)!=null&&i.updating||this._rendererChangeAbortController||this._elevationInfoChangeAbortController||this._updatingPendingLoadedGraphicsChange||this._frameTask.updating||this._loadingSymbols>0)}get running(){var t;return this._pendingUpdates.size>0||!!((t=this._spatialIndex)!=null&&t.updating)}get suspendedOrOutsideOfView(){var t;return this.owner.suspended||!!((t=this.owner.suspendInfo)!=null&&t.outsideOfView)}get updatingRemaining(){var t,e;return this.updating?this._pendingUpdates.size+.1*(((t=this._spatialIndex)==null?void 0:t.updatingRemaining)||0)+.1*(((e=this._elevationAlignment)==null?void 0:e.updatingRemaining)||0):0}get displayFeatureLimit(){const t=this.owner&&this.owner.view&&this.owner.view.qualitySettings,e=(t==null?void 0:t.graphics3D.minTotalNumberOfFeatures)??0,i=(t==null?void 0:t.graphics3D.maxTotalNumberOfFeatures)??0,s=(t==null?void 0:t.graphics3D.maxNumberOfDrawCalls)??0,r=(t==null?void 0:t.graphics3D.maxTotalNumberOfVertices)??0,a=this.averageSymbolComplexity,n=Math.max(1,(a==null?void 0:a.verticesPerFeature)??1),d=a&&a.drawCallsPerFeature>0&&s>0?s/a.drawCallsPerFeature:i,l=Math.ceil(r/n),c=Math.max(e,Math.min(i,l,d)),y=this._get("displayFeatureLimit");return y&&y.maximumTotalNumberOfVertices===r&&y.averageSymbolComplexity===a&&y.maximumNumberOfFeatures===c?y:new hi(r,c,a)}get averageSymbolComplexity(){const t=yt(this._symbolComplexities),e=this._get("averageSymbolComplexity");return t.numComplexities===0||e!=null&&(t.estimated&&(e.verticesPerFeature>=t.verticesPerFeature||e.verticesPerCoordinate>=t.verticesPerCoordinate||e.drawCallsPerFeature>=t.drawCallsPerFeature)||e.verticesPerFeature===t.verticesPerFeature&&e.verticesPerCoordinate===t.verticesPerCoordinate&&e.drawCallsPerFeature===t.drawCallsPerFeature)?e:t}get usedMemory(){const t=this.averageSymbolComplexity!=null&&this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel*this._numberOfGraphics:0,e=this._getSymbolComplexitiesUsed().reduce((a,n)=>a+n.memory.resourceBytes,0),i=this.owner.view._stage.renderer,s=this.owner.view.basemapTerrain.overlayManager.renderer,r=Array.from(this._symbols.values()).reduce((a,n)=>a+((n==null?void 0:n.symbolLayers.reduce((d,l)=>d+((l==null?void 0:l.materials.reduce((c,y)=>c+i.getMemoryForMaterial(y)+s.getMemoryForMaterial(y),0))??0),0))??0),0);return this._usedMemory+t+e+r}get usedMemoryPerGraphic(){if(this._usedMemory&&this._numberOfGraphics){const t=this._numberOfGraphics/(this._numberOfGraphics+Math.max(this._pendingAdds,this._pendingRemoves));return this._usedMemory/this._numberOfGraphics*t}if(this.averageSymbolComplexity!=null){const t=this.labelsEnabled?this.averageSymbolComplexity.memory.bytesPerFeatureLabel:0;return this.averageSymbolComplexity.memory.bytesPerFeature+t}return 0}get unprocessedMemoryEstimate(){return(this._pendingAdds-this._pendingRemoves)*this.usedMemoryPerGraphic}get _symbolComplexities(){return this.currentRenderer?this._getSymbolComplexitiesUsedOrRenderer(this.currentRenderer):this._getSymbolComplexitiesUsed()}get visible(){return this._visible}_getConvertedSymbol(t){var r;if(t.type==="web-style")return t.clone();const e=this._symbolConversionCache.get(t.id);if(e!=null)return e;const i=oe(t,{geometryType:((r=this.layer)==null?void 0:r.geometryType)??void 0,retainId:!0,hasLabelingContext:this._hasLabelingContext(t)}),s=i.symbol||null;return s==null&&i.error&&b.error(i.error.message),this._symbolConversionCache.set(t.id,s),s}_getSymbolComplexitiesUsedOrRenderer(t){if(t==null)return[];const e=t.getSymbols(),i="backgroundFillSymbol"in t?t.backgroundFillSymbol:null;if(!i&&!(e!=null&&e.length))return[];const s=[],r=this._getSymbolComplexityUsedOrRenderer(i);r!=null&&s.push(r);for(const a of e){const n=this._getSymbolComplexityUsedOrRenderer(a);n!=null&&s.push(n)}return s}_getSymbolComplexityUsedOrRenderer(t){if(t==null)return null;const e=this._symbols.get(t.id);if(e!=null)return e.complexity;const i=this._getConvertedSymbol(t);return i!=null?ut(i):null}_getSymbolComplexitiesUsed(){const t=[];return this._symbols.forEach(e=>{e!=null&&t.push(e.complexity)}),t}get _objectIdField(){return this.layer.objectIdField}constructor(t){super(t),this._propertiesPool=new gt({computedExtent:mt},this),this.computedExtent=null,this.currentRenderer=null,this.rendererHasGeometryOperations=!1,this._graphicStateTracking=null,this.graphics3DGraphics=new Map,this.stageLayer=null,this.stage=null,this._graphicsDrapedUids=new Set,this._graphicsBySymbol=new Map,this._symbolConversionCache=new Map,this._symbols=new Map,this._graphicsWithoutSymbol=new Map,this._graphicsWaitingForSymbol=new Map,this._graphicsUpdateId=0,this._frameTask=le,this._suspendSymbolCleanup=!1,this._arcadeOnDemand=null,this._rendererChangeAbortController=null,this._elevationInfoChangeAbortController=null,this._initializeAbortController=null,this._scaleVisibility=null,this._filterVisibility=null,this._spatialIndex=null,this.extentPadding=0,this._updatingPendingLoadedGraphicsChange=null,this._featureStore=null,this._deconflictor=null,this._labeler=null,this._objectStates=null,this._viewElevationProvider=null,this._stageLayerElevationProvider=null,this._sharedSymbolResourcesOwnerHandle=null,this._whenGraphics3DGraphicRequests={},this._pendingUpdates=new Map,this._numberOfGraphics=0,this._numberOfGraphicsProvidingElevation=0,this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this._loadingSymbols=0,this._pendingUpdatesPool=new Q({allocator:e=>e||new gi,deallocator:e=>(e.clear(),e)}),this._symbolWarningLogged=!1,this._geometryWarningLogged=!1,this._objectIdInvisibleSet=new Set,this._whenSymbolRemoved=new Q,this.preferredUpdatePolicy=f.SYNC,this._forcedUpdatePolicy=null,this.elevationFeatureExpressionEnabled=!0,this.owner=null,this.layer=null,this.graphicSymbolSupported=!0,this.getRenderingInfoWithoutRenderer=!1,this.setUidToIdOnAdd=!0,this.hasZ=null,this.hasM=null,this._usedMemory=0,this._visible=!1,this._startCreateGraphics=!1,this.symbolCreationContext=new _t(t.owner.view.resourceController.scheduler,(e,i)=>this._frameTask.schedule(e,i))}initialize(){var i;this._featureStore=new x({objectIdField:(i=this.owner.layer)==null?void 0:i.objectIdField,hasZ:!!this.hasZ,hasM:!!this.hasM,viewSpatialReference:this._viewSpatialReference,featureSpatialReference:this.owner.featureSpatialReference,getSpatialIndex:()=>this.spatialIndex,forEach:s=>this.graphics3DGraphics.forEach(s)});const t=(s,r,a)=>this.spatialIndex.queryGraphicUIDsInExtent(s,r,a),{componentFactories:e}=this;if(e.elevationAlignment!=null){const s=e.elevationAlignment(this,t);this._elevationAlignment=s}if(e.scaleVisibility!=null){const s=e.scaleVisibility(this,t);this._scaleVisibility=s}if(e.filterVisibility!=null){const s=e.filterVisibility({featureStore:this._featureStore,getFeatureCount:()=>this.graphics3DGraphics.size,updateFeatureVisibilities:r=>this.modifyGraphics3DGraphicVisibilities(a=>a.setVisibilityFlag(E.GRAPHIC,R.FILTER,r(F(a.graphic,this._objectIdField)))),setAllFeaturesVisibility:r=>this.modifyGraphics3DGraphicVisibilities(a=>a.setVisibilityFlag(E.GRAPHIC,R.FILTER,r)),clearFeaturesVisibility:()=>this.modifyGraphics3DGraphicVisibilities(r=>r.setVisibilityFlag(E.GRAPHIC,R.FILTER,!0))});this._filterVisibility=s}if(e.deconflictor!=null){const s=e.deconflictor(this);this._deconflictor=s}if(e.labeler!=null&&this._scaleVisibility!=null){const s=e.labeler(this,this._scaleVisibility);this._labeler=s}if(e.objectStates!=null){const s=e.objectStates(this);this._objectStates=s}this._initializeAbortController=new AbortController,this._initializePromise=this._initializeAsync()}async _initializeAsync(){var r,a,n,d;const t=(r=this._initializeAbortController)==null?void 0:r.signal,e=this.owner.view;this._viewElevationProvider=new bt(this._viewSpatialReference,e),this._initializeStage(e,this.layer.uid);const i=e.sharedSymbolResources;this.symbolCreationContext.sharedResources=i,this._sharedSymbolResourcesOwnerHandle=i.addGraphicsOwner(this.owner),this.currentRenderer!=null&&(this.symbolCreationContext.renderer=this.currentRenderer),this.symbolCreationContext.stage=this.stage,this.symbolCreationContext.streamDataRequester=i.streamDataRequester,this.symbolCreationContext.renderCoordsHelper=e.renderCoordsHelper,this.symbolCreationContext.layer=this.layer,this.symbolCreationContext.graphicsCoreOwner=this.owner,this.symbolCreationContext.localOriginFactory=new ft(e.renderSpatialReference),this.symbolCreationContext.elevationProvider=e.elevationProvider,this.symbolCreationContext.notifyGraphicGeometryChanged=l=>this.notifyGraphicGeometryChanged(l),this.symbolCreationContext.notifyGraphicVisibilityChanged=l=>this.notifyGraphicVisibilityChanged(l);const s=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);if(this.symbolCreationContext.featureExpressionInfoContext=await de(s,this._viewSpatialReference,t,b),k(t),this.symbolCreationContext.screenSizePerspectiveEnabled=e.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this.symbolCreationContext.physicalBasedRenderingEnabled=!!((a=this.owner.view.qualitySettings)!=null&&a.physicallyBasedRenderingEnabled),this.symbolCreationContext.skipHighSymbolLods=!!((d=(n=this.owner.view.qualitySettings)==null?void 0:n.graphics3D)!=null&&d.skipHighSymbolLods),"drapeSourceType"in this.owner){const{owner:l}=this;this.symbolCreationContext.drapeSourceRenderer=e.basemapTerrain.overlayManager.registerGeometryDrapeSource(l),this.addHandles(se(()=>e.basemapTerrain.overlayManager.unregisterDrapeSource(l)))}this.addHandles([S(()=>this.suspendedOrOutsideOfView,()=>this._frameTask.reschedule(()=>this._updateLayerVisibility())),S(()=>{var l,c;return[(l=this.layer)==null?void 0:l.screenSizePerspectiveEnabled,(c=this.owner.view)==null?void 0:c.screenSizePerspectiveEnabled]},()=>{var c;const l=e.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled;l!==this.symbolCreationContext.screenSizePerspectiveEnabled&&(this.symbolCreationContext.screenSizePerspectiveEnabled=l,(c=this._labeler)==null||c.reset(),this.recreateAllGraphicsAndSymbols())}),S(()=>this.owner.slicePlaneEnabled,l=>this._slicePlaneEnabledChange(!!l)),S(()=>{var l;return(l=this.owner.view.state)==null?void 0:l.rasterPixelRatio},()=>this._pixelRatioChange()),S(()=>{var l;return!!((l=this.owner.view.qualitySettings)!=null&&l.physicallyBasedRenderingEnabled)},l=>this._physicalBasedRenderingChange(l)),S(()=>{var l,c;return!!((c=(l=this.owner.view.qualitySettings)==null?void 0:l.graphics3D)!=null&&c.skipHighSymbolLods)},l=>this._skipHighSymbolLoDsChange(l)),vt(()=>{var l;return(l=e.basemapTerrain)==null?void 0:l.tilingScheme},l=>{if(l.spatialReference.equals(this.symbolCreationContext.overlaySR)||e.basemapTerrain.spatialReference==null||(this.symbolCreationContext.overlaySR=e.basemapTerrain.spatialReference),this.hasHandles("loaded-graphics"))this.recreateAllGraphics();else{const c=()=>{var y;return(y=this.owner)==null?void 0:y.loadedGraphics};this.addHandles([St(c,"change",y=>{this._graphicsCollectionChanged(y),this._signalUpdatingDuringAsyncLoadedGraphicsChange()},{onListenerAdd:()=>{this.recreateAllGraphics(),this._signalUpdatingDuringAsyncLoadedGraphicsChange()}})],"loaded-graphics")}},{initial:!0}),S(()=>this.effectiveUpdatePolicy,l=>{this.stageLayer!=null&&(this.stageLayer.updatePolicy=l),this.symbolCreationContext.isAsync=this.effectiveUpdatePolicy===f.ASYNC,l===f.SYNC&&this.runTask(Fe)},Ct)]),this._frameTask=e.resourceController.scheduler.registerTask(B.GRAPHICS_CORE,this),this.layer&&"featureReduction"in this.layer&&this.addHandles(S(()=>this.layer.featureReduction,()=>this._deconflictor.featureReductionChange())),this.notifyChange("averageSymbolComplexity"),this.rendererChange(this.owner.renderer).catch(()=>{}),this._initializeAbortController=null}_abortInitialize(){this._initializeAbortController&&(this._initializeAbortController.abort(),this._initializeAbortController=null)}destroy(){var t,e,i,s;this._abortInitialize(),this._abortRendererChange(),this._abortElevationInfoChange(),this._frameTask.remove(),this._frameTask=le,(e=(t=this.owner.view)==null?void 0:t.deconflictor)==null||e.removeGraphicsOwner(this),(s=(i=this.owner.view)==null?void 0:i.labeler)==null||s.removeGraphicsOwner(this),this._elevationAlignment=v(this._elevationAlignment),this._scaleVisibility=v(this._scaleVisibility),this._filterVisibility=v(this._filterVisibility),this._deconflictor=null,this._labeler=null,this._objectStates=v(this._objectStates),this.clear(),this._featureStore=v(this._featureStore),this._updatingPendingLoadedGraphicsChange=ce(this._updatingPendingLoadedGraphicsChange),this._graphicStateTracking=v(this._graphicStateTracking),this.stage&&(this.stageLayer=v(this.stageLayer),this.stage=null),this._set("owner",null);for(const r in this._whenGraphics3DGraphicRequests)this._whenGraphics3DGraphicRequests[r].reject(new T("graphic:layer-destroyed","Layer has been destroyed"));this._whenGraphics3DGraphicRequests=null,this._sharedSymbolResourcesOwnerHandle=ce(this._sharedSymbolResourcesOwnerHandle),this._propertiesPool=v(this._propertiesPool),this._pendingUpdatesPool=null,this._symbolConversionCache.clear(),this._objectIdInvisibleSet.clear(),this._spatialIndex=v(this._spatialIndex)}clear(){var t,e;(t=this._objectStates)==null||t.allGraphicsDeleted(),this._graphicStateTracking!=null&&this._graphicStateTracking.allGraphicsDeleted(),this.graphics3DGraphics.forEach(i=>i.destroy()),(e=this._spatialIndex)==null||e.clear(),this.graphics3DGraphics.clear(),this._numberOfGraphics=0,this._usedMemory=0,this._updateLayerVisibility(),this._symbols.forEach(v),this._symbols.clear(),this._graphicsBySymbol.clear(),this._graphicsWithoutSymbol.clear(),this._graphicsWaitingForSymbol.clear(),this._pendingUpdates.clear(),this._pendingUpdatesPool.clear(),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1,this.notifyChange("updating"),this.notifyChange("running"),this.notifyChange("updatingRemaining"),this._featureStore.events.emit("changed")}_initializeStage(t,e){this.stage=t._stage,this.stageLayer=new wt(this.stage,{pickable:!this.suspendedOrOutsideOfView,updatePolicy:this.effectiveUpdatePolicy},e);const i=this.stageLayer.events;i.on("transformationChanged",s=>this.notifyGraphicGeometryChanged(s.graphicUid)),i.on("shaderTransformationChanged",s=>this.notifyGraphicGeometryChanged(s.graphicUid)),i.on("visibilityChanged",s=>this.notifyGraphicVisibilityChanged(s.graphicUid)),i.on("geometryAdded",s=>this.notifyGraphicGeometryChanged(s.object.graphicUid)),i.on("geometryRemoved",s=>this.notifyGraphicGeometryChanged(s.object.graphicUid)),i.on("attributesChanged",s=>$e(s.attribute)&&this.notifyGraphicGeometryChanged(s.object.graphicUid))}notifyGraphicGeometryChanged(t){if(this._graphicStateTracking==null||t==null)return;const e=this.graphics3DGraphics.get(t);e&&this._graphicStateTracking.updateGraphicGeometry(e)}notifyGraphicVisibilityChanged(t){if(this._graphicStateTracking==null||t==null)return;const e=this.graphics3DGraphics.get(t);e&&this._graphicStateTracking.updateGraphicVisibility(e)}_updateLayerVisibility(){const t=this.displayFeatureLimit.maximumNumberOfFeatures,e=this._numberOfGraphics>t*mi,i=!this.suspendedOrOutsideOfView&&!e;i!==this._visible&&(this._visible=i,i?(this.stageLayer.pickable=!0,this.updateAllGraphicsVisibility()):(this.stageLayer.pickable=!1,this._hideAllGraphics()),this._updateStageLayerVisibility())}_updateStageLayerVisibility(){this.stageLayer.visible=this._visible&&(this.layer.opacity==null||this.layer.opacity>0)}getGraphics3DGraphicById(t){return t!=null?this.graphics3DGraphics.get(t):void 0}getGraphics3DGraphicByObjectId(t){var e;return(e=this.owner.layer)!=null&&e.objectIdField?this._findGraphics3DGraphicByObjectId(t):null}_getGraphicObjectID(t,e=(i=>(i=this.owner.layer)==null?void 0:i.objectIdField)()){return F(t,e)}get graphics3DGraphicsByObjectID(){var i;const t=(i=this.owner.layer)==null?void 0:i.objectIdField;if(!t)return;const e=new Map;return this.graphics3DGraphics.forEach(s=>{if(!s)return;const r=s.graphic,a=this._getGraphicObjectID(r,t);a!=null&&e.set(a,s)}),e}get labelsEnabled(){return!(!this._labeler||!this._labeler.layerLabelsEnabled())}async updateLabelingInfo(t){const e=this._deconflictor&&this._deconflictor.labelingInfoChange(t),i=this._labeler&&this._labeler.labelingInfoChange(t);await Promise.allSettled([e,i])}updateVisibilityInfo(){this._deconflictor&&this._deconflictor.labelingInfoChange(),this._labeler&&this._labeler.visibilityInfoChange()}get symbolUpdateType(){if(this._pendingUpdates.size>0)return"unknown";let t=0,e=0;return Gt(this._symbols,(i,s)=>{if(i!=null){const r=i.getFastUpdateStatus();if(r.loading>0)return!0;this._graphicsBySymbol.has(s)&&(e+=r.fast,t+=r.slow)}return!1})?"unknown":e>=0&&t===0?"fast":t>=0&&e===0?"slow":"mixed"}runTask(t){if(this._frameTask.processQueue(t),this._applyPendingUpdates(t),this.notifyChange("running"),this.running||this.notifyChange("updating"),this.notifyChange("updatingRemaining"),!t.hasProgressed)return ae.YIELD}setObjectIdVisibility(t,e){e?this._objectIdInvisibleSet.delete(t):this._objectIdInvisibleSet.add(t);const i=this._findGraphics3DGraphicByObjectId(t);i!=null&&this._updateUserVisibility(i)}_findGraphics3DGraphicByObjectId(t){return xt(this.graphics3DGraphics,e=>this._getGraphicObjectID(e.graphic)===t)}_updateUserVisibility(t){if(t==null)return!1;const e=t.graphic,i=this._getGraphicObjectID(e),s=e.visible&&!this.owner.suspended&&(i==null||!this._objectIdInvisibleSet.has(i));return t.setVisibilityFlag(E.GRAPHIC,R.USER,s)}_whenGraphics3DGraphic(t){const e=this.graphics3DGraphics.get(t.uid);if(e)return Promise.resolve(e);const i=this._whenGraphics3DGraphicRequests[t.uid];if(i)return i.promise;const s=It();return this._whenGraphics3DGraphicRequests[t.uid]=s,s.promise}async _boundsForGraphics3DGraphic(t,e){const i=this._viewSpatialReference,s=this.owner.view.renderSpatialReference,r=this.owner.view.basemapTerrain.spatialReference,a=(y,u,m)=>Se(y,s,u,y,i,u,m),n=(y,u,m)=>Se(y,r,u,y,i,u,m),d=this._viewElevationProvider?{service:this._viewElevationProvider,useViewElevation:e!=null&&!!e.useViewElevation,minDemResolution:e!=null?e.minDemResolution:null,minDemResolutionForPoints:this.owner.view.resolution}:null,l=await t.getProjectedBoundingBox(a,n,d,e==null?void 0:e.signal);if(!l)return null;const c=l.boundingBox;if(l.requiresDrapedElevation){const y=this.symbolCreationContext.elevationProvider;if(y){Et(c,X);const u=y.getElevation(X[0],X[1],0,i,"ground")??0;c[2]=Math.min(c[2],u),c[5]=Math.max(c[5],u)}}return{boundingBox:c,screenSpaceObjects:l.screenSpaceObjects}}async whenGraphicBounds(t,e){var a;await Rt(()=>{var n;return(n=this.owner)==null?void 0:n.loadedGraphics});const i=(a=this.owner.layer)==null?void 0:a.objectIdField,s=this.owner.loadedGraphics.find(n=>n===t||i!=null&&n.attributes!=null&&t.attributes&&n.attributes[i]===t.attributes[i]);if(!s)throw new T("internal:graphic-not-part-of-view","Graphic is not part of this view");const r=await this._whenGraphics3DGraphic(s);return this._boundsForGraphics3DGraphic(r,e)}computeAttachmentOrigin(t,e){const i=this.graphics3DGraphics.get(t.uid);if(!i)return null;const s=i.computeAttachmentOrigin();if(s.render.num===0&&s.draped.num===0)return null;pe(G,0,0,0);let r=0;if(s.render.num>0){if(!ye(s.render.origin,this.symbolCreationContext.renderCoordsHelper.spatialReference,$,e))return null;ue(G,G,$),r++}if(s.draped.num>0){const[a,n]=s.draped.origin,d=this._viewElevationProvider.getElevation(a,n,"ground")??0;if(pe($,a,n,d),!ye($,this._viewElevationProvider.spatialReference,$,e))return null;ue(G,G,$),r++}return r>1&&Dt(G,G,1/r),new Ot({x:G[0],y:G[1],z:G[2],spatialReference:e})}getSymbolLayerSize(t,e){const i=this._symbols.get(t.id);if(i==null)throw new T("internal:symbol-not-part-of-view","Symbol is not part of this view");const s=t.symbolLayers.indexOf(e);if(s===-1)throw new T("internal:missing-symbol-layer","Symbol layer is not in symbol");const r=i.getSymbolLayerSize(s);if(r==null)throw new T("internal:missing-size","Symbol layer has no valid size");return r}_graphicsCollectionChanged(t){this._startCreateGraphics&&(this.add(t.added),this.remove(t.removed))}graphicUpdateHandler(t){const e=t.graphic.uid,i=this.graphics3DGraphics.get(e);if(i!=null||this._graphicsWithoutSymbol.get(e)!=null)switch(t.property){case"visible":this._graphicUpdateVisibleHandler(i);break;case"geometry":this._graphicUpdateGeometryHandler(i,t);break;case"symbol":this._graphicUpdateSymbolHandler(i,t);break;case"attributes":break;case"origin-transform":this._graphicUpdateTransformHandler(i,t)}}_graphicUpdateGeometryHandler(t,e){this._graphicUpdateGeometryOrTransformHandler(t,e,()=>e.newValue!=null&&t!=null&&t.graphics3DSymbol.updateGeometry(t,e.newValue));const i=e.graphic.geometry;i!=null&&this._expandComputedExtent(i)}_graphicUpdateTransformHandler(t,e){const i=e.graphic.geometry;this._graphicUpdateGeometryOrTransformHandler(t,e,()=>e.newValue!=null&&t!=null&&i!=null&&t.graphics3DSymbol.updateTransform(t,i.spatialReference,e.newValue,e.action))}_graphicUpdateGeometryOrTransformHandler(t,e,i){var s;if(e.graphic.geometry!=null)if(t!=null)i()||this._recreateGraphic(t.graphic);else{const r=(s=e.graphic.symbol)==null?void 0:s.id;if(r){const a=this._symbols.get(r);if(a!=null&&a.loadStatus===Pt.LOADING)return}this._recreateGraphic(e.graphic)}else this._recreateGraphic(e.graphic)}_graphicUpdateSymbolHandler(t,e){const i=e.graphic,s=t!=null?t.graphics3DSymbol:e.oldValue!=null?this._symbols.get(e.oldValue.id):null;if(s==null||e.newValue==null)return void this._recreateGraphic(i);const r=s.symbol,a=this._getConvertedSymbol(e.newValue);if(a!=null&&(a.type!==r.type||a.type==="web-style")||r.type==="web-style")return void this._recreateGraphic(i);const n=this._graphicsBySymbol.get(r.id);if(n&&n.size!==1)return void this._recreateGraphic(i);const d=ge(r,a);if(d==null)return void this._updateSymbolMapping(r.id,a);const l={diff:d,graphics3DGraphicPatches:[],symbolStatePatches:[]};if(s.prepareSymbolPatch(l),!At(l.diff))return void this._recreateGraphic(i);const c=this._getRenderingInfo(i);if(c==null)return void this._recreateGraphic(i);const y=s.extentPadding;for(const u of l.symbolStatePatches)u();if(y!==s.extentPadding&&this._recomputeExtentPadding(),t!=null)for(const u of l.graphics3DGraphicPatches)u(t,c);this._updateSymbolMapping(r.id,a)}_graphicUpdateVisibleHandler(t){this._updateUserVisibility(t)&&(this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty())}recreateGraphics(t){this._suspendSymbolCleanup=!0,this.remove(t),this.add(t),this._suspendSymbolCleanup=!1,this.effectiveUpdatePolicy===f.SYNC&&this._cleanupSymbols()}_recreateGraphic(t){this.recreateGraphics([t])}_beginGraphicUpdate(t){const e=this._graphicsUpdateId;return this._graphicsUpdateId++,this._graphicsWaitingForSymbol.set(t.uid,e),this._graphicsWaitingForSymbol.size===1&&this.notifyChange("updating"),e}_endGraphicUpdate(t){t&&(this._graphicsWaitingForSymbol.delete(t.uid),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange("updating")))}_recomputeExtentPadding(){let t=0;this._symbols.forEach(e=>{e!=null&&(t=Math.max(t,e.extentPadding))}),this._set("extentPadding",t)}_expandComputedExtent(t){const e=ui,i=t.spatialReference;Lt(t,e);const s=this._viewSpatialReference,r=ee.tmpVec;if(Vt(i,s)||me(e[0],e[1],0,i,r,s)&&(e[0]=r[0],e[1]=r[1],me(e[3],e[4],0,i,r,s),e[3]=r[0],e[4]=r[1]),!(isFinite(e[0])&&isFinite(e[3])&&isFinite(e[1])&&isFinite(e[4])))return;const a=this.computedExtent;let n=null;const d=isFinite(e[2])&&isFinite(e[5]),l=d&&((a==null?void 0:a.zmin)==null||e[2]a.zmax);a?(e[0]a.xmax||e[4]>a.ymax||l||c)&&(n=this._propertiesPool.get("computedExtent"),n.xmin=Math.min(e[0],a.xmin),n.ymin=Math.min(e[1],a.ymin),n.xmax=Math.max(e[3],a.xmax),n.ymax=Math.max(e[4],a.ymax),n.spatialReference=s):(n=this._propertiesPool.get("computedExtent"),n.xmin=e[0],n.ymin=e[1],n.xmax=e[3],n.ymax=e[4],n.spatialReference=s),n&&(l&&(n.zmin=e[2]),c&&(n.zmax=e[5]),this._set("computedExtent",n))}_abortElevationInfoChange(){this._elevationInfoChangeAbortController&&(this._elevationInfoChangeAbortController.abort(),this._elevationInfoChangeAbortController=null)}async elevationInfoChange(){var i,s;this._abortElevationInfoChange();const t=new AbortController;this._elevationInfoChangeAbortController=t;const e=he(this.layer.elevationInfo,this.elevationFeatureExpressionEnabled);this.symbolCreationContext.featureExpressionInfoContext=await de(e,this._viewSpatialReference,t.signal,b),k(t.signal),this._elevationInfoChangeAbortController=null,(i=this._labeler)==null||i.elevationInfoChange(),this.forEachGraphics3DSymbol((r,a,n)=>{r.globalPropertyChanged("elevationInfo",a)?a.forEach(d=>{const l=d.graphic,c=d.labelLayers;for(const y of c)y.graphics3DSymbolLayer.updateGraphicElevationContext(l,y)}):this._recreateSymbol(n)}),this.updateStageLayerElevationProvider(),(s=this._elevationAlignment)==null||s.elevationInfoChange()}updateStageLayerElevationProvider(){this._stageLayerElevationProvider?(this.layer.elevationInfo&&this.layer.elevationInfo.mode==="relative-to-scene"||this._numberOfGraphicsProvidingElevation===0)&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=_e(this._stageLayerElevationProvider)):(!this.layer.elevationInfo||this.layer.elevationInfo&&this.layer.elevationInfo.mode!=="relative-to-scene")&&this._numberOfGraphicsProvidingElevation>0&&(this._stageLayerElevationProvider=new A({layer:this.layer,stageLayer:this.stageLayer,view:this.owner.view}),this.owner.view.elevationProvider.register("scene",this._stageLayerElevationProvider))}_clearSymbolsAndGraphics(){var t,e,i,s;this.clear(),this._filterVisibility!=null&&this._filterVisibility.clear(),(t=this._labeler)==null||t.reset(),(e=this._deconflictor)==null||e.clear(),(i=this._elevationAlignment)==null||i.clear(),(s=this.stageLayer)==null||s.invalidateSpatialQueryAccelerator(),this._stageLayerElevationProvider&&(this.owner.view.elevationProvider.unregister(this._stageLayerElevationProvider),this._stageLayerElevationProvider=_e(this._stageLayerElevationProvider))}startCreateGraphics(){this._startCreateGraphics=!0,this.recreateAllGraphics()}recreateAllGraphics(){this._recreateAllGraphics(!1)}recreateAllGraphicsAndSymbols(){this._recreateAllGraphics(!0)}_recreateAllGraphics(t=!1){if(!this._startCreateGraphics)return;const{loadedGraphics:e,view:i}=this.owner,s=i.basemapTerrain.tilingScheme&&(e!=null&&e.length)?e.toArray():null;!t&&s||this._clearSymbolsAndGraphics(),this.symbolCreationContext.screenSizePerspectiveEnabled=this.owner.view.screenSizePerspectiveEnabled&&!!this.layer.screenSizePerspectiveEnabled,this.symbolCreationContext.slicePlaneEnabled=!!this.owner.slicePlaneEnabled,this._set("computedExtent",null),s&&(t?this.add(s):this.recreateGraphics(s))}_recreateSymbol(t){const e=this._graphicsBySymbol.get(t),i=[];e&&(e.forEach((r,a)=>{var d;const n=r.usedMemory;this._conditionalRemove(r,a),(d=this._spatialIndex)==null||d.remove(r),i.push(r.graphic),r.destroy(),this._removeGraphics3DGraphic(a,n),this._updateLayerVisibility(),this._featureStore.events.emit("changed")}),this._graphicsBySymbol.set(t,new Map));const s=this._symbols.get(t);v(s),this._symbols.delete(t),this.add(i)}_recreateGraphicsForSymbol(t){const e=this._graphicsBySymbol.get(t);if(e){const i=[];e.forEach(s=>i.push(s.graphic)),this.recreateGraphics(i)}}_conditionalRemove(t,e){var i,s,r;this._graphicsDrapedUids.delete(e),(i=this._objectStates)==null||i.removeGraphic(t),(s=this._labeler)==null||s.removeGraphic(t),(r=this._deconflictor)==null||r.removeGraphic(t),this._graphicStateTracking!=null&&this._graphicStateTracking.removeGraphic(t)}add(t){var e;t&&t.length!==0&&((e=this.owner.view.basemapTerrain)!=null&&e.tilingScheme?(this._updatePolicyForGraphics(t)===f.ASYNC?this._addDelayed(t):this._addImmediate(t),this.notifyChange("updating")):b.error("#add()","Cannot add graphics before terrain surface has been initialized"))}_updatePolicyForGraphics(t){if(this.effectiveUpdatePolicy===f.SYNC&&(this.layer.geometryType==="mesh"||this.layer.geometryType==null)){for(const e of t)if(e.geometry!=null&&e.geometry.type==="mesh"&&!e.geometry.loaded)return f.ASYNC}return this.effectiveUpdatePolicy}_addImmediate(t){this._geometryWarningLogged=!1,this._symbolWarningLogged=!1;for(const e of t)this._addGraphic(e,this._getRenderingInfo(e,b),f.SYNC);this._cleanupSymbols(),this._labeler&&(this.owner.view.labeler.setDirty(),this._cleanupSymbols()),this.owner.view.deconflictor.setDirty()}_addDelayed(t){var e;for(const i of t){const s=i.uid;let r=this._pendingUpdates.get(s);r?r.add?r.state!==g.NEW&&((e=r.abortController)==null||e.abort()):this._pendingAdds++:(r=this._pendingUpdatesPool.pushNew(),this._pendingAdds++,this._pendingUpdates.set(s,r)),r.add=i}this.notifyChange("running"),this.notifyChange("updatingRemaining")}remove(t){this.effectiveUpdatePolicy===f.ASYNC?this._removeDelayed(t):this._removeImmediate(t),this.notifyChange("updating")}_removeImmediate(t){for(const e of t)this._removeGraphic(e);this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_removeDelayed(t){var e;for(const i of t){const s=i.uid,r=this._pendingUpdates.get(s);if(r)r.add&&(r.remove?r.add=null:this._pendingUpdates.delete(s),r.state===g.LOADING&&((e=r.abortController)==null||e.abort()),this._pendingAdds--);else{const a=this._pendingUpdatesPool.pushNew();a.remove=i,this._pendingUpdates.set(s,a),this._pendingRemoves++,this._applyPendingRemovesFirst=!0}}this._pendingUpdates.size===0&&this._finishPendingUpdates(),this.notifyChange("running"),this.notifyChange("updatingRemaining")}_finishPendingUpdates(){this._pendingUpdatesPool.clear(),this._cleanupSymbols(),(this._pendingAdds||this._pendingRemoves)&&b.warn("pendingAdds/Removes in inconsistent state!"),this._pendingAdds=0,this._pendingRemoves=0,this._applyPendingRemovesFirst=!1}_applyPendingUpdates(t){var e;if(this._geometryWarningLogged=!1,this._symbolWarningLogged=!1,this._pendingUpdates.size===0&&((e=this._spatialIndex)==null?void 0:e.updating))return this._spatialIndex.update(),void t.madeProgress();if(this._applyPendingRemovesFirst){this._applyPendingRemovesFirst=!1;for(const[i,s]of this._pendingUpdates){if(t.done){this._applyPendingRemovesFirst=!0;break}if(s.remove&&!s.add&&(this._pendingRemoves--,t.madeProgress(),this._removeGraphic(s.remove),s.remove=null,this._pendingUpdates.delete(i),this._pendingRemoves===0))break}}for(const[i,s]of this._pendingUpdates){if(t.done)break;s.add&&s.state===g.NEW&&this._processPendingUpdateNew(s);let r=this.effectiveUpdatePolicy;if(!s.remove||s.add&&s.state!==g.READY||(this._pendingRemoves--,t.madeProgress(),this._removeGraphic(s.remove),s.remove=null,r=f.SYNC),s.add)switch(s.state){case g.READY:this._addGraphic(s.add,s.renderingInfo,r),s.add=null,this._pendingAdds--,t.madeProgress();break;case g.REJECTED:s.add=null,this._pendingAdds--;case g.LOADING:}s.remove==null&&s.add==null&&this._pendingUpdates.delete(i)}this._pendingUpdates.size===0&&(this._finishPendingUpdates(),this.notifyChange("running"))}_processPendingUpdateNew(t){if(!t.add)return void(t.state=g.READY);const e=t.add.geometry;e==null||e.type!=="mesh"||e.loaded?this._processPendingUpdateNewRenderingInfo(t):this._processPendingUpdateNewMesh(t,e)}async _processPendingUpdateNewMesh(t,e){t.state=g.LOADING,t.abortController=new AbortController;const i=t.abortController.signal;try{await e.load({signal:i})}catch(s){return this._processPendingUpdateNewError(t,s)}t.abortController=null,this._processPendingUpdateNewRenderingInfo(t)}_processPendingUpdateNewError(t,e){t.abortController=null,N(e)?t.state=g.NEW:t.state=g.REJECTED}async _processPendingUpdateNewRenderingInfo(t){if(this.layer.renderer==null||this.layer.renderer.type!=="dictionary")return t.renderingInfo=this._getRenderingInfo(t.add,b),void(t.state=g.READY);t.state=g.LOADING,t.abortController=new AbortController;let e=null;try{e=await this._getRenderingInfoAsync(t.add,{signal:t.abortController.signal})}catch(i){return t.abortController=null,void(N(i)?t.state=g.NEW:t.state=g.REJECTED)}(e==null?void 0:e.symbol)==null?(b&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,b.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),t.renderingInfo=null):t.renderingInfo=e,t.state=g.READY}_addGraphic(t,e,i){var u;if(this._graphicsWithoutSymbol.set(t.uid,t),(e==null?void 0:e.symbol)==null||!Ut(t))return;if(this.stage.renderView.objectAndLayerIdRenderHelper!=null&&this.setUidToIdOnAdd){const m=jt(this.owner.view.map,this.layer.uid);this.stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(t.objectId,t.uid,this.layer.id,this.layer.uid,!!this.layer.popupEnabled&&!m&&$t(this.layer,(u=this.owner.view.popup)==null?void 0:u.defaultPopupTemplateEnabled))}const s=e.symbol,r=this.getOrCreateGraphics3DSymbol(s,e.renderer);if(r==null)return;this._expandComputedExtent(t.geometry);const a=this._beginGraphicUpdate(t),n=new Ft(t,e,this.layer);let d=!1;const l=m=>{m===r.symbol.id&&(d=!0)};this._whenSymbolRemoved.push(l);const c=()=>{if(--this._loadingSymbols,!this.destroyed){if(this._whenSymbolRemoved.removeUnordered(l),this._graphicsWaitingForSymbol.get(t.uid)!==a||d||r.destroyed||this.graphicSymbolSupported&&t.symbol&&t.symbol.id!==r.symbol.id)--r.referenced,this._cleanupSymbols();else{const m=this._createGraphics3DGraphic(r,n);this._spatialIndex&&m!=null&&this._spatialIndex.add(m),--r.referenced,this._endGraphicUpdate(t)}this._featureStore.events.emit("changed"),this._labeler&&this.owner.view.labeler.setDirty()}},y=m=>{--this._loadingSymbols,this.destroyed||(this._whenSymbolRemoved.removeUnordered(l),d||(N(m)?this.add([t]):r.destroyed||this._endGraphicUpdate(t)))};++this._loadingSymbols,i===f.ASYNC?r.load(()=>this._frameTask.schedule(c),m=>this._frameTask.schedule(()=>y(m))):r.load(c,y)}_removeGraphic(t){var s,r;const e=t.uid,i=this.graphics3DGraphics.get(e);if(i){i.graphics3DSymbol.onRemoveGraphic(i);const a=i.usedMemory,n=i.isElevationSource;this._conditionalRemove(i,e),(s=this._spatialIndex)==null||s.remove(i);const d=i.graphics3DSymbol.symbol.id;(r=this._graphicsBySymbol.get(d))==null||r.delete(e),this._graphicsWithoutSymbol.delete(e),this._removeGraphics3DGraphic(e,a,n),i.destroy(),this._featureStore.events.emit("changed")}else this._graphicsWithoutSymbol.delete(e),this._graphicsWaitingForSymbol.delete(e),this._graphicsWaitingForSymbol.size===0&&(this._cleanupSymbols(),this.notifyChange("updating"))}_hasLabelingContext(t){if(t instanceof be||t instanceof Tt){const e=this.symbolCreationContext.layer;return!!e.labelingInfo&&e.labelingInfo.some(i=>i.symbol===t)}return!1}_hasValidSymbolCreationContext(t){return!(t instanceof be&&!this._hasLabelingContext(t))||(b.error("LabelSymbol3D is only valid as part of a LabelClass. Using LabelSymbol3D as a renderer symbol is not supported."),!1)}_getRenderingInfo(t,e){const i=t.geometry;if(i==null)return e&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!zt(i.spatialReference,this._viewSpatialReference))return e&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} has incompatible spatial reference and will not render`)),null;if(!this.graphicSymbolSupported&&t.symbol!=null)return e&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const s=this.rendererHasGeometryOperations?W(t,this.layer):t;let r;return this.owner.getRenderingInfo&&(this.getRenderingInfoWithoutRenderer||this.currentRenderer!=null)?r=this.owner.getRenderingInfo(s,this.currentRenderer,this._arcadeOnDemand):r={symbol:s.symbol||li(s.geometry)},(r==null?void 0:r.symbol)==null?(e&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,e.warn(`Graphic in layer ${this.layer.id} has no symbol and will not render`)),null):r}_getRenderingInfoAsync(t,e){if(t.geometry==null)return b&&!this._geometryWarningLogged&&(this._geometryWarningLogged=!0,b.warn(`Graphic in layer ${this.layer.id} has no geometry and will not render`)),null;if(!this.graphicSymbolSupported&&t.symbol!=null)return b&&!this._symbolWarningLogged&&(this._symbolWarningLogged=!0,b.warn(`Graphic in layer ${this.layer.id} is not allowed to have a symbol, use a renderer instead`)),null;const i=this.rendererHasGeometryOperations?W(t,this.layer):t;return this.owner.getRenderingInfoAsync(i,this.currentRenderer,this._arcadeOnDemand,e)}_createGraphics3DSymbol(t,e){if(!this._hasValidSymbolCreationContext(t))return null;const i=this._getConvertedSymbol(t);if(!i)return null;let s;if(e!=null&&"backgroundFillSymbol"in e&&e.backgroundFillSymbol){const a=oe(e.backgroundFillSymbol,{ignoreDrivers:!0});a.symbol!=null&&a.symbol.type!=="web-style"&&a.symbol.type!=="cim"&&(s=a.symbol.symbolLayers)}const r=ci(i,this.symbolCreationContext,s);return r.load(()=>{const a=r.extentPadding;a>this.extentPadding&&this._set("extentPadding",a),this.notifyChange("averageSymbolComplexity")},()=>{}),r}getOrCreateGraphics3DSymbol(t,e){let i=this._symbols.get(t.id);return i===void 0&&(i=t instanceof Mt?new kt(t,s=>this._frameTask.schedule(s),s=>this._createGraphics3DSymbol(s,e)):this._createGraphics3DSymbol(t,e),this._symbols.set(t.id,i)),i!=null&&++i.referenced,i}trackGraphicState(t){return this._graphicStateTracking==null&&(this._graphicStateTracking=new pi(this)),this._graphicStateTracking.add(t)}_addGraphics3DGraphic(t){this._usedMemory+=t.usedMemory,this.graphics3DGraphics.set(t.graphic.uid,t),this._numberOfGraphics++,t.isElevationSource&&(this._numberOfGraphicsProvidingElevation++,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_removeGraphics3DGraphic(t,e,i=!1){this._usedMemory-=e,this.graphics3DGraphics.delete(t),this._numberOfGraphics--,i&&(this._numberOfGraphicsProvidingElevation--,this.updateStageLayerElevationProvider()),this._updateLayerVisibility()}_createGraphics3DGraphic(t,e){var n,d,l;const i=e.graphic;if(this._graphicsWithoutSymbol.delete(i.uid),!this._symbols.has(t.symbol.id))return this.add([i]),null;if(this.graphics3DGraphics.has(i.uid))return null;const s=t.createGraphics3DGraphic(e);if(s==null)return null;this._addGraphics3DGraphic(s);const r=t.symbol.id;if(this._graphicsBySymbol.has(r)||this._graphicsBySymbol.set(r,new Map),this._graphicsBySymbol.get(r).set(i.uid,s),s.isDraped&&this._graphicsDrapedUids.add(i.uid),s.centroid=null,i.geometry!=null&&i.geometry.type!=="point"&&(s.centroid=Ht(i.geometry,this._viewSpatialReference)),this._updateUserVisibility(s),this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(s),this._filterVisibility!=null){const{defaultVisibility:c}=this._filterVisibility;s.setVisibilityFlag(E.GRAPHIC,R.FILTER,c),c||this._filterVisibility.reapply()}(n=this._deconflictor)==null||n.addGraphic(s),(d=this._labeler)==null||d.addGraphic(s),(l=this._objectStates)==null||l.addGraphic(s),this._deconflictor&&this.owner.view.deconflictor.setInitialIconVisibilityFlag(this,s),s.initialize(this.stageLayer,this.owner),this._graphicStateTracking!=null&&this._graphicStateTracking.addGraphic(s);const a=this._whenGraphics3DGraphicRequests[i.uid];return a&&(delete this._whenGraphics3DGraphicRequests[i.uid],a.resolve(s)),s}_abortRendererChange(){this._rendererChangeAbortController&&(this._rendererChangeAbortController.abort(),this._rendererChangeAbortController=null)}async rendererChange(t){if(this._abortRendererChange(),t!==this.currentRenderer)if(this._validateRenderer(t),t==null&&this._currentRendererChange(null,!1),Bt(t))if(t!=null&&t.arcadeRequired){const e=new AbortController;this._rendererChangeAbortController=e;const{arcadeUtils:i}=await this._ensureArcade();k(e);const s=i.hasGeometryOperations(t);s&&(await i.enableGeometryOperations(),k(e)),this.effectiveUpdatePolicy===f.ASYNC?await this._frameTask.schedule(()=>this._currentRendererChange(t,s),e.signal):this._currentRendererChange(t,s),this._rendererChangeAbortController=null}else if(this.effectiveUpdatePolicy===f.ASYNC){const e=new AbortController;this._rendererChangeAbortController=e,await this._frameTask.schedule(()=>this._currentRendererChange(t,!1),e.signal),this._rendererChangeAbortController=null}else this._currentRendererChange(t,!1);else this._currentRendererChange(t,!1)}async _ensureArcade(){return this._arcadeOnDemand==null?(this._arcadeOnDemand=await Nt(),this._arcadeOnDemand):this._arcadeOnDemand}_currentRendererChange(t,e){var r;this.currentRenderer=t,this.rendererHasGeometryOperations=e,this.symbolCreationContext.arcade=this._arcadeOnDemand;const i=this.symbolCreationContext.renderer;if(t===i)return;if(this._symbolConversionCache.clear(),t==null)return this.symbolCreationContext.renderer=null,void this.recreateAllGraphicsAndSymbols();const s=ge(i,t);this._updateUnchangedSymbolMappings(s,t,i),this.symbolCreationContext.renderer=t,s!=null&&(s.type==="complete"?this.recreateAllGraphicsAndSymbols():s.type==="partial"&&(this._applyRendererDiff(s,t,i)?(r=this._labeler)==null||r.reset():this.recreateAllGraphicsAndSymbols()),this.notifyChange("averageSymbolComplexity"))}_diffHasSymbolChange(t){for(const e in t.diff)switch(e){case"visualVariables":case"defaultSymbol":case"uniqueValueInfos":break;case"uniqueValueGroups":case"authoringInfo":case"fieldDelimiter":delete t.diff[e];break;default:return!0}return!1}_applySymbolSetDiff(t,e,i){t=t||[],e=e||[];const s=[];for(const r of e){const a=this._graphicsBySymbol.get(r.id);a&&a.forEach((n,d)=>{const l=n.graphic,c=this.layer instanceof Wt?this.layer:null,y=this._arcadeOnDemand;if(r===i.defaultSymbol&&i.getSymbol(W(l,c),{arcade:y})===i.defaultSymbol)return;const u=n.usedMemory;t.length||i.defaultSymbol?s.push(l):this._graphicsWithoutSymbol.set(d,l);const m=this.graphics3DGraphics.get(d);this._conditionalRemove(m,d),n.destroy(),a.delete(d),this._removeGraphics3DGraphic(d,u),this._updateLayerVisibility()}),this._whenSymbolRemoved.forAll(n=>n(r.id))}(t.length||s.length)&&(this._graphicsWithoutSymbol.forEach(r=>s.push(r)),this._graphicsWithoutSymbol.clear(),this.add(s)),this._cleanupSymbols(),this._labeler&&this.owner.view.labeler.setDirty(),this.owner.view.deconflictor.setDirty()}_applyUniqueValueRendererDiff(t,e,i){const s=t.diff.defaultSymbol,r=t.diff.uniqueValueInfos;if(s||r){const a=r?r.added.map(d=>d.symbol).filter(fe):[],n=r?r.removed.map(d=>d.symbol).filter(fe):[];if(r)for(let d=0;dc!=null?c.id:null,r=t&&t.diff,a=r==null?void 0:r.defaultSymbol,n=r&&r.uniqueValueInfos;let d;if(n)d=n.unchanged.map(c=>({oldId:s(c.oldValue.symbol),newId:s(c.newValue.symbol)}));else{d=[];for(const c of i.uniqueValueInfos??[]){const y=s(c.symbol),u=(l=e.uniqueValueInfos)==null?void 0:l.find(m=>m.value===c.value);u&&y!==s(u.symbol)&&d.push({oldId:y,newId:s(u.symbol)})}}return!a&&i.defaultSymbol&&d.push({oldId:s(i.defaultSymbol),newId:s(e.defaultSymbol)}),d}_updateSymbolMapping(t,e){const i=e!=null&&e?typeof e=="string"?e:e.id:null;if(t==null||t===i)return;const s=this._graphicsBySymbol.get(t);this._graphicsBySymbol.delete(t),s!==void 0&&this._graphicsBySymbol.set(i,s);const r=this._symbols.get(t);if(r!==void 0&&(this._symbols.delete(t),this._symbols.set(i,r),r!=null)){const a=typeof e=="string"?null:e;a!=null?r.symbol=a:r.symbol.id=i}}_updateUnchangedSymbolMappings(t,e,i){const s=this._calculateUnchangedSymbolMapping(t,e,i);for(const{oldId:r,newId:a}of s)this._updateSymbolMapping(r,a)}_applyRendererDiff(t,e,i){if(this._diffHasSymbolChange(t))return!1;if(e instanceof ve&&i instanceof ve&&this._applyUniqueValueRendererDiff(t,e,i)&&Object.keys(t.diff).length===0)return!0;for(const[s]of this._graphicsBySymbol){const r=this._symbols.get(s);if(r!=null)switch(r.applyRendererDiff(t,e)){case q.RecreateSymbol:this._recreateSymbol(s);break;case q.RecreateGraphics:this._recreateGraphicsForSymbol(s);case q.FastUpdate:}}return!0}opacityChange(){this.forEachGraphics3DSymbol((t,e)=>t.globalPropertyChanged("opacity",e)),this._updateStageLayerVisibility()}_slicePlaneEnabledChange(t){t!==this.symbolCreationContext.slicePlaneEnabled&&(this.symbolCreationContext.slicePlaneEnabled=t,this.stageLayer.sliceable=t,this.forEachGraphics3DSymbol((e,i)=>e.globalPropertyChanged("slicePlaneEnabled",i)),this._deconflictor&&this._deconflictor.slicePlaneEnabledChange(),this._labeler&&this._labeler.slicePlaneEnabledChange())}_physicalBasedRenderingChange(t){this.symbolCreationContext.physicalBasedRenderingEnabled=t,this.forEachGraphics3DSymbol((e,i,s)=>{e.globalPropertyChanged("physicalBasedRenderingEnabled",i)||this._recreateSymbol(s)})}_skipHighSymbolLoDsChange(t){this.symbolCreationContext.skipHighSymbolLods=t,this.forEachGraphics3DSymbol((e,i,s)=>{e.globalPropertyChanged("skipHighSymbolLods",i)||this._recreateSymbol(s)})}_pixelRatioChange(){this.forEachGraphics3DSymbol((t,e,i)=>{t.globalPropertyChanged("pixelRatio",e)||this._recreateSymbol(i)})}_signalUpdatingDuringAsyncLoadedGraphicsChange(){this._updatingPendingLoadedGraphicsChange&&this._updatingPendingLoadedGraphicsChange.remove(),this._updatingPendingLoadedGraphicsChange=qt(()=>{this._updatingPendingLoadedGraphicsChange=null})}setClippingExtent(t,e){const i=this.symbolCreationContext.clippingExtent,s=H();return Yt(t,s,e)?this.symbolCreationContext.clippingExtent=je(te(),s):this.symbolCreationContext.clippingExtent=null,!Zt(this.symbolCreationContext.clippingExtent,i)}modifyGraphics3DGraphicVisibilities(t){var i,s;if(this.destroyed)return;let e=!1;this.graphics3DGraphics.forEach(r=>{t(r)&&(e=!0)}),e&&((i=this.owner.view.labeler)==null||i.setDirty(),(s=this.owner.view.deconflictor)==null||s.setDirty())}forEachGraphics3DSymbol(t){for(const[e,i]of this._symbols){if(i==null)return;t(i,this._graphicsBySymbol.get(e)||_i,e)}}updateAllGraphicsVisibility(){this._filterVisibility!=null&&this._filterVisibility.reapply(),this.modifyGraphics3DGraphicVisibilities(t=>{const e=this._updateUserVisibility(t),i=this._scaleVisibility!=null&&this._scaleVisibility.updateVisibility(t);return e||i})}_hideAllGraphics(){this.modifyGraphics3DGraphicVisibilities(t=>t.setVisibilityFlag(E.GRAPHIC,R.USER,!1))}_validateRenderer(t){var i;const e=Xt(t,{geometryType:(i=this.layer)==null?void 0:i.geometryType});if(e){const s=`Renderer for layer '${this.layer.title?`${this.layer.title}, `:""}, id:${this.layer.id}' is not supported in a SceneView`;b.warn(s,e.message)}}_cleanupSymbols(){if(this._graphicsWaitingForSymbol.size>0||this._suspendSymbolCleanup)return;let t=!1;this._symbols.forEach((e,i)=>{if(e==null||e.referenced>0)return;const s=this._graphicsBySymbol.get(i);s&&s.size!==0||(this._graphicsBySymbol.delete(i),this._symbols.delete(i),v(e),t=!0)}),t&&(this._recomputeExtentPadding(),this.notifyChange("averageSymbolComplexity"))}get test(){return{snapshotInternals:()=>({graphics:[...this.graphics3DGraphics.keys()].sort(),symbols:[...this._symbols.keys()].sort(),graphicsBySymbol:[...this._graphicsBySymbol.keys()].sort().map(t=>({symbolId:t,graphics:[...this._graphicsBySymbol.get(t).keys()].sort()})),graphicsWithoutSymbol:[...this._graphicsWithoutSymbol.keys()].sort(),graphicsDrapedUids:[...this._graphicsDrapedUids].sort(),pendingUpdates:this._pendingUpdates}),symbols:this._symbols,filterVisibility:this._filterVisibility,numPending:this._pendingUpdates.size,forceUpdatePolicy:t=>{this._forcedUpdatePolicy=t}}}get performanceInfo(){return{visible:this.graphics3DGraphics.size,missing:this._graphicsWithoutSymbol.size,pending:this._pendingUpdates.size}}};var g;p.tmpVec=U(),o([h({readOnly:!0})],p.prototype,"computedExtent",void 0),o([h()],p.prototype,"currentRenderer",void 0),o([h()],p.prototype,"rendererHasGeometryOperations",void 0),o([h()],p.prototype,"_frameTask",void 0),o([h({readOnly:!0})],p.prototype,"_viewSpatialReference",null),o([h()],p.prototype,"_rendererChangeAbortController",void 0),o([h()],p.prototype,"_elevationInfoChangeAbortController",void 0),o([h()],p.prototype,"_initializeAbortController",void 0),o([h()],p.prototype,"_elevationAlignment",void 0),o([h()],p.prototype,"_scaleVisibility",void 0),o([h()],p.prototype,"_filterVisibility",void 0),o([h()],p.prototype,"_initializePromise",void 0),o([h()],p.prototype,"_spatialIndex",void 0),o([h({readOnly:!0})],p.prototype,"extentPadding",void 0),o([h()],p.prototype,"_updatingPendingLoadedGraphicsChange",void 0),o([h()],p.prototype,"_featureStore",void 0),o([h()],p.prototype,"_deconflictor",void 0),o([h()],p.prototype,"_labeler",void 0),o([h()],p.prototype,"_objectStates",void 0),o([h()],p.prototype,"_loadingSymbols",void 0),o([h()],p.prototype,"preferredUpdatePolicy",void 0),o([h()],p.prototype,"_forcedUpdatePolicy",void 0),o([h({readOnly:!0})],p.prototype,"effectiveUpdatePolicy",null),o([h({constructOnly:!0})],p.prototype,"elevationFeatureExpressionEnabled",void 0),o([h({constructOnly:!0})],p.prototype,"owner",void 0),o([h({constructOnly:!0})],p.prototype,"layer",void 0),o([h({constructOnly:!0})],p.prototype,"graphicSymbolSupported",void 0),o([h({constructOnly:!0})],p.prototype,"getRenderingInfoWithoutRenderer",void 0),o([h({constructOnly:!0})],p.prototype,"componentFactories",void 0),o([h({constructOnly:!0})],p.prototype,"setUidToIdOnAdd",void 0),o([h()],p.prototype,"featureStore",null),o([h()],p.prototype,"initializePromise",null),o([h()],p.prototype,"scaleVisibility",null),o([h()],p.prototype,"elevationAlignment",null),o([h()],p.prototype,"objectStates",null),o([h()],p.prototype,"filterVisibility",null),o([h({readOnly:!0})],p.prototype,"updating",null),o([h({readOnly:!0})],p.prototype,"running",null),o([h({readOnly:!0})],p.prototype,"suspendedOrOutsideOfView",null),o([h({readOnly:!0,dependsOn:[]})],p.prototype,"updatingRemaining",null),o([h({readOnly:!0})],p.prototype,"displayFeatureLimit",null),o([h({readOnly:!0,dependsOn:[]})],p.prototype,"averageSymbolComplexity",null),o([h({constructOnly:!0})],p.prototype,"hasZ",void 0),o([h({constructOnly:!0})],p.prototype,"hasM",void 0),o([h()],p.prototype,"_objectIdField",null),p=ee=o([L(Te)],p),function(t){t[t.NEW=0]="NEW",t[t.LOADING=1]="LOADING",t[t.READY=2]="READY",t[t.REJECTED=3]="REJECTED"}(g||(g={}));class gi{constructor(){this.add=null,this.renderingInfo=null,this.state=g.NEW,this.abortController=null,this.remove=null}clear(){this.add=null,this.renderingInfo=null,this.state=g.NEW,this.abortController=null,this.remove=null}}const mi=10,G=U(),$=U(),_i=new Map,Ae=re.getLogger("esri.views.3d.layers.graphics.Graphics3DScaleVisibility");let C=class extends V{constructor(t){super(t),this._scaleRangeActive=!1,this._layerScaleRangeVisibilityQuery=!1,this._extent=null,this._updatingHandles=new Jt,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null,this.layerScaleEnabled=!0,this.suspended=!1,this._dirty=!0}initialize(){this.updateScaleRangeActive();const t=this.graphicsCoreOwner.view.resourceController.scheduler;this.addHandles(t.registerTask(B.SCALE_VISIBILITY,this)),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this.layerMinMaxScaleChangeHandler())}destroy(){this._updatingHandles.destroy(),this.removeHandles(),this._dirty=!1,this._extent=null,this.graphicsCoreOwner=null,this.layer=null,this.queryGraphicUIDsInExtent=null,this.graphicsCore=null,this.basemapTerrain=null}get updating(){return this._dirty||this._updatingHandles.updating}_setDirty(){this._dirty=!0}setExtent(t){const e=this.graphicsCoreOwner.view.spatialReference,i=this.graphicsCoreOwner.view.basemapTerrain.spatialReference;if(e===i)this._extent=t??null;else{const s=H();Ce(t,e,s,i)?this._extent=s:this._extent=null}this._setDirty()}scaleRangeActive(){return this._scaleRangeActive}updateScaleRangeActive(){const t=this.layer,e=t.effectiveScaleRange;let i=this.layerScaleEnabled&&e!=null&&Le(e.minScale,e.maxScale);t.labelingInfo&&!i&&(i=t.labelingInfo.some(r=>r&&Le(r.minScale??0,r.maxScale??0)));const s=this._scaleRangeActive!==i;return this._scaleRangeActive=i,i&&!this.hasHandles(z)&&this.basemapTerrain?(this.addHandles(this.basemapTerrain.on("scale-change",r=>this._scaleUpdateHandler(r)),z),this.layerScaleEnabled&&this.addHandles(this.basemapTerrain.on("tiles-visibility-changed",()=>this._setDirty()),z)):!i&&this.hasHandles(z)&&this.removeHandles(z),s}get running(){return!(!this.graphicsCoreOwner.view.basemapTerrain||!this.updating)}runTask(t){const e=this.graphicsCoreOwner.view.basemapTerrain;if(this._extent&&e&&e.ready&&this._scaleRangeActive&&this.layerScaleEnabled){if(this._layerScaleRangeVisibilityQuery)return ae.YIELD;{this._layerScaleRangeVisibilityQuery=!0;const{minScale:i,maxScale:s}=this.layer.effectiveScaleRange;e.queryVisibleScaleRange(this._extent,i,s,r=>this._finishUpdate(r))}}else this._finishUpdate(!0);t.madeProgress()}_finishUpdate(t){this._layerScaleRangeVisibilityQuery=!1,this._set("suspended",!t),this._dirty=!1}_visibleAtLayerScale(t){const e=this.layer.effectiveScaleRange;return!this.layerScaleEnabled||we(t,e.minScale||0,e.maxScale||0)}_visibleAtLabelScale(t,e){return we(t,e.minScale||0,e.maxScale||0)}_graphicScale(t){let e;return t.centroid!=null?e=t.centroid:t.graphic.geometry!=null&&t.graphic.geometry.type==="point"&&(e=t.graphic.geometry),e?this.graphicsCoreOwner.view.basemapTerrain?this.graphicsCoreOwner.view.basemapTerrain.getScale(e):1:null}_graphicVisible(t){if(!this.layerScaleEnabled)return!0;const e=this._graphicScale(t);return this._visibleAtLayerScale(e)}updateVisibility(t){if(this._scaleRangeActive){const e=this._graphicVisible(t);return t.setVisibilityFlag(E.GRAPHIC,R.SCALE_RANGE,e)}return!1}updateGraphicLabelScaleVisibility(t){if(!this._scaleRangeActive||!t.labelLayers||t.labelLayers.length===0)return!1;const e=this._graphicScale(t),i=this._updateLabelScaleVisibility(t,e);return i&&(this.graphicsCoreOwner.view.deconflictor.setDirty(),this.graphicsCoreOwner.view.labeler.setDirty()),i}_updateLabelScaleVisibility(t,e){if(!t.labelLayers||t.labelLayers.length===0)return!1;const i=t.labelLayers[0]._labelClass;if((i==null?void 0:i.minScale)!=null&&i.maxScale!=null){const s=this._visibleAtLabelScale(e,i);if(t.setVisibilityFlag(E.LABEL,R.SCALE_RANGE,s))return!0}return!1}_scaleUpdateHandler(t){if(this._setDirty(),!this.graphicsCore.visible)return;const e=t.extent,i=t.scale,s=this._visibleAtLayerScale(i);let r=!1;const a=this.graphicsCoreOwner.view.spatialReference,n=t.spatialReference;if(n==null)return void Ae.error("scaleUpdate: Internal error, no SpatialReference given for tiles");const d=!n.equals(a);if(d&&!Ce(e,n,Ve,a))return void Ae.error("scaleUpdate: Internal error, cannot project AABR from "+n+" to wkid "+a);const l=d?Ve:e;this.queryGraphicUIDsInExtent(l,a,c=>{const y=this.graphicsCore.getGraphics3DGraphicById(c);if(y==null)return;const u=y.centroid;u!=null&&(e[0]>u.x||e[1]>u.y||e[2]t.setVisibilityFlag(E.GRAPHIC,R.SCALE_RANGE,!0)):this._scaleRangeActive&&this.graphicsCore.updateAllGraphicsVisibility(),this._setDirty()}};function Le(t,e){return t>0||e>0}o([h()],C.prototype,"graphicsCoreOwner",void 0),o([h()],C.prototype,"layer",void 0),o([h()],C.prototype,"queryGraphicUIDsInExtent",void 0),o([h()],C.prototype,"graphicsCore",void 0),o([h()],C.prototype,"basemapTerrain",void 0),o([h({constructOnly:!0})],C.prototype,"layerScaleEnabled",void 0),o([h({readOnly:!0})],C.prototype,"suspended",void 0),o([h({readOnly:!0})],C.prototype,"updating",null),o([h()],C.prototype,"_dirty",void 0),C=o([L("esri.views.3d.layers.graphics.Graphics3DScaleVisibility")],C);const z="terrain-events",Ve=H(),bi=.05;class fi{constructor(){this._extents=new Q({allocator:e=>e||H()}),this._tmpExtent=H(),this._dirty=!1}get empty(){return this._extents.length===0}get size(){return this._extents.length}clear(){this._extents.clear()}add(e){this._contains(e)||(this._removeContained(e),Ge(this._extents.pushNew(),e),this._dirty=!0)}pop(){return this._dirty&&this._mergeTight(),this._extents.pop()}merge(e){return this._mergeTight(e),e.hasProgressed}_mergeTight(e=Fe){const i=this._extents,s=new Set;let r=0;for(;r!==i.length;){i.sort((a,n)=>a[0]-n[0]),r=i.length,s.clear();for(let a=0;a=n[2])break;s.add(l)}s.forEach(d=>{if(n===d)return;if(d[2]<=n[0])return void s.delete(d);const l=Y(n),c=Y(d),y=this._tmpExtent;Qt(n,d,y);const u=l+c;(Y(y)-u)/uxe(i,e))}_removeContained(e){this._extents.filterInPlace(i=>!xe(e,i))}get test(){const e=this;return{containsPoint:i=>e._extents.some(s=>Kt(s,i))}}}let P=class extends V{constructor(t){super(t),this._dirtyExtents=new fi,this._globalDirty=!1,this._averageExtentUpdateSize=0,this._dirtyGraphicsSet=new Set,this._updateElevation=!1,this.graphicsCoreOwner=null,this.graphicsCore=null,this.events=new ie}initialize(){const t=this.elevationProvider,e=this.graphicsCoreOwner.view.resourceController.scheduler;this.addHandles([t.on("elevation-change",i=>this._elevationChanged(i)),S(()=>this.graphicsCoreOwner.suspended,()=>this._suspendedChange()),e.registerTask(B.ELEVATION_ALIGNMENT,this)])}destroy(){this._dirtyGraphicsSet.clear(),this.graphicsCoreOwner=null,this.graphicsCore=null,this.queryGraphicUIDsInExtent=null,this.elevationProvider=null}clear(){this._dirtyGraphicsSet.clear(),this.notifyChange("updating")}_suspendedChange(){this.graphicsCoreOwner.suspended===!0?this._updateElevation=!1:this.graphicsCoreOwner.suspended===!1&&this._updateElevation&&(this._globalDirty=!0,this.notifyChange("updating"))}elevationInfoChange(){this._globalDirty=!0,this.notifyChange("updating")}get updating(){return this.running}get running(){return this._dirtyGraphicsSet.size>0||this._dirtyExtents&&!this._dirtyExtents.empty||this._globalDirty}get updatingRemaining(){return this._dirtyGraphicsSet.size+this._dirtyExtents.size*this._averageExtentUpdateSize}runTask(t){for(this._globalDirty&&(this._markAllGraphicsElevationDirty(),this._globalDirty=!1,t.madeProgress()),t.run(()=>this._dirtyExtents.merge(t));this.running&&!t.done;)this._updateDirtyGraphics(t),this._updateDirtyExtents(t);this.notifyChange("updating")}_updateDirtyGraphics(t){const e=this.graphicsCoreOwner.view.renderCoordsHelper,i=this.graphicsCore.effectiveUpdatePolicy===f.ASYNC;for(const s of this._dirtyGraphicsSet.keys()){const r=this.graphicsCore.getGraphics3DGraphicById(s);if(this._dirtyGraphicsSet.delete(s),r!=null&&(r.alignWithElevation(this.elevationProvider,e,i),this.graphicsCoreOwner.view.deconflictor.setDirty(),t.madeProgress()),t.done)return}}_updateDirtyExtents(t){for(;!this._dirtyExtents.empty&&!t.done;){const e=this._dirtyExtents.pop(),i=this.elevationProvider.spatialReference;this.events.emit("invalidate-elevation",{extent:e,spatialReference:i});const s=this._dirtyGraphicsSet.size;this.queryGraphicUIDsInExtent(e,i,r=>{const a=this.graphicsCore.getGraphics3DGraphicById(r);a!=null&&a.needsElevationUpdates()&&this._dirtyGraphicsSet.add(r)}),this._averageExtentUpdateSize=.1*(this._dirtyGraphicsSet.size-s)+.9*this._averageExtentUpdateSize,t.madeProgress()}}_markAllGraphicsElevationDirty(){this._dirtyExtents.clear(),this._dirtyGraphicsSet.clear(),this.graphicsCore.graphics3DGraphics.forEach((t,e)=>this._dirtyGraphicsSet.add(e))}_elevationChanged(t){if(t.context==="scene"&&(!this.graphicsCore.layer.elevationInfo||this.graphicsCore.layer.elevationInfo.mode!=="relative-to-scene"))return;const{extent:e,spatialReference:i}=t;if(this.graphicsCoreOwner.suspended){if(!this._updateElevation){const s=this.graphicsCore.computedExtent;s&&e[2]>s.xmin&&e[0]s.ymin&&e[1]this._viewChange()),S(()=>e.state.camera,()=>this._viewChange(),ti),s.registerTask(B.FRUSTUM_VISIBILITY,this),S(()=>i.visibleElevationBounds,()=>this._elevationBoundsChange())]),e.viewingMode==="local"?this._isVisibleBelowSurface=!0:this.addHandles([S(()=>{var r,a,n;return[i.baseOpacity,i.wireframe,(n=(a=(r=e.map)==null?void 0:r.ground)==null?void 0:a.navigationConstraint)==null?void 0:n.type]},()=>this._updateIsVisibleBelowSurface(),ii)])}destroy(){this._set("graphicsCoreOwner",null),this._extent=null,this._extentIntersection=null}_setDirty(){this.updating||this._set("updating",!0)}setExtent(t){this._extent=t,this._extentIntersectionDirty=!0,this._setDirty()}_viewChange(){this._setDirty()}_elevationBoundsChange(){this._setDirty(),this._extentIntersectionDirty=!0}set _isVisibleBelowSurface(t){this._isVisibleBelowSurfaceInternal=t,this._setDirty(),this._extentIntersectionDirty=!0}_updateIsVisibleBelowSurface(){var r,a;const t=this.graphicsCoreOwner.view,e=t.basemapTerrain,i=t.viewingMode==="local",s=((a=(r=t.map.ground)==null?void 0:r.navigationConstraint)==null?void 0:a.type)==="none";this._isVisibleBelowSurface=i||!e.opaque||s}_updateExtentIntersection(){if(!this._extentIntersectionDirty)return;this._extentIntersectionDirty=!1;const t=this.graphicsCoreOwner.view;let e;if(this._isVisibleBelowSurfaceInternal)e=-.3*Ie(t.spatialReference).radius;else{const{min:i,max:s}=t.basemapTerrain.visibleElevationBounds;e=i-Math.max(1,(s-i)*(vi-1))}this._extentIntersection.update(this._extent,t.spatialReference,e)}get running(){return this.updating}runTask(t){if(this._set("updating",!1),!this._extent)return this._set("suspended",!1),ae.YIELD;this._updateExtentIntersection();const e=this.graphicsCoreOwner.view.frustum,i=Ie(this.graphicsCoreOwner.view.spatialReference).radius;this._set("suspended",!this._extentIntersection.isVisibleInFrustum(e,i)),t.madeProgress()}};o([h({readOnly:!0})],M.prototype,"suspended",void 0),o([h({constructOnly:!0})],M.prototype,"graphicsCoreOwner",void 0),o([h({readOnly:!0})],M.prototype,"updating",void 0),M=o([L("esri.views.3d.layers.graphics.Graphics3DFrustumVisibility")],M);var I;(function(t){t[t.Object=0]="Object",t[t.RenderGeometry=1]="RenderGeometry",t[t.External=2]="External",t[t.COUNT=3]="COUNT"})(I||(I={}));class Si{constructor(){this._items=[]}addObject(e,i){this._items.push({type:I.Object,objectStateId:i,object:e})}addRenderGeometry(e,i,s){this._items.push({type:I.RenderGeometry,objectStateId:i,renderGeometry:e,owner:s})}addExternal(e,i){this._items.push({type:I.External,objectStateId:i,remove:e})}remove(e){for(let i=this._items.length-1;i>=0;--i){const s=this._items[i];s.objectStateId===e&&(this._removeObjectStateItem(s),this._items.splice(i,1))}}removeObject(e){for(let i=this._items.length-1;i>=0;--i){const s=this._items[i];s.type===I.Object&&s.object===e&&(this._removeObjectStateItem(s),this._items.splice(i,1))}}removeRenderGeometry(e){for(let i=this._items.length-1;i>=0;--i){const s=this._items[i];s.type===I.RenderGeometry&&s.renderGeometry===e&&(this._removeObjectStateItem(s),this._items.splice(i,1))}}removeAll(){this._items.forEach(e=>{this._removeObjectStateItem(e)}),this._items=[]}_removeObjectStateItem(e){switch(e.type){case I.Object:e.objectStateId.channel===Ee.Highlight?e.object.removeHighlight(e.objectStateId):e.objectStateId.channel===Ee.MaskOccludee&&e.object.removeOcclude(e.objectStateId);break;case I.RenderGeometry:e.owner.removeRenderGeometryObjectState(e.renderGeometry,e.objectStateId);break;case I.External:e.remove(e.objectStateId)}}}class Ci{constructor(e,i){this.stateType=e,this.objectIdField=i,this.objectStateSet=new Si,this.ids=new Set,this.paused=!1}hasGraphic(e){if(this.objectIdField){const i=e.graphic.attributes[this.objectIdField];return this.ids.has(i)}return this.ids.has(e.graphic.uid)}}class Pi{constructor(e){this._graphicsCore=e,this._stateSets=new Array}destroy(){this.reset(),this._stateSets=null}reset(){this._stateSets&&(this._stateSets.forEach(e=>e.objectStateSet.removeAll()),this._stateSets.length=0)}acquireSet(e,i){const s=new Ci(e,i);this._stateSets.push(s);const r=se(()=>this.releaseSet(s));return{set:s,handle:r}}releaseSet(e){e.objectStateSet.removeAll();const i=this._stateSets?this._stateSets.indexOf(e):-1;i!==-1&&this._stateSets.splice(i,1)}_addObjectStateSet(e,i){e.addObjectStateSet(i.stateType,i.objectStateSet)}_removeObjectStateSet(e,i){e.removeObjectState(i.objectStateSet)}setUid(e,i){e.ids.add(i);const s=this._graphicsCore.graphics3DGraphics.get(i);s&&this._addObjectStateSet(s,e)}setUids(e,i){i.forEach(s=>this.setUid(e,s))}setObjectIds(e,i){i.forEach(s=>e.ids.add(s)),this._initializeSet(e)}addGraphic(e){this._stateSets.forEach(i=>{!i.paused&&i.hasGraphic(e)&&this._addObjectStateSet(e,i)})}removeGraphic(e){this._stateSets.forEach(i=>{i.hasGraphic(e)&&this._removeObjectStateSet(e,i)})}allGraphicsDeleted(){this._stateSets&&this._stateSets.forEach(e=>e.objectStateSet.removeAll())}_initializeSet(e){const i=this._graphicsCore.graphics3DGraphics;e.objectIdField?i.forEach(s=>{s&&e.hasGraphic(s)&&this._addObjectStateSet(s,e)}):e.ids.forEach(s=>{const r=i.get(s);r&&this._addObjectStateSet(r,e)})}get test(){return{states:this._stateSets}}}export{p as F,hi as e,fi as l,P as p,Pi as s,M as u,C as y}; diff --git a/dist/assets/GraphicsLayerView3D-TqJxY2EU.js b/dist/assets/GraphicsLayerView3D-TqJxY2EU.js new file mode 100644 index 0000000..1d9d836 --- /dev/null +++ b/dist/assets/GraphicsLayerView3D-TqJxY2EU.js @@ -0,0 +1 @@ +import{F as l,n as c,E as h,G as u,e as t,y as o,c as d}from"./index-J0iiHjMT.js";import{n as m}from"./LayerView3D-iOx2MD1g.js";import{c as g,r as y}from"./queryForSymbologySnapping-I1fFQTD_.js";import{O as f}from"./GraphicsProcessor-rh5nA4fc.js";import{l as b}from"./projectExtentUtils-TwA6ooHn.js";import{u as v}from"./LayerView-efDufa6j.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";let i=class extends m(v){constructor(){super(...arguments),this.type="graphics-3d",this.symbologySnappingSupported=!0,this._slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.ignoresMemoryFactor=!0}initialize(){this._set("processor",new f({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this.addHandles(this.layer.on("graphic-update",e=>this.processor.graphicsCore.graphicUpdateHandler(e))),this.addResolvingPromise(b(this).then(e=>this.fullExtentInLocalViewSpatialReference=e)),this.layer.internal?this.notifyChange("updating"):this.addHandles(l(()=>{var e,s;return(s=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:s.ready},()=>()=>this.notifyChange("updating"),{once:!0}))}destroy(){this._updatingHandles.removeAll(),this._set("processor",c(this.processor))}get loadedGraphics(){return this.layer.graphics}get legendEnabled(){var e;return this.canResume()&&!((e=this.processor)!=null&&e.frustumVisibilitySuspended)}get slicePlaneEnabled(){const e=this.layer.internal;return this._slicePlaneEnabled&&!e}set slicePlaneEnabled(e){this._slicePlaneEnabled=e}getSuspendInfo(){var s,r;const e=super.getSuspendInfo();return e.outsideScaleRange=((s=this.processor)==null?void 0:s.scaleVisibilitySuspended)??!1,e.outsideOfView=((r=this.processor)==null?void 0:r.frustumVisibilitySuspended)??!1,e}async fetchPopupFeatures(e,s){return(s==null?void 0:s.clientGraphics)??[]}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,s){return this.processor.whenGraphicBounds(e,s)}computeAttachmentOrigin(e,s){var r;return(r=this.processor)==null?void 0:r.computeAttachmentOrigin(e,s)}getSymbolLayerSize(e,s){return this.processor.getSymbolLayerSize(e,s)}queryGraphics(){return Promise.resolve(this.loadedGraphics)}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return this.processor.highlight(e)}async elevationAlignPointsInFeatures(e,s){const{processor:r}=this;if((r==null?void 0:r.graphics3DGraphics)==null)throw new h("graphicslayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");const{graphics3DGraphics:a}=r,p=n=>typeof n=="number"?a.get(n):void 0;return g(this.view,this.layer,p,e,s)}async queryForSymbologySnapping(e,s){return y(this.processor,e,s)}get updatePolicy(){var e;return((e=this.processor)==null?void 0:e.graphicsCore.effectiveUpdatePolicy)||u.SYNC}canResume(){var e;return super.canResume()&&!((e=this.processor)!=null&&e.scaleVisibilitySuspended)}isUpdating(){var e,s;return this.view&&this.layer&&!(!((e=this.processor)!=null&&e.updating)&&(this.layer.internal||(s=this.view.basemapTerrain)!=null&&s.ready))}get performanceInfo(){var e,s;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:((e=this.processor)==null?void 0:e.elevationAlignment.updating)??!1,visibilityFrustum:!((s=this.processor)!=null&&s.frustumVisibilitySuspended)}}get usedMemory(){var e,s;return((s=(e=this.processor)==null?void 0:e.graphicsCore)==null?void 0:s.usedMemory)??0}get unloadedMemory(){var e,s;return(s=(e=this.processor)==null?void 0:e.graphicsCore)==null?void 0:s.unprocessedMemoryEstimate}};t([o()],i.prototype,"loadedGraphics",null),t([o({readOnly:!0})],i.prototype,"legendEnabled",null),t([o()],i.prototype,"layer",void 0),t([o({readOnly:!0})],i.prototype,"processor",void 0),t([o()],i.prototype,"_slicePlaneEnabled",void 0),t([o({type:Boolean})],i.prototype,"slicePlaneEnabled",null),i=t([d("esri.views.3d.layers.GraphicsLayerView3D")],i);const _=i;export{_ as default}; diff --git a/dist/assets/GraphicsProcessor-rh5nA4fc.js b/dist/assets/GraphicsProcessor-rh5nA4fc.js new file mode 100644 index 0000000..92ad206 --- /dev/null +++ b/dist/assets/GraphicsProcessor-rh5nA4fc.js @@ -0,0 +1 @@ +import{e as n,p as g,c3 as b,k as f,G as m,c4 as C,f as w,d as p,C as V,n as c,c5 as S,c6 as v,c7 as E,c8 as _,c9 as h,ca as x,S as u,V as G,A as O,y as a,c as P,a2 as A,cb as j,cc as H}from"./index-J0iiHjMT.js";import{F as I,p as R,y as z,s as D,u as q}from"./Graphics3DObjectStates--mMi4sdi.js";let r=class extends g{constructor(e){super(e),this.type="graphics-3d",this.graphicsCore=null,this.drapeSourceType=b.Features,this.scaleVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this._suspendResumeExtent=null,this._updatingHandles=new f}initialize(){const{layer:e}=this,i="effectiveScaleRange"in e?e:null,l=this.scaleVisibilityEnabled&&i!=null,t=new I({owner:this,layer:this.owner.layer,preferredUpdatePolicy:m.SYNC,graphicSymbolSupported:!0,componentFactories:{elevationAlignment:(s,o)=>new R({graphicsCoreOwner:this,graphicsCore:s,queryGraphicUIDsInExtent:o,elevationProvider:this.view.elevationProvider}),scaleVisibility:l?(s,o)=>new z({graphicsCoreOwner:this,layer:i,queryGraphicUIDsInExtent:o,graphicsCore:s,basemapTerrain:this.owner.view.basemapTerrain}):null,objectStates:s=>new D(s)}});if(this._set("graphicsCore",t),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new q({graphicsCoreOwner:this})),"fullOpacity"in this.owner){const s=this.owner;this._updatingHandles.add(()=>s.fullOpacity,()=>this.graphicsCore.opacityChange())}if("elevationInfo"in e){const s=e;this._updatingHandles.add(()=>s.elevationInfo,(o,y)=>{C(o,y)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())})}this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){try{await this.graphicsCore.initializePromise}catch(e){if(w(e))return;throw e}this.destroyed||(this.addHandles(p(()=>this.view.clippingArea,()=>this._updateClippingExtent(),V)),this._updateClippingExtent(),this._setupSuspendResumeExtent(),this.graphicsCore.startCreateGraphics())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",c(this.frustumVisibility)),this._set("graphicsCore",c(this.graphicsCore))}get layer(){return this.owner.layer}get view(){return this.owner.view}get scaleVisibility(){var e;return(e=this.graphicsCore)==null?void 0:e.scaleVisibility}get elevationAlignment(){var e;return(e=this.graphicsCore)==null?void 0:e.elevationAlignment}get objectStates(){var e;return(e=this.graphicsCore)==null?void 0:e.objectStates}get scaleVisibilitySuspended(){return!(this.scaleVisibility==null||!this.scaleVisibility.suspended)}get frustumVisibilitySuspended(){return this.frustumVisibility!=null&&this.frustumVisibility.suspended}get suspended(){return this.owner.suspended??!1}get updating(){var e;return!!((e=this.graphicsCore)!=null&&e.updating||this.scaleVisibility!=null&&this.scaleVisibility.updating||this.frustumVisibility!=null&&this.frustumVisibility.updating||this._updatingHandles.updating)}get graphics3DGraphics(){var e;return(e=this.graphicsCore)==null?void 0:e.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var e;return(e=this.graphicsCore)==null?void 0:e.graphics3DGraphicsByObjectID}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){return this.owner.fullOpacity??1}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}notifyGraphicGeometryChanged(e){this.graphicsCore.notifyGraphicGeometryChanged(e)}notifyGraphicVisibilityChanged(e){this.graphicsCore.notifyGraphicVisibilityChanged(e)}getRenderingInfo(e,i,l){const t=S(e,{renderer:i,arcade:l});if(t!=null&&t.color){const s=t.color;s[0]=s[0]/255,s[1]=s[1]/255,s[2]=s[2]/255}return t}getRenderingInfoAsync(e,i,l,t){return v(e,{renderer:i,arcade:l,...t})}getHit(e){if(this.owner.loadedGraphics){const i=this.owner.loadedGraphics.find(l=>l.uid===e);if(i){const l=this.layer instanceof E?this.layer:null,t=_(i,l);return{type:"graphic",graphic:t,layer:t.layer}}}return null}whenGraphicBounds(e,i){return this.graphicsCore?this.graphicsCore.whenGraphicBounds(e,i):Promise.reject()}computeAttachmentOrigin(e,i){return this.graphicsCore?this.graphicsCore.computeAttachmentOrigin(e,i):null}getSymbolLayerSize(e,i){return this.graphicsCore?this.graphicsCore.getSymbolLayerSize(e,i):null}maskOccludee(e){const{set:i,handle:l}=this.objectStates.acquireSet(h.MaskOccludee,null);return this.objectStates.setUid(i,e.uid),l}highlight(e){if(e instanceof x)return d;if(typeof e=="number")return this.highlight([e]);if(e instanceof u)return this.highlight([e]);if(e instanceof G&&(e=e.toArray()),Array.isArray(e)&&e.length>0){if(e[0]instanceof u){const i=e.map(s=>s.uid),{set:l,handle:t}=this.objectStates.acquireSet(h.Highlight,null);return this.objectStates.setUids(l,i),t}if(typeof e[0]=="number"){const i=e,{set:l,handle:t}=this.objectStates.acquireSet(h.Highlight,null);return this.objectStates.setObjectIds(l,i),t}}return d}_setupSuspendResumeExtent(){const{scaleVisibility:e,frustumVisibility:i}=this;if(e==null&&i==null)return;const l=({computedExtent:t,extentPadding:s})=>{this._suspendResumeExtent=j(t,this._suspendResumeExtent,H,s),e!=null&&e.setExtent(this._suspendResumeExtent),i!=null&&i.setExtent(this._suspendResumeExtent)};this.addHandles(p(()=>{var t,s;return{computedExtent:(t=this.graphicsCore)==null?void 0:t.computedExtent,extentPadding:(s=this.graphicsCore)==null?void 0:s.extentPadding}},t=>l(t),O))}_updateClippingExtent(){const e=this.view.clippingArea;this.graphicsCore.setClippingExtent(e,this.view.spatialReference)&&this.graphicsCore.recreateAllGraphics()}};n([a()],r.prototype,"type",void 0),n([a({constructOnly:!0})],r.prototype,"owner",void 0),n([a()],r.prototype,"layer",null),n([a()],r.prototype,"view",null),n([a({constructOnly:!0})],r.prototype,"graphicsCore",void 0),n([a()],r.prototype,"scaleVisibility",null),n([a({constructOnly:!0})],r.prototype,"frustumVisibility",void 0),n([a()],r.prototype,"elevationAlignment",null),n([a()],r.prototype,"objectStates",null),n([a()],r.prototype,"scaleVisibilitySuspended",null),n([a({readOnly:!0})],r.prototype,"frustumVisibilitySuspended",null),n([a()],r.prototype,"suspended",null),n([a({readOnly:!0})],r.prototype,"updating",null),n([a()],r.prototype,"loadedGraphics",null),n([a()],r.prototype,"fullOpacity",null),n([a()],r.prototype,"slicePlaneEnabled",null),n([a()],r.prototype,"drapeSourceType",void 0),n([a()],r.prototype,"updatePolicy",null),n([a({constructOnly:!0})],r.prototype,"scaleVisibilityEnabled",void 0),n([a({constructOnly:!0})],r.prototype,"frustumVisibilityEnabled",void 0),n([a()],r.prototype,"initializePromise",void 0),r=n([P("esri.views.3d.layers.graphics.GraphicsProcessor")],r);const d=A();export{r as O}; diff --git a/dist/assets/GraphicsSnappingSource-FqTOI9A3.js b/dist/assets/GraphicsSnappingSource-FqTOI9A3.js new file mode 100644 index 0000000..0b6f7ae --- /dev/null +++ b/dist/assets/GraphicsSnappingSource-FqTOI9A3.js @@ -0,0 +1 @@ +import{p as v,k as S,gD as w,P as y,gC as b,d as k,fl as E,gH as F,s as c,gI as C,gF as P,b as G,fd as A,l as I,gJ as g,ct as H,e1 as $,eU as R,eZ as O,fe as x,eQ as z,ai as Z,e as r,y as p,c as M,gG as L,gK as W}from"./index-J0iiHjMT.js";import{a as J}from"./normalizeUtilsSync-zfJiThlh.js";import{m as j}from"./FeatureStore-X-AIJLo2.js";import{W as q}from"./QueryEngine-8tLWlkSE.js";import{o as D,a as N}from"./queryEngineUtils-0F1SWi13.js";import{i as m,r as T,n as _}from"./symbologySnappingCandidates-Sz0MFOvR.js";import"./BoundsStore-wmwfHjhp.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./VertexSnappingCandidate-sgrBHAMS.js";import"./PointSnappingHint-ULetRXiW.js";const f="graphics-collections";let a=class extends v{get updating(){return this._updatingHandles.updating}get _hasZ(){const e=this.view;return e!=null&&e.type==="3d"&&this.layerSource.layer.type!=="map-notes"}get _snappingElevationAligner(){const{view:e}=this,{layer:t}=this.layerSource,s=e!=null&&e.type==="3d";if(!s||t.type==="map-notes")return m();const i=async(n,o)=>(await L(e.whenLayerView(t),o)).elevationAlignPointsInFeatures(n,o);return m(s,{elevationInfo:t.elevationInfo,alignPointsInFeatures:i})}get _snappingElevationFilter(){const{view:e}=this,t=e!=null&&e.type==="3d"&&this.layerSource.layer.type!=="map-notes";return T(t)}get _symbologySnappingFetcher(){const{view:e}=this,{layer:t}=this.layerSource,s=e!=null&&e.type==="3d",i=this._extrudedPolygonSymbolsCount>0;return s&&t.type!=="map-notes"&&i?_(i,async(n,o)=>{const l=await e.whenLayerView(t);return c(o),l.queryForSymbologySnapping({candidates:n,spatialReference:e.spatialReference},o)}):_()}constructor(e){super(e),this.availability=1,this._sources={multipoint:null,point:null,polygon:null,polyline:null},this._loadedWkids=new Set,this._loadedWkts=new Set,this._pendingAdds=[],this._extrudedPolygonSymbolsCount=0,this._updatingHandles=new S,this._memoizedMakeGetGroundElevation=w(D)}destroy(){for(const e of this._pendingAdds)e.task.abort();this._pendingAdds.length=0,this._mapSources(e=>this._destroySource(e)),this._updatingHandles.destroy()}initialize(){this._updatingHandles.add(()=>this.getGraphicsLayers(),s=>{this._updatingHandles.removeHandles(f);for(const i of s)this._addMany(i.graphics.toArray()),this.addHandles([i.on("graphic-update",n=>this._onGraphicUpdate(n)),this._updatingHandles.addOnCollectionChange(()=>i.graphics,n=>this._onGraphicsChanged(n))],f)},y);const{view:e}=this,{layer:t}=this.layerSource;e!=null&&e.type==="3d"&&t.type!=="map-notes"&&this.addHandles([e.elevationProvider.on("elevation-change",({context:s})=>{b(s,t.elevationInfo)&&this._snappingElevationAligner.notifyElevationSourceChange()}),k(()=>t.elevationInfo,()=>this._snappingElevationAligner.notifyElevationSourceChange(),y),E(()=>t,["edits","apply-edits","graphic-update"],()=>this._symbologySnappingFetcher.notifySymbologyChange())])}async fetchCandidates(e,t){const{point:s,coordinateHelper:{spatialReference:i}}=e,n=await F(this._mapSources(d=>this._fetchCandidatesForSource(d,e,t)));c(t);const o=this._memoizedMakeGetGroundElevation(this.view,i),l=n.flat().map(d=>N(d,o));return C(s,l),l}async _fetchCandidatesForSource(e,t,s){var u;const i=P(t,((u=this.view)==null?void 0:u.type)??"2d"),n=await e.queryEngine.executeQueryForSnapping(i,s);c(s);const o=await this._snappingElevationAligner.alignCandidates(n.candidates,t.coordinateHelper.spatialReference,s);c(s);const l=await this._symbologySnappingFetcher.fetch(o,s);c(s);const d=l.length===0?o:[...o,...l];return this._snappingElevationFilter.filter(i,d)}refresh(){}_onGraphicUpdate(e){if(this.getGraphicsLayers().some(t=>t.graphics.includes(e.graphic)))switch(e.property){case"geometry":case"visible":this._remove(e.graphic),this._addMany([e.graphic])}}_onGraphicsChanged(e){for(const t of e.removed)this._remove(t);this._addMany(e.added)}_addMany(e){const t=[],s=new Map;for(const i of e)i.geometry!=null&&(this._needsInitializeProjection(i.geometry.spatialReference)?(t.push(i.geometry.spatialReference),s.set(i.uid,i)):this._add(i));this._createPendingAdd(t,s)}_createPendingAdd(e,t){if(!e.length)return;const s=G(async o=>{await A(e.map(l=>({source:l,dest:this.spatialReference})),{signal:o}),this._markLoadedSpatialReferences(e);for(const[,l]of t)this._add(l)});this._updatingHandles.addPromise(s.promise);const i={task:s,graphics:t},n=()=>W(this._pendingAdds,i);s.promise.then(n,n),this._pendingAdds.push(i)}_markLoadedSpatialReferences(e){for(const t of e){t.wkid!=null&&this._loadedWkids.add(t.wkid);const s=t.wkt2||t.wkt;s&&this._loadedWkts.add(s)}}_add(e){if(e.geometry==null||!e.visible)return;let t=e.geometry;if(t.type==="mesh")return;t.type==="extent"&&(t=I.fromExtent(t));const s=this._ensureSource(t.type);if(s==null)return;const i=this._createOptimizedFeature(e.uid,t);i!=null&&(s.featureStore.add(i),g(e.symbol)&&this._extrudedPolygonSymbolsCount++)}_needsInitializeProjection(e){if(e.wkid!=null&&this._loadedWkids.has(e.wkid))return!1;const t=e.wkt2||e.wkt;return(!t||!this._loadedWkts.has(t))&&!H(e,this.spatialReference)}_createOptimizedFeature(e,t){const s=$(J(t),this.spatialReference);if(!s)return null;const i=this._ensureGeometryHasZ(s),n=R(i,this._hasZ,!1);return new O(n,{[h]:e},null,e)}_ensureGeometryHasZ(e){if(!this._hasZ)return e;const t=i=>{for(;i.length<3;)i.push(0)},s=e.clone();switch(s.hasZ=!0,s.type){case"point":s.z=s.z??0;break;case"multipoint":s.points.forEach(t);break;case"polyline":s.paths.forEach(i=>i.forEach(t));break;case"polygon":s.rings.forEach(i=>i.forEach(t))}return s}_ensureSource(e){const t=this._sources[e];if(t!=null)return t;const s=this._createSource(e);return this._sources[e]=s,s}_createSource(e){const t=x.toJSON(e),s=this._hasZ,i=new j({geometryType:t,hasZ:s,hasM:!1});return{featureStore:i,queryEngine:new q({featureStore:i,fieldsIndex:z.fromLayerJSON({fields:[{name:h,type:"esriFieldTypeOID",alias:h}]}),geometryType:t,hasM:!1,hasZ:s,objectIdField:h,spatialReference:this.spatialReference,priority:Z.SNAPPING,scheduler:this.view!=null&&this.view.type==="3d"?this.view.resourceController.scheduler:null}),type:e}}_remove(e){this._mapSources(t=>this._removeFromSource(t,e));for(const t of this._pendingAdds)t.graphics.delete(e.uid),t.graphics.size===0&&t.task.abort()}_removeFromSource(e,t){const s=t.uid;e.featureStore.has(s)&&(e.featureStore.removeById(t.uid),g(t.symbol)&&this._extrudedPolygonSymbolsCount--)}_destroySource(e){e.queryEngine.destroy(),this._sources[e.type]=null}_mapSources(e){const{point:t,polygon:s,polyline:i,multipoint:n}=this._sources,o=[];return t!=null&&o.push(e(t)),s!=null&&o.push(e(s)),i!=null&&o.push(e(i)),n!=null&&o.push(e(n)),o}};r([p()],a.prototype,"getGraphicsLayers",void 0),r([p({constructOnly:!0})],a.prototype,"layerSource",void 0),r([p({constructOnly:!0})],a.prototype,"spatialReference",void 0),r([p({constructOnly:!0})],a.prototype,"view",void 0),r([p({readOnly:!0})],a.prototype,"updating",null),r([p({readOnly:!0})],a.prototype,"availability",void 0),r([p()],a.prototype,"_hasZ",null),r([p()],a.prototype,"_snappingElevationAligner",null),r([p()],a.prototype,"_snappingElevationFilter",null),r([p()],a.prototype,"_symbologySnappingFetcher",null),r([p()],a.prototype,"_extrudedPolygonSymbolsCount",void 0),a=r([M("esri.views.interactive.snapping.featureSources.GraphicsSnappingSource")],a);const h="OBJECTID";export{a as GraphicsSnappingSource}; diff --git a/dist/assets/GraphicsView3D-6FUUKif_.js b/dist/assets/GraphicsView3D-6FUUKif_.js new file mode 100644 index 0000000..134a541 --- /dev/null +++ b/dist/assets/GraphicsView3D-6FUUKif_.js @@ -0,0 +1 @@ +import{m as i,n as p,e as s,y as t,o as a,c,p as h}from"./index-J0iiHjMT.js";import{O as n}from"./GraphicsProcessor-rh5nA4fc.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";let e=class extends i(h){constructor(r){super(r),this.processor=null,this.slicePlaneEnabled=!1,this.layer=new l}initialize(){this._set("processor",new n({owner:this}))}destroy(){this._set("processor",p(this.processor))}get graphics(){var r;return(r=this.view)==null?void 0:r.graphics}get loadedGraphics(){return this.graphics}get updating(){var r;return!!((r=this.processor)!=null&&r.updating)}get symbolUpdateType(){return this.processor.graphicsCore.symbolUpdateType}getHit(r){return this.processor.getHit(r)}whenGraphicBounds(r,o){return this.processor.whenGraphicBounds(r,o)}graphicChanged(r){this.processor.graphicsCore.graphicUpdateHandler(r)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}async queryGraphics(){return this.loadedGraphics}async fetchPopupFeatures(r,o){return(o==null?void 0:o.clientGraphics)??[]}highlight(r){return this.processor.highlight(r)}maskOccludee(r){return this.processor.maskOccludee(r)}};s([t({readOnly:!0})],e.prototype,"graphics",null),s([t()],e.prototype,"loadedGraphics",null),s([t({readOnly:!0})],e.prototype,"updating",null),s([t({constructOnly:!0})],e.prototype,"view",void 0),s([t()],e.prototype,"processor",void 0),s([t({type:Boolean})],e.prototype,"slicePlaneEnabled",void 0),s([t()],e.prototype,"layer",void 0),e=s([c("esri.views.3d.layers.GraphicsView3D")],e);class l extends a{constructor(){super(),this.type="graphics-view-3d-dummy",this.id=this.uid}}const v=e;export{v as default}; diff --git a/dist/assets/GroupLayerView-do80uFuS.js b/dist/assets/GroupLayerView-do80uFuS.js new file mode 100644 index 0000000..e930671 --- /dev/null +++ b/dist/assets/GroupLayerView-do80uFuS.js @@ -0,0 +1 @@ +import{e as t,y as a,fs as n,c as d,V,d as y,C as h,ef as o}from"./index-J0iiHjMT.js";import{u as p}from"./LayerView-efDufa6j.js";let l=class extends p{constructor(i){super(i),this.type="group",this.layerViews=new V}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),y(()=>{var i;return(i=this.layer)==null?void 0:i.visibilityMode},()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},h),y(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},h)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",o(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>{const s=this._findLayerViewForLayer(e);return!!(s!=null&&s.visible)});return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(s=>y(()=>s.visible,r=>this._applyVisibility(()=>{r!==this.visible&&(s.visible=this.visible)},()=>this._applyExclusiveVisibility(r?s:null)),h)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e!=null&&e.visible?e:null))}_applyVisibility(i,e){var s,r;this._hasLayerViewVisibleOverrides()&&(((s=this.layer)==null?void 0:s.visibilityMode)==="inherited"?i():((r=this.layer)==null?void 0:r.visibilityMode)==="exclusive"&&e())}};t([a({cast:n})],l.prototype,"layerViews",null),t([a({readOnly:!0})],l.prototype,"updatingProgress",null),t([a()],l.prototype,"view",void 0),l=t([d("esri.views.layers.GroupLayerView")],l);const v=l;export{v as default}; diff --git a/dist/assets/HeatmapDensity.glsl-y7dUg--m.js b/dist/assets/HeatmapDensity.glsl-y7dUg--m.js new file mode 100644 index 0000000..ecb4e3e --- /dev/null +++ b/dist/assets/HeatmapDensity.glsl-y7dUg--m.js @@ -0,0 +1,38 @@ +import{ae as ce,zh as _t,lC as _e,j4 as fe,jL as ft,jU as gt,jQ as ge,zi as Ft,p_ as D,zj as bt,Z as H,e as n,y as o,c as M,p as q,aj as xt,fl as Et,ai as pe,f as A,eB as vt,lt as wt,zk as Rt,zl as Tt,ez as St,ca as U,s as Fe,eD as Ct,O as ke,vt as Dt,zm as Ot,f7 as Vt,zn as It,rI as Q,V as L,rK as k,l as Pt,S as z,bY as $t,bZ as Mt,b_ as At,c0 as Lt,cZ as Nt,k as ee,P as O,bK as Ht,E as P,n as $,ak as Be,a as le,w as We,d as T,A as B,C as ue,jO as Gt,jP as qt,rg as zt,dv as Ut,bI as be,cY as jt,dJ as xe,jR as Ee,dT as Qt,fe as kt,eQ as Bt,dQ as Wt,fS as Jt,dC as Zt,b as Yt,c3 as Je,G as ye,c4 as ve,zo as we,zp as Xt,c9 as W,a2 as X,c5 as Kt,c6 as ei,k4 as ti,F as ii,qX as si,cX as ri,cb as ai,cc as ni,xz as Ze,zb as oi,zq as li,yk as Re,xx as K,xy as N,xM as Ye,de as Xe,xL as he,xO as Ke,xP as et,y6 as tt,xQ as it,xR as ui,xW as st,uS as hi,xN as rt,y8 as di,zr as ci,uB as Te,fA as Se,zs as pi,zt as yi,vq as G,uD as mi,tt as _i,s6 as ie,zu as fi,zv as gi,xE as Fi,bf as v,yl as bi,zw as xi,uY as Ce,x$ as Ei,y0 as vi,xY as wi,lX as Ri,xA as Ti,hL as Si,hu as Ci,x_ as Di,y3 as Oi,yu as Vi,a9 as Ii,uR as J,uC as I,zx as De,ov as Pi,op as $i,oq as Oe,gO as Mi,nG as Ai,zy as Li,eY as Ni,jT as Hi,eZ as Gi,vr as Ve,e3 as qi,fu as Ie,ay as zi,bg as Ui,zz as ji,bz as Pe,b7 as Qi,by as ki,kW as Bi,fy as $e,tY as Wi,e_ as Me,aa as Ji,gJ as Zi,c8 as Yi}from"./index-J0iiHjMT.js";import{c as at}from"./dehydratedFeatureComparison-hdPq-zad.js";import{c as Xi,r as Ki}from"./queryForSymbologySnapping-I1fFQTD_.js";import{i as es}from"./hash-SS5GKVPY.js";import{F as ts,p as is,y as ss,s as rs,u as as,e as nt}from"./Graphics3DObjectStates--mMi4sdi.js";import{W as ns}from"./QueryEngine-8tLWlkSE.js";import{d as Ae}from"./FeatureSet-d4S1oKME.js";import{m as os}from"./FeatureStore-X-AIJLo2.js";import{l as ls}from"./projectExtentUtils-TwA6ooHn.js";let us=class{get isReferenced(){return this.versions.length!==0}get isSingle(){return this.versions.length===1&&this.versions[0].refCount===1}constructor(e,t){this._highestResolutionVersion=null,this.versions=[],this.ref(e,t)}ref(e,t){const i=this.feature;x.oldVersion=i,this.feature&&Object.defineProperty(e,"uid",{value:this.feature.uid,configurable:!0});for(const a of this.versions)if(a.resolution===t){a.refCount++;const l=this._highestResolutionVersion===a&&!at(e,a.feature);return(l||this._highestResolutionVersion!==a)&&(a.feature=e),x.newVersion=l?e:i,x}const r={feature:e,resolution:t,refCount:1};return this.versions.push(r),!this._highestResolutionVersion||t0&&(this._refCount--,!this.isReferenced)?(x.newVersion=null,x):(x.newVersion=this._feature,x)}get feature(){return this._feature}};const x={oldVersion:null,newVersion:null},ds=16438,Le=new Set;let cs=class{get displayingFeatures(){return this._displayingFeatures}set displayingFeatures(e){this._displayingFeatures=e,this.extentIncludingBorrowedFeatures=null}get perTileMaximumNumberOfFeaturesExceeded(){return!this.filtered&&(this.featuresMissing||this.features&&this.featureLimit!==this.features.length)}get features(){return this._features}get featureLimit(){return this._featureLimit}set featureLimit(e){this._featureLimit!==e&&(this._featureLimit=e,this._estimatedUnusedSizeDirty=!0)}get availableFields(){return this._availableFields}setFeatures(e,t,i){this._availableFields=i??Le,this._features=e,this._shuffled=!1,this._estimatedSize=-1,this._estimatedUnusedSizeDirty=!0,e&&e.length>0?(this._emptyFeatureRatio=t/(e.length+t),this._numVertices=e.reduce((r,a)=>r+_t(a.geometry),0)):(this._emptyFeatureRatio=0,this._numVertices=0)}get emptyFeatureRatio(){return this._emptyFeatureRatio}get numFeatures(){return this.hasPreciseFeatureCount?this._numFeatures:this._features?this._features.length:0}set numFeatures(e){this._numFeatures=e}get hasPreciseFeatureCount(){return this._numFeatures>se}get needsFeatureCount(){return this._numFeatures===se}get numVertices(){return this._numVertices}constructor(e){this.descriptor=e,this.fetchStatus=f.FETCH_NEEDED,this._features=null,this._numVertices=0,this._featureLimit=0,this.featuresMissing=!0,this._shuffled=!1,this._numFeatures=se,this._emptyFeatureRatio=0,this._estimatedSize=-1,this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._availableFields=Le,this._displayingFeatures=null,this.alive=!0,this.filtered=!1}get id(){return this.descriptor.id}get estimatedSize(){return this.updateMemoryEstimates(),this._estimatedSize}get estimatedUnusedSize(){return this._estimatedUnusedSize}updateMemoryEstimates(){if(this._estimatedSize<0){if(this._estimatedSize=0,this._estimatedUnusedSize=0,this._features)for(let e=0;e=this.featureLimit&&(this._estimatedUnusedSize+=t)}return!0}if(this._estimatedUnusedSizeDirty){if(this._estimatedUnusedSize=0,this._estimatedUnusedSizeDirty=!1,this._features)for(let e=this.featureLimit;eD(t,e)-D(i,e)),bt(this._features,ds),this._shuffled=!0,this._estimatedUnusedSizeDirty=!0}reduceFeatures(e,t,i){if(e<=0)return!1;if(!this._features)return this.featureLimit=0,!1;let r=!1;this.featureLimit=Math.ceil(this.numFeatures*e),this.featureLimit>this._features.length&&(this.featureLimit=this._features.length,this.fetchStatus===f.DONE&&this._features.length>0&&(this.fetchStatus=f.REFETCH_NEEDED,r=!0)),!this._shuffled&&e<1&&this._shuffle(i);const a=Math.max(this.featureLimit,Math.ceil(t*this.numFeatures));return this._features.length>a&&(this._features.length=a,this.featuresMissing=!0,this.fetchStatus===f.FULL&&(this.fetchStatus=f.DONE)),r}get cache(){return{availableFields:this._availableFields,features:this._features,numFeatures:this._numFeatures,emptyFeatureRatio:this._emptyFeatureRatio,fetchStatus:this.fetchStatus,featuresMissing:this.featuresMissing}}set cache(e){this.requestController=null,this._availableFields=e.availableFields,this._features=e.features,this._numFeatures=e.numFeatures,this._emptyFeatureRatio=e.emptyFeatureRatio,this.fetchStatus=e.fetchStatus,this.featuresMissing=e.featuresMissing,this._estimatedSize=-1,this._estimatedUnusedSizeDirty=!0}};const se=-1,ps=-2;var f;function ys(s,e,t){if(e==null||s==null||t!==e.length||t>s.length)return!1;for(let i=0;ie+=t.estimatedUnusedSize),e}get totalVertices(){let e=0;return this._featureTiles.forEach(t=>e+=t.numVertices),e}get totalFeatures(){let e=0;return this._featureTiles.forEach(t=>e+=t.numFeatures),e}set filterExtent(e){if(e!=null&&this.context.tilingScheme&&!e.spatialReference.equals(this.context.tilingScheme.spatialReference))return void Z.error("#filterExtent=","extent needs to be in the same spatial reference as the tiling scheme");const t=this._get("filterExtent");if(t===e||t!=null&&e&&t.equals(e))return;const i=e!=null?e.clone():null;this._set("filterExtent",i),this._reclip(i,t)}constructor(e){super(e),this._useTileCount=!1,this.updating=!1,this.running=!1,this.updatingTotal=0,this.updatingRemaining=0,this.expectedFeatureDiff=0,this.maximumNumberOfFeaturesExceeded=!1,this._fullRatio=1,this._farRatio=1,this._changes={updates:{adds:new Array,removes:new Array},adds:new Array,removes:new Array},this._frameTask=xt,this._dirty=!1,this._featureTiles=new Map,this._displayingFeatureReferences=new Map,this._numDisplayingFeatureReferences=0,this._suspended=!0,this._pendingEdits=null}initialize(){this.addHandles(Et(()=>this.tileDescriptors,"change",()=>this._setDirty(),{onListenerAdd:()=>this._setDirty()})),this._objectIdField=this.context.objectIdField,this.FeatureReferenceClass=this.context.capabilities.supportsMultipleResolutions?us:hs;const e=this.context.scheduler;e!=null&&(this._frameTask=e.registerTask(pe.FEATURE_TILE_FETCHER,this)),this._setDirty()}destroy(){var e;this._frameTask.remove(),this._featureTiles.forEach(t=>{this._cancelFetchTile(t),this._removeTile(t)}),this._featureTiles.clear(),this._displayingFeatureReferences.clear(),(e=this._pendingEdits)==null||e.controller.abort(),this._pendingEdits=null}get _paused(){return this._suspended||!!this._pendingEdits}restart(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._clearTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}refetch(){this._featureTiles.forEach(e=>{this._cancelFetchTile(e),this._resetFetchTile(e)}),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._setDirty()}suspend(){this._suspended||(this._suspended=!0,this._pause(),this._setDirty())}resume(){this._suspended&&(this._suspended=!1,this._unpause())}_pause(){this._paused&&(this._featureTiles.forEach(e=>this._cancelFetchTile(e)),this._updated())}_unpause(){this._paused||(this._setDirty(),this._updated())}get availableFields(){let e=null;return this._featureTiles.forEach(t=>{t.displayingFeatures!=null&&t.displayingFeatures.length!==0&&(e==null?e=new Set(t.availableFields):e.forEach(i=>{t.availableFields.has(i)||e.delete(i)}))}),e??new Set}applyEdits(e){this._pendingEdits||(this._pendingEdits={edits:Promise.resolve(),count:0,controller:new AbortController},this._pause());const t=this._pendingEdits;t.count++;const i=t.edits.then(()=>e.result.catch(r=>{if(A(r))throw r;return null}).then(r=>r&&(this._applyEditsDeleteFeatures(r.deletedFeatures),this._applyEditsAddUpdateFeatures(r.addedFeatures,r.updatedFeatures,t.controller.signal).then(()=>r))).then(r=>(--t.count==0&&(this._pendingEdits===t&&(this._pendingEdits=null),this.context.memoryCache!=null&&this.context.memoryCache.clear(),this._unpause(),this._updated()),r)));return t.edits=i,this._updated(),i}_applyEditsDeleteFeatures(e){if(e.length===0)return;const t=this.context.globalIdField,i=t&&this.availableFields.has(t),r=new Set,a=this._objectIdField;e.forEach(({objectId:l,globalId:u})=>{(!l||l<0)&&t&&u&&(i||Z.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${t} to be included the layer's outFields for updates to be reflected in the view`),l=this._objectIdFromGlobalId(u,a,t)),l!=null&&l>=0&&r.add(l)}),this._featureTiles.forEach(l=>{if(!l.features)return;const u=l.features.filter(d=>!r.has(D(d,this._objectIdField)));u.length!==l.features.length&&(l.setFeatures(u,0,l.availableFields),this._invalidateCounts())})}_objectIdFromGlobalId(e,t,i){if(e==null)return null;const r=this.features.find(a=>{var l;return((l=a.attributes)==null?void 0:l[i])===e});return r?D(r,t):null}async _applyEditsAddUpdateFeatures(e,t,i){const{objectIdField:r,globalIdField:a}=this.context,l=a&&this.availableFields.has(a),u=new Set,d=new Set;for(const y of e){const h=y.objectId;h!=null&&u.add(h)}for(const{objectId:y,globalId:h}of t){let _=y;(_==null||_<0)&&a&&(l||Z.errorOncePerTick(`Editing the specified service requires the layer's globalIdField, ${a} to be included the layer's outFields for updates to be reflected in the view`),_=this._objectIdFromGlobalId(h,r,a)),_!=null&&_>=0&&(u.add(_),d.add(_))}if(u.size===0)return;const c=[];this._featureTiles.forEach(y=>{const h=this._applyEditsAddUpdateTile(y,u,d,i);h&&c.push(h)}),await Promise.allSettled(c)}async _applyEditsAddUpdateTile(e,t,i,r){if(!e.features)return;const a=this._createQuery(e);a.resultType=void 0,a.cacheHint=!1,a.objectIds=Array.from(t);const l=await this._queryFeatures(a,r);let u=null;if(i.size>0){const d=e.features.filter(c=>!i.has(D(c,this._objectIdField)));d.length!==e.features.length&&(u=d)}if(l.features.length>0){u||(u=e.features.slice());for(const d of l.features)u.push(d)}u&&(e.hasPreciseFeatureCount&&(e.numFeatures=Math.max(e.numFeatures,u.length)),e.setFeatures(u,0,He(e.availableFields,l.fields)),this._invalidateCounts())}_queryFeatures(e,t){return this.context.query.queryFeaturesDehydrated(e,{signal:t,timeout:Fs})}_setDirty(){this._dirty=!0,this._updated()}runTask(e){if(this._frameTask.processQueue(e),!this._dirty||!this.initialized)return;this._dirty=!1;const t=this._getListOfTiles();if(this._markTilesNotAlive(t),!e.run(()=>this._addTiles(t,e))||!e.run(()=>this._filterExtentTiles(t,e))||!e.run(()=>this._removeTiles(t,e))||e.done)return void this._setDirty();const i=this._sortTiles(t);e.run(()=>this._showTiles(i,e))&&e.run(()=>this._fetchTiles(i,e))&&e.run(()=>this._updateMemoryEstimates(i,e))||this._setDirty(),this._updated(),this.updating||this._updateMaximumNumberOfFeaturesExceeded()}_markTilesNotAlive(e){for(const t of e)t.alive=!1}_addTiles(e,t){return!(this._suspended||!this.tileDescriptors)&&(this.tileDescriptors.forEach(i=>{const r=this._featureTiles.get(i.id);r?r.alive=!0:t.done||(e.push(this._addTile(i)),t.madeProgress())}),t.hasProgressed)}_filterExtentTiles(e,t){for(const i of e){if(t.done)break;i.alive&&(i.filtered=!i.intersects(this.filterExtent),i.filtered&&(this._clearTile(i),t.madeProgress()))}return t.hasProgressed}_removeTiles(e,t){for(let i=e.length-1;i>=0&&!t.done;i--){const r=e[i];r.alive||(this._removeTile(r),i!==e.length-1&&(e[i]=e[e.length-1]),e.pop(),t.madeProgress())}return t.hasProgressed}_sortTiles(e){return e.sort((t,i)=>(t.descriptor.loadPriority??0)-(i.descriptor.loadPriority??0)),e}_showTiles(e,t){const i=this._updateRatio(e),r=a=>{const l=this._fullRatio<1?i(a)*this._farRatio:1;return a.reduceFeatures(l,this.memoryFactor,this._objectIdField)&&this._setDirty(),this._showTile(a)};for(const a of e)if(!t.run(()=>r(a))){this._setDirty();break}return t.hasProgressed}_fetchTiles(e,t){if(this._paused)return!1;let i=!1;for(const r of e){if(!r.needsFetching)continue;const a=this.context.memoryCache!=null?this.context.memoryCache.pop(r.id):null;if(a==null){if(this._needsNumFeatures(r)){const l=new AbortController,u=this._fetchTileCount(r,l.signal);this._handleRequest(r,u,l,()=>r.numFeatures=ps),i=!0,t.madeProgress()}if(t.done)return!0}else r.cache=a,this._setDirty(),this._scheduleUpdated(),t.madeProgress()}if(i)return t.hasProgressed;for(const r of e)if(r.needsFetching){const a=new AbortController,l=this._fetchTile(r,a.signal);if(this._handleRequest(r,l,a,u=>{r.setFeatures([],0,null),this._invalidateCounts(),r.featuresMissing=!1,this.context.logFetchError(Z,u)}),t.madeProgress())return!0}return t.hasProgressed}_updateMemoryEstimates(e,t){return e.some(i=>!t.run(()=>i.updateMemoryEstimates())&&(this._setDirty(),!0)),t.hasProgressed}_reclip(e,t){if(!this.initialized)return;const i=new Array;this._featureTiles.forEach(r=>{r.displayingFeatures!=null&&r.displayingFeatures.length!==0&&(r.intersectionIncludingBorrowed(t,Ge),r.intersectionIncludingBorrowed(e,qe),vt(Ge,qe)||i.push(r))}),this._refreshDisplayingFeatures(i),this._updated()}_refreshDisplayingFeatures(e){const t=new Set,i=this._changes.updates;for(const r of e)if(r.displayingFeatures!=null)for(const a of r.displayingFeatures){const l=D(a,this._objectIdField);if(t.has(l))continue;t.add(l);const u=this._displayingFeatureReferences.get(l).feature;i.removes.push(u),i.adds.push(u)}this._applyChanges()}_updated(){let e=0;this._paused||this._featureTiles.forEach(i=>i.isFetching?++e:0);const t=this._dirty||!!this._pendingEdits||e>0;if(this._set("running",this._dirty),this._set("updating",t),t){let i=0,r=0,a=0,l=0,u=0;const d=this._displayingFeatureReferences.size/this._numDisplayingFeatureReferences;this._featureTiles.forEach(h=>{if(++r,h.isFetching&&h.hasPreciseFeatureCount){const _=this._maximumFeaturesForTile(h)*(1-h.emptyFeatureRatio),b=h.displayingFeatures!=null?h.displayingFeatures.length*d:0;u+=_-b}h.needsFetching?++l:h.numFeatures>0&&(++a,i+=h.numFeatures)}),l+=e;let c=0,y=0;i?(y=i,c=Math.min(l*i/a,i)):(y=r,c=l),u=Math.min(this.maximumNumberOfFeatures-this.features.length,u),this._set("updatingTotal",y),this._set("updatingRemaining",c),this._set("expectedFeatureDiff",u)}else this._set("updatingTotal",0),this._set("updatingRemaining",0),this._set("expectedFeatureDiff",0);this.debugger&&this.debugger.update()}_updateMaximumNumberOfFeaturesExceeded(){const e=wt(this._featureTiles,t=>t.perTileMaximumNumberOfFeaturesExceeded);this._set("maximumNumberOfFeaturesExceeded",e)}_updateRatio(e){const t=ms(e),i=l=>1/(1<e&&this._featureTiles.forEach(i=>{if(!i.featuresMissing)return;const r=this._maximumFeaturesForTile(i);i.features&&(i.features.length>=r||i.fetchStatus===f.FULL)||(this._cancelFetchTile(i),this._resetFetchTile(i))}),this._setDirty())}_addTile(e){const t=new cs(e);return this._featureTiles.set(t.id,t),this._resetFetchTile(t),this._referenceDisplayingFeaturesFromRelatedTiles(t),t}_referenceDisplayingFeaturesFromRelatedTiles(e){const t=e.descriptor.resolution;this._featureTiles.forEach(i=>{if(!(i.displayingFeatures==null||e===i||e.descriptor.lij&&i.descriptor.lij&&!Rt(e.descriptor.lij,i.descriptor.lij))){e.displayingFeatures==null&&(e.displayingFeatures=[]),e.descriptor.extent&&i.descriptor.extent&&(e.extentIncludingBorrowedFeatures==null&&(e.extentIncludingBorrowedFeatures=Tt(e.descriptor.extent)),St(e.extentIncludingBorrowedFeatures,i.descriptor.extent,e.extentIncludingBorrowedFeatures));for(const r of i.displayingFeatures){e.displayingFeatures.push(r);const a=this._displayingFeatureReferences.get(D(r,this._objectIdField));a.ref(a.feature,t),this._numDisplayingFeatureReferences++}}}),e.featureLimit=e.displayingFeatures!=null?e.displayingFeatures.length:0}_removeTile(e){this._clearTile(e),this._featureTiles.delete(e.id)}_resetFetchTile(e){e.filtered=!e.intersects(this.filterExtent),e.filtered?e.needsFetching&&(e.fetchStatus=f.DONE):e.fetchStatus=f.FETCH_NEEDED}_cancelFetchTile(e){const t=e.requestController;t!=null&&(e.requestController=null,e.resetFetching(),t.abort())}async _fetchTileCount(e,t){return e.numFeatures=await this._fetchCount(e,t),this._updateRatio(this._getListOfTiles()),e.fetchStatus===f.REFETCHING?f.REFETCH_NEEDED:f.FETCH_NEEDED}async _fetchTile(e,t){const i=this._maximumFeaturesForTile(e);if(i<=0)return fs(e);const r=this._getMaxRecordCount(e),a=Math.ceil(i/r);if(re(e)||!this.context.capabilities.supportsMaxRecordCountFactor||e.numFeatures<=i&&a>U.MAX_MAX_RECORD_COUNT_FACTOR)return this._fetchPagedTile(e,t);const l=this._createQuery(e);if(l.maxRecordCountFactor=Math.ceil(i/r),e.isRefetching&&e.features&&e.features.length>0){const h=Math.ceil(e.features.length/(1-e.emptyFeatureRatio)/r);l.maxRecordCountFactor=Math.max(h+1,l.maxRecordCountFactor)}const{features:u,exceededTransferLimit:d,fields:c}=await this._queryFeatures(l,t),y=d?l.maxRecordCountFactor>=U.MAX_MAX_RECORD_COUNT_FACTOR?f.FULL:f.DONE:f.FULL;return await this._frameTask.schedule(()=>{e.featuresMissing=u.length{h&&(r+=y.num),l+=_.length,a+=this._removeEmptyFeatures(_),e.featuresMissing=r0&&this.context.capabilities.supportsMaxRecordCountFactor?(e.maxRecordCountFactor=Math.ceil(i/r),e.num=Math.min(e.maxRecordCountFactor*r,i)):e.num=Math.min(r),!0)}_getEffectiveTileResolution(e){if(e.descriptor.resolution==null)return null;const t=this.context.viewingMode===ke.Global?this.context.tilingScheme.resolutionAtLevel(3):1/0;return Math.min(e.descriptor.resolution,t)/this.lodFactor}get _supportsResolution(){return this.context.capabilities.supportsMultipleResolutions&&this.context.geometryType!=="point"}_setResolutionParams(e,t){if(!this._supportsResolution)return;const i=this._getEffectiveTileResolution(t);i!=null&&(this.context.capabilities.supportsQuantization?e.quantizationParameters=new Dt({mode:"view",originPosition:"upper-left",tolerance:i,extent:this.context.fullExtent}):this.context.geometryType==="polyline"&&(e.maxAllowableOffset=i))}_removeEmptyFeatures(e){const t=e.length;for(let i=0;i0&&this.context.capabilities.supportsResultType?t:i!=null&&i>0?i:gs}_useTileQuery(e){return(!re(e)||!this.context.capabilities.supportsCacheHint)&&this.context.capabilities.supportsResultType}_handleRequest(e,t,i,r){e.fetchStatus=e.needsRefetching?f.REFETCHING:f.FETCHING,e.requestController=i;let a=!1;t.then(l=>{e.requestController=null,e.fetchStatus=l}).catch(l=>{e.requestController===i&&(e.requestController=null,e.fetchStatus=f.DONE),A(l)?a=!0:r(l)}).then(()=>{a||this._setDirty(),this._scheduleUpdated()})}_scheduleUpdated(){this.hasHandles("scheduleUpdated")||this.addHandles(Vt(()=>{this.removeHandles("scheduleUpdated"),this._updated()}),"scheduleUpdated")}_showTile(e){if(e.displayingFeatures!=null&&!e.needsDisplayUpdate)return!1;const t=e.features;if(e.featureLimit===0||!t){const u=e.displayingFeatures!=null&&e.displayingFeatures.length>0;return this._hideTileFeatures(e),e.displayingFeatures=[],u}const i=e.descriptor.resolution,r=this._changes.updates,a=this._changes.adds,l=Math.min(e.featureLimit,t.length);e.featureLimit=l;for(let u=0;u0&&(this.features.removeMany(e.removes),e.removes.length=0),e.adds.length>0&&(this.features.addMany(e.adds),e.adds.length=0);const t=this._changes.adds,i=this._changes.removes,r=Math.min(t.length,i.length);let a=0;for(;ar&&this.features.addMany(a===0?t:t.slice(a)),i.length>r&&this.features.removeMany(a===0?i:i.slice(a)),t.length=0,i.length=0}_clearTile(e){if(this._hideTile(e),e.features&&this.context.memoryCache!=null){const t=16+e.estimatedSize;this.context.memoryCache.put(e.id,e.cache,t)}e.setFeatures(null,0,null),this._invalidateCounts()}_invalidateCounts(){this.notifyChange("totalVertices"),this.notifyChange("totalFeatures"),this.notifyChange("memoryForUnusedFeatures")}_getListOfTiles(){return Array.from(this._featureTiles.values())}get storedFeatures(){return this._getListOfTiles().reduce((e,t)=>e+(t.features?t.features.length:0),0)}get missingTiles(){return Array.from(this._featureTiles.values()).reduce((e,t)=>e+(t.needsFetching||t.isFetching?1:0),0)}_maximumFeaturesForTile(e){const t=e.hasPreciseFeatureCount?e.numFeatures:1/0,i=e.hasPreciseFeatureCount?t:this.maximumNumberOfFeatures,r=this._fullRatio<1?this._farRatio:1;return Math.min(Math.ceil(i*r/(1-e.emptyFeatureRatio)),t)}get test(){return{process:e=>this.runTask(e),getFeatureTileById:e=>this._featureTiles.get(e),forEachFeatureTile:e=>this._featureTiles.forEach(e)}}};function re(s){return s.id==="dummy-tile-full-extent"}function ms(s){let e=0;for(const t of s)t.features&&t.features.length>0&&t.alive&&(e=Math.max(e,t.descriptor.lij[0]));return e}function ir(s){const e=s.capabilities.query;return{supportsMultipleResolutions:_s(s),supportsPagination:!(!e||!e.supportsPagination),supportsResultType:!(!e||!e.supportsResultType),supportsCacheHint:!(!e||!e.supportsCacheHint),supportsQuantization:!(!e||!e.supportsQuantization),supportsQuantizationEditMode:!(!e||!e.supportsQuantizationEditMode),supportsMaxRecordCountFactor:!(!e||!e.supportsMaxRecordCountFactor),supportsFormatPBF:!(!e||!e.supportsFormatPBF)}}function _s(s){switch(s.geometryType){case"polyline":return!0;case"polygon":return s.capabilities&&s.capabilities.query&&s.capabilities.query.supportsQuantization;default:return!1}}function fs(s){return s.setFeatures([],0,null),s.featuresMissing=!1,f.DONE}function lt(s){return s==null?new Set:new Set(s.map(e=>e.name))}function He(s,e){if(s==null||e==null)return lt(e);const t=new Set;for(const{name:i}of e)s.has(i)&&t.add(i);return t}n([o({constructOnly:!0})],F.prototype,"features",void 0),n([o()],F.prototype,"tileDescriptors",void 0),n([o({value:1/0})],F.prototype,"maximumNumberOfFeatures",null),n([o({value:1})],F.prototype,"memoryFactor",null),n([o({value:1})],F.prototype,"lodFactor",null),n([o()],F.prototype,"useTileCount",null),n([o({readOnly:!0})],F.prototype,"updating",void 0),n([o({readOnly:!0})],F.prototype,"running",void 0),n([o({readOnly:!0})],F.prototype,"updatingTotal",void 0),n([o({readOnly:!0})],F.prototype,"updatingRemaining",void 0),n([o({readOnly:!0})],F.prototype,"expectedFeatureDiff",void 0),n([o({readOnly:!0})],F.prototype,"memoryForUnusedFeatures",null),n([o({readOnly:!0})],F.prototype,"maximumNumberOfFeaturesExceeded",void 0),n([o({readOnly:!0})],F.prototype,"totalVertices",null),n([o({readOnly:!0})],F.prototype,"totalFeatures",null),n([o()],F.prototype,"filterExtent",null),n([o({constructOnly:!0})],F.prototype,"context",void 0),F=n([M(ot)],F);const gs=2e3,Ge=ce(),qe=ce(),Fs=6e5,bs=200,xs=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];let Es=class{constructor(e,t,i){this._loadingGraphics=new Map,this._loadedGraphics=new Map,this._pendingGraphics=new Map,this._dataExtentGraphic=null,this._enabled=!0,this._tileFetcher=e,this._view=i,this._tilingScheme=new It(t),this._loadedSymbols=xs.map(r=>new Q({symbolLayers:new L([new k({material:{color:[r[0],r[1],r[2],.6]},outline:{color:"black",size:1}})])})),this._loadingSymbols=[new Q({symbolLayers:new L([new k({material:{color:[200,200,200,.4]},outline:{color:[30,30,30],size:1}})])})],this._pendingSymbols=[new Q({symbolLayers:new L([new k({material:{color:[100,100,100,.4]},outline:{color:[30,30,30],size:1}})])})],this._dataExtentSymbol=new Q({symbolLayers:new L([new k({material:{color:[0,0,0,0]},outline:{color:"green",size:4}})])})}destroy(){this.enabled=!1}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}update(){this._enabled?(this._synchronizeMaps(this._loadingGraphics,{filter:e=>e.isFetching,symbols:this._loadingSymbols}),this._synchronizeMaps(this._loadedGraphics,{filter:e=>!e.isFetching,symbols:this._loadedSymbols}),this._synchronizeMaps(this._pendingGraphics,{filter:e=>!e.isFetching,symbols:this._pendingSymbols}),this.showDataExtent(this._tileFetcher.filterExtent)):(this._loadingGraphics.forEach(e=>{this._view.graphics.removeMany(e)}),this._loadingGraphics.clear(),this._loadedGraphics.forEach(e=>{this._view.graphics.removeMany(e)}),this._loadedGraphics.clear(),this._pendingGraphics.forEach(e=>{this._view.graphics.removeMany(e)}),this._pendingGraphics.clear(),this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null))}showDataExtent(e){if(this._dataExtentGraphic&&(this._view.graphics.remove(this._dataExtentGraphic),this._dataExtentGraphic=null),e==null)return;const t=Pt.fromExtent(e);this._dataExtentGraphic=new z({geometry:t,symbol:this._dataExtentSymbol}),this._view.graphics.add(this._dataExtentGraphic)}_synchronizeMaps(e,t){const i=[];e.forEach((r,a)=>{const l=this._tileFetcher.test.getFeatureTileById(a);l&&t.filter(l)||(this._view.graphics.removeMany(r),i.push(a))}),i.forEach(r=>e.delete(r)),this._tileFetcher.test.forEachFeatureTile(r=>{if(t.filter(r)&&!e.has(r.id)){const[a,l,u]=r.descriptor.lij;this._tilingScheme.ensureMaxLod(a);const d=this._tilingScheme.getExtentGeometry(a,l,u),c=[new z({geometry:d,symbol:t.symbols[a%t.symbols.length]}),new z({geometry:d.center,symbol:new $t({verticalOffset:new Mt({screenLength:40/.75}),callout:new At({color:"white",border:{color:"black"}}),symbolLayers:new L([new Lt({text:`${a}/${l}/${u}`,halo:{color:"white",size:1/.75},material:{color:"black"},size:16})])})})];e.set(r.id,c),this._view.graphics.addMany(c)}})}},g=class extends Nt(q){set extent(e){if(e!=null&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void H.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e||t!=null&&e&&t.equals(e))return;const i=e!=null?e.clone():null;this._set("extent",i)}get updating(){return!!(this._tileFetcher!=null&&this._tileFetcher.updating||this._fetchDataInfoPromise!=null||this.mode==="tiles"&&this.layerView.view.featureTiles&&this.layerView.view.featureTiles.updating||this._updatingHandles&&this._updatingHandles.updating)}get updatingTotal(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&this._tileFetcher!=null?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return this._tileFetcher!=null?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(this._tileFetcher==null||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){var e;return((e=this.displayFeatureLimit)==null?void 0:e.maximumNumberOfFeatures)??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get mode(){var a,l;const e=this.layerView.layer;if(e.type==="feature"&&e.infoFor3D!=null)return"snapshot";if(this._forceTilesMode)return"tiles";const t=this.layerView.view;if(((l=(a=t.qualitySettings)==null?void 0:a.graphics3D)==null?void 0:l.snapshotAvailable)===!1||this.serviceDataCount===S.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return"tiles";const i=t&&t.featureTiles,r=i&&i.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const u=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/u+this.serviceDataExtent.height/u)/2>S.maxSnapshotMinScaleFactor)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){var i;const e=this._get("maxTotalSnapshotVertices")||0,t=this.mode==="snapshot"&&((i=this._tileFetcher)==null?void 0:i.totalVertices)||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),a=t.levels[0];return r*((a.tileSize[0]/(a.scale/e)+a.tileSize[1]/(a.scale/e))/2)}get tileDescriptors(){return this.mode==="snapshot"?new L([{id:"dummy-tile-full-extent",lij:[0,0,0]}]):this.layerView.view.featureTiles?this.layerView.view.featureTiles.tiles:new L}get test(){return{fetchDataInfoPromise:this._fetchDataInfoPromise,tileFetcher:this._tileFetcher}}constructor(e){super(e),this.type="feature-tile-3d",this._updatingHandles=new ee,this.serviceDataExtent=null,this.serviceDataCount=S.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=>this.displayFeatureLimit,e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal))),this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),O),this._updatingHandles.add(()=>this.mode,(e,t)=>{e==="tiles"&&t==="snapshot"&&(this._forceTilesMode=!0)},O),this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){var t;const e=this.layerView.layer;if(e.type!=="ogc-feature"&&!((t=Ht(e))!=null&&t.operations.supportsQuery))throw new P("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=$(this._tileFetcher),this._tilesHandle=Be(this._tilesHandle),this._lifeCycleAbortController=le(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,this._tileFetcher!=null&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,this._tileFetcher!=null&&this._tileFetcher.resume())}restart(){const e=()=>{this._tileFetcher!=null&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}_refetch(e){const t=()=>{this._tileFetcher!=null&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const t=We(()=>{var i;return(i=e.featureTiles)==null?void 0:i.tilingScheme},this._lifeCycleAbortController.signal);this._updatingHandles.addPromise(t),t.then(()=>{const{layerView:i,tileDescriptors:r}=this,a=i.layer,l=new F({context:this.context,filterExtent:this.extent,tileDescriptors:r,features:this.graphics});this._tileFetcher=l,this._suspended?this._tileFetcher.suspend():this._tileFetcher.resume();const u=this.layerView.view;u&&this.addHandles(T(()=>u.quality,h=>l.memoryFactor=h,B));const d=this.context.geometryType==="polygon"?"polygonLodFactor":this.context.geometryType==="polyline"?"polylineLodFactor":null;d&&this.addHandles(T(()=>{var h,_,b;return(b=(_=(h=this.layerView.view)==null?void 0:h.qualitySettings)==null?void 0:_.graphics3D)==null?void 0:b[d]},h=>l.lodFactor=h||1,O));const c=h=>{l.maximumNumberOfFeatures=h,l.useTileCount=this.serviceDataCount>h},y=h=>{l.useTileCount=h>this.maximumNumberOfFeatures};a.type!=="ogc-feature"&&this._updatingHandles.add(()=>a.createQueryVersion,()=>this._dataFilterChanged()),this._updatingHandles.add(()=>i.availableFields,(h,_)=>this._availableFieldsChanged(_,h)),this._updatingHandles.add(()=>i.requiredFields,(h,_)=>this._requiredFieldsChanged(_,h)),this.addHandles([a.on("apply-edits",h=>this._applyEdits(h)),T(()=>this.extent,h=>l.filterExtent=h,ue),T(()=>this.tileDescriptors,h=>l.tileDescriptors=h,ue),T(()=>this.maximumNumberOfFeatures,c,B),T(()=>this.serviceDataCount,y,B),T(()=>Gt.FEATURE_TILE_FETCH_SHOW_TILES,h=>{h&&l&&!l.debugger?(l.debugger=new Es(l,u.featureTiles.tilingScheme.toTileInfo(),u),l.debugger.update()):!h&&this._tileFetcher&&l.debugger&&(l.debugger.destroy(),l.debugger=null)},B)]),this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}).catch(()=>{})}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.featureTiles.addClient());break;default:H.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":this._tilesHandle!=null&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this._refetch({resetForceTilesMode:!0})}_applyEdits(e){this._tileFetcher!=null&&this._tileFetcher.applyEdits(e).then(t=>{if(t){if(!this._lifeCycleAbortController)throw qt();t.exceededTransferLimit?this.layerView.layer.refresh():(t.deletedFeatures.length||t.updatedFeatures.length||t.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(t=>{if(!A(t))throw t})}_availableFieldsChanged(e,t){this._tileFetcher!=null&&ze(this._tileFetcher.availableFields,t)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(e,t){this._tileFetcher!=null&&ze(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){var r;const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new zt({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],(r=t.capabilities)!=null&&r.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){var i;const e=this.layerView.layer,t=e.createQuery();return t.returnGeometry=!1,t.outSpatialReference=this.layerView.view.spatialReference,(i=e.capabilities)!=null&&i.query.supportsCacheHint&&(t.cacheHint=!0),t}_fullExtentIsAccurate(){const e=this.layerView.layer;if(e.definitionExpression)return!1;switch(e.type){case"feature":case"oriented-imagery":return Ut(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){A(t)||this._set("serviceDataExtent",be(this.layerView.fullExtentInLocalViewSpatialReference))}}async _tryUpdateServiceDataExtent(e){var c;const t=this.layerView,i=t.layer,r=((c=i.capabilities)==null?void 0:c.query.supportsExtent)??!1,a=be(t.fullExtentInLocalViewSpatialReference),l=i.fullExtent,u=this._fullExtentIsAccurate(),d=this.serviceDataCount;if(r&&d<=S.maxFeatureCountForExtent&&(!a||!u)&&"queryExtent"in i){const y=this._createDataInfoQuery(),h=await i.queryExtent(y,{timeout:S.queryExtentTimeout,signal:e});this._set("serviceDataExtent",h.extent)}else if(a)this._set("serviceDataExtent",a);else if(l!=null){const y="portalItem"in i?i.portalItem:null,h=await jt(l,t.view.spatialReference,y,e);this._set("serviceDataExtent",h)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!xe("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",S.noServiceDataCount);const i=await Ee(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:S.queryStatisticsTimeout,signal:e}));if(i.ok===!0)this._set("serviceDataCount",i.value);else{if(A(i.error))throw i.error;this._set("serviceDataCount",S.noServiceDataCount)}}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return e.capabilities!=null&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateSnapshotLimit(e,t,i){if((e==null?void 0:e.averageSymbolComplexity)==null)return void(this._snapshotLimitExceeded=!1);const{maximumTotalNumberOfVertices:r,averageSymbolComplexity:a}=e,{verticesPerFeature:l,verticesPerCoordinate:u}=a,d=l<=0,c=this._minimumNumberOfVerticesForGeometry>1;if(!d&&!c)return void(this._snapshotLimitExceeded=!1);l!==0&&t!=null&&await t;const y=Math.min(r,ws),h=this.serviceDataCount,_=h!==S.noServiceDataCount;let b=Math.ceil(_?(y-h*l)/(u||1):y/(u||1));if(c&&(b=Math.min(b,Ss)),_&&this._minimumNumberOfVerticesForGeometry*h>b)return void(this._snapshotLimitExceeded=!0);if(!this._supportsExceedsLimitQuery||!xe("featurelayer-snapshot-enabled"))return void(this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>b);const w=await Ee(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(b),{timeout:S.queryStatisticsTimeout,signal:i}));if(w.ok===!1){if(A(w.error))throw w.error;return void(this._snapshotLimitExceeded=!1)}const C=w.value.features[0];this._snapshotLimitExceeded=!!(C!=null&&C.attributes)&&!!C.attributes.exceedslimit}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo();let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=Promise.allSettled([i,this._updateSnapshotLimit(this.displayFeatureLimit,i,t)]),a=r.then(()=>this._updateServiceDataExtent(t)).catch(l=>{A(l)||H.getLogger(this).error("#fetchServiceDataInfo()",l)}).then(()=>{a===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null});return e&&(this._fetchDataInfoPromise=a),this._fetchDataInfoAbortController=e,r.then(()=>{},()=>{})}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){var e,t,i,r;return{storedFeatures:((e=this._tileFetcher)==null?void 0:e.storedFeatures)??0,totalFeatures:((t=this._tileFetcher)==null?void 0:t.totalFeatures)??0,totalVertices:((i=this._tileFetcher)==null?void 0:i.totalVertices)??0,missingTiles:((r=this._tileFetcher)==null?void 0:r.missingTiles)??0}}};n([o({readOnly:!0})],g.prototype,"type",void 0),n([o({constructOnly:!0})],g.prototype,"graphics",void 0),n([o({constructOnly:!0})],g.prototype,"layerView",void 0),n([o({constructOnly:!0})],g.prototype,"context",void 0),n([o()],g.prototype,"extent",null),n([o()],g.prototype,"updating",null),n([o({readOnly:!0})],g.prototype,"_updatingHandles",void 0),n([o()],g.prototype,"updatingTotal",null),n([o()],g.prototype,"updatingRemaining",null),n([o()],g.prototype,"expectedFeatureDiff",null),n([o()],g.prototype,"memoryForUnusedFeatures",null),n([o()],g.prototype,"maximumNumberOfFeaturesExceeded",null),n([o({readOnly:!0})],g.prototype,"serviceDataExtent",void 0),n([o({readOnly:!0})],g.prototype,"serviceDataCount",void 0),n([o()],g.prototype,"_snapshotLimitExceeded",void 0),n([o()],g.prototype,"displayFeatureLimit",void 0),n([o({type:Number})],g.prototype,"maximumNumberOfFeatures",null),n([o()],g.prototype,"_forceTilesMode",void 0),n([o({readOnly:!0})],g.prototype,"mode",null),n([o({readOnly:!0})],g.prototype,"maxTotalSnapshotVertices",null),n([o({readOnly:!0})],g.prototype,"tileDescriptors",null),n([o()],g.prototype,"_tileFetcher",void 0),n([o()],g.prototype,"_fetchDataInfoPromise",void 0),g=n([M("esri.layers.graphics.controllers.FeatureTileController3D")],g);const vs=1e4,ws=1e6,Rs=12e3,Ts=1e4,Ss=5e6;function ze(s,e){if(!e)return!1;for(const t of e)if(!s.has(t))return!0;return!1}var S;(function(s){function e(){s.maxFeatureCountForExtent=vs,s.queryStatisticsTimeout=Rs,s.queryExtentTimeout=Ts}s.noServiceDataCount=1/0,s.maxSnapshotMinScaleFactor=5,s.reset=e})(S||(S={})),S.reset();function Ue(s,e,t){if(!t||e==null)return null;if(!s)return Cs(e,t);const i=s.get(t);return i?e[i.name]:null}function Cs(s,e){const t=e.toLowerCase();for(const i in s)if(i.toLowerCase()===t)return s[i];return null}const Ds=ns;let V=class extends q{get layer(){return this.context.layer}get spatialReference(){return this.context.spatialReference}get _queryGeometryType(){switch(this.layer.geometryType){case"multipoint":case"point":case"polygon":case"polyline":return this.layer.geometryType;case"mesh":return"polygon";default:return}}get defaultQueryJSON(){return new U({outSpatialReference:this.spatialReference}).toJSON()}get _dataQueryEngine(){return this._ensureDataQueryEngine()}constructor(e){super(e),this._dataQueryEngineInstance=null}destroy(){this.clear()}clear(){return!!this._dataQueryEngineInstance&&(this._dataQueryEngineInstance.destroy(),this._dataQueryEngineInstance=null,!0)}async executeQueryForIdSet(e,t,i){return this._dataQueryEngine.executeQueryForIdSet(this._ensureQueryJSON(e,t),i)}async executeQueryForCount(e,t){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),t)}async executeQueryForExtent(e,t){const{count:i,extent:r}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),t);return{count:i,extent:Qt.fromJSON(r)}}async executeQueryForIds(e,t){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),t)}async executeQueryForLatestObservations(e,t){const i=await this._dataQueryEngine.executeQueryForLatestObservations(this._ensureQueryJSON(e),t),r=Ae.fromJSON(i);return r.features.forEach(a=>{a.layer=this.layer,a.sourceLayer=this.layer}),r}async executeQuery(e,t){const i=await this._dataQueryEngine.executeQuery(this._ensureQueryJSON(e),t),r=Ae.fromJSON(i);return r.features.forEach(a=>{a.layer=this.layer,a.sourceLayer=this.layer}),r}_ensureQueryJSON(e,t){let i=this.defaultQueryJSON;if(e!=null&&("outSpatialReference"in e&&!e.outSpatialReference&&(e.outSpatialReference=this.spatialReference),i=e.toJSON()),t!=null){const r=t.geometries.map(a=>a.toJSON()).reduce((a,l)=>(a.rings=a.rings.concat(l.rings),a));i={...i,sceneFilter:{...t,geometry:r}}}return i}_ensureDataQueryEngine(){var h,_;if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e="timeInfo"in this.layer&&((h=this.layer.timeInfo)==null?void 0:h.toJSON())||null,t=this.layer.objectIdField,i=kt.toJSON(this._queryGeometryType),r=((_=this.layer.fieldsIndex)==null?void 0:_.toJSON())||new Bt([]),a=this.priority,l=this.spatialReference.toJSON(),{hasZ:u,hasM:d,featureStore:c,scheduler:y}=this.context;return this._dataQueryEngineInstance=new Ds({hasZ:u,hasM:d,geometryType:i,fieldsIndex:r,timeInfo:e,spatialReference:l,objectIdField:t,featureStore:c,scheduler:y,priority:a}),this._dataQueryEngineInstance}};n([o({constructOnly:!0})],V.prototype,"context",void 0),n([o({constructOnly:!0})],V.prototype,"priority",void 0),n([o()],V.prototype,"layer",null),n([o()],V.prototype,"spatialReference",null),n([o()],V.prototype,"_queryGeometryType",null),n([o()],V.prototype,"defaultQueryJSON",null),V=n([M("esri.views.3d.layers.graphics.QueryEngine")],V);let E=class extends q{constructor(s){super(s),this._updateTask=null,this._frameTask=null,this._queryEngine=null,this._updateRequested=!0,this._updatingHandles=new ee,this._updateVisibility=async e=>{if(this._compositedFeatureFilter==null&&this._sceneFilter==null||this.context.getFeatureCount()===0)return this._frameTask.schedule(()=>this.clear(),e);try{const t=await this._queryEngine.executeQueryForIdSet(this._compositedFeatureFilter,this._sceneFilter,e);return this._frameTask.schedule(()=>{this.context.updateFeatureVisibilities(i=>t.has(i))},e)}catch(t){return Wt(t),H.getLogger(this).warn(`FeatureFilter query failed: ${t}`,{error:t}),this._frameTask.schedule(()=>{this.context.setAllFeaturesVisibility(!0)},e)}}}initialize(){const s=pe.FILTER_VISIBILITY,{layer:e,view:t}=this._layerView,{featureStore:i}=this.context,r="hasZ"in this._layerView&&this._layerView.hasZ,a="hasM"in this._layerView&&this._layerView.hasM;this._queryEngine=new V({context:{spatialReference:t.spatialReference,layer:e,scheduler:t.resourceController.scheduler,featureStore:i,hasM:a,hasZ:r},priority:s}),this._frameTask=this._layerView.view.resourceController.scheduler.registerTask(s,this),this._updatingHandles.add(()=>[this._compositedFeatureFilter,this._sceneFilter],()=>this.reapply(),O)}destroy(){this._updateRequested=!1,this._updatingHandles.destroy(),this.clear(),this._updateTask=le(this._updateTask),this._frameTask=Be(this._frameTask),this._queryEngine=$(this._queryEngine),this._set("context",null)}get updating(){return this.running||this._updatingHandles.updating||this._updateTask!=null&&!this._updateTask.finished}get running(){return this._updateRequested||this._frameTask.updating}get defaultVisibility(){return this._compositedFeatureFilter==null&&this._sceneFilter==null}get _featureFilter(){return"filter"in this._layerView?this._layerView.filter:null}get _sceneFilter(){return"layerFilter"in this._layerView?this._layerView.layerFilter:null}get _floorFilter(){return Jt(this._layerView)}get _timeExtent(){return"timeExtent"in this._layerView?this._layerView.timeExtent:null}get _compositedFeatureFilter(){const{_featureFilter:s,_timeExtent:e,_floorFilter:t}=this;if(e==null&&t==null)return s;const i=s!=null?s.clone():new Zt;if(e!=null&&(i.timeExtent=i.timeExtent!=null?i.timeExtent.intersection(e):e),t!=null){const r=i.where==null||i.where==="";i.where=r?t:`(${i.where}) AND (${t})`}return i}get _layerView(){return this.context.layerView}reapply(){this._updateRequested=!0}clear(){this._queryEngine.clear(),this.context.clearFeaturesVisibility()}runTask(s){this._updateRequested&&(this._updateTask=le(this._updateTask),this._updateTask=Yt(this._updateVisibility),this._updateRequested=!1,s.madeProgress()),this._frameTask.processQueue(s)}};n([o({constructOnly:!0})],E.prototype,"context",void 0),n([o()],E.prototype,"updating",null),n([o()],E.prototype,"running",null),n([o()],E.prototype,"defaultVisibility",null),n([o()],E.prototype,"_featureFilter",null),n([o()],E.prototype,"_sceneFilter",null),n([o()],E.prototype,"_floorFilter",null),n([o()],E.prototype,"_timeExtent",null),n([o()],E.prototype,"_compositedFeatureFilter",null),n([o()],E.prototype,"_layerView",null),n([o()],E.prototype,"_updateTask",void 0),n([o()],E.prototype,"_updateRequested",void 0),E=n([M("esri.views.3d.layers.support.FeatureVisibilityFilter")],E);let m=class extends q{constructor(s){super(s),this.type="graphics-3d",this._randomRotationRenderers=null,this._updatingHandles=new ee,this.elevationFeatureExpressionEnabled=!1,this.scaleVisibilityEnabled=!1,this.filterVisibilityEnabled=!1,this.frustumVisibilityEnabled=!1,this.elevationAlignmentEnabled=!1,this.timeExtentEnabled=!1,this.setUidToIdOnAdd=!0,this.dataExtent=null,this.drapeSourceType=Je.Features,this.preferredUpdatePolicy=ye.ASYNC,this._suspendResumeExtent=null}initialize(){const s=this.owner,e=(this.filterVisibilityEnabled||this.timeExtentEnabled)&&s.layer.geometryType!=="multipatch",t=new ts({owner:this,layer:this.layer,preferredUpdatePolicy:this.preferredUpdatePolicy,elevationFeatureExpressionEnabled:this.elevationFeatureExpressionEnabled,graphicSymbolSupported:!1,hasZ:s.hasZ,hasM:s.hasM,setUidToIdOnAdd:this.setUidToIdOnAdd,componentFactories:{deconflictor:i=>s.view.deconflictor.addGraphicsOwner(i),labeler:(i,r)=>s.view.labeler.addGraphicsOwner(i,r),elevationAlignment:this.elevationAlignmentEnabled?(i,r)=>new is({graphicsCoreOwner:this,graphicsCore:i,queryGraphicUIDsInExtent:r,elevationProvider:s.view.elevationProvider}):null,scaleVisibility:this.scaleVisibilityEnabled?(i,r)=>new ss({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:r,graphicsCore:i,basemapTerrain:s.view.basemapTerrain}):null,filterVisibility:e?i=>new E({context:{layerView:s,...i}}):null,objectStates:i=>new rs(i)}});this._set("graphicsCore",t),this.frustumVisibilityEnabled&&this._set("frustumVisibility",new as({graphicsCoreOwner:this})),this.elevationAlignment&&this._updatingHandles.add(()=>this.layer.elevationInfo,(i,r)=>{ve(i,r)&&this._updatingHandles.addPromise(this.graphicsCore.elevationInfoChange())}),this._updatingHandles.add(()=>this.layer.labelsVisible,()=>this.graphicsCore.updateVisibilityInfo()),this._updatingHandles.add(()=>this.layer.labelingInfo,(i,r)=>{ve(i,r)&&this.graphicsCore.updateLabelingInfo()}),this._updatingHandles.add(()=>this.preferredUpdatePolicy,i=>this.graphicsCore.preferredUpdatePolicy=i),this._set("initializePromise",this._initializeAsync()),this._updatingHandles.addPromise(this.initializePromise)}async _initializeAsync(){await we(this.graphicsCore.initializePromise);const s=this.owner;this._updatingHandles.add(()=>this.renderer,e=>this._updatingHandles.addPromise(this.graphicsCore.rendererChange(e))),this._updatingHandles.add(()=>s.fullOpacity,()=>this.graphicsCore.opacityChange()),this._setupSuspendResumeExtent(),this.updateClippingExtent&&(this._updatingHandles.add(()=>s.view.clippingArea,()=>this._updateClippingExtent()),this._updateClippingExtent()),this.graphicsCore.startCreateGraphics(),this.graphicsCore.labelsEnabled&&await we(this.graphicsCore.updateLabelingInfo())}destroy(){this._updatingHandles.destroy(),this._set("frustumVisibility",$(this.frustumVisibility)),this._set("graphicsCore",$(this.graphicsCore)),this._set("owner",null)}get layer(){return this.owner.layer}get renderer(){const{renderer:s,objectIdField:e}=this.layer;if(!s||!e||s.type==="heatmap"||!s.visualVariables)return s;const t=s.visualVariables.findIndex(r=>r.type==="rotation"&&r.valueExpression!=null&&Xt(r.valueExpression)===e&&(r.axis==null||r.axis==="heading")&&r.rotationType==="geographic");if(t<0)return s;const i=s.clone();return i.visualVariables.splice(t,1),this._randomRotationRenderers||(this._randomRotationRenderers=new WeakMap),this._randomRotationRenderers.set(i,e),i}get scaleVisibility(){var s;return(s=this.graphicsCore)==null?void 0:s.scaleVisibility}get filterVisibility(){var s;return(s=this.graphicsCore)==null?void 0:s.filterVisibility}get elevationAlignment(){var s;return(s=this.graphicsCore)==null?void 0:s.elevationAlignment}get objectStates(){var s;return(s=this.graphicsCore)==null?void 0:s.objectStates}get suspendResumeExtentMode(){return"suspendResumeExtentMode"in this.owner?this.owner.suspendResumeExtentMode:"computed"}get scaleVisibilitySuspended(){return this.scaleVisibility!=null&&this.scaleVisibility.suspended}get suspended(){return this.owner.suspended}get legendEnabled(){return this.frustumVisibility==null||!this.frustumVisibility.suspended}get suspendInfo(){const s={};return this.scaleVisibilitySuspended&&(s.outsideScaleRange=!0),this.frustumVisibility!=null&&this.frustumVisibility.suspended&&(s.outsideOfView=!0),s}get updating(){var s,e;return!!((s=this.graphicsCore)!=null&&s.updating||(e=this.frustumVisibility)!=null&&e.updating||this._updatingHandles.updating)}get updatingRemaining(){var s;return((s=this.graphicsCore)==null?void 0:s.updatingRemaining)??0}get featureStore(){var s;return(s=this.graphicsCore)==null?void 0:s.featureStore}get view(){return this.owner.view}get loadedGraphics(){return this.owner.loadedGraphics}get fullOpacity(){var s;return(s=this.owner)==null?void 0:s.fullOpacity}get filter(){return"filter"in this.owner?this.owner.filter:null}get slicePlaneEnabled(){return this.owner.slicePlaneEnabled}get updatePolicy(){return this.owner.updatePolicy}get featureSpatialReference(){return"featureSpatialReference"in this.owner?this.owner.featureSpatialReference:this.owner.view.spatialReference}get graphics3DGraphics(){var s;return(s=this.graphicsCore)==null?void 0:s.graphics3DGraphics}get graphics3DGraphicsByObjectID(){var s;return(s=this.graphicsCore)==null?void 0:s.graphics3DGraphicsByObjectID}get symbolUpdateType(){var s;return(s=this.graphicsCore)==null?void 0:s.symbolUpdateType}get displayFeatureLimit(){var i;const s=this.view.quality,e=(i=this.graphicsCore)==null?void 0:i.displayFeatureLimit;if(s===1)return e;const t=Math.ceil(e.maximumNumberOfFeatures*s);return new nt(e.maximumTotalNumberOfVertices,t,e.averageSymbolComplexity)}get usedMemory(){var s;return((s=this.graphicsCore)==null?void 0:s.usedMemory)??0}get loadedFeatures(){var s;return((s=this.graphicsCore)==null?void 0:s.numberOfGraphics)??0}get usedMemoryPerFeature(){var s;return((s=this.graphicsCore)==null?void 0:s.usedMemoryPerGraphic)??0}get unprocessedMemoryEstimate(){var s;return((s=this.graphicsCore)==null?void 0:s.unprocessedMemoryEstimate)??0}get performanceInfo(){return{core:this.graphicsCore.performanceInfo,elevationUpdating:this.elevationAlignment.updating,visibilityFrustum:this.frustumVisibility==null||!this.frustumVisibility.suspended,visibilityScale:!this.scaleVisibilitySuspended}}maskOccludee(s){const{set:e,handle:t}=this.objectStates.acquireSet(W.MaskOccludee,null);return this.objectStates.setUid(e,s.uid),t}highlight(s,e){if(s instanceof U){const{set:t,handle:i}=this.objectStates.acquireSet(W.Highlight,e);return this.owner.queryObjectIds(s).then(r=>this.objectStates.setObjectIds(t,r)),i}if(typeof s=="number"||typeof s=="string")return this.highlight([s],e);if(s instanceof z)return this.highlight([s],e);if("toArray"in s&&(s=s.toArray()),Array.isArray(s)&&s.length>0){if(s[0]instanceof z){const t=s;if(Ue(this.layer.fieldsIndex,t[0].attributes,e)==null){const i=t.map(l=>l.uid),{set:r,handle:a}=this.objectStates.acquireSet(W.Highlight,null);return this.objectStates.setUids(r,i),a}s=t.map(i=>Ue(this.layer.fieldsIndex,i.attributes,e))}if(Array.isArray(s)&&(typeof s[0]=="number"||typeof s[0]=="string")){const t=s,{set:i,handle:r}=this.objectStates.acquireSet(W.Highlight,e);return this.objectStates.setObjectIds(i,t),r}}return X()}resetObjectStates(){this.objectStates.reset()}whenGraphicBounds(s,e){var t;return(t=this.graphicsCore)==null?void 0:t.whenGraphicBounds(s,e)}computeAttachmentOrigin(s,e){var t;return(t=this.graphicsCore)==null?void 0:t.computeAttachmentOrigin(s,e)}notifyGraphicGeometryChanged(s){this.graphicsCore.notifyGraphicGeometryChanged(s)}notifyGraphicVisibilityChanged(s){this.graphicsCore.notifyGraphicVisibilityChanged(s)}getRenderingInfo(s,e,t){var r;const i=Kt(s,{renderer:e,arcade:t});if(i!=null&&i.color){const a=i.color;a[0]=a[0]/255,a[1]=a[1]/255,a[2]=a[2]/255}if(i!=null&&e!=null&&((r=this._randomRotationRenderers)!=null&&r.has(e))){const a=this._randomRotationRenderers.get(e),l=s.attributes[a],u=new es(0);u.updateFloatArray([l]),u.updateUint8Array([173]),i.heading=8381e-11*u.digest()}return i}getRenderingInfoAsync(s,e,t,i){return ei(s,{renderer:e,arcade:t,...i})}getSymbolLayerSize(s,e){var t;return(t=this.graphicsCore)==null?void 0:t.getSymbolLayerSize(s,e)}setObjectIdVisibility(s,e){var t;(t=this.graphicsCore)==null||t.setObjectIdVisibility(s,e)}refreshFilter(){this.filterVisibility!=null&&this.filterVisibility.reapply()}getGraphics3DGraphicByObjectId(s){var e;return(e=this.graphicsCore)==null?void 0:e.getGraphics3DGraphicByObjectId(s)}_updateClippingExtent(){const s=this.owner.view.clippingArea;this.graphicsCore.setClippingExtent(s,this.owner.view.spatialReference)&&(this.updateClippingExtent(s)||this.graphicsCore.recreateAllGraphics())}_setupSuspendResumeExtent(){(this.frustumVisibility||this.scaleVisibility)&&this.addHandles(T(()=>this.suspendResumeExtentMode,()=>{switch(this.removeHandles(ae),this.suspendResumeExtentMode){case"computed":this.addHandles([T(()=>this.graphicsCore.computedExtent,s=>this._updateSuspendResumeExtent(s),O),T(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.graphicsCore.computedExtent))],ae);break;case"data":this.addHandles([ii(()=>this.dataExtent,s=>this._updateSuspendResumeExtent(s),O),T(()=>this.graphicsCore.extentPadding,()=>this._updateSuspendResumeExtent(this.dataExtent))],ae);break;default:ti(this.suspendResumeExtentMode)}},O))}_updateSuspendResumeExtent(s){s?this._suspendResumeExtentChanged(this._extentToSuspendResumeRect(s,this._suspendResumeExtent)):this._suspendResumeExtentChanged(null)}_extentToSuspendResumeRect(s,e){const t=this.owner.view.spatialReference;if(!s.spatialReference.equals(t)){if(!si(s,t))return;s=ri(s,t)}return ai(s,e,ni,this.graphicsCore.extentPadding)}_suspendResumeExtentChanged(s){this.frustumVisibility!=null&&this.frustumVisibility.setExtent(s),this.scaleVisibility!=null&&this.scaleVisibility.setExtent(s)}};n([o()],m.prototype,"type",void 0),n([o({constructOnly:!0})],m.prototype,"owner",void 0),n([o()],m.prototype,"layer",null),n([o()],m.prototype,"renderer",null),n([o({constructOnly:!0})],m.prototype,"updateClippingExtent",void 0),n([o({constructOnly:!0})],m.prototype,"elevationFeatureExpressionEnabled",void 0),n([o({constructOnly:!0})],m.prototype,"graphicsCore",void 0),n([o({constructOnly:!0})],m.prototype,"scaleVisibilityEnabled",void 0),n([o({constructOnly:!0})],m.prototype,"filterVisibilityEnabled",void 0),n([o({constructOnly:!0})],m.prototype,"frustumVisibilityEnabled",void 0),n([o({constructOnly:!0})],m.prototype,"elevationAlignmentEnabled",void 0),n([o({constructOnly:!0})],m.prototype,"timeExtentEnabled",void 0),n([o({constructOnly:!0})],m.prototype,"setUidToIdOnAdd",void 0),n([o()],m.prototype,"scaleVisibility",null),n([o()],m.prototype,"filterVisibility",null),n([o()],m.prototype,"elevationAlignment",null),n([o({constructOnly:!0})],m.prototype,"frustumVisibility",void 0),n([o()],m.prototype,"objectStates",null),n([o()],m.prototype,"initializePromise",void 0),n([o()],m.prototype,"suspendResumeExtentMode",null),n([o()],m.prototype,"dataExtent",void 0),n([o()],m.prototype,"scaleVisibilitySuspended",null),n([o()],m.prototype,"suspended",null),n([o()],m.prototype,"legendEnabled",null),n([o()],m.prototype,"suspendInfo",null),n([o()],m.prototype,"updating",null),n([o()],m.prototype,"updatingRemaining",null),n([o()],m.prototype,"featureStore",null),n([o()],m.prototype,"view",null),n([o()],m.prototype,"loadedGraphics",null),n([o()],m.prototype,"fullOpacity",null),n([o()],m.prototype,"filter",null),n([o()],m.prototype,"slicePlaneEnabled",null),n([o()],m.prototype,"drapeSourceType",void 0),n([o()],m.prototype,"updatePolicy",null),n([o()],m.prototype,"preferredUpdatePolicy",void 0),n([o({readOnly:!0})],m.prototype,"displayFeatureLimit",null),m=n([M("esri.views.3d.layers.graphics.Graphics3DFeatureProcessor")],m);const ae="suspendResumeExtentMode";function ut(s){const e=new Ze;e.include(oi),e.include(li);const{usesHalfFloat:t}=s;return e.fragment.uniforms.add(new Re("densityMap",i=>i.densityMap),new Re("tex",i=>i.colorRamp),new K("densityNormalizer",i=>1/(i.maxDensity-i.minDensity)),new K("minDensity",i=>i.minDensity),new K("densityMultiplier",i=>3/(i.searchRadius*i.searchRadius*Math.PI))),t&&e.constants.add("compressionFactor","float",4),e.fragment.code.add(N` + void main() { + float density = texture(densityMap, uv).r * densityMultiplier${t?N` * compressionFactor`:""}; + float densityRatio = (density - minDensity) * densityNormalizer; + + vec4 color = texture(tex, vec2(clamp(densityRatio, 0.0, 1.0), 0.5)); + + discardOrAdjustAlpha(color); + fragColor = color; + } + `),e}const Os=Object.freeze(Object.defineProperty({__proto__:null,build:ut},Symbol.toStringTag,{value:"Module"}));let Vs=class extends di{constructor(){super(...arguments),this.colorRamp=null,this.densityMap=null,this.searchRadius=1,this.fieldTotal=0,this.minDensity=0,this.maxDensity=100}},ht=class dt extends Ke{constructor(e,t){super(e,t,()=>this.destroy())}initializeProgram(e){return new et(e.rctx,dt.shader.get().build(this.configuration),tt)}initializePipeline(){return it({blending:ui,colorWrite:st,depthTest:null,depthWrite:null})}get primitiveType(){return hi.TRIANGLE_STRIP}};ht.shader=new Ye(Os,()=>Xe(()=>Promise.resolve().then(()=>qs),void 0));let ct=class extends rt{constructor(){super(...arguments),this.usesHalfFloat=!1}};n([he()],ct.prototype,"usesHalfFloat",void 0);let R=class extends ci{constructor(s){super(s),this.pixelRatio=1,this._colorRampData=new Uint8ClampedArray(4),this.type="draped-heatmap",this._heatmapParameters=new Vs;const e=new Te;e.pixelFormat=s.pixelFormat,e.internalFormat=s.internalFormat,e.dataType=s.dataType,e.samplingMode=s.samplingMode,e.wrapMode=Se.CLAMP_TO_EDGE;const t=s.rendererContext.rctx;this._densityMap=new pi(t,e),this._quad=yi(t);const i=new ct;i.usesHalfFloat=s.dataType!==G.FLOAT,this._technique=new ht({rctx:t,viewingMode:ke.Local},i)}initialize(){const s=this._colorRampData,e=new Te(s.length/4,1);e.wrapMode=Se.CLAMP_TO_EDGE,this._colorRamp=new mi(this.rctx,e,s),this._heatmapParameters.densityMap=this._densityMap.colorTexture,this.addHandles(T(()=>[this.colorRampData,this.minDensity,this.maxDensity,this.fieldTotal,this.pixelRatio,this.searchRadius],()=>this.rendererContext.notifyContentChanged()))}destroy(){this._technique=_i(this._technique),this._densityMap=ie(this._densityMap),this._quad=ie(this._quad),this._colorRamp=ie(this._colorRamp)}get searchRadius(){return this._heatmapParameters.searchRadius}set searchRadius(s){s!==this._heatmapParameters.searchRadius&&(this._heatmapParameters.searchRadius=s,this.notifyChange("searchRadius"))}get minDensity(){return this._heatmapParameters.minDensity}set minDensity(s){s!==this._heatmapParameters.minDensity&&(this._heatmapParameters.minDensity=s,this.notifyChange("minDensity"))}get maxDensity(){return this._heatmapParameters.maxDensity}set maxDensity(s){s!==this._heatmapParameters.maxDensity&&(this._heatmapParameters.maxDensity=s,this.notifyChange("maxDensity"))}get fieldTotal(){return this._heatmapParameters.fieldTotal}set fieldTotal(s){this._heatmapParameters.fieldTotal=s,this.notifyChange("fieldTotal")}get colorRampData(){return this._colorRampData}set colorRampData(s){const{colorRamp:e}=this._heatmapParameters;if(e!=null&&s!==this._colorRampData){const t=e.descriptor.width,i=s.length/4;i!==t&&e.resize(i,1),e.setData(s)}this._colorRampData=s}get _colorRamp(){return this._heatmapParameters.colorRamp}set _colorRamp(s){this._heatmapParameters.colorRamp=s}get hasHighlights(){return!1}get hasWater(){return!1}get rendersOccluded(){return!1}render(s){const e=this._sortedMaterialRenderers;if(e.length===0)return;const t=this.rctx.getBoundFramebufferObject(),i=this.rctx.getViewport(),{pixelRatio:r}=this,a=Math.ceil(i.width*r),l=Math.ceil(i.height*r);this._densityMap.resize(a,l),this.rctx.bindFramebuffer(this._densityMap),this.rctx.setViewport(0,0,a,l),this.rctx.clear(fi.COLOR_BUFFER_BIT);let u=!1;e.forAll(d=>{const c=d.prepareTechnique(s);c!=null&&(d.renderNode(s,c),u=!0)}),this.rctx.bindFramebuffer(t),this.rctx.setViewport(i.x,i.y,i.width,i.height),u&&(this.rctx.bindVAO(this._quad),this.rctx.bindTechnique(this._technique,this._heatmapParameters,s.bindParameters),this.rctx.drawArrays(this._technique.primitiveType,0,gi(this._quad,"geometry")))}};n([o()],R.prototype,"searchRadius",null),n([o()],R.prototype,"minDensity",null),n([o()],R.prototype,"maxDensity",null),n([o()],R.prototype,"fieldTotal",null),n([o()],R.prototype,"pixelRatio",void 0),n([o()],R.prototype,"colorRampData",null),n([o({constructOnly:!0})],R.prototype,"dataType",void 0),n([o({constructOnly:!0})],R.prototype,"samplingMode",void 0),n([o({constructOnly:!0})],R.prototype,"pixelFormat",void 0),n([o({constructOnly:!0})],R.prototype,"internalFormat",void 0),n([o()],R.prototype,"_colorRampData",void 0),R=n([M("esri.views.3d.webgl-engine.lib.DrapedHeatmapRenderer")],R);function pt(s){const e=new Ze,{vertex:t,fragment:i,attributes:r,varyings:a}=e;Fi(t,s);const{isAttributeDriven:l,usesHalfFloat:u}=s;return r.add(v.POSITION,"vec3"),r.add(v.UV0,"vec2"),l&&(r.add(v.FEATUREATTRIBUTE,"float"),a.add("attributeValue","float")),u&&e.constants.add("compressionFactor","float",.25),a.add("unitCirclePos","vec2"),t.uniforms.add(new K("radius",({resolutionForScale:d,searchRadius:c},{camera:y,screenToWorldRatio:h,overlayStretch:_})=>2*c*(d===0?1:d/h)*y.pixelRatio/y.fullViewport[2]/_)),t.code.add(N` + void main() { + unitCirclePos = uv0; + + vec4 posProj = proj * (view * vec4(${v.POSITION}, 1.0)); + vec4 quadOffset = vec4(unitCirclePos * radius, 0.0, 0.0); + + ${l?N`attributeValue = ${v.FEATUREATTRIBUTE};`:""} + gl_Position = posProj + quadOffset; + } + `),i.code.add(N` + void main() { + float radiusRatioSquared = dot(unitCirclePos, unitCirclePos); + if (radiusRatioSquared > 1.0) { + discard; + } + + float oneMinusRadiusRatioSquared = 1.0 - radiusRatioSquared; + float density = oneMinusRadiusRatioSquared * oneMinusRadiusRatioSquared ${l?N` * attributeValue`:""} ${u?N` * compressionFactor`:""}; + fragColor = vec4(density); + } + `),e}const Is=Object.freeze(Object.defineProperty({__proto__:null,build:pt},Symbol.toStringTag,{value:"Module"}));let Ps=class extends Ei{constructor(){super(...arguments),this.searchRadius=128,this.resolutionForScale=0}};class te extends Ke{initializeProgram(e){return new et(e.rctx,te.shader.get().build(this.configuration),tt)}initializePipeline(){return it({blending:bi(Ce.ONE,Ce.ONE,xi.ADD),colorWrite:st,depthTest:null,depthWrite:null})}destroy(){super.destroy()}}te.shader=new Ye(Is,()=>Xe(()=>Promise.resolve().then(()=>zs),void 0));let de=class extends rt{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloat=!1}};n([he()],de.prototype,"isAttributeDriven",void 0),n([he()],de.prototype,"usesHalfFloat",void 0);const $s=2;class Ms extends Ps{constructor(){super(...arguments),this.isAttributeDriven=!1,this.usesHalfFloats=!1}}class je extends wi{constructor(e){super(e,new Ms),this._configuration=new de}produces(e,t){return e===Ri.DRAPED_MATERIAL&&t===Ti.Color}getConfiguration(){return this._configuration.isAttributeDriven=this.parameters.isAttributeDriven,this._configuration.usesHalfFloat=this.parameters.usesHalfFloats,this._configuration}createGLMaterial(e){return new As(e)}intersect(){}intersectDraped(e,t,i,r,a,l){const u=e.attributes.get(v.POSITION),{parameters:d}=this,{searchRadius:c}=d,{screenToWorldRatio:y}=e,h=c*y+$s*y,_=h*h,b=u.data.length/u.size;for(let w=0;wthis._loadedPointGraphics.length,setAllFeaturesVisibility:a=>this._setAllFeaturesVisibility(a),clearFeaturesVisibility:()=>this._setAllFeaturesVisibility(!0),updateFeatureVisibilities:a=>this._updateFeatureVisibilities(a)}}),this._updatingHandles.addOnCollectionChange(()=>this._loadedPointGraphics,a=>this._onLoadedFeaturesChange(a),O),this._updatingHandles.addWhen(()=>this._materialParameters,a=>this._forEachMaterial(l=>l.setParameters(a)),O),this._updatingHandles.add(()=>this._rendererParameters,a=>this._drapeSourceRenderer.set(a)),this._updatingHandles.add(()=>this._heatmapRendererField,()=>{this._recreate()},ue),this._updatingHandles.add(()=>({fieldName:this._heatmapRendererFieldName,numeric:this._heatmapRendererFieldIsNumeric}),({fieldName:a,numeric:l})=>{if(a!=null&&l){let u=0;this._featureStore.forEach(d=>u+=d.attributes[a]??0),this._fieldTotal=u}else this._fieldTotal=this._featureStore.numFeatures},O),this.addHandles([T(()=>({fieldName:this._heatmapRendererFieldName,field:this._heatmapRendererField}),({fieldName:a,field:l})=>{a&&!l&&Y.warn(`Heatmap renderer field '${a}' for layer '${this.layer.title??this.layer.id}' not found`)}),T(()=>({field:this._heatmapRendererField,numeric:this._heatmapRendererFieldIsNumeric}),({field:a,numeric:l})=>{a==null||l||Y.warn(`Heatmap renderer field '${a.name}' for layer '${this.layer.title??this.layer.id}' does not contain numeric values and cannot be used to drive the heatmap density`)}),X(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this))])}destroy(){this._renderGeometries.clear(),this._material=null,this._materialWithField=null,this._featureStore.clear(),this._featureStore=null,this._updatingHandles.destroy()}get layer(){return this.owner.layer}get featureStore(){return this._featureStore}get updating(){return this._updatingHandles.updating||this.filterVisibility.updating}get updatingRemaining(){return 0}get suspendInfo(){return{}}get legendEnabled(){return!0}get filterVisibility(){return this._filterVisibility}get displayFeatureLimit(){var i,r,a,l;const s=((r=(i=this.owner)==null?void 0:i.view)==null?void 0:r.quality)??1,e=(l=(a=this.owner)==null?void 0:a.view)==null?void 0:l.qualitySettings,t=e?Math.ceil(e.heatmap.maxTotalNumberOfFeatures*s):0;return new nt(t*6,t)}get hasZ(){return"hasZ"in this.layer&&this.layer.hasZ}get hasM(){return"hasM"in this.layer&&this.layer.hasM}get view(){return this.owner.view}get fullOpacity(){return this.owner.fullOpacity}get updatePolicy(){return this.owner.updatePolicy}get scaleVisibilitySuspended(){if(!this._isScaleRangeActive)return!1;const{minScale:s,maxScale:e}=this.layer.effectiveScaleRange,{scale:t}=this.view;return!Pi(t,s??0,e??0)}get usedMemory(){var r,a;const s=this.usedMemoryPerFeature*this._featureStore.numFeatures,e=this._pixelFormat===I.RED?1:4,t=this._dataType===G.FLOAT?4:2,i=Math.ceil((((a=(r=this._overlayRenderer)==null?void 0:r.overlays[0])==null?void 0:a.resolution)??0)*this._densityMapPixelRatio)??0;return i*i*e*t+s}get usedMemoryPerFeature(){const s=this._loadedPointGraphics.find(()=>!0);if(s==null)return 0;const e=$i(s),t=Wi(),i=6;return i*Oe([0,0,0],t)+i*Oe([0,0],t)+(this._heatmapRendererFieldIsNumeric?i*t:0)+e}get loadedFeatures(){return this._featureStore.numFeatures}get unprocessedMemoryEstimate(){return 0}get performanceInfo(){return{core:{visible:this._visibleFeatures,missing:0,pending:0},elevationUpdating:!1,visibilityFrustum:!0,visibilityScale:!0}}get renderer(){return this._heatmapRenderer}get _overlayRenderer(){return this.view.basemapTerrain.overlayManager.renderer}get _overlaySpatialReference(){return this._overlayRenderer.spatialReference}get _rendererParameters(){return{...this._radiusParameter,...this._densityParameters,...this._colorRampParameter,...this._pixelRatioParameter}}get _materialParameters(){return{...this._radiusParameter,...this._resolutionForScaleParameter}}get _densityParameters(){const s=this._heatmapRenderer;if(s==null)return null;const{minDensity:e,maxDensity:t}=s;return{minDensity:e,maxDensity:t,fieldTotal:this._fieldTotal}}get _radiusParameter(){const s=this._heatmapRenderer;return s?{searchRadius:Mi(this._clampSearchRadius(s.radius))}:null}get _resolutionForScaleParameter(){const s=this._heatmapRenderer;if(!s)return null;const{referenceScale:e}=s;return{resolutionForScale:e===0?0:Ai(e,this.view.spatialReference)}}get _colorRampParameter(){const s=this._heatmapRenderer;return s?{colorRampData:Li(s.colorStops)}:null}get _pixelRatioParameter(){return{pixelRatio:this._densityMapPixelRatio}}get _densityMapPixelRatio(){var s,e;return((e=(s=this.owner)==null?void 0:s.view)==null?void 0:e.qualitySettings.heatmap.pixelRatio)??1}get _renderView(){return this.view._stage.renderView}get _featuresArePoints(){return this.layer.geometryType==="point"}get _loadedPointGraphics(){return this.owner.loadedGraphics}get _heatmapRenderer(){const s=this.layer.renderer;return(s==null?void 0:s.type)==="heatmap"?s:null}get _heatmapRendererFieldName(){var s;return(s=this._heatmapRenderer)==null?void 0:s.field}get _heatmapRendererField(){const s=this._heatmapRendererFieldName;return s!=null?this.layer.fieldsIndex.get(s):null}get _heatmapRendererFieldIsNumeric(){const s=this._heatmapRendererField;return s!=null&&Ni(s)}get _isScaleRangeActive(){const{layer:s}=this;if(!("effectiveScaleRange"in s))return!1;const{minScale:e,maxScale:t}=s.effectiveScaleRange;return Hi(e,t)}get _visibleFeatures(){let s=0;return this._renderGeometries.forEach(e=>{e.visible&&++s}),s}async whenGraphicBounds(){return null}computeAttachmentOrigin(){return null}highlight(){return X()}maskOccludee(){return X()}setObjectIdVisibility(){}refreshFilter(){this.filterVisibility.reapply()}_onLoadedFeaturesChange(s){if(!this._featuresArePoints)return;const{objectIdField:e}=this.layer;this._featureStore.removeManyById(s.removed.map(l=>D(l,e))),this._featureStore.addMany(s.added.map(l=>{const{attributes:u,centroid:d,geometry:c}=l,y=new Gi(Ve(new Me,c),u,d?Ve(new Me,d):null,D(l,e));return y.displayId=l.uid,y}));const t=s.added,i=s.removed;this._fieldTotal+=this._computeFieldTotalChange(t,i);const r=i.map(({uid:l})=>{const u=this._renderGeometries.get(l);return this._renderGeometries.delete(l),u}).filter(qi),a=t.map(l=>{const u=this._pointGraphicToRenderGeometry(l);return this._renderGeometries.set(l.uid,u),u});r.length>0&&this._drapeSourceRenderer.removeGeometries(r,Ie.REMOVE),a.length>0&&this._drapeSourceRenderer.addGeometries(a,Ie.ADD),(a.length>0||r.length>0)&&(this.filterVisibility.reapply(),this._renderView.requestRender())}_recreate(){if(!this._loadedPointGraphics)return;const s=this._loadedPointGraphics.toArray();this._onLoadedFeaturesChange({added:s,removed:s})}_pointGraphicToRenderGeometry(s){const e=this._heatmapRendererFieldName,t=e!=null?this._materialWithField:this._material,i=Ji();zi(s.geometry,i,this._overlaySpatialReference),i[2]=Ui;const r=ji(1),a=[[v.POSITION,new Pe(i,r,i.length)]],l=this._heatmapRendererFieldIsNumeric;e!=null&&a.push([v.FEATUREATTRIBUTE,new Pe([l?s.attributes[e]??0:0],r,1)]);const u=new Qi(new ki(t,a,null,Bi.Point),{layerUid:this.layer.uid,graphicUid:s.uid});return u.visible=this.filterVisibility.defaultVisibility,u}_forEachMaterial(s){s(this._material),s(this._materialWithField)}_computeFieldTotalChange(s,e){if(this._heatmapRendererFieldName==null||!this._heatmapRendererFieldIsNumeric)return s.length-e.length;const t=this._heatmapRendererFieldName,i=(r,a)=>r+(a.attributes[t]??0);return s.reduce(i,0)-e.reduce(i,0)}_clampSearchRadius(s){return s>oe&&Y.warnOnce(`SceneView supports a maximum radius of ${oe} pt for HeatmapRenderer.`),Math.min(s,oe)}_updateFeatureVisibilities(s){const e=[];this._featureStore.forEach(({objectId:t,displayId:i})=>{const r=s(t),a=this._renderGeometries.get(i);a&&a.visible!==r&&(e.push(a),a.visible=r)}),this._drapeSourceRenderer.modifyGeometries(e,$e.VISIBILITY)}_setAllFeaturesVisibility(s){const e=[];for(const t of this._renderGeometries.values())t.visible!==s&&(e.push(t),t.visible=s);this._drapeSourceRenderer.modifyGeometries(e,$e.VISIBILITY)}get test(){return{visibleFeatureCount:this._visibleFeatures}}};n([o()],p.prototype,"type",void 0),n([o({constructOnly:!0})],p.prototype,"owner",void 0),n([o()],p.prototype,"layer",null),n([o()],p.prototype,"featureStore",null),n([o()],p.prototype,"updating",null),n([o()],p.prototype,"updatingRemaining",null),n([o()],p.prototype,"suspendInfo",null),n([o()],p.prototype,"legendEnabled",null),n([o()],p.prototype,"filterVisibility",null),n([o()],p.prototype,"displayFeatureLimit",null),n([o()],p.prototype,"preferredUpdatePolicy",void 0),n([o()],p.prototype,"hasZ",null),n([o()],p.prototype,"hasM",null),n([o()],p.prototype,"dataExtent",void 0),n([o()],p.prototype,"view",null),n([o()],p.prototype,"fullOpacity",null),n([o()],p.prototype,"updatePolicy",null),n([o()],p.prototype,"drapeSourceType",void 0),n([o()],p.prototype,"scaleVisibilitySuspended",null),n([o()],p.prototype,"renderer",null),n([o()],p.prototype,"_featureStore",void 0),n([o()],p.prototype,"_filterVisibility",void 0),n([o()],p.prototype,"_overlayRenderer",null),n([o()],p.prototype,"_overlaySpatialReference",null),n([o()],p.prototype,"_rendererParameters",null),n([o()],p.prototype,"_materialParameters",null),n([o()],p.prototype,"_densityParameters",null),n([o()],p.prototype,"_radiusParameter",null),n([o()],p.prototype,"_resolutionForScaleParameter",null),n([o()],p.prototype,"_colorRampParameter",null),n([o()],p.prototype,"_pixelRatioParameter",null),n([o()],p.prototype,"_densityMapPixelRatio",null),n([o()],p.prototype,"_renderGeometries",void 0),n([o()],p.prototype,"_material",void 0),n([o()],p.prototype,"_materialWithField",void 0),n([o()],p.prototype,"_renderView",null),n([o()],p.prototype,"_featuresArePoints",null),n([o()],p.prototype,"_loadedPointGraphics",null),n([o()],p.prototype,"_heatmapRenderer",null),n([o()],p.prototype,"_heatmapRendererFieldName",null),n([o()],p.prototype,"_heatmapRendererField",null),n([o()],p.prototype,"_heatmapRendererFieldIsNumeric",null),n([o()],p.prototype,"_fieldTotal",void 0),n([o()],p.prototype,"_drapeSourceRenderer",void 0),n([o()],p.prototype,"_isScaleRangeActive",null),p=n([M(mt)],p);const hr=s=>{let e=class extends s{constructor(){super(...arguments),this.controller=null,this.updatePolicy=ye.SYNC,this.suspendResumeExtentMode="computed",this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.suspendResumeExtent=null,this._controllerCreated=!1,this.supportsHeightUnitConversion=!0,this._pendingController=null,this.queryEngine=null}initialize(){const t=this.layer;if("isTable"in t&&t.isTable)return void this.addResolvingPromise(Promise.reject(new P("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:t})));this.addResolvingPromise(this._validateGeometryType()),this._updatingHandles.add(()=>this.layer.renderer,r=>this._recreateProcessor(r),O),this.addResolvingPromise((async()=>{const r=await ls(this);this.fullExtentInLocalViewSpatialReference=r,await this._initializeController()})()),this._updatingHandles.add(()=>this.updatePolicy,r=>this.processor.preferredUpdatePolicy=r);const i=()=>this.processor.featureStore;this.queryEngine=new V({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return i()},hasZ:this.hasZ,hasM:this.hasM},priority:pe.FEATURE_QUERY_ENGINE}),this.notifyChange("updating")}destroy(){this._destroyPendingController(),this.controller=$(this.controller),this._set("processor",$(this.processor)),this.queryEngine=$(this.queryEngine),this.loadedGraphics=null}_destroyPendingController(){this._pendingController=$(this._pendingController)}get legendEnabled(){var t;return this.canResume()&&((t=this.processor)==null?void 0:t.legendEnabled)}get graphics3DProcessor(){var t;return((t=this.processor)==null?void 0:t.type)==="graphics-3d"?this.processor:null}get heatmapProcessor(){var t;return((t=this.processor)==null?void 0:t.type)==="heatmap"?this.processor:null}get symbologySnappingSupported(){var i,r;const t=(r=(i=this.layer)==null?void 0:i.renderer)==null?void 0:r.getSymbols();return(t==null?void 0:t.some(Zi))??!1}getHit(t){var r;let i;return(r=this.loadedGraphics)==null||r.forEach(a=>{a.uid===t&&(i=Yi(a,this.layer))}),i?{type:"graphic",graphic:i,layer:i.layer}:null}whenGraphicBounds(t,i){var r;return(r=this.processor)==null?void 0:r.whenGraphicBounds(t,i)}computeAttachmentOrigin(t,i){var r;return(r=this.processor)==null?void 0:r.computeAttachmentOrigin(t,i)}async elevationAlignPointsInFeatures(t,i){const r=this.graphics3DProcessor;if(r==null)throw new P("featurelayerview3d:missing-processor","A Graphics3D processor is needed to resolve graphics elevation.");return Xi(this.view,this.layer,a=>r.getGraphics3DGraphicByObjectId(a),t,i)}async queryForSymbologySnapping(t,i){return this.symbologySnappingSupported?Ki(this.graphics3DProcessor,t,i):{candidates:[],sourceCandidateIndices:[]}}queryFeatures(t,i){return this.queryEngine.executeQuery(this._ensureQuery(t),i==null?void 0:i.signal)}queryObjectIds(t,i){return this.queryEngine.executeQueryForIds(this._ensureQuery(t),i==null?void 0:i.signal)}queryFeatureCount(t,i){return this.queryEngine.executeQueryForCount(this._ensureQuery(t),i==null?void 0:i.signal)}queryExtent(t,i){return this.queryEngine.executeQueryForExtent(this._ensureQuery(t),i==null?void 0:i.signal)}_ensureQuery(t){return t==null?this.createQuery():U.from(t)}highlight(t){return this.processor.highlight(t,this.layer.objectIdField)}maskOccludee(t){return this.processor.maskOccludee(t)}canResume(){var t;return super.canResume()&&!((t=this.processor)!=null&&t.scaleVisibilitySuspended)}getSuspendInfo(){const t=super.getSuspendInfo();return this.processor?{...t,...this.processor.suspendInfo}:t}isUpdating(){var t,i,r;return!(!this.processor||this.processor.destroyed)&&!(this._controllerCreated&&!((t=this.controller)!=null&&t.updating)&&((r=(i=this.view)==null?void 0:i.basemapTerrain)!=null&&r.ready)&&!this.processor.updating)}async _initializeController(){const t=this.createController();this._pendingController=t,await t.when(),this._setControllerWhenInitialized(t)}async _setControllerWhenInitialized(t){try{await this.when()}catch{}this._controllerCreated=!0,this.notifyChange("updating"),this.isResolved()&&!this.destroyed?(await We(()=>{var i,r;return(r=(i=this.view)==null?void 0:i.basemapTerrain)==null?void 0:r.ready}),this.beforeSetController(t),this._pendingController=null,this.controller=t,this.loadedGraphics=t.graphics,this.notifyChange("updating")):this._destroyPendingController()}_updateClippingExtent(t){if(this.clippingExtent=t,!this.controller)return!1;switch(this.controller.type){case"stream":return!1;case"feature-tile-3d":return this.controller.extent=t,!0}}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new P("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}_recreateProcessor(t){var u,d;const i=(t==null?void 0:t.type)==="heatmap",r=((u=this.processor)==null?void 0:u.type)==="heatmap",a=this.processor;if(a&&i===r)return;const l=i?new p({owner:this}):new m({owner:this,frustumVisibilityEnabled:!0,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!0,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!0,preferredUpdatePolicy:this.updatePolicy,updateClippingExtent:c=>this._updateClippingExtent(c)});this._set("processor",l),a==null||a.destroy(),(d=this.queryEngine)==null||d.clear(),this.addResolvingPromise(l.initializePromise)}_getResourceInfo(){var i;const t=this.controller instanceof g?this.controller:null;return{displayedNumberOfFeatures:(i=this.loadedGraphics)==null?void 0:i.length,maximumNumberOfFeatures:(t==null?void 0:t.maximumNumberOfFeatures)??-1,totalNumberOfFeatures:(t==null?void 0:t.serviceDataCount)??-1,nodes:0,...this.processor.performanceInfo}}get performanceInfo(){return this._getResourceInfo()}};return n([o()],e.prototype,"loadedGraphics",void 0),n([o()],e.prototype,"suspended",void 0),n([o({readOnly:!0})],e.prototype,"legendEnabled",null),n([o()],e.prototype,"updating",void 0),n([o()],e.prototype,"controller",void 0),n([o()],e.prototype,"processor",void 0),n([o({readOnly:!0})],e.prototype,"updatePolicy",void 0),n([o({readOnly:!0})],e.prototype,"suspendResumeExtentMode",void 0),n([o({type:Boolean})],e.prototype,"slicePlaneEnabled",void 0),n([o({readOnly:!0})],e.prototype,"suspendInfo",void 0),n([o()],e.prototype,"graphics3DProcessor",null),n([o()],e.prototype,"heatmapProcessor",null),n([o()],e.prototype,"symbologySnappingSupported",null),e=n([M("esri.views.3d.layers.FeatureLikeLayerView3D")],e),e},qs=Object.freeze(Object.defineProperty({__proto__:null,build:ut},Symbol.toStringTag,{value:"Module"})),zs=Object.freeze(Object.defineProperty({__proto__:null,build:pt},Symbol.toStringTag,{value:"Module"}));export{hr as E,ir as I,m as P,g as T,V as l,Ue as n}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/HeatmapProcessor-QI9jD0nx.js b/dist/assets/HeatmapProcessor-QI9jD0nx.js new file mode 100644 index 0000000..3238376 --- /dev/null +++ b/dist/assets/HeatmapProcessor-QI9jD0nx.js @@ -0,0 +1 @@ +import{e as k,c as K,c4 as _,hb as F}from"./index-J0iiHjMT.js";import{c as S}from"./definitions-DqQMJYPH.js";import{p as U,o}from"./BaseProcessor-nWGHAt7P.js";class n{constructor(t,i){this.offset=t,this.extent=i}}function v(s){const t=s.key,i=new Map,r=256,e=S,a=s.tileInfoView.tileInfo.isWrappable;return i.set(o(t,-1,-1,a).id,new n([-e,-e],[e-r,e-r,e,e])),i.set(o(t,0,-1,a).id,new n([0,-e],[0,e-r,e,e])),i.set(o(t,1,-1,a).id,new n([e,-e],[0,e-r,r,e])),i.set(o(t,-1,0,a).id,new n([-e,0],[e-r,0,e,e])),i.set(o(t,1,0,a).id,new n([e,0],[0,0,r,e])),i.set(o(t,-1,1,a).id,new n([-e,e],[e-r,0,e,r])),i.set(o(t,0,1,a).id,new n([0,e],[0,0,e,r])),i.set(o(t,1,1,a).id,new n([e,e],[0,0,r,r])),i}let h=class extends U{constructor(){super(...arguments),this.type="heatmap",this._tileKeyToFeatureSets=new Map}initialize(){this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this))])}async update(s,t){const i=t.schema.processors[0];i.type==="heatmap"&&_(this._schema,i)&&(s.mesh=!0,this._schema=i)}onTileUpdate(s){for(const t of s.removed)this._tileKeyToFeatureSets.delete(t.key.id)}onTileClear(s){const t={clear:!0};return this._tileKeyToFeatureSets.delete(s.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:t})}async onTileMessage(s,t,i){this._tileKeyToFeatureSets.has(s.key.id)||this._tileKeyToFeatureSets.set(s.key.id,new Map);const r=this._tileKeyToFeatureSets.get(s.key.id);if(r&&t.addOrUpdate!=null&&t.addOrUpdate.hasFeatures&&r.set(t.addOrUpdate.instance,t),t.end){const e=[],a=v(s);this._tileKeyToFeatureSets.forEach((p,l)=>{if(l===s.key.id)p.forEach(({addOrUpdate:d})=>{d&&e.push(d)});else if(a.has(l)){const d=a.get(l),[m,T]=d.offset;p.forEach(({addOrUpdate:f})=>{if(f){const w=f.transform(m,T,1,1);e.push(w)}})}});const c=F(e,this._schema.mesh,512,512),u={tileKey:s.key.id,intensityInfo:c},y=[c.matrix];return this.remoteClient.invoke("tileRenderer.onTileData",u,{...i,transferList:y})}}onTileError(s,t,i){return this.remoteClient.invoke("tileRenderer.onTileError",{tileKey:s.id,error:t},i)}};h=k([K("esri.views.2d.layers.features.processors.HeatmapProcessor")],h);const x=h;export{x as default}; diff --git a/dist/assets/HoveredPoints-BD2phuV6.js b/dist/assets/HoveredPoints-BD2phuV6.js new file mode 100644 index 0000000..90cbeba --- /dev/null +++ b/dist/assets/HoveredPoints-BD2phuV6.js @@ -0,0 +1 @@ +import{e as c,y as l,c as p,p as v,V as m,d as P,A as y,gL as b}from"./index-J0iiHjMT.js";import{c as x}from"./AnchorElementViewModel-SDYg-P9c.js";let a=class extends v{constructor(e){super(e),this._hoveredPoints=new m}initialize(){this.addHandles(P(()=>this._hoveredPoints.toArray().map(({anchor:e,element:o})=>({screenLocation:e.screenLocation,element:o})),e=>{for(const{screenLocation:o,element:t}of e)o&&(t.style.transform=`translate(${o.x}px, ${o.y}px)`)},y))}destroy(){this._hoveredPoints.drain(e=>this._destroyHoveredPoint(e))}update(e){var s;const o=this.view,t=this._hoveredPoints,i=e.length;for(;this._hoveredPoints.length>i;)this._destroyHoveredPoint(this._hoveredPoints.pop());for(;this._hoveredPoints.length{let i=s.meta.featureExtents;if(i==null){i=new Float64Array(6*s.meta.featureIds.length),s.meta.featureExtents=i;for(let o=0;o0){const r=this.toArray();this._map.clear(),this.emit("change",{added:[],removed:r})}}get length(){return this._map.size}get(r){return this._map.get(r)}addMany(r){if(r.length===0)return;const e=new Set;for(let s=0;s0?r.filter(s=>!e.has(s.objectId)):r;t.length>0&&this.emit("change",{added:t,removed:[]})}removeMany(r){const e=[];for(const t of r){const s=t.objectId,i=this._map.get(s);i!=null&&(!i.refCount||--i.refCount<=0)&&(this._map.delete(s),e.push(t))}e.length>0&&this.emit("change",{added:[],removed:e})}removeManyByObjectId(r){const e=[];for(const t of r){const s=this._map.get(t);s!=null&&(!s.refCount||--s.refCount<=0)&&(this._map.delete(t),e.push(s))}e.length>0&&this.emit("change",{added:[],removed:e})}toArray(){return[...this._map.values()]}find(r){let e;return be(this._map,t=>!!r(t)&&(e=t,!0)),e}forEach(r){this._map.forEach(e=>r(e))}}let Hi=class extends Ge{constructor(r){super(),this._limit=r,this._all=new Vi,this._active=new Gi(this),this._pending=new Map,this._handle=this._all.on("change",e=>this._handleChanges(e))}destroy(){this._handle.remove()}get length(){return this._active.length}toArray(){return this._active.toArray()}find(r){return this._active.find(r)}forEach(r){this._active.forEach(r)}addMany(r){this._all.addMany(r)}removeManyByObjectId(r){this._all.removeManyByObjectId(r)}_handleChanges(r){let e=r.removed;if(this._pending.size>0){e=new Array;for(const a of r.removed)this._pending.delete(a.objectId)||e.push(a)}let t=this._limit-this._active.length+e.length;t{W.sample()&&(e.push(a),this._pending.set(a.objectId,a))}),t=this._limit-this._active.length+e.length);let s=r.added;if(t0&&this._pending.size>0&&(W.reset(i/this._pending.size),this._pending.forEach(a=>{W.sample()&&(s.push(a),this._pending.delete(a.objectId))})),this._active.addAndRemove(s,e)}},$i=class{constructor(){this._percentage=1,this._last=-1,this._index=0}reset(r){this._percentage=r,this._last=-1}sample(){const r=Math.floor(this._index*this._percentage);return++this._index,r!==this._last&&(this._last=r,!0)}};const W=new $i;let Gi=class{constructor(r){this._parent=r,this._map=new Map}get length(){return this._map.size}forEach(r){this._map.forEach(e=>r(e))}find(r){let e;return be(this._map,t=>!!r(t)&&(e=t,!0)),e}toArray(){return[...this._map.values()]}addAndRemove(r,e){for(const t of r)this._map.set(t.objectId,t);for(const t of e)this._map.delete(t.objectId);(r.length>0||e.length>0)&&this._parent.emit("change",{added:r,removed:e})}removeMany(r){for(const e of r)this._map.delete(e.objectId);r.length>0&&this._parent.emit("change",{added:[],removed:r})}};class lt{constructor(r,e){this.meta=r,this.index=e}}class Li{constructor(r,e){this.graphic=r,this.geometry=e,this.components=[],this.overridesDirty=!1}}let F=class extends Le{get updating(){var n;return((n=this._graphicsCore)==null?void 0:n.updating)??!1}constructor(n){super(n),this.loadedGraphics=new Hi(5e4),this.slicePlaneEnabled=!1,this._renderingInfo={symbol:new ts},this._featuresMap=new Map}initialize(){const n=this.view.basemapTerrain;this._graphicsCore=new xi({owner:this,layer:this.layer,preferredUpdatePolicy:ss.ASYNC,elevationFeatureExpressionEnabled:!1,graphicSymbolSupported:!1,getRenderingInfoWithoutRenderer:!0,hasZ:!0,hasM:!1,componentFactories:{deconflictor:r=>this.view.deconflictor.addGraphicsOwner(r),labeler:(r,e)=>this.view.labeler.addGraphicsOwner(r,e,{emptySymbolLabelSupported:!0,elevationInfoOverride:{mode:"absolute-height",offset:0},disablePlacement:{logEntityDescription:"3D Object Scene Layer features"}}),scaleVisibility:(r,e)=>new wi({graphicsCoreOwner:this,layer:this.layer,queryGraphicUIDsInExtent:e,graphicsCore:r,basemapTerrain:n,layerScaleEnabled:!1})}}),this._graphicsCore.initializePromise.then(()=>this._graphicsCore.startCreateGraphics()).catch(()=>{}),this.addHandles(Pe(()=>this.layer.labelingInfo,(r,e)=>{is(r,e)&&this._graphicsCore.updateLabelingInfo()}))}destroy(){this._graphicsCore=A(this._graphicsCore),this.loadedGraphics=A(this.loadedGraphics),this.view=null}addNodeMeta(n,r){let e=0;const t=n.filteredIds,s=this.view.spatialReference,i=[];for(let a=0;a{const i=this._graphicsCore.getGraphics3DGraphicById(t.uid);i!=null&&this._updateLabelGeometry(n.featureIds[e])&&i.alignWithAbsoluteElevation(s.z??0,r,!1)})}setNodeMetaAttributes(n,r){const e=new Array;this._forEachGraphic(n,(t,s)=>{const i=r(t,n);as(s.attributes,i)||(s.attributes=i,e.push(s.uid))}),this._graphicsCore.updateLabelingInfo(e)}applyFilterChange(n){this._forEachFeature(n,(r,e,t)=>{if(!this._enabledForFeatureInNode(n,r)){const a=n.featureIds[r];switch(this._removeFeature(e,n,r)){case $.REMOVED:this.loadedGraphics.removeManyByObjectId([a]);break;case $.MODIFIED:this._updateLabelPosition(a)}return}const s=e.graphic,i=s.visible;i!==t&&(s.visible=t,te.graphic=s,te.property="visible",te.oldValue=i,te.newValue=t,this._graphicsCore.graphicUpdateHandler(te))})}removeNodeMeta(n){const r=[];this._forEachGraphic(n,e=>{const t=n.featureIds[e],s=this._featuresMap.get(t);if(s)switch(this._removeFeature(s,n,e)){case $.MODIFIED:this._updateLabelPosition(t);break;case $.REMOVED:r.push(t)}}),this.loadedGraphics.removeManyByObjectId(r)}_removeFeature(n,r,e){const t=n.components.length;return ns(n.components,s=>!(s.meta===r&&s.index===e)),n.components.length===0?(this._featuresMap.delete(r.featureIds[e]),$.REMOVED):t!==n.components.length?$.MODIFIED:$.UNMODIFIED}getRenderingInfo(){return this._renderingInfo}notifyGraphicGeometryChanged(){}notifyGraphicVisibilityChanged(){}_updateLabelPosition(n){const r=this._featuresMap.get(n);r&&this._updateLabelGeometry(n)&&(this.loadedGraphics.removeManyByObjectId([n]),this.loadedGraphics.addMany([r.graphic]))}_updateLabelGeometry(n){const r=this._featuresMap.get(n);if(!r)return!1;const e=r.geometry,t=this.view.spatialReference,s=this.view.renderCoordsHelper,i=e.x,a=e.y,o=e.z??0,h=r.components.length,d=ye(h*ot);let c=0;for(const{meta:l,index:u}of r.components)ke(u,this.collection,l.objectHandle,d,c),c+=ot;return He(d,s.spatialReference,0,d,t,0,d.length/3),De(k,It),$e(k,d),e.x=(k[0]+k[3])/2,e.y=(k[1]+k[4])/2,e.z=k[5],!Se(e.x,i)||!Se(e.y,a)||!Se(e.z,o)}_forEachGraphic(n,r){this._forEachFeature(n,(e,{graphic:t,geometry:s},i)=>{this._enabledForFeatureInNode(n,e)&&r(e,t,s,i)})}_forEachFeature(n,r){let e=0;for(let t=0;t[e.geometryBuffer],project:e=>[e.positions.buffer],transformNormals:e=>[e.normals.buffer]},r,{hasInitialize:!0})}setModifications(r,e,t,s){const i={context:r,modifications:Pt(e,t,s),isGeodetic:s.isGeographic};this.broadcast(i,"setModifications")}setLegacySchema(r,e){const t=JSON.stringify(e);return this.broadcast({context:r,jsonSchema:t},"setLegacySchema")}destroyContext(r){return this.broadcast(r,"destroyContext")}project(r,e){return this.invokeMethod("project",r,e)}transformNormals(r,e){return this.invokeMethod("transformNormals",r,e)}};const _=new Mt({deallocator:null}),Y=[0,0,0];function Pt(n,r,e){_.clear();let t=1/0,s=1/0,i=-1/0,a=-1/0,o=!1;for(const d of r){const c=d.type==="clip"?U.Inside:d.type==="mask"?U.Outside:U.Replace,l=d.geometry;let u=g=>g;if(l.spatialReference){if(!ds(l.spatialReference,e)){Ue.getLogger("esri.views.3d.layers.I3SMeshWorkerHandle").warn("Can't project modification polygon into layer spatial reference, ignoring modification");continue}u=g=>(pe(g,l.spatialReference,Y,e),Y)}else l.hasZ||(Y[2]=0,u=g=>(Y[0]=g[0],Y[1]=g[1],Y));o=o||c===U.Outside,_.push(c),_.push(l.rings.length);for(const g of l.rings){_.push(g.length);for(const f of g){const v=u(f);_.push(v[0]),_.push(v[1]),_.push(v[2]),t=Math.min(t,v[0]),s=Math.min(s,v[1]),i=Math.max(i,v[0]),a=Math.max(a,v[1])}}}n!=null&&(o?(_.push(U.Inside),_.push(2),_.push(4),_.push(t-1e-4),_.push(s-1e-4),_.push(0),_.push(i+1e-4),_.push(s-1e-4),_.push(0),_.push(i+1e-4),_.push(a+1e-4),_.push(0),_.push(t-1e-4),_.push(a+1e-4),_.push(0),_.push(4),_.push(n[0]),_.push(n[1]),_.push(0),_.push(n[2]),_.push(n[1]),_.push(0),_.push(n[2]),_.push(n[3]),_.push(0),_.push(n[0]),_.push(n[3]),_.push(0)):(_.push(U.Outside),_.push(1),_.push(4),_.push(n[0]),_.push(n[1]),_.push(0),_.push(n[2]),_.push(n[1]),_.push(0),_.push(n[2]),_.push(n[3]),_.push(0),_.push(n[0]),_.push(n[3]),_.push(0))),_.push(U.Finished);const h=new Float64Array(_.length);for(let d=0;d<_.length;++d)h[d]=_.at(d);return h}var q,x;(function(n){n[n.VISIBLE_ONLY=0]="VISIBLE_ONLY",n[n.ALL=1]="ALL",n[n.QUERYABLE=2]="QUERYABLE"})(q||(q={})),function(n){n[n.EXIT=0]="EXIT",n[n.CONTINUE=1]="CONTINUE",n[n.SKIP=2]="SKIP"}(x||(x={}));let Bi=class{constructor(){this.ids=new Set}};class zi{constructor({collection:r,forAllFeatures:e,forAllFeaturesOfNode:t}){this._highlights=[],this._collection=r,this._forAllFeatures=e,this._forAllFeaturesOfNode=t}destroy(){this._highlights.forEach(r=>this._releaseSet(r)),this._highlights=null}acquireSet(){const r=new Bi;this._highlights.push(r);const e=Et(()=>{this._highlights&&(this._releaseSet(r),Ot(this._highlights,r))});return{set:r,handle:e}}setFeatureIds(r,e){e.forEach(t=>r.ids.add(t)),this._initializeSet(r)}_initializeSet(r){this._forAllFeatures((e,t,s)=>(r.ids.has(e)&&this._collection.addComponentHighlight(s.objectHandle,t),x.CONTINUE))}_releaseSet(r){this._forAllFeatures((e,t,s)=>(r.ids.has(e)&&this._collection.removeComponentHighlight(s.objectHandle,t),x.CONTINUE))}objectCreated(r){this._highlights.forEach(e=>{this._forAllFeaturesOfNode(r,(t,s)=>(e.ids.has(t)&&this._collection.addComponentHighlight(r.objectHandle,s),x.CONTINUE))})}objectDeleted(r){this._collection.clearHighlights(r.objectHandle)}}let fe=class extends Le{constructor(r,e,t){super({}),this._updateExtent=e,this._updateNode=t,this.running=!1,this._extentSet=new Si,this._nodeSet=new Set,this.addHandles(r.registerTask(hs.ELEVATION_ALIGNMENT,this))}normalizeCtorArgs(){return{}}addExtent(r){this._extentSet.add(r),this.running=!0}schedule(r){this._nodeSet.add(r),this.running=!0}remove(r){this._nodeSet.delete(r),this._updateRunning()}runTask(r){const e=this._extentSet;for(r.run(()=>e.merge(r));!e.empty&&!r.done;){const s=this._updateExtent(e.pop());s!=null&&s.forAll(i=>this.schedule(i)),r.madeProgress()}if(r.done)return;const t=this._nodeSet;for(const s of t)if(t.delete(s),this._updateNode(s),r.madeProgress(),r.done)break;this._updateRunning()}_updateRunning(){this.running=this._nodeSet.size>0||this._extentSet.size>0}};p([m()],fe.prototype,"running",void 0),fe=p([Ce("esri.views.3d.layers.i3s.I3SAsyncElevationUpdater.ts")],fe);let qi=class{constructor(){this.lodCrossfadeSignedDuration=0}},Ki=class{constructor(r){this._view=r,this._preRenderFrameTaskHandle=null,this._currentFrameStartTime=null,this._numFadingNodes=0}destroy(){var r;(r=this._preRenderFrameTaskHandle)==null||r.remove(),this._preRenderFrameTaskHandle=null,this._view=null}get updating(){return this._numFadingNodes>0}stopNodeFading(r){r.lodCrossfadeProgress!=null&&(this._numFadingNodes--,r.lodCrossfadeProgress=null,this._numFadingNodes===0&&(this._preRenderFrameTaskHandle!=null&&(this._preRenderFrameTaskHandle=cs(this._preRenderFrameTaskHandle)),this._view.notifyLODUpdate(),this._view.notifyUpdate()))}_startNodeFading(r,e,t){this._numFadingNodes===0&&(this._preRenderFrameTaskHandle=us({preRender:s=>this._updateAllNodeFading(s)}),this._view.notifyLODUpdate()),r.lodCrossfadeProgress==null&&(this._numFadingNodes++,this._view.notifyUpdate()),r.lodCrossfadeSignedDuration=t,r.lodCrossfadeProgress=e}_updateAllNodeFading(r){const e=this._view.nodeCrossfadingEnabled;this._view.foreachCrossfadeNode((t,s)=>{if((s==null?void 0:s.lodCrossfadeProgress)!=null){const i=s.lodCrossfadeSignedDuration,a=i>0?this._view.fullOpacity:0,o=r.deltaTime/i,h=s.lodCrossfadeProgress+Math.abs(o),d=!e||h>=1||i===0,c=a-(d?0:i>0?1:-1)*(1-h);d?(this.stopNodeFading(s),i<0&&this._view.markNodeToRemove(t)):s.lodCrossfadeProgress=h,this._view.setNodeOpacityByIndex(t,c)}}),this._view.removeMarkedNodes()}stopAllNodeFading(){this._view.foreachCrossfadeNode((r,e)=>{if((e==null?void 0:e.lodCrossfadeProgress)!=null){this.stopNodeFading(e);const t=e.lodCrossfadeSignedDuration;t<0&&this._view.markNodeToRemove(r);const s=t>0?this._view.fullOpacity:0;this._view.setNodeOpacityByIndex(r,s)}}),this._view.removeMarkedNodes()}fadeNode(r,e,t,s){this._currentFrameStartTime==null&&(this._currentFrameStartTime=Date.now());const i=this._view,a=i.nodeCrossfadingEnabled,o=t===me.FadeIn?i.fullOpacity:0,h=a?s?t===me.FadeIn?i.lodCrossfadeinDuration:i.lodCrossfadeoutDuration:i.lodCrossfadeUncoveredDuration:0,d=this._view.getNodeOpacityByIndex(r);if(a&&d!==o&&h>0){const c=1-Math.abs(o-d);this._startNodeFading(e,c,Wi(t)*h)}else this.stopNodeFading(e),this._view.setNodeOpacityByIndex(r,o),t===me.FadeOut&&this._view.removeNode(r)}isNodeFullyFadedIn(r){const e=this._view.getNodeCrossfadeMetaData(r);return e==null||e.lodCrossfadeProgress==null&&this._view.getNodeOpacityByIndex(r)===this._view.fullOpacity}};function Wi(n){return n===me.FadeIn?1:-1}const B=je(),se=St(),dt=Nt(0,0,0,0),H=G(),Yi=G(),Qi=G();let z=class extends Ge.EventedMixin(Le){get spatialReference(){var n,r;return(r=(n=this.view)==null?void 0:n.elevationProvider)==null?void 0:r.spatialReference}constructor(n){super(n),this._tmpEvent={spatialReference:null,extent:B,context:"scene"}}initialize(){this.view=this.layerView.view,this._renderCoordsHelper=this.view.renderCoordsHelper,this._intersector=_s(this.view.state.viewingMode),this._intersector.options.store=xt.MIN,this._tmpEvent.context=this.intersectionHandler.isGround?"ground":"scene"}getElevation(n,r,e,t){const s=H;s[0]=n,s[1]=r,s[2]=e;const i=this._renderCoordsHelper;if(!i.toRenderCoords(s,t,s))return Ue.getLogger(this).error("could not project point to compute elevation"),null;const{layerView:a,_intersector:o,intersectionHandler:h}=this,d=a.i3slayer.fullExtent,c=d!=null&&Number.isFinite(d.xmin)&&Number.isFinite(d.xmax)&&Number.isFinite(d.ymin)&&Number.isFinite(d.ymax)&&Number.isFinite(d.zmin)&&Number.isFinite(d.zmax)?{min:d.zmin,max:d.zmax}:a.elevationRange;if(c==null)return null;const l=a.elevationOffset,u=c.min+l,g=c.max+l,f=Yi,v=Qi;return i.setAltitude(f,g,s),i.setAltitude(v,u,s),o.reset(f,v,null),h.intersect(o,null,f,v),o.results.min.getIntersectionPoint(s)?i.getAltitude(s):null}getSphereElevationBounds(n,r){return Dt(n,r,dt,this._renderCoordsHelper.spatialReference),this.layerView.getElevationRange(dt)}getRootElevationBounds(){const n=this.layerView.i3slayer.fullExtent;return n!=null&&n.hasZ?{min:n.zmin,max:n.zmax}:null}layerChanged(){this.spatialReference&&(this._tmpEvent.extent=this._computeLayerExtent(),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}objectChanged(n){this.spatialReference&&(this._tmpEvent.extent=this._computeObjectExtent(n),this._tmpEvent.spatialReference=this.spatialReference,this.emit("elevation-change",this._tmpEvent))}_computeObjectExtent(n){return je(B),this._expandExtent(n,B),B}_computeLayerExtent(){je(B);for(const n of this.layerView.getVisibleNodes())this._expandExtent(n,B);return B}_expandExtent(n,r){const e=this.spatialReference;if(e==null)return;const t=this.layerView.getNodeComponentObb(n);if(t!=null){gs(se,t.quaternion),se[12]=t.center[0],se[13]=t.center[1],se[14]=t.center[2];for(let s=0;s<8;++s)H[0]=1&s?t.halfSize[0]:-t.halfSize[0],H[1]=2&s?t.halfSize[1]:-t.halfSize[1],H[2]=4&s?t.halfSize[2]:-t.halfSize[2],wt(H,H,se),this._renderCoordsHelper.fromRenderCoords(H,H,e),ps(r,H,r)}}};p([m({constructOnly:!0})],z.prototype,"layerView",void 0),p([m({constructOnly:!0})],z.prototype,"intersectionHandler",void 0),p([m()],z.prototype,"view",void 0),p([m()],z.prototype,"spatialReference",null),z=p([Ce("esri.views.3d.layers.i3s.I3SElevationProvider")],z);const Xi=z;class Ji{constructor(r){this.type=ms.I3S,this._needVerticalOffset=!1,this.layerUid=r.layerUid,this.sublayerUid=r.sublayerUid,this._collection=r.collection,this._traverseNodeHierarchy=r.traverseNodeHierarchy,this.slicePlaneEnabled=r.slicePlaneEnabled,this.isGround=r.isGround}updateElevationAlignState(r,e){this._needVerticalOffset=r&&e===fs.Global}intersect(r,e,t,s){const i=r.results,a=r.options.store===xt.ALL,o=r.ray.direction,h=r.tolerance;let d=u=>u,c=u=>u;const l=ys(r.verticalOffset!=null?r.verticalOffset:this._needVerticalOffset?0:null);r.verticalOffset!=null&&l!=null&&(d=u=>l.applyToMbs(u),c=u=>l.applyToObb(u)),this._traverseNodeHierarchy((u,g)=>{if(u.childrenLoaded===0)return!1;const f=u.serviceObbInRenderSR!=null&&bs(u.serviceObbInRenderSR)?u.serviceObbInRenderSR:null;return!(f!=null&&!Qe(c(f),t,o,h))&&(!g||f==null&&vs(u.renderMbs)&&!Zi(d(u.renderMbs),t,o,h)||u.geometryObb!=null&&!Qe(c(u.geometryObb),t,o,h)||this._collection.intersect(g,t,s,h,l,(v,M,w,S)=>{if(M>=0){if(e!=null&&!e(t,s,M))return;const y=I=>{const b=new Cs(this.layerUid,this.sublayerUid,u.index,v,S);I.set(this.type,b,M,w)};if(this.isGround&&(i.ground.dist==null||Mi.max.dist)&&y(i.max),a){const I=Is(r.ray);y(I),r.results.all.push(I)}}}),!0)})}}function Zi(n,r,e,t=0){const s=n[3]+t,i=r[0]-n[0],a=r[1]-n[1],o=r[2]-n[2],h=e[0],d=e[1],c=e[2],l=h*i+d*a+c*o;return l*l-(h*h+d*d+c*c)*(i*i+a*a+o*o-s*s)>=0}const er=14;class tr{constructor(r,e,t=er){this._version=t,this._db=null,this._quotaReductionPromise=null,this._gcCounter=0,this._hit=0,this._miss=0,this._destroyed=!1,this.gcFrequency=50,this.maxByteSize=Rt.GIGABYTES,this.quotaReductionFactor=.2,this._dbName=r,this._storeName=e}init(){return Promise.resolve().then(()=>{const r=indexedDB.open(this._dbName,this._version);return r.onupgradeneeded=e=>{const t=r.result,s=r.transaction,i=t.objectStoreNames.contains(this._storeName)?s.objectStore(this._storeName):t.createObjectStore(this._storeName),a=t.objectStoreNames.contains("last_access")?s.objectStore("last_access"):t.createObjectStore("last_access");a.indexNames.contains("date")||a.createIndex("date","date",{unique:!1}),a.indexNames.contains("byteSize")||a.createIndex("byteSize","byteSize",{unique:!1}),e.oldVersion{this._destroyed?r.close():this._db=r})}destroy(){this._db&&(this._db.close(),this._db=null),this._destroyed=!0}get initialized(){return this._db!=null}getHitRate(){return this._hit/(this._hit+this._miss)}put(r,e){return this._db==null?Promise.reject(new Ms("indexedb:not-initialized","IndexedDB Cache is not initialized")):(this._quotaReductionPromise!=null?this._quotaReductionPromise:Promise.resolve()).then(()=>this._put(r,e)).catch(t=>{if(t&&t.name==="QuotaExceededError")return this._quotaReductionPromise==null&&(this._quotaReductionPromise=this._getCacheSize().then(s=>this._removeLeastRecentlyAccessed(e.byteSize+Math.ceil(s*this.quotaReductionFactor))),this._quotaReductionPromise.then(()=>this._quotaReductionPromise=null,()=>this._quotaReductionPromise=null)),this._quotaReductionPromise.then(()=>this._put(r,e));throw t}).then(()=>{this._gcCounter--,this._gcCounter<0&&this._db!=null&&(this._gcCounter=this.gcFrequency,this._getCacheSize().then(t=>this._removeLeastRecentlyAccessed(t-this.maxByteSize)))})}get(r,e){const t=this._db;if(t==null)return Promise.resolve(void 0);let s=null;return Promise.resolve().then(()=>{const i=t.transaction(this._storeName,"readonly");return s=Es(e,()=>{i.abort()}),Q(i.objectStore(this._storeName).get(r))}).then(i=>(i==null?++this._miss:this._db&&(++this._hit,this._db.transaction("last_access","readwrite").objectStore("last_access").put({date:Date.now(),byteSize:i.byteSize},r)),s!=null&&s.remove(),i)).catch(()=>{++this._miss,Ve(e),s!=null&&s.remove()})}remove(r){const e=this._db;return e==null?Promise.resolve():Promise.resolve().then(async()=>{const t=e.transaction([this._storeName,"last_access"],"readwrite"),s=t.objectStore(this._storeName),i=t.objectStore("last_access"),a=s.delete(r),o=i.delete(r);await Promise.all([Q(a),Q(o),ge(t)])})}_put(r,e){const t=this._db;if(t==null)return Promise.resolve();const s=t.transaction([this._storeName,"last_access"],"readwrite"),i=s.objectStore(this._storeName),a=s.objectStore("last_access"),o=i.put(e,r),h=a.put({date:Date.now(),byteSize:e.byteSize},r);return Promise.all([Q(o),Q(h),ge(s)])}_removeLeastRecentlyAccessed(r){if(r<=0||!this._db)return Promise.resolve();const e=this._db.transaction([this._storeName,"last_access"],"readwrite"),t=e.objectStore(this._storeName),s=e.objectStore("last_access");let i=0;const a=s.index("date").openCursor(null,"next");return a.onsuccess=()=>{const o=a.result;o!=null&&(o.value.byteSize!=null&&(i+=o.value.byteSize),t.delete(o.primaryKey),s.delete(o.primaryKey),i{const a=i.result;if(!a)return;const o=a.key;o!=null&&(s+=o),a.continue()},ge(e).then(()=>s)}}function ge(n){return new Promise((r,e)=>{n.oncomplete=()=>r(),n.onerror=()=>e(n.error),n.onabort=()=>e(n.error)})}function Q(n){return new Promise((r,e)=>{n.readyState==="done"?n.error!=null?e(n.error):r(n.result):(n.onsuccess=()=>r(n.result),n.onerror=()=>e(n.error))})}const ht=new WeakMap;class sr{constructor(r,e){switch(this._miss=0,this._hit=0,this.initialized=!0,e){case"layer":this._data=new Map;break;case"view":{const t=ht.get(r);if(t){this._data=t;break}const s=new Map;this._data=s,ht.set(r,s)}}}init(){return Promise.resolve()}async get(r,e){if(this._data.has(r))return this._hit++,this._data.get(r)??void 0;this._miss++}destroy(){}put(r,e){return this._data.set(r,e),Promise.resolve()}remove(r){return this._data.delete(r),Promise.resolve()}getHitRate(){return this._hit/(this._hit+this._miss)}}const jt="esri.views.3d.layers.I3SMeshView3D",P=Ue.getLogger(jt),ct=[1,1,1,1];class ir extends qi{constructor(r,e,t,s,i,a,o,h,d){super(),this.node=r,this.featureIds=e,this.objectHandle=t,this.cachedRendererVersion=s,this.attributeInfo=i,this.material=a,this.textures=o,this.anchorIds=h,this.anchors=d,this.cachedElevationAnchors=null,this.cachedEdgeMaterials=new Array,this.edgeMemoryUsage=0}}var K;(function(n){n[n.CastShadows=4]="CastShadows",n[n.Pickable=5]="Pickable"})(K||(K={}));const rr=23,ar=100*Rt.MEGABYTES,Nr=n=>{let r=class extends n{constructor(...e){super(e),this._updatingHandles=new ws,this._nodeId2Meta=new Map,this._nodeId2MetaReloading=new Map,this._i3sWasmLoaded=!1,this._snappingSourcesTrackers=[],this._hasLoadedPBRTextures=!1,this._asyncModuleLoading=0,this._addTasks=new Map,this._currentRenderer=null,this._rendererVersion=0,this._colorVariable=null,this._opacityVariable=null,this._rendererFields=null,this._symbologyFields=null,this._symbologyOverride=null,this._symbologyOverrideFields=null,this._symbolInfos=new Map,this._visibleGeometryChangedSchedulerHandle=null,this._hasComponentData=!1,this._hasVertexColors=!1,this._nodeColorOverride=null,this.updating=!0,this.holeFilling="auto",this._hasColors=!1,this._hasTextures=!1,this._hasData=!1,this.slicePlaneEnabled=!1,this._modifications=new Array,this.ignoresMemoryFactor=!1,this._layerUrl="",this._cacheKeySuffix=null,this._elevationTask=null,this._filters=[],this._arcade=null,this._tmpAttributeOnlyGraphic=new le(null,null,{}),this._crossfadeHelper=new Ki(this)}get lodCrossfadeoutDuration(){return 0}get lodCrossfadeinDuration(){return 0}get lodCrossfadeUncoveredDuration(){return 0}get layerUid(){return this.i3slayer&&this.i3slayer.uid}get sublayerUid(){return null}get layerId(){return this.i3slayer&&this.i3slayer.id}get sublayerId(){return null}get contentVisible(){var e;return!this.suspended&&((e=this._controller)==null?void 0:e.rootNodeVisible)}get legendEnabled(){var e;return this.contentVisible&&((e=this.i3slayer)==null?void 0:e.legendEnabled)===!0}get updatingProgressValue(){var e;return((e=this._controller)==null?void 0:e.updatingProgress)??0}get hasTexturesOrVertexColors(){return this._hasData?this._hasTextures||this._hasColors?"yes":"probably-not":"unknown"}get rendererTextureUsage(){return Ss(this._currentRenderer)?this._usePBR||this._hasLoadedPBRTextures?ee.AllTexturesPBR:ee.AllTextures:this._usePBR||this._hasLoadedPBRTextures?ee.GeometryTexturesPBR:ee.GeometryTextures}get elevationOffset(){const e=this.i3slayer!=null?this.i3slayer.elevationInfo:null;if(e!=null&&e.mode==="absolute-height"){const t=Xe(this.i3slayer.spatialReference),s=Je(e.unit);return(e.offset??0)*s/t}return 0}get elevationInfo(){const e=this.i3slayer!=null?this.i3slayer.elevationInfo:null;if(e==null)return{mode:R.Absolute,offset:0};const t=Xe(this.i3slayer.spatialReference),s=Je(e.unit),i=(e.offset??0)*s/t;switch(e.mode){case"absolute-height":return{mode:R.Absolute,offset:i};case"relative-to-ground":return{mode:R.RelativeToGround,offset:i};case"on-the-ground":return{mode:R.OnTheGround,offset:0};default:return{mode:R.Absolute,offset:0}}}get supportedTextureEncodings(){return yi(this.view._stage.renderView.capabilities)}get uncompressedTextureDownsamplingEnabled(){var s;const e=(s=this.view)==null?void 0:s.qualitySettings.sceneService.uncompressedTextureDownsamplingEnabled,t=(this.supportedTextureEncodings&_e.DDS_S3TC)==0;return e&&t}get clientGeometry(){return this.i3sOverrides.geometryOverrides}get elevationRange(){const e=this._nodeId2Meta;let t=1/0,s=-1/0;for(const i of e.values()){if(i==null)continue;const{node:{mbs:a}}=i,[,o,h]=a;t=Math.min(t,o-h),s=Math.max(s,o+h)}return Number.isFinite(t)&&Number.isFinite(s)?{min:t,max:s}:null}initialize(){var c;const e=Ne("enable-feature:idb-mock-cache");this._idbCache=e?new sr(this.view,e):new tr("esri-scenelayer-cache","geometries"),this._preLoadBasis(),this.addResolvingPromise(this.i3slayer.indexInfo);const t=this.view.resourceController,s=t.memoryController;this.i3sOverrides=new bi({view:this.view,layer:this.i3slayer,memoryController:s}),this._worker=new ki(ur(t)),this.addResolvingPromise(this._worker.promise);const i=this.i3slayer.store;this._worker.setLegacySchema(this.uid,i.defaultGeometrySchema),Ns(this.i3slayer),Rs(this.i3slayer,this.view),this._layerUrl=this.i3slayer.parsedUrl.path,this._controller=new vi({layerView:this,worker:this._worker}),this._gpuMemoryEstimate=0,this._texMemoryEstimate=0,this._geoMemoryEstimate=0,this._stage=this.view._stage,this._collection=this._stage.renderView.componentObjectCollection,this.resetHighlights();const a=i.defaultGeometrySchema;if(this._isIntegratedMesh||!a)this._hasComponentData=!1;else{const l=a.featureAttributes;this._hasComponentData=!!(l&&l.faceRange&&l.id)}this._hasVertexColors=((a==null?void 0:a.vertexAttributes.color)??null)!=null&&!((c=this.i3slayer.cachedDrawingInfo)!=null&&c.color),this._isIntegratedMesh||(this._edgeView=this._stage.renderer.ensureEdgeView());const o=this.view.resourceController.memoryController.newCache(`sl-${this.uid}`,l=>this._deleteComponentObject(l));this._memCache=o;const h=l=>{var u;return((u=this._controller.index)==null?void 0:u.rootNode)!=null?this._controller.index.traverse(this._controller.index.rootNode,g=>{const f=g.index,v=this._nodeId2Meta.get(f)||this._nodeId2MetaReloading.get(f);return l(g,v!=null?v.objectHandle:null)}):()=>{}};this._intersectionHandler=new Ji({layerUid:this.layerUid,sublayerUid:this.sublayerUid,collection:this._collection,slicePlaneEnabled:this.slicePlaneEnabled,isGround:this._isIntegratedMesh,traverseNodeHierarchy:h}),this._updatingHandles.add(()=>this.layerUid,l=>this._intersectionHandler.layerUid=l),this._updatingHandles.add(()=>this.sublayerUid,l=>this._intersectionHandler.sublayerUid=l),this._elevationProvider=new Xi({layerView:this,intersectionHandler:this._intersectionHandler}),this._hasLoadedPBRTextures=this._usePBR,this._updatingHandles.add(()=>this.view.clippingArea,()=>this._clippingAreaChanged(),V),this._updatingHandles.add(()=>this.fullOpacity,l=>this._opacityChange(l)),this._updatingHandles.add(()=>this.slicePlaneEnabled,l=>this._slicePlaneEnabledChange(l)),this._updatingHandles.add(()=>this.elevationOffset,(l,u)=>{this._reloadAll(u),this._controller.invalidateVisibilityObbs()}),this._updatingHandles.add(()=>this.elevationInfo,(l,u)=>this._elevationInfoChanged(l,u),V),this._updatingHandles.add(()=>!this.suspended&&this.elevationInfo.mode!==R.Absolute,(l,u)=>{l?this.addHandles(this.view.basemapTerrain.on("elevation-change",({extent:g})=>this._ensureElevationTask().addExtent(g)),vt):u&&this.removeHandles(vt)},V),this._updatingHandles.add(()=>this._usePBR,l=>this._updatePBR(l));const d=()=>{this._reloadAll(),this.clearMemCache()};this._updatingHandles.add(()=>this.rendererTextureUsage,d),this._updatingHandles.add(()=>this.uncompressedTextureDownsamplingEnabled,d),this._updatingHandles.add(()=>this.contentVisible,l=>this._contentVisibleChanged(l),V),this._updatingHandles.add(()=>this.i3slayer.labelsVisible,()=>this._labelingChanged(),V),this._updatingHandles.add(()=>this.i3slayer.labelingInfo,()=>this._labelingChanged(),V),this._updatingHandles.add(()=>this._modifications,()=>this._modificationsChanged(),V),this.addHandles([Pe(()=>J.I3S_TREE_SHOW_TILES,l=>{if(l&&!this._treeDebugger){const u=this._controller.crsIndex;As(()=>import("./I3STreeDebugger-tPVEJfH8.js"),__vite__mapDeps([0,1,2,3])).then(({I3STreeDebugger:g})=>{!this._treeDebugger&&J.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new g({lv:this,view:this.view,nodeSR:u}))})}else l||J.I3S_TREE_SHOW_TILES||(this._treeDebugger=A(this._treeDebugger))},V),Pe(()=>J.I3S_SHOW_MODIFICATIONS,()=>this._showModifications(),V)]),this._cacheKeySuffix=Fs(this.i3slayer.spatialReference,this.view.renderSpatialReference),this._idbCache.init().catch(l=>P.warn(`Failed to initialize IndexedDB cache: ${l}`))}destroy(){this._clearAddTasks(),this._elevationTask=A(this._elevationTask),this.i3sOverrides=A(this.i3sOverrides),this._elevationProvider&&(this._elevationProvider.layerChanged(),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._intersectionHandler&&(this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),this._intersectionHandler=null);const e=this._worker;e&&(e.destroyContext(this.uid).then(()=>e.destroy()),this._worker=null),this._removeAllNodeDataFromStage(),this._memCache=A(this._memCache),this._collection=null,this._stage=null,this._edgeView=null,this._labeler=A(this._labeler),this._treeDebugger=A(this._treeDebugger),this._controller=A(this._controller),this._highlights.destroy(),this._nodeId2Meta.clear(),this._nodeId2MetaReloading.clear(),this._crossfadeHelper=A(this._crossfadeHelper),this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle&&(this._visibleGeometryChangedSchedulerHandle.remove(),this._visibleGeometryChangedSchedulerHandle=null),this._updatingHandles=A(this._updatingHandles)}_memEstimateTextureAdded(e){const t=e.memoryEstimate;return this._gpuMemoryEstimate+=t,this._texMemoryEstimate+=t,t}_memEstimateTextureRemoved(e){if(e!=null){const t=e.memoryEstimate;this._gpuMemoryEstimate-=t,this._texMemoryEstimate-=t}}_memEstimateGeometryAdded(e){const t=this._collection.getObjectGPUMemoryUsage(e);return this._gpuMemoryEstimate+=t,this._geoMemoryEstimate+=t,t}_memEstimateGeometryRemoved(e){const t=this._collection.getObjectGPUMemoryUsage(e);this._gpuMemoryEstimate-=t,this._geoMemoryEstimate-=t}isNodeLoaded(e){return this._nodeId2Meta.has(e)}isNodeReloading(e){return this._nodeId2MetaReloading.has(e)}get usedMemory(){let e=this._labeler!=null?this._labeler.usedMemory:0;return this._nodeId2Meta.forEach(t=>e+=t!=null?t.node.memory:0),this._nodeId2MetaReloading.forEach(t=>e+=t!=null?t.node.memory:0),e}get unloadedMemory(){return(this._controller!=null?this._controller.unloadedMemoryEstimate:0)+(this._labeler!=null?this._labeler.unloadedMemoryEstimate:0)}_labelingChanged(){if(!(Ts(this.i3slayer)&&this._supportsLabeling))return void(this._labeler!=null&&(this._labeler.destroy(),this._labeler=null));if(this._labeler!=null)return;const e=new Ui({view:this.view,layer:this.i3slayer,collection:this._collection,overrides:this.i3sOverrides});this._nodeId2Meta.forEach(t=>t!=null&&this._addMetaToLabeler(e,t)),this._labeler=e}_loadAsyncModule(e){return++this._asyncModuleLoading,e.then(t=>(--this._asyncModuleLoading,t),t=>{throw--this._asyncModuleLoading,t})}_modificationsChanged(){if(!this._i3sWasmLoaded&&this.hasModifications)return this._i3sWasmLoaded=Ni().then(()=>{this._i3sWasmLoaded=!0,this._modificationsChanged(),this.notifyUpdate()}),void this.notifyUpdate();if(this._i3sWasmLoaded!==!0)return;const e=this.uid,t=this.i3slayer.spatialReference;this._worker.setModifications(e,this._layerClippingArea,this._modifications,t);const s=Pt(this._layerClippingArea,this._modifications,t);Ri({context:e,modifications:s,isGeodetic:t.isGeographic}),this._controller.modificationsChanged();const i=this.hasModifications?new Mt:null;this._nodeId2Meta.forEach((a,o)=>{a==null?(this._nodeId2Meta.delete(o),this._controller.updateLoadStatus(o,!1)):a.node.hasModifications?(this._nodeId2Meta.delete(o),this._nodeId2MetaReloading.set(o,a)):i!=null&&i.push(a.node)}),this.notifyChange("elevationRange"),i!=null&&this._nodeId2MetaReloading.forEach(a=>i.push(a.node)),i!=null&&i.length>0&&(this.updateNodeModificationStatus(i),i.forAll(a=>{if(a.imModificationImpact!==nt.Culled){const o=this._nodeId2Meta.get(a.index);this._controller.invalidateGeometryVisibility(a.index),o!=null?(this._nodeId2Meta.delete(a.index),this._nodeId2MetaReloading.set(a.index,o),this.notifyChange("elevationRange")):this._nodeId2Meta.has(a.index)&&(this._nodeId2Meta.delete(a.index),this._controller.updateLoadStatus(a.index,!1))}})),this.clearMemCache(),this._controller.restartNodeLoading(),this._showModifications()}_showModifications(){if(this._modificationGraphics!=null&&(this.view.graphics.removeMany(this._modificationGraphics),this._modificationGraphics=null),!J.I3S_SHOW_MODIFICATIONS||this._modifications.length===0)return;const e={clip:[227,227,79,.8],mask:[227,139,79,.8],replace:[139,227,79,.8]},t={type:"simple-fill",outline:{color:[255,255,255],width:1}};this._modificationGraphics=new Array;for(const s of this._modifications){const i=s.geometry;i.spatialReference=this.i3slayer.spatialReference;const a={...t,color:e[s.type]};this._modificationGraphics.push(new le({geometry:i,symbol:a}))}this.view.graphics.addMany(this._modificationGraphics)}_addMetaToLabeler(e,t){e.addNodeMeta(t,(s,i)=>this._createAttributes(s,i))}_contentVisibleChanged(e){e?(this.view.elevationProvider.register(this._elevationContext,this._elevationProvider),this._stage.view.sceneIntersectionHelper.addIntersectionHandler(this._intersectionHandler)):(this._removeAllNodeDataFromStage(),this.view.elevationProvider&&this.view.elevationProvider.unregister(this._elevationProvider),this._stage.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler))}getLoadedAttributes(e){const t=this._nodeId2Meta.get(e);if((t==null?void 0:t.attributeInfo)!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this._nodeId2Meta.get(e);if((t==null?void 0:t.attributeInfo)!=null)return t.attributeInfo.attributeData}setAttributeData(e,t){const s=this._nodeId2Meta.get(e);(s==null?void 0:s.attributeInfo)!=null&&(s.attributeInfo.attributeData=t,this._attributeValuesChanged(s))}async updateAttributes(e,t,s){const i=this._nodeId2Meta.get(e);i!=null&&(await this.i3sOverrides.applyAttributeOverrides(i.featureIds,t,s,this._controller.requiredAttributes),i.attributeInfo=t,this._controller.reschedule(()=>this._attributeValuesChanged(i),s).catch(a=>{Ft(a)||P.warn("Error while updating attribute values. Layer might not display correctly.",a)}))}_attributeValuesChanged(e){e.cachedRendererVersion=this._getInvalidRendererVersion(),e.filteredIds=null,this._labeler!=null&&this._labeler.setNodeMetaAttributes(e,(t,s)=>this._createAttributes(t,s)),this._updateEngineObject(e)}clearMemCache(){this._memCache!=null&&this._memCache.clear()}getVisibleNodes(){const e=new Array;return this._nodeId2Meta.forEach(t=>t!=null&&e.push(t.node)),e}getNodeComponentObb(e){const t=this._nodeId2Meta.get(e.index)??this._nodeId2MetaReloading.get(e.index);return t!=null?this._collection.getComponentObb(t.objectHandle):null}getLoadedNodeIndices(e){this._nodeId2Meta.forEach((t,s)=>e.push(s)),this._nodeId2MetaReloading.forEach((t,s)=>e.push(s))}_preLoadBasis(){var e;!Ne("disable-feature:i3s-basis")&&this.supportedTextureEncodings&_e.Basis&&((e=this.i3slayer.textureSetDefinitions)!=null&&e.some(t=>t.formats.some(s=>s.format==="basis"||s.format==="ktx2")))&&Ze()}_getVertexBufferLayout(e,t){const s={hasTexture:pt(e.params.material),hasNormals:t.normal,hasRegions:t.uvRegion};return Ds(Ps(this._getGeometryParameters(s)))}_getObjectIdField(){return this.i3slayer.objectIdField||js}_getGlobalIdField(){var e;return(e=this.i3slayer.associatedLayer)==null?void 0:e.globalIdField}_findGraphicNodeAndIndex(e){const t=Te(this.i3slayer.fieldsIndex,e.attributes,this._getObjectIdField());let s=null;return be(this._nodeId2Meta,i=>{if(i==null)return!1;const a=i.featureIds.indexOf(t);return a!==-1&&(s={node:i.node,index:a},!0)}),s}_getGraphicIndices(e,t){const s=this._nodeId2Meta.get(e.index);if(s==null)return[];const i=[],a=this._getObjectIdField(),o=this.i3slayer.fieldsIndex;for(const h of t){const d=Te(o,h.attributes,a),c=s.featureIds.indexOf(d);c!==-1&&i.push(c)}return i}whenGraphicBounds(e){const t=this._findGraphicNodeAndIndex(e);if(!t)return Promise.reject();const s=this._getAABB(t.node.index,t.index);return s==null?Promise.reject():Promise.resolve({boundingBox:s,screenSpaceObjects:[]})}getAABBFromIntersectorTarget(e){return e.nodeIndex==null||e.componentIndex==null?null:this._getAABB(e.nodeIndex,e.componentIndex)}_getAABB(e,t){const s=this._nodeId2Meta.get(e);if((s==null?void 0:s.featureIds)==null||t>=s.featureIds.length)return null;const i=s.objectHandle,a=ke(t,this._collection,i,ye(24),0),o=this.view.renderSpatialReference,h=this.view.spatialReference;if(!He(a,o,0,a,h,0,8))return null;const d=Vs();return $e(d,a,0,8),d}whenGraphicAttributes(e,t){return Hs(this.i3slayer,e,this._getObjectIdField(),t,()=>[...this._nodeId2Meta.values()].filter($s))}getGraphicFromIntersectorTarget(e){if(e.nodeIndex==null||e.componentIndex==null)return null;const t=this._nodeId2Meta.get(e.nodeIndex);return(t==null?void 0:t.featureIds)==null||e.componentIndex>=t.featureIds.length?null:this._createGraphic(e.componentIndex,t)}_getCacheKey(e){return`${this._layerUrl}/v${rr}/${e}${this._cacheKeySuffix}`}_getMemCacheKey(e,t=this.elevationOffset){return e+"#"+t}get _idbCacheEnabled(){return!this._controller.disableIDBCache&&!this.hasModifications&&this.elevationOffset===0&&this._cacheKeySuffix!=null}loadCachedGPUData(e){return this._memCache!=null?this._memCache.pop(this._getMemCacheKey(e)):null}deleteCachedGPUData(e){e!=null&&this._deleteComponentObject(e)}_cacheGPUData(e,t=this.elevationOffset){if(this._memCache==null)return void this._deleteComponentObject(e);const s=this._controller.indexDepth-e.node.level;this._memCache.put(this._getMemCacheKey(e.node.index,t),e,e.node.memory,s)}loadMissingTextures(e,t,s,i){const a=(e==null?void 0:e.filter((o,h)=>{if(!(o.usage&this.rendererTextureUsage))return!1;if(t==null)return!0;const d=Ii(o.encodings,this.supportedTextureEncodings),c=t[h];return!!((c==null?void 0:c.data)==null||d&&c.encoding!==d.encoding)}))??[];return a.length===0?Promise.resolve(!1):s(a,i).then(o=>{let h=0;for(let d=0;di==null?null:i.nodeVersion!==e.version?(this._idbCache.remove(this._getCacheKey(e.id)),null):(this.elevationInfo.mode===R.Absolute&&(e.geometryObb=i.geometryObb),this.loadMissingTextures(i.requiredTextures,i.textureData,s,t).then(a=>(a&&this._idbCache.initialized&&i.textureData!=null&&(i.byteSize=ft(i.transformedGeometry,i.textureData),i.textureData.every(mt)&&yt(e,i)&&this._idbCache.put(this._getCacheKey(e.id),i).catch(o=>P.warn(`Failed to update node with textures in IndexedDB cache: ${e.id}: ${o}`))),Ve(t),i)))):Promise.resolve(null)}addNode(e,t,s){return dr(t)?t.geometryBuffer==null?(this._addNodeMeta(e.index,null),Promise.resolve()):this._addData(e,t.attributeDataInfo,()=>this._transformNode(e,t,s).then(i=>this._safeReschedule(()=>{if(i==null)return e.hasModifications=!1,this._addCachedNodeData(e,null,s);e.hasModifications=i.transformedGeometry.hasModifications;const{obb:a,componentOffsets:o,featureIds:h,anchorIds:d,anchors:c,transformedGeometry:l}=i,u=this._controller.crsIndex,g=this.view.renderSpatialReference,f=et(e.mbs,this.elevationOffset,u,g),v=At([a.center.x,a.center.y,a.center.z],[a.extents.x,a.extents.y,a.extents.z],Gs(a.orientation.x,a.orientation.y,a.orientation.z,a.orientation.w));wt(v.center,v.center,f),this.elevationInfo.mode===R.Absolute&&(e.geometryObb=v),t.geometryData.componentOffsets=o,h&&(t.geometryData.featureIds=Array.from(h)),t.geometryData.anchorIds=d,t.geometryData.anchors=c;const M={nodeVersion:e.version,geometryData:t.geometryData,requiredTextures:t.requiredTextures,textureData:t.textureData,transformedGeometry:l,globalTrafo:f,geometryObb:v,byteSize:ft(l,t.textureData)};if(this._idbCacheEnabled&&this._idbCache.initialized&&yt(e,M)){const w=M.textureData!=null?M.textureData.map(S=>mt(S)?S:null):null;this._idbCache.put(this._getCacheKey(e.id),{...M,textureData:w}).catch(S=>P.warn(`Failed to store node in IndexedDB cache: ${e.id}: ${S}`))}return this._addCachedNodeData(e,M,s)},s))):Promise.reject()}getElevationRange(e){let t=1/0,s=-1/0;const i=Ls(this.view.renderCoordsHelper.spatialReference);return this._nodeId2Meta.forEach(a=>{if((a==null?void 0:a.node.geometryObb)!=null){const o=a.node.geometryObb;if(Us(o,e)){const h=this._collection.getObjectTransform(a.objectHandle),d=this.view.renderCoordsHelper.getAltitude(h.position);for(let c=0;c0||this.lodCrossfadeoutDuration>0||this.lodCrossfadeUncoveredDuration>0)}get nodeFadeoutEnabled(){return this._supportsNodeCrossFading&&this.lodCrossfadeoutDuration>0}_setNewNodeOpacity(e){const t=this.nodeCrossfadingEnabled?0:this.fullOpacity;this._setNodeOpacity(e,t)}addCachedGPUData(e,t,s){if(this.elevationInfo.mode===R.Absolute&&(e.geometryObb=zs(this._collection.getComponentObb(t.objectHandle))),!this._controller.isGeometryVisible(e))return void this._cacheGPUData(t);this._labeler!=null&&this._addMetaToLabeler(this._labeler,t);const i=e.index;this._addNodeMeta(i,t),this.updateNodeState(i,s),this._collection.setObjectVisibility(t.objectHandle,Re.Visible),this._updateMaterial(t),this._setNewNodeOpacity(t),this.elevationInfo.mode!==R.Absolute&&this._ensureElevationTask().schedule(i),this._updateEngineObject(t),this._highlights.objectCreated(t),this._treeDebugger!=null&&this._treeDebugger.update()}addCachedNodeData(e,t,s,i){return this._addData(e,s,()=>this._addCachedNodeData(e,t,i))}async deleteCachedNodeData(e){if(this._idbCacheEnabled)return this._idbCache.remove(this._getCacheKey(e))}async _addCachedNodeData(e,t,s){var Ke;if(!this.contentVisible||!this._controller.isGeometryVisible(e))return void this._removeNodeStageData(e.index,this.elevationOffset,this._nodeId2MetaReloading);if(t==null)return void this._addNodeMeta(e.index,null);const i=this._addTasks.get(e.index),{geometryData:a,transformedGeometry:o,globalTrafo:h}=t;await this.i3sOverrides.applyAttributeOverrides(a.featureIds,i.attributeInfo,s,this._controller.requiredAttributes);const d=t.textureData!=null?t.textureData.filter(O=>O!=null&&(O.usage&this.rendererTextureUsage)!=0):[];!Ne("disable-feature:i3s-basis")&&d.some(O=>O!=null&&(O.encoding===_e.Basis||O.encoding===_e.KTX2))&&await Ze(),e.memory=0;const{componentOffsets:c,geometries:l,featureIds:u,anchorIds:g,anchors:f}=a,v=this._collection,M=l[0],{layout:w,indices:S,interleavedVertexData:y,positionData:I,hasColors:b}=o,E=this._materialParameters(M,w),C=c||new Uint32Array([0,S?S.length:y.byteLength/w[0].stride]),Vt={vertices:{data:y,count:y.byteLength/w[0].stride,layoutParameters:E.geometryParams},positionData:{positions:qs(I.data),indices:Ks(I.indices)},indices:S,componentOffsets:C},ne=M.transformation?Ws(M.transformation):St();Ys(ne,h,ne);const Me=Qs(G(),ne),Ht=Xs(Js(),ne),Be=this.view.renderSpatialReference,ze=this.view.basemapTerrain.spatialReference,Ee=G(),Oe=[1,1,1];Di(Me,Be,Oe,ze)||P.errorOnce("Unsupported coordinate system for IM overlay"),pe(Me,Be,Ee,ze);const oe=v.createObject({toMapSpace:Zs(Ee[0],Ee[1],Oe[0],Oe[1]),geometry:Vt,obb:t.geometryObb,transform:{position:Me,rotationScale:Ht}}),$t=E.geometryParams.textureCoordinates===de.Atlas,{textures:qe,texturePromise:Gt}=this._initMaterialAndTextures(oe,E.material,d,$t);e.memory+=this._memEstimateGeometryAdded(oe),e.memory+=qe.reduce((O,xe)=>O+(xe!=null?this._memEstimateTextureAdded(xe):0),0);const Lt=!!E.material.hasParametersFromSource,Ut=E.material.alphaMode!=="blend"&&E.material.metallicRoughness.baseColorFactor[3]>=1,N=new ir(e,u,oe,this._getInvalidRendererVersion(),i.attributeInfo,{hasParametersFromSource:Lt,isOpaque:Ut},qe,g,f);i.meta=N,!this._hasTextures&&((Ke=t.requiredTextures)!=null&&Ke.some(({usage:O})=>(O&ee.ColorTextures)!=0))&&(this._hasTextures=!0),this._hasData=!0,this._hasColors=this._hasColors||b,this._hasTextures=this._hasTextures||!!e.resources.texture,this.notifyChange("hasTexturesOrVertexColors");const kt=this.slicePlaneEnabled;return Promise.all([this._addOrUpdateEdgeRendering(N),Gt]).then(([O,xe])=>(O!=null&&O.updateObjectVisibility(N.objectHandle,!1).catch(X=>L(X,this.i3slayer.title)),this._safeReschedule(()=>{const X=this._addTasks.get(e.index);if(!X)return;if(this._addNodeMeta(e.index,N),X.meta=null,!this.contentVisible)return void this._removeNodeStageData(e.index,this.elevationOffset);v.setObjectVisibility(oe,Re.Visible),O!=null&&O.updateObjectVisibility(N.objectHandle,!0).catch(Wt=>L(Wt,this.i3slayer.title)),N.attributeInfo=X.attributeInfo;const Bt=N.cachedRendererVersion!==this._rendererVersion,zt=kt!==this.slicePlaneEnabled;this._updateElevationOffsets(N);const qt=N.elevationOffsets;this._updateComponentData(N);const Kt=this._applyFiltersToNode(N);(Bt||O!=null&&(zt||Kt||qt))&&this._addOrUpdateEdgeRendering(N),this._labeler!=null&&this._addMetaToLabeler(this._labeler,N),this._visibleGeometryChanged(N,T.ADD),this._highlights.objectCreated(N),this._updateMaterial(N),this._setNewNodeOpacity(N),this._treeDebugger!=null&&this._treeDebugger.update()},s))).catch(O=>{throw i.meta!=null&&(this._cacheGPUData(i.meta),i.meta=null),O})}_addNodeMeta(e,t){if(this._removeNodeStageData(e,this.elevationOffset,this._nodeId2MetaReloading),this._nodeId2Meta.has(e)){P.error("Removing duplicated node");const s=this._nodeId2Meta.get(e);s!=null&&this._deleteComponentObject(s)}else this._controller.updateLoadStatus(e,!0);t!=null&&(t.lodCrossfadeProgress=null,this.nodeCrossfadingEnabled&&re(t.cachedEdgeMaterials,0)),this._nodeId2Meta.set(e,t),this.notifyChange("elevationRange")}_updateElevationOffsets(e){const t=this.view.renderSpatialReference,s=this._controller.crsIndex,i=this.elevationInfo,a=this.view.basemapTerrain,o=a.spatialReference,h=i.mode;if(t==null||o==null||h===R.Absolute)return void(e.elevationOffsets=null);const d=this._collection.getObjectTransform(e.objectHandle);e.elevationOffsets=e.elevationOffsets??[];const c=cr,l=bt,u=h===R.OnTheGround,g=this.view.renderCoordsHelper,f=e.featureIds.length,v=(()=>{var I;if(e.cachedElevationAnchors)return e.cachedElevationAnchors;const y=ye(3*f);e.cachedElevationAnchors=y;for(let b=0;b=0?(st(c,e.anchors[3*C],e.anchors[3*C+1],e.anchors[3*C+2]),ae(c,c,e.node.mbs),pe(c,s,c,o),y[E]=c[0],y[E+1]=c[1],y[E+2]=g.getAltitude(c)):(this._collection.getComponentAabb(e.objectHandle,b,l,!0),st(c,(l[0]+l[3])/2,(l[1]+l[4])/2,l[2]),Ct(c,c,d.rotationScale),ae(c,c,d.position),y[E+2]=g.getAltitude(c),pe(c,t,c,o),y[E]=c[0],y[E+1]=c[1])}return y})(),M=i.offset,w=e.elevationOffsets,S=(y,I)=>{const b=u?v[3*y+2]:0;w[y]=M+(I!=null?I-b:0)};a.getElevations(v,f,S)}_ensureElevationTask(){return this._elevationTask!=null||(this._elevationTask=new fe(this.view.resourceController.scheduler,e=>{const t=this._controller.updateElevationChanged(e,this.view.basemapTerrain.spatialReference);return t!=null?t.filterInPlace(s=>this._nodeId2Meta.get(s)!=null):null},e=>{const t=this._nodeId2Meta.get(e);this._nodeElevationAlignmentChanged(t)})),this._elevationTask}_elevationInfoChanged(e,t){const s=e.mode!==R.Absolute,i=!!t&&t!==e&&t.mode!==R.Absolute;this._intersectionHandler.updateElevationAlignState(s,this.view.state.viewingMode),s&&!i&&this._controller.removeAllGeometryObbs(),this._nodeId2Meta.forEach(a=>this._nodeElevationAlignmentChanged(a))}_nodeElevationAlignmentChanged(e){e!=null&&(this._updateElevationOffsets(e),this._updateComponentData(e),this._updateEdgeRendering(e),this._labeler!=null&&this._labeler.updateLabelPositions(e),this._updateSnappingSources(e,T.UPDATE))}_safeReschedule(e,t){return Ve(t),this._controller.reschedule(e,t)}_materialParameters(e,t){const s=e.params.material!=null?e.params.material:Ci(),i=t.some(h=>h.name==="uvRegion"),a=t.some(h=>h.name==="normalCompressed"),o=pt(s);return{geometryParams:this._getGeometryParameters({hasTexture:o,hasNormals:a,hasRegions:i}),material:s}}_initMaterialAndTextures(e,t,s,i){const a=this._stage.renderView,o=s.map(d=>Mi(d,t,i,a));this._stage.addMany(o);let h=null;return this._collection.updateMaterial(e,d=>{h=Ei(d,t,o,s,this.view._stage.renderView.textureRepository,{rendererTextureUsage:this.rendererTextureUsage,usePBR:this._usePBR,isIntegratedMesh:this._isIntegratedMesh,slicePlaneEnabled:this.slicePlaneEnabled,viewSpatialReference:this.view.spatialReference}),this._updateMaterialOverlay(d)}),{textures:o,texturePromise:h}}_getGeometryParameters(e){return{textureCoordinates:e.hasTexture?e.hasRegions?de.Atlas:de.Default:de.None,colors:this._hasVertexColors,normals:e.hasNormals&&!this._isIntegratedMesh}}_addData(e,t,s){let i=this._addTasks.get(e.index);return i?i.attributeInfo=t:(i={...ei(),attributeInfo:t,meta:null},this._addTasks.set(e.index,i),s().then(i.resolve,i.reject).then(()=>this._addTasks.delete(e.index)).catch(a=>{throw this._addTasks.delete(e.index),a})),i.promise}_clearAddTasks(){this._addTasks.forEach(e=>{e.meta!=null&&(this._cacheGPUData(e.meta),e.meta=null)}),this._addTasks.clear()}_clippingAreaChanged(){const e=this.view.renderSpatialReference,t=this.i3slayer.spatialReference,s=ve();this._renderClippingArea=it(this.view.clippingArea,s,e)?s:null;const i=ve();this._layerClippingArea=it(this.view.clippingArea,i,t)?i:null,this._filterChange(),this._controller&&this._controller.updateClippingArea(this.view.clippingArea),this._isIntegratedMesh&&this._modificationsChanged()}get hasGeometryFilter(){return!1}_geometryFilterChange(){const e=this.hasGeometryFilter;this._controller.geometryFilterChanged(e),this._applyFilters(e)}_filterChange(){this._applyFilters(this.hasGeometryFilter)}_applyFilters(e){this._filters=this.getFilters(),e?this._controller&&this._controller.requestUpdate():this._nodeId2Meta.forEach(t=>{t!=null&&this._applyFiltersToNode(t)&&(this._addOrUpdateEdgeRendering(t),this._visibleGeometryChanged(t,T.UPDATE))})}getFilters(){const e=[],t=this._renderClippingArea;return t!=null&&e.push((s,i)=>this._boundingRectFilter(s,i,t)),e}addSqlFilter(e,t,s){if(t!=null){const i=t.fieldNames;e.push((a,o)=>this._sqlFilter(a,o,t,i,s))}}_sqlFilter(e,t,s,i,a){var u;const o={},h=this._createLayerGraphic(o),d=this.i3slayer.objectIdField,c=t.featureIds,l=(u=t.attributeInfo)==null?void 0:u.attributeData;i.every(g=>g===d||(l==null?void 0:l[g])!=null)&&rt(e,c,g=>{o[d]=c[g];for(const f of i)f!==d&&(o[f]=l?Ae(l[f],g):null);try{return s.testFeature(h)}catch(f){return a(f),!1}})}_boundingRectNodeTest(e,t){return Dt(e.node.mbs,this._controller.crsIndex,gt,this.view.renderSpatialReference),ti(t,gt)}_boundingRectFeatureTest(e,t,s){return this._collection.getComponentAabb(e.objectHandle,t,ut),si(ut,_t),ii(s,_t)}_boundingRectFilter(e,t,s){const i=this._collection,a=this._boundingRectNodeTest(t,s);if(a===he.INSIDE)return;if(a===he.OUTSIDE)return void(e.length=0);const o=i.getComponentCount(t.objectHandle);if(o.invisible+o.visible!==t.featureIds.length)return;const h=this._transformClippingArea(nr,s,t.objectHandle);rt(e,t.featureIds,d=>this._boundingRectFeatureTest(t,d,h))}_transformClippingArea(e,t,s){const i=this._collection.getObjectTransform(s),a=i.position,o=i.rotationScale;return e[0]=(t[0]-a[0])/o[0],e[1]=(t[1]-a[1])/o[4],e[2]=(t[2]-a[0])/o[0],e[3]=(t[3]-a[1])/o[4],e}_addOrUpdateEdgeRendering(e,t=!0){const s=this._edgeView;if(s==null)return Promise.resolve(null);const i=e.objectHandle,a=s.hasObject(i),{hasEdges:o,perFeatureEdgeMaterials:h}=this._getFilteredEdgeMaterials(e),d={hasSlicePlane:this.slicePlaneEnabled};return o&&a?(this.nodeCrossfadingEnabled&&re(h,this.getNodeOpacity(e)),s.updateAllComponentMaterials(i,h,d,t).catch(c=>L(c,this.i3slayer.title)),s.updateObjectVisibility(i,!0).catch(c=>L(c,this.i3slayer.title)),s.updateAllVerticalOffsets(i,e.elevationOffsets).catch(c=>L(c,this.i3slayer.title)),Promise.resolve(s)):o&&!a?this._collection.addEdges(i,s,h,d).then(c=>(e.edgeMemoryUsage=c,e.node.memory+=c,s.updateAllVerticalOffsets(i,e.elevationOffsets).catch(l=>L(l,this.i3slayer.title)),s)):(!o&&a&&(e.node.memory-=e.edgeMemoryUsage,e.edgeMemoryUsage=0,s.removeObject(i)),Promise.resolve(null))}_applyFiltersToNode(e){return!!this._applyFiltersToNodeComponents(e)&&(this._labeler!=null&&this._labeler.applyFilterChange(e),!0)}_applyFiltersToNodeComponents(e){const t=this._collection,s=t.getComponentCount(e.objectHandle),i=e.filteredIds!=null,a=s.invisible===0;if(t.setAllComponentVisibilities(e.objectHandle,"all"),this._filters.length===0)return e.filteredIds=null,!a;if(this._updateCachedFilteredIds(e),i&&e.filteredIds===e.featureIds)return!a;const o=this._computeFilteredComponentIndices(e);return t.setAllComponentVisibilities(e.objectHandle,o),!0}_updateCachedFilteredIds(e){e.filteredIds!=null&&e.appliedFilters===this._filters||(e.filteredIds=this._computeFilteredIds(e),e.appliedFilters=this._filters)}_computeFilteredIds(e){const t=e.featureIds.slice();for(const s of this._filters)if(s(t,e),t.length===0)break;return t.length===e.featureIds.length?e.featureIds:t}_computeFilteredComponentIndices(e){const t=new Array,s=e.filteredIds;return s!=null&&e.featureIds.forEach((i,a)=>{s[t.length]===i&&t.push(a)}),t}_removeAllNodeDataFromStage(e=this.elevationOffset){this._nodeId2Meta.forEach((t,s)=>this._removeNodeStageData(s,e)),this._nodeId2MetaReloading.forEach((t,s)=>this._removeNodeStageData(s,e,this._nodeId2MetaReloading)),this._elevationTask=A(this._elevationTask)}removeNode(e){const t=this.elevationOffset;this._removeNodeStageData(e,t),this._removeNodeStageData(e,t,this._nodeId2MetaReloading),this._elevationTask!=null&&this._elevationTask.remove(e)}_removeNodeStageData(e,t,s=this._nodeId2Meta){s.has(e)&&this._controller.updateLoadStatus(e,!1);const i=s.get(e);i!=null?(this._collection.setObjectVisibility(i.objectHandle,Re.Hidden),this._edgeView!=null&&this._edgeView.hasObject(i.objectHandle)&&this._edgeView.updateObjectVisibility(i.objectHandle,!1).catch(a=>L(a,this.i3slayer.title)),this._visibleGeometryChanged(i,T.REMOVE),this._labeler!=null&&this._labeler.removeNodeMeta(i),s.delete(e),this._highlights.objectDeleted(i),s===this._nodeId2Meta?(this._cacheGPUData(i,t),this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopNodeFading(i)):this._deleteComponentObject(i),this._treeDebugger!=null&&this._treeDebugger.update()):s.delete(e)}_deleteComponentObject(e){if(this._edgeView!=null&&this._edgeView.removeObject(e.objectHandle),this._memEstimateGeometryRemoved(e.objectHandle),this._collection.destroyObject(e.objectHandle),e.textures)for(const t of e.textures)this._memEstimateTextureRemoved(t),this._stage.remove(t)}updateNodeState(e,t){const s=this._nodeId2Meta.get(e);s!=null&&this._collection.updateMaterial(s.objectHandle,i=>i.polygonOffsetEnabled=t===Ti.Hole)}updateNodeIndex(e,t){if(this._nodeId2Meta.has(e)){const i=this._nodeId2Meta.get(e);this._nodeId2Meta.delete(e),this._nodeId2Meta.set(t,i),this.notifyChange("elevationRange")}const s=this._nodeId2MetaReloading.get(e);s&&(this._nodeId2MetaReloading.delete(e),this._nodeId2MetaReloading.set(t,s))}_invalidateAllSymbols(){this._rendererVersion=Fe(this._rendererVersion,1),this._controller&&this._controller.requestUpdate()}_getInvalidRendererVersion(){return Fe(this._rendererVersion,-1)}async _rendererChange(e){if(this._currentRenderer=e,this.notifyChange("rendererTextureUsage"),this._rendererVersion=Fe(this._rendererVersion,1),this._rendererFields=null,this._colorVariable=null,this._opacityVariable=null,this._invalidateAllSymbols(),e&&(this._rendererFields=await e.getRequiredFields(this.i3slayer.fieldsIndex)),this._updateSymbologyFields(),!this._arcade&&e&&"arcadeRequired"in e&&e.arcadeRequired&&(this._arcade=await ri()),e&&"visualVariables"in e&&e.visualVariables)for(const t of e.visualVariables)t.type==="color"?this._colorVariable=t:t.type==="opacity"?this._opacityVariable=t:P.warn(`Unsupported visual variable type for 3D Object Scene Services: ${t.type}`);if(e)for(const t of e.getSymbols())t.type!=="mesh-3d"&&P.error(`Symbols of type '${t.type}' are not supported for 3D Object Scene Services.`);this._controller&&this._controller.requestUpdate()}_getCachedEdgeMaterials(e){return this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e),e.cachedEdgeMaterials}_getComponentParameters(e){this._hasComponentData&&e.cachedRendererVersion!==this._rendererVersion&&this._updateCachedRendererData(e);const t=e.cachedSymbology;return(s,i)=>{var o;const a=5*s;if(ai(i.externalColor,t[a]/255,t[a+1]/255,t[a+2]/255,t[a+3]/255),this._stage.renderView.objectAndLayerIdRenderHelper!=null){const h=e.featureIds[s],d=ni(this.view.map,this.layerUid);this._stage.renderView.objectAndLayerIdRenderHelper.setUidToObjectAndLayerId(h,h,this.layerId,this.layerUid+"_"+this.sublayerId,this.layerPopupEnabledAndHasTemplate&&!d,e.node.resources.attributes,s,this.sublayerId),i.objectAndLayerIdColor=this._stage.renderView.getObjectAndLayerIdColor({graphicUid:h,layerUid:this.layerUid+"_"+this.sublayerId})}i.externalColorMixMode=t[a+4]&(1<0?this._rendererFields!=null&&this._rendererFields.length>0?di(this.i3slayer.fieldsIndex,[...this._rendererFields,...this._symbologyOverrideFields]):this._symbologyOverrideFields:this._rendererFields}_updateCachedRendererData(e){var S;if(e.cachedRendererVersion=this._rendererVersion,!this._hasComponentData)return;const t=this._tmpAttributeOnlyGraphic,s={};t.attributes=s;const i=this._currentRenderer,a=(S=e.attributeInfo)==null?void 0:S.attributeData,o=e.featureIds!=null?this.i3slayer.objectIdField:null,h=a!=null&&this._symbologyFields!=null&&this._symbologyFields.length>0;let d=null,c=null;if(h&&this._symbologyFields!=null){d=[],c=[];for(const y of this._symbologyFields){const I=a[y];I&&(d.push(y),c.push(I))}}e.cachedSymbology||(e.cachedSymbology=Pi(5*e.featureIds.length));const l={color:ie,castShadows:!0,pickable:!0,colorMixMode:ce.Multiply,edgeMaterial:null},u=this.fullOpacity,g=this.nodeCrossfadingEnabled?this.getNodeOpacity(e):u;let f=null,v=ue.OPAQUE,M=Z,w=0;for(let y=0;y=1&&(e.material.isOpaque||l.colorMixMode===ce.Replace)?ue.OPAQUE:ue.TRANSPARENT;l.edgeMaterial===f&&C===v||(M={...l.edgeMaterial,opacity:g,objectTransparency:C},f=l.edgeMaterial,v=C),e.cachedEdgeMaterials[y]=M}else e.cachedEdgeMaterials[y]=Z;e.cachedSymbology[w++]=Math.round(255*b[0]),e.cachedSymbology[w++]=Math.round(255*b[1]),e.cachedSymbology[w++]=Math.round(255*b[2]),e.cachedSymbology[w++]=Math.round(255*b[3]),e.cachedSymbology[w++]=l.colorMixMode|+l.castShadows<h!==Z),perFeatureEdgeMaterials:t};let i=0,a=!1;const o=t.map((h,d)=>e.featureIds[d]!==s[i]?Z:(a=a||h!==Z,i++,h));return{hasEdges:a,perFeatureEdgeMaterials:o}}_updateComponentData(e){if(!this._hasComponentData)return;const t=e.objectHandle,s=this._getComponentParameters(e);this._collection.setComponentData(t,s),this._stage.renderView.requestRender()}_reloadAll(e=this.elevationOffset){this._removeAllNodeDataFromStage(e),this._controller!=null&&this._controller.restartNodeLoading()}_opacityChange(e){this.nodeCrossfadingEnabled&&this._crossfadeHelper.stopAllNodeFading(),this._nodeId2Meta.forEach(t=>{t!=null&&(this._collection.updateMaterial(t.objectHandle,s=>s.objectOpacity=e),re(t.cachedEdgeMaterials,e),this._updateEdgeRendering(t))})}_updateMaterial(e){this._collection.updateMaterial(e.objectHandle,t=>{t.commonMaterialParameters.hasSlicePlane=this.slicePlaneEnabled,t.usePBR=this._usePBR,this._updateMaterialOverlay(t)})}_updateMaterialOverlay(e){}_updateEngineObject(e){this._updateComponentData(e),this._applyFiltersToNode(e),this._addOrUpdateEdgeRendering(e),this._visibleGeometryChanged(e,T.UPDATE)}_slicePlaneEnabledChange(e){this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e),this._labeler!=null&&(this._labeler.slicePlaneEnabled=e),this._nodeId2Meta.forEach(t=>{t!=null&&(this._collection.updateMaterial(t.objectHandle,s=>s.commonMaterialParameters.hasSlicePlane=e),this._updateEdgeRendering(t,!1))})}_updatePBR(e){this._nodeId2Meta.forEach(t=>{t!=null&&this._collection.updateMaterial(t.objectHandle,s=>s.usePBR=e)}),this._hasLoadedPBRTextures=!0}get _usePBR(){return!this._isIntegratedMesh&&this.view.qualitySettings.physicallyBasedRenderingEnabled}_updateEdgeRendering(e,t=!0){this._edgeView!=null&&this._edgeView.hasObject(e.objectHandle)&&this._addOrUpdateEdgeRendering(e,t)}_forAllNodes(e){this._nodeId2Meta.forEach(e)}_ignoreClientNodeOverriddenFeatures(e){return this.i3sOverrides.hasGeometryChanges?(t,s,i)=>i.node.index>=0&&this.i3sOverrides.featureHasGeometryChanges(t)?x.CONTINUE:e(t,s,i):e}_forAllFeatures(e,t,s){be(this._nodeId2Meta,i=>{if(i==null)return!1;if(t!=null)switch(t(i)){case x.EXIT:return!0;case x.SKIP:return!1}let a=x.CONTINUE;switch(s){case q.ALL:a=this._forAllFeaturesOfNode(i,e);break;case q.VISIBLE_ONLY:a=this._forAllVisibleFeaturesOfNode(i,e);break;case q.QUERYABLE:a=this._forAllQueryableFeaturesOfNode(i,e)}return a===x.EXIT})}_forAllFeaturesOfNode(e,t){let s=x.CONTINUE;const i=e.featureIds;for(let a=0;a(s=t(i[a],a,e),s===x.CONTINUE)),s}_forAllQueryableFeaturesOfNode(e,t){const s=this._ignoreClientNodeOverriddenFeatures(t);if(this._renderClippingArea==null)return this._forAllFeaturesOfNode(e,s);const i=this._boundingRectNodeTest(e,this._renderClippingArea);if(i===he.OUTSIDE)return x.CONTINUE;if(i===he.INSIDE)return this._forAllFeaturesOfNode(e,s);const a=x.CONTINUE,o=e.featureIds,h=e.objectHandle,d=ui(this._renderClippingArea,this._collection.getObjectTransform(h));for(let c=0;c0){if(e[0]instanceof le){const t=e,s=this.i3slayer.fieldsIndex,i=this._getObjectIdField(),a=t.map(d=>Te(s,d.attributes,i)),{set:o,handle:h}=this._highlights.acquireSet();return this._highlights.setFeatureIds(o,a),h}if(typeof e[0]=="number"){const t=e,{set:s,handle:i}=this._highlights.acquireSet();return this._highlights.setFeatureIds(s,t),i}}return Et()}resetHighlights(){A(this._highlights),this._highlights=new zi({collection:this._collection,forAllFeatures:e=>this._forAllFeatures(e,null,q.ALL),forAllFeaturesOfNode:(e,t)=>this._forAllFeaturesOfNode(e,t)})}_visibleGeometryChanged(e,t){this._elevationProvider&&(this._elevationProvider.objectChanged(e.node),this._visibleGeometryChangedSchedulerHandle==null&&(this._visibleGeometryChangedSchedulerHandle=gi(()=>{this.emit("visible-geometry-changed"),this._visibleGeometryChangedSchedulerHandle=null})),this._updateSnappingSources(e,t))}get performanceInfo(){const e={displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null,index:0,nodes:this._nodeId2Meta.size,"Total GPU Memory Estimate":(this._gpuMemoryEstimate/1048576).toFixed(1)+"MB","Geometry Memory Estimate":(this._geoMemoryEstimate/1048576).toFixed(1)+"MB","Texture Memory Estimate":(this._texMemoryEstimate/1048576).toFixed(1)+"MB","Unloaded Memory Estimate":(this.unloadedMemory/1048576).toFixed(1)+"MB"};return this._memCache!=null&&(e.MemCache=Math.round(100*this._memCache.hitRate)+"% hit"),this._controller&&(this._idbCacheEnabled&&(e.IDBCache=Math.round(100*this._idbCache.getHitRate())+"% hit"),this._controller.updateStats(e)),e}get test(){const e=this,t=s=>{this._nodeColorOverride=s,this._invalidateAllSymbols()};return{controller:this._controller,labeler:this._labeler,get visibleObjectIds(){const s=[];return e._forAllFeatures(i=>(s.push(i),x.CONTINUE),null,q.VISIBLE_ONLY),s.sort((i,a)=>i-a),s},get numNodes(){return e._nodeId2Meta.size},get loadedNodes(){return Array.from(e._nodeId2Meta.keys()).sort((s,i)=>s-i)},setNodeColorOverride:t,setNodeColoring:s=>{t(s==="client-nodes"?(i,a)=>{i.index<0?(a[0]=1,a[1]=0,a[2]=0):(a[0]=1,a[1]=1,a[2]=1)}:null)}}}getNodeOpacityByIndex(e){const t=this._nodeId2Meta.get(e);return this.getNodeOpacity(t)}getNodeOpacity(e){return e!=null?this._collection.getMaterial(e.objectHandle).objectOpacity:0}isNodeFullyFadedIn(e){return this._crossfadeHelper.isNodeFullyFadedIn(e)}getNodeCrossfadeMetaData(e){return this._nodeId2Meta.get(e)}markNodeToRemove(e){this._controller&&this._controller.markNodeToRemove(e)}removeMarkedNodes(){this._controller&&this._controller.removeMarkedNodes()}foreachCrossfadeNode(e){this._nodeId2Meta.forEach((t,s)=>e(s,t))}fadeNode(e,t,s){if(!this.nodeCrossfadingEnabled)return;const i=this._nodeId2Meta.get(e);i!=null&&this._crossfadeHelper.fadeNode(e,i,t,s)}setNodeOpacityByIndex(e,t){const s=this._nodeId2Meta.get(e);s!=null&&this._setNodeOpacity(s,t)}_setNodeOpacity(e,t){this._collection.updateMaterial(e.objectHandle,s=>s.objectOpacity=t),this._setNodeEdgeOpacity(e,t)}_setNodeEdgeOpacity(e,t){if(this._edgeView==null||!e.cachedEdgeMaterials)return;re(e.cachedEdgeMaterials,t);const s=e.objectHandle;this._edgeView.hasObject(s)&&this._edgeView.updateAllComponentOpacities(s,t).catch(i=>L(i,this.i3slayer.title))}get hasModifications(){return this._isIntegratedMesh&&this._layerClippingArea!=null||this._modifications&&this._modifications.length>0}updateNodeModificationStatus(e){const t=e.length;if(!this.hasModifications||t<=0||this._i3sWasmLoaded!==!0)return;const s=this.uid,i=hr(e);if(i!=null){const a={context:s,buffer:i.buffer};Ai(a);const o=new Float64Array(i.buffer);e.forAll((h,d)=>{const c=o[d],l=Fi(c);h.imModificationImpact=l,l!==nt.Unmodified&&this._controller.invalidateGeometryVisibility(h.index)})}}notifyUpdate(){this.notifyChange("updating")}notifyLODUpdate(){this._controller.notifyLODUpdate()}isUpdating(){var e;return!(!this._controller||!this._controller.updating)||!!this._visibleGeometryChangedSchedulerHandle||this._labeler!=null&&this._labeler.updating||((e=this._crossfadeHelper)==null?void 0:e.updating)||this._i3sWasmLoaded instanceof Promise||this._asyncModuleLoading>0||this._elevationTask!=null&&this._elevationTask.running}trackSnappingSources(e){const t={events:e,fetchEdgeLocations:async(s,i,a)=>{const o=this._nodeId2Meta.get(s);if(o==null)throw new Error("invalid-node");const{origin:h,buffer:d}=await this._collection.extractEdgeInformation(o.objectHandle,i,a);return this._snappingLocationsApplyElevation(o,d,h),{type:"components",objectIds:o.featureIds,locations:d,origin:h}},remove:()=>{Ot(this._snappingSourcesTrackers,t)}};return this._snappingSourcesTrackers.push(t),this._nodeId2Meta.forEach((s,i)=>{if(s==null)return;const a=this._controller.getRenderMbs(s.node);a!=null&&e.add(i,a)}),t}_snappingLocationsApplyElevation(e,t,s){if(!e.elevationOffsets||this.elevationInfo.mode===R.Absolute)return;const i=t.position0,a=t.position1,o=t.componentIndex,h=G(),d=G(),c=(l,u)=>{ae(l,l,s),this.view.renderCoordsHelper.worldUpAtPosition(l,d),ae(l,l,mi(d,d,u)),fi(l,l,s)};for(let l=0;l=0||r&&r.metallicRoughnessTextureId>=0||n.normalTextureId>=0||n.emissiveTextureId>=0||n.occlusionTextureId>=0}function dr(n){return"geometryData"in n}function mt(n){return n!=null&&Tt(n.data)}function ft(n,r){let e=1024+n.interleavedVertexData.byteLength+(n.indices?n.indices.byteLength:0)+n.positionData.data.byteLength+n.positionData.indices.byteLength;if(r!=null)for(const t of r)t!=null&&Tt(t.data)&&(e+=t.data.byteLength);return e}function yt(n,r){return r.byteSize>ar?(P.warn(`Node is too big to store in IndexedDB cache: ${n.id} (${r.byteSize} bytes)`),!1):r.byteSize>0}function hr(n){if(n.length===0)return null;const r=10*n.length,e=new Float64Array(r);return n.forAll((t,s)=>{let i=t.serviceObb;i==null&&(i=or,pi(i.center,t.mbs),i.halfSize[0]=i.halfSize[1]=i.halfSize[2]=t.mbs[3]);const a=10*s;e[a]=i.center[0],e[a+1]=i.center[1],e[a+2]=i.center[2],e[a+3]=i.halfSize[0],e[a+4]=i.halfSize[1],e[a+5]=i.halfSize[2],e[a+6]=i.quaternion[0],e[a+7]=i.quaternion[1],e[a+8]=i.quaternion[2],e[a+9]=i.quaternion[3]}),e}function re(n,r){n.forEach(e=>e.opacity=r)}var R;(function(n){n[n.Absolute=0]="Absolute",n[n.RelativeToGround=1]="RelativeToGround",n[n.OnTheGround=2]="OnTheGround"})(R||(R={}));const cr=G(),bt=Ie(),vt="elevation-change";function ur(n){return r=>{if(n.immediate)return n.immediate.schedule(r);throw console.error("Error no immediate schudler"),new Error("cant find immediate scheduler")}}export{Nr as E,x as I,q as a,vr as c}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/I3STreeDebugger-tPVEJfH8.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/TileTreeDebugger-2DVbY5sQ.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/I3SNode-5SPByfpU.js b/dist/assets/I3SNode-5SPByfpU.js new file mode 100644 index 0000000..4e892f4 --- /dev/null +++ b/dist/assets/I3SNode-5SPByfpU.js @@ -0,0 +1 @@ +import{fm as v}from"./index-J0iiHjMT.js";class N{constructor(i,t){this.id=i,this.mbs=t,this.renderMbs=v(0,0,0,-1),this.elevationRangeMin=NaN,this.elevationRangeMax=NaN}invalidateElevationRange(){this.elevationRangeMin=NaN}}var d,a,s,h,c;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(d||(d={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(a||(a={}));class U extends N{constructor(i,t,n,o,r,l,m,u,f,C){super(i,n),this.index=t,this.childCount=o,this.level=r,this.resources=l,this.version=m,this.lodMetric=u,this.maxError=f,this.numFeatures=C,this.failed=!1,this.cacheState=s.Unknown,this.vertexCount=0,this.memory=0,this.childrenLoaded=0,this.hasModifications=!1,this.imModificationImpact=a.NotChecked}}(function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"})(s||(s={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(h||(h={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(c||(c={}));class k{constructor(i,t,n,o){this.nodeHasLOD=i,this.isChosen=t,this.lodLevel=n,this.version=o}}export{h as a,k as d,U as h,N as i,a as n,s as o,c as s,d as t}; diff --git a/dist/assets/I3SOverrides-5dCbMm3h.js b/dist/assets/I3SOverrides-5dCbMm3h.js new file mode 100644 index 0000000..4c45982 --- /dev/null +++ b/dist/assets/I3SOverrides-5dCbMm3h.js @@ -0,0 +1 @@ +import{tc as Gt,td as kt,te as Ut,sv as k,tf as Me,tg as jt,mL as et,aa as Y,pl as qt,th as Pt,ab as Oe,ti as fe,i2 as A,tj as tt,E as q,tk as Bt,tl as Ht,iZ as Mt,s as zt,tm as Qt,aq as Jt,qI as Kt,mY as Wt,p5 as Xt,tn as Zt,fB as Yt,e as x,y as v,c as Xe,p as Ze,gK as ei,ai as ti,a2 as Ot,cd as T,to as ee,f as ie,sV as it,fm as ii,aQ as te,tp as B,tq as se,tr as st,ts as si,kd as be,t2 as Lt,fx as ni,tt as nt,tu as ae,fA as Se,tv as ze,bm as Rt,tw as At,fz as ri,tx as Le,ty as ai,dJ as Ye,fF as oi,dQ as li,jR as Ie,tz as Re,tA as di,f5 as rt,bI as hi,tB as ui,tC as ci,tD as _i,sG as at,bB as Ft,tE as gi,mJ as mi,bq as fi,tF as pi,i9 as bi,tG as yi,sE as xi,b5 as vi,bp as ot,sC as lt,tH as dt,tI as Ni,tJ as ht,tK as Ci,tL as Ii,t0 as wi,t1 as Si,av as ut,az as le,au as de,ax as Ae,cP as Di,aU as Fe,at as Pi,cs as Mi,Z as Qe,cZ as Oi,tM as ct,tN as Li,fU as Ri,tO as Ai,d as R,P as Je,C as Fi,tP as Ei,ae as Et,sf as Ti,q5 as _t,tQ as $i,tR as Vi,tS as gt,tT as Gi,tU as mt,re as ki,ov as Ui,V as ft,fn as Ee,n as ji,a as qi,fT as Bi,gG as Hi,d8 as zi,tV as Qi,tW as Ji,nS as Ki,nT as Wi,tX as Xi,tY as Zi,bW as Yi,tZ as es,bH as ts}from"./index-J0iiHjMT.js";import{a as L,i as ye,h as pt,t as ge,n as he,d as is,s as ne,o as ue}from"./I3SNode-5SPByfpU.js";import{s as bt}from"./ReactiveSet-HLstcUcf.js";import{assetMapFromAssetMapsJSON as ss,extractMesh as ns}from"./meshFeatureSet-Mcou8mDC.js";import rs from"./FeatureLayerView3D-t6NDkLO0.js";function me(i,e,t,s){if(e==null||s==null)return!1;const n=kt(e,s,as);if(n.projector===Ut)return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],!0;if(n.projector==null)return!1;const{source:r,dest:a}=n;if(a.spatialReferenceId===k.WEB_MERCATOR){const o=Me[r.spatialReferenceId][k.WGS84];return o!=null&&(o(i,0,Te,0),jt(Te,0,t,0),t[3]=yt(Te[1],i[2],i[3],et.radius),!0)}if(r.spatialReferenceId!==k.WGS84&&r.spatialReferenceId!==k.CGCS2000||a.spatialReferenceId!==k.PLATE_CARREE){n.projector(i,0,t,0);const o=r.metersPerUnit??1,l=a.metersPerUnit??1;t[3]=i[3]*o/l}else{const o=Me[r.spatialReferenceId][k.SPHERICAL_ECEF],l=Me[k.SPHERICAL_ECEF][k.PLATE_CARREE];let d=i[3];o!=null&&l!=null&&(d=yt(i[1],i[2],i[3],et.radius)),n.projector(i,0,t,0),t[3]=d}return!0}function yt(i,e,t,s){const n=s+e;if(nn)return Number.MAX_VALUE;const r=Math.abs(os*i)+Math.asin(t/n);return r>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(r)}const Te=Y(),as=Gt(),os=qt(1);var C,w;(function(i){i[i.KTX2=1]="KTX2",i[i.Basis=2]="Basis",i[i.DDS_S3TC=4]="DDS_S3TC",i[i.PNG=8]="PNG",i[i.JPG=16]="JPG",i[i.KTX_ETC2=32]="KTX_ETC2"})(C||(C={})),function(i){i[i.None=0]="None",i[i.Color=1]="Color",i[i.MetallicRoughness=2]="MetallicRoughness",i[i.Normal=4]="Normal",i[i.Occlusion=8]="Occlusion",i[i.Emissive=16]="Emissive",i[i.AlphaMask=32]="AlphaMask",i[i.ColorTextures=19]="ColorTextures",i[i.GeometryTextures=36]="GeometryTextures",i[i.GeometryTexturesPBR=44]="GeometryTexturesPBR",i[i.AllTextures=37]="AllTextures",i[i.AllTexturesPBR=63]="AllTexturesPBR"}(w||(w={}));async function ls(i){const e=[],t=[];if(i==null)return{material:{alphaMode:"opaque",alphaCutoff:.1,doubleSided:!0,cullFace:0,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[1,1,1,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6000000238418579},wrapTextures:!1,hasParametersFromSource:!0},requiredTextures:e,textureData:t};const s=ds(i);i.alphaMode==="auto"&&console.warn('alphaMode "auto" not supported by I3S PBRMaterial - defaulting to "blend".');const n=Pt({normalTexture:i.normalTexture,emissiveTexture:s?i.emissiveTexture:null,emissiveFactor:s?Oe.toUnitRGB(i.emissiveColor):null,occlusionTexture:s?i.occlusionTexture:null,metallicRoughnessTexture:s?i.metallicRoughnessTexture:null,metallicFactor:s?i.metallic:null,roughnessFactor:s?i.roughness:null}),r=n?fe[0]:s?i.metallic:0,a=n?fe[1]:s?i.roughness:0;return{material:{alphaMode:i.alphaMode==="auto"?"blend":i.alphaMode,alphaCutoff:i.alphaCutoff,doubleSided:i.doubleSided,cullFace:i.doubleSided?A.None:A.Back,normalTextureId:await ce(i.normalTexture,e,t,w.Normal),emissiveTextureId:s?await ce(i.emissiveTexture,e,t,w.Emissive):-1,occlusionTextureId:s?await ce(i.occlusionTexture,e,t,w.Occlusion):-1,emissiveFactor:s&&i.emissiveColor!=null?Oe.toUnitRGB(i.emissiveColor):[0,0,0],metallicRoughness:{baseColorFactor:i.color!=null?Oe.toUnitRGBA(i.color):[1,1,1,1],baseColorTextureId:await ce(i.colorTexture,e,t,w.Color),metallicRoughnessTextureId:s?await ce(i.metallicRoughnessTexture,e,t,w.MetallicRoughness):-1,metallicFactor:r,roughnessFactor:a},wrapTextures:!0,hasParametersFromSource:n},requiredTextures:e,textureData:t}}async function ce(i,e,t,s){if(i==null)return-1;const n=t.length,r=i.data,a=i.url;if(r!=null){if(r instanceof HTMLImageElement||r instanceof HTMLCanvasElement){const o=tt(r);return t.push({id:n,usage:s,data:o,encoding:C.PNG,downsampled:!1}),e.push({id:n,usage:s,encodings:[{name:void 0,encoding:C.PNG}]}),n}if(r instanceof HTMLVideoElement)return-1;if(r instanceof ImageData)throw new q("ImageData textures not supported yet for client side I3S nodes");if(r instanceof Bt)throw new q("EncodedMeshTexture textures not supported yet for client side I3S nodes")}else if(a!=null){const o=new Image;o.src=a;const l=await Ht(o,o.src,!1,void 0),d=tt(l);return t.push({id:n,usage:s,data:d,encoding:C.PNG,downsampled:!1}),e.push({id:n,usage:s,encodings:[{name:void 0,encoding:C.PNG}]}),n}return-1}function ds(i){return i.hasOwnProperty("metallicRoughnessTexture")}let hs=class{constructor(e,t,s,n){this._uid=e,this._worker=n,this._id2Meta=new Map,this._oid2Meta=new Map,this._indexSR=t.indexSR,this._vertexSR=t.vertexSR,this._renderSR=t.renderSR,this._localMode=t.localMode,this._memCache=s.newCache(`sl-client-mesh-data-${this._uid}`)}get uid(){return this._uid}get worker(){return this._worker}get indexSR(){return this._indexSR}get renderSR(){return this._renderSR}createMeshNodeInfo(e,t){const s=`mesh${t}`,n=e.extent,r=n.spatialReference,a=this._indexSR,o=us(n,e.origin);return me(o,r,o,a),{type:"mesh",id:s,version:gs(e),oid:t,mbs:o,componentNodeIds:[],unloadedMesh:e,nodeIndex:null,loadMeshPromise:null}}addMeshNode(e,t){if(this.getMeshNodeIndex(t.oid)!=null)throw new q(`I3SClientNodeLoader: client side mesh for feature oid=${t.oid} already exists`);t.nodeIndex=e,this._id2Meta.set(t.id,t),this._oid2Meta.set(t.oid,t)}getMeshNodeIndex(e){const t=this._oid2Meta.get(e);return t==null||t.type!=="mesh"?null:t.nodeIndex}removeNode(e){const t=this._id2Meta.get(e);t!=null&&(this._id2Meta.delete(e),t.type==="mesh"&&this._oid2Meta.delete(t.oid))}async loadNodeJSON(e){const t=this._id2Meta.get(e);if(t==null)throw new q(`I3SClientNodeLoader::loadNodeJSON unable to find node ${e}`);switch(t.type){case"mesh":return this._loadMeshNodeJSON(t);case"mesh-component":return this._loadMeshComponentNodeJSON(t);default:throw new q(`I3SClientNodeLoader::loadNodeJSON unable to handle node ${e}`)}}async _loadMeshNodeJSON(e){const t=e.id,s=(await this._getMeshData(e)).loadedMesh;if(s.components==null||s.components.length===0)return{id:t,version:null,mbs:e.mbs,obb:null,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:null};const n=[],r=s.components;for(let a=0;a{const o=e.unloadedMesh.clone();try{await o.load()}catch(c){a(c)}const l=o.memoryUsage,d={loadedMesh:o,projectionPromise:null,normalsTransformPromise:null,usedMemoryInBytes:l};this._memCache.put(t,d,l,Zt),e.loadMeshPromise=null,r(d)};return e.loadMeshPromise=new Promise((r,a)=>n(r,a)),e.loadMeshPromise}return s}};function us(i,e){const{spatialReference:t}=i,s=[1,-1],n=[.5*i.width,.5*i.height,i.hasZ?.5*(i.zmax-i.zmin):0],r=t.isGeographic?t.metersPerUnit:1,a=i.center;let o=0;if(i.hasZ)for(let l=0;l<2;++l)for(let d=0;d<2;++d)for(let c=0;c<2;++c){const h=(a.x+s[l]*n[0]-e.x)*r,u=(a.y+s[d]*n[1]-e.y)*r,_=a.z+s[c]*n[2]-e.z;o=Math.max(h*h+u*u+_*_,o)}else for(let l=0;l<2;++l)for(let d=0;d<2;++d){const c=(a.x+s[l]*n[0]-e.x)*r,h=(a.y+s[d]*n[1]-e.y)*r;o=Math.max(c*c+h*h,o)}return Qt([e.x,e.y,e.z],Math.sqrt(o))}async function cs(i,e,t,s){const{transform:n,vertexAttributes:r}=e.loadedMesh,a=i.shading==="source"?r.normal:null;if(!(a!=null&&n!=null&&(n.rotationAngle!==0||!Jt(n.scale,Kt))))return{transformed:a,original:r.normal};if(!e.normalsTransformPromise){Mt(t,"SceneLayerWorker is needed to transform mesh normals");const o=Yt();Wt(o,n.localMatrix),e.normalsTransformPromise=t.transformNormals({normalMatrix:o,normals:a},s)}return e.normalsTransformPromise}function _s(i,e,t,s,n,r){const o=e.length/3,l=3*o;let d=0,c=0,h=!1,u=0,_=!1,m=0,g=!1,p=0,b=0,f=0;d+=K,d+=K,c=d,d+=3*l*$e,t!=null&&(h=!0,u=d,d+=3*l*$e),s!=null&&(_=!0,m=d,d+=2*l*$e),n!=null&&(g=!0,p=d,d+=4*l*ms),b=d,d+=1*fs,f=d,d+=2*1*K;const y=new ArrayBuffer(d),N=new Uint8Array(y);J(N,0,l),J(N,K,1);const S=new Float32Array(y,c),I=t!=null?new Float32Array(y,u):null,M=s!=null?new Float32Array(y,m):null,F=n!=null?new Uint8Array(y,p):null;for(let $=0;$>8,i[e+2]=255&t>>16,i[e+3]=255&t>>24}function gs(i){var n;const e=(n=i.metadata.displaySource)==null?void 0:n.source;if(e==null||!Array.isArray(e)||!e.length||e[0]instanceof File)return Xt();const t=e;let s="";for(const r of t)s+=r.makeHash();return s+JSON.stringify(i.transform!=null?i.transform.toJSON():"")+(i.vertexSpace.isRelative?JSON.stringify(i.vertexSpace.origin):"")}const K=4,$e=4,ms=1,fs=8;let we=class extends Ze{constructor(){super(),this.referenceCount=0,this.callbacks=new Array,this.runIndex=0}get running(){return this.callbacks.some(e=>e.running)}runTask(e){this._sort();const t=this.callbacks,s={numIndexLoading:0,numNodesLoading:0};for(let n=0;n0;s--){const n=e[s-1];let r=s;for(;r{t!=null&&(t.task.remove(e),t.task.callbacks.length>0||(Ve.delete(i),t.handle.remove(),t.task.destroy()),t=null)})}function oe(i,e,t){i&&(typeof e=="number"?(i.elevationRangeMin=Math.min(i.elevationRangeMin,e),i.elevationRangeMax=Math.max(i.elevationRangeMax,t)):(i.elevationRangeMin=Math.min(i.elevationRangeMin,e.elevationRangeMin),i.elevationRangeMax=Math.max(i.elevationRangeMax,e.elevationRangeMax)))}let Ge=class{constructor(e,t,s,n,r){this.childOffset=e,this.childCount=t,this.visibilityCache=s,this.ref=n,this.node=r,this.useAsHole=0,this.filterImpact=ge.NotChecked,this.traversalState=null,this.parent=-1}},ke=class{constructor(e=[],t=[]){this.nodes=e,this.children=t,this.lastTraversed=0,this.numNodesWithLoadedChildren=0}},ys=class{get _useNodePages(){return this._pageSize>0}constructor(e,t,s,n,r,a,o,l,d,c,h,u,_,m,g){var p,b;this._layer=e,this._streamDataController=s,this._clientNodeLoader=n,this._viewportQueries=r,this._logger=a,this.holeFilling=o,this._isLoaded=l,this._isReloading=d,this._isSelected=c,this._enable=h,this._needsUpdate=u,this._canRequest=_,this._computeVisibilityObb=m,this._computeNodeFiltering=g,this._dirty=!0,this._nodePages=new Map,this._clientNodePage=null,this._pageSize=0,this._rootIndex=0,this._lodMetric=L.None,this._lodConversion=f=>f,this._isEditable=!1,this._urlPrefix="",this._loadingNodes=new Set,this._loadingPages=new Set,this._failedNodes=new Set,this._failedPages=new Set,this._indexMissing=1,this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.POSITIVE_INFINITY,this._version=W(0),this._visibilityCacheVersion=W(0),this._maxLevel=1,this._featureEstimate={estimate:0,leavesReached:!1},this._unloadedMemoryEstimate=0,this._missingPagesAndNodes=new T({deallocator:null}),this._prefetchNodes=new T({deallocator:null}),this._updates=new xs(this._missingPagesAndNodes),this._imModificationUncategorized=new T({deallocator:null}),this.ignoreServiceObb=!1,this.progressiveLoadPenalty=0,this._pageQueue=new Array,this._newPages=new Array,this.needNodeElevationRange=!1,this.layerHasModifications=!1,this._layerHasFilter=!1,this._frameNumber=0,this._isEditable=ee()&&((p=e.associatedLayer)==null?void 0:p.infoFor3D)!=null,(b=e.serviceUpdateTimeStamp)!=null&&b.lastUpdate&&(this._lastUpdate=`${e.serviceUpdateTimeStamp.lastUpdate}`),this._maxLodLevel=this._viewportQueries?this._viewportQueries.maxLodLevel:1,this._init(t)}_init(e){if(e.type==="page"){const t=e.rootPage;switch(this._urlPrefix=e.urlPrefix,this._pageSize=e.pageSize,e.lodMetric){case"maxScreenThreshold":this._lodMetric=L.MaxScreenThreshold;break;case"maxScreenThresholdSQ":this._lodMetric=L.MaxScreenThreshold,this._lodConversion=Cs}if(this._isEditable){this._rootIndex=-1;const s=E(e.rootIndex,e.pageSize),n=t.nodes[s],r={nodes:[{index:this._rootIndex,children:[e.rootIndex],mesh:void 0,obb:n.obb,lodThreshold:n.lodThreshold}]};this._addPage(X(this._rootIndex,this._pageSize),r),this.getNode(-1).serviceObb=void 0}else this._rootIndex=e.rootIndex;this._addPage(X(e.rootIndex,this._pageSize),t),this._updateParentsAndLevel()}else if(e.type==="node"){this._urlPrefix=e.urlPrefix;const t=new ke;if(this._nodePages.set(0,t),this._isEditable){this._clientNodePage=new ke;const n={id:"-1",version:null,mbs:e.rootNode.mbs,obb:e.rootNode.obb,sharedResource:null,geometryData:null,attributeData:null,featureData:null,children:[{id:"root",href:"../root",mbs:e.rootNode.mbs,obb:e.rootNode.obb}]};this._rootIndex=this._makeClientRefNode(new ye(n.id,null),-1);const r=this._validateNode(n.id,n);r&&this._addNode(r,this._rootIndex)}else this._rootIndex=this._makeRefNode(new ye(e.rootNode.id,null),-1);const s=this._validateNode(e.rootNode.id,e.rootNode);s&&this._addNode(s,0)}}addClientNodeToIndex(e,t){const n=new ye(e,t),r=this._makeClientRefNode(n,-1);return this._linkChildToParentNode(-1,r),this.requestUpdate(),r}removeClientNodeFromIndex(e,t,s){this._destroyClientRefNode(e,t,s),this.requestUpdate()}_loadPage(e){this._loadingPages.add(e);const t=this._urlPrefix+e;this._streamDataController.request(t,"json").then(s=>{this._pageQueue.push({pageIndex:e,page:s})}).catch(s=>{this._loadingPages.delete(e),ie(s)||(this._failedPages.add(e),this._logger.error("#loadPage()",this._layer,`Error when loading page ${e}`,s))})}_addQueuedPages(e){for(;this._pageQueue.length>0&&!e.done;){const{pageIndex:t,page:s}=this._pageQueue.shift();this._addPage(t,s),this._loadingPages.delete(t),e.madeProgress(),this.needNodeElevationRange&&this._newPages.push(t)}this._updateParentsAndLevel()}_invalidateElevationRangeForNewPages(e){if(this.needNodeElevationRange)for(;this._newPages.length>0&&!e.done;){const t=this._nodePages.get(this._newPages.shift());if(t==null)continue;const s=t.nodes;for(let n=0;n{var y,N,S;const d=s.length,c=o.children?o.children.length:0;n.push(this._rootIndex);for(let I=0;I{const a=this._getPage(s);if(a!=null){const o=E(s,this._pageSize),l=a.nodes[o];l.parent=n??-1;const d=l.node;d!=null&&(d.level=r,e.push(s))}};for(t(this._rootIndex,null,0);e.length;){const s=e.pop(),n=this.getNode(s);if(n!=null)for(let r=0;r=0)throw new Error("I3SIndex::client side nodes can not be made children of service side nodes.");const n=-(s.nodes.length+1),r=new Ge(0,0,xe(this._visibilityCacheVersion),e,null);return s.nodes.push(r),r.parent=t,B(e.renderMbs),se(e.serviceObbInRenderSR),n}_linkChildToParentNode(e,t){const s=this._clientNodePage;if(s==null||e>=0)return;const n=E(e,this._pageSize),r=E(t,this._pageSize),a=s.nodes[n],o=a.childOffset;s.children.splice(a.childOffset+a.childCount,0,t);const l=1;a.childCount+=l,a.node!=null&&(a.node.childCount+=l);for(const d of s.nodes)d.childOffset>o&&(d.childOffset+=l);s.nodes[r].parent=e,this._updateParentBoundingInformation(e)}_destroyClientRefNode(e,t,s){var m,g;const n=this._clientNodePage;if(n==null)return;const r=this.getParentIndex(e);if(r==null)return;const a=new Set,o=new Map,l=p=>{var N,S;const b=E(p,this._pageSize),f=n.nodes[b];if(f.childCount>0)for(let I=f.childOffset;I-1),u=[],_=[];for(let p=0;p=0)_.push(S);else{const I=E(S,this._pageSize),M=d[I];if(a.has(M))continue;const F=h[I];_.push(F),M.parent=b}}f.childOffset=y,f.childCount=_.length-y,f.node&&(f.node.childCount=f.childCount)}n.nodes=u,n.children=_,this._updateParentBoundingInformation(h[E(r,this._pageSize)])}_updateParentBoundingInformation(e){let t=e;do{let s=null;const n=this._clientNodeLoader.indexSR,r=this._clientNodeLoader.renderSR,a=this._getNodeInternal(t);if(a==null)return;for(let l=0;l0)if(s==null)s=st(h.mbs,Is);else{const u=ws,_=Ss,m=Ds;me(h.mbs,n,u,r),me(s,n,_,r),si(u,_,m),me(m,r,s,n)}}const o=a.ref||a.node;o!=null&&(s!=null?o.mbs=st(s,o.mbs!=null?o.mbs:be()):B(o.mbs),B(o.renderMbs),se(o.serviceObbInRenderSR),o.geometryObb=null),this.invalidateNodeVisibilityCacheInternal(a),t=this.getParentIndex(t)}while(t!=null)}populateChildren(e,t){const s=this._getNodeInternal(e),n=this._getPage(e);s.childOffset=n.children.length,s.childCount=t.length;for(let r=0;r{(s.node!=null&&s.node.id===e||s.ref!=null&&s.ref.id===e)&&(t=n)}),t}getNodeById(e){const t=this.getIndexById(e);return t!=null&&t>=0?this.getNode(t):null}getChildIndex(e,t){const s=this._getPage(e);if(s==null)return-1;const n=s.nodes[E(e,this._pageSize)];return s.children[n.childOffset+t]}getParentIndex(e){const t=this._getPage(e);return t!=null&&e!==this._rootIndex?t.nodes[E(e,this._pageSize)].parent:null}getParent(e){const t=this.getParentIndex(e);return t!=null?this.getNode(t):null}isLeaf(e){const t=this._getNodeInternal(e);return t!=null&&t.childCount===0}get rootNode(){return this.getNode(this._rootIndex)}get isEditable(){return this._isEditable}removeAllGeometryObbs(){this._forAllNodes(e=>{e.node!=null&&(e.node.geometryObb=null)})}invalidateVisibilityCache(){this._visibilityCacheVersion=W(this._visibilityCacheVersion)}invalidateNodeVisibilityCache(e){const t=this._getNodeInternal(e);t!=null&&this.invalidateNodeVisibilityCacheInternal(t)}invalidateNodeVisibilityCacheInternal(e){e.visibilityCache=xe(this._visibilityCacheVersion)}invalidateBoundingVolumeCache(e){const t=this._getNodeInternal(e);t!=null&&(xt(t),this.invalidateNodeVisibilityCacheInternal(t))}updateElevationChanged(e){const t=this._getNodeInternal(e);if(t==null)return;if(!this.needNodeElevationRange)return void this.invalidateBoundingVolumeCache(e);const s=t.node!=null?t.node:t.ref;s!=null&&s.invalidateElevationRange()}invalidateGeometryVisibility(e){const t=this._getNodeInternal(e);(t==null?void 0:t.node)!=null&&(t.node.geometryObb=null,B(t.node.renderMbs),se(t.node.serviceObbInRenderSR))}invalidateVisibilityObbs(){this.rootNode!=null&&this.traverse(this.rootNode,e=>(e.visibilityObb=this._computeVisibilityObb(e),e.geometryObb=null,!0))}_updateElevationRange(e){this._updateElevationRangeInternal(e,null)}_updateElevationRangeInternal(e,t){var d;const s=this._getNodeInternal(e);if(!s)return!1;const n=(s==null?void 0:s.node)??(s==null?void 0:s.ref);if(!n)return!1;const r=n.elevationRangeMin;if(!Number.isNaN(r))return oe(t,n),!0;const a={elevationRangeMin:1/0,elevationRangeMax:-1/0};let o=!1;for(let c=0;c{t!=null&&(t.imModificationImpact=he.NotChecked,t.visibilityObb=this._computeVisibilityObb(t),t.hasModifications&&this.invalidateGeometryVisibility(t.index))}),this.invalidateVisibilityCache()}layerFilterChanged(e){this._layerHasFilter=e,this._forAllNodes(t=>{if(t!=null){t.filterImpact=ge.NotChecked;const s=t.node;s!=null&&this.invalidateNodeVisibilityCache(s.index)}}),this.invalidateVisibilityCache()}update(e,t,s){if(!this._dirty)return;this._pageQueue.length>0&&this._addQueuedPages(t),this._invalidateElevationRangeForNewPages(t),this._maxUnloadedPrio=Number.NEGATIVE_INFINITY,this._maxProcessingPrio=Number.NEGATIVE_INFINITY,this._missingPagesAndNodes.clear(),this._prefetchNodes.clear(),this._updates.reset(e),O.clear();let n=!0;const r=new je,a=new je,o=this._imModificationUncategorized;o.clear();const l=new Set,d=(h,u,_)=>{const m=X(h,this._pageSize);if(l.add(m),u==null){let f=this._entryPriority(h);return f===1/0&&(f=this._entryPriority(_)),O.set(m,Math.max(f,O.get(m)||0)),this._loadingPages.has(m)||this._failedPages.has(m)||this._missingPagesAndNodes.push(m),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f))}const g=u.node;if(this._updateNodeFeatureEstimate(g,a),g==null){const f=this._entryPriority(h);return this._loadingNodes.has(h)||this._failedNodes.has(h)||(this._missingPagesAndNodes.push(h),O.set(h,f)),void(this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f))}const p=this._getPage(h);if(this._missingPagesAndNodes.length===0&&!this._useNodePages)for(let f=0;f0&&this._isSelected(g)&&(n=!1));if(this._isLoaded(h)){if(r.known+=g.memory,++r.knownNodes,this._isSelected(g)?u.childCount>0&&(n=!1):(r.unremoved+=g.memory,n=!1),this._needsUpdate(g)){const f=this._entryPriority(h);O.set(h,f),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,f),this._updates.update.push(h)}return}if(g.memory&&(r.known+=g.memory,++r.knownNodes),!this._isSelected(g))return void(this._isReloading(h)&&this._updates.remove.push(h));if(u.childCount>0&&(n=!1),g.memory?(r.missing+=g.memory,r.known+=g.memory,++r.knownNodes):++r.missingNodes,e.includes(g.index))return this._maxProcessingPrio=Math.max(this._maxProcessingPrio,this._entryPriority(h)),void(this._updates.cancel=this._updates.cancel.filter(f=>f!==g.index));if(!t.done&&this._enable(g))return void t.madeProgress();const b=this._entryPriority(h);O.set(h,b),this._maxProcessingPrio=Math.max(this._maxProcessingPrio,b),this._updates.add.push(h),this.layerHasModifications&&s&&g!=null&&g.imModificationImpact===he.NotChecked&&o.push(h)};this.traverseVisible(d),this._frameNumber++,this._missingPagesAndNodes.sort((h,u)=>h-u),this._missingPagesAndNodes.filterInPlace((h,u)=>u<1||this._missingPagesAndNodes.data[u-1]!==h),this._missingPagesAndNodes.sort((h,u)=>O.get(h)-O.get(u)),this._missingPagesAndNodes.length>0&&(this._maxUnloadedPrio=O.get(this._missingPagesAndNodes.back()),this._prefetchNodes.clear());const c=this._updates.add;c.length>0&&this.layerHasModifications&&(o.length>0&&(s==null||s(o)),c.filterInPlace(h=>{const u=this._getNodeInternal(h),_=(u==null?void 0:u.node)==null||u.node.imModificationImpact!==he.Culled;return _||this.invalidateNodeVisibilityCache(h),_})),this._unloadedMemoryEstimate=r.missing-r.unremoved,r.knownNodes>3&&r.missingNodes>0&&(this._unloadedMemoryEstimate+=r.known/r.knownNodes*r.missingNodes),this._unloadedMemoryEstimate=.8*Math.max(0,this._unloadedMemoryEstimate),this._featureEstimate.estimate=this._computeFeatureEstimate(a),this._featureEstimate.leavesReached=n,this._updates.add.filterInPlace(h=>O.get(h)>=this._maxUnloadedPrio).sort((h,u)=>O.get(h)-O.get(u)),this._updates.update.sort((h,u)=>O.get(h)-O.get(u)),this._indexMissing=this._loadingPages.size+this._loadingNodes.size+this._missingPagesAndNodes.length,this._dirty=this._indexMissing>0,O.clear()}checkFeatureTarget(e,t){const s=this._viewportQueries.updateScreenSpaceErrorBias(t);let n=t,r=t,a=s,o=10;for(;o--;){const l=new je;if(this._updateFeatureEstimate(n,l),this._computeFeatureEstimate(l)<=e){if(n>=t||l.missingNodes>0||o===0)break;a=n,n=.5*(n+r)}else r=n,n=.5*(n+a)}return this._version=W(this._version),this._viewportQueries.updateScreenSpaceErrorBias(s),Math.min(t,n)}_updateFeatureEstimate(e,t){this._version=W(this._version),this._viewportQueries.updateScreenSpaceErrorBias(e),this.traverseVisible((s,n)=>this._updateNodeFeatureEstimate(n!=null?n.node:void 0,t))}_updateNodeFeatureEstimate(e,t){e==null||e.failed||e.numFeatures==null||this._isSelected(e)&&(e.numFeatures!=null?(t.missing+=e.numFeatures,t.known+=e.numFeatures,++t.knownNodes):++t.missingNodes)}_computeFeatureEstimate(e){let t=e.known-e.unremoved;return e.knownNodes>3&&e.missingNodes>0&&(t+=e.known/e.knownNodes*e.missingNodes),Math.max(0,t)}load(){return this._load(this._missingPagesAndNodes)}prefetch(){return this._prefetchNodes.sort((e,t)=>O.get(e)-O.get(t)),this._load(this._prefetchNodes)}_load(e){if(e.length===0||!this._canRequest())return!1;for(;e.length>0&&this._canRequest();){const t=e.pop();this._useNodePages&&t>=0?this._loadPage(t):this._loadNode(t)}return!0}get isLoading(){return this._indexMissing>0}get isPrefetching(){return this._prefetchNodes.length>0}get indexLoading(){return this._loadingPages.size+this._loadingNodes.size}get indexMissing(){return this._indexMissing}get unloadedMemoryEstimate(){return this._unloadedMemoryEstimate}get updates(){return this._updates}get featureEstimate(){return this._featureEstimate}get maxPriority(){return Math.max(this._maxProcessingPrio,this._maxUnloadedPrio)}nodeTraversalState(e){if(e==null)return null;const t=e.index,s=this._getNodeInternal(t);if(!s)return null;let n=s==null?void 0:s.traversalState;if(n&&Ue(n.version,this._version))return n;const r=this._viewportQueries.getLodLevel(e),a=this._viewportQueries.hasLOD(e);let o=!0;if(a){const l=this.getParentIndex(t);if(l!=null){const d=this._getNodeInternal(l),c=d==null?void 0:d.traversalState;o=!!c&&r>c.lodLevel}else o=r>0}else o=e.childCount===0;return n?(n.lodLevel=r,n.isChosen=o,n.version=ve(!0,this._version),n):(n=new is(a,o,r,ve(!0,this._version)),s.traversalState=n,n)}async _loadNode(e){this._loadingNodes.add(e);const t=this._getNodeInternal(e).ref;if(t==null)return void this._failedNodes.add(e);const s=t.id,n=this._urlPrefix+s,r=()=>{this._loadingNodes.delete(e),this._missingPagesAndNodes.length===0&&this._loadingNodes.size===0&&this.requestUpdate()};let a=null;try{a=e>=0?await this._streamDataController.request(n,"json"):await this._clientNodeLoader.loadNodeJSON(s)}catch(d){return r(),void(ie(d)||(this._logger.error("#loadNode()",this._layer,"Error loading node: "+n),this._failedNodes.add(e)))}r();const o=this._validateNode(s,a);if(o==null)return;o.obb&&this.invalidateNodeVisibilityCache(e);const l=this._addNode(o,e);this.nodeTraversalState(l)}_validateNode(e,t){var u;if(t==null||typeof t!="object"||t.id!==e)return this._logger.error("#validateNode()",this._layer,`Invalid node. Wrong type or wrong id "${e}"`),null;if(!Array.isArray(t.mbs))return this._logger.error("#validateNode()",this._layer,`Invalid bounding volume on node ${e}.`),null;t.sharedResource&&t.sharedResource.href!=="./shared"&&t.sharedResource.href!=="./shared/"&&this._logger.warn("#validateNode()",this._layer,`Invalid shared resource href on node "${e}"`);const s=t.geometryData;s==null||Array.isArray(s)&&s.length===0||Array.isArray(s)&&s.length===1&&s[0].href==="./geometries/0"||this._logger.warn("#validateNode()",this._layer,`Invalid geometry data on node "${e}"`);const n=t.attributeData,r=this._layer.attributeStorageInfo;n==null||Array.isArray(n)&&!n.some((_,m)=>{var g;return _.href!==`./attributes/${((g=r==null?void 0:r[m])==null?void 0:g.key)??`f_${m}`}/0`})||this._logger.warn("#validateNode()",this._layer,`Invalid attribute data on node "${e}"`),t.featureData&&t.featureData.length>1&&this._logger.warn("#validateNode()",this._layer,`Node ${e} has ${t.featureData.length} bundles. Only the first bundle will be loaded.`);const a=t.hasOwnProperty("obb")&&!this.ignoreServiceObb?t.obb:null,o=t.featureData&&t.featureData.length===1&&t.featureData[0].featureRange?t.featureData[0].featureRange[1]-t.featureData[0].featureRange[0]+1:void 0,l=_=>{if(_==null)return null;const m=b=>this._logger.error("#validateNode()",this._layer,`Invalid node reference on node ${e}: ${b}`);if(typeof _.id=="number")m(`id ${_.id} is a number instead of a string.`);else if(typeof _.id!="string"||!Array.isArray(_.mbs))return m("Missing or invalid id."),null;if(!Array.isArray(_.mbs))return m(`Invalid bounding volume on reference ${_.id}.`),null;_.href&&_.href!=="../"+_.id&&this._logger.error("#validateNode()",this._layer,`Invalid node href on node "${e}"`);const g=_.hasOwnProperty("obb")&&!this.ignoreServiceObb?_.obb:null,p=new ye(`${_.id}`,_.mbs);return p.serviceObb=g,p.visibilityObb=this._computeVisibilityObb(p),p},d=Array.isArray(t.children)?t.children.map(l).filter(_=>_!=null):null,c=((u=t.featureData)==null?void 0:u.length)??!1,h=t.isEmpty===!0;return{id:e,mbs:t.mbs,obb:a,children:d,resources:{isEmpty:!c&&h,hasSharedResource:t.sharedResource!=null,attributes:t.attributeData?e:void 0,texture:t.textureData&&t.textureData.length>0?e:void 0,geometry:t.geometryData!=null?e:void 0},version:typeof t.version=="string"?t.version:null,lodSelection:Array.isArray(t.lodSelection)?t.lodSelection:null,numFeatures:o}}resetFailedNodes(){this._failedNodes.clear(),this._failedPages.clear(),this._forAllNodes(e=>{e.node!=null&&(e.node.failed=!1)})}_entryPriority(e){const t=this._getNodeInternal(e),s=this.getParentIndex(e);if(t==null||s==null&&t.node==null)return s==null?1/0:this._entryPriority(s);let n=0;if(t.node&&s!=null){const o=this._getNodeInternal(s).traversalState;o!=null&&(n=o.lodLevel)}let r=this.progressiveLoadPenalty;for(let o=e;o!=null;o=this.getParentIndex(o))if(this._isLoaded(o)){r=0;break}const a=t.ref!=null?this._viewportQueries.distToPOI(t.ref):t.node!=null?this._viewportQueries.distToPOI(t.node):0;return-a-n*(a+this.progressiveLoadPenalty)+r}traverseVisible(e){const t=this._getNodeInternal(this._rootIndex);t!=null?this._traverseVisible(this._rootIndex,null,t,e):e(this._rootIndex,null,null)}_traverseVisible(e,t,s,n){if(s.node&&s.childCount===0)return void(this.isGeometryVisible(e)&&n(e,s,t));if(!this.isNodeVisible(e)||(n(e,s,t),s.node==null))return;const r=this.nodeTraversalState(s.node);if(r!=null&&r.nodeHasLOD&&r.lodLevel===this._maxLodLevel)return;const a=this._getPage(e);for(let o=0;o{let n=this._isLoaded(s.index)||this._isReloading(s.index)?1:0;return this.traverseChildren(s,r=>(n+=t(r),!1)),s.childrenLoaded!==n&&e.push(s.index),n};return t(this.rootNode),e.length&&this._logger.error("childrenLoaded invariant broken at following nodes: "+e.join(",")),e.length>0}updateStats(e){var t;if(this._updates.add.length>0&&(e.nodes+=" + "+this._updates.add.length),e.index=this._nodePages.size*(this._pageSize||1)+(((t=this._clientNodePage)==null?void 0:t.nodes.length)??0),e.prio=this._maxProcessingPrio,(this._indexMissing||this._prefetchNodes.length>0)&&(e.index+=" + "+this._indexMissing||this._prefetchNodes.length),this._featureEstimate.estimate){const s=this._featureEstimate.estimate-e.features;s>0?e.features+=" + "+s:s<0&&(e.features+=" - "+-s)}}updateElevationInfo(e,t){this.needNodeElevationRange=t&&!!e&&(e.mode==="relative-to-ground"||e.mode==="on-the-ground"),this._viewportQueries.updateElevationInfo(e),this.invalidateAllElevationRanges()}invalidateAllElevationRanges(){this._forAllNodes(e=>{xt(e),e.node!=null&&e.node.invalidateElevationRange(),e.ref!=null&&e.ref.invalidateElevationRange()})}_forAllNodes(e){if(this._clientNodePage!=null){const t=this._clientNodePage;for(let s=0;st.add(X(s,this._pageSize)));for(const[s,n]of e)if(n.numNodesWithLoadedChildren!==0||t.has(s))for(const r of n.nodes)r.traversalState=null;else this._deleteNodePage(s)}}_deleteNodePage(e){this._nodePages.delete(e)}get test(){return{addNode:(e,t)=>this._addNode(e,t),getNodeInternal:e=>this._getNodeInternal(e),getPageIndex:e=>X(e,this._pageSize),getIndexWithinPage:e=>E(e,this._pageSize),getNodePage:e=>e<0?this._clientNodePage:this._nodePages.get(e),getChildIndices:e=>{const t=this._getNodeInternal(e),s=this._getPage(e);if(t==null||s==null)return[];const n=[];for(let r=t.childOffset;r0?i/e|0:0}function E(i,e){return i<0?-i-1:e===0?i:i%e}function Ne(i,e,t){return e===-1?-(i+1):t===0?i:e*t+i}const vs=[["maxScreenThreshold",L.MaxScreenThreshold],["screenSpaceRelative",L.ScreenSpaceRelative],["removedFeatureDiameter",L.RemovedFeatureDiameter],["distanceRangeFromDefaultCamera",L.DistanceRangeFromDefaultCamera]];function Ns(i){if(i){for(let e=0;e0&&this._removeChildrenRecursive(e),!0;const h=o.isNodeLoaded(r);if(n&&h&&d){const b=!s&&this.hasNoVisibleChildren(e);o.fadeNode(r,pe.FadeIn,!b)}const u=h&&(!o.isNodeFullyFadedIn||o.isNodeFullyFadedIn(r));if(h&&(o.updateNodeState(r,d?ne.Leaf:ne.Hole),d))return u&&this._removeChildrenRecursive(e),u;const _=e.childCount>0;let m=_;if(_)for(let b=0;b((this._layerView.isNodeLoaded(t.index)||this._layerView.isNodeReloading(t.index))&&G.push(t.index),t.childrenLoaded>0))}hasNoVisibleChildren(e){let t=!0;return this._index.traverseChildren(e,s=>!(!t||!this._index.isNodeVisible(s.index))&&(this._layerView.isNodeLoaded(s.index)?(t=!1,!1):s.childrenLoaded>0)),t}_childrenRequireLoading(e){let t=!1,s=!0;return this._index.traverseChildren(e,n=>{if(!s||!this._index.isNodeVisible(n.index))return!1;const r=this._index.nodeTraversalState(n);return this._isChosenMaxLOD(r)&&this._index.isGeometryVisible(n.index)&&(t=!0),this._layerView.isNodeLoaded(n.index)?(s=!1,!1):n.childrenLoaded>0}),s&&t}_isChosenMaxLOD(e){return e.isChosen&&(!e.nodeHasLOD||e.lodLevel===this._maxLodLevel)}};const G=new T({deallocator:null});class _e{constructor(e,t){this._textureRep=e,this.loadPromise=null,this._disposed=!1;const s=this._textureRep.acquire(t);ni(s)?(s.then(n=>{this._disposed?nt(n):this._textureRef=n}),this.loadPromise=s):this._textureRef=s}dispose(){this._textureRef=nt(this._textureRef),this._disposed=!0}get glTexture(){return this._textureRef!=null?this._textureRef.glTexture:null}}function Ms(i,e){const t=new Map,s=(m,g)=>{if(m==null)return-1;const p=t.get(m.id);if(p)return p.usage|=g,p.id;const b=t.size;return t.set(m.id,{id:b,usage:g}),b},n=e.pbrMetallicRoughness,r=n==null?void 0:n.baseColorFactor,a=e.emissiveFactor,o=Pt({normalTexture:e.normalTexture,emissiveTexture:e.emissiveTexture,emissiveFactor:e.emissiveFactor,occlusionTexture:e.occlusionTexture,metallicRoughnessTexture:n==null?void 0:n.metallicRoughnessTexture,metallicFactor:n==null?void 0:n.metallicFactor,roughnessFactor:n==null?void 0:n.roughnessFactor}),l=o?fe[0]:(n==null?void 0:n.metallicFactor)??ze[0],d=o?fe[1]:(n==null?void 0:n.roughnessFactor)??ze[1],c=e.alphaMode==="mask"?w.Color|w.AlphaMask:w.Color,h={baseColorFactor:r?[r[0],r[1],r[2],r[3]]:[1,1,1,1],baseColorTextureId:s(n==null?void 0:n.baseColorTexture,c),metallicRoughnessTextureId:s(n==null?void 0:n.metallicRoughnessTexture,w.MetallicRoughness),metallicFactor:l,roughnessFactor:d},u={alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,cullFace:e.cullFace==="none"?A.None:e.cullFace==="back"?A.Back:e.cullFace==="front"?A.Front:A.None,normalTextureId:s(e.normalTexture,w.Normal),emissiveTextureId:s(e.emissiveTexture,w.Emissive),occlusionTextureId:s(e.occlusionTexture,w.Occlusion),emissiveFactor:a?[a[0],a[1],a[2]]:[0,0,0],metallicRoughness:h,wrapTextures:!1,hasParametersFromSource:o},_=[];return t.forEach(({usage:m},g)=>{const p=i!=null&&i[g]&&i[g].formats,b=p?Tt(p.map(({name:f,format:y})=>({name:f,encoding:Os[y]}))):[];_.push({id:g,usage:m,encodings:b})}),{material:u,textures:_}}function Tt(i){return i.sort((e,t)=>e.encoding-t.encoding)}const Os={ktx2:C.KTX2,basis:C.Basis,dds:C.DDS_S3TC,png:C.PNG,jpg:C.JPG,"ktx-etc2":C.KTX_ETC2},Nt={[ae.KTX2_ENCODING]:C.Basis,[ae.BASIS_ENCODING]:C.Basis,[ae.DDS_ENCODING]:C.DDS_S3TC,"image/png":C.PNG,"image/jpg":C.JPG,"image/jpeg":C.JPG,"image/ktx":C.KTX_ETC2};function Ls(i){var o,l;const e=i!=null&&i.materialDefinitions?Object.keys(i.materialDefinitions)[0]:null,t=i!=null&&i.textureDefinitions?Object.keys(i.textureDefinitions)[0]:null,s=e?(o=i.materialDefinitions)==null?void 0:o[e]:null,n=t?(l=i.textureDefinitions)==null?void 0:l[t]:null,r=Rs();if(s!=null){const d=s.params;d.diffuse&&(r.metallicRoughness.baseColorFactor=[d.diffuse[0],d.diffuse[1],d.diffuse[2],1]),d.doubleSided!=null&&(r.doubleSided=d.doubleSided,r.cullFace=d.doubleSided?A.None:A.Back),d.cullFace!=="none"&&d.cullFace!=="front"&&d.cullFace!=="back"||(r.cullFace=d.cullFace==="none"?A.None:d.cullFace==="back"?A.Back:A.Front),d.transparency&&(r.metallicRoughness.baseColorFactor[3]=Rt(1-d.transparency,0,1)),(d.useVertexColorAlpha||r.metallicRoughness.baseColorFactor[3]<1)&&(r.alphaMode="blend")}const a=[];if(n!=null){!n.wrap||n.wrap[0]!=="repeat"&&n.wrap[1]!=="repeat"||(r.wrapTextures=!0);let c=w.Color;n.channels==="rgba"&&(r.alphaMode="blend",c|=w.AlphaMask);const h=n.images.length-1,u=n.images[h],_=g=>g==null?void 0:g.split("/").pop(),m=Array.isArray(n.encoding)?Tt(n.encoding.map((g,p)=>({name:_(u.href[p]),encoding:Nt[g]||0}))):[{name:_(u.href),encoding:Nt[n.encoding]||0}];a.push({id:0,usage:c,encodings:m}),r.metallicRoughness.baseColorTextureId=0}return{material:r,textures:a}}const Rs=()=>({alphaMode:"opaque",alphaCutoff:At,doubleSided:!0,cullFace:A.None,normalTextureId:-1,emissiveTextureId:-1,occlusionTextureId:-1,emissiveFactor:[0,0,0],metallicRoughness:{baseColorFactor:[.8,.8,.8,1],baseColorTextureId:-1,metallicRoughnessTextureId:-1,metallicFactor:0,roughnessFactor:.6},wrapTextures:!1,hasParametersFromSource:!0});function cn(i,e,t,s){if((i==null?void 0:i.data)==null)return null;const n=i.data,r=s.renderingContext.parameters.maxMaxAnisotropy,a=r>1,o=t||!e.wrapTextures?As:Fs,l=$s(i.encoding),d=i.usage&w.Color?e.alphaMode==="opaque"?3:4:3;return new ri(n,{mipmap:a,maxAnisotropy:r,encoding:l,wrap:o,components:d,noUnpackFlip:!0})}const As={s:Se.CLAMP_TO_EDGE,t:Se.CLAMP_TO_EDGE},Fs={s:Se.REPEAT,t:Se.REPEAT};function _n(i,e,t,s,n,r){const a=r.rendererTextureUsage,o=p=>Ts(s,t,p&a),l=e.metallicRoughness.baseColorFactor,d=Rt(e.metallicRoughness.baseColorFactor[3],0,1);i.baseColor=[l[0],l[1],l[2],d],i.hasParametersFromSource=!!e.hasParametersFromSource,i.usePBR=r.usePBR,i.mrrFactors=[e.metallicRoughness.metallicFactor,e.metallicRoughness.roughnessFactor,e.hasParametersFromSource?fe[2]:ze[2]],i.emissiveFactor=e.emissiveFactor,i.isIntegratedMesh=r.isIntegratedMesh,i.textureAlphaCutoff=e.alphaMode==="mask"?e.alphaCutoff:At,i.alphaDiscardMode=e.alphaMode==="opaque"?Le.Opaque:e.alphaMode==="mask"?Le.Mask:Le.MaskBlend;const c=[],h=o(w.Color|w.AlphaMask);h!=null&&(i.baseColorTexture=new _e(n,h),c.push(i.baseColorTexture.loadPromise));const u=o(w.MetallicRoughness);u!=null&&(i.metallicRoughnessTexture=new _e(n,u),c.push(i.metallicRoughnessTexture.loadPromise));const _=o(w.Emissive);_!=null&&(i.emissionTexture=new _e(n,_),c.push(i.emissionTexture.loadPromise));const m=o(w.Occlusion);m!=null&&(i.occlusionTexture=new _e(n,m),c.push(i.occlusionTexture.loadPromise));const g=o(w.Normal);return g!=null&&(i.normalTexture=new _e(n,g),c.push(i.normalTexture.loadPromise)),i.commonMaterialParameters.hasSlicePlane=r.slicePlaneEnabled,i.commonMaterialParameters.doubleSided=e.doubleSided,i.commonMaterialParameters.cullFace=e.cullFace,i.ellipsoidMode=ai(r.viewSpatialReference),Promise.all(c)}function gn(i){const e=!!i.compressedTextureS3TC,t=!!i.compressedTextureETC,s=Ye("disable-feature:i3s-basis")?0:C.Basis|C.KTX2,n=C.JPG|C.PNG,r=s|C.DDS_S3TC;return n|(e?r:0)|(t?s:0)}function Es(i,e){if(e!=null)return i.find(t=>(t.encoding&e)!=0)}function Ts(i,e,t){if(i==null||t===w.None)return null;for(let s=0;sMs(o,l))}}_load(e,t,s){return this._streamDataController.request(e,t,s)}_loadAttribute(e,t,s){const n=`${this._layerUrl}/nodes/${e.resources.attributes}/attributes/${t.key}/0`;return this._load(n,"binary",s).then(r=>oi(t,r))}async loadAttributes(e,t,s){const n=await Promise.allSettled(t.map(a=>this._loadAttribute(e,a.attributeStorageInfo,s))),r={};for(let a=0;a=0?this._materialAndTextures[d]:l!=null?Ls(l):null,h=c==null?void 0:c.material,u=(c==null?void 0:c.textures)??[],_=`${e.id}`,m=!a&&this._options.loadFeatureData,g=m?await this._loadFeatureData(_,t):null,p=m?Gs(g):Vs(h),b=p==null?ks(g):null,f=u.length>0?Ie(this.loadTextures(e,u,t)):null;let y=null,N=null;if(o){y=Re(await o);const F=Us(this._defaultGeometrySchema,l);N=di(n,F)}const S=f?Re(await f):null,I=s?Re(await s):{},M=I?{attributeData:I,loadedAttributes:this._requiredAttributes}:null;if(p!=null)return{geometryData:p,attributeDataInfo:M,geometryBuffer:y,geometryDescriptor:N,requiredTextures:u,textureData:S};if(b!=null)return{pointData:b,attributeDataInfo:M,geometryBuffer:y,geometryDescriptor:N,requiredTextures:u,textureData:S};throw new Error}static _addAbsoluteHrefTexture(e,t){const s=e.textureDefinitions;if(s!=null)for(const n of Object.keys(s))for(const r of s[n].images)Array.isArray(r.href)?r.hrefConcat=r.href.map(a=>rt(a,t)):r.hrefConcat=rt(r.href,t)}static _fixTextureEncodings(e){const t=e.textureDefinitions;if(t!=null)for(const s in t){const n=t[s];if(Array.isArray(n.encoding))for(let r=0;r(De._fixTextureEncodings(n),De._addAbsoluteHrefTexture(n,s),n))}_loadTexture(e,t,s,n,r,a){let o=!1;return r===C.DDS_S3TC||r===C.KTX2||r===C.Basis?this._load(e,"binary",a).then(l=>({id:t,usage:s,data:l,encoding:r,downsampled:o})):this._load(e,"image",a).then(l=>{let d=l;const c=4096,h=2;if(n&&l.width*l.height>=c){const u=Math.ceil(l.width/h),_=Math.ceil(l.height/h),m=document.createElement("canvas");m.width=u,m.height=_,m.getContext("2d").drawImage(l,0,0,u,_),d=m,o=!0}return{id:t,usage:s,data:d,encoding:r,downsampled:o}})}loadTextures(e,t,s){const n=!!this._options.uncompressedTextureDownsamplingEnabled,r=this._options.textureUsageMask;return Promise.all(t.map(a=>{if(!(a.usage&r))return null;const o=Es(a.encodings,this._options.textureEncodings);if(o==null)return this._logger.error("#loadTextures",this._logLayer,`No known encoding for texture found on node ${e.id}`),Promise.reject();const l=e.resources.texture||e.id,d=`${this._layerUrl}/nodes/${l}/textures/${o.name}`;return this._loadTexture(d,a.id,a.usage,n,o.encoding,s)}))}_loadFeatureData(e,t){const s=`${this._layerUrl}/nodes/${e}/features/0`;return this._load(s,"json",t)}_loadGeometry(e,t,s){const n=`${this._layerUrl}/nodes/${e}/geometries/${t}`;return this._load(n,"binary",s)}}function Vs(i){return{featureIds:[],geometries:[{type:"ArrayBufferView",params:{material:i}}],featureDataPosition:[0,0,0]}}function Gs(i){if(!i)return null;for(const e of i.featureData){const t=e.geometries;if(t!=null)for(const s of t)return{featureIds:[e.id],featureDataPosition:e.position,geometries:[s]}}return null}function ks(i){if(!i)return null;const e=new Array;for(const t of i.featureData)t.position!=null&&e.push({featureIds:[t.id],featureDataPosition:t.position,geometries:[]});return e}function Us(i,e){if(!i||!(e!=null&&e.materialDefinitions))return i;const t=Object.keys(e.materialDefinitions)[0];return!e.materialDefinitions[t].params.vertexRegions&&i.vertexAttributes.region&&delete(i=hi(i)).vertexAttributes.region,i}function js(i,e){const t={bufferDefinition:null,bufferIndex:0},s=e.resources.geometryDefinition;if(i==null||s==null||s<0)return t;const n=s>=0?i[s].geometryBuffers:null;if(n==null)return t;for(let r=0;rn.abort()),a={signal:n.signal,query:{token:this._apiKey}},o=this._requester.request(e,t,a),l={response:o,abortController:n,abortHandle:r};return this._activeRequests.add(l),ci(o,()=>{var d;l.abortController=null,(d=l.abortHandle)==null||d.remove(),l.abortHandle=null,this._activeRequests.delete(l)}),o}cancelAll(){this._activeRequests.forEach(e=>{var t,s;(t=e.abortController)==null||t.abort(),e.abortController=null,(s=e.abortHandle)==null||s.remove()}),this._activeRequests.clear()}}const It=1e5;class qs{constructor(e,t,s,n,r,a,o,l,d={}){this._indexSR=e,this._renderCoordsHelper=t,this._clippingArea=r,this._elevationProvider=a,this._viewingMode=o,this._options=d,this._frustum=_i(),this._useFrustumCulling=!1,this._poi=Y(),this._elevationContext=null,this.minDistance=1/0,this.maxDistance=0,this.maxLodLevel=2,this._tmpObb=at(),this._tmp1=Y(),this._tmp2=Y(),this._tmp3=Y(),this._tmp0=Y(),this._screenspaceErrorBias=d.screenspaceErrorBias||1,this._progressiveLoadFactor=d.progressiveLoadFactor||1,this.updateCamera(s,n),this.engineSR=this._renderCoordsHelper.spatialReference,this.updateElevationInfo(l),this._tmpPoint=Ft(0,0,0,e),this._isECEFOBBInLocalMode=this._indexSR.isWGS84&&(this.engineSR.isWebMercator||gi(this.engineSR)),this._indexSREllipsoidRadius=mi(this._indexSR).radius}updateElevationInfo(e){e!=null?(this._elevationContext=fi.fromElevationInfo(e),this._elevationContext.updateFeatureExpressionInfoContext(pi(bi(e,!1)))):this._elevationContext=null}updateCamera(e,t){this._useFrustumCulling=t,t&&yi(e.viewMatrix,e.projectionMatrix,this._frustum),this._screenSizeFactor=1/(e.perScreenPixelRatio/2),this._camPos=e.eye,this.minDistance=1/0,this.maxDistance=0}setPointOfInterest(e){this._poi=e}updateScreenSpaceErrorBias(e){const t=this._screenspaceErrorBias;return this._screenspaceErrorBias=e,t}updateClippingArea(e){this._clippingArea=e}expandElevationRange(e,t,s){var h,u;if(this._elevationContext==null)return;const n=e.mbs;if(!n)return;if(this._elevationProvider.getSphereElevationBounds){const _=this._elevationProvider.getSphereElevationBounds(n,this._indexSR);return void(_&&oe(s,_.min,_.max))}const r=n[0],a=n[1],o=n[2],l=this._elevationContext.mode==="relative-to-scene"?"scene":"ground",d=this._elevationProvider.getElevation(r,a,o,this._indexSR,l);d&&oe(s,d,d);const c=t?null:(u=(h=this._elevationProvider).getRootElevationBounds)==null?void 0:u.call(h);c&&oe(s,c.min,c.max)}getRenderMbs(e){const t=e.renderMbs;if(xi(t))return t;e.mbs&&vi(t,e.mbs);const s=e.elevationRangeMin;if(this._elevationContext&&Number.isFinite(s)){let n=0,r=0;const a=e.elevationRangeMax;switch(this._elevationContext.mode){case"relative-to-ground":n=this._elevationContext.geometryZWithOffset(t[2],this._renderCoordsHelper)+s-t[2],r=a-s;break;case"on-the-ground":n=s-t[2],r=a-s}t[2]+=n+.5*r,t[3]+=.5*r}else this._elevationContext&&t[3]n>s)?null:(e.serviceObbInRenderSR=this._computeRenderObb(t,e.serviceObbInRenderSR,e.mbs[3],e.elevationRangeMin,e.elevationRangeMax),e.serviceObbInRenderSR)}_computeRenderObb(e,t,s,n,r){if(t==null)t=at();else if(lt(t))return t;let a=0,o=0;if(this._elevationContext&&!Number.isNaN(n)&&Number.isFinite(n))switch(this._elevationContext.mode){case"relative-to-ground":a=this._elevationContext.geometryZWithOffset(e.center[2],this._renderCoordsHelper)+n-e.center[2],o=r-n;break;case"on-the-ground":a=n-e.center[2],o=r-n}else this._elevationContext&&s0?(dt(e,this._indexSR,this._tmpObb,this.engineSR,a),Ni(this._tmpObb,0,o,this._viewingMode,t)):dt(e,this._indexSR,t,this.engineSR,a),t}isNodeVisible(e){const t=this.getRenderMbs(e);if(!this._isMBSinClippingArea(t))return!1;if(!this._useFrustumCulling)return!0;const s=this._getVisibilityObb(e);return s?ht(s,this._frustum):Ci(this._frustum,Ii(t))}isGeometryVisible(e){if(!this._useFrustumCulling)return!0;const t=e.geometryObb;return t!=null?ht(t,this._frustum):this.isNodeVisible(e)}_isMBSinClippingArea(e){return this._clippingArea==null||wi(this._clippingArea,e)!==Si.OUTSIDE}_screenSpaceDiameterMbs(e,t){const s=this.getRenderMbs(e),n=Math.sqrt(ut(s,this._camPos)),r=n-s[3];return this._updateMinMaxDistance(n),r<0?.5*Number.MAX_VALUE:t/r*this._screenSizeFactor}calcCameraDistance(e){return this.calcCameraDistanceToCenter(e)-this.getRenderMbs(e)[3]}calcCameraDistanceToCenter(e){const t=this.getRenderMbs(e),s=le(t,this._camPos);return this._updateMinMaxDistance(s),s}calcAngleDependentLoD(e){const t=this.getRenderMbs(e),s=t[3],n=(Math.abs(t[0]*(t[0]-this._camPos[0])+t[1]*(t[1]-this._camPos[1])+t[2]*(t[2]-this._camPos[2]))/te(t)+s)/le(t,this._camPos);return Math.min(1,n)}hasLOD(e){return e.lodMetric!==L.None}_getDistancePlanarMode(e,t){const s=e[0]-t[0],n=e[1]-t[1],r=e[2]-t[2],a=s*s+n*n,o=t[3];if(a<=o*o)return Math.abs(r);const l=Math.sqrt(a)-o;return Math.sqrt(r*r+l*l)}_getDistanceGlobeMode(e,t){const s=te(t),n=te(e)-s;de(this._tmp0,e,Ae(e,t)/Di(e));const r=ut(t,this._tmp0),a=t[3];if(r<=a*a)return Math.abs(n);{const o=de(this._tmp0,t,1/s),l=s,d=a*a/2/l,c=de(this._tmp1,o,l-d),h=e,u=Fe(this._tmp2,h,c),_=Fe(this._tmp2,u,de(this._tmp3,o,Ae(o,u))),m=Pi(this._tmp2,c,de(this._tmp2,_,a/te(_)));let g=le(h,m);if(n>=2e5){const p=Fe(this._tmp1,h,m);let b=Ae(p,o)/te(p);b<.08&&(b=1e-4),g/=b}return g}}_getDistance(e,t){return this.engineSR===Mi(this.engineSR)?this._getDistanceGlobeMode(e,t):this._getDistancePlanarMode(e,t)}_updateMinMaxDistance(e){e>0?(this.minDistance=Math.min(this.minDistance,e),this.maxDistance=Math.max(this.maxDistance,e)):(this.minDistance=0,this.maxDistance=Math.max(this.maxDistance,-e))}getLodLevel(e){if(e.lodMetric===L.None)return 0;if(e.childCount===0)return this.maxLodLevel;if(this._useFrustumCulling&&this._progressiveLoadFactor<1){const t=this._progressiveLoadFactor*this._screenspaceErrorBias,s=this._screenspaceErrorBias;return this.evaluateLODmetric(e,t)?this.evaluateLODmetric(e,s)?2:1:0}return this.evaluateLODmetric(e,this._screenspaceErrorBias)?this.maxLodLevel:0}evaluateLODmetric(e,t){switch(e.lodMetric){case L.ScreenSpaceRelative:{const s=this.getRenderMbs(e),n=this._getDistance(this._camPos,s),r=2*n/this._screenSizeFactor,a=n+s[3];return this._updateMinMaxDistance(a),e.maxError*t<=r}case L.MaxScreenThreshold:{let s=this._screenSpaceDiameterMbs(e,e.mbs[3]*t);return this._options.angleDependentLoD&&(s*=this.calcAngleDependentLoD(e)),se.maxError*t}return!1}distToPOI(e){const t=this.getRenderMbs(e);return le(t,this._poi)-t[3]}distCameraToPOI(){return le(this._camPos,this._poi)}}const $t="esri.layers.graphics.controllers.I3SOnDemandController",Z=Qe.getLogger($t),Bs=100,wt=2,St=1e4,qe=1e-4,Hs=1.2,zs=500,Qs=1.5;let D=class extends Oi(Ze){get isMeshPyramid(){var i;return this.layer.profile==="mesh-pyramids"||((i=this.layer.store)==null?void 0:i.lodType)==="MeshPyramid"}get isGraphics3D(){return this.layer.profile==="points"}get useMaximumNumberOfFeatures(){return!this.isMeshPyramid&&(this.layer.priority==null||this.layer.priority==="High")}get indexStreamController(){const i=this.layerView.view.resourceController.createStreamDataRequester(ct.I3S_INDEX);return new Ct(i,this.layer.apiKey)}get dataStreamController(){const i=this.layerView.view.resourceController.createStreamDataRequester(ct.I3S_DATA);return new Ct(i,this.layer.apiKey)}get crsVertex(){return Li(this.layer)}get crsIndex(){return Ri(this.layer)}get layer(){return this.layerView.i3slayer}get running(){return this.updating}get rootNodeVisible(){if(this._index){const i=this._index.rootNode;if(i)return this._updateViewData(),this._index.isNodeVisible(i.index)}return!0}get index(){return this._index}get requiredAttributes(){return this._requiredAttributes}constructor(i){super(i),this.screenSizeFactor=0,this.featureTarget=5e4,this.fixedFeatureTarget=!1,this.updating=!0,this.updatingProgress=1,this.leavesReached=!1,this.scaleVisibilityEnabled=!0,this.worker=null,this._featureLOD=1,this._stableFeatureLOD=!1,this._isIdle=!1,this._cameraDirty=!0,this._invisibleDirty=!1,this._idleStateCallbacks=null,this._newLoadingNodes=new T({deallocator:null}),this._loadedNodeScales=new Map,this._modificationsNodeFilteringArray=new T,this._downloadingCount=0,this._loadingNodes=new Map,this._updatingNodes=new Map,this._progressMaxNumNodes=1,this._requiredAttributes=new Array,this._requiredAttributesDirty=!0,this._updatesDisabled=!1,this.disableIDBCache=!1,this._disableMemCache=!1,this._restartNodeLoading=!1,this._fields=null,this._attributeStorageInfo=null,this._idleQueue=new Ai,this._elevationUpdateNodes=new T({deallocator:null}),this._errorCount=0}initialize(){const{layerView:i,layer:e}=this;this._disableMemCache=!i.loadCachedGPUData||!i.addCachedGPUData,this._lodHandling=new Ps(i),this._defaultGeometrySchema=e.store.defaultGeometrySchema,this.disableIDBCache=Ye("disable-feature:idb-cache"),"fields"in e&&(this._fields=e.fields,this._attributeStorageInfo=e.attributeStorageInfo),this.addResolvingPromise(Promise.all([e.indexInfo,e.when(),i.when()]).then(([t])=>{if(this.destroyed||!i||i.destroyed||!t)return;const{view:s,clientGeometry:n}=i,{resourceController:r}=s;if(this._setClippingArea(s.clippingArea),this.addHandles([R(()=>{var a,o;return(o=(a=s==null?void 0:s.pointsOfInterest)==null?void 0:a.focus)==null?void 0:o.renderLocation},a=>this._pointOfInterestChanged(a),Je),R(()=>s.quality,()=>this._setCameraDirty(),Fi),R(()=>i.contentVisible,a=>{const o=a?()=>this._updateIdleState(!0):()=>this._updateViewData(),l=a?()=>this._updateIdleState(!1):()=>{};a&&this._index!=null&&this._index.invalidateAllElevationRanges(),this._idleStateCallbacks?(a||this.cancelNodeLoading(),this.restartNodeLoading(),this._idleStateCallbacks.idleBegin=o,this._idleStateCallbacks.idleEnd=l):this._idleStateCallbacks=r.scheduler.registerIdleStateCallbacks(o,l)},Je),bs(i.view.resourceController.scheduler,this),R(()=>i.uncompressedTextureDownsamplingEnabled,()=>this.restartNodeLoading()),R(()=>[this.featureTarget,this.fixedFeatureTarget],()=>{this._setCameraDirty(),this._stableFeatureLOD=!1}),R(()=>{var a;return(a=s.state)==null?void 0:a.contentCamera},()=>this._setCameraDirty()),R(()=>e.elevationInfo,a=>this._elevationInfoChanged(a)),R(()=>e.effectiveScaleRange,()=>this._scaleBoundsChanged()),R(()=>i.lodFactor,()=>this._setCameraDirty()),R(()=>i.availableFields,()=>this._requiredFieldsChange()),R(()=>i.holeFilling,a=>this._index!=null&&(this._index.holeFilling=a))]),this._updateScaleHandles(),this._viewportQueries=new qs(this.crsIndex,s.renderCoordsHelper,s.state.contentCamera,!s.state.fixedContentCamera||this.isGraphics3D,this._clippingArea,this.isMeshPyramid?s.basemapTerrain:s.elevationProvider,Ei(s.viewingMode),this.layer.elevationInfo,{progressiveLoadFactor:this._getProgressiveLoadFactor(),screenspaceErrorBias:this._lod,angleDependentLoD:this._lod<.5}),this._clientNodeLoader=new hs(this.layer.uid,{indexSR:this.crsIndex,vertexSR:this.crsVertex,renderSR:s.renderCoordsHelper.spatialReference,localMode:s.viewingMode==="local"},s.resourceController.memoryController,this.worker),this._index=new ys(e,t,this.indexStreamController,this._clientNodeLoader,this._viewportQueries,Z,i.holeFilling,a=>i.isNodeLoaded(a),a=>i.isNodeReloading(a),a=>this._shouldLoadNode(a),a=>this._enableFromGPUCache(a,ne.Leaf),a=>this._needsUpdate(a),()=>!this.indexStreamController.busy,a=>i.computeVisibilityObb?i.computeVisibilityObb(a):null,i!=null&&i.computeNodeFiltering?a=>i.computeNodeFiltering(a):void 0),this._index.updateElevationInfo(this.layer.elevationInfo,this.isMeshPyramid||this.isGraphics3D),this._index.imModificationsChanged(!!i.hasModifications),this._index.layerFilterChanged(!!i.hasGeometryFilter),n!=null){for(const a of n)this._addMesh(a.mesh,a.oid);this.addHandles(n.on("change",a=>{for(const o of a.removed)this._removeMesh(o.oid);for(const o of a.added)this._addMesh(o.mesh,o.oid)}))}this._startNodeLoading()})),this._tmpPoint=Ft(0,0,0,this.crsIndex)}updateNodeModificationStatus(i){const e=this._index,t=this.layerView;e!=null&&(t!=null&&t.updateNodeModificationStatus)&&(this._modificationsNodeFilteringArray.clear(),i.forAll(s=>{const n=e.getNode(s);n!=null&&this._modificationsNodeFilteringArray.push(n)}),t.updateNodeModificationStatus(this._modificationsNodeFilteringArray),this._invisibleDirty=!0)}destroy(){this.cancelNodeLoading(),this._idleStateCallbacks&&(this._isIdle=!1,this._idleStateCallbacks.remove(),this._idleStateCallbacks=null),this._nodeLoader=null,V.prune(),Be!=null&&(Be.hide(),Be=null)}_getRequiredAttributes(){if(this._attributeStorageInfo==null||!this._fields||!this.layerView.availableFields)return[];const i=this._attributeStorageInfo,e=this._fields,t=this.layer.objectIdField;return this.layerView.availableFields.map(s=>{const n=Ke(i,s),r=Ke(e,s);return n>=0&&r>=0?{index:n,name:e[r].name,field:e[r],attributeStorageInfo:i[n]}:null}).filter(s=>s!=null&&s.name!==t)}_requiredFieldsChange(){const i=this._getRequiredAttributes();He(this._requiredAttributes,i)||(this._requiredAttributes=i,this._requiredAttributesDirty=!1,this.restartNodeLoading())}requestUpdate(){this._requiredAttributesDirty=!0,this.restartNodeLoading()}_setClippingArea(i){const e=Et();Ti(i,e,this.layerView.view.renderSpatialReference)?this._clippingArea=e:this._clippingArea=null}_pointOfInterestChanged(i){this._viewportQueries!=null&&(this._viewportQueries.setPointOfInterest(i),this._index!=null&&(this._index.progressiveLoadPenalty=Dt.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate()))}updateClippingArea(i){this._setClippingArea(i),this._viewportQueries!=null&&this._index!=null&&(this._viewportQueries.updateClippingArea(this._clippingArea),this._index.invalidateVisibilityCache()),this._setCameraDirty()}_setCameraDirty(){this._cameraDirty=!0,this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}_addMesh(i,e){if(this._index==null)return;const t=this._clientNodeLoader.createMeshNodeInfo(i,e),s=this._index.addClientNodeToIndex(t.id,t.mbs);this._clientNodeLoader.addMeshNode(s,t),this._evaluateUpdating(),this.notifyChange("rootNodeVisible")}_removeMesh(i){const e=this._clientNodeLoader.getMeshNodeIndex(i);if(e!=null){if(this._index==null)throw new Error("delayed removal of client side i3s node geometry not supported yet.");{const t=(n,r)=>{var a,o,l,d;this.layerView.removeNode(r),this._loadedNodeScales.delete(r),this._clientNodeLoader.removeNode(n),this.layerView.deleteCachedNodeData&&n!=null&&this.layerView.deleteCachedNodeData(n),(d=(l=this.layerView).deleteCachedGPUData)==null||d.call(l,(o=(a=this.layerView).loadCachedGPUData)==null?void 0:o.call(a,r))},s=(n,r,a)=>{this._clientNodeLoader.updateNodeIndex(n,r,a),this.layerView.updateNodeIndex&&this.layerView.updateNodeIndex(r,a)};this._index.removeClientNodeFromIndex(e,t,s),this.notifyChange("rootNodeVisible")}}}updateElevationChanged(i,e){const t=this._index;if((t==null?void 0:t.rootNode)==null||e==null)return null;this.crsIndex.equals(e)||(_t(i,e,Ce,this.crsIndex),i=Ce);const s=this._elevationUpdateNodes;return s.clear(),$i(i,t.rootNode,t,n=>s.push(n.index)),s.length&&(s.forAll(n=>t.updateElevationChanged(n)),this._setCameraDirty()),s}removeAllGeometryObbs(){this._index!=null&&this._index.removeAllGeometryObbs()}getRenderMbs(i){return this._viewportQueries!=null?this._viewportQueries.getRenderMbs(i):null}_elevationInfoChanged(i){this._index!=null&&(this._index.updateElevationInfo(i,this.isMeshPyramid||this.isGraphics3D),this._setCameraDirty())}_updateScaleHandles(){const i="scale-bounds";this.removeHandles(i),this._areScaleBoundsActive&&this.addHandles(this.layerView.view.basemapTerrain.on("scale-change",e=>this._scaleUpdateHandler(e)),i)}_scaleBoundsChanged(){this._areScaleBoundsActive||this._loadedNodeScales.clear(),this._updateScaleHandles(),this._setCameraDirty()}_scaleUpdateHandler(i){this._updateScaleInBoundingRect(i.extent,i.spatialReference),this._setCameraDirty()}_updateScaleInBoundingRect(i,e){const t=this._index;t!=null&&t.rootNode!=null&&_t(i,e,Ce,this.crsIndex)&&this._loadedNodeScales.forEach((s,n)=>{const r=t.getNode(n);r!=null&&Vi(Ce,r.mbs)&&this._loadedNodeScales.set(n,this._computeScale(r))})}restartNodeLoading(){this._restartNodeLoading=!0,this.cancelNodeLoading(),this._evaluateUpdating()}schedule(i,e){return this._idleQueue.push(i,e)}reschedule(i,e){return this._idleQueue.unshift(i,e)}get _isIntegratedMesh(){return this.layer.type==="integrated-mesh"}get _areScaleBoundsActive(){const{minScale:i,maxScale:e}=gt(this.layer);return this.scaleVisibilityEnabled&&(i>0||e>0)}get unloadedMemoryEstimate(){return this._index!=null&&this.layerView.contentVisible?this._index.unloadedMemoryEstimate*this._lodDropFactor:0}async _loadNodeData(i,e){return i.index<0?this._clientNodeLoader.loadNodeData(i.id,e):this._nodeLoader.loadNodeData(i,e)}async _loadAttributes(i,e,t){return(i.index<0?this._clientNodeLoader:this._nodeLoader).loadAttributes(i,e,t)}get indexDepth(){return this._index!=null?this._index.maxLevel:0}set disableMemCache(i){this.layerView.loadCachedGPUData&&this.layerView.addCachedGPUData||(this._disableMemCache=!0),this._disableMemCache=i}runTask(i,e){return this.layerView.contentVisible?this.layerView.visible&&this._index!=null?(this._processWithErrorLogging(i,e),this._index.maxPriority):-1/0:(this._updateViewData(),this._evaluateUpdating(),-1/0)}_processWithErrorLogging(i,e){try{this._process(i,e)}catch(t){this._errorCount<50?Z.error("Error during processing: "+t):this._errorCount===50&&Z.error("Too many errors for this layer. Further errors will not be displayed."),this._errorCount++}}_process(i,e){this._restartNodeLoading&&this._startNodeLoading(),this._nodeLoader!=null&&this._index!=null&&(this._updateViewData(),this._invisibleDirty&&this._removeInvisibleNodes(i)&&(this._invisibleDirty=!1),this._isIntegratedMesh&&(i.enabled=!1),i.run(()=>this._processIndex(i)),this._updateFeatureLOD(),i.run(()=>this._processCache(i)),this._isIntegratedMesh&&(i.enabled=!0),i.run(()=>this._processNodes(i,e)),this._idleQueue.runTask(i),i.run(()=>this._prefetchIndex()),e.numIndexLoading+=this._index.indexLoading,e.numNodesLoading+=this._downloadingCount,i.run(()=>this._lodHandling.lodGlobalHandling(i)),this._evaluateUpdating())}_processIndex(i){if(this._index==null)return!1;if(this._index.dirty){this._newLoadingNodes.clear(),this._index.update(Array.from(this._loadingNodes.keys()),i,t=>this.updateNodeModificationStatus(t)),this._disableMemCache||(this._newLoadingNodes.pushArray(this._index.updates.add.data,this._index.updates.add.length),this._newLoadingNodes.pushArray(this._index.updates.missing.data,this._index.updates.missing.length));const e=this._index.featureEstimate.leavesReached;this._index.isLoading||e===this._get("leavesReached")||this._set("leavesReached",e)}return this._index.load()}_prefetchIndex(){return!(this._index==null||this._loadingNodes.size>0||this._index.updates.add.length>0)&&this._index.prefetch()}_updateFeatureLOD(){if(!this.useMaximumNumberOfFeatures||this._index==null||this._viewportQueries==null)return;const i=!this._index.isLoading,e=this.featureTarget*this._baseLOD,t=this._index.featureEstimate;if(t.estimate=t.estimate||e/2,this._index.indexMissing>zs){if(this._featureLOD<=qe)return;this._featureLOD/=Qs,this._stableFeatureLOD=!1}else if(i&&t.estimate=St||this._stableFeatureLOD)return;const s=Math.min(10,Math.max(e/t.estimate,1.001));this._featureLOD*=s;const n=this._lod,r=this._index.checkFeatureTarget(e,n);r!==n&&(this._featureLOD=r/this._baseLOD,this._stableFeatureLOD=!0)}else{if(!(t.estimate>e*Hs||i&&t.estimate>e)||this._featureLOD<=qe)return;this._featureLOD/=1+.25*(t.estimate/e-1),this._stableFeatureLOD=!1}this._featureLOD=Math.min(St,Math.max(qe,this._featureLOD)),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.requestUpdate()}_processCache(i){const e=this._index;if(e==null)return!1;for(;this._newLoadingNodes.length>0&&!i.done;){const t=this._newLoadingNodes.pop();for(let s=e.getParent(t);s!=null&&!this.layerView.isNodeLoaded(s.index)&&this._isNodeInScaleBounds(s);s=e.getParent(s.index))if(this._enableFromGPUCache(s,ne.Hole)){i.madeProgress();break}}return i.hasProgressed}_processNodes(i,e){if(this._index==null)return!1;let t=(this._isIdle?Bs:wt)-this._loadingNodes.size;const s=this._index.updates;for(s.cancel.forEach(this._cancelNode,this),s.cancel=[];s.remove.length>0&&!i.done;)this.layerView.removeNode(s.remove.pop()),i.madeProgress();for(;s.update.length>0&&!i.done;){const n=this._index.getNode(s.update.pop());n!=null&&(this._updateLoadedNode(n),i.madeProgress())}for(;s.add.length>0&&!i.done&&t>0;){--t;const n=this._index.getNode(s.add.back());if(n==null||n.cacheState!==ue.Cached&&!this._hasNodeLoadToken(e))break;s.add.pop(),this._loadNode(n),i.madeProgress()}return i.hasProgressed}_cancelAllNodes(){this._loadingNodes.forEach(i=>i.abort()),this._loadingNodes.clear(),this._updatingNodes.forEach(i=>i.abort()),this._updatingNodes.clear()}_cancelNode(i){const e=this._loadingNodes.get(i);e&&(e.abort(),this._loadingNodes.delete(i))}_hasNodeLoadToken(i){return!(!this._isIdle&&i.numNodesLoading+this._loadingNodes.size>=wt)&&this._downloadingCount0||this._updatingNodes.size>0||this._restartNodeLoading||this._cameraDirty||this._idleQueue.running||this._lodHandling&&this._lodHandling.requiresLODGlobalHandling||this._index!=null&&this._index.isPrefetching),t===0&&(this._progressMaxNumNodes=1),this._progressMaxNumNodes=Math.max(t,this._progressMaxNumNodes),e=1-t/this._progressMaxNumNodes}else i=this._cameraDirty,e=i?0:1;this.updating=i,this.updatingProgress=e}}_updateViewData(){if(!this._cameraDirty||this._index==null||this._viewportQueries==null)return;const i=this.layerView.view,{contentCamera:e,fixedContentCamera:t}=i.state;this.screenSizeFactor=1/(e.perScreenPixelRatio/2),this._viewportQueries.updateCamera(e,!t||this.isGraphics3D),this._viewportQueries.setPointOfInterest(i.pointsOfInterest.focus.renderLocation),this._viewportQueries.updateScreenSpaceErrorBias(this._lod),this._index.invalidateVisibilityCache(),this._index.progressiveLoadPenalty=Dt.distancePenalty*this._viewportQueries.distCameraToPOI(),this._index.requestUpdate(),this._stableFeatureLOD=!1,this._invisibleDirty=!0,this._cameraDirty=!1,this.notifyChange("rootNodeVisible")}_getProgressiveLoadFactor(){return this.layerView.view.quality<1?1:this.layerView.progressiveLoadFactor}get _lod(){return this._featureLOD*this._baseLOD}get _baseLOD(){const i=this.layerView.lodFactor;return this.fixedFeatureTarget?1:(i>0?i:1)*this.layerView.view.quality}get _lodDropFactor(){return this.fixedFeatureTarget?1:(Math.min(this.layerView.view.quality,.5)-mt)/(.5-mt)}isGeometryVisible(i){var e;return!!((e=this._index)!=null&&e.isGeometryVisible(i.index))}updateVisibility(i){var e;(e=this._index)==null||e.invalidateNodeVisibilityCache(i)}invalidateGeometryVisibility(i){var e;(e=this._index)==null||e.invalidateGeometryVisibility(i)}invalidateVisibilityObbs(){var i;(i=this._index)==null||i.invalidateVisibilityObbs()}modificationsChanged(){var i;(i=this._index)==null||i.imModificationsChanged(!!this.layerView.hasModifications),this._invisibleDirty=!0}_shouldLoadNode(i){return!(!this._lodHandling.shouldLoadNode(i)||this._shouldDropNode(i))&&!(this._index==null||!this._index.isGeometryVisible(i.index))&&this._isNodeInScaleBounds(i)}_shouldDropNode(i){if(this._viewportQueries==null)return!1;const e=this._lodDropFactor;return e>=1||!this._lodHandling.hasNoVisibleChildren(i)?!1:Math.abs(this._viewportQueries.calcCameraDistanceToCenter(i))-this._viewportQueries.minDistance>(this._viewportQueries.maxDistance-this._viewportQueries.minDistance)*e}_startNodeLoading(){this._restartNodeLoading=!1;const i=this._index;if(this._updatesDisabled||i==null||this._viewportQueries==null)return;this._updateViewData(),this._requiredAttributesDirty&&(this._requiredAttributes=this._getRequiredAttributes(),this._requiredAttributesDirty=!1);const e={textureEncodings:this.layerView.supportedTextureEncodings,uncompressedTextureDownsamplingEnabled:this.layerView.uncompressedTextureDownsamplingEnabled,textureUsageMask:this.layerView.rendererTextureUsage,loadFeatureData:this.useMaximumNumberOfFeatures};this._nodeLoader=new De(this.layer,this.dataStreamController,Z,this._defaultGeometrySchema,this._requiredAttributes,e),i.requestUpdate(),this._lodHandling.startNodeLoading(t=>this._isNodeInScaleBounds(t),(t,s)=>this._removeNodes(t,s,re.fadeout),i,{maxLodLevel:this._viewportQueries.maxLodLevel}),this._evaluateUpdating()}isNodeLoading(){return this._nodeLoader!=null&&this._index!=null}cancelNodeLoading(){this.isNodeLoading()&&(this.indexStreamController.cancelAll(),this.dataStreamController.cancelAll(),this._idleQueue.cancelAll(),this._cancelAllNodes(),this._nodeLoader=null,this._evaluateUpdating())}_removeInvisibleNodes(i){const e=this._index;if(e==null||this._viewportQueries==null)return!1;V.clear(),this.layerView.getLoadedNodeIndices(V);const t=this._viewportQueries.maxDistance===0,s=t?()=>!1:n=>this._shouldDropNode(n);return V.filterInPlace(n=>{const r=e.getNode(n);return r==null||!e.isGeometryVisible(n)||s(r)||!this._isNodeInScaleBounds(r)}),V.length>0&&this._lodHandling.setLodGlobalDirty(),this._removeNodes(V,i,re.pop),!(t&&this._lodDropFactor<1)&&(V.length===0||(V.clear(),!1))}markNodeToRemove(i){V.push(i)}removeMarkedNodes(){this._removeNodes(V,ki,re.pop)}_removeNodes(i,e,t){const s=i.length;if(s!==0&&!e.done){for(this._index!=null&&this._index.requestUpdate();i.length>0&&!e.done;){const n=i.pop(),r=this._index;t===re.fadeout&&this.layerView.nodeFadeoutEnabled&&r!=null&&r.isGeometryVisible(n)?this.layerView.fadeNode(n,pe.FadeOut,!0):this.layerView.removeNode(n),e.madeProgress()}if(this._loadedNodeScales.size>0)for(let n=i.length;nthis.layerView.updateAttributes(i.index,{loadedAttributes:this._requiredAttributes,attributeData:s},e.signal),e.signal)}catch(t){if(!ie(t))return this.layerView.updateAttributes(i.index,{loadedAttributes:this._requiredAttributes,attributeData:{}},e.signal)}this._updatingNodes.delete(i.index),this._evaluateUpdating()}_loadNode(i){if(this._loadingNodes.has(i.index))return void Z.error("already loading node "+i.index);const e=new AbortController;this._loadingNodes.set(i.index,e),this._evaluateUpdating(),this._loadAndAddNode(i,e.signal).then(t=>{t&&this._index!=null&&this._loadingNodes.get(i.index)===e&&(this._loadingNodes.delete(i.index),this._index.requestUpdate())}).catch(t=>{if(!ie(t))throw t}).finally(()=>{this._loadingNodes.get(i.index)===e&&this._loadingNodes.delete(i.index),this._evaluateUpdating()})}_loadAndAddNode(i,e){return i.cacheState===ue.Uncached?this._loadUncached(i,e).then(()=>!1):this._loadCached(i,e).then(t=>!t&&(i.cacheState=ue.Uncached,!0)).catch(t=>!ie(t)&&(i.cacheState=ue.Uncached,!0))}_enableFromGPUCache(i,e){if(this._disableMemCache||this._index==null)return!1;if(e===ne.Hole&&!this._index.useNodeAsHole(i.index))return!0;const t=this._loadCachedGPUData(i);return!!t&&(this.layerView.addCachedGPUData(i,t,e),this._nodeAdded(),!0)}_loadCachedGPUData(i){const e=this.layerView.loadCachedGPUData(i.index);return(e==null?void 0:e.attributeInfo)!=null&&He(e.attributeInfo.loadedAttributes,this._requiredAttributes)?e:(this.layerView.deleteCachedGPUData(e),null)}_nodeAdded(){this._index!=null&&this._index.requestUpdate(),this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating()}updateLoadStatus(i,e){const t=this._index;t!=null&&t.updateChildrenLoaded(i,e?1:-1)}async _loadCached(i,e){if(this._enableFromGPUCache(i,ne.Leaf))return!0;const t=this.layerView;if(this.disableIDBCache||!t.loadCachedNodeData||!t.addCachedNodeData)return!1;const s=(d,c)=>this._nodeLoader.loadTextures(i,d,c),n=(d,c)=>this._clientNodeLoader.loadTextures(i,d,c),r=i.index>=0?s:n,a=await this.schedule(()=>t.loadCachedNodeData(i,e,r),e);if(a==null)return!1;const o=this._requiredAttributes,l=await this.reschedule(()=>this._loadAttributes(i,o,e),e);return await this.reschedule(()=>t.addCachedNodeData(i,a,{loadedAttributes:o,attributeData:l},e),e),this._nodeAdded(),!0}_loadUncached(i,e){return this._downloadingCount++,this._loadNodeData(i,e).catch(t=>{throw this._downloadingCount--,t}).then(t=>(this._downloadingCount--,this.schedule(()=>this.layerView.addNode(i,t,e),e))).then(()=>{this._nodeAdded(),i.cacheState=ue.Cached}).catch(t=>{if(!ie(t))throw Z.error("#loadNodeData()",this.layer,`Failed to load node '${i.id}'`,t),i.failed=!0,this._index!=null&&this._index.requestUpdate(),t})}_updateIdleState(i){i!==this._isIdle&&(this._isIdle=i,this._evaluateUpdating(),i&&this._index&&this._index!=null&&this._index.resetFailedNodes())}_getScale(i){if(this._loadedNodeScales.has(i.index))return this._loadedNodeScales.get(i.index);const e=this._computeScale(i);return this.layerView.isNodeLoaded(i.index)&&this._loadedNodeScales.set(i.index,e),e}_computeScale(i){this._tmpPoint.x=i.mbs[0],this._tmpPoint.y=i.mbs[1],this._tmpPoint.z=i.mbs[2];const e=i.mbs[3];return this.layerView.view.basemapTerrain.getSphereScale(this._tmpPoint,e)}_isNodeInScaleBounds(i){if(!this._areScaleBoundsActive)return!0;const e=this._getScale(i),{minScale:t,maxScale:s}=gt(this.layer);return Ui(e,t,s)}updateStats(i){var e;this.isGraphics3D&&(i.detail=this._featureLOD,i.target=this.featureTarget*this._baseLOD),(e=this._index)==null||e.updateStats(i)}get test(){const i=this;return{index:this._index,set disableUpdates(e){i._updatesDisabled=e,e?i.cancelNodeLoading():i.requestUpdate()},set disableIDBCache(e){i.disableIDBCache=e},set ignoreServiceObb(e){i._index!=null&&(i._index.ignoreServiceObb=e)},shouldLoadNode:e=>i._shouldLoadNode(e)}}notifyLODUpdate(){this._lodHandling.setLodGlobalDirty(),this._evaluateUpdating(),this._index!=null&&this._index.requestUpdate()}geometryFilterChanged(i){const e=this._index;e!=null&&e.layerFilterChanged(i),this._setCameraDirty()}};x([v({readOnly:!0})],D.prototype,"isMeshPyramid",null),x([v({readOnly:!0})],D.prototype,"isGraphics3D",null),x([v({readOnly:!0})],D.prototype,"useMaximumNumberOfFeatures",null),x([v({readOnly:!0})],D.prototype,"indexStreamController",null),x([v({readOnly:!0})],D.prototype,"dataStreamController",null),x([v({readOnly:!0})],D.prototype,"crsVertex",null),x([v({readOnly:!0})],D.prototype,"crsIndex",null),x([v()],D.prototype,"screenSizeFactor",void 0),x([v()],D.prototype,"featureTarget",void 0),x([v()],D.prototype,"fixedFeatureTarget",void 0),x([v()],D.prototype,"layerView",void 0),x([v()],D.prototype,"layer",null),x([v()],D.prototype,"updating",void 0),x([v({readOnly:!0})],D.prototype,"running",null),x([v()],D.prototype,"updatingProgress",void 0),x([v({readOnly:!0})],D.prototype,"leavesReached",void 0),x([v({constructOnly:!0})],D.prototype,"scaleVisibilityEnabled",void 0),x([v({constructOnly:!0})],D.prototype,"worker",void 0),x([v({readOnly:!0,dependsOn:[]})],D.prototype,"rootNodeVisible",null),D=x([Xe($t)],D);const V=new T({deallocator:null});let Be;function He(i,e){return i!=null&&i.length===e.length&&i.every(t=>Ke(e,t.name)>=0)}function Ke(i,e){const t=e.toLowerCase();for(let s=0;s{this._pendingFetchAbortController=null,this._pendingFetchChangedObjectIds=null}),this.is3DOFL&&this._associatedLayer!=null&&(Ee()?this._associatedLayer.load().then(e=>{this.destroyed||(this._original3DOFLDefinitionExpression=e.definitionExpression,this.addHandles(R(()=>this._definitionExpression,t=>e.definitionExpression=t,Je)),this._associatedLayerView=new rs({layer:this._associatedLayer,view:this.view}))}):ee())}destroy(){this.is3DOFL&&this._associatedLayer!=null&&(Ee()?this._associatedLayerView!=null&&(this._associatedLayer.definitionExpression=this._original3DOFLDefinitionExpression):ee()),this._set("layer",null),this._memCache=ji(this._memCache),this._pendingFetchAbortController=qi(this._pendingFetchAbortController),this._pendingFetchChangedObjectIds=null,this._featureIdLocks.clear()}get is3DOFL(){var i;return Bi()&&((i=this._associatedLayer)==null?void 0:i.infoFor3D)!=null}get sortedGeometryChangedObjectIds(){return this.is3DOFL?[...this._geometryChangedObjectIds].sort((i,e)=>i-e):[]}get _associatedLayer(){return this.layer==null?null:this.layer.associatedLayer}get hasGeometryChanges(){return this._geometryChangedObjectIds.size>0}get _definitionExpression(){const i=this.sortedGeometryChangedObjectIds;return i.length===0?"1 = 0":`OBJECTID IN (${i.join(",")})`}get updating(){return this.is3DOFL?this._pendingFetchChangedObjectIds?!0:Ee()?this._associatedLayerView==null||this._associatedLayerView!=null&&this._associatedLayerView.updating:!1:!1}get isEmpty(){return this._pendingFetchChangedObjectIds==null&&this._attributeChangedObjectIds.size===0&&this._geometryChangedObjectIds.size===0}featureHasGeometryChanges(i){return this._geometryChangedObjectIds.has(i)}featureHasAttributeChanges(i){return this._attributeChangedObjectIds.has(i)}createInteractiveEditSession(i){this._attributeChangedObjectIds.add(i);const e=this._interactiveEditingSessions,t=new Js(i,()=>{e.remove(t)});return e.unshift(t),t}async applyAttributeOverrides(i,e,t,s=[]){if(this._pendingFetchChangedObjectIds&&await Hi(this._pendingFetchChangedObjectIds,t),e==null)return;const{attributeData:n,loadedAttributes:r}=e;if(r==null||n==null||this._attributeChangedObjectIds.size===0)return;const a=new Set;for(const l of r)a.add(l.index);for(const l of s)a.has(l.index)||(r.push(l),n[l.name]=new Array(i.length));const o=await this._lockFeatureIds(i);try{const l={attributeData:n,loadedAttributes:r},d=this._getOverridesFromCache(i,l,this._attributeChangedObjectIds),{objectIds:c,fieldNames:h}=d;if(c.length===0||h.length===0)return;const u=await this._queryAttributeOverridesFromAssociatedLayer(c,h,t);if(u==null)return;this._processOverridesFromAssociatedLayer(i,u,h,l)}finally{o.remove()}}updateGeometry(i,e){this._geometryChangedObjectIds.add(i);const t=this._clientGeometryCache.get(i);if(t!=null&&(this.geometryOverrides.remove(t),this._clientGeometryCache.delete(i)),e!=null){const s={oid:i,mesh:e};this.geometryOverrides.add(s),this._clientGeometryCache.set(i,s)}}updateAttributeValue(i,e,t){this._attributeChangedObjectIds.add(i),this._cacheAttributeValue(i,e,t)}featureAdded(i){this.is3DOFL&&ee()&&this._geometryChangedObjectIds.add(i),this._attributeChangedObjectIds.add(i)}_cacheAttributeValue(i,e,t){this._memCache.put(this._getAttributeCacheKey(i,e),t,this._memCacheAttributeValueSize(t))}_getOverridesFromCache(i,{loadedAttributes:e,attributeData:t},s){const n=new Set,r=new Array;for(const o of e)r[o.index]=t[o.name];const a=new Set;for(let o=0;oa-o);const r=Ji(e,n).map(a=>{const o=t.clone();return o.objectIds=a,Ki(Wi(i,o,{signal:s}))});return Promise.all(r)}_processOverridesFromAssociatedLayer(i,e,t,{loadedAttributes:s,attributeData:n}){const r=this._associatedLayer;if(r==null)return;const a=r.objectIdField,o=t.map(h=>(h in n||(n[h]=new Array(i.length)),n[h])),l=new Map(s.map(h=>[h.name,h.index])),d=t.map(h=>l.get(h)),c=new Map(Array.from(i,(h,u)=>[h,u]));for(const h of e){const u=h.attributes[a];for(let _=0;_I-M);for(let I=0;I0){const I=await this._queryGeometryOverridesFromAssociatedLayer(Array.from(this._geometryChangedObjectIds),i);if(I!=null)for(const M of I)M.geometry!=null&&this.updateGeometry(M.attributes[t.objectIdField],M.geometry)}}}_getFetchChangedObjectIdsServerGen(){var t,s;const i=this.layer;if(((t=i.serviceUpdateTimeStamp)==null?void 0:t.lastUpdate)!=null)return i.serviceUpdateTimeStamp.lastUpdate;const e=i.associatedLayer;return((s=e==null?void 0:e.serverGens)==null?void 0:s.minServerGen)!=null?e.serverGens.minServerGen:null}async _lockFeatureIds(i){const e=this._featureIdLocks;let t=!0;for(;t;){const r=new Array;for(const a of i){const o=e.get(a);o&&r.push(o)}r.length===0?t=!1:await Promise.all(r)}const s=ts(),n=s.promise;for(const r of i)e.set(r,n);return Ot(()=>{for(const r of i)e.delete(r);s.resolve()})}get test(){const i=Array.from(this._attributeChangedObjectIds),e=this._pendingFetchChangedObjectIds,t=this;return{changedObjectIds:i,pendingFetchChangedObjectIds:e,get maximumNumberOfEditOVerrides(){return t._maximumNumberOfEditOVerrides},set maximumNumberOfEditOVerrides(s){t._maximumNumberOfEditOVerrides=s}}}};x([v({constructOnly:!0})],P.prototype,"view",void 0),x([v({constructOnly:!0})],P.prototype,"layer",void 0),x([v({readOnly:!0})],P.prototype,"is3DOFL",null),x([v()],P.prototype,"_interactiveEditingSessions",void 0),x([v({readOnly:!0})],P.prototype,"sortedGeometryChangedObjectIds",null),x([v({readOnly:!0})],P.prototype,"geometryOverrides",void 0),x([v()],P.prototype,"_clientGeometryCache",void 0),x([v()],P.prototype,"_associatedLayer",null),x([v()],P.prototype,"_associatedLayerView",void 0),x([v({constructOnly:!0})],P.prototype,"memoryController",void 0),x([v()],P.prototype,"_attributeChangedObjectIds",void 0),x([v()],P.prototype,"_geometryChangedObjectIds",void 0),x([v()],P.prototype,"hasGeometryChanges",null),x([v()],P.prototype,"_pendingFetchChangedObjectIds",void 0),x([v()],P.prototype,"_pendingFetchAbortController",void 0),x([v()],P.prototype,"_definitionExpression",null),x([v()],P.prototype,"updating",null),x([v()],P.prototype,"isEmpty",null),P=x([Xe(We)],P);class Js{constructor(e,t){this.objectId=e,this._remove=t,this._updates=new Map,this._isActive=!0}getAttribute(e){return this._updates.get(e)}setAttribute(e,t){this.isActive&&this._updates.set(e,t)}remove(){this.isActive&&(this._isActive=!1,this._remove())}get isActive(){return this._isActive}}const Ks=1e4,Ws=5e4;export{Es as D,cn as F,gn as M,P as S,me as a,pe as b,C as c,Rs as d,mn as e,_n as f,w as s}; diff --git a/dist/assets/I3SQueryFeatureStore-CLo7XXT-.js b/dist/assets/I3SQueryFeatureStore-CLo7XXT-.js new file mode 100644 index 0000000..838c8ce --- /dev/null +++ b/dist/assets/I3SQueryFeatureStore-CLo7XXT-.js @@ -0,0 +1,7 @@ +import{Z as pe,e as c,y as d,dC as ye,c as B,eh as A,p as q,w as he,de as ge,lz as fe,fV as me,mG as Ee,cX as Z,ar as z,e0 as we,e1 as U,mH as Se,mI as _e,ez as be,ce as Re,mJ as Fe,mK as Ie,fm as se,dR as ve,eF as xe,bm as Oe,mL as $e,cf as Qe,i$ as T,at as G,bn as N,as as L,ca as je,n as Me,dT as Ce,E as H,lE as Te,eQ as Ge,lG as X,e_ as K,ae as Ne,K as ke,jL as De,mM as Ae}from"./index-J0iiHjMT.js";import{a as j,n as Y,u as ee}from"./DefinitionExpressionSceneLayerView-oAOUEjm-.js";import{x as Je}from"./WhereClause-XAMIZ4-B.js";import{a as D}from"./I3SOverrides-5dCbMm3h.js";import{W as Pe}from"./QueryEngine-8tLWlkSE.js";import{d as Ve}from"./FeatureSet-d4S1oKME.js";import{n as Le}from"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import{I as C}from"./I3SMeshView3D-OXYwZo0p.js";const ie="esri.views.3d.layers.i3s.I3SMeshViewFilter",$=pe.getLogger(ie);let g=class extends q{constructor(t){super(t),this._projectionEngineLoaded=!1}initialize(){he(()=>{var t;return((t=this.viewFilter)==null?void 0:t.geometry)||this.layerFilter!=null}).then(()=>this.loadAsyncModule(ge(()=>import("./index-J0iiHjMT.js").then(t=>t.zJ),__vite__mapDeps([0,1])).then(t=>{this.destroyed||(this._geometryEngine=t)})))}get sortedObjectIds(){var e;if(((e=this.viewFilter)==null?void 0:e.objectIds)==null)return null;const t=fe(this.viewFilter.objectIds);return t.sort(),t}get parsedWhereClause(){const t=this.viewFilter!=null?this.viewFilter.where:null;if(t==null||!t)return null;try{return Je.create(t,this.layerFieldsIndex)}catch(e){$.error(`Failed to parse filter where clause: ${e}`)}return null}addFilters(t,e,r,s){const n=this.sortedObjectIds;n!=null&&t.push(l=>me(n,!0,l)),this.addSqlFilter(t,this.parsedWhereClause);const i=j(this._layerMaskGeometries),o=this._geometryEngine;if(i!=null&&this.layerFilter!=null&&o!=null){const l=this.layerFilter.spatialRelationship;t.push((u,h)=>re(o,u,h,s,e,r,i,l))}const a=j(this._viewMaskGeometries);if(a!=null&&this.viewFilter!=null&&o!=null){const l=this.viewFilter.spatialRelationship;t.push((u,h)=>re(o,u,h,s,e,r,a,l))}}isMBSGeometryVisible(t,e,r){const s=j(this._layerMaskGeometries),n=this._geometryEngine;if(s!=null&&this.layerFilter!=null&&n!=null){const o=this.layerFilter.spatialRelationship,a=s[0].spatialReference||e;return D(t,r,M,a)?te(n,M,s,a,o):($.warnOnce("SceneLayer.mask geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0)}const i=j(this._viewMaskGeometries);if(i!=null&&this.viewFilter!=null&&n!=null){const o=this.viewFilter.spatialRelationship,a=i[0].spatialReference||e;return D(t,r,M,a)?te(n,M,i,a,o):($.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter for MBS"),!0)}return!0}get parsedGeometry(){const t=j(this._viewMaskGeometries),e=j(this._layerMaskGeometries);return t==null||e==null?t||e:e.concat(t)}get _layerMaskGeometries(){const t=this.layerFilter;return t==null?null:this._geometryEngine==null?Y:t.spatialRelationship==="disjoint"?t.geometries.map(e=>({type:"polygon",rings:e.rings,spatialReference:e.spatialReference,cache:{}})):[t.geometries.reduce((e,r)=>(e.rings=[...e.rings,...r.rings],e),{type:"polygon",rings:[],spatialReference:t.geometries[0].spatialReference,cache:{}})]}get _viewMaskGeometries(){if(this.viewFilter==null)return null;const{geometry:t}=this.viewFilter;if(t==null)return null;if(this.viewFilter==null||this._geometryEngine==null)return Y;const{distance:e,units:r}=this.viewFilter,s=this.viewFilter.spatialRelationship,n=t.type==="mesh"?t.extent:t;if(e==null||e===0)return k(this._geometryEngine,n,s);const i=r||Ee(n.spatialReference);if(n.spatialReference.isWGS84){const l=this._geometryEngine.geodesicBuffer(n,e,i);return k(this._geometryEngine,l,s)}const o=Z(n,z.WGS84);if(o!=null){const l=Z(this._geometryEngine.geodesicBuffer(o,e,i),n.spatialReference);return k(this._geometryEngine,l,s)}if(!this._projectionEngineLoaded&&(this.loadAsyncModule(we().then(()=>this._projectionEngineLoaded=!0)),!this._projectionEngineLoaded))return null;let a=null;try{a=U(n,z.WGS84)}catch{}if(a)try{a=U(this._geometryEngine.geodesicBuffer(a,e,i),n.spatialReference)}catch{a=null}return a||$.error(`Filter by geodesic buffer (distance) unsupported, failed to project input geometry (${n.spatialReference.wkid}) to WGS84.`),k(this._geometryEngine,a,s)}get updating(){return ee(this._layerMaskGeometries)||ee(this._viewMaskGeometries)}static checkSupport(t){return t!=null&&(t.timeExtent?($.warn("Filters with a timeExtent are not supported for mesh scene layers"),!1):!!Ke(t.spatialRelationship)||($.warn(`Filters with spatialRelationship other than ${oe.join(", ")} are not supported for mesh scene layers`),!1))}};c([d()],g.prototype,"layerFilter",void 0),c([d({type:ye})],g.prototype,"viewFilter",void 0),c([d()],g.prototype,"layerFieldsIndex",void 0),c([d()],g.prototype,"loadAsyncModule",void 0),c([d()],g.prototype,"addSqlFilter",void 0),c([d({readOnly:!0})],g.prototype,"sortedObjectIds",null),c([d({readOnly:!0})],g.prototype,"parsedWhereClause",null),c([d({readOnly:!0})],g.prototype,"parsedGeometry",null),c([d({readOnly:!0})],g.prototype,"_layerMaskGeometries",null),c([d({readOnly:!0})],g.prototype,"_viewMaskGeometries",null),c([d()],g.prototype,"updating",null),c([d()],g.prototype,"_projectionEngineLoaded",void 0),c([d()],g.prototype,"_geometryEngine",void 0),g=c([B(ie)],g);const oe=(t=>t)(["contains","intersects","disjoint"]);function Ke(t){return t!=null&&oe.includes(t)}var y;function k(t,e,r){if(e==null)return null;if(r==="disjoint"&&e.type==="polygon"){const s=e.rings.length,n=e.spatialReference,i=new Array(s);for(let l=0;ll.aabr[0]-u.aabr[0]);const o=new Set,a=new Qe;for(let l=0;l{if(h>=p.aabr[2])return void o.delete(p);if(u.aabr[1]>p.aabr[3]||u.aabr[3]=.5*(e[2]+Fe(s).radius))return!0;const i=ae(t,e,s);return r.every(o=>le(t,o,i,n)!==y.DISCARD)}function re(t,e,r,s,n,i,o,a){const l=o[0].spatialReference||n.spatialReference;if(!D(r.node.mbs,i,M,l))return void $.warnOnce("SceneLayerView.filter.geometry is using unsupported SpatialReference, skipping geometry filter");const u=ae(t,M,l),h=We(a,n,l,s,r.objectHandle);for(const p of o){if(e.length===0)return;switch(le(t,p,u,a)){case y.DISCARD:return void(e.length=0);case y.KEEP:continue}Ie(e,r.featureIds,m=>Be(t,p,m,h))}}(function(t){t[t.KEEP=0]="KEEP",t[t.DISCARD=1]="DISCARD",t[t.TEST=2]="TEST"})(y||(y={}));const M=se(0,0,0,0);function We(t,e,r,s,n){const i=e.renderSpatialReference,o=new Map,a={type:"polygon",rings:[[[0,0,0],[0,0,0],[0,0,0],[0,0,0]]],spatialReference:r};a.rings[0][3]=a.rings[0][0];const l={indices:null,data:null,stride:0,startIndex:0,endIndex:0};let u,h;switch(t){case"intersects":u=(p,m,b)=>p.intersects(m,b)?y.KEEP:y.TEST,h=W;break;case"contains":u=(p,m,b)=>p.contains(m,b)?y.TEST:y.DISCARD,h=W;break;default:u=(p,m,b)=>p.disjoint(m,b)?y.TEST:y.DISCARD,h=ue}return{collection:s,object:n,type:t,maskSR:r,renderSR:i,aabbCache:o,triangle:a,positions:l,triangleTest:u,geometryTest:h}}function ae(t,e,r){const s={type:"point",x:e[0],y:e[1],hasZ:!1,hasM:!1,spatialReference:r},n=!ve(r)&&!xe(r),i=Number.isNaN(e[3])?0:Oe(e[3],0,2*$e.radius),o=n?t.buffer(s,i,1):t.geodesicBuffer(s,i,1);return o.type="polygon",o}function le(t,e,r,s){switch(s){case"intersects":case"contains":return W(t,e,r);case"disjoint":return ue(t,e,r)}}function W(t,e,r){return t.intersects(e,r)?t.contains(e,r)?y.KEEP:y.TEST:y.DISCARD}function ue(t,e,r){return t.intersects(e,r)?t.contains(e,r)?y.DISCARD:y.TEST:y.KEEP}function Be(t,e,r,s){const{collection:n,object:i,renderSR:o,maskSR:a,geometryTest:l,aabbCache:u}=s;let h=u.get(r);if(!h){const R=n.getObjectTransform(i);n.getComponentAabb(i,r,_);const E=[[_[0],_[1],0],[_[0],_[4],0],[_[3],_[4],0],[_[3],_[1],0]];for(let f=0;f<4;++f)T(E[f],E[f],R.rotationScale),G(E[f],E[f],R.position),N(E[f],o,E[f],a);h={type:"polygon",rings:[E],spatialReference:a,cache:{}},h.rings[0][4]=h.rings[0][0],u.set(r,h)}switch(l(t,e,h)){case y.DISCARD:return!1;case y.KEEP:return!0}const{triangle:p,triangleTest:m,positions:b}=s,I=p.rings[0][0],v=p.rings[0][1],x=p.rings[0][2],Q=n.getObjectTransform(i);n.getComponentPositions(i,r,b);const{indices:J,data:S,stride:P,startIndex:ce,endIndex:de}=b;for(let R=ce;Rthis.spatialIndex.events.emit("changed")))}destroy(){this._dataQueryEngineInstance=Me(this._dataQueryEngineInstance),this._set("layerView",null)}async executeQueryForCount(e,r){return this._dataQueryEngine.executeQueryForCount(this._ensureQueryJSON(e),r)}async executeQueryForExtent(e,r){const{count:s,extent:n}=await this._dataQueryEngine.executeQueryForExtent(this._ensureQueryJSON(e),r);return{count:s,extent:Ce.fromJSON(n)}}async executeQueryForIds(e,r){return this._dataQueryEngine.executeQueryForIds(this._ensureQueryJSON(e),r)}async executeQuery(e,r){const s=this._ensureQueryJSON(e);if(s.returnGeometry)throw new H("unsupported-query","returnGeometry is not yet supported for mesh scene layer queries");if(s.returnCentroid)throw new H("unsupported-query","returnCentroid is not yet supported for mesh scene layer queries");const n=await this._dataQueryEngine.executeQuery(s,r),i=Ve.fromJSON(n);return i.features.forEach(o=>{o.geometry=null}),i}_ensureQueryJSON(e){return e==null?this.defaultQueryJSON:e.toJSON()}_ensureDataQueryEngine(){var l;if(this._dataQueryEngineInstance)return this._dataQueryEngineInstance;const e=this.layer.objectIdField||Te,r="esriGeometryPolygon",s=((l=this.layer.fieldsIndex)==null?void 0:l.toJSON())||new Ge([]),n=this.layerView.view.resourceController.scheduler,i=this.spatialReference.toJSON(),o=this.priority,a=this.spatialIndex;return this._dataQueryEngineInstance=new qe({hasZ:!0,hasM:!1,geometryType:r,fieldsIndex:s,timeInfo:null,spatialReference:i,objectIdField:e,featureStore:a,scheduler:n,priority:o}),this._dataQueryEngineInstance}};c([d({constructOnly:!0})],F.prototype,"layerView",void 0),c([d({constructOnly:!0})],F.prototype,"priority",void 0),c([d({constructOnly:!0})],F.prototype,"spatialIndex",void 0),c([d()],F.prototype,"spatialReference",null),c([d()],F.prototype,"layer",null),c([d()],F.prototype,"defaultQueryJSON",null),F=c([B("esri.views.3d.layers.i3s.I3SQueryEngine")],F);class ot{constructor(e){this._objectIdField=e.objectIdField,this._getFeatureExtent=e.getFeatureExtent}getObjectId(e){return e.id}getAttributes(e){var o;const{meta:r,index:s}=e,n={};this._objectIdField&&(n[this._objectIdField]=e.id);const i=(o=r.attributeInfo)==null?void 0:o.attributeData;if(i!=null)for(const a of Object.keys(i))n[a]=X(i[a],s);return n}getAttribute(e,r){var o;if(r===this._objectIdField)return e.id;const{meta:s,index:n}=e,i=(o=s.attributeInfo)==null?void 0:o.attributeData;return i!=null?X(i[r],n):null}getGeometry(e){if(e.geometry)return e.geometry;const[r,s,n,i,o]=this._getFeatureExtent(e,ne);return new K([5],[r,s,n,i,s,n,i,o,n,r,o,n,r,s,n])}getCentroid(e,r){if(e.geometry)return Le(new K,e.geometry,r.hasZ,r.hasM);const[s,n,i,o,a,l]=this._getFeatureExtent(e,ne);return new K([0],[(s+o)/2,(n+a)/2,(i+l)/2])}cloneWithGeometry(e,r){const{id:s,index:n,meta:i}=e;return{id:s,index:n,meta:i,geometry:r}}}const ne=A(),Ze=A();let O=class extends q{constructor(t){super(t),this.events=new ke}forEach(t){this.forAllFeatures(e=>(t(e),C.CONTINUE))}forEachBounds(t,e){const r=this.getFeatureExtent;for(const s of t)e(r(s,Ze))}forEachInBounds(t,e){this.forAllFeatures(r=>{const s=this.getFeatureExtent(r,ze);return De(t,Ae(s,Ue))&&e(r),C.CONTINUE},r=>{if(D(r.node.mbs,this.sourceSpatialReference,w,this.viewSpatialReference),w[0]>=t[0]&&w[2]<=t[2]&&w[1]>=t[1]&&w[3]<=t[3])return C.CONTINUE;const s=Math.max(t[0],Math.min(w[0],t[2])),n=Math.max(t[1],Math.min(w[1],t[3])),i=w[0]-s,o=w[1]-n;return i*i+o*o<=w[3]*w[3]?C.CONTINUE:C.SKIP})}};c([d({constructOnly:!0})],O.prototype,"featureAdapter",void 0),c([d({constructOnly:!0})],O.prototype,"forAllFeatures",void 0),c([d({constructOnly:!0})],O.prototype,"getFeatureExtent",void 0),c([d({constructOnly:!0})],O.prototype,"sourceSpatialReference",void 0),c([d({constructOnly:!0})],O.prototype,"viewSpatialReference",void 0),O=c([B("esri.views.3d.layers.i3s.I3SQueryFeatureStore")],O);const w=se(0,0,0,0),ze=A(),Ue=Ne();export{g as L,F as d,O as l,ot as o}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/I3STreeDebugger-tPVEJfH8.js b/dist/assets/I3STreeDebugger-tPVEJfH8.js new file mode 100644 index 0000000..5d957f6 --- /dev/null +++ b/dist/assets/I3STreeDebugger-tPVEJfH8.js @@ -0,0 +1 @@ +import{e3 as S,h8 as d,aE as a,gn as u,h9 as r,l as b,e as p,y as c,c as g,bA as v,aa as j}from"./index-J0iiHjMT.js";import{d as m}from"./TileTreeDebugger-2DVbY5sQ.js";let h=class extends m{constructor(o){super(o)}getTiles(){const o=this.lv.getVisibleNodes(),t=this.view.renderSpatialReference,i=this.nodeSR;return o.map(s=>y(s,t,i)).filter(S).sort((s,l)=>s.lij[0]===l.lij[0]?s.label>l.label?-1:1:s.lij[0]-l.lij[0])}};function y(o,t,i){const s=o.serviceObb;if(s==null||t==null)return null;d(n,s.quaternion),a(e,s.center),u(e,i,0,e,t,0,1),n[12]=e[0],n[13]=e[1],n[14]=e[2];const l=[[],[],[]];a(e,s.halfSize),r(e,e,n),u(e,t,0,e,i,0,1),l[0].push([e[0],e[1]]),a(e,s.halfSize),e[0]=-e[0],r(e,e,n),u(e,t,0,e,i,0,1),l[0].push([e[0],e[1]]),a(e,s.halfSize),e[0]=-e[0],e[1]=-e[1],r(e,e,n),u(e,t,0,e,i,0,1),l[0].push([e[0],e[1]]),a(e,s.halfSize),e[1]=-e[1],r(e,e,n),u(e,t,0,e,i,0,1),l[0].push([e[0],e[1]]),l[1].push(l[0][0]),l[1].push(l[0][1]),a(e,s.halfSize),e[0]=-e[0],e[2]=-e[2],r(e,e,n),u(e,t,0,e,i,0,1),l[1].push([e[0],e[1]]),a(e,s.halfSize),e[2]=-e[2],r(e,e,n),u(e,t,0,e,i,0,1),l[1].push([e[0],e[1]]),l[2].push(l[0][0]),l[2].push(l[0][3]),a(e,s.halfSize),e[1]=-e[1],e[2]=-e[2],r(e,e,n),u(e,t,0,e,i,0,1),l[2].push([e[0],e[1]]),l[2].push(l[1][3]);const f=new b({rings:l,spatialReference:i});return{lij:[o.level,o.childCount,0],label:o.id,geometry:f}}p([c({constructOnly:!0})],h.prototype,"lv",void 0),p([c({constructOnly:!0})],h.prototype,"nodeSR",void 0),h=p([g("esri.views.3d.layers.support.I3STreeDebugger")],h);const n=v(),e=j();export{h as I3STreeDebugger}; diff --git a/dist/assets/IdentityManager-DTERQ1-w.js b/dist/assets/IdentityManager-DTERQ1-w.js new file mode 100644 index 0000000..4b3c400 --- /dev/null +++ b/dist/assets/IdentityManager-DTERQ1-w.js @@ -0,0 +1,7 @@ +import{e as m,y as _,kM as We,c as oe,hl as Ye,hn as C,hy as lt,oJ as je,d as Re,a2 as ct,oK as ut,dr as Xe,K as Qe,kt as R,oL as Ze,bV as ke,bH as le,fZ as se,E as N,g as ht,fa as G,j6 as Y,bW as M,oM as ce,oN as Ae,oO as Te,f3 as Le,oP as dt,dS as Ue,j9 as pt,oQ as ft,nC as ue,f5 as qe,l5 as vt,oR as gt}from"./index-J0iiHjMT.js";const he="esri-identity-form",L={base:he,group:`${he}__group`,label:`${he}__label`,footer:`${he}__footer`,esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},mt="ArcGIS Online";let z=class extends Ye{constructor(e,t){super(e,t),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){var c;const{error:e,server:t,resource:r,signingIn:i,oAuthPrompt:s,messages:n}=this,l=C("div",{class:L.group},lt(s?n.oAuthInfo:n.info,{server:t&&/\.arcgis\.com/i.test(t)?mt:t,resource:`(${r||n.lblItem})`})),d=s?null:C("div",{class:L.group,key:"username"},C("label",{class:L.label},n.lblUser,C("input",{afterCreate:je,autocomplete:"off",bind:this,class:L.esriInput,"data-node-ref":"_usernameInputNode",required:!0,spellcheck:!1,type:"text",value:""}))),a=s?null:C("div",{class:L.group,key:"password"},C("label",{class:L.label},n.lblPwd,C("input",{afterCreate:je,bind:this,class:L.esriInput,"data-node-ref":"_passwordInputNode",required:!0,type:"password",value:""}))),p=C("div",{class:this.classes(L.group,L.footer)},C("input",{class:L.esriButton,disabled:!!i,type:"submit",value:i?n.lblSigning:n.lblOk}),C("input",{bind:this,class:this.classes(L.esriButton,L.esriButtonSecondary),onclick:this._cancel,type:"button",value:n.lblCancel})),f=e?C("div",null,(c=e.details)!=null&&c.httpStatus?n.invalidUser:n.noAuthService):null;return C("form",{bind:this,class:L.base,onsubmit:this._submit},l,f,d,a,p)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(e){e.preventDefault(),this._set("signingIn",!0);const t=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",t)}};m([_(),We("esri/identity/t9n/identity")],z.prototype,"messages",void 0),m([_()],z.prototype,"signingIn",void 0),m([_()],z.prototype,"server",void 0),m([_()],z.prototype,"resource",void 0),m([_()],z.prototype,"error",void 0),m([_()],z.prototype,"oAuthPrompt",void 0),z=m([oe("esri.identity.IdentityForm")],z);const _t=z;/*! +* tabbable 6.2.0 +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE +*/var $e=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],ge=$e.join(","),et=typeof Element>"u",Q=et?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,me=!et&&Element.prototype.getRootNode?function(o){var e;return o==null||(e=o.getRootNode)===null||e===void 0?void 0:e.call(o)}:function(o){return o==null?void 0:o.ownerDocument},_e=function o(e,t){var r;t===void 0&&(t=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",n=s||t&&e&&o(e.parentNode);return n},bt=function(e){var t,r=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return r===""||r==="true"},tt=function(e,t,r){if(_e(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(ge));return t&&Q.call(e,ge)&&i.unshift(e),i=i.filter(r),i},rt=function o(e,t,r){for(var i=[],s=Array.from(e);s.length;){var n=s.shift();if(!_e(n,!1))if(n.tagName==="SLOT"){var l=n.assignedElements(),d=l.length?l:n.children,a=o(d,!0,r);r.flatten?i.push.apply(i,a):i.push({scopeParent:n,candidates:a})}else{var p=Q.call(n,ge);p&&r.filter(n)&&(t||!e.includes(n))&&i.push(n);var f=n.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(n),c=!_e(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(n));if(f&&c){var v=o(f===!0?n.children:f.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:n,candidates:v})}else s.unshift.apply(s,n.children)}}return i},st=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},X=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||bt(e))&&!st(e)?0:e.tabIndex},yt=function(e,t){var r=X(e);return r<0&&t&&!st(e)?0:r},wt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},it=function(e){return e.tagName==="INPUT"},St=function(e){return it(e)&&e.type==="hidden"},It=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},kt=function(e,t){for(var r=0;rsummary:first-of-type"),n=s?e.parentElement:e;if(Q.call(n,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var l=e;e;){var d=e.parentElement,a=me(e);if(d&&!d.shadowRoot&&i(d)===!0)return Be(e);e.assignedSlot?e=e.assignedSlot:!d&&a!==e.ownerDocument?e=a.host:e=d}e=l}if(xt(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Be(e);return!1},Pt=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},Nt=function o(e){var t=[],r=[];return e.forEach(function(i,s){var n=!!i.scopeParent,l=n?i.scopeParent:i,d=yt(l,n),a=n?o(i.candidates):l;d===0?n?t.push.apply(t,a):t.push(l):r.push({documentOrder:s,tabIndex:d,item:i,isScope:n,content:a})}),r.sort(wt).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(t)},Ct=function(e,t){t=t||{};var r;return t.getShadowRoot?r=rt([e],t.includeContainer,{filter:Ne.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Rt}):r=tt(e,t.includeContainer,Ne.bind(null,t)),Nt(r)},Dt=function(e,t){t=t||{};var r;return t.getShadowRoot?r=rt([e],t.includeContainer,{filter:be.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=tt(e,t.includeContainer,be.bind(null,t)),r},Z=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Q.call(e,ge)===!1?!1:Ne(t,e)},Et=$e.concat("iframe").join(","),xe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Q.call(e,Et)===!1?!1:be(t,e)};/*! +* focus-trap 7.5.4 +* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE +*/function Ve(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(o,i).enumerable})),t.push.apply(t,r)}return t}function Me(o){for(var e=1;e0){var r=e[e.length-1];r!==t&&r.pause()}var i=e.indexOf(t);i===-1||e.splice(i,1),e.push(t)},deactivateTrap:function(e,t){var r=e.indexOf(t);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},qt=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Bt=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},ne=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Vt=function(e){return ne(e)&&!e.shiftKey},Mt=function(e){return ne(e)&&e.shiftKey},Ke=function(e){return setTimeout(e,0)},Ge=function(e,t){var r=-1;return e.every(function(i,s){return t(i)?(r=s,!1):!0}),r},ie=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i1?g-1:0),U=1;U=0)h=r.activeElement;else{var u=n.tabbableGroups[0],g=u&&u.firstTabbableNode;h=g||p("fallbackFocus")}if(!h)throw new Error("Your focus-trap needs to have at least one focusable element");return h},c=function(){if(n.containerGroups=n.containers.map(function(h){var u=Ct(h,s.tabbableOptions),g=Dt(h,s.tabbableOptions),T=u.length>0?u[0]:void 0,U=u.length>0?u[u.length-1]:void 0,P=g.find(function(F){return Z(F)}),D=g.slice().reverse().find(function(F){return Z(F)}),j=!!u.find(function(F){return X(F)>0});return{container:h,tabbableNodes:u,focusableNodes:g,posTabIndexesFound:j,firstTabbableNode:T,lastTabbableNode:U,firstDomTabbableNode:P,lastDomTabbableNode:D,nextTabbableNode:function(J){var te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,K=u.indexOf(J);return K<0?te?g.slice(g.indexOf(J)+1).find(function(re){return Z(re)}):g.slice(0,g.indexOf(J)).reverse().find(function(re){return Z(re)}):u[K+(te?1:-1)]}}}),n.tabbableGroups=n.containerGroups.filter(function(h){return h.tabbableNodes.length>0}),n.tabbableGroups.length<=0&&!p("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(n.containerGroups.find(function(h){return h.posTabIndexesFound})&&n.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},v=function O(h){var u=h.activeElement;if(u)return u.shadowRoot&&u.shadowRoot.activeElement!==null?O(u.shadowRoot):u},b=function O(h){if(h!==!1&&h!==v(document)){if(!h||!h.focus){O(f());return}h.focus({preventScroll:!!s.preventScroll}),n.mostRecentlyFocusedNode=h,qt(h)&&h.select()}},y=function(h){var u=p("setReturnFocus",h);return u||(u===!1?!1:h)},I=function(h){var u=h.target,g=h.event,T=h.isBackward,U=T===void 0?!1:T;u=u||de(g),c();var P=null;if(n.tabbableGroups.length>0){var D=a(u,g),j=D>=0?n.containerGroups[D]:void 0;if(D<0)U?P=n.tabbableGroups[n.tabbableGroups.length-1].lastTabbableNode:P=n.tabbableGroups[0].firstTabbableNode;else if(U){var F=Ge(n.tabbableGroups,function(Se){var Ie=Se.firstTabbableNode;return u===Ie});if(F<0&&(j.container===u||xe(u,s.tabbableOptions)&&!Z(u,s.tabbableOptions)&&!j.nextTabbableNode(u,!1))&&(F=D),F>=0){var J=F===0?n.tabbableGroups.length-1:F-1,te=n.tabbableGroups[J];P=X(u)>=0?te.lastTabbableNode:te.lastDomTabbableNode}else ne(g)||(P=j.nextTabbableNode(u,!1))}else{var K=Ge(n.tabbableGroups,function(Se){var Ie=Se.lastTabbableNode;return u===Ie});if(K<0&&(j.container===u||xe(u,s.tabbableOptions)&&!Z(u,s.tabbableOptions)&&!j.nextTabbableNode(u))&&(K=D),K>=0){var re=K===n.tabbableGroups.length-1?0:K+1,Fe=n.tabbableGroups[re];P=X(u)>=0?Fe.firstTabbableNode:Fe.firstDomTabbableNode}else ne(g)||(P=j.nextTabbableNode(u))}}else P=p("fallbackFocus");return P},w=function(h){var u=de(h);if(!(a(u,h)>=0)){if(ie(s.clickOutsideDeactivates,h)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}ie(s.allowOutsideClick,h)||h.preventDefault()}},B=function(h){var u=de(h),g=a(u,h)>=0;if(g||u instanceof Document)g&&(n.mostRecentlyFocusedNode=u);else{h.stopImmediatePropagation();var T,U=!0;if(n.mostRecentlyFocusedNode)if(X(n.mostRecentlyFocusedNode)>0){var P=a(n.mostRecentlyFocusedNode),D=n.containerGroups[P].tabbableNodes;if(D.length>0){var j=D.findIndex(function(F){return F===n.mostRecentlyFocusedNode});j>=0&&(s.isKeyForward(n.recentNavEvent)?j+1=0&&(T=D[j-1],U=!1))}}else n.containerGroups.some(function(F){return F.tabbableNodes.some(function(J){return X(J)>0})})||(U=!1);else U=!1;U&&(T=I({target:n.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(n.recentNavEvent)})),b(T||n.mostRecentlyFocusedNode||f())}n.recentNavEvent=void 0},ae=function(h){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;n.recentNavEvent=h;var g=I({event:h,isBackward:u});g&&(ne(h)&&h.preventDefault(),b(g))},$=function(h){if(Bt(h)&&ie(s.escapeDeactivates,h)!==!1){h.preventDefault(),l.deactivate();return}(s.isKeyForward(h)||s.isKeyBackward(h))&&ae(h,s.isKeyBackward(h))},S=function(h){var u=de(h);a(u,h)>=0||ie(s.clickOutsideDeactivates,h)||ie(s.allowOutsideClick,h)||(h.preventDefault(),h.stopImmediatePropagation())},k=function(){if(n.active)return ze.activateTrap(i,l),n.delayInitialFocusTimer=s.delayInitialFocus?Ke(function(){b(f())}):b(f()),r.addEventListener("focusin",B,!0),r.addEventListener("mousedown",w,{capture:!0,passive:!1}),r.addEventListener("touchstart",w,{capture:!0,passive:!1}),r.addEventListener("click",S,{capture:!0,passive:!1}),r.addEventListener("keydown",$,{capture:!0,passive:!1}),l},A=function(){if(n.active)return r.removeEventListener("focusin",B,!0),r.removeEventListener("mousedown",w,!0),r.removeEventListener("touchstart",w,!0),r.removeEventListener("click",S,!0),r.removeEventListener("keydown",$,!0),l},ye=function(h){var u=h.some(function(g){var T=Array.from(g.removedNodes);return T.some(function(U){return U===n.mostRecentlyFocusedNode})});u&&b(f())},we=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(ye):void 0,ee=function(){we&&(we.disconnect(),n.active&&!n.paused&&n.containers.map(function(h){we.observe(h,{subtree:!0,childList:!0})}))};return l={get active(){return n.active},get paused(){return n.paused},activate:function(h){if(n.active)return this;var u=d(h,"onActivate"),g=d(h,"onPostActivate"),T=d(h,"checkCanFocusTrap");T||c(),n.active=!0,n.paused=!1,n.nodeFocusedBeforeActivation=r.activeElement,u==null||u();var U=function(){T&&c(),k(),ee(),g==null||g()};return T?(T(n.containers.concat()).then(U,U),this):(U(),this)},deactivate:function(h){if(!n.active)return this;var u=Me({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},h);clearTimeout(n.delayInitialFocusTimer),n.delayInitialFocusTimer=void 0,A(),n.active=!1,n.paused=!1,ee(),ze.deactivateTrap(i,l);var g=d(u,"onDeactivate"),T=d(u,"onPostDeactivate"),U=d(u,"checkCanReturnFocus"),P=d(u,"returnFocus","returnFocusOnDeactivate");g==null||g();var D=function(){Ke(function(){P&&b(y(n.nodeFocusedBeforeActivation)),T==null||T()})};return P&&U?(U(y(n.nodeFocusedBeforeActivation)).then(D,D),this):(D(),this)},pause:function(h){if(n.paused||!n.active)return this;var u=d(h,"onPause"),g=d(h,"onPostPause");return n.paused=!0,u==null||u(),A(),ee(),g==null||g(),this},unpause:function(h){if(!n.paused||!n.active)return this;var u=d(h,"onUnpause"),g=d(h,"onPostUnpause");return n.paused=!1,u==null||u(),c(),k(),ee(),g==null||g(),this},updateContainerElements:function(h){var u=[].concat(h).filter(Boolean);return n.containers=u.map(function(g){return typeof g=="string"?r.querySelector(g):g}),n.active&&c(),ee(),this}},l.updateContainerElements(e),l};const W="esri-identity-modal",V={base:W,open:`${W}--open`,closed:`${W}--closed`,title:`${W}__title`,dialog:`${W}__dialog`,content:`${W}__content`,closeButton:`${W}__close-button`,iconClose:"esri-icon-close"};let H=class extends Ye{constructor(o,e){super(o,e),this.container=document.createElement("div"),this.content=null,this.open=!1,this._focusTrap=null,this._close=()=>{this.open=!1},document.body.appendChild(this.container),this.addHandles(Re(()=>this.open,()=>this._toggleFocusTrap()))}destroy(){this._destroyFocusTrap()}get title(){var o;return(o=this.messages)==null?void 0:o.auth.signIn}render(){const o=this.id,{open:e,content:t,title:r,messages:i}=this,s=e&&!!t,n={[V.open]:s,[V.closed]:!s},l=C("button",{"aria-label":i.close,bind:this,class:V.closeButton,onclick:this._close,title:i.close,type:"button"},C("span",{"aria-hidden":"true",class:V.iconClose})),d=`${o}_title`,a=`${o}_content`,p=r?C("h1",{class:V.title,id:d},r):null,f=s?C("div",{afterCreate:this._createFocusTrap,"aria-describedby":a,"aria-labelledby":d,bind:this,class:V.dialog,role:"dialog"},l,p,this._renderContent(a)):null;return C("div",{class:this.classes(V.base,n),tabIndex:-1},f)}_destroyFocusTrap(){var o;(o=this._focusTrap)==null||o.deactivate({onDeactivate:()=>{}}),this._focusTrap=null}_toggleFocusTrap(){const{_focusTrap:o,open:e}=this;o&&(e?o.activate():o.deactivate())}_createFocusTrap(o){this._destroyFocusTrap();const e=requestAnimationFrame(()=>{this._focusTrap=Kt(o,{initialFocus:"input",onDeactivate:this._close}),this._toggleFocusTrap()});this.addHandles(ct(()=>cancelAnimationFrame(e)))}_renderContent(o){const e=this.content;return typeof e=="string"?C("div",{class:V.content,id:o,innerHTML:e}):ut(e)?C("div",{class:V.content,id:o},e.render()):e instanceof HTMLElement?C("div",{afterCreate:this._attachToNode,bind:e,class:V.content,id:o}):null}_attachToNode(o){const e=this;o.appendChild(e)}};m([_({readOnly:!0})],H.prototype,"container",void 0),m([_()],H.prototype,"content",void 0),m([_()],H.prototype,"open",void 0),m([_(),We("esri/t9n/common")],H.prototype,"messages",void 0),m([_()],H.prototype,"title",null),H=m([oe("esri.identity.IdentityModal")],H);const He=H,Oe="esriJSAPIOAuth";class Ce{constructor(e,t){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=t,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const t=Date.now();this.expires>t&&(this.expires-t)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r||(r=e[t.authNamespace]={}),this.appId||(this.appId=t.appId),r[t.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(Oe,JSON.stringify(e))}catch(i){return console.warn(i),!1}return!0}return!1}destroy(){const e=this._load(),t=this.oAuthInfo;if(t!=null&&t.appId&&(t!=null&&t.portalUrl)&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const r=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",i=new FormData;if(i.append("f","json"),i.append("auth_token",this.refreshToken||this.token),i.append("client_id",t.appId),i.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(r,i);else{const s=new XMLHttpRequest;s.open("POST",r),s.send(i)}}if(t&&t.authNamespace&&t.portalUrl&&this.storage){const r=e[t.authNamespace];if(r){delete r[t.portalUrl];try{this.storage.setItem(Oe,JSON.stringify(e))}catch(i){console.log(i)}}}t&&(t._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),t=this.oAuthInfo;if(t&&t.authNamespace&&t.portalUrl){let r=e[t.authNamespace];r&&(r=r[t.portalUrl],r&&(this.appId=r.appId,this.codeVerifier=r.codeVerifier,this.expires=r.expires,this.refreshToken=r.refreshToken,this.ssl=r.ssl,this.stateUID=r.stateUID,this.token=r.token,this.userId=r.userId))}}_load(){let e={};if(this.storage){const t=this.storage.getItem(Oe);if(t)try{e=JSON.parse(t)}catch(r){console.warn(r)}}return e}}Ce.prototype.declaredClass="esri.identity.OAuthCredential";var De;let E=De=class extends Xe{constructor(o){super(o),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return De.fromJSON(this.toJSON())}};m([_({json:{write:!0}})],E.prototype,"appId",void 0),m([_({json:{write:!0}})],E.prototype,"authNamespace",void 0),m([_({json:{write:!0}})],E.prototype,"expiration",void 0),m([_({json:{write:!0}})],E.prototype,"flowType",void 0),m([_({json:{write:!0}})],E.prototype,"forceLogin",void 0),m([_({json:{write:!0}})],E.prototype,"forceUserId",void 0),m([_({json:{write:!0}})],E.prototype,"locale",void 0),m([_({json:{write:!0}})],E.prototype,"minTimeUntilExpiration",void 0),m([_({json:{write:!0}})],E.prototype,"popup",void 0),m([_({json:{write:!0}})],E.prototype,"popupCallbackUrl",void 0),m([_({json:{write:!0}})],E.prototype,"popupWindowFeatures",void 0),m([_({json:{write:!0}})],E.prototype,"portalUrl",void 0),m([_({json:{write:!0}})],E.prototype,"preserveUrlHash",void 0),m([_({json:{write:!0}})],E.prototype,"userId",void 0),E=De=m([oe("esri.identity.OAuthInfo")],E);const Je=E;let q=class extends Xe{constructor(e){super(e),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};m([_({json:{write:!0}})],q.prototype,"adminTokenServiceUrl",void 0),m([_({json:{write:!0}})],q.prototype,"currentVersion",void 0),m([_({json:{write:!0}})],q.prototype,"hasPortal",void 0),m([_({json:{write:!0}})],q.prototype,"hasServer",void 0),m([_({json:{write:!0}})],q.prototype,"owningSystemUrl",void 0),m([_({json:{write:!0}})],q.prototype,"owningTenant",void 0),m([_({json:{write:!0}})],q.prototype,"server",void 0),m([_({json:{write:!0}})],q.prototype,"shortLivedTokenValidity",void 0),m([_({json:{write:!0}})],q.prototype,"tokenServiceUrl",void 0),m([_({json:{write:!0}})],q.prototype,"webTierAuth",void 0),q=m([oe("esri.identity.ServerInfo")],q);const Pe=q,pe={},nt=o=>{const e=new Y(o.owningSystemUrl).host,t=new Y(o.server).host,r=/.+\.arcgis\.com$/i;return r.test(e)&&r.test(t)},Ee=(o,e)=>!!(nt(o)&&e&&e.some(t=>t.test(o.server)));let fe=null,ve=null;try{fe=window.localStorage,ve=window.sessionStorage}catch{}class ot extends Qe{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.formConstructor=_t,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=ke(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^\/]+\/[^\/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^\/]+)\/?.*/i,this._gwItem=/http.+\/items\/([^\/]+)\/?.*/i,this._gwGroup=/http.+\/groups\/([^\/]+)\/?.*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const t=this.serverInfos;t?(e=e.filter(r=>!this.findServerInfo(r.server)),this.serverInfos=t.concat(e)):this.serverInfos=e,e.forEach(r=>{r.owningSystemUrl&&this._portals.push(r.owningSystemUrl),r.hasPortal&&this._portals.push(r.server)})}registerOAuthInfos(e){const t=this.oAuthInfos;if(t){for(const r of e){const i=this.findOAuthInfo(r.portalUrl);i&&t.splice(t.indexOf(i),1)}this.oAuthInfos=t.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const t=this._sanitizeUrl(e.server),r=this._isServerRsrc(t);let i,s=this.findServerInfo(t),n=!0;s||(s=new Pe,s.server=this._getServerInstanceRoot(t),r?s.hasServer=!0:(s.tokenServiceUrl=this._getTokenSvcUrl(t),s.hasPortal=!0),this.registerServers([s])),i=this._findCredential(t),i?(delete e.server,Object.assign(i,e),n=!1):(i=new x({userId:e.userId,server:s.server,token:e.token,expires:e.expires,ssl:e.ssl,scope:r?"server":"portal"}),i.resources=[t],this.credentials.push(i)),i.emitTokenChange(!1),n||i.refreshServerTokens()}toJSON(){return Ze({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const t=e.serverInfos,r=e.oAuthInfos,i=e.credentials;if(t){const s=[];t.forEach(n=>{n.server&&n.tokenServiceUrl&&s.push(n.declaredClass?n:new Pe(n))}),s.length&&this.registerServers(s)}if(r){const s=[];r.forEach(n=>{n.appId&&s.push(n.declaredClass?n:new Je(n))}),s.length&&this.registerOAuthInfos(s)}i&&i.forEach(s=>{s.server&&s.token&&s.expires&&s.expires>Date.now()&&((s=s.declaredClass?s:new x(s)).emitTokenChange(),this.credentials.push(s))})}findServerInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.serverInfos)if(this._hasSameServerInstance(r.server,e)){t=r;break}return t}findOAuthInfo(e){let t;e=this._sanitizeUrl(e);for(const r of this.oAuthInfos)if(this._hasSameServerInstance(r.portalUrl,e)){t=r;break}return t}findCredential(e,t){if(!e)return;let r;e=this._sanitizeUrl(e);const i=this._isServerRsrc(e)?"server":"portal";if(t){for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&t===s.userId&&s.scope===i){r=s;break}}else for(const s of this.credentials)if(this._hasSameServerInstance(s.server,e)&&this._getIdenticalSvcIdx(e,s)!==-1&&s.scope===i){r=s;break}return r}getCredential(e,t){let r,i,s=!0;t&&(r=!!t.token,i=t.error,s=t.prompt!==!1),t={...t},e=this._sanitizeUrl(e);const n=new AbortController,l=le();if(t.signal&&se(t.signal,()=>{n.abort()}),se(n,()=>{l.reject(new N("identity-manager:user-aborted","ABORTED"))}),ht(n))return l.promise;t.signal=n.signal;const d=this._isAdminResource(e),a=r?this.findCredential(e):null;let p;if(a&&i&&i.details&&i.details.httpStatus===498)a.destroy();else if(a)return p=new N("identity-manager:not-authorized","You are currently signed in as: '"+a.userId+"'. You do not have access to this resource: "+e,{error:i}),l.reject(p),l.promise;const f=this._findCredential(e,t);if(f)return l.resolve(f),l.promise;let c=this.findServerInfo(e);if(c)!c.hasPortal&&c.server&&c.owningSystemUrl&&this._hasSameServerInstance(c.server,c.owningSystemUrl)&&(c.hasPortal=!0),!c.hasServer&&this._isServerRsrc(e)&&(c._restInfoPms=this._getTokenSvcUrl(e),c.hasServer=!0);else{const v=this._getTokenSvcUrl(e);if(!v)return p=new N("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),l.reject(p),l.promise;c=new Pe,c.server=this._getServerInstanceRoot(e),typeof v=="string"?(c.tokenServiceUrl=v,c.hasPortal=!0):(c._restInfoPms=v,c.hasServer=!0),this.registerServers([c])}return c.hasPortal&&c._selfReq===void 0&&(s||G(c.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(v=>v.tokenServiceUrl===c.tokenServiceUrl))&&(c._selfReq={owningTenant:t==null?void 0:t.owningTenant,selfDfd:this._getPortalSelf(c.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,c,t,l,d)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,t,r){const i=this._rePortalTokenSvc.test(e.tokenServiceUrl),s=new Y(this._appOrigin),n=e.shortLivedTokenValidity;let l,d,a,p,f,c,v,b;t&&(b=this.tokenValidity||n||this._defaultTokenValidity,b>n&&n>0&&(b=n)),r&&(l=r.isAdmin,d=r.serverUrl,a=r.token,c=r.signal,v=r.ssl,e.customParameters=r.customParameters),l?p=e.adminTokenServiceUrl:(p=e.tokenServiceUrl,f=new Y(p.toLowerCase()),e.webTierAuth&&(r!=null&&r.serverUrl)&&!v&&s.scheme==="http"&&(G(s.uri,p,!0)||f.scheme==="https"&&s.host===f.host&&s.port==="7080"&&f.port==="7443")&&(p=p.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const y={query:{request:"getToken",username:t==null?void 0:t.username,password:t==null?void 0:t.password,serverUrl:d,token:a,expiration:b,referer:l||i?this._appOrigin:null,client:l?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,r),signal:c,...r==null?void 0:r.ioArgs};return i||(y.withCredentials=!1),M(p,y).then(I=>{const w=I.data;if(!(w!=null&&w.token))return new N("identity-manager:authentication-failed","Unable to generate token");const B=e.server;return pe[B]||(pe[B]={}),t&&(pe[B][t.username]=t.password),w.validity=b,w})}isBusy(){return!!this._busy}checkSignInStatus(e){return this.checkAppAccess(e,"").then(t=>t.credential)}checkAppAccess(e,t,r){let i=!1;return this.getCredential(e,{prompt:!1}).then(s=>{let n;const l={f:"json"};if(s.scope==="portal")if(t&&(this._doPortalSignIn(e)||r!=null&&r.force))n=s.server+"/sharing/rest/oauth2/validateAppAccess",l.client_id=t;else{if(!s.token)return{credential:s};n=s.server+"/sharing/rest"}else{if(!s.token)return{credential:s};n=s.server+"/rest/services"}return s.token&&(l.token=s.token),M(n,{query:l,authMode:"anonymous"}).then(d=>{if(d.data.valid===!1)throw new N("identity-manager:not-authorized",`You are currently signed in as: '${s.userId}'.`,d.data);return i=!!d.data.viewOnlyUserTypeApp,{credential:s}}).catch(d=>{var p;if(d.name==="identity-manager:not-authorized")throw d;const a=(p=d.details)==null?void 0:p.httpStatus;if(a===498)throw s.destroy(),new N("identity-manager:not-authenticated","User is not signed in.");if(a===400)throw new N("identity-manager:invalid-request");return{credential:s}})}).then(s=>({credential:s.credential,viewOnly:i}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.substring(1)),this._processOAuthPopupParams(ce(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,t,r={}){const i=le(),s=()=>{var f;d==null||d.remove(),a==null||a.remove(),p==null||p.remove(),l==null||l.destroy(),(f=this.dialog)==null||f.destroy(),this.dialog=l=d=a=p=null},n=()=>{s(),this._oAuthDfd=null,i.reject(new N("identity-manager:user-aborted","ABORTED"))};r.signal&&se(r.signal,()=>{n()});let l=new this.formConstructor;l.resource=this.getResourceName(e),l.server=t.server,this.dialog=new He,this.dialog.content=l,this.dialog.open=!0,this.emit("dialog-create");let d=l.on("cancel",n),a=Re(()=>this.dialog.open,n),p=l.on("submit",f=>{this.generateToken(t,f,{isAdmin:r.isAdmin,signal:r.signal}).then(c=>{s();const v=new x({userId:f.username,server:t.server,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:r.isAdmin,validity:c.validity});i.resolve(v)}).catch(c=>{l.error=c,l.signingIn=!1})});return i.promise}oAuthSignIn(e,t,r,i){this._oAuthDfd=le();const s=this._oAuthDfd;let n;i!=null&&i.signal&&se(i.signal,()=>{const b=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;b&&!b.closed?b.close():this.dialog&&c()}),s.resUrl_=e,s.sinfo_=t,s.oinfo_=r;const l=r._oAuthCred;if(l.storage&&(r.flowType==="authorization-code"||r.flowType==="auto"&&t.currentVersion>=8.4)){let b=crypto.getRandomValues(new Uint8Array(32));n=Ae(b),l.codeVerifier=n,b=crypto.getRandomValues(new Uint8Array(32)),l.stateUID=Ae(b),l.save()||(l.codeVerifier=n=null)}else l.codeVerifier=null;let d,a,p,f;this._getCodeChallenge(n).then(b=>{const y=!i||i.oAuthPopupConfirmation!==!1;r.popup&&y?(d=new this.formConstructor,d.oAuthPrompt=!0,d.server=t.server,this.dialog=new He,this.dialog.content=d,this.dialog.open=!0,this.emit("dialog-create"),a=d.on("cancel",c),p=Re(()=>this.dialog.open,c),f=d.on("submit",()=>{v(),this._doOAuthSignIn(e,t,r,b)})):this._doOAuthSignIn(e,t,r,b)});const c=()=>{v(),this._oAuthDfd=null,s.reject(new N("identity-manager:user-aborted","ABORTED"))},v=()=>{var b;a==null||a.remove(),p==null||p.remove(),f==null||f.remove(),d==null||d.destroy(),(b=this.dialog)==null||b.destroy(),this.dialog=null};return s.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=Te(window,"message",t=>{var r;if((t.origin===this._appOrigin||t.origin.endsWith(".arcgis.com"))&&((r=t.data)==null?void 0:r.type)==="arcgis:auth:requestCredential"){const i=t.source;this.getCredential(e).then(s=>{i.postMessage({type:"arcgis:auth:credential",credential:{expires:s.expires,server:s.server,ssl:s.ssl,token:s.token,userId:s.userId}},t.origin)}).catch(s=>{i.postMessage({type:"arcgis:auth:error",error:{name:s.name,message:s.message}},t.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){var r,i;let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.substring(1));const s=ce(e);let n=!1;if(s.access_token&&s.expires_in&&s.state&&s.hasOwnProperty("username"))try{s.state=JSON.parse(s.state),s.state.portalUrl&&(this._oAuthLocationParams=s,n=!0)}catch{}else if(s.error&&s.error_description&&(console.log("IdentityManager OAuth Error: ",s.error," - ",s.error_description),s.error==="access_denied"&&(n=!0,s.state)))try{s.state=JSON.parse(s.state)}catch{}n&&(window.location.hash=((r=s.state)==null?void 0:r.hash)||"")}let t=window.location.search;if(t){t.charAt(0)==="?"&&(t=t.substring(1));const s=ce(t);let n=!1;if(s.code&&s.state)try{s.state=JSON.parse(s.state),s.state.portalUrl&&s.state.uid&&(this._oAuthLocationParams=s,n=!0)}catch{}else if(s.error&&s.error_description&&(console.log("IdentityManager OAuth Error: ",s.error," - ",s.error_description),s.error==="access_denied"&&(n=!0,s.state)))try{s.state=JSON.parse(s.state)}catch{}if(n){const l={...s};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete l[p]});const d=Le(l),a=window.location.pathname+(d?`?${d}`:"")+(((i=s.state)==null?void 0:i.hash)||"");window.history.replaceState(window.history.state,"",a)}}}_getOAuthToken(e,t,r,i,s){return e=e.replace(/^http:/i,"https:"),M(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:i&&s?{grant_type:"authorization_code",code:t,redirect_uri:i,client_id:r,code_verifier:s}:{grant_type:"refresh_token",refresh_token:t,client_id:r}}).then(n=>n.data)}_getCodeChallenge(e){if(e&&globalThis.isSecureContext){const t=new TextEncoder().encode(e);return crypto.subtle.digest("SHA-256",t).then(r=>Ae(new Uint8Array(r)))}return Promise.resolve(null)}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const t=new N("identity-manager:user-aborted","ABORTED");this._errbackFunc(t)}}_findCredential(e,t){let r,i,s,n,l=-1;const d=t==null?void 0:t.token,a=t==null?void 0:t.resource,p=this._isServerRsrc(e)?"server":"portal",f=this.credentials.filter(c=>this._hasSameServerInstance(c.server,e)&&c.scope===p);if(e=a||e,f.length)if(f.length===1){if(r=f[0],s=this.findServerInfo(r.server),i=s==null?void 0:s.owningSystemUrl,n=i?this.findCredential(i,r.userId):void 0,l=this._getIdenticalSvcIdx(e,r),!d)return l===-1&&r.resources.push(e),this._addResource(e,n),r;l!==-1&&(r.resources.splice(l,1),this._removeResource(e,n))}else{let c,v;if(f.some(b=>(v=this._getIdenticalSvcIdx(e,b),v!==-1&&(c=b,s=this.findServerInfo(c.server),i=s==null?void 0:s.owningSystemUrl,n=i?this.findCredential(i,c.userId):void 0,l=v,!0))),d)c&&(c.resources.splice(l,1),this._removeResource(e,n));else if(c)return this._addResource(e,n),c}}_findOAuthInfo(e){let t=this.findOAuthInfo(e);if(!t){for(const r of this.oAuthInfos)if(this._isIdProvider(r.portalUrl,e)){t=r;break}}return t}_addResource(e,t){t&&this._getIdenticalSvcIdx(e,t)===-1&&t.resources.push(e)}_removeResource(e,t){let r=-1;t&&(r=this._getIdenticalSvcIdx(e,t),r>-1&&t.resources.splice(r,1))}_useProxy(e,t){return(t==null?void 0:t.isAdmin)&&!G(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!G(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const t=new Y(e);return t.scheme+"://"+t.host+(t.port!=null?":"+t.port:"")}_getServerInstanceRoot(e){const t=e.toLowerCase();let r=t.indexOf(this._agsRest);return r===-1&&this._isAdminResource(e)&&(r=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),r!==-1||dt(t)||(r=t.indexOf("/sharing")),r===-1&&t.substr(-1)==="/"&&(r=t.length-1),r>-1?e.substring(0,r):e}_hasSameServerInstance(e,t){return e.substr(-1)==="/"&&(e=e.slice(0,-1)),e=e.toLowerCase(),t=this._getServerInstanceRoot(t).toLowerCase(),e=this._normalizeAGOLorgDomain(e),t=this._normalizeAGOLorgDomain(t),(e=e.substr(e.indexOf(":")))===(t=t.substr(t.indexOf(":")))}_normalizeAGOLorgDomain(e){const t=/^https?:\/\/(?:cdn|[a-z\d-]+\.maps)\.arcgis\.com/i,r=/^https?:\/\/(?:cdndev|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,i=/^https?:\/\/(?:cdnqa|[a-z\d-]+\.mapsqa)\.arcgis\.com/i;return t.test(e)?e=e.replace(t,"https://www.arcgis.com"):r.test(e)?e=e.replace(r,"https://devext.arcgis.com"):i.test(e)&&(e=e.replace(i,"https://qaext.arcgis.com")),e}_sanitizeUrl(e){const t=(Ue.request.proxyUrl||"").toLowerCase(),r=t?e.toLowerCase().indexOf(t+"?"):-1;return r!==-1&&(e=e.substring(r+t.length+1)),e=pt(e),ke(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,t){let r=!1;if(this._isRESTService(e)&&this._isRESTService(t)){const i=this._getSuffix(e).toLowerCase(),s=this._getSuffix(t).toLowerCase();if(r=i===s,!r){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;r=i.replaceAll(n,"$1")===s.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(t)?r=!0:this._isServerRsrc(e)||this._isServerRsrc(t)||!this._isPortalDomain(e)||(r=!0);return r}_isPortalDomain(e){const t=new Y(e.toLowerCase()),r=this._portalConfig;let i=this._gwDomains.some(s=>s.regex.test(t.uri));return!i&&r&&(i=this._hasSameServerInstance(this._getServerInstanceRoot(r.restBaseUrl),t.uri)),i||Ue.portalUrl&&(i=G(t,Ue.portalUrl,!0)),i||(i=this._portals.some(s=>this._hasSameServerInstance(s,t.uri))),i=i||this._agsPortal.test(t.path),i}_isIdProvider(e,t){let r=-1,i=-1;this._gwDomains.forEach((n,l)=>{r===-1&&n.regex.test(e)&&(r=l),i===-1&&n.regex.test(t)&&(i=l)});let s=!1;if(r>-1&&i>-1&&(r===0||r===4?i!==0&&i!==4||(s=!0):r===1?i!==1&&i!==2||(s=!0):r===2?i===2&&(s=!0):r===3&&i===3&&(s=!0)),!s){const n=this.findServerInfo(t),l=n==null?void 0:n.owningSystemUrl;l&&nt(n)&&this._isPortalDomain(l)&&this._isIdProvider(e,l)&&(s=!0)}return s}_getIdenticalSvcIdx(e,t){let r=-1;for(let i=0;in.data),{adminUrl:t,promise:r}}if(this._isPortalDomain(e)){let s="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(s=n.tokenServiceUrl),!!s)),s||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(s=n+this._gwTokenUrl),!!s)),s||(i=e.toLowerCase().indexOf("/sharing"),i!==-1&&(s=e.substring(0,i)+this._gwTokenUrl)),s||(s=this._getOrigin(e)+this._gwTokenUrl),s){const n=new Y(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(s=s.replace(/:7080/i,":7443")),s=s.replace(/http:/i,"https:")}return s}if(e.toLowerCase().includes("premium.arcgisonline.com"))return"https://premium.arcgisonline.com/server/tokens"}_processOAuthResponseParams(e,t,r){const i=t._oAuthCred;if(e.code){const n=i.codeVerifier;return i.codeVerifier=null,i.stateUID=null,i.save(),this._getOAuthToken(r.server,e.code,t.appId,this._getRedirectURI(t,!0),n).then(l=>{const d=new x({userId:l.username,server:r.server,token:l.access_token,expires:Date.now()+1e3*l.expires_in,ssl:l.ssl,oAuthState:e.state,_oAuthCred:i});return t.userId=d.userId,i.storage=l.persist?fe:ve,i.refreshToken=l.refresh_token,i.token=null,i.expires=l.refresh_token_expires_in?Date.now()+1e3*l.refresh_token_expires_in:null,i.userId=d.userId,i.ssl=d.ssl,i.save(),d})}const s=new x({userId:e.username,server:r.server,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:i});return t.userId=s.userId,i.storage=e.persist?fe:ve,i.refreshToken=null,i.token=s.token,i.expires=s.expires,i.userId=s.userId,i.ssl=s.ssl,i.save(),Promise.resolve(s)}_processOAuthPopupParams(e){var r;const t=this._oAuthDfd;if(this._oAuthDfd=null,t)if(clearInterval(this._oAuthIntervalId),(r=this._oAuthOnPopupHandle)==null||r.remove(),e.error){const i=e.error==="access_denied",s=new N(i?"identity-manager:user-aborted":"identity-manager:authentication-failed",i?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);t.reject(s)}else this._processOAuthResponseParams(e,t.oinfo_,t.sinfo_).then(i=>{t.resolve(i)}).catch(i=>{t.reject(i)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.substring(1)),this._processOAuthPopupParams(ce(e)))}_exchangeToken(e,t,r){return M(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:t,token:r}}).then(i=>i.data.token)}_getPlatformSelf(e,t){return e=e.replace(/^http:/i,"https:"),M(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":t,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0}).then(r=>r.data)}_getPortalSelf(e,t){let r;return this._gwDomains.some(i=>(i.regex.test(e)&&(r=i.customBaseUrl),!!r)),r?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:r,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(t)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),M(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(i=>i.data))}_doPortalSignIn(e){const t=this._portalConfig,r=window.location.href,i=this.findServerInfo(e);return!(!t&&!this._isPortalDomain(r)||!(i?i.hasPortal||i.owningSystemUrl&&this._isPortalDomain(i.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(r,e)||t&&(this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),e)||this._isIdProvider(t.restBaseUrl,e))||G(r,e,!0)))}_checkProtocol(e,t,r,i){let s=!0;const n=i?t.adminTokenServiceUrl:t.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ft(n)&&(s=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:t}),!s)&&r(new N("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),s}_enqueue(e,t,r,i,s,n){return i||(i=le()),i.resUrl_=e,i.sinfo_=t,i.options_=r,i.admin_=s,i.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(i)):this._xoReqs.push(i):this._doSignIn(i),i.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const t=a=>{var I;const p=(I=e.options_)==null?void 0:I.resource,f=e.resUrl_,c=e.refresh_;let v=!1;this.credentials.includes(a)||(c&&this.credentials.includes(c)?(c.userId=a.userId,c.token=a.token,c.expires=a.expires,c.validity=a.validity,c.ssl=a.ssl,c.creationTime=a.creationTime,v=!0,a=c):this.credentials.push(a)),a.resources||(a.resources=[]),a.resources.includes(p||f)||a.resources.push(p||f),a.scope=this._isServerRsrc(f)?"server":"portal",a.emitTokenChange();const b=this._soReqs,y={};this._soReqs=[],b.forEach(w=>{if(!this._isIdenticalService(f,w.resUrl_)){const B=this._getSuffix(w.resUrl_);y[B]||(y[B]=!0,a.resources.push(w.resUrl_))}}),e.resolve(a),b.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(f),w.resUrl_)?w.resolve(a):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,v||this.emit("credential-create",{credential:a}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=a=>{e.reject(a),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},i=(a,p,f,c)=>{var B,ae,$;const v=e.sinfo_,b=!e.options_||e.options_.prompt!==!1,y=v.hasPortal&&this._findOAuthInfo(e.resUrl_);let I,w;if(a)t(new x({userId:a,server:v.server,token:f||null,expires:c!=null?Number(c):null,ssl:!!p}));else if(window!==window.parent&&((B=this._appUrlObj.query)!=null&&B["arcgis-auth-origin"])&&((ae=this._appUrlObj.query)!=null&&ae["arcgis-auth-portal"])&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const S=Te(window,"message",k=>{k.source===window.parent&&k.data&&(k.data.type==="arcgis:auth:credential"?(S.remove(),k.data.credential.expires{S.remove()})}else if(y){let S=y._oAuthCred;if(!S){const k=new Ce(y,fe),A=new Ce(y,ve);k.isValid()&&A.isValid()?k.expires>A.expires?(S=k,A.destroy()):(S=A,k.destroy()):S=k.isValid()?k:A,y._oAuthCred=S}if(S.isValid()){I=new x({userId:S.userId,server:v.server,token:S.token,expires:S.expires,ssl:S.ssl,_oAuthCred:S});const k=y.appId!==S.appId&&this._doPortalSignIn(e.resUrl_);k||S.refreshToken?(e._pendingDfd=S.refreshToken?this._getOAuthToken(v.server,S.refreshToken,S.appId).then(A=>(I.expires=Date.now()+1e3*A.expires_in,I.token=A.access_token,I)):Promise.resolve(I),e._pendingDfd.then(A=>k?this._exchangeToken(A.server,y.appId,A.token).then(ye=>(A.token=ye,A)).catch(()=>A):A).then(A=>{t(A)}).catch(()=>{S==null||S.destroy(),i()})):t(I)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(y.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===S.stateUID&&S.codeVerifier)){const k=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(k,y,v).then(A=>{t(A)}).catch(r)}else{const k=()=>{b?e._pendingDfd=this.oAuthSignIn(e.resUrl_,v,y,e.options_).then(t,r):(w=new N("identity-manager:not-authenticated","User is not signed in."),r(w))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(v.server,y.appId).then(A=>{G(A.portalUrl,this._appOrigin,!0)?(I=new x({userId:A.username,server:v.server,expires:Date.now()+1e3*A.expires_in,token:A.token}),t(I)):k()}).catch(k):k()}}else if(b){if(this._checkProtocol(e.resUrl_,v,r,e.admin_)){let S=e.options_;e.admin_&&(S=S||{},S.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,v,S).then(t,r)}}else w=new N("identity-manager:not-authenticated","User is not signed in."),r(w)},s=()=>{const a=e.sinfo_,p=a.owningSystemUrl,f=e.options_;let c,v,b,y;if(f&&(c=f.token,v=f.error,b=f.prompt),y=this._findCredential(p,{token:c,resource:e.resUrl_}),!y){for(const I of this.credentials)if(this._isIdProvider(p,I.server)){y=I;break}}if(y){const I=this.findCredential(e.resUrl_,y.userId);if(I)t(I);else if(Ee(a,this._legacyFed)){const w=y.toJSON();w.server=a.server,w.resources=null,t(new x(w))}else(e._pendingDfd=this.generateToken(this.findServerInfo(y.server),null,{serverUrl:e.resUrl_,token:y.token,signal:e.options_.signal,ssl:y.ssl})).then(w=>{t(new x({userId:y==null?void 0:y.userId,server:a.server,token:w.token,expires:w.expires!=null?Number(w.expires):null,ssl:!!w.ssl,isAdmin:e.admin_,validity:w.validity}))},r)}else this._busy=null,c&&(e.options_.token=null),(e._pendingDfd=this.getCredential(p.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:a.owningTenant,signal:e.options_.signal,token:c,error:v,prompt:b})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},I=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(I)})};this._errbackFunc=r;const n=e.sinfo_.owningSystemUrl,l=this._isServerRsrc(e.resUrl_),d=e.sinfo_._restInfoPms;d?d.promise.then(a=>{const p=e.sinfo_;if(p._restInfoPms){p.adminTokenServiceUrl=p._restInfoPms.adminUrl,p._restInfoPms=null,p.tokenServiceUrl=(ue("authInfo.tokenServicesUrl",a)||ue("authInfo.tokenServiceUrl",a)||ue("tokenServiceUrl",a))??null,p.shortLivedTokenValidity=ue("authInfo.shortLivedTokenValidity",a)??null,p.currentVersion=a.currentVersion,p.owningTenant=a.owningTenant;const f=p.owningSystemUrl=a.owningSystemUrl;f&&this._portals.push(f)}l&&p.owningSystemUrl?s():i()},()=>{e.sinfo_._restInfoPms=null;const a=new N("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");r(a)}):l&&n?s():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(a=>{var y;const p={};let f,c,v,b;return a&&(f=(y=a.user)==null?void 0:y.username,p.username=f,p.allSSL=a.allSSL,c=a.supportsOAuth,b=parseFloat(a.currentVersion),a.portalMode==="multitenant"&&(v=a.customBaseUrl),e.sinfo_.currentVersion=b),e.sinfo_.webTierAuth=!!f,f&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:p.allSSL}).catch(()=>null).then(I=>(p.portalToken=I&&I.token,p.tokenExpiration=I&&I.expires,p)):!f&&c&&b>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:v,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>p):p}).catch(()=>null).then(a=>{e.sinfo_._selfReq=null,a?i(a.username,a.allSSL,a.portalToken,a.tokenExpiration):i()}):i()}_generateOAuthInfo(e){let t,r=null,i=e.portalUrl;const s=e.customBaseUrl,n=e.owningTenant,l=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(l){r=window.location.href;let d=r.indexOf("?");d>-1&&(r=r.slice(0,d)),d=r.search(/\/(apps|home)\//),r=d>-1?r.slice(0,d):null}return l&&r?(this._hasTestedIfAppIsOnPortal=!0,t=M(r+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new Je({appId:"arcgisonline",popupCallbackUrl:r+"/home/oauth-callback.html"})})):t=Promise.resolve(),t.then(()=>{if(this._defaultOAuthInfo)return i=i.replace(/^http:/i,"https:"),M(i+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:qe(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(d=>{if(d.data.valid){const a=this._defaultOAuthInfo.clone();d.data.urlKey&&s?a.portalUrl="https://"+d.data.urlKey.toLowerCase()+"."+s:a.portalUrl=i,a.popup=window!==window.top||!(G(i,this._appOrigin)||this._gwDomains.some(p=>p.regex.test(i)&&p.regex.test(this._appOrigin))),this.oAuthInfos.push(a)}})})}_doOAuthSignIn(e,t,r,i){const s=r._oAuthCred,n={portalUrl:r.portalUrl};!r.popup&&r.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),s.stateUID&&(n.uid=s.stateUID);const l={client_id:r.appId,response_type:s.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:r.expiration,locale:r.locale,redirect_uri:this._getRedirectURI(r,!!s.codeVerifier)};r.forceLogin&&(l.force_login=!0),r.forceUserId&&r.userId&&(l.prepopulatedusername=r.userId),!r.popup&&this._doPortalSignIn(e)&&(l.redirectToUserOrgUrl=!0),s.codeVerifier&&(l.code_challenge=i||s.codeVerifier,l.code_challenge_method=i?"S256":"plain");const d=r.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",a=d+"?"+Le(l);if(r.popup){const p=window.open(a,"esriJSAPIOAuth",r.popupWindowFeatures);if(p)p.focus(),this._oAuthDfd.oAuthWin_=p,this._oAuthIntervalId=setInterval(()=>{if(p.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const f=this._oAuthDfd;if(f){const c=new N("identity-manager:user-aborted","ABORTED");f.reject(c)}}},500),this._oAuthOnPopupHandle=Te(window,["arcgis:auth:hash","arcgis:auth:location:search"],f=>{f.type==="arcgis:auth:hash"?this.setOAuthResponseHash(f.detail):this._setOAuthResponseQueryString(f.detail)});else{const f=new N("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(f)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:l,authorizeUrl:d,resourceUrl:e,serverInfo:t,oAuthInfo:r}):window.location.href=a}_getRedirectURI(e,t){const r=window.location.href.replace(/#.*$/,"");if(e.popup)return qe(e.popupCallbackUrl);if(t){const i=ke(r);return i.query&&["code","error","error_description","message_code","persist","state"].forEach(s=>{delete i.query[s]}),vt(i.path,i.query)}return r}}ot.prototype.declaredClass="esri.identity.IdentityManagerBase";let x=class extends Qe.EventedAccessor{constructor(o){super(o),this._oAuthCred=null,this.tokenRefreshBuffer=2,o!=null&&o._oAuthCred&&(this._oAuthCred=o._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const o=R.findServerInfo(this.server),e=o==null?void 0:o.owningSystemUrl,t=!!e&&this.scope==="server",r=t&&Ee(o,R._legacyFed),i=o.webTierAuth,s=i&&R.normalizeWebTierAuth,n=pe[this.server],l=n==null?void 0:n[this.userId];let d,a=this.resources&&this.resources[0],p=t?R.findServerInfo(e):null,f={username:this.userId,password:l};if(i&&!s)return;t&&!p&&R.serverInfos.some(v=>(R._isIdProvider(e,v.server)&&(p=v),!!p));const c=p?R.findCredential(p.server,this.userId):null;if(!t||c){if(!r){if(t)d={serverUrl:a,token:c==null?void 0:c.token,ssl:c&&c.ssl};else if(s)f=null,d={ssl:this.ssl};else{if(!l){let v;return a&&(a=R._sanitizeUrl(a),this._enqueued=1,v=R._enqueue(a,o,null,null,this.isAdmin,this),v.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),v}this.isAdmin&&(d={isAdmin:!0})}return R.generateToken(t?p:o,t?null:f,d).then(v=>{this.token=v.token,this.expires=v.expires!=null?Number(v.expires):null,this.creationTime=Date.now(),this.validity=v.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}c==null||c.refreshToken()}}refreshServerTokens(){this.scope==="portal"&&R.credentials.forEach(o=>{const e=R.findServerInfo(o.server),t=e==null?void 0:e.owningSystemUrl;o!==this&&o.userId===this.userId&&t&&o.scope==="server"&&(R._hasSameServerInstance(this.server,t)||R._isIdProvider(t,this.server))&&(Ee(e,R._legacyFed)?(o.token=this.token,o.expires=this.expires,o.creationTime=this.creationTime,o.validity=this.validity,o.emitTokenChange()):o.refreshToken())})}emitTokenChange(o){clearTimeout(this._refreshTimer);const e=this.server?R.findServerInfo(this.server):null,t=e==null?void 0:e.owningSystemUrl,r=t?R.findServerInfo(t):null;o===!1||t&&this.scope!=="portal"&&(!(r!=null&&r.webTierAuth)||R.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const o=R.credentials.indexOf(this);o>-1&&R.credentials.splice(o,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const o=Ze({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(o.resources=e.slice()),o}_startRefreshTimer(){clearTimeout(this._refreshTimer);const o=6e4*this.tokenRefreshBuffer,e=2**31-1;let t=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();t<0?t=0:t>e&&(t=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),t>o?t-o:t)}};m([_()],x.prototype,"creationTime",void 0),m([_()],x.prototype,"expires",void 0),m([_()],x.prototype,"isAdmin",void 0),m([_()],x.prototype,"oAuthState",void 0),m([_()],x.prototype,"resources",void 0),m([_()],x.prototype,"scope",void 0),m([_()],x.prototype,"server",void 0),m([_()],x.prototype,"ssl",void 0),m([_()],x.prototype,"token",void 0),m([_()],x.prototype,"tokenRefreshBuffer",void 0),m([_()],x.prototype,"userId",void 0),m([_()],x.prototype,"validity",void 0),x=m([oe("esri.identity.Credential")],x);class at extends ot{}at.prototype.declaredClass="esri.identity.IdentityManager";const Gt=new at;gt(Gt);export{Gt as default}; diff --git a/dist/assets/ImageHistogramParameters-sFtZwJ9j.js b/dist/assets/ImageHistogramParameters-sFtZwJ9j.js new file mode 100644 index 0000000..c031d1a --- /dev/null +++ b/dist/assets/ImageHistogramParameters-sFtZwJ9j.js @@ -0,0 +1 @@ +import{dp as he,uc as Mt,ab as f,e as s,y as l,l1 as ve,iw as W,oF as yt,pS as Vt,c as j,dr as N,ey as E,ud as ht,dt as z,ue as It,bI as A,du as Ie,oD as wt,uf as ft,T as we,bN as Gt,S as Ot,J as Ft,a8 as Jt,ug as Wt,uh as $t,ui as _t,uj as Kt,jl as fe,dY as Se,uk as rt,jk as Ge,dm as Qt,ul as K,pR as te,f6 as Xt,um as ge,Z as Me,dy as At,ha as Yt,dT as Ce,l as qt,g1 as ei,E as C,e3 as ti,un as Dt,uo as ot,dw as ii,dZ as ni,f$ as ai,f_ as ri,bW as F,ar as oi,dx as si,ev as li,gb as ci}from"./index-J0iiHjMT.js";import{o as Le,p as de,q as ui,t as H,v as di,f as pi,w as mi,u as P,x as gi,y as Oe,z as bt,A as vt,C as Mi,E as yi,G as hi,b as Ii}from"./dataUtils-s_UKlouc.js";import"./generateRendererUtils-_1jVE02H.js";import{d as wi}from"./FeatureSet-d4S1oKME.js";var xe;const se=new he({flow_from:"flow-from",flow_to:"flow-to"});let b=xe=class extends Mt(N){constructor(e){super(e),this.density=.8,this.color=new f([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){var D,g;const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:n,trailLength:a,smoothing:r,flowRepresentation:o,trailCap:u,background:d}=this,c=this.color.clone(),p=(this.visualVariables||[]).map(M=>M.clone()),m=(D=this.authoringInfo)==null?void 0:D.clone(),w=(g=this.legendOptions)==null?void 0:g.clone();return new xe({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:n,trailLength:a,trailCap:u,background:d,smoothing:r,flowRepresentation:o,visualVariables:p,authoringInfo:m,legendOptions:w})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};s([l({type:Number,json:{write:!0}})],b.prototype,"density",void 0),s([l({type:f,json:{write:{allowNull:!0}}})],b.prototype,"color",void 0),s([l({type:Number,cast:ve,json:{write:!0}})],b.prototype,"maxPathLength",void 0),s([l({type:Number,cast:ve,json:{write:!0}})],b.prototype,"trailWidth",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"flowSpeed",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"trailLength",void 0),s([l({type:Number,cast:ve,json:{write:!1}})],b.prototype,"smoothing",void 0),s([l({type:se.apiValues,json:{type:se.jsonValues,read:{reader:se.read},write:{writer:se.write}}})],b.prototype,"flowRepresentation",void 0),s([W({flowRenderer:"flow"})],b.prototype,"type",void 0),s([l({type:yt,json:{write:!0}})],b.prototype,"authoringInfo",void 0),s([l({type:Vt,json:{write:!0}})],b.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],b.prototype,"trailCap",void 0),s([l({type:String,json:{write:!0}})],b.prototype,"background",void 0),b=xe=s([j("esri.renderers.FlowRenderer")],b);const St=b;let J=class extends N{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};s([l({type:Number,json:{write:!0}})],J.prototype,"value",void 0),s([l({type:String,json:{write:!0}})],J.prototype,"label",void 0),s([l({type:f,json:{type:[E],write:!0}})],J.prototype,"color",void 0),J=s([j("esri.renderers.support.ColormapInfo")],J);const jt=J;var Q;let X=Q=class extends N{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,n=[...e].sort((a,r)=>a[0]-r[0]).map(a=>jt.fromJSON({value:a[0],color:i?a.slice(1,5):a.slice(1,4).concat([255]),label:t?t[a[0]]??"":a[0]}));return new Q({colormapInfos:n})}static createFromColorramp(e){const t=Le(e);return Q.createFromColormap(t)}clone(){return new Q({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};s([l({type:[jt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),s([W({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=s([j("esri.renderers.RasterColormapRenderer")],X);const Fe=X;var Be;let L=Be=class extends N{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return It(e)}clone(){return new Be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:A(this.colorRamp)})}};s([l({type:Number,json:{write:!0}})],L.prototype,"altitude",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"azimuth",void 0),s([l({types:ht,json:{write:!0}})],L.prototype,"colorRamp",void 0),s([z("colorRamp")],L.prototype,"readColorRamp",null),s([l({type:["traditional","multi-directional"],json:{write:!0}})],L.prototype,"hillshadeType",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"pixelSizePower",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"pixelSizeFactor",void 0),s([l({type:["none","adjusted"],json:{write:!0}})],L.prototype,"scalingType",void 0),s([W({rasterShadedRelief:"raster-shaded-relief"})],L.prototype,"type",void 0),s([l({type:Number,json:{write:!0}})],L.prototype,"zFactor",void 0),L=Be=s([j("esri.renderers.RasterShadedReliefRenderer")],L);const Nt=L;var Ue;let y=Ue=class extends N{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return It(e)}writeStatistics(e,t,i){e!=null&&e.length&&(Array.isArray(e[0])||(e=e.map(n=>[n.min,n.max,n.avg,n.stddev])),t[i]=e)}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=ui[i]),de.read(i)}clone(){return new Ue({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:A(this.statistics),gamma:A(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:A(this.colorRamp),histograms:A(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};s([l({types:ht,json:{write:!0}})],y.prototype,"colorRamp",void 0),s([z("colorRamp")],y.prototype,"readColorRamp",null),s([l({type:Boolean,json:{write:!0}})],y.prototype,"computeGamma",void 0),s([l({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],y.prototype,"dynamicRangeAdjustment",void 0),s([l({type:[Number],json:{write:!0}})],y.prototype,"gamma",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"maxPercent",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"minPercent",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"numberOfStandardDeviations",void 0),s([l({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],y.prototype,"outputMax",void 0),s([l({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],y.prototype,"outputMin",void 0),s([l({type:Number,json:{write:!0}})],y.prototype,"sigmoidStrengthLevel",void 0),s([l({json:{type:[[Number]],write:!0}})],y.prototype,"statistics",void 0),s([l()],y.prototype,"histograms",void 0),s([Ie("statistics")],y.prototype,"writeStatistics",null),s([l({type:Boolean,json:{write:!0}})],y.prototype,"useGamma",void 0),s([l({type:de.apiValues,json:{type:de.jsonValues,write:de.write}})],y.prototype,"stretchType",void 0),s([z("stretchType",["stretchType"])],y.prototype,"readStretchType",null),s([W({rasterStretch:"raster-stretch"})],y.prototype,"type",void 0),y=Ue=s([j("esri.renderers.RasterStretchRenderer")],y);const Je=y;var ze;const st=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),le=new he({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),ce=new he({flow_from:"flow-from",flow_to:"flow-to"});let v=ze=class extends Mt(N){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return st.has(e)?H.fromJSON(e):null}readOutputUnit(e,t){return st.has(e)?H.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new wt({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new ft({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new ze({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:A(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){var w;const n=new Array,a=di(this.inputUnit,this.outputUnit),r=((w=this.rotationVariables[0])==null?void 0:w.rotationType)||this.rotationType,o=t?pi(e.pixelBlock,"vector-uv",r,a):mi(e.pixelBlock,"vector-magdir",a);if(o==null)return n;const u=e.extent,d=o.mask!=null&&o.mask.length>0;let c=0;const p=(u.xmax-u.xmin)/o.width,m=(u.ymax-u.ymin)/o.height;for(let D=0;DU.intersects(M));if((!d||o.mask[c])&&!x){const U={Magnitude:o.pixels[0][c],Direction:o.pixels[1][c]},R=new Ot({geometry:{type:"point",x:M.x,y:M.y,spatialReference:u.spatialReference},attributes:U});R.symbol=this._getVisualVariablesAppliedSymbol(R),n.push(R)}}return n}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){var e;return(e=this.styleRenderer)==null?void 0:e.classBreakInfos}getDefaultSymbol(){var e;return(e=this.styleRenderer)==null?void 0:e.defaultSymbol}_getDefaultSymbol(e){return new Ft({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new Jt({width:0}),size:20,color:e||new f([0,92,230])})}_getVisualVariablesAppliedSymbol(e){var a,r;if(!e)return;const t=(r=(a=this.styleRenderer)==null?void 0:a.getSymbol(e))==null?void 0:r.clone(),i=this.sizeVariables,n=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>Wt(t,$t([o],e))),n&&n.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(u=>_t(t,Kt(u,e),u.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new fe(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new f([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new f([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new f([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],n=3.28084;return t=t.map(a=>a*n),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new f([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],n=2.23694;return t=t.map(a=>a*n),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new f([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],n=3.6;return t=t.map(a=>a*n),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new f([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new f([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){var n;const e=this._getDefaultSymbol(new f([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if((n=this.sizeVariables)!=null&&n.length){const a=this.sizeVariables[0].minDataValue,r=this.sizeVariables[0].maxDataValue;if(a&&r){const o=(r-a)/5;t=Array.from(Array(6).keys()).map(u=>a+o*u)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:Se.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(a=>5*a),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=Se.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),n=e.map((a,r)=>{let o;if(r!==e.length-1)if(r===0)o={minValue:a,maxValue:e[r+1],symbol:i};else{const u=Se.fromJSON({type:"esriPMS",imageData:t[r].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});o={minValue:a,maxValue:e[r+1],symbol:u}}return new rt(o)});return{defaultSymbol:i,classBreakInfos:n}}_getClassBreaks(e,t){return t.map((i,n)=>new rt({minValue:e[n],maxValue:e[n+1],symbol:this._getDefaultSymbol(new f(i))}))}};s([l({type:String,json:{write:!0}})],v.prototype,"attributeField",void 0),s([l({type:ce.apiValues,json:{type:ce.jsonValues,read:{reader:ce.read},write:{writer:ce.write}}})],v.prototype,"flowRepresentation",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0}})],v.prototype,"rotationType",void 0),s([l({type:le.apiValues,json:{type:le.jsonValues,read:{reader:le.read},write:{writer:le.write}}})],v.prototype,"style",void 0),s([l({json:{write:!0}})],v.prototype,"symbolTileSize",void 0),s([l({type:H.apiValues,json:{type:H.jsonValues,write:{writer:H.write}}})],v.prototype,"inputUnit",void 0),s([z("inputUnit")],v.prototype,"readInputUnit",null),s([l({type:H.apiValues,json:{type:H.jsonValues,read:{reader:H.read},write:{writer:H.write}}})],v.prototype,"outputUnit",void 0),s([z("outputUnit")],v.prototype,"readOutputUnit",null),s([W({vectorField:"vector-field"})],v.prototype,"type",void 0),s([l({type:fe})],v.prototype,"styleRenderer",null),s([l({type:wt})],v.prototype,"sizeVariables",null),s([l({type:ft})],v.prototype,"rotationVariables",null),v=ze=s([j("esri.renderers.VectorFieldRenderer")],v);const We=v,lt={key:"type",base:null,typeMap:{"unique-value":Ge,"class-breaks":fe,"raster-colormap":Fe,"raster-stretch":Je,"vector-field":We,"raster-shaded-relief":Nt,flow:St}},ct={...lt,typeMap:{...lt.typeMap}};delete ct.typeMap["vector-field"],delete ct.typeMap.flow;const fi={uniqueValue:Ge,classBreaks:fe,rasterStretch:Je,rasterColormap:Fe,vectorField:We,rasterShadedRelief:Nt,flowRenderer:St};function Ai(e){return e&&fi[e.type]||null}function Yi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const n=e.authoringInfo||{classificationMethod:""};n.classificationMethod=e.classificationMethod,e.authoringInfo=n}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=Ai(e);if(i){const n=new i;return n.read(e,t),n}return t!=null&&t.messages&&e&&t.messages.push(new Qt("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}var Re;let V=Re=class extends N{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new Re({variableName:this.variableName,dimensionName:this.dimensionName,values:A(this.values),isSlice:this.isSlice})}};s([l({type:String,json:{write:!0}})],V.prototype,"variableName",void 0),s([l({type:String,json:{write:!0}})],V.prototype,"dimensionName",void 0),s([l({type:K.array(K.oneOf([K.native(Number),K.array(K.native(Number))])),json:{write:!0}})],V.prototype,"values",void 0),s([l({type:Boolean,json:{write:!0}})],V.prototype,"isSlice",void 0),V=Re=s([j("esri.layers.support.DimensionalDefinition")],V);const ee=V,qi=te()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),en=te()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),je=te()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"});let Z=class extends N{constructor(){super(...arguments),this.pixelType="unknown"}};s([l({type:String,json:{write:!0}})],Z.prototype,"name",void 0),s([l({type:String,json:{write:!0}})],Z.prototype,"description",void 0),s([l({type:E,json:{type:E,write:!0,name:"_object_id"}})],Z.prototype,"id",void 0),s([l({type:String,json:{type:je.jsonValues,read:je.read,write:je.write}})],Z.prototype,"pixelType",void 0),s([l({type:String,json:{write:!0}})],Z.prototype,"type",void 0),Z=s([j("esri.layers.support.RasterFunctionInfo")],Z);const Di=Z;let k=class extends N{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};s([l({type:String,json:{write:!0}})],k.prototype,"name",void 0),s([l({type:Number,json:{type:E,write:!0,name:"_object_id"}})],k.prototype,"id",void 0),s([l({type:Boolean,json:{write:!0}})],k.prototype,"isDataset",void 0),s([l({type:Boolean,json:{write:!0}})],k.prototype,"isPublic",void 0),s([l({json:{write:!0}})],k.prototype,"value",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"type",void 0),k=s([j("esri.layers.support.RasterFunctionVariable")],k);const bi=k,ue={key:"type",base:null,typeMap:{RasterFunctionVariable:bi}};let G=class extends N{};s([l({types:ue,json:{types:ue,name:"MatchVariable"}})],G.prototype,"matchVariable",void 0),s([l({types:ue,json:{types:ue,name:"UnionDimension"}})],G.prototype,"unionDimension",void 0),s([l({type:Number,json:{type:E,write:!0,name:"_object_id"}})],G.prototype,"id",void 0),s([l({type:String,json:{write:!0}})],G.prototype,"type",void 0),G=s([j("esri.layers.support.RasterFunctionProperties")],G);const vi=G,Ne=new he({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends N{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};s([l({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),s([l({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"description",void 0),s([l({type:Di,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),s([l({type:Ne.apiValues,json:{type:[0,1,2],read:Ne.read,write:Ne.write}})],I.prototype,"functionType",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"group",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"help",void 0),s([l({type:Number,json:{type:E,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"name",void 0),s([l({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"tag",void 0),s([l({type:vi,json:{write:!0}})],I.prototype,"properties",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),s([l({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),s([l({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=s([j("esri.layers.support.RasterFunctionTemplate")],I);const Tt=I;var ke;const pe=new Set(["raster","raster2","dem","fillraster"]),me=new Set(["rasters"]),ut=e=>e!=null&&e.rasterFunction?S.fromJSON(e):e,Te=e=>e&&e instanceof S?e.toJSON():e,He=e=>(e==null?void 0:e.functionName)&&!e.declaredClass,dt=e=>He(e)?new S(e):e,Si=e=>{if(e==null)return null;e=A(e);const t={};for(const i of Object.keys(e))pe.has(i.toLowerCase())?t[i]=ut(e[i]):me.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(ut):t[i]=e[i];return t},ji={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:Tt}},json:{write:!0,name:"rasterFunctionDefinition"}};let S=ke=class extends N{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>pe.has(i.toLowerCase())&&He(e[i]))||t.some(i=>me.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(n=>He(n)))){e=A(e);for(const i of t)pe.has(i.toLowerCase())?e[i]=dt(e[i]):me.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(n=>dt(n)))}}this._set("functionArguments",e)}readFunctionArguments(e){return Si(e)}writeFunctionArguments(e,t,i){const n={};for(const a of Object.keys(e))pe.has(a.toLowerCase())?n[a]=Te(e[a]):me.has(a.toLowerCase())&&Array.isArray(e[a])?n[a]=e[a].map(Te):n[a]=Te(e[a]);t[i]=n}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i!=null&&i.length&&i[0].name!=="None"?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}get rasterFunctionDefinition(){var e;return(e=this.functionDefinition)==null?void 0:e.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?Tt.fromJSON(e):null}clone(){return new ke({functionName:this.functionName,functionArguments:A(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:A(this.rasterFunctionDefinition)})}};s([l({json:{type:Object,name:"rasterFunctionArguments"}})],S.prototype,"functionArguments",null),s([z("functionArguments")],S.prototype,"readFunctionArguments",null),s([Ie("functionArguments")],S.prototype,"writeFunctionArguments",null),s([l({json:{type:String,write:{target:"rasterFunction"}}})],S.prototype,"functionName",void 0),s([z("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],S.prototype,"readFunctionName",null),s([W({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),l({json:{default:"unknown"}})],S.prototype,"outputPixelType",void 0),s([l({type:String,json:{read:!0,write:!0}})],S.prototype,"variableName",void 0),s([l()],S.prototype,"rasterFunctionDefinition",null),s([l(ji)],S.prototype,"functionDefinition",void 0),S=ke=s([j("esri.layers.support.RasterFunction")],S);const ye=S;var Ze;const Y=te()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),Ee=te()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function Ni(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return Ee.fromJSON(t)}let h=Ze=class extends N{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}get itemRenderingRule(){return ge(Me.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._get("itemRasterFunction")}set itemRenderingRule(e){ge(Me.getLogger(this),"itemRenderingRule",{replacement:"itemRasterFunction",version:"4.27",warnOnce:!0}),this._set("itemRasterFunction",e)}readMethod(e,t){return Ni(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:n,dimensionName:a})=>n&&n!=="*"||a)).length&&(t[i]=e.map(n=>n.toJSON()))}readOperation(e,t){var r;const i=t.mosaicOperation,n=(r=t.mosaicOperator)==null?void 0:r.toLowerCase(),a=i||(n?Y.toJSON(n):null);return Y.fromJSON(a)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Ze({ascending:this.ascending,itemRasterFunction:A(this.itemRasterFunction),lockRasterIds:A(this.lockRasterIds),method:this.method,multidimensionalDefinition:A(this.multidimensionalDefinition),objectIds:A(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:A(this.viewpoint),where:this.where})}};s([l({type:Boolean,json:{write:!0}})],h.prototype,"ascending",void 0),s([z("ascending",["ascending","sortAscending"])],h.prototype,"readAscending",null),s([l({type:ye,json:{name:"itemRenderingRule",write:!0}})],h.prototype,"itemRasterFunction",void 0),s([l({type:ye})],h.prototype,"itemRenderingRule",null),s([l({type:[E],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],h.prototype,"lockRasterIds",void 0),s([l({type:String,json:{type:Ee.jsonValues,write:{target:"mosaicMethod",writer:Ee.write}}})],h.prototype,"method",void 0),s([z("method",["mosaicMethod","defaultMosaicMethod"])],h.prototype,"readMethod",null),s([l({type:[ee],json:{write:!0}})],h.prototype,"multidimensionalDefinition",void 0),s([Ie("multidimensionalDefinition")],h.prototype,"writeMultidimensionalDefinition",null),s([l({type:[E],json:{name:"fids",write:!0}})],h.prototype,"objectIds",void 0),s([l({json:{type:Y.jsonValues,read:{reader:Y.read},write:{target:"mosaicOperation",writer:Y.write}}})],h.prototype,"operation",void 0),s([z("operation",["mosaicOperation","mosaicOperator"])],h.prototype,"readOperation",null),s([l({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],h.prototype,"sortField",void 0),s([l({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],h.prototype,"sortValue",void 0),s([Xt("sortValue")],h.prototype,"castSortValue",null),s([l({type:we,json:{write:!0}})],h.prototype,"viewpoint",void 0),s([l({type:String,json:{write:!0}})],h.prototype,"where",void 0),h=Ze=s([j("esri.layers.support.MosaicRule")],h);const Ti=h;var Pe;const Ci={base:Yt,key:"type",typeMap:{extent:Ce,polygon:qt}};let O=Pe=class extends N{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(n=>{if(!n.dimensionName)return;let a,r;if(Array.isArray(n.values[0])){const o=n.values;a=o[0][0],r=o[n.values.length-1][1]}else{const o=n.values;a=o[0],r=o[n.values.length-1]}if(t.has(n.dimensionName)){const o=t.get(n.dimensionName);o[0]=Math.min(a,o[0]),o[1]=Math.max(r,o[1])}else t.set(n.dimensionName,[a,r])});const i=[];for(const n of t)i.push({name:n[0],extent:n[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){var i;const e=(i=this.subsetDefinitions)==null?void 0:i.map(n=>n.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Pe({areaOfInterest:t,subsetDefinitions:e})}};s([l({types:Ci,json:{read:At,write:!0}})],O.prototype,"areaOfInterest",void 0),s([l({readOnly:!0})],O.prototype,"dimensions",null),s([l({readOnly:!0})],O.prototype,"variables",null),s([l({type:[ee],json:{write:!0}})],O.prototype,"subsetDefinitions",void 0),O=Pe=s([j("esri.layers.support.MultidimensionalSubset")],O);const on=O;let sn=class{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await ei("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return n?new P(n):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("decode",t,i);return n?new P(n):null}async symbolize(t,i){var r,o;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n={extent:(r=t.extent)==null?void 0:r.toJSON(),pixelBlock:(o=t.pixelBlock)==null?void 0:o.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},a=await this._workerThread.invoke("symbolize",n,i);return a?new P(a):null}async updateSymbolizer(t,i){var a;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=(a=t==null?void 0:t.rendererJSON)==null?void 0:a.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:n},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){var a,r;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=await this._workerThread.invoke("process",{extent:(a=t.extent)==null?void 0:a.toJSON(),primaryPixelSizes:(r=t.primaryPixelSizes)==null?void 0:r.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return n?new P(n):null}async stretch(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const n={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},a=await this._workerThread.invoke("stretch",n,i);return a?new P(a):null}async split(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const n={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel},a=await this._workerThread.invoke("split",n,i);return a&&a.forEach((r,o)=>{a.set(o,r?P.fromJSON(r):null)}),a}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const n={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",n,i)}async mosaicAndTransform(t,i){var r;if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");if(!((r=t==null?void 0:t.srcPixelBlocks)!=null&&r.length))return{pixelBlock:null};const n={...t,srcPixelBlocks:t.srcPixelBlocks.map(o=>o!=null?o.toJSON():null)},a=await this._workerThread.invoke("mosaicAndTransform",n,i);return{pixelBlock:a.pixelBlock?new P(a.pixelBlock):null,localNorthDirections:a.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:a,simulationSettings:r}=t,o=await this._workerThread.invoke("createFlowMesh",{meshType:a,flowData:n,simulationSettings:r},{...i,transferList:[n.buffer,n.maskBuffer]});return{vertexData:new Float32Array(o.vertexBuffer),indexData:new Uint32Array(o.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new C("raster-jobhandler:no-connection","no available worker connection");const n=t.datumTransformation!=null?t.datumTransformation.steps.map(o=>({wkid:o.wkid,wkt:o.wkt,isInverse:o.isInverse})):null,a=t.rasterTransform!=null?t.rasterTransform.toJSON():null,r={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:n,rasterTransform:a,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",r,i)}};function Ct(e,t,i){var r;const n=t.shift();if(i.length===0){const o=[];i.push({sliceId:-1,multidimensionalDefinition:o})}const a=i.length;for(let o=0;o{i.push({sliceId:-1,multidimensionalDefinition:[...u,{variableName:e,dimensionName:n.name,values:[d]}]})})}t.length&&Ct(e,t,i)}function cn(e,t){const i=[];let n=0;return(t?e.variables.filter(a=>a.name.toLowerCase()===t.toLowerCase()):[...e.variables].sort((a,r)=>a.name>r.name?1:-1)).forEach(a=>{const r=[],o=[...a.dimensions].sort((u,d)=>u.name>d.name?-1:1);Ct(a.name,o,r),r.forEach(u=>{i.push({...u,sliceId:n++})})}),i}function un(e,t,i){let n=e;if(t&&(t=[...t].sort((a,r)=>a.dimensionName{r.length&&(n=n.filter(u=>{const d=u.multidimensionalDefinition.find(p=>p.dimensionName===a);if(d==null)return!1;const c=d.values[0];return typeof c=="number"?typeof r[0]=="number"?r.includes(c):r.some(p=>p[0]<=c&&p[1]>=c):typeof r[0]=="number"?r.some(p=>c[0]<=p&&c[1]>=p):o?r.some(p=>p[0]===c[0]&&p[0]===c[1]):r.some(p=>p[0]>=c[0]&&p[0]<=c[1]||p[1]>=c[0]&&p[1]<=c[1]||p[0]c[1])}))}),n.length&&(i==null?void 0:i.start)!=null&&i.end!=null){const a=i.start.getTime(),r=i.end.getTime(),o=n[0].multidimensionalDefinition.findIndex(u=>u.dimensionName==="StdTime");o>-1&&(n=n.filter(u=>{const d=u.multidimensionalDefinition[o].values[0];return a<=d&&r>=d}))}return n.map(a=>a.sliceId)}function Lt(e,t){return Array.isArray(e)?t[0]===t[1]?e[0]===t[0]||e[1]===t[0]:e[0]>=t[0]&&e[0]<=t[1]&&e[1]>=t[0]&&e[1]<=t[1]:e>=t[0]&&e<=t[1]}function Li(e,t){return e[0]<=t[0]&&e[1]>=t[0]||e[0]<=t[1]&&e[1]>=t[1]||e[0]>=t[0]&&e[1]<=t[1]}function xt(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function Bt(e,t,i){var o,u;if(!((o=t==null?void 0:t.subsetDefinitions)!=null&&o.length))return e;let n;if(i){const{variables:d}=t;if(d.length&&!d.includes(i))return null;const c=t.subsetDefinitions.find(p=>p.dimensionName===e.name&&p.variableName===i);if(!((u=c==null?void 0:c.values)!=null&&u.length))return e;n=xt(c.values)}else{const d=t.dimensions.find(({name:c})=>c===e.name);n=d==null?void 0:d.extent}const a=n;if(!(a!=null&&a.length))return e;const r=e.values.filter(d=>Lt(d,a));return{...e,extent:[...a],values:r}}function Ut(e,t,i){var a;if(!((a=t==null?void 0:t.subsetDefinitions)!=null&&a.length))return!1;const{variables:n}=t;if(n.length&&e.some(({variableName:r})=>r&&!n.includes(r)))return!0;for(let r=0;r(o.variableName===""||d.variableName===o.variableName)&&d.dimensionName===o.dimensionName);if(u!=null&&u.values.length){const d=xt(u.values);if(!o.isSlice&&o.values.length===2&&!Array.isArray(o.values[0])&&o.values[0]!==o.values[1]&&i){if(!Li(o.values,d))return!0}else if(o.values.some(c=>!Lt(c,d)))return!0}}return!1}function dn(e,t){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:n,multidimensionalDefinition:a}=t;let r=null;if(n!=null&&(r=xi(e,n),r==null))return{isOutside:!0};const{areaOfInterest:o}=e;if(o&&i){const u=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(u&&!o.contains(u))return{isOutside:!0}}return a!=null&&a.length&&Ut(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:r,multidimensionalDefinition:a}}}function xi(e,t){const i=e.dimensions.find(({name:o})=>o==="StdTime");if(i==null||t.start==null&&t.end==null)return t;t=t.clone();const{start:n,end:a}=t.toJSON(),r=n===a?[n]:n!=null&&a!=null?[n,a]:[n??a];return r.length===2&&(i!=null&&i.extent.length)&&(r[0]=Math.max(r[0],i.extent[0]),r[1]=Math.min(r[1],i.extent[1]??i.extent[0]),r[1]r.variables.includes(w))),d?c.find(({name:w})=>w===d)??c[0]:c[0]}function pn(e,t={}){const i=Bi(e,t);if(!i)return null;const n=[],{dimensions:a,name:r}=i;if(a.length===0)return[new ee({variableName:r,dimensionName:"",values:[],isSlice:!0})];for(let o=0;o{if(t.values==null)return!0;const i=t.values.length;return i===0||i>1||!t.isSlice&&Array.isArray(t.values[0])})}function gn(e,t){var n;if(t==null||e==null)return null;let i=t.variables.map(a=>({...a}));return(n=e==null?void 0:e.variables)!=null&&n.length&&(i=i.filter(({name:a})=>e.variables.includes(a)),i.forEach(a=>{a.dimensions=a.dimensions.map(r=>Bt(r,e,a.name)).filter(ti)})),i}function Ui(e,t){var u;const{values:i}=t;if(i!=null&&i.length){const d=Array.isArray(i[0]),c=Array.isArray(e);return d!==c?-1:d&&c?i.findIndex(p=>p[0]===e[0]&&p[1]===e[1]):i.indexOf(e)}const{extent:n}=t;if(Array.isArray(e)||en[1])return-1;const a=t.interval||1;if(t.unit!=="ISO8601")return Math.round((e-n[0])/a);const r=n[0];let o=-1;switch(((u=t.intervalUnit)==null?void 0:u.toLowerCase())||"seconds"){case"seconds":o=Math.round((e-r)/1e3/a);break;case"minutes":o=Math.round((e-r)/6e4/a);break;case"hours":o=Math.round((e-r)/36e5/a);break;case"days":o=Math.round((e-r)/864e5/a);break;case"months":{const d=new Date(e).getUTCFullYear()-new Date(r).getUTCFullYear(),c=new Date(r).getUTCMonth(),p=new Date(e).getUTCMonth();o=d===0?p-c:p+11-c+12*(d-1)}break;case"years":o=Math.round((new Date(e).getUTCFullYear()-new Date(r).getUTCFullYear())/a);break;case"decades":o=Math.round((new Date(e).getUTCFullYear()-new Date(r).getUTCFullYear())/10/a)}return o}function pt(e){var o,u;let t=(o=e.values)==null?void 0:o.length;if(t)return t;const{extent:i,unit:n}=e,a=e.interval||1,r=i?i[1]-i[0]:0;if(n!=="ISO8601")return Math.round(r/a);switch(((u=e.intervalUnit)==null?void 0:u.toLowerCase())??"seconds"){case"seconds":t=Math.round(r/1e3/a);break;case"minutes":t=Math.round(r/6e4/a);break;case"hours":t=Math.round(r/36e5/a);break;case"days":t=Math.round(r/864e5/a);break;case"months":{const d=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),c=new Date(i[0]).getUTCMonth(),p=new Date(i[1]).getUTCMonth();t=d===0?p-c+1:p+11-c+12*(d-1)+1}break;case"years":t=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a);break;case"decades":t=Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a);break;default:t=0}return t}function Mn(e,t){let i=0;const n=e[0].variableName,a=[...t.variables].sort((r,o)=>r.name>o.name?1:-1);for(let r=0;rp.name>m.name?-1:1);if(o.name!==n){i+=u.map(p=>pt(p)).reduce((p,m)=>p*m);continue}const d=u.map(p=>pt(p)),c=u.length;for(let p=0;pD.dimensionName===u[p].name);if(m==null)return null;const w=Ui(m.values[0],u[p]);if(w===-1)return null;d.shift(),i+=p===c-1?w:w*d.reduce((D,g)=>D*g)}break}return i}const zi=.25,Ri=Dt.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),mt=Dt.fromJSON(gi[0]),zt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function yn(e,t){const{attributeTable:i,colormap:n}=e;if(Oe(e)){const a=Ji(e);if(a!=null)return a}if(n!=null){const a=Oi(e);if(a!=null)return a}if(i!=null){const a=Vi(e);if(a!=null)return a}return ki(e,t)}function hn(e,t=!1){const i=["raster-stretch"];return bt(e,t)&&i.push("raster-colormap"),vt(e)&&i.push("unique-value"),Mi(e,t)&&i.push("class-breaks"),yi(e)&&i.push("raster-shaded-relief"),Oe(e)&&i.push("vector-field"),hi(e)&&i.push("flow"),i}function In(e,t,i){const n=["nearest","bilinear","cubic","majority"].find(a=>a===(i==null?void 0:i.toLowerCase()));return t==="Map"?n??"bilinear":e.dataType==="standard-time"?n??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?n==="nearest"||n==="majority"?n:"nearest":n??"bilinear"}function ki(e,t){e=Hi(e,t==null?void 0:t.variableName);const{bandCount:i}=e;let{bandIds:n,stretchType:a}=t||{};n!=null&&n.some(m=>m>=i)&&(n=null);let r=e.statistics,o=e.histograms;i>1?(n=n!=null&&n.length?n:Zi(e),r=r==null?null:n==null?void 0:n.map(m=>r[m]),o=o==null?null:n==null?void 0:n.map(m=>o[m])):n=[0],a==null&&(a=Pi(e));let u=!1;switch(a){case"none":u=!1;break;case"percent-clip":u=!(o!=null&&o.length);break;default:u=!(r!=null&&r.length)}const{dataType:d}=e,c=(n==null?void 0:n.length)===1&&zt.has(d)?Ri:null,p=new Je({stretchType:a,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:(n==null?void 0:n.length)===1?[1]:[1,1,1],useGamma:!1});return a==="percent-clip"?p.maxPercent=p.minPercent=zi:a==="standard-deviation"&&(p.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!(t!=null&&t.includeStatisticsInStretch)||(a==="percent-clip"?p.histograms=o:a!=="min-max"&&a!=="standard-deviation"||(p.statistics=r)),p}function Hi(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const n=i.variables.find(a=>a.name===t);if(!n)return e;if(e=e.clone(),n){const{statistics:a,histograms:r}=n;a!=null&&a.length&&(e.statistics=a.map(o=>({min:o.min,max:o.max,avg:o.avg,stddev:o.stddev}))),r!=null&&r.length&&(e.histograms=r)}return e}function Zi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let n;if(i.length===t){const{red:a,green:r,blue:o,nir:u}=Ei(i);a!=null&&r!=null&&o!=null?n=[a,r,o]:u!=null&&a!=null&&r!=null&&(n=[u,a,r])}return!n&&t>=3&&(n=[0,1,2]),n}function Ei(e){const t={};for(let i=0;i=410&&r<=480&&o>=480&&o<=540?t.blue=i:t.green==null&&r>=490&&r<=560&&o>=560&&o<=610?t.green=i:t.red==null&&r>=595&&r<=670&&o>=660&&o<=730?t.red=i:t.nir==null&&r>=700&&r<=860&&o>=800&&o<=950&&(t.nir=i)}}return t}function Pi(e){let t="percent-clip";const{pixelType:i,dataType:n,histograms:a,statistics:r,multidimensionalInfo:o}=e,u=zt.has(n)||n==="generic"&&o!=null;return i!=="u8"||n!=="processed"&&a!=null&&r!=null?i==="u8"||n==="elevation"||u?t="min-max":a!=null?t="percent-clip":r!=null&&(t="min-max"):t="none",t}function Vi(e,t,i,n){if(!vt(e,t))return null;const{attributeTable:a,statistics:r}=e,o=Rt(a,t),u=q(a,"red"),d=q(a,"green"),c=q(a,"blue"),p=new yt,m=[],w=new Set,D=!!(u&&d&&c);if(a!=null)a.features.forEach(g=>{const M=g.attributes[o.name];if(!w.has(g.attributes[o.name])&&M!=null){w.add(M);const x=D&&(u.type==="single"||u.type==="double")&&(d.type==="single"||d.type==="double")&&(c.type==="single"||c.type==="double")&&!a.features.some(R=>R.attributes[u.name]>1||R.attributes[d.name]>1||R.attributes[c.name]>1),U=x?255:1;m.push(new ot({value:g.attributes[o.name],label:g.attributes[o.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new f(D?[g.attributes[u.name]*U,g.attributes[d.name]*U,g.attributes[c.name]*U,1]:[0,0,0,0])}}))}});else if(r!=null&&r[0])for(let g=r[0].min;g<=r[0].max;g++)m.push(new ot({value:g,label:g.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new f([0,0,0,0])}}));if(m.sort((g,M)=>g.value&&typeof g.value.valueOf()=="string"?0:g.value>M.value?1:-1),!D){const g=Le(mt,{numColors:m.length});m.forEach((M,x)=>M.symbol.color=new f(g[x].slice(1,4))),p.colorRamp=mt}if(i||n){const g=i||Le(n,{numColors:m.length}).map(M=>M.slice(1));m.forEach((M,x)=>M.symbol.color=new f(g[x])),p.colorRamp=n}return new Ge({field:o.name,uniqueValueInfos:m,authoringInfo:p})}function Rt(e,t,i){let n;return e!=null?(n=t?e.fields.find(a=>t.toLowerCase()===a.name.toLowerCase()):Gi(e.fields),n||(i||(n=e.fields.find(a=>a.type==="string")),n||(n=q(e,"value")))):n=new ii({name:"value"}),n}function Gi(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function Oi(e){if(!bt(e))return null;let t;const{attributeTable:i,colormap:n}=e;if(i!=null){const a=q(i,"value"),r=Rt(i,null,!0);r.type==="string"&&(t={},i.features.forEach(o=>{const u=o.attributes;t[u[a.name]]=r?u[r.name]:u[a.name]}))}return Fe.createFromColormap(n,t)}const Fi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Ji(e){if(!Oe(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:a,maxMagnitude:r}=Wi(e.dataType,e.statistics);t=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:a,maxDataValue:r}]}const i=e.multidimensionalInfo!=null?Fi.get(e.multidimensionalInfo.variables[0].unit):null,n=new We({visualVariables:t,inputUnit:i,rotationType:"geographic"});return n.visualVariables=[...n.sizeVariables,...n.rotationVariables],n}function gt(e){var t;return{color:(t=e.symbolLayers[0].material)==null?void 0:t.color,type:"esriSFS",style:"esriSFSSolid"}}function wn(e){var t,i;if(e.type==="uniqueValue"){const n=e.uniqueValueInfos,a=n==null?void 0:n[0].symbol;return(t=a==null?void 0:a.symbolLayers)!=null&&t.length&&(e.uniqueValueInfos=n==null?void 0:n.map(r=>({value:r.value,label:r.label,symbol:r.symbol?gt(r.symbol):null}))),e}if(e.type==="classBreaks"){const n=e.classBreakInfos,a=n[0].symbol;return(i=a==null?void 0:a.symbolLayers)!=null&&i.length&&(e.classBreakInfos=n.map(r=>({classMinValue:r.classMinValue,classMaxValue:r.classMaxValue,label:r.label,symbol:r.symbol?gt(r.symbol):null}))),e}return e}function Wi(e,t){let i,n;if(e==="vector-magdir")i=t[0].min,n=t[0].max;else{const a=t[0].min,r=t[0].max,o=t[1].min,u=t[1].max;i=0,n=Math.max(Math.abs(a),Math.abs(o),Math.abs(r),Math.abs(u))}return{minMagnitude:i,maxMagnitude:n}}async function kt(e,t,i){var _e,Ke,Qe,Xe,Ye,qe,et,tt,it,nt;const n=ni(e),{rasterFunction:a,sourceJSON:r}=t||{},o=a?JSON.stringify(a.rasterFunctionDefinition||a):null,u=ai({...n.query,renderingRule:o,f:"json"}),d=ri(u,i);e=n.path;const c=r||await F(e,d).then(T=>T.data),p=c.hasRasterAttributeTable?F(`${e}/rasterAttributeTable`,d):null,m=c.hasColormap?F(`${e}/colormap`,d):null,w=c.hasHistograms?F(`${e}/histograms`,d):null,D=c.currentVersion>=10.3?F(`${e}/keyProperties`,d):null,g=c.hasMultidimensions?F(`${e}/multidimensionalInfo`,d):null,M=await Promise.allSettled([p,m,w,D,g]);let x=null;if(c.minValues&&c.minValues.length===c.bandCount){x=[];for(let T=0;T{var at;(at=T.statistics)!=null&&at.length&&T.statistics.forEach(oe=>{oe.avg=oe.mean,oe.stddev=oe.standardDeviation})});const{defaultVariable:De,serviceDataType:_}=c;De&&De!==$.DefaultVariable&&($.DefaultVariable=De),_!=null&&_.includes("esriImageServiceDataTypeVector")&&!_.includes($.DataType)&&($.DataType=_.replace("esriImageServiceDataType",""));let be=c.noDataValue;return(nt=c.noDataValues)!=null&&nt.length&&c.noDataValues.some(T=>T!==be)&&(be=c.noDataValues),new Ii({width:R,height:Ht,bandCount:c.bandCount,extent:Ce.fromJSON(c.extent),spatialReference:$e,pixelSize:new we({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:$e}),pixelType:c.pixelType.toLowerCase(),statistics:x,attributeTable:Zt,colormap:Et,histograms:Pt,keyProperties:$,noDataValue:be,multidimensionalInfo:Ae})}function fn(e,t,i){return kt(e,{sourceJSON:t},i)}function An(e,t,i){return kt(e,{rasterFunction:t},i)}function Dn(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}var Ve;let B=Ve=class extends N{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=ci(e),t[i]=e.toJSON())}get renderingRule(){return ge(Me.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(e){ge(Me.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}clone(){return new Ve(A({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};s([l({types:si,json:{read:At}})],B.prototype,"geometry",void 0),s([Ie("geometry")],B.prototype,"writeGeometry",null),s([l({type:Ti,json:{write:!0}})],B.prototype,"mosaicRule",void 0),s([l({type:ye})],B.prototype,"renderingRule",null),s([l({type:ye,json:{write:!0,name:"renderingRule"}})],B.prototype,"rasterFunction",void 0),s([l({type:we,json:{write:!0}})],B.prototype,"pixelSize",void 0),s([l({json:{write:!0}})],B.prototype,"raster",void 0),s([l({type:li,json:{read:{source:"time"},write:{target:"time"}}})],B.prototype,"timeExtent",void 0),B=Ve=s([j("esri.rest.support.ImageHistogramParameters")],B);const bn=B;export{Hi as B,Mn as D,Zi as E,wn as K,ye as N,In as S,yn as V,un as a,Yi as b,on as c,ct as d,bn as e,pn as f,Bi as g,mn as h,cn as i,gn as j,Dn as k,lt as l,fn as m,qi as n,Ut as o,ee as p,en as q,Ti as r,je as s,sn as t,An as u,dn as v,hn as w}; diff --git a/dist/assets/ImageMaterial.glsl-TdPtjVc_.js b/dist/assets/ImageMaterial.glsl-TdPtjVc_.js new file mode 100644 index 0000000..7505782 --- /dev/null +++ b/dist/assets/ImageMaterial.glsl-TdPtjVc_.js @@ -0,0 +1,41 @@ +import{xz as T,xE as $,xB as O,bf as p,xy as c,xC as A,xH as I,yk as b,xx as S,xA as n,tw as v,xD as C,xK as d,yl as D,uY as m,e as r,xL as o,i2 as _,xM as w,de as N,xN as R,xO as V,xP as L,xQ as M,xS as F,xT as U,ym as z,xU as B,xV as W,xW as j,yn as G,yo as H,yp as Q,yq as k,y9 as q,yr as K,lX as u,yc as X,ys as Y,yb as J,y2 as Z,yt as ee,yu as te,yv as se,x$ as ae}from"./index-J0iiHjMT.js";function x(t){const e=new T,{vertex:s,fragment:a}=e;return $(s,t),e.include(O,t),e.attributes.add(p.POSITION,"vec3"),e.attributes.add(p.UV0,"vec2"),t.perspectiveInterpolation&&e.attributes.add(p.PERSPECTIVEDIVIDE,"float"),e.varyings.add("vpos","vec3"),t.multipassEnabled&&e.varyings.add("depth","float"),s.code.add(c` + void main(void) { + vpos = position; + ${t.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""} + vTexCoord = uv0; + gl_Position = transformPosition(proj, view, vpos); + + ${t.perspectiveInterpolation?"gl_Position *= perspectiveDivide;":""} + } + `),e.include(A,t),e.include(I,t),a.uniforms.add(new b("tex",l=>l.texture),new S("opacity",l=>l.opacity)),e.varyings.add("vTexCoord","vec2"),t.output===n.Alpha?a.code.add(c` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + + float alpha = texture(tex, vTexCoord).a * opacity; + if (alpha < ${c.float(v)}) { + discard; + } + + fragColor = vec4(alpha); + } + `):(a.include(C),a.code.add(c` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + fragColor = texture(tex, vTexCoord) * opacity; + + if (fragColor.a < ${c.float(v)}) { + discard; + } + + fragColor = highlightSlice(fragColor, vpos); + ${t.transparencyPassType===d.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `)),e}const ie=Object.freeze(Object.defineProperty({__proto__:null,build:x},Symbol.toStringTag,{value:"Module"}));class g extends V{initializeProgram(e){return new L(e.rctx,g.shader.get().build(this.configuration),E)}_setPipelineState(e,s){const a=this.configuration,l=e===d.NONE,h=e===d.FrontFace;return M({blending:a.output!==n.Color&&a.output!==n.Alpha||!a.transparent?null:l?re:F(e),culling:U(a.cullFace),depthTest:{func:z(e)},depthWrite:l?a.writeDepth?B:null:W(e),colorWrite:j,stencilWrite:a.hasOccludees?G:null,stencilTest:a.hasOccludees?s?H:Q:null,polygonOffset:l||h?null:k(a.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}}g.shader=new w(ie,()=>N(()=>Promise.resolve().then(()=>pe),void 0));const re=D(m.ONE,m.ONE_MINUS_SRC_ALPHA);class i extends R{constructor(){super(...arguments),this.output=n.Color,this.cullFace=_.None,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.transparencyPassType=d.NONE,this.multipassEnabled=!1,this.cullAboveGround=!1,this.perspectiveInterpolation=!0}}r([o({count:n.COUNT})],i.prototype,"output",void 0),r([o({count:_.COUNT})],i.prototype,"cullFace",void 0),r([o()],i.prototype,"hasSlicePlane",void 0),r([o()],i.prototype,"transparent",void 0),r([o()],i.prototype,"enableOffset",void 0),r([o()],i.prototype,"writeDepth",void 0),r([o()],i.prototype,"hasOccludees",void 0),r([o({count:d.COUNT})],i.prototype,"transparencyPassType",void 0),r([o()],i.prototype,"multipassEnabled",void 0),r([o()],i.prototype,"cullAboveGround",void 0),r([o()],i.prototype,"perspectiveInterpolation",void 0),r([o({constValue:!1})],i.prototype,"occlusionPass",void 0);const E=new Map([[p.POSITION,0],[p.UV0,2],[p.PERSPECTIVEDIVIDE,3]]);let ue=class extends q{constructor(e){super(e,new le),this.supportsEdges=!0,this._vertexAttributeLocations=E,this._configuration=new i}getConfiguration(e,s){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=s.transparencyPassType,this._configuration.enableOffset=s.camera.relativeElevation __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/ImageryLayer-G7gb-fJC.js b/dist/assets/ImageryLayer-G7gb-fJC.js new file mode 100644 index 0000000..ec7e564 --- /dev/null +++ b/dist/assets/ImageryLayer-G7gb-fJC.js @@ -0,0 +1,7 @@ +import{bI as Q,oD as Dt,uu as Tt,e as n,y as l,du as P,c as F,dr as z,ar as he,uv as le,uw as $e,ux as Me,T as q,dZ as ie,f$ as ye,f_ as ge,bW as _,bN as Le,et as Ze,dT as _e,ey as Ee,dp as Pt,dx as nt,gb as Se,ev as dt,um as we,Z as ne,dy as ht,hq as Nt,dt as E,dw as ce,iL as _t,dW as Ot,eQ as Ct,bV as Vt,E as C,g0 as G,eu as lt,l as Ge,ca as He,d as At,S as jt,uy as $t,iD as Mt,dK as Et,el as Jt,dO as Lt,dM as qt,dN as zt,dL as Gt,em as Ht,dP as Ut,dq as Qt,ah as Bt,dQ as kt,il as Wt,jc as Ne,dV as Zt,iu as Kt,iv as Xt,c7 as Yt,de as ei}from"./index-J0iiHjMT.js";import{N as b,n as oe,q as Ie,r as H,c as ti,l as ii,d as ri,s as Ue,b as si,e as Qe,u as ni,v as Be,j as ai,m as oi,k as li,p as ui,w as pi,E as ci,V as mi,K as di,f as hi,t as yi}from"./ImageHistogramParameters-sFtZwJ9j.js";import{H as yt,o as gt,p as gi,J as fi,K as Ri,n as vi,b as ft,u as ke,s as wi,L as bi,j as ut,P as Si,l as xi}from"./dataUtils-s_UKlouc.js";import{d as Rt}from"./FeatureSet-d4S1oKME.js";import{s as Fi}from"./executeQueryJSON-ACj9qY0y.js";import"./pbf-o0zzptPp.js";import"./AttachmentInfo-kbEMEIl0.js";import{s as Ii,n as Di}from"./executeForIds-wXO8-pll.js";import"./TopFeaturesQuery-E6D2tV-x.js";import{o as Ti}from"./CustomParametersMixin-Y1bOcayO.js";import{e as Pi}from"./versionUtils-4v9zIDlv.js";import"./generateRendererUtils-_1jVE02H.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./queryZScale-IaMm02_2.js";const Ni={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},_i=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Oi={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},Ci=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function vt(r){return Ci.has(r.type)}function We(r,i){var e;if(!r||!i)return Q(r||i);const o=Q(r);if(o.functionDefinition&&i.rasterFunctionDefinition){const t=i.rasterFunctionDefinition;(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=void 0),wt(o.functionDefinition.arguments,i),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else((e=i.functionName)==null?void 0:e.toLowerCase())!=="none"&&(bt(o.functionArguments).Raster=i);return o}function wt(r,i){for(const o in r)o.toLowerCase()==="raster"&&(r[o].type==="RasterFunctionVariable"?(r[o]=i.rasterFunctionDefinition,r[o].type="RasterFunctionTemplate"):r[o].type==="RasterFunctionTemplate"&&wt(r[o].arguments,i))}function K(r){const i=Q(Ni[r.functionName+"Function"]),o=r.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(i.arguments[e]=K(o[e]),i.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(i.arguments[e].value=qi(o[e]),i.arguments.ColorSchemeType.value=0):i.arguments[e].value=o[e];return i}function Vi(r,i){switch(i=i||{},r.type){case"raster-stretch":return $i(r,i);case"class-breaks":return Mi(r,i);case"unique-value":return Ei(r,i);case"raster-colormap":return Ji(r,i);case"vector-field":return Ai(r,i);case"raster-shaded-relief":return ji(r,i);case"flow":throw new Error("Unsupported rendering rule.")}}function bt(r){const i=(r==null?void 0:r.Raster)??(r==null?void 0:r.raster);return i&&i.declaredClass==="esri.layers.support.RasterFunction"?bt(i.functionArguments):r}const xe={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Ai(r,i){const o=new b;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:t}=i,s=e==="vector-uv";let a,u;if(t&&t.length===2){const R=t.map(f=>f.toLowerCase());a=R.indexOf("magnitude"),u=R.indexOf("direction")}a!==-1&&a!==null||(a=0,u=1);const p=r.rotationType==="arithmetic"?1:2,m=r.flowRepresentation==="flow-from"?0:1,c=r.visualVariables?r.visualVariables.find(R=>R.field==="Magnitude"):new Dt,d={magnitudeBandID:a,directionBandID:u,isUVComponents:s,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Oi[r.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const y=K(o);return i.convertToRFT?b.fromJSON({rasterFunctionDefinition:y}):o}function ji(r,i){const o=i.convertToRFT;if(i.dataType!=="elevation"&&(i.dataType!=="generic"||i.bandCount!==1||i.pixelType!=="s16"&&i.pixelType!=="s32"&&i.pixelType!=="f32"&&i.pixelType!=="f64"))return new b;const e=new b;e.functionName="Hillshade";const t=r.hillshadeType==="traditional"?0:1,s=r.scalingType==="none"?1:3,a={HillshadeType:t,SlopeType:s,ZFactor:r.zFactor};return t===0&&(a.Azimuth=r.azimuth,a.Altitude=r.altitude),s===3&&(a.PSPower=r.pixelSizePower,a.PSZFactor=r.pixelSizeFactor),e.functionArguments=a,e.variableName="Raster",r.colorRamp&&(e.functionName="ShadedRelief",o?a.ColorRamp=yt(r.colorRamp):a.Colormap=gt(r.colorRamp)),o?new b({rasterFunctionDefinition:K(e)}):e}function $i(r,i){var u;const o=i.convertToRFT,e=new b;e.functionName="Stretch";const t=xe[gi.toJSON(r.stretchType)],s="u8",a={StretchType:t,Statistics:Li(r.statistics??[]),DRA:r.dynamicRangeAdjustment,UseGamma:r.useGamma,Gamma:r.gamma,ComputeGamma:r.computeGamma};if(r.outputMin!=null&&(a.Min=r.outputMin),r.outputMax!=null&&(a.Max=r.outputMax),t===xe.standardDeviation?(a.NumberOfStandardDeviations=r.numberOfStandardDeviations,e.outputPixelType=s):t===xe.percentClip?(a.MinPercent=r.minPercent,a.MaxPercent=r.maxPercent,e.outputPixelType=s):t===xe.minMax?e.outputPixelType=s:t===xe.sigmoid&&(a.SigmoidStrengthLevel=r.sigmoidStrengthLevel),e.functionArguments=a,e.variableName="Raster",r.colorRamp){const p=r.colorRamp,m=new b;if(o)m.functionArguments={ColorRamp:yt(p)};else{const c=fi(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!i.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=r.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&((u=d.colorRamps)!=null&&u.length)&&d.colorRamps.forEach(y=>y.algorithm=y.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:gt(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new b({rasterFunctionDefinition:K(m)}):m}return o?new b({rasterFunctionDefinition:K(e)}):e}function Mi(r,i){const o=[],e=[],t=[],s=[],{pixelType:u,rasterAttributeTable:p}=i,m=p==null?null:p.features,c=St(p);if(c&&m&&Array.isArray(m)&&r.classBreakInfos){r.classBreakInfos.forEach((h,g)=>{var $;const w=($=h.symbol)==null?void 0:$.color;let T;w!=null&&w.a&&h.minValue!=null&&h.maxValue!=null&&m.forEach(V=>{h.minValue!=null&&h.maxValue!=null&&(T=V.attributes[r.field],(T>=h.minValue&&T=h.minValue)&&s.push([V.attributes[c],w.r,w.g,w.b]))})});const f=u?Je(s,u):s,v=new b;return v.functionName="Colormap",v.functionArguments={},v.functionArguments.Colormap=f,v.variableName="Raster",i.convertToRFT?new b({rasterFunctionDefinition:K(v)}):v}r.classBreakInfos.forEach((f,v)=>{if(f.minValue==null||f.maxValue==null)return;const h=f.symbol&&f.symbol.color;h!=null&&h.a?(v===0?o.push(f.minValue,f.maxValue+1e-4):o.push(f.minValue+1e-4,f.maxValue+1e-4),e.push(v),s.push([v,h.r,h.g,h.b])):t.push(f.minValue,f.maxValue)});const d=u?Je(s,u):s,y=new b;y.functionName="Remap",y.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:t},y.variableName="Raster";const R=new b;return R.functionName="Colormap",R.functionArguments={Colormap:d,Raster:y},i.convertToRFT?new b({rasterFunctionDefinition:K(R)}):R}function Je(r,i){const o=_i.has(i)?Tt(i):null;return o&&r.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),r}function St(r){if(r==null)return;const{fields:i}=r,o=i==null?void 0:i.find(e=>(e==null?void 0:e.name)&&e.name.toLowerCase()==="value");return o==null?void 0:o.name}function Ei(r,i){var d,y,R;const o=[],{pixelType:e,rasterAttributeTable:t}=i,s=t==null?null:t.features,a=St(t),u=(y=(d=r.defaultSymbol)==null?void 0:d.color)==null?void 0:y.toRgb(),p=r.uniqueValueInfos;if(p)if(s){if(a){const f=new Map;p.forEach(h=>{var T;const g=h.value,w=(T=h.symbol)==null?void 0:T.color;g!=null&&(w!=null&&w.a)&&f.set(String(g),w.toRgb())});const v=r.field;s.forEach(({attributes:h})=>{const g=String(h[v]),w=h[a],T=f.get(g);T?o.push([w,...T]):u&&o.push([w,...u])})}}else for(let f=0;f{const e=o;if(Array.isArray(e))i.push(e);else{if(e.min==null||e.max==null)return;const t=[e.min,e.max,e.avg||0,e.stddev||0];i.push(t)}}),i}function qi(r){const i=[],o=[];return r.forEach(e=>{i.push(e[0]),o.push(Ri([...e.slice(1),255]))}),{type:"RasterColormap",values:i,colors:o}}let N=class extends z{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,o,e){this.layer.version<10.3||(o[e]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,o,e){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(o[e]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,o,e){this.format==="lerc"&&i!=null&&(o[e]=i)}get format(){var i;return((i=this.layer.renderer)==null?void 0:i.type)==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,o,e){this.format==="lerc"&&this.layer.version>=10.5&&(o[e]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let o=i.mosaicRule;const e=i.definitionExpression;return o?e&&e!==o.where&&(o=o.clone(),o.where=e):e&&(o=new H({where:e})),o}get rasterFunction(){var a,u;const i=this.layer;let{rasterFunction:o}=i;const e=i.pixelFilter,t=!i.format||i.format.includes("jpg")||i.format.includes("png");o=this._addResampleRasterFunction(o);const s=(a=i.multidimensionalSubset)==null?void 0:a.areaOfInterest;return s&&(o=this._addClipFunction(o,s)),t&&!e&&((u=i.renderer)==null?void 0:u.type)!=="vector-field"&&(o=this.combineRendererWithRenderingRule(o)),o}combineRendererWithRenderingRule(i){const o=this.layer,{rasterInfo:e,renderer:t}=o;return i=i||o.rasterFunction,!t||!vt(t)?i:We(Vi(t,{rasterAttributeTable:e.attributeTable,pixelType:e.pixelType,dataType:e.dataType,bandNames:e.bandInfos.map(({name:s})=>s),convertColorRampToColormap:o.version<10.6,convertToRFT:!!(i!=null&&i.rasterFunctionDefinition),bandCount:e.bandCount}),i)}_addResampleRasterFunction(i){var s;if(((s=this.layer.renderer)==null?void 0:s.type)!=="vector-field"||(i==null?void 0:i.functionName)==="Resample")return i;const o=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,e=this.layer.serviceRasterInfo.pixelSize;let t=new b({functionName:"Resample",functionArguments:{ResamplingType:o,InputCellSize:e}});return t=i!=null&&i.rasterFunctionDefinition?new b({rasterFunctionDefinition:K(t)}):t,We(t,i)}_addClipFunction(i,o){const e=new b({functionName:"Clip",functionArguments:{ClippingGeometry:o.toJSON(),ClippingType:1}});return We(e,i)}};n([l()],N.prototype,"layer",void 0),n([l({json:{write:!0}})],N.prototype,"adjustAspectRatio",null),n([P("adjustAspectRatio")],N.prototype,"writeAdjustAspectRatio",null),n([l({json:{write:!0}})],N.prototype,"bandIds",null),n([l({json:{write:!0}})],N.prototype,"compression",void 0),n([l({json:{write:!0}})],N.prototype,"compressionQuality",null),n([P("compressionQuality")],N.prototype,"writeCompressionQuality",null),n([l({json:{write:!0}})],N.prototype,"compressionTolerance",null),n([P("compressionTolerance")],N.prototype,"writeCompressionTolerance",null),n([l({json:{write:!0}})],N.prototype,"format",null),n([l({type:String,json:{read:{reader:oe.read},write:{writer:oe.write}}})],N.prototype,"interpolation",null),n([l({json:{write:!0}})],N.prototype,"noData",null),n([l({type:String,json:{read:{reader:Ie.read},write:{writer:Ie.write}}})],N.prototype,"noDataInterpretation",null),n([l({json:{write:!0}})],N.prototype,"pixelType",void 0),n([l({json:{write:!0}})],N.prototype,"lercVersion",void 0),n([P("lercVersion")],N.prototype,"writeLercVersion",null),n([l({type:Number})],N.prototype,"version",null),n([l({json:{write:!0}})],N.prototype,"mosaicRule",null),n([l({json:{write:!0,name:"renderingRule"}})],N.prototype,"rasterFunction",null),N=n([F("esri.layers.mixins.ExportImageServiceParameters")],N);let fe=class extends z{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};n([l({type:Number,json:{write:!0}})],fe.prototype,"north",void 0),n([l({type:Number,json:{write:!0}})],fe.prototype,"up",void 0),n([l({type:he,json:{write:!0}})],fe.prototype,"spatialReference",void 0),fe=n([F("esri.rest.support.ImageAngleResult")],fe);const zi=fe;let se=class extends z{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};n([l({type:Number,json:{read:!0,write:!0}})],se.prototype,"value",void 0),n([l({type:String,json:{read:!0,write:!0}})],se.prototype,"displayValue",void 0),n([l({type:Number,json:{read:!0,write:!0}})],se.prototype,"uncertainty",void 0),se=n([F("esri.rest.support.ImageMeasureResultValue")],se);let be=class extends se{constructor(){super(...arguments),this.unit=null}};n([l({type:String,json:{read:le.read,write:le.write}})],be.prototype,"unit",void 0),be=n([F("esri.rest.support.ImageMeasureResultLengthValue")],be);let Oe=class extends se{constructor(){super(...arguments),this.unit=null}};n([l({type:String,json:{read:$e.read,write:$e.write}})],Oe.prototype,"unit",void 0),Oe=n([F("esri.rest.support.ImageMeasureResultAreaValue")],Oe);let De=class extends se{constructor(){super(...arguments),this.unit=null}};n([l({type:String,json:{read:Me.read,write:Me.write}})],De.prototype,"unit",void 0),De=n([F("esri.rest.support.ImageMeasureResultAngleValue")],De);let ae=class extends z{constructor(){super(...arguments),this.name=null,this.sensorName=null}};n([l({type:String,json:{read:!0,write:!0}})],ae.prototype,"name",void 0),n([l({type:String,json:{read:!0,write:!0}})],ae.prototype,"sensorName",void 0),ae=n([F("esri.rest.support.BaseImageMeasureResult")],ae);let Fe=class extends ae{constructor(){super(...arguments),this.area=null,this.perimeter=null}};n([l({type:Oe,json:{read:!0,write:!0}})],Fe.prototype,"area",void 0),n([l({type:be,json:{read:!0,write:!0}})],Fe.prototype,"perimeter",void 0),Fe=n([F("esri.rest.support.ImageAreaResult")],Fe);const Gi=Fe;let Re=class extends ae{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};n([l({type:be,json:{read:!0,write:!0}})],Re.prototype,"distance",void 0),n([l({type:De,json:{read:!0,write:!0}})],Re.prototype,"azimuthAngle",void 0),n([l({type:De,json:{read:!0,write:!0}})],Re.prototype,"elevationAngle",void 0),Re=n([F("esri.rest.support.ImageDistanceResult")],Re);const Hi=Re;let Ce=class extends ae{constructor(){super(...arguments),this.height=null}};n([l({type:be,json:{read:!0,write:!0}})],Ce.prototype,"height",void 0),Ce=n([F("esri.rest.support.ImageHeightResult")],Ce);const Ui=Ce;let k=class extends z{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};n([l({json:{write:!0}})],k.prototype,"catalogItemVisibilities",void 0),n([l({type:Rt,json:{write:!0}})],k.prototype,"catalogItems",void 0),n([l({type:q,json:{write:!0}})],k.prototype,"location",void 0),n([l({json:{write:!0}})],k.prototype,"name",void 0),n([l({json:{write:!0}})],k.prototype,"objectId",void 0),n([l({json:{write:!0}})],k.prototype,"processedValues",void 0),n([l({json:{write:!0}})],k.prototype,"properties",void 0),n([l({json:{write:!0}})],k.prototype,"value",void 0),k=n([F("esri.rest.support.ImageIdentifyResult")],k);const Qi=k;let Ve=class extends z{constructor(){super(...arguments),this.geometries=null}};n([l({json:{write:!0}})],Ve.prototype,"geometries",void 0),Ve=n([F("esri.rest.support.ImagePixelLocationResult")],Ve);const Bi=Ve;let Ae=class extends ae{constructor(){super(...arguments),this.point=null}};n([l({type:q,json:{name:"point.value",read:!0,write:!0}})],Ae.prototype,"point",void 0),Ae=n([F("esri.rest.support.ImagePointResult")],Ae);const ki=Ae;let Y=class extends z{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};n([l({json:{write:!0}})],Y.prototype,"attributes",void 0),n([l({type:q,json:{write:!0}})],Y.prototype,"location",void 0),n([l({json:{write:!0}})],Y.prototype,"locationId",void 0),n([l({json:{write:!0}})],Y.prototype,"rasterId",void 0),n([l({json:{write:!0}})],Y.prototype,"resolution",void 0),n([l({json:{write:!0}})],Y.prototype,"pixelValue",void 0),Y=n([F("esri.rest.support.ImageSample")],Y);const Wi=Y;let je=class extends z{constructor(){super(...arguments),this.samples=null}};n([l({type:[Wi],json:{write:!0}})],je.prototype,"samples",void 0),je=n([F("esri.rest.support.ImageSampleResult")],je);const Zi=je;function xt(r){const i=r==null?void 0:r.time;if(i&&(i.start!=null||i.end!=null)){const o=[];i.start!=null&&o.push(i.start),i.end==null||o.includes(i.end)||o.push(i.end),r.time=o.join(",")}}async function Ft(r,i,o){const e=ie(r),t=i.geometry?[i.geometry]:[],s=await Le(t),a=i.toJSON();xt(a);const u=s==null?void 0:s[0];u!=null&&(a.geometry=u.toJSON());const p=ye({...e.query,f:"json",...a});return ge(p,o)}async function Ki(r,i,o){var p,m,c;const e=i.toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),(m=(p=i==null?void 0:i.point)==null?void 0:p.spatialReference)!=null&&m.imageCoordinateSystem&&(e.point.spatialReference=ze(i.point.spatialReference)),(c=i==null?void 0:i.spatialReference)!=null&&c.imageCoordinateSystem&&(e.spatialReference=It(i.spatialReference));const t=ie(r),s=ye({...t.query,f:"json",...e}),a=ge(s,o),{data:u}=await _(`${t.path}/computeAngles`,a);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new he({wkid:0,imageCoordinateSystem:u.spatialReference}):he.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new zi(u)}async function Xi(r,i,o){var m;const e=i.toJSON(),{geometries:t}=i;if(t)for(let c=0;c{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:a,histograms:s.histograms}}async function er(r,i,o){const e=await Ft(r,i,o),t=ie(r),{data:s}=await _(`${t.path}/computeHistograms`,e);return{histograms:s.histograms}}async function tr(r,i,o){var d,y;const e=i.toJSON();xt(e),(d=e.outFields)!=null&&d.length&&(e.outFields=e.outFields.join(","));const t=await Le(i.geometry),s=t==null?void 0:t[0];s!=null&&(e.geometry=s.toJSON());const a=ie(r),u=ye({...a.query,f:"json",...e}),p=ge(u,o),{data:m}=await _(`${a.path}/getSamples`,p),c=(y=m==null?void 0:m.samples)==null?void 0:y.map(R=>{const f=R.value==="NaN"||R.value===""?null:R.value.split(" ").map(v=>Number(v));return{...R,pixelValue:f}});return Zi.fromJSON({samples:c})}async function pt(r,i,o){const e=ie(r),t=i.geometry?[i.geometry]:[];return Le(t).then(s=>{const a=i.toJSON(),u=s==null?void 0:s[0];u!=null&&(a.geometry=JSON.stringify(u.toJSON()));const p=ye({...e.query,f:"json",...a}),m=ge(p,o);return _(e.path+"/identify",m)}).then(s=>Qi.fromJSON(s.data))}async function ir(r,i,o){const e=await qe(r,i,[i.fromGeometry,i.toGeometry],o);return Ui.fromJSON(e)}async function rr(r,i,o){const e=await qe(r,i,[i.geometry],o);return Gi.fromJSON(e)}async function sr(r,i,o){const e=await qe(r,i,[i.geometry],o);return ki.fromJSON(e)}async function nr(r,i,o){const e=await qe(r,i,[i.fromGeometry,i.toGeometry],o);return Hi.fromJSON(e)}async function qe(r,i,o,e){const t=ie(r),s=await Le(o),a=i.toJSON();s[0]!=null&&(a.fromGeometry=JSON.stringify(ct(s[0]))),s[1]!=null&&(a.toGeometry=JSON.stringify(ct(s[1])));const u=ye({...t.query,f:"json",...a}),p=ge(u,e),{data:m}=await _(t.path+"/measure",p);return m}function ct(r){var o;const i=r.toJSON();return(o=r.spatialReference)!=null&&o.imageCoordinateSystem&&(i.spatialReference=ze(r.spatialReference)),i}function ze(r){const{imageCoordinateSystem:i}=r;if(i){const{id:o,referenceServiceName:e}=i;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:i}}return r.toJSON()}function It(r,i){if(!r.imageCoordinateSystem)return Ze(r);const o=ze(r),{icsid:e,icsns:t}=o;return e==null||t!=null&&!(i!=null&&i.toLowerCase().includes("/"+t.toLowerCase()+"/"))?JSON.stringify(o):`0:${e}`}async function ar(r,i,o){var $,V;const e=ie(r),t=ye({...e==null?void 0:e.query,f:"json"}),s=ge(t,o),a=`${e==null?void 0:e.path}/${i}/info`,u=_(`${a}`,s),p=_(`${a}/keyProperties`,s),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let y=null;($=c.statistics)!=null&&$.length&&(y=c.statistics.map(x=>({min:x[0],max:x[1],avg:x[2],stddev:x[3]})));const R=_e.fromJSON(c.extent),f=Math.ceil(R.width/c.pixelSizeX-.1),v=Math.ceil(R.height/c.pixelSizeY-.1),h=R.spatialReference,g=new q({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:h}),w=(V=c.histograms)!=null&&V.length?c.histograms:null,T=new vi({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new ft({width:f,height:v,bandCount:c.bandCount,extent:R,spatialReference:h,pixelSize:g,pixelType:c.pixelType.toLowerCase(),statistics:y,histograms:w,keyProperties:d,storageInfo:T})}var Ke;let me=Ke=class extends z{constructor(r){super(r),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ke(Q({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};n([l({type:[String],json:{name:"angleName",write:!0}})],me.prototype,"angleNames",void 0),n([l({type:q,json:{write:!0}})],me.prototype,"point",void 0),n([l({type:he,json:{write:!0}})],me.prototype,"spatialReference",void 0),n([l({type:Ee,json:{write:!0}})],me.prototype,"rasterId",void 0),me=Ke=n([F("esri.rest.support.ImageAngleParameters")],me);const or=me,U=new Pt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let W=class extends z{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};n([l()],W.prototype,"type",void 0),n([l({type:U.apiValues,json:{read:U.read,write:U.write}})],W.prototype,"measureOperation",void 0),n([l({type:H,json:{write:!0}})],W.prototype,"mosaicRule",void 0),n([l({type:q,json:{write:!0}})],W.prototype,"pixelSize",void 0),n([l({json:{write:!0}})],W.prototype,"raster",void 0),W=n([F("esri.rest.support.BaseImageMeasureParameters")],W);var Xe;let ee=Xe=class extends W{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(r,i,o){r!=null&&(i.geometryType=Se(r),i[o]=r.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new Xe(Q({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({types:nt,json:{name:"fromGeometry",read:!0,write:!0}})],ee.prototype,"geometry",void 0),n([P("geometry")],ee.prototype,"writeGeometry",null),n([l({type:U.apiValues,json:{write:U.write}})],ee.prototype,"measureOperation",null),n([l({json:{read:!0}})],ee.prototype,"is3D",void 0),n([l({type:String,json:{read:le.read,write:le.write}})],ee.prototype,"linearUnit",void 0),n([l({type:String,json:{read:$e.read,write:$e.write}})],ee.prototype,"areaUnit",void 0),ee=Xe=n([F("esri.rest.support.ImageAreaParameters")],ee);const lr=ee;var Ye;let Z=Ye=class extends W{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(r,i,o){r!=null&&(i.geometryType=Se(r),i[o]=r.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new Ye(Q({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({type:q,json:{read:!0,write:!0}})],Z.prototype,"fromGeometry",void 0),n([P("fromGeometry")],Z.prototype,"writeFromGeometry",null),n([l({type:q,json:{read:!0,write:!0}})],Z.prototype,"toGeometry",void 0),n([l({type:U.apiValues,json:{write:U.write}})],Z.prototype,"measureOperation",null),n([l({json:{read:!0}})],Z.prototype,"is3D",void 0),n([l({type:String,json:{read:le.read,write:le.write}})],Z.prototype,"linearUnit",void 0),n([l({type:String,json:{read:Me.read,write:Me.write}})],Z.prototype,"angularUnit",void 0),Z=Ye=n([F("esri.rest.support.ImageDistanceParameters")],Z);const ur=Z;var et;let te=et=class extends W{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(r,i,o){r!=null&&(i.geometryType=Se(r),i[o]=r.toJSON())}get measureOperation(){return this.operationType}clone(){return new et(Q({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({type:q,json:{read:!0}})],te.prototype,"fromGeometry",void 0),n([P("fromGeometry")],te.prototype,"writeFromGeometry",null),n([l({type:q,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),n([l({type:U.apiValues,json:{write:U.write}})],te.prototype,"measureOperation",null),n([l({json:{read:!0}})],te.prototype,"operationType",void 0),n([l({type:String,json:{read:le.read,write:le.write}})],te.prototype,"linearUnit",void 0),te=et=n([F("esri.rest.support.ImageHeightParameters")],te);const pr=te;var tt;let D=tt=class extends z{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(r,i,o){r!=null&&(i.geometryType=Se(r),i[o]=JSON.stringify(r.toJSON()))}set mosaicRule(r){let i=r;i!=null&&i.mosaicMethod&&(i=H.fromJSON({...i.toJSON(),mosaicMethod:i.mosaicMethod,mosaicOperation:i.mosaicOperation})),this._set("mosaicRule",i)}writeMosaicRule(r,i,o){r!=null&&(i[o]=JSON.stringify(r.toJSON()))}get renderingRule(){return we(ne.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(r){we(ne.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",r)}get renderingRules(){return we(ne.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(r){we(ne.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",r)}set rasterFunction(r){let i=r;i!=null&&i.rasterFunction&&(i=b.fromJSON({...i.toJSON(),rasterFunction:i.rasterFunction,rasterFunctionArguments:i.rasterFunctionArguments})),this._set("rasterFunction",i)}writeRasterFunction(r,i,o){r!=null&&(i[o]=JSON.stringify(r.toJSON())),r.rasterFunctionDefinition&&(i[o]=JSON.stringify(r.rasterFunctionDefinition))}writeRasterFunctions(r,i,o){r!=null&&(i[o]=JSON.stringify(r.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(r,i,o){r!=null&&(i[o]=JSON.stringify(r))}writeTimeExtent(r,i,o){if(r!=null){const e=r.start!=null?r.start.getTime():null,t=r.end!=null?r.end.getTime():null;i[o]=e!=null?t!=null?`${e},${t}`:`${e}`:null}}clone(){return new tt(Q({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};n([l({json:{write:!0}})],D.prototype,"geometry",void 0),n([P("geometry")],D.prototype,"writeGeometry",null),n([l({type:H,json:{write:!0}})],D.prototype,"mosaicRule",null),n([P("mosaicRule")],D.prototype,"writeMosaicRule",null),n([l({type:b})],D.prototype,"renderingRule",null),n([l({type:[b]})],D.prototype,"renderingRules",null),n([l({type:b,json:{write:!0,name:"renderingRule"}})],D.prototype,"rasterFunction",null),n([P("rasterFunction")],D.prototype,"writeRasterFunction",null),n([l({type:[b],json:{write:!0,name:"renderingRules"}})],D.prototype,"rasterFunctions",void 0),n([P("rasterFunctions")],D.prototype,"writeRasterFunctions",null),n([l({type:q,json:{write:!0}})],D.prototype,"pixelSize",void 0),n([P("pixelSize")],D.prototype,"writePixelSize",null),n([l({type:Boolean,json:{write:!0}})],D.prototype,"returnGeometry",void 0),n([l({type:Boolean,json:{write:!0}})],D.prototype,"returnCatalogItems",void 0),n([l({type:Boolean,json:{write:!0}})],D.prototype,"returnPixelValues",void 0),n([l({type:Number,json:{write:!0}})],D.prototype,"maxItemCount",void 0),n([l({type:dt,json:{write:{target:"time"}}})],D.prototype,"timeExtent",void 0),n([P("timeExtent")],D.prototype,"writeTimeExtent",null),n([l({json:{write:!0}})],D.prototype,"raster",void 0),n([l({json:{write:!0}})],D.prototype,"viewId",void 0),n([l({type:Boolean,json:{write:!0}})],D.prototype,"processAsMultidimensional",void 0),D=tt=n([F("esri.rest.support.ImageIdentifyParameters")],D);const mt=D;var it;let ve=it=class extends z{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(r,i,o){i.geometries={geometryType:"esriGeometryPoint",geometries:r.map(e=>e.toJSON())}}clone(){var r;return new it({geometries:((r=this.geometries)==null?void 0:r.map(i=>i.clone()))??[],rasterId:this.rasterId})}};n([l({type:[q],json:{write:!0}})],ve.prototype,"geometries",void 0),n([P("geometries")],ve.prototype,"writeGeometry",null),n([l({type:Ee,json:{write:!0}})],ve.prototype,"rasterId",void 0),ve=it=n([F("esri.rest.support.ImagePixelLocationParameters")],ve);const cr=ve;var rt;let de=rt=class extends W{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(r,i,o){r!=null&&(i.geometryType=Se(r),i[o]=r.toJSON())}get measureOperation(){const{is3D:r,geometry:i}=this;return i.type==="point"?r?"point-3D":"point":r?"centroid-3D":"centroid"}clone(){return new rt(Q({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};n([l({types:nt,json:{name:"fromGeometry",read:ht}})],de.prototype,"geometry",void 0),n([P("geometry")],de.prototype,"writeGeometry",null),n([l({type:U.apiValues,json:{read:U.read,write:U.write}})],de.prototype,"measureOperation",null),n([l({json:{read:!0}})],de.prototype,"is3D",void 0),de=rt=n([F("esri.rest.support.ImagePointParameters")],de);const mr=de;var st;let j=st=class extends z{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(r,i,o){r!=null&&(i.geometryType=Se(r),i[o]=r.toJSON())}set locations(r){if(r!=null&&r.length){const i=new Nt({spatialReference:r[0].spatialReference});i.points=r.map(o=>[o.x,o.y]),this._set("locations",r),this.geometry=i}}clone(){return new st(Q({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};n([l({types:nt,json:{read:ht}})],j.prototype,"geometry",void 0),n([P("geometry")],j.prototype,"writeGeometry",null),n([l()],j.prototype,"locations",null),n([l({type:String,json:{type:oe.jsonValues,read:oe.read,write:oe.write}})],j.prototype,"interpolation",void 0),n([l({type:H,json:{write:!0}})],j.prototype,"mosaicRule",void 0),n([l({type:[String],json:{write:!0}})],j.prototype,"outFields",void 0),n([l({type:q,json:{write:!0}})],j.prototype,"pixelSize",void 0),n([l({type:String,json:{write:!0}})],j.prototype,"raster",void 0),n([l({type:Boolean,json:{write:!0}})],j.prototype,"returnFirstValueOnly",void 0),n([l({type:Number,json:{write:!0}})],j.prototype,"sampleDistance",void 0),n([l({type:Number,json:{write:!0}})],j.prototype,"sampleCount",void 0),n([l({type:Number,json:{write:!0}})],j.prototype,"sliceId",void 0),n([l({type:dt,json:{read:{source:"time"},write:{target:"time"}}})],j.prototype,"timeExtent",void 0),j=st=n([F("esri.rest.support.ImageSampleParameters")],j);const dr=j,hr=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),yr=$t(Mt,{min:0,max:255});function gr(r){if(!r)return null;const i=JSON.stringify(r).match(/"rasterFunction":"(.*?")/gi),o=i==null?void 0:i.map(e=>e.replace('"rasterFunction":"',"").replace('"',""));return o?o.join("/"):null}const fr=r=>{let i=class extends r{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new N({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(s=>typeof s=="number"))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,s){e!=null&&this.format!=="lerc"&&(t[s]=e)}writeCompressionTolerance(e,t,s){this.format==="lerc"&&e!=null&&(t[s]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?H.fromJSON(t):null}get fieldsIndex(){return this.fields?new Ct(this.fields):null}set format(e){e&&hr.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return t.serviceDataType==="esriImageServiceDataTypeVector-UV"||t.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t!=null&&t.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const s=e||t.mosaicRule;return s?H.fromJSON(s):this._isMosaicRuleSupported(t)?H.fromJSON(t):null}writeMosaicRule(e,t,s){let a=this.mosaicRule;const u=this.definitionExpression;a?u&&u!==a.where&&(a=a.clone(),a.where=u):u&&(a=new H({where:u})),this._isValidCustomizedMosaicRule(a)&&(t[s]=a.toJSON())}writeNoData(e,t,s){e!=null&&typeof e=="number"&&(t[s]=yr(e))}readObjectIdField(e,t){if(!e){const s=t.fields.find(a=>a.type==="esriFieldTypeOID"||a.type==="oid");e=s==null?void 0:s.name}return e}get parsedUrl(){return Vt(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,s){var p,m;const a=(m=(p=t==null?void 0:t.layerDefinition)==null?void 0:p.drawingInfo)==null?void 0:m.renderer,u=si(a,s);return u==null?null:(u.type==="vector-field"&&t.symbolTileSize&&!a.symbolTileSize&&(u.symbolTileSize=t.symbolTileSize),vt(u)||ne.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,t,s){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){var m;const e=this._rasterAttributeTableFieldPrefix,t=new ce({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new ce({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),a=new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?Q(this.fields):[];u.push(s),(m=this.capabilities)!=null&&m.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(t),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(c=>c.name.toLowerCase()==="none")&&u.push(a),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(c=>c.name.toLowerCase()!=="none").forEach(c=>{u.push(new ce({name:"Raster.ServicePixelValue."+c.name,alias:c.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new ce({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new ce({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const c=p.fields.filter(d=>d.type!=="esriFieldTypeOID"&&d.name.toLowerCase()!=="value").map(d=>{const y=Q(d);return y.name=e+d.name,y});u=u.concat(c)}return u}get renderingRule(){return we(ne.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this.rasterFunction}set renderingRule(e){we(ne.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}set rasterFunction(e){let t=e;t!=null&&t.rasterFunction&&(t=b.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const s=t.rasterFunctionInfos;return t.renderingRule||s!=null&&s.length&&s[0].name!=="None"?this._isRFTJson(t.renderingRule)?b.fromJSON({rasterFunctionDefinition:t.renderingRule}):b.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const s=e||t.extent.spatialReference;return s?he.fromJSON(s):null}readPixelType(e){return Ue.fromJSON(e)||e}writePixelType(e,t,s){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(t[s]=Ue.toJSON(e))}readVersion(e,t){let s=t.currentVersion;return s||(s=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),s}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let s=e;const{renderer:a,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&a&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(a.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,t),this._cachedRendererJson=a.toJSON());const y=await d.symbolize({bandIds:m,...e},t);s={extent:e.extent,pixelBlock:y}}else s={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return s}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeAngles)throw new C("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=G(or,e).clone(),Ki(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputePixelLocation)throw new C("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=G(cr,e).clone(),Xi(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeHistograms)throw new C("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=G(Qe,e).clone(),this._applyMosaicAndRenderingRules(e),er(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeStatisticsHistograms)throw new C("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=G(Qe,e).clone(),this._applyMosaicAndRenderingRules(e),Yi(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const s=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(e.operationType==="base-and-top"?s.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?s.mensuration.supportsHeightFromBaseAndTopShadow:s.mensuration.supportsHeightFromTopAndTopShadow))throw new C("imagery-layer:measure-height","this operation is not supported on the input image service");return e=G(pr,e).clone(),this._applyMosaicAndRenderingRules(e),ir(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const s=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(s.mensuration.supportsAreaAndPerimeter&&(!e.is3D||s.mensuration.supports3D)))throw new C("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=G(lr,e).clone(),this._applyMosaicAndRenderingRules(e),rr(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const s=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(s.mensuration.supportsDistanceAndAngle&&(!e.is3D||s.mensuration.supports3D)))throw new C("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=G(ur,e).clone(),this._applyMosaicAndRenderingRules(e),nr(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const s=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(s.mensuration.supportsPointOrCentroid&&(!e.is3D||s.mensuration.supports3D)))throw new C("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=G(mr,e).clone(),this._applyMosaicAndRenderingRules(e),sr(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return t!=null?t.get(e):void 0}getFieldDomain(e,t){const s=this.getField(e);return s?s.domain:null}async fetchImage(e,t,s,a={}){if(e==null||t==null||s==null)throw new C("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const d=await this._generateRasterInfo(this.rasterFunction,{signal:a.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,t,s,a.timeExtent);if(u==null){if(a.requestAsImageElement&&this._canRequestImageElement(this.format)){const g=document.createElement("canvas");return g.width=t,g.height=s,a.returnImageBitmap?{imageBitmap:await lt(g,`${o(this.parsedUrl)}/exportImage`,a.signal)}:{imageOrCanvasElement:g}}const{bandIds:d,rasterInfo:y}=this,R=((d==null?void 0:d.length)||y.bandCount)??0,f=t*s,v=y.pixelType,h=[];for(let g=0;g=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>t.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new C("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):_(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e==null?void 0:e.rasterFunction:null})}).then(t=>Rt.fromJSON(t.data))}getCatalogItemRasterInfo(e,t){const s={...t,query:this._getQueryParams()};return ar(o(this.parsedUrl),e,s)}async getCatalogItemICSInfo(e,t){var ue,pe,X,at,ot;const{data:s}=await _(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),a=s==null?void 0:s.ics;if(!a)return;let u=null;try{u=(await _(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!u||!u.spatialReference)return{ics:a,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?_(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(S=>S.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:Ze(m),outSR:"0:"+e},d=_(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...t}).then(S=>S.data).catch(()=>({})),y=5,R=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(y+1),v=u.ymin+f,h=[];for(let S=0;SS.data).catch(()=>({})),T=await Promise.all([p,d,w]);let $=T[0].ipxf;if($==null){const S=(ue=a.geodataXform)==null?void 0:ue.xf_0;((pe=S==null?void 0:S.name)==null?void 0:pe.toLowerCase())==="topup"&&((X=S==null?void 0:S.coefficients)==null?void 0:X.length)===6&&($={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:S.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const V=_e.fromJSON((ot=(at=T[1])==null?void 0:at.geometries)==null?void 0:ot[0]);V&&(V.spatialReference=new he({wkid:0,imageCoordinateSystem:a}));const x=T[2].geometries?T[2].geometries.filter(S=>(S==null?void 0:S.x)!=null&&S.y!=null&&S.x!=="NaN"&&S.y!=="NaN"):[],J=x.length;if(J<3)return{ics:a,icsToPixelTransform:$,icsExtent:V,northDirection:null};let B=0,O=0,I=0,M=0;for(let S=0;Sx[0].x,Pe=x[y-1].y>x[0].y;return A===1/0?re=Pe?90:270:A===0?re=Te?0:180:A>0?re=Te?180*Math.atan(A)/Math.PI:180*Math.atan(A)/Math.PI+180:A<0&&(re=Pe?180+180*Math.atan(A)/Math.PI:360+180*Math.atan(A)/Math.PI),{ics:a,icsToPixelTransform:$,icsExtent:V,northDirection:re}}async generateRasterInfo(e,t){var p;if(e=G(b,e),this.serviceRasterInfo&&(!e||((p=e.functionName)==null?void 0:p.toLowerCase())==="none"||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const s=gr(e);if(!s)throw new C("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const a={...t,query:this._getQueryParams()},u=ni(o(this.parsedUrl),e,a);this._functionRasterInfos[s]=u;try{return await u}catch(m){throw this._functionRasterInfos[s]=null,m}}getExportImageServiceParameters(e,t,s,a){var h;e=e.clone().shiftCentralMeridian();const u=It(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const y=(h=this.rasterFunction)==null?void 0:h.rasterFunctionDefinition,R=!this.renderer||this.renderer.type==="raster-stretch";if(m!=null&&m.length&&this._hasRasterFunction(this.rasterFunction)&&!y&&R){const g={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")g.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=g;else if(d.rasterFunction==="Colormap"){const w=d.rasterFunctionArguments.Raster;(w==null?void 0:w.rasterFunction)==="Stretch"?(g.rasterFunctionArguments.Raster=w.rasterFunctionArguments.Raster,w.rasterFunctionArguments.Raster=g):(g.rasterFunctionArguments.Raster=w,d.rasterFunctionArguments.Raster=g)}else g.rasterFunctionArguments.Raster=d,d=g;p.bandIds=void 0}else p.bandIds=m==null?void 0:m.join(",");c instanceof Array&&c.length>0&&(p.noData=c.join(","));const f=this._processMultidimensionalIntersection(null,a,this.exportImageServiceParameters.mosaicRule);if(f.isOutSide)return null;p.mosaicRule=f.mosaicRule!=null?JSON.stringify(f.mosaicRule):null,a=f.timeExtent,p.renderingRule=this._getRenderingRuleString(b.fromJSON(d));const v={};if(a!=null){const{start:g,end:w}=a.toJSON();g&&w&&g===w?v.time=""+g:g==null&&w==null||(v.time=`${g??"null"},${w??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:t+","+s,...p,...v}}async getSamples(e,t){const s=await this._fetchCapabilities(t==null?void 0:t.signal);if(!(s!=null&&s.operations.supportsGetSamples))throw new C("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=G(dr,e).clone();const{raster:a}=this;return a&&e.raster==null&&(e.raster=a),tr(this.url,e,this._getRequestOptions(t))}async identify(e,t){var p;if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsIdentify)throw new C("imagery-layer:identify","identify operation is not supported on the input image service");e=G(mt,e).clone(),this.version<10.91&&((p=e.geometry)==null?void 0:p.type)==="extent"&&(e.geometry=Ge.fromExtent(e.geometry));const s=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(s.isOutSide)throw new C("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=s.timeExtent,e.mosaicRule=s.mosaicRule;const{raster:a,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),a&&e.raster==null&&(e.raster=a),pt(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new He;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Fi(this.url,e,t)}async queryObjectIds(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Ii(this.url,e,t)}async queryRasterCount(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Di(this.url,e,t)}async queryVisibleRasters(e,t){var V,x,J,B;if(!e)throw new C("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:s,returnDomainValues:a,returnTopmostRaster:u,showNoDataRecords:p}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const y="raster.servicepixelvalue",R=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(O=>!O.toLowerCase().includes(y)),this.version>=10.4)){const O=e.outFields.filter(M=>M.toLowerCase().includes(y)&&M.length>y.length).map(M=>{const A=M.slice(y.length+1);return[this._updateRenderingRulesFunctionName(A,R),A]});c=O.map(M=>new b({functionName:M[0]})),d=O.map(M=>M[1]);const{rasterFunction:I}=this;c.length===0?I!=null&&I.functionName?(c.push(I),d.push(I.functionName)):c=null:I!=null&&I.functionName&&!c.some(M=>M.functionName===I.functionName)&&(c.push(I),d.push(I.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:v}=this;let h=e.timeExtent||this.timeExtent;if(v){const{isOutside:O,intersection:I}=Be(v,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:(V=this.exportImageServiceParameters.mosaicRule)==null?void 0:V.multidimensionalDefinition});if(O)throw new C("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");(I==null?void 0:I.timeExtent)!=null&&(h=I.timeExtent)}const g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,h);let w=e.geometry;this.version<10.91&&(w==null?void 0:w.type)==="extent"&&(w=Ge.fromExtent(w));const T=this._getQueryParams({geometry:w,timeExtent:h,mosaicRule:g,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:s,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete T.f;const $=new mt(T);try{await this._generateRasterInfo(this.rasterFunction);const O=await pt(this.url,$,{signal:t==null?void 0:t.signal,query:{...this.customParameters}}),I=e.outFields,M=O.value!=null&&O.value.toLowerCase().includes("nodata");if(!(m&&!f&&((x=O==null?void 0:O.catalogItems)!=null&&x.features.length)&&(p||!M)))return this._processVisibleRastersResponse(O,{returnDomainValues:a,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:I});const A=this.objectIdField||"ObjectId",re=((J=O.catalogItems)==null?void 0:J.features)??[],Te=re.map(pe=>{var X;return(X=pe.attributes)==null?void 0:X[A]}),Pe=new He({objectIds:Te,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[A]}),ue=await this.queryRasters(Pe);return(B=ue==null?void 0:ue.features)!=null&&B.length&&ue.features.forEach(pe=>{re.forEach(X=>{X.attributes[A]===pe.attributes[A]&&(X.geometry=new Ge(pe.geometry),e.outSpatialReference!=null&&(X.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(O,{returnDomainValues:a,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:I})}catch{throw new C("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const s=_(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.statistics}),a=_(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.histograms}),u=await Promise.all([s,a]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,t){const s=this._rasterJobHandler.instance;return s?s.createFlowMesh(e,t):wi(e.meshType,e.simulationSettings,e.flowData,t.signal!=null?t.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return ai(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,s=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):oi(o(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),li(p,t),p)),a=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([s,a,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),ne.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([At(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,t){var v;const s=this.timeInfo,{multidimensionalInfo:a}=this.serviceRasterInfo;if(e==null||a==null||t==null||(s==null?void 0:s.startField)==null)return e;const{startField:u}=s,p=a.variables.some(h=>h.dimensions.some(g=>g.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=(v=e.multidimensionalDefinition)==null?void 0:v.filter(h=>h.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(h=>h.dimensionName===p),c=t.start!=null?t.start.getTime():null,d=t.end!=null?t.end.getTime():null,y=c==null||d==null||c===d,R=y?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(h=>{h.dimensionName===p&&(f?(h.dimensionName=null,h.isSlice=!1,h.values=[]):(h.isSlice=y,h.values=R))});else if(!f){const h=e.multidimensionalDefinition.filter(g=>g.variableName!=null&&g.dimensionName==null);h.length?h.forEach(g=>{g.dimensionName=p,g.isSlice=y,g.values=R}):e.multidimensionalDefinition.push(new ui({variableName:"",dimensionName:p,isSlice:y,values:R}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(t=>!(!t.variableName&&!t.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQuery)throw new C("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?G(He,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yi;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:s}=this;return e.type==="unique-value"&&this._hasRasterFunction(s)&&(t==null?void 0:t.bandCount)===1&&["u8","s8"].includes(t.pixelType)||t!=null&&e!=null&&pi(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var s;let t=this.sourceJSON;if(!t){const{data:a,ssl:u}=await _(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=a,this.sourceJSON=t,u&&(this.url=this.url.replace(/^http:/i,"https:"))}if(((s=t.capabilities)==null?void 0:s.toLowerCase().split(",").map(a=>a.trim()).indexOf("tilesonly"))>-1)throw new C("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":((t=e.fields)==null?void 0:t.length)>0}_isMosaicRuleSupported(e){var a;if(!e)return!1;const t=this._isMosaicDataset(e),s=e.currentVersion>=10.71&&e.hasMultidimensions&&!(((a=e.fields)==null?void 0:a.length)>1);return t||s}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:t,functionArguments:s}=e,a=(t==null?void 0:t.toLowerCase())==="resample",u=(s==null?void 0:s.ResampleType)||(s==null?void 0:s.resampleType);return a&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){var a,u;const t=this._isPicture(),{rasterInfo:s}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&s.bandCount>=3){const m=ci(s);!m||s.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=mi(s,{bandIds:this.bandIds,variableName:this.rasterFunction?null:(u=(a=this.mosaicRule)==null?void 0:a.multidimensionalDefinition)==null?void 0:u[0].variableName}));const p=di(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=s):this.symbolizer=new bi({rendererJSON:p,rasterInfo:s}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){(e==null?void 0:e.renderingRule)!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:s}=this;return{raster:t,viewId:s,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e==null?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,s){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):ut(e,t,s)}async _getRasterFunctionInfos(e){var s;const t=this.sourceJSON.rasterFunctionInfos;return this.loaded?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()==="none"?t:(s=(await _(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data)==null?void 0:s.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:s,returnImageBitmap:a,signal:u}=e;if(s&&this._canRequestImageElement(t.format)){const v=`${o(this.parsedUrl)}/exportImage`,{data:h}=await _(v,{responseType:a?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return h instanceof Blob?{imageBitmap:await lt(h,v,u),params:t}:{imageOrCanvasElement:h,params:t}}const p=this._initJobHandler(),m=_(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=t.format||"jpgpng";let y=d;if(y!=="bsq"&&y!=="bip"&&(y=Si(c)),!y)throw new C("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const R={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(y==="png"||y==="jpg")?ut(c,{useCanvas:!0,...t},R):this._decodePixelBlock(c,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:d},R)),extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){var t;return e&&JSON.stringify(e.toJSON())!==JSON.stringify((t=this.defaultMosaicRule)==null?void 0:t.toJSON())}_updateMultidimensionalDefinition(e){var s;if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=hi(e,{multidimensionalSubset:this.multidimensionalSubset});if(t!=null&&t.length>0){this.mosaicRule=this.mosaicRule||new H;const a=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&((s=this.rasterFunction.functionName)==null?void 0:s.toLowerCase())!=="none"&&t.forEach(u=>u.variableName=""),t=t.filter(({variableName:u,dimensionName:p})=>u&&u!=="*"||p),!(a!=null&&a.length)&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){var T,$,V;t=t||{};const s=e.value,{templateRRFunctionNames:a,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=t,c=e.processedValues;let d=(T=e.catalogItems)==null?void 0:T.features,y=((V=($=e.properties)==null?void 0:$.Values)==null?void 0:V.map(x=>x.replaceAll(/ /gi,", ")))||[];const R=this.objectIdField||"ObjectId",f=typeof s=="string"&&s.toLowerCase().includes("nodata"),v=[];if(s&&!d&&!f){const x={};x[R]=0,y=[s],d=[new jt(this.fullExtent,null,x)]}if(!d)return[];let h,g,w;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let x=0;x0&&a&&a.length>0&&a.includes(this.rasterFunction.functionName)?c[a.indexOf(this.rasterFunction.functionName)]:s,g.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",B="Raster.ServicePixelValue";h.attributes[J]=g,h.attributes[B]=w,this._updateFeatureWithMagDirValues(h,g);const O=this.fields&&this.fields.length>0;let I=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?O?g:s:w;this.rasterFunction||(I=O?g:s),this._updateFeatureWithRasterAttributeTableValues(h,I)}if(h.sourceLayer=h.layer=this,p&&this._updateFeatureWithDomainValues(h),a&&c&&a.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=a.filter(c=>c.attributes[p]===(t!=null?parseInt(t,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const s=t.split(/,\s*/).map(c=>parseFloat(c)),a=s.map(c=>[c]),u=s.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ke({height:1,width:1,pixelType:"f32",pixels:a,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new _e(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:xi([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(s=>s.domain&&s.domain.type==="coded-value");t!=null&&t.forEach(s=>{const a=e.attributes[s.name];if(a!=null){const u=s.domain.codedValues.find(p=>p.code===a);u&&(e.attributes[s.name]=u.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const s=this.fieldsIndex;s!=null&&e.forEach(a=>{var u;if(a!=null&&a.attributes)for(const p of t){const m=(u=s.get(p))==null?void 0:u.name;m&&m!==p&&(a.attributes[p]=a.attributes[m],delete a.attributes[m])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return(e==null?void 0:e.functionName)!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const s=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(s)?t.get(s):e}_isRFTJson(e){return(e==null?void 0:e.name)&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:s,rasterFunction:a}=this;a&&e instanceof Qe&&e.rasterFunction==null&&(e.rasterFunction=a),s&&e.mosaicRule==null&&(e.mosaicRule=s),t&&e.raster==null&&(e.raster=t)}_readCapabilities(e){var v;const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(h=>h.trim()):["image","catalog"],{currentVersion:s,advancedQueryCapabilities:a,maxRecordCount:u}=e,p=t.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!((v=e.extent)!=null&&v.spatialReference)),d=t.includes("edit"),y=t.includes("mensuration")&&c,R=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(h=>h.trim()),f=y&&R.includes("basic");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsMeasure:y,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:s>=10.2&&p,supportsProject:s>=10.3&&p,supportsComputeStatisticsHistograms:s>=10.4&&p,supportsQueryBoundary:s>=10.6&&p,supportsCalculateVolume:s>=10.7&&m,supportsComputePixelLocation:s>=10.7&&t.includes("catalog"),supportsComputeAngles:s>=10.91,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!(a!=null&&a.supportsStatistics),supportsOrderBy:!!(a!=null&&a.supportsOrderBy),supportsDistinct:!!(a!=null&&a.supportsDistinct),supportsPagination:!!(a!=null&&a.supportsPagination),supportsStandardizedQueriesOnly:!!(a!=null&&a.useStandardizedQueries),supportsPercentileStatistics:!!(a!=null&&a.supportsPercentileStatistics),supportsCentroid:!!(a!=null&&a.supportsReturningGeometryCentroid),supportsDistance:!!(a!=null&&a.supportsQueryWithDistance),supportsExtent:!!(a!=null&&a.supportsReturningQueryExtent),supportsGeometryProperties:!!(a!=null&&a.supportsReturningGeometryProperties),supportsHavingClause:!!(a!=null&&a.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!(a!=null&&a.supportsDefaultSR),supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:y&&R.includes("base-top height"),supportsHeightFromBaseAndTopShadow:y&&R.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:y&&R.includes("top-top shadow height"),supports3D:y&&R.includes("3d")}}}};function o(e){return(e==null?void 0:e.path)??""}return n([l({clonable:!1})],i.prototype,"_functionRasterInfos",void 0),n([l({clonable:!1})],i.prototype,"_rasterJobHandler",void 0),n([l({clonable:!1})],i.prototype,"_cachedRendererJson",void 0),n([l({readOnly:!0})],i.prototype,"_serviceSupportsMosaicRule",void 0),n([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],i.prototype,"readServiceSupportsMosaicRule",null),n([l({readOnly:!0})],i.prototype,"_rasterAttributeTableFieldPrefix",void 0),n([l({readOnly:!0})],i.prototype,"_rasterFunctionNamesIndex",null),n([l()],i.prototype,"adjustAspectRatio",void 0),n([l({type:[Ee],json:{write:!0}})],i.prototype,"bandIds",void 0),n([E("bandIds")],i.prototype,"readBandIds",null),n([l({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",void 0),n([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],i.prototype,"readCapabilities",null),n([l({type:Number})],i.prototype,"compressionQuality",void 0),n([P("compressionQuality")],i.prototype,"writeCompressionQuality",null),n([l({type:Number})],i.prototype,"compressionTolerance",void 0),n([P("compressionTolerance")],i.prototype,"writeCompressionTolerance",null),n([l({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),n([l({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],i.prototype,"defaultMosaicRule",void 0),n([E("defaultMosaicRule",["defaultMosaicMethod"])],i.prototype,"readDefaultMosaicRule",null),n([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),n([l({readOnly:!0,constructOnly:!0})],i.prototype,"exportImageServiceParameters",void 0),n([l()],i.prototype,"rasterInfo",void 0),n([l({readOnly:!0,type:[ce]})],i.prototype,"fields",void 0),n([l({readOnly:!0})],i.prototype,"fieldsIndex",null),n([l({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],i.prototype,"format",null),n([E("service","format",["serviceDataType"])],i.prototype,"readFormat",null),n([l({type:_e})],i.prototype,"fullExtent",void 0),n([l({readOnly:!0})],i.prototype,"hasMultidimensions",void 0),n([l({json:{read:{source:"maxImageHeight"}}})],i.prototype,"imageMaxHeight",void 0),n([l({json:{read:{source:"maxImageWidth"}}})],i.prototype,"imageMaxWidth",void 0),n([l({type:String,json:{type:oe.jsonValues,read:oe.read,write:oe.write}})],i.prototype,"interpolation",void 0),n([l()],i.prototype,"minScale",void 0),n([E("service","minScale")],i.prototype,"readMinScale",null),n([l()],i.prototype,"maxScale",void 0),n([E("service","maxScale")],i.prototype,"readMaxScale",null),n([l({type:H})],i.prototype,"mosaicRule",null),n([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],i.prototype,"readMosaicRule",null),n([P("mosaicRule")],i.prototype,"writeMosaicRule",null),n([l()],i.prototype,"multidimensionalInfo",void 0),n([l({type:ti,json:{write:!0}})],i.prototype,"multidimensionalSubset",void 0),n([l({json:{type:Ee}})],i.prototype,"noData",void 0),n([P("noData")],i.prototype,"writeNoData",null),n([l({type:String,json:{type:Ie.jsonValues,read:Ie.read,write:Ie.write}})],i.prototype,"noDataInterpretation",void 0),n([l({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],i.prototype,"objectIdField",void 0),n([E("objectIdField")],i.prototype,"readObjectIdField",null),n([l({readOnly:!0})],i.prototype,"geometryType",void 0),n([l({})],i.prototype,"typeIdField",void 0),n([l({})],i.prototype,"types",void 0),n([l({readOnly:!0})],i.prototype,"parsedUrl",null),n([l({type:Function})],i.prototype,"pixelFilter",void 0),n([l()],i.prototype,"raster",void 0),n([l({readOnly:!0})],i.prototype,"sourceType",void 0),n([E("sourceType",["serviceSourceType","fields"])],i.prototype,"readSourceType",null),n([l()],i.prototype,"viewId",void 0),n([l({types:ii,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:ri,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],i.prototype,"renderer",null),n([E("renderer")],i.prototype,"readRenderer",null),n([P("renderer")],i.prototype,"writeRenderer",null),n([l({clonable:!1})],i.prototype,"symbolizer",void 0),n([l(_t)],i.prototype,"opacity",void 0),n([l({readOnly:!0})],i.prototype,"rasterFields",null),n([l({constructOnly:!0})],i.prototype,"rasterFunctionInfos",void 0),n([l({type:b})],i.prototype,"renderingRule",null),n([l({type:b,json:{name:"renderingRule"}})],i.prototype,"rasterFunction",null),n([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],i.prototype,"readRasterFunction",null),n([l({readOnly:!0})],i.prototype,"serviceDataType",void 0),n([l({readOnly:!0,type:he})],i.prototype,"spatialReference",void 0),n([E("spatialReference",["spatialReference","extent"])],i.prototype,"readSpatialReference",null),n([l({json:{type:Ue.jsonValues}})],i.prototype,"pixelType",void 0),n([E("pixelType")],i.prototype,"readPixelType",null),n([P("pixelType")],i.prototype,"writePixelType",null),n([l({constructOnly:!0,type:ft})],i.prototype,"serviceRasterInfo",void 0),n([l()],i.prototype,"sourceJSON",void 0),n([l(Ot)],i.prototype,"url",void 0),n([l({readOnly:!0})],i.prototype,"version",void 0),n([E("version",["currentVersion","fields","timeInfo"])],i.prototype,"readVersion",null),i=n([F("esri.layers.mixins.ArcGISImageService")],i),i};let L=class extends Et(Jt(Lt(qt(zt(fr(Gt(Ti(Ht(Ut(Qt(Yt))))))))))){constructor(...r){super(...r),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Bt(async(i,o,e)=>{const{save:t,saveAs:s}=await ei(()=>import("./imageryUtils-djrWgZtb.js"),__vite__mapDeps([0,1,2,3,4]));switch(i){case Ne.SAVE:return t(this,o);case Ne.SAVE_AS:return s(this,e,o)}})}normalizeCtorArgs(r,i){return typeof r=="string"?{url:r,...i}:r}load(r){const i=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},r).catch(kt).then(()=>this._fetchService(i))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(r){this._set("legendEnabled",r)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(r){this._set("listMode",r)}writeOperationalLayerType(r,i,o){var t;const e=((t=this.renderer)==null?void 0:t.type)==="vector-field";i[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){var r;return!(!this.raster||!((r=this.url)!=null&&r.toLowerCase().includes("/rasterrendering/imageserver")))}createPopupTemplate(r){var p;const i=this.rasterFields,o=this.title,e=new Set;let t=!1,s=!1;this.capabilities&&(t=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,s=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const a=new Set;t&&a.add("raster.itempixelvalue");for(const m of i){const c=m.name.toLowerCase();a.has(c)||c.includes("raster.servicepixelvalue.")||e.add(m.name)}s&&e.add("raster.magnitude").add("raster.direction");const u=Wt({fields:i,title:o},{...r,visibleFieldNames:e});return u!=null&&u.fieldInfos&&((p=this.rasterInfo)!=null&&p.pixelType.startsWith("f"))&&u.fieldInfos.forEach(({format:m,fieldName:c})=>{m&&/^raster\.(item|service)pixelvalue/i.test(c)&&(m.places=2)}),u}queryFeatures(r,i){return this.queryRasters(r,i).then(o=>{if(o!=null&&o.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(r,i){return this.queryRasterCount(r,i)}redraw(){this.emit("redraw")}async save(r){return this._debouncedSaveOperations(Ne.SAVE,r)}async saveAs(r,i){return this._debouncedSaveOperations(Ne.SAVE_AS,i,r)}serviceSupportsSpatialReference(r){return Pi(this,r)}write(r,i){if(!this._isPreviewLayer)return super.write(r,i);if(i!=null&&i.messages){const o=`${i.origin}/${i.layerContainerType||"operational-layers"}`;i.messages.push(new C("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};n([l(Zt)],L.prototype,"legendEnabled",null),n([l({type:["show","hide"]})],L.prototype,"listMode",null),n([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],L.prototype,"isReference",void 0),n([l({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],L.prototype,"operationalLayerType",void 0),n([P("web-map","operationalLayerType")],L.prototype,"writeOperationalLayerType",null),n([l(Kt)],L.prototype,"popupEnabled",void 0),n([l({type:Xt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],L.prototype,"popupTemplate",void 0),n([l({readOnly:!0})],L.prototype,"defaultPopupTemplate",null),n([l({readOnly:!0,json:{read:!1}})],L.prototype,"type",void 0),n([l({readOnly:!0})],L.prototype,"_isPreviewLayer",null),L=n([F("esri.layers.ImageryLayer")],L);const Qr=L;export{Qr as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/imageryUtils-djrWgZtb.js","assets/utils-rBsg-VY8.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/jsonContext-cWV_-jAj.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/ImageryLayerView3D-Ajt9-b41.js b/dist/assets/ImageryLayerView3D-Ajt9-b41.js new file mode 100644 index 0000000..3b6dafa --- /dev/null +++ b/dist/assets/ImageryLayerView3D-Ajt9-b41.js @@ -0,0 +1 @@ +import{e as o,y as d,jW as D,c as w,E as m,fG as E,ca as _,T as c,ah as b,F as H}from"./index-J0iiHjMT.js";import{N as I}from"./DynamicLayerView3D-4lztpXo0.js";import"./LayerView3D-iOx2MD1g.js";import"./projectExtentUtils-TwA6ooHn.js";import"./ImageMaterial.glsl-TdPtjVc_.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";const F=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(a,r){const{layer:n}=this;if(!a)throw new m("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:n});const{popupEnabled:i}=n,s=E(n,r);if(!i||s==null)throw new m("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:i,popupTemplate:s});const y=await s.getRequiredFields(),l=new _;l.timeExtent=this.timeExtent,l.geometry=a,l.outFields=y,l.outSpatialReference=a.spatialReference;const{resolution:p,spatialReference:h}=this.view,g=this.view.type==="2d"?new c(p,p,h):new c(.5*p,.5*p,h),{returnTopmostRaster:x,showNoDataRecords:f}=s.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},v={returnDomainValues:!0,returnTopmostRaster:x,pixelSize:g,showNoDataRecords:f,signal:r!=null?r.signal:null};return n.queryVisibleRasters(l,v).then(R=>R)}canResume(){var a;return!!super.canResume()&&!((a=this.timeExtent)!=null&&a.isEmpty)}};return o([d()],t.prototype,"layer",void 0),o([d()],t.prototype,"suspended",void 0),o([d(D)],t.prototype,"timeExtent",void 0),o([d()],t.prototype,"view",void 0),t=o([w("esri.views.layers.ImageryLayerView")],t),t};let u=class extends F(I){constructor(){super(...arguments),this.type="imagery-3d",this.redrawDebounced=b(async e=>{this.redraw((t,a)=>this._redrawImage(t,a),e)},2e3)}initialize(){this.addHandles([H(()=>this.view.basemapTerrain.ready,()=>this._initializeMaximumDataResolution(),{once:!0,initial:!0}),this.layer.on("redraw",()=>this._updatingHandles.addPromise(this.redrawDebounced()))]),this._updatingHandles.add(()=>{var e,t;return(t=(e=this.layer)==null?void 0:e.exportImageServiceParameters)==null?void 0:t.version},()=>{this._updatingHandles.addPromise(this.refreshDebounced())}),this._updatingHandles.add(()=>{var e;return(e=this.layer)==null?void 0:e.renderer},()=>{this._updatingHandles.addPromise(this.refreshDebounced())}),this._updatingHandles.add(()=>this.timeExtent,()=>this._updatingHandles.addPromise(this.refreshDebounced()))}_initializeMaximumDataResolution(){this.maximumDataResolution=this.layer.loaded?this.layer.serviceRasterInfo.pixelSize:null}getFetchOptions(){return{timeExtent:this.timeExtent}}async processResult(e,t,a){t.imageOrCanvasElement?e.image=t.imageOrCanvasElement:(e.image=document.createElement("canvas"),e.pixelData=t.pixelData,await this._redrawImage(e,a))}async _redrawImage(e,t){if(!(e.image instanceof HTMLCanvasElement)||e.pixelData==null)throw new Error;const a=e.image,r=a.getContext("2d"),n=await this.layer.applyRenderer(e.pixelData,{signal:t}),i=this.layer.applyFilter(n).pixelBlock;if(i==null)throw new Error;a.width=i.width,a.height=i.height;const s=r.createImageData(i.width,i.height);s.data.set(i.getAsRGBA()),r.putImageData(s,0,0)}};u=o([w("esri.views.3d.layers.ImageryLayerView3D")],u);const O=u;export{O as default}; diff --git a/dist/assets/ImageryTileLayer-ce5u7kmi.js b/dist/assets/ImageryTileLayer-ce5u7kmi.js new file mode 100644 index 0000000..bc2270c --- /dev/null +++ b/dist/assets/ImageryTileLayer-ce5u7kmi.js @@ -0,0 +1,8 @@ +import{cZ as xt,e$ as te,u7 as ot,Z as _e,E as P,g0 as Ne,T as H,dT as W,bW as lt,f0 as ct,fZ as wt,u8 as It,e as b,y as R,dW as ut,c as Q,dr as bt,de as ht,e2 as qe,ar as j,dt as St,e4 as Rt,jG as ft,u9 as vt,e3 as De,dJ as Tt,jP as _t,iZ as kt,bV as Ft,pb as Mt,dK as Ct,dO as Pt,dM as Ot,dN as $t,el as Dt,em as Bt,dL as Jt,dP as zt,dq as Et,ah as Nt,dQ as At,dw as he,il as Ht,jc as we,d as Lt,ey as Wt,iw as jt,dV as qt,iv as Gt,c7 as Vt}from"./index-J0iiHjMT.js";import{o as Ut}from"./CustomParametersMixin-Y1bOcayO.js";import{h as dt,D as Xt,i as Yt,a as Kt,p as mt,c as Zt,N as Be,l as Qt,d as ei,b as ti,e as ii,f as Ge,o as si,g as Ve,K as Ue,B as Xe,j as ri,S as ni,E as ai,V as Ye,t as oi,k as li,m as ci,n as ui}from"./ImageHistogramParameters-sFtZwJ9j.js";import{U as Me,j as hi,n as ge,R as pt,I as fi,a as di,l as mi,u as ie,f as pi,m as yi,s as gi,L as xi,r as Ke,b as xe,W as wi,h as Ii,g as Ae,P as bi,T as Si,c as Ri,F as vi,d as Ti,N as _i,e as ki,i as Ie,B as Fi,k as Mi,D as Ci}from"./dataUtils-s_UKlouc.js";import{T as Je,D as be,j as Ze,r as Qe,o as Pi,V as Ce,J as ve,e as Oi,Z as $i,C as Di,U as Bi}from"./rasterProjectionHelper-KvYWHIT_.js";import{d as He}from"./FeatureSet-d4S1oKME.js";import{R as ze,f as Ji,i as zi,y as Le,n as Ei,C as Ni}from"./utils-4xKNo3Tf.js";import"./generateRendererUtils-_1jVE02H.js";let Ai=class{constructor(e=15e3,s=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=e,this._interval=Math.min(e,s)}decreaseRefCount(e,s){const t=e+"/"+s,i=this._cachedBlocks;if(i.has(t)){const r=i.get(t);return r.refCount--,r.refCount<=0&&(i.delete(t),r.controller&&r.controller.abort()),r.refCount}return 0}getBlock(e,s){const t=e+"/"+s,i=this._cachedBlocks;if(i.has(t)){const r=i.get(t);return r.ts=Date.now(),r.refCount++,i.delete(t),i.set(t,r),r.block}return null}putBlock(e,s,t,i){const r=this._cachedBlocks,n=e+"/"+s;if(r.has(n)){const l=r.get(n);l.ts=Date.now(),l.refCount++}else r.set(n,{block:t,ts:Date.now(),refCount:1,controller:i});this._trim(),this._updateTimer()}deleteBlock(e,s){const t=this._cachedBlocks,i=e+"/"+s;t.has(i)&&t.delete(i)}updateMaxSize(e){this._size=e,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const e=this._cachedBlocks;this._timer=setInterval(()=>{const s=Array.from(e),t=Date.now();for(let i=0;i=e.size)return;const s=Array.from(e);for(let t=0;tn.isResolved=!0).catch(()=>n.isRejected=!0),(l=r[e])==null||l.cache.set(s,n)}function Li(a,e,s){var i;const t=ke.get(a);t?e!=null&&t[e]!=null?(i=t[e])==null||i.cache.delete(s):re.deleteBlock(a,s):e==null&&re.deleteBlock(a,s)}const st=8,Wi=256;let q=class extends xt(bt){constructor(){super(...arguments),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=Je();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e!=null&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:te.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,s=be(e.spatialReference);return s!=null&&e.extent.width>=s/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return e==null||e.type==="gcs-shift"}set rasterJobHandler(e){var s,t;this._set("rasterJobHandler",e),this.datasetFormat==="Function"&&((t=(s=this.primaryRasters)==null?void 0:s.rasters)==null||t.forEach(i=>i.rasterJobHandler=e))}set url(e){this._set("url",ot(e,_e.getLogger(this)))}async open(e){throw new P("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,s,t,i={}){const r=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,s,t,r);return this.fetchPixels(n,r.size[0],r.size[1],i)}async identify(e,s={}){var O;e=Ne(H,e).clone().normalize();const{multidimensionalDefinition:t,timeExtent:i}=s,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:l}=r;let{transposedVariableName:o}=s;const c=l!=null&&n&&(i!=null||dt(t));c&&!o&&(o=t!=null&&t.length>0?t[0].variableName??void 0:l.variables[0].name,s={...s,transposedVariableName:o}),s=this._getRequestOptionsWithSliceId(s);const{spatialReference:u,extent:f}=r,{datumTransformation:p}=s;let h=Ze(e,u,p);if(!f.intersects(h))return{location:h,value:null};if(r.transform!=null){const D=r.transform.inverseTransform(h);if(!r.nativeExtent.intersects(D))return{location:D,value:null};h=D}let m=0;const y=o!=null&&l!=null&&r.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const D=this.primaryRasters.rasters[0];if(y)return D.identify(h,s);const{pixelSize:E}=r,C=3,$=E.x*C/2,B=E.y*C/2,V=new W({xmin:h.x-$,xmax:h.x+$,ymin:h.y-B,ymax:h.y+B,spatialReference:u}),Y={interpolation:"nearest"},{pixelBlock:N}=await D.fetchPixels(V,C,C,Y),{pixelBlock:A}=await this.fetchPixels(V,C,C,Y);if(N==null)return{location:h,value:null};const L=Math.floor(C*C*.5),ee=!N.mask||N.mask[L]?N.pixels.map(U=>U[L]):null;let J;return A!=null&&(J=!A.mask||A.mask[L]?A.pixels.map(U=>U[L]):void 0),{location:h,value:ee,processedValue:J,pyramidLevel:0}}if(!y){if(s.srcResolution)m=Qe(s.srcResolution,r,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(e,s),m==null)return{location:h,value:null}}const d=this.identifyPixelLocation(h,m,null,y);if(d===null)return{location:h,value:null};const{row:x,col:g,rowOffset:w,colOffset:I,blockWidth:S}=d,v=o??s.sliceId,F=et(this.url,v),T=`${m}/${x}/${g}`;let k=tt(F,null,T);k==null&&(k=this.fetchRawTile(m,x,g,s),it(F,null,T,k));const _=await k;if(!((O=_==null?void 0:_.pixels)!=null&&O.length))return{location:h,value:null};const M=w*S+I;return this._processIdentifyResult(_,{srcLocation:h,position:M,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:c,identifyOptions:s})}async fetchPixels(e,s,t,i={}){e=Pi(e),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:r}=this;if(i.requestRawData&&r)return this._fetchPixels(e,s,t,i);const n=be(e.spatialReference),l=Ce(e);if(n==null||l===0||l===1&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,s,t,i);if(l>=3)return{extent:e,pixelBlock:null};const o=[],{xmin:c,xmax:u}=e,f=Math.round(n/(u-c)*s),p=f-Math.round((n/2-c)/(u-c)*s);let h=0;const m=[];for(let g=0;g<=l;g++){const w=new W({xmin:g===0?c:-n/2,xmax:g===l?u-n*g:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),I=g===0?f-p:g===l?s-h:f;h+=I,m.push(I);const S=i.disableWrapAround&&g>0?null:this._fetchPixels(w,I,t,i);o.push(S)}const y=(await Promise.all(o)).map(g=>g==null?void 0:g.pixelBlock);let d=null;const x={width:s,height:t};return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:x,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:d=Me(y,x,{blockWidths:m}),{extent:e,srcExtent:ve(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:d}}async fetchRawPixels(e,s,t,i={}){s={x:Math.floor(s.x),y:Math.floor(s.y)};const r=await this._fetchRawTiles(e,s,t,i),{nativeExtent:n,nativePixelSize:l,storageInfo:o}=this.rasterInfo,c=2**e,u=l.x*c,f=l.y*c,p=new W({xmin:n.xmin+u*s.x,xmax:n.xmin+u*(s.x+t.width-1),ymin:n.ymax-f*(s.y+t.height-1),ymax:n.ymax-f*s.y,spatialReference:n.spatialReference});if(!r)return{extent:p,srcExtent:p,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=r;if(h.length===1&&h[0]!=null&&h[0].width===t.width&&h[0].height===t.height)return{extent:p,srcExtent:p,pixelBlock:r.pixelBlocks[0]};const y=e>0?o.pyramidBlockWidth:o.blockWidth,d=e>0?o.pyramidBlockHeight:o.blockHeight,x={x:s.x%y,y:s.y%d};let g;return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:t,clipOffset:x,clipSize:t,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:g=Me(h,m,{clipOffset:x,clipSize:t}),{extent:p,srcExtent:p,pixelBlock:g}}fetchRawTile(e,s,t,i){throw new P("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return ve(this.rasterInfo.extent,e)}decodePixelBlock(e,s){return!this.rasterJobHandler||s.useCanvas?hi(e,s):this.rasterJobHandler.decode({data:e,options:s})}async request(e,s,t=0){const{customFetchParameters:i}=this.ioConfig,{range:r,query:n,headers:l}=s;t=t??s.retryCount??this.ioConfig.retryCount;const o=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await lt(e,{...s,query:{...n,...i},headers:{...l,...o}})}catch(c){if(t>0)return t--,this.request(e,s,t);throw c}}getSliceIndex(e){const{multidimensionalInfo:s}=this.rasterInfo;return s==null||e==null||e.length===0?null:Xt(e,s)}getTileExtentFromTileInfo(e,s,t,i){const r=i.lodAt(e);return this.getTileExtent({x:r.resolution,y:r.resolution},s,t,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:s,extent:t,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const r=[],n=e.maximumPyramidLevel||0;let l=Math.max(i.x,i.y),o=1/.0254*96*l;for(let u=0;u<=n;u++)r.unshift(new ct({level:n-u,resolution:l,scale:o})),l*=2,o*=2;const c=new H({x:t.xmin,y:t.ymax,spatialReference:s});e.tileInfo=new te({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:s,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,s=512,t=512,i){const{width:r,height:n,nativeExtent:l,pixelSize:o,spatialReference:c}=e,u=new H({x:l.xmin,y:l.ymax,spatialReference:c});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const f=this.computeBlockBoundary(l,512,512,{x:l.xmin,y:l.ymax},[o],i);e.storageInfo=new ge({blockWidth:s,blockHeight:t,pyramidBlockWidth:s,pyramidBlockHeight:t,origin:u,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:f})}async computeBestPyramidLevelForLocation(e,s={}){return 0}computeBlockBoundary(e,s,t,i,r,n=0,l=2){if(r.length===1&&n>0){r=[...r];let{x:f,y:p}=r[0];for(let h=0;ho)return null;const m=this.getPyramidPixelSize(s),{x:y,y:d}=m,x=(c.y-h.y)/d/p,g=(h.x-c.x)/y/f,w=Math.min(p-1,Math.floor((x-Math.floor(x))*p)),I=Math.min(f-1,Math.floor((g-Math.floor(g))*f));return{pyramidLevel:s,row:Math.floor(x),col:Math.floor(g),rowOffset:w,colOffset:I,blockWidth:f,srcLocation:h}}getTileExtent(e,s,t,i,r,n){const[l,o]=n,c=i.x+t*l*e.x,u=c+l*e.x,f=i.y-s*o*e.y,p=f-o*e.y;return new W({xmin:c,xmax:u,ymin:p,ymax:f,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,s,t){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRows||i.minCol>t}async _fetchPixels(e,s,t,i={}){let r=Ce(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,s,t,i),{pyramidLevel:l,srcResolution:o,srcExtent:c,srcWidth:u,srcHeight:f,ul:p}=n;if(u===0||f===0)return{extent:e,srcExtent:c,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=(m==null?void 0:m.type)==="gcs-shift",d=be(e.spatialReference)!=null;!y&&d||(r=Ce(n.srcExtent,y));const x=await this._fetchRawTiles(l,p,{width:u,height:f,wrapCount:r},i);if(!x)return{extent:e,srcExtent:c,pixelBlock:null};const g=h.storageInfo,w=l>0?g.pyramidBlockWidth:g.blockWidth,I=l>0?g.pyramidBlockHeight:g.blockHeight;let{x:S,y:v}=h.pixelSize;if(l>0){const{pyramidResolutions:U,pyramidScalingFactor:gt}=g;if(U!=null&&U[l-1])({x:S,y:v}=U[l-1]);else{const je=gt**l;S*=je,v*=je}}const F=h.spatialReference,T=new H({x:S,y:v,spatialReference:F}),k=w===u&&I===f&&p.x%w==0&&p.y%I==0,_=new H({x:(e.xmax-e.xmin)/s,y:(e.ymax-e.ymin)/t,spatialReference:e.spatialReference}),M=!e.spatialReference.equals(F),O=F.isGeographic?1e-9:1e-4,{datumTransformation:D}=i;if(!M&&k&&x.pixelBlocks.length===1&&w===s&&I===t&&this._isSameResolution(o,_,O))return{extent:e,srcExtent:c,srcTilePixelSize:T,pixelBlock:x.pixelBlocks[0]};const E=d&&be(c.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,C=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");C&&!this.rasterJobHandler&&await Je();const $=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:_.toJSON(),datumTransformation:D,rasterTransform:m,hasWrapAround:r>0||E,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:C},i):Oi({projectedExtent:e,srcBufferExtent:x.extent,pixelSize:_,datumTransformation:D,rasterTransform:m,hasWrapAround:r>0||E,isAdaptive:!1,includeGCSGrid:C});let B;const V=!i.requestRawData,Y={rows:$.spacing[0],cols:$.spacing[1]},N=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(l,x.extent.xmin):void 0,{pixelBlocks:A,mosaicSize:L,isPartiallyFilled:ee}=x;let J=null;if(this.rasterJobHandler)({pixelBlock:B,localNorthDirections:J}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:A,srcMosaicSize:L,destDimension:V?{width:s,height:t}:null,coefs:V?$.coefficients:null,sampleSpacing:V?Y:null,projectDirections:C,gcsGrid:C?$.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:N,blockWidths:null},i));else{const U=Me(A,L,{alignmentInfo:N});B=V?pt(U,{width:s,height:t},$.coefficients,Y,i.interpolation):U,C&&$.gcsGrid&&(J=fi({width:s,height:t},$.gcsGrid),B=di(B,this.rasterInfo.dataType,J))}return i.requestRawData||C?{extent:e,srcExtent:c,srcTilePixelSize:T,pixelBlock:B,transformGrid:$,localNorthDirections:J,isPartiallyFilled:ee}:{extent:e,srcExtent:c,srcTilePixelSize:T,pixelBlock:B}}async _fetchRawTiles(e,s,t,i){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:l,blockHeight:o}=this.getBlockWidthHeight(e);let{x:c,y:u}=s,{width:f,height:p,wrapCount:h}=t;const m=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(c-=i.buffer.cols,u-=i.buffer.rows,f+=2*i.buffer.cols,p+=2*i.buffer.rows);let y=0,d=0,x=0;h&&m!=null&&({worldColumnCountFromOrigin:d,originColumnOffset:x,rightPadding:y}=m,d*m.blockWidth-y>=c+f&&(y=0));const g=Math.floor(c/l),w=Math.floor(u/o),I=Math.floor((c+f+y-1)/l),S=Math.floor((u+p+y-1)/o),v=n[e];if(!v)return null;const{minRow:F,minCol:T,maxCol:k,maxRow:_}=v;if(h===0&&(S_||g>k))return null;const M=new Array;let O=!1;const D=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let N=w;N<=S;N++)for(let A=g;A<=I;A++){let L=A;if(!i.disableWrapAround&&h&&m!=null&&d<=A&&(L=A-d-x),N>=F&&L>=T&&_>=N&&k>=L){const ee=this._fetchRawTile(e,N,L,i);D?M.push(new Promise(J=>{ee.then(U=>J(U)).catch(()=>{O=!0,J(null)})})):M.push(ee)}else M.push(Promise.resolve(null))}if(M.length===0)return null;const E=await Promise.all(M),C={height:(S-w+1)*o,width:(I-g+1)*l},{spatialReference:$}=this.rasterInfo,B=this.getPyramidPixelSize(e),{x:V,y:Y}=B;return{extent:new W({xmin:r.x+g*l*V,xmax:r.x+(I+1)*l*V,ymin:r.y-(S+1)*o*Y,ymax:r.y-w*o*Y,spatialReference:$}),pixelBlocks:E,mosaicSize:C,isPartiallyFilled:O}}_isSameResolution(e,s,t){return Math.abs(e.x-s.x)c||t>o)return Promise.resolve(null);const u=et(this.url,i.sliceId),f=`${e}/${s}/${t}`;let p=tt(u,i.registryId,f);if(p==null){const h=new AbortController;p=this.fetchRawTile(e,s,t,{...i,signal:h.signal}),it(u,i.registryId,f,p,h),p.catch(()=>Li(u,i.registryId,f))}return i.signal&&wt(i,()=>{Hi(u,i.registryId,f)}),p}_computeMagDirValues(e){var c;const{bandCount:s,dataType:t}=this.rasterInfo;if(!(s===2&&t==="vector-magdir"||t==="vector-uv")||(e==null?void 0:e.length)!==2||!((c=e[0])!=null&&c.length))return null;const i=e[0].length;if(t==="vector-magdir"){const u=e[1].map(f=>(f+360)%360);return[e[0],u]}const[r,n]=e,l=[],o=[];for(let u=0;u=16,h=c===n&&this._requireTooManySrcTiles(l,o,s,t);if(p||h||l===0||o===0){const m=new H({x:(e.xmax-e.xmin)/s,y:(e.ymax-e.ymin)/t,spatialReference:e.spatialReference});let y=Di(m,this.rasterInfo.spatialReference,e,r.datumTransformation);const d=!y||i.srcResolution&&y.x+y.y=x){const g=2**x;y={x:i.srcResolution.x*g,y:i.srcResolution.y*g}}}y&&(r.srcResolution=y,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,s,t)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,s,t,i){const{tileInfo:r}=this.rasterInfo.storageInfo;return Math.ceil(e/r.size[0])*Math.ceil(s/r.size[1])>=Wi||e/t>st||s/i>st}_updateSourceDataInfo(e,s){s.srcWidth=0,s.srcHeight=0;const{rasterInfo:t}=this,i=t.spatialReference,{srcResolution:r,datumTransformation:n}=s,{pyramidLevel:l,pyramidResolution:o,excessiveReading:c}=Qe(r,t,this.ioConfig.sampling);if(c)return;let u=s.srcExtent||ve(e,i,n);if(u==null)return;const f=t.transform;f&&(u=f.inverseTransform(u)),s.srcExtent=u;const{x:p,y:h}=t.storageInfo.origin,m=Math.floor((u.xmin-p)/o.x+.1),y=Math.floor((h-u.ymax)/o.y+.1),d=Math.floor((u.xmax-p)/o.x-.1),x=Math.floor((h-u.ymin)/o.y-.1),g=u.width<.1*o.x?0:d-m+1,w=u.height<.1*o.y?0:x-y+1;s.pyramidLevel=l,s.pyramidResolution=o,s.srcWidth=g,s.srcHeight=w,s.ul={x:m,y}}_getRequestOptionsWithSliceId(e){return this.rasterInfo.multidimensionalInfo!=null&&e.sliceId==null&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,s){const{srcLocation:t,position:i,pyramidLevel:r,useTransposedTile:n}=s,l=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[i]))return{location:t,value:null};const{multidimensionalInfo:o}=this.rasterInfo;if(o==null||!n){const x=e.pixels.map(I=>I[i]),g={location:t,value:x,pyramidLevel:r},w=this._computeMagDirValues(x.map(I=>[I]));return w!=null&&w.length&&(g.magdirValue=w.map(I=>I[0])),g}let c=e.pixels.map(x=>x.slice(i*l,i*l+l)),u=this._computeMagDirValues(c);const{requestSomeSlices:f,identifyOptions:p}=s;let h=Yt(o,p.transposedVariableName);if(f){const x=Kt(h,p.multidimensionalDefinition,p.timeExtent);c=c.map(g=>x.map(w=>g[w])),u=u==null?void 0:u.map(g=>x.map(w=>g[w])),h=x.map(g=>h[g])}const m=e.noDataValues||this.rasterInfo.noDataValue,y={pixels:c,pixelType:e.pixelType};let d;return m!=null&&(It(y,m),d=y.mask),{location:t,value:null,dataSeries:h.map((x,g)=>{const w={value:(d==null?void 0:d[g])===0?null:c.map(I=>I[g]),multidimensionalDefinition:x.multidimensionalDefinition.map(I=>new mt({...I,isSlice:!0}))};return u!=null&&u.length&&(w.magdirValue=[u[0][g],u[1][g]]),w}),pyramidLevel:r}}};b([R()],q.prototype,"_rasterTileAlighmentInfo",void 0),b([R({readOnly:!0})],q.prototype,"_isGlobalWrappableSource",null),b([R({readOnly:!0})],q.prototype,"_hasNoneOrGCSShiftTransform",null),b([R()],q.prototype,"rasterJobHandler",null),b([R(ut)],q.prototype,"url",null),b([R({type:String,json:{write:!0}})],q.prototype,"datasetName",void 0),b([R({type:String,json:{write:!0}})],q.prototype,"datasetFormat",void 0),b([R()],q.prototype,"hasUniqueSourceStorageInfo",void 0),b([R()],q.prototype,"rasterInfo",void 0),b([R()],q.prototype,"ioConfig",void 0),b([R()],q.prototype,"sourceJSON",void 0),q=b([Q("esri.layers.support.rasterDatasets.BaseRaster")],q);const ce=q;let ne=class extends ce{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null}async open(e){var u,f,p,h;await this.init();const{rasterFunction:s}=this;(f=(u=this.primaryRasters)==null?void 0:u.rasters)!=null&&f.length?s.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=s.getPrimaryRasters(),this.rasterJobHandler&&((p=this.primaryRasters.rasters)==null||p.forEach(m=>m.rasterJobHandler=this.rasterJobHandler)));const{rasters:t,rasterIds:i}=this.primaryRasters,r=t.map(m=>m.rasterInfo?void 0:m.open(e));await Promise.all(r);const n=t.map(({rasterInfo:m})=>m),l=s.bind({rasterInfos:n,rasterIds:i});if(!l.success||n.length===0)throw new P("raster-function:open",`cannot bind the function: ${l.error??""}`);const o=s.functionName==="Table"?s:(h=s.functionArguments)==null?void 0:h.raster;(o==null?void 0:o.functionName)==="Table"&&(s.rasterInfo.attributeTable=He.fromJSON(o.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const c=n[0];this.hasUniqueSourceStorageInfo=n.length===1||n.slice(1).every(m=>this._hasSameStorageInfo(m,c)),this.set("sourceJSON",t[0].sourceJSON),this.set("rasterInfo",s.rasterInfo)}async syncJobHandler(){var e;return(e=this.rasterJobHandler)==null?void 0:e.updateRasterFunction(this.rasterFunction)}async fetchPixels(e,s,t,i={}){var w,I;const{rasters:r,rasterIds:n}=this.primaryRasters;let l=!1;const{interpolation:o}=i,c=(w=this.rasterFunction.flatWebGLFunctionChain)==null?void 0:w.hasFocalFunction;!i.requestRawData&&o!=="bilinear"&&c&&(l=r.length===1&&!i.skipRasterFunction,i={...i,interpolation:"bilinear",requestRawData:l});const u=r.map(S=>S.fetchPixels(e,s,t,i)),f=await Promise.all(u),p=f.map(S=>S.pixelBlock),h=l||i.requestRawData?f.map(S=>S.srcTilePixelSize):null;if(i.skipRasterFunction||p.every(S=>S==null))return f[0];const m=((I=f.find(S=>S.pixelBlock!=null))==null?void 0:I.extent)??e,y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:h,primaryRasterIds:n}):this.rasterFunction.process({extent:m,primaryPixelBlocks:p,primaryPixelSizes:h,primaryRasterIds:n}),{transformGrid:d}=f[0];if(!l||y==null||d==null)return{...f[0],pixelBlock:y};const x={rows:d.spacing[0],cols:d.spacing[1]};let g;return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:s,height:t},coefs:d.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:o,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:g=pt(y,{width:s,height:t},d.coefficients,x,o),{extent:e,srcExtent:f[0].srcExtent,pixelBlock:g}}_hasSameStorageInfo(e,s){const{storageInfo:t,pixelSize:i,spatialReference:r,extent:n}=e,{storageInfo:l,pixelSize:o,spatialReference:c,extent:u}=s;return i.x===o.x&&i.y===o.y&&r.equals(c)&&n.equals(u)&&t.blockHeight===l.blockHeight&&t.blockWidth===l.blockWidth&&t.maximumPyramidLevel===l.maximumPyramidLevel}};b([R({type:String,json:{write:!0}})],ne.prototype,"datasetFormat",void 0),b([R()],ne.prototype,"tileType",void 0),b([R()],ne.prototype,"rasterFunction",void 0),b([R()],ne.prototype,"primaryRasters",void 0),ne=b([Q("esri.layers.support.rasterDatasets.FunctionRaster")],ne);const Ee=ne;function ji(a,e){if(a.spatialReference.equals(e))return a;const s=qe(a.spatialReference),t=qe(e);if(s===t)return a;const i=s/t;return{x:a.x*i,y:a.y*i}}async function qi(a,e,s){if(s.type==="extent")return Vi(a,e,s);const{width:t,height:i}=a,r=new Uint8Array(t*i),{contains:n,intersects:l}=await ht(()=>import("./index-J0iiHjMT.js").then(o=>o.zJ),__vite__mapDeps([0,1]));return l(e,s)?s.type==="polyline"?Ui(a,e,s):n(s,e)?a:Gi(a,e,s):new ie({pixelType:a.pixelType,width:t,height:i,mask:r,maskIsAlpha:!1,pixels:[...a.pixels]})}function Gi(a,e,s){if(!a)return a;const{width:t,height:i}=a,r=e.width/t,n=e.height/i,{xmin:l,ymax:o}=e;let c;if(s.type==="extent"){const d=(s.xmin-l)/r,x=(s.xmax-l)/r,g=(o-s.ymax)/n,w=(o-s.ymin)/n;c=[[[d,g],[d,w],[x,w],[x,g],[d,g]]]}else c=s.rings.map(d=>d.map(([x,g])=>[(x-l)/r,(o-g)/n]));const u=document.createElement("canvas");u.width=t,u.height=i;const f=u.getContext("2d");f.fillStyle="#f00",c.forEach(d=>{f.beginPath(),f.moveTo(d[0][0],d[0][1]);for(let x=0;x127?255:0);return new ie({pixelType:a.pixelType,width:t,height:i,mask:y,maskIsAlpha:!1,pixels:[...a.pixels]})}function Vi(a,e,s){const{width:t,height:i}=a,r=new Uint8Array(t*i),n=e.width/t,l=e.height/i;if(s.width/n<.5||s.height/l<.5)return new ie({pixelType:a.pixelType,width:t,height:i,mask:r,pixels:[...a.pixels]});const{xmin:o,xmax:c,ymin:u,ymax:f}=e,{xmin:p,xmax:h,ymin:m,ymax:y}=s,d=Math.max(o,p),x=Math.min(c,h),g=Math.max(u,m),w=Math.min(f,y),I=.5*n,S=.5*l;if(x-dc-I||g>f-S||w.5&&F%1<.5||O===D&&T%1>.5&&k%1<.5)return new ie({pixelType:a.pixelType,width:t,height:i,mask:r,pixels:[...a.pixels]});if(_===0&&O===0&&M===t&&D===i)return a;const E=a.mask;for(let C=O;C<=D;C++)for(let $=_;$<=M;$++){const B=C*t+$;r[B]=E?E[B]:255}return new ie({pixelType:a.pixelType,width:t,height:i,mask:r,pixels:[...a.pixels]})}function Ui(a,e,s){const{width:t,height:i}=a,r=new Uint8Array(t*i),n=e.width/t,l=e.height/i,{xmin:o,ymax:c}=e,{paths:u}=s,f=a.mask;for(let p=0;py?r*Math.round((f-y)/r):0),h=d-(hy?r*Math.round((p-y)/r):0),m=d-(my?r*Math.floor((f-y)/r+.1):0),h=d-(h{let e=class extends a{constructor(...t){var i,r;super(...t),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalSubset=null,this.raster=null,this.rasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=((r=(i=t[0])==null?void 0:i.raster)==null?void 0:r.datasetFormat)==="Function"}get fullExtent(){var t;return(t=this.rasterInfo)==null?void 0:t.extent}set multidimensionalDefinition(t){this._set("multidimensionalDefinition",t),this.updateRenderer()}set rasterFunction(t){var i;((i=t==null?void 0:t.functionName)==null?void 0:i.toLowerCase())==="none"&&(t=void 0),this._set("rasterFunction",t),this.updateRasterFunction()}set url(t){this._set("url",ot(t,rt))}set renderer(t){t==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("renderer",t),this.updateRenderer())}readRenderer(t,i,r){var l,o;const n=(o=(l=i==null?void 0:i.layerDefinition)==null?void 0:l.drawingInfo)==null?void 0:o.renderer;return ti(n,r)||void 0}async convertVectorFieldData(t,i){if(t==null||!this.rasterInfo)return null;const r=this._rasterJobHandler.instance,n=this.rasterInfo.dataType;return r?r.convertVectorFieldData({pixelBlock:t,dataType:n},i):pi(t,n)}async computeStatisticsHistograms(t,i){t=Ne(ii,t).clone();const{rasterInfo:r}=this,{geometry:n}=t;if(n==null)throw new P("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=r;n.spatialReference.equals(o)||(await Je(),l=n.type==="extent"?ve(n,o):Bi(n,o));const c=t.pixelSize??new H({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:p}=Xi(r,l,c),h=await this.fetchPixels(u,f,p,{...i,interpolation:"nearest"});if(h.pixelBlock==null)throw new P("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const m=await qi(h.pixelBlock,u,l),y=this._rasterJobHandler.instance;return y?y.computeStatisticsHistograms({pixelBlock:m},i):yi(m)}async createFlowMesh(t,i){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(t,i):gi(t.meshType,t.simulationSettings,t.flowData,i.signal!=null?i.signal:new AbortController().signal)}normalizeRasterFetchOptions(t){var l,o;const{multidimensionalInfo:i}=this.rasterInfo??{};if(i==null)return t;let r=t.multidimensionalDefinition||this.multidimensionalDefinition;r!=null&&r.length||(r=Ge(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=t.timeExtent||this.timeExtent;if(r!=null&&n!=null&&(n.start!=null||n.end!=null)){r=r.map(x=>x.clone());const c=(o=(l=i.variables.find(({name:x})=>x===r[0].variableName))==null?void 0:l.dimensions)==null?void 0:o.find(({name:x})=>x==="StdTime"),u=r.find(({dimensionName:x})=>x==="StdTime");if(!c||!u)return{...t,multidimensionalDefinition:null};const{start:f,end:p}=n,h=f==null?null:f.getTime(),m=p==null?null:p.getTime(),y=h??m,d=m??h;if(c.values!=null){const x=c.values.filter(g=>{if(Array.isArray(g)){if(y===d)return g[0]<=y&&g[1]>=y;const w=g[0]<=y&&g[1]>y||g[0]=d,I=g[0]>=y&&g[1]<=d||g[0]d;return w||I}return y===d?g===y:g>=y&&g<=d});if(x.length){const g=x.sort((w,I)=>{const S=Array.isArray(w)?w[0]:w,v=Array.isArray(w)?w[1]:w,F=Array.isArray(I)?I[0]:I,T=Array.isArray(I)?I[1]:I;return y===d?S-F:Math.abs(v-d)-Math.abs(T-d)})[0];u.values=[g]}else r=null}else if(c.hasRegularIntervals&&c.extent){const[x,g]=c.extent;y>g||d1&&t.forEach(d=>h[d.url]=d);const m=ze(((f=n.functionDefinition)==null?void 0:f.toJSON())??n.toJSON(),h),y=new Ee({rasterFunction:m});y.rasterJobHandler=this._rasterJobHandler.instance,await y.open(),this._cachedRasterFunctionJson=(p=this.rasterFunction)==null?void 0:p.toJSON(),this.raster=y}else this.raster=i,this._cachedRasterFunctionJson=null,await i.when();if(this._cachedRendererJson=null,!r&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l!=null&&l.length?l.some(h=>h>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:t,symbolizer:i}=this;if(!t||!i||!this.renderer)return;const{rasterInfo:r}=this.raster,n=Ve(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n==null?void 0:n.name,o=Ue({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(i.rasterInfo=Xe(r,l),i.rendererJSON=o,i.bind(),await c.updateSymbolizer(i),this._cachedRendererJson=o)}async applyRenderer(t,i){const r=t==null?void 0:t.pixelBlock;if(!(r!=null&&r.pixels&&r.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...t,simpleStretchParams:i,bandIds:o}):this.symbolizer.symbolize({...t,simpleStretchParams:i,bandIds:o}),n}getTileUrl(t,i,r){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${t}/${i}/${r}`:""}getCompatibleTileInfo(t,i,r=!1){if(!this.loaded||i==null)return null;if(r&&t.equals(this.spatialReference))return this.tileInfo;const n=Rt(t);return te.create({size:256,spatialReference:t,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:i.xmin,y:i.ymax}})}getCompatibleFullExtent(t){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(t)||(this._compatibleFullExtent=this.raster.computeExtent(t)),this._compatibleFullExtent):null}async fetchTile(t,i,r,n={}){var o;if(s(this),n.requestAsImageElement){const c=this.getTileUrl(t,i,r);return lt(c,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(u=>u.data)}const{rasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const c=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(t,i,r,c),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),((o=this.renderer)==null?void 0:o.type)==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(t,i,r,n)}async fetchPixels(t,i,r,n={}){return this.rasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:t,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),i=Math.round(i),r=Math.round(r),this.raster.fetchPixels(t,i,r,n))}async identify(t,i={}){var o;const{raster:r,rasterInfo:n}=this;if(n.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(dt(i.multidimensionalDefinition)||i.transposedVariableName||i.timeExtent))&&(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition==null)return{location:t,value:null};const l=(o=this.multidimensionalSubset)==null?void 0:o.areaOfInterest;if(l&&!l.contains(t))throw new P("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return r.identify(t,i)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var n,l,o;const t=(n=this.rasterInfo)==null?void 0:n.multidimensionalInfo;if(t==null||((l=this.rasterInfo)==null?void 0:l.dataType)!=="standard-time")return!1;const i=this.multidimensionalDefinition,r=(o=i==null?void 0:i[0])==null?void 0:o.variableName;return t.variables.some(c=>c.name===r&&(!(i!=null&&i[0].dimensionName)||c.dimensions.some(u=>u.name==="StdTime")))}getStandardTimeValue(t){return new Date(24*(t-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(t){var r;const i=t??((r=this.rasterInfo)==null?void 0:r.multidimensionalInfo);return ri(this.multidimensionalSubset,i)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ge(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const t=new oi;return this._rasterJobHandler.connectionPromise=t.initialize().then(async()=>{s(this),this._rasterJobHandler.instance=t,this.raster.rasterJobHandler=t,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){var t;if(this.interpolation==null){s(this);const{raster:i}=this,r=ni(i.rasterInfo,i.tileType,(t=this.sourceJSON)==null?void 0:t.defaultResamplingMethod);this._set("interpolation",r)}}_configDefaultRenderer(t="no"){var u,f;s(this);const{rasterInfo:i}=this.raster;!this.bandIds&&i.bandCount>1&&(this.bandIds=ai(i));const r=Ve(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r==null?void 0:r.name;if(!this.renderer||t==="override"){const p=Ye(i,{bandIds:this.bandIds,variableName:n}),h=i.statistics,m=h&&h.length>0?h[0]:null,y=(m==null?void 0:m.max)??0,d=(m==null?void 0:m.min)??0;this.raster.datasetFormat==="WCSServer"&&p.type==="raster-stretch"&&(y>1e24||d<-1e24)&&(p.dynamicRangeAdjustment=!0,p.statistics=null,p.stretchType==="none"&&(p.stretchType="min-max")),this.renderer=p}const l=Ue({...this.renderer.toJSON(),variableName:n}),o=Xe(i,n);this.symbolizer?(this.symbolizer.rendererJSON=l,this.symbolizer.rasterInfo=o):this.symbolizer=new xi({rendererJSON:l,rasterInfo:o});const c=this.symbolizer.bind();if(c.success){if(t==="auto"){const{colormap:p}=this.raster.rasterInfo,h=this.renderer;if(p!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=(u=this.bandIds)==null?void 0:u.length,y=(f=h.statistics)==null?void 0:f.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else rt.warn("imagery-tile-mixin",c.error||"The given renderer is not supported by the layer."),t==="auto"&&this._configDefaultRenderer("override")}};function s(t){if(!t.raster||!t.rasterInfo)throw new P("imagery-tile","no raster")}return b([R({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),b([R({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),b([R({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),b([R({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),b([R({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),b([R()],e.prototype,"bandIds",void 0),b([R({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),b([R({json:{read:!1}})],e.prototype,"fullExtent",null),b([R()],e.prototype,"interpolation",void 0),b([R()],e.prototype,"ioConfig",void 0),b([R({type:[mt],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),b([R({type:Zt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),b([R()],e.prototype,"raster",void 0),b([R({type:Be,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),b([R()],e.prototype,"rasterInfo",void 0),b([R()],e.prototype,"sourceJSON",void 0),b([R({readOnly:!0,type:j,json:{read:!1}})],e.prototype,"spatialReference",void 0),b([R({type:te})],e.prototype,"tileInfo",void 0),b([R(ut)],e.prototype,"url",null),b([R({types:Qt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var i;const t=((i=this.renderer)==null?void 0:i.type)==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!t}}},origins:{"web-scene":{types:ei,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:t=>({enabled:t&&t.type!=="vector-field"&&t.type!=="flow"})}}}}})],e.prototype,"renderer",null),b([St("renderer")],e.prototype,"readRenderer",null),b([R({clonable:!1})],e.prototype,"symbolizer",void 0),e=b([Q("esri.layers.ImageryTileMixin")],e),e};function Ki(a){const e=a.fields,s=a.records,t=e.some(c=>c.name.toLowerCase()==="oid")?"OBJECTID":"OID",i=[{name:t,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),r=i.map(c=>c.name),n=[];let l=0,o=0;return s.forEach(c=>{const u={};for(u[t]=l++,o=1;o0)for(;u.lengthn;){const p=[];s.getUint8(o)===32?(o+=1,c.forEach(h=>{if(h.type==="C")p.push(Ke(new Uint8Array(e,o,h.length)).trim());else if(h.type==="N")p.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,h.length)).trim(),10));else if(h.type==="F")p.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,h.length)).trim()));else if(h.type==="D"){const m=String.fromCharCode.apply(null,new Uint8Array(e,o,h.length)).trim();p.push(new Date(parseInt(m.substring(0,4),10),parseInt(m.substring(4,6),10)-1,parseInt(m.substring(6,8),10)))}o+=h.length}),u.push(p)):o+=n}}return{header:l,fields:c,records:u,recordSet:Ki({fields:c,records:u})}}}const ae=new Map;ae.set("int16","esriFieldTypeSmallInteger"),ae.set("int32","esriFieldTypeInteger"),ae.set("int64","esriFieldTypeInteger"),ae.set("float32","esriFieldTypeSingle"),ae.set("float64","esriFieldTypeDouble"),ae.set("text","esriFieldTypeString");const nt=8;let me=class extends ce{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:s}=await this.request(this.url+"/conf.json",{signal:e==null?void 0:e.signal});if(!this._validateHeader(s))throw new P("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:t,rasterInfo:i}=this._parseHeader(s);if(i.dataType==="thematic"){const r=await this._fetchAuxiliaryInformation();i.attributeTable=r}this._set("storageInfo",t),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,s,t,i={}){const{transposeInfo:r}=this.rasterInfo.storageInfo,{transposedVariableName:n}=i,l=!(!r||!n),o=l?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(o<0)return null;const c=this._buildCacheFilePath(o,s,t,i.multidimensionalDefinition,n),u=this._getIndexRecordFromBundle(s,t,l),f=await this.request(c,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!f)return null;const p=new Uint8Array(f.data),h=this._getTileEndAndContentType(p,u);if(h.recordSize===0)return null;const m=await this.request(c,{range:{from:h.position,to:h.position+h.recordSize},responseType:"array-buffer",signal:i.signal});if(!m)return null;const[y,d]=this._getTileSize(l);return this.decodePixelBlock(m.data,{width:y,height:d,planes:null,pixelType:null,returnInterleaved:l})}_validateHeader(e){const s=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&e.type==="RasterInfo"&&!s.some(t=>!e[t])}_parseHeader(e){var Y,N,A,L,ee;const s=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:t,colormap:i,blockWidth:r,blockHeight:n,firstPyramidLevel:l,maximumPyramidLevel:o}=e,c=(Y=e.statistics)==null?void 0:Y.map(J=>({min:J.min,max:J.max,avg:J.mean,stddev:J.standardDeviation,median:J.median,mode:J.mode})),u=(L=(A=(N=e.histograms)==null?void 0:N[0])==null?void 0:A.counts)!=null&&L.length?e.histograms:null,f=e.extent.spatialReference,p=(ee=e.geodataXform)==null?void 0:ee.spatialReference,h=new j(f!=null&&f.wkid||f!=null&&f.wkt||f!=null&&f.wkt2?f:p);let m=new W({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:h});const y=new H({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:h}),d=Math.round((m.xmax-m.xmin)/y.x),x=Math.round((m.ymax-m.ymin)/y.y),g=this._parseTransform(e.geodataXform),w=g?m:null;g&&(m=g.forwardTransform(m),y.x=(m.xmax-m.xmin)/d,y.y=(m.ymax-m.ymin)/x);const I=e.properties??{},S=e.format.toLowerCase().replace("cache/",""),v=new H(e.origin.x,e.origin.y,h);let F,T,k,_;if(i!=null&&i.colors)for(F=[],T=0;T>>24,k<<8>>>24,k>>>24]);const M=e.LODInfos,O=[];for(T=0;T0)for(T=0;Tn.data).catch(()=>null),t=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then(n=>n.data).catch(()=>null),i=await Promise.all([s,t]);let r;if(i[0]){let n=i[0].fields;const l=i[0].values;if(n&&l){n=n.map(c=>({type:c.name==="OID"?"esriFieldTypeOID":ae.get(c.type),name:c.name,alias:c.alias||c.name}));const o=l.map(c=>({attributes:c}));n&&l&&(r={fields:n,features:o})}}return!r&&i[1]&&(r=yt.parse(i[1]).recordSet),He.fromJSON(r)}_buildCacheFilePath(e,s,t,i,r){const n=this._getPackageSize(!!r),l=Math.floor(s/n)*n,o=Math.floor(t/n)*n,c="R"+this._toHexString4(l)+"C"+this._toHexString4(o);let u="L";u+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:f}=this.rasterInfo,p=i==null?void 0:i[0];if(f==null||!p)return`${this.url}/_alllayers/${u}/${c}.bundle`;let h="_yxs";if(!r){h=f.variables.find(d=>d.name===p.variableName).dimensions[0].values.indexOf(p.values[0]).toString(16);const y=4-h.length;for(let d=0;d0;)s="0"+s}return s}};b([R({readOnly:!0})],me.prototype,"storageInfo",void 0),b([R({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),me=b([Q("esri.layers.support.rasterDatasets.CloudRaster")],me);const Zi=me;let pe=class extends ce{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){await this.init();const s=this.data,{pixelBlock:t,statistics:i,histograms:r,name:n,keyProperties:l,nativeExtent:o,transform:c}=this.data,{width:u,height:f,pixelType:p}=t,h=s.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new j({wkid:3857})}),m=s.isPseudoSpatialReference??!s.extent,y={x:h.width/u,y:h.height/f},d=new xe({width:u,height:f,pixelType:p,extent:h,nativeExtent:o,transform:c,pixelSize:y,spatialReference:h.spatialReference,bandCount:t.pixels.length,keyProperties:l||{},statistics:i,isPseudoSpatialReference:m,histograms:r});this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),await this._buildInMemoryRaster(t,{width:512,height:512},e),this.datasetName=n,this.url="/InMemory/"+n}fetchRawTile(e,s,t,i={}){const r=this._pixelBlockTiles.get(`${e}/${s}/${t}`);return Promise.resolve(r)}async _buildInMemoryRaster(e,s,t){var u,f;const i=this.rasterInfo.storageInfo.maximumPyramidLevel,r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:s,maximumPyramidLevel:i},t):Promise.resolve(wi(e,s,i)),n=this.rasterInfo.statistics!=null,l=this.rasterInfo.histograms!=null,o=n?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},t):Promise.resolve(Ii(e)),c=await ft([r,o]);if(!c[0].value&&c[1].value)throw new P("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=c[0].value,n||(this.rasterInfo.statistics=(u=c[1].value)==null?void 0:u.statistics),l||(this.rasterInfo.histograms=(f=c[1].value)==null?void 0:f.histograms)}};b([R({type:String,json:{write:!0}})],pe.prototype,"datasetFormat",void 0),b([R()],pe.prototype,"data",void 0),pe=b([Q("esri.layers.support.rasterDatasets.InMemoryRaster")],pe);const Qi=pe;function fe(a,e){if(!a||!e)return[];let s=e;e.includes("/")?(s=e.slice(0,e.indexOf("/")),e=e.slice(e.indexOf("/")+1)):e="";const t=[];if(e){const r=fe(a,s);for(let n=0;nt.push(l));return t}const i=a.getElementsByTagNameNS("*",s);if(!i||i.length===0)return[];for(let r=0;r0?e?X(t[0],e):t[0]:null}function Z(a,e=null){const s=e?X(a,e):a;let t;return s?(t=s.textContent||s.nodeValue,t?t.trim():null):null}function es(a,e){const s=fe(a,e),t=[];let i;for(let r=0;rNumber(s))}function le(a,e){const s=Z(a,e);return Number(s)}function Pe(a,e){var i;const s=(i=a==null?void 0:a.nodeName)==null?void 0:i.toLowerCase(),t=e.toLowerCase();return s.slice(s.lastIndexOf(":")+1)===t}function at(a,e){if(!a||!e)return null;const s=[];for(let t=0;tNumber(h));let l,o,c,u;fe(a,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=le(a,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n!=null&&n.length&&t!=null&&i!=null?{min:t,max:i,size:r||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Fe(a){if(!a)return null;let e=Number(a);if(!isNaN(e)&&e!==0)return new j({wkid:e});if(a=String(a).trim(),vt(a))return new j({wkt2:a});const s=a.toUpperCase();if(s.startsWith("COMPD_CS")){if(!s.includes("VERTCS")||!s.includes("GEOGCS")&&!s.startsWith("PROJCS"))return null;const t=s.indexOf("VERTCS"),i=s.indexOf("PROJCS"),r=i>-1?i:s.indexOf("GEOGCS");if(r===-1)return null;const n=a.slice(r,a.lastIndexOf("]",t)+1).trim(),l=a.slice(t,a.lastIndexOf("]")).trim();e=Oe(n);const o=new j(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return s.startsWith("GEOGCS")||s.startsWith("PROJCS")?(e=Oe(a),new j(e!==0?{wkid:e}:{wkt:a})):null}function Oe(a){var i;const e=a.replaceAll("]","[").replaceAll('"',"").split("[").map(r=>r.trim()).filter(r=>r!==""),s=e[e.length-1].split(","),t=(i=s[0])==null?void 0:i.toLowerCase();if((t==="epsg"||t==="esri")&&a.endsWith('"]]')){const r=Number(s[1]);if(!isNaN(r)&&r!==0)return r}return 0}function We(a){var t;if(((t=a==null?void 0:a.documentElement.tagName)==null?void 0:t.toLowerCase())!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};a.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Pe(i,"SRS")){if(!e.spatialReference){const r=Z(i);e.spatialReference=Fe(r)}}else if(Pe(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:r,transform:n}=ts(i);e.transform=n,e.spatialReference||(e.spatialReference=r)}else fe(i,"MDI").forEach(r=>e.metadata[r.getAttribute("key")]=Z(r));else if(Pe(i,"PAMRasterBand")){const r=is(i);r.sourceBandIndex!=null&&e.rasterBands[r.sourceBandIndex]==null?e.rasterBands[r.sourceBandIndex]=r:e.rasterBands.push(r)}}});const s=e.rasterBands;if(s.length){const i=!!s[0].statistics;e.statistics=i?s.map(n=>n.statistics).filter(De):null;const r=!!s[0].histogram;e.histograms=r?s.map(n=>n.histogram).filter(De):null}return e}let Te=class extends ce{async open(a){await this.init();const e=await this._fetchData(a);let{spatialReference:s,statistics:t,histograms:i,transform:r}=await this._fetchAuxiliaryData(a);const n=!s;n&&(s=new j({wkid:3857})),i!=null&&i.length&&t==null&&(t=Ae(i));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:s});const u=r?r.forwardTransform(c):c;let f=!0;if(r){const h=r.forwardCoefficients;f=h&&h[1]===0&&h[2]===0,f&&(r=null,c=u)}const p=new Qi({data:{extent:u,nativeExtent:c,transform:r,pixelBlock:e,statistics:t,histograms:i,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n}});await p.open(),p.data=null,this._set("rasterInfo",p.rasterInfo),this._inMemoryRaster=p}fetchRawTile(a,e,s,t={}){return this._inMemoryRaster.fetchRawTile(a,e,s,t)}async _fetchData(a){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:a==null?void 0:a.signal}),s=bi(e).toUpperCase();if(s!=="JPG"&&s!=="PNG"&&s!=="GIF"&&s!=="BMP")throw new P("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);const t=s.toLowerCase(),i=t==="gif"||t==="bmp"||!Tt("ios"),r=await this.decodePixelBlock(e,{format:t,useCanvas:i,hasNoZlibMask:!0});if(r==null)throw new P("image-aux-raster:open","the data cannot be decoded");return r}async _fetchAuxiliaryData(a){var c;const e=a==null?void 0:a.signal,s=this.ioConfig.skipExtensions??[],t=s.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),i=this.datasetFormat,r=i==="JPG"?"jgw":i==="PNG"?"pgw":i==="BMP"?"bpw":null,n=r&&s.includes(r)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+r,{responseType:"text",signal:e}),l=await ft([t,n]);if(e!=null&&e.aborted)throw _t();const o=We((c=l[0].value)==null?void 0:c.data);if(!o.transform){const u=l[1].value?l[1].value.data.split(` +`).slice(0,6).map(f=>Number(f)):null;o.transform=(u==null?void 0:u.length)===6?new Le({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return o}};b([R({type:String,json:{write:!0}})],Te.prototype,"datasetFormat",void 0),Te=b([Q("esri.layers.support.rasterDatasets.ImageAuxRaster")],Te);const Re=Te;let ye=class extends ce{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(a){var F,T;await this.init();const e=a==null?void 0:a.signal,s=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});s.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const t=s.data;if(this.sourceJSON=t,!t)throw new P("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!t.tileInfo)throw new P("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const i=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=t.cacheType,this.tileType==null&&(i.includes(t.tileInfo.format.toLowerCase())?this.tileType="Map":t.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=((F=t.name)==null?void 0:F.slice(t.name.indexOf("/")+1))??"";const r=await this._fetchRasterInfo({signal:e});if(r==null)throw new P("image-server-raster:open","cannot initialize image service");li(r,t);const n=this.tileType==="Map"?ss(t.tileInfo,t):te.fromJSON(t.tileInfo);kt(n);const[l,o]=this._computeMinMaxLOD(r,n),{extent:c,pixelSize:u}=r,f=.5/r.width*u.x,p=Math.max(u.x,u.y),{lods:h}=n;(this.tileType!=="Map"&&t.maxScale!==0||Math.abs(u.x-u.y)>f||!h.some(k=>Math.abs(k.resolution-p){k.level>=o.level&&k.level<=l.level&&x.push({x:k.resolution,y:k.resolution}),_k.x-_.x);const w=this.computeBlockBoundary(c,y,d,n.origin,x,m),I=x.length>1?x.slice(1):null;let S;t.transposeInfo&&(S={tileSize:[t.transposeInfo.rows,t.transposeInfo.cols],packetSize:((T=r.keyProperties)==null?void 0:T._yxs.PacketSize)??0});const v=g.length<=1||g.length>=3&&g.slice(0,-1).every(k=>k===g[0])?g[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/m))/10;if(r.storageInfo=new ge({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:I,pyramidScalingFactor:v,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:m,tileInfo:n,transposeInfo:S,blockBoundary:w}),this._fixGCSShift(r),this._set("rasterInfo",r),t.capabilities.toLowerCase().includes("tilemap")){const k={tileInfo:r.storageInfo.tileInfo,parsedUrl:Ft(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Mt({layer:k})}}async fetchRawTile(a,e,s,t={}){const{storageInfo:i,extent:r}=this.rasterInfo,{transposeInfo:n}=i,l=n!=null&&!!t.transposedVariableName;if(this._slices&&!l&&t.sliceId==null)return null;const o=l?0:i.maximumPyramidLevel-a+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${s}`,u=this._slices?l?{variable:t.transposedVariableName}:{sliceId:t.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:t.signal});if(!f)return null;const p=l?n.tileSize:i.tileInfo.size,h=await this.decodePixelBlock(f,{width:p[0],height:p[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(h==null)return null;const m=i.blockBoundary[a];if(i.compression!=="jpg"||s>m.minCol&&sm.minRow&&e{const r=e.find(n=>i.variableName===n.variableName&&n.dimensionName===i.dimensionName);return r?(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])!==(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0]):!0}))return s}return null}async fetchVariableStatisticsHistograms(a,e){var r,n,l;const s=this.request(this.url+"/statistics",{query:{variable:a,f:"json"},signal:e}).then(o=>{var c;return(c=o.data)==null?void 0:c.statistics}),t=this.request(this.url+"/histograms",{query:{variable:a,f:"json"},signal:e}).then(o=>{var c;return(c=o.data)==null?void 0:c.histograms}),i=await Promise.all([s,t]);return i[0]&&i[0].forEach(o=>{o.avg=o.mean,o.stddev=o.standardDeviation}),(l=(n=(r=i[1])==null?void 0:r[0])==null?void 0:n.counts)!=null&&l.length||(i[1]=null),{statistics:i[0]||null,histograms:i[1]||null}}async computeBestPyramidLevelForLocation(a,e={}){if(!this._tilemapCache)return 0;let s=this.identifyPixelLocation(a,0,e.datumTransformation);if(s===null)return null;let t=0;const{maximumPyramidLevel:i}=this.rasterInfo.storageInfo;let r=i-t+this._levelOffset;const n=s.srcLocation;for(;r>=0;){try{if(await this._tilemapCache.fetchAvailability(r,s.row,s.col,e)==="available")break}catch{}if(r--,t++,s=this.identifyPixelLocation(n,t,e.datumTransformation),s===null)return null}return r===-1||s==null?null:t}async _fetchRasterInfo(a){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=j.fromJSON(e.spatialReference||n.spatialReference),u=new H({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new xe({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:s}=a,t=ci(this.url,this.sourceJSON,{signal:s,query:this.ioConfig.customFetchParameters}),i=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:s}).then(n=>{var l;return(l=n.data)==null?void 0:l.slices}).catch(()=>null):null,r=await Promise.all([t,i]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:a}=this;a.minScale&&a.minScale<0&&(a.minScale=0),a.maxScale&&a.maxScale<0&&(a.maxScale=0)}_fixGCSShift(a){const{extent:e,spatialReference:s}=a;e.xmin>-1&&e.xmax>181&&(s!=null&&s.wkid)&&s.isGeographic&&(a.nativeExtent=a.extent,a.transform=new Ei,a.extent=a.transform.forwardTransform(e))}_computeMinMaxLOD(a,e){const{pixelSize:s}=a,t=.5/a.width*s.x,{lods:i}=e,r=e.lodAt(Math.max.apply(null,i.map(p=>p.level))),n=e.lodAt(Math.min.apply(null,i.map(p=>p.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=i[0].level,[r,n];if(l==="Raster")return[i.find(p=>p.resolution===s.x)??r,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=r;c>0&&(u=i.find(p=>Math.abs(p.scale-c)p.scale>c).sort((p,h)=>p.scale>h.scale?1:-1)[0]??r));let f=n;return o>0&&(f=i.find(p=>Math.abs(p.scale-o)n!=null&&n>=i&&n<=r)});if(s!==0&&t!==0){const n=c=>Math.round(1e4*c)/1e4,l=s?n(s):1/0,o=t?n(t):-1/0;return te.fromJSON({...a,lods:a.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return te.fromJSON(a)}b([R({type:String,json:{write:!0}})],ye.prototype,"datasetFormat",void 0),b([R()],ye.prototype,"tileType",void 0),ye=b([Q("esri.layers.support.rasterDatasets.ImageServerRaster")],ye);const rs=ye,K=new Map;K.set("Int8","s8"),K.set("UInt8","u8"),K.set("Int16","s16"),K.set("UInt16","u16"),K.set("Int32","s32"),K.set("UInt32","u32"),K.set("Float32","f32"),K.set("Float64","f32"),K.set("Double64","f32");const se=new Map;se.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),se.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),se.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),se.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let ue=class extends ce{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(a){var y;await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=a?a.signal:null,s=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:t,files:i}=this._parseHeader(s.data);if(((y=this.ioConfig.skipExtensions)==null?void 0:y.indexOf("aux.xml"))===-1){const d=await this._fetchAuxiliaryData(a);d!=null&&(t.statistics=d.statistics??t.statistics,t.histograms=d.histograms,d.histograms&&t.statistics==null&&(t.statistics=Ae(d.histograms)))}this._set("rasterInfo",t),this._files=i;const r=await this.request(i.index,{responseType:"array-buffer",signal:e});this._storageIndex=this._parseIndex(r.data);const{blockWidth:n,blockHeight:l}=this.rasterInfo.storageInfo,o=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:c,height:u}=this.rasterInfo,f=[],p=this._getBandSegmentCount();let h=0,m=-1;for(;h0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=m),this.updateTileInfo()}async fetchRawTile(a,e,s,t={}){const{blockWidth:i,blockHeight:r,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[a];if(!l||l.maxRowe||l.minCol>s)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:p}=this._getTileLocation(a,e,s);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const _=new Uint8Array(i*r);return new ie({width:i,height:r,pixels:null,mask:_,validPixelCount:0})}const{bandIds:h}=this.ioConfig,m=this._getBandSegmentCount(),y=[];let d=0;for(d=0;d_.data.byteLength).reduce((_,M)=>_+M),w=new Uint8Array(g);let I=0;for(d=0;d1e24)for(d=0;d<_;d++)Math.abs((v.pixels[0][d]-F)/F)>1e-6&&(M[d]=1);else for(d=0;d<_;d++)v.pixels[0][d]!==F&&(M[d]=1);v.mask=M}let T=0,k=0;if(f!==i||p!==r){let _=v.mask;if(_)for(d=0;d0)throw new Error("invalid array buffer must be multiples of 16");let e,s,t,i,r,n;if(Ri){for(s=new Uint8Array(a),i=new ArrayBuffer(a.byteLength),t=new Uint8Array(i),r=0;rparseFloat(M)))),X(a,"MRF_META/CachedSource"))throw new P("mrf:open","currently does not support MRF referencing other data files");const y=X(a,"MRF_META/GeoTags"),d=X(y,"BoundingBox");let x,g=!1;if(d!=null){const M=parseFloat(d.getAttribute("minx")),O=parseFloat(d.getAttribute("miny")),D=parseFloat(d.getAttribute("maxx")),E=parseFloat(d.getAttribute("maxy")),C=Z(y,"Projection")||"";let $=j.WGS84;if(C!=="LOCAL_CS[]")if(C.toLowerCase().startsWith("epsg:")){const B=Number(C.slice(5));isNaN(B)||B===0||($=new j({wkid:B}))}else $=Fe(C)??j.WGS84;else g=!0,$=new j({wkid:3857});x=new W(M,O,D,E),x.spatialReference=$}else g=!0,x=new W({xmin:-.5,ymin:.5-i,xmax:t-.5,ymax:.5,spatialReference:new j({wkid:3857})});const w=X(a,"MRF_META/Rsets"),I=parseInt((w==null?void 0:w.getAttribute("scale"))||"2",10),S=x.spatialReference,v=new ge({origin:new H({x:x.xmin,y:x.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:I}),F=new H({x:x.width/t,y:x.height/i,spatialReference:S}),T=new xe({width:t,height:i,extent:x,isPseudoSpatialReference:g,spatialReference:S,bandCount:r,pixelType:o,pixelSize:F,noDataValue:h,storageInfo:v}),k=Z(a,"datafile"),_=Z(a,"IndexFile");return{rasterInfo:T,files:{mrf:this.url,index:_||this.url.replace(".mrf",".idx"),data:k||this.url.replace(".mrf",se.get(n).blobExtension)}}}async _fetchAuxiliaryData(a){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:a==null?void 0:a.signal});return We(e)}catch{return null}}};b([R()],ue.prototype,"_files",void 0),b([R()],ue.prototype,"_storageIndex",void 0),b([R({type:String,json:{write:!0}})],ue.prototype,"datasetFormat",void 0),ue=b([Q("esri.layers.support.rasterIO.MRFRaster")],ue);const ns=ue,$e=(a,e)=>{var s;return(s=a.get(e))==null?void 0:s.values},de=(a,e)=>{var s,t;return(t=(s=a.get(e))==null?void 0:s.values)==null?void 0:t[0]};let oe=class extends ce{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(a){var m,y,d,x;await this.init();const e=a?a.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!s)throw new P("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:t,firstIFDPos:i,isBigTiff:r}=vi(s),n=[];await this._readIFDs(n,s,t,i,0,r?8:4,e);const{imageInfo:l,rasterInfo:o}=this._parseIFDs(n),c=Ti(n),u=_i(n);if(this._headerInfo={littleEndian:t,isBigTiff:r,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new P("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new P("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&_e.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=(y=(m=n[0].get("PREDICTOR"))==null?void 0:m.values)==null?void 0:y[0];if(((x=(d=n[0].get("SAMPLEFORMAT"))==null?void 0:d.values)==null?void 0:x[0])===3&&f===2)throw new P("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floatting point data");const{skipExtensions:h=[]}=this.ioConfig;if(!h.includes("aux.xml")){const g=await this._fetchAuxiliaryMetaData(a);g!=null&&this._processPAMInfo(g,o)}h.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||(o.attributeTable=await this._fetchAuxiliaryTable(a),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(a,e,s,t={}){var r;if(!((r=this._headerInfo)!=null&&r.isSupported)||this.isBlockOutside(a,e,s))return null;const i=await this._fetchRawTiffTile(a,e,s,!1,t);if(i!=null&&this._headerInfo.hasMaskBand){const n=await this._fetchRawTiffTile(a,e,s,!0,t);n!=null&&n.pixels[0]instanceof Uint8Array&&(i.mask=n.pixels[0])}return i}_parseIFDs(a){var O,D;const e=ki(a),{width:s,height:t,tileWidth:i,tileHeight:r,planes:n,pixelType:l,compression:o,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:f,pyramidBlockHeight:p,tileBoundary:h,affine:m,metadata:y}=e,d=((O=e.extent.spatialReference)==null?void 0:O.wkt)||((D=e.extent.spatialReference)==null?void 0:D.wkid);let x=Fe(d),g=!!e.isPseudoGeographic;x==null&&(g=!0,x=new j({wkid:3857}));const w=new W({...e.extent,spatialReference:x}),I=new H(w?{x:w.xmin,y:w.ymax,spatialReference:x}:{x:0,y:0}),S=new ge({blockWidth:i,blockHeight:r,pyramidBlockWidth:f,pyramidBlockHeight:p,compression:o,origin:I,firstPyramidLevel:c,maximumPyramidLevel:u,blockBoundary:h}),v=new H({x:(w.xmax-w.xmin)/s,y:(w.ymax-w.ymin)/t,spatialReference:x}),F=y?{BandProperties:y.bandProperties,DataType:y.dataType}:{};let T=null;const k=de(a[0],"PHOTOMETRICINTERPRETATION"),_=$e(a[0],"COLORMAP");if(k<=3&&(_==null?void 0:_.length)>3&&_.length%3==0){T=[];const E=_.length/3;for(let C=0;C>>8,_[C+E]>>>8,_[C+2*E]>>>8])}const M=new xe({width:s,height:t,bandCount:n,pixelType:l,pixelSize:v,storageInfo:S,spatialReference:x,isPseudoSpatialReference:g,keyProperties:F,extent:w,colormap:T,statistics:y?y.statistics:null});return m!=null&&m.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-t,xmax:s-.5,ymax:.5,spatialReference:x}),M.transform=new Le({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new H({x:(w.xmax-w.xmin)/s,y:(w.ymax-w.ymin)/t,spatialReference:x}),S.origin.x=-.5,S.origin.y=.5),{imageInfo:e,rasterInfo:M}}_processPAMInfo(a,e){if(e.statistics=a.statistics??e.statistics,e.histograms=a.histograms,a.histograms&&e.statistics==null&&(e.statistics=Ae(a.histograms)),a.transform&&e.transform==null){e.transform=a.transform,e.nativeExtent=e.extent;const s=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new H({x:(s.xmax-s.xmin)/e.width,y:(s.ymax-s.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=s}e.isPseudoSpatialReference&&a.spatialReference&&(e.spatialReference=a.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}async _readIFDs(a,e,s,t,i,r=4,n){if(!t)return null;(t>=e.byteLength||t<0)&&(e=(await this.request(this.url,{range:{from:t+i,to:t+i+this._bufferSize},responseType:"array-buffer",signal:n})).data,i=t+i,t=0);const l=await this._readIFD(e,s,t,i,Ie.tiffTags,r,n);if(a.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(a,e,s,l.nextIFD-i,i,r,n)}async _readIFD(a,e,s,t,i=Ie.tiffTags,r=4,n){var o,c;if(!a)return null;const l=Fi(a,e,s,t,i,r);if(l.success){const u=[];if((o=l.ifd)==null||o.forEach(f=>{f.values||u.push(f)}),u.length>0){const f=u.map(h=>h.offlineOffsetSize).filter(De),p=Math.min.apply(null,f.map(h=>h[0]));if(Math.min.apply(null,f.map(h=>h[0]+h[1]))-p<=this._bufferSize){const{data:h}=await this.request(this.url,{range:{from:p,to:p+this._bufferSize},responseType:"array-buffer",signal:n});a=h,t=p,u.forEach(m=>Mi(a,e,m,t))}}if((c=l.ifd)!=null&&c.has("GEOKEYDIRECTORY")){const f=l.ifd.get("GEOKEYDIRECTORY"),p=f==null?void 0:f.values;if(p&&p.length>4){const h=p[0]+"."+p[1]+"."+p[2],m=await this._readIFD(a,e,f.valueOffset+6-t,t,Ie.geoKeys,2,n);f.data=m.ifd,f.data&&f.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[h]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==a.byteLength)return(a=(await this.request(this.url,{range:{from:t,to:t+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:v,responseType:"array-buffer",signal:i.signal})),f=await Promise.all(u),p=f.map(v=>v.data.byteLength).reduce((v,F)=>v+F),h=f.length===1?f[0].data:new ArrayBuffer(p),m=[0],y=[0];if(f.length>1){const v=new Uint8Array(h);for(let F=0,T=0;Fm||s>y||ee.add(t)),e}static async open(e){const{url:s,ioConfig:t,sourceJSON:i}=e;let r=e.datasetFormat;r==null&&s.lastIndexOf(".")&&(r=s.slice(s.lastIndexOf(".")+1).toUpperCase()),r==="OVR"||r==="TIF"?r="TIFF":r!=="JPG"&&r!=="JPEG"&&r!=="JFIF"||(r="JPG"),s.toLowerCase().includes("/imageserver")&&!s.toLowerCase().includes("/wcsserver")&&(r="RasterTileServer");const n={url:s,sourceJSON:i,datasetFormat:r,ioConfig:t??{bandIds:null,sampling:null}};let l,o;if(r&&this.supportedFormats.has(r)){if(r==="CRF"&&!(t!=null&&t.enableCRF))throw new P("rasterfactory:open",`cannot open raster: ${s}`);return l=G.get(r).constructor,o=new l(n),await o.open({signal:e.signal}),o}if(r)throw new P("rasterfactory:open","not a supported format "+r);const c=Array.from(G.keys());let u=0;const f=()=>(r=c[u++],r&&(r!=="CRF"||t!=null&&t.enableCRF)?(l=G.get(r).constructor,o=new l(n),o.open({signal:e.signal}).then(()=>o).catch(()=>f())):null);return f()}static register(e,s,t){G.has(e.toUpperCase())||G.set(e.toUpperCase(),{desc:s,constructor:t})}}let z=class extends Ct(Pt(Ot($t(Ut(Yi(Dt(Bt(Jt(zt(Et(Vt))))))))))){constructor(...a){super(...a),this._primaryRasters=[],this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=Nt(async(e,s,t)=>{const{save:i,saveAs:r}=await ht(()=>import("./imageryUtils-djrWgZtb.js"),__vite__mapDeps([2,3,0,1,4]));switch(e){case we.SAVE:return i(this,s);case we.SAVE_AS:return r(this,t,s)}})}normalizeCtorArgs(a,e){return typeof a=="string"?{url:a,...e}:a}load(a){const e=a!=null?a.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},a).catch(At).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var l;const a=[new he({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new he({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],{rasterInfo:e}=this,s=e==null?void 0:e.attributeTable,t=s!=null?s.fields:null,i="Raster.";if(t){const o=t.filter(c=>c.type!=="oid"&&c.name.toLowerCase()!=="value").map(c=>{const u=c.clone();return u.name=i+c.name,u});a.push(...o)}const r=e==null?void 0:e.dataType,n=e==null?void 0:e.multidimensionalInfo;if((r==="vector-magdir"||r==="vector-uv")&&n!=null){const o=(l=n.variables[0].unit)==null?void 0:l.trim(),c="Magnitude"+(o?` (${o})`:"");a.push(new he({name:"Raster.Magnitude",alias:c,domain:null,editable:!1,type:"double"})),a.push(new he({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return a}createPopupTemplate(a){const{rasterFields:e}=this,s=new Set(e.map(({name:t})=>t).filter(t=>t.toLowerCase()!=="raster.servicepixelvalue.raw"));return Ht({fields:e,title:this.title},{...a,visibleFieldNames:s})}async generateRasterInfo(a,e){var s;if(!(a=Ne(Be,a)))return this.rasterInfo;try{const t={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(n=>t[n.url]=n);const i=ze(((s=a.functionDefinition)==null?void 0:s.toJSON())??a.toJSON(),t),r=new Ee({rasterFunction:i});return await r.open(e),r.rasterInfo}catch(t){throw t instanceof P?t:new P("imagery-tile-layer","the given raster function is not supported")}}async save(a){return this._debouncedSaveOperations(we.SAVE,a)}async saveAs(a,e){return this._debouncedSaveOperations(we.SAVE_AS,e,a)}write(a,e){const s=this._primaryRasters[0]??this.raster;if(this.loaded?s.datasetFormat==="RasterTileServer"&&(s.tileType==="Raster"||s.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(a,e);if(e!=null&&e.messages){const t=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new P("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${t}'`,{layer:this}))}return null}async _openRaster(a){var t;let e=!1;if(this.raster)this.raster.rasterInfo||await this.raster.open(),this.raster.datasetFormat==="Function"?(e=!0,this._primaryRasters=this.raster.primaryRasters.rasters):this._primaryRasters=[this.raster],this.url=this.raster.url;else{const{rasterFunction:i}=this,r=[this.url];i&&Ni(i.toJSON(),r);const n=await Promise.all(r.map(o=>os.open({url:o,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:a}))),l=n.findIndex(o=>o==null);if(l>-1)throw new P("imagery-tile-layer:open",`cannot open raster: ${r[l]}`);if(this._primaryRasters=n,i){const o={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(f=>o[f.url]=f);const c=ze(((t=i.functionDefinition)==null?void 0:t.toJSON())??i.toJSON(),o),u=new Ee({rasterFunction:c});try{await u.open(),this.raster=u}catch(f){const p=_e.getLogger(this);f instanceof P&&p.error("imagery-tile-layer:open",f.message),p.warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=n[0]}}else this.raster=n[0]}const s=this.raster.rasterInfo;if(!s)throw new P("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("rasterInfo",e?s:this._primaryRasters[0].rasterInfo),this._set("spatialReference",s.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.rasterInfo.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Lt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}};b([R({clonable:!1})],z.prototype,"_primaryRasters",void 0),b([R({type:[Wt],json:{write:{overridePolicy(){var a;return{enabled:!this.loaded||this.raster.tileType==="Raster"||((a=this.bandIds)==null?void 0:a.join(","))!=="0,1,2"}}}}})],z.prototype,"bandIds",void 0),b([R({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),jt(ui)],z.prototype,"interpolation",void 0),b([R(qt)],z.prototype,"legendEnabled",void 0),b([R({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),b([R({type:["show","hide"]})],z.prototype,"listMode",void 0),b([R({json:{read:!0,write:!0}})],z.prototype,"blendMode",void 0),b([R()],z.prototype,"sourceJSON",void 0),b([R({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],z.prototype,"version",void 0),b([R({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),b([R({type:["ArcGISTiledImageServiceLayer"]})],z.prototype,"operationalLayerType",void 0),b([R({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(a,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(a,e,s){e[s]=!a}}}})],z.prototype,"popupEnabled",void 0),b([R({type:Gt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],z.prototype,"popupTemplate",void 0),b([R({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),b([R({readOnly:!0,type:[he]})],z.prototype,"fields",void 0),b([R({readOnly:!0,type:[he]})],z.prototype,"rasterFields",null),z=b([Q("esri.layers.ImageryTileLayer")],z);const bs=z;export{bs as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/imageryUtils-djrWgZtb.js","assets/utils-rBsg-VY8.js","assets/jsonContext-cWV_-jAj.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/ImageryTileLayerView3D-kyd0hRhY.js b/dist/assets/ImageryTileLayerView3D-kyd0hRhY.js new file mode 100644 index 0000000..55f3b21 --- /dev/null +++ b/dist/assets/ImageryTileLayerView3D-kyd0hRhY.js @@ -0,0 +1 @@ +import{e as n,y as l,jW as L,c as E,E as I,fG as O,S as P,w as _,jX as j,jY as F}from"./index-J0iiHjMT.js";import{s as v,v as G}from"./rasterProjectionHelper-KvYWHIT_.js";import{n as A}from"./LayerView3D-iOx2MD1g.js";import{o as k}from"./TiledLayerView3D-Av58zTxG.js";import{u as M}from"./LayerView-efDufa6j.js";import{a as V}from"./RefreshableLayerView-Pd4dLcWr.js";import{r as W}from"./drapedUtils-9db1OpTX.js";const $=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return v(this.layer.rasterInfo,this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return G(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(r){return!!v(this.layer.rasterInfo,r)}async fetchPopupFeatures(r,a){const{layer:i}=this;if(!r)throw new I("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:h}=i,y=O(i,a);if(!h||y==null)throw new I("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:h,popupTemplate:y});const o=[],{value:p,magdirValue:s,processedValue:b}=await i.identify(r,{timeExtent:this.timeExtent});let c="";if(p&&p.length){c=i.type==="imagery-tile"&&i.hasStandardTime()&&p[0]!=null?p.map(w=>i.getStandardTimeValue(w)).join(", "):p.join(", ");const d={ObjectId:0},T="Raster.ServicePixelValue";d[T]=(b==null?void 0:b.join(", "))??c,d[T+".Raw"]=c;const x=i.rasterInfo.attributeTable;if(x!=null){const{fields:w,features:z}=x,S=w.find(({name:u})=>u.toLowerCase()==="value"),g=S?z.find(u=>String(u.attributes[S.name])===c):null;if(g)for(const u in g.attributes)g.attributes.hasOwnProperty(u)&&(d[this._rasterFieldPrefix+u]=g.attributes[u])}const R=i.rasterInfo.dataType;R!=="vector-magdir"&&R!=="vector-uv"||(d["Raster.Magnitude"]=s==null?void 0:s[0],d["Raster.Direction"]=s==null?void 0:s[1]);const f=new P(this.fullExtent.clone(),null,d);f.layer=i,f.sourceLayer=f.layer,o.push(f)}return o}};return n([l()],e.prototype,"layer",void 0),n([l(L)],e.prototype,"timeExtent",void 0),n([l()],e.prototype,"view",void 0),n([l()],e.prototype,"fullExtent",null),n([l()],e.prototype,"tileInfo",void 0),n([l({readOnly:!0})],e.prototype,"hasTilingEffects",null),n([l()],e.prototype,"datumTransformation",null),e=n([E("esri.views.layers.ImageryTileLayerView")],e),e};let m=class extends $(V(k(A(M)))){constructor(){super(...arguments),this.type="imagery-tile-3d",this.isAlignedMapTile=!0}initialize(){this.layer.increaseRasterJobHandlerUsage(),this.fullExtent==null&&this.addResolvingPromise(Promise.reject(new I("layerview:spatial-reference-incompatible","The layer extent cannot be projected to the view's spatial reference",{layer:this.layer})));const t=_(()=>{var e,r;return(r=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:r.tilingSchemeLocked}).then(()=>{const e=this.view.basemapTerrain.tilingScheme,r=this.layer.tileInfo,a=["png","png24","png32","jpg","mixed"].includes(r.format)&&e.compatibleWith(r);this.isAlignedMapTile=a;const i=a?r:e.toTileInfo();this.tileInfo=i,this._updatingHandles.add(()=>[this.layer.renderer,this.layer.interpolation,this.layer.bandIds,this.layer.multidimensionalDefinition,this.layer.multidimensionalSubset,this.layer.rasterFunction,this.timeExtent],()=>this.refresh())});this.addResolvingPromise(t)}destroy(){this.layer.decreaseRasterJobHandlerUsage(),this.view=null}get _blankTile(){const t=document.createElement("canvas"),e=t.getContext("2d"),[r,a]=this.tileInfo.size;return t.width=r,t.height=a,e.clearRect(0,0,r,a),e.getImageData(0,0,r,a)}get imageFormatIsOpaque(){return this.layer.tileInfo.format==="jpg"}get hasMixedImageFormats(){return this.layer.tileInfo.format==="mixed"}get dataLevelRange(){var a,i;const t=this.layer.tileInfo,e=(a=this.tileInfo.lodAt(0))==null?void 0:a.scale,r=(i=this.layer.tileInfo.lodAt(t.lods.length-1))==null?void 0:i.scale;return this.levelRangeFromScaleRange(e,r)}_getfullExtent(){var t;return v(this.layer.rasterInfo,((t=this.view.basemapTerrain)==null?void 0:t.spatialReference)!=null?this.view.basemapTerrain.spatialReference:this.view.spatialReference)}async fetchTile(t,e,r,a){const i=this.tileInfo,h=this._canSymbolizeInWebGL(),y={tileInfo:i,requestRawData:h,signal:a.signal,timeExtent:this.timeExtent,requestAsImageElement:this.isAlignedMapTile},o=await this.layer.fetchTile(t,e,r,y);if(o instanceof HTMLImageElement)return o;let p=o==null?void 0:o.pixelBlock;if(p==null)return this._blankTile;if(!h&&(p=await this.layer.applyRenderer(o),p==null))return this._blankTile;const s=new j([t,e,r],p,i.size[0],i.size[1]);return h?(s.symbolizerRenderer=this.layer.symbolizer.rendererJSON,s.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(t)),s.transformGrid=o.transformGrid):s.isRendereredSource=!0,s.interpolation=this.layer.interpolation,s.bandIds=this.layer.bandIds,s}_getSymbolizerOptions(t){var r;const e=this.tileInfo.lodAt(t).resolution;return{pixelBlock:null,isGCS:((r=this.view.basemapTerrain)==null?void 0:r.spatialReference)!=null?this.view.basemapTerrain.spatialReference.isGeographic:this.view.spatialReference.isGeographic,resolution:{x:e,y:e},bandIds:this.layer.bandIds}}ensureSymbolizerParameters(t){this._canSymbolizeInWebGL()&&JSON.stringify(t.symbolizerRenderer)!==JSON.stringify(this.layer.symbolizer.rendererJSON)&&(t.symbolizerParameters=this.layer.symbolizer.generateWebGLParameters(this._getSymbolizerOptions(t.lij[0])))}createFetchPopupFeaturesQueryGeometry(t,e){return W(t,e,this.view)}refresh(){this.emit("data-changed")}async doRefresh(){this.suspended||this.emit("data-changed")}_canSymbolizeInWebGL(){var i,h;const t=F("3d"),{symbolizer:e}=this.layer,r=(h=(i=e.lookup)==null?void 0:i.colormapLut)==null?void 0:h.indexedColormap,a=r&&r.length>4*(t.maxTextureSize||4906);return t.supportsTextureFloat&&e.canRenderInWebGL&&!a}};n([l({readOnly:!0})],m.prototype,"_blankTile",null),n([l({readOnly:!0})],m.prototype,"imageFormatIsOpaque",null),n([l({readOnly:!0})],m.prototype,"hasMixedImageFormats",null),n([l({readOnly:!0})],m.prototype,"dataLevelRange",null),m=n([E("esri.views.3d.layers.ImageryTileLayerView3D")],m);const U=m;export{U as default}; diff --git a/dist/assets/IntegratedMeshLayer-T6vTIezB.js b/dist/assets/IntegratedMeshLayer-T6vTIezB.js new file mode 100644 index 0000000..737fa51 --- /dev/null +++ b/dist/assets/IntegratedMeshLayer-T6vTIezB.js @@ -0,0 +1 @@ +import{iB as w,V as T,bV as _,bW as O,e as s,y as r,c as f,iO as I,em as $,dM as L,dN as x,dO as b,dP as M,en as N,fl as j,C as A,hh as E,dQ as P,iP as h,E as d,iQ as m,iR as V,Z as u,iS as D,ip as J,iq as U,ir as K,is as R,eb as C,dt as z,iH as H,c7 as Q}from"./index-J0iiHjMT.js";import{f as l}from"./SceneModification-dyp2M_Yg.js";var a;let n=a=class extends w(T.ofType(l)){constructor(e){super(e),this.url=null}clone(){return new a({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const o=new a;for(const p of e)o.add(l.fromJSON(p,t));return o}static async fromUrl(e,t,o){const p={url:_(e),origin:"service"},g=await O(e,{responseType:"json",signal:o==null?void 0:o.signal}),S=t.toJSON(),y=[];for(const c of g.data)y.push(l.fromJSON({...c,geometry:{...c.geometry,spatialReference:S}},p));return new a({url:e,items:y})}};s([r({type:String})],n.prototype,"url",void 0),n=a=s([f("esri.layers.support.SceneModifications")],n);const v=n;let i=class extends I($(L(x(b(M(N(Q))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.path=null}initialize(){this.addHandles(j(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,A))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:E(e,o),context:o}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e==null?void 0:e.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){P(o)}if(await this._fetchService(t),this._modificationsSource!=null){const o=await v.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",o,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(h.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(h.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new d("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";m(u.getLogger(this),V(t,"absolute-height",e)),m(u.getLogger(this),D(t,e))}};s([r({type:String,readOnly:!0})],i.prototype,"geometryType",void 0),s([r({type:["show","hide"]})],i.prototype,"listMode",void 0),s([r({type:["IntegratedMeshLayer"]})],i.prototype,"operationalLayerType",void 0),s([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),s([r({type:J,readOnly:!0})],i.prototype,"nodePages",void 0),s([r({type:[U],readOnly:!0})],i.prototype,"materialDefinitions",void 0),s([r({type:[K],readOnly:!0})],i.prototype,"textureSetDefinitions",void 0),s([r({type:[R],readOnly:!0})],i.prototype,"geometryDefinitions",void 0),s([r({readOnly:!0})],i.prototype,"serviceUpdateTimeStamp",void 0),s([r({type:v}),C({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],i.prototype,"modifications",void 0),s([z(["web-scene","portal-item"],"modifications")],i.prototype,"readModifications",null),s([r(H)],i.prototype,"elevationInfo",null),s([r({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),i=s([f("esri.layers.IntegratedMeshLayer")],i);const F=i;export{F as default}; diff --git a/dist/assets/IntegratedMeshLayerView3D-EW3nzBgf.js b/dist/assets/IntegratedMeshLayerView3D-EW3nzBgf.js new file mode 100644 index 0000000..4530c3f --- /dev/null +++ b/dist/assets/IntegratedMeshLayerView3D-EW3nzBgf.js @@ -0,0 +1 @@ +import{ft as n,P as p,S as m,e as i,y as e,fi as l,c as d}from"./index-J0iiHjMT.js";import{E as c}from"./I3SMeshView3D-OXYwZo0p.js";import{n as u}from"./LayerView3D-iOx2MD1g.js";import{u as h}from"./LayerView-efDufa6j.js";import"./I3SOverrides-5dCbMm3h.js";import"./I3SNode-5SPByfpU.js";import"./ReactiveSet-HLstcUcf.js";import"./meshFeatureSet-Mcou8mDC.js";import"./External-GV0jSEES.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureLayerView3D-t6NDkLO0.js";import"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./RefreshableLayerView-Pd4dLcWr.js";import"./SceneModification-dyp2M_Yg.js";import"./SceneLayerWorker-o7OZRrjZ.js";const g=.2;let r=class extends c(u(h)){constructor(){super(...arguments),this.type="integrated-mesh-3d",this._elevationContext="im",this._isIntegratedMesh=!0,this._supportsLabeling=!1,this.drapeTargetType=n.WithoutRasterImage}get i3slayer(){return this.layer}get updatingProgressValue(){var t;return((t=this._controller)==null?void 0:t.updatingProgress)??0}get lodFactor(){var t,o,a,s;return((s=(a=(o=(t=this.view)==null?void 0:t.qualitySettings)==null?void 0:o.sceneService)==null?void 0:a.integratedMesh)==null?void 0:s.lodFactor)??1}get progressiveLoadFactor(){return this.lodFactor>=1?g:1}get layerPopupEnabledAndHasTemplate(){return!1}initialize(){this._updatingHandles.add(()=>this.layer.modifications,()=>this._loadModifications(),p),this.view.basemapTerrain.overlayManager.registerDrapeTarget(this)}destroy(){this.view.basemapTerrain.overlayManager.unregisterDrapeTarget(this)}_createLayerGraphic(){const t=new m;return t.layer=this.layer,t.sourceLayer=this.layer,t}canResume(){return super.canResume()&&(!this._controller||this._controller.rootNodeVisible)}_loadModifications(){if(this.removeHandles("modifications"),this.layer.modifications==null)return void(this._modifications=[]);const t=this.layer.modifications;this.addHandles(this._updatingHandles.addOnCollectionChange(()=>t,()=>this._modifications=t.toArray(),p),"modifications")}};i([e()],r.prototype,"layer",void 0),i([e()],r.prototype,"i3slayer",null),i([e(l)],r.prototype,"updatingProgress",void 0),i([e()],r.prototype,"updatingProgressValue",null),i([e()],r.prototype,"lodFactor",null),i([e({readOnly:!0})],r.prototype,"progressiveLoadFactor",null),r=i([d("esri.views.3d.layers.SceneLayerView3D")],r);const rt=r;export{rt as default}; diff --git a/dist/assets/InteractiveAnalysisViewModel-RI-qFGDH.js b/dist/assets/InteractiveAnalysisViewModel-RI-qFGDH.js new file mode 100644 index 0000000..5e5700a --- /dev/null +++ b/dist/assets/InteractiveAnalysisViewModel-RI-qFGDH.js @@ -0,0 +1 @@ +import{e as n,y as a,c as w,d as h,C as _,A as u,a as l,b as c,w as p,s as V,f as d,g as v}from"./index-J0iiHjMT.js";import{n as O}from"./MeasurementWidgetContent-d8uX7Gw_.js";var r;(function(s){s[s.PENDING=0]="PENDING",s[s.WAIT_FOR_VIEW_READY=1]="WAIT_FOR_VIEW_READY",s[s.RUNNING=2]="RUNNING"})(r||(r={}));let t=class extends O{constructor(s={}){super(s),this.analysisView=null,this._reconnectViewTask=null,this._parentChangeFromReconnect=!1,this._startUserOperation=null;const i=s==null?void 0:s.analysis;i!=null?this.analysis=i:(this._set("analysis",this.constructAnalysis()),this._set("isAnalysisOwner",!0))}normalizeCtorArgs(s){const{analysis:i,...e}=s;return e}initialize(){this.addHandles([h(()=>{var s;return(s=this.analysis)==null?void 0:s.parent},s=>{this._parentChangeFromReconnect||s===this.view||this._set("isAnalysisOwner",!1);const i=!this._parentChangeFromReconnect;this._parentChangeFromReconnect=!1,i&&this._scheduleViewReconnect()},_),h(()=>({view:this.view,ready:this.view!=null&&this.view.ready,supported:this.supported}),({view:s},i)=>{const e=i==null?void 0:i.view;s!==e&&(this._startUserOperation=l(this._startUserOperation),this._disconnectFromView(e)),this._scheduleViewReconnect()},u),h(()=>this.analysis.isEditable,(s,i)=>{this.analysisView!=null&&(s&&!i&&this.tool==null?this.createTool():s||!i||this.tool==null||this.tool.active||this.removeTool())})])}destroy(){this._reconnectViewTask=l(this._reconnectViewTask),this._startUserOperation=l(this._startUserOperation),this.analysisView!=null&&(this.analysisView.visible=void 0),this._disconnectFromView(this.view),this.analysis!=null&&this.isAnalysisOwner&&(this.analysis.destroy(),this._set("analysis",null))}set analysis(s){s!==this._get("analysis")&&(this._startUserOperation=l(this._startUserOperation),this._disconnectFromView(this.view),this._setExternalAnalysis(s),this._scheduleViewReconnect())}get ready(){return this.analysisView!=null&&!this.connectingToView}get connectingToView(){return this._reconnectViewTask!=null}get isAnalysisOwner(){return this._get("isAnalysisOwner")}set visible(s){this._set("visible",s),this.analysisView!=null&&(this.analysisView.visible=s)}async start(){this.clear();const s={task:null,abort:null,state:r.PENDING},i=c(async e=>{s.state=r.WAIT_FOR_VIEW_READY,await p(()=>this.ready,e),s.state=r.RUNNING,this.createTool({interactive:!0})});return s.task=i,s.abort=()=>i.abort(),this._startUserOperation=s,i.promise}clear(){this._startUserOperation=l(this._startUserOperation),this.removeTool(),this.analysis.clear()}onConnectToAnalysisView(s){}onDisconnectFromAnalysisView(){}_scheduleViewReconnect(){this._reconnectViewTask=l(this._reconnectViewTask);const s=c(async i=>{try{await this._reconnectView(i)}catch(e){if(V(i),!d(e))return void this.logger.warn("Failed to use analysis in view model",e);throw e}finally{s===this._reconnectViewTask&&(this._reconnectViewTask=null)}});this._reconnectViewTask=s}async _reconnectView(s){const{view:i}=this,e=i!=null&&i.ready&&this.supported,o=this.analysis;if(this._startUserOperation=y(this._startUserOperation),this._disconnectFromView(i),e&&i!=null&&o!=null){if(this.isAnalysisOwner){if(o.parent!=null)return void this.logError("expected owned analysis to have null parent when connecting to view");this._parentChangeFromReconnect=!0,i.analyses.add(o)}this.analysisView=await i.whenAnalysisView(o),v(s)?this._startUserOperation=y(this._startUserOperation):(this.analysisView.visible=this.visible,this.onConnectToAnalysisView(this.analysisView),this.createTool())}}_disconnectFromView(s){this.removeTool(),s!=null&&this.isAnalysisOwner&&(this._parentChangeFromReconnect=!0,s.analyses.remove(this.analysis),this.analysis.clear()),this.analysisView=null,this.onDisconnectFromAnalysisView()}_setExternalAnalysis(s){this.analysisView==null||this.isAnalysisOwner||(this.analysisView.visible=!0),this.analysisView=null,this._set("isAnalysisOwner",!1),this._set("analysis",s),this._parentChangeFromReconnect=!1}get testInfo(){return{analysisView:this.analysisView}}};function y(s){return s!=null&&s.state>=r.RUNNING?(s.abort(),null):s}n([a({nonNullable:!0})],t.prototype,"analysis",null),n([a()],t.prototype,"analysisView",void 0),n([a()],t.prototype,"ready",null),n([a()],t.prototype,"connectingToView",null),n([a({readOnly:!0})],t.prototype,"isAnalysisOwner",null),n([a({type:Boolean,value:!0})],t.prototype,"visible",null),n([a()],t.prototype,"_reconnectViewTask",void 0),t=n([w("esri.widgets.support.InteractiveAnalysisViewModel")],t);export{t as u}; diff --git a/dist/assets/InteractiveToolBase-WDic4GPF.js b/dist/assets/InteractiveToolBase-WDic4GPF.js new file mode 100644 index 0000000..1eaec84 --- /dev/null +++ b/dist/assets/InteractiveToolBase-WDic4GPF.js @@ -0,0 +1 @@ +import{e3 as A,aO as g,kT as R,e1 as E,T,O as C,kU as F,ki as z,bm as _,an as O,bI as G,Y as P,V as I,e as u,p as $,kV as f,bH as D,Z as U,y as h,c as V}from"./index-J0iiHjMT.js";import{r as x}from"./drawUtils-woTYaREB.js";function W(a,t){let e=null,n=null;return i=>{if(i.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),e=null,n=null));const r={action:i.action,screenStart:i.start,screenEnd:i.screenPoint};i.action==="start"&&e==null&&(e=new y,n=new y,t(a,e,n,i.pointerType,r)),e!=null&&e.execute(r),i.action==="end"&&e!=null&&(e=null,n=null)}}function K(a,t){return a.events.on("drag",W(a,t))}function Q(a,t){const e=[a.x,a.y,a.z??0],n=t,i=[Math.cos(n),Math.sin(n)],r=Math.sqrt(i[0]*i[0]+i[1]*i[1]);if(r===0)return null;i[0]/=r,i[1]/=r;const l=o=>{const c=(o.x-e[0])*i[0]+(o.y-e[1])*i[1];o.x=e[0]+c*i[0],o.y=e[1]+c*i[1]};return o=>(l(o.mapStart),l(o.mapEnd),{...o,axis:i})}function k(a,t){let e=null;return n=>{if(n.action==="start"&&(e=q(a,n.mapStart.spatialReference,t)),e==null)return null;const i=n.mapEnd.x-n.mapStart.x,r=n.mapEnd.y-n.mapStart.y,l=n.mapEnd.z-n.mapStart.z;return e.move(i,r,l,n.action),{...n,translationX:i,translationY:r,translationZ:l}}}function S(a,t){return a==null?null:a.spatialReference.equals(t)?a.clone():E(a,t)}function q(a,t,e){const n=a.geometry,i=R(t);if(n==null)return null;if(n.type==="mesh")return H(a,n,i,e);const r=S(n,i),l=n.spatialReference;return r==null?null:{move:(o,c,d)=>{const p=x(r.clone(),o,c,d);p.spatialReference.equals(l)?a.geometry=p:a.geometry=E(p,l)}}}function H(a,t,e,n){if(t.vertexSpace.isRelative)return N(a,t,t.vertexSpace,e);if(!t.spatialReference.equals(e))return null;let i=0,r=0,l=0;return{move:(o,c,d)=>{const p=o-i,m=c-r,b=d-l;if(p||m||b){const w=new T(t.origin.x+p,t.origin.y+m,(t.origin.z??0)+b,t.origin.spatialReference);t.centerAt(w,{geographic:t.vertexSpace.isRelative?void 0:n===C.Global}),a.notifyGeometryChanged(),i=o,r=c,l=d}}}}function N(a,t,e,n){const i=S(e.getOriginPoint(t.spatialReference),n),r=t.spatialReference;return i==null?null:{move:(l,o,c,d)=>{const p=x(i.clone(),l,o,c);if(p.spatialReference.equals(r))e.setOriginFromPoint(p);else{const m=E(p,r);m!=null&&e.setOriginFromPoint(m)}if(e.isGeoreferenced)a.notifyGeometryChanged();else{const m=d==="end";a.notifyMeshTransformChanged(m?{action:F.UpdateFastLocalOrigin}:{})}}}}function tt(a,t=null,e){var l;let n=null;const i=t==null||(l=a.spatialReference)!=null&&l.equals(t)?o=>o:o=>o!=null?E(o,t):o,r={exclude:[],...e};return o=>{if(o.action==="start"&&(n=i(a.toMap(o.screenStart,r))),n==null)return null;const c=i(a.toMap(o.screenEnd,r));return c!=null?{...o,mapStart:n,mapEnd:c}:null}}function et(a,t){const e=a.map(n=>k(n,t)).filter(A);return n=>{const i=n.mapEnd.x-n.mapStart.x,r=n.mapEnd.y-n.mapStart.y,l=n.mapEnd.z-n.mapStart.z;return e.forEach(o=>o(n)),{...n,translationX:i,translationY:r,translationZ:l}}}function X(a,t){const e=new Map;for(const n of t)e.set(n,G(a[n]));return n=>(e.forEach((i,r)=>{a[r]=i}),n)}function Y(a){return a.geometry!=null&&a.geometry.type==="mesh"?Z(a,a.geometry):X(a,["geometry"])}function Z(a,t){var r;const{vertexSpace:e}=t;if(e.isGeoreferenced){const l=t.vertexAttributes.clonePositional();return o=>(t.vertexAttributes=l,a.notifyGeometryChanged(),o)}const n=z(e.origin),i=(r=t.transform)==null?void 0:r.clone();return l=>(t.transform=i,t.vertexSpace.origin=n,a.notifyMeshTransformChanged(),l)}function nt(a){const t=a.map(e=>Y(e)).filter(e=>e!=null);return e=>(t.forEach(n=>n(e)),e)}function at(){let a=0,t=0,e=0;return n=>{n.action==="start"&&(a=n.mapStart.x,t=n.mapStart.y,e=n.mapStart.z);const i=n.mapEnd.x-a,r=n.mapEnd.y-t,l=n.mapEnd.z-e;return a=n.mapEnd.x,t=n.mapEnd.y,e=n.mapEnd.z,{...n,mapDeltaX:i,mapDeltaY:r,mapDeltaZ:l,mapDeltaSpatialReference:n.mapStart.spatialReference}}}function it(){let a=0,t=0;return e=>{e.action==="start"&&(a=e.screenStart.x,t=e.screenStart.y);const n=e.screenEnd.x-a,i=e.screenEnd.y-t;return a=e.screenEnd.x,t=e.screenEnd.y,{...e,screenDeltaX:n,screenDeltaY:i}}}function rt(a,t){let e=null,n=0,i=0;return r=>{var d;if(r.action==="start"&&(e=(d=a.toScreen)==null?void 0:d.call(a,t),e!=null&&(e.x<0||e.x>a.width||e.y<0||e.y>a.height?e=null:(n=r.screenStart.x-e.x,i=r.screenStart.y-e.y))),e==null)return null;const l=_(r.screenEnd.x-n,0,a.width),o=_(r.screenEnd.y-i,0,a.height),c=P(l,o);return r.screenStart=e,r.screenEnd=c,r}}const L=()=>{};class y{constructor(){this.execute=L}next(t,e=new y){return t!=null&&(this.execute=n=>{const i=t(n);i!=null&&e.execute(i)}),e}}function ot(a,t,e=[]){if(a.type==="2d")return i=>i;let n=null;return i=>{i.action==="start"&&(n=a.toMap(i.screenStart,{exclude:e}),n!=null&&(n.z=g(n,a,t)));const r=a.toMap(i.screenEnd,{exclude:e});r!=null&&(r.z=g(r,a,t));const l=n!=null&&r!=null?{sceneStart:n,sceneEnd:r}:null;return{...i,scenePoints:l}}}function M(a,t,e){const n=t.elevationProvider.getElevation(a.x,a.y,a.z??0,a.spatialReference,"scene")??0,i=O(a);return i.z=n,i.hasZ=!0,i.z=g(i,t,e),i}function lt(a,t){if(a.type==="2d")return n=>n;let e=null;return n=>{n.action==="start"&&(e=M(n.mapStart,a,t));const i=M(n.mapEnd,a,t),r=e!=null&&i!=null?{sceneStart:e,sceneEnd:i}:null;return{...n,scenePoints:r}}}var v;(function(a){a[a.WhenToolEditable=0]="WhenToolEditable",a[a.WhenToolNotEditable=1]="WhenToolNotEditable",a[a.Always=2]="Always"})(v||(v={}));class j{constructor(){this._isToolEditable=!0,this._manipulators=new I,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(t){this._isToolEditable=t}get length(){return this._manipulators.length}add(t,e=v.WhenToolEditable){this.addMany([t],e)}addMany(t,e=v.WhenToolEditable){for(const n of t){const i={manipulator:n,visibilityPredicate:e,attached:!1};this._manipulators.add(i),this._attached&&this._updateManipulatorAttachment(i)}}remove(t){for(let e=0;e{this._detachManipulator(t)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(t=>{this._updateManipulatorAttachment(t)}),this._attached=!0}detach(){this._manipulators.forEach(t=>{this._detachManipulator(t)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:t})=>t.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(t,e){return this._manipulators.on(t,n=>{e(n)})}forEach(t){for(const e of this._manipulators.items)t(e)}some(t){return this._manipulators.items.some(t)}toArray(){const t=[];return this.forEach(e=>t.push(e.manipulator)),t}intersect(t,e){let n=null,i=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:r,attached:l})=>{if(!l||!r.interactive)return;const o=r.intersectionDistance(t,e);o!=null&&o{const v=S(l);v.featureSet.features=[];const h=l.featureSet.geometryType;r.set(h,v);const m=l.layerDefinition.objectIdField;h==="esriGeometryPoint"?P(n,m,l.featureSet.features):h==="esriGeometryPolyline"?P(c,m,l.featureSet.features):h==="esriGeometryPolygon"&&P(p,m,l.featureSet.features)}),e.groundOverlays&&e.groundOverlays.forEach(l=>{b.set(l.id,l)}),t.forEach(l=>{l.networkLinkIds.forEach(v=>{const h=ye(v,l.id,e.networkLinks);h&&s.push(h)})}),s.forEach(l=>{var v;if(l.featureInfos){l.points=S(r.get("esriGeometryPoint")),l.polylines=S(r.get("esriGeometryPolyline")),l.polygons=S(r.get("esriGeometryPolygon")),l.mapImages=[];for(const h of l.featureInfos)switch(h.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const m=d[h.type].get(h.id);m&&((v=l[ae[h.type]])==null||v.featureSet.features.push(m));break}case"GroundOverlay":{const m=b.get(h.id);m&&l.mapImages.push(m);break}}l.fullExtent=L([l])}});const u=L(s);return{folders:t,sublayers:s,extent:u}}function K(e,t,s,r){var p;const n=(p=W)==null?void 0:p.findCredential(e);e=z(e,{token:n==null?void 0:n.token});const c=J.kmlServiceUrl;return A(c,{query:{url:e,model:"simple",folders:"",refresh:s!==0||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:r})}function N(e,t,s=null,r=[]){const n=[],c={},p=t.sublayers,b=new Set(t.folders.map(d=>d.id));return p.forEach(d=>{var f;const u=new e;if(s?u.read(d,s):u.read(d),r.length&&b.has(u.id)&&(u.visible=r.includes(u.id)),c[d.id]=u,d.parentFolderId!=null&&d.parentFolderId!==-1){const l=c[d.parentFolderId];l.sublayers||(l.sublayers=[]),(f=l.sublayers)==null||f.unshift(u)}else n.unshift(u)}),n}function P(e,t,s){s.forEach(r=>{e.set(r.attributes[t],r)})}function ue(e,t){let s;return t.some(r=>r.id===e&&(s=r,!0)),s}function ye(e,t,s){const r=ue(e,s);return r&&(r.parentFolderId=t,r.networkLink=r),r}function L(e){var r,n,c,p,b,d;const t=M(E),s=M(E);for(const u of e){if((n=(r=u.polygons)==null?void 0:r.featureSet)!=null&&n.features)for(const f of u.polygons.featureSet.features)w(t,f.geometry),k(s,t);if((p=(c=u.polylines)==null?void 0:c.featureSet)!=null&&p.features)for(const f of u.polylines.featureSet.features)w(t,f.geometry),k(s,t);if((d=(b=u.points)==null?void 0:b.featureSet)!=null&&d.features)for(const f of u.points.featureSet.features)w(t,f.geometry),k(s,t);if(u.mapImages)for(const f of u.mapImages)w(t,f.extent),k(s,t)}return V(s,E)?void 0:{xmin:s[0],ymin:s[1],zmin:s[2],xmax:s[3],ymax:s[4],zmax:s[5],spatialReference:O.WGS84}}var x;let y=x=class extends B.EventedMixin(D(Q)){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([j(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},g),j(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},g),$(()=>this.sublayers,(t,s)=>{if(s)for(const r of s)r.layer=r.parent=null;if(t)for(const r of t)r.parent=this,r.layer=this.layer},g),$(()=>this.layer,t=>{if(this.sublayers)for(const s of this.sublayers)s.layer=t},g)])}initialize(){_(()=>this.networkLink).then(()=>_(()=>this.visible===!0)).then(()=>this.load())}load(e){var r;if(!this.networkLink||this.networkLink.viewFormat)return;const t=e!=null?e.signal:null,s=this._fetchService(((r=this._get("networkLink"))==null?void 0:r.href)??"",t).then(n=>{var b;const c=L(n.sublayers);this.fullExtent=F.fromJSON(c),this.sourceJSON=n;const p=H(G.ofType(x),N(x,n));this.sublayers?this.sublayers.addMany(p):this.sublayers=p,(b=this.layer)==null||b.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(s),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}_fetchService(e,t){return K(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(s=>T(s.data))}};i([o()],y.prototype,"description",void 0),i([o({type:F})],y.prototype,"fullExtent",void 0),i([o()],y.prototype,"id",void 0),i([o({readOnly:!0,value:null})],y.prototype,"networkLink",void 0),i([o({json:{write:{allowNull:!0}}})],y.prototype,"parent",void 0),i([o({type:G.ofType(y),json:{write:{allowNull:!0}}})],y.prototype,"sublayers",void 0),i([o({value:null,json:{read:{source:"name",reader:e=>q(e)}}})],y.prototype,"title",void 0),i([o({value:!0})],y.prototype,"visible",null),i([I("visible",["visibility"])],y.prototype,"readVisible",null),i([o()],y.prototype,"sourceJSON",void 0),i([o()],y.prototype,"layer",void 0),y=x=i([C("esri.layers.support.KMLSublayer")],y);const R=y,pe=["kml","xml"];let a=class extends U(X(Y(Z(ee(te(ne)))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new se({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.outSpatialReference=O.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([$(()=>this.sublayers,(e,t)=>{t&&t.forEach(s=>{s.parent=null,s.layer=null}),e&&e.forEach(s=>{s.parent=this,s.layer=this})},g),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,s){return N(R,t,s,this._visibleFolders)}writeSublayers(e,t){const s=[],r=e.toArray();for(;r.length;){const n=r[0];n.networkLink||(n.visible&&s.push(n.id),n.sublayers&&r.push(...n.sublayers.toArray())),r.shift()}t.visibleFolders=s}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?re(this.url,pe)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],s=r=>{r.visible&&(t.push(r),r.sublayers&&r.sublayers.forEach(s))};return e&&e.forEach(s),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(ie).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:K(this.url??"",this.outSpatialReference,this.refreshInterval,e)),s=T(t.data);s&&this.read(s,{origin:"service"})}_recomputeFullExtent(){let e=null;this.extent!=null&&(e=this.extent.clone());const t=s=>{if(s.sublayers)for(const r of s.sublayers.items)t(r),r.visible&&r.fullExtent&&(e!=null?e.union(r.fullExtent):e=r.fullExtent.clone())};return t(this),e}};i([o({readOnly:!0})],a.prototype,"allSublayers",void 0),i([o({type:O})],a.prototype,"outSpatialReference",void 0),i([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),i([o({readOnly:!0,json:{read:!1,write:!1}})],a.prototype,"legendEnabled",void 0),i([o({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),i([o({type:["KML"]})],a.prototype,"operationalLayerType",void 0),i([o({})],a.prototype,"resourceInfo",void 0),i([o({type:G.ofType(R),json:{write:{ignoreOrigin:!0}}})],a.prototype,"sublayers",void 0),i([I(["web-map","portal-item"],"sublayers",["visibleFolders"])],a.prototype,"readSublayersFromItemOrWebMap",null),i([I("service","sublayers",["sublayers"])],a.prototype,"readSublayers",null),i([le("sublayers")],a.prototype,"writeSublayers",null),i([o({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),i([o({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],a.prototype,"title",null),i([o(oe)],a.prototype,"url",void 0),i([o({readOnly:!0})],a.prototype,"visibleSublayers",null),i([o({type:F})],a.prototype,"extent",void 0),i([o()],a.prototype,"fullExtent",null),a=i([C("esri.layers.KMLLayer")],a);const he=a;export{he as default}; diff --git a/dist/assets/Laserlines.glsl-nvjcCsAw.js b/dist/assets/Laserlines.glsl-nvjcCsAw.js new file mode 100644 index 0000000..4866a69 --- /dev/null +++ b/dist/assets/Laserlines.glsl-nvjcCsAw.js @@ -0,0 +1,159 @@ +import{z9 as we,za as xe,xx as d,xI as P,yk as F,yH as y,xy as r,xz as ie,yF as B,w4 as Ve,hL as ne,bf as u,a9 as se,bA as Ee,xM as ae,de as re,xO as le,xP as oe,xQ as ce,yl as he,uY as R,xW as de,y0 as De,aa as c,h$ as ye,as as q,uS as Le,yS as Se,sN as Ce,uT as Me,uU as Re,aU as ue,e as f,xL as x,ya as Ae,aT as $e,pl as N,zb as Te,xF as C,aF as A,aQ as G,az as pe,h9 as m,aE as b,zc as ge,bh as Oe,aG as qe,at as _e,aV as ze,ou as Ie,kd as We,y8 as Ne,b1 as k,b0 as W,y6 as He,a$ as Ue,y as z,c as je,yN as Fe,O as X,lX as Q,zd as Be,ze as $,zf as Ge,tt as Y,s6 as ke,ba as Xe,wi as Qe,bc as Ye,bd as Je,be as Ke,zg as Ze,ki as J}from"./index-J0iiHjMT.js";import{t as et}from"./VisualElement-kjYXz27t.js";function fe(e,t){const n=e.fragment;n.include(we),e.include(xe),n.uniforms.add(new d("globalAlpha",i=>i.globalAlpha),new P("glowColor",i=>i.glowColor),new d("glowWidth",(i,s)=>i.glowWidth*s.camera.pixelRatio),new d("glowFalloff",i=>i.glowFalloff),new P("innerColor",i=>i.innerColor),new d("innerWidth",(i,s)=>i.innerWidth*s.camera.pixelRatio),new F("depthMap",(i,s)=>{var a;return(a=s.linearDepth)==null?void 0:a.colorTexture}),new y("nearFar",(i,s)=>s.camera.nearFar),new F("frameColor",(i,s)=>s.mainColor)),n.code.add(r`vec4 blendPremultiplied(vec4 source, vec4 dest) { +float oneMinusSourceAlpha = 1.0 - source.a; +return vec4( +source.rgb + dest.rgb * oneMinusSourceAlpha, +source.a + dest.a * oneMinusSourceAlpha +); +}`),n.code.add(r`vec4 premultipliedColor(vec3 rgb, float alpha) { +return vec4(rgb * alpha, alpha); +}`),n.code.add(r`vec4 laserlineProfile(float dist) { +if (dist > glowWidth) { +return vec4(0.0); +} +float innerAlpha = (1.0 - smoothstep(0.0, innerWidth, dist)); +float glowAlpha = pow(max(0.0, 1.0 - dist / glowWidth), glowFalloff); +return blendPremultiplied( +premultipliedColor(innerColor, innerAlpha), +premultipliedColor(glowColor, glowAlpha) +); +}`),n.code.add(r`bool laserlineReconstructFromDepth(out vec3 pos, out vec3 normal, out float depthDiscontinuityAlpha) { +float depth = linearDepthFromTexture(depthMap, uv, nearFar); +if (-depth == nearFar[0]) { +return false; +} +pos = reconstructPosition(gl_FragCoord.xy, depth); +normal = normalize(cross(dFdx(pos), dFdy(pos))); +float ddepth = fwidth(depth); +depthDiscontinuityAlpha = 1.0 - smoothstep(0.0, 0.01, -ddepth / depth); +return true; +}`),t.contrastControlEnabled?(n.uniforms.add(new d("globalAlphaContrastBoost",i=>i.globalAlphaContrastBoost!=null?i.globalAlphaContrastBoost:1)),n.code.add(r`float rgbToLuminance(vec3 color) { +return dot(vec3(0.2126, 0.7152, 0.0722), color); +} +vec4 laserlineOutput(vec4 color) { +float backgroundLuminance = rgbToLuminance(texture(frameColor, uv).rgb); +float alpha = clamp(globalAlpha * max(backgroundLuminance * globalAlphaContrastBoost, 1.0), 0.0, 1.0); +return color * alpha; +}`)):n.code.add(r`vec4 laserlineOutput(vec4 color) { +return color * globalAlpha; +}`)}function Pe(e){const t=new ie;t.include(fe,e);const{vertex:n,fragment:i}=t;return n.uniforms.add(new B("modelView",(s,a)=>Ve(it,a.camera.viewMatrix,s.origin)),new B("proj",(s,a)=>a.camera.projectionMatrix),new d("glowWidth",(s,a)=>s.glowWidth*a.camera.pixelRatio),new y("pixelToNDC",(s,a)=>ne(tt,2/a.camera.fullViewport[2],2/a.camera.fullViewport[3]))),t.attributes.add(u.START,"vec3"),t.attributes.add(u.END,"vec3"),t.attributes.add(u.UP,"vec3"),t.attributes.add(u.EXTRUDE,"vec2"),t.varyings.add("uv","vec2"),t.varyings.add("vViewStart","vec3"),t.varyings.add("vViewEnd","vec3"),t.varyings.add("vViewPlane","vec4"),n.code.add(r`void main() { +vec3 pos = mix(start, end, extrude.x); +vec4 viewPos = modelView * vec4(pos, 1); +vec4 projPos = proj * viewPos; +vec2 ndcPos = projPos.xy / projPos.w; +vec3 viewUp = (modelView * vec4(extrude.y * up, 0)).xyz; +vec4 projPosUp = proj * vec4(viewPos.xyz + viewUp, 1); +vec2 projExtrudeDir = normalize(projPosUp.xy / projPosUp.w - ndcPos); +vec2 lxy = abs(sign(projExtrudeDir) - ndcPos); +ndcPos += length(lxy) * projExtrudeDir; +vec3 worldPlaneNormal = normalize(cross(up, normalize(end - start))); +vec3 viewPlaneNormal = (modelView * vec4(worldPlaneNormal, 0)).xyz; +vViewStart = (modelView * vec4(start, 1)).xyz; +vViewEnd = (modelView * vec4(end, 1)).xyz; +vViewPlane = vec4(viewPlaneNormal, -dot(viewPlaneNormal, vViewStart)); +float xPaddingPixels = sign(dot(viewPlaneNormal, viewPos.xyz)) * (extrude.x * 2.0 - 1.0) * glowWidth; +ndcPos.x += xPaddingPixels * pixelToNDC.x; +uv = ndcPos * 0.5 + 0.5; +gl_Position = vec4(ndcPos, 0, 1); +}`),i.uniforms.add(new d("perScreenPixelRatio",(s,a)=>a.camera.perScreenPixelRatio)),i.code.add(r`float planeDistancePixels(vec4 plane, vec3 pos, vec3 start, vec3 end) { +vec3 origin = mix(start, end, 0.5); +vec3 basis = end - origin; +vec3 posAtOrigin = pos - origin; +float x = dot(normalize(basis), posAtOrigin); +float y = dot(plane.xyz, posAtOrigin); +float dx = max(abs(x) - length(basis), 0.0); +float dy = y; +float dist = length(vec2(dx, dy)); +float width = fwidth(y); +float maxPixelDistance = length(pos) * perScreenPixelRatio * 2.0; +float pixelDist = dist / min(width, maxPixelDistance); +return abs(pixelDist); +} +void main() { +vec3 pos; +vec3 normal; +float depthDiscontinuityAlpha; +vec3 dEndStart = vViewEnd - vViewStart; +if (dot(dEndStart, dEndStart) < 1e-5) { +discard; +} +if (!laserlineReconstructFromDepth(pos, normal, depthDiscontinuityAlpha)) { +discard; +} +float distance = planeDistancePixels(vViewPlane, pos, vViewStart, vViewEnd); +vec4 color = laserlineProfile(distance); +float alpha = 1.0 - smoothstep(0.995, 0.999, abs(dot(normal, vViewPlane.xyz))); +fragColor = laserlineOutput(color * alpha * depthDiscontinuityAlpha); +}`),t}const tt=se(),it=Ee(),nt=Object.freeze(Object.defineProperty({__proto__:null,build:Pe},Symbol.toStringTag,{value:"Module"}));class T extends le{initializeProgram(t){return new oe(t.rctx,T.shader.get().build(this.configuration),me)}initializePipeline(){return ce({blending:he(R.ONE,R.ONE_MINUS_SRC_ALPHA),colorWrite:de})}}T.shader=new ae(nt,()=>re(()=>Promise.resolve().then(()=>_t),void 0));const me=new Map([[u.START,0],[u.END,1],[u.UP,2],[u.EXTRUDE,3]]);let K=class{constructor(t){this._renderCoordsHelper=t,this._buffers=null,this._origin=c(),this._dirty=!1,this._count=0,this._vao=null}set vertices(t){const n=ye(3*t.length);let i=0;for(const s of t)n[i++]=s[0],n[i++]=s[1],n[i++]=s[2];this.buffers=[n]}set buffers(t){if(this._buffers=t,this._buffers.length>0){const n=this._buffers[0],i=3*Math.floor(n.length/3/2);q(this._origin,n[i],n[i+1],n[i+2])}else q(this._origin,0,0,0);this._dirty=!0}get origin(){return this._origin}draw(t){const n=this._ensureVAO(t);n!=null&&(t.bindVAO(n),t.drawArrays(Le.TRIANGLES,0,this._count))}dispose(){this._vao!=null&&this._vao.dispose()}_ensureVAO(t){return this._buffers==null?null:(this._vao==null&&(this._vao=this._createVAO(t,this._buffers)),this._ensureVertexData(this._vao,this._buffers),this._vao)}_createVAO(t,n){const i=this._createDataBuffer(n);return this._dirty=!1,new Se(t,me,{data:Ce(ee)},{data:Me.createVertex(t,Re.STATIC_DRAW,i)})}_ensureVertexData(t,n){var s;if(!this._dirty)return;const i=this._createDataBuffer(n);(s=t.vertexBuffers.data)==null||s.setData(i),this._dirty=!1}_numberOfRenderVertices(t){return 3*(2*(t.length/3-1))}_createDataBuffer(t){const n=t.reduce((g,p)=>g+this._numberOfRenderVertices(p),0);this._count=n;const i=ee.createBuffer(n),s=this._origin;let a=0,l=0;for(const g of t){for(let p=0;p0){i.up.setVec(o-2,w),i.up.setVec(o-4,w),i.up.setVec(o-5,w);for(let v=-6;v<0;v++)i.end.setVec(o+v,j)}}a+=this._numberOfRenderVertices(g)}return i.buffer}};const st=c(),Z=c(),ee=De().vec3f(u.START).vec3f(u.END).vec3f(u.UP).vec2f(u.EXTRUDE);class H extends Ae{constructor(){super(...arguments),this.contrastControlEnabled=!1}}f([x()],H.prototype,"contrastControlEnabled",void 0);const U=N(6);function be(e){const t=new ie;t.include(Te),t.include(fe,e);const n=t.fragment;if(e.lineVerticalPlaneEnabled||e.heightManifoldEnabled)if(n.uniforms.add(new d("maxPixelDistance",(i,s)=>e.heightManifoldEnabled?2*s.camera.computeScreenPixelSizeAt(i.heightManifoldTarget):2*s.camera.computeScreenPixelSizeAt(i.lineVerticalPlaneSegment.origin))),n.code.add(r`float planeDistancePixels(vec4 plane, vec3 pos) { +float dist = dot(plane.xyz, pos) + plane.w; +float width = fwidth(dist); +dist /= min(width, maxPixelDistance); +return abs(dist); +}`),e.spherical){const i=(a,l,g)=>m(a,l.heightManifoldTarget,g.camera.viewMatrix),s=(a,l)=>m(a,[0,0,0],l.camera.viewMatrix);n.uniforms.add(new C("heightManifoldOrigin",(a,l)=>(i(_,a,l),s(V,l),ue(V,V,_),A(h,V),h[3]=G(V),h)),new P("globalOrigin",(a,l)=>s(_,l)),new d("cosSphericalAngleThreshold",(a,l)=>1-Math.max(2,pe(l.camera.eye,a.heightManifoldTarget)*l.camera.perRenderPixelRatio)/G(a.heightManifoldTarget))),n.code.add(r`float globeDistancePixels(float posInGlobalOriginLength) { +float dist = abs(posInGlobalOriginLength - heightManifoldOrigin.w); +float width = fwidth(dist); +dist /= min(width, maxPixelDistance); +return abs(dist); +} +float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) { +vec3 posInGlobalOriginNorm = normalize(globalOrigin - pos); +float cosAngle = dot(posInGlobalOriginNorm, heightManifoldOrigin.xyz); +vec3 posInGlobalOrigin = globalOrigin - pos; +float posInGlobalOriginLength = length(posInGlobalOrigin); +float sphericalDistance = globeDistancePixels(posInGlobalOriginLength); +float planarDistance = planeDistancePixels(heightPlane, pos); +return cosAngle < cosSphericalAngleThreshold ? sphericalDistance : planarDistance; +}`)}else n.code.add(r`float heightManifoldDistancePixels(vec4 heightPlane, vec3 pos) { +return planeDistancePixels(heightPlane, pos); +}`);if(e.pointDistanceEnabled&&(n.uniforms.add(new d("maxPixelDistance",(i,s)=>2*s.camera.computeScreenPixelSizeAt(i.pointDistanceTarget))),n.code.add(r`float sphereDistancePixels(vec4 sphere, vec3 pos) { +float dist = distance(sphere.xyz, pos) - sphere.w; +float width = fwidth(dist); +dist /= min(width, maxPixelDistance); +return abs(dist); +}`)),e.intersectsLineEnabled&&(n.uniforms.add(new d("perScreenPixelRatio",(i,s)=>s.camera.perScreenPixelRatio)),n.code.add(r`float lineDistancePixels(vec3 start, vec3 dir, float radius, vec3 pos) { +float dist = length(cross(dir, pos - start)) / (length(pos) * perScreenPixelRatio); +return abs(dist) - radius; +}`)),(e.lineVerticalPlaneEnabled||e.intersectsLineEnabled)&&n.code.add(r`bool pointIsWithinLine(vec3 pos, vec3 start, vec3 end) { +vec3 dir = end - start; +float t2 = dot(dir, pos - start); +float l2 = dot(dir, dir); +return t2 >= 0.0 && t2 <= l2; +}`),n.code.add(r`void main() { +vec3 pos; +vec3 normal; +float depthDiscontinuityAlpha; +if (!laserlineReconstructFromDepth(pos, normal, depthDiscontinuityAlpha)) { +discard; +} +vec4 color = vec4(0, 0, 0, 0);`),e.heightManifoldEnabled){n.uniforms.add(new y("angleCutoff",s=>M(s)),new C("heightPlane",(s,a)=>ve(s.heightManifoldTarget,s.renderCoordsHelper.worldUpAtPosition(s.heightManifoldTarget,_),a.camera.viewMatrix)));const i=e.spherical?r`normalize(globalOrigin - pos)`:r`heightPlane.xyz`;n.code.add(r` + { + float heightManifoldAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, ${i}))); + vec4 heightManifoldColor = laserlineProfile(heightManifoldDistancePixels(heightPlane, pos)); + color = max(color, heightManifoldColor * heightManifoldAlpha); + } + `)}return e.pointDistanceEnabled&&(n.uniforms.add(new y("angleCutoff",i=>M(i)),new C("pointDistanceSphere",(i,s)=>at(i,s))),n.code.add(r`{ +float pointDistanceSphereDistance = sphereDistancePixels(pointDistanceSphere, pos); +vec4 pointDistanceSphereColor = laserlineProfile(pointDistanceSphereDistance); +float pointDistanceSphereAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, normalize(pos - pointDistanceSphere.xyz)))); +color = max(color, pointDistanceSphereColor * pointDistanceSphereAlpha); +}`)),e.lineVerticalPlaneEnabled&&(n.uniforms.add(new y("angleCutoff",i=>M(i)),new C("lineVerticalPlane",(i,s)=>rt(i,s)),new P("lineVerticalStart",(i,s)=>lt(i,s)),new P("lineVerticalEnd",(i,s)=>ot(i,s))),n.code.add(r`{ +if (pointIsWithinLine(pos, lineVerticalStart, lineVerticalEnd)) { +float lineVerticalDistance = planeDistancePixels(lineVerticalPlane, pos); +vec4 lineVerticalColor = laserlineProfile(lineVerticalDistance); +float lineVerticalAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, abs(dot(normal, lineVerticalPlane.xyz))); +color = max(color, lineVerticalColor * lineVerticalAlpha); +} +}`)),e.intersectsLineEnabled&&(n.uniforms.add(new y("angleCutoff",i=>M(i)),new P("intersectsLineStart",(i,s)=>m(_,i.lineStartWorld,s.camera.viewMatrix)),new P("intersectsLineEnd",(i,s)=>m(_,i.lineEndWorld,s.camera.viewMatrix)),new P("intersectsLineDirection",(i,s)=>(b(h,i.intersectsLineSegment.vector),h[3]=0,A(_,ge(h,h,s.camera.viewMatrix)))),new d("intersectsLineRadius",i=>i.intersectsLineRadius)),n.code.add(r`{ +if (pointIsWithinLine(pos, intersectsLineStart, intersectsLineEnd)) { +float intersectsLineDistance = lineDistancePixels(intersectsLineStart, intersectsLineDirection, intersectsLineRadius, pos); +vec4 intersectsLineColor = laserlineProfile(intersectsLineDistance); +float intersectsLineAlpha = 1.0 - smoothstep(angleCutoff.x, angleCutoff.y, 1.0 - abs(dot(normal, intersectsLineDirection))); +color = max(color, intersectsLineColor * intersectsLineAlpha); +} +}`)),n.code.add(r`fragColor = laserlineOutput(color * depthDiscontinuityAlpha); +}`),t}function M(e){return ne(ct,Math.cos(e.angleCutoff),Math.cos(Math.max(0,e.angleCutoff-N(2))))}function at(e,t){return m(I,e.pointDistanceOrigin,t.camera.viewMatrix),I[3]=pe(e.pointDistanceOrigin,e.pointDistanceTarget),I}function rt(e,t){const n=Oe(e.lineVerticalPlaneSegment,.5,_),i=e.renderCoordsHelper.worldUpAtPosition(n,ht),s=A(V,e.lineVerticalPlaneSegment.vector),a=qe(h,i,s);return A(a,a),ve(e.lineVerticalPlaneSegment.origin,a,t.camera.viewMatrix)}function lt(e,t){const n=b(_,e.lineVerticalPlaneSegment.origin);return e.renderCoordsHelper.setAltitude(n,0),m(n,n,t.camera.viewMatrix)}function ot(e,t){const n=_e(_,e.lineVerticalPlaneSegment.origin,e.lineVerticalPlaneSegment.vector);return e.renderCoordsHelper.setAltitude(n,0),m(n,n,t.camera.viewMatrix)}function ve(e,t,n){return m(te,e,n),b(h,t),h[3]=0,ge(h,h,n),ze(te,h,dt)}const ct=se(),_=c(),h=Ie(),ht=c(),V=c(),te=c(),dt=$e(),I=We(),ut=Object.freeze(Object.defineProperty({__proto__:null,build:be,defaultAngleCutoff:U},Symbol.toStringTag,{value:"Module"}));class pt extends Ne{constructor(){super(...arguments),this.innerColor=k(1,1,1),this.innerWidth=1,this.glowColor=k(1,.5,0),this.glowWidth=8,this.glowFalloff=8,this.globalAlpha=.75,this.globalAlphaContrastBoost=2,this.angleCutoff=N(6),this.pointDistanceOrigin=c(),this.pointDistanceTarget=c(),this.lineVerticalPlaneSegment=W(),this.intersectsLineSegment=W(),this.intersectsLineRadius=3,this.heightManifoldTarget=c(),this.lineStartWorld=c(),this.lineEndWorld=c()}}class O extends le{initializeProgram(t){return new oe(t.rctx,O.shader.get().build(this.configuration),He)}initializePipeline(){return ce({blending:he(R.ONE,R.ONE_MINUS_SRC_ALPHA),colorWrite:de})}}O.shader=new ae(ut,()=>re(()=>Promise.resolve().then(()=>ft),void 0));class E extends H{constructor(){super(...arguments),this.heightManifoldEnabled=!1,this.pointDistanceEnabled=!1,this.lineVerticalPlaneEnabled=!1,this.intersectsLineEnabled=!1,this.spherical=!1}}f([x()],E.prototype,"heightManifoldEnabled",void 0),f([x()],E.prototype,"pointDistanceEnabled",void 0),f([x()],E.prototype,"lineVerticalPlaneEnabled",void 0),f([x()],E.prototype,"intersectsLineEnabled",void 0),f([x()],E.prototype,"spherical",void 0);let D=class extends Fe{constructor(e){super(e),this._technique=null,this._heightManifoldEnabled=!1,this._pointDistanceEnabled=!1,this._lineVerticalPlaneEnabled=!1,this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._viewingMode=X.Local,this._pathVerticalPlaneEnabled=!1,this._pathVerticalPlaneData=null,this._pathTechnique=null,this._passParameters=new pt,this.produces=new Map([[Q.LASERLINES,()=>!this.contrastControlEnabled],[Q.LASERLINES_CONTRAST_CONTROL,()=>this.contrastControlEnabled]])}initialize(){this._passParameters.renderCoordsHelper=this.renderCoordsHelper}consumes(){return Be}get isDecoration(){return this._isDecoration}get heightManifoldEnabled(){return this._heightManifoldEnabled}set heightManifoldEnabled(e){this._heightManifoldEnabled!==e&&(this._heightManifoldEnabled=e,this._requestRender())}get heightManifoldTarget(){return this._passParameters.heightManifoldTarget}set heightManifoldTarget(e){b(this._passParameters.heightManifoldTarget,e),this._requestRender()}get pointDistanceEnabled(){return this._pointDistanceEnabled}set pointDistanceEnabled(e){e!==this._pointDistanceEnabled&&(this._pointDistanceEnabled=e,this._requestRender())}get pointDistanceTarget(){return this._passParameters.pointDistanceTarget}set pointDistanceTarget(e){b(this._passParameters.pointDistanceTarget,e),this._requestRender()}get pointDistanceOrigin(){return this._passParameters.pointDistanceOrigin}set pointDistanceOrigin(e){b(this._passParameters.pointDistanceOrigin,e),this._requestRender()}get lineVerticalPlaneEnabled(){return this._lineVerticalPlaneEnabled}set lineVerticalPlaneEnabled(e){e!==this._lineVerticalPlaneEnabled&&(this._lineVerticalPlaneEnabled=e,this._requestRender())}get lineVerticalPlaneSegment(){return this._passParameters.lineVerticalPlaneSegment}set lineVerticalPlaneSegment(e){$(e,this._passParameters.lineVerticalPlaneSegment),this._requestRender()}get intersectsLineEnabled(){return this._intersectsLineEnabled}set intersectsLineEnabled(e){e!==this._intersectsLineEnabled&&(this._intersectsLineEnabled=e,this._requestRender())}get intersectsLineSegment(){return this._passParameters.intersectsLineSegment}set intersectsLineSegment(e){$(e,this._passParameters.intersectsLineSegment),this._requestRender()}get intersectsLineRadius(){return this._passParameters.intersectsLineRadius}set intersectsLineRadius(e){e!==this._passParameters.intersectsLineRadius&&(this._passParameters.intersectsLineRadius=e,this._requestRender())}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(e){e!==this._intersectsLineInfinite&&(this._intersectsLineInfinite=e,this._requestRender())}get viewingMode(){return this._viewingMode}set viewingMode(e){e!==this._viewingMode&&(this._viewingMode=e,this._requestRender())}get pathVerticalPlaneEnabled(){return this._pathVerticalPlaneEnabled}set pathVerticalPlaneEnabled(e){e!==this._pathVerticalPlaneEnabled&&(this._pathVerticalPlaneEnabled=e,this._pathVerticalPlaneData!=null&&this._requestRender())}set pathVerticalPlaneVertices(e){this._pathVerticalPlaneData==null&&(this._pathVerticalPlaneData=new K(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.vertices=e,this.pathVerticalPlaneEnabled&&this._requestRender()}set pathVerticalPlaneBuffers(e){this._pathVerticalPlaneData==null&&(this._pathVerticalPlaneData=new K(this._passParameters.renderCoordsHelper)),this._pathVerticalPlaneData.buffers=e,this.pathVerticalPlaneEnabled&&this._requestRender()}setParameters(e){Ge(this._passParameters,e)&&this._requestRender()}initializeRenderContext(e){this._context=e,this._techniqueRepository=e.techniqueRepository,this._techniqueConfig=new E;const t=new H;t.contrastControlEnabled=this.contrastControlEnabled,this._pathTechnique=this._techniqueRepository.acquire(T,t)}uninitializeRenderContext(){this._technique=Y(this._technique),this._pathVerticalPlaneData=ke(this._pathVerticalPlaneData),this._pathTechnique=Y(this._pathTechnique)}prepareTechnique(){return this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled?(this._techniqueConfig.heightManifoldEnabled=this.heightManifoldEnabled,this._techniqueConfig.lineVerticalPlaneEnabled=this.lineVerticalPlaneEnabled,this._techniqueConfig.pointDistanceEnabled=this.pointDistanceEnabled,this._techniqueConfig.intersectsLineEnabled=this.intersectsLineEnabled,this._techniqueConfig.contrastControlEnabled=this.contrastControlEnabled,this._techniqueConfig.spherical=this._viewingMode===X.Global,this._technique=this._techniqueRepository.releaseAndAcquire(O,this._techniqueConfig,this._technique),this._technique):this._pathTechnique}renderNode(e,t){(this.heightManifoldEnabled||this.pointDistanceEnabled||this.lineVerticalPlaneSegment||this.intersectsLineEnabled)&&this._renderUnified(e,t),this.pathVerticalPlaneEnabled&&this._renderPath(e)}_renderUnified(e,t){const n=e.rctx;this._updatePassParameters(e),n.bindTechnique(t,this._passParameters,e.bindParameters),n.screen.draw()}_renderPath(e){if(this._pathVerticalPlaneData==null||this._pathTechnique==null)return;const t=e.rctx,n=this._pathTechnique;t.bindTechnique(n,{...this._passParameters,origin:this._pathVerticalPlaneData.origin},e.bindParameters),this._pathVerticalPlaneData.draw(e.rctx)}_updatePassParameters(e){if(!this._intersectsLineEnabled)return;const t=e.bindParameters.camera;if(this._intersectsLineInfinite){if(Xe(Qe(this._passParameters.intersectsLineSegment.origin,this._passParameters.intersectsLineSegment.vector),L),L.c0=-Number.MAX_VALUE,!Ye(t.frustum,L))return;Je(L,this._passParameters.lineStartWorld),Ke(L,this._passParameters.lineEndWorld)}else b(this._passParameters.lineStartWorld,this._passParameters.intersectsLineSegment.origin),_e(this._passParameters.lineEndWorld,this._passParameters.intersectsLineSegment.origin,this._passParameters.intersectsLineSegment.vector)}_requestRender(){this._context&&this._context.requestRender()}get test(){return{passParameters:this._passParameters}}};f([z({constructOnly:!0})],D.prototype,"contrastControlEnabled",void 0),f([z({constructOnly:!0})],D.prototype,"_isDecoration",void 0),f([z({constructOnly:!0})],D.prototype,"renderCoordsHelper",void 0),D=f([je("esri.views.3d.support.LaserLineRenderer")],D);const L=Ue();class vt extends et{constructor(t){super(t),this._angleCutoff=U,this._style={},this._heightManifoldTarget=c(),this._heightManifoldEnabled=!1,this._intersectsLine=W(),this._intersectsLineEnabled=!1,this._intersectsLineInfinite=!1,this._lineVerticalPlaneSegment=null,this._pathVerticalPlaneBuffers=null,this._pointDistanceLine=null,this.applyProperties(t)}get testData(){return this._renderer}createResources(){this._ensureRenderer()}destroyResources(){this._disposeRenderer()}updateVisibility(){this._syncRenderer(),this._syncHeightManifold(),this._syncIntersectsLine(),this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance()}get angleCutoff(){return this._angleCutoff}set angleCutoff(t){this._angleCutoff!==t&&(this._angleCutoff=t,this._syncAngleCutoff())}get style(){return this._style}set style(t){this._style=t,this._syncStyle()}get heightManifoldTarget(){return this._heightManifoldEnabled?this._heightManifoldTarget:null}set heightManifoldTarget(t){t!=null?(b(this._heightManifoldTarget,t),this._heightManifoldEnabled=!0):this._heightManifoldEnabled=!1,this._syncRenderer(),this._syncHeightManifold()}set intersectsWorldUpAtLocation(t){if(t==null)return void(this.intersectsLine=null);const n=this.view.renderCoordsHelper.worldUpAtPosition(t,gt);this.intersectsLine=Ze(t,n),this.intersectsLineInfinite=!0}get intersectsLine(){return this._intersectsLineEnabled?this._intersectsLine:null}set intersectsLine(t){t!=null?($(t,this._intersectsLine),this._intersectsLineEnabled=!0):this._intersectsLineEnabled=!1,this._syncIntersectsLine(),this._syncRenderer()}get intersectsLineInfinite(){return this._intersectsLineInfinite}set intersectsLineInfinite(t){this._intersectsLineInfinite=t,this._syncIntersectsLineInfinite()}get lineVerticalPlaneSegment(){return this._lineVerticalPlaneSegment}set lineVerticalPlaneSegment(t){this._lineVerticalPlaneSegment=t!=null?$(t):null,this._syncLineVerticalPlane(),this._syncRenderer()}get pathVerticalPlane(){return this._pathVerticalPlaneBuffers}set pathVerticalPlane(t){this._pathVerticalPlaneBuffers=t,this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance(),this._syncRenderer()}get pointDistanceLine(){return this._pointDistanceLine}set pointDistanceLine(t){this._pointDistanceLine=t!=null?{origin:J(t.origin),target:t.target?J(t.target):null}:null,this._syncPointDistance(),this._syncRenderer()}_syncRenderer(){this.attached&&this.visible&&(this._intersectsLineEnabled||this._heightManifoldEnabled||this._pointDistanceLine!=null||this._pathVerticalPlaneBuffers!=null)?this._ensureRenderer():this._disposeRenderer()}_ensureRenderer(){this._renderer==null&&(this._renderer=new D({renderCoordsHelper:this.view.renderCoordsHelper,contrastControlEnabled:!0,_isDecoration:this.isDecoration}),this._renderer.viewingMode=this.view.state.viewingMode,this._syncStyle(),this._syncHeightManifold(),this._syncIntersectsLine(),this._syncIntersectsLineInfinite(),this._syncPathVerticalPlane(),this._syncLineVerticalPlane(),this._syncPointDistance(),this._syncAngleCutoff(),this.view._stage&&this.view._stage.addRenderPlugin(this._renderer))}_syncStyle(){this._renderer!=null&&(this._renderer.setParameters(this._style),this._style.intersectsLineRadius!=null&&(this._renderer.intersectsLineRadius=this._style.intersectsLineRadius))}_syncAngleCutoff(){this._renderer!=null&&this._renderer.setParameters({angleCutoff:this._angleCutoff})}_syncHeightManifold(){this._renderer!=null&&(this._renderer.heightManifoldEnabled=this._heightManifoldEnabled&&this.visible,this._heightManifoldEnabled&&(this._renderer.heightManifoldTarget=this._heightManifoldTarget))}_syncIntersectsLine(){this._renderer!=null&&(this._renderer.intersectsLineEnabled=this._intersectsLineEnabled&&this.visible,this._intersectsLineEnabled&&(this._renderer.intersectsLineSegment=this._intersectsLine))}_syncIntersectsLineInfinite(){this._renderer!=null&&(this._renderer.intersectsLineInfinite=this._intersectsLineInfinite)}_syncPathVerticalPlane(){this._renderer!=null&&(this._renderer.pathVerticalPlaneEnabled=this._pathVerticalPlaneBuffers!=null&&this.visible,this._pathVerticalPlaneBuffers!=null&&(this._renderer.pathVerticalPlaneBuffers=this._pathVerticalPlaneBuffers))}_syncLineVerticalPlane(){this._renderer!=null&&(this._renderer.lineVerticalPlaneEnabled=this._lineVerticalPlaneSegment!=null&&this.visible,this._lineVerticalPlaneSegment!=null&&(this._renderer.lineVerticalPlaneSegment=this._lineVerticalPlaneSegment))}_syncPointDistance(){if(this._renderer==null)return;const t=this._pointDistanceLine,n=t!=null;this._renderer.pointDistanceEnabled=n&&t.target!=null&&this.visible,n&&(this._renderer.pointDistanceOrigin=t.origin,t.target!=null&&(this._renderer.pointDistanceTarget=t.target))}_disposeRenderer(){this._renderer!=null&&this.view._stage&&(this.view._stage.removeRenderPlugin(this._renderer),this._renderer=null)}}const gt=c(),_t=Object.freeze(Object.defineProperty({__proto__:null,build:Pe},Symbol.toStringTag,{value:"Module"})),ft=Object.freeze(Object.defineProperty({__proto__:null,build:be,defaultAngleCutoff:U},Symbol.toStringTag,{value:"Module"}));export{vt as c}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/LayerView-efDufa6j.js b/dist/assets/LayerView-efDufa6j.js new file mode 100644 index 0000000..b50cae3 --- /dev/null +++ b/dist/assets/LayerView-efDufa6j.js @@ -0,0 +1 @@ +import{m as a,cZ as d,K as o,p,k as u,Z as y,n as h,e as i,y as s,c as g}from"./index-J0iiHjMT.js";let t=class extends a(d(o.EventedMixin(p))){constructor(e){super(e),this._updatingHandles=new u,this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{var n;if(e.name!=="layerview:create-error"){const r=this.layer&&this.layer.id||"no id",l=((n=this.layer)==null?void 0:n.title)||"no title";y.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${l}', id: '${r}')`,e)}})}destroy(){this._updatingHandles=h(this._updatingHandles)}get fullOpacity(){var e,n;return(((e=this.layer)==null?void 0:e.opacity)??1)*(((n=this.parent)==null?void 0:n.fullOpacity)??1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){var e;return!this.suspended&&((e=this.layer)==null?void 0:e.legendEnabled)===!0}get updating(){var e;return!(!((e=this._updatingHandles)!=null&&e.updating)&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return((e=this.layer)==null?void 0:e.visible)===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){var e,n,r;return this.visible&&((e=this.layer)==null?void 0:e.loaded)&&!((n=this.parent)!=null&&n.suspended)&&((r=this.view)==null?void 0:r.ready)||!1}getSuspendInfo(){var r,l;const e=(r=this.parent)!=null&&r.suspended?this.parent.suspendInfo:{};return(l=this.view)!=null&&l.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};i([s()],t.prototype,"fullOpacity",null),i([s()],t.prototype,"layer",void 0),i([s()],t.prototype,"parent",void 0),i([s({readOnly:!0})],t.prototype,"suspended",null),i([s({readOnly:!0})],t.prototype,"suspendInfo",null),i([s({readOnly:!0})],t.prototype,"legendEnabled",null),i([s({type:Boolean,readOnly:!0})],t.prototype,"updating",null),i([s({readOnly:!0})],t.prototype,"updatingProgress",null),i([s()],t.prototype,"visible",null),i([s()],t.prototype,"view",void 0),t=i([g("esri.views.layers.LayerView")],t);const c=t;export{c as u}; diff --git a/dist/assets/LayerView3D-iOx2MD1g.js b/dist/assets/LayerView3D-iOx2MD1g.js new file mode 100644 index 0000000..1320c1a --- /dev/null +++ b/dist/assets/LayerView3D-iOx2MD1g.js @@ -0,0 +1 @@ +import{e as a,y as l,c as r,cV as c,a2 as h,w as d,s as p,cW as u}from"./index-J0iiHjMT.js";const m=o=>{let t=class extends o{constructor(){super(...arguments),this.slicePlaneEnabled=!1,this.supportsHeightUnitConversion=!1}postscript(e){super.postscript(e),c(this.layer)&&this.addResolvingPromise(this._validateHeightModelInfo())}async _validateHeightModelInfo(){const e=new AbortController,s=e.signal;this.addHandles(h(()=>e.abort())),await d(()=>{var n;return(n=this.view.defaultsFromMap)==null?void 0:n.heightModelInfoReady},s),p(s);const i=u(this.layer,this.view.heightModelInfo,this.supportsHeightUnitConversion);if(i)throw i}canResume(){const e=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return super.canResume()&&(!(e!=null&&e.minScale)||!e.maxScale||e.minScale>=e.maxScale)}getSuspendInfo(){const e=super.getSuspendInfo(),s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return s&&s.minScale&&s.maxScale&&s.minScalel.normalize(p(e),0,!0))],t.prototype,"orientation",void 0),t=i([u("esri.analysis.LengthDimension")],t);const h=t;export{c as r,r as t,h as u}; diff --git a/dist/assets/LercWorker-e_UqPfL3.js b/dist/assets/LercWorker-e_UqPfL3.js new file mode 100644 index 0000000..be87499 --- /dev/null +++ b/dist/assets/LercWorker-e_UqPfL3.js @@ -0,0 +1 @@ +import{gl as Y}from"./index-J0iiHjMT.js";var A={};A.defaultNoDataValue=Y(-1/0),A.decode=function(i,t){var r=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=E(i,t.inputOffset||0,r),c=t.noDataValue!=null?Y(t.noDataValue):A.defaultNoDataValue,n=F(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),s={width:e.width,height:e.height,pixelData:n.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return n.resultMask&&(s.maskData=n.resultMask),t.returnEncodedMask&&e.mask&&(s.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(s.fileInfo=b(e,c),t.computeUsedBitDepths&&(s.fileInfo.bitDepths=D(e))),s};var F=function(i,t,r,e,c){var n,s,d=0,m=i.pixels.numBlocksX,x=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/x),p=2*i.maxZError;r=r||(i.mask?i.mask.bitset:null),n=new t(i.width*i.height),c&&r&&(s=new Uint8Array(i.width*i.height));for(var g,k,h=new Float32Array(y*v),M=0;M<=x;M++){var B=M!==x?v:i.height%x;if(B!==0)for(var I=0;I<=m;I++){var o=I!==m?y:i.width%m;if(o!==0){var P,a,f,w,l=M*i.width*v+I*y,U=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?P=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,h,i.pixels.maxValue),P=h),a=0):f=u.encoding===2?0:u.offset,r)for(k=0;k>3],w<<=7&l),g=0;g>3]),128&w?(s&&(s[l]=1),n[l++]=u.encoding<2?P[a++]:f):(s&&(s[l]=0),n[l++]=e),w<<=1;l+=U}else if(u.encoding<2)for(k=0;k0){var s=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(n=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,x=0;do{if(d>0)for(;d--;)s[x++]=n.getUint8(m++);else{var y=n.getUint8(m++);for(d=-d;d--;)s[x++]=y}d=n.getInt16(m,!0),m+=2}while(m0?1:0),k=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*k);for(var h=1e9,M=0,B=0;B3)throw"Invalid block encoding ("+a.encoding+")";if(a.encoding!==2){if(f!==0&&f!==2){if(f>>=6,a.offsetType=f,f===2)a.offset=n.getInt8(1),o++;else if(f===1)a.offset=n.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";a.offset=n.getFloat32(1,!0),o+=4}if(h=Math.min(a.offset,h),a.encoding===1)if(f=n.getUint8(o),o++,a.bitsPerPixel=63&f,f>>=6,a.numValidPixelsType=f,f===2)a.numValidPixels=n.getUint8(o),o++;else if(f===1)a.numValidPixels=n.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";a.numValidPixels=n.getUint32(o,!0),o+=4}}var w;if(t+=o,a.encoding!=3){if(a.encoding===0){var l=(e.pixels.numBytes-1)/4;if(l!==Math.floor(l))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*l),new Uint8Array(w).set(new Uint8Array(i,t,4*l));for(var U=new Float32Array(w),u=0;u=t)m=x>>>p-t&y,p-=t;else{var h=t-p;m=(x&y)<>>(p=32-h)}n[d]=me.maxDistance**2)return null;const o=this.view.renderCoordsHelper.fromRenderCoords(s,this.view.spatialReference),l=ue(n.normal);if(Ye(n))return new P({type:j.OBJECT,id:`${n.target.layerUid}/${n.target.nodeIndex}/${n.target.componentIndex}`,mapPoint:o,renderPoint:s,normal:l,ray:ie(t),graphic:null});if(Qe(n))return new P({type:j.TERRAIN,id:n.target.lij.slice(),mapPoint:o,renderPoint:s,normal:l,ray:ie(t),graphic:null});const d=Q(n,this.view);if(d!=null){const h=d.layer,c=d.sourceLayer;let u;return c&&c.type==="scene"?u=et(d,c.objectIdField):u=d.uid,new P({type:j.OBJECT,id:`${h==null?void 0:h.uid}/${u}`,mapPoint:o,renderPoint:s,normal:l,ray:ie(t),graphic:d})}return null}updateFromGroundIntersection(t,e,i){const n=Tt,s=It,o=Pt,l=Le;T(s,t),this.view.renderCoordsHelper.worldUpAtPosition(s,o),de(o,o);const d=this.view.basemapTerrain.visibleElevationBounds,h=(e>=0?1:-1)*((d?Math.abs(d.max-d.min):100)+Math.abs(e));z(l,o,h),F(n,s,l),ce(n,s,re);const c=this._getRayIntersection(re,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:h});if(c!=null){const u=Le;return z(u,o,e),F(i,c.renderPoint,u),ue(c.normal)}return T(i,t),null}};a([r()],G.prototype,"view",void 0),a([r()],G.prototype,"intersector",void 0),G=a([D("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],G);const Tt=_(),It=_(),Pt=_(),Le=_(),re=$e(),Ge="esri.views.3d.analysis.LineOfSight.LineOfSightController",Ve=he.getLogger(Ge);let y=class extends Ae.EventedMixin(k){constructor(t){super(t),this.updateOnCameraChange=!0,this._observerGroundOffsetRenderSpace=0,this._effectiveObserverElevationMode="absolute-height",this._observerFeatureId=null,this._updatingHandles=new ge,this._frameTask=ve,this._computationHandles=new te,this._externalObserverUpdate=!0}initialize(){var e;const t=(e=this.view.resourceController)==null?void 0:e.scheduler;this._frameTask=t?t.registerTask(W.LINE_OF_SIGHT_TOOL):ve,this._intersector=new G({view:this.view}),this.addHandles([this._connectObserver(),this._connectComputations(),this._connectTargets()])}destroy(){this._computationHandles.destroy(),this._computations.removeAll(),this._updatingHandles.destroy()}get updating(){return this._frameTask.updating||this._updatingHandles.updating}get priority(){return this._frameTask.priority}set priority(t){this._frameTask.priority=t}get _computations(){return this.analysisViewData.computations}get _elevationAlignedObserverPositionRenderSpace(){return this.analysisViewData.observerEngineLocation}set _elevationAlignedObserverPositionRenderSpace(t){this.analysisViewData.observerEngineLocation=t}get _screenPixelSize(){return this.view.state.camera.computeScreenPixelSizeAt(this._elevationAlignedObserverPositionRenderSpace)}_computeResult(t){const e=t.computation,{inputPoints:i,computationResult:n}=e,{observerAdjusted:s,targetAdjusted:o}=i,{start:l,end:d}=n;T(l,s),T(d,o),this._canCompute(e)?this._computeIntersection(t):this._interpolateIntersection(t),e.notifyResultChanged(),this.emit("result-changed",{target:t.computation.target,result:e.result})}_updateAdjustedPointsFromFeatures(t){const e=this.view,{sceneIntersectionHelper:i}=e,{inputPoints:n}=t,{observerAdjusted:s,observerFeatureId:o,targetFeatureId:l,targetAdjusted:d}=n;if(o==null&&l==null)return;const h=tt(s,d),c=this._intersector.intersector,u=ce(n.observer,n.target,Se);c.options.store=ee.ALL,i.intersectToolIntersectorRay(u,c);let g=null,p=null,C=null,b=null;for(const w of c.results.all){const m=Q(w,this.view);if(m==null||w.distanceInRenderSpace==null)continue;const L=ne(m);L!=null&&(o!=null&&L===o&&(g==null&&(g=this._getFeatureDistanceThreshold(w,e,h)),w.distanceInRenderSpace=I*x(h,c)}const L=new st(w,i.spatialReference);{const{result:I,target:R}=t;I!=null?(I.target=R,I.intersectedGraphic=m?null:Q(C,i),I.intersectedLocation=m?null:L,I.visible=m):t.result=new A({target:R,elevationAlignedTargetLocation:t.elevationAlignedTargetLocation,intersectedGraphic:m?null:Q(C,i),intersectedLocation:m?null:L,visible:m})}l.isValid=d.isValid=!0,l.isTargetVisible=m}_interpolateIntersection({computation:t,interpolationInfo:e}){const{computationResult:i,inputPoints:n}=t,{start:s,end:o,intersection:l}=i,{originalIntersection:d,originalObserver:h,originalTarget:c}=e;if(T(l,d),n.isValid){const u=K,g=x(h,d)/x(h,c);_e(u,s,h),z(u,u,1-g),F(l,l,u),_e(u,o,c),z(u,u,g),F(l,l,u),i.isValid=!0}else t.result=null,i.isValid=!1,i.isTargetVisible=!1}_canCompute(t){const e=this.analysisViewData.elevationAlignedObserver,i=this.view.frustum;if(e==null||t.elevationAlignedTargetLocation==null||i==null)return!1;const{observerAdjusted:n,targetAdjusted:s}=t.inputPoints,o=i.intersectsPoint(n),l=i.intersectsPoint(s);return o&&l}_onObserverPositionChange(t,e,i,n,s){if(this._externalObserverUpdate=s,t==null)return this.analysisViewData.elevationAlignedObserver=null,void(this._observerFeatureId=null);if(e==null)return Te(this.analysis,t.spatialReference,Ve),void(this.analysisViewData.elevationAlignedObserver=null);const o=this._getEffectiveElevationInfo(e,i),{absoluteZ:l,elevation:d}=me(e.x,e.y,e.z,this.view.spatialReference,this.view,o),h=e.clone();h.z=l,this._effectiveObserverElevationMode=o.mode,this.analysisViewData.elevationAlignedObserver=h;const c=_();this.view.renderCoordsHelper.toRenderCoords(h,c),this._elevationAlignedObserverPositionRenderSpace=c,this._observerGroundOffsetRenderSpace=l-d,this._observerFeatureId=ne(n),this.priority=W.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onObserverRenderSpacePositionChangeForComputation(t,e,i,n,s){const{inputPoints:o}=t;switch(T(o.observer,e),o.observerFeatureId=s,o.observerSurfaceNormal=null,n){case"on-the-ground":case"relative-to-ground":{const l=this._intersector.updateFromGroundIntersection(o.observer,i,o.observer);o.observerFeatureId==null&&(o.observerSurfaceNormal=l)}}this._adjustStartEndPositions(t),t.notifyInputPointsChanged(),this.priority=W.LINE_OF_SIGHT_TOOL_INTERACTIVE}_onTargetPositionChange(t,e,i,n,s,o=!0){const l=t.inputPoints;if(o&&(l.isValid=!1),i==null)return e!=null&&Te(this.analysis,e.spatialReference,Ve),t.elevationAlignedTargetLocation=null,void t.notifyInputPointsChanged();const d=this._getEffectiveElevationInfo(i,n),{absoluteZ:h,elevation:c}=me(i.x,i.y,i.z,this.view.spatialReference,this.view,d),u=i.clone();switch(u.z=h,t.elevationAlignedTargetLocation=u,this.view.renderCoordsHelper.toRenderCoords(t.elevationAlignedTargetLocation,l.target),l.targetFeatureId=ne(s),l.targetSurfaceNormal=null,d.mode){case"on-the-ground":case"relative-to-ground":{const g=this._intersector.updateFromGroundIntersection(l.target,h-c,l.target);l.targetFeatureId==null&&(l.targetSurfaceNormal=g)}}this._adjustStartEndPositions(t),t.notifyInputPointsChanged(),this.priority=W.LINE_OF_SIGHT_TOOL_INTERACTIVE}_connectComputationToTarget(t){return J([this._updatingHandles.add(()=>({computation:t,targetPosition:t.target.position,targetElevationInfo:t.target.elevationInfo,targetFeatureInfo:t.target.feature,projectedTargetPosition:Z(t.target.position,this.view.spatialReference)}),({computation:e,targetPosition:i,targetElevationInfo:n,targetFeatureInfo:s,projectedTargetPosition:o})=>{o.pending==null?this._onTargetPositionChange(e,i,o.geometry,n,s):this._updatingHandles.addPromise(o.pending)},S)])}_connectComputationToObserver(t){return this._updatingHandles.add(()=>({computation:t,observer:this.analysisViewData.elevationAlignedObserver}),({computation:e})=>{this._externalObserverUpdate&&(e.inputPoints.isValid=!1,e.notifyInputPointsChanged())},S)}_connectComputationToRenderSpaceObserver(t){return this._updatingHandles.add(()=>({computation:t,observer:this._elevationAlignedObserverPositionRenderSpace,observerGroundOffset:this._observerGroundOffsetRenderSpace,observerElevationMode:this._effectiveObserverElevationMode,observerFeatureId:this._observerFeatureId}),({computation:e,observer:i,observerGroundOffset:n,observerElevationMode:s,observerFeatureId:o})=>{this._onObserverRenderSpacePositionChangeForComputation(e,i,n,s,o)},S)}_connectComputationToCamera(t){return this._updatingHandles.add(()=>({camera:this.view.state.camera,isDirty:this._isCameraDirty}),({isDirty:e})=>{!this.updateOnCameraChange||t.inputPoints.isValid&&!e||t.notifyInputPointsChanged()})}_connectComputationToSlicePlane(t){return this._updatingHandles.add(()=>this.view.slicePlane,()=>{t.inputPoints.isValid=!1,t.notifyInputPointsChanged()})}_connectComputationToElevation(t){const e=(i,n)=>{const s=this.analysis.observer,o=t.target;let l=null,d=null,h=null,c=null,u=null,g=null;if((s==null?void 0:s.position)!=null){const p=Z(s.position,this.view.spatialReference);if(p.pending!=null)return this._updatingHandles.addPromise(p.pending),void p.pending.finally(()=>e(i,n));l=p.geometry,d=s.elevationInfo,h=s.feature}if(o.position!=null){const p=Z(o.position,this.view.spatialReference);if(p.pending!=null)return this._updatingHandles.addPromise(p.pending),void p.pending.finally(()=>e(i,n));c=p.geometry,u=o.elevationInfo,g=o.feature}l==null&&c==null||(lt(i,n,X,this.view.spatialReference),l!=null&&be(X,l)&&this._onObserverPositionChange(s!=null?s.position:null,l,d,h,!1),c!=null&&be(X,c)&&this._onTargetPositionChange(t,o.position,c,u,g,!1),l!=null&&c!=null&&ut(X,l,c)&&t.notifyInputPointsChanged())};return this.view.elevationProvider.on("elevation-change",i=>e(i.extent,i.spatialReference))}_connectComputationToTask(t){let e=null;const i={computation:t,interpolationInfo:{originalIntersection:_(),originalObserver:_(),originalTarget:_()}};return J([this._updatingHandles.add(()=>t.inputPoints,()=>{e=ye(e),e=at(async n=>{await ot(this._frameTask.schedule(()=>this._computeResult(i),n))})},{initial:!0,equals:()=>!1}),He(()=>e=ye(e))])}_connectComputation(t){const e=this._computationHandles;e.has(t)||e.add([this._connectComputationToTarget(t),this._connectComputationToObserver(t),this._connectComputationToRenderSpaceObserver(t),this._connectComputationToCamera(t),this._connectComputationToSlicePlane(t),this._connectComputationToElevation(t),this._connectComputationToTask(t)],t)}_disconnectComputation(t){this._computationHandles.remove(t)}_onComputationCollectionChange({added:t,removed:e}){for(const i of e)this._disconnectComputation(i);for(const i of t)this._connectComputation(i)}_onTargetCollectionChange({added:t,removed:e}){for(const i of e)this._removeTarget(i);for(const i of t)this._addTarget(i)}_onCursorTargetChange(t,e){e!=null&&this._removeTarget(e),t!=null&&this._addTarget(t)}_addTarget(t){this._computations.some(e=>e.target===t)||this._computations.add(new H({target:t}))}_removeTarget(t){const e=this._computations.findIndex(i=>i.target===t);this._computations.removeAt(e)}_connectObserver(){return J([this._updatingHandles.add(()=>({observerPosition:this.analysis.observer!=null?this.analysis.observer.position:null,projectedObserverPosition:Z(this.analysis.observer!=null?this.analysis.observer.position:null,this.view.spatialReference),observerElevationInfo:this.analysis.observer!=null?this.analysis.observer.elevationInfo:null,observerFeatureInfo:this.analysis.observer!=null?this.analysis.observer.feature:null}),({observerPosition:t,projectedObserverPosition:e,observerElevationInfo:i,observerFeatureInfo:n})=>{e.pending==null?this._onObserverPositionChange(t,e.geometry,i,n,!0):this._updatingHandles.addPromise(e.pending)},S)])}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this._computations,t=>this._onComputationCollectionChange(t),{initial:!0,final:!0})}_connectTargets(){return J([this._updatingHandles.addOnCollectionChange(()=>this.analysis.targets,t=>this._onTargetCollectionChange(t),{initial:!0,final:!0}),this._updatingHandles.add(()=>this.analysisViewData.cursorTarget,(t,e)=>{this._onCursorTargetChange(t,e)})])}get _isCameraDirty(){const t=this.analysisViewData.elevationAlignedObserver,{view:e}=this,{renderCoordsHelper:i}=e;if(t==null||i==null)return!1;const n=K;i.toRenderCoords(t,n);const s=e.state.camera.computeScreenPixelSizeAt(n);return Math.abs((s-this._screenPixelSize)/this._screenPixelSize)>Lt}_getEffectiveElevationInfo(t,e){return t.hasZ?e??{mode:"absolute-height",offset:0}:{mode:"on-the-ground",offset:0}}};a([r({constructOnly:!0})],y.prototype,"analysis",void 0),a([r({constructOnly:!0})],y.prototype,"analysisViewData",void 0),a([r({constructOnly:!0})],y.prototype,"view",void 0),a([r()],y.prototype,"updating",null),a([r()],y.prototype,"priority",null),a([r()],y.prototype,"updateOnCameraChange",void 0),a([r()],y.prototype,"_computations",null),a([r()],y.prototype,"_elevationAlignedObserverPositionRenderSpace",null),a([r()],y.prototype,"_observerGroundOffsetRenderSpace",void 0),a([r()],y.prototype,"_effectiveObserverElevationMode",void 0),a([r()],y.prototype,"_observerFeatureId",void 0),a([r()],y.prototype,"_screenPixelSize",null),a([r({readOnly:!0})],y.prototype,"_updatingHandles",void 0),a([r()],y.prototype,"_frameTask",void 0),a([r()],y.prototype,"_isCameraDirty",null),y=a([D(Ge)],y);const Lt=.1,K=_(),Se=$e(),X=rt(),Vt=.05;let St=class{constructor(){this.glowWidth=8,this.innerWidth=.75}};const Rt=new St;function Et(t){const e=t.accentColor;return{glowColor:e,innerColor:dt(e),globalAlpha:.75*e.a}}class $t{constructor(){this.size=.5}}const At=new $t;function Re(t){return ct(t.accentColor,.75)}class Ht{constructor(){this.size=.5,this.visibleColor=new v([3,252,111,.75]),this.occludedColor=new v([252,3,69,.75]),this.undefinedColor=new v([127,127,127,.75])}}const Dt=new Ht;let Mt=class{constructor(){this.innerWidth=2,this.outerWidth=8,this.visibleInnerColor=new v([3,252,111,1]),this.visibleOuterColor=new v([3,252,111,.15]),this.occludedInnerColor=new v([252,3,69,1]),this.occludedOuterColor=new v([252,3,69,.1]),this.undefinedInnerColor=new v([255,255,255,1]),this.undefinedOuterColor=new v([127,127,127,.2])}};const Y=new Mt;class kt extends ke{constructor(e,i){const n=xe(Re(e.effectiveTheme)),s=De(n,At.size,32,32),o=new ze(s);super({view:e,renderObjects:[o],metadata:i,elevationInfo:{mode:"absolute-height",offset:0}}),Fe(this),this.themeHandle=Me(()=>({color:Re(e.effectiveTheme)}),l=>{n.setParameters(l)})}destroy(){this.themeHandle.remove(),super.destroy()}}let xt=class extends ke{constructor(e,i){const{size:n,visibleColor:s,occludedColor:o,undefinedColor:l}=Dt;super({view:e,renderObjects:[le(n,s,U.Custom1),le(n,o,U.Custom2),le(n,l,U.Custom3)],metadata:i,elevationInfo:{mode:"absolute-height",offset:0}}),Fe(this)}};function le(t,e,i){return new ze(De(xe(v.toUnitRGBA(e)),t,32,32),i)}var M;(function(t){t.Ready="ready",t.Creating="creating",t.Created="created"})(M||(M={}));let O=class extends Ct{constructor(e){super(e),this.removeIncompleteOnCancel=!1,this.analysisViewData=null,this._latestPointerMovePointerType=null,this._laserlineVisualElement=null,this._grabbedManipulator=null,this._analysisHandles=new te,this._updatingHandles=new ge,this._manipulatorHandles=new te,this._targetTrackerManipulator=null}initialize(){this._intersector=new G({view:this.view}),this.addHandles(Me(()=>this.state,e=>{e===M.Created&&this.finishToolCreation()},pt)),this._observerManipulator=this._createObserverManipulator(),this._createLaserLine(),this.addHandles([this._updatingHandles.add(()=>{var e;return(e=this.analysisViewData)==null?void 0:e.elevationAlignedObserver},e=>this._onObserverLocationChange(e),S),this._updatingHandles.add(()=>Et(this.view.effectiveTheme),({glowColor:e,innerColor:i,globalAlpha:n})=>this._updateLaserLineStyle(e,i,n),S),this._updatingHandles.add(()=>this._laserLineRendererDependencies(),e=>this._updateLaserLineRenderer(e)),this._connectComputations(),this._updatingHandles.addWhen(()=>!this._shouldRenderTracker,()=>this._clearCursorTracker(),S)])}destroy(){this._updatingHandles=E(this._updatingHandles),this._manipulatorHandles=E(this._manipulatorHandles),this._analysisHandles=E(this._analysisHandles),this._observerManipulator=null,this._clearCursorTracker(),this._removeLaserLine(),this._intersector=null,this._set("analysis",null)}get state(){var e;return this.active?this.hasGrabbedManipulators?M.Created:M.Creating:((e=this.analysis.observer)==null?void 0:e.position)!=null?M.Created:M.Ready}get cursor(){return this.active&&this._showTracker?"crosshair":null}get updating(){return this.analysisViewData!=null&&this.analysisViewData.updating||this._updatingHandles.updating}get _showTracker(){return this.active&&this._latestPointerMovePointerType==="mouse"}get _shouldRenderTracker(){var e;return this._showTracker&&((e=this.analysis.observer)==null?void 0:e.position)!=null&&!this.hasGrabbedManipulators}continue(){this.view.activeTool=this}stop(){this.view.activeTool=null}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}onInputEvent(e){switch(e.type){case"immediate-double-click":this._doubleClickHandler(e);break;case"key-down":this._keyDownHandler(e);break;case"pointer-move":this._pointerMoveHandler(e)}}onInputEventAfter(e){e.type==="immediate-click"&&this._clickHandler(e)}onShow(){}onHide(){}onDeactivate(){this._clearCursorTracker()}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,e=>this._onComputationsCollectionChange(e),{initial:!0,final:!0})}_onComputationsCollectionChange({added:e,removed:i}){for(const n of i)this._disconnectComputation(n);for(const n of e)this._connectComputation(n)}_connectComputation(e){if(this.destroyed)return void he.getLogger(this).warn("Attempting to connect an analysis to a destroyed LineOfSight tool. Ignoring.");const i=this._analysisHandles;if(i.has(e))return;const n=this._createTargetManipulator(e.target);this._targetTrackerManipulator==null&&n.metadata.target===this.analysisViewData.cursorTarget&&(this._targetTrackerManipulator=n,this._targetTrackerManipulator.available=!1,this._targetTrackerManipulator.interactive=!1,this._updateLaserLineRenderer()),i.add([this._updatingHandles.add(()=>this._getLineOfSightManipulatorStateDependencies(e),()=>this._updateManipulatorState(n,e),S),this._updatingHandles.add(()=>e.elevationAlignedTargetLocation,s=>this._onTargetLocationChange(s,n),S)],e)}_disconnectComputation(e){if(this.destroyed)return void he.getLogger(this).warn("Attempting to disconnect an analysis from a destroyed LineOfSight tool. Ignoring.");this._analysisHandles.remove(e);const i=this._getTargetManipulator(e.target);i!=null&&(this.manipulators.remove(i),this._manipulatorHandles.remove(i),this._targetTrackerManipulator!=null&&this._targetTrackerManipulator===i&&(this._targetTrackerManipulator=null))}_clearCursorTracker(){this.analysisViewData.cursorTarget=E(this.analysisViewData.cursorTarget)}_createTargetManipulator(e){const i={target:e,type:"target"},n=new xt(this.view,i);return this._manipulatorHandles.add([this._createTargetManipulatorDragPipeline(n),n.events.on("grab-changed",s=>this._manipulatorGrabChanged(n,s)),n.events.on("immediate-click",s=>this._manipulatorClick(n,s))],n),this.manipulators.add(n),e.position!=null?n.elevationAlignedLocation=e.position:n.available=!1,n}_getTargetManipulator(e){let i=null;return this.manipulators.forEach(n=>{const s=n.manipulator;i==null&&s.metadata.type==="target"&&s.metadata.target===e&&(i=s)}),i}_createObserverManipulator(){const e=new kt(this.view,{type:"observer",intersection:null});return this._manipulatorHandles.add([this._createObserverManipulatorDragPipeline(e),e.events.on("grab-changed",i=>this._manipulatorGrabChanged(e,i)),e.events.on("immediate-click",i=>this._manipulatorClick(e,i))],e),this.manipulators.add(e),e}_screenToIntersection(){return e=>{const i=this._intersector.getScreenPointIntersection(e.screenEnd);return i==null?null:{...e,intersection:i}}}_createTargetManipulatorDragPipeline(e){return Ie(e,(i,n,s)=>{n.next(this._screenToIntersection()).next(this._updateTargetDragStep(e)).next(()=>this._updateLaserLineRenderer()),s.next(this._cancelTargetDragStep(e.metadata.target)).next(()=>this._updateLaserLineRenderer())})}_createObserverManipulatorDragPipeline(e){return Ie(e,(i,n,s)=>{n.next(this._screenToIntersection()).next(this._updateObserverDragStep()).next(()=>this._updateLaserLineRenderer()),s.next(this._cancelObserverDragStep()).next(()=>this._updateLaserLineRenderer())})}_updateObserverDragStep(){return e=>(e.intersection.mapPoint!=null?(this.analysis.observer==null&&(this.analysis.observer=new fe),this._updateFromIntersection(this.analysis.observer,e.intersection)):this.analysis.observer=null,e)}_cancelObserverDragStep(){var i;const e=((i=this.analysis.observer)==null?void 0:i.position)!=null?this.analysis.observer.clone():null;return n=>(this.analysis.observer=e,n)}_updateTargetDragStep(e){return i=>{this._updateFromIntersection(e.metadata.target,i.intersection);const n=i.intersection.mapPoint;return n!=null&&(e.elevationAlignedLocation=n),i}}_cancelTargetDragStep(e){var n;const i=(n=e.position)==null?void 0:n.clone();return s=>(e.position=i,s)}_manipulatorGrabChanged(e,i){switch(i.action){case"start":this._grabbedManipulator=e;break;case"end":this._grabbedManipulator===e&&(this._grabbedManipulator=null)}}_updateManipulatorState(e,i){const{isValid:n,isTargetVisible:s}=i.computationResult;e.state=n?s?U.Custom1:U.Custom2:U.Custom3}_getLineOfSightManipulatorStateDependencies(e){const{isValid:i,isTargetVisible:n}=e.computationResult;return{isValid:i,isTargetVisible:n}}_laserLineRendererDependencies(){return{laserlineVisualElement:this._laserlineVisualElement,grabbedManipulator:this._grabbedManipulator,shouldRenderTracker:this._shouldRenderTracker,observerPosition:this.analysis.observer!=null?this.analysis.observer.position:null,visible:this.visible}}_updateLaserLineRenderer(e=this._laserLineRendererDependencies()){const{laserlineVisualElement:i,grabbedManipulator:n,shouldRenderTracker:s,observerPosition:o,visible:l}=e;if(i==null)return;const d=n??(s&&o!=null?this._targetTrackerManipulator:null);d!=null&&l?(i.visible=!0,i.heightManifoldTarget=d.renderLocation,d!==this._observerManipulator?i.lineVerticalPlaneSegment=gt(this._observerManipulator.renderLocation,d.renderLocation,zt):i.lineVerticalPlaneSegment=null):(i.visible=!1,i.heightManifoldTarget=null,i.lineVerticalPlaneSegment=null)}_createLaserLine(){this._removeLaserLine();const{glowWidth:e,innerWidth:i}=Rt;this._laserlineVisualElement=new ft({view:this.view,attached:!0,visible:this.visible,style:{glowWidth:e,innerWidth:i},isDecoration:!0})}_removeLaserLine(){this._laserlineVisualElement!=null&&(this._laserlineVisualElement.destroy(),this._laserlineVisualElement=null)}_updateLaserLineStyle(e,i,n){const s=this._laserlineVisualElement;if(s==null)return;const o=s.style;s.style={...o,glowColor:v.toUnitRGB(e),innerColor:v.toUnitRGB(i),globalAlpha:n}}_onObserverLocationChange(e){e!=null?(this._observerManipulator.metadata.intersection=null,this._observerManipulator.available=!0,this._observerManipulator.elevationAlignedLocation=e):this._observerManipulator.available=!1}_onTargetLocationChange(e,i){e!=null?(i.elevationAlignedLocation=e,i!==this._targetTrackerManipulator&&(i.available=!0)):i.available=!1}_addPointFromClickEvent(e){var n;const i=this._intersector.getScreenPointIntersection(e);if((i==null?void 0:i.mapPoint)!=null)if(((n=this.analysis.observer)==null?void 0:n.position)!=null){this._clearCursorTracker();const s=new Ce;this._updateFromIntersection(s,i),this.analysis.targets.add(s)}else{const s=new fe;this._updateFromIntersection(s,i),this.analysis.observer=s}}_clickHandler(e){this.active&&e.button!==se.Right&&(this._addPointFromClickEvent(we(e)),e.stopPropagation())}_doubleClickHandler(e){this.active&&e.button!==se.Right&&(this.stop(),e.stopPropagation())}_keyDownHandler(e){this.active&&e.key==="Escape"&&(this.stop(),e.stopPropagation())}_pointerMoveHandler(e){var s;if(this.hasGrabbedManipulators||(this._latestPointerMovePointerType=e.pointerType,this._updateLaserLineRenderer(),!this._showTracker||((s=this.analysis.observer)==null?void 0:s.position)==null))return;const i=we(e),n=this._intersector.getScreenPointIntersection(i);(n==null?void 0:n.mapPoint)!=null&&(this.analysisViewData.cursorTarget==null&&(this.analysisViewData.cursorTarget=new Ce),this._updateFromIntersection(this.analysisViewData.cursorTarget,n),this._updateLaserLineRenderer())}_updateFromIntersection(e,i){if(i.mapPoint==null)return e.position=null,e.elevationInfo=null,void(e.feature=null);switch(i.type){case j.OBJECT:if(i.graphic!=null){const s=i.graphic,o=vt(s);o.mode==="on-the-ground"&&(o.mode="relative-to-ground",o.offset=0),e.elevationInfo=new Oe(o),e.feature=s}else e.elevationInfo=null,e.feature=null;break;case j.TERRAIN:case j.I3S:e.elevationInfo=new Oe({mode:"on-the-ground"}),e.feature=null;break;default:e.elevationInfo=null,e.feature=null}const n=i.mapPoint.clone();n.z=_t(this.view,n,{mode:"absolute-height",offset:0},e.elevationInfo),e.position=n}_manipulatorClick(e,i){if(e.metadata.type==="observer"||e.grabbing||e.dragging||i.button!==se.Right||this.analysis.targets.length<=1)return;const{target:n}=e.metadata;this.analysis.targets.remove(n),i.stopPropagation()}get testInfo(){return{laserLineVisualElement:this._laserlineVisualElement,getTargetManipulator:e=>this._getTargetManipulator(e)}}};a([r({constructOnly:!0})],O.prototype,"view",void 0),a([r({constructOnly:!0})],O.prototype,"analysis",void 0),a([r({readOnly:!0})],O.prototype,"state",null),a([r({readOnly:!0})],O.prototype,"cursor",null),a([r()],O.prototype,"removeIncompleteOnCancel",void 0),a([r({readOnly:!0})],O.prototype,"updating",null),a([r({constructOnly:!0})],O.prototype,"analysisViewData",void 0),a([r({readOnly:!0})],O.prototype,"_showTracker",null),a([r()],O.prototype,"_latestPointerMovePointerType",void 0),a([r()],O.prototype,"_shouldRenderTracker",null),a([r()],O.prototype,"_laserlineVisualElement",void 0),a([r()],O.prototype,"_grabbedManipulator",void 0),O=a([D("esri.views.3d.interactive.analysisTools.lineOfSight.LineOfSightTool")],O);const zt=ht();class Ft{constructor(e,i,n,s){this.visibleLineVisualElement=e,this.occludedLineVisualElement=i,this.undefinedLineVisualElement=n,this.targetVisualElement=s}destroy(){this.visibleLineVisualElement.destroy(),this.occludedLineVisualElement.destroy(),this.undefinedLineVisualElement.destroy(),this.targetVisualElement.destroy()}}let V=class extends k{constructor(t){super(t),this._lineOfSightVisualElements=new Array,this._computationHandles=new te,this._updatingHandles=new ge}initialize(){this.addHandles(this._connectComputations()),this._createObserverVisualization()}destroy(){this._updatingHandles=E(this._updatingHandles),this._computationHandles=E(this._computationHandles),this._observerVisualElement=E(this._observerVisualElement)}get visible(){return this.analysisViewData.visible}get updating(){return this._updatingHandles.updating}get interactiveAndEditable(){return this.analysisViewData.interactive&&this.analysisViewData.editable}get test(){return{disablePartialOcclusion:()=>{for(const t of this._lineOfSightVisualElements)t.visibleLineVisualElement.renderOccluded=ae.Occlude,t.occludedLineVisualElement.renderOccluded=ae.Occlude,t.undefinedLineVisualElement.renderOccluded=ae.Occlude},visualizations:this._lineOfSightVisualElements}}_createLineOfSightVisualization(){const t=Y,e=this.view,i=this.isDecoration,n={view:e,attached:!0,width:t.outerWidth,innerWidth:t.innerWidth,isDecoration:i},s=v.toUnitRGBA(t.visibleOuterColor),o=v.toUnitRGBA(t.visibleInnerColor),l=v.toUnitRGBA(t.occludedOuterColor),d=v.toUnitRGBA(t.occludedInnerColor),h=v.toUnitRGBA(t.undefinedOuterColor),c=v.toUnitRGBA(t.undefinedInnerColor),u=new oe({...n,color:s,innerColor:o}),g=new oe({...n,color:l,innerColor:d}),p=new oe({...n,color:h,innerColor:c}),C=new Pe({view:e,attached:!0,...Ee,size:8,isDecoration:i}),b=new Ft(u,g,p,C);return this._lineOfSightVisualElements.push(b),b}_destroyLineOfSightVisualization(t){t.destroy(),this._lineOfSightVisualElements.splice(this._lineOfSightVisualElements.indexOf(t),1)}_updateLineOfSightVisualization(t,e,i){const n=Y,{computationResult:s,inputPoints:o}=t,{start:l,end:d,intersection:h,isValid:c,isTargetVisible:u}=s,{observer:g}=o,p=Nt;p[12]=g[0],p[13]=g[1],p[14]=g[2];const C=B(Gt,l,g),b=B(jt,d,g),w=B(Ut,h,g),{visibleLineVisualElement:m,occludedLineVisualElement:L,undefinedLineVisualElement:I,targetVisualElement:R}=e,je=this.analysisViewData.elevationAlignedObserver==null||t.elevationAlignedTargetLocation==null,N=this.visible&&!je;m.visible=N,L.visible=N,I.visible=N,R.visible=N,R.attached=!i.interactiveAndEditable,N&&(m.geometry=null,L.geometry=null,I.geometry=null,R.geometry=t.elevationAlignedTargetLocation,c?u?(m.geometry=[[$(C),$(b)]],m.transform=p,m.color=v.toUnitRGBA(n.visibleOuterColor),R.color=v.toUnitRGBA(n.visibleInnerColor)):(m.geometry=[[$(C),$(w)]],m.transform=p,m.color=v.toUnitRGBA(n.occludedOuterColor),L.geometry=[[$(w),$(b)]],L.transform=p,R.color=v.toUnitRGBA(n.occludedInnerColor)):(I.geometry=[[$(C),$(b)]],I.transform=p,R.color=v.toUnitRGBA(n.undefinedInnerColor)))}_getLineOfSightVisualizationDependencies(t){const{computationResult:e}=t,{occludedOuterColor:i,visibleOuterColor:n}=Y;return{computationResult:e,occludedOuterColor:i,visibleOuterColor:n,visible:this.visible,interactiveAndEditable:this.interactiveAndEditable}}_connectComputation(t){const e=this._computationHandles;if(e.has(t))return;const i=this._createLineOfSightVisualization();e.add([this._updatingHandles.add(()=>this._getLineOfSightVisualizationDependencies(t),n=>this._updateLineOfSightVisualization(t,i,n),{initial:!0,equals:()=>!1}),He(()=>this._destroyLineOfSightVisualization(i))],t)}_disconnectComputation(t){this._computationHandles.remove(t)}_connectComputations(){return this._updatingHandles.addOnCollectionChange(()=>this.analysisViewData.computations,t=>this._onComputationsCollectionChange(t),{initial:!0,final:!0})}_onComputationsCollectionChange({added:t,removed:e}){for(const i of e)this._disconnectComputation(i);for(const i of t)this._connectComputation(i)}_createObserverVisualization(){const t=v.toUnitRGBA(Y.visibleInnerColor),e=new Pe({view:this.view,color:t,...Ee,isDecoration:this.isDecoration});this._observerVisualElement=e,this.addHandles(this._updatingHandles.add(()=>({observer:this.analysisViewData.elevationAlignedObserver,interactiveAndEditable:this.interactiveAndEditable,visible:this.visible}),({observer:i,interactiveAndEditable:n,visible:s})=>{i!=null&&!n&&s?(e.geometry=i,this._observerVisualElement.attached=!0):e.attached=!1},S))}};a([r({constructOnly:!0})],V.prototype,"analysis",void 0),a([r({constructOnly:!0})],V.prototype,"analysisViewData",void 0),a([r({constructOnly:!0})],V.prototype,"view",void 0),a([r({readOnly:!0})],V.prototype,"visible",null),a([r({constructOnly:!0})],V.prototype,"isDecoration",void 0),a([r()],V.prototype,"updating",null),a([r()],V.prototype,"interactiveAndEditable",null),a([r()],V.prototype,"test",null),V=a([D("esri.views.3d.analysis.LineOfSight.LineOfSightVisualization")],V);const Ee={size:6,pixelSnappingEnabled:!1,primitive:"circle",elevationInfo:{mode:"absolute-height",offset:0},outlineSize:0},Gt=_(),jt=_(),Ut=_(),Nt=mt();let f=class extends bt(Ae.EventedMixin(k)){constructor(t){super(t),this.type="line-of-sight-view-3d",this.analysis=null,this.tool=null,this.computations=new yt,this.elevationAlignedObserver=null,this.observerEngineLocation=_(),this.cursorTarget=null,this.editable=!0}initialize(){const t=this.view,e=this.analysis;this._analysisController=new y({analysis:e,analysisViewData:this,view:t}),this._analysisVisualization=new V({analysis:e,analysisViewData:this,view:t,isDecoration:!this.parent}),this.addHandles([this._analysisController.on("result-changed",i=>{i.target!==this.cursorTarget&&this.emit("result-changed",i)}),wt(this,O)])}destroy(){Ot(this),this._analysisController=E(this._analysisController),this._analysisVisualization=E(this._analysisVisualization)}get results(){return this.computations.map(t=>t.result)}get priority(){return this._analysisController.priority}set priority(t){this._analysisController.priority=t}get updating(){return this._analysisController!=null&&this._analysisController.updating||this._analysisVisualization!=null&&this._analysisVisualization.updating}getResultForTarget(t){var e;return(e=this.computations.find(i=>i.target===t))==null?void 0:e.result}get testInfo(){return{visualization:this._analysisVisualization,controller:this._analysisController}}};a([r({readOnly:!0})],f.prototype,"type",void 0),a([r({constructOnly:!0,nonNullable:!0})],f.prototype,"analysis",void 0),a([r()],f.prototype,"tool",void 0),a([r({readOnly:!0})],f.prototype,"results",null),a([r()],f.prototype,"priority",null),a([r()],f.prototype,"computations",void 0),a([r()],f.prototype,"elevationAlignedObserver",void 0),a([r()],f.prototype,"observerEngineLocation",void 0),a([r()],f.prototype,"cursorTarget",void 0),a([r()],f.prototype,"updating",null),a([r()],f.prototype,"editable",void 0),a([r()],f.prototype,"_analysisController",void 0),a([r()],f.prototype,"_analysisVisualization",void 0),f=a([D("esri.views.3d.analysis.LineOfSightAnalysisView3D")],f);const di=f;export{di as default}; diff --git a/dist/assets/LineOfSightLayer-JMoACZan.js b/dist/assets/LineOfSightLayer-JMoACZan.js new file mode 100644 index 0000000..62033c8 --- /dev/null +++ b/dist/assets/LineOfSightLayer-JMoACZan.js @@ -0,0 +1 @@ +import{V as n,ed as l,dM as o,dP as y,ee as r,d as p,A as d,ef as h,e as s,y as i,eg as u,c as g,c7 as c}from"./index-J0iiHjMT.js";const f=n.ofType(l);let t=class extends o(y(c)){constructor(e){super(e),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new r,this.opacity=1}initialize(){this.addHandles(p(()=>this.analysis,(e,a)=>{a!=null&&a.parent===this&&(a.parent=null),e!=null&&(e.parent=this)},d))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){var e;return(e=this.analysis)==null?void 0:e.observer}set observer(e){const{analysis:a}=this;a&&(a.observer=e)}get targets(){return this.analysis!=null?this.analysis.targets:new n}set targets(e){var a;h(e,(a=this.analysis)==null?void 0:a.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(e){this.analysis===e&&(this.analysis=new r)}};s([i({json:{read:!1},readOnly:!0})],t.prototype,"type",void 0),s([i({type:["LineOfSightLayer"]})],t.prototype,"operationalLayerType",void 0),s([i({type:u,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],t.prototype,"observer",null),s([i({type:f,json:{read:!0,write:{ignoreOrigin:!0}}})],t.prototype,"targets",null),s([i({nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"analysis",void 0),s([i({readOnly:!0})],t.prototype,"fullExtent",null),s([i({readOnly:!0})],t.prototype,"spatialReference",null),s([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],t.prototype,"opacity",void 0),s([i({type:["show","hide"]})],t.prototype,"listMode",void 0),t=s([g("esri.layers.LineOfSightLayer")],t);const w=t;export{w as default}; diff --git a/dist/assets/LineOfSightLayerView3D-rUjgrEFl.js b/dist/assets/LineOfSightLayerView3D-rUjgrEFl.js new file mode 100644 index 0000000..8d3439b --- /dev/null +++ b/dist/assets/LineOfSightLayerView3D-rUjgrEFl.js @@ -0,0 +1,7 @@ +import{d as h,A as w,E as r,b as d,n as c,a as V,g as _,de as u,e as a,y as n,c as p}from"./index-J0iiHjMT.js";import{n as A}from"./LayerView3D-iOx2MD1g.js";import{u as f}from"./LayerView-efDufa6j.js";const o="analysis-view-handles";let i=class extends A(f){constructor(s){super(s),this.type="line-of-sight-3d",this._analysisModule=null}initialize(){this.addHandles(h(()=>this.layer.analysis,s=>{this._destroyAnalysisView(),s!=null&&this._createAnalysisView(s)},w),o)}destroy(){this.removeHandles(o),this._destroyAnalysisView()}async whenAnalysisView(){if(this.analysisView!=null)return this.analysisView;if(this._createAnalysisViewTask!=null)return this._createAnalysisViewTask.promise;throw new r("layerview:no-analysisview-for-analysis","The analysis has not been set on the LineOfSightLayer of this layer view")}isUpdating(){return this._createAnalysisViewTask!=null||this.analysisView!=null&&this.analysisView.updating}_createAnalysisView(s){const t=d(async e=>(this.analysisView=await this._createAnalysisViewPromise(s,e),this._createAnalysisViewTask===t&&(this._createAnalysisViewTask=null),this.analysisView));this._createAnalysisViewTask=t}_destroyAnalysisView(){this.analysisView=c(this.analysisView),this._createAnalysisViewTask=V(this._createAnalysisViewTask)}async _createAnalysisViewPromise(s,t){let e=this._analysisModule;if(e==null){const y=await this._loadAnalysisModule();this._analysisModule=y,e=y}const l=new e.default({analysis:s,view:this.view,parent:this});if(await l.when(),_(t))throw l.destroy(),new r("layerview:no-analysisview-for-analysis","The analysis has not been added to the LineOfSightLayer of this layer view",{analysis:s});return l}_loadAnalysisModule(){return u(()=>import("./LineOfSightAnalysisView3D-lX-OBMBB.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))}};a([n()],i.prototype,"type",void 0),a([n()],i.prototype,"layer",void 0),a([n()],i.prototype,"analysisView",void 0),a([n()],i.prototype,"_createAnalysisViewTask",void 0),i=a([p("esri.views.3d.layers.LineOfSightLayerView3D")],i);const k=i;export{k as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/LineOfSightAnalysisView3D-lX-OBMBB.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/AnalysisView3D-jkk3JIRT.js","assets/LineVisualElement-4BP10o6v.js","assets/Object3DVisualElement-TMb7y_wl.js","assets/VisualElement-kjYXz27t.js","assets/ShadedColorMaterial.glsl-Fp4o6LjC.js","assets/manipulatorUtils-1y2yxq3d.js","assets/Laserlines.glsl-nvjcCsAw.js","assets/AnalysisToolBase-3A13PdgS.js","assets/InteractiveToolBase-WDic4GPF.js","assets/drawUtils-woTYaREB.js","assets/PointVisualElement-bX-_4FqS.js","assets/analysisViewUtils-AQaQeJpR.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/LineSeries-VcEznTH7.js b/dist/assets/LineSeries-VcEznTH7.js new file mode 100644 index 0000000..dbca89f --- /dev/null +++ b/dist/assets/LineSeries-VcEznTH7.js @@ -0,0 +1 @@ +import{W as Y,Q as T,e as St,a as ft,Y as k,V as H,Z as $t,v as q,g as Kt,$ as et,q as J,m as P,w as vt,l as b,k as yt,b as S,r as wt,c as qt,d as X,f as Jt,F as Ot,y as Pt,h as kt,j as it,n as B,H as Qt,o as te,p as At,s as V,B as L,G as Xt,t as ee,i as ie,X as Dt,D as Tt,J as $,z as N,K as Mt,u as se}from"./Theme-QNc_77AM.js";import{s as Ct}from"./ColorSet-j9kKRPwP.js";import{l as M}from"./DefaultTheme-T7-VnRhA.js";import{U as Yt,D as Lt,_ as Ft,B as Rt,g as st,V as It,k as C,I as ae}from"./Tick-WQ_bPwW2.js";import{o as oe}from"./Button-1STHXt3M.js";import{da as K}from"./index-J0iiHjMT.js";function jt(y){return typeof y=="object"&&"length"in y?y:Array.from(y)}function Vt(y){this._context=y}function Et(y){return new Vt(y)}function Gt(y){return y[0]}function Nt(y){return y[1]}function zt(y,t){var e=C(!0),i=null,s=Et,a=null,r=It(n);function n(o){var h,c,l,d=(o=jt(o)).length,u=!1;for(i==null&&(a=s(l=r())),h=0;h<=d;++h)!(h=u;--g)n.point(_[g],f[g]);n.lineEnd(),n.areaEnd()}v&&(_[d]=+y(m,d,l),f[d]=+t(m,d,l),n.point(i?+i(m,d,l):_[d],e?+e(m,d,l):f[d]))}if(p)return n=null,p+""||null}function c(){return zt().defined(s).curve(r).context(a)}return y=typeof y=="function"?y:y===void 0?Gt:C(+y),t=typeof t=="function"?t:C(t===void 0?0:+t),e=typeof e=="function"?e:e===void 0?Nt:C(+e),h.x=function(l){return arguments.length?(y=typeof l=="function"?l:C(+l),i=null,h):y},h.x0=function(l){return arguments.length?(y=typeof l=="function"?l:C(+l),h):y},h.x1=function(l){return arguments.length?(i=l==null?null:typeof l=="function"?l:C(+l),h):i},h.y=function(l){return arguments.length?(t=typeof l=="function"?l:C(+l),e=null,h):t},h.y0=function(l){return arguments.length?(t=typeof l=="function"?l:C(+l),h):t},h.y1=function(l){return arguments.length?(e=l==null?null:typeof l=="function"?l:C(+l),h):e},h.lineX0=h.lineY0=function(){return c().x(y).y(t)},h.lineY1=function(){return c().x(y).y(e)},h.lineX1=function(){return c().x(i).y(t)},h.defined=function(l){return arguments.length?(s=typeof l=="function"?l:C(!!l),h):s},h.curve=function(l){return arguments.length?(r=l,a!=null&&(n=r(a)),h):r},h.context=function(l){return arguments.length?(l==null?a=n=null:n=r(a=l),h):a},h}Vt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(y,t){switch(y=+y,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(y,t):this._context.moveTo(y,t);break;case 1:this._point=2;default:this._context.lineTo(y,t)}}};class re extends ie{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this._root.language,i=this.rule.bind(this);i("XYChart").setAll({colors:Ct.new(this._root,{}),paddingLeft:20,paddingRight:20,paddingTop:16,paddingBottom:16,panX:!1,panY:!1,wheelStep:.25,arrangeTooltips:!0,pinchZoomX:!1,pinchZoomY:!1}),i("XYSeries").setAll({legendLabelText:"{name}"}),i("XYChart",["scrollbar","chart"]).setAll({paddingBottom:0,paddingLeft:0,paddingTop:0,paddingRight:0,colors:Ct.new(this._root,{saturation:0})});{const o=i("Graphics",["scrollbar","overlay"]);o.setAll({fillOpacity:.5}),M(o,"fill",t,"background")}i("RoundedRectangle",["xy","scrollbar","thumb"]).setAll({cornerRadiusTR:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusBL:0,fillOpacity:0,focusable:!0}),i("RoundedRectangle",["xy","scrollbar","thumb"]).states.create("hover",{fillOpacity:.4}),i("RoundedRectangle",["xy","scrollbar","chart","background"]).setAll({cornerRadiusTL:0,cornerRadiusBL:0,cornerRadiusTR:0,cornerRadiusBR:0}),i("RoundedRectangle",["xy","scrollbar","chart","background","resize","button"]).setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),i("AxisRendererX",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0}),i("AxisRendererY",["xy","chart","scrollbar"]).setAll({strokeOpacity:0,inside:!0,minGridDistance:5}),i("AxisLabel",["xy","scrollbar","x"]).setAll({opacity:.5,centerY:k,minPosition:.01,maxPosition:.99,fontSize:"0.8em"}),i("AxisLabel",["category"]).setAll({text:"{category}",populateText:!0}),i("AxisLabel",["x"]).setAll({centerY:0}),i("AxisLabel",["x","inside"]).setAll({centerY:k}),i("AxisLabel",["x","inside","opposite"]).setAll({centerY:0}),i("AxisLabel",["x","opposite"]).setAll({centerY:k}),i("AxisLabel",["y"]).setAll({centerX:k}),i("AxisLabel",["y","inside"]).setAll({centerX:0}),i("AxisLabel",["y","inside","opposite"]).setAll({centerX:k}),i("AxisLabel",["y","opposite"]).setAll({centerX:0}),i("AxisLabel",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","y"]).setAll({visible:!1}),i("Grid",["xy","scrollbar","x"]).setAll({opacity:.5}),i("XYCursor").setAll({behavior:"none",layer:30,exportable:!1,snapToSeriesBy:"xy",moveThreshold:1});{const o=i("Grid",["cursor","x"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:e.translate("Use left and right arrows to move selection")}),M(o,"stroke",t,"alternativeBackground")}{const o=i("Grid",["cursor","y"]);o.setAll({strokeOpacity:.8,strokeDasharray:[2,2],ariaLabel:e.translate("Use up and down arrows to move selection")}),M(o,"stroke",t,"alternativeBackground")}{const o=i("Graphics",["cursor","selection"]);o.setAll({fillOpacity:.15}),M(o,"fill",t,"alternativeBackground")}i("Axis").setAll({start:0,end:1,minZoomCount:1,maxZoomCount:1/0,maxZoomFactor:1e3,maxDeviation:.1,snapTooltip:!0,tooltipLocation:.5,panX:!0,panY:!0,zoomX:!0,zoomY:!0,fixAxisSize:!0}),i("AxisLabel").setAll({location:.5,multiLocation:0,centerX:Dt,centerY:Dt,paddingTop:3,paddingBottom:3,paddingLeft:5,paddingRight:5}),i("Container",["axis","header"]).setAll({layer:30}),i("Rectangle",["axis","header","background"]).setAll({crisp:!0});{const o=i("AxisRenderer");o.setAll({crisp:!0,strokeOpacity:0}),M(o,"stroke",t,"grid")}i("AxisRendererX").setAll({minGridDistance:120,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,width:k}),i("AxisRendererY").setAll({minGridDistance:40,opposite:!1,inversed:!1,cellStartLocation:0,cellEndLocation:1,height:k});{const o=i("Rectangle",["axis","thumb"]);o.setAll({fillOpacity:0}),M(o,"fill",t,"alternativeBackground"),o.states.create("hover",{fillOpacity:.1})}i("Rectangle",["axis","thumb","x"]).setAll({cursorOverStyle:"ew-resize"}),i("Rectangle",["axis","thumb","y"]).setAll({cursorOverStyle:"ns-resize"});{const o=i("Grid");o.setAll({location:0,strokeOpacity:.15,crisp:!0}),M(o,"stroke",t,"grid")}i("Grid",["base"]).setAll({strokeOpacity:.3});{const o=i("Graphics",["axis","fill"]);o.setAll({visible:!1,isMeasured:!1,position:"absolute",fillOpacity:.05}),M(o,"fill",t,"alternativeBackground")}i("Graphics",["axis","fill","range"]).setAll({isMeasured:!0}),i("Graphics",["series","fill","range"]).setAll({visible:!1,isMeasured:!0}),i("Grid",["series","range"]).setAll({visible:!1}),i("AxisTick",["series","range"]).setAll({visible:!1}),i("AxisLabel",["series","range"]).setAll({visible:!1});{const o=i("AxisTick");o.setAll({location:.5,multiLocation:0,strokeOpacity:1,isMeasured:!1,position:"absolute",visible:!1}),M(o,"stroke",t,"grid")}i("CategoryAxis").setAll({startLocation:0,endLocation:1,fillRule:(o,h)=>{const c=o.get("axisFill");c&&(b(h)&&h%2!=0?c.setPrivate("visible",!1):c.setPrivate("visible",!0))}});const s=[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:5},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:50},{timeUnit:"millisecond",count:100},{timeUnit:"millisecond",count:500},{timeUnit:"second",count:1},{timeUnit:"second",count:5},{timeUnit:"second",count:10},{timeUnit:"second",count:30},{timeUnit:"minute",count:1},{timeUnit:"minute",count:5},{timeUnit:"minute",count:10},{timeUnit:"minute",count:15},{timeUnit:"minute",count:30},{timeUnit:"hour",count:1},{timeUnit:"hour",count:3},{timeUnit:"hour",count:6},{timeUnit:"hour",count:12},{timeUnit:"day",count:1},{timeUnit:"day",count:2},{timeUnit:"day",count:3},{timeUnit:"day",count:4},{timeUnit:"day",count:5},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"month",count:2},{timeUnit:"month",count:3},{timeUnit:"month",count:6},{timeUnit:"year",count:1},{timeUnit:"year",count:2},{timeUnit:"year",count:5},{timeUnit:"year",count:10},{timeUnit:"year",count:50},{timeUnit:"year",count:100},{timeUnit:"year",count:200},{timeUnit:"year",count:500},{timeUnit:"year",count:1e3},{timeUnit:"year",count:2e3},{timeUnit:"year",count:5e3},{timeUnit:"year",count:1e4},{timeUnit:"year",count:1e5}],a={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_hour"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month"),year:e.translate("_date_year")},r={millisecond:e.translate("_date_millisecond"),second:e.translate("_date_second"),minute:e.translate("_date_minute"),hour:e.translate("_date_day"),day:e.translate("_date_day"),week:e.translate("_date_day"),month:e.translate("_date_month")+" "+e.translate("_date_year"),year:e.translate("_date_year")},n={millisecond:e.translate("_date_millisecond_full"),second:e.translate("_date_second_full"),minute:e.translate("_date_minute_full"),hour:e.translate("_date_hour_full"),day:e.translate("_date_day_full"),week:e.translate("_date_week_full"),month:e.translate("_date_month_full"),year:e.translate("_date_year")};i("CategoryDateAxis").setAll({markUnitChange:!0,gridIntervals:Tt(s),dateFormats:$(a),periodChangeDateFormats:$(r)}),i("DateAxis").setAll({maxZoomFactor:null,strictMinMax:!0,startLocation:0,endLocation:1,markUnitChange:!0,groupData:!1,groupCount:500,gridIntervals:Tt(s),dateFormats:$(a),periodChangeDateFormats:$(r),tooltipDateFormats:n,groupIntervals:[{timeUnit:"millisecond",count:1},{timeUnit:"millisecond",count:10},{timeUnit:"millisecond",count:100},{timeUnit:"second",count:1},{timeUnit:"second",count:10},{timeUnit:"minute",count:1},{timeUnit:"minute",count:10},{timeUnit:"hour",count:1},{timeUnit:"day",count:1},{timeUnit:"week",count:1},{timeUnit:"month",count:1},{timeUnit:"year",count:1}],fillRule:o=>{const h=o.get("axisFill");if(h){const c=o.component,l=o.get("value"),d=o.get("endValue"),u=c.intervalDuration(),g=c.getPrivate("baseInterval"),m=c.getPrivate("gridInterval",g);let p=c.getPrivate("min",0);if(p=ae(new Date(p),m.timeUnit,m.count,this._root.locale.firstDayOfWeek,this._root.utc,void 0,this._root.timezone).getTime(),l!=null&&d!=null){const x=Math.round(Math.round((l-p)/u))/2;x==Math.round(x)?h.setPrivate("visible",!0):h.setPrivate("visible",!1)}}}}),i("GaplessDateAxis").setAll({fillRule:o=>{const h=o.get("axisFill");if(h){const c=o.get("index");let l=!1;b(c)&&c%2!=0||(l=!0),h.setPrivate("visible",l)}}}),i("ValueAxis").setAll({baseValue:0,logarithmic:!1,strictMinMax:!1,autoZoom:!0,fillRule:o=>{const h=o.get("axisFill");if(h){const c=o.component,l=o.get("value"),d=c.getPrivate("step");b(l)&&b(d)&&(X(l/d/2,5)==Math.round(l/d/2)?h.setPrivate("visible",!1):h.setPrivate("visible",!0))}}}),i("DurationAxis").setAll({baseUnit:"second"}),i("XYSeries").setAll({maskBullets:!0,stackToNegative:!0,locationX:.5,locationY:.5,snapTooltip:!1,openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close",seriesTooltipTarget:"series"}),i("BaseColumnSeries").setAll({adjustBulletPosition:!0}),i("ColumnSeries").setAll({clustered:!0}),i("RoundedRectangle",["series","column"]).setAll({position:"absolute",isMeasured:!1,width:N(70),height:N(70),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("LineSeries").setAll({connect:!0,autoGapCount:1.1,stackToNegative:!1}),i("Graphics",["series","stroke"]).setAll({position:"absolute",strokeWidth:1,strokeOpacity:1,isMeasured:!1}),i("Graphics",["series","fill"]).setAll({visible:!1,fillOpacity:0,position:"absolute",strokeWidth:0,strokeOpacity:0,isMeasured:!1}),i("Graphics",["line","series","legend","marker","stroke"]).setAll({draw:(o,h)=>{const c=h.parent;if(c){const l=c.height(),d=c.width();o.moveTo(0,l/2),o.lineTo(d,l/2)}}});{const o=i("Graphics",["line","series","legend","marker","stroke"]).states.create("disabled",{});M(o,"stroke",t,"disabled")}i("Graphics",["line","series","legend","marker","fill"]).setAll({draw:(o,h)=>{const c=h.parent;if(c){const l=c.height(),d=c.width();o.moveTo(0,0),o.lineTo(d,0),o.lineTo(d,l),o.lineTo(0,l),o.lineTo(0,0)}}});{const o=i("Graphics",["line","series","legend","marker","fill"]).states.create("disabled",{});M(o,"stroke",t,"disabled")}i("SmoothedXYLineSeries").setAll({tension:.5}),i("SmoothedXLineSeries").setAll({tension:.5}),i("SmoothedYLineSeries").setAll({tension:.5}),i("Candlestick").setAll({position:"absolute",isMeasured:!1,width:N(50),height:N(50),strokeWidth:1,strokeOpacity:1,cornerRadiusBL:0,cornerRadiusTL:0,cornerRadiusBR:0,cornerRadiusTR:0,fillOpacity:1,role:"figure"}),i("OHLC").setAll({width:N(80),height:N(80)}),i("CandlestickSeries").setAll({lowValueXGrouped:"low",lowValueYGrouped:"low",highValueXGrouped:"high",highValueYGrouped:"high",openValueXGrouped:"open",openValueYGrouped:"open",valueXGrouped:"close",valueYGrouped:"close"});{const o=i("Rectangle",["column","autocolor"]).states.create("riseFromOpen",{});M(o,"fill",t,"positive"),M(o,"stroke",t,"positive")}{const o=i("Rectangle",["column","autocolor"]).states.create("dropFromOpen",{});M(o,"fill",t,"negative"),M(o,"stroke",t,"negative")}i("Rectangle",["column","autocolor","pro"]).states.create("riseFromOpen",{fillOpacity:0}),i("Rectangle",["column","autocolor","pro"]).states.create("dropFromOpen",{fillOpacity:1});{const o=i("Rectangle",["column","autocolor","pro"]).states.create("riseFromPrevious",{});M(o,"fill",t,"positive"),M(o,"stroke",t,"positive")}{const o=i("Rectangle",["column","autocolor","pro"]).states.create("dropFromPrevious",{});M(o,"fill",t,"negative"),M(o,"stroke",t,"negative")}}}class nt extends Yt{constructor(){super(...arguments),Object.defineProperty(this,"xAxes",{enumerable:!0,configurable:!0,writable:!0,value:new ft}),Object.defineProperty(this,"yAxes",{enumerable:!0,configurable:!0,writable:!0,value:new ft}),Object.defineProperty(this,"topAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(T.new(this._root,{width:k,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"yAxesAndPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(T.new(this._root,{width:k,height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"bottomAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.chartContainer.children.push(T.new(this._root,{width:k,layout:this._root.verticalLayout}))}),Object.defineProperty(this,"leftAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(T.new(this._root,{height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"plotsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(T.new(this._root,{width:k,height:k,maskContent:!1}))}),Object.defineProperty(this,"plotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(T.new(this._root,{width:k,height:k}))}),Object.defineProperty(this,"topPlotContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotsContainer.children.push(T.new(this._root,{width:k,height:k}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(T.new(this._root,{width:k,height:k,isMeasured:!1}))}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:T.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"rightAxesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.yAxesAndPlotContainer.children.push(T.new(this._root,{height:k,layout:this._root.horizontalLayout}))}),Object.defineProperty(this,"axisHeadersContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.plotContainer.children.push(T.new(this._root,{}))}),Object.defineProperty(this,"zoomOutButton",{enumerable:!0,configurable:!0,writable:!0,value:this.topPlotContainer.children.push(oe.new(this._root,{themeTags:["zoom"],icon:Y.new(this._root,{themeTags:["button","icon"]})}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_wheelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_otherCharts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_movePoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_downStartX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downStartY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downEndY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._defaultThemes.push(re.new(this._root)),super._afterNew(),this._disposers.push(this.xAxes),this._disposers.push(this.yAxes);const t=this._root;let e=this._root.verticalLayout;const i=this.zoomOutButton;i.events.on("click",()=>{this.zoomOut()}),i.hide(0),i.states.lookup("default").set("opacity",1),this.chartContainer.set("layout",e);const s=this.plotContainer;s.children.push(this.seriesContainer),this._disposers.push(this._processAxis(this.xAxes,this.bottomAxesContainer)),this._disposers.push(this._processAxis(this.yAxes,this.leftAxesContainer)),s.children.push(this.topGridContainer),s.children.push(this.bulletsContainer),s.set("interactive",!0),s.set("interactiveChildren",!1),s.set("background",H.new(t,{themeTags:["xy","background"],fill:$t.fromHex(0),fillOpacity:0})),this._disposers.push(s.events.on("pointerdown",a=>{this._handlePlotDown(a)})),this._disposers.push(s.events.on("globalpointerup",a=>{this._handlePlotUp(a)})),this._disposers.push(s.events.on("globalpointermove",a=>{this._handlePlotMove(a)})),this._maskGrid(),this._setUpTouch()}_beforeChanged(){super._beforeChanged(),(this.isDirty("pinchZoomX")||this.isDirty("pinchZoomY")||this.get("panX")||this.get("panY"))&&this._setUpTouch()}_setUpTouch(){this.plotContainer._display.cancelTouch||(this.plotContainer._display.cancelTouch=!!(this.get("pinchZoomX")||this.get("pinchZoomY")||this.get("panX")||this.get("panY")))}_maskGrid(){this.gridContainer.set("maskContent",!0),this.topGridContainer.set("maskContent",!0)}_removeSeries(t){t._unstack(),t._posXDp&&t._posXDp.dispose(),t._posYDp&&t._posYDp.dispose(),t.set("baseAxis",void 0);const e=t.get("xAxis");e&&(q(e.series,t),e.markDirtyExtremes());const i=t.get("yAxis");i&&(q(i.series,t),i.markDirtyExtremes());const s=this.get("cursor");if(s){const a=s.get("snapToSeries");a&&q(a,t)}super._removeSeries(t)}handleWheel(t){const e=this.get("wheelX"),i=this.get("wheelY"),s=this.plotContainer,a=t.originalEvent;if(!Kt(a,this))return;a.preventDefault();const r=s.toLocal(t.point),n=this.get("wheelStep",.2),o=a.deltaY/100,h=a.deltaX/100,c=this.get("wheelZoomPositionX"),l=this.get("wheelZoomPositionY");e!=="zoomX"&&e!=="zoomXY"||h==0||this.xAxes.each(d=>{if(d.get("zoomX")){let u=d.get("start"),g=d.get("end"),m=d.fixPosition(r.x/s.width());c!=null&&(m=c);let p=u-n*(g-u)*h*m,x=g+n*(g-u)*h*(1-m);1/(x-p){if(d.get("zoomX")){let u=d.get("start"),g=d.get("end"),m=d.fixPosition(r.x/s.width());c!=null&&(m=c);let p=u-n*(g-u)*o*m,x=g+n*(g-u)*o*(1-m);1/(x-p){if(d.get("zoomY")){let u=d.get("start"),g=d.get("end"),m=d.fixPosition(r.y/s.height());l!=null&&(m=l);let p=u-n*(g-u)*h*m,x=g+n*(g-u)*h*(1-m);1/(x-p){if(d.get("zoomY")){let u=d.get("start"),g=d.get("end"),m=d.fixPosition(r.y/s.height());l!=null&&(m=l);let p=u-n*(g-u)*o*m,x=g+n*(g-u)*o*(1-m);1/(x-p){if(d.get("panX")){let u=d.get("start"),g=d.get("end"),m=this._getWheelSign(d)*n*(g-u)*h,p=u+m,x=g+m,v=this._fixWheel(p,x);p=v[0],x=v[1],this._handleWheelAnimation(d.zoom(p,x))}}),i!=="panX"&&i!=="panXY"||o==0||this.xAxes.each(d=>{if(d.get("panX")){let u=d.get("start"),g=d.get("end"),m=this._getWheelSign(d)*n*(g-u)*o,p=u+m,x=g+m,v=this._fixWheel(p,x);p=v[0],x=v[1],this._handleWheelAnimation(d.zoom(p,x))}}),e!=="panY"&&e!=="panXY"||h==0||this.yAxes.each(d=>{if(d.get("panY")){let u=d.get("start"),g=d.get("end"),m=this._getWheelSign(d)*n*(g-u)*h,p=u+m,x=g+m,v=this._fixWheel(p,x);p=v[0],x=v[1],this._handleWheelAnimation(d.zoom(p,x))}}),i!=="panY"&&i!=="panXY"||o==0||this.yAxes.each(d=>{if(d.get("panY")){let u=d.get("start"),g=d.get("end"),m=this._getWheelSign(d)*n*(g-u)*o,p=u-m,x=g-m,v=this._fixWheel(p,x);p=v[0],x=v[1],this._handleWheelAnimation(d.zoom(p,x))}})}_handleSetWheel(){const t=this.get("wheelX"),e=this.get("wheelY"),i=this.plotContainer;t!=="none"||e!=="none"?(this._wheelDp=i.events.on("wheel",s=>{const a=s.originalEvent;(t!=="none"&&Math.abs(a.deltaX)!=0||e!=="none"&&Math.abs(a.deltaY)!=0)&&this.handleWheel(s)}),this._disposers.push(this._wheelDp)):this._wheelDp&&this._wheelDp.dispose()}_getWheelSign(t){let e=1;return t.get("renderer").get("inversed")&&(e=-1),e}_fixWheel(t,e){const i=e-t;return t<0&&(e=(t=0)+i),e>1&&(t=(e=1)-i),[t,e]}_handlePlotDown(t){const e=t.originalEvent;if(e.button==2)return;const i=this.plotContainer;let s=i.toLocal(t.point);if((this.get("pinchZoomX")||this.get("pinchZoomY"))&&e.pointerId&&et(i._downPoints).length>0){const a=this.xAxes.getIndex(0),r=this.yAxes.getIndex(0);a&&(this._downStartX=a.get("start",0),this._downEndX=a.get("end",1)),r&&(this._downStartY=r.get("start",0),this._downEndY=r.get("end",1))}if((this.get("panX")||this.get("panY"))&&s.x>=0&&s.y>=0&&s.x<=i.width()&&s.y<=this.height()){this._downPoint={x:e.clientX,y:e.clientY};const a=this.get("panX"),r=this.get("panY");a&&this.xAxes.each(o=>{o._panStart=o.get("start"),o._panEnd=o.get("end")}),r&&this.yAxes.each(o=>{o._panStart=o.get("start"),o._panEnd=o.get("end")});const n="panstarted";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this,originalEvent:t.originalEvent})}}_handleWheelAnimation(t){t?t.events.on("stopped",()=>{this._dispatchWheelAnimation()}):this._dispatchWheelAnimation()}_dispatchWheelAnimation(){const t="wheelended";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}_handlePlotUp(t){const e=this._downPoint;if(e&&(this.get("panX")||this.get("panY"))){let i=this.plotContainer.toLocal(t.point);if(i.x==e.x&&i.y==e.y){const a="pancancelled";this.events.isEnabled(a)&&this.events.dispatch(a,{type:a,target:this,originalEvent:t.originalEvent})}const s="panended";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,originalEvent:t.originalEvent})}this._downPoint=void 0,this.xAxes.each(i=>{i._isPanning=!1}),this.yAxes.each(i=>{i._isPanning=!1})}_handlePlotMove(t){const e=this.plotContainer;if(this.get("pinchZoomX")||this.get("pinchZoomY")){const s=t.pointerId;if(s&&(this._movePoints[s]=t.point,et(e._downPoints).length>1))return void this._handlePinch()}let i=this._downPoint;if(i){i=e.toLocal(this._root.documentPointToRoot(i));let s=e.toLocal(t.point);const a=this.get("panX"),r=this.get("panY");if(a){let n=this.get("scrollbarX");n&&n.events.disableType("rangechanged"),this.xAxes.each(o=>{if(o.get("panX")){o._isPanning=!0;let h=o._panStart,c=o._panEnd,l=(c-h)*(i.x-s.x)/e.width();o.get("renderer").get("inversed")&&(l*=-1);let d=h+l,u=c+l;u-d<1+2*o.get("maxDeviation",1)&&(o.set("start",d),o.set("end",u))}}),n&&n.events.enableType("rangechanged")}if(r){let n=this.get("scrollbarY");n&&n.events.disableType("rangechanged"),this.yAxes.each(o=>{if(o.get("panY")){o._isPanning=!0;let h=o._panStart,c=o._panEnd,l=(c-h)*(i.y-s.y)/e.height();o.get("renderer").get("inversed")&&(l*=-1);let d=h-l,u=c-l;u-d<1+2*o.get("maxDeviation",1)&&(o.set("start",d),o.set("end",u))}}),n&&n.events.enableType("rangechanged")}}}_handlePinch(){const t=this.plotContainer;let e=0,i=[],s=[];if(J(t._downPoints,(a,r)=>{i[e]=r;let n=this._movePoints[a];n&&(s[e]=n),e++}),i.length>1&&s.length>1){const a=t.width(),r=t.height();let n=i[0],o=i[1],h=s[0],c=s[1];if(n&&o&&h&&c){if(h=t.toLocal(h),c=t.toLocal(c),n=t.toLocal(n),o=t.toLocal(o),this.get("pinchZoomX")){const l=this._downStartX,d=this._downEndX;if(l!=null&&d!=null){n.x>o.x&&([n,o]=[o,n],[h,c]=[c,h]);let u=l+n.x/a*(d-l),g=l+o.x/a*(d-l),m=l+h.x/a*(d-l),p=l+c.x/a*(d-l),x=Math.max(.001,g-u)/Math.max(.001,p-m),v=l*x+u-m*x,_=d*x+g-p*x;this.xAxes.each(f=>{let w=f.fixPosition(v),A=f.fixPosition(_);f.zoom(w,A,0)})}}if(this.get("pinchZoomY")){const l=this._downStartY,d=this._downEndY;if(l!=null&&d!=null){n.y{let w=f.fixPosition(v),A=f.fixPosition(_);f.zoom(w,A,0)})}}}}}_handleCursorPosition(){const t=this.get("cursor");if(t){const e=t.getPrivate("point");let i=t.get("snapToSeries");if(t._downPoint&&(i=void 0),i&&e){const s=t.get("snapToSeriesBy"),a=[];P(i,o=>{if(!o.isHidden()&&!o.isHiding())if(s!="x!"&&s!="y!"){const h=o.startIndex(),c=o.endIndex();for(let l=h;l{const h=o.get("point");if(h){let c=0;c=s=="x"||s=="x!"?Math.abs(e.x-h.x):s=="y"||s=="y!"?Math.abs(e.y-h.y):Math.hypot(e.x-h.x,e.y-h.y),c{const h=o.get("tooltip");h&&h._setDataItem(void 0)}),r){let o=r.component;o.showDataItemTooltip(r);const h=r.get("point");h&&t.handleMove(o.toGlobal({x:h.x-o.x(),y:h.y-o.y()}),!0)}}}}_updateCursor(){let t=this.get("cursor");t&&t.updateCursor()}_addCursor(t){this.plotContainer.children.push(t)}_prepareChildren(){if(super._prepareChildren(),this.series.each(t=>{this._colorize(t)}),(this.isDirty("wheelX")||this.isDirty("wheelY"))&&this._handleSetWheel(),this.isDirty("cursor")){const t=this._prevSettings.cursor,e=this.get("cursor");e!==t&&(this._disposeProperty("cursor"),t&&t.dispose(),e&&(e._setChart(this),this._addCursor(e),this._pushPropertyDisposer("cursor",e.events.on("selectended",()=>{this._handleCursorSelectEnd()}))),this._prevSettings.cursor=e)}if(this.isDirty("scrollbarX")){const t=this._prevSettings.scrollbarX,e=this.get("scrollbarX");e!==t&&(this._disposeProperty("scrollbarX"),t&&t.dispose(),e&&(e.parent||this.topAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarX",e.events.on("rangechanged",i=>{this._handleScrollbar(this.xAxes,i.start,i.end,i.grip)})),e.setPrivate("positionTextFunction",i=>{const s=this.xAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarX=e)}if(this.isDirty("scrollbarY")){const t=this._prevSettings.scrollbarY,e=this.get("scrollbarY");e!==t&&(this._disposeProperty("scrollbarY"),t&&t.dispose(),e&&(e.parent||this.rightAxesContainer.children.push(e),this._pushPropertyDisposer("scrollbarY",e.events.on("rangechanged",i=>{this._handleScrollbar(this.yAxes,i.start,i.end,i.grip)})),e.setPrivate("positionTextFunction",i=>{const s=this.yAxes.getIndex(0);return s&&s.getTooltipText(i,!1)||""})),this._prevSettings.scrollbarY=e)}this._handleZoomOut()}_processSeries(t){super._processSeries(t);const e=t.get("xAxis"),i=t.get("yAxis");vt(e.series,t),vt(i.series,t),t._posXDp=t.addDisposer(e.events.on("positionchanged",()=>{t._fixPosition()})),t._posXDp=t.addDisposer(i.events.on("positionchanged",()=>{t._fixPosition()})),t.get("baseAxis")||(i.isType("CategoryAxis")||i.isType("DateAxis")?t.set("baseAxis",i):t.set("baseAxis",e)),t.get("stacked")&&(t._markDirtyKey("stacked"),P(t.dataItems,s=>{s.set("stackToItemY",void 0),s.set("stackToItemX",void 0)})),t._markDirtyAxes(),i.markDirtyExtremes(),e.markDirtyExtremes(),this._colorize(t)}_colorize(t){const e=this.get("colors");if(e&&t.get("fill")==null){const i=e.next();t._setSoft("stroke",i),t._setSoft("fill",i)}}_handleCursorSelectEnd(){const t=this.get("cursor"),e=t.get("behavior"),i=t.getPrivate("downPositionX",0),s=t.getPrivate("downPositionY",0),a=Math.min(1,Math.max(0,t.getPrivate("positionX",.5))),r=Math.min(1,Math.max(0,t.getPrivate("positionY",.5)));this.xAxes.each(n=>{if(e==="zoomX"||e==="zoomXY"){let o=n.toAxisPosition(i),h=n.toAxisPosition(a);n.zoom(o,h)}n.setPrivate("updateScrollbar",!0)}),this.yAxes.each(n=>{if(e==="zoomY"||e==="zoomXY"){let o=n.toAxisPosition(s),h=n.toAxisPosition(r);n.zoom(o,h)}n.setPrivate("updateScrollbar",!0)})}_handleScrollbar(t,e,i,s){t.each(a=>{let r=a.fixPosition(e),n=a.fixPosition(i),o=a.zoom(r,n,void 0,s);const h="updateScrollbar";a.setPrivateRaw(h,!1),o?o.events.on("stopped",()=>{a.setPrivateRaw(h,!0)}):a.setPrivateRaw(h,!0)})}_processAxis(t,e){return t.events.onAll(i=>{if(i.type==="clear")P(i.oldValues,s=>{this._removeAxis(s)});else if(i.type==="push")e.children.push(i.newValue),i.newValue.processChart(this);else if(i.type==="setIndex")e.children.setIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="insertIndex")e.children.insertIndex(i.index,i.newValue),i.newValue.processChart(this);else if(i.type==="removeIndex")this._removeAxis(i.oldValue);else{if(i.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.children.moveValue(i.value,i.newIndex),i.value.processChart(this)}})}_removeAxis(t){if(!t.isDisposed()){const e=t.parent;e&&e.children.removeValue(t);const i=t.gridContainer,s=i.parent;s&&s.children.removeValue(i);const a=t.topGridContainer,r=a.parent;r&&r.children.removeValue(a)}}_updateChartLayout(){const t=this.leftAxesContainer.width(),e=this.rightAxesContainer.width(),i=this.bottomAxesContainer;i.set("paddingLeft",t),i.set("paddingRight",e);const s=this.topAxesContainer;s.set("paddingLeft",t),s.set("paddingRight",e)}processAxis(t){this.get("cursor")&&(this.addDisposer(t.on("start",()=>{this._updateCursor()})),this.addDisposer(t.on("end",()=>{this._updateCursor()})))}_handleAxisSelection(t,e){let i=t.fixPosition(t.get("start",0)),s=t.fixPosition(t.get("end",1));if(i>s&&([i,s]=[s,i]),this.xAxes.indexOf(t)!=-1){if(e||t.getPrivate("updateScrollbar")){let a=this.get("scrollbarX");!a||a.getPrivate("isBusy")&&!e||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}}else if(this.yAxes.indexOf(t)!=-1&&(e||t.getPrivate("updateScrollbar"))){let a=this.get("scrollbarY");!a||a.getPrivate("isBusy")&&!e||(a.setRaw("start",i),a.setRaw("end",s),a.updateGrips())}this._handleZoomOut()}_handleZoomOut(){let t=this.zoomOutButton;if(t&&t.parent){let e=!1;this.xAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(e=!0)}),this.yAxes.each(i=>{i.get("start")==0&&i.get("end")==1||(e=!0)}),e?t.isHidden()&&t.show():t.hide()}}inPlot(t){const e=this.plotContainer,i=this.getPrivate("otherCharts",this._otherCharts),s=e.toGlobal(t);if(t.x>=-.5&&t.y>=-.5&&t.x<=e.width()+.5&&t.y<=e.height()+.5)return!0;if(i)for(let a=i.length-1;a>=0;a--){const r=i[a];if(r!=this){const n=r.plotContainer,o=this._root.rootPointToDocument(s),h=r._root.documentPointToRoot(o),c=n.toLocal(h);if(c.x>=-.1&&c.y>=-.1&&c.x<=n.width()+.1&&c.y<=n.height()+.1)return!0}}return!1}arrangeTooltips(){const t=this.plotContainer,e=t.width(),i=t.height(),s=this.height();let a=t._display.toGlobal({x:0,y:0}),r=t._display.toGlobal({x:e,y:i});const n=[];let o,h,c=0,l=1/0,d=this._movePoint,u=this.get("maxTooltipDistance"),g=this.get("maxTooltipDistanceBy","xy");b(u)&&this.series.each(p=>{if(!p.isHidden()){const x=p.get("tooltip");if(x){let v=x.get("pointTo");if(v){let _=Math.hypot(d.x-v.x,d.y-v.y);g=="x"?_=Math.abs(d.x-v.x):g=="y"&&(_=Math.abs(d.y-v.y)),_{const x=p.get("tooltip");if(x){let v=!1,_=x.get("pointTo");if(_){if(u>=0){let f=x.get("pointTo");if(f&&p!=o){let w=Math.hypot(h.x-f.x,h.y-f.y);g=="x"?w=Math.abs(h.x-f.x):g=="y"&&(w=Math.abs(h.y-f.y)),w>u&&(v=!0)}}else u==-1&&p!=o&&(v=!0);this.inPlot(this._tooltipToLocal(_))&&x.dataItem?v||(c+=_.y):v=!0,v||p.isHidden()||p.isHiding()?x.hide(0):(x.show(),n.push(x),m.push(p))}}}),this.setPrivate("tooltipSeries",m),this.get("arrangeTooltips")){const p=this._root.tooltipContainer,x=n.length;if(c/x>i/2+a.y){n.sort((_,f)=>yt(f.get("pointTo").y,_.get("pointTo").y));let v=r.y;if(P(n,_=>{let f=_.height(),w=_.get("centerY");w instanceof Mt&&(f*=w.value),f+=_.get("marginBottom",0),_.set("bounds",{left:a.x,top:a.y,right:r.x,bottom:v}),_.setPrivate("customData",{left:a.x,top:a.y,right:r.x,bottom:v}),v=Math.min(v-f,_._fy-f),_.parent==p&&p.children.moveValue(_,0)}),v<0){n.reverse();let _=v;P(n,f=>{let w=f.get("bounds");if(w){let A=w.top-v,F=w.bottom-v;A<_&&(A=_,F=A+f.height()),f.set("bounds",{left:w.left,top:A,right:w.right,bottom:F}),_=w.bottom-v+f.get("marginBottom",0)}})}}else{n.reverse(),n.sort((_,f)=>yt(_.get("pointTo").y,f.get("pointTo").y));let v=0;if(P(n,_=>{let f=_.height(),w=_.get("centerY");w instanceof Mt&&(f*=w.value),f+=_.get("marginBottom",0),_.set("bounds",{left:a.x,top:v,right:r.x,bottom:Math.max(a.y+s,v+f)}),_.parent==p&&p.children.moveValue(_,0),v=Math.max(v+f,_._fy+f)}),v>s){n.reverse();let _=s;P(n,f=>{let w=f.get("bounds");if(w){let A=w.top-(s-v),F=w.bottom-(s-v);F>_&&(F=_,A=F-f.height()),f.set("bounds",{left:w.left,top:A,right:w.right,bottom:F}),_=F-f.height()-f.get("marginBottom",0)}})}}}}_tooltipToLocal(t){return this.plotContainer.toLocal(t)}zoomOut(){this.xAxes.each(t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)}),this.yAxes.each(t=>{t.setPrivate("updateScrollbar",!0),t.zoom(0,1)})}}Object.defineProperty(nt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYChart"}),Object.defineProperty(nt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Yt.classNames.concat([nt.className])});class z extends Y{_beforeChanged(){super._beforeChanged(),(this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Grid"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Y.classNames.concat([z.className])});class rt extends T{constructor(){super(...arguments),Object.defineProperty(this,"lineX",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(z.new(this._root,{themeTags:["x"]}))}),Object.defineProperty(this,"lineY",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(z.new(this._root,{themeTags:["y"]}))}),Object.defineProperty(this,"selection",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(Y.new(this._root,{themeTags:["selection","cursor"],layer:30}))}),Object.defineProperty(this,"_movePoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_lastPoint",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0}}),Object.defineProperty(this,"_tooltipX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_tooltipY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_toY",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this._settings.themeTags=S(this._settings.themeTags,["xy","cursor"]),super._afterNew(),this.setAll({width:k,height:k,isMeasured:!0,position:"absolute"}),this.states.create("hidden",{visible:!0,opacity:0}),this._drawLines(),this.setPrivateRaw("visible",!1),this._disposers.push(this.setTimeout(()=>{this.setPrivate("visible",!0)},500)),this._disposers.push(this.lineX.events.on("positionchanged",()=>{this._handleXLine()})),this._disposers.push(this.lineY.events.on("positionchanged",()=>{this._handleYLine()})),this._disposers.push(this.lineX.events.on("focus",t=>this._handleLineFocus(t.target))),this._disposers.push(this.lineX.events.on("blur",t=>this._handleLineBlur(t.target))),this._disposers.push(this.lineY.events.on("focus",t=>this._handleLineFocus(t.target))),this._disposers.push(this.lineY.events.on("blur",t=>this._handleLineBlur(t.target))),wt("keyboardevents")&&this._disposers.push(qt(document,"keydown",t=>{this._handleLineMove(t.keyCode)}))}_setUpTouch(){const t=this.chart;t&&(t.plotContainer._display.cancelTouch=this.get("behavior")!="none")}_handleXLine(){let t=this.lineX.x(),e=!0;(t<0||t>this.width())&&(e=!1),this.lineX.setPrivate("visible",e)}_handleYLine(){let t=this.lineY.y(),e=!0;(t<0||t>this.height())&&(e=!1),this.lineY.setPrivate("visible",e)}_handleLineMove(t){let e="",i=0,s=.1;const a=this.chart;this._root.focused(this.lineX)?(a&&a.xAxes.length&&(s=a.xAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionX",0),e="positionX",t==37?i-=s:t==39&&(i+=s)):this._root.focused(this.lineY)&&(a&&a.yAxes.length&&(s=a.yAxes.getIndex(0).getCellWidthPosition()),i=this.getPrivate("positionY",0),e="positionY",t==38?i-=s:t==40&&(i+=s)),i<0?i=0:i>1&&(i=1),e!=""&&this.set(e,i)}_handleLineFocus(t){this.setAll({positionX:this.getPrivate("positionX"),positionY:this.getPrivate("positionY"),alwaysShow:!0})}_handleLineBlur(t){this.setAll({positionX:void 0,positionY:void 0,alwaysShow:!1})}_prepareChildren(){if(super._prepareChildren(),this.isDirty("xAxis")){this._tooltipX=!1;const t=this.get("xAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipX=!0,this._disposers.push(e.on("pointTo",()=>{this._updateXLine(e)})))}}if(this.isDirty("yAxis")){this._tooltipY=!1;const t=this.get("yAxis");if(t){const e=t.get("tooltip");e&&(this._tooltipY=!0,this._disposers.push(e.on("pointTo",()=>{this._updateYLine(e)})))}}}_handleSyncWith(){const t=this.chart;if(t){const e=this.get("syncWith"),i=[];e&&P(e,s=>{const a=s.chart;a&&i.push(a)}),t._otherCharts=i}}_updateChildren(){if(super._updateChildren(),this._handleSyncWith(),this.isDirty("positionX")||this.isDirty("positionY")){const t=this.get("positionX"),e=this.get("positionY");t==null&&e==null?this.hide(0):(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0))),this.handleMove())}}_updateXLine(t){let e=X(this._display.toLocal(t.get("pointTo",{x:0,y:0})).x,2);this._toX!=e&&(this.lineX.animate({key:"x",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toX=e)}_updateYLine(t){let e=X(this._display.toLocal(t.get("pointTo",{x:0,y:0})).y,2);this._toY!=e&&(this.lineY.animate({key:"y",to:e,duration:t.get("animationDuration",0),easing:t.get("animationEasing")}),this._toY=e)}_drawLines(){this.lineX.set("draw",t=>{t.moveTo(0,0),t.lineTo(0,this.height())}),this.lineY.set("draw",t=>{t.moveTo(0,0),t.lineTo(this.width(),0)})}updateCursor(){this.get("alwaysShow")&&(this._movePoint=this.toGlobal(this._getPoint(this.get("positionX",0),this.get("positionY",0)))),this.handleMove()}_setChart(t){this.chart=t,this._handleSyncWith();const e=t.plotContainer;this.events.on("boundschanged",()=>{this._disposers.push(this.setTimeout(()=>{this.updateCursor()},50))}),wt("touchevents")&&(this._disposers.push(e.events.on("click",s=>{Jt(s.originalEvent)&&this._handleMove(s)})),this._setUpTouch()),this._disposers.push(e.events.on("pointerdown",s=>{this._handleCursorDown(s)})),this._disposers.push(e.events.on("globalpointerup",s=>{this._handleCursorUp(s),s.native||this.isHidden()||this._handleMove(s)})),this._disposers.push(e.events.on("globalpointermove",s=>{(this.get("syncWith")||et(e._downPoints).length!=0||s.native||!this.isHidden())&&this._handleMove(s)}));const i=this.parent;i&&i.children.moveValue(this.selection)}_inPlot(t){const e=this.chart;return!!e&&e.inPlot(t)}_handleCursorDown(t){if(t.originalEvent.button==2)return;const e=t.point;let i=this._display.toLocal(e);const s=this.chart;if(this.selection.set("draw",()=>{}),s&&this._inPlot(i)){if(this._downPoint=i,this.get("behavior")!="none"){this.selection.show();const n="selectstarted";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this,originalEvent:t.originalEvent})}let a=this._getPosition(i).x,r=this._getPosition(i).y;this.setPrivate("downPositionX",a),this.setPrivate("downPositionY",r)}}_handleCursorUp(t){if(this._downPoint){const e=this.get("behavior","none");if(e!="none"){e.charAt(0)==="z"&&this.selection.hide();const i=t.point;let s=this._display.toLocal(i);const a=this._downPoint,r=this.get("moveThreshold",1);if(s&&a){let n=!1;if(e!=="zoomX"&&e!=="zoomXY"&&e!=="selectX"&&e!=="selectXY"||Math.abs(s.x-a.x)>r&&(n=!0),e!=="zoomY"&&e!=="zoomXY"&&e!=="selectY"&&e!=="selectXY"||Math.abs(s.y-a.y)>r&&(n=!0),n){const o="selectended";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:t.originalEvent})}else{const o="selectcancelled";this.events.isEnabled(o)&&this.events.dispatch(o,{type:o,target:this,originalEvent:t.originalEvent})}}}}this._downPoint=void 0}_handleMove(t){if(this.getPrivate("visible")){const e=this.chart;if(e&&et(e.plotContainer._downPoints).length>1)return void this.set("forceHidden",!0);this.set("forceHidden",!1);const i=t.point,s=this._lastPoint;if(Math.round(s.x)===Math.round(i.x)&&Math.round(s.y)===Math.round(i.y))return;this._lastPoint=i,this.setPrivate("lastPoint",i),this.handleMove({x:i.x,y:i.y},!1,t.originalEvent)}}_getPosition(t){return{x:t.x/this.width(),y:t.y/this.height()}}handleMove(t,e,i){t||(t=this._movePoint);const s=this.get("alwaysShow");if(!t)return void this.hide(0);this._movePoint=t;let a=this._display.toLocal(t),r=this.chart;if(r&&(this._inPlot(a)||this._downPoint)){r._movePoint=t,this.isHidden()&&(this.show(),this.get("behavior","").charAt(0)=="z"&&this.selection.set("draw",()=>{}));let n=a.x,o=a.y,h=this._getPosition(a);this.setPrivate("point",a);let c=this.get("snapToSeries");this._downPoint&&(c=void 0);let l=this.get("positionX"),d=h.x;b(l)&&(d=l);let u=this.get("positionY"),g=h.y;b(u)&&(g=u),this.setPrivate("positionX",d),this.setPrivate("positionY",g);const m=this._getPoint(d,g);if(n=m.x,o=m.y,r.xAxes.each(p=>{p._handleCursorPosition(d,c),s&&p.handleCursorShow()}),r.yAxes.each(p=>{p._handleCursorPosition(g,c),s&&p.handleCursorShow()}),!e){r._handleCursorPosition();const p="cursormoved";this.events.isEnabled(p)&&this.events.dispatch(p,{type:p,target:this,point:t,originalEvent:i})}this._updateLines(n,o),r.arrangeTooltips()}else if(!this._downPoint&&!s){this.hide(0);const n="cursorhidden";this.events.isEnabled(n)&&this.events.dispatch(n,{type:n,target:this})}this._downPoint&&this.get("behavior")!="none"&&this._updateSelection(a)}_getPoint(t,e){return{x:this.width()*t,y:this.height()*e}}_updateLines(t,e){this._tooltipX||this.lineX.set("x",t),this._tooltipY||this.lineY.set("y",e),this._drawLines()}_updateSelection(t){const e=this.selection,i=this.get("behavior"),s=this.width(),a=this.height();t.x<0&&(t.x=0),t.x>s&&(t.x=s),t.y<0&&(t.y=0),t.y>a&&(t.y=a),e.set("draw",r=>{const n=this._downPoint;n&&(i==="zoomXY"||i==="selectXY"?(r.moveTo(n.x,n.y),r.lineTo(n.x,t.y),r.lineTo(t.x,t.y),r.lineTo(t.x,n.y),r.lineTo(n.x,n.y)):i==="zoomX"||i==="selectX"?(r.moveTo(n.x,0),r.lineTo(n.x,a),r.lineTo(t.x,a),r.lineTo(t.x,0),r.lineTo(n.x,0)):i!=="zoomY"&&i!=="selectY"||(r.moveTo(0,n.y),r.lineTo(s,n.y),r.lineTo(s,t.y),r.lineTo(0,t.y),r.lineTo(0,n.y)))})}_onHide(){if(this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorHide()}),t.yAxes.each(e=>{e.handleCursorHide()}),t.series.each(e=>{e.handleCursorHide()}))}super._onHide()}_onShow(){if(!this.isHidden()){let t=this.chart;t&&(t.xAxes.each(e=>{e.handleCursorShow()}),t.yAxes.each(e=>{e.handleCursorShow()}))}super._onShow()}_dispose(){super._dispose(),this.selection.dispose()}}function le(y,t){return y==null?t:t==null?y:ty?t:y}Object.defineProperty(rt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYCursor"}),Object.defineProperty(rt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:T.classNames.concat([rt.className])});class W extends Lt{constructor(){super(...arguments),Object.defineProperty(this,"_xField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yOpenField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_xHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yLowField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_yHighField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_axesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stackDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataSets",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_mainContainerMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"mainContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(T.new(this._root,{}))}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Ot}),Object.defineProperty(this,"_skipped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_couldStackTo",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_reallyStackedTo",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_stackedSeries",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_aLocationX0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationX1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_aLocationY0",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_aLocationY1",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_showBullets",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueX","openValueX","lowValueX","highValueX"]}),Object.defineProperty(this,"valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:["valueY","openValueY","lowValueY","highValueY"]}),Object.defineProperty(this,"_valueXFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueXShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__valueYShowFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_emptyDataItem",{enumerable:!0,configurable:!0,writable:!0,value:new st(this,void 0,{})}),Object.defineProperty(this,"_dataSetId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipFieldY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posXDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_posYDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_afterNew(){this.fields.push("categoryX","categoryY","openCategoryX","openCategoryY"),this.valueFields.push("valueX","valueY","openValueX","openValueY","lowValueX","lowValueY","highValueX","highValueY"),this._setRawDefault("vcx",1),this._setRawDefault("vcy",1),this._setRawDefault("valueXShow","valueXWorking"),this._setRawDefault("valueYShow","valueYWorking"),this._setRawDefault("openValueXShow","openValueXWorking"),this._setRawDefault("openValueYShow","openValueYWorking"),this._setRawDefault("lowValueXShow","lowValueXWorking"),this._setRawDefault("lowValueYShow","lowValueYWorking"),this._setRawDefault("highValueXShow","highValueXWorking"),this._setRawDefault("highValueYShow","highValueYWorking"),this._setRawDefault("lowValueXGrouped","low"),this._setRawDefault("lowValueYGrouped","low"),this._setRawDefault("highValueXGrouped","high"),this._setRawDefault("highValueYGrouped","high"),super._afterNew(),this.set("maskContent",!0),this._disposers.push(this.axisRanges.events.onAll(t=>{if(t.type==="clear")P(t.oldValues,e=>{this._removeAxisRange(e)});else if(t.type==="push")this._processAxisRange(t.newValue);else if(t.type==="setIndex")this._processAxisRange(t.newValue);else if(t.type==="insertIndex")this._processAxisRange(t.newValue);else if(t.type==="removeIndex")this._removeAxisRange(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(t.value)}})),this.states.create("hidden",{opacity:1,visible:!1}),this._makeFieldNames()}_processAxisRange(t){const e=T.new(this._root,{});t.container=e,this.children.push(e),t.series=this;const i=t.axisDataItem;i.setRaw("isRange",!0);const s=i.component;if(s){s._processAxisRange(i,["range","series"]);const a=i.get("bullet");if(a){const n=a.get("sprite");n&&n.setPrivate("visible",!1)}const r=i.get("axisFill");r&&e.set("mask",r),s._seriesAxisRanges.push(i)}}_removeAxisRange(t){const e=t.axisDataItem,i=e.component;i.disposeDataItem(e),q(i._seriesAxisRanges,e);const s=t.container;s&&s.dispose()}_updateFields(){super._updateFields(),this._valueXFields=[],this._valueYFields=[],this._valueXShowFields=[],this._valueYShowFields=[],this.__valueXShowFields=[],this.__valueYShowFields=[],this.valueXFields&&P(this.valueXFields,t=>{if(this.get(t+"Field")){this._valueXFields.push(t);let e=this.get(t+"Show");this.__valueXShowFields.push(e),e.indexOf("Working")!=-1?this._valueXShowFields.push(e.split("Working")[0]):this._valueXShowFields.push(e)}}),this.valueYFields&&P(this.valueYFields,t=>{if(this.get(t+"Field")){this._valueYFields.push(t);let e=this.get(t+"Show");this.__valueYShowFields.push(e),e.indexOf("Working")!=-1?this._valueYShowFields.push(e.split("Working")[0]):this._valueYShowFields.push(e)}})}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this),Pt(this.get("xAxis").series,this),Pt(this.get("yAxis").series,this)}_min(t,e){let i=le(this.getPrivate(t),e);this.setPrivate(t,i)}_max(t,e){let i=he(this.getPrivate(t),e);this.setPrivate(t,i)}_shouldMakeBullet(t){const e=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis");if(!e.inited||!i.inited)return!1;const a=this.get("minBulletDistance",0);if(a>0){let r=this.startIndex(),n=this.endIndex()-r;if(e==s){if(e.get("renderer").axisLength()/n{P(this._valueXShowFields,o=>{let h=n.get(o);h!=null&&(r&&(h+=this.getStackedXValue(n,o)),this._min("minX",h),this._max("maxX",h))}),P(this._valueYShowFields,o=>{let h=n.get(o);h!=null&&(r&&(h+=this.getStackedYValue(n,o)),this._min("minY",h),this._max("maxY",h))}),t.processSeriesDataItem(n,this._valueXFields),e.processSeriesDataItem(n,this._valueYFields)}),t._seriesValuesDirty=!0,e._seriesValuesDirty=!0,this.get("ignoreMinMax")||((this.isPrivateDirty("minX")||this.isPrivateDirty("maxX"))&&t.markDirtyExtremes(),(this.isPrivateDirty("minY")||this.isPrivateDirty("maxY"))&&e.markDirtyExtremes()),this._markStakedDirtyStack(),this.get("tooltipDataItem")||this.updateLegendValue(void 0)),(this.isDirty("vcx")||this.isDirty("vcy"))&&this._markStakedDirtyStack(),this._dataGrouped||(t._groupSeriesData(this),e._groupSeriesData(this),this._dataGrouped=!0),this._valuesDirty||this.isPrivateDirty("startIndex")||this.isPrivateDirty("endIndex")||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty){let n=this.startIndex(),o=this.endIndex(),h=this.get("minBulletDistance",0);if(h>0&&i&&(i.get("renderer").axisLength()/(o-n)>h?this._showBullets=!0:this._showBullets=!1),(this._psi!=n||this._pei!=o||this.isDirty("vcx")||this.isDirty("vcy")||this._stackDirty||this._valuesDirty)&&!this._selectionProcessed){this._selectionProcessed=!0;const c=this.get("vcx",1),l=this.get("vcy",1),d=this.get("stacked",!1),u=this.getPrivate("outOfSelection");if(i===t||!i)if(e._calculateTotals(),this.setPrivateRaw("selectionMinY",void 0),this.setPrivateRaw("selectionMaxY",void 0),u)e.markDirtySelectionExtremes();else for(let g=n;g0){let t=this._mainContainerMask;t==null&&(t=this.children.push(Y.new(this._root,{})),this._mainContainerMask=t,t.set("draw",(e,i)=>{const s=this.parent;if(s){const a=this._root.container.width(),r=this._root.container.height();e.moveTo(-a,-r),e.lineTo(-a,2*r),e.lineTo(2*a,2*r),e.lineTo(2*a,-r),e.lineTo(-a,-r),this.axisRanges.each(n=>{const o=n.axisDataItem.get("axisFill");if(s&&o){let h=o.get("draw");h&&h(e,i)}})}this.mainContainer._display.mask=t._display})),t.markDirty(),t._markDirtyKey("fill")}else this.mainContainer._display.mask=null}_updateChildren(){super._updateChildren(),this._x=this.x(),this._y=this.y(),this._makeRangeMask()}_stack(){const t=this.chart;if(t){const e=t.series.indexOf(this);if(this._couldStackTo=[],e>0){let i;for(let s=e-1;s>=0&&(i=t.series.getIndex(s),i.get("xAxis")!==this.get("xAxis")||i.get("yAxis")!==this.get("yAxis")||i.className!==this.className||(this._couldStackTo.push(i),i.get("stacked")));s--);}this._stackDataItems()}}_unstack(){J(this._reallyStackedTo,(t,e)=>{delete e._stackedSeries[this.uid]}),this._reallyStackedTo={},P(this.dataItems,t=>{t.setRaw("stackToItemY",void 0),t.setRaw("stackToItemX",void 0)})}_stackDataItems(){const t=this.get("baseAxis"),e=this.get("xAxis"),i=this.get("yAxis");let s,a;t===e?(s="valueY",a="stackToItemY"):t===i&&(s="valueX",a="stackToItemX");let r=this._couldStackTo.length,n=0;const o=this.get("stackToNegative");this._reallyStackedTo={},P(this.dataItems,h=>{for(let c=0;c=0&&g>=0){h.setRaw(a,d),this._reallyStackedTo[l.uid]=l,l._stackedSeries[this.uid]=this;break}if(u<0&&g<0){h.setRaw(a,d),this._reallyStackedTo[l.uid]=l,l._stackedSeries[this.uid]=this;break}}}else if(b(u)&&b(g)){h.setRaw(a,d),this._reallyStackedTo[l.uid]=l,l._stackedSeries[this.uid]=this;break}}}n++})}processXSelectionDataItem(t,e,i){P(this.__valueXShowFields,s=>{let a=t.get(s);a!=null&&(i&&(a+=this.getStackedXValueWorking(t,s)),this._min("selectionMinX",a),this._max("selectionMaxX",a*e))})}processYSelectionDataItem(t,e,i){P(this.__valueYShowFields,s=>{let a=t.get(s);a!=null&&(i&&(a+=this.getStackedYValueWorking(t,s)),this._min("selectionMinY",a),this._max("selectionMaxY",a*e))})}getStackedYValueWorking(t,e){const i=t.get("stackToItemY");if(i){const s=i.component;return i.get(e,0)*s.get("vcy",1)+this.getStackedYValueWorking(i,e)}return 0}getStackedXValueWorking(t,e){const i=t.get("stackToItemX");if(i){const s=i.component;return i.get(e,0)*s.get("vcx",1)+this.getStackedXValueWorking(i,e)}return 0}getStackedYValue(t,e){const i=t.get("stackToItemY");return i?i.get(e,0)+this.getStackedYValue(i,e):0}getStackedXValue(t,e){const i=t.get("stackToItemX");return i?i.get(e,0)+this.getStackedXValue(i,e):0}createLegendMarker(t){this.updateLegendMarker()}_markDirtyAxes(){this._axesDirty=!0,this.markDirty()}_markDataSetDirty(){this._afterDataChange(),this._valuesDirty=!0,this._dataProcessed=!1,this._aggregatesCalculated=!1,this.markDirty()}_clearDirty(){super._clearDirty(),this._axesDirty=!1,this._selectionProcessed=!1,this._stackDirty=!1,this._dataProcessed=!1}_positionBullet(t){let e=t.get("sprite");if(e){let i=e.dataItem,s=t.get("locationX",i.get("locationX",.5)),a=t.get("locationY",i.get("locationY",.5)),r=this.get("xAxis"),n=this.get("yAxis");const o=r.getDataItemPositionX(i,this._xField,s,this.get("vcx",1)),h=n.getDataItemPositionY(i,this._yField,a,this.get("vcy",1));let c=this.getPoint(o,h),l=i.get("left",c.x),d=i.get("right",c.x),u=i.get("top",c.y),g=i.get("bottom",c.y);if(this._shouldShowBullet(o,h)){t.getPrivate("hidden")?e.setPrivate("visible",!1):e.setPrivate("visible",!0);let m=d-l,p=g-u;e.isType("Label")&&(e.setPrivate("maxWidth",Math.abs(m)),e.setPrivate("maxHeight",Math.abs(p)));let x=l+m*s,v=g-p*a;e.set("x",x),e.set("y",v)}else e.setPrivate("visible",!1)}}_shouldShowBullet(t,e){return this._showBullets}setDataSet(t){if(this._dataSets[t]){this._handleDataSetChange(),this._dataItems=this._dataSets[t],this._markDataSetDirty(),this._dataSetId=t;const e="datasetchanged";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,id:t})}}resetGrouping(){J(this._dataSets,(t,e)=>{e!=this._mainDataItems&&P(e,i=>{this.disposeDataItem(i)})}),this._dataSets={},this._dataItems=this.mainDataItems}_handleDataSetChange(){this.bullets.length>0&&P(this._dataItems,t=>{let e=t.bullets;e&&P(e,i=>{if(i){let s=i.get("sprite");s&&s.setPrivate("visible",!1)}})}),this._selectionProcessed=!1}show(t){const e=Object.create(null,{show:{get:()=>super.show}});return K(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(e.show.call(this,t).then(()=>{this._isShowing=!1;let s=this.get("xAxis"),a=this.get("yAxis"),r=this.get("baseAxis");a!==r&&a.markDirtySelectionExtremes(),s!==r&&s.markDirtySelectionExtremes()})),i.push(this.bulletsContainer.show(t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return K(this,void 0,void 0,function*(){this._fixVC();let i=[];i.push(e.hide.call(this,t).then(()=>{this._isHiding=!1})),i.push(this.bulletsContainer.hide(t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return K(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];b(e)||(e=this.get("stateAnimationDuration",0));const a=this.get("stateAnimationEasing");P(this._valueFields,r=>{s.push(t.animate({key:r+"Working",to:t.get(r),duration:e,easing:a}).waitForStop())}),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return K(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],a=this.states.create("hidden",{});b(e)||(e=a.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const r=a.get("stateAnimationEasing",this.get("stateAnimationEasing")),n=this.get("xAxis"),o=this.get("yAxis"),h=this.get("baseAxis"),c=this.get("stacked");if(h!==n&&h||P(this._valueYFields,l=>{let d=o.getPrivate("min"),u=o.baseValue();b(d)&&d>u&&(u=d),c&&(u=0),t.get(l)!=null&&s.push(t.animate({key:l+"Working",to:u,duration:e,easing:r}).waitForStop())}),h===o||!h){let l=n.getPrivate("min"),d=n.baseValue();b(l)&&l>d&&(d=l),c&&(d=0),P(this._valueXFields,u=>{t.get(u)!=null&&s.push(t.animate({key:u+"Working",to:d,duration:e,easing:r}).waitForStop())})}yield Promise.all(s)})}_markDirtyStack(){this._stackDirty=!0,this.markDirty(),this._markStakedDirtyStack()}_markStakedDirtyStack(){const t=this._stackedSeries;t&&J(t,(e,i)=>{i._stackDirty||i._markDirtyStack()})}_afterChanged(){super._afterChanged(),this._skipped&&(this._markDirtyAxes(),this._skipped=!1)}showDataItemTooltip(t){this.updateLegendMarker(t),this.updateLegendValue(t);const e=this.get("tooltip");if(e){if(this.isHidden())this.hideTooltip();else if(e._setDataItem(t),t){let i=this.get("locationX",0),s=this.get("locationY",1),a=t.get("locationX",i),r=t.get("locationY",s);const n=this.get("xAxis"),o=this.get("yAxis"),h=this.get("vcx",1),c=this.get("vcy",1),l=n.getDataItemPositionX(t,this._tooltipFieldX,this._aLocationX0+(this._aLocationX1-this._aLocationX0)*a,h),d=o.getDataItemPositionY(t,this._tooltipFieldY,this._aLocationY0+(this._aLocationY1-this._aLocationY0)*r,c),u=this.getPoint(l,d);let g=!0;if(P(this._valueFields,m=>{t.get(m)==null&&(g=!1)}),g){const m=this.chart;m&&m.inPlot(u)?(e.label.text.markDirtyText(),e.set("tooltipTarget",this._getTooltipTarget(t)),e.set("pointTo",this._display.toGlobal({x:u.x,y:u.y}))):e._setDataItem(void 0)}else e._setDataItem(void 0)}}}hideTooltip(){const t=this.get("tooltip");return t&&t.set("tooltipTarget",this),super.hideTooltip()}_getTooltipTarget(t){if(this.get("seriesTooltipTarget")=="bullet"){const e=t.bullets;if(e&&e.length>0){const i=e[0].get("sprite");if(i)return i}}return this}updateLegendValue(t){const e=this.get("legendDataItem");if(e){const i=e.get("label");if(i){let a="";t?(i._setDataItem(t),a=this.get("legendLabelText",i.get("text",this.get("name","")))):(i._setDataItem(this._emptyDataItem),a=this.get("legendRangeLabelText",this.get("legendLabelText",i.get("text",this.get("name",""))))),i.set("text",a)}const s=e.get("valueLabel");if(s){let a="";t?(s._setDataItem(t),a=this.get("legendValueText",s.get("text",""))):(s._setDataItem(this._emptyDataItem),a=this.get("legendRangeValueText",s.get("text",""))),s.set("text",a)}}}_getItemReaderLabel(){let t="X: {"+this._xField;return this.get("xAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}; Y: {"+this._yField,this.get("yAxis").isType("DateAxis")&&(t+=".formatDate()"),t+="}",t}getPoint(t,e){let i=this.get("xAxis").get("renderer").positionToCoordinate(t),s=this.get("yAxis").get("renderer").positionToCoordinate(e),a=999999999;return s<-a&&(s=-a),s>a&&(s=a),i<-a&&(i=-a),i>a&&(i=a),{x:i,y:s}}_shouldInclude(t){return!0}handleCursorHide(){this.hideTooltip(),this.updateLegendValue(void 0),this.updateLegendMarker(void 0)}_afterDataChange(){super._afterDataChange(),this.get("xAxis")._markDirtyKey("start"),this.get("yAxis")._markDirtyKey("start"),this.resetExtremes()}resetExtremes(){this.setPrivate("selectionMinX",void 0),this.setPrivate("selectionMaxX",void 0),this.setPrivate("selectionMinY",void 0),this.setPrivate("selectionMaxY",void 0),this.setPrivate("minX",void 0),this.setPrivate("minY",void 0),this.setPrivate("maxX",void 0),this.setPrivate("maxY",void 0)}createAxisRange(t){return this.axisRanges.push({axisDataItem:t})}get mainDataItems(){return this._mainDataItems}}Object.defineProperty(W,"className",{enumerable:!0,configurable:!0,writable:!0,value:"XYSeries"}),Object.defineProperty(W,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Lt.classNames.concat([W.className])});class U extends Ft{constructor(){super(...arguments),Object.defineProperty(this,"_series",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_isPanning",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(T.new(this._root,{}))}),Object.defineProperty(this,"gridContainer",{enumerable:!0,configurable:!0,writable:!0,value:T.new(this._root,{width:k,height:k})}),Object.defineProperty(this,"topGridContainer",{enumerable:!0,configurable:!0,writable:!0,value:T.new(this._root,{width:k,height:k})}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(T.new(this._root,{isMeasured:!1,width:k,height:k,position:"absolute"}))}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rangesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_panStart",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_panEnd",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_sAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_eAnimation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_skipSync",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisRanges",{enumerable:!0,configurable:!0,writable:!0,value:new Ot}),Object.defineProperty(this,"_seriesAxisRanges",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"ghostLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cursorPosition",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(this,"_snapToSeries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_seriesValuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"axisHeader",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(T.new(this._root,{themeTags:["axis","header"],position:"absolute",background:H.new(this._root,{themeTags:["header","background"],fill:this._root.interfaceColors.get("background")})}))}),Object.defineProperty(this,"_bullets",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_dispose(){this.gridContainer.dispose(),this.topGridContainer.dispose(),this.bulletsContainer.dispose(),this.labelsContainer.dispose(),this.axisHeader.dispose(),super._dispose()}_afterNew(){super._afterNew(),this.setPrivate("updateScrollbar",!0),this._disposers.push(this.axisRanges.events.onAll(e=>{if(e.type==="clear")P(e.oldValues,i=>{this.disposeDataItem(i)});else if(e.type==="push")this._processAxisRange(e.newValue,["range"]);else if(e.type==="setIndex")this._processAxisRange(e.newValue,["range"]);else if(e.type==="insertIndex")this._processAxisRange(e.newValue,["range"]);else if(e.type==="removeIndex")this.disposeDataItem(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");this._processAxisRange(e.value,["range"])}}));const t=this.get("renderer");t&&(t.axis=this,t.processAxis()),this.children.push(t),this.ghostLabel=t.makeLabel(new st(this,void 0,{}),[]),this.ghostLabel.adapters.disable("text"),this.ghostLabel.setAll({opacity:0,tooltipText:void 0,tooltipHTML:void 0,interactive:!1}),this.ghostLabel.events.disable()}_updateFinals(t,e){}zoom(t,e,i,s){if(this._updateFinals(t,e),this.get("start")!==t||this.get("end")!=e){let a=this._sAnimation,r=this._eAnimation,n=this.get("maxDeviation",.5)*Math.min(1,e-t);t<-n&&(t=-n),e>1+n&&(e=1+n),t>e&&([t,e]=[e,t]),b(i)||(i=this.get("interpolationDuration",0)),s||(s="end");let o=this.getPrivate("maxZoomFactor",this.get("maxZoomFactor",100)),h=o;e===1&&t!==0&&(s=tthis.get("end")?"end":"start");let c=this.get("minZoomCount"),l=this.get("maxZoomCount");b(c)&&(o=h/c);let d=1;if(b(l)&&(d=h/l),s==="start"?(l>0&&1/(e-t)o&&(e=t+1/o),e>1&&e-t<1/o&&(t=e-1/o)):(l>0&&1/(e-t)o&&(t=e-1/o),t<0&&e-t<1/o&&(e=t+1/o)),1/(e-t)>o&&(e=t+1/o),1/(e-t)>o&&(t=e-1/o),l!=null&&c!=null&&t==this.get("start")&&e==this.get("end")){const u=this.chart;u&&u._handleAxisSelection(this,!0)}if((a&&a.playing&&a.to==t||this.get("start")==t)&&(r&&r.playing&&r.to==e||this.get("end")==e))return;if(i>0){let u,g,m=this.get("interpolationEasing");if(this.get("start")!=t&&(u=this.animate({key:"start",to:t,duration:i,easing:m})),this.get("end")!=e&&(g=this.animate({key:"end",to:e,duration:i,easing:m})),this._sAnimation=u,this._eAnimation=g,u)return u;if(g)return g}else this.set("start",t),this.set("end",e),this._root.events.once("frameended",()=>{this._markDirtyKey("start"),this._root._markDirty()})}else this._sAnimation&&this._sAnimation.stop(),this._eAnimation&&this._eAnimation.stop()}get series(){return this._series}_processAxisRange(t,e){t.setRaw("isRange",!0),this._createAssets(t,e),this._rangesDirty=!0,this._prepareDataItem(t);const i=t.get("above"),s=this.topGridContainer,a=t.get("grid");i&&a&&s.children.moveValue(a);const r=t.get("axisFill");i&&r&&s.children.moveValue(r)}_prepareDataItem(t,e){}markDirtyExtremes(){}markDirtySelectionExtremes(){}_calculateTotals(){}_updateAxisRanges(){this._bullets={},this.axisRanges.each(t=>{this._prepareDataItem(t)}),P(this._seriesAxisRanges,t=>{this._prepareDataItem(t)})}_prepareChildren(){if(super._prepareChildren(),this.get("fixAxisSize")?this.ghostLabel.set("visible",!0):this.ghostLabel.set("visible",!1),this.isDirty("start")||this.isDirty("end")){this.chart._updateCursor();let e=this.get("start",0),i=this.get("end",1),s=this.get("maxDeviation",.5)*Math.min(1,i-e);if(e<-s){let a=e+s;e=-s,this.setRaw("start",e),this.isDirty("end")&&this.setRaw("end",i-a)}if(i>1+s){let a=i-1-s;i=1+s,this.setRaw("end",i),this.isDirty("start")&&this.setRaw("start",e-a)}}const t=this.get("renderer");if(t._start=this.get("start"),t._end=this.get("end"),t._inversed=t.get("inversed",!1),t._axisLength=t.axisLength()/(t._end-t._start),t._updateLC(),this.isDirty("tooltip")){const e=this.get("tooltip");if(e){const i=t.get("themeTags");e.addTag("axis"),e.addTag(this.className.toLowerCase()),e._applyThemes(),i&&(e.set("themeTags",S(e.get("themeTags"),i)),e.label._applyThemes())}}}_updateTooltipBounds(){const t=this.get("tooltip");t&&this.get("renderer").updateTooltipBounds(t)}_updateBounds(){super._updateBounds(),this._updateTooltipBounds()}processChart(t){this.chart=t,this.get("renderer").chart=t,t.gridContainer.children.push(this.gridContainer),t.topGridContainer.children.push(this.topGridContainer),t.axisHeadersContainer.children.push(this.axisHeader),this.on("start",()=>{t._handleAxisSelection(this)}),this.on("end",()=>{t._handleAxisSelection(this)}),t.plotContainer.onPrivate("width",()=>{this.markDirtySize()}),t.plotContainer.onPrivate("height",()=>{this.markDirtySize()}),t.processAxis(this)}hideDataItem(t){return this._toggleDataItem(t,!1),super.hideDataItem(t)}showDataItem(t){return this._toggleDataItem(t,!0),super.showDataItem(t)}_toggleDataItem(t,e){const i=t.get("label");i&&i.setPrivate("visible",e);const s=t.get("grid");s&&s.setPrivate("visible",e);const a=t.get("tick");a&&a.setPrivate("visible",e);const r=t.get("axisFill");r&&r.setPrivate("visible",e);const n=t.get("bullet");if(n){const o=n.get("sprite");o&&o.setPrivate("visible",e)}}_createAssets(t,e){const i=this.get("renderer");t.get("label")||i.makeLabel(t,e),t.get("grid")||i.makeGrid(t,e),t.get("tick")||i.makeTick(t,e),t.get("axisFill")||i.makeAxisFill(t,e),this._processBullet(t)}_processBullet(t){let e=t.get("bullet"),i=this.get("bullet");if(e||!i||t.get("isRange")||(e=i(this._root,this,t)),e){e.axis=this;const s=e.get("sprite");s&&(s._setDataItem(t),t.setRaw("bullet",e),s.parent||this.bulletsContainer.children.push(s))}}_afterChanged(){super._afterChanged();const t=this.chart;t&&(t._updateChartLayout(),t.axisHeadersContainer.markDirtySize()),this.get("renderer")._updatePositions()}disposeDataItem(t){super.disposeDataItem(t);const e=this.get("renderer"),i=t.get("label");i&&(e.labels.removeValue(i),i.dispose());const s=t.get("tick");s&&(e.ticks.removeValue(s),s.dispose());const a=t.get("grid");a&&(e.grid.removeValue(a),a.dispose());const r=t.get("axisFill");r&&(e.axisFills.removeValue(r),r.dispose());const n=t.get("bullet");n&&n.dispose()}_updateGhost(){this.setPrivate("cellWidth",this.getCellWidthPosition()*this.get("renderer").axisLength());const t=this.ghostLabel;if(!t.isHidden()){const s=t.localBounds(),a=s.right-s.left;let r=t.get("text");P(this.dataItems,n=>{const o=n.get("label");if(o&&!o.isHidden()){const h=o.localBounds();h.right-h.left>a&&(r=o.text._getText())}}),t.set("text",r)}let e=this.get("start",0),i=this.get("end",1);this.get("renderer").updateLabel(t,e+.5*(i-e))}_handleCursorPosition(t,e){t=this.get("renderer").toAxisPosition(t),this._cursorPosition=t,this._snapToSeries=e,this.updateTooltip()}updateTooltip(){const t=this._snapToSeries;let e=this._cursorPosition;const i=this.get("tooltip"),s=this.get("renderer");b(e)&&(P(this.series,a=>{if(a.get("baseAxis")===this){const r=this.getSeriesItem(a,e,this.get("tooltipLocation"));a.setRaw("tooltipDataItem",r),t&&t.indexOf(a)!=-1?(a.updateLegendMarker(r),a.updateLegendValue(r)):a.showDataItemTooltip(r)}}),i&&(s.updateTooltipBounds(i),this.get("snapTooltip")&&(e=this.roundAxisPosition(e,this.get("tooltipLocation",.5))),B(e)?i.hide(0):(this.setPrivateRaw("tooltipPosition",e),this._updateTooltipText(i,e),s.positionTooltip(i,e),ethis.get("end")?i.hide(0):i.show(0))))}_updateTooltipText(t,e){t.label.set("text",this.getTooltipText(e))}roundAxisPosition(t,e){return t}handleCursorShow(){let t=this.get("tooltip");t&&t.show()}handleCursorHide(){let t=this.get("tooltip");t&&t.hide()}processSeriesDataItem(t,e){}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._rangesDirty=!1}coordinateToPosition(t){const e=this.get("renderer");return e.toAxisPosition(t/e.axisLength())}toAxisPosition(t){return this.get("renderer").toAxisPosition(t)}toGlobalPosition(t){return this.get("renderer").toGlobalPosition(t)}fixPosition(t){return this.get("renderer").fixPosition(t)}shouldGap(t,e,i,s){return!1}createAxisRange(t){return this.axisRanges.push(t)}_groupSeriesData(t){}getCellWidthPosition(){return .05}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Axis"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ft.classNames.concat([U.className])});class lt extends U{constructor(){super(...arguments),Object.defineProperty(this,"_dirtyExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirtySelectionExtremes",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_deltaMinMax",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_minReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_maxReal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_baseValue",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_syncDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_minLogAdjusted",{enumerable:!0,configurable:!0,writable:!0,value:1})}markDirtyExtremes(){this._dirtyExtremes=!0,this.markDirty()}markDirtySelectionExtremes(){this._dirtySelectionExtremes=!0,this.markDirty()}_afterNew(){this._settings.themeTags=S(this._settings.themeTags,["axis"]),this.setPrivateRaw("name","value"),this.addTag("value"),super._afterNew()}_prepareChildren(){if(super._prepareChildren(),this.isDirty("syncWithAxis")){this._prevSettings.syncWithAxis&&this._syncDp&&this._syncDp.dispose();let t=this.get("syncWithAxis");t&&(this._syncDp=new Qt([t.onPrivate("selectionMinFinal",()=>{this._dirtySelectionExtremes=!0}),t.onPrivate("selectionMaxFinal",()=>{this._dirtySelectionExtremes=!0})]))}(this._sizeDirty||this._dirtyExtremes||this._valuesDirty||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("min")||this.isDirty("max")||this.isDirty("extraMin")||this.isDirty("extraMax")||this.isDirty("logarithmic")||this.isDirty("treatZeroAs")||this.isDirty("baseValue")||this.isDirty("strictMinMax")||this.isDirty("strictMinMaxSelection")||this.isDirty("maxPrecision")||this.isDirty("numberFormat"))&&(this._getMinMax(),this.ghostLabel.set("text",""),this._dirtyExtremes=!1),this._dirtySelectionExtremes&&!this._isPanning&&this.get("autoZoom",!0)&&(this._getSelectionMinMax(),this._dirtySelectionExtremes=!1),this._groupData(),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("min")||this.isPrivateDirty("selectionMax")||this.isPrivateDirty("selectionMin")||this.isPrivateDirty("max")||this.isPrivateDirty("step")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("logarithmic"))&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges()),this._baseValue=this.baseValue()}_groupData(){}_formatText(t){const e=this.get("numberFormat"),i=this.getNumberFormatter();let s="";return s=e?i.format(t,e):i.format(t,void 0,this.getPrivate("stepDecimalPlaces")),s}_prepareAxisItems(){const t=this.getPrivate("min"),e=this.getPrivate("max");if(b(t)&&b(e)){const i=this.get("logarithmic"),s=this.getPrivate("step"),a=this.getPrivate("selectionMin"),r=this.getPrivate("selectionMax")+s;let n=a-s,o=0,h=1,c=t;if(i){if(n=this._minLogAdjusted,n2&&(n=Math.pow(10,Math.log(c)*Math.LOG10E-5))}let l=-1/0;for(;n2?n=Math.pow(10,Math.log(c)*Math.LOG10E+o-5):n+=s,l==n)break;let g=Math.pow(10,Math.floor(Math.log(Math.abs(s))*Math.LOG10E));if(g<1){let m=Math.round(Math.abs(Math.log(Math.abs(g))*Math.LOG10E))+2;n=X(n,m)}o++,l=n}for(let d=o;d{d.inited&&d._markDirtyAxes()}),this._updateGhost()}}_prepareDataItem(t,e){let i=this.get("renderer"),s=t.get("value"),a=t.get("endValue"),r=this.valueToPosition(s),n=r,o=this.valueToPosition(s+this.getPrivate("step"));b(a)&&(n=this.valueToPosition(a),o=n),t.get("isRange")&&a==null&&(o=r),i.updateLabel(t.get("label"),r,n,e);const h=t.get("grid");if(i.updateGrid(h,r,n),h&&(s==this.get("baseValue",0)?(h.addTag("base"),h._applyThemes()):h.hasTag("base")&&(h.removeTag("base"),h._applyThemes())),i.updateTick(t.get("tick"),r,n,e),i.updateFill(t.get("axisFill"),r,o),this._processBullet(t),i.updateBullet(t.get("bullet"),r,n),!t.get("isRange")){const c=this.get("fillRule");c&&c(t)}}_handleRangeChange(){let t=this.positionToValue(this.get("start",0)),e=this.positionToValue(this.get("end",1));const i=this.get("renderer").gridCount();let s=this._adjustMinMax(t,e,i,!0),a=te(s.step);this.setPrivateRaw("stepDecimalPlaces",a),t=X(t,a),e=X(e,a),s=this._adjustMinMax(t,e,i,!0);let r=s.step;t=s.min,e=s.max,this.getPrivate("selectionMin")===t&&this.getPrivate("selectionMax")===e&&this.getPrivate("step")===r||(this.setPrivateRaw("selectionMin",t),this.setPrivateRaw("selectionMax",e),this.setPrivateRaw("step",r))}positionToValue(t){const e=this.getPrivate("min"),i=this.getPrivate("max");return this.get("logarithmic")?Math.pow(Math.E,(t*(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)+Math.log(e)*Math.LOG10E)/Math.LOG10E):t*(i-e)+e}valueToPosition(t){const e=this.getPrivate("min"),i=this.getPrivate("max");if(this.get("logarithmic")){if(t<=0){let s=this.get("treatZeroAs");b(s)&&(t=s)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}valueToFinalPosition(t){const e=this.getPrivate("minFinal"),i=this.getPrivate("maxFinal");if(this.get("logarithmic")){if(t<=0){let s=this.get("treatZeroAs");b(s)&&(t=s)}return(Math.log(t)*Math.LOG10E-Math.log(e)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(e)*Math.LOG10E)}return(t-e)/(i-e)}getX(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getY(t,e,i){t=i+(t-i)*e;const s=this.valueToPosition(t);return this._settings.renderer.positionToCoordinate(s)}getDataItemCoordinateX(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionX(t,e,i,s))}getDataItemPositionX(t,e,i,s){let a=t.get(e);return t.get("stackToItemX")?a=a*s+t.component.getStackedXValueWorking(t,e):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}getDataItemCoordinateY(t,e,i,s){return this._settings.renderer.positionToCoordinate(this.getDataItemPositionY(t,e,i,s))}getDataItemPositionY(t,e,i,s){let a=t.get(e);return t.get("stackToItemY")?a=a*s+t.component.getStackedYValueWorking(t,e):a=this._baseValue+(a-this._baseValue)*s,this.valueToPosition(a)}basePosition(){return this.valueToPosition(this.baseValue())}baseValue(){const t=Math.min(this.getPrivate("minFinal",-1/0),this.getPrivate("selectionMin",-1/0)),e=Math.max(this.getPrivate("maxFinal",1/0),this.getPrivate("selectionMax",1/0));let i=this.get("baseValue",0);return ie&&(i=e),i}cellEndValue(t){return t}fixSmallStep(t){return 1+t===1?(t*=2,this.fixSmallStep(t)):t}_fixMin(t){return t}_fixMax(t){return t}_calculateTotals(){if(this.get("calculateTotals")){let t=this.series[0];if(t){let e=t.startIndex();if(t.dataItems.length>0){e>0&&e--;let i,s,a=t.endIndex();a{if(!c.get("excludeFromTotal")){let l=c.dataItems[n];if(l){let d=l.get(r)*c.get(s);B(d)||(o+=d,h+=Math.abs(d))}}}),P(this.series,c=>{if(!c.get("excludeFromTotal")){let l=c.dataItems[n];if(l){let d=l.get(r)*c.get(s);B(d)||(l.set(i+"Total",h),l.set(i+"Sum",o),l.set(i+"TotalPercent",d/h*100))}}})}}}}}_getSelectionMinMax(){const t=this.getPrivate("minFinal"),e=this.getPrivate("maxFinal"),i=this.get("min"),s=this.get("max");let a=this.get("extraMin",0),r=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(r=.2));const n=this.get("renderer").gridCount(),o=this.get("strictMinMaxSelection"),h=this.get("strictMinMax");if(b(t)&&b(e)){let c=e,l=t;if(P(this.series,_=>{if(!_.get("ignoreMinMax")){let f,w;const A=_.getPrivate("outOfSelection");_.get("xAxis")===this?A||(f=_.getPrivate("selectionMinX",_.getPrivate("minX")),w=_.getPrivate("selectionMaxX",_.getPrivate("maxX"))):_.get("yAxis")===this&&(A||(f=_.getPrivate("selectionMinY",_.getPrivate("minY")),w=_.getPrivate("selectionMaxY",_.getPrivate("maxY")))),_.isHidden()||_.isShowing()||(b(f)&&(c=Math.min(c,f)),b(w)&&(l=Math.max(l,w)))}}),this.axisRanges.each(_=>{if(_.get("affectsMinMax")){let f=_.get("value");f!=null&&(c=Math.min(c,f),l=Math.max(l,f)),f=_.get("endValue"),f!=null&&(c=Math.min(c,f),l=Math.max(l,f))}}),c>l&&([c,l]=[l,c]),b(i)?c=h?i:t:h&&b(this._minReal)&&(c=this._minReal),b(s)?l=h?s:e:h&&b(this._maxReal)&&(l=this._maxReal),c===l){c-=this._deltaMinMax,l+=this._deltaMinMax;let _=this._adjustMinMax(c,l,n,h);c=_.min,l=_.max}let d=c,u=l;c-=(l-c)*a,l+=(l-c)*r;let g=this._adjustMinMax(c,l,n);c=g.min,l=g.max,c=At(c,t,e),l=At(l,t,e),g=this._adjustMinMax(c,l,n,!0),h||(c=g.min,l=g.max);const m=this.get("syncWithAxis");m&&(g=this._syncAxes(c,l,g.step,m.getPrivate("selectionMinFinal",m.getPrivate("minFinal",0)),m.getPrivate("selectionMaxFinal",m.getPrivate("maxFinal",1)),m.getPrivate("selectionStepFinal",m.getPrivate("step",1))),c=g.min,l=g.max),h&&(b(i)&&(c=Math.max(c,i)),b(s)&&(l=Math.min(l,s))),o&&(c=d-(l-c)*a,l=u+(l-c)*r),this.get("logarithmic")&&(c<=0&&(c=d*(1-Math.min(a,.99))),ce&&(l=e));let p=Math.min(20,Math.ceil(Math.log(this.getPrivate("maxZoomFactor",100)+1)/Math.LN10)+2),x=X(this.valueToFinalPosition(c),p),v=X(this.valueToFinalPosition(l),p);this.setPrivateRaw("selectionMinFinal",c),this.setPrivateRaw("selectionMaxFinal",l),this.setPrivateRaw("selectionStepFinal",g.step),this.zoom(x,v)}}_getMinMax(){let t=this.get("min"),e=this.get("max"),i=1/0,s=-1/0,a=this.get("extraMin",0),r=this.get("extraMax",0);this.get("logarithmic")&&(this.get("extraMin")==null&&(a=.1),this.get("extraMax")==null&&(r=.2));let n=1/0;if(P(this.series,_=>{if(!_.get("ignoreMinMax")){let f,w;if(_.get("xAxis")===this?(f=_.getPrivate("minX"),w=_.getPrivate("maxX")):_.get("yAxis")===this&&(f=_.getPrivate("minY"),w=_.getPrivate("maxY")),b(f)&&b(w)){i=Math.min(i,f),s=Math.max(s,w);let A=w-f;A<=0&&(A=Math.abs(w/100)),A{if(_.get("affectsMinMax")){let f=_.get("value");f!=null&&(i=Math.min(i,f),s=Math.max(s,f)),f=_.get("endValue"),f!=null&&(i=Math.min(i,f),s=Math.max(s,f))}}),this.get("logarithmic")){let _=this.get("treatZeroAs");b(_)&&i<=0&&(i=_)}if(i===0&&s===0&&(s=.9,i=-.9),b(t)&&(i=t),b(e)&&(s=e),i===1/0||s===-1/0)return this.setPrivate("minFinal",void 0),void this.setPrivate("maxFinal",void 0);const o=i,h=s;let c=this.adapters.fold("min",i),l=this.adapters.fold("max",s);b(c)&&(i=c),b(l)&&(s=l),i=this._fixMin(i),s=this._fixMax(s),s-i<=1/Math.pow(10,15)&&(s-i!=0?this._deltaMinMax=(s-i)/2:this._getDelta(s),i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*r,this.get("logarithmic")&&(i<0&&o>=0&&(i=0),s>0&&h<=0&&(s=0)),this._minReal=i,this._maxReal=s;let d=this.get("strictMinMax"),u=this.get("strictMinMaxSelection",!1);u&&(d=u);let g=d;b(e)&&(g=!0);let m=this.get("renderer").gridCount(),p=this._adjustMinMax(i,s,m,g);i=p.min,s=p.max,p=this._adjustMinMax(i,s,m,!0),i=p.min,s=p.max,d&&(i=b(t)?t:this._minReal,s=b(e)?e:this._maxReal,s-i<=1e-8&&(i-=this._deltaMinMax,s+=this._deltaMinMax),i-=(s-i)*a,s+=(s-i)*r),c=this.adapters.fold("min",i),l=this.adapters.fold("max",s),b(c)&&(i=c),b(l)&&(s=l),n==1/0&&(n=s-i);let x=Math.round(Math.abs(Math.log(Math.abs(s-i))*Math.LOG10E))+5;i=X(i,x),s=X(s,x);const v=this.get("syncWithAxis");if(v&&(p=this._syncAxes(i,s,p.step,v.getPrivate("minFinal",v.getPrivate("min",0)),v.getPrivate("maxFinal",v.getPrivate("max",1)),v.getPrivate("step",1)),i=p.min,s=p.max),this.setPrivateRaw("maxZoomFactor",Math.max(1,Math.ceil((s-i)/n*this.get("maxZoomFactor",100)))),this._fixZoomFactor(),this.get("logarithmic")&&(this._minLogAdjusted=i,i=this._minReal,s=this._maxReal,i<=0&&(i=o*(1-Math.min(a,.99)))),b(i)&&b(s)&&(this.getPrivate("minFinal")!==i||this.getPrivate("maxFinal")!==s)){this.setPrivate("minFinal",i),this.setPrivate("maxFinal",s),this._saveMinMax(i,s);const _=this.get("interpolationDuration",0),f=this.get("interpolationEasing");this.animatePrivate({key:"min",to:i,duration:_,easing:f}),this.animatePrivate({key:"max",to:s,duration:_,easing:f})}}_fixZoomFactor(){}_getDelta(t){let e=Math.log(Math.abs(t))*Math.LOG10E,i=Math.pow(10,Math.floor(e));i/=10,this._deltaMinMax=i}_saveMinMax(t,e){}_adjustMinMax(t,e,i,s){i<=1&&(i=1),i=Math.round(i);let a=t,r=e,n=e-t;n===0&&(n=Math.abs(e));let o=Math.log(Math.abs(n))*Math.LOG10E,h=Math.pow(10,Math.floor(o));h/=10;let c=h;s&&(c=0),s?(t=Math.floor(t/h)*h,e=Math.ceil(e/h)*h):(t=Math.ceil(t/h)*h-c,e=Math.floor(e/h)*h+c),t<0&&a>=0&&(t=0),e>0&&r<=0&&(e=0),o=Math.log(Math.abs(n))*Math.LOG10E,h=Math.pow(10,Math.floor(o)),h/=100;let l=Math.ceil(n/i/h)*h,d=Math.pow(10,Math.floor(Math.log(Math.abs(l))*Math.LOG10E)),u=Math.ceil(l/d);u>5?u=10:u<=5&&u>2&&(u=5),l=Math.ceil(l/(d*u))*d*u;let g=this.get("maxPrecision");if(b(g)){let v=se(l,g);ga&&(t-=l),l=this.fixSmallStep(l),{min:t,max:e,step:l}}getTooltipText(t,e){const i=this.get("tooltipNumberFormat",this.get("numberFormat")),s=this.getNumberFormatter(),a=this.get("extraTooltipPrecision",0),r=this.getPrivate("stepDecimalPlaces",0)+a,n=X(this.positionToValue(t),r);return i?s.format(n,i):s.format(n,void 0,r)}getSeriesItem(t,e){let i,s,a=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),r=this.positionToValue(e);if(P(t.dataItems,(n,o)=>{const h=Math.abs(n.get(a)-r);(i===void 0||h500&&(c=!0),c)t=u,e=g,i=m;else{l/3==Math.round(l/3)?(u=t-d*l,t>=0&&u<0&&(u=0)):(g=e+d*l,g<=0&&g>0&&(g=0));let p=this._adjustMinMax(u,g,h,!0);u=p.min,g=p.max,m=p.step}}}return{min:t,max:e,step:i}}_checkSync(t,e,i,s){let a=(e-t)/i;for(let r=1;rtt._new(this._root,{themeTags:S(this.ticks.template.get("themeTags",[]),this.get("themeTags",[]))},[this.ticks.template]))}),Object.defineProperty(this,"grid",{enumerable:!0,configurable:!0,writable:!0,value:new V(L.new({}),()=>z._new(this._root,{themeTags:S(this.grid.template.get("themeTags",[]),this.get("themeTags",[]))},[this.grid.template]))}),Object.defineProperty(this,"axisFills",{enumerable:!0,configurable:!0,writable:!0,value:new V(L.new({}),()=>Y._new(this._root,{themeTags:S(this.axisFills.template.get("themeTags",["axis","fill"]),this.get("themeTags",[]))},[this.axisFills.template]))}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:new V(L.new({}),()=>Q._new(this._root,{themeTags:S(this.labels.template.get("themeTags",[]),this.get("themeTags",[]))},[this.labels.template]))}),Object.defineProperty(this,"axis",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}makeTick(t,e){const i=this.ticks.make();return i._setDataItem(t),t.setRaw("tick",i),i.set("themeTags",S(i.get("themeTags"),e)),this.axis.labelsContainer.children.push(i),this.ticks.push(i),i}makeGrid(t,e){const i=this.grid.make();return i._setDataItem(t),t.setRaw("grid",i),i.set("themeTags",S(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),this.grid.push(i),i}makeAxisFill(t,e){const i=this.axisFills.make();return i._setDataItem(t),i.set("themeTags",S(i.get("themeTags"),e)),this.axis.gridContainer.children.push(i),t.setRaw("axisFill",i),this.axisFills.push(i),i}makeLabel(t,e){const i=this.labels.make();return i.set("themeTags",S(i.get("themeTags"),e)),this.axis.labelsContainer.children.moveValue(i,0),i._setDataItem(t),t.setRaw("label",i),this.labels.push(i),i}axisLength(){return 0}gridCount(){return this.axisLength()/this.get("minGridDistance",50)}_updatePositions(){}_afterNew(){super._afterNew(),this.set("isMeasured",!1);const t=this.thumb;t&&(this._disposers.push(t.events.on("pointerdown",e=>{this._handleThumbDown(e)})),this._disposers.push(t.events.on("globalpointerup",e=>{this._handleThumbUp(e)})),this._disposers.push(t.events.on("globalpointermove",e=>{this._handleThumbMove(e)})))}_changed(){if(super._changed(),this.isDirty("pan")){const t=this.thumb;if(t){const e=this.axis.labelsContainer,i=this.get("pan");i=="zoom"?e.children.push(t):i=="none"&&e.children.removeValue(t)}}}_handleThumbDown(t){this._thumbDownPoint=this.toLocal(t.point);const e=this.axis;this._downStart=e.get("start"),this._downEnd=e.get("end")}_handleThumbUp(t){this._thumbDownPoint=void 0}_handleThumbMove(t){const e=this._thumbDownPoint;if(e){const i=this.toLocal(t.point),s=this._downStart,a=this._downEnd,r=this._getPan(i,e)*Math.min(1,a-s)/2;this.axis.zoom(s-r,a+r,0)}}_getPan(t,e){return 0}positionToCoordinate(t){return this._inversed?(this._end-t)*this._axisLength:(t-this._start)*this._axisLength}updateTooltipBounds(t){}_updateSize(){this.markDirty(),this._clear=!0}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t*=i-e,t=this.get("inversed")?i-t:e+t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t=i-t:t-=e,t/=i-e}fixPosition(t){return this.get("inversed")?1-t:t}_updateLC(){}toggleVisibility(t,e,i,s){let a=this.axis;const r=a.get("start",0),n=a.get("end",1);er+(n-r)*(s+1e-4)?t.setPrivate("visible",!1):t.setPrivate("visible",!0)}_positionTooltip(t,e){const i=this.chart;i&&(i.inPlot(e)?t.set("pointTo",this._display.toGlobal(e)):t.hide())}processAxis(){}}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRenderer"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Y.classNames.concat([E.className])});class ht extends E{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:H.new(this._root,{width:k,isMeasured:!1,themeTags:["axis","x","thumb"]})})}_afterNew(){this._settings.themeTags=S(this._settings.themeTags,["renderer","x"]),super._afterNew(),this.setPrivateRaw("letter","X");const t=this.grid.template;t.set("height",k),t.set("width",0),t.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(0,i.height())}),this.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(i.width(),0)})}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("x",-1e3);const e="opposite",i="inside";if(this.isDirty(e)||this.isDirty(i)){const s=this.chart,a=t.children;if(this.get(i)?t.addTag(i):t.removeTag(i),s){if(this.get(e)){const r=s.topAxesContainer.children;r.indexOf(t)==-1&&r.insertIndex(0,t),t.addTag(e),a.moveValue(this)}else{const r=s.bottomAxesContainer.children;r.indexOf(t)==-1&&r.moveValue(t),t.removeTag(e),a.moveValue(this,0)}t.ghostLabel._applyThemes(),this.labels.each(r=>{r._applyThemes()}),this.root._markDirtyRedraw()}t.markDirtySize()}this.thumb.setPrivate("height",t.labelsContainer.height())}_getPan(t,e){return(e.x-t.x)/this.width()}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?i-t:e+t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t=i-t:t-=e,t=t/(i-e)*this._lc,t+=this._ls}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerWidth();this._lc=this.axisLength()/i,this._ls=(t.x()-e.get("paddingLeft",0))/i}}_updatePositions(){const t=this.axis,e=t.x()-it(t.get("centerX",0),t.width())-t.parent.get("paddingLeft",0);t.gridContainer.set("x",e),t.topGridContainer.set("x",e),t.bulletsContainer.set("y",this.y());const i=t.chart;if(i){const s=i.plotContainer,a=t.axisHeader;let r=t.get("marginLeft",0),n=t.x()-r;const o=t.parent;o&&(n-=o.get("paddingLeft",0)),a.children.length>0?(r=t.axisHeader.width(),t.set("marginLeft",r+1)):a.set("width",r),a.setAll({x:n,y:-1,height:s.height()+2})}}processAxis(){super.processAxis();const t=this.axis;t.set("width",k);const e=this._root.verticalLayout;t.set("layout",e),t.labelsContainer.set("width",k),t.axisHeader.setAll({layout:e})}axisLength(){return this.axis.width()}positionToPoint(t){return{x:this.positionToCoordinate(t),y:0}}updateTick(t,e,i,s){if(t){b(e)||(e=0);let a=.5;a=b(s)&&s>1?t.get("multiLocation",a):t.get("location",a),b(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e));let r=t.get("length",0);const n=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("y",k),n||(r*=-1)):(t.set("y",0),n&&(r*=-1)),t.set("draw",o=>{o.moveTo(0,0),o.lineTo(0,r)}),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateLabel(t,e,i,s){if(t){let a=.5;a=b(s)&&s>1?t.get("multiLocation",a):t.get("location",a),b(e)||(e=0);const r=t.get("inside",this.get("inside",!1));this.get("opposite")?r?(t.set("position","absolute"),t.set("y",0)):(t.set("position","relative"),t.set("y",k)):r?(t.set("y",0),t.set("position","absolute")):(t.set("y",void 0),t.set("position","relative")),b(i)&&i!=e&&(e+=(i-e)*a),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){b(e)||(e=0);let s=t.get("location",.5);b(i)&&i!=e&&(e+=(i-e)*s),t.set("x",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateBullet(t,e,i){if(t){const s=t.get("sprite");if(s){b(e)||(e=0);let a=t.get("location",.5);b(i)&&i!=e&&(e+=(i-e)*a);let r=this.axis.roundAxisPosition(e,a),n=this.axis._bullets[r],o=-1;if(this.get("opposite")&&(o=1),t.get("stacked"))if(n){let h=n.get("sprite");h&&s.set("y",h.y()+h.height()*o)}else s.set("y",0);this.axis._bullets[r]=t,s.set("x",this.positionToCoordinate(e)),this.toggleVisibility(s,e,0,1)}}}updateFill(t,e,i){if(t){b(e)||(e=0),b(i)||(i=1);let s=this.positionToCoordinate(e),a=this.positionToCoordinate(i);this.fillDrawMethod(t,s,a)}}fillDrawMethod(t,e,i){t.set("draw",s=>{const a=this.axis.gridContainer.height(),r=this.width();ir||i<0||(s.moveTo(e,0),s.lineTo(i,0),s.lineTo(i,a),s.lineTo(e,a),s.lineTo(e,0))})}positionTooltip(t,e){this._positionTooltip(t,{x:this.positionToCoordinate(e),y:0})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.x,r=0,n=this.axisLength(),o=i,h="up";this.get("opposite")?e?(h="up",r=s.y,o=i):(h="down",r=s.y-i,o=i):e?(h="down",r=s.y-i,o=i):(h="up",r=s.y,o=i);const c={left:a,right:a+n,top:r,bottom:r+o},l=t.get("bounds");Xt(c,l)||(t.set("bounds",c),t.set("pointerOrientation",h))}}Object.defineProperty(ht,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererX"}),Object.defineProperty(ht,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([ht.className])});class dt extends E{constructor(){super(...arguments),Object.defineProperty(this,"_downY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:H.new(this._root,{height:k,isMeasured:!1,themeTags:["axis","y","thumb"]})})}_afterNew(){this._settings.themeTags=S(this._settings.themeTags,["renderer","y"]),this._settings.opposite&&this._settings.themeTags.push("opposite"),super._afterNew(),this.setPrivateRaw("letter","Y");const t=this.grid.template;t.set("width",k),t.set("height",0),t.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(i.width(),0)}),this.set("draw",(e,i)=>{e.moveTo(0,0),e.lineTo(0,i.height())})}_getPan(t,e){return(t.y-e.y)/this.height()}_changed(){super._changed();const t=this.axis;t.ghostLabel.setPrivate("visible",!this.get("inside")),t.ghostLabel.set("y",-1e3);const e=this.thumb,i="opposite",s="inside",a=this.chart;if(this.isDirty(i)||this.isDirty(s)){const n=t.children;if(this.get(s)?t.addTag(s):t.removeTag(s),a){if(this.get(i)){const o=a.rightAxesContainer.children;o.indexOf(t)==-1&&o.moveValue(t,0),t.addTag(i),n.moveValue(this,0)}else{const o=a.leftAxesContainer.children;o.indexOf(t)==-1&&o.moveValue(t),t.removeTag(i),n.moveValue(this)}t.ghostLabel._applyThemes(),this.labels.each(o=>{o._applyThemes()}),this.root._markDirtyRedraw()}t.markDirtySize()}const r=t.labelsContainer.width();a&&(this.get(i)?e.set("centerX",0):e.set("centerX",r)),e.setPrivate("width",r)}processAxis(){super.processAxis();const t=this.axis;t.get("height")==null&&t.set("height",k);const e=this._root.horizontalLayout;t.set("layout",e),t.labelsContainer.set("height",k),t.axisHeader.set("layout",e)}_updatePositions(){const t=this.axis,e=t.y()-it(t.get("centerY",0),t.height());t.gridContainer.set("y",e),t.topGridContainer.set("y",e),t.bulletsContainer.set("x",this.x());const i=t.chart;if(i){const s=i.plotContainer,a=t.axisHeader;let r=t.get("marginTop",0);a.children.length>0?(r=t.axisHeader.height(),t.set("marginTop",r+1)):a.set("height",r),a.setAll({y:t.y()-r,x:-1,width:s.width()+2})}}axisLength(){return this.axis.innerHeight()}positionToPoint(t){return{x:0,y:this.positionToCoordinate(t)}}updateLabel(t,e,i,s){if(t){b(e)||(e=0);let a=.5;a=b(s)&&s>1?t.get("multiLocation",a):t.get("location",a);const r=this.get("opposite"),n=t.get("inside",this.get("inside",!1));r?(t.set("x",0),n?t.set("position","absolute"):t.set("position","relative")):n?(t.set("x",0),t.set("position","absolute")):(t.set("x",void 0),t.set("position","relative")),b(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateGrid(t,e,i){if(t){b(e)||(e=0);let s=t.get("location",.5);b(i)&&i!=e&&(e+=(i-e)*s),t.set("y",this.positionToCoordinate(e)),this.toggleVisibility(t,e,0,1)}}updateTick(t,e,i,s){if(t){b(e)||(e=0);let a=.5;a=b(s)&&s>1?t.get("multiLocation",a):t.get("location",a),b(i)&&i!=e&&(e+=(i-e)*a),t.set("y",this.positionToCoordinate(e));let r=t.get("length",0);const n=t.get("inside",this.get("inside",!1));this.get("opposite")?(t.set("x",0),n&&(r*=-1)):n||(r*=-1),t.set("draw",o=>{o.moveTo(0,0),o.lineTo(r,0)}),this.toggleVisibility(t,e,t.get("minPosition",0),t.get("maxPosition",1))}}updateBullet(t,e,i){if(t){const s=t.get("sprite");if(s){b(e)||(e=0);let a=t.get("location",.5);b(i)&&i!=e&&(e+=(i-e)*a);let r=this.axis.roundAxisPosition(e,a),n=this.axis._bullets[r],o=1;if(this.get("opposite")&&(o=-1),t.get("stacked"))if(n){let h=n.get("sprite");h&&s.set("x",h.x()+h.width()*o)}else s.set("x",0);this.axis._bullets[r]=t,s.set("y",this.positionToCoordinate(e)),this.toggleVisibility(s,e,0,1)}}}updateFill(t,e,i){if(t){b(e)||(e=0),b(i)||(i=1);let s=this.positionToCoordinate(e),a=this.positionToCoordinate(i);this.fillDrawMethod(t,s,a)}}fillDrawMethod(t,e,i){t.set("draw",s=>{const a=this.axis.gridContainer.width(),r=this.height();ir||i<0||(s.moveTo(0,e),s.lineTo(a,e),s.lineTo(a,i),s.lineTo(0,i),s.lineTo(0,e))})}positionToCoordinate(t){return this._inversed?(t-this._start)*this._axisLength:(this._end-t)*this._axisLength}positionTooltip(t,e){this._positionTooltip(t,{x:0,y:this.positionToCoordinate(e)})}updateTooltipBounds(t){const e=this.get("inside"),i=1e5;let s=this._display.toGlobal({x:0,y:0}),a=s.y,r=0,n=this.axisLength(),o=i,h="right";this.get("opposite")?e?(h="right",r=s.x-i,o=i):(h="left",r=s.x,o=i):e?(h="left",r=s.x,o=i):(h="right",r=s.x-i,o=i);const c={left:r,right:r+o,top:a,bottom:a+n},l=t.get("bounds");Xt(c,l)||(t.set("bounds",c),t.set("pointerOrientation",h))}_updateLC(){const t=this.axis,e=t.parent;if(e){const i=e.innerHeight();this._lc=this.axisLength()/i,this._ls=t.y()/i}}toAxisPosition(t){const e=this._start||0,i=this._end||1;return t=(t-=this._ls)*(i-e)/this._lc,t=this.get("inversed")?e+t:i-t}toGlobalPosition(t){const e=this._start||0,i=this._end||1;return this.get("inversed")?t-=e:t=i-t,t=t/(i-e)*this._lc,t+=this._ls}fixPosition(t){return this.get("inversed")?t:1-t}}Object.defineProperty(dt,"className",{enumerable:!0,configurable:!0,writable:!0,value:"AxisRendererY"}),Object.defineProperty(dt,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([dt.className])});class ct extends W{constructor(){super(...arguments),Object.defineProperty(this,"_endIndex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeGenerator",{enumerable:!0,configurable:!0,writable:!0,value:zt()}),Object.defineProperty(this,"_fillGenerator",{enumerable:!0,configurable:!0,writable:!0,value:ne()}),Object.defineProperty(this,"_legendStroke",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_legendFill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"strokes",{enumerable:!0,configurable:!0,writable:!0,value:new V(L.new({}),()=>Y._new(this._root,{themeTags:S(this.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template]))}),Object.defineProperty(this,"fills",{enumerable:!0,configurable:!0,writable:!0,value:new V(L.new({}),()=>Y._new(this._root,{themeTags:S(this.strokes.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template]))}),Object.defineProperty(this,"_fillTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeTemplate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_previousPoint",{enumerable:!0,configurable:!0,writable:!0,value:[0,0,0,0]}),Object.defineProperty(this,"_dindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sindex",{enumerable:!0,configurable:!0,writable:!0,value:0})}_afterNew(){this._fillGenerator.y0(function(t){return t[3]}),this._fillGenerator.x0(function(t){return t[2]}),this._fillGenerator.y1(function(t){return t[1]}),this._fillGenerator.x1(function(t){return t[0]}),super._afterNew()}makeStroke(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}makeFill(t){const e=this.mainContainer.children.push(t.make());return t.push(e),e}_updateChildren(){this._strokeTemplate=void 0,this._fillTemplate=void 0;let t=this.get("xAxis"),e=this.get("yAxis");if(this.isDirty("stroke")){const i=this.get("stroke");this.strokes.template.set("stroke",i);const s=this._legendStroke;s&&s.states.lookup("default").set("stroke",i)}if(this.isDirty("fill")){const i=this.get("fill");this.fills.template.set("fill",i);const s=this._legendFill;s&&s.states.lookup("default").set("fill",i)}if(this.isDirty("curveFactory")){const i=this.get("curveFactory");i&&(this._strokeGenerator.curve(i),this._fillGenerator.curve(i))}if(t.inited&&e.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty||this.isDirty("connect")||this.isDirty("curveFactory")){this.fills.each(c=>{c.setPrivate("visible",!1)}),this.strokes.each(c=>{c.setPrivate("visible",!1)}),this.axisRanges.each(c=>{let l=c.fills;l&&l.each(u=>{u.setPrivate("visible",!1)});let d=c.strokes;d&&d.each(u=>{u.setPrivate("visible",!1)})});let i=this.startIndex(),s=this.strokes.template.get("templateField"),a=this.fills.template.get("templateField"),r=!0,n=!0;s&&(r=!1),a&&(n=!1);for(let c=i-1;c>=0;c--){let l=this.dataItems[c],d=!0,u=l.dataContext;if(s&&u[s]&&(r=!0),a&&u[a]&&(n=!0),P(this._valueFields,g=>{b(l.get(g))||(d=!1)}),d&&r&&n){i=c;break}}let o=this.dataItems.length,h=this.endIndex();if(h{b(l.get(u))||(d=!1)}),d){h=c+1;break}}}if(i>0&&i--,this._endIndex=h,this._clearGraphics(),this._sindex=0,this._dindex=i,this.dataItems.length==1)this._startSegment(0);else for(;this._dindex0&&(bt=!0);let xt=!1;(A||f||w)&&(xt=!0);const at={points:j,segments:I,stacked:A,getOpen:xt,basePosX:F,basePosY:Wt,fillVisible:bt,xField:p,yField:x,xOpenField:v,yOpenField:_,vcx:g,vcy:m,baseAxis:u,xAxis:l,yAxis:d,locationX:mt,locationY:_t,openLocationX:Ut,openLocationY:Bt,minDistance:Ht};for(O=t;Ot){i=O;break}h.template=D}}if(pt){let D=R.dataContext[pt];if(D){if(D instanceof L||(D=L.new(D)),this._fillTemplate=D,O>t){i=O;break}r.template=D}}if(!a){let D=this.dataItems[O+1];D&&u.shouldGap(R,D,s,ut)&&(j=[],I.push(j),at.points=j)}}r.setRaw("userData",[t,O]),h.setRaw("userData",[t,O]),O===e&&this._endLine(j,I[0][0]),h&&this._drawStroke(h,I),r&&this._drawFill(r,I),this.axisRanges.each(R=>{const G=R.container,ot=R.fills,D=this.makeFill(ot);G&&G.children.push(D),D.setPrivate("visible",!0),this._drawFill(D,I);const Zt=R.strokes,Z=this.makeStroke(Zt);G&&G.children.push(Z),Z.setPrivate("visible",!0),this._drawStroke(Z,I),D.setRaw("userData",[t,O]),Z.setRaw("userData",[t,O])})}_getPoints(t,e){let i=e.points,s=t.get("locationX",e.locationX),a=t.get("locationY",e.locationY),r=e.xAxis.getDataItemPositionX(t,e.xField,s,e.vcx),n=e.yAxis.getDataItemPositionY(t,e.yField,a,e.vcy);if(this._shouldInclude(r)){const o=this.getPoint(r,n),h=[o.x,o.y];if(o.x+=this._x,o.y+=this._y,t.set("point",o),e.fillVisible){let c=r,l=n;if(e.baseAxis===e.xAxis?l=e.basePosY:e.baseAxis===e.yAxis&&(c=e.basePosX),e.getOpen){let u=t.get(e.xOpenField),g=t.get(e.yOpenField);if(u!=null&&g!=null){let m=t.get("openLocationX",e.openLocationX),p=t.get("openLocationY",e.openLocationY);if(e.stacked){let x=t.get("stackToItemX"),v=t.get("stackToItemY");x?(c=e.xAxis.getDataItemPositionX(x,e.xField,m,x.component.get("vcx")),B(c)&&(c=e.basePosX)):c=e.yAxis===e.baseAxis?e.basePosX:e.xAxis.getDataItemPositionX(t,e.xOpenField,m,e.vcx),v?(l=e.yAxis.getDataItemPositionY(v,e.yField,p,v.component.get("vcy")),B(l)&&(l=e.basePosY)):l=e.xAxis===e.baseAxis?e.basePosY:e.yAxis.getDataItemPositionY(t,e.yOpenField,p,e.vcy)}else c=e.xAxis.getDataItemPositionX(t,e.xOpenField,m,e.vcx),l=e.yAxis.getDataItemPositionY(t,e.yOpenField,p,e.vcy)}}let d=this.getPoint(c,l);h[2]=d.x,h[3]=d.y}if(e.minDistance>0){const c=h[0],l=h[1],d=h[2],u=h[3],g=this._previousPoint,m=g[0],p=g[1],x=g[2],v=g[3];(Math.hypot(c-m,l-p)>e.minDistance||d&&u&&Math.hypot(d-x,u-v)>e.minDistance)&&(i.push(h),this._previousPoint=h)}else i.push(h)}}_endLine(t,e){}_drawStroke(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",i=>{P(e,s=>{this._strokeGenerator.context(i),this._strokeGenerator(s)})})}_drawFill(t,e){t.get("visible")&&!t.get("forceHidden")&&t.set("draw",i=>{P(e,s=>{this._fillGenerator.context(i),this._fillGenerator(s)})})}_processAxisRange(t){super._processAxisRange(t),t.fills=new V(L.new({}),()=>Y._new(this._root,{themeTags:S(t.fills.template.get("themeTags",[]),["line","series","fill"])},[this.fills.template,t.fills.template])),t.strokes=new V(L.new({}),()=>Y._new(this._root,{themeTags:S(t.strokes.template.get("themeTags",[]),["line","series","stroke"])},[this.strokes.template,t.strokes.template]))}createLegendMarker(t){const e=this.get("legendDataItem");if(e){const i=e.get("marker"),s=e.get("markerRectangle");s&&s.setPrivate("visible",!1),i.set("background",H.new(i._root,{fillOpacity:0,fill:ee(0)}));const a=i.children.push(Y._new(i._root,{themeTags:["line","series","legend","marker","stroke"],interactive:!1},[this.strokes.template]));this._legendStroke=a;const r=i.children.push(Y._new(i._root,{themeTags:["line","series","legend","marker","fill"]},[this.fills.template]));this._legendFill=r;const n=this._root.interfaceColors.get("disabled");if(a.states.create("disabled",{fill:n,stroke:n}),r.states.create("disabled",{fill:n,stroke:n}),this.bullets.length>0){const o=this.bullets.getIndex(0);if(o){const h=o(i._root,this,new st(this,{legend:!0},{}));if(h){const c=h.get("sprite");c instanceof Y&&c.states.create("disabled",{fill:n,stroke:n}),c&&(c.set("tooltipText",void 0),c.set("tooltipHTML",void 0),i.children.push(c),c.setAll({x:i.width()/2,y:i.height()/2}))}}}}}}Object.defineProperty(ct,"className",{enumerable:!0,configurable:!0,writable:!0,value:"LineSeries"}),Object.defineProperty(ct,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:W.classNames.concat([ct.className])});export{ht as _,dt as b,U as c,W as d,nt as o,rt as r,lt as u,ct as x}; diff --git a/dist/assets/LineVisualElement-4BP10o6v.js b/dist/assets/LineVisualElement-4BP10o6v.js new file mode 100644 index 0000000..e86f653 --- /dev/null +++ b/dist/assets/LineVisualElement-4BP10o6v.js @@ -0,0 +1 @@ +import{i4 as g,i5 as y,b6 as _,bi as C,b2 as P,as as h,bw as f,bv as w,h9 as O,aa as n,i6 as u,i7 as R,i8 as $,bA as G}from"./index-J0iiHjMT.js";import{a as b}from"./Object3DVisualElement-TMb7y_wl.js";function E(d,e,t,s=!1){const r=g(d,e);return r==null?null:(r.hasZ&&!s||t==null||(r.z=y(t,r)??0),r)}function F(d,e,t){t.warnOnce(`Failed to project analysis geometry (id: '${d.id}'), projection from spatial reference (wkid: '${e.wkid}') to view spatial reference is not supported. Projection may be possible after calling projection.load().`)}class H extends b{constructor(e,t){super(e),this._hasExternalMaterial=!1,this._hasExternalMaterial=t!=null,this._material=t??new _({width:1,color:C(1,0,1,1),stippleOffColor:null,stipplePattern:null,stipplePreferContinuous:!0,isClosed:!1,falloff:0,innerColor:null,innerWidth:1,hasPolygonOffset:!1,renderOccluded:P.OccludeAndTransparent,isDecoration:!!e.isDecoration,writeDepth:!0}),this.applyProperties(e)}setGeometryFromRenderSpacePoint(e,t=1e3){this.geometry=[[[e[0]-t,e[1],e[2]],[e[0]+t,e[1],e[2]]],[[e[0],e[1]-t,e[2]],[e[0],e[1]+t,e[2]]],[[e[0],e[1],e[2]-t],[e[0],e[1],e[2]+t]]]}setGeometryFromExtent(e){const t=this.view.spatialReference,s=n(),r=n(),a=100,o=[];h(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,r),o.push([r[0],r[1],r[2]]),h(s,e[2],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,r),o.push([r[0],r[1],r[2]]),h(s,e[2],e[3],a),this.view.renderCoordsHelper.toRenderCoords(s,t,r),o.push([r[0],r[1],r[2]]),h(s,e[0],e[3],a),this.view.renderCoordsHelper.toRenderCoords(s,t,r),o.push([r[0],r[1],r[2]]),h(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,r),o.push([r[0],r[1],r[2]]),h(s,e[0],e[1],a),this.view.renderCoordsHelper.toRenderCoords(s,t,r),o.push([r[0],r[1],r[2]]),this.geometry=[o]}setGeometryFromFrustum(e){const t=[];e.lines.forEach(s=>{t.push([s.origin[0],s.origin[1],s.origin[2]]),t.push([s.endpoint[0],s.endpoint[1],s.endpoint[2]])}),this.geometry=[t]}setGeometryFromBoundedPlane(e){const t=[],s=e.origin,r=e.basis1,a=e.basis2,o=.5,i=n(),l=n(),m=n(),p=n();i[0]=s[0]-r[0]*o-a[0]*o,i[1]=s[1]-r[1]*o-a[1]*o,i[2]=s[2]-r[2]*o-a[2]*o,l[0]=s[0]-r[0]*o+a[0]*o,l[1]=s[1]-r[1]*o+a[1]*o,l[2]=s[2]-r[2]*o+a[2]*o,m[0]=s[0]+r[0]*o+a[0]*o,m[1]=s[1]+r[1]*o+a[1]*o,m[2]=s[2]+r[2]*o+a[2]*o,p[0]=s[0]+r[0]*o-a[0]*o,p[1]=s[1]+r[1]*o-a[1]*o,p[2]=s[2]+r[2]*o-a[2]*o,t.push([i[0],i[1],i[2]]),t.push([l[0],l[1],l[2]]),t.push([m[0],m[1],m[2]]),t.push([p[0],p[1],p[2]]),t.push([i[0],i[1],i[2]]),this.geometry=[t]}setGeometryFromSegment(e){const t=e.endRenderSpace;this.transform=f(c,t);const{points:s}=e.createRenderGeometry(t,this.view.renderCoordsHelper);this.geometry=[s]}setGeometryFromSegments(e,t=w){this.transform=f(c,t),this.geometry=e.map(s=>s.createRenderGeometry(t,this.view.renderCoordsHelper).points)}getTransformedGeometry(){return this._geometry==null?null:this._geometry.map(e=>e.map(t=>O(n(),t,this.transform)))}get renderOccluded(){return this._material.parameters.renderOccluded}set renderOccluded(e){this._material.setParameters({renderOccluded:e})}get geometry(){return this._geometry}set geometry(e){this._geometry=e,this.recreateGeometry()}get width(){return this._material.parameters.width}set width(e){this._material.setParameters({width:e})}get color(){return this._material.parameters.color}set color(e){const t=e[3]===1;this._material.setParameters({color:u(e),writeDepth:t})}get innerWidth(){return this._material.parameters.innerWidth}set innerWidth(e){this._material.setParameters({innerWidth:e})}get innerColor(){return this._material.parameters.innerColor}set innerColor(e){this._material.setParameters({innerColor:e!=null?u(e):null})}get stipplePattern(){return this._material.parameters.stipplePattern}set stipplePattern(e){this._material!=null&&this._material.setParameters({stipplePattern:e})}get stippleOffColor(){return this._material.parameters.stippleOffColor}set stippleOffColor(e){this._material.setParameters({stippleOffColor:e!=null?u(e):null})}get stipplePreferContinuous(){return this._material.parameters.stipplePreferContinuous}set stipplePreferContinuous(e){this._material.setParameters({stipplePreferContinuous:e})}get falloff(){return this._material.parameters.falloff}set falloff(e){this._material.setParameters({falloff:e})}get polygonOffset(){return this._material.parameters.hasPolygonOffset}set polygonOffset(e){this._material.setParameters({hasPolygonOffset:e})}createExternalResources(){}destroyExternalResources(){}createGeometries(e){for(const t of R(this.geometry)){const s=$(this._material,t);e.addGeometry(s)}}forEachExternalMaterial(e){this._hasExternalMaterial||e(this._material)}}const c=G();export{E as r,F as t,H as u}; diff --git a/dist/assets/LinkChartLayer-uIn6uT3L.js b/dist/assets/LinkChartLayer-uIn6uT3L.js new file mode 100644 index 0000000..974cf25 --- /dev/null +++ b/dist/assets/LinkChartLayer-uIn6uT3L.js @@ -0,0 +1,7 @@ +import{eU as le,dy as fr,eZ as Dt,e as l,y as p,c as R,p as ke,dr as se,ar as Wt,dJ as gr,de as at,kj as ot,E as _,ha as Tt,hq as Vt,T as Ge,N as ye,l as Se,Z as Ee,bW as ve,kt as wr,ca as ge,fd as Kt,eV as De,e1 as st,dT as Re,kv as Gt,ld as Rt,ix as _r,dK as Zt,dO as Xt,dL as br,wn as Tr,fe as me,dw as St,wo as We,iF as Er,il as kr,iv as Mr,iM as xr,c7 as er,V as Nt,e_ as $t,s as Cr}from"./index-J0iiHjMT.js";import{p as ue}from"./geohashUtils-U0jvYCSY.js";import{m as Ir}from"./FeatureStore-X-AIJLo2.js";import{W as Lr}from"./QueryEngine-8tLWlkSE.js";import{l as vr,o as Ve}from"./clientSideDefaults-F-CNnR0g.js";import{c as Dr}from"./FeatureReductionLayer-RlitE1N6.js";import{d as Gr}from"./FeatureSet-d4S1oKME.js";import"./BoundsStore-wmwfHjhp.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";const Rr="ESRI__DESTINATION_ID",Sr="ESRI__ORIGIN_ID";let Ke=class pe{constructor(){this._featureLookup=new Map}static getInstance(){return pe.instance||(pe.instance=new pe),pe.instance}static resetInstance(){pe.instance&&(pe.instance=null)}deleteFromStore(t){t.forEach(r=>{this._featureLookup.delete(r)})}readFromStoreByList(t){const r=[];return t.forEach(i=>{const n=this.readFromStoreById(i);n&&r.push(n)}),r}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,r,i){const n=[];return t.forEach(a=>{if(!(a!=null&&a.id))return;a.properties||(a.properties=[]);let o,s=null;if(i&&a.properties[i]&&(s=le(a.properties[i])),"originId"in a&&"destinationId"in a&&(a.properties[Sr]=a.originId,a.properties[Rr]=a.destinationId),a.properties[r]=a.id,a.id&&this._featureLookup.has(a.id)&&this._featureLookup.get(a.id).attributes){const d=this._featureLookup.get(a.id),u=JSON.parse(JSON.stringify(Object.assign(d.attributes,a.properties)));i&&a.properties[i]&&(u[i]=fr(a.properties[i])),o=new Dt(s?JSON.parse(JSON.stringify(s)):d!=null&&d.geometry?JSON.parse(JSON.stringify(d.geometry)):null,u,null,a.properties[r])}else o=new Dt(s?JSON.parse(JSON.stringify(s)):null,a.properties,null,a.properties[r]);this._featureLookup.set(a.id,o),n.push(o)}),n}},Pe=class extends ke{constructor(t){super(t),this.resultRows=[]}};l([p()],Pe.prototype,"resultRows",void 0),Pe=l([R("esri.rest.knowledgeGraph.GraphQueryResult")],Pe);const Ft=Pe;let Oe=class extends ke{constructor(t){super(t),this.resultRowsStream=new ReadableStream}};l([p()],Oe.prototype,"resultRowsStream",void 0),Oe=l([R("esri.rest.knowledgeGraph.GraphQueryResult")],Oe);const Pt=Oe;let ae=class extends se{constructor(t){super(t),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};l([p({type:String,json:{write:!0}})],ae.prototype,"name",void 0),l([p({type:Boolean,json:{write:!0}})],ae.prototype,"unique",void 0),l([p({type:Boolean,json:{write:!0}})],ae.prototype,"ascending",void 0),l([p({type:String,json:{write:!0}})],ae.prototype,"description",void 0),l([p({type:[String],json:{write:!0}})],ae.prototype,"fieldNames",void 0),ae=l([R("esri.rest.knowledgeGraph.FieldIndex")],ae);const tr=ae;let q=class extends se{constructor(t){super(t),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};l([p({type:String,json:{write:!0}})],q.prototype,"name",void 0),l([p({type:String,json:{write:!0}})],q.prototype,"alias",void 0),l([p({type:String,json:{write:!0}})],q.prototype,"fieldType",void 0),l([p({type:String,json:{write:!0}})],q.prototype,"geometryType",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"hasM",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"hasZ",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"nullable",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"editable",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"required",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"defaultVisibility",void 0),l([p({type:Boolean,json:{write:!0}})],q.prototype,"systemMaintained",void 0),l([p()],q.prototype,"role",void 0),l([p({type:Object,json:{type:String,write:{writer:(e,t)=>{t.defaultValue=e!=null?e.toString():null}}}})],q.prototype,"defaultValue",void 0),q=l([R("esri.rest.knowledgeGraph.GraphProperty")],q);const rr=q;let ne=class extends se{constructor(t){super(t),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null}};l([p({type:String,json:{write:!0}})],ne.prototype,"name",void 0),l([p({type:String,json:{write:!0}})],ne.prototype,"alias",void 0),l([p({type:String,json:{write:!0}})],ne.prototype,"role",void 0),l([p({type:Boolean,json:{write:!0}})],ne.prototype,"strict",void 0),l([p({type:[rr],json:{write:!0}})],ne.prototype,"properties",void 0),l([p({type:[tr],json:{write:!0}})],ne.prototype,"fieldIndexes",void 0),ne=l([R("esri.rest.knowledgeGraph.GraphObjectType")],ne);const ir=ne;let lt=class extends ir{constructor(t){super(t)}};lt=l([R("esri.rest.knowledgeGraph.EntityType")],lt);const Et=lt;let je=class extends ir{constructor(t){super(t),this.endPoints=[]}};l([p()],je.prototype,"endPoints",void 0),je=l([R("esri.rest.knowledgeGraph.RelationshipType")],je);const kt=je;let V=class extends se{constructor(t){super(t),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null}};l([p({type:Date,json:{type:Number,write:{writer:(e,t)=>{t.timestamp=e==null?void 0:e.getTime()}}}})],V.prototype,"timestamp",void 0),l([p({type:Wt,json:{write:!0}})],V.prototype,"spatialReference",void 0),l([p({type:Boolean,json:{write:!0}})],V.prototype,"strict",void 0),l([p({type:String,json:{write:!0}})],V.prototype,"objectIdField",void 0),l([p({type:String,json:{write:!0}})],V.prototype,"globalIdField",void 0),l([p()],V.prototype,"arcgisManaged",void 0),l([p()],V.prototype,"identifierInfo",void 0),l([p()],V.prototype,"searchIndexes",void 0),l([p({type:[Et],json:{write:!0}})],V.prototype,"entityTypes",void 0),l([p({type:[kt],json:{write:!0}})],V.prototype,"relationshipTypes",void 0),V=l([R("esri.rest.knowledgeGraph.DataModel")],V);const nr=V;let P=class extends se{constructor(t){super(t),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1}};l([p({type:[String],json:{write:!0}})],P.prototype,"capabilities",void 0),l([p({type:Boolean,json:{write:!0}})],P.prototype,"supportsSearch",void 0),l([p({type:[String],json:{write:!0}})],P.prototype,"supportedQueryFormats",void 0),l([p({type:Boolean,json:{write:!0}})],P.prototype,"allowGeometryUpdates",void 0),l([p({type:Number,json:{write:!0}})],P.prototype,"searchMaxRecordCount",void 0),l([p({type:Object,json:{write:!0}})],P.prototype,"serviceCapabilities",void 0),l([p({type:Number,json:{write:!0}})],P.prototype,"maxRecordCount",void 0),l([p({type:String,json:{write:!0}})],P.prototype,"description",void 0),l([p({type:String,json:{write:!0}})],P.prototype,"copyrightText",void 0),l([p({type:String,json:{write:!0}})],P.prototype,"units",void 0),l([p({type:Object,json:{write:!0}})],P.prototype,"spatialReference",void 0),l([p({type:Number,json:{write:!0}})],P.prototype,"currentVersion",void 0),l([p({type:Object,json:{write:!0}})],P.prototype,"dateFieldsTimeReference",void 0),l([p({type:String,json:{write:!0}})],P.prototype,"serviceItemId",void 0),l([p({type:Boolean,json:{write:!0}})],P.prototype,"supportsDocuments",void 0),l([p({type:Boolean,json:{write:!0}})],P.prototype,"dataEditingNotSupported",void 0),l([p({type:Boolean,json:{write:!0}})],P.prototype,"schemaEditingNotSupported",void 0),P=l([R("esri.rest.knowledgeGraph.ServiceDefinition")],P);const ar=P;let we=class extends se{constructor(t){super(t),this.dataModel=null,this.serviceDefinition=null}};l([p({type:String,json:{write:!0}})],we.prototype,"url",void 0),l([p({type:nr,json:{write:!0}})],we.prototype,"dataModel",void 0),l([p({type:ar,json:{write:!0}})],we.prototype,"serviceDefinition",void 0),we=l([R("esri.rest.knowledgeGraph.KnowledgeGraph")],we);const Nr=we,Ot="esri/rest/knowledgeGraph/wasmInterface/";let Ze;async function oe(){const e=Ze;if(e)return e;const t=gr("wasm-simd");return Ze=$r(t),Ze}async function $r(e){if(e){const{default:r}=await at(()=>import("./arcgis-knowledge-client-core-simd-wFoqgd0S.js"),__vite__mapDeps([0,1,2])).then(i=>i.a);return r({locateFile:i=>ot(Ot+i)})}const{default:t}=await at(()=>import("./arcgis-knowledge-client-core-k0_SaRI-.js"),__vite__mapDeps([3,1,2])).then(r=>r.a);return t({locateFile:r=>ot(Ot+r)})}function or(e,t){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(i=>{r.add_value(xt(i,t))}),r}function sr(e,t){const r=new t.ObjectValue;r.deleteLater();for(const[i,n]of Object.entries(e))r.set_key_value(i,xt(n,t));return r}function Mt(e,t){if(e instanceof Vt)return jr(e,t);if(e instanceof Ge)return Ar(e,t);if(e instanceof ye||e instanceof Se)return Or(e,t);throw new _("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function Fr(e,t){t.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pr(e,t,r){if(!e.extent)throw new _("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new _("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new _("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);t.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:r.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function xt(e,t){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof Tt)return Mt(e,t);if(Array.isArray(e)){const r=new t.ArrayValue;return r.deleteLater(),e.forEach(i=>{r.add_value(xt(i,t))}),r}return sr(e,t)}function Or(e,t){const r=new t.GeometryValue;r.deleteLater(),r.has_z=e.hasZ,r.has_m=e.hasM;const i=[],n=[];let a=[];e instanceof ye?(r.geometry_type=t.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof Se&&(r.geometry_type=t.esriGeometryType.esriGeometryPolygon,a=e.rings);let o=0,s=0;return a.forEach(d=>{let u=0;d.forEach(c=>{u++,c.forEach(m=>{i[s]=m,s++})}),n[o]=u,o++}),r.coords=new Float64Array(i),r.lengths=new Uint32Array(n),r}function jr(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=r.geometry_type=t.esriGeometryType.esriGeometryMultipoint,r.has_z=e.hasZ,r.has_m=e.hasM;const i=[],n=[];n[0]=e.points.length;let a=0;return e.points.forEach(o=>{o.forEach(s=>{i[a]=s,a++})}),r.coords=new Float64Array(i),r.lengths=new Uint32Array(n),r}function Ar(e,t){const r=new t.GeometryValue;r.deleteLater(),r.geometry_type=t.esriGeometryType.esriGeometryPoint,r.has_z=e.hasZ,r.has_m=e.hasM;const i=[],n=[];n[0]=1,i[0]=e.x,i[1]=e.y;let a=2;return e.hasZ&&(i[a]=e.z,a++),e.hasM&&(i[a]=e.m,a++),r.coords=new Float64Array(i),r.lengths=new Uint32Array(n),r}let Ae=class extends se{constructor(t){super(t),this.properties=null}};l([p({json:{write:!0}})],Ae.prototype,"properties",void 0),Ae=l([R("esri.rest.knowledgeGraph.GraphObject")],Ae);const Ct=Ae;let Ie=class extends Ct{constructor(t){super(t),this.typeName=null,this.id=null}};l([p({type:String,json:{write:!0}})],Ie.prototype,"typeName",void 0),l([p({type:String,json:{write:!0}})],Ie.prototype,"id",void 0),Ie=l([R("esri.rest.knowledgeGraph.GraphNamedObject")],Ie);const lr=Ie;let ze=class extends lr{constructor(t){super(t),this.layoutGeometry=null}};l([p({type:Ge,json:{write:!0}})],ze.prototype,"layoutGeometry",void 0),ze=l([R("esri.rest.knowledgeGraph.Entity")],ze);const pr=ze;let _e=class extends lr{constructor(t){super(t),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};l([p({type:String,json:{write:!0}})],_e.prototype,"originId",void 0),l([p({type:String,json:{write:!0}})],_e.prototype,"destinationId",void 0),l([p({type:ye,json:{write:!0}})],_e.prototype,"layoutGeometry",void 0),_e=l([R("esri.rest.Relationship.Relationship")],_e);const dr=_e;function $e(e,t){if(!e.typeName)throw new _("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof pr){const r=new t.EntityValue;r.deleteLater(),r.type_name=e.typeName;for(const[i,n]of Object.entries(e.properties))r.set_key_value(i,jt(n,t));return e.id&&r.set_id(e.id),r}if(e instanceof dr){const r=new t.RelationshipValue;r.deleteLater(),r.type_name=e.typeName;for(const[i,n]of Object.entries(e.properties))r.set_key_value(i,jt(n,t));return e.id&&r.set_id(e.id),e.originId&&e.destinationId&&r.set_related_entity_ids(e.originId,e.destinationId),r}throw new _("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function zr(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function jt(e,t){return e==null?"":typeof e!="object"||e instanceof Date?e:e instanceof Tt?Mt(e,t):""}let de=class extends ke{constructor(t){super(t),this.name=null,this.supportedCategory=null,this.analyzers=[],this.searchProperties=new Map}};l([p()],de.prototype,"name",void 0),l([p()],de.prototype,"supportedCategory",void 0),l([p()],de.prototype,"analyzers",void 0),l([p()],de.prototype,"searchProperties",void 0),de=l([R("esri.rest.knowledgeGraph.SearchIndex")],de);const Qr=de;var Ye,Be,He,pt,dt,ut,ht;(function(e){e[e.Regular=0]="Regular",e[e.Provenance=1]="Provenance",e[e.Document=2]="Document"})(Ye||(Ye={})),function(e){e[e.esriFieldTypeSmallInteger=0]="esriFieldTypeSmallInteger",e[e.esriFieldTypeInteger=1]="esriFieldTypeInteger",e[e.esriFieldTypeSingle=2]="esriFieldTypeSingle",e[e.esriFieldTypeDouble=3]="esriFieldTypeDouble",e[e.esriFieldTypeString=4]="esriFieldTypeString",e[e.esriFieldTypeDate=5]="esriFieldTypeDate",e[e.esriFieldTypeOID=6]="esriFieldTypeOID",e[e.esriFieldTypeGeometry=7]="esriFieldTypeGeometry",e[e.esriFieldTypeBlob=8]="esriFieldTypeBlob",e[e.esriFieldTypeRaster=9]="esriFieldTypeRaster",e[e.esriFieldTypeGUID=10]="esriFieldTypeGUID",e[e.esriFieldTypeGlobalID=11]="esriFieldTypeGlobalID",e[e.esriFieldTypeXML=12]="esriFieldTypeXML",e[e.esriFieldTypeBigInteger=13]="esriFieldTypeBigInteger",e[e.esriFieldTypeDateOnly=14]="esriFieldTypeDateOnly",e[e.esriFieldTypeTimeOnly=15]="esriFieldTypeTimeOnly",e[e.esriFieldTypeTimestampOffset=16]="esriFieldTypeTimestampOffset"}(Be||(Be={})),function(e){e[e.esriGeometryNull=0]="esriGeometryNull",e[e.esriGeometryPoint=1]="esriGeometryPoint",e[e.esriGeometryMultipoint=2]="esriGeometryMultipoint",e[e.esriGeometryPolyline=3]="esriGeometryPolyline",e[e.esriGeometryPolygon=4]="esriGeometryPolygon",e[e.esriGeometryEnvelope=5]="esriGeometryEnvelope",e[e.esriGeometryAny=6]="esriGeometryAny",e[e.esriGeometryMultiPatch=7]="esriGeometryMultiPatch"}(He||(He={})),function(e){e[e.esriMethodHintUNSPECIFIED=0]="esriMethodHintUNSPECIFIED",e[e.esriUUIDESRI=1]="esriUUIDESRI",e[e.esriUUIDRFC4122=2]="esriUUIDRFC4122"}(pt||(pt={})),function(e){e[e.esriTypeUNSPECIFIED=0]="esriTypeUNSPECIFIED",e[e.esriTypeEntity=1]="esriTypeEntity",e[e.esriTypeRelationship=2]="esriTypeRelationship",e[e.esriTypeBoth=4]="esriTypeBoth"}(dt||(dt={})),function(e){e[e.esriGraphPropertyUNSPECIFIED=0]="esriGraphPropertyUNSPECIFIED",e[e.esriGraphPropertyRegular=1]="esriGraphPropertyRegular",e[e.esriGraphPropertyDocumentName=2]="esriGraphPropertyDocumentName",e[e.esriGraphPropertyDocumentTitle=3]="esriGraphPropertyDocumentTitle",e[e.esriGraphPropertyDocumentUrl=4]="esriGraphPropertyDocumentUrl",e[e.esriGraphPropertyDocumentText=5]="esriGraphPropertyDocumentText",e[e.esriGraphPropertyDocumentKeywords=6]="esriGraphPropertyDocumentKeywords",e[e.esriGraphPropertyDocumentContentType=7]="esriGraphPropertyDocumentContentType",e[e.esriGraphPropertyDocumentMetadata=8]="esriGraphPropertyDocumentMetadata",e[e.esriGraphPropertyDocumentFileExtension=9]="esriGraphPropertyDocumentFileExtension"}(ut||(ut={})),function(e){e[e.esriIdentifierInfoTypeUNSPECIFIED=0]="esriIdentifierInfoTypeUNSPECIFIED",e[e.esriIdentifierInfoTypeDatabaseNative=1]="esriIdentifierInfoTypeDatabaseNative",e[e.esriIdentifierInfoTypeUniformProperty=2]="esriIdentifierInfoTypeUniformProperty"}(ht||(ht={}));function Ur(e){var t,r,i,n,a,o,s,d,u,c,m;return e.deleteLater(),new nr({timestamp:e.timestamp,spatialReference:new Wt(e.spatial_reference),strict:e.strict,objectIdField:e.objectid_property,globalIdField:e.globalid_property,arcgisManaged:e.arcgis_managed,identifierInfo:{identifierMappingInfo:{identifierInfoType:ht[(i=(r=(t=e.identifier_info)==null?void 0:t.identifier_mapping_info)==null?void 0:r.identifier_info_type)==null?void 0:i.value],databaseNativeIdentifier:(a=(n=e.identifier_info)==null?void 0:n.identifier_mapping_info)==null?void 0:a.database_native_identifier,uniformPropertyIdentifier:{identifierPropertyName:(d=(s=(o=e.identifier_info)==null?void 0:o.identifier_mapping_info)==null?void 0:s.uniform_property_identifier)==null?void 0:d.identifier_property_name}},identifierGenerationInfo:{uuidMethodHint:pt[(m=(c=(u=e.identifier_info)==null?void 0:u.identifier_generation_info)==null?void 0:c.uuid_method_hint)==null?void 0:m.value]}},searchIndexes:Xr(e.search_indexes),entityTypes:Jr(e.entity_types),relationshipTypes:Zr(e.relationship_types)})}function qr(e){return e.deleteLater(),new Et(ur(e))}function Yr(e){return e.deleteLater(),new tr({name:e.name,unique:e.unique,ascending:e.ascending,description:e.description,fieldNames:Wr(e.fields)})}function ur(e){return{name:e.name,alias:e.alias,role:Ye[e.role.value]?Ye[e.role.value]:null,strict:e.strict,properties:Vr(e.properties),fieldIndexes:Kr(e.field_indexes)}}function Br(e){return e.deleteLater(),new rr({alias:e.alias,name:e.name,fieldType:Be[e.field_type.value]?Be[e.field_type.value]:null,geometryType:He[e.geometry_type.value]?He[e.geometry_type.value]:null,hasM:e.has_m,hasZ:e.has_z,nullable:e.nullable,editable:e.editable,required:e.required,defaultVisibility:e.default_visibility,systemMaintained:e.system_maintained,role:ut[e.role.value],defaultValue:e.default_value})}function Hr(e){e.deleteLater();const t=ur(e),r=[];for(let i=0;i{const d=[];for(let u=0;u{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case Z.ESRI_GEOMETRY_POINT:return ii(e);case Z.ESRI_GEOMETRY_MULTIPOINT:return ri(e);case Z.ESRI_GEOMETRY_POLYLINE:return ni(e);case Z.ESRI_GEOMETRY_POLYGON:return ai(e);case Z.ESRI_GEOMETRY_ENVELOPE:case Z.ESRI_GEOMETRY_MULTI_PATCH:return Fe.warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case Z.ESRI_GEOMETRY_NULL:case Z.ESRI_GEOMETRY_ANY:default:return Fe.warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return Fe.warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case he.OBJECT:return li(e,t);case he.ENTITY:return cr(e,t);case he.RELATIONSHIP:return yr(e,t);case he.PATH:return pi(e,t);case he.ARRAY:return si(e,t);default:return Fe.warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function si(e,t){const r=[],i=e.count();for(let n=0;n{const t=new Nr({url:e}),r=[];return r.push(Je(t)),r.push(ci(t)),await Promise.all(r),t},refreshDataModel:async e=>{e.dataModel=await mr(e)},refreshServiceDefinition:async e=>{var r,i;const t=(await ve(e.url,{query:{f:"json"}})).data;return t.capabilities=(r=t==null?void 0:t.capabilities)==null?void 0:r.split(","),t.supportedQueryFormats=(i=t==null?void 0:t.supportedQueryFormats)==null?void 0:i.split(","),e.serviceDefinition=new ar(t),e.serviceDefinition},executeQueryStreaming:async(e,t,r)=>{const i=`${e.url}/graph/query`;await et(e);const n=await tt(i,r);n.data.body=await fi(t,e);const a=await Xe(n.data.url,n.data);if(e.dataModel)return new Pt({resultRowsStream:await zt(a,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,t,r)=>{var a;if((a=e.serviceDefinition)!=null&&a.dataEditingNotSupported)throw new _("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const i=`${e.url}/graph/applyEdits`;await et(e);const n=await tt(i,r);return n.data.body=await mi(t,e),wi(await Xe(n.data.url,n.data))},executeQuery:async(e,t,r)=>{var s;const i=`${e.url}/graph/query`,n=await ve(i,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:t.openCypherQuery,...r==null?void 0:r.query},signal:r==null?void 0:r.signal,timeout:r==null?void 0:r.timeout}),a=(s=n.getHeader)==null?void 0:s.call(n,"content-type"),o=n.data;if(a!=null&&a.includes("application/x-protobuf")){const d=new(await oe()).GraphQueryDecoder;if(d.deleteLater(),e.dataModel)return new Ft({resultRows:yt(d,o,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:n.data})},executeSearch:async(e,t,r)=>{var d;const i=t.typeCategoryFilter,n=`${e.url}/graph/search`,a=await ve(n,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${t.searchQuery}"`,typeCategoryFilter:i,...r==null?void 0:r.query},signal:r==null?void 0:r.signal,timeout:r==null?void 0:r.timeout}),o=(d=a.getHeader)==null?void 0:d.call(a,"content-type"),s=a.data;if(o!=null&&o.includes("application/x-protobuf")){const u=new(await oe()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel)return new Ft({resultRows:yt(u,s,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:a.data})},executeSearchStreaming:async(e,t,r)=>{const i=`${e.url}/graph/search`;await et(e);const n=await tt(i,r);n.data.body=await gi(t);const a=await Xe(n.data.url,n.data);if(e.dataModel)return new Pt({resultRowsStream:await zt(a,e.dataModel)});throw new _("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},_fetchWrapper:async(e,t)=>fetch(e,t)};async function Ue(e,t,r){return Ne.executeQueryStreaming(e,t,r)}async function hi(e){return Ne.fetchKnowledgeGraph(e)}async function Je(e){return Ne.refreshDataModel(e)}async function ci(e){return Ne.refreshServiceDefinition(e)}async function Xe(e,t){return Ne._fetchWrapper(e,t)}async function et(e){var r;((r=wr)==null?void 0:r.findCredential(e.url))||(e.dataModel?await mr(e):await Je(e))}function xe(e,t,r){if(e.error_code!==0)throw new _(t,r,{errorCode:e.error_code,errorMessage:e.error_message})}function yi(e,t,r,i){t==null?r.set_param_key_value(e,""):typeof t!="object"||t instanceof Date?r.set_param_key_value(e,t):t instanceof Tt?r.set_param_key_value(e,Mt(t,i)):t instanceof Array?r.set_param_key_value(e,or(t,i)):r.set_param_key_value(e,sr(t,i))}async function mi(e,t){var o,s,d,u,c,m,g,h,E;if(t.dataModel||await Je(t),!t.dataModel)throw new _("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const r=await oe(),i=!!((o=e.options)!=null&&o.cascadeDelete),n=new r.GraphApplyEditsEncoder(r.SpatialReferenceUtil.WGS84(),(s=e.options)!=null&&s.inputQuantizationParameters?zr((d=e.options)==null?void 0:d.inputQuantizationParameters):r.InputQuantizationUtil.WGS84_lossless());n.deleteLater(),n.cascade_delete=i;try{let w;(u=e.entityAdds)==null||u.forEach(y=>{w=n.add_entity($e(y,r)),xe(w,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(c=e.relationshipAdds)==null||c.forEach(y=>{if(!y.originId||!y.destinationId)throw new _("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");w=n.add_relationship($e(y,r)),xe(w,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(m=e.entityUpdates)==null||m.forEach(y=>{if(!y.id)throw new _("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");w=n.update_entity($e(y,r)),xe(w,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),(g=e.relationshipUpdates)==null||g.forEach(y=>{if(!y.id)throw new _("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");w=n.update_relationship($e(y,r)),xe(w,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),(h=e.entityDeletes)==null||h.forEach(y=>{var I;if(!y.typeName)throw new _("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const b=n.make_delete_helper(y.typeName,!0);b.deleteLater(),(I=y.ids)==null||I.forEach(Q=>{b.delete_by_id(Q)})}),(E=e.relationshipDeletes)==null||E.forEach(y=>{var I;if(!y.typeName)throw new _("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const b=n.make_delete_helper(y.typeName,!1);(I=y.ids)==null||I.forEach(Q=>{b.delete_by_id(Q)})}),n.encode()}catch(w){throw new _("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:w})}const a=n.get_encoding_result();return xe(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),a.get_byte_buffer()}async function fi(e,t){var a,o;const r=await oe(),i=new r.GraphQueryRequestEncoder;if(i.deleteLater(),i.output_spatial_reference=r.SpatialReferenceUtil.WGS84(),i.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[s,d]of Object.entries(e.bindParameters))yi(s,d,i,r);if(e.bindGeometryQuantizationParameters)Fr(e.bindGeometryQuantizationParameters,i);else{if(t.dataModel||await Je(t),((o=(a=t.dataModel)==null?void 0:a.spatialReference)==null?void 0:o.wkid)!==4326)throw new _("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");i.input_quantization_parameters=r.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&Pr(e.outputQuantizationParameters,i,r);try{i.encode()}catch(s){throw new _("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:s})}const n=i.get_encoding_result();if(n.error.error_code!==0)throw new _("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return n.get_byte_buffer()}async function gi(e){var n;const t=await oe(),r=new t.GraphSearchRequestEncoder;if(r.deleteLater(),r.search_query=e.searchQuery,r.type_category_filter=t.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(r.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(r.start_index=e.start),e.num!=null&&(r.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{r.set_ids_filter(or(e.idsFilter,t))}catch(a){throw new _("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:a})}(n=e.namedTypesFilter)==null||n.forEach(a=>{r.add_named_type_filter(a)});try{r.encode()}catch(a){throw new _("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:a})}const i=r.get_encoding_result();if(i.error.error_code!==0)throw new _("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:i.error.error_code,errorMessage:i.error.error_message});return i.get_byte_buffer()}async function tt(e,t){return ve(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...t==null?void 0:t.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:t==null?void 0:t.signal,timeout:t==null?void 0:t.timeout})}async function wi(e){const t=e.headers.get("content-type");if(t!=null&&t.includes("application/x-protobuf")){const r=await e.arrayBuffer(),i=new(await oe()).GraphApplyEditsDecoder;return i.deleteLater(),i.decode(new Uint8Array(r)),ui(i)}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}function yt(e,t,r){e.push_buffer(new Uint8Array(t));const i=[];let n=0;for(;e.next_row();){n||(n=e.get_header_keys().size());const a=new Array(n);for(let o=0;o{if(d){let m;if(a.has_error()&&(m=new _("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded",{errorCode:a.error.error_code,errorMessage:a.error.error_message})),n.releaseLock(),m)throw o.error(m),m;return void o.close()}const c=yt(a,u,t);return c.length>0&&o.enqueue(c),s()})}}})}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}async function mr(e){var a;const t=`${e.url}/dataModel/queryDataModel`,r=await ve(t,{responseType:"array-buffer",query:{f:"pbf"}}),i=(a=r.getHeader)==null?void 0:a.call(r,"content-type"),n=r.data;if(i!=null&&i.includes("application/x-protobuf")){const o=(await oe()).decode_data_model_from_protocol_buffer(new Uint8Array(n));if(!o)throw new _("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return Ur(o)}throw new _("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:i,data:r.data})}let qe=class extends ke{constructor(t){super(t),this.openCypherQuery=""}};l([p()],qe.prototype,"openCypherQuery",void 0),qe=l([R("esri.rest.knowledgeGraph.GraphQuery")],qe);const _i=qe;let Te=class extends _i{constructor(t){super(t),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null}};l([p()],Te.prototype,"bindParameters",void 0),l([p()],Te.prototype,"bindGeometryQuantizationParameters",void 0),l([p()],Te.prototype,"outputQuantizationParameters",void 0),Te=l([R("esri.rest.knowledgeGraph.GraphQueryStreaming")],Te);const Le=Te;function bi(e){if(!e.spatialReference.isWGS84)throw new _("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");let t;return t=e.xmax>180&&e.xmin<180?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[180,e.ymax],[180,e.ymin],[e.xmin,e.ymin]],[[-180,e.ymin],[-180,e.ymax],[e.xmax-360,e.ymax],[e.xmax-360,e.ymin],[-180,e.ymin]]]:e.xmax>180&&e.xmin>180?[[[e.xmin-360,e.ymin],[e.xmin-360,e.ymax],[e.xmax-360,e.ymax],[e.xmax-360,e.ymin],[e.xmin-360,e.ymin]]]:e.xmax>-180&&e.xmin<-180?[[[e.xmin+360,e.ymin],[e.xmin+360,e.ymax],[180,e.ymax],[180,e.ymin],[e.xmin+360,e.ymin]],[[-180,e.ymin],[-180,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[-180,e.ymin]]]:e.xmax<-180&&e.xmin<-180?[[[e.xmin+360,e.ymin],[e.xmin+360,e.ymax],[e.xmax+360,e.ymax],[e.xmax+360,e.ymin],[e.xmin+360,e.ymin]]]:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],t}async function Ti(e,t){var a,o;const r=[],i=new Map,n=[];if((a=t.dataModel)!=null&&a.relationshipTypes)for(const s of t.dataModel.relationshipTypes)s.name&&i.set(s.name,[]);for(const s of e)i.has(s.typeName)&&((o=i.get(s.typeName))==null||o.push(s.id));for(const[s,d]of i){if(d.length<1)continue;const u=new Le({openCypherQuery:`MATCH (n)-[r:${s}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:d}});n.push(Ue(t,u).then(async c=>{const m=c.resultRowsStream.getReader();for(;;){const{done:g,value:h}=await m.read();if(g)break;for(const E of h)r.push({id:E[0],typeName:E[1]}),r.push({id:E[2],typeName:E[3]})}}))}return await Promise.all(n),r}const D="ESRI__ID",Ce="ESRI__ORIGIN_ID",rt="ESRI__DESTINATION_ID",O="ESRI__LAYOUT_GEOMETRY",ce=12,Qt=Ee.getLogger("esri.rest.knowledgeGraph.knowledgeGraphLayer.KnowledgeGraphLayerDataManager");let te=class extends ke{constructor(t){var i,n,a;super(t),this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.memberIdTypeLookup=new Map,this._processingCacheUpdatesLookup=new Map;const r=new Map;(i=t.knowledgeGraph.dataModel.entityTypes)==null||i.forEach(o=>{var s,d;o.name&&(r.set(o.name,"entity"),this._processingCacheUpdatesLookup.set(o.name,[]),t.inclusionModeDefinition&&!((s=t.inclusionModeDefinition)!=null&&s.generateAllSublayers)||this.entityTypeNames.add(o.name),(d=o.properties)==null||d.forEach(u=>{u.geometryType&&u.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(o.name,{name:u.name??"",geometryType:u.geometryType})}))}),(n=t.knowledgeGraph.dataModel.relationshipTypes)==null||n.forEach(o=>{var s,d;o.name&&(r.set(o.name,"relationship"),this._processingCacheUpdatesLookup.set(o.name,[]),t.inclusionModeDefinition&&!((s=t.inclusionModeDefinition)!=null&&s.generateAllSublayers)||this.relationshipTypeNames.add(o.name),(d=o.properties)==null||d.forEach(u=>{u.geometryType&&u.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(o.name,{name:u.name??"",geometryType:u.geometryType})}))}),(a=t.inclusionModeDefinition)==null||a.namedTypeDefinitions.forEach((o,s)=>{var u,c;if(r.get(s)==="entity")this.entityTypeNames.add(s);else{if(r.get(s)!=="relationship")return Qt.warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void((u=t.inclusionModeDefinition)==null?void 0:u.namedTypeDefinitions.delete(s));this.relationshipTypeNames.add(s)}const d=new Map;(c=o.members)==null||c.forEach(m=>{this.memberIdTypeLookup.set(m.id,s);const g=this.getById(m.id);g&&d.set(m.id,g)}),this.sublayerCaches.set(s,d)})}addToLayer(t){t.forEach(({typeName:r,id:i})=>{if(!this.inclusionModeDefinition)throw new _("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(r)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(r)){const n=this.inclusionModeDefinition.namedTypeDefinitions.get(r);n.members||(n.members=new Map),n.members.set(i,{id:i}),this.memberIdTypeLookup.set(i,r)}}else{const n=new Map;n.set(i,{id:i}),this.inclusionModeDefinition.namedTypeDefinitions.set(r,{useAllData:!1,members:n}),this.memberIdTypeLookup.set(i,r)}})}getById(t){return Ke.getInstance().readFromStoreById(t)}async getData(t,r,i){var a,o;if(r.objectType.name&&((a=this.inclusionModeDefinition)!=null&&a.namedTypeDefinitions)&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(r.objectType.name))return[];let n;if(n=t||new ge({where:"1=1",outFields:["*"]}),r.parentCompositeLayer.type==="link-chart"){const s=r.parentCompositeLayer,d=this._processingCacheUpdatesLookup.get(r.objectType.name??""),u=n.outFields,c=n.geometry;let m="",g="";c&&c.extent&&(m=ue(c.extent.ymin,c.extent.xmin,ce),g=ue(c.extent.ymax,c.extent.xmax,ce)),u&&u.length===1&&u[0]===D&&n.where==="1=1"||await Promise.all(d??[]);const h=this.sublayerCaches.has(r.objectType.name??"")?Array.from((o=this.sublayerCaches.get(r.objectType.name))==null?void 0:o.values()):[],E=[];return h.forEach(w=>{if(w.geometry=s.linkChartDiagramLookup.get(w.attributes[r.objectIdField]),w.attributes[O]=w.geometry,m&&g){const y=s.linkChartGeohashLookup.get(w.attributes[r.objectIdField]);y?y>=m&&y<=g&&E.push(w):E.push(w)}else E.push(w)}),E}return this.retrieveDataFromService(n,r,i)}async getConnectedRecordIds(t){const r=[],i=[],n=new Map;return t.forEach(a=>{var o;if(this.memberIdTypeLookup.has(a)){const s=this.memberIdTypeLookup.get(a);if(!this.entityTypeNames.has(s))return;n.has(s)?(o=n.get(s))==null||o.push(a):n.set(s,[a])}}),n.forEach((a,o)=>{const s=`MATCH (n:${o})-[r]-(m) WHERE id(n) IN $ids RETURN id(r), type(r), id(m), labels(m)[0]`,d=new Promise(u=>{(async()=>{const c=(await Ue(this.knowledgeGraph,new Le({openCypherQuery:s,bindParameters:{ids:a}}))).resultRowsStream.getReader();try{for(;;){const{done:m,value:g}=await c.read();if(m)break;for(let h=0;h{u()})});i.push(d)}),await Promise.all(i),r}async refreshCacheContent(t,r,i,n=!0){var u,c,m,g,h,E,w;const a=Ke.getInstance(),o=[],s=new Map,d=new Map;(u=this.knowledgeGraph.dataModel.entityTypes)==null||u.forEach(y=>{y.name&&d.set(y.name,y)}),(c=this.knowledgeGraph.dataModel.relationshipTypes)==null||c.forEach(y=>{y.name&&d.set(y.name,y)}),t||this.inclusionModeDefinition?t?t.forEach(y=>{var b;if(this.memberIdTypeLookup.has(y)){const I=this.memberIdTypeLookup.get(y);s.has(I)?(b=s.get(I))==null||b.push(y):s.set(I,[y])}}):(g=(m=this.inclusionModeDefinition)==null?void 0:m.namedTypeDefinitions)==null||g.forEach((y,b)=>{y.useAllData?s.set(b,null):y.members&&y.members.forEach(I=>{var Q;s.has(b)&&s.get(b)!==null?(Q=s.get(b))==null||Q.push(I.id):s.set(b,[I.id])})}):((h=this.knowledgeGraph.dataModel.entityTypes)==null||h.forEach(y=>{y.name&&s.set(y.name,null)}),(E=this.knowledgeGraph.dataModel.entityTypes)==null||E.forEach(y=>{y.name&&s.set(y.name,null)}));for(const[y,b]of s){const I=new Promise(Q=>{(async()=>{var K,M,S,B,Me,N,C;const J=new Set,X=[];let f,x="",L=!1;if(r||((M=(K=d.get(y))==null?void 0:K.properties)==null||M.forEach(G=>{G.name&&J.add(G.name)})),i&&this.geographicLookup.has(y)){const G=(S=this.geographicLookup.get(y))==null?void 0:S.name;G&&J.add(G)}if(this.entityTypeNames.has(y))x=`MATCH (n:${y}) ${b?"WHERE id(n) IN $ids ":""}return ID(n)`,J.forEach(G=>{x+=`, n.${G}`,X.push(G)});else{if(!this.relationshipTypeNames.has(y))throw new _("knowledge-graph:layer-data-manager",`The graph type of ${y} could not be determined. Was this type set in the KG data model and inclusion definition?`);L=!0,x=`MATCH ()-[n:${y}]->() ${b?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,J.forEach(G=>{x+=`, n.${G}`,X.push(G)})}f=new Le(b?{openCypherQuery:x,bindParameters:{ids:b}}:{openCypherQuery:x});const ee=(await Ue(this.knowledgeGraph,f)).resultRowsStream.getReader();for(;;){const{done:G,value:U}=await ee.read();if(G)break;const z=[];for(let v=0;vnew Set).add(ie.id),Rt(this.nodeConnectionsLookup,ie.destinationId,()=>new Set).add(ie.id));A{var T,A;j==null||j.set(v.attributes[D],v),n&&!((T=this.inclusionModeDefinition)!=null&&T.namedTypeDefinitions.get(y).members.has(v.attributes[D]))&&((A=this.inclusionModeDefinition)==null||A.namedTypeDefinitions.get(y).members.set(v.attributes[D],{id:v.attributes[D]}),this.memberIdTypeLookup.set(v.attributes[D],y))})}})().then(()=>{Q(null)})});o.push(I),(w=this._processingCacheUpdatesLookup.get(y))==null||w.push(I)}await Promise.all(o)}removeFromLayer(t){var n;const r=new Set,i=new Set(t.map(a=>a.id));for(const a of t)r.add(a.typeName),this.memberIdTypeLookup.delete(a.id),(n=this.inclusionModeDefinition)==null||n.namedTypeDefinitions.forEach(o=>{var s;(s=o.members)!=null&&s.has(a.id)&&o.members.delete(a.id)});r.forEach(a=>{var o;(o=this.sublayerCaches.get(a))==null||o.forEach((s,d)=>{var u;i.has(d)&&((u=this.sublayerCaches.get(a))==null||u.delete(d))})})}async retrieveDataFromService(t,r,i){var w,y,b,I,Q,k,J,X,f,x,L,ee,K,M,S,B,Me;const n=Ke.getInstance(),a=new Set,o=[];let s,d="",u=[];const c=r.graphType==="relationship",m=(b=(y=(w=this.inclusionModeDefinition)==null?void 0:w.namedTypeDefinitions)==null?void 0:y.get(r.objectType.name))==null?void 0:b.useAllData,g=r.parentCompositeLayer.sublayerIdsCache.get(r.objectType.name);let h=!m&&g?Array.from(g).sort():null;if((k=(Q=(I=this.inclusionModeDefinition)==null?void 0:I.namedTypeDefinitions)==null?void 0:Q.get(r.objectType.name))!=null&&k.useAllData)(f=(X=(J=this.inclusionModeDefinition)==null?void 0:J.namedTypeDefinitions)==null?void 0:X.get(r.objectType.name))!=null&&f.useAllData&&t.objectIds!=null&&(h=t.objectIds);else if(t.objectIds!=null&&h&&h.length>0){const N=t.objectIds;t.objectIds=h.filter(C=>N.includes(C))}else if(t.objectIds!=null)h=t.objectIds;else{if((x=this.inclusionModeDefinition)!=null&&x.namedTypeDefinitions.has(r.objectType.name)&&(!((L=this.inclusionModeDefinition.namedTypeDefinitions.get(r.objectType.name))!=null&&L.members)||((K=(ee=this.inclusionModeDefinition.namedTypeDefinitions.get(r.objectType.name))==null?void 0:ee.members)==null?void 0:K.size)<1))return t.objectIds=[],[];t.objectIds=h}if(t.outFields!=null){const N=t.outFields;N.includes("*")?r.fields.forEach(C=>{a.add(C.name)}):N.forEach(C=>{C!==D&&C!==r.geometryFieldName&&a.add(C)})}if(t.geometry!=null){const N=t.geometry;let C;const G=r.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,U=G==null?void 0:G.spatialReference,z=(M=G==null?void 0:G.serviceCapabilities)==null?void 0:M.geometryCapabilities;let F=z==null?void 0:z.geometryMaxBoundingRectangleSizeX,j=z==null?void 0:z.geometryMaxBoundingRectangleSizeY;if((S=N==null?void 0:N.extent)!=null&&S.spatialReference&&!((B=N.spatialReference)!=null&&B.isWGS84)?(await Kt(N.extent.spatialReference,De),C=st(N.extent,De)):C=N.extent,F&&j&&U){if(U.wkid!==4326){const v=new Re({spatialReference:U,xmax:F,ymax:j}),T=st(v,De);F=T.xmax,j=T.ymax}if(C.xmax-C.xmin>F)throw new _("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${F}° latitude, limit exceeded`);if(C.ymax-C.ymin>j)throw new _("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${j}° longitude, limit exceeded`)}if(t.where!=null&&t.where!=="1=1"){const v=await Gt(t.where.toUpperCase(),r.fieldsIndex);r.fields.forEach(T=>{v.fieldNames.includes(T.name)&&a.add(T.name)})}d=c?`Match ()-[n:${r.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${r.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${r.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${r.geometryFieldName}) return ID(n)`,r.geometryFieldName&&a.add(r.geometryFieldName),a.forEach(v=>{d+=`, n.${v}`,o.push(v)}),s=new Le({openCypherQuery:d,bindParameters:{param_filter_geom:new Se({rings:bi(C)})}})}else{let N="";if(t.where!=null&&t.where!=="1=1"){const U=await Gt(t.where,r.fieldsIndex);r.fields.forEach(T=>{U.fieldNames.includes(T.name)&&a.add(T.name)});const z=new Set(["column-reference","string","number","binary-expression"]),F=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let j=!1;const v=T=>{if(T.type==="column-reference")return`n.${T.column}`;if(T.type==="string")return`'${T.value}'`;if(T.type==="number")return`${T.value}`;if(T.type==="binary-expression"&&z.has(T.left.type)&&z.has(T.right.type)&&F.has(T.operator))return`${v(T.left)} ${T.operator} ${v(T.right)}`;if(T.type==="binary-expression"&&T.operator==="LIKE"){let A="";if(T.left.type==="function"&&T.left.args.value[0].type==="column-reference")A+=`lower(n.${T.left.args.value[0].column})`;else{if(T.left.type!=="column-reference")return j=!0,"";A+=`lower(n.${T.left.column})`}if(A+=" CONTAINS (",T.right.type!=="string")return j=!0,"";{let W=T.right.value;W.charAt(0)==="%"&&(W=W.slice(1)),W.charAt(W.length-1)==="%"&&(W=W.slice(0,-1)),A+=`'${W.toLowerCase()}')`}return A}return j=!0,""};N=v(U.parseTree),j&&(N="")}let C="";C=c?`Match ()-[n:${r.objectType.name}]->()`:`Match (n:${r.objectType.name})`;let G=!1;h&&(G=!0,C+=" WHERE ID(n) IN $ids"),N&&(C+=G?" AND":" WHERE",C+=` ${N}`),C+=" return ID(n)",c&&(C+=", id(startNode(n)), id(endNode(n))"),t.returnGeometry&&r.geometryFieldName&&a.add(r.geometryFieldName),a.forEach(U=>{C+=`, n.${U}`,o.push(U)}),s=new Le(h?{openCypherQuery:C,bindParameters:{ids:h}}:{openCypherQuery:C})}const E=(await Ue(r.parentCompositeLayer.dataManager.knowledgeGraph,s,i)).resultRowsStream.getReader();for(;;){const{done:N,value:C}=await E.read();if(N)break;const G=[];for(let U=0;U{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return l([p(Ut.fields)],t.prototype,"fields",void 0),l([p(Ut.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=l([R("esri.layers.knowledgeGraphLayer.KnowledgeGraphSublayerBase")],t),t};let $=class extends Dr(Ei(Zt(Xt(br(er))))){constructor(e){var t,r,i,n,a;if(super(e),this.capabilities=vr(!1,!1),this.definitionExpression="",this.displayField="",this.elevationInfo=null,this.geometryType=null,this.geometryFieldName=null,this.graphType=null,this.hasM=!1,this.hasZ=!1,this.labelsVisible=null,this.labelingInfo=null,this.objectIdField=D,this.objectType=null,this.parentCompositeLayer=null,this.popupTemplate=null,this.source={openPorts:()=>this.load().then(()=>{const o=new MessageChannel;return new Tr(o.port1,{channel:o,client:{queryFeatures:(s,d={})=>{const u=ge.fromJSON(s);return this.queryFeaturesJSON(u,d)}}}),[o.port2]})},this.type="knowledge-graph-sublayer",e.parentCompositeLayer.type==="link-chart")e.graphType==="relationship"?this.geometryType="polyline":this.geometryType="point",this.geometryFieldName=O;else if((t=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))!=null&&t.geometryType&&((r=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name))==null?void 0:r.geometryType)!=="esriGeometryNull"){const o=e.parentCompositeLayer.dataManager.geographicLookup.get(e.objectType.name);this.geometryFieldName=(o==null?void 0:o.name)??null,this.geometryType=o!=null&&o.geometryType?me.fromJSON(o.geometryType):null;const s=o==null?void 0:o.name,d=s?(i=e.objectType.properties)==null?void 0:i[s]:null;d?(this.hasM=d.hasM??!1,this.hasZ=d.hasZ??!1):(this.hasM=!1,this.hasZ=!1)}else this.geometryType=null;(n=e.objectType.properties)==null||n.forEach(o=>{let s=null,d=o.fieldType;d==="esriFieldTypeOID"&&(d="esriFieldTypeInteger"),this.fields.push(St.fromJSON({name:o.name,type:d,alias:o.alias,defaultValue:s,editable:o.editable,nullable:o.nullable}))}),this.fields.push(St.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1})),this._set("fields",[...this.fields]),(a=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel)!=null&&a.spatialReference&&(this.spatialReference=e.parentCompositeLayer.dataManager.knowledgeGraph.dataModel.spatialReference),e.parentCompositeLayer.type==="link-chart"?e.graphType==="relationship"?this.renderer=We(Ve(me.toJSON("polyline")).renderer):this.renderer=We(Ve(me.toJSON("point")).renderer):this.renderer=We(Ve(me.toJSON(this.geometryType)).renderer)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Er(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return kr(this,e)}createQuery(){return new ge({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{a.sourceLayer=this}),n}async queryFeaturesJSON(e,t){const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t==null?void 0:t.signal)}async queryFeatureCount(e,t){const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t==null?void 0:t.signal)}async queryExtent(e={},t){var s,d,u,c;const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:n}=await this._setupQueryObjects(r),a=await n.executeQueryForExtent(i.toJSON(),t==null?void 0:t.signal);let o;return o=((s=a.extent)==null?void 0:s.xmin)!=null&&((d=a.extent)==null?void 0:d.xmax)!=null&&((u=a.extent)==null?void 0:u.ymin)!=null&&((c=a.extent)==null?void 0:c.ymax)!=null?new Re(a.extent):new Re,{count:a.count,extent:o}}async queryObjectIds(e,t){const r=ge.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const n=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(n)}return i.executeQueryForIds(r.toJSON(),t==null?void 0:t.signal)}loadQueryEngine(e){const t=new Ir({geometryType:me.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new Lr({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:me.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:null,featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new ge({where:"1=1",outFields:[D]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}async _setupQueryObjects(e,t){var a;const r=ge.from(e),i=r.geometry;let n;if(i&&!((a=i.spatialReference)!=null&&a.isWGS84)&&(await Kt(i.spatialReference,De),r.geometry=st(i instanceof Se||i instanceof ye?i:i.extent,De)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)n=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);n=this.loadQueryEngine(o)}return{resolvedQuery:r,queryEngine:n}}};l([p()],$.prototype,"capabilities",void 0),l([p({readOnly:!0})],$.prototype,"defaultPopupTemplate",null),l([p()],$.prototype,"definitionExpression",void 0),l([p()],$.prototype,"displayField",void 0),l([p()],$.prototype,"elevationInfo",void 0),l([p()],$.prototype,"geometryType",void 0),l([p()],$.prototype,"geometryFieldName",void 0),l([p()],$.prototype,"graphType",void 0),l([p()],$.prototype,"hasM",void 0),l([p()],$.prototype,"hasZ",void 0),l([p()],$.prototype,"labelsVisible",void 0),l([p()],$.prototype,"labelingInfo",void 0),l([p()],$.prototype,"objectIdField",void 0),l([p()],$.prototype,"objectType",void 0),l([p()],$.prototype,"parentCompositeLayer",void 0),l([p({type:Mr,json:{name:"popupInfo",write:!0}})],$.prototype,"popupTemplate",void 0),l([p({types:xr,json:{write:{target:"layerDefinition.drawingInfo.renderer"}}})],$.prototype,"renderer",null),l([p()],$.prototype,"source",void 0),l([p({json:{read:!1}})],$.prototype,"type",void 0),$=l([R("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],$);const it=$;let nt,H=null;function ki(){return nt||(nt=at(()=>import("./lclayout-osE6VX-O.js"),__vite__mapDeps([4,1,2])).then(e=>e.l).then(({default:e})=>e({locateFile:t=>ot(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Mi(e)}),nt)}function Mi(e){H=e}var re;function fe(e,t,r,i,n,a){const o=r.length,s=n.length,d=Float64Array.BYTES_PER_ELEMENT,u=Uint32Array.BYTES_PER_ELEMENT,c=Uint8Array.BYTES_PER_ELEMENT,m=16,g=m-1+o*(c+2*d)+s*(2*u),h=H._malloc(g);try{const E=h+m-h%m,w=E+o*d,y=w+o*d,b=y+s*u,I=b+s*u,Q=()=>[H.HEAPF64.subarray(E>>3,(E>>3)+o),H.HEAPF64.subarray(w>>3,(w>>3)+o),H.HEAPU32.subarray(y>>2,(y>>2)+s),H.HEAPU32.subarray(b>>2,(b>>2)+s),H.HEAPU8.subarray(I,I+o)],[k,J,X,f,x]=Q();k.set(r),J.set(i),X.set(n),f.set(a),x.set(t);const L=e(o,I,E,w,s,y,b),[ee,K,M,S,B]=Q();return r.set(ee),i.set(K),n.set(M),a.set(S),t.set(B),L}finally{H._free(h)}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot"})(re||(re={}));const qt=2,Yt=1,Bt=-1;var mt,ft,gt,wt,_t,bt,Ht,Jt;(function(e){function t(){return H.getMinIdealEdgeLength()}function r(i,n,a,o,s,d=qt,u=Yt,c=Bt){return fe((m,g,h,E,w,y,b)=>H.applyForceDirectedLayout(m,g,h,E,w,y,b,d,u,c),i,n,a,o,s)}e.getMinIdealEdgeLength=t,e.apply=r})(mt||(mt={})),function(e){function t(r,i,n,a,o,s=qt,d=Yt,u=Bt){return fe((c,m,g,h,E,w,y)=>H.applyCommunityLayout(c,m,g,h,E,w,y,s,d,u),r,i,n,a,o)}e.apply=t}(ft||(ft={})),function(e){function t(r,i,n,a,o){return fe(H.applySimpleLayout,r,i,n,a,o)}e.apply=t}(gt||(gt={})),function(e){function t(r,i,n,a,o){return fe(H.applyHierarchicalLayout,r,i,n,a,o)}e.apply=t}(wt||(wt={})),function(e){function t(r,i,n,a,o){return fe(H.applyRadialTreeLayout,r,i,n,a,o)}e.apply=t}(_t||(_t={})),function(e){function t(r,i,n,a,o){return fe(H.applySmartTreeLayout,r,i,n,a,o)}e.apply=t}(bt||(bt={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ht||(Ht={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Jt||(Jt={}));const xi=(e,t,r)=>(e.has(t)||e.set(t,r()),e.get(t));let Y=class extends Zt(Xt(er)){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE",xScaleFactor:1,yScaleFactor:1},this._graphTypeLookup=new Map,this.knowledgeGraph=null,this.layers=new Nt,this.linkChartDiagramLookup=new Map,this.linkChartExtent=new Re({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.linkChartGeohashLookup=new Map,this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.sublayerIdsCache=new Map,this.tables=new Nt,this.type="link-chart",this._originalInclusionList=e.inclusionModeDefinition,e.dataPreloadedInLocalCache&&!e.inclusionModeDefinition)throw new _("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it")}normalizeCtorArgs(e){return{url:e.url,title:e.title,dataPreloadedInLocalCache:e.dataPreloadedInLocalCache,defaultLinkChartConfig:e.defaultLinkChartConfig}}_initializeLayerProperties(e){var a,o,s,d,u,c;if(!this.title&&this.url){const m=this.url.split("/");this.title=m[m.length-2]}const t=new Set;let r=[],i=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new _("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");(a=e.knowledgeGraph.dataModel.entityTypes)==null||a.forEach(m=>{m.name&&this._graphTypeLookup.set(m.name,m)}),(o=e.knowledgeGraph.dataModel.relationshipTypes)==null||o.forEach(m=>{m.name&&this._graphTypeLookup.set(m.name,m)}),(s=e.inclusionModeDefinition)!=null&&s.generateAllSublayers?(r=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]):(d=e.inclusionModeDefinition)!=null&&d.namedTypeDefinitions&&((u=e.inclusionModeDefinition)==null?void 0:u.namedTypeDefinitions.size)>0?(c=e.inclusionModeDefinition)==null||c.namedTypeDefinitions.forEach((m,g)=>{var h,E;if(!this._graphTypeLookup.get(g))return Ee.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't in the data model and will be removed`),void((h=e.inclusionModeDefinition)==null?void 0:h.namedTypeDefinitions.delete(g));this._graphTypeLookup.get(g)instanceof kt||"strictOrigin"in this._graphTypeLookup.get(g)?t.has(g)||(t.add(g),i.push(this._graphTypeLookup.get(g))):this._graphTypeLookup.get(g)instanceof Et||"properties"in this._graphTypeLookup.get(g)?t.has(g)||(t.add(g),r.push(this._graphTypeLookup.get(g))):(Ee.getLogger(this).warn(`A named type, ${g}, was in the inclusion list that wasn't properly modeled and will be removed`),(E=e.inclusionModeDefinition)==null||E.namedTypeDefinitions.delete(g))}):(r=e.knowledgeGraph.dataModel.entityTypes??[],i=e.knowledgeGraph.dataModel.relationshipTypes??[]);const n=new te({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=r,this.memberRelationshipTypes=i,this.dataManager=n}load(e){return this.addResolvingPromise(new Promise(t=>{hi(this.url).then(r=>{var i,n,a,o,s,d;if(this._initializeLayerProperties({knowledgeGraph:r,inclusionModeDefinition:this._originalInclusionList}),(n=(i=this.dataManager.inclusionModeDefinition)==null?void 0:i.namedTypeDefinitions)!=null&&n.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},(a=this.dataManager.knowledgeGraph.dataModel.entityTypes)==null||a.forEach(u=>{var c;u.name&&((c=this.dataManager.inclusionModeDefinition)==null||c.namedTypeDefinitions.set(u.name,{useAllData:!0}))}),(o=this.dataManager.knowledgeGraph.dataModel.relationshipTypes)==null||o.forEach(u=>{var c;u.name&&((c=this.dataManager.inclusionModeDefinition)==null||c.namedTypeDefinitions.set(u.name,{useAllData:!0}))})),this.dataPreloadedInLocalCache)this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),(s=this.dataManager.inclusionModeDefinition)==null||s.namedTypeDefinitions.forEach(u=>{var c;u.useAllData=!1,(c=u.members)==null||c.forEach(m=>{let g;g=m.linkChartLocation instanceof $t?m.linkChartLocation:m.linkChartLocation?le(m.linkChartLocation):null,this.linkChartDiagramLookup.set(m.id,g),g&&g.coords.length===2&&g.lengths.length===0?this.linkChartGeohashLookup.set(m.id,ue(g.coords[1],g.coords[0],ce)):this.linkChartGeohashLookup.set(m.id,"")}),this.addResolvingPromise(this._initializeDiagram().then(async()=>{this.layers.forEach(async m=>{await m.refreshCachedQueryEngine()}),this.tables.forEach(async m=>{await m.refreshCachedQueryEngine()})}))});else{const u=((d=this.defaultLinkChartConfig)==null?void 0:d.layoutMode)==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,u,!0).then(async()=>{Cr(e);const c=[],m=[];this.loadLayerAssumingLocalCache(),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1,this.dataManager.inclusionModeDefinition.namedTypeDefinitions.forEach(g=>{g.useAllData=!1})),await this._initializeDiagram(),this.layers.forEach(g=>{m.push(g.refreshCachedQueryEngine()),c.push(new Promise(h=>{g.on("layerview-create",()=>{h(null)})}))}),this.tables.forEach(g=>{m.push(g.refreshCachedQueryEngine())}),await Promise.all(m)}))}t(null)})})),Promise.resolve(this)}async addRecords(e,t){let r=[];t!=null&&t.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(r=await Ti(e,this.dataManager.knowledgeGraph));const i=e.concat(r).filter(n=>{var a;return!((a=this.sublayerIdsCache.get(n.typeName))!=null&&a.has(n.id))});await this._handleNewRecords(i)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:r=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){var a,o,s,d,u,c,m,g;let i=[];for(const h of e)((s=(o=(a=this.dataManager.inclusionModeDefinition)==null?void 0:a.namedTypeDefinitions)==null?void 0:o.get(h.typeName))==null?void 0:s.useAllData)===!1&&((m=(c=(u=(d=this.dataManager.inclusionModeDefinition)==null?void 0:d.namedTypeDefinitions)==null?void 0:u.get(h.typeName))==null?void 0:c.members)!=null&&m.has(h.id))&&i.push(h);if(t){const h=new Set,E=[];for(const w of i)if(this.dataManager.nodeConnectionsLookup.has(w.id))for(const y of this.dataManager.nodeConnectionsLookup.get(w.id))h.add(y);for(const w of h)this.dataManager.memberIdTypeLookup.has(w)&&E.push({id:w,typeName:this.dataManager.memberIdTypeLookup.get(w)});i=i.concat(E)}this.dataManager.removeFromLayer(i);for(const h of i)(g=this.sublayerIdsCache.get(h.typeName))==null||g.delete(h.id),this.linkChartDiagramLookup.delete(h.id);r&&await this.calculateLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor});const n=[];return this.layers.forEach(h=>{n.push(h.refreshCachedQueryEngine())}),await Promise.all(n),this._refreshNamedTypes(),i}async expand(e){const t=await this.dataManager.getConnectedRecordIds(e),r=t.filter(i=>{var n;return!((n=this.sublayerIdsCache.get(i.typeName))!=null&&n.has(i.id))});return await this._handleNewRecords(t),{records:r}}loadLayerAssumingLocalCache(){var e,t;this.memberRelationshipTypes.forEach(r=>{const i=new it({objectType:r,parentCompositeLayer:this,graphType:"relationship",title:r.name});i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.has(r.name)||this.dataManager.sublayerCaches.set(r.name,new Map)}),this.memberEntityTypes.forEach(r=>{const i=new it({objectType:r,parentCompositeLayer:this,graphType:"entity",title:r.name});i.geometryType?this.layers.push(i):this.tables.push(i),this.dataManager.sublayerCaches.has(r.name)||this.dataManager.sublayerCaches.set(r.name,new Map)}),(e=this.dataManager.inclusionModeDefinition)!=null&&e.namedTypeDefinitions&&((t=this.dataManager.inclusionModeDefinition)==null||t.namedTypeDefinitions.forEach((r,i)=>{var a;const n=xi(this.sublayerIdsCache,i,()=>new Set);(a=r.members)==null||a.forEach(o=>{if(n.add(o.id),o.linkChartLocation)if(o.linkChartLocation instanceof $t)this.linkChartDiagramLookup.set(o.id,o.linkChartLocation),o.linkChartLocation.coords.length===2&&o.linkChartLocation.lengths.length===0?this.linkChartGeohashLookup.set(o.id,ue(o.linkChartLocation.coords[1],o.linkChartLocation.coords[0],ce)):this.linkChartGeohashLookup.set(o.id,"");else{const s=le(o.linkChartLocation);this.linkChartDiagramLookup.set(o.id,o.linkChartLocation?s:null),"x"in o.linkChartLocation&&"y"in o.linkChartLocation?this.linkChartGeohashLookup.set(o.id,ue(o.linkChartLocation.x,o.linkChartLocation.y,ce)):this.linkChartGeohashLookup.set(o.id,"")}})}))}async calculateLinkChartLayout(e="RADIAL_TREE",t){const r=[],i=[];this.dataManager.sublayerCaches.forEach((f,x)=>{this.dataManager.entityTypeNames.has(x)?f.forEach(L=>{r.push({typeName:x,feature:L})}):this.dataManager.relationshipTypeNames.has(x)&&f.forEach(L=>{i.push({typeName:x,feature:L})})}),this.linkChartDiagramLookup=new Map;const n=new Map,a=new Map,o=new Map,s=new Map,d=new Uint8Array(r.length),u=new Float64Array(r.length),c=new Float64Array(r.length),m=new Uint32Array(i.length),g=new Uint32Array(i.length),h=[],E="FORCE_DIRECTED",w=(t==null?void 0:t.xScaleFactor)??1,y=(t==null?void 0:t.yScaleFactor)??1,b=new Re({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let I,Q="FORCE_DIRECTED",k=0,J=0;switch(Q=e==="GEOGRAPHIC"?E:e,Q){case"FORCE_DIRECTED":I=mt.apply;break;case"COMMUNITY":I=ft.apply;break;case"HIERARCHICAL":I=wt.apply;break;case"RADIAL_TREE":I=_t.apply;break;case"SMART_TREE":I=bt.apply;break;default:I=gt.apply}r.forEach(({typeName:f,feature:x})=>{var L,ee,K;if((L=t==null?void 0:t.lockedNodeLocations)!=null&&L.has(x.attributes[D])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(f)?d[k]=re.IsGeographic:d[k]=re.None;const M=t.lockedNodeLocations.get(x.attributes[D]);u[k]=M.x,c[k]=M.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(f)){d[k]=re.IsGeographic;let M=null;const S=x.attributes[this.dataManager.geographicLookup.get(f).name];switch((ee=this.dataManager.geographicLookup.get(f))==null?void 0:ee.geometryType){case"esriGeometryPoint":u[k]=S==null?void 0:S.x,c[k]=S==null?void 0:S.y;break;case"esriGeometryPolygon":M=S==null?void 0:S.centroid,(M==null?void 0:M.x)!=null&&(M==null?void 0:M.y)!=null?(u[k]=M.x,c[k]=M.y):d[k]=re.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":M=(K=S==null?void 0:S.extent)==null?void 0:K.center,(M==null?void 0:M.x)!=null&&(M==null?void 0:M.y)!=null?(u[k]=M.x,c[k]=M.y):d[k]=re.IsMovable;break;default:d[k]=re.IsMovable}(u[k]==null||c[k]==null||Number.isNaN(u[k])||Number.isNaN(c[k]))&&(d[k]=re.IsMovable,u[k]=0,c[k]=0)}else d[k]=re.IsMovable,u[k]=0,c[k]=0;s.set(x.attributes[D],k),h[k]={feature:x,typeName:f},k++});let X=!1;if(i.forEach(f=>{const x=s.get(f.feature.attributes[Ce]),L=s.get(f.feature.attributes[rt]);x!==void 0&&L!==void 0?(m[J]=x,g[J]=L,J++):(X=!0,this.linkChartDiagramLookup.set(f.feature.attributes[Ce],null),this.linkChartGeohashLookup.set(f.feature.attributes[Ce],null))}),X&&Ee.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null"),await ki(),!I(d,u,c,m,g))throw new _("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let f=0;f84.9999&&(c[f]=84.9999),c[f]<-84.9999&&(c[f]=-84.9999),u[f]>179.9999&&(u[f]=179.9999),u[f]<-179.9999&&(u[f]=-179.9999),h[f].feature.attributes[O]=new Ge(u[f],c[f]),n.has(h[f].typeName)){const L=n.get(h[f].typeName);L==null||L.set(h[f].feature.attributes[D],h[f].feature)}else{const L=new Map;L.set(h[f].feature.attributes[D],h[f].feature),n.set(h[f].typeName,L)}o.set(h[f].feature.attributes[D],h[f].feature);const x=le(h[f].feature.attributes[O]);this.linkChartDiagramLookup.set(h[f].feature.attributes[D],h[f].feature.attributes[O]?x:null),this.linkChartGeohashLookup.set(h[f].feature.attributes[D],ue(h[f].feature.attributes[O].y,h[f].feature.attributes[O].x,ce)),h[f].feature.attributes[O].xb.xmax&&(b.xmax=h[f].feature.attributes[O].x),h[f].feature.attributes[O].yb.ymax&&(b.ymax=h[f].feature.attributes[O].y)}return this.linkChartExtent.xmin=b.xmin,this.linkChartExtent.xmax=b.xmax,this.linkChartExtent.ymin=b.ymin,this.linkChartExtent.ymax=b.ymax,i.forEach(f=>{var M,S;const x=(M=h[s.get(f.feature.attributes[Ce])])==null?void 0:M.feature.attributes[O],L=(S=h[s.get(f.feature.attributes[rt])])==null?void 0:S.feature.attributes[O];if(!x||!L)return;const ee=new ye({paths:[[x.x,x.y],[L.x,L.y]]});if(f.feature.attributes[O]=ee,a.has(f.typeName)){const B=a.get(f.typeName);B==null||B.set(f.feature.attributes[D],f.feature)}else{const B=new Map;B.set(f.feature.attributes[D],f.feature),a.set(f.typeName,B)}o.set(f.feature.attributes[D],f.feature);const K=le(f.feature.attributes[O]);this.linkChartDiagramLookup.set(f.feature.attributes[D],f.feature.attributes[O]?K:null),this.linkChartGeohashLookup.set(f.feature.attributes[D],"")}),this._currentLinkChartConfig={layoutMode:e,xScaleFactor:w,yScaleFactor:y},{nodes:n,links:a,idMap:o}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const r=[];await this.calculateLinkChartLayout(e,t),this.layers.forEach(i=>{r.push(i.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes()}getCurrentNodeLocations(){var t,r;const e=new Map;return(r=(t=this.dataManager.inclusionModeDefinition)==null?void 0:t.namedTypeDefinitions)==null||r.forEach(i=>{var n;(n=i==null?void 0:i.members)==null||n.forEach(a=>{const o=a.linkChartLocation;let s;const d=a.id;o&&(s="x"in o?{x:o.x,y:o.y}:{x:o.coords[0],y:o.coords[1]},e.set(d,new Ge({x:s.x,y:s.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{var t;(t=this.dataManager.inclusionModeDefinition)==null||t.namedTypeDefinitions.forEach((r,i)=>{if(r.useAllData=!1,r.members&&r.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const n=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(r.members.keys()).filter(a=>!n.has(a)).forEach(a=>{var o;(o=r.members)==null||o.delete(a)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(r=>{t.push(r.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const r of e)this.sublayerIdsCache.has(r.typeName)||(this.sublayerIdsCache.set(r.typeName,new Set),t.push(r.typeName)),this.sublayerIdsCache.get(r.typeName).add(r.id);for(const r of t)if(this._graphTypeLookup.has(r)){const i=this._graphTypeLookup.get(r),n="endPoints"in i?"relationship":"entity",a=new it({objectType:i,parentCompositeLayer:this,graphType:n,title:r});n==="entity"?this.dataManager.entityTypeNames.add(r):this.dataManager.relationshipTypeNames.add(r),a.geometryType?this.layers.push(a):this.tables.push(a),this.dataManager.sublayerCaches.set(r,new Map)}await this.dataManager.refreshCacheContent(e.map(r=>r.id)),await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,{xScaleFactor:this._currentLinkChartConfig.xScaleFactor,yScaleFactor:this._currentLinkChartConfig.xScaleFactor})}async _initializeDiagram(){var e,t;this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?((t=(e=this.dataManager.inclusionModeDefinition)==null?void 0:e.namedTypeDefinitions)==null||t.forEach(r=>{var i;(i=r==null?void 0:r.members)==null||i.forEach(n=>{const a=n.linkChartLocation;let o;const s=n.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=le(o);this.linkChartDiagramLookup.set(s,d),this.linkChartGeohashLookup.set(s,ue(o.x,o.y,ce)),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{var i;r.name&&((i=this.dataManager.sublayerCaches.get(r.name))==null||i.forEach(n=>{const a=this.linkChartDiagramLookup.get(n.attributes[Ce]),o=this.linkChartDiagramLookup.get(n.attributes[rt]);if(a&&o){const s=le(new ye({paths:[[a.coords[0],a.coords[1]],[o.coords[0],o.coords[1]]]}));this.linkChartDiagramLookup.set(n.attributes[D],s)}else this.linkChartDiagramLookup.set(n.attributes[D],null);this.linkChartGeohashLookup.set(n.attributes[D],"")}))})):await this.calculateLinkChartLayout(this.defaultLinkChartConfig.layoutMode,{xScaleFactor:this.defaultLinkChartConfig.xScaleFactor,yScaleFactor:this.defaultLinkChartConfig.yScaleFactor,lockedNodeLocations:this.getCurrentNodeLocations()}):await this.calculateLinkChartLayout("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}};l([p()],Y.prototype,"dataPreloadedInLocalCache",void 0),l([p()],Y.prototype,"defaultLinkChartConfig",void 0),l([p()],Y.prototype,"dataManager",void 0),l([p()],Y.prototype,"knowledgeGraph",void 0),l([p()],Y.prototype,"layers",void 0),l([p()],Y.prototype,"linkChartDiagramLookup",void 0),l([p()],Y.prototype,"linkChartExtent",void 0),l([p()],Y.prototype,"linkChartGeohashLookup",void 0),l([p()],Y.prototype,"memberEntityTypes",void 0),l([p()],Y.prototype,"memberRelationshipTypes",void 0),l([p()],Y.prototype,"sublayerIdsCache",void 0),l([p()],Y.prototype,"tables",void 0),l([p({json:{read:!1}})],Y.prototype,"type",void 0),Y=l([R("esri.layers.LinkChartLayer")],Y);const un=Y;export{un as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/arcgis-knowledge-client-core-simd-wFoqgd0S.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/arcgis-knowledge-client-core-k0_SaRI-.js","assets/lclayout-osE6VX-O.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/MapImageLayer-qMOOMfH7.js b/dist/assets/MapImageLayer-qMOOMfH7.js new file mode 100644 index 0000000..67220e4 --- /dev/null +++ b/dist/assets/MapImageLayer-qMOOMfH7.js @@ -0,0 +1 @@ +import{dK as $,el as w,dO as I,em as T,dM as E,dN as O,dP as M,dL as L,en as P,dQ as R,eo as v,ep as g,eq as b,er as F,es as j,et as N,eu as q,bW as f,dT as J,ev as U,ew as A,E as x,f as _,e as i,y as n,ex as S,dt as k,du as V,dW as W,c as z,ey as K,c7 as Z}from"./index-J0iiHjMT.js";import{E as B,f as C,X as D}from"./SublayersOwner-8xrm3MkT.js";import{o as G}from"./CustomParametersMixin-Y1bOcayO.js";import{e as H}from"./versionUtils-4v9zIDlv.js";import"./QueryTask-91TvtrTt.js";import"./executeForIds-wXO8-pll.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./executeQueryJSON-ACj9qY0y.js";import"./FeatureSet-d4S1oKME.js";import"./executeQueryPBF-vdaOUMid.js";import"./FeatureType-MpRe7WJj.js";import"./FeatureTemplate-kUgbbA00.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";let s=class extends $(w(I(B(C(T(E(O(M(L(P(G(Z)))))))))))){constructor(...e){super(...e),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,a){return typeof e=="string"?{url:e,...a}:e}load(e){const a=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(R).then(()=>this._fetchService(a))),Promise.resolve(this)}readImageFormat(e,a){const l=a.supportedImageFormatTypes;return l&&l.includes("PNG32")?"png32":"png24"}writeSublayers(e,a,l,t){var h;if(!this.loaded||!e)return;const o=e.slice().reverse().flatten(({sublayers:r})=>r&&r.toArray().reverse()).toArray();let p=!1;if(this.capabilities&&this.capabilities.operations.supportsExportMap&&((h=this.capabilities.exportMap)!=null&&h.supportsDynamicLayers)){const r=v(t.origin);if(r===g.PORTAL_ITEM){const d=this.createSublayersForOrigin("service").sublayers;p=b(o,d,g.SERVICE)}else if(r>g.PORTAL_ITEM){const d=this.createSublayersForOrigin("portal-item");p=b(o,d.sublayers,v(d.origin))}}const m=[],y={writeSublayerStructure:p,...t};let c=p;o.forEach(r=>{const d=r.write({},y);m.push(d),c=c||r.originOf("visible")==="user"}),m.some(r=>Object.keys(r).length>1)&&(a.layers=m),c&&(a.visibleLayers=o.filter(r=>r.visible).map(r=>r.id))}createExportImageParameters(e,a,l,t){const o=(t==null?void 0:t.pixelRatio)||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const p=new F({layer:this,floors:t==null?void 0:t.floors,scale:j({extent:e,width:a})*o}),m=p.toJSON();p.destroy();const y=!(t!=null&&t.rotation)||this.version<10.3?{}:{rotation:-t.rotation},c=e==null?void 0:e.spatialReference,h=N(c);m.dpi*=o;const r={};if(t!=null&&t.timeExtent){const{start:d,end:u}=t.timeExtent.toJSON();r.time=d&&u&&d===u?""+d:`${d??"null"},${u??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(r.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:h,imageSR:h,size:a+","+l,...m,...y,...r}}async fetchImage(e,a,l,t){const{data:o}=await this._fetchImage("image",e,a,l,t);return o}async fetchImageBitmap(e,a,l,t){const{data:o,url:p}=await this._fetchImage("blob",e,a,l,t);return q(o,p,t==null?void 0:t.signal)}async fetchRecomputedExtents(e={}){const a={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:l}=await f(this.url,a),{extent:t,fullExtent:o,timeExtent:p}=l,m=t||o;return{fullExtent:m&&J.fromJSON(m),timeExtent:p&&U.fromJSON({start:p[0],end:p[1]})}}loadAll(){return A(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return H(this,e)}async _fetchImage(e,a,l,t,o){var y,c,h;const p={responseType:e,signal:(o==null?void 0:o.signal)??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(a,l,t,o),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},m=this.parsedUrl.path+"/export";if(((y=p.query)==null?void 0:y.dynamicLayers)!=null&&!((h=(c=this.capabilities)==null?void 0:c.exportMap)!=null&&h.supportsDynamicLayers))throw new x("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:p.query});try{const{data:r}=await f(m,p);return{data:r,url:m}}catch(r){throw _(r)?r:new x("mapimagelayer:image-fetch-error",`Unable to load image: ${m}`,{error:r})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:a,ssl:l}=await f(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});l&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=a,this.read(a,{origin:"service",url:this.parsedUrl})}};i([n(S("dateFieldsTimeReference"))],s.prototype,"dateFieldsTimeZone",void 0),i([n({type:Boolean})],s.prototype,"datesInUnknownTimezone",void 0),i([n()],s.prototype,"dpi",void 0),i([n()],s.prototype,"gdbVersion",void 0),i([n()],s.prototype,"imageFormat",void 0),i([k("imageFormat",["supportedImageFormatTypes"])],s.prototype,"readImageFormat",null),i([n({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],s.prototype,"imageMaxHeight",void 0),i([n({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],s.prototype,"imageMaxWidth",void 0),i([n()],s.prototype,"imageTransparency",void 0),i([n({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],s.prototype,"isReference",void 0),i([n({json:{read:!1,write:!1}})],s.prototype,"labelsVisible",void 0),i([n({type:["ArcGISMapServiceLayer"]})],s.prototype,"operationalLayerType",void 0),i([n({json:{read:!1,write:!1}})],s.prototype,"popupEnabled",void 0),i([n(S("preferredTimeReference"))],s.prototype,"preferredTimeZone",void 0),i([n()],s.prototype,"sourceJSON",void 0),i([n({json:{write:{ignoreOrigin:!0}}})],s.prototype,"sublayers",void 0),i([V("sublayers",{layers:{type:[D]},visibleLayers:{type:[K]}})],s.prototype,"writeSublayers",null),i([n({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),i([n({json:{read:!1},readOnly:!0,value:"map-image"})],s.prototype,"type",void 0),i([n(W)],s.prototype,"url",void 0),s=i([z("esri.layers.MapImageLayer")],s);const he=s;export{he as default}; diff --git a/dist/assets/MapImageLayerView3D-GIO-oWiM.js b/dist/assets/MapImageLayerView3D-GIO-oWiM.js new file mode 100644 index 0000000..354d12b --- /dev/null +++ b/dist/assets/MapImageLayerView3D-GIO-oWiM.js @@ -0,0 +1 @@ +import{e as i,y as o,jW as a,c as p,er as m}from"./index-J0iiHjMT.js";import{N as n}from"./DynamicLayerView3D-4lztpXo0.js";import{G as l}from"./MapServiceLayerViewHelper-a8WMaeWS.js";import{r as h}from"./drapedUtils-9db1OpTX.js";import"./LayerView3D-iOx2MD1g.js";import"./projectExtentUtils-TwA6ooHn.js";import"./ImageMaterial.glsl-TdPtjVc_.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";const u=t=>{let e=class extends t{initialize(){this.exportImageParameters=new m({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){var r;return((r=this.view)==null?void 0:r.floors)??null}get exportImageVersion(){var r;return(r=this.exportImageParameters)==null||r.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}canResume(){var r;return!!super.canResume()&&!((r=this.timeExtent)!=null&&r.isEmpty)}};return i([o()],e.prototype,"exportImageParameters",void 0),i([o({readOnly:!0})],e.prototype,"floors",null),i([o({readOnly:!0})],e.prototype,"exportImageVersion",null),i([o()],e.prototype,"layer",void 0),i([o()],e.prototype,"suspended",void 0),i([o(a)],e.prototype,"timeExtent",void 0),e=i([p("esri.views.layers.MapImageLayerView")],e),e};let s=class extends u(n){constructor(){super(...arguments),this.type="map-image-3d"}initialize(){this._updatingHandles.add(()=>this.exportImageVersion,()=>this._updatingHandles.addPromise(this.refreshDebounced())),this._popupHighlightHelper=new l({createFetchPopupFeaturesQueryGeometry:(t,e)=>h(t,e,this.view),layerView:this,updatingHandles:this._updatingHandles})}destroy(){var t;(t=this._popupHighlightHelper)==null||t.destroy()}fetchPopupFeatures(t,e){return this._popupHighlightHelper.fetchPopupFeatures(t,e)}getFetchOptions(){return{timeExtent:this.timeExtent}}};s=i([p("esri.views.3d.layers.MapImageLayerView3D")],s);const v=s;export{v as default}; diff --git a/dist/assets/MapNotesLayer-CdG3vHcH.js b/dist/assets/MapNotesLayer-CdG3vHcH.js new file mode 100644 index 0000000..c8181ce --- /dev/null +++ b/dist/assets/MapNotesLayer-CdG3vHcH.js @@ -0,0 +1 @@ +import{dw as x,e as i,y as s,c as M,bX as G,a8 as B,J as L,c1 as F,dK as k,dO as z,dM as A,dN as W,dP as K,ar as h,V as w,bI as N,ek as I,ez as J,eA as S,eB as $,eC as D,eD as E,S as U,E as q,dD as H,al as Q,ct as V,d$ as X,e0 as Z,e1 as Y,bN as ee,dm as T,dt as f,du as te,dT as re,Q as oe,c7 as ie}from"./index-J0iiHjMT.js";import le from"./FeatureLayer--S4epFk-.js";import{n as ae}from"./objectIdUtils-GktMsX8e.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./queryZScale-IaMm02_2.js";import"./FeatureSet-d4S1oKME.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";import"./TopFeaturesQuery-E6D2tV-x.js";function b(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return v.find(o=>{var l,n,y;return r===o.geometryTypeJSON&&((y=(n=(l=t.drawingInfo)==null?void 0:l.renderer)==null?void 0:n.symbol)==null?void 0:y.type)===o.identifyingSymbol.type})}function _(){return new re({xmin:-180,ymin:-90,xmax:180,ymax:90})}const C=new x({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new x({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let u=class extends oe{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference,e=this.fullBounds;return t?e==null?S(_(),t).geometry:E(e,t):null}get fullBounds(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference;if(!t)return null;const e=I();return this.graphics.forEach(o=>{const l=o.geometry!=null?S(o.geometry,t).geometry:null;l!=null&&J(e,l.type==="point"?l:l.extent,e)}),$(e,D)?null:e}get sublayers(){return this.graphics}};i([s({readOnly:!0})],u.prototype,"fullExtent",null),i([s({readOnly:!0})],u.prototype,"fullBounds",null),i([s({readOnly:!0})],u.prototype,"sublayers",null),i([s()],u.prototype,"layer",void 0),i([s()],u.prototype,"layerId",void 0),i([s({readOnly:!0})],u.prototype,"visibilityMode",void 0),u=i([M("esri.layers.MapNotesLayer.MapNotesSublayer")],u);const v=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new G().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new B().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new L().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new L().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new F().toJSON()}];let a=class extends k(z(A(W(K(ie))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=h.WGS84,this.sublayers=new w(v.map(e=>new u({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!b(e)&&(r==null?void 0:r.origin)!=="portal-item"}}}readFeatureCollections(t,e,r){if(!b(e))return null;const o=e.layers.map(l=>{const n=new le;return n.read(l,r),n});return new w({items:o})}readLegacyfeatureCollectionJSON(t,e){return b(e)?N(e.featureCollection):null}get fullExtent(){var r;const t=this.spatialReference,e=I();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:o})=>o!=null?J(e,o,e):e,e):(r=this.featureCollectionJSON)!=null&&r.layers.some(o=>o.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(o=>{const l=S(o.layerDefinition.extent,t).geometry;l!=null&&J(e,l,e)}),$(e,D)?S(_(),t).geometry:E(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(b(e))return null;const o=[];let l=e.layers.reduce((n,y)=>Math.max(n,y.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:y,featureSet:p}=n,d=y.id??l++,m=R(n);if(m!=null){const c=new u({id:m.id,title:y.name,layerId:d,layer:this,graphics:p.features.map(({geometry:g,symbol:O,attributes:j,popupInfo:P})=>U.fromJSON({attributes:j,geometry:g,symbol:O,popupTemplate:P}))});o.push(c)}}return new w(o)}writeSublayers(t,e,r,o){var m;const{minScale:l,maxScale:n}=this;if(t==null)return;const y=t.some(c=>c.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(y&&((m=o==null?void 0:o.messages)==null?void 0:m.push(new q("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer"))));const p=[];let d=this.spatialReference.toJSON();e:for(const c of t)for(const g of c.graphics)if(g.geometry!=null){d=g.geometry.spatialReference.toJSON();break e}for(const c of v){const g=t.find(O=>c.id===O.id);this._writeMapNoteSublayer(p,g,c,l,n,d,o)}H("featureCollection.layers",p,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=N(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const o of this.sublayers)for(const l of o.graphics)if(l.geometry!=null){const n=l.geometry;t?Q(n.spatialReference,t)||(V(n.spatialReference,t)||X()||await Z(),l.geometry=Y(n,t)):t=n.spatialReference,e.push(l)}const r=await ee(e.map(o=>o.geometry));e.forEach((o,l)=>o.geometry=r[l])}_findSublayer(t){var e;return this.sublayers==null?null:((e=this.sublayers)==null?void 0:e.find(r=>r.id===t))??null}_writeMapNoteSublayer(t,e,r,o,l,n,y){const p=[];if(e!=null){for(const d of e.graphics)this._writeMapNote(p,d,r.geometryType,y);this._normalizeObjectIds(p,C),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:N(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:l,objectIdField:"OBJECTID",fields:[C.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:p,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,o){var d,m;if(e==null)return;const{geometry:l,symbol:n,popupTemplate:y}=e;if(l==null)return;if(l.type!==r)return void((d=o==null?void 0:o.messages)==null?void 0:d.push(new T("map-notes-layer:invalid-geometry-type",`Geometry "${l.type}" cannot be saved in "${r}" layer`,{graphic:e})));if(n==null)return void((m=o==null?void 0:o.messages)==null?void 0:m.push(new T("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e})));const p={attributes:{...e.attributes},geometry:l.toJSON(),symbol:n.toJSON()};y!=null&&(p.popupInfo=y.toJSON()),t.push(p)}_normalizeObjectIds(t,e){const r=e.name;let o=ae(r,t)+1;const l=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:y}=n;(y[r]==null||l.has(y[r]))&&(y[r]=o++),l.add(y[r])}}};i([s({readOnly:!0})],a.prototype,"capabilities",void 0),i([f(["portal-item","web-map"],"capabilities",["layers"])],a.prototype,"readCapabilities",null),i([s({readOnly:!0})],a.prototype,"featureCollections",void 0),i([f(["web-map","portal-item"],"featureCollections",["layers"])],a.prototype,"readFeatureCollections",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],a.prototype,"featureCollectionJSON",void 0),i([f(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],a.prototype,"readLegacyfeatureCollectionJSON",null),i([s({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],a.prototype,"featureCollectionType",void 0),i([s({readOnly:!0})],a.prototype,"fullExtent",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],a.prototype,"legendEnabled",void 0),i([s({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"minScale",void 0),i([f(["web-map","portal-item"],"minScale",["layers"])],a.prototype,"readMinScale",null),i([s({type:Number,nonNullable:!0,json:{write:!1}})],a.prototype,"maxScale",void 0),i([f(["web-map","portal-item"],"maxScale",["layers"])],a.prototype,"readMaxScale",null),i([s({readOnly:!0})],a.prototype,"multipointLayer",null),i([s({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],a.prototype,"operationalLayerType",void 0),i([s({readOnly:!0})],a.prototype,"pointLayer",null),i([s({readOnly:!0})],a.prototype,"polygonLayer",null),i([s({readOnly:!0})],a.prototype,"polylineLayer",null),i([s({type:h})],a.prototype,"spatialReference",void 0),i([f(["web-map","portal-item"],"spatialReference",["layers"])],a.prototype,"readSpatialReference",null),i([s({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],a.prototype,"sublayers",void 0),i([f("web-map","sublayers",["layers"])],a.prototype,"readSublayers",null),i([te("web-map","sublayers")],a.prototype,"writeSublayers",null),i([s({readOnly:!0})],a.prototype,"textLayer",null),i([s()],a.prototype,"title",void 0),i([s({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),a=i([M("esri.layers.MapNotesLayer")],a);const Le=a;export{Le as default}; diff --git a/dist/assets/MapServiceLayerViewHelper-a8WMaeWS.js b/dist/assets/MapServiceLayerViewHelper-a8WMaeWS.js new file mode 100644 index 0000000..56e259e --- /dev/null +++ b/dist/assets/MapServiceLayerViewHelper-a8WMaeWS.js @@ -0,0 +1,7 @@ +import{gb as D,et as Z,es as W,nE as C,nF as G,ji as K,e as l,y,dx as X,dy as Y,dT as H,ar as ee,ev as te,c as I,dr as J,g0 as re,S as V,dt as se,du as ie,j5 as ne,dZ as ae,bN as oe,f$ as le,f_ as ue,bW as pe,p as ye,ah as ce,fl as de,E as T,a2 as N,V as he,e3 as L,J as U,de as fe,ld as me,e2 as ge,dJ as we,nG as be,fI as ve,nH as xe,d6 as $e,fG as Se}from"./index-J0iiHjMT.js";import{o as M}from"./drapedUtils-9db1OpTX.js";function Fe(t,e){const{dpi:s,gdbVersion:i,geometry:r,geometryPrecision:n,height:a,layerOption:o,mapExtent:c,maxAllowableOffset:u,returnFieldName:p,returnGeometry:h,returnUnformattedValues:d,returnZ:F,spatialReference:$,timeExtent:x,tolerance:m,width:j}=t.toJSON(),{dynamicLayers:g,layerDefs:w,layerIds:v}=je(t),R=(e==null?void 0:e.geometry)!=null?e.geometry:null,b={geometryPrecision:n,maxAllowableOffset:u,returnFieldName:p,returnGeometry:h,returnUnformattedValues:d,returnZ:F,tolerance:m},E=R&&R.toJSON()||r;b.imageDisplay=`${j},${a},${s}`,i&&(b.gdbVersion=i),E&&(delete E.spatialReference,b.geometry=JSON.stringify(E),b.geometryType=D(E));const A=$??(E==null?void 0:E.spatialReference)??(c==null?void 0:c.spatialReference);if(A&&(b.sr=Z(A)),b.time=x?[x.start,x.end].join(","):null,c){const{xmin:z,ymin:k,xmax:q,ymax:B}=c;b.mapExtent=`${z},${k},${q},${B}`}return w&&(b.layerDefs=w),g&&!w&&(b.dynamicLayers=g),b.layers=o==="popup"?"visible":o,v&&!g&&(b.layers+=`:${v.join(",")}`),b}function je(t){var $,x;const{mapExtent:e,floors:s,width:i,sublayers:r,layerIds:n,layerOption:a,gdbVersion:o}=t,c=(x=($=r==null?void 0:r.find(m=>m.layer!=null))==null?void 0:$.layer)==null?void 0:x.serviceSublayers,u=a==="popup",p={},h=W({extent:e,width:i,spatialReference:e==null?void 0:e.spatialReference}),d=[],F=m=>{const j=h===0,g=m.minScale===0||h<=m.minScale,w=m.maxScale===0||h>=m.maxScale;if(m.visible&&(j||g&&w))if(m.sublayers)m.sublayers.forEach(F);else{if((n==null?void 0:n.includes(m.id))===!1||u&&(!m.popupTemplate||!m.popupEnabled))return;d.unshift(m)}};if(r==null||r.forEach(F),r&&!d.length)p.layerIds=[];else{const m=C(d,c,o),j=d.map(g=>{const w=G(s,g);return g.toExportImageJSON(w)});if(m)p.dynamicLayers=JSON.stringify(j);else{if(r){let w=d.map(({id:v})=>v);n&&(w=w.filter(v=>n.includes(v))),p.layerIds=w}else n!=null&&n.length&&(p.layerIds=n);const g=Ee(s,d);if(g!=null&&g.length){const w={};for(const v of g)v.definitionExpression&&(w[v.id]=v.definitionExpression);Object.keys(w).length&&(p.layerDefs=JSON.stringify(w))}}}return p}function Ee(t,e){const s=!!(t!=null&&t.length),i=e.filter(r=>r.definitionExpression!=null||s&&r.floorInfo!=null);return i.length?i.map(r=>{const n=G(t,r),a=K(n,r.definitionExpression);return{id:r.id,definitionExpression:a??void 0}}):null}var _;let f=_=class extends J{static from(t){return re(_,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}};l([y({type:Number,json:{write:!0}})],f.prototype,"dpi",void 0),l([y()],f.prototype,"floors",void 0),l([y({type:String,json:{write:!0}})],f.prototype,"gdbVersion",void 0),l([y({types:X,json:{read:Y,write:!0}})],f.prototype,"geometry",void 0),l([y({type:Number,json:{write:!0}})],f.prototype,"geometryPrecision",void 0),l([y({type:Number,json:{write:!0}})],f.prototype,"height",void 0),l([y({type:[Number],json:{write:!0}})],f.prototype,"layerIds",void 0),l([y({type:["top","visible","all","popup"],json:{write:!0}})],f.prototype,"layerOption",void 0),l([y({type:H,json:{write:!0}})],f.prototype,"mapExtent",void 0),l([y({type:Number,json:{write:!0}})],f.prototype,"maxAllowableOffset",void 0),l([y({type:Boolean,json:{write:!0}})],f.prototype,"returnFieldName",void 0),l([y({type:Boolean,json:{write:!0}})],f.prototype,"returnGeometry",void 0),l([y({type:Boolean,json:{write:!0}})],f.prototype,"returnM",void 0),l([y({type:Boolean,json:{write:!0}})],f.prototype,"returnUnformattedValues",void 0),l([y({type:Boolean,json:{write:!0}})],f.prototype,"returnZ",void 0),l([y({type:ee,json:{write:!0}})],f.prototype,"spatialReference",void 0),l([y()],f.prototype,"sublayers",void 0),l([y({type:te,json:{write:!0}})],f.prototype,"timeExtent",void 0),l([y({type:Number,json:{write:!0}})],f.prototype,"tolerance",void 0),l([y({type:Number,json:{write:!0}})],f.prototype,"width",void 0),f=_=l([I("esri.rest.support.IdentifyParameters")],f);const Q=f;let S=class extends J{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return V.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:s,geometry:i}=t;s&&(e.attributes={...s}),i!=null&&(e.geometry=i.toJSON(),e.geometryType=ne.toJSON(i.type))}};l([y({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),l([y({type:V})],S.prototype,"feature",void 0),l([se("feature",["attributes","geometry"])],S.prototype,"readFeature",null),l([ie("feature")],S.prototype,"writeFeature",null),l([y({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),l([y({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=l([I("esri.rest.support.IdentifyResult")],S);const Oe=S;async function Re(t,e,s){const i=(e=Pe(e)).geometry?[e.geometry]:[],r=ae(t);return r.path+="/identify",oe(i).then(n=>{const a=Fe(e,{geometry:n==null?void 0:n[0]}),o=le({...r.query,f:"json",...a}),c=ue(o,s);return pe(r.path,c).then(Ne).then(u=>_e(u,e.sublayers))})}function Ne(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(s=>Oe.fromJSON(s)),e}function Pe(t){return t=Q.from(t)}function _e(t,e){if(!(e!=null&&e.length))return t;const s=new Map;function i(r){s.set(r.id,r),r.sublayers&&r.sublayers.forEach(i)}e.forEach(i);for(const r of t.results)r.feature.sourceLayer=s.get(r.layerId);return t}let P=null;function Ue(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends ye{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=ce(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([de(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeatures(t,e){var a,o;const{layerView:{layer:s,view:{scale:i}}}=this;if(!t)throw new T("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:s});const r=Ge(s.sublayers,i,e);if(!r.length)return[];const n=await Ve(s,r);if(!((((o=(a=s.capabilities)==null?void 0:a.operations)==null?void 0:o.supportsIdentify)??!0)&&s.version>=10.5)&&!n)throw new T("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:s});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){var t;(t=this.highlightGraphics)==null||t.removeAll()}highlight(t){const e=this.highlightGraphics;if(!e)return N();let s=null;if(t instanceof V?s=[t]:he.isCollection(t)&&t.length>0?s=t.toArray():Array.isArray(t)&&t.length>0&&(s=t),s=s==null?void 0:s.filter(L),!(s!=null&&s.length))return N();for(const i of s){const r=i.sourceLayer;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(i.visible=!1)}return e.addMany(s),N(()=>e.removeMany(s??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:s,highlightGraphicUpdated:i}=this;if(s&&i)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async a=>{var u;a||(a=new U);let o=null;const c="visualVariables"in n?(u=n.visualVariables)==null?void 0:u.find(p=>p.type==="size"):void 0;c&&(P||(P=(await fe(()=>import("./index-J0iiHjMT.js").then(p=>p.zA),__vite__mapDeps([0,1]))).getSize),o=P(c,r,{view:e.type,scale:e.scale,shape:a.type==="simple-marker"?a.style:null})),o||(o="width"in a&&"height"in a&&a.width!=null&&a.height!=null?Math.max(a.width,a.height):"size"in a?a.size:16),s.includes(r)&&(r.symbol=new U({style:"square",size:o,xoffset:"xoffset"in a?a.xoffset:0,yoffset:"yoffset"in a?a.yoffset:0}),i(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:s},highlightGraphics:i,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!(i!=null&&i.length)||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),a=new Map;for(const u of i)if(!this._featuresResolutions.has(u)||this._featuresResolutions.get(u)>n){const p=u.sourceLayer;me(a,p,()=>new Map).set(u.getObjectId(),u)}const o=Array.from(a,([u,p])=>{const h=u.createQuery();return h.objectIds=[...p.keys()],h.outFields=[u.objectIdField],h.returnGeometry=!0,h.maxAllowableOffset=n,h.outSpatialReference=s.spatialReference,u.queryFeatures(h)}),c=await Promise.all(o);if(!this.destroyed)for(const{features:u}of c)for(const p of u){const h=p.sourceLayer,d=a.get(h).get(p.getObjectId());d&&i.includes(d)&&(d.geometry=p.geometry,r(d,"geometry"),this._featuresResolutions.set(d,n))}}_getTargetResolution(t){const e=t*ge(this.layerView.view.spatialReference),s=e/16;return s<=10?0:t/e*s}async _fetchPopupFeaturesUsingIdentify(t,e,s){const i=await this._createIdentifyParameters(t,e,s);if(i==null)return[];const{results:r}=await Re(this.layerView.layer.parsedUrl,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,s){const{floors:i,layer:r,timeExtent:n,view:{spatialReference:a,scale:o}}=this.layerView,c=s!=null?s.event:null;if(!e.length)return null;await Promise.all(e.map(({sublayer:$})=>$.load().catch(()=>{})));const u=Math.min(we("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce(($,x)=>x.renderer?M({renderer:x.renderer,event:c}):$,2)),p=this.createFetchPopupFeaturesQueryGeometry(t,u),h=be(o,a),d=Math.round(p.width/h),F=new H({xmin:p.center.x-h*d,ymin:p.center.y-h*d,xmax:p.center.x+h*d,ymax:p.center.y+h*d,spatialReference:p.spatialReference});return new Q({floors:i,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:d,layerOption:"popup",mapExtent:F,returnGeometry:!0,spatialReference:a,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:d})}async _fetchPopupFeaturesUsingQueries(t,e,s){const{layerView:{floors:i,timeExtent:r}}=this,n=s!=null?s.event:null,a=e.map(async({sublayer:o,popupTemplate:c})=>{var v;if(await o.load().catch(()=>{}),o.capabilities&&!o.capabilities.operations.supportsQuery)return[];const u=o.createQuery(),p=M({renderer:o.renderer,event:n}),h=this.createFetchPopupFeaturesQueryGeometry(t,p),d=new Set,[F]=await Promise.all([ve(o,c),(v=o.renderer)==null?void 0:v.collectRequiredFields(d,o.fieldsIndex)]);xe(d,o.fieldsIndex,F);const $=Array.from(d).sort();if(u.geometry=h,u.outFields=$,u.timeExtent=r,i){const R=i.clone(),b=G(R,o);b!=null&&(u.where=u.where?`(${u.where}) AND (${b})`:b)}const x=this._getTargetResolution(h.width/p),m=await Ie(c),j=o.geometryType==="point"||m&&m.arcadeUtils.hasGeometryOperations(c);j||(u.maxAllowableOffset=x);let{features:g}=await o.queryFeatures(u);const w=j?0:x;g=await Ae(o,g);for(const R of g)this._featuresResolutions.set(R,w);return g});return(await Promise.allSettled(a)).reduce((o,c)=>c.status==="fulfilled"?[...o,...c.value]:o,[]).filter(L)}};function Ge(t,e,s){const i=[];if(!t)return i;const r=n=>{const a=n.minScale===0||e<=n.minScale,o=n.maxScale===0||e>=n.maxScale;if(n.visible&&a&&o){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const c=Se(n,{...s,defaultPopupTemplateEnabled:!1});c!=null&&i.unshift({sublayer:n,popupTemplate:c})}}};return t.map(r),i}function Ie(t){var e;return(e=t.expressionInfos)!=null&&e.length||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression")?$e():Promise.resolve()}async function Ve(t,e){var s,i;if((i=(s=t.capabilities)==null?void 0:s.operations)!=null&&i.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:r})=>r.load().then(()=>r.capabilities.operations.supportsQuery)))}catch{return!1}}async function Ae(t,e){const s=t.renderer;return s&&"defaultSymbol"in s&&!s.defaultSymbol&&(e=s.valueExpression?await Promise.all(e.map(i=>s.getSymbolAsync(i).then(r=>r?i:null))).then(i=>i.filter(r=>r!=null)):e.filter(i=>s.getSymbol(i)!=null)),e}l([y({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),l([y({constructOnly:!0})],O.prototype,"layerView",void 0),l([y({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),l([y({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),l([y({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=l([I("esri.views.layers.support.MapService")],O);export{O as G,Ue as S}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/MeasurementWidgetContent-d8uX7Gw_.js b/dist/assets/MeasurementWidgetContent-d8uX7Gw_.js new file mode 100644 index 0000000..236d56a --- /dev/null +++ b/dist/assets/MeasurementWidgetContent-d8uX7Gw_.js @@ -0,0 +1,7 @@ +import{e as s,y as i,c as d,p,Z as h,d as m,A as c,F as v,hl as _,hm as g,de as y,hn as r,ho as w}from"./index-J0iiHjMT.js";let u=class extends p{constructor(e){super(e),this.tool=null,this._loggedUnsupportedErrorOnce=!1,this.logger=h.getLogger(this),(e==null?void 0:e.visible)!=null&&(this.visible=e.visible)}initialize(){this.addHandles(m(()=>({ready:this.view!=null&&this.view.ready,supported:this.supported}),({ready:e,supported:t})=>{!e||t||this._loggedUnsupportedErrorOnce||(this.logError(this.unsupportedErrorMessage),this._loggedUnsupportedErrorOnce=!0)},c))}destroy(){this.removeTool(),this.view=null}get active(){return this.tool!=null&&this.tool.active}get disabled(){return this.view==null||!this.view.ready||!this.supported}get supported(){return this.view==null||this.view.type===this.supportedViewType}get view(){return this._get("view")}set view(e){if(e===this.view)return;this.removeTool(),this._set("view",e);const t="tools";this.removeHandles(t),e!=null&&this.addHandles(e.tools.on("after-remove",a=>{a.item===this.tool&&this._set("tool",null)}),t)}set visible(e){this._set("visible",e),this.tool!=null&&(this.tool.visible=e)}createTool(e={interactive:!1}){if(this.removeTool(),this.view==null||!this.view.ready||!this.supported)return;const t=this.constructTool();t.created?(this._set("tool",t),this.view.tools.add(t)):e.interactive?(this._set("tool",t),this.view.addAndActivateTool(t),v(()=>t.created,()=>{t.active&&this.view!=null&&(this.view.activeTool=null)},{initial:!0,once:!0})):t.destroy()}removeTool(){var a;const e=this.tool;if(e==null)return;const t=(a=this.view)==null?void 0:a.tools;t!=null?t.remove(e):e.destroy(),this._set("tool",null)}logError(...e){this.logger.error(...e)}};s([i({constructOnly:!0})],u.prototype,"tool",void 0),s([i()],u.prototype,"active",null),s([i()],u.prototype,"disabled",null),s([i()],u.prototype,"supported",null),s([i({value:null})],u.prototype,"view",null),s([i({type:Boolean,value:!0})],u.prototype,"visible",null),u=s([d("esri.widgets.support.InteractiveToolViewModel")],u);const o="esri-measurement-widget-content",l={base:o,actions:`${o}__actions`,error:`${o}__error`,hint:`${o}__hint`,hintText:`${o}__hint-text`,panelError:`${o}__panel--error`,settings:`${o}__settings`,measurement:`${o}__measurement`,measurementItem:`${o}__measurement-item`,measurementItemDisabled:`${o}__measurement-item--disabled`,measurementItemTitle:`${o}__measurement-item__title`,measurementItemValue:`${o}__measurement-item__value`};let n=class extends _{constructor(e,t){super(e,t)}loadDependencies(){return g({button:()=>y(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))})}render(){return r("div",{class:l.base},this._renderContent())}_renderContent(){const{supported:e,active:t,state:a}=this;switch(a){case"disabled":case"ready":return e?t?this._renderHint():this._renderActions():this._renderUnsupportedMessage();case"measuring":case"measured":return[this._renderSettings(),this._renderMeasurement(),this._renderActions()]}}_renderUnsupportedMessage(){return r("section",{class:l.error,key:"unsupported"},r("p",null,this.messages.unsupported))}_renderHint(){const{messages:e}=this;return r("section",{class:l.hint,key:"hint"},r("p",{class:l.hintText},e.hint))}_renderSettings(){return r("div",{class:l.settings,key:"settings"},r(w,{options:this.unitOptions,selectLabel:this.messages.unit,value:this.unit,onChange:this.onUnitChange}))}_renderMeasurement(){return r("section",{class:l.measurement,key:"measurement"},this.measurementItems.map(e=>this._renderMeasurementItem(e)))}_renderMeasurementItem({key:e,title:t,value:a}){return r("div",{class:this.classes(l.measurementItem,a==null&&l.measurementItemDisabled),key:e},r("span",{class:l.measurementItemTitle},t),r("span",{"aria-live":"polite",class:l.measurementItemValue},a??this.messages.notApplicable))}_renderActions(){const{messages:e}=this;return r("div",{class:l.actions},r("calcite-button",{class:this.newMeasurementButtonClass,disabled:this.state==="disabled",onclick:this.onNewMeasurementClick},e.newMeasurement))}};s([i()],n.prototype,"active",void 0),s([i()],n.prototype,"measurementItems",void 0),s([i()],n.prototype,"messages",void 0),s([i()],n.prototype,"newMeasurementButtonClass",void 0),s([i()],n.prototype,"onNewMeasurementClick",void 0),s([i()],n.prototype,"onUnitChange",void 0),s([i()],n.prototype,"state",void 0),s([i()],n.prototype,"supported",void 0),s([i()],n.prototype,"unit",void 0),s([i()],n.prototype,"unitOptions",void 0),n=s([d("esri.widgets.support.MeasurementWidgetContent")],n);export{u as n,n as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/calcite-button-tOn16zeN.js","assets/button-dkwNndhL.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/form-2Iq0hI3D.js","assets/interactive-NKzPUNL4.js","assets/label2-d2vWQ7x7.js","assets/loadable-sxY2K1G3.js","assets/locale-pfkq1d6A.js","assets/key-qdHumIlA.js","assets/observers-JyBmMU24.js","assets/component-dtiBfYiX.js","assets/t9n-od6MEnI1.js","assets/icon-ZwpY5ksA.js","assets/loader-QqciGs1c.js","assets/guid-6vN-YNJI.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/MediaElementView-ezYHddnZ.js b/dist/assets/MediaElementView-ezYHddnZ.js new file mode 100644 index 0000000..1244634 --- /dev/null +++ b/dist/assets/MediaElementView-ezYHddnZ.js @@ -0,0 +1 @@ +import{as as y,i$ as h,j0 as $,hL as d,j1 as g,j2 as j,j3 as p,aa as w,fB as u,e as l,y as a,c as A,p as E,j4 as c,eA as J,l as L}from"./index-J0iiHjMT.js";import{p as M}from"./normalizeUtilsSync-zfJiThlh.js";const o=w(),s=u(),i=u(),m=u();function U(e,t,r){return y(o,t[0],t[1],1),h(o,o,$(s,r)),o[2]===0?d(e,o[0],o[1]):d(e,o[0]/o[2],o[1]/o[2])}function V(e,t,r){return f(i,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),f(m,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),g(e,j(i,i),m),e[8]!==0&&(e[0]/=e[8],e[1]/=e[8],e[2]/=e[8],e[3]/=e[8],e[4]/=e[8],e[5]/=e[8],e[6]/=e[8],e[7]/=e[8],e[8]/=e[8]),e}function f(e,t,r,x,z,C,b,B,v){p(e,t,x,C,r,z,b,1,1,1),y(o,B,v,1),j(s,e);const[R,S,k]=h(o,o,$(s,s));return p(s,R,0,0,0,S,0,0,0,k),g(e,s,e)}let n=class extends E{constructor(e){super(e)}get bounds(){const e=this.coords;return(e==null?void 0:e.extent)==null?null:c(e.extent)}get coords(){var t;const e=(t=this.element.georeference)==null?void 0:t.coords;return J(e,this.spatialReference).geometry}get normalizedCoords(){return L.fromJSON(M(this.coords))}get normalizedBounds(){const e=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return e!=null?c(e):null}};l([a()],n.prototype,"spatialReference",void 0),l([a()],n.prototype,"element",void 0),l([a()],n.prototype,"bounds",null),l([a()],n.prototype,"coords",null),l([a()],n.prototype,"normalizedCoords",null),l([a()],n.prototype,"normalizedBounds",null),n=l([A("esri.layers.support.MediaElementView")],n);export{U as h,n as i,V as j}; diff --git a/dist/assets/MediaLayer-39dmiD7K.js b/dist/assets/MediaLayer-39dmiD7K.js new file mode 100644 index 0000000..ef3999a --- /dev/null +++ b/dist/assets/MediaLayer-39dmiD7K.js @@ -0,0 +1 @@ +import{e as r,c as v,iE as $e,eA as F,Z as U,y as l,T as m,iB as me,ar as fe,oS as _e,hL as T,E as K,Y as H,oT as be,fB as D,dt as Y,du as ne,oU as A,oV as le,l as oe,a9 as R,p as Ie,oW as J,dT as se,ag as Me,oX as ae,oY as Se,oZ as Le,ij as ye,mb as Ee,hh as Oe,o_ as ce,o$ as ge,p0 as je,p1 as He,p2 as Te,p3 as Ce,p4 as We,bW as Ve,p5 as Ne,h6 as ze,p6 as Ae,p7 as Ue,V as q,cZ as Be,K as Ge,d as Fe,s as Ke,ef as Je,fd as Ze,al as ke,e1 as qe,j4 as De,p8 as Ye,dK as Qe,dO as Xe,dM as et,dP as tt,f6 as nt,c7 as ot}from"./index-J0iiHjMT.js";import{h as $,j as xe,i as st}from"./MediaElementView-ezYHddnZ.js";import{o as rt}from"./BoundsStore-wmwfHjhp.js";import"./normalizeUtilsSync-zfJiThlh.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";let te=class extends $e{projectOrWarn(e,t){if(e==null)return e;const{geometry:o,pending:n}=F(e,t);return n?null:n||o?o:(U.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};te=r([v("esri.layers.support.GeoreferenceBase")],te);const Q=te,X=D(),p=R();let G=class extends Ie{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};r([l()],G.prototype,"sourcePoint",void 0),r([l({type:m})],G.prototype,"mapPoint",void 0),G=r([v("esri.layers.support.ControlPoint")],G);let x=class extends me(Q){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const o=fe.fromJSON(t.spatialReference),n=_e(...t.coefficients,1);return e.map(s=>(T(p,s.x,s.y),$(p,p,n),{sourcePoint:s,mapPoint:new m({x:p[0],y:p[1],spatialReference:o})}))}writeControlPoints(e,t,o,n){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(s=>{const i=s.sourcePoint;return{x:i.x,y:i.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const s=new K("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration.",{layer:n==null?void 0:n.layer,georeference:this});n!=null&&n.messages?n.messages.push(s):U.getLogger(this).error(s.name,s.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(X);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return ut(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:o,height:n}=this,{rings:[[s,i,a,c]]}=e,u={sourcePoint:H(0,n),mapPoint:new m({x:s[0],y:s[1],spatialReference:t})},h={sourcePoint:H(0,0),mapPoint:new m({x:i[0],y:i[1],spatialReference:t})},d={sourcePoint:H(o,0),mapPoint:new m({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:H(o,n),mapPoint:new m({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(d)&&f(g)&&(ue(X,u,h,d,g),this.controlPoints=this.controlPoints.map(({sourcePoint:w})=>(T(p,w.x,w.y),$(p,p,X),{sourcePoint:w,mapPoint:new m({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:be(D(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;T(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return $(p,p,this.transform),new m({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=F(e,t).geometry)==null?null:(T(p,e.x,e.y),$(p,p,this.inverseTransform),H(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:o,height:n}=this;if(!(t!=null&&o>0&&n>0))return null;const[s,i,a,c]=t;if(!f(s))return null;const u=s.mapPoint.spatialReference,h=this._projectControlPoint(i,u),d=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!d.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=D());let w=null;return w=f(d.controlPoint)&&f(g.controlPoint)?ue(e,s,h.controlPoint,d.controlPoint,g.controlPoint):f(d.controlPoint)?lt(e,s,h.controlPoint,d.controlPoint):it(e,s,h.controlPoint),w.every(we=>we===0)?null:w}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:o,mapPoint:n}=e,{geometry:s,pending:i}=F(n,t);return i?{valid:!1,controlPoint:null}:i||s?{valid:!0,controlPoint:{sourcePoint:o,mapPoint:s}}:(U.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:n.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return(e==null?void 0:e.sourcePoint)!=null&&e.mapPoint!=null}r([l({type:[G],json:{write:{allowNull:!1,isRequired:!0}}})],x.prototype,"controlPoints",void 0),r([Y("controlPoints")],x.prototype,"readControlPoints",null),r([ne("controlPoints")],x.prototype,"writeControlPoints",null),r([l()],x.prototype,"coords",null),r([l({json:{write:!0}})],x.prototype,"height",void 0),r([l({readOnly:!0})],x.prototype,"inverseTransform",null),r([l({readOnly:!0})],x.prototype,"transform",null),r([l({json:{write:!0}})],x.prototype,"width",void 0),x=r([v("esri.layers.support.ControlPointsGeoreference")],x);const _=R(),b=R(),C=R(),O=R(),I=R(),M=R(),W=R(),j=R(),Z=Math.PI/2;function S(e,t,o){T(e,o.sourcePoint.x,o.sourcePoint.y),T(t,o.mapPoint.x,o.mapPoint.y)}function it(e,t,o){return S(_,I,t),S(b,M,o),A(C,b,_,Z),A(O,_,b,Z),A(W,M,I,-Z),A(j,I,M,-Z),re(e,_,b,C,O,I,M,W,j)}function lt(e,t,o,n){return S(_,I,t),S(b,M,o),S(C,W,n),le(O,_,b,.5),A(O,C,O,Math.PI),le(j,I,M,.5),A(j,W,j,Math.PI),re(e,_,b,C,O,I,M,W,j)}function ue(e,t,o,n,s){return S(_,I,t),S(b,M,o),S(C,W,n),S(O,j,s),re(e,_,b,C,O,I,M,W,j)}const at=new Array(8).fill(0),ct=new Array(8).fill(0);function pe(e,t,o,n,s){return e[0]=t[0],e[1]=t[1],e[2]=o[0],e[3]=o[1],e[4]=n[0],e[5]=n[1],e[6]=s[0],e[7]=s[1],e}function re(e,t,o,n,s,i,a,c,u){return xe(e,pe(at,t,o,n,s),pe(ct,i,a,c,u))}function ut(e,t,o,n){const s=J(0,o),i=J(0,0),a=J(t,0),c=J(t,o);return $(s,s,e),$(i,i,e),$(a,a,e),$(c,c,e),new oe({rings:[[s,i,a,c,s]],spatialReference:n})}const Pe=x,B=R();let L=class extends Q{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:o,bottomRight:n}=this;if(e==null||t==null||o==null||n==null)return null;const s=e.spatialReference;return t=this.projectOrWarn(t,s),o=this.projectOrWarn(o,s),n=this.projectOrWarn(n,s),t==null||o==null||n==null?null:new oe({rings:[[[o.x,o.y],[e.x,e.y],[t.x,t.y],[n.x,n.y],[o.x,o.y]]],spatialReference:s})}set coords(e){const{topLeft:t}=this;if(t==null)return;const o=t.spatialReference;if((e=this.projectOrWarn(e,o))==null)return;const{rings:[[n,s,i,a]]}=e;this.bottomLeft=new m({x:n[0],y:n[1],spatialReference:o}),this.topLeft=new m({x:s[0],y:s[1],spatialReference:o}),this.topRight=new m({x:i[0],y:i[1],spatialReference:o}),this.bottomRight=new m({x:a[0],y:a[1],spatialReference:o})}toSourceNormalized(e){const{topLeft:t,topRight:o,bottomRight:n,bottomLeft:s}=this;if(e==null||t==null||o==null||n==null||s==null)return null;const i=t.spatialReference;e=e.normalize();const a=F(e,i).geometry;if(a==null)return null;T(B,a.x,a.y);const c=xe(D(),[t.x,t.y,s.x,s.y,o.x,o.y,n.x,n.y],[0,0,0,1,1,0,1,1]);return $(B,B,c),H(B[0],B[1])}};r([l()],L.prototype,"coords",null),r([l({type:m})],L.prototype,"bottomLeft",void 0),r([l({type:m})],L.prototype,"bottomRight",void 0),r([l({type:m})],L.prototype,"topLeft",void 0),r([l({type:m})],L.prototype,"topRight",void 0),L=r([v("esri.layers.support.CornersGeoreference")],L);const pt=L;let V=class extends Q{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:o,ymax:n,spatialReference:s}=this.extent;let i;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ee(a,c,this.rotation);i=[u(e,t),u(e,n),u(o,n),u(o,t)],i.push(i[0])}else i=[[e,t],[e,n],[o,n],[o,t],[e,t]];return new oe({rings:[i],spatialReference:s})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),(e==null?void 0:e.extent)==null)return;const{rings:[[o,n,s]],extent:{center:{x:i,y:a}}}=e,c=Me(Math.PI/2-Math.atan2(n[1]-o[1],n[0]-o[0])),u=ee(i,a,-c),[h,d]=u(o[0],o[1]),[g,w]=u(s[0],s[1]);this.extent=new se({xmin:h,ymin:d,xmax:g,ymax:w,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:o}=this;if(e==null||t==null)return null;const{xmin:n,ymin:s,xmax:i,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=F(e,u).geometry;if(h==null)return null;let d=h.x,g=h.y;return o&&([d,g]=ee(c.x,c.y,-o)(d,g)),H(ae(d,n,i,0,1),ae(g,a,s,0,1))}};function ee(e,t,o){const n=Se(o),s=Math.cos(n),i=Math.sin(n);return(a,c)=>[s*(a-e)+i*(c-t)+e,s*(c-t)-i*(a-e)+t]}r([l()],V.prototype,"coords",null),r([l({type:se})],V.prototype,"extent",void 0),r([l({type:Number})],V.prototype,"rotation",void 0),V=r([v("esri.layers.support.ExtentAndRotationGeoreference")],V);const ht=V,dt={key:"type",base:Q,typeMap:{"control-points":Pe,corners:pt,"extent-and-rotation":ht}};let N=class extends Le(me(ye)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return Pe.fromJSON(e)}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:o,contentHeight:n}=this;if(e==null||t==null||o===0||n===0)return null;const s=t.toSourceNormalized(e);return s==null?null:(s.x*=o,s.y*=n,s)}};r([l({types:dt,json:{write:!0}})],N.prototype,"georeference",void 0),r([Y("georeference")],N.prototype,"readGeoreference",null),r([l()],N.prototype,"opacity",void 0),N=r([v("esri.layers.support.MediaElementBase")],N);const ie=N;let P=class extends ie{constructor(t){super(t),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const t=this.image;if(typeof t=="string"){const o=Ee(t).then(n=>{this._set("content",n)});this.addResolvingPromise(o)}else if(t instanceof HTMLImageElement){const o=t.decode().then(()=>{this._set("content",t)});this.addResolvingPromise(o)}else t?this._set("content",t):this.addResolvingPromise(Promise.reject(new K("image-element:invalid-image-type","Invalid image type",{image:t})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(t,o,n){return Oe(o.url,n)}writeImage(t,o,n,s){if(t==null)return;const i=s==null?void 0:s.portalItem,a=s==null?void 0:s.resources;if(!i||!a)return void(typeof t=="string"&&(o[n]=ce(t,s)));const c=typeof t!="string"||ge(t)||je(t)?null:t;if(c){if(He(c)==null)return void(o[n]=c);const u=ce(c,{...s,verifyItemRelativeUrls:s!=null&&s.verifyItemRelativeUrls?{writtenUrls:s.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},Te.NO);if(i&&u&&!Ce(u))return a.toKeep.push({resource:i.resourceFromPath(u),compress:!1}),void(o[n]=u)}o[n]="",a.pendingOperations.push(mt(t).then(u=>{const h=yt(u,i);o[n]=h.itemRelativeUrl,a.toAdd.push({resource:h,content:{type:"blob",blob:u},compress:!1,finish:d=>{this.image=d.url}})}))}};r([l()],P.prototype,"animationOptions",void 0),r([l({readOnly:!0})],P.prototype,"content",void 0),r([l({readOnly:!0})],P.prototype,"contentWidth",null),r([l({readOnly:!0})],P.prototype,"contentHeight",null),r([l({json:{name:"url",type:String}})],P.prototype,"image",void 0),r([Y("image",["url"])],P.prototype,"readImage",null),r([ne("image")],P.prototype,"writeImage",null),r([l({readOnly:!0,json:{name:"mediaType"}})],P.prototype,"type",void 0),P=r([v("esri.layers.support.ImageElement")],P);const ve=P;async function mt(e){return typeof e=="string"?ge(e)?We(e):(await Ve(e,{responseType:"blob"})).data:new Promise(t=>ft(e).toBlob(t))}function ft(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,o=e instanceof HTMLImageElement?e.naturalHeight:e.height,n=document.createElement("canvas"),s=n.getContext("2d");return n.width=t,n.height=o,e instanceof HTMLImageElement?s.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&s.putImageData(e,0,0),n}function yt(e,t){const o=Ne(),n=`${ze("media",o)}.${Ae({type:"blob",blob:e})}`;return t.resourceFromPath(n)}let E=class extends ie{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;if(typeof e=="string"){const t=document.createElement("video");t.src=e,t.crossOrigin="anonymous",t.autoplay=!0,t.muted=!0,t.loop=!0,this.addResolvingPromise(this._loadVideo(t).then(()=>{this._set("content",t)}))}else e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new K("video-element:invalid-video-type","Invalid video type",{video:e})));return Promise.resolve(this)}get contentWidth(){var e;return((e=this.content)==null?void 0:e.videoWidth)??0}get contentHeight(){var e;return((e=this.content)==null?void 0:e.videoHeight)??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):U.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}_loadVideo(e){return new Promise((t,o)=>{var s;const n=Ue(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()});this.addHandles(n,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",(s=e.src)!=null&&s.includes("blob:")||(e.src=e.src))})}};r([l()],E.prototype,"autoplay",void 0),r([l({readOnly:!0})],E.prototype,"content",void 0),r([l({readOnly:!0})],E.prototype,"contentWidth",null),r([l({readOnly:!0})],E.prototype,"contentHeight",null),r([l()],E.prototype,"video",null),E=r([v("esri.layers.support.VideoElement")],E);const Re=E,gt={key:"type",defaultKeyValue:"image",base:ie,typeMap:{image:ve,video:Re}},he=q.ofType(gt);let z=class extends ye.LoadableMixin(Be(Ge.EventedAccessor)){constructor(e){super(e),this._index=new rt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const n of t.removed){const s=this._elementViewsMap.get(n);this._elementViewsMap.delete(n),this._index.delete(s),this.removeHandles(s),s.destroy(),this.notifyChange("fullExtent")}const{spatialReference:o}=this;for(const n of t.added){if(this._elementViewsMap.get(n))continue;const s=new st({spatialReference:o,element:n});this._elementViewsMap.set(n,s);const i=Fe(()=>s.coords,()=>this._updateIndexForElement(s,!1));this._updateIndexForElement(s,!0),this.addHandles(i,s)}this._elementsIndexes.clear(),this.elements.forEach((n,s)=>this._elementsIndexes.set(n,s)),this.emit("refresh")},this.elements=new he}async load(e){if(Ke(e),!this.spatialReference){const t=this.elements.find(o=>{var n;return((n=o.georeference)==null?void 0:n.coords)!=null});this._set("spatialReference",t?t.georeference.coords.spatialReference:fe.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",Je(e,this._get("elements"),he))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new se({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):U.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await Ze(e.spatialReference,this.spatialReference,null,t);const o=ke(e.spatialReference,this.spatialReference)?e:qe(e,this.spatialReference);if(!o)return[];const n=o.normalize(),s=[];for(const i of n)this._index.forEachInBounds(De(i),({normalizedCoords:a,element:c})=>{a!=null&&Ye(i,a)&&s.push(c)});return s.sort((i,a)=>this._elementsIndexes.get(i)-this._elementsIndexes.get(a)),s}_updateIndexForElement(e,t){const o=e.normalizedBounds,n=this._index.has(e),s=o!=null;this._index.delete(e),s&&this._index.set(e,o),this.notifyChange("fullExtent"),t||(n!==s?this.emit("refresh"):this.emit("change",{element:e.element}))}};r([l()],z.prototype,"elements",null),r([l({readOnly:!0})],z.prototype,"fullExtent",null),r([l()],z.prototype,"spatialReference",null),z=r([v("esri.layers.support.LocalMediaElementSource")],z);const k=z;function de(e){return typeof e=="object"&&e!=null&&"type"in e}let y=class extends Qe(Xe(et(tt(ot)))){constructor(e){super(e),this.effectiveSource=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this.source=new k}load(e){const t=this.source;if(!t)return this.addResolvingPromise(Promise.reject(new K("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer."))),Promise.resolve(this);const o=de(t)?new k({elements:new q([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference);const n=o.load(e).then(()=>{this.spatialReference=o.spatialReference});return this.addResolvingPromise(n),Promise.resolve(this)}destroy(){var e,t;(e=this.effectiveSource)==null||e.destroy(),(t=this.source)==null||t.destroy()}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus==="not-loaded"?this._set("source",e):U.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new k({elements:new q(e)}):e instanceof q?new k({elements:e}):e:null}readSource(e,t,o){const n=t.mediaType==="image"?new ve:t.mediaType==="video"?new Re:null;return n==null||n.read(t,o),n}writeSource(e,t,o,n){var s;e&&de(e)&&e.type==="image"?e.write(t,n):n!=null&&n.messages&&((s=n==null?void 0:n.messages)==null||s.push(new K("media-layer:unsupported-source","source must be an 'ImageElement'")))}};r([l({readOnly:!0})],y.prototype,"effectiveSource",void 0),r([l({type:String})],y.prototype,"copyright",void 0),r([l({readOnly:!0})],y.prototype,"fullExtent",null),r([l({type:["MediaLayer"]})],y.prototype,"operationalLayerType",void 0),r([l({type:["show","hide"]})],y.prototype,"listMode",void 0),r([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1}}})],y.prototype,"source",null),r([nt("source")],y.prototype,"castSource",null),r([Y("source",["url"])],y.prototype,"readSource",null),r([ne("source")],y.prototype,"writeSource",null),r([l()],y.prototype,"spatialReference",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),y=r([v("esri.layers.MediaLayer")],y);const bt=y;export{bt as default}; diff --git a/dist/assets/MediaLayerView3D-CIdxGOiQ.js b/dist/assets/MediaLayerView3D-CIdxGOiQ.js new file mode 100644 index 0000000..ca72780 --- /dev/null +++ b/dist/assets/MediaLayerView3D-CIdxGOiQ.js @@ -0,0 +1 @@ +import{c3 as T,G as x,ah as P,a2 as b,fl as D,eD as G,fu as c,fv as I,fw as M,fx as z,by as S,bf as s,bz as m,b7 as H,fy as $,bg as h,E as O,fz as V,fA as f,e as p,y as v,c as C,fB as L}from"./index-J0iiHjMT.js";import{i as W,j as N}from"./MediaElementView-ezYHddnZ.js";import{n as U}from"./LayerView3D-iOx2MD1g.js";import{g as k}from"./ImageMaterial.glsl-TdPtjVc_.js";import{u as Y}from"./LayerView-efDufa6j.js";import"./normalizeUtilsSync-zfJiThlh.js";let o=class extends U(Y){constructor(){super(...arguments),this.type="media-3d",this.drapeSourceType=T.RasterImage,this.updatePolicy=x.ASYNC,this._uidToElement=new Map,this._renderedElements=new Map,this._lastDrapingExtent=null,this._update=P(async(e,t,r)=>{const n=await this._collectMediaElements(e,t,r);this._synchronizeRenderElements(n)},0)}initialize(){this._renderer=this.view.basemapTerrain.overlayManager.registerGeometryDrapeSource(this);const e=()=>this._updateWithLastDrapingExtent();this.addHandles([b(()=>this.view.basemapTerrain.overlayManager.unregisterDrapeSource(this)),D(()=>this.layer.effectiveSource,"change",e),D(()=>this.layer.effectiveSource,"refresh",e)]),this._updatingHandles.add(()=>this.suspended,e)}setDrapingExtent(e,t){this._lastDrapingExtent={overlays:e,spatialReference:t},this._updateWithLastDrapingExtent()}getHit(e){const t=this._uidToElement.get(e);return t?{type:"media",element:t,layer:this.layer}:null}_updateWithLastDrapingExtent(){if(this._lastDrapingExtent==null||this.suspended)return void(this._renderer&&this._synchronizeRenderElements(new Set));const{overlays:e,spatialReference:t}=this._lastDrapingExtent;this._updatingHandles.addPromise(this._update(e,t).catch(()=>{}))}async _collectMediaElements(e,t,r){const n=this.layer.effectiveSource;return n==null?new Set:new Set((await Promise.all(e.map(a=>n.queryElements(G(a.extent,t),{signal:r})))).flat())}_synchronizeRenderElements(e){this._synchronizeRenderElementsRemove(e),this._synchronizeRenderElementsAdd(e)}_synchronizeRenderElementsRemove(e){const t=new Set,r=[];this._renderedElements.forEach((n,a)=>{e.has(a)||(t.add(a),n.renderData!=null&&r.push(n.renderData.renderGeometry),this._removeElement(a,n))}),this._renderer.removeGeometries(r,c.REMOVE)}_synchronizeRenderElementsAdd(e){for(const t of e)this._renderedElements.has(t)||this._createRenderElement(t)}_removeElement(e,{renderData:t,handle:r}){this._destroyRenderData(t),this._renderedElements.delete(e),this._uidToElement.delete(e.uid),r.remove()}async _createRenderElement(e){const t=new W({spatialReference:this.view.spatialReference,element:e}),r={renderData:null,handle:I([this._updatingHandles.add(()=>e.opacity,n=>{r.renderData!=null&&r.renderData.material.setParameters({opacity:n})}),this._updatingHandles.add(()=>t.coords,()=>{r.renderData!=null?this._updateGeometry(t,r,r.renderData):this._initializeRenderData(t,r)}),this._updatingHandles.add(()=>e.content,()=>this._initializeRenderData(t,r)),M(t)])};this._renderedElements.set(e,r),this._uidToElement.set(e.uid,e),this._updatingHandles.addPromise(e.load().catch(()=>{})),this._initializeRenderData(t,r)}_initializeRenderData(e,t){const{coords:r,element:n}=e,{contentWidth:a,contentHeight:l}=n;if(r==null||n.content==null)return void(t.renderData=this._destroyRenderData(t.renderData));if(t.renderData!=null)return;const i=this._createTexture(n.content),_=i.load(this.view._stage.renderView.renderingContext);this.view._stage.add(i),z(_)&&this._updatingHandles.addPromise(_);const y=new k({initTextureTransparent:!0,textureId:i.id,opacity:n.opacity,transparent:!0,perspectiveInterpolation:!0}),E=this._getPositionAttributeArray(r),w=[0,0,1,0,1,1,0,1],R=this._getPerspectiveDivideAttributeArray(E,a,l),u=[0,1,2,0,2,3],A=new S(y,[[s.POSITION,new m(E,u,3,!0)],[s.UV0,new m(w,u,2,!0)],[s.PERSPECTIVEDIVIDE,new m(R,u,1,!0)]]),g=new H(A,{layerUid:this.layer.uid,graphicUid:n.uid});this._renderer.addGeometries([g],c.ADD),t.renderData={renderGeometry:g,texture:i,material:y}}_updateGeometry(e,t,r){const{coords:n,element:a}=e;if(n==null||a.content==null)return void(t.renderData=this._destroyRenderData(t.renderData));const l=this._getPositionAttributeArray(n);r.renderGeometry.geometry.setAttributeData(s.POSITION,l);const i=this._getPerspectiveDivideAttributeArray(l,a.contentWidth,a.contentHeight);r.renderGeometry.geometry.setAttributeData(s.PERSPECTIVEDIVIDE,i),this._renderer.modifyGeometries([r.renderGeometry],$.GEOMETRY)}_getPositionAttributeArray(e){const[t,r,n,a]=e.rings[0];return[t[0],t[1],h,a[0],a[1],h,n[0],n[1],h,r[0],r[1],h]}_getPerspectiveDivideAttributeArray(e,t,r){N(d,[0,0,t,0,t,r,0,r],[e[0],e[1],e[3],e[4],e[6],e[7],e[9],e[10]]);const n=d[6]/d[8]*t,a=d[7]/d[8]*r;return[1,1+n,1+n+a,1+a]}_destroyRenderData(e){if(e==null)return null;const t=e.texture;return t.unload(),this.view._stage.remove(t),this._renderer.removeGeometries([e.renderGeometry],c.REMOVE),null}_createTexture(e){const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,r=e instanceof HTMLImageElement?e.naturalHeight:e.height;if("getFrame"in e)throw new O("media-layer-view-3d","animation is not supported");return new V(e,{wrap:{s:f.CLAMP_TO_EDGE,t:f.CLAMP_TO_EDGE},preMultiplyAlpha:!0,width:t,height:r,mipmap:!0,updateCallback:()=>this.view.basemapTerrain.overlayManager.setDrawTexturesDirty()})}get test(){const e=this;return{get numberOfElements(){return e._renderedElements.size}}}};p([v({readOnly:!0})],o.prototype,"type",void 0),p([v()],o.prototype,"layer",void 0),o=p([C("esri.views.3d.layers.MediaLayerView3D")],o);const d=L(),Q=o;export{Q as default}; diff --git a/dist/assets/MemorySourceWorker-K3WXTL5J.js b/dist/assets/MemorySourceWorker-K3WXTL5J.js new file mode 100644 index 0000000..7bd169d --- /dev/null +++ b/dist/assets/MemorySourceWorker-K3WXTL5J.js @@ -0,0 +1 @@ +import{eQ as w,E as I,eP as M,ff as Z,ga as A,eR as P,gb as b,gc as O,gd as k,ge as C,eV as S,eH as v}from"./index-J0iiHjMT.js";import{t as $,n as G}from"./objectIdUtils-GktMsX8e.js";import{m as L}from"./FeatureStore-X-AIJLo2.js";import{W,x as E,j as _}from"./QueryEngine-8tLWlkSE.js";import{i as z,o as H,a as N}from"./clientSideDefaults-F-CNnR0g.js";import{I as B,f as g,p as T,d as j,w as D}from"./sourceUtils-zbywPEXK.js";import"./BoundsStore-wmwfHjhp.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./date-be_IQzZd.js";const U=S,V={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},J={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function K(h){return v(h)?h.z!=null:!!h.hasZ}function X(h){return v(h)?h.m!=null:!!h.hasM}class he{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const i=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),o=e.fields||[],u=e.hasM!=null?e.hasM:!!n.hasM,y=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,d=p?U:e.spatialReference||n.spatialReference,m=p?V:null,c=e.geometryType||n.geometryType,l=!c;let t=e.objectIdField||n.objectIdField,r=e.timeInfo;const f=new w(o);if(!l&&(p&&i.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!c))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(i.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const s=f.get(t);s?(t=s.name,s.type="esriFieldTypeOID",s.editable=!1,s.nullable=!1):o.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const s of o){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),!s.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:s});if(s.name===t&&(s.type="esriFieldTypeOID"),!M.jsonValues.includes(s.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s});s.length==null&&(s.length=Z(s))}const F={};for(const s of o)if(s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"){const q=A(s);q!==void 0&&(F[s.name]=q)}if(r){if(r.startTimeField){const s=f.get(r.startTimeField);s?(r.startTimeField=s.name,s.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const s=f.get(r.endTimeField);s?(r.endTimeField=s.name,s.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const s=f.get(r.trackIdField);s?r.trackIdField=s.name:(r.trackIdField=null,i.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(i.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:r}}),r=null)}const x=f.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??P}:null;this._createDefaultAttributes=z(F,t);const R={warnings:i,featureErrors:[],layerDefinition:{...J,drawingInfo:H(c),templates:N(F),extent:m,geometryType:c,objectIdField:t,fields:o,hasZ:y,hasM:u,timeInfo:r,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:w.fromLayerJSON({fields:o,timeInfo:r,dateFieldsTimeReference:x}),geometryType:c,hasM:u,hasZ:y,objectIdField:t,spatialReference:d,featureStore:new L({geometryType:c,hasM:u,hasZ:y}),timeInfo:r,cacheSpatialQueries:!0}),!(a!=null&&a.length))return this._nextObjectId=$,R;const Q=G(t,a);return this._nextObjectId=Q+1,await E(a,d),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:i,geometryType:a}=this._queryEngine;return await Promise.all([B(i,a),E(e.adds,i),E(e.updates,i)]),this._applyEdits(e)}queryFeatures(e,i={}){return this._queryEngine.executeQuery(e,i.signal)}queryFeatureCount(e,i={}){return this._queryEngine.executeQueryForCount(e,i.signal)}queryObjectIds(e,i={}){return this._queryEngine.executeQueryForIds(e,i.signal)}queryExtent(e,i={}){return this._queryEngine.executeQueryForExtent(e,i.signal)}querySnapping(e,i={}){return this._queryEngine.executeQueryForSnapping(e,i.signal)}_inferLayerProperties(e,i){let a,n,o=null,u=null,y=null;for(const p of e){const d=p.geometry;if(d!=null&&(o||(o=b(d)),u||(u=d.spatialReference),a==null&&(a=K(d)),n==null&&(n=X(d)),o&&u&&a!=null&&n!=null))break}if(i&&i.length){let p=null;i.some(d=>{const m=d.type==="esriFieldTypeOID",c=!d.type&&d.name&&d.name.toLowerCase()==="objectid";return p=d,m||c})&&(y=p.name)}return{geometryType:o,spatialReference:u,objectIdField:y,hasM:n,hasZ:a}}async _loadInitialFeatures(e,i){const{geometryType:a,hasM:n,hasZ:o,objectIdField:u,spatialReference:y,featureStore:p,fieldsIndex:d}=this._queryEngine,m=[];for(const t of i){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const r=this._createDefaultAttributes(),f=T(d,r,t.attributes,!0);f?e.featureErrors.push(f):(this._assignObjectId(r,t.attributes,!0),t.attributes=r,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[u]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,y)),m.push(t))}p.addMany(O([],m,a,o,n,u));const{fullExtent:c,timeExtent:l}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=c,l){const{start:t,end:r}=l;e.layerDefinition.timeInfo.timeExtent=[t,r]}return e}async _applyEdits(e){const{adds:i,updates:a,deletes:n}=e,o={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(i!=null&&i.length&&this._applyAddEdits(o,i),a!=null&&a.length&&this._applyUpdateEdits(o,a),n==null?void 0:n.length){for(const p of n)o.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:u,timeExtent:y}=await this._queryEngine.fetchRecomputedExtents();return{extent:u,timeExtent:y,featureEditResults:o}}_applyAddEdits(e,i){const{addResults:a}=e,{geometryType:n,hasM:o,hasZ:u,objectIdField:y,spatialReference:p,featureStore:d,fieldsIndex:m}=this._queryEngine,c=[];for(const l of i){if(l.geometry&&n!==b(l.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=T(m,t,l.attributes);if(r)a.push(r);else{if(this._assignObjectId(t,l.attributes),l.attributes=t,l.uid!=null){const f=l.attributes[y];e.uidToObjectId[l.uid]=f}if(l.geometry!=null){const f=l.geometry.spatialReference??p;l.geometry=_(D(l.geometry,f),f,p)}c.push(l),a.push(j(l.attributes[y]))}}d.addMany(O([],c,n,u,o,y))}_applyUpdateEdits({updateResults:e},i){const{geometryType:a,hasM:n,hasZ:o,objectIdField:u,spatialReference:y,featureStore:p,fieldsIndex:d}=this._queryEngine;for(const m of i){const{attributes:c,geometry:l}=m,t=c==null?void 0:c[u];if(t==null){e.push(g(`Identifier field ${u} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const r=k(p.getFeature(t),a,o,n);if(l!=null){if(a!==b(l)){e.push(g("Incorrect geometry type."));continue}const f=l.spatialReference??y;r.geometry=_(D(l,f),f,y)}if(c){const f=T(d,r.attributes,c);if(f){e.push(f);continue}}p.add(C(r,a,o,n,u)),e.push(j(t))}}_assignObjectId(e,i,a=!1){const n=this._queryEngine.objectIdField;a&&i&&isFinite(i[n])?e[n]=i[n]:e[n]=this._nextObjectId++}}export{he as default}; diff --git a/dist/assets/OGCFeatureLayer--w0HTnNu.js b/dist/assets/OGCFeatureLayer--w0HTnNu.js new file mode 100644 index 0000000..6d5c99b --- /dev/null +++ b/dist/assets/OGCFeatureLayer--w0HTnNu.js @@ -0,0 +1 @@ +import{e as r,y as s,c as D,ij as B,ar as x,j5 as L,E as b,en as N,dK as H,el as J,dO as z,dM as V,dN as Z,dL as k,dP as K,iF as F,il as U,ca as I,iG as W,iH as X,dw as Y,dT as ee,fe as $,iJ as te,iK as re,iI as oe,dV as se,iu as ie,iv as ne,iM as pe,it as ae,iN as le,dW as ue,ix as de,c7 as ce}from"./index-J0iiHjMT.js";import{S as ye,h as O,x as T,T as he,I as fe,F as me,k as ge,j as ve,b as Se}from"./ogcFeatureUtils-dtzP0u64.js";import{d as xe}from"./FeatureSet-d4S1oKME.js";import{o as we}from"./CustomParametersMixin-Y1bOcayO.js";import{p as Ce}from"./FeatureEffectLayer-oBa8pIG5.js";import{c as Re}from"./FeatureReductionLayer-RlitE1N6.js";import{c as be}from"./OrderedLayer-M7k5gLgx.js";import{n as Fe}from"./FeatureType-MpRe7WJj.js";import"./geojson-fSjaGZrp.js";import"./date-be_IQzZd.js";import"./clientSideDefaults-F-CNnR0g.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureTemplate-kUgbbA00.js";let d=class extends B{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:i,supportedCrs:n},layer:{apiKey:p,customParameters:l,effectiveMaxRecordCount:a}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:a,queryParameters:{apiKey:p,customParameters:l},spatialReference:i,supportedCrs:n}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(i=>xe.fromJSON(i))}queryFeaturesJSON(e,t={}){const i=this.getSource();return this.load(t).then(()=>ye(i,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){const i=new RegExp(`^${t}$`,"i");return e.conformsTo.some(n=>i.test(n))??!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){var i,n,p,l,a;const t=(i=e==null?void 0:e.components)==null?void 0:i.parameters;return((p=(n=t==null?void 0:t.limit)==null?void 0:n.schema)==null?void 0:p.maximum)??((a=(l=t==null?void 0:t.limitFeatures)==null?void 0:l.schema)==null?void 0:a.maximum)}_getStorageSpatialReference(e){const t=e.storageCrs??O,i=T(t);return i==null?x.WGS84:new x({wkid:i})}_getSupportedSpatialReferences(e,t){const i="#/crs",n=e.crs??[O],p=n.includes(i)?n.filter(a=>a!==i).concat(t.crs??[]):n,l=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return p.filter(a=>!l.test(a))}async _loadOGCServices(e,t){const i=t!=null?t.signal:null,{apiKey:n,collectionId:p,customParameters:l,fields:a,geometryType:h,hasZ:f,objectIdField:j,timeInfo:m,url:E}=e,P={fields:a==null?void 0:a.map(u=>u.toJSON()),geometryType:L.toJSON(h),hasZ:f??!1,objectIdField:j,timeInfo:m==null?void 0:m.toJSON()},c={apiKey:n,customParameters:l,signal:i},g=await he(E,c),[w,C]=await Promise.all([fe(g,c),me(g,c)]);if(!this._conformsToType(w,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new b("ogc-feature-layer:no-geojson-support","Server does not support geojson");const y=C.collections.find(u=>u.id===p);if(!y)throw new b("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const _=this._conformsToType(w,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ge(g,c):null,R=await ve(y,P,c),q=this._getMaxRecordCount(_),M=this._getCapabilities(R.hasZ,q),A=this._getStorageSpatialReference(y).toJSON(),G=this._getSupportedSpatialReferences(y,C),Q=new RegExp(`^${Se}`,"i"),v={};for(const u of G){const S=T(u);S!=null&&(v[S]||(v[S]=u.replace(Q,"")))}this.featureDefinition={capabilities:M,collection:y,layerDefinition:R,spatialReference:A,supportedCrs:v}}};r([s()],d.prototype,"featureDefinition",void 0),r([s({constructOnly:!0})],d.prototype,"layer",void 0),r([s()],d.prototype,"type",void 0),d=r([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const Ie=de();let o=class extends N(we(Re(Ce(H(be(J(z(V(Z(k(K(ce)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){var e;return this.maxRecordCount??((e=this.capabilities)==null?void 0:e.query.maxRecordCount)??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){F(e,this.fieldsIndex),this._set("renderer",e)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return U(this,e)}createQuery(){return new I}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a;let i,n=!1;const p=(a=t==null?void 0:t.feature)==null?void 0:a.attributes,l=this.typeIdField&&(p==null?void 0:p[this.typeIdField]);return l!=null&&this.types&&(n=this.types.some(h=>{var f;return h.id==l&&(i=(f=h.domains)==null?void 0:f[e],(i==null?void 0:i.type)==="inherited"&&(i=this._getLayerDomain(e)),!0)})),n||i||(i=this._getLayerDomain(e)),i}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(I.from(e)||this.createQuery(),t)).then(i=>{var n;return(n=i==null?void 0:i.features)==null||n.forEach(p=>{p.layer=p.sourceLayer=this}),i})}serviceSupportsSpatialReference(e){var t;return((t=this.source)==null?void 0:t.serviceSupportsSpatialReference(e))??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),F(this.renderer,this.fieldsIndex),W(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};r([s({readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"capabilities",void 0),r([s({type:String,json:{write:!0}})],o.prototype,"collectionId",void 0),r([s({type:String})],o.prototype,"copyright",void 0),r([s({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([s({type:String})],o.prototype,"definitionExpression",void 0),r([s({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],o.prototype,"description",void 0),r([s({type:String})],o.prototype,"displayField",void 0),r([s({type:Number})],o.prototype,"effectiveMaxRecordCount",null),r([s(X)],o.prototype,"elevationInfo",void 0),r([s({type:[Y],json:{origins:{service:{name:"layerDefinition.fields"}}}})],o.prototype,"fields",void 0),r([s(Ie.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([s({readOnly:!0,type:ee,json:{origins:{service:{name:"layerDefinition.extent"}}}})],o.prototype,"fullExtent",void 0),r([s({type:$.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:$.read}}}}})],o.prototype,"geometryType",void 0),r([s({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],o.prototype,"hasZ",void 0),r([s({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([s({type:[te],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:re},write:!0}}}})],o.prototype,"labelingInfo",void 0),r([s(oe)],o.prototype,"labelsVisible",void 0),r([s(se)],o.prototype,"legendEnabled",void 0),r([s({type:Number})],o.prototype,"maxRecordCount",void 0),r([s({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([s({type:["OGCFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),r([s(ie)],o.prototype,"popupEnabled",void 0),r([s({type:ne,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([s({types:pe,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:ae,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],o.prototype,"renderer",null),r([s(le)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([s({readOnly:!0})],o.prototype,"source",void 0),r([s({readOnly:!0,type:x,json:{origins:{service:{read:!0}}}})],o.prototype,"spatialReference",void 0),r([s({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],o.prototype,"title",void 0),r([s({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([s({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),r([s({type:[Fe]})],o.prototype,"types",void 0),r([s(ue)],o.prototype,"url",void 0),o=r([D("esri.layers.OGCFeatureLayer")],o);const Le=o;export{Le as default}; diff --git a/dist/assets/OGCFeatureLayerView3D-FLI41Ca4.js b/dist/assets/OGCFeatureLayerView3D-FLI41Ca4.js new file mode 100644 index 0000000..419cf3c --- /dev/null +++ b/dist/assets/OGCFeatureLayerView3D-FLI41Ca4.js @@ -0,0 +1 @@ +import{e as r,y as i,c as o,E as s}from"./index-J0iiHjMT.js";import{_ as m}from"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./LayerView3D-iOx2MD1g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";const l=p=>{let e=class extends p{get availableFields(){return this.layer.fieldsIndex.fields.map(a=>a.name)}};return r([i()],e.prototype,"layer",void 0),r([i({readOnly:!0})],e.prototype,"availableFields",null),e=r([o("esri.views.layers.OGCFeatureLayerView")],e),e};let t=class extends l(m){constructor(){super(...arguments),this.type="ogc-feature-3d"}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new s("layerview:spatial-reference-incompatible","The spatial references supported by this OGC layer are incompatible with the spatial reference of the view",{layer:this.layer})))}};r([i()],t.prototype,"layer",void 0),t=r([o("esri.views.3d.layers.OGCFeatureLayerView3D")],t);const q=t;export{q as default}; diff --git a/dist/assets/Object3DVisualElement-TMb7y_wl.js b/dist/assets/Object3DVisualElement-TMb7y_wl.js new file mode 100644 index 0000000..40db74b --- /dev/null +++ b/dist/assets/Object3DVisualElement-TMb7y_wl.js @@ -0,0 +1 @@ +import{bA as o,bC as i,bD as a,G as c,bE as n}from"./index-J0iiHjMT.js";import{t as h}from"./VisualElement-kjYXz27t.js";class _ extends h{constructor(e){super(e),this._resources=null,this._transform=o()}get object(){return this._resources!=null?this._resources.object:null}get transform(){return this._transform}set transform(e){i(this._transform,e),this._resources!=null&&(this._resources.object.transformation=this._transform)}recreate(){this.attached&&this.createResources()}recreateGeometry(){if(this._resources==null)return;const e=this._resources.object,s=this.view._stage;s.removeMany(e.geometries),e.removeAllGeometries(),this.createGeometries(e),e.visible=this.visible,s.addMany(e.geometries)}createResources(){this.destroyResources();const e=this.view._stage;if(!e)return;const s=new a(e,{pickable:!1,updatePolicy:c.SYNC}),r=new n({castShadow:!1});r.transformation=this._transform,this.createExternalResources(),this.createGeometries(r),e.addMany(r.geometries),this.forEachExternalMaterial(t=>e.add(t)),e.add(r),s.add(r),r.visible=this.visible,this._resources={layer:s,object:r}}destroyResources(){const e=this.view._stage;this._resources!=null&&e&&(e.remove(this._resources.object),this._resources.layer.destroy(),this.forEachExternalMaterial(s=>{e.remove(s)}),e.removeMany(this._resources.object.geometries),this._resources.object.dispose(),this.destroyExternalResources(),this._resources=null)}updateVisibility(e){this._resources!=null&&(this._resources.object.visible=e)}}export{_ as a}; diff --git a/dist/assets/OpenStreetMapLayer-6XrQQ-kN.js b/dist/assets/OpenStreetMapLayer-6XrQQ-kN.js new file mode 100644 index 0000000..eb8061f --- /dev/null +++ b/dist/assets/OpenStreetMapLayer-6XrQQ-kN.js @@ -0,0 +1 @@ +import{e as t,y as l,bR as a,e$ as s,c as i,T as p,ar as r,f0 as e,dT as c}from"./index-J0iiHjMT.js";import{I as u}from"./WebTileLayer-JxqArsF7.js";let o=class extends u{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new s({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:r.WebMercator}),spatialReference:r.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new c(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,r.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([l({type:a,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([l({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([l({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([l({type:s,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([l({type:["show","hide"]})],o.prototype,"listMode",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([l({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([l({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([l({json:{read:!1}})],o.prototype,"type",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([i("esri.layers.OpenStreetMapLayer")],o);const y=o;export{y as default}; diff --git a/dist/assets/OrderedLayer-M7k5gLgx.js b/dist/assets/OrderedLayer-M7k5gLgx.js new file mode 100644 index 0000000..c91e88f --- /dev/null +++ b/dist/assets/OrderedLayer-M7k5gLgx.js @@ -0,0 +1 @@ +import{dp as y,e as i,y as s,c as p,dr as f,dD as w}from"./index-J0iiHjMT.js";var c;const a=new y({asc:"ascending",desc:"descending"});let t=c=class extends f{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new c({field:this.field,valueExpression:this.valueExpression,order:this.order})}};i([s({type:String,json:{write:!0}})],t.prototype,"field",void 0),i([s({type:String,json:{write:!0}})],t.prototype,"valueExpression",void 0),i([s({type:a.apiValues,json:{read:a.read,write:a.write}})],t.prototype,"order",void 0),t=c=i([p("esri.layers.support.OrderByInfo")],t);const u=t;function v(e,r,o){if(!e)return null;const d=e.find(l=>!!l.field);if(!d)return null;const n=new u;return n.read(d,o),[n]}function g(e,r,o,d){const n=e.find(l=>!!l.field);n&&w(o,[n.toJSON()],r)}const h=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return i([s({type:[u],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:v},write:{target:"layerDefinition.orderBy",writer:g}}})],r.prototype,"orderBy",void 0),r=i([p("esri.layers.mixins.OrderedLayer")],r),r};export{h as c}; diff --git a/dist/assets/OrientedImageryLayer-LKoItije.js b/dist/assets/OrientedImageryLayer-LKoItije.js new file mode 100644 index 0000000..af7598b --- /dev/null +++ b/dist/assets/OrientedImageryLayer-LKoItije.js @@ -0,0 +1 @@ +import{e as t,y as e,c as x,p as q,dq as M,iB as A,dr as Y,dp as V,f6 as _,E as B}from"./index-J0iiHjMT.js";import Z from"./FeatureLayer--S4epFk-.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./queryZScale-IaMm02_2.js";import"./FeatureSet-d4S1oKME.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";import"./TopFeaturesQuery-E6D2tV-x.js";const G=[2155,2194,2204,2222,2223,2224,2225,2226,2227,2228,2229,2230,2231,2232,2233,2234,2235,2236,2237,2238,2239,2240,2241,2242,2243,2244,2245,2246,2247,2248,2249,2250,2251,2252,2253,2254,2255,2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266,2267,2268,2269,2270,2271,2272,2273,2274,2275,2276,2277,2278,2279,2280,2281,2282,2283,2284,2285,2286,2287,2288,2289,2314,2867,2868,2869,2870,2871,2872,2873,2874,2875,2876,2877,2878,2879,2880,2881,2882,2883,2884,2885,2886,2887,2888,2889,2890,2891,2892,2893,2894,2895,2896,2897,2898,2899,2900,2901,2902,2903,2904,2905,2906,2907,2908,2909,2910,2911,2912,2913,2914,2915,2916,2917,2918,2919,2920,2921,2922,2923,2924,2925,2926,2927,2928,2929,2930,2964,2965,2966,2967,2968,2992,2994,3080,3089,3091,3102,3359,3359,3361,3363,3365,3366,3404,3407,3417,3418,3419,3420,3421,3422,3423,3424,3425,3426,3427,3428,3429,3430,3431,3432,3433,3434,3435,3436,3437,3438,3441,3442,3443,3444,3445,3446,3451,3452,3453,3454,3455,3456,3457,3458,3459,3479,3481,3483,3485,3487,3490,3492,3494,3496,3498,3500,3502,3504,3506,3508,3510,3512,3515,3517,3519,3521,3523,3525,3527,3529,3531,3533,3535,3537,3539,3541,3543,3545,3547,3549,3551,3553,3560,3561,3562,3563,3564,3565,3566,3567,3568,3569,3570,3582,3584,3586,3588,3590,3593,3598,3600,3605,3608,3610,3612,3614,3616,3618,3620,3622,3624,3626,3628,3630,3632,3634,3636,3640,3642,3644,3646,3648,3650,3652,3654,3656,3658,3660,3662,3664,3668,3670,3672,3674,3676,3677,3679,3680,3682,3683,3686,3688,3690,3692,3696,3698,3700,3728,3729,3730,3731,3732,3733,3734,3735,3736,3737,3738,3739,3753,3754,3755,3756,3757,3758,3759,3760,3991,3992,4217,4399,4400,4401,4402,4403,4404,4405,4406,4407,4408,4409,4410,4411,4412,4413,4418,4419,4420,4421,4422,4423,4424,4425,4426,4427,4428,4429,4430,4431,4432,4433,4438,4439,4455,4456,4457,5466,5588,5589,5623,5624,5625,5646,5654,5655,6128,6129,6141,6200,6201,6202,6391,6405,6407,6409,6411,6413,6416,6418,6420,6422,6424,6426,6428,6430,6432,6434,6436,6438,6441,6443,6445,6447,6449,6451,6453,6455,6457,6459,6461,6463,6465,6467,6469,6471,6473,6475,6477,6479,6484,6486,6488,6490,6492,6494,6496,6499,6501,6503,6505,6507,6510,6515,6517,6519,6521,6523,6525,6527,6529,6531,6533,6535,6537,6539,6541,6543,6545,6547,6549,6551,6553,6555,6557,6559,6561,6563,6565,6568,6570,6572,6574,6576,6578,6582,6584,6586,6588,6590,6593,6595,6597,6599,6601,6603,6605,6607,6609,6612,6614,6616,6618,6625,6626,6627,6633,6785,6787,6789,6791,6793,6795,6797,6799,6801,6803,6805,6807,6809,6811,6813,6815,6817,6819,6821,6823,6825,6827,6829,6831,6833,6835,6837,6839,6841,6843,6845,6847,6849,6851,6853,6855,6857,6859,6861,6863,6868,6880,6885,6887,6923,6925,6966,6997,7057,7058,7059,7060,7061,7062,7063,7064,7065,7066,7067,7068,7069,7070,7119,7120,7121,7122,7123,7124,7125,7126,7127,7128,7132,7258,7260,7262,7264,7266,7268,7270,7272,7274,7276,7278,7280,7282,7284,7286,7288,7290,7292,7294,7296,7298,7300,7302,7304,7306,7308,7310,7312,7314,7316,7318,7320,7322,7324,7326,7328,7330,7332,7334,7336,7338,7340,7342,7344,7346,7348,7350,7352,7354,7356,7358,7360,7362,7364,7366,7368,7370,7558,7587,7588,7589,7590,7591,7592,7593,7594,7595,7596,7597,7598,7599,7600,7601,7602,7603,7604,7605,7606,7607,7608,7609,7610,7611,7612,7613,7614,7615,7616,7617,7618,7619,7620,7621,7622,7623,7624,7625,7626,7627,7628,7629,7630,7631,7632,7633,7634,7635,7636,7637,7638,7639,7640,7641,7642,7643,7644,7645,24100,26729,26730,26731,26732,26733,26734,26735,26736,26737,26738,26739,26740,26741,26742,26743,26744,26745,26746,26747,26748,26749,26750,26751,26752,26753,26754,26755,26756,26757,26758,26759,26760,26766,26767,26768,26769,26770,26771,26772,26773,26774,26775,26776,26777,26778,26779,26780,26781,26782,26783,26784,26785,26786,26787,26791,26792,26793,26794,26795,26796,26797,26798,26799,26801,26802,26803,26811,26812,26813,26814,26815,26819,26820,26821,26822,26825,26826,26830,26831,26832,26833,26836,26837,26841,26842,26843,26844,26847,26848,26849,26850,26851,26852,26853,26854,26855,26856,26857,26858,26859,26860,26861,26862,26863,26864,26865,26866,26867,26868,26869,26870,32001,32002,32003,32005,32006,32007,32008,32009,32010,32011,32012,32013,32014,32015,32016,32017,32018,32019,32020,32021,32022,32023,32024,32025,32026,32027,32028,32029,32030,32031,32033,32034,32035,32036,32037,32038,32039,32040,32041,32042,32043,32044,32045,32046,32047,32048,32049,32050,32051,32052,32053,32054,32055,32056,32057,32058,32064,32065,32066,32067,32074,32075,32076,32077,32099,32164,32165,32166,32167,32664,32665,32666,32667,65061,102120,102121,102629,102630,102631,102632,102633,102634,102635,102636,102637,102638,102639,102640,102641,102642,102643,102644,102645,102646,102648,102649,102650,102651,102652,102653,102654,102655,102656,102657,102658,102659,102660,102661,102662,102663,102664,102665,102666,102667,102668,102669,102670,102671,102672,102673,102674,102675,102676,102677,102678,102679,102680,102681,102682,102683,102684,102685,102686,102687,102688,102689,102690,102691,102692,102693,102694,102695,102696,102697,102698,102700,102704,102707,102708,102709,102710,102711,102712,102713,102714,102715,102716,102717,102718,102719,102720,102721,102722,102723,102724,102725,102726,102727,102728,102729,102730,102733,102734,102735,102736,102737,102738,102739,102740,102741,102742,102743,102744,102745,102746,102747,102748,102749,102750,102751,102752,102753,102754,102755,102756,102757,102758,102761,102766],J=[5614,5702,6130,6131,6132,6358,6359,6360],Q=[115700,4326];function k(o){return G.includes(o)?"feet":"meters"}function X(o,i){return typeof o=="number"?J.includes(o)?"feet":"meters":k(i)}function tt(o,i){return Q.includes(o)||i===4326?"ellipsoidal":"gravity-related-height"}let P=class extends q{get isAdvanced(){return!1}getInfo(){const{horizontalWKID:i,verticalWKID:a}=this;let n=i,p=a;const l=this;if(l.type===4){const{properties:j}=l;n=4326,p=j.verticalWKID}return{heightModel:tt(n,p),heightUnit:X(p,n),horizontalUnit:k(n)}}};t([e({json:{write:!0}})],P.prototype,"affineTransformations",void 0),t([e({json:{write:!0}})],P.prototype,"focalLength",void 0),t([e({json:{write:!0}})],P.prototype,"principalOffsetPoint",void 0),t([e({json:{write:!0}})],P.prototype,"radialDistortionCoefficients",void 0),t([e({json:{write:!0}})],P.prototype,"tangentialDistortionCoefficients",void 0),t([e({json:{write:!0}})],P.prototype,"horizontalWKID",void 0),t([e({json:{write:!0}})],P.prototype,"verticalWKID",void 0),t([e({json:{write:!0}})],P.prototype,"x",void 0),t([e({json:{write:!0}})],P.prototype,"y",void 0),t([e({json:{write:!0}})],P.prototype,"z",void 0),t([e({json:{write:!0}})],P.prototype,"type",void 0),P=t([x("esri.layers.orientedImagery.core.CameraOrientation")],P);const F=P;let h=class extends M(A(F)){constructor(){super(...arguments),this.type=1}get isAdvanced(){const{affineTransformations:i,focalLength:a,principalOffsetPoint:n,radialDistortionCoefficients:p,tangentialDistortionCoefficients:l}=this;return(i==null?void 0:i.length)>1||!Number.isNaN(a)||(n==null?void 0:n.length)>1||(p==null?void 0:p.length)>1||(l==null?void 0:l.length)>1}toString(){const{type:i,horizontalWKID:a,verticalWKID:n,x:p,y:l,z:j,heading:N,pitch:w,roll:D,affineTransformations:u,focalLength:b,principalOffsetPoint:f,radialDistortionCoefficients:d,tangentialDistortionCoefficients:m}=this,y=[i,a,n,p,l,j,N,w,D];return this.isAdvanced&&(u==null||u.forEach(r=>y.push(r)),y.push(b),f==null||f.forEach(r=>y.push(r)),d==null||d.forEach(r=>y.push(r)),m==null||m.forEach(r=>y.push(r))),y.map(r=>Number.isNaN(r)?"":r).join("|")}};t([e({json:{write:!0}})],h.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"heading",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"pitch",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"roll",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([x("esri.layers.orientedImagery.core.CameraOrientationHPR")],h);const et=h;let v=class extends M(A(F)){constructor(){super(...arguments),this.type=2}get isAdvanced(){const{affineTransformations:i,focalLength:a,principalOffsetPoint:n,radialDistortionCoefficients:p,tangentialDistortionCoefficients:l}=this;return(i==null?void 0:i.length)>1||!Number.isNaN(a)||(n==null?void 0:n.length)>1||(p==null?void 0:p.length)>1||(l==null?void 0:l.length)>1}toString(){const{type:i,horizontalWKID:a,verticalWKID:n,x:p,y:l,z:j,omega:N,phi:w,kappa:D,affineTransformations:u,focalLength:b,principalOffsetPoint:f,radialDistortionCoefficients:d,tangentialDistortionCoefficients:m}=this,y=[i,a,n,p,l,j,N,w,D];return this.isAdvanced&&(u==null||u.forEach(r=>y.push(r)),y.push(b),f==null||f.forEach(r=>y.push(r)),d==null||d.forEach(r=>y.push(r)),m==null||m.forEach(r=>y.push(r))),y.map(r=>isNaN(r)?"":r).join("|")}};t([e({json:{write:!0}})],v.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"omega",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"phi",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"kappa",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([x("esri.layers.orientedImagery.core.CameraOrientationOPK")],v);const ot=v;let g=class extends M(A(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:i,focalLength:a,principalOffsetPoint:n,radialDistortionCoefficients:p,tangentialDistortionCoefficients:l}=this;return(i==null?void 0:i.length)>1||!Number.isNaN(a)||(n==null?void 0:n.length)>1||(p==null?void 0:p.length)>1||(l==null?void 0:l.length)>1}toString(){const{type:i,horizontalWKID:a,verticalWKID:n,x:p,y:l,z:j,yaw:N,pitch:w,roll:D,affineTransformations:u,focalLength:b,principalOffsetPoint:f,radialDistortionCoefficients:d,tangentialDistortionCoefficients:m}=this,y=[i,a,n,p,l,j,N,w,D];return this.isAdvanced&&(u==null||u.forEach(r=>y.push(r)),y.push(b),f==null||f.forEach(r=>y.push(r)),f==null||f.forEach(r=>y.push(r)),d==null||d.forEach(r=>y.push(r)),m==null||m.forEach(r=>y.push(r))),y.map(r=>Number.isNaN(r)?"":r).join("|")}};t([e({json:{write:!0}})],g.prototype,"type",void 0),t([e({type:[Number],json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"focalLength",void 0),t([e({type:[Number],json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([e({type:[Number],json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([e({type:[Number],json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"yaw",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"pitch",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"roll",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"horizontalWKID",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"verticalWKID",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"x",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"y",void 0),t([e({type:Number,json:{write:!0}})],g.prototype,"z",void 0),g=t([x("esri.layers.orientedImagery.core.CameraOrientationYPR")],g);const it=g;let O=class extends Y{constructor(){super(...arguments),this.url=null}};t([e({type:Number,json:{write:!0}})],O.prototype,"lod",void 0),t([e({type:String,json:{write:!0}})],O.prototype,"rasterFunction",void 0),t([e({type:String,json:{write:!0}})],O.prototype,"url",void 0),O=t([x("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],O);let E=class extends Y{};t([e({type:Number,json:{write:!0}})],E.prototype,"constantElevation",void 0),E=t([x("esri.layers.orientedImagery.cor.ElevationSourceDefinitions.ConstantElevation")],E);const rt=o=>"constantElevation"in o;var I;(function(o){o[o.HPR=1]="HPR",o[o.OPK=2]="OPK",o[o.YPR=3]="YPR",o[o.LTP=4]="LTP"})(I||(I={}));function nt(o,i,a){return i&&(o=`${i}${o}`),a&&(o+=`${a}`),o}function at(o,i,a){let{url:n}=o;return n?(n=nt(n,i,a),new O({...o,url:n})):null}function st(o,i,a){return o&&(rt(o)?new E(o):at(o,i,a))}const R=new V({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),H=new V({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),U=new Map;U.set(`${I.OPK}`,{desc:"Using Omega Phi Kappa",constructor:ot}),U.set(`${I.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:et}),U.set(`${I.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:it});const W=new Map;function pt(o){const[i,a,n,p,l,j,N,w,D,u,b,f,d,m,y,r,$,S,C,z,K,L,T]=o;return{type:i,horizontalWKID:a,verticalWKID:n,x:p,y:l,z:j,omega:N,phi:w,kappa:D,affineTransformations:[u,b,f,d,m,y],focalLength:r,principalOffsetPoint:[$,S],radialDistortionCoefficients:[C,z,K],tangentialDistortionCoefficients:[L,T]}}function lt(o){const[i,a,n,p,l,j,N,w,D,u,b,f,d,m,y,r,$,S,C,z,K,L,T]=o;return{type:i,horizontalWKID:a,verticalWKID:n,x:p,y:l,z:j,heading:N,pitch:w,roll:D,affineTransformations:[u,b,f,d,m,y],focalLength:r,principalOffsetPoint:[$,S],radialDistortionCoefficients:[C,z,K],tangentialDistortionCoefficients:[L,T]}}function yt(o){const[i,a,n,p,l,j,N,w,D,u,b,f,d,m,y,r,$,S,C,z,K,L,T]=o;return{type:i,horizontalWKID:a,verticalWKID:n,x:p,y:l,z:j,yaw:N,pitch:w,roll:D,affineTransformations:[u,b,f,d,m,y],focalLength:r,principalOffsetPoint:[$,S],radialDistortionCoefficients:[C,z,K],tangentialDistortionCoefficients:[L,T]}}function ct(o){const[i,a,n,p,l,j,...N]=o,w=W.get(j);return w?{type:i,latitude:a,longitude:n,ellipsoidRadius:p,squaredEccentricity:l,properties:w([j,"",...N])}:null}W.set(`${I.HPR}`,lt),W.set(`${I.YPR}`,yt),W.set(`${I.OPK}`,pt),W.set(`${I.LTP}`,ct);function c(o,i,a){return{name:`orientedImageryProperties.${o}`,write:!i||{target:`orientedImageryProperties.${o}`,writer:i},origins:{service:{name:`orientedImageryInfo.orientedImageryProperties.${o}`,write:i,read:a}}}}let s=class extends Z{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.type="oriented-imagery",this.timeIntervalUnit=null,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null}get effectiveElevationSource(){const{elevationSource:o,demPathPrefix:i,demPathSuffix:a}=this;return st(o,i,a)}findFirstValidLayerId(o){var i,a;return(a=(i=o.layers)==null?void 0:i.find(n=>n.type==="Oriented Imagery Layer"))==null?void 0:a.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new B("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([e({type:Number,json:c("cameraHeading")})],s.prototype,"cameraHeading",void 0),t([e({type:Number,json:c("cameraHeight")})],s.prototype,"cameraHeight",void 0),t([e({type:Number,json:c("cameraPitch")})],s.prototype,"cameraPitch",void 0),t([e({type:Number,json:c("cameraRoll")})],s.prototype,"cameraRoll",void 0),t([e({type:Number,json:c("coveragePercent")})],s.prototype,"coveragePercent",void 0),t([e({type:String,json:c("demPathPrefix")})],s.prototype,"demPathPrefix",void 0),t([e({type:String,json:c("demPathSuffix")})],s.prototype,"demPathSuffix",void 0),t([e({type:String,json:c("depthImagePathPrefix")})],s.prototype,"depthImagePathPrefix",void 0),t([e({type:String,json:c("depthImagePathSuffix")})],s.prototype,"depthImagePathSuffix",void 0),t([e({type:Object,json:c("elevationSource")})],s.prototype,"elevationSource",void 0),t([e()],s.prototype,"effectiveElevationSource",null),t([e({type:Number,json:c("farDistance")})],s.prototype,"farDistance",void 0),t([e({json:{write:!0}})],s.prototype,"geometryType",void 0),t([e({type:Number,json:c("horizontalFieldOfView")})],s.prototype,"horizontalFieldOfView",void 0),t([e({type:String,json:c("horizontalMeasurementUnit")})],s.prototype,"horizontalMeasurementUnit",void 0),t([e({type:String,json:c("imagePathPrefix")})],s.prototype,"imagePathPrefix",void 0),t([e({type:String,json:c("imagePathSuffix")})],s.prototype,"imagePathSuffix",void 0),t([e({type:Number,json:c("imageRotation")})],s.prototype,"imageRotation",void 0),t([e({type:Number,json:c("maximumDistance")})],s.prototype,"maximumDistance",void 0),t([e({type:Number,json:c("nearDistance")})],s.prototype,"nearDistance",void 0),t([e({type:["OrientedImageryLayer"]})],s.prototype,"operationalLayerType",void 0),t([e({json:c("orientationAccuracy",(o,i)=>{o&&(i.orientationAccuracy=o.join(","))})}),_(o=>o?o.trim().split(",").map(Number):null)],s.prototype,"orientationAccuracy",void 0),t([e({json:{...c("orientedImageryType",H.write,H.read),type:H.apiValues}})],s.prototype,"orientedImageryType",void 0),t([e({json:{read:!1},value:"oriented-imagery",readOnly:!0})],s.prototype,"type",void 0),t([e({json:{...c("timeIntervalUnit",R.write,R.read),type:R.apiValues}})],s.prototype,"timeIntervalUnit",void 0),t([e({type:Number,json:c("verticalFieldOfView")})],s.prototype,"verticalFieldOfView",void 0),t([e({json:{...c("verticalMeasurementUnit"),type:new V({Feet:"feet",Meter:"meter"}).apiValues}})],s.prototype,"verticalMeasurementUnit",void 0),t([e({type:String,json:c("videoPathPrefix")})],s.prototype,"videoPathPrefix",void 0),t([e({type:String,json:c("videoPathSuffix")})],s.prototype,"videoPathSuffix",void 0),s=t([x("esri.layers.OrientedImageryLayer")],s);const Lt=s;export{Lt as default}; diff --git a/dist/assets/PBFDecoderWorker--NqrOA1Y.js b/dist/assets/PBFDecoderWorker--NqrOA1Y.js new file mode 100644 index 0000000..2d86b0d --- /dev/null +++ b/dist/assets/PBFDecoderWorker--NqrOA1Y.js @@ -0,0 +1 @@ +import{k3 as d,dB as c,ar as p,dw as f,i_ as y,eT as _,k4 as m,k5 as g,k6 as P}from"./index-J0iiHjMT.js";import{t as C}from"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";function b(o,e){return e}function l(o,e,t,r){switch(t){case 0:return h(o,e+r,0);case 1:return o.originPosition==="lowerLeft"?h(o,e+r,1):v(o,e+r,1)}}function u(o,e,t,r){return t===2?h(o,e,2):l(o,e,t,r)}function G(o,e,t,r){return t===2?h(o,e,3):l(o,e,t,r)}function k(o,e,t,r){return t===3?h(o,e,3):u(o,e,t,r)}function h({translate:o,scale:e},t,r){return o[r]+t*e[r]}function v({translate:o,scale:e},t,r){return o[r]-t*e[r]}class M{constructor(e){this._options=e,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=b,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return new d}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const t=c(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(t!=null)for(const r of e.features)t(r.geometry)}createSpatialReference(){return new p}addField(e,t){e.fields.push(f.fromJSON(t));const r=e.fields.map(s=>s.name);this._attributesConstructor=function(){for(const s of r)this[s]=null}}addFeature(e,t){const r=this._options.maxStringAttributeLength??0;if(r>0)for(const s in t.attributes){const i=t.attributes[s];typeof i=="string"&&i.length>r&&(t.attributes[s]="")}e.features.push(t)}addQueryGeometry(e,t){const{queryGeometry:r,queryGeometryType:s}=t,i=y(r.clone(),r,!1,!1,this._transform),a=_(i,s,!1,!1);let n=null;switch(s){case"esriGeometryPoint":n="point";break;case"esriGeometryPolygon":n="polygon";break;case"esriGeometryPolyline":n="polyline";break;case"esriGeometryMultipoint":n="multipoint"}a.type=n,e.queryGeometryType=s,e.queryGeometry=a}prepareFeatures(e){switch(this._transform=e.transform??null,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"point":this.addCoordinate=(t,r,s)=>this.addCoordinatePoint(t,r,s),this.createGeometry=t=>this.createPointGeometry(t);break;case"polygon":this.addCoordinate=(t,r,s)=>this._addCoordinatePolygon(t,r,s),this.createGeometry=t=>this._createPolygonGeometry(t);break;case"polyline":this.addCoordinate=(t,r,s)=>this._addCoordinatePolyline(t,r,s),this.createGeometry=t=>this._createPolylineGeometry(t);break;case"multipoint":this.addCoordinate=(t,r,s)=>this._addCoordinateMultipoint(t,r,s),this.createGeometry=t=>this._createMultipointGeometry(t);break;case"mesh":case"extent":break;default:m(e.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new g(P(),null,new this._attributesConstructor)}allocateCoordinates(){const e=this._lengths.reduce((t,r)=>t+r,0);this._coordinateBuffer=new Float64Array(e*this._vertexDimension),this._coordinateBufferPtr=0}addLength(e,t){this._lengths.length===0&&(this._toAddInCurrentPath=t),this._lengths.push(t)}createPointGeometry(e){const t={type:"point",x:0,y:0,spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM};return t.hasZ&&(t.z=0),t.hasM&&(t.m=0),t}addCoordinatePoint(e,t,r){const s=this._transform?this._applyTransform(this._transform,t,r,0):t;if(s!=null)switch(r){case 0:e.x=s;break;case 1:e.y=s;break;case 2:e.hasZ?e.z=s:e.m=s;break;case 3:e.m=s}}_transformPathLikeValue(e,t){let r=0;return t<=1&&(r=this._previousCoordinate[t],this._previousCoordinate[t]+=e),this._transform?this._applyTransform(this._transform,e,t,r):e}_addCoordinatePolyline(e,t,r){this._dehydratedAddPointsCoordinate(e.paths,t,r)}_addCoordinatePolygon(e,t,r){this._dehydratedAddPointsCoordinate(e.rings,t,r)}_addCoordinateMultipoint(e,t,r){r===0&&e.points.push([]);const s=this._transformPathLikeValue(t,r);e.points[e.points.length-1].push(s)}_createPolygonGeometry(e){return{type:"polygon",rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{type:"polyline",paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{type:"multipoint",points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,t,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(t,r),i=e[e.length-1],a=this._coordinateBuffer;if(a){if(r===0){const n=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;i.push(new Float64Array(a.buffer,n,this._vertexDimension))}a[this._coordinateBufferPtr++]=s}}_deriveApplyTransform(e){const{hasZ:t,hasM:r}=e;return t&&r?k:t?u:r?G:l}}class T{_parseFeatureQuery(e){var s;const t=C(e.buffer,new M(e.options)),r={...t,spatialReference:(s=t.spatialReference)==null?void 0:s.toJSON(),fields:t.fields?t.fields.map(i=>i.toJSON()):void 0};return Promise.resolve(r)}}function A(){return new T}export{A as default}; diff --git a/dist/assets/Pipeline--6jAENf8.js b/dist/assets/Pipeline--6jAENf8.js new file mode 100644 index 0000000..300e354 --- /dev/null +++ b/dist/assets/Pipeline--6jAENf8.js @@ -0,0 +1,22 @@ +import{de as Ye,Z as ae,c4 as ye,vd as Ee,dJ as b,ve as Ss,e_ as D,eT as $e,dy as ws,vf as Ts,vg as Fs,iZ as Xe,eh as _t,K as ke,vh as As,gc as Cs,ol as ss,eQ as H,gd as Ms,l4 as oe,vi as Es,i_ as rs,E as V,eZ as mt,r0 as is,vj as as,vk as $s,bH as yt,nW as He,e3 as ns,jP as ks,k as It,ao as Pe,dv as os,ev as Us,vl as Rs,ca as Ds,vm as Bs,vn as lt,s as P,f as Ie,bW as Os,e as k,c as Je,uA as qs,mo as hs,y as O,p as xt,fv as Ls,ge as zs,qQ as ct,vo as us,vp as ds,uU as Gs,vq as X,kk as Ue,kl as Re,bm as Ps,ar as ie,r8 as bt,vr as js,ej as ls,mL as re,l as cs,dT as vt,e4 as gs,vs as Ns,F as Qs,d as Ve,eR as Ys,w as De,pa as ps,ae as Xs,u1 as Hs,vt as Vs,vu as Zs,al as Js,uN as Ws,e$ as Ks}from"./index-J0iiHjMT.js";import{j as xe,x as fs,W as Dt}from"./QueryEngine-8tLWlkSE.js";import{t as St,o as er}from"./StreamFeatureManager-QrKJ84_c.js";import{f as tr}from"./quickselect-UFB0jJTZ.js";import{m as Be,n as Bt,b as Ot}from"./TimeOnly-ljWtUK7N.js";import{a as sr,l as rr}from"./labelPoint-ysDT9nFH.js";import{v as qt}from"./ogcFeatureUtils-dtzP0u64.js";import{d as ir,c as Lt}from"./query-rG0aX6cE.js";import{r as ar}from"./pbf-o0zzptPp.js";import{b as nr,h as or}from"./pbfQueryUtils-pWizwTQZ.js";import{createConnection as hr}from"./createConnection-4ppGVnSc.js";import{V as ur,W as dr,S as lr,a as zt,Q as cr,R as gr,c as j}from"./definitions-DqQMJYPH.js";import{E as Se,S as Oe}from"./enums-uQoFEhYh.js";import"./number-sTjsTbdA.js";import{X as pr,b as Ze,Y as je}from"./geohashUtils-U0jvYCSY.js";function fr(i){return i==="heatmap"?Ye(()=>import("./HeatmapProcessor-QI9jD0nx.js"),__vite__mapDeps([0,1,2,3,4])):Ye(()=>import("./SymbolProcessor-pXDjnfSh.js").then(e=>e.S),__vite__mapDeps([5,1,2,6,7,8,3,9,10,11,4,12,13,14]))}function be(i,e){if(!(this instanceof be))return new be(i,e);this._maxEntries=Math.max(4,i||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&(typeof e=="function"?this.toBBox=e:this._initFormat(e)),this.clear()}function _r(i,e,t){if(!t)return e.indexOf(i);for(var s=0;s=i.minX&&e.maxY>=i.minY}function ge(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function jt(i,e,t,s,r){for(var a,n=[e,t];n.length;)(t=n.pop())-(e=n.pop())<=s||(a=e+Math.ceil((t-e)/s/2)*s,tr(i,a,e,t,r),n.push(e,a,a,t))}be.prototype={all:function(){return this._all(this.data,[])},search:function(i){var e=this.data,t=[],s=this.toBBox;if(!Le(i,e))return t;for(var r,a,n,o,h=[];e;){for(r=0,a=e.children.length;r=0&&a[e].children.length>this._maxEntries;)this._split(a,e),e--;this._adjustParentBBoxes(r,a,e)},_split:function(i,e){var t=i[e],s=t.children.length,r=this._minEntries;this._chooseSplitAxis(t,r,s);var a=this._chooseSplitIndex(t,r,s),n=ge(t.children.splice(a,t.children.length-a));n.height=t.height,n.leaf=t.leaf,de(t,this.toBBox),de(n,this.toBBox),e?i[e-1].children.push(n):this._splitRoot(t,n)},_splitRoot:function(i,e){this.data=ge([i,e]),this.data.height=i.height+1,this.data.leaf=!1,de(this.data,this.toBBox)},_chooseSplitIndex:function(i,e,t){var s,r,a,n,o,h,u,d;for(h=u=1/0,s=e;s<=t-e;s++)n=yr(r=Ae(i,0,s,this.toBBox),a=Ae(i,s,t,this.toBBox)),o=et(r)+et(a),n=e;r--)a=i.children[r],Ce(h,i.leaf?n(a):a),u+=qe(h);return u},_adjustParentBBoxes:function(i,e,t){for(var s=t;s>=0;s--)Ce(e[s],i)},_condense:function(i){for(var e,t=i.length-1;t>=0;t--)i[t].children.length===0?t>0?(e=i[t-1].children).splice(e.indexOf(i[t]),1):this.clear():de(i[t],this.toBBox)},_initFormat:function(i){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(i[0])),this.compareMinY=new Function("a","b",e.join(i[1])),this.toBBox=new Function("a","return {minX: a"+i[0]+", minY: a"+i[1]+", maxX: a"+i[2]+", maxY: a"+i[3]+"};")}};function Ir(i,e,t){var r;if(i==null)return null;const s=e.readArcadeFeature();e.contextTimeZone=(r=t.$view)==null?void 0:r.timeZone;try{return i.evaluate({...t,$feature:s},i.services)}catch(a){return ae.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",a),null}}let wt=class{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=t,this._bitsets={computed:t.getBitset(t.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const s=ye(this._schema,t);if(this._schema=t,!t||s==null||!Ee(s,"attributes"))return;b("esri-2d-update-debug")&&console.debug("Applying Update - Store:",s),this._bitsets.computed.clear(),e.targets[t.name]=!0;const r=t.attributes,a=[],n=[];for(const o in r){const h=r[o];switch(h.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(h));break;case"label-expression":a.push(this._createLabelArcadeComputedField(h));break;case"statistic":n.push(h)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some(o=>o.type==="expression"&&o.expression!=null&&o.expression.referencesScale()),this._statisticFields=n}setComputedAttributes(e,t,s,r,a){const n=this._bitsets.computed;if(!this._canCacheExpressionValue||!n.has(s)){n.set(s);for(const o of this._computedFields){const h=this._evaluateField(t,o,r,a);switch(o.resultType){case"numeric":e.setComputedNumericAtIndex(s,o.fieldIndex,h);break;case"string":e.setComputedStringAtIndex(s,o.fieldIndex,h)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex;return{...e,expression:await Ss(e.valueExpression,t,s)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,s=this._sourceInfo.fieldsIndex,{createLabelFunction:r}=await Ye(()=>import("./index-J0iiHjMT.js").then(n=>n.zG),__vite__mapDeps([1,2])),a=await r(e.label,s,t);return{...e,builder:a}}_evaluateField(e,t,s,r){switch(t.type){case"label-expression":{const a=e.readArcadeFeature();return t.builder.evaluate(a,r)||""}case"expression":{const{expression:a}=t;return Ir(a,e,{$view:{scale:s,timeZone:r}})}}}},_s=class Ne{static fromBuffer(e,t){return new Ne(e,t)}static create(e,t=4294967295){const s=new Uint32Array(Math.ceil(e/32));return new Ne(s,t)}constructor(e,t){this._mask=0,this._buf=e,this._mask=t}_getIndex(e){return Math.floor(e/32)}has(e){const t=this._mask&e;return!!(this._buf[this._getIndex(t)]&1<>>=1,r++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},we=0;const We=b("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],xr=We[0],br=We[1],vr=We[2],Sr=We[3],Tt=b("featurelayer-simplify-payload-size-factors")??[1,2,4],wr=Tt[0],Tr=Tt[1],Fr=Tt[2],Ar=b("featurelayer-simplify-mobile-factor")??2,Cr=b("esri-mobile");let ve=class{constructor(e,t){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",this.seen=!1,this.instance=0,this._tx=0,this._ty=0,this._sx=1,this._sy=1,this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._contextTimeZone=null,this._level=0,this.instance=e,this._layerSchema=t}static createInstance(){return we++,we=we>65535?0:we,we}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}set level(e){this._level=e}getAreaSimplificationThreshold(e,t){let s=1;const r=Cr?Ar:1;t>4e6?s=Fr*r:t>1e6?s=Tr*r:t>5e5?s=wr*r:t>1e5&&(s=r);let a=0;e>4e3?a=Sr*s:e>2e3?a=vr*s:e>100?a=br:e>15&&(a=xr);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),a*n}createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new D([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new D([2],[e-1,t+1,1,-1])}parseTimestampOffset(e){return e}setArcadeSpatialReference(e){this._arcadeSpatialReference=e}attachStorage(e){this._storage=e}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(e){return this.getComputedNumericAtIndex(0)}setComputedNumeric(e,t){return this.setComputedNumericAtIndex(t,0)}getComputedString(e){return this.getComputedStringAtIndex(0)}setComputedString(e,t){return this.setComputedStringAtIndex(0,t)}getComputedNumericAtIndex(e){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),e)}setComputedNumericAtIndex(e,t){this._storage.setComputedNumericAtIndex(this.getDisplayId(),e,t)}getComputedStringAtIndex(e){return this._storage.getComputedStringAtIndex(this.getDisplayId(),e)}setComputedStringAtIndex(e,t){return this._storage.setComputedStringAtIndex(this.getDisplayId(),e,t)}transform(e,t,s,r){const a=this.copy();return a._tx+=e,a._ty+=t,a._sx*=s,a._sy*=r,a}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const s=this._readAttribute(e,t);if(s!==void 0)return s;for(const r of this._joined){r.setIndex(this.getIndex());const a=r._readAttribute(e,t);if(a!==void 0)return a}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const s=t._readAttributes();for(const r of Object.keys(s))e[r]=s[r]}return e}joinAttributes(e){this._joined.push(e)}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)}geometry(){const e=this.readHydratedGeometry(),t=$e(e,this.geometryType,this.hasZ,this.hasM),s=ws(t);return s&&(s.spatialReference=this._arcadeSpatialReference),s}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?Be.unknownDateJSToArcadeDate(t):Be.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??Ts):t}isUnknownDateTimeField(e){return this._layerSchema.fieldsIndex.getTimeZone(e)===Fs}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Ot.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return Bt.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return Be.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const s of this._joined)if(s.setIndex(this.getIndex()),t=s.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Ot.fromReader(s._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return Bt.fromReader(s._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return Be.fromReaderAsTimeStampOffset(s._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,s._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeature());const t=this.readLegacyFeature();if(!t)return JSON.stringify(null);const s={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const r in s.attributes){const a=s.attributes[r];a instanceof Date&&(s.attributes[r]=a.getTime())}return JSON.stringify(s)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(e=null){var t;return{attributes:this._readAttributes(),geometry:(e==null?void 0:e.keepGeometryType)===!0?this.geometry():((t=this.geometry())==null?void 0:t.toJSON())??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}removeIds(e){if(this._objectIdToIndex==null){const s=new Map,r=this.getCursor();for(;r.next();){const a=r.getObjectId();Xe(a),s.set(a,r.getIndex())}this._objectIdToIndex=s}const t=this._objectIdToIndex;for(const s of e)t.has(s)&&this.removeAtIndex(t.get(s))}removeAtIndex(e){this._deleted==null&&(this._deleted=_s.create(this.getSize())),this._deleted.set(e)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const e=this.getCursor();for(;e.next();)yield e.readOptimizedFeature()}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeCentroid(){if(this.geometryType!=="esriGeometryPolygon")return null;const e=this.readUnquantizedGeometry();if(!e||e.hasIndeterminateRingOrder)return null;const t=sr.fromOptimized(e,this.geometryType);t.yFactor*=-1;const s=rr(t);return s?(s[1]*=-1,new D([],s)):null}copyInto(e){e.seen=this.seen,e._storage=this._storage,e._arcadeSpatialReference=this._arcadeSpatialReference,e._joined=this._joined,e._tx=this._tx,e._ty=this._ty,e._sx=this._sx,e._sy=this._sy,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e.contextTimeZone=this.contextTimeZone}},ms=class gt extends ve{static from(e,t){return new gt(e.copy(),t)}constructor(e,t){super(ve.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=t}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1>>16}function Fe(i){return 65535&i}const Ft={getObjectId:i=>i.getObjectId(),getAttributes:i=>i.readAttributes(),getAttribute:(i,e)=>i.readAttribute(e),getAttributeAsTimestamp:(i,e)=>i.readAttributeAsTimestamp(e),cloneWithGeometry:(i,e)=>i,getGeometry:i=>i.readHydratedGeometry(),getCentroid:(i,e)=>i.readCentroid()};let Mr=class extends wt{constructor(e,t,s){super(e,t),this.featureAdapter=Ft,this.events=new ke,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new St(50),this._index=be(9,r=>({minX:this._storage.getXMin(r),minY:this._storage.getYMin(r),maxX:this._storage.getXMax(r),maxY:this._storage.getYMax(r)})),this.mode=s}get storeStatistics(){let e=0,t=0,s=0;return this.forEach(r=>{const a=r.readGeometry();a&&(t+=a.isPoint?1:a.lengths.reduce((n,o)=>n+o,0),s+=a.isPoint?1:a.lengths.length,e+=1)}),{featureCount:e,vertexCount:t,ringCount:s}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t,s){if(t.addOrUpdate==null)return t;if(t.addOrUpdate.attachStorage(this._storage),this.mode==="snapshot"){const a=t.addOrUpdate.getCursor();for(;a.next();){const n=a.getDisplayId();this.setComputedAttributes(this._storage,a,n,e.scale,s)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const r=t.addOrUpdate.getCursor();for(;r.next();)this._insertFeature(r,e.scale,s);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,s=this._indexSearchCache.find(o=>o.tileId===t);if(s!=null)return s.readers;const r=new Map,a=this._searchIndex(e.bounds),n=[];for(const o of a){const h=this._storage.getInstanceId(o),u=Te(h),d=Fe(h);r.has(u)||r.set(u,[]),r.get(u).push(d)}return r.forEach((o,h)=>{const u=this._featureSetsByInstance.get(h);n.push(ms.from(u,o))}),this._indexSearchCache.enqueue({tileId:t,readers:n}),n}insert(e){const t=e.getCursor(),s=this._storage;for(;t.next();){const r=Qt(t.instance,t.getIndex()),a=t.getObjectId(),n=this._objectIdToDisplayId.get(a)??this._storage.createDisplayId();t.setDisplayId(n),s.setInstanceId(n,r),this._objectIdToDisplayId.set(a,n)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const s=this._storage.getInstanceId(t),r=Fe(s),a=Te(s),n=this._featureSetsByInstance.get(a);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),n.removeAtIndex(r),n.isEmpty&&this._featureSetsByInstance.delete(a),this._spatialIndexInvalid=!0}forEach(e){this._objectIdToDisplayId.forEach(t=>{const s=this._storage.getInstanceId(t),r=this._lookupFeature(s);e(r)})}forEachUnsafe(e){this._objectIdToDisplayId.forEach(t=>{const s=this._storage.getInstanceId(t),r=Te(s),a=Fe(s),n=this._getFeatureSet(r);n.setIndex(a),e(n)})}forEachInBounds(e,t){const s=this._searchIndex(e);for(const r of s)t(this.lookupFeatureByDisplayId(r,this._storage))}forEachBounds(e,t){this._rebuildIndex();for(const s of e){if(!s.readGeometry())continue;const r=s.getDisplayId();As(Nt,this._storage.getXMin(r),this._storage.getYMin(r),this._storage.getXMax(r),this._storage.getYMax(r)),t(Nt)}}sweepFeatures(e,t,s){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach((r,a)=>{e.has(r)||(t.releaseDisplayId(r),s&&s.unsetAttributeData(r),this._objectIdToDisplayId.delete(a))}),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach((t,s)=>{e.has(s)||this._featureSetsByInstance.delete(s)})}lookupObjectId(e,t){const s=this.lookupFeatureByDisplayId(e,t);return s==null?null:s.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const s=t.getInstanceId(e);return this._lookupFeature(s)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),s=Te(t),r=Fe(t),a=this._getFeatureSet(s);return a?(a.setIndex(r),a):null}_insertFeature(e,t,s){const r=this._storage,a=e.getObjectId(),n=Qt(e.instance,e.getIndex());r.getInstanceId(e.getDisplayId());let o=this._objectIdToDisplayId.get(a);o||(o=r.createDisplayId(),this._objectIdToDisplayId.set(a,o),this._spatialIndexInvalid=!0),e.setDisplayId(o),r.setInstanceId(o,n),this.setComputedAttributes(r,e,o,t,s)}_searchIndex(e){this._rebuildIndex();const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}_rebuildIndex(){if(!this._spatialIndexInvalid)return;const e=[];this.mode==="snapshot"?this._featureSetsByInstance.forEach(t=>{const s=t.getCursor();for(;s.next();){const r=s.getDisplayId();this._storage.setBounds(r,s)&&e.push(r)}}):this._objectIdToDisplayId.forEach(t=>{const s=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(s))&&e.push(t)}),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=Te(e),s=this._getFeatureSet(t);if(!s)return;const r=s.getCursor(),a=Fe(e);return r.setIndex(a),r}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}};function Er({coords:i,lengths:e}){let t=0;for(const s of e){for(let r=1;r!(s.objectId!=null&&t.has(s.objectId)))}append(e){for(const t of e)this._features.push(t)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){var e;return(e=this._current)==null?void 0:e.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}getGroupId(){return this._current.groupId}setGroupId(e){this._current.groupId=e}copy(){const e=new pe(this.instance,this._features,this.fullSchema());return this.copyInto(e),e}next(){for(;++this._featureIndex0}let qr=class pt extends ve{static fromBuffer(e,t,s=!1){const r=t.geometryType,a=Rr(e),n=kr(a,r==="esriGeometryPoint",s),o=ve.createInstance();return new pt(o,a,n,t)}constructor(e,t,s,r){super(e,r),this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0,centroid:void 0,legacyFeature:void 0,optFeature:void 0},this._geometryType=r.geometryType,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get _size(){return this._header.featureCount}get hasZ(){return!1}get hasM(){return!1}get stride(){return 2+(this.hasZ?1:0)+(this.hasM?1:0)}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getQuantizationTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}getGroupId(){return this._header.groupIds[this._featureIndex]}setGroupId(e){this._header.groupIds[this._featureIndex]=e}readLegacyFeature(){if(this._cache.legacyFeature===void 0){const e=this.readCentroid(),t={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null};return this._cache.legacyFeature=t,t}return this._cache.legacyFeature}readOptimizedFeature(){if(this._cache.optFeature===void 0){const e=new mt(this.readGeometry(),this.readAttributes(),this.readCentroid());return e.objectId=this.getObjectId(),e.displayId=this.getDisplayId(),this._cache.optFeature=e,e}return this._cache.optFeature}getXHydrated(){const e=this._header.centroid[2*this._featureIndex],t=this.getQuantizationTransform();return t==null?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return t==null?e:t.translate[1]-e*t.scale[1]}getX(){return this._header.centroid[2*this._featureIndex]*this._sx+this._tx}getY(){return this._header.centroid[2*this._featureIndex+1]*this._sy+this._ty}readLegacyPointGeometry(){return{x:this.getX(),y:this.getY()}}readLegacyGeometry(e){const t=this.readUnquantizedGeometry(e);return $e(t,this.geometryType,!1,!1)}readLegacyCentroid(){const e=this.readCentroid();if(!e)return null;const[t,s]=e.coords;return{x:t,y:s}}readGeometryArea(){return this._cache.area||this.readGeometry(!0),this._cache.area}readUnquantizedGeometry(e=!1){if(this._cache.unquantGeometry===void 0){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const s=Ht(t.coords.length).decoded,r=t.clone(s),a=r.coords;let n=0;for(const o of r.lengths){for(let h=1;hl.length)for(let f=0;f=f?(c+=-.5*(T-m)*(C+I),y>1&&it(l[d-2],l[d-1],v,w)?(l[d-2]+=v,l[d-1]+=w):(l[d++]=v,l[d++]=w,y++),m=T,I=C):(M+=v,F+=w),v=M,w=F,x++}y<3||S?d-=2*y:(c+=-.5*(m+v-m)*(I+w+I),it(l[d-2],l[d-1],v,w)?(l[d-2]+=v,l[d-1]+=w,h.push(y)):(l[d++]=v,l[d++]=w,h.push(++y)))}else{let f=0,x=r.getSInt32(),y=r.getSInt32();this.hasZ&&r.getSInt32(),this.hasM&&r.getSInt32(),l[d++]=x,l[d++]=y,f+=1;for(let S=1;S2&&it(l[d-2],l[d-1],m,I)?(l[d-2]+=m,l[d-1]+=I):(l[d++]=m,l[d++]=I,f+=1),x=v,y=w}h.push(f)}break}default:r.skip()}if(this._cache.area=c,!h.length)return null;if(this._tx||this._ty){let _=0;Xe(l);for(const p of h)l[2*_]+=this._tx,l[2*_+1]+=this._ty,_+=p}return new D(h,l)}},Ke=class{constructor(e){this.service=e,this._arcadeLayerSchema={...e,fieldsIndex:H.fromJSON(e.fieldsIndex)}}destroy(){}};function Lr(i){return Array.isArray(i.source)}function zr(i){return(i==null?void 0:i.type)==="ogc-source"}function Gr(i){const{capabilities:e}=i;return zr(i.source)?new Yr(i):Lr(i)?new jr(i):e.query.supportsFormatPBF&&b("featurelayer-pbf")?new Nr(i):new Qr(i)}async function Pr(i){const e=new $s;return await e.open(i,{}),e}let jr=class extends Ke{constructor(e){super(e),this._portsOpen=Pr(e.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(e,t){await this._portsOpen;const s=await this.client.invoke("queryFeatures",e.toJSON(),t);return G.fromFeatureSet(s,this._arcadeLayerSchema)}},Nr=class extends Ke{async executeQuery(e,t){const{data:s}=await ir(this.service.source,e,t),r=!e.quantizationParameters;return qr.fromBuffer(s,this._arcadeLayerSchema,r)}},Qr=class extends Ke{async executeQuery(e,t){var u;const{source:s,capabilities:r,spatialReference:a,objectIdField:n,geometryType:o}=this.service;if(e.quantizationParameters!=null&&!r.query.supportsQuantization){const d=e.clone(),l=is(d.quantizationParameters);d.quantizationParameters=null;const{data:c}=await Lt(s,d,a,t),g=ss(c,n);return as(l,g),G.fromOptimizedFeatureSet(g,this._arcadeLayerSchema)}const{data:h}=await Lt(s,e,this.service.spatialReference,t);return o==="esriGeometryPoint"&&(h.features=(u=h.features)==null?void 0:u.filter(d=>{if(d.geometry!=null){const l=d.geometry;return Number.isFinite(l.x)&&Number.isFinite(l.y)}return!0})),G.fromFeatureSet(h,this._arcadeLayerSchema)}},Yr=class extends Ke{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const a=e.clone(),n=is(a.quantizationParameters);a.quantizationParameters=null;const o=await qt(this.service.source,e,t);return as(n,o),G.fromOptimizedFeatureSet(o,this._arcadeLayerSchema)}const r=await qt(this.service.source,e,t);return G.fromOptimizedFeatureSet(r,this._arcadeLayerSchema)}},z=class Qe{constructor(){this.version=0,this.source=!1,this.targets={feature:!1,aggregate:!1},this.storage={filters:!1,data:!1},this.mesh=!1,this.queryFilter=!1,this.why={mesh:[],source:[]}}static create(e){const t=new Qe;let s;for(s in e){const r=e[s];if(typeof r=="object")for(const a in r){const n=a,o=r[n];t[s][n]=o}t[s]=r}return t}static empty(){return Qe.create({})}static all(){return Qe.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,e.source&&(this.source=!1),e.targets.feature&&(this.targets.feature=!1),e.targets.aggregate&&(this.targets.aggregate=!1),e.storage.filters&&(this.storage.filters=!1),e.storage.data&&(this.storage.data=!1),e.mesh&&(this.mesh=!1),e.queryFilter&&(this.queryFilter=!1)}any(){return this.source||this.mesh||this.storage.filters||this.storage.data||this.targets.feature||this.targets.aggregate||this.queryFilter}describe(){let e=0,t="";if(this.mesh){e+=20,t+=`-> (20) Mesh needs update +`;for(const r of this.why.mesh)t+=` + ${r} +`}if(this.source){e+=10,t+=`-> (10) The source needs update +`;for(const r of this.why.source)t+=` + ${r} +`}this.targets.feature&&(e+=5,t+=`-> (5) Feature target parameters changed +`),this.storage.filters&&(e+=5,t+=`-> (5) Feature filter parameters changed +`),this.targets.aggregate&&(e+=4,t+=`-> (4) Aggregate target parameters changed +`),this.storage.data&&(e+=1,t+="-> (1) Texture storage parameters changed");const s=e<5?"Fastest":e<10?"Fast":e<15?"Moderate":e<20?"Slow":"Very Slow";console.debug(`Applying ${s} update of cost ${e}/45 `),console.debug(t)}toJSON(){return{queryFilter:this.queryFilter,source:this.source,targets:this.targets,storage:this.storage,mesh:this.mesh}}},Xr=class{constructor(e,t){this.requests={done:new Array,stream:new St(10)},this._edits=null,this._abortController=new AbortController,this._version=0,this._isDone=!1,this.didSend=!1,this.tile=e,this._version=t,this._resolver=yt(),this._resolver.promise.catch(s=>He(s))}get signal(){return this._abortController.signal}get options(){return{signal:this._abortController.signal}}get empty(){return!this.requests.done.length&&this.edits==null}get edits(){return this._edits}get done(){return this._resolver.promise}get isDone(){return this._isDone}resolve(){this._isDone=!0,this._resolver.resolve()}clear(){this.requests.done=[]}applyUpdate(e){this.requests.done.forEach(t=>t.message.status.unset(e)),this._version=e.version,this._edits!=null&&this._edits.status.unset(e)}add(e){e.message.status=e.message.status??z.empty(),e.message.status.version=this._version,b("esri-2d-update-debug")&&console.debug(this.tile.id,"DataTileSubscription:add",this._version),e.message.end&&(this.requests.done.forEach(t=>{t.message!=null&&t.message.end&&(t.message.end=!1)}),this._resolver.resolve(),this._isDone=!0),this.requests.done.push(e)}edit(e,t){const s=e.getQuantizationTransform(),r=e.fullSchema(),a=Array.from(e.features()).filter(ns),n=[...t,...a.map(o=>o.objectId)];if(this.removeIds(n),this._invalidate(),this._edits==null)return void(this._edits={type:"append",addOrUpdate:G.fromOptimizedFeatures(a,r,s),id:this.tile.id,status:z.empty(),end:!0});this.requests.done.forEach(o=>o.message.end=!1),this._edits.addOrUpdate.append(e.features())}*readers(){var e;for(const{message:t}of this.requests.done)t.addOrUpdate!=null&&(yield t.addOrUpdate);((e=this._edits)==null?void 0:e.addOrUpdate)!=null&&(yield this._edits.addOrUpdate)}_invalidate(){for(const e of this.requests.done)e.message.status=z.empty();this._edits!=null&&(this._edits.status=z.empty())}removeIds(e){var t;this._invalidate();for(const{message:s}of this.requests.done){const r=s.addOrUpdate;r!=null&&(r.removeIds(e),r.isEmpty&&(b("esri-2d-update-debug")&&console.debug("Removing FeatureSetReader"),s.addOrUpdate=null))}((t=this._edits)==null?void 0:t.addOrUpdate)!=null&&this._edits.addOrUpdate.removeIds(e),this.requests.done=this.requests.done.filter(s=>s.message.addOrUpdate||s.message.end)}abort(){this._abortController.abort(),this._resolver.reject(ks())}};function Hr(i,e){const t=new Set;return i&&i.forEach(s=>t.add(s)),e&&e.forEach(s=>t.add(s)),t.has("*")?["*"]:Array.from(t)}let ys=class{constructor(e){this.updatingHandles=new It,this.events=new ke,this._resolver=yt(),this._didEdit=!1,this._subscriptions=new Map,this._outSR=e.outSR,this._serviceInfo=e.serviceInfo,this._onTileUpdateMessage=e.onMessage,this._arcadeLayerSchema=e.arcadeLayerSchema}destroy(){for(const e of this._subscriptions.values())e.abort();this.updatingHandles.destroy()}get subscriptions(){return this._subscriptions.values()}async _onMessage(e){const t=this._subscriptions.get(e.id);if(!t)return;const s={...e,remove:e.remove??[],status:e.status??z.empty()};return Pe(this._onTileUpdateMessage(s,t.options))}update(e,t){var u;const s=t.fields.length;t.outFields=Hr((u=this._schema)==null?void 0:u.outFields,t.outFields),t.outFields=t.outFields.length>=.75*s?["*"]:t.outFields,t.outFields.sort();const r=ye(this._schema,t);if(!r)return;b("esri-2d-update-debug")&&console.debug("Applying Update - Source:",r);const a="orderByFields"in this._serviceInfo&&this._serviceInfo.orderByFields?this._serviceInfo.orderByFields:this._serviceInfo.objectIdField+" ASC",n=this._serviceInfo.source,o={returnCentroid:!(n!==null&&typeof n=="object"&&"path"in n&&os(n.path))&&this._serviceInfo.geometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:this._serviceInfo.type!=="stream"&&this._serviceInfo.timeReferenceUnknownClient,outFields:t.outFields,outSpatialReference:this._outSR,orderByFields:[a],where:t.definitionExpression||"1=1",gdbVersion:t.gdbVersion,historicMoment:t.historicMoment,timeExtent:t.timeExtent?Us.fromJSON(t.timeExtent):null},h=this._schema&&Ee(r,"outFields");this._schema&&Rs(r,["timeExtent","definitionExpression","gdbVersion","historicMoment","customParameters"])&&(e.why.mesh.push("Layer filter and/or custom parameters changed"),e.why.source.push("Layer filter and/or custom parameters changed"),e.mesh=!0,e.source=!0,e.queryFilter=!0),h&&(e.why.source.push("Layer required fields changed"),e.source=!0),ye(o,this._queryInfo)&&(this._queryInfo=o),this._schema=t,this._resolver.resolve()}whenInitialized(){return this._resolver.promise}async applyUpdate(e){if(e.queryFilter||e.source&&this._didEdit)return this.refresh(e.version),void(this._didEdit=!1);this._subscriptions.forEach(t=>t.applyUpdate(e)),await this.resend()}refresh(e,t){for(const s of this._tiles())this.unsubscribe(s),this.subscribe(s,e)}subscribe(e,t){const s=new Xr(e,t);return this._subscriptions.set(e.id,s),s}unsubscribe(e){const t=this.getSubscription(e.id);t!=null&&t.abort(),this._subscriptions.delete(e.id)}createQuery(e={}){const t=this._queryInfo.historicMoment?new Date(this._queryInfo.historicMoment):null;return new Ds({...this._queryInfo,historicMoment:t,...e})}getSubscription(e){return this._subscriptions.has(e)?this._subscriptions.get(e):null}async queryLastEditDate(){throw new Error("Service does not support query type")}async query(e,t){throw new Error("Service does not support query")}*_tiles(){const e=Array.from(this._subscriptions.values());for(const t of e)yield t.tile}async edit(e,t){return this.updatingHandles.addPromise(this._edit(e,t))}async _edit(e,t){const s=Array.from(this._subscriptions.values()),r=s.map(({tile:a})=>a);for(const a of s)a.removeIds(t);if(e.length){const a=r.map(o=>{const h=this.createTileQuery(o);return h.objectIds=e,{tile:o,query:h}}).map(async({tile:o,query:h})=>({tile:o,result:await this.query(h,{query:{tile:b("esri-tiles-debug")?o.id.replaceAll("/","."):void 0}}),query:h})),n=(await Bs(a)).map(async({tile:o,result:h})=>{if(!h.hasFeatures&&!t.length&&!e.length)return;const u=this._subscriptions.get(o.key.id);u&&u.edit(h,e)});await Promise.allSettled(n)}this._didEdit=!0}};const Vr=4;let At=class extends ys{constructor(e){super(e),this.type="feature",this.mode="on-demand",this._adapter=Gr(e.serviceInfo),this._queue=new lt({concurrency:8,process:async t=>{var s,r;if(P(t),t.tile!=null){const a=t.tile.key.id,{signal:n}=t,o=b("esri-tiles-debug")?{tile:a.replaceAll("/","."),depth:t.depth}:void 0,h=await this._adapter.executeQuery(t.query,{signal:n,query:{...o,...(s=this._schema)==null?void 0:s.customParameters}});return h.level=t.tile.key.level,h}return this._adapter.executeQuery(t.query,{...t,query:(r=this._schema)==null?void 0:r.customParameters})}}),this._patchQueue=new lt({concurrency:8,process:async t=>{var s,r;if(P(t),t.tile!=null){const a=t.tile.key.id,{signal:n}=t,o=b("esri-tiles-debug")?{tile:a.replaceAll("/","."),depth:t.depth}:void 0,h=await this._adapter.executeQuery(t.query,{signal:n,query:{...o,...(s=this._schema)==null?void 0:s.customParameters}});return h.level=t.tile.key.level,h}return this._adapter.executeQuery(t.query,{...t,query:(r=this._schema)==null?void 0:r.customParameters})}})}destroy(){super.destroy(),this._adapter.destroy(),this._queue.destroy(),this._patchQueue.destroy()}enqueueQuery(e,t){return this.updatingHandles.addPromise(this._queue.push(e,t))}enqueuePatchQuery(e,t){return this.updatingHandles.addPromise(this._patchQueue.push(e,t))}get maxRecordCountFactor(){const{query:e}=this._serviceInfo.capabilities;return e.supportsMaxRecordCountFactor?Vr:null}get maxPageSize(){const{query:e}=this._serviceInfo.capabilities;return(e.maxRecordCount??8e3)*(this.maxRecordCountFactor??1)}get pageSize(){return Math.min(8e3,this.maxPageSize)}enableEvent(e,t){}subscribe(e,t){const s=super.subscribe(e,t);return this._fetchDataTile(e).catch(r=>{Ie(r)||ae.getLogger("esri.views.2d.layers.features.sources.BaseFeatureSource").error(new V("mapview-query-error","Encountered error when fetching tile",{tile:e,error:r}))}),s}unsubscribe(e){super.unsubscribe(e)}readers(e){return this._subscriptions.get(e).readers()}async query(e,t={}){var r;const s=t.query??{};return this._adapter.executeQuery(e,{...t,query:{...s,...(r=this._schema)==null?void 0:r.customParameters}})}async queryLastEditDate(){const e=this._serviceInfo.source,t={...e.query,f:"json"};return(await Os(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate}createTileQuery(e,t={}){const s=this._serviceInfo.geometryType,r=this.createQuery(t);r.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),r.resultType="tile",r.geometry=e.extent,this._serviceInfo.capabilities.query.supportsQuantization?s==="esriGeometryPolyline"&&(r.maxAllowableOffset=e.resolution*b("feature-polyline-generalization-factor")):s!=="esriGeometryPolyline"&&s!=="esriGeometryPolygon"||(r.maxAllowableOffset=e.resolution,s==="esriGeometryPolyline"&&(r.maxAllowableOffset*=b("feature-polyline-generalization-factor")));const a=this._serviceInfo.capabilities.query;return r.defaultSpatialReferenceEnabled=a.supportsDefaultSpatialReference,r.compactGeometryEnabled=a.supportsCompactGeometry,r}async _executePatchQuery(e,t,s,r){const a=t.clone();a.outFields=[this._serviceInfo.objectIdField,...s],a.returnCentroid=!1,a.returnGeometry=!1;const n=a.start!=null?a.start/8e3:0,o=r.signal;return await this.enqueuePatchQuery({tile:e,query:a,signal:o,depth:n})}async _resend(e,t){const{query:s,message:r}=e,a=s.outFields!=null?s.outFields:[],n=this._queryInfo.outFields,o=n.filter(h=>!a.includes(h));if(r.addOrUpdate!=null)if(o.length)try{const h=this._subscriptions.get(r.id).tile,u=await this._executePatchQuery(h,s,o,t);P(t),s.outFields=n,r.addOrUpdate.joinAttributes(u),this._onMessage({...r,end:r.end,type:"append"})}catch{}else this._onMessage({...r,type:"append"});else this._onMessage({...r,type:"append"})}async _resendSubscription(e){if(b("esri-2d-update-debug")&&console.debug(e.tile.id,"Resend Subscription"),e.empty)return this._onMessage({id:e.tile.id,addOrUpdate:null,end:!1,type:"append"});const t=e.signal;for(const s of e.requests.done)await this._resend(s,{signal:t});return e.edits!=null?this._onMessage(e.edits):void 0}async resend(){const e=Array.from(this._subscriptions.values());await Promise.all(e.map(t=>this._resendSubscription(t)))}};const Vt=b("esri-mobile"),Zt={maxDrillLevel:Vt?1:4,maxRecordCountFactor:Vt?1:3};class Zr extends At{constructor(e){super(e)}async _fetchDataTile(e){const t=this._serviceInfo.capabilities.query.supportsMaxRecordCountFactor,s=this._subscriptions.get(e.key.id),r=s.signal,a=e.getQuantizationParameters();let n=0;const o=async(h,u)=>{const d=this._queryInfo,l=this.createTileQuery(h,{maxRecordCountFactor:t?Zt.maxRecordCountFactor:void 0,returnExceededLimitFeatures:!1,quantizationParameters:a});n++;try{const c=await this.enqueueQuery({tile:e,query:l,signal:r,depth:u});if(n--,P(r),!c)return;if(d!==this._queryInfo)return void o(h,u);if(c.exceededTransferLimit&&u{o--,P(r);const g=e.id,_=l.reader,p=l.query;if(!_.exceededTransferLimit){if(a=!0,c!==0&&!_.hasFeatures){const y={id:g,addOrUpdate:_,end:o===0,type:"append"};return r.add({message:y,query:p}),void this._onMessage(y)}const x={id:g,addOrUpdate:_,end:o===0,type:"append"};return r.add({message:x,query:p}),void this._onMessage(x)}const f={id:g,addOrUpdate:_,end:a&&o===0,type:"append"};r.add({message:f,query:p}),this._onMessage(f)};let u=0,d=0;for(;!a&&d++<20;){let l;for(let c=0;c_&&h(_,g)).catch(_=>{if(a=!0,!Ie(_)){ae.getLogger("esri.views.2d.layers.features.sources.PagedFeatureSource").error(new V("mapview-query-error","Encountered error when fetching tile",{tile:e,error:_}));const p={id:e.id,addOrUpdate:null,end:a,type:"append"},f={start:this.pageSize*n,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};this.maxRecordCountFactor!=null&&(f.maxRecordCountFactor=this.maxRecordCountFactor);const x=this.createTileQuery(e,f);r.add({message:p,query:x}),this._onMessage(p)}})}await l,P(r),u=Math.min(u+2,6)}}async _fetchDataTilePage(e,t,s){P(s);const r=this._queryInfo,a={start:this.pageSize*t,num:this.pageSize,returnExceededLimitFeatures:!0,quantizationParameters:e.getQuantizationParameters()};this.maxRecordCountFactor!=null&&(a.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createTileQuery(e,a);try{const o=s.signal,h=await this.enqueueQuery({tile:e,query:n,signal:o,depth:t});return P(s),h?r!==this._queryInfo?this._fetchDataTilePage(e,t,s):{reader:h,query:n}:null}catch(o){return He(o),null}}};function Wr(i,e,t){const s=i.getXHydrated(),r=i.getYHydrated(),a=e.getColumnForX(s),n=Math.floor(e.normalizeCol(a));return`${t}/${Math.floor(e.getRowForY(r))}/${n}`}function at(i,e){if(i==null)return null;const t=e.transform,s=i.getQuantizationTransform();if(s==null){const[f,x]=t.scale,[y,S]=t.translate,m=-y/f,I=1/f,v=S/x,w=1/-x;return i.transform(m,v,I,w)}const[r,a]=s.scale,[n,o]=s.translate,[h,u]=t.scale,[d,l]=t.translate,c=r/h,g=(n-d)/h,_=a/u,p=(-o+l)/u;return i.transform(g,p,c,_)}let ft=class extends At{constructor(e){super(e),this.mode="snapshot",this._loading=!0,this._controller=new AbortController,this._downloadPromise=null,this._didSendEnd=!1,this._queries=new Array,this._invalidated=!1,this._hasAggregates=!1,this._random=new qs(1e3),this._store=e.store,this._markedIdsBufId=this._store.storage.createBitset()}destroy(){super.destroy(),this._controller.abort()}get loading(){return this._loading}get _signal(){return this._controller.signal}update(e,t){var s;super.update(e,t),this._featureCount??(this._featureCount=t.initialFeatureCount),t.changedFeatureCount!=null&&(this._featureCount=t.changedFeatureCount),this._hasAggregates=!!((s=e.targets)!=null&&s.aggregate)}async resend(e=!1){if(await this._downloadPromise,this._invalidated||e){const s=this._featureCount;return Xe(s,"Expected featureCount to be defined"),this._invalidated=!1,this._subscriptions.forEach(r=>r.clear()),this._downloadPromise=this._download(s),void await this._downloadPromise}const t=this._queries.map(({query:s,reader:r})=>this._sendPatchQuery(s,r));await Promise.all(t),this._subscriptions.forEach(s=>{s.requests.done.forEach(r=>this._onMessage(r.message))})}async refresh(e,t){t&&(this._featureCount=t.featureCount),await this.resend(!0)}async _sendPatchQuery(e,t){const s=e.outFields!=null?e.outFields:[],r=this._queryInfo.outFields,a=r.filter(u=>!s.includes(u));if(!a.length)return;const n=e.clone(),o=this._signal;n.returnGeometry=!1,n.returnCentroid=!1,n.outFields=a,e.outFields=r;const h=await this.enqueueQuery({query:n,depth:0,signal:o});P({signal:o}),t.joinAttributes(h)}async _fetchDataTile(e){this._downloadPromise??(this._downloadPromise=this._download(this._featureCount));const t=this._store.search(e),s=this._subscriptions.get(e.key.id),r=t.length-1;for(let h=0;h=0?t[r]:null,e),n=this._didSendEnd,o={type:"append",id:e.id,addOrUpdate:a,end:n,status:z.empty()};s.add({query:null,message:o}),this._onMessage(o)}async _download(e){try{await this.whenInitialized();const t=this._store.storage.getBitset(this._markedIdsBufId),s=new Set;t.clear();const r=Math.ceil(e/this.pageSize),a=Array.from({length:r},(n,o)=>o).sort((n,o)=>this._random.getInt()-this._random.getInt()).map(n=>this._downloadPage(n,t,s));await Promise.all(a),this._store.sweepFeatures(t,this._store.storage),this._store.sweepFeatureSets(s)}catch(t){ae.getLogger("esri.views.2d.layers.features.sources.SnapshotFeatureSource").error("mapview-snapshot-source","Encountered and error when downloading feature snapshot",t)}this._sendEnd(),this._loading=!1}async _downloadPage(e,t,s){const r=this.pageSize,a={start:e*r,num:r,cacheHint:!0};this.maxRecordCountFactor!=null&&(a.maxRecordCountFactor=this.maxRecordCountFactor);const n=this.createQuery(a),o=this._signal,h=await this.enqueueQuery({query:n,depth:e,signal:o});P({signal:o}),this._queries.push({query:n,reader:h}),this._store.insert(h),s.add(h.instance);const u=h.getCursor();for(;u.next();)t.set(u.getDisplayId());this._send(h)}_send(e){if(!this._subscriptions.size)return;let t=null;const s=new Map,r=new Set,a=new Map;this._subscriptions.forEach(n=>{const o=n.tile;s.set(o.key.id,null),t=o.tileInfoView,r.add(o.level);const{row:h,col:u}=o.key,d=`${o.level}/${h}/${u}`,l=a.get(d)??[];l.push(n),a.set(d,l)});for(const n of r){const o=t.getLODInfoAt(n),h=e.getCursor();for(;h.next();){const u=Wr(h,o,n),d=h.getIndex();if(a.has(u))for(const l of a.get(u)){const c=l.tile.id;let g=s.get(c);g==null&&(g=[],s.set(c,g)),g.push(d)}}}s.forEach((n,o)=>{if(n!=null){const h=this._subscriptions.get(o),u={type:"append",id:o,addOrUpdate:at(ms.from(e,n),h.tile),end:!1,status:z.empty()};h.add({query:null,message:u}),this._onMessage(u)}})}_sendEnd(){this._subscriptions.forEach(e=>{const t={type:"append",id:e.tile.id,addOrUpdate:null,end:!0,status:z.empty()};e.add({query:null,message:t}),this._onMessage(t)}),this._didSendEnd=!0}};ft=k([Je("esri.view.2d.layers.features.sources.SnapshotFeatureSource")],ft);let fe=class extends xt{constructor(e){super(e)}get connectionStatus(){var e;return(e=this.connection)==null?void 0:e.connectionStatus}get errorString(){var e;return(e=this.connection)==null?void 0:e.errorString}};k([O()],fe.prototype,"connection",void 0),k([O()],fe.prototype,"connectionStatus",null),k([O()],fe.prototype,"errorString",null),fe=k([Je("esri.views.2d.layers.features.sources.StreamConnectionState")],fe);const Kr=2500;function ei(i,e){const t=i.weakClone();if(i.geometry!=null){const s=us(e,i.geometry.coords[0]),r=ds(e,i.geometry.coords[1]);t.geometry=new D([],[s,r])}return t}function ti(i){return i==="esriGeometryPoint"?ei:(e,t)=>{const s=e.weakClone(),r=new D,a=!1,n=!1,o=ct(r,e.geometry,a,n,i,t,!1,!1);return s.geometry=o,s}}function si(i){return i==="esriGeometryPoint"?e=>e.geometry!=null?{minX:e.geometry.coords[0],minY:e.geometry.coords[1],maxX:e.geometry.coords[0],maxY:e.geometry.coords[1]}:{minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}:e=>{let t=1/0,s=1/0,r=-1/0,a=-1/0;return e.geometry!=null&&e.geometry.forEachVertex((n,o)=>{t=Math.min(t,n),s=Math.min(s,o),r=Math.max(r,n),a=Math.max(a,o)}),{minX:t,minY:s,maxX:r,maxY:a}}}function ri(i,e){const t=be(9,si(e));return t.load(i),t}function ii(i,e){return i.search({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]})}class ai{constructor(e,t){this.onUpdate=e,this._geometryType=t,this._objectIdToFeature=new Map,this._index=null}get _features(){const e=[];return this._objectIdToFeature.forEach(t=>e.push(t)),e}add(e){this._objectIdToFeature.set(e.objectId,e),this._index=null}get(e){return this._objectIdToFeature.has(e)?this._objectIdToFeature.get(e):null}forEach(e){this._objectIdToFeature.forEach(e)}search(e){return this._index||(this._index=ri(this._features,this._geometryType)),ii(this._index,e)}clear(){this._index=null,this._objectIdToFeature.clear()}removeById(e){const t=this._objectIdToFeature.get(e);return t?(this._objectIdToFeature.delete(e),this._index=null,t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._objectIdToFeature.size}}let ni=class extends ys{constructor(e){super(e),this.type="stream",this._updateIntervalId=0,this._level=0,this._isPaused=!1,this._updateInfo={websocket:0,client:0},this._inUpdate=!1;const{outSR:t}=e,{geometryType:s,objectIdField:r,timeInfo:a,purgeOptions:n,source:o,spatialReference:h,serviceFilter:u,maxReconnectionAttempts:d,maxReconnectionInterval:l,updateInterval:c,customParameters:g,enabledEventTypes:_}=e.serviceInfo,p=new ai(this._onUpdate.bind(this),s),f=new er(p,r,a,n),x=hr(o,h,t,s,u,d,l,g??{});this._connectionState=new fe({connection:x}),this._store=p,this._manager=f,this._connection=x,this._quantize=ti(s),this._enabledEventTypes=new Set(_),this._handlesGroup=Ls([this._connection.on("data-received",y=>this._onFeature(y)),this._connection.on("message-received",y=>this._onWebSocketMessage(y))]),this._initUpdateInterval=()=>{let y=performance.now();this._updateIntervalId=setInterval(()=>{const S=performance.now(),m=S-y;if(m>Kr){y=S;const I=Math.round(this._updateInfo.client/(m/1e3)),v=Math.round(this._updateInfo.websocket/(m/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.events.emit("updateRate",{client:I,websocket:v})}e.canAcceptRequest()&&!this._inUpdate&&this._manager.checkForUpdates()},c)},this._isPaused=e.serviceInfo.isPaused,this._isPaused||this._initUpdateInterval()}destroy(){var e;super.destroy(),this._clearUpdateInterval(),this._connection.destroy(),(e=this._handlesGroup)==null||e.remove()}_fetchDataTile(){}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState.errorString}updateCustomParameters(e){this._connection.updateCustomParameters(e)}pauseStream(){this._isPaused||(this._isPaused=!0,this._clearUpdateInterval())}resumeStream(){this._isPaused&&(this._isPaused=!1,this._initUpdateInterval())}sendMessageToSocket(e){this._connection.sendMessageToSocket(e)}sendMessageToClient(e){this._isPaused&&"type"in e&&e.type==="clear"?(this._store.clear(),this._subscriptions.forEach((t,s)=>{t.didSend&&t.tile.level===this._level&&this._onMessage({type:"append",id:s,addOrUpdate:null,clear:!0,end:!0})})):this._connection.sendMessageToClient(e)}enableEvent(e,t){t?this._enabledEventTypes.add(e):this._enabledEventTypes.delete(e)}subscribe(e,t){const s=super.subscribe(e,t);this._level=e.level;const r=this._getTileFeatures(e);return this._onMessage({type:"append",id:e.key.id,addOrUpdate:r,end:!0}),s.didSend=!0,s}unsubscribe(e){super.unsubscribe(e)}*readers(e){const t=this._subscriptions.get(e),{tile:s}=t;yield this._getTileFeatures(s)}createTileQuery(e){throw new Error("Service does not support tile queries")}async resend(){this._subscriptions.forEach(e=>{const{tile:t}=e,s={type:"append",id:t.id,addOrUpdate:this._getTileFeatures(t),end:!0};this._onMessage(s)})}_getTileFeatures(e){const t=this._store.search(e).map(s=>this._quantize(s,e.transform));return G.fromOptimizedFeatures(t,this._arcadeLayerSchema,e.transform)}_onWebSocketMessage(e){if(this._enabledEventTypes.has("message-received")&&this.events.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this._store.forEach(t=>this._manager.removeById(t.objectId))}}_onFeature(e){this._updateInfo.websocket++;try{this._enabledEventTypes.has("data-received")&&this.events.emit("data-received",e);const t=zs(e,this._serviceInfo.geometryType,!1,!1,this._serviceInfo.objectIdField);this._manager.add(t)}catch{}}_clearUpdateInterval(){clearInterval(this._updateIntervalId),this._updateIntervalId=0}async _onUpdate(e,t){this._inUpdate=!0;try{e!=null&&(this._updateInfo.client+=e.length),this._subscriptions.forEach((r,a)=>{r.didSend&&r.tile.level===this._level&&this._onMessage({type:"append",id:a,addOrUpdate:null,clear:!0,end:!1})});const s=[];this._subscriptions.forEach((r,a)=>{if(!r.didSend||r.tile.level!==this._level)return;const n=r.tile,o={type:"append",id:a,addOrUpdate:this._getTileFeatures(n),remove:[],end:!1,status:z.empty()};r.requests.stream.enqueue(o),s.push(this._onMessage(o))}),await Promise.all(s),this._subscriptions.forEach((r,a)=>{r.didSend&&r.tile.level===this._level&&this._onMessage({type:"append",id:a,addOrUpdate:null,end:!0})})}catch{}this._inUpdate=!1}};function oi(i,e,t,s,r,a,n){const o=hi(i,e,t,s,r,a,n);switch(o.type){case"feature":switch(o.origin){case"hosted":case"local":return new Jr(o);case"snapshot":return new ft(o);default:return new Zr(o)}case"stream":return new ni(o)}}function hi(i,e,t,s,r,a,n){switch(i.type){case"snapshot":return{type:"feature",origin:"snapshot",featureCount:i.featureCount??0,serviceInfo:i,onMessage:r,outSR:t,tileInfoView:s,canAcceptRequest:a,store:n,arcadeLayerSchema:e};case"stream":return{type:"stream",serviceInfo:i,onMessage:r,outSR:t,canAcceptRequest:a,arcadeLayerSchema:e};case"memory":case"on-demand":return{type:"feature",serviceInfo:i,onMessage:r,outSR:t,origin:o(i.source),tileInfoView:s,canAcceptRequest:a,arcadeLayerSchema:e}}function o(h){return Array.isArray(h)?"local":"path"in h&&os(h.path)?"hosted":"unknown"}}const $=8388607,Is=8388608,ui=254,di=255,li=0,Ct=1,Mt=i=>(i&Is)>>>23,_e=i=>i&$,ci=i=>Mt(i)===Ct?ui:di;function Ma(i){return Mt(i)===Ct}function Et(i,e){return((e?Is:0)|i)>>>0}const $t=ae.getLogger("esri.views.2d.engine.webgl.Utils"),W="geometry",gi=[{name:W,strideInBytes:12}],pi=[{name:W,strideInBytes:36}],fi=[{name:W,strideInBytes:24}],_i=[{name:W,strideInBytes:12}],mi=[{name:W,strideInBytes:40}],yi=[{name:W,strideInBytes:36}],Ii=[{name:W,strideInBytes:36}];function ne(i){const e={};for(const t of i)e[t.name]=t.strideInBytes;return e}const xi=ne([{name:W,strideInBytes:36}]),bi=ne(gi),vi=ne(pi),Si=ne(fi),wi=ne(_i),Ti=ne(mi),Fi=ne(yi),Ai=ne(Ii);function Ea(i,e){switch(i){case Se.MARKER:return e===Oe.HEATMAP?bi:xi;case Se.FILL:switch(e){case Oe.DOT_DENSITY:return wi;case Oe.SIMPLE:case Oe.OUTLINE_FILL_SIMPLE:return Si;default:return vi}case Se.LINE:return Ti;case Se.TEXT:return Fi;case Se.LABEL:return Ai}}function $a(i){switch(i){case"butt":return Ue.BUTT;case"round":return Ue.ROUND;case"square":return Ue.SQUARE;default:return $t.error(new V("mapview-invalid-type",`Cap type ${i} is not a valid option. Defaulting to round`)),Ue.ROUND}}function ka(i){switch(i){case"miter":return Re.MITER;case"bevel":return Re.BEVEL;case"round":return Re.ROUND;default:return $t.error(new V("mapview-invalid-type",`Join type ${i} is not a valid option. Defaulting to round`)),Re.ROUND}}W+"",Gs.STATIC_DRAW;function Ci(i){switch(i){case X.UNSIGNED_BYTE:return Uint8Array;case X.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case X.FLOAT:return Float32Array;default:return void $t.error(new V("webgl-utils",`Unable to handle type ${i}`))}}const Mi=(i,e)=>i&&((...t)=>e.warn("DEBUG:",...t))||(()=>null),Ei=!1;function $i(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const me=ae.getLogger("esri.views.layers.2d.features.support.AttributeStore"),ze=Mi(Ei,me),Me={sharedArrayBuffer:b("esri-shared-array-buffer"),atomics:b("esri-atomics")};function nt(i,e){return t=>e(i(t))}class ki{constructor(e,t,s,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:a,layout:n,textureOnly:o}=r;this.textureOnly=o||!1,this.pixelType=a,this._ctype=t,this.layout=n,this._resetRange(),this._shared=e,this.size=s,o||(this.data=this._initData(a,s,e,t))}get buffer(){var e;return(e=this.data)==null?void 0:e.buffer}unsetComponentAllTexels(e,t){const s=this.data;for(let r=0;rt)return null;this._resetRange();const r=!(this._shared||this._ctype==="local"),a=this.pixelType,n=this.layout,o=this.data;return{start:e,end:t,data:r&&o.slice(e*s,(t+1)*s)||null,pixelType:a,layout:n}}_initData(e,t,s,r){const a=s&&r!=="local"?SharedArrayBuffer:ArrayBuffer,n=Ci(e),o=new n(new a(t*t*4*n.BYTES_PER_ELEMENT));for(let h=0;hnull)}destroy(){this._abortController.abort(),this.updatingHandles.destroy()}get hasScaleExpr(){return this._hasScaleExpr}get _signal(){return this._abortController.signal}get hasHighlight(){return this._idsToHighlight.size>0}isUpdating(){const e=this.updatingHandles.updating||!!this._nextUpdate;return b("esri-2d-log-updating")&&console.log(`Updating AttributeStore: ${e} + -> updatingHandles ${this.updatingHandles.updating} (currUpdate: ${!!this._currUpdate}) + -> nextUpdate: ${!!this._nextUpdate} +`),e}update(e,t){this.config=t;const s=t.schema.processors[0].storage,r=ye(this._schema,s);if((e.targets.feature||e.targets.aggregate)&&(e.storage.data=!0),r&&(b("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),e.storage.data=!0,this._schema=s,this._attributeComputeInfo=null,s!=null)){switch(s.target){case"feature":this._targetType=li;break;case"aggregate":this._targetType=Ct}if(s.type==="subtype"){this._attributeComputeInfo={isSubtype:!0,subtypeField:s.subtypeField,map:new Map};for(const a in s.mapping){const n=s.mapping[a];if((n==null?void 0:n.vvMapping)!=null)for(const o of n.vvMapping)this._bindAttribute(o,parseInt(a,10))}}else{if(this._attributeComputeInfo={isSubtype:!1,map:new Map},s.vvMapping!=null)for(const a of s.vvMapping)this._bindAttribute(a);if(s.attributeMapping!=null)for(const a of s.attributeMapping)this._bindAttribute(a)}}}onTileData(e,t){if(t.addOrUpdate==null)return;const s=t.addOrUpdate.getCursor();for(;s.next();){const r=s.getDisplayId();this.setAttributeData(r,s)}}async setHighlight(e,t){const r=this._getBlock(0),a=t.map(n=>_e(n));r.lock(),r.unsetComponentAllTexels(0,1),r.setComponent(0,1,a),r.unlock(),this._idsToHighlight.clear();for(const n of e)this._idsToHighlight.add(n);await this.sendUpdates()}async updateFilters(e,t,s){b("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters");const{service:r,spatialReference:a}=s,{filters:n}=t,o=n.map((u,d)=>this._updateFilter(u,d,r,a)),h=(await Promise.all(o)).some(u=>u);b("esri-2d-update-debug")&&console.debug("AttributeStore::updateFilters - finsihed"),h&&(e.storage.filters=!0,b("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(e,t,s,r){const a=_e(e);this._ensureSizeForTexel(a),this._getBlock(t).setData(e,s,r)}getData(e,t,s){return this._getBlock(t).getData(e,s)}getHighlightFlag(e){return this._idsToHighlight.has(e)?dr:0}unsetAttributeData(e){const t=_e(e);this._getBlock(0).setData(t,0,0)}setAttributeData(e,t){const s=_e(e);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(t)),this._targetType!==Mt(e))return;const r=this._attributeComputeInfo,a=this.config.supportsTextureFloat?1:2,n=4;let o=null;r&&(o=r.isSubtype?r.map.get(t.readAttribute(r.subtypeField)):r.map,o!=null&&o.size&&o.forEach((h,u)=>{const d=u*a%n,l=Math.floor(u*a/n),c=this._getBlock(l+lr),g=h(t);if(this.config.supportsTextureFloat)c.setData(s,d,g);else if(g===zt)c.setData(s,d,255),c.setData(s,d+1,255);else{const _=Ps(Math.round(g),-32767,32766)+32768,p=255&_,f=(65280&_)>>8;c.setData(s,d,p),c.setData(s,d+1,f)}}))}sendUpdates(){if(b("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=yt(),this.updatingHandles.addPromise(this._nextUpdate.promise),this._nextUpdate.promise;const e={blocks:this._blocks.map(t=>t!=null?t.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const t=()=>{if(this._currUpdate=null,this._nextUpdate){const r=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>r.resolve())}else b("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued")};b("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const s=this.updatingHandles.addPromise(this._client.update(e,this._signal).then(t).catch(t));return this._client.render(this._signal),s}).catch(t=>{if(Ie(t))return this._createResourcesPromise=null,this._createResources();me.error(new V("mapview-attribute-store","Encountered an error during client update",t))}),this._currUpdate}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}_bindAttribute(e,t){function s(){const{normalizationField:u}=e;return u?d=>{const l=d.readAttribute(u);return l?d.readAttribute(e.field)/l:null}:d=>d.readAttribute(e.field)}function r(){return e.normalizationField&&me.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),u=>u.getComputedNumericAtIndex(e.fieldIndex)}let a;if(e.fieldIndex!=null)a=r();else{if(!e.field)return;a=s()}const{valueRepresentation:n}=e;n&&(a=nt(a,u=>$i(u,n)));const o=u=>u===null||isNaN(u)||u===1/0||u===-1/0?zt:u,h=this._attributeComputeInfo;if(h.isSubtype){const u=h.map.get(t)??new Map;u.set(e.binding,nt(a,o)),h.map.set(t,u)}else h.map.set(e.binding,nt(a,o))}_createResources(){if(this._createResourcesPromise!=null)return this._createResourcesPromise;this._getBlock(cr),this._getBlock(gr),ze("Initializing AttributeStore");const e={shared:Me.sharedArrayBuffer&&this._client.type!=="local",size:this._size,blocks:this._blocks.map(s=>s!=null?{textureOnly:s.textureOnly,buffer:s.buffer,pixelType:s.pixelType}:null)},t=this._client.initialize(e,this._signal).catch(s=>{Ie(s)?this._createResourcesPromise=null:me.error(new V("mapview-attribute-store","Encountered an error during client initialization",s))});return this._createResourcesPromise=t,t.then(()=>this._createResourcesPromise==null?this._createResources():void 0),t}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;ze(`Initializing AttributeBlock at index ${e}`);const s=Me.sharedArrayBuffer,r=this._client.type,a=new ki(s,r,this._size,this._blockDescriptors[e]);return this._blocks[e]=a,this._createResourcesPromise=null,a}_expand(){if(this._sizeimport("./FeatureFilter-w5_DYl72.js"),__vite__mapDeps([15,1,2,16,17,18,19,20,21,22,23,24,7,25,26,27,28,29,30,31,32,33,3,11,9,34])),a=new r({geometryType:t.geometryType,hasM:!1,hasZ:!1,timeInfo:t.timeInfo,fieldsIndex:H.fromJSON(t.fieldsIndex)});return this._filters[e]=a,a}isVisible(e){return!!(2&this._getBlock(0).getData(e,0))}getFilterFlags(e){let t=0;const s=ci(e.getDisplayId());for(let a=0;a{},this._nodes=0,this._root=new ot(this,0,0,0),this._statisticFields=e,this._pool=s?new St(8096):null,this._serviceInfo=t}destroy(){this.clear()}_acquire(e,t,s){this._nodes++;let r=null;return this._pool!=null&&(r=this._pool.dequeue()),r!=null?r.realloc(e,t,s):r=new ot(this,e,t,s),r}_release(e){this.onRelease(e),this._nodes--,this._pool!=null&&this._pool.enqueue(e)}get count(){return this._root.count}get size(){return this._nodes}get poolSize(){var e;return((e=this._pool)==null?void 0:e.size)??0}get depth(){let e=0;return this.forEach(t=>e=Math.max(e,t.depth)),e}dropLevels(e){this.forEach(t=>{if(t.depth>=e)for(let s=0;s{if(t.depth>=e)for(let s=0;sthis._release(e)),this._root=new ot(this,0,0,0)}insert(e,t,s=0){const r=G.fromOptimizedFeatures([e],this._serviceInfo).getCursor();r.next();const a=r.readGeometry();if(!a)return;const[n,o]=a.coords,h=e.geohashX,u=e.geohashY;this.insertCursor(r,e.displayId,n,o,h,u,t,s)}insertCursor(e,t,s,r,a,n,o,h=0){let u=this._root,d=0,l=0,c=0;for(;u!==null;){if(u.depth>=h&&(u.count+=1,u.xTotal+=s,u.yTotal+=r,u.xGeohashTotal+=a,u.yGeohashTotal+=n,u.referenceId=t,this._updateStatisticsCursor(e,u,1)),d>=o)return void u.add(t);const g=Math.ceil((d+1)/2),_=Math.floor((d+1)/2),p=1-d%2,f=30-(3*g+2*_),x=30-(2*g+3*_),y=(a&7*p+3*(1-p)<>f,S=(n&3*p+7*(1-p)<>x,m=y+S*(8*p+4*(1-p));l=l<<3*p+2*(1-p)|y,c=c<<2*p+3*(1-p)|S,u.children[m]==null&&(u.children[m]=this._acquire(l,c,d+1)),d+=1,u=u.children[m]}}remove(e,t){const s=G.fromOptimizedFeatures([e],this._serviceInfo).getCursor();s.next();const r=s.readGeometry();if(!r)return;const[a,n]=r.coords,o=e.geohashX,h=e.geohashY;this.removeCursor(s,a,n,o,h,t)}removeCursor(e,t,s,r,a,n){let o=this._root,h=0;for(;o!==null;){if(o.count-=1,o.xTotal-=t,o.yTotal-=s,o.xGeohashTotal-=r,o.yGeohashTotal-=a,this._updateStatisticsCursor(e,o,-1),h>=n)return void o.remove(e.getDisplayId());const u=Math.ceil((h+1)/2),d=Math.floor((h+1)/2),l=1-h%2,c=30-(3*u+2*d),g=30-(2*u+3*d),_=((r&7*l+3*(1-l)<>c)+((a&3*l+7*(1-l)<>g)*(8*l+4*(1-l)),p=o.children[_];(p==null?void 0:p.count)===1&&(this._release(p),o.children[_]=null),h+=1,o=p}}forEach(e){let t=this._root;for(;t!==null;){const s=this._linkChildren(t)||t.next;e(t),t=s}}find(e,t,s){return this._root.find(e,t,s,0,0,0)}findIf(e){let t=null;return this.forEach(s=>{e(s)&&(t=s)}),t}findAllIf(e){const t=[];return this.forEach(s=>{e(s)&&t.push(s)}),t}findSingleOccupancyNode(e,t,s,r,a){let n=this._root;for(;n!==null;){const o=n.depth,h=n.xNode,u=n.yNode,d=1-o%2,l=n.xGeohashTotal/n.count,c=n.yGeohashTotal/n.count;if(n.count===1&&e=a){n=n.next;continue}const g=Math.ceil((o+1)/2),_=Math.floor((o+1)/2),p=30-(3*g+2*_),f=30-(2*g+3*_),x=~((1<>p,m=(t&y)>>f,I=(s&x)>>p,v=(r&y)>>f,w=h<<3*d+2*(1-d),M=u<<2*d+3*(1-d),F=w+8*d+4*(1-d),T=M+4*d+8*(1-d),C=Math.max(w,S),A=Math.max(M,m),E=Math.min(F,I),U=Math.min(T,v);let B=null,Z=null;for(let R=A;R<=U;R++)for(let Y=C;Y<=E;Y++){const Q=Y-w+(R-M)*(8*d+4*(1-d)),q=n.children[Q];q&&(B||(B=q,B.next=n.next),Z&&(Z.next=q),Z=q,q.next=n.next)}n=B||n.next}return null}getRegionDisplayIds(e){let t=this._root;const{bounds:s,geohashBounds:r,level:a}=e,[n,o,h,u]=s,d=[];for(;t!==null;){const l=t.depth,c=t.xNode,g=t.yNode;if(l>=a){const Q=t.xTotal/t.count,q=t.yTotal/t.count;Q>=n&&Q<=h&&q>=o&&q<=u&&t.displayIds.forEach(K=>d.push(K)),t=t.next;continue}const _=Math.ceil((l+1)/2),p=Math.floor((l+1)/2),f=1-l%2,x=30-(3*_+2*p),y=30-(2*_+3*p),S=~((1<>x,v=(r.yLL&m)>>y,w=(r.xTR&S)>>x,M=(r.yTR&m)>>y,F=c<<3*f+2*(1-f),T=g<<2*f+3*(1-f),C=F+8*f+4*(1-f),A=T+4*f+8*(1-f),E=Math.max(F,I),U=Math.max(T,v),B=Math.min(C,w),Z=Math.min(A,M);let R=null,Y=null;for(let Q=U;Q<=Z;Q++)for(let q=E;q<=B;q++){const K=q-F+(Q-T)*(8*f+4*(1-f)),J=t.children[K];J&&(R||(R=J,R.next=t.next),Y&&(Y.next=J),Y=J,J.next=t.next)}t=R||t.next}return d}getRegionStatistics(e){let t=this._root,s=0,r=0,a=0;const n={},{bounds:o,geohashBounds:h,level:u}=e,[d,l,c,g]=o;let _=0;for(;t!==null;){const p=t.depth,f=t.xNode,x=t.yNode;if(p>=u){const ee=t.xTotal/t.count,te=t.yTotal/t.count;ee>d&&ee<=c&&te>l&&te<=g&&(s+=t.count,r+=t.xTotal,a+=t.yTotal,t.count===1&&(_=t.referenceId),this._aggregateStatistics(n,t.statistics)),t=t.next;continue}const y=Math.ceil((p+1)/2),S=Math.floor((p+1)/2),m=1-p%2,I=30-(3*y+2*S),v=30-(2*y+3*S),w=~((1<>I,T=(h.yLL&M)>>v,C=(h.xTR&w)>>I,A=(h.yTR&M)>>v,E=f<<3*m+2*(1-m),U=x<<2*m+3*(1-m),B=E+8*m+4*(1-m),Z=U+4*m+8*(1-m),R=Math.max(E,F),Y=Math.max(U,T),Q=Math.min(B,C),q=Math.min(Z,A);let K=null,J=null;for(let ee=Y;ee<=q;ee++)for(let te=R;te<=Q;te++){const vs=te-E+(ee-U)*(8*m+4*(1-m)),L=t.children[vs];if(L){if(ee!==Y&&ee!==q&&te!==R&&te!==Q){const Ut=L.xTotal/L.count,Rt=L.yTotal/L.count;Ut>d&&Ut<=c&&Rt>l&&Rt<=g&&(s+=L.count,r+=L.xTotal,a+=L.yTotal,L.count===1&&(_=L.referenceId),this._aggregateStatistics(n,L.statistics));continue}K||(K=L,K.next=t.next),J&&(J.next=L),J=L,L.next=t.next}}t=K||t.next}return{count:s,attributes:this.normalizeStatistics(n,s),xTotal:r,yTotal:a,referenceId:_}}getBins(e){const t=[],{geohashBounds:s,level:r}=e;let a=this._root;for(;a!==null;){const n=a.depth,o=a.xNode,h=a.yNode;if(n>=r){t.push(a),a=a.next;continue}const u=Math.ceil((n+1)/2),d=Math.floor((n+1)/2),l=1-n%2,c=30-(3*u+2*d),g=30-(2*u+3*d),_=~((1<>c,x=(s.yLL&p)>>g,y=(s.xTR&_)>>c,S=(s.yTR&p)>>g,m=o<<3*l+2*(1-l),I=h<<2*l+3*(1-l),v=m+8*l+4*(1-l),w=I+4*l+8*(1-l),M=Math.max(m,f),F=Math.max(I,x),T=Math.min(v,y),C=Math.min(w,S);let A=null,E=null;for(let U=F;U<=C;U++)for(let B=M;B<=T;B++){const Z=B-m+(U-I)*(8*l+4*(1-l)),R=a.children[Z];R&&(A||(A=R,A.next=a.next),E&&(E.next=R),E=R,R.next=a.next)}a=A||a.next}return t}_linkChildren(e){let t=null,s=null;for(let r=0;r<=e.children.length;r++){const a=e.children[r];a&&(t||(t=a,t.next=e.next),s&&(s.next=a),s=a,a.next=e.next)}return t}_updateStatisticsCursor(e,t,s){for(const r of this._statisticFields){const a=r.name,n=r.inField?e.readAttribute(r.inField):e.getComputedNumericAtIndex(r.inFieldIndex);switch(r.statisticType){case"min":{if(isNaN(n))break;if(!t.statistics[a]){t.statistics[a]={value:n};break}const o=t.statistics[a].value;t.statistics[a].value=Math.min(o,n);break}case"max":{if(isNaN(n))break;if(!t.statistics[a]){t.statistics[a]={value:n};break}const o=t.statistics[a].value;t.statistics[a].value=Math.max(o,n);break}case"count":break;case"sum":case"avg":{t.statistics[a]||(t.statistics[a]={value:0,nanCount:0});const o=t.statistics[a].value,h=t.statistics[a].nanCount??0;n==null||isNaN(n)?t.statistics[a].nanCount=h+s:t.statistics[a].value=o+s*n;break}case"avg_angle":{t.statistics[a]||(t.statistics[a]={x:0,y:0,nanCount:0});const o=t.statistics[a].x,h=t.statistics[a].y,u=t.statistics[a].nanCount??0,d=Math.PI/180;n==null||isNaN(n)?t.statistics[a].nanCount=u+s:(t.statistics[a].x=o+s*Math.cos(n*d),t.statistics[a].y=h+s*Math.sin(n*d));break}case"mode":{t.statistics[a]||(t.statistics[a]={});const o=t.statistics[a][n]||0;t.statistics[a][n]=o+s;break}}}}_aggregateStatistics(e,t){for(const s of this._statisticFields){const r=s.name;switch(s.statisticType){case"min":{if(!e[r]){e[r]={value:t[r].value};break}const a=e[r].value;e[r].value=Math.min(a,t[r].value);break}case"max":{if(!e[r]){e[r]={value:t[r].value};break}const a=e[r].value;e[r].value=Math.max(a,t[r].value);break}case"count":break;case"sum":case"avg":case"avg_angle":case"mode":e[r]||(e[r]={});for(const a in t[r]){const n=e[r][a]||0;e[r][a]=n+t[r][a]}}}}normalizeStatistics(e,t){const s={};for(const r of this._statisticFields){const a=r.name;switch(r.statisticType){case"min":case"max":{const n=e[a];if(!t||!n)break;s[a]=n.value;break}case"count":if(!t)break;s[a]=t;break;case"sum":{if(!t)break;const{value:n,nanCount:o}=e[a];if(!(t-o))break;s[a]=n;break}case"avg":{if(!t)break;const{value:n,nanCount:o}=e[a];if(!(t-o))break;s[a]=n/(t-o);break}case"avg_angle":{if(!t)break;const{x:n,y:o,nanCount:h}=e[a];if(!(t-h))break;const u=n/(t-h),d=o/(t-h),l=180/Math.PI,c=Math.atan2(d,u)*l;s[a]=c;break}case"mode":{const n=e[a];let o=0,h=0,u=null;for(const d in n){const l=n[d];l===o?h+=1:l>o&&(o=l,h=1,u=d)}s[a]=u==="null"||h>1?null:u;break}}}return s}};class ot{constructor(e,t,s,r){this.count=0,this.xTotal=0,this.yTotal=0,this.statistics={},this.displayId=0,this.referenceId=0,this.displayIds=new Set,this.next=null,this.depth=0,this.xNode=0,this.yNode=0,this.xGeohashTotal=0,this.yGeohashTotal=0,this._tree=e,this.children=new Array(32);for(let a=0;a=s)return this;const o=1-r%2,h=3*o+2*(1-o),u=2*o+3*(1-o),d=30-a-h,l=30-n-u,c=((e&7*o+3*(1-o)<>d)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[c];return g==null?null:g.find(e,t,s,r+1,a+h,n+u)}}const ht=ae.getLogger("esri.view.2d.layers.features.support.BinStore"),Jt=12,Ri=64,Di=_t(),Bi=5;function Wt(i){return 57.29577951308232*i}let Oi=class extends wt{constructor(e,t,s,r){super(e,s),this.type="bin",this.events=new ke,this.objectIdField="aggregateId",this.featureAdapter=Ft,this._geohashLevel=Bi,this._geohashBuf=[],this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=fs(t,ie.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree&&this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch{}this._fields=this._schema.params.fields,this._fieldsIndex=new H(this._fields);const r=ye(s,t);t&&(r!=null||e.source||e.storage.filters)?((Ee(r,"params.fields")||Ee(r,"params")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new xs(this._statisticFields,this._serviceInfo),this._tree.onRelease=a=>a.displayId&&this._storage.releaseDisplayId(a.displayId),this._geohashLevel=this._schema.params.fixedBinLevel,this._rebuildTree(),b("esri-2d-update-debug")&&ht.info("Aggregate mesh needs update due to tree changing")),b("esri-2d-update-debug")&&ht.info("Aggregate mesh needs update due to tree changing"),e.targets[t.name]=!0,e.mesh=!1):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet(s=>{if(!e.has(s)){const r=t.lookupByDisplayIdUnsafe(s);this._remove(r)}})}sweepAggregates(e,t,s){}onTileData(e,t,s,r,a,n=!0){if(!this._schema||t.addOrUpdate==null)return t;this.events.emit("changed");const o=this._getTransforms(e,this._spatialReference);{const u=t.addOrUpdate.getCursor();for(;u.next();)this._update(u,r)}if(t.status.mesh||!n)return t;const h=new Array;this._getBinsForTile(h,e,o,s),t.addOrUpdate=G.fromOptimizedFeatures(h,{fields:this.fields,fieldsIndex:this._fieldsIndex,geometryType:"esriGeometryPolygon",objectIdField:this.objectIdField}),t.addOrUpdate.attachStorage(s),t.end=!0,t.isRepush||(t.clear=!0);{const u=t.addOrUpdate.getCursor();for(;u.next();){const d=u.getDisplayId();this._bitsets.computed.unset(d),this.setComputedAttributes(s,u,d,e.scale,a)}}return t}forEachBin(e){this._tree.forEach(e)}forEach(e){this._tree.forEach(t=>{if(t.depth!==this._geohashLevel)return;const s=this._toFeatureJSON(t),r=G.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields,fieldsIndex:this._fieldsIndex}).getCursor();r.next(),e(r)})}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:s,hasZ:r}=this.geometryInfo;for(const a of e){const n=ls(Di,a.readGeometry(),r,s);n!=null&&t(n)}}onTileUpdate(e){}getAggregate(e){const t=Et(e,!0),s=this._tree.findIf(r=>r.displayId===t);return s?this._toFeatureJSON(s):null}getAggregates(){return this._tree.findAllIf(e=>e.depth===this._geohashLevel).map(this._toFeatureJSON.bind(this))}getDisplayId(e){var t;return(t=this._tree.findIf(s=>s.id===e))==null?void 0:t.displayId}getFeatureDisplayIdsForAggregate(e){const t=this._tree.findIf(s=>s.id===e);return t!=null?Array.from(t.displayIds):[]}getDisplayIdForReferenceId(e){var t;return(t=this._tree.findIf(s=>s.displayIds.size===1&&s.displayIds.has(e)))==null?void 0:t.displayId}_toFeatureJSON(e){const t=this._spatialReference;return{displayId:e.displayId,attributes:e.getAttributes(),geometry:$e(e.getGeometry(t),"esriGeometryPolygon",!1,!1),centroid:null}}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),a=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,a,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,a=t.isVisible(s);if(a===r.has(s))return;if(!a)return void this._remove(e);const n=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,n,o))return;const h=this._geohashBuf[2*s],u=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,o,h,u,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const a=Wt(t/re.radius),n=a-360*Math.floor((a+180)/360),o=Wt(Math.PI/2-2*Math.atan(Math.exp(-s/re.radius)));Ze(r,e,o,n,Jt)}else{const a=xe({x:t,y:s},this._spatialReference,ie.WGS84);if(!a)return!1;Ze(r,e,a.y,a.x,Jt)}return this._bitsets.geohash.set(e),!0}_getBinsForTile(e,t,s,r){try{const a=this._getGeohashBounds(t),n=this._tree.getBins(a);for(const o of n){o.displayId||(o.displayId=r.createDisplayId(!0));let h=null;const u=o.getGeometry(this._spatialReference,s.tile);u||(h=o.getGeometryCentroid(this._spatialReference,s.tile));const d=new mt(u,o.getAttributes(),h);d.objectId=o.id,d.displayId=o.displayId,e.push(d)}}catch{return void ht.error("Unable to get bins for tile",t.key.id)}}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return je(r,t,e,s),r}_getGeohashBounds(e){const t=this._getGeohashLevel(e.key.level),s=[e.extent.xmin,e.extent.ymin,e.extent.xmax,e.extent.ymax],r=cs.fromExtent(vt.fromBounds(s,this._spatialReference)),a=xe(r,this._spatialReference,ie.WGS84,{densificationStep:e.resolution*Ri}),n=bt(new D,a,!1,!1),o=n.coords.filter((p,f)=>!(f%2)),h=n.coords.filter((p,f)=>f%2),u=Math.min(...o),d=Math.min(...h),l=Math.max(...o),c=Math.max(...h),g=this._getGeohash(u,d,t),_=this._getGeohash(l,c,t);return{bounds:s,geohashBounds:{xLL:g.geohashX,yLL:g.geohashY,xTR:_.geohashX,yTR:_.geohashY},level:t}}_getGeohashLevel(e){return this._schema.params.fixedBinLevel}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=gs(t);if(!r)return{tile:s,left:null,right:null};const[a,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[a-n+e.bounds[0],e.bounds[3]]}}}};const ut=12,qi=64,Kt=1,Li=_t();class kt extends Ns{constructor(e,t,s,r,a){super(new D([],[t,s]),r,null,e),this.geohashBoundsInfo=a}get count(){return this.attributes.cluster_count}static create(e,t,s,r,a,n,o,h){const u=new kt(t,s,r,n,o);return u.displayId=e.createDisplayId(!0),u.referenceId=h,u.tileLevel=a,u}update(e,t,s,r,a,n){return this.geometry.coords[0]=e,this.geometry.coords[1]=t,this.tileLevel=s,this.attributes=r,this.geohashBoundsInfo=a,this.referenceId=null,this.referenceId=n,this}toJSON(){return{attributes:{...this.attributes,aggregateId:this.objectId,referenceId:this.attributes.cluster_count===1?this.referenceId:null},geometry:{x:this.geometry.coords[0],y:this.geometry.coords[1]}}}}function ce(i){return 57.29577951308232*i}class zi extends wt{constructor(e,t,s,r){super(e,s),this.type="cluster",this.events=new ke,this.objectIdField="aggregateId",this.featureAdapter=Ft,this._geohashLevel=0,this._tileLevel=0,this._aggregateValueRanges={},this._aggregateValueRangesChanged=!1,this._geohashBuf=[],this._clusters=new Map,this._tiles=new Map,this._serviceInfo=r,this.geometryInfo=e.geometryInfo,this._spatialReference=t,this._projectionSupportCheck=fs(t,ie.WGS84),this._bitsets.geohash=s.getBitset(s.createBitset()),this._bitsets.inserted=s.getBitset(s.createBitset())}destroy(){this._tree.destroy()}get featureSpatialReference(){return this._spatialReference}get fields(){return this._fields}async updateSchema(e,t){const s=this._schema;try{await super.updateSchema(e,t),await this._projectionSupportCheck}catch{}this._fields=[...this._schema.params.fields,{name:"referenceId",alias:"referenceId",type:"esriFieldTypeInteger"}],this._fields.some(a=>a.name==="cluster_count")||this._fields.push({name:"cluster_count",alias:"cluster_count",type:"esriFieldTypeInteger"}),this._fieldsIndex=new H(this._fields);const r=ye(s,t);t&&(r!=null||e.source||e.storage.filters)?((Ee(r,"params.fields")||!this._tree||e.source)&&(this._tree&&this._tree.destroy(),this._tree=new xs(this._statisticFields,this._serviceInfo),this._rebuildTree(),b("esri-2d-update-debug")&&console.debug("Aggregate mesh needs update due to tree changing")),b("esri-2d-update-debug")&&console.debug("Applying Update - ClusterStore:",r),e.targets[t.name]=!0,e.mesh=!1,this._aggregateValueRanges={}):s&&(e.mesh=!0)}clear(){this._rebuildTree()}sweepFeatures(e,t){this._bitsets.inserted.forEachSet(s=>{if(!e.has(s)){const r=t.lookupByDisplayIdUnsafe(s);this._remove(r)}})}sweepAggregates(e,t,s){this._clusters.forEach((r,a)=>{r&&r.tileLevel!==s&&(e.releaseDisplayId(r.displayId),t.unsetAttributeData(r.displayId),this._clusters.delete(a))})}onTileData(e,t,s,r,a,n=!0){if(!this._schema||t.addOrUpdate==null)return t;this.events.emit("changed");const o=this._getTransforms(e,this._spatialReference);{const d=t.addOrUpdate.getCursor();for(;d.next();)this._update(d,r)}if(t.status.mesh||!n)return t;const h=new Array,u=this._schema.params.clusterRadius;this._getClustersForTile(h,e,u,s,o),t.addOrUpdate=G.fromOptimizedFeatures(h,{fields:this.fields,fieldsIndex:this._fieldsIndex,geometryType:"esriGeometryPoint",objectIdField:this.objectIdField}),t.addOrUpdate.attachStorage(s),t.clear=!0,t.end=!0;{const d=t.addOrUpdate.getCursor();for(;d.next();){const l=d.getDisplayId();this._bitsets.computed.unset(l),this.setComputedAttributes(s,d,l,e.scale,a)}}return this._aggregateValueRangesChanged&&t.end&&(this.events.emit("valueRangesChanged",{valueRanges:this._aggregateValueRanges}),this._aggregateValueRangesChanged=!1),t}onTileUpdate({added:e,removed:t}){if(e.length){const r=e[0].level;this._tileLevel=r,this._setGeohashLevel(r)}if(!this._schema)return;const s=this._schema.params.clusterRadius;t.forEach(r=>{this._tiles.delete(r.key.id),this._markTileClustersForDeletion(r,s)})}getAggregate(e){for(const t of this._clusters.values())if(((t==null?void 0:t.displayId)&$)==(e&$))return t.toJSON();return null}getAggregates(){const e=[];for(const t of this._clusters.values())(t==null?void 0:t.tileLevel)===this._tileLevel&&e.push(t.toJSON());return e}getDisplayId(e){const t=this._clusters.get(e);return t?t.displayId:null}getFeatureDisplayIdsForAggregate(e){const t=this._clusters.get(e);return t?this._tree.getRegionDisplayIds(t.geohashBoundsInfo):[]}getDisplayIdForReferenceId(e){for(const t of this._clusters.values())if((t==null?void 0:t.referenceId)===e)return t.displayId;return null}getAggregateValueRanges(){return this._aggregateValueRanges}forEach(e){this._clusters.forEach(t=>{if(!t)return;const s=t.toJSON(),r=G.fromFeatures([s],{objectIdField:this.objectIdField,globalIdField:null,geometryType:this.geometryInfo.geometryType,fields:this.fields,fieldsIndex:this._fieldsIndex}).getCursor();r.next(),e(r)})}forEachInBounds(e,t){}forEachBounds(e,t){const{hasM:s,hasZ:r}=this.geometryInfo;for(const a of e){const n=ls(Li,a.readGeometry(),r,s);n!=null&&t(n)}}size(){let e=0;return this.forEach(t=>e++),e}_rebuildTree(){this._bitsets.computed.clear(),this._bitsets.inserted.clear(),this._tree&&this._tree.clear()}_remove(e){const t=e.getDisplayId(),s=e.getXHydrated(),r=e.getYHydrated(),a=this._geohashBuf[2*t],n=this._geohashBuf[2*t+1];this._bitsets.inserted.has(t)&&(this._bitsets.inserted.unset(t),this._tree.removeCursor(e,s,r,a,n,this._geohashLevel))}_update(e,t){const s=e.getDisplayId(),r=this._bitsets.inserted,a=t.isVisible(s);if(a===r.has(s))return;if(!a)return void this._remove(e);const n=e.getXHydrated(),o=e.getYHydrated();if(!this._setGeohash(s,n,o))return;const h=this._geohashBuf[2*s],u=this._geohashBuf[2*s+1];this._tree.insertCursor(e,s,n,o,h,u,this._geohashLevel),r.set(s)}_setGeohash(e,t,s){if(this._bitsets.geohash.has(e))return!0;const r=this._geohashBuf;if(this._spatialReference.isWebMercator){const a=ce(t/re.radius),n=a-360*Math.floor((a+180)/360),o=ce(Math.PI/2-2*Math.atan(Math.exp(-s/re.radius)));Ze(r,e,o,n,ut)}else{const a=xe({x:t,y:s},this._spatialReference,ie.WGS84);if(!a)return!1;Ze(r,e,a.y,a.x,ut)}return this._bitsets.geohash.set(e),!0}_getClustersForTile(e,t,s,r,a,n=!0){const o=this._schema.params.clusterPixelBuffer,h=2*s,u=Math.ceil(2**t.key.level*j/h)+1,d=Math.ceil(o/h)+0,l=Math.ceil(j/h),{row:c,col:g}=t.key,_=g*j,p=c*j,f=Math.floor(_/h)-d,x=Math.floor(p/h)-d,y=f+l+2*d,S=x+l+2*d,m=t.tileInfoView.getLODInfoAt(t.key.level);for(let I=f;I<=y;I++)for(let v=x;v<=S;v++){let w=I;m.wrap&&(w=I<0?I+u:I%u);const M=m.wrap&&I<0,F=m.wrap&&I%u!==I,T=this._lookupCluster(r,m,t.key.level,w,v,t);if(T!=null){let C=null;if(a&&(C=M?a.left:F?a.right:a.tile),n&&C==null||!T.count)continue;if(C!=null&&n){const A=T.geometry.clone();let E=T.attributes;A.coords[0]=us(C,A.coords[0]),A.coords[1]=ds(C,A.coords[1]),T.count===1&&T.referenceId!=null&&(E={...T.attributes,referenceId:T.referenceId});const U=new mt(A,E);U.displayId=T.displayId,e.push(U)}}}}_getGeohashLevel(e){return Math.min(Math.ceil(e/2+2),ut)}_setGeohashLevel(e){const t=this._getGeohashLevel(e),s=(Math.floor(t/Kt)+1)*Kt-1;if(this._geohashLevel!==s)return this._geohashLevel=s,this._rebuildTree(),void this._bitsets.geohash.clear()}_getTransforms(e,t){const s={originPosition:"upperLeft",scale:[e.resolution,e.resolution],translate:[e.bounds[0],e.bounds[3]]},r=gs(t);if(!r)return{tile:s,left:null,right:null};const[a,n]=r.valid;return{tile:s,left:{...s,translate:[n,e.bounds[3]]},right:{...s,translate:[a-n+e.bounds[0],e.bounds[3]]}}}_getClusterId(e,t,s){return(15&e)<<28|(16383&t)<<14|16383&s}_markForDeletion(e,t,s){const r=this._getClusterId(e,t,s);this._clusters.delete(r)}_getClusterBounds(e,t,s){const r=this._schema.params.clusterRadius,a=2*r;let n=s%2?t*a:t*a-r;const o=s*a;let h=n+a;const u=o-a,d=2**e.level*j;e.wrap&&n<0&&(n=0),e.wrap&&h>d&&(h=d);const l=n/j,c=o/j,g=h/j,_=u/j;return[e.getXForColumn(l),e.getYForRow(c),e.getXForColumn(g),e.getYForRow(_)]}_getGeohash(e,t,s){const r={geohashX:0,geohashY:0};return je(r,t,e,s),r}_getGeohashBounds(e,t){const s=this._getGeohashLevel(e.key.level);if(this._spatialReference.isWebMercator){const[p,f,x,y]=t,S={x:p,y:f},m={x,y};let I=0,v=0,w=0,M=0;{const C=ce(S.x/re.radius);I=C-360*Math.floor((C+180)/360),v=ce(Math.PI/2-2*Math.atan(Math.exp(-S.y/re.radius)))}{const C=ce(m.x/re.radius);w=C-360*Math.floor((C+180)/360),M=ce(Math.PI/2-2*Math.atan(Math.exp(-m.y/re.radius)))}const F={geohashX:0,geohashY:0},T={geohashX:0,geohashY:0};return je(F,v,I,s),je(T,M,w,s),{bounds:[p,f,x,y],geohashBounds:{xLL:F.geohashX,yLL:F.geohashY,xTR:T.geohashX,yTR:T.geohashY},level:s}}const r=cs.fromExtent(vt.fromBounds(t,this._spatialReference)),a=xe(r,this._spatialReference,ie.WGS84,{densificationStep:e.resolution*qi});if(!a)return null;const n=bt(new D,a,!1,!1),o=n.coords.filter((p,f)=>!(f%2)),h=n.coords.filter((p,f)=>f%2),u=Math.min(...o),d=Math.min(...h),l=Math.max(...o),c=Math.max(...h),g=this._getGeohash(u,d,s),_=this._getGeohash(l,c,s);return{bounds:t,geohashBounds:{xLL:g.geohashX,yLL:g.geohashY,xTR:_.geohashX,yTR:_.geohashY},level:s}}_lookupCluster(e,t,s,r,a,n){const o=this._getClusterId(s,r,a),h=this._clusters.get(o),u=this._getClusterBounds(t,r,a),d=this._getGeohashBounds(n,u);if(d==null)return null;const l=this._tree.getRegionStatistics(d),{count:c,xTotal:g,yTotal:_,referenceId:p}=l,f=c?g/c:0,x=c?_/c:0;if(c===0)return this._clusters.set(o,null),null;const y={cluster_count:c,...l.attributes},S=h!=null?h.update(f,x,s,y,d,p):kt.create(e,o,f,x,s,y,d,p);if(c===0){const[m,I,v,w]=u;S.geometry.coords[0]=(m+v)/2,S.geometry.coords[1]=(I+w)/2}return this._clusters.set(o,S),this._updateAggregateValueRangeForCluster(S,S.tileLevel),S}_updateAggregateValueRangeForCluster(e,t){const s=this._aggregateValueRanges[t]||{minValue:1/0,maxValue:0},r=s.minValue,a=s.maxValue;s.minValue=Math.min(r,e.count),s.maxValue=Math.max(a,e.count),this._aggregateValueRanges[t]=s,r===s.minValue&&a===s.maxValue||(this._aggregateValueRangesChanged=!0)}_markTileClustersForDeletion(e,t){const s=2*t,r=Math.ceil(j/s),{row:a,col:n}=e.key,o=n*j,h=a*j,u=Math.floor(o/s),d=Math.floor(h/s);for(let l=u;le))for(;i.length<=e;)i.push(t)}let Pi=class{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new Gi,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const e=this._bitsets.length;return this._bitsets.push(_s.create(this._allocatedSize,$)),e+1}getBitset(e){return this._bitsets[e-1]}_expand(){this._allocatedSize<<=1;for(const e of this._bitsets)e.resize(this._allocatedSize)}_ensureNumeric(e,t){this._numerics[e]||(this._numerics[e]=[]),Ge(this._numerics[e],t,0)}_ensureInstanceId(e){Ge(this._instanceIds,e,0)}_ensureString(e,t){this._strings[e]||(this._strings[e]=[]),Ge(this._strings[e],t,null)}createDisplayId(e=!1){const t=this._idGenerator.createId();return t>this._allocatedSize&&this._expand(),Et(t,e)}releaseDisplayId(e){for(const t of this._bitsets)t.unset(e);return this._idGenerator.releaseId(e&$)}getComputedNumeric(e,t){return this.getComputedNumericAtIndex(e&$,0)}setComputedNumeric(e,t,s){return this.setComputedNumericAtIndex(e&$,s,0)}getComputedString(e,t){return this.getComputedStringAtIndex(e&$,0)}setComputedString(e,t,s){return this.setComputedStringAtIndex(e&$,0,s)}getComputedNumericAtIndex(e,t){const s=e&$;return this._ensureNumeric(t,s),this._numerics[t][s]}setComputedNumericAtIndex(e,t,s){const r=e&$;this._ensureNumeric(t,r),this._numerics[t][r]=s}getInstanceId(e){const t=e&$;return this._ensureInstanceId(t),this._instanceIds[t]}setInstanceId(e,t){const s=e&$;this._ensureInstanceId(s),this._instanceIds[s]=t}getComputedStringAtIndex(e,t){const s=e&$;return this._ensureString(t,s),this._strings[t][s]}setComputedStringAtIndex(e,t,s){const r=e&$;this._ensureString(t,r),this._strings[t][r]=s}getXMin(e){return this._bounds[4*(e&$)]}getYMin(e){return this._bounds[4*(e&$)+1]}getXMax(e){return this._bounds[4*(e&$)+2]}getYMax(e){return this._bounds[4*(e&$)+3]}setBounds(e,t){const s=t.readHydratedGeometry();if(!(s!=null&&s.coords.length))return!1;let r=1/0,a=1/0,n=-1/0,o=-1/0;s.forEachVertex((u,d)=>{r=Math.min(r,u),a=Math.min(a,d),n=Math.max(n,u),o=Math.max(o,d)});const h=e&$;return Ge(this._bounds,4*h+4,0),this._bounds[4*h]=r,this._bounds[4*h+1]=a,this._bounds[4*h+2]=n,this._bounds[4*h+3]=o,!0}};const ji=5e3,Ni="tileRenderer.featuresView.attributeView.initialize",Qi="tileRenderer.featuresView.attributeView.requestUpdate",Yi="tileRenderer.featuresView.requestRender";function Xi(i){return i.name==="worker:port-closed"}function se(i){if(!Ie(i)&&!Xi(i))throw i}function es(i){return i.type==="feature"&&i.mode==="snapshot"}let N=class extends xt{constructor(){super(...arguments),this._storage=new Pi,this._markedIdsBufId=this._storage.createBitset(),this._lastCleanup=performance.now(),this._cleanupNeeded=!1,this._invalidated=!1,this._tileToResolver=new Map,this._didEdit=!1,this._updateVersion=1,this._updatingHandles=new It,this.tileStore=null,this.config=null,this.processor=null,this.remoteClient=null,this.service=null}initialize(){this._initStores(),this._initSource(),this._updateQueue=new lt({concurrency:this._source.type==="stream"?1:4,process:(i,e)=>this._onTileMessage(i,{signal:e})}),this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this)),Qs(()=>!this.updating,()=>this.onIdle())])}_initSource(){const i=this.tileStore.tileScheme,e=()=>this._updateQueue&&this._updateQueue.length<50,t=(s,r)=>(this._invalidated=!0,this._patchTile(s,r));this._source=oi(this.service,{...this.service,fieldsIndex:this.fieldsIndex},this.spatialReference,i,t,e,this.featureStore),this._proxyEvents()}_setStreamClientProperty(i,e){this.remoteClient.invoke("setProperty",{propertyName:i,value:e}).catch(se)}_proxyEvents(){if(this._source.type==="stream"){const i=this._source.events,e=this._source;this.addHandles([Ve(()=>e.connectionStatus,t=>this._setStreamClientProperty("pipelineConnectionStatus",t),{initial:!0}),Ve(()=>e.errorString,t=>this._setStreamClientProperty("pipelineErrorString",t),{initial:!0}),i.on("data-received",t=>this.remoteClient.invoke("emitEvent",{name:"data-received",event:{attributes:t.attributes,centroid:t.centroid,geometry:t.geometry}}).catch(se)),i.on("message-received",t=>this.remoteClient.invoke("emitEvent",{name:"message-received",event:t}).catch(se)),i.on("updateRate",t=>this.remoteClient.invoke("emitEvent",{name:"update-rate",event:{...t}}).catch(se))])}}_initAttributeStore(i){this.attributeStore||(this.attributeStore=new Ui({type:"remote",initialize:(e,t)=>Pe(this.remoteClient.invoke(Ni,e,{signal:t}).catch(se)),update:(e,t)=>Pe(this.remoteClient.invoke(Qi,e,{signal:t}).catch(se)),render:e=>Pe(this.remoteClient.invoke(Yi,void 0,{signal:e}).catch(se))},i))}_initStores(){const i=this.service.type==="snapshot"?"snapshot":"on-demand",e={geometryInfo:{geometryType:this.service.geometryType,hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex};this.featureStore=new Mr(e,this._storage,i)}_initQueryEngine(i){var t;const e=this;(t=this.featureQueryEngine)==null||t.destroy(),this.featureQueryEngine=new Dt({availableFields:i.availableFields,definitionExpression:i.schema.source.definitionExpression??void 0,fieldsIndex:H.fromJSON(this.service.fieldsIndex),geometryType:this.service.geometryType,objectIdField:this.service.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!0,featureStore:this.featureStore,aggregateAdapter:{getFeatureObjectIds(s){return e.aggregateStore==null?[]:e.aggregateStore.getFeatureDisplayIdsForAggregate(s).map(r=>e.getObjectId(r))}},timeInfo:this.service.timeInfo})}_initAggregateQueryEngine(i,e){var s;if((s=this.aggregateQueryEngine)==null||s.destroy(),i==null)return;const t=e.targets.aggregate.params.fields.slice();this.aggregateQueryEngine=new Dt({definitionExpression:void 0,fieldsIndex:H.fromLayerJSON({fields:t,dateFieldsTimeReference:{timeZoneIANA:Ys}}),geometryType:i.geometryInfo.geometryType,objectIdField:i.objectIdField,hasM:i.geometryInfo.hasM,hasZ:i.geometryInfo.hasZ,spatialReference:this.spatialReference.toJSON(),cacheSpatialQueries:!1,featureStore:i,aggregateAdapter:{getFeatureObjectIds:r=>[]}})}destroy(){var i,e,t;this._updateQueue.destroy(),this._source.destroy(),(i=this.featureQueryEngine)==null||i.destroy(),(e=this.aggregateQueryEngine)==null||e.destroy(),(t=this.attributeStore)==null||t.destroy();for(const s of this.tileStore.tiles)this._source.unsubscribe(s);clearInterval(this._checkUpdating),this._updatingHandles.destroy()}get fieldsIndex(){return H.fromJSON(this.service.fieldsIndex)}get spatialReference(){return this.tileStore.tileScheme.spatialReference}get dataUpdating(){return this._source.updatingHandles.updating}get updating(){return this.isUpdating()}isUpdating(){const i=this._source.updatingHandles.updating,e=!this.attributeStore||this.attributeStore.updatingHandles.updating,t=i||e||this._updatingHandles.updating;if(b("esri-2d-log-updating")){let s=`Updating FeatureController2D: ${t} +`;s+=` -> updatingSource ${i} +`;for(const r of this._source.subscriptions)s+=` ${r.tile.id} ${r.isDone} +`;s+=` -> updatingAttributeStore ${e} +`,s+=` -> updatingHandles ${this._updatingHandles.updating} (queue: ${this._updateQueue.length}) +`,console.log(s)}return t}updateCustomParameters(i){this._source.type==="stream"&&this._source.updateCustomParameters(i)}enableEvent(i){this._source.enableEvent(i.name,i.value)}pause(){this._updateQueue.pause(),this._updateQueue.clear()}resume(){this._updateQueue.resume()}pauseStream(){this._source.type==="stream"&&this._source.pauseStream()}resumeStream(){this._source.type==="stream"&&this._source.resumeStream()}sendMessageToSocket(i){this._source.type==="stream"&&this._source.sendMessageToSocket(i)}sendMessageToClient(i){this._source.type==="stream"&&this._source.sendMessageToClient(i)}_initAggregateStore(i){var t,s,r,a,n;const e=((s=(t=i.schema.targets)==null?void 0:t.aggregate)==null?void 0:s.type)??null;if((((n=(a=(r=this.config)==null?void 0:r.schema.targets)==null?void 0:a.aggregate)==null?void 0:n.type)??null)!==e&&(this.aggregateStore!=null&&(this.removeHandles("valueRangesChanged"),this.aggregateStore.destroy(),this.aggregateStore=null),e)){switch(e){case"cluster":{const o={geometryInfo:{geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new zi(o,this.spatialReference,this._storage,{...this.service,fieldsIndex:this.fieldsIndex}),this.addHandles(this.aggregateStore.events.on("valueRangesChanged",h=>{this.remoteClient.invoke("emitEvent",{name:"valueRangesChanged",event:{valueRanges:h.valueRanges}}).catch(se)}),"valueRangesChanged");break}case"bin":{const o={geometryInfo:{geometryType:"esriGeometryPolygon",hasM:!1,hasZ:!1},spatialReference:this.spatialReference,fieldsIndex:this.fieldsIndex,fields:this.service.fields};this.aggregateStore=new Oi(o,this.spatialReference,this._storage,{...this.service,fieldsIndex:this.fieldsIndex});break}}this.aggregateStore.onTileUpdate({added:this.tileStore.tiles,removed:[]})}}async update(i,e){var t;this._updateVersion++,b("esri-2d-update-debug")&&console.debug(`FeatureController2D::update: Token version ${this._updateVersion}`),this._initQueryEngine(e),this._initAttributeStore(e),this.pause(),((t=this.config)==null?void 0:t.timeZone)!==e.timeZone&&(i.mesh=!0,i.storage.data=!0,i.storage.filters=!0,i.targets.aggregate=!0,i.targets.feature=!0,this.featureStore.invalidate()),await Promise.all([this._source.update(i,e.schema.source),this.featureStore.updateSchema(i,e.schema.targets.feature),this.attributeStore.update(i,e),this.attributeStore.updateFilters(i,e,this)]),this._initAggregateStore(e),this.aggregateStore!=null&&await this.aggregateStore.updateSchema(i,e.schema.targets.aggregate),this._initAggregateQueryEngine(this.aggregateStore,e.schema),b("esri-2d-update-debug")&&i.describe(),this._set("config",e)}async applyUpdate(i){i.version=this._updateVersion,b("esri-2d-update-debug")&&console.debug(`FeatureController2D::applyUpdate: Token version ${i.version}`),i.mesh&&this.clearTiles(),this._updateQueue.resume(),await this._source.applyUpdate(i),b("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for source update to finish"),this.notifyChange("updating"),await De(()=>!this.updating),b("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Source update finsihed"),this.aggregateStore!=null&&(await hs(10),b("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Waiting for aggregate idle call"),await De(()=>!this.updating),b("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Aggregate idle called")),b("esri-2d-update-debug")&&console.debug("FeatureController2D::applyUpdate Update finished")}async onEdits({edits:i}){b("esri-2d-update-debug")&&console.debug("Applying Edit:",i),this._didEdit=!0;try{const e=i.removed.map(s=>s.objectId&&s.objectId!==-1?s.objectId:this._lookupObjectIdByGlobalId(s.globalId)),t=i.addOrModified.map(({objectId:s})=>s);this.featureStore.invalidate(),await this._source.edit(t,e),this.clearTiles(),this.notifyChange("updating"),this.aggregateStore!=null&&this.aggregateStore.clear(),await this._source.resend(),await De(()=>!this.updating)}catch{}}async refresh(i){if(!i.dataChanged){const e=z.empty();return e.storage.filters=!0,this.applyUpdate(e)}this.featureStore.invalidate(),this.clearTiles(),this._source.refresh(this._updateVersion,i),this._cleanupNeeded=!0,this.notifyChange("updating"),await De(()=>!this.updating)}clearTiles(){for(const i of this.tileStore.tiles)this.processor.onTileClear(i,!1)}onTileUpdate(i){this.aggregateStore!=null&&this.aggregateStore.onTileUpdate(i);for(const e of i.added){const t=this._source.subscribe(e,this._updateVersion);this._source.type!=="stream"&&this._updatingHandles.addPromise(t.done),this._level=e.level}for(const e of i.removed)this._source.unsubscribe(e),this._cleanupNeeded=!0,this._tileToResolver.has(e.id)&&(this._tileToResolver.get(e.id).resolve(),this._tileToResolver.delete(e.id));this.notifyChange("updating")}async onIdle(){this._invalidated&&(this._invalidated=!1,this.aggregateStore==null&&this.processor.type!=="heatmap"||await this._repushCurrentLevelTiles()),this._markAndSweep()}async querySummaryStatistics({query:i,params:e}){return this.featureQueryEngine.executeQueryForSummaryStatistics(i,e)}async queryAggregateSummaryStatistics({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForSummaryStatistics(this._normalizeAggregateQuery(i),e)}async queryUniqueValues({query:i,params:e}){return this.featureQueryEngine.executeQueryForUniqueValues(i,e)}async queryAggregateUniqueValues({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForUniqueValues(this._normalizeAggregateQuery(i),e)}async queryClassBreaks({query:i,params:e}){return this.featureQueryEngine.executeQueryForClassBreaks(i,e)}async queryAggregateClassBreaks({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForClassBreaks(this._normalizeAggregateQuery(i),e)}async queryHistogram({query:i,params:e}){return this.featureQueryEngine.executeQueryForHistogram(i,e)}async queryAggregateHistogram({query:i,params:e}){return this.aggregateQueryEngine.executeQueryForHistogram(this._normalizeAggregateQuery(i),e)}queryExtent(i){return this.featureQueryEngine.executeQueryForExtent(i)}queryAggregates(i){return this.aggregateQueryEngine.executeQuery(this._normalizeAggregateQuery(i))}queryAggregateCount(i){return this.aggregateQueryEngine.executeQueryForCount(this._normalizeAggregateQuery(i))}queryAggregateIds(i){return this.aggregateQueryEngine.executeQueryForIds(this._normalizeAggregateQuery(i))}queryFeatures(i){return this.featureQueryEngine.executeQuery(i)}async queryVisibleFeatures(i){const e=await this.featureQueryEngine.executeQuery(i),t=e.objectIdFieldName;return e.features=e.features.filter(s=>{const r=s.attributes[t],a=this.getDisplayId(r);return a!=null&&this.attributeStore.isVisible(a)}),e}queryFeatureCount(i){return this.featureQueryEngine.executeQueryForCount(i)}queryLatestObservations(i){return this.featureQueryEngine.executeQueryForLatestObservations(i)}queryObjectIds(i){return this.featureQueryEngine.executeQueryForIds(i)}async queryStatistics(){return this.featureStore.storeStatistics}getObjectId(i){return this.featureStore.lookupObjectId(i,this._storage)}getDisplayId(i){if(this.aggregateStore!=null){const e=this.aggregateStore.getDisplayId(i);if(e==null){const t=this.featureStore.lookupDisplayId(i);return this.aggregateStore.getDisplayIdForReferenceId(t)}return e}return this.featureStore.lookupDisplayId(i)}getFeatures(i){const e=[],t=[];for(const s of i){const r=this.aggregateStore!=null?this.getAggregate(s):null;if(r!=null)if(r.attributes.referenceId!=null){const a=this.getFeature(r.attributes.referenceId);a!=null&&e.push(a)}else t.push(r);else{const a=this.getFeature(s);a!=null&&e.push(a)}}return{features:e,aggregates:t}}getFeature(i){const e=this.featureStore.lookupFeatureByDisplayId(i,this._storage);if(e==null)return null;const t=e.readHydratedGeometry(),s=$e(t,e.geometryType,e.hasZ,e.hasM);return{attributes:e.readAttributes(),geometry:s}}getAggregate(i){return this.aggregateStore==null?null:this.aggregateStore.getAggregate(i)}getAggregates(){return this.aggregateStore==null?[]:this.aggregateStore.getAggregates()}async setHighlight(i){const e=i.map(t=>this.getDisplayId(t)).filter(ns);return this.attributeStore.setHighlight(i,e)}_normalizeAggregateQuery(i){const e=i.objectIds??[];for(const t of i.aggregateIds??[])e.push(t);return i.objectIds=e,i.aggregateIds=[],i}_lookupObjectIdByGlobalId(i){const e=this.service.globalIdField;if(e==null)throw new Error("Expected globalIdField to be defined");let t=null;if(this.featureStore.forEach(s=>{i===s.readAttribute(e)&&(t=s.getObjectId())}),t==null)throw new Error(`Expected to find a feature with globalId ${i}`);return t}async _repushCurrentLevelTiles(){const i=this.tileStore.tiles.filter(t=>t.level===this._level);i.map(async t=>this._patchTile({type:"append",id:t.key.id,clear:!0,addOrUpdate:null,end:!1}));const e=i.map(async t=>this._patchTile({type:"append",id:t.key.id,addOrUpdate:G.fromOptimizedFeatures([],{...this.service,fieldsIndex:this.fieldsIndex}),remove:[],end:!0,isRepush:!0,status:z.empty()}));await Promise.all(e)}_maybeForceCleanup(){performance.now()-this._lastCleanup>ji&&this._markAndSweep()}_patchTile(i,e){const t=this._updateQueue.push(i,e).catch(s=>{});return this._updatingHandles.addPromise(t)}async _onTileMessage(i,e){var a,n,o;if(P(e),b("esri-2d-update-debug")){const h=(a=i.addOrUpdate)==null?void 0:a.hasFeatures;console.debug(i.id,`FeatureController:onTileMessage: [clear:${i.clear}, end:${i.end}, features: ${h}]`)}const t=this.tileStore.get(i.id);if(!t)return;if(i.clear)return this.processor.onTileClear(t,i.end);const s=i.status;this._cleanupNeeded=!0;const r=[];for(const h of i.remove??[]){const u=this.featureStore.lookupDisplayId(h);u&&r.push(u)}i.remove=r;try{if(i.addOrUpdate==null)return void this.processor.onTileMessage(t,{...i,addOrUpdate:null},this.aggregateStore!=null,e).catch(He);if(i.addOrUpdate.setArcadeSpatialReference(this.spatialReference),this.featureStore.hasInstance(i.addOrUpdate.instance)&&s.targets.feature||(s.targets.feature=!0,this.featureStore.onTileData(t,i,(n=this.config)==null?void 0:n.timeZone)),(!s.storage.data||!s.storage.filters)&&(s.storage.data=!0,s.storage.filters=!0,this.attributeStore.onTileData(t,i),this._source.type==="stream"||this._didEdit?(await this.attributeStore.sendUpdates(),P(e)):this.attributeStore.sendUpdates()),this.aggregateStore!=null&&!s.targets.aggregate){s.targets.aggregate=!0;const h=es(this._source)&&this._source.loading,u=!es(this._source)||h||i.end;if(this.aggregateStore.onTileData(t,i,this._storage,this.attributeStore,(o=this.config)==null?void 0:o.timeZone,u),!u)return;s.mesh||(this.attributeStore.onTileData(t,i),await this.attributeStore.sendUpdates())}if(!s.mesh){s.mesh=!0;const h=this.aggregateStore!=null&&this.aggregateStore.type==="cluster";await this.processor.onTileMessage(t,i,h,e),P(e)}this._maybeForceCleanup()}catch(h){He(h)}}_mark(i,e,t){const s=(4294901760&this._storage.getInstanceId(i))>>>16;i&&(e.add(s),t.set(i))}_markAndSweep(){if(this._lastCleanup=performance.now(),!(!(this._source.type==="feature"&&this._source.mode==="snapshot")&&(this._source.type==="stream"||this._cleanupNeeded)))return;this._cleanupNeeded=!1;const i=this._storage.getBitset(this._markedIdsBufId),e=new Set;i.clear();for(const t of this.tileStore.tiles)for(const s of this._source.readers(t.id)){const r=s.getCursor();for(;r.next();){let a=r.getDisplayId();if(!a){const n=r.getObjectId();a=this.featureStore.lookupDisplayId(n)}this._mark(a,e,i)}}this.processor.type==="symbol"&&this.processor.forEachBufferId(t=>{this._mark(t,e,i)}),this._updateQueue.forEach(t=>{for(const s of t.remove??[]){const r=this.featureStore.lookupDisplayId(s);this._mark(r,e,i)}}),this.aggregateStore!=null&&(this.aggregateStore.sweepFeatures(i,this.featureStore),"sweepAggregates"in this.aggregateStore&&this.aggregateStore.sweepAggregates(this._storage,this.attributeStore,this._level)),this.featureStore.sweepFeatures(i,this._storage,this.attributeStore),this.featureStore.sweepFeatureSets(e)}};k([O({constructOnly:!0})],N.prototype,"tileStore",void 0),k([O()],N.prototype,"config",void 0),k([O({readOnly:!0})],N.prototype,"fieldsIndex",null),k([O()],N.prototype,"processor",void 0),k([O({constructOnly:!0})],N.prototype,"remoteClient",void 0),k([O({constructOnly:!0})],N.prototype,"service",void 0),k([O()],N.prototype,"spatialReference",null),k([O()],N.prototype,"dataUpdating",null),k([O()],N.prototype,"updating",null),N=k([Je("esri.views.2d.layers.features.controllers.FeatureController2D")],N);const Hi=N;let ts=class bs{constructor(e,t){this.key=new ps(0,0,0,0),this.bounds=Xs(),this.objectIds=new Set,this.key.set(t);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.scale=s.scale,this.level=s.level}get id(){return this.key.id}get extent(){return vt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createChildTiles(){const e=this.key.getChildKeys(),t=Hs.acquire();for(let s=0;s({minX:t.bounds[0],minY:t.bounds[1],maxX:t.bounds[2],maxY:t.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=e}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(e){return this._tiles.has(e)}get(e){return this._tiles.get(e)}boundsIntersections(e){return this._index.search({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]})}updateTiles(e){const t={added:[],removed:[]};for(const s of e.added)if(!this.has(s)){const r=new ts(this.tileScheme,s);this._tiles.set(s,r),this._index.insert(r),t.added.push(r)}for(const s of e.removed)if(this.has(s)){const r=this.get(s);this._tiles.delete(s),this._index.remove(r),t.removed.push(r)}this.tiles.length=0,this._tiles.forEach(s=>this.tiles.push(s)),(t.added.length||t.removed.length)&&this.emit("update",t)}setViewState(e){const t=this.tileScheme.getTileCoverage(e,0);if(!t)return;const{spans:s,lodInfo:r}=t,{level:a}=r;if(s.length>0)for(const{row:n,colFrom:o,colTo:h}of s)for(let u=o;u<=h;u++){const d=Vi.set(a,n,r.normalizeCol(u),r.getWorldForColumn(u)).id;if(dt.add(d),!this.has(d)){const l=new ts(this.tileScheme,d);this._tiles.set(d,l),this._index.insert(l),this.tiles.push(l),he.added.push(l)}}for(let n=this.tiles.length-1;n>=0;n--){const o=this.tiles[n];dt.has(o.id)||(this._tiles.delete(o.id),this.tiles.splice(n,1),this._index.remove(o),he.removed.push(o))}(he.added.length||he.removed.length)&&this.emit("update",he),Zs.pool.release(t),dt.clear(),he.added.length=0,he.removed.length=0}},ue=class extends xt{constructor(){super(...arguments),this.controller=null,this.processor=null,this.remoteClient=null,this.tileStore=null,this.service=null,this.viewState=null,this._paused=!1,this._pendingTileUpdates=[]}initialize(){this.addHandles([Ve(()=>this.updating,i=>{this.remoteClient.invoke("setUpdating",i).catch(e=>{})})])}destroy(){var i,e;this.stop(),(i=this.controller)==null||i.destroy(),(e=this.processor)==null||e.destroy(),this.controller=this.processor=this.tileStore=this.remoteClient=null}get updating(){return!this.controller||this.controller.updating}stop(){var i,e,t;this._paused=!0,Array.isArray((i=this.service)==null?void 0:i.source)&&(this.service.source.forEach(s=>s.close()),this.service.source.length=0),(e=this.tileStore)==null||e.updateTiles({added:[],removed:this.tileStore.tiles.map(s=>s.id)}),(t=this.tileStore)==null||t.destroy(),this.tileStore=null,this._pendingTileUpdates.length=0}async startup({service:i,config:e,tileInfo:t,tiles:s}){var r,a,n;if(this._paused=!0,Array.isArray((r=this.service)==null?void 0:r.source)&&(this.service.source.forEach(o=>o.close()),this.service.source.length=0),this.service=i,!this.tileStore||!Js(this.tileStore.tileScheme.spatialReference,t.spatialReference)){const o=new Ws(Ks.fromJSON(t));s.added.length=s.removed.length=0,(a=this.tileStore)==null||a.updateTiles({added:[],removed:this.tileStore.tiles.map(h=>h.id)}),(n=this.tileStore)==null||n.destroy(),this.tileStore=new Zi(o),this._pendingTileUpdates.length=0}for(await this._createProcessorAndController(e),await this.update({config:e}),this.controller.resume(),this.tileStore.clear(),this.tileStore.updateTiles(s),this._paused=!1;this._pendingTileUpdates.length;)this.tileStore.updateTiles(this._pendingTileUpdates.pop())}async updateTiles(i){var e;this._paused?this._pendingTileUpdates.push(i):(e=this.tileStore)==null||e.updateTiles(i)}async update({config:i}){const e=z.empty();return await Promise.all([this.processor.update(e,i),this.controller.update(e,i)]),e.toJSON()}async applyUpdate(i){return this.controller.applyUpdate(z.create(i))}async _createProcessorAndController(i){await Promise.all([this._handleControllerConfig(i),this._handleProcessorConfig(i)]),this.controller.processor=this.processor}async _handleControllerConfig(i){return this._createController(this.service,i)}async _handleProcessorConfig(i){return this._createProcessor(this.service,i)}async _createController(i,e){this.controller&&(this.controller.destroy(),this.removeHandles("controller"));const{tileStore:t,remoteClient:s}=this,r=new Hi({service:i,tileStore:t,remoteClient:s}),a=Ve(()=>r.dataUpdating,n=>{this.remoteClient.invoke("setDataUpdating",n).catch(o=>{})});return this.addHandles(a,"controller"),this.controller=r,r}async _createProcessor(i,e){const t=e.schema.processors[0].type,s=(await fr(t)).default,{remoteClient:r,tileStore:a}=this,n=new s({service:i,config:e,tileStore:a,remoteClient:r});return this.processor&&this.processor.destroy(),this.processor=n,n}};k([O()],ue.prototype,"controller",void 0),k([O()],ue.prototype,"processor",void 0),k([O()],ue.prototype,"updating",null),k([O()],ue.prototype,"viewState",void 0),ue=k([Je("esri.views.2d.layers.features.Pipeline")],ue);const Ji=ue,La=Object.freeze(Object.defineProperty({__proto__:null,default:Ji},Symbol.toStringTag,{value:"Module"}));export{ka as G,Ft as I,La as P,Ea as R,_e as f,$a as k,Ma as p}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/HeatmapProcessor-QI9jD0nx.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/definitions-DqQMJYPH.js","assets/BaseProcessor-nWGHAt7P.js","assets/SymbolProcessor-pXDjnfSh.js","assets/cimAnalyzer-DtyBzAGI.js","assets/labelPoint-ysDT9nFH.js","assets/TileClipper-NSFZXMR1.js","assets/number-sTjsTbdA.js","assets/BidiEngine-8z8MVveq.js","assets/enums-uQoFEhYh.js","assets/TurboLine-SWK4qRwh.js","assets/Rect-bBBxMtVp.js","assets/GeometryUtils-K2DOc0l8.js","assets/FeatureFilter-w5_DYl72.js","assets/QueryEngine-8tLWlkSE.js","assets/WhereClause-XAMIZ4-B.js","assets/TimeOnly-ljWtUK7N.js","assets/json-v6EOeNTY.js","assets/QueryEngineCapabilities-PzVpW5yD.js","assets/utils-P5wTOmqv.js","assets/generateRendererUtils-_1jVE02H.js","assets/StreamFeatureManager-QrKJ84_c.js","assets/quickselect-UFB0jJTZ.js","assets/ogcFeatureUtils-dtzP0u64.js","assets/geojson-fSjaGZrp.js","assets/date-be_IQzZd.js","assets/clientSideDefaults-F-CNnR0g.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/queryZScale-IaMm02_2.js","assets/createConnection-4ppGVnSc.js","assets/geohashUtils-U0jvYCSY.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/PointCloudLayer-qVzMPRjJ.js b/dist/assets/PointCloudLayer-qVzMPRjJ.js new file mode 100644 index 0000000..80919de --- /dev/null +++ b/dist/assets/PointCloudLayer-qVzMPRjJ.js @@ -0,0 +1,11 @@ +import{e as r,y as i,c as y,dr as B,ey as x,iw as g,bI as u,iO as V,em as E,dM as N,dN as _,dO as O,dP as L,en as A,dw as w,dD as D,dQ as k,il as K,oI as C,E as l,h6 as M,bW as G,iP as P,iQ as T,iR as Q,Z as F,iS as U,iu as z,iv as H,dt as W,iH as Z,dV as J,du as X,ix as Y,c7 as ee}from"./index-J0iiHjMT.js";import{c as q,d as te,b as re,a as ie}from"./PointCloudUniqueValueRenderer-RbbyNiwC.js";let f=class extends B{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],f.prototype,"type",void 0),f=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],f);const m=f;var b;let d=b=class extends m{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new b({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[x],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],d.prototype,"requiredClearBits",void 0),r([i({type:[x],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],d.prototype,"requiredSetBits",void 0),r([g({pointCloudBitfieldFilter:"bitfield"})],d.prototype,"type",void 0),d=b=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],d);const oe=d;var I;let h=I=class extends m{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new I({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"includedReturns",void 0),r([g({pointCloudReturnFilter:"return"})],h.prototype,"type",void 0),h=I=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],h);const se=h;var $;let p=$=class extends m{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new $({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"mode",void 0),r([g({pointCloudValueFilter:"value"})],p.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"values",void 0),p=$=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],p);const ne=p,ae={key:"type",base:m,typeMap:{value:ne,bitfield:oe,return:se}};var S;let v=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([g({pointCloudRGBRenderer:"point-cloud-rgb"})],v.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],v.prototype,"field",void 0),v=S=r([y("esri.renderers.PointCloudRGBRenderer")],v);const le=v,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":te,"point-cloud-rgb":le,"point-cloud-stretch":re,"point-cloud-unique-value":ie},errorContext:"renderer"},j=Y();let o=class extends V(E(N(_(O(L(A(ee))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t!=null&&t.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new w;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new w({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){D("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(k).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=K(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){var a;const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` + var returnValue = $feature.${t.name}; + return (returnValue % 16) + " / " + Floor(returnValue / 16); + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){var a;const t=this.fieldsIndex.get("RGB");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` + var rgb = $feature.${t.name}; + var red = Floor(rgb / 65536, 0); + var green = Floor((rgb - (red * 65536)) / 256,0); + var blue = rgb - (red * 65536) - (green * 256); + + return "rgb(" + red + "," + green + "," + blue + ")"; + `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-rgb-decoded"}async queryCachedStatistics(e,t){if(await this.load(t),!this.attributeStorageInfo)throw new l("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const n=this.fieldsIndex.get(e);if(!n)throw new l("pointcloudlayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const s of this.attributeStorageInfo)if(s.name===n.name){const a=M(this.parsedUrl.path,`./statistics/${s.key}`);return G(a,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(c=>c.data)}throw new l("pointcloudlayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(P.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"point-cloud"};return this._debouncedSaveOperations(P.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="PointCloud")throw new l("pointcloudlayer:layer-type-not-supported","PointCloudLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new l("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"});if(this.version.major>2)throw new l("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x-2.x"})}hasCachedStatistics(e){return this.attributeStorageInfo!=null&&this.attributeStorageInfo.some(t=>t.name===e)}_getTypeKeywords(){return["PointCloud"]}_validateElevationInfo(){const e=this.elevationInfo;T(F.getLogger(this),Q("Point cloud layers","absolute-height",e)),T(F.getLogger(this),U("Point cloud layers",e))}};r([i({type:["PointCloudLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(z)],o.prototype,"popupEnabled",void 0),r([i({type:H,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),r([i({readOnly:!0,json:{write:!1,read:!1,origins:{"web-document":{write:!1,read:!1}}}})],o.prototype,"opacity",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({types:[ae],json:{origins:{service:{read:{source:"filters"}}},name:"layerDefinition.filters",write:!0}})],o.prototype,"filters",void 0),r([i({type:[w]})],o.prototype,"fields",void 0),r([i(j.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([W("service","fields",["fields","attributeStorageInfo"])],o.prototype,"readServiceFields",null),r([i(j.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),r([i(Z)],o.prototype,"elevationInfo",null),r([i({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),r([i(J)],o.prototype,"legendEnabled",void 0),r([i({types:R,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:{target:{"layerDefinition.drawingInfo.renderer":{types:R},"layerDefinition.drawingInfo.transparency":{type:Number}}}}})],o.prototype,"renderer",void 0),r([X("renderer")],o.prototype,"writeRenderer",null),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),o=r([y("esri.layers.PointCloudLayer")],o);const ue=o;export{ue as default}; diff --git a/dist/assets/PointCloudLayerView3D-KHREaqUZ.js b/dist/assets/PointCloudLayerView3D-KHREaqUZ.js new file mode 100644 index 0000000..dc21d58 --- /dev/null +++ b/dist/assets/PointCloudLayerView3D-KHREaqUZ.js @@ -0,0 +1,62 @@ +import{ls as tt,ax as A,yw as it,eh as Q,yx as Qe,yy as We,yz as st,yA as rt,tH as nt,e as p,y as b,c as ue,S as ot,a2 as Te,yB as at,c9 as lt,y8 as dt,yC as de,yD as ht,xz as ut,xA as w,xC as ct,bf as B,yE as pt,o7 as _t,bw as gt,yF as ft,yG as fe,hL as ee,yH as mt,yI as me,as as be,xn as L,yJ as bt,yK as yt,xy as C,yL as St,yM as xt,bA as Pt,aa as k,a9 as vt,xM as wt,de as Nt,xO as zt,xP as Ct,y6 as Ue,xQ as Rt,lZ as $t,xU as At,xW as It,yn as Ot,yp as Mt,xL as E,xN as Et,sk as ye,qE as Se,yN as Ft,a_ as Lt,lX as Be,cd as kt,aT as Ge,aU as xe,aQ as Vt,au as Dt,bb as qt,t3 as Ht,yO as Pe,yP as je,yQ as Qt,sD as Wt,yR as Tt,cP as Ut,aY as T,b3 as Bt,m6 as Gt,uS as te,rd as jt,l9 as Jt,s6 as ve,yS as Yt,uT as we,uU as Ne,yT as Kt,tO as Xt,fH as ze,yU as Zt,dA as ei,lU as ti,bB as ii,yV as si,yW as ri,tM as Ce,P as x,d as ni,C as oi,ai,n as Re,a as li,jT as di,q5 as hi,si as ui,jR as ci,yX as pi,yY as _i,e3 as $e,V as gi,sG as fi,yZ as mi,tS as bi,f as yi,Z as ie,gH as Si,s as Ae,aE as xi,y_ as Pi,lD as Ie,gm as vi,fi as wi,ae as Ni,gO as zi,jN as Ci,ov as Ri}from"./index-J0iiHjMT.js";import{n as $i}from"./LayerView3D-iOx2MD1g.js";import{c as Ai,u as Ii,a as Oi}from"./PointCloudWorkerUtil-q8ml4JQu.js";import{i as Mi}from"./PopupSceneLayerView-cRxapYqF.js";import{u as Ei}from"./LayerView-efDufa6j.js";import"./PointCloudUniqueValueRenderer-RbbyNiwC.js";let Fi=class extends tt{constructor(t){super("PointCloudWorker","transform",{transform:i=>this._getTransferList(i)},t)}_getTransferList(t){const i=[t.geometryBuffer];if(t.primaryAttributeData!=null&&t.primaryAttributeData.buffer&&i.push(t.primaryAttributeData.buffer),t.modulationAttributeData!=null&&t.modulationAttributeData.buffer&&i.push(t.modulationAttributeData.buffer),t.filterAttributesData!=null)for(const s of t.filterAttributesData)s!=null&&s.buffer&&i.push(s.buffer);for(const s of t.userAttributesData)s.buffer&&i.push(s.buffer);return i}};function Li(e,t,i){for(let r=0;r=0&&(re[r]=!0,R[n]!=null?R[n].push(t[r]):R[n]=[t[r]])}for(let r=0;r=0&&(se[r]=!0,$[n]!=null?$[n].push(e[r]):$[n]=[e[r]])}const s=[];for(let r=0;r1||$[r][0]!==t[r])&&s.push({load:[t[r]],remove:$[r]});for(let r=0;r1||R[r][0]!==e[r])&&s.push({load:R[r],remove:[e[r]]});return s}const se=[!1],R=[null],re=[!1],$=[null];function Oe(e,t,i){let s=e;for(;s>0;){const r=t.indexOf(s);if(r>=0)return r;s=i.getParentId(s)}return t.indexOf(s)}function ki(e,t,i){return e.sort((s,r)=>{if(s.load.length===0&&r.load.length===0)return 0;if(s.load.length===0)return-1;if(r.load.length===0)return 1;if(s.remove.length===0&&r.remove.length===0){const n=i.getRenderCenter(s.load[0]),a=i.getRenderCenter(r.load[0]);return A(n,t)-A(a,t)}if(s.remove.length===0)return-1;if(r.remove.length===0)return 1;if(s.load.length===1&&r.load.length===1){const n=i.getRenderCenter(s.load[0]),a=i.getRenderCenter(r.load[0]);return A(n,t)-A(a,t)}if(s.load.length===1)return-1;if(r.load.length===1)return 1;{const n=i.getRenderCenter(s.remove[0]),a=i.getRenderCenter(r.remove[0]);return A(n,t)-A(a,t)}})}function Vi(e,t,i){for(let s=0;st&&r.remove.length===1&&Di(e,r,i)}}function Di(e,t,i){const s=[t.remove[0]],r=[];for(;s.length===1;){const n=s.pop();r.length=0;for(let a=0;a1?e.push({remove:[s[n]],load:r[n]}):s[n]=r[n][0]}class qi{constructor(t,i,s){this._pages=[],this.pageSize=0,this._nodeSR=null,this._renderSR=null,this._nodeSR=t,this._renderSR=i,this.pageSize=s}addPage(t,i,s=0){for(;this._pages.lengthHi(t,i,s)}}function Hi(e,t,i){const s=e.index;if(!s.hasNodes(0,1))return;const r=e.queue;r.length=0,r.push(0);const n=e.masks;for(n.length=0,n.push(0);r.length>0;){const a=r.pop();let o=n.pop();const l=s.getNode(a),d=s.getRenderObb(a);let g=!0;if(t.clippingBox!=null){const _=1<0?g=!1:u<0&&(o|=c)}}if(i.predicate(a,l,g)){const _=l.firstChild,c=l.childCount;let u=!1;const y=v(_,s.pageSize),N=v(_+c-1,s.pageSize);for(let f=y;f<=N;f++)if(!s.hasPage(f)){i.pageMiss(a,f),u=!0;break}if(!u)for(let f=0;f({filterJSON:i.toJSON(),attributeInfo:W(e.attributeStorageInfo,i.field)})):[]}function Ti(e){const t=e==null?void 0:e.pointSizeAlgorithm;return t&&t.type==="splat"?t:null}function Fe(e){const t=e==null?void 0:e.pointSizeAlgorithm;return t&&t.type==="fixed-size"?t:null}function Ui(e){const t=e==null?void 0:e.pointSizeAlgorithm;return!!(t!=null&&t.type)&&t.type==="fixed-size"}function Le(e,t){for(const i of e??[])if(i.name===t&&i.attributeValues!=null&&i.attributeValues.valueType==="UInt8"&&i.attributeValues.valuesPerElement===3)return{name:t,storageInfo:i,useElevation:!1};return null}function W(e,t){for(const i of e??[])if(i.name===t){const s=i.encoding==="embedded-elevation";return s?{name:t,storageInfo:null,useElevation:s}:{name:t,storageInfo:i,useElevation:s}}return(t==null?void 0:t.toLowerCase())==="elevation"?{name:t,storageInfo:null,useElevation:!0}:null}let H=class extends ot{constructor(e){super(e),this.pointCloudMetadata=null}};p([b({constructOnly:!0,clonable:"reference"})],H.prototype,"pointCloudMetadata",void 0),H=p([ue("esri.views.3d.layers.i3s.PointGraphic")],H);class Bi{constructor(t){this._context=t,this._highlights=new Set}get empty(){return this._highlights.size===0}destroy(){this._highlights=null}add(t){const i=new Gi(t);return this._highlights.add(i),this._enableSet(i),Te(()=>this._removeSet(i))}_removeSet(t){this._disableSet(t),this._highlights.delete(t)}_enableSet(t){t.enabled||(t.enabled=!0,this._context.forEachNode(i=>this._enableSetForNode(t,i)))}_enableSetForNode(t,i){if(!t.enabled)return;const s=t.ids.get(i.id);s&&s.forEach(r=>this._context.addHighlight(i,r,t.id))}_disableSet(t){t.enabled&&(t.enabled=!1,this._context.forEachNode(i=>this._disableSetForNode(t,i)))}_disableSetForNode(t,i){t.enabled||this._context.removeHighlight(i,t.id)}nodeAdded(t){this._highlights.forEach(i=>this._enableSetForNode(i,t))}nodeRemoved(t){this._highlights.forEach(i=>this._disableSetForNode(i,t))}removeAll(){this._highlights.forEach(t=>this._disableSet(t))}}class Gi{constructor(t){this.id=new at(lt.Highlight),this.ids=new Map,this.enabled=!1;for(const i of t)i!=null&&this._add(i.nodeId,i.pointId)}_add(t,i){const s=this.ids.get(t);s?s.add(i):this.ids.set(t,new Set([i]))}}class ce extends dt{constructor(){super(...arguments),this.clipBox=Q(de),this.useFixedSizes=!1,this.useRealWorldSymbolSizes=!1,this.scaleFactor=1,this.minSizePx=0,this.size=0,this.sizePx=0}get fixedSize(){return this.drawScreenSpace?this.sizePx:this.size}get screenMinSize(){return this.useFixedSizes?0:this.minSizePx}get drawScreenSpace(){return this.useFixedSizes&&!this.useRealWorldSymbolSizes}}class pe extends ht{constructor(t,i,s){super(t),this.origin=t,this.isLeaf=i,this.splatSize=s}}function Je(e){const t=new ut,i=e.output===w.Color,s=e.output===w.Depth,r=e.output===w.Highlight,{vertex:n,fragment:a}=t;return t.include(ct,e),t.attributes.add(B.POSITION,"vec3"),t.attributes.add(B.COLOR,"vec3"),n.uniforms.add(new pt("modelView",(o,l)=>_t(ke,l.camera.viewMatrix,gt(ke,o.origin))),new ft("proj",(o,l)=>l.camera.projectionMatrix),new fe("screenMinMaxSize",(o,l,d)=>ee(ne,d.useFixedSizes?0:d.minSizePx*l.camera.pixelRatio,G(o.isLeaf)*l.camera.pixelRatio)),e.useFixedSizes?new mt("pointScale",(o,l)=>ee(ne,o.fixedSize*l.camera.pixelRatio,l.camera.fullHeight)):new fe("pointScale",(o,l,d)=>ee(ne,o.splatSize*d.scaleFactor*l.camera.pixelRatio,l.camera.fullHeight/l.camera.pixelRatio))),e.clippingEnabled?n.uniforms.add(new me("clipMin",(o,l,d)=>be(Ve,d.clipBox[0]-o.origin[0],d.clipBox[1]-o.origin[1],d.clipBox[2]-o.origin[2])),new me("clipMax",(o,l,d)=>be(Ve,d.clipBox[3]-o.origin[0],d.clipBox[4]-o.origin[1],d.clipBox[5]-o.origin[2]))):(n.constants.add("clipMin","vec3",[-L,-L,-L]),n.constants.add("clipMax","vec3",[L,L,L])),s?(bt(t),yt(t),t.varyings.add("depth","float")):e.output!==w.Highlight&&t.varyings.add("vColor","vec3"),n.code.add(C` + void main(void) { + // Move clipped points outside of clipspace + if (position.x < clipMin.x || position.y < clipMin.y || position.z < clipMin.z || + position.x > clipMax.x || position.y > clipMax.y || position.z > clipMax.z) { + gl_Position = vec4(0.0,0.0,0.0,2.0); + gl_PointSize = 0.0; + return; + } + + if (rejectBySlice(position)) { + gl_Position = vec4(0.0,0.0,0.0,2.0); + gl_PointSize = 0.0; + return; + } + + // Position in camera space + vec4 camera = modelView * vec4(position, 1.0); + + float pointSize = pointScale.x; + vec4 position = proj * camera; + ${e.drawScreenSize?C` + float clampedScreenSize = pointSize;`:C` + float pointRadius = 0.5 * pointSize; + vec4 cameraOffset = camera + vec4(0.0, pointRadius, 0.0, 0.0); + vec4 positionOffset = proj * cameraOffset; + float radius = abs(positionOffset.y - position.y); + float viewHeight = pointScale.y; + // screen diameter = (2 * r / w) * (h / 2) + float screenPointSize = (radius / position.w) * viewHeight; + float clampedScreenSize = clamp(screenPointSize, screenMinMaxSize.x, screenMinMaxSize.y); + // Shift towards camera, to move rendered point out of terrain i.e. to + // the camera-facing end of the virtual point when considering it as a + // 3D sphere. + camera.xyz -= normalize(camera.xyz) * pointRadius * clampedScreenSize / screenPointSize; + position = proj * camera;`} + + gl_PointSize = clampedScreenSize; + gl_Position = position; + + ${s?C`depth = calculateLinearDepth(nearFar, camera.z);`:""} + ${i?C`vColor = color;`:""} + } + `),a.include(St,e),r&&t.include(xt,e),a.code.add(C` + void main(void) { + vec2 vOffset = gl_PointCoord - vec2(0.5, 0.5); + float r2 = dot(vOffset, vOffset); + + if (r2 > 0.25) { + discard; + } + ${s?C`fragColor = float2rgba(depth);`:""} + ${r?C`outputHighlight();`:""} + ${i?C`fragColor = vec4(vColor, 1.0);`:""} + } + `),t}function G(e){return e?256:64}const ke=Pt(),Ve=k(),ne=vt(),ji=Object.freeze(Object.defineProperty({__proto__:null,PointRendererDrawParameters:pe,PointRendererPassParameters:ce,build:Je,getMaxPointSizeScreenspace:G},Symbol.toStringTag,{value:"Module"}));class j extends zt{constructor(t,i,s){super(t,i,s)}initializeProgram(t){return new Ct(t.rctx,j.shader.get().build(this.configuration),Ue)}initializePipeline(){return Rt({depthTest:{func:$t.LESS},depthWrite:At,colorWrite:It,stencilWrite:this.configuration.hasOccludees?Ot:null,stencilTest:this.configuration.hasOccludees?Mt:null})}}j.shader=new wt(ji,()=>Nt(()=>Promise.resolve().then(()=>ns),void 0));class O extends Et{constructor(){super(...arguments),this.output=w.Color,this.hasSlicePlane=!1,this.drawScreenSize=!1,this.useFixedSizes=!1,this.hasOccludees=!1,this.clippingEnabled=!1}}p([E({count:w.COUNT})],O.prototype,"output",void 0),p([E()],O.prototype,"hasSlicePlane",void 0),p([E()],O.prototype,"drawScreenSize",void 0),p([E()],O.prototype,"useFixedSizes",void 0),p([E()],O.prototype,"hasOccludees",void 0),p([E()],O.prototype,"clippingEnabled",void 0),p([E({constValue:!0})],O.prototype,"hasSliceInVertexProgram",void 0);const Ji={positions:[new ye(B.POSITION,3,Se.FLOAT,0,12)],colors:[new ye(B.COLOR,3,Se.UNSIGNED_BYTE,0,3,!0)]};let U=class extends Ft{constructor(e){super(e),this.type=Lt.PCL,this.isGround=!1,this._passParameters=new ce,this._highlights=new Bi({forEachNode:t=>this.forEachNode(t),addHighlight:(t,i,s)=>this._addHighlight(t,i,s),removeHighlight:(t,i)=>this._removeHighlight(t,i)}),this.produces=new Map([[Be.OPAQUE_MATERIAL,t=>t!==w.Highlight||!this._highlights.empty]]),this.layerUid="",this._slicePlaneEnabled=!1,this._techniqueConfig=new O,this._nodes=new kt}initializeRenderContext(e){this._context=e,e.requestRender()}uninitializeRenderContext(){}intersect(e,t,i,s){const r=k(),n=k(),a=k(),o=k(),l=Ge(),d=e.camera.perScreenPixelRatio/2,g=e.camera.near;xe(n,s,i);const _=1/Vt(n);Dt(n,n,_),qt(a,n),Ht(l,n[0],n[1],n[2],-A(n,i));const c=new ae,u=new ae,y=new Array,N=Q(),f=Q(this._passParameters.clipBox);Pe(f,-i[0],-i[1],-i[2],f),this._nodes.forAll(h=>{const S=h.splatSize*this._passParameters.scaleFactor;let P=je(h.obb,l),I=Qt(h.obb,l);P-=oe(S,P+g,this._passParameters,d,h.isLeaf),I-=oe(S,I+g,this._passParameters,d,h.isLeaf);const Ye=I<0,Ke=c.dist!=null&&u.dist!=null&&c.distI*_;if(Ye||Ke)return;const Y=he(S,I+g,this._passParameters,d,h.isLeaf);if(!Wt(h.obb,i,n,Y))return;const Xe=Y*Y;Qe(h.obb,N),Pe(N,-i[0],-i[1],-i[2],N);const Ze=!We(f,N);xe(o,h.origin,i);const et=h.coordinates.length/3;for(let M=0;MXe)continue;let K=q+g;const X=oe(S,K,this._passParameters,d,h.isLeaf);if(q-X<0)continue;K-=X;const ge=he(S,K,this._passParameters,d,h.isLeaf);if(_e>ge*ge)continue;const F=(q-X)*_,Z=z=>(z.point=Xi(h,M,z.point),z.dist=F,z.normal=a,z.node=h,z.pointId=M,z.layerUid=this.layerUid,z);if((c.dist==null||Fu.dist)&&(t==null||t(i,s,F))&&Z(u),e.options.store===T.ALL&&(t==null||t(i,s,F))){const z=new ae;y.push(Z(z))}}});const J=h=>{const{layerUid:S,node:P,pointId:I}=h;return new Kt(h.point,S,I,()=>this.createGraphic(P,I,h.point))},D=(h,S)=>{const P=J(S);h.set(this.type,P,S.dist,S.normal)};if(qe(c)){const h=e.results.min;(h.dist==null||c.disth.dist)&&D(h,u)}if(e.options.store===T.ALL){const h=Bt(i,s);for(const S of y){const P=Gt(h);D(P,S),e.results.all.push(P)}}}prepareTechnique(e){return this._nodes.length===0||e.output!==w.Color&&e.output!==w.Depth&&e.output!==w.Highlight?null:(this._nodes.forAll(t=>{t.vao==null&&this._initNode(e,t)}),this._techniqueConfig.drawScreenSize=this._passParameters.drawScreenSpace,this._techniqueConfig.useFixedSizes=this._passParameters.useFixedSizes,this._techniqueConfig.hasSlicePlane=this._slicePlaneEnabled,this._techniqueConfig.hasOccludees=e.bindParameters.hasOccludees,this._techniqueConfig.clippingEnabled=this._clippingEnabled,this._techniqueConfig.output=e.output,this._context.techniqueRepository.releaseAndAcquire(j,this._techniqueConfig,this._technique))}renderNode(e,t){const i=e.rctx,s=i.bindTechnique(t,this._passParameters,e.bindParameters),r=e.output===w.Highlight;this._nodes.forAll(n=>{n.coordinates.length===0||r&&!n.highlights||(s.bindDraw(n,e.bindParameters,this._passParameters),i.bindVAO(n.vao),r?this._renderHighlightFragments(i,n):i.drawArrays(te.POINTS,0,n.coordinates.length/3))})}_renderHighlightFragments(e,t){const i=t.highlights;if(i==null)return;let s=i[0].component,r=s+1;for(let a=1;a0&&e.drawArrays(te.POINTS,s,l),s=o}r=o+1}const n=r-s;n>0&&e.drawArrays(te.POINTS,s,n)}set useFixedSizes(e){this._passParameters.useFixedSizes!==e&&(this._passParameters.useFixedSizes=e,this._requestRender())}get useFixedSizes(){return this._passParameters.useFixedSizes}set scaleFactor(e){this._passParameters.scaleFactor!==e&&(this._passParameters.scaleFactor=e,this._requestRender())}get scaleFactor(){return this._passParameters.scaleFactor}set minSizePx(e){this._passParameters.minSizePx!==e&&(this._passParameters.minSizePx=e,this._requestRender())}get minSizePx(){return this._passParameters.minSizePx}set useRealWorldSymbolSizes(e){this._passParameters.useRealWorldSymbolSizes!==e&&(this._passParameters.useRealWorldSymbolSizes=e,this._requestRender())}get useRealWorldSymbolSizes(){return this._passParameters.useRealWorldSymbolSizes}set size(e){this._passParameters.size!==e&&(this._passParameters.size=e,this._requestRender())}get size(){return this._passParameters.size}set sizePx(e){this._passParameters.sizePx!==e&&(this._passParameters.sizePx=e,this._requestRender())}get sizePx(){return this._passParameters.sizePx}set clippingBox(e){jt(this._passParameters.clipBox,e||de)}get _clippingEnabled(){return!Jt(this._passParameters.clipBox,de,(e,t)=>e===t)}get slicePlaneEnabled(){return this._slicePlaneEnabled}set slicePlaneEnabled(e){this._slicePlaneEnabled!==e&&(this._slicePlaneEnabled=e,this._requestRender())}addNode(e){this._nodes.push(e),this._highlights.nodeAdded(e),this._requestRender()}removeNode(e){let t=null;return this._nodes.filterInPlace(i=>i.id!==e||(t=i,i.vao=ve(i.vao),this._highlights.nodeRemoved(i),!1)),this._requestRender(),t}forEachNode(e){this._nodes.forAll(e)}removeAll(){this._nodes.forAll(e=>e.vao=ve(e.vao)),this._highlights.removeAll(),this._nodes.clear(),this._requestRender()}highlight(e){return this._highlights.add(e)}_addHighlight(e,t,i){e.highlights=Zi(e.highlights,t,i),this._requestRender()}_removeHighlight(e,t){e.highlights=es(e.highlights,t),this._requestRender()}_initNode(e,t){const i=e.rctx;t.vao=new Yt(i,Ue,Ji,{positions:we.createVertex(i,Ne.STATIC_DRAW,t.coordinates),colors:we.createVertex(i,Ne.STATIC_DRAW,t.rgb)})}_requestRender(){this._context&&this._context.requestRender()}};p([b({constructOnly:!0})],U.prototype,"createGraphic",void 0),U=p([ue("esri.views.3d.layers.i3s.PointRenderer")],U);class Yi extends pe{constructor(t,i,s,r,n,a,o,l,d=null,g=null){super(s,n,i),this.id=t,this.obb=r,this.coordinates=a,this.rgb=o,this.attributes=l,this.pointIdFilterMap=d,this.highlights=g}}function Ki(e){return e.hasOwnProperty("splatSize")}function he(e,t,i,s,r){if(i.drawScreenSpace)return i.fixedSize*t*s;const n=G(r)*t*s;return i.useFixedSizes?Math.min(i.fixedSize/2,n):i.screenMinSize>0?Math.min(Math.max(i.screenMinSize*t*s,e/2),n):Math.min(e/2,n)}function oe(e,t,i,s,r){return i.drawScreenSpace?0:he(e,t,i,s,r)}function Xi(e,t,i){return i==null&&(i=k()),i[0]=e.origin[0]+e.coordinates[3*t],i[1]=e.origin[1]+e.coordinates[3*t+1],i[2]=e.origin[2]+e.coordinates[3*t+2],i}function De(e){return e.component!=null?e.component:-1}function Zi(e,t,i){e==null&&(e=[]);const s={component:t,id:i};e.push(s);const r=De(s);let n=e.length-1;for(;n>0&&rs.id!==t);return i.length===0?null:i}class ae{constructor(){this.node=null,this.pointId=null,this.point=null,this.dist=null,this.normal=null,this.layerUid=""}}function qe(e){return e.dist!=null&&e.point!=null&&e.pointId!=null&&e.node!=null}const ts=8,is=Ge();let m=class extends Mi($i(Ei)){constructor(){super(...arguments),this.type="point-cloud-3d",this.slots=[Be.OPAQUE_MATERIAL],this.maximumPointCount=4e6,this.slicePlaneEnabled=!1,this._renderer=null,this._rendererAdded=!1,this._renderedNodes=new Set,this._nodeScales=new Map,this._updateViewNeeded=!0,this._lodFactor=1,this._maxLoggedBoxWarnings=5,this._pageMultiplier=1,this._nodeLoadEpoch=0,this._indexQueue=[],this._workQueue=new Array,this._idleQueue=new Xt,this._indexPagesLoading=new Map,this._loadingNodes=new Map,this._recalcWork=!0,this._layerIsVisible=!1,this._codedDomainPopulationPromise=null,this._codedDomainPopulationAbortController=null,this._totalWork=0,this._index=null,this._loadingInitNodePage=!1,this._nodeIdArray=[],this.ignoresMemoryFactor=!1}get baseUrl(){return this.layer.parsedUrl.path}get pointScale(){var i;const e=Ti((i=this.layer)==null?void 0:i.renderer),t=1;return(e==null?void 0:e.scaleFactor)!=null?e.scaleFactor:t}get useRealWorldSymbolSizes(){var i;const e=Fe((i=this.layer)==null?void 0:i.renderer),t=!1;return(e==null?void 0:e.useRealWorldSymbolSizes)!=null?e.useRealWorldSymbolSizes:t}get pointSize(){var i;const e=Fe((i=this.layer)==null?void 0:i.renderer),t=0;return(e==null?void 0:e.size)!=null?e.size:t}get inverseDensity(){var t;return(t=this.layer)!=null&&t.renderer?1*96/this.layer.renderer.pointsPerInch:5}get availableFields(){const e=Me(this.layer),t=new Set;e.primaryAttribute&&t.add(e.primaryAttribute.name),e.modulationAttribute&&t.add(e.modulationAttribute.name);const i=Ee(this.layer);if(i)for(const s of i)s.attributeInfo&&t.add(s.attributeInfo.name);if(this.layer.outFields)for(const s of ze(this.layer.fieldsIndex,this.layer.outFields))t.add(s);return Array.from(t)}get _clippingBox(){if(!this.view||!this.view.clippingArea)return null;const e=Q(),t=this.view.renderSpatialReference;return Zt(this.view.clippingArea,e,t)?e:null}get _elevationOffset(){const e=this.layer&&this.layer.elevationInfo;if(e&&e.mode==="absolute-height"){const t=ei(this.layer.spatialReference),i=ti(e.unit);return(e.offset??0)*i/t}return 0}initialize(){const e=this.view.resourceController,t=rs(e);this._worker=new Fi(t),this.addResolvingPromise(this._worker.promise),this._tmpPoint=ii(0,0,0,this.layer.spatialReference),si(this.layer),ri(this.layer,this.view),this._indexRequester=e.createStreamDataRequester(Ce.I3S_INDEX),this._dataRequester=e.createStreamDataRequester(Ce.I3S_DATA),this._initRenderer();const i=this._initNodePages(),s=this.view.resourceController.memoryController;this._memCache=s.newCache(`pcl-${this.layer.uid}`),this._updatingHandles.add(()=>this._clippingBox,()=>this._setUpdateViewNeeded(),x),this._updatingHandles.add(()=>this._elevationOffset,()=>this._elevationOffsetChanged(),x),this._updatingHandles.add(()=>this.layer.renderer,()=>this._rendererChanged(),x),this._updatingHandles.add(()=>this.layer.filters,()=>this._reload(),x),this._updatingHandles.add(()=>this.layer.outFields,()=>this._reload(),x),this._updatingHandles.add(()=>this.layer.effectiveScaleRange,()=>this._setUpdateViewNeeded()),this._updatingHandles.add(()=>this.view.state.contentCamera,()=>this._setUpdateViewNeeded()),this.addHandles([this.view.basemapTerrain.on("scale-change",r=>this._scaleUpdateHandler(r)),ni(()=>this.view.quality,()=>this._setUpdateViewNeeded(),oi)]),this.addResolvingPromise(i),this.when(()=>{this.addHandles([e.scheduler.registerTask(ai.POINT_CLOUD_LAYER,this),e.scheduler.registerIdleStateCallbacks(()=>this._idleBegin(),()=>this._idleEnd()),this._updatingHandles.add(()=>this.suspended,r=>{r?this._clearNodeState():this._setUpdateViewNeeded()},x)])},()=>{this._updatingHandles.removeAll(),this.removeAllHandles()})}_setUpdateViewNeeded(){this._updateViewNeeded=!0,this._updateLoading()}destroy(){this.cancelLoading(),this._worker=Re(this._worker),this._destroyRenderer(),this._memCache=Re(this._memCache),this._codedDomainPopulationAbortController=li(this._codedDomainPopulationAbortController),this._codedDomainPopulationPromise=null}_initRenderer(){this._renderer=new U({createGraphic:(e,t,i)=>this._createGraphic(e,t,i)}),this._renderer.layerUid=this.layer.uid,this._updatingHandles.add(()=>this._clippingBox,e=>this._renderer.clippingBox=e,x),this._updatingHandles.add(()=>this.suspended,e=>this._setPointsVisible(!e),x),this._updatingHandles.add(()=>this.pointScale,e=>this._renderer.scaleFactor=e,x),this._renderer.minSizePx=Math.sqrt(2),this._updatingHandles.add(()=>this.useRealWorldSymbolSizes,e=>this._renderer.useRealWorldSymbolSizes=e,x),this._updatingHandles.add(()=>this.pointSize,e=>{const t=zi(e);this._renderer.size=e,this._renderer.sizePx=t},x),this._updatingHandles.add(()=>this.slicePlaneEnabled,e=>this._renderer.slicePlaneEnabled=e,x),this._updatingHandles.add(()=>this.inverseDensity,()=>this._setUpdateViewNeeded(),x),this._updatingHandles.add(()=>this.maximumPointCount,()=>this._setUpdateViewNeeded(),x),this._updatingHandles.add(()=>this.view.qualitySettings.sceneService.pointCloud.lodFactor,e=>{this._lodFactor=e,this._setUpdateViewNeeded()},x)}_destroyRenderer(){this._renderer.removeAll(),this._setPointsVisible(!1)}_createGraphic(e,t,i){const s=e.pointIdFilterMap!=null?e.pointIdFilterMap[t]:t,r=this.view.computeMapPointFromVec3d(i),n=this._createGraphicAttributes(e,s);return new H({pointCloudMetadata:{nodeId:e.id,pointIndexInNode:t,attributePointIndexInNode:s,epoch:this._nodeLoadEpoch},geometry:r,attributes:n,layer:this.layer,sourceLayer:this.layer})}_createGraphicAttributes(e,t){const i={};for(const s of e.attributes)this._encodeGraphicAttribute(s.attributeInfo,s.values,t,i);return i}_encodeGraphicAttribute(e,t,i,s){var a;const r=(a=e.storageInfo)==null?void 0:a.attributeValues,n=(r==null?void 0:r.valuesPerElement)??1;if(n===1)s[e.name]=t[i];else if((r==null?void 0:r.valueType)==="UInt8"&&n<=4){let o=0;const l=i*n;for(let d=l;d{if(!this._renderedNodes.has(s))return void this._nodeScales.delete(s);const r=this._index.getNode(s);ui(He,r.obb.center)&&this._nodeScales.set(s,e.scale)}),this._setUpdateViewNeeded()):this._nodeScales.clear()}_displayNodes(e){this._workQueue=Li([...this._renderedNodes],e,this._index),ki(this._workQueue,this.view.state.contentCamera.viewForward,this._index),Vi(this._workQueue,ts,this._index),this._updateQueues(),this._totalWork=this._computeWork(),this._updateLoading(),this._layerIsVisible=e.length>0||this._loadingInitNodePage,this.notifyChange("suspended")}cancelLoading(){this._cancelNodeLoading(),this._cancelIndexLoading()}_cancelNodeLoading(){const e=new Array;this._loadingNodes.forEach(({abortController:t})=>e.push(t)),this._loadingNodes.clear();for(const t of e)t.abort();this._workQueue=[],this._idleQueue.cancelAll(),this._totalWork=this._computeWork(),this._updateLoading()}_updateQueues(){const e=new Set;this._workQueue.forEach(s=>s.load.forEach(r=>e.add(r)));const t=new Array,i=new Map;this._loadingNodes.forEach((s,r)=>{e.has(r)?i.set(r,s):t.push(s)}),this._loadingNodes=i;for(const{abortController:s}of t)s.abort();this._workQueue=this._workQueue.filter(s=>{for(const r of s.load)if(this._loadingNodes.has(r))return this._recalcWork=!0,!1;return!0}),this._totalWork=this._computeWork(),this._updateLoading()}_cancelIndexLoading(){this._indexQueue=[],this._indexPagesLoading.forEach(({abortController:e})=>e.abort()),this._indexPagesLoading.clear(),this._totalWork=this._computeWork(),this._updateLoading()}_clearNodeState(){this._nodeLoadEpoch++,this._renderedNodes.forEach(e=>this._removeFromRenderer(e)),this._cancelNodeLoading()}_idleBegin(){this._setUpdateViewNeeded()}_idleEnd(){this._setUpdateViewNeeded()}get running(){return this.suspended?this._updateViewNeeded:this._updateViewNeeded||this._indexQueue.length>0||this._workQueue.length>0||this._idleQueue.running}runTask(e){if(this.suspended){if(this._updateViewNeeded){this._updateViewNeeded=!1;const t=this._isRootNodeVisible();t!==this._layerIsVisible&&(this._layerIsVisible=t,this.notifyChange("suspended")),this._updateLoading()}}else{for(e.run(()=>this._updateWorkQueues());this._indexQueue.length>0&&e.run(()=>this._processIndexQueue()););this._processWorkQueue(e),this._idleQueue.runTask(e)}}_processIndexQueue(){const e=this._indexQueue.shift(),t=this._loadNodePage(e);return this._indexPagesLoading.set(e,t),t.promise.then(i=>{this._index.addPage(e,i,this._elevationOffset),this._setUpdateViewNeeded()}).then(()=>{this._indexPagesLoading.delete(e)},()=>{this._indexPagesLoading.delete(e)}),!0}_processWorkQueue(e){for(;!e.done;){const t=this._scheduleWorkEntry();if(t==null)return void e.madeProgress();this._processWorkEntry(t),e.madeProgress()}}_scheduleWorkEntry(){let e=this._workQueue.length;for(;e--;){const t=this._workQueue.shift();if(!t.remove.find(i=>!this._renderedNodes.has(i)))return t;this._workQueue.push(t)}return null}_processWorkEntry(e){if(e.load.length!==0)Promise.all(e.load.map(t=>{const i=new AbortController,s=this._memCache.pop(t.toString());return s!=null?this._loadingNodes.set(t,{abortController:i,promise:Promise.resolve(s)}):this._loadingNodes.has(t)||this._loadingNodes.set(t,{abortController:i,promise:this._loadNode(t,i.signal)}),this._loadingNodes.get(t).promise})).then(t=>{for(let i=0;i{}).then(()=>{for(const t of e.load)this._loadingNodes.delete(t);this._updateLoading(),this._recalcWork&&!this._idleQueue.running&&this._indexQueue.length===0&&this._loadingNodes.size===0&&(this._recalcWork=!1,this._setUpdateViewNeeded())}),this._updateLoading();else for(const t of e.remove)this._removeFromRenderer(t)}async _populateClassCodeCodedDomain(e,t){var a,o,l;const i="CLASS_CODE",s=this.layer.fieldsIndex.get(i);if(!s||s.domain||!e.includes(s.name))return;const r=await ci(this.layer.queryCachedStatistics(i,{signal:t}));if(r.ok===!1)return;const n=(l=(o=(a=r.value)==null?void 0:a.stats)==null?void 0:o.labels)==null?void 0:l.labels;n&&Array.isArray(n)&&(s.domain=new pi({name:"CLASS_CODE",codedValues:n.map(d=>new _i({code:d.value,name:d.label}))}))}async prepareFetchPopupFeatures(e){return this._codedDomainPopulationPromise||(this._codedDomainPopulationAbortController=new AbortController,this._codedDomainPopulationPromise=this._populateClassCodeCodedDomain(e,this._codedDomainPopulationAbortController.signal).then(()=>{this._codedDomainPopulationAbortController=null})),this._codedDomainPopulationPromise}async whenGraphicAttributes(e,t){const i=this._splitGraphicsPerNode(e),s=this.layer.attributeStorageInfo,r=t.map(o=>W(s,o)).filter($e),n=async(o,l)=>{const d=this._index.getNode(l);await Ci(r,async g=>{const _=g.useElevation?await this._loadElevationAttributeFromGeometry(d.resourceId):await this._loadAndParseAttribute(d,g);if(_){for(const c of o)if(this._isValidPointGraphic(c)){const u=c.pointCloudMetadata.attributePointIndexInNode;this._encodeGraphicAttribute(g,_,u,c.attributes)}}})},a=[];return i.forEach((o,l)=>{a.push(n(o,l))}),await Promise.allSettled(a),e}_isValidPointGraphic(e){var t;return e instanceof H&&((t=e.pointCloudMetadata)==null?void 0:t.epoch)===this._nodeLoadEpoch}_splitGraphicsPerNode(e){const t=new Map;for(const i of e){if(!this._isValidPointGraphic(i))continue;const s=i.pointCloudMetadata,r=t.get(s.nodeId);r?r.push(i):t.set(s.nodeId,[i])}return t}async _loadAndParseAttribute(e,t){const i=await this._loadAttribute(e.resourceId,t,null);return i!=null?Ai({attributeInfo:t,buffer:i},null,e.vertexCount):null}async _loadElevationAttributeFromGeometry(e){const t=this.layer.store.defaultGeometrySchema,i=Ii(t,await this._loadGeometry(e,null));return Oi(i,i.length/3)}highlight(e){if(!e)return Te();const t=gi.isCollection(e)?e.toArray():Array.isArray(e)?e:[e];return this._renderer.highlight(t.map(i=>this._graphicToPointDefinition(i)))}_graphicToPointDefinition(e){if(!this._isValidPointGraphic(e))return null;const{nodeId:t,pointIndexInNode:i}=e.pointCloudMetadata;return t!=null&&i!=null?{nodeId:t,pointId:i}:null}_computeWork(){let e=0;for(const t of this._workQueue)e+=t.load.length+t.remove.length;return e+=this._loadingNodes.size,e+=(this._indexQueue.length+this._indexPagesLoading.size)*this._index.pageSize,e+=this._loadingInitNodePage?100:0,e+=this._updateViewNeeded?100:0,e}get updatingProgressValue(){if(this.suspended)return this._updateViewNeeded?0:1;const e=this._computeWork();return 1-Math.min(this._totalWork,e)/this._totalWork}_updateLoading(){this.notifyChange("updating"),this.notifyChange("updatingProgressValue")}canResume(){return super.canResume()&&this._layerIsVisible}isUpdating(){return this.suspended?this._updateViewNeeded:this._computeWork()>0}_initNodePages(){const e=this.layer.store.index,t=e.nodesPerPage||e.nodePerIndexBlock;return this._index=new qi(this.layer.spatialReference,this.view.renderCoordsHelper.spatialReference,t),this._cancelIndexLoading(),this._traverseVisible=this._index.createVisibilityTraverse(),this._loadingInitNodePage=!0,this._layerIsVisible=!0,this.notifyChange("suspended"),this._updateLoading(),this._pageMultiplier=e.nodesPerPage!=null?1:e.nodePerIndexBlock,this._loadNodePage(0).promise.then(i=>{this._index.addPage(0,i,this._elevationOffset),this._loadingInitNodePage=!1,this._setUpdateViewNeeded()})}_loadNodePage(e){const t=new AbortController,i=`${this.baseUrl}/nodepages/${e*this._pageMultiplier}`;return{promise:this._requestNodePage(i,t.signal).then(s=>s.nodes.map((r,n)=>({resourceId:r.resourceId!=null?r.resourceId:e*this._index.pageSize+n,obb:r.obb,obbInRenderSR:fi(),firstChild:r.firstChild,childCount:r.childCount,vertexCount:r.vertexCount??r.pointCount,lodThreshold:r.lodThreshold??r.effectiveArea}))),abortController:t}}_updateWorkQueues(){if(!this._updateViewNeeded)return!1;const e=this.view.quality;let t=this.inverseDensity/this._lodFactor*e;const i=this.maximumPointCount*this._lodFactor*e;let s=this._computeNodesForMinimumDensity(t),r=this._computePointCount(s),n=Math.sqrt(r/(.75*i));for(;r>i;)t*=n,s=this._computeNodesForMinimumDensity(t),r=this._computePointCount(s),n=Math.sqrt(2);return this._displayNodes(s),this._updateViewNeeded=!1,this._updateLoading(),!0}_computePointCount(e){let t=0;for(let i=0;i(e=s,!1),pageMiss:()=>{}}),e}_computeNodesForMinimumDensity(e){const t=this.view.state.contentCamera,i=t.frustum,s=this._clippingBox,r=t.viewForward,n=A(r,t.eye),a=mi(r,-n,is),o=t.perScreenPixelRatio/2,l=e*e,d=this._nodeIdArray;d.length=0;const{minScale:g,maxScale:_}=bi(this.layer),c=g===0&&_===0?u=>d.push(u):u=>{const y=this._getScale(u);Ri(y,g,_)&&d.push(u)};return this._traverseVisible({frustum:i,clippingBox:s},{predicate:(u,y,N)=>{if(!N)return!1;if(y.childCount===0)return c(u),!1;const f=this._index.getRenderObb(u);return!(this._computeAveragePixelArea(f,y.lodThreshold,y.vertexCount,a,o)<=l)||(c(u),!1)},pageMiss:(u,y)=>{c(u),this._indexQueue.includes(y)||this._indexQueue.push(y)}}),d}_getScale(e){let t=this._nodeScales.get(e);if(t==null){const i=this._index.getNode(e).obb.center;this._tmpPoint.x=i[0],this._tmpPoint.y=i[1],this._tmpPoint.z=i[2],t=this.view.basemapTerrain.getScale(this._tmpPoint),this._nodeScales.set(e,t)}return t}_computeAveragePixelArea(e,t,i,s,r){const a=Math.max(1e-7,je(e,s));return t/(a*a)/(4*r*r)/i}_loadNode(e,t){try{return this._loadNodeAsync(e,t)}catch(i){throw yi(i)||ie.getLogger(this).error(i),i}}async _loadAdditionalUserAttributes(e,t,i){const s=this.layer.outFields;if(!s)return[];const r=ze(this.layer.fieldsIndex,s),n=new Set(e.map(d=>d!=null?d.name:null)),a=this.layer.attributeStorageInfo,o=[];for(const d of r){if(n.has(d))continue;const g=W(a,d);g&&o.push(t(g))}const l=await Si(o);return Ae(i),l.filter($e)}async _loadNodeAsync(e,t){const i=this._index.getNode(e),s=Me(this.layer),r=Ee(this.layer),n=i.resourceId,a=async o=>{if(!o)return null;if(o.useElevation)return{attributeInfo:o,buffer:null};const l=await this._loadAttribute(n,o,t);return l!=null?{attributeInfo:o,buffer:l}:null};return this._idleQueue.push(async()=>{const o=this._loadGeometry(n,t),{primaryAttribute:l,modulationAttribute:d}=s,g=a(l),_=a(d),c=r.map(P=>P.attributeInfo),u=c.map(P=>a(P)),y=this._loadAdditionalUserAttributes([l,d,...c],a,t),[N,f,J,D,h]=await Promise.all([o,g,_,Promise.all(u),y]);Ae(t);const S={geometryBuffer:N,primaryAttributeData:f,modulationAttributeData:J,filterAttributesData:D,userAttributesData:h,schema:this.layer.store.defaultGeometrySchema,rendererInfo:s,filterInfo:r,obb:this._index.getRenderObb(e),elevationOffset:this._elevationOffset,inSR:this.layer.spatialReference.toJSON(),outSR:this.view.renderCoordsHelper.spatialReference.toJSON()};return this._worker.invoke(S,t)},t)}async _loadGeometry(e,t){return this._requestData(`${this.baseUrl}/nodes/${e}/geometries/0`,t)}async _loadAttribute(e,t,i){if(!(t!=null&&t.storageInfo))return null;const s=t.storageInfo.key;return this._requestData(`${this.baseUrl}/nodes/${e}/attributes/${s}`,i)}_requestNodePage(e,t){const i={f:"json",token:this.layer.apiKey};return this._indexRequester.request(e,"json",{query:i,signal:t})}_requestData(e,t){return this._dataRequester.request(e,"binary",{query:{token:this.layer.apiKey},signal:t})}_removeFromRenderer(e){if(this._renderedNodes.has(e)){const t=this._renderer.removeNode(e);this._renderedNodes.delete(e),this._nodeScales.delete(e),this._memCache.put(t.id.toString(),t,ss(t))}}_addToRenderer(e){this._renderedNodes.has(e.id)||(this._renderedNodes.add(e.id),this._renderer.addNode(e))}_setupRendererData(e,t){const i=this._index.getNode(e),s=Math.sqrt(i.lodThreshold/i.vertexCount),r=this._index.getRenderObb(e);if(Ki(t))return t.splatSize=s,t.obb=r,xi(t.origin,t.obb.center),t;const n=.01*Math.max(r.halfSize[0],r.halfSize[1],r.halfSize[2]);if(t.obb.halfSize[0]>r.halfSize[0]+n||t.obb.halfSize[1]>r.halfSize[1]+n||t.obb.halfSize[2]>r.halfSize[2]+n){if(this._maxLoggedBoxWarnings>0){const a=o=>`[${o.halfSize[0]}, ${o.halfSize[1]}, ${o.halfSize[2]}]`;ie.getLogger(this).warn(`Node ${e} reported bounding box too small. got ${a(r)} but points cover ${a(t.obb)}`),--this._maxLoggedBoxWarnings==0&&ie.getLogger(this).warn(" Too many bounding box errors, stopping reporting for this layer.")}this._index.setRenderObb(e,t.obb)}return new Yi(e,s,Pi(r.center),r,i.childCount===0,t.points,t.rgb,t.attributes,t.pointIdFilterMap)}get usedMemory(){let e=0;return this._renderer.forEachNode(t=>{e+=le,e+=Ie(t.coordinates);for(const i of t.attributes){const s=i.values;vi(s.buffer)&&(e+=Ie(s))}}),e}get unloadedMemory(){const e=this._renderedNodes.size;if(e<4)return 0;const t=[...this._renderedNodes].reduce((s,r)=>s+this._index.getNode(r).vertexCount);let i=this._loadingNodes.size;for(let s=0;se+this._index.getNode(t).vertexCount,0),maximumNumberOfFeatures:this.maximumPointCount,totalNumberOfFeatures:-1,core:null,"Loading Nodes":this._loadingNodes.size,"Index Queue":this._indexQueue.length,"Work Queue":this._workQueue.length,"Idle Queue":this._idleQueue.length}}get test(){return{index:this._index,visibleNodes:this._renderedNodes}}};p([b()],m.prototype,"layer",void 0),p([b()],m.prototype,"baseUrl",null),p([b()],m.prototype,"pointScale",null),p([b()],m.prototype,"useRealWorldSymbolSizes",null),p([b()],m.prototype,"pointSize",null),p([b()],m.prototype,"inverseDensity",null),p([b()],m.prototype,"maximumPointCount",void 0),p([b({readOnly:!0})],m.prototype,"availableFields",null),p([b({readOnly:!0})],m.prototype,"_clippingBox",null),p([b({readOnly:!0})],m.prototype,"_elevationOffset",null),p([b({type:Boolean})],m.prototype,"slicePlaneEnabled",void 0),p([b()],m.prototype,"updating",void 0),p([b(wi)],m.prototype,"updatingProgress",void 0),p([b({readOnly:!0})],m.prototype,"updatingProgressValue",null),m=p([ue("esri.views.3d.layers.PointCloudLayerView3D")],m);const ps=m;function ss(e){return 5*e.coordinates.length+128}const He=Ni(),le=160;function rs(e){return t=>e.immediate.schedule(t)}const ns=Object.freeze(Object.defineProperty({__proto__:null,PointRendererDrawParameters:pe,PointRendererPassParameters:ce,build:Je,getMaxPointSizeScreenspace:G},Symbol.toStringTag,{value:"Module"}));export{ps as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/PointCloudUniqueValueRenderer-RbbyNiwC.js b/dist/assets/PointCloudUniqueValueRenderer-RbbyNiwC.js new file mode 100644 index 0000000..f425fb3 --- /dev/null +++ b/dist/assets/PointCloudUniqueValueRenderer-RbbyNiwC.js @@ -0,0 +1 @@ +import{e,y as t,c as r,dr as f,dp as I,iw as m,pR as D,bI as o,ab as P,ey as N,pS as z,pT as K}from"./index-J0iiHjMT.js";var w;let c=w=class extends f{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new w({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=w=e([r("esri.renderers.support.pointCloud.ColorModulation")],c);const k=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends f{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([r("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([m({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([r("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const B=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([m({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([r("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":B,splat:q}},T=D()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends f{constructor(O){super(O),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:T.apiValues,readOnly:!0,nonNullable:!0,json:{type:T.jsonValues,read:!1,write:T.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:k,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([r("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const i=l;var j;let n=j=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:P,json:{type:[N],write:!0}})],n.prototype,"color",void 0),n=j=e([r("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends i{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([r("esri.renderers.PointCloudClassBreaksRenderer")],p);const E=p;var C;let a=C=class extends i{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([m({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([r("esri.renderers.PointCloudStretchRenderer")],a);const H=a;var $;let u=$=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new $({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:P,json:{type:[N],write:!0}})],u.prototype,"color",void 0),u=$=e([r("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var x;let d=x=class extends i{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new x({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:z,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=x=e([r("esri.renderers.PointCloudUniqueValueRenderer")],d);const J=d;export{J as a,H as b,i as c,E as d}; diff --git a/dist/assets/PointCloudWorker-UgniuzRB.js b/dist/assets/PointCloudWorker-UgniuzRB.js new file mode 100644 index 0000000..700be70 --- /dev/null +++ b/dist/assets/PointCloudWorker-UgniuzRB.js @@ -0,0 +1 @@ +import{gm as g,e3 as A,ar as c,gn as v,go as d,gp as y,gq as S,gr as D,gs as h}from"./index-J0iiHjMT.js";import{u as M,c as b,i as w,f as z}from"./PointCloudWorkerUtil-q8ml4JQu.js";import"./PointCloudUniqueValueRenderer-RbbyNiwC.js";class O{transform(t){const a=this._transform(t),e=[a.points.buffer,a.rgb.buffer];a.pointIdFilterMap!=null&&e.push(a.pointIdFilterMap.buffer);for(const r of a.attributes)"buffer"in r.values&&g(r.values.buffer)&&r.values.buffer!==a.rgb.buffer&&e.push(r.values.buffer);return Promise.resolve({result:a,transferList:e})}_transform(t){const a=M(t.schema,t.geometryBuffer);let e=a.length/3,r=null;const s=new Array,i=b(t.primaryAttributeData,a,e);t.primaryAttributeData!=null&&i&&s.push({attributeInfo:t.primaryAttributeData.attributeInfo,values:i});const o=b(t.modulationAttributeData,a,e);t.modulationAttributeData!=null&&o&&s.push({attributeInfo:t.modulationAttributeData.attributeInfo,values:o});let f=w(t.rendererInfo,i,o,e);if(t.filterInfo&&t.filterInfo.length>0&&t.filterAttributesData!=null){const n=t.filterAttributesData.filter(A).map(l=>{const I=b(l,a,e),p={attributeInfo:l.attributeInfo,values:I};return s.push(p),p});r=new Uint32Array(e),e=z(a,f,r,t.filterInfo,n)}for(const n of t.userAttributesData){const l=b(n,a,e);s.push({attributeInfo:n.attributeInfo,values:l})}3*e=o[l].value)t[3*r]=o[l].color.r,t[3*r+1]=o[l].color.g,t[3*r+2]=o[l].color.b;else for(let f=1;f=o[l].minValue&&c<=o[l].maxValue){t[3*r]=o[l].color.r,t[3*r+1]=o[l].color.g,t[3*r+2]=o[l].color.b;break}}}else t=new Uint8Array(3*u).fill(255);if(d&&(s!=null&&s.colorModulation)){const o=s.colorModulation.minValue,a=s.colorModulation.maxValue,r=.3;for(let c=0;c=a?1:l<=o?r:r+(1-r)*(l-o)/(a-o);t[3*c]=f*t[3*c],t[3*c+1]=f*t[3*c+1],t[3*c+2]=f*t[3*c+2]}}return t}function M(n,e){if(n.encoding==null||n.encoding===""){const d=C(e,n);if(d.vertexAttributes.position==null)return;const u=k(e,d.vertexAttributes.position),i=d.header.fields,p=[i.offsetX,i.offsetY,i.offsetZ],t=[i.scaleX,i.scaleY,i.scaleZ],s=u.length/3,o=new Float64Array(3*s);for(let a=0;a>>4&15,b=f>1,w=l===1,y=l===f;let h=!1;for(const g of r.includedReturns)if(g==="last"&&y||g==="firstOfMany"&&w&&b||g==="lastOfMany"&&y&&b||g==="single"&&!b){h=!0;break}h||(o=!1);break}}}o&&(d[t]=s,n[3*t]=n[3*s],n[3*t+1]=n[3*s+1],n[3*t+2]=n[3*s+2],e[3*t]=e[3*s],e[3*t+1]=e[3*s+1],e[3*t+2]=e[3*s+2],t++)}return t}function m(n){switch(n){default:case null:case"none":return e=>e;case"low-four-bit":return e=>15&e;case"high-four-bit":return e=>(240&e)>>4;case"absolute-value":return e=>Math.abs(e);case"modulo-ten":return e=>e%10}}function v(n){let e=0;for(const d of n||[])e|=1<e,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),_.prune(),X.prune(),d.prune(),Y.prune()}all(t){this._all(this._data,t)}search(t,n){let e=this._data;const i=this._toBBox;if(M(t,e))for(_.clear();e;){for(let s=0,a=e.children.length;s0;){if(e||(e=d.pop(),i=d.data[d.length-1],s=Y.pop()??0,a=!0),e.leaf&&(n=v(e.children,t,e.children.length,e.indexHint),n!==-1))return e.children.splice(n,1),d.push(e),this._condense(d),this;a||e.leaf||!S(e,r)?i?(s++,e=i.children[s],a=!1):e=null:(d.push(e),Y.push(s),s=0,i=e,e=e.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,n){let e=t;for(X.clear();e;){if(e.leaf===!0)for(const i of e.children)n(i);else X.pushArray(e.children);e=X.pop()??null}}_build(t,n,e,i){const s=e-n+1;let a=this._maxEntries;if(s<=a){const l=new B(t.slice(n,e+1));return x(l,this._toBBox),l}i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/a**(i-1)));const r=new E([]);r.height=i;const o=Math.ceil(s/a),c=o*Math.ceil(Math.sqrt(a));R(t,n,e,c,this._compareMinX);for(let l=n;l<=e;l+=c){const m=Math.min(l+c-1,e);R(t,l,m,o,this._compareMinY);for(let u=l;u<=m;u+=o){const A=Math.min(u+o-1,m);r.children.push(this._build(t,u,A,i-1))}}return x(r,this._toBBox),r}_chooseSubtree(t,n,e,i){for(;i.push(n),n.leaf!==!0&&i.length-1!==e;){let s,a=1/0,r=1/0;for(let o=0,c=n.children.length;o=0&&d.data[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(s,d,n)}_split(t,n){const e=t.data[n],i=e.children.length,s=this._minEntries;this._chooseSplitAxis(e,s,i);const a=this._chooseSplitIndex(e,s,i);if(!a)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const r=e.children.splice(a,e.children.length-a),o=e.leaf?new B(r):new E(r);o.height=e.height,x(e,this._toBBox),x(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(e,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,x(this._data,this._toBBox)}_chooseSplitIndex(t,n,e){let i,s,a;i=s=1/0;for(let r=n;r<=e-n;r++){const o=f(t,0,r,this._toBBox),c=f(t,r,e,this._toBBox),l=I(o,c),m=b(o)+b(c);l=n;c--){const l=t.children[c];p(r,t.leaf?s(l):l),o+=g(r)}return o}_adjustParentBBoxes(t,n,e){for(let i=e;i>=0;i--)p(n.data[i],t)}_condense(t){for(let n=t.length-1;n>=0;n--){const e=t.data[n];if(e.children.length===0)if(n>0){const i=t.data[n-1],s=i.children;s.splice(v(s,e,s.length,i.indexHint),1)}else this.clear();else x(e,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function x(h,t){f(h,0,h.children.length,t,h)}function f(h,t,n,e,i){i||(i=new B([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let s,a=t;a=h.minX&&t.maxY>=h.minY}function R(h,t,n,e,i){const s=[t,n];for(;s.length;){const a=s.pop(),r=s.pop();if(a-r<=e)continue;const o=r+Math.ceil((a-r)/e/2)*e;H(h,o,r,a,i),s.push(r,o,o,a)}}const _=new w,X=new w,d=new w,Y=new w({deallocator:void 0});class J{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class y extends J{constructor(){super(...arguments),this.height=1,this.indexHint=new D}}class B extends y{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends y{constructor(t){super(),this.children=t,this.leaf=!1}}export{$ as s}; diff --git a/dist/assets/Popup-aRK3Vd3w.js b/dist/assets/Popup-aRK3Vd3w.js new file mode 100644 index 0000000..204f4a7 --- /dev/null +++ b/dist/assets/Popup-aRK3Vd3w.js @@ -0,0 +1,8 @@ +import{V as De,e as o,y as l,f6 as Te,S as ke,c as R,p as ce,d as f,P as H,E as k,li as Pt,kj as Ni,kM as Y,hl as Z,fl as Fe,hm as Re,de as E,hn as u,kN as I,oJ as Lt,vv as Ot,vw as Si,hw as Ae,kO as pe,vx as It,oK as di,oI as Di,vy as ci,c_ as Vt,Z as ie,gG as Bi,jG as Ce,rg as Wi,ca as it,eY as qi,bW as Hi,kq as vt,vz as ui,e3 as Ke,vA as zi,hy as oe,vB as ji,hv as Ui,vC as hi,vD as Qi,ma as Qe,vE as Gi,vF as pi,vG as Xi,vH as Nt,dq as Yi,m as mi,ao as st,ah as nt,n as Ki,mo as gi,f as Ji,vf as Be,vI as O,vJ as Zi,vb as es,vK as ye,nW as ts,vL as xe,vM as me,vN as St,vO as is,vP as Ie,bX as ss,F as yt,C as ns,pf as rs,vQ as os,lE as as,c7 as Dt,km as Bt,T as ls,d8 as Wt,vR as fi,vS as ds,um as qt,w as cs}from"./index-J0iiHjMT.js";import{l as us}from"./AttachmentInfo-kbEMEIl0.js";import{E as _i,x as Ge,C as vi,q as yi,d as we,D as be,P as Ht,z as zt,R as hs,v as wt,M as wi,Y as ps,a as Ft,o as At,T as ms,r as gs,i as jt,s as fs,J as _s,n as vs,c as ys,u as rt,h as ws,b as bs}from"./featureUtils-itZGjo5c.js";import{s as ot}from"./executeQueryJSON-ACj9qY0y.js";import"./pbf-o0zzptPp.js";import"./FeatureSet-d4S1oKME.js";import"./TopFeaturesQuery-E6D2tV-x.js";import Ms from"./FeatureLayer--S4epFk-.js";import{c as bi}from"./AnchorElementViewModel-SDYg-P9c.js";import{s as Is}from"./ReactiveSet-HLstcUcf.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./queryZScale-IaMm02_2.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";const Ut={editing:!1,operations:{add:!0,update:!0,delete:!0}},Mi=De.ofType(us);let X=class extends ce{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...Ut},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Mi,this.fileInfos=new De,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(f(()=>this.graphic,()=>this._graphicChanged(),H))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...Ut,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return(t==null?void 0:t.loaded)&&"capabilities"in t&&t.capabilities&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new k("invalid-layer","getAttachments(): A valid layer is required.");const s=this._getObjectId(),n=new Pt({objectIds:[s],returnMetadata:!0}),r=[],a=e.queryAttachments(n).then(c=>c[s]||r).catch(()=>r);this._getAttachmentsPromise=a,this.notifyChange("state");const d=await a;return t.removeAll(),d.length&&t.addMany(d),this._getAttachmentsPromise=null,this.notifyChange("state"),d}async addAttachment(e,t=this.graphic){var c;const{_attachmentLayer:s,attachmentInfos:n,capabilities:r}=this;if(!t)throw new k("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new k("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!((c=r.operations)!=null&&c.add))throw new k("invalid-capabilities","addAttachment(): add capabilities are required.");if(!s||typeof s.addAttachment!="function")throw new k("invalid-layer","addAttachment(): A valid layer is required.");const a=s.addAttachment(t,e).then(h=>this._queryAttachment(h.objectId,t)),d=await a;return n.add(d),d}async deleteAttachment(e){var c;const{_attachmentLayer:t,attachmentInfos:s,graphic:n,capabilities:r}=this;if(!e)throw new k("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!((c=r.operations)!=null&&c.delete))throw new k("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new k("invalid-layer","deleteAttachment(): A valid layer is required.");if(!n)throw new k("invalid-graphic","deleteAttachment(): A graphic is required.");const a=t.deleteAttachments(n,[e.id]).then(()=>e),d=await a;return s.remove(d),d}async updateAttachment(e,t=this.activeAttachmentInfo){var p;const{_attachmentLayer:s,attachmentInfos:n,graphic:r,capabilities:a}=this;if(!e)throw new k("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new k("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!((p=a.operations)!=null&&p.update))throw new k("invalid-capabilities","updateAttachment(): Update capabilities are required.");const d=n.indexOf(t);if(!s||typeof s.updateAttachment!="function")throw new k("invalid-layer","updateAttachment(): A valid layer is required.");if(!r)throw new k("invalid-graphic","updateAttachment(): A graphic is required.");const c=s.updateAttachment(r,t.id,e).then(m=>this._queryAttachment(m.objectId)),h=await c;return n.splice(d,1,h),h}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const s={file:e,form:t};return this.fileInfos.add(s),s}updateFile(e,t,s=this.activeFileInfo){if(!e||!t||!s)return null;const n=this.fileInfos.indexOf(s);return n>-1&&this.fileInfos.splice(n,1,{file:e,form:t}),this.fileInfos.items[n]}deleteFile(e){const t=this.fileInfos.find(s=>s.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:s}=this;if(!e||!(s!=null&&s.queryAttachments))throw new k("invalid-attachment-id","Could not query attachment.");const n=this._getObjectId(t),r=new Pt({objectIds:[n],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return s.queryAttachments(r).then(a=>a[n][0])}_getObjectId(e=this.graphic){return(e==null?void 0:e.getObjectId())??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,t=_i(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};o([l()],X.prototype,"capabilities",void 0),o([Te("capabilities")],X.prototype,"castCapabilities",null),o([l()],X.prototype,"activeAttachmentInfo",void 0),o([l()],X.prototype,"activeFileInfo",void 0),o([l({readOnly:!0,type:Mi})],X.prototype,"attachmentInfos",void 0),o([l()],X.prototype,"fileInfos",void 0),o([l({type:ke})],X.prototype,"graphic",void 0),o([l()],X.prototype,"mode",void 0),o([l({readOnly:!0})],X.prototype,"state",null),o([l()],X.prototype,"filesEnabled",void 0),o([l({readOnly:!0})],X.prototype,"supportsResizeAttachments",null),X=o([R("esri.widgets.Attachments.AttachmentsViewModel")],X);const Ct=X;function Qt(i){const e=i.toLowerCase();return e==="image/bmp"||e==="image/emf"||e==="image/exif"||e==="image/gif"||e==="image/x-icon"||e==="image/jpeg"||e==="image/png"||e==="image/tiff"||e==="image/x-wmf"}function Fs(i){const e=Ni("esri/themes/base/images/files/");return i?i==="text/plain"?`${e}text-32.svg`:i==="application/pdf"?`${e}pdf-32.svg`:i==="text/csv"?`${e}csv-32.svg`:i==="application/gpx+xml"?`${e}gpx-32.svg`:i==="application/x-dwf"?`${e}cad-32.svg`:i==="application/postscript"||i==="application/json"||i==="text/xml"||i==="model/vrml"?`${e}code-32.svg`:i==="application/x-zip-compressed"||i==="application/x-7z-compressed"||i==="application/x-gzip"||i==="application/x-tar"||i==="application/x-gtar"||i==="application/x-bzip2"||i==="application/gzip"||i==="application/x-compress"||i==="application/x-apple-diskimage"||i==="application/x-rar-compressed"||i==="application/zip"?`${e}zip-32.svg`:i.includes("image/")?`${e}image-32.svg`:i.includes("audio/")?`${e}sound-32.svg`:i.includes("video/")?`${e}video-32.svg`:i.includes("msexcel")||i.includes("ms-excel")||i.includes("spreadsheetml")?`${e}excel-32.svg`:i.includes("msword")||i.includes("ms-word")||i.includes("wordprocessingml")?`${e}word-32.svg`:i.includes("powerpoint")||i.includes("presentationml")?`${e}report-32.svg`:`${e}generic-32.svg`:`${e}generic-32.svg`}const Gt={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},C="esri-attachments",y={base:C,loaderContainer:`${C}__loader-container`,loader:`${C}__loader`,fadeIn:`${C}--fade-in`,container:`${C}__container`,containerList:`${C}__container--list`,containerPreview:`${C}__container--preview`,actions:`${C}__actions`,deleteButton:`${C}__delete-button`,addAttachmentButton:`${C}__add-attachment-button`,errorMessage:`${C}__error-message`,items:`${C}__items`,item:`${C}__item`,itemButton:`${C}__item-button`,itemMask:`${C}__item-mask`,itemMaskIcon:`${C}__item-mask--icon`,itemImage:`${C}__image`,itemImageResizable:`${C}__image--resizable`,itemLabel:`${C}__label`,itemFilename:`${C}__filename`,itemChevronIcon:`${C}__item-chevron-icon`,itemLink:`${C}__item-link`,itemLinkOverlay:`${C}__item-link-overlay`,itemLinkOverlayIcon:`${C}__item-link-overlay-icon`,itemEditIcon:`${C}__item-edit-icon`,itemAddIcon:`${C}__item-add-icon`,itemAddButton:`${C}__item-add-button`,formNode:`${C}__form-node`,fileFieldset:`${C}__file-fieldset`,fileLabel:`${C}__file-label`,fileName:`${C}__file-name`,fileInput:`${C}__file-input`,metadata:`${C}__metadata`,metadataFieldset:`${C}__metadata-fieldset`,progressBar:`${C}__progress-bar`},at=window.CSS;let j=class extends Z{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...Gt},this._supportsImageOrientation=at&&at.supports&&at.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e!=null&&e.viewModel||(e={viewModel:new Ct,...e}),e}initialize(){this.addHandles([Fe(()=>{var e;return(e=this.viewModel)==null?void 0:e.attachmentInfos},"change",()=>this.scheduleRender()),Fe(()=>{var e;return(e=this.viewModel)==null?void 0:e.fileInfos},"change",()=>this.scheduleRender()),f(()=>{var e;return(e=this.viewModel)==null?void 0:e.mode},()=>this._modeChanged(),H)])}loadDependencies(){return Re({icon:()=>E(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([0,1,2,3,4]))})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...Gt,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(s=>(this._set("submitting",!1),this._set("error",null),t.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new k("attachments:add-attachment",this.messages.addErrorMessage,s)),s})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(s=>(this._set("submitting",!1),this._set("error",null),t.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new k("attachments:delete-attachment",this.messages.deleteErrorMessage,s)),s})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(s=>(this._set("submitting",!1),this._set("error",null),e.mode="view",s)).catch(s=>{throw this._set("submitting",!1),this._set("error",new k("attachments:update-attachment",this.messages.updateErrorMessage,s)),s})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){var s;const t=this.viewModel.deleteFile(e||((s=this.viewModel.activeFileInfo)==null?void 0:s.file));return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:s}=t;return u("div",{class:this.classes(y.base,I.widget)},e?this._renderProgressBar():null,s==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:y.errorMessage,key:"error-message"},e.message):null}_renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:s}=this.viewModel;return t==="add"?this._renderAddForm():t==="edit"?this._renderDetailsForm(s||e):this._renderAttachmentContainer()}_renderLoading(){return u("div",{class:y.loaderContainer,key:"loader"},u("div",{class:y.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:y.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,s=e||!t,n=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(I.button,I.buttonTertiary,I.buttonSmall,I.buttonHalf,e&&I.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,r=this.visibleElements.addSubmitButton?u("button",{class:this.classes(I.button,I.buttonSecondary,I.buttonSmall,I.buttonHalf,{[I.buttonDisabled]:s}),disabled:s,type:"submit"},this.messages.add):null,a=t?u("span",{class:y.fileName,key:"file-name"},t.name):null,d=u("form",{afterCreate:Lt,afterRemoved:Ot,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:y.fileFieldset},a,u("label",{class:this.classes(y.fileLabel,I.button,I.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:y.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),r,n);return u("div",{class:y.formNode,key:"add-form-container"},d)}_renderDetailsForm(e){var V,se,K;const{visibleElements:t,viewModel:s,selectedFile:n,submitting:r}=this,{capabilities:a}=s,d=r||!n;let c,h,p,m;n?(c=n.type,h=n.name,p=n.size):e&&"file"in e?(c=e.file.type,h=e.file.name,p=e.file.size):e&&"contentType"in e&&(c=e.contentType,h=e.name,p=e.size,m=e.url);const g=a.editing&&((V=a.operations)!=null&&V.delete)&&t.deleteButton?u("button",{bind:this,class:this.classes(I.button,I.buttonSmall,I.buttonTertiary,y.deleteButton,{[I.buttonDisabled]:r}),disabled:r,key:"delete-button",onclick:ee=>this._submitDeleteAttachment(ee,e),type:"button"},this.messages.delete):void 0,_=a.editing&&((se=a.operations)!=null&&se.update)&&t.updateButton?u("button",{class:this.classes(I.button,I.buttonSmall,I.buttonThird,{[I.buttonDisabled]:d}),disabled:d,key:"update-button",type:"submit"},this.messages.update):void 0,v=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(I.button,I.buttonSmall,I.buttonTertiary,I.buttonThird,{[I.buttonDisabled]:r}),disabled:r,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,w=a.editing&&((K=a.operations)!=null&&K.update)?u("fieldset",{class:y.fileFieldset,key:"file"},u("span",{class:y.fileName,key:"file-name"},h),u("label",{class:this.classes(y.fileLabel,I.button,I.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:y.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,A=u("fieldset",{class:y.metadataFieldset,key:"size"},u("label",null,Si(this.messagesUnits,p??0))),b=u("fieldset",{class:y.metadataFieldset,key:"content-type"},u("label",null,c)),T=m!=null?u("a",{class:y.itemLink,href:m,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:y.itemLinkOverlay},u("span",{class:y.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),L=u("form",{afterCreate:Lt,afterRemoved:Ot,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:ee=>this._submitUpdateAttachment(ee,e)},u("div",{class:y.metadata},A,b),w,u("div",{class:y.actions},g,v,_));return u("div",{class:y.formNode,key:"edit-form-container"},T,L)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:s}=this.viewModel,n=Fs(t),r={[y.itemImageResizable]:s};return u("div",{class:this.classes(y.itemMaskIcon,y.itemMask),key:n},u("img",{alt:e,class:this.classes(r,y.itemImage),src:n,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:s}=this.viewModel;if(!e)return null;const{contentType:n,name:r,url:a}=e;if(!s||!Qt(n))return this._renderGenericImageMask(r,n);const d=this._getCSSTransform(e),c=d?{transform:d,"image-orientation":"none"}:{},h=`${a}${a!=null&&a.includes("?")?"&":"?"}w=${t}`,p={[y.itemImageResizable]:s};return u("div",{class:this.classes(y.itemMask),key:h},u("img",{alt:r,class:this.classes(p,y.itemImage),src:h,styles:c,title:r}))}_renderFile(e){const{file:t}=e;return u("li",{class:y.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:y.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:y.itemLabel},u("span",{class:y.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(y.itemChevronIcon,Ae(this.container)?pe.left:pe.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:s,effectiveDisplayType:n}=this,{capabilities:r,supportsResizeAttachments:a}=s,{contentType:d,name:c,url:h}=e,p=this._renderImageMask(e,t==="list"?48:400),m=r.editing?u("span",{"aria-hidden":"true",class:this.classes(y.itemChevronIcon,Ae(this.container)?pe.left:pe.right)}):null,g=[p,n==="preview"&&a&&Qt(d)?null:u("label",{class:y.itemLabel},u("span",{class:y.itemFilename},c||this.messages.noTitle),m)],_=r.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:y.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},g):u("a",{class:y.itemButton,href:h??void 0,key:"details-link",target:"_blank"},g);return u("li",{class:y.item,key:e},_)}_renderAttachmentContainer(){var v;const{effectiveDisplayType:e,viewModel:t,visibleElements:s}=this,{attachmentInfos:n,capabilities:r,fileInfos:a}=t,d=!!(n!=null&&n.length),c=!!(a!=null&&a.length),h={[y.containerList]:e!=="preview",[y.containerPreview]:e==="preview"},p=r.editing&&((v=r.operations)!=null&&v.add)&&s.addButton?u("button",{bind:this,class:this.classes(I.button,I.buttonTertiary,y.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(y.itemAddIcon,pe.plus)}),this.messages.add):void 0,m=d?u("ul",{class:y.items,key:"attachments-list"},n.toArray().map(w=>this._renderAttachmentInfo({attachmentInfo:w,displayType:e}))):void 0,g=c?u("ul",{class:y.items,key:"file-list"},a.toArray().map(w=>this._renderFile(w))):void 0,_=c||d?void 0:u("div",{class:I.empty},this.messages.noAttachments);return u("div",{class:this.classes(y.container,h),key:"attachments-container"},m,g,_,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){var n;const t=e.target,s=(n=t.files)==null?void 0:n.item(0);this._set("selectedFile",s)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};o([l()],j.prototype,"capabilities",null),o([l()],j.prototype,"displayType",void 0),o([l({readOnly:!0})],j.prototype,"effectiveDisplayType",null),o([l()],j.prototype,"graphic",null),o([l()],j.prototype,"label",null),o([l(),Y("esri/widgets/Attachments/t9n/Attachments")],j.prototype,"messages",void 0),o([l(),Y("esri/core/t9n/Units")],j.prototype,"messagesUnits",void 0),o([l({readOnly:!0})],j.prototype,"selectedFile",void 0),o([l({readOnly:!0})],j.prototype,"submitting",void 0),o([l({readOnly:!0})],j.prototype,"error",void 0),o([l({type:Ct})],j.prototype,"viewModel",void 0),o([l()],j.prototype,"visibleElements",void 0),o([Te("visibleElements")],j.prototype,"castVisibleElements",null),j=o([R("esri.widgets.Attachments")],j);const As=j;let Oe=class extends Ct{constructor(e){super(e),this.description=null,this.title=null}};o([l()],Oe.prototype,"description",void 0),o([l()],Oe.prototype,"title",void 0),Oe=o([R("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],Oe);const Et=Oe,lt="esri-feature-element-info",dt={base:lt,title:`${lt}__title`,description:`${lt}__description`};let Ee=class extends Z{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:dt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(It,{class:dt.title,level:this.headingLevel},e):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:dt.description,key:"description"},e):null}};o([l()],Ee.prototype,"description",void 0),o([l()],Ee.prototype,"headingLevel",void 0),o([l()],Ee.prototype,"title",void 0),Ee=o([R("esri.widgets.Feature.support.FeatureElementInfo")],Ee);const Je=Ee,Cs={base:"esri-feature-attachments"};let re=class extends Z{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new As,this.headingLevel=2,this.viewModel=new Et}initialize(){this._featureElementInfo=new Je,this.addHandles([f(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title,this.headingLevel]},()=>this._setupFeatureElementInfo(),H),f(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,H)])}destroy(){var e;this.attachmentsWidget.viewModel=null,this.attachmentsWidget.destroy(),(e=this._featureElementInfo)==null||e.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var t;const{attachmentsWidget:e}=this;return u("div",{class:Cs.base},(t=this._featureElementInfo)==null?void 0:t.render(),e==null?void 0:e.render())}_setupFeatureElementInfo(){var n;const{description:e,title:t,headingLevel:s}=this;(n=this._featureElementInfo)==null||n.set({description:e,title:t,headingLevel:s})}};o([l({readOnly:!0})],re.prototype,"attachmentsWidget",void 0),o([l()],re.prototype,"description",null),o([l()],re.prototype,"displayType",null),o([l()],re.prototype,"graphic",null),o([l()],re.prototype,"headingLevel",void 0),o([l()],re.prototype,"title",null),o([l({type:Et})],re.prototype,"viewModel",void 0),re=o([R("esri.widgets.Feature.FeatureAttachments")],re);const Es=re;let he=class extends ce{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(f(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},H))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:s}=this;e&&t&&(Ge(s,{graphic:t}).catch(()=>null),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const s=Ge(e,{graphic:t}).catch(()=>null);this._loadingPromise=s,this.notifyChange("state");const n=await s;s===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",n))}};o([l({readOnly:!0})],he.prototype,"created",void 0),o([l()],he.prototype,"creator",void 0),o([l()],he.prototype,"destroyer",void 0),o([l({type:ke})],he.prototype,"graphic",void 0),o([l({readOnly:!0})],he.prototype,"state",null),he=o([R("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],he);const Xe=he,ct="esri-feature-content",ut={base:ct,loaderContainer:`${ct}__loader-container`,loader:`${ct}__loader`};let $e=class extends Z{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=s=>{Array.from(s.querySelectorAll("a")).forEach(n=>{vi(n.href)&&!n.hasAttribute("target")&&n.setAttribute("target","_blank")})}}get creator(){var e;return(e=this.viewModel)==null?void 0:e.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){var e;return(e=this.viewModel)==null?void 0:e.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){var t;const e=(t=this.viewModel)==null?void 0:t.state;return u("div",{class:ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:ut.loaderContainer,key:"loader"},u("div",{class:ut.loader}))}_renderCreated(){var t;const e=(t=this.viewModel)==null?void 0:t.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):di(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};o([l()],$e.prototype,"creator",null),o([l()],$e.prototype,"graphic",null),o([l({type:Xe})],$e.prototype,"viewModel",void 0),$e=o([R("esri.widgets.Feature.FeatureContent")],$e);const He=$e;let le=class extends ce{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,s=[];return t==null||t.forEach(n=>{if(!(!n.hasOwnProperty("visible")||n.visible))return;const r=n.clone();r.label=yi(r,e),s.push(r)}),s}};o([l()],le.prototype,"attributes",void 0),o([l({type:[Di]})],le.prototype,"expressionInfos",void 0),o([l()],le.prototype,"description",void 0),o([l({type:[ci]})],le.prototype,"fieldInfos",void 0),o([l({readOnly:!0})],le.prototype,"formattedFieldInfos",null),o([l()],le.prototype,"title",void 0),le=o([R("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],le);const Ze=le,$s=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function xs(i){let e=null;return $s.some(t=>(t.pattern.test(i)&&(e=t),!!e)),e}function Ts(i,e){if(typeof e!="string"||!e)return e;const t=xs(e);if(!t)return e;const s=e.match(t.pattern),n=s&&s[2],r=Vt(Vt(t.label,{messages:i,hierPart:n}),{appName:t.appName}),a=t.target?` target="${t.target}"`:"",d=t.target==="_blank"?' rel="noreferrer"':"";return e.replace(t.pattern,`${r}`)}const We="esri-feature-fields",qe={base:We,fieldHeader:`${We}__field-header`,fieldData:`${We}__field-data`,fieldDataDate:`${We}__field-data--date`};let ne=class extends Z{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Ze,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new Je,this.addHandles(f(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),H))}destroy(){var e;(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return u("div",{class:qe.base},(e=this._featureElementInfo)==null?void 0:e.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:s}=this.viewModel,n=e.fieldName,r=e.label||n,a=s?s[n]==null?"":s[n]:"",d=!(!e.format||!e.format.dateFormat),c=typeof a=="number"&&!d?this._forceLTR(a):Ts(this.messagesURIUtils,a),h={[qe.fieldDataDate]:d};return u("tr",{key:`fields-element-info-row-${n}-${t}`},u("th",{class:qe.fieldHeader,innerHTML:r,key:`fields-element-info-row-header-${n}-${t}`}),u("td",{class:this.classes(qe.fieldData,h),innerHTML:c,key:`fields-element-info-row-data-${n}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e!=null&&e.length?u("table",{class:I.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,s)=>this._renderFieldInfo(t,s)))):null}_setupFeatureElementInfo(){var s;const{description:e,title:t}=this;(s=this._featureElementInfo)==null||s.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};o([l()],ne.prototype,"attributes",null),o([l()],ne.prototype,"description",null),o([l()],ne.prototype,"expressionInfos",null),o([l()],ne.prototype,"fieldInfos",null),o([l()],ne.prototype,"title",null),o([l({type:Ze,nonNullable:!0})],ne.prototype,"viewModel",void 0),o([l(),Y("esri/widgets/Feature/t9n/Feature")],ne.prototype,"messages",void 0),o([l(),Y("esri/widgets/support/t9n/uriUtils")],ne.prototype,"messagesURIUtils",void 0),ne=o([R("esri.widgets.Feature.FeatureFields")],ne);const Ii=ne,ks=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,Rs="esri.widgets.Feature.support.relatedFeatureUtils",Xt=ie.getLogger(Rs),Yt=new Map;function ze(i){if(!we(i))return null;const[e,t]=i.split("/").slice(1);return{layerId:e,fieldName:t}}function Ps(i,e){if(!e.relationships)return null;let t=null;const{relationships:s}=e;return s.some(n=>n.id===parseInt(i,10)&&(t=n,!0)),t}function Ls({originRelationship:i,relationships:e,layerId:t}){let s=null;return e&&e.some(n=>(`${n.relatedTableId}`===t&&n.id===(i==null?void 0:i.id)&&(s=n),!!s)),s}function Os(i,e){const t=e.toLowerCase();for(const s in i)if(s.toLowerCase()===t)return i[s];return null}function Vs(i,e){const t=Ps(i,e);if(t)return{url:`${e.url}/${t.relatedTableId}`,sourceSpatialReference:e.spatialReference,relation:t,relatedFields:[],outStatistics:[]}}function Ns(i,e){if(!e||!i)return;const{features:t,statsFeatures:s}=i,n=t==null?void 0:t.value;e.relatedFeatures=n?n.features:[];const r=s==null?void 0:s.value;e.relatedStatsFeatures=r?r.features:[]}function Ss(i,e,t,s){var r;const n=new vt;return n.outFields=["*"],n.relationshipId=typeof e.id=="number"?e.id:parseInt(e.id,10),n.objectIds=[i.attributes[t.objectIdField]],((r=t.queryRelatedFeatures)==null?void 0:r.call(t,n,s))??Promise.resolve({})}function Ds(i,e,t){let s=0;const n=[];for(;sJSON.stringify(e.toJSON())===JSON.stringify(t.toJSON())):void 0}async function qs(i,e,t,s){const n=t.layerId.toString(),{layerInfo:r,relation:a,relatedFields:d,outStatistics:c,url:h,sourceSpatialReference:p}=e,m=Bs(d),g=Ws(c);if(!r||!a)return null;const _=Ls({originRelationship:a,relationships:r.relationships,layerId:n});if(_!=null&&_.relationshipTableId&&_.keyFieldInRelationshipTable){const w=(await Ss(i,_,t,s))[i.attributes[t.objectIdField]];if(!w)return null;const A=w.features.map(b=>b.attributes[r.objectIdField]);if(g!=null&&g.length&&r.supportsStatistics){const b=new it;b.where=Ds(r.objectIdField,A,1e3),b.outFields=m,b.outStatistics=g,b.sourceSpatialReference=p;const T={features:Promise.resolve(w),statsFeatures:ot(h,b)};return Ce(T)}}const v=_==null?void 0:_.keyField;if(v){const w=qi(Qs(r.fields,v)),A=Os(i.attributes,a.keyField),b=w?`${v}=${A}`:`${v}='${A}'`,T=ot(h,new it({where:b,outFields:m,sourceSpatialReference:p}),s),L=g!=null&&g.length&&r.supportsStatistics?ot(h,new it({where:b,outFields:m,outStatistics:g,sourceSpatialReference:p}),s):null,V={features:T};return L&&(V.statsFeatures=L),Ce(V)}return null}function Hs(i,e){return Hi(i,{query:{f:"json"},signal:e==null?void 0:e.signal})}function zs({relatedInfos:i,layer:e},t){const s={};return i.forEach((n,r)=>{const{relation:a}=n;if(!a){const m=new k("relation-required","A relation is required on a layer to retrieve related records.");throw Xt.error(m),m}const{relatedTableId:d}=a;if(typeof d!="number"){const m=new k("A related table ID is required on a layer to retrieve related records.");throw Xt.error(m),m}const c=`${e.url}/${d}`,h=Yt.get(c),p=h??Hs(c);h||Yt.set(c,p),s[r]=p}),Bi(Ce(s),t)}function js({graphic:i,relatedInfos:e,layer:t},s){const n={};return e.forEach((r,a)=>{r.layerInfo&&(n[a]=qs(i,r,t,s))}),Ce(n)}function Us({relatedInfo:i,fieldName:e,fieldInfo:t}){var s,n;if((s=i.relatedFields)==null||s.push(e),t.statisticType){const r=new Wi({statisticType:t.statisticType,onStatisticField:e,outStatisticFieldName:e});(n=i.outStatistics)==null||n.push(r)}}function Qs(i,e){if(i!=null){e=e.toLowerCase();for(const t of i)if(t&&t.name.toLowerCase()===e)return t}return null}const Kt={chartAnimation:!0};let D=class extends ce{constructor(e){super(e),this.abilities={...Kt},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Kt,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,s=(e+t)%t;this.activeMediaInfoIndex=s}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,s=t+e;this._setContentElementMedia(s)}_formatMediaInfos(){const{mediaInfos:e,layer:t}=this,s=this.attributes??{},n=this.formattedAttributes??{},r=this.expressionAttributes??{},a=this.fieldInfoMap??new Map;return(e==null?void 0:e.map(d=>{const c=d==null?void 0:d.clone();if(!c)return null;if(c.title=be({attributes:s,fieldInfoMap:a,globalAttributes:n,expressionAttributes:r,layer:t,text:c.title}),c.caption=be({attributes:s,fieldInfoMap:a,globalAttributes:n,expressionAttributes:r,layer:t,text:c.caption}),c.altText=be({attributes:s,fieldInfoMap:a,globalAttributes:n,expressionAttributes:r,layer:t,text:c.altText}),c.type==="image"){const{value:h}=c;return this._setImageValue({value:h,formattedAttributes:n,layer:t}),c.value.sourceURL?c:void 0}if(c.type==="pie-chart"||c.type==="line-chart"||c.type==="column-chart"||c.type==="bar-chart"){const{value:h}=c;return this._setChartValue({value:h,chartType:c.type,attributes:s,formattedAttributes:n,layer:t,expressionAttributes:r}),c}return null}).filter(Ke))??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:s,formattedAttributes:n,layer:r}=e,{linkURL:a,sourceURL:d}=s;if(d){const c=Ht(d,r);s.sourceURL=zt({formattedAttributes:n,template:c,fieldInfoMap:t})}if(a){const c=Ht(a,r);s.linkURL=zt({formattedAttributes:n,template:c,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:s,formattedAttributes:n,chartType:r,layer:a,expressionAttributes:d}=e,{popupTemplate:c,relatedInfos:h}=this,{fields:p,normalizeField:m}=t,g=a;if(t.fields=hs(p,g),m&&(t.normalizeField=wt(m,g)),!p.some(v=>!!(n[v]!=null||we(v)&&(h!=null&&h.size))))return;const _=(c==null?void 0:c.fieldInfos)??[];p.forEach((v,w)=>{var T;const A=(T=t.colors)==null?void 0:T[w];if(we(v))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:_,fieldName:v,formattedAttributes:n,chartType:r,value:t,color:A})]);const b=this._getChartOption({value:t,attributes:s,chartType:r,formattedAttributes:n,expressionAttributes:d,fieldName:v,fieldInfos:_,color:A});t.series.push(b)})}_getRelatedChartInfos(e){var v;const{fieldInfos:t,fieldName:s,formattedAttributes:n,chartType:r,value:a,color:d}=e,c=[],h=ze(s),p=h&&((v=this.relatedInfos)==null?void 0:v.get(h.layerId.toString()));if(!p)return c;const{relatedFeatures:m,relation:g}=p;if(!g||!m)return c;const{cardinality:_}=g;return m.forEach(w=>{const{attributes:A}=w;A&&Object.keys(A).forEach(b=>{b===h.fieldName&&c.push(this._getChartOption({value:a,attributes:A,formattedAttributes:n,fieldName:s,chartType:r,relatedFieldName:b,hasMultipleRelatedFeatures:(m==null?void 0:m.length)>1,fieldInfos:t,color:d}))})}),_==="one-to-many"||_==="many-to-many"?c:[c[0]]}_getTooltip({label:e,value:t,chartType:s}){return s==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){var ee;const{value:t,attributes:s,formattedAttributes:n,expressionAttributes:r,fieldName:a,relatedFieldName:d,fieldInfos:c,chartType:h,hasMultipleRelatedFeatures:p,color:m}=e,g=this.layer,_=this.fieldInfoMap??new Map,{normalizeField:v,tooltipField:w}=t,A=v?we(v)?s[ze(v).fieldName]:s[v]:null,b=wi(a)&&r&&r[a]!==void 0?r[a]:d&&s[d]!==void 0?s[d]:s[a]!==void 0?s[a]:n[a],T=new zi({fieldName:a,color:m,value:b===void 0?null:b&&A?b/A:b});if(we(a)){const q=_.get(a.toLowerCase()),et=w&&_.get(w.toLowerCase()),Li=(q==null?void 0:q.fieldName)??a,tt=p&&w?ze(w).fieldName:(et==null?void 0:et.fieldName)??w,Oi=p&&tt?s[tt]:n[tt]??(q==null?void 0:q.label)??(q==null?void 0:q.fieldName)??d,Vi=p&&d?s[d]:n[Li];return T.tooltip=this._getTooltip({label:Oi,value:Vi,chartType:h}),T}const L=ps(c,a),V=wt(a,g),se=w&&n[w]!==void 0?n[w]:yi(L||new ci({fieldName:V}),(ee=this.popupTemplate)==null?void 0:ee.expressionInfos),K=n[V];return T.tooltip=this._getTooltip({label:se,value:K,chartType:h}),T}};o([l()],D.prototype,"abilities",void 0),o([Te("abilities")],D.prototype,"castAbilities",null),o([l()],D.prototype,"activeMediaInfoIndex",void 0),o([l({readOnly:!0})],D.prototype,"activeMediaInfo",null),o([l()],D.prototype,"attributes",void 0),o([l()],D.prototype,"description",void 0),o([l()],D.prototype,"fieldInfoMap",void 0),o([l()],D.prototype,"formattedAttributes",void 0),o([l()],D.prototype,"expressionAttributes",void 0),o([l({readOnly:!0})],D.prototype,"formattedMediaInfos",null),o([l()],D.prototype,"isAggregate",void 0),o([l()],D.prototype,"layer",void 0),o([l({readOnly:!0})],D.prototype,"formattedMediaInfoCount",null),o([l()],D.prototype,"mediaInfos",void 0),o([l()],D.prototype,"popupTemplate",void 0),o([l()],D.prototype,"relatedInfos",void 0),o([l()],D.prototype,"title",void 0),D=o([R("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],D);const Me=D,N="esri-feature-media",U={base:N,mediaContainer:`${N}__container`,mediaItemContainer:`${N}__item-container`,mediaItem:`${N}__item`,mediaItemText:`${N}__item-text`,mediaItemTitle:`${N}__item-title`,mediaItemCaption:`${N}__item-caption`,mediaNavigation:`${N}__item-navigation`,mediaPagination:`${N}__pagination`,mediaPaginationText:`${N}__pagination-text`,mediaPrevious:`${N}__previous`,mediaPreviousIconLTR:`${N}__previous-icon`,mediaPreviousIconRTL:`${N}__previous-icon--rtl`,mediaNext:`${N}__next`,mediaNextIconLTR:`${N}__next-icon`,mediaNextIconRTL:`${N}__next-icon--rtl`,mediaChart:`${N}__chart`,mediaPaginationButton:`${N}__pagination-button`,mediaPaginationIcon:`${N}__pagination-icon`,mediaChartRendered:`${N}__chart--rendered`},ht=15,ue="category",Pe="value",Gs="rgba(50, 50, 50, 1)",Xs=250,Ys=500,Ks=200;let Q=class extends Z{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Me,this.messages=null,this._disposeChart=s=>{var n;(n=this._chartRootMap.get(s))==null||n.dispose(),this._chartRootMap.delete(s)},this._createChart=async s=>{const{destroyed:n,viewModel:r}=this;if(n||!r||!s)return;const{createRoot:a}=await E(()=>import("./chartUtilsAm5-QfmFJ3lc.js").then(c=>c.c),__vite__mapDeps([5,2,3,6,7,8])),d=await a(s);this._chartRootMap.set(s,d),this._renderChart({mediaInfo:r.activeMediaInfo,root:d})}}initialize(){this._featureElementInfo=new Je,this.addHandles([f(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.activeMediaInfo,(t=this.viewModel)==null?void 0:t.activeMediaInfoIndex]},()=>this._setupMediaRefreshTimer(),H),f(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),H)])}loadDependencies(){return Re({icon:()=>E(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([0,1,2,3,4]))})}destroy(){var e;this._clearMediaRefreshTimer(),(e=this._featureElementInfo)==null||e.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return u("div",{bind:this,class:U.base,onkeyup:this._handleMediaKeyup},(e=this._featureElementInfo)==null?void 0:e.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,s=this._renderMediaText();return e?u("div",{class:U.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:U.mediaNavigation},s,e>1?u("div",{class:U.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:U.mediaPaginationText},oe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:U.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,s=e&&e.caption?u("div",{class:U.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||s?u("div",{class:U.mediaItemText,key:"media-text"},t,s):null}_renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:s,formattedMediaInfoCount:n}=this.viewModel,{value:r,refreshInterval:a,altText:d,title:c,type:h}=e,{sourceURL:p,linkURL:m}=r,g=vi(m??void 0)?"_blank":"_self",_=g==="_blank"?"noreferrer":"",v=a?t:null,w=v?v.timestamp:0,A=v?v.sourceURL:p,b=u("img",{alt:d||c,key:`media-${h}-${s}-${n}-${w}`,src:A??void 0});return(m?u("a",{href:m,rel:_,target:g,title:c},b):null)??b}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:s}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:U.mediaChart,key:`media-${e.type}-${t}-${s}`})}_renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this._renderImageMediaInfo(e):e.type.includes("chart")?this._renderChartMediaInfo(e):null:null}_renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;return e?u("div",{class:U.mediaItemContainer,key:"media-container"},u("div",{class:U.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",s=t?this.messages.previous:this.messages.next,n=t?"chevron-left":"chevron-right",r=t?"media-previous":"media-next",a=t?this._previous:this._next;return u("button",{"aria-label":s,bind:this,class:U.mediaPaginationButton,key:r,onclick:a,tabIndex:0,title:s,type:"button"},u("calcite-icon",{class:U.mediaPaginationIcon,icon:n,scale:"s"}))}_setupFeatureElementInfo(){var s;const{description:e,title:t}=this;(s=this._featureElementInfo)==null||s.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&(t!=null&&t.featureReduction)&&"renderer"in t.featureReduction?t.featureReduction.renderer:t==null?void 0:t.renderer}async _getSeriesColors(e){const{colorAm5:t}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),s=new Map;return e.forEach(n=>{n.color&&s.set(n,t(n.color.toCss(!0)))}),s}async _getRendererColors(){const{colorAm5:e}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),t=new Map,s=this._getRenderer(),n="default";if(!s)return t;const r=await ji(s);return r.delete(n),Array.from(r.values()).every(a=>(a==null?void 0:a.length)===1)&&Array.from(r.keys()).forEach(a=>{var c,h;const d=(h=(c=r.get(a))==null?void 0:c[0])==null?void 0:h.toCss(!0);d&&t.set(a,e(d))}),t}_handleMediaKeyup(e){const t=hi(e);t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!ks()}_getChartAnimationMS(){return this._canAnimateChart()?Xs:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?Ys:0}async _renderChart(e){const{root:t,mediaInfo:s}=e,{value:n,type:r}=s,{ResponsiveThemeAm5:a,DarkThemeAm5:d,AnimatedThemeAm5:c,ColorSetAm5:h,ThemeAm5:p,esriChartColorSet:m}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),g=p.new(t);g.rule("ColorSet").set("colors",m),g.rule("ColorSet").set("reuse",!0);const _=[a.new(t),g];Ui()&&_.push(d.new(t)),this._canAnimateChart()&&_.push(c.new(t)),t.setThemes(_);const v=await this._getRendererColors(),w=await this._getSeriesColors(n.series),A=h.new(t,{}),b=w.get(n.series[0]),T=b?{lineSettings:{stroke:b}}:void 0,L=n.series.map((V,se)=>{const K=w.get(V)||v.get(V.fieldName)||A.getIndex(se);return{[ue]:V.tooltip,[Pe]:V.value,columnSettings:{fill:K,stroke:K},...T}}).filter(V=>r!=="pie-chart"||V.value!=null&&V.value>0);r==="pie-chart"?this._createPieChart(e,L):this._createXYChart(e,L)}_getDirection(){return Ae(this.container)?"rtl":"ltr"}_isInversed(){return!!Ae(this.container)}async _customizeChartTooltip(e,t="horizontal"){var n;const{colorAm5:s}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12]));e.setAll({pointerOrientation:t}),(n=e.get("background"))==null||n.setAll({stroke:s(Gs)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:Ks})}async _createPieChart(e,t){const{TooltipAm5:s}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),{PieChartAm5:n,PieSeriesAm5:r}=await E(()=>import("./pieChart-w-OTuuJJ.js"),__vite__mapDeps([13,2,3,14,6,12,8])),{mediaInfo:a,root:d}=e,{title:c}=a,h=5,p=(a==null?void 0:a.altText)||(a==null?void 0:a.title)||"",m=d.container.children.push(n.new(d,{ariaLabel:p,focusable:!0,paddingBottom:h,paddingTop:h,paddingLeft:h,paddingRight:h})),g=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,_=s.new(d,{labelText:g}),v=m.series.push(r.new(d,{name:c,valueField:Pe,categoryField:ue,tooltip:_}));v.ticks.template.set("forceHidden",!0),v.labels.template.set("forceHidden",!0),v.slices.template.states.create("active",{shiftRadius:h}),this._customizeChartTooltip(_),v.slices.template.setAll({ariaLabel:g,focusable:!0,templateField:"columnSettings"}),v.data.setAll(t),v.appear(this._getChartSeriesAnimationMS()),m.appear(this._getChartAnimationMS()),m.root.dom.classList.toggle(U.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(s=>t=Math.min(s.value,t)),t}async _createColumnChart(e,t,s){const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),{CategoryAxisAm5:a,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:h,ColumnSeriesAm5:p}=await E(()=>import("./xyChart-pkay2Qkc.js"),__vite__mapDeps([15,16,6,2,3,12,8,14,11])),{mediaInfo:m,root:g}=t,{value:_,title:v}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const w=e.xAxes.push(a.new(g,{renderer:d.new(g,{inversed:this._isInversed()}),categoryField:ue}));w.get("renderer").labels.template.setAll({forceHidden:!0});const A=e.yAxes.push(c.new(g,{renderer:h.new(g,{inside:!1}),min:this._getMinSeriesValue(_.series)}));A.get("renderer").labels.template.setAll({direction:this._getDirection()});const b="{categoryX}",T=n.new(g,{labelText:b}),L=e.series.push(p.new(g,{name:v,xAxis:w,yAxis:A,valueYField:Pe,categoryXField:ue,tooltip:T}));this._customizeChartTooltip(T),L.columns.template.setAll({ariaLabel:b,focusable:!0,templateField:"columnSettings"}),_.series.length>ht&&e.set("scrollbarX",r.new(g,{orientation:"horizontal"})),w.data.setAll(s),L.data.setAll(s),L.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,s){const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),{CategoryAxisAm5:a,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:h,ColumnSeriesAm5:p}=await E(()=>import("./xyChart-pkay2Qkc.js"),__vite__mapDeps([15,16,6,2,3,12,8,14,11])),{mediaInfo:m,root:g}=t,{value:_,title:v}=m;e.setAll({wheelX:"panY",wheelY:"zoomY"});const w=e.yAxes.push(a.new(g,{renderer:h.new(g,{inversed:!0}),categoryField:ue}));w.get("renderer").labels.template.setAll({forceHidden:!0});const A=e.xAxes.push(c.new(g,{renderer:d.new(g,{inside:!1,inversed:this._isInversed()}),min:this._getMinSeriesValue(_.series)}));A.get("renderer").labels.template.setAll({direction:this._getDirection()});const b="{categoryY}",T=n.new(g,{labelText:b}),L=e.series.push(p.new(g,{name:v,xAxis:A,yAxis:w,valueXField:Pe,categoryYField:ue,tooltip:T}));this._customizeChartTooltip(T,"vertical"),L.columns.template.setAll({ariaLabel:b,focusable:!0,templateField:"columnSettings"}),_.series.length>ht&&e.set("scrollbarY",r.new(g,{orientation:"vertical"})),w.data.setAll(s),L.data.setAll(s),L.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,s){var se,K,ee;const{TooltipAm5:n,ScrollbarAm5:r}=await E(()=>import("./chartCommon-ZPkVkRIK.js"),__vite__mapDeps([9,6,2,3,10,11,7,12])),{CategoryAxisAm5:a,AxisRendererXAm5:d,ValueAxisAm5:c,AxisRendererYAm5:h,LineSeriesAm5:p}=await E(()=>import("./xyChart-pkay2Qkc.js"),__vite__mapDeps([15,16,6,2,3,12,8,14,11])),{root:m,mediaInfo:g}=t,{value:_,title:v}=g;e.setAll({wheelX:"panX",wheelY:"zoomX"});const w=e.xAxes.push(a.new(m,{renderer:d.new(m,{inversed:this._isInversed()}),categoryField:ue}));w.get("renderer").labels.template.setAll({forceHidden:!0});const A=e.yAxes.push(c.new(m,{renderer:h.new(m,{inside:!1}),min:this._getMinSeriesValue(_.series)}));A.get("renderer").labels.template.setAll({direction:this._getDirection()});const b="{categoryX}",T=(K=(se=s[0])==null?void 0:se.lineSettings)==null?void 0:K.stroke,L=n.new(m,{getFillFromSprite:!T,labelText:b});T&&((ee=L.get("background"))==null||ee.setAll({fill:T}));const V=e.series.push(p.new(m,{name:v,xAxis:w,yAxis:A,valueYField:Pe,categoryXField:ue,tooltip:L}));V.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(L,"vertical"),_.series.length>ht&&e.set("scrollbarX",r.new(m,{orientation:"horizontal"})),w.data.setAll(s),V.data.setAll(s),V.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:s,XYCursorAm5:n}=await E(()=>import("./xyChart-pkay2Qkc.js"),__vite__mapDeps([15,16,6,2,3,12,8,14,11])),{root:r,mediaInfo:a}=e,{type:d}=a,c=(a==null?void 0:a.altText)||(a==null?void 0:a.title)||"",h=r.container.children.push(s.new(r,{ariaLabel:c,focusable:!0,panX:!0,panY:!0}));h.set("cursor",n.new(r,{})),d==="column-chart"&&await this._createColumnChart(h,e,t),d==="bar-chart"&&await this._createBarChart(h,e,t),d==="line-chart"&&await this._createLineChart(h,e,t),h.root.dom.classList.toggle(U.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:s}=e;if(!t)return;const n=6e4*t;this._updateMediaInfoTimestamp(s.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(s.sourceURL)},n);this._refreshTimer=r}_getImageSource(e,t){const s=e.includes("?")?"&":"?",[n,r=""]=e.split("#");return`${n}${s}timestamp=${t}${r?"#":""}${r}`}};o([l()],Q.prototype,"_refreshIntervalInfo",void 0),o([l()],Q.prototype,"attributes",null),o([l()],Q.prototype,"activeMediaInfoIndex",null),o([l()],Q.prototype,"description",null),o([l()],Q.prototype,"fieldInfoMap",null),o([l()],Q.prototype,"layer",null),o([l()],Q.prototype,"mediaInfos",null),o([l()],Q.prototype,"popupTemplate",null),o([l()],Q.prototype,"relatedInfos",null),o([l()],Q.prototype,"title",null),o([l({type:Me})],Q.prototype,"viewModel",void 0),o([l(),Y("esri/widgets/Feature/t9n/Feature")],Q.prototype,"messages",void 0),Q=o([R("esri.widgets.Feature.FeatureMedia")],Q);const Fi=Q,Js=["$datastore","$map","$layer","$aggregatedfeatures"],Zs="esri.widgets.Feature.support.arcadeFeatureUtils",en=ie.getLogger(Zs);function tn(i){return typeof i=="string"?Ft(At(i)):Array.isArray(i)?sn(i):(i==null?void 0:i.declaredClass)==="esri.arcade.Dictionary"?nn(i):i}function sn(i){return`
    ${i.map(e=>`
  • ${typeof e=="string"?Ft(At(e)):e}
  • `).join("")}
`}function nn(i){return`${i.keys().map(e=>{const t=i.field(e);return``}).join("")}
${e}${typeof t=="string"?Ft(At(t)):t}
`}function rn({aggregatedFeatures:i,arcadeUtils:e,featureSetVars:t,context:s,viewInfo:n,map:r,graphic:a,interceptor:d}){t.forEach(c=>{const h=c.toLowerCase(),p=n.sr,m={map:r,spatialReference:p,interceptor:d};if(h==="$map"&&(s.vars[h]=e.convertMapToFeatureSetCollection(m)),h==="$layer"&&(s.vars[h]=e.convertFeatureLayerToFeatureSet({layer:a.sourceLayer,spatialReference:p,interceptor:d})),h==="$datastore"&&(s.vars[h]=e.convertServiceUrlToWorkspace({url:a.sourceLayer.url,spatialReference:p,interceptor:d})),h==="$aggregatedfeatures"){const g=a.layer,{fields:_,objectIdField:v,geometryType:w,spatialReference:A,displayField:b}=g,T=new Ms({fields:_,objectIdField:v,geometryType:w,spatialReference:A,displayField:b,...g.type==="feature"?{templates:g.templates,typeIdField:g.typeIdField,types:g.types}:null,source:i});s.vars[h]=e.convertFeatureLayerToFeatureSet({layer:T,spatialReference:A,interceptor:d})}})}function Ai(){return E(()=>import("./arcadeUtils-OUqwHs4P.js").then(i=>i.aD),__vite__mapDeps([17,2,3,18,19]))}function on(i){return"createQuery"in i&&"queryFeatures"in i}async function an({graphic:i,view:e}){const{isAggregate:t,layer:s}=i;if(!t||!s||(e==null?void 0:e.type)!=="2d")return[];const n=await e.whenLayerView(s);if(!on(n))return[];const r=n.createQuery(),a=i.getObjectId();r.aggregateIds=a!=null?[a]:[];const{features:d}=await n.queryFeatures(r);return d}async function Ci({expressionInfo:i,arcadeUtils:e,interceptor:t,spatialReference:s,map:n,graphic:r,view:a}){if(!(i!=null&&i.expression))return null;const d=e.createSyntaxTree(i.expression),c=Js.filter(_=>e.hasVariable(d,_)),[h]=await Promise.all([an({graphic:r,view:a}),e.loadScriptDependencies(d,!0,c)]),p=e.getViewInfo({spatialReference:s}),m=e.createExecContext(r,p,a==null?void 0:a.timeZone);m.interceptor=t,m.useAsync=!0,rn({aggregatedFeatures:h,arcadeUtils:e,featureSetVars:c,context:m,viewInfo:p,map:n,graphic:r,interceptor:t});const g=e.createFunction(d,m);return e.executeAsyncFunction(g,m).catch(_=>en.error("arcade-execution-error",{error:_,graphic:r,expressionInfo:i}))}async function ln({expressionInfos:i,spatialReference:e,graphic:t,interceptor:s,map:n,view:r}){if(!(i!=null&&i.length))return{};const a=await Ai(),d={};for(const p of i)d[`expression/${p.name}`]=Ci({expressionInfo:p,arcadeUtils:a,interceptor:s,spatialReference:e,map:n,graphic:t,view:r});const c=await Ce(d),h={};for(const p in c)h[p]=tn(c[p].value);return h}const dn=1;let J=class extends ce{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{var n,r;const t=(n=this.contentElement)==null?void 0:n.type;(r=this.contentElementViewModel)==null||r.destroy();const s=t==="fields"?new Ze:t==="media"?new Me:t==="text"?new Xe:null;this._set("contentElementViewModel",s)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=Qe(this._compile,dn,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:s,interceptor:n,spatialReference:r,map:a,view:d,_abortController:c}=this;if(!(t&&s&&r&&a))return void this._set("contentElement",null);const h=await Ai();if(c!==this._abortController)return;const p=await Ci({arcadeUtils:h,expressionInfo:t,graphic:s,interceptor:n,map:a,spatialReference:r,view:d});if(!p||p.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await p.castAsJsonAsync(c==null?void 0:c.signal),g=m==null?void 0:m.type,_=g==="media"?Gi.fromJSON(m):g==="text"?pi.fromJSON(m):g==="fields"?Xi.fromJSON(m):null;this._set("contentElement",_)},this.addHandles([f(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),H),f(()=>[this.contentElement],()=>this._createVM(),H)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){var e;this._cancelQuery(),(e=this.contentElementViewModel)==null||e.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){var e;return((e=this.view)==null?void 0:e.spatialReference)??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:s}=this;return e?"loading":t||s?"ready":"disabled"}get map(){var e;return((e=this.view)==null?void 0:e.map)??null}set map(e){this._override("map",e)}};o([l()],J.prototype,"_abortController",void 0),o([l({type:Qi})],J.prototype,"expressionInfo",void 0),o([l({type:ke})],J.prototype,"graphic",void 0),o([l({readOnly:!0})],J.prototype,"contentElement",void 0),o([l({readOnly:!0})],J.prototype,"contentElementViewModel",void 0),o([l()],J.prototype,"interceptor",void 0),o([l()],J.prototype,"spatialReference",null),o([l({readOnly:!0})],J.prototype,"state",null),o([l()],J.prototype,"map",null),o([l()],J.prototype,"view",void 0),J=o([R("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],J);const $t=J,pt="esri-feature",mt={base:`${pt}-expression`,loadingSpinnerContainer:`${pt}__loading-container`,spinner:`${pt}__loading-spinner`};let je=class extends Z{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new $t}initialize(){this.addHandles(f(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentElementViewModel},()=>this._setupExpressionWidget(),H))}destroy(){this._destroyContentWidget()}render(){var t;const{state:e}=this.viewModel;return u("div",{class:mt.base},e==="loading"?this._renderLoading():e==="disabled"?null:(t=this._contentWidget)==null?void 0:t.render())}_renderLoading(){return u("div",{class:mt.loadingSpinnerContainer,key:"loading-container"},u("span",{class:this.classes(pe.loadingIndicator,I.rotating,mt.spinner)}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,s=t==null?void 0:t.type;this._destroyContentWidget();const n=e?s==="fields"?new Ii({viewModel:e}):s==="media"?new Fi({viewModel:e}):s==="text"?new He({viewModel:e}):null:null;this._contentWidget=n,this.scheduleRender()}};o([l({type:$t})],je.prototype,"viewModel",void 0),je=o([R("esri.widgets.Feature.FeatureExpression")],je);const cn=je;var Jt;(function(i){i.TOO_SHORT="length-validation-error::too-short"})(Jt||(Jt={}));const un=i=>{var t;const e=[];if(i.formTemplate){const{description:s,title:n}=i.formTemplate;(t=i.fields)==null||t.forEach(r=>{const a=n&&Nt(n,r.name),d=s&&Nt(s,r.name);(a||d)&&e.push(r.name)})}return e},gt=100;let $=class extends Yi(mi(ce)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await st(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await st(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await st(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=nt(this._queryController,gt),this._queryFeatureCountDebounced=nt(this._queryFeatureCountController,gt),this._queryPageDebounced=nt(this._queryPageController,gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:s}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,s.removeAll(),this.destroyed||s.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t==null?void 0:t.signal}))))},this.addHandles([f(()=>{var t;return[this.displayCount,this.graphic,this.layer,(t=this.layer)==null?void 0:t.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount]},()=>this._queryDebounced(),H),f(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),f(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:s}=this,n=1,r=Math.ceil(s/t)||1;this._set("featurePage",Math.min(Math.max(e,n),r))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&(t!=null&&t.loaded)?e.map(s=>{const n=s.clone();return n.field=wt(s.field,t),n}):e??[]}get supportsCacheHint(){var e,t,s;return!!((s=(t=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:t.queryRelated)!=null&&s.supportsCacheHint)}get canLoad(){return!!this.map&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"}get canQuery(){var t,s;const e=(s=(t=this.layer)==null?void 0:t.capabilities)==null?void 0:s.queryRelated;return!!(this.relatedLayer&&this.relationship&&typeof this.relationshipId=="number"&&typeof this.objectId=="number"&&(e!=null&&e.supportsCount)&&(e!=null&&e.supportsPagination))}get itemDescriptionFieldName(){var e;return((e=this.orderByFieldsFixedCasing[0])==null?void 0:e.field)||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){var e,t;return(this.objectIdField&&((t=(e=this.graphic)==null?void 0:e.attributes)==null?void 0:t[this.objectIdField]))??null}get objectIdField(){var e;return((e=this.layer)==null?void 0:e.objectIdField)||null}get relatedFeatures(){return this._get("relatedFeatures")||new De}get relatedLayer(){const{layer:e,map:t,relationship:s}=this;return e!=null&&e.loaded&&t&&s?ms(t,e,s)??null:null}get relationship(){var s;const{relationshipId:e,layer:t}=this;return typeof e=="number"?((s=t==null?void 0:t.relationships)==null?void 0:s.find(({id:n})=>n===e))??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new De}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:s,canQuery:n,_loaded:r,canLoad:a}=this;return t||a&&!r?"loading":e||s?"querying":n?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}_destroyRelatedFeatureViewModels(){var e;(e=this.relatedFeatureViewModels)==null||e.forEach(t=>!t.destroyed&&t.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:s,objectId:n,_queryFeatureCountAbortController:r,canQuery:a,supportsCacheHint:d}=this;if(await(e==null?void 0:e.load()),await(t==null?void 0:t.load()),!a||!e||!t)return void this._set("featureCount",0);const c=t.createQuery(),h=new vt({cacheHint:d,relationshipId:s,returnGeometry:!1,objectIds:[n],where:c.where??void 0}),p=await e.queryRelatedFeaturesCount(h,{signal:r==null?void 0:r.signal});this._set("featureCount",p[n]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:s}=this;return t?e:s?e.slice(0,s):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:s,_queryPageAbortController:n,featureCount:r}=this;!s||t<2||!r||e.addMany(await this._queryRelatedFeatures({signal:n==null?void 0:n.signal}))}async _queryRelatedFeatures(e){var ee;const{orderByFieldsFixedCasing:t,showAllEnabled:s,featuresPerPage:n,displayCount:r,layer:a,relationshipId:d,featurePage:c,featureCount:h,relatedLayer:p,supportsCacheHint:m}=this,{canQuery:g,objectId:_}=this;if(!g||!a||!p)return[];const v=s?((c-1)*n+h)%h:0,w=s?n:r,A=p.objectIdField,b=[...t.map(q=>q.field),...un(p),A].filter(Ke),T=t.map(q=>`${q.field} ${q.order}`),L=p.createQuery(),V=new vt({orderByFields:T,start:v,num:w,outFields:b,cacheHint:m,relationshipId:d,returnGeometry:!1,objectIds:[_],where:L.where??void 0}),se=await a.queryRelatedFeatures(V,{signal:e==null?void 0:e.signal}),K=((ee=se[_])==null?void 0:ee.features)||[];return K.forEach(q=>{q.sourceLayer=p,q.layer=p}),K}};o([l()],$.prototype,"_loaded",void 0),o([l()],$.prototype,"_queryAbortController",void 0),o([l()],$.prototype,"_queryPageAbortController",void 0),o([l()],$.prototype,"_queryFeatureCountAbortController",void 0),o([l({value:1})],$.prototype,"featurePage",null),o([l()],$.prototype,"featuresPerPage",void 0),o([l({readOnly:!0})],$.prototype,"orderByFieldsFixedCasing",null),o([l({readOnly:!0})],$.prototype,"supportsCacheHint",null),o([l({readOnly:!0})],$.prototype,"canLoad",null),o([l({readOnly:!0})],$.prototype,"canQuery",null),o([l()],$.prototype,"description",void 0),o([l({readOnly:!0})],$.prototype,"itemDescriptionFieldName",null),o([l({value:3})],$.prototype,"displayCount",null),o([l({type:ke})],$.prototype,"graphic",void 0),o([l()],$.prototype,"layer",void 0),o([l()],$.prototype,"map",void 0),o([l({readOnly:!0})],$.prototype,"objectId",null),o([l({readOnly:!0})],$.prototype,"objectIdField",null),o([l()],$.prototype,"orderByFields",void 0),o([l({readOnly:!0})],$.prototype,"relatedFeatures",null),o([l({readOnly:!0})],$.prototype,"relatedLayer",null),o([l({readOnly:!0})],$.prototype,"relationship",null),o([l()],$.prototype,"featureCount",void 0),o([l({readOnly:!0})],$.prototype,"relatedFeatureViewModels",null),o([l()],$.prototype,"relationshipId",void 0),o([l()],$.prototype,"showAllEnabled",void 0),o([l()],$.prototype,"state",null),o([l()],$.prototype,"title",void 0),o([l()],$.prototype,"getRelatedFeatureByObjectId",null),$=o([R("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],$);const xt=$,Ve="esri-feature",Le=`${Ve}-relationship`,ae={base:Le,listContainer:`${Le}__list`,listItem:`${Le}__list-item`,listItemHidden:`${Le}__list-item--hidden`,listContainerQuerying:`${Le}__list--querying`,featureObserver:`${Ve}__feature-observer`,stickySpinnerContainer:`${Ve}__sticky-loading-container`,loadingSpinnerContainer:`${Ve}__loading-container`,spinner:`${Ve}__loading-spinner`},Zt={title:!0,description:!0};let G=class extends Z{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([s])=>{s!=null&&s.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new xt,this.messages=null,this.messagesCommon=null,this.visibleElements={...Zt},this._increaseFeaturePage=()=>{const{state:s,showAllEnabled:n,relatedFeatures:r,featuresPerPage:a,featurePage:d}=this.viewModel;s==="ready"&&n&&r.length>=a*d&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new Je,this.addHandles([f(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),H),f(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Fe(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Re({icon:()=>E(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([0,1,2,3,4])),list:()=>E(()=>import("./calcite-list-LJfGqLbO.js"),__vite__mapDeps([20,2,3,21,4,22,23,24,25,26,27,1,28,29,30,31,32,33,34,35])),"list-item":()=>E(()=>import("./calcite-list-item-OtIyVNHT.js"),__vite__mapDeps([36,2,3,21,22,25,26,4,27,23,37,34,31,1,33])),notice:()=>E(()=>import("./calcite-notice-zH528nES.js"),__vite__mapDeps([38,2,3,39,4,23,25,26,27,40,31,1]))})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=Ki(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:s,state:n}=this.viewModel;return!e&&!!t&&n==="ready"&&(t>s||s===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return oe(e==null?void 0:e.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Zt,...e}}render(){var t;const{state:e}=this.viewModel;return u("div",{class:this.classes(ae.base,I.widget)},(t=this._featureElementInfo)==null?void 0:t.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ae.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("span",{class:this.classes(pe.loadingIndicator,I.rotating,ae.spinner)})}_renderLoading(){return u("div",{class:ae.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=Ae(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){var r;const{itemDescriptionFieldName:t}=this.viewModel,s=e.title;e.description=t&&((r=e.formattedAttributes)==null?void 0:r.global[t]);const n=e.state==="loading";return u("calcite-list-item",{class:this.classes(ae.listItem,{[ae.listItemHidden]:n}),description:e.description??"",key:e.uid,label:s,onCalciteListItemSelect:()=>this.emit("select-record",{featureViewModel:e})},this._renderChevronIconNode())}_renderShowAllListItem(){var e;return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:(e=this.messages)==null?void 0:e.showAll,onCalciteListItemSelect:()=>this.emit("show-all-records")},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){var e;return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},(e=this.messages)==null?void 0:e.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:ae.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(ae.listContainer,{[ae.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){var e;return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},(e=this.messages)==null?void 0:e.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e==null||e.forEach(s=>{this.addHandles(f(()=>[s.title,s.state],()=>this.scheduleRender(),H),t)}),this.scheduleRender()}_setupFeatureElementInfo(){var r;const{headingLevel:e,visibleElements:t}=this,s=t.description&&this.description,n=t.title&&this.title;(r=this._featureElementInfo)==null||r.set({description:s,title:n,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await gi(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};o([l()],G.prototype,"_relatedFeatureIntersectionObserverNode",void 0),o([l({readOnly:!0})],G.prototype,"displayShowAllButton",null),o([l({readOnly:!0})],G.prototype,"displayListItems",null),o([l()],G.prototype,"description",null),o([l({readOnly:!0})],G.prototype,"featureCountDescription",null),o([l()],G.prototype,"headingLevel",void 0),o([l()],G.prototype,"title",null),o([l({type:xt})],G.prototype,"viewModel",void 0),o([l(),Y("esri/widgets/Feature/t9n/Feature")],G.prototype,"messages",void 0),o([l(),Y("esri/t9n/common")],G.prototype,"messagesCommon",void 0),o([l()],G.prototype,"visibleElements",void 0),o([Te("visibleElements")],G.prototype,"castVisibleElements",null),G=o([R("esri.widgets.Feature.FeatureRelationship")],G);const ei=G;let hn=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=s=>{}),this.preRequestCallback||(this.preLayerQueryCallback=s=>{})}};var Ne;const pn=1,ti="content-view-models",ii="relationship-view-models",si={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let P=Ne=class extends mi(ce){constructor(i){super(i),this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=Qe(this._graphicChanged,pn,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...si},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=e=>{const{abilities:t}=this;return e.type==="attachments"&&!!t.attachmentsContent||e.type==="custom"&&!!t.customContent||e.type==="fields"&&!!t.fieldsContent||e.type==="media"&&!!t.mediaContent||e.type==="text"&&!!t.textContent||e.type==="expression"&&!!t.expressionContent||e.type==="relationship"&&!!t.relationshipContent},this.addHandles(f(()=>[this.graphic,this._effectivePopupTemplate,this.abilities],()=>this._graphicChangedThrottled(),H))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return gs(jt(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return _i(this.graphic)}castAbilities(i){return{...si,...i}}get isTable(){var i;return((i=this._sourceLayer)==null?void 0:i.isTable)||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(i){this._set("graphic",i?i.clone():null)}get spatialReference(){var i;return((i=this.view)==null?void 0:i.spatialReference)??null}set spatialReference(i){this._override("spatialReference",i)}get map(){var i;return((i=this.view)==null?void 0:i.map)||null}set map(i){this._override("map",i)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(i,e){const t=this.contentViewModels[i];t instanceof Me&&t.setActiveMedia(e)}nextMedia(i){const e=this.contentViewModels[i];e instanceof Me&&e.next()}previousMedia(i){const e=this.contentViewModels[i];e instanceof Me&&e.previous()}async updateGeometry(){var a;const{graphic:i,spatialReference:e,_sourceLayer:t}=this;await(t==null?void 0:t.load());const s=t==null?void 0:t.objectIdField;if(!s||!i||!t)return;const n=(a=i==null?void 0:i.attributes)==null?void 0:a[s];if(n==null)return;const r=[n];if(!i.geometry){const d=await fs({layer:t,graphic:i,outFields:[],objectIds:r,returnGeometry:!0,spatialReference:e}),c=d==null?void 0:d.geometry;c&&(i.geometry=c)}}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:i}=this;if(!i)return;const e=new AbortController;this._featureAbortController=e;try{await this._queryFeature({signal:e.signal})}catch(t){Ji(t)||(this._error=t,ie.getLogger(this).error("error","The popupTemplate could not be displayed for this feature.",{error:t,graphic:i,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===e&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:i}=this;i&&i.abort(),this._featureAbortController=null}_compileContentElement(i,e){return i.type==="attachments"?this._compileAttachments(i,e):i.type==="custom"?this._compileCustom(i,e):i.type==="fields"?this._compileFields(i,e):i.type==="media"?this._compileMedia(i,e):i.type==="text"?this._compileText(i,e):i.type==="expression"?this._compileExpression(i,e):i.type==="relationship"?this._compileRelationship(i,e):void 0}_compileContent(i){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(i)?i.filter(this._isAllowedContentType).map((e,t)=>this._compileContentElement(e,t)).filter(Ke):typeof i=="string"?this._compileText(new pi({text:i}),0).text:i}_destroyContentViewModels(){this.removeHandles(ii),this.removeHandles(ti),this.contentViewModels.forEach(i=>i&&!i.destroyed&&i.destroy()),this._set("contentViewModels",[])}_matchesFeature(i,e){var n;const t=(n=i==null?void 0:i.graphic)==null?void 0:n.getObjectId(),s=e==null?void 0:e.getObjectId();return t!=null&&s!=null&&t===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:i,relatedFeatures:e,map:t}){const{view:s,spatialReference:n}=this;e==null||e.filter(Boolean).forEach(r=>{i.find(a=>this._matchesFeature(a,r))||i.add(new Ne({abilities:{relationshipContent:!1},map:t,view:s,spatialReference:n,graphic:r}))}),i.forEach(r=>{(e==null?void 0:e.find(d=>this._matchesFeature(r,d)))||i.remove(r)})}_setExpressionContentVM(i,e){const t=this.formattedAttributes,{contentElement:s,contentElementViewModel:n}=i,r=s==null?void 0:s.type;n&&r&&(r==="fields"&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:t}),n.set(this._createFieldsVMParams(s,e))),r==="media"&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:e,formattedAttributes:t}),n.set(this._createMediaVMParams(s,e))),r==="text"&&n.set(this._createTextVMParams(s)))}_compileRelationship(i,e){const{displayCount:t,orderByFields:s,relationshipId:n,title:r,description:a}=i,{_sourceLayer:d,graphic:c,map:h}=this;if(!_s(d))return;const p=new xt({displayCount:t,graphic:c,orderByFields:s,relationshipId:n,layer:d,map:h,...this._compileTitleAndDesc({title:r,description:a})});return this.contentViewModels[e]=p,this.addHandles(Fe(()=>p.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(p)),ii),i}_compileExpression(i,e){const{expressionInfo:t}=i,{graphic:s,map:n,spatialReference:r,view:a}=this,d=new $t({expressionInfo:t,graphic:s,interceptor:Ne.interceptor,map:n,spatialReference:r,view:a});return this.contentViewModels[e]=d,this.addHandles(f(()=>d.contentElementViewModel,()=>this._setExpressionContentVM(d,e),H),ti),i}_compileAttachments(i,e){const{graphic:t}=this,{description:s,title:n}=i;return this.contentViewModels[e]=new Et({graphic:t,...this._compileTitleAndDesc({title:n,description:s})}),i}_compileCustom(i,e){const{graphic:t}=this,{creator:s,destroyer:n}=i;return this.contentViewModels[e]=new Xe({graphic:t,creator:s,destroyer:n}),i}_compileTitleAndDesc({title:i,description:e}){const{_fieldInfoMap:t,_sourceLayer:s,graphic:n,formattedAttributes:r}=this,a=n==null?void 0:n.attributes,d=this._expressionAttributes,c=r.global;return{title:be({attributes:a,fieldInfoMap:t,globalAttributes:c,expressionAttributes:d,layer:s,text:i}),description:be({attributes:a,fieldInfoMap:t,globalAttributes:c,expressionAttributes:d,layer:s,text:e})}}_createFieldsVMParams(i,e){const t=this._effectivePopupTemplate,s=this.formattedAttributes,n={...s==null?void 0:s.global,...s==null?void 0:s.content[e]},r=(i==null?void 0:i.fieldInfos)||(t==null?void 0:t.fieldInfos),a=r==null?void 0:r.filter(({fieldName:p})=>wi(p)||we(p)||n.hasOwnProperty(p)),d=t==null?void 0:t.expressionInfos,{description:c,title:h}=i;return{attributes:n,expressionInfos:d,fieldInfos:a,...this._compileTitleAndDesc({title:h,description:c})}}_compileFields(i,e){const t=i.clone(),s=new Ze(this._createFieldsVMParams(i,e));return this.contentViewModels[e]=s,t.fieldInfos=s.formattedFieldInfos.slice(0),t}_createMediaVMParams(i,e){const{abilities:t,graphic:s,_fieldInfoMap:n,_effectivePopupTemplate:r,relatedInfos:a,_sourceLayer:d,_expressionAttributes:c}=this,h=this.formattedAttributes,p=(s==null?void 0:s.attributes)??{},{description:m,mediaInfos:g,title:_}=i;return{abilities:{chartAnimation:t.chartAnimation},activeMediaInfoIndex:i.activeMediaInfoIndex||0,attributes:p,isAggregate:s==null?void 0:s.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...h==null?void 0:h.global,...h==null?void 0:h.content[e]},expressionAttributes:c,mediaInfos:g,popupTemplate:r,relatedInfos:a,...this._compileTitleAndDesc({title:_,description:m})}}_compileMedia(i,e){const t=i.clone(),s=new Me(this._createMediaVMParams(i,e));return t.mediaInfos=s.formattedMediaInfos.slice(0),this.contentViewModels[e]=s,t}_createTextVMParams(i){var r;const{graphic:e,_fieldInfoMap:t,_sourceLayer:s,_expressionAttributes:n}=this;if(i&&i.text){const a=(e==null?void 0:e.attributes)??{},d=((r=this.formattedAttributes)==null?void 0:r.global)??{};i.text=be({attributes:a,fieldInfoMap:t,globalAttributes:d,expressionAttributes:n,layer:s,text:i.text})}return{graphic:e,creator:i.text}}_compileText(i,e){const t=i.clone();return this.contentViewModels[e]=new Xe(this._createTextVMParams(t)),t}_compileLastEditInfo(){const{_effectivePopupTemplate:i,_sourceLayer:e,graphic:t,view:s}=this;if(!i)return;const{lastEditInfoEnabled:n}=i,r=e==null?void 0:e.editFieldsInfo;return n&&r?vs(r,t==null?void 0:t.attributes,(s==null?void 0:s.timeZone)??Be,e):void 0}_compileTitle(i){var d;const{_fieldInfoMap:e,_sourceLayer:t,graphic:s,_expressionAttributes:n}=this,r=(s==null?void 0:s.attributes)??{},a=((d=this.formattedAttributes)==null?void 0:d.global)??{};return be({attributes:r,fieldInfoMap:e,globalAttributes:a,expressionAttributes:n,layer:t,text:i})}async _getTitle(){const{_effectivePopupTemplate:i,graphic:e}=this;if(!e)return null;const t=i==null?void 0:i.title;return Ge(t,{graphic:e})}async _getContent(){const{_effectivePopupTemplate:i,graphic:e}=this;if(!e)return null;const t=i==null?void 0:i.content;return Ge(t,{graphic:e})}async _queryFeature(i){const{_featureAbortController:e,_sourceLayer:t,graphic:s,_effectivePopupTemplate:n}=this,r=this.map,a=this.view,d=this.spatialReference;if(e!==this._featureAbortController||!s)return;await ys({graphic:s,popupTemplate:n,layer:t,spatialReference:d},i);const{content:{value:c},title:{value:h}}=await Ce({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:p}}=await Ce({checkForRelatedFeatures:this._checkForRelatedFeatures(i),expressionAttributes:ln({expressionInfos:n==null?void 0:n.expressionInfos,spatialReference:d,graphic:s,map:r,interceptor:Ne.interceptor,view:a})});e===this._featureAbortController&&s&&(this._expressionAttributes=p,this._graphicExpressionAttributes={...s.attributes,...p},this._set("formattedAttributes",this._createFormattedAttributes(c)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(c)||null))}_createMediaFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}){var h;const{_effectivePopupTemplate:s,graphic:n,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:d,_graphicExpressionAttributes:c}=this;t.content[e]=rt({fieldInfos:s==null?void 0:s.fieldInfos,graphic:n,attributes:{...c,...i.attributes},layer:a,fieldInfoMap:d,relatedInfos:r,timeZone:((h=this.view)==null?void 0:h.timeZone)??Be})}_createFieldsFormattedAttributes({contentElement:i,contentElementIndex:e,formattedAttributes:t}){var s;if(i.fieldInfos){const{graphic:n,relatedInfos:r,_sourceLayer:a,_fieldInfoMap:d,_graphicExpressionAttributes:c}=this;t.content[e]=rt({fieldInfos:i.fieldInfos,graphic:n,attributes:{...c,...i.attributes},layer:a,fieldInfoMap:d,relatedInfos:r,timeZone:((s=this.view)==null?void 0:s.timeZone)??Be})}}_createFormattedAttributes(i){var h;const{_effectivePopupTemplate:e,graphic:t,relatedInfos:s,_sourceLayer:n,_fieldInfoMap:r,_graphicExpressionAttributes:a}=this,d=e==null?void 0:e.fieldInfos,c={global:rt({fieldInfos:d,graphic:t,attributes:a,layer:n,fieldInfoMap:r,relatedInfos:s,timeZone:((h=this.view)==null?void 0:h.timeZone)??Be}),content:[]};return Array.isArray(i)&&i.forEach((p,m)=>{p.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:p,contentElementIndex:m,formattedAttributes:c}),p.type==="media"&&this._createMediaFormattedAttributes({contentElement:p,contentElementIndex:m,formattedAttributes:c})}),c}_checkForRelatedFeatures(i){const{graphic:e,_effectivePopupTemplate:t}=this;return this._queryRelatedInfos(e,jt(t),i)}async _queryRelatedInfos(i,e,t){const{relatedInfos:s,_sourceLayer:n}=this;s.clear();const r=(n==null?void 0:n.associatedLayer)!=null?await(n==null?void 0:n.associatedLayer.load(t)):n;if(!r||!i)return;const a=e.filter(h=>h&&we(h.fieldName));if(!(a!=null&&a.length))return;e.forEach(h=>this._configureRelatedInfo(h,r));const d=await zs({relatedInfos:s,layer:r},t);Object.keys(d).forEach(h=>{var g;const p=s.get(h.toString()),m=(g=d[h])==null?void 0:g.value;p&&m&&(p.layerInfo=m.data)});const c=await js({graphic:i,relatedInfos:s,layer:r},t);Object.keys(c).forEach(h=>{var p;Ns((p=c[h])==null?void 0:p.value,s.get(h.toString()))})}_configureRelatedInfo(i,e){const{relatedInfos:t}=this,s=ze(i.fieldName);if(!s)return;const{layerId:n,fieldName:r}=s;if(!n)return;const a=t.get(n.toString())||Vs(n,e);a&&(Us({relatedInfo:a,fieldName:r,fieldInfo:i}),this.relatedInfos.set(n,a))}};P.interceptor=new hn(ws,bs),o([l()],P.prototype,"_error",void 0),o([l()],P.prototype,"_featureAbortController",void 0),o([l({readOnly:!0})],P.prototype,"_effectivePopupTemplate",null),o([l({readOnly:!0})],P.prototype,"_fieldInfoMap",null),o([l({readOnly:!0})],P.prototype,"_sourceLayer",null),o([l()],P.prototype,"abilities",void 0),o([Te("abilities")],P.prototype,"castAbilities",null),o([l({readOnly:!0})],P.prototype,"content",void 0),o([l({readOnly:!0})],P.prototype,"contentViewModels",void 0),o([l()],P.prototype,"description",void 0),o([l({type:Boolean})],P.prototype,"defaultPopupTemplateEnabled",void 0),o([l({readOnly:!0})],P.prototype,"isTable",null),o([l({readOnly:!0})],P.prototype,"state",null),o([l({readOnly:!0})],P.prototype,"formattedAttributes",void 0),o([l({type:ke,value:null})],P.prototype,"graphic",null),o([l({readOnly:!0})],P.prototype,"lastEditInfo",void 0),o([l({readOnly:!0})],P.prototype,"relatedInfos",void 0),o([l()],P.prototype,"spatialReference",null),o([l({readOnly:!0})],P.prototype,"title",void 0),o([l()],P.prototype,"map",null),o([l({readOnly:!0})],P.prototype,"waitingForContent",null),o([l()],P.prototype,"view",void 0),P=Ne=o([R("esri.widgets.FeatureViewModel")],P);const Tt=P,Ei=i=>{let e=class extends i{constructor(){super(...arguments),this.renderNodeContent=t=>di(t)&&!t.destroyed?u("div",{class:O.contentNode,key:t},t.render()):t instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:t,class:O.contentNode,key:t}):Zi(t)?u("div",{afterCreate:this._attachToNode,bind:t.domNode,class:O.contentNode,key:t}):null}_attachToNode(t){const s=this;t.appendChild(s)}};return e=o([R("esri.widgets.Feature.ContentMixin")],e),e};var bt;const ni={title:!0,content:!0,lastEditedInfo:!0},ri="relationship-handles";let B=bt=class extends Ei(Z){constructor(i,e){super(i,e),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.visibleElements={...ni},this.viewModel=new Tt}initialize(){this.addHandles(f(()=>{var i;return(i=this.viewModel)==null?void 0:i.contentViewModels},()=>this._setupContentWidgets(),H))}loadDependencies(){return Re({notice:()=>E(()=>import("./calcite-notice-zH528nES.js"),__vite__mapDeps([38,2,3,39,4,23,25,26,27,40,31,1]))})}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(i){this.viewModel.graphic=i}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(i){this.viewModel.defaultPopupTemplateEnabled=i}get isTable(){return this.viewModel.isTable}get label(){var i;return((i=this.messages)==null?void 0:i.widgetLabel)??""}set label(i){this._overrideIfSome("label",i)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(i){this.viewModel.spatialReference=i}get title(){return this.viewModel.title}castVisibleElements(i){return{...ni,...i}}get map(){return this.viewModel.map}set map(i){this.viewModel.map=i}get view(){return this.viewModel.view}set view(i){this.viewModel.view=i}setActiveMedia(i,e){return this.viewModel.setActiveMedia(i,e)}nextMedia(i){return this.viewModel.nextMedia(i)}previousMedia(i){return this.viewModel.previousMedia(i)}render(){const{state:i}=this.viewModel,e=u("div",{class:O.container,key:"container"},this._renderTitle(),i==="error"?this._renderError():i==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(O.base,I.widget)},e)}_renderError(){const{messagesCommon:i,messages:e,visibleElements:t}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},t.title?u("div",{key:"error-title",slot:"title"},i.errorMessage):null,u("div",{key:"error-message",slot:"message"},e.loadingError))}_renderLoading(){return u("div",{class:O.loadingSpinnerContainer,key:"loading-container"},u("span",{class:this.classes(pe.loadingIndicator,I.rotating,O.spinner)}))}_renderContentContainer(){const{visibleElements:i}=this;return i.content?u("div",{class:O.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:i,title:e}=this;return i.title?u(It,{class:O.title,innerHTML:e,level:this.headingLevel}):null}_renderContent(){const i=this.viewModel.content,e="content";if(!i)return null;if(Array.isArray(i))return i.length?u("div",{class:O.contentNode,key:`${e}-content-elements`},i.map(this._renderContentElement,this)):null;if(typeof i=="string"){const t=this._contentWidgets[0];return!t||t.destroyed?null:u("div",{class:this.classes(O.contentNode,O.contentNodeText),key:`${e}-content`},t.render())}return this.renderNodeContent(i)}_renderContentElement(i,e){var s;const{visibleElements:t}=this;if(typeof t.content!="boolean"&&!((s=t.content)!=null&&s[i.type]))return null;switch(i.type){case"attachments":return this._renderAttachments(e);case"custom":return this._renderCustom(i,e);case"fields":return this._renderFields(e);case"media":return this._renderMedia(e);case"text":return this._renderText(i,e);case"expression":return this._renderExpression(e);case"relationship":return this._renderRelationship(e);default:return null}}_renderAttachments(i){const e=this._contentWidgets[i];if(!e||e.destroyed)return null;const{state:t,attachmentInfos:s}=e.viewModel;return t==="loading"||s.length>0?u("div",{class:this.classes(O.contentElement),key:this._buildKey("attachments-element",i)},e.render()):null}_renderRelationship(i){const e=this._contentWidgets[i];return e&&!e.destroyed&&this.flowItems?u("div",{class:O.contentElement,key:this._buildKey("relationship-element",i)},e.render()):null}_renderExpression(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:u("div",{class:O.contentElement,key:this._buildKey("expression-element",i)},e.render())}_renderCustom(i,e){const{creator:t}=i,s=this._contentWidgets[e];return!s||s.destroyed?null:t?u("div",{class:O.contentElement,key:this._buildKey("custom-element",e)},s.render()):null}_renderFields(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:u("div",{class:O.contentElement,key:this._buildKey("fields-element",i)},e.render())}_renderMedia(i){const e=this._contentWidgets[i];return!e||e.destroyed?null:u("div",{class:O.contentElement,key:this._buildKey("media-element",i)},e.render())}_renderLastEditInfo(){const{visibleElements:i,messages:e}=this,{lastEditInfo:t}=this.viewModel;if(!t||!i.lastEditedInfo)return null;const{date:s,user:n}=t,r=t.type==="edit"?n?e.lastEditedByUser:e.lastEdited:n?e.lastCreatedByUser:e.lastCreated,a=oe(r,{date:s,user:n});return u("div",{class:this.classes(O.lastEditedInfo,O.contentElement),key:"edit-info-element"},a)}_renderText(i,e){const t=i.text,s=this._contentWidgets[e];return!s||s.destroyed?null:t?u("div",{class:this.classes(O.contentElement,O.text),key:this._buildKey("text-element",e)},s.render()):null}_buildKey(i,...e){var t,s;return`${i}__${((s=(t=this.viewModel)==null?void 0:t.graphic)==null?void 0:s.uid)||"0"}-${e.join("-")}`}_destroyContentWidget(i){i&&(i.viewModel=null,!i.destroyed&&i.destroy())}_destroyContentWidgets(){this.removeHandles(ri),this._contentWidgets.forEach(i=>this._destroyContentWidget(i)),this._contentWidgets=[]}_addFeatureRelationshipHandles(i){const{flowItems:e,visibleElements:t}=this;this.addHandles([Fe(()=>i,"select-record",({featureViewModel:s})=>{e&&(s.abilities={relationshipContent:!0},e.push(new bt({flowItems:e,viewModel:s,visibleElements:t})))}),Fe(()=>i,"show-all-records",()=>{if(!e)return;const{viewModel:s}=i;s.showAllEnabled=!0;const n=new ei({visibleElements:{title:!1,description:!1},viewModel:s});this._addFeatureRelationshipHandles(n),e.push(n)})],ri)}_setupContentWidgets(){var n;this._destroyContentWidgets();const{headingLevel:i,visibleElements:e}=this,t=(n=this.viewModel)==null?void 0:n.content,{contentViewModels:s}=this.viewModel;if(Array.isArray(t))t.forEach((r,a)=>{if(r.type==="attachments"&&(this._contentWidgets[a]=new Es({displayType:r.displayType,headingLevel:e.title?i+1:i,viewModel:s[a]})),r.type==="fields"&&(this._contentWidgets[a]=new Ii({viewModel:s[a]})),r.type==="media"&&(this._contentWidgets[a]=new Fi({viewModel:s[a]})),r.type==="text"&&(this._contentWidgets[a]=new He({viewModel:s[a]})),r.type==="custom"&&(this._contentWidgets[a]=new He({viewModel:s[a]})),r.type==="expression"&&(this._contentWidgets[a]=new cn({viewModel:s[a]})),r.type==="relationship"){const d=new ei({viewModel:s[a]});this._addFeatureRelationshipHandles(d),this._contentWidgets[a]=d}},this);else{const r=s[0];r&&!r.destroyed&&(this._contentWidgets[0]=new He({viewModel:r}))}this.scheduleRender()}};o([l()],B.prototype,"graphic",null),o([l()],B.prototype,"defaultPopupTemplateEnabled",null),o([l()],B.prototype,"flowItems",void 0),o([l()],B.prototype,"headingLevel",void 0),o([l({readOnly:!0})],B.prototype,"isTable",null),o([l()],B.prototype,"label",null),o([l(),Y("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),o([l(),Y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),o([l(),Y("esri/widgets/support/t9n/uriUtils")],B.prototype,"messagesURIUtils",void 0),o([l()],B.prototype,"spatialReference",null),o([l({readOnly:!0})],B.prototype,"title",null),o([l()],B.prototype,"visibleElements",void 0),o([Te("visibleElements")],B.prototype,"castVisibleElements",null),o([l()],B.prototype,"map",null),o([l()],B.prototype,"view",null),o([l({type:Tt})],B.prototype,"viewModel",void 0),B=bt=o([R("esri.widgets.Feature")],B);const mn=B,gn="esri.widgets.CompassViewModel";let Ue=class extends bi{constructor(e){super(e),this.visible=!1}};o([l()],Ue.prototype,"visible",void 0),Ue=o([R(gn)],Ue);const $i=Ue,ft="esri-spinner",_t={base:ft,spinnerStart:`${ft}--start`,spinnerFinish:`${ft}--finish`};let fe=class extends Z{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new $i}initialize(){this.addHandles(f(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:s}=e??{};t&&(this.viewModel.location=t),this.visible=!0;const n=()=>this.hide();s&&s.catch(()=>{}).then(n)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,s=!!t,n=e&&s,r=!e&&s,a={[_t.spinnerStart]:n,[_t.spinnerFinish]:r},d=this._getPositionStyles();return u("div",{class:this.classes(_t.base,a),styles:d})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=gi(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(t==null||e==null)return{};const{padding:s}=t;return{left:e.x-s.left+"px",top:e.y-s.top+"px"}}};o([l()],fe.prototype,"location",null),o([l()],fe.prototype,"view",null),o([l({type:$i})],fe.prototype,"viewModel",void 0),o([l()],fe.prototype,"visible",null),fe=o([R("esri.widgets.Spinner")],fe);const fn=fe,z="esri-features",W={icon:`${z}__icon`,actionImage:`${z}__action-image`,base:z,container:`${z}__container`,contentContainer:`${z}__content-container`,contentFeature:`${z}__content-feature`,flowItemCollapsed:`${z}__flow-item--collapsed`,header:`${z}__header`,footer:`${z}__footer`,featureMenuObserver:`${z}__feature-menu-observer`,actionExit:`${z}__action--exit`,loader:`${z}__loader`,featuresHeading:`${z}__heading`,paginationActionBar:`${z}__pagination-action-bar`,paginationPrevious:`${z}__pagination-previous`,paginationNext:`${z}__pagination-next`};let _e=class extends Z{constructor(i,e){super(i,e),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenRelatedFeature=t=>{this.emit("open-related-feature",{feature:t})}}loadDependencies(){return Re({action:()=>E(()=>import("./calcite-action-mEzyoc-Z.js"),__vite__mapDeps([41,37,2,3,34,21,23,25,26,4,31,27,1,33])),"flow-item":()=>E(()=>import("./calcite-flow-item-mBjWFd-U.js"),__vite__mapDeps([42,2,3,21,23,25,26,4,27,43,34,37,31,1,33,44,45,24,40,46,35]))})}render(){const{flowItems:i}=this,e=i==null?void 0:i.toArray();return u(es,null,e==null?void 0:e.map(t=>this._renderRelatedRecordsFlowItem(t)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleRelatedRecordsBackClick(){var e;const i=(e=this.flowItems)==null?void 0:e.pop();i&&("showAllEnabled"in i.viewModel&&(i.viewModel.showAllEnabled=!1),i&&(i.viewModel=null,i.destroy()))}_renderRelatedRecordsFlowItem(i){const{messages:e,closable:t,closed:s}=this,n="graphic"in i&&!i.isTable;return u("calcite-flow-item",{bind:this,closable:t,closed:s,description:this._getRelatedRecordsFlowItemDescription(i),heading:i.title??"",key:`flow-item-${i.viewModel.uid}`,onCalciteFlowItemBack:this._handleRelatedRecordsBackClick,onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:W.actionExit,icon:"move-up",key:"exit-related-records-action",label:e.exitRelatedRecords,onclick:this._handleExitClick,scale:"m",slot:"header-actions-start",text:e.exitRelatedRecords,title:e.exitRelatedRecords}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-related-feature-action",label:e.selectFeature,onclick:()=>this._handleOpenRelatedFeature(i),scale:"m",slot:"header-actions-end",text:e.selectFeature,title:e.selectFeature}):null,u("div",{class:W.container},i.render()))}_getRelatedRecordsFlowItemDescription(i){return"featureCountDescription"in i?i.featureCountDescription:i.viewModel.description??""}};o([l()],_e.prototype,"flowItems",void 0),o([l(),Y("esri/widgets/Features/t9n/Features")],_e.prototype,"messages",void 0),o([l()],_e.prototype,"closed",void 0),o([l()],_e.prototype,"closable",void 0),_e=o([R("esri.widgets.Features.FeaturesRelatedRecords")],_e);const _n=_e,vn="esri.widgets.Popup.PopupViewModel",Ye=ie.getLogger(vn),yn=i=>{const{event:e,view:t,viewModel:s}=i,{action:n}=e;if(!n)return Promise.reject(new k("trigger-action:missing-arguments","Event has no action"));const{disabled:r,id:a}=n;if(!a)return Promise.reject(new k("trigger-action:invalid-action","action.id is missing"));if(r)return Promise.reject(new k("trigger-action:invalid-action","Action is disabled"));if(a===ye.id)return bn(s).catch(ts);if(a===xe.id)return Mn(s);if(a===me.id)return s.browseClusterEnabled=!s.browseClusterEnabled,s.featureMenuOpen=s.browseClusterEnabled,Promise.resolve();if(a===St.id){s.visible=!1;const{selectedFeature:d}=s;if(!d)return Promise.reject(new k(`trigger-action:${St.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):t==null||t.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function xi(i){const{selectedFeature:e,location:t,view:s}=i;return s?e??t??null:null}function ve(i){var e,t;return!!i&&i.isAggregate&&((t=(e=i.sourceLayer)==null?void 0:e.featureReduction)==null?void 0:t.type)==="cluster"}async function wn(i,e){if((e==null?void 0:e.type)!=="3d"||!i||i.declaredClass!=="esri.Graphic")return!0;const t=e.getViewForGraphic(i);if(t&&"whenGraphicBounds"in t){let s=null;try{s=await t.whenGraphicBounds(i,{useViewElevation:!0})}catch{}return!s||!s.boundingBox||s.boundingBox[0]===s.boundingBox[3]&&s.boundingBox[1]===s.boundingBox[4]&&s.boundingBox[2]===s.boundingBox[5]}return!0}async function bn(i){var p;const{location:e,selectedFeature:t,view:s,zoomFactor:n}=i,r=xi(i);if(!s||!r){const m=new k("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:r,view:s});throw Ye.error(m),m}const a=s.scale/n,d=(p=i.selectedFeature)==null?void 0:p.geometry,c=d??e,h=c!=null&&c.type==="point"&&await wn(t,s);ye.active=!0,ye.disabled=!0;try{await i.zoomTo({target:{target:r,scale:h?a:void 0}})}catch{const g=new k("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:t});Ye.error(g)}finally{ye.active=!1,ye.disabled=!1,i.zoomToLocation=null,h&&(i.location=c)}}async function Mn(i){const{selectedFeature:e,view:t}=i;if((t==null?void 0:t.type)!=="2d"){const a=new k("zoomToCluster:invalid-view","View must be 2d MapView.",{view:t});throw Ye.error(a),a}if(!e||!ve(e)){const a=new k("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:e});throw Ye.error(a),a}const[s,n]=await kt(t,e);xe.active=!0,xe.disabled=!0;const{extent:r}=await s.queryExtent(n);await i.zoomTo({target:r}),xe.active=!1,xe.disabled=!1}async function In(i){const{view:e,selectedFeature:t}=i;if(!e||!t)return;const[s,n]=await kt(e,t),{extent:r}=await s.queryExtent(n);i.selectedClusterBoundaryFeature.geometry=r,e.graphics.add(i.selectedClusterBoundaryFeature)}async function Fn(i){const{selectedFeature:e,view:t}=i;if(!t||!e)return;const[s,n]=await kt(t,e);me.active=!0,me.disabled=!0;const{features:r}=await s.queryFeatures(n);me.active=!1,me.disabled=!1,me.value=!0,i==null||i.open({features:[e].concat(r),featureMenuOpen:!0})}async function kt(i,e){const t=await i.whenLayerView(e.sourceLayer),s=t.createQuery(),n=e.getObjectId();return s.aggregateIds=n!=null?[n]:[],[t,s]}function An(i){me.value=!1;const e=i.features.filter(t=>ve(t));e.length&&(i.features=e)}function Ti(i){var e;if(i==null)return null;switch(i.type){case"point":return i;case"extent":return i.center;case"polygon":return i.centroid;case"multipoint":case"polyline":return(e=i.extent)==null?void 0:e.center;default:return null}}const Cn=()=>[ye.clone()],En=()=>[xe.clone(),me.clone()];let M=class extends is(bi){constructor(e){super(e),this._pendingPromises=new Is,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new Ie,this.activeFeature=null,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new ke({symbol:new ss({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),f(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),f(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),f(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.animation)==null?void 0:t.state},e=>this._animationStateChange(e)),f(()=>this.location,e=>this._locationChange(e)),f(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),f(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),f(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),f(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>yn({event:e,viewModel:this,view:this.view})),yt(()=>!this.waitingForResult,()=>this._waitingForResultChange(),ns),f(()=>{var e,t;return[this.features,(e=this.view)==null?void 0:e.map,(t=this.view)==null?void 0:t.spatialReference]},()=>this._updateFeatureVMs()),f(()=>{var e;return(e=this.view)==null?void 0:e.scale},()=>this._viewScaleChange()),yt(()=>!this.visible,()=>this.browseClusterEnabled=!1),f(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new Ie;e.removeAll();const{actions:t,defaultActions:s,defaultPopupTemplateEnabled:n,includeDefaultActions:r,selectedFeature:a}=this,d=r?s.concat(t):t,c=a&&(typeof a.getEffectivePopupTemplate=="function"&&a.getEffectivePopupTemplate(n)||a.popupTemplate),h=c==null?void 0:c.actions,p=c!=null&&c.overwriteActions?h:(h==null?void 0:h.concat(d))??d;return p==null||p.filter(Boolean).forEach(m=>e.add(m)),e}get defaultActions(){const e=this._get("defaultActions")||new Ie;return e.removeAll(),e.addMany(ve(this.selectedFeature)?En():Cn()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:s,promiseCount:n,selectedFeatureIndex:r}=this,a=n&&t.length;a&&s&&r===-1?this.selectedFeatureIndex=0:a&&r!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){var r,a,d;let t=e;const s=(a=(r=this.view)==null?void 0:r.spatialReference)==null?void 0:a.isWebMercator;((d=e==null?void 0:e.spatialReference)==null?void 0:d.isWGS84)&&s&&(t=rs(e)),this._set("location",t)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice(0)).forEach(t=>{this._pendingPromises.add(t);const s=r=>{this._pendingPromises.has(t)&&this._updateFeatures(r),this._updatePendingPromises(t)},n=()=>this._updatePendingPromises(t);t.then(s,n)})):this._set("promises",[])}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){var e;return(e=this.view)!=null&&e.ready?"ready":"disabled"}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=xi(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new k("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:s}=this;if(!s||!e)throw new k("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:s});return s.fetchPopupFeatures(e,{event:t==null?void 0:t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t==null?void 0:t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:s}=t;delete t.fetchFeatures,s&&this._setFetchFeaturesPromises(t.location);const n=["actionsMenuOpen","collapsed"];for(const r of n)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){An(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;(e==null?void 0:e.type)==="2d"?ve(t)?(await In(this),await Fn(this)):ie.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):ie.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this.autoOpenEnabled&&this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(ye.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){var t,s;const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Ke);(s=(t=this.view)==null?void 0:t.graphics)==null||s.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(ve(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:s}=this;s&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:s,featuresPerPage:n,featureViewModels:r}=this;if(s===null)return;const a=((s-1)*n+t)%t,d=a+n;r.slice(a,d).forEach((c,h)=>{c&&(c.graphic??(c.graphic=e[a+h]))})}async _selectedFeatureChange(e){var r;const{location:t,updateLocationEnabled:s,view:n}=this;if(e&&n){if(this.browseClusterEnabled)return this._selectedClusterFeature&&(n.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),ve(e)?void 0:(e.symbol=await os(e),this._selectedClusterFeature=e,void n.graphics.add(this._selectedClusterFeature));if(!s&&t||!e.geometry){if(s&&!e.geometry){await this.centerAtLocation();const a=(r=n.center)==null?void 0:r.clone();a&&(this.location=a)}}else this.location=Ti(e.geometry)}}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{clientOnlyGraphics:t,promisesPerLayerView:s}=await this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)),n=Promise.resolve(t),r=s.map(a=>a.promise);this.promises=[n,...r]}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:s,view:n}=this;if(ve(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!(t!=null&&t.length))return;const r=s.slice(0),a=[];t.forEach((d,c)=>{if(!d)return;let h=null;if(r.some((p,m)=>(p&&p.graphic===d&&(h=p,r.splice(m,1)),!!h)),h)a[c]=h;else{const p=new Tt({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n==null?void 0:n.spatialReference,graphic:d===e?d:null,map:n==null?void 0:n.map,view:n});a[c]=p}}),r.forEach(d=>d&&!d.destroyed&&d.destroy()),this._set("featureViewModels",a)}_getScreenPoint(e){const{view:t}=this;return t&&e&&typeof t.toScreen=="function"?t.toScreen(e):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const s=new AbortController,{signal:n}=s;this._fetchFeaturesController=s;const r=this.fetchFeatures(e,{signal:n,event:t});return r.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),r}async _fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:s}=e,{view:n}=this,{clientOnlyGraphics:r,promisesPerLayerView:a,location:d}=await this._fetchFeaturesWithController(t,e),c=[Promise.resolve(r),...a.map(h=>h.promise)];n!=null&&n.popup&&"open"in n.popup&&n.popup.open({location:d||s,promises:c})}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&this._pendingPromises.delete(e)}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:s}=e;return s&&"layer"in s&&s.layer?s.layer:(s==null?void 0:s.type)==="map-notes"||(s==null?void 0:s.type)==="subtype-group"?s:t}_getHighlightTarget(e,t){const s=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||as:null,n=e.attributes;return n&&s&&n[s]||e}_mapIncludesLayer(e){var t,s,n;return!!((n=(s=(t=this.view)==null?void 0:t.map)==null?void 0:s.allLayers)!=null&&n.includes(e))}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:s,activeFeature:n,visible:r}=this;if(!(n&&s&&t&&r))return;const a=this._getHighlightLayer(n);if(!(a&&a instanceof Dt&&this._mapIncludesLayer(a)))return;const d=this._getLayerView(s,a);this._highlightActiveFeaturePromise=d;const c=await d;if(!(c&&Bt(c)&&this._highlightActiveFeaturePromise===d&&this.activeFeature&&this.highlightEnabled))return;const h=c.highlight(this._getHighlightTarget(n,a));this.addHandles(h,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:s,view:n,visible:r}=this;if(!(t&&n&&s&&r))return;const a=this._getHighlightLayer(t);if(!(a&&a instanceof Dt&&this._mapIncludesLayer(a)))return;const d=this._getLayerView(n,a);this._highlightSelectedFeaturePromise=d;const c=await d;if(!(c&&Bt(c)&&this._highlightSelectedFeaturePromise===d&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const h=c.highlight(this._getHighlightTarget(t,a));this.addHandles(h,e)}_updateFeatures(e){const{features:t}=this;if(!(e!=null&&e.length))return;if(!t.length)return void(this.features=e);const s=e.filter(n=>!t.includes(n));this.features=t.concat(s)}};o([l()],M.prototype,"_fetchFeaturesController",void 0),o([l({type:Ie})],M.prototype,"actions",void 0),o([l({readOnly:!0})],M.prototype,"active",null),o([l()],M.prototype,"activeFeature",void 0),o([l({readOnly:!0})],M.prototype,"allActions",null),o([l()],M.prototype,"autoCloseEnabled",void 0),o([l()],M.prototype,"autoOpenEnabled",void 0),o([l()],M.prototype,"browseClusterEnabled",void 0),o([l()],M.prototype,"content",void 0),o([l({type:Ie,readOnly:!0})],M.prototype,"defaultActions",null),o([l({type:Boolean})],M.prototype,"defaultPopupTemplateEnabled",void 0),o([l({readOnly:!0})],M.prototype,"featureCount",null),o([l()],M.prototype,"featurePage",void 0),o([l({value:[]})],M.prototype,"features",null),o([l()],M.prototype,"featuresPerPage",void 0),o([l()],M.prototype,"featureMenuOpen",void 0),o([l()],M.prototype,"featureViewModelAbilities",void 0),o([l({readOnly:!0})],M.prototype,"featureViewModels",void 0),o([l()],M.prototype,"highlightEnabled",void 0),o([l()],M.prototype,"includeDefaultActions",void 0),o([l({type:ls})],M.prototype,"location",null),o([l({readOnly:!0})],M.prototype,"pendingPromisesCount",null),o([l({readOnly:!0})],M.prototype,"promiseCount",null),o([l()],M.prototype,"promises",null),o([l({readOnly:!0})],M.prototype,"selectedClusterBoundaryFeature",void 0),o([l({value:null,readOnly:!0})],M.prototype,"selectedFeature",null),o([l({value:-1})],M.prototype,"selectedFeatureIndex",null),o([l({readOnly:!0})],M.prototype,"selectedFeatureViewModel",null),o([l({readOnly:!0})],M.prototype,"state",null),o([l()],M.prototype,"title",void 0),o([l()],M.prototype,"updateLocationEnabled",void 0),o([l()],M.prototype,"view",void 0),o([l()],M.prototype,"visible",void 0),o([l({readOnly:!0})],M.prototype,"waitingForContents",null),o([l({readOnly:!0})],M.prototype,"waitingForResult",null),o([l()],M.prototype,"zoomFactor",void 0),o([l()],M.prototype,"zoomToLocation",void 0),o([l()],M.prototype,"centerAtLocation",null),M=o([R("esri.widgets.Features.FeaturesViewModel")],M);const Rt=M;let de=class extends ce{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.heading=!0,this.spinner=!0}};o([l({type:Boolean,nonNullable:!0})],de.prototype,"actionBar",void 0),o([l({type:Boolean,nonNullable:!0})],de.prototype,"closeButton",void 0),o([l({type:Boolean,nonNullable:!0})],de.prototype,"collapseButton",void 0),o([l({type:Boolean,nonNullable:!0})],de.prototype,"featureNavigation",void 0),o([l({type:Boolean,nonNullable:!0})],de.prototype,"heading",void 0),o([l({type:Boolean,nonNullable:!0})],de.prototype,"spinner",void 0),de=o([R("esri.widgets.Features.FeaturesVisibleElements")],de);const ki=de,oi="selected-index",$n=0,ai="features-spinner",xn=50;let x=class extends Ei(Z){constructor(i,e){super(i,e),this._featureMenuIntersectionObserverCallback=([t])=>{t!=null&&t.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusOn=null,this._spinner=null,this._feature=null,this._relatedRecordsFlowItems=new De,this._relatedRecordsWidget=new _n({flowItems:this._relatedRecordsFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this.collapsed=!1,this.icon=null,this.featureNavigationTop=!1,this.headerActions=new Ie,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Rt,this.visibleElements=new ki,this._renderAction=(t,s)=>{const n=this._getActionTitle(t),{type:r,active:a,uid:d,disabled:c,indicator:h}=t;return t.visible?u("calcite-action",{active:r==="toggle"&&t.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(t),indicator:h,key:`action-${s}`,loading:a,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(t)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusOn="root-flow-item",this.featureMenuOpen=!1)},this._focusFlowItemNode=t=>{this._focusOn===t&&requestAnimationFrame(async()=>{var s,n;switch(t){case"menu-flow-item":await((s=this._featureMenuViewportNode)==null?void 0:s.setFocus());break;case"root-flow-item":await((n=this._rootFlowItemNode)==null?void 0:n.setFocus())}this._focusOn=null})},this._focusFlowItemNodeThrottled=Qe(this._focusFlowItemNode,xn),this._displaySpinnerThrottled=Qe(()=>this._displaySpinner(),$n),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,this._focusFlowItemNodeThrottled,f(()=>{var t;return(t=this.viewModel)==null?void 0:t.active},()=>this._toggleScreenLocationEnabled()),f(()=>{var t;return(t=this.viewModel)==null?void 0:t.active},t=>this._relatedRecordsWidget.closed=!t),f(()=>{var t;return(t=this.visibleElements)==null?void 0:t.closeButton},t=>this._relatedRecordsWidget.closable=t),f(()=>{var t;return(t=this.visibleElements)==null?void 0:t.spinner},t=>this._spinnerEnabledChange(t)),f(()=>{var t;return(t=this.viewModel)==null?void 0:t.view},(t,s)=>this._viewChange(t,s)),f(()=>{var t,s;return(s=(t=this.viewModel)==null?void 0:t.view)==null?void 0:s.ready},(t,s)=>this._viewReadyChange(t??!1,s??!1)),f(()=>{var t,s;return[(t=this.viewModel)==null?void 0:t.waitingForResult,(s=this.viewModel)==null?void 0:s.location]},()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),f(()=>this.selectedFeatureWidget,()=>this._destroyRelatedRecordsFlowItemWidgets()),f(()=>{var s;const t=(s=this.selectedFeatureWidget)==null?void 0:s.viewModel;return[t==null?void 0:t.title,t==null?void 0:t.state]},()=>this._setTitleFromFeatureWidget()),f(()=>{var s;const t=(s=this.selectedFeatureWidget)==null?void 0:s.viewModel;return[t==null?void 0:t.content,t==null?void 0:t.state]},()=>this._setContentFromFeatureWidget()),f(()=>{var t;return(t=this.viewModel)==null?void 0:t.featureViewModels},()=>this._featureMenuViewportScrollTop()),this._relatedRecordsWidget.on("close",()=>this.close()),this._relatedRecordsWidget.on("exit",()=>this._destroyRelatedRecordsFlowItemWidgets()),this._relatedRecordsWidget.on("open-related-feature",({feature:t})=>this._openRelatedFeature(t))])}loadDependencies(){return Re({action:()=>E(()=>import("./calcite-action-mEzyoc-Z.js"),__vite__mapDeps([41,37,2,3,34,21,23,25,26,4,31,27,1,33])),"action-bar":()=>E(()=>import("./calcite-action-bar-yKX8eCZY.js"),__vite__mapDeps([47,2,3,39,4,23,25,26,27,48,43,34,37,21,31,1,33,44,45,24,40,46])),"action-group":()=>E(()=>import("./calcite-action-group-_Xoggrsa.js"),__vite__mapDeps([49,48,2,3,39,4,23,25,26,27,43,34,37,21,31,1,33,44,45,24,40,46])),button:()=>E(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([50,51,2,3,29,21,30,23,25,26,4,31,27,1,33,34])),flow:()=>E(()=>import("./calcite-flow-A39UdeqN.js"),__vite__mapDeps([52,2,3,4,23])),"flow-item":()=>E(()=>import("./calcite-flow-item-mBjWFd-U.js"),__vite__mapDeps([42,2,3,21,23,25,26,4,27,43,34,37,31,1,33,44,45,24,40,46,35])),list:()=>E(()=>import("./calcite-list-LJfGqLbO.js"),__vite__mapDeps([20,2,3,21,4,22,23,24,25,26,27,1,28,29,30,31,32,33,34,35])),"list-item":()=>E(()=>import("./calcite-list-item-OtIyVNHT.js"),__vite__mapDeps([36,2,3,21,22,25,26,4,27,23,37,34,31,1,33])),"list-item-group":()=>E(()=>import("./calcite-list-item-group-havhVECR.js"),__vite__mapDeps([53,2,3,21,22])),loader:()=>E(()=>import("./calcite-loader-Z65agR8e.js"),__vite__mapDeps([54,33,2,3,34]))})}destroy(){var i,e;this._destroyRelatedRecordsFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),(i=this._featureMenuIntersectionObserver)==null||i.disconnect(),(e=this._relatedRecordsWidget)==null||e.destroy()}get _hideActionText(){var e;if(!this.responsiveActionsEnabled)return!1;const i=(e=this.view)==null?void 0:e.widthBreakpoint;return i==="xsmall"||i==="small"||i==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get content(){return this.viewModel.content}set content(i){this.viewModel.content=i}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(i){this.viewModel.featureMenuOpen=i}get features(){return this.viewModel.features}set features(i){this.viewModel.features=i}get location(){return this.viewModel.location}set location(i){this.viewModel.location=i}get label(){var i;return((i=this.messages)==null?void 0:i.widgetLabel)??""}set label(i){this._overrideIfSome("label",i)}get promises(){return this.viewModel.promises}set promises(i){this.viewModel.promises=i}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(i){this.viewModel.selectedFeatureIndex=i}get selectedFeatureWidget(){const{_feature:i,headingLevel:e,_relatedRecordsFlowItems:t}=this,{selectedFeatureViewModel:s}=this.viewModel,n={title:!1};return s?(i?(i.viewModel=s,i.visibleElements=n):this._feature=new mn({flowItems:t,headingLevel:e+1,viewModel:s,visibleElements:n}),this._feature):null}get title(){return this.viewModel.title}set title(i){this.viewModel.title=i}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(i){this.viewModel.updateLocationEnabled=i}get view(){return this.viewModel.view}set view(i){this.viewModel.view=i}get visible(){return this.viewModel.visible}set visible(i){this.viewModel.visible=i}blur(){var e;const{active:i}=this.viewModel;i?(e=this._rootFlowItemNode)==null||e.blur():ie.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(i,e){return this.viewModel.fetchFeatures(i,e)}focus(){const{active:i}=this.viewModel;i?this._setFocusOn():ie.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(i){this.removeHandles(oi);const e={collapsed:(i==null?void 0:i.collapsed)??!1};this.set(e),this.viewModel.open(i),this.addHandles(yt(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(i){return this.viewModel.triggerAction(i)}render(){return u("div",{bind:this,class:this.classes(W.base,I.widget,I.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:W.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:W.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:i,viewModel:e}=this,{featureCount:t,selectedFeatureIndex:s,pendingPromisesCount:n}=e;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:i.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:oe(i.pageText,{index:Wt(s+1),total:Wt(t)}),textEnabled:!0,title:i.selectFeature})}_renderPagination(){const{previous:i,next:e}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:W.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:W.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:i,onclick:this._previousFeature,scale:"s",text:i,title:i}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:e,onclick:this._nextFeature,scale:"s",text:e,title:e})))}_renderFeatureMenuItem(i){const{selectedFeatureViewModel:e,featureViewModels:t}=this.viewModel,s=i===e,n=t.indexOf(i);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${i.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:s,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:i.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:i}=this.viewModel,e=new Map;return i.forEach(t=>{const s=t==null?void 0:t.graphic;if(!s)return;const n=s.sourceLayer??s.layer,r=e.get(n)??[];e.set(n,[...r,t])}),e}_renderFeatureMenu(){const{featureViewModels:i}=this.viewModel,e=this._groupResultsByLayer();return i.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(e.keys()).map(t=>{var s;return u("calcite-list-item-group",{heading:(t==null?void 0:t.title)??this.messagesCommon.untitled,key:(t==null?void 0:t.uid)||"untitled"},(s=e.get(t))==null?void 0:s.map(n=>this._renderFeatureMenuItem(n)))})):null}_renderHeaderAction(i,e){return i.visible?u("calcite-action",{active:i.type==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":i.uid,disabled:i.disabled,icon:i.icon||"",indicator:i.indicator,key:`header-action-${e}`,loading:i.active,onclick:this._triggerHeaderAction,scale:"m",slot:"header-actions-end",text:i.title||"",title:i.title||""}):null}_renderHeaderActions(){return this.headerActions.map((i,e)=>this._renderHeaderAction(i,e)).toArray()}_renderContentFeature(){const{headingLevel:i,visibleElements:e,_isCollapsed:t,_collapseEnabled:s,featureNavigationTop:n}=this,{title:r,active:a}=this.viewModel,d=e.heading&&r?r:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,afterUpdate:this._focusRootFlowItemNode,bind:this,class:this.classes({[W.contentFeature]:!0,[W.flowItemCollapsed]:t}),closable:e.closeButton,closed:!a,collapsed:t,collapseDirection:n?"down":"up",collapsible:s,headingLevel:i,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(It,{class:this.classes(W.featuresHeading,I.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),t?null:u("div",{class:this.classes(W.container,W.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:i,featureMenuOpen:e,messages:t,messagesCommon:s}=this,{active:n,featureViewModels:r,pendingPromisesCount:a}=i;return e?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,afterUpdate:this._focusFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:oe(t.total,{total:r.length}),heading:t.selectFeature,key:"feature-menu",loading:i.waitingForContents,onCalciteFlowItemBack:this._handleFeatureMenuBack},a>0?u("calcite-loader",{class:W.loader,inline:!0,key:"feature-menu-loader",label:s.loading,scale:"m",slot:"header-actions-end"}):null,u("div",{class:W.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:W.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},s.back)):null}_renderContentContainer(){return u("calcite-flow",{key:"content-container"},this._renderContentFeature(),this._renderFeatureMenuContainer(),this._relatedRecordsWidget.render())}_getIconStyles(i){return{"background-image":i?`url(${i})`:""}}_getActionImage(i){const{selectedFeature:e}=this,t=e==null?void 0:e.attributes,{image:s}=i;return s&&t?oe(s,t):s??""}_getFallbackIcon(i){const{className:e,icon:t}=i;if(t)return null;const s=this._getActionImage(i),n={[W.icon]:!!e,[W.actionImage]:!!s};return e&&(n[e]=!0),s||e?u("span",{"aria-hidden":"true",class:this.classes(W.icon,n),key:"icon",styles:s?this._getIconStyles(s):{}}):null}_renderActionBar(){var i;return!this._isCollapsed&&this.visibleElements.actionBar&&((i=this.viewModel.allActions)!=null&&i.length)?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){var e;const i=(e=this.viewModel)==null?void 0:e.content;return i?typeof i=="string"?u("div",{class:O.contentNode,innerHTML:i,key:i}):this.renderNodeContent(i):null}_setFocusOn(){this._focusOn=this.featureMenuOpen?"menu-flow-item":"root-flow-item",this.renderNow()}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(i){await i.viewModel.updateGeometry();const e=i.graphic,t=e==null?void 0:e.geometry;if(t==null||e==null)return;this._destroyRelatedRecordsFlowItemWidgets(),await this.viewModel.zoomTo({target:t});const s=Ti(t);this.open({features:[e],location:s??void 0})}_focusRootFlowItemNode(){this._focusFlowItemNodeThrottled("root-flow-item")}_focusFeatureMenuFlowItemNode(){this._focusFlowItemNodeThrottled("menu-flow-item")}_storeRootFlowItemNode(i){this._rootFlowItemNode=i,this._focusFlowItemNodeThrottled("root-flow-item")}_storeFeatureMenuFlowItemNode(i){this._featureMenuViewportNode=i,this._focusFlowItemNodeThrottled("menu-flow-item")}_setActiveFeature(i){var s;const{viewModel:e}=this,t=i.currentTarget["data-feature-index"];e.activeFeature=((s=e.features)==null?void 0:s[t])||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(i){const e=i.currentTarget["data-feature-index"];isNaN(e)||(this.viewModel.selectedFeatureIndex=e),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(i){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(i),this._featureMenuIntersectionObserverNode=i}_getActionIcon(i){return i.icon?i.icon:i.image||i.className?void 0:"question"}_getActionTitle(i){const{messages:e,selectedFeature:t,messagesCommon:s}=this,{id:n}=i,r=t==null?void 0:t.attributes,a=i.title??"",d=n==="zoom-to-feature"?oe(a,{messages:e}):n==="remove-selected-feature"?oe(a,{messages:s}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?oe(a,{messages:e}):i.title;return d&&r?oe(d,r):d??""}_onMainKeydown(i){const e=hi(i);e==="ArrowLeft"&&(i.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),e==="ArrowRight"&&(i.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:i}=this;i&&(this.viewModel.content=i)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:i,messagesCommon:e}=this,t=i==null?void 0:i.viewModel;i&&(this.viewModel.title=(t==null?void 0:t.state)==="error"?e==null?void 0:e.errorMessage:(t==null?void 0:t.title)||"")}_addSelectedFeatureIndexHandle(){const i=f(()=>{var e;return(e=this.viewModel)==null?void 0:e.selectedFeatureIndex},(e,t)=>this._selectedFeatureIndexUpdated(e,t));this.addHandles(i,oi)}_selectedFeatureIndexUpdated(i,e){const{featureCount:t}=this.viewModel;t&&i!==e&&i!==-1&&(this._destroyRelatedRecordsFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(i){const e=i.currentTarget;if(e.disabled)return;const t=e.dataset.actionUid,s=this.headerActions.find(({uid:n})=>n===t);s&&!s.disabled&&((s==null?void 0:s.type)==="toggle"&&(s.value=!s.value),this.emit("trigger-header-action",{action:s}))}_triggerAction(i){const e=i.currentTarget;if(e.disabled)return;const t=e.dataset.actionUid,{allActions:s}=this.viewModel,n=s.findIndex(a=>a.uid===t),r=s.at(n);r&&r.type==="toggle"&&(r.value=!r.value),this.viewModel.triggerAction(n)}_createSpinner(i){i&&(this._spinner=new fn({view:i}),i.ui.add(this._spinner,{key:ai,position:"manual",internal:!0}))}_wireUpView(i){var e;this._destroySpinner(),i&&((e=this.visibleElements)!=null&&e.spinner)&&this._createSpinner(i)}_hideSpinner(){const{_spinner:i}=this;i&&(i.location=null,i.hide())}_viewReadyChange(i,e){var t;i?this._wireUpView((t=this.viewModel)==null?void 0:t.view):e&&this.viewModel.clear()}_viewChange(i,e){i&&e&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:i}=this;i&&(i.viewModel=null,!i.destroyed&&i.destroy()),this._feature=null}_destroyRelatedRecordsFlowItemWidgets(){this._relatedRecordsFlowItems.removeAll().forEach(i=>{"showAllEnabled"in i.viewModel&&(i.viewModel.showAllEnabled=!1),i.viewModel=null,i.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:i}=this;i&&(i.screenLocationEnabled=i.active)}_displaySpinner(){const{_spinner:i}=this;if(!i)return;const{location:e,waitingForResult:t}=this.viewModel;t&&e?i.show({location:e}):i.hide()}_destroySpinner(){var t;const{_spinner:i,view:e}=this;i&&((t=e==null?void 0:e.ui)==null||t.remove(i,ai),i.destroy(),this._spinner=null)}_spinnerEnabledChange(i){var e;this._destroySpinner(),i&&this._createSpinner((e=this.viewModel)==null?void 0:e.view)}};o([l()],x.prototype,"_focusOn",void 0),o([l()],x.prototype,"_relatedRecordsFlowItems",void 0),o([l()],x.prototype,"_hideActionText",null),o([l()],x.prototype,"_featureNavigationVisible",null),o([l()],x.prototype,"_isCollapsed",null),o([l()],x.prototype,"_collapseEnabled",null),o([l()],x.prototype,"collapsed",void 0),o([l()],x.prototype,"content",null),o([l()],x.prototype,"icon",void 0),o([l()],x.prototype,"featureMenuOpen",null),o([l()],x.prototype,"featureNavigationTop",void 0),o([l()],x.prototype,"features",null),o([l({type:Ie})],x.prototype,"headerActions",void 0),o([l()],x.prototype,"headingLevel",void 0),o([l()],x.prototype,"location",null),o([l()],x.prototype,"label",null),o([l(),Y("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),o([l(),Y("esri/t9n/common")],x.prototype,"messagesCommon",void 0),o([l()],x.prototype,"promises",null),o([l()],x.prototype,"responsiveActionsEnabled",void 0),o([l({readOnly:!0})],x.prototype,"selectedFeature",null),o([l()],x.prototype,"selectedFeatureIndex",null),o([l({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),o([l()],x.prototype,"title",null),o([l()],x.prototype,"updateLocationEnabled",null),o([l()],x.prototype,"view",null),o([l({type:Rt}),fi(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),o([l({type:ki,nonNullable:!0})],x.prototype,"visibleElements",void 0),o([l()],x.prototype,"visible",null),x=o([R("esri.widgets.Features")],x);const Tn=x,te="esri-popup",ge=`${te}--is-docked`,S={base:te,main:`${te}__main-container`,shadow:`${te}--shadow`,isDocked:ge,isDockedTopLeft:`${ge}-top-left`,isDockedTopCenter:`${ge}-top-center`,isDockedTopRight:`${ge}-top-right`,isDockedBottomLeft:`${ge}-bottom-left`,isDockedBottomCenter:`${ge}-bottom-center`,isDockedBottomRight:`${ge}-bottom-right`,alignTopCenter:`${te}--aligned-top-center`,alignBottomCenter:`${te}--aligned-bottom-center`,alignTopLeft:`${te}--aligned-top-left`,alignBottomLeft:`${te}--aligned-bottom-left`,alignTopRight:`${te}--aligned-top-right`,alignBottomRight:`${te}--aligned-bottom-right`,pointer:`${te}__pointer`,pointerDirection:`${te}__pointer-direction`};let Mt=class extends Rt{constructor(i){super(i)}};Mt=o([R("esri.widgets.Popup.PopupViewModel")],Mt);const Ri=Mt;let Se=class extends ce{constructor(){super(...arguments),this.closeButton=!0,this.featureNavigation=!0}};o([l({type:Boolean,nonNullable:!0})],Se.prototype,"closeButton",void 0),o([l({type:Boolean,nonNullable:!0})],Se.prototype,"featureNavigation",void 0),Se=o([R("esri.widgets.Features.PopupVisibleElements")],Se);const Pi=Se,li={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let F=class extends Z{constructor(i,e){super(i,e),this._dockAction=new ds({id:"popup-dock-action"}),this._featuresWidget=new Tn({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.spinnerEnabled=!0,this.viewModel=new Ri,this.visibleElements=new Pi}initialize(){this.addHandles([f(()=>{var i,e;return[(e=(i=this.viewModel)==null?void 0:i.view)==null?void 0:e.widthBreakpoint,this.dockEnabled]},()=>this._handleDockIcon(),{initial:!0}),f(()=>{var i,e;return[this.dockEnabled,(i=this.messages)==null?void 0:i.undock,(e=this.messages)==null?void 0:e.dock]},()=>this._handleDockEnabled(),{initial:!0}),f(()=>this.dockOptions,i=>{const{_dockAction:e}=this,t=this._featuresWidget.headerActions;t.remove(e),i.buttonEnabled&&t.add(e)},{initial:!0}),f(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},()=>this._positionContainer()),f(()=>{var i;return[(i=this.viewModel)==null?void 0:i.active,this.dockEnabled]},()=>this._toggleScreenLocationEnabled()),f(()=>{var i,e,t,s,n,r,a;return[(i=this.viewModel)==null?void 0:i.screenLocation,(t=(e=this.viewModel)==null?void 0:e.view)==null?void 0:t.padding,(n=(s=this.viewModel)==null?void 0:s.view)==null?void 0:n.size,(r=this.viewModel)==null?void 0:r.active,(a=this.viewModel)==null?void 0:a.location,this.alignment]},()=>this.reposition()),f(()=>{var i,e;return(e=(i=this.viewModel)==null?void 0:i.view)==null?void 0:e.size},(i,e)=>this._updateDockEnabledForViewSize(i,e)),f(()=>{var i;return(i=this.viewModel)==null?void 0:i.view},(i,e)=>this._viewChange(i,e)),f(()=>{var i,e;return(e=(i=this.viewModel)==null?void 0:i.view)==null?void 0:e.ready},(i,e)=>this._viewReadyChange(i??!1,e??!1)),f(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,{initial:!0}),f(()=>this._featureNavigationTop,i=>this._featuresWidget.featureNavigationTop=i,{initial:!0}),f(()=>this.headingLevel,i=>this._featuresWidget.headingLevel=i,{initial:!0}),f(()=>this.collapseEnabled,i=>this._featuresWidget.visibleElements.collapseButton=i,{initial:!0}),f(()=>this.collapsed,i=>this._featuresWidget.collapsed=i,{initial:!0}),f(()=>this.visibleElements.closeButton,i=>this._featuresWidget.visibleElements.closeButton=!!i,{initial:!0}),f(()=>this.spinnerEnabled,i=>this._featuresWidget.visibleElements.spinner=i,{initial:!0}),f(()=>this.visibleElements.featureNavigation,i=>this._featuresWidget.visibleElements.featureNavigation=!!i,{initial:!0}),Fe(()=>this._featuresWidget,"trigger-header-action",i=>{i.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}destroy(){var i;this._dockAction.destroy(),(i=this._featuresWidget)==null||i.destroy()}get _featureNavigationTop(){const{currentAlignment:i,currentDockPosition:e}=this;return i==="bottom-left"||i==="bottom-center"||i==="bottom-right"||e==="top-left"||e==="top-center"||e==="top-right"}get actions(){return this.viewModel.actions}set actions(i){this.viewModel.actions=i}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(i){this.viewModel.autoCloseEnabled=i}get autoOpenEnabled(){return qt(ie.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled}set autoOpenEnabled(i){qt(ie.getLogger(this),"autoOpenEnabled",{replacement:"MapView/SceneView.popupEnabled",version:"4.27"}),this.viewModel.autoOpenEnabled=i}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(i){this.viewModel.defaultPopupTemplateEnabled=i}get content(){return this.viewModel.content}set content(i){this.viewModel.content=i}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||li}set dockOptions(i){var d,c;const e={...li},t=(c=(d=this.viewModel)==null?void 0:d.view)==null?void 0:c.breakpoints,s={};t&&(s.width=t.xsmall,s.height=t.xsmall);const n={...e,...i},r={...e.breakpoint,...s},{breakpoint:a}=n;typeof a=="object"?n.breakpoint={...r,...a}:a&&(n.breakpoint=r),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(i){this.viewModel.featureMenuOpen=i}get features(){return this.viewModel.features}set features(i){this.viewModel.features=i}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(i){this.viewModel.goToOverride=i}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(i){this.viewModel.highlightEnabled=i}get location(){return this.viewModel.location}set location(i){this.viewModel.location=i}get label(){var i;return((i=this.messages)==null?void 0:i.widgetLabel)??""}set label(i){this._overrideIfSome("label",i)}get promises(){return this.viewModel.promises}set promises(i){this.viewModel.promises=i}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(i){this.viewModel.selectedFeatureIndex=i}get selectedFeatureWidget(){return this._featuresWidget.selectedFeatureWidget}get title(){return this.viewModel.title}set title(i){this.viewModel.title=i}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(i){this.viewModel.updateLocationEnabled=i}get view(){return this.viewModel.view}set view(i){this.viewModel.view=i}get visible(){return this.viewModel.visible}set visible(i){this.viewModel.visible=i}blur(){const{active:i}=this.viewModel;i||ie.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(i,e){return this.viewModel.fetchFeatures(i,e)}focus(){const{active:i}=this.viewModel;i||ie.getLogger(this).warn("Popup can only be focused when currently active."),this.renderNow(),this._featuresWidget.focus()}next(){return this.viewModel.next()}open(i){const e=!!i&&!!i.featureMenuOpen,t={collapsed:!!i&&!!i.collapsed,featureMenuOpen:e};this.set(t),this.viewModel.open(i),this._shouldFocus(i)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(i){return this.viewModel.triggerAction(i)}render(){var h,p,m,g;const{dockEnabled:i,currentAlignment:e,currentDockPosition:t}=this,{active:s}=this.viewModel,n=s&&i,r=s&&!i,a=(p=(h=this.selectedFeature)==null?void 0:h.layer)==null?void 0:p.title,d=(g=(m=this.selectedFeature)==null?void 0:m.layer)==null?void 0:g.id,c={[S.alignTopCenter]:e==="top-center",[S.alignBottomCenter]:e==="bottom-center",[S.alignTopLeft]:e==="top-left",[S.alignBottomLeft]:e==="bottom-left",[S.alignTopRight]:e==="top-right",[S.alignBottomRight]:e==="bottom-right",[S.isDocked]:n,[S.shadow]:r,[S.isDockedTopLeft]:t==="top-left",[S.isDockedTopCenter]:t==="top-center",[S.isDockedTopRight]:t==="top-right",[S.isDockedBottomLeft]:t==="bottom-left",[S.isDockedBottomCenter]:t==="bottom-center",[S.isDockedBottomRight]:t==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(S.base,c),"data-layer-id":d,"data-layer-title":a,role:"presentation"},s?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:S.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(S.pointerDirection,S.shadow)}))}_renderMainContainer(){const{dockEnabled:i}=this,e={[S.shadow]:i};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(S.main,I.widget,e)},this._featuresWidget.render())}async _shouldFocus(i){i!=null&&i.shouldFocus&&(await cs(()=>{var e;return((e=this.viewModel)==null?void 0:e.active)===!0}),this.focus())}_isOutsideView(i){const{popupHeight:e,popupWidth:t,screenLocation:s,side:n,view:r}=i;if(isNaN(t)||isNaN(e)||!r||!s)return!1;const a=r.padding;return n==="right"&&s.x+t/2>r.width-a.right||n==="left"&&s.x-t/2r.height-a.bottom}_calculateAutoAlignment(i){if(i!=="auto")return i;const{_pointerOffsetInPx:e,_containerNode:t,_mainContainerNode:s,viewModel:n}=this,{screenLocation:r,view:a}=n;if(r==null||!a||!t)return"top-center";function d(L){return parseInt(L.replaceAll(/[^-\d\.]/g,""),10)}const c=s?window.getComputedStyle(s,null):null,h=c?d(c.getPropertyValue("max-height")):0,p=c?d(c.getPropertyValue("height")):0,{height:m,width:g}=t.getBoundingClientRect(),_=g+e,v=Math.max(m,h,p)+e,w=this._isOutsideView({popupHeight:v,popupWidth:_,screenLocation:r,side:"right",view:a}),A=this._isOutsideView({popupHeight:v,popupWidth:_,screenLocation:r,side:"left",view:a}),b=this._isOutsideView({popupHeight:v,popupWidth:_,screenLocation:r,side:"top",view:a}),T=this._isOutsideView({popupHeight:v,popupWidth:_,screenLocation:r,side:"bottom",view:a});return A?b?"bottom-right":"top-right":w?b?"bottom-left":"top-left":b?T?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(i){return typeof i=="function"?i.call(this):i}_getCurrentAlignment(){const{alignment:i,dockEnabled:e}=this;return e||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(i)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(i){const e=["left","right"];return Ae(this.container)&&e.reverse(),i==null?void 0:i.replace(/leading/gi,e[0]).replaceAll(/trailing/gi,e[1])}_callDockPosition(i){return typeof i=="function"?i.call(this):i}_getDockPosition(){var i;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition((i=this.dockOptions)==null?void 0:i.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(i){var a;if(i!=="auto")return i;const e=(a=this.viewModel)==null?void 0:a.view,t=Ae(this.container)?"top-left":"top-right";if(!e)return t;const s=e.padding||{left:0,right:0,top:0,bottom:0},n=e.width-s.left-s.right,{breakpoints:r}=e;return r&&n<=r.xsmall?"bottom-center":t}_getDockIcon(){const i=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(i){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){var i,e;this._dockAction.title=this.dockEnabled?(i=this.messages)==null?void 0:i.undock:(e=this.messages)==null?void 0:e.dock}_setMainContainerNode(i){this._mainContainerNode=i}_positionContainer(i=this._containerNode){if(i&&(this._containerNode=i),!this._containerNode)return;const{screenLocation:e}=this.viewModel,{width:t}=this._containerNode.getBoundingClientRect(),s=this._calculatePositionStyle(e,t);s&&Object.assign(this._containerNode.style,s)}_calculateFullWidth(i){const{currentAlignment:e,_pointerOffsetInPx:t}=this;return e==="top-left"||e==="bottom-left"||e==="top-right"||e==="bottom-right"?i+t:i}_calculateAlignmentPosition(i,e,t,s){const{currentAlignment:n,_pointerOffsetInPx:r}=this;if(!t)return;const{padding:a}=t,d=s/2,c=t.height-e,h=t.width-i;return n==="bottom-center"?{top:e+r-a.top,left:i-d-a.left}:n==="top-left"?{bottom:c+r-a.bottom,right:h+r-a.right}:n==="bottom-left"?{top:e+r-a.top,right:h+r-a.right}:n==="top-right"?{bottom:c+r-a.bottom,left:i+r-a.left}:n==="bottom-right"?{top:e+r-a.top,left:i+r-a.left}:n==="top-center"?{bottom:c+r-a.bottom,left:i-d-a.left}:void 0}_calculatePositionStyle(i,e){const{dockEnabled:t,view:s}=this;if(!s)return;if(t)return{left:"",top:"",right:"",bottom:""};if(i==null||!e)return;const n=this._calculateFullWidth(e),r=this._calculateAlignmentPosition(i.x,i.y,s,n);return r?{top:r.top!==void 0?`${r.top}px`:"auto",left:r.left!==void 0?`${r.left}px`:"auto",bottom:r.bottom!==void 0?`${r.bottom}px`:"auto",right:r.right!==void 0?`${r.right}px`:"auto"}:void 0}_viewChange(i,e){i&&e&&(this.close(),this.clear())}_viewReadyChange(i,e){i?this._wireUpView():e&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(i,e,t){const[s,n]=i,[r,a]=e,{width:d=0,height:c=0}=t??{};return s<=d&&r>d||s>d&&r<=d||n<=c&&a>c||n>c&&a<=c}_updateDockEnabledForViewSize(i,e){var h,p;if(!i||!e)return;const t=((p=(h=this.viewModel)==null?void 0:h.view)==null?void 0:p.padding)||{left:0,right:0,top:0,bottom:0},s=t.left+t.right,n=t.top+t.bottom,r=[],a=[];r[0]=i[0]-s,r[1]=i[1]-n,a[0]=e[0]-s,a[1]=e[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(r,a,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:i,viewModel:e}=this;if(!e)return;const t=e.active&&!i;e.screenLocationEnabled=t}_shouldDockAtCurrentViewSize(i){var d,c;const e=i.breakpoint,t=(c=(d=this.viewModel)==null?void 0:d.view)==null?void 0:c.ui;if(!t)return!1;const{width:s,height:n}=t;if(isNaN(s)||isNaN(n)||!e)return!1;const r=e.hasOwnProperty("width")&&s<=(e.width??0),a=e.hasOwnProperty("height")&&n<=(e.height??0);return r||a}_setDockEnabledForViewSize(i){i.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(i))}};o([l({readOnly:!0})],F.prototype,"_featureNavigationTop",null),o([l()],F.prototype,"actions",null),o([l()],F.prototype,"alignment",void 0),o([l()],F.prototype,"autoCloseEnabled",null),o([l()],F.prototype,"autoOpenEnabled",null),o([l()],F.prototype,"defaultPopupTemplateEnabled",null),o([l()],F.prototype,"content",null),o([l()],F.prototype,"collapsed",void 0),o([l()],F.prototype,"collapseEnabled",void 0),o([l({readOnly:!0})],F.prototype,"currentAlignment",null),o([l({readOnly:!0})],F.prototype,"currentDockPosition",null),o([l()],F.prototype,"dockOptions",null),o([l()],F.prototype,"dockEnabled",void 0),o([l({readOnly:!0})],F.prototype,"featureCount",null),o([l()],F.prototype,"featureMenuOpen",null),o([l()],F.prototype,"features",null),o([l()],F.prototype,"goToOverride",null),o([l()],F.prototype,"headingLevel",void 0),o([l()],F.prototype,"highlightEnabled",null),o([l()],F.prototype,"location",null),o([l()],F.prototype,"label",null),o([l()],F.prototype,"maxInlineActions",void 0),o([l(),Y("esri/widgets/Popup/t9n/Popup")],F.prototype,"messages",void 0),o([l()],F.prototype,"promises",null),o([l({readOnly:!0})],F.prototype,"selectedFeature",null),o([l()],F.prototype,"selectedFeatureIndex",null),o([l({readOnly:!0})],F.prototype,"selectedFeatureWidget",null),o([l()],F.prototype,"spinnerEnabled",void 0),o([l()],F.prototype,"title",null),o([l()],F.prototype,"updateLocationEnabled",null),o([l()],F.prototype,"view",null),o([l({type:Ri}),fi(["triggerAction","trigger-action"])],F.prototype,"viewModel",void 0),o([l()],F.prototype,"visible",null),o([l({type:Pi,nonNullable:!0})],F.prototype,"visibleElements",void 0),F=o([R("esri.widgets.Popup")],F);const wr=F;export{wr as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/calcite-icon-itD416se.js","assets/icon-ZwpY5ksA.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/observers-JyBmMU24.js","assets/chartUtilsAm5-QfmFJ3lc.js","assets/Theme-QNc_77AM.js","assets/Tooltip-lrFZgXdG.js","assets/DefaultTheme-T7-VnRhA.js","assets/chartCommon-ZPkVkRIK.js","assets/Responsive-QKXcW_1q.js","assets/Button-1STHXt3M.js","assets/ColorSet-j9kKRPwP.js","assets/pieChart-w-OTuuJJ.js","assets/Tick-WQ_bPwW2.js","assets/xyChart-pkay2Qkc.js","assets/LineSeries-VcEznTH7.js","assets/arcadeUtils-OUqwHs4P.js","assets/TimeOnly-ljWtUK7N.js","assets/hash-SS5GKVPY.js","assets/calcite-list-LJfGqLbO.js","assets/interactive-NKzPUNL4.js","assets/utils3-_ao2jQXg.js","assets/loadable-sxY2K1G3.js","assets/debounce-HnHf1UOZ.js","assets/locale-pfkq1d6A.js","assets/key-qdHumIlA.js","assets/t9n-od6MEnI1.js","assets/input-9jE7tcJD.js","assets/form-2Iq0hI3D.js","assets/label2-d2vWQ7x7.js","assets/component-dtiBfYiX.js","assets/progress-puB9lhY4.js","assets/loader-QqciGs1c.js","assets/guid-6vN-YNJI.js","assets/scrim-OeyGkB0-.js","assets/calcite-list-item-OtIyVNHT.js","assets/action-W5zDPNjG.js","assets/calcite-notice-zH528nES.js","assets/conditionalSlot-e55zipTI.js","assets/openCloseComponent-yw47Oy2q.js","assets/calcite-action-mEzyoc-Z.js","assets/calcite-flow-item-mBjWFd-U.js","assets/action-menu-h_LAlWK7.js","assets/popover-Jm1QI0N1.js","assets/floating-ui-McpI0u1Z.js","assets/FloatingArrow-BghsONry.js","assets/calcite-action-bar-yKX8eCZY.js","assets/action-group-8XaPC2xM.js","assets/calcite-action-group-_Xoggrsa.js","assets/calcite-button-tOn16zeN.js","assets/button-dkwNndhL.js","assets/calcite-flow-A39UdeqN.js","assets/calcite-list-item-group-havhVECR.js","assets/calcite-loader-Z65agR8e.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/PopupSceneLayerView-cRxapYqF.js b/dist/assets/PopupSceneLayerView-cRxapYqF.js new file mode 100644 index 0000000..823d9d9 --- /dev/null +++ b/dist/assets/PopupSceneLayerView-cRxapYqF.js @@ -0,0 +1 @@ +import{e as y,c as d,E as l,fG as o,fH as f,fI as w,fJ as F}from"./index-J0iiHjMT.js";const x=h=>{let r=class extends h{_validateFetchPopupFeatures(p){const{layer:e}=this,{popupEnabled:t}=e;if(!t)throw new l("scenelayerview3d:fetchPopupFeatures","Popups are disabled",{layer:e});if(!o(e,p))throw new l("scenelayerview3d:fetchPopupFeatures","Layer does not define a popup template",{layer:e})}async prepareFetchPopupFeatures(p){}async fetchPopupFeatures(p,e){this._validateFetchPopupFeatures(e);const t=e!=null?e.clientGraphics:null;if(!t||t.length===0)return[];const u=this.layer.type==="scene"&&this.layer.associatedLayer!=null?this.layer.associatedLayer:this.layer;let i=[];"fieldsIndex"in this.layer&&(i=f(this.layer.fieldsIndex,await w(u,o(this.layer,e)))),await this.prepareFetchPopupFeatures(i);const c=new Set,n=[],a=[];for(const s of t)F(i,s,c)?a.push(s):n.push(s);return a.length===0?n:this.whenGraphicAttributes(a,[...c]).catch(()=>a).then(s=>n.concat(s))}};return r=y([d("esri.views.3d.layers.support.PopupSceneLayerView")],r),r};export{x as i}; diff --git a/dist/assets/QueryEngine-8tLWlkSE.js b/dist/assets/QueryEngine-8tLWlkSE.js new file mode 100644 index 0000000..2e9dcf5 --- /dev/null +++ b/dist/assets/QueryEngine-8tLWlkSE.js @@ -0,0 +1,7 @@ +import{qP as mt,qQ as oe,qR as pt,e_ as L,qS as ue,qT as yt,qU as gt,qV as xt,gu as Re,E as T,eP as Ie,k1 as _t,qW as Ft,al as b,bH as St,qX as Be,eF as ye,k2 as Ue,e3 as wt,fd as Rt,gk as G,qY as ce,qZ as he,d4 as ke,d6 as Le,q_ as It,q$ as Te,gi as ve,gh as se,r0 as $e,de as ge,r1 as Tt,r2 as de,r3 as vt,r4 as $t,bI as ee,dp as bt,bN as fe,dy as me,eJ as Q,dz as H,eK as At,ct as Et,mG as Mt,r5 as qt,eV as be,r6 as Vt,r7 as Pt,r8 as Ae,r9 as Ct,ra as Nt,gb as zt,rb as Qt,rc as Gt,eE as Dt,eQ as Ot,ak as Ee,n as Zt,s as jt,rd as Bt,l6 as Ut,eh as kt,l8 as Lt,e2 as ae,re as Me,ce as Ht,ea as Jt,eU as Yt,mH as qe,eL as Wt,ae as Kt,cf as Xt}from"./index-J0iiHjMT.js";import{x as ei}from"./WhereClause-XAMIZ4-B.js";import{t as He}from"./json-v6EOeNTY.js";import{t as ti}from"./QueryEngineCapabilities-PzVpW5yD.js";import{c as re,w as ii,B as si,f as ai,d as Ve,p as Pe,C as ri,k as ni,$ as li,E as oi,P as ui,U as ci,T as hi,v as di}from"./utils-P5wTOmqv.js";const Ce=new L,fi=new L,pe=new L,E={esriGeometryPoint:ue,esriGeometryPolyline:yt,esriGeometryPolygon:gt,esriGeometryMultipoint:xt};function Ne(a,e,t,i=a.hasZ,s=a.hasM){if(e==null)return null;const r=a.hasZ&&i,n=a.hasM&&s;if(t){const l=oe(pe,e,a.hasZ,a.hasM,"esriGeometryPoint",t,i,s);return ue(l,r,n)}return ue(e,r,n)}function q(a,e,t,i,s,r,n=e,l=t){var h,d,m;const o=e&&n,u=t&&l,c=i!=null?"coords"in i?i:i.geometry:null;if(c==null)return null;if(s){let p=mt(fi,c,e,t,a,s,n,l);return r&&(p=oe(pe,p,o,u,a,r)),((h=E[a])==null?void 0:h.call(E,p,o,u))??null}if(r){const p=oe(pe,c,e,t,a,r,n,l);return((d=E[a])==null?void 0:d.call(E,p,o,u))??null}return pt(Ce,c,e,t,n,l),((m=E[a])==null?void 0:m.call(E,Ce,o,u))??null}function U(a){return a&&Je in a?JSON.parse(JSON.stringify(a,mi)):a}const Je="_geVersion",mi=(a,e)=>a!==Je?e:void 0;let pi=class{constructor(e,t){this._cache=new Re(e),this._invalidCache=new Re(t)}get(e,t){const i=`${t.uid}:${e}`,s=this._cache.get(i);if(s)return s;if(this._invalidCache.get(i)!=null)return null;try{const r=ei.create(e,t);return this._cache.put(i,r),r}catch(r){return this._invalidCache.put(i,r),null}}getError(e,t){const i=`${t.uid}:${e}`;return this._invalidCache.get(i)??null}};const Ye=new pi(50,500),k="unsupported-query",We=" as ",Ke=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),Xe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),yi=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...Ke,...Xe]);function xe(a,e,t={}){const i=z(e,a);if(!i){const r=Ye.getError(e,a);throw new T(k,"invalid SQL expression",{expression:e,error:r})}const s=t.expressionName||"expression";if(t.validateStandardized&&!i.isStandardized)throw new T(k,`${s} is not standard`,{expression:e});if(t.validateAggregate&&!i.isAggregate)throw new T(k,`${s} does not contain a valid aggregate function`,{expression:e});return i.fieldNames}function gi(a,e,t,i){if(!t)return!0;const s="where clause";return N(a,e,xe(a,t,{validateStandardized:!0,expressionName:s}),{expressionName:s,query:i}),!0}function xi(a,e,t,i,s){if(!t)return!0;const r="having clause",n=xe(a,t,{validateAggregate:!0,expressionName:r});N(a,e,n,{expressionName:r,query:s});const l=z(t,a);if(!(l==null?void 0:l.getExpressions().every(u=>{var m;const{aggregateType:c,field:h}=u,d=(m=a.get(h))==null?void 0:m.name;return i.some(p=>{var w;const{onStatisticField:f,statisticType:F}=p;return((w=a.get(f))==null?void 0:w.name)===d&&F.toLowerCase().trim()===c})})))throw new T(k,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function z(a,e){return a?Ye.get(a,e):null}function et(a){return/\((.*?)\)/.test(a)?a:a.split(We)[0]}function _i(a){return a.split(We)[1]}function N(a,e,t,i={}){const s=new Map;if(Fi(s,a,e,i.allowedFieldTypes??yi,t),s.size){const r=i.expressionName??"expression";throw new T(k,`${r} contains invalid or missing fields`,{errors:Array.from(s.values()),query:i.query})}}function Fi(a,e,t,i,s){for(const r of s)if(r!=="*")if(e.get(r))ze(a,e,t,i,r);else try{const n=xe(e,et(r),{validateStandardized:!0});for(const l of n)ze(a,e,t,i,l)}catch(n){a.set(r,{type:"expression-error",expression:r,error:n})}}function ze(a,e,t,i,s){if(s==="*")return;const r=e.get(s);r?t.has(r.name)?(i==null?void 0:i.has(r.type))===!1&&a.set(s,{type:"invalid-type",fieldName:r.name,fieldType:Ie.fromJSON(r.type),allowedFieldTypes:Array.from(i,n=>Ie.fromJSON(n))}):a.set(s,{type:"missing-field",fieldName:r.name}):a.set(s,{type:"invalid-field",fieldName:s})}const ne=[0,0];function tt(a,e){if(!e)return null;if("x"in e){const t={x:0,y:0};return[t.x,t.y]=a(e.x,e.y,ne),e.z!=null&&(t.z=e.z),e.m!=null&&(t.m=e.m),t}if("xmin"in e){const t={xmin:0,ymin:0,xmax:0,ymax:0};return[t.xmin,t.ymin]=a(e.xmin,e.ymin,ne),[t.xmax,t.ymax]=a(e.xmax,e.ymax,ne),e.hasZ&&(t.zmin=e.zmin,t.zmax=e.zmax,t.hasZ=!0),e.hasM&&(t.mmin=e.mmin,t.mmax=e.mmax,t.hasM=!0),t}return"rings"in e?{rings:Qe(e.rings,a),hasM:e.hasM,hasZ:e.hasZ}:"paths"in e?{paths:Qe(e.paths,a),hasM:e.hasM,hasZ:e.hasZ}:"points"in e?{points:it(e.points,a),hasM:e.hasM,hasZ:e.hasZ}:null}function Qe(a,e){const t=[];for(const i of a)t.push(it(i,e));return t}function it(a,e){const t=[];for(const i of a){const s=e(i[0],i[1],[0,0]);t.push(s),i.length>2&&s.push(i[2]),i.length>3&&s.push(i[3])}return t}async function Z(a,e){if(!a||!e)return;const t=Array.isArray(a)?a.map(i=>i.geometry!=null?i.geometry.spatialReference:null).filter(wt):[a];await Rt(t.map(i=>({source:i,dest:e})))}const st=tt.bind(null,_t),at=tt.bind(null,Ft);function M(a,e,t,i){if(!a||(t||(t=e,e=a.spatialReference),!G(e)||!G(t)||b(e,t)))return a;if(Be(e,t)){const s=ye(t)?st(a):at(a);return s.spatialReference=t,s}return Ue(He,[a],e,t,null,i)[0]}class Si{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,s){if(!(e!=null&&e.length)||!t||!i||b(t,i))return e;const r={geometries:e,inSpatialReference:t,outSpatialReference:i,geographicTransformation:s,resolve:St()};return this._jobs.push(r),this._timer??(this._timer=setTimeout(this._process,10)),r.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:s,resolve:r,geographicTransformation:n}=e;Be(i,s)?ye(s)?r(t.map(st)):r(t.map(at)):r(Ue(He,t,i,s,n,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const wi=new Si;function Ri(a,e,t,i){return wi.push(a,e,t,i)}let X=class{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const s=e.outFields;if(s&&!s.includes("*")){this.outFields=s;let r=0;for(const n of s){const l=et(n),o=this.fieldsIndex.get(l),u=o?null:z(l,i),c=o?o.name:_i(n)||"FIELD_EXP_"+r++;this._fieldDataCache.set(n,{alias:c,clause:u})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(t=>this.getAttributes(t)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){var n;const s=i?i.name:t;let r=null;return this._fieldDataCache.has(s)?r=(n=this._fieldDataCache.get(s))==null?void 0:n.clause:i||(r=z(t,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:r})),i?this.featureAdapter.getAttribute(e,s):r==null?void 0:r.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const s=t.normalizationType,r=t.normalizationTotal,n=this.fieldsIndex.get(t.field),l=ce(n)||he(n),o=ke(n);return e.map(u=>{let c=t.field&&this.getFieldValue(u,t.field,this.fieldsIndex.get(t.field));if(t.field2?(c=`${re(c)}${t.fieldDelimiter}${re(this.getFieldValue(u,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(c=`${c}${t.fieldDelimiter}${re(this.getFieldValue(u,t.field3,this.fieldsIndex.get(t.field3)))}`)):typeof c=="string"&&i&&(l?c=c?new Date(c).getTime():null:o&&(c=c?ii(c):null)),s&&Number.isFinite(c)){const h=s==="field"&&t.normalizationField?this.getFieldValue(u,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;c=si(c,s,h,r)}return c})}async getExpressionValues(e,t,i,s,r){const{arcadeUtils:n}=await Le(),l=n.hasGeometryOperations(t);l&&await n.enableGeometryOperations();const o=n.createFunction(t),u=n.getViewInfo(i),c={fields:this.fieldsIndex.fields};return e.map(h=>{const d={attributes:this.featureAdapter.getAttributes(h),layer:c,geometry:l?{...q(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(h)),spatialReference:i==null?void 0:i.spatialReference}:null},m=n.createExecContext(d,u,r);return n.executeFunction(o,m)})}validateItem(e,t){var i,s;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:z(t,this.fieldsIndex)}),((s=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:s.testFeature(e,this.featureAdapter))??!1}validateItems(e,t){var i,s;return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:z(t,this.fieldsIndex)}),((s=(i=this._fieldDataCache.get(t))==null?void 0:i.clause)==null?void 0:s.testSet(e,this.featureAdapter))??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!(t!=null&&t.length))return this.featureAdapter.getAttributes(e);const i={};for(const s of t){const{alias:r,clause:n}=this._fieldDataCache.get(s);i[r]=n?n.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,r)}return i}_processAttributesForDistinctValues(e){if(e==null||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const n of t){const{alias:l}=this._fieldDataCache.get(n);i.push(e[l])}else for(const n in e)i.push(e[n]);const s=`${(t||["*"]).join(",")}=${i.join(",")}`;let r=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++r),r>1?null:e}};class v{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new X(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query;if(!(t==null?void 0:t.length))return 1;const n=new Map,l=new Map,o=new Set;for(const u of s){const{statisticType:c}=u,h=c!=="exceedslimit"?u.onStatisticField:void 0;if(!l.has(h)){const m=[];for(const p of t){const f=this._getAttributeValues(e,p,n);m.push(f)}l.set(h,this._calculateUniqueValues(m,e.returnDistinctValues))}const d=l.get(h);for(const m in d){const{data:p,items:f}=d[m],F=p.join(",");i&&!e.validateItems(f,i)||o.add(F)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;G(this.query.outSR)&&!b(t.spatialReference,this.query.outSR)?e.queryGeometry=U({spatialReference:this.query.outSR,...M(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=U({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,s=Ge(this.hasZ,this.hasM),{point:r,mode:n}=e,l=typeof e.distance=="number"?e.distance:e.distance.x,o=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(n,this.spatialReference,t),d=new De(null,0),m=new De(null,0),p={x:0,y:0,z:0};for(const f of this.items){const F=i.getGeometry(f);if(F==null)continue;const{coords:_,lengths:w}=F;if(d.coords=_,m.coords=_,e.returnEdge){let I=0;for(let g=0;gf.distance-F.distance),u}_getPointCreator(e,t,i){const s=i==null||b(t,i)?l=>l:l=>M(l,t,i),{hasZ:r}=this,n=0;return e==="3d"?r?({x:l,y:o,z:u})=>s({x:l,y:o,z:u}):({x:l,y:o})=>s({x:l,y:o,z:n}):({x:l,y:o})=>s({x:l,y:o})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,minValue:l,maxValue:o,scale:u,timeZone:c}=e,h=this.fieldsIndex.get(t),d=ve(h)||ce(h)||he(h),m=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:u,timeZone:c}),p=ai({normalizationType:r,normalizationField:s,minValue:l,maxValue:o}),f={value:.5,fieldType:h==null?void 0:h.type},F=se(h)?Ve({values:m,supportsNullCount:p,percentileParams:f}):Pe({values:m,minValue:l,maxValue:o,useSampleStdDev:!r,supportsNullCount:p,percentileParams:f});return ri(F,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:r,scale:n,timeZone:l}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:n,timeZone:l},!1),u=ni(o);return li(u,s,r,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,p=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:d,timeZone:m}),f=oi(p,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numClasses:h});return ui(f,l)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,p=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:r,normalizationTotal:n,scale:d,timeZone:m});return ci(p,{field:t,normalizationField:s,normalizationType:r,normalizationTotal:n,classificationMethod:l,standardDeviationInterval:o,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,i){if(e.length>1&&(t!=null&&t.length))for(const s of t.reverse()){const r=s.split(" "),n=r[0],l=this.fieldsIndex.get(n),o=!!r[1]&&r[1].toLowerCase()==="desc",u=hi(l==null?void 0:l.type,o);e.sort((c,h)=>{const d=i(c,n,l),m=i(h,n,l);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:i,hasM:s,hasZ:r,objectIdField:n,spatialReference:l}=this,{outFields:o,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:p}=e,f=h!=null&&t.length>(d||0)+h,F=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:F,geometryType:i,hasM:s&&p,hasZ:r&&m,objectIdFieldName:n,spatialReference:U(u||l),transform:c&&$e(c)||null}}_createFeatures(e,t){const i=new X(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:r}=this,{orderByFields:n,quantizationParameters:l,returnGeometry:o,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:p=!1}=e,f=r&&m,F=s&&p;let _=[],w=0;const I=[...t];if(this._sortFeatures(I,n,(x,y,S)=>i.getFieldValue(x,y,S)),this.geometryType&&(o||u)){const x=$e(l)??void 0;if(o&&!u)for(const y of I)_[w++]={attributes:i.getAttributes(y),geometry:q(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(y),c,x,f,F)};else if(!o&&u)for(const y of I)_[w++]={attributes:i.getAttributes(y),centroid:Ne(this,this.featureAdapter.getCentroid(y,this),x)};else for(const y of I)_[w++]={attributes:i.getAttributes(y),centroid:Ne(this,this.featureAdapter.getCentroid(y,this),x),geometry:q(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(y),c,x,f,F)}}else for(const x of I){const y=i.getAttributes(x);y&&(_[w++]={attributes:y})}const g=h||0;if(d!=null){const x=g+d;_=_.slice(g,Math.min(_.length,x))}return _}_createExceedsLimitQueryResponse(e){let t=!1,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;for(const n of e.outStatistics??[])if(n.statisticType==="exceedslimit"){i=n.maxPointCount!=null?n.maxPointCount:Number.POSITIVE_INFINITY,s=n.maxRecordCount!=null?n.maxRecordCount:Number.POSITIVE_INFINITY,r=n.maxVertexCount!=null?n.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>i;else if(this.items.length>s)t=!0;else{const n=Ge(this.hasZ,this.hasM),l=this.featureAdapter;t=this.items.reduce((o,u)=>{const c=l.getGeometry(u);return o+(c!=null&&c.coords.length||0)},0)/n>r}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){var I;const t={attributes:{}},i=[],s=new Map,r=new Map,n=new Map,l=new Map,o=new X(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,p=c==null?void 0:c.length,f=!!p,F=f?c[0]:null,_=f&&!this.fieldsIndex.get(F);for(const g of u??[]){const{outStatisticFieldName:x,statisticType:y}=g,S=g,R=y!=="exceedslimit"?g.onStatisticField:void 0,$=y==="percentile_disc"||y==="percentile_cont",A=y==="EnvelopeAggregate"||y==="CentroidAggregate"||y==="ConvexHullAggregate",J=f&&p===1&&(R===F||_)&&y==="count";if(f){if(!n.has(R)){const W=[];for(const ie of c){const K=this._getAttributeValues(o,ie,s);W.push(K)}n.set(R,this._calculateUniqueValues(W,!A&&o.returnDistinctValues))}const V=n.get(R);if(!V)continue;const te=Object.keys(V);for(const W of te){const{count:ie,data:K,items:Fe,itemPositions:ht}=V[W],Se=K.join(",");if(!h||o.validateItems(Fe,h)){const D=l.get(Se)||{attributes:{}};if(A){D.aggregateGeometries||(D.aggregateGeometries={});const{aggregateGeometries:P,outStatisticFieldName:j}=await this._getAggregateGeometry(S,Fe);D.aggregateGeometries[j]=P}else{let P=null;if(J)P=ie;else{const j=this._getAttributeValues(o,R,s),we=ht.map(ft=>j[ft]);P=$&&"statisticParameters"in S?this._getPercentileValue(S,we):this._getStatisticValue(S,we,null,o.returnDistinctValues)}D.attributes[x]=P}let dt=0;c.forEach((P,j)=>D.attributes[this.fieldsIndex.get(P)?P:"EXPR_"+ ++dt]=K[j]),l.set(Se,D)}}}else if(A){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:V,outStatisticFieldName:te}=await this._getAggregateGeometry(S,this.items);t.aggregateGeometries[te]=V}else{const V=this._getAttributeValues(o,R,s);t.attributes[x]=$&&"statisticParameters"in S?this._getPercentileValue(S,V):this._getStatisticValue(S,V,r,o.returnDistinctValues)}const Y=y!=="min"&&y!=="max"||!se(this.fieldsIndex.get(R))&&!this._isAnyDateField(R)?null:(I=this.fieldsIndex.get(R))==null?void 0:I.type;i.push({name:x,alias:x,type:Y||"esriFieldTypeDouble"})}const w=f?Array.from(l.values()):[t];return this._sortFeatures(w,d,(g,x)=>g.attributes[x]),m&&(w.length=Math.min(m,w.length)),{fields:i,features:w}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return ve(t)||ce(t)||he(t)||ke(t)}async _getAggregateGeometry(e,t){const{convexHull:i,union:s}=await ge(()=>import("./geometryEngineJSON-FxYgI0L3.js").then(f=>f.g),__vite__mapDeps([0,1,2,3])),{statisticType:r,outStatisticFieldName:n}=e,{featureAdapter:l,spatialReference:o,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>q(u,c,h,l.getGeometry(f))),m=i(o,d,!0)[0],p={aggregateGeometries:null,outStatisticFieldName:null};if(r==="EnvelopeAggregate"){const f=m?Tt(m):de(s(o,d));p.aggregateGeometries={...f,spatialReference:o},p.outStatisticFieldName=n||"extent"}else if(r==="CentroidAggregate"){const f=m?vt(m):$t(de(s(o,d)));p.aggregateGeometries={x:f[0],y:f[1],spatialReference:o},p.outStatisticFieldName=n||"centroid"}else r==="ConvexHullAggregate"&&(p.aggregateGeometries=m,p.outStatisticFieldName=n||"convexHull");return p}_getStatisticValue(e,t,i,s){const{onStatisticField:r,statisticType:n}=e;let l=null;return l=i!=null&&i.has(r)?i.get(r):se(this.fieldsIndex.get(r))||this._isAnyDateField(r)?Ve({values:t,returnDistinct:s}):Pe({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(r,l),l[n==="var"?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:r}=e,{value:n,orderBy:l}=s,o=this.fieldsIndex.get(i);return di(t,{value:n,orderBy:l,fieldType:o==null?void 0:o.type,isDiscrete:r==="percentile_disc"})}_getAttributeValues(e,t,i){if(i.has(t))return i.get(t);const s=this.fieldsIndex.get(t),r=this.items.map(n=>e.getFieldValue(n,t,s));return i.set(t,r),r}_calculateUniqueValues(e,t){const i={},s=this.items,r=s.length;for(let n=0;nM(i,be));return(await bi())(n.spatialReference,n,e,r)}async function bi(){return(await ge(()=>import("./geometryEngineJSON-FxYgI0L3.js").then(a=>a.g),__vite__mapDeps([0,1,2,3]))).geodesicBuffer}function Ai(a){return a==="mesh"?Vt:Pt(a)}function lt(a,e){return a?e?4:3:e?3:2}function Ei(a,e,t,i){return ot(a,e,t,i.coords[0],i.coords[1])}function Mi(a,e,t,i,s,r){const n=lt(s,r),{coords:l,lengths:o}=i;if(!o)return!1;for(let u=0,c=0;u=n||p=n)&&h+(n-d)/(p-d)*(m-h)import("./geometryEngineJSON-FxYgI0L3.js").then(a=>a.g),__vite__mapDeps([0,1,2,3]))}function B(a,e,t,i,s){if(H(e)&&t==="esriGeometryPoint"&&(a==="esriSpatialRelIntersects"||a==="esriSpatialRelContains")){const r=Ae(new L,e,!1,!1);return Promise.resolve(n=>Ei(r,!1,!1,n))}if(H(e)&&t==="esriGeometryMultipoint"){const r=Ae(new L,e,!1,!1);if(a==="esriSpatialRelContains")return Promise.resolve(n=>Mi(r,!1,!1,n,i,s))}if(Q(e)&&t==="esriGeometryPoint"&&(a==="esriSpatialRelIntersects"||a==="esriSpatialRelContains"))return Promise.resolve(r=>Ct(e,q(t,i,s,r)));if(Q(e)&&t==="esriGeometryMultipoint"&&a==="esriSpatialRelContains")return Promise.resolve(r=>Nt(e,q(t,i,s,r)));if(Q(e)&&a==="esriSpatialRelIntersects"){const r=Ai(t);return Promise.resolve(n=>r(e,q(t,i,s,n)))}return zi().then(r=>{const n=r[Vi[a]].bind(null,e.spatialReference,e);return l=>n(q(t,i,s,l))})}async function ut(a,e,t){var r;const{spatialRel:i,geometry:s}=a;if(s){if(!Pi(i))throw new T(le,"Unsupported query spatial relationship",{query:a});if(G(s.spatialReference)&&G(t)){if(!Ci(s))throw new T(le,"Unsupported query geometry type",{query:a});if(!Ni(e))throw new T(le,"Unsupported layer geometry type",{query:a});if(a.outSR)return Z((r=a.geometry)==null?void 0:r.spatialReference,a.outSR)}}}function Ze(a){if(Q(a))return!0;if(H(a)){for(const e of a.rings)if(e.length!==5||e[0][0]!==e[1][0]||e[0][0]!==e[4][0]||e[2][0]!==e[3][0]||e[0][1]!==e[3][1]||e[0][1]!==e[4][1]||e[1][1]!==e[2][1])return!1;return!0}return!1}const O="unsupported-query";async function je(a,{fieldsIndex:e,geometryType:t,spatialReference:i,availableFields:s}){if((a.distance??0)<0||a.geometryPrecision!=null||a.multipatchOption&&a.multipatchOption!=="xyFootprint"||a.pixelSize||a.relationParam||a.text)throw new T(O,"Unsupported query options",{query:a});return ct(e,s,a),Gi(e,s,a),Promise.all([ut(a,t,i),Z(i,a.outSR)]).then(()=>a)}function ct(a,e,t){const{outFields:i,orderByFields:s,returnDistinctValues:r,outStatistics:n}=t,l=n?n.map(o=>o.outStatisticFieldName&&o.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(s&&s.length>0){const o=" asc",u=" desc",c=s.map(h=>{const d=h.toLowerCase();return d.includes(o)?d.split(o)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!l.includes(h));N(a,e,c,{expressionName:"orderByFields",query:t})}if(i&&i.length>0)N(a,e,i,{expressionName:"outFields",query:t});else if(r)throw new T(O,"outFields should be specified for returnDistinctValues",{query:t});gi(a,e,t.where,t)}const Qi=new Set([...Ke,...Xe]);function Gi(a,e,t){const{outStatistics:i,groupByFieldsForStatistics:s,having:r}=t,n=s==null?void 0:s.length,l=i==null?void 0:i.length;if(r){if(!n||!l)throw new T(O,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});xi(a,e,r,i,t)}if(l){if(!Zi(i))return;const o=i.map(u=>u.onStatisticField).filter(Boolean);N(a,e,o,{expressionName:"onStatisticFields",query:t}),n&&N(a,e,s,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of i){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new T(O,"statisticParameters should be set for percentile type",{definition:u,query:t})}else a.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&N(a,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qi,query:t})}}}async function Di(a,e,{fieldsIndex:t,geometryType:i,spatialReference:s,availableFields:r}){if((a.distance??0)<0||a.geometryPrecision!=null||a.multipatchOption||a.pixelSize||a.relationParam||a.text||a.outStatistics||a.groupByFieldsForStatistics||a.having||a.orderByFields)throw new T(O,"Unsupported query options",{query:a});return ct(t,r,a),Promise.all([Oi(t,r,e,a),ut(a,i,s),Z(s,a.outSR)]).then(()=>a)}async function Oi(a,e,t,i){let s=[];if(t.valueExpression){const{arcadeUtils:r}=await Le();s=r.extractFieldNames(t.valueExpression)}if(t.field&&s.push(t.field),t.field2&&s.push(t.field2),t.field3&&s.push(t.field3),t.normalizationField&&s.push(t.normalizationField),!s.length&&!t.valueExpression)throw new T(O,"field or valueExpression is required",{params:t});N(a,e,s,{expressionName:"statistics",query:i})}function Zi(a){return a!=null&&a.every(e=>e.statisticType!=="exceedslimit")}async function ji(a,e){if(!a)return null;const t=e.featureAdapter,{startTimeField:i,endTimeField:s}=a;let r=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(i&&s)await e.forEach(l=>{const o=t.getAttribute(l,i),u=t.getAttribute(l,s);o==null||isNaN(o)||(r=Math.min(r,o)),u==null||isNaN(u)||(n=Math.max(n,u))});else{const l=i||s;await e.forEach(o=>{const u=t.getAttribute(o,l);u==null||isNaN(u)||(r=Math.min(r,u),n=Math.max(n,u))})}return{start:r,end:n}}function Bi(a,e,t){var o;if(!e||!a)return null;const{startTimeField:i,endTimeField:s}=a;if(!i&&!s)return null;const{start:r,end:n}=e;if(r===null&&n===null)return null;if(r===void 0&&n===void 0)return Li();const l=((o=t.getAttributeAsTimestamp)==null?void 0:o.bind(t))??t.getAttribute.bind(t);return i&&s?Ui(l,i,s,r,n):ki(l,i||s,r,n)}function Ui(a,e,t,i,s){return i!=null&&s!=null?r=>{const n=a(r,e),l=a(r,t);return(n==null||n<=s)&&(l==null||l>=i)}:i!=null?r=>{const n=a(r,t);return n==null||n>=i}:s!=null?r=>{const n=a(r,e);return n==null||n<=s}:void 0}function ki(a,e,t,i){return t!=null&&i!=null&&t===i?s=>a(s,e)===t:t!=null&&i!=null?s=>{const r=a(s,e);return r!=null&&r>=t&&r<=i}:t!=null?s=>{const r=a(s,e);return r!=null&&r>=t}:i!=null?s=>{const r=a(s,e);return r!=null&&r<=i}:void 0}function Li(){return()=>!1}const Hi="unsupported-query",Ji=new Qt(2e6);let Yi=0;class rs{constructor(e){this._geometryQueryCache=null,this._changeHandle=null,this.capabilities={query:ti},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new Gt(Yi+++"$$",Ji)),this.fieldsIndex=Dt(e.fieldsIndex)?e.fieldsIndex:Ot.fromJSON(e.fieldsIndex),this.availableFields=e.availableFields==null?new Set(this.fieldsIndex.fields.map(t=>t.name)):new Set(e.availableFields.map(t=>{var i;return(i=this.fieldsIndex.get(t))==null?void 0:i.name}).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=Ee(this._frameTask),this.clearCache(),Zt(this._geometryQueryCache),this._changeHandle=Ee(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){var e;(e=this._geometryQueryCache)==null||e.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(i){if(i!==C)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(i){if(i!==C)throw i;return 0}}async executeQueryForExtent(e,t){const i=e.outSR;try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=s.size;return r?{count:r,extent:await this._getBounds(s.items,s.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(s){if(s===C)return{count:0,extent:null};throw s}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(i=>Array.from(i))}async executeQueryForIdSet(e,t){try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),s=i.items,r=new Set;return await this._reschedule(()=>{for(const n of s)r.add(i.featureAdapter.getObjectId(n))},t),r}catch(i){if(i===C)return new Set;throw i}}async executeQueryForSnapping(e,t){const{point:i,distance:s,returnEdge:r,vertexMode:n}=e;if(!r&&n==="none")return{candidates:[]};let l=ee(e.query);l=await this._schedule(()=>rt(l,this.definitionExpression,this.spatialReference),t),l=await this._reschedule(()=>je(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),t);const o=!b(i.spatialReference,this.spatialReference);o&&await Z(i.spatialReference,this.spatialReference);const u=typeof s=="number"?s:s.x,c=typeof s=="number"?s:s.y,h={xmin:i.x-u,xmax:i.x+u,ymin:i.y-c,ymax:i.y+c,spatialReference:i.spatialReference},d=o?M(h,this.spatialReference):h;if(!d)return{candidates:[]};const m=(await fe(me(i),null,{signal:t}))[0],p=(await fe(me(d),null,{signal:t}))[0];if(m==null||p==null)return{candidates:[]};const f=new v(await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(p.toJSON())),t),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(f),t),await this._reschedule(()=>this._executeTimeQuery(f),t),await this._reschedule(()=>this._executeAttributesQuery(f),t),await this._reschedule(()=>this._executeGeometryQueryForSnapping(f,t),t);const F=m.toJSON(),_=o?M(F,this.spatialReference):F,w=o?Math.max(d.xmax-d.xmin,d.ymax-d.ymin)/2:s;return f.createSnappingResponse({...e,point:_,distance:w},i.spatialReference)}async executeQueryForLatestObservations(e,t){var i;if(!((i=this.timeInfo)!=null&&i.trackIdField))throw new T(Hi,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},t);return await this._reschedule(()=>this._filterLatest(s),t),s.createQueryResponse()}catch(s){if(s!==C)throw s;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,i){const{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,i){const{field:s,field2:r,field3:n,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:s,field2:r,field3:n,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,i){const{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,i){const{field:s,normalizationField:r,valueExpression:n}=t;return(await this._executeQueryForStatistics(e,{field:s,normalizationField:r,valueExpression:n},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){this._timeExtentPromise||(this._timeExtentPromise=ji(this.timeInfo,this.featureStore));const[t,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return jt(e),{fullExtent:t,timeExtent:i}}async _getBounds(e,t,i){const s=Bt(kt(),Ut);await this.featureStore.forEachBounds(e,l=>Lt(s,l));const r={xmin:s[0],ymin:s[1],xmax:s[3],ymax:s[4],spatialReference:U(this.spatialReference)};this.hasZ&&isFinite(s[2])&&isFinite(s[5])&&(r.zmin=s[2],r.zmax=s[5]);const n=M(r,t,i);if(n.spatialReference=U(i),n.xmax-n.xmin==0){const l=ae(n.spatialReference);n.xmin-=l,n.xmax+=l}if(n.ymax-n.ymin==0){const l=ae(n.spatialReference);n.ymin-=l,n.ymax+=l}if(this.hasZ&&n.zmin!=null&&n.zmax!=null&&n.zmax-n.zmin==0){const l=ae(n.spatialReference);n.zmin-=l,n.zmax+=l}return n}_getFullExtent(){return this._fullExtentPromise||(this._fullExtentPromise="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference))),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Me)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Me)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const i=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(s=>i.push(s))})().then(()=>i)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,i){e=ee(e),e=await this._schedule(()=>Oe(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>je(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i),e={...e,...t};const s=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),r=await this._reschedule(()=>this._executeGeometryQuery(e,s,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),i),await this._reschedule(()=>this._executeObjectIdsQuery(r),i),await this._reschedule(()=>this._executeTimeQuery(r),i),await this._reschedule(()=>this._executeAttributesQuery(r),i),r}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:i,returnGeometry:s,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,l=e.sceneFilter.geometry,o=n==null||b(n,l.spatialReference)?l:M(l,n);if(!o)return null;const u=s||r,c=G(i)&&!b(this.spatialReference,i)&&u?async f=>this._project(f,i):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(o)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const w of d)f.add(h.getObjectId(w));const F=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const w=await B("esriSpatialRelDisjoint",o,this.geometryType,this.hasZ,this.hasM),I=x=>!f.has(h.getObjectId(x))||w(h.getGeometry(x)),g=await this._runSpatialFilter(F,I,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(o,e))return c(new v(d,e,this));const m=await B("esriSpatialRelContains",o,this.geometryType,this.hasZ,this.hasM),p=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(p,e,this))}async _executeGeometryQuery(e,t,i){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:s,outSR:r,spatialRel:n,returnGeometry:l,returnCentroid:o}=e,u=this.featureStore.featureSpatialReference,c=!s||u==null||b(u,s.spatialReference)?s:M(s,u),h=l||o,d=G(r)&&!b(this.spatialReference,r),m=this._geometryQueryCache&&t==null?JSON.stringify(d&&h?{originalFilterGeometry:s,spatialRelationship:n,outSpatialReference:r}:{originalFilterGeometry:s,spatialRelationship:n}):null,p=m?this._geometryQueryCache.get(m):null;if(p!=null)return new v(p,e,this);const f=async g=>(d&&h&&await this._project(g,r),m&&this._geometryQueryCache.put(m,g.items,g.items.length+1),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const F=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(this._getQueryBBoxes(s)),i);if(n==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const S of _)g.add(F.getObjectId(S));const x=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),i),y=await this._reschedule(async()=>{const S=await B(n,c,this.geometryType,this.hasZ,this.hasM),R=A=>!g.has(F.getObjectId(A))||S(F.getGeometry(A)),$=await this._runSpatialFilter(x,R,i);return new v($,e,this)},i);return f(y)}if(t!=null){const g=new Xt;_=_.filter(x=>Ht(t.items,x,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._geometryQueryCache.put(m,g.items,1),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const w=await B(n,c,this.geometryType,this.hasZ,this.hasM),I=await this._runSpatialFilter(_,g=>w(F.getGeometry(g)),i);return f(new v(I,e,this))}async _executeGeometryQueryForSnapping(e,t){var l;const{query:i}=e,{spatialRel:s}=i;if(!((l=e==null?void 0:e.items)!=null&&l.length)||!i.geometry||!s)return;const r=await B(s,i.geometry,this.geometryType,this.hasZ,this.hasM),n=await this._runSpatialFilter(e.items,o=>r(o.geometry),t);e.items=n}_executeAggregateIdsQuery(e){var s;if(e.items.length===0||!((s=e.query.aggregateIds)!=null&&s.length)||this.aggregateAdapter==null)return;const t=new Set;for(const r of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(r).forEach(n=>t.add(n));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(r=>t.has(i(r)))}_executeObjectIdsQuery(e){var s;if(e.items.length===0||!((s=e.query.objectIds)!=null&&s.length))return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(r=>t.has(i(r)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=Bi(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=z(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(i=>t.testFeature(i,this.featureAdapter))}}async _runSpatialFilter(e,t,i){if(!t)return e;if(this._frameTask==null)return e.filter(l=>t(l));let s=0;const r=new Array,n=async l=>{for(;sn(u),i)}};return this._reschedule(l=>n(l),i).then(()=>r)}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:s}=this.timeInfo,r=s||i,n=new Map,l=this.featureAdapter.getAttribute;for(const o of e.items){const u=l(o,t),c=l(o,r),h=n.get(u);(!h||c>l(h,r))&&n.set(u,o)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return Ze(e)&&(i==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(i==="esriSpatialRelIntersects"||i==="esriSpatialRelContains"))}async _project(e,t){if(!t||b(this.spatialReference,t))return e;const i=this.featureAdapter;let s;try{const n=await this._getFullExtent();s=Jt(this.spatialReference,t,n)}catch{}const r=await Ri(e.items.map(n=>q(this.geometryType,this.hasZ,this.hasM,i.getGeometry(n))),this.spatialReference,t,s);return e.items=r.map((n,l)=>i.cloneWithGeometry(e.items[l],Yt(n,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(Ze(e)){if(Q(e))return[qe(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if(H(e))return e.rings.map(t=>qe(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[Wt(Kt(),e)]}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(s=>this.featureStore.forEachInBounds(s,r=>t.add(r))));const i=Array.from(t.values());return t.clear(),i}async _executeQueryForStatistics(e,t,i){e=ee(e);try{e=await this._schedule(()=>Oe(e,this.definitionExpression,this.spatialReference),i),e=await this._reschedule(()=>Di(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),i);const s=await this._reschedule(()=>this._executeSceneFilterQuery(e,i),i),r=await this._reschedule(()=>this._executeGeometryQuery(e,s,i),i);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),i),await this._reschedule(()=>this._executeObjectIdsQuery(r),i),await this._reschedule(()=>this._executeTimeQuery(r),i),await this._reschedule(()=>this._executeAttributesQuery(r),i),r}catch(s){if(s!==C)throw s;return new v([],e,this)}}}export{rs as W,rt as a,U as h,M as j,Bi as t,B as v,Z as x}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-FxYgI0L3.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/json-v6EOeNTY.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/QueryEngineCapabilities-PzVpW5yD.js b/dist/assets/QueryEngineCapabilities-PzVpW5yD.js new file mode 100644 index 0000000..68f84d8 --- /dev/null +++ b/dist/assets/QueryEngineCapabilities-PzVpW5yD.js @@ -0,0 +1 @@ +const t={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0};export{t}; diff --git a/dist/assets/QueryTask-91TvtrTt.js b/dist/assets/QueryTask-91TvtrTt.js new file mode 100644 index 0000000..3f6ebca --- /dev/null +++ b/dist/assets/QueryTask-91TvtrTt.js @@ -0,0 +1,7 @@ +import{dZ as y,ca as _,dT as v,e as a,y as c,iY as D,c as A,p as w,bV as Q,dJ as P,gG as d,de as n,bO as f,bP as h,E as j}from"./index-J0iiHjMT.js";import{n as q,s as L}from"./executeForIds-wXO8-pll.js";import{x as z}from"./query-rG0aX6cE.js";import{a as J}from"./executeQueryJSON-ACj9qY0y.js";import{n as $}from"./executeQueryPBF-vdaOUMid.js";import{d as N}from"./FeatureSet-d4S1oKME.js";async function C(e,t,r){const o=y(e);return z(o,_.from(t),{...r}).then(i=>({count:i.data.count,extent:v.fromJSON(i.data.extent)}))}let s=class extends w{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return Q(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){var u;const r=this._normalizeQuery(e),o=((u=e.outStatistics)==null?void 0:u[0])!=null,i=P("featurelayer-pbf-statistics"),l=!o||i;let p;if(this.pbfSupported&&l)try{p=await $(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&l||(p=await J(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return N.fromJSON(t);const{meshFeatureSetFromJSON:o}=await d(n(()=>import("./meshFeatureSet-Mcou8mDC.js"),__vite__mapDeps([0,1,2,3,4])),r);return o(e,this.infoFor3D,t)}executeForCount(e,t){return q(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return C(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return L(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:o}]=await d(Promise.all([n(()=>import("./index-J0iiHjMT.js").then(i=>i.zE),__vite__mapDeps([1,2])),n(()=>import("./executeRelationshipQuery-A9rcFpIX.js"),__vite__mapDeps([5,1,2,6,7,8,9,4]))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:o}]=await d(Promise.all([n(()=>import("./index-J0iiHjMT.js").then(i=>i.zE),__vite__mapDeps([1,2])),n(()=>import("./executeRelationshipQuery-A9rcFpIX.js"),__vite__mapDeps([5,1,2,6,7,8,9,4]))]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),o(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:o,processAttachmentQueryResult:i}=await d(n(()=>import("./queryAttachments-2yka8D_T.js"),__vite__mapDeps([10,1,2,6,7,8,9,11])),t),l=y(this.url);return i(l,await(this.queryAttachmentsSupported?r(l,e,t):o(l,e,t)))}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await d(n(()=>import("./executeTopFeaturesQuery-se6h6fh4.js"),__vite__mapDeps([12,1,2,13,6,7,8,9,4,14])),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await d(n(()=>import("./executeForTopIds-kKHpaQVu.js"),__vite__mapDeps([15,1,2,13,6,7,8,9,14])),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await d(n(()=>import("./executeForTopExtents--je_5dPa.js"),__vite__mapDeps([16,1,2,13,6,7,8,9,14])),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await d(n(()=>import("./executeForTopCount-bR-K9CPn.js"),__vite__mapDeps([17,1,2,13,6,7,8,9,14])),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?D.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:o,queryFormats:i}=r,l=f("model/gltf-binary",o)??h("glb",o),p=f("model/gltf+json",o)??h("gtlf",o);for(const u of i){if(u===l){t.formatOf3DObjects=u;break}u!==p||t.formatOf3DObjects||(t.formatOf3DObjects=u)}if(!t.formatOf3DObjects)throw new j("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:u,originY:m,originZ:S,translationX:b,translationY:F,translationZ:O,scaleX:x,scaleY:g,scaleZ:E,rotationX:V,rotationY:R,rotationZ:I,rotationDeg:T}=r.transformFieldRoles;t.outFields.push(u,m,S,b,F,O,x,g,E,V,R,I,T)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};a([c({type:D})],s.prototype,"dynamicDataSource",void 0),a([c()],s.prototype,"fieldsIndex",void 0),a([c()],s.prototype,"gdbVersion",void 0),a([c()],s.prototype,"infoFor3D",void 0),a([c({readOnly:!0})],s.prototype,"parsedUrl",null),a([c()],s.prototype,"pbfSupported",void 0),a([c()],s.prototype,"queryAttachmentsSupported",void 0),a([c()],s.prototype,"sourceSpatialReference",void 0),a([c({type:String})],s.prototype,"url",void 0),s=a([A("esri.tasks.QueryTask")],s);const K=s;export{K as x}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/meshFeatureSet-Mcou8mDC.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/External-GV0jSEES.js","assets/FeatureSet-d4S1oKME.js","assets/executeRelationshipQuery-A9rcFpIX.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/queryZScale-IaMm02_2.js","assets/queryAttachments-2yka8D_T.js","assets/AttachmentInfo-kbEMEIl0.js","assets/executeTopFeaturesQuery-se6h6fh4.js","assets/queryTopFeatures-L2nDK2pi.js","assets/TopFeaturesQuery-E6D2tV-x.js","assets/executeForTopIds-kKHpaQVu.js","assets/executeForTopExtents--je_5dPa.js","assets/executeForTopCount-bR-K9CPn.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/RasterWorker-0s4_fI9v.js b/dist/assets/RasterWorker-0s4_fI9v.js new file mode 100644 index 0000000..edb5409 --- /dev/null +++ b/dist/assets/RasterWorker-0s4_fI9v.js @@ -0,0 +1 @@ +import{dT as a,T as l,gt as c}from"./index-J0iiHjMT.js";import{u as i,f as m,m as f,j as u,L as p,h as S,W as d,U as x,R as y,I as h,a as O,s as N}from"./dataUtils-s_UKlouc.js";import{R as J,i as g}from"./utils-4xKNo3Tf.js";import{M as P,T as b,e as B}from"./rasterProjectionHelper-KvYWHIT_.js";class T{convertVectorFieldData(e){const t=i.fromJSON(e.pixelBlock),s=m(t,e.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(e){const t=i.fromJSON(e.pixelBlock),s=f(t);return Promise.resolve(s)}async decode(e){const t=await u(e.data,e.options);return t&&t.toJSON()}symbolize(e){e.pixelBlock=i.fromJSON(e.pixelBlock),e.extent=e.extent?a.fromJSON(e.extent):null;const t=this.symbolizer.symbolize(e);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(e){var t;this.symbolizer=p.fromJSON(e.symbolizerJSON),e.histograms&&((t=this.symbolizer)==null?void 0:t.rendererJSON.type)==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=J(e.rasterFunctionJSON)}async process(e){var s;const t=this.rasterFunction.process({extent:a.fromJSON(e.extent),primaryPixelBlocks:e.primaryPixelBlocks.map(o=>o!=null?i.fromJSON(o):null),primaryPixelSizes:(s=e.primaryPixelSizes)==null?void 0:s.map(o=>o!=null?l.fromJSON(o):null),primaryRasterIds:e.primaryRasterIds});return t!=null?t.toJSON():null}stretch(e){const t=this.symbolizer.simpleStretch(i.fromJSON(e.srcPixelBlock),e.stretchParams);return Promise.resolve(t==null?void 0:t.toJSON())}estimateStatisticsHistograms(e){const t=S(i.fromJSON(e.srcPixelBlock));return Promise.resolve(t)}split(e){const t=d(i.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel);return t&&t.forEach((s,o)=>{t.set(o,s==null?void 0:s.toJSON())}),Promise.resolve(t)}async mosaicAndTransform(e){const t=e.srcPixelBlocks.map(n=>n?new i(n):null),s=x(t,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let o,r=s;return e.coefs&&(r=y(s,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(o=h(e.destDimension,e.gcsGrid),r=O(r,e.isUV?"vector-uv":"vector-magdir",o)),{pixelBlock:r==null?void 0:r.toJSON(),localNorthDirections:o}}async createFlowMesh(e,t){const s={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:o,indexData:r}=await N(e.meshType,e.simulationSettings,s,t.signal);return{result:{vertexBuffer:o.buffer,indexBuffer:r.buffer},transferList:[o.buffer,r.buffer]}}async getProjectionOffsetGrid(e){const t=a.fromJSON(e.projectedExtent),s=a.fromJSON(e.srcBufferExtent);let o=null;e.datumTransformationSteps&&(o=new c({steps:e.datumTransformationSteps})),(e.includeGCSGrid||P(t.spatialReference,s.spatialReference,o))&&await b();const r=e.rasterTransform?g(e.rasterTransform):null;return B({...e,projectedExtent:t,srcBufferExtent:s,datumTransformation:o,rasterTransform:r})}}export{T as default}; diff --git a/dist/assets/ReactiveSet-HLstcUcf.js b/dist/assets/ReactiveSet-HLstcUcf.js new file mode 100644 index 0000000..5b2a476 --- /dev/null +++ b/dist/assets/ReactiveSet-HLstcUcf.js @@ -0,0 +1 @@ +import{fg as h,fh as t}from"./index-J0iiHjMT.js";class b{constructor(){this._set=new Set,this._observable=new h}get size(){return t(this._observable),this._set.size}add(e){const s=this._set.size;return this._set.add(e),this._set.size!==s&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(e){const s=this._set.delete(e);return s&&this._observable.notify(),s}entries(){return t(this._observable),this._set.entries()}forEach(e,s){t(this._observable),this._set.forEach((r,i)=>e.call(s,r,i,this),s)}has(e){return t(this._observable),this._set.has(e)}keys(){return t(this._observable),this._set.keys()}values(){return t(this._observable),this._set.values()}[Symbol.iterator](){return t(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{b as s}; diff --git a/dist/assets/Rect-bBBxMtVp.js b/dist/assets/Rect-bBBxMtVp.js new file mode 100644 index 0000000..5b2b3d6 --- /dev/null +++ b/dist/assets/Rect-bBBxMtVp.js @@ -0,0 +1 @@ +class a{constructor(h=0,t=0,i=0,s=0){this.x=h,this.y=t,this.width=i,this.height=s}get isEmpty(){return this.width<=0||this.height<=0}union(h){this.x=Math.min(this.x,h.x),this.y=Math.min(this.y,h.y),this.width=Math.max(this.width,h.width),this.height=Math.max(this.height,h.height)}}export{a as t}; diff --git a/dist/assets/RefreshableLayerView-Pd4dLcWr.js b/dist/assets/RefreshableLayerView-Pd4dLcWr.js new file mode 100644 index 0000000..de2689d --- /dev/null +++ b/dist/assets/RefreshableLayerView-Pd4dLcWr.js @@ -0,0 +1 @@ +import{e as s,y as i,c as h,fl as l,f as o,Z as d}from"./index-J0iiHjMT.js";const n=a=>{let e=class extends a{initialize(){this.addHandles(l(()=>this.layer,"refresh",t=>{this.doRefresh(t.dataChanged).catch(r=>{o(r)||d.getLogger(this).error(r)})}),"RefreshableLayerView")}};return s([i()],e.prototype,"layer",void 0),e=s([h("esri.layers.mixins.RefreshableLayerView")],e),e};export{n as a}; diff --git a/dist/assets/Reshape-J0NI6bzM.js b/dist/assets/Reshape-J0NI6bzM.js new file mode 100644 index 0000000..ab32dd9 --- /dev/null +++ b/dist/assets/Reshape-J0NI6bzM.js @@ -0,0 +1 @@ +import{J as G,K as z,V as E,L as $,F as U,U as M,d as k,n as S,M as L,N as D,O as P,Q as K,a as I,R as b,S as f,T as x,W as O,b as N,X as J,Y as T,I as C,Z as Q,E as W,e as m,y,_ as X,$ as Y,A as Z,P as q,c as B}from"./index-J0iiHjMT.js";import{S as j}from"./SnappingVisualizer2D-NnEm1PvQ.js";import{i as tt}from"./drawUtils-woTYaREB.js";import{l as et,U as it}from"./GraphicMover-DhG5Ib7v.js";import{d as st}from"./settings-YeKUIkGh.js";import{V as ot}from"./EditGeometryOperations-TPE5Wzab.js";import{e as rt}from"./SnappingContext-6K6JmvvY.js";import{m as R,g as nt,u as at}from"./Tooltip-ON77BKb3.js";import{r as ht,p as pt}from"./TranslateTooltipInfos-J6BygtUO.js";import{u as ct}from"./automaticAreaMeasurementUtils-nVd6Y5mX.js";import"./featureUtils-itZGjo5c.js";import"./GraphicManipulator-ku6oRBpa.js";import"./drapedUtils-9db1OpTX.js";import"./PointSnappingHint-ULetRXiW.js";import"./euclideanLengthMeasurementUtils-VQw5qWk6.js";import"./measurementUtils-84-ZBArh.js";import"./quantityFormatUtils-NiAiojad.js";import"./euclideanAreaMeasurementUtils-zmzttSyV.js";class lt{constructor(e,i,s){this.graphic=e,this.mover=i,this.selected=s,this.type="reshape-start"}}class dt{constructor(e,i,s){this.graphic=e,this.mover=i,this.selected=s,this.type="reshape"}}class vt{constructor(e,i,s){this.graphic=e,this.mover=i,this.selected=s,this.type="reshape-stop"}}class mt{constructor(e,i,s){this.mover=e,this.dx=i,this.dy=s,this.type="move-start"}}class yt{constructor(e,i,s){this.mover=e,this.dx=i,this.dy=s,this.type="move"}}class _t{constructor(e,i,s){this.mover=e,this.dx=i,this.dy=s,this.type="move-stop"}}class gt{constructor(e){this.added=e,this.type="vertex-select"}}class ut{constructor(e){this.removed=e,this.type="vertex-deselect"}}class xt{constructor(e,i,s,o){this.added=e,this.graphic=i,this.oldGraphic=s,this.vertices=o,this.type="vertex-add"}}class ft{constructor(e,i,s,o){this.removed=e,this.graphic=i,this.oldGraphic=s,this.vertices=o,this.type="vertex-remove"}}const g=st.reshapeGraphics,Gt={vertices:{default:new G({style:"circle",size:g.vertex.size,color:g.vertex.color,outline:{color:g.vertex.outlineColor,width:1}}),hover:new G({style:"circle",size:g.vertex.hoverSize,color:g.vertex.hoverColor,outline:{color:g.vertex.hoverOutlineColor,width:1}}),selected:new G({style:"circle",size:g.selected.size,color:g.selected.color,outline:{color:g.selected.outlineColor,width:1}})},midpoints:{default:new G({style:"circle",size:g.midpoint.size,color:g.midpoint.color,outline:{color:g.midpoint.outlineColor,width:1}}),hover:new G({style:"circle",size:g.midpoint.size,color:g.midpoint.color,outline:{color:g.midpoint.outlineColor,width:1}})}};let d=class extends z.EventedAccessor{constructor(t){super(t),this._activeOperationInfo=null,this._editGeometryOperations=null,this._graphicAttributes={esriSketchTool:"box"},this._mover=null,this._snappingContext=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._tooltip=null,this._translateGraphicTooltipInfo=null,this._translateVertexTooltipInfo=null,this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.enableMidpoints=!0,this.enableMovement=!0,this.enableVertices=!0,this.graphic=null,this.layer=null,this.midpointGraphics=new E,this.midpointSymbol=new G({style:"circle",size:6,color:[200,200,200],outline:{color:[100,100,100],width:1}}),this.selectedVertices=[],this.snappingManager=null,this.symbols=Gt,this.tooltipOptions=new $,this.type="reshape",this.vertexGraphics=new E,this.view=null}initialize(){const t=this.view;this._highlightHelper=new et({view:t}),this._setup(),this.addHandles([U(()=>t==null?void 0:t.ready,()=>{const{layer:e,view:i}=this;X(i,e),this.addHandles(i.on("key-down",s=>this._keyDownHandler(s),Y.TOOL))},{once:!0,initial:!0}),M(()=>this.graphic,()=>this.refresh()),M(()=>this.layer,(e,i)=>{i&&(this._clearSelection(),this._resetGraphics(i)),this.refresh()}),M(()=>this.enableMidpoints,()=>this.refresh()),k(()=>this.tooltipOptions.enabled,e=>{this._tooltip=e?new at({view:this.view}):S(this._tooltip)},Z),k(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),q)])}destroy(){var t;this._reset(),(t=this._mover)==null||t.destroy(),this._mover=null,this._tooltip=S(this._tooltip)}set highlightsEnabled(t){var e;(e=this._highlightHelper)==null||e.removeAll(),this._set("highlightsEnabled",t),this._setUpHighlights()}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}isUIGraphic(t){const e=[];return this.graphic&&e.push(this.graphic),e.concat(this.vertexGraphics.items,this.midpointGraphics.items),e.length>0&&e.includes(t)}refresh(){this._reset(),this._setup()}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_setup(){const{graphic:t,layer:e}=this;if(!e||(t==null?void 0:t.geometry)==null)return;const i=t.geometry;i.type!=="mesh"&&i.type!=="extent"?(i.type==="polygon"&&L(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover()):this._logGeometryTypeError()}_setUpHighlights(){var t;this.highlightsEnabled&&this.graphic&&((t=this._highlightHelper)==null||t.add(this.graphic))}_setUpGeometryHelper(){const t=this.graphic.geometry;if(t==null||t.type==="mesh"||t.type==="extent")return void this._logGeometryTypeError();const e=t.type==="multipoint"?new D({paths:t.points,spatialReference:t.spatialReference}):t;this._editGeometryOperations=ot.fromGeometry(e,P.Local)}_saveSnappingContextForHandle(t,e){var i;this._snappingGraphicsLayer=new K({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer),this._snappingContext=new rt({editGeometryOperations:this._editGeometryOperations,elevationInfo:{mode:"on-the-ground",offset:0},pointer:((i=e.viewEvent)==null?void 0:i.pointerType)||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new j(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){var t;this._clearSelection(),(t=this._highlightHelper)==null||t.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._activeOperationInfo=null,this._mover&&this._mover.destroy(),this._mover=null,this.view.cursor="default"}_resetSnappingStateVars(){var t;this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._snappingGraphicsLayer!=null&&((t=this.view)!=null&&t.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._editGeometryOperations=S(this._editGeometryOperations),this._snappingTask=I(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._set("selectedVertices",[])}_removeMidpointGraphics(t){const e=t||this.layer;e&&e.removeMany(this.midpointGraphics.items),this.midpointGraphics.items.forEach(i=>i.destroy()),this.midpointGraphics.removeAll()}_removeVertexGraphics(t){const e=t||this.layer;e&&e.removeMany(this.vertexGraphics.items),this.vertexGraphics.items.forEach(i=>i.destroy()),this.vertexGraphics.removeAll()}_getCoordinatesForUI(t){const e=b(t.clone());if(t.type==="polygon")for(const i of e){const s=i[i.length-1];i[0][0]===s[0]&&i[0][1]===s[1]&&i.length>2&&i.pop()}return e}_setupGraphics(){const t=this.graphic.geometry;if(t!=null&&(t.type==="polyline"||t.type==="polygon")){const e=this._getCoordinatesForUI(t);this.enableMidpoints&&this._setUpMidpointGraphics(e),this.enableVertices&&this._setUpVertexGraphics(e)}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=this._createMidpointGraphics(t);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){this._removeVertexGraphics();const e=this._createVertexGraphics(t);this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}_createVertexGraphics(t){const{_graphicAttributes:e,symbols:i,view:{spatialReference:s}}=this,o=[];return t==null||t.forEach((n,r)=>{n.forEach((h,p)=>{var v;const[a,c,l]=h;o.push(new f({geometry:new x({x:a,y:c,z:l,spatialReference:s}),symbol:(v=i==null?void 0:i.vertices)==null?void 0:v.default,attributes:{...e,pathIndex:r,pointIndex:p}}))})}),o}_createMidpointGraphics(t){const{_graphicAttributes:e,symbols:i,view:{spatialReference:s}}=this,o=[];return t==null||t.forEach((n,r)=>{n.forEach((h,p)=>{var _;const[a,c,l]=h,v=n[p+1]?p+1:0;if(((_=this.graphic.geometry)==null?void 0:_.type)==="polygon"||v!==0){const[u,V,w]=n[v],[H,A,F]=O([a,c,l],[u,V,w]);o.push(new f({geometry:new x({x:H,y:A,z:F,spatialReference:s}),symbol:i.midpoints.default,attributes:{...e,pathIndex:r,pointIndexStart:p,pointIndexEnd:v}}))}})}),o}_updateSymbolsForTheme(){var e;const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:(e=this.symbols.vertices.hover)==null?void 0:e.clone().set("color",t)},midpoints:{...this.symbols.midpoints}};for(const i of this.vertexGraphics)this._isSelected(i)?i.symbol=this.symbols.vertices.selected:this._hoverGraphic===i?i.symbol=this.symbols.vertices.hover:i.symbol=this.symbols.vertices.default}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:i})=>({x:i.x,y:i.y}));for(let i=0;ithis._onGraphicClickCallback(r),onGraphicMoveStart:r=>this._onGraphicMoveStartCallback(r),onGraphicMove:r=>this._onGraphicMoveCallback(r),onGraphicMoveStop:r=>this._onGraphicMoveStopCallback(r),onGraphicPointerOver:r=>this._onGraphicPointerOverCallback(r),onGraphicPointerOut:r=>this._onGraphicPointerOutCallback(r)}})}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic;if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick&&this.callbacks.onGraphicClick(t);else if(this._isMidpoint(e)){if(t.viewEvent.button===2)return;const i=this.graphic.clone(),s=this._createVertexFromMidpoint(e);this.refresh(),this._emitVertexAddEvent([e],i,s)}else this._isVertex(e)&&(t.viewEvent.stopPropagation(),t.viewEvent.button===2?this._removeVertices(e):(t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedVertices.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)))}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t;if(s===this.graphic){const{geometry:o}=s;return this._setUpOperation(t),this._emitMoveStartEvent(e,i),void(o!=null&&o.type==="point"&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}if(!this.selectedVertices.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const o=this.graphic.clone(),n=this._createVertexFromMidpoint(s);this._emitVertexAddEvent([s],o,n)}this._addToSelection(s)}this._setUpOperation(t),this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:n}=e,{geometry:r}=o;if(r!=null){if(n!=="move")this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else if(r.type==="point")this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if(r.type==="polyline"||r.type==="polygon"){const h=this._getCoordinatesForUI(r);this._updateVertexGraphicLocations(h),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t,{operationType:n}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>n==="move"?this._emitMoveStopEvent():this._emitReshapeStopEvent(o)),this._isMidpoint(o)?this.refresh():(this._updateTooltip(this._isVertex(o)?o:null),this._resetSnappingStateVars(),this._activeOperationInfo=null)}_updateVertexGraphicLocations(t){const e=this.view.spatialReference;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes,[n,r,h]=t[s][o];i.geometry=new x({x:n,y:r,z:h,spatialReference:e})}this._updateMidpointGraphicLocations(t)}_updateMidpointGraphicLocations(t){for(const e of this.midpointGraphics){const{pathIndex:i,pointIndexStart:s,pointIndexEnd:o}=e.attributes,[n,r,h]=t[i][s],[p,a,c]=t[i][o],[l,v,_]=O([n,r,h],[p,a,c]);e.geometry=new x({x:l,y:v,z:_,spatialReference:this.view.spatialReference})}}_getIndicesForVertexGraphic({attributes:t}){return[(t==null?void 0:t.pathIndex)||0,(t==null?void 0:t.pointIndex)||0]}_getVertexFromEditGeometry(t){const[e,i]=this._getIndicesForVertexGraphic(t);return this._editGeometryOperations.data.components[e].vertices[i]}_onHandleMove(t,e,i,s,o){I(this._snappingTask);const n=this._snappingContext;if(!n)return;const r=t.geometry,h=s.type==="graphic-move-stop";if(this.snappingManager!=null&&this.selectedVertices.length<2&&!h){const p=this.snappingManager;this._stagedVertex=p.update({point:r,context:n}),this._syncGeometryAfterVertexMove(t,new x(this._stagedVertex),e,i,h),o(),this._snappingTask=N(async a=>{const c=await p.snap({point:r,context:n,signal:a});c.valid&&(this._stagedVertex=c.apply(),this._syncGeometryAfterVertexMove(t,new x(this._stagedVertex),e,i,h),o())})}else{const p=this._stagedVertex!=null?new x(this._stagedVertex):r;this._syncGeometryAfterVertexMove(t,p,e,i,h),o()}}async _syncGeometryAfterVertexMove(t,e,i,s,o=!1){const n=this._editGeometryOperations.data.geometry;if(n.type==="point")t.geometry=e;else if(n.type==="mesh")t.geometry=n.centerAt(e),t.notifyGeometryChanged();else{const{x:r,y:h,z:p}=e,[a,c]=this._getIndicesForVertexGraphic(t);let l=b(n);const v=l[a].length-1,_=p!=null?[r,h,p]:[r,h];l[a][c]=_,n.type==="polygon"&&(c===0?l[a][v]=_:c===v&&(l[a][0]=_)),this._isVertex(t)&&(l=this._moveRelatedCoordinates(l,t,_),l=this._moveSelectedHandleCoordinates(l,t,i,s,n.type==="polygon"),this._updateMidpointGraphicLocations(l)),this.graphic.geometry=n.clone();const u=this._getVertexFromEditGeometry(t),V=r-u.pos[0],w=h-u.pos[1];this._editGeometryOperations.moveVertices([u],V,w,0),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_moveRelatedCoordinates(t,e,i){const{relatedGraphicIndices:s}=e.attributes;for(const o of s){const n=this.vertexGraphics.at(o),{pathIndex:r,pointIndex:h}=n.attributes;t[r][h]=i,n.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){for(const n of this.selectedVertices)if(n!==e){const{pathIndex:r,pointIndex:h,relatedGraphicIndices:p}=n.attributes,a=tt(n.geometry,i,s,this.view),c=t[r].length-1;t[r][h]=[a.x,a.y],n.geometry=a,o&&(h===0?t[r][c]=[a.x,a.y]:h===c&&(t[r][0]=[a.x,a.y]));for(const l of p){const v=this.vertexGraphics.at(l),{pathIndex:_,pointIndex:u}=v.attributes;t[_][u]=[a.x,a.y],v.geometry=a}}return t}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this.view.cursor="default",this._updateTooltip()}_createVertexFromMidpoint(t){const{_graphicAttributes:e,graphic:i}=this,s=i.geometry;if(s==null||s.type!=="polygon"&&s.type!=="polyline")return[];const o=s.clone(),n=[],{pathIndex:r,pointIndexStart:h,pointIndexEnd:p}=t.attributes,{x:a,y:c,z:l}=t.geometry,v=p===0?h+1:p,_=b(o);return _[r].splice(v,0,l!=null?[a,c,l]:[a,c]),t.attributes={...e,pathIndex:r,pointIndex:v,relatedGraphicIndices:[]},n.push({coordinates:_[r][v],componentIndex:r,vertexIndex:v}),this.graphic.geometry=o,n}_addToSelection(t){t instanceof f&&(t=[t]);for(const e of t)e.symbol=this.symbols.vertices.selected;this._set("selectedVertices",this.selectedVertices.concat(t)),this._emitSelectEvent(t)}_removeFromSelection(t,e){const{vertices:i}=this.symbols,s=e?i.hover:i.default;t instanceof f&&(t=[t]);for(const o of t)this.selectedVertices.splice(this.selectedVertices.indexOf(o),1),this._set("selectedVertices",this.selectedVertices),o.set("symbol",s);this._emitDeselectEvent(t)}_clearSelection(){if(this.selectedVertices.length){const t=this.selectedVertices;for(const e of this.selectedVertices)e.set("symbol",this.symbols.vertices.default);this._set("selectedVertices",[]),this._emitDeselectEvent(t)}}_keyDownHandler(t){J.delete.includes(t.key)&&!t.repeat&&this.selectedVertices.length&&this._removeVertices(this.selectedVertices)}_removeVertices(t){const e=this.graphic.geometry;if(e==null||e.type!=="polygon"&&e.type!=="polyline"||e.type==="polygon"&&this.vertexGraphics.length<4||this.vertexGraphics.length<3)return;t instanceof f&&(t=[t]);const i=this.graphic.clone(),s=e.clone();let o=b(s);const n=[];t instanceof f&&(t=[t]);for(const r of t){const{x:h,y:p}=r.geometry;for(let a=0;a{if(r.length<2)return!1;const[h,p]=r[0],[a,c]=r[r.length-1];return(r.length!==2||h!==a||p!==c)&&(h===a&&p===c||r.push(r[0]),!0)}),s.rings=o;else{for(const r of o)r.length===1&&o.splice(o.indexOf(r),1);s.paths=o}this.graphic.geometry=s,this.refresh(),this._emitVertexRemoveEvent(t,i,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isSelected(t){return this._isVertex(t)&&this.selectedVertices.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){this.view.cursor=this._isMidpoint(t)?"copy":"move"}_updateTooltip(t,e){this._tooltip!=null&&(t?t===this.graphic?this._updateMoveGraphicTooltip(e):this._updateMoveVertexTooltip(e):this._tooltip.clear())}_updateMoveGraphicTooltip(t){const{_tooltip:e,tooltipOptions:i,view:s}=this;if(e==null)return;const o=this._translateGraphicTooltipInfo??(this._translateGraphicTooltipInfo=new ht({tooltipOptions:i}));if(o.clear(),o.tooltipOptions=i,t){const{x:n,y:r}=t.origin,h=s.toMap(t),p=s.toMap(T(n,r)),a=R(p,h);o.distance=a??C}e.info=o}_updateMoveVertexTooltip(t){const{_tooltip:e,graphic:{geometry:i},tooltipOptions:s,view:o}=this;if(e==null)return;const n=this._translateVertexTooltipInfo??(this._translateVertexTooltipInfo=new pt({tooltipOptions:s}));if(n.clear(),n.tooltipOptions=s,(i==null?void 0:i.type)==="polygon"?n.area=ct(i):(i==null?void 0:i.type)==="polyline"&&(n.totalLength=nt(i)),t){const{x:r,y:h}=t.origin,p=o.toMap(t),a=o.toMap(T(r,h)),c=R(a,p);n.distance=c??C}e.info=n}_emitMoveStartEvent(t,e){const i=new mt(this.graphic,t,e);this.emit("move-start",i),this.callbacks.onMoveStart&&this.callbacks.onMoveStart(i)}_emitMoveEvent(t,e){const i=new yt(this.graphic,t,e);this.emit("move",i),this.callbacks.onMove&&this.callbacks.onMove(i)}_emitMoveStopEvent(){const t=this._activeOperationInfo;if(!t)return;const{totalDx:e,totalDy:i}=t,s=new _t(this.graphic,e,i);this.emit("move-stop",s),this.callbacks.onMoveStop&&this.callbacks.onMoveStop(s)}_emitReshapeStartEvent(t){const e=new lt(this.graphic,t,this.selectedVertices);this.emit("reshape-start",e),this.callbacks.onReshapeStart&&this.callbacks.onReshapeStart(e)}_emitReshapeEvent(t){const e=new dt(this.graphic,t,this.selectedVertices);this.emit("reshape",e),this.callbacks.onReshape&&this.callbacks.onReshape(e)}_emitReshapeStopEvent(t){const e=new vt(this.graphic,t,this.selectedVertices);this.emit("reshape-stop",e),this.callbacks.onReshapeStop&&this.callbacks.onReshapeStop(e)}_emitSelectEvent(t){const e=new gt(t);this.emit("select",e),this.callbacks.onVertexSelect&&this.callbacks.onVertexSelect(e)}_emitDeselectEvent(t){const e=new ut(t);this.emit("deselect",e),this.callbacks.onVertexDeselect&&this.callbacks.onVertexDeselect(e)}_emitVertexAddEvent(t,e,i){const s=new xt(t,this.graphic,e,i);this.emit("vertex-add",s),this.callbacks.onVertexAdd&&this.callbacks.onVertexAdd(s)}_emitVertexRemoveEvent(t,e,i){const s=new ft(t,this.graphic,e,i);this.emit("vertex-remove",s),this.callbacks.onVertexRemove&&this.callbacks.onVertexRemove(s)}_logGeometryTypeError(){Q.getLogger(this).error(new W("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};m([y()],d.prototype,"_tooltip",void 0),m([y()],d.prototype,"_translateGraphicTooltipInfo",void 0),m([y()],d.prototype,"_translateVertexTooltipInfo",void 0),m([y()],d.prototype,"callbacks",void 0),m([y()],d.prototype,"enableMidpoints",void 0),m([y()],d.prototype,"enableMovement",void 0),m([y()],d.prototype,"enableVertices",void 0),m([y()],d.prototype,"graphic",void 0),m([y({value:!0})],d.prototype,"highlightsEnabled",null),m([y()],d.prototype,"layer",void 0),m([y({readOnly:!0})],d.prototype,"midpointGraphics",void 0),m([y()],d.prototype,"midpointSymbol",void 0),m([y({readOnly:!0})],d.prototype,"selectedVertices",void 0),m([y()],d.prototype,"snappingManager",void 0),m([y({readOnly:!0})],d.prototype,"state",null),m([y()],d.prototype,"symbols",void 0),m([y({type:$})],d.prototype,"tooltipOptions",void 0),m([y({readOnly:!0})],d.prototype,"type",void 0),m([y({readOnly:!0})],d.prototype,"vertexGraphics",void 0),m([y()],d.prototype,"view",void 0),d=m([B("esri.views.draw.support.Reshape")],d);const Lt=d;export{Lt as default}; diff --git a/dist/assets/Responsive-QKXcW_1q.js b/dist/assets/Responsive-QKXcW_1q.js new file mode 100644 index 0000000..ab0df23 --- /dev/null +++ b/dist/assets/Responsive-QKXcW_1q.js @@ -0,0 +1 @@ +import{i as s,Z as a,H as g,v as m,Y as c,z as n}from"./Theme-QNc_77AM.js";class h extends s{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:a.fromHex(0),fill:a.fromHex(2829099),primaryButton:a.lighten(a.fromHex(6788316),-.2),primaryButtonHover:a.lighten(a.fromHex(6779356),-.2),primaryButtonDown:a.lighten(a.fromHex(6872181),-.2),primaryButtonActive:a.lighten(a.fromHex(6872182),-.2),primaryButtonText:a.fromHex(16777215),primaryButtonStroke:a.lighten(a.fromHex(6788316),-.2),secondaryButton:a.fromHex(3881787),secondaryButtonHover:a.lighten(a.fromHex(3881787),.1),secondaryButtonDown:a.lighten(a.fromHex(3881787),.15),secondaryButtonActive:a.lighten(a.fromHex(3881787),.2),secondaryButtonText:a.fromHex(12303291),secondaryButtonStroke:a.lighten(a.fromHex(3881787),-.2),grid:a.fromHex(12303291),background:a.fromHex(0),alternativeBackground:a.fromHex(16777215),text:a.fromHex(16777215),alternativeText:a.fromHex(0),disabled:a.fromHex(11382189),positive:a.fromHex(5288704),negative:a.fromHex(11730944)})}}const o=h;class t extends s{constructor(){super(...arguments),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]})}static widthXXS(e,i){return e<=t.XXS}static widthXS(e,i){return e<=t.XS}static widthS(e,i){return e<=t.S}static widthM(e,i){return e<=t.M}static widthL(e,i){return e<=t.L}static widthXL(e,i){return e<=t.XL}static widthXXL(e,i){return e<=t.XXL}static heightXXS(e,i){return i<=t.XXS}static heightXS(e,i){return i<=t.XS}static heightS(e,i){return i<=t.S}static heightM(e,i){return i<=t.M}static heightL(e,i){return i<=t.L}static heightXL(e,i){return i<=t.XL}static heightXXL(e,i){return i<=t.XXL}static isXXS(e,i){return e<=t.XXS&&i<=t.XXS}static isXS(e,i){return e<=t.XS&&i<=t.XS}static isS(e,i){return e<=t.S&&i<=t.S}static isM(e,i){return e<=t.M&&i<=t.M}static isL(e,i){return e<=t.L&&i<=t.L}static isXL(e,i){return e<=t.XL&&i<=t.XL}static isXXL(e,i){return e<=t.XXL&&i<=t.XXL}static maybeXXS(e,i){return e<=t.XXS||i<=t.XXS}static maybeXS(e,i){return e<=t.XS||i<=t.XS}static maybeS(e,i){return e<=t.S||i<=t.S}static maybeM(e,i){return e<=t.M||i<=t.M}static maybeL(e,i){return e<=t.L||i<=t.L}static maybeXL(e,i){return e<=t.XL||i<=t.XL}static maybeXXL(e,i){return e<=t.XXL||i<=t.XXL}static newEmpty(e){return new this(e,!0)}addRule(e){return e.name&&!e.template&&(e.template=this.rule(e.name,e.tags)),e._dp=new g([this._root._rootContainer.onPrivate("width",i=>{this._isUsed()&&this._applyRule(e)}),this._root._rootContainer.onPrivate("height",i=>{this._isUsed()&&this._applyRule(e)})]),this.responsiveRules.push(e),this._applyRule(e),e}removeRule(e){m(this.responsiveRules,e),e._dp&&e._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_applyRule(e){const i=this._root._rootContainer.getPrivate("width"),l=this._root._rootContainer.getPrivate("height"),d=e.relevant.call(e,i,l),r=e.applied;d?r||(e.applied=!0,e.template&&e.settings&&e.template.setAll(e.settings),e.applying&&e.applying.call(e)):r&&(e.applied=!1,e.template&&e.template.removeAll(),e.removing&&e.removing.call(e))}setupDefaultRules(){super.setupDefaultRules();const e=i=>this.addRule(i);e({name:"Chart",relevant:t.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),e({name:"Chart",relevant:t.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),e({name:"Bullet",relevant:t.isXS,settings:{forceHidden:!0}}),e({name:"Legend",relevant:t.isXS,settings:{forceHidden:!0}}),e({name:"HeatLegend",tags:["vertical"],relevant:t.widthXS,settings:{forceHidden:!0}}),e({name:"HeatLegend",tags:["horizontal"],relevant:t.heightXS,settings:{forceHidden:!0}}),e({name:"Label",tags:["heatlegend","start"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"Label",tags:["heatlegend","end"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"Button",tags:["resize"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"AxisRendererX",relevant:t.heightXS,settings:{inside:!0}}),e({name:"AxisRendererY",relevant:t.widthXS,settings:{inside:!0}}),e({name:"AxisRendererXLabel",relevant:t.heightXS,settings:{minPosition:.1,maxPosition:.9}}),e({name:"AxisLabel",tags:["y"],relevant:t.widthXS,settings:{centerY:c,maxPosition:.9}}),e({name:"AxisLabel",tags:["x"],relevant:t.heightXXS,settings:{forceHidden:!0}}),e({name:"AxisLabel",tags:["y"],relevant:t.widthXXS,settings:{forceHidden:!0}}),e({name:"AxisTick",tags:["x"],relevant:t.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),e({name:"AxisTick",tags:["y"],relevant:t.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),e({name:"Grid",relevant:t.maybeXXS,settings:{forceHidden:!0}}),e({name:"RadialLabel",tags:["radial"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"RadialLabel",tags:["circular"],relevant:t.maybeS,settings:{inside:!0}}),e({name:"AxisTick",relevant:t.maybeS,settings:{inside:!0}}),e({name:"RadialLabel",tags:["circular"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"AxisTick",tags:["circular"],relevant:t.maybeXS,settings:{inside:!0}}),e({name:"PieChart",relevant:t.maybeXS,settings:{radius:n(99)}}),e({name:"PieChart",relevant:t.widthM,settings:{radius:n(99)}}),e({name:"RadialLabel",tags:["pie"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"RadialLabel",tags:["pie"],relevant:t.widthM,settings:{forceHidden:!0}}),e({name:"Tick",tags:["pie"],relevant:t.maybeXS,settings:{forceHidden:!0}}),e({name:"Tick",tags:["pie"],relevant:t.widthM,settings:{forceHidden:!0}}),e({name:"FunnelSeries",relevant:t.widthM,settings:{alignLabels:!1}}),e({name:"Label",tags:["funnel","vertical"],relevant:t.widthL,settings:{forceHidden:!0}}),e({name:"Tick",tags:["funnel","vertical"],relevant:t.widthL,settings:{forceHidden:!0}}),e({name:"Label",tags:["funnel","horizontal"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"Tick",tags:["funnel","horizontal"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"PyramidSeries",relevant:t.widthM,settings:{alignLabels:!1}}),e({name:"Label",tags:["pyramid","vertical"],relevant:t.widthL,settings:{forceHidden:!0}}),e({name:"Tick",tags:["pyramid","vertical"],relevant:t.widthL,settings:{forceHidden:!0}}),e({name:"Label",tags:["pyramid","horizontal"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"Tick",tags:["pyramid","horizontal"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"PictorialStackedSeries",relevant:t.widthM,settings:{alignLabels:!1}}),e({name:"Label",tags:["pictorial","vertical"],relevant:t.widthL,settings:{forceHidden:!0}}),e({name:"Tick",tags:["pictorial","vertical"],relevant:t.widthL,settings:{forceHidden:!0}}),e({name:"Label",tags:["pictorial","horizontal"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"Tick",tags:["pictorial","horizontal"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"Label",tags:["flow","horizontal"],relevant:t.widthS,settings:{forceHidden:!0}}),e({name:"Label",tags:["flow","vertical"],relevant:t.heightS,settings:{forceHidden:!0}}),e({name:"Chord",relevant:t.maybeXS,settings:{radius:n(99)}}),e({name:"Label",tags:["hierarchy","node"],relevant:t.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(t,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(t,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(t,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(t,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(t,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(t,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(t,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});const v=t;export{v as d,o as l}; diff --git a/dist/assets/RightAngleQuadVisualElement-y_W8r903.js b/dist/assets/RightAngleQuadVisualElement-y_W8r903.js new file mode 100644 index 0000000..aef0a3b --- /dev/null +++ b/dist/assets/RightAngleQuadVisualElement-y_W8r903.js @@ -0,0 +1 @@ +import{aa as d,b2 as h,bi as _,b5 as p,az as m,aF as O,aU as b,aE as u,bu as f,b6 as M,aq as R,bv as g,b7 as x,d as S,b8 as w,at as v,br as c,bw as z,bx as D,bg as $,by as q,bf as j,bz as G,bA as T,bB as C}from"./index-J0iiHjMT.js";import{t as F}from"./EngineVisualElement-eZNKTKsI.js";class H extends F{constructor(e){super(e),this._maxSize=0,this._position=d(),this._up=d(),this._right=d(),this._renderOccluded=h.OccludeAndTransparent,this._color=_(1,0,0,1),this._outlineColor=_(0,0,0,1),this._outlineSize=0,this._size=32,this._outlineRenderOccluded=h.Opaque,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:t=>this._createObject3DResources(t),destroyResources:()=>{},cameraChanged:()=>this._updateTransformObject3D()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:t=>this._destroyDrapedResources(t)}}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateQuadMaterial())}get color(){return this._color}set color(e){p(this._color,e),this._updateQuadMaterial()}get outlineColor(){return this._outlineColor}set outlineColor(e){p(this._outlineColor,e),this._updateOutlineMaterial()}get outlineSize(){return this._outlineSize}set outlineSize(e){const t=this._outlineSize===0!=(e===0);this._outlineSize=e,t?this.recreateGeometry():this._updateOutlineMaterial()}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateTransform())}get outlineRenderOccluded(){return this._outlineRenderOccluded}set outlineRenderOccluded(e){this._outlineRenderOccluded=e,this._updateOutlineMaterial()}set geometry({previous:e,center:t,next:r}){this._maxSize=Math.min(m(t,e),m(t,r))/3,O(this._up,b(this._up,e,t)),O(this._right,b(this._right,r,t)),u(this._position,t),this.recreateGeometry()}_createObject3DResources(e){const t=new f(this._quadMaterialParameters),r=this._outlineSize===0?void 0:new M(this._outlineMaterialParameters);return this._createObject3DGeometries(e,t,r),{quadMaterial:t,outlineMaterial:r,forEach:s=>{s(t),r&&s(r)}}}_createObject3DGeometries(e,t,r){if(R(this._up,g)&&R(this._right,g))return;const s=this._createGeometries(t,r);for(const o of s)e.addGeometry(o);this._updateTransformObject3D(e)}_createDrapedResources(){const e=new f(this._quadMaterialParameters),t=this._outlineSize===0?void 0:new M(this._outlineMaterialParameters),r=this._createGeometries(e,t).map(s=>new x(s));return this._setTransformDraped(r),{quadMaterial:e,outlineMaterial:t,geometries:r,pixelRatioHandle:S(()=>this.view.state.contentPixelRatio,()=>{this.drapedResources.recreateGeometry()})}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[]}_createGeometries(e,t){const{up:r,right:s,corner:o}=this._getVertices(),a=this._quadGeometryData(r,s,o,e);return t?[a,w(t,[r,o,s])]:[a]}_getVertices(){let e=this._up,t=this._right;const r=v(c.get(),e,t);return this.isDraped&&(e=u(c.get(),e),t=u(c.get(),t),e[2]=0,t[2]=0,r[2]=0),{up:e,right:t,corner:r}}_updateTransform(){this.isDraped?this.drapedResources.recreateGeometry():this._updateTransformObject3D()}_updateTransformObject3D(e=this.object3dResources.object){if(!e)return;const t=this.view.state.camera,r=this._size*t.computeScreenPixelSizeAt(this._position),s=Math.min(this._maxSize,r);z(i,this._position),D(i,i,[s,s,s]),e.transformation=i}_setTransformDraped(e){if(e.length===0)return;const{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:r}}}=this,{_position:s,_size:o}=this,a=u(c.get(),s);a[2]=$;const n=I;n.spatialReference=t.renderer.spatialReference,n.x=a[0],n.y=a[1];const P=o*(this.view.overlayPixelSizeInMapUnits(n)*r),l=Math.min(this._maxSize,P);z(i,a),D(i,i,[l,l,1]);for(const y of e)y.transformation=i}_quadGeometryData(e,t,r,s){return new q(s,[[j.POSITION,new G([0,0,0,...t,...e,...r],[0,1,2,1,2,3],3,!0)]])}get _quadMaterialParameters(){return{color:this._color,forceTransparentMode:!0,writeDepth:!1,polygonOffset:!0,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateQuadMaterial(){var e,t;(e=this.object3dResources.resources)==null||e.quadMaterial.setParameters(this._quadMaterialParameters),(t=this.drapedResources.resources)==null||t.quadMaterial.setParameters(this._quadMaterialParameters)}get _outlineMaterialParameters(){return{color:this._outlineColor,width:this._outlineSize,renderOccluded:this._outlineRenderOccluded,isDecoration:this.isDecoration}}_updateOutlineMaterial(){var e,t,r,s;(t=(e=this.object3dResources.resources)==null?void 0:e.outlineMaterial)==null||t.setParameters(this._outlineMaterialParameters),(s=(r=this.drapedResources.resources)==null?void 0:r.outlineMaterial)==null||s.setParameters(this._outlineMaterialParameters)}}const i=T(),I=C(0,0,void 0,null);export{H as z}; diff --git a/dist/assets/RouteLayer-GamYzZdr.js b/dist/assets/RouteLayer-GamYzZdr.js new file mode 100644 index 0000000..8d0943b --- /dev/null +++ b/dist/assets/RouteLayer-GamYzZdr.js @@ -0,0 +1,2 @@ +import{e as r,y as s,mv as C,c as A,dr as L,J as V,a8 as he,bX as nt,iw as I,dt as P,du as q,Z as Ze,E as M,f_ as fe,bW as re,pc as Se,nC as at,dZ as Ve,dp as ze,T as Ke,S as K,N as be,dT as He,ar as W,e3 as Qe,bN as lt,ua as ut,dq as Pe,dx as pt,dy as ct,g0 as yt,ub as dt,V as O,dK as mt,dO as ft,dM as ht,dN as vt,dP as wt,fl as gt,dD as St,hq as bt,eV as Ce,dS as Je,u7 as Tt,bV as Bt,bR as Nt,bS as Pt,h as Rt,bT as $t,f as It,ja as At,iv as Ot,fd as jt,e1 as Lt,hx as Dt,c7 as Mt}from"./index-J0iiHjMT.js";import{U as H,y as Re,s as Ct,R as Jt,r as Xe,a as $e,b as _t,n as kt,o as xt,w as Ft,d as Et,D as _e,e as Gt,k as Ut,i as qt,f as Wt,l as Zt,m as oe,c as se,C as X,T as Y,j as ee,O as te,S as le,g as Vt}from"./Stop-W76EJiT2.js";import{d as E}from"./FeatureSet-d4S1oKME.js";let G=class extends L{constructor(t){super(t),this.break=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new V({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new V({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new V({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new V({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};r([s({types:C})],G.prototype,"break",void 0),r([s({types:C})],G.prototype,"first",void 0),r([s({types:C})],G.prototype,"unlocated",void 0),r([s({types:C})],G.prototype,"last",void 0),r([s({types:C})],G.prototype,"middle",void 0),r([s({types:C})],G.prototype,"waypoint",void 0),G=r([A("esri.layers.support.RouteStopSymbols")],G);const Ye=G;let x=class extends L{constructor(t){super(t),this.directionLines=new he({color:[0,122,194],width:6}),this.directionPoints=new V({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new V({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new nt({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new he({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new he({width:8,color:[20,89,127]}),this.stops=new Ye}};r([s({types:C})],x.prototype,"directionLines",void 0),r([s({types:C})],x.prototype,"directionPoints",void 0),r([s({types:C})],x.prototype,"pointBarriers",void 0),r([s({types:C})],x.prototype,"polygonBarriers",void 0),r([s({types:C})],x.prototype,"polylineBarriers",void 0),r([s({types:C})],x.prototype,"routeInfo",void 0),r([s({type:Ye})],x.prototype,"stops",void 0),x=r([A("esri.layers.support.RouteSymbols")],x);const et=x;let _=class extends L{constructor(t){super(t),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};r([s({type:String})],_.prototype,"dataType",void 0),r([I(H,{ignoreUnknown:!1})],_.prototype,"name",void 0),r([s({type:[String]})],_.prototype,"parameterNames",void 0),r([s({type:String})],_.prototype,"restrictionUsageParameterName",void 0),r([I(Re,{ignoreUnknown:!1})],_.prototype,"timeNeutralAttributeName",void 0),r([s({type:String})],_.prototype,"trafficSupport",void 0),r([I(Ct)],_.prototype,"units",void 0),r([I(Jt)],_.prototype,"usageType",void 0),_=r([A("esri.rest.support.NetworkAttribute")],_);const zt=_;let Z=class extends L{constructor(t){super(t),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};r([s({type:Number})],Z.prototype,"buildTime",void 0),r([s({type:String})],Z.prototype,"name",void 0),r([s({type:[zt]})],Z.prototype,"networkAttributes",void 0),r([s()],Z.prototype,"networkSources",void 0),r([s({type:String})],Z.prototype,"state",void 0),Z=r([A("esri.rest.support.NetworkDataset")],Z);const Kt=Z;let $=class extends L{constructor(t){super(t),this.accumulateAttributeNames=null,this.attributeParameterValues=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(t){return t==null?null:t.map(o=>H.fromJSON(o))}writeAccumulateAttributes(t,o,i){t!=null&&t.length&&(o[i]=t.map(n=>H.toJSON(n)))}readDefaultTravelMode(t,o){var n,p;const i=((n=o.supportedTravelModes)==null?void 0:n.find(({id:l})=>l===o.defaultTravelMode))??((p=o.supportedTravelModes)==null?void 0:p.find(({itemId:l})=>l===o.defaultTravelMode));return i?$e.fromJSON(i):null}};r([s()],$.prototype,"accumulateAttributeNames",void 0),r([P("accumulateAttributeNames")],$.prototype,"readAccumulateAttributes",null),r([q("accumulateAttributeNames")],$.prototype,"writeAccumulateAttributes",null),r([s()],$.prototype,"attributeParameterValues",void 0),r([s()],$.prototype,"currentVersion",void 0),r([s()],$.prototype,"defaultTravelMode",void 0),r([P("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],$.prototype,"readDefaultTravelMode",null),r([s()],$.prototype,"directionsLanguage",void 0),r([I(Xe)],$.prototype,"directionsLengthUnits",void 0),r([s()],$.prototype,"directionsSupportedLanguages",void 0),r([I(Re,{ignoreUnknown:!1})],$.prototype,"directionsTimeAttribute",void 0),r([s()],$.prototype,"hasZ",void 0),r([I(H,{ignoreUnknown:!1})],$.prototype,"impedance",void 0),r([s({type:Kt})],$.prototype,"networkDataset",void 0),r([s({type:[$e]})],$.prototype,"supportedTravelModes",void 0),$=r([A("esri.rest.support.NetworkServiceDescription")],$);const Ht=$,Qt=Ze.getLogger("esri.rest.networkService");function ue(e,t,o,i){i[o]=[t.length,t.length+e.length],e.forEach(n=>{t.push(n.geometry)})}function Xt(e,t){for(let o=0;o=10.4?tr(e,t,o):er(e,o),{defaultTravelMode:l,supportedTravelModes:c}=await p;return n.defaultTravelMode=l,n.supportedTravelModes=c,Ht.fromJSON(n)}async function er(e,t){var w,d,a;const o=fe({f:"json"},t),{data:i}=await re(e.replace(/\/rest\/.*$/i,"/info"),o);if(!(i!=null&&i.owningSystemUrl))return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:n}=i,p=Se(n)+"/sharing/rest/portals/self",{data:l}=await re(p,o),c=at("helperServices.routingUtilities.url",l);if(!c)return{supportedTravelModes:[],defaultTravelMode:null};const v=Ve(n),S=/\/solve$/i.test(v.path)?"Route":/\/solveclosestfacility$/i.test(v.path)?"ClosestFacility":"ServiceAreas",u=fe({f:"json",serviceName:S},t),b=Se(c)+"/GetTravelModes/execute",N=await re(b,u),B=[];let h=null;if((d=(w=N==null?void 0:N.data)==null?void 0:w.results)!=null&&d.length){const T=N.data.results;for(const f of T)if(f.paramName==="supportedTravelModes"){if((a=f.value)!=null&&a.features){for(const{attributes:R}of f.value.features)if(R){const J=JSON.parse(R.TravelMode);B.push(J)}}}else f.paramName==="defaultTravelMode"&&(h=f.value)}return{supportedTravelModes:B,defaultTravelMode:h}}async function tr(e,t,o){try{const i=fe({f:"json",token:t},o),n=Se(e)+"/retrieveTravelModes",{data:{supportedTravelModes:p,defaultTravelMode:l}}=await re(n,i);return{supportedTravelModes:p,defaultTravelMode:l}}catch(i){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:i})}}const ke=new ze({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let ie=class extends L{constructor(t){super(t),this.description=null,this.type=null}};r([s({type:String,json:{write:!0}})],ie.prototype,"description",void 0),r([s({type:String,json:{read:ke.read,write:ke.write}})],ie.prototype,"type",void 0),ie=r([A("esri.rest.support.GPMessage")],ie);const rr=ie,xe=new ze({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let de=class extends rr{constructor(t){super(t),this.type=null}};r([s({type:String,json:{read:xe.read,write:xe.write}})],de.prototype,"type",void 0),de=r([A("esri.rest.support.NAMessage")],de);const or=de;let ne=class extends L{constructor(t){super(t)}};r([s({json:{read:{source:"string"}}})],ne.prototype,"text",void 0),r([I(_t,{name:"stringType"})],ne.prototype,"type",void 0),ne=r([A("esri.rest.support.DirectionsString")],ne);const rt=ne;let U=class extends L{constructor(t){super(t),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(t,o){return kt(o.ETA,o.arriveTimeUTC)}readGeometry(t,o){return Ke.fromJSON(o.point)}};r([s({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),r([s()],U.prototype,"arriveTimeOffset",void 0),r([P("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),r([s({type:Ke})],U.prototype,"geometry",void 0),r([P("geometry",["point"])],U.prototype,"readGeometry",null),r([s({type:[rt]})],U.prototype,"strings",void 0),U=r([A("esri.rest.support.DirectionsEvent")],U);const sr=U;function ir(e){if(e==null||e==="")return null;let t=0,o=0,i=0,n=0;const p=[];let l,c,v,S,u,b,N,B,h=0,w=0,d=0;if(u=e.match(/((\+|\-)[^\+\-\|]+|\|)/g),u||(u=[]),parseInt(u[h],32)===0){h=2;const a=parseInt(u[h],32);h++,b=parseInt(u[h],32),h++,1&a&&(w=u.indexOf("|")+1,N=parseInt(u[w],32),w++),2&a&&(d=u.indexOf("|",w)+1,B=parseInt(u[d],32),d++)}else b=parseInt(u[h],32),h++;for(;h0,hasM:d>0}}let Q=class extends K{constructor(e){super(e),this.events=null,this.strings=null}readGeometry(e,t){const o=ir(t.compressedGeometry);return o!=null?be.fromJSON(o):null}};r([s({type:[sr]})],Q.prototype,"events",void 0),r([P("geometry",["compressedGeometry"])],Q.prototype,"readGeometry",null),r([s({type:[rt]})],Q.prototype,"strings",void 0),Q=r([A("esri.rest.support.DirectionsFeature")],Q);const nr=Q;function ar(e,t){if(e.length===0)return new be({spatialReference:t});const o=[];for(const l of e)for(const c of l.paths)o.push(...c);const i=[];o.forEach((l,c)=>{c!==0&&l[0]===o[c-1][0]&&l[1]===o[c-1][1]||i.push(l)});const{hasM:n,hasZ:p}=e[0];return new be({hasM:n,hasZ:p,paths:[i],spatialReference:t})}let j=class extends E{constructor(t){super(t),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(t,o){if(!t)return[];const i=o.summary.envelope.spatialReference??o.spatialReference,n=i&&W.fromJSON(i);return t.map(p=>{const l=nr.fromJSON(p);if(l.geometry!=null&&(l.geometry.spatialReference=n),l.events!=null)for(const c of l.events)c.geometry!=null&&(c.geometry.spatialReference=n);return l})}get mergedGeometry(){return this.features?ar(this.features.map(({geometry:t})=>t),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:t})=>t).filter(Qe)}};r([s({type:He,json:{read:{source:"summary.envelope"}}})],j.prototype,"extent",void 0),r([s({nonNullable:!0})],j.prototype,"features",void 0),r([P("features")],j.prototype,"readFeatures",null),r([s()],j.prototype,"geometryType",void 0),r([s({readOnly:!0})],j.prototype,"mergedGeometry",null),r([s()],j.prototype,"routeId",void 0),r([s()],j.prototype,"routeName",void 0),r([s({value:null,readOnly:!0})],j.prototype,"strings",null),r([s({json:{read:{source:"summary.totalDriveTime"}}})],j.prototype,"totalDriveTime",void 0),r([s({json:{read:{source:"summary.totalLength"}}})],j.prototype,"totalLength",void 0),r([s({json:{read:{source:"summary.totalTime"}}})],j.prototype,"totalTime",void 0),j=r([A("esri.rest.support.DirectionsFeatureSet")],j);const lr=j;let D=class extends L{constructor(t){super(t),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};r([s({type:E,json:{write:!0}})],D.prototype,"directionLines",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"directionPoints",void 0),r([s({type:lr,json:{write:!0}})],D.prototype,"directions",void 0),r([s({type:K,json:{write:!0}})],D.prototype,"route",void 0),r([s({type:String,json:{write:!0}})],D.prototype,"routeName",void 0),r([s({type:[K],json:{write:!0}})],D.prototype,"stops",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedEdges",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedJunctions",void 0),r([s({type:E,json:{write:!0}})],D.prototype,"traversedTurns",void 0),D=r([A("esri.rest.support.RouteResult")],D);const ur=D;function ve(e){return e?E.fromJSON(e).features.filter(Qe):[]}let k=class extends L{constructor(t){super(t),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(t,o){return ve(o.barriers)}readPolylineBarriers(t){return ve(t)}readPolygonBarriers(t){return ve(t)}};r([s({type:[or]})],k.prototype,"messages",void 0),r([s({type:[K]})],k.prototype,"pointBarriers",void 0),r([P("pointBarriers",["barriers"])],k.prototype,"readPointBarriers",null),r([s({type:[K]})],k.prototype,"polylineBarriers",void 0),r([P("polylineBarriers")],k.prototype,"readPolylineBarriers",null),r([s({type:[K]})],k.prototype,"polygonBarriers",void 0),r([P("polygonBarriers")],k.prototype,"readPolygonBarriers",null),r([s({type:[ur]})],k.prototype,"routeResults",void 0),k=r([A("esri.rest.support.RouteSolveResult")],k);const pr=k;function pe(e){return e instanceof E}async function cr(e,t,o){const i=[],n=[],p={},l={},c=Ve(e),{path:v}=c;pe(t.stops)&&ue(t.stops.features,n,"stops.features",p),pe(t.pointBarriers)&&ue(t.pointBarriers.features,n,"pointBarriers.features",p),pe(t.polylineBarriers)&&ue(t.polylineBarriers.features,n,"polylineBarriers.features",p),pe(t.polygonBarriers)&&ue(t.polygonBarriers.features,n,"polygonBarriers.features",p);const S=await lt(n);for(const B in p){const h=p[B];i.push(B),l[B]=S.slice(h[0],h[1])}if(Yt(l,i)){let B=null;try{B=await tt(v,t.apiKey,o)}catch{}B&&!B.hasZ&&Xt(l,i)}for(const B in l)l[B].forEach((h,w)=>{ut(t,B)[w].geometry=h});const u={...o,query:{...c.query,...xt(t),f:"json"}},b=v.endsWith("/solve")?v:`${v}/solve`,{data:N}=await re(b,u);return yr(N)}function yr(e){const{barriers:t,directionLines:o,directionPoints:i,directions:n,messages:p,polygonBarriers:l,polylineBarriers:c,routes:v,stops:S,traversedEdges:u,traversedJunctions:b,traversedTurns:N}=e,B=a=>{const T=w.find(R=>R.routeName===a);if(T!=null)return T;const f={routeId:w.length+1,routeName:a};return w.push(f),f},h=a=>{const T=w.find(R=>R.routeId===a);if(T!=null)return T;const f={routeId:a,routeName:null};return w.push(f),f},w=[];v==null||v.features.forEach((a,T)=>{a.geometry.spatialReference=v.spatialReference??void 0;const f=a.attributes.Name,R=T+1;w.push({routeId:R,routeName:f,route:a})}),n==null||n.forEach(a=>{const{routeName:T}=a;B(T).directions=a});const d=((S==null?void 0:S.features.every(a=>a.attributes.RouteName==null))??!1)&&w.length>0?w[0].routeName:null;return S==null||S.features.forEach(a=>{var R;a.geometry&&((R=a.geometry).spatialReference??(R.spatialReference=S.spatialReference??void 0));const T=d??a.attributes.RouteName,f=B(T);f.stops??(f.stops=[]),f.stops.push(a)}),o==null||o.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:J}=o;f.directionLines??(f.directionLines={features:[],geometryType:R,spatialReference:J}),f.directionLines.features.push(a)}),i==null||i.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:J}=i;f.directionPoints??(f.directionPoints={features:[],geometryType:R,spatialReference:J}),f.directionPoints.features.push(a)}),u==null||u.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:J}=u;f.traversedEdges??(f.traversedEdges={features:[],geometryType:R,spatialReference:J}),f.traversedEdges.features.push(a)}),b==null||b.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T),{geometryType:R,spatialReference:J}=b;f.traversedJunctions??(f.traversedJunctions={features:[],geometryType:R,spatialReference:J}),f.traversedJunctions.features.push(a)}),N==null||N.features.forEach(a=>{const T=a.attributes.RouteID,f=h(T);f.traversedTurns??(f.traversedTurns={features:[]}),f.traversedTurns.features.push(a)}),pr.fromJSON({routeResults:w,barriers:t,polygonBarriers:l,polylineBarriers:c,messages:p})}let F=class extends Pe(L){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};r([s({type:Boolean,json:{write:!0}})],F.prototype,"doNotLocateOnRestrictedElements",void 0),r([s({types:pt,json:{read:ct,write:!0}})],F.prototype,"geometry",void 0),r([I(Ft)],F.prototype,"geometryType",void 0),r([s({type:String,json:{name:"layerName",write:!0}})],F.prototype,"name",void 0),r([I(Et,{name:"spatialRel"})],F.prototype,"spatialRelationship",void 0),r([s({type:String,json:{write:!0}})],F.prototype,"type",void 0),r([s({type:String,json:{write:!0}})],F.prototype,"where",void 0),F=r([A("esri.rest.support.DataLayer")],F);const dr=F;var Te;let me=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};r([s({type:Boolean,json:{write:!0}})],me.prototype,"doNotLocateOnRestrictedElements",void 0),me=Te=r([A("esri.rest.support.NetworkFeatureSet")],me);const mr=me;let ae=class extends Pe(L){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};r([s({type:Boolean,json:{write:!0}})],ae.prototype,"doNotLocateOnRestrictedElements",void 0),r([s({type:String,json:{write:!0}})],ae.prototype,"url",void 0),ae=r([A("esri.rest.support.NetworkUrl")],ae);const fr=ae;var Be;let y=Be=class extends Pe(L){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return yt(Be,e)}readAccumulateAttributes(e){return e==null?null:e.map(t=>H.fromJSON(t))}writeAccumulateAttributes(e,t,o){e!=null&&e.length&&(t[o]=e.map(i=>H.toJSON(i)))}writePointBarriers(e,t,o){ce(e,t,o)}writePolygonBarrier(e,t,o){ce(e,t,o)}writePolylineBarrier(e,t,o){ce(e,t,o)}readRestrictionAttributes(e){return e==null?null:e.map(t=>_e.fromJSON(t))}writeRestrictionAttributes(e,t,o){e!=null&&e.length&&(t[o]=e.map(i=>_e.toJSON(i)))}readStartTime(e,t){const{startTime:o}=t;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,t){e!=null&&(t.startTime=e==="now"?"now":e.getTime())}readStops(e,t){return Sr(t.stops)}writeStops(e,t,o){ce(e,t,o)}};r([s({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],y.prototype,"accumulateAttributes",void 0),r([P("accumulateAttributes")],y.prototype,"readAccumulateAttributes",null),r([q("accumulateAttributes")],y.prototype,"writeAccumulateAttributes",null),r([s(dt)],y.prototype,"apiKey",void 0),r([s({json:{write:!0}})],y.prototype,"attributeParameterValues",void 0),r([s({type:String,json:{write:!0}})],y.prototype,"directionsLanguage",void 0),r([I(Xe)],y.prototype,"directionsLengthUnits",void 0),r([I(Gt)],y.prototype,"directionsOutputType",void 0),r([I(Ut)],y.prototype,"directionsStyleName",void 0),r([I(Re,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],y.prototype,"directionsTimeAttribute",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"findBestSequence",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"geometryPrecision",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"geometryPrecisionM",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"geometryPrecisionZ",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"ignoreInvalidLocations",void 0),r([I(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],y.prototype,"impedanceAttribute",void 0),r([s({type:Number,json:{write:!0}})],y.prototype,"outputGeometryPrecision",void 0),r([I(qt)],y.prototype,"outputGeometryPrecisionUnits",void 0),r([I(Wt)],y.prototype,"outputLines",void 0),r([s({type:W,json:{name:"outSR",write:!0}})],y.prototype,"outSpatialReference",void 0),r([s({json:{write:!0}})],y.prototype,"overrides",void 0),r([s({json:{name:"barriers",write:!0}})],y.prototype,"pointBarriers",void 0),r([q("pointBarriers")],y.prototype,"writePointBarriers",null),r([s({json:{write:!0}})],y.prototype,"polygonBarriers",void 0),r([q("polygonBarriers")],y.prototype,"writePolygonBarrier",null),r([s({json:{write:!0}})],y.prototype,"polylineBarriers",void 0),r([q("polylineBarriers")],y.prototype,"writePolylineBarrier",null),r([s({type:Boolean,json:{write:!0}})],y.prototype,"preserveFirstStop",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"preserveLastStop",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"preserveObjectID",void 0),r([s({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],y.prototype,"restrictionAttributes",void 0),r([P("restrictionAttributes")],y.prototype,"readRestrictionAttributes",null),r([q("restrictionAttributes")],y.prototype,"writeRestrictionAttributes",null),r([I(Zt)],y.prototype,"restrictUTurns",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnDirections",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnPolygonBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnPolylineBarriers",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnRoutes",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnStops",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnTraversedEdges",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnTraversedJunctions",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnTraversedTurns",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"returnZ",void 0),r([s({type:Date,json:{type:Number,write:!0}})],y.prototype,"startTime",void 0),r([P("startTime")],y.prototype,"readStartTime",null),r([q("startTime")],y.prototype,"writeStartTime",null),r([s({type:Boolean,json:{write:!0}})],y.prototype,"startTimeIsUTC",void 0),r([s({json:{write:!0}})],y.prototype,"stops",void 0),r([P("stops")],y.prototype,"readStops",null),r([q("stops")],y.prototype,"writeStops",null),r([s({type:Boolean,json:{write:!0}})],y.prototype,"timeWindowsAreUTC",void 0),r([s({type:$e,json:{write:!0}})],y.prototype,"travelMode",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"useHierarchy",void 0),r([s({type:Boolean,json:{write:!0}})],y.prototype,"useTimeWindows",void 0),y=Be=r([A("esri.rest.support.RouteParameters")],y);const Fe=y;function hr(e){return e&&"type"in e}function vr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function wr(e){return e&&"url"in e}function gr(e){return e&&"features"in e}function Sr(e){return hr(e)?dr.fromJSON(e):wr(e)?fr.fromJSON(e):vr(e)?mr.fromJSON(e):gr(e)?E.fromJSON(e):null}function ce(e,t,o){e!=null&&(t[o]=O.isCollection(e)?{features:e.toArray().map(i=>i.toJSON())}:e.toJSON())}function we(e){return e.length?e:null}function Ne(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Ne("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Ne("esriGeometryPolyline")}}}function ye(e){return"layers"in e}function br(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function Tr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function Br(e,t,o){var Ie,Ae,Oe,je,Le,De;const i=(Ie=t.networkDataset)==null?void 0:Ie.networkAttributes,n=(i==null?void 0:i.filter(({usageType:m})=>m==="cost"))??[],p=o.travelMode??t.defaultTravelMode;if(p==null)return void st.warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:l,distanceAttributeName:c}=p,v=n.find(({name:m})=>m===l),S=n.find(({name:m})=>m===c),u=((Ae=o.travelMode)==null?void 0:Ae.impedanceAttributeName)??o.impedanceAttribute??t.impedance,b=v==null?void 0:v.units,N=S==null?void 0:S.units;if(!b||!N)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??t.directionsLanguage,h=o.accumulateAttributes??t.accumulateAttributeNames??[],w=new Set(n.filter(({name:m})=>m===l||m===c||m===u||m!=null&&h.includes(m)).map(({name:m})=>m)),d=m=>{for(const Me in m)w.has(Me)||delete m[Me]};for(const m of e.pointBarriers)m.costs!=null&&(m.addedCost=m.costs[u]??0,d(m.costs));for(const m of e.polygonBarriers)m.costs!=null&&(m.scaleFactor=m.costs[u]??1,d(m.costs));for(const m of e.polylineBarriers)m.costs!=null&&(m.scaleFactor=m.costs[u]??1,d(m.costs));const{routeInfo:a}=e,{findBestSequence:T,preserveFirstStop:f,preserveLastStop:R,startTimeIsUTC:J,timeWindowsAreUTC:it}=o;a.analysisSettings=new Vt({accumulateAttributes:h,directionsLanguage:B,findBestSequence:T,preserveFirstStop:f,preserveLastStop:R,startTimeIsUTC:J,timeWindowsAreUTC:it,travelMode:p}),a.totalDuration=z(((Oe=a.totalCosts)==null?void 0:Oe[l])??0,b),a.totalDistance=ge(((je=a.totalCosts)==null?void 0:je[c])??0,N),a.totalLateDuration=z(((Le=a.totalViolations)==null?void 0:Le[l])??0,b),a.totalWaitDuration=z(((De=a.totalWait)==null?void 0:De[l])??0,b),a.totalCosts!=null&&d(a.totalCosts),a.totalViolations!=null&&d(a.totalViolations),a.totalWait!=null&&d(a.totalWait);for(const m of e.stops)m.serviceCosts!=null&&(m.serviceDuration=z(m.serviceCosts[l]??0,b),m.serviceDistance=ge(m.serviceCosts[c]??0,N),d(m.serviceCosts)),m.cumulativeCosts!=null&&(m.cumulativeDuration=z(m.cumulativeCosts[l]??0,b),m.cumulativeDistance=ge(m.cumulativeCosts[c]??0,N),d(m.cumulativeCosts)),m.violations!=null&&(m.lateDuration=z(m.violations[l]??0,b),d(m.violations)),m.wait!=null&&(m.waitDuration=z(m.wait[l]??0,b),d(m.wait))}async function Ee(e){const t=W.WGS84;return await jt(e.spatialReference,t),Lt(e,t)}function z(e,t){switch(t){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function ge(e,t){return t==="decimal-degrees"||t==="points"||t==="unknown"?e:Dt(e,t,"meters")}function Nr(e){const{attributes:t,geometry:o,popupTemplate:i,symbol:n}=e.toGraphic().toJSON();return{attributes:t,geometry:o,popupInfo:i,symbol:n}}const Pr=O.ofType(oe),Rr=O.ofType(se),Ge=O.ofType(X),Ue=O.ofType(Y),qe=O.ofType(ee),We=O.ofType(te),ot="esri.layers.RouteLayer",st=Ze.getLogger(ot);let g=class extends mt(ft(ht(vt(wt(Mt))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new et,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Ge,this.polygonBarriers=new Ue,this.polylineBarriers=new qe,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new We,this.type="route";const t=()=>{this._setStopSymbol(this.stops)};this.addHandles(gt(()=>this.stops,"change",t,{sync:!0,onListenerAdd:t}))}writeFeatureCollectionWebmap(e,t,o,i){const n=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(c=>!!c),p=n.map((c,v)=>v),l=i.origin==="web-map"?"featureCollection.layers":"layers";St(l,n,t),t.opacity=this.opacity,t.visibility=this.visible,t.visibleLayers=p}readDirectionLines(e,t){return this._getNetworkFeatures(t,"DirectionLines",o=>oe.fromGraphic(o))}readDirectionPoints(e,t){return this._getNetworkFeatures(t,"DirectionPoints",o=>se.fromGraphic(o))}get fullExtent(){var n;const e=new He({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(((n=this.routeInfo)==null?void 0:n.geometry)!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const t=this.stops.filter(p=>p.geometry!=null);if(t.length<2)return e;const{spatialReference:o}=t.at(0).geometry;if(o==null)return e;const i=t.toArray().map(p=>{const l=p.geometry;return[l.x,l.y]});return new bt({points:i,spatialReference:o}).extent}readMaxScale(e,t){var n;const o=ye(t)?t.layers:(n=t.featureCollection)==null?void 0:n.layers,i=o==null?void 0:o.find(p=>p.layerDefinition.maxScale!=null);return(i==null?void 0:i.layerDefinition.maxScale)??0}readMinScale(e,t){var n;const o=ye(t)?t.layers:(n=t.featureCollection)==null?void 0:n.layers,i=o==null?void 0:o.find(p=>p.layerDefinition.minScale!=null);return(i==null?void 0:i.layerDefinition.minScale)??0}readPointBarriers(e,t){return this._getNetworkFeatures(t,"Barriers",o=>X.fromGraphic(o))}readPolygonBarriers(e,t){return this._getNetworkFeatures(t,"PolygonBarriers",o=>Y.fromGraphic(o))}readPolylineBarriers(e,t){return this._getNetworkFeatures(t,"PolylineBarriers",o=>ee.fromGraphic(o))}readRouteInfo(e,t){const o=this._getNetworkFeatures(t,"RouteInfo",i=>le.fromGraphic(i));return o.length>0?o.at(0):null}readSpatialReference(e,t){var c,v;const o=ye(t)?t.layers:(c=t.featureCollection)==null?void 0:c.layers;if(!(o!=null&&o.length))return W.WGS84;const{layerDefinition:i,featureSet:n}=o[0],p=n.features[0],l=((v=p==null?void 0:p.geometry)==null?void 0:v.spatialReference)??n.spatialReference??i.spatialReference??i.extent.spatialReference??Ce;return W.fromJSON(l)}readStops(e,t){return this._getNetworkFeatures(t,"Stops",o=>te.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){var e;return((e=this.routeInfo)==null?void 0:e.name)!=null?this.routeInfo.name:"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Je.routeServiceUrl}set url(e){e!=null?this._set("url",Tt(e,st)):this._set("url",Je.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:t}=this;if(!t)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!t.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(t.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=t;await o.signIn(),o.user||await t.reload();const{itemUrl:i,itemControl:n}=t;if(n!=="admin"&&n!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const p={messages:[],origin:"portal-item",portal:o,url:i?Bt(i):void 0,writtenProperties:[]},l=this.write(void 0,p);return t.extent=await Ee(e),t.title=this.title,await t.update({data:l}),t}async saveAs(e,t={}){var c;if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Nt.from(e).clone();o.extent??(o.extent=await Ee(this.fullExtent)),o.id=null,o.portal??(o.portal=Pt.getDefault()),o.title??(o.title=this.title),o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",Rt.MULTI_LAYER,"Route Layer"];const{portal:i}=o,n={messages:[],origin:"portal-item",portal:i,url:null,writtenProperties:[]};await i.signIn();const p=t==null?void 0:t.folder,l=this.write(void 0,n);return await((c=i.user)==null?void 0:c.addItem({item:o,folder:p,data:l})),this.portalItem=o,$t(n),n.portalItem=o,o}async solve(e,t){const o=(e==null?void 0:e.stops)??this.stops,i=(e==null?void 0:e.pointBarriers)??we(this.pointBarriers),n=(e==null?void 0:e.polylineBarriers)??we(this.polylineBarriers),p=(e==null?void 0:e.polygonBarriers)??we(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((br(o)||Tr(o))&&o.features.length<2||O.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(O.isCollection(o))for(const d of o)d.routeName=null;const l=e==null?void 0:e.apiKey,c=this.url,v=await this._getServiceDescription(c,l,t),S=(e==null?void 0:e.travelMode)??v.defaultTravelMode,u=(e==null?void 0:e.accumulateAttributes)??[];S!=null&&(u.push(S.distanceAttributeName),S.timeAttributeName&&u.push(S.timeAttributeName));const b={startTime:new Date},N={accumulateAttributes:u,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:i,polylineBarriers:n,polygonBarriers:p,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!i,returnDirections:!0,returnPolygonBarriers:!!p,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:o},B=e?Fe.from(e):new Fe;for(const d in b)B[d]==null&&(B[d]=b[d]);let h;B.set(N);try{h=await cr(c,B,t)}catch(d){throw It(d)?d:new M("routelayer:failed-route-request","the routing request failed",{error:d})}const w=this._toRouteLayerSolution(h);return this._isOverridden("title")||(this.title=w.routeInfo.name??"Route"),Br(w,v,B),w}update(e){const{stops:t,directionLines:o,directionPoints:i,pointBarriers:n,polylineBarriers:p,polygonBarriers:l,routeInfo:c}=e;this.set({stops:t,pointBarriers:n,polylineBarriers:p,polygonBarriers:l}),this._set("directionLines",o),this._set("directionPoints",i),this._set("routeInfo",c),c.geometry!=null&&(this.spatialReference=c.geometry.spatialReference)}_getNetworkFeatures(e,t,o,i){var w;const n=ye(e)?e.layers:(w=e.featureCollection)==null?void 0:w.layers,p=n==null?void 0:n.find(d=>d.layerDefinition.name===t);if(p==null)return new O;const{layerDefinition:l,popupInfo:c,featureSet:v}=p,S=l.drawingInfo.renderer,{features:u}=v,b=v.spatialReference??l.spatialReference??l.extent.spatialReference??Ce,N=S&&At(S),B=W.fromJSON(b),h=u.map(d=>{const a=K.fromJSON(d);a.geometry!=null&&d.geometry!=null&&d.geometry.spatialReference==null&&(a.geometry.spatialReference=B);const T=o(a);return T.symbol??(T.symbol=(N==null?void 0:N.getSymbol(a))??this._getNetworkSymbol(t)),T.popupTemplate??(T.popupTemplate=c&&Ot.fromJSON(c)),T});return i&&h.some(d=>!d.symbol)&&i(h),new O(h)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,t,o){if(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const i=await tt(e,t,o);return this._cachedServiceDescription={serviceDescription:i,url:e},i}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:u})=>u!=null))return;const{first:t,last:o,middle:i,unlocated:n,waypoint:p,break:l}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((u,b)=>{switch(b){case 0:u.symbol=t;break;case e.length-1:u.symbol=o;break;default:u.symbol=i}});const c=e.map(({sequence:u})=>u).filter(u=>u!=null),v=Math.min(...c),S=Math.max(...c);for(const u of e)u.sequence!==v?u.sequence!==S?u.status==="ok"||u.status==="not-located-on-closest"?u.locationType!=="waypoint"?u.locationType!=="break"?u.symbol=i:u.symbol=l:u.symbol=p:u.symbol=n:u.symbol=o:u.symbol=t}_toRouteLayerSolution(e){var S,u,b,N,B,h,w;const t=(S=e.routeResults[0].stops)==null?void 0:S.map(d=>te.fromJSON(d.toJSON()));this._setStopSymbol(t);const o=new We(t),i=new Ue((u=e.polygonBarriers)==null?void 0:u.map(d=>{const a=Y.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.polygonBarriers,a})),n=new qe((b=e.polylineBarriers)==null?void 0:b.map(d=>{const a=ee.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.polylineBarriers,a})),p=new Ge((N=e.pointBarriers)==null?void 0:N.map(d=>{const a=X.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.pointBarriers,a})),l=(B=e.routeResults[0].route)==null?void 0:B.toJSON(),c=le.fromJSON(l);c.symbol=this.defaultSymbols.routeInfo;const v=new Rr((h=e.routeResults[0].directionPoints)==null?void 0:h.features.map(d=>{const a=se.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.directionPoints,a}));return{directionLines:new Pr((w=e.routeResults[0].directionLines)==null?void 0:w.features.map(d=>{const a=oe.fromJSON(d.toJSON());return a.symbol=this.defaultSymbols.directionLines,a})),directionPoints:v,pointBarriers:p,polygonBarriers:i,polylineBarriers:n,routeInfo:c,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",oe.fields,oe.popupInfo,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",se.fields,se.popupInfo,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,t,o,i,n,p,l){if(!(e!=null&&e.length))return null;const c=this.spatialReference.toJSON(),{fullExtent:v,maxScale:S,minScale:u}=this;return{featureSet:{features:e.toArray().map(b=>Nr(b)),geometryType:o,spatialReference:c},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:t!=null?t.toJSON():Ne(o)}},extent:v.toJSON(),fields:i,geometryType:o,hasM:!1,hasZ:!1,maxScale:S,minScale:u,name:p,objectIdField:"ObjectID",spatialReference:c,title:l,type:"Feature Layer",typeIdField:""},popupInfo:n}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",X.fields,X.popupInfo,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",Y.fields,Y.popupInfo,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ee.fields,ee.popupInfo,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new O([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",le.fields,le.popupInfo,"RouteInfo","Route Details")}_writeStops(){var p,l,c;const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",te.fields,te.popupInfo,"Stops","Stops");if(e==null)return null;const{stops:t}=this.defaultSymbols,o=(p=t==null?void 0:t.first)==null?void 0:p.toJSON(),i=(l=t==null?void 0:t.middle)==null?void 0:l.toJSON(),n=(c=t==null?void 0:t.last)==null?void 0:c.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:i,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:n,label:"Last Stop"}]},e}};r([s({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],g.prototype,"_featureCollection",void 0),r([q(["web-map","portal-item"],"_featureCollection")],g.prototype,"writeFeatureCollectionWebmap",null),r([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],g.prototype,"_type",void 0),r([s({nonNullable:!0,type:et})],g.prototype,"defaultSymbols",void 0),r([s({readOnly:!0})],g.prototype,"directionLines",void 0),r([P(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],g.prototype,"readDirectionLines",null),r([s({readOnly:!0})],g.prototype,"directionPoints",void 0),r([P(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],g.prototype,"readDirectionPoints",null),r([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],g.prototype,"featureCollectionType",void 0),r([s({readOnly:!0})],g.prototype,"fullExtent",null),r([s({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],g.prototype,"legendEnabled",void 0),r([s({type:["show","hide"]})],g.prototype,"listMode",void 0),r([s({type:Number,nonNullable:!0,json:{write:!1}})],g.prototype,"maxScale",void 0),r([P(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],g.prototype,"readMaxScale",null),r([s({type:Number,nonNullable:!0,json:{write:!1}})],g.prototype,"minScale",void 0),r([P(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],g.prototype,"readMinScale",null),r([s({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],g.prototype,"operationalLayerType",void 0),r([s({nonNullable:!0,type:O.ofType(X)})],g.prototype,"pointBarriers",void 0),r([P(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],g.prototype,"readPointBarriers",null),r([s({nonNullable:!0,type:O.ofType(Y)})],g.prototype,"polygonBarriers",void 0),r([P(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],g.prototype,"readPolygonBarriers",null),r([s({nonNullable:!0,type:O.ofType(ee)})],g.prototype,"polylineBarriers",void 0),r([P(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],g.prototype,"readPolylineBarriers",null),r([s({readOnly:!0})],g.prototype,"routeInfo",void 0),r([P(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],g.prototype,"readRouteInfo",null),r([s({type:W})],g.prototype,"spatialReference",void 0),r([P(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],g.prototype,"readSpatialReference",null),r([s({nonNullable:!0,type:O.ofType(te)})],g.prototype,"stops",void 0),r([P(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],g.prototype,"readStops",null),r([s()],g.prototype,"title",null),r([s({readOnly:!0,json:{read:!1}})],g.prototype,"type",void 0),r([s()],g.prototype,"url",null),g=r([A(ot)],g);const Gr=g;export{Gr as default}; diff --git a/dist/assets/RouteLayerView3D-tOy-WtTD.js b/dist/assets/RouteLayerView3D-tOy-WtTD.js new file mode 100644 index 0000000..aa7a755 --- /dev/null +++ b/dist/assets/RouteLayerView3D-tOy-WtTD.js @@ -0,0 +1 @@ +import{P as c,F as h,n as m,fP as y,V as d,d as u,G as g,e as i,y as o,c as f}from"./index-J0iiHjMT.js";import{m as b,c as O,C as _,T as I,j as v,S as w,O as S}from"./Stop-W76EJiT2.js";import{n as V}from"./LayerView3D-iOx2MD1g.js";import{O as G}from"./GraphicsProcessor-rh5nA4fc.js";import{l as C}from"./projectExtentUtils-TwA6ooHn.js";import{r as P}from"./EventedSet-JGlFrfoR.js";import{u as R}from"./LayerView-efDufa6j.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";function $(e){return e instanceof b||e instanceof O||e instanceof _||e instanceof I||e instanceof v||e instanceof w||e instanceof S}let r=class extends V(R){constructor(){super(...arguments),this.type="route-3d",this.loadedGraphics=new P,this._byObjectID=new Map,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null}initialize(){this._set("processor",new G({owner:this,scaleVisibilityEnabled:!0,frustumVisibilityEnabled:!0})),this.addResolvingPromise(this.processor.initializePromise),this._updatingHandles.addOnCollectionChange(()=>this._routeItems,e=>this._routeItemsChanged(e),c),this.addResolvingPromise(C(this).then(e=>this.fullExtentInLocalViewSpatialReference=e)),this.addHandles(h(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:t.ready},()=>()=>this.notifyChange("updating"),{once:!0}))}destroy(){var e;this._updatingHandles.removeAll(),this._set("processor",m(this.processor)),(e=this._get("_routeItems"))==null||e.destroy()}get _routeItems(){return new y({getCollections:()=>[this.layer.pointBarriers,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.stops,this.layer.directionLines,this.layer.directionPoints,this.layer.routeInfo!=null?new d([this.layer.routeInfo]):null]})}_routeItemsChanged(e){if(e.removed.length){this.loadedGraphics.removeMany(e.removed.map(t=>{const s=this._byObjectID.get(t);return this._byObjectID.delete(t),s}));for(const t of e.removed)this.removeHandles(t)}if(e.added.length){this.loadedGraphics.addMany(e.added.map(t=>{const s=t.toGraphic();return this._byObjectID.set(t,s),s}));for(const t of e.added)this.addHandles([u(()=>t.geometry,(s,n)=>{this._updateGraphic(t,"geometry",s,n)}),u(()=>t.symbol,(s,n)=>{this._updateGraphic(t,"symbol",s,n)})],t)}}get legendEnabled(){var e;return this.canResume()&&!((e=this.processor)!=null&&e.frustumVisibilitySuspended)}getSuspendInfo(){var t,s;const e=super.getSuspendInfo();return e.outsideScaleRange=((t=this.processor)==null?void 0:t.scaleVisibilitySuspended)??!1,e.outsideOfView=((s=this.processor)==null?void 0:s.frustumVisibilitySuspended)??!1,e}async fetchPopupFeatures(e,t){return(t==null?void 0:t.clientGraphics)??[]}getHit(e){return this.processor.getHit(e)}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){var s;return(s=this.processor)==null?void 0:s.computeAttachmentOrigin(e,t)}getSymbolLayerSize(e,t){return this.processor.getSymbolLayerSize(e,t)}async queryGraphics(){return new d(this.loadedGraphics.toArray())}maskOccludee(e){return this.processor.maskOccludee(e)}highlight(e){return $(e)&&(e=this._byObjectID.get(e)),this.processor.highlight(e)}get updatePolicy(){var e;return((e=this.processor)==null?void 0:e.graphicsCore.effectiveUpdatePolicy)||g.SYNC}canResume(){var e;return super.canResume()&&!((e=this.processor)!=null&&e.scaleVisibilitySuspended)}isUpdating(){var e,t,s;return!(!((e=this.processor)!=null&&e.updating)&&((s=(t=this.view)==null?void 0:t.basemapTerrain)!=null&&s.ready))}get performanceInfo(){var e,t;return{displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:-1,totalNumberOfFeatures:-1,nodes:0,core:null,updating:this.updating,elevationUpdating:((e=this.processor)==null?void 0:e.elevationAlignment.updating)??!1,visibilityFrustum:!((t=this.processor)!=null&&t.frustumVisibilitySuspended)}}_updateGraphic(e,t,s,n){var p;const l=this._byObjectID.get(e);l[t]=s,a.graphic=l,a.property=t,a.oldValue=n,a.newValue=s,(p=this.processor)==null||p.graphicsCore.graphicUpdateHandler(a)}};i([o()],r.prototype,"_routeItems",null),i([o()],r.prototype,"loadedGraphics",void 0),i([o({readOnly:!0})],r.prototype,"legendEnabled",null),i([o()],r.prototype,"layer",void 0),i([o({readOnly:!0})],r.prototype,"processor",void 0),i([o({type:Boolean})],r.prototype,"slicePlaneEnabled",void 0),r=i([f("esri.views.3d.layers.RouteLayerView3D")],r);const a={graphic:null,property:null,oldValue:null,newValue:null},U=r;export{U as default}; diff --git a/dist/assets/SMAAData-j7UWeZ7Z.js b/dist/assets/SMAAData-j7UWeZ7Z.js new file mode 100644 index 0000000..c928176 --- /dev/null +++ b/dist/assets/SMAAData-j7UWeZ7Z.js @@ -0,0 +1 @@ +const A="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII=",b="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII=";export{A as areaTexture,b as searchTexure}; diff --git a/dist/assets/SceneLayerGraphicsView3D-Abn6jwJk.js b/dist/assets/SceneLayerGraphicsView3D-Abn6jwJk.js new file mode 100644 index 0000000..78655c4 --- /dev/null +++ b/dist/assets/SceneLayerGraphicsView3D-Abn6jwJk.js @@ -0,0 +1,7 @@ +import{ls as V,K as R,lt as H,fQ as q,n as y,lu as Q,P as N,d as U,de as z,jO as C,G as T,dB as B,lv as k,lw as W,c8 as Z,Z as w,gn as D,lx as K,fR as Y,ly as X,bn as J,h$ as F,lz as ee,as as te,lA as re,lB as ie,S as G,bB as se,lC as oe,lD as ae,lE as ne,lF as de,ca as S,ai as le,e as p,y as g,dC as he,fi as ue,c as ce,lG as L,aa as pe,lH as ge}from"./index-J0iiHjMT.js";import{S as A,e as me}from"./I3SOverrides-5dCbMm3h.js";import{n as _e}from"./LayerView3D-iOx2MD1g.js";import{P as fe,l as ye}from"./HeatmapDensity.glsl-y7dUg--m.js";import{c as be,i as ve,u as xe,f as Ee,a as Ie,j as we}from"./SceneLayerView-MZstNOoI.js";import{t as Ne}from"./DefinitionExpressionSceneLayerView-oAOUEjm-.js";import{i as Ce}from"./PopupSceneLayerView-cRxapYqF.js";import"./I3SNode-5SPByfpU.js";import"./ReactiveSet-HLstcUcf.js";import"./meshFeatureSet-Mcou8mDC.js";import"./External-GV0jSEES.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureLayerView3D-t6NDkLO0.js";import"./FeatureLayerViewBase3D-VurTj7t3.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";class P extends V{constructor(t){super("SceneLayerWorker","dracoDecompressPointCloudData",{dracoDecompressPointCloudData:i=>[i.geometryBuffer]},t,{hasInitialize:!0})}}class Oe extends R{constructor(t,i){super(),this._updateAndCompare=t,this._notifyUpdated=i,this._nodes=new Map,this._graphics=new Map,this._duplicates=new Map}clear(){if(this._graphics.size>0){const t=this.toArray();this._graphics.clear(),this.emit("change",{added:[],removed:t})}this._nodes.clear()}get length(){return this._graphics.size}get(t){return this._graphics.get(t)}getNode(t){return this._nodes.get(t)}hasNode(t){return this._nodes.has(t)}nodes(){return this._nodes.values()}addNode(t,i){this._nodes.set(t,i);const r=i.graphics;if(r.length===0)return;const s=new Set;for(let a=0;a0?r.filter(a=>!s.has(a.objectId)):r;o.length>0&&this.emit("change",{added:o,removed:[]})}removeNode(t){const i=this._nodes.get(t);if(!i)return void console.error("Removing unknown node");this._nodes.delete(t);const r=new Set,s=[];for(const o of i.graphics){const a=o.objectId,n=this._graphics.get(a);if(!n)continue;const d=this._duplicates.get(a);if(d){const h=d.indexOf(t);if(h===-1){console.error("error: removing graphic from node that should not reference it.");continue}if(d.splice(h,1),n.nodeIndex===t){let u=this.getNode(d[0]);for(let l=1;lu.node.level)&&(u=m)}u!=null&&r.add(u)}d.length===1&&this._duplicates.delete(a)}else this._graphics.delete(a),s.push(o)}s.length>0&&this.emit("change",{added:[],removed:s}),r.forEach(o=>this._updateForeignGraphics(o))}_updateForeignGraphics(t){const i=[],r=t.node.index,s=t.node.level;let o=0;for(;os)o+=n;else{for(let h=o;h!!t(r)&&(i=r,!0)),i}forEach(t){this._graphics.forEach(i=>t(i))}forEachNode(t){this._nodes.forEach((i,r)=>t(i,r))}get nodeCount(){return this._nodes.size}_checkInvariants(){const t=new Map;this._nodes.forEach((r,s)=>{s!==r.node.index&&console.error("Mismatched node index"),r.graphics.forEach(o=>{t.set(o.objectId,1+(t.get(o.objectId)??0));const a=this._duplicates.get(o.objectId);a&&!a.includes(s)&&console.error("Node not listed in duplicate list"),a||o.nodeIndex===s||console.error("Unique graphic does not reference owning node index")})}),this._graphics.size!==t.size&&console.error("Mismatch between actual and expected number of graphics");let i=0;t.forEach((r,s)=>{i+=r>1?1:0;const o=this._graphics.get(s);if(!o)return void console.error("Missing graphic entry");const a=this._nodes.get(o.nodeIndex);if(!a)return void console.error("Graphic references unkown node");const n=this._duplicates.get(s);n?(n.length!==r&&console.error("Wrong number of entries in duplicate list"),n.forEach(d=>{const h=this._nodes.get(d);h?h.node.level>a.node.level&&console.error("Duplicated graphic does not reference highest level node"):console.error("Unknown node in duplicate list")})):r>1&&console.error("Missing duplicates entry")}),this._duplicates.size!==i&&console.error("Mismatch between expected and actual number of duplicate entries")}}const M=Ie();class De{constructor(t,i,r,s){this.graphics=t,this.featureIds=i,this.attributeInfo=r,this.node=s}}let c=class extends Ne(Ce(_e(we))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new Oe((e,t,i)=>Ge(e,t,i),e=>this.processor.graphicsCore.recreateGraphics(e)),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{var r;q(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=(r=this.view.resourceController)==null?void 0:r.memoryController;this._i3sOverrides=new A({view:this.view,layer:e,memoryController:i}),y(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){var t,i;this.addResolvingPromise(this.layer.indexInfo);const e=(t=this.view.resourceController)==null?void 0:t.memoryController;this._i3sOverrides=new A({view:this.view,layer:this.layer,memoryController:e}),Q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new be({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,r=>this._rangeInfosChanged(r),N),this._updatingHandles.add(()=>this.layer.renderer,(r,s)=>this._rendererChange(r,s)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this._excludeObjectIdsSorted],()=>this._filterChange()),this.addHandles(U(()=>C.I3S_TREE_SHOW_TILES,r=>{if(r&&!this._treeDebugger){const s=this._controller.crsIndex;z(()=>import("./I3STreeDebugger-tPVEJfH8.js"),__vite__mapDeps([0,1,2,3])).then(({I3STreeDebugger:o})=>{!this._treeDebugger&&C.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new o({lv:this,view:this.view,nodeSR:s}))})}else r||!this._treeDebugger||C.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},N)),this._set("processor",new fe({owner:this,preferredUpdatePolicy:T.ASYNC,scaleVisibilityEnabled:!0,filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:r=>this._updateClippingExtent(r)})),(i=this.processor.elevationAlignment)==null||i.events.on("invalidate-elevation",r=>this._controller.updateElevationChanged(r.extent,r.spatialReference)),this.supportsHeightUnitConversion&&(this._verticalScale=B("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.initializePromise),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new me({layerView:this,scaleVisibilityEnabled:!1}),k(this.layer.geometryDefinitions)&&(this._worker=new P(r=>this.view.resourceController.immediate.schedule(r))),this.addHandles(this.layer.on("apply-edits",r=>this._updatingHandles.addPromise(r.result))),this.addHandles(this.layer.on("edits",r=>{const s=this._pendingEditsQueue.then(()=>this._handleEdits(r)).then();this._pendingEditsQueue=s,this._updatingHandles.addPromise(s)})),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,r=>this._controller.featureTarget=r,N),this._updatingHandles.add(()=>this.suspended,r=>{r&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=y(this._treeDebugger),this._i3sOverrides=y(this._i3sOverrides),this._set("processor",y(this.processor)),this._controller=y(this._controller),this._queryEngine=y(this._queryEngine),this._worker=y(this._worker),this._memCache=y(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=y(this._fieldsHelper)}get i3slayer(){return this.layer}get updatingProgressValue(){var e;return((e=this._controller)==null?void 0:e.updatingProgress)??1}get requiredFields(){var e;return((e=this._fieldsHelper)==null?void 0:e.requiredFields)??[]}get maximumNumberOfFeatures(){var t,i;const e=(i=(t=this.processor)==null?void 0:t.graphicsCore)==null?void 0:i.displayFeatureLimit;return(e==null?void 0:e.maximumNumberOfFeatures)??0}set maximumNumberOfFeatures(e){e!=null?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){var e;return!this.suspended&&!!((e=this._controller)!=null&&e.useMaximumNumberOfFeatures)&&!this._controller.leavesReached}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds;return e.length?e.toArray().sort((t,i)=>t-i):null}get lodFactor(){return this.layer.semantic==="Labels"?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){var e;return!this.suspended&&!!((e=this._controller)!=null&&e.rootNodeVisible)}get legendEnabled(){var e;return this.contentVisible&&((e=this.i3slayer)==null?void 0:e.legendEnabled)===!0}async whenGraphicAttributes(e,t){return W(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){var r;if(!this.loadedGraphics)return null;const t=Z(this.loadedGraphics.find(s=>s.uid===e),this.layer),i=this._getObjectIdField();return(r=t==null?void 0:t.attributes)!=null&&r[i]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){var e,t,i;return!!((e=this._controller)!=null&&e.updating||(t=this.processor)!=null&&t.updating||(i=this._fieldsHelper)!=null&&i.updating||this.layerFilterUpdating)}highlight(e){return this.processor.highlight(e,this.layer.objectIdField)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return ve(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const i={geometryBuffer:e.geometryBuffer};this._worker==null&&(this._worker=new P(s=>this.view.resourceController.immediate.schedule(s)));const r=await this._worker.invoke(i,t);if(r==null)throw new Error("Failed to decompress Draco point data");return{positionData:r.positions,featureIds:r.featureIds}}async addNode(e,t,i){var f;if(!O(t)&&!Fe(t))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void w.getLogger(this).error("I3S node "+e.id+" already added");const r=this.layer.fullExtent!=null?Se(this.layer.fullExtent.clone(),.5):null,s=[],{featureIds:o,pointPositions:a}=O(t)?await this._extractBinaryPointPositions(e,t,i):this._extractLegacyPointPositions(t);this._validatePositions(e,o,a,r,s);const n=this._controller.crsVertex,d=this.view.spatialReference;D(a,n,0,a,d,0,o.length);const h=O(t)?e.level:0,u=this._createGraphics(o,a,e.index,h),l=new De(u,o,t.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(l.featureIds,t.attributeDataInfo,i),e.numFeatures=l.graphics.length,this._updateNodeMemory(e),$(l),s.length>0&&(this._computeObb(e,s,n),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(l);if(this._verticalScale!=null)for(const b of l.graphics)this._verticalScale(b.geometry);const m=this.view._stage.renderView.objectAndLayerIdRenderHelper;if(m!=null){const b=K(this.view.map,this.layer.uid);for(let x=0;x3)continue;const m=((o=u.params.vertexAttributes)==null?void 0:o.position)??[0,0,0],f=3*r.length;i[f]=d[0]+m[0],i[f+1]=d[1]+m[1],i[f+2]=h===3?d[2]+m[2]:NaN,r.push(l)}return{featureIds:r,pointPositions:i}}_validatePositions(e,t,i,r,s){if(r==null&&e.serviceObb)return;const o=t.length,a=3;for(let n=0;noe(r)+i,ae(e.featureIds)+1024);this._memCache.put(this._getMemCacheKey(e.node),e,t)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const i=e.node;this._updateNodeMemory(i),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return t==null?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){var t;return(t=this._memCache)==null?void 0:t.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,t,i,r){this.loadedGraphics.hasNode(e.index)?w.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(t.featureIds,i,r),this.loadedGraphics.addNode(e.index,t),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),t.attributeInfo=i,this._attributeValuesChanged(t),this._filterNode(t),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,i)=>e.push(i))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if((t==null?void 0:t.attributeInfo)!=null)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if((t==null?void 0:t.attributeInfo)!=null)return t.attributeInfo.attributeData}_setAttributeData(e,t){const i=this.loadedGraphics.getNode(e);(i==null?void 0:i.attributeInfo)!=null&&(i.attributeInfo.attributeData=t,this._attributeValuesChanged(i))}async updateAttributes(e,t,i){const r=this.loadedGraphics.getNode(e);r!=null&&(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,t,i),r.attributeInfo=t,this._attributeValuesChanged(r))}_attributeValuesChanged(e){if($(e),this._filterNode(e),this.processor.graphicsCore.labelsEnabled){const t=e.graphics.map(i=>i.uid);this.processor.graphicsCore.updateLabelingInfo(t)}}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||ne}_getGlobalIdField(){var e;return(e=this.layer.associatedLayer)==null?void 0:e.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:i}}=this,r=new Set;let s,o;e?(await e.collectRequiredFields(r,i),s=Array.from(r).sort()):s=[],r.clear(),t?(await t.collectRequiredFields(r,i),o=Array.from(r).sort()):o=[],s.length===o.length&&s.every((a,n)=>s[n]===o[n])||this._reloadAllNodes()}_rangeInfosChanged(e){e!=null&&e.length>0&&w.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,i=this._excludeObjectIdsSorted,r=this._getObjectIdField();for(const s of e.graphics){const o=s.visible,a=!t||this._evaluateClause(t,s),n=i==null||de(i,s.attributes[r])<0;s.visible=a&&n,o!==s.visible&&(_.graphic=s,_.property="visible",_.oldValue=o,_.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(_))}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter!=null?this.filter.createQuery(e):new S(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t==null?void 0:t.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t==null?void 0:t.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t==null?void 0:t.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():S.from(e))}_setupQueryEngine(){const e=()=>this.processor.featureStore;this._queryEngine=new ye({context:{spatialReference:this.view.spatialReference,layer:this.layer,scheduler:this.view.resourceController.scheduler,get featureStore(){return e()},hasZ:this.hasZ,hasM:this.hasM},priority:le.FEATURE_QUERY_ENGINE})}get usedMemory(){var e,t;return((t=(e=this.processor)==null?void 0:e.graphicsCore)==null?void 0:t.usedMemory)??0}get unloadedMemory(){var e,t,i;return .8*((((e=this._controller)==null?void 0:e.unloadedMemoryEstimate)??0)+(((i=(t=this.processor)==null?void 0:t.graphicsCore)==null?void 0:i.unprocessedMemoryEstimate)??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,i=await xe(t,e);Ee(t,i)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:i=>this.loadedGraphics.forEachNode(r=>i(r.node,r.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:i=>this.getAttributeData(i),setAttributeData:(i,r,s)=>{this._setAttributeData(i,r);const o=this.loadedGraphics.getNode(i);if(s!=null){const a=this.loadedGraphics.get(s.attributes[e]);a!=null&&this.processor.graphicsCore.recreateGraphics([a])}else o!=null&&this.processor.graphicsCore.recreateGraphics(o.graphics)},clearMemCache:()=>{}}}get performanceInfo(){const e={displayedNumberOfFeatures:this.loadedGraphics.length,maximumNumberOfFeatures:this.maximumNumberOfFeatures,totalNumberOfFeatures:-1,nodes:this.loadedGraphics.nodeCount,core:this.processor.graphicsCore.performanceInfo};return this._controller&&this._controller.updateStats(e),e}get test(){return{controller:this._controller,numNodes:this.loadedGraphics.nodeCount,loadedGraphics:this.loadedGraphics}}};p([g()],c.prototype,"processor",void 0),p([g({type:he})],c.prototype,"filter",void 0),p([g()],c.prototype,"loadedGraphics",void 0),p([g()],c.prototype,"i3slayer",null),p([g()],c.prototype,"_controller",void 0),p([g()],c.prototype,"updating",void 0),p([g()],c.prototype,"suspended",void 0),p([g()],c.prototype,"holeFilling",void 0),p([g(ue)],c.prototype,"updatingProgress",void 0),p([g()],c.prototype,"updatingProgressValue",null),p([g(M.requiredFields)],c.prototype,"requiredFields",null),p([g(M.availableFields)],c.prototype,"availableFields",void 0),p([g()],c.prototype,"_fieldsHelper",void 0),p([g({type:Number})],c.prototype,"maximumNumberOfFeatures",null),p([g({readOnly:!0})],c.prototype,"maximumNumberOfFeaturesExceeded",null),p([g()],c.prototype,"_excludeObjectIdsSorted",null),p([g({readOnly:!0})],c.prototype,"lodFactor",null),p([g({readOnly:!0})],c.prototype,"hasM",null),p([g({readOnly:!0})],c.prototype,"hasZ",null),p([g()],c.prototype,"contentVisible",null),p([g({readOnly:!0})],c.prototype,"legendEnabled",null),c=p([ce("esri.views.3d.layers.SceneLayerGraphicsView3D")],c);const yt=c;function Fe(e){return"pointData"in e}function O(e){return"geometryBuffer"in e&&e.geometryBuffer!==null}function Ge(e,t,i){const r=t.attributeInfo;if((r==null?void 0:r.loadedAttributes)==null||r.attributeData==null)return!1;let s=!1;for(const{name:o}of r.loadedAttributes)if(r.attributeData[o]){const a=L(r.attributeData[o],i);a!==e.attributes[o]&&(e.attributes[o]=a,s=!0)}return s}function $(e){const t=e.attributeInfo,i=e.node.index;if((t==null?void 0:t.loadedAttributes)!=null&&t.attributeData!=null)for(let r=0;r __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SceneLayerSnappingSource-u6yw_bMd.js b/dist/assets/SceneLayerSnappingSource-u6yw_bMd.js new file mode 100644 index 0000000..a21e8d0 --- /dev/null +++ b/dist/assets/SceneLayerSnappingSource-u6yw_bMd.js @@ -0,0 +1 @@ +import{e as s,y as n,c as g,p as w,fm as k,gy as m,m8 as C,ls as b,aa as S,k as H,ak as L,a as $,m9 as E,fw as _,g as O,s as I,e3 as V}from"./index-J0iiHjMT.js";import{r as R}from"./VertexSnappingCandidate-sgrBHAMS.js";import"./PointSnappingHint-ULetRXiW.js";let d=class extends w{constructor(e){super(e),this.availability=0,this._ids=new Set}destroy(){this._workerHandle.destroy(),this._workerHandle=null}initialize(){this._workerHandle=new x(this.schedule,{fetchAllEdgeLocations:(e,t)=>this._fetchAllEdgeLocations(e,t)})}async fetchCandidates(e,t){const i=e.coordinateHelper,{point:c}=e,a=P;this.renderCoordsHelper.toRenderCoords(c,i.spatialReference,a);const u=e.distance,l=typeof u=="number"?u:u.distance,p=await this._workerHandle.invoke({bounds:k(a[0],a[1],a[2],l),returnEdge:e.returnEdge,returnVertex:e.vertexMode!=="none"},t);return p.candidates.sort((y,f)=>y.distance-f.distance),p.candidates.map(y=>this._convertCandidate(i,y))}async add(e,t){this._ids.add(e.id),await this._workerHandle.invokeMethod("add",e,t)}async remove(e,t){this._ids.delete(e.id),await this._workerHandle.invokeMethod("remove",e,t)}_convertCandidate(e,t){switch(t.type){case"edge":return new m({objectId:t.objectId,targetPoint:this._convertRenderCoordinate(e,t.target),edgeStart:this._convertRenderCoordinate(e,t.start),edgeEnd:this._convertRenderCoordinate(e,t.end),isDraped:!1});case"vertex":return new R({objectId:t.objectId,targetPoint:this._convertRenderCoordinate(e,t.target),isDraped:!1})}}_convertRenderCoordinate({spatialReference:e},t){const i=S();return this.renderCoordsHelper.fromRenderCoords(t,i,e),C(i)}async _fetchAllEdgeLocations(e,t){const i=[],c=[];for(const{id:a,uid:u}of e.components)this._ids.has(a)&&i.push((async()=>{const l=await this.fetchEdgeLocations(a,t.signal),p=l.locations.buffer;return c.push(p),{id:a,uid:u,objectIds:l.objectIds,locations:p,origin:l.origin,type:l.type}})());return{result:{components:(await Promise.all(i)).filter(({id:a})=>this._ids.has(a))},transferList:c}}};s([n({constructOnly:!0})],d.prototype,"renderCoordsHelper",void 0),s([n({constructOnly:!0})],d.prototype,"fetchEdgeLocations",void 0),s([n({constructOnly:!0})],d.prototype,"schedule",void 0),s([n({readOnly:!0})],d.prototype,"availability",void 0),d=s([g("esri.views.interactive.snapping.featureSources.sceneLayerSource.SceneLayerSnappingSourceWorker")],d);class x extends b{constructor(e,t){super("SceneLayerSnappingSourceWorker","fetchCandidates",{},e,{strategy:"dedicated",client:t})}}const P=S();let o=class extends w{get updating(){return this._updatingHandles.updating}constructor(r){super(r),this.availability=1,this._updatingHandles=new H,this._abortController=new AbortController}destroy(){this._tracker=L(this._tracker),this._abortController=$(this._abortController),this._updatingHandles.destroy()}initialize(){const{view:r}=this,e=r.resourceController;this._edgeWorker=new E(v(e)),this._workerHandle=new d({renderCoordsHelper:this.view.renderCoordsHelper,schedule:v(e),fetchEdgeLocations:async(t,i)=>{if(this._tracker==null)throw new Error("tracker-not-initialized");return this._tracker.fetchEdgeLocations(t,this._edgeWorker,i)}}),this._updatingHandles.addPromise(this._setupLayerView()),this.addHandles([_(this._workerHandle),_(this._edgeWorker)])}async fetchCandidates(r,e){return this._workerHandle.fetchCandidates(r,e)}refresh(){}async _setupLayerView(){var t;if(this.destroyed)return;const r=(t=this._abortController)==null?void 0:t.signal,e=await this.getLayerView();e==null||O(r)||(this._tracker=e.trackSnappingSources({add:(i,c)=>{this._updatingHandles.addPromise(this._workerHandle.add({id:i,bounds:c},r))},remove:i=>{this._updatingHandles.addPromise(this._workerHandle.remove({id:i},r))}}))}};function v(r){return e=>r.immediate.schedule(e)}s([n({constructOnly:!0})],o.prototype,"getLayerView",void 0),s([n({constructOnly:!0})],o.prototype,"view",void 0),s([n({readOnly:!0})],o.prototype,"updating",null),s([n({readOnly:!0})],o.prototype,"availability",void 0),o=s([g("esri.views.interactive.snapping.featureSources.I3SSnappingSource")],o);let h=class extends w{get updating(){return this._i3sSources.some(r=>r.updating)}constructor(r){super(r),this.availability=1,this._i3sSources=[]}destroy(){this._i3sSources.forEach(r=>r.destroy()),this._i3sSources.length=0}initialize(){const{view:r}=this,e=this.layerSource.layer;this._i3sSources=e.type==="building-scene"?this._getBuildingSceneI3SSources(r,e):[this._getSceneLayerI3SSource(r,e)]}async fetchCandidates(r,e){const t=await Promise.all(this._i3sSources.map(i=>i.fetchCandidates(r,e)));return I(e),t.flat()}refresh(){this._i3sSources.forEach(r=>r.refresh())}_getBuildingSceneI3SSources(r,e){return e.allSublayers.toArray().map(t=>t.type==="building-component"?new o({getLayerView:async()=>(await r.whenLayerView(e)).whenSublayerView(t),view:r}):null).filter(V)}_getSceneLayerI3SSource(r,e){return new o({getLayerView:async()=>{const t=await r.whenLayerView(e);return t.type==="scene-layer-graphics-3d"?void 0:t},view:r})}};s([n({constructOnly:!0})],h.prototype,"layerSource",void 0),s([n({constructOnly:!0})],h.prototype,"view",void 0),s([n({readOnly:!0})],h.prototype,"updating",null),s([n({readOnly:!0})],h.prototype,"availability",void 0),h=s([g("esri.views.interactive.snapping.featureSources.SceneLayerSnappingSource")],h);export{h as SceneLayerSnappingSource}; diff --git a/dist/assets/SceneLayerSnappingSourceWorker-gaKuqg8q.js b/dist/assets/SceneLayerSnappingSourceWorker-gaKuqg8q.js new file mode 100644 index 0000000..8f970d3 --- /dev/null +++ b/dist/assets/SceneLayerSnappingSourceWorker-gaKuqg8q.js @@ -0,0 +1 @@ +import{cM as f,az as g,at as m,kd as E,ke as _,e as w,c as v,kf as b,b0 as y,aa as h,s as L,g8 as V,b9 as k,kg as P,kh as C,ki as u}from"./index-J0iiHjMT.js";const S=1e3;function j(t,e,n){const s=E(),o=_(s);return f(o,o,t,.5),f(o,o,e,.5),s[3]=g(o,t),m(o,o,n),s}let l=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=y(),this._tmpP1=h(),this._tmpP2=h(),this._tmpP3=h(),this.remoteClient=null}async fetchCandidates(t,e){await Promise.resolve(),L(e),await this._ensureEdgeLocations(t,e);const n=[];return this._edges.forEachNeighbor(s=>(this._addCandidates(t,s,n),n.length{if(i.info==null){const{id:c,uid:d}=i;n.push({id:c,uid:d})}return!0},t.bounds),!n.length)return;const s={components:n},o=await this.remoteClient.invoke("fetchAllEdgeLocations",s,e??{});for(const i of o.components)this._setFetchEdgeLocations(i)}async add(t){const e=new p(t.id,t.bounds);return this._idToComponent.set(e.id,e),this._components.add([e]),{result:{}}}async remove(t){const e=this._idToComponent.get(t.id);if(e){const n=[];this._edges.forEachNeighbor(s=>(s.component===e&&n.push(s),!0),e.bounds),this._edges.remove(n),this._components.remove([e]),this._idToComponent.delete(e.id)}return{result:{}}}_setFetchEdgeLocations(t){const e=this._idToComponent.get(t.id);if(e==null||t.uid!==e.uid)return;const n=V.createView(t.locations),s=new Array(n.count),o=h(),i=h();for(let a=0;a{const p=u.get(c);if(p==null){const m=f.indexOf(t);return u.set(c,m),m}return p};let l=E.EDITING;const o={setAttribute(c,f){if(l!==E.EDITING)return;const p=e.fieldsIndex.get(c);if(!p)return;const m=e.attributeStorageInfo.findIndex(F=>F.name===p.name);if(m<0)return;if(!(c in a))throw new Error(`Attribute "${c}" is not an attribute of the edited feature.`);d.setAttribute(m,f);const w=e.attributeStorageInfo[m];let b=!1;s.add(c),e.forEachNode((F,x)=>{const v=i(F,x);if(v===-1)return;const A=e.getAttributeData(F.index);if(A){const O=A[w.name];O&&(O[v]=f,e.setAttributeData(F.index,A,n),b=!0)}}),b&&e.clearMemCache()},rollback(){if(l===E.EDITING){for(const c of s)this.setAttribute(c,a[c]);d.remove(),l=E.ROLLED_BACK,e.sessions.delete(t)}},commit(){l===E.EDITING&&(d.remove(),l=E.COMMITTED,e.sessions.delete(t))}};return e.sessions.set(t,o),o}function ce(e,n,t){const{gidToFeatureInfo:r,oidToFeatureInfo:a,fieldsIndex:s,objectIdField:d,globalIdField:u,featureOrIdentifierList:i}=t;if(!t.featuresResolved&&i!=null){for(const l of i){const o={feature:null,oid:-1,gid:null};if("attributes"in l){o.feature=l;const c=l.attributes;if(c!=null)for(const f in c){if(o.oid!==-1&&o.gid!=null)break;const p=s.normalizeFieldName(f);p===d&&(o.oid=c[f]??-1),p===u&&(o.gid=c[f])}}else o.oid=l.objectId??-1,o.gid=l.globalId;o.gid!=null&&r.set(o.gid,o),o.oid!==-1&&a.set(o.oid,o)}t.featuresResolved=!0}return(e!==-1?a.get(e):null)??(n!=null?r.get(n):null)}function $(e,n,t,r,a=null,s=!0){const d=[],u={gidToFeatureInfo:new Map,oidToFeatureInfo:new Map,featuresResolved:t==null,fieldsIndex:e.fieldsIndex,objectIdField:e.objectIdField,globalIdField:e.globalIdField,featureOrIdentifierList:t};for(const i of n){if(i.error!=null)continue;const l=i.objectId??-1,o=i.globalId,c=(l===-1||s?ce(l,o,u):null)??{feature:null,oid:l,gid:o},f={oid:l===-1?c.oid:l,gid:o??c.gid,feature:c.feature,result:i};if(d.push(f),f.oid===-1&&f.gid!=null&&a!=null&&(f.oid=a.get(f.gid)??-1),f.oid===-1&&f.gid!=null){let p=r.get(f.gid);p==null&&(p=[],r.set(f.gid,p)),p.push(f)}}return d}async function Ee(e,n){var d,u,i;const t=new Map,r=$(e,n.addedFeatures,(d=n.edits)==null?void 0:d.addFeatures,t),a=$(e,n.updatedFeatures,(u=n.edits)==null?void 0:u.updateFeatures,t),s=$(e,n.deletedFeatures,(i=n.edits)==null?void 0:i.deleteFeatures,t,n.globalIdToObjectId,!1);return t.size>0&&await fe(e,t),{adds:r.filter(l=>l.oid!==-1),updates:a.filter(l=>l.oid!==-1),deletes:s.filter(l=>l.oid!==-1)}}async function fe(e,n){const t=e.i3sOverrides.layer.associatedLayer;if((t==null?void 0:t.globalIdField)==null)return;const r=t.createQuery(),{objectIdField:a,globalIdField:s}=t;r.where=Array.from(n.keys()).map(i=>`${s}='${i}'`).join(" OR "),r.returnGeometry=!1,r.outFields=[a,s],r.cacheHint=!1;const d=await B(H(t,r));if(!d.ok)return;const u=d.value.features;for(const i of u){const l=i.attributes[s],o=i.attributes[a];if(l==null||o==null||o===-1)continue;const c=n.get(l);if(c!=null)for(const f of c)f.oid=o}}function xe(e,n){var d,u;const t=new Map,r=n.adds,a=n.updates,s=n.deletes;if(r.length>0)for(const i of r){const l=i.oid,o=i.feature;((d=o==null?void 0:o.geometry)==null?void 0:d.type)==="mesh"&&t.set(l,o.geometry)}if(a.length>0)for(const i of a){const l=i.oid,o=i.feature;((u=o==null?void 0:o.geometry)==null?void 0:u.type)==="mesh"&&t.set(l,o.geometry)}if(s.length>0)for(const i of s)t.set(i.oid,null);for(const[i,l]of t)e.i3sOverrides.updateGeometry(i,l)}function ve(e,n){var f;const t=ge(e,n),r=pe(e,n);if(t.size===0&&r.size===0)return;const a=new Map;for(let p=0;p{const w=e.getAttributeData(m);let b=!1;p.forEach((F,x)=>{const v=w!=null?w[x]:null,A=a.get(x);for(const{featureIndex:O,value:T,featureId:G}of F)v&&(v[O]=T,b=!0,s=!0),e.i3sOverrides.updateAttributeValue(G,A,T)}),b&&e.setAttributeData(m,w,null)}),s&&e.clearMemCache();const{fieldsIndex:d,i3sOverrides:u,objectIdField:i,globalIdField:l}=e,o=(f=u.layer.associatedLayer)==null?void 0:f.infoFor3D,c=new Set(o?[...Object.values(o.assetMapFieldRoles),...Object.values(o.transformFieldRoles)]:[]);for(const[p,m]of r){u.featureAdded(p);const{attributes:w}=m;for(const b in w){if(b!==i&&b!==l&&c.has(b))continue;const F=d.normalizeFieldName(b),x=F!=null?a.get(F):null;if(x==null)continue;const v=w[b];u.updateAttributeValue(p,x,v)}}}function pe(e,n){var a;const t=new Map,r=n.adds;if(!r||r.length===0||e.globalIdField==null)return t;for(const s of r){const d=s.oid,u=s.feature;((a=u==null?void 0:u.geometry)==null?void 0:a.type)==="mesh"&&t.set(d,u)}return t}function ge(e,n){const t=n.updates;if(!t||t.length===0)return new C;const r=new C,a=new Map;for(let s=0;s{for(const u of t){if(u.feature==null)continue;const i=u.feature,l=u.oid,o=d.indexOf(l);for(const c in i.attributes){const f=e.fieldsIndex.normalizeFieldName(c),p=ye(r,s.index,f),m=i.attributes[c];p.push({featureIndex:o,featureId:l,value:m})}}}),r}function ye(e,n,t){const r=he(e,n),a=t!=null&&r.get(t);if(a)return a;const s=new Array;return r.set(t,s),s}function he(e,n){const t=e.get(n);if(t)return t;const r=new me;return e.set(n,r),r}(function(e){e[e.EDITING=0]="EDITING",e[e.ROLLED_BACK=1]="ROLLED_BACK",e[e.COMMITTED=2]="COMMITTED"})(E||(E={}));const me=Map,C=Map;function Ae(){return{requiredFields:{type:[String],readOnly:!0},availableFields:{type:[String],readOnly:!0,get:function(){const{layer:e,layer:{fieldsIndex:n},requiredFields:t}=this;return e.outFields?S(n,[...Q(n,e.outFields),...t]):S(n,t)}}}}const P=e=>{let n=class extends e{constructor(){super(...arguments),this._numUpdating=0,this._asyncUpdateState=new Map}get updating(){return this._numUpdating>0}autoUpdateAsync(t,r){return be(a=>this._updateAsync(t,a),r)}async _updateAsync(t,r){if(!this._startAsyncUpdate(t)){try{const a=await r();this._set(t,a)}catch{L.getLogger(this).warn(`Async update of "${String(t)}" failed. Async update functions should not throw exceptions.`)}this._endAsyncUpdate(t)&&this._updateAsync(t,r)}}_startAsyncUpdate(t){const r=this._asyncUpdateState.get(t)??I.None;return r&I.Updating?(this._asyncUpdateState.set(t,r|I.Invalidated),!0):(++this._numUpdating,this._asyncUpdateState.set(t,r|I.Updating),!1)}_endAsyncUpdate(t){--this._numUpdating;const r=(this._asyncUpdateState.get(t)??I.None)&~I.Updating;return r&I.Invalidated?(this._asyncUpdateState.set(t,r&~I.Invalidated),!0):(this._asyncUpdateState.set(t,r),!1)}};return g([y({readOnly:!0})],n.prototype,"updating",null),g([y()],n.prototype,"_numUpdating",void 0),n=g([N("esri.core.AsyncUpdate")],n),n};var I;function be(e,n){const t=()=>{s&&!d&&e(r)},r=()=>{if(!s||d)return n();s.clear(),d=!0;const u=W(s,n);return d=!1,u},a=()=>{s&&(s.destroy(),s=null)};let s=new J(t),d=!1;return e(r),{remove:a}}(function(e){e[e.None=0]="None",e[e.Updating=1]="Updating",e[e.Invalidated=2]="Invalidated"})(I||(I={}));let k=class extends P(q){};k=g([N("esri.core.AsyncUpdate")],k);const V="esri.views.3d.layers.support.SceneLayerViewRequiredFields";let _=class extends P(q){get layer(){return this.layerView.layer}get requiredFields(){const{layerView:{layer:{fieldsIndex:e},definitionExpressionFields:n},rendererFields:t,labelingFields:r,viewFilterFields:a}=this;return S(e,[...n??[],...t??[],...r??[],...a??[]])}constructor(e){super(e)}initialize(){this.addHandles([this.autoUpdateAsync("rendererFields",async()=>{const{fieldsIndex:e,renderer:n}=this.layer;return n?U(t=>n.collectRequiredFields(t,e)):null}),this.autoUpdateAsync("labelingFields",async()=>{const{layer:e}=this;return e.labelsVisible?U(n=>Z(n,e)):null}),this.autoUpdateAsync("viewFilterFields",()=>{const{layer:e,filter:n}=this.layerView;return U(t=>X(t,e,n))})])}};async function U(e){const n=new Set;try{return await e(n),Array.from(n).sort()}catch(t){return L.getLogger(V).error(t),null}}g([y()],_.prototype,"layerView",void 0),g([y()],_.prototype,"layer",null),g([y()],_.prototype,"requiredFields",null),g([y()],_.prototype,"rendererFields",void 0),g([y()],_.prototype,"labelingFields",void 0),g([y()],_.prototype,"viewFilterFields",void 0),_=g([N(V)],_);const z="esri.views.layers.SceneLayerView",j=L.getLogger(z);let h=class extends de{constructor(){super(...arguments),this.layer=null,this.filter=null,this._geometryEngine=null,this._projectionEngineLoaded=!1,this._abortController=new AbortController}get availableFields(){return[]}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(e){throw new Error("Not implemented")}get maximumNumberOfFeaturesExceeded(){return!1}get layerFilter(){return se(this._layerFilter)}get _layerFilter(){var u;const e=(u=this.layer)==null?void 0:u.filter;if(e==null||e.geometries.length<1)return null;const n=this._geometryEngine;if(n==null||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine)return ae;const t=e.geometries.at(0).spatialReference,r=e.geometries.toArray().map(i=>{try{i=n.simplify(i)}catch{return j.warnOncePerTick("Failed to simplify scene filter mask polygon. Polygon will be ignored."),null}if(i==null)return null;if(i.spatialReference.equals(t))return i;try{return Y(i,t)}catch{return j.warnOncePerTick("Failed to project scene filter mask polygon. Polygon will be ignored."),null}}).filter(ee).sort((i,l)=>i.extent.xmin-l.extent.xmin),a=new Set,s=new Array,d=new Array;for(let i of r){const l=i.extent.xmin;if(s.length=0,a.forEach(o=>{if(l>=o.extent.xmax)return d.push(o),void a.delete(o);i.extent.ymin<=o.extent.ymax&&i.extent.ymax>=o.extent.ymin&&n.intersects(i,o)&&s.push(o)}),s.length>0){s.push(i);try{i=n.union(s)}catch{j.warnOncePerTick("Failed to unify filter mask polygons. Polygon will be ignored.");continue}s.pop(),s.forEach(o=>a.delete(o))}a.add(i)}return a.forEach(i=>d.push(i)),d.length>0?{spatialRelationship:e.spatialRelationship,geometries:d}:null}get _filterNeedsProjectionEngine(){const e=this.layer.filter;if(e==null||e.geometries.length<=1)return!1;const n=e.geometries.at(0).spatialReference;return e.geometries.some(({spatialReference:t})=>!t.equals(n)&&!te(t,n))}get layerFilterUpdating(){return le(this._layerFilter)}initialize(){const{signal:e}=this._abortController;M(()=>{var n,t,r;return this.destroyed||!this._geometryEngine&&((r=(t=(n=this.layer)==null?void 0:n.filter)==null?void 0:t.geometries)==null?void 0:r.length)},e).then(async()=>{D(e),this._geometryEngine=await ne(()=>import("./index-J0iiHjMT.js").then(n=>n.zJ),__vite__mapDeps([0,1]))}).catch(R),this._projectionEngineLoaded=re(),M(()=>this.destroyed||!this._projectionEngineLoaded&&this._filterNeedsProjectionEngine,e).then(async()=>{D(e),await ie(),this._projectionEngineLoaded=!0}).catch(R)}destroy(){this._abortController=oe(this._abortController)}highlight(e){throw new Error("Not implemented")}queryFeatures(e,n){throw new Error("Not implemented")}queryObjectIds(e,n){throw new Error("Not implemented")}queryFeatureCount(e,n){throw new Error("Not implemented")}createQuery(){throw new Error("Not implemented")}queryExtent(e,n){throw new Error("Not implemented")}};g([y()],h.prototype,"layer",void 0),g([y()],h.prototype,"availableFields",null),g([y()],h.prototype,"maximumNumberOfFeatures",null),g([y({readOnly:!0})],h.prototype,"maximumNumberOfFeaturesExceeded",null),g([y()],h.prototype,"filter",void 0),g([y({readOnly:!0})],h.prototype,"layerFilter",null),g([y({readOnly:!0})],h.prototype,"_layerFilter",null),g([y()],h.prototype,"_geometryEngine",void 0),g([y()],h.prototype,"_projectionEngineLoaded",void 0),g([y()],h.prototype,"_filterNeedsProjectionEngine",null),g([y()],h.prototype,"layerFilterUpdating",null),h=g([N(z)],h);const Ne=h;export{Ae as a,_ as c,xe as d,ve as f,_e as i,Ne as j,Ee as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SceneLayerView3D-7NpyxR5M.js b/dist/assets/SceneLayerView3D-7NpyxR5M.js new file mode 100644 index 0000000..f2e80ed --- /dev/null +++ b/dist/assets/SceneLayerView3D-7NpyxR5M.js @@ -0,0 +1 @@ +import{fQ as _,fR as f,fS as m,P as h,fT as o,n as F,Z as b,ca as d,ai as v,fU as I,S as w,fV as u,e as l,y as n,fi as E,dC as O,c as S}from"./index-J0iiHjMT.js";import{s as x}from"./ReactiveSet-HLstcUcf.js";import{x as j}from"./WhereClause-XAMIZ4-B.js";import{E as C,c as H,a as Q}from"./I3SMeshView3D-OXYwZo0p.js";import{n as q}from"./LayerView3D-iOx2MD1g.js";import{c as V,i as D,u as R,d as $,f as A,a as P,j as G}from"./SceneLayerView-MZstNOoI.js";import{L as p,d as U,l as L,o as M}from"./I3SQueryFeatureStore-CLo7XXT-.js";import{t as c}from"./I3SNode-5SPByfpU.js";import{S as N}from"./I3SOverrides-5dCbMm3h.js";import{t as T}from"./DefinitionExpressionSceneLayerView-oAOUEjm-.js";import{i as z}from"./PopupSceneLayerView-cRxapYqF.js";import"./TimeOnly-ljWtUK7N.js";import"./SceneModification-dyp2M_Yg.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./SceneLayerWorker-o7OZRrjZ.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./QueryEngine-8tLWlkSE.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./LayerView-efDufa6j.js";import"./meshFeatureSet-Mcou8mDC.js";import"./External-GV0jSEES.js";import"./FeatureLayerView3D-t6NDkLO0.js";import"./FeatureLayerViewBase3D-VurTj7t3.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./RefreshableLayerView-Pd4dLcWr.js";const y=P();let s=class extends C(T(z(q(G)))){constructor(){super(...arguments),this.type="scene-layer-3d",this._setVisibilityHiddenObjectIds=new x,this.progressiveLoadFactor=1,this._elevationContext="scene",this._isIntegratedMesh=!1,this._supportsLabeling=!0,this._pendingEditsQueue=Promise.resolve(),this._interactiveEditingSessions=new Map,this._queryEngine=null}get i3slayer(){return this.layer}tryRecycleWith(e,t){return e.url===this.layer.url&&this.i3sOverrides.isEmpty?e.load(t).then(()=>{var r;_(this.layer,e,this.i3sOverrides),this.layer=e,this.i3sOverrides.destroy();const i=(r=this.view.resourceController)==null?void 0:r.memoryController;this.i3sOverrides=new N({view:this.view,layer:e,memoryController:i}),this.resetHighlights()}):null}get layerPopupEnabledAndHasTemplate(){var e;return this.layer.popupEnabled&&f(this.layer,(e=this.view.popup)==null?void 0:e.defaultPopupTemplateEnabled)}get filter(){return this._get("filter")}set filter(e){this._set("filter",p.checkSupport(e)?e:null)}get viewFilter(){const e=this.filter,t=this.layerFilter;if(e==null&&t==null)return null;const i=this._get("viewFilter");return i==null?new p({layerFilter:t,viewFilter:e,layerFieldsIndex:this.layer.fieldsIndex,loadAsyncModule:r=>this._loadAsyncModule(r),addSqlFilter:(r,a)=>this.addSqlFilter(r,a,this.logError)}):(i.viewFilter=e,i.layerFilter=t,i)}get requiredFields(){var e;return((e=this._fieldsHelper)==null?void 0:e.requiredFields)??[]}get _floorFilterClause(){const e=m(this);return e!=null?j.create(e,this.layer.fieldsIndex):null}get _excludeObjectIdsSorted(){const e=this.layer.excludeObjectIds.toArray();return e.length?e.sort((t,i)=>t-i):null}get _setVisibilityHiddenObjectIdsSorted(){return this._setVisibilityHiddenObjectIds.size?Array.from(this._setVisibilityHiddenObjectIds).sort((e,t)=>e-t):null}get _objectQualitySettings(){var e,t,i;return(i=(t=(e=this.view)==null?void 0:e.qualitySettings)==null?void 0:t.sceneService)==null?void 0:i.object}get lodFactor(){var e;return((e=this._objectQualitySettings)==null?void 0:e.lodFactor)??1}get lodCrossfadeinDuration(){return this._objectQualitySettings.lodCrossfadeinDuration??0}get lodCrossfadeoutDuration(){return this._objectQualitySettings.lodCrossfadeoutDuration??0}get lodCrossfadeUncoveredDuration(){return this._objectQualitySettings.lodCrossfadeUncoveredDuration??0}get updatingProgressValue(){var e;return((e=this._controller)==null?void 0:e.updatingProgress)??0}initialize(){this._fieldsHelper=new V({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,t=>this._rangeInfosChanged(t),h),this._updatingHandles.add(()=>this.layer.renderer,t=>this._updatingHandles.addPromise(this._rendererChange(t)),h);const e=()=>this._filterChange();this._updatingHandles.add(()=>this.parsedDefinitionExpression,e),this._updatingHandles.add(()=>this.filter,e),this._updatingHandles.add(()=>this._floorFilterClause,e),this._updatingHandles.add(()=>this._excludeObjectIdsSorted,e),this._updatingHandles.add(()=>this._setVisibilityHiddenObjectIdsSorted,e),this._updatingHandles.add(()=>this.viewFilter!=null?this.viewFilter.sortedObjectIds:null,e),this._updatingHandles.add(()=>this.viewFilter!=null?this.viewFilter.parsedWhereClause:null,e),this._updatingHandles.add(()=>[this.viewFilter!=null?this.viewFilter.parsedGeometry:null,this.filter!=null?this.filter.spatialRelationship:null,this.layer.filter!=null?this.layer.filter.spatialRelationship:null],()=>this._geometryFilterChange()),o()&&this.i3sOverrides.is3DOFL&&this._updatingHandles.add(()=>this.i3sOverrides.sortedGeometryChangedObjectIds,e),this.addHandles(this.layer.on("apply-edits",t=>this._updatingHandles.addPromise(t.result))),this.addHandles(this.layer.on("edits",t=>{const i=this._pendingEditsQueue.then(()=>this._handleEdits(t)).then();this._pendingEditsQueue=i,this._updatingHandles.addPromise(i)}))}destroy(){this._fieldsHelper=F(this._fieldsHelper)}_rangeInfosChanged(e){e!=null&&e.length>0&&b.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}createQuery(){const e={outFields:["*"],returnGeometry:!1,outSpatialReference:this.view.spatialReference};return this.filter!=null?this.filter.createQuery(e):new d(e)}queryExtent(e,t){return this._ensureQueryEngine().executeQueryForExtent(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatureCount(e,t){return this._ensureQueryEngine().executeQueryForCount(this._ensureQuery(e),t==null?void 0:t.signal)}queryFeatures(e,t){return this._ensureQueryEngine().executeQuery(this._ensureQuery(e),t==null?void 0:t.signal).then(i=>{if(!(i!=null&&i.features))return i;const r=this.layer;for(const a of i.features)a.layer=r,a.sourceLayer=r;return i})}queryObjectIds(e,t){return this._ensureQueryEngine().executeQueryForIds(this._ensureQuery(e),t==null?void 0:t.signal)}_ensureQueryEngine(){return this._queryEngine||(this._queryEngine=this._createQueryEngine()),this._queryEngine}_createQueryEngine(){const e=H(this.view.spatialReference,this.view.renderSpatialReference,this._collection);return new U({layerView:this,priority:v.FEATURE_QUERY_ENGINE,spatialIndex:new L({featureAdapter:new M({objectIdField:this.layer.objectIdField,attributeStorageInfo:this.layer.attributeStorageInfo??[],getFeatureExtent:e}),forAllFeatures:(t,i)=>this._forAllFeatures((r,a,g)=>t({id:r,index:a,meta:g}),i,Q.QUERYABLE),getFeatureExtent:e,sourceSpatialReference:I(this.layer),viewSpatialReference:this.view.spatialReference})})}highlight(e){const t=this._highlights;if(e instanceof d){const{set:i,handle:r}=t.acquireSet();return this.queryObjectIds(e).then(a=>t.setFeatureIds(i,a)),r}return super.highlight(e)}createInteractiveEditSession(e){return D(this._attributeEditingContext,e)}_createLayerGraphic(e){const t=new w(null,null,e);return t.layer=this.layer,t.sourceLayer=this.layer,t}getFilters(){const e=super.getFilters();o()&&this.i3sOverrides.is3DOFL&&this.i3sOverrides.sortedGeometryChangedObjectIds.length>0&&e.push((r,a)=>{a.node.index>=0&&u(this.i3sOverrides.sortedGeometryChangedObjectIds,!1,r)});const t=this._setVisibilityHiddenObjectIdsSorted;t!=null&&e.push(r=>u(t,!1,r));const i=this._excludeObjectIdsSorted;return i!=null&&e.push(r=>u(i,!1,r)),this._floorFilterClause&&this.addSqlFilter(e,this._floorFilterClause,this.logError),this.addSqlFilter(e,this.parsedDefinitionExpression,this.logError),this.viewFilter!=null&&this.viewFilter.addFilters(e,this.view,this._controller.crsIndex,this._collection),e}setVisibility(e,t){t?this._setVisibilityHiddenObjectIds.delete(e):this._setVisibilityHiddenObjectIds.add(e)}isUpdating(){return super.isUpdating()||this.layerFilterUpdating||this.viewFilter!=null&&this.viewFilter.updating||this.i3sOverrides!=null&&this.i3sOverrides.updating}_ensureQuery(e){return this._addDefinitionExpressionToQuery(e==null?this.createQuery():d.from(e))}get _attributeEditingContext(){return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:this._getObjectIdField(),globalIdField:this._getGlobalIdField(),forEachNode:e=>this._forAllNodes(t=>t!=null?e(t.node,t.featureIds):null),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this.i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(e,t)=>this.setAttributeData(e,t),clearMemCache:()=>this.clearMemCache()}}async _handleEdits(e){const t=o(),i=this._attributeEditingContext,r=await R(i,e);t&&$(i,r),A(i,r)}get hasGeometryFilter(){const e=this.viewFilter;return(e==null?void 0:e.parsedGeometry)!=null}computeNodeFiltering(e){const t=this.viewFilter;return t==null||!this.view.spatialReference||t.isMBSGeometryVisible(e,this.view.spatialReference,this._controller.crsIndex)?c.Unmodified:c.Culled}};l([n()],s.prototype,"i3slayer",null),l([n(E)],s.prototype,"updatingProgress",void 0),l([n({type:O})],s.prototype,"filter",null),l([n({readOnly:!0})],s.prototype,"viewFilter",null),l([n(y.requiredFields)],s.prototype,"requiredFields",null),l([n(y.availableFields)],s.prototype,"availableFields",void 0),l([n()],s.prototype,"_fieldsHelper",void 0),l([n()],s.prototype,"_floorFilterClause",null),l([n()],s.prototype,"_excludeObjectIdsSorted",null),l([n()],s.prototype,"_setVisibilityHiddenObjectIds",void 0),l([n()],s.prototype,"_setVisibilityHiddenObjectIdsSorted",null),l([n()],s.prototype,"_objectQualitySettings",null),l([n()],s.prototype,"lodFactor",null),l([n()],s.prototype,"updatingProgressValue",null),s=l([S("esri.views.3d.layers.SceneLayerView3D")],s);const Re=s;export{Re as default}; diff --git a/dist/assets/SceneLayerWorker-o7OZRrjZ.js b/dist/assets/SceneLayerWorker-o7OZRrjZ.js new file mode 100644 index 0000000..61580e7 --- /dev/null +++ b/dist/assets/SceneLayerWorker-o7OZRrjZ.js @@ -0,0 +1,7 @@ +import{de as L,kj as G,ar as j,ln as W,lo as K,lp as Q,lq as X,lr as Z}from"./index-J0iiHjMT.js";import{n as A}from"./I3SNode-5SPByfpU.js";var S,$;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(S||(S={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}($||($={}));function ee(){return v||(v=new Promise(e=>L(()=>import("./i3s-038C_b0B.js"),__vite__mapDeps([0,1,2])).then(t=>t.i).then(({default:t})=>{const n=t({locateFile:te,onRuntimeInitialized:()=>e(n)});delete n.then})).catch(e=>{throw e})),v}function te(e){return G(`esri/libs/i3s/${e}`)}let v;async function ne(e){o=await w();const t=[e.geometryBuffer];return{result:C(o,e,t),transferList:t}}async function re(e){var h;o=await w();const t=[e.geometryBuffer],{geometryBuffer:n}=e,s=n.byteLength,i=o._malloc(s),d=new Uint8Array(o.HEAPU8.buffer,i,s);d.set(new Uint8Array(n));const f=o.dracoDecompressPointCloudData(i,d.byteLength);if(o._free(i),f.error.length>0)throw new Error(`i3s.wasm: ${f.error}`);const c=((h=f.featureIds)==null?void 0:h.length)>0?f.featureIds.slice():null,a=f.positions.slice();return c&&t.push(c.buffer),t.push(a.buffer),{result:{positions:a,featureIds:c},transferList:t}}async function oe(e){await w(),V(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function ie(e){await w(),z(e)}async function se(e){o=await w(),o.setLegacySchema(e.context,e.jsonSchema)}async function ae(e){const{localMatrix:t,origin:n,positions:s,vertexSpace:i,localMode:d}=e,f=j.fromJSON(e.inSpatialReference),c=j.fromJSON(e.outSpatialReference);let a;if(i.type==="georeferenced"){const[{projectBuffer:l},{initializeProjection:_}]=await Promise.all([L(()=>import("./index-J0iiHjMT.js").then(y=>y.zC),__vite__mapDeps([1,2])),L(()=>import("./index-J0iiHjMT.js").then(y=>y.zD),__vite__mapDeps([1,2]))]);await _(f,c),a=new Float64Array(s.length),l(s,f,0,a,c,0,a.length/3)}else{const l=i.type==="georeferencedRelative"?W.fromJSON(i):K.fromJSON(i),{project:_}=await L(()=>import("./index-J0iiHjMT.js").then(y=>y.zH),__vite__mapDeps([1,2]));a=Q(_({positions:s,transform:t?{localMatrix:t}:void 0,vertexSpace:l,inSpatialReference:f,outSpatialReference:c,localMode:d}))}const h=a.length,[P,O,R]=n;for(let l=0;lp.some(E=>E.name==="color")),normal:t.needNormals&&t.layouts.some(p=>p.some(E=>E.name==="normalCompressed")),uv0:t.layouts.some(p=>p.some(E=>E.name==="uv0")),uvRegion:t.layouts.some(p=>p.some(E=>E.name==="uvRegion")),featureIndex:x.featureIndex},r=e.process(s,!!t.obb,l,F.byteLength,x,H,y,a,O,R,t.normalReferenceFrame);if(e._free(y),e._free(l),r.error.length>0)throw new Error(`i3s.wasm: ${r.error}`);if(r.discarded)return null;const T=r.componentOffsets.length>0?r.componentOffsets.slice():null,M=r.featureIds.length>0?r.featureIds.slice():null,J=r.anchorIds.length>0?Array.from(r.anchorIds):null,k=r.anchors.length>0?Array.from(r.anchors):null,U=r.interleavedVertedData.slice().buffer,N=r.indicesType===S.Int16?new Uint16Array(r.indices.buffer,r.indices.byteOffset,r.indices.byteLength/2).slice():new Uint32Array(r.indices.buffer,r.indices.byteOffset,r.indices.byteLength/4).slice(),B=r.positions.slice(),D=r.positionIndicesType===S.Int16?new Uint16Array(r.positionIndices.buffer,r.positionIndices.byteOffset,r.positionIndices.byteLength/2).slice():new Uint32Array(r.positionIndices.buffer,r.positionIndices.byteOffset,r.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:U,indices:N,hasColors:r.hasColors,hasModifications:r.hasModifications,positionData:{data:B,indices:D}};return M&&n.push(M.buffer),T&&n.push(T.buffer),n.push(U),n.push(N.buffer),n.push(B.buffer),n.push(D.buffer),{componentOffsets:T,featureIds:M,anchorIds:J,anchors:k,transformedGeometry:q,obb:r.obb}}function ce(e){return e===0?A.Unmodified:e===1?A.PotentiallyModified:e===2?A.Culled:A.Unknown}function V(e){if(!o)return;const{context:t,buffer:n}=e,s=o._malloc(n.byteLength),i=n.byteLength/Float64Array.BYTES_PER_ELEMENT,d=new Float64Array(o.HEAPU8.buffer,s,i),f=new Float64Array(n);d.set(f),o.filterOBBs(t,s,i),f.set(d),o._free(s)}function Y(e){o&&o.destroy(e)===0&&(o=null)}function g(e,t){for(let n=0;n(o=e,I=null,o))),I)}const de={transform:(e,t)=>o&&C(o,e,t),destroy:Y},be=Object.freeze(Object.defineProperty({__proto__:null,destroyContext:le,dracoDecompressPointCloudData:re,filterObbsForModifications:oe,filterObbsForModificationsSync:V,initialize:ue,interpretObbModificationResults:ce,process:ne,project:ae,setLegacySchema:se,setModifications:ie,setModificationsSync:z,test:de,transformNormals:fe},Symbol.toStringTag,{value:"Module"}));export{ce as A,z as E,ue as I,V as L,be as S,$ as e}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/i3s-038C_b0B.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SceneModification-dyp2M_Yg.js b/dist/assets/SceneModification-dyp2M_Yg.js new file mode 100644 index 0000000..5d9a872 --- /dev/null +++ b/dist/assets/SceneModification-dyp2M_Yg.js @@ -0,0 +1 @@ +import{e as r,y as l,l as y,eb as c,du as f,c as m,dr as d,ct as u,dm as R,ec as g,bI as h}from"./index-J0iiHjMT.js";var s;let t=s=class extends d{constructor(a){super(a),this.geometry=null,this.type="clip"}writeGeometry(a,i,o,e){var n;if((n=e.layer)!=null&&n.spatialReference&&!e.layer.spatialReference.equals(this.geometry.spatialReference)){if(!u(a.spatialReference,e.layer.spatialReference))return void((e==null?void 0:e.messages)&&e.messages.push(new R("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})));const p=new y;g(a,p,e.layer.spatialReference),i[o]=p.toJSON(e)}else i[o]=a.toJSON(e);delete i[o].spatialReference}clone(){return new s({geometry:h(this.geometry),type:this.type})}};r([l({type:y}),c()],t.prototype,"geometry",void 0),r([f(["web-scene","portal-item"],"geometry")],t.prototype,"writeGeometry",null),r([l({type:["clip","mask","replace"],nonNullable:!0}),c()],t.prototype,"type",void 0),t=s=r([m("esri.layers.support.SceneModification")],t);const b=t;export{b as f}; diff --git a/dist/assets/SceneSnappingManagerPool-OpebO9Di.js b/dist/assets/SceneSnappingManagerPool-OpebO9Di.js new file mode 100644 index 0000000..c36bc3c --- /dev/null +++ b/dist/assets/SceneSnappingManagerPool-OpebO9Di.js @@ -0,0 +1 @@ +import{hW as s,a5 as r,d as c,P as p,V as u,hX as l,hY as f,hZ as d,a2 as g,h_ as h}from"./index-J0iiHjMT.js";function v(n,e){const i=new s({enabled:!0,selfEnabled:!1,featureEnabled:!0,distance:(e==null?void 0:e.distance)??r.distance,touchSensitivityMultiplier:(e==null?void 0:e.touchSensitivityMultiplier)??r.touchSensitivityMultiplier});return{...c(()=>{var t,a;return((a=(t=n.map)==null?void 0:t.allLayers)==null?void 0:a.toArray())??[]},t=>{i.featureSources=new u(t.map(a=>new l({layer:a,enabled:!0})))},p),options:i}}const o=new Map;function M(n){if(!o.has(n)){const t=v(n,{distance:10}),a=y(n,t.options);o.set(n,{referenceCount:0,snappingManager:a,remove:()=>{t.remove(),a.destroy()}})}const e=o.get(n);e.referenceCount++;const i=g(()=>w(n,e));return{snappingManager:e.snappingManager,...i}}function w(n,e){e.referenceCount--,e.referenceCount>0||h(()=>{e.referenceCount===0&&(e.remove(),o.delete(n))})}function y(n,e){return new f({view:n,options:e,snappingEnginesFactory:(i,t)=>[new d({view:n,spatialReference:n.spatialReference,options:t})]})}export{M as a}; diff --git a/dist/assets/Segment-hN2uWAPW.js b/dist/assets/Segment-hN2uWAPW.js new file mode 100644 index 0000000..e231b4e --- /dev/null +++ b/dist/assets/Segment-hN2uWAPW.js @@ -0,0 +1 @@ +import{e as _,y as p,c as W,p as B,kn as H,ab as C,hM as v,hL as X,hK as I,lI as $,hJ as G,lJ as Q,lK as Z,d as tt,at as L,a0 as et,aa as u,lL as j,j_ as D,aR as J,hP as K,aU as w,aF as R,br as st,au as it,ki as Y,bn as S,aE as ot,cs as rt,ct as at,lM as ht,lN as nt}from"./index-J0iiHjMT.js";import{t as lt}from"./VisualElement-kjYXz27t.js";import{t as P,x as ct}from"./TextOverlayItem-eCjvS6IO.js";let c=class extends B{get startPosition(){return[this.startX,this.startY]}set startPosition(i){this._set("startX",i[0]),this._set("startY",i[1])}get endPosition(){return[this.endX,this.endY]}set endPosition(i){this._set("endX",i[0]),this._set("endY",i[1])}constructor(i){super(i),this.startX=0,this.startY=0,this.endX=0,this.endY=0,this.width=1,this.color=[0,0,0,.5],this.visible=!0,this.isDecoration=!0}get _strokeStyle(){const i=this.color;return`rgba(${i[0]}, ${i[1]}, ${i[2]}, ${i[3]})`}get _lineCap(){return"round"}render(){const{height:i,left:t,top:e,width:s,x1:a,x2:r,y1:m,y2:l}=this._calculateCoordinates(z),n=`stroke: ${this._strokeStyle}; stroke-width: ${this.width}; stroke-linecap: ${this._lineCap};`;return P("div",{classes:{"esri-line-overlay-item":!0},styles:{left:t+"px",top:e+"px",width:s+"px",height:i+"px",visibility:this.visible?"visible":"hidden"}},[P("svg",{width:s,height:i},[P("line",{x1:a,y1:m,x2:r,y2:l,style:n})])])}renderCanvas(i){if(!this.visible)return;i.strokeStyle=this._strokeStyle,i.lineWidth=this.width,i.lineCap=this._lineCap;const t=this._calculateCoordinates(z);i.beginPath(),i.moveTo(t.left+t.x1,t.top+t.y1),i.lineTo(t.left+t.x2,t.top+t.y2),i.stroke()}_calculateCoordinates(i){const t=Math.min(this.startX,this.endX),e=Math.max(this.startX,this.endX),s=Math.min(this.startY,this.endY),a=Math.max(this.startY,this.endY),r=this.width;return i.left=t-r,i.top=s-r,i.width=e-t+2*r,i.height=Math.max(20,a-s+2*r),i.x1=this.startX-t+r,i.y1=this.startY-s+r,i.x2=this.endX-t+r,i.y2=this.endY-s+r,i}};_([p()],c.prototype,"startX",void 0),_([p()],c.prototype,"startY",void 0),_([p()],c.prototype,"endX",void 0),_([p()],c.prototype,"endY",void 0),_([p()],c.prototype,"startPosition",null),_([p()],c.prototype,"endPosition",null),_([p()],c.prototype,"width",void 0),_([p()],c.prototype,"color",void 0),_([p()],c.prototype,"visible",void 0),_([p()],c.prototype,"isDecoration",void 0),_([p({readOnly:!0})],c.prototype,"_strokeStyle",null),c=_([W("esri.views.overlay.LineOverlayItem")],c);const z={left:0,top:0,width:0,height:0,x1:0,y1:0,x2:0,y2:0},dt=c;class gt extends lt{constructor(t){super(t),this._handles=new H,this._textItem=null,this._calloutItem=null,this._showCallout=!0,this._showText=!0,this._geometry=null,this._text="-",this._fontSize=14,this._backgroundColor=new C([0,0,0,.6]),this._calloutColor=new C([0,0,0,.5]),this._textColor=new C([255,255,255]),this._distance=25,this._anchor="right",this.updatePositionOnCameraMove=!0,this.applyProperties(t)}get geometry(){return this._geometry}set geometry(t){this._geometry=t,this.updateLabelPosition()}get isDecoration(){return this._isDecoration}set isDecoration(t){this._isDecoration=t,this._textItem&&(this._textItem.isDecoration=t),this._calloutItem&&(this._calloutItem.isDecoration=t)}get textItem(){return this._textItem}get text(){return this._text}set text(t){this._text=t,this.attached&&(this._textItem.text=this._text)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize=t,this.attached&&(this._textItem.fontSize=this._fontSize)}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){this._backgroundColor=t,this.attached&&(this._textItem.backgroundColor=this._backgroundColor)}get calloutColor(){return this._calloutColor}set calloutColor(t){this._calloutColor=t,this.attached&&(this._calloutItem.color=this._calloutColor.toRgba())}get textColor(){return this._textColor}set textColor(t){this._textColor=t,this.attached&&(this._textItem.textColor=this._textColor)}get distance(){return this._distance}set distance(t){this._distance!==t&&(this._distance=t,this.updateLabelPosition())}get anchor(){return this._anchor}set anchor(t){this._anchor!==t&&(this._anchor=t,this.updateLabelPosition())}get _camera(){return this.view.state.cssCamera}overlaps(t){var e;return!!this.attached&&this.textItem.visible&&t.textItem.visible&&!!((e=this.view.overlay)!=null&&e.overlaps(this._textItem,t.textItem))}updateLabelPosition(){if(!this.attached)return;this._showText=!1,this._showCallout=!1;const{geometry:t,view:e,visible:s}=this;if(t!=null&&e._stage)switch(t.type){case"point":if(!this._computeLabelPositionFromPoint(t.point,x))break;if(t.callout){const a=this._camera,r=t.callout.distance;v(h,h,[0,t.callout.offset]),a.renderToScreen(h,x),X(o,0,1),I(o,o,r),v(o,o,h),a.renderToScreen(o,g),this._showCallout=this._updatePosition(x,g)}else this._textItem.position=[x[0],x[1]],this._textItem.anchor="center";this._showText=!0;break;case"corner":if(!this._computeLabelPositionFromCorner(t,this._distance,x,g))break;this._showCallout=this._updatePosition(x,g),this._showText=!0;break;case"segment":{if(!this._computeLabelPositionFromSegment(t,this._distance,this._anchor,x,g))break;this._showText=!0;const a=this._updatePosition(x,g);this._showCallout=t.callout!==!1&&a,this._showCallout||(this._textItem.anchor="center")}}this.updateVisibility(s)}_computeLabelPositionFromPoint(t,e){const s=this._camera;return s.projectToRenderScreen(t,h),!(h[2]<0||h[2]>1)&&(s.renderToScreen(h,e),!0)}_computeLabelPositionFromCorner(t,e,s,a){if(!t)return!1;const r=this._camera;return F(t.left,1,r,b),$(b,b),F(t.right,0,r,U),v(o,b,U),$(o,o),G(o,o),r.projectToRenderScreen(t.left.endRenderSpace,h),!(h[2]<0||h[2]>1)&&(r.renderToScreen(h,s),I(o,o,e),v(o,o,h),r.renderToScreen(o,a),!0)}_computeLabelPositionFromSegment(t,e,s,a,r){if(!t)return!1;const m=t.segment,l=this._camera;Q(m.startRenderSpace,m.endRenderSpace,l,b),X(o,-b[1],b[0]);let n=!1;switch(s){case"top":n=o[1]<0;break;case"bottom":n=o[1]>0;break;case"left":n=o[0]>0;break;case"right":n=o[0]<0}if(n&&$(o,o),Z(o)===0)switch(s){case"top":o[1]=1;break;case"bottom":o[1]=-1;break;case"left":o[0]=-1;break;case"right":o[0]=1}return m.eval(ut[t.sampleLocation],V),l.projectToRenderScreen(V,h),!(h[2]<0||h[2]>1)&&(l.renderToScreen(h,a),I(o,o,e),v(o,o,h),l.renderToScreen(o,r),!0)}_updatePosition(t,e){if(e){const s=e[0]-t[0],a=e[1]-t[1];return this._textItem.position=[e[0],e[1]],this._textItem.anchor=Math.abs(s)>Math.abs(a)?s>0?"left":"right":a>0?"top":"bottom",this._calloutItem.startPosition=[t[0],t[1]],this._calloutItem.endPosition=[e[0],e[1]],!0}return this._textItem.position=[t[0],t[1]],this._textItem.anchor="center",!1}createResources(){var t;this._textItem=new ct({visible:!0,text:this._text,fontSize:this._fontSize,backgroundColor:this._backgroundColor,textColor:this._textColor,isDecoration:this._isDecoration}),this._calloutItem=new dt({color:this._calloutColor.toRgba(),visible:!0,width:2,isDecoration:this._isDecoration}),this.updateLabelPosition(),(t=this.view.overlay)==null||t.items.addMany([this._textItem,this._calloutItem]),this.updatePositionOnCameraMove&&this._handles.add(tt(()=>this.view.state.camera,()=>this.updateLabelPosition()))}destroyResources(){this.view.overlay&&!this.view.overlay.destroyed&&this.view.overlay.items.removeMany([this._textItem,this._calloutItem]),this._handles.removeAll()}updateVisibility(t){this._textItem.visible=this._showText&&t,this._calloutItem.visible=this._showCallout&&t}}function F(i,t,e,s){i.eval(t,k,O),L(A,k,O),e.projectToRenderScreen(k,q),e.projectToRenderScreen(A,E),et(s,pt,_t),G(s,s)}function yt(i){switch(i){case"top":return"bottom";case"right":return"left";case"bottom":return"top";case"left":return"right"}}const k=u(),A=u(),O=u(),b=j(),U=j(),o=j(),V=u(),h=D(),x=J(),g=J(),q=D(),_t=q,E=D(),pt=E,ut={start:0,center:.5,end:1};class N{constructor(t=u(),e=u()){this.startRenderSpace=t,this.endRenderSpace=e,this.type="euclidean"}eval(t,e,s){return K(e,this.startRenderSpace,this.endRenderSpace,t),s&&(w(s,this.endRenderSpace,this.startRenderSpace),R(s,s)),e}createRenderGeometry(t,e){const s=[],a=[],r=(l,n)=>{const d=T;w(d,l,t),s.push([d[0],d[1],d[2]]),a.push([n[0],n[1],n[2]])},m=e.worldUpAtPosition(this.eval(.5,y),st.get());return r(this.startRenderSpace,m),r(this.endRenderSpace,m),{points:s,normals:a}}static fromPositionAndVector(t,e,s=1){return it(y,e,s),L(y,t,y),new N(Y(t),Y(y))}}class vt{_projectIn(t,e){this._project?S(t,this.renderSpatialReference,e,this._pcpf):ot(e,t)}constructor(t,e,s){this.startRenderSpace=t,this.endRenderSpace=e,this.renderSpatialReference=s,this.type="geodesic",this._start=u(),this._end=u(),this._pcpf=rt(s),this._project=at(s,this._pcpf),this._projectIn(t,this._start),this._projectIn(e,this._end)}eval(t,e,s){if(this._project)if(s){const a=T;ht(this._start,this._end,t,e,a),L(f,e,a),S(e,this._pcpf,e,this.renderSpatialReference),S(f,this._pcpf,f,this.renderSpatialReference),w(s,f,e),R(s,s)}else nt(this._start,this._end,t,e),S(e,this._pcpf,e,this.renderSpatialReference);else K(e,this._start,this._end,t),s&&(w(s,this._end,this._start),R(s,s));return e}createRenderGeometry(t,e){const s=[],a=[],r=(l,n)=>{const d=f;w(d,l,t),s.push([d[0],d[1],d[2]]),a.push([n[0],n[1],n[2]])};for(let l=0;l<128;++l){const n=l/127,d=y,M=T;this.eval(n,d),e.worldUpAtPosition(d,M),r(d,M)}return{points:s,normals:a}}}const y=u(),T=u(),f=u();export{yt as C,vt as _,gt as g,N as m}; diff --git a/dist/assets/ShadedColorMaterial.glsl-Fp4o6LjC.js b/dist/assets/ShadedColorMaterial.glsl-Fp4o6LjC.js new file mode 100644 index 0000000..8ee7ea4 --- /dev/null +++ b/dist/assets/ShadedColorMaterial.glsl-Fp4o6LjC.js @@ -0,0 +1,37 @@ +import{b0 as Re,aI as xe,aT as je,T as C,xp as Pe,bA as I,aa as $,q8 as D,K as De,aR as ye,j_ as Fe,a2 as ze,bC as Ce,an as Y,kT as Me,at as M,aJ as Ie,k4 as Ne,aM as V,qk as Z,i$ as ee,aV as te,aN as ie,h9 as A,xq as ke,b9 as se,br as y,au as H,xr as ne,aE as ae,bv as We,av as Be,xs as Ve,hu as Ue,bD as Ge,G as qe,ct as He,n as Qe,aS as Je,q6 as Ke,i5 as U,rm as T,bE as Xe,as as Q,aU as $e,xt as Ye,o7 as re,mJ as Ze,xu as et,xv as tt,pl as oe,ro as it,fB as st,xw as nt,xx as ce,xy as v,xz as at,xA as g,xB as rt,xC as ot,xD as ct,xE as lt,xF as le,bf as h,xG as ht,xH as dt,xI as ut,xJ as _t,xK as P,ou as gt,e as m,xL as S,i2 as R,xM as pt,de as ft,xN as vt,xO as bt,xP as mt,xQ as St,xR as yt,xS as $t,xT as wt,lZ as G,xU as Ot,xV as Tt,xW as Et,xX as Lt,xY as At,xZ as he,lX as x,x_ as Rt,x$ as xt,bi as de,aF as J,y0 as jt,y1 as Pt,y2 as Dt,nc as Ft,y3 as zt,s1 as Ct,y4 as Mt,nm as we,bu as Oe,b2 as Te,sc as It,nR as Nt,o4 as kt,aG as Ee,y5 as Wt}from"./index-J0iiHjMT.js";class ri{constructor(e){var i;this.metadata=void 0,this._camera=new Pe,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=I(),this._worldFrame=null,this._renderLocation=$(),this._renderLocationDirty=!0,this._location=new C({x:0,y:0,z:0}),this._elevationAlignedLocation=new C,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=D.None,this._focused=!1,this.events=new De.EventEmitter,this._screenLocation={screenPointArray:ye(),renderScreenPointArray:Fe(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const t=(i=this.view.state)==null?void 0:i.camera;t&&this._camera.copyFrom(t)}destroy(){this._applyObjectTransform=qt,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){var e;return(e=this.view)==null?void 0:e._stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,this._noDisplayCount===1&&this._updateEngineObject(),ze(()=>{this._noDisplayCount--,this._noDisplayCount===0&&this._updateEngineObject()})}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){ue(e)&&(this._screenLocationDirty=!0),Ce(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=I()),Bt(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){Y(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){Y(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=this._elevation.override!=null?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=Me(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:e===!0?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(ue(this._modelTransform)){const t=this._calculateModelTransformOffset(Gt);e=M(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(e,t){if(!this.available)return null;const i=Ie(e,Vt),n=this._getCollisionRadius(t),a=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(Ue(this.screenLocation.screenPointArray,i)0;for(const{stateMask:r,objects:o}of i){if(a){for(const c of o)c.visible=!1;continue}const p=(r&T.All)!==T.None,l=(r&D.All)!==D.None,d=!p||(n&r)==(r&T.All),u=!l||(this.state&r)==(r&D.All);if(d&&u)for(const c of o)c.visible=!0,c.transformation=t;else for(const c of o)c.visible=!1}}_ensureEngineResources(){if(this._engineResources==null){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach(({geometry:{material:r}})=>{i.has(r)||(t.push(r),i.add(r))});const n=new Map;this._renderObjects.forEach(r=>{const o=new Xe({castShadow:!1,geometries:[r.geometry]}),p=n.get(r.stateMask)||[];p.push(o),n.set(r.stateMask,p)});const a=[];n.forEach((r,o)=>a.push({stateMask:o,objects:r})),this._engineResources={objectsByState:a,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||this._engineResources==null||!e)return;const{objectsByState:t,layer:i,materials:n}=this._engineResources;n.forEach(a=>{const r=this._materialIdReferences,o=r.get(a.id)||0;o===0&&e.add(a),r.set(a.id,o+1)}),t.forEach(({objects:a})=>{i.addMany(a),e.addMany(a)}),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||this._engineResources==null||!e)return;const{objectsByState:t,layer:i,materials:n}=this._engineResources;t.forEach(({objects:a})=>{i.removeMany(a),e.removeMany(a)}),n.forEach(a=>{const r=this._materialIdReferences,o=r.get(a.id);o===1?(e.remove(a),r.delete(a.id)):r.set(a.id,o-1)}),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*(e==="touch"?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,Ut);return Q(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return $e(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return Ye(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&re(t,t,this._worldFrame),re(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,this._applyObjectTransform!=null&&this._applyObjectTransform(t),t}get test(){let e=!1;if(this._engineResources!=null)for(const t of this._engineResources.objectsByState){for(const i of t.objects)if(i.visible){e=!0;break}if(e)break}return{areAnyResourcesVisible:e}}}function ue(s){return s[12]!==0||s[13]!==0||s[14]!==0}function Bt(s,e,t){switch(s.viewingMode){case"local":return it(t),!0;case"global":{const i=Ze(s.renderCoordsHelper.spatialReference);return et(e,0,j,0,i.radius),tt(oe(j[0]),oe(j[1]),t),!0}}}const Vt=ye(),_e=Re(),q=xe(),ge=st(),Ut=I(),F=I(),z=je(),j=$(),pe=$(),fe=$(),ve=$(),be=$(),Gt=$(),me=new C({x:0,y:0,z:0,spatialReference:null}),qt=()=>{};class oi{constructor(e,t=T.None){this.geometry=e,this.stateMask=t}}function Ht(s,e){if(!e.screenSizeEnabled)return;const t=s.vertex;nt(t,e),t.uniforms.add(new ce("perScreenPixelRatio",(i,n)=>n.camera.perScreenPixelRatio),new ce("screenSizeScale",i=>i.screenSizeScale)),t.code.add(v`float computeRenderPixelSizeAt( vec3 pWorld ){ +vec3 viewForward = - vec3(view[0][2], view[1][2], view[2][2]); +float viewDirectionDistance = abs(dot(viewForward, pWorld - cameraPosition)); +return viewDirectionDistance * perScreenPixelRatio; +} +vec3 screenSizeScaling(vec3 position, vec3 anchor){ +return position * screenSizeScale * computeRenderPixelSizeAt(anchor) + anchor; +}`)}function Le(s){const e=new at,t=s.multipassEnabled&&(s.output===g.Color||s.output===g.Alpha);e.include(rt,s),e.include(Ht,s),e.include(ot,s);const{vertex:i,fragment:n}=e;return n.include(ct),lt(i,s),n.uniforms.add(new le("uColor",a=>a.color)),e.attributes.add(h.POSITION,"vec3"),e.varyings.add("vWorldPosition","vec3"),t&&e.varyings.add("depth","float"),s.screenSizeEnabled&&e.attributes.add(h.OFFSET,"vec3"),s.shadingEnabled&&(ht(i),e.attributes.add(h.NORMAL,"vec3"),e.varyings.add("vViewNormal","vec3")),i.code.add(v` + void main(void) { + vWorldPosition = ${s.screenSizeEnabled?"screenSizeScaling(offset, position)":"position"}; + `),s.shadingEnabled&&i.code.add(v`vec3 worldNormal = normal; +vViewNormal = (viewNormal * vec4(worldNormal, 1)).xyz;`),i.code.add(v` + ${t?"depth = (view * vec4(vWorldPosition, 1.0)).z;":""} + gl_Position = transformPosition(proj, view, vWorldPosition); + } + `),t&&e.include(dt,s),n.code.add(v` + void main() { + discardBySlice(vWorldPosition); + ${t?"terrainDepthTest(depth);":""} + `),s.shadingEnabled?(n.uniforms.add(new ut("shadingDirection",a=>a.shadingDirection)),n.uniforms.add(new le("shadedColor",a=>Qt(a.shadingTint,a.color))),n.code.add(v`vec3 viewNormalNorm = normalize(vViewNormal); +float shadingFactor = 1.0 - clamp(-dot(viewNormalNorm, shadingDirection), 0.0, 1.0); +vec4 finalColor = mix(uColor, shadedColor, shadingFactor);`)):n.code.add(v`vec4 finalColor = uColor;`),n.code.add(v` + ${s.output===g.ObjectAndLayerIdColor?v`finalColor.a = 1.0;`:""} + if (finalColor.a < ${v.float(_t)}) { + discard; + } + ${s.output===g.Alpha?v`fragColor = vec4(finalColor.a);`:""} + + ${s.output===g.Color?v`fragColor = highlightSlice(finalColor, vWorldPosition); ${s.transparencyPassType===P.Color?"fragColor = premultiplyAlpha(fragColor);":""}`:""} + } + `),e}function Qt(s,e){const t=1-s[3],i=s[3]+e[3]*t;return i===0?(E[3]=i,E):(E[0]=(s[0]*s[3]+e[0]*e[3]*t)/i,E[1]=(s[1]*s[3]+e[1]*e[3]*t)/i,E[2]=(s[2]*s[3]+e[2]*e[3]*t)/i,E[3]=e[3],E)}const E=gt(),Jt=Object.freeze(Object.defineProperty({__proto__:null,build:Le},Symbol.toStringTag,{value:"Module"}));class N extends bt{initializeProgram(e){return new mt(e.rctx,N.shader.get().build(this.configuration),Ae)}_setPipelineState(e){const t=this.configuration,i=e===P.NONE,n=e===P.FrontFace;return St({blending:t.output!==g.Color&&t.output!==g.Alpha||!t.transparent?null:i?yt:$t(e),culling:wt(t.cullFace),depthTest:{func:n?G.LESS:t.shadingEnabled?G.LEQUAL:G.LESS},depthWrite:i?t.writeDepth?Ot:null:Tt(e),colorWrite:Et,polygonOffset:i||n?null:Lt})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}}N.shader=new pt(Jt,()=>ft(()=>Promise.resolve().then(()=>ni),void 0));let b=class extends vt{constructor(){super(...arguments),this.output=g.Color,this.cullFace=R.None,this.transparencyPassType=P.NONE,this.hasSlicePlane=!1,this.transparent=!1,this.writeDepth=!0,this.screenSizeEnabled=!0,this.shadingEnabled=!0,this.multipassEnabled=!1,this.cullAboveGround=!1}};m([S({count:g.COUNT})],b.prototype,"output",void 0),m([S({count:R.COUNT})],b.prototype,"cullFace",void 0),m([S({count:P.COUNT})],b.prototype,"transparencyPassType",void 0),m([S()],b.prototype,"hasSlicePlane",void 0),m([S()],b.prototype,"transparent",void 0),m([S()],b.prototype,"writeDepth",void 0),m([S()],b.prototype,"screenSizeEnabled",void 0),m([S()],b.prototype,"shadingEnabled",void 0),m([S()],b.prototype,"multipassEnabled",void 0),m([S()],b.prototype,"cullAboveGround",void 0),m([S({constValue:!1})],b.prototype,"occlusionPass",void 0);const Ae=new Map([[h.POSITION,0],[h.NORMAL,1],[h.OFFSET,2]]);class Kt extends At{constructor(e){super(e,new Yt),this.supportsEdges=!0,this._configuration=new b,this._vertexAttributeLocations=Ae}getConfiguration(e,t){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._isTransparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled,this._configuration.transparencyPassType=t.transparencyPassType,this._configuration.multipassEnabled=t.multipassEnabled,this._configuration.cullAboveGround=t.multipassTerrain.cullAboveGround,this._configuration}intersect(e,t,i,n,a,r){if(this.parameters.screenSizeEnabled){const o=e.attributes.get(h.OFFSET);he(e,i,n,a,{applyToVertex:(l,d,u,c)=>{const f=Q(Se,o.data[3*c],o.data[3*c+1],o.data[3*c+2]),_=Q(ei,l,d,u);return H(f,f,this.parameters.screenSizeScale*i.camera.computeScreenPixelSizeAt(f)),M(_,_,f),[_[0],_[1],_[2]]},applyToAabb:l=>{const d=Ct(l,Se);return Mt(l,this.parameters.screenSizeScale*i.camera.computeScreenPixelSizeAt(d))}},r)}else he(e,i,n,a,void 0,r)}produces(e,t){if(t===g.Highlight)return e===x.OPAQUE_MATERIAL;if(t===g.Color||t===g.Alpha||t===g.ObjectAndLayerIdColor){let i=x.OPAQUE_MATERIAL;return this._isTransparent&&(i=this.parameters.writeDepth?x.TRANSPARENT_MATERIAL:x.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),e===i||e===x.DRAPED_MATERIAL}return!1}createGLMaterial(e){return new Xt(e)}createBufferWriter(){return new Zt(this.parameters.screenSizeEnabled)}get _isTransparent(){return this.parameters.color[3]<1||this.parameters.forceTransparentMode}}let Xt=class extends Rt{beginSlot(e){return this.ensureTechnique(N,e)}},Yt=class extends xt{constructor(){super(...arguments),this.color=de(1,1,1,1),this.shadingTint=de(0,0,0,.25),this.shadingDirection=J($(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=R.None,this.screenSizeEnabled=!1,this.shadingEnabled=!0}},Zt=class{constructor(e){this.screenSizeEnabled=e;const t=jt().vec3f(h.POSITION).vec3f(h.NORMAL);this.screenSizeEnabled&&t.vec3f(h.OFFSET),this.vertexBufferLayout=t}elementCount(e){return e.attributes.get(h.POSITION).indices.length}write(e,t,i,n,a){if(Pt(i,this.vertexBufferLayout,e,t,n,a),this.screenSizeEnabled){if(!i.attributes.has(h.OFFSET))throw new Error(`${h.OFFSET} vertex attribute required for screenSizeEnabled ShadedColorMaterial`);{const r=i.attributes.get(h.OFFSET);Dt(r.size===3);const o=n.getField(h.OFFSET,Ft);if(!o)throw new Error("unable to acquire view for "+h.OFFSET);zt(r,t,o,a)}}}};const Se=$(),ei=$();function ui(s,e=Te.OccludeAndTransparent,t=!0){const i=we(s),n=!(s[3]<1);return t?new Kt({color:i,writeDepth:n,cullFace:R.Back,renderOccluded:e,isDecoration:!0}):new Oe({color:i,writeDepth:n,cullFace:R.Back,renderOccluded:e,isDecoration:!0})}function _i(s,e=Te.OccludeAndTransparent){const t=we(s);return new Oe({color:t,writeDepth:!0,cullFace:R.Front,renderOccluded:e,isDecoration:!0})}const gi=Object.freeze({calloutLength:40,calloutWidth:1,discRadius:27,focusMultiplier:1.1}),pi=Object.freeze({autoScaleRenderObjects:!1,worldSized:!0});function fi(s,e,t,i){const n=$e(y.get(),s,t),a=ti(n,Ee(y.get(),i,n),t,kt.get());Wt(a,a);const r=A(y.get(),e,a);return Math.atan2(r[1],r[0])}function ti(s,e,t,i){const n=J(y.get(),s),a=J(y.get(),e),r=Ee(y.get(),n,a);return i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=0,i[4]=a[0],i[5]=a[1],i[6]=a[2],i[7]=0,i[8]=r[0],i[9]=r[1],i[10]=r[2],i[11]=0,i[12]=t[0],i[13]=t[1],i[14]=t[2],i[15]=1,i}function ii(s,e){const t=s.getViewForGraphic(e);return t!=null&&"computeAttachmentOrigin"in t?t.computeAttachmentOrigin(e,s.spatialReference):null}function vi(s,e,t){const i=ii(s,t);i==null?si(e,t.geometry):e.elevationAlignedLocation=i}function si(s,e){if(e==null)return;const t=e.type==="mesh"?e.anchor:It(e);t!=null&&(s.location=Nt(t))}const ni=Object.freeze(Object.defineProperty({__proto__:null,build:Le},Symbol.toStringTag,{value:"Module"}));export{ri as $,pi as D,fi as F,ti as M,gi as O,_i as b,oi as e,Kt as j,ii as k,vi as v,ui as w}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SliceAnalysisView3D--IcVdus9.js b/dist/assets/SliceAnalysisView3D--IcVdus9.js new file mode 100644 index 0000000..e209d9c --- /dev/null +++ b/dist/assets/SliceAnalysisView3D--IcVdus9.js @@ -0,0 +1 @@ +import{k4 as fe,Z as Ve,e as l,y as r,c as L,p as N,c7 as Z,d as v,nX as d,nY as ne,aI as be,nZ as Me,Y as De,aX as Ee,aY as Ce,C as Te,A as B,n as V,kS as M,n_ as p,n$ as D,ax as S,o0 as F,aQ as C,o1 as q,aE as Y,br as c,au as z,at as Q,o2 as W,aT as U,aN as H,cQ as Se,o3 as xe,o4 as T,h9 as X,ki as $e,aF as J,o5 as ke,ak as ee,aJ as He,aL as Le,as as le,o6 as re,o7 as oe,i6 as ze,o8 as he,aa as K,kZ as Oe}from"./index-J0iiHjMT.js";import{s as Ge}from"./AnalysisView3D-jkk3JIRT.js";import{C as Re}from"./BuildingComponentSublayer-j8wian8V.js";import{U as Ie,P as Ae,v as Be,j as ue,m as Fe,I as Ue,H as Ke,g as te,a as je,A as pe,E as ce,M as de,r as O,t as G,c as ie,C as ae,o as Ne,p as Ze,s as qe,_ as x,b as Ye,V as f,d as ye,l as Qe,e as We,f as Xe,h as Je,n as ve,i as we,k as et,q as tt,u as it,w as at,x as st}from"./SlicePlaneMaterial.glsl-RxywoUhm.js";import{t as nt}from"./LineVisualElement-4BP10o6v.js";import{l as lt,n as rt}from"./Factory-m-O4WAoG.js";import{F as ot}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";import{H as $}from"./dragEventPipeline3D-4CqrlxD2.js";import{a as ht}from"./AnalysisToolBase-3A13PdgS.js";import{d as k}from"./InteractiveToolBase-WDic4GPF.js";import{a as ut,v as pt}from"./analysisViewUtils-AQaQeJpR.js";import"./FeatureLayer--S4epFk-.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./editsZScale-Wgw9kbYG.js";import"./queryZScale-IaMm02_2.js";import"./FeatureSet-d4S1oKME.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";import"./FeatureTemplate-kUgbbA00.js";import"./FeatureType-MpRe7WJj.js";import"./versionUtils-4v9zIDlv.js";import"./TopFeaturesQuery-E6D2tV-x.js";import"./ImageMaterial.glsl-TdPtjVc_.js";import"./Object3DVisualElement-TMb7y_wl.js";import"./VisualElement-kjYXz27t.js";import"./drawUtils-woTYaREB.js";function ct(e){switch(e.type){case"building-scene":case"csv":case"dimension":case"feature":case"geo-rss":case"geojson":case"graphics":case"group":case"integrated-mesh":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-notes":case"ogc-feature":case"oriented-imagery":case"point-cloud":case"route":case"scene":case"stream":case"voxel":case"subtype-group":case"unknown":case"unsupported":case"wfs":case null:return!1;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"elevation":case"imagery":case"imagery-tile":case"map-image":case"media":case"open-street-map":case"tile":case"vector-tile":case"video":case"wcs":case"web-tile":case"wms":case"wmts":return!0;default:return fe(e.type),!1}}const _e="esri.views.3d.analysis.Slice.SliceController",R=Ve.getLogger(_e);let P=class extends N{constructor(e){super(e),this._internalChange=!1,this._currentSlicePlane=null}initialize(){this.addHandles(this.analysis.excludedLayers.on("before-add",e=>{const t=e.item;t!=null&&(t instanceof Z||t instanceof Re)?t instanceof Z&&ct(t)?(R.error("excludedLayers",`Layer '${t.title}, id:${t.id}' of type '${t.type}' can not be individually excluded from slicing. Use 'excludeGroundSurface' instead.`),e.preventDefault()):this.analysis.excludedLayers.includes(t)&&e.preventDefault():(R.error("excludedLayers","Invalid layer type, layer must derive from Layer or BuildingComponentSublayer"),e.preventDefault())})),yt(this.view,this),this.addHandles([v(()=>this.analysisViewData.plane,()=>{this._internalChange||this._updateSlicePlaneFromBoundedPlane(),this._updateLayerViews()},{sync:!0}),v(()=>this.analysis.excludeGroundSurface,()=>this._updateLayerViews(),{sync:!0}),this.analysis.excludedLayers.on("change",()=>this._updateLayerViews()),v(()=>[this.analysisViewData.active,this.analysisViewData.visible],()=>{this._updateActiveController(),this._updateViewSlicePlane()},{sync:!0}),v(()=>this._allLayerAndSubLayerViews,()=>this._updateLayerViews())]),this.addHandles([v(()=>this.analysis.shape,()=>{this._internalChange||(this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane())},{sync:!0})],"analysis"),this._updateActiveController(),this._updateBoundedPlaneFromSlicePlane(),this._updateViewSlicePlane()}destroy(){this.analysisViewData.active&&(this.analysisViewData.active=!1,this.view.slicePlane=null,this._updateActiveController(),this._updateViewSlicePlane()),vt(this.view,this),this.set("view",null)}get _allLayerAndSubLayerViews(){const e=this.view.allLayerViews.items;return e.concat(e.filter(Ie).flatMap(({sublayerViews:t})=>t.items))}_updateBoundedPlaneFromSlicePlane(){const e=this.analysis.shape,t=this._currentSlicePlane;if(t==null&&e==null||t!=null&&e!=null&&e.equals(t))return;let i=null,a=null;if((e==null?void 0:e.position)!=null){const s=e.position.spatialReference,n=Ae(e,this.view);n==null&&nt(this.analysis,s,R),i=Be(n,this.view,{tiltEnabled:this.analysis.tiltEnabled},d()),i!=null&&(a={heading:e.heading,tilt:e.tilt,position:e.position,width:e.width,height:e.height})}this._currentSlicePlane=a,this._internalChange=!0,this.analysisViewData.plane=i,this._internalChange=!1}_updateSlicePlaneFromBoundedPlane(){const e=this.analysisViewData.plane,t=ue(e,this.view,this.view.spatialReference,new ne);let i=null;t!=null&&(i={heading:t.heading,tilt:t.tilt,position:t.position,width:t.width,height:t.height}),this._currentSlicePlane=i,this._internalChange=!0,this.analysis.shape=t,this._internalChange=!1,this._updateViewSlicePlane()}_updateActiveController(){if(I)return;const e=Pe(this.view);if(e)if(this.analysisViewData.active)e.activeController!=null&&e.activeController!==this?(I=!0,e.activeController.analysisViewData.active=!1,I=!1):e.activeController!=null&&e.activeController,this._updateLayerViews(),e.activeController=this;else{if(e.activeController!=null&&e.activeController!==this)return;e.activeController!=null&&e.activeController===this&&(e.activeController=null,this._updateLayerViews())}}_updateViewSlicePlane(){dt(this.view)}_updateLayerViews(){const e=this.analysisViewData.plane!=null&&this.analysisViewData.visible&&this.analysisViewData.active,t=[],i=a=>{"layers"in a?a.layers.forEach(i):t.push(a)};this.analysis.excludedLayers.forEach(i),this.view.allLayerViews.forEach(a=>{a.destroyed||("slicePlaneEnabled"in a&&(a.slicePlaneEnabled=e&&!t.includes(a.layer)),"sublayerViews"in a&&a.sublayerViews.forEach(s=>{s.slicePlaneEnabled=e&&!t.includes(s.sublayer)}))}),this.view.basemapTerrain!=null&&(this.view.basemapTerrain.slicePlaneEnabled=e&&!this.analysis.excludeGroundSurface)}};l([r()],P.prototype,"view",void 0),l([r()],P.prototype,"analysis",void 0),l([r()],P.prototype,"analysisViewData",void 0),l([r()],P.prototype,"_allLayerAndSubLayerViews",null),P=l([L(_e)],P);const g=new Map;let I=!1;function dt(e){const t=Pe(e),i=t==null?void 0:t.activeController;(i==null?void 0:i.analysisViewData.plane)!=null&&i.analysisViewData.visible?e.slicePlane=i.analysisViewData.plane:e.slicePlane=null}function yt(e,t){var i;g.has(e)||g.set(e,{all:[],activeController:null}),(i=g.get(e))==null||i.all.push(t)}function Pe(e){return g.get(e)}function vt(e,t){if(!g.has(e))throw new Error("view expected in global slice register");const i=g.get(e),a=(i==null?void 0:i.all.lastIndexOf(t))??-1;if(!i||a===-1)throw new Error("controller expected in global slice register");i.all.splice(a,1),i.all.length===0&&g.delete(e)}var j;let u=j=class extends ht{constructor(e){super(e),this._clock=Me,this._previewPlaneOpacity=1,this.removeIncompleteOnCancel=!1,this.layersMode="none",this.shiftManipulator=null,this.rotateHeadingManipulator=null,this.rotateTiltManipulator=null,this.resizeManipulators=null,this._frameTask=null,this._pointerMoveTimerMs=Fe,this._prevPointerMoveTimeout=null,this._previewPlaneGridVisualElement=null,this._previewPlaneOutlineVisualElement=null,this._startPlane=d(),this._previewPlane=null,this._activeKeyModifiers={},this._lastCursorPosition=De(),this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._intersector=Ee(e.view.state.viewingMode),this._intersector.options.store=Ce.MIN}initialize(){var h;if(this.analysis==null)throw new Error("SliceTool requires valid analysis, but null was provided.");const e=o=>{this._updateManipulatorsInteractive(o),o.grabbing||(this.analysisViewData.plane!=null&&p(this.analysisViewData.plane,this._startPlane),this.inputState=null)},t=new Ue(this.view,Ke.CENTER_ON_ARROW);this.shiftManipulator=t,this.manipulators.add(t),this.addHandles([this._createShiftDragPipeline(t),t.events.on("grab-changed",o=>{this._onShiftGrab(o),e(t)})]);const i=!((h=this.view._stage)!=null&&h.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result),a=new te(this.view,(o,w)=>lt(this.view.textures,{accentColor:o,contrastColor:w,preMultiplyAlpha:i}));this.rotateHeadingManipulator=a,this.manipulators.add(a),this.addHandles([this._createRotateHeadingDragPipeline(a),a.events.on("grab-changed",o=>{this._onRotateHeadingGrab(o),e(a)})]);const s=new te(this.view,(o,w)=>rt(this.view.textures,{accentColor:o,contrastColor:w,preMultiplyAlpha:i}));this.rotateTiltManipulator=s,this.manipulators.add(s),this.addHandles([this._createRotateTiltDragPipeline(s),s.events.on("grab-changed",o=>{this._onRotateTiltGrab(o),e(s)})]),this.resizeManipulators=this._resizeHandles.map((o,w)=>{const m=new je(this.view,o);return this.addHandles([this._createResizeDragPipeline(m),m.events.on("grab-changed",b=>{this._onResizeGrab(b,w),e(m)})]),m}),this.manipulators.addMany(this.resizeManipulators),this._previewPlaneGridVisualElement=pe(this.view),this._previewPlaneOutlineVisualElement=ce(this.view),this._previewPlaneOutlineVisualElement.width=de,this.addHandles(v(()=>[this.analysisViewData.plane,this.analysis.tiltEnabled],()=>this._updateManipulators(),Te));const n=v(()=>this.state,o=>{o==="sliced"&&this.finishToolCreation()},B);this.addHandles([n,v(()=>this.view.state.camera,()=>this._onCameraChange())])}destroy(){this._removeFrameTask(),this._clearPointerMoveTimeout(),this._previewPlaneOutlineVisualElement=V(this._previewPlaneOutlineVisualElement),this._previewPlaneGridVisualElement=V(this._previewPlaneGridVisualElement)}get state(){const e=!!this.analysisViewData.plane,t=!!this.inputState;return e?e&&t?"slicing":e&&!t?"sliced":"ready":"ready"}get cursor(){return this._isPlacingSlicePlane||this.layersMode==="exclude"?"crosshair":this._creatingPointerId!=null?"grabbing":null}set analysis(e){if(e==null)throw new Error("SliceTool requires valid analysis, but null was provided.");this.removeHandles("analysis"),this._set("analysis",e)}get inputState(){return this._get("inputState")}set inputState(e){this._set("inputState",e),this.analysisViewData.showGrid=e!=null&&e.type==="resize",this._updateMaterials()}get _isPlacingSlicePlane(){return!this.inputState&&!this.analysisViewData.plane&&this.active}get _creatingPointerId(){return this.inputState!=null&&this.inputState.type==="shift"?this.inputState.creatingPointerId:null}enterExcludeLayerMode(){this.analysisViewData.plane!=null&&(this._set("layersMode","exclude"),this.active||(this.view.activeTool=this))}exitExcludeLayerMode(){this.analysisViewData.plane!=null&&(this._set("layersMode","none"),this.active&&(this.view.activeTool=null))}onDeactivate(){this._set("layersMode","none"),this._updatePreviewPlane(null)}onShow(){this._updateVisibility(!0)}onHide(){this._updateVisibility(!1)}_updateVisibility(e){this._updateManipulators(),e||this._clearPointerMoveTimeout()}onInputEvent(e){switch(e.type){case"pointer-drag":if(!A(e))return;this._isPlacingSlicePlane?this._onClickPlacePlane(e)&&e.stopPropagation():this._onPointerDrag(e)&&e.stopPropagation();break;case"pointer-move":this._onPointerMove(e);break;case"pointer-up":this._onPointerUp(e)&&e.stopPropagation();break;case"immediate-click":if(!A(e))return;this._onClickPlacePlane(e)&&e.stopPropagation();break;case"click":if(!A(e))return;this._onClickExcludeLayer(e)&&e.stopPropagation();break;case"drag":this.inputState&&e.stopPropagation();break;case"key-down":this._onKeyDown(e)&&e.stopPropagation();break;case"key-up":this._onKeyUp(e)&&e.stopPropagation()}}onEditableChange(){this.analysisViewData.editable=this.internallyEditable}_onPointerDrag(e){const t=this.inputState;if(e.pointerId===this._creatingPointerId&&t!=null&&t.type==="shift"){const i=M(e);return this.shiftManipulator.events.emit("drag",{action:t.hasBeenDragged?"update":"start",pointerType:e.pointerType,start:i,screenPoint:i}),t.hasBeenDragged=!0,!0}return!1}_onPointerMove(e){this._lastCursorPosition.x=e.x,this._lastCursorPosition.y=e.y,this._resetPointerMoveTimeout(),e.pointerType!=="touch"&&this._updatePreviewPlane(M(e),this._activeKeyModifiers)}_onCameraChange(){this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),this._updateManipulators()}_onPointerUp(e){if(e.pointerId===this._creatingPointerId&&this.analysisViewData.plane!=null){const t=M(e);return this.shiftManipulator.events.emit("drag",{action:"end",start:t,screenPoint:t}),p(this.analysisViewData.plane,this._startPlane),this.inputState=null,!0}return!1}_onClickPlacePlane(e){if(this.layersMode==="exclude")return!1;if(this._isPlacingSlicePlane){const t=M(e),i=d();if(this._pickPlane(t,!1,this._activeKeyModifiers,i)){if(e.type==="pointer-drag"){const a=D(this.view.state.camera,t,E);this.inputState=se(a,e.pointerId,i.origin,i)}return p(i,this._startPlane),this.analysis.shape=ue(i,this.view,this.view.spatialReference,new ne),!0}}return!1}_onClickExcludeLayer(e){return!(this.layersMode!=="exclude"||!this.created)&&(this.view.hitTest(M(e)).then(t=>{if(t.results.length){const i=t.results[0],a=(i==null?void 0:i.type)==="graphic"&&i.graphic;if(a){const s=a.sourceLayer||a.layer;s&&this.analysis.excludedLayers.push(s)}}else t.ground.layer?this.analysis.excludedLayers.push(t.ground.layer):this.analysis.excludeGroundSurface=!0}),this._set("layersMode","none"),this.active&&(this.view.activeTool=null),!0)}_onKeyDown(e){return(e.key===O||e.key===G)&&(this._activeKeyModifiers[e.key]=!0,this._previewPlane!=null&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onKeyUp(e){return!(e.key!==O&&e.key!==G||!this._activeKeyModifiers[e.key])&&(delete this._activeKeyModifiers[e.key],this._previewPlane!=null&&this._updatePreviewPlane(this._lastCursorPosition,this._activeKeyModifiers),!0)}_onShiftGrab(e){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const t=D(this.view.state.camera,e.screenPoint,E);p(this.analysisViewData.plane,this._startPlane),this.inputState=se(t,null,this.shiftManipulator.renderLocation,this.analysisViewData.plane)}_createShiftDragPipeline(e){return k(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="shift")return;const n=this.analysisViewData.plane!=null?p(this.analysisViewData.plane,d()):null;i.next($(this.view,s.shiftPlane)).next(this._shiftDragAdjustSensitivity(s)).next(this._shiftDragUpdatePlane(s)),a.next(()=>{n!=null&&this._updateBoundedPlane(n)})})}_shiftDragAdjustSensitivity(e){return t=>{if(this.analysisViewData.plane==null)return null;const i=.001,a=Math.min((1-Math.abs(S(F(this.analysisViewData.plane),t.ray.direction)/C(t.ray.direction)))/i,1),s=-q(this._startPlane.plane,t.renderEnd),n=-q(this._startPlane.plane,e.startPoint);return e.depth=e.depth*(1-a)+s*a-n,t}}_shiftDragUpdatePlane(e){return()=>{if(this.analysisViewData.plane==null)return;const t=Y(c.get(),this._startPlane.origin),i=Y(c.get(),F(this._startPlane));z(i,i,-e.depth),Q(i,i,t);const a=W(i,this.analysisViewData.plane.basis1,this.analysisViewData.plane.basis2,d());this._updateBoundedPlane(a)}}_onRotateHeadingGrab(e){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const t=ie(this.analysisViewData.plane,this.view.renderCoordsHelper,ae.HEADING,U()),i=D(this.view.state.camera,e.screenPoint,E),a=K();H(t,i,a)&&(p(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:t,startPoint:a})}_createRotateHeadingDragPipeline(e){return k(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="rotate")return;const n=this.analysisViewData.plane!=null?p(this.analysisViewData.plane,d()):null;i.next($(this.view,s.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(s)).next(this._rotateDragUpdatePlaneFromRotate()),a.next(()=>{n!=null&&this._updateBoundedPlane(n)})})}_onRotateTiltGrab(e){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const t=ie(this.analysisViewData.plane,this.view.renderCoordsHelper,ae.TILT,U()),i=D(this.view.state.camera,e.screenPoint,E),a=K();H(t,i,a)&&(p(this.analysisViewData.plane,this._startPlane),this.inputState={type:"rotate",rotatePlane:t,startPoint:a})}_createRotateTiltDragPipeline(e){return k(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="rotate")return;const n=this.analysisViewData.plane!=null?p(this.analysisViewData.plane,d()):null;i.next($(this.view,s.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(s)).next(this._rotateDragUpdatePlaneFromRotate()),a.next(()=>{n!=null&&this._updateBoundedPlane(n)})})}_rotateDragRenderPlaneToRotate(e){return t=>{if(this.analysisViewData.plane==null)return null;const i=Se(e.rotatePlane),a=ot(e.startPoint,t.renderEnd,this.analysisViewData.plane.origin,i);return{...t,rotateAxis:i,rotateAngle:a}}}_rotateDragUpdatePlaneFromRotate(){return e=>{if(this.analysisViewData.plane==null)return;const t=xe(T.get(),e.rotateAngle,e.rotateAxis);if(t==null)return;const i=X(c.get(),this._startPlane.basis1,t),a=X(c.get(),this._startPlane.basis2,t),s=W(this.analysisViewData.plane.origin,i,a,d());this._updateBoundedPlane(s)}}_onResizeGrab(e,t){if(e.action!=="start"||this.analysisViewData.plane==null||!e.screenPoint)return;const i=D(this.view.state.camera,e.screenPoint,E),a=c.get();H(this.analysisViewData.plane.plane,i,a)&&(p(this.analysisViewData.plane,this._startPlane),this.inputState={type:"resize",activeHandleIdx:t,startPoint:$e(a)})}_createResizeDragPipeline(e){return k(e,(t,i,a)=>{const s=this.inputState;if(s==null||s.type!=="resize"||this.analysisViewData.plane==null)return;const n=p(this.analysisViewData.plane,d());i.next($(this.view,this.analysisViewData.plane.plane)).next(this._resizeDragUpdatePlane(s)),a.next(()=>{this._updateBoundedPlane(n)})})}_resizeDragUpdatePlane(e){return t=>{if(this.analysisViewData.plane==null)return;const i=this._resizeHandles[e.activeHandleIdx],a=Ne(i,e.startPoint,t.renderEnd,this.view.state.camera,this._startPlane,p(this.analysisViewData.plane));this._updateBoundedPlane(a)}}_updateBoundedPlane(e){const t=this.analysisViewData;if(t==null)throw new Error("valid internal object expected");t.plane=e}_updatePreviewPlane(e,t={}){let i=this._previewPlane;if(this._previewPlane=null,e==null)return this._removeFrameTask(),void this._updateManipulators();if(!this.analysisViewData.plane&&this.active){const a=i??d();if(i=i!=null?p(i,wt):null,this._pickPlane(e,!0,t,a)){const s=tt;let n=!1;i!=null&&(n=S(i.plane,a.plane){this._previewPlaneOpacity=Math.min(this._previewPlaneOpacity+a/(1e3*Ze),1),this._updateManipulators(),this._previewPlaneOpacity===1&&this._removeFrameTask()}}):this._previewPlane==null&&this._frameTask!=null?this._removeFrameTask():this._previewPlane!=null&&this._updateManipulators()}_removeFrameTask(){this._frameTask=ee(this._frameTask)}_pickMinResult(e){const t=He(e,Le.get());return this.view.sceneIntersectionHelper.intersectToolIntersectorScreen(t,this._intersector),this._intersector.results.min}_pickPlane(e,t,i,a){const s=this._pickMinResult(e),n=c.get();if(!s.getIntersectionPoint(n))return!1;const h=s.getTransformedNormal(c.get()),o=this.view.state.camera;S(h,o.viewForward)>0&&z(h,h,-1);const w=qe(n,o),m=(t?1:-1)*w*it,b=z(c.get(),h,m);Q(b,b,n);const ge=this.analysis.tiltEnabled?x.TILTED:x.HORIZONTAL_OR_VERTICAL,me=i[O]?x.VERTICAL:i[G]?x.HORIZONTAL:ge;return Ye(b,h,w,w,o,me,this.view.renderCoordsHelper,a),!0}_clearPointerMoveTimeout(){this._prevPointerMoveTimeout=ee(this._prevPointerMoveTimeout)}_resetPointerMoveTimeout(){this._clearPointerMoveTimeout(),this.shiftManipulator.state|=f,this.rotateHeadingManipulator.state|=f,this.rotateTiltManipulator.state|=f,this._prevPointerMoveTimeout=this._clock.setTimeout(()=>{this.shiftManipulator.state&=~f,this.rotateHeadingManipulator.state&=~f,this.rotateTiltManipulator.state&=~f},this._pointerMoveTimerMs)}_updateManipulators(){if(j.disableEngineLayers)return;let e,t=!1;if(this.analysisViewData.plane!=null)e=this.analysisViewData.plane,t=!1;else{if(this._previewPlane==null)return this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach(h=>h.available=!1),this._previewPlaneOutlineVisualElement.visible=!1,void(this._previewPlaneGridVisualElement.visible=!1);e=this._previewPlane,t=!0}const i=ye(e,T.get());t?(this.shiftManipulator.available=!1,this.rotateHeadingManipulator.available=!1,this.rotateTiltManipulator.available=!1,this.resizeManipulators.forEach(h=>h.available=!1),this._previewPlaneOutlineVisualElement.attached=!0,this._previewPlaneGridVisualElement.attached=!0,this._previewPlaneOutlineVisualElement.visible=!0,this._previewPlaneGridVisualElement.visible=!0):(this.shiftManipulator.available=!0,this.rotateHeadingManipulator.available=!0,this.rotateTiltManipulator.available=this.analysis.tiltEnabled,this.resizeManipulators.forEach(h=>h.available=!0),Qe(this.shiftManipulator,i,e,this.view.state.camera),We(this.rotateHeadingManipulator,i,e,this.view.renderCoordsHelper),Xe(this.rotateTiltManipulator,i,e),this.resizeManipulators.forEach((h,o)=>Je(h,this._resizeHandles[o],i,e)),this._previewPlaneOutlineVisualElement.visible=!1,this._previewPlaneGridVisualElement.visible=!1);const a=le(c.get(),C(e.basis1),C(e.basis2),1),s=re(T.get(),a),n=oe(s,i,s);this._previewPlaneOutlineVisualElement.transform=n,this._previewPlaneGridVisualElement.transform=n,this._updateMaterials()}_updateMaterials(){const e=ve(this.view.effectiveTheme);e[3]*=this._previewPlaneOpacity;const t=ze(we);t[3]*=this._previewPlaneOpacity,this._previewPlaneOutlineVisualElement.color=e,this._previewPlaneGridVisualElement.backgroundColor=t,this._previewPlaneGridVisualElement.gridColor=he}_updateManipulatorsInteractive(e){if(!e.grabbing)return this.shiftManipulator.interactive=!0,this.rotateHeadingManipulator.interactive=!0,this.rotateTiltManipulator.interactive=!0,void this.resizeManipulators.forEach(t=>{t.interactive=!0});this.shiftManipulator.interactive=this.shiftManipulator===e,this.rotateHeadingManipulator.interactive=this.rotateHeadingManipulator===e,this.rotateTiltManipulator.interactive=this.rotateTiltManipulator===e,this.resizeManipulators.forEach(t=>{t.interactive=t===e})}testData(){return{plane:this.analysisViewData.plane,setPointerMoveTimerMs:e=>{this._pointerMoveTimerMs=e}}}};function se(e,t,i,a){const s=et(i,F(a),e.direction,U()),n=K();return H(s,e,n)?{type:"shift",creatingPointerId:t,hasBeenDragged:!1,shiftPlane:s,depth:0,startPoint:n}:null}function A(e){return e.pointerType!=="mouse"||e.button===0}u.disableEngineLayers=!1,l([r()],u.prototype,"_clock",void 0),l([r({constructOnly:!0})],u.prototype,"view",void 0),l([r()],u.prototype,"analysisViewData",void 0),l([r({readOnly:!0})],u.prototype,"state",null),l([r({readOnly:!0})],u.prototype,"cursor",null),l([r()],u.prototype,"analysis",null),l([r()],u.prototype,"removeIncompleteOnCancel",void 0),l([r({readOnly:!0})],u.prototype,"layersMode",void 0),l([r({value:null})],u.prototype,"inputState",null),l([r()],u.prototype,"_isPlacingSlicePlane",null),l([r()],u.prototype,"_creatingPointerId",null),u=j=l([L("esri.views.3d.analysis.Slice.SliceTool")],u);const wt=d(),E=be(),_t=u;let _=class extends N{constructor(e){super(e),this._gridVisualElement=null,this._outlineVisualElement=null,this.showGrid=!1,this.preview=!0}initialize(){const e=this.analysisViewData;if(e==null)throw new Error("expected internal object to be valid");this._gridVisualElement=pe(this.view),this._outlineVisualElement=ce(this.view),this.addHandles([v(()=>{const t=e.plane!=null&&this.analysisViewData.visible,{active:i}=this.analysisViewData,{preview:a,showGrid:s,view:n}=this,{effectiveTheme:h}=n;return{visible:t,active:i,preview:a,showGrid:s,gridColor:at(h),outlineColor:ve(h)}},t=>this._updateMaterials(t),B),v(()=>e.plane,t=>this._updatePlane(t),B)],"internal")}destroy(){this._gridVisualElement=V(this._gridVisualElement),this._outlineVisualElement=V(this._outlineVisualElement),this.set("view",null)}_updatePlane(e){if(e==null)return;this._gridVisualElement.attached=!0,this._outlineVisualElement.attached=!0;const t=le(c.get(),C(e.basis1),C(e.basis2),1),i=re(T.get(),t),a=ye(e,T.get()),s=oe(i,a,i);this._outlineVisualElement.transform=s,this._gridVisualElement.transform=s}_updateMaterials({visible:e,active:t,preview:i,showGrid:a,gridColor:s,outlineColor:n}){this._outlineVisualElement.color=n,this._outlineVisualElement.width=i?de:st,this._outlineVisualElement.stipplePattern=t?null:Oe(5),this._gridVisualElement.backgroundColor=we,this._gridVisualElement.gridColor=a?s:he,this._gridVisualElement.visible=e,this._outlineVisualElement.visible=e}};l([r()],_.prototype,"view",void 0),l([r()],_.prototype,"analysis",void 0),l([r()],_.prototype,"analysisViewData",void 0),l([r()],_.prototype,"showGrid",void 0),l([r()],_.prototype,"preview",void 0),_=l([L("esri.views.3d.analysis.Slice.SliceVisualization")],_);let y=class extends Ge(N){constructor(e){super(e),this.type="slice-view-3d",this.analysis=null,this.tool=null,this.analysisVisualization=null,this.analysisController=null,this.plane=null,this.active=!0}initialize(){this.analysisVisualization=new _({view:this.view,analysis:this.analysis,analysisViewData:this}),this.analysisController=new P({view:this.view,analysis:this.analysis,analysisViewData:this}),this.addHandles(ut(this,_t))}destroy(){pt(this),this.analysisVisualization=V(this.analysisVisualization),this.analysisController=V(this.analysisController)}get showGrid(){var e;return((e=this.analysisVisualization)==null?void 0:e.showGrid)??!1}set showGrid(e){this.analysisVisualization&&(this.analysisVisualization.showGrid=e)}get editable(){return!this.analysisVisualization.preview}set editable(e){this.analysisVisualization.preview=!e}get testData(){return{visualization:this.analysisVisualization,controller:this.analysisController,tool:this.tool}}};l([r({readOnly:!0})],y.prototype,"type",void 0),l([r({constructOnly:!0,nonNullable:!0})],y.prototype,"analysis",void 0),l([r()],y.prototype,"tool",void 0),l([r()],y.prototype,"plane",void 0),l([r()],y.prototype,"active",void 0),l([r()],y.prototype,"showGrid",null),l([r()],y.prototype,"editable",null),y=l([L("esri.views.3d.analysis.SliceAnalysisView3D")],y);const qt=y;export{qt as default}; diff --git a/dist/assets/SlicePlaneMaterial.glsl-RxywoUhm.js b/dist/assets/SlicePlaneMaterial.glsl-RxywoUhm.js new file mode 100644 index 0000000..06b74f5 --- /dev/null +++ b/dist/assets/SlicePlaneMaterial.glsl-RxywoUhm.js @@ -0,0 +1,22 @@ +import{bi as j,nk as ke,dJ as Je,pl as Q,xz as Qe,xE as Ke,bf as K,xy as we,xF as Ie,xx as et,xM as tt,de as rt,xO as st,xP as nt,y6 as it,xQ as at,y7 as ot,uY as q,lZ as ct,xW as dt,y8 as lt,y9 as ut,ya as gt,yb as ht,yc as pt,xA as ft,lX as bt,x_ as mt,b2 as $,b5 as Ae,jK as _t,q8 as ne,aI as $t,br as l,aE as M,aV as De,aQ as R,as as ee,at as b,au as p,v$ as fe,o4 as F,bx as We,o7 as G,yd as je,ax as V,aG as E,aF as S,aU as w,o2 as Tt,wl as Ot,ye as le,yf as wt,yg as It,ki as At,w5 as Ge,cP as Et,i4 as Ct,m2 as Fe,ag as Pt,nY as vt,yh as Mt,nX as Be,yi as ue,nw as Ee,o0 as Rt,pI as St,Z as xt,b6 as W,d as be,P as me,ab as C,b8 as L,rm as _,b1 as v,hS as yt,kz as ze,by as Lt,bz as Ce,bu as X,i2 as Y,aa as te,ro as Pe,w4 as ve,bA as ce,h8 as Me,nx as Re,yj as Se,w2 as xe,wh as Nt}from"./index-J0iiHjMT.js";import{M as Ut,$ as _e,D as Vt,e as m,O as qe}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";import{g as Ht}from"./ImageMaterial.glsl-TdPtjVc_.js";import{u as kt,r as Dt}from"./LineVisualElement-4BP10o6v.js";import{a as Wt}from"./Object3DVisualElement-TMb7y_wl.js";const jt=j(0,0,0,.04);function Gt({accentColor:e}){return ke(e,.5)}function Ft({accentColor:e}){return ke(e,.7)}const Er=Je("mac")?"Meta":"Control",Cr="Shift",Bt=2,zt=1.15,qt=1.15,Pr=2500,vr=.02,Xt=Math.cos(Q(45)),ye=Math.cos(Q(5)),Mr=.95,Rr=.3,Sr=2,Yt=1,Zt=3,Xe=11,ge=22.5,J=40,Le=48,Jt=2.25,Qt=4,Ne=1,Kt=.3,er=6,tr=4,Ue=1600,rr=.4;function Ye(e){const t=new Qe,{vertex:a,fragment:s,attributes:n,varyings:i}=t;return Ke(a,e),n.add(K.POSITION,"vec3"),n.add(K.UV0,"vec2"),i.add("vUV","vec2"),a.code.add(we`void main(void) { +vUV = uv0; +gl_Position = proj * view * vec4(position, 1.0); +}`),s.uniforms.add(new Ie("backgroundColor",r=>r.backgroundColor),new Ie("gridColor",r=>r.gridColor),new et("gridWidth",r=>r.gridWidth)),s.code.add(we`void main() { +const float LINE_WIDTH = 1.0; +vec2 uvScaled = vUV * gridWidth; +vec2 gridUV = (fract(uvScaled + 0.5) - 0.5) / (LINE_WIDTH * fwidth(uvScaled)); +vec2 grid = (1.0 - step(0.5, gridUV)) * step(-0.5, gridUV); +grid.x *= step(0.5, uvScaled.x) * step(uvScaled.x, gridWidth - 0.5); +grid.y *= step(0.5, uvScaled.y) * step(uvScaled.y, gridWidth - 0.5); +float gridFade = max(grid.x, grid.y); +float gridAlpha = gridColor.a * gridFade; +fragColor = +vec4(backgroundColor.rgb * backgroundColor.a, backgroundColor.a) * (1.0 - gridAlpha) + +vec4(gridColor.rgb, 1.0) * gridAlpha; +}`),t}const sr=Object.freeze(Object.defineProperty({__proto__:null,build:Ye},Symbol.toStringTag,{value:"Module"}));class nr extends lt{constructor(){super(...arguments),this.backgroundColor=j(1,0,0,.5),this.gridColor=j(0,1,0,.5),this.gridWidth=4}}class ie extends st{initializeProgram(t){return new nt(t.rctx,ie.shader.get().build(this.configuration),it)}initializePipeline(){return at({blending:ot(q.ONE,q.ONE,q.ONE_MINUS_SRC_ALPHA,q.ONE_MINUS_SRC_ALPHA),depthTest:{func:ct.LESS},colorWrite:dt})}}ie.shader=new tt(sr,()=>rt(()=>Promise.resolve().then(()=>$r),void 0));let ir=class extends ut{constructor(t){super(t,new or),this._configuration=new gt}createBufferWriter(){return new ht(pt)}produces(t,a){return a===ft.Color&&t===bt.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL}createGLMaterial(t){return new ar(t)}getConfiguration(){return this._configuration}};class ar extends mt{constructor(t){super(t),this.ensureTechnique(ie,null)}beginSlot(){return this.technique}}class or extends nr{constructor(){super(...arguments),this.renderOccluded=$.Occlude,this.isDecoration=!1}}class cr extends Wt{constructor(t){super(t),this._material=null,this._renderOccluded=$.OccludeAndTransparent,this._gridWidth=1,this._gridColor=j(1,0,0,1),this._backgroundColor=j(1,0,0,1),this.applyProperties(t)}get renderOccluded(){return this._renderOccluded}set renderOccluded(t){t!==this._renderOccluded&&(this._renderOccluded=t,this._updateMaterial())}get gridWidth(){return this._gridWidth}set gridWidth(t){this._gridWidth!==t&&(this._gridWidth=t,this._updateMaterial())}get gridColor(){return this._gridColor}set gridColor(t){Ae(this._gridColor,t),this._updateMaterial()}get backgroundColor(){return this._backgroundColor}set backgroundColor(t){Ae(this._backgroundColor,t),this._updateMaterial()}createExternalResources(){this._material=new ir(this._materialParameters)}destroyExternalResources(){this._material=null}forEachExternalMaterial(t){this._material!=null&&t(this._material)}createGeometries(t){if(this._material!=null){const a=_t(this._material);t.addGeometry(a)}}get _materialParameters(){return{backgroundColor:this._backgroundColor,gridWidth:this._gridWidth,gridColor:this._gridColor,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateMaterial(){this._material!=null&&this._material.setParameters(this._materialParameters)}}function yr(e,t,a,s,n,i,r,o){return dr(t,r.worldUpAtPosition(e,l.get()),n,i,o.basis1,o.basis2),p(o.basis1,o.basis1,a),p(o.basis2,o.basis2,s),M(o.origin,e),je(o.basis2,o.basis1,o.origin,o.plane),o}function dr(e,t,a,s,n,i){const r=V(e,t),o=l.get(),u=l.get();switch(s===P.HORIZONTAL_OR_VERTICAL?Math.abs(r)>Xt?P.HORIZONTAL:P.VERTICAL:s){case P.VERTICAL:{const c=Math.abs(r)<=ye?e:a.viewUp;E(o,c,t),M(u,t);break}case P.HORIZONTAL:E(o,a.viewUp,t),E(u,t,o);break;case P.TILTED:{const c=Math.abs(r)<=ye?t:a.viewUp;E(o,c,e),E(u,e,o);break}}const d=E(l.get(),o,u);V(d,a.viewForward)>0&&p(u,u,-1),S(n,o),S(i,u)}function lr(e,t,a){const s=t.worldUpAtPosition(e.origin,l.get()),n=e.basis1,i=Oe(e,s),r=Math.round(i/H)*H;return ue(e,r-i,n,a)}function Lr(e,t,a,s,n,i){const r=M(l.get(),n.origin);b(r,r,p(l.get(),n.basis1,e.direction[0]<0?1:-1)),b(r,r,p(l.get(),n.basis2,e.direction[1]<0?1:-1));const o=R(n.basis1),u=R(n.basis2),d=w(l.get(),a,r),c=w(l.get(),t,r);let g=0,h=0;if(Te(e)){const ae=he(n),k=he(i);g=o-.5*e.direction[0]*V(n.basis1,c)/o,h=u-.5*e.direction[1]*V(n.basis2,c)/u;const B=k/ae;g*=B,h*=B}const f=g+.5*e.direction[0]*V(n.basis1,d)/o,O=h+.5*e.direction[1]*V(n.basis2,d)/u,N=p(l.get(),n.basis1,f/o),x=p(l.get(),n.basis2,O/u);(f<=0||Ve(i.origin,N,s)<=Ue)&&M(N,i.basis1),(O<=0||Ve(i.origin,x,s)<=Ue)&&M(x,i.basis2);const T=M(l.get(),r);return b(T,T,p(l.get(),N,e.direction[0]<0?-1:1)),b(T,T,p(l.get(),x,e.direction[1]<0?-1:1)),Tt(T,N,x,i)}function Nr(e,t){return rr*Math.min(t.width,t.height)*t.computeRenderPixelSizeAt(e)}function Ur(e,t,a,s){const n=E(l.get(),t,a);return E(n,n,t),De(e,n,s)}function Vr(e,t){return Ut(e.basis1,e.basis2,e.origin,t)}function Hr(e,t,a,s){const n=t.worldUpAtPosition(e.origin,l.get()),i=l.get();switch(a){case re.HEADING:M(i,n);break;case re.TILT:M(i,e.basis1)}return De(e.origin,i,s)}function kr(e,t,a,s){const n=$e(a,I.NEGATIVE_X),i=F.get();Ot(i,t,n.edge*Math.PI/2);const r=S(l.get(),n.basis);let o=p(l.get(),r,n.direction*s.computeScreenPixelSizeAt(n.position)*J);b(o,o,n.position);const u=s.projectToRenderScreen(o,le(l.get())),d=ur(s,u);wt(s,u,Z),S(Z.direction,Z.direction);const c=l.get();!d&&It(a,Z,c)&&(o=c),i[12]=0,i[13]=0,i[14]=0,e.modelTransform=i,e.renderLocation=At(o),d?e.state|=se:e.state&=~se}function ur(e,t){const[a,s,n,i]=e.viewport,r=Math.min(n,i)/16;let o=!0;return t[0]a+n-r&&(t[0]=a+n-r,o=!1),t[1]s+i-r&&(t[1]=s+i-r,o=!1),o}function Dr(e,t,a,s){const n=R(s.basis1),i=R(s.basis2),r=Ze(s),o=he(s),u=ee(l.get(),0,0,0);b(u,p(l.get(),s.basis1,t.direction[0]),p(l.get(),s.basis2,t.direction[1])),b(u,s.origin,u);let d=0,c=1;if(Te(t))t.direction[0]===1&&t.direction[1]===-1?d=H:t.direction[0]===1&&t.direction[1]===1?d=Math.PI:t.direction[0]===-1&&t.direction[1]===1&&(d=3*Math.PI/2),c=o;else{const h=t.direction[0]!==0?1:2;d=h===1?H:0,c=(h===1?i:n)-r}const g=fe(F.get(),d);We(g,g,ee(l.get(),c,c,c)),G(g,a,g),g[12]=0,g[13]=0,g[14]=0,e.modelTransform=g,e.renderLocation=u}function Wr(e,t,a,s){const n=s.worldUpAtPosition(a.origin,l.get()),i=$e(a,I.POSITIVE_X),r=fe(F.get(),i.edge*Math.PI/2);Ge(r,r,-Oe(a,n)),G(r,t,r),r[12]=0,r[13]=0,r[14]=0,e.modelTransform=r,e.renderLocation=i.position}function jr(e,t,a){const s=$e(a,I.POSITIVE_Y),n=fe(F.get(),s.edge*Math.PI/2);Ge(n,n,H),G(n,t,n),n[12]=0,n[13]=0,n[14]=0,e.modelTransform=n,e.renderLocation=s.position}var I;function $e(e,t){switch(t){case I.POSITIVE_X:return{basis:e.basis1,direction:1,position:b(l.get(),e.origin,e.basis1),edge:t};case I.POSITIVE_Y:return{basis:e.basis2,direction:1,position:b(l.get(),e.origin,e.basis2),edge:t};case I.NEGATIVE_X:return{basis:e.basis1,direction:-1,position:w(l.get(),e.origin,e.basis1),edge:t};case I.NEGATIVE_Y:return{basis:e.basis2,direction:-1,position:w(l.get(),e.origin,e.basis2),edge:t}}}function Ve(e,t,a){const s=a.projectToRenderScreen(b(l.get(),e,t),le(l.get())),n=a.projectToRenderScreen(w(l.get(),e,t),le(l.get()));return Et(w(s,s,n))}function Ze(e){const t=R(e.basis1),a=R(e.basis2);return Kt*Math.min(t,a)}function he(e){return Ze(e)}function Te(e){return e.direction[0]!==0&&e.direction[1]!==0}function Gr(e){const t=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0],[-1,-1,0]];return new kt({view:e,attached:!1,color:Ft(e.effectiveTheme),width:Yt,renderOccluded:$.OccludeAndTransparent,geometry:[t],isDecoration:!0})}function Fr(e){return new cr({view:e,attached:!1,backgroundColor:jt,gridColor:Gt(e.effectiveTheme),gridWidth:4,renderOccluded:$.OccludeAndTransparent,isDecoration:!0})}function Br(e,t,a,s=new vt){if(e==null)return null;const{renderCoordsHelper:n}=t,i=n.fromRenderCoords(e.origin,t.spatialReference);if(i==null)return null;const r=Ct(i,a);if(r==null)return null;s.position=r;const o=2*R(e.basis1),u=2*R(e.basis2),d=Fe.renderUnitScaleFactor(t.spatialReference,a);s.width=o*d,s.height=u*d;const c=n.worldUpAtPosition(e.origin,l.get());return s.tilt=Pt(Oe(e,c)),s.heading=n.headingAtPosition(e.origin,e.basis1)-90,s}function Oe(e,t){return Mt(t,e.basis2,e.basis1)+H}function gr(e,t,a,s,n,i,r=Be()){return i.toRenderCoords(e,r.origin)?(i.worldBasisAtPosition(r.origin,Ee.X,r.basis1),i.worldBasisAtPosition(r.origin,Ee.Y,r.basis2),je(r.basis2,r.basis1,r.origin,r.plane),ue(r,-Q(t),Rt(r),r),ue(r,Q(a),r.basis1,r),p(r.basis1,r.basis1,s/2),p(r.basis2,r.basis2,n/2),St(r),r):(xt.getLogger("esri.views.3d.analysis.Slice.sliceToolUtils").error(`Failed to project slice plane position, projection from ${e.spatialReference.wkid} is not supported`),null)}function zr(e,t){if((e==null?void 0:e.position)==null)return null;const a=Dt(e.position,t.spatialReference,t.elevationProvider);if(a==null)return null;const s=Fe.renderUnitScaleFactor(e.position.spatialReference,t.spatialReference),n=e.width*s,i=e.height*s;return{position:a,heading:e.heading,tilt:e.tilt,renderWidth:n,renderHeight:i}}function qr(e,t,a,s=Be()){if(e==null)return null;const n=gr(e.position,e.heading,e.tilt,e.renderWidth,e.renderHeight,t.renderCoordsHelper,s);return a.tiltEnabled||n==null||lr(n,t.renderCoordsHelper,n),n}(function(e){e[e.POSITIVE_X=0]="POSITIVE_X",e[e.POSITIVE_Y=1]="POSITIVE_Y",e[e.NEGATIVE_X=2]="NEGATIVE_X",e[e.NEGATIVE_Y=3]="NEGATIVE_Y"})(I||(I={}));const A=ne.Custom1;var re,P;(function(e){e[e.HEADING=1]="HEADING",e[e.TILT=2]="TILT"})(re||(re={})),function(e){e[e.HORIZONTAL_OR_VERTICAL=0]="HORIZONTAL_OR_VERTICAL",e[e.HORIZONTAL=1]="HORIZONTAL",e[e.VERTICAL=2]="VERTICAL",e[e.TILTED=3]="TILTED"}(P||(P={}));const se=ne.Custom2,Z=$t(),H=Math.PI/2,de=ne.Custom1,hr=ne.Custom2;function Xr(e){return(e.type==="building-scene-3d"?e:null)!=null}class Yr extends _e{constructor(t,a){const s=Te(a),n=s?Qt:Ne,i=n*Bt,r=Ne,o={renderOccluded:$.OccludeAndTransparent,isDecoration:!0},u=new W({...o,width:n}),d=new W({...o,width:i}),c=new W({...o,width:r});super({view:t,...Vt,...pr({isCorner:s,unfocusedMaterial:u,focusedMaterial:d,outlineMaterial:c})}),this._themeHandle=be(()=>t.effectiveTheme.accentColor,g=>{const h=C.toUnitRGBA(g);u.setParameters({color:h}),d.setParameters({color:h}),c.setParameters({color:h})},me)}destroy(){this._themeHandle.remove(),super.destroy()}}function pr({isCorner:e,unfocusedMaterial:t,focusedMaterial:a,outlineMaterial:s}){const n=e?[v(1,0,0),v(0,0,0),v(0,1,0)]:[v(1,0,0),v(-1,0,0)];return{renderObjects:[new m(L(t,n),_.Unfocused|de),new m(L(a,n),_.Focused|de),new m(L(s,n),hr)],collisionType:{type:"line",paths:[n]},radius:e?er:tr,state:de}}class Zr extends _e{constructor(t,a){const s=new Ht({transparent:!0,writeDepth:!1,renderOccluded:$.Opaque,isDecoration:!0}),n=qe.calloutWidth,i=new W({width:n,renderOccluded:$.OccludeAndTransparent,isDecoration:!0});super({view:t,...fr({imageMaterial:s,calloutMaterial:i})}),this._currentTexture=null,this._themeHandle=be(()=>t.effectiveTheme.accentColor,r=>{const o=yt(r,.5),u=ze(r),d=this._currentTexture,c=a(o,u);s.setParameters({textureId:c.texture.id}),i.setParameters({color:C.toUnitRGBA(r)}),this._currentTexture=c,d==null||d.release()},me)}destroy(){var t;this._themeHandle.remove(),(t=this._currentTexture)==null||t.release(),super.destroy()}}function fr({imageMaterial:e,calloutMaterial:t}){const{focusMultiplier:a,calloutLength:s,discRadius:n}=qe,i=n*a,r=(c,g)=>{const h=[0,1,2,2,3,0];return new Lt(g,[[K.POSITION,new Ce([s-c,-c,0,s+c,-c,0,s+c,c,0,s-c,c,0],h,3,!0)],[K.UV0,new Ce([0,0,1,0,1,1,0,1],h,2,!0)]])},o=L(t,[[0,0,0],[s-n,0,0]]),u=L(t,[[0,0,0],[s-i,0,0]]),d=A;return{autoScaleRenderObjects:!1,collisionPriority:1,collisionType:{type:"disc",direction:[0,0,1],offset:[s,0,0]},focusMultiplier:a,radius:n,renderObjects:[new m(r(n,e),_.Unfocused|d),new m(o,_.Unfocused|d),new m(r(i,e),_.Focused|d),new m(u,_.Focused|d)],state:d}}var pe;(function(e){e[e.CENTER_ON_CALLOUT=0]="CENTER_ON_CALLOUT",e[e.CENTER_ON_ARROW=1]="CENTER_ON_ARROW"})(pe||(pe={}));class Jr extends _e{constructor(t,a){const s=new W({width:1,renderOccluded:$.OccludeAndTransparent,isDecoration:!0}),n=new X({cullFace:Y.Back,renderOccluded:$.Opaque,isDecoration:!0}),i=new X({cullFace:Y.Back,renderOccluded:$.Opaque,isDecoration:!0}),r=new X({cullFace:Y.Back,renderOccluded:$.Opaque,isDecoration:!0}),o=new X({writeDepth:!1,cullFace:Y.Front,renderOccluded:$.Transparent,isDecoration:!0});super({view:t,...br({offsetMode:a,tubeMaterial:n,tipMaterial:i,capMaterial:r,outlineMaterial:o,calloutMaterial:s})}),this._themeHandle=be(()=>t.effectiveTheme.accentColor,u=>{const d=ze(u),c=C.toUnitRGBA(u),g=C.toUnitRGBA(d),h=C.toUnitRGBA(C.blendColors(d,u,.4)),f=C.toUnitRGBA(C.blendColors(d,u,.14));s.setParameters({color:c}),n.setParameters({color:f}),i.setParameters({color:g}),r.setParameters({color:h}),o.setParameters({color:c})},me)}destroy(){this._themeHandle.remove(),super.destroy()}}function br({offsetMode:e,tubeMaterial:t,tipMaterial:a,capMaterial:s,outlineMaterial:n,calloutMaterial:i}){const r=e===pe.CENTER_ON_CALLOUT?J:0,o=[v(r,0,-Le/2),v(r,0,Le/2)],u=_r(o,!0),d=He({vertices:o,padding:0,materials:{tube:t,tip:a,cap:s}}),c=He({vertices:o,padding:Jt,materials:{tube:n,tip:n,cap:n}}),g=L(i,[[r,0,0],[r-J,0,0]]),h=L(i,[[r,0,0],[r-J,0,0]]);return{renderObjects:[...d.normal.map(f=>new m(f,_.Unfocused|A)),...c.normal.map(f=>new m(f,_.Unfocused|A)),new m(g,_.Unfocused|A|se),...d.focused.map(f=>new m(f,_.Focused|A)),...c.focused.map(f=>new m(f,_.Focused|A)),new m(h,_.Focused|A|se)],autoScaleRenderObjects:!1,collisionType:{type:"line",paths:[u]},collisionPriority:1,radius:Xe,state:A}}function He({vertices:e,padding:t,materials:a}){const s=n=>{const i=e.slice(0),r=w(l.get(),i[0],i[1]);S(r,r);const o=w(l.get(),i[i.length-1],i[i.length-2]);if(S(o,o),t>0){const D=p(te(),o,-t);i[i.length-1]=b(D,D,i[i.length-1]);const U=p(te(),r,-t);i[0]=b(U,U,i[0])}const u=n?qt:1,d=ge*u,c=Xe*u,g=Pe(F.get());if(t>0){const D=d/4,U=ee(l.get(),0,D,0),z=1+t/D;ve(g,g,U),We(g,g,ee(l.get(),z,z,z)),ve(g,g,p(U,U,-1/z))}const h=Pe(ce()),f=v(0,1,0),O=Me(ce(),Re(Se.get(),f,o));O[12]=i[i.length-1][0],O[13]=i[i.length-1][1],O[14]=i[i.length-1][2],G(O,O,g);const N=a.tube,x=mr(Zt*(n?zt:1)+t,i,N);x.transformation=h;const T=[x],ae=a.tip,k=xe(ae,d,c,24,!1,!1,!0);k.transformation=O,T.push(k);const B=a.cap,oe=xe(B,d,c,24,!1,!0,!1);oe.transformation=O,T.push(oe);const y=Me(ce(),Re(Se.get(),f,r));return y[12]=i[0][0],y[13]=i[0][1],y[14]=i[0][2],G(y,y,g),T.push(k.instantiate({transformation:y})),T.push(oe.instantiate({transformation:y})),T};return{normal:s(!1),focused:s(!0)}}function mr(e,t,a){const s=[];for(let i=0;i<12;i++){const r=i/12*2*Math.PI;s.push([Math.cos(r)*e,Math.sin(r)*e])}return Nt(a,s,t,[],[],!1)}function _r(e,t){const a=w(te(),e[e.length-1],e[e.length-2]);if(S(a,a),p(a,a,ge),b(a,a,e[e.length-1]),t){const s=w(te(),e[0],e[1]);return S(s,s),p(s,s,ge),b(s,s,e[0]),[s,...e,a]}return[...e,a]}const $r=Object.freeze(Object.defineProperty({__proto__:null,build:Ye},Symbol.toStringTag,{value:"Module"}));export{Fr as A,he as B,re as C,hr as D,Gr as E,pe as H,Jr as I,Sr as M,de as N,zr as P,Xr as U,A as V,P as _,Yr as a,yr as b,Hr as c,Vr as d,Wr as e,jr as f,Zr as g,Dr as h,jt as i,Br as j,Ur as k,kr as l,Pr as m,Ft as n,Lr as o,Rr as p,Mr as q,Cr as r,Nr as s,Er as t,vr as u,qr as v,Gt as w,Yt as x,se as y,Te as z}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SnappingContext-6K6JmvvY.js b/dist/assets/SnappingContext-6K6JmvvY.js new file mode 100644 index 0000000..15a28bb --- /dev/null +++ b/dist/assets/SnappingContext-6K6JmvvY.js @@ -0,0 +1 @@ +import{hF as o,hG as l,hH as u,hI as h,fv as p}from"./index-J0iiHjMT.js";import{n as f}from"./PointSnappingHint-ULetRXiW.js";class v{draw(e,i){const n=this._getUniqueHints(e),r=this.sortUniqueHints(n),s=[];for(const t of r)t instanceof o&&s.push(this.visualizeIntersectionPoint(t,i)),t instanceof l&&s.push(this.visualizeLine(t,i)),t instanceof u&&s.push(this.visualizeParallelSign(t,i)),t instanceof h&&s.push(this.visualizeRightAngleQuad(t,i)),t instanceof f&&s.push(this.visualizePoint(t,i));return p(s)}sortUniqueHints(e){return e}_getUniqueHints(e){const i=[];for(const n of e){let r=!0;for(const s of i)if(n.equals(s)){r=!1;break}r&&i.push(n)}return i}}class H{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}}export{H as e,v as r}; diff --git a/dist/assets/SnappingDragPipelineStep-THHIXt-p.js b/dist/assets/SnappingDragPipelineStep-THHIXt-p.js new file mode 100644 index 0000000..9eba3d5 --- /dev/null +++ b/dist/assets/SnappingDragPipelineStep-THHIXt-p.js @@ -0,0 +1 @@ +import{am as G,d as A,ai as L,aj as M,an as N,a as D,ak as j,ao as q,ah as B}from"./index-J0iiHjMT.js";import{r as J}from"./dehydratedFeatureComparison-hdPq-zad.js";import{U as K}from"./InteractiveToolBase-WDic4GPF.js";import{e as Q}from"./SnappingContext-6K6JmvvY.js";function tn({predicate:n=()=>!0,snappingManager:e,snappingContext:o,updatingHandles:a,useZ:t=!0}){const i=new K;if(e==null)return{snappingStep:[z,i],cancelSnapping:z};let p,u=null,l=null,c=null;const f=()=>{u=D(u),e.doneSnapping(),l==null||l.frameTask.remove(),l=null,p=j(p),c=null},m=R(e,t,i);let d=null,s=null,Z=null;return{snappingStep:[r=>{if(!n(r))return r;const{action:P}=r;if(P==="start"){const{info:x}=r,S=V(e.view);if(l=W(o,r,S),l.context.selfSnappingZ=null,!t&&x!=null){const g=Y(o.coordinateHelper,x.handle.component);g!=null&&(l.context.selfSnappingZ={value:g,elevationInfo:o.elevationInfo??G})}}if(l!=null){const{context:x,originalScenePos:S,originalPos:g}=l,{mapEnd:k,mapStart:T,scenePoints:E}=r,v=U(g,y(k,T)),w=y(T,g),H={...r,action:"update"},O=l.context,h=X(S,E),I=e.update({point:v,scenePoint:h,context:x});if(Z=I,C(k,I,w,t),d=v,s=h,P!=="end"){const{frameTask:b}=l;u==null&&(u=new AbortController),c=F=>{a.addPromise(q(m({frameTask:b,event:H,context:O,point:v,scenePoint:h,delta:w,getLastState:()=>({point:d,scenePoint:s,updatePoint:F.forceUpdate?null:Z})},u.signal)))},c({forceUpdate:!1}),p==null&&(p=A(()=>e.options.effectiveEnabled,()=>c==null?void 0:c({forceUpdate:!0})))}}return P==="end"&&f(),r},i],cancelSnapping:r=>(f(),r)}}function R(n,e,o){return B(async({frameTask:a,point:t,scenePoint:i,context:p,event:u,delta:l,getLastState:c},f)=>{const m=await a.schedule(()=>n.snap({point:t,scenePoint:i,context:p,signal:f}),f);if(m.valid){let d=await a.schedule(()=>m.apply(),f);const s=c();s.point!=null&&t!==s.point&&(d=n.update({point:s.point,scenePoint:s.scenePoint,context:p})),s.updatePoint!=null&&J(d,s.updatePoint)||(C(u.mapEnd,d,l,e),o.execute(u))}})}function V(n){return n.type==="3d"?n.resourceController.scheduler.registerTask(L.SNAPPING):M}function W(n,e,o){return{context:new Q({editGeometryOperations:n.editGeometryOperations,elevationInfo:n.elevationInfo,pointer:n.pointer,vertexHandle:e.info!=null?e.info.handle:null,excludeFeature:n.excludeFeature,feature:n.feature,visualizer:n.visualizer}),originalPos:e.snapOrigin!=null?n.coordinateHelper.vectorToDehydratedPoint(e.snapOrigin):e.mapStart,originalScenePos:e.scenePoints!=null?e.scenePoints.sceneStart:null,frameTask:o}}function U(n,[e,o,a]){const t=N(n);return t.x+=e,t.y+=o,t.hasZ&&(t.z+=a),t}function X(n,e){return n==null||e==null?null:U(n,y(e.sceneEnd,e.sceneStart))}function y(n,e){const o=n.hasZ&&e.hasZ?n.z-e.z:0;return[n.x-e.x,n.y-e.y,o]}function C(n,e,[o,a,t],i){n.x=e.x+o,n.y=e.y+a,i&&n.hasZ&&e.hasZ&&(n.z=e.z+t)}function Y(n,e){if(!n.hasZ())return null;const o=e.vertices;let a=null;for(const t of o){const i=n.getZ(t.pos);if(a!=null&&i!=null&&Math.abs(i-a)>1e-6)return null;a==null&&(a=i)}return a}function z(n){return n}export{tn as f}; diff --git a/dist/assets/SnappingOperation-2U48wt1k.js b/dist/assets/SnappingOperation-2U48wt1k.js new file mode 100644 index 0000000..1b6c23f --- /dev/null +++ b/dist/assets/SnappingOperation-2U48wt1k.js @@ -0,0 +1 @@ +import{e as r,p as c,ah as u,ai as _,aj as P,a as h,ak as d,y as l,c as g}from"./index-J0iiHjMT.js";let a=class extends c{constructor(t){super(t),this.constrainResult=s=>s,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=u(async(s,n,o,i)=>{const e=this._frameTask;if(e==null)return;const p=await e.schedule(()=>n.snap({...s,context:o,signal:i}),i);p.valid&&await e.schedule(()=>{this.stagedPoint=p.apply(),s!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=n.update({...this._snapPoints,context:o}))},i)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(t){this._stagedPoint=this.constrainResult(t)}initialize(){var s,n;const t=this.view.type==="3d"?(n=(s=this.view)==null?void 0:s.resourceController)==null?void 0:n.scheduler:null;this._frameTask=t!=null?t.registerTask(_.SNAPPING):P}destroy(){this._abortController=h(this._abortController),this._frameTask=d(this._frameTask)}update(t,s,n){this._snapPoints=t;const{point:o,scenePoint:i}=t,e=s.update({point:o,scenePoint:i,context:n});return this.stagedPoint=e,e}async snap(t,s,n){const{point:o,scenePoint:i}=t;return this.stagedPoint=s.update({point:o,scenePoint:i,context:n}),this._snapPoints=t,this._abortController==null&&(this._abortController=new AbortController),this._snap(t,s,n,this._abortController.signal)}async resnap(t,s){this._snapPoints!=null&&await this.snap(this._snapPoints,t,s)}abort(){this._abortController=h(this._abortController),this._snapPoints=null}};r([l({constructOnly:!0})],a.prototype,"view",void 0),r([l()],a.prototype,"stagedPoint",null),r([l()],a.prototype,"constrainResult",void 0),r([l()],a.prototype,"_stagedPoint",void 0),a=r([g("esri.views.interactive.snapping.SnappingOperation")],a);export{a as p}; diff --git a/dist/assets/SnappingVisualizer2D-NnEm1PvQ.js b/dist/assets/SnappingVisualizer2D-NnEm1PvQ.js new file mode 100644 index 0000000..a4077bd --- /dev/null +++ b/dist/assets/SnappingVisualizer2D-NnEm1PvQ.js @@ -0,0 +1 @@ +import{T as y,N as n,a0 as p,a1 as b,S,a2 as u,a3 as o,a4 as l,a5 as s,a6 as d,a7 as M,J as m,a8 as C,a9 as h,aa as P}from"./index-J0iiHjMT.js";import{r as v}from"./SnappingContext-6K6JmvvY.js";class w extends v{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new y({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new y({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new n({paths:[[e.lineStart,e.lineEnd]],spatialReference:t.spatialReference}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new n({paths:[[e.lineStart,e.lineEnd]],spatialReference:t.spatialReference}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const a=h(),r=h(),c=P();p(a,e.centerVertex,e.previousVertex),p(r,e.nextVertex,e.previousVertex),b(c,a,r);const g=`rightAngleQuad${c[2]<0?45:225}`;return this._visualizeSnappingIndicator(new n({paths:[[e.previousVertex,e.centerVertex,e.nextVertex]],spatialReference:t.spatialReference}),this._getOrCreateSymbol(g,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const a=new S({geometry:e,symbol:t});return this._graphicsLayer.add(a),u(()=>{this._graphicsLayer.remove(a)})}_getOrCreateSymbol(e,t){var r;const a=this._symbolPairingsByType;return((r=a.get(e))==null?void 0:r.color)!==t&&a.set(e,{color:t,symbol:I(e,t)}),a.get(e).symbol}}function I(i,e){const t=[...e.toRgb(),255*e.a];switch(i){case"point":return new m({outline:{width:.5,color:[0,0,0,1]},size:10,color:e});case"intersectionPoint":return new m({outline:new C({width:1.5,color:e}),size:15,color:[0,0,0,0]});case"line":return new o({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:d.Butt,joinStyle:M.Round,miterLimit:10,width:l(s.lineHintWidthTarget),color:t}]}}});case"parallelSign":return new o({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const a=i==="rightAngleQuad45"?45:225;return new o({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:l(s.rightAngleHintSize),rotation:a,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:l(s.rightAngleHintOutlineSize),color:t},{type:"CIMSolidFill",enable:!0,color:[...e.toRgb(),255*e.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}export{w as S}; diff --git a/dist/assets/SnappingVisualizer3D-KWlqByBu.js b/dist/assets/SnappingVisualizer3D-KWlqByBu.js new file mode 100644 index 0000000..7e34a14 --- /dev/null +++ b/dist/assets/SnappingVisualizer3D-KWlqByBu.js @@ -0,0 +1 @@ +import{aa as O,b1 as k,b2 as g,aq as P,aE as j,aF as K,aU as Q,b4 as J,b5 as X,b6 as H,d as Y,b7 as ee,b8 as T,at as te,hJ as re,a0 as ie,bf as S,aK as V,bg as z,hK as E,hL as ae,hM as v,a9 as C,aR as q,bB as se,hG as F,fw as R,hN as I,hO as B,am as W,hP as oe,a5 as p,hQ as A,hR as $,ab as M,hS as ne,hT as ce,hU as de,bn as le,hV as he}from"./index-J0iiHjMT.js";import{G as ue,V as pe}from"./ExtendedLineVisualElement-YbjiXiBG.js";import{r as me}from"./vec4f32-NvfHy9q7.js";import{t as _e}from"./EngineVisualElement-eZNKTKsI.js";import{x as L}from"./PointVisualElement-bX-_4FqS.js";import{z as ge}from"./RightAngleQuadVisualElement-y_W8r903.js";import{r as fe}from"./SnappingContext-6K6JmvvY.js";let De=class extends _e{constructor(e){super(e),this._location=O(),this._direction=k(1,0,0),this._width=1,this._offset=1,this._length=18,this._color=me(1,0,1,1),this._renderOccluded=g.OccludeAndTransparent,this.applyProperties(e)}createObject3DResourceFactory(e){return{view:e,createResources:t=>this._createObject3DResources(t),destroyResources:t=>this._destroyObject3DResources(t),recreateGeometry:(t,r)=>this._recreateObject3DGeometry(t,r),cameraChanged:()=>this._updateGeometry()}}createDrapedResourceFactory(e){return{view:e,createResources:()=>this._createDrapedResources(),destroyResources:t=>this._destroyDrapedResources(t),recreateGeometry:t=>this._recreateDrapedGeometry(t)}}get location(){return this._location}set location(e){P(this._location,e)||(j(this._location,e),this._updateGeometry())}get direction(){return this._direction}set direction(e){P(this._direction,e)||(j(this._direction,e),this._updateGeometry())}setDirectionFromPoints(e,t){K(this._direction,Q(this._direction,t,e)),this._updateGeometry()}get width(){return this._width}set width(e){e!==this._width&&(this._width=e,this._updateMaterial())}get offset(){return this._offset}set offset(e){e!==this._offset&&(this._offset=e,this._updateGeometry())}get length(){return this._length}set length(e){e!==this._length&&(this._length=e,this._updateGeometry())}get color(){return this._color}set color(e){J(e,this._color)||(X(this._color,e),this._updateMaterial())}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial())}_createObject3DResources(e){const t=new H(this.materialParameters),r=new Array;return this._createObject3DGeometry(t,e,r),{material:t,geometries:r,forEach:a=>{a(t),r.forEach(a)}}}_destroyObject3DResources(e){e.geometries.length=0}_recreateObject3DGeometry(e,t){e.geometries.length=0,this._createObject3DGeometry(e.material,t,e.geometries)}_createObject3DGeometry(e,t,r){const[a,s]=this._createGeometries(e);t.addGeometry(a),t.addGeometry(s),r.push(a),r.push(s),this._updateVerticesObject3D(t)}_createDrapedResources(){const e=new H(this.materialParameters),t=Y(()=>this.view.state.contentPixelRatio,()=>{this.drapedResources.recreateGeometry()});return{material:e,geometries:this._createDrapedGeometry(e),pixelRatioHandle:t}}_destroyDrapedResources(e){e.pixelRatioHandle.remove(),e.geometries=[]}_recreateDrapedGeometry(e){e.geometries=this._createDrapedGeometry(e.material)}_createDrapedGeometry(e){const t=this._createGeometries(e);return this._updateVerticesDraped(t),t.map(r=>new ee(r))}_createGeometries(e){return[T(e,[O(),O()]),T(e,[O(),O()])]}_updateMaterial(){var t,r;const{materialParameters:e}=this;(t=this.object3dResources.resources)==null||t.material.setParameters(e),(r=this.drapedResources.resources)==null||r.material.setParameters(e)}get materialParameters(){return{width:this._width,color:this._color,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateGeometry(){if(this.isDraped)this.drapedResources.recreateGeometry();else{const e=this.object3dResources.object;e&&this._updateVerticesObject3D(e)}}_updateVerticesObject3D(e){const t=this.view.state.camera;t.projectToScreen(this.location,x),te(m,this.location,this.direction),t.projectToScreen(m,b),re(b,ie(b,b,x)),this._updateVertexAttributesObject3D(t,e,0,x,b,1),this._updateVertexAttributesObject3D(t,e,1,x,b,-1)}_updateVertexAttributesObject3D(e,t,r,a,s,i){var d;const n=t.geometries[r],o=(d=n.getMutableAttribute(S.POSITION))==null?void 0:d.data;if(!o)return;const{start:l,end:h}=this._computeStartEnd(s,a,i,this.offset,this.width,this.length);e.unprojectFromScreen(V(l),m),o[0]=m[0],o[1]=m[1],o[2]=m[2],e.unprojectFromScreen(V(h),m),o[3]=m[0],o[4]=m[1],o[5]=m[2],t.geometryVertexAttributeUpdated(n,S.POSITION)}_updateVerticesDraped(e){const{view:{basemapTerrain:{overlayManager:t},state:{contentPixelRatio:r}}}=this,{location:a,width:s,length:i,offset:n}=this,o=Oe;o.spatialReference=t.renderer.spatialReference,o.x=a[0],o.y=a[1];const l=this.view.overlayPixelSizeInMapUnits(o)*r,h=s*l,d=i*l,_=n*l;this._updateVertexAttributesDraped(e[0],h,d,_,-1),this._updateVertexAttributesDraped(e[1],h,d,_,1)}_updateVertexAttributesDraped(e,t,r,a,s){var d;const i=(d=e.getMutableAttribute(S.POSITION))==null?void 0:d.data;if(!i)return;const{location:n,direction:o}=this,{start:l,end:h}=this._computeStartEnd(o,n,s,a,t,r);i[0]=l[0],i[1]=l[1],i[2]=z,i[3]=h[0],i[4]=h[1],i[5]=z,e.invalidateBoundingInfo()}_computeStartEnd(e,t,r,a,s,i){const n=E(N,ae(N,e[1]*r,e[0]*-r),a+s/2),o=v(w,v(w,v(w,t,E(w,e,i/2)),n),n);return{start:o,end:v(U,o,E(U,e,-i))}}};const m=O(),N=C(),w=C(),U=C(),x=q(),b=q(),Oe=se(0,0,void 0,null);class Ee extends fe{sortUniqueHints(e){return e.sort((t,r)=>(r instanceof F?r.length:0)-(t instanceof F?t.length:0))}visualizeIntersectionPoint(e,t){const{spatialReference:r,view:a}=t,s=y(t);return R(new L({view:a,primitive:"circle",geometry:I(e.intersectionPoint,r),elevationInfo:e.isDraped?B:W,size:20,outlineSize:2,color:s.intersectionPointColor,outlineColor:s.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,t){const{view:r,spatialReference:a}=t,s=y(t),i=f(e.point,e.domain,t);return R(new L({view:r,primitive:"circle",geometry:I(i,a),elevationInfo:G(e,t),size:20,outlineSize:2,color:s.pointColor,outlineColor:s.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,t){const{view:r,spatialReference:a}=t,s=y(t),i=f(e.lineStart,e.domain,t),n=f(e.lineEnd,e.domain,t);return R(this._createLineSegmentHint(e.type,i,n,a,G(e,t),r,s,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,t){const{view:r,spatialReference:a}=t,s=y(t),{isDraped:i}=e,n=G(e,t),o=f(e.lineStart,e.domain,t),l=f(e.lineEnd,e.domain,t),h=D(o,a,n,r,i),d=D(l,a,n,r,i),_=oe(d,h,d,.5),u=new De({view:r,attached:!1,offset:p.parallelLineHintOffset,length:p.parallelLineHintLength,width:p.parallelLineHintWidth,color:s.parallelSignColor,location:_,renderOccluded:i?g.OccludeAndTransparent:g.Opaque,isDraped:i,renderGroup:A.SnappingHint,isDecoration:!0});return u.setDirectionFromPoints(h,_),u.attached=!0,R(u)}visualizeRightAngleQuad(e,t){const{view:r,spatialReference:a}=t,s=y(t),i=G(e,t),{isDraped:n}=e,o=f(e.previousVertex,e.domain,t),l=f(e.centerVertex,e.domain,t),h=f(e.nextVertex,e.domain,t),d=D(o,a,i,r,n),_=D(l,a,i,r,n),u=D(h,a,i,r,n);return R(new ge({view:r,attached:!0,color:n?s.rightAngleColorDraped:s.rightAngleColor,renderOccluded:n?g.OccludeAndTransparent:g.Transparent,outlineRenderOccluded:n?g.OccludeAndTransparent:g.Opaque,outlineColor:s.rightAngleOutlineColor,outlineSize:p.rightAngleHintOutlineSize,size:p.rightAngleHintSize,isDraped:n,geometry:{previous:d,center:_,next:u},renderGroup:A.SnappingHint,isDecoration:!0}))}_createLineSegmentHint(e,t,r,a,s,i,n,o=!1,l=!0,h=!0){const d=D(t,a,s,i,o),_=D(r,a,s,i,o),u=new ue({view:i,extensionType:pe.FADED,start:d,end:_,isDraped:o,color:n.lineColor,renderOccluded:o?g.OccludeAndTransparent:g.Opaque,renderGroup:A.SnappingHint,isDecoration:!0});switch(e){case $.TARGET:u.width=p.lineHintWidthTarget,u.fadedExtensions={start:0,end:p.lineHintFadedExtensions};break;case $.REFERENCE_EXTENSION:u.width=p.lineHintWidthReference,u.fadedExtensions={start:0,end:0};break;case $.REFERENCE:u.width=p.lineHintWidthReference,u.fadedExtensions={start:l?p.lineHintFadedExtensions:0,end:h?p.lineHintFadedExtensions:0}}return u.attached=!0,u}}function y(c){const{effectiveTheme:e}=c.view,t=M.toUnitRGBA(e.accentColor),r=[0,0,0,0];return{intersectionPointColor:r,intersectionPointOutlineColor:t,pointColor:r,pointOutlineColor:t,lineColor:t,lineOutlineColor:void 0,parallelSignColor:t,rightAngleColor:t,rightAngleColorDraped:M.toUnitRGBA(ne(e.accentColor,.5)),rightAngleOutlineColor:t}}function f(c,e,t){const r=Z(e,t);return r==null?c:ce(c[0],c[1],r)}function G(c,e){return Z(c.domain,e)!=null?e.selfSnappingZ.elevationInfo:c.isDraped?B:W}function Z(c,{selfSnappingZ:e}){return c===de.SELF&&e!=null?e.value:null}function D(c,e,t,r,a,s=O()){if(a){const i=r.basemapTerrain.overlayManager.renderer.spatialReference;le(c,e,s,i)}else he(c,e,t,r,s);return s}export{Ee as O}; diff --git a/dist/assets/SpatialFilter-CXhA7RaJ.js b/dist/assets/SpatialFilter-CXhA7RaJ.js new file mode 100644 index 0000000..c150101 --- /dev/null +++ b/dist/assets/SpatialFilter-CXhA7RaJ.js @@ -0,0 +1 @@ +import{x as T,n as f,t as g,s as m,a as y,r as J}from"./WhereClause-XAMIZ4-B.js";import{D as X,ag as h,ah as P,ai as k,aj as L,ak as x,al as O,am as ee,an as te,ao as ne,ap as ae,aq as F,ar as re,as as se,at as G,au as B,av as H}from"./arcadeUtils-OUqwHs4P.js";import{n as M,m as ie,b as W}from"./TimeOnly-ljWtUK7N.js";import{mA as le,ar as oe,eQ as ue,fx as Z}from"./index-J0iiHjMT.js";import{union as ce,geodesicArea as he,planarArea as de,geodesicLength as pe,planarLength as _e,relate as fe,crosses as ge,touches as me,within as ye,overlaps as Se,contains as we,intersects as Q}from"./geometryEngineAsync-QjQc0riy.js";class E{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){this._databaseTypeMetaData[e]===void 0&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return e==="MUSTBESET"||this._databaseTypeMetaData[e]===void 0?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return this._layerInfo[e]===void 0?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){this._layerInfo[e]!==void 0&&delete this._layerInfo[e]}}E.applicationCache=null;class Te{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}async nextBatchAsArcadeFeatures(e,t){const n=await this.nextBatch(e);return n===null?n:n.map(a=>X.createFromGraphicLikeObject(a.geometry,a.attributes,this._parent,t))}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(a=>this.nextBatch(e),a=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((a,s)=>{this._parent._getSet(this._progress).then(i=>{const l=i._known;let o=l.length-1;if(l[l.length-1]==="GETPAGES"&&(o-=1),this._lastId+e>o&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(c=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(a,s)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)});const u=i._candidates;if(o>=this._lastId+e||u.length===0){for(let c=0;c=l.length)break;n[c]=l[p]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,a([])),void this._parent._getFeatureBatch(n,this._progress).then(c=>{t.hasset=!0,this._parent._mainSetInUse=null,a(c)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(a,s)},c=>{t.hasset=!0,this._parent._mainSetInUse=null,s(c)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,s(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(a=>{const s=a._known;this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(a,s[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):a._candidates.length>0?this._parent._refineSetBlock(a,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},a=>{e.hasset=!0,this._parent._mainSetInUse=null,n(a)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class D{constructor(e,t,n,a){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=a}}function Y(r,e){return d(r==null?void 0:r.parseTree,e,r==null?void 0:r.parameters)}function Ze(r,e,t){return d(r,e,t)}function Qe(r,e,t,n){return T.create(d(r.parseTree,h.Standardised,r.parameters,e,t),n,r.timeZone)}function Ye(r,e,t="AND"){return T.create("(("+Y(r,h.Standardised)+")"+t+"("+Y(e,h.Standardised)+"))",r.fieldsIndex,r.timeZone)}function d(r,e,t,n=null,a=null){let s,i,l,o;switch(r.type){case"interval":return Ee(d(r.value,e,t,n,a),r.qualifier,r.op);case"case-expression":{let u=" CASE ";r.format==="simple"&&(u+=d(r.operand,e,t,n,a));for(let c=0;c":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+d(r.left,e,t,n,a)+" "+r.operator+" "+d(r.right,e,t,n,a)+") ";case"||":return" ("+d(r.left,e,t,n,a)+" "+(e===h.SqlServer?"+":r.operator)+" "+d(r.right,e,t,n,a)+") "}throw new f(g.UnsupportedOperator,{operator:r.operator});case"null":return"null";case"boolean":return r.value===!0?"1":"0";case"string":return"'"+r.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${r.value}'`;case"date":return`date '${r.value}'`;case"time":return`time '${r.value}'`;case"number":return r.value.toString();case"current-time":return Fe(r.mode==="date",e);case"column-reference":return n?n.toLowerCase()===r.column.toLowerCase()?"("+a+")":r.delimited===!0?`"${r.column.split('"').join('""')}"`:r.column:r.column;case"data-type":return r.value;case"function":{const u=d(r.args,e,t,n,a);return Ie(r.name,u,e)}}throw new f(g.UnsupportedSyntax,{node:r.type})}function Ie(r,e,t){switch(r.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase().trim()});return`${r.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:"ceiling"});switch(t){case h.Standardised:case h.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase().trim()});return`${r.toUpperCase().trim()}(${e[0]},${e[1]})`;case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new f(g.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new f(g.InvalidFunctionParameters,{function:"truncate"});return t===h.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new f(g.InvalidFunctionParameters,{function:"char_length"});switch(t){case h.SqlServer:return"LEN("+e[0]+")";case h.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new f(g.InvalidFunctionParameters,{function:r.toLowerCase()});let n=r.toUpperCase().trim()+"(";for(let a=0;a":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new f(g.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return C([S(r,e.left,t,n),S(r,e.right,t,n)]);case"||":return"string";default:throw new f(g.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return"date";case"column-reference":{const c=r[e.column.toLowerCase()];return c===void 0?"":c}case"function":switch(e.name.toLowerCase()){case"cast":switch(((i=(s=e.args)==null?void 0:s.value[1])==null?void 0:i.value.type)??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return((u=(o=(l=e.args)==null?void 0:l.value[1])==null?void 0:o.value)==null?void 0:u.withtimezone)===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(a=S(r,e.args,t,n),a instanceof Array){if(a.length<=0)return"double";a=a[0]}return a;case"sign":return"integer";case"ceiling":case"floor":case"abs":return a=S(r,e.args,t,n),a instanceof Array&&(a=C(a)),a==="integer"||a==="double"?a:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return a=S(r,e.args,t,n),a instanceof Array?a.length>0?a[0]:"":a}return""}throw new f(g.UnsupportedSyntax,{node:e.type})}const V={boolean:1,string:2,integer:3,double:4,date:5};function C(r){if(r){let e="";for(const t of r)t!==""&&(e=e===""||V[e]=e&&e!==-1)return t}return t}function qe(r){switch(r.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function Ve(r,e,t=1e3){switch(r.toLowerCase()){case"distinct":return Ae(e,t);case"avg":case"mean":return A(e);case"min":return Math.min.apply(Math,e);case"sum":return $(e);case"max":return Math.max.apply(Math,e);case"stdev":case"stddev":return Math.sqrt(j(e));case"var":case"variance":return j(e);case"count":return e.length}return 0}async function Re(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.min.apply(Math,n)}async function Ce(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.max.apply(Math,n)}async function Ne(r,e,t){let n="";e&&!De(e)&&(n=be(e,r.fields));const a=await v(r,e,t,!0);if(a.length===0)return null;const s=A(a);return s===null?s:n==="integer"?ve(s):s}async function Pe(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:z(n)}async function ke(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:Math.sqrt(z(n))}async function Le(r,e,t){const n=await v(r,e,t,!0);return n.length===0?null:$(n)}async function xe(r,e){return r.iterator(e).count()}async function v(r,e,t,n=!1){const a=r.iterator(t),s=[],i={ticker:0};let l=await a.next();for(;l!==null;){if(i.ticker++,t.aborted)throw new m(y.Cancelled);i.ticker%100==0&&(i.ticker=0,await new Promise(u=>{setTimeout(u,0)}));const o=e==null?void 0:e.calculateValue(l);o===null?n===!1&&(s[s.length]=o):s[s.length]=o instanceof W||o instanceof M?o.toNumber():o instanceof J?o.toMilliseconds():o,l=await a.next()}return s}async function Oe(r,e,t=1e3,n=null){const a=r.iterator(n),s=[],i={},l={ticker:0};let o=await a.next();for(;o!==null;){if(l.ticker++,n&&n.aborted)throw new m(y.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(p=>{setTimeout(p,0)}));const u=e==null?void 0:e.calculateValue(o);let c=u;if(u instanceof W?c="!!DATEONLY!!-"+u.toString():u instanceof J?c="!!TSOFFSETONLY!!-"+u.toString():u instanceof M?c="!!TIMEONLY!!-"+u.toString():u instanceof Date&&(c="!!DATE!!-"+u.toString()),u!=null&&i[c]===void 0&&(s.push(u),i[c]=1),s.length>=t&&t!==-1)return s;o=await a.next()}return s}class _{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=h.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e!=null&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e!=null&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){var e,t;return((e=this._parent)==null?void 0:e.loaded)===!0?(this._initialiseFeatureSet(),this):(await((t=this._parent)==null?void 0:t.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new oe({wkid:4326}),this.geometryType=ae.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(a=>(a&&a.name.toLowerCase()===e&&(n=a),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=ue.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new m(y.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,a,s){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,a,s)}async _getAggregatePagesDataSourceDefinition(e,t,n,a,s,i,l){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,a,s,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new m(y.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===h.NotEvaluated){if(E.applicationCache!==null){const e=E.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),E.applicationCache!==null&&E.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw E.applicationCache!==null&&E.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:h.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:h.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:h.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return h.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new m(y.NotImplemented)}isTable(){var e;return((e=this._parent)==null?void 0:e.isTable())??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new m(y.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new m(y.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new D([],e,!1,null),a=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const s of e)this._featureFromCache(s)!==void 0&&a.push(this._featureFromCache(s));return a}async _getFeatures(e,t,n,a){return"success"}_getFilteredSet(e,t,n,a,s){throw new m(y.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const a=e._candidates.length;this._refineKnowns(e,t);let s=a-e._candidates.length;if(e._candidates.length===0||s>=t)return e;if(await this._refineIfParentKnown(e,t-s,n),this._checkCancelled(n),this._refineKnowns(e,t-s),s=a-e._candidates.length,s0){const i=t-s,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-s),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}a!==null&&s.push(a);for(let i=s.length-1;i>=0;i--)e._candidates.splice(s[i].start,s[i].end-s[i].start+1)}_refineIfParentKnown(e,t,n){const a=new D([],[],e._ordered,null);return a._candidates=e._candidates.slice(0),this._parent._refineSetBlock(a,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let a=e._lastFetchedIndex;a=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let a=0;a=t)break}return!1}async _expandPagedSet(e,t,n,a,s){if(this._parent===null)throw new m(y.NotImplemented);return this._parent._expandPagedSet(e,t,n,a,s)}async _expandPagedSetFeatureSet(e,t,n,a,s){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(a=1),a===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(a=2),a===0)return"finished";const i=await this._getPage(e,a,s);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){a.length=a.length-1;let s=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)a[a.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],s++;e.pagesDefinition.resultOffset+=s;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&a.push("GETPAGES"),s}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,a){await this._ensureLoaded();let s=await this._stat(e,t,"",null,null,n,a);return s.calculated===!1&&(s=await this._manualStat(e,t,n,a)),s.result}async _manualStat(e,t,n,a){let s=null;switch(e.toLowerCase()){case"count":return s=await xe(this,a),{calculated:!0,result:s};case"distinct":return s=await Oe(this,t,n,a),{calculated:!0,result:s};case"avg":case"mean":return s=await Ne(this,t,a),{calculated:!0,result:s};case"stdev":return s=await ke(this,t,a),{calculated:!0,result:s};case"variance":return s=await Pe(this,t,a),{calculated:!0,result:s};case"sum":return s=await Le(this,t,a),{calculated:!0,result:s};case"min":return s=await Re(this,t,a),{calculated:!0,result:s};case"max":return s=await Ce(this,t,a),{calculated:!0,result:s};default:return{calculated:!0,result:0}}}async _stat(e,t,n,a,s,i,l){const o=await this._parent._stat(e,t,n,a,s,i,l);return o.calculated===!1?s===null&&n===""&&a===null?this._manualStat(e,t,i,l):{calculated:!1}:o}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((a,s)=>{this._unionShapeInBatches(n,t,a,s)})}_unionAllGeom(e){return new Promise((t,n)=>{const a=this.iterator(this._defaultTracker(e)),s=[];this._unionShapeInBatches(s,a,t,n)})}_unionShapeInBatches(e,t,n,a){t.next().then(s=>{try{s!==null&&s.geometry!==null&&e.push(s.geometry),e.length>30||s===null&&e.length>1?ce(e).then(i=>{try{s===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,a))}catch(l){a(l)}},a):s===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,a)}catch(i){a(i)}},a)}iterator(e){return new Te(this,e)}intersection(e,t=!1){return _._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return _._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return _._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",a=null){return _._featuresetFunctions.morphShape.bind(this)(e,t,n,a)}morphShapeAndAttributes(e,t,n="unknown"){return _._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return _._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return _._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return _._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return _._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return _._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return _._featuresetFunctions.relate.bind(this)(e,t)}within(e){return _._featuresetFunctions.within.bind(this)(e)}touches(e){return _._featuresetFunctions.touches.bind(this)(e)}top(e){return _._featuresetFunctions.top.bind(this)(e)}crosses(e){return _._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,a=!0){return _._featuresetFunctions.buffer.bind(this)(e,t,n,a)}filter(e,t=null){return _._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return _._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return _._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return _._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((a,s)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,a,s,0)})}_reduceImpl(e,t,n,a,s,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,a,s,i,l)});e.next().then(o=>{try{if(o===null)s(n);else{const u=t(n,o,a,this);Z(u)?u.then(c=>{this._reduceImpl(e,t,c,a+1,s,i,l)},i):this._reduceImpl(e,t,u,a+1,s,i,l)}}catch(u){i(u)}},i)}catch(o){i(o)}}removeField(e){return _._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return _._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const a=re(e);return this.reduce((s,i)=>i.geometry===null?0:t?he(i.geometry,a).then(l=>s+l):de(i.geometry,a).then(l=>s+l),0,n)}sumLength(e,t=!1,n){const a=se(e);return this.reduce((s,i)=>i.geometry===null?0:t?pe(i.geometry,a).then(l=>s+l):_e(i.geometry,a).then(l=>s+l),0,n)}_substituteVars(e,t){if(t!==null){const n={};for(const a in t)n[a.toLowerCase()]=t[a];e.parameters=n}}async distinct(e,t=1e3,n=null,a){await this.load();const s=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(s,n),this.calculateStatistic("distinct",s,t,this._defaultTracker(a))}async min(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("min",a,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("max",a,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("avg",a,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("sum",a,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("stdev",a,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const a=T.create(e,this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC);return this._substituteVars(a,t),this.calculateStatistic("variance",a,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",this.getFieldsIndex(),this.dateFieldsTimeZoneDefaultUTC),-1,this._defaultTracker(e))}_defaultTracker(e){return e??{aborted:!1}}forEach(e,t){return new Promise((n,a)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,a,0)})}_forEachImpl(e,t,n,a,s,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,a,s,i)},0);e.next().then(l=>{try{if(l===null)a(n);else{const o=t(l);o==null?this._forEachImpl(e,t,n,a,s,i):Z(o)?o.then(()=>{try{this._forEachImpl(e,t,n,a,s,i)}catch(u){s(u)}},s):this._forEachImpl(e,t,n,a,s,i)}}catch(o){s(o)}},s)}catch(l){s(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{var i;const s={geometry:(i=a.geometry)==null?void 0:i.toJSON(),attributes:{}};for(const l in a.attributes)s.attributes[l]=a.attributes[l];return t.featureSet.features.push(s),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,a,s){return this._parent.queryAttachments(e,t,n,a,s)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((s,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const a=this.schema();return a.features=n,a.spatialReference=this.spatialReference.toJSON(),JSON.stringify(a)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return(e==null?void 0:e.featureset)==="keeptype"?this:(e==null?void 0:e.featureset)==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){var s;if((t==null?void 0:t.featureset)==="keeptype")return this;if((t==null?void 0:t.featureset)==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if((t==null?void 0:t.featureset)==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((i,l)=>{const o={geometry:l.geometry?(t==null?void 0:t.keepGeometryType)===!0?l.geometry:l.geometry.toJSON():null,attributes:l.attributes};return o.geometry!==null&&o.geometry.spatialReference&&(t==null?void 0:t.keepGeometryType)!==!0&&delete o.geometry.spatialReference,n.push(o),1},0,e);const a=this.schema();return a.features=n,a.spatialReference=(t==null?void 0:t.keepGeometryType)===!0?this.spatialReference:(s=this.spatialReference)==null?void 0:s.toJSON(),a}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){var e;return((e=this._parent)==null?void 0:e.preferredTimeZone)??null}get dateFieldsTimeZone(){var e;return((e=this._parent)==null?void 0:e.dateFieldsTimeZone)??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._parent)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._parent)==null?void 0:e.timeInfo)??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){var e;return this.fsetInfo??await((e=this._parent)==null?void 0:e.getFeatureSetInfo())??null}}_._featuresetFunctions={};class b extends _{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new D([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=h.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new m(y.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new m(y.NeverReach)}async _getFilteredSet(){return new D([],[],!1,null)}_stat(e,t,n,a,s,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends _{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new D(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,a){return this._parent._getFeatures(e,t,n,a)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return Q(H(this._relationGeom),H(e.geometry));case"esriSpatialRelIntersects":return Q(this._relationGeom,e.geometry);case"esriSpatialRelContains":return we(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return Se(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return ye(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return me(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return ge(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return fe(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){var l;const a=new D([],e,!1,null),s=Math.min(t,e.length);await((l=this._parent)==null?void 0:l._getFeatures(a,-1,s,n)),this._checkCancelled(n);const i=[];for(let o=0;oX.fromJSON(m))}writeRestrictionAttributes(e,a,s){e!=null&&(a[s]=e.map(m=>X.toJSON(m)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([x(te,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([x(C,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([D("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([x(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([x(ie,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([x(ee)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([x($)],d.prototype,"uturnAtJunctions",void 0),d=t([g("esri.rest.support.TravelMode")],d);const ae=d;function f(e,a){if(e==null)return null;const s={},m=new RegExp(`^${a}`,"i");for(const N of Object.keys(e))if(m.test(N)){const k=N.substring(a.length);s[C.fromJSON(k)]=e[N]}return s}function Y(e,a,s){if(e!=null){a.attributes||(a.attributes={});for(const m in e){const N=C.toJSON(m);a.attributes[`${s}${N}`]=e[m]}}}function E(e){const a={};for(const s of Object.keys(e)){const m=s;a[C.fromJSON(m)]=e[s]}return a}function j(e){const a={};for(const s of Object.keys(e)){const m=s;a[C.toJSON(m)]=e[s]}return a}function B(e,a){return e==null||a==null?null:Math.round((e-a)/6e4)}function ye(e){var m,N,k;const a=e.toJSON(),s=a;return s.accumulateAttributeNames&&(s.accumulateAttributeNames=(m=a.accumulateAttributeNames)==null?void 0:m.join()),s.attributeParameterValues&&(s.attributeParameterValues=JSON.stringify(a.attributeParameterValues)),s.barriers&&(s.barriers=JSON.stringify(a.barriers)),s.outSR&&(s.outSR=(N=a.outSR)==null?void 0:N.wkid),s.overrides&&(s.overrides=JSON.stringify(a.overrides)),s.polygonBarriers&&(s.polygonBarriers=JSON.stringify(a.polygonBarriers)),s.polylineBarriers&&(s.polylineBarriers=JSON.stringify(a.polylineBarriers)),s.restrictionAttributeNames&&(s.restrictionAttributeNames=(k=a.restrictionAttributeNames)==null?void 0:k.join()),s.stops&&(s.stops=JSON.stringify(a.stops)),s.travelMode&&(s.travelMode=JSON.stringify(a.travelMode)),s}var J;let c=J=class extends A(S){constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(e){return new J({directionLineType:V.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?V.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(e.FromLevel=this.fromLevel),this.toLevel!=null&&(e.ToLevel=this.toLevel),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};c.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:"Unknown",code:0},{name:"Segment",code:1},{name:"Maneuver Segment",code:2},{name:"Restriction violation",code:3},{name:"Scale cost barrier crossing",code:4},{name:"Heavy Traffic",code:5},{name:"Slow Traffic",code:6},{name:"Moderate Traffic",code:7}]}},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"FromLevel",alias:"Start from 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"Meters",alias:"Length in Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"Minutes",alias:"Duration in Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"ToLevel",alias:"End at 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1}],c.popupInfo={title:"Direction Lines",fieldInfos:[{fieldName:"DirectionLineType",label:"Line Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:"Length in Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:"Duration in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:"Direction Point ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:"Start from 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:"End at 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:V.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:V.read}}})],c.prototype,"directionLineType",void 0),t([i({json:{read:{source:"attributes.DirectionPointID"}}})],c.prototype,"directionPointId",void 0),t([i({json:{read:{source:"attributes.Meters"}}})],c.prototype,"distance",void 0),t([i({json:{read:{source:"attributes.Minutes"}}})],c.prototype,"duration",void 0),t([i({json:{read:{source:"attributes.FromLevel"}}})],c.prototype,"fromLevel",void 0),t([i({type:z})],c.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),t([i({type:F})],c.prototype,"popupTemplate",void 0),t([i({types:I})],c.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.ToLevel"}}})],c.prototype,"toLevel",void 0),t([i({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),c=J=t([g("esri.rest.support.DirectionLine")],c);const Te=c;var R;let n=R=class extends A(S){constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,a){return a.attributes.ArrivalTime!=null?new Date(a.attributes.ArrivalTime):null}static fromGraphic(e){return new R({alternateName:e.attributes.AlternateName??null,arrivalTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:W.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?W.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(e.AlternateName=this.alternateName),this.arrivalTime!=null&&(e.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(e.Azimuth=this.azimuth),this.branchName!=null&&(e.BranchName=this.branchName),this.displayText!=null&&(e.DisplayText=this.displayText),this.exitName!=null&&(e.ExitName=this.exitName),this.intersectingName!=null&&(e.IntersectingName=this.intersectingName),this.level!=null&&(e.Level=this.level),this.name!=null&&(e.Name=this.name),this.shortVoiceInstruction!=null&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(e.TowardName=this.towardName),this.voiceInstruction!=null&&(e.VoiceInstruction=this.voiceInstruction),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};n.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AlternateName",alias:"Alternative Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ArrivalTime",alias:"Maneuver Starts at",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"BranchName",alias:"Signpost Branch Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"DirectionPointType",alias:"Directions Item Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:"Unknown",code:0},{name:"",code:1},{name:"Arrive at stop",code:50},{name:"Depart at stop",code:51},{name:"Go straight",code:52},{name:"Take ferry",code:100},{name:"Take off ferry",code:101},{name:"Keep center at fork",code:102},{name:"Take roundabout",code:103},{name:"Make U-Turn",code:104},{name:"Pass the door",code:150},{name:"Take stairs",code:151},{name:"",code:152},{name:"Take escalator",code:153},{name:"Take pedestrian ramp",code:154},{name:"Keep left at fork",code:200},{name:"Ramp left",code:201},{name:"Take left-handed roundabout",code:202},{name:"Make left-handed U-Turn",code:203},{name:"Bear left",code:204},{name:"Turn left",code:205},{name:"Make sharp left",code:206},{name:"Turn left, followed by turn left",code:207},{name:"Turn left, followed by turn right",code:208},{name:"Keep right at fork",code:300},{name:"Ramp right",code:301},{name:"Take right-handed roundabout",code:302},{name:"Make right-handed U-Turn",code:303},{name:"Bear right",code:304},{name:"Turn right",code:305},{name:"Make sharp right",code:306},{name:"Turn right, followed by turn left",code:307},{name:"Turn right, followed by turn right",code:308},{name:"Indicates up direction of elevator",code:400},{name:"Indicates up direction of escalator",code:401},{name:"Take up-stairs",code:402},{name:"Indicates down direction of elevator",code:500},{name:"Indicates down direction of escalator",code:501},{name:"Take down-stairs",code:502},{name:"General event",code:1e3},{name:"Landmark",code:1001},{name:"Time zone change",code:1002},{name:"Heavy traffic segment",code:1003},{name:"Scale cost barrier crossing",code:1004},{name:"Administrative Border crossing",code:1005},{name:"Restriction violation",code:1006}]}},{name:"DisplayText",alias:"Text to Display",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ExitName",alias:"Highway Exit Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"IntersectingName",alias:"Intersecting Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Level",alias:"3D Logical Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Name",alias:"Primary Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ShortVoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TowardName",alias:"Signpost Toward Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"VoiceInstruction",alias:"Voice Full Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null}],n.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:"Directions Item Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:"Text to Display",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:"Stop ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Maneuver Starts at",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:"Azimuth",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:"Primary Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:"Alternative Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",label:"Highway Exit Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:"Intersecting Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:"Signpost Branch Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:"Signpost Toward Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",label:"Voice Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:"Voice Full Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],n.prototype,"alternateName",void 0),t([i()],n.prototype,"arrivalTime",void 0),t([p("arrivalTime",["attributes.ArrivalTime"])],n.prototype,"readArrivalTime",null),t([i({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],n.prototype,"arrivalTimeOffset",void 0),t([i({json:{read:{source:"attributes.Azimuth"}}})],n.prototype,"azimuth",void 0),t([i({json:{read:{source:"attributes.BranchName"}}})],n.prototype,"branchName",void 0),t([i({type:W.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:W.read}}})],n.prototype,"directionPointType",void 0),t([i({json:{read:{source:"attributes.DisplayText"}}})],n.prototype,"displayText",void 0),t([i({json:{read:{source:"attributes.ExitName"}}})],n.prototype,"exitName",void 0),t([i({type:H})],n.prototype,"geometry",void 0),t([i()],n.prototype,"intersectingName",void 0),t([i()],n.prototype,"level",void 0),t([i({json:{read:{source:"attributes.Name"}}})],n.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],n.prototype,"objectId",void 0),t([i({type:F})],n.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.Sequence"}}})],n.prototype,"sequence",void 0),t([i()],n.prototype,"shortVoiceInstruction",void 0),t([i({json:{read:{source:"attributes.StopID"}}})],n.prototype,"stopId",void 0),t([i({types:I})],n.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.TowardName"}}})],n.prototype,"towardName",void 0),t([i({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),t([i()],n.prototype,"voiceInstruction",void 0),n=R=t([g("esri.rest.support.DirectionPoint")],n);const ve=n;var P;let u=P=class extends A(S){constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(e,a){return f(a.attributes,"Attr_")}writeCosts(e,a){Y(e,a,"Attr_")}static fromGraphic(e){return new P({addedCost:e.attributes.AddedCost??null,barrierType:e.attributes.BarrierType!=null?v.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?E(JSON.parse(e.attributes.Costs)):null,curbApproach:e.attributes.CurbApproach!=null?b.fromJSON(e.attributes.CurbApproach):null,fullEdge:e.attributes.FullEdge!=null?U.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:e.attributes.Status!=null?O.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?v.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(j(this.costs)):null,CurbApproach:this.curbApproach!=null?b.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?U.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?O.toJSON(this.status):null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};u.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}}],u.popupInfo={title:"Point Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:"Added Cost",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],u.prototype,"addedCost",void 0),t([i({type:v.apiValues,json:{name:"attributes.BarrierType",read:{reader:v.read},write:{writer:v.write}}})],u.prototype,"barrierType",void 0),t([i()],u.prototype,"costs",void 0),t([p("costs",["attributes"])],u.prototype,"readCosts",null),t([D("costs")],u.prototype,"writeCosts",null),t([i({constructOnly:!0,type:b.apiValues,json:{read:{source:"attributes.CurbApproach",reader:b.read}}})],u.prototype,"curbApproach",void 0),t([i({type:U.apiValues,json:{name:"attributes.FullEdge",read:{reader:U.read},write:{writer:U.write}}})],u.prototype,"fullEdge",void 0),t([i({type:H,json:{write:!0}})],u.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],u.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],u.prototype,"objectId",void 0),t([i({type:F})],u.prototype,"popupTemplate",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:L.read}}})],u.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],u.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],u.prototype,"sourceOid",void 0),t([i({type:O.apiValues,json:{read:{source:"attributes.Status",reader:O.read}}})],u.prototype,"status",void 0),t([i({types:I})],u.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],u.prototype,"type",void 0),u=P=t([g("esri.rest.support.PointBarrier")],u);const he=u;var _;let y=_=class extends A(S){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(e,a){return f(a.attributes,"Attr_")}writeCosts(e,a){Y(e,a,"Attr_")}static fromGraphic(e){return new _({barrierType:e.attributes.BarrierType!=null?v.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?E(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?v.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(j(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};y.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],y.popupInfo={title:"Polygon Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:v.apiValues,json:{name:"attributes.BarrierType",read:{reader:v.read},write:{writer:v.write}}})],y.prototype,"barrierType",void 0),t([i()],y.prototype,"costs",void 0),t([p("costs",["attributes"])],y.prototype,"readCosts",null),t([D("costs")],y.prototype,"writeCosts",null),t([i({type:Z,json:{write:!0}})],y.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],y.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],y.prototype,"objectId",void 0),t([i({type:F})],y.prototype,"popupTemplate",void 0),t([i()],y.prototype,"scaleFactor",void 0),t([i({types:I})],y.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),y=_=t([g("esri.rest.support.PolygonBarrier")],y);const fe=y;var q;let T=q=class extends A(S){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(e,a){return f(a.attributes,"Attr_")}static fromGraphic(e){return new q({barrierType:e.attributes.BarrierType!=null?v.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?E(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?v.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(j(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};T.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],T.popupInfo={title:"Line Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:v.apiValues,json:{read:{source:"attributes.BarrierType",reader:v.read}}})],T.prototype,"barrierType",void 0),t([i()],T.prototype,"costs",void 0),t([p("costs",["attributes"])],T.prototype,"readCosts",null),t([i({type:z,json:{write:!0}})],T.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],T.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],T.prototype,"objectId",void 0),t([i({type:F})],T.prototype,"popupTemplate",void 0),t([i()],T.prototype,"scaleFactor",void 0),t([i({types:I})],T.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],T.prototype,"type",void 0),T=q=t([g("esri.rest.support.PolylineBarrier")],T);const ge=T;let h=class extends S{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return e==null?null:e.map(a=>C.fromJSON(a))}writeAccumulateAttributes(e,a,s){e!=null&&e.length&&(a[s]=e.map(m=>C.toJSON(m)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],h.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],h.prototype,"readAccumulateAttributes",null),t([D("accumulateAttributes")],h.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],h.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],h.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],h.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],h.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],h.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],h.prototype,"timeWindowsAreUTC",void 0),t([i({type:ae,json:{write:!0}})],h.prototype,"travelMode",void 0),h=t([g("esri.layers.support.RouteSettings")],h);const re=h;var K;let l=K=class extends A(S){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,a){return a.attributes.EndTimeUTC!=null?new Date(a.attributes.EndTimeUTC):null}readEndTimeOffset(e,a){return B(a.attributes.EndTime,a.attributes.EndTimeUTC)}readStartTime(e,a){return a.attributes.StartTimeUTC!=null?new Date(a.attributes.StartTimeUTC):null}readStartTimeOffset(e,a){return B(a.attributes.StartTime,a.attributes.StartTimeUTC)}readTotalCosts(e,a){return f(a.attributes,"Total_")}readTotalViolations(e,a){return f(a.attributes,"TotalViolation_")}readTotalWait(e,a){return f(a.attributes,"TotalWait_")}static fromGraphic(e){return new K({analysisSettings:e.attributes.AnalysisSettings!=null?re.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?E(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(j(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};l.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],l.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],l.prototype,"analysisSettings",void 0),t([i()],l.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],l.prototype,"readEndTime",null),t([i()],l.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],l.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],l.prototype,"firstStopId",void 0),t([i({type:z})],l.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],l.prototype,"lastStopId",void 0),t([i()],l.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],l.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],l.prototype,"objectId",void 0),t([i({type:F})],l.prototype,"popupTemplate",void 0),t([i()],l.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],l.prototype,"readStartTime",null),t([i()],l.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],l.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],l.prototype,"stopCount",void 0),t([i({types:I})],l.prototype,"symbol",void 0),t([i()],l.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],l.prototype,"readTotalCosts",null),t([i()],l.prototype,"totalDistance",void 0),t([i()],l.prototype,"totalDuration",void 0),t([i()],l.prototype,"totalLateDuration",void 0),t([i()],l.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],l.prototype,"readTotalViolations",null),t([i()],l.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],l.prototype,"readTotalWait",null),t([i()],l.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),t([i()],l.prototype,"version",void 0),l=K=t([g("esri.rest.support.RouteInfo")],l);const Se=l;var G;let r=G=class extends A(S){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,a){return B(a.attributes.ArriveTime,a.attributes.ArriveTimeUTC)}readCumulativeCosts(e,a){return f(a.attributes,"Cumul_")}readDepartTimeOffset(e,a){return B(a.attributes.DepartTime,a.attributes.DepartTimeUTC)}readServiceCosts(e,a){return f(a.attributes,"Attr_")}writeServiceCosts(e,a){Y(e,a,"Attr_")}writeTimeWindowEnd(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,a){e!=null&&(a.attributes||(a.attributes={}),a.attributes.TimeWindowStart=e.getTime())}readViolations(e,a){return f(a.attributes,"Violation_")}readWait(e,a){return f(a.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?b.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?E(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?b.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?b.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?M.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?E(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?O.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?b.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(j(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?b.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?b.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?M.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(j(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?O.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};r.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],r.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:b.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:b.read}}})],r.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],r.prototype,"arriveTime",void 0),t([i()],r.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],r.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],r.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],r.prototype,"bearingTol",void 0),t([i()],r.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],r.prototype,"readCumulativeCosts",null),t([i()],r.prototype,"cumulativeDistance",void 0),t([i()],r.prototype,"cumulativeDuration",void 0),t([i({type:b.apiValues,json:{name:"attributes.CurbApproach",read:{reader:b.read},write:{writer:b.write}}})],r.prototype,"curbApproach",void 0),t([i({type:b.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:b.read}}})],r.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],r.prototype,"departTime",void 0),t([i()],r.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],r.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],r.prototype,"distanceToNetworkInMeters",void 0),t([i({type:H,json:{write:!0}})],r.prototype,"geometry",void 0),t([i()],r.prototype,"lateDuration",void 0),t([i({type:M.apiValues,json:{name:"attributes.LocationType",read:{reader:M.read},write:{writer:M.write}}})],r.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],r.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],r.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],r.prototype,"objectId",void 0),t([i({type:F})],r.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],r.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],r.prototype,"routeName",void 0),t([i()],r.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],r.prototype,"readServiceCosts",null),t([D("serviceCosts")],r.prototype,"writeServiceCosts",null),t([i()],r.prototype,"serviceDistance",void 0),t([i()],r.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],r.prototype,"sequence",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:L.read}}})],r.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],r.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],r.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],r.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],r.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],r.prototype,"sourceOid",void 0),t([i({type:O.apiValues,json:{read:{source:"attributes.Status",reader:O.read}}})],r.prototype,"status",void 0),t([i({types:I})],r.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],r.prototype,"timeWindowEnd",void 0),t([D("timeWindowEnd")],r.prototype,"writeTimeWindowEnd",null),t([i()],r.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],r.prototype,"timeWindowStart",void 0),t([D("timeWindowStart")],r.prototype,"writeTimeWindowStart",null),t([i()],r.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([i()],r.prototype,"violations",void 0),t([p("violations",["attributes"])],r.prototype,"readViolations",null),t([i()],r.prototype,"waitDuration",void 0),t([i()],r.prototype,"wait",void 0),t([p("wait",["attributes"])],r.prototype,"readWait",null),r=G=t([g("esri.rest.support.Stop")],r);const Ne=r;export{he as C,X as D,Ne as O,be as R,Se as S,fe as T,C as U,ae as a,ce as b,ve as c,de as d,ne as e,ue as f,re as g,Q as i,ge as j,pe as k,$ as l,Te as m,B as n,ye as o,le as r,oe as s,me as w,ie as y}; diff --git a/dist/assets/StreamFeatureManager-QrKJ84_c.js b/dist/assets/StreamFeatureManager-QrKJ84_c.js new file mode 100644 index 0000000..e8e969d --- /dev/null +++ b/dist/assets/StreamFeatureManager-QrKJ84_c.js @@ -0,0 +1 @@ +import{bm as c}from"./index-J0iiHjMT.js";class n{constructor(t){this.size=0,this._start=0,this.maxSize=t,this._buffer=new Array(t)}get entries(){return this._buffer}enqueue(t){if(this.size===this.maxSize){const e=this._buffer[this._start];return this._buffer[this._start]=t,this._start=(this._start+1)%this.maxSize,e}return this._buffer[(this._start+this.size++)%this.maxSize]=t,null}dequeue(){if(this.size===0)return null;const t=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,t}peek(){return this.size===0?null:this._buffer[this._start]}find(t){if(this.size===0)return null;for(const e of this._buffer)if(e!=null&&t(e))return e;return null}clear(t){let e=this.dequeue();for(;e!=null;)t&&t(e),e=this.dequeue()}}const l="__esri_stream_id__",a="__esri_timestamp__",d=1e3;class p{constructor(t,e,s,i,r=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=s,this._purgeOptions=i,this.store=t,this.objectIdField=e,this.purgeInterval=r,this._useGeneratedIds=this.objectIdField===l}removeById(t){this._removed.push(t)}removeByTrackId(t){const e=this._trackIdToObservations.get(t);if(e)for(const s of e.entries)this._removed.push(s)}add(t){var h;if(this._useGeneratedIds){const o=this._nextId();t.attributes[this.objectIdField]=o,t.objectId=o}else t.objectId=t.attributes[this.objectIdField];const e=t.objectId;if(this._addOrUpdated.set(e,t),this._maxAge=Math.max(this._maxAge,t.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new n(1e5)),void this._trackIdLessObservations.enqueue(e);const s=t.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(s)){const o=((h=this._purgeOptions)==null?void 0:h.maxObservations)!=null?this._purgeOptions.maxObservations:d,_=c(o,0,d);this._trackIdToObservations.set(s,new n(_))}const i=this._trackIdToObservations.get(s),r=i==null?void 0:i.enqueue(e);r!=null&&(this._addOrUpdated.has(r)?this._addOrUpdated.delete(r):this._removed.push(r))}checkForUpdates(){const t=this._getToAdd(),e=this._getToRemove(),s=performance.now();s-this._lastPurge>=this.purgeInterval&&(this._purge(s),this._lastPurge=s);const i=[];if(e!=null)for(const h of e){const o=this.store.removeById(h);o!=null&&i.push(o)}const r=[];if(t!=null){const h=new Set(e??[]);for(const o of t)h.has(o.objectId)||(o.attributes[a]=s,this.store.add(o),r.push(o))}(r.length||i!=null&&i.length)&&this.store.update(r,i)}_getToAdd(){if(!this._addOrUpdated.size)return null;const t=new Array(this._addOrUpdated.size);let e=0;return this._addOrUpdated.forEach(s=>t[e++]=s),this._addOrUpdated.clear(),t}_getToRemove(){const t=this._removed;return this._removed.length?(this._removed=[],t):null}_nextId(){const t=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,t}_purge(t){const e=this._purgeOptions;e!=null&&(this._purgeSomeByDisplayCount(e),this._purgeByAge(e),this._purgeByAgeReceived(t,e),this._purgeTracks())}_purgeSomeByDisplayCount(t){if(!t.displayCount)return;let e=this.store.size;if(e>t.displayCount){if(this._timeInfo.trackIdField){for(const s of this._trackIdToObservations.values())if(e>t.displayCount&&s.size){const i=s.dequeue();this._removed.push(i),e--}}if(this._trackIdLessObservations!=null){let s=e-t.displayCount;for(;s-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(t){var r;const e=(r=this._timeInfo)==null?void 0:r.startTimeField;if(!t.age||!e)return;const s=60*t.age*1e3,i=this._maxAge-s;this.store.forEach(h=>{h.attributes[e]{i.attributes[a]{t.size===0&&this._trackIdToObservations.delete(e)})}}export{p as o,n as t}; diff --git a/dist/assets/StreamLayer-KHxHoWyI.js b/dist/assets/StreamLayer-KHxHoWyI.js new file mode 100644 index 0000000..33ec857 --- /dev/null +++ b/dist/assets/StreamLayer-KHxHoWyI.js @@ -0,0 +1,7 @@ +import{e as t,y as s,c as S,dr as F,dK as P,el as E,dO as O,dL as A,em as k,dM as D,dN as N,dP as C,dq as L,ar as j,ah as U,E as p,dQ as V,iF as f,ja as M,Z as G,jb as J,de as v,fe as h,fv as W,il as z,ca as q,jc as m,bW as K,dw as Q,iG as Z,dl as Y,hs as B,dT as H,iI as X,iJ as ee,iK as te,dV as ie,ey as g,jd as se,je as re,iu as oe,iv as ne,iM as ae,it as le,dt as w,bI as de,iN as pe,dW as ce,ix as me,c7 as ue}from"./index-J0iiHjMT.js";import{o as he}from"./CustomParametersMixin-Y1bOcayO.js";import{p as ye}from"./FeatureEffectLayer-oBa8pIG5.js";import{c as fe}from"./FeatureReductionLayer-RlitE1N6.js";import"./FeatureEffect-5bEV-xG1.js";var y;let d=y=class extends F{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([s({type:Number,json:{write:!0}})],d.prototype,"age",void 0),t([s({type:Number,json:{write:!0}})],d.prototype,"ageReceived",void 0),t([s({type:Number,json:{write:!0}})],d.prototype,"displayCount",void 0),t([s({type:Number,json:{write:!0}})],d.prototype,"maxObservations",void 0),d=y=t([S("esri.layers.support.PurgeOptions")],d);const x=d,b=me();function I(e,r){return new p("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${r}`,{layer:e})}let i=class extends fe(ye(P(E(O(A(k(D(N(C(he(L(ue)))))))))))){constructor(...e){super(...e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new x,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=j.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=U(async(r,o,a)=>{const{save:n,saveAs:l}=await v(()=>import("./streamLayerUtils-j16jl5bN.js"),__vite__mapDeps([0,1,2,3,4]));switch(r){case m.SAVE:return n(this,o);case m.SAVE_AS:return l(this,a,o)}})}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new p("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(V).then(()=>this._fetchService(r))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const r=this._normalizeFeatureReduction(e);this._set("featureReduction",r)}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,r,o){var n;r=r.layerDefinition||r;const a=(n=r.drawingInfo)==null?void 0:n.renderer;if(a){const l=M(a,r,o)||void 0;return l||G.getLogger(this).error("Failed to create renderer",{rendererDefinition:r.drawingInfo.renderer,layer:this,context:o}),l}return J(r,o)}async connect(e){const[{createConnection:r}]=await Promise.all([v(()=>import("./createConnection-4ppGVnSc.js"),__vite__mapDeps([5,2,3,6,7,8,9])),this.load()]),o=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:a=null,definitionExpression:n=null,geometryDefinition:l=null,maxReconnectionAttempts:$=0,maxReconnectionInterval:R=20,spatialReference:T=this.spatialReference}=e||this.createConnectionParameters(),c=r(this.parsedUrl,this.spatialReference,T,o,{geometry:l,where:n},$,R,a??void 0),_=W([this.on("send-message-to-socket",u=>c.sendMessageToSocket(u)),this.on("send-message-to-client",u=>c.sendMessageToClient(u))]);return c.once("destroy",_.remove),c}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return z(this,e)}createQuery(){const e=new q;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,r){if(!this.fields)return null;let o=null;return this.fields.some(a=>(a.name===e&&(o=a.domain),!!o)),o}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,r){return this._debouncedSaveOperations(m.SAVE_AS,r,e)}write(e,r){const o=r==null?void 0:r.messages;return this.webSocketUrl?(o==null||o.push(I(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,r):(o==null||o.push(I(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){var r,o,a;if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:n}=await K(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=n}}else{if(!((r=this.timeInfo)!=null&&r.trackIdField))throw new p("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const n=(o=this.fields.find(l=>l.type==="oid"))==null?void 0:o.name;if(!n)throw new p("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=n}if(!this.fields)throw new p("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(n=>n.name===this.objectIdField)||this.fields.push(new Q({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new p("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:(a=this.portalItem)==null?void 0:a.portal,url:this.parsedUrl}),f(this.renderer,this.fieldsIndex),Z(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),Y(this,{origin:"service"})}};t([s({type:String})],i.prototype,"copyright",void 0),t([s({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([s({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([s({type:String})],i.prototype,"displayField",void 0),t([s({type:B})],i.prototype,"elevationInfo",void 0),t([s({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([s(b.fields)],i.prototype,"fields",void 0),t([s(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([s({type:H,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([s({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([s(X)],i.prototype,"labelsVisible",void 0),t([s({type:[ee],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:te},write:!0}})],i.prototype,"labelingInfo",void 0),t([s(ie)],i.prototype,"legendEnabled",void 0),t([s({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([s({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([s({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([s(se)],i.prototype,"maxScale",void 0),t([s(re)],i.prototype,"minScale",void 0),t([s({type:String})],i.prototype,"objectIdField",void 0),t([s({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],i.prototype,"outFields",void 0),t([s(oe)],i.prototype,"popupEnabled",void 0),t([s({type:ne,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([s({type:x})],i.prototype,"purgeOptions",void 0),t([s({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([s({types:ae,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:le,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([s((()=>{const e=de(pe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([s()],i.prototype,"sourceJSON",void 0),t([s({type:j,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([s({json:{read:!1}})],i.prototype,"type",void 0),t([s(ce)],i.prototype,"url",void 0),t([s({type:Number})],i.prototype,"updateInterval",void 0),t([s({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([s({type:String})],i.prototype,"webSocketUrl",void 0),i=t([S("esri.layers.StreamLayer")],i);const Se=i;export{Se as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/streamLayerUtils-j16jl5bN.js","assets/utils-rBsg-VY8.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/jsonContext-cWV_-jAj.js","assets/createConnection-4ppGVnSc.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/queryZScale-IaMm02_2.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/StreamLayerView3D-nu_wqFzJ.js b/dist/assets/StreamLayerView3D-nu_wqFzJ.js new file mode 100644 index 0000000..2d25459 --- /dev/null +++ b/dist/assets/StreamLayerView3D-nu_wqFzJ.js @@ -0,0 +1 @@ +import{e as r,y as i,c as p,cZ as M,p as R,n as _,fe as U,d as f,S as k,dC as C,G as T,E as $,ca as x}from"./index-J0iiHjMT.js";import{o as E}from"./StreamFeatureManager-QrKJ84_c.js";import{createConnection as G}from"./createConnection-4ppGVnSc.js";import{r as j}from"./EventedSet-JGlFrfoR.js";import{E as V}from"./HeatmapDensity.glsl-y7dUg--m.js";import{n as L}from"./LayerView3D-iOx2MD1g.js";import{u as F}from"./LayerView-efDufa6j.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";const N=2500;let d=class extends k{getObjectId(){return this.objectId}};r([i({type:Number,json:{read:!0}})],d.prototype,"objectId",void 0),d=r([p("esri.layers.graphics.controllers.StreamGraphic")],d);let z=class{constructor(e){this.onUpdate=e,this._idToGraphic=new Map}destroy(){this._idToGraphic.clear()}add(e){this._idToGraphic.set(e.objectId,e)}get(e){return this._idToGraphic.get(e)}forEach(e){this._idToGraphic.forEach(e)}removeById(e){const t=this._idToGraphic.get(e);return t?(t.sourceLayer=t.layer=null,this._idToGraphic.delete(e),t):null}update(e,t){this.onUpdate(e,t)}get size(){return this._idToGraphic.size}},n=class extends M(R){constructor(){super(...arguments),this.isPaused=!1,this.graphics=new j,this._updateInfo={websocket:0,client:0},this._updateIntervalId=null,this._outSpatialReference=null}initialize(){this.addResolvingPromise(this.layer.when(()=>this._startup()))}destroy(){this.clear()}_clearInterval(){this._updateIntervalId!==null&&(clearInterval(this._updateIntervalId),this._updateIntervalId=null)}clear(){this._clearInterval(),this.connection=_(this.connection),this.store=_(this.store),this.graphics.clear(),this.removeAllHandles()}get updating(){return!this.connection||this.connection.connectionStatus==="connected"}_startup(){const{layer:e,layerView:t}=this,{spatialReference:l,definitionExpression:c,geometryDefinition:h,objectIdField:u,timeInfo:g,purgeOptions:v,maxReconnectionAttempts:I,maxReconnectionInterval:S,customParameters:w}=e,b=e.geometryType?U.toJSON(e.geometryType):null,O=l,m=t.view.spatialReference,P={geometry:h,where:c};this.clear(),this._set("connection",G(e.parsedUrl,O,m,b,P,I,S,w??void 0)),this._outSpatialReference=m.toJSON(),this.store=new z(this._onUpdate.bind(this)),this.featuresManager=new E(this.store,u,g.toJSON(),v);const y="startup-watches";this.removeHandles(y),this.addHandles([e.on("send-message-to-socket",a=>this.connection.sendMessageToSocket(a)),e.on("send-message-to-client",a=>this.connection.sendMessageToClient(a)),this.connection.on("data-received",a=>this._onFeature(a)),this.connection.on("message-received",a=>this._onWebSocketMessage(a)),f(()=>[e.definitionExpression,e.geometryDefinition,e.purgeOptions],()=>this._startup())],y),this.isPaused||this._initUpdateInterval()}_onWebSocketMessage(e){if(this.layerView.emit("message-received",e),"type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this.featuresManager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this.featuresManager.removeByTrackId(t);break;case"clear":this.store.forEach(t=>this.featuresManager.removeById(t.objectId))}}_onFeature(e){this._updateInfo.websocket++,this.layerView.hasEventListener("data-received")&&this.layerView.emit("data-received",{attributes:e.attributes,centroid:e.centroid,geometry:e.geometry});try{e.geometry==null||e.geometry.spatialReference||(e.geometry.spatialReference=this._outSpatialReference);const t=d.fromJSON(e);t.sourceLayer=t.layer=this.layer,this.featuresManager.add(t)}catch{}}_onUpdate(e,t){t!=null&&this.graphics.removeMany(t),e!=null&&(this._updateInfo.client+=e.length,this.graphics.addMany(e))}_initUpdateInterval(){this._clearInterval();const{updateInterval:e}=this.layer;let t=performance.now();this._updateIntervalId=setInterval(()=>{const l=performance.now(),c=l-t;if(c>N){t=l;const h=Math.round(this._updateInfo.client/(c/1e3)),u=Math.round(this._updateInfo.websocket/(c/1e3));this._updateInfo.client=0,this._updateInfo.websocket=0,this.layerView.emit("update-rate",{client:h,websocket:u})}this.featuresManager.checkForUpdates()},e)}pauseStream(){this.isPaused=!0,this._clearInterval()}resumeStream(){this.isPaused=!1,this._initUpdateInterval()}};r([i()],n.prototype,"isPaused",void 0),r([i({constructOnly:!0})],n.prototype,"layer",void 0),r([i({constructOnly:!0})],n.prototype,"layerView",void 0),r([i()],n.prototype,"connection",void 0),r([i({readOnly:!0})],n.prototype,"updating",null),n=r([p("esri.layers.graphics.controllers.StreamController")],n);const B=s=>{let e=class extends s{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}constructor(...t){super(...t),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return this._isUserPaused?"paused":this._streamConnectionStatus}_onSuspendedChange(t){t?this._doPause():this._isUserPaused||this._doResume()}};return r([i()],e.prototype,"_isUserPaused",void 0),r([i({readOnly:!0})],e.prototype,"connectionStatus",null),r([i({type:C})],e.prototype,"filter",void 0),e=r([p("esri.layers.mixins.StreamLayerView")],e),e};let o=class extends B(V(L(F))){constructor(){super(...arguments),this.type="stream-3d",this.updatePolicy=T.ASYNC,this.hasZ=!0,this.hasM=!1}initialize(){this.addHandles(f(()=>this.suspended,s=>{this.controller&&this._onSuspendedChange(s)}))}get connectionError(){var e,t;const s=(t=(e=this.controller)==null?void 0:e.connection)==null?void 0:t.errorString;return s?new $("stream-controller",s):null}createQuery(){return new x({outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference})}queryLatestObservations(s,e){return this.queryEngine.executeQueryForLatestObservations(this._ensureQuery(s),e==null?void 0:e.signal)}get _streamConnectionStatus(){var s,e;return((e=(s=this.controller)==null?void 0:s.connection)==null?void 0:e.connectionStatus)??"disconnected"}createController(){return new n({layer:this.layer,layerView:this})}beforeSetController(){}_doPause(){var s;(s=this.controller)==null||s.pauseStream()}_doResume(){var s;(s=this.controller)==null||s.resumeStream()}};r([i({readOnly:!0})],o.prototype,"updatePolicy",void 0),r([i({readOnly:!0})],o.prototype,"connectionError",null),r([i()],o.prototype,"controller",void 0),r([i({readOnly:!0})],o.prototype,"hasZ",void 0),r([i({readOnly:!0})],o.prototype,"hasM",void 0),r([i({readOnly:!0})],o.prototype,"_streamConnectionStatus",null),o=r([p("esri.views.3d.layers.StreamLayerView3D")],o);const Ie=o;export{Ie as default}; diff --git a/dist/assets/StyleRepository-UhXfhILC.js b/dist/assets/StyleRepository-UhXfhILC.js new file mode 100644 index 0000000..d656c2b --- /dev/null +++ b/dist/assets/StyleRepository-UhXfhILC.js @@ -0,0 +1,9 @@ +import{qE as _,sk as x,ab as D,sl as Xt,sm as te,sn as ee,so as W,sp as v,sq as M,sr as Q}from"./index-J0iiHjMT.js";import{t as vt}from"./TileClipper-NSFZXMR1.js";import{$ as ge}from"./definitions-DqQMJYPH.js";let _e=class{constructor(t){this._array=[],t<=0&&console.error("strideInBytes must be positive!"),this._stride=t}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(t,e){return 65535&t|e<<16}static i8888to32(t,e,r,s){return 255&t|(255&e)<<8|(255&r)<<16|s<<24}static i8816to32(t,e,r){return 255&t|(255&e)<<8|r<<16}};var c,q;(function(n){n[n.R8_SIGNED=0]="R8_SIGNED",n[n.R8_UNSIGNED=1]="R8_UNSIGNED",n[n.R16_SIGNED=2]="R16_SIGNED",n[n.R16_UNSIGNED=3]="R16_UNSIGNED",n[n.R8G8_SIGNED=4]="R8G8_SIGNED",n[n.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",n[n.R16G16_SIGNED=6]="R16G16_SIGNED",n[n.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",n[n.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",n[n.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",n[n.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",n[n.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",n[n.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(c||(c={})),function(n){n[n.UNIFORM=0]="UNIFORM",n[n.DATA_DRIVEN=1]="DATA_DRIVEN",n[n.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",n[n.UNUSED=3]="UNUSED"}(q||(q={}));let H=class Dt{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,s,i){const o=this.getUniforms();for(const a of o){const{name:l,type:u,getValue:p}=a,h=p(r,e,s,i);if(h!==null)switch(u){case"float":t.setUniform1f(l,h);break;case"vec2":t.setUniform2fv(l,h);break;case"vec4":t.setUniform4fv(l,h)}}}encodeAttributes(t,e,r,s){var p;const i=this.attributesInfo(),o=this.getEncodingInfos(),a=[];let l=0,u=0;for(const h of Object.keys(o)){const f=o[h],{type:m,precisionFactor:g,isLayout:A}=i[h],w=A?r.getLayoutProperty(h):r.getPaintProperty(h),S=(p=w.interpolator)==null?void 0:p.getInterpolationRange(e);let d=0;for(const I of f){const{offset:E,bufferElementsToAdd:L}=I;if(L>0){for(let N=0;N4)s++,N={dataIndex:s,count:0,offset:0},I!==4&&(r[R]=N),t.push({location:-1,name:"a_data_"+s,count:I,type:S,normalized:E}),$=Math.ceil(Math.max(L/4,1));else{const z=t[N.dataIndex];z.count+=I,$=Math.ceil(Math.max(z.count*d/4,1))-Math.ceil(Math.max(N.offset/4,1))}g.push({dataIndex:N.dataIndex,offset:N.offset,bufferElementsToAdd:$}),N.offset+=L,N.count+=I}}for(const h of t)switch(h.type){case _.BYTE:case _.UNSIGNED_BYTE:h.count=4;break;case _.SHORT:case _.UNSIGNED_SHORT:h.count+=h.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layoutInfo.geometry;for(const h of u)this._locations.set(h.name,l++);const p=this._layoutInfo.opacity;if(p)for(const h of p)this._locations.set(h.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e={},r=this.geometryInfo();let s=r[0].stride;if(t.length===0)e.geometry=r;else{const i=[];let o=s;for(const a of t)s+=re(a.type)*a.count;for(const a of r)i.push(new x(a.name,a.count,a.type,a.offset,s,a.normalized));for(const a of t)i.push(new x(a.name,a.count,a.type,o,s,a.normalized)),o+=re(a.type)*a.count;e.geometry=i}this.opacityInfo()&&(e.opacity=this.opacityInfo()),this._layoutInfo=e,this._stride=s}_buildShaderInfo(t,e){let r=` +`,s=` +`;const i=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; +`;const o=this.attributes(),a=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:p,type:h,precisionFactor:f,isLayout:m}=a[u],g=f&&f!==1?" * "+1/f:"",{bytesPerElement:A,count:w}=Dt._encodingInfo[h],S=d=>`a_data_${d.dataIndex}${de(w,d.offset,A)}`;switch(this.getAtributeState(l)){case q.UNIFORM:{const d=this._getType(w),I=`u_${p}`;i.push({name:I,type:d,getValue:(E,L,R,N)=>{const $=m?E.getLayoutValue(u,L):E.getPaintValue(u,L);if(h===c.R16G16B16A16_DASHARRAY){const z=E.getDashKey($,E.getLayoutValue("line-cap",L)),it=N.getMosaicItemPosition(z,!1);if(it==null)return null;const{tl:nt,br:Jt}=it;return[nt[0],Jt[1],Jt[0],nt[1]]}if(h===c.R16G16B16A16_PATTERN){const z=N.getMosaicItemPosition($,!u.includes("line-"));if(z==null)return null;const{tl:it,br:nt}=z;return[it[0],nt[1],nt[0],it[1]]}if(h===c.R8G8B8A8_COLOR){const z=$[3];return[z*$[0],z*$[1],z*$[2],z]}return $}}),r+=`uniform ${d} ${I}; +`,s+=`${d} ${p} = ${I}; +`}break;case q.DATA_DRIVEN:{const d=S(e[u][0]);s+=`${this._getType(w)} ${p} = ${d}${g}; +`}break;case q.INTERPOLATED_DATA_DRIVEN:{const d=`u_t_${p}`;i.push({name:d,type:"float",getValue:(L,R,N,$)=>(m?L.getLayoutProperty(u):L.getPaintProperty(u)).interpolator.interpolationUniformValue(N,R)}),r+=`uniform float ${d}; +`;const I=S(e[u][0]),E=S(e[u][1]);s+=`${this._getType(w)} ${p} = mix(${I}${g}, ${E}${g}, ${d}); +`}}}this._shaderHeader=r,this._shaderMain=s,this._uniforms=i}_bit(t){return(this._key&1<>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return _e.i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!(r!=null&&r.rect))return;const s=2,i=r.rect,o=r.width,a=r.height;e[t]=this._encodeShort(i.x+s,0),e[t]|=this._encodeShort(i.y+s+a,16),e[t+1]=this._encodeShort(i.x+s+o,0),e[t+1]|=this._encodeShort(i.y+s,16)}_encodeByte(t,e){return(255&t)<{switch(n){case _.FLOAT:case _.INT:case _.UNSIGNED_INT:return 4;case _.SHORT:case _.UNSIGNED_SHORT:return 2;case _.BYTE:case _.UNSIGNED_BYTE:return 1}},de=(n,t,e)=>{const r=t/e;if(n===1)switch(r){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(n===2)switch(r){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(n===3)switch(r){case 0:return".xyz";case 1:return".yzw"}return""};let J=class pt extends H{constructor(t){super(t)}geometryInfo(){return pt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return pt.ATTRIBUTES}attributesInfo(){return pt.ATTRIBUTES_INFO}};J.ATTRIBUTES=[],J.GEOMETRY_LAYOUT=[new x("a_pos",2,_.BYTE,0,2)],J.ATTRIBUTES_INFO={};let X=class yt extends H{constructor(t){super(t)}geometryInfo(){return yt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return yt.ATTRIBUTES}attributesInfo(){return yt.ATTRIBUTES_INFO}};X.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],X.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,4)],X.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:c.R8_UNSIGNED},"circle-color":{name:"color",type:c.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:c.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:c.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:c.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:32}};let tt=class ft extends H{constructor(t){super(t)}geometryInfo(){return ft.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return ft.ATTRIBUTES}attributesInfo(){return ft.ATTRIBUTES_INFO}};tt.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],tt.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,4)],tt.ATTRIBUTES_INFO={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0}};let V=class Z extends H{constructor(t,e){super(t),this._usefillColor=e}geometryInfo(){return Z.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this._usefillColor?Z.ATTRIBUTES_FILL:Z.ATTRIBUTES_OUTLINE}attributesInfo(){return this._usefillColor?Z.ATTRIBUTES_INFO_FILL:Z.ATTRIBUTES_INFO_OUTLINE}};V.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],V.ATTRIBUTES_FILL=["fill-color","fill-opacity"],V.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,8),new x("a_offset",2,_.BYTE,4,8),new x("a_xnormal",2,_.BYTE,6,8)],V.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}},V.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:c.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100}};let et=class gt extends H{constructor(t){super(t)}geometryInfo(){return gt.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return gt.ATTRIBUTES}attributesInfo(){return gt.ATTRIBUTES_INFO}};et.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],et.GEOMETRY_LAYOUT=[new x("a_pos",2,_.SHORT,0,16),new x("a_extrude_offset",4,_.BYTE,4,16),new x("a_dir_normal",4,_.BYTE,8,16),new x("a_accumulatedDistance",2,_.UNSIGNED_SHORT,12,16)],et.ATTRIBUTES_INFO={"line-width":{name:"width",type:c.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:c.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:c.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:c.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:c.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:c.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:c.R16G16B16A16_DASHARRAY,isOptional:!0}};const le=[new x("a_pos",2,_.SHORT,0,16),new x("a_vertexOffset",2,_.SHORT,4,16),new x("a_texAngleRange",4,_.UNSIGNED_BYTE,8,16),new x("a_levelInfo",4,_.UNSIGNED_BYTE,12,16)],ue=[new x("a_opacityInfo",1,_.UNSIGNED_BYTE,0,1)];let ot=class Rt extends H{constructor(t){super(t)}geometryInfo(){return le}opacityInfo(){return ue}attributes(){return Rt.ATTRIBUTES}attributesInfo(){return Rt.ATTRIBUTES_INFO}};ot.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],ot.ATTRIBUTES_INFO={"icon-color":{name:"color",type:c.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:c.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};let lt=class Nt extends H{constructor(t){super(t)}geometryInfo(){return le}opacityInfo(){return ue}attributes(){return Nt.ATTRIBUTES}attributesInfo(){return Nt.ATTRIBUTES_INFO}};lt.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],lt.ATTRIBUTES_INFO={"text-color":{name:"color",type:c.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:c.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:c.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:c.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:c.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:c.R8_UNSIGNED,isLayout:!0}};function me(n,t,e,r){const s=3*n,i=3*(e-n)-s,o=1-s-i,a=3*t,l=3*(r-t)-a,u=1-a-l;function p(g){return((o*g+i)*g+s)*g}function h(g){return((u*g+l)*g+a)*g}function f(g){return(3*o*g+2*i)*g+s}function m(g,A){let w,S,d,I,E,L;for(d=g,L=0;L<8;L++){if(I=p(d)-g,Math.abs(I)S)return S;for(;wI?w=d:S=d,d=.5*(S-w)+w}return d}return function(g,A=1e-6){return h(m(g,A))}}const Ye=Number.POSITIVE_INFINITY,St=Math.PI,He=2*St,we=128/St,je=St/180,Ee=1/Math.LN2;function be(n,t){return(n%=t)>=0?n:n+t}function qe(n){return be(n*we,256)}function Ke(n){return Math.log(n)*Ee}function U(n,t,e){return n*(1-e)+t*e}const ce={kind:"null"},T={kind:"number"},k={kind:"string"},P={kind:"boolean"},Y={kind:"color"},bt={kind:"object"},C={kind:"value"};function ct(n,t){return{kind:"array",itemType:n,n:t}}const Te=[ce,T,k,P,Y,bt,ct(C)];function rt(n){if(n.kind==="array"){const t=rt(n.itemType);return typeof n.n=="number"?`array<${t}, ${n.n}>`:n.itemType.kind==="value"?"array":`array<${t}>`}return n.kind}function Tt(n){if(n===null)return ce;if(typeof n=="string")return k;if(typeof n=="boolean")return P;if(typeof n=="number")return T;if(n instanceof D)return Y;if(Array.isArray(n)){let t;for(const e of n){const r=Tt(e);if(t){if(t!==r){t=C;break}}else t=r}return ct(t||C,n.length)}return typeof n=="object"?bt:C}function At(n,t){if(t.kind==="array")return n.kind==="array"&&(n.n===0&&n.itemType.kind==="value"||At(n.itemType,t.itemType))&&(typeof t.n!="number"||t.n===n.n);if(t.kind==="value"){for(const e of Te)if(At(n,e))return!0}return t.kind===n.kind}function xt(n){if(n===null)return"";const t=typeof n;return t==="string"?n:t==="number"||t==="boolean"?String(n):n instanceof D?n.toString():JSON.stringify(n)}let Ie=class{constructor(t){this._parent=t,this._vars={}}add(t,e){this._vars[t]=e}get(t){return this._vars[t]?this._vars[t]:this._parent?this._parent.get(t):null}};class Lt{constructor(){this.type=C}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new Lt}evaluate(t,e){return t==null?void 0:t.id}}class Ut{constructor(){this.type=k}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new Ut}evaluate(t,e){if(!t)return null;switch(t.type){case vt.Point:return"Point";case vt.LineString:return"LineString";case vt.Polygon:return"Polygon";default:return null}}}let ve=class he{constructor(){this.type=bt}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new he}evaluate(t,e){return t==null?void 0:t.values}};class It{constructor(){this.type=T}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new It}evaluate(t,e){return e}}class G{constructor(t,e,r){this._lhs=t,this._rhs=e,this._compare=r,this.type=P}static parse(t,e,r){if(t.length!==3&&t.length!==4)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(t.length===4)throw new Error(`"${t[0]}" collator not supported`);return new G(y(t[1],e),y(t[2],e),r)}evaluate(t,e){return this._compare(this._lhs.evaluate(t,e),this._rhs.evaluate(t,e))}}class De extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r===s)}}class Re extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r!==s)}}class Ne extends G{static parse(t,e){return G.parse(t,e,(r,s)=>rr<=s)}}class xe extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r>s)}}class Pe extends G{static parse(t,e){return G.parse(t,e,(r,s)=>r>=s)}}class Bt{constructor(t){this._arg=t,this.type=P}static parse(t,e){if(t.length!==2)throw new Error('"!" expects 1 argument');return new Bt(y(t[1],e))}evaluate(t,e){return!this._arg.evaluate(t,e)}}class Ot{constructor(t){this._args=t,this.type=P}static parse(t,e){const r=[];for(let s=1;s1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${i[0]}"`)}if(t.length%2!=1)throw new Error(`"${s}" expects an even number of arguments`);const o=y(t[2],e,T);let a;s==="interpolate-hcl"||s==="interpolate-lab"?a=Y:r&&r.kind!=="value"&&(a=r);const l=[];for(let u=3;u=p)throw new Error(`"${s}" requires strictly ascending stop inputs`);const h=y(t[u+1],e,a);a||(a=h.type),l.push([p,h])}if(a&&a!==Y&&a!==T&&(a.kind!=="array"||a.itemType!==T))throw new Error(`"${s}" cannot interpolate type ${rt(a)}`);return new j(s,a,i,o,l)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const s=this.input.evaluate(t,e);if(s<=r[0][0])return r[0][1].evaluate(t,e);if(s>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let i=0;for(;++iU(h,p[f],l));if(this.type.kind==="color"&&u instanceof D&&p instanceof D){const h=new D(u),f=new D(p);return new D([U(h.r,f.r,l),U(h.g,f.g,l),U(h.b,f.b,l),U(h.a,f.a,l)])}if(this.type.kind==="number"&&typeof u=="number"&&typeof p=="number")return U(u,p,l);throw new Error(`"${this._operator}" cannot interpolate type ${rt(this.type)}`)}if(this._operator==="interpolate-hcl"){const h=Xt(u),f=Xt(p),m=f.h-h.h,g=te({h:h.h+l*(m>180||m<-180?m-360*Math.round(m/360):m),c:U(h.c,f.c,l),l:U(h.l,f.l,l)});return new D({a:U(u.a,p.a,l),...g})}if(this._operator==="interpolate-lab"){const h=ee(u),f=ee(p),m=te({l:U(h.l,f.l,l),a:U(h.a,f.a,l),b:U(h.b,f.b,l)});return new D({a:U(u.a,p.a,l),...m})}throw new Error(`Unexpected operator "${this._operator}"`)}interpolationUniformValue(t,e){const r=this._stops;if(r.length===1||t>=r[r.length-1][0])return 0;let s=0;for(;++s=r)return[r,r];let s=0;for(;++s1&&(i=1),i}static _exponentialInterpolationRatio(t,e,r,s){const i=s-r;if(i===0)return 0;const o=t-r;return e===1?o/i:(e**o-1)/(e**i-1)}};class Ft{constructor(t,e,r){this.type=t,this._input=e,this._stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=y(t[1],e,T);let s;const i=[];i.push([-1/0,y(t[2],e)]);for(let o=3;o=a)throw new Error('"step" requires strictly ascending stop inputs');const l=y(t[o+1],e);s||(s=l.type),i.push([a,l])}return new Ft(s,r,i)}evaluate(t,e){const r=this._stops;if(r.length===1)return r[0][1].evaluate(t,e);const s=this._input.evaluate(t,e);let i=0;for(;++i=s.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return s[r]}}class dt{constructor(t,e){this._key=t,this._obj=e,this.type=C}static parse(t,e){let r,s;switch(t.length){case 2:return r=y(t[1],e),new dt(r);case 3:return r=y(t[1],e),s=y(t[2],e),new dt(r,s);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?this._obj.evaluate(t,e)[r]:t==null?void 0:t.values[r]}}class mt{constructor(t,e){this._key=t,this._obj=e,this.type=P}static parse(t,e){let r,s;switch(t.length){case 2:return r=y(t[1],e),new mt(r);case 3:return r=y(t[1],e),s=y(t[2],e),new mt(r,s);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this._key.evaluate(t,e);return this._obj?r in this._obj.evaluate(t,e):!!(t!=null&&t.values[r])}}class Ct{constructor(t,e){this._key=t,this._vals=e,this.type=P}static parse(t,e){if(t.length!==3)throw new Error('"in" expects 2 arguments');return new Ct(y(t[1],e),y(t[2],e))}evaluate(t,e){const r=this._key.evaluate(t,e);return this._vals.evaluate(t,e).includes(r)}}let Ue=class Pt{constructor(t,e,r){this._item=t,this._array=e,this._from=r,this.type=T}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=y(t[1],e),s=y(t[2],e);if(t.length===4){const i=y(t[3],e,T);return new Pt(r,s,i)}return new Pt(r,s)}evaluate(t,e){const r=this._item.evaluate(t,e),s=this._array.evaluate(t,e);if(this._from){const i=this._from.evaluate(t,e);if(i!==Math.floor(i))throw new Error('"index-of" index must be an integer');return s.indexOf(r,i)}return s.indexOf(r)}};class Yt{constructor(t){this._arg=t,this.type=T}static parse(t,e){if(t.length!==2)throw new Error('"length" expects 2 arguments');const r=y(t[1],e);return new Yt(r)}evaluate(t,e){const r=this._arg.evaluate(t,e);if(typeof r=="string"||Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class wt{constructor(t,e,r,s){this.type=t,this._array=e,this._from=r,this._to=s}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=y(t[1],e),s=y(t[2],e,T);if(s.type!==T)throw new Error('"slice" index must return a number');if(t.length===4){const i=y(t[3],e,T);if(i.type!==T)throw new Error('"slice" index must return a number');return new wt(r.type,r,s,i)}return new wt(r.type,r,s)}evaluate(t,e){const r=this._array.evaluate(t,e);if(!Array.isArray(r)&&typeof r!="string")throw new Error('"slice" input must be an array or a string');const s=this._from.evaluate(t,e);if(s<0||s>=r.length)throw new Error('"slice" index out of bounds');if(s!==Math.floor(s))throw new Error('"slice" index must be an integer');if(this._to){const i=this._to.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');return r.slice(s,i)}return r.slice(s)}}class Ht{constructor(){this.type=P}static parse(t){if(t.length!==1)throw new Error('"has-id" expects no arguments');return new Ht}evaluate(t,e){return(t==null?void 0:t.id)!==void 0}}class B{constructor(t,e){this._args=t,this._calculate=e,this.type=T}static parse(t,e,r){const s=t.slice(1).map(i=>y(i,e));return new B(s,r)}evaluate(t,e){let r;return this._args&&(r=this._args.map(s=>s.evaluate(t,e))),this._calculate(r)}}class Be extends B{static parse(t,e){switch(t.length){case 2:return B.parse(t,e,r=>-r[0]);case 3:return B.parse(t,e,r=>r[0]-r[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class Oe extends B{static parse(t,e){return B.parse(t,e,r=>{let s=1;for(const i of r)s*=i;return s})}}class Ge extends B{static parse(t,e){if(t.length===3)return B.parse(t,e,r=>r[0]/r[1]);throw new Error('"/" expects 2 arguments')}}class ke extends B{static parse(t,e){if(t.length===3)return B.parse(t,e,r=>r[0]%r[1]);throw new Error('"%" expects 2 arguments')}}class $e extends B{static parse(t,e){if(t.length===3)return B.parse(t,e,r=>r[0]**r[1]);throw new Error('"^" expects 1 or 2 arguments')}}class ze extends B{static parse(t,e){return B.parse(t,e,r=>{let s=0;for(const i of r)s+=i;return s})}}class b{constructor(t,e){this._args=t,this._calculate=e,this.type=T}static parse(t,e){const r=t.slice(1).map(s=>y(s,e));return new b(r,b.ops[t[0]])}evaluate(t,e){let r;return this._args&&(r=this._args.map(s=>s.evaluate(t,e))),this._calculate(r)}}b.ops={abs:n=>Math.abs(n[0]),acos:n=>Math.acos(n[0]),asin:n=>Math.asin(n[0]),atan:n=>Math.atan(n[0]),ceil:n=>Math.ceil(n[0]),cos:n=>Math.cos(n[0]),e:()=>Math.E,floor:n=>Math.floor(n[0]),ln:n=>Math.log(n[0]),ln2:()=>Math.LN2,log10:n=>Math.log(n[0])/Math.LN10,log2:n=>Math.log(n[0])/Math.LN2,max:n=>Math.max(...n),min:n=>Math.min(...n),pi:()=>Math.PI,round:n=>Math.round(n[0]),sin:n=>Math.sin(n[0]),sqrt:n=>Math.sqrt(n[0]),tan:n=>Math.tan(n[0])};class jt{constructor(t){this._args=t,this.type=k}static parse(t,e){return new jt(t.slice(1).map(r=>y(r,e)))}evaluate(t,e){return this._args.map(r=>r.evaluate(t,e)).join("")}}class st{constructor(t,e){this._arg=t,this._calculate=e,this.type=k}static parse(t,e){if(t.length!==2)throw new Error(`${t[0]} expects 1 argument`);const r=y(t[1],e);return new st(r,st.ops[t[0]])}evaluate(t,e){return this._calculate(this._arg.evaluate(t,e))}}st.ops={downcase:n=>n.toLowerCase(),upcase:n=>n.toUpperCase()};class qt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==4)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(s=>y(s,e));return new qt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),s=this._validate(this._args[1].evaluate(t,e)),i=this._validate(this._args[2].evaluate(t,e));return new D({r,g:s,b:i})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}}class Kt{constructor(t){this._args=t,this.type=Y}static parse(t,e){if(t.length!==5)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(s=>y(s,e));return new Kt(r)}evaluate(t,e){const r=this._validate(this._args[0].evaluate(t,e)),s=this._validate(this._args[1].evaluate(t,e)),i=this._validate(this._args[2].evaluate(t,e)),o=this._validateAlpha(this._args[3].evaluate(t,e));return new D({r,g:s,b:i,a:o})}_validate(t){if(typeof t!="number"||t<0||t>255)throw new Error(`${t}: invalid color component`);return Math.round(t)}_validateAlpha(t){if(typeof t!="number"||t<0||t>1)throw new Error(`${t}: invalid alpha color component`);return t}}class Wt{constructor(t){this._color=t,this.type=ct(T,4)}static parse(t,e){if(t.length!==2)throw new Error('"to-rgba" expects 1 argument');const r=y(t[1],e);return new Wt(r)}evaluate(t,e){return new D(this._color.evaluate(t,e)).toRgba()}}class K{constructor(t,e){this.type=t,this._args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(`${r} expects at least one argument`);let s,i=1;if(r==="array"){if(t.length>2){switch(t[1]){case"string":s=k;break;case"number":s=T;break;case"boolean":s=P;break;default:throw new Error('"array" type argument must be string, number or boolean')}i++}else s=C;let a;if(t.length>3){if(a=t[2],a!==null&&(typeof a!="number"||a<0||a!==Math.floor(a)))throw new Error('"array" length argument must be a positive integer literal');i++}s=ct(s,a)}else switch(r){case"string":s=k;break;case"number":s=T;break;case"boolean":s=P;break;case"object":s=bt}const o=[];for(;i":xe,">=":Pe,all:Ot,any:Gt,case:$t,coalesce:Se,match:zt,within:null,interpolate:_t,"interpolate-hcl":_t,"interpolate-lab":_t,step:Ft,let:Mt,var:Le,concat:jt,downcase:st,"is-supported-script":null,"resolved-locale":null,upcase:st,rgb:qt,rgba:Kt,"to-rgba":Wt,"-":Be,"*":Oe,"/":Ge,"%":ke,"^":$e,"+":ze,abs:b,acos:b,asin:b,atan:b,ceil:b,cos:b,e:b,floor:b,ln:b,ln2:b,log10:b,log2:b,max:b,min:b,pi:b,round:b,sin:b,sqrt:b,tan:b,zoom:It,"heatmap-density":null,"has-id":Ht,none:kt};class O{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=y(t,null,P);return new O(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t)||t.length===0)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return t.length===3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"in":return t.length>=3&&typeof t[1]=="string"&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e":case"<":case">=":case"<=":return O.convertComparison(e,t[1],t[2]);case"in":return O.convertIn(t[1],t.slice(2));case"!in":return O.negate(O.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return O.convertCombining(e,t.slice(1));case"has":return O.convertHas(t[1]);case"!has":return O.negate(O.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}class Et{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r=t.value==="number";break;default:r=!1}if(e==null&&(e=t.default),Array.isArray(e)&&e.length>0&&fe[e[0]]){const i={number:T,color:Y,string:k,boolean:P,enum:k};try{const o=t.type==="array"?ct(i[t.value]||C,t.length):i[t.type],a=y(e,null,o);this.getValue=this._buildExpression(a,t),this.isDataDriven=!0,a instanceof _t&&a.input instanceof It&&(this.interpolator=a)}catch(o){console.log(o.message),this.getValue=this._buildSimple(t.default)}return}r&&e.type==="interval"&&(r=!1);const s=(e==null?void 0:e.stops)&&e.stops.length>0;if(s)for(const i of e.stops)i[1]=this._validate(i[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(e.default!==void 0&&(e.default=this._validate(e.default,t)),s)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else s?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if(e.type==="number"){if(e.minimum!=null&&te.maximum)return e.maximum}else e.type==="color"?t=Et._parseColor(t):e.type==="enum"?typeof t=="string"&&(t=e.values.indexOf(t)):e.type==="array"&&e.value==="enum"?t=t.map(r=>typeof r=="string"?e.values.indexOf(r):r):e.type==="string"&&(t=xt(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,s)=>{try{const i=t.evaluate(s,r);return i===void 0?e.default:this._validate(i,e)}catch(i){return console.log(i.message),e.default}}}_buildIdentity(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),i!==void 0&&(i=this._validate(i,e)),i??(t.default!==void 0?t.default:e.default)}}_buildCategorical(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),i=this._categorical(i,t.stops),i!==void 0?i:t.default!==void 0?t.default:e.default}}_buildInterval(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),typeof i=="number"?this._interval(i,t.stops):t.default!==void 0?t.default:e.default}}_buildInterpolate(t,e){return(r,s)=>{let i;return s&&(i=s.values[t.property]),typeof i=="number"?this._interpolate(i,t.stops,t.base||1):t.default!==void 0?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let s=0;sthis._create(e,r,s)).filter(e=>!!e),this.layers){let e;for(let r=0;r=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){return this._uidToLayer.get(t)??null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!(t!=null&&t.id))return;const r=this._style;e!=null&&e>=this.layers.length&&(e=this.layers.length-1);let s,i=!0;const o=this._layerByName[t.id];if(o){const a=this.layers.indexOf(o);e||(e=a),e===a?(i=!1,s=at._recreateLayer(t,o),this.layers[e]=s,r.layers[e]=t):(this.layers.splice(a,1),r.layers.splice(a,1),s=this._create(t,e,this.layers),this.layers.splice(e,0,s),r.layers.splice(e,0,t))}else s=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(s),r.layers.push(t)):(this.layers.splice(e,0,s),r.layers.splice(e,0,t));this._layerByName[t.id]=s,this._uidToLayer.set(s.uid,s),i&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},i=at._recreateLayer(s,r),o=this.layers.indexOf(r);this.layers[o]=i,this._style.layers[o].paint=e,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const s={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},i=at._recreateLayer(s,r),o=this.layers.indexOf(r);this.layers[o]=i,this._style.layers[o].layout=e,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const s=r.layout||{};s.visibility=e;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:s,paint:r.paint},o=at._recreateLayer(i,r),a=this.layers.indexOf(r);this.layers[a]=o,this._style.layers[a].layout=s,this._layerByName[r.id]=o,this._uidToLayer.set(r.uid,o)}getStyleLayerVisibility(t){const e=this._layerByName[t];if(!e)return"none";const r=e.layout;return(r==null?void 0:r.visibility)??"visible"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;ri.keyo.key?1:0);const s=t.length;for(let i=0;i{let e=class extends r{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(t,i){const s=i.capabilities&&i.capabilities.split(",").map(Z=>Z.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const l=this.type,y=l!=="tile"&&!!i.supportsDynamicLayers,p=s.includes("query"),d=s.includes("map"),c=!!i.exportTilesAllowed,b=s.includes("tilemap"),I=s.includes("data"),x=l!=="tile"&&(!i.tileInfo||y),O=l!=="tile"&&(!i.tileInfo||y),h=l!=="tile",f=i.cimVersion&&re.parse(i.cimVersion),T=(f==null?void 0:f.since(1,4))??!1,D=(f==null?void 0:f.since(2,0))??!1;return{operations:{supportsExportMap:d,supportsExportTiles:c,supportsIdentify:p,supportsQuery:I,supportsTileMap:b},exportMap:d?{supportsArcadeExpressionForLabeling:T,supportsSublayersChanges:h,supportsDynamicLayers:y,supportsSublayerVisibility:x,supportsSublayerDefinitionExpression:O,supportsCIMSymbols:D}:null,exportTiles:c?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(t,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchRelatedService(t){const i=this.portalItem;if(!i||!B(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},t).then(l=>l.find(y=>y.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return Q(t),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(t,i){var p;const{source:s}=t;if(this!=null&&this.portalItem&&this.type==="tile"&&(s==null?void 0:s.type)==="map-layer"&&B(this.portalItem)&&t.originIdOf("url")u.SERVICE)try{const d=await this._fetchAllLayersAndTablesFromService(l),c=((p=H(l))==null?void 0:p.sublayer)??s.mapLayerId;y=d.get(c)}catch{}else{let d=t.id;(s==null?void 0:s.type)==="map-layer"&&(d=s.mapLayerId);try{y=(await this.fetchAllLayersAndTables(i)).get(d)}catch{}}return y}async fetchAllLayersAndTables(t){var i;return this._fetchAllLayersAndTablesFromService((i=this.parsedUrl)==null?void 0:i.path,t)}async _fetchAllLayersAndTablesFromService(t,i){await this.load(i),this._allLayersAndTablesMap||(this._allLayersAndTablesMap=new Map);const s=H(t),l=ie(this._allLayersAndTablesMap,s==null?void 0:s.url.path,()=>$(W(s==null?void 0:s.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(p=>{const d=new Map;for(const c of p.data.layers)d.set(c.id,c);return{result:d}},p=>({error:p}))),y=await l;if(Q(i),"result"in y)return y.result;throw y.error}};return a([n({readOnly:!0})],e.prototype,"capabilities",void 0),a([g("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),a([n({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),a([n({type:z})],e.prototype,"fullExtent",void 0),a([n(Y)],e.prototype,"id",void 0),a([n({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),a([n(ee)],e.prototype,"popupEnabled",void 0),a([n({type:te})],e.prototype,"spatialReference",void 0),a([n({readOnly:!0})],e.prototype,"version",void 0),a([g("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=a([k("esri.layers.mixins.ArcGISMapService")],e),e};var A;function j(r){return r!=null&&r.type==="esriSMS"}function M(r,e,t){var s;const i=this.originIdOf(e)>=L(t.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!t&&((s=t.layer)==null?void 0:s.type)==="map-image"&&(t.writeSublayerStructure||i)}}function C(r,e,t){var i;return{enabled:!!t&&((i=t.layer)==null?void 0:i.type)==="tile"&&(t.origin&&this.originIdOf(e)>=L(t.origin)||this._isOverridden(e))}}function m(r,e,t){return{ignoreOrigin:!0,enabled:t&&t.writeSublayerStructure||!1}}function P(r,e,t){return{ignoreOrigin:!0,enabled:!!t&&(t.writeSublayerStructure||this.originIdOf(e)>=L(t.origin))}}let je=0;const v=new Set;v.add("layer"),v.add("parent"),v.add("loaded"),v.add("loadStatus"),v.add("loadError"),v.add("loadWarnings");let o=A=class extends se(ae(xe)){constructor(r){super(r),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(r){return this.addResolvingPromise((async()=>{const{layer:e,url:t}=this;if(!e&&!t)throw new S("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=e?await e.fetchSublayerInfo(this,r):(await $(t,{responseType:"json",query:{f:"json"},...r})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service"}))})()),this}readCapabilities(r,e){e=e.layerDefinition||e;const{operations:{supportsQuery:t,supportsQueryAttachments:i},query:{supportsFormatPBF:s},data:{supportsAttachment:l}}=Ve(e,this.url);return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:t,supportsQueryAttachments:i},data:{supportsAttachment:l},query:{supportsFormatPBF:s}}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(r){this._setAndNotifyLayer("definitionExpression",r)}get effectiveScaleRange(){const{minScale:r,maxScale:e}=this;return{minScale:r,maxScale:e}}readMaxScaleRange(r,e){return{minScale:(e=e.layerDefinition||e).minScale??0,maxScale:e.maxScale??0}}get fieldsIndex(){return new le(this.fields||[])}set floorInfo(r){this._setAndNotifyLayer("floorInfo",r)}readGlobalIdFieldFromService(r,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeGlobalID")return t.name}}get id(){return this._get("id")??je++}set id(r){var e,t,i;this._get("id")!==r&&(((i=(t=(e=this.layer)==null?void 0:e.capabilities)==null?void 0:t.exportMap)==null?void 0:i.supportsDynamicLayers)!==!1?this._set("id",r):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(r){this._setAndNotifyLayer("labelingInfo",r)}writeLabelingInfo(r,e,t,i){r&&r.length&&(e.layerDefinition={drawingInfo:{labelingInfo:r.map(s=>s.write({},i))}})}set labelsVisible(r){this._setAndNotifyLayer("labelsVisible",r)}set layer(r){this._set("layer",r),this.sublayers&&this.sublayers.forEach(e=>e.layer=r)}set listMode(r){this._set("listMode",r)}set minScale(r){this._setAndNotifyLayer("minScale",r)}readMinScale(r,e){var t;return e.minScale||((t=e.layerDefinition)==null?void 0:t.minScale)||0}set maxScale(r){this._setAndNotifyLayer("maxScale",r)}readMaxScale(r,e){var t;return e.maxScale||((t=e.layerDefinition)==null?void 0:t.maxScale)||0}readObjectIdFieldFromService(r,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const t of e.fields)if(t.type==="esriFieldTypeOID")return t.name}}set opacity(r){this._setAndNotifyLayer("opacity",r)}readOpacity(r,e){var i;const t=e.layerDefinition;return 1-.01*(((t==null?void 0:t.transparency)!=null?t.transparency:(i=t==null?void 0:t.drawingInfo)==null?void 0:i.transparency)??0)}writeOpacity(r,e,t,i){e.layerDefinition={drawingInfo:{transparency:100-100*r}}}writeParent(r,e){this.parent&&this.parent!==this.layer?e.parentLayerId=oe(this.parent.id):e.parentLayerId=-1}get queryTask(){var y;if(!this.layer)return null;const{spatialReference:r}=this.layer,e="gdbVersion"in this.layer?this.layer.gdbVersion:void 0,{capabilities:t,fieldsIndex:i}=this,s=ne("featurelayer-pbf")&&(t==null?void 0:t.query.supportsFormatPBF),l=((y=t==null?void 0:t.operations)==null?void 0:y.supportsQueryAttachments)??!1;return new _e({url:this.url,pbfSupported:s,fieldsIndex:i,gdbVersion:e,sourceSpatialReference:r,queryAttachmentsSupported:l})}set renderer(r){if(r){for(const e of r.getSymbols())if(ye(e)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",r)}get source(){return this._get("source")||new R({mapLayerId:this.id})}set source(r){this._setAndNotifyLayer("source",r)}set sublayers(r){this._handleSublayersChange(r,this._get("sublayers")),this._set("sublayers",r)}castSublayers(r){return pe(U.ofType(A),r)}writeSublayers(r,e,t){var i;(i=this.sublayers)!=null&&i.length&&(e[t]=this.sublayers.map(s=>s.id).toArray().reverse())}readTitle(r,e){var t;return((t=e.layerDefinition)==null?void 0:t.name)??e.name}readTypeIdField(r,e){let t=(e=e.layerDefinition||e).typeIdField;if(t&&e.fields){t=t.toLowerCase();const i=e.fields.find(s=>s.name.toLowerCase()===t);i&&(t=i.name)}return t}get url(){var i;const r=((i=this.layer)==null?void 0:i.parsedUrl)??this._lastParsedUrl,e=this.source;if(!r)return null;if(this._lastParsedUrl=r,(e==null?void 0:e.type)==="map-layer")return`${r.path}/${e.mapLayerId}`;const t={layer:JSON.stringify({source:this.source})};return`${r.path}/dynamicLayer?${ue(t)}`}set url(r){this._overrideIfSome("url",r)}set visible(r){this._setAndNotifyLayer("visible",r)}writeVisible(r,e,t,i){e[t]=this.getAtOrigin("defaultVisibility","service")||r}clone(){const{store:r}=_(this),e=new A;return _(e).store=r.clone(v),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(r){return de(this,r)}createQuery(){return new ce({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){var s;if(this.hasOwnProperty("sublayers"))return null;const r=(await he(()=>import("./FeatureLayer--S4epFk-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))).default,{layer:e,url:t}=this;let i;if(t&&this.originIdOf("url")>u.SERVICE)i=new r({url:t});else{if(!(e!=null&&e.parsedUrl))throw new S("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const l=e.parsedUrl;i=new r({url:l.path}),l&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return(e==null?void 0:e.refreshInterval)!=null&&(i.refreshInterval=e.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=F(this.floorInfo)),this.originIdOf("labelingInfo")>u.SERVICE&&(i.labelingInfo=F(this.labelingInfo)),this.originIdOf("labelsVisible")>u.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>u.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>u.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>u.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>u.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>u.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>u.DEFAULTS&&(i.popupTemplate=F(this.popupTemplate)),this.originIdOf("renderer")>u.SERVICE&&(i.renderer=F(this.renderer)),((s=this.source)==null?void 0:s.type)==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>u.DEFAULTS&&(i.title=this.title),(e==null?void 0:e.type)==="map-image"&&e.originIdOf("customParameters")>u.DEFAULTS&&(i.customParameters=e.customParameters),(e==null?void 0:e.type)==="tile"&&e.originIdOf("customParameters")>u.DEFAULTS&&(i.customParameters=e.customParameters),i}getField(r){return this.fieldsIndex.get(r)}getFeatureType(r){const{typeIdField:e,types:t}=this;if(!e||!r)return null;const i=r.attributes?r.attributes[e]:void 0;if(i==null)return null;let s=null;return t==null||t.some(l=>{const{id:y}=l;return y!=null&&(y.toString()===i.toString()&&(s=l),!!s)}),s}getFieldDomain(r,e){const t=e==null?void 0:e.feature,i=this.getFeatureType(t);if(i){const s=i.domains&&i.domains[r];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(r)}async queryAttachments(r,e){var b,I;await this.load(),r=fe.from(r);const t=this.capabilities;if(!((b=t==null?void 0:t.data)!=null&&b.supportsAttachment))throw new S("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:l,num:y,size:p,start:d,where:c}=r;if(!((I=t==null?void 0:t.operations)!=null&&I.supportsQueryAttachments)&&((i==null?void 0:i.length)>0||(l==null?void 0:l.length)>0||(p==null?void 0:p.length)>0||y||d||c))throw new S("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",r);if(!(s!=null&&s.length||l!=null&&l.length||c))throw new S("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",r);return this.queryTask.executeAttachmentQuery(r,e)}async queryFeatures(r=this.createQuery(),e){var i,s;if(await this.load(),!this.capabilities.operations.supportsQuery)throw new S("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new S("queryFeatures:not-supported","this layer has no url.");const t=await this.queryTask.execute(r,{...e,query:{...(i=this.layer)==null?void 0:i.customParameters,token:(s=this.layer)==null?void 0:s.apiKey}});if(t!=null&&t.features)for(const l of t.features)l.sourceLayer=this;return t}toExportImageJSON(r){var l,y;const e={id:this.id,source:((l=this.source)==null?void 0:l.toJSON())||{mapLayerId:this.id,type:"mapLayer"}},t=be(r,this.definitionExpression);t!=null&&(e.definitionExpression=t);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((p,d)=>(p[d]=this.originIdOf(d),p),{});if(Object.keys(i).some(p=>i[p]>u.SERVICE)){const p=e.drawingInfo={};if(i.renderer>u.SERVICE&&(p.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>u.SERVICE&&(p.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>u.SERVICE)if(this.labelingInfo){!this.loaded&&((y=this.labelingInfo)!=null&&y.some(c=>!c.labelPlacement))&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let d=this.labelingInfo;this.geometryType!=null&&(d=me(this.labelingInfo,q.toJSON(this.geometryType))),p.showLabels=!0,p.labelingInfo=d.filter(c=>c.labelPlacement).map(c=>c.toJSON({origin:"service",layer:this.layer}))}else p.showLabels=!1;i.opacity>u.SERVICE&&(p.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(p.renderer)}return e}_assignDefaultSymbolColors(r){this._forEachSimpleMarkerSymbols(r,e=>{var t;e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||((t=e.outline)!=null&&t.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(r,e){if(r){const t=("uniqueValueInfos"in r?r.uniqueValueInfos:"classBreakInfos"in r?r.classBreakInfos:null)??[];for(const i of t)j(i.symbol)&&e(i.symbol);"symbol"in r&&j(r.symbol)&&e(r.symbol),"defaultSymbol"in r&&j(r.defaultSymbol)&&e(r.defaultSymbol)}}_setAndNotifyLayer(r,e){var p,d,c,b;const t=this.layer,i=this._get(r);let s,l;switch(r){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",l="supportsModification"}const y=_(this).getDefaultOrigin();if(y!=="service"){if(s&&((c=(d=(p=this.layer)==null?void 0:p.capabilities)==null?void 0:d.exportMap)==null?void 0:c[s])===!1)return void this._logLockedError(r,`capability not available 'layer.capabilities.exportMap.${s}'`);if(l&&((b=this.capabilities)==null?void 0:b.exportMap[l])===!1)return void this._logLockedError(r,`capability not available 'capabilities.exportMap.${l}'`)}r!=="source"||this.loadStatus==="not-loaded"?(this._set(r,e),y!=="service"&&i!==e&&t&&t.emit&&t.emit("sublayer-update",{propertyName:r,target:this})):this._logLockedError(r,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(r,e){e&&(e.forEach(t=>{t.parent=null,t.layer=null}),this.removeAllHandles()),r&&(r.forEach(t=>{t.parent=this,t.layer=this.layer}),this.addHandles([r.on("after-add",({item:t})=>{t.parent=this,t.layer=this.layer}),r.on("after-remove",({item:t})=>{t.parent=null,t.layer=null}),r.on("before-changes",t=>{var s,l,y;const i=(y=(l=(s=this.layer)==null?void 0:s.capabilities)==null?void 0:l.exportMap)==null?void 0:y.supportsSublayersChanges;i==null||i||(E.getLogger(this).error(new S("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),t.preventDefault())})]))}_logLockedError(r,e){const{layer:t,declaredClass:i}=this;E.getLogger(i).error(new S("sublayer:locked",`Property '${String(r)}' can't be changed on Sublayer from the layer '${t==null?void 0:t.id}'`,{reason:e,sublayer:this,layer:t}))}_getLayerDomain(r){const e=this.fieldsIndex.get(r);return e?e.domain:null}};o.test={isMapImageLayerOverridePolicy:r=>r===m||r===M,isTileImageLayerOverridePolicy:r=>r===C},a([n({readOnly:!0})],o.prototype,"capabilities",void 0),a([g("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([n()],o.prototype,"defaultPopupTemplate",null),a([n({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:M}}})],o.prototype,"definitionExpression",null),a([n({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([g("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([n({type:[ge],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([n({readOnly:!0})],o.prototype,"fieldsIndex",null),a([n({type:Se,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:M},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([n({type:z,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([n({type:q.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:q.read}}}}})],o.prototype,"geometryType",void 0),a([n({type:String})],o.prototype,"globalIdField",void 0),a([g("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([n({type:V,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([n({value:null,type:[Ie],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:m}}})],o.prototype,"labelingInfo",null),a([w("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([n({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:m}}})],o.prototype,"labelsVisible",null),a([n({value:null})],o.prototype,"layer",null),a([n({type:String,json:{write:{overridePolicy:C}}})],o.prototype,"layerItemId",void 0),a([n({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([n({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([n({type:Number,value:0,json:{write:{overridePolicy:m}}})],o.prototype,"minScale",null),a([g("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([n({type:Number,value:0,json:{write:{overridePolicy:m}}})],o.prototype,"maxScale",null),a([g("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([n({type:String})],o.prototype,"objectIdField",void 0),a([g("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([n({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:m}}})],o.prototype,"opacity",null),a([g("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([w("opacity")],o.prototype,"writeOpacity",null),a([n({json:{type:V,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:m}}})],o.prototype,"parent",void 0),a([w("parent")],o.prototype,"writeParent",null),a([n({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(r,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(r,e,t){e[t]=!r}}}})],o.prototype,"popupEnabled",void 0),a([n({type:ve,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([n({readOnly:!0})],o.prototype,"queryTask",null),a([n({types:we,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m},origins:{"web-scene":{types:Ee,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:m}}}}})],o.prototype,"renderer",null),a([n({types:{key:"type",base:null,typeMap:{"data-layer":G,"map-layer":R}},cast(r){if(r){if("mapLayerId"in r)return K(R,r);if("dataSource"in r)return K(G,r)}return r},json:{name:"layerDefinition.source",write:{overridePolicy:m}}})],o.prototype,"source",null),a([n()],o.prototype,"sourceJSON",void 0),a([n({value:null,json:{type:[V],write:{target:"subLayerIds",allowNull:!0,overridePolicy:m}}})],o.prototype,"sublayers",null),a([Le("sublayers")],o.prototype,"castSublayers",null),a([w("sublayers")],o.prototype,"writeSublayers",null),a([n({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([g("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([n({type:String})],o.prototype,"typeIdField",void 0),a([n({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([g("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([n({type:[Ae],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([n({type:String,json:{name:"layerUrl",write:{overridePolicy:C}}})],o.prototype,"url",null),a([n({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:m}}})],o.prototype,"visible",null),a([w("visible")],o.prototype,"writeVisible",null),o=A=a([k("esri.layers.support.Sublayer")],o);const J=o,Me=E.getLogger("esri.layers.TileLayer");function Ce(r,e){const t=[],i={};return r&&r.forEach(s=>{const l=new J;if(l.read(s,e),i[l.id]=l,s.parentLayerId!=null&&s.parentLayerId!==-1){const y=i[s.parentLayerId];y.sublayers||(y.sublayers=[]),y.sublayers.unshift(l)}else t.unshift(l)}),t}const N=U.ofType(J);function X(r,e){r&&r.forEach(t=>{e(t),t.sublayers&&t.sublayers.length&&X(t.sublayers,e)})}const Ue=r=>{let e=class extends r{constructor(...t){super(...t),this.allSublayers=new Oe({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[u.SERVICE]:{},[u.PORTAL_ITEM]:{},[u.WEB_SCENE]:{},[u.WEB_MAP]:{}},this.addHandles(Te(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),De))}destroy(){this.allSublayers.destroy()}readSublayers(t,i){if(!i||!t)return;const{sublayersSourceJSON:s}=this,l=L(i.origin);if(lu.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:y,origin:p}=this.createSublayersForOrigin("web-document"),d=_(this);d.setDefaultOrigin(p),this._set("sublayers",new N(y)),d.setDefaultOrigin("user")}findSublayerById(t){return this.allSublayers.find(i=>i.id===t)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(t){const i=L(t==="web-document"?"web-map":t);let s=u.SERVICE,l=this.sublayersSourceJSON[u.SERVICE].layers,y=this.sublayersSourceJSON[u.SERVICE].context,p=null;const d=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(h=>h<=i);for(const h of d){const f=this.sublayersSourceJSON[h];Fe(f.layers)&&(s=h,l=f.layers,y=f.context,f.visibleLayers&&(p={visibleLayers:f.visibleLayers,context:f.context}))}const c=[u.PORTAL_ITEM,u.WEB_SCENE,u.WEB_MAP].filter(h=>h>s&&h<=i);let b=null;for(const h of c){const{layers:f,visibleLayers:T,context:D}=this.sublayersSourceJSON[h];f&&(b={layers:f,context:D}),T&&(p={visibleLayers:T,context:D})}const I=Ce(l,y),x=new Map,O=new Set;if(b)for(const h of b.layers)x.set(h.id,h);if(p!=null&&p.visibleLayers)for(const h of p.visibleLayers)O.add(h);return X(I,h=>{b&&h.read(x.get(h.id),b.context),p&&h.read({defaultVisibility:O.has(h.id)},p.context)}),{origin:Pe(s),sublayers:new N({items:I})}}read(t,i){super.read(t,i),this.readSublayers(t,i)}_handleSublayersChange(t,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.removeHandles("sublayers-owner")),t&&(t.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([t.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),t.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.addHandles(t.on("before-changes",s=>{Me.error(new S("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([n({readOnly:!0})],e.prototype,"allSublayers",void 0),a([n({readOnly:!0,type:U.ofType(J)})],e.prototype,"serviceSublayers",void 0),a([n({value:null,type:N,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),a([n({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=a([k("esri.layers.mixins.SublayersOwner")],e),e};export{Ue as E,J as X,ke as f}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/FeatureLayer--S4epFk-.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/FeatureLayerBase-jpFp8gE3.js","assets/serviceCapabilitiesUtils-26KpT1VN.js","assets/editsZScale-Wgw9kbYG.js","assets/queryZScale-IaMm02_2.js","assets/FeatureSet-d4S1oKME.js","assets/CustomParametersMixin-Y1bOcayO.js","assets/FeatureEffectLayer-oBa8pIG5.js","assets/FeatureEffect-5bEV-xG1.js","assets/FeatureReductionLayer-RlitE1N6.js","assets/OrderedLayer-M7k5gLgx.js","assets/FeatureTemplate-kUgbbA00.js","assets/FeatureType-MpRe7WJj.js","assets/versionUtils-4v9zIDlv.js","assets/TopFeaturesQuery-E6D2tV-x.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SubtypeGroupLayer-xK5RtU9X.js b/dist/assets/SubtypeGroupLayer-xK5RtU9X.js new file mode 100644 index 0000000..ce6e4e4 --- /dev/null +++ b/dist/assets/SubtypeGroupLayer-xK5RtU9X.js @@ -0,0 +1,7 @@ +import{jf as W,dP as R,dq as k,m as X,bI as j,dD as Y,Z as ee,iF as te,jg as A,E as b,il as re,jh as N,ji as L,ep as M,ca as Q,e as i,y as n,du as ie,iI as se,iJ as ne,iK as ae,dV as oe,je as le,jd as ue,iu as pe,iv as de,dt as I,c as U,jj as ye,jk as ce,jl as he,ix as H,jm as be,jn as fe,jo as me,ij as ge,jp as ve,dK as we,el as je,dO as Se,dL as Fe,em as Ie,dM as Oe,dN as $e,en as Ee,V as _,ah as Te,d as Ce,C as _e,dQ as Ae,jq as Le,jr as xe,bV as Pe,h6 as Ge,js as Ve,jt as qe,ju as De,jv as Re,gG as ke,de as x,jw as Ne,jx as Me,ew as Qe,jy as Ue,jz as He,jA as Be,jB as Je,jC as ze,jD as Ke,jc as E,iG as Ze,jE as We,dU as Xe,eo as P,jF as Ye,c7 as et}from"./index-J0iiHjMT.js";import{o as tt}from"./CustomParametersMixin-Y1bOcayO.js";import{y as rt,D as it}from"./FeatureLayerBase-jpFp8gE3.js";import{p as B}from"./FeatureTemplate-kUgbbA00.js";import{e as st}from"./versionUtils-4v9zIDlv.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";const nt=["charts","editingEnabled","formTemplate","labelsVisible","labelingInfo","legendEnabled","minScale","maxScale","opacity","popupEnabled","popupTemplate","renderer","subtypeCode","templates","title","visible"],J={key:"type",base:ye,errorContext:"renderer",typeMap:{simple:A,"unique-value":ce,"class-breaks":he}},G=H(),V=W({types:J});let at=0;function F(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function ot(e){return new A({symbol:lt(e)})}function lt(e){switch(e){case"point":case"multipoint":return me.clone();case"polyline":return fe.clone();case"polygon":case"multipatch":return be.clone();default:return null}}function ut(e,t){return!!t&&(e==null?void 0:e.type)==="unique-value"&&typeof e.field=="string"&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function z(e,t){var r;return e==null?null:(r=t.subtypes)==null?void 0:r.find(s=>s.code===e)}function pt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const s={},a=z(e,t);if(a!=null){const{defaultValues:o}=a;for(const u in o)s[u]=o[u]}return s[t.subtypeField]=e,new B({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}const K="esri.layers.support.SubtypeSublayer";let l=class extends R(k(X(ge))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${at++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}get capabilities(){var e;return(e=this.parent)==null?void 0:e.capabilities}get effectiveCapabilities(){var e;return(e=this.parent)==null?void 0:e.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){var e;return(e=this.parent)==null?void 0:e.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:a}=this;let o;if(s){o=[];let u=0;s.forEach(({name:y,alias:c,editable:m,visible:g})=>{var O;if(!g)return;const d=(O=a==null?void 0:a.fields)==null?void 0:O.find(S=>S.name===y);if(!d)return;const f={name:y};let w=!1;c!==d.alias&&(f.alias=c,w=!0),m!==d.editable&&(f.editable=m,w=!0),o.push(f),w&&u++}),u===0&&o.length===s.length&&(o=null)}else o=j(e);o!=null&&o.length&&Y(r,o,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e==null?void 0:e.fields;if(!e||!(s!=null&&s.length))return null;const{subtypes:a,subtypeField:o}=e,u=a==null?void 0:a.find(g=>g.code===r),y=u==null?void 0:u.defaultValues,c=u==null?void 0:u.domains,m=[];for(const g of s){const d=g.clone(),{name:f}=d,w=t==null?void 0:t.find($=>$.name===f);if(d.visible=!t||!!w,w){const{alias:$,editable:Z}=w;$&&(d.alias=$),Z===!1&&(d.editable=!1)}const O=(y==null?void 0:y[f])??null;d.defaultValue=f===o?r:O;const S=(c==null?void 0:c[f])??null;d.domain=f===o?null:S?S.type==="inherited"?d.domain:S.clone():null,m.push(d)}return m}get floorInfo(){var e;return(e=this.parent)==null?void 0:e.floorInfo}get geometryType(){var e;return(e=this.parent)==null?void 0:e.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){var e;return this.parent||ee.getLogger(K).error(v("objectIdField")),(e=this.parent)==null?void 0:e.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){te(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?ot(e.geometryType):null}readRendererFromService(e,t,r){var y,c,m;if(t.type==="Table")return null;const s=(y=t.drawingInfo)==null?void 0:y.renderer,a=V(s,t,r);let o;const{subtypeCode:u}=this;if(u!=null&&ut(a,t.subtypeField)){const g=(c=a.uniqueValueInfos)==null?void 0:c.find(({value:d})=>(d=typeof d=="number"?String(d):d)===String(u));g&&(o=new A({symbol:g.symbol}))}else(a==null?void 0:a.type)!=="simple"||(m=a.visualVariables)!=null&&m.length||(o=a);return o}readRenderer(e,t,r){var o,u,y;const s=(u=(o=t==null?void 0:t.layerDefinition)==null?void 0:o.drawingInfo)==null?void 0:u.renderer;return s?((y=s.visualVariables)==null?void 0:y.some(c=>c.type!=="rotationInfo"))?void 0:V(s,t,r)||void 0:void 0}get spatialReference(){var e;return(e=this.parent)==null?void 0:e.spatialReference}readTemplatesFromService(e,t){return[pt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=z(this.subtypeCode,t);return r!=null?r.name:null}get url(){var e;return(e=this.parent)==null?void 0:e.url}get userHasUpdateItemPrivileges(){var e;return!!((e=this.parent)!=null&&e.userHasUpdateItemPrivileges)}async addAttachment(e,t){const{parent:r}=this;if(!r)throw v("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw v("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw v("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw v("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:a}=this;if(r){const{displayField:o,editFieldsInfo:u,objectIdField:y}=r;t={displayField:o,editFieldsInfo:u,fields:s,objectIdField:y,title:a}}return re(t,e)}createQuery(){if(!this.parent)throw v("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=L(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}hasUserOverrides(){return nt.some(e=>this.originIdOf(e)===M.USER)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw v("queryAttachments");const s=e.clone();return s.where=q(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw v("queryFeatures");const s=Q.from(e)??r.createQuery();return e!=null&&(s.where=q(s.where,r.parent.subtypeField,r.subtypeCode)),r.parent.queryFeatures(s,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([n({readOnly:!0,json:{read:!1}})],l.prototype,"capabilities",null),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"effectiveCapabilities",null),i([n({json:{write:{ignoreOrigin:!0}}})],l.prototype,"charts",void 0),i([n({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],l.prototype,"editingEnabled",void 0),i([n({type:Boolean,readOnly:!0})],l.prototype,"effectiveEditingEnabled",null),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"elevationInfo",null),i([n({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],l.prototype,"fieldOverrides",void 0),i([ie("fieldOverrides")],l.prototype,"writeFieldOverrides",null),i([n({...G.fields,readOnly:!0,json:{read:!1}})],l.prototype,"fields",null),i([n(G.fieldsIndex)],l.prototype,"fieldsIndex",void 0),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"floorInfo",null),i([n({type:rt,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],l.prototype,"formTemplate",void 0),i([n({type:String,clonable:!1,readOnly:!0,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],l.prototype,"id",void 0),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"geometryType",null),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),i([n(F(j(se)))],l.prototype,"labelsVisible",void 0),i([n({type:[ne],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:ae},write:{ignoreOrigin:!0}}})],l.prototype,"labelingInfo",void 0),i([n({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],l.prototype,"layerType",void 0),i([n(F(j(oe)))],l.prototype,"legendEnabled",void 0),i([n({type:["show","hide"]})],l.prototype,"listMode",void 0),i([n((()=>{const e=j(le);return e.json.origins.service.read=!1,F(e)})())],l.prototype,"minScale",void 0),i([n((()=>{const e=j(ue);return e.json.origins.service.read=!1,F(e)})())],l.prototype,"maxScale",void 0),i([n({readOnly:!0})],l.prototype,"effectiveScaleRange",null),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"objectIdField",null),i([n({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],l.prototype,"opacity",void 0),i([n({clonable:!1})],l.prototype,"parent",void 0),i([n(F(j(pe)))],l.prototype,"popupEnabled",void 0),i([n({type:de,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],l.prototype,"popupTemplate",void 0),i([n({readOnly:!0})],l.prototype,"defaultPopupTemplate",null),i([n({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],l.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],l.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],l.prototype,"readRenderer",null),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"spatialReference",null),i([n({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],l.prototype,"subtypeCode",void 0),i([n({type:[B],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],l.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],l.prototype,"readTemplatesFromService",null),i([n({type:String,json:{write:{ignoreOrigin:!0}}})],l.prototype,"title",void 0),i([I("service","title",["subtypes"])],l.prototype,"readTitleFromService",null),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"url",null),i([n({readOnly:!0})],l.prototype,"userHasUpdateItemPrivileges",null),i([n({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],l.prototype,"visible",void 0),l=i([U(K)],l);const q=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),a=`${t}=${r}`,o=e??"";return s.test(o)?o.replace(s,a):L(a,o)},v=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=l,h="SubtypeGroupLayer",dt="esri.layers.SubtypeGroupLayer";function D(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const C=H();let p=class extends it(ve(we(je(Se(Fe(Ie(Oe($e(R(tt(Ee(k(et))))))))))))){constructor(...e){super(...e),this._sublayersCollectionChanged=!1,this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(_.ofType(T)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=Te(async(t,r,s)=>{const{save:a,saveAs:o}=await x(()=>import("./featureLayerUtils-o55B7eEP.js"),__vite__mapDeps([0,1,2,3,4,5,6]));switch(t){case E.SAVE:return a(this,r);case E.SAVE_AS:return o(this,s,r)}}),this.addHandles(Ce(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),_e))}destroy(){var e;(e=this.source)==null||e.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(Ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Le(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return xe(this)}get parsedUrl(){const e=Pe(this.url);return e!=null&&this.layerId!=null&&(e.path=Ge(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?Ve(this.url,t):t}async addAttachment(e,t){return qe(this,e,t,h)}async updateAttachment(e,t,r){return De(this,e,t,r,h)}async applyEdits(e,t){return Re(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ke(x(()=>import("./FeatureLayerSource-AZE5JEq3.js"),__vite__mapDeps([7,1,2,8,9,10,11,12,13,14,15,16,17,18,19,20,21])),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=L(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return Ne(this,e,t,h)}async fetchRecomputedExtents(e){return Me(this,e,h)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return Qe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Ue(this,e,t,h)}async queryFeatures(e,t){const r=await this.load(),s=Q.from(e)??r.createQuery(),a=s.outFields??[];a.includes(this.subtypeField)||(a.push(this.subtypeField),s.outFields=a);const o=await r.source.queryFeatures(s,t);if(o!=null&&o.features)for(const u of o.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return o}async queryObjectIds(e,t){return He(this,e,t,h)}async queryFeatureCount(e,t){return Be(this,e,t,h)}async queryExtent(e,t){return Je(this,e,t,h)}async queryRelatedFeatures(e,t){return ze(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return Ke(this,e,t,h)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){var o;const{origin:r,layerContainerType:s,messages:a}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return a==null||a.push(D(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return a==null||a.push(D(this,"using a non-table source cannot be written to tables in web maps")),null;return(o=this.sublayers)!=null&&o.length?super.write(e,t):(a==null||a.push(new b("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&st(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){var r;this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new b("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!((r=this.subtypes)!=null&&r.length))throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),Ze(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return We(this)}_verifyFields(){var t,r;const e=((t=this.parsedUrl)==null?void 0:t.path)??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||(r=this.fields)!=null&&r.some(s=>s.type==="geometry")||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this._sublayersCollectionChanged=!1,this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)}),e.on("after-changes",()=>{this._sublayersCollectionChanged=!0})],"sublayers-owner"))}};i([n({readOnly:!0})],p.prototype,"createQueryVersion",null),i([n({readOnly:!0})],p.prototype,"editingEnabled",null),i([n({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([n({...C.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([n(C.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([n(Xe)],p.prototype,"id",void 0),i([n({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([n({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([n(C.outFields)],p.prototype,"outFields",void 0),i([n({readOnly:!0})],p.prototype,"parsedUrl",null),i([n({clonable:!1})],p.prototype,"source",null),i([n({type:_.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const s=e.map(({code:a})=>{const o=new T({subtypeCode:a});return o.read(t,r),o});return new(_.ofType(T))(s)}}}},name:"layers",write:{overridePolicy(e,t,r){const s=this.originOf("sublayers"),a=M.PORTAL_ITEM;let o=!0;if(P(s)===a&&P(r.origin)>a){const u=e.some(y=>y.hasUserOverrides());o=this._sublayersCollectionChanged||u}return{enabled:o,ignoreOrigin:!0}}}}})],p.prototype,"sublayers",void 0),i([n({type:Ye})],p.prototype,"timeInfo",void 0),i([n({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([n({json:{read:!1}})],p.prototype,"type",void 0),p=i([U(dt)],p);const gt=p;export{gt as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/featureLayerUtils-o55B7eEP.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/utils-rBsg-VY8.js","assets/jsonContext-cWV_-jAj.js","assets/fetchService-wPWKuma6.js","assets/requestPresets-18nzHK5y.js","assets/FeatureLayerSource-AZE5JEq3.js","assets/External-GV0jSEES.js","assets/editingSupport-EiPa9PKq.js","assets/clientSideDefaults-F-CNnR0g.js","assets/QueryEngineCapabilities-PzVpW5yD.js","assets/QueryTask-91TvtrTt.js","assets/executeForIds-wXO8-pll.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/queryZScale-IaMm02_2.js","assets/executeQueryJSON-ACj9qY0y.js","assets/FeatureSet-d4S1oKME.js","assets/executeQueryPBF-vdaOUMid.js","assets/editsZScale-Wgw9kbYG.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/SymbolProcessor-pXDjnfSh.js b/dist/assets/SymbolProcessor-pXDjnfSh.js new file mode 100644 index 0000000..721e439 --- /dev/null +++ b/dist/assets/SymbolProcessor-pXDjnfSh.js @@ -0,0 +1,7 @@ +import{uX as Ki,uW as Mt,wp as Q,wq as ee,wr as me,ws as Xe,gO as v,hL as et,wt as gt,wu as Xt,wv as pe,pa as Ir,E as bt,l1 as Pr,ww as K,Z as St,bm as Gi,wx as $r,wy as Bt,e_ as Cr,kk as He,me as Ft,wz as L,bH as Er,de as ke,wA as Ye,wB as qe,wC as je,f as Ae,g as Qe,gu as Wr,e3 as Vr,ve as kr,wD as Ar,e as Rr,c as Br,c4 as Fr,vd as Je,s as Lt,ar as Or,iZ as Dr}from"./index-J0iiHjMT.js";import{c as Kr,i as Zi,g as Gr,f as Zr,s as Nr,h as Ni,k as Ui,m as ye,o as Ur,p as Xr,q as Hr,V as Yr,j as qr}from"./cimAnalyzer-DtyBzAGI.js";import{f as jr,R as xe,k as Qr,G as Jr,p as Xi}from"./Pipeline--6jAENf8.js";import{E as b,S as A,L as G,A as Ot}from"./enums-uQoFEhYh.js";import{d as ge,f as ts,c as ut,w as es,b as Hi,m as E,q as is,g as k,h as rs,n as Yi,l as qi,p as it,i as ss,x as ji,j as Qi,$ as ns,k as as,o as Ji,s as ie,u as tr,v as er,y as tt,z as W,A as Ht,B as Yt}from"./definitions-DqQMJYPH.js";import{o as os,p as hs}from"./BaseProcessor-nWGHAt7P.js";import{r as ls,c as cs,i as ti}from"./TurboLine-SWK4qRwh.js";import{x as P,w as M}from"./number-sTjsTbdA.js";import{a as re}from"./labelPoint-ysDT9nFH.js";import{t as us}from"./Rect-bBBxMtVp.js";import{c as ve}from"./GeometryUtils-K2DOc0l8.js";import{e as ir,t as rr}from"./TileClipper-NSFZXMR1.js";function $(s){if(!s)return 0;const{r:t,g:e,b:i,a:r}=s;return P(t*r,e*r,i*r,255*r)}function O(s){if(!s)return 0;const[t,e,i,r]=s;return P(t*(r/255),e*(r/255),i*(r/255),r)}let zt=class Me{constructor(t,e,i,r){this.center=Ki(t,e),this.centerT=Mt(),this.halfWidth=i/2,this.halfHeight=r/2,this.width=i,this.height=r}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new Me(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const i=Math.abs(t.centerT[0]-this.centerT[0]),r=Math.abs(t.centerT[1]-this.centerT[1]),n=(t.halfWidth+this.halfWidth+e)/i,a=(t.halfHeight+this.halfHeight+e)/r,o=Math.min(n,a);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),i=Math.min(this.ymin,t.ymin),r=Math.max(this.xmax,t.xmax)-e,n=Math.max(this.ymax,t.ymax)-i,a=e+r/2,o=i+n/2;this.width=r,this.height=n,this.halfWidth=r/2,this.halfHeight=n/2,this.x=a,this.y=o}static deserialize(t){const e=t.readF32(),i=t.readF32(),r=t.readInt32(),n=t.readInt32();return new Me(e,i,r,n)}};const Re=26,sr=4,ds=Re+sr,fs=Re-6,ei=3,V=8,_s=Math.PI/180,ms=8,ii=1.5;let nr=class{constructor(t,e,i,r){this._rotationT=Q(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=i.rect,a=new Float32Array(8);t*=r,e*=r;const o=i.code?n.width*r:i.metrics.width,h=i.code?n.height*r:i.metrics.height;this.width=o,this.height=h,a[0]=t,a[1]=e,a[2]=t+o,a[3]=e,a[4]=t,a[5]=e+h,a[6]=t+o,a[7]=e+h,this._data=a,this._setTextureCoords(n),this._scale=r,this._mosaic=i,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+h)}get mosaic(){return this._mosaic}set angle(t){this._angle=t,ee(this._rotationT,-t),this._setOffsets(this._data)}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(this._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,i=e*this._scale,r=Math.abs(t)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+i,n[3]=this.y,n[4]=this.x,n[5]=this.y+r,n[6]=this.x+i,n[7]=this.y+r;const a=me(Q(),this._rotationT,this._transform);Xe(n,n,a);let o=1/0,h=1/0,l=0,u=0;for(let m=0;m<4;m++){const p=n[2*m],y=n[2*m+1];o=Math.min(o,p),h=Math.min(h,y),l=Math.max(l,p),u=Math.max(u,y)}const c=l-o,f=u-h,d=o+c/2,_=h+f/2;this._bounds=new zt(d,_,c,f)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,i=new Float32Array(8),r=me(Q(),this._rotationT,this._transform);Xe(i,t,r),e.upperLeft=M(i[0]*V,i[1]*V),e.upperRight=M(i[2]*V,i[3]*V),e.lowerLeft=M(i[4]*V,i[5]*V),e.lowerRight=M(i[6]*V,i[7]*V)}_setTextureCoords({x:t,y:e,width:i,height:r}){this._texcoords={upperLeft:M(t,e),upperRight:M(t+i,e),lowerLeft:M(t,e+r),lowerRight:M(t+i,e+r)}}};const ps=(s,t)=>({code:0,page:0,sdf:!0,rect:new us(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:s,left:0,top:0}});function Tt(s,t){return s.forEach(e=>gt(e,e,t)),{upperLeft:M(V*s[0][0],V*s[0][1]),upperRight:M(V*s[1][0],V*s[1][1]),lowerLeft:M(V*s[2][0],V*s[2][1]),lowerRight:M(V*s[3][0],V*s[3][1])}}let ys=class{constructor(t,e,i){this._rotation=0,this._decorate(t,e,i),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=i.angle!==0,this._transform=this._createGlyphTransform(this.bounds,i),this._borderLineSize=i.borderLineSize,(i.borderLineSize||i.hasBackground)&&([this.bounds,this.background]=this.shapeBackground(this._transform));for(const r of t)r.setTransform(this._transform)}setRotation(t){if(t===0&&this._rotation===0)return;this._rotation=t;const e=this._transform,i=ee(Q(),t);me(e,i,e);for(const r of this.glyphs)r.setTransform(this._transform)}_decorate(t,e,i){if(!i.decoration||i.decoration==="none"||!t.length)return;const r=i.scale,n=i.decoration==="underline"?ds:fs,a=t[0].textureBinding;for(const o of e){const h=o.startX*r,l=o.startY*r,u=(o.width+o.glyphWidthEnd)*r;t.push(new nr(h,l+n*r,ps(u,a),1))}}shapeBackground(t){const e=ms,{xmin:i,ymin:r,xmax:n,ymax:a,x:o,y:h,width:l,height:u}=this.bounds,c=Math.min(l,u)+2*e-ii,f=Math.min(v(this._borderLineSize||0),c),d=(ii+f)/2,_=this._borderLineSize?d:0,m=[i-e,r-e],p=[n+e,r-e],y=[i-e,a+e],x=[n+e,a+e],g=Tt([[m[0]-d,m[1]-d],[p[0]+d,p[1]-d],[m[0]+_,m[1]+_],[p[0]-_,p[1]+_]],t),w=Tt([[y[0]+_,y[1]-_],[x[0]-_,x[1]-_],[y[0]-d,y[1]+d],[x[0]+d,x[1]+d]],t),S=Tt([[m[0]-d,m[1]-d],[m[0]+_,m[1]+_],[y[0]-d,y[1]+d],[y[0]+_,y[1]-_]],t),T=Tt([[p[0]-_,p[1]+_],[p[0]+d,p[1]-d],[x[0]-_,x[1]-_],[x[0]+d,x[1]+d]],t),z={main:Tt([m,p,y,x],t),top:g,bot:w,left:S,right:T};return[new zt(o,h,l+2*d,u+2*d),z]}get boundsT(){const t=this.bounds,e=et(Mt(),t.x,t.y);if(gt(e,e,this._transform),this._hasRotation){const i=Math.max(t.width,t.height);return new zt(e[0],e[1],i,i)}return new zt(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,i=1/0,r=0,n=0;for(const h of t)e=Math.min(e,h.xTopLeft),i=Math.min(i,h.yTopLeft),r=Math.max(r,h.xBottomRight),n=Math.max(n,h.yBottomRight);const a=r-e,o=n-i;return new zt(e+a/2,i+o/2,a,o)}_createGlyphTransform(t,e){const i=_s*e.angle,r=Q(),n=Mt();return Xt(r,r,et(n,e.xOffset,-e.yOffset)),e.isCIM?pe(r,r,i):(Xt(r,r,et(n,t.x,t.y)),pe(r,r,i),Xt(r,r,et(n,-t.x,-t.y))),r}},Dt=class{constructor(t,e,i,r,n,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,i)),this.end=Math.max(0,Math.max(e,i)),this.ends===10,ri=s=>s===32;function xs(s,t,e){const i=new Array,r=1/e.scale,n=e.maxLineWidth*r,a=t?s.length-1:0,o=t?-1:s.length,h=t?-1:1;let l=a,u=0,c=0,f=l,d=f,_=0,m=1/0,p=0;for(;l!==o;){const{code:x,metrics:g}=s[l],w=Math.abs(g.top);if(we(x)||ri(x)||(m=Math.min(m,w),p=Math.max(p,w+g.height)),we(x))l!==a&&(i.push(new Dt(s,f,l-h,u,m,p)),m=1/0,p=0),u=0,f=l+h,d=l+h,c=0;else if(ri(x))d=l+h,c=0,_=g.advance,u+=g.advance;else if(u>n){if(d!==f){const S=d-2*h;u-=_,i.push(new Dt(s,f,S,u-c,m,p)),m=1/0,p=0,f=d,u=c}else i.push(new Dt(s,f,l-h,u,m,p)),m=1/0,p=0,f=l,d=l,u=0;u+=g.advance,c+=g.advance}else u+=g.advance,c+=g.advance;l+=h}const y=new Dt(s,f,l-h,u,m,p);return y.start>=0&&y.end=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT)*ws,this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),r=new this._ctor(i);r.set(this._buffer,0),this._array=i,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length{const n=1<=ut-i?oi:hi|oi)|(e<0+r?ci:e>=ut-r?li:ci|li));this._current.overlaps|=n}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=xe(t,this._symbologyType).geometry;e.set(t,new si(t,i,this.hint.records))}return this._data.self.get(t)}};function Ss(s,t,e){const i=G.SIZE_FIELD_STOPS|G.SIZE_MINMAX_VALUE|G.SIZE_SCALE_STOPS|G.SIZE_UNIT_VALUE,r=(t&(Ot.FIELD_TARGETS_OUTLINE|Ot.MINMAX_TARGETS_OUTLINE|Ot.SCALE_TARGETS_OUTLINE|Ot.UNIT_TARGETS_OUTLINE))>>>4;return s===b.LINE&&e.isOutline||s===b.FILL&&ar(e.symbologyType)?i&r:i&~r}const ui=0,di=8,Ls=7,fi=8,_i=11,mi=11,pi=12,yi=13,xi=14,gi=15,vi=16,Mi=17,wi=18,bi=19,Si=20,Li=21,Ti=26,Ts=Object.keys(A).filter(s=>typeof A[s]=="number").reduce((s,t)=>({...s,[t]:A[t]}),{});function zs(s){return s===A.SIMPLE||s===A.OUTLINE_FILL_SIMPLE}function ar(s){return s===A.OUTLINE_FILL||s===A.OUTLINE_FILL_SIMPLE}function or(s){return zs(s.symbologyType)}function qt(s){return ar(s.symbologyType)}function he(s,t){switch(s){case b.FILL:return H.from(t);case b.LINE:return rt.from(t);case b.MARKER:return dt.from(t);case b.TEXT:return Ct.from(t);case b.LABEL:return ct.from(t);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${s}`)}}function ha(s){switch(Z.load(s).geometryType){case b.MARKER:return new dt(s);case b.FILL:return new H(s);case b.LINE:return new rt(s);case b.TEXT:return new Ct(s);case b.LABEL:return new ct(s)}}class Z{static load(t){const e=this.shared;return e.data=t,e}constructor(t){this._data=0,this._data=t}set data(t){this._data=t??0}get data(){return this._data}get geometryType(){return this.bits(fi,_i)}set geometryType(t){this.setBits(t,fi,_i)}get mapAligned(){return!!this.bit(Si)}set mapAligned(t){this.setBit(Si,t)}get sdf(){return!!this.bit(mi)}set sdf(t){this.setBit(mi,t??!1)}get pattern(){return!!this.bit(pi)}set pattern(t){this.setBit(pi,t)}get textureBinding(){return this.bits(ui,di)}set textureBinding(t){this.setBits(t,ui,di)}get symbologyType(){return this.bits(Li,Ti)}set symbologyType(t){this.setBits(t,Li,Ti)}get geometryTypeString(){switch(this.geometryType){case b.FILL:return"fill";case b.MARKER:return"marker";case b.LINE:return"line";case b.TEXT:return"text";case b.LABEL:return"label";default:throw new bt(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(t,e){const i=1<>t}setBits(t,e,i){for(let r=e,n=0;rclass extends s{get vvSizeMinMaxValue(){return this.bit(vi)!==0}set vvSizeMinMaxValue(t){this.setBit(vi,t)}get vvSizeScaleStops(){return this.bit(Mi)!==0}set vvSizeScaleStops(t){this.setBit(Mi,t)}get vvSizeFieldStops(){return this.bit(wi)!==0}set vvSizeFieldStops(t){this.setBit(wi,t)}get vvSizeUnitValue(){return this.bit(bi)!==0}set vvSizeUnitValue(t){this.setBit(bi,t)}hasSizeVV(){return this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}hasVV(){return super.hasVV()||this.hasSizeVV()}setVV(t,e){super.setVV(t,e);const i=Ss(this.geometryType,t,e)&t;this.vvSizeMinMaxValue=!!(i&G.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(i&G.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(i&G.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(i&G.SIZE_SCALE_STOPS)}},hr=s=>class extends s{get vvRotation(){return this.bit(gi)!==0}set vvRotation(t){this.setBit(gi,t)}hasVV(){return super.hasVV()||this.vvRotation}setVV(t,e){super.setVV(t,e),this.vvRotation=!e.isOutline&&!!(t&G.ROTATION)}},le=s=>class extends s{get vvColor(){return this.bit(yi)!==0}set vvColor(t){this.setBit(yi,t)}hasVV(){return super.hasVV()||this.vvColor}setVV(t,e){super.setVV(t,e),this.vvColor=!e.isOutline&&!!(t&G.COLOR)}},ce=s=>class extends s{get vvOpacity(){return this.bit(xi)!==0}set vvOpacity(t){this.setBit(xi,t)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(t,e){super.setVV(t,e),this.vvOpacity=!e.isOutline&&!!(t&G.OPACITY)}};let H=class extends le(ce(At(Z))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:i}=t,r=this.load(0);return r.geometryType=b.FILL,r.symbologyType=e,e!==A.DOT_DENSITY&&r.setVV(i,t),r.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};H.shared=new H(0);class dt extends le(ce(hr(At(Z)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const{symbologyType:e,vvFlags:i}=t,r=this.load(0);return r.geometryType=b.MARKER,r.symbologyType=e,e!==A.HEATMAP&&r.setVV(i,t),r.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}dt.shared=new dt(0);let rt=class extends le(ce(At(Z))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=b.LINE,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};rt.shared=new rt(0);let Ct=class extends le(ce(hr(At(Z)))){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=b.TEXT,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};Ct.shared=new Ct(0);let ct=class extends At(Z){static load(t){const e=this.shared;return e.data=t,e}static from(t){const e=this.load(0);return e.geometryType=b.LABEL,e.symbologyType=t.symbologyType,e.setVV(t.vvFlags,t),e.mapAligned=Zi(t.placement),e.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}};ct.shared=new ct(0);const N=0,U=100;function zi(s,t,e){return s[0]=t[0]-e[0],s[1]=t[1]-e[1],s}function lr(s,t){return Math.sqrt(s*s+t*t)}function Ii(s){const t=lr(s[0],s[1]);s[0]/=t,s[1]/=t}function Is(s,t){return lr(s[0]-t[0],s[1]-t[1])}function be(s=2){return 1/Math.max(s,1)}function at(s,t){return[!!(s!=null&&s.minScale)&&t.scaleToZoom(s.minScale)||N,!!(s!=null&&s.maxScale)&&t.scaleToZoom(s.maxScale)||U]}function Ps(s,t){return s[t+1]}function cr(s){return s.length-1}function $s(s){let t=0;for(let e=0;et._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1t)return this._seekBackwards(t-r);r+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}};function Ws(s,t,e,i=!0){const r=$s(s),n=Es.create(s),a=r/2;if(!i)return n.seek(a),void e(n.clone(),0,a+0*t,r);const o=Math.max((r-t)/2,0),h=Math.floor(o/t),l=a-h*t;n.seek(l);for(let u=-h;u<=h;u++)n.x<512&&n.x>=0&&n.y<512&&n.y>=0&&e(n.clone(),u,a+u*t,r),n.seek(t)}function Vs(s,t){const e=t;for(let i=0;i=0&&!(r[m+1]r[c]+u);m++){const p=u-r[m-1]+r[c],y=r[m]-r[m-1],x=r[m]-r[c]class extends s{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=b.TEXT,this._aux=P(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){this._shapingInfo=t!=null&&t.length?vs(t,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:es*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM,hasBackground:!!this._backgroundColor,borderLineSize:this._borderLineSize}):null}_write(t,e,i,r){const n=e.getDisplayId();this._writeGeometry(t,e,n,i,r)}_writeGeometry(t,e,i,r,n){const a=this._shapingInfo;if(a==null)return;if(this._textPlacement)return this._writePlacedText(t,i,a,r,e,n);const o=n?n.asOptimized():e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(o!=null){if(o.isPoint){const[h,l]=o.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(h<0||h>=512||l<0||l>=512)?void 0:this._writeGlyphs(t,i,{x:h,y:l},a)}o.forEachVertex((h,l)=>this._writeGlyphs(t,i,{x:h,y:l},a))}}_writePlacedText(t,e,i,r,n,a){const o=this._textPlacement,h=a||re.fromFeatureSetReaderCIM(n);if(!h)return;const l=-1,u=ur.getPlacement(h,l,o,v(1),t.tileKey,r.geometryEngine);if(!u)return;const c=i.bounds,f=Math.sqrt(c.height*c.height+c.width*c.width);let d,_,m;for(;d=u.next();)if(_=d.tx,m=-d.ty,_+f>=0&&_-f<512&&m+f>=0&&m-f<512){const p=-d.getAngle();i.setRotation(p),this._writeGlyphs(t,e,{x:_,y:m},i),i.setRotation(-p)}}_writeGlyphs(t,e,i,r){const n=Z.load(this._materialKey),a=M(Math.round(mt*i.x),Math.round(mt*i.y)),o=this._vertexBoundsScale,{bounds:h,background:l,glyphs:u}=r;u.length>0&&(this._borderLineColor||this._backgroundColor)&&(n.textureBinding=u[0].textureBinding,t.recordStart(e,n.data,this.geometryType,!0),this._writeBackgroundGeometry(t,e,i,h,l),t.recordEnd());const c=2*Math.max(h.width,h.height);for(const f of r.glyphs)n.textureBinding=f.textureBinding,t.recordStart(e,n.data,this.geometryType,!0),t.vertexBounds(i.x+h.x+this._xOffset,i.y+h.y-this._yOffset,c*o,c*o),this._writeVertices(t,e,a,f),t.recordEnd()}_writeGlyph(t,e,i,r,n){const a=Z.load(this._materialKey),o=M(Math.round(mt*i),Math.round(mt*r));a.textureBinding=n.textureBinding,t.recordStart(e,a.data,this.geometryType,!0);const h=n.bounds,l=this._vertexBoundsScale;t.vertexBounds(i+h.x*l,r+h.y*l,h.width*l,h.height*l),this._writeVertices(t,e,o,n),t.recordEnd()}_writeVertices(t,e,i,r){const n=t.vertexCount();this._writeVertexCommon(t,e,i,r),t.vertexWrite(r.offsets.upperLeft),t.vertexWrite(r.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,r),t.vertexWrite(r.offsets.upperRight),t.vertexWrite(r.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,r),t.vertexWrite(r.offsets.lowerLeft),t.vertexWrite(r.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,r),t.vertexWrite(r.offsets.lowerRight),t.vertexWrite(r.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(n+0),t.indexWrite(n+1),t.indexWrite(n+2),t.indexWrite(n+1),t.indexWrite(n+3),t.indexWrite(n+2)}_writeVertexCommon(t,e,i,r){const n=this._color,a=this._haloColor,o=P(0,0,this._referenceSize,this._bitset),h=P(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(h),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}_writeBackgroundVertex(t,e,i,r,n,a){const o=P(0,1,this._referenceSize,this._bitset),h=P(0,0,this._size,this._haloSize),l=P(0,0,0,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(l),t.vertexWrite(h),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom),t.vertexWrite(n),t.vertexWrite(a),t.vertexEnd()}_writeBackgroundQuad(t,e,i,r,n,a){const o=t.vertexCount();this._writeBackgroundVertex(t,e,i,r,n.upperLeft,a[0]),this._writeBackgroundVertex(t,e,i,r,n.upperRight,a[1]),this._writeBackgroundVertex(t,e,i,r,n.lowerLeft,a[2]),this._writeBackgroundVertex(t,e,i,r,n.lowerRight,a[3]),t.indexWrite(o+0),t.indexWrite(o+1),t.indexWrite(o+2),t.indexWrite(o+1),t.indexWrite(o+3),t.indexWrite(o+2)}_writeBackgroundGeometry(t,e,i,r,n){const a=M(Math.round(mt*i.x),Math.round(mt*i.y)),{x:o,y:h,width:l,height:u}=r,c=2*Math.max(l,u);if(t.vertexBounds(i.x+o+this._xOffset,i.y+h-this._yOffset,c*this._vertexBoundsScale,c*this._vertexBoundsScale),this._backgroundColor){const f=[Gt,Gt,Gt,Gt];this._writeBackgroundQuad(t,e,a,this._backgroundColor,n.main,f)}if(this._borderLineColor||this._backgroundColor){const f=!!this._borderLineColor&&!!this._borderLineSize&&this._borderLineSize>0,[d,_,m,p,y]=f?[Pi,Pi,$i,$i,this._borderLineColor]:[As,Rs,Bs,Fs,this._backgroundColor];this._writeBackgroundQuad(t,e,a,y,n.top,d),this._writeBackgroundQuad(t,e,a,y,n.bot,_),this._writeBackgroundQuad(t,e,a,y,n.left,m),this._writeBackgroundQuad(t,e,a,y,n.right,p)}}};let Rt=class{constructor(){this._materialKey=null}bindFeature(t,e,i){}write(t,e,i,r){if(this._effects&&this._effects.length>0){let n=re.fromFeatureSetReaderCIM(e);if(n){n.invertY();const a=Zr.executeEffects(this._effects,n,t.tileKey,r.geometryEngine);for(;n=a.next();)n.invertY(),this._write(t,e,r,n)}}else this._write(t,e,r)}_write(t,e,i,r){}};const Os=5;let Le=class Te extends dr(Rt){constructor(t,e,i,r,n,a,o,h,l,u,c,f,d,_,m,p,y,x,g,w,S,T,z,I){super(),this._xOffset=v(d),this._yOffset=v(_),this._decoration=u||"none",this._backgroundColor=T,this._borderLineColor=z,this._borderLineSize=I,this._color=n,this._haloColor=a,this._haloSize=Math.min(Math.floor(Os*v(Pr(i))),127),this._size=Math.min(Math.round(v(e)),127);const Y=Math.min(Math.round(v(r||e)),127);this._referenceSize=Math.round(Math.sqrt(256*Y)),this._scale=this._size/Hi,this._angle=f,this._justify=Nr(o||"center"),this._xAlignD=Ni(o||"center"),this._yAlignD=Ui(h||"baseline"),this._baseline=(h||"baseline")==="baseline",this._bitset=(l===K.MAP?1:0)|(c?1:0)<<1;const ft=Z.load(t);ft.sdf=!0,this._materialKey=ft.data,this._lineWidth=v(m)||512,this._lineHeight=p||1,this._textPlacement=y,this._effects=x,this._isCIM=g??!1,this._minMaxZoom=M(Math.round(w*E),Math.round(S*E))}static fromText(t,e){var a,o;const i=(a=t.font)==null?void 0:a.size,r=new Te(t.materialKey,i,t.haloSize||0,i,t.color&&O(t.color)||0,t.haloColor&&O(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,K.SCREEN,(o=t.font)==null?void 0:o.decoration,!1,t.angle||0,t.xoffset||0,t.yoffset||0,t.lineWidth||0,t.lineHeight||0,null,null,!1,N,U,t.backgroundColor&&O(t.backgroundColor),t.borderLineColor&&O(t.borderLineColor),t.borderLineSize),[,n]=ye(t.text);return r.bindTextInfo(e??[],n),r._vertexBoundsScale=t.maxVVSize&&i?t.maxVVSize/i:1,r}static fromCIMText(t,e,i){const r=t.scaleFactor||1,n=t.size*t.sizeRatio*r,[a,o]=at(t.scaleInfo,i),h=new Te(t.materialKey,n,t.outlineSize*t.sizeRatio,t.referenceSize,$(t.color),$(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked??!1,t.angle,t.offsetX*t.sizeRatio*r,t.offsetY*t.sizeRatio*r,t.lineWidth||512,1,t.markerPlacement,t.effects,!0,a,o,t.backgroundColor?$(t.backgroundColor):void 0,t.borderLineColor?$(t.borderLineColor):void 0,t.borderLineWidth),[,l]=ye(t.text);return h.bindTextInfo(e,l),h._vertexBoundsScale=t.maxVVSize?t.maxVVSize/n:1,h}};const fr=St.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),Ds=(s,t="mapview-labeling")=>fr.error(new bt(t,s)),Zt=1,pt=0,Ks=4,de=25;function Gs(s,t){const e=!!s.minScale&&t.scaleToZoom(s.minScale)||0;return Gi(e,0,25.5)}function Zs(s,t){const e=!!s.maxScale&&t.scaleToZoom(s.maxScale)||255;return Gi(e,0,25.5)}function Ns(s){const t=new Map;return e=>(t.has(e)||t.set(e,s(e)),t.get(e))}const Us=Ns(s=>{let t=0;if(s===0)return 1/0;for(;!(s%2);)t++,s/=2;return t}),Nt=s=>Math.floor(127*s+127),ot=s=>Math.floor(s*E),J=s=>Math.round(s*(254/360));class Qt extends Le{constructor(t,e,i,r){var c,f,d;super(t,(c=i.font)==null?void 0:c.size,i.haloSize||0,(f=i.font)==null?void 0:f.size,i.color&&O(i.color)||0,i.haloColor&&O(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,Zi(e.labelPlacement)?K.MAP:K.SCREEN,(d=i.font)==null?void 0:d.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,!1,null,null,i.backgroundColor&&O(i.backgroundColor),i.borderLineColor&&O(i.borderLineColor),i.borderLineSize),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=b.LABEL,this._allowOverrun=e.allowOverrun??!1,this._repeatLabel=e.repeatLabel??!0,this._labelPosition=e.labelPosition??"curved";const n=Gs(e,r),a=Zs(e,r),o=e.labelPlacement,[h,l]=Ur(o);this._xAlignD=h,this._yAlignD=l,this._minZoom=n,this._maxZoom=a,this._minBackgroundZoom=n,this._maxBackgroundZoom=a,this._refPlacementPadding=v(i.haloSize)+is,this._repeatLabelDistance=e.repeatLabelDistance?v(e.repeatLabelDistance):128;const u=ct.load(t);u.sdf=!0,this._materialKey=u.data}static fromLabelClass(t,e){if(t.labelPlacement==="esriServerLinePlacementCenterAlong"){const i=t.symbol;i.xoffset=0,i.yoffset=0,i.angle=0,i.font.decoration="none"}return new Qt(t.materialKey,t,t.symbol,e)}get _shapedBox(){return this._shapingInfo.bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=Xr(this._xAlignD),i=Hr(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,t==null)return void(this._refSymbolAndPlacementOffset=P(0,0,Nt(e),Nt(i)));if(t.boundsType==="circle"&&(e||i)){const a=Math.sqrt(e*e+i*i);e/=a,i/=a}const r=Math.max(t.height,t.width),n=this._refPlacementPadding*Ks;this._refSymbolAndPlacementOffset=P(n,r,Nt(e),Nt(i)),this._referenceSize=r,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(this._shapingInfo==null)return;const i=this._shapingInfo,r=e.getDisplayId(),n=e.geometryType==="esriGeometryPolygon"?e.readLegacyCentroid():e.readLegacyGeometry();if(n)switch(this._current={out:t,inId:r,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType==="esriGeometryPolyline"&&this._labelPosition==="curved"&&(this._borderLineColor||this._backgroundColor)&&fr.warnOnce("TextSymbol properties 'borderLineColor', 'borderLineSize', and 'backgroundColor' are not supported in curved labels"),e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(n);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(n);break;default:Ds(`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=ot(this._current.zoomLevel);return ot(t)<=i&&i<=ot(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:r}=this._current;this._writeGlyphs(e,i,t,r)}_placeLineLabels(t){const e=Vs(t.paths,this._current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),r=(this._shapedBox.width+this._repeatLabelDistance)/(1<0&&(this._borderLineColor||this._backgroundColor);if(this._maxBackgroundZoom=de,this._minBackgroundZoom=Math.max(e,0),l){const u=ct.load(this._materialKey);u.textureBinding=n.glyphs[0].textureBinding;const c=ee(Q(),-t.angle),[f,d]=n.shapeBackground(c);this._outLineLabelAngle=J(o),i.recordStart(r,u.data,this.geometryType,!0),this._writeBackgroundGeometry(i,r,t,f,d),i.recordEnd(),this._outLineLabelAngle=J(h),i.recordStart(r,u.data,this.geometryType,!0),this._writeBackgroundGeometry(i,r,t,f,d),i.recordEnd()}this._outLineLabelAngle=J(o),this._placeFirst(a,e,1,!0),this._outLineLabelAngle=J(h),this._placeFirst(a,e,0,!0),i.metricEnd()}_placeBack(t,e,i,r,n){const a=t.clone();let o=t.backwardLength+pt;for(;a.prev()&&!(o>=r);)this._placeOnSegment(a,e,o,i,-1,n),o+=a.length+pt}_placeForward(t,e,i,r,n){const a=t.clone();let o=t.remainingLength+pt;for(;a.next()&&!(o>=r);)this._placeOnSegment(a,e,o,i,1,n),o+=a.length+pt}_placeFirst(t,e,i,r=!1){const n=t,a=this._current.inShaping,o=a.glyphs,h=this._current.zoomLevel,{out:l,inId:u}=this._current;for(const c of o){const f=c.x>a.bounds.x?i:1-i,d=f*t.remainingLength+(1-f)*t.backwardLength,_=Math.abs(c.x+c.width/2-a.bounds.x),m=Math.max(0,h+Math.log2(_/(d+pt))),p=Math.max(e,r?0:m);if(c.maxZoom=de,c.angle=t.angle+(1-i)*Math.PI,c.minZoom=p,this._writeGlyph(l,u,n.x,n.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const y=c.bounds;l.metricBoxWrite(y.center[0],y.center[1],y.width,y.height)}}}_placeOnSegment(t,e,i,r,n,a){const o=this._current.inShaping.glyphs,{out:h,inId:l}=this._current,u=this._current.inShaping,c=this._current.zoomLevel,f=t.dx/t.length,d=t.dy/t.length,_={x:t.x+i*-n*f,y:t.y+i*-n*d};for(const m of o){const p=m.x>u.bounds.x?a:1-a;if(!(p&&n===1||!p&&n===-1))continue;const y=Math.abs(m.x+m.width/2-u.bounds.x),x=Math.max(0,c+Math.log2(y/i)-.1),g=Math.max(r,c+Math.log2(y/(i+t.length+pt)));if(x!==0&&(m.angle=t.angle+(1-a)*Math.PI,m.minZoom=g,m.maxZoom=x,this._writeGlyph(h,l,_.x,_.y,m),a&&this._isVisible(m.minZoom,m.maxZoom))){const w=m.bounds,S=t.x-e.x,T=t.y-e.y;h.metricBoxWrite(w.center[0]+S,w.center[1]+T,w.width,w.height)}}}_writeGlyphs(t,e,i,r,n=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;if(r.glyphs.length>0&&(this._borderLineColor||this._backgroundColor)){const c=ct.load(this._materialKey);c.textureBinding=r.glyphs[0].textureBinding,t.recordStart(e,c.data,this.geometryType,!0),this._writeBackgroundGeometry(t,e,i,r.bounds,r.background),t.recordEnd()}const a=i.x+this._refOffsetX,o=i.y-this._refOffsetY;for(const c of r.glyphs)c.minZoom=n,c.maxZoom=this._maxZoom,this._writeGlyph(t,e,a,o,c);const h=this._refPlacementDirX,l=this._refPlacementDirY,u=r.boundsT;t.metricStart(e,n,a,o,h,l,this._referenceSize,this._materialKey),t.metricBoxWrite(u.center[0],u.center[1],u.width,u.height),t.metricEnd()}_writeVertexCommon(t,e,i,r){const n=this._color,a=this._haloColor,o=P(0,0,this._size,this._haloSize),h=Math.max(r.minZoom,this._minZoom),l=Math.min(r.maxZoom,this._maxZoom),u=P(ot(h),ot(l),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(n),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(u)}_writeBackgroundVertex(t,e,i,r,n,a){const o=P(0,0,this._size,this._haloSize),h=P(0,0,0,0),l=P(ot(this._minBackgroundZoom),ot(this._maxBackgroundZoom),this._outLineLabelAngle,1);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(h),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(l),t.vertexWrite(n),t.vertexWrite(a),t.vertexEnd()}}const fe=3.14159265359/180,Ci=8,_r=s=>class extends s{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._allowBorrowing=!0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this.geometryType=b.MARKER}_write(t,e,i,r){const n=e.getDisplayId();t.recordStart(n,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,n,i,r),t.recordEnd()}_writeGeometry(t,e,i,r,n){if(this._markerPlacement!=null)return this._writePlacedMarkers(t,e,r,n);if(this._allowBorrowing=!0,!n&&e.geometryType==="esriGeometryPoint"){const o=e.getX(),h=e.getY();return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=513||h<0||h>=513)?void 0:this._writeVertices(t,i,this._getPos(o,h),o,h)}const a=n?n.asOptimized():e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(a!=null){if(a.isPoint){const[o,h]=a.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=512||h<0||h>=512)?void 0:this._writeVertices(t,i,this._getPos(o,h),o,h)}a.forEachVertex((o,h)=>{const l=2*ut;o<-l||o>=l||h<-l||h>=l||this._writeVertices(t,i,this._getPos(o,h),o,h)})}}_writePlacedMarkers(t,e,i,r){const n=r||re.fromFeatureSetReaderCIM(e);if(!n)return;const a=-1,o=ur.getPlacement(n,a,this._markerPlacement,v(1),t.tileKey,i.geometryEngine);if(!o)return;this._allowBorrowing=e.geometryType!=="esriGeometryPolygon";const h=e.getDisplayId(),l=Mt(),u=Q(),c=-128,f=640;let d=o.next();for(;d!=null;){const _=d.tx,m=-d.ty;_>=c&&_<=f&&m>=c&&m<=f&&(this._applyTransformation(u,l,-d.getAngle()/fe),this._writeVertices(t,h,this._getPos(_,m),_,m)),d=o.next()}}_writeVertices(t,e,i,r,n){const a=dt.load(this._materialKey);return a.symbologyType===A.HEATMAP?this._writeHeatmapVertices(t,e,i):this._writeMarkerVertices(t,e,a,i,r,n)}_writeMarkerVertices(t,e,i,r,n,a){const o=i.vvRotation,h=t.vertexCount();let l=this._computedWidth*this._vertexBoundsScaleX,u=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const c=Math.max(l,u);l=c,u=c}if(o){const c=Math.max(this.xOffset,this.yOffset);l+=c,u+=c}this._allowBorrowing&&t.vertexBounds(n+this.xOffset,a-this.yOffset,l,u),t.vertexWrite(r),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(r),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(r),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(r),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),this._writeIndices(t,h)}_writeHeatmapVertices(t,e,i){const r=t.vertexCount();t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(e),t.vertexEnd(),this._writeIndices(t,r)}_writeIndices(t,e){t.indexWrite(e+0),t.indexWrite(e+1),t.indexWrite(e+2),t.indexWrite(e+1),t.indexWrite(e+3),t.indexWrite(e+2)}_applyTransformation(t,e,i=0){i?ee(t,fe*i):$r(t),Xt(t,t,Ki(this.xOffset,-this.yOffset)),this.angle&&pe(t,t,fe*this.angle);const r=this._computedWidth,n=this._computedHeight,a=-(.5+this._anchorX)*r,o=-(.5-this._anchorY)*n;et(e,a,o),gt(e,e,t),this._offsetUpperLeft=M(16*e[0],16*e[1]),et(e,a+r,o),gt(e,e,t),this._offsetUpperRight=M(16*e[0],16*e[1]),et(e,a,o+n),gt(e,e,t),this._offsetBottomLeft=M(16*e[0],16*e[1]),et(e,a+r,o+n),gt(e,e,t),this._offsetBottomRight=M(16*e[0],16*e[1])}_computeSize(t,e,i,r,n,a,o,h){const l=t*i,u=e*i;if(a.sdf&&!o){const T=h&&t>e?l:t,z=e,I=r+2*1;t=Math.min(T+I,l),e=Math.min(z+I,u)}else t=l,e=u;const c=rs/Math.max(l,u),f=.5*(l-t)*c,d=.5*(u-e)*c,_=a.rect.x+k+f,m=a.rect.y+k+d,p=_+a.width-2*f,y=m+a.height-2*d,x=Math.floor(_),g=Math.floor(m),w=Math.ceil(p),S=Math.ceil(y);t*=(w-x)/(p-_),e*=(S-g)/(y-m),this._texUpperLeft=M(x,g),this._texUpperRight=M(w,g),this._texBottomLeft=M(x,S),this._texBottomRight=M(w,S),this._anchorX*=l/t,this._anchorY*=u/e,t*=n,e*=n,this._computedWidth=t,this._computedHeight=e}_getPos(t,e){return M(Math.round(Ci*t),Math.round(Ci*e))}};let It=class Pt extends _r(Rt){constructor(t,e,i,r,n,a,o,h,l,u,c,f,d,_,m,p,y,x,g,w,S,T,z,I){super(),this.angle=r,this.height=o,this.width=a,this.xOffset=e*g,this.yOffset=i*g,this._markerPlacement=w||void 0,this._effects=S||void 0,this._anchorX=p,this._anchorY=y,this._minMaxZoom=M(Math.round(T*E),Math.round(z*E));const Y=(_===K.MAP?Yi:qi)|(c?it:0)|(d?ss:0)|(f?ji:0),ft=m&&m.sdf,_t=dt.load(t);_t.sdf=ft,_t.pattern=!0,_t.textureBinding=m.textureBinding,this._materialKey=_t.data,this._fillColor=n,this._outlineColor=l,this._sizeOutlineWidth=P(Math.round(Math.min(Math.sqrt(128*a),255)),Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*u),255)),Math.round(Math.min(Math.sqrt(128*h),255))),_t.symbologyType===A.PIE_CHART?(a*=x*g,o*=x*g,this._computedWidth=a,this._computedHeight=o,this._texUpperLeft=M(0,1),this._texUpperRight=M(1,1),this._texBottomLeft=M(0,0),this._texBottomRight=M(1,0)):this._computeSize(a,o,x,u,g,m,_t.hasSizeVV(),I);const Lr=Math.round(64*x);this._bitestAndDistRatio=M(Y,Lr);const Tr=Mt(),zr=Q();this._applyTransformation(zr,Tr)}static fromCIMMarker(t,e,i){const r=e&&e.width||1,n=e&&e.height||1,a=t.size,o=r/n*t.scaleX,h=t.scaleSymbolsProportionally&&t.frameHeight?a/t.frameHeight:1,l=$(t.color),u=$(t.outlineColor),c=v(a),f=c*o,d=v(t.offsetX||0),_=v(t.offsetY||0),m=v(t.outlineWidth||0)*h,p=t.alignment||K.SCREEN,y=v(t.referenceSize),[x,g]=at(t.scaleInfo,i);let w=t.rotation||0;t.rotateClockwise||(w=-w);let S=0,T=0;const z=t.anchorPoint;z&&(t.isAbsoluteAnchorPoint?a&&(S=z.x/(a*o),T=z.y/a):(S=z.x,T=z.y));const I=new Pt(t.materialKey,d,_,w,l,f,c,y,u,m,t.colorLocked,t.scaleSymbolsProportionally,!1,p,e,S,T,t.sizeRatio,t.scaleFactor??1,t.markerPlacement,t.effects,x,g,!0);return I._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/f:1,I._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/c:1,I}static fromPictureMarker(t,e){const i=Math.round(v(t.width)),r=Math.round(v(t.height)),n=Qi,a=Math.round(v(t.xoffset||0)),o=Math.round(v(t.yoffset||0)),h=new Pt(t.materialKey,a,o,t.angle,n,i,r,r,0,0,!1,!1,!1,K.SCREEN,e,0,0,1,1,null,null,N,U,!1);return h._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,h._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,h}static fromSimpleMarker(t,e){const i=t.style,r=O(t.color),n=Math.round(v(t.size));let a=n;i==="esriSMSTriangle"&&(a*=e.height/e.width);const o=Math.round(v(t.xoffset||0)),h=Math.round(v(t.yoffset||0)),l=t.outline,u=0|((l==null?void 0:l.color)&&O(l.color)),c=0|((l==null?void 0:l.width)&&Math.round(v(l.width))),f=new Pt(t.materialKey,o,h,t.angle??0,r,n,a,a,u,c,!1,!1,i==="esriSMSCross"||i==="esriSMSX",K.SCREEN,e,0,0,2,1,null,null,N,U,!1);return f.boundsType=i==="esriSMSCircle"?"circle":"square",f._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,f._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,f}static fromLineSymbolMarker(t,e){const i=O(t.color),r=6,n=Math.round(v(r*t.lineWidth)),a=n,o=t.style==="cross"||t.style==="x";let h;switch(t.placement){case"begin-end":h=Bt.Both;break;case"begin":h=Bt.JustBegin;break;case"end":h=Bt.JustEnd;break;default:h=Bt.None}const l={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:h,offsetAlongLine:0},u=new Pt(t.materialKey,0,0,0,i,n,a,a/r,i,o?Math.round(v(t.lineWidth)):0,!1,!1,o,K.MAP,e,0,0,2,1,l,null,N,U,!1);return u.boundsType=t.style==="circle"?"circle":"square",u}};function Xs(s,t,e,i,r,n,a){Pe=0;const o=(i-e)*n,h=r&&r.length,l=h?(r[0]-e)*n:o;let u,c,f,d,_,m=mr(t,e,i,0,l,n,!0);if(m&&m.next!==m.prev){if(h&&(m=js(t,e,i,r,m,n)),o>80*n){u=f=t[0+e*n],c=d=t[1+e*n];for(let p=n;p0)for(let h=i;h=i;h-=n)o=Ei(h+t*n,s[h+t*n],s[h+1+t*n],o);return o&<(o,o.next)&&(Vt(o),o=o.next),o}function Et(s,t=s){if(!s)return s;let e,i=s;do if(e=!1,i.steiner||!lt(i,i.next)&&C(i.prev,i,i.next)!==0)i=i.next;else{if(Vt(i),i=t=i.prev,i===i.next)break;e=!0}while(e||i!==t);return t}function Wt(s,t,e,i,r,n,a,o){if(!s)return;!o&&n&&(s=pr(s,i,r,n));let h=s;for(;s.prev!==s.next;){const l=s.prev,u=s.next;if(n?Ys(s,i,r,n):Hs(s))t.push(l.index/e+a),t.push(s.index/e+a),t.push(u.index/e+a),Vt(s),s=u.next,h=u.next;else if((s=u)===h){o?o===1?Wt(s=nn(s,t,e,a),t,e,i,r,n,a,2):o===2&&an(s,t,e,i,r,n,a):Wt(Et(s),t,e,i,r,n,a,1);break}}}function Hs(s){const t=s.prev,e=s,i=s.next;if(C(t,e,i)>=0)return!1;let r=s.next.next;const n=r;let a=0;for(;r!==s.prev&&(a===0||r!==n);){if(a++,vt(t.x,t.y,e.x,e.y,i.x,i.y,r.x,r.y)&&C(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ys(s,t,e,i){const r=s.prev,n=s,a=s.next;if(C(r,n,a)>=0)return!1;const o=r.xn.x?r.x>a.x?r.x:a.x:n.x>a.x?n.x:a.x,u=r.y>n.y?r.y>a.y?r.y:a.y:n.y>a.y?n.y:a.y,c=ze(o,h,t,e,i),f=ze(l,u,t,e,i);let d=s.prevZ,_=s.nextZ;for(;d&&d.z>=c&&_&&_.z<=f;){if(d!==s.prev&&d!==s.next&&vt(r.x,r.y,n.x,n.y,a.x,a.y,d.x,d.y)&&C(d.prev,d,d.next)>=0||(d=d.prevZ,_!==s.prev&&_!==s.next&&vt(r.x,r.y,n.x,n.y,a.x,a.y,_.x,_.y)&&C(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;d&&d.z>=c;){if(d!==s.prev&&d!==s.next&&vt(r.x,r.y,n.x,n.y,a.x,a.y,d.x,d.y)&&C(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;_&&_.z<=f;){if(_!==s.prev&&_!==s.next&&vt(r.x,r.y,n.x,n.y,a.x,a.y,_.x,_.y)&&C(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function Ei(s,t,e,i){const r=wt.create(s,t,e);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Vt(s){s.next.prev=s.prev,s.prev.next=s.next,s.prevZ&&(s.prevZ.nextZ=s.nextZ),s.nextZ&&(s.nextZ.prevZ=s.prevZ)}function qs(s){let t=s,e=s;do(t.x=e.next.y&&e.next.y!==e.y){const f=e.x+(r-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(f<=i&&f>a){if(a=f,f===i){if(r===e.y)return e;if(r===e.next.y)return e.next}n=e.x=e.x&&e.x>=h&&i!==e.x&&vt(rn.x)&&kt(e,s)&&(n=e,c=u)),e=e.next;return n}function pr(s,t,e,i){let r;for(;r!==s;r=r.next){if(r=r||s,r.z===null&&(r.z=ze(r.x,r.y,t,e,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,pr(s,t,e,i);r.prevZ=r.prev,r.nextZ=r.next}return s.prevZ.nextZ=null,s.prevZ=null,tn(s)}function tn(s){let t,e=1;for(;;){let i,r=s;s=null,t=null;let n=0;for(;r;){n++,i=r;let a=0;for(;a0||o>0&&i;){let h;a===0?(h=i,i=i.nextZ,o--):o!==0&&i?r.z<=i.z?(h=r,r=r.nextZ,a--):(h=i,i=i.nextZ,o--):(h=r,r=r.nextZ,a--),t?t.nextZ=h:s=h,h.prevZ=t,t=h}r=i}if(t.nextZ=null,e*=2,n<2)return s}}function C(s,t,e){return(t.y-s.y)*(e.x-t.x)-(t.x-s.x)*(e.y-t.y)}function yr(s,t,e,i){return!!(lt(s,t)&<(e,i)||lt(s,i)&<(e,t))||C(s,t,e)>0!=C(s,t,i)>0&&C(e,i,s)>0!=C(e,i,t)>0}function en(s,t){let e=s;do{if(e.index!==s.index&&e.next.index!==s.index&&e.index!==t.index&&e.next.index!==t.index&&yr(e,e.next,s,t))return!0;e=e.next}while(e!==s);return!1}function rn(s,t,e,i,r,n){let a=0;for(let o=i,h=r-n;o=0&&(s-a)*(i-o)-(e-a)*(t-o)>=0&&(e-a)*(n-o)-(r-a)*(i-o)>=0}function kt(s,t){return C(s.prev,s,s.next)<0?C(s,t,s.next)>=0&&C(s,s.prev,t)>=0:C(s,t,s.prev)<0||C(s,s.next,t)<0}function ze(s,t,e,i,r){return(s=1431655765&((s=858993459&((s=252645135&((s=16711935&((s=32767*(s-e)*r)|s<<8))|s<<4))|s<<2))|s<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function lt(s,t){return s.x===t.x&&s.y===t.y}function sn(s,t){return s.x-t.x}function nn(s,t,e,i){let r=s;do{const n=r.prev,a=r.next.next;!lt(n,a)&&yr(n,r,r.next,a)&&kt(n,a)&&kt(a,n)&&(t.push(n.index/e+i),t.push(r.index/e+i),t.push(a.index/e+i),Vt(r),Vt(r.next),r=s=a),r=r.next}while(r!==s);return r}function an(s,t,e,i,r,n,a){let o=s;do{let h=o.next.next;for(;h!==o.prev;){if(o.index!==h.index&&on(o,h)){let l=xr(o,h);return o=Et(o,o.next),l=Et(l,l.next),Wt(o,t,e,i,r,n,a,0),void Wt(l,t,e,i,r,n,a,0)}h=h.next}o=o.next}while(o!==s)}function on(s,t){return s.next.index!==t.index&&s.prev.index!==t.index&&!en(s,t)&&kt(s,t)&&kt(t,s)&&hn(s,t)}function hn(s,t){let e=s,i=!1;const r=(s.x+t.x)/2,n=(s.y+t.y)/2;do e.y>n!=e.next.y>n&&e.next.y!==e.y&&r<(e.next.x-e.x)*(n-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==s);return i}function xr(s,t){const e=wt.create(s.index,s.x,s.y),i=wt.create(t.index,t.x,t.y),r=s.next,n=t.prev;return s.next=t,t.prev=s,e.next=r,r.prev=e,i.next=e,e.prev=i,n.next=i,i.prev=n,i}class wt{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const r=Pe0))break;c+=y,f.push(o+u),u+=p}const d=a.length;Xs(a,e,o,o+u,f,2,n);const _=un(a,e,d,a.length,n),m=Math.abs(c);if(Math.abs((_-m)/Math.max(1e-7,m))>cn)return a.length=0,!1;h=l,o+=u}return!0}function fn(s){const{coords:t,lengths:e}=s,{buffer:i}=ls(t,e);return i}function _n(s,t,e){let i=0;for(let r=0;re||he)return!0}i+=n}return!1}function mn(s,t){if(s==null)return null;if(!_n(s,-128,ut+128))return s;ht.setPixelMargin(t),ht.reset(rr.Polygon);let e=0;for(let a=0;ar||ur){a=!0;continue}h.push({x:l,y:u})}let c=!1;for(;s.nextPoint();)if(l=s.x,u=s.y,a)e.lineTo(l,u);else{if(lr||ur){c=!0;break}h.push({x:l,y:u})}if(c)a=!0;else{if(a){const f=e.resultWithStarts();if(f)for(const d of f)n.push(d)}else n.push({line:h,start:0});o=s.nextPath(),a=!1}}return n=n.filter(h=>h.line.length>1),n.length===0?null:n}ht.setExtent(ut),$e.setExtent(ut);const Jt=8,B=16,Vi=65535,gr=s=>class extends s{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=b.LINE}writeGeometry(t,e,i,r){this._writeGeometry(t,e,i,r)}_initializeTessellator(t){const e=rt.load(this._materialKey),i=H.load(this._materialKey),r=this._tessellationOptions,n=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,a=this.tessellationProperties._halfWidth(i,r,n,a,o,h,l,u,c,f,d)=>{const _=M(d,Math.ceil(B*s._halfWidth)),m=P(Math.round(B*l),Math.round(B*u),Math.round(B*c),Math.round(B*f)),p=P(B*o,B*h,0,s._bitset),y=s.out;return y.vertexBounds(i,r,t,e),y.vertexWrite(M(Jt*i,Jt*r)),y.vertexWrite(s.id),y.vertexWrite(s._fillColor),y.vertexWrite(m),y.vertexWrite(_),y.vertexWrite(s._tl),y.vertexWrite(s._br),y.vertexWrite(p),y.vertexWrite(M(Math.ceil(B*s._halfReferenceWidth),0)),y.vertexWrite(s.minMaxZoom),y.vertexEnd(),s.offset+s.vertexCount++},xn=(s,t,e)=>(i,r,n,a,o,h,l,u,c,f,d)=>{const _=M(B*s._halfWidth,B*s._halfReferenceWidth),m=P(B*l+128,B*u+128,B*c+128,B*f+128),p=s.out,y=s._bitset<<24|s.id;p.vertexBounds(i,r,t,e),p.vertexWrite(M(Jt*i,Jt*r)),p.vertexWrite(y),p.vertexWrite(s._fillColor);const x=or(s.key);return x||(p.vertexWrite(0),p.vertexWrite(0)),p.vertexWrite(0),p.vertexWrite(_),p.vertexWrite(m),x||p.vertexWrite(s.minMaxZoom),p.vertexEnd(),s.offset+s.vertexCount++},gn=s=>(t,e,i)=>{const r=s.out;r.indexWrite(t),r.indexWrite(e),r.indexWrite(i),s.indexCount+=3};let Ce=class xt extends gr(Rt){constructor(t,e,i,r,n,a,o,h,l,u,c,f,d,_,m,p,y,x,g,w){super();const S=rt.load(t);e&&(S.sdf=e.sdf,S.pattern=!0,S.textureBinding=e.textureBinding),this._capType=r,this._joinType=n,this._miterLimitCosine=be(a),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=h,this.tessellationProperties._br=l,this._hasPattern=u,this._isDashed=c,this._zOrder=y,this._effects=x||null,this._minMaxZoom=M(Math.round(g*E),Math.round(w*E)),this._materialKey=S.data;const T=(d?it:0)|(_?as:0)|(f?Ji:0)|(m?ie:0);this.tessellationProperties._bitset=T,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*p,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const r=t.color,n=t.scaleFactor||1,a=!!t.dashTemplate;let o=t.cap;a&&o===He.ROUND&&(o=He.SQUARE);const h=t.join,l=v(t.width)*n,u=v(t.referenceWidth),c=v(t.miterLimit),f=r&&$(r)||0,[d,_]=at(t.scaleInfo,i),m=!1;if(!e)return new xt(t.materialKey,e,l,o,h,c,f,0,0,!1,a,t.scaleDash??!1,t.colorLocked??!1,m,t.sampleAlphaOnly,u,t.zOrder,t.effects,d,_);const{rect:p,width:y,height:x}=e,g=p.x+k,w=p.y+k,S=g+y,T=w+x,z=M(g,w),I=M(S,T),Y=!1;return new xt(t.materialKey,e,l,o,h,c,f,z,I,!0,a,t.scaleDash??!1,t.colorLocked??!1,Y,t.sampleAlphaOnly,u,t.zOrder,t.effects,d,_)}static fromFillOutline(t){var i;const e=H.load(t.materialKey);return qt(e)&&t.outline&&((i=t.outline)==null?void 0:i.style)==="esriSLSSolid"?xt.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,i=!1){const{color:r}=t,n=t.style!=="esriSLSSolid"&&t.style!=="esriSLSNull",a=Qr(t.cap||"round"),o=Jr(t.join||"round");let h=r&&t.style!=="esriSLSNull"&&O(r)||0;t.style==="esriSLSNull"&&(h=0);const l=v(t.width),u=t.miterLimit;if(!e)return new xt(t.materialKey,e,l,a,o,u,h,0,0,!1,n,!0,!1,i,!1,l,0,null,N,U);const{rect:c,width:f,height:d}=e,_=c.x+k,m=c.y+k,p=_+f,y=m+d,x=M(_,m),g=M(p,y);return new xt(t.materialKey,e,l,a,o,u,h,x,g,!0,n,!0,!1,i,!1,l,0,null,N,U)}static fromPictureLineSymbol(t,e,i,r){return St.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}};const vn=100,ki=1,vr=s=>class extends s{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=b.FILL}_maybeAddLineTemplate(t){this._lineTemplate=Ce.fromFillOutline(t)}_write(t,e,i,r){const n=e.geometryType==="esriGeometryPoint",a=H.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,n),this._writeGeometry(t,e,a,r,n),qt(a)&&this._lineTemplate!=null&&this._lineTemplate.writeGeometry(t,e,r,n),t.recordEnd()}_writeGeometry(t,e,i,r,n){const a=this._getGeometry(e,r,n);if(a==null)return;const o=[];if(!(a.maxLength>vn)&&!this.forceLibtess&&dn(o,a))return void(o.length&&this._writeVertices(t,e,a.coords,a.lengths,i,o));const h=fn(a);this._writeVertices(t,e,h,[h.length/2],i)}_writeVertex(t,e,i,r,n,a){const o=M(ki*r,ki*n);if(t.vertexBounds(r,n,0,0),t.vertexWrite(o),t.vertexWrite(e),i.symbologyType===A.DOT_DENSITY)t.vertexWriteF32(1/Math.abs(a.readGeometryArea()));else{t.vertexWrite(this.fillColor);const h=or(i);h||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux21),t.vertexWrite(this.aux22),t.vertexWrite(this.aux3),h||t.vertexWrite(this._minMaxZoom)}}_writeVertices(t,e,i,r,n,a){const o=e.getDisplayId(),h=this._bitset<<24|o,l=r.reduce((d,_)=>d+_),u=xe(n.geometryType,n.symbologyType).geometry/4,c=t.vertexCount();t.vertexEnsureSize(u*l);let f=0;if(a)for(const d of a){const _=i[2*d],m=i[2*d+1];this._writeVertex(t,h,n,_,m,e),f++}else for(let d=0;d0,o=e.readLegacyFeature(),h=e.getObjectId(),l=this._materialCache,u=this._cimLayer.materialHash;if(!u)return Ai.error("A Dynamic mesh template must have a material hash value or function!"),null;const c=typeof u=="function"?u(o,i,r,h):u,f=l.get(c);if(f!=null)return f;const d=this._ongoingMaterialRequestMap.get(c);if(d)return d;const _=this._cimLayer,m=Yr(_.cim,this._cimLayer.materialOverrides);m.mosaicHash=c;const{type:p,url:y}=_,x={cim:m,type:p,mosaicHash:c,url:y,size:null,dashTemplate:null,text:null,fontName:null,objectId:h,animatedSymbolProperties:null};switch(p){case"marker":x.size=Ft(_.size,o,i,r),x.animatedSymbolProperties=Ft(_.animatedSymbolProperties,o,i,r);break;case"line":x.dashTemplate=_.dashTemplate;break;case"text":x.text=Ft(_.text,o,i,r),x.fontName=Ft(_.fontName,o,i,r)}const g=t.getMosaicItem(x,n).then(w=>(a||(this._ongoingMaterialRequestMap.delete(c),l.set(c,w)),w)).catch(w=>(this._ongoingMaterialRequestMap.delete(c),Ai.error(".analyze()",w.message),null));return a||this._ongoingMaterialRequestMap.set(c,g),g}};function F(s,t){if(s&&"name"in s){const e=s;return t&&t.error(new bt(e.name,e.message,e.details)),!1}return!0}let Mn=class Mr extends vr(ue){constructor(t,e,i){var u;if(super(t),this._minMaxZoom=M(Math.round(e*E),Math.round(i*E)),L(t.color)){const c=(f,d,_)=>{const m=t.color(f,d,_);return m&&$(m)||0};this._dynamicPropertyMap.set("fillColor",c)}else{const c=t.color;this.fillColor=c&&$(c)||0}const r=((u=t.cim.placement)==null?void 0:u.type)==="CIMMarkerPlacementInsidePolygon"&&t.cim.placement.shiftOddRows?2:1,n=t.height;if(L(n)){const c=(f,d,_)=>n(f,d,_)*r;this._dynamicPropertyMap.set("_height",c)}else this._height=(n||0)*r;const a=t.offsetX;if(L(a)){const c=(f,d,_)=>v(a(f,d,_));this._dynamicPropertyMap.set("_offsetX",c)}else this._offsetX=v(a||0);const o=t.offsetY;if(L(o)){const c=(f,d,_)=>v(-o(f,d,_));this._dynamicPropertyMap.set("_offsetY",c)}else this._offsetY=v(-o||0);const h=t.scaleX;L(h)?this._dynamicPropertyMap.set("_scaleX",h):this._scaleX=h||1;const l=t.angle;if(L(l)){const c=(f,d,_)=>ve(l(f,d,_));this._dynamicPropertyMap.set("_angle",c)}else this._angle=ve(l)||0;if(t.effects!=null){const c=t.effects;L(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._cimFillLayer=t,this._bitset=(t.colorLocked?it:0)|(t.applyRandomOffset?tr:0)|(t.sampleAlphaOnly?ie:0)|(t.hasUnresolvedReplacementColor?er:0),this._fillMaterialKey=t.materialKey}static fromCIMFill(t,e){const[i,r]=at(t.scaleInfo,e);return new Mr(t,i,r)}bindFeature(t,e,i){const r=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(r,e,i)});const n=H.load(this._fillMaterialKey),a=this._materialCache,o=(0,this._cimFillLayer.materialHash)(r,e,i),h=a.get(o);let l=null;if(h&&F(h.spriteMosaicItem)&&(l=h.spriteMosaicItem),l){const{rect:u,width:c,height:f}=l,d=u.x+k,_=u.y+k,m=d+c,p=_+f;let y=v(this._height);y<=0&&(y=p-_),yL(t.width)?.5*v(t.width(c,f,d)):r;this._dynamicPropertyMap.set("_halfWidth",n),L(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,L(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const a=t.color;if(L(a)){const c=(f,d,_)=>$(a(f,d,_));this._dynamicPropertyMap.set("_fillColor",c)}else this._fillColor=a&&$(a)||0;const o=t.miterLimit;if(L(o)){const c=(f,d,_)=>be(o(f,d,_));this._dynamicPropertyMap.set("_miterLimitCosine",c)}else this._miterLimitCosine=be(o);if(t.effects!=null){const c=t.effects;L(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._scaleFactor=t.scaleFactor||1,this._isDashed=t.dashTemplate!=null;const h=t.colorLocked?it:0,l=t.scaleDash?Ji:0,u=t.sampleAlphaOnly?ie:0;this.tessellationProperties._bitset=h|l|u,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,r]=at(t.scaleInfo,e);return new wr(t,i,r)}bindFeature(t,e,i){const r=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(r,e,i)}),this._halfWidth*=this._scaleFactor;const n=this._materialCache,a=(0,this._cimLineLayer.materialHash)(r,e,i),o=n.get(a);let h=null;if(o&&F(o.spriteMosaicItem)&&(h=o.spriteMosaicItem),h){this._hasPattern=!0;const{rect:u,width:c,height:f}=h,d=u.x+k,_=u.y+k,m=d+c,p=_+f;this.tessellationProperties._tl=M(d,_),this.tessellationProperties._br=M(m,p)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const l=rt.load(this._materialKey);h&&(l.sdf=h.sdf,l.pattern=!0,l.textureBinding=h.textureBinding),this._materialKey=l.data}};const bn=Mt(),Sn=Q();let Ln=class br extends _r(ue){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=M(Math.round(e*E),Math.round(i*E));const r=t.color;if(L(r)){const f=(d,_,m)=>$(r(d,_,m));this._dynamicPropertyMap.set("_fillColor",f)}else this._fillColor=$(r);const n=t.outlineColor;if(L(n)){const f=(d,_,m)=>$(n(d,_,m));this._dynamicPropertyMap.set("_outlineColor",f)}else this._outlineColor=$(n);const a=t.size;if(L(a)){const f=(d,_,m)=>v(a(d,_,m));this._dynamicPropertyMap.set("_size",f)}else this._size=v(a)||0;const o=t.scaleX;L(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o;const h=t.offsetX;if(L(h)){const f=(d,_,m)=>v(h(d,_,m));this._dynamicPropertyMap.set("xOffset",f)}else this.xOffset=v(h)||0;const l=t.offsetY;if(L(l)){const f=(d,_,m)=>v(l(d,_,m));this._dynamicPropertyMap.set("yOffset",f)}else this.yOffset=v(l)||0;const u=t.outlineWidth;if(L(u)){const f=(d,_,m)=>v(u(d,_,m));this._dynamicPropertyMap.set("_outlineWidth",f)}else this._outlineWidth=v(u)||0;const c=t.rotation;if(L(c)?this._dynamicPropertyMap.set("_angle",c):this._angle=c||0,t.effects!=null){const f=t.effects;L(f)?this._dynamicPropertyMap.set("_effects",f):this._effects=f}if(t.markerPlacement!=null){const f=t.markerPlacement;L(f)?this._dynamicPropertyMap.set("_markerPlacement",f):this._markerPlacement=f}this._scaleFactor=t.scaleFactor??1,this._bitSet=(t.alignment===K.MAP?Yi:qi)|(t.colorLocked?it:0)|(t.scaleSymbolsProportionally?ji:0),this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,r]=at(t.scaleInfo,e);return new br(t,i,r)}bindFeature(t,e,i){const r=t.readLegacyFeature(),n=t.getObjectId();this._dynamicPropertyMap.forEach((Y,ft)=>{this[ft]=Y(r,e,i)});const a=this._cimMarkerLayer.materialHash,o=typeof a=="function"?a(r,e,i,n):a,h=this._materialCache.get(o);if(!h||!F(h.spriteMosaicItem)||!h.spriteMosaicItem)return void St.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new bt("mapview-cim","Encountered an error when binding feature"));const l=h.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,c=l.width/l.height*this._scaleX,f=dt.load(this._materialKey);f.sdf=l.sdf,f.pattern=!0,f.textureBinding=l.textureBinding,this._materialKey=f.data;const d=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle,_=this._size,m=_*c,p=this.xOffset,y=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const x=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/v(this._cimMarkerLayer.frameHeight):1,g=this._outlineWidth*x,w=v(this._cimMarkerLayer.referenceSize);let S=0,T=0;const z=this._cimMarkerLayer.anchorPoint;z&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(S=v(z.x)/(this._size*c),T=v(z.y)/this._size):(S=z.x,T=z.y)),this._anchorX=S,this._anchorY=T,this._sizeOutlineWidth=P(Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*_),255)),Math.round(Math.min(Math.sqrt(128*g),255)),Math.round(Math.min(Math.sqrt(128*w),255))),this.angle=d;const I=Math.round(64*u);this._bitestAndDistRatio=M(this._bitSet,I),this._computeSize(m,_,u,g,this._scaleFactor,l,f.hasSizeVV(),!0),this._applyTransformation(Sn,bn),this.xOffset=p,this.yOffset=y}};function Ke(s){if(s==null)return[];const t=new Array(s.length);for(let e=0;e$(n(p,y,x));this._dynamicPropertyMap.set("_color",m)}else this._color=$(n);const a=t.outlineColor;if(L(a)){const m=(p,y,x)=>$(a(p,y,x));this._dynamicPropertyMap.set("_haloColor",m)}else this._haloColor=$(a);let o;L(t.size)||(o=Math.min(Math.round(v(t.size*t.sizeRatio)),127));const h=(m,p,y)=>L(t.size)?Math.min(Math.round(v(t.size(m,p,y)*t.sizeRatio)),127):o;if(this._dynamicPropertyMap.set("_size",h),L(t.outlineSize)){const m=(p,y,x)=>Math.min(Math.floor(Ri*v(t.outlineSize(p,y,x)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",m)}else this._haloSize=Math.min(Math.floor(Ri*v(t.outlineSize*t.sizeRatio)),127);let l;L(t.offsetX)||(l=Math.round(v(t.offsetX*t.sizeRatio)));const u=(m,p,y)=>L(t.offsetX)?Math.round(v(t.offsetX(m,p,y)*t.sizeRatio)):l;let c;this._dynamicPropertyMap.set("_xOffset",u),L(t.offsetY)||(c=Math.round(v(t.offsetY*t.sizeRatio)));const f=(m,p,y)=>L(t.offsetY)?Math.round(v(t.offsetY(m,p,y)*t.sizeRatio)):c;if(this._dynamicPropertyMap.set("_yOffset",f),L(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,L(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,L(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,t.effects!=null){const m=t.effects;L(m)?this._dynamicPropertyMap.set("_effects",m):this._effects=m}if(t.markerPlacement!=null){const m=t.markerPlacement;L(m)?this._dynamicPropertyMap.set("_markerPlacement",m):this._textPlacement=m}L(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._backgroundColor=t.backgroundColor&&$(t.backgroundColor),this._borderLineColor=t.borderLineColor&&$(t.borderLineColor),this._borderLineSize=t.borderLineWidth,this._scaleFactor=r;const d=Math.min(Math.round(v(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*d)),this._materialKey=t.materialKey;const _=Ct.load(this._materialKey);_.sdf=!0,this._bitset=(t.alignment===K.MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=_.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,r]=at(t.scaleInfo,e);return new Sr(t,i,r)}async analyze(t,e,i,r){const n=e.readLegacyFeature(),a=Tn(this._cimTextLayer,n,i,r),o=await super.analyze(t,e,i,r,Ke(a));return o!=null&&o.glyphMosaicItems&&this._textToGlyphs.set(a,o.glyphMosaicItems),o}bindFeature(t,e,i){const r=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((a,o)=>{this[o]=a(r,e,i)}),!this._text||this._text.length===0)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/Hi,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=Ni(this._horizontalAlignment??"center"),this._yAlignD=Ui(this._verticalAlignment??"baseline");const n=this._textToGlyphs.get(this._text)??[];this.bindTextInfo(n,!1)}};class j extends vr(Rt){constructor(t,e,i,r,n,a,o,h,l,u,c,f,d,_,m,p){super(),this._effects=_||void 0;const y=H.load(t);e&&(y.sdf=e.sdf,y.pattern=!0,y.textureBinding=e.textureBinding),this.fillColor=i,this.tl=r,this.br=n,this.aux21=M(a,o),this.aux22=M(h,l),this.aux3=P(u,c,f,0),this._bitset=d,this._minMaxZoom=M(Math.round(m*E),Math.round(p*E)),this._materialKey=y.data}static fromCIMFill(t,e,i){const r=t.color,n=r&&$(r)||0,a=t.materialKey,[o,h]=at(t.scaleInfo,i);let l=(t.colorLocked?it:0)|(t.applyRandomOffset?tr:0)|(t.sampleAlphaOnly?ie:0)|(t.hasUnresolvedReplacementColor?er:0);if(!e)return new j(a,null,n,0,0,0,0,0,0,0,0,0,l,t.effects,o,h);const{rect:u,width:c,height:f}=e,d=t.scaleX||1,_=u.x+k,m=u.y+k,p=_+c,y=m+f,x=v(t.height);let g=d*x;t.cim.type==="CIMHatchFill"&&(g*=c/f);let w=x;w<=0&&(w=y-m),w{const i=new qr(e,t);return new Cn(await i.analyzeSymbolReference(s.data,!1),s.data,s.rendererKey,s.maxVVSize)};async function X(s,t,e,i){if(!s)return null;if(s.type==="cim")return Bi(s,t,e);if(s.type==="web-style"){const{fetchCIMSymbolReference:r}=await ke(()=>import("./webStyleUtils-7PxVkooF.js"),__vite__mapDeps([0,1,2])),n={type:"cim",data:await r(s,null,i)??void 0,rendererKey:s.rendererKey,maxVVSize:s.maxVVSize};return Bi(n,t,e)}return s}function Ut(s){if(!s)return null;const{avoidSDFRasterization:t,type:e,cim:i,url:r,materialHash:n,maxVVSize:a}=s,o={cim:i,type:e,mosaicHash:n,url:r,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null,avoidSDFRasterization:t};switch(e){case"marker":a&&"size"in i&&(i.size=Math.max(a,i.size)),o.size=s.size,o.path=s.path,o.animatedSymbolProperties=s.animatedSymbolProperties;break;case"line":o.dashTemplate=s.dashTemplate;break;case"text":o.text=s.text,o.fontName=s.fontName}return o}const R=St.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),Fi={sortKey:null,templates:new Array},Ge={isOutline:!1,placement:null,symbologyType:A.DEFAULT,vvFlags:0},Wn={...Ye,hash:JSON.stringify(Ye),materialKey:he(b.MARKER,Ge)},Vn={...qe,hash:JSON.stringify(qe),materialKey:he(b.LINE,Ge)},kn={...je,hash:JSON.stringify(je),materialKey:he(b.FILL,Ge)};function q(s,t){const e=s.length;return s.push(null),t.then(i=>s[e]=i),s}function $t(s){return s!=null&&!!(1&s)}function An(s){return s.name==="worker:port-closed"}class Rn{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new In,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e,i=null){this._initErrorTemplates();const r=t.hash,n=this._symbolToTemplate.get(r);if(n!=null)return n;const a=new Array,o={sortKey:i,templates:a};e&&this._createMeshTemplates(a,e,!0),this._createMeshTemplates(a,t,!1);const h=this._createGroupId(t.type==="expanded-cim"&&Bn(t));return this._idToTemplateGroup.set(h,o),this._symbolToTemplate.set(r,h),h}getTemplateGroup(t){return this._idToTemplateGroup.get(t)??Fi}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?($t(t)||R.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):Fi}getMosaicItem(t,e){const i=this._createTemplateId(),r=new Promise(n=>this._idToResolver.set(i,n));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),r}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?Pn(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],kn,!1),marker:this._createMeshTemplates([],Wn,!1),line:this._createMeshTemplates([],Vn,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(r=>{for(const{id:n,mosaicItem:a}of r)this._idToResolver.get(n)(a),this._idToResolver.delete(n)})).catch(r=>{Ae(r)?this._fetchQueue=this._fetchQueue.concat(e):An(r)||R.error(new bt("mapview-template-store","Unable to fetch requested texture resources",r))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,R)?It.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,R)?It.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,R)?j.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,R)?j.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,R)?Ce.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,R)?It.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return Le.fromText(t,e??[])}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(Ut(t),Ke(t.text));return F(e,R)?Le.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Ut(t));return F(e,R)?j.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Ut(t));return F(e,R)?Ce.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Ut(t));return F(e,R)?It.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;let i=this._cimTemplateCache.get(e);if(i!=null)return i;switch(t.type){case"marker":i=await this._createCIMMarker(t);break;case"line":i=await this._createCIMLine(t);break;case"fill":i=await this._createCIMFill(t);break;case"text":i=await this._createCIMText(t)}return this._cimTemplateCache.set(e,i),i}async _createDynamicCIM(t){const e=t.templateHash;let i=this._cimTemplateCache.get(e);if(i!=null)return i;switch(t.type){case"marker":i=Ln.fromCIMMarker(t,this._tileInfo);break;case"line":i=wn.fromCIMLine(t,this._tileInfo);break;case"fill":i=Mn.fromCIMFill(t,this._tileInfo);break;case"text":i=zn.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return q(t,this._createSMS(e));case"esriPMS":return q(t,this._createPMS(e));case"esriSFS":return q(t,this._createSFS(e,i));case"line-marker":return q(t,this._createLMS(e));case"esriPFS":return q(t,this._createPFS(e,i));case"esriSLS":return q(t,this._createSLS(e,!1));case"esriTS":return q(t,this._createTS(e));default:return R.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(e.type.includes("3d"))return R.error("3D symbols are not supported with MapView"),t;if(e.type==="expanded-cim"){for(const r of e.layers)typeof r.materialHash=="function"?q(t,this._createDynamicCIM(r)):q(t,this._createCIM(r));return t}if(e.type==="composite-symbol"){for(const r of e.layers)this._createPrimitiveMeshTemplates(t,r,i);return t}return e.type==="cim"||e.type==="label"||e.type==="web-style"?t:this._createPrimitiveMeshTemplates(t,e,i)}}const Bn=s=>{if(!s.layers)return!1;for(const t of s.layers)if(typeof t.materialHash=="function")return!0;return!1};class Fn{constructor(t,e,i){this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){t.mesh.labels!=null&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if(t.type==="simple"){for(const r of t.classes){const n=Qt.fromLabelClass(r,e);i.set(r.index,n)}return i}for(const r in t.classes){const n=t.classes[r];for(const a of n){const o=Qt.fromLabelClass(a,e);i.set(a.index,o)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,r,n,a,o){if(Qe(o))return;let h;(i==null?void 0:i.type)==="dictionary"&&(h=await i.analyze(this._idField,t.copy(),e,n,a,o));let l=0;for(;t.next();){let u=null;if(u=h?h[l++]:r!=null&&Xi(t.getDisplayId())&&t.readAttribute("cluster_count")!==1?r.match(this._idField,t,this._geometryType,n,a):i.match(this._idField,t,this._geometryType,n,a),t.setGroupId(u),$t(u)){const c=this._templateStore.getDynamicTemplateGroup(u).templates;for(const f of c)f&&f.analyze&&f.analyze(this._templateStore,t,n,a)}}return await ti(),this._templateStore.finalize(o)}async analyzeGraphics(t,e,i,r,n,a){if(Qe(a))return;const o=t.getCursor();for(i&&await i.analyze(this._idField,o.copy(),e,r,n,a);o.next();){let h=o.getGroupId();if(h!=null&&h!==-1||(h=i==null?void 0:i.match(this._idField,o,o.geometryType,r,n),o.setGroupId(h)),$t(h)){const l=this._templateStore.getDynamicTemplateGroup(h).templates;for(const u of l)u&&u.analyze&&u.analyze(this._templateStore,o,r,n)}o.setGroupId(h)}return await ti(),this._templateStore.finalize(a)}writeGraphic(t,e,i,r){const n=e.getGroupId(),a=e.getDisplayId(),o=this._templateStore.getTemplateGroup(n);if(t.featureStart(e.insertAfter,0),a!=null){if($t(n))for(const h of o.templates)h&&h.bindFeature(e,null,null);if(o){for(const h of o.templates)h&&h.write(t,e,i,r);t.featureEnd()}}}writeCursor(t,e,i,r,n,a,o){const h=e.getGroupId(),l=e.getDisplayId(),u=this._templateStore.getTemplateGroup(h),c=u.templates,f=this._getSortKeyValue(e,u);if(t.featureStart(0,f),l!=null&&c){if($t(h))for(const d of c)d.bindFeature(e,i,r);for(const d of c)d.write(t,e,n,o);if(c.length&&a!=null){const d=a&&this._findLabelRef(c);this._writeLabels(t,e,a,d,n,o)}t.featureEnd()}}_getSortKeyValue(t,e){const i=this._schema.mesh.sortKey;if(i==null)return 0;let r=0;return r=i.byRenderer===!0&&e.sortKey!=null?e.sortKey:i.fieldIndex!=null?t.getComputedNumericAtIndex(i.fieldIndex):i.field!=null?t.readAttribute(i.field):t.readAttribute(this._idField),r*=i.order==="asc"?1:-1,r==null||isNaN(r)?0:r}_findLabelRef(t){for(const e of t)if(e instanceof It)return e;return null}_writeLabels(t,e,i,r,n,a){for(const o of i)if(o!=null&&o){const{glyphs:h,rtl:l,index:u}=o,c=this._labelTemplates.get(u);if(!c)continue;c.setZoomLevel(n),c.bindReferenceTemplate(r),c.bindTextInfo(h,l),c.write(t,e,null,a)}}}const Ee=St.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function We(s,t,e,i){switch(s.type){case"simple":case"heatmap":return nt.fromBasicRenderer(s,t,e,i);case"map":return Ne.fromUVRenderer(s,t,e,i);case"interval":return Ze.fromCBRenderer(s,t,e,i);case"dictionary":return Ue.fromDictionaryRenderer(s,t,e,i);case"pie-chart":return te.fromPieChartRenderer(s,t,e,i);case"subtype":return te.fromSubtypes(s,t,e,i)}}class nt{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i,r){const n=new nt;if(t.symbol){const a=await X(t.symbol,i,r),o=e.createTemplateGroup(a,null);n.setDefault(o)}return n}static async fromPieChartRenderer(t,e,i,r){const n=new nt;if(t.markerSymbol){const a=await X(t.markerSymbol,i,r);let o;t.fillSymbol&&(o=await X(t.fillSymbol,i,r));const h=e.createTemplateGroup(a,o);n.setDefault(h)}return n}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,r,n){return this.getDefault()}async analyze(t,e,i,r,n,a){return null}}class te extends nt{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i,r){const n=new Map,a=[];for(const o in t.renderers){const h=parseInt(o,10),l=We(t.renderers[o],e,i,r).then(u=>n.set(h,u));a.push(l)}return await Promise.all(a),new te(n,t.subtypeField)}match(t,e,i,r,n){const a=e.readAttribute(this._subtypeField),o=this._subMatchers.get(a);return o?o.match(t,e,i,r,n):null}}class Ze extends nt{constructor(t,e,i,r){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=r,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i,r){const{isMaxInclusive:n,normalizationField:a,normalizationTotal:o,normalizationType:h}=t,l=t.field,u=new Ze(l,n,{normalizationField:a,normalizationTotal:o,normalizationType:h},t.fieldIndex),c=await X(t.backgroundFillSymbol,i,r);await Promise.all(t.intervals.map(async d=>{const _=await X(d.symbol,i,r),m=e.createTemplateGroup(_,c),p={min:d.min,max:d.max};u.add(p,m)}));const f=await X(t.defaultSymbol,i,r);if(f){const d=e.createTemplateGroup(f,c);u.setDefault(d)}return u}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((i,r)=>i.interval.min-r.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,r,n){if(this._fieldIndex==null&&!this._field)return this.getDefault();const a=this._fieldIndex!=null?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(a==null||isNaN(a)||a===1/0||a===-1/0)return this.getDefault();for(let o=0;o=h.min,c=this._isMaxInclusive?a<=h.max:a{const f=await X(u.symbol,i,r),d=c+1,_=e.createTemplateGroup(f,o,d);u.value===""?h.setNullResult(_):h.add(u.value,_)}));const l=await X(t.defaultSymbol,i,r);if(l){const u=Number.MAX_SAFE_INTEGER,c=e.createTemplateGroup(l,o,u);h.setDefault(c)}return h}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,r,n){if(this._fieldsIndex==null&&!this._fields)return this.getDefault();const a=this._fieldsIndex!=null?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(this._nullResult!==null&&(a==null||a===""||a===""))return this._nullResult;if(a==null)return this.getDefault();const o=a.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const r=t.readAttribute(i);r==null||r===""?e.push(""):e.push(r)}return e.join(this._seperator)}}async function On(s,t){const e=s||1;if(typeof e=="number")return(r,n,a)=>e;const i=await kr(e,t.spatialReference,t.fields);return(r,n,a)=>Ar(i,r,{$view:a},t.geometryType,n)||1}let _e;async function Dn(){return _e||(_e=ke(()=>import("./createSymbolSchema-Tv2jMAOE.js"),__vite__mapDeps([3,4,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))),_e}class Ue extends nt{constructor(t,e,i,r,n,a){super(),this.type="dictionary",this._groupIdCache=new Wr(100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=r,this._schemaUtilsModule=n,this._symbolOptions=a}static async fromDictionaryRenderer(t,e,i,r){const[{DictionaryLoader:n},a]=await Promise.all([ke(()=>import("./index-J0iiHjMT.js").then(l=>l.zB),__vite__mapDeps([1,2])),Dn()]),o=new n(t.url,t.config,t.fieldMap);await o.fetchResources({spatialReference:i.spatialReference,fields:i.fields});const h=await On(t.scaleExpression,i);return new Ue(o,e,i,h,a,t.symbolOptions)}async _analyzeFeature(t,e,i,r,n){const a=t.readLegacyFeature(),o=this._scaleFn(a,i,r),h=this._attributeHash(a)+"-"+o,l=this._groupIdCache.get(h);if(l)return l;const u={...r,spatialReference:this._info.spatialReference,abortOptions:n,fields:this._info.fields},c=await this._loader.getSymbolAsync(a,u),f=this._schemaUtilsModule.createSymbolSchema(c,this._symbolOptions),d=X(f,this._info,e,n).then(_=>{if((_==null?void 0:_.type)!=="expanded-cim")return Ee.error(new bt("mapview-bad-type",`Found unexpected type ${_==null?void 0:_.type} in dictionary response`)),null;_.hash+="-"+o;for(const m of _.layers)m.scaleFactor=o,m.templateHash+="-"+o;return this._templates.createTemplateGroup(_,null)});return this._groupIdCache.put(h,d,1),d}async analyze(t,e,i,r,n,a){const o=e.getCursor(),h=[];for(;o.next();)h.push(this._analyzeFeature(o,i,r,n,a));return Promise.all(h).then(l=>l.filter(Vr))}match(t,e,i,r,n){return null}_attributeHash(t){var i;let e="";for(const r of this._symbolFields){const n=(i=this._fieldMap)==null?void 0:i[r];n&&(e+=t.attributes[n]+"-")}return e}}class Kn{constructor(t){this._remoteClient=t,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){}async fetchResource(t,e){const i=this._resourceMap,r=i.get(t);if(r)return r;let n=this._inFlightResourceMap.get(t);if(n)return n;try{n=this._remoteClient.invoke("tileRenderer.fetchResource",{url:t},{...e}),this._inFlightResourceMap.set(t,n),n.then(a=>(this._inFlightResourceMap.delete(t),i.set(t,a),a))}catch(a){return Ae(a)?null:{width:0,height:0}}return n}getResource(t){return this._resourceMap.get(t)??null}loadFont(t){return Promise.resolve(null)}}function Oi(s,t){const e=t-t/4,i=t+t/2;return(!s.minScale||s.minScale>=e)&&(!s.maxScale||s.maxScale<=i)}function Di(s){var i;const t=s.message,e={message:{data:{},tileKey:t.tileKey,tileKeyOrigin:t.tileKeyOrigin,version:t.version},transferList:new Array};for(const r in t.data){const n=r,a=t.data[n];if(e.message.data[n]=null,a!=null){const o=a.stride,h=a.indices.slice(0),l=a.vertices.slice(0),u=a.records.slice(0),c=(i=a.metrics)==null?void 0:i.slice(0),f={stride:o,indices:h,vertices:l,records:u,metrics:c};e.transferList.push(h,l,u),e.message.data[n]=f}}return e}let Ve=class extends hs{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.addHandles([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new Kn(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(s){this._bufferIds.forEach(t=>{t.forEach(s)})}async update(s,t){var r;const e=t.schema.processors[0];if(e.type!=="symbol")return;const i=Fr(this._schema,e);(Je(i,"mesh")||Je(i,"target"))&&(s.mesh=!0,(r=s.why)==null||r.mesh.push("Symbology changed"),this._schema=e,this._factory=this._createFactory(e),this._factory.update(e,this.tileStore.tileScheme.tileInfo))}onTileMessage(s,t,e,i){return Lt(i),this._onTileData(s,t,e,i)}onTileClear(s,t){const e={clear:!0,end:t};return this._bufferData.delete(s.key.id),this._bufferIds.delete(s.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:e})}onTileError(s,t,e){const i=e.signal,r={tileKey:s.id,error:t};return this.remoteClient.invoke("tileRenderer.onTileError",r,{signal:i})}onTileUpdate(s){for(const t of s.removed)this._bufferData.has(t.key.id)&&this._bufferData.delete(t.key.id),this._bufferIds.has(t.key.id)&&this._bufferIds.delete(t.key.id);for(const t of s.added)this._bufferData.forEach(e=>{for(const i of e)i.message.tileKey===t.id&&this._updateTileMesh("append",t,Di(i),[],!1,!1,null)})}_addBufferData(s,t){var e;this._bufferData.has(s)||this._bufferData.set(s,[]),(e=this._bufferData.get(s))==null||e.push(Di(t))}_createFactory(s){const{geometryType:t,objectIdField:e,fields:i}=this.service,r=(l,u)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",l,u),n={geometryType:t,fields:i,spatialReference:Or.fromJSON(this.spatialReference)},a=new Rn(r,this.tileStore.tileScheme.tileInfo),{matcher:o,aggregateMatcher:h}=s.mesh;return this._store=a,this._matchers.feature=We(o,a,n,this._resourceManagerProxy),this._matchers.aggregate=h?We(h,a,n,this._resourceManagerProxy):null,new Fn(t,e,a)}async _onTileData(s,t,e,i){var c;Lt(i);const{type:r,addOrUpdate:n,remove:a,clear:o,end:h}=t,l=!!this._schema.mesh.sortKey;if(!n){const f={type:r,addOrUpdate:null,remove:a,clear:o,end:h,sort:l};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:f},i)}const u=this._processFeatures(s,n,e,i,(c=t.status)==null?void 0:c.version);try{const f=await u;if(f==null){const _={type:r,addOrUpdate:null,remove:a,clear:o,end:h,sort:l};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:_},i)}const d=[];for(const _ of f){let m=!1;const p=_.message.bufferIds,y=s.key.id,x=_.message.tileKey;if(y!==x&&p!=null){if(!this.tileStore.get(x)){this._addBufferData(y,_),d.push(_);continue}let g=this._bufferIds.get(x);g||(g=new Set,this._bufferIds.set(x,g));const w=Array.from(p);for(const S of w){if(g.has(S)){m=!0;break}g.add(S)}}m||(this._addBufferData(y,_),d.push(_))}await Promise.all(d.map(_=>{const m=s.key.id===_.message.tileKey,p=m?t.remove:[],y=m&&t.end;return this._updateTileMesh(r,s,_,p,y,!!t.clear,i.signal)}))}catch(f){this._handleError(s,f,i)}}async _updateTileMesh(s,t,e,i,r,n,a){const o=s,h=e.message.tileKey,l=!!this._schema.mesh.sortKey;h!==t.key.id&&(r=!1);const u=e==null?void 0:e.message,c={type:o,addOrUpdate:u,remove:i,clear:n,end:r,sort:l},f={transferList:(e==null?void 0:e.transferList)??[],signal:a};return Lt(f),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:h,data:c},f)}async _processFeatures(s,t,e,i,r){if(t==null||!t.hasFeatures)return null;const n={transform:s.transform,hasZ:!1,hasM:!1},a=this._factory,o={viewingMode:"",scale:s.scale},h=await this._matchers.feature,l=await this._matchers.aggregate;Lt(i);const u=this._getLabelInfos(s,t);return await a.analyze(t.getCursor(),this._resourceManagerProxy,h,l,n,o),Lt(i),this._writeFeatureSet(s,t,n,u,a,e,r)}_writeFeatureSet(s,t,e,i,r,n,a){const o=t.getSize(),h=this._schema.mesh.matcher.symbologyType,l=new bs(s.key.id,{features:o,records:o,metrics:0},h,n,h!==A.HEATMAP,a),u={viewingMode:"",scale:s.scale},c=t.getCursor();for(;c.next();)try{const d=c.getDisplayId(),_=i!=null?i.get(d):null;r.writeCursor(l,c,e,u,s.level,_,this._resourceManagerProxy)}catch{}const f=s.tileInfoView.tileInfo.isWrappable;return l.serialize(f)}_handleError(s,t,e){if(!Ae(t)){const i={tileKey:s.id,error:t.message};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:e.signal})}return Promise.resolve()}_getLabelingSchemaForScale(s){const t=this._schema.mesh.labels;if(t==null)return null;if(t.type==="subtype"){const i={type:"subtype",classes:{}};let r=!1;for(const n in t.classes){const a=t.classes[n].filter(o=>Oi(o,s.scale));r=r||!!a.length,i.classes[n]=a}return r?i:null}const e=t.classes.filter(i=>Oi(i,s.scale));return e.length?{type:"simple",classes:e}:null}_getLabels(s,t){if(t.type==="subtype"){const e=this.service.subtypeField;Dr(e,"Expected to find subtype Field");const i=s.readAttribute(e);return i==null?[]:t.classes[i]??[]}return t.classes}_getLabelInfos(s,t){const e=this._getLabelingSchemaForScale(s);if(e==null)return null;const i=new Map,r=t.getCursor();for(;r.next();){const n=r.getDisplayId(),a=[],o=Xi(n),h=o&&r.readAttribute("cluster_count")!==1?"aggregate":"feature",l=this._getLabels(r,e);for(const u of l){if(u.target!==h)continue;const c=r.getStorage(),f=o&&h==="feature"?c.getComputedStringAtIndex(r.readAttribute("referenceId"),u.fieldIndex):c.getComputedStringAtIndex(n,u.fieldIndex);if(!f)continue;const d=ye(f.toString()),_=d[0],m=d[1];this._store.getMosaicItem(u.symbol,Ke(_)).then(p=>{a[u.index]={glyphs:p.glyphMosaicItems??[],rtl:m,index:u.index}})}i.set(n,a)}return i}};Ve=Rr([Br("esri.views.2d.layers.features.processors.SymbolProcessor")],Ve);const Gn=Ve,xa=Object.freeze(Object.defineProperty({__proto__:null,default:Gn},Symbol.toStringTag,{value:"Module"}));export{ha as A,xa as S,ar as _,he as f}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/webStyleUtils-7PxVkooF.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/createSymbolSchema-Tv2jMAOE.js","assets/cimAnalyzer-DtyBzAGI.js","assets/labelPoint-ysDT9nFH.js","assets/TileClipper-NSFZXMR1.js","assets/definitions-DqQMJYPH.js","assets/number-sTjsTbdA.js","assets/BidiEngine-8z8MVveq.js","assets/enums-uQoFEhYh.js","assets/Pipeline--6jAENf8.js","assets/QueryEngine-8tLWlkSE.js","assets/WhereClause-XAMIZ4-B.js","assets/TimeOnly-ljWtUK7N.js","assets/json-v6EOeNTY.js","assets/QueryEngineCapabilities-PzVpW5yD.js","assets/utils-P5wTOmqv.js","assets/generateRendererUtils-_1jVE02H.js","assets/StreamFeatureManager-QrKJ84_c.js","assets/quickselect-UFB0jJTZ.js","assets/ogcFeatureUtils-dtzP0u64.js","assets/geojson-fSjaGZrp.js","assets/date-be_IQzZd.js","assets/clientSideDefaults-F-CNnR0g.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/queryZScale-IaMm02_2.js","assets/createConnection-4ppGVnSc.js","assets/geohashUtils-U0jvYCSY.js","assets/BaseProcessor-nWGHAt7P.js","assets/TurboLine-SWK4qRwh.js","assets/Rect-bBBxMtVp.js","assets/GeometryUtils-K2DOc0l8.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/TerrainTileTree3DDebugger-Or7WvqAU.js b/dist/assets/TerrainTileTree3DDebugger-Or7WvqAU.js new file mode 100644 index 0000000..56fb077 --- /dev/null +++ b/dist/assets/TerrainTileTree3DDebugger-Or7WvqAU.js @@ -0,0 +1 @@ +import{d as a,P as i,l as t,eD as n,e as l,c as o}from"./index-J0iiHjMT.js";import{d as p}from"./TileTreeDebugger-2DVbY5sQ.js";let s=class extends p{constructor(e){super(e),this.enablePolygons=!1}initialize(){a(()=>this.enabled,e=>this.view.basemapTerrain.renderPatchBorders=e,i)}getTiles(){const e=this.view.basemapTerrain.spatialReference!=null?this.view.basemapTerrain.spatialReference:null;return this.view.basemapTerrain.test.getRenderedTiles().map(r=>({...r,geometry:t.fromExtent(n(r.extent,e))}))}};s=l([o("esri.views.3d.layers.support.TerrainTileTree3DDebugger")],s);export{s as TerrainTileTree3DDebugger}; diff --git a/dist/assets/TextOverlayItem-eCjvS6IO.js b/dist/assets/TextOverlayItem-eCjvS6IO.js new file mode 100644 index 0000000..f1339eb --- /dev/null +++ b/dist/assets/TextOverlayItem-eCjvS6IO.js @@ -0,0 +1 @@ +import{e as n,y as h,c as m,p as b,ab as g}from"./index-J0iiHjMT.js";let _=t=>({vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}),v=(t,e,o)=>{for(let s=0,r=e.length;s0;)--t,e(s[t],t)}function Rt(s,e){const t=s.length;for(let i=0;i0;)if(--t,e(s[t],t))return t;return-1}function Qe(s,e){const t=Le(s,e);if(t!==-1)return s[t]}function Ze(s,e){const t=qe(s,e);if(t!==-1)return s[t]}function et(s,e){let t=0,i=s.length,r=!1;for(;t>1,a=e(s[n]);a<0?t=n+1:a===0?(r=!0,t=n+1):i=n}return{found:r,index:r?t-1:t}}function tt(s,e){let t=0,i=s.length,r=!1;for(;t>1,a=e(s[n]);a<0?t=n+1:(a===0&&(r=!0),i=n)}return{found:r,index:t}}function Vt(s,e){let t=s.length;for(;t>0;)--t,e(s[t])||s.splice(t,1)}class Ne{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class P{constructor(e){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=e}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Ut extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){g(this._disposers,e=>{e.dispose()})}}class k extends Ne{constructor(e){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=e}_dispose(){g(this._disposers,e=>{e.dispose()})}get disposers(){return this._disposers}}class it extends P{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new P(()=>{--this._counter,this._counter===0&&this.dispose()})}}class ${constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const e=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{g(e,t=>{t.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(e){return Je(this._listeners,t=>(t.type===null||t.type===e)&&!t.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(e){delete this._disabled[e]}disableType(e,t=1/0){this._disabled[e]=t}_removeListener(e){if(this._iterating===0){const t=this._listeners.indexOf(e);if(t===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(t,1)}else this._killed.push(e)}_removeExistingListener(e,t,i,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==e||n.type!==t||i!==void 0&&n.callback!==i||n.context!==r||n.disposer.dispose()})}isEnabled(e){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(e)&&this._disabled[e]===void 0}removeType(e){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(t=>{t.type===e&&t.disposer.dispose()})}has(e,t,i){return Le(this._listeners,r=>r.once!==!0&&r.type===e&&(t===void 0||r.callback===t)&&r.context===i)!==-1}_shouldDispatch(e){if(this._disposed)throw new Error("EventDispatcher is disposed");const t=this._disabled[e];return _(t)?(t<=1?delete this._disabled[e]:--this._disabled[e],!1):this._enabled}_eachListener(e){++this._iterating;try{g(this._listeners,e)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(g(this._killed,t=>{this._removeListener(t)}),this._killed.length=0)}}dispatch(e,t){this._shouldDispatch(e)&&this._eachListener(i=>{i.killed||i.type!==null&&i.type!==e||i.dispatch(e,t)})}_on(e,t,i,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(e,t,i,r);const o={type:t,callback:i,context:r,shouldClone:n,dispatch:a,killed:!1,once:e,disposer:new P(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(e,t,i=!0){return this._on(!1,null,e,t,i,(r,n)=>e.call(t,n)).disposer}on(e,t,i,r=!0){return this._on(!1,e,t,i,r,(n,a)=>t.call(i,a)).disposer}once(e,t,i,r=!0){const n=this._on(!0,e,t,i,r,(a,o)=>{n.disposer.dispose(),t.call(i,o)});return n.disposer}off(e,t,i){this._removeExistingListener(!1,e,t,i)}copyFrom(e){if(this._disposed)throw new Error("EventDispatcher is disposed");if(e===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const t=[];return g(e._listeners,i=>{!i.killed&&i.shouldClone&&(i.type===null?t.push(this.onAll(i.callback,i.context)):i.once?t.push(this.once(i.type,i.callback,i.context)):t.push(this.on(i.type,i.callback,i.context)))}),new k(t)}}function R(s,e){if(!(s>=0&&s=0&&e{this.push(t)})}copyFrom(e){this.pushAll(e._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(e){const t=this._values;this._values=[],this._onClear(t),g(e,i=>{this._values.push(i),this._onPush(i)})}clear(){this.setAll([])}*[Symbol.iterator](){const e=this._values.length;for(let t=0;t{t.dispose()}),super._onClear(e)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this.autoDispose&&g(this._values,e=>{e.dispose()}))}}class Kt extends st{constructor(e,t){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=e,this.make=t}}class rt extends Re{constructor(e){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=e,this._events=this.events.onAll(t=>{if(t.type==="clear")g(t.oldValues,i=>{this._onRemoved(i)});else if(t.type==="push")this._onInserted(t.newValue);else if(t.type==="setIndex")this._onRemoved(t.oldValue),this._onInserted(t.newValue,t.index);else if(t.type==="insertIndex")this._onInserted(t.newValue,t.index);else if(t.type==="removeIndex")this._onRemoved(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(t.value),this._onInserted(t.value,t.newIndex)}})}_onInserted(e,t){e._setParent(this._container,!0);const i=this._container._childrenDisplay;t===void 0?i.addChild(e._display):i.addChildAt(e._display,t)}_onRemoved(e){this._container._childrenDisplay.removeChild(e._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),g(this.values,e=>{e.dispose()}))}}class f{constructor(e){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=e}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(e,t){return e+this.value*(t-e)}static normalize(e,t,i){return e instanceof f?e:new f(t===i?0:100*Math.min(Math.max(1/(i-t)*(e-t),0),1))}}function xe(s){return new f(s)}const zt=xe(0),nt=xe(100),at=xe(50);function T(s){return Object.keys(s)}function ot(s,e){return T(s).sort(e)}function Gt(s){return Object.assign({},s)}function w(s,e){T(s).forEach(t=>{e(t,s[t])})}function Yt(s,e){for(let t in s)if(ht(s,t)&&!e(t,s[t]))break}function ht(s,e){return{}.hasOwnProperty.call(s,e)}function Xt(s){s.parentNode&&s.parentNode.removeChild(s)}function Fe(s,e,t,i){return s.addEventListener(e,t,i||!1),new P(()=>{s.removeEventListener(e,t,i||!1)})}function $t(s){return Fe(window,"resize",e=>{s()})}function le(s){switch(s){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function de(s){return s.pointerId||0}function Jt(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let s=document.createElement("button");s.style.position="fixed",s.style.top="0px",s.style.left="-10000px",document.body.appendChild(s),s.focus(),s.blur(),document.body.removeChild(s)}}function qt(s){s&&s.focus()}function Qt(s){if(le("pointerevents"))return s;if(le("touchevents"))switch(s){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(le("mouseevents"))switch(s){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return s}function Se(s){if(typeof Touch<"u"&&s instanceof Touch)return!0;if(typeof PointerEvent<"u"&&s instanceof PointerEvent&&s.pointerType!=null)switch(s.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(s instanceof MouseEvent)}else if(s.type!=null&&s.type.match(/^mouse/))return!1;return!0}function Zt(s,e,t){s.style[e]=t}function ei(s,e){return s.style[e]}function ti(s){if(s.composedPath){const e=s.composedPath();return e.length===0?null:e[0]}return s.target}function lt(s,e){let t=e;for(;;){if(s===t)return!0;if(t.parentNode===null){if(t.host==null)return!1;t=t.host}else t=t.parentNode}}function dt(s,e){return s.target&<(e.root.dom,s.target)}function ii(s,e){s.style.pointerEvents=e?"auto":"none"}function ut(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function si(){return ut()?1:void 0}function C(s,e){return _(s)?s:s!=null&&_(s.value)&&_(e)?e*s.value:0}function ri(s){let e=(""+s).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function ue(s,e=0,t="0"){return typeof s!="string"&&(s=s.toString()),e>s.length?Array(e-s.length+1).join(t)+s:s}function pt(s){return s.replace(/^[\s]*/,"")}function ct(s){return s.replace(/[\s]*$/,"")}function We(s){return pt(ct(s))}function gt(s){if(s===void 0)return"string";let e=(s=(s=(s=s.toLowerCase().replace(/^\[[^\]]*\]/,"")).replace(/\[[^\]]+\]/,"")).trim()).match(/\/(date|number|duration)$/);return e?e[1]:s==="number"?"number":s==="date"?"date":s==="duration"?"duration":s.match(/[#0]/)?"number":s.match(/[ymwdhnsqaxkzgtei]/)?"date":"string"}function ni(s){return s.replace(/\/(date|number|duration)$/i,"")}function ai(s){return s&&s.replace(/<[^>]*>/g,"")}function oi(s){return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function hi(s,e=!1){const t=new Date(s.getFullYear(),0,0),i=s.getTime()-t.getTime()+60*(t.getTimezoneOffset()-s.getTimezoneOffset())*1e3;return Math.floor(i/864e5)}function je(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;t.setUTCDate(t.getUTCDate()+4-i);const r=new Date(Date.UTC(t.getUTCFullYear(),0,1));return Math.ceil(((t.getTime()-r.getTime())/864e5+1)/7)}function li(s,e=!1){const t=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate())),i=t.getUTCDay()||7;return t.setUTCDate(t.getUTCDate()+4-i),new Date(Date.UTC(t.getUTCFullYear(),0,1)).getFullYear()}function di(s,e=!1){const t=je(new Date(s.getFullYear(),s.getMonth(),1),e);let i=je(s,e);return i==1&&(i=53),i-t+1}function ui(s,e,t=1,i=!1){let r=new Date(e,0,4,0,0,0,0);return i&&r.setUTCFullYear(e),7*s+t-((r.getDay()||7)+3)}function pi(s,e){return s>12?s-=12:s===0&&(s=12),e!=null?s+(e-1):s}function ci(s,e=!1,t=!1,i=!1,r){if(i)return e?"Coordinated Universal Time":"UTC";if(r){const o=s.toLocaleString("en-US",{timeZone:r});return We(s.toLocaleString("en-US",{timeZone:r,timeZoneName:e?"long":"short"}).substr(o.length))}let n=s.toLocaleString("UTC"),a=s.toLocaleString("UTC",{timeZoneName:e?"long":"short"}).substr(n.length);return t===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),a}function gi(s){const e=new Date(Date.UTC(2012,0,1,0,0,0,0)),t=new Date(e.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(e.toLocaleString("en-US",{timeZone:s})).getTime()-t.getTime())/6e4*-1}function _i(s){return s.charAt(0).toUpperCase()+s.slice(1)}function Ve(s){let e,t,i,r=s.h,n=s.s,a=s.l;if(n==0)e=t=i=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;e=o(l,h,r+1/3),t=o(l,h,r),i=o(l,h,r-1/3)}return{r:Math.round(255*e),g:Math.round(255*t),b:Math.round(255*i)}}function Ue(s){let e=s.r/255,t=s.g/255,i=s.b/255,r=Math.max(e,t,i),n=Math.min(e,t,i),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case e:a=(t-i)/l+(t0?255-s:s;return Math.round(t*e)}function mt(s,e){if(s){let t=te(Math.min(Math.max(s.r,s.g,s.b),230),e);return{r:Math.max(0,Math.min(255,Math.round(s.r+t))),g:Math.max(0,Math.min(255,Math.round(s.g+t))),b:Math.max(0,Math.min(255,Math.round(s.b+t))),a:s.a}}return s}function Ee(s){return(299*s.r+587*s.g+114*s.b)/1e3>=128}function ft(s,e){if(s===void 0||e==1)return s;let t=Ue(s);return t.s=e,Ve(t)}function bt(s,e={r:255,g:255,b:255},t={r:255,g:255,b:255}){let i=e,r=t;return Ee(t)&&(i=t,r=e),Ee(s)?r:i}function mi(s,e){return s||(s=[]),[...s,...e].filter((t,i,r)=>r.indexOf(t)===i)}function fi(s,e){return!!e&&s.left==e.left&&s.right==e.right&&s.top==e.top&&s.bottom==e.bottom}function Ke(s){return s[0]==="#"&&(s=s.substr(1)),s.length==3&&(s=s[0].repeat(2)+s[1].repeat(2)+s[2].repeat(2)),parseInt(s,16)}function vt(s){let e=(s=s.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(e)e.push("1");else if(e=s.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!e)return 0;let t="";for(let i=1;i<=3;i++){let r=parseInt(e[i]).toString(16);r.length==1&&(r="0"+r),t+=r}return Ke(t)}function bi(s){return y.fromAny(s)}class y{constructor(e){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|e}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(e=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+e+")"}toCSSHex(){return"#"+ue(this.r.toString(16),2)+ue(this.g.toString(16),2)+ue(this.b.toString(16),2)}toHSL(e=1){return Ue({r:this.r,g:this.g,b:this.b,a:e})}static fromHSL(e,t,i){const r=Ve({h:e,s:t,l:i});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(e){return new y(e)}static fromRGB(e,t,i){return new y((0|i)+(t<<8)+(e<<16))}static fromString(e){return new y(Ke(e))}static fromCSS(e){return new y(vt(e))}static fromAny(e){if(Be(e)){if(e[0]=="#")return y.fromString(e);if(e.substr(0,3)=="rgb")return y.fromCSS(e)}else{if(_(e))return y.fromHex(e);if(e instanceof y)return y.fromHex(e.hex)}throw new Error("Unknown color syntax: "+e)}static alternative(e,t,i){const r=bt({r:e.r,g:e.g,b:e.b},t?{r:t.r,g:t.g,b:t.b}:void 0,i?{r:i.r,g:i.g,b:i.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(e,t,i,r="rgb"){if(r=="hsl"){const n=t.toHSL(),a=i.toHSL();return y.fromHSL(M(e,n.h,a.h),M(e,n.s,a.s),M(e,n.l,a.l))}return y.fromRGB(M(e,t.r,i.r),M(e,t.g,i.g),M(e,t.b,i.b))}static lighten(e,t){const i=_t({r:e.r,g:e.g,b:e.b},t);return y.fromRGB(i.r,i.g,i.b)}static brighten(e,t){const i=mt({r:e.r,g:e.g,b:e.b},t);return y.fromRGB(i.r,i.g,i.b)}static saturate(e,t){const i=ft({r:e.r,g:e.g,b:e.b},t);return y.fromRGB(i.r,i.g,i.b)}}function Ce(s){return Z(this,void 0,void 0,function*(){if(s!==void 0){const e=[];w(s,(t,i)=>{e.push(i.waitForStop())}),yield Promise.all(e)}})}function M(s,e,t){return e+s*(t-e)}function yt(s,e,t){return s>=1?t:e}function wt(s,e,t){return new f(M(s,e.percent,t.percent))}function Pt(s,e,t){return y.interpolate(s,e,t)}function Dt(s,e){return typeof s=="number"&&typeof e=="number"?M:s instanceof f&&e instanceof f?wt:s instanceof y&&e instanceof y?Pt:yt}const ze=Math.PI,Ge=ze/180,vi=180/ze;function yi(s,e,t){if(!_(e)||e<=0){let i=Math.round(s);return t&&i-s==.5&&i--,i}{let i=Math.pow(10,e);return Math.round(s*i)/i}}function wi(s,e){if(!_(e)||e<=0)return Math.ceil(s);{let t=Math.pow(10,e);return Math.ceil(s*t)/t}}function Me(s,e,t){return Math.min(Math.max(s,e),t)}function fe(s){return Math.sin(Ge*s)}function be(s){return Math.cos(Ge*s)}function Pi(s){return(s%=360)<0&&(s+=360),s}function Di(s,e,t,i,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(pe(r,t)),l.push(pe(r,i));let d=Math.min(90*Math.floor(t/90),90*Math.floor(i/90)),p=Math.max(90*Math.ceil(t/90),90*Math.ceil(i/90));for(let u=d;u<=p;u+=90)u>=t&&u<=i&&l.push(pe(r,u));for(let u=0;uo&&(o=c.x),c.y>h&&(h=c.y)}return{left:s+n,top:e+a,right:s+o,bottom:e+h}}function pe(s,e){return{x:s*be(e),y:s*fe(e)}}function xi(s){const e=s.length;if(e>0){let t=s[0],i=t.left,r=t.top,n=t.right,a=t.bottom;if(e>1)for(let o=1;o{this._userSettings[i]=!0})}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._userSettings[e]=!0,this.setRaw(e,t)}remove(e){delete this._userSettings[e],delete this._settings[e]}setAll(e){T(e).forEach(t=>{this.set(t,e[t])})}_eachSetting(e){w(this._settings,e)}apply(){const e={stateAnimationEasing:!0,stateAnimationDuration:!0},t=this._entity.states.lookup("default");this._eachSetting((i,r)=>{e[i]||(e[i]=!0,this!==t&&(i in t._settings||(t._settings[i]=this._entity.get(i))),this._entity.set(i,r))})}applyAnimate(e){e==null&&(e=this._settings.stateAnimationDuration),e==null&&(e=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let t=this._settings.stateAnimationEasing;t==null&&(t=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",xt)));const i=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=i&&(a in i._settings||(i._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:e,easing:t});h&&(n[a]=h)}}),n}}class Ot{constructor(e){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new kt(this._entity,t);return this._states[e]=r,r}}remove(e){delete this._states[e]}apply(e){const t=this._states[e];t&&t.apply(),this._entity._applyState(e)}applyAnimate(e,t){let i;const r=this._states[e];return r&&(i=r.applyAnimate(t)),this._entity._applyStateAnimated(e,t),i}}class Tt{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.4.8"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const L=new Tt;function Oi(s){L.licenses.push(s)}function N(s,e){return s===e?0:s{O(i,t)&&this._entity._markDirtyKey(e)})}remove(e){const t=this._callbacks[e];t!==void 0&&(delete this._callbacks[e],t.length!==0&&this._entity._markDirtyKey(e))}enable(e){this._disabled[e]&&(delete this._disabled[e],this._entity._markDirtyKey(e))}disable(e){this._disabled[e]||(this._disabled[e]=!0,this._entity._markDirtyKey(e))}fold(e,t){if(!this._disabled[e]){const i=this._callbacks[e];if(i!==void 0)for(let r=0,n=i.length;r{if(this._stopped)e();else{const i=()=>{r.dispose(),e()},r=this.events.on("stopped",i)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(e){this._oldTime!==null&&(this._time+=e-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=e}_reset(e){this._oldTime=e,this._time=0}_value(e){return this._interpolate(this._easing(e),this._from,this._to)}}let jt=0;class Et{constructor(e){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++jt}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_playingAnimations",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._settings=e}_checkDirty(){T(this._settings).forEach(e=>{this._userProperties[e]=!0,this._markDirtyKey(e)})}resetUserSettings(){this._userProperties={}}_runAnimation(e){return!this.isDisposed()&&(w(this._animatingSettings,(t,i)=>{if(i._stopped)this._stopAnimation(t);else if(i._playing){i._run(e);const r=i.percentage;r>=1?i._checkEnded()?this.set(t,i._value(1)):(i._reset(e),this._set(t,i._value(1))):this._set(t,i._value(r))}}),w(this._animatingPrivateSettings,(t,i)=>{if(i._stopped)this._stopAnimationPrivate(t);else if(i._playing){i._run(e);const r=i.percentage;r>=1?i._checkEnded()?this.setPrivate(t,i._value(1)):(i._reset(e),this._setPrivate(t,i._value(1))):this._setPrivate(t,i._value(r))}}),this._playingAnimations!==0)}_markDirtyKey(e){this.markDirty()}_markDirtyPrivateKey(e){this.markDirty()}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._privateSettingEvents[e]})}getRaw(e,t){const i=this._settings[e];return i!==void 0?i:t}get(e,t){return this.getRaw(e,t)}_sendKeyEvent(e,t){const i=this._settingEvents[e];i!==void 0&&g(i,r=>{r(t,this,e)})}_sendPrivateKeyEvent(e,t){const i=this._privateSettingEvents[e];i!==void 0&&g(i,r=>{r(t,this,e)})}_setRaw(e,t,i){this._prevSettings[e]=t,this._sendKeyEvent(e,i)}setRaw(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&this._setRaw(e,i,t)}_set(e,t){const i=this._settings[e];this._settings[e]=t,i!==t&&(this._setRaw(e,i,t),this._markDirtyKey(e))}_stopAnimation(e){const t=this._animatingSettings[e];t&&(--this._playingAnimations,delete this._animatingSettings[e],t.stop())}set(e,t){return this._set(e,t),this._stopAnimation(e),t}remove(e){e in this._settings&&(this._prevSettings[e]=this._settings[e],delete this._settings[e],this._sendKeyEvent(e,void 0),this._markDirtyKey(e)),this._stopAnimation(e)}removeAll(){g(T(this._settings),e=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}_setPrivateRaw(e,t,i){this._prevPrivateSettings[e]=t,this._sendPrivateKeyEvent(e,i)}setPrivateRaw(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&this._setPrivateRaw(e,i,t)}_setPrivate(e,t){const i=this._privateSettings[e];this._privateSettings[e]=t,i!==t&&(this._setPrivateRaw(e,i,t),this._markDirtyPrivateKey(e))}_stopAnimationPrivate(e){const t=this._animatingPrivateSettings[e];t&&(--this._playingAnimations,t.stop(),delete this._animatingPrivateSettings[e])}setPrivate(e,t){return this._setPrivate(e,t),this._stopAnimationPrivate(e),t}removePrivate(e){e in this._privateSettings&&(this._prevPrivateSettings[e]=this._privateSettings[e],delete this._privateSettings[e],this._markDirtyPrivateKey(e)),this._stopAnimationPrivate(e)}setAll(e){w(e,(t,i)=>{this.set(t,i)})}animate(e){const t=e.key,i=e.to,r=e.duration||0,n=e.loops||1,a=e.from===void 0?this.get(t):e.from,o=e.easing===void 0?Ae:e.easing;if(r===0)this.set(t,i);else{if(a!==void 0&&a!==i){this.set(t,a);const l=this._animatingSettings[t]=new Q(this,a,i,r,o,n,this._animationTime());return++this._playingAnimations,this._startAnimation(),l}this.set(t,i)}const h=new Q(this,a,i,r,o,n,null);return h.stop(),h}animatePrivate(e){const t=e.key,i=e.to,r=e.duration||0,n=e.loops||1,a=e.from===void 0?this.getPrivate(t):e.from,o=e.easing===void 0?Ae:e.easing;if(r===0)this.setPrivate(t,i);else{if(a!==void 0&&a!==i){this.setPrivate(t,a);const l=this._animatingPrivateSettings[t]=new Q(this,a,i,r,o,n,this._animationTime());return++this._playingAnimations,this._startAnimation(),l}this.setPrivate(t,i)}const h=new Q(this,a,i,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class A extends Et{constructor(e,t,i,r=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ot(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new St(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=e,this._internalTemplates=r,t.id&&this._registerId(t.id)}static new(e,t,i){const r=new this(e,t,!0);return r._template=i,r._afterNew(),r}static _new(e,t,i=[]){const r=new this(e,t,!0,i);return r._afterNew(),r}_afterNew(){this._checkDirty();let e=!1;const t=this._template;t&&(e=!0,t._setObjectTemplate(this)),g(this._internalTemplates,i=>{e=!0,i._setObjectTemplate(this)}),e&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const e=this._template;e&&e._setObjectTemplate(this),g(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new $}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefault(e,t){e in this._settings||super.set(e,t)}_setRawDefault(e,t){e in this._settings||super.setRaw(e,t)}_clearDirty(){T(this._dirty).forEach(e=>{this._dirty[e]=!1}),T(this._dirtyPrivate).forEach(e=>{this._dirtyPrivate[e]=!1})}isDirty(e){return!!this._dirty[e]}isPrivateDirty(e){return!!this._dirtyPrivate[e]}_markDirtyKey(e){this._dirty[e]=!0,super._markDirtyKey(e)}_markDirtyPrivateKey(e){this._dirtyPrivate[e]=!0,super._markDirtyKey(e)}isType(e){return this.classNames.indexOf(e)!==-1}_pushPropertyDisposer(e,t){let i=this._disposerProperties[e];return i===void 0&&(i=this._disposerProperties[e]=[]),i.push(t),t}_disposeProperty(e){const t=this._disposerProperties[e];t!==void 0&&(g(t,i=>{i.dispose()}),delete this._disposerProperties[e])}set template(e){const t=this._template;t!==e&&(this._template=e,t&&t._removeObjectTemplate(this),e&&e._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(e){}_applyStateAnimated(e,t){}get(e,t){const i=this.adapters.fold(e,this._settings[e]);return i!==void 0?i:t}isUserSetting(e){return this._userProperties[e]||!1}set(e,t){return this._userProperties[e]=!0,super.set(e,t)}setRaw(e,t){this._userProperties[e]=!0,super.setRaw(e,t)}_setSoft(e,t){return this._userProperties[e]?t:super.set(e,t)}remove(e){delete this._userProperties[e],this._removeTemplateProperty(e)}setPrivate(e,t){return this._userPrivateProperties[e]=!0,super.setPrivate(e,t)}setPrivateRaw(e,t){this._userPrivateProperties[e]=!0,super.setPrivateRaw(e,t)}removePrivate(e){delete this._userPrivateProperties[e],this._removeTemplatePrivateProperty(e)}_setTemplateProperty(e,t,i){this._userProperties[t]||e===this._findTemplateByKey(t)&&super.set(t,i)}_setTemplatePrivateProperty(e,t,i){this._userPrivateProperties[t]||e===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,i)}_removeTemplateProperty(e){if(!this._userProperties[e]){const t=this._findTemplateByKey(e);t?super.set(e,t._settings[e]):super.remove(e)}}_removeTemplatePrivateProperty(e){if(!this._userPrivateProperties[e]){const t=this._findTemplateByPrivateKey(e);t?super.setPrivate(e,t._privateSettings[e]):super.removePrivate(e)}}_walkParents(e){e(this._root._rootContainer),e(this)}_applyStateByKey(e){const t=this.states.create(e,{}),i={};this._eachTemplate(r=>{const n=r.states.lookup(e);n&&n._apply(t,i)}),w(t._settings,r=>{i[r]||t._userSettings[r]||t.remove(r)})}_applyTemplate(e,t){this._templateDisposers.push(e._apply(this,t)),w(e._settings,(i,r)=>{t.settings[i]||this._userProperties[i]||(t.settings[i]=!0,super.set(i,r))}),w(e._privateSettings,(i,r)=>{t.privateSettings[i]||this._userPrivateProperties[i]||(t.privateSettings[i]=!0,super.setPrivate(i,r))}),this._runSetup&&e.setup&&(this._runSetup=!1,e.setup(this))}_findStaticTemplate(e){if(this._template&&e(this._template))return this._template}_eachTemplate(e){this._findStaticTemplate(t=>(e(t),!1)),F(this._internalTemplates,e),g(this._templates,e)}_applyTemplates(e=!0){e&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(i=>{this._applyTemplate(i,t)}),e&&(w(this._settings,i=>{this._userProperties[i]||t.settings[i]||super.remove(i)}),w(this._privateSettings,i=>{this._userPrivateProperties[i]||t.privateSettings[i]||super.removePrivate(i)}))}_findTemplate(e){const t=this._findStaticTemplate(e);if(t===void 0){const i=Ze(this._internalTemplates,e);return i===void 0?Qe(this._templates,e):i}return t}_findTemplateByKey(e){return this._findTemplate(t=>e in t._settings)}_findTemplateByPrivateKey(e){return this._findTemplate(t=>e in t._privateSettings)}_disposeTemplates(){g(this._templateDisposers,e=>{e.dispose()}),this._templateDisposers.length=0}_removeTemplates(){g(this._templates,e=>{e._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(){let e=!1;const t=[];let i=[];const r=new Set,n=this.get("themeTagsSelf");return n&&g(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(e=!0),a._defaultThemes.length>0&&t.push(a._defaultThemes);const o=a.get("themes");o&&i.push(o);const h=a.get("themeTags");h&&g(h,l=>{r.add(l)})}),i=t.concat(i),this._removeTemplates(),e&&F(this.classNames,a=>{const o=[];g(i,h=>{g(h,l=>{const d=l._lookupRules(a);d&&F(d,p=>{if(p.tags.every(u=>r.has(u))){const u=tt(o,c=>{const m=N(p.tags.length,c.tags.length);return m===0?Ye(p.tags,c.tags,N):m});o.splice(u.index,0,p)}})})}),g(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),e&&(this._runSetup=!1),e}_changed(){}_beforeChanged(){if(this.isDirty("id")){const e=this.get("id");e&&this._registerId(e);const t=this._prevSettings.id;t&&delete L.entitiesById[t]}}_registerId(e){if(L.entitiesById[e]&&L.entitiesById[e]!==this)throw new Error('An entity with id "'+e+'" already exists.');L.entitiesById[e]=this}_afterChanged(){}addDisposer(e){return this._disposers.push(e),e}_dispose(){super._dispose();const e=this._template;e&&e._removeObjectTemplate(this),g(this._internalTemplates,i=>{i._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(i=>{i.dispose()}),w(this._disposerProperties,(i,r)=>{g(r,n=>{n.dispose()})});const t=this.get("id");t&&delete L.entitiesById[t]}setTimeout(e,t){const i=setTimeout(()=>{this.removeDispose(r),e()},t),r=new P(()=>{clearTimeout(i)});return this._disposers.push(r),r}removeDispose(e){if(!this.isDisposed()){let t=se(this._disposers,e);t>-1&&this._disposers.splice(t,1)}e.dispose()}hasTag(e){return se(this.get("themeTags",[]),e)!==-1}addTag(e){if(!this.hasTag(e)){const t=this.get("themeTags",[]);t.push(e),this.set("themeTags",t)}}removeTag(e){if(this.hasTag(e)){const t=this.get("themeTags",[]);He(t,e),this.set("themeTags",t)}}_t(e,t,...i){return this._root.language.translate(e,t,...i)}get root(){return this._root}}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Ct{constructor(e,t,i){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=e,this._template=t,this._settings=i}get(e,t){const i=this._settings[e];return i!==void 0?i:t}set(e,t){this._settings[e]=t,this._template._stateChanged(this._name)}remove(e){delete this._settings[e],this._template._stateChanged(this._name)}setAll(e){T(e).forEach(t=>{this._settings[t]=e[t]}),this._template._stateChanged(this._name)}_apply(e,t){w(this._settings,(i,r)=>{t[i]||e._userSettings[i]||(t[i]=!0,e.setRaw(i,r))})}}class Mt{constructor(e){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=e}lookup(e){return this._states[e]}create(e,t){const i=this._states[e];if(i)return i.setAll(t),i;{const r=new Ct(e,this._template,t);return this._states[e]=r,this._template._stateChanged(e),r}}remove(e){delete this._states[e],this._template._stateChanged(e)}_apply(e,t){w(this._states,(i,r)=>{let n=t.states[i];n==null&&(n=t.states[i]={});const a=e.states.create(i,{});r._apply(a,n)})}}class At{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(e,t){let i=this._callbacks[e];return i===void 0&&(i=this._callbacks[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._callbacks[e]})}remove(e){this._callbacks[e]!==void 0&&delete this._callbacks[e]}_apply(e){const t=[];return w(this._callbacks,(i,r)=>{g(r,n=>{t.push(e.adapters.add(i,n))})}),new k(t)}}class X{constructor(e,t){if(Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Mt(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new At}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new $}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=e}static new(e){return new X(e,!0)}get entities(){return this._entities}get(e,t){const i=this._settings[e];return i!==void 0?i:t}setRaw(e,t){this._settings[e]=t}set(e,t){this._settings[e]!==t&&(this.setRaw(e,t),this._entities.forEach(i=>{i._setTemplateProperty(this,e,t)}))}remove(e){e in this._settings&&(delete this._settings[e],this._entities.forEach(t=>{t._removeTemplateProperty(e)}))}removeAll(){w(this._settings,(e,t)=>{this.remove(e)})}getPrivate(e,t){const i=this._privateSettings[e];return i!==void 0?i:t}setPrivateRaw(e,t){return this._privateSettings[e]=t,t}setPrivate(e,t){return this._privateSettings[e]!==t&&(this.setPrivateRaw(e,t),this._entities.forEach(i=>{i._setTemplatePrivateProperty(this,e,t)})),t}removePrivate(e){e in this._privateSettings&&(delete this._privateSettings[e],this._entities.forEach(t=>{t._removeTemplatePrivateProperty(e)}))}setAll(e){w(e,(t,i)=>{this.set(t,i)})}on(e,t){let i=this._settingEvents[e];return i===void 0&&(i=this._settingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._settingEvents[e]})}onPrivate(e,t){let i=this._privateSettingEvents[e];return i===void 0&&(i=this._privateSettingEvents[e]=[]),i.push(t),new P(()=>{O(i,t),i.length===0&&delete this._privateSettingEvents[e]})}_apply(e,t){const i=[];return w(this._settingEvents,(r,n)=>{g(n,a=>{i.push(e.on(r,a))})}),w(this._privateSettingEvents,(r,n)=>{g(n,a=>{i.push(e.onPrivate(r,a))})}),this.states._apply(e,t),i.push(this.adapters._apply(e)),i.push(e.events.copyFrom(this.events)),new k(i)}_setObjectTemplate(e){this._entities.push(e)}_removeObjectTemplate(e){He(this._entities,e)}_stateChanged(e){this._entities.forEach(t=>{t._applyStateByKey(e)})}}class re extends ${constructor(e){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=e}_makePointerEvent(e,t){return{type:e,originalEvent:t.event,point:t.point,simulated:t.simulated,native:t.native,target:this._sprite}}_onRenderer(e,t){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let i=this._rendererDisposers[e];if(i===void 0){const r=this._sprite._display.on(e,n=>{t.call(this,n)});i=this._rendererDisposers[e]=new it(()=>{delete this._rendererDisposers[e],r.dispose()})}return i.increment()}_on(e,t,i,r,n,a){const o=super._on(e,t,i,r,n,a),h=re.RENDERER_EVENTS[t];return h!==void 0&&(o.disposer=new k([o.disposer,this._onRenderer(t,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(e,t){const i=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(e,t),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(e,t)}finally{this._dispatchParents=i}}}Object.defineProperty(re,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(s){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",s))&&this.dispatch("click",this._makePointerEvent("click",s))},rightclick:function(s){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",s))},middleclick:function(s){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",s))},dblclick:function(s){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",s))},pointerover:function(s){this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",s))},pointerout:function(s){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",s))},pointerdown:function(s){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",s))},pointerup:function(s){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",s))},globalpointerup:function(s){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",s))},globalpointermove:function(s){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",s))},wheel:function(s){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:s.event,point:s.point})}}});class D extends A{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}_markDirtyKey(e){super._markDirtyKey(e),e!="x"&&e!="y"&&e!="dx"&&e!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(e){super._markDirtyPrivateKey(e),e!="x"&&e!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new re(this)}_processTemplateField(){let e;const t=this.get("templateField");if(t){const i=this.dataItem;if(i){const r=i.dataContext;r&&(e=r[t],e instanceof X||!e||(e=X.new(e)))}}this._templateField!==e&&(this._removeTemplateField(),this._templateField=e,e&&e._setObjectTemplate(this),this._applyTemplates())}_setDataItem(e){const t=this._dataItem;this._dataItem=e,this._processTemplateField();const i="dataitemchanged";e!=t&&this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this,oldDataItem:t,newDataItem:e})}set dataItem(e){this._setDataItem(e)}get dataItem(){if(this._dataItem)return this._dataItem;{let e=this._parent;for(;e;){if(e._dataItem)return e._dataItem;e=e._parent}}}_addPercentageSizeChildren(){let e=this.parent;e&&(this.get("width")instanceof f||this.get("height")instanceof f?Te(e._percentageSizeChildren,this):O(e._percentageSizeChildren,this))}_addPercentagePositionChildren(){let e=this.parent;e&&(this.get("x")instanceof f||this.get("y")instanceof f?Te(e._percentagePositionChildren,this):O(e._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const e=this._localBounds;if(e){const t=this.get("centerX");t!=null&&(this._display.pivot.x=e.left+C(t,e.right-e.left));const i=this.get("centerY");i!=null&&(this._display.pivot.y=e.top+C(i,e.bottom-e.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const e=this._prevSettings.tooltip;e&&e.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const e=this._tooltipMoveDp;e&&(e.dispose(),this._tooltipMoveDp=void 0);const t=this._tooltipPointerDp;t&&(t.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})),this._tooltipPointerDp=new k([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",i=>{this.showTooltip(i.point)})}),this.events.on("pointerout",()=>{const i=this._tooltipMoveDp;i&&(i.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const e=this._display,t=this.events;if(this.isDirty("draggable")){const i=this.get("draggable");i?(this.set("interactive",!0),this._dragDp=new k([t.on("pointerdown",r=>{this.dragStart(r)}),t.on("globalpointermove",r=>{this.dragMove(r)}),t.on("globalpointerup",r=>{this.dragStop(r)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),e.cancelTouch=!!i}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const i=this.get("tooltipText"),r=this.get("tooltipHTML"),n=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(i||r)&&(n=="click"?(this._tooltipDp=new k([t.on("click",()=>{this.setTimeout(()=>this.showTooltip(),10)}),Fe(document,"click",a=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):n=="always"||(this._tooltipDp=new k([t.on("pointerover",()=>{this.showTooltip()}),t.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let i=this.get("toggleKey");i&&i!="none"?this._toggleDp=t.on("click",()=>{this._isDragging||this.set(i,!this.get(i))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(e.alpha=Math.max(0,this.get("opacity",1))),this.isDirty("rotation")&&(this.markDirtyBounds(),e.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),e.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?e.visible=!0:(e.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const i=this.parent;i&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(i.markDirty(),i._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const i=this.get("wheelable");i&&this.set("interactive",!0),e.wheelable=!!i}if((this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(e.filter=this.get("filter")),this.isDirty("cursorOverStyle")&&(e.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new k([t.on("focus",()=>{this.showTooltip()}),t.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility()),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(e.exportable=this.get("exportable")),this.isDirty("interactive")){const i=this.events;this.get("interactive")?this._hoverDp=new k([i.on("click",r=>{Se(r.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:r.target,originalEvent:r.originalEvent,point:r.point,simulated:r.simulated})},10))}),i.on("globalpointerup",r=>{Se(r.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:r.target,originalEvent:r.originalEvent,point:r.point,simulated:r.simulated})),this._isDown&&this._handleUp(r)}),i.on("pointerover",()=>{this._handleOver()}),i.on("pointerout",()=>{this._handleOut()}),i.on("pointerdown",r=>{this._handleDown(r)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",!1)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(e){this._dragEvent=e,this.events.stopParentDispatch()}dragStop(e){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const t="dragstop";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(e){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const t=de(e.originalEvent);delete this._downPoints[t],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(e){const t=de(e.originalEvent),i=this._downPoints[t];if(i){const r=Math.abs(i.x-e.point.x),n=Math.abs(i.y-e.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(e){const t=this.parent;if(t&&!this.get("draggable")&&t._handleDown(e),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:e.point.x,y:e.point.y},this._isDown=!0;const i=de(e.originalEvent);this._downPoints[i]={x:e.point.x,y:e.point.y}}}dragMove(e){let t=this._dragEvent;if(t){if(t.simulated&&!e.simulated)return!0;let i=0,r=this.parent;for(;r!=null;)i+=r.get("rotation",0),r=r.parent;let n=e.point.x-t.point.x,a=e.point.y-t.point.y;const o=this.events;if(t.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const h="dragstart";o.isEnabled(h)&&o.dispatch(h,{type:h,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}if(this._isDragging){let h=this._dragPoint;this.set("x",h.x+n*be(i)+a*fe(i)),this.set("y",h.y+a*be(i)-n*fe(i));const l="dragged";o.isEnabled(l)&&o.dispatch(l,{type:l,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}else if(Math.hypot(n,a)>5){this._isDragging=!0,this._dragEvent=e,this._dragPoint={x:this.x(),y:this.y()};const h="dragstart";o.isEnabled(h)&&o.dispatch(h,{type:h,target:this,originalEvent:e.originalEvent,point:e.point,simulated:e.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let e=this.parent,t=0;for(;;){if(!e)return t;++t,e=e.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const e=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),e.isMeasured=!0,e.invalidateBounds();const t=this.parent;t&&this.get("position")!="absolute"&&(t.get("width")==null||t.get("height")==null||t.get("layout"))&&t.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const e=this._adjustedLocalBounds;let t;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),t=this._adjustedLocalBounds):(t={left:0,right:0,top:0,bottom:0},this._localBounds=t,this._adjustedLocalBounds=t),!e||e.left!==t.left||e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom){const i="boundschanged";this.events.isEnabled(i)&&this.events.dispatch(i,{type:i,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds())}}_fixMinBounds(e){let t=this.get("minWidth",this.getPrivate("minWidth")),i=this.get("minHeight",this.getPrivate("minHeight"));_(t)&&e.right-e.left0?e.right=e.left+r:e.left=e.right+r),_(n)&&(n>0?e.bottom=e.top+n:e.top=e.bottom+n)}_removeParent(e){e&&(e.children.removeValue(this),O(e._percentageSizeChildren,this),O(e._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.showTooltip(),this._handleOver()}unhover(){this.hideTooltip(),this._handleOut()}showTooltip(e){const t=this.getTooltip(),i=this.get("tooltipText"),r=this.get("tooltipHTML");if((i||r)&&t){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&e||(this._display._setMatrix(),e=this.toGlobal(a._getTooltipPoint())),t.set("pointTo",e),t.set("tooltipTarget",a),t.get("x")||t.set("x",e.x),t.get("y")||t.set("y",e.y),i&&t.label.set("text",i),r&&t.label.set("html",r);const o=this.dataItem;if(o&&t.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(e.x<0||e.x>this._root.width()||e.y<0||e.y>this._root.height()))return void this.hideTooltip();t.label.text.markDirtyText();const h=t.show();return this.setPrivateRaw("showingTooltip",!0),h}}hideTooltip(){const e=this.getTooltip();if(e&&(e.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==e)){let t=e.get("keepTargetHover")&&e.get("stateAnimationDuration",0)==0?400:void 0;const i=e.hide(t);return this.setPrivateRaw("showingTooltip",!1),i}}_getTooltipPoint(){const e=this._localBounds;if(e){let t=0,i=0;return this.get("isMeasured")?(t=e.left+C(this.get("tooltipX",0),e.right-e.left),i=e.top+C(this.get("tooltipY",0),e.bottom-e.top)):(t=C(this.get("tooltipX",0),this.width()),i=C(this.get("tooltipY",0),this.height())),{x:t,y:i}}return{x:0,y:0}}getTooltip(){let e=this.get("tooltip");if(e)return e;{let t=this.parent;if(t)return t.getTooltip()}}_updatePosition(){const e=this.parent;let t=this.get("dx",0),i=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=e?e.innerWidth()*r.value+e.get("paddingLeft",0):0),_(r)?a=r+t:n!=null?a=n:e&&h=="relative"&&(a=e.get("paddingLeft",0)+t);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=e?e.innerHeight()*l.value+e.get("paddingTop",0):0),_(l)?o=l+i:d!=null?o=d:e&&h=="relative"&&(o=e.get("paddingTop",0)+i);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let e=this.get("x"),t=this.getPrivate("x");const i=this.parent;return i?e instanceof f?C(e,i.innerWidth())+i.get("paddingLeft",0):_(e)?e:t??i.get("paddingLeft",this._display.x):this._display.x}y(){let e=this.getPrivate("y");if(e!=null)return e;let t=this.get("y");const i=this.parent;return i?t instanceof f?C(t,i.innerHeight())+i.get("paddingTop",0):_(t)?t:e??i.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const e=this.get("tooltip");e&&e.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const e=this._adjustedLocalBounds,t=this.x(),i=this.y();return{left:e.left+t,right:e.right+t,top:e.top+i,bottom:e.bottom+i}}globalBounds(){const e=this.localBounds(),t=this.toGlobal({x:e.left,y:e.top}),i=this.toGlobal({x:e.right,y:e.top}),r=this.toGlobal({x:e.right,y:e.bottom}),n=this.toGlobal({x:e.left,y:e.bottom});return{left:Math.min(t.x,i.x,r.x,n.x),top:Math.min(t.y,i.y,r.y,n.y),right:Math.max(t.x,i.x,r.x,n.x),bottom:Math.max(t.y,i.y,r.y,n.y)}}_onShow(e){}_onHide(e){}appear(e,t){return Z(this,void 0,void 0,function*(){return yield this.hide(0),t?new Promise((i,r)=>{this.setTimeout(()=>{i(this.show(e))},t)}):this.show(e)})}show(e){return Z(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(e);const t=this.states.applyAnimate("default",e);yield Ce(t),this._isShowing=!1}})}hide(e){return Z(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let t=this.states.lookup("hidden");t||(t=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(e);const i=this.states.applyAnimate("hidden",e);yield Ce(i),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const e=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*e:e}width(){let e=this.get("width"),t=this.get("maxWidth",this.getPrivate("maxWidth")),i=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(_(r))n=r;else if(e==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(e instanceof f){const a=this.parent;n=a?a.innerWidth()*e.value:this._root.width()*e.value}else _(e)&&(n=e);return _(i)&&(n=Math.max(i,n)),_(t)&&(n=Math.min(t,n)),n}maxWidth(){let e=this.get("maxWidth",this.getPrivate("maxWidth"));if(_(e))return e;{let i=this.get("width");if(_(i))return i}const t=this.parent;return t?t.innerWidth():this._root.width()}maxHeight(){let e=this.get("maxHeight",this.getPrivate("maxHeight"));if(_(e))return e;{let i=this.get("height");if(_(i))return i}const t=this.parent;return t?t.innerHeight():this._root.height()}height(){let e=this.get("height"),t=this.get("maxHeight",this.getPrivate("maxHeight")),i=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(_(r))n=r;else if(e==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(e instanceof f){const a=this.parent;n=a?a.innerHeight()*e.value:this._root.height()*e.value}else _(e)&&(n=e);return _(i)&&(n=Math.max(i,n)),_(t)&&(n=Math.min(t,n)),n}_findStaticTemplate(e){return this._templateField&&e(this._templateField)?this._templateField:super._findStaticTemplate(e)}_walkParents(e){this._parent&&this._walkParent(e)}_walkParent(e){this._parent&&this._parent._walkParent(e),e(this)}get parent(){return this._parent}_setParent(e,t=!1){const i=this._parent;e!==i&&(this.markDirtyBounds(),e.markDirty(),this._parent=e,t&&(this._removeParent(i),e&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(e){return this._display.toGlobal(e)}toLocal(e){return this._display.toLocal(e)}_getDownPoint(){const e=this._getDownPointId();if(e)return this._downPoints[e]}_getDownPointId(){if(this._downPoints)return ot(this._downPoints,(e,t)=>e>t?1:e0&&(this._backgroundDisplay.beginFill(r,n),this._backgroundDisplay.drawRect(0,0,t,i),this._backgroundDisplay.endFill()),this._display.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(this._display,this._backgroundDisplay,e,t,i)}}}Object.defineProperty(W,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(W,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:A.classNames.concat([W.className])});class V extends W{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load()}_draw(){super._draw();const e=this._image;if(e){const t=this.get("width",100),i=this.get("height",100),r=this.get("fit","image");let n=0,a=0;r=="pattern"?(n=t,a=i):(n=e.width,a=e.height,r=="image"&&(this.set("width",n),this.set("height",a)));let o=0,h=0;this.get("centered",!0)&&(o=t/2-n/2,h=i/2-a/2),this._display.image(e,n,a,o,h)}}_load(){const e=this.get("src");if(e){const t=new Image;t.src=e,t.decode().then(()=>{this._image=t,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(i=>{})}}}var ve;Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:W.classNames.concat([V.className])}),function(s){s.ADD="lighter",s.COLOR="color",s.COLOR_BURN="color-burn",s.COLOR_DODGE="color-dodge",s.DARKEN="darken",s.DIFFERENCE="difference",s.DST_OVER="destination-over",s.EXCLUSION="exclusion",s.HARD_LIGHT="hard-light",s.HUE="hue",s.LIGHTEN="lighten",s.LUMINOSITY="luminosity",s.MULTIPLY="multiply",s.NORMAL="source-over",s.OVERLAY="overlay",s.SATURATION="saturation",s.SCREEN="screen",s.SOFT_LIGHT="soft-light",s.SRC_ATOP="source-atop",s.XOR="xor"}(ve||(ve={}));const Si=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset"];class U extends D{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const e=this.get("fillGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const e=this.get("strokeGradient");if(e){this._display.isMeasured=!0;const t=e.get("target");t&&(this._disposers.push(t.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(t.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let e=this.get("strokeDasharray");_(e)&&(e=e<.5?[0]:[e]),this._display.setLineDash(e);const t=this.get("strokeDashoffset");t&&this._display.setLineDashOffset(t);const i=this.get("blendMode",ve.NORMAL);this._display.blendMode=i;const r=this.get("draw");r&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const e=this.get("fill"),t=this.get("fillGradient"),i=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),i){let c=!1;!e||i.get("fill")&&!i.get("fillInherited")||(i.set("fill",e),i.set("fillInherited",!0),c=!0),!n||i.get("color")&&!i.get("colorInherited")||(i.set("color",n),i.set("colorInherited",!0),c=!0),c&&i._changed();const m=i.pattern;m&&(this._display.beginFill(m,r),this._display.endFill(),i instanceof V&&i.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}else if(t){if(e){const m=t.get("stops",[]);m.length&&g(m,b=>{b.color&&!b.colorInherited||!e||(b.color=e,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const c=t.getFill(this);c&&(this._display.beginFill(c,r),this._display.endFill())}else e&&(this._display.beginFill(e,r),this._display.endFill());if(n||a||o){const c=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(o){let S=!1;!n||o.get("color")&&!o.get("colorInherited")||(o.set("color",n),o.set("colorInherited",!0),S=!0),S&&o._changed();const x=o.pattern;x&&(this._display.lineStyle(m,x,c,b),this._display.endStroke(),o instanceof V&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}else if(a){const S=a.get("stops",[]);S.length&&g(S,v=>{v.color&&!v.colorInherited||!n||(v.color=n,v.colorInherited=!0),(v.opacity==null||v.opacityInherited)&&(v.opacity=c,v.opacityInherited=!0)});const x=a.getFill(this);x&&(this._display.lineStyle(m,x,c,b),this._display.endStroke())}else n&&(this._display.lineStyle(m,n,c,b),this._display.endStroke())}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:D.classNames.concat([U.className])});class K extends U{_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(s,e){s.get("reverseChildren",!1)?s.children.eachReverse(e):s.children.each(e)}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([K.className])});class E extends A{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:A.classNames.concat([E.className])});class z extends E{updateContainer(e){let t=e.get("paddingLeft",0),i=e.innerWidth(),r=0;j(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=i*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(i-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(i-=d,r-=o.value)}else _(o)||(o=a.width()),i-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(i<=0||i==1/0)&&(i=.1),j(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=i*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=t;j(e,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let c=n+h-p;a.setPrivate("x",c),n=c+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([z.className])});class G extends E{updateContainer(e){let t=e.get("paddingTop",0),i=e.innerHeight(),r=0;j(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=i*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(i-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(i-=d,r-=o.value)}else _(o)||(o=a.height()),i-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(i<=0||i==1/0)&&(i=.1),j(e,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=i*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=t;j(e,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),c=n+h-l;a.setPrivate("y",c),n=c+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([G.className])});class Y extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(e){let t=e.get("paddingLeft",0),i=e.get("paddingRight",0),r=e.get("paddingTop",0),n=e.maxWidth()-t-i,a=n,o=1;j(e,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Me(a,1,n),o=Me(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(e,h,o,n),d=r,p=0,u=0;h=l.length;let c=t;j(e,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let x=m.adjustedLocalBounds(),v=m.get("marginLeft",0),H=m.get("marginRight",0),J=c+v-x.left,q=d+b-x.top;m.setPrivate("x",J),m.setPrivate("y",q),c+=l[p]+H,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,c=t,d+=u)}})}getColumnWidths(e,t,i,r){let n=0,a=[],o=0;return j(e,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=i:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?t>2?(t-=1,this.getColumnWidths(e,t,i,r)):[r]:a}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class ye{static escape(e){return e.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(e){return e.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(e){return e.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(e,t=!1,i=!1){let r=[];e=this.escape(e);let n=t?e.split("'"):[e];for(let a=0;a{e.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(e=>{e.removePrivate("x"),e.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(e=>{e.markDirtyPosition()}),this.isDirty("maskContent")){const e=this._childrenDisplay;let t=this._contentMask;this.get("maskContent")?t||(t=K.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=t,e.addChildAt(t._display,0),e.mask=t._display):t&&(e.removeChild(t._display),e.mask=null,t.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),g(this._percentageSizeChildren,e=>{e._updateSize()}),g(this._percentagePositionChildren,e=>{e.markDirtyPosition(),e._updateSize()}),this.updateBackground()}updateBackground(){const e=this.get("background");let t=this._localBounds;if(t&&!this.isHidden()){let i=t.left,r=t.top,n=t.right-i,a=t.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();e&&(e.setAll({width:n,height:a,x:i,y:r}),this._display.interactive&&(e._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const c=u.get("background");c&&c.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(){return!!super._applyThemes()&&(this.eachChildren(e=>{e._applyThemes()}),!0)}_applyState(e){super._applyState(e),this.get("setStateOnChildren")&&this.eachChildren(t=>{t.states.apply(e)})}_applyStateAnimated(e,t){super._applyStateAnimated(e,t),this.get("setStateOnChildren")&&this.eachChildren(i=>{i.states.applyAnimate(e,t)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){let e=this.get("width"),t=this.get("height"),i=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof z||a instanceof Y)&&(o=!0),a instanceof G&&(h=!0),e==null&&i==null||t==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,c=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),x=this.get("paddingBottom",0);this.children.each(v=>{if(v.get("position")!="absolute"&&v.get("isMeasured")){let H=v.adjustedLocalBounds(),J=v.x(),q=v.y(),ne=J+H.left,ae=J+H.right,oe=q+H.top,he=q+H.bottom;o&&(ne-=v.get("marginLeft",0),ae+=v.get("marginRight",0)),h&&(oe-=v.get("marginTop",0),he+=v.get("marginBottom",0)),nep&&(p=ae),oec&&(c=he)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),c==-l&&(c=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=c+x}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,_(e)&&(n.left=0,n.right=e),_(i)&&(n.left=0,n.right=i),_(t)&&(n.top=0,n.bottom=t),_(r)&&(n.top=0,n.bottom=r),this._localBounds=n}_updateBounds(){const e=this.get("layout");e&&e.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const e=this.innerWidth(),t=this.innerHeight();if(e!=this._prevWidth||t!=this._prevHeight){let i=this.get("layout"),r=!1,n=!1;i&&((i instanceof z||i instanceof Y)&&(r=!0),i instanceof G&&(n=!0)),g(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*e)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*t)}}),g(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=e,this._prevHeight=t,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateChildren(){if(this.isDirty("html")){const e=this.get("html");e&&e!==""?this._root._setHTMLContent(this,we(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}if(this.isDirty("verticalScrollbar")){const e=this.get("verticalScrollbar");if(e){e._setParent(this),e.startGrip.setPrivate("visible",!1),e.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",e.width()+e.get("marginRight",0)+e.get("marginLeft",0));let t=this.get("background");t||(t=this.set("background",K.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",i=>{const r=i.originalEvent;if(!dt(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=e.get("start",0),o=e.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(e.set("start",a+n),e.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=e.events.on("rangechanged",()=>{let i=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-e.get("start")*i,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(e._display)}else{const t=this._prevSettings.verticalScrollbar;t&&(this._display.removeChild(t._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const e=this._prevSettings.background;e&&this._display.removeChild(e._display);const t=this.get("background");t instanceof D&&(t.set("isMeasured",!1),t._setParent(this),this._display.addChildAt(t._display,0))}if(this.isDirty("mask")){const e=this.get("mask"),t=this._prevSettings.mask;if(t&&(this._display.removeChild(t._display),t!=e&&t.dispose()),e){const i=e.parent;i&&i.children.removeValue(e),e._setParent(this),this._display.addChildAt(e._display,0),this._childrenDisplay.mask=e._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(e=>{e._processTemplateField()})}walkChildren(e){this.children.each(t=>{t instanceof I&&t.walkChildren(e),e(t)})}eachChildren(e){const t=this.get("background");t&&e(t);const i=this.get("verticalScrollbar");i&&e(i);const r=this.get("mask");r&&e(r),this.children.values.forEach(n=>{e(n)})}allChildren(){const e=[];return this.eachChildren(t=>{e.push(t)}),e}_setDataItem(e){const t=e!==this._dataItem;super._setDataItem(e);const i=this.get("html","");i&&i!==""&&t&&this._root._setHTMLContent(this,we(this,i))}}Object.defineProperty(I,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(I,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:D.classNames.concat([I.className])});class ie extends D{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text"))super._updateBounds();else{let e={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=e}}_changed(){super._changed(),this._display.clear();let e=this.textStyle;if(this.isDirty("opacity")){let t=this.get("opacity",1);this._display.alpha=t}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new P(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(e.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(e.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(e.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(e.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(e.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(e.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")){let t=this.get("fill");t&&(e.fill=t)}if(this.isDirty("fillOpacity")){let t=this.get("fillOpacity",1);t&&(e.fillOpacity=t)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(e.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(e.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),g(this._textStyles,t=>{this._dirty[t]&&(e[t]=this.get(t),this.markDirtyBounds())}),e.fontSize=this.get("fontSize"),e.fontFamily=this.get("fontFamily"),this._display.style=e,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){const e=this.get("text","");return this.get("populateText")?we(this,e):e}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(e){super._setDataItem(e),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:D.classNames.concat([ie.className])});class ce extends I{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),g(this._textKeys,e=>{const t=this.get(e);t!=null&&this._text.set(e,t)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(ie.new(this._root,{}))}_updateChildren(){if(super._updateChildren(),g(this._textKeys,e=>{this._text.set(e,this.get(e))}),this.isDirty("maxWidth")&&this._setMaxDimentions(),this.isDirty("maxHeight")&&this._setMaxDimentions(),this.isDirty("rotation")&&this._setMaxDimentions(),this.get("html","")!==""?this._text.set("text",""):this._text.set("text",this.get("text")),this.isDirty("textAlign")||this.isDirty("width")){const e=this.get("textAlign");let t;this.get("width")!=null?t=e=="right"?nt:e=="center"?at:0:e=="left"||e=="start"?t=this.get("paddingLeft"):e!="right"&&e!="end"||(t=-this.get("paddingRight")),this.text.set("x",t)}}_setMaxDimentions(){const e=this.get("rotation"),t=e==90||e==270||e==-90,i=this.get("maxWidth",this.getPrivate("maxWidth",1/0));_(i)?this.text.set(t?"maxHeight":"maxWidth",i-this.get("paddingLeft",0)-this.get("paddingRight",0)):this.text.set(t?"maxHeight":"maxWidth",void 0);const r=this.get("maxHeight",this.getPrivate("maxHeight",1/0));_(r)?this.text.set(t?"maxWidth":"maxHeight",r-this.get("paddingTop",0)-this.get("paddingBottom",0)):this.text.set(t?"maxWidth":"maxHeight",void 0)}_setDataItem(e){super._setDataItem(e),this._markDirtyKey("text"),this.text.get("populateText")&&this.text.markDirtyText()}getText(){return this._text._getText()}}Object.defineProperty(ce,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(ce,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([ce.className])});class ji{constructor(e,t){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=e,!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(e){const t=new this(e,!0);return t.setupDefaultRules(),t}setupDefaultRules(){}_lookupRules(e){return this._rules[e]}ruleRaw(e,t=[]){let i=this._rules[e];i||(i=this._rules[e]=[]),t.sort(N);const{index:r,found:n}=et(i,a=>{const o=N(a.tags.length,t.length);return o===0?Ye(a.tags,t,N):o});if(n)return i[r].template;{const a=X.new({});return i.splice(r,0,{tags:t,template:a}),a}}rule(e,t=[]){return this.ruleRaw(e,t)}}export{T as $,Y as A,X as B,xt as C,Wt as D,A as E,Re as F,fi as G,k as H,Et as I,Gt as J,f as K,wt as L,ie as M,Di as N,xi as O,be as P,I as Q,fe as R,Qe as S,Ge as T,Pi as U,K as V,U as W,at as X,nt as Y,y as Z,Nt as _,st as a,Si as a0,we as a1,zt as a2,Oi as a3,Be as a4,Ie as a5,ni as a6,Oe as a7,Lt as a8,Ht as a9,oi as aA,Yt as aB,Ut as aC,se as aD,Zt as aE,it as aF,Qt as aG,ti as aH,ve as aI,Rt as aJ,ei as aK,Ne as aL,vi as aM,We as aN,ye as aa,$ as ab,G as ac,z as ad,si as ae,L as af,ii as ag,Jt as ah,qt as ai,Vt as aj,N as ak,P as al,Xt as am,ai as an,Te as ao,$t as ap,gi as aq,ue as ar,ci as as,pi as at,hi as au,di as av,je as aw,li as ax,ui as ay,ge as az,mi as b,Fe as c,yi as d,ce as e,Se as f,dt as g,_i as h,ji as i,C as j,Ti as k,_ as l,g as m,De as n,ri as o,Me as p,w as q,le as r,Kt as s,bi as t,wi as u,He as v,Ft as w,ki as x,O as y,xe as z}; diff --git a/dist/assets/Tick-WQ_bPwW2.js b/dist/assets/Tick-WQ_bPwW2.js new file mode 100644 index 0000000..c180505 --- /dev/null +++ b/dist/assets/Tick-WQ_bPwW2.js @@ -0,0 +1 @@ +import{da as M}from"./index-J0iiHjMT.js";import{Q as I,W as K,m as b,$ as W,F as q,Y as x,S as Y,a as Z,I as Q,l as T,Z as L,K as J,L as ee,e as E,_ as H}from"./Theme-QNc_77AM.js";class te extends q{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,i){this.processor&&this.processor.processRow(i),super._onSetIndex(e,t,i)}}class V extends Q{constructor(e,t,i){super(i),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class $ extends I{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new te}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")b(t,i=>{i.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const i=new V(this,e.newValue,this._makeDataItem(e.newValue));t.push(i),this.processDataItem(i)}else if(e.type==="setIndex"){const i=t[e.index],s=this._makeDataItem(e.newValue);i.bullets&&i.bullets.length==0&&(i.bullets=void 0),W(s).forEach(a=>{i.animate({key:a,to:s[a],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),i.dataContext=e.newValue}else if(e.type==="insertIndex"){const i=new V(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,i),this.processDataItem(i)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const i=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,i)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},b(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},b(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&b(this._valueFields,i=>{const s=this.get(this._valueFieldsF[i].fieldKey);t[i]=e[s],t[this._valueFieldsF[i].workingKey]=t[i]}),this._fields&&b(this._fields,i=>{const s=this.get(this._fieldsF[i]);t[i]=e[s]}),t}makeDataItem(e){let t=new V(this,void 0,e);return this.processDataItem(t),t}pushDataItem(e){const t=this.makeDataItem(e);return this._mainDataItems.push(t),t}disposeDataItem(e){}showDataItem(e,t){return M(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return M(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([$.className])});let se={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function O(l,e){return e==null&&(e=1),se[l]*e}function z(l,e,t,i,s,a,n){if(!n||s){let o=0;switch(s||e=="millisecond"||(o=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-o)),e){case"day":let u=l.getUTCDate();if(t>1){if(a){a=z(a,"day",1);let y=l.getTime()-a.getTime(),w=Math.floor(y/O("day")/t),D=O("day",w*t);l.setTime(a.getTime()+D-o*O("minute"))}}else l.setUTCDate(u);l.setUTCHours(0,0,0,0);break;case"second":let h=l.getUTCSeconds();t>1&&(h=Math.floor(h/t)*t),l.setUTCSeconds(h,0);break;case"millisecond":if(t==1)return l;let c=l.getUTCMilliseconds();c=Math.floor(c/t)*t,l.setUTCMilliseconds(c);break;case"hour":let m=l.getUTCHours();t>1&&(m=Math.floor(m/t)*t),l.setUTCHours(m,0,0,0);break;case"minute":let d=l.getUTCMinutes();t>1&&(d=Math.floor(d/t)*t),l.setUTCMinutes(d,0,0);break;case"month":let r=l.getUTCMonth();t>1&&(r=Math.floor(r/t)*t),l.setUTCMonth(r,1),l.setUTCHours(0,0,0,0);break;case"year":let p=l.getUTCFullYear();t>1&&(p=Math.floor(p/t)*t),l.setUTCFullYear(p,0,1),l.setUTCHours(0,0,0,0);break;case"week":let g=l.getUTCDate(),f=l.getUTCDay();T(i)||(i=1),g=f>=i?g-f+i:g-(7+f)+i,l.setUTCDate(g),l.setUTCHours(0,0,0,0)}if(!s&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+o),e=="day"||e=="week"||e=="month"||e=="year")){let u=l.getTimezoneOffset();if(u!=o){let h=u-o;l.setUTCMinutes(l.getUTCMinutes()+h)}}return l}{if(isNaN(l.getTime()))return l;let o=n.offsetUTC(l),u=l.getTimezoneOffset(),h=n.parseDate(l),c=h.year,m=h.month,d=h.day,r=h.hour,p=h.minute,g=h.second,f=h.millisecond,y=h.weekday;switch(e){case"day":if(t>1&&a){a=z(a,"day",1,i,s,void 0,n);let D=l.getTime()-a.getTime(),_=Math.floor(D/O("day")/t),C=O("day",_*t);l.setTime(a.getTime()+C),h=n.parseDate(l),c=h.year,m=h.month,d=h.day}r=0,p=o-u,g=0,f=0;break;case"second":p+=o-u,t>1&&(g=Math.floor(g/t)*t),f=0;break;case"millisecond":p+=o-u,t>1&&(f=Math.floor(f/t)*t);break;case"hour":t>1&&(r=Math.floor(r/t)*t),p=o-u,g=0,f=0;break;case"minute":t>1&&(p=Math.floor(p/t)*t),p+=o-u,g=0,f=0;break;case"month":t>1&&(m=Math.floor(m/t)*t),d=1,r=0,p=o-u,g=0,f=0;break;case"year":t>1&&(c=Math.floor(c/t)*t),m=0,d=1,r=0,p=o-u,g=0,f=0;break;case"week":T(i)||(i=1),d=y>=i?d-y+i:d-(7+y)+i,r=0,p=o-u,g=0,f=0}let w=(l=new Date(c,m,d,r,p,g,f)).getTimezoneOffset();return w!=u&&l.setTime(l.getTime()+6e4*(u-w)),l}}class N extends ${constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new q}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:I.new(this._root,{width:x,height:x,position:"absolute"})})}_afterNew(){this.valueFields.push("value"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){b(e,t=>{const i=t.bullets;i&&(b(i,s=>{s.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return Y(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,i){const s=t(this._root,this,e);if(s){let a=s.get("sprite");a&&(a._setDataItem(e),a.setRaw("position","absolute"),this.bulletsContainer.children.push(a)),s._index=i,s.series=this,e.bullets.push(s)}return s}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const i=this.getPrivate("baseValueSeries");i&&this._disposers.push(i.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0)),this._psi==e&&this._pei==t||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let i=this.get("tooltip");i&&(i.hide(0),i.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let i;const s=this.get("legendDataItem");if(s&&(i=s.get("markerRectangle"),i&&this.isVisible())){if(this.isDirty("stroke")){let a=this.get("stroke");i.set("stroke",a)}if(this.isDirty("fill")){let a=this.get("fill");i.set("fill",a)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let i=this.startIndex(),s=this.endIndex();s{s[r]=0,a[r]=0,n[r]=0}),b(i,r=>{let p=r+"Change",g=r+"ChangePercent",f=r+"ChangePrevious",y=r+"ChangePreviousPercent",w=r+"ChangeSelection",D=r+"ChangeSelectionPercent",_="valueY";r!="valueX"&&r!="openValueX"&&r!="lowValueX"&&r!="highValueX"||(_="valueX");const C=this.getPrivate("baseValueSeries");for(let S=e;Sv||o[r]==null)&&(o[r]=v),(u[r]{this.setPrivate(r+"AverageSelection",m[r]),this.setPrivate(r+"CountSelection",n[r]),this.setPrivate(r+"SumSelection",s[r]),this.setPrivate(r+"AbsoluteSumSelection",a[r]),this.setPrivate(r+"LowSelection",o[r]),this.setPrivate(r+"HighSelection",u[r]),this.setPrivate(r+"OpenSelection",h[r]),this.setPrivate(r+"CloseSelection",c[r])}),e===0&&t===this.dataItems.length&&b(i,r=>{this.setPrivate(r+"Average",m[r]),this.setPrivate(r+"Count",n[r]),this.setPrivate(r+"Sum",s[r]),this.setPrivate(r+"AbsoluteSum",a[r]),this.setPrivate(r+"Low",o[r]),this.setPrivate(r+"High",u[r]),this.setPrivate(r+"Open",h[r]),this.setPrivate(r+"Close",c[r])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&b(e,t=>{const i=t.minValue||this.getPrivate(t.dataField+"Low")||0,s=t.maxValue||this.getPrivate(t.dataField+"High")||0;b(t.target._entities,a=>{const n=a.dataItem.get(t.dataField);if(T(n))if(t.customFunction)t.customFunction.call(this,a,i,s,n);else{let o,u;o=t.logarithmic?(Math.log(n)*Math.LOG10E-Math.log(i)*Math.LOG10E)/(Math.log(s)*Math.LOG10E-Math.log(i)*Math.LOG10E):(n-i)/(s-i),!T(n)||T(o)&&Math.abs(o)!=1/0||(o=.5),T(t.min)?u=t.min+(t.max-t.min)*o:t.min instanceof L?u=L.interpolate(o,t.min,t.max):t.min instanceof J&&(u=ee(o,t.min,t.max)),a.set(t.key,u)}else t.neutral&&a.set(t.key,t.neutral)})}),this.get("visible")&&this.bullets.length>0){let t=this.dataItems.length,i=this.startIndex(),s=this.endIndex();s0&&i--;for(let a=0;a{this._positionBullet(t);const i=t.get("sprite");t.get("dynamic")&&(i&&(i._markDirtyKey("fill"),i.markDirtySize()),i instanceof I&&i.walkChildren(s=>{s._markDirtyKey("fill"),s.markDirtySize(),s instanceof E&&s.text.markDirtyText()})),i instanceof E&&i.get("populateText")&&i.text.markDirtyText()})}_hideBullets(e){e.bullets&&b(e.bullets,t=>{let i=t.get("sprite");i&&i.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&b(t,i=>{i.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return M(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)],a=e.bullets;a&&b(a,n=>{s.push(n.get("sprite").show(t))}),yield Promise.all(s)})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return M(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],a=e.bullets;a&&b(a,n=>{s.push(n.get("sprite").hide(t))}),yield Promise.all(s)})}_sequencedShowHide(e,t){return M(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if(T(t)||(t=this.get("interpolationDuration",0)),t>0){const i=this.startIndex(),s=this.endIndex();yield Promise.all(H(this.dataItems,(a,n)=>M(this,void 0,void 0,function*(){let o=t||0;(ns+10)&&(o=0);let u=this.get("sequencedDelay",0)+o/(s-i);yield ie(u*(n-i)),e?yield this.showDataItem(a,o):yield this.hideDataItem(a,o)})))}else yield Promise.all(H(this.dataItems,i=>e?this.showDataItem(i,0):this.hideDataItem(i,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const i=t.get("valueLabel");if(i){const a=i.text;let n="";i._setDataItem(e),n=this.get("legendValueText",a.get("text","")),i.set("text",n),a.markDirtyText()}const s=t.get("label");if(s){const a=s.text;let n="";s._setDataItem(e),n=this.get("legendLabelText",a.get("text","")),s.set("text",n),a.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function G(l,e){for(let t=0,i=e.length;t0){let a=s[0];if(a.length>0){let n=a[0];l.moveTo(n.x,n.y);for(let o=0,u=s.length;o0){let i=e[0];this._display.moveTo(i.x,i.y),G(this._display,[[e]])}else if(t)G(this._display,t);else if(!this.get("draw")){let i=this.width(),s=this.height();this._display.moveTo(0,0),this._display.lineTo(i,s)}}}}function ue(l){return function(){return l}}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([j.className])});const R=Math.PI,A=2*R,k=1e-6,re=A-k;function X(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return X;const t=10**e;return function(i){this._+=i[0];for(let s=1,a=i.length;sk)if(Math.abs(m*u-h*c)>k&&a){let r=i-n,p=s-o,g=u*u+h*h,f=r*r+p*p,y=Math.sqrt(g),w=Math.sqrt(d),D=a*Math.tan((R-Math.acos((g+d-f)/(2*y*w)))/2),_=D/w,C=D/y;Math.abs(_-1)>k&&this._append`L${e+_*c},${t+_*m}`,this._append`A${a},${a},0,0,${+(m*r>c*p)},${this._x1=e+C*u},${this._y1=t+C*h}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,i,s,a,n){if(e=+e,t=+t,n=!!n,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(s),u=i*Math.sin(s),h=e+o,c=t+u,m=1^n,d=n?s-a:a-s;this._x1===null?this._append`M${h},${c}`:(Math.abs(this._x1-h)>k||Math.abs(this._y1-c)>k)&&this._append`L${h},${c}`,i&&(d<0&&(d=d%A+A),d>re?this._append`A${i},${i},0,1,${m},${e-o},${t-u}A${i},${i},0,1,${m},${this._x1=h},${this._y1=c}`:d>k&&this._append`A${i},${i},0,${+(d>=R)},${m},${this._x1=e+i*Math.cos(a)},${this._y1=t+i*Math.sin(a)}`)}rect(e,t,i,s){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${i=+i}v${+s}h${-i}Z`}toString(){return this._}}function de(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const i=Math.floor(t);if(!(i>=0))throw new RangeError(`invalid digits: ${t}`);e=i}return l},()=>new ne(e)}class F extends I{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(I.new(this._root,{width:x,height:x,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:I.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:x,height:x})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:I.classNames.concat([F.className])});class U extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:I.new(this._root,{width:x,height:x,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new Z})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){b(t.oldValues,s=>{this._removeSeries(s)});const i=this.get("colors");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([U.className])});class B extends j{}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:j.classNames.concat([B.className])});export{B,N as D,z as I,U,de as V,$ as _,V as g,ue as k}; diff --git a/dist/assets/TileClipper-NSFZXMR1.js b/dist/assets/TileClipper-NSFZXMR1.js new file mode 100644 index 0000000..797a570 --- /dev/null +++ b/dist/assets/TileClipper-NSFZXMR1.js @@ -0,0 +1 @@ +var T,c;(function(o){o[o.Unknown=0]="Unknown",o[o.Point=1]="Point",o[o.LineString=2]="LineString",o[o.Polygon=3]="Polygon"})(T||(T={}));class g{constructor(t,s){this.x=t,this.y=s}clone(){return new g(this.x,this.y)}equals(t,s){return t===this.x&&s===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,s){this.x=t,this.y=s}normalize(){const t=this.x,s=this.y,i=Math.sqrt(t*t+s*s);this.x/=i,this.y/=i}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,s){this.x+=t,this.y+=s}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,s){this.x=t.x+s.x,this.y=t.y+s.y}assignSub(t,s){this.x=t.x-s.x,this.y=t.y-s.y}rotate(t,s){const i=this.x,h=this.y;this.x=i*t-h*s,this.y=i*s+h*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,s=this.y;return Math.sqrt(t*t+s*s)}static distance(t,s){const i=s.x-t.x,h=s.y-t.y;return Math.sqrt(i*i+h*h)}static add(t,s){return new g(t.x+s.x,t.y+s.y)}static sub(t,s){return new g(t.x-s.x,t.y-s.y)}}class R{constructor(t,s,i){this.ratio=t,this.x=s,this.y=i}}class L{constructor(t,s,i,h=8,e=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=e,this._tileSize=512*h,this._dz=t,this._yPos=s,this._xPos=i}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;s>i&&(s=i),this._margin=s,this._xmin=i*this._xPos-s,this._ymin=i*this._yPos-s,this._xmax=this._xmin+i+2*s,this._ymax=this._ymin+i+2*s}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,s){this._pushLine(),this._prevIsIn=this._isIn(t,s),this._moveTo(t,s,this._prevIsIn),this._prevPt=new g(t,s),this._firstPt=new g(t,s),this._dist=0}lineTo(t,s){const i=this._isIn(t,s),h=new g(t,s),e=g.distance(this._prevPt,h);let n,a,_,y,d,f,r,p;if(i)this._prevIsIn?this._lineTo(t,s,!0):(n=this._prevPt,a=h,_=this._intersect(a,n),this._start=this._dist+e*(1-this._r),this._lineTo(_.x,_.y,!0),this._lineTo(a.x,a.y,!0));else if(this._prevIsIn)a=this._prevPt,n=h,_=this._intersect(a,n),this._lineTo(_.x,_.y,!0),this._lineTo(n.x,n.y,!1);else{const x=this._prevPt,l=h;if(x.x<=this._xmin&&l.x<=this._xmin||x.x>=this._xmax&&l.x>=this._xmax||x.y<=this._ymin&&l.y<=this._ymin||x.y>=this._ymax&&l.y>=this._ymax)this._lineTo(l.x,l.y,!1);else{const u=[];if((x.xthis._xmin||x.x>this._xmin&&l.x=this._ymax?f=!0:u.push(new R(y,this._xmin,p))),(x.xthis._xmax||x.x>this._xmax&&l.x=this._ymax?f=!0:u.push(new R(y,this._xmax,p))),(x.ythis._ymin||x.y>this._ymin&&l.y=this._xmax?d=!0:u.push(new R(y,r,this._ymin))),(x.ythis._ymax||x.y>this._ymax&&l.y=this._xmax?d=!0:u.push(new R(y,r,this._ymax))),u.length===0)d?f?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):f?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(u.length>1&&u[0].ratio>u[1].ratio)this._start=this._dist+e*u[1].ratio,this._lineTo(u[1].x,u[1].y,!0),this._lineTo(u[0].x,u[0].y,!0);else{this._start=this._dist+e*u[0].ratio;for(let m=0;m2){const t=this._firstPt,s=this._prevPt;t.x===s.x&&t.y===s.y||this.lineTo(t.x,t.y);const i=this._line;let h=i.length;for(;h>=4&&(i[0].x===i[1].x&&i[0].x===i[h-2].x||i[0].y===i[1].y&&i[0].y===i[h-2].y);)i.pop(),i[0].x=i[h-2].x,i[0].y=i[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===T.Polygon&&t&&P.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==T.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,s=t.length;if(s===0)return null;const i=[];for(let h=0;h=this._xmin&&t<=this._xmax&&s>=this._ymin&&s<=this._ymax}_intersect(t,s){let i,h,e;if(s.x>=this._xmin&&s.x<=this._xmax)h=s.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(s.y-t.y),i=t.x+e*(s.x-t.x);else if(s.y>=this._ymin&&s.y<=this._ymax)i=s.x<=this._xmin?this._xmin:this._xmax,e=(i-t.x)/(s.x-t.x),h=t.y+e*(s.y-t.y);else{h=s.y<=this._ymin?this._ymin:this._ymax,i=s.x<=this._xmin?this._xmin:this._xmax;const n=(i-t.x)/(s.x-t.x),a=(h-t.y)/(s.y-t.y);n0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===T.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===T.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,s,i){this._type!==T.Polygon?i&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line.push(new g(t,s))):(i||(tthis._xmax&&(t=this._xmax),sthis._ymax&&(s=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line.push(new g(t,s)),this._isH=!1,this._isV=!1)}_lineTo(t,s,i){let h,e;if(this._type!==T.Polygon)if(i){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,s)))return;this._line.push(new g(t,s))}else this._line&&this._line.length>0&&this._pushLine();else if(i||(tthis._xmax&&(t=this._xmax),sthis._ymax&&(s=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),s=Math.round((s-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const n=h.x===t,a=h.y===s;if(n&&a)return;this._isH&&n||this._isV&&a?(h.x=t,h.y=s,e=this._line[this._line.length-2],e.x===t&&e.y===s?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===s)):(this._isH=e.x===t,this._isV=e.y===s)):(this._line.push(new g(t,s)),this._isH=n,this._isV=a)}else this._line.push(new g(t,s))}}class I{setExtent(t){this._ratio=t===4096?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this._lines=[],this._line=null}moveTo(t,s){this._line&&this._lines.push(this._line),this._line=[];const i=this._ratio;this._line.push(new g(t*i,s*i))}lineTo(t,s){const i=this._ratio;this._line.push(new g(t*i,s*i))}close(){const t=this._line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(o){o[o.sideLeft=0]="sideLeft",o[o.sideRight=1]="sideRight",o[o.sideTop=2]="sideTop",o[o.sideBottom=3]="sideBottom"})(c||(c={}));class P{static simplify(t,s,i){if(!i)return;const h=-s,e=t+s,n=-s,a=t+s,_=[],y=[],d=i.length;for(let r=0;rx.y?(_.push(r),_.push(m),_.push(c.sideLeft),_.push(-1)):(y.push(r),y.push(m),y.push(c.sideLeft),y.push(-1))),l.x>=e&&(l.y=a&&(l.x>x.x?(_.push(r),_.push(m),_.push(c.sideBottom),_.push(-1)):(y.push(r),y.push(m),y.push(c.sideBottom),y.push(-1)))),l=x}if(_.length===0||y.length===0)return;P.fillParent(i,y,_),P.fillParent(i,_,y);const f=[];P.calcDeltas(f,y,_),P.calcDeltas(f,_,y),P.addDeltas(f,i)}static fillParent(t,s,i){const h=i.length,e=s.length;for(let n=0;n1&&h[n-2]===e?0:(h.push(e),P.calcDelta(e,i,s,h)+1)}static addDeltas(t,s){const i=t.length;let h=0;for(let e=0;eh&&(h=n)}for(let e=0;eo>=t&&o<=s||o>=s&&o<=t;export{I as _,L as e,g as h,T as t}; diff --git a/dist/assets/TileLayer-bPSfr5GU.js b/dist/assets/TileLayer-bPSfr5GU.js new file mode 100644 index 0000000..cc6efda --- /dev/null +++ b/dist/assets/TileLayer-bPSfr5GU.js @@ -0,0 +1 @@ +import{dK as _,dO as S,f1 as T,dM as b,dN as w,em as O,dP as $,dL as W,en as R,dQ as P,ar as m,bV as U,bW as u,f2 as f,f3 as j,ew as L,E as h,df as M,dv as N,f4 as A,f5 as B,e as i,y as o,dt as I,du as C,f6 as k,dW as D,c as J,c7 as q}from"./index-J0iiHjMT.js";import{E,f as G,X as V}from"./SublayersOwner-8xrm3MkT.js";import{o as K}from"./CustomParametersMixin-Y1bOcayO.js";import"./QueryTask-91TvtrTt.js";import"./executeForIds-wXO8-pll.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./executeQueryJSON-ACj9qY0y.js";import"./FeatureSet-d4S1oKME.js";import"./executeQueryPBF-vdaOUMid.js";import"./FeatureType-MpRe7WJj.js";import"./FeatureTemplate-kUgbbA00.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";var y;const v=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let s=y=class extends _(S(E(T(G(b(w(O($(W(R(K(q)))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(P).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){var r;const e=(r=this.parsedUrl)==null?void 0:r.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){var t;return(e=e||((t=r.tileInfo)==null?void 0:t.spatialReference))&&m.fromJSON(e)}writeSublayers(e,r,t,a){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:l})=>l&&l.toArray().reverse()).toArray(),n=[],c={writeSublayerStructure:!1,...a};p.forEach(l=>{const d=l.write({},c);n.push(d)}),n.some(l=>Object.keys(l).length>1)&&(r.layers=n)}get tileServers(){var e;return this._getDefaultTileServers((e=this.parsedUrl)==null?void 0:e.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>U(r).path):null}fetchTile(e,r,t,a={}){const{signal:p}=a,n=this.getTileUrl(e,r,t),c={responseType:"image",signal:p,query:{...this.refreshParameters}};return u(n,c).then(l=>l.data)}async fetchImageBitmapTile(e,r,t,a={}){const{signal:p}=a;if(this.fetchTile!==y.prototype.fetchTile){const d=await this.fetchTile(e,r,t,a);return f(d,e,r,t,p)}const n=this.getTileUrl(e,r,t),c={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:l}=await u(n,c);return f(l,e,r,t,p)}getTileUrl(e,r,t){var c,l;const a=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=j({...(c=this.parsedUrl)==null?void 0:c.query,blankTile:!a&&null,...this.customParameters,token:this.apiKey}),n=this.tileServers;return`${n&&n.length?n[r%n.length]:(l=this.parsedUrl)==null?void 0:l.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return L(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new h("tile-layer:undefined-url","layer's url is not defined");const a=M(this.parsedUrl.path);if(a!=null&&a.serverType==="ImageServer")throw new h("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");u(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!N(t))return this._fetchServerVersion(t,e).then(a=>{this.read({currentVersion:a})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!A(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return u(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(a=>{if(a.data&&a.data.currentVersion)return a.data.currentVersion;throw new h("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r?r[2]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,a=v.length;t({enabled:!1})}}})],s.prototype,"isReference",void 0),i([o({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],s.prototype,"operationalLayerType",void 0),i([o({type:Boolean})],s.prototype,"resampling",void 0),i([o()],s.prototype,"sourceJSON",void 0),i([o({type:m})],s.prototype,"spatialReference",void 0),i([I("spatialReference",["spatialReference","tileInfo"])],s.prototype,"readSpatialReference",null),i([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),i([o({readOnly:!0})],s.prototype,"sublayers",void 0),i([C("sublayers",{layers:{type:[V]}})],s.prototype,"writeSublayers",null),i([o({json:{read:!1,write:!1}})],s.prototype,"popupEnabled",void 0),i([o()],s.prototype,"tileServers",null),i([k("tileServers")],s.prototype,"castTileServers",null),i([o({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),i([o(D)],s.prototype,"url",void 0),s=y=i([J("esri.layers.TileLayer")],s);const g=Symbol("default-fetch-tile");s.prototype.fetchTile[g]=!0;const le=s;export{le as default}; diff --git a/dist/assets/TileLayerView3D-5Hf3FIEh.js b/dist/assets/TileLayerView3D-5Hf3FIEh.js new file mode 100644 index 0000000..55a50d8 --- /dev/null +++ b/dist/assets/TileLayerView3D-5Hf3FIEh.js @@ -0,0 +1 @@ +import{ct as p,E as n,e as i,y as a,c as h}from"./index-J0iiHjMT.js";import{n as u}from"./LayerView3D-iOx2MD1g.js";import{o as f}from"./TiledLayerView3D-Av58zTxG.js";import{u as m}from"./LayerView-efDufa6j.js";import{a as y}from"./RefreshableLayerView-Pd4dLcWr.js";import{S as c,G as d}from"./MapServiceLayerViewHelper-a8WMaeWS.js";import{r as g}from"./drapedUtils-9db1OpTX.js";let t=class extends y(f(u(m))){constructor(){super(...arguments),this.type="tile-3d",this._popupHighlightHelper=null}get imageFormatIsOpaque(){return this.layer.tileInfo.format==="jpg"}get hasMixedImageFormats(){return this.layer.tileInfo.format==="mixed"}get tileInfo(){return this.layer.tileInfo}initialize(){var e,r;if(this.layer.type==="web-tile"){const l=(e=this.layer.fullExtent)==null?void 0:e.spatialReference,s=(r=this.layer.tileInfo)==null?void 0:r.spatialReference;if(l==null||s==null||!p(l,s)){const o=this.layer.originOf("fullExtent")==="defaults"||this.layer.fullExtent==null?"SceneView requires fullExtent to be specified by the user on WebTileLayer":"SceneView requires fullExtent to be specified in the same spatial reference as tileInfo on WebTileLayer";this.addResolvingPromise(Promise.reject(new n("layerview:incompatible-fullextent",o)))}}c(this,this.layer)&&(this._popupHighlightHelper=new d({createFetchPopupFeaturesQueryGeometry:(l,s)=>g(l,s,this.view),layerView:this,updatingHandles:this._updatingHandles})),this._addTilingSchemeMatchPromise()}destroy(){var e;(e=this._popupHighlightHelper)==null||e.destroy()}async fetchPopupFeatures(e,r){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeatures(e,r):[]}async doRefresh(){this.suspended||this.emit("data-changed")}};i([a()],t.prototype,"imageFormatIsOpaque",null),i([a()],t.prototype,"hasMixedImageFormats",null),i([a()],t.prototype,"layer",void 0),i([a()],t.prototype,"tileInfo",null),t=i([h("esri.views.3d.layers.TileLayerView3D")],t);const E=t;export{E as default}; diff --git a/dist/assets/TileTreeDebugger-2DVbY5sQ.js b/dist/assets/TileTreeDebugger-2DVbY5sQ.js new file mode 100644 index 0000000..42977cf --- /dev/null +++ b/dist/assets/TileTreeDebugger-2DVbY5sQ.js @@ -0,0 +1 @@ +import{e as r,p as M,bX as P,S,ab as g,bY as O,bZ as $,b_ as j,b$ as A,V as L,c0 as k,c1 as T,y as p,c as E,c2 as z}from"./index-J0iiHjMT.js";const J=[[0,179,255],[117,62,128],[0,104,255],[215,189,166],[32,0,193],[98,162,206],[102,112,129],[52,125,0],[142,118,246],[138,83,0],[92,122,255],[122,55,83],[0,142,255],[81,40,179],[0,200,244],[13,24,127],[0,170,147],[19,58,241],[22,44,35]];let a=class extends M{constructor(s){super(s),this.updating=!1,this.enablePolygons=!0,this.enableLabels=!0,this._polygons=new Map,this._labels=new Map,this._enabled=!0}initialize(){this._symbols=J.map(s=>new P({color:[s[0],s[1],s[2],.6],outline:{color:"black",width:1}})),this.update()}destroy(){this._enabled=!1,this.clear()}get enabled(){return this._enabled}set enabled(s){this._enabled!==s&&(this._enabled=s,this.update())}update(){if(!this._enabled)return void this.clear();const s=e=>{if(e.label!=null)return e.label;let l=e.lij.toString();return e.loadPriority!=null&&(l+=` (${e.loadPriority})`),l},h=this.getTiles(),c=new Array,d=new Set((this._labels.size,this._labels.keys()));h.forEach((e,l)=>{const t=e.lij.toString();d.delete(t);const x=e.lij[0],u=e.geometry;if(this.enablePolygons&&!this._polygons.has(t)){const i=new S({geometry:u,symbol:this._symbols[x%this._symbols.length]});this._polygons.set(t,i),c.push(i)}if(this.enableLabels){const i=s(e),w=l/(h.length-1),y=z(0,200,w),_=z(20,6,w)/.75,m=e.loadPriority!=null&&e.loadPriority>=h.length,v=new g([y,m?0:y,m?0:y]),f=this.view.type==="3d"?()=>new O({verticalOffset:new $({screenLength:40/.75}),callout:new j({color:new g("white"),border:new A({color:new g("black")})}),symbolLayers:new L([new k({text:i,halo:{color:"white",size:1/.75},material:{color:v},size:_})])}):()=>new T({text:i,haloColor:"white",haloSize:1/.75,color:v,size:_}),n=this._labels.get(t);if(n){const o=f();n.symbol!=null&&JSON.stringify(o)===JSON.stringify(n.symbol)||(n.symbol=o)}else{const o=new S({geometry:u.extent.center,symbol:f()});this._labels.set(t,o),c.push(o)}}});const b=new Array;d.forEach(e=>{const l=this._polygons.get(e);l!=null&&(b.push(l),this._polygons.delete(e));const t=this._labels.get(e);t!=null&&(b.push(t),this._labels.delete(e))}),this.view.graphics.removeMany(b),this.view.graphics.addMany(c)}clear(){this.view.graphics.removeMany(Array.from(this._polygons.values())),this.view.graphics.removeMany(Array.from(this._labels.values())),this._polygons.clear(),this._labels.clear()}};r([p({constructOnly:!0})],a.prototype,"view",void 0),r([p({readOnly:!0})],a.prototype,"updating",void 0),r([p()],a.prototype,"enabled",null),a=r([E("esri.views.support.TileTreeDebugger")],a);export{a as d}; diff --git a/dist/assets/TiledLayerView3D-Av58zTxG.js b/dist/assets/TiledLayerView3D-Av58zTxG.js new file mode 100644 index 0000000..8f8c248 --- /dev/null +++ b/dist/assets/TiledLayerView3D-Av58zTxG.js @@ -0,0 +1 @@ +import{e as r,y as n,fi as u,fj as g,c as d,E as o,w as f,fk as y}from"./index-J0iiHjMT.js";const S=p=>{let a=class extends p{get imageFormatIsOpaque(){return!1}get fullExtent(){return this.layer.fullExtent}get isOpaque(){return this.fullOpacity>=1&&this.imageFormatIsOpaque}get dataScaleRange(){const e=this.tileInfo.lods;let i=e[0].scale,t=e[e.length-1].scale;if("tilemapCache"in this.layer&&this.layer.tilemapCache){const{effectiveMinLOD:l,effectiveMaxLOD:s}=this.layer.tilemapCache;i=this.tileInfo.lodAt(l).scale,t=this.tileInfo.lodAt(s).scale}return{minScale:i,maxScale:t}}get dataLevelRange(){const{minScale:e,maxScale:i}=this.dataScaleRange;return this.levelRangeFromScaleRange(e,i)}get displayLevelRange(){const e=this.layer.minScale||this.dataScaleRange.minScale,i=this.layer.maxScale||this.dataScaleRange.maxScale,t=this.levelRangeFromScaleRange(e,i);return this.layer.maxScale&&t.maxLevel++,t}getTileUrl(e,i,t){return this.layer.getTileUrl(e,i,t)}_addTilingSchemeMatchPromise(){if(this.fullExtent==null)return this.addResolvingPromise(Promise.reject(new o("tilingscheme:extent-not-defined","This layer doesn't define a fullExtent.")));const e=this._getTileInfoSupportError(this.tileInfo,this.fullExtent);if(e!=null)return this.addResolvingPromise(Promise.reject(e));const i=f(()=>{var t,l;return(l=(t=this.view)==null?void 0:t.basemapTerrain)==null?void 0:l.tilingSchemeLocked}).then(()=>{const t=this.view.basemapTerrain.tilingScheme,l=this._getTileInfoCompatibilityError(this.tileInfo,t);if(l)throw l});this.addResolvingPromise(i)}_getTileInfoSupportError(e,i){const t=y(e,i,this.view.spatialReference,this.view.state.viewingMode);if(t){const l={layer:this.layer,error:t};let s;switch(t.name){case"tilingscheme:spatial-reference-mismatch":case"tilingscheme:global-unsupported-spatial-reference":case"tilingscheme:local-unsupported-spatial-reference":s=new o("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",l);break;default:s=new o("layerview:tiling-scheme-unsupported","The tiling scheme of this layer is not supported by SceneView",l)}return s}return null}_getTileInfoCompatibilityError(e,i){return e!=null&&i.compatibleWith(e)?null:new o("layerview:tiling-scheme-incompatible","The tiling scheme of this layer is incompatible with the tiling scheme of the surface")}levelRangeFromScaleRange(e,i){const t={minLevel:0,maxLevel:1/0},l=this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.tilingScheme;if(!l)return t;const s=l.levels[0],h=m=>{const c=Math.log(s.scale/m)/Math.LN2;return .5-Math.abs(.5-c%1)<1e-9?Math.round(c):Math.ceil(c)};return e!=null&&e>0&&(t.minLevel=Math.max(0,h(e))),i!=null&&i>0&&(t.maxLevel=Math.max(0,h(i))),t}isUpdating(){return!!(this.view&&this.view.basemapTerrain&&this.view.basemapTerrain.updating)}};return r([n({readOnly:!0})],a.prototype,"imageFormatIsOpaque",null),r([n({readOnly:!0})],a.prototype,"updating",void 0),r([n(u)],a.prototype,"updatingProgress",void 0),r([n(g)],a.prototype,"updatingProgressValue",void 0),r([n()],a.prototype,"fullExtent",null),r([n({readOnly:!0})],a.prototype,"isOpaque",null),r([n()],a.prototype,"dataScaleRange",null),r([n({readOnly:!0})],a.prototype,"dataLevelRange",null),r([n({readOnly:!0})],a.prototype,"displayLevelRange",null),r([n()],a.prototype,"layer",void 0),r([n()],a.prototype,"tileInfo",void 0),a=r([d("esri.views.3d.layers.TiledLayerView3D")],a),a};export{S as o}; diff --git a/dist/assets/TimeOnly-ljWtUK7N.js b/dist/assets/TimeOnly-ljWtUK7N.js new file mode 100644 index 0000000..51d174a --- /dev/null +++ b/dist/assets/TimeOnly-ljWtUK7N.js @@ -0,0 +1 @@ +import{mA as i,mB as l,mC as M,mD as g,mE as Z,c_ as q,mF as U,dT as b}from"./index-J0iiHjMT.js";var y;(function(s){s.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const A={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(A[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(s,e,t){return st?s-t:0}function d(s,e,t){return st?t:s}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,r=1,a=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(a)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=i.local(e,t).daysInMonth;let D=i.fromObject({day:d(r,1,p),year:e,month:d(t,1,12),hour:d(a,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(r,1,p),hours:h(a,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const r=m(t);return e.isUnknownTimeZone||r===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,r):new n(e._date.setZone(r))}static dateJSToArcadeDate(e){return new n(i.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const r=m(t);return new n(i.fromJSDate(e,{zone:r}))}static unknownEpochToArcadeDate(e){return new n(i.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(i.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const r=m(t);return new n(i.fromMillis(e,{zone:r}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const r=m(t);return e.zone===l.instance||r===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,r):new n(e.setZone(r))}static nowToArcadeDate(e){const t=m(e);return new n(i.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(i.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=i.fromISO(e,{setZone:!0});return new n(t)}}function m(s,e=!0){if(s instanceof M)return s;if(s.toLowerCase()==="system")return"system";if(s.toLowerCase()==="utc")return"UTC";if(s.toLowerCase()==="unknown")return l.instance;if(/^[\+\-]?[0-9]{1,2}([:][0-9]{2})?$/.test(s)){const r=g.parseSpecifier("UTC"+(s.startsWith("+")||s.startsWith("-")?"":"+")+s);if(r)return r}const t=Z.create(s);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(s){s=s.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const t=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of s.match(t)||[])switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"X":case"x":e+=r;break;default:r.length>=2&&r.slice(0,1)==="["&&r.slice(-1)==="]"?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}let O=class c{constructor(e,t,r){this._year=e,this._month=t,this._day=r,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return i.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return i.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null){if(e===null||e==="")return this.toString();if(!(e=k(e)))return"";const t=this.toDateTime("unknown");return n.dateTimeToArcadeDate(t).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd")}toSQLValue(){return this.toFormat("yyyy-LL-dd")}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd")+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return i.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=i.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=i.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,r){const a=new c(e,t,r);return a.isValid===!1?null:a}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const r=[];if(t)(t=k(t))&&r.push(t);else if(t===null||t===""){const a=i.fromISO(e,{setZone:!0});return a.isValid?c.fromParts(a.year,a.month,a.day):null}for(const a of r){const o=i.fromFormat(e,t??a);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=i.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function $(s){if(s==null)return null;if(typeof s=="number")return s;let e=s.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function Y(s){if(s==null)return null;switch(s.type){case"polygon":case"multipoint":case"polyline":return s.extent;case"point":return new b({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});case"extent":return s}return null}function z(s){if(s==null)return null;if(typeof s=="number")return s;let e=s.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function I(s){if(s==null)return null;const e=s.clone();return s.cache._geVersion!==void 0&&(e.cache._geVersion=s.cache._geVersion),e}function f(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}function C(s){if(!s)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const r of s.match(e)||[])switch(r){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=r;break;case"A":case"a":t+="a";break;default:t+=`'${r}'`}return t}class u{constructor(e,t,r,a){this._hour=e,this._minute=t,this._second=r,this._millisecond=a,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?i.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,r,a){const o=new u(e,t,r,a);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),r=Math.floor(e/6e4%60),a=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(a,r,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const r=[];t?(t=C(t))&&r.push(t):t!==null&&t!==""||(r.push("HH:mm:ss"),r.push("HH:mm:ss.SSS"),r.push("hh:mm:ss a"),r.push("hh:mm:ss.SSS a"),r.push("HH:mm"),r.push("hh:mm a"),r.push("H:mm"),r.push("h:mm a"),r.push("H:mm:ss"),r.push("h:mm:ss a"),r.push("H:mm:ss.SSS"),r.push("h:mm:ss.SSS a"));for(const a of r){const o=i.fromFormat(e,a);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return i.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as a,O as b,I as c,m as h,n as m,u as n,$ as r,Y as s}; diff --git a/dist/assets/Tooltip-ON77BKb3.js b/dist/assets/Tooltip-ON77BKb3.js new file mode 100644 index 0000000..5a21c81 --- /dev/null +++ b/dist/assets/Tooltip-ON77BKb3.js @@ -0,0 +1,7 @@ +import{f as yt,s as bt,m as V,z as Mt,Z as P,x as Lt}from"./euclideanLengthMeasurementUtils-VQw5qWk6.js";import{kQ as Ct,as as Et,aa as D,r5 as Vt,kB as Dt,eF as Ot,cp as C,aB as at,kI as wt,aC as dt,aH as zt,al as It,kG as Rt,K as Ft,e as a,y as c,c as v,hn as s,v7 as Nt,hl as A,kM as ht,gD as At,d8 as S,pH as F,rl as vt,d as N,fl as St,hm as xt,hB as Ht,de as E,v8 as Pt,v9 as Ut,va as Wt,vb as qt,p as Kt,vc as Zt,A as H,n as ft,hw as Gt}from"./index-J0iiHjMT.js";import{T as lt,k as Bt,q as mt,x as jt,F as Qt,S as Xt,U as Yt}from"./quantityFormatUtils-NiAiojad.js";function Jt({hasZ:n,spatialReference:t,paths:e},i,o=0){const l=Ct(t);if(l==null)return!1;const r=n?h=>h:h=>Et(te,h[0],h[1],o);for(const h of e){const b=[];for(const T of h){const y=[0,0,o];l(r(T),0,y,0),b.push(y)}i.push(b)}return!0}const te=D();function kt(n,t,e,i,...o){return Vt(n)&&Dt(n)?t.apply(void 0,o):Ot(n)?e.apply(void 0,o):i.apply(void 0,o)}function Tt(n){const{spatialReference:t}=n;return kt(t,se,oe,ae,n)}function rt(n,t){if(!It(n.spatialReference,t.spatialReference))return null;const{spatialReference:e}=n;return O[0]=n.x,O[1]=n.y,O[2]=n.hasZ?n.z:0,z[0]=t.x,z[1]=t.y,z[2]=t.hasZ?t.z:0,ct(O,z,e)}function ct(n,t,e){return kt(e,ee,ne,ie,n,t,e)}function ee(n,t,e){return C(at(ut,n,t,e).distance,"meters")}function ne(n,t,e){return C(wt(le(n,t,e),"meters"),"meters")}function ie(n,t,e){return dt(n,e,_t)&&dt(t,e,gt)?C(at(ut,_t,gt).distance,"meters"):null}function se(n){return C(Rt([n],"meters")[0],"meters")}function oe(n){return C(wt(n,"meters"),"meters")}function ae(n){const t=[];if(!Jt(n,t))return null;let e=0;for(const i of t){let o=0;for(let l=1;l!t.readOnly)}enterInputMode(){this._mode="input",this.emit("focus")}exitInputMode(){this._mode="feedback"}unlockAllFields(){this.allFields.forEach(t=>t.unlock())}};a([c()],w.prototype,"tooltipOptions",void 0),a([c()],w.prototype,"_mode",void 0),a([c()],w.prototype,"mode",null),a([c()],w.prototype,"helpMessage",void 0),a([c()],w.prototype,"viewType",void 0),a([c()],w.prototype,"allFields",null),a([c()],w.prototype,"editableFields",null),w=a([v("esri.views.interactive.tooltip.SketchTooltipInfo")],w);const k="esri-tooltip",p=`${k}-content`,re=`${k}-content--input`,ce=`${k}-content__header`,ue=`${k}-table`,pe=`${k}-help-message`;function f({className:n,helpMessage:t,mode:e,onDiscard:i,onkeydown:o},...l){const r=l.flat(10).filter(h=>!!h);return s("div",{class:Nt(n,p,e==="input"&&re),onkeydown:o},e==="input"?s("div",{class:ce,key:"tooltip-content-header"},s("calcite-button",{appearance:"transparent",iconFlipRtl:"both",iconStart:"chevron-left",kind:"neutral",onclick:i,scale:"s",tabIndex:-1})):null,r.length>0?s("div",{class:ue},...r):null,t?s("div",{class:pe,key:"help-message"},t):null)}const I=`${k}-field`,R={base:I,inputMode:`${I}--input`,title:`${I}__title`,value:`${I}__value`};let u=class extends A{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return s("div",{class:this.classes({[R.base]:!0,[R.inputMode]:this.mode==="input"})},s("div",{class:R.title},this.title),s("div",{class:R.value},this.value))}};a([c()],u.prototype,"hidden",void 0),a([c()],u.prototype,"mode",void 0),a([c()],u.prototype,"title",void 0),a([c()],u.prototype,"value",void 0),u=a([v("esri.views.interactive.tooltip.TooltipField")],u);const de={base:`${k}-value-by-value`};let x=class extends A{constructor(){super(...arguments),this.divider="×"}render(){return s("div",{class:de.base},s("span",null,this.left),s("span",null,this.divider),s("span",null,this.right))}};a([c()],x.prototype,"left",void 0),a([c()],x.prototype,"divider",void 0),a([c()],x.prototype,"right",void 0),x=a([v("esri.views.interactive.tooltip.ValueByValue")],x);let d=class extends A{constructor(){super(...arguments),this._getFormatters=At((n,t)=>({angle:e=>lt(e,e.rotationType),area:(e,i)=>Bt(n,e,i??t.area),length:(e,i,o)=>mt(n,e,i??t.length,o),relativeLength:(e,i)=>jt(n,e,i??t.length),totalLength:(e,i)=>mt(n,e,i??t.length),verticalLength:(e,i)=>Qt(n,e,i??t.length),relativeVerticalLength:(e,i)=>Xt(n,e,i??t.verticalLength),relativeOrientation:e=>S(e,{maximumFractionDigits:2,minimumFractionDigits:2,signDisplay:"exceptZero"}),percentage:e=>S(e.value,{style:"percent"}),scale:e=>S(e,{style:"percent",maximumFractionDigits:0})})),this._formatScale=n=>this._formatters.scale(n),this._formatRelativeOrientation=n=>this._formatters.relativeOrientation(n),this._formatLength=(n,t,e)=>this._formatters.length(n,t,e),this._formatRelativeLength=(n,t)=>this._formatters.relativeLength(n,t),this._formatVerticalLength=(n,t)=>this._formatters.verticalLength(n,t),this._formatRelativeVerticalLength=(n,t)=>this._formatters.relativeVerticalLength(n,t),this._formatArea=(n,t)=>this._formatters.area(n,t),this._formatPercentage=n=>this._formatters.percentage(n),this._onDiscard=()=>{this._exitInputMode()},this._onCommit=(n,t)=>{var r;if(t==="commit-and-exit")return this._exitInputMode();const e=this._getFocusableInputs(),i=e.length,o=e.indexOf(n);if(o===-1)return this._exitInputMode();const l=((o+(t==="commit-and-next"?1:-1))%i+i)%i;(r=e.at(l))==null||r.focus()},this._handleTab=n=>{if(n.code!==F.next)return;const t=this._getFocusableInputs();if(t.length===0)return;const e=t.at(0),i=t.at(-1);e&&i&&(n.shiftKey?document.activeElement===e&&(n.preventDefault(),i.focus()):document.activeElement===i&&(n.preventDefault(),e.focus()))}}get _displayUnits(){const n=vt(this.tooltip.view);return{length:n,verticalLength:n,area:n,angle:"degrees"}}get _inputUnitInfos(){const n=this._messagesUnits,t=h=>({unit:h,abbreviation:Ht(n,h,"abbr")}),e=vt(this.tooltip.view),i=Pt(e),o=Ut(e),l=Wt(e),r="degrees";return{length:t(i),relativeLength:t(i),verticalLength:t(o),relativeVerticalLength:t(o),area:t(l),orientation:t(r),rotation:t(r)}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,onCommit:this._onCommit,onDiscard:this._onDiscard}}initialize(){let n=new AbortController;this.addHandles([N(()=>this.info.mode,t=>{this.tooltip.positionMode=t==="input"?"fixed":"follow-cursor"}),St(()=>this.info,"focus",()=>{n==null||n.abort();const{signal:t}=n=new AbortController;requestAnimationFrame(()=>{var e;t.aborted||((e=this._getFocusableInputs().at(0))==null||e.focus())})})])}loadDependencies(){return xt({button:()=>E(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),icon:()=>E(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([16,13,2,3,10])),input:()=>E(()=>import("./calcite-input-V4_hyPVg.js"),__vite__mapDeps([17,18,2,3,4,5,9,6,7,8,10,12,11,13,19]))})}_getHelpMessage(n){var b,T,y,m;const{info:t}=this,{tooltipOptions:e,helpMessage:i,viewType:o}=t,l=(b=e==null?void 0:e.visibleElements)==null?void 0:b.helpMessage,r=n??i,h=o==="3d"?"helpMessages3d":"helpMessages2d";return l&&r?(m=(y=(T=this._messagesTooltip)==null?void 0:T.sketch)==null?void 0:y[h])==null?void 0:m[r]:void 0}_exitInputMode(){this.info.exitInputMode(),document.querySelector(".esri-view-surface").focus()}_getFocusableInputs(){var n;return Array.from(((n=this.domNode)==null?void 0:n.querySelectorAll("input:not([disabled])"))??[])}};a([ht("esri/core/t9n/Units"),c()],d.prototype,"_messagesUnits",void 0),a([ht("esri/views/interactive/tooltip/t9n/Tooltip"),c()],d.prototype,"_messagesTooltip",void 0),a([c()],d.prototype,"info",void 0),a([c()],d.prototype,"tooltip",void 0),a([c()],d.prototype,"_displayUnits",null),a([c()],d.prototype,"_inputUnitInfos",null),a([c()],d.prototype,"_formatters",null),a([c()],d.prototype,"fieldContext",null),d=a([v("esri.views.interactive.tooltip.content.TooltipContent")],d);const he={base:`${p} ${`${p}--draw-rectangle`}`};let U=class extends d{render(){const{area:t,radius:e,xSize:i,ySize:o,tooltipOptions:l}=this.info,{visibleElements:r}=l,h=this._messagesTooltip.sketch;return s(f,{className:he.base,helpMessage:this._getHelpMessage()},r.radius&&e!=null?s(u,{title:h.radius,value:this._formatLength(e)}):null,r.size&&i!=null&&o!=null?s(u,{title:h.size,value:s(x,{left:this._formatLength(i),right:this._formatLength(o)})}):null,r.area?s(u,{title:h.area,value:this._formatArea(t)}):null)}};U=a([v("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],U);const ve={base:`${p}--draw-mesh`};let W=class extends d{render(){const{elevation:t,tooltipOptions:e}=this.info,{visibleElements:i}=e,o=this._messagesTooltip.sketch;return s(f,{className:ve.base,helpMessage:this._getHelpMessage()},i.elevation?s(u,{title:o.elevation,value:this._formatVerticalLength(t.actual)}):null)}};W=a([v("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],W);const _=`${k}-editable-field`,g={base:_,inputMode:`${_}--input`,locked:`${_}--locked`,title:`${_}__title`,titleContent:`${_}__title__content`,value:`${_}__value`,valueContent:`${_}__value__content`,input:`${_}__input`,inputDisabled:`${_}__input--disabled`,inputReadOnly:`${_}__input--read-only`,inputSuffix:`${_}__input-suffix`,button:`${_}__button`};let $=class extends A{constructor(){super(...arguments),this._input=null,this._afterInputCreate=t=>{this._input=t},this._selectText=()=>{requestAnimationFrame(()=>{var t;(t=this._input)==null||t.select()})},this._onKeyDown=t=>{t.key===F.discard&&this._discard()},this._onInputKeyDown=t=>{switch(t.key){case F.commit:return this._commit({type:"commit-and-exit",allowLockingCurrentValue:!0});case F.next:return t.stopPropagation(),this._commit({type:t.shiftKey?"commit-and-previous":"commit-and-next",allowLockingCurrentValue:!1})}},this._onInput=t=>{this.field.inputValue=t.target.value},this._onLockClick=()=>{const{field:t}=this;t.locked?t.unlock():this._lock()}}loadDependencies(){return xt({button:()=>E(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),icon:()=>E(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([16,13,2,3,10]))})}render(){const{mode:t,field:e}=this,i=t==="input",{locked:o}=e;return s("div",{class:this.classes({[g.base]:!0,[g.inputMode]:t==="input",[g.locked]:o})},s("div",{class:g.title,key:"title"},s("div",{class:g.titleContent,key:"title-content"},this._title,o&&!i?s("calcite-icon",{icon:"lock",key:"icon",scale:"s"}):null)),s("div",{class:g.value,key:"value"},i?this._renderInput():s("span",{key:"formatted-value"},this._feedbackValue)))}get _initialValue(){const{field:t}=this;return t.actual!=null?t.toInputUnits(t.actual,this.context).value:null}get _feedbackValue(){const{context:t,field:e}=this,{actual:i,committed:o,format:l}=e;return o!=null?l(o,t):i!=null?l(i,t):""}get _displayValue(){const{field:t}=this,{inputValue:e,committed:i}=t;return e??(i!=null?this._toString(t.toInputUnits(i,this.context).value):this._toString(this._initialValue))}get _suffix(){const{suffix:t}=this.field;return typeof t=="string"?t:t(this.context)}get _title(){const{title:t}=this.field;return typeof t=="string"?t:t(this.context)}_renderInput(){const{disabled:t,locked:e,readOnly:i}=this.field;return s("div",{class:g.valueContent,key:"input-container",onkeydown:this._onKeyDown},s("input",{afterCreate:this._afterInputCreate,class:this.classes({[g.input]:!0,[g.inputDisabled]:t,[g.inputReadOnly]:i}),disabled:t||i,onfocus:this._selectText,oninput:this._onInput,onkeydown:this._onInputKeyDown,readOnly:i,type:"text",value:this._displayValue}),s("div",{class:g.inputSuffix,key:"suffix"},this._suffix),i?void 0:s("calcite-button",{appearance:"transparent",class:g.button,disabled:t,iconStart:e?"lock":"unlock",kind:"neutral",onclick:this._onLockClick,scale:"s",tabIndex:-1}))}_commit({type:t,allowLockingCurrentValue:e}){const{_input:i,field:o}=this;i&&(o.locked&&o.inputValue===""?o.unlock():(e||o.inputValue!=null)&&this._lock(),this.context.onCommit(i,t))}_discard(){this._input&&(this.field.inputValue=null,this.context.onDiscard(this._input))}_lock(){const{field:t}=this,e=this._parseNumber(t.inputValue),i=e!=null?t.createQuantity(e,this.context):null;t.lock(i)}_parseNumber(t){if(t==null)return null;const e=parseFloat(t);return isNaN(e)||!isFinite(e)?null:e}_toString(t){return t!=null?t.toFixed(3):"0"}};a([c()],$.prototype,"field",void 0),a([c()],$.prototype,"context",void 0),a([c()],$.prototype,"mode",void 0),a([c()],$.prototype,"_initialValue",null),a([c()],$.prototype,"_feedbackValue",null),a([c()],$.prototype,"_input",void 0),a([c()],$.prototype,"_displayValue",null),a([c()],$.prototype,"_suffix",null),a([c()],$.prototype,"_title",null),$=a([v("esri.views.interactive.tooltip.TooltipEditableField")],$);function pt(n){const t=n.fields.filter(e=>e!=null&&!e.hidden);return t.length===0?null:s(qt,null,t.map(e=>s($,{context:n.context,field:e,key:e.id,mode:n.mode})))}const fe={base:`${p}--draw-point`};let q=class extends d{render(){const{fieldContext:t,info:e}=this,{mode:i,elevation:o,tooltipOptions:l}=e,{visibleElements:r}=l;return s(f,{className:fe.base,helpMessage:this._getHelpMessage(),mode:i,onkeydown:this._handleTab,onDiscard:this._onDiscard},s(pt,{context:t,fields:[r.elevation?o:void 0],mode:i}))}};q=a([v("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],q);const me={base:`${p} ${`${p}--draw-polygon`}`};let K=class extends d{render(){const{fieldContext:t,info:e}=this,{area:i,distance:o,elevation:l,mode:r,orientation:h,tooltipOptions:b,viewType:T}=e,{inputEnabled:y,visibleElements:m}=b;return s(f,{className:me.base,helpMessage:this._getHelpMessage(),mode:r,onkeydown:this._handleTab,onDiscard:this._onDiscard},s(pt,{context:t,fields:[y&&m.orientation?h:void 0,y&&m.distance?o:void 0,m.elevation&&T!=="2d"?l:void 0,m.area?i:void 0],mode:r}))}};K=a([v("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],K);const _e={base:`${p} ${`${p}--draw-polyline`}`};let Z=class extends d{render(){const{fieldContext:t,info:e}=this,{distance:i,elevation:o,mode:l,orientation:r,tooltipOptions:h,totalLength:b,viewType:T}=e,{inputEnabled:y,visibleElements:m}=h;return s(f,{className:_e.base,helpMessage:this._getHelpMessage(),mode:l,onkeydown:this._handleTab,onDiscard:this._onDiscard},s(pt,{context:t,fields:[y&&m.orientation?r:void 0,y&&m.distance?i:void 0,m.elevation&&T!=="2d"?o:void 0,m.totalLength?b:void 0],mode:l}))}};Z=a([v("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],Z);const ge={base:`${p} ${`${p}--draw-rectangle`}`};let G=class extends d{render(){const{area:t,xSize:e,ySize:i,tooltipOptions:o}=this.info,{visibleElements:l}=o,r=this._messagesTooltip.sketch;return s(f,{className:ge.base,helpMessage:this._getHelpMessage()},l.size&&e!=null&&i!=null?s(u,{title:r.size,value:s(x,{left:this._formatLength(e),right:this._formatLength(i)})}):null,l.area?s(u,{title:r.area,value:this._formatArea(t)}):null)}};G=a([v("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],G);const $e={base:`${p} ${`${p}--extent-rotate`}`};let B=class extends d{render(){const{angle:t,tooltipOptions:e}=this.info,{visibleElements:i}=e,o=this._messagesTooltip.sketch;return s(f,{className:$e.base,helpMessage:this._getHelpMessage()},i.rotation?s(u,{title:o.rotation,value:this._formatRelativeOrientation(t)}):null)}};B=a([v("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],B);const ye={base:`${p} ${`${p}--extent-scale`}`};let j=class extends d{render(){const t=this.info,{visibleElements:e}=t.tooltipOptions,i=this._messagesTooltip.sketch;return s(f,{className:ye.base,helpMessage:this._getHelpMessage()},e.size?s(u,{title:i.size,value:s(x,{left:this._formatLength(t.xSize),right:this._formatLength(t.ySize)})}):null,e.scale?s(u,{title:i.scale,value:s(x,{left:this._formatScale(t.xScale),right:this._formatScale(t.yScale)})}):null)}};j=a([v("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],j);const be={base:`${p} ${`${p}--reshape-edge-offset`}`};let Q=class extends d{render(){const{area:t,distance:e,totalLength:i,tooltipOptions:o}=this.info,{visibleElements:l}=o,r=this._messagesTooltip.sketch;return s(f,{className:be.base,helpMessage:this._getHelpMessage()},l.distance?s(u,{title:r.distance,value:this._formatRelativeLength(e)}):null,l.area&&t!=null?s(u,{title:r.area,value:this._formatArea(t)}):null,l.totalLength&&i!=null?s(u,{title:r.totalLength,value:this._formatLength(i)}):null)}};Q=a([v("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Q);const we={base:`${p} ${`${p}--transform-absolute`}`};let X=class extends d{render(){const{info:t}=this,{visibleElements:e}=t.tooltipOptions,i=this._messagesTooltip.sketch;return s(f,{className:we.base,helpMessage:this._getHelpMessage()},e.orientation&&t.orientation!=null?s(u,{key:"orientation",title:i.orientation,value:lt(t.orientation,t.rotationType,t.orientationPrecision)}):null,e.size&&t.size!=null?s(u,{key:"size",title:i.size,value:this._formatLength(t.size,t.sizeUnit,t.sizePrecision)}):null)}};X=a([v("esri.views.interactive.tooltip.content.TooltipContentTransformAbsolute")],X);const xe={base:`${p} ${`${p}--transform-rotate`}`};let Y=class extends d{render(){const{info:t}=this,{visibleElements:e}=t.tooltipOptions,i=this._messagesTooltip.sketch;return s(f,{className:xe.base,helpMessage:this._getHelpMessage()},e.rotation&&t.rotation!=null?s(u,{key:"rotation",title:i.rotation,value:Yt(t.rotation,t.rotationType,t.rotationPrecision)}):null,e.orientation&&t.orientation!=null?s(u,{key:"orientation",title:i.orientation,value:lt(t.orientation,t.rotationType,t.orientationPrecision)}):null)}};Y=a([v("esri.views.interactive.tooltip.content.TooltipContentTransformRotate")],Y);const ke={base:`${p} ${`${p}--transform-scale`}`};let J=class extends d{render(){const{info:t}=this,{visibleElements:e}=t.tooltipOptions,i=this._messagesTooltip.sketch;return s(f,{className:ke.base,helpMessage:this._getHelpMessage()},e.scale&&t.scale!=null?s(u,{key:"scale",title:i.scale,value:this._formatPercentage(t.scale)}):null,e.size&&t.size!=null?s(u,{key:"size",title:i.size,value:this._formatLength(t.size,t.sizeUnit,t.sizePrecision)}):null)}};J=a([v("esri.views.interactive.tooltip.content.TooltipContentTransformScale")],J);const Te={base:`${p} ${`${p}--translate-graphic`}`};let tt=class extends d{render(){const{info:t}=this,{visibleElements:e}=t.tooltipOptions,i=this._messagesTooltip.sketch;return s(f,{className:Te.base,helpMessage:this._getHelpMessage()},e.distance?s(u,{title:i.distance,value:this._formatLength(t.distance)}):null)}};tt=a([v("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphic")],tt);const Me={base:`${p} ${`${p}--translate-graphic-xy`}`};let et=class extends d{render(){const{info:t}=this,{visibleElements:e}=t.tooltipOptions,i=this._messagesTooltip.sketch;return s(f,{className:Me.base,helpMessage:this._getHelpMessage()},e.distance?s(u,{title:i.distance,value:this._formatRelativeLength(t.distance)}):null)}};et=a([v("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphicXY")],et);const Le={base:`${p} ${`${p}--translate-graphic-z`}`};let nt=class extends d{render(){const{info:n}=this,{visibleElements:t}=n.tooltipOptions,e=this._messagesTooltip.sketch;return s(f,{className:Le.base,helpMessage:this._getHelpMessage()},t.distance?s(u,{title:e.distance,value:this._formatRelativeVerticalLength(n.distance)}):null)}};nt=a([v("esri.views.interactive.tooltip.content.TooltipContentTranslateGraphicZ")],nt);const Ce={base:`${p} ${`${p}--translate-vertex`}`};let it=class extends d{render(){const{distance:t,elevation:e,area:i,totalLength:o,tooltipOptions:l}=this.info,{visibleElements:r}=l,h=this._messagesTooltip.sketch;return s(f,{className:Ce.base,helpMessage:this._getHelpMessage()},r.distance?s(u,{title:h.distance,value:this._formatLength(t)}):null,r.elevation&&e!=null?s(u,{title:h.elevation,value:this._formatVerticalLength(e.actual)}):null,r.area&&i!=null?s(u,{title:h.area,value:this._formatArea(i)}):null,r.totalLength&&o!=null?s(u,{title:h.totalLength,value:this._formatLength(o)}):null)}};it=a([v("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],it);const Ee={base:`${p} ${`${p}--translate-vertex`}`};let st=class extends d{render(){const{area:n,distance:t,elevation:e,totalLength:i,tooltipOptions:o}=this.info,{visibleElements:l}=o,r=this._messagesTooltip.sketch;return s(f,{className:Ee.base,helpMessage:this._getHelpMessage()},l.distance?s(u,{title:r.distance,value:this._formatRelativeLength(t)}):null,l.elevation&&e!=null?s(u,{title:r.elevation,value:this._formatVerticalLength(e.actual)}):null,l.area&&n!=null?s(u,{title:r.area,value:this._formatArea(n)}):null,l.totalLength&&i!=null?s(u,{title:r.totalLength,value:this._formatLength(i)}):null)}};st=a([v("esri.views.interactive.tooltip.content.TooltipContentTranslateVertexXY")],st);const Ve={base:`${p} ${`${p}--translate-vertex`}`};let ot=class extends d{render(){const{distance:n,elevation:t,tooltipOptions:e}=this.info,{visibleElements:i}=e,o=this._messagesTooltip.sketch;return s(f,{className:Ve.base,helpMessage:this._getHelpMessage()},i.distance?s(u,{title:o.distance,value:this._formatRelativeVerticalLength(n)}):null,i.elevation&&t!=null?s(u,{title:o.elevation,value:this._formatVerticalLength(t.actual)}):null)}};ot=a([v("esri.views.interactive.tooltip.content.TooltipContentTranslateVertexZ")],ot);function De(n,t){if(t==null)return null;const e=document.createElement("div");switch(t.type){case"draw-point":return new q({tooltip:n,info:t,container:e});case"draw-polygon":return new K({tooltip:n,info:t,container:e});case"draw-polyline":return new Z({tooltip:n,info:t,container:e});case"draw-mesh":return new W({tooltip:n,info:t,container:e});case"draw-rectangle":return new G({tooltip:n,info:t,container:e});case"draw-circle":return new U({tooltip:n,info:t,container:e});case"extent-rotate":return new B({tooltip:n,info:t,container:e});case"extent-scale":return new j({tooltip:n,info:t,container:e});case"transform-absolute":return new X({tooltip:n,info:t,container:e});case"transform-rotate":return new Y({tooltip:n,info:t,container:e});case"transform-scale":return new J({tooltip:n,info:t,container:e});case"translate-graphic":return new tt({tooltip:n,info:t,container:e});case"translate-graphic-z":return new nt({tooltip:n,info:t,container:e});case"translate-graphic-xy":return new et({tooltip:n,info:t,container:e});case"translate-vertex":return new it({tooltip:n,info:t,container:e});case"translate-vertex-z":return new ot({tooltip:n,info:t,container:e});case"translate-vertex-xy":return new st({tooltip:n,info:t,container:e});case"reshape-edge-offset":return new Q({tooltip:n,info:t,container:e})}}const Oe={base:`${k}`};let M=class extends Kt{constructor(n){super(n),this.info=null,this.positionMode="follow-cursor",this._contentContainer=(()=>{const t=document.createElement("div");return t.classList.add(Oe.base),Zt(t),t})(),this._contentWidget=null}initialize(){const n=this._contentContainer;this.addHandles([N(()=>{var t;return(t=this.view.overlay)==null?void 0:t.surface},t=>{n.remove(),t==null||t.appendChild(n)},H),N(()=>this.info,(t,e)=>{if(this._contentWidget!=null&&t!=null&&e!=null&&t.type===e.type)this._contentWidget.info=t;else{this._contentWidget=ft(this._contentWidget);const i=De(this,t);i&&(this._contentWidget=i,i.container&&n.appendChild(i.container))}},H),N(()=>({container:this._contentContainer,contentWidget:this._contentWidget,screenPoint:this._screenPoint,positionMode:this.positionMode}),ze,H)])}destroy(){this._contentWidget=ft(this._contentWidget),this._contentContainer.remove()}clear(){this.info=null}get _screenPoint(){const n=this.view.inputManager;return n!=null&&n.multiTouchActive?null:n==null?void 0:n.latestPointerLocation}get test(){var n;return{contentContainer:this._contentContainer,visible:((n=this._contentContainer)==null?void 0:n.style.display)!=="none"}}};function ze({container:n,contentWidget:t,screenPoint:e,positionMode:i}){const{style:o}=n;if(i==="docked")return o.display="block",void(o.transform="none");if(i!=="fixed")if(e!=null&&t!=null){o.display="block";const l=Gt(n),r=`translate(${Math.round(e.x)+$t[0]*(l?-1:1)}px, ${Math.round(e.y)+$t[1]}px)`;o.transform=l?`translate(-100%, 0) ${r}`:r}else o.display="none"}a([c({nonNullable:!0})],M.prototype,"view",void 0),a([c()],M.prototype,"info",void 0),a([c()],M.prototype,"positionMode",void 0),a([c()],M.prototype,"_contentContainer",void 0),a([c()],M.prototype,"_contentWidget",void 0),a([c()],M.prototype,"_screenPoint",null),M=a([v("esri.views.interactive.tooltip.Tooltip")],M);const $t=[20,20];export{He as a,ct as b,Pe as c,Ae as d,Ue as g,Se as l,We as m,Ne as p,kt as r,w as s,M as u}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/calcite-button-tOn16zeN.js","assets/button-dkwNndhL.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/form-2Iq0hI3D.js","assets/interactive-NKzPUNL4.js","assets/label2-d2vWQ7x7.js","assets/loadable-sxY2K1G3.js","assets/locale-pfkq1d6A.js","assets/key-qdHumIlA.js","assets/observers-JyBmMU24.js","assets/component-dtiBfYiX.js","assets/t9n-od6MEnI1.js","assets/icon-ZwpY5ksA.js","assets/loader-QqciGs1c.js","assets/guid-6vN-YNJI.js","assets/calcite-icon-itD416se.js","assets/calcite-input-V4_hyPVg.js","assets/input-9jE7tcJD.js","assets/progress-puB9lhY4.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/Tooltip-lrFZgXdG.js b/dist/assets/Tooltip-lrFZgXdG.js new file mode 100644 index 0000000..ea4534e --- /dev/null +++ b/dist/assets/Tooltip-lrFZgXdG.js @@ -0,0 +1 @@ +import{W as M,Q as N,p as u,b as E,e as F,c as x,v as L,H as X,Z as j,K as B}from"./Theme-QNc_77AM.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let l=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,c=(l-T)*(i-_)-(o-_)*(t-T),n=(l-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),c>0&&n>0){let r=Math.round(u(l,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(r-a,0),s.lineTo(l,o),s.lineTo(r+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),c>0&&n<0){let r=Math.round(u(o,e+a,i-a-e));l=u(l,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(r-a,e)),s.lineTo(l,o),s.lineTo(t,r+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),c<0&&n<0){let r=Math.round(u(l,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(r+a,i),s.lineTo(l,o),s.lineTo(r-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),c<0&&n>0){let r=Math.round(u(o,e+a,i-e-a));l=u(l,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,r+a),s.lineTo(l,o),s.lineTo(0,Math.max(r-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,l=[]){super(t,i,e,l),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this.set("background",D.new(this._root,{themeTags:["tooltip","background"]})),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(x(t,"pointerover",i=>{this._htmlContentHovered=!0}),x(t,"pointerout",i=>{this._htmlContentHovered=!1}))})),this._root._tooltips.push(this)}get label(){return this._label}dispose(){super.dispose(),L(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new X([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const l=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:l.event,point:l.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,l;t&&i&&(e=t.get("fill"),l=t.get("stroke"),e==null&&(e=l),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,l=this.get("centerX");l instanceof B&&(i=l.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,c=0;if(_){f=_.x(),c=_.y();const d=_.get("layerMargin");d&&(f+=d.left||0,c+=d.top||0,a+=(d.left||0)+(d.right||0),T+=(d.top||0)+(d.bottom||0))}const n=this.get("bounds",{left:-f,top:-c,right:a-f,bottom:T-c});this._updateBounds();let s=this.width(),r=this.height();s===0&&(s=this._w),r===0&&(r=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,v=this.get("pointerOrientation"),b=this.get("background"),g=0,m=0,y=0;b instanceof D&&(g=b.get("pointerLength",0),m=b.get("strokeWidth",0)/2,y=m,b.set("width",s),b.set("height",r));let C=0,O=0,H=n.right-n.left,W=n.bottom-n.top;v=="horizontal"||v=="left"||v=="right"?(m=0,v=="horizontal"?h>n.left+H/2?(h-=s*(1-i)+g,y*=-1):h+=s*i+g:v=="left"?h+=s*(1-i)+g:(h-=s*i+g,y*=-1)):(y=0,v=="vertical"?p>n.top+r/2+g?p-=r*(1-e)+g:(p+=r*e+g,m*=-1):v=="down"?p-=r*(1-e)+g:(p+=r*e+g,m*=-1)),h=u(h,n.left+s*i,n.left+H-s*(1-i))+y,p=u(p,n.top+r*e,n.top+W-r*(1-e))-m,C=k.x-h+s*i+y,O=k.y-p+r*e-m,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const d=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:d}),this.animate({key:"y",to:p,duration:w,easing:d})}else this.set("x",h),this.set("y",p);b instanceof D&&(b.set("pointerX",C),b.set("pointerY",O)),s>0&&(this._w=s),r>0&&(this._h=r)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as u}; diff --git a/dist/assets/TopFeaturesQuery-E6D2tV-x.js b/dist/assets/TopFeaturesQuery-E6D2tV-x.js new file mode 100644 index 0000000..c2f9cfe --- /dev/null +++ b/dist/assets/TopFeaturesQuery-E6D2tV-x.js @@ -0,0 +1 @@ +import{e as t,y as i,c as u,dr as y,dp as h,dx as c,dy as v,ar as m,du as p,ev as w,iy as S,bI as R}from"./index-J0iiHjMT.js";var s;let o=s=class extends y{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};t([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),t([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),t([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=t([u("esri.rest.support.TopFilter")],o);const j=o;var n;const a=new h({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new h({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=n=class extends y{constructor(r){super(r),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(R({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};t([i({type:Boolean,json:{write:!0}})],e.prototype,"cacheHint",void 0),t([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],e.prototype,"distance",void 0),t([i({types:c,json:{read:v,write:!0}})],e.prototype,"geometry",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],e.prototype,"maxAllowableOffset",void 0),t([i({type:Number,json:{read:{source:"resultRecordCount"}}})],e.prototype,"num",void 0),t([i({json:{write:!0}})],e.prototype,"objectIds",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"orderByFields",void 0),t([i({type:[String],json:{write:!0}})],e.prototype,"outFields",void 0),t([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],e.prototype,"outSpatialReference",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"resultType",void 0),t([i({json:{write:!0}})],e.prototype,"returnGeometry",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnM",void 0),t([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],e.prototype,"returnZ",void 0),t([i({type:Number,json:{read:{source:"resultOffset"}}})],e.prototype,"start",void 0),t([p("start"),p("num")],e.prototype,"writeStart",null),t([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],e.prototype,"spatialRelationship",void 0),t([i({type:w,json:{write:!0}})],e.prototype,"timeExtent",void 0),t([i({type:j,json:{write:!0}})],e.prototype,"topFilter",void 0),t([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],e.prototype,"units",void 0),t([i({type:String,json:{write:!0}})],e.prototype,"where",void 0),e=n=t([u("esri.rest.support.TopFeaturesQuery")],e),e.from=S(e);const g=e;export{g as S}; diff --git a/dist/assets/TranslateTooltipInfos-J6BygtUO.js b/dist/assets/TranslateTooltipInfos-J6BygtUO.js new file mode 100644 index 0000000..29ff4d5 --- /dev/null +++ b/dist/assets/TranslateTooltipInfos-J6BygtUO.js @@ -0,0 +1 @@ +import{e as t,I as o,y as e,c as r}from"./index-J0iiHjMT.js";import{s as l}from"./Tooltip-ON77BKb3.js";let p=class extends l{constructor(i){super(i),this.type="translate-graphic",this.distance=o}clear(){this.distance=o}};t([e()],p.prototype,"type",void 0),t([e()],p.prototype,"distance",void 0),p=t([r("esri.views.interactive.tooltip.TranslateGraphicTooltipInfo")],p);let c=class extends l{constructor(i){super(i),this.type="translate-graphic-z",this.distance=o}clear(){this.distance=o}};t([e()],c.prototype,"type",void 0),t([e()],c.prototype,"distance",void 0),c=t([r("esri.views.interactive.tooltip.TranslateGraphicZTooltipInfo")],c);let h=class extends l{constructor(i){super(i),this.type="translate-graphic-xy",this.distance=o}};t([e()],h.prototype,"type",void 0),t([e()],h.prototype,"distance",void 0),h=t([r("esri.views.interactive.tooltip.TranslateGraphicXYTooltipInfo")],h);let s=class extends l{constructor(i){super(i),this.type="translate-vertex",this.distance=o,this.elevation=null,this.area=null,this.totalLength=null}clear(){this.distance=o,this.elevation=null,this.area=null,this.totalLength=null}};t([e()],s.prototype,"type",void 0),t([e()],s.prototype,"distance",void 0),t([e()],s.prototype,"elevation",void 0),t([e()],s.prototype,"area",void 0),t([e()],s.prototype,"totalLength",void 0),s=t([r("esri.views.interactive.tooltip.TranslateVertexTooltipInfo")],s);let n=class extends l{constructor(i){super(i),this.type="translate-vertex-z",this.distance=o,this.elevation=null}clear(){this.distance=o,this.elevation=null}};t([e()],n.prototype,"type",void 0),t([e()],n.prototype,"distance",void 0),t([e()],n.prototype,"elevation",void 0),n=t([r("esri.views.interactive.tooltip.TranslateVertexZTooltipInfo")],n);let a=class extends l{constructor(i){super(i),this.type="translate-vertex-xy",this.distance=o,this.elevation=null,this.area=null,this.totalLength=null}clear(){this.distance=o,this.elevation=null,this.area=null,this.totalLength=null}};t([e()],a.prototype,"type",void 0),t([e()],a.prototype,"distance",void 0),t([e()],a.prototype,"elevation",void 0),t([e()],a.prototype,"area",void 0),t([e()],a.prototype,"totalLength",void 0),a=t([r("esri.views.interactive.tooltip.TranslateVertexXYTooltipInfo")],a);export{c as a,a as c,h as l,n,s as p,p as r}; diff --git a/dist/assets/TurboLine-SWK4qRwh.js b/dist/assets/TurboLine-SWK4qRwh.js new file mode 100644 index 0000000..476ba2a --- /dev/null +++ b/dist/assets/TurboLine-SWK4qRwh.js @@ -0,0 +1,7 @@ +import{dJ as bt,de as wt,kj as kt,kk as $,kl as D}from"./index-J0iiHjMT.js";import{$ as Rt}from"./definitions-DqQMJYPH.js";const pt=128e3;let ut=null,mt=null;async function At(){return ut||(ut=Mt()),ut}async function Mt(){mt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-MMunuWgb.js"),__vite__mapDeps([0,1,2])).then(i=>i.l):await wt(()=>import("./libtess-R_Me7Q5k.js"),__vite__mapDeps([3,1,2])).then(i=>i.l)).load({locateFile:i=>kt(`esri/core/libs/libtess/${i}`)})}function Ot(r,i){const x=Math.max(r.length,pt);return mt.triangulate(r,i,x)}function Vt(r,i){return r.x===i.x&&r.y===i.y}function Ut(r){if(!r)return;const i=r.length;if(i<=1)return;let x=0;for(let g=1;gg){I=!0;const t=(g-N)/w;w=g-N,W=(1-t)*C+t*W,X=(1-t)*F+t*X,--j}const o=this._writeVertex(C,F,0,0,b,v,v,-b,0,-1,N),y=this._writeVertex(C,F,0,0,b,v,-v,b,0,1,N);N+=w;const J=this._writeVertex(W,X,0,0,b,v,v,-b,0,-1,N),e=this._writeVertex(W,X,0,0,b,v,-v,b,0,1,N);this._writeTriangle(o,y,J),this._writeTriangle(y,J,e),C=W,F=X}}_tessellate(i,x){const g=i[0],N=i[i.length-1],I=Vt(g,N),C=I?3:2;if(i.length{const O=Et(o,y,_,c,G,m,R,st,L,A,h);return d>=0&&l>=0&&O>=0&&Nt(d,l,O),d=l,l=O,O};I&&(w=i[i.length-2],t.x=N.x-w.x,t.y=N.y-w.y,Q=ft(t),t.x/=Q,t.y/=Q);let Y=!1;for(let R=0;R_t&&(Y=!0)),Y){const n=(_t-h)/K;K=_t-h,w={x:(1-n)*w.x+n*i[R].x,y:(1-n)*w.y+n*i[R].y},--R}else w=i[R];o=w.x,y=w.y;const st=R<=0&&!Y,G=R===i.length-1;if(st||(h+=K),J=G?I?i[1]:null:i[R+1],J?(t.x=J.x-o,t.y=J.y-y,Q=ft(t),t.x/=Q,t.y/=Q):(t.x=void 0,t.y=void 0),!I){if(st){k(s,t),_=s.x,c=s.y,B===$.SQUARE&&(u(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),u(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===$.ROUND&&(u(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),u(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==$.ROUND&&B!==$.BUTT||(u(-t.y,t.x,t.x,t.y,0,-1),u(t.y,-t.x,t.x,t.y,0,1));continue}if(G){U(s,e),_=s.x,c=s.y,B!==$.ROUND&&B!==$.BUTT||(u(e.y,-e.x,-e.x,-e.y,0,-1),u(-e.y,e.x,-e.x,-e.y,0,1)),B===$.SQUARE&&(u(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),u(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===$.ROUND&&(u(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),u(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let m,L,A=-Bt(e,t);if(Math.abs(A)<.01)gt(e,t)>0?(s.x=e.x,s.y=e.y,A=1,m=Number.MAX_VALUE,L=!0):(k(s,t),A=1,m=1,L=!1);else{s.x=(e.x+t.x)/A,s.y=(e.y+t.y)/A,m=ft(s);const n=(m-1)*b*F;L=m>4||n>K&&n>Q}_=s.x,c=s.y;let O=j;switch(j){case D.BEVEL:m<1.05&&(O=D.MITER);break;case D.ROUND:mW&&(O=D.BEVEL)}switch(O){case D.MITER:if(u(s.x,s.y,-e.x,-e.y,0,-1),u(-s.x,-s.y,-e.x,-e.y,0,1),G)break;if(v){const n=Y?0:h;d=this._writeVertex(o,y,_,c,t.x,t.y,s.x,s.y,0,-1,n),l=this._writeVertex(o,y,_,c,t.x,t.y,-s.x,-s.y,0,1,n)}break;case D.BEVEL:{const n=A<0;let T,V,q,p;if(n){const a=d;d=l,l=a,T=xt,V=nt}else T=nt,V=xt;if(L)q=n?k(this._innerPrev,e):U(this._innerPrev,e),p=n?U(this._innerNext,t):k(this._innerNext,t);else{const a=n?vt(this._inner,s):Tt(this._inner,s);q=a,p=a}const M=n?U(this._bevelStart,e):k(this._bevelStart,e);u(q.x,q.y,-e.x,-e.y,T.x,T.y);const yt=u(M.x,M.y,-e.x,-e.y,V.x,V.y);if(G)break;const P=n?k(this._bevelEnd,t):U(this._bevelEnd,t);if(L){const a=this._writeVertex(o,y,_,c,-e.x,-e.y,0,0,0,0,h);d=this._writeVertex(o,y,_,c,t.x,t.y,p.x,p.y,T.x,T.y,h),l=this._writeVertex(o,y,_,c,t.x,t.y,P.x,P.y,V.x,V.y,h),this._writeTriangle(yt,a,l)}else{if(v){const a=this._bevelMiddle;a.x=(M.x+P.x)/2,a.y=(M.y+P.y)/2,et(f,a,-e.x,-e.y),u(a.x,a.y,-e.x,-e.y,f.x,f.y),et(f,a,t.x,t.y),d=this._writeVertex(o,y,_,c,t.x,t.y,a.x,a.y,f.x,f.y,h),l=this._writeVertex(o,y,_,c,t.x,t.y,p.x,p.y,T.x,T.y,h)}else{const a=d;d=l,l=a}u(P.x,P.y,t.x,t.y,V.x,V.y)}if(n){const a=d;d=l,l=a}break}case D.ROUND:{const n=A<0;let T,V;if(n){const E=d;d=l,l=E,T=xt,V=nt}else T=nt,V=xt;const q=n?vt(this._inner,s):Tt(this._inner,s);let p,M;L?(p=n?k(this._innerPrev,e):U(this._innerPrev,e),M=n?U(this._innerNext,t):k(this._innerNext,t)):(p=q,M=q);const yt=n?U(this._roundStart,e):k(this._roundStart,e),P=n?k(this._roundEnd,t):U(this._roundEnd,t),a=u(p.x,p.y,-e.x,-e.y,T.x,T.y),ot=u(yt.x,yt.y,-e.x,-e.y,V.x,V.y);if(G)break;const z=this._writeVertex(o,y,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(d,l,z);const S=vt(this._outer,q),H=this._writeVertex(o,y,_,c,t.x,t.y,P.x,P.y,V.x,V.y,h);let Z,tt;const lt=m>2;if(lt){let E;m!==Number.MAX_VALUE?(S.x/=m,S.y/=m,E=gt(e,S),E=(m*(E*E-1)+1)/E):E=-1,Z=n?U(this._startBreak,e):k(this._startBreak,e),Z.x+=e.x*E,Z.y+=e.y*E,tt=n?k(this._endBreak,t):U(this._endBreak,t),tt.x+=t.x*E,tt.y+=t.y*E}et(f,S,-e.x,-e.y);const ht=this._writeVertex(o,y,_,c,-e.x,-e.y,S.x,S.y,f.x,f.y,h);et(f,S,t.x,t.y);const ct=v?this._writeVertex(o,y,_,c,t.x,t.y,S.x,S.y,f.x,f.y,h):ht,dt=z,at=v?this._writeVertex(o,y,_,c,t.x,t.y,0,0,0,0,h):z;let it=-1,rt=-1;if(lt&&(et(f,Z,-e.x,-e.y),it=this._writeVertex(o,y,_,c,-e.x,-e.y,Z.x,Z.y,f.x,f.y,h),et(f,tt,t.x,t.y),rt=this._writeVertex(o,y,_,c,t.x,t.y,tt.x,tt.y,f.x,f.y,h)),v?lt?(this._writeTriangle(dt,ot,it),this._writeTriangle(dt,it,ht),this._writeTriangle(at,ct,rt),this._writeTriangle(at,rt,H)):(this._writeTriangle(dt,ot,ht),this._writeTriangle(at,ct,H)):lt?(this._writeTriangle(z,ot,it),this._writeTriangle(z,it,rt),this._writeTriangle(z,rt,H)):(this._writeTriangle(z,ot,ht),this._writeTriangle(z,ct,H)),L?(d=this._writeVertex(o,y,_,c,t.x,t.y,M.x,M.y,T.x,T.y,h),l=H):(d=v?this._writeVertex(o,y,_,c,t.x,t.y,M.x,M.y,T.x,T.y,h):a,this._writeTriangle(d,at,H),l=H),n){const E=d;d=l,l=E}break}}}}}export{Pt as c,At as i,Ot as r}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/libtess-asm-MMunuWgb.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/libtess-R_Me7Q5k.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/UnitNormalizer-19C91v_m.js b/dist/assets/UnitNormalizer-19C91v_m.js new file mode 100644 index 0000000..452049f --- /dev/null +++ b/dist/assets/UnitNormalizer-19C91v_m.js @@ -0,0 +1 @@ +import{as as l,at as o,au as h,a0 as _,hJ as p,j_ as i,e2 as s}from"./index-J0iiHjMT.js";function R(t,e){if(l(e,0,0,0),t.length>0){for(let r=0;r{l(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unknown layer type";n&&(a+=" "+n),o(new d("layer:unknown-layer-type",a,{layerType:n}))})}))}read(r,o){super.read({resourceInfo:r},o)}write(r,o){return null}};s([t({readOnly:!0})],e.prototype,"resourceInfo",void 0),s([t({type:["show","hide"]})],e.prototype,"listMode",void 0),s([t({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=s([p("esri.layers.UnknownLayer")],e);const f=e;export{f as default}; diff --git a/dist/assets/UnsupportedLayer-s0OShVnj.js b/dist/assets/UnsupportedLayer-s0OShVnj.js new file mode 100644 index 0000000..846ce96 --- /dev/null +++ b/dist/assets/UnsupportedLayer-s0OShVnj.js @@ -0,0 +1 @@ +import{dN as p,dP as a,f7 as d,e as r,y as i,c as l,c7 as u,E as y}from"./index-J0iiHjMT.js";let t=class extends p(a(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,o)=>{d(()=>{const s=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unsupported layer type";s&&(n+=" "+s),o(new y("layer:unsupported-layer-type",n,{layerType:s}))})}))}read(e,o){const s={resourceInfo:e};e.id!=null&&(s.id=e.id),e.title!=null&&(s.title=e.title),super.read(s,o)}write(e,o){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};r([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),r([i({type:["show","hide"]})],t.prototype,"listMode",void 0),r([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),r([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=r([l("esri.layers.UnsupportedLayer")],t);const h=t;export{h as default}; diff --git a/dist/assets/VectorTileLayer-0SVRfneU.js b/dist/assets/VectorTileLayer-0SVRfneU.js new file mode 100644 index 0000000..e824eaf --- /dev/null +++ b/dist/assets/VectorTileLayer-0SVRfneU.js @@ -0,0 +1 @@ +import{Z,E as I,gm as H,p9 as ee,bV as w,f3 as te,bW as x,s as V,pa as Q,n as re,f as ie,l5 as S,ld as se,fZ as le,g as oe,bI as g,p3 as F,h6 as P,e$ as R,pb as W,dT as U,j8 as K,pc as J,j9 as z,pd as ae,pe as G,pf as E,eV as D,pg as L,T as ne,f0 as ue,dK as pe,dO as ce,f1 as he,em as ye,dM as de,dN as fe,en as me,dP as ge,dQ as $,ph as Ae,pi as Se,jY as M,b as xe,e as c,y,ar as we,du as ve,dt as N,c as _e,c7 as be}from"./index-J0iiHjMT.js";import{o as Ie}from"./CustomParametersMixin-Y1bOcayO.js";import{e as Ue}from"./jsonContext-cWV_-jAj.js";import{l as Re}from"./StyleRepository-UhXfhILC.js";import"./TileClipper-NSFZXMR1.js";import"./definitions-DqQMJYPH.js";let _=null;function $e(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const B=1.15;class C{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>B;const{width:r,height:i,data:s,json:o}=await this._getSpriteData(this._spriteSource,t),l=Object.keys(o);if(!l||l.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=o,this.width=r,this.height=i;const n=Math.max(this._maxTextureSize,4096);if(r>n||i>n){const u=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw Z.getLogger("esri.layers.support.SpriteSource").error(u),new I("SpriteSource",u)}let a;for(let u=0;ut.data.index)),this._tileIndexPromise}async dataKey(t,r){const i=await this.fetchTileIndex();return V(r),this._getIndexedDataKey(i,t)}_getIndexedDataKey(t,r){const i=[r];if(r.level<0||r.row<0||r.col<0||r.row>>r.level>0||r.col>>r.level>0)return null;let s=r;for(;s.level!==0;)s=new Q(s.level-1,s.row>>1,s.col>>1,s.world),i.push(s);let o,l,n=t,a=i.pop();if(n===1)return a;for(;i.length;)if(o=i.pop(),l=(1&o.col)+((1&o.row)<<1),n){if(n[l]===0){a=null;break}if(n[l]===1){a=o;break}a=o,n=n[l]}return a}},Pe=class{constructor(t,r){this._tilemap=t,this._tileIndexUrl=r}destroy(){this._tilemap=re(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=x(this._tileIndexUrl,{query:{...t==null?void 0:t.query}}).then(r=>r.data.index)),this._tileIndexPromise}dataKey(t,r){const{level:i,row:s,col:o}=t,l=new Q(t);return this._tilemap.fetchAvailabilityUpsample(i,s,o,l,r).then(()=>(l.world=t.world,l)).catch(n=>{if(ie(n))throw n;return null})}};class Oe{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){this._promise===null&&(this._abortController=new AbortController,this._promise=this._makeRequest(this._tileUrl,this._abortController.signal));const r=this._abortOptions;return r.push(t),le(t,()=>{r.every(i=>oe(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t,r){const{data:i}=await x(t,{responseType:"array-buffer",signal:r});return i}}const T=new Map;function je(e,t,r,i,s){const o=w(e),l=o.query;if(l)for(const[a,u]of Object.entries(l))switch(u){case"{x}":l[a]=i.toString();break;case"{y}":l[a]=r.toString();break;case"{z}":l[a]=t.toString()}const n=o.path;return Ee(S(n.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...o.query}),s)}function Ee(e,t){return se(T,e,()=>new Oe(e)).getData(t).then(r=>(T.delete(e),r)).catch(r=>{throw T.delete(e),r})}class De{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=w(this.sourceUrl),o=g(i),l=o.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),a=(i==null?void 0:i.exportTilesAllowed)===!0,u=(n==null?void 0:n.includes("tilemap"))===!0,h=a&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:a,supportsTileMap:u},exportTiles:a?{maxExportTilesCount:+h}:null},this.tileInfo=R.fromJSON(o.tileInfo);const d=i.tileMap?S(P(s.path,i.tileMap),s.query??{}):null;u?(this.type="vector-tile",this.tilemap=new Pe(new W({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:o.minLOD??this.tileInfo.lods[0].level,maxLOD:o.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Te(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){var t;(t=this.tilemap)==null||t.destroy()}async getRefKey(t,r){var i;return await((i=this.tilemap)==null?void 0:i.dataKey(t,r))??t}requestTile(t,r,i,s){const o=this.tileServers[r%this.tileServers.length];return je(o,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,o=i.lods,l=Math.min(s.length,o.length);for(let n=0;n=b||Math.abs(r.y-i.y)>=b)return!1;let s,o;e.lods[0].scale>t.lods[0].scale?(s=e,o=t):(o=e,s=t);for(let l=s.lods[0].scale;l>=o.lods[o.lods.length-1].scale-b;l/=2)if(Math.abs(l-o.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],a=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],u=n.scale,h=n.resolution,d=a.scale,f=[];let m=u,O=h,j=0;for(;m>d;)f.push(new ue({level:j,resolution:O,scale:m})),j++,m/=2,O/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:o,lods:f,spatialReference:l})}let p=class extends pe(ce(he(ye(de(fe(Ie(me(ge(be))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=null,this.path=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){var e;if(this.sourceNameToSource)for(const t of Object.values(this.sourceNameToSource))t==null||t.destroy();(e=this.primarySource)==null||e.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch($).then(async()=>{var i;if(!((i=this.portalItem)!=null&&i.id))return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await x(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Ue(this.portalItem))}).catch($).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=(e==null?void 0:e.serviceUrl)&&w(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return((e=this.primarySource)==null?void 0:e.fullExtent)||null}get initialExtent(){var e;return((e=this.primarySource)==null?void 0:e.initialExtent)||null}get parsedUrl(){return this.serviceUrl?w(this.serviceUrl):null}get serviceUrl(){var e;return((e=this.currentStyleInfo)==null?void 0:e.serviceUrl)||null}get spatialReference(){var e;return((e=this.tileInfo)==null?void 0:e.spatialReference)??null}get styleUrl(){var e;return((e=this.currentStyleInfo)==null?void 0:e.styleUrl)||null}writeStyleUrl(e,t){e&&K(e)&&(e=`https:${e}`);const r=Ae(e);t.styleUrl=Se(e,r)}get tileInfo(){var r;const e=[];for(const i in this.sourceNameToSource)e.push(this.sourceNameToSource[i]);let t=((r=this.primarySource)==null?void 0:r.tileInfo)||new R;if(e.length>1)for(let i=0;i(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:s})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){var t;return g((t=this.styleRepository)==null?void 0:t.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return g(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return t!=null&&t.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Le(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await $e("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new Re(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const o of r)if(o.toLowerCase().includes(i))return z(`//static.arcgis.com/attribution/Vector${s}/${o}`)}async _loadStyle(e){var t;return((t=this._loadingTask)==null?void 0:t.promise)??this.loadStyle(null,e)}};c([y({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([y({type:["show","hide"]})],p.prototype,"listMode",void 0),c([y({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([y({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([y({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([y({json:{read:!1},readOnly:!0,type:U})],p.prototype,"fullExtent",null),c([y({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),c([y({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([y({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([y({readOnly:!0})],p.prototype,"parsedUrl",null),c([y()],p.prototype,"style",void 0),c([y({readOnly:!0})],p.prototype,"serviceUrl",null),c([y({type:we,readOnly:!0})],p.prototype,"spatialReference",null),c([y({readOnly:!0})],p.prototype,"styleRepository",void 0),c([y({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([y({readOnly:!0})],p.prototype,"primarySource",void 0),c([y({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([ve(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([y({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([y()],p.prototype,"tilemapCache",void 0),c([N("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",null),c([y({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([y({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([y({readOnly:!0})],p.prototype,"version",void 0),c([N("version",["version","currentVersion"])],p.prototype,"readVersion",null),c([y({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),p=c([_e("esri.layers.VectorTileLayer")],p);const Ge=p;export{Ge as default}; diff --git a/dist/assets/VectorTileLayerView3D-eexSRj3E.js b/dist/assets/VectorTileLayerView3D-eexSRj3E.js new file mode 100644 index 0000000..724c208 --- /dev/null +++ b/dist/assets/VectorTileLayerView3D-eexSRj3E.js @@ -0,0 +1,555 @@ +import{uB as Le,uC as He,fA as Ue,uD as Ae,bW as We,a as ze,l5 as he,g1 as Be,nW as Ge,dQ as Je,pa as ee,f as Ke,uE as ke,uF as Ye,uG as Xe,u3 as le,sr as U,uH as Y,uI as ce,uJ as de,uK as je,uL as ae,uM as Qe,uN as Ze,e$ as et,s as tt,ae as it,uO as nt,tn as st,uP as ot,uQ as at,uR as X,fW as fe,lZ as V,uS as F,uT as rt,uU as lt,uV as ct,qE as H,uW as ut,uX as ht,so as A,s6 as Oe,sp as K,uY as oe,dJ as _e,E as dt,uZ as ft,u_ as _t,w as mt,d as pt,A as gt,g as yt,n as me,e as q,y as B,c as vt}from"./index-J0iiHjMT.js";import{t as $}from"./Rect-bBBxMtVp.js";import{r as xt}from"./pbf-o0zzptPp.js";import{e as wt}from"./rasterizingUtils-6P0UGdzr.js";import{r as bt}from"./vec4f32-NvfHy9q7.js";import{e as k,t as Ne,r as pe}from"./definitions-DqQMJYPH.js";import{T as W}from"./enums-uQoFEhYh.js";import{M as ne}from"./number-sTjsTbdA.js";import{c as ge}from"./GeometryUtils-K2DOc0l8.js";import{l as ye}from"./StyleRepository-UhXfhILC.js";import{n as St}from"./LayerView3D-iOx2MD1g.js";import{o as Tt}from"./TiledLayerView3D-Av58zTxG.js";import{u as Pt}from"./LayerView-efDufa6j.js";import"./TileClipper-NSFZXMR1.js";let It=class{constructor(e,i,t){this._scale=e,this._shift=i,this._levelShift=t}getLevelRowColumn(e){const i=this.getLevelShift(e[0]),t=this._shift+i;return t?[e[0]-i,e[1]>>t,e[2]>>t]:e}getLevelShift(e){return Math.min(e,this._levelShift)}getOffset(e,i){let t=0,n=0;const s=this._shift+this.getLevelShift(e[0]);if(s){const o=(1<this._width||i>this._height)return new $;let t=null,n=-1;for(let s=0;se&&this._free.push(new $(t.x+e,t.y,t.width-e,i)),t.height>i&&this._free.push(new $(t.x,t.y+i,t.width,t.height-i))):(t.width>e&&this._free.push(new $(t.x+e,t.y,t.width-e,t.height)),t.height>i&&this._free.push(new $(t.x,t.y+i,e,t.height-i))),new $(t.x,t.y,e,i))}release(e){for(let i=0;i{const l=e+r;if(this._rangePromises.has(l))a.push(this._rangePromises.get(l));else{const h=n.getRange(e,r).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),a.push(h)}}),Promise.all(a).then(()=>{let r=this._glyphIndex[e];r||(r={},this._glyphIndex[e]=r);for(const l of i){const h=r[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const d=n.getGlyph(e,l);if(!(d!=null&&d.metrics))continue;const f=d.metrics;let c;if(f.width===0)c=new $(0,0,0,0);else{const m=f.width+6,_=f.height+2*3;let p=m%4?4-m%4:4,v=_%4?4-_%4:4;p===1&&(p=5),v===1&&(v=5),c=this._binPack.allocate(m+p,_+v),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new ie(this.width-4,this.height-4),c=this._binPack.allocate(m+p,_+v));const P=this._glyphData[this._currentPage],I=d.bitmap;let x,b;if(I)for(let w=0;w<_;w++){x=m*w,b=this.width*(c.y+w+1)+c.x;for(let y=0;y{t.addRange(i,new re(new xt(new Uint8Array(a.data),new DataView(a.data))))}).catch(()=>{t.addRange(i,new re)})}return t.addRange(i,new re),Promise.resolve()}getGlyph(e,i){const t=this._getFontStack(e);if(!t)return;const n=Math.floor(i/256),s=t.getRange(n);return s?{metrics:s.getMetrics(i),bitmap:s.getBitmap(i)}:void 0}_getFontStack(e){let i=this._glyphInfo[e];return i||(i=this._glyphInfo[e]=new Mt),i}},Rt=class{constructor(e,i,t){this._array=e,this._start=i,this.length=t}at(e){return 0<=e&&e0&&(this._maxItemSize=t),this._binPack=new ie(e-4,i-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new ie(this._pageWidth-4,this._pageHeight-4);const i=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),n=new Uint32Array(i*t);this._mosaicsData[0]=n,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,i=!1){let t,n,s=this._mosaicRects[e];if(s)return s;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(Dt)?([t,n]=this._rasterizeDash(e),i=!0):t=this._sprites.getSpriteInfo(e),!(t!=null&&t.width)||!t.height||t.width<0||t.height<0))return null;const o=t.width,a=t.height,[r,l,h]=this._allocateImage(o,a);return r.width<=0?null:(this._copy(r,t,l,h,i,n),s={rect:r,width:o,height:a,sdf:t.sdf,simplePattern:!1,pixelRatio:t.pixelRatio,page:l},this._mosaicRects[e]=s,s)}getSpriteItems(e){const i={};for(const t of e)i[t.name]=this.getSpriteItem(t.name,t.repeat);return i}getMosaicItemPosition(e,i){const t=this.getSpriteItem(e,i),n=t&&t.rect;if(!n)return null;n.width=t.width,n.height=t.height;const s=t.width,o=t.height,a=2;return{tl:[n.x+a,n.y+a],br:[n.x+a+s,n.y+a+o],page:t.page}}bind(e,i,t=0,n=0){if(t>=this._size.length||t>=this._mosaicsData.length)return;if(!this._textures[t]){const o=new Le;o.wrapMode=Ue.CLAMP_TO_EDGE,o.width=this._size[t][0],o.height=this._size[t][1],this._textures[t]=new Ae(e,o,new Uint8Array(this._mosaicsData[t].buffer))}const s=this._textures[t];s.setSamplingMode(i),this._dirties[t]&&s.setData(new Uint8Array(this._mosaicsData[t].buffer)),e.bindTexture(s,n),this._dirties[t]=!1}static _copyBits(e,i,t,n,s,o,a,r,l,h,d){let f=n*i+t,c=r*o+a;if(d){c-=o;for(let g=-1;g<=h;g++,f=((g+h)%h+n)*i+t,c+=o)for(let m=-1;m<=l;m++)s[c+m]=e[f+(m+l)%l]}else for(let g=0;g=this._mosaicsData.length)return;const a=new Uint32Array(o?o.buffer:this._sprites.image.buffer),r=this._mosaicsData[t];r&&a||console.error("Source or target images are uninitialized!");const l=2,h=o?i.width:this._sprites.width;$e._copyBits(a,h,i.x,i.y,r,n[0],e.x+l,e.y+l,i.width,i.height,s),this._dirties[t]=!0}_allocateImage(e,i){e+=2,i+=2;const t=Math.max(e,i);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._requestSprite(e);const i=this._layer.currentStyleInfo.glyphsUrl,t=new xe(i?he(i,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new ve(1024,1024,t),this._broadcastPromise=Be("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(n=>{var s;if(this._layer&&((s=this._connection)==null||s.close(),this._connection=n,this._layer&&!this._connection.closed)){const o=n.broadcast("setStyle",this._layer.currentStyleInfo.style,e);Promise.all(o).catch(a=>Ge(a))}})}_requestSprite(e){var o,a;(o=this._spriteSourceAbortController)==null||o.abort();const i=new AbortController;this._spriteSourceAbortController=i;const t=e==null?void 0:e.signal;this._inputSignalEventListener&&((a=this._startOptionsInputSignal)==null||a.removeEventListener("abort",this._inputSignalEventListener)),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Et(i),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:n}=i,s={...e,signal:n};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,s),this._spriteSourcePromise.then(r=>{Je(n),this._spriteMosaic=new we(1024,1024,250),this._spriteMosaic.setSpriteSource(r)})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const i=new we(1024,1024,250);return i.setSpriteSource(e),this._spriteMosaic=i,this._spriteSourcePromise=Promise.resolve(e),this._spriteSourceAbortController=null,i}async setStyle(e,i){await this._broadcastPromise,this._styleRepository=e,this._requestSprite();const t=new xe(this._layer.currentStyleInfo.glyphsUrl?he(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new ve(1024,1024,t),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",i)),this._broadcastPromise}fetchTileData(e,i){return this._getRefKeys(e,i).then(t=>{const n=this._layer.sourceNameToSource,s=[];for(const o in n)s.push(o);return this._getSourcesData(s,t,i)})}parseTileData(e,i){const t=e&&e.data;if(!t)return Promise.resolve(null);const{sourceName2DataAndRefKey:n,transferList:s}=t;return Object.keys(n).length===0?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:n,styleLayerUIDs:e.styleLayerUIDs},{...i,transferList:s}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,i,t){const n=ee.pool.acquire(e.id),s=this._layer.sourceNameToSource[i],{level:o,row:a,col:r}=n;ee.pool.release(n);try{return{protobuff:await s.requestTile(o,a,r,t),sourceName:i}}catch(l){if(Ke(l))throw l;return{protobuff:null,sourceName:i}}}_getRefKeys(e,i){const t=this._layer.sourceNameToSource,n=new Array;for(const s in t){const o=t[s].getRefKey(e,i);n.push(o)}return Promise.allSettled(n)}_getSourcesData(e,i,t){const n=[];for(let s=0;s{const o={},a=[];for(let r=0;ru.abort()}function Lt(u,e,i,t,n,s){const{iconRotationAlignment:o,textRotationAlignment:a,iconTranslate:r,iconTranslateAnchor:l,textTranslate:h,textTranslateAnchor:d}=t;let f=0;for(const c of u.colliders){const[g,m]=c.partIndex===0?r:h,_=c.partIndex===0?l:d,p=c.minLod<=s&&s<=c.maxLod;f+=p?0:1,c.enabled=p,c.xScreen=c.xTile*n[0]+c.yTile*n[3]+n[6],c.yScreen=c.xTile*n[1]+c.yTile*n[4]+n[7],_===Y.MAP?(c.xScreen+=i*g-e*m,c.yScreen+=e*g+i*m):(c.xScreen+=g,c.yScreen+=m),U.VIEWPORT===(c.partIndex===0?o:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=i*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+i*(c.dyPixels+c.height/2)-c.height/2)}u.colliders.length>0&&f===u.colliders.length&&(u.unique.show=!1)}let Ut=class{constructor(e,i,t,n,s,o){this._symbols=e,this._styleRepository=n,this._zoom=s,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new ke(i,t,Ye),this._si=Math.sin(Math.PI*o/180),this._co=Math.cos(Math.PI*o/180);for(const a of e)for(const r of a.symbols)this._allNeededMatrices.has(r.tile)||this._allNeededMatrices.set(r.tile,Xe(r.tile.transforms.tileUnitsToPixels))}work(e){const i=this._gridIndex;function t(s){const o=s.xScreen+s.dxScreen,a=s.yScreen+s.dyScreen,r=o+s.width,l=a+s.height,[h,d,f,c]=i.getCellSpan(o,a,r,l);for(let g=d;g<=c;g++)for(let m=h;m<=f;m++){const _=i.cells[g][m];for(const p of _){const v=p.xScreen+p.dxScreen,P=p.yScreen+p.dyScreen,I=v+p.width,x=P+p.height;if(!(rI||lx))return!0}}return!1}const n=performance.now();for(;this._currentLayerCursore)return!1;const a=s.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Lt(a,this._si,this._co,o,this._allNeededMatrices.get(a.tile),this._zoom);const r=a.unique;if(!r.show)continue;const{iconAllowOverlap:l,iconIgnorePlacement:h,textAllowOverlap:d,textIgnorePlacement:f}=o;for(const c of a.colliders){if(!c.enabled)continue;const g=r.parts[c.partIndex];g.show&&!(c.partIndex?d:l)&&t(c)&&(c.hard?r.show=!1:g.show=!1)}if(r.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?f:h)||!r.parts[c.partIndex].show)continue;const g=c.xScreen+c.dxScreen,m=c.yScreen+c.dyScreen,_=g+c.width,p=m+c.height,[v,P,I,x]=this._gridIndex.getCellSpan(g,m,_,p);for(let b=P;b<=x;b++)for(let w=v;w<=I;w++)this._gridIndex.cells[b][w].push(c)}}}return!0}_getProperties(e){const i=this._styleProps.get(e);if(i)return i;const t=this._zoom,n=this._styleRepository.getStyleLayerByUID(e),s=n.getLayoutValue("symbol-placement",t)!==le.POINT;let o=n.getLayoutValue("icon-rotation-alignment",t);o===U.AUTO&&(o=s?U.MAP:U.VIEWPORT);let a=n.getLayoutValue("text-rotation-alignment",t);a===U.AUTO&&(a=s?U.MAP:U.VIEWPORT);const r=n.getPaintValue("icon-translate",t),l=n.getPaintValue("icon-translate-anchor",t),h=n.getPaintValue("text-translate",t),d=n.getPaintValue("text-translate-anchor",t),f={iconAllowOverlap:n.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:n.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:n.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:n.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:o,textRotationAlignment:a,iconTranslateAnchor:l,iconTranslate:r,textTranslateAnchor:d,textTranslate:h};return this._styleProps.set(e,f),f}};function At(u,e){if(u.priority-e.priority)return u.priority-e.priority;const i=u.tile.key,t=e.tile.key;return i.world-t.world?i.world-t.world:i.level-t.level?i.level-t.level:i.row-t.row?i.row-t.row:i.col-t.col?i.col-t.col:u.xTile-e.xTile?u.xTile-e.xTile:u.yTile-e.yTile}let zt=class{get running(){return this._running}constructor(e,i,t,n,s,o){this._visibleTiles=e,this._symbolRepository=i,this._createCollisionJob=t,this._assignTileSymbolsOpacity=n,this._symbolLayerSorter=s,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(e,i){this._screenWidth===e&&this._screenHeight===i||this.restart(),this._screenWidth=e,this._screenHeight=i}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const i=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const i=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const i=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-i)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let r=0;rr)return!1;let g=null,m=!1,_=!1;for(const p of l.tileSymbols)if(!_||!m){const v=p.tile;(!g||v.isCoverage||v.neededForCoverage&&!m)&&(g=p,(v.neededForCoverage||v.isCoverage)&&(_=!0),v.isCoverage&&(m=!0))}if(g.selectedForRendering=!0,_){c.symbols.push(g),l.show=!0;for(const p of l.parts)p.show=!0}else l.show=!1}}for(const d of i)d.symbols.sort(At);return!0}const a=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return i.sort(a)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,i=this._visibleTiles;let t=0;function n(s,o){const a=s.symbols;for(const[r,l]of a)kt(l,o);e(s,o);for(const r of s.childrenTiles)n(r,o)}return{work(s){const o=performance.now();for(;ts)return!1;const a=i[t];a.parentTile==null&&n(a,performance.now())}return!0}}}};function kt(u,e){for(const i of u){const t=i.unique;for(const n of t.parts){const s=n.targetOpacity>.5?1:-1;n.startOpacity+=s*((e-n.startTime)/ce),n.startOpacity=Math.min(Math.max(n.startOpacity,0),1),n.startTime=e,n.targetOpacity=t.show&&n.show?1:0}}}const Ot=32,Nt=8,$t=64;let Vt=class{constructor(e,i,t){this.tileCoordRange=e,this._visibleTiles=i,this._createUnique=t,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,i){this._uniqueSymbolLayerArray=null;let t=this._tiles.get(e.id);t||(t={symbols:new Map},this._tiles.set(e.id,t));const n=new Map;if(i)for(const a of i)t.symbols.has(a)&&(n.set(a,t.symbols.get(a)),t.symbols.delete(a));else for(const[a,r]of e.layerData)t.symbols.has(a)&&(n.set(a,t.symbols.get(a)),t.symbols.delete(a));this._removeSymbols(n);const s=e.symbols,o=new Map;for(const[a,r]of s){let l=r.length;if(l>=Ot){let h=this.tileCoordRange;do h/=2,l/=4;while(l>Nt&&h>$t);const d=new ke(this.tileCoordRange,this.tileCoordRange,h);o.set(a,{flat:r,index:d}),t.symbols.set(a,{flat:r,index:d});for(const f of r)d.getCell(f.xTile,f.yTile).push(f)}else o.set(a,{flat:r}),t.symbols.set(a,{flat:r})}this._addSymbols(e.key,s)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[i,t]of this._tiles){const n=new Map;for(const s of e)t.symbols.has(s)&&(n.set(s,t.symbols.get(s)),t.symbols.delete(s));this._removeSymbols(n),t.symbols.size===0&&this._tiles.delete(i)}}removeTile(e){this._uniqueSymbolLayerArray=null;const i=this._tiles.get(e.id);if(!i)return;const t=new Map;for(const[n,s]of e.symbols)i.symbols.has(n)&&(t.set(n,i.symbols.get(n)),i.symbols.delete(n));this._removeSymbols(t),i.symbols.size===0&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[i,{flat:t}]of e)for(const n of t){const s=n.unique,o=s.tileSymbols,a=o.length-1;for(let r=0;ri.level){const s=e.key.level-i.level;if(e.key.row>>s!==i.row||e.key.col>>s!==i.col)return}if(i.level>e.key.level){const s=i.level-e.key.level;if(i.row>>s!==e.key.row||i.col>>s!==e.key.col)return}if(i.equals(e.key)){for(const s of e.childrenTiles)this._matchSymbols(s,i,t);return}const n=new Map;for(const[s,o]of t){const a=[];for(const d of o){const f=de(this.tileCoordRange,d.xTile,i.level,i.col,e.key.level,e.key.col),c=de(this.tileCoordRange,d.yTile,i.level,i.row,e.key.level,e.key.row);f>=0&&f=0&&c0&&n.set(s,r)}for(const s of e.childrenTiles)this._matchSymbols(s,i,n)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,i=new Array(e.size);let t,n=0;for(const[s,o]of e){const a=new Array(o.size);t=0;for(const r of o)a[t++]=r;i[n]={styleLayerUID:s,uniqueSymbols:a},n++}return i}};function Ft(u){const e=[],i=new Vt(4096,e,()=>{const n=new Qe;return n.show=!1,n.parts.push({startTime:0,startOpacity:0,targetOpacity:0,show:!1}),n.parts.push({startTime:0,startOpacity:0,targetOpacity:0,show:!1}),n}),t=new zt(e,i,(n,s,o)=>new Ut(n,s,o,u.styleRepository,u.key.level,0),(n,s)=>{je(n,s,!1)},()=>0,n=>{const s=u.styleRepository.getStyleLayerByUID(n).getLayoutProperty("visibility");return!s||s.getValue()!==ae.NONE});e.push(u),i.add(u),t.setScreenSize(512,512),t.continue(1/0)}let qt=class extends Ze{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const i=ee.pool.acquire(e),t=i.level===0?null:ee.getId(i.level-1,i.row>>1,i.col>>1,i.world);return ee.pool.release(i),t}getTileCoverage(e,i,t=!0,n){const s=super.getTileCoverage(e,i,t,n);if(!s)return s;const o=1<a.row>=0&&a.rowi[0].scale)return i[0].level;let t,n;for(let s=0;sn.scale)return t=i[s],t.level+(t.scale-e)/(t.scale-n.scale);return i[i.length-1].level}}_initializeFullCacheLODs(e){let i;if(e[0].level===0)i=e.map(t=>({level:t.level,resolution:t.resolution,scale:t.scale}));else{const t=this.tileInfo.size[0],n=this.tileInfo.spatialReference;i=et.create({size:t,spatialReference:n}).lods.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}))}for(let t=0;te.abort()),this._ongoingRequestToController.clear(),this._ongoingTileRequests.clear()}async getVectorTile(e,i,t,n){const s=new ee(e,i,t,0);let o=this._memCache.get(s.id);if(o!=null)return o.retain(),o;const a=await this._getVectorTileData(s);if(tt(n),!this._layer)return null;if(o=this._memCache.get(s.id),o!=null)return o.retain(),o;const r=this._layer.tileInfo.getTileBounds(it(),s),l=this._tileInfoView.getTileResolution(e);return o=new nt(s,l,r[0],r[3],512,512,this._styleRepository,this._memCache),a?(o.setData(a),o.retain(),this._memCache.put(s.id,o,o.memoryUsed,st)):o.setData(null),o.neededForCoverage=!0,o.transforms.tileUnitsToPixels=ot(1/8,0,0,0,1/8,0,0,0,1),Ft(o),o}_getVectorTileData(e){const i=e.id;if(this._ongoingTileRequests.has(i))return this._ongoingTileRequests.get(i);const t=new AbortController,n={signal:t.signal},s=this._getParsedVectorTileData(e,n).then(o=>(this._ongoingTileRequests.delete(i),this._ongoingRequestToController.delete(i),o)).catch(()=>(this._ongoingTileRequests.delete(i),this._ongoingRequestToController.delete(i),null));return this._ongoingTileRequests.set(i,s),this._ongoingRequestToController.set(i,t),s}_getParsedVectorTileData(e,i){return this.fetchTileData(e,i).then(t=>this.parseTileData({key:e,data:t},i))}},se=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,i){}draw(e,i,t){}drawMany(e,i,t){for(const n of i)n.visible&&this.draw(e,n,t)}},Ht=class extends se{constructor(){super(...arguments),this._color=bt(1,0,0,1),this._patternMatrix=at(),this._programOptions={id:!1,pattern:!1}}dispose(){this._vao&&(this._vao.dispose(),this._vao=null)}drawMany(e,i){const{context:t,painter:n,styleLayerUID:s,requestRender:o,allowDelayedRender:a}=e;this._loadWGLResources(e);const r=e.displayLevel,l=e.styleLayer,h=l.backgroundMaterial,d=n.vectorTilesMaterialManager,f=l.getPaintValue("background-color",r),c=l.getPaintValue("background-opacity",r),g=l.getPaintValue("background-pattern",r),m=g!==void 0,_=f[3]*c,p=1|window.devicePixelRatio,v=e.spriteMosaic;let P,I;const x=p>Ne?2:1,b=e.drawPhase===W.HITTEST,w=this._programOptions;w.id=b,w.pattern=m;const y=d.getMaterialProgram(t,h,w);if(!a||o==null||y.compiled){if(t.bindVAO(this._vao),t.useProgram(y),m){const S=v.getMosaicItemPosition(g,!0);if(S!=null){const{tl:M,br:T,page:D}=S;P=T[0]-M[0],I=T[1]-M[1];const R=v.getPageSize(D);R!=null&&(v.bind(t,X.LINEAR,D,k),y.setUniform4f("u_tlbr",M[0],M[1],T[0],T[1]),y.setUniform2fv("u_mosaicSize",R),y.setUniform1i("u_texture",k))}y.setUniform1f("u_opacity",c)}else this._color[0]=_*f[0],this._color[1]=_*f[1],this._color[2]=_*f[2],this._color[3]=_,y.setUniform4fv("u_color",this._color);if(y.setUniform1f("u_depth",l.z||0),b){const S=ne(s+1);y.setUniform4fv("u_id",S)}for(const S of i){if(y.setUniform1f("u_coord_range",S.rangeX),y.setUniformMatrix3fv("u_dvsMat3",S.transforms.dvs),m){const M=Math.max(2**(Math.round(r)-S.key.level),1),T=x*S.width*M,D=T/fe(P),R=T/fe(I);this._patternMatrix[0]=D,this._patternMatrix[4]=R,y.setUniformMatrix3fv("u_pattern_matrix",this._patternMatrix)}t.setStencilFunction(V.EQUAL,0,255),t.drawArrays(F.TRIANGLE_STRIP,0,4)}}else o()}_loadWGLResources(e){if(this._vao)return;const{context:i,styleLayer:t}=e,n=t.backgroundMaterial,s=new Int8Array([0,0,1,0,0,1,1,1]),o=rt.createVertex(i,lt.STATIC_DRAW,s),a=new ct(i,n.getAttributeLocations(),n.getLayoutInfo(),{geometry:o});this._vao=a}},Wt=class extends se{constructor(){super(...arguments),this._programOptions={id:!1}}dispose(){}drawMany(e,i){const{context:t,displayLevel:n,requiredLevel:s,state:o,drawPhase:a,painter:r,spriteMosaic:l,styleLayerUID:h,requestRender:d,allowDelayedRender:f}=e;if(!i.some(w=>{var y;return((y=w.layerData.get(h))==null?void 0:y.circleIndexCount)??!1}))return;const c=e.styleLayer,g=c.circleMaterial,m=r.vectorTilesMaterialManager,_=1.2,p=c.getPaintValue("circle-translate",n),v=c.getPaintValue("circle-translate-anchor",n),P=a===W.HITTEST,I=this._programOptions;I.id=P;const x=m.getMaterialProgram(t,g,I);if(f&&d!=null&&!x.compiled)return void d();t.useProgram(x),x.setUniformMatrix3fv("u_displayMat3",v===Y.VIEWPORT?o.displayMat3:o.displayViewMat3),x.setUniform2fv("u_circleTranslation",p),x.setUniform1f("u_depth",c.z),x.setUniform1f("u_antialiasingWidth",_);let b=-1;if(P){const w=ne(h+1);x.setUniform4fv("u_id",w)}for(const w of i){if(!w.layerData.has(h))continue;w.key.level!==b&&(b=w.key.level,g.setDataUniforms(x,n,c,b,l));const y=w.layerData.get(h);if(!y.circleIndexCount)continue;y.prepareForRendering(t);const S=y.vao;S!=null&&(t.bindVAO(S),x.setUniformMatrix3fv("u_dvsMat3",w.transforms.dvs),s!==w.key.level?t.setStencilFunction(V.EQUAL,w.stencilRef,255):t.setStencilFunction(V.GREATER,255,255),t.drawElements(F.TRIANGLES,y.circleIndexCount,H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*y.circleIndexStart),w.triangleCount+=y.circleIndexCount/3)}}};const Se=1/65536;let Bt=class extends se{constructor(){super(...arguments),this._fillProgramOptions={id:!1,pattern:!1},this._outlineProgramOptions={id:!1}}dispose(){}drawMany(e,i){const{displayLevel:t,drawPhase:n,renderPass:s,spriteMosaic:o,styleLayerUID:a}=e;let r=!1;for(const x of i)if(x.layerData.has(a)){const b=x.layerData.get(a);if(b.fillIndexCount>0||b.outlineIndexCount>0){r=!0;break}}if(!r)return;const l=e.styleLayer,h=l.getPaintProperty("fill-pattern"),d=h!==void 0,f=d&&h.isDataDriven;let c;if(d&&!f){const x=h.getValue(t);c=o.getMosaicItemPosition(x,!0)}const g=!d&&l.getPaintValue("fill-antialias",t);let m=!0,_=1;if(!d){const x=l.getPaintProperty("fill-color"),b=l.getPaintProperty("fill-opacity");if(!(x!=null&&x.isDataDriven)&&!(b!=null&&b.isDataDriven)){const w=l.getPaintValue("fill-color",t);_=l.getPaintValue("fill-opacity",t)*w[3],_>=1&&(m=!1)}}if(m&&s==="opaque")return;let p;n===W.HITTEST&&(p=ne(a+1));const v=l.getPaintValue("fill-translate",t),P=l.getPaintValue("fill-translate-anchor",t);(m||s!=="translucent")&&this._drawFill(e,a,l,i,v,P,d,c,f,p);const I=!l.hasDataDrivenOutlineColor&&l.outlineUsesFillColor&&_<1;g&&s!=="opaque"&&!I&&this._drawOutline(e,a,l,i,v,P,p)}_drawFill(e,i,t,n,s,o,a,r,l,h){if(a&&!l&&r==null)return;const{context:d,displayLevel:f,state:c,drawPhase:g,painter:m,pixelRatio:_,spriteMosaic:p,requestRender:v,allowDelayedRender:P}=e,I=t.fillMaterial,x=m.vectorTilesMaterialManager,b=_>Ne?2:1,w=g===W.HITTEST,y=this._fillProgramOptions;y.id=w,y.pattern=a;const S=x.getMaterialProgram(d,I,y);if(P&&v!=null&&!S.compiled)return void v();if(d.useProgram(S),r!=null){const{page:T}=r,D=p.getPageSize(T);D!=null&&(p.bind(d,X.LINEAR,T,k),S.setUniform2fv("u_mosaicSize",D),S.setUniform1i("u_texture",k))}S.setUniformMatrix3fv("u_displayMat3",o===Y.VIEWPORT?c.displayMat3:c.displayViewMat3),S.setUniform2fv("u_fillTranslation",s),S.setUniform1f("u_depth",t.z+Se),w&&S.setUniform4fv("u_id",h);let M=-1;for(const T of n){if(!T.layerData.has(i))continue;T.key.level!==M&&(M=T.key.level,I.setDataUniforms(S,f,t,M,p));const D=T.layerData.get(i);if(!D.fillIndexCount)continue;D.prepareForRendering(d);const R=D.fillVAO;if(R!=null){if(d.bindVAO(R),S.setUniformMatrix3fv("u_dvsMat3",T.transforms.dvs),d.setStencilFunction(V.EQUAL,T.stencilRef,255),a){const E=Math.max(2**(Math.round(f)-T.key.level),1),L=T.rangeX/(b*T.width*E);S.setUniform1f("u_patternFactor",L)}if(l){const E=D.patternMap;if(!E)continue;for(const[L,G]of E){const J=p.getPageSize(L);J!=null&&(p.bind(d,X.LINEAR,L,k),S.setUniform2fv("u_mosaicSize",J),S.setUniform1i("u_texture",k),d.drawElements(F.TRIANGLES,G[1],H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*G[0]))}}else d.drawElements(F.TRIANGLES,D.fillIndexCount,H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*D.fillIndexStart);T.triangleCount+=D.fillIndexCount/3}}}_drawOutline(e,i,t,n,s,o,a){const{context:r,displayLevel:l,state:h,drawPhase:d,painter:f,pixelRatio:c,spriteMosaic:g,requestRender:m,allowDelayedRender:_}=e,p=t.outlineMaterial,v=f.vectorTilesMaterialManager,P=.75/c,I=d===W.HITTEST,x=this._outlineProgramOptions;x.id=I;const b=v.getMaterialProgram(r,p,x);if(_&&m!=null&&!b.compiled)return void m();r.useProgram(b),b.setUniformMatrix3fv("u_displayMat3",o===Y.VIEWPORT?h.displayMat3:h.displayViewMat3),b.setUniform2fv("u_fillTranslation",s),b.setUniform1f("u_depth",t.z+Se),b.setUniform1f("u_outline_width",P),I&&b.setUniform4fv("u_id",a);let w=-1;for(const y of n){if(!y.layerData.has(i))continue;y.key.level!==w&&(w=y.key.level,p.setDataUniforms(b,l,t,w,g));const S=y.layerData.get(i);if(S.prepareForRendering(r),!S.outlineIndexCount)continue;const M=S.outlineVAO;M!=null&&(r.bindVAO(M),b.setUniformMatrix3fv("u_dvsMat3",y.transforms.dvs),r.setStencilFunction(V.EQUAL,y.stencilRef,255),r.drawElements(F.TRIANGLES,S.outlineIndexCount,H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*S.outlineIndexStart),y.triangleCount+=S.outlineIndexCount/3)}}},Gt=class extends se{constructor(){super(...arguments),this._programOptions={id:!1,pattern:!1,sdf:!1}}dispose(){}drawMany(e,i){const{context:t,displayLevel:n,state:s,drawPhase:o,painter:a,pixelRatio:r,spriteMosaic:l,styleLayerUID:h,requestRender:d,allowDelayedRender:f}=e;if(!i.some(R=>{var E;return((E=R.layerData.get(h))==null?void 0:E.lineIndexCount)??!1}))return;const c=e.styleLayer,g=c.lineMaterial,m=a.vectorTilesMaterialManager,_=c.getPaintValue("line-translate",n),p=c.getPaintValue("line-translate-anchor",n),v=c.getPaintProperty("line-pattern"),P=v!==void 0,I=P&&v.isDataDriven;let x,b;if(P&&!I){const R=v.getValue(n);x=l.getMosaicItemPosition(R)}let w=!1;if(!P){const R=c.getPaintProperty("line-dasharray");if(b=R!==void 0,w=b&&R.isDataDriven,b&&!w){const E=R.getValue(n),L=c.getDashKey(E,c.getLayoutValue("line-cap",n));x=l.getMosaicItemPosition(L)}}const y=1/r,S=o===W.HITTEST,M=this._programOptions;M.id=S,M.pattern=P,M.sdf=b;const T=m.getMaterialProgram(t,g,M);if(f&&d!=null&&!T.compiled)return void d();if(t.useProgram(T),T.setUniformMatrix3fv("u_displayViewMat3",s.displayViewMat3),T.setUniformMatrix3fv("u_displayMat3",p===Y.VIEWPORT?s.displayMat3:s.displayViewMat3),T.setUniform2fv("u_lineTranslation",_),T.setUniform1f("u_depth",c.z),T.setUniform1f("u_antialiasing",y),S){const R=ne(h+1);T.setUniform4fv("u_id",R)}if(x&&x!=null){const{page:R}=x,E=l.getPageSize(R);E!=null&&(l.bind(t,X.LINEAR,R,k),T.setUniform2fv("u_mosaicSize",E),T.setUniform1i("u_texture",k))}let D=-1;for(const R of i){if(!R.layerData.has(h))continue;R.key.level!==D&&(D=R.key.level,g.setDataUniforms(T,n,c,D,l));const E=2**(n-D)/r;T.setUniform1f("u_zoomFactor",E);const L=R.layerData.get(h);if(!L.lineIndexCount)continue;L.prepareForRendering(t);const G=L.vao;if(G!=null){if(t.bindVAO(G),T.setUniformMatrix3fv("u_dvsMat3",R.transforms.dvs),t.setStencilFunction(V.EQUAL,R.stencilRef,255),I||w){const J=L.patternMap;if(!J)continue;for(const[te,C]of J){const Q=l.getPageSize(te);Q!=null&&(l.bind(t,X.LINEAR,te,k),T.setUniform2fv("u_mosaicSize",Q),T.setUniform1i("u_texture",k),t.drawElements(F.TRIANGLES,C[1],H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*C[0]))}}else t.drawElements(F.TRIANGLES,L.lineIndexCount,H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*L.lineIndexStart);R.triangleCount+=L.lineIndexCount/3}}}};const Jt=1/65536;class Kt extends se{constructor(){super(...arguments),this._iconProgramOptions={id:!1,sdf:!1},this._sdfProgramOptions={id:!1},this._spritesTextureSize=ut()}dispose(){}drawMany(e,i){const{drawPhase:t,styleLayerUID:n}=e,s=e.styleLayer;let o;t===W.HITTEST&&(o=ne(n+1)),this._drawIcons(e,s,i,o),this._drawText(e,s,i,o)}_drawIcons(e,i,t,n){const{context:s,displayLevel:o,drawPhase:a,painter:r,spriteMosaic:l,state:h,styleLayerUID:d,requestRender:f,allowDelayedRender:c}=e,g=i.iconMaterial,m=r.vectorTilesMaterialManager;let _,p=!1;for(const D of t)if(D.layerData.has(d)&&(_=D.layerData.get(d),_.iconPerPageElementsMap.size>0)){p=!0;break}if(!p)return;const v=i.getPaintValue("icon-translate",o),P=i.getPaintValue("icon-translate-anchor",o);let I=i.getLayoutValue("icon-rotation-alignment",o);I===U.AUTO&&(I=i.getLayoutValue("symbol-placement",o)===le.POINT?U.VIEWPORT:U.MAP);const x=I===U.MAP,b=i.getLayoutValue("icon-keep-upright",o)&&x,w=_.isIconSDF,y=a===W.HITTEST,S=this._iconProgramOptions;S.id=y,S.sdf=w;const M=m.getMaterialProgram(s,g,S);if(c&&f!=null&&!M.compiled)return void f();s.useProgram(M),M.setUniformMatrix3fv("u_displayViewMat3",I===U.MAP?h.displayViewMat3:h.displayMat3),M.setUniformMatrix3fv("u_displayMat3",P===Y.VIEWPORT?h.displayMat3:h.displayViewMat3),M.setUniform2fv("u_iconTranslation",v),M.setUniform1f("u_depth",i.z),M.setUniform1f("u_mapRotation",ge(h.rotation)),M.setUniform1f("u_keepUpright",b?1:0),M.setUniform1f("u_level",10*o),M.setUniform1i("u_texture",k),M.setUniform1f("u_fadeDuration",ce/1e3),y&&M.setUniform4fv("u_id",n);let T=-1;for(const D of t){if(!D.layerData.has(d)||(D.key.level!==T&&(T=D.key.level,g.setDataUniforms(M,o,i,T,l)),_=D.layerData.get(d),_.iconPerPageElementsMap.size===0))continue;_.prepareForRendering(s),_.updateOpacityInfo();const R=_.iconVAO;if(R!=null){s.bindVAO(R),M.setUniformMatrix3fv("u_dvsMat3",D.transforms.dvs),M.setUniform1f("u_time",(performance.now()-_.lastOpacityUpdate)/1e3);for(const[E,L]of _.iconPerPageElementsMap)this._renderIconRange(e,M,L,E,D)}}}_renderIconRange(e,i,t,n,s){const{context:o,spriteMosaic:a}=e;this._spritesTextureSize[0]=a.getWidth(n)/4,this._spritesTextureSize[1]=a.getHeight(n)/4,i.setUniform2fv("u_mosaicSize",this._spritesTextureSize),a.bind(o,X.LINEAR,n,k),this._setStencilState(e,s),o.drawElements(F.TRIANGLES,t[1],H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*t[0]),s.triangleCount+=t[1]/3}_drawText(e,i,t,n){const{context:s,displayLevel:o,drawPhase:a,glyphMosaic:r,painter:l,pixelRatio:h,spriteMosaic:d,state:f,styleLayerUID:c,requestRender:g,allowDelayedRender:m}=e,_=i.textMaterial,p=l.vectorTilesMaterialManager;let v,P=!1;for(const N of t)if(N.layerData.has(c)&&(v=N.layerData.get(c),v.glyphPerPageElementsMap.size>0)){P=!0;break}if(!P)return;const I=i.getPaintProperty("text-opacity");if(I&&!I.isDataDriven&&I.getValue(o)===0)return;const x=i.getPaintProperty("text-color"),b=!x||x.isDataDriven||x.getValue(o)[3]>0,w=i.getPaintProperty("text-halo-width"),y=i.getPaintProperty("text-halo-color"),S=(!w||w.isDataDriven||w.getValue(o)>0)&&(!y||y.isDataDriven||y.getValue(o)[3]>0);if(!b&&!S)return;const M=24/8;let T=i.getLayoutValue("text-rotation-alignment",o);T===U.AUTO&&(T=i.getLayoutValue("symbol-placement",o)===le.POINT?U.VIEWPORT:U.MAP);const D=T===U.MAP,R=i.getLayoutValue("text-keep-upright",o)&&D,E=a===W.HITTEST,L=.8*M/h;this._glyphTextureSize||(this._glyphTextureSize=ht(r.width/4,r.height/4));const G=i.getPaintValue("text-translate",o),J=i.getPaintValue("text-translate-anchor",o),te=this._sdfProgramOptions;te.id=E;const C=p.getMaterialProgram(s,_,te);if(m&&g!=null&&!C.compiled)return void g();s.useProgram(C),C.setUniformMatrix3fv("u_displayViewMat3",T===U.MAP?f.displayViewMat3:f.displayMat3),C.setUniformMatrix3fv("u_displayMat3",J===Y.VIEWPORT?f.displayMat3:f.displayViewMat3),C.setUniform2fv("u_textTranslation",G),C.setUniform1f("u_depth",i.z+Jt),C.setUniform2fv("u_mosaicSize",this._glyphTextureSize),C.setUniform1f("u_mapRotation",ge(f.rotation)),C.setUniform1f("u_keepUpright",R?1:0),C.setUniform1f("u_level",10*o),C.setUniform1i("u_texture",pe),C.setUniform1f("u_antialiasingWidth",L),C.setUniform1f("u_fadeDuration",ce/1e3),E&&C.setUniform4fv("u_id",n);let Q=-1;for(const N of t){if(!N.layerData.has(c)||(N.key.level!==Q&&(Q=N.key.level,_.setDataUniforms(C,o,i,Q,d)),v=N.layerData.get(c),v.glyphPerPageElementsMap.size===0))continue;v.prepareForRendering(s),v.updateOpacityInfo();const ue=v.textVAO;if(ue==null)continue;s.bindVAO(ue),C.setUniformMatrix3fv("u_dvsMat3",N.transforms.dvs),this._setStencilState(e,N);const Ve=(performance.now()-v.lastOpacityUpdate)/1e3;C.setUniform1f("u_time",Ve),v.glyphPerPageElementsMap.forEach((Fe,qe)=>{this._renderGlyphRange(s,Fe,qe,r,C,S,b,N)})}}_renderGlyphRange(e,i,t,n,s,o,a,r){n.bind(e,X.LINEAR,t,pe),o&&(s.setUniform1f("u_halo",1),e.drawElements(F.TRIANGLES,i[1],H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),r.triangleCount+=i[1]/3),a&&(s.setUniform1f("u_halo",0),e.drawElements(F.TRIANGLES,i[1],H.UNSIGNED_INT,Uint32Array.BYTES_PER_ELEMENT*i[0]),r.triangleCount+=i[1]/3)}_setStencilState(e,i){const{context:t,is3D:n,stencilSymbols:s}=e;if(t.setStencilTestEnabled(!0),s)return t.setStencilWriteMask(255),void t.setStencilFunction(V.ALWAYS,i.stencilRef,255);t.setStencilWriteMask(0),n?t.setStencilFunction(V.EQUAL,i.stencilRef,255):t.setStencilFunction(V.GREATER,255,255)}}const Yt={vtlBackground:Ht,vtlFill:Bt,vtlLine:Gt,vtlCircle:Wt,vtlSymbol:Kt},Xt={background:{"background.frag":`#ifdef PATTERN +uniform lowp float u_opacity; +uniform lowp sampler2D u_texture; +varying mediump vec4 v_tlbr; +varying mediump vec2 v_tileTextureCoord; +#else +uniform lowp vec4 u_color; +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() { +#ifdef PATTERN +mediump vec2 normalizedTextureCoord = mod(v_tileTextureCoord, 1.0); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +gl_FragColor = u_opacity * color; +#else +gl_FragColor = u_color; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"background.vert":`precision mediump float; +attribute vec2 a_pos; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform mediump float u_coord_range; +uniform mediump float u_depth; +#ifdef PATTERN +uniform mediump mat3 u_pattern_matrix; +varying mediump vec2 v_tileTextureCoord; +uniform mediump vec4 u_tlbr; +uniform mediump vec2 u_mosaicSize; +varying mediump vec4 v_tlbr; +#endif +void main() { +gl_Position = vec4((u_dvsMat3 * vec3(u_coord_range * a_pos, 1.0)).xy, u_depth, 1.0); +#ifdef PATTERN +v_tileTextureCoord = (u_pattern_matrix * vec3(a_pos, 1.0)).xy; +v_tlbr = u_tlbr / u_mosaicSize.xyxy; +#endif +#ifdef ID +v_id = u_id / 255.0; +#endif +}`},circle:{"circle.frag":`precision lowp float; +varying lowp vec4 v_color; +varying lowp vec4 v_stroke_color; +varying mediump float v_blur; +varying mediump float v_stroke_width; +varying mediump float v_radius; +varying mediump vec2 v_offset; +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +mediump float dist = length(v_offset); +mediump float alpha = smoothstep(0.0, -v_blur, dist - 1.0); +lowp float color_mix_ratio = v_stroke_width < 0.01 ? 0.0 : smoothstep(-v_blur, 0.0, dist - v_radius / (v_radius + v_stroke_width)); +gl_FragColor = alpha * mix(v_color, v_stroke_color, color_mix_ratio); +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"circle.vert":`precision mediump float; +attribute vec2 a_pos; +#pragma header +varying lowp vec4 v_color; +varying lowp vec4 v_stroke_color; +varying mediump float v_blur; +varying mediump float v_stroke_width; +varying mediump float v_radius; +varying mediump vec2 v_offset; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump vec2 u_circleTranslation; +uniform mediump float u_depth; +uniform mediump float u_antialiasingWidth; +void main() +{ +#pragma main +v_color = color * opacity; +v_stroke_color = stroke_color * stroke_opacity; +v_stroke_width = stroke_width; +v_radius = radius; +v_blur = max(blur, u_antialiasingWidth / (radius + stroke_width)); +mediump vec2 offset = vec2(mod(a_pos, 2.0) * 2.0 - 1.0); +v_offset = offset; +#ifdef ID +v_id = u_id / 255.0; +#endif +mediump vec3 pos = u_dvsMat3 * vec3(a_pos * 0.5, 1.0) + u_displayMat3 * vec3((v_radius + v_stroke_width) * offset + u_circleTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},fill:{"fill.frag":`precision lowp float; +#ifdef PATTERN +uniform lowp sampler2D u_texture; +varying mediump vec2 v_tileTextureCoord; +varying mediump vec4 v_tlbr; +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +vec4 mixColors(vec4 color1, vec4 color2) { +float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); +vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); +return vec4(compositeColor, compositeAlpha); +} +void main() +{ +#ifdef PATTERN +mediump vec2 normalizedTextureCoord = fract(v_tileTextureCoord); +mediump vec2 samplePos = mix(v_tlbr.xy, v_tlbr.zw, normalizedTextureCoord); +lowp vec4 color = texture2D(u_texture, samplePos); +gl_FragColor = v_color[3] * color; +#else +gl_FragColor = v_color; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"fill.vert":`precision mediump float; +attribute vec2 a_pos; +#pragma header +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump float u_depth; +uniform mediump vec2 u_fillTranslation; +#ifdef PATTERN +#include +uniform mediump vec2 u_mosaicSize; +uniform mediump float u_patternFactor; +varying mediump vec2 v_tileTextureCoord; +varying mediump vec4 v_tlbr; +#endif +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +void main() +{ +#pragma main +v_color = color * opacity; +#ifdef ID +v_id = u_id / 255.0; +#endif +#ifdef PATTERN +float patternWidth = nextPOT(tlbr.z - tlbr.x); +float patternHeight = nextPOT(tlbr.w - tlbr.y); +float scaleX = 1.0 / (patternWidth * u_patternFactor); +float scaleY = 1.0 / (patternHeight * u_patternFactor); +mat3 patterMat = mat3(scaleX, 0.0, 0.0, +0.0, -scaleY, 0.0, +0.0, 0.0, 1.0); +v_tileTextureCoord = (patterMat * vec3(a_pos, 1.0)).xy; +v_tlbr = tlbr / u_mosaicSize.xyxy; +#endif +vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(u_fillTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},icon:{"icon.frag":`precision mediump float; +uniform lowp sampler2D u_texture; +#ifdef SDF +uniform lowp vec4 u_color; +uniform lowp vec4 u_outlineColor; +#endif +varying mediump vec2 v_tex; +varying lowp float v_opacity; +varying mediump vec2 v_size; +varying lowp vec4 v_color; +#ifdef SDF +varying mediump flaot v_halo_width; +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +#include +vec4 mixColors(vec4 color1, vec4 color2) { +float compositeAlpha = color2.a + color1.a * (1.0 - color2.a); +vec3 compositeColor = color2.rgb + color1.rgb * (1.0 - color2.a); +return vec4(compositeColor, compositeAlpha); +} +void main() +{ +#ifdef SDF +lowp vec4 fillPixelColor = v_color; +float d = rgba2float(texture2D(u_texture, v_tex)) - 0.5; +const float softEdgeRatio = 0.248062016; +float size = max(v_size.x, v_size.y); +float dist = d * softEdgeRatio * size; +fillPixelColor *= clamp(0.5 - dist, 0.0, 1.0); +if (v_halo_width > 0.25) { +lowp vec4 outlinePixelColor = u_outlineColor; +const float outlineLimitRatio = (16.0 / 86.0); +float clampedOutlineSize = softEdgeRatio * min(v_halo_width, outlineLimitRatio * max(v_size.x, v_size.y)); +outlinePixelColor *= clamp(0.5 - (abs(dist) - clampedOutlineSize), 0.0, 1.0); +gl_FragColor = v_opacity * mixColors(fillPixelColor, outlinePixelColor); +} +else { +gl_FragColor = v_opacity * fillPixelColor; +} +#else +lowp vec4 texColor = texture2D(u_texture, v_tex); +gl_FragColor = v_opacity * texColor; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"icon.vert":`attribute vec2 a_pos; +attribute vec2 a_vertexOffset; +attribute vec4 a_texAngleRange; +attribute vec4 a_levelInfo; +attribute float a_opacityInfo; +#pragma header +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +#ifdef SDF +varying mediump float v_halo_width; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump vec2 u_iconTranslation; +uniform vec2 u_mosaicSize; +uniform mediump float u_depth; +uniform mediump float u_mapRotation; +uniform mediump float u_level; +uniform lowp float u_keepUpright; +uniform mediump float u_fadeDuration; +varying mediump vec2 v_tex; +varying lowp float v_opacity; +varying mediump vec2 v_size; +const float C_OFFSET_PRECISION = 1.0 / 8.0; +const float C_256_TO_RAD = 3.14159265359 / 128.0; +const float C_DEG_TO_RAD = 3.14159265359 / 180.0; +const float tileCoordRatio = 1.0 / 8.0; +uniform highp float u_time; +void main() +{ +#pragma main +v_color = color; +v_opacity = opacity; +#ifdef SDF +v_halo_width = halo_width; +#endif +float modded = mod(a_opacityInfo, 128.0); +float targetOpacity = (a_opacityInfo - modded) / 128.0; +float startOpacity = modded / 127.0; +float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); +v_opacity *= interpolatedOpacity; +mediump float a_angle = a_levelInfo[1]; +mediump float a_minLevel = a_levelInfo[2]; +mediump float a_maxLevel = a_levelInfo[3]; +mediump vec2 a_tex = a_texAngleRange.xy; +mediump float delta_z = 0.0; +mediump float rotated = mod(a_angle + u_mapRotation, 256.0); +delta_z += (1.0 - step(u_keepUpright, 0.0)) * step(64.0, rotated) * (1.0 - step(192.0, rotated)); +delta_z += 1.0 - step(a_minLevel, u_level); +delta_z += step(a_maxLevel, u_level); +delta_z += step(v_opacity, 0.0); +vec2 offset = C_OFFSET_PRECISION * a_vertexOffset; +v_size = abs(offset); +#ifdef SDF +offset = (120.0 / 86.0) * offset; +#endif +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayViewMat3 * vec3(size * offset, 0.0) + u_displayMat3 * vec3(u_iconTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); +#ifdef ID +v_id = u_id / 255.0; +#endif +v_tex = a_tex.xy / u_mosaicSize; +}`},line:{"line.frag":`precision lowp float; +varying mediump vec2 v_normal; +varying highp float v_accumulatedDistance; +varying mediump float v_lineHalfWidth; +varying lowp vec4 v_color; +varying mediump float v_blur; +#if defined (PATTERN) || defined(SDF) +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +varying mediump float v_widthRatio; +uniform sampler2D u_texture; +uniform mediump float u_antialiasing; +#endif +#ifdef SDF +#include +#endif +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +mediump float fragDist = length(v_normal) * v_lineHalfWidth; +lowp float alpha = clamp((v_lineHalfWidth - fragDist) / v_blur, 0.0, 1.0); +#ifdef PATTERN +mediump float relativeTexX = fract(v_accumulatedDistance / (v_patternSize.x * v_widthRatio)); +mediump float relativeTexY = 0.5 + v_normal.y * v_lineHalfWidth / (v_patternSize.y * v_widthRatio); +mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); +lowp vec4 color = texture2D(u_texture, texCoord); +gl_FragColor = alpha * v_color[3] * color; +#elif defined(SDF) +mediump float relativeTexX = fract((v_accumulatedDistance * 0.5) / (v_patternSize.x * v_widthRatio)); +mediump float relativeTexY = 0.5 + 0.25 * v_normal.y; +mediump vec2 texCoord = mix(v_tlbr.xy, v_tlbr.zw, vec2(relativeTexX, relativeTexY)); +mediump float d = rgba2float(texture2D(u_texture, texCoord)) - 0.5; +float dist = d * (v_lineHalfWidth + u_antialiasing / 2.0); +gl_FragColor = alpha * clamp(0.5 - dist, 0.0, 1.0) * v_color; +#else +gl_FragColor = alpha * v_color; +#endif +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"line.vert":`precision mediump float; +attribute vec2 a_pos; +attribute vec4 a_extrude_offset; +attribute vec4 a_dir_normal; +attribute vec2 a_accumulatedDistance; +#pragma header +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump float u_zoomFactor; +uniform mediump vec2 u_lineTranslation; +uniform mediump float u_antialiasing; +uniform mediump float u_depth; +varying mediump vec2 v_normal; +varying highp float v_accumulatedDistance; +const float scale = 1.0 / 31.0; +const mediump float tileCoordRatio = 8.0; +#if defined (SDF) +const mediump float sdfPatternHalfWidth = 15.5; +#endif +#if defined (PATTERN) || defined(SDF) +uniform mediump vec2 u_mosaicSize; +varying mediump vec4 v_tlbr; +varying mediump vec2 v_patternSize; +varying mediump float v_widthRatio; +#endif +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +varying lowp vec4 v_color; +varying mediump float v_lineHalfWidth; +varying mediump float v_blur; +void main() +{ +#pragma main +v_color = color * opacity; +v_blur = blur + u_antialiasing; +v_normal = a_dir_normal.zw * scale; +#if defined (PATTERN) || defined(SDF) +v_tlbr = tlbr / u_mosaicSize.xyxy; +v_patternSize = vec2(tlbr.z - tlbr.x, tlbr.y - tlbr.w); +#if defined (PATTERN) +v_widthRatio = width / v_patternSize.y; +#else +v_widthRatio = width / sdfPatternHalfWidth / 2.0; +#endif +#endif +v_lineHalfWidth = (width + u_antialiasing) * 0.5; +mediump vec2 dir = a_dir_normal.xy * scale; +mediump vec2 offset_ = a_extrude_offset.zw * scale * offset; +mediump vec2 dist = v_lineHalfWidth * scale * a_extrude_offset.xy; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos + offset_ * tileCoordRatio / u_zoomFactor, 1.0) + u_displayViewMat3 * vec3(dist, 0.0) + u_displayMat3 * vec3(u_lineTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +#if defined (PATTERN) || defined(SDF) +v_accumulatedDistance = a_accumulatedDistance.x * u_zoomFactor / tileCoordRatio + dot(dir, dist + offset_); +#endif +#ifdef ID +v_id = u_id / 255.0; +#endif +}`},outline:{"outline.frag":`varying lowp vec4 v_color; +varying mediump vec2 v_normal; +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +lowp float dist = abs(v_normal.y); +lowp float alpha = smoothstep(1.0, 0.0, dist); +gl_FragColor = alpha * v_color; +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"outline.vert":`attribute vec2 a_pos; +attribute vec2 a_offset; +attribute vec2 a_xnormal; +#pragma header +varying lowp vec4 v_color; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform mediump vec2 u_fillTranslation; +uniform mediump float u_depth; +uniform mediump float u_outline_width; +varying lowp vec2 v_normal; +const float scale = 1.0 / 15.0; +void main() +{ +#pragma main +v_color = color * opacity; +#ifdef ID +v_id = u_id / 255.0; +#endif +v_normal = a_xnormal; +mediump vec2 dist = u_outline_width * scale * a_offset; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + u_displayMat3 * vec3(dist + u_fillTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth, 1.0); +}`},text:{"text.frag":`uniform lowp sampler2D u_texture; +varying lowp vec2 v_tex; +varying lowp vec4 v_color; +varying mediump float v_edgeWidth; +varying mediump float v_edgeDistance; +#ifdef ID +varying mediump vec4 v_id; +#endif +void main() +{ +lowp float dist = texture2D(u_texture, v_tex).a; +mediump float alpha = smoothstep(v_edgeDistance - v_edgeWidth, v_edgeDistance + v_edgeWidth, dist); +gl_FragColor = alpha * v_color; +#ifdef ID +if (gl_FragColor.a < 1.0 / 255.0) { +discard; +} +gl_FragColor = v_id; +#endif +}`,"text.vert":`attribute vec2 a_pos; +attribute vec2 a_vertexOffset; +attribute vec4 a_texAngleRange; +attribute vec4 a_levelInfo; +attribute float a_opacityInfo; +#pragma header +varying lowp vec4 v_color; +#ifdef ID +uniform mediump vec4 u_id; +varying mediump vec4 v_id; +#endif +uniform highp mat3 u_dvsMat3; +uniform highp mat3 u_displayMat3; +uniform highp mat3 u_displayViewMat3; +uniform mediump vec2 u_textTranslation; +uniform vec2 u_mosaicSize; +uniform mediump float u_depth; +uniform mediump float u_mapRotation; +uniform mediump float u_level; +uniform lowp float u_keepUpright; +uniform mediump float u_fadeDuration; +varying lowp vec2 v_tex; +const float offsetPrecision = 1.0 / 8.0; +const mediump float edgePos = 0.75; +uniform mediump float u_antialiasingWidth; +varying mediump float v_edgeDistance; +varying mediump float v_edgeWidth; +uniform lowp float u_halo; +const float sdfFontScale = 1.0 / 24.0; +const float sdfPixel = 3.0; +uniform highp float u_time; +void main() +{ +#pragma main +if (u_halo > 0.5) +{ +v_color = halo_color * opacity; +halo_width *= sdfPixel; +halo_blur *= sdfPixel; +} +else +{ +v_color = color * opacity; +halo_width = 0.0; +halo_blur = 0.0; +} +float modded = mod(a_opacityInfo, 128.0); +float targetOpacity = (a_opacityInfo - modded) / 128.0; +float startOpacity = modded / 127.0; +float interpolatedOpacity = clamp(startOpacity + 2.0 * (targetOpacity - 0.5) * u_time / u_fadeDuration, 0.0, 1.0); +v_color *= interpolatedOpacity; +mediump float a_angle = a_levelInfo[1]; +mediump float a_minLevel = a_levelInfo[2]; +mediump float a_maxLevel = a_levelInfo[3]; +mediump vec2 a_tex = a_texAngleRange.xy; +mediump float a_visMinAngle = a_texAngleRange.z; +mediump float a_visMaxAngle = a_texAngleRange.w; +mediump float delta_z = 0.0; +mediump float angle = mod(a_angle + u_mapRotation, 256.0); +if (a_visMinAngle < a_visMaxAngle) +{ +delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) + (1.0 - step(a_visMinAngle, angle))); +} +else +{ +delta_z += (1.0 - step(u_keepUpright, 0.0)) * (step(a_visMaxAngle, angle) * (1.0 - step(a_visMinAngle, angle))); +} +delta_z += 1.0 - step(a_minLevel, u_level); +delta_z += step(a_maxLevel, u_level); +delta_z += step(v_color[3], 0.0); +v_tex = a_tex.xy / u_mosaicSize; +#ifdef ID +v_id = u_id / 255.0; +#endif +v_edgeDistance = edgePos - halo_width / size; +v_edgeWidth = (u_antialiasingWidth + halo_blur) / size; +mediump vec3 pos = u_dvsMat3 * vec3(a_pos, 1.0) + sdfFontScale * u_displayViewMat3 * vec3(offsetPrecision * size * a_vertexOffset, 0.0) + u_displayMat3 * vec3(u_textTranslation, 0.0); +gl_Position = vec4(pos.xy, u_depth + delta_z, 1.0); +}`},util:{"encoding.glsl":`const vec4 rgba2float_factors = vec4( +255.0 / (256.0), +255.0 / (256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0), +255.0 / (256.0 * 256.0 * 256.0 * 256.0) +); +float rgba2float(vec4 rgba) { +return dot(rgba, rgba2float_factors); +}`,"util.glsl":`float nextPOT(in float x) { +return pow(2.0, ceil(log2(abs(x)))); +}`}};let jt=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,i=new Map){if(i.has(e))return i.get(e);const t=this._read(e);if(!t)throw new Error(`cannot find shader file ${e}`);const n=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=n.exec(t);const o=[];for(;s!=null;)o.push({path:s[1],start:s.index,length:s[0].length}),s=n.exec(t);let a=0,r="";return o.forEach(l=>{r+=t.slice(a,l.start),r+=i.has(l.path)?"":this._resolve(l.path,i),a=l.start+l.length}),r+=t.slice(a),i.set(e,r),r}_read(e){return this._readFile(e)}};function Qt(u){let e=Xt;return u.split("/").forEach(i=>{e&&(e=e[i])}),e}const Zt=new jt(Qt);function z(u){return Zt.resolveIncludes(u)}function ei(u){const{options:e,value:i}=u;return typeof e[i]=="number"}function j(u){let e="";for(const i in u){const t=u[i];if(typeof t=="boolean")t&&(e+=`#define ${i} +`);else if(typeof t=="number")e+=`#define ${i} ${t.toFixed()} +`;else if(typeof t=="object")if(ei(t)){const{value:n,options:s,namespace:o}=t,a=o?`${o}_`:"";for(const r in s)e+=`#define ${a}${r} ${s[r].toFixed()} +`;e+=`#define ${i} ${a}${n} +`}else{const n=t.options;let s=0;for(const o in n)e+=`#define ${n[o]} ${(s++).toFixed()} +`;e+=`#define ${i} ${n[t.value]} +`}}return e}const Te=u=>j({ID:u.id,PATTERN:u.pattern}),ti={shaders:u=>({vertexShader:Te(u)+z("background/background.vert"),fragmentShader:Te(u)+z("background/background.frag")})},Pe=u=>j({ID:u.id}),ii={shaders:u=>({vertexShader:Pe(u)+z("circle/circle.vert"),fragmentShader:Pe(u)+z("circle/circle.frag")})},Ie=u=>j({ID:u.id,PATTERN:u.pattern}),ni={shaders:u=>({vertexShader:Ie(u)+z("fill/fill.vert"),fragmentShader:Ie(u)+z("fill/fill.frag")})},Me=u=>j({ID:u.id}),si={shaders:u=>({vertexShader:Me(u)+z("outline/outline.vert"),fragmentShader:Me(u)+z("outline/outline.frag")})},Re=u=>j({ID:u.id,SDF:u.sdf}),oi={shaders:u=>({vertexShader:Re(u)+z("icon/icon.vert"),fragmentShader:Re(u)+z("icon/icon.frag")})},De=u=>j({ID:u.id,PATTERN:u.pattern,SDF:u.sdf}),ai={shaders:u=>({vertexShader:De(u)+z("line/line.vert"),fragmentShader:De(u)+z("line/line.frag")})},Ce=u=>j({ID:u.id}),ri={shaders:u=>({vertexShader:Ce(u)+z("text/text.vert"),fragmentShader:Ce(u)+z("text/text.frag")})};let li=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getMaterialProgram(e,i,t){const n=i.key<<3|this._getMaterialOptionsValue(i.type,t);if(this._programByKey.has(n))return this._programByKey.get(n);const s=this._getProgramTemplate(i.type),{shaders:o}=s,{vertexShader:a,fragmentShader:r}=o(t),l=i.getShaderHeader(),h=i.getShaderMain(),d=a.replace("#pragma header",l).replace("#pragma main",h),f=e.programCache.acquire(d,r,i.getAttributeLocations());return this._programByKey.set(n,f),f}_getMaterialOptionsValue(e,i){switch(e){case A.BACKGROUND:{const t=i;return(t.pattern?1:0)<<1|(t.id?1:0)}case A.FILL:{const t=i;return(t.pattern?1:0)<<1|(t.id?1:0)}case A.OUTLINE:return i.id?1:0;case A.LINE:{const t=i;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1|(t.id?1:0)}case A.ICON:{const t=i;return(t.sdf?1:0)<<1|(t.id?1:0)}case A.CIRCLE:return i.id?1:0;case A.TEXT:return i.id?1:0;default:return 0}}_getProgramTemplate(e){switch(e){case A.BACKGROUND:return ti;case A.CIRCLE:return ii;case A.FILL:return ni;case A.ICON:return oi;case A.LINE:return ai;case A.OUTLINE:return si;case A.TEXT:return ri;default:return null}}};const Z=1e-6;class Ee{constructor(e,i){this.spriteMosaic=e,this.glyphMosaic=i,this._brushCache=new Map,this._vtlMaterialManager=new li}dispose(){this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache=null),this._vtlMaterialManager=Oe(this._vtlMaterialManager),this.spriteMosaic.dispose(),this.glyphMosaic.dispose()}get vectorTilesMaterialManager(){return this._vtlMaterialManager}drawSymbols(e,i,t){const n=t.layers;e.renderPass="translucent";for(let s=0;sr+Z||o.maxzoom!==void 0&&o.maxzoom<=r-Z||(e.styleLayerUID=o.uid,e.styleLayer=o,this._drawWithBrush(e,i,"vtlSymbol"))}}drawBackground(e,i,t){if(t.backgroundBucketIds.length===0)return;const{context:n,displayLevel:s,requiredLevel:o}=e;i.key.level=o,n.setBlendingEnabled(!0),n.setDepthTestEnabled(!1),n.setStencilTestEnabled(!1),e.renderPass="background",t.backgroundBucketIds.forEach(a=>{const r=t.getLayerById(a);if(r.type!==K.BACKGROUND)return;const l=r.getLayoutProperty("visibility");l&&l.getValue()===ae.NONE||r.minzoom!==void 0&&r.minzoom>s+Z||r.maxzoom!==void 0&&r.maxzoom<=s-Z||(e.styleLayerUID=r.uid,e.styleLayer=r,this._drawWithBrush(e,i,"vtlBackground"))})}drawTile(e,i,t,n){const{context:s}=e,o=t.layers;s.setBlendingEnabled(!1),s.setDepthTestEnabled(!0),s.setDepthWriteEnabled(!0),s.setDepthFunction(V.LEQUAL),e.renderPass="opaque";for(let a=o.length-1;a>=0;a--){const r=o[a];n!=null&&n!==r.type||this._renderStyleLayer(r,e,i,!1)}s.setDepthWriteEnabled(!1),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(oe.ONE,oe.ONE_MINUS_SRC_ALPHA,oe.ONE,oe.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let a=0;ar+Z||e.maxzoom!==void 0&&e.maxzoom<=r-Z)return;const{context:l}=i;l.setStencilTestEnabled(!1),l.setStencilWriteMask(0),i.styleLayerUID=e.uid,i.styleLayer=e,this._drawWithBrush(i,t,a)}_drawWithBrush(e,i,t){if(!this._brushCache.has(t)){const n=Yt[t];this._brushCache.set(t,new n)}this._brushCache.get(t).drawMany(e,[i])}}let O=class extends Tt(St(Pt)){constructor(){super(...arguments),this._tileHandlerController=null,this.type="vector-tile-3d",this.levelShift=_e("disable-feature:vtl-level-shift")?0:1}initialize(){if(this.layer.fullExtent==null)return void this.addResolvingPromise(Promise.reject(new dt("vectortilelayerview:full-extent-undefined","This layer view's layer does not define a fullExtent.")));const{basemapTerrain:u,spatialReference:e,state:i,viewingMode:t}=this.view,n=t==="local"&&!ft(e)||_t.force512VTL,s=this.layer.tileInfo.spatialReference.isGeographic,o=n?this.layer.tileInfo:this.layer.tileInfo.getOrCreateCompatible(256,s?1:2),a=this._getTileInfoSupportError(o,this.layer.fullExtent);if(a!=null)return this.addResolvingPromise(Promise.reject(a));const r=mt(()=>{var _,p;return(p=(_=this.view)==null?void 0:_.basemapTerrain)==null?void 0:p.tilingSchemeLocked}).then(()=>{var w,y,S;const _=u.tilingScheme,p=_.pixelSize,v=p===256?1:2,P=(w=u.spatialReference)!=null&&w.isGeographic&&p===256?1:0,I=(y=u.spatialReference)!=null&&y.isGeographic||p!==256?0:1;let x;if(this.schemaHelper=new It(v,P,this.levelShift+I),p===256){const M=this.layer.tileInfo.spatialReference.isGeographic;x=this.layer.tileInfo.getOrCreateCompatible(256,M?1:2)}else x=(S=this.view.spatialReference)!=null&&S.isGeographic?this.layer.tileInfo.getOrCreateCompatible(512,.5):this.layer.tileInfo;const b=this._getTileInfoCompatibilityError(x,_);if(b)throw b;this.tileInfo=x});this._tileHandlerController=new AbortController;const l=this.view.resourceController;this._memCache=l.memoryController.newCache(`vtl-${this.layer.uid}`,_=>{_.release()}),this.addHandles(pt(()=>this.view.qualitySettings.memoryLimit,_=>this._memCache.maxSize=Math.ceil(_/10*1048576),gt));const h=new ye(this.layer.currentStyleInfo.style);this._tileHandler=new be(this.layer,h,i.contentPixelRatio,this._memCache);const d=this._tileHandlerController.signal,f=ci(l),c=this._tileHandler.start({signal:d,schedule:f}),g=this._tileHandler.spriteMosaic;g.then(_=>{!yt(d)&&this._tileHandler&&(this.painter=new Ee(_,this._tileHandler.glyphMosaic))}),c.then(()=>this._tileHandlerController=null),this._updatingHandles.add(()=>{var _;return{style:this.layer.currentStyleInfo.style,pixelRatio:(_=this.view.state)==null?void 0:_.contentPixelRatio}},({style:_,pixelRatio:p})=>{this._tileHandlerController&&this._tileHandlerController.abort(),this._tileHandlerController=new AbortController,this._memCache.clear();const v=new ye(_),P=new be(this.layer,v,p,this._memCache),I=P.start({signal:this._tileHandlerController.signal,schedule:f}),x=P.spriteMosaic;I.then(()=>this._tileHandlerController=null),this._updatingHandles.addPromise(Promise.all([I,x]).then(([,b])=>{const w=this._tileHandler,y=this.painter;this.painter=new Ee(b,P.glyphMosaic),this._tileHandler=P,this.emit("data-changed"),w.destroy(),y&&y.dispose()}))});const m=Promise.all([r,c,g]);this.addResolvingPromise(m)}destroy(){this.painter=Oe(this.painter),this._tileHandlerController=ze(this._tileHandlerController),this._tileHandler=me(this._tileHandler),this._memCache=me(this._memCache)}get contentZoom(){return _e("disable-feature:vtl-level-shift")?1:this.view.qualitySettings.tiledSurface.vtlContentZoom}get displayLevelRange(){const u=this.tileInfo.lods,e=this.layer.minScale||u[0].scale,i=this.layer.maxScale||u[u.length-1].scale,t=this.levelRangeFromScaleRange(e,i);return this.layer.maxScale?t.maxLevel++:t.maxLevel+=this.levelShift,t}get dataScaleRange(){const u=this.tileInfo.lods;return{minScale:u[0].scale,maxScale:u[u.length-1].scale}}get dataLevelRange(){const{minScale:u,maxScale:e}=this.dataScaleRange,i=this.levelRangeFromScaleRange(u,e);return i.minLevel===1&&this.tileInfo.size[0]===256&&(i.minLevel=0),i.maxLevel+=this.levelShift,i}async fetchTile(u,e,i,t){return this._tileHandler.getVectorTile(u,e,i,t)}};q([B()],O.prototype,"layer",void 0),q([B()],O.prototype,"levelShift",void 0),q([B()],O.prototype,"contentZoom",null),q([B()],O.prototype,"displayLevelRange",null),q([B()],O.prototype,"tileInfo",void 0),q([B()],O.prototype,"dataScaleRange",null),q([B()],O.prototype,"dataLevelRange",null),q([B()],O.prototype,"updatingProgressValue",void 0),O=q([vt("esri.views.3d.layers.VectorTileLayerView3D")],O);const Wi=O;function ci(u){return e=>u.immediate.schedule(e)}export{Wi as default}; diff --git a/dist/assets/VertexSnappingCandidate-sgrBHAMS.js b/dist/assets/VertexSnappingCandidate-sgrBHAMS.js new file mode 100644 index 0000000..c7447eb --- /dev/null +++ b/dist/assets/VertexSnappingCandidate-sgrBHAMS.js @@ -0,0 +1 @@ +import{gA as r,gB as s}from"./index-J0iiHjMT.js";import{n}from"./PointSnappingHint-ULetRXiW.js";class a extends r{constructor(t){super({...t,constraint:new s(t.targetPoint)})}get hints(){return[new n(this.targetPoint,this.isDraped,this.domain)]}}export{a as r}; diff --git a/dist/assets/VerticesVisualElement-oQAA_hbc.js b/dist/assets/VerticesVisualElement-oQAA_hbc.js new file mode 100644 index 0000000..1094751 --- /dev/null +++ b/dist/assets/VerticesVisualElement-oQAA_hbc.js @@ -0,0 +1 @@ +import{h$ as u,i0 as x,b2 as O,i1 as d,b4 as _,b5 as v,bq as z,as as g,i2 as p,aa as S,i3 as G}from"./index-J0iiHjMT.js";import{a as y}from"./Object3DVisualElement-TMb7y_wl.js";import{j as m}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";function P(a,e,r,o,n){const t=u(3*a.length),h=u(t.length);a.forEach((s,c)=>{t[3*c]=s[0],t[3*c+1]=s[1],t[3*c+2]=s.length>2?s[2]:0});const l=x(t,e,0,h,0,t,0,t.length/3,r,o,n),i=l!=null;return{numVertices:a.length,position:t,mapPositions:h,projectionSuccess:i,sampledElevation:l}}class w extends y{constructor(e){super(e),this.view=null,this._renderOccluded=O.OccludeAndTransparent,this._vertices=null,this._spatialReference=null,this._color=d([1,127/255,0,1]),this._size=11,this._outlineColor=d([0,0,0,.5]),this._outlineSize=1,this._elevationInfo=null,this.applyProperties(e)}get renderOccluded(){return this._renderOccluded}set renderOccluded(e){e!==this._renderOccluded&&(this._renderOccluded=e,this._updateMaterial(),this._updateOutlineMaterial())}get vertices(){return this._vertices}set vertices(e){this._vertices=e,this.recreateGeometry()}get spatialReference(){return this._spatialReference}set spatialReference(e){this._spatialReference=e,this.recreateGeometry()}get color(){return this._color}set color(e){_(e,this._color)||(v(this._color,e),this._updateMaterial())}get size(){return this._size}set size(e){e!==this._size&&(this._size=e,this._updateMaterial())}get outlineColor(){return this._outlineColor}set outlineColor(e){_(e,this._outlineColor)||(v(this._outlineColor,e),this._updateOutlineMaterial())}get outlineSize(){return this._outlineSize}set outlineSize(e){e!==this._outlineSize&&(this._outlineSize=e,this._updateOutlineMaterial())}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this.recreateGeometry()}get _vertexMaterialParameters(){return{color:this._color,screenSizeScale:this.size,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}get _vertexOutlineMaterialParameters(){return{color:this._outlineColor,screenSizeScale:this.size+2*this.outlineSize,renderOccluded:this._renderOccluded,isDecoration:this.isDecoration}}_updateMaterial(){this.attached&&this._vertexMaterial.setParameters(this._vertexMaterialParameters)}_updateOutlineMaterial(){this.attached&&this._vertexOutlineMaterial.setParameters(this._vertexOutlineMaterialParameters)}_createRenderGeometries(){const e=this.vertices;if(e==null||e.length===0)return[];const r=.5,o=.5,n=P(e,this.spatialReference,this.view.elevationProvider,this.view.renderCoordsHelper,z.fromElevationInfo(this.elevationInfo)),t=[],h=n.numVertices,l=n.position;for(let i=0;it.view.ready,s=>{this._resourcesCreated&&(s?this._createResources():this._destroyResources())})}applyProperties(t){let s=!1;for(const e in t)e in this?e==="attached"?s=t[e]:this[e]=t[e]:console.error("Cannot set unknown property",e);this.attached=s}destroy(){this.attached=!1,this._handle.remove()}get attached(){return this._attached}set attached(t){t!==this._attached&&this.view._stage&&(this._attached=t,this._attached&&!this._resourcesCreated?this._createResources():!this._attached&&this._resourcesCreated&&this._destroyResources(),this.onAttachedChange(t))}onAttachedChange(t){}get visible(){return this._visible}set visible(t){t!==this._visible&&(this._visible=t,this.attached&&this.updateVisibility(t))}_createResources(){this.createResources(),this._resourcesCreated=!0,this.updateVisibility(this.visible)}_destroyResources(){this.destroyResources(),this._resourcesCreated=!1}};export{a as t}; diff --git a/dist/assets/VoxelLayer-NKOtejie.js b/dist/assets/VoxelLayer-NKOtejie.js new file mode 100644 index 0000000..065562a --- /dev/null +++ b/dist/assets/VoxelLayer-NKOtejie.js @@ -0,0 +1 @@ +import{aE as $e,aF as ve,up as ae,gr as se,gq as ze,uq as ge,oY as be,ur as Be,aa as Oe,b1 as Q,dq as A,iC as z,iD as R,e as i,y as o,f6 as ee,c as d,dr as v,iz as Ce,eb as ke,ey as $,ab as E,V as c,ef as te,bm as X,c2 as Z,bI as G,Z as Re,ar as Ie,al as Ue,aU as We,us as Je,T as ne,qa as Ye,ut as Ge,at as Qe,iO as Xe,em as Ze,dM as He,dN as Ke,dO as et,dP as tt,en as it,u7 as ot,dQ as st,E as le,dT as Ne,dw as B,il as rt,dV as nt,dW as lt,dt as fe,iv as at,c7 as pt}from"./index-J0iiHjMT.js";const b=Oe(),Se=se(),xe=se(),we=se(),Te=Q(0,0,1),ut=Q(0,1,0),ct=Q(1,0,0);function O(e){$e(b,e),ve(b,b);const t=Math.atan2(b[1],b[0]),s=ae(se(),Te,-t);ze(b,b,s);const r=-1*Math.atan2(b[2],b[0]);return[ge(t)+270,ge(r)+90]}function ie(e,t){return ae(xe,Te,be(e-270)),ae(we,ut,be(t-90)),Be(Se,xe,we),$e(b,ct),ze(b,b,Se),ve(b,b),[b[0],b[1],b[2]]}let I=class extends A(v){constructor(t){super(t),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return z.normalize(R(t),0,!0)}set orientation(t){const s=ie(t,this.tilt);this._set("normal",s),this._set("orientation",t)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return z.normalize(R(s),0,!0)}set tilt(t){const s=ie(this.orientation,t);this._set("normal",s),this._set("tilt",t)}};i([o({type:Boolean,json:{write:!0}})],I.prototype,"enabled",void 0),i([o({type:String,json:{write:!0}})],I.prototype,"label",void 0),i([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(e=>z.normalize(R(e),0,!0))],I.prototype,"orientation",null),i([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(e=>z.normalize(R(e),0,!0))],I.prototype,"tilt",null),i([o({type:[Number],json:{write:!0}})],I.prototype,"normal",void 0),i([o({type:[Number],json:{write:!0}})],I.prototype,"point",void 0),I=i([d("esri.layers.voxel.VoxelSlice")],I);const oe=I;let S=class extends A(v){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return z.normalize(R(t),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[t,s]=O(this.normal);return z.normalize(R(s),0,!0)}};i([o({type:Boolean,json:{default:!0,write:!0}})],S.prototype,"enabled",void 0),i([o({type:String,json:{origins:{service:{read:Ce}},write:{enabled:!0,isRequired:!0}}}),ke({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],S.prototype,"href",void 0),i([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"id",void 0),i([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),i([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"orientation",null),i([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],S.prototype,"tilt",null),i([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"normal",void 0),i([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"point",void 0),i([o({type:[$],json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"sizeInPixel",void 0),i([o({type:[oe],json:{write:!0}})],S.prototype,"slices",void 0),i([o({type:$,json:{default:0,write:!0}})],S.prototype,"timeId",void 0),i([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],S.prototype,"variableId",void 0),S=i([d("esri.layers.voxel.VoxelSection")],S);const pe=S;let k=class extends v{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};i([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],k.prototype,"diffuseFactor",void 0),i([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],k.prototype,"specularFactor",void 0),k=i([d("esri.layers.voxel.VoxelSimpleShading")],k);const qe=k;let N=class extends v{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};i([o({type:["discrete","continuous"],json:{write:!0}})],N.prototype,"continuity",void 0),i([o({type:Boolean,json:{write:!0}})],N.prototype,"hasNoData",void 0),i([o({type:Number,json:{write:!0}})],N.prototype,"noData",void 0),i([o({type:Number,json:{write:!0}})],N.prototype,"offset",void 0),i([o({type:Number,json:{write:!0}})],N.prototype,"scale",void 0),i([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],N.prototype,"type",void 0),N=i([d("esri.layers.voxel.VoxelFormat")],N);const Ve=N;let j=class extends v{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};i([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"id",void 0),i([o({type:String,json:{write:!0}})],j.prototype,"description",void 0),i([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"name",void 0),i([o({type:Ve,json:{write:!0}})],j.prototype,"originalFormat",void 0),i([o({type:Ve,json:{write:{enabled:!0,isRequired:!0}}})],j.prototype,"renderingFormat",void 0),i([o({type:String,json:{write:!0}})],j.prototype,"unit",void 0),i([o({type:Number,json:{write:!0}})],j.prototype,"volumeId",void 0),i([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],j.prototype,"type",void 0),j=i([d("esri.layers.voxel.VoxelVariable")],j);const yt=j;let F=class extends A(v){constructor(){super(...arguments),this.color=E.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};i([o({type:E,json:{type:[$],write:{enabled:!0,isRequired:!0}}})],F.prototype,"color",void 0),i([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],F.prototype,"value",void 0),i([o({type:Boolean,json:{default:!0,write:!0}})],F.prototype,"enabled",void 0),i([o({type:String,json:{write:!0}})],F.prototype,"label",void 0),i([o({type:Boolean,json:{default:!1,write:!0}})],F.prototype,"colorLocked",void 0),F=i([d("esri.layers.voxel.VoxelIsosurface")],F);const De=F;let U=class extends A(v){constructor(){super(...arguments),this.color=null,this.position=0}};i([o({type:E,json:{type:[$],write:{enabled:!0,isRequired:!0}}})],U.prototype,"color",void 0),i([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],U.prototype,"position",void 0),U=i([d("esri.layers.voxel.VoxelColorStop")],U);const ue=U;let W=class extends A(v){constructor(){super(...arguments),this.opacity=1,this.position=0}};i([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],W.prototype,"opacity",void 0),i([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],W.prototype,"position",void 0),W=i([d("esri.layers.voxel.VoxelOpacityStop")],W);const ce=W;let J=class extends A(v){constructor(){super(...arguments),this.enabled=!1,this.range=null}};i([o({type:Boolean,json:{default:!1,write:!0}})],J.prototype,"enabled",void 0),i([o({type:[Number],json:{write:!0}})],J.prototype,"range",void 0),J=i([d("esri.layers.voxel.VoxelRangeFilter")],J);const dt=J;var V;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(V||(V={}));let T=class extends A(v){constructor(t){super(t),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(ue)),this.opacityStops=new(c.ofType(ce))}set colorStops(t){this._set("colorStops",te(t,this._get("colorStops"),c.ofType(ue)))}set opacityStops(t){this._set("opacityStops",te(t,this._get("opacityStops"),c.ofType(ce)))}getPreviousNext(t,s,r){let n=t;for(;--n>0&&s[n].type!==r&&s[n].type!==V.Both;);let l=t;const y=s.length;for(;++lu.position{h.color[re]=Math.round(Z(C[re],Ee[re],g))})}else m!==-1?H.forEach(g=>{h.color[g]=r[m].color[g]}):H.forEach(g=>{h.color[g]=r[f].color[g]})}}for(const u of r)s.push({color:u.color,position:u.position})}s[0].position=0,s[s.length-1].position=1;let l=0,y=1;for(let p=0;ps[y].position;)l=y++;const h=(u-s[l].position)/(s[y].position-s[l].position),m=s[l].color,f=s[y].color,g=new E;H.forEach(C=>{g[C]=Math.round(Z(m[C],f[C],h))}),g.a=X(1-Z(m.a,f.a,h)/255,0,1),t.push(g)}return t}getColorForContinuousDataValue(t,s){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let n=this.stretchRange[0],l=this.stretchRange[1];if(n>l){const p=n;n=l,l=p}t=X(t,n,l);const y=r[Math.round((t-n)/(l-n)*(this._colorMapSize-1))].clone();return s||(y.a=1),y}};i([o({type:["linear","nearest"],json:{write:!0}})],T.prototype,"interpolation",void 0),i([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"stretchRange",void 0),i([o({type:c.ofType(ue),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],T.prototype,"colorStops",null),i([o({type:c.ofType(ce),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],T.prototype,"opacityStops",null),i([o({type:dt,json:{write:!0}})],T.prototype,"rangeFilter",void 0),i([o({type:[E],clonable:!1,json:{read:!1}})],T.prototype,"rasterizedTransferFunction",null),T=i([d("esri.layers.voxel.VoxelTransferFunctionStyle")],T);const ht=T,H=["r","g","b"];let M=class extends A(v){constructor(){super(...arguments),this.color=E.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};i([o({type:E,json:{type:[$],write:{enabled:!0,isRequired:!0}}})],M.prototype,"color",void 0),i([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"value",void 0),i([o({type:Boolean,json:{default:!0,write:!0}})],M.prototype,"enabled",void 0),i([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),M=i([d("esri.layers.voxel.VoxelUniqueValue")],M);const Ae=M;var ye;let L=ye=class extends v{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(Ae)),this.isosurfaces=new(c.ofType(De))}clone(){return new ye({variableId:this.variableId,label:this.label,transferFunction:G(this.transferFunction),uniqueValues:G(this.uniqueValues),isosurfaces:G(this.isosurfaces)})}};i([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],L.prototype,"variableId",void 0),i([o({type:String,json:{write:!0}})],L.prototype,"label",void 0),i([o({type:ht,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],L.prototype,"transferFunction",void 0),i([o({type:c.ofType(Ae),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],L.prototype,"uniqueValues",void 0),i([o({type:c.ofType(De),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,t=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&t}}}}})],L.prototype,"isosurfaces",void 0),L=ye=i([d("esri.layers.voxel.VoxelVariableStyle")],L);const Fe=L;let K=class extends v{constructor(){super(...arguments),this.values=null}};i([o({type:[Number],json:{write:!0}})],K.prototype,"values",void 0),K=i([d("esri.layers.voxel.VoxelIrregularSpacing")],K);const mt=K;let Y=class extends v{constructor(){super(...arguments),this.scale=1,this.offset=0}};i([o({type:Number,json:{write:!0}})],Y.prototype,"scale",void 0),i([o({type:Number,json:{write:!0}})],Y.prototype,"offset",void 0),Y=i([d("esri.layers.voxel.VoxelRegularSpacing")],Y);const vt=Y;let x=class extends v{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){var t;return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray((t=this.irregularSpacing)==null?void 0:t.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};i([o({type:mt,json:{write:!0}})],x.prototype,"irregularSpacing",void 0),i([o({type:Boolean,json:{write:!0}})],x.prototype,"isPositiveUp",void 0),i([o({type:Boolean,json:{write:!0}})],x.prototype,"isWrappedDateLine",void 0),i([o({type:String,json:{write:!0}})],x.prototype,"label",void 0),i([o({type:String,json:{write:!0}})],x.prototype,"name",void 0),i([o({type:String,json:{write:!0}})],x.prototype,"quantity",void 0),i([o({type:vt,json:{write:!0}})],x.prototype,"regularSpacing",void 0),i([o({type:Number,json:{write:!0}})],x.prototype,"size",void 0),i([o({type:String,json:{write:!0}})],x.prototype,"unit",void 0),i([o({type:Boolean,json:{read:!1}})],x.prototype,"isRegular",null),x=i([d("esri.layers.voxel.VoxelDimension")],x);const gt=x,Le="esri.layers.voxel.VoxelVolume",je=Re.getLogger(Le);let w=class extends v{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Ie.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size];return[e[0],t[0],r[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),t=this.dimensions[1].getRange(),s=this.dimensions[2],r=s.isRegular?s.getRange():[0,s.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let l=0;l<3;++l)n[l]<2?n[l]=1:n[l]-=1;return s.isRegular&&!s.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(t[1]-t[0])/n[1],(r[1]-r[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,t=this.dimensions[3].size>0;if(!e&&t)return"xyt";if(e&&t)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){var r;if(!this.isValid)return[0,0,0];if(this.volumeType==="xyt")return je.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!Ue(this.spatialReference,e.spatialReference))return je.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const t=Q(e.x,e.y,e.z??0);We(t,t,this.originInLayerSpace3D),Je(t,t,this.voxelSizeInLayerSpaceSigned);const s=this.dimensions[this.zDimension];if(!s.isRegular&&Array.isArray((r=s.irregularSpacing)==null?void 0:r.values)&&s.irregularSpacing.values.length>1){const n=e.z??0,l=s.irregularSpacing.values,y=s.isPositiveUp?1:-1,p=l.reduce((u,h)=>Math.abs(y*h-n)z.normalize(R(e),0,!0))],q.prototype,"orientation",null),i([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ee(e=>z.normalize(R(e),0,!0))],q.prototype,"tilt",null),i([o({type:[Number],json:{write:!0}})],q.prototype,"normal",void 0),i([o({type:[Number],json:{write:!0}})],q.prototype,"point",void 0),q=i([d("esri.layers.voxel.VoxelDynamicSection")],q);const he=q;var me;let D=me=class extends v{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(oe)),this.dynamicSections=new(c.ofType(he))}set slices(e){this._set("slices",te(e,this._get("slices"),c.ofType(oe)))}set dynamicSections(e){this._set("dynamicSections",te(e,this._get("dynamicSections"),c.ofType(he)))}clone(){return new me({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:G(this.slices),dynamicSections:G(this.dynamicSections)})}};i([o({type:$,json:{write:{enabled:!0,isRequired:!0}}})],D.prototype,"volumeId",void 0),i([o({type:Number,json:{default:1,write:!0}})],D.prototype,"verticalExaggeration",void 0),i([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],D.prototype,"exaggerationMode",void 0),i([o({type:Number,json:{default:0,write:!0}})],D.prototype,"verticalOffset",void 0),i([o({type:c.ofType(oe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],D.prototype,"slices",null),i([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],D.prototype,"dynamicSections",null),D=me=i([d("esri.layers.voxel.VoxelVolumeStyle")],D);const Me=D,_e="esri.layers.VoxelLayer",P=Re.getLogger(_e);let a=class extends Xe(Ze(He(Ke(et(tt(it(pt))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new qe,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.test=null,this.volumeStyles=new(c.ofType(Me)),this.variableStyles=new(c.ofType(Fe)),this.sections=new(c.ofType(pe))}normalizeCtorArgs(e){return e!=null&&e.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",ot(e,P))}load(e){const t=e!=null?e.signal:null,s=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(st).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(s),Promise.resolve(this)}read(e,t){super.read(e,t);for(const s of this.volumes)s.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new le("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new le("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new le("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,s){if(e!=null&&typeof e=="object"){const r=Ne.fromJSON(e,s);if(r.zmin===0&&r.zmax===0&&Array.isArray(t.volumes)){const n=Pe.fromJSON(t.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const l=n.dimensions[2];if(l.isRegular){let y=l.regularSpacing.offset,p=l.regularSpacing.offset+l.regularSpacing.scale*(l.size-1);if(y>p){const u=y;y=p,p=u}r.zmin=y,r.zmax=p}}}return r}return null}get voxelFields(){const e=[new B({name:"Voxel.ServiceValue",alias:"Value",domain:null,editable:!1,length:128,type:"string"}),new B({name:"Voxel.ServiceVariableLabel",alias:"Variable",domain:null,editable:!1,length:128,type:"string"}),new B({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"})],t=this.getVolume(null);if(t!=null){if(t.volumeType==="xyzt"||t.volumeType==="xyt"){const s=new B({name:"Voxel.ServiceLocalTime",alias:"Local Time",domain:null,editable:!1,length:128,type:"string"});e.push(s);const r=new B({name:"Voxel.ServiceNativeTime",alias:"Native Time",domain:null,editable:!1,length:128,type:"string"});e.push(r)}if(t.volumeType!=="xyt"){const s=new B({name:"Voxel.ServiceDepth",alias:"Depth",domain:null,editable:!1,length:128,type:"string"});e.push(s)}}return e}get popupTemplate(){return this.loaded?this.createPopupTemplate():null}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.voxelFields,s=this.title;return rt({fields:t,title:s},e)}getConfiguration(){var t,s;const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:(t=this.index)==null?void 0:t.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&((s=this.index)!=null&&s.isValid())?JSON.stringify(e):""}getVariableStyle(e){let t=-1;if(t=e??this.currentVariableId,!this.variableStyles||t===-1)return null;const s=this.variableStyles.findIndex(r=>r.variableId===t);return s<0?null:this.variableStyles.at(s)}getVariable(e){let t=-1;if(t=e??this.currentVariableId,!this.variables||t===-1)return null;const s=this.variables.findIndex(r=>r.id===t);return s<0?null:this.variables.at(s)}getVolume(e){const t=this.getVariable(e);return t!=null?this.volumes.find(({id:s})=>s===t.volumeId):null}getVolumeStyle(e){const t=this.getVariable(e);return t!=null?this.volumeStyles.find(({volumeId:s})=>s===t.volumeId):null}getColorForContinuousDataValue(e,t,s){var y;const r=this.getVariable(e);if(r==null||((y=r.renderingFormat)==null?void 0:y.continuity)!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const l=this.variableStyles.at(n);return l!=null&&l.transferFunction?l.transferFunction.getColorForContinuousDataValue(t,s):null}getSections(){const e=[];for(const t of this.sections)e.push(new pe({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const s=this._getVariable(t);if(s!=null){const r=t.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),P.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of r.isosurfaces)if(!n.colorLocked){const l=this.getColorForContinuousDataValue(r.variableId,n.value,!1);l===null||l.equals(n.color)||(n.color=l)}if(s.renderingFormat.continuity==="continuous")(r.transferFunction===null||r.transferFunction.colorStops.length<2)&&P.error(`VoxelVariableStyle for variable ${s.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),r.transferFunction!==null&&(Array.isArray(r.transferFunction.stretchRange)&&r.transferFunction.stretchRange.length===2||(P.error(`VoxelVariableStyle for variable ${s.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll()));else if(s.renderingFormat.continuity==="discrete")if(t.uniqueValues.length===0)P.error(`VoxelVariableStyle for variable ${s.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of t.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(r)}else P.error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const s=this._getVolumeFromVolumeId(t.volumeId);if(s!=null){const r=t.clone();for(const n of r.slices)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of r.dynamicSections)this._isPlaneValid(n,[0,1,s.zDimension],s.dimensions)||(n.enabled=!1,n.label="invalid");e.push(r)}else P.error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const s of this.variables)if(s.id===t)return s;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,s){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;const r=Q(e.normal[0],e.normal[1],e.normal[2]);ve(r,r);const n=1e-6;return!(Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,s){t[s]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],a.prototype,"popupEnabled",void 0),i([o({type:at,json:{read:!1}})],a.prototype,"popupTemplate",null),i([o({readOnly:!0})],a.prototype,"defaultPopupTemplate",null),a=i([d(_e)],a);const Lt=a;export{Lt as default}; diff --git a/dist/assets/VoxelLayerView3D-FruX8zyo.js b/dist/assets/VoxelLayerView3D-FruX8zyo.js new file mode 100644 index 0000000..603d958 --- /dev/null +++ b/dist/assets/VoxelLayerView3D-FruX8zyo.js @@ -0,0 +1 @@ +import{E as y,al as v,fK as T,d as l,P as E,fL as r,fM as V,fN as x,bn as A,ar as M,fO as I,aG as L,aF as D,as as P,Z as w,e as b,y as _,c as F,aa as f}from"./index-J0iiHjMT.js";import{n as $}from"./LayerView3D-iOx2MD1g.js";import{i as C}from"./PopupSceneLayerView-cRxapYqF.js";import{u as R}from"./LayerView-efDufa6j.js";var a;(function(e){e[e.API=1]="API",e[e.VerboseAPI=2]="VerboseAPI",e[e.Error=3]="Error"})(a||(a={}));const h=f(),S=f();let u=class extends C($(R)){constructor(){super(...arguments),this._suspendedHandle=null,this._usedMemory=0,this._futureMemory=0,this.type="voxel-3d",this.slicePlaneEnabled=!1,this._wasmLayerId=-1,this.ignoresMemoryFactor=!0,this._dbgFlags=new Set}get baseUrl(){var e;return((e=this.layer.parsedUrl)==null?void 0:e.path)??""}get wasmLayerId(){return this._wasmLayerId}initialize(){var c;if(this._dbgFlags.add(a.Error),this.view.viewingMode!=="local")throw new y("voxel:unsupported-viewingMode","Voxel layers support local viewingMode only.",{});if(!((c=this.view._stage.renderView.renderingContext.capabilities.colorBufferFloat)!=null&&c.textureFloat))throw new y("voxel:missing-color-buffer-float","Voxel layers require the WebGL2 extension EXT_color_buffer_float",{});const e=this.layer.spatialReference;if(!v(e,this.view.spatialReference))throw new y("layerview:spatial-reference-incompatible","The spatial reference of this scene layer is incompatible with the spatial reference of the view",{});const s=this.layer.currentVariableId,i=this.layer.getVolume(s),o=this.layer.getVariable(s);if(i!=null&&o!=null){const d=i.dimensions[0],t=i.dimensions[1],m=i.zDimension;if(m>1){const g=i.dimensions[m],W=d.size*t.size*g.size;let p=1;switch(o.renderingFormat.type){case"Int16":case"UInt16":p=2;break;case"Int32":case"UInt32":case"Float32":p=4}this._futureMemory=p*W}}const n=T(this).then(d=>{this._wasmLayerId=d,this._suspendedHandle=l(()=>this.suspended,t=>{const m=r(this.view);m&&m.setEnabled(this,!t)},E),this.addHandles([l(()=>this.layer.renderMode,t=>this._pushRenderModeToWasm(t)),l(()=>this.layer.currentVariableId,t=>this._pushCurrentVariableIdToWasm(t)),l(()=>this.layer.getSections(),t=>this._pushSectionsToWasm(t)),l(()=>this.layer.getVariableStyles(),t=>this._pushVariableStylesToWasm(t)),l(()=>this.layer.getVolumeStyles(),t=>this._pushVolumeStylesToWasm(t)),l(()=>this.layer.enableDynamicSections,t=>this._pushEnableDynamicSectionsToWasm(t)),l(()=>this.layer.enableIsosurfaces,t=>this._pushEnableIsosurfacesToWasm(t)),l(()=>this.layer.enableSections,t=>this._pushEnableSectionsToWasm(t)),l(()=>this.layer.enableSlices,t=>this._pushEnableSlicesToWasm(t)),l(()=>this.slicePlaneEnabled,t=>this._pushAnalysisSliceToWasm(t,this.view.slicePlane)),l(()=>this.view.slicePlane,t=>this._pushAnalysisSliceToWasm(this.slicePlaneEnabled,t))])}).catch(d=>{if(V(this),this._wasmLayerId=-1,d===-1)throw new y("voxel:addLayer-failure","The voxel layer description was invalid.",{});if(d===-2)throw new y("voxel:addLayer-failure","The voxel layer web assembly module failed to download.",{})});this.addResolvingPromise(n)}destroy(){V(this),this._suspendedHandle&&(this._suspendedHandle.remove(),this._suspendedHandle=null)}isUpdating(){const e=r(this.view);return!(this._wasmLayerId<0||e==null)&&e.isUpdating(this._wasmLayerId)}updatingFlagChanged(){this.notifyChange("updating")}get usedMemory(){return this._usedMemory}get unloadedMemory(){return this._futureMemory}get performanceInfo(){return{nodes:0,displayedNumberOfFeatures:0,maximumNumberOfFeatures:0,totalNumberOfFeatures:0,core:null}}whenGraphicBounds(e,s){const i=e.attributes["Voxel.WorldPosition"];if(i){const o=x(),n=JSON.parse(i);if(A(n,this.view.renderSpatialReference,S,this.view.spatialReference||M.WGS84))return I(o,S),Promise.resolve({boundingBox:o,screenSpaceObjects:[]})}return Promise.reject()}setUsedMemory(e){this._usedMemory=e,this._futureMemory=0}captureFrustum(){const e=r(this.view);e==null||e.captureFrustum()}toggleFullVolumeExtentDraw(){const e=r(this.view);e==null||e.toggleFullVolumeExtentDraw(this)}getLayerTimes(){const e=r(this.view);return(e==null?void 0:e.getLayerTimes(this))??[]}getCurrentLayerTimeIndex(){const e=r(this.view);return(e==null?void 0:e.getCurrentLayerTimeIndex(this))??0}_pushRenderModeToWasm(e){const s=r(this.view);this._dbg(a.VerboseAPI,"VoxelLayerView3D._pushRenderModeToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s!=null&&s.setRenderMode(this,e)||this._dbg(a.Error,"VoxelLayerView3D._pushRenderModeToWasm() failed!")}_pushSectionsToWasm(e){const s=r(this.view);this._dbg(a.VerboseAPI,"VoxelLayerView3D._pushSectionsToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s!=null&&s.setStaticSections(this,e)||this._dbg(a.Error,"VoxelLayerView3D._pushSectionsToWasm() failed!")}_pushCurrentVariableIdToWasm(e){const s=r(this.view);this._dbg(a.VerboseAPI,"VoxelLayerView3D._pushCurrentVariableIdToWasm() called!, "+(s?"have WASM":"don't have WASM!!!")),s!=null&&s.setCurrentVariable(this,e)||this._dbg(a.Error,"VoxelLayerView3D._pushCurrentVariableIdToWasm() failed!")}_pushVariableStylesToWasm(e){const s=r(this.view);this._dbg(a.VerboseAPI,"VoxelLayerView3D._pushVariableStylesToWasm() called, "+(s?"have WASM":"don't have WASM!!!")),s!=null&&s.setVariableStyles(this,e)||this._dbg(a.Error,"VoxelLayerView3D._pushVariableStylesToWasm() failed!")}_accountForEnableSlices(e,s){const i=s??this.layer.enableSlices;for(let o=0;o$(()=>import("./vxlLayer-oRewqFuR.js"),__vite__mapDeps([0,1,2])).then(i=>i.v).then(({default:i})=>{const s=i({locateFile:he,preinitializedWebGLContext:e,onRuntimeInitialized:()=>t(s)})})).catch(t=>{throw t})}function he(e){return q(`esri/libs/vxl/${e}`)}const v=O.getLogger("esri.layers.VoxelWasmPerSceneView");var o;(function(e){e[e.Lifetime=1]="Lifetime",e[e.RequestResponse=2]="RequestResponse",e[e.Rendering=3]="Rendering",e[e.Error=4]="Error"})(o||(o={}));let E=class extends z{constructor(e){super(e),this._halfIntTexturesAvailable=!1,this._textureFloatLinearAvailable=!1,this._havePreparedWithAllLayers=!1,this._renderPluginContext=null,this._vxlPromise=null,this._vxl=null,this._pluginIsActive=!1,this._moreToLoad=!1,this._viewportWidth=-1,this._viewportHeight=-1,this._newLayers=[],this._layers=new Map,this._rctx=null,this._renderTargetToRestore=null,this._lastFrameWasStationary=!1,this._wasmMemBlockSizes=[512,1024,2048,4096,8192,16384,32768,65536],this._wasmMemBlocks=new Map,this._dbgFlags=new Set,this._captureFrustum=!1,this._frustum=null,this._frustumRenderableId=-1,this._renderCoordsHelper=null,this.produces=new Map([[j.VOXEL,()=>!!this._vxl&&this.view.viewingMode==="local"]]),this.type=H.VOXEL,this.slicePlaneEnabled=!0,this.isGround=!1,this.layerUid=[]}_dbg(e,t){this._dbgFlags.has(e)&&(e===o.Error?v.error(t):v.warn(t))}_removeRenderPlugin(){this._pluginIsActive&&this.view._stage&&(this._dbg(o.Lifetime,"--removeRenderPlugin--"),this.view._stage.removeRenderPlugin(this)),this._pluginIsActive=!1}initialize(){this._dbg(o.Lifetime,"--initialize--");for(const e of this._wasmMemBlockSizes)this._wasmMemBlocks.set(e,0);this.addHandles([L(()=>this.view.ready,e=>{e&&this.view.viewingMode==="local"?(this._dbg(o.Lifetime,"view ready status changed to ready on a local view, calling addRenderPlugin"),this.view._stage.addRenderPlugin(this),this._pluginIsActive=!0):(this._dbg(o.Lifetime,"view ready status changed, not ready or not a local view!"),this._removeRenderPlugin())},F),L(()=>{var e;return(e=this.view)==null?void 0:e.qualityProfile},e=>{this._dbg(o.Rendering,"qualityProfile changed to "+e),this._vxl&&this._vxl.set_quality(this._toWasmQuality(e))},F),L(()=>{var e;return(e=this.view)==null?void 0:e.timeExtent},()=>{var e;if(this._vxl){const t=this._getTimeArgs((e=this.view)==null?void 0:e.timeExtent);this._dbg(o.Rendering,"sceneView timeExtent changed to useTime="+t.useTime+" st="+t.startTime+" et="+t.endTime),this._vxl.set_scene_time_extent(t.startTime,t.endTime,t.useTime),this._renderPluginContext.requestRender()}},F),L(()=>{var e;return(e=this.view)==null?void 0:e.stationary},e=>{this._vxl&&e&&!this._lastFrameWasStationary&&this._renderPluginContext.requestRender()})])}initializeRenderContext(e){this._dbg(o.Lifetime,"--initializeRenderContext--");const t=e.renderContext.rctx;t.type===G.WEBGL2?(this._renderPluginContext=e,this._rctx=e.renderContext.rctx,this._halfIntTexturesAvailable=!!this._rctx.capabilities.textureNorm16,this._textureFloatLinearAvailable=this._rctx.capabilities.textureFloatLinear,this._initializeWasm(t.gl)):this._dbg(o.Error,"WebGL 1 context only!")}uninitializeRenderContext(){this._renderPluginContext=null,this._rctx=null,this._dbg(o.Lifetime,"--uninitializeRenderContext--")}_restoreFramebuffer(){if(!this._renderTargetToRestore)return;const e=this._renderTargetToRestore.fbo;if(!this._rctx)return void this._dbg(o.Error,"no context in restoreFramebuffer!");this._rctx.bindFramebuffer(e,!0);const t=this._renderTargetToRestore.viewport;this._rctx.setViewport(t.x,t.y,t.width,t.height)}_bindPreviousDepthToSlot(e,t){const i=!!this._rctx,s=!!this._renderTargetToRestore;if(!i||!s)return 0;const a=this._renderTargetToRestore.fbo.depthStencilTexture;return a?(t===0?this._rctx.bindTexture(null,e,!0):this._rctx.bindTexture(a,e,!0),1):(this._dbg(o.Error,"no depth/stencil texture exists!"),0)}_modifyResourceCount(e,t,i){if(!this._rctx)return void this._dbg(o.Error,"modifyAllocation callback has no rendering context!");const s=e;i===1?this._rctx.instanceCounter.increment(s,t):this._rctx.instanceCounter.decrement(s,t)}_setBlendState(e,t,i,s){this._rctx?(this._rctx.setBlendingEnabled(e===1),this._rctx.setBlendFunction(t,i),this._rctx.setBlendEquation(s)):this._dbg(o.Error,"setBlendState callback has no rendering context!")}_setFrontFace(e){this._rctx?this._rctx.setFrontFace(e):this._dbg(o.Error,"setFrontFace callback has no rendering context!")}_setDepthStencilStateFunction(e,t,i){this._rctx?(this._rctx.setDepthFunction(i),this._rctx.setDepthTestEnabled(e===1),this._rctx.setDepthWriteEnabled(t===1),this._rctx.setStencilTestEnabled(!1),this._rctx.setStencilFunction(X.ALWAYS,0,255),this._rctx.setStencilOpSeparate(V.FRONT,b.KEEP,b.INCR,b.KEEP),this._rctx.setStencilOpSeparate(V.BACK,b.KEEP,b.DECR,b.KEEP)):this._dbg(o.Error,"setDepthStencilStateFunction callback has no rendering context!")}_setRasterizerState(e){if(this._rctx)switch(e){case w.None:this._rctx.setFaceCullingEnabled(!1);break;case w.Back:this._rctx.setCullFace(V.BACK),this._rctx.setFaceCullingEnabled(!0);break;case w.Front:this._rctx.setCullFace(V.FRONT),this._rctx.setFaceCullingEnabled(!0)}else this._dbg(o.Error,"setRasterizerState callback has no rendering context!")}_setViewport(e,t,i,s){this._rctx?this._rctx.setViewport(e,t,i,s):this._dbg(o.Error,"setViewport callback has no rendering context!")}_updateMemoryUsage(){this._layers.forEach((e,t)=>{if(e.needMemoryUsageUpdate){const i=this._vxl.estimate_memory_usage(t);i>=0&&(e.needMemoryUsageUpdate=!1,e.layerView.setUsedMemory(i))}})}_syncRequestsResponses(){this._layers.forEach((e,t)=>{const i=[];e.responses.forEach((r,u)=>{i.push(u),this._dbg(o.RequestResponse,"responding for requestID:"+u+" size:"+r.size),this._vxl.respond(t,u,r),r.requestType!==C.TreeIndex&&r.requestType!==C.Section||(e.needMemoryUsageUpdate=!0)});const s=e.responses;for(const r of i)s.delete(r);const a=this._vxl.get_new_requests(t),n=e.abortController.signal;for(const r in a){e.outstandingRequestCount+=1,e.outstandingRequestCount===1&&e.layerView.updatingFlagChanged();const u=a[r],g={responseType:"array-buffer",signal:n};this._dbg(o.RequestResponse,"making requestID:"+r+" url:"+u.url),Y(u.url,g).then(h=>{e.outstandingRequestCount-=1,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),this._dbg(o.RequestResponse,"have response for requestID:"+r);let _=0;if(h.data.byteLength>0){_=this._vxl._malloc(h.data.byteLength);const d=new Uint8Array(this._vxl.HEAPU8.buffer,_,h.data.byteLength),m=new Uint8Array(h.data);for(let f=0;f{e.outstandingRequestCount-=1,e.outstandingRequestCount===0&&e.layerView.updatingFlagChanged(),K(h)||(this._dbg(o.Error,`requestID:${r} failed, error=${h.toString()}`),s.set(+r,{responseType:u.responseType,ptr:0,size:0,success:!1,requestType:u.requestType}))})}})}updateWasmCamera(e){this._vxl.set_projection_matrix.apply(this._vxl,e.projectionMatrix),this._vxl.set_view_matrix.apply(this._vxl,e.viewMatrix),this._vxl.set_near_far(e.near,e.far)}isUpdating(e){if(!this._vxl&&this._vxlPromise)return!0;const t=this._layers.get(e);return!!t&&t.outstandingRequestCount>0}getLayerTimes(e){const t=[];return this._layers.forEach((i,s)=>{if(i.layerView.wasmLayerId===e.wasmLayerId){const a=this._vxl.get_layer_epoch_times(s,e.layer.currentVariableId);for(let n=0;n{i.layerView.wasmLayerId===e.wasmLayerId&&(t=this._vxl.get_layer_current_time_id(s))}),t}setEnabled(e,t){this._layers.forEach((i,s)=>{i.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.set_enabled(s,t),i.needMemoryUsageUpdate=!0,this._renderPluginContext.requestRender())})}setStaticSections(e,t){const i={mask:x.StaticSections,staticSections:t};return this._doMaskedUIUpdate(e,i,!0)}setCurrentVariable(e,t){const i={mask:x.CurrentVariable,currentVariable:t};return this._doMaskedUIUpdate(e,i,!0)}setRenderMode(e,t){const i={mask:x.RenderMode,renderMode:t};return this._doMaskedUIUpdate(e,i,!0)}setVerticalExaggerationAndOffset(e,t,i,s){const a={mask:x.ExaggerationAndOffset,volStyleDesc:{volumeId:t,verticalExaggeration:i,verticalOffset:s}};return this._doMaskedUIUpdate(e,a,!0)}setVariableStyles(e,t){const i={mask:x.VariableStyles,variableStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setVolumeStyles(e,t){const i={mask:x.VolumeStyles,volumeStyles:t};return this._doMaskedUIUpdate(e,i,!0)}setEnableDynamicSections(e,t){const i={mask:x.ContainerVisibility,containerIsVisible:t,container:S.DynamicSections};return this._doMaskedUIUpdate(e,i,!0)}setEnableIsosurfaces(e,t){const i={mask:x.ContainerVisibility,containerIsVisible:t,container:S.Isosurfaces};return this._doMaskedUIUpdate(e,i,!0)}setEnableSections(e,t){const i={mask:x.ContainerVisibility,containerIsVisible:t,container:S.StaticSections};return this._doMaskedUIUpdate(e,i,!0)}setAnalysisSlice(e,t,i,s){const a={mask:x.AnalysisSlice,analysisSlice:{point:i,normal:s,enabled:t}};return this._doMaskedUIUpdate(e,a,!0)}_doMaskedUIUpdate(e,t,i){if(!this._vxl)return!1;let s=!1;return this._layers.forEach((a,n)=>{if(a.layerView.wasmLayerId===e.wasmLayerId){const r={str:JSON.stringify(t),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(r)&&(s=this._vxl.handle_masked_ui_update(n,r.ptr,r.byteCount)===1,r.isReusable||this._vxl._free(r.ptr))}}),s&&i&&this._renderPluginContext.requestRender(),s}_addTriangleToWasmBuffer(e,t,i,s,a){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],e[3*(t+=1)]=s[0],e[3*t+1]=s[1],e[3*t+2]=s[2],e[3*(t+=1)]=a[0],e[3*t+1]=a[1],e[3*t+2]=a[2],t+=1}_addNormalToWasmBuffer(e,t,i){return e[3*t]=i[0],e[3*t+1]=i[1],e[3*t+2]=i[2],t+=1}_doCaptureFrustum(){if(!this._vxl)return;const e=36,t=e/3,i=this._vxl._malloc(3*e*Float32Array.BYTES_PER_ELEMENT),s=new Float32Array(this._vxl.HEAPF32.buffer,i,3*e),a=this._vxl._malloc(3*t*Float32Array.BYTES_PER_ELEMENT),n=new Float32Array(this._vxl.HEAPF32.buffer,a,e),r=this._frustum.points[p.NEAR_BOTTOM_LEFT],u=this._frustum.points[p.NEAR_BOTTOM_RIGHT],g=this._frustum.points[p.NEAR_TOP_RIGHT],h=this._frustum.points[p.NEAR_TOP_LEFT],_=this._frustum.points[p.FAR_BOTTOM_LEFT],d=this._frustum.points[p.FAR_BOTTOM_RIGHT],m=this._frustum.points[p.FAR_TOP_RIGHT],f=this._frustum.points[p.FAR_TOP_LEFT];let l=0,c=0;const y=this._frustum.planes[T.NEAR];l=this._addTriangleToWasmBuffer(s,l,g,u,r),c=this._addNormalToWasmBuffer(n,c,y),l=this._addTriangleToWasmBuffer(s,l,r,h,g),c=this._addNormalToWasmBuffer(n,c,y);const R=this._frustum.planes[T.FAR];l=this._addTriangleToWasmBuffer(s,l,_,d,m),c=this._addNormalToWasmBuffer(n,c,R),l=this._addTriangleToWasmBuffer(s,l,m,f,_),c=this._addNormalToWasmBuffer(n,c,R);const I=this._frustum.planes[T.TOP];l=this._addTriangleToWasmBuffer(s,l,m,g,h),c=this._addNormalToWasmBuffer(n,c,I),l=this._addTriangleToWasmBuffer(s,l,h,f,m),c=this._addNormalToWasmBuffer(n,c,I);const k=this._frustum.planes[T.BOTTOM];l=this._addTriangleToWasmBuffer(s,l,r,u,d),c=this._addNormalToWasmBuffer(n,c,k),l=this._addTriangleToWasmBuffer(s,l,d,_,r),c=this._addNormalToWasmBuffer(n,c,k);const B=this._frustum.planes[T.LEFT];l=this._addTriangleToWasmBuffer(s,l,h,r,_),c=this._addNormalToWasmBuffer(n,c,B),l=this._addTriangleToWasmBuffer(s,l,_,f,h),c=this._addNormalToWasmBuffer(n,c,B);const U=this._frustum.planes[T.RIGHT];l=this._addTriangleToWasmBuffer(s,l,g,m,d),c=this._addNormalToWasmBuffer(n,c,U),l=this._addTriangleToWasmBuffer(s,l,d,u,g),c=this._addNormalToWasmBuffer(n,c,U),this._frustumRenderableId!==-1&&this._vxl.remove_generic_mesh(this._frustumRenderableId),this._frustumRenderableId=this._vxl.add_generic_mesh(i,3*e,a,e,255,0,0,64),this._vxl._free(i),this._vxl._free(a),this._captureFrustum=!1,this._renderPluginContext.requestRender()}captureFrustum(){this._renderCoordsHelper===null&&(this._renderCoordsHelper=J.create(Q.Local,Z(!1,this.view.spatialReference))),this._frustum===null&&(this._frustum=new ee(this._renderCoordsHelper)),this._captureFrustum=!0,this._renderPluginContext!==null&&this._renderPluginContext.requestRender()}toggleFullVolumeExtentDraw(e){this._vxl&&this._layers.forEach((t,i)=>{t.layerView.wasmLayerId===e.wasmLayerId&&(this._vxl.toggle_full_volume_extent_draw(i),this._renderPluginContext.requestRender())})}addVoxelLayer(e){if(!this._vxl){const i={layerView:e,resolveCallback:null,rejectCallback:null},s=new Promise((a,n)=>{i.resolveCallback=a,i.rejectCallback=n});return this._newLayers.push(i),s}const t=this._addVoxelLayer(e);return t<0?Promise.reject(-1):Promise.resolve(t)}removeVoxelLayer(e){if(!this._vxl){const s=this._newLayers.findIndex(n=>e.uid===n.layerView.uid);s>=0&&(this._newLayers[s].resolveCallback(-1),this._newLayers.splice(s,1));const a=this._newLayers.length;return a===0&&(this._dbg(o.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),a}let t=-1;this._layers.forEach((s,a)=>{if(s.layerView.wasmLayerId===e.wasmLayerId){t=a,s.abortController.abort(),this._vxl.remove_layer(t);const n=this.layerUid.indexOf(e.layer.uid);n!==-1&&this.layerUid.splice(n,1)}}),t>=0&&this._layers.delete(t);const i=this._layers.size;return i===0&&(this._dbg(o.Lifetime," no voxel layers left after removing a layer, removing RenderPlugin and destroying"),this.destroy()),i}_getBlockSize(e){for(const t of this._wasmMemBlockSizes)if(e=0){(g=t.test)!=null&&g.constantUpscaling&&(this._setUpscalingLimits(0,.25,.25),this._setUpscalingLimits(1,.5,.5),this._setUpscalingLimits(2,.75,.75));const h=new AbortController;if(this._layers.set(i,{layerView:e,responses:new Map,outstandingRequestCount:0,abortController:h,needMemoryUsageUpdate:!1}),this.layerUid.push(e.layer.uid),!this._halfIntTexturesAvailable||P("mac")){const _=[];let d="";for(const m of e.layer.variables)m.renderingFormat.type!=="Int16"&&m.renderingFormat.type!=="UInt16"||(_.push(m.name),m.id===e.layer.currentVariableId&&(d=m.name));d!==""&&v.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${d}' in this browser`),_.length>0&&v.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${_.toString()}' in this browser`)}if(!this._textureFloatLinearAvailable){const _=[];let d="";for(const m of e.layer.variables)m.renderingFormat.type==="Float32"&&(_.push(m.name),m.id===e.layer.currentVariableId&&(d=m.name));d!==""&&v.error("#addVoxelLayer_error()",e.layer,`The voxel layer '${e.layer.title}' cannot render the current variable '${d}' in this browser`),_.length>0&&v.warn("#addVoxelLayer_warning()",e.layer,`The voxel layer '${e.layer.title}' cannot render the variables '${_.toString()}' in this browser`)}return P("esri-mobile")&&v.warnOnce("Mobile support differs across devices. Voxel layer might not display as expected."),i}return-1}prepareRender(e){if(!this._vxl)return;const t=e.bindParameters.camera.viewForward,i=e.bindParameters.camera.eye;this._vxl.update_camera_pos_and_direction(i[0],i[1],i[2],t[0],t[1],t[2]);const s=this._vxl.cull();this._dbg(o.RequestResponse,"missingResourceCount="+s),this._moreToLoad=s>0,this._havePreparedWithAllLayers=this._newLayers.length===0,this._updateMemoryUsage()}renderNode(e){if(!this._vxl)return;for(const i of this._newLayers){const s=this._addVoxelLayer(i.layerView);s===-1?i.rejectCallback(-1):i.resolveCallback(s)}if(this._newLayers=[],this._layers.size===0)return void this._dbg(o.Error,"No voxel layers but RenderPlugin instance is being asked to render!");this._lastFrameWasStationary=this.view.stationary,this._syncRequestsResponses(),this._beforeDraw(),this._vxl.begin_color_frame(!this.view._stage.renderer.isFeatureEnabled(te.HighResolutionVoxel),e.bindParameters.lighting.mainLight.direction[0],e.bindParameters.lighting.mainLight.direction[1],e.bindParameters.lighting.mainLight.direction[2]);const t=this._renderTargetToRestore.viewport;t.width===this._viewportWidth&&t.height===this._viewportHeight||(this._viewportWidth=t.width,this._viewportHeight=t.height,this._vxl.set_viewport(t.width,t.height),this._layers.forEach(i=>{i.needMemoryUsageUpdate=!0})),t.x===0&&t.y===0||this._dbg(o.Error,"Unsupported viewport parameters detected!"),this.updateWasmCamera(e.bindParameters.camera),this._captureFrustum&&(this._frustum.update(e.bindParameters.camera),this._doCaptureFrustum()),this._vxl.draw(),this._afterDraw(),(this._moreToLoad||!this._havePreparedWithAllLayers&&this._layers.size>0)&&this._renderPluginContext.requestRender()}destroy(){this._dbg(o.Lifetime,"--destroy--"),this._removeRenderPlugin(),this._vxl&&(this._layers.forEach(e=>{e.abortController.abort()}),this._wasmMemBlocks.forEach(e=>{e!==0&&this._vxl._free(e)}),this._vxl.uninitialize_voxel_wasm(),this._vxl=null)}_initializeWasm(e){return this._vxl?Promise.resolve():(this._vxlPromise||(this._vxlPromise=le(e).then(t=>{var f;if(this._vxl=t,this._vxlPromise=null,this._newLayers.length<=0)return this._dbg(o.Lifetime," no voxel layers left after WASM downloaded, removing RenderPlugin and destroying"),void this.destroy();const i=this._getTimeArgs((f=this.view)==null?void 0:f.timeExtent),s=this._vxl.addFunction(this._restoreFramebuffer.bind(this),"v"),a=this._vxl.addFunction(this._setBlendState.bind(this),"viiii"),n=this._vxl.addFunction(this._setFrontFace.bind(this),"vi"),r=this._vxl.addFunction(this._setRasterizerState.bind(this),"vi"),u=this._vxl.addFunction(this._setDepthStencilStateFunction.bind(this),"viii"),g=this._vxl.addFunction(this._setViewport.bind(this),"viiii"),h=this._vxl.addFunction(this._bindPreviousDepthToSlot.bind(this),"iii"),_=this._vxl.addFunction(this._modifyResourceCount.bind(this),"viii"),d=this._halfIntTexturesAvailable&&!P("mac"),m=this._textureFloatLinearAvailable;this._vxl.initialize_voxel_wasm(s,a,n,r,u,g,h,_,i.startTime,i.endTime,i.useTime,d,m),this._renderPluginContext&&this._renderPluginContext.requestRender()}).catch(()=>{for(const t of this._newLayers)t.rejectCallback(-2);this._dbg(o.Error," WASM failed to download, removing RenderPlugin and destroying"),this.destroy()})),this._vxlPromise)}pickDepth(e,t,i){if(!this._vxl||!this._rctx||this._layers.size===0)return null;const s=i.viewport[3]-t;if(e<0||e>i.viewport[2]||t<0||t>i.viewport[3])return this._dbg(o.Error,`[js] pickDepth: outOfRange, screenXY=[${e.toFixed(0)}, ${s.toFixed(0)}]]`),null;this._beforeDraw();const a=i.viewForward,n=i.eye;this._vxl.update_camera_pos_and_direction(n[0],n[1],n[2],a[0],a[1],a[2]),this.updateWasmCamera(i),this._vxl.begin_frame();const r=this._vxl.pick_depth(e,s);return this._afterDraw(),r.success?r.distanceToCamera:null}pickObject(e,t,i,s){if(!this._vxl||!this._rctx||this._layers.size===0)return null;const a=Math.round(e),n=Math.round(t);if(a<0||a>i.viewport[2]||n<0||n>i.viewport[3])return this._dbg(o.Error,`[js] pickObject: outOfRange, screenXY=[${a}, ${n}], vp=[${i.viewport.toString()}]`),null;this._beforeDraw();const r=i.viewForward,u=i.eye;this._vxl.update_camera_pos_and_direction(u[0],u[1],u[2],r[0],r[1],r[2]),this.updateWasmCamera(i),this._vxl.begin_frame();let g=null;if(s.length===0)g=this._vxl.pick_object(a,n,0,0);else{const h={str:JSON.stringify({layerIds:s}),byteCount:0,ptr:0,isReusable:!1};this._allocateBlock(h)&&(g=this._vxl.pick_object(a,n,h.ptr,h.byteCount),h.isReusable||this._vxl._free(h.ptr))}return this._afterDraw(),g}_beforeDraw(){this._renderTargetToRestore={fbo:this._rctx.getBoundFramebufferObject(),viewport:this._rctx.getViewport()},this._rctx.setPolygonOffsetFillEnabled(!1),this._rctx.setScissorTestEnabled(!1),this._rctx.setColorMask(!0,!0,!0,!0)}_afterDraw(){this._renderTargetToRestore.fbo=null,this._rctx.externalTextureUnitUpdate(this._vxl.get_texture_units_bound_in_frame(),this._vxl.get_active_texture_unit()),this._rctx.externalVertexArrayObjectUpdate(),this._rctx.externalVertexBufferUpdate(),this._rctx.externalProgramUpdate()}intersect(e,t,i,s,a){if(!this._vxl||!this._rctx||this._layers.size===0||!e.options.selectionMode||e.options.isFiltered)return;if(a[0]<0||a[0]>e.camera.viewport[2]||a[1]<0||a[1]>e.camera.viewport[3])return this._dbg(o.Error,`[js] VoxelWasmPerScene.intersect: outOfRange, screenXY=[${a[0].toFixed(0)}, ${a[1].toFixed(0)}]`),null;const n=[];this._layers.forEach(g=>{e.options.filteredLayerUids.includes(g.layerView.layer.uid)&&n.push(g.layerView.wasmLayerId)});const r=this.pickObject(a[0],a[1],e.camera,n);if(r==null||r.layerId===-1)return;const u=this._layers.get(r.layerId);if(u){const g=u.layerView.layer.uid,h=r.distanceToCamera/ie(i,s),_=ne();_[0]=r.worldX,_[1]=r.worldY,_[2]=r.worldZ;const d={};if(r.continuousValue!=null&&r.continuousValueUnits!=null?d["Voxel.ServiceValue"]=`${r.continuousValue.toLocaleString()} ${r.continuousValueUnits}`:r.uniqueValueLabel!=null&&r.uniqueValue!=null?d["Voxel.ServiceValue"]=`${r.uniqueValueLabel} (${r.uniqueValue})`:r.uniqueValue!=null&&(d["Voxel.ServiceValue"]=`${r.uniqueValue}`),d["Voxel.ServiceVariableLabel"]=r.variableLabel,d["Voxel.Position"]=r.voxelSpacePosition,r.epochTime!=null&&r.nativeTime!=null&&r.nativeTimeUnits!=null){const y=new Date(r.epochTime);d["Voxel.ServiceLocalTime"]=y.toString(),d["Voxel.ServiceNativeTime"]=`${r.nativeTime.toLocaleString()} ${r.nativeTimeUnits}`}r.depth!=null&&r.depthUnits!=null&&(d["Voxel.ServiceDepth"]=`${r.depth.toLocaleString()} ${r.depthUnits}`);const m=r.faceNormal;d["Voxel.WorldPosition"]=`[${_[0]}, ${_[1]}, ${_[2]}]`;const f=y=>{const R=new oe(_,g,()=>this._createVoxelGraphic(u.layerView.layer,d));y.set(this.type,R,h,m)},l=e.results,c=e.options.store===se.ALL;if((l.min.dist==null||hl.max.dist)&&f(l.max),c){const y=re(e.ray);f(y),e.results.all.push(y)}}}_createVoxelGraphic(e,t){return new ae({layer:e,sourceLayer:e,attributes:t})}_toWasmQuality(e){switch(e){case"low":return 0;case"medium":return 1;case"high":return 2}}_setUpscalingLimits(e,t,i){this._vxl&&this._vxl.set_upscaling_limits(e,t,i)}};A([N({constructOnly:!0})],E.prototype,"view",void 0),E=A([D("esri.layers.VoxelWasmPerSceneView")],E);const ue=E;export{ue as default}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/vxlLayer-oRewqFuR.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/WFSLayer-VPxAc_vg.js b/dist/assets/WFSLayer-VPxAc_vg.js new file mode 100644 index 0000000..489b2f7 --- /dev/null +++ b/dist/assets/WFSLayer-VPxAc_vg.js @@ -0,0 +1 @@ +import{e as i,y as r,c as x,ij as $,ah as P,dT as j,E as N,fe as m,jG as C,g1 as E,dJ as J,eR as U,dK as _,el as k,dL as W,dO as D,dM as X,dN as Y,dP as L,ar as T,iF as O,iG as Q,dw as R,dD as V,bV as G,il as M,ca as y,ex as Z,iH as z,du as A,iI as B,iJ as H,iK as K,dV as ee,ey as S,jH as te,iu as ie,iv as re,iM as se,it as oe,iN as ae,dW as ne,ix as le,c7 as pe}from"./index-J0iiHjMT.js";import{l as de,o as ue}from"./clientSideDefaults-F-CNnR0g.js";import{v as ye,W as ce,q as me,V as fe,S as he}from"./wfsUtils-6CAR46-c.js";import{d as ge}from"./FeatureSet-d4S1oKME.js";import{o as we}from"./CustomParametersMixin-Y1bOcayO.js";import{p as ve}from"./FeatureEffectLayer-oBa8pIG5.js";import{c as Fe}from"./FeatureReductionLayer-RlitE1N6.js";import{c as be}from"./OrderedLayer-M7k5gLgx.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./geojson-fSjaGZrp.js";import"./date-be_IQzZd.js";import"./xmlUtils-Q_9cB30b.js";import"./FeatureEffect-5bEV-xG1.js";let d=class extends ${constructor(){super(...arguments),this._connection=null,this.capabilities=de(!1,!1),this.type="wfs",this.refresh=P(async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const o=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return ge.fromJSON(o)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const o=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:o.count,extent:j.fromJSON(o.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){var F,b;const{url:t,customParameters:o,name:n,namespaceUri:l,fields:a,geometryType:u,swapXY:f}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!t)throw new N("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await ye(t,{customParameters:o,...e}));const h=["fields","geometryType","name","namespaceUri","swapXY"].some(w=>this.layer[w]==null),p=h?await ce(this.wfsCapabilities,n,l,{spatialReference:c,customParameters:o,signal:e==null?void 0:e.signal}):{...me(a??[]),geometryType:u,name:n,namespaceUri:l,spatialReference:c,swapXY:f},g=fe(this.wfsCapabilities.readFeatureTypes(),p.name,p.namespaceUri),q=m.toJSON(p.geometryType);return{customParameters:o,featureType:g,fields:((F=p.fields)==null?void 0:F.map(w=>w.toJSON()))??[],geometryField:p.geometryField,geometryType:q,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:p.objectIdField,spatialReference:(b=p.spatialReference)==null?void 0:b.toJSON(),swapXY:!!p.swapXY}}async _startWorker(e){const[t,o]=await C([this._createLoadOptions(e),E("WFSSourceWorker",{...e,strategy:J("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=t.error||o.error||null,l=o.value||null;if(n)throw l&&l.close(),n;const a=t.value;this._connection=o.value;const u=(await this._connection.invoke("load",a,e)).extent;this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:U},extent:u,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:ue(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:3e3,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};i([r()],d.prototype,"capabilities",void 0),i([r({constructOnly:!0})],d.prototype,"layer",void 0),i([r()],d.prototype,"sourceJSON",void 0),i([r()],d.prototype,"type",void 0),i([r()],d.prototype,"wfsCapabilities",void 0),d=i([x("esri.layers.graphics.sources.WFSSource")],d);var v;const I=le();let s=v=class extends be(we(Fe(ve(_(k(W(D(X(Y(L(pe))))))))))){static fromWFSLayerInfo(e){const{customParameters:t,fields:o,geometryField:n,geometryType:l,name:a,namespaceUri:u,objectIdField:f,spatialReference:c,swapXY:h,url:p,wfsCapabilities:g}=e;return new v({customParameters:t,fields:o,geometryField:n,geometryType:l,name:a,namespaceUri:u,objectIdField:f,spatialReference:c,swapXY:h,url:p,wfsCapabilities:g})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=T.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),O(this.renderer,this.fieldsIndex),Q(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){var e;return(e=this.source)==null?void 0:e.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,o){const n=e.filter(l=>l.name!==he);this.geometryField&&n.unshift(new R({name:this.geometryField,alias:this.geometryField,type:"geometry"})),V(o,n.map(l=>l.toJSON()),t)}get parsedUrl(){return G(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){var e;return(e=this.source)==null?void 0:e.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return M(this,e)}createQuery(){const e=new y;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:o}=this;return e.timeExtent=t!=null&&o!=null?o.offset(-t.value,t.unit):o||null,e}getFieldDomain(e,t){var o;return(o=this.getField(e))==null?void 0:o.domain}getField(e){var t;return(t=this.fieldsIndex)==null?void 0:t.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),t)).then(o=>{if(o!=null&&o.features)for(const n of o.features)n.layer=n.sourceLayer=this;return o})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};i([r({readOnly:!0})],s.prototype,"capabilities",null),i([r({type:String})],s.prototype,"copyright",void 0),i([r({readOnly:!0})],s.prototype,"createQueryVersion",null),i([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],s.prototype,"customParameters",void 0),i([r(Z("dateFieldsTimeReference"))],s.prototype,"dateFieldsTimeZone",void 0),i([r({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),i([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),i([r({type:String})],s.prototype,"displayField",void 0),i([r(z)],s.prototype,"elevationInfo",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"featureUrl",void 0),i([r({type:[R],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],s.prototype,"fields",void 0),i([A("fields")],s.prototype,"writeFields",null),i([r(I.fieldsIndex)],s.prototype,"fieldsIndex",void 0),i([r({type:j,json:{name:"extent"}})],s.prototype,"fullExtent",void 0),i([r()],s.prototype,"geometryField",void 0),i([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:m.read},write:{target:"layerDefinition.geometryType",writer:m.write,ignoreOrigin:!0},origins:{service:{read:m.read}}}})],s.prototype,"geometryType",void 0),i([r({type:String})],s.prototype,"id",void 0),i([r(B)],s.prototype,"labelsVisible",void 0),i([r({type:[H],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:K},write:!0}})],s.prototype,"labelingInfo",void 0),i([r(ee)],s.prototype,"legendEnabled",void 0),i([r({type:["show","hide"]})],s.prototype,"listMode",void 0),i([r({type:String})],s.prototype,"objectIdField",void 0),i([r({type:["WFS"]})],s.prototype,"operationalLayerType",void 0),i([r({type:S,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"maxFeatures",void 0),i([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],s.prototype,"mode",void 0),i([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"name",void 0),i([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"namespaceUri",void 0),i([r(te)],s.prototype,"opacity",void 0),i([r(I.outFields)],s.prototype,"outFields",void 0),i([r({readOnly:!0})],s.prototype,"parsedUrl",null),i([r(ie)],s.prototype,"popupEnabled",void 0),i([r({type:re,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),i([r({types:se,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:oe,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],s.prototype,"renderer",null),i([r(ae)],s.prototype,"screenSizePerspectiveEnabled",void 0),i([r({readOnly:!0})],s.prototype,"source",void 0),i([r({type:T,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],s.prototype,"spatialReference",void 0),i([r({readOnly:!0,type:[S],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"spatialReferences",void 0),i([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"swapXY",void 0),i([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],s.prototype,"title",void 0),i([r({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),i([r(ne)],s.prototype,"url",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"version",void 0),i([r()],s.prototype,"wfsCapabilities",null),s=v=i([x("esri.layers.WFSLayer")],s);const Je=s;export{Je as default}; diff --git a/dist/assets/WFSLayerView3D-OjHmKjv_.js b/dist/assets/WFSLayerView3D-OjHmKjv_.js new file mode 100644 index 0000000..8788cca --- /dev/null +++ b/dist/assets/WFSLayerView3D-OjHmKjv_.js @@ -0,0 +1 @@ +import{e as r,y as o,c as p}from"./index-J0iiHjMT.js";import{_ as i}from"./FeatureLayerViewBase3D-VurTj7t3.js";import"./HeatmapDensity.glsl-y7dUg--m.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./queryForSymbologySnapping-I1fFQTD_.js";import"./hash-SS5GKVPY.js";import"./Graphics3DObjectStates--mMi4sdi.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./FeatureSet-d4S1oKME.js";import"./FeatureStore-X-AIJLo2.js";import"./BoundsStore-wmwfHjhp.js";import"./projectExtentUtils-TwA6ooHn.js";import"./LayerView3D-iOx2MD1g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./EventedSet-JGlFrfoR.js";import"./FeatureEffect-5bEV-xG1.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";let t=class extends i{constructor(){super(...arguments),this.type="wfs-3d"}};r([o()],t.prototype,"layer",void 0),t=r([p("esri.views.3d.layers.WFSLayerView3D")],t);const C=t;export{C as default}; diff --git a/dist/assets/WFSSourceWorker-iUwpu94Y.js b/dist/assets/WFSSourceWorker-iUwpu94Y.js new file mode 100644 index 0000000..55b6dd4 --- /dev/null +++ b/dist/assets/WFSSourceWorker-iUwpu94Y.js @@ -0,0 +1 @@ +import{E as l,s as c,eQ as g,eR as _,b as d,f as F,Z as w,al as E,eU as S,eT as q}from"./index-J0iiHjMT.js";import{m as x}from"./FeatureStore-X-AIJLo2.js";import{x as T,W as R,j as I}from"./QueryEngine-8tLWlkSE.js";import{E as b,N as j}from"./geojson-fSjaGZrp.js";import{p as C}from"./sourceUtils-zbywPEXK.js";import{a as $,B as k}from"./wfsUtils-6CAR46-c.js";import"./BoundsStore-wmwfHjhp.js";import"./PooledRBush-o8tLYBG5.js";import"./quickselect-UFB0jJTZ.js";import"./optimizedFeatureQueryEngineAdapter-KnoSHZzG.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./date-be_IQzZd.js";import"./xmlUtils-Q_9cB30b.js";class X{constructor(){this._queryEngine=null,this._customParameters=null}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=null}async load(e,t){const{getFeatureUrl:r,getFeatureOutputFormat:p,fields:o,geometryType:i,featureType:n,objectIdField:u,customParameters:a}=e,{spatialReference:s,getFeatureSpatialReference:h}=$(r,n,e.spatialReference);this._featureType=n,this._customParameters=a,this._getFeatureUrl=r,this._getFeatureOutputFormat=p,this._getFeatureSpatialReference=h;try{await T(h,s)}catch{throw new l("unsupported-projection","Projection not supported",{inSpatialReference:h,outSpatialReference:s})}c(t);const y=g.fromLayerJSON({fields:o,dateFieldsTimeReference:o.some(f=>f.type==="esriFieldTypeDate")?{timeZoneIANA:_}:null}),m=await this._snapshotFeatures({fieldsIndex:y,geometryType:i,objectIdField:u,spatialReference:s},t.signal);return this._queryEngine=new R({fieldsIndex:y,geometryType:i,hasM:!1,hasZ:!1,objectIdField:u,spatialReference:s,timeInfo:null,featureStore:new x({geometryType:i,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new l("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var t;return this._customParameters=e,(t=this._snapshotTask)==null||t.abort(),this._snapshotTask=d(r=>this._snapshotFeatures(this._queryEngine,r)),this._snapshotTask.promise.then(r=>{this._queryEngine.featureStore.clear(),r&&this._queryEngine.featureStore.addMany(r)},r=>{this._queryEngine.featureStore.clear(),F(r)||w.getLogger("esri.layers.WFSLayer").error(new l("wfs-layer:getfeature-error","An error occurred during the GetFeature request",{error:r}))}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures({objectIdField:e,geometryType:t,spatialReference:r,fieldsIndex:p},o){const i=await k(this._getFeatureUrl??"",this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:o});b(i,this._getFeatureSpatialReference.wkid),c(o);const n=j(i,{geometryType:t,hasZ:!1,objectIdField:e});if(!E(r,this._getFeatureSpatialReference))for(const a of n)a.geometry!=null&&(a.geometry=S(I(q(a.geometry,t,!1,!1),this._getFeatureSpatialReference,r)));let u=1;for(const a of n){const s={};C(p,s,a.attributes,!0),a.attributes=s,s[e]==null&&(a.objectId=s[e]=u++)}return n}}export{X as default}; diff --git a/dist/assets/WMSLayerView3D-HO_hwLwX.js b/dist/assets/WMSLayerView3D-HO_hwLwX.js new file mode 100644 index 0000000..66b4a0c --- /dev/null +++ b/dist/assets/WMSLayerView3D-HO_hwLwX.js @@ -0,0 +1 @@ +import{e as a,y as h,jW as w,c as l,jZ as x,n as f,E as m,dT as g}from"./index-J0iiHjMT.js";import{N as P}from"./DynamicLayerView3D-4lztpXo0.js";import"./LayerView3D-iOx2MD1g.js";import"./projectExtentUtils-TwA6ooHn.js";import"./ImageMaterial.glsl-TdPtjVc_.js";import"./LayerView-efDufa6j.js";import"./RefreshableLayerView-Pd4dLcWr.js";const v=r=>{let e=class extends r{initialize(){this.exportImageParameters=new x({layer:this.layer})}destroy(){this.exportImageParameters=f(this.exportImageParameters)}get exportImageVersion(){var t;return(t=this.exportImageParameters)==null||t.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}fetchPopupFeatures(t){const{layer:i}=this;if(!t)return Promise.reject(new m("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:i}));const{popupEnabled:o}=i;if(!o)return Promise.reject(new m("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:o}));const n=this.createFetchPopupFeaturesQuery(t);if(!n)return Promise.resolve([]);const{extent:p,width:s,height:u,x:d,y}=n;if(!(p&&s&&u))throw new m("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:p,width:s,height:u});return i.fetchFeatureInfo(p,s,u,d,y)}};return a([h()],e.prototype,"exportImageParameters",void 0),a([h({readOnly:!0})],e.prototype,"exportImageVersion",null),a([h()],e.prototype,"layer",void 0),a([h(w)],e.prototype,"timeExtent",void 0),e=a([l("esri.layers.mixins.WMSLayerView")],e),e};let c=class extends v(P){constructor(){super(...arguments),this.type="wms-3d"}initialize(){this.layer.serviceSupportsSpatialReference(this.view.spatialReference)||this.addResolvingPromise(Promise.reject(new m("layerview:spatial-reference-incompatible","The spatial references supported by this WMS layer are incompatible with the spatial reference of the view"))),this._updatingHandles.add(()=>{var r;return(r=this.exportImageParameters)==null?void 0:r.version},()=>{this._updatingHandles.addPromise(this.refreshDebounced())})}createFetchPopupFeaturesQuery(r){const e=this.findExtentInfoAt(r),t=e.extent,i=new g(t[0],t[1],t[2],t[3],this._spatialReference),o=e.imageSize,n=o.width,p=o.height,s=i.width/n;return{extent:i,width:n,height:p,x:Math.round((r.x-i.xmin)/s),y:Math.round((i.ymax-r.y)/s)}}getFetchOptions(){return{timeExtent:this.timeExtent}}};c=a([l("esri.views.3d.layers.WMSLayerView3D")],c);const V=c;export{V as default}; diff --git a/dist/assets/WMTSLayer-Qx8zOTb2.js b/dist/assets/WMTSLayer-Qx8zOTb2.js new file mode 100644 index 0000000..dfc458e --- /dev/null +++ b/dist/assets/WMTSLayer-Qx8zOTb2.js @@ -0,0 +1 @@ +import{e as o,y as u,dT as A,e$ as X,c as N,dr as Y,dt as R,V as J,E as _,nz as Z,T as ge,f0 as we,nA as B,nB as xe,e3 as de,dK as ve,dL as Se,dO as Me,dM as Ie,dN as Te,dP as Le,d as ie,C as U,fl as se,dQ as le,nC as Ee,nD as Ce,bW as K,f2 as ae,bI as oe,bV as G,f3 as Pe,du as be,c7 as Re}from"./index-J0iiHjMT.js";import{p as Oe,I as Ae}from"./WebTileLayer-JxqArsF7.js";import{o as ne}from"./xmlUtils-Q_9cB30b.js";var q;let F=q=class extends Y{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new q;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};o([u({type:A,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([u({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([u({type:X,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=q=o([N("esri.layer.support.TileMatrixSet")],F);const Fe=F;var H;let E=H=class extends Y{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u({json:{read:{source:"id"}}})],E.prototype,"id",void 0),o([u({json:{read:{source:"title"}}})],E.prototype,"title",void 0),o([u({json:{read:{source:"abstract"}}})],E.prototype,"description",void 0),o([u({json:{read:{source:"legendUrl"}}})],E.prototype,"legendUrl",void 0),o([u({json:{read:{source:"isDefault"}}})],E.prototype,"isDefault",void 0),o([u({json:{read:{source:"keywords"}}})],E.prototype,"keywords",void 0),E=H=o([N("esri.layer.support.WMTSStyle")],E);const $e=E;var z;let x=z=class extends Y{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?A.fromJSON(e):null}readFullExtents(e,t){var r,i;return(r=t.fullExtents)!=null&&r.length?t.fullExtents.map(s=>A.fromJSON(s)):((i=t.tileMatrixSets)==null?void 0:i.map(s=>A.fromJSON(s.fullExtent)).filter(s=>s))??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){var t,r;let e=this._get("styleId");return e||(e=((r=(t=this.styles)==null?void 0:t.at(0))==null?void 0:r.id)??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find(e=>e.id===this.tileMatrixSetId):null}clone(){var t,r,i;const e=new z;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=(t=this.fullExtent)==null?void 0:t.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=(r=this.styles)==null?void 0:r.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=(i=this.tileMatrixSets)==null?void 0:i.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u()],x.prototype,"description",void 0),o([u()],x.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],x.prototype,"readFullExtent",null),o([u({readOnly:!0})],x.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],x.prototype,"readFullExtents",null),o([u()],x.prototype,"id",void 0),o([u()],x.prototype,"imageFormat",null),o([u({json:{read:{source:"formats"}}})],x.prototype,"imageFormats",void 0),o([u()],x.prototype,"layer",void 0),o([u()],x.prototype,"parent",void 0),o([u()],x.prototype,"styleId",null),o([u({type:J.ofType($e),json:{read:{source:"styles"}}})],x.prototype,"styles",void 0),o([u({json:{write:{ignoreOrigin:!0}}})],x.prototype,"title",void 0),o([u()],x.prototype,"tileMatrixSetId",void 0),o([u({readOnly:!0})],x.prototype,"tileMatrixSet",null),o([u({type:J.ofType(Fe),json:{read:{source:"tileMatrixSets"}}})],x.prototype,"tileMatrixSets",void 0),x=z=o([N("esri.layers.support.WMTSSublayer")],x);const j=x,me=90.71428571428571;function ue(e){const t=e.replaceAll(/ows:/gi,"");if(!g("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function Ve(e,t){var re;e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=g("Contents",r);if(!a)throw new _("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=g("OperationsMetadata",r),n=l==null?void 0:l.querySelector("[name='GetTile']"),c=n==null?void 0:n.getElementsByTagName("Get"),p=c&&Array.prototype.slice.call(c),h=(re=t.url)==null?void 0:re.indexOf("https"),f=h!==void 0&&h>-1;let d,w,S=t.serviceMode,v=t==null?void 0:t.url;if(p!=null&&p.length&&p.some(T=>{const L=g("Constraint",T);return!L||$("AllowedValues","Value",S,L)?(v=T.attributes[0].nodeValue,!0):(!L||$("AllowedValues","Value","RESTful",L)||$("AllowedValues","Value","REST",L)?w=T.attributes[0].nodeValue:L&&!$("AllowedValues","Value","KVP",L)||(d=T.attributes[0].nodeValue),!1)}),!v)if(w)v=w,S="RESTful";else if(d)v=d,S="KVP";else{const T=g("ServiceMetadataURL",r);v=T==null?void 0:T.getAttribute("xlink:href")}const C=v.indexOf("1.0.0/");C===-1&&S==="RESTful"?v+="/":C>-1&&(v=v.substring(0,C)),S==="KVP"&&(v+=C>-1?"":"?"),f&&(v=v.replace(/^http:/i,"https:"));const M=y("ServiceIdentification>ServiceTypeVersion",r),I=y("ServiceIdentification>AccessConstraints",r),P=I&&/^none$/i.test(I)?null:I,k=b("Layer",a),W=b("TileMatrixSet",a),D=k.map(T=>{const L=y("Identifier",T);return i.set(L,T),Ue(L,T,W,f,M)});return{copyright:P,dimensionMap:s,layerMap:i,layers:D,serviceMode:S,tileUrl:v}}function je(e){return e.layers.forEach(t=>{var r;(r=t.tileMatrixSets)==null||r.forEach(i=>{var a;const s=i.tileInfo;s&&s.dpi!==96&&((a=s.lods)==null||a.forEach(l=>{var n;l.scale=96*l.scale/s.dpi,l.resolution=fe((n=s.spatialReference)==null?void 0:n.wkid,l.scale*me/96,i.id)}),s.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function g(e,t){for(let r=0;ri.textContent).filter(de)}function y(e,t){return e.split(">").forEach(r=>{t&&(t=g(r,t))}),t&&t.textContent}function $(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=g(t,a),n=l==null?void 0:l.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=a,!0}return!1}),s}function Ue(e,t,r,i,s){const a=y("Abstract",t),l=O("Format",t);return{id:e,fullExtent:We(t),fullExtents:De(t),description:a,formats:l,styles:Be(t,i),title:y("Title",t),tileMatrixSets:Ke(s,t,r)}}function he(e,t){var h;const r=[],i=(h=e.layerMap)==null?void 0:h.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,n,c,p;return a.length&&(l=y("Identifier",a[0]),n=O("Default",a[0])||O("Value",a[0])),a.length>1&&(c=y("Identifier",a[1]),p=O("Default",a[1])||O("Value",a[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:p}),s.forEach(f=>{let d=f.getAttribute("template");if(f.getAttribute("resourceType")==="tile"){if(l&&n.length)if(d.includes("{"+l+"}"))d=d.replace("{"+l+"}","{dimensionValue}");else{const w=d.toLowerCase().indexOf("{"+l.toLowerCase()+"}");w>-1&&(d=d.substring(0,w)+"{dimensionValue}"+d.substring(w+l.length+2))}if(c&&p.length)if(d.includes("{"+c+"}"))d=d.replace("{"+c+"}","{dimensionValue2}");else{const w=d.toLowerCase().indexOf("{"+c.toLowerCase()+"}");w>-1&&(d=d.substring(0,w)+"{dimensionValue2}"+d.substring(w+c.length+2))}r.push({template:d,format:f.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,n){var d,w;const c=Ne(e,t,i);if(!((c==null?void 0:c.length)>0))return"";const{dimensionMap:p}=e,h=(d=p.get(t).dimensions)==null?void 0:d[0],f=(w=p.get(t).dimensions2)==null?void 0:w[0];return c[l%c.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+n).replaceAll(/\{dimensionValue\}/gi,h).replaceAll(/\{dimensionValue2\}/gi,f)}function Ne(e,t,r){const i=he(e,t),s=i==null?void 0:i.filter(a=>a.format===r);return(s!=null&&s.length?s:i)??[]}function ke(e,t,r,i){var n,c;const{dimensionMap:s}=e,a=he(e,t);let l="";if(a&&a.length>0){const p=(n=s.get(t).dimensions)==null?void 0:n[0],h=(c=s.get(t).dimensions2)==null?void 0:c[0];l=a[0].template,l.indexOf(".xxx")===l.length-4&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,h)}return l}function We(e){const t=g("WGS84BoundingBox",e),r=t?y("LowerCorner",t).split(" "):["-180","-90"],i=t?y("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function De(e){const t=[];return ne(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,n,c,p;ne(r,{LowerCorner:h=>{[l,n]=h.textContent.split(" ").map(f=>Number.parseFloat(f)),a&&([l,n]=[n,l])},UpperCorner:h=>{[c,p]=h.textContent.split(" ").map(f=>Number.parseFloat(f)),a&&([c,p]=[p,c])}}),t.push({xmin:l,ymin:n,xmax:c,ymax:p,spatialReference:s})}}),t}function Be(e,t){return b("Style",e).map(r=>{const i=g("LegendURL",r),s=g("Keywords",r),a=s?O("Keyword",s):[];let l=i&&i.getAttribute("xlink:href");return t&&(l=l&&l.replace(/^http:/i,"https:")),{abstract:y("Abstract",r),id:y("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:y("Title",r)}})}function Ke(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ge(e,i,r))}function Ge(e,t,r){const i=g("TileMatrixSet",t).textContent,s=O("TileMatrix",t),a=r.find(M=>{const I=g("Identifier",M),P=I==null?void 0:I.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=g("TileMatrixSetLimits",t),n=l&&b("TileMatrixLimits",l),c=new Map;if(n!=null&&n.length)for(const M of n){const I=g("TileMatrix",M).textContent,P=+g("MinTileRow",M).textContent,k=+g("MaxTileRow",M).textContent,W=+g("MinTileCol",M).textContent,D=+g("MaxTileCol",M).textContent;c.set(I,{minCol:W,maxCol:D,minRow:P,maxRow:k})}const p=y("SupportedCRS",a).toLowerCase(),h=Je(a,p),f=h.spatialReference,d=g("TileMatrix",a),w=[parseInt(y("TileWidth",d),10),parseInt(y("TileHeight",d),10)],S=[];s.length?s.forEach((M,I)=>{const P=$("TileMatrix","Identifier",M,a);S.push(ce(P,p,I,i,c))}):b("TileMatrix",a).forEach((M,I)=>{S.push(ce(M,p,I,i,c))});const v=qe(e,a,h,w,S[0]).toJSON(),C=new X({dpi:96,spatialReference:f,size:w,origin:h,lods:S}).toJSON();return{id:i,fullExtent:v,tileInfo:C}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=ze(e);return r!=null&&(t=r),{wkid:t}}function Je(e,t){return ye(g("TileMatrix",e),t)}function ye(e,t){const r=te(t),[i,s]=y("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new ge(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function qe(e,t,r,i,s){const a=g("BoundingBox",t);let l,n,c,p,h,f;if(a&&(l=y("LowerCorner",a).split(" "),n=y("UpperCorner",a).split(" ")),l&&l.length>1&&n&&n.length>1)c=parseFloat(l[0]),h=parseFloat(l[1]),p=parseFloat(n[0]),f=parseFloat(n[1]);else{const d=g("TileMatrix",t),w=parseInt(y("MatrixWidth",d),10),S=parseInt(y("MatrixHeight",d),10);c=r.x,f=r.y,p=c+w*i[0]*s.resolution,h=f-S*i[1]*s.resolution}return He(e,r.spatialReference,r)?new A(h,c,f,p,r.spatialReference):new A(c,h,p,f,r.spatialReference)}function He(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var V;function ze(e){return e.includes("crs84")||e.includes("crs:84")?V.CRS84:e.includes("crs83")||e.includes("crs:83")?V.CRS83:e.includes("crs27")||e.includes("crs:27")?V.CRS27:null}function ce(e,t,r,i,s){const a=te(t),l=y("Identifier",e);let n=parseFloat(y("ScaleDenominator",e));const c=fe(a.wkid,n,i);n*=96/me;const p=+y("MatrixWidth",e),h=+y("MatrixHeight",e),{maxCol:f=p-1,maxRow:d=h-1,minCol:w=0,minRow:S=0}=s.get(l)??{},{x:v,y:C}=ye(e,t);return new we({cols:[w,f],level:r,levelValue:l,origin:[v,C],scale:n,resolution:c,rows:[S,d]})}function fe(e,t,r){let i;return i=B.hasOwnProperty(""+e)?B.values[B[e]]:r==="default028mm"?6370997*Math.PI/180:xe(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(V||(V={}));var Q;const pe={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},Qe=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let m=Q=class extends ve(Se(Me(Ie(Te(Le(Re)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([ie(()=>this.activeLayer,(t,r)=>{var i;r&&!((i=this.sublayers)!=null&&i.includes(r))&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},U),se(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},U),se(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},U),ie(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},U)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(le).then(()=>this._fetchService(e)).catch(t=>{throw le(t),new _("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=i==null?void 0:i.layerIdentifier;let l=null;const n=i==null?void 0:i.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(l=n[0]):l=n);const c=s==null?void 0:s.format,p=s==null?void 0:s.style;return new j({id:a,imageFormat:c,styleId:p,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=Ee("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return Xe(t.layers,r)}get supportedSpatialReferences(){var e;return((e=this.activeLayer.tileMatrixSets)==null?void 0:e.map(t=>{var r;return(r=t.tileInfo)==null?void 0:r.spatialReference}).toArray().filter(de))??[]}get tilemapCache(){var t,r;const e=(r=(t=this.activeLayer)==null?void 0:t.tileMatrixSet)==null?void 0:r.tileInfo;return e?new Ce(e):void 0}get title(){var e;return((e=this.activeLayer)==null?void 0:e.title)??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.substr(-1)==="/"?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r==null?void 0:r.tileInfo,s=e.fullExtent,a=new Oe({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Ae({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await K(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==Q.prototype.fetchTile){const n=await this.fetchTile(e,t,r,i);return ae(n,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await K(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){var t;return(t=this.sublayers)==null?void 0:t.find(r=>r.id===e)}getTileUrl(e,t,r){var n;const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=(n=i==null?void 0:i.tileInfo)==null?void 0:n.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=ke({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return pe[r.toLowerCase()]&&(s=pe[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ue(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ue(t.data),this.serviceMode=r}catch(i){throw new _("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=je(t.data):t.data=Ve(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await K(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){var i;const t=this.findSublayerById(this.activeLayer.id);return(i=t==null?void 0:t.tileMatrixSets)==null?void 0:i.find(s=>s.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...oe(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=G(e),i={...r.query,...t},s=Pe(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=G(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=G(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?oe(e):{},i.forEach(s=>{e.hasOwnProperty(s)||Qe.has(s)||(e[s]=r[s])}))}return e}};function Xe(e,t){return e.map(r=>{const i=new j;return i.read(r,t),i})}o([u()],m.prototype,"dimensionMap",void 0),o([u()],m.prototype,"layerMap",void 0),o([u({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],m.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],m.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],m.prototype,"readActiveLayerFromItemOrWebDoc",null),o([be(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:X},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],m.prototype,"writeActiveLayer",null),o([u({type:String,value:"",json:{write:!0}})],m.prototype,"copyright",void 0),o([u({type:["show","hide"]})],m.prototype,"listMode",void 0),o([u({json:{read:!0,write:!0}})],m.prototype,"blendMode",void 0),o([u({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],m.prototype,"customParameters",void 0),o([R(["portal-item","web-document"],"customParameters")],m.prototype,"readCustomParameters",null),o([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],m.prototype,"customLayerParameters",void 0),o([u({type:A,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],m.prototype,"fullExtent",void 0),o([u({readOnly:!0})],m.prototype,"fullExtents",null),o([u({type:["WebTiledLayer"]})],m.prototype,"operationalLayerType",void 0),o([u()],m.prototype,"resourceInfo",void 0),o([u()],m.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],m.prototype,"readServiceMode",null),o([u({type:J.ofType(j)})],m.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],m.prototype,"readSublayersFromService",null),o([u({readOnly:!0})],m.prototype,"supportedSpatialReferences",null),o([u({readOnly:!0})],m.prototype,"tilemapCache",null),o([u({json:{read:{source:"title"}}})],m.prototype,"title",null),o([u({json:{read:!1},readOnly:!0,value:"wmts"})],m.prototype,"type",void 0),o([u({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],m.prototype,"url",null),o([u()],m.prototype,"version",void 0),m=Q=o([N("esri.layers.WMTSLayer")],m);const tt=m;export{tt as default}; diff --git a/dist/assets/WMTSLayerView3D-oO1etwl-.js b/dist/assets/WMTSLayerView3D-oO1etwl-.js new file mode 100644 index 0000000..caa4b5f --- /dev/null +++ b/dist/assets/WMTSLayerView3D-oO1etwl-.js @@ -0,0 +1 @@ +import{w as d,fY as f,V as u,Z as a,e as s,y as o,c as m}from"./index-J0iiHjMT.js";import{n as c}from"./LayerView3D-iOx2MD1g.js";import{o as p}from"./TiledLayerView3D-Av58zTxG.js";import{u as g}from"./LayerView-efDufa6j.js";import{a as y}from"./RefreshableLayerView-Pd4dLcWr.js";let r=class extends y(p(c(g))){constructor(){super(...arguments),this.type="wmts-3d"}initialize(){this._getCompatibleTileInfoMatrixSet(e=>this._getTileInfoSupportError(e.tileInfo,e.fullExtent));const t=d(()=>{var e,i;return(i=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:i.tilingSchemeLocked}).then(()=>{const e=this._getCompatibleTileInfoMatrixSet(i=>this._getTileInfoError(i.tileInfo,i.fullExtent));e!=null&&(e.id!==null&&this.layer.activeLayer.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),e.tileInfo&&(this.tileInfo=e.tileInfo),this.layer.fullExtent=e.fullExtent)});this.addResolvingPromise(t),this.when(()=>this._postInitialize())}get hasMixedImageFormats(){return!0}refresh(){this.emit("data-changed")}canResume(){if(!super.canResume())return!1;const t=this.layer.activeLayer.tileMatrixSet;return t!=null&&!this._getTileInfoError(t.tileInfo,t.fullExtent)}async doRefresh(){this.suspended||this.emit("data-changed")}_postInitialize(){this._updatingHandles.add(()=>{var t,e;return(e=(t=this.layer)==null?void 0:t.activeLayer)==null?void 0:e.styleId},()=>this.refresh()),this._updatingHandles.add(()=>{var t;return(t=this.layer)==null?void 0:t.activeLayer},t=>{const e=this._getCompatibleTileInfoMatrixSet(i=>this._getTileInfoError(i.tileInfo,i.fullExtent),!0);e&&e.id!=null&&t.tileMatrixSetId!==e.id&&(this.layer.activeLayer.tileMatrixSetId=e.id),this.notifyChange("suspended"),this.canResume()&&this.refresh()})}_getCompatibleTileInfoMatrixSet(t,e=!1){const i=f(this.layer);if(i!=null){if(u.isCollection(i))return i.find(h=>{const l=t(h);return l!=null&&(e?a.getLogger(this).error("The selected tile matrix set is not compatible with the view",l):this.addResolvingPromise(Promise.reject(l))),l==null});const n=t(i);return n!=null&&(e?a.getLogger(this).error("The selected tile matrix set is not compatible with the view",n):this.addResolvingPromise(Promise.reject(n))),i}return null}_getTileInfoError(t,e){return this._getTileInfoSupportError(t,e)||this._getTileInfoCompatibilityError(t,this.view.basemapTerrain.tilingScheme)}};s([o({readOnly:!0})],r.prototype,"hasMixedImageFormats",null),s([o()],r.prototype,"layer",void 0),s([o()],r.prototype,"suspended",void 0),s([o()],r.prototype,"tileInfo",void 0),r=s([m("esri.views.3d.layers.WMTSLayerView3d")],r);const S=r;export{S as default}; diff --git a/dist/assets/WebTileLayer-JxqArsF7.js b/dist/assets/WebTileLayer-JxqArsF7.js new file mode 100644 index 0000000..ab53bcc --- /dev/null +++ b/dist/assets/WebTileLayer-JxqArsF7.js @@ -0,0 +1 @@ +import{e as l,y as i,c as T,dr as R,bI as v,dK as $,dL as x,dO as I,dM as M,dN as W,dP as L,dT as j,ar as y,e$ as S,T as U,f0 as s,j6 as h,E as D,j7 as E,j8 as O,j9 as z,bW as w,f2 as g,c_ as A,dt as b,du as _,c7 as q}from"./index-J0iiHjMT.js";var m;let c=m=class extends R{constructor(e){super(e)}clone(){return new m({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=m=l([T("esri.layer.support.WMTSLayerInfo")],c);var f;let o=f=class extends $(x(I(M(W(L(q)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,y.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=y.WebMercator,this.subDomains=null,this.tileInfo=new S({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:y.WebMercator}),spatialReference:y.WebMercator,lods:[new s({level:0,scale:591657527591555e-6,resolution:156543.033928}),new s({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new s({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new s({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new s({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new s({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new s({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new s({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new s({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new s({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new s({level:10,scale:577790.554289,resolution:152.874056570411}),new s({level:11,scale:288895.277144,resolution:76.4370282850732}),new s({level:12,scale:144447.638572,resolution:38.2185141425366}),new s({level:13,scale:72223.819286,resolution:19.1092570712683}),new s({level:14,scale:36111.909643,resolution:9.55462853563415}),new s({level:15,scale:18055.954822,resolution:4.77731426794937}),new s({level:16,scale:9027.977411,resolution:2.38865713397468}),new s({level:17,scale:4513.988705,resolution:1.19432856685505}),new s({level:18,scale:2256.994353,resolution:.597164283559817}),new s({level:19,scale:1128.497176,resolution:.298582141647617}),new s({level:20,scale:564.248588,resolution:.14929107082380833}),new s({level:21,scale:282.124294,resolution:.07464553541190416}),new s({level:22,scale:141.062147,resolution:.03732276770595208}),new s({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{var a;let r="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const n=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&((a=n.authority)!=null&&a.includes("{subDomain}"))&&(r="is missing 'subDomains' property")}else r="spatialReference must match tileInfo.spatialReference";else r="is missing the required 'urlTemplate' property value";if(r)throw new D("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${r}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){var r;return e||y.fromJSON((r=t.fullExtent)==null?void 0:r.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p!=null&&p.includes("{subDomain}")){if(r&&r.length>0&&p.split(".").length>1)for(const d of r)e.push(n+p.replaceAll(/\{subDomain\}/gi,d)+"/")}else e.push(u);return e.map(E)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){O(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=z(e)),t.templateUrl=e}fetchTile(e,t,r,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,r),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(d=>d.data)}async fetchImageBitmapTile(e,t,r,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,r,a);return g(P,e,t,r,n)}const u=this.getTileUrl(e,t,r),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:d}=await w(u,p);return g(d,e,t,r,n)}getTileUrl(e,t,r){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+A(u,{level:p,z:p,col:r,x:r,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:j,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:y})],o.prototype,"spatialReference",void 0),l([b("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:S,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([b("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([_("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([T("esri.layers.WebTileLayer")],o);const V=o,B=Object.freeze(Object.defineProperty({__proto__:null,default:V},Symbol.toStringTag,{value:"Module"}));export{V as I,B as W,c as p}; diff --git a/dist/assets/WhereClause-XAMIZ4-B.js b/dist/assets/WhereClause-XAMIZ4-B.js new file mode 100644 index 0000000..7e973ec --- /dev/null +++ b/dist/assets/WhereClause-XAMIZ4-B.js @@ -0,0 +1,7 @@ +import{b as q,n as Q,m as Ps}from"./TimeOnly-ljWtUK7N.js";import{c_ as ln,mA as _,mC as Ls,mB as jt,pO as Yt,pP as ct,pQ as _s,dJ as tn,mD as Rs}from"./index-J0iiHjMT.js";var d;(function(i){i.InvalidFunctionParameters="InvalidFunctionParameters",i.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",i.UnsupportedSqlFunction="UnsupportedSqlFunction",i.UnsupportedOperator="UnsupportedOperator",i.UnsupportedSyntax="UnsupportedSyntax",i.UnsupportedIsRhs="UnsupportedIsRhs",i.UnsupportedIsLhs="UnsupportedIsLhs",i.InvalidDataType="InvalidDataType",i.CannotCastValue="CannotCastValue",i.FunctionNotRecognized="FunctionNotRecognized",i.InvalidTime="InvalidTime",i.InvalidParameterCount="InvalidParameterCount",i.InvalidTimeStamp="InvalidTimeStamp",i.InvalidDate="InvalidDate",i.InvalidOperator="InvalidOperator",i.IllegalInterval="IllegalInterval",i.YearMonthIntervals="YearMonthIntervals",i.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",i.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Us={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let v=class cn extends Error{constructor(r,u){super(ln(Us[r],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,cn)}};var W;(function(i){i.NeverReach="NeverReach",i.NotImplemented="NotImplemented",i.Cancelled="Cancelled",i.InvalidStatResponse="InvalidStatResponse",i.InvalidRequest="InvalidRequest",i.RequestFailed="RequestFailed",i.MissingFeatures="MissingFeatures",i.AggregationFieldNotFound="AggregationFieldNotFound",i.DataElementsNotFound="DataElementsNotFound"})(W||(W={}));const Vs={[W.Cancelled]:"Cancelled",[W.InvalidStatResponse]:"Invalid statistics response from service",[W.InvalidRequest]:"Invalid request",[W.RequestFailed]:"Request failed - {reason}",[W.MissingFeatures]:"Missing features",[W.AggregationFieldNotFound]:"Aggregation field not found",[W.DataElementsNotFound]:"Data elements not found on service",[W.NeverReach]:"Encountered unreachable logic",[W.NotImplemented]:"Not implemented"};let hc=class fn extends Error{constructor(r,u){super(ln(Vs[r],u)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,fn)}};function en(i){return Number.isNaN(i)||i===0?i:Math.trunc(i)}class z{constructor(r){this._timeStampOffset=r,this._date=null}toDateTime(){return this._date??(this._date=_.fromISO(this._timeStampOffset,{setZone:!0})),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return en(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return en(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return z.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(r){return new z(_.fromJSDate(r).toISO({includeOffset:!0}))}static fromDateTime(r){return new z(r.toISO({includeOffset:!0}))}static fromParts(r,u,c=0,l=0,h=0,I=0,e=0,T=!1,O=0,L=0){const U=`${r.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${c.toString().padStart(2,"0")}`;let Z="";I<10&&(Z="0");let C=`${l.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}:${Z+I.toString()}`;e!==0&&(C+="."+e.toString().padStart(3,"0"));const A=`${T?"-":"+"}${O.toString().padStart(2,"0")}:${L.toString().padStart(2,"0")}`;return new z(U+"T"+C+A)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let r=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return r&&(r=r.replace(".000","")),r}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(r){const u=this.toDateTime().plus(r);return z.fromDateTime(u)}}function Js(i,r){const u=dn[i.toLowerCase()];if(u==null)throw new v(d.FunctionNotRecognized);if(r.lengthu.maxParams)throw new v(d.InvalidParameterCount,{name:i.toUpperCase()});return u.evaluate(r)}function nn(i,r){const u=dn[i.toLowerCase()];return u!=null&&r>=u.minParams&&r<=u.maxParams}const dn={min:{minParams:1,maxParams:1,evaluate:i=>rn(i[0],"min")},max:{minParams:1,maxParams:1,evaluate:i=>rn(i[0],"max")},avg:{minParams:1,maxParams:1,evaluate:i=>pn(i[0])},sum:{minParams:1,maxParams:1,evaluate:i=>zs(i[0])},stddev:{minParams:1,maxParams:1,evaluate:i=>Zs(i[0])},count:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].length},var:{minParams:1,maxParams:1,evaluate:i=>vn(i[0])}};function pn(i){if(i===null)return null;let r=0,u=0;for(let c=0;c=h)&&(u=l,c=h)}return u}function zs(i){if(i===null)return null;let r=0;for(let u=0;uc!==null)).length===0)return null;const r=pn(i);if(r===null)return null;let u=0;for(const c of i){if(!te(c))throw new v(d.InvalidValueForAggregateFunction);u+=(r-c)**2}return u/(i.length-1)}class b{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(r){if(r.precision!==null||r.secondary!==null)throw new v(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(r,u){if(u.includes(".")){const c=u.split(".");r.second=parseFloat(c[0]),r.millis=parseInt(c[1],10)}else r.second=parseFloat(u)}static createFromMilliseconds(r){const u=new b;return u.second=r/1e3,u}static createFromValueAndQualifer(r,u,c){let l=null;const h=new b;if(h.op=c==="-"?"-":"+",u.type==="interval-period"){b._fixDefaults(u);const I=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new v(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(r))throw new v(d.IllegalInterval);b._parseSecondsComponent(h,r)}else{if(!I.test(r))throw new v(d.IllegalInterval);h[u.period]=parseFloat(r)}}else{if(b._fixDefaults(u.start),b._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new v(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);h[u.start.period]=parseFloat(r.split(" ")[0]),h[u.end.period]=parseFloat(r.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);{h[u.start.period]=parseFloat(r.split(" ")[0]);const I=r.split(" ")[1].split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{h[u.start.period]=parseFloat(r.split(" ")[0]);const I=r.split(" ")[1].split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1]),b._parseSecondsComponent(h,I[2])}break;default:throw new v(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(r))throw new v(d.IllegalInterval);h.hour=parseFloat(r.split(":")[0]),h.minute=parseFloat(r.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{const I=r.split(":");h.hour=parseFloat(I[0]),h.minute=parseFloat(I[1]),b._parseSecondsComponent(h,I[2])}break;default:throw new v(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new v(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(r))throw new v(d.IllegalInterval);{const I=r.split(":");h.minute=parseFloat(I[0]),b._parseSecondsComponent(h,I[1])}break;default:throw new v(d.IllegalInterval)}}return h}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}const ks=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,Hs=/^(\d{1,2}):(\d{1,2})$/,qs=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,mn=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,js=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,Ys=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,Bs=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$/,Qs=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function bt(i,r){if(r instanceof Ls)return r===jt.instance?_.fromMillis(i.getTime(),{zone:jt.instance}):_.fromJSDate(i,{zone:r});switch(r){case"system":case"local":case null:return _.fromJSDate(i);default:return(r==null?void 0:r.toLowerCase())==="unknown"?_.fromMillis(i.getTime(),{zone:jt.instance}):_.fromJSDate(i,{zone:r})}}function k(i){return typeof i=="number"}function H(i){return typeof i=="string"||i instanceof String}function et(i){return i instanceof b}function Y(i){return i instanceof Date}function M(i){return i instanceof _}function E(i){return i instanceof q}function D(i){return i instanceof Q}function F(i){return i instanceof z}function ee(i){let r=ks.exec(i);if(r!==null){const[,u,c,l]=r,h=Q.fromParts(parseInt(u,10),parseInt(c,10),parseInt(l,10),0);if(h!==null)return h;throw new v(d.InvalidTime)}if(r=Hs.exec(i),r!==null){const[,u,c]=r,l=Q.fromParts(parseInt(u,10),parseInt(c,10),0,0);if(l!==null)return l;throw new v(d.InvalidTime)}if(r=qs.exec(i),r!==null){const[,u,c,l,h]=r,I=Q.fromParts(parseInt(u,10),parseInt(c,10),parseInt(l,10),parseInt(h,10));if(I!==null)return I;throw new v(d.InvalidTime)}throw new v(d.InvalidTime)}function At(i,r,u=!1){let c=js.exec(i);if(c!==null){const[,l,h,I,e,T,O,L]=c,U=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:parseInt(e,10),minute:parseInt(T,10),second:parseInt(O,10),millisecond:L?parseInt(L.replace(".",""),10):0},{zone:Yt(r)});if(U.isValid===!1)throw new v(d.InvalidTimeStamp);return U}if(c=Ys.exec(i),c!==null){const[,l,h,I,e,T,O,L,U,Z,C]=c,A=z.fromParts(parseInt(l,10),parseInt(h,10),parseInt(I,10),parseInt(e,10),parseInt(T,10),parseInt(O,10),L?parseInt(L.replace(".",""),10):0,U==="-",parseInt(Z,10),parseInt(C,10));if(A.isValid===!1)throw new v(d.InvalidTimeStamp);return A}if(c=Bs.exec(i),c!==null){const[,l,h,I,e,T,O,L,U]=c,Z=z.fromParts(parseInt(l,10),parseInt(h,10),parseInt(I,10),parseInt(e,10),parseInt(T,10),0,0,O==="-",parseInt(L,10),parseInt(U,10));if(Z.isValid===!1)throw new v(d.InvalidTimeStamp);return Z}if(c=Qs.exec(i),c!==null){const[,l,h,I,e,T]=c,O=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:parseInt(e,10),minute:parseInt(T,10),second:0},{zone:Yt(r)});if(O.isValid===!1)throw new v(d.InvalidTimeStamp);return O}if(c=mn.exec(i),c!==null){const[,l,h,I]=c,e=_.fromObject({year:parseInt(l,10),month:parseInt(h,10),day:parseInt(I,10),hour:0,minute:0,second:0},{zone:Yt(r)});if(e.isValid===!1)throw new v(d.InvalidTimeStamp);return e}throw new v(d.InvalidTimeStamp)}function hn(i,r){const u=mn.exec(i);if(u===null)try{return At(i,r)}catch{throw new v(d.InvalidDate)}const[,c,l,h]=u,I=q.fromParts(parseInt(c,10),parseInt(l,10),parseInt(h,10));if(I===null)throw new v(d.InvalidDate);return I}const Ws=321408e5,Gs=26784e5,Ks=864e5,Xs=36e5,tl=6e4;function Bt(i){return!!M(i)||!!F(i)}function el(i){return!!M(i)||!!E(i)||!!F(i)||!!D(i)}function xt(i){if(M(i))return i.toMillis();if(E(i))return i.toNumber();if(F(i))return i.toMilliseconds();throw new v(d.InvalidDataType)}function B(i,r,u,c){if(i==null||r==null)return null;if(k(i)){if(k(r))return G(i,r,u);if(H(r))return nl(i,r,u);if(el(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator)}else if(H(i)){if(k(r))return rl(i,r,u);if(H(r))return al(i,r,u);if(M(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator);if(D(r))throw new v(d.InvalidOperator);if(F(r))throw new v(d.InvalidOperator)}else if(M(i)){if(Bt(r)){if(i instanceof _&&ct(i.zone)){if(r instanceof _&&ct(r.zone)===!1||r instanceof z)return ft(i,r,u)}else if(r instanceof _&&ct(r.zone)&&(i instanceof _&&ct(i.zone)===!1||i instanceof z))return ft(i,r,u);return G(xt(i),xt(r),u)}if(H(r))throw new v(d.InvalidOperator);if(E(r))return il(i,r,u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}else if(E(i)){if(F(r))return sl(i,r,u);if(M(r))return ul(i,r,u);if(H(r))throw new v(d.InvalidOperator);if(E(r))return G(i.toNumber(),r.toNumber(),u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}else if(D(i)){if(D(r))return G(i.toNumber(),r.toNumber(),u);if(H(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator);if(E(r))throw new v(d.InvalidOperator);if(Bt(r))throw new v(d.InvalidOperator)}else if(F(i)){if(Bt(r))return r instanceof _&&ct(r.zone)?ft(i,r,u):G(xt(i),xt(r),u);if(H(r))throw new v(d.InvalidOperator);if(E(r))return ol(i,r,u);if(D(r))throw new v(d.InvalidOperator);if(k(r))throw new v(d.InvalidOperator)}switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function G(i,r,u){switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function nl(i,r,u){const c=parseFloat(r);if(!isNaN(c))return G(i,c,u);const l=i.toString();switch(u){case"<>":return l!==r;case"=":return l===r;case">":return l>r;case"<":return l=":return l>=r;case"<=":return l<=r}}function rl(i,r,u){const c=parseFloat(i);if(!isNaN(c))return G(c,r,u);const l=r.toString();switch(u){case"<>":return i!==l;case"=":return i===l;case">":return i>l;case"<":return i=":return i>=l;case"<=":return i<=l}}function al(i,r,u){switch(u){case"<>":return i!==r;case"=":return i===r;case">":return i>r;case"<":return i=":return i>=r;case"<=":return i<=r}}function il(i,r,u){const c=r.toDateTimeLuxon(i.zone);return G((i=i.startOf("day")).toMillis(),c.toMillis(),u)}function ol(i,r,u){const c=r.toDateTimeLuxon(i.toDateTime().zone);return G((i=i.startOfDay()).toMilliseconds(),c.toMillis(),u)}function ul(i,r,u){const c=i.toDateTimeLuxon(r.zone);return r=r.startOf("day"),G(c.toMillis(),r.toMillis(),u)}function sl(i,r,u){const c=i.toDateTimeLuxon(r.toDateTime().zone);return r=r.startOfDay(),G(c.toMillis(),r.toMilliseconds(),u)}function ft(i,r,u){i instanceof z&&(i=i.toDateTime()),r instanceof z&&(r=r.toDateTime());const c=an(i),l=an(r);switch(u){case"<>":return c!==l;case"=":return c===l;case">":return c>l;case"<":return c=":return c>=l;case"<=":return c<=l}}function an(i){return i.year*Ws+i.month*Gs+i.day*Ks+i.hour*Xs+i.minute*tl+1e3*i.second+i.millisecond}function ne(i,r,u){const c=In[i.toLowerCase()];if(c==null)throw new v(d.FunctionNotRecognized);if(r.lengthc.maxParams)throw new v(d.InvalidParameterCount,{name:i.toUpperCase()});return c.evaluate(r,u)}function ll(i,r){const u=In[i.toLowerCase()];return u!=null&&r>=u.minParams&&r<=u.maxParams}function Mt(i){return typeof i=="string"||i instanceof String}function Qt(i){return!Y(i)&&!E(i)&&!M(i)&&!D(i)&&!F(i)}function wn(i){return E(i)||D(i)?i.toString():F(i)?i.toSQLValue():M(i)?i.millisecond===0?i.toFormat("yyyy-LL-dd HH:mm:ss"):i.toSQL({includeOffset:!1}):Y(i)?wn(_.fromJSDate(i)):i.toString()}function cl(i){if(Y(i))return q.fromDateJS(i);if(M(i))return q.fromParts(i.year,i.month,i.day);if(E(i))return i;if(D(i))throw new v(d.CannotCastValue);if(F(i)&&q.fromParts(i.year,i.month,i.day)===null)throw new v(d.CannotCastValue);if(Mt(i)){const r=q.fromReader(i);if(r!==null&&r.isValid)return r}throw new v(d.CannotCastValue)}function fl(i,r,u){if(Y(i))return bt(i,r);if(M(i))return i;if(E(i))return i.toDateTimeLuxon("unknown");if(D(i))throw new v(d.CannotCastValue);if(F(i))return i;if(Mt(i))return At(i,"unknown",u);throw new v(d.CannotCastValue)}function dl(i){if(Y(i))return Q.fromDateJS(i);if(M(i))return Q.fromDateTime(i);if(E(i))throw new v(d.CannotCastValue);if(D(i))return i;if(F(i))return Q.fromSqlTimeStampOffset(i);if(Mt(i))return ee(i);throw new v(d.CannotCastValue)}const In={extract:{minParams:2,maxParams:2,evaluate:([i,r])=>{if(r==null)return null;if(Y(r))switch(i.toUpperCase()){case"SECOND":return r.getSeconds();case"MINUTE":return r.getMinutes();case"HOUR":return r.getHours();case"DAY":return r.getDate();case"MONTH":return r.getMonth()+1;case"YEAR":return r.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(M(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour;case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(E(r))switch(i.toUpperCase()){case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(D(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour}else if(F(r))switch(i.toUpperCase()){case"SECOND":return r.second;case"MINUTE":return r.minute;case"HOUR":return r.hour;case"DAY":return r.day;case"MONTH":return r.month;case"YEAR":return r.year;case"TIMEZONE_HOUR":return r.timezoneOffsetHour;case"TIMEZONE_MINUTE":return r.timezoneOffsetMinutes}throw new v(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:i=>{if(i.length===2){const[r,u]=i;return r==null||u==null?null:r.toString().substring(u-1)}if(i.length===3){const[r,u,c]=i;return r==null||u==null||c==null?null:c<=0?"":r.toString().substring(u-1,u+c-1)}}},position:{minParams:2,maxParams:2,evaluate:([i,r])=>i==null||r==null?null:r.indexOf(i)+1},trim:{minParams:2,maxParams:3,evaluate:i=>{const r=i.length===3,u=r?i[1]:" ",c=r?i[2]:i[1];if(u==null||c==null)return null;const l=`(${_s(u)})`;switch(i[0]){case"BOTH":return c.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return c.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return c.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new v(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.abs(i[0])},ceiling:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.ceil(i[0])},floor:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.floor(i[0])},log:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])},log10:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.log(i[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sin(i[0])},cos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cos(i[0])},tan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tan(i[0])},asin:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.asin(i[0])},acos:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.acos(i[0])},atan:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.atan(i[0])},sign:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0]>0?1:i[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]**i[1]},mod:{minParams:2,maxParams:2,evaluate:i=>i[0]==null||i[1]==null?null:i[0]%i[1]},round:{minParams:1,maxParams:2,evaluate:i=>{const r=i[0],u=i.length===2?10**i[1]:1;return r==null?null:Math.round(r*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:i=>i[0]==null?null:i.length===1?parseInt(i[0].toFixed(0),10):parseFloat(i[0].toFixed(i[1]))},char_length:{minParams:1,maxParams:1,evaluate:i=>Mt(i[0])?i[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:i=>{let r="";for(let u=0;ui[0]==null?null:i[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:i[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:i=>{for(const r of i)if(r!==null)return r;return null}},cosh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.cosh(i[0])},sinh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.sinh(i[0])},tanh:{minParams:1,maxParams:1,evaluate:i=>i[0]==null?null:Math.tanh(i[0])},nullif:{minParams:2,maxParams:2,evaluate:(i,r)=>B(i[0],i[1],"=")?null:i[0]},cast:{minParams:2,maxParams:2,evaluate:(i,r)=>{const u=i[0],c=i[1];if(u===null)return null;switch(c.type){case"integer":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new v(d.CannotCastValue);return l}case"smallint":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new v(d.CannotCastValue);if(l>32767||l<-32767)throw new v(d.CannotCastValue);return l}case"float":case"real":{if(!Qt(u))throw new v(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new v(d.CannotCastValue);return l}case"time":return dl(u);case"date":return cl(u);case"timestamp":return fl(u,r,c.withtimezone===!0);case"varchar":{const l=wn(u);if(l.length>c.size)throw new v(d.CannotCastValue);return l}default:throw new v(d.InvalidDataType)}}}};function gn(i,r,u,c){if(i==="||")return ne("concat",[r,u],c);if(r===null||u===null)return null;if(k(r)){if(k(u))return re(r,u,i);if(et(u))return yl(r,u,i);if(D(u))return El();if(E(u))return Fl();if(F(u))return Ml();if(M(u))return bl();if(H(u))return $l(r,u,i);throw new v(d.InvalidOperator)}if(E(r)){if(k(u))return xl(r,u,i);if(et(u))return Tl(r,u,i);if(D(u))return Jl();if(E(u))return Vl(r,u,i);if(F(u))return Ul(r,u,i);if(M(u))return Rl(r,u,i);if(H(u))return Xl();throw new v(d.InvalidOperator)}if(D(r)){if(k(u))return Cl(r,u,i);if(et(u))return hl(r,u,i);if(D(u))return Bl();if(E(u))return jl();if(F(u))return Yl();if(M(u))return ql();if(H(u))return tc();throw new v(d.InvalidOperator)}if(et(r)){if(k(u))return gl(r,u,i);if(et(u))return Il(r,u,i);if(D(u))return vl(r,u,i);if(E(u))return ml(r,u,i);if(F(u))return wl(r,u,i);if(M(u))return pl(r,u,i);if(H(u))return Ll();throw new v(d.InvalidOperator)}if(M(r)){if(k(u))return Ol(r,u,i);if(et(u))return Nl(r,u,i);if(D(u))return Kl();if(E(u))return Wl(r,u,i);if(F(u))return Gl(r,u,i);if(M(u))return Ql(r,u,i);if(H(u))return ec();throw new v(d.InvalidOperator)}if(F(r)){if(k(u))return Al(r,u,i);if(et(u))return Sl(r,u,i);if(D(u))return zl();if(E(u))return Zl(r,u,i);if(F(u))return Hl(r,u,i);if(M(u))return kl(r,u,i);if(H(u))return nc();throw new v(d.InvalidOperator)}if(H(r)){if(k(u))return Dl(r,u,i);if(et(u))return _l();if(D(u))return rc();if(E(u))return ac();if(F(u))return oc();if(M(u))return ic();if(H(u))return Pl(r,u,i);throw new v(d.InvalidOperator)}throw new v(d.InvalidOperator)}function re(i,r,u){switch(u){case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r}throw new v(d.InvalidOperator)}function pl(i,r,u){switch(u){case"+":return r.plus({milliseconds:i.valueInMilliseconds()});case"-":return i.valueInMilliseconds()-r.toMillis()}throw new v(d.InvalidOperator)}function vl(i,r,u){if(u==="+")return r.plus("milliseconds",i.valueInMilliseconds());throw new v(d.InvalidOperator)}function ml(i,r,u){if(u==="+")return r.plus("milliseconds",i.valueInMilliseconds());throw new v(d.InvalidOperator)}function hl(i,r,u){switch(u){case"+":return i.plus("milliseconds",r.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function wl(i,r,u){if(u==="+")return r.addMilliseconds(i.valueInMilliseconds());throw new v(d.InvalidOperator)}function Il(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i.valueInMilliseconds()+r.valueInMilliseconds());case"-":return b.createFromMilliseconds(i.valueInMilliseconds()-r.valueInMilliseconds());case"*":return b.createFromMilliseconds(i.valueInMilliseconds()*r.valueInMilliseconds());case"/":return b.createFromMilliseconds(i.valueInMilliseconds()/r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function gl(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i.valueInMilliseconds()+r);case"-":return b.createFromMilliseconds(i.valueInMilliseconds()-r);case"*":return b.createFromMilliseconds(i.valueInMilliseconds()*r);case"/":return b.createFromMilliseconds(i.valueInMilliseconds()/r)}throw new v(d.InvalidOperator)}function yl(i,r,u){switch(u){case"+":return b.createFromMilliseconds(i+r.valueInMilliseconds());case"-":return b.createFromMilliseconds(i-r.valueInMilliseconds());case"*":return b.createFromMilliseconds(i*r.valueInMilliseconds());case"/":return b.createFromMilliseconds(i/r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Tl(i,r,u){switch(u){case"+":return i.plus("milliseconds",r.valueInMilliseconds());case"-":return i.plus("milliseconds",-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Nl(i,r,u){switch(u){case"+":return i.plus({milliseconds:r.valueInMilliseconds()});case"-":return i.minus({milliseconds:r.valueInMilliseconds()})}throw new v(d.InvalidOperator)}function Sl(i,r,u){switch(u){case"+":return i.addMilliseconds(r.valueInMilliseconds());case"-":return i.addMilliseconds(-1*r.valueInMilliseconds())}throw new v(d.InvalidOperator)}function Ol(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus({milliseconds:c});case"-":return i.minus({milliseconds:c})}throw new v(d.InvalidOperator)}function xl(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus("milliseconds",c);case"-":return i.plus("milliseconds",-1*c)}throw new v(d.InvalidOperator)}function Cl(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.plus("milliseconds",c);case"-":return i.plus("milliseconds",-1*c)}throw new v(d.InvalidOperator)}function bl(i,r,u){throw new v(d.InvalidOperator)}function Al(i,r,u){const c=1e3*r*24*60*60;switch(u){case"+":return i.addMilliseconds(c);case"-":return i.addMilliseconds(-1*c)}throw new v(d.InvalidOperator)}function Ml(i,r,u){throw new v(d.InvalidOperator)}function El(i,r,u){throw new v(d.InvalidOperator)}function Fl(i,r,u){throw new v(d.InvalidOperator)}function $l(i,r,u){const c=parseFloat(r);if(isNaN(c))throw new v(d.InvalidOperator);return re(i,c,u)}function Dl(i,r,u){const c=parseFloat(i);if(isNaN(c))throw new v(d.InvalidOperator);return re(c,r,u)}function Pl(i,r,u){if(u==="+")return i+r;throw new v(d.InvalidOperator)}function Ll(i,r,u){throw new v(d.InvalidOperator)}function _l(i,r,u){throw new v(d.InvalidOperator)}function Rl(i,r,u){if(u==="-")return i.toDateTimeLuxon(r.zone).diff(r).as("days");throw new v(d.InvalidOperator)}function Ul(i,r,u){if(u==="-")return i.toDateTimeLuxon(r.toDateTime().zone).diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function Vl(i,r,u){if(u==="-")return i.toDateTimeLuxon("UTC").diff(r.toDateTimeLuxon("UTC")).as("days");throw new v(d.InvalidOperator)}function Jl(i,r,u){throw new v(d.InvalidOperator)}function zl(i,r,u){throw new v(d.InvalidOperator)}function Zl(i,r,u){if(u==="-")return i.toDateTime().diff(r.toDateTimeLuxon(i.toDateTime().zone)).as("days");throw new v(d.InvalidOperator)}function kl(i,r,u){if(u==="-")return i.toDateTime().diff(r).as("days");throw new v(d.InvalidOperator)}function Hl(i,r,u){if(u==="-")return i.toDateTime().diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function ql(i,r,u){throw new v(d.InvalidOperator)}function jl(i,r,u){throw new v(d.InvalidOperator)}function Yl(i,r,u){throw new v(d.InvalidOperator)}function Bl(i,r,u){throw new v(d.InvalidOperator)}function Ql(i,r,u){if(u==="-")return i.diff(r).as("days");throw new v(d.InvalidOperator)}function Wl(i,r,u){if(u==="-")return i.diff(r.toDateTimeLuxon(i.zone)).as("days");throw new v(d.InvalidOperator)}function Gl(i,r,u){if(u==="-")return i.diff(r.toDateTime()).as("days");throw new v(d.InvalidOperator)}function Kl(i,r,u){throw new v(d.InvalidOperator)}function Xl(i,r,u){throw new v(d.InvalidOperator)}function tc(i,r,u){throw new v(d.InvalidOperator)}function ec(i,r,u){throw new v(d.InvalidOperator)}function nc(i,r,u){throw new v(d.InvalidOperator)}function rc(i,r,u){throw new v(d.InvalidOperator)}function ac(i,r,u){throw new v(d.InvalidOperator)}function ic(i,r,u){throw new v(d.InvalidOperator)}function oc(i,r,u){throw new v(d.InvalidOperator)}var on,un,Wt={exports:{}};Wt.exports,un=function(){function i(l,h){function I(){this.constructor=l}I.prototype=h.prototype,l.prototype=new I}function r(l,h,I,e){var T=Error.call(this,l);return Object.setPrototypeOf&&Object.setPrototypeOf(T,r.prototype),T.expected=h,T.found=I,T.location=e,T.name="SyntaxError",T}function u(l,h,I){return I=I||" ",l.length>h?l:(h-=l.length,l+(I+=I.repeat(h)).slice(0,h))}function c(l,h){var I,e={},T=(h=h!==void 0?h:{}).grammarSource,O={start:Te},L=Te,U="!",Z="=",C=">=",A=">",j="<=",R="<>",xn="<",ae="!=",Et="+",Ft="-",ie="||",Cn="*",bn="/",An="@",oe="'",ue="N'",dt="''",Mn=".",En="null",Fn="true",$n="false",Dn="in",Pn="is",Ln="like",_n="escape",Rn="not",Un="and",Vn="or",Jn="between",zn="from",Zn="for",kn="substring",Hn="extract",qn="trim",jn="position",Yn="timestamp",Bn="date",Qn="time",Wn="leading",Gn="trailing",Kn="both",Xn="cast",tr="as",er="integer",nr="smallint",rr="float",ar="real",ir="varchar",or="to",ur="interval",sr="year",lr="timezone_hour",cr="timezone_minute",fr="month",dr="day",pr="hour",vr="minute",mr="second",hr="case",wr="end",Ir="when",gr="then",yr="else",Tr=",",Nr="(",Sr=")",se="`",Or=/^[A-Za-z_\x80-\uFFFF]/,xr=/^[A-Za-z0-9_]/,le=/^[A-Za-z0-9_.\x80-\uFFFF]/,Cr=/^["]/,ce=/^[^']/,br=/^[0-9]/,Ar=/^[eE]/,Mr=/^[+\-]/,Er=/^[ \t\n\r]/,fe=/^[^`]/,Fr=y("!",!1),de=y("=",!1),$r=y(">=",!1),Dr=y(">",!1),Pr=y("<=",!1),Lr=y("<>",!1),_r=y("<",!1),Rr=y("!=",!1),$t=y("+",!1),Dt=y("-",!1),Ur=y("||",!1),Vr=y("*",!1),Jr=y("/",!1),zr=X([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),Zr=X([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),pe=X([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),kr=X(['"'],!1,!1),Hr=y("@",!1),ve=y("'",!1),qr=y("N'",!1),me=y("''",!1),he=X(["'"],!0,!1),jr=y(".",!1),Yr=X([["0","9"]],!1,!1),Br=X(["e","E"],!1,!1),Qr=X(["+","-"],!1,!1),Wr=y("NULL",!0),Gr=y("TRUE",!0),Kr=y("FALSE",!0),Xr=y("IN",!0),ta=y("IS",!0),ea=y("LIKE",!0),na=y("ESCAPE",!0),ra=y("NOT",!0),aa=y("AND",!0),ia=y("OR",!0),oa=y("BETWEEN",!0),ua=y("FROM",!0),sa=y("FOR",!0),la=y("SUBSTRING",!0),ca=y("EXTRACT",!0),fa=y("TRIM",!0),da=y("POSITION",!0),pa=y("TIMESTAMP",!0),va=y("DATE",!0),ma=y("TIME",!0),ha=y("LEADING",!0),wa=y("TRAILING",!0),Ia=y("BOTH",!0),ga=y("CAST",!0),ya=y("AS",!0),Ta=y("INTEGER",!0),Na=y("SMALLINT",!0),Sa=y("FLOAT",!0),Oa=y("REAL",!0),xa=y("VARCHAR",!0),Ca=y("TO",!0),ba=y("INTERVAL",!0),Aa=y("YEAR",!0),Ma=y("TIMEZONE_HOUR",!0),Ea=y("TIMEZONE_MINUTE",!0),Fa=y("MONTH",!0),$a=y("DAY",!0),Da=y("HOUR",!0),Pa=y("MINUTE",!0),La=y("SECOND",!0),_a=y("CASE",!0),Ra=y("END",!0),Ua=y("WHEN",!0),Va=y("THEN",!0),Ja=y("ELSE",!0),za=y(",",!1),Za=y("(",!1),ka=y(")",!1),Ha=X([" "," ",` +`,"\r"],!1,!1),we=y("`",!1),Ie=X(["`"],!0,!1),qa=function(t){return t},ja=function(t,a){var o={type:"expression-list"},s=Es(t,a);return o.value=s,o},Ya=function(t,a){return lt(t,a)},Ba=function(t,a){return lt(t,a)},Qa=function(t){return As("NOT",t)},Wa=function(t,a){return a==""||a==null||a==null?t:a.type=="arithmetic"?lt(t,a.tail):Xe(a.op,t,a.right,a.escape)},Ga=function(t){return{type:"arithmetic",tail:t}},Ka=function(t,a){return{op:t+"NOT",right:a}},Xa=function(t,a){return{op:t,right:a}},ti=function(t,a,o){return{op:"NOT"+t,right:{type:"expression-list",value:[a,o]}}},ei=function(t,a,o){return{op:t,right:{type:"expression-list",value:[a,o]}}},ni=function(t){return t[0]+" "+t[2]},ri=function(t){return t[0]+" "+t[2]},ai=function(t,a,o){return{op:t,right:a,escape:o.value}},ii=function(t,a){return{op:t,right:a,escape:""}},oi=function(t,a){return{op:t,right:a}},ui=function(t){return{op:t,right:{type:"expression-list",value:[]}}},si=function(t,a){return{op:t,right:a}},li=function(t,a){return lt(t,a)},ci=function(t,a){return lt(t,a)},fi=function(t){return t.paren=!0,t},di=function(t){return/^CURRENT_DATE$/i.test(t)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(t)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:t}},pi=function(t){return{type:"column-reference",table:"",column:t,delimited:!0}},vi=function(t){return t},mi=function(t,a){return t+a.join("")},hi=function(t,a){return t+a.join("")},wi=function(t){return t},Ii=function(t){return t.join("")},gi=function(){return'"'},yi=function(t){return{type:"parameter",value:t[1]}},Ti=function(t,a){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:t},a]}}},Ni=function(t,a,o){return{type:"function",name:"substring",args:{type:"expression-list",value:o?[t,a,o[2]]:[t,a]}}},Si=function(t,a){return{type:"function",name:"cast",args:{type:"expression-list",value:[t,a]}}},Oi=function(){return{type:"data-type",value:{type:"integer"}}},xi=function(){return{type:"data-type",value:{type:"smallint"}}},Ci=function(){return{type:"data-type",value:{type:"float"}}},bi=function(){return{type:"data-type",value:{type:"real"}}},Ai=function(){return{type:"data-type",value:{type:"date"}}},Mi=function(){return{type:"data-type",value:{type:"timestamp"}}},Ei=function(){return{type:"data-type",value:{type:"time"}}},Fi=function(t){return{type:"data-type",value:{type:"varchar",size:parseInt(t)}}},$i=function(t,a,o){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:t??"BOTH"},a,o]}}},Di=function(t,a){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:t??"BOTH"},a]}}},Pi=function(t,a){return{type:"function",name:"position",args:{type:"expression-list",value:[t,a]}}},Li=function(t,a){return{type:"function",name:t,args:a||{type:"expression-list",value:[]}}},_i=function(t){return t.type==="string"&&Fs(t.value),{type:"timestamp",value:t.value}},Ri=function(t){return t.type==="string"&&$s(t.value),{type:"time",value:t.value}},Ui=function(t,a,o){return{type:"interval",value:a,qualifier:o,op:t}},Vi=function(t,a){return{type:"interval",value:t,qualifier:a,op:""}},Ji=function(t,a){return{type:"interval-qualifier",start:t,end:a}},zi=function(t,a){return{type:"interval-period",period:t.value,precision:a,secondary:null}},Zi=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},ki=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},Hi=function(t,a){return{type:"interval-period",period:"second",precision:t,secondary:a}},qi=function(t){return{type:"interval-period",period:"second",precision:t,secondary:null}},ji=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Yi=function(t,a){return{type:"interval-period",period:t.value,precision:a,secondary:null}},Bi=function(t){return{type:"interval-period",period:t.value,precision:null,secondary:null}},Qi=function(t,a){return{type:"interval-period",period:"second",precision:t,secondary:a}},Wi=function(t){return{type:"interval-period",period:"second",precision:t,secondary:null}},Gi=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Ki=function(){return{type:"string",value:"day"}},Xi=function(){return{type:"string",value:"hour"}},to=function(){return{type:"string",value:"minute"}},eo=function(){return{type:"string",value:"month"}},no=function(){return{type:"string",value:"year"}},ro=function(t){return parseFloat(t)},ao=function(t){return parseFloat(t)},io=function(t){return t.type==="string"&&Ds(t.value),{type:"date",value:t.value}},oo=function(){return{type:"null",value:null}},uo=function(){return{type:"boolean",value:!0}},so=function(){return{type:"boolean",value:!1}},ge=function(){return"'"},lo=function(t){return{type:"string",value:t.join("")}},co=function(t,a){return{type:"case-expression",format:"simple",operand:t,clauses:a,else:null}},fo=function(t,a,o){return{type:"case-expression",format:"simple",operand:t,clauses:a,else:o.value}},po=function(t){return{type:"case-expression",format:"searched",clauses:t,else:null}},vo=function(t,a){return{type:"case-expression",format:"searched",clauses:t,else:a.value}},mo=function(t,a){return{type:"when-clause",operand:t,value:a}},ho=function(t,a){return{type:"when-clause",operand:t,value:a}},wo=function(t){return{type:"else-clause",value:t}},Io=function(t){return{type:"number",value:t}},go=function(t,a,o){return parseFloat(t+a+o)},yo=function(t,a){return parseFloat(t+a)},To=function(t,a){return parseFloat(t+a)},No=function(t){return parseFloat(t)},So=function(t,a){return t[0]+a},Oo=function(t){return"."+(t??"")},xo=function(t,a){return t+a},Co=function(t){return t.join("")},bo=function(t,a){return"e"+(a===null?"":a)},Ao=function(){return"IN"},Mo=function(){return"IS"},Eo=function(){return"LIKE"},Fo=function(){return"ESCAPE"},$o=function(){return"NOT"},Do=function(){return"AND"},Po=function(){return"OR"},Lo=function(){return"BETWEEN"},_o=function(){return"FROM"},Ro=function(){return"FOR"},Uo=function(){return"SUBSTRING"},Vo=function(){return"EXTRACT"},Jo=function(){return"TRIM"},zo=function(){return"POSITION"},Zo=function(){return"TIMESTAMP"},ko=function(){return"DATE"},Ho=function(){return"TIME"},qo=function(){return"LEADING"},jo=function(){return"TRAILING"},Yo=function(){return"BOTH"},Bo=function(){return"CAST"},Qo=function(){return"AS"},Wo=function(){return"INTEGER"},Go=function(){return"SMALLINT"},Ko=function(){return"FLOAT"},Xo=function(){return"REAL"},tu=function(){return"VARCHAR"},eu=function(){return"TO"},nu=function(){return"INTERVAL"},ru=function(){return"YEAR"},au=function(){return"TIMEZONE_HOUR"},iu=function(){return"TIMEZONE_MINUTE"},ou=function(){return"MONTH"},uu=function(){return"DAY"},su=function(){return"HOUR"},lu=function(){return"MINUTE"},cu=function(){return"SECOND"},fu=function(){return"CASE"},du=function(){return"END"},pu=function(){return"WHEN"},vu=function(){return"THEN"},mu=function(){return"ELSE"},hu=function(t){return t},wu=function(t){return t.join("")},n=0,m=0,pt=[{line:1,column:1}],K=0,Pt=[],f=0;if("startRule"in h){if(!(h.startRule in O))throw new Error(`Can't start parsing from rule "`+h.startRule+'".');L=O[h.startRule]}function Lt(t,a){throw gu(t,a=a!==void 0?a:_t(m,n))}function y(t,a){return{type:"literal",text:t,ignoreCase:a}}function X(t,a,o){return{type:"class",parts:t,inverted:a,ignoreCase:o}}function Iu(){return{type:"end"}}function ye(t){var a,o=pt[t];if(o)return o;for(a=t-1;!pt[a];)a--;for(o={line:(o=pt[a]).line,column:o.column};aK&&(K=n,Pt=[]),Pt.push(t))}function gu(t,a){return new r(t,null,null,a)}function yu(t,a,o){return new r(r.buildMessage(t,a),t,a,o)}function Te(){var t,a;return t=n,p(),(a=P())!==e?(p(),m=t,t=qa(a)):(n=t,t=e),t}function Ne(){var t,a,o,s,g,S,x,$;if(t=n,(a=P())!==e){for(o=[],s=n,g=p(),(S=Ot())!==e?(x=p(),($=P())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Ot())!==e?(x=p(),($=P())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=ja(a,o)}else n=t,t=e;return t}function P(){var t,a,o,s,g,S,x,$;if(t=n,(a=Rt())!==e){for(o=[],s=n,g=p(),(S=Ue())!==e?(x=p(),($=Rt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Ue())!==e?(x=p(),($=Rt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=Ya(a,o)}else n=t,t=e;return t}function Rt(){var t,a,o,s,g,S,x,$;if(t=n,(a=vt())!==e){for(o=[],s=n,g=p(),(S=Tt())!==e?(x=p(),($=vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Tt())!==e?(x=p(),($=vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=Ba(a,o)}else n=t,t=e;return t}function vt(){var t,a,o,s,g;return t=n,(a=st())===e&&(a=n,l.charCodeAt(n)===33?(o=U,n++):(o=e,f===0&&w(Fr)),o!==e?(s=n,f++,l.charCodeAt(n)===61?(g=Z,n++):(g=e,f===0&&w(de)),f--,g===e?s=void 0:(n=s,s=e),s!==e?a=o=[o,s]:(n=a,a=e)):(n=a,a=e)),a!==e?(o=p(),(s=vt())!==e?(m=t,t=Qa(s)):(n=t,t=e)):(n=t,t=e),t===e&&(t=Tu()),t}function Tu(){var t,a,o;return t=n,(a=tt())!==e?(p(),(o=Nu())===e&&(o=null),m=t,t=Wa(a,o)):(n=t,t=e),t}function Nu(){var t;return(t=Su())===e&&(t=bu())===e&&(t=xu())===e&&(t=Ou())===e&&(t=Cu()),t}function Su(){var t,a,o,s,g,S,x;if(t=n,a=[],o=n,s=p(),(g=Se())!==e?(S=p(),(x=tt())!==e?o=s=[s,g,S,x]:(n=o,o=e)):(n=o,o=e),o!==e)for(;o!==e;)a.push(o),o=n,s=p(),(g=Se())!==e?(S=p(),(x=tt())!==e?o=s=[s,g,S,x]:(n=o,o=e)):(n=o,o=e);else a=e;return a!==e&&(m=t,a=Ga(a)),t=a}function Se(){var t;return l.substr(n,2)===C?(t=C,n+=2):(t=e,f===0&&w($r)),t===e&&(l.charCodeAt(n)===62?(t=A,n++):(t=e,f===0&&w(Dr)),t===e&&(l.substr(n,2)===j?(t=j,n+=2):(t=e,f===0&&w(Pr)),t===e&&(l.substr(n,2)===R?(t=R,n+=2):(t=e,f===0&&w(Lr)),t===e&&(l.charCodeAt(n)===60?(t=xn,n++):(t=e,f===0&&w(_r)),t===e&&(l.charCodeAt(n)===61?(t=Z,n++):(t=e,f===0&&w(de)),t===e&&(l.substr(n,2)===ae?(t=ae,n+=2):(t=e,f===0&&w(Rr)))))))),t}function Ou(){var t,a,o,s;return t=n,(a=_e())!==e?(p(),(o=st())!==e?(p(),(s=tt())!==e?(m=t,t=Ka(a,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=_e())!==e?(p(),(o=tt())!==e?(m=t,t=Xa(a,o)):(n=t,t=e)):(n=t,t=e)),t}function xu(){var t,a,o,s,g,S;return t=n,(a=st())!==e?(p(),(o=Ve())!==e?(p(),(s=tt())!==e?(p(),(g=Tt())!==e?(p(),(S=tt())!==e?(m=t,t=ti(o,s,S)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Ve())!==e?(p(),(o=tt())!==e?(p(),(s=Tt())!==e?(p(),(g=tt())!==e?(m=t,t=ei(a,o,g)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Oe(){var t,a,o,s,g;return t=n,a=n,(o=st())!==e?(s=p(),(g=Re())!==e?a=o=[o,s,g]:(n=a,a=e)):(n=a,a=e),a!==e&&(m=t,a=ni(a)),(t=a)===e&&(t=Re()),t}function Ut(){var t,a,o,s,g;return t=n,a=n,(o=st())!==e?(s=p(),(g=Ht())!==e?a=o=[o,s,g]:(n=a,a=e)):(n=a,a=e),a!==e&&(m=t,a=ri(a)),(t=a)===e&&(t=Ht()),t}function Cu(){var t,a,o,s;return t=n,(a=Oe())!==e?(p(),(o=nt())!==e?(p(),ss()!==e?(p(),(s=kt())!==e?(m=t,t=ai(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Oe())!==e?(p(),(o=nt())!==e?(m=t,t=ii(a,o)):(n=t,t=e)):(n=t,t=e)),t}function bu(){var t,a,o,s;return t=n,(a=Ut())!==e?(p(),(o=V())!==e?(p(),(s=Ne())!==e?(p(),J()!==e?(m=t,t=oi(a,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Ut())!==e?(p(),(o=V())!==e?(p(),(s=J())!==e?(m=t,t=ui(a)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=Ut())!==e?(p(),(o=Zt())!==e?(m=t,t=si(a,o)):(n=t,t=e)):(n=t,t=e))),t}function tt(){var t,a,o,s,g,S,x,$;if(t=n,(a=Vt())!==e){for(o=[],s=n,g=p(),(S=xe())!==e?(x=p(),($=Vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=xe())!==e?(x=p(),($=Vt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=li(a,o)}else n=t,t=e;return t}function xe(){var t;return l.charCodeAt(n)===43?(t=Et,n++):(t=e,f===0&&w($t)),t===e&&(l.charCodeAt(n)===45?(t=Ft,n++):(t=e,f===0&&w(Dt)),t===e&&(l.substr(n,2)===ie?(t=ie,n+=2):(t=e,f===0&&w(Ur)))),t}function Vt(){var t,a,o,s,g,S,x,$;if(t=n,(a=Jt())!==e){for(o=[],s=n,g=p(),(S=Ce())!==e?(x=p(),($=Jt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);s!==e;)o.push(s),s=n,g=p(),(S=Ce())!==e?(x=p(),($=Jt())!==e?s=g=[g,S,x,$]:(n=s,s=e)):(n=s,s=e);m=t,t=ci(a,o)}else n=t,t=e;return t}function Ce(){var t;return l.charCodeAt(n)===42?(t=Cn,n++):(t=e,f===0&&w(Vr)),t===e&&(l.charCodeAt(n)===47?(t=bn,n++):(t=e,f===0&&w(Jr))),t}function Jt(){var t,a;return(t=ku())===e&&(t=Lu())===e&&(t=_u())===e&&(t=Vu())===e&&(t=Ju())===e&&(t=Ru())===e&&(t=zu())===e&&(t=Xu())===e&&(t=Au())===e&&(t=Zt())===e&&(t=n,V()!==e?(p(),(a=P())!==e?(p(),J()!==e?(m=t,t=fi(a)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Au(){var t,a;return t=n,(a=Mu())!==e&&(m=t,a=di(a)),(t=a)===e&&(t=n,(a=Fu())!==e&&(m=t,a=pi(a)),t=a),t}function Mu(){var t,a;return t=n,(a=Eu())!==e&&(m=t,a=vi(a)),t=a}function Eu(){var t,a,o,s;if(t=n,(a=zt())!==e){for(o=[],s=Ae();s!==e;)o.push(s),s=Ae();m=t,t=mi(a,o)}else n=t,t=e;return t}function be(){var t,a,o,s;if(t=n,(a=zt())!==e){for(o=[],s=N();s!==e;)o.push(s),s=N();m=t,t=hi(a,o)}else n=t,t=e;return t}function zt(){var t;return Or.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(zr)),t}function N(){var t;return xr.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(Zr)),t}function Ae(){var t;return le.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(pe)),t}function Fu(){var t,a;return t=n,mt()!==e?(a=$u(),mt()!==e?(m=t,t=wi(a)):(n=t,t=e)):(n=t,t=e),t}function $u(){var t,a,o;for(t=n,a=[],o=Me();o!==e;)a.push(o),o=Me();return m=t,t=a=Ii(a)}function Me(){var t;return(t=Pu())===e&&(t=Du()),t}function Du(){var t;return t=n,mt()!==e&&mt()!==e?(m=t,t=gi()):(n=t,t=e),t}function Pu(){var t;return le.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(pe)),t}function mt(){var t;return Cr.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(kr)),t}function Zt(){var t,a,o,s;return t=n,a=n,l.charCodeAt(n)===64?(o=An,n++):(o=e,f===0&&w(Hr)),o!==e&&(s=be())!==e?a=o=[o,s]:(n=a,a=e),a!==e&&(m=t,a=yi(a)),t=a}function Lu(){var t,a,o;return t=n,fs()!==e?(p(),V()!==e?(p(),(a=Zu())!==e?(p(),qt()!==e?(p(),(o=P())!==e?(p(),J()!==e?(m=t,t=Ti(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function _u(){var t,a,o,s,g,S,x;return t=n,cs()!==e?(p(),V()!==e?(p(),(a=P())!==e?(p(),qt()!==e?(p(),(o=P())!==e?(p(),s=n,(g=ls())!==e?(S=p(),(x=P())!==e?s=g=[g,S,x,p()]:(n=s,s=e)):(n=s,s=e),s===e&&(s=null),(g=J())!==e?(m=t,t=Ni(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Ru(){var t,a,o;return t=n,hs()!==e?(p(),V()!==e?(p(),(a=P())!==e?(p(),ws()!==e?(p(),(o=Uu())!==e?(p(),J()!==e?(m=t,t=Si(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Uu(){var t,a,o;return t=n,(a=Is())!==e&&(m=t,a=Oi()),(t=a)===e&&(t=n,(a=gs())!==e&&(m=t,a=xi()),(t=a)===e&&(t=n,(a=ys())!==e&&(m=t,a=Ci()),(t=a)===e&&(t=n,(a=Ts())!==e&&(m=t,a=bi()),(t=a)===e&&(t=n,(a=Ze())!==e&&(m=t,a=Ai()),(t=a)===e&&(t=n,(a=ze())!==e&&(m=t,a=Mi()),(t=a)===e&&(t=n,(a=ke())!==e&&(m=t,a=Ei()),(t=a)===e&&(t=n,(a=Ns())!==e?(p(),V()!==e?(p(),(o=rt())!==e?(p(),J()!==e?(m=t,t=Fi(o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)))))))),t}function Vu(){var t,a,o,s;return t=n,Je()!==e?(p(),V()!==e?(p(),(a=Ee())===e&&(a=null),p(),(o=P())!==e?(p(),qt()!==e?(p(),(s=P())!==e?(p(),J()!==e?(m=t,t=$i(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,Je()!==e?(p(),V()!==e?(p(),(a=Ee())===e&&(a=null),p(),(o=P())!==e?(p(),J()!==e?(m=t,t=Di(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Ee(){var t;return(t=ps())===e&&(t=vs())===e&&(t=ms()),t}function Ju(){var t,a,o;return t=n,ds()!==e?(p(),V()!==e?(p(),(a=P())!==e?(p(),Ht()!==e?(p(),(o=P())!==e?(p(),J()!==e?(m=t,t=Pi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function zu(){var t,a,o;return t=n,(a=bs())!==e?(p(),V()!==e?(p(),(o=Ne())===e&&(o=null),p(),J()!==e?(m=t,t=Li(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function Zu(){var t;return(t=qe())===e&&(t=je())===e&&(t=Ye())===e&&(t=Be())===e&&(t=Qe())===e&&(t=at())===e&&(t=Os())===e&&(t=xs()),t}function ku(){var t;return(t=kt())===e&&(t=ns())===e&&(t=Ku())===e&&(t=Gu())===e&&(t=Wu())===e&&(t=Hu())===e&&(t=ju())===e&&(t=qu()),t}function Hu(){var t,a;return t=n,ze()!==e?(p(),(a=nt())!==e?(m=t,t=_i(a)):(n=t,t=e)):(n=t,t=e),t}function qu(){var t,a;return t=n,ke()!==e?(p(),(a=nt())!==e?(m=t,t=Ri(a)):(n=t,t=e)):(n=t,t=e),t}function ju(){var t,a,o,s;return t=n,He()!==e?(p(),l.charCodeAt(n)===45?(a=Ft,n++):(a=e,f===0&&w(Dt)),a===e&&(l.charCodeAt(n)===43?(a=Et,n++):(a=e,f===0&&w($t))),a!==e?(p(),(o=nt())!==e?(p(),(s=Fe())!==e?(m=t,t=Ui(a,o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,He()!==e?(p(),(a=nt())!==e?(p(),(o=Fe())!==e?(m=t,t=Vi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)),t}function Fe(){var t,a,o;return t=n,(a=Yu())!==e?(p(),Ss()!==e?(p(),(o=Bu())!==e?(m=t,t=Ji(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=Qu()),t}function Yu(){var t,a,o;return t=n,(a=ut())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),J()!==e?(m=t,t=zi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=ut())!==e&&(m=t,a=Zi(a)),t=a),t}function Bu(){var t,a,o,s;return t=n,(a=ut())!==e&&(m=t,a=ki(a)),(t=a)===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),Ot()!==e?(p(),(s=ht())!==e?(p(),J()!==e?(m=t,t=Hi(o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),J()!==e?(m=t,t=qi(o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e&&(m=t,a=ji()),t=a))),t}function Qu(){var t,a,o,s;return t=n,(a=ut())!==e?(p(),V()!==e?(p(),(o=ht())!==e?(p(),J()!==e?(m=t,t=Yi(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=ut())!==e&&(m=t,a=Bi(a)),(t=a)===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=wt())!==e?(p(),Ot()!==e?(p(),(s=ht())!==e?(p(),J()!==e?(m=t,t=Qi(o,s)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e?(p(),V()!==e?(p(),(o=ht())!==e?(p(),J()!==e?(m=t,t=Wi(o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t===e&&(t=n,(a=at())!==e&&(m=t,a=Gi()),t=a)))),t}function ut(){var t,a;return t=n,(a=Ye())!==e&&(m=t,a=Ki()),(t=a)===e&&(t=n,(a=Be())!==e&&(m=t,a=Xi()),(t=a)===e&&(t=n,(a=Qe())!==e&&(m=t,a=to()),(t=a)===e&&(t=n,(a=je())!==e&&(m=t,a=eo()),(t=a)===e&&(t=n,(a=qe())!==e&&(m=t,a=no()),t=a)))),t}function ht(){var t,a;return t=n,(a=rt())!==e&&(m=t,a=ro(a)),t=a}function wt(){var t,a;return t=n,(a=rt())!==e&&(m=t,a=ao(a)),t=a}function Wu(){var t,a;return t=n,Ze()!==e?(p(),(a=nt())!==e?(m=t,t=io(a)):(n=t,t=e)):(n=t,t=e),t}function Gu(){var t,a;return t=n,(a=is())!==e&&(m=t,a=oo()),t=a}function Ku(){var t,a;return t=n,(a=os())!==e&&(m=t,a=uo()),(t=a)===e&&(t=n,(a=us())!==e&&(m=t,a=so()),t=a),t}function nt(){var t;return(t=kt())===e&&(t=Zt()),t}function kt(){var t,a,o,s,g;if(t=n,l.charCodeAt(n)===39?(a=oe,n++):(a=e,f===0&&w(ve)),a===e&&(l.substr(n,2)===ue?(a=ue,n+=2):(a=e,f===0&&w(qr))),a!==e){for(o=[],s=n,l.substr(n,2)===dt?(g=dt,n+=2):(g=e,f===0&&w(me)),g!==e&&(m=s,g=ge()),(s=g)===e&&(ce.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(he)));s!==e;)o.push(s),s=n,l.substr(n,2)===dt?(g=dt,n+=2):(g=e,f===0&&w(me)),g!==e&&(m=s,g=ge()),(s=g)===e&&(ce.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(he)));l.charCodeAt(n)===39?(s=oe,n++):(s=e,f===0&&w(ve)),s!==e?(m=t,t=lo(o)):(n=t,t=e)}else n=t,t=e;return t}function Xu(){var t;return(t=ts())===e&&(t=es()),t}function ts(){var t,a,o,s,g;if(t=n,Nt()!==e)if(p(),(a=P())!==e){for(p(),o=[],s=gt();s!==e;)o.push(s),s=gt();s=p(),(g=St())!==e?(m=t,t=co(a,o)):(n=t,t=e)}else n=t,t=e;else n=t,t=e;if(t===e)if(t=n,Nt()!==e)if(p(),(a=P())!==e){for(p(),o=[],s=gt();s!==e;)o.push(s),s=gt();s=p(),(g=$e())!==e?(p(),St()!==e?(m=t,t=fo(a,o,g)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;else n=t,t=e;return t}function es(){var t,a,o,s;if(t=n,Nt()!==e){for(p(),a=[],o=It();o!==e;)a.push(o),o=It();o=p(),(s=St())!==e?(m=t,t=po(a)):(n=t,t=e)}else n=t,t=e;if(t===e)if(t=n,Nt()!==e){for(p(),a=[],o=It();o!==e;)a.push(o),o=It();o=p(),(s=$e())!==e?(p(),St()!==e?(m=t,t=vo(a,s)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function It(){var t,a,o;return t=n,We()!==e?(p(),(a=P())!==e?(p(),Ge()!==e?(p(),(o=P())!==e?(m=t,t=mo(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function gt(){var t,a,o;return t=n,We()!==e?(p(),(a=P())!==e?(p(),Ge()!==e?(p(),(o=P())!==e?(m=t,t=ho(a,o)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e)):(n=t,t=e),t}function $e(){var t,a;return t=n,Cs()!==e?(p(),(a=P())!==e?(m=t,t=wo(a)):(n=t,t=e)):(n=t,t=e),t}function ns(){var t,a,o,s;return t=n,(a=rs())!==e?(o=n,f++,s=zt(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Io(a)):(n=t,t=e)):(n=t,t=e),t}function rs(){var t,a,o,s;return t=n,(a=yt())!==e&&(o=De())!==e&&(s=Pe())!==e?(m=t,t=go(a,o,s)):(n=t,t=e),t===e&&(t=n,(a=yt())!==e&&(o=De())!==e?(m=t,t=yo(a,o)):(n=t,t=e),t===e&&(t=n,(a=yt())!==e&&(o=Pe())!==e?(m=t,t=To(a,o)):(n=t,t=e),t===e&&(t=n,(a=yt())!==e&&(m=t,a=No(a)),t=a))),t}function yt(){var t,a,o;return(t=rt())===e&&(t=n,l.charCodeAt(n)===45?(a=Ft,n++):(a=e,f===0&&w(Dt)),a===e&&(l.charCodeAt(n)===43?(a=Et,n++):(a=e,f===0&&w($t))),a!==e&&(o=rt())!==e?(m=t,t=So(a,o)):(n=t,t=e)),t}function De(){var t,a,o;return t=n,l.charCodeAt(n)===46?(a=Mn,n++):(a=e,f===0&&w(jr)),a!==e?((o=rt())===e&&(o=null),m=t,t=Oo(o)):(n=t,t=e),t}function Pe(){var t,a,o;return t=n,(a=as())!==e&&(o=rt())!==e?(m=t,t=xo(a,o)):(n=t,t=e),t}function rt(){var t,a,o;if(t=n,a=[],(o=Le())!==e)for(;o!==e;)a.push(o),o=Le();else a=e;return a!==e&&(m=t,a=Co(a)),t=a}function Le(){var t;return br.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(Yr)),t}function as(){var t,a,o;return t=n,Ar.test(l.charAt(n))?(a=l.charAt(n),n++):(a=e,f===0&&w(Br)),a!==e?(Mr.test(l.charAt(n))?(o=l.charAt(n),n++):(o=e,f===0&&w(Qr)),o===e&&(o=null),m=t,t=bo(a,o)):(n=t,t=e),t}function is(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===En?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Wr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?t=a=[a,o]:(n=t,t=e)):(n=t,t=e),t}function os(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Fn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Gr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?t=a=[a,o]:(n=t,t=e)):(n=t,t=e),t}function us(){var t,a,o,s;return t=n,l.substr(n,5).toLowerCase()===$n?(a=l.substr(n,5),n+=5):(a=e,f===0&&w(Kr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?t=a=[a,o]:(n=t,t=e)):(n=t,t=e),t}function Ht(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===Dn?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(Xr)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ao()):(n=t,t=e)):(n=t,t=e),t}function _e(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===Pn?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(ta)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Mo()):(n=t,t=e)):(n=t,t=e),t}function Re(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Ln?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ea)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Eo()):(n=t,t=e)):(n=t,t=e),t}function ss(){var t,a,o,s;return t=n,l.substr(n,6).toLowerCase()===_n?(a=l.substr(n,6),n+=6):(a=e,f===0&&w(na)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Fo()):(n=t,t=e)):(n=t,t=e),t}function st(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===Rn?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(ra)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=$o()):(n=t,t=e)):(n=t,t=e),t}function Tt(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===Un?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(aa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Do()):(n=t,t=e)):(n=t,t=e),t}function Ue(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===Vn?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(ia)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Po()):(n=t,t=e)):(n=t,t=e),t}function Ve(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===Jn?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(oa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Lo()):(n=t,t=e)):(n=t,t=e),t}function qt(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===zn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ua)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=_o()):(n=t,t=e)):(n=t,t=e),t}function ls(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===Zn?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(sa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ro()):(n=t,t=e)):(n=t,t=e),t}function cs(){var t,a,o,s;return t=n,l.substr(n,9).toLowerCase()===kn?(a=l.substr(n,9),n+=9):(a=e,f===0&&w(la)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Uo()):(n=t,t=e)):(n=t,t=e),t}function fs(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===Hn?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(ca)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Vo()):(n=t,t=e)):(n=t,t=e),t}function Je(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===qn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(fa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Jo()):(n=t,t=e)):(n=t,t=e),t}function ds(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===jn?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(da)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=zo()):(n=t,t=e)):(n=t,t=e),t}function ze(){var t,a,o,s;return t=n,l.substr(n,9).toLowerCase()===Yn?(a=l.substr(n,9),n+=9):(a=e,f===0&&w(pa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Zo()):(n=t,t=e)):(n=t,t=e),t}function Ze(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Bn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(va)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=ko()):(n=t,t=e)):(n=t,t=e),t}function ke(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Qn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ma)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ho()):(n=t,t=e)):(n=t,t=e),t}function ps(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===Wn?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(ha)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=qo()):(n=t,t=e)):(n=t,t=e),t}function vs(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===Gn?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(wa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=jo()):(n=t,t=e)):(n=t,t=e),t}function ms(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Kn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Ia)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Yo()):(n=t,t=e)):(n=t,t=e),t}function hs(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Xn?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(ga)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Bo()):(n=t,t=e)):(n=t,t=e),t}function ws(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===tr?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(ya)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Qo()):(n=t,t=e)):(n=t,t=e),t}function Is(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===er?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(Ta)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Wo()):(n=t,t=e)):(n=t,t=e),t}function gs(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===nr?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(Na)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Go()):(n=t,t=e)):(n=t,t=e),t}function ys(){var t,a,o,s;return t=n,l.substr(n,5).toLowerCase()===rr?(a=l.substr(n,5),n+=5):(a=e,f===0&&w(Sa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Ko()):(n=t,t=e)):(n=t,t=e),t}function Ts(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===ar?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Oa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=Xo()):(n=t,t=e)):(n=t,t=e),t}function Ns(){var t,a,o,s;return t=n,l.substr(n,7).toLowerCase()===ir?(a=l.substr(n,7),n+=7):(a=e,f===0&&w(xa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=tu()):(n=t,t=e)):(n=t,t=e),t}function Ss(){var t,a,o,s;return t=n,l.substr(n,2).toLowerCase()===or?(a=l.substr(n,2),n+=2):(a=e,f===0&&w(Ca)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=eu()):(n=t,t=e)):(n=t,t=e),t}function He(){var t,a,o,s;return t=n,l.substr(n,8).toLowerCase()===ur?(a=l.substr(n,8),n+=8):(a=e,f===0&&w(ba)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=nu()):(n=t,t=e)):(n=t,t=e),t}function qe(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===sr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Aa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=ru()):(n=t,t=e)):(n=t,t=e),t}function Os(){var t,a,o,s;return t=n,l.substr(n,13).toLowerCase()===lr?(a=l.substr(n,13),n+=13):(a=e,f===0&&w(Ma)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=au()):(n=t,t=e)):(n=t,t=e),t}function xs(){var t,a,o,s;return t=n,l.substr(n,15).toLowerCase()===cr?(a=l.substr(n,15),n+=15):(a=e,f===0&&w(Ea)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=iu()):(n=t,t=e)):(n=t,t=e),t}function je(){var t,a,o,s;return t=n,l.substr(n,5).toLowerCase()===fr?(a=l.substr(n,5),n+=5):(a=e,f===0&&w(Fa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=ou()):(n=t,t=e)):(n=t,t=e),t}function Ye(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===dr?(a=l.substr(n,3),n+=3):(a=e,f===0&&w($a)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=uu()):(n=t,t=e)):(n=t,t=e),t}function Be(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===pr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Da)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=su()):(n=t,t=e)):(n=t,t=e),t}function Qe(){var t,a,o,s;return t=n,l.substr(n,6).toLowerCase()===vr?(a=l.substr(n,6),n+=6):(a=e,f===0&&w(Pa)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=lu()):(n=t,t=e)):(n=t,t=e),t}function at(){var t,a,o,s;return t=n,l.substr(n,6).toLowerCase()===mr?(a=l.substr(n,6),n+=6):(a=e,f===0&&w(La)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=cu()):(n=t,t=e)):(n=t,t=e),t}function Nt(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===hr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(_a)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=fu()):(n=t,t=e)):(n=t,t=e),t}function St(){var t,a,o,s;return t=n,l.substr(n,3).toLowerCase()===wr?(a=l.substr(n,3),n+=3):(a=e,f===0&&w(Ra)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=du()):(n=t,t=e)):(n=t,t=e),t}function We(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===Ir?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Ua)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=pu()):(n=t,t=e)):(n=t,t=e),t}function Ge(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===gr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Va)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=vu()):(n=t,t=e)):(n=t,t=e),t}function Cs(){var t,a,o,s;return t=n,l.substr(n,4).toLowerCase()===yr?(a=l.substr(n,4),n+=4):(a=e,f===0&&w(Ja)),a!==e?(o=n,f++,s=N(),f--,s===e?o=void 0:(n=o,o=e),o!==e?(m=t,t=mu()):(n=t,t=e)):(n=t,t=e),t}function Ot(){var t;return l.charCodeAt(n)===44?(t=Tr,n++):(t=e,f===0&&w(za)),t}function V(){var t;return l.charCodeAt(n)===40?(t=Nr,n++):(t=e,f===0&&w(Za)),t}function J(){var t;return l.charCodeAt(n)===41?(t=Sr,n++):(t=e,f===0&&w(ka)),t}function p(){var t,a;for(t=[],a=Ke();a!==e;)t.push(a),a=Ke();return t}function Ke(){var t;return Er.test(l.charAt(n))?(t=l.charAt(n),n++):(t=e,f===0&&w(Ha)),t}function bs(){var t,a,o,s;if(t=n,(a=be())!==e&&(m=t,a=hu(a)),(t=a)===e)if(t=n,l.charCodeAt(n)===96?(a=se,n++):(a=e,f===0&&w(we)),a!==e){if(o=[],fe.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(Ie)),s!==e)for(;s!==e;)o.push(s),fe.test(l.charAt(n))?(s=l.charAt(n),n++):(s=e,f===0&&w(Ie));else o=e;o!==e?(l.charCodeAt(n)===96?(s=se,n++):(s=e,f===0&&w(we)),s!==e?(m=t,t=wu(o)):(n=t,t=e)):(n=t,t=e)}else n=t,t=e;return t}function As(t,a){return{type:"unary-expression",operator:t,expr:a}}function Xe(t,a,o,s){var g={type:"binary-expression",operator:t,left:a,right:o};return s!==void 0&&(g.escape=s),g}function Ms(t,a){for(var o=[t],s=0;s `+L+` +`+Z+` | +`+O.line+" | "+C+` +`+Z+" | "+u("",T.column-1," ")+u("",A,"^")}else h+=` + at `+L}return h},r.buildMessage=function(l,h){var I={literal:function(C){return'"'+T(C.text)+'"'},class:function(C){var A=C.parts.map(function(j){return Array.isArray(j)?O(j[0])+"-"+O(j[1]):O(j)});return"["+(C.inverted?"^":"")+A.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(C){return C.description}};function e(C){return C.charCodeAt(0).toString(16).toUpperCase()}function T(C){return C.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(A){return"\\x0"+e(A)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(A){return"\\x"+e(A)})}function O(C){return C.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(A){return"\\x0"+e(A)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(A){return"\\x"+e(A)})}function L(C){return I[C.type](C)}function U(C){var A,j,R=C.map(L);if(R.sort(),R.length>0){for(A=1,j=1;A=")&&B(r,u[1],"<=")}static notbetween(r,u,c){return r==null||u[0]==null||u[1]==null?null:B(r,u[0],"<")||B(r,u[1],">")}static ternaryNot(r){return Ct(r)}static ternaryAnd(r,u){return Nn(r,u)}static ternaryOr(r,u){return Sn(r,u)}}let fc=class yn{constructor(r,u,c="UTC"){this.fieldsIndex=u,this.timeZone=c,this.parameters={},this._hasDateFunctions=void 0,this.parseTree=sc.parse(r);const{isStandardized:l,isAggregate:h,referencedFieldNames:I}=this._extractExpressionInfo(u);this._referencedFieldNames=I,this.isStandardized=l,this.isAggregate=h}static convertValueToStorageFormat(r,u=null){if(u===null)return Y(r)?r.getTime():M(r)?r.toMillis():F(r)?r.toStorageFormat():D(r)?r.toStorageString():E(r)?r.toStorageFormat():r;switch(u){case"date":return Y(r)?r.getTime():M(r)?r.toMillis():F(r)?r.toMilliseconds():E(r)?r.toNumber():r;case"date-only":return Y(r)?q.fromDateJS(r).toString():F(r)?q.fromSqlTimeStampOffset(r).toString():M(r)?q.fromDateTime(r).toString():r;case"time-only":return Y(r)?Q.fromDateJS(r).toStorageString():M(r)?Q.fromDateTime(r).toStorageString():F(r)?Q.fromSqlTimeStampOffset(r).toStorageString():D(r)?r.toStorageString():r;case"timestamp-offset":if(Y(r))return z.fromJSDate(r).toStorageFormat();if(M(r))return z.fromDateTime(r).toStorageFormat();if(F(r))return r.toStorageFormat()}return r}static create(r,u,c="UTC"){return new yn(r,u,c)}get fieldNames(){return this._referencedFieldNames}testSet(r,u=ot){return!!this._evaluateNode(this.parseTree,null,u,r)}calculateValue(r,u=ot){const c=this._evaluateNode(this.parseTree,r,u,null);return c instanceof b?c.valueInMilliseconds()/864e5:c}calculateValueCompiled(r,u=ot){return this.parseTree._compiledVersion!=null?this.parseTree._compiledVersion(r,this.parameters,u,this.fieldsIndex,this.timeZone):tn("esri-csp-restrictions")?this.calculateValue(r,u):(this._compileMe(),this.parseTree._compiledVersion(r,this.parameters,u,this.fieldsIndex,this.timeZone))}testFeature(r,u=ot){return!!this._evaluateNode(this.parseTree,r,u,null)}testFeatureCompiled(r,u=ot){return this.parseTree._compiledVersion!=null?!!this.parseTree._compiledVersion(r,this.parameters,u,this.fieldsIndex,this.timeZone):tn("esri-csp-restrictions")?this.testFeature(r,u):(this._compileMe(),!!this.parseTree._compiledVersion(r,this.parameters,u,this.fieldsIndex,this.timeZone))}get hasDateFunctions(){return this._hasDateFunctions!=null||(this._hasDateFunctions=!1,this._visitAll(this.parseTree,r=>{r.type==="current-time"?this._hasDateFunctions=!0:r.type==="function"&&(this._hasDateFunctions=this._hasDateFunctions||lc.has(r.name.toLowerCase()))})),this._hasDateFunctions}getFunctions(){const r=new Set;return this._visitAll(this.parseTree,u=>{u.type==="function"&&r.add(u.name.toLowerCase())}),Array.from(r)}getExpressions(){const r=new Map;return this._visitAll(this.parseTree,u=>{if(u.type==="function"){const c=u.name.toLowerCase(),l=u.args.value[0];if(l.type==="column-reference"){const h=l.column,I=`${c}-${h}`;r.has(I)||r.set(I,{aggregateType:c,field:h})}}}),[...r.values()]}getVariables(){const r=new Set;return this._visitAll(this.parseTree,u=>{u.type==="parameter"&&r.add(u.value.toLowerCase())}),Array.from(r)}_compileMe(){const r="return this.convertInterval("+this.evaluateNodeToJavaScript(this.parseTree)+")";this.parseTree._compiledVersion=new Function("feature","lookups","attributeAdapter","fieldsIndex","timeZone",r).bind(cc)}_extractExpressionInfo(r){const u=[],c=new Set;let l=!0,h=!1;return this._visitAll(this.parseTree,I=>{switch(I.type){case"column-reference":{const e=r==null?void 0:r.get(I.column);let T,O;e?T=O=e.name??"":(O=I.column,T=O.toLowerCase()),c.has(T)||(c.add(T),u.push(O)),I.column=O;break}case"function":{const{name:e,args:T}=I,O=T.value.length;l&&(l=ll(e,O)),h===!1&&(h=nn(e,O));break}}}),{referencedFieldNames:Array.from(u),isStandardized:l,isAggregate:h}}_visitAll(r,u){if(r!=null)switch(u(r),r.type){case"when-clause":this._visitAll(r.operand,u),this._visitAll(r.value,u);break;case"case-expression":for(const c of r.clauses)this._visitAll(c,u);r.format==="simple"&&this._visitAll(r.operand,u),r.else!==null&&this._visitAll(r.else,u);break;case"expression-list":for(const c of r.value)this._visitAll(c,u);break;case"unary-expression":this._visitAll(r.expr,u);break;case"binary-expression":this._visitAll(r.left,u),this._visitAll(r.right,u);break;case"function":this._visitAll(r.args,u)}}evaluateNodeToJavaScript(r){switch(r.type){case"interval":return"this.makeSqlInterval("+this.evaluateNodeToJavaScript(r.value)+", "+JSON.stringify(r.qualifier)+","+JSON.stringify(r.op)+")";case"case-expression":{let u="";if(r.format==="simple"){const c=this.evaluateNodeToJavaScript(r.operand);u="( ";for(let l=0;l=",this.timeZone)&&B(e,T[1],"<=",this.timeZone)}case"NOTBETWEEN":{const e=this._evaluateNode(r.left,u,c,l),T=this._evaluateNode(r.right,u,c,l);return e==null||T[0]==null||T[1]==null?null:B(e,T[0],"<",this.timeZone)||B(e,T[1],">",this.timeZone)}case"LIKE":return Xt(this._evaluateNode(r.left,u,c,l),this._evaluateNode(r.right,u,c,l),r.escape);case"NOT LIKE":return Ct(Xt(this._evaluateNode(r.left,u,c,l),this._evaluateNode(r.right,u,c,l),r.escape));case"<>":case"<":case">":case">=":case"<=":case"=":return B(this._evaluateNode(r.left,u,c,l),this._evaluateNode(r.right,u,c,l),r.operator,this.timeZone);case"-":case"+":case"*":case"/":case"||":return gn(r.operator,this._evaluateNode(r.left,u,c,l),this._evaluateNode(r.right,u,c,l),this.timeZone)}case"null":case"boolean":case"string":case"number":return r.value;case"date":return r.parsedValue??(r.parsedValue=hn(r.value,"unknown")),r.parsedValue;case"timestamp":return r.parsedValue??(r.parsedValue=At(r.value,"unknown")),r.parsedValue;case"time":return ee(r.value);case"current-time":return r.mode==="date"?q.fromNow(this.timeZone):bt(new Date,this.timeZone);case"column-reference":return On(u,r.column,this.fieldsIndex,c);case"data-type":return r.value;case"function":{if(this.isAggregate&&nn(r.name,r.args.value.length)){const T=[];for(const O of((I=r.args)==null?void 0:I.value)||[]){const L=[];for(const U of l||[])L.push(this._evaluateNode(O,U,c,null));T.push(L)}return Js(r.name,T)}const e=this._evaluateNode(r.args,u,c,l);return ne(r.name,e,this.timeZone)}}throw new v(d.UnsupportedSyntax,{node:r.type})}};function Tn(i){return i===!0}function Gt(i){return Array.isArray(i)?i:[i]}function Ct(i){return i!==null?i!==!0:null}function Nn(i,r){return i!=null&&r!=null?i===!0&&r===!0:i!==!1&&r!==!1&&null}function Sn(i,r){return i!=null&&r!=null?i===!0||r===!0:i===!0||r===!0||null}function Kt(i,r){if(i==null)return null;let u=!1;for(const c of r)if(c==null)u=null;else if(i===c){u=!0;break}return u}const sn="-[]/{}()*+?.\\^$|";var it;function dc(i,r){const u=r;let c="",l=it.Normal;for(let h=0;h(pc(i)?i.attributes:i)[r]},wc=Object.freeze(Object.defineProperty({__proto__:null,WhereClause:fc,defaultAttributeAdapter:ot},Symbol.toStringTag,{value:"Module"}));export{wc as W,W as a,v as n,z as r,hc as s,d as t,fc as x}; diff --git a/dist/assets/WorkerTileHandler-9KieSe2P.js b/dist/assets/WorkerTileHandler-9KieSe2P.js new file mode 100644 index 0000000..a1baf27 --- /dev/null +++ b/dist/assets/WorkerTileHandler-9KieSe2P.js @@ -0,0 +1,2 @@ +import{sr as ie,t_ as Le,t$ as k,u0 as me,u1 as ke,cU as ve,u2 as Se,lV as Ce,u3 as be,iZ as Ye,u4 as Ze,u5 as Pe,sp as ee,g as Je,f as He,u6 as oe}from"./index-J0iiHjMT.js";import{h as A,t as Qe,e as Xe,_ as et}from"./TileClipper-NSFZXMR1.js";import{e as Be,t as le,n as se,f as Ee,i as Ke,r as Re,a as E,T as tt,m as st,N as Y,h as ge,l as it}from"./StyleRepository-UhXfhILC.js";import{t as Oe}from"./Rect-bBBxMtVp.js";import{r as rt}from"./pbf-o0zzptPp.js";import{r as nt,c as at,i as ot}from"./TurboLine-SWK4qRwh.js";import{C as lt}from"./BidiEngine-8z8MVveq.js";import"./definitions-DqQMJYPH.js";function ht(u){return u===746||u===747||!(u<4352)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103&&!(u>=65097&&u<=65103)||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351&&!(u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=12592&&u<=12687||u>=43360&&u<=43391||u>=55216&&u<=55295||u>=4352&&u<=4607||u>=44032&&u<=55215||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12688&&u<=12703||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543&&u!==12540||u>=65280&&u<=65519&&!(u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||u>=65104&&u<=65135&&!(u>=65112&&u<=65118||u>=65123&&u<=65126)||u>=5120&&u<=5759||u>=6320&&u<=6399||u>=65040&&u<=65055||u>=19904&&u<=19967||u>=40960&&u<=42127||u>=42128&&u<=42191)}function ct(u){return!(u<11904)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=65280&&u<=65519||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543||u>=65040&&u<=65055||u>=42128&&u<=42191||u>=40960&&u<=42127)}function ut(u){switch(u){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function Fe(u){switch(u){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,We=17;let je=class{constructor(e,t,i,s,r,n,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=i,this._letterSpacing=s,this._hAnchor=r,this._vAnchor=n,this._justify=a}getShaping(e,t,i){const s=this._letterSpacing,r=this._lineHeight,n=this._justify,a=this._maxWidth,o=[];let c=0,h=0;for(const g of e){const I=g.codePointAt(0);if(I==null)continue;const b=i&&ht(I);let m;for(const M of this._glyphItems)if(m=M[I],m)break;o.push({codePoint:I,x:c,y:h,vertical:b,glyphMosaicItem:m}),m&&(c+=m.metrics.advance+s)}let f=c;a>0&&(f=c/Math.max(1,Math.ceil(c/a)));const l=e.includes("​"),d=[],x=o.length;for(let g=0;gb&&Fe(o[m].codePoint);)o[m].glyphMosaicItem=null,--m;if(b<=m){const M=o[b].x;for(let T=b;T<=m;T++)o[T].x-=M,o[T].y=h;let B=o[m].x;o[m].glyphMosaicItem&&(B+=o[m].glyphMosaicItem.metrics.advance),w=Math.max(B,w),n&&this._applyJustification(o,b,m)}_=I,h+=y}if(o.length>0){const g=p.length-1,I=(n-this._hAnchor)*w;let b=(-this._vAnchor*(g+1)+.5)*r;t&&g&&(b+=g*r);for(const m of o)m.x+=I,m.y+=b}return o.filter(g=>g.glyphMosaicItem)}static getTextBox(e,t){if(!e.length)return null;let i=1/0,s=1/0,r=0,n=0;for(const a of e){const o=a.glyphMosaicItem.metrics.advance,c=a.x,h=a.y-We,f=c+o,l=h+t;i=Math.min(i,c),r=Math.max(r,f),s=Math.min(s,h),n=Math.max(n,l)}return{x:i,y:s,width:r-i,height:n-s}}static getBox(e){if(!e.length)return null;let t=1/0,i=1/0,s=0,r=0;for(const n of e){const{height:a,left:o,top:c,width:h}=n.glyphMosaicItem.metrics,f=n.x,l=n.y-(a-Math.abs(c)),d=f+h+o,x=l+a;t=Math.min(t,f),s=Math.max(s,d),i=Math.min(i,l),r=Math.max(r,x)}return{x:t,y:i,width:s-t,height:r-i}}static addDecoration(e,t){const i=e.length;if(i===0)return;const s=3;let r=e[0].x+e[0].glyphMosaicItem.metrics.left,n=e[0].y;for(let o=1;o=0&&a,d=s.allowOverlap&&s.ignorePlacement?null:[],x=[],p=4,w=!l;let y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,g=y,I=_;const b=(l||a)&&o,m=s.size/K;let M=!1;for(const P of t)if(P.vertical){M=!0;break}let B,T=0,D=0;if(!l&&M){const P=je.getTextBox(t,s.lineHeight*K);switch(s.anchor){case k.LEFT:T=P.height/2,D=-P.width/2;break;case k.RIGHT:T=-P.height/2,D=P.width/2;break;case k.TOP:T=P.height/2,D=P.width/2;break;case k.BOTTOM:T=-P.height/2,D=-P.width/2;break;case k.TOP_LEFT:T=P.height;break;case k.BOTTOM_LEFT:D=-P.width;break;case k.TOP_RIGHT:D=P.width;break;case k.BOTTOM_RIGHT:T=-P.height}}T+=s.offset[0]*K,D+=s.offset[1]*K;for(const P of t){const S=P.glyphMosaicItem;if(!S||S.rect.isEmpty)continue;const L=S.rect,v=S.metrics,R=S.page;if(d&&w){if(B!==void 0&&B!==P.y){let C,F,N,z;M?(C=-I+T,F=y+D,N=I-g,z=_-y):(C=y+T,F=g+D,N=_-y,z=I-g);const G={xTile:e.x,yTile:e.y,dxPixels:C*m-c,dyPixels:F*m-c,hard:!s.optional,partIndex:1,width:N*m+2*c,height:z*m+2*c,angle:n,minLod:X,maxLod:se};d.push(G),y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,g=y,I=_}B=P.y}const Z=[];if(l){const C=.5*S.metrics.width,F=(P.x+v.left-p+C)*m*he;if(h=this._placeGlyph(e,h,F,i,e.segment,1,P.vertical,R,Z),o&&(h=this._placeGlyph(e,h,F,i,e.segment,-1,P.vertical,R,Z)),h>=Te)break}else Z.push(new _e(r,f,f,R,!1)),a&&o&&Z.push(new _e(r,f+le,f+le,R,!1));const $=P.x+v.left,j=P.y-We-v.top,J=$+v.width,we=j+v.height;let O,H,ce,ue,Q,fe,Ae,Ve;if(!l&&M)if(P.vertical){const C=($+J)/2-v.height/2,F=(j+we)/2+v.width/2;O=new A(-F-p+T,C-p+D),H=new A(O.x+L.width,O.y+L.height),ce=new A(O.x,H.y),ue=new A(H.x,O.y)}else O=new A(-j+p+T,$-p+D),H=new A(O.x-L.height,O.y+L.width),ce=new A(H.x,O.y),ue=new A(O.x,H.y);else O=new A($-p+T,j-p+D),H=new A(O.x+L.width,O.y+L.height),ce=new A(O.x,H.y),ue=new A(H.x,O.y);for(const C of Z){let F,N,z,G;if(C.alternateVerticalGlyph){if(!Q){const q=(j+we)/2+D;Q=new A(($+J)/2+T-v.height/2-p,q+v.width/2+p),fe=new A(Q.x+L.height,Q.y-L.width),Ae=new A(fe.x,Q.y),Ve=new A(Q.x,fe.y)}F=Q,N=Ae,z=Ve,G=fe}else F=O,N=ce,z=ue,G=H;const de=j,Me=we,ye=C.glyphAngle+n;if(ye!==0){const q=Math.cos(ye),xe=Math.sin(ye);F=F.clone(),N=N==null?void 0:N.clone(),z=z==null?void 0:z.clone(),G=G==null?void 0:G.clone(),F.rotate(q,xe),G==null||G.rotate(q,xe),N==null||N.rotate(q,xe),z==null||z.rotate(q,xe)}let ne=0,ae=256;if(l&&M?P.vertical?C.alternateVerticalGlyph?(ne=32,ae=96):(ne=224,ae=32):(ne=224,ae=96):(ne=192,ae=64),x.push(new ze(F,z,N,G,L,C.labelAngle,ne,ae,C.anchor,C.minzoom,C.maxzoom,C.page)),d&&(!b||this._legible(C.labelAngle))){if(w)$_&&(_=J),Me>I&&(I=Me);else if(C.minzoom=Te)return null;if(d&&w){let P,S,L,v;M?(P=-I+T,S=y+D,L=I-g,v=_-y):(P=y+T,S=g+D,L=_-y,v=I-g);const R={xTile:e.x,yTile:e.y,dxPixels:P*m-c,dyPixels:S*m-c,hard:!s.optional,partIndex:1,width:L*m+2*c,height:v*m+2*c,angle:n,minLod:X,maxLod:se};d.push(R)}const V=new Ue(x);return d&&d.length>0&&(V.textColliders=d),V}_legible(e){const t=Ke(e);return t<65||t>=193}_placeGlyph(e,t,i,s,r,n,a,o,c){let h=n;const f=h<0?Ee(e.angle+le,Re):e.angle;let l=0;i<0&&(h*=-1,i*=-1,l=le),h>0&&++r;let d=new A(e.x,e.y),x=s[r],p=se;if(s.length<=r)return p;for(;;){const w=x.x-d.x,y=x.y-d.y,_=Math.sqrt(w*w+y*y),g=Math.max(i/_,t),I=w/_,b=y/_,m=Ee(Math.atan2(b,I)+l,Re);if(c.push(new _e(d,f,m,o,!1,g,p)),a&&c.push(new _e(d,f,m,o,!0,g,p)),g<=t)return g;d=x.clone();do{if(r+=h,s.length<=r||r<0)return g;x=s[r]}while(d.isEqual(x));let M=x.x-d.x,B=x.y-d.y;const T=Math.sqrt(M*M+B*B);M*=_/T,B*=_/T,d.x-=M,d.y-=B,p=g}}};var re;(function(u){u[u.moveTo=1]="moveTo",u[u.lineTo=2]="lineTo",u[u.close=7]="close"})(re||(re={}));let dt=class{constructor(e,t){this.values={},this._geometry=void 0,this._pbfGeometry=null;const i=t.keys,s=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const n=r.getMessage().asUnsafe(),a=this.values;for(;!n.empty();){const o=n.getUInt32(),c=n.getUInt32();a[i[o]]=s[c]}n.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let i,s;this._pbfGeometry=null,e?e.reset(this.type):i=[];let r,n=re.moveTo,a=0,o=0,c=0;for(;!t.empty();){if(a===0){const h=t.getUInt32();n=7&h,a=h>>3}switch(a--,n){case re.moveTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.moveTo(o,c):i&&(s&&i.push(s),s=[],s.push(new A(o,c)));break;case re.lineTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.lineTo(o,c):s&&s.push(new A(o,c));break;case re.close:e?e.close():s&&!s[0].equals(o,c)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?r=e.result():i&&(s&&i.push(s),r=i),t.release(),this._geometry=r,r}},te=class extends E{constructor(){super(12)}add(e,t,i){const s=this.array;s.push(e),s.push(t),s.push(i)}};class De{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(De._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(e){for(;e.next();)switch(e.tag()){case 1:return e.getString();case 2:return e.getFloat();case 3:return e.getDouble();case 4:return e.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}let yt=class extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,f,l){const d=this.array;let x=E.i1616to32(e,t);d.push(x);const p=31;x=E.i8888to32(Math.round(p*i),Math.round(p*s),Math.round(p*r),Math.round(p*n)),d.push(x),x=E.i8888to32(Math.round(p*a),Math.round(p*o),Math.round(p*c),Math.round(p*h)),d.push(x),x=E.i1616to32(f,0),d.push(x),l&&d.push(...l)}},xt=class extends E{constructor(e){super(e)}add(e,t,i){const s=this.array;s.push(E.i1616to32(e,t)),i&&s.push(...i)}};class gt extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a){const o=this.array,c=this.index;let h=E.i1616to32(e,t);o.push(h);const f=15;return h=E.i8888to32(Math.round(f*i),Math.round(f*s),r,n),o.push(h),a&&o.push(...a),c}}class Ge extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,f,l){const d=this.array;let x=E.i1616to32(e,t);d.push(x),x=E.i1616to32(Math.round(8*i),Math.round(8*s)),d.push(x),x=E.i8888to32(r/4,n/4,o,c),d.push(x),x=E.i8888to32(0,Ke(a),10*h,Math.min(10*f,255)),d.push(x),l&&d.push(...l)}}class pt extends E{constructor(e){super(e)}add(e,t,i,s,r){const n=this.array,a=E.i1616to32(2*e+i,2*t+s);n.push(a),r&&n.push(...r)}}class Ie{constructor(e,t,i){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=i,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,i){}}let _t=class extends Ie{constructor(e,t,i,s,r){super(e,t,i),this.type=me.CIRCLE,this._circleVertexBuffer=s,this._circleIndexBuffer=r}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,i=this._circleIndexBuffer;this._circleIndexStart=3*i.index,this._circleIndexCount=0;const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);for(const n of this._features){const a=n.getGeometry(e);if(!a)continue;const o=s.circleMaterial.encodeAttributes(n,r,s);for(const c of a)if(c)for(const h of c){const f=t.index;t.add(h.x,h.y,0,0,o),t.add(h.x,h.y,0,1,o),t.add(h.x,h.y,1,0,o),t.add(h.x,h.y,1,1,o),i.add(f,f+1,f+2),i.add(f+1,f+2,f+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let r=0;rI.page-b.page);for(const{ddFillAttributes:I,ddOutlineAttributes:b,page:m,geometry:M}of d)this._processFeature(M,h,t.outlineUsesFillColor,I,b,l,m)}}else for(const d of f){const x=n?s.encodeAttributes(d,i,t):null,p=h&&a?r.encodeAttributes(d,i,t):null,w=d.getGeometry(e);this._processFeature(w,h,t.outlineUsesFillColor,x,p,l)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this._fillVertexBuffer.array.length;for(let a=0;ah?(f!==void 0&&this._processFill(e,f,s,n,a),f=[l]):d<-h&&f!==void 0&&f.push(l)}f!==void 0&&this._processFill(e,f,s,n,a)}_processOutline(e,t){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,r=s.index;let n,a,o;const c=new A(0,0),h=new A(0,0),f=new A(0,0);let l=-1,d=-1,x=-1,p=-1,w=-1,y=!1;const _=0;let g=e.length;if(g<2)return;const I=e[_];let b=e[g-1];for(;g&&b.isEqual(I);)--g,b=e[g-1];if(!(g-_<2)){for(let m=_;m8&&(D=8),B>=0?(x=i.add(a.x,a.y,c.x,c.y,0,1,t),p===-1&&(p=x),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),d=i.add(a.x,a.y,D*-f.x,D*-f.y,0,-1,t),w===-1&&(w=d),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),l=d,d=x,x=i.add(a.x,a.y,f.x,f.y,0,1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),d=i.add(a.x,a.y,h.x,h.y,0,1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x)):(x=i.add(a.x,a.y,D*f.x,D*f.y,0,1,t),p===-1&&(p=x),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),d=i.add(a.x,a.y,-c.x,-c.y,0,-1,t),w===-1&&(w=d),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),l=d,d=x,x=i.add(a.x,a.y,-f.x,-f.y,0,-1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x),l=i.add(a.x,a.y,-h.x,-h.y,0,-1,t),l>=0&&d>=0&&x>=0&&!M&&s.add(l,d,x))}l>=0&&d>=0&&p>=0&&!y&&s.add(l,d,p),l>=0&&p>=0&&w>=0&&!y&&s.add(l,w,p),this._outlineIndexCount+=3*(s.index-r)}}_processFill(e,t,i,s,r){s=!0;let n;t.length>1&&(n=[]);let a=0;for(const f of t)a!==0&&n.push(a),a+=e[f].length;const o=2*a,c=ke.acquire();for(const f of t){const l=e[f],d=l.length;for(let x=0;x0){const f=t.map(x=>e[x].length),{buffer:l,vertexCount:d}=nt(c,f);if(d>0){const x=this._fillVertexBuffer.index;for(let p=0;p0){const l=this._fillVertexBuffer.index;let d=0;for(;d=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const i=e.length-1;for(let s=0;sP.page-S.page),r.textured=!0;for(const{ddAttributes:P,page:S,cap:L,join:v,miterLimit:R,roundLimit:Z,halfWidth:$,offset:j,geometry:J}of V)r.capType=L,r.joinType=v,r.miterLimit=R,r.roundLimit=Z,r.halfWidth=$,r.offset=j,this._processFeature(J,P,S)}else{if(o){const V=o.getValue(i),P=this._spriteInfo[V];if(!(P!=null&&P.rect))return}r.textured=!(!o&&!c),r.capType=x,r.joinType=_,r.miterLimit=I,r.roundLimit=m,r.halfWidth=.5*B,r.offset=D;for(const V of s){const P=n?a.encodeAttributes(V,i,t):null;d&&(r.capType=d.getValue(i,V)),y&&(r.joinType=y.getValue(i,V)),g&&(r.miterLimit=g.getValue(i,V)),b&&(r.roundLimit=b.getValue(i,V)),M&&(r.halfWidth=.5*M.getValue(i,V)),T&&(r.offset=T.getValue(i,V));const S=V.getGeometry(e);this._processFeature(S,P)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,t,i,s,r,n,a,o,c,h,f)=>(u._lineVertexBuffer.add(e,t,a,o,i,s,r,n,c,h,f,u._ddValues),u._lineVertexBuffer.index-1),bt=u=>(e,t,i)=>{u._lineIndexBuffer.add(e,t,i)},$e=10;function Pt(u,e){return u.iconMosaicItem&&e.iconMosaicItem?u.iconMosaicItem.page===e.iconMosaicItem.page?0:u.iconMosaicItem.page-e.iconMosaicItem.page:u.iconMosaicItem&&!e.iconMosaicItem?1:!u.iconMosaicItem&&e.iconMosaicItem?-1:0}class U extends Ie{constructor(e,t,i,s,r,n,a,o){super(e,t,o.getSpriteItems()),this.type=me.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=r,this._textIndexBuffer=n,this._placementEngine=a,this._workerTileHandler=o}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(e,t,i){const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);const n=s.getLayoutProperty("icon-image"),a=s.getLayoutProperty("text-field");let o=s.getLayoutProperty("text-transform"),c=s.getLayoutProperty("text-font");const h=[];let f,l,d,x;n&&!n.isDataDriven&&(f=n.getValue(r)),a&&!a.isDataDriven&&(l=a.getValue(r)),o&&o.isDataDriven||(d=s.getLayoutValue("text-transform",r),o=null),c&&c.isDataDriven||(x=s.getLayoutValue("text-font",r),c=null);for(const p of this._features){const w=p.getGeometry(e);if(!w||w.length===0)continue;let y,_;n&&(y=n.isDataDriven?n.getValue(r,p):this._replaceKeys(f,p.values),y&&t(y));let g=!1;if(a&&(_=a.isDataDriven?a.getValue(r,p):this._replaceKeys(l,p.values),_)){switch(_=_.replaceAll("\\n",` +`),o&&(d=o.getValue(r,p)),d){case Se.LOWERCASE:_=_.toLowerCase();break;case Se.UPPERCASE:_=_.toUpperCase()}if(U._bidiEngine.hasBidiChar(_)){let m;m=U._bidiEngine.checkContextual(_)==="rtl"?"IDNNN":"ICNNN",_=U._bidiEngine.bidiTransform(_,m,"VLYSN"),g=!0}if(_.length>0){c&&(x=c.getValue(r,p));for(const m of x){let M=i[m];M||(M=i[m]=new Set);for(const B of _){const T=B.codePointAt(0);T!=null&&M.add(T)}}}}if(!y&&!_)continue;const I=s.getLayoutValue("symbol-sort-key",r,p),b={feature:p,sprite:y,label:_,rtl:g,geometry:w,hash:(_?Ce(_):0)^(y?Ce(y):0),priority:I,textFont:x};h.push(b)}this._symbolFeatures=h}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,i=this.zoom,s=t.getLayoutValue("symbol-placement",i),r=s!==be.POINT,n=t.getLayoutValue("symbol-spacing",i)*he,a=t.getLayoutProperty("icon-image"),o=t.getLayoutProperty("text-field"),c=a?new tt(t,i,r):null,h=o?new st(t,i,r):null,f=this._workerTileHandler;let l;a&&(l=f.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const d=[];let x=1;h&&h.size&&(x=h.size/K);const p=h?h.maxAngle*Be:0,w=h?h.size*he:0;for(const y of this._symbolFeatures){let _;c&&l&&y.sprite&&(_=l[y.sprite],_&&_.sdf&&(this._isIconSDF=!0));let g;_&&c.update(i,y.feature);let I=0;const b=y.label;if(b){Ye(h),h.update(i,y.feature);const m=r&&h.rotationAlignment===ie.MAP?h.keepUpright:h.writingMode&&h.writingMode.includes(Ze.VERTICAL);let M=.5;switch(h.anchor){case k.TOP_LEFT:case k.LEFT:case k.BOTTOM_LEFT:M=0;break;case k.TOP_RIGHT:case k.RIGHT:case k.BOTTOM_RIGHT:M=1}let B=.5;switch(h.anchor){case k.TOP_LEFT:case k.TOP:case k.TOP_RIGHT:B=0;break;case k.BOTTOM_LEFT:case k.BOTTOM:case k.BOTTOM_RIGHT:B=1}let T=.5;switch(h.justify){case Pe.AUTO:T=M;break;case Pe.LEFT:T=0;break;case Pe.RIGHT:T=1}const D=h.letterSpacing*K,V=r?0:h.maxWidth*K,P=h.lineHeight*K,S=y.textFont.map(L=>f.getGlyphItems(L));if(g=new je(S,V,P,D,M,B,T).getShaping(b,y.rtl,m),g&&g.length>0){let L=1e30,v=-1e30;for(const R of g)L=Math.min(L,R.x),v=Math.max(v,R.x);I=(v-L+2*K)*x*he}}for(let m of y.geometry){const M=[];if(s===be.LINE){if(g!=null&&g.length&&(h!=null&&h.size)){const B=h.size*he*(2+Math.min(2,4*Math.abs(h.offset[1])));m=U._smoothVertices(m,B)}U._pushAnchors(M,m,n,I)}else s===be.LINE_CENTER?U._pushCenterAnchor(M,m):y.feature.type===Qe.Polygon?U._pushCentroid(M,m):M.push(new pe(m[0].x,m[0].y));for(const B of M){if(B.x<0||B.x>Ne||B.y<0||B.y>Ne||r&&I>0&&(h==null?void 0:h.rotationAlignment)===ie.MAP&&!U._honorsTextMaxAngle(m,B,I,p,w))continue;const T={shaping:g,line:m,iconMosaicItem:_,anchor:B,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};d.push(T),this._processFeature(T,c,h)}}}d.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=d}serialize(){let e=11;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=U._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer),s=new Float32Array(t.buffer);let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let n=0;ns in t?t[s]:"")}_processFeature(e,t,i){const{line:s,iconMosaicItem:r,shaping:n,anchor:a}=e,o=this.zoom,c=this.layer,h=!!r;let f=!0;h&&(f=(t==null?void 0:t.optional)||!r);const l=n&&n.length>0,d=!l||(i==null?void 0:i.optional);let x,p;if(h&&(x=this._placementEngine.getIconPlacement(a,r,t)),(x||f)&&(l&&(p=this._placementEngine.getTextPlacement(a,n,s,i)),p||d)){if(x&&p||(d||f?d||p?f||x||(p=null):x=null:(x=null,p=null)),p){const w=c.hasDataDrivenText?c.textMaterial.encodeAttributes(e.symbolFeature.feature,o,c):null;if(this._storePlacedGlyphs(e,p.shapes,o,i.rotationAlignment,w),p.textColliders){e.textColliders=p.textColliders;for(const y of p.textColliders){y.minLod=Math.max(o+Y(y.minLod),0),y.maxLod=Math.min(o+Y(y.maxLod),25);const _=y.angle;if(_){const g=Math.cos(_),I=Math.sin(_),b=y.dxPixels*g-y.dyPixels*I,m=y.dxPixels*I+y.dyPixels*g,M=(y.dxPixels+y.width)*g-y.dyPixels*I,B=(y.dxPixels+y.width)*I+y.dyPixels*g,T=y.dxPixels*g-(y.dyPixels+y.height)*I,D=y.dxPixels*I+(y.dyPixels+y.height)*g,V=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*I,P=(y.dxPixels+y.width)*I+(y.dyPixels+y.height)*g,S=Math.min(b,M,T,V),L=Math.max(b,M,T,V),v=Math.min(m,B,D,P),R=Math.max(m,B,D,P);y.dxPixels=S,y.dyPixels=v,y.width=L-S,y.height=R-v}}}}if(x){const w=c.hasDataDrivenIcon?c.iconMaterial.encodeAttributes(e.symbolFeature.feature,o,c):null;if(this._addPlacedIcons(e,x.shapes,o,r.page,t.rotationAlignment===ie.VIEWPORT,w),x.iconColliders){e.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(o+Y(y.minLod),0),y.maxLod=Math.min(o+Y(y.maxLod),25);const _=y.angle;if(_){const g=Math.cos(_),I=Math.sin(_),b=y.dxPixels*g-y.dyPixels*I,m=y.dxPixels*I+y.dyPixels*g,M=(y.dxPixels+y.width)*g-y.dyPixels*I,B=(y.dxPixels+y.width)*I+y.dyPixels*g,T=y.dxPixels*g-(y.dyPixels+y.height)*I,D=y.dxPixels*I+(y.dyPixels+y.height)*g,V=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*I,P=(y.dxPixels+y.width)*I+(y.dyPixels+y.height)*g,S=Math.min(b,M,T,V),L=Math.max(b,M,T,V),v=Math.min(m,B,D,P),R=Math.max(m,B,D,P);y.dxPixels=S,y.dyPixels=v,y.width=L-S,y.height=R-v}}}}}}_addPlacedIcons(e,t,i,s,r,n){const a=Math.max(i-1,0),o=this._iconVertexBuffer,c=this._iconIndexBuffer,h=this._markerMap;for(const f of t){const l=r?0:Math.max(i+Y(f.minzoom),a),d=r?25:Math.min(i+Y(f.maxzoom),25);if(d<=l)continue;const x=f.tl,p=f.tr,w=f.bl,y=f.br,_=f.mosaicRect,g=f.labelAngle,I=f.minAngle,b=f.maxAngle,m=f.anchor,M=o.index,B=_.x,T=_.y,D=B+_.width,V=T+_.height,P=o.index;o.add(m.x,m.y,x.x,x.y,B,T,g,I,b,l,d,n),o.add(m.x,m.y,p.x,p.y,D,T,g,I,b,l,d,n),o.add(m.x,m.y,w.x,w.y,B,V,g,I,b,l,d,n),o.add(m.x,m.y,y.x,y.y,D,V,g,I,b,l,d,n),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===P?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([P,4]),c.add(M,M+1,M+2),c.add(M+1,M+2,M+3),h.has(s)?h.get(s)[1]+=6:h.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,i=this._glyphMap;for(const[s,r]of this._glyphBufferDataStorage)for(const n of r){const a=e.index,o=n.symbolInstance,c=n.ddAttributes,h=e.index;e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.tl[0],n.tl[1],n.xmin,n.ymin,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.tr[0],n.tr[1],n.xmax,n.ymin,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.bl[0],n.bl[1],n.xmin,n.ymax,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.br[0],n.br[1],n.xmax,n.ymax,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===h?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([h,4]),t.add(a,a+1,a+2),t.add(a+1,a+2,a+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,i,s,r){const n=Math.max(i-1,0),a=s===ie.VIEWPORT;let o,c,h,f,l,d,x,p,w,y,_;for(const g of t)o=a?0:Math.max(i+Y(g.minzoom),n),c=a?25:Math.min(i+Y(g.maxzoom),25),!(c<=o)&&(h=g.tl,f=g.tr,l=g.bl,d=g.br,x=g.labelAngle,p=g.minAngle,w=g.maxAngle,y=g.anchor,_=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[h.x,h.y],tr:[f.x,f.y],bl:[l.x,l.y],br:[d.x,d.y],xmin:_.x,ymin:_.y,xmax:_.x+_.width,ymax:_.y+_.height,labelAngle:x,minAngle:p,maxAngle:w,minLod:o,maxLod:c,placementLod:n,symbolInstance:e,ddAttributes:r}))}static _pushAnchors(e,t,i,s){i+=s;let r=0;const n=t.length-1;for(let l=0;l-a;){if(--c,c<0)return!1;n-=A.distance(e[c],o),o=e[c]}n+=A.distance(e[c],e[c+1]);const h=[];let f=0;const l=e.length;for(;nr;)f-=h.shift().deviation;if(Math.abs(f)>s)return!1;n+=A.distance(x,w),c=p}return!0}static _smoothVertices(e,t){if(t<=0)return e;let i=e.length;if(i<3)return e;const s=[];let r=0,n=0;s.push(0);for(let p=1;p0&&(r+=w,s.push(r),n++,n!==p&&(e[n]=e[p]))}if(i=n+1,i<3)return e;t=Math.min(t,.2*r);const a=e[0].x,o=e[0].y,c=e[i-1].x,h=e[i-1].y,f=A.sub(e[0],e[1]);f.normalize(),e[0].x+=t*f.x,e[0].y+=t*f.y,f.assignSub(e[i-1],e[i-2]),f.normalize(),e[i-1].x+=t*f.x,e[i-1].y+=t*f.y,s[0]-=t,s[i-1]+=t;const l=[];l.push(new A(a,o));const d=1e-6,x=.5*t;for(let p=1;p=0;g--){const I=x+s[g+1]-s[p];if(I<0)break;const b=s[g+1]-s[g],m=s[p]-s[g]4096&&(f=4096),f<0&&(f=0),l>4096&&(l=4096),l<0&&(l=0);for(let d=1;d4096&&(x=4096),x<0&&(x=0),p>4096&&(p=4096),p<0&&(p=0),w>4096&&(w=4096),w<0&&(w=0),y>4096&&(y=4096),y<0&&(y=0);const _=(x-f)*(y-l)-(w-f)*(p-l);o+=_*(f+x+w),c+=_*(l+p+y),h+=_}o/=3*h,c/=3*h,isNaN(o)||isNaN(c)||e.push(new pe(o,c))}}U._bidiEngine=new lt;var W;(function(u){u[u.INITIALIZED=0]="INITIALIZED",u[u.NO_DATA=1]="NO_DATA",u[u.READY=2]="READY",u[u.MODIFIED=3]="MODIFIED",u[u.INVALID=4]="INVALID"})(W||(W={}));const Tt=8,Bt=14,Dt=16;class At{constructor(e,t,i,s,r){var h;if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=t,r){this._styleLayerUIDs=new Set;for(const f of r)this._styleLayerUIDs.add(f)}this._styleRepository=s,this._layers=((h=this._styleRepository)==null?void 0:h.layers)??[];const[n,a,o]=t.tileKey.split("/").map(parseFloat);this._level=n;const c=Tt+Math.max((this._level-Bt)*Dt,0);for(const f of Object.keys(e)){const l=e[f];if(this._pbfTiles[f]=new rt(new Uint8Array(l.protobuff),new DataView(l.protobuff)),l.refKey){const[d]=l.refKey.split("/").map(parseFloat),x=n-d;if(x>0){const p=(1<{n.has(h)||(r.push({name:h,repeat:f}),n.add(h))},o={};for(const h of s)h.getResources(h.tileClipper,a,o);if(this._tile.status===W.INVALID)return[];const c=this._fetchResources(r,o,e);return Promise.all([...c,t]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(e){return{signal:e==null?void 0:e.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,layers:i,zoom:s,sourceNameToTileClipper:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:a,returnedBuckets:o,layerIdToBucket:c,referencerUIDToReferencedId:h}=e;for(let f=i.length-1;f>=0;f--){const l=i[f];if(!this._canParseStyleLayer(l.uid)||l.minzoom&&s=l.maxzoom||l.type===ee.BACKGROUND||!t[l.source]||!r[l.source])continue;const d=t[l.source],x=r[l.source],p=l.sourceLayer,w=d[p];if(w){let y=a[l.source];if(y||(y=a[l.source]=new Set),y.add(l.sourceLayer),l.refLayerId)h.set(l.uid,l.refLayerId);else{const _=this._createBucket(l);if(_){_.layerUIDs=[l.uid],_.layerExtent=w.extent,_.tileClipper=x;let g=n[l.source];g||(g=n[l.source]={});let I=g[p];I||(I=g[p]=[]),I.push(_),o.push(_),c[l.id]=_}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:i}=e;i.forEach((s,r)=>{t[s]&&t[s].layerUIDs.push(r)})}_filterFeatures(e){const{signal:t,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:r}=e,n=10*this._level,a=10*(this._level+1),o=[],c=[];for(const h of Object.keys(r))r[h].forEach(f=>{o.push(f),c.push(h)});for(let h=0;h=a)continue;const I=_._maxzoom;if(I&&I<=n)continue}for(const g of x)g.pushFeature(y)}}}_fetchResources(e,t,i){const s=[],r=this._tile.getWorkerTileHandler();let n,a;e.length>0&&(n=r.fetchSprites(e,this._client,i),s.push(n));for(const o in t){const c=t[o];c.size>0&&(a=r.fetchGlyphs(this._tile.tileKey,o,c,this._client,i),s.push(a))}return s}_processFeatures(e){const t=e.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of t)i.processFeatures(i.tileClipper);return t}_parseTileData(e){const t={};for(const i of Object.keys(e)){const s=e[i],r={};for(;s.next();)switch(s.tag()){case 3:{const n=s.getMessage(),a=new De(n);n.release(),r[a.name]=a;break}default:s.skip()}t[i]=r}return t}_createBucket(e){switch(e.type){case ee.BACKGROUND:return null;case ee.FILL:return this._createFillBucket(e);case ee.LINE:return this._createLineBucket(e);case ee.CIRCLE:return this._createCircleBucket(e);case ee.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new mt(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(e.fillMaterial.getStride()),new te,new gt(e.outlineMaterial.getStride()),new te)}_createLineBucket(e){return new wt(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new yt(e.lineMaterial.getStride()),new te)}_createCircleBucket(e){return new _t(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new pt(e.circleMaterial.getStride()),new te)}_createSymbolBucket(e){const t=this._tile;return new U(e,this._level,new Ge(e.iconMaterial.getStride()),new te,new Ge(e.textMaterial.getStride()),new te,t.placementEngine,t.getWorkerTileHandler())}}class Vt{constructor(e,t,i,s){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=e,this.refKeys=t,this._workerTileHandler=i,this._styleRepository=s}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const i=t==null?void 0:t.signal;if(i!=null){const h=()=>{i.removeEventListener("abort",h),this.status=W.INVALID};i.addEventListener("abort",h)}let s;const r={bucketsWithData:[],emptyBuckets:null};try{s=await this._parse(e,t)}catch(h){if(He(h))throw h;return{result:r,transferList:[]}}this.status=W.READY;const n=r.bucketsWithData,a=[];for(const h of s)if(h.hasFeatures()){const f=h.serialize();n.push(f)}else a.push(h.layer.uid);const o=[...n];let c=null;return a.length>0&&(c=Uint32Array.from(a),o.push(c.buffer)),r.emptyBuckets=c,{result:r,transferList:o}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const i=e.sourceName2DataAndRefKey;return Object.keys(i).length===0?[]:(this.status=W.MODIFIED,new At(i,this,t.client,this._styleRepository,e.styleLayerUIDs).parse(t))}}class jt{constructor(){this._spriteInfo={},this._glyphInfo={}}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){var e;return((e=this._styleRepository)==null?void 0:e.layers)??[]}async createTileAndParse(e,t){const{key:i}=e,s={};for(const n of Object.keys(e.sourceName2DataAndRefKey)){const a=e.sourceName2DataAndRefKey[n];s[n]=a.refKey}const r=new Vt(i,s,this,this._styleRepository);try{return await r.parse(e,t)}catch(n){if(r.setObsolete(),r.release(),!He(n))throw n;return null}}updateStyle(e){if(!e||e.length===0||!this._styleRepository)return;const t=this._styleRepository;for(const i of e){const s=i.type,r=i.data;switch(s){case oe.PAINTER_CHANGED:t.setPaintProperties(r.layer,r.paint);break;case oe.LAYOUT_CHANGED:t.setLayoutProperties(r.layer,r.layout);break;case oe.LAYER_REMOVED:t.deleteStyleLayer(r.layer);break;case oe.LAYER_CHANGED:t.setStyleLayer(r.layer,r.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(e){this._styleRepository=new it(e),this._spriteInfo={},this._glyphInfo={}}fetchSprites(e,t,i){const s=[],r=this._spriteInfo;for(const n of e)r[n.name]===void 0&&s.push(n);return s.length===0?Promise.resolve():t.invoke("getSprites",s,{signal:i==null?void 0:i.signal}).then(n=>{for(const a in n){const o=n[a];r[a]=o}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,i,s,r){const n=[];let a=this._glyphInfo[t];return a?i.forEach(o=>{a[o]||n.push(o)}):(a=this._glyphInfo[t]=[],i.forEach(o=>n.push(o))),n.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:e,font:t,codePoints:n},r).then(o=>{for(let c=0;cy(this)),this.guid=`calcite-action-${k()}`,this.indicatorId=`${this.guid}-indicator`,this.buttonId=`${this.guid}-button`,this.handleTooltipSlotChange=t=>{const i=t.target.assignedElements({flatten:!0}).filter(a=>a==null?void 0:a.matches("calcite-tooltip"))[0];i&&(i.referenceElement=this.buttonEl)},this.active=!1,this.alignment=void 0,this.appearance="solid",this.compact=!1,this.disabled=!1,this.icon=void 0,this.iconFlipRtl=!1,this.indicator=!1,this.label=void 0,this.loading=!1,this.scale="m",this.text=void 0,this.textEnabled=!1,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0}onMessagesChange(){}effectiveLocaleChange(){F(this,this.effectiveLocale)}connectedCallback(){var t;z(this),S(this),H(this),(t=this.mutationObserver)==null||t.observe(this.el,{childList:!0,subtree:!0})}async componentWillLoad(){E(this),await R(this)}componentDidLoad(){L(this)}disconnectedCallback(){var t;w(this),M(this),W(this),(t=this.mutationObserver)==null||t.disconnect()}componentDidRender(){I(this)}async setFocus(){var t;await T(this),(t=this.buttonEl)==null||t.focus()}renderTextContainer(){const{text:t,textEnabled:e}=this,i={[o.textContainer]:!0,[o.textContainerVisible]:e};return t?n("div",{class:i,key:"text-container"},t):null}renderIndicatorText(){const{indicator:t,messages:e,indicatorId:i,buttonId:a}=this;return n("div",{"aria-labelledby":a,"aria-live":"polite",class:o.indicatorText,id:i,role:"region"},t?e.indicator:null)}renderIconContainer(){var r;const{loading:t,icon:e,scale:i,el:a,iconFlipRtl:l,indicator:d}=this,u=i==="l"?"l":"m",b=t?n("calcite-loader",{inline:!0,label:this.messages.loading,scale:u}):null,c=e?n("calcite-icon",{class:{[o.indicatorWithIcon]:d},flipRtl:l,icon:e,scale:$(this.scale)}):null,s=b||c,h=s||((r=a.children)==null?void 0:r.length),p=n("div",{class:{[o.slotContainer]:!0,[o.slotContainerHidden]:t}},n("slot",null));return h?n("div",{"aria-hidden":"true",class:o.iconContainer,key:"icon-container"},s,p):null}render(){const{active:t,compact:e,disabled:i,icon:a,loading:l,textEnabled:d,label:u,text:b,indicator:c,indicatorId:s,buttonId:h,messages:p}=this,r=`${u||b}${c?` (${p.indicator})`:""}`,m={[o.button]:!0,[o.buttonTextVisible]:d,[o.buttonCompact]:e};return n(C,null,n("button",{"aria-busy":f(l),"aria-controls":c?s:null,"aria-disabled":f(i),"aria-label":r,"aria-pressed":f(t),class:m,disabled:i,id:h,ref:g=>this.buttonEl=g},this.renderIconContainer(),this.renderTextContainer(),!a&&c&&n("div",{class:o.indicatorWithoutIcon,key:"indicator-no-icon"})),n("slot",{name:V.tooltip,onSlotchange:this.handleTooltipSlotChange}),this.renderIndicatorText())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return _}},[1,"calcite-action",{active:[516],alignment:[513],appearance:[513],compact:[516],disabled:[516],icon:[1],iconFlipRtl:[516,"icon-flip-rtl"],indicator:[516],label:[1],loading:[516],scale:[513],text:[1],textEnabled:[516,"text-enabled"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function U(){if(typeof customElements>"u")return;["calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-action":customElements.get(e)||customElements.define(e,A);break;case"calcite-icon":customElements.get(e)||j();break;case"calcite-loader":customElements.get(e)||D();break}})}U();export{A,U as d}; diff --git a/dist/assets/action-group-8XaPC2xM.js b/dist/assets/action-group-8XaPC2xM.js new file mode 100644 index 0000000..ef60461 --- /dev/null +++ b/dist/assets/action-group-8XaPC2xM.js @@ -0,0 +1,5 @@ +import{q as u,H as d,h7 as m,t as o}from"./index-J0iiHjMT.js";import{c as p,d as h}from"./conditionalSlot-e55zipTI.js";import{c as g,s as f,a as b}from"./loadable-sxY2K1G3.js";import{c as x,d as C}from"./locale-pfkq1d6A.js";import{u as v,c as y,d as M,s as E}from"./t9n-od6MEnI1.js";import{d as S,S as i}from"./action-menu-h_LAlWK7.js";import{d as L}from"./action-W5zDPNjG.js";import{d as O}from"./icon-ZwpY5ksA.js";import{d as k}from"./loader-QqciGs1c.js";import{d as A}from"./popover-Jm1QI0N1.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const a={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},z={menu:"ellipsis"},w={container:"container"},$=':host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0px;--calcite-action-group-columns:3;--calcite-action-group-gap:1px;--calcite-action-group-padding:1px}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-action-group-columns:1}:host([columns="2"]){--calcite-action-group-columns:2}:host([columns="3"]){--calcite-action-group-columns:3}:host([columns="4"]){--calcite-action-group-columns:4}:host([columns="5"]){--calcite-action-group-columns:5}:host([columns="6"]){--calcite-action-group-columns:6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:var(--calcite-ui-background);gap:var(--calcite-action-group-gap);padding:var(--calcite-action-group-gap);grid-template-columns:repeat(var(--calcite-action-group-columns), auto)}:host([hidden]){display:none}[hidden]{display:none}',H=u(class extends d{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.setMenuOpen=t=>{this.menuOpen=!!t.target.open},this.handleMenuActionsSlotChange=t=>{this.hasMenuActions=m(t)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){v(this,this.effectiveLocale)}async setFocus(){await g(this),this.el.focus()}connectedCallback(){x(this),y(this),p(this)}disconnectedCallback(){C(this),M(this),h(this)}async componentWillLoad(){f(this),await E(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:t,menuOpen:e,scale:s,layout:c,messages:n,overlayPositioning:l,hasMenuActions:r}=this;return o("calcite-action-menu",{expanded:t,flipPlacements:["left","right"],hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:e,overlayPositioning:l,placement:c==="horizontal"?"bottom-start":"leading-start",scale:s},o("calcite-action",{icon:z.menu,scale:s,slot:i.trigger,text:n.more,textEnabled:t}),o("slot",{name:a.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),o("slot",{name:a.menuTooltip,slot:i.tooltip}))}render(){return o("div",{"aria-label":this.label,class:w.container,role:"group"},o("slot",null),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]}]);function P(){if(typeof customElements>"u")return;["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,H);break;case"calcite-action":customElements.get(e)||L();break;case"calcite-action-menu":customElements.get(e)||S();break;case"calcite-icon":customElements.get(e)||O();break;case"calcite-loader":customElements.get(e)||k();break;case"calcite-popover":customElements.get(e)||A();break}})}P();export{H as A,a as S,P as d}; diff --git a/dist/assets/action-menu-h_LAlWK7.js b/dist/assets/action-menu-h_LAlWK7.js new file mode 100644 index 0000000..6ea0bee --- /dev/null +++ b/dist/assets/action-menu-h_LAlWK7.js @@ -0,0 +1,19 @@ +import{q as g,H as E,r as v,v as x,B as c,ac as I,t as s,ad as M}from"./index-J0iiHjMT.js";import{g as b}from"./guid-6vN-YNJI.js";import{i as B}from"./key-qdHumIlA.js";import{s as A,a as C,c as w}from"./loadable-sxY2K1G3.js";import{d as D}from"./action-W5zDPNjG.js";import{d as O}from"./icon-ZwpY5ksA.js";import{d as P}from"./loader-QqciGs1c.js";import{d as y}from"./popover-Jm1QI0N1.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function u(e,t){return(e+t)%t}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const r={menu:"menu",defaultTrigger:"default-trigger"},d={tooltip:"tooltip",trigger:"trigger"},S={menu:"ellipsis"},T="data-active",k=`:host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1);color:var(--calcite-ui-text-2)}.menu ::slotted(calcite-action){margin:0.125rem;display:flex;outline-color:transparent}.menu ::slotted(calcite-action[data-active]){outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + );outline-offset:0px}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{flex-direction:column;flex-wrap:nowrap;outline:2px solid transparent;outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,H=["ArrowUp","ArrowDown","End","Home"],L=g(class extends E{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=v(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${b()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:o}=this,i=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==i&&(this.disconnectMenuButtonEl(),this.menuButtonEl=i,this.setTooltipReferenceElement(),i&&(i.active=n,i.setAttribute("aria-controls",t),i.setAttribute("aria-expanded",x(n)),i.setAttribute("aria-haspopup","true"),i.id||(i.id=e),i.label||(i.label=o),i.text||(i.text=o),i.addEventListener("pointerdown",this.menuButtonClick),i.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("pointerdown",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n==null?void 0:n.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=e=>{c(e)&&this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n==null?void 0:n.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:o}=this;e&&(e.referenceElement=!t&&!o?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:o}=this,i=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=i),e.toggleAttribute(T,t===o)},this.updateActions=e=>{e==null||e.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n==null?void 0:n.matches("calcite-action"));this.actionElements=t},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:o,open:i}=this;if(n.length){if(B(t)){if(e.preventDefault(),!i){this.toggleOpen();return}const a=n[o];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,H))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const o=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=u(Math.max(o-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=u(o+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}componentWillLoad(){A(this)}componentDidLoad(){C(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}closeCalciteActionMenuOnClick(e){!c(e)||e.composedPath().includes(this.el)||(this.open=!1)}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await w(this),I(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:o}=this;return s("slot",{name:d.trigger,onSlotchange:this.setMenuButtonEl},s("calcite-action",{appearance:e,class:r.defaultTrigger,icon:S.menu,scale:n,text:t,textEnabled:o,ref:this.setDefaultMenuButtonEl}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:o,menuButtonEl:i,label:a,placement:m,overlayPositioning:h,flipPlacements:p}=this,l=e[t],f=(l==null?void 0:l.id)||null;return s("calcite-popover",{flipPlacements:p,focusTrapDisabled:!0,label:a,offsetDistance:0,open:n,overlayPositioning:h,placement:m,pointerDisabled:!0,referenceElement:i},s("div",{"aria-activedescendant":f,"aria-labelledby":i==null?void 0:i.id,class:r.menu,id:o,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},s("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return s(M,null,this.renderMenuButton(),this.renderMenuItems(),s("slot",{name:d.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return k}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},[[9,"pointerdown","closeCalciteActionMenuOnClick"]]]);function $(){if(typeof customElements>"u")return;["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(t=>{switch(t){case"calcite-action-menu":customElements.get(t)||customElements.define(t,L);break;case"calcite-action":customElements.get(t)||D();break;case"calcite-icon":customElements.get(t)||O();break;case"calcite-loader":customElements.get(t)||P();break;case"calcite-popover":customElements.get(t)||y();break}})}$();export{d as S,$ as d}; diff --git a/dist/assets/analysisViewUtils-AQaQeJpR.js b/dist/assets/analysisViewUtils-AQaQeJpR.js new file mode 100644 index 0000000..796beaf --- /dev/null +++ b/dist/assets/analysisViewUtils-AQaQeJpR.js @@ -0,0 +1 @@ +import{fZ as c,b as s,w as v,ak as r,d as u,A as w}from"./index-J0iiHjMT.js";function y(t,n){t.interactive=!0;const{tool:a,view:e}=t;e.activeTool=a;let i=c(n,()=>{e.activeTool===a&&(e.activeTool=null)});return s(async o=>{await v(()=>a==null||!a.active,o),i=r(i)},n)}function $(t,n){return u(()=>t.interactive,()=>f(t,n),w)}function f(t,n){t.interactive?d(t,n):l(t)}function d(t,n){l(t);const{view:a,analysis:e}=t,i=new n({view:a,analysis:e,analysisViewData:t});return t.tool=i,a.tools.add(i),i}function l(t){const{view:n,tool:a}=t;a!=null&&(n.tools.remove(a),t.tool=null)}export{$ as a,y as l,l as v}; diff --git a/dist/assets/apng-yUSt3z2o.js b/dist/assets/apng-yUSt3z2o.js new file mode 100644 index 0000000..9c67b1f --- /dev/null +++ b/dist/assets/apng-yUSt3z2o.js @@ -0,0 +1 @@ +import{cg as G,s as S,gM as V}from"./index-J0iiHjMT.js";var R,T,k={exports:{}};k.exports,R=k,k.exports,T=function(){return function(b){var l={};function s(a){if(l[a])return l[a].exports;var h=l[a]={exports:{},id:a,loaded:!1};return b[a].call(h.exports,h,h.exports,s),h.loaded=!0,h.exports}return s.m=b,s.c=l,s.p="",s(0)}([function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.isNotPNG=n,l.isNotAPNG=r,l.default=t;var a=p(s(1)),h=s(2);function p(u){return u&&u.__esModule?u:{default:u}}var y=new Error("Not a PNG"),e=new Error("Not an animated PNG");function n(u){return u===y}function r(u){return u===e}var i=new Uint8Array([137,80,78,71,13,10,26,10]);function t(u){var g=new Uint8Array(u);if(Array.prototype.some.call(i,function(L,w){return L!==g[w]}))return y;var _=!1;if(o(g,function(L){return!(_=L==="acTL")}),!_)return e;var d=[],O=[],P=null,c=null,I=0,x=new h.APNG;if(o(g,function(L,w,f,U){var F=new DataView(w.buffer);switch(L){case"IHDR":P=w.subarray(f+8,f+8+U),x.width=F.getUint32(f+8),x.height=F.getUint32(f+12);break;case"acTL":x.numPlays=F.getUint32(f+8+4);break;case"fcTL":c&&(x.frames.push(c),I++),(c=new h.Frame).width=F.getUint32(f+8+4),c.height=F.getUint32(f+8+8),c.left=F.getUint32(f+8+12),c.top=F.getUint32(f+8+16);var M=F.getUint16(f+8+20),N=F.getUint16(f+8+22);N===0&&(N=100),c.delay=1e3*M/N,c.delay<=10&&(c.delay=100),x.playTime+=c.delay,c.disposeOp=F.getUint8(f+8+24),c.blendOp=F.getUint8(f+8+25),c.dataParts=[],I===0&&c.disposeOp===2&&(c.disposeOp=1);break;case"fdAT":c&&c.dataParts.push(w.subarray(f+8+4,f+8+U));break;case"IDAT":c&&c.dataParts.push(w.subarray(f+8,f+8+U));break;case"IEND":O.push(E(w,f,12+U));break;default:d.push(E(w,f,12+U))}}),c&&x.frames.push(c),x.frames.length==0)return e;var j=new Blob(d),C=new Blob(O);return x.frames.forEach(function(L){var w=[];w.push(i),P.set(D(L.width),0),P.set(D(L.height),4),w.push(A("IHDR",P)),w.push(j),L.dataParts.forEach(function(f){return w.push(A("IDAT",f))}),w.push(C),L.imageData=new Blob(w,{type:"image/png"}),delete L.dataParts,w=null}),x}function o(u,g){var _=new DataView(u.buffer),d=8,O=void 0,P=void 0,c=void 0;do P=_.getUint32(d),c=g(O=v(u,d+4,4),u,d,P),d+=12+P;while(c!==!1&&O!="IEND"&&d>>24&255,u>>>16&255,u>>>8&255,255&u])}},function(b,l){Object.defineProperty(l,"__esModule",{value:!0}),l.default=function(y){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,i=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.length-e);r>>8^s[255&(n^y[r])];return-1^n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var h=a,p=0;p<8;p++)h=1&h?3988292384^h>>>1:h>>>1;s[a]=h}},function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0}),l.Frame=l.APNG=void 0;var a=function(){function e(n,r){for(var i=0;i1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new h.default(r,n,i)})}}]),e}(),l.Frame=function(){function e(){y(this,e),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,i){var t=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(t),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(t),n.imageElement=null,i(new Error("Image creation error"))},n.imageElement.src=t})}}]),e}()},function(b,l,s){Object.defineProperty(l,"__esModule",{value:!0});var a=function(){function r(i,t){for(var o=0;o=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var t=this.currentFrame;this._prevFrame=t,this._prevFrameData=null,t.disposeOp==2&&(this._prevFrameData=this.context.getImageData(t.left,t.top,t.width,t.height)),t.blendOp==0&&this.context.clearRect(t.left,t.top,t.width,t.height),this.context.drawImage(t.imageElement,t.left,t.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var t=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var o=performance.now()+this.currentFrame.delay/this.playbackRate,v=function m(E){if(!t._ended&&!t._paused){if(E>=o){for(;E-o>=t._apng.playTime/t.playbackRate;)o+=t._apng.playTime/t.playbackRate,t._numPlays++;do t.renderNextFrame(),o+=t.currentFrame.delay/t.playbackRate;while(!t._ended&&E>o)}requestAnimationFrame(m)}};requestAnimationFrame(v)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),i}(h(s(4)).default);l.default=n},function(b,l){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function h(e){return typeof e=="number"}function p(e){return typeof e=="object"&&e!==null}function y(e){return e===void 0}b.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!h(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,i,t,o,v;if(this._events||(this._events={}),e==="error"&&(!this._events.error||p(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(y(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:t=Array.prototype.slice.call(arguments,1),r.apply(this,t)}else if(p(r))for(t=Array.prototype.slice.call(arguments,1),i=(v=r.slice()).length,o=0;o0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(e,i),this},s.prototype.removeListener=function(e,n){var r,i,t,o;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(t=(r=this._events[e]).length,i=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(p(r)){for(o=t;o-- >0;)if(r[o]===n||r[o].listener&&r[o].listener===n){i=o;break}if(i<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},R.exports=T();const q=G(k.exports);async function z(b,l){const s=q(b);if(s instanceof Error)throw s;await s.createImages(),S(l);const{frames:a,width:h,height:p}=s,y=document.createElement("canvas");y.width=h,y.height=p;const e=y.getContext("2d",{willReadFrequently:!0}),n=[],r=[];let i=0;for(const t of a){const o=V(t.delay||100);r.push(o),i+=o;const v=t.imageElement;t.blendOp===0?e.globalCompositeOperation="copy":e.globalCompositeOperation="source-over";const m=t.disposeOp===2?e.getImageData(t.left,t.top,t.width,t.height):void 0;e.drawImage(v,t.left,t.top);const E=e.getImageData(0,0,h,p);n.push(E),t.disposeOp===0||(t.disposeOp===1?e.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&e.putImageData(m,t.left,t.top))}return{frameCount:a.length,duration:i,frameDurations:r,getFrame:t=>n[t],width:h,height:p}}const B=[137,80,78,71,13,10,26,10];function $(b){const l=new Uint8Array(b);return!B.some((s,a)=>s!==l[a])}function J(b){if(!$(b))return!1;const l=new DataView(b),s=new Uint8Array(b);let a,h=8;do{const p=l.getUint32(h);if(a=String.fromCharCode.apply(String,Array.prototype.slice.call(s.subarray(h+4,h+8))),a==="acTL")return!0;h+=12+p}while(a!=="IEND"&&h13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"تغيير مقياس الرسم",Play:"تشغيل",Stop:"إيقاف تشغيل",Legend:"وسيلة الإيضاح","Press ENTER to toggle":"",Loading:"تحميل",Home:"الصفحة الرئيسية",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"طباعة",Image:"صورة",Data:"بيانات",Print:"طباعة","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"من %1 إلى %2","From %1":"من %1","To %1":"إلى %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/arcadeAsyncRuntime-RlgIDugP.js b/dist/assets/arcadeAsyncRuntime-RlgIDugP.js new file mode 100644 index 0000000..a11f7bd --- /dev/null +++ b/dist/assets/arcadeAsyncRuntime-RlgIDugP.js @@ -0,0 +1,2 @@ +import{C as se,$ as ce,m as ue,W as fe,f as we,n as pe,G as I,a as l,r as s,e as W,o as de,s as X,F as y,M as O,w as p,O as S,R as E,v,p as he,u as ge,P as h,N as F,q as B,b as $,U as M,H as me,z as R,c as d,L as z,d as N,g as ye,h as q,I as ve,i as be,D as ee,j as Se,k as D,l as H,t as xe}from"./arcadeUtils-OUqwHs4P.js";import{registerFunctions as Ie}from"./geomasync-_hAyjeTi.js";import{ar as ne,ha as Y}from"./index-J0iiHjMT.js";import"./TimeOnly-ljWtUK7N.js";import"./hash-SS5GKVPY.js";import"./portalUtils-MqaWunxU.js";import"./geometryEngineAsync-QjQc0riy.js";function J(n){return n&&typeof n.then=="function"}const j=100;async function V(n,e){const t=[];for(let r=0;r{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,null);return K(this.definition,r,t,null)}}call(e,t){return L(e,t,(r,o,a)=>{const i={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,t);return K(this.definition,i,a,t)})}marshalledCall(e,t,r,o){return o(e,t,async(a,i,u)=>{const f={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:{}};return u=u.map(w=>!v(w)||w instanceof D?w:H(w,e,o)),H(await K(this.definition,f,u,t),r,o)})}}class C extends xe{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await c(this.executingContext,t.node),t.valueset=!0),v(t.value)&&!(t.value instanceof D)){const r=new D;r.fn=t.value,r.parameterEvaluator=L,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(v(t))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}async loadModule(e){let t=e.spatialReference;t==null&&(t=new ne({wkid:102100})),this.moduleScope=ie({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,services:e.services,libraryResolver:new X(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:e.abortSignal===void 0||e.abortSignal===null?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console??le,lrucache:e.lrucache,timeZone:e.timeZone??null,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await c(this.executingContext,this.source.syntax)}}async function L(n,e,t){if(e.preparsed===!0){const o=t(n,null,e.arguments);return J(o),o}const r=t(n,e,await V(n,e));return J(r),r}async function c(n,e,t){if(e.breakpoint&&t!==!0)return await e.breakpoint(),c(n,e,!0);try{switch(e==null?void 0:e.type){case"VariableDeclarator":return await Ze(n,e);case"ImportDeclaration":return await De(n,e);case"ExportNamedDeclaration":return await Ge(n,e);case"VariableDeclaration":return await re(n,e,0);case"BlockStatement":case"Program":return await Pe(n,e);case"FunctionDeclaration":return await qe(n,e);case"ReturnStatement":return await Ke(n,e);case"IfStatement":return await je(n,e);case"ExpressionStatement":return await $e(n,e);case"UpdateExpression":return await Ee(n,e);case"AssignmentExpression":return await Be(n,e);case"ForStatement":return await Ne(n,e);case"WhileStatement":return await Ae(n,e);case"ForInStatement":return await ke(n,e);case"BreakStatement":return S;case"EmptyStatement":return p;case"ContinueStatement":return E;case"TemplateElement":return await He(n,e);case"TemplateLiteral":return await Je(n,e);case"Identifier":return await _(n,e);case"MemberExpression":return await Te(n,e);case"Literal":return e.value;case"CallExpression":return await ze(n,e);case"UnaryExpression":return await Ue(n,e);case"BinaryExpression":return await Ve(n,e);case"LogicalExpression":return await _e(n,e);case"ArrayExpression":return await We(n,e);case"ObjectExpression":return await Ce(n,e);case"Property":return await Re(n,e);default:throw new l(n,s.Unrecognized,e)}}catch(r){throw ge(n,e,r)}}async function Ce(n,e){const t=[];for(let i=0;i{try{t.testResult===!0?++a>j?(a=0,setTimeout(()=>{k(n,e,t,r,o,a)},0)):k(n,e,t,r,o,a):t.lastAction instanceof y?r(t.lastAction):r(p)}catch(i){o(i)}},i=>{o(i)})}catch(i){o(i)}}function Ne(n,e){try{return e.init!==null?c(n,e.init).then(()=>new Promise((t,r)=>{k(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})):new Promise((t,r)=>{k(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})}catch(t){return Promise.reject(t)}}function G(n,e,t,r,o,a,i,u,f,w){try{if(r<=a)return void u(p);o.value=i==="k"?t[a]:a,c(n,e.body).then(m=>{try{m instanceof y?u(m):m===S?u(p):++w>j?(w=0,setTimeout(()=>{G(n,e,t,r,o,a+1,i,u,f,w)},0)):G(n,e,t,r,o,a+1,i,u,f,w)}catch(P){f(P)}},m=>{f(m)})}catch(m){f(m)}}function Z(n,e,t,r,o,a,i,u,f){try{if(t.length()<=o)return void i(p);r.value=a==="k"?t.get(o):o,c(n,e.body).then(w=>{w instanceof y?i(w):w===S?i(p):++f>j?(f=0,setTimeout(()=>{Z(n,e,t,r,o+1,a,i,u,f)},0)):Z(n,e,t,r,o+1,a,i,u,f)},w=>{u(w)})}catch(w){u(w)}}function T(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(p);G(n,e,t,t.length,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Le(n,e,t,r,o,a){try{if(a===void 0&&(a="i"),t.length===0)return void r.resolve(p);Z(n,e,t,o,0,a,i=>{r.resolve(i)},i=>{r.reject(i)},0)}catch(i){r.reject(i)}}function Oe(n,e,t,r,o){try{T(n,e,t.keys(),r,o,"k")}catch(a){r.reject(a)}}function U(n,e,t,r,o,a,i,u){try{n.next().then(f=>{try{if(f===null)a(p);else{const w=ee.createFromGraphicLikeObject(f.geometry,f.attributes,r,e.timeZone);w._underlyingGraphic=f,o.value=w,c(e,t.body).then(m=>{try{m===S?a(p):m instanceof y?a(m):++u>j?(u=0,setTimeout(()=>{U(n,e,t,r,o,a,i,u)},0)):U(n,e,t,r,o,a,i,u)}catch(P){i(P)}},m=>{i(m)})}}catch(w){i(w)}},f=>{i(f)})}catch(f){i(f)}}async function ke(n,e){return new Promise((t,r)=>{c(n,e.right).then(o=>{try{let a=null;a=e.left.type==="VariableDeclaration"?c(n,e.left):Promise.resolve(),a.then(()=>{try{let i="";if(e.left.type==="VariableDeclaration"){const f=e.left.declarations[0].id;f.type==="Identifier"&&(i=f.name)}else e.left.type==="Identifier"&&(i=e.left.name);if(!i)throw new l(n,s.InvalidIdentifier,e);i=i.toLowerCase();let u=null;if(n.localScope!=null&&n.localScope[i]!==void 0&&(u=n.localScope[i]),u===null&&n.globalScope[i]!==void 0&&(u=n.globalScope[i]),u===null)return void r(new l(n,s.InvalidIdentifier,e));B(o)||h(o)?T(n,e,o,{reject:r,resolve:t},u):$(o)?Le(n,e,o,{reject:r,resolve:t},u):o instanceof F||M(o)?Oe(n,e,o,{reject:r,resolve:t},u):me(o)?U(o.iterator(n.abortSignal),n,e,o,u,f=>{t(f)},f=>{r(f)},0):T(n,e,[],{reject:r,resolve:t},u)}catch(i){r(i)}},r)}catch(a){r(a)}},r)})}async function Ee(n,e){const t=e.argument;if(t.type==="MemberExpression"){const a={t:null},i=await c(n,t.object);let u=null;a.t=i,t.computed===!0?u=await c(n,t.property):t.property.type==="Identifier"&&(u=t.property.name);const f=a.t;let w;if(B(f)){if(!R(u))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(u<0&&(u=f.length+u),u<0||u>=f.length)throw new l(n,s.OutOfBounds,e);w=d(f[u]),f[u]=e.operator==="++"?w+1:w-1}else if(f instanceof F){if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});w=d(f.field(u)),f.setField(u,e.operator==="++"?w+1:w-1)}else if(f instanceof C){if(h(u)===!1)throw new l(n,s.ModuleAccessorMustBeString,e);if(f.hasGlobal(u)!==!0)throw new l(n,s.ModuleExportNotFound,e);w=d(await f.global(u)),f.setGlobal(u,e.operator==="++"?w+1:w-1)}else{if(!M(f))throw $(f)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});w=d(f.field(u)),f.setField(u,e.operator==="++"?w+1:w-1)}return e.prefix===!1?w:e.operator==="++"?w+1:w-1}const r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"";if(!r)throw new l(n,s.InvalidIdentifier,e);let o;if(n.localScope!=null&&n.localScope[r]!==void 0)return o=d(n.localScope[r].value),n.localScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;if(n.globalScope[r]!==void 0)return o=d(n.globalScope[r].value),n.globalScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;throw new l(n,s.InvalidIdentifier,e)}function b(n,e,t,r,o){switch(e){case"=":return n===p?null:n;case"/=":return d(t)/d(n);case"*=":return d(t)*d(n);case"-=":return d(t)-d(n);case"+=":return h(t)||h(n)?N(t)+N(n):d(t)+d(n);case"%=":return d(t)%d(n);default:throw new l(o,s.UnsupportedOperator,r)}}async function Be(n,e){const t=e.left;if(t.type==="MemberExpression"){const o=await c(n,t.object);let a=null;if(t.computed===!0)a=await c(n,t.property);else{if(t.property.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);a=t.property.name}const i=await c(n,e.right);if(B(o)){if(!R(a))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(a<0&&(a=o.length+a),a<0||a>o.length)throw new l(n,s.OutOfBounds,e);if(a===o.length){if(e.operator!=="=")throw new l(n,s.OutOfBounds,e);o[a]=b(i,e.operator,o[a],e,n)}else o[a]=b(i,e.operator,o[a],e,n)}else if(o instanceof F){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}else if(o instanceof C){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasGlobal(a)!==!0)throw new l(n,s.ModuleExportNotFound,e);o.setGlobal(a,b(i,e.operator,await o.global(a),e,n))}else{if(!M(o))throw $(o)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(o.hasField(a)===!0)o.setField(a,b(i,e.operator,o.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});o.setField(a,b(i,e.operator,null,e,n))}}return p}const r=t.name.toLowerCase();if(n.localScope!=null&&n.localScope[r]!==void 0){const o=await c(n,e.right);return n.localScope[r]={value:b(o,e.operator,n.localScope[r].value,e,n),valueset:!0,node:e.right},p}if(n.globalScope[r]!==void 0){const o=await c(n,e.right);return n.globalScope[r]={value:b(o,e.operator,n.globalScope[r].value,e,n),valueset:!0,node:e.right},p}throw new l(n,s.InvalidIdentifier,e)}async function $e(n,e){if(e.expression.type==="AssignmentExpression")return c(n,e.expression);if(e.expression.type==="CallExpression"){const r=await c(n,e.expression);return r===p?p:new O(r)}const t=await c(n,e.expression);return t===p?p:new O(t)}async function je(n,e){const t=await c(n,e.test);if(t===!0)return c(n,e.consequent);if(t===!1)return e.alternate!==null?c(n,e.alternate):p;throw new l(n,s.BooleanConditionRequired,e)}async function Pe(n,e){return te(n,e,0)}async function te(n,e,t){if(t>=e.body.length)return p;const r=await c(n,e.body[t]);return r instanceof y||r===S||r===E||t===e.body.length-1?r:te(n,e,t+1)}async function Ke(n,e){if(e.argument===null)return new y(p);const t=await c(n,e.argument);return new y(t)}async function qe(n,e){const t=e.id.name.toLowerCase();return n.globalScope[t]={valueset:!0,node:null,value:new Fe(e,n)},p}async function De(n,e){var a,i;const t=e.specifiers[0].local.name.toLowerCase(),r=n.libraryResolver.loadLibrary(t);let o=null;return(a=n.libraryResolver._moduleSingletons)!=null&&a.has(r.uri)?o=n.libraryResolver._moduleSingletons.get(r.uri):(o=new C(r),await o.loadModule(n),(i=n.libraryResolver._moduleSingletons)==null||i.set(r.uri,o)),n.globalScope[t]={value:o,valueset:!0,node:e},p}async function Ge(n,e){if(await c(n,e.declaration),e.declaration.type==="FunctionDeclaration")n.exports[e.declaration.id.name.toLowerCase()]="function";else if(e.declaration.type==="VariableDeclaration")for(const t of e.declaration.declarations)n.exports[t.id.name.toLowerCase()]="variable";return p}async function re(n,e,t){return t>=e.declarations.length?p:(await c(n,e.declarations[t]),t===e.declarations.length-1||await re(n,e,t+1),p)}async function Ze(n,e){let t=null;if(t=e.init===null?null:await c(n,e.init),n.localScope!==null){if(t===p&&(t=null),e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const o=e.id.name.toLowerCase();return n.localScope!=null&&(n.localScope[o]={value:t,valueset:!0,node:e.init}),p}if(e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const r=e.id.name.toLowerCase();return t===p&&(t=null),n.globalScope[r]={value:t,valueset:!0,node:e.init},p}async function Te(n,e){const t=await c(n,e.object);if(t===null)throw new l(n,s.MemberOfNull,e);if(e.computed===!1){if(e.property.type==="Identifier"){if(t instanceof F||M(t))return t.field(e.property.name);if(t instanceof Y)return z(t,e.property.name,n,e);if(t instanceof C){if(!t.hasGlobal(e.property.name))throw new l(n,s.InvalidIdentifier,e);return t.global(e.property.name)}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}let r=await c(n,e.property);if(t instanceof F||M(t)){if(h(r))return t.field(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof C){if(h(r))return t.global(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof Y){if(h(r))return z(t,r,n,e);throw new l(n,s.InvalidMemberAccessKey,e)}if(B(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}if($(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new l(n,s.OutOfBounds,e);return t.get(r)}throw new l(n,s.InvalidMemberAccessKey,e)}if(h(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}async function Ue(n,e){const t=await c(n,e.argument);if(I(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}async function We(n,e){const t=[];for(let r=0;r>":case">>>":case"^":case"&":return ve(d(r),d(o),e.operator);case"==":return q(r,o);case"!=":return!q(r,o);case"<":case">":case"<=":case">=":return ye(r,o,e.operator);case"+":return h(r)||h(o)?N(r)+N(o):d(r)+d(o);case"-":return d(r)-d(o);case"*":return d(r)*d(o);case"/":return d(r)/d(o);case"%":return d(r)%d(o);default:throw new l(n,s.UnsupportedOperator,e)}}async function _e(n,e){const t=await c(n,e.left);let r=null;if(!I(t))throw new l(n,s.LogicalExpressionOnlyBoolean,e);switch(e.operator){case"||":if(t===!0)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);case"&&":if(t===!1)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);default:throw new l(n,s.LogicExpressionOrAnd,e)}}async function _(n,e){const t=e.name.toLowerCase();if(n.localScope!=null&&n.localScope[t]!==void 0){const r=n.localScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}if(n.globalScope[t]!==void 0){const r=n.globalScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}throw new l(n,s.InvalidIdentifier,e)}async function ze(n,e){if(e.callee.type==="MemberExpression"){const t=await c(n,e.callee.object);if(!(t instanceof C))throw new l(n,s.FunctionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:await c(n,e.callee.property);if(!t.hasGlobal(r))throw new l(n,s.FunctionNotFound,e);const o=await t.global(r);if(!v(o))throw new l(n,s.CallNonFunction,e);return o.call(n,e)}if(e.callee.type!=="Identifier")throw new l(n,s.FunctionNotFound,e);if(n.localScope!=null&&n.localScope[e.callee.name.toLowerCase()]!==void 0){const t=n.localScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}if(n.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=n.globalScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}throw new l(n,s.FunctionNotFound,e)}async function He(n,e){return e.value?e.value.cooked:""}function Ye(n,e,t){if(v(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);return n}async function Je(n,e){const t=[];for(let a=0;athis.fn(t,{preparsed:!0,arguments:n})}call(t,n){return this.fn(t,n)}marshalledCall(t,n,r,a){return a(t,n,(u,o,i)=>{i=i.map(c=>c instanceof tt&&!(c instanceof ze)?dt(c,t,a):c);const s=this.call(r,{args:i});return qe(s)?s.then(c=>dt(c,r,a)):s})}},ze=class extends tt{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(t){return this.fn.createFunction(this.context)}call(t,n){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}marshalledCall(t,n,r){return this.fn.marshalledCall(t,n,this.context,this.parameterEvaluator)}},se=class{constructor(t=[]){this._elements=t}length(){return this._elements.length}get(t){return this._elements[t]}toArray(){const t=[];for(let n=0;nn)throw new d(r,l.WrongNumberOfParameters,a)}function Nn(e){return e<0?-Math.round(-e):Math.round(e)}function st(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll(/[xy]/g,t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(t==="x"?n:3&n|8).toString(16)})}function tr(e,t){return isNaN(e)||t==null||t===""?e.toString():(t=He(t,"‰",""),t=He(t,"¤",""),ya(e,{pattern:t}))}function on(e,t){return t==null||t===""?e.toISOString(!0):e.toFormat(nr(t),{locale:Kn(),numberingSystem:"latn"})}function nr(e,t=!1){e=e.replaceAll(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let n="";const r=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|Z{1,5}|.)/g;for(const a of e.match(r)||[])switch(a){case"D":n+="d";break;case"DD":n+="dd";break;case"DDD":n+="o";break;case"d":n+="c";break;case"ddd":n+="ccc";break;case"dddd":n+="cccc";break;case"M":n+="L";break;case"MM":n+="LL";break;case"MMM":n+="LLL";break;case"MMMM":n+="LLLL";break;case"YY":n+="yy";break;case"Y":case"YYYY":n+="yyyy";break;case"Q":n+="q";break;case"Z":n+="Z";break;case"ZZ":n+="ZZ";break;case"ZZZ":n+="ZZZ";break;case"ZZZZ":n+=t?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":n+=t?"[ZZZZZ]":"ZZZZZ";break;case"S":n+="'S'";break;case"SS":n+="'SS'";break;case"SSS":n+="u";break;case"A":case"a":n+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":n+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?n+=`'${a.slice(1,-1)}'`:n+=`'${a}'`}return n}function N(e,t,n){switch(n){case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t}return!1}function rr(e,t,n){if(e===null){if(t===null||t===A)return N(null,null,n);if(q(t))return N(0,t,n);if(C(t)||z(t))return N(0,h(t),n);if(V(t))return N(0,t.toNumber(),n);if(J(t)||P(t))return N(e,t.toNumber(),n)}if(e===A){if(t===null||t===A)return N(null,null,n);if(q(t))return N(0,t,n);if(C(t)||z(t))return N(0,h(t),n);if(V(t))return N(0,t.toNumber(),n);if(J(t)||P(t))return N(e,t.toNumber(),n)}else if(q(e)){if(q(t))return N(e,t,n);if(z(t))return N(e,h(t),n);if(t===null||t===A)return N(e,0,n);if(C(t))return N(e,h(t),n);if(V(t)||J(t)||P(t))return N(e,t.toNumber(),n)}else if(C(e)){if(C(t))return N(w(e),w(t),n);if(V(t)||J(t)||P(t))return N(h(e),t.toNumber(),n);if(q(t))return N(h(e),t,n);if(t===null||t===A)return N(h(e),0,n);if(z(t))return N(h(e),h(t),n)}else if(V(e)){if(V(t))return e.timeZone!==t.timeZone&&(e.isUnknownTimeZone?e=O.arcadeDateAndZoneToArcadeDate(e,t.timeZone):t.isUnknownTimeZone&&(t=O.arcadeDateAndZoneToArcadeDate(t,e.timeZone))),N(e.toNumber(),t.toNumber(),n);if(t===null||t===A)return N(e.toNumber(),0,n);if(q(t))return N(e.toNumber(),t,n);if(z(t)||C(t))return N(e.toNumber(),h(t),n);if(J(t))throw new d(null,l.CannotCompareDateAndTime,null);if(P(t))return N(e.toNumber(),t.toNumber(),n)}else if(z(e)){if(z(t))return N(e,t,n);if(q(t))return N(h(e),h(t),n);if(V(t)||J(t)||P(t))return N(h(e),t.toNumber(),n);if(t===null||t===A)return N(h(e),0,n);if(C(t))return N(h(e),h(t),n)}else if(P(e)){if(V(t))return N(e.toNumber(),t.toNumber(),n);if(t===null||t===A)return N(e.toNumber(),0,n);if(q(t))return N(e.toNumber(),t,n);if(z(t)||C(t))return N(e.toNumber(),h(t),n);if(J(t))throw new d(null,l.CannotCompareDateAndTime,null);if(P(t))return N(e.toNumber(),t.toNumber(),n)}else if(J(e)){if(V(t))throw new d(null,l.CannotCompareDateAndTime,null);if(t===null||t===A)return N(e.toNumber(),0,n);if(q(t))return N(e.toNumber(),t,n);if(z(t)||C(t))return N(e.toNumber(),h(t),n);if(J(t))return N(e.toNumber(),t.toNumber(),n);if(P(t))throw new d(null,l.CannotCompareDateAndTime,null)}return!!Ee(e,t)&&(n==="<="||n===">=")}function Ee(e,t){if(e===t||e===null&&t===A||t===null&&e===A)return!0;if(V(e)&&V(t)||J(e)&&J(t)||P(e)&&P(t))return e.equals(t);if(e instanceof Tn||e instanceof it)return e.equalityTest(t);if(e instanceof H&&t instanceof H){const n=e.cache._arcadeCacheId,r=t.cache._arcadeCacheId;if(n!=null)return n===r}return!!(Bn(e)&&Bn(t)&&(e._arcadeCacheId===t._arcadeCacheId&&e._arcadeCacheId!==void 0&&e._arcadeCacheId!==null||e._underlyingGraphic===t._underlyingGraphic&&e._underlyingGraphic!==void 0&&e._underlyingGraphic!==null))}function w(e,t){if(C(e))return e;if(e===null)return"";if(q(e))return tr(e,t);if(z(e))return e.toString();if(V(e))return on(e,t);if(J(e)||P(e))return e.toFormat(t);if(e instanceof B)return JSON.stringify(e.toJSON());if(T(e)){const n=[];for(let r=0;rr.key===a.key?0:r.key==="spatialReference"?1:a.key==="spatialReference"||r.keya.key?1:0);if(T(e)){const r=[];for(let a=0;a0)return e;return null}if(e instanceof oe){if(e.paths.length===0)return null;for(const t of e.paths)if(t.length>0)return e;return null}return e instanceof be?e.points.length===0?null:e:e instanceof ge?e.xmin==="NaN"||e.xmin===null||isNaN(e.xmin)?null:e:null}function mi(e,t){if(!e||!e.domain)return t;let n=null,r=null;if(e.field.type==="string"||e.field.type==="esriFieldTypeString")n=w(t);else{if(t==null)return null;if(t==="")return t;n=h(t)}for(let a=0;a{var s;return i.id===r&&(a=(s=i.domains)==null?void 0:s[o.name],a&&a.type==="inherited"&&(a=Ar(o.name,t),u=!0),!0)}),u||a||(a=Ar(e,t)),{field:o,domain:a}}function Ar(e,t){let n;return t.fields.some(r=>(r.name.toLowerCase()===e.toLowerCase()&&(n=r.domain),!!n)),n}function _n(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});const n=typeof t.cycles=="boolean"&&t.cycles,r=t.cmp&&(a=t.cmp,function(o){return function(i,s){const c={key:i,value:o[i]},p={key:s,value:o[s]};return a(c,p)}});var a;const u=[];return function o(i){if(i!=null&&i.toJSON&&typeof i.toJSON=="function"&&(i=i.toJSON()),i===void 0)return;if(typeof i=="number")return isFinite(i)?""+i:"null";if(typeof i!="object")return JSON.stringify(i);let s,c;if(Array.isArray(i)){for(c="[",s=0;s0&&(u=e[0].spatialReference,n=e[0].hasZ,r=e[0].hasM)}else if(e instanceof it)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else{if(!R(e))throw new d(null,l.InvalidParameter,null);for(const o of e.toArray())mt(a,o);a.length>0&&(u=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:(Xr(a)||(a=a.slice(0).reverse()),new ue({rings:[a],spatialReference:u,hasZ:n,hasM:r}))}return e}function kt(e,t){if(T(e)||R(e)){let n=!1,r=!1,a=[],u=t;if(T(e)){for(const o of e)mt(a,o);a.length>0&&(u=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof it)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else if(R(e)){for(const o of e.toArray())mt(a,o);a.length>0&&(u=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new oe({paths:[a],spatialReference:u,hasZ:n,hasM:r})}return e}function Vt(e,t){if(T(e)||R(e)){let n=!1,r=!1,a=[],u=t;if(T(e)){for(const o of e)mt(a,o);a.length>0&&(u=e[0].spatialReference,n=e[0].hasZ===!0,r=e[0].hasM===!0)}else if(e instanceof it)a=e._elements,a.length>0&&(n=e._hasZ,r=e._hasM,u=e.get(0).spatialReference);else if(R(e)){for(const o of e.toArray())mt(a,o);a.length>0&&(u=e.get(0).spatialReference,n=e.get(0).hasZ===!0,r=e.get(0).hasM===!0)}return a.length===0?null:new be({points:a,spatialReference:u,hasZ:n,hasM:r})}return e}function Na(e,t=!1){const n=[];if(e===null)return n;if(T(e)===!0){for(let r=0;r{setTimeout(()=>{t(e)},0)})):e}function ir(e,t,n){switch(n){case"&":return e&t;case"|":return e|t;case"^":return e^t;case"<<":return e<>":return e>>t;case">>>":return e>>>t}}function Ke(e,t=null){return e==null?null:z(e)||q(e)||C(e)?e:e instanceof B?(t==null?void 0:t.keepGeometryType)===!0?e:e.toJSON():e instanceof se?e.toArray().map(n=>Ke(n,t)):e instanceof Array?e.map(n=>Ke(n,t)):Wt(e)?e:V(e)?e.toJSDate():J(e)?e.toString():P(e)?e.toJSDate():e!==null&&typeof e=="object"&&e.castAsJson!==void 0?e.castAsJson(t):null}async function Ma(e,t,n,r,a){const u=await ar(e,t,n);a[r]=u}async function ar(e,t=null,n=null){if(e instanceof se&&(e=e.toArray()),e==null)return null;if(Ge(e)||e instanceof B||Wt(e)||V(e))return Ke(e,n);if(e instanceof Array){const r=[],a=[];for(const u of e)u===null||Ge(u)||u instanceof B||Wt(u)||V(u)?a.push(Ke(u,n)):(a.push(null),r.push(Ma(u,t,n,a.length-1,a)));return r.length>0&&await Promise.all(r),a}return e!==null&&typeof e=="object"&&e.castAsJsonAsync!==void 0?e.castAsJsonAsync(t,n):null}function Ut(e){return Di(e)?e.parent:e}function Di(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.support.SubtypeSublayer"}function $a(e){return e&&"declaredClass"in e&&e.declaredClass==="esri.layers.SubtypeGroupLayer"}function gi(e,t,n){const r=Ut(e.fullSchema());return r===null||!r.fields?null:un(t,r,e,n)}function jt(e){const t=Ut(e.fullSchema());return t===null?null:t.fields&&t.typeIdField?{subtypeField:t.typeIdField,subtypes:t.types?t.types.map(n=>({name:n.name,code:n.id})):[]}:null}function yi(e,t,n,r){const a=Ut(e.fullSchema());if(a===null||!a.fields)return null;const u=un(t,a,e,r);if(n===void 0)try{n=e.field(t)}catch{return null}return mi(u,n)}function wi(e,t,n,r){const a=Ut(e.fullSchema());if(a===null||!a.fields)return null;if(n===void 0){try{n=e.field(t)}catch{return null}return n}return pi(un(t,a,e,r),n)}function _(e){return(e==null?void 0:e.timeZone)??"system"}function xi(e){const t=Ut(e.fullSchema());if(t===null||!t.fields)return null;const n=[];for(const r of t.fields)n.push(Ta(r));return{objectIdField:t.objectIdField,globalIdField:t.globalIdField??"",geometryType:Fr[t.geometryType]===void 0?"":Fr[t.geometryType],fields:n}}function Fi(e,t){return e==="system"&&(e=O.systemTimeZoneCanonicalName),{version:Ci,engineVersion:Qr,timeZone:e,spatialReference:t instanceof yt?t.toJSON():t,application:wa.applicationName??"",engine:"web",locale:Kn()}}const Ci="1.24",Ai=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:ft,ImplicitResultE:fi,ReturnResult:ye,ReturnResultE:di,absRound:Nn,arcadeVersion:Ci,autoCastArrayOfPointsToMultiPoint:Vt,autoCastArrayOfPointsToPolygon:Mn,autoCastArrayOfPointsToPolyline:kt,autoCastFeatureToGeometry:Z,binaryOperator:ir,breakResult:Ie,castAsJson:Ke,castAsJsonAsync:ar,continueResult:wt,defaultExecutingContext:Fi,defaultTimeZone:_,defaultUndefined:$,equalityTest:Ee,featureDomainCodeLookup:wi,featureDomainValueLookup:yi,featureFullDomain:gi,featureSchema:xi,featureSubtypes:jt,fixNullGeometry:Ye,fixSpatialReference:te,formatDate:on,formatNumber:tr,generateUUID:st,getDomain:un,getDomainCode:pi,getDomainValue:mi,getType:Qn,greaterThanLessThan:rr,isArray:T,isBoolean:z,isDate:V,isDateOnly:P,isDictionary:hi,isFeature:ee,isFeatureSet:xt,isFeatureSetCollection:Rt,isFunctionParameter:X,isGeometry:er,isImmutableArray:R,isInteger:Pe,isJsDate:Wt,isModule:Xn,isNumber:q,isObject:Bn,isSimpleType:Ge,isString:C,isSubtypeGrouplayer:$a,isSubtypeSublayer:Di,isTime:J,multiReplace:He,pcCheck:D,stableStringify:_n,standardiseDateFormat:nr,tick:_a,toBoolean:ht,toDate:ae,toNumber:h,toNumberArray:We,toString:w,toStringArray:Na,toStringExplicit:we,voidOperation:A},Symbol.toStringTag,{value:"Module"}));function La(e){bi=e}let bi;function Mt(e){return e===null?null:V(e)?e.clone():Ge(e)?e:er(e)?e.clone():R(e)?e.toArray().map(t=>Mt(t)):T(e)?e.map(t=>Mt(t)):ee(e)?bi.createFromArcadeFeature(e):Rt(e)||xt(e)?e:hi(e)||(e==null?void 0:e.declaredClass)==="esri.arcade.Attachment"?e.deepClone():((e==null?void 0:e.declaredClass)==="esri.arcade.Portal"||e instanceof Pt||X(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(q(e))return h(e);if(z(e))return ht(e);if(C(e))return w(e);if(V(e))return ae(e,t);if(P(e)||J(e))return e;if(T(e)){const u=[];for(const o of e)u.push(Xt(o,t,n,r));return u}if(r&&er(e))return e;const a=new k;a.immutable=!1;for(const u of Object.keys(e)){const o=e[u];o!==void 0&&a.setField(u,Xt(o,t,n,r))}return a.immutable=n,a}let k=class Ht{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Ht?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new d(null,l.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new d(null,l.Immutable,null);if(X(n))throw new d(null,l.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=O.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":z(a)||q(a)||C(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof B?n+=JSON.stringify(r)+":"+we(a):a instanceof se||a instanceof Array?n+=JSON.stringify(r)+":"+we(a,null,t):a instanceof O?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const u=new Ht;u.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&u.setField(o.toString(),Xt(i,n,r,a))}return u.immutable=r,u}static convertJsonToArcade(t,n,r=!1){return Xt(t,n,r)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t!=null&&t.keyTranslate&&(r=t.keyTranslate(r)),n[r]=Ke(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,u){const o=await ar(r,a,u);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let u in this.attributes){const o=this.attributes[u];n!=null&&n.keyTranslate&&(u=n.keyTranslate(u)),o!==void 0&&(Ge(o)||o instanceof B||o instanceof O?r[u]=Ke(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,u,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Ht;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Q=class Fe{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Fe;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Fe){const r=new Fe;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Fe.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Fe;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t){const n=new Fe;return n.attributes=t.field("attributes"),n.attributes!==null&&n.attributes instanceof k?(n.attributes=n.attributes.attributes,n.attributes===null&&(n.attributes={})):n.attributes={},n._geometry=t.field("geometry"),n._geometry!==null&&(n._geometry instanceof k?n._geometry=Fe.parseGeometryFromDictionary(n._geometry):n._geometry instanceof B||(n._geometry=null)),n}static createFromGraphicLikeObject(t,n,r=null,a){const u=new Fe;return u.contextTimeZone=a??null,n===null&&(n={}),u.attributes=n,u._geometry=t??null,u._layer=r,u._layer&&(u._fieldTypesFixed=!1,u.fieldsIndex=this.hydrateFieldsIndex(u._layer)),u}static hydrateFieldsIndex(t){return t===null?null:xt(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:xa.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":z(a)||q(a)||C(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof B?n+=JSON.stringify(r)+":"+we(a):a instanceof fe||a instanceof de?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof se||a instanceof Array?n+=JSON.stringify(r)+":"+we(a,null,t):a instanceof O?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":we(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){var r;if(this._fieldsToFixDataTypes&&((r=this._fieldsToFixDataTypes)==null?void 0:r.length)>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let a=0;a0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){var n;return((n=this.fieldsIndex)==null?void 0:n.getTimeZone(t))==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function Si(e){const t=[];return K(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:n.specifiers[0].local.name.toLowerCase(),source:n.source.value}),!0)),t}function Ra(e,t){let n=!1;const r=t.toLowerCase();return K(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function Ua(e){const t=[];return K(e,n=>{var r;return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function za(e){const t=[];return K(e,n=>{var r;if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let a="";for(let u=0;u<(n.arguments||[]).length;u++)u===0?n.arguments[u].type==="Identifier"&&(a=n.arguments[u].name.toLowerCase()):a&&n.arguments[u].type==="Literal"&&Er(n.arguments[u].value)&&t.push(a+"."+n.arguments[u].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let a="";return n.arguments[0].type==="Identifier"&&(a=n.arguments[0].name.toLowerCase()),a&&n.arguments[1].type==="Literal"&&Er(n.arguments[1].value)&&t.push(a+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&t.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),t}function Ln(e){const t=[];return K(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function zt(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Ln(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Ei(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,Si(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Ln(e));for(let r=0;r0||s.length>0;)if(i.length>0&&s.length>0){let f=c(i[0],s[0]);isNaN(f)&&(f=0),f<=0?(p.push(i[0]),i=i.slice(1)):(p.push(s[0]),s=s.slice(1))}else i.length>0?(p.push(i[0]),i=i.slice(1)):s.length>0&&(p.push(s[0]),s=s.slice(1));return p}async function a(i,s){const c=i.length,p=Math.floor(c/2);if(c===0)return[];if(c===1)return[i[0]];const f=[await a(i.slice(0,p),s),await a(i.slice(p,c),s)];return u(f[0],f[1],s,[])}async function u(i,s,c,p){const f=p;if(!(i.length>0||s.length>0))return p;if(i.length>0&&s.length>0){let m=await c(i[0],s[0]);return isNaN(m)&&(m=1),m<=0?(f.push(i[0]),i=i.slice(1)):(f.push(s[0]),s=s.slice(1)),u(i,s,c,p)}return i.length>0?(f.push(i[0]),u(i=i.slice(1),s,c,p)):s.length>0?(f.push(s[0]),u(i,s=s.slice(1),c,p)):void 0}function o(i,s,c,p){D(c,1,2,i,s);let f=c[0];if(R(f)&&(f=f.toArray()),T(f)===!1)throw new d(i,l.InvalidParameter,s);if(c.length>1){if(X(c[1])===!1)throw new d(i,l.InvalidParameter,s);let I=f;const W=c[1].createFunction(i);return p?a(I,W):(I=n(I,(pe,Zt)=>W(pe,Zt)),I)}let m=f;if(m.length===0)return[];const g={};for(let I=0;I1||M==="String"?n(m,(I,W)=>{if(I==null||I===A)return W==null||W===A?0:1;if(W==null||W===A)return-1;const pe=w(I),Zt=w(W);return peI-W):M==="Boolean"?n(m,(I,W)=>I===W?0:W?-1:1):M==="Date"?n(m,(I,W)=>W-I):m.slice(0),m}e.functions.array=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,0,2,i,s),f.length===0)return new Array;if(f.length===1&&f[0]===null)return new Array;if(T(f[0])){if(f.length===2&&z(f[1])===!1)throw new d(i,l.InvalidParameter,s);return $(f[1],!1)===!0?Mt(f[0]):f[0].slice(0)}if(R(f[0])){if(f.length===2&&z(f[1])===!1)throw new d(i,l.InvalidParameter,s);return $(f[1],!1)===!0?Mt(f[0]):f[0].toArray().slice(0)}const m=h(f[0]);if(isNaN(m)||Pe(m)===!1)throw new d(i,l.InvalidParameter,s);const g=$(f[1],null),x=new Array(m);return x.fill(g),x})},e.functions.front=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,1,1,i,s),R(f[0])){if(f[0].length()<=0)throw new d(i,l.OutOfBounds,s);return f[0].get(0)}if(T(f[0])){if(f[0].length<=0)throw new d(i,l.OutOfBounds,s);return f[0][0]}throw new d(i,l.InvalidParameter,s)})},e.functions.back=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,1,1,i,s),R(f[0])){if(f[0].length()<=0)throw new d(i,l.OutOfBounds,s);return f[0].get(f[0].length()-1)}if(T(f[0])){if(f[0].length<=0)throw new d(i,l.OutOfBounds,s);return f[0][f[0].length-1]}throw new d(i,l.InvalidParameter,s)})},e.functions.push=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,1,2,i,s),T(f[0]))return f[0][f[0].length]=f[1],f[0].length;throw new d(i,l.InvalidParameter,s)})},e.functions.pop=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,1,1,i,s),T(f[0])){if(f[0].length<=0)throw new d(i,l.OutOfBounds,s);const m=f[0][f[0].length-1];return f[0].length=f[0].length-1,m}throw new d(i,l.InvalidParameter,s)})},e.functions.erase=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,2,2,i,s),T(f[0])){let m=h(f[1]);if(isNaN(m)||Pe(m)===!1)throw new d(i,l.InvalidParameter,s);const g=f[0];if(g.length<=0)throw new d(i,l.OutOfBounds,s);if(m<0&&(m=g.length+m),m<0)throw new d(i,l.OutOfBounds,s);if(m>=g.length)throw new d(i,l.OutOfBounds,s);return g.splice(m,1),A}throw new d(i,l.InvalidParameter,s)})},e.functions.insert=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,3,3,i,s),T(f[0])){const m=h(f[1]);if(isNaN(m)||Pe(m)===!1)throw new d(i,l.InvalidParameter,s);const g=f[2],x=f[0];if(m>x.length)throw new d(i,l.OutOfBounds,s);if(m<0&&m<-1*x.length)throw new d(i,l.OutOfBounds,s);return m===x.length?(x[m]=g,A):(x.splice(m,0,g),A)}throw new d(i,l.InvalidParameter,s)})},e.functions.resize=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,2,3,i,s),T(f[0])){const m=h(f[1]);if(isNaN(m)||Pe(m)===!1)throw new d(i,l.InvalidParameter,s);if(m<0)throw new d(i,l.InvalidParameter,s);const g=$(f[2],null),x=f[0];if(x.length>=m)return x.length=m,A;const M=x.length;x.length=m;for(let I=M;I{if(D(f,2,2,i,s),T(f[0])){const m=f[1];return f[0].findIndex(g=>Ee(g,m))>-1}if(R(f[0])){const m=f[1];return f[0].toArray().findIndex(g=>Ee(g,m))>-1}throw new d(i,l.InvalidParameter,s)})},e.functions.slice=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{if(D(f,1,3,i,s),T(f[0])){const m=h($(f[1],0)),g=h($(f[2],f[0].length));if(isNaN(m)||Pe(m)===!1)throw new d(i,l.InvalidParameter,s);if(isNaN(g)||Pe(g)===!1)throw new d(i,l.InvalidParameter,s);return f[0].slice(m,g)}if(R(f[0])){const m=f[0],g=h($(f[1],0)),x=h($(f[2],m.length()));if(isNaN(g)||Pe(g)===!1)throw new d(i,l.InvalidParameter,s);if(isNaN(x)||Pe(x)===!1)throw new d(i,l.InvalidParameter,s);return m.toArray().slice(g,x)}throw new d(i,l.InvalidParameter,s)})},e.functions.splice=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{const m=[];for(let g=0;g{if(D(f,2,2,i,s),T(f[0]))return h(f[1])>=f[0].length?f[0].slice(0):f[0].slice(0,h(f[1]));if(R(f[0]))return h(f[1])>=f[0].length()?f[0].slice(0):f[0].slice(0,h(f[1]));throw new d(i,l.InvalidParameter,s)})},e.functions.first=function(i,s){return e.standardFunction(i,s,(c,p,f)=>(D(f,1,1,i,s),T(f[0])?f[0].length===0?null:f[0][0]:R(f[0])?f[0].length()===0?null:f[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,s){return e.standardFunction(i,s,(c,p,f)=>o(i,s,f,!1))},e.functions.any=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);for(const x of g){const M=m(x);if(z(M)&&M===!0)return!0}return!1})},e.functions.all=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);for(const x of g)if(m(x)!==!0)return!1;return!0})},e.functions.none=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);for(const x of g)if(m(x)===!0)return!1;return!0})},e.functions.reduce=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{D(f,2,3,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);return f.length===2?g.length===0?null:g.reduce((x,M)=>{const I=m(x,M);return x=I!==void 0&&I!==A?I:null}):g.reduce((x,M)=>{const I=m(x,M);return x=I!==void 0&&I!==A?I:null},f[2])})},e.functions.map=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s),x=[];for(const M of g){const I=m(M);I!==void 0&&I!==A?x.push(I):x.push(null)}return x})},e.functions.filter=function(i,s){return e.standardFunction(i,s,(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s),x=[];for(const M of g)m(M)===!0&&x.push(M);return x})}),e.mode==="async"&&(e.functions.sort=function(i,s){return e.standardFunctionAsync(i,s,(c,p,f)=>o(i,s,f,!0))},e.functions.any=function(i,s){return e.standardFunctionAsync(i,s,async(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);for(const x of g){const M=await m(x);let I=null;if(I=qe(I)?await M:M,z(I)&&I===!0)return!0}return!1})},e.functions.all=function(i,s){return e.standardFunctionAsync(i,s,async(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);for(const x of g){const M=await m(x);let I=null;if(I=qe(I)?await M:M,I!==!0)return!1}return!0})},e.functions.none=function(i,s){return e.standardFunctionAsync(i,s,async(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);for(const x of g){const M=await m(x);let I=null;if(I=qe(I)?await M:M,I===!0)return!1}return!0})},e.functions.filter=function(i,s){return e.standardFunctionAsync(i,s,async(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s),x=[];for(const M of g){const I=await m(M);let W=null;W=qe(W)?await I:I,W===!0&&x.push(M)}return x})},e.functions.reduce=function(i,s){return e.standardFunctionAsync(i,s,(c,p,f)=>{D(f,2,3,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s);let x=null;if(f.length>2){const M=$(f[2],null);x=g.reduce(async(I,W)=>{let pe=await I;return pe!==void 0&&pe!==A||(pe=null),m(pe,W)},Promise.resolve(M))}else{if(g.length===0)return null;x=g.reduce(async(M,I,W)=>{if(W<=1)return m(M,I);let pe=await M;return pe!==void 0&&pe!==A||(pe=null),m(pe,I)})}return x.then(M=>M!==void 0&&M!==A?M:null)})},e.functions.map=function(i,s){return e.standardFunctionAsync(i,s,async(c,p,f)=>{D(f,2,2,i,s);const m=f[1].createFunction(i),g=t(f[0],i,s),x=[];for(const M of g){const I=await m(M);let W=null;W=qe(W)?await I:I,W!==void 0&&W!==A?x.push(W):x.push(null)}return x})})}const On=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:Ga},Symbol.toStringTag,{value:"Module"}));function Za(e,t,n){return e+(Ja(n)?Va:qa)[t]}function Ja(e){return e%4==0&&(e%100!=0||e%400==0)}const qa=[0,31,59,90,120,151,181,212,243,273,304,334],Va=[0,31,60,91,121,152,182,213,244,274,305,335];function Be(e){return e===null?e:e.isValid===!1?null:e}function Ft(e,t){return e===""||e.toLowerCase().trim()==="default"?_(t):e==="z"||e==="Z"?"UTC":e}function $e(e,t){return P(e)?e.toArcadeDate():ae(e,_(t))}function vi(e,t){e.today=function(n,r){return t(n,r,(a,u,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),O.dateJSAndZoneToArcadeDate(i,_(n))})},e.time=function(n,r){return t(n,r,(a,u,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=O.nowToArcadeDate(_(n));return new fe(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(J(o[0]))return o[0].clone();if(V(o[0]))return new fe(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(P(o[0]))return new fe(0,0,0,0);if(C(o[0]))return fe.fromString(o[0]);const i=h(o[0]);return isNaN(i)===!1?fe.fromMilliseconds(i):null}case 2:return C(o[0])&&C(o[1])?fe.fromString(o[0],o[1]):fe.fromParts(h(o[0]),h(o[1]),0,0);case 3:return fe.fromParts(h(o[0]),h(o[1]),h(o[2]),0);case 4:return fe.fromParts(h(o[0]),h(o[1]),h(o[2]),h(o[3]))}throw new d(n,l.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,0,3,n,r),o.length===3)return de.fromParts(h(o[0]),h(o[1])+1,h(o[2]));if(o.length===2){const i=w(o[1]);return i===""?null:i==="X"?de.fromSeconds(h(o[0])):i==="x"?de.fromMilliseconds(h(o[0])):de.fromString(w(o[0]),i)}if(o.length===1){if(C(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return de.fromString(o[0]+"-01-01")}if(P(o[0]))return o[0].clone();if(V(o[0]))return de.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=h(o[0]);return isNaN(i)===!1?de.fromMilliseconds(i):C(o[0])?de.fromString(o[0]):null}if(o.length===0){const i=O.nowToArcadeDate(_(n));return i.isValid===!1?null:de.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(P(o[0]))throw new d(n,l.CannotChangeTimeZoneDateOnly,r);if(P(o[0]))throw new d(n,l.CannotChangeTimeZoneTime,r);const i=ae(o[0],_(n));if(i===null)throw new d(n,l.InvalidParameter,r);const s=bt(Ft(w(o[1]),n),!1);if(s===null)return null;const c=O.arcadeDateAndZoneToArcadeDate(i,s);return c.isValid===!1?null:c})},e.timezone=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,2,n,r),J(o[0])||P(o[0]))return"Unknown";const i=ae(o[0],_(n));if(i===null)return null;const s=i.timeZone;return s==="system"?O.systemTimeZoneCanonicalName:s.toLowerCase()==="utc"?"UTC":s.toLowerCase()==="unknown"?"Unknown":s})},e.timezoneoffset=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=ae(o[0],_(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,u,o)=>{D(o,0,0,n,r);const i=O.nowToArcadeDate(_(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,u,o)=>{D(o,0,0,n,r);const i=O.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=ae(o[0],_(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=ae(o[0],_(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),J(o[0]))return o[0].hour;const i=ae(o[0],_(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),J(o[0]))return o[0].second;const i=ae(o[0],_(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),J(o[0]))return o[0].millisecond;const i=ae(o[0],_(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),J(o[0]))return o[0].minute;const i=ae(o[0],_(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,2,n,r);const i=$e(o[0],_(n));if(i===null)return NaN;const s=h($(o[1],0));if(s<0||s>6)throw new d(n,l.InvalidParameter,r);const c=i.day,p=i.monthJS,f=i.year,m=i.dayOfWeekJS,g=Za(c,p,f)-1,x=Math.floor(g/7);return m-s+(m-s<0?7:0){D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=$e(o[0],_(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,0,8,n,r),o.length===3){if(P(o[0])&&J(o[1])&&C(o[2])){const i=bt(Ft(w(o[2])??"unknown",n),!1);return i===null?null:Be(O.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Be(O.fromParts(h(o[0]),h(o[1])+1,h(o[2]),0,0,0,0,_(n)))}if(o.length===4)return Be(O.fromParts(h(o[0]),h(o[1])+1,h(o[2]),h(o[3]),0,0,0,_(n)));if(o.length===5)return Be(O.fromParts(h(o[0]),h(o[1])+1,h(o[2]),h(o[3]),h(o[4]),0,0,_(n)));if(o.length===6)return Be(O.fromParts(h(o[0]),h(o[1])+1,h(o[2]),h(o[3]),h(o[4]),h(o[5]),0,_(n)));if(o.length===7)return Be(O.fromParts(h(o[0]),h(o[1])+1,h(o[2]),h(o[3]),h(o[4]),h(o[5]),h(o[6]),_(n)));if(o.length===8){const i=bt(Ft(w(o[7])??"unknown",n),!1);return i===null?null:Be(O.fromParts(h(o[0]),h(o[1])+1,h(o[2]),h(o[3]),h(o[4]),h(o[5]),h(o[6]),i))}if(o.length===2){if(P(o[0])&&C(o[1])){const c=bt(Ft(w(o[1])??"unknown",n),!1);return c===null?null:Be(O.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,c))}if(P(o[0])&&J(o[1]))return Be(O.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,s=w(o[1]);return s===""?null:(s=nr(s,!0),i=s==="X"?Qe.fromSeconds(h(o[0])):s==="x"?Qe.fromMillis(h(o[0])):Qe.fromFormat(w(o[0]),s,{locale:Kn(),numberingSystem:"latn"}),i.isValid?O.dateTimeToArcadeDate(i):null)}if(o.length===1){if(P(o[0]))return Be(O.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(C(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return ae(o[0]+"-01-01",_(n))}const i=h(o[0]);if(isNaN(i)===!1){const s=Qe.fromMillis(i);return s.isValid?O.dateTimeAndZoneToArcadeDate(s,_(n)):null}return ae(o[0],_(n))}return o.length===0?O.nowToArcadeDate(_(n)):null})},e.datediff=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,4,n,r),J(o[0]))return J(o[1])?o[0].difference(o[1],w(o[2])):NaN;if(J(o[1]))return NaN;if(P(o[0]))return P(o[1])?o[0].difference(o[1],w(o[2])):NaN;if(P(o[1]))return NaN;let i=ae(o[0],_(n)),s=ae(o[1],_(n));if(i===null||s===null)return NaN;let c=$(o[3],"");switch(c!==""&&c!==null?(c=Ft(w(c),n),i=O.arcadeDateAndZoneToArcadeDate(i,c),s=O.arcadeDateAndZoneToArcadeDate(s,c)):i.timeZone!==s.timeZone&&(i.isUnknownTimeZone?i=O.arcadeDateAndZoneToArcadeDate(i,s.timeZone):s=(s.isUnknownTimeZone,O.arcadeDateAndZoneToArcadeDate(s,i.timeZone))),w(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(s,"days");case"months":case"month":return i.diff(s,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(s,"months"):i.diff(s,"minutes");case"seconds":case"second":case"s":return i.diff(s,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(s);case"hours":case"hour":case"h":return i.diff(s,"hours");case"years":case"year":case"y":return i.diff(s,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,3,n,r);let i=h(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return J(o[0])||P(o[0])?o[0].clone():ae(o[0],_(n));let s="milliseconds";switch(w(o[2]).toLowerCase()){case"days":case"day":case"d":s="days",i=P(o[0])?i:Nn(i);break;case"months":case"month":s="months",i=P(o[0])?i:Nn(i);break;case"minutes":case"minute":case"m":s=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":s="seconds";break;case"milliseconds":case"millisecond":case"ms":s="milliseconds";break;case"hours":case"hour":case"h":s="hours";break;case"years":case"year":case"y":s="years"}if(J(o[0])||P(o[0]))return o[0].plus(s,i);const c=ae(o[0],_(n));return c===null?null:c.plus({[s]:i})})}}function Ct(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ha(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function Ka(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new H(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new H(t)):null}function Xa(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ki(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function to(e,t){return cn(ki(e,t),2*Math.PI)*(180/Math.PI)}function no(e,t){return cn(Math.PI/2-ki(e,t),2*Math.PI)*(180/Math.PI)}function Ti(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(eo(r,a),Qa(r,a))}function ro(e,t,n){return ei(cn(Ti(e,t,n),2*Math.PI))}function io(e,t,n){return ei(cn(-1*Ti(e,t,n),2*Math.PI))}Tt[9002]=.3048,Tt[9003]=.3048006096012192,Tt[9095]=.3048007491;const ie=[0,0];function vr(e){for(let t=0;t{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(T(o[0]))for(const s of o[0]){if(!(s instanceof H))throw new d(n,l.InvalidParameter,r);i.push(s.hasZ?s.hasM?[s.x,s.y,s.z,s.m]:[s.x,s.y,s.z]:[s.x,s.y])}else if(o[0]instanceof it)i=o[0]._elements;else{if(!R(o[0]))throw new d(n,l.InvalidParameter,r);for(const s of o[0].toArray()){if(!(s instanceof H))throw new d(n,l.InvalidParameter,r);i.push(s.hasZ?s.hasM?[s.x,s.y,s.z,s.m]:[s.x,s.y,s.z]:[s.x,s.y])}}return!(i.length<3)&&Xr(i)})},e.polygon=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);let i=null;if(o[0]instanceof k){if(i=te(Q.parseGeometryFromDictionary(o[0]),n.spatialReference),!(i instanceof ue))throw new d(n,l.InvalidParameter,r)}else i=o[0]instanceof ue?De(o[0].toJSON()):te(new ue(JSON.parse(o[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,l.WrongSpatialReference,r);return Ye(i)})},e.polyline=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);let i=null;if(o[0]instanceof k){if(i=te(Q.parseGeometryFromDictionary(o[0]),n.spatialReference),!(i instanceof oe))throw new d(n,l.InvalidParameter,r)}else i=o[0]instanceof oe?De(o[0].toJSON()):te(new oe(JSON.parse(o[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,l.WrongSpatialReference,r);return Ye(i)})},e.point=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);let i=null;if(o[0]instanceof k){if(i=te(Q.parseGeometryFromDictionary(o[0]),n.spatialReference),!(i instanceof H))throw new d(n,l.InvalidParameter,r)}else i=o[0]instanceof H?De(o[0].toJSON()):te(new H(JSON.parse(o[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,l.WrongSpatialReference,r);return Ye(i)})},e.multipoint=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);let i=null;if(o[0]instanceof k){if(i=te(Q.parseGeometryFromDictionary(o[0]),n.spatialReference),!(i instanceof be))throw new d(n,l.InvalidParameter,r)}else i=o[0]instanceof be?De(o[0].toJSON()):te(new be(JSON.parse(o[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,l.WrongSpatialReference,r);return Ye(i)})},e.extent=function(n,r){return t(n,r,(a,u,o)=>{var s;o=Z(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof k)i=te(Q.parseGeometryFromDictionary(o[0]),n.spatialReference);else if(o[0]instanceof H){const c={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},p=o[0];p.hasZ?(c.zmin=p.z,c.zmax=p.z):p.hasM&&(c.mmin=p.m,c.mmax=p.m),i=De(c)}else i=o[0]instanceof ue||o[0]instanceof oe||o[0]instanceof be?De((s=o[0].extent)==null?void 0:s.toJSON()):o[0]instanceof ge?De(o[0].toJSON()):te(new ge(JSON.parse(o[0])),n.spatialReference);if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,l.WrongSpatialReference,r);return Ye(i)})},e.geometry=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(i=qt(o[0])?te(o[0].geometry(),n.spatialReference):o[0]instanceof k?te(Q.parseGeometryFromDictionary(o[0]),n.spatialReference):te(De(JSON.parse(o[0])),n.spatialReference),i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new d(n,l.WrongSpatialReference,r);return Ye(i)})},e.setgeometry=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,2,n,r),!qt(o[0]))throw new d(n,l.InvalidParameter,r);if(o[0].immutable===!0)throw new d(n,l.Immutable,r);if(!(o[1]instanceof B||o[1]===null))throw new d(n,l.InvalidParameter,r);return o[0]._geometry=o[1],A})},e.feature=function(n,r){return t(n,r,(a,u,o)=>{if(o.length===0)throw new d(n,l.WrongNumberOfParameters,r);let i=null;if(o.length===1)if(C(o[0]))i=Q.fromJson(JSON.parse(o[0]),n.timeZone);else if(qt(o[0]))i=Q.createFromArcadeFeature(o[0]);else if(o[0]instanceof B)i=Q.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof k))throw new d(n,l.InvalidParameter,r);{let s=o[0].hasField("geometry")?o[0].field("geometry"):null,c=o[0].hasField("attributes")?o[0].field("attributes"):null;s!==null&&s instanceof k&&(s=Q.parseGeometryFromDictionary(s)),c!==null&&(c=Q.parseAttributesFromDictionary(c)),i=Q.createFromGraphicLikeObject(s,c,null,n.timeZone)}}else if(o.length===2){let s=null,c=null;if(o[0]!==null)if(o[0]instanceof B)s=o[0];else{if(!(s instanceof k))throw new d(n,l.InvalidParameter,r);s=Q.parseGeometryFromDictionary(o[0])}if(o[1]!==null){if(!(o[1]instanceof k))throw new d(n,l.InvalidParameter,r);c=Q.parseAttributesFromDictionary(o[1])}i=Q.createFromGraphicLikeObject(s,c,null,n.timeZone)}else{let s=null;const c={};if(o[0]!==null)if(o[0]instanceof B)s=o[0];else{if(!(s instanceof k))throw new d(n,l.InvalidParameter,r);s=Q.parseGeometryFromDictionary(o[0])}for(let p=1;p{if(o.length===0||o.length===1&&o[0]===null){const c=new k;return c.immutable=!1,c}if(o.length===1&&C(o[0]))try{const c=JSON.parse(o[0]),p=k.convertObjectToArcadeDictionary(c,_(n),!1);return p.immutable=!1,p}catch{throw new d(n,l.InvalidParameter,r)}if(o.length===1&&o[0]instanceof B)try{const c=o[0].toJSON();c.hasZ=o[0].hasZ===!0,c.hasM=o[0].hasM===!0;const p=k.convertObjectToArcadeDictionary(c,_(n),!1);return p.immutable=!1,p}catch{throw new d(n,l.InvalidParameter,r)}if(o.length===1&&ee(o[0]))try{const c=new k;c.immutable=!1,c.setField("geometry",o[0].geometry());const p=new k;p.immutable=!1,c.setField("attributes",p);for(const f of o[0].keys())p.setField(f,o[0].field(f));return c}catch{throw new d(n,l.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const c=new k;c.immutable=!1;for(const p of o[0].keys())c.setField(p,o[0].field(p));return c}catch{throw new d(n,l.InvalidParameter,r)}if(o.length===2&&o[0]instanceof k&&z(o[1]))try{if(o[1]!==!0){const c=new k;c.immutable=!1;for(const p of o[0].keys())c.setField(p,o[0].field(p));return c}return o[0].deepClone()}catch{throw new d(n,l.InvalidParameter,r)}if(o.length%2!=0)throw new d(n,l.WrongNumberOfParameters,r);const i={};for(let c=0;c{D(o,2,2,n,r);const i=w(o[1]);if(qt(o[0])||o[0]instanceof k)return o[0].hasField(i);if(o[0]instanceof B){const s=$t(o[0],i,null,null,2);return!s||s.keystate!=="notfound"}throw new d(n,l.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,2,n,r),o[0]===null||o[1]===null)return!1;const i=w(o[1]);return ee(o[0])||o[0]instanceof k?!!o[0].hasField(i)&&o[0].field(i)!==null:o[0]instanceof B?$t(o[0],i,null,null,0)!==null:!1})},e.indexof=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,2,n,r);const i=o[1];if(T(o[0])){for(let s=0;s{if(o=Z(o),D(o,2,3,n,r),!(o[0]instanceof H))throw new d(n,l.InvalidParameter,r);if(!(o[1]instanceof H))throw new d(n,l.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof H))throw new d(n,l.InvalidParameter,r);return o.length===2?to(o[0],o[1]):ro(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,u,o)=>{if(o=Z(o),D(o,2,3,n,r),!(o[0]instanceof H))throw new d(n,l.InvalidParameter,r);if(!(o[1]instanceof H))throw new d(n,l.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof H))throw new d(n,l.InvalidParameter,r);return o.length===2?no(o[0],o[1]):io(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,u,o)=>{o=Z(o),D(o,1,1,n,r);let i=o[0];if(i instanceof ue)return i.isSelfIntersecting;if(i instanceof oe)return i=i.paths,vr(i);if(i instanceof be){const s=i.points;for(let c=0;c(i=Z(i),n(r,a,i),i[0]===null||i[1]===null||U.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]!==null&&i[1]!==null&&U.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]!==null&&i[1]!==null&&U.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]!==null&&i[1]!==null&&U.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]!==null&&i[1]!==null&&U.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]!==null&&i[1]!==null&&U.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]!==null&&i[1]!==null&&U.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(u,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof B&&i[1]instanceof B?U.equals(i[0],i[1]):(V(i[0])&&V(i[1])||J(i[0])&&J(i[1])||!(!P(i[0])||!P(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,3,3,r,a),i[0]instanceof B&&i[1]instanceof B)return U.relate(i[0],i[1],w(i[2]));if(i[0]instanceof B&&i[1]===null||i[1]instanceof B&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new d(r,l.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]===null||i[1]===null?null:U.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(u,o,i)=>{const s=[];if((i=Z(i)).length===0)throw new d(r,l.WrongNumberOfParameters,a);if(i.length===1)if(T(i[0])){const c=Z(i[0]);for(let p=0;p(i=Z(i),n(r,a,i),i[0]!==null&&i[1]===null?Se(i[0]):i[0]===null?null:U.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(u,o,i)=>(i=Z(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):U.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,2,r,a),!(i[1]instanceof ge)&&i[1]!==null)throw new d(r,l.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return i[1]===null?null:U.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,2,r,a),!(i[1]instanceof oe)&&i[1]!==null)throw new d(r,l.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return i[1]===null?[Se(i[0])]:U.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),(i=Z(i))[0]===null)return 0;if(T(i[0])||R(i[0])){const s=Mn(i[0],r.spatialReference);return s===null?0:U.planarArea(s,Jt($(i[1],-1)))}if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.planarArea(i[0],Jt($(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),(i=Z(i))[0]===null)return 0;if(T(i[0])||R(i[0])){const s=Mn(i[0],r.spatialReference);return s===null?0:U.geodesicArea(s,Jt($(i[1],-1)))}if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.geodesicArea(i[0],Jt($(i[1],-1)))})},e.length=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),(i=Z(i))[0]===null)return 0;if(T(i[0])||R(i[0])){const s=kt(i[0],r.spatialReference);return s===null?0:U.planarLength(s,re($(i[1],-1)))}if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.planarLength(i[0],re($(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),(i=Z(i))[0]===null)return 0;if(T(i[0])||R(i[0])){const s=kt(i[0],r.spatialReference);return s===null?0:s.hasZ===!0?kr(s,re($(i[1],-1))):U.planarLength(s,re($(i[1],-1)))}if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return i[0].hasZ===!0?kr(i[0],re($(i[1],-1))):U.planarLength(i[0],re($(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),(i=Z(i))[0]===null)return 0;if(T(i[0])||R(i[0])){const s=kt(i[0],r.spatialReference);return s===null?0:U.geodesicLength(s,re($(i[1],-1)))}if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.geodesicLength(i[0],re($(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(u,o,i)=>{i=Z(i),D(i,2,3,r,a);let s=i[0];(T(i[0])||R(i[0]))&&(s=Vt(i[0],r.spatialReference));let c=i[1];if((T(i[1])||R(i[1]))&&(c=Vt(i[1],r.spatialReference)),!(s instanceof B))throw new d(r,l.InvalidParameter,a);if(!(c instanceof B))throw new d(r,l.InvalidParameter,a);return U.distance(s,c,re($(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(u,o,i)=>{i=Z(i),D(i,2,3,r,a);const s=i[0],c=i[1];if(!(s instanceof H))throw new d(r,l.InvalidParameter,a);if(!(c instanceof H))throw new d(r,l.InvalidParameter,a);const p=new oe({paths:[],spatialReference:s.spatialReference});return p.addPath([s,c]),U.geodesicLength(p,re($(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);const s=h(i[1]);if(isNaN(s))throw new d(r,l.InvalidParameter,a);if(s<=0)throw new d(r,l.InvalidParameter,a);return i[0]instanceof ue||i[0]instanceof oe?U.densify(i[0],s,re($(i[2],-1))):i[0]instanceof ge?U.densify(Ir(i[0]),s,re($(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);const s=h(i[1]);if(isNaN(s))throw new d(r,l.InvalidParameter,a);if(s<=0)throw new d(r,l.InvalidParameter,a);return i[0]instanceof ue||i[0]instanceof oe?U.geodesicDensify(i[0],s,re($(i[2],-1))):i[0]instanceof ge?U.geodesicDensify(Ir(i[0]),s,re($(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);const s=h(i[1]);if(isNaN(s))throw new d(r,l.InvalidParameter,a);return U.generalize(i[0],s,ht($(i[2],!0)),re($(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);const s=h(i[1]);if(isNaN(s))throw new d(r,l.InvalidParameter,a);return s===0?Se(i[0]):U.buffer(i[0],s,re($(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);const s=h(i[1]);if(isNaN(s))throw new d(r,l.InvalidParameter,a);return s===0?Se(i[0]):U.geodesicBuffer(i[0],s,re($(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof ue||i[0]instanceof oe))throw new d(r,l.InvalidParameter,a);const s=h(i[1]);if(isNaN(s))throw new d(r,l.InvalidParameter,a);const c=h($(i[4],10));if(isNaN(c))throw new d(r,l.InvalidParameter,a);const p=h($(i[5],0));if(isNaN(p))throw new d(r,l.InvalidParameter,a);return U.offset(i[0],s,re($(i[2],-1)),w($(i[3],"round")).toLowerCase(),c,p)})},e.rotate=function(r,a){return t(r,a,(u,o,i)=>{i=Z(i),D(i,2,3,r,a);let s=i[0];if(s===null)return null;if(!(s instanceof B))throw new d(r,l.InvalidParameter,a);s instanceof ge&&(s=ue.fromExtent(s));const c=h(i[1]);if(isNaN(c))throw new d(r,l.InvalidParameter,a);const p=$(i[2],null);if(p===null)return U.rotate(s,c);if(p instanceof H)return U.rotate(s,c,p);throw new d(r,l.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,1,1,r,a),i[0]===null)return null;let s=i[0];if((T(i[0])||R(i[0]))&&(s=Vt(i[0],r.spatialReference)),s===null)return null;if(!(s instanceof B))throw new d(r,l.InvalidParameter,a);return s instanceof H?te(Se(i[0]),r.spatialReference):s instanceof ue?s.centroid:s instanceof oe?Ya(s):s instanceof be?Xa(s):s instanceof ge?s.center:null})},e.multiparttosinglepart=function(r,a){return t(r,a,(u,o,i)=>{i=Z(i),D(i,1,1,r,a);const s=[];if(i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);if(i[0]instanceof H)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof ge)return[te(Se(i[0]),r.spatialReference)];const c=U.simplify(i[0]);if(c instanceof ue){const p=[],f=[];for(let m=0;m{if(i=Z(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof B))throw new d(r,l.InvalidParameter,a);return U.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,2,r,a),!(i[0]instanceof B||i[0]===null))throw new d(r,l.InvalidParameter,a);if(!(i[1]instanceof H||i[1]===null))throw new d(r,l.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const s=U.nearestCoordinate(i[0],i[1]);return s===null||s.isEmpty?null:k.convertObjectToArcadeDictionary({coordinate:s.coordinate,distance:s.distance},_(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(u,o,i)=>{if(i=Z(i),D(i,2,2,r,a),!(i[0]instanceof B||i[0]===null))throw new d(r,l.InvalidParameter,a);if(!(i[1]instanceof H||i[1]===null))throw new d(r,l.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const s=U.nearestVertex(i[0],i[1]);return s===null||s.isEmpty?null:k.convertObjectToArcadeDictionary({coordinate:s.coordinate,distance:s.distance},_(r),!1,!0)})}}function gn(e,t,n){return n===void 0||+n==0?Math[e](t):(t=+t,n=+n,isNaN(t)||typeof n!="number"||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))}function _i(e,t){function n(r,a,u){const o=h(r);return isNaN(o)?o:isNaN(a)||isNaN(u)||a>u?NaN:ou?u:o}e.number=function(r,a){return t(r,a,(u,o,i)=>{D(i,1,2,r,a);const s=i[0];if(q(s))return s;if(s===null)return 0;if(V(s)||J(s)||P(s))return s.toNumber();if(z(s))return Number(s);if(T(s))return NaN;if(s===""||s===void 0)return Number(s);if(C(s)){if(i[1]!==void 0){let c=He(i[1],"‰","");return c=He(c,"¤",""),Yr(s,{pattern:c})}return Number(s.trim())}return Number(s)})},e.abs=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.abs(h(i[0]))))},e.acos=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.acos(h(i[0]))))},e.asin=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.asin(h(i[0]))))},e.atan=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.atan(h(i[0]))))},e.atan2=function(r,a){return t(r,a,(u,o,i)=>(D(i,2,2,r,a),Math.atan2(h(i[0]),h(i[1]))))},e.ceil=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),i.length===2){let s=h(i[1]);return isNaN(s)&&(s=0),gn("ceil",h(i[0]),-1*s)}return Math.ceil(h(i[0]))})},e.round=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),i.length===2){let s=h(i[1]);return isNaN(s)&&(s=0),gn("round",h(i[0]),-1*s)}return Math.round(h(i[0]))})},e.floor=function(r,a){return t(r,a,(u,o,i)=>{if(D(i,1,2,r,a),i.length===2){let s=h(i[1]);return isNaN(s)&&(s=0),gn("floor",h(i[0]),-1*s)}return Math.floor(h(i[0]))})},e.cos=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.cos(h(i[0]))))},e.isnan=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.exp(h(i[0]))))},e.log=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.log(h(i[0]))))},e.pow=function(r,a){return t(r,a,(u,o,i)=>(D(i,2,2,r,a),h(i[0])**h(i[1])))},e.random=function(r,a){return t(r,a,(u,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.sin(h(i[0]))))},e.sqrt=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.sqrt(h(i[0]))))},e.tan=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),Math.tan(h(i[0]))))},e.defaultvalue=function(r,a){return t(r,a,(u,o,i)=>(D(i,2,2,r,a),i[0]===null||i[0]===""||i[0]===void 0?i[1]:i[0]))},e.isempty=function(r,a){return t(r,a,(u,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0))},e.boolean=function(r,a){return t(r,a,(u,o,i)=>{D(i,1,1,r,a);const s=i[0];return ht(s)})},e.constrain=function(r,a){return t(r,a,(u,o,i)=>{D(i,3,3,r,a);const s=h(i[1]),c=h(i[2]);if(T(i[0])){const p=[];for(const f of i[0])p.push(n(f,s,c));return p}if(R(i[0])){const p=[];for(let f=0;f=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return uo(t,n);case"avg":case"mean":return Mi(We(t));case"min":return Math.min.apply(Math,We(t));case"sum":return oo(We(t));case"max":return Math.max.apply(Math,We(t));case"stdev":case"stddev":return Math.sqrt(Tr(We(t)));case"var":case"variance":return Tr(We(t));case"count":return t.length}return 0}function Ze(e,t,n,r){if(r.length===1){if(T(r[0]))return yn(e,r[0],-1);if(R(r[0]))return yn(e,r[0].toArray(),-1)}return yn(e,r,-1)}function $i(e,t){e.stdev=function(n,r){return t(n,r,(a,u,o)=>Ze("stdev",a,u,o))},e.variance=function(n,r){return t(n,r,(a,u,o)=>Ze("variance",a,u,o))},e.average=function(n,r){return t(n,r,(a,u,o)=>Ze("mean",a,u,o))},e.mean=function(n,r){return t(n,r,(a,u,o)=>Ze("mean",a,u,o))},e.sum=function(n,r){return t(n,r,(a,u,o)=>Ze("sum",a,u,o))},e.min=function(n,r){return t(n,r,(a,u,o)=>Ze("min",a,u,o))},e.max=function(n,r){return t(n,r,(a,u,o)=>Ze("max",a,u,o))},e.distinct=function(n,r){return t(n,r,(a,u,o)=>Ze("distinct",a,u,o))},e.count=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),T(o[0])||C(o[0]))return o[0].length;if(R(o[0]))return o[0].length();throw new d(n,l.InvalidParameter,r)})}}let Pn=class extends k{constructor(t){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",t),this.immutable=!0}},so=class Li extends k{constructor(t,n,r,a,u,o,i){super(),this.attachmentUrl=u,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){var t;return new Li(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,((t=this.field("exifinfo"))==null?void 0:t.deepClone())??null,this.field("keywords"))}};const or=e=>(t,n,r)=>(r=r||14,+e(t,n).toFixed(r)),lo=(e,t)=>e+t,co=(e,t)=>e*t,fo=(e,t)=>e/t,Br=(e,t,n)=>or(lo)(e,t,n),ct=(e,t,n)=>or(co)(e,t,n),Qt=(e,t,n)=>or(fo)(e,t,n),en=360,ho=400,mo=2*Math.PI,ve=3600,Nr=3240,Bt=60,je=60,_r=180*ve/Math.PI,St=en*Bt*je,wn=90*ve,at=180*ve,po=270*ve,Oi="ᵍ",vt="°";function At(e){if(C(e)===!1)throw new d(null,l.InvalidParameter,null);return e}function Rn(e,t){const n=10**t;return Math.round(e*n)/n}function Do(e,t){return e%t}function ot(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var Y,y,j,Un;function lt(e,t){switch(e){case Y.north:return t==="SHORT"?"N":"North";case Y.east:return t==="SHORT"?"E":"East";case Y.south:return t==="SHORT"?"S":"South";case Y.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case y.truncated_degrees:case y.decimal_degrees:return en;case y.radians:return mo;case y.gradians:return ho;case y.seconds:return St;case y.fractional_degree_minutes:return Bt;case y.fractional_minute_seconds:return je;default:throw new d(null,l.LogicError,null,{reason:"unsupported evaluations"})}}function Mr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return j.north_azimuth;case"POLAR":return j.polar;case"QUADRANT":return j.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return j.south_azimuth}throw new d(null,l.LogicError,null,{reason:"unsupported directionType"})}function $r(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return y.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return y.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return y.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return y.gradians}throw new d(null,l.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(Y||(Y={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(y||(y={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(j||(j={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class Kt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case y.decimal_degrees:case y.truncated_degrees:return this.m_degrees;case y.fractional_degree_minutes:return this.m_minutes;case y.seconds:case y.fractional_minute_seconds:return this.m_seconds;default:throw new d(null,l.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=ot(t).fraction;let r=ot(t).integer;const a=Math.floor(r/ve);r-=a*ve;const u=Math.floor(r/je);return r-=u*je,new Kt(a,u,r+n)}static numberToDms(t){const n=ot(t).fraction,r=ot(t).integer,a=ct(ot(100*n).fraction,100),u=ot(100*n).integer;return new Kt(r,u,a)}format(t,n){let r=Rn(this.m_seconds,n),a=this.m_minutes,u=this.m_degrees;if(t===y.seconds||t===y.fractional_minute_seconds)je<=r&&(r-=je,++a),Bt<=a&&(a=0,++u),en<=u&&(u=0);else if(t===y.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,u=this.m_degrees,Bt<=a&&(a=0,++u),en<=u&&(u=0);else if(t===y.decimal_degrees||t===y.truncated_degrees){const o=Qt(this.m_seconds,ve),i=Qt(this.m_minutes,Bt);u=Math.round(this.m_degrees+i+o),a=0,r=0}return new Kt(u,a,r)}static dmsToSeconds(t,n,r){return t*ve+n*je+r}},go=class{constructor(t,n,r){this.meridian=t,this.angle=n,this.direction=r}fetchAzimuth(t){return t===Un.meridian?this.meridian:this.direction}},Je=class Re{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Re(new Ne(Re._convertDirectionFormat(t.extractAngularUnits(y.seconds),n,j.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(y.seconds);switch(t){case j.north_azimuth:case j.south_azimuth:case j.polar:return new Ne(Re._convertDirectionFormat(n,j.north_azimuth,t));case j.quadrant:{const r=Re.secondsNorthAzimuthToQuadrant(n);return new Ne(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(y.seconds);switch(t){case j.north_azimuth:return Y.north;case j.south_azimuth:return Y.south;case j.polar:return Y.east;case j.quadrant:return Re.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(y.seconds);switch(t){case j.north_azimuth:return Y.east;case j.south_azimuth:return Y.west;case j.polar:return Y.north;case j.quadrant:return Re.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=po?Y.north:Y.south,r=n===Y.north?Math.min(St-t,t):Math.abs(t-at),a=t>at?Y.west:Y.east;return new go(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Re(new Ne(Re.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(y.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===Y.north?r===Y.east?t:St-t:r===Y.east?at-t:at+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case j.north_azimuth:a=t;break;case j.polar:a=wn-t;break;case j.quadrant:throw new d(null,l.LogicError,null,{reason:"unexpected evaluation"});case j.south_azimuth:a=t+at}let u=0;switch(r){case j.north_azimuth:u=a;break;case j.polar:u=wn-a;break;case j.quadrant:throw new d(null,l.LogicError,null,{reason:"unexpected evaluation"});case j.south_azimuth:u=a-at}return u=Do(u,St),u<0?St+u:u}};function Lr(e,t,n){let r=null;switch(t){case y.decimal_degrees:r=ct(e,ve);break;case y.seconds:r=e;break;case y.gradians:r=ct(e,Nr);break;case y.radians:r=ct(e,_r);break;default:throw new d(null,l.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case y.decimal_degrees:return Qt(r,ve);case y.seconds:return r;case y.gradians:return Qt(r,Nr);case y.radians:return r/_r;default:throw new d(null,l.LogicError,null,{reason:"unexpected evaluation"})}}let Ne=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Lr(t,n,y.seconds))}extractAngularUnits(t){return Lr(this._seconds,y.seconds,Lt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(Br(Br(ct(t,ve),ct(n,je)),r))}};function Lt(e){switch(ti(e),e){case y.decimal_degrees:case y.truncated_degrees:case y.degrees_minutes_seconds:return y.decimal_degrees;case y.gradians:return y.gradians;case y.fractional_degree_minutes:return y.fractional_degree_minutes;case y.radians:return y.radians;case y.seconds:case y.fractional_minute_seconds:return y.seconds}}let yo=class Pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new Pi(t,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let t=null,n=y.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case y.truncated_degrees:case y.fractional_degree_minutes:return u=xn(a.fetchFormattedDms().getField(t),Fn(t)),u.toFixed(r).padStart(n+r+(r>0?1:0),"0");case y.fractional_minute_seconds:return u=xn(Rn(a.fetchDms().getField(t),r),Fn(t)),u.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new d(null,l.LogicError,null,{reason:"unexpected evaluation"})}}function xo(e,t,n){if(n===j.quadrant)throw new d(null,l.LogicError,null,{reason:"conversion error"});if(t===y.degrees_minutes_seconds){const r=pt.numberToDms(e);return Je.createFromAngleAndDirection(Ne.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Je.createFromAngleAndDirection(Ne.createFromAngleAndUnits(e,Lt(t)),n)}function Fo(e){switch(h(e)){case 1:return{first:Y.north,second:Y.east};case 2:return{first:Y.south,second:Y.east};case 3:return{first:Y.south,second:Y.west};case 4:return{first:Y.north,second:Y.west}}return null}function Or(e){switch(e.toUpperCase().trim()){case"N":case"NORTH":return Y.north;case"E":case"EAST":return Y.east;case"S":case"SOUTH":return Y.south;case"W":case"WEST":return Y.west}return null}function ut(e){const t=parseFloat(e);if(q(t)){if(isNaN(t))throw new d(null,l.LogicError,null,{reason:"invalid conversion"});return t}throw new d(null,l.LogicError,null,{reason:"invalid conversion"})}function Cn(e,t,n){const r=n===j.quadrant;let a=null,u=null,o=0,i=0,s=0;if(r){if(e.length<2)throw new d(null,l.LogicError,null,{reason:"conversion error"});s=1;const c=Fo(w(e[e.length-1]));if(c?(a=c.first,u=c.second):(o=1,a=Or(w(e[0])),u=Or(w(e[e.length-1]))),a===null||u===null)throw new d(null,l.LogicError,null,{reason:"invalid conversion"})}switch(t){case y.decimal_degrees:case y.radians:case y.gradians:if(e.length===0)throw new d(null,l.LogicError,null,{reason:"invalid conversion"});return r?Je.createFromAngleMeridianAndDirection(Ne.createFromAngleAndUnits(ut(e[o]),Lt(t)),a,u):Je.createFromAngleAndDirection(Ne.createFromAngleAndUnits(ut(e[o]),Lt(t)),n);case y.degrees_minutes_seconds:if(i=e.length-s-o,i===3){const c=Ne.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Je.createFromAngleMeridianAndDirection(c,a,u):Je.createFromAngleAndDirection(c,n)}if(i===1){const c=ut(e[o]),p=pt.numberToDms(c),f=Ne.createFromDegreesMinutesSeconds(p.m_degrees,p.m_minutes,p.m_seconds);return r?Je.createFromAngleMeridianAndDirection(f,a,u):Je.createFromAngleAndDirection(f,n)}}throw new d(null,l.LogicError,null,{reason:"invalid conversion"})}function Co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,Oi," ","\r",` +`,"*"]);let n="";for(let r=0;rr!=="")}function Ao(e,t,n){if(q(e))return xo(h(e),t,n);if(C(e))return Cn(Co(e),t,n);if(T(e))return Cn(e,t,n);if(R(e))return Cn(e.toArray(),t,n);throw new d(null,l.LogicError,null,{reason:"conversion error"})}function bo(e,t,n){const r=Lt(n);if(r&&n!==y.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new d(null,l.LogicError,null,{reason:"conversion error"})}function Eo(e,t,n){const r=e.getAngle(t);if(t===j.quadrant&&n===y.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(y.seconds));return[lt(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,lt(e.getDirection(t),"SHORT")]}if(n===y.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(y.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===j.quadrant?[lt(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),lt(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function So(e,t){let n="";switch(e){case y.decimal_degrees:n=t===j.quadrant?"DD.DD"+vt:"DDD.DD"+vt;break;case y.degrees_minutes_seconds:n=t===j.quadrant?"dd"+vt+` mm' ss"`:"ddd"+vt+` mm' ss.ss"`;break;case y.radians:n="R.RR";break;case y.gradians:n="GGG.GG"+Oi;break;default:throw new d(null,l.LogicError,null,{reason:"conversion error"})}return t===j.quadrant&&(n="p "+n+" b"),n}function Gn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t(D(o,1,1,n,r),new Pn(w(o[0]))))},e.typeof=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=Qn(o[0]);if(i==="Unrecognized Type")throw new d(n,l.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,u,o)=>(D(o,1,1,n,r),w(o[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=h(o[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,u,o)=>(D(o,1,1,n,r),w(o[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,2,n,r);let i=1;o.length===2&&w(o[1]).toLowerCase()==="firstword"&&(i=2);const s=/\s/,c=w(o[0]);let p="",f=!0;for(let m=0;m(D(o,1,1,n,r),w(o[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,0,1,n,r),o.length>0)switch(w(o[0]).toLowerCase()){case"digits":return st().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return st();case"digits-hyphen-braces":return"{"+st()+"}";case"digits-hyphen-parentheses":return"("+st()+")"}return"{"+st()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,2,n,r);let i=w(o[0]);if(i===""||i===null)return"";const s=/^(\{|\()?(?[0-9a-z]{8})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!s)return"";const c=s.groups;switch(i=c.partA+"-"+c.partB+"-"+c.partC+"-"+c.partD+"-"+c.partE,w(o[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,u,o)=>(o.length===0||(o.length===1?n.console(w(o[0])):n.console(w(o))),A))},e.mid=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,3,n,r);let i=h(o[1]);if(isNaN(i))return"";if(i<0&&(i=0),o.length===2)return w(o[0]).substr(i);let s=h(o[2]);return isNaN(s)?"":(s<0&&(s=0),w(o[0]).substr(i,s))})},e.find=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,3,n,r);let i=0;if(o.length>2){if(i=h($(o[2],0)),isNaN(i))return-1;i<0&&(i=0)}return w(o[1]).indexOf(w(o[0]),i)})},e.left=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,2,n,r);let i=h(o[1]);return isNaN(i)?"":(i<0&&(i=0),w(o[0]).substr(0,i))})},e.right=function(n,r){return t(n,r,(a,u,o)=>{D(o,2,2,n,r);let i=h(o[1]);return isNaN(i)?"":(i<0&&(i=0),w(o[0]).substr(-1*i,i))})},e.split=function(n,r){return t(n,r,(a,u,o)=>{let i;D(o,2,4,n,r);let s=h($(o[2],-1));const c=ht($(o[3],!1));if(s===-1||s===null||c===!0?i=w(o[0]).split(w(o[1])):(isNaN(s)&&(s=-1),s<-1&&(s=-1),i=w(o[0]).split(w(o[1]),s)),c===!1)return i;const p=[];for(let f=0;f=s);f++)i[f]!==""&&i[f]!==void 0&&p.push(i[f]);return p})},e.text=function(n,r){return t(n,r,(a,u,o)=>(D(o,1,2,n,r),we(o[0],o[1])))},e.concatenate=function(n,r){return t(n,r,(a,u,o)=>{const i=[];if(o.length<1)return"";if(T(o[0])){const s=$(o[2],"");for(let c=0;c1?i.join(o[1]):i.join("")}if(R(o[0])){const s=$(o[2],"");for(let c=0;c1?i.join(o[1]):i.join("")}for(let s=0;s{if(D(o,1,1,n,r),T(o[0])){const i=o[0].slice(0);return i.reverse(),i}if(R(o[0])){const i=o[0].toArray().slice(0);return i.reverse(),i}throw new d(n,l.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,u,o)=>{D(o,3,4,n,r);const i=w(o[0]),s=w(o[1]),c=w(o[2]);return o.length!==4||ht(o[3])?He(i,s,c):i.replace(s,c)})},e.schema=function(n,r){return t(n,r,(a,u,o)=>{if(ee(o[0])){const i=xi(o[0]);return i?k.convertObjectToArcadeDictionary(i,_(n)):null}throw new d(n,l.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),ee(o[0])){const i=jt(o[0]);return i?k.convertObjectToArcadeDictionary(i,_(n)):null}throw new d(n,l.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),ee(o[0])){const i=jt(o[0]);if(!i)return null;if(i.subtypeField&&o[0].hasField(i.subtypeField)){const s=o[0].field(i.subtypeField);for(const c of i.subtypes)if(c.code===s)return c.code;return null}return null}throw new d(n,l.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),ee(o[0])){const i=jt(o[0]);if(!i)return"";if(i.subtypeField&&o[0].hasField(i.subtypeField)){const s=o[0].field(i.subtypeField);for(const c of i.subtypes)if(c.code===s)return c.name;return""}return""}throw new d(n,l.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),ee(o[0]))return o[0].gdbVersion();throw new d(n,l.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,3,n,r),ee(o[0])){const i=gi(o[0],w(o[1]),o[2]===void 0?void 0:o[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?k.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:Cr[i.field.type],codedValues:i.domain.codedValues.map(s=>({name:s.name,code:s.code}))},_(n)):k.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:Cr[i.field.type],min:i.domain.min,max:i.domain.max},_(n)):null}throw new d(n,l.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,4,n,r),ee(o[0]))return yi(o[0],w(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new d(n,l.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,2,4,n,r),ee(o[0]))return wi(o[0],w(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new d(n,l.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),o[0]===null)return"";if(o[0]instanceof k){let i="";for(const s of o[0].keys()){const c=o[0].field(s);i!==""&&(i+="&"),i+=c===null?encodeURIComponent(s)+"=":encodeURIComponent(s)+"="+encodeURIComponent(c)}return i}return encodeURIComponent(w(o[0]))})},e.hash=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,1,n,r);const i=new Sa(0);return Ce(o[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,u,o)=>(D(o,3,3,n,r),ko(o[0],o[1],o[2])))},e.fromjson=function(n,r){return t(n,r,(a,u,o)=>{if(D(o,1,1,n,r),C(o[0])===!1)throw new d(n,l.InvalidParameter,r);return k.convertJsonToArcade(JSON.parse(w(o[0])),_(n))})},e.expects=function(n,r){return t(n,r,(a,u,o)=>{if(o.length<1)throw new d(n,l.WrongNumberOfParameters,r);return A})},e.tocharcode=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,2,n,r);const i=h($(o[1],0)),s=w(o[0]);if(s.length===0&&o.length===1)return null;if(s.length<=i||i<0)throw new d(n,l.OutOfBounds,r);return s.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,u,o)=>{D(o,1,2,n,r);const i=h($(o[1],0)),s=w(o[0]);if(s.length===0&&o.length===1)return null;if(s.length<=i||i<0)throw new d(n,l.OutOfBounds,r);return s.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,u,o)=>{if(o.length<1)throw new d(n,l.WrongNumberOfParameters,r);const i=o.map(s=>Math.trunc(h(s))).filter(s=>s>=0&&s<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,u,o)=>{if(o.length<1)throw new d(n,l.WrongNumberOfParameters,r);let i;try{i=o.map(s=>Math.trunc(h(s))).filter(s=>s<=1114111&&s>>>0===s)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,u,o)=>{var s;D(o,0,2,n,r);let i=$(o[1],"");if(i=i===!0||i===!1?"":w(i),i!==null&&i!=="")return null;if(o.length===0||o[0]instanceof Pn){let c=null;if(c=(s=n.services)!=null&&s.portal?n.services.portal:Wn.getDefault(),o.length>0&&!Bo(o[0].field("url"),c)||!c)return null;if(i===""){const p=To(c);if(p){const f=JSON.parse(JSON.stringify(p));for(const m of["lastLogin","created","modified"])f[m]!==void 0&&f[m]!==null&&(f[m]=new Date(f[m]));return k.convertObjectToArcadeDictionary(f,_(n))}}return null}throw new d(n,l.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,u,o)=>(D(o,0,0,n,r),k.convertObjectToArcadeDictionary(Fi(_(n),n.spatialReference),_(n),!0)))}}let No=class extends tt{constructor(t,n){super(),this.paramCount=n,this.fn=t}createFunction(t){return(...n)=>{if(n.length!==this.paramCount)throw new d(t,l.WrongNumberOfParameters,null);return this.fn(...n)}}call(t,n){return this.fn(...n.arguments)}marshalledCall(t,n,r,a){return a(t,n,(u,o,i)=>{i=i.map(c=>!X(c)||c instanceof ze?c:dt(c,t,a));const s=this.call(r,{arguments:i});return qe(s)?s.then(c=>dt(c,r,a)):s})}};function Ae(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function S(e,t){try{switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return Vo(e,t);case"VariableDeclaration":return qo(e,t);case"BlockStatement":case"Program":return Zn(e,t);case"FunctionDeclaration":return Jo(e,t);case"ImportDeclaration":return Go(e,t);case"ExportNamedDeclaration":return Zo(e,t);case"ReturnStatement":return zo(e,t);case"IfStatement":return Ui(e,t);case"ExpressionStatement":return Uo(e,t);case"AssignmentExpression":return Ro(e,t);case"UpdateExpression":return Oo(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return Wo(e,t);case"TemplateElement":return JSON.stringify(t.value?t.value.cooked:"");case"ForStatement":return Lo(e,t);case"ForInStatement":return $o(e,t);case"WhileStatement":return Po(e,t);case"Identifier":return Qo(e,t);case"MemberExpression":return jo(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return eu(e,t);case"UnaryExpression":return Ho(e,t);case"BinaryExpression":return Yo(e,t);case"LogicalExpression":return Xo(e,t);case"ArrayExpression":return Ko(e,t);case"ObjectExpression":return _o(e,t);case"Property":return Mo(e,t);case"Array":throw new le(e,l.NeverReach,t);default:throw new le(e,l.Unrecognized,t)}}catch(n){throw n}}function _o(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+(a.key.type==="Identifier"?"'"+a.key.name+"'":S(e,a.key))+",'ObjectExpression'),lang.aCheck("+S(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function Mo(e,t){throw new le(e,l.NeverReach,t)}function $o(e,t){const n=_e(e),r=_e(e),a=_e(e);let u="var "+n+" = "+S(e,t.right)+`; +`;t.left.type==="VariableDeclaration"&&(u+=S(e,t.left));let o=t.left.type==="VariableDeclaration"?t.left.declarations[0].id.name:t.left.name;o=o.toLowerCase(),xe(o);let i="";e.localScope!==null&&(e.localScope[o]!==void 0?i="lscope['"+o+"']":e.localScope._SymbolsMap[o]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[o]+"']"));let s="";if(i===""){if(e.globalScope[o]!==void 0)i="gscope['"+o+"']";else if(e.globalScope._SymbolsMap[o]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[o]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(o))i="gscope['"+e.undeclaredGlobalsInFunctions.get(o).manglename+"']",s=e.undeclaredGlobalsInFunctions.get(o).manglename;else{const c={manglename:Te(e),node:t.left};e.undeclaredGlobalsInFunctions.set(o,c),i="gscope['"+c.manglename+"']",s=c.manglename}}return s&&(u+="lang.chkAssig('"+s+`',runtimeCtx); +`),u+="if ("+n+`===null) { lastStatement = lc.voidOperation; } + `,u+="else if (lc.isArray("+n+") || lc.isString("+n+")) {",u+="var "+r+"="+n+`.length; +`,u+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,u+=i+"="+a+`; +`,u+=S(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`,u+="else if (lc.isImmutableArray("+n+")) {",u+="var "+r+"="+n+`.length(); +`,u+="for(var "+a+"=0; "+a+"<"+r+"; "+a+`++) { +`,u+=i+"="+a+`; +`,u+=S(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`,u+="else if (( "+n+" instanceof lang.Dictionary) || ( "+n+" instanceof lang.Feature)) {",u+="var "+r+"="+n+`.keys(); +`,u+="for(var "+a+"=0; "+a+"<"+r+".length; "+a+`++) { +`,u+=i+"="+r+"["+a+`]; +`,u+=S(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`,e.isAsync&&(u+="else if (lc.isFeatureSet("+n+")) {",u+="var "+r+"="+n+`.iterator(runtimeCtx.abortSignal); +`,u+="for(var "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+", runtimeCtx); "+a+"!=null; "+a+"=lang. graphicToFeature( yield "+r+".next(),"+n+`, runtimeCtx)) { +`,u+=i+"="+a+`; +`,u+=S(e,t.body),u+=` +} +`,u+=` lastStatement = lc.voidOperation; +`,u+=` +} +`),u+=`else { lastStatement = lc.voidOperation; } +`,u}function Lo(e,t){let n=`lastStatement = lc.voidOperation; +`;t.init!==null&&(n+=S(e,t.init)+"; ");const r=_e(e),a=_e(e);return n+="var "+r+" = true; ",n+=` + do { `,t.update!==null&&(n+=" if ("+r+`===false) { + `+S(e,t.update)+` +} + `+r+`=false; +`),t.test!==null&&(n+="var "+a+" = "+S(e,t.test)+"; ",n+="if ("+a+"===false) { break; } else if ("+a+"!==true) { lang.error('"+l.BooleanConditionRequired+`'); } +`),n+=S(e,t.body),t.update!==null&&(n+=` + `+S(e,t.update)),n+=` +`+r+` = true; +} while(true); lastStatement = lc.voidOperation; `,n}function Oo(e,t){let n=null,r="";if(t.argument.type==="MemberExpression")return n=S(e,t.argument.object),t.argument.computed===!0?r=S(e,t.argument.property):(r="'"+t.argument.property.name+"'",xe(t.argument.property.name)),"lang.memberupdate("+n+","+r+",'"+t.operator+"',"+t.prefix+")";if(n=t.argument.name.toLowerCase(),xe(n),e.localScope!==null){if(e.localScope[n]!==void 0)return"lang.update(lscope, '"+n+"','"+t.operator+"',"+t.prefix+")";if(e.localScope._SymbolsMap[n]!==void 0)return"lang.update(lscope, '"+e.localScope._SymbolsMap[n]+"','"+t.operator+"',"+t.prefix+")"}if(e.globalScope[n]!==void 0)return"lang.update(gscope, '"+n+"','"+t.operator+"',"+t.prefix+")";if(e.globalScope._SymbolsMap[n]!==void 0)return"lang.update(gscope, '"+e.globalScope._SymbolsMap[n]+"','"+t.operator+"',"+t.prefix+")";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(n))return"lang.update(gscope,lang.chkAssig( '"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")";const a={manglename:Te(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(n,a),"lang.update(gscope, lang.chkAssig('"+a.manglename+"',runtimeCtx),'"+t.operator+"',"+t.prefix+")"}throw new d(e,l.InvalidIdentifier,t)}function Po(e,t){let n=`lastStatement = lc.voidOperation; +`;const r=_e(e);return n+=` + var ${r} = true; + do { + ${r} = ${S(e,t.test)}; + if (${r}==false) { + break; + } + if (${r}!==true) { + lang.error('${l.BooleanConditionRequired}'); + } + ${S(e,t.body)} + } + while (${r} !== false); + lastStatement = lc.voidOperation; + `,n}function Ro(e,t){const n=S(e,t.right);let r=null,a="";if(t.left.type==="MemberExpression")return r=S(e,t.left.object),t.left.computed===!0?a=S(e,t.left.property):(a="'"+t.left.property.name+"'",xe(t.left.property.name)),"lang.assignmember("+r+","+a+",'"+t.operator+"',"+n+")";if(r=t.left.name.toLowerCase(),xe(r),e.localScope!==null){if(e.localScope[r]!==void 0)return"lscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+r+"'])";if(e.localScope._SymbolsMap[r]!==void 0)return"lscope['"+e.localScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', lscope['"+e.localScope._SymbolsMap[r]+"'])"}if(e.globalScope[r]!==void 0)return"gscope['"+r+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+r+"'])";if(e.globalScope._SymbolsMap[r]!==void 0)return"gscope['"+e.globalScope._SymbolsMap[r]+"']=lang.assign("+n+",'"+t.operator+"', gscope['"+e.globalScope._SymbolsMap[r]+"'])";if(e.localScope!==null){if(e.undeclaredGlobalsInFunctions.has(r))return"gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(r).manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+e.undeclaredGlobalsInFunctions.get(r).manglename+"'])";const u={manglename:Te(e),node:t.argument};return e.undeclaredGlobalsInFunctions.set(r,u),"gscope[lang.chkAssig('"+u.manglename+"',runtimeCtx)]=lang.assign("+n+",'"+t.operator+"', gscope['"+u.manglename+"'])"}throw new d(e,l.InvalidIdentifier,t)}function Uo(e,t){return t.expression.type==="AssignmentExpression"?"lastStatement = lc.voidOperation; "+S(e,t.expression)+`; + `:(t.expression.type,"lastStatement = "+S(e,t.expression)+"; ")}function Rr(e,t){return t.type==="BlockStatement"?S(e,t):t.type==="ReturnStatement"||t.type==="BreakStatement"||t.type==="ContinueStatement"?S(e,t)+"; ":t.type==="UpdateExpression"?"lastStatement = "+S(e,t)+"; ":t.type==="ExpressionStatement"?S(e,t):t.type==="ObjectExpression"?"lastStatement = "+S(e,t)+"; ":S(e,t)+"; "}function Ui(e,t){if(t.test.type==="AssignmentExpression"||t.test.type==="UpdateExpression")throw new le(e,l.BooleanConditionRequired,t);return`if (lang.mustBoolean(${S(e,t.test)}, runtimeCtx) === true) { + ${Rr(e,t.consequent)} + } `+(t.alternate!==null?t.alternate.type==="IfStatement"?" else "+Ui(e,t.alternate):` else { + ${Rr(e,t.alternate)} + } +`:` else { + lastStatement = lc.voidOperation; + } +`)}function Zn(e,t){let n="";for(let r=0;r0&&(u+=", "),u+=S(e,t.arguments[o]);return u+="]",e.isAsync?"(yield lang.callModuleFunction("+S(e,t.callee.object)+","+u+","+a+",runtimeCtx))":"lang.callModuleFunction("+S(e,t.callee.object)+","+u+","+a+",runtimeCtx)"}if(t.callee.type!=="Identifier")throw new le(e,l.FunctionNotFound,t);const n=t.callee.name.toLowerCase();if(n==="iif")return tu(e,t);if(n==="when")return nu(e,t);if(n==="decode")return ru(e,t);let r="";if(e.localScope!==null&&(e.localScope[n]!==void 0?r="lscope['"+n+"']":e.localScope._SymbolsMap[n]!==void 0&&(r="lscope['"+e.localScope._SymbolsMap[n]+"']")),r===""){if(e.globalScope[n]!==void 0)r="gscope['"+n+"']";else if(e.globalScope._SymbolsMap[n]!==void 0)r="gscope['"+e.globalScope._SymbolsMap[n]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(n))r="gscope[lang.chkAssig('"+e.undeclaredGlobalsInFunctions.get(n).manglename+"',runtimeCtx)]";else{const a={manglename:Te(e),node:t.argument};e.undeclaredGlobalsInFunctions.set(n,a),r="gscope[lang.chkAssig('"+a.manglename+"',runtimeCtx)]"}}if(r!==""){let a="[";for(let u=0;u0&&(a+=", "),a+=S(e,t.arguments[u]);return a+="]",e.isAsync?"(yield lang.callfunc("+r+","+a+",runtimeCtx) )":"lang.callfunc("+r+","+a+",runtimeCtx)"}throw new le(e,l.FunctionNotFound,t)}catch(n){throw n}}function tu(e,t){try{if(t.arguments.length!==3)throw new le(e,l.WrongNumberOfParameters,t);const n=_e(e);return`${e.isAsync?`(yield (function() { + return lang.__awaiter(this, void 0, void 0, function* () {`:"function() {"} + var ${n} = ${S(e,t.arguments[0])}; + + if (${n} === true) { + return ${S(e,t.arguments[1])}; + } + else if (${n} === false) { + return ${S(e,t.arguments[2])}; + } + else { + lang.error('ExecutionErrorCodes.BooleanConditionRequired'); + } + ${e.isAsync?"})}()))":"}()"}`}catch(n){throw n}}function nu(e,t){try{if(t.arguments.length<3)throw new le(e,l.WrongNumberOfParameters,t);if(t.arguments.length%2==0)throw new le(e,l.WrongNumberOfParameters,t);const n=_e(e);let r="var ";for(let a=0;a{throw new d(e,l.Unrecognized,t)})}catch(n){throw n}},ne.decode=function(e,t){try{return Ae(e,t,(n,r,a)=>{throw new d(e,l.Unrecognized,t)})}catch(n){throw n}},ne.when=function(e,t){try{return Ae(e,t,(n,r,a)=>{throw new d(e,l.Unrecognized,t)})}catch(n){throw n}};const Dt={};for(const e in ne)Dt[e]=new nt(ne[e]);Ni(ne,Ae);for(const e in ne)ne[e]=new nt(ne[e]);const ur=function(){};ur.prototype=ne;const sr=function(){};function zi(e,t,n){const r={};e||(e={}),n||(n={}),r._SymbolsMap={},r.textformatting=1,r.infinity=1,r.pi=1;for(const a in t)r[a]=1;for(const a in n)r[a]=1;for(const a in e)r[a]=1;return r}function Gi(e,t,n,r){const a=n?new sr:new ur;e||(e={}),t||(t={});const u=new k({newline:` +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});u.immutable=!1,a._SymbolsMap={textformatting:1,infinity:1,pi:1},a.textformatting=u,a.infinity=Number.POSITIVE_INFINITY,a.pi=Math.PI;for(const o in t)a[o]=t[o],a._SymbolsMap[o]=1;for(const o in e)a._SymbolsMap[o]=1,e[o]&&e[o].declaredClass==="esri.Graphic"?a[o]=Q.createFromGraphic(e[o],r??null):a[o]=e[o];return a}sr.prototype=Dt;function rt(e,t){const n={mode:t,compiled:!0,functions:{},signatures:[],standardFunction:Ae,standardFunctionAsync:Ae,evaluateIdentifier:iu};for(let r=0;r0){if(n.substr(0,2).toLowerCase()!=="_t"&&e.localStack[e.localStack.length-1][n]!==void 0)return e.localStack[e.localStack.length-1][n];const a=e.mangleMap[n];if(a!==void 0&&e.localStack[e.localStack.length-1][a]!==void 0)return e.localStack[e.localStack.length-1][a]}if(n.substr(0,2).toLowerCase()!=="_t"&&e.globalScope[n]!==void 0||e.globalScope._SymbolsMap[n]===1)return e.globalScope[n];const r=e.mangleMap[n];return r!==void 0?e.globalScope[r]:void 0}rt([On],"sync"),rt([On],"async");let An=0;const Zi={error(e){throw new d(null,e,null)},__awaiter:(e,t,n,r)=>new Promise((a,u)=>{function o(c){try{s(r.next(c))}catch(p){u(p)}}function i(c){try{s(r.throw(c))}catch(p){u(p)}}function s(c){var p;c.done?a(c.value):(p=c.value)!=null&&p.then?c.value.then(o,i):(An++,An%100==0?setTimeout(()=>{An=0,o(c.value)},0):o(c.value))}s((r=r.apply(e,t||[])).next())}),functionDepthchecker:(e,t)=>function(){if(t.depthCounter.depth++,t.localStack.push([]),t.depthCounter.depth>64)throw new d(null,l.MaximumCallDepth,null);const n=e.apply(this,arguments);return qe(n)?n.then(r=>(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,r)):(t.depthCounter.depth--,t.localStack.length=t.localStack.length-1,n)},chkAssig(e,t){if(t.gdefs[e]===void 0)throw new d(t,l.InvalidIdentifier,null);return e},mustBoolean(e,t){if(e===!0||e===!1)return e;throw new d(t,l.BooleanConditionRequired,null)},setAssig:(e,t)=>(t.gdefs[e]=1,e),castString:e=>w(e),aCheck(e,t){if(X(e))throw t==="ArrayExpression"?new d(null,l.NoFunctionInArray,null):t==="ObjectExpression"?new d(null,l.NoFunctionInDictionary,null):new d(null,l.NoFunctionInTemplateLiteral,null);return e===A?null:e},Dictionary:k,Feature:Q,UserDefinedCompiledFunction:No,dictionary(e){const t={},n=new Map;for(let a=0;a>":case">>>":case"^":case"&":return ir(h(e),h(t),n);case"==":case"=":return Ee(e,t);case"!=":return!Ee(e,t);case"<":case">":case"<=":case">=":return rr(e,t,n);case"+":return C(e)||C(t)?w(e)+w(t):h(e)+h(t);case"-":return h(e)-h(t);case"*":return h(e)*h(t);case"/":return h(e)/h(t);case"%":return h(e)%h(t);default:throw new d(null,l.UnsupportedOperator,null)}},assign(e,t,n){switch(t){case"=":return e===A?null:e;case"/=":return h(n)/h(e);case"*=":return h(n)*h(e);case"-=":return h(n)-h(e);case"+=":return C(n)||C(e)?w(n)+w(e):h(n)+h(e);case"%=":return h(n)%h(e);default:throw new d(null,l.UnsupportedOperator,null)}},update(e,t,n,r){const a=h(e[t]);return e[t]=n==="++"?a+1:a-1,r===!1?a:n==="++"?a+1:a-1},graphicToFeature:(e,t,n)=>e===null?null:Q.createFromGraphicLikeObject(e.geometry,e.attributes,t,n.timeZone),memberupdate(e,t,n,r){let a;if(T(e)){if(!q(t))throw new d(null,l.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>=e.length)throw new d(null,l.OutOfBounds,null);a=h(e[t]),e[t]=n==="++"?a+1:a-1}else if(e instanceof k){if(C(t)===!1)throw new d(null,l.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new d(null,l.FieldNotFound,null,{key:t});a=h(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else if(ee(e)){if(C(t)===!1)throw new d(null,l.KeyAccessorMustBeString,null);if(e.hasField(t)!==!0)throw new d(null,l.FieldNotFound,null);a=h(e.field(t)),e.setField(t,n==="++"?a+1:a-1)}else{if(R(e))throw new d(null,l.Immutable,null);if(!(e instanceof It))throw new d(null,l.InvalidIdentifier,null);if(C(t)===!1)throw new d(null,l.ModuleAccessorMustBeString,null);if(e.hasGlobal(t)!==!0)throw new d(null,l.ModuleExportNotFound,null);a=h(e.global(t)),e.setGlobal(t,n==="++"?a+1:a-1)}return r===!1?a:n==="++"?a+1:a-1},assignmember(e,t,n,r){if(T(e)){if(!q(t))throw new d(null,l.ArrayAccessorMustBeNumber,null);if(t<0&&(t=e.length+t),t<0||t>e.length)throw new d(null,l.OutOfBounds,null);if(t===e.length){if(n!=="=")throw new d(null,l.OutOfBounds,null);e[t]=this.assign(r,n,e[t])}else e[t]=this.assign(r,n,e[t])}else if(e instanceof k){if(C(t)===!1)throw new d(null,l.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new d(null,l.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else if(ee(e)){if(C(t)===!1)throw new d(null,l.KeyAccessorMustBeString,null);if(e.hasField(t)===!0)e.setField(t,this.assign(r,n,e.field(t)));else{if(n!=="=")throw new d(null,l.FieldNotFound,null);e.setField(t,this.assign(r,n,null))}}else{if(R(e))throw new d(null,l.Immutable,null);if(!(e instanceof It))throw new d(null,l.InvalidIdentifier,null);if(C(t)===!1)throw new d(null,l.ModuleAccessorMustBeString,null);if(!e.hasGlobal(t))throw new d(null,l.ModuleExportNotFound,null);e.setGlobal(t,this.assign(r,n,e.global(t)))}},member(e,t){if(e===null)throw new d(null,l.MemberOfNull,null);if(e instanceof k||ee(e)){if(C(t))return e.field(t);throw new d(null,l.InvalidMemberAccessKey,null)}if(e instanceof B){if(C(t))return $t(e,t,null,null);throw new d(null,l.InvalidMemberAccessKey,null)}if(T(e)){if(q(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new d(null,l.OutOfBounds,null);return e[t]}throw new d(null,l.InvalidMemberAccessKey,null)}if(C(e)){if(q(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length+t),t>=e.length||t<0)throw new d(null,l.OutOfBounds,null);return e[t]}throw new d(null,l.InvalidMemberAccessKey,null)}if(R(e)){if(q(t)&&isFinite(t)&&Math.floor(t)===t){if(t<0&&(t=e.length()+t),t>=e.length()||t<0)throw new d(null,l.OutOfBounds,null);return e.get(t)}throw new d(null,l.InvalidMemberAccessKey,null)}if(e instanceof It){if(C(t))return e.global(t);throw new d(null,l.InvalidMemberAccessKey,null)}throw new d(null,l.InvalidMemberAccessKey,null)},callfunc:(e,t,n)=>e.call(n,{arguments:t,preparsed:!0}),loadModule(e,t){const n=t.moduleFactoryMap[e];if(t.moduleSingletons[n])return t.moduleSingletons[n];const r=t.moduleFactory[n]({vars:{},moduleSingletons:t.moduleSingletons,depthCounter:t.depthCounter,console:t.console,abortSignal:t.abortSignal,isAsync:t.isAsync,services:t.services,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor},t.spatialReference);return t.moduleSingletons[n]=r,r},callModuleFunction(e,t,n,r){if(!(e instanceof It))throw new d(null,l.FunctionNotFound,null);const a=e.global(n);if(X(a)===!1)throw new d(null,l.CallNonFunction,null);return a.call(r,{preparsed:!0,arguments:t})}};function tn(e){console.log(e)}function Ji(e,t,n=!1){t===null&&(t={vars:{},customfunctions:{}});let r=null;e.usesModules&&(r=new an(null,e.loadedModules));const a={isAsync:n,globalScope:zi(t.vars,n?Dt:ne,t.customfunctions),moduleFactory:{},moduleFactoryMap:{},undeclaredGlobalsInFunctions:new Map,customfunctions:t.customfunctions,libraryResolver:r,localScope:null,mangleMap:{},depthCounter:{depth:1},exports:{},console:tn,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let u=S(a,e);u===""&&(u="lc.voidOperation; "),a.undeclaredGlobalsInFunctions.size>0&&a.undeclaredGlobalsInFunctions.forEach(m=>{throw new le(t,l.InvalidIdentifier,m.node)});let o="";o=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+u+` + return lastStatement; }); } + return this.postProcess(yield mainBody()); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+u+` + return lastStatement; } + return this.postProcess(mainBody()); `;const i=a.moduleFactory,s=a.moduleFactoryMap,c=a.exports,p={};for(const m in c)p[m]=a.mangleMap[m]!==void 0?a.mangleMap[m]:m;const f={lc:Ai,lang:Zi,mangles:a.mangleMap,postProcess(m){if(m instanceof ye&&(m=m.value),m instanceof ft&&(m=m.value),m===A&&(m=null),m===Ie)throw new d(null,l.IllegalResult,null);if(m===wt)throw new d(null,l.IllegalResult,null);if(X(m))throw new d(null,l.IllegalResult,null);return m},prepare(m,g){let x=m.spatialReference;x==null&&(x=yt.WebMercator);const M=Gi(m.vars,m.customfunctions,g,m.timeZone);return{localStack:[],isAsync:g,moduleFactory:i,moduleFactoryMap:s,mangleMap:this.mangles,moduleSingletons:{},exports:c,gdefs:{},exportmangle:p,spatialReference:x,globalScope:M,abortSignal:m.abortSignal===void 0||m.abortSignal===null?{aborted:!1}:m.abortSignal,localScope:null,services:m.services,console:m.console??tn,lrucache:m.lrucache,timeZone:m.timeZone??null,interceptor:m.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(f)}async function au(){return rt([await Ve(()=>import("./geomasync-_hAyjeTi.js"),__vite__mapDeps([0,1,2,3,4,5,6]))],"async"),!0}class It extends Pt{constructor(t){super(null),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(X(n))throw new d(null,l.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope;t=t.toLowerCase();const r=n[this.moduleContext.exportmangle[t]];if(r===void 0)throw new d(null,l.InvalidIdentifier,null);if(X(r)&&!(r instanceof ze)){const a=new ze;return a.fn=r,a.parameterEvaluator=Ae,a.context=this.moduleContext,n[this.moduleContext.exportmangle[t]]=a,a}return r}}function ou(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new an(null,e.loadedModules),globalScope:zi(t.vars,n?Dt:ne,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:tn,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=S(r,e);a===""&&(a="lc.voidOperation; ");let u="";u=n?`var runtimeCtx=this.prepare(context, true); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; +return lang.__awaiter(this, void 0, void 0, function* () { + + function mainBody() { + var lastStatement=lc.voidOperation; + return lang.__awaiter(this, void 0, void 0, function* () { +`+a+` + return lastStatement; }); } + yield mainBody(); + return this.prepareModule(runtimeCtx); }); `:`var runtimeCtx=this.prepare(context, false); + var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; + function mainBody() { + var lastStatement=lc.voidOperation; + `+a+` + return lastStatement; } + mainBody(); + return this.prepareModule(runtimeCtx); `;const o=r.moduleFactory,i=r.moduleFactoryMap,s=r.exports,c={};for(const f in s)c[f]=r.mangleMap[f]!==void 0?r.mangleMap[f]:f;const p={lc:Ai,lang:Zi,mangles:r.mangleMap,prepareModule:f=>new It(f),prepare(f,m){let g=f.spatialReference;g==null&&(g=new yt({wkid:102100}));const x=Gi(f.vars,f.customfunctions,m,f.timeZone);return{localStack:[],isAsync:m,exports:s,exportmangle:c,gdefs:{},moduleFactory:o,moduleFactoryMap:i,moduleSingletons:f.moduleSingletons,mangleMap:this.mangles,spatialReference:g,globalScope:x,abortSignal:f.abortSignal===void 0||f.abortSignal===null?{aborted:!1}:f.abortSignal,localScope:null,services:f.services,console:f.console??tn,lrucache:f.lrucache,timeZone:f.timeZone??null,interceptor:f.interceptor,symbols:{symbolCounter:0},depthCounter:f.depthCounter}}};return new Function("context","spatialReference",u).bind(p)}var L,b;(function(e){e.Break="break",e.Continue="continue",e.Else="else",e.False="false",e.For="for",e.From="from",e.Function="function",e.If="if",e.Import="import",e.Export="export",e.In="in",e.Null="null",e.Return="return",e.True="true",e.Var="var",e.While="while"})(L||(L={})),function(e){e.AssignmentExpression="AssignmentExpression",e.ArrayExpression="ArrayExpression",e.BlockComment="BlockComment",e.BlockStatement="BlockStatement",e.BinaryExpression="BinaryExpression",e.BreakStatement="BreakStatement",e.CallExpression="CallExpression",e.ContinueStatement="ContinueStatement",e.EmptyStatement="EmptyStatement",e.ExpressionStatement="ExpressionStatement",e.ExportNamedDeclaration="ExportNamedDeclaration",e.ExportSpecifier="ExportSpecifier",e.ForStatement="ForStatement",e.ForInStatement="ForInStatement",e.FunctionDeclaration="FunctionDeclaration",e.Identifier="Identifier",e.IfStatement="IfStatement",e.ImportDeclaration="ImportDeclaration",e.ImportDefaultSpecifier="ImportDefaultSpecifier",e.LineComment="LineComment",e.Literal="Literal",e.LogicalExpression="LogicalExpression",e.MemberExpression="MemberExpression",e.ObjectExpression="ObjectExpression",e.Program="Program",e.Property="Property",e.ReturnStatement="ReturnStatement",e.TemplateElement="TemplateElement",e.TemplateLiteral="TemplateLiteral",e.UnaryExpression="UnaryExpression",e.UpdateExpression="UpdateExpression",e.VariableDeclaration="VariableDeclaration",e.VariableDeclarator="VariableDeclarator",e.WhileStatement="WhileStatement"}(b||(b={}));const Jn=["++","--"],qi=["-","+","!","~"],Vi=["=","/=","*=","%=","+=","-="],ji=["||","&&"],uu=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"],su={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10};var E;(function(e){e[e.Unknown=0]="Unknown",e[e.BooleanLiteral=1]="BooleanLiteral",e[e.EOF=2]="EOF",e[e.Identifier=3]="Identifier",e[e.Keyword=4]="Keyword",e[e.NullLiteral=5]="NullLiteral",e[e.NumericLiteral=6]="NumericLiteral",e[e.Punctuator=7]="Punctuator",e[e.StringLiteral=8]="StringLiteral",e[e.Template=10]="Template"})(E||(E={}));const lu=["Unknown","Boolean","","Identifier","Keyword","Null","Numeric","Punctuator","String","RegularExpression","Template"];var F;(function(e){e.InvalidModuleUri="InvalidModuleUri",e.ForInOfLoopInitializer="ForInOfLoopInitializer",e.IdentiferExpected="IdentiferExpected",e.InvalidEscapedReservedWord="InvalidEscapedReservedWord",e.InvalidExpression="InvalidExpression",e.InvalidFunctionIdentifier="InvalidFunctionIdentifier",e.InvalidHexEscapeSequence="InvalidHexEscapeSequence",e.InvalidLeftHandSideInAssignment="InvalidLeftHandSideInAssignment",e.InvalidLeftHandSideInForIn="InvalidLeftHandSideInForIn",e.InvalidTemplateHead="InvalidTemplateHead",e.InvalidVariableAssignment="InvalidVariableAssignment",e.KeyMustBeString="KeyMustBeString",e.NoFunctionInsideBlock="NoFunctionInsideBlock",e.NoFunctionInsideFunction="NoFunctionInsideFunction",e.ModuleExportRootOnly="ModuleExportRootOnly",e.ModuleImportRootOnly="ModuleImportRootOnly",e.PunctuatorExpected="PunctuatorExpected",e.TemplateOctalLiteral="TemplateOctalLiteral",e.UnexpectedBoolean="UnexpectedBoolean",e.UnexpectedEndOfScript="UnexpectedEndOfScript",e.UnexpectedIdentifier="UnexpectedIdentifier",e.UnexpectedKeyword="UnexpectedKeyword",e.UnexpectedNull="UnexpectedNull",e.UnexpectedNumber="UnexpectedNumber",e.UnexpectedPunctuator="UnexpectedPunctuator",e.UnexpectedString="UnexpectedString",e.UnexpectedTemplate="UnexpectedTemplate",e.UnexpectedToken="UnexpectedToken"})(F||(F={}));const cu={[F.InvalidModuleUri]:"Module uri must be a text literal.",[F.ForInOfLoopInitializer]:"for-in loop variable declaration may not have an initializer.",[F.IdentiferExpected]:"'${value}' is an invalid identifier.",[F.InvalidEscapedReservedWord]:"Keyword cannot contain escaped characters.",[F.InvalidExpression]:"Invalid expression.",[F.InvalidFunctionIdentifier]:"'${value}' is an invalid function identifier.",[F.InvalidHexEscapeSequence]:"Invalid hexadecimal escape sequence.",[F.InvalidLeftHandSideInAssignment]:"Invalid left-hand side in assignment.",[F.InvalidLeftHandSideInForIn]:"Invalid left-hand side in for-in.",[F.InvalidTemplateHead]:"Invalid template structure.",[F.InvalidVariableAssignment]:"Invalid variable assignment.",[F.KeyMustBeString]:"Object property keys must be a word starting with a letter.",[F.NoFunctionInsideBlock]:"Functions cannot be declared inside of code blocks.",[F.NoFunctionInsideFunction]:"Functions cannot be declared inside another function.",[F.ModuleExportRootOnly]:"Module exports cannot be declared inside of code blocks.",[F.ModuleImportRootOnly]:"Module import cannot be declared inside of code blocks.",[F.PunctuatorExpected]:"'${value}' expected.",[F.TemplateOctalLiteral]:"Octal literals are not allowed in template literals.",[F.UnexpectedBoolean]:"Unexpected boolean literal.",[F.UnexpectedEndOfScript]:"Unexpected end of Arcade expression.",[F.UnexpectedIdentifier]:"Unexpected identifier.",[F.UnexpectedKeyword]:"Unexpected keyword.",[F.UnexpectedNull]:"Unexpected null literal.",[F.UnexpectedNumber]:"Unexpected number.",[F.UnexpectedPunctuator]:"Unexpected ponctuator.",[F.UnexpectedString]:"Unexpected text literal.",[F.UnexpectedTemplate]:"Unexpected quasi '${value}'.",[F.UnexpectedToken]:"Unexpected token '${value}'."};let Ot=class Hi extends Error{constructor({code:t,index:n,line:r,column:a,len:u=0,description:o,data:i}){var s;super(`${o??t}`),this.declaredRootClass="esri.arcade.lib.parsingerror",this.name="ParsingError",this.code=t,this.index=n,this.line=r,this.column=a,this.len=u,this.data=i,this.description=o,this.range={start:{line:r,column:a-1},end:{line:r,column:a+u}},(s=Error.captureStackTrace)==null||s.call(Error,this,Hi)}};function du(e){return(e==null?void 0:e.type)===b.Program}function Ur(e){return(e==null?void 0:e.type)===b.BlockStatement}function fu(e){return(e==null?void 0:e.type)===b.BlockComment}function hu(e){return(e==null?void 0:e.type)===b.EmptyStatement}function mu(e){return(e==null?void 0:e.type)===b.VariableDeclarator}function bn(e,t){return!!t&&t.loc.end.line===e.loc.start.line&&t.loc.end.column<=e.loc.start.column}function zr(e,t){return e.range[0]>=t.range[0]&&e.range[1]<=t.range[1]}let pu=class{constructor(){this.comments=[],this._nodeStack=[],this._newComments=[]}insertInnerComments(t){if(!Ur(t)||t.body.length!==0)return;const n=[];for(let r=this._newComments.length-1;r>=0;--r){const a=this._newComments[r];t.range[1]>=a.range[0]&&(n.unshift(a),this._newComments.splice(r,1))}n.length&&(t.innerComments=n)}attachTrailingComments(t){if(!t)return;const n=this._nodeStack[this._nodeStack.length-1];if(Ur(t)&&zr(n,t))for(let a=this._newComments.length-1;a>=0;--a){const u=this._newComments[a];zr(u,t)&&(n.trailingComments=[...n.trailingComments??[],u],this._newComments.splice(a,1))}let r=[];if(this._newComments.length>0)for(let a=this._newComments.length-1;a>=0;--a){const u=this._newComments[a];bn(u,n)?(n.trailingComments=[...n.trailingComments??[],u],this._newComments.splice(a,1)):bn(u,t)&&(r.unshift(u),this._newComments.splice(a,1))}n!=null&&n.trailingComments&&bn(n.trailingComments[0],t)&&(r=[...r,...n.trailingComments],delete n.trailingComments),r.length>0&&(t.trailingComments=r)}attachLeadingComments(t){var u,o;if(!t)return;let n;for(;this._nodeStack.length>0;){const i=this._nodeStack[this._nodeStack.length-1];if(!(t.range[0]<=i.range[0]))break;n=i,this._nodeStack.pop()}const r=[],a=[];if(n){for(let i=(((u=n.leadingComments)==null?void 0:u.length)??0)-1;i>=0;--i){const s=n.leadingComments[i];t.range[0]>=s.range[1]?(r.unshift(s),n.leadingComments.splice(i,1)):mu(t)&&!fu(s)&&(a.unshift(s),n.leadingComments.splice(i,1))}return((o=n.leadingComments)==null?void 0:o.length)===0&&delete n.leadingComments,r.length&&(t.leadingComments=r),void(a.length&&(t.trailingComments=[...a,...t.trailingComments??[]]))}for(let i=this._newComments.length-1;i>=0;--i){const s=this._newComments[i];t.range[0]>=s.range[0]&&(r.unshift(s),this._newComments.splice(i,1))}r.length&&(t.leadingComments=r)}attachComments(t){if(du(t)&&t.body.length>0){const n=this._nodeStack[this._nodeStack.length-1];return n?(n.trailingComments=[...n.trailingComments??[],...this._newComments],this._newComments.length=0,void this._nodeStack.pop()):(t.trailingComments=[...this._newComments],void(this._newComments.length=0))}this.attachTrailingComments(t),this.attachLeadingComments(t),this.insertInnerComments(t),this._nodeStack.push(t)}collectComment(t){this.comments.push(t),this._newComments.push(t)}};function qn(e,t){const n=cu[e];return t?n.replaceAll(/\${(.*?)}/g,(r,a)=>{var u;return((u=t[a])==null?void 0:u.toString())??""}):n}let Du=class{constructor(t=!1){this.tolerant=t,this.errors=[]}recordError(t){this.errors.push(t)}tolerate(t){if(!this.tolerant)throw t;this.recordError(t)}throwError(t){throw t.description=t.description??qn(t.code,t.data),new Ot(t)}tolerateError(t){t.description=t.description??qn(t.code,t.data);const n=new Ot(t);if(!this.tolerant)throw n;this.recordError(n)}};function Gr(e,t){if(!e)throw new Error("ASSERT: "+t)}const Zr={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDEC0-\uDEEB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7C6\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB67\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD27\uDD30-\uDD39\uDF00-\uDF1C\uDF27\uDF30-\uDF50\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD46\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E\uDC5F\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCE9\uDCFF\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},G={fromCodePoint:e=>e<65536?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10))+String.fromCharCode(56320+(e-65536&1023)),isWhiteSpace:e=>e===32||e===9||e===11||e===12||e===160||e>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e),isLineTerminator:e=>e===10||e===13||e===8232||e===8233,isIdentifierStart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e===92||e>=128&&Zr.NonAsciiIdentifierStart.test(G.fromCodePoint(e)),isIdentifierPart:e=>e===36||e===95||e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===92||e>=128&&Zr.NonAsciiIdentifierPart.test(G.fromCodePoint(e)),isDecimalDigit:e=>e>=48&&e<=57,isHexDigit:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,isOctalDigit:e=>e>=48&&e<=55};function Jr(e){return"0123456789abcdef".indexOf(e.toLowerCase())}function En(e){return"01234567".indexOf(e)}const Xe=[[],[],[]];Jn.forEach(e=>Xe[e.length-1].push(e)),qi.forEach(e=>Xe[e.length-1].push(e)),ji.forEach(e=>Xe[e.length-1].push(e)),Vi.forEach(e=>Xe[e.length-1].push(e)),uu.forEach(e=>Xe[e.length-1].push(e));let gu=class{constructor(t,n){this.source=t,this.errorHandler=n,this._length=t.length,this.index=0,this.lineNumber=1,this.lineStart=0,this.curlyStack=[]}saveState(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart,curlyStack:this.curlyStack.slice()}}restoreState(t){this.index=t.index,this.lineNumber=t.lineNumber,this.lineStart=t.lineStart,this.curlyStack=t.curlyStack}eof(){return this.index>=this._length}throwUnexpectedToken(t=F.UnexpectedToken){this.errorHandler.throwError({code:t,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}tolerateUnexpectedToken(t=F.UnexpectedToken){this.errorHandler.tolerateError({code:t,index:this.index,line:this.lineNumber,column:this.index-this.lineStart+1})}skipSingleLineComment(t){const n=[],r=this.index-t,a={start:{line:this.lineNumber,column:this.index-this.lineStart-t},end:{line:0,column:0}};for(;!this.eof();){const u=this.source.charCodeAt(this.index);if(++this.index,G.isLineTerminator(u)){if(a){a.end={line:this.lineNumber,column:this.index-this.lineStart-1};const o={multiLine:!1,start:r+t,end:this.index-1,range:[r,this.index-1],loc:a};n.push(o)}return u===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,n}}if(a){a.end={line:this.lineNumber,column:this.index-this.lineStart};const u={multiLine:!1,start:r+t,end:this.index,range:[r,this.index],loc:a};n.push(u)}return n}skipMultiLineComment(){const t=[],n=this.index-2,r={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{line:0,column:0}};for(;!this.eof();){const a=this.source.charCodeAt(this.index);if(G.isLineTerminator(a))a===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(a===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const u={multiLine:!0,start:n+2,end:this.index-2,range:[n,this.index],loc:r};t.push(u)}return t}++this.index}else++this.index}if(r){r.end={line:this.lineNumber,column:this.index-this.lineStart};const a={multiLine:!0,start:n+2,end:this.index,range:[n,this.index],loc:r};t.push(a)}return this.tolerateUnexpectedToken(),t}scanComments(){let t=[];for(;!this.eof();){let n=this.source.charCodeAt(this.index);if(G.isWhiteSpace(n))++this.index;else if(G.isLineTerminator(n))++this.index,n===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index;else{if(n!==47)break;if(n=this.source.charCodeAt(this.index+1),n===47){this.index+=2;const r=this.skipSingleLineComment(2);t=[...t,...r]}else{if(n!==42)break;{this.index+=2;const r=this.skipMultiLineComment();t=[...t,...r]}}}}return t}isKeyword(t){switch((t=t.toLowerCase()).length){case 2:return t===L.If||t===L.In;case 3:return t===L.Var||t===L.For;case 4:return t===L.Else;case 5:return t===L.Break||t===L.While;case 6:return t===L.Return||t===L.Import||t===L.Export;case 8:return t===L.Function||t===L.Continue;default:return!1}}codePointAt(t){let n=this.source.charCodeAt(t);if(n>=55296&&n<=56319){const r=this.source.charCodeAt(t+1);r>=56320&&r<=57343&&(n=1024*(n-55296)+r-56320+65536)}return n}scanHexEscape(t){const n=t==="u"?4:2;let r=0;for(let a=0;a1114111||t!=="}")&&this.throwUnexpectedToken(),G.fromCodePoint(n)}getIdentifier(){const t=this.index++;for(;!this.eof();){const n=this.source.charCodeAt(this.index);if(n===92)return this.index=t,this.getComplexIdentifier();if(n>=55296&&n<57343)return this.index=t,this.getComplexIdentifier();if(!G.isIdentifierPart(n))break;++this.index}return this.source.slice(t,this.index)}getComplexIdentifier(){let t,n=this.codePointAt(this.index),r=G.fromCodePoint(n);for(this.index+=r.length,n===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,t=this.scanUnicodeCodePointEscape()):(t=this.scanHexEscape("u"),t!==null&&t!=="\\"&&G.isIdentifierStart(t.charCodeAt(0))||this.throwUnexpectedToken()),r=t);!this.eof()&&(n=this.codePointAt(this.index),G.isIdentifierPart(n));)t=G.fromCodePoint(n),r+=t,this.index+=t.length,n===92&&(r=r.substring(0,r.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,t=this.scanUnicodeCodePointEscape()):(t=this.scanHexEscape("u"),t!==null&&t!=="\\"&&G.isIdentifierPart(t.charCodeAt(0))||this.throwUnexpectedToken()),r+=t);return r}octalToDecimal(t){let n=t!=="0",r=En(t);return!this.eof()&&G.isOctalDigit(this.source.charCodeAt(this.index))&&(n=!0,r=8*r+En(this.source[this.index++]),"0123".includes(t)&&!this.eof()&&G.isOctalDigit(this.source.charCodeAt(this.index))&&(r=8*r+En(this.source[this.index++]))),{code:r,octal:n}}scanIdentifier(){let t;const n=this.index,r=this.source.charCodeAt(n)===92?this.getComplexIdentifier():this.getIdentifier();if(t=r.length===1?E.Identifier:this.isKeyword(r)?E.Keyword:r.toLowerCase()===L.Null?E.NullLiteral:r.toLowerCase()===L.True||r.toLowerCase()===L.False?E.BooleanLiteral:E.Identifier,t!==E.Identifier&&n+r.length!==this.index){const a=this.index;this.index=n,this.tolerateUnexpectedToken(F.InvalidEscapedReservedWord),this.index=a}return{type:t,value:r,lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}scanPunctuator(){const t=this.index;let n=this.source[this.index];switch(n){case"(":case"{":n==="{"&&this.curlyStack.push("{"),++this.index;break;case".":case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;case"}":++this.index,this.curlyStack.pop();break;default:for(let r=Xe.length;r>0;r--)if(n=this.source.substring(this.index,this.index+r),Xe[r-1].includes(n)){this.index+=r;break}}return this.index===t&&this.throwUnexpectedToken(),{type:E.Punctuator,value:n,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanHexLiteral(t){let n="";for(;!this.eof()&&G.isHexDigit(this.source.charCodeAt(this.index));)n+=this.source[this.index++];return n.length===0&&this.throwUnexpectedToken(),G.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:E.NumericLiteral,value:parseInt("0x"+n,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanBinaryLiteral(t){let n="";for(;!this.eof();){const r=this.source[this.index];if(r!=="0"&&r!=="1")break;n+=this.source[this.index++]}if(n.length===0&&this.throwUnexpectedToken(),!this.eof()){const r=this.source.charCodeAt(this.index);(G.isIdentifierStart(r)||G.isDecimalDigit(r))&&this.throwUnexpectedToken()}return{type:E.NumericLiteral,value:parseInt(n,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanOctalLiteral(t,n){let r="",a=!1;for(G.isOctalDigit(t.charCodeAt(0))?(a=!0,r="0"+this.source[this.index++]):++this.index;!this.eof()&&G.isOctalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];return a||r.length!==0||this.throwUnexpectedToken(),(G.isIdentifierStart(this.source.charCodeAt(this.index))||G.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:E.NumericLiteral,value:parseInt(r,8),lineNumber:this.lineNumber,lineStart:this.lineStart,start:n,end:this.index}}scanNumericLiteral(){const t=this.index;let n=this.source[t];Gr(G.isDecimalDigit(n.charCodeAt(0))||n===".","Numeric literal must start with a decimal digit or a decimal point");let r="";if(n!=="."){if(r=this.source[this.index++],n=this.source[this.index],r==="0"){if(n==="x"||n==="X")return++this.index,this.scanHexLiteral(t);if(n==="b"||n==="B")return++this.index,this.scanBinaryLiteral(t);if(n==="o"||n==="O")return this.scanOctalLiteral(n,t)}for(;G.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if(n==="."){for(r+=this.source[this.index++];G.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];n=this.source[this.index]}if(n==="e"||n==="E")if(r+=this.source[this.index++],n=this.source[this.index],n!=="+"&&n!=="-"||(r+=this.source[this.index++]),G.isDecimalDigit(this.source.charCodeAt(this.index)))for(;G.isDecimalDigit(this.source.charCodeAt(this.index));)r+=this.source[this.index++];else this.throwUnexpectedToken();return G.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:E.NumericLiteral,value:parseFloat(r),lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanStringLiteral(){const t=this.index;let n=this.source[t];Gr(n==="'"||n==='"',"String literal must starts with a quote"),++this.index;let r=!1,a="";for(;!this.eof();){let u=this.source[this.index++];if(u===n){n="";break}if(u==="\\")if(u=this.source[this.index++],u&&G.isLineTerminator(u.charCodeAt(0)))++this.lineNumber,u==="\r"&&this.source[this.index]===` +`&&++this.index,this.lineStart=this.index;else switch(u){case"u":if(this.source[this.index]==="{")++this.index,a+=this.scanUnicodeCodePointEscape();else{const o=this.scanHexEscape(u);o===null&&this.throwUnexpectedToken(),a+=o}break;case"x":{const o=this.scanHexEscape(u);o===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),a+=o;break}case"n":a+=` +`;break;case"r":a+="\r";break;case"t":a+=" ";break;case"b":a+="\b";break;case"f":a+="\f";break;case"v":a+="\v";break;case"8":case"9":a+=u,this.tolerateUnexpectedToken();break;default:if(u&&G.isOctalDigit(u.charCodeAt(0))){const o=this.octalToDecimal(u);r=o.octal||r,a+=String.fromCharCode(o.code)}else a+=u}else{if(G.isLineTerminator(u.charCodeAt(0)))break;a+=u}}return n!==""&&(this.index=t,this.throwUnexpectedToken()),{type:E.StringLiteral,value:a,lineNumber:this.lineNumber,lineStart:this.lineStart,start:t,end:this.index}}scanTemplate(){let t="",n=!1;const r=this.index,a=this.source[r]==="`";let u=!1,o=2;for(++this.index;!this.eof();){let i=this.source[this.index++];if(i==="`"){o=1,u=!0,n=!0;break}if(i!=="$")if(i!=="\\")G.isLineTerminator(i.charCodeAt(0))?(++this.lineNumber,i==="\r"&&this.source[this.index]===` +`&&++this.index,this.lineStart=this.index,t+=` +`):t+=i;else if(i=this.source[this.index++],G.isLineTerminator(i.charCodeAt(0)))++this.lineNumber,i==="\r"&&this.source[this.index]===` +`&&++this.index,this.lineStart=this.index;else switch(i){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,t+=this.scanUnicodeCodePointEscape();else{const s=this.index,c=this.scanHexEscape(i);c!==null?t+=c:(this.index=s,t+=i)}break;case"x":{const s=this.scanHexEscape(i);s===null&&this.throwUnexpectedToken(F.InvalidHexEscapeSequence),t+=s;break}case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:i==="0"?(G.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(F.TemplateOctalLiteral),t+="\0"):G.isOctalDigit(i.charCodeAt(0))?this.throwUnexpectedToken(F.TemplateOctalLiteral):t+=i}else{if(this.source[this.index]==="{"){this.curlyStack.push("${"),++this.index,n=!0;break}t+=i}}return n||this.throwUnexpectedToken(),a||this.curlyStack.pop(),{type:E.Template,value:this.source.slice(r+1,this.index-o),cooked:t,head:a,tail:u,lineNumber:this.lineNumber,lineStart:this.lineStart,start:r,end:this.index}}lex(){if(this.eof())return{type:E.EOF,value:"",lineNumber:this.lineNumber,lineStart:this.lineStart,start:this.index,end:this.index};const t=this.source.charCodeAt(this.index);return G.isIdentifierStart(t)?this.scanIdentifier():t===40||t===41||t===59?this.scanPunctuator():t===39||t===34?this.scanStringLiteral():t===46?G.isDecimalDigit(this.source.charCodeAt(this.index+1))?this.scanNumericLiteral():this.scanPunctuator():G.isDecimalDigit(t)?this.scanNumericLiteral():t===96||t===125&&this.curlyStack[this.curlyStack.length-1]==="${"?this.scanTemplate():t>=55296&&t<57343&&G.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()}};var ce,Nt;function qr(e,t=0){let n=e.start-e.lineStart,r=e.lineNumber;return n<0&&(n+=t,r--),{index:e.start,line:r,column:n}}function Vr(e){return[{index:e.range[0],...e.loc.start},{index:e.range[1],...e.loc.end}]}function jr(e){return su[e]??0}(function(e){e[e.None=0]="None",e[e.Function=1]="Function",e[e.IfClause=2]="IfClause",e[e.ForLoop=4]="ForLoop",e[e.WhileLoop=8]="WhileLoop"})(ce||(ce={})),function(e){e[e.AsObject=0]="AsObject",e[e.Automatic=1]="Automatic"}(Nt||(Nt={}));class yu{constructor(t,n={},r){this.delegate=r,this.hasLineTerminator=!1,this.options={tokens:typeof n.tokens=="boolean"&&n.tokens,comments:typeof n.comments=="boolean"&&n.comments,tolerant:typeof n.tolerant=="boolean"&&n.tolerant},this.options.comments&&(this.commentHandler=new pu),this.errorHandler=new Du(this.options.tolerant),this.scanner=new gu(t,this.errorHandler),this.context={isAssignmentTarget:!1,blockContext:ce.None,curlyParsingType:Nt.AsObject},this.rawToken={type:E.EOF,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.endMarker={index:0,line:this.scanner.lineNumber,column:0},this.readNextRawToken(),this.endMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}throwIfInvalidType(t,n,{validTypes:r,invalidTypes:a}){r!=null&&r.some(u=>t.type===u)||a!=null&&a.some(u=>t.type===u)&&this.throwError(F.InvalidExpression,n)}throwError(t,n,r=this.endMarker){const{index:a,line:u,column:o}=n,i=r.index-a-1;this.errorHandler.throwError({code:t,index:a,line:u,column:o+1,len:i})}tolerateError(t,n){throw new Error("######################################### !!!")}unexpectedTokenError(t={}){const{rawToken:n}=t;let r,{code:a,data:u}=t;if(n){if(!a)switch(n.type){case E.EOF:a=F.UnexpectedEndOfScript;break;case E.Identifier:a=F.UnexpectedIdentifier;break;case E.NumericLiteral:a=F.UnexpectedNumber;break;case E.StringLiteral:a=F.UnexpectedString;break;case E.Template:a=F.UnexpectedTemplate}r=n.value.toString()}else r="ILLEGAL";a=a??F.UnexpectedToken,u||(u={value:r});const o=qn(a,u);if(n){const c=n.start,p=n.lineNumber,f=n.start-n.lineStart+1;return new Ot({code:a,index:c,line:p,column:f,len:n.end-n.start-1,data:u,description:o})}const{index:i,line:s}=this.endMarker;return new Ot({code:a,index:i,line:s,column:this.endMarker.column+1,data:u,description:o})}throwUnexpectedToken(t={}){throw t.rawToken=t.rawToken??this.rawToken,this.unexpectedTokenError(t)}collectComments(t){const{commentHandler:n}=this;n&&t.length&&t.forEach(r=>{const a={type:r.multiLine?b.BlockComment:b.LineComment,value:this.getSourceValue(r),range:r.range,loc:r.loc};n.collectComment(a)})}peekAhead(t){const n=()=>(this.scanner.scanComments(),this.scanner.lex()),r=this.scanner.saveState(),a=t.call(this,n);return this.scanner.restoreState(r),a}getSourceValue(t){return this.scanner.source.slice(t.start,t.end)}convertToToken(t){return{type:lu[t.type],value:this.getSourceValue(t),range:[t.start,t.end],loc:{start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}}}readNextRawToken(){this.endMarker.index=this.scanner.index,this.endMarker.line=this.scanner.lineNumber,this.endMarker.column=this.scanner.index-this.scanner.lineStart;const t=this.rawToken;this.collectComments(this.scanner.scanComments()),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart),this.rawToken=this.scanner.lex(),this.hasLineTerminator=t.lineNumber!==this.rawToken.lineNumber,this.options.tokens&&this.rawToken.type!==E.EOF&&this.tokens.push(this.convertToToken(this.rawToken))}captureStartMarker(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}}getItemLocation(t){return{range:[t.index,this.endMarker.index],loc:{start:{line:t.line,column:t.column},end:{line:this.endMarker.line,column:this.endMarker.column}}}}finalize(t){var n,r;return(this.delegate||this.commentHandler)&&((n=this.commentHandler)==null||n.attachComments(t),(r=this.delegate)==null||r.call(this,t)),t}expectPunctuator(t){const n=this.rawToken;this.matchPunctuator(t)?this.readNextRawToken():this.throwUnexpectedToken({rawToken:n,code:F.PunctuatorExpected,data:{value:t}})}expectKeyword(t){this.rawToken.type!==E.Keyword||this.rawToken.value.toLowerCase()!==t?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}expectContextualKeyword(t){this.rawToken.type!==E.Identifier||this.rawToken.value.toLowerCase()!==t?this.throwUnexpectedToken({rawToken:this.rawToken}):this.readNextRawToken()}matchKeyword(t){return this.rawToken.type===E.Keyword&&this.rawToken.value.toLowerCase()===t}matchContextualKeyword(t){return this.rawToken.type===E.Identifier&&this.rawToken.value===t}matchPunctuator(t){return this.rawToken.type===E.Punctuator&&this.rawToken.value===t}getMatchingPunctuator(t){if(typeof t=="string"&&(t=t.split("")),this.rawToken.type===E.Punctuator&&(t==null?void 0:t.length))return t.find(this.matchPunctuator,this)}isolateCoverGrammar(t){const n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=t.call(this);return this.context.isAssignmentTarget=n,r}inheritCoverGrammar(t){const n=this.context.isAssignmentTarget;this.context.isAssignmentTarget=!0;const r=t.call(this);return this.context.isAssignmentTarget=this.context.isAssignmentTarget&&n,r}withBlockContext(t,n){const r=this.context.blockContext;this.context.blockContext=this.context.blockContext|t;const a=this.context.curlyParsingType;this.context.curlyParsingType=Nt.Automatic;const u=n.call(this);return this.context.blockContext=r,this.context.curlyParsingType=a,u}consumeSemicolon(){if(this.matchPunctuator(";"))this.readNextRawToken();else if(!this.hasLineTerminator)return this.rawToken.type===E.EOF||this.matchPunctuator("}")?(this.endMarker.index=this.startMarker.index,this.endMarker.line=this.startMarker.line,void(this.endMarker.column=this.startMarker.column)):void this.throwUnexpectedToken({rawToken:this.rawToken})}parsePrimaryExpression(){const t=this.captureStartMarker(),n=this.rawToken;switch(n.type){case E.Identifier:return this.readNextRawToken(),this.finalize({type:b.Identifier,name:n.value,...this.getItemLocation(t)});case E.NumericLiteral:case E.StringLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:b.Literal,value:n.value,raw:this.getSourceValue(n),isString:typeof n.value=="string",...this.getItemLocation(t)});case E.BooleanLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:b.Literal,value:n.value.toLowerCase()===L.True,raw:this.getSourceValue(n),isString:!1,...this.getItemLocation(t)});case E.NullLiteral:return this.context.isAssignmentTarget=!1,this.readNextRawToken(),this.finalize({type:b.Literal,value:null,raw:this.getSourceValue(n),isString:!1,...this.getItemLocation(t)});case E.Template:return this.parseTemplateLiteral();case E.Punctuator:switch(n.value){case"(":return this.inheritCoverGrammar(this.parseGroupExpression);case"[":return this.inheritCoverGrammar(this.parseArrayInitializer);case"{":return this.inheritCoverGrammar(this.parseObjectExpression);default:return this.throwUnexpectedToken({rawToken:this.rawToken})}case E.Keyword:return this.context.isAssignmentTarget=!1,this.throwUnexpectedToken({rawToken:this.rawToken});default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseArrayInitializer(){const t=this.captureStartMarker();this.expectPunctuator("[");const n=[];for(;!this.matchPunctuator("]");){const r=this.captureStartMarker();this.matchPunctuator(",")?(this.readNextRawToken(),this.throwError(F.InvalidExpression,r)):(n.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.matchPunctuator("]")||this.expectPunctuator(","))}return this.expectPunctuator("]"),this.finalize({type:b.ArrayExpression,elements:n,...this.getItemLocation(t)})}parseObjectPropertyKey(){const t=this.captureStartMarker(),n=this.rawToken;switch(n.type){case E.StringLiteral:return this.readNextRawToken(),this.finalize({type:b.Literal,value:n.value,raw:this.getSourceValue(n),isString:!0,...this.getItemLocation(t)});case E.Identifier:case E.BooleanLiteral:case E.NullLiteral:case E.Keyword:return this.readNextRawToken(),this.finalize({type:b.Identifier,name:n.value,...this.getItemLocation(t)});default:this.throwError(F.KeyMustBeString,t)}}parseObjectProperty(){const t=this.rawToken,n=this.captureStartMarker(),r=this.parseObjectPropertyKey();let a=!1,u=null;return this.matchPunctuator(":")?(this.readNextRawToken(),u=this.inheritCoverGrammar(this.parseAssignmentExpression)):t.type===E.Identifier?(a=!0,u=this.finalize({type:b.Identifier,name:t.value,...this.getItemLocation(n)})):this.throwUnexpectedToken({rawToken:this.rawToken}),this.finalize({type:b.Property,kind:"init",key:r,value:u,shorthand:a,...this.getItemLocation(n)})}parseObjectExpression(){const t=this.captureStartMarker();this.expectPunctuator("{");const n=[];for(;!this.matchPunctuator("}");)n.push(this.parseObjectProperty()),this.matchPunctuator("}")||this.expectPunctuator(",");return this.expectPunctuator("}"),this.finalize({type:b.ObjectExpression,properties:n,...this.getItemLocation(t)})}parseTemplateElement(t=!1){const n=this.rawToken;n.type!==E.Template&&this.throwUnexpectedToken({rawToken:n}),t&&!n.head&&this.throwUnexpectedToken({code:F.InvalidTemplateHead,rawToken:n});const r=this.captureStartMarker();this.readNextRawToken();const{value:a,cooked:u,tail:o}=n,i=this.finalize({type:b.TemplateElement,value:{raw:a,cooked:u},tail:o,...this.getItemLocation(r)});return i.loc.start.column++,i.loc.end.column=i.loc.end.column-(o?1:2),i}parseTemplateLiteral(){const t=this.captureStartMarker(),n=[],r=[];let a=this.parseTemplateElement(!0);for(r.push(a);!a.tail;)n.push(this.parseExpression()),a=this.parseTemplateElement(),r.push(a);return this.finalize({type:b.TemplateLiteral,quasis:r,expressions:n,...this.getItemLocation(t)})}parseGroupExpression(){this.expectPunctuator("(");const t=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.expectPunctuator(")"),t}parseArguments(){this.expectPunctuator("(");const t=[];if(!this.matchPunctuator(")"))for(;;){const n=this.isolateCoverGrammar(this.parseAssignmentExpression);if(t.push(n),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),t}parseMemberName(){const t=this.rawToken,n=this.captureStartMarker();return this.readNextRawToken(),t.type!==E.NullLiteral&&t.type!==E.Identifier&&t.type!==E.Keyword&&t.type!==E.BooleanLiteral&&this.throwUnexpectedToken({rawToken:t}),this.finalize({type:b.Identifier,name:t.value,...this.getItemLocation(n)})}parseLeftHandSideExpression(){const t=this.captureStartMarker();let n=this.inheritCoverGrammar(this.parsePrimaryExpression);const r=this.captureStartMarker();let a;for(;a=this.getMatchingPunctuator("([.");)switch(a){case"(":{this.context.isAssignmentTarget=!1,n.type!==b.Identifier&&n.type!==b.MemberExpression&&this.throwError(F.IdentiferExpected,t,r);const u=this.parseArguments();n=this.finalize({type:b.CallExpression,callee:n,arguments:u,...this.getItemLocation(t)});continue}case"[":{this.context.isAssignmentTarget=!0,this.expectPunctuator("[");const u=this.isolateCoverGrammar(this.parseExpression);this.expectPunctuator("]"),n=this.finalize({type:b.MemberExpression,computed:!0,object:n,property:u,...this.getItemLocation(t)});continue}case".":{this.context.isAssignmentTarget=!0,this.expectPunctuator(".");const u=this.parseMemberName();n=this.finalize({type:b.MemberExpression,computed:!1,object:n,property:u,...this.getItemLocation(t)});continue}}return n}parseUpdateExpression(){const t=this.captureStartMarker();let n=this.getMatchingPunctuator(Jn);if(n){this.readNextRawToken();const o=this.captureStartMarker(),i=this.inheritCoverGrammar(this.parseUnaryExpression);return i.type!==b.Identifier&&i.type!==b.MemberExpression&&i.type!==b.CallExpression&&this.throwError(F.InvalidExpression,o),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,t),this.context.isAssignmentTarget=!1,this.finalize({type:b.UpdateExpression,operator:n,argument:i,prefix:!0,...this.getItemLocation(t)})}const r=this.captureStartMarker(),a=this.inheritCoverGrammar(this.parseLeftHandSideExpression),u=this.captureStartMarker();return this.hasLineTerminator?a:(n=this.getMatchingPunctuator(Jn),n?(a.type!==b.Identifier&&a.type!==b.MemberExpression&&this.throwError(F.InvalidExpression,r,u),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,t),this.readNextRawToken(),this.context.isAssignmentTarget=!1,this.finalize({type:b.UpdateExpression,operator:n,argument:a,prefix:!1,...this.getItemLocation(t)})):a)}parseUnaryExpression(){const t=this.getMatchingPunctuator(qi);if(t){const n=this.captureStartMarker();this.readNextRawToken();const r=this.inheritCoverGrammar(this.parseUnaryExpression);return this.context.isAssignmentTarget=!1,this.finalize({type:b.UnaryExpression,operator:t,argument:r,prefix:!0,...this.getItemLocation(n)})}return this.parseUpdateExpression()}parseBinaryExpression(){const t=this.rawToken;let n=this.inheritCoverGrammar(this.parseUnaryExpression);if(this.rawToken.type!==E.Punctuator)return n;const r=this.rawToken.value;let a=jr(r);if(a===0)return n;this.readNextRawToken(),this.context.isAssignmentTarget=!1;const u=[t,this.rawToken];let o=n,i=this.inheritCoverGrammar(this.parseUnaryExpression);const s=[o,r,i],c=[a];for(;this.rawToken.type===E.Punctuator&&(a=jr(this.rawToken.value))>0;){for(;s.length>2&&a<=c[c.length-1];){i=s.pop();const m=s.pop();c.pop(),o=s.pop(),u.pop();const g=u[u.length-1],x=qr(g,g.lineStart);s.push(this.finalize(this.createBinaryOrLogicalExpression(x,m,o,i)))}s.push(this.rawToken.value),c.push(a),u.push(this.rawToken),this.readNextRawToken(),s.push(this.inheritCoverGrammar(this.parseUnaryExpression))}let p=s.length-1;n=s[p];let f=u.pop();for(;p>1;){const m=u.pop();if(!m)break;const g=f==null?void 0:f.lineStart,x=qr(m,g),M=s[p-1];n=this.finalize(this.createBinaryOrLogicalExpression(x,M,s[p-2],n)),p-=2,f=m}return n}createBinaryOrLogicalExpression(t,n,r,a){const u=ji.includes(n)?b.LogicalExpression:b.BinaryExpression;return u===b.BinaryExpression||(r.type!==b.AssignmentExpression&&r.type!==b.UpdateExpression||this.throwError(F.InvalidExpression,...Vr(r)),a.type!==b.AssignmentExpression&&a.type!==b.UpdateExpression||this.throwError(F.InvalidExpression,...Vr(r))),{type:u,operator:n,left:r,right:a,...this.getItemLocation(t)}}parseAssignmentExpression(){const t=this.captureStartMarker(),n=this.inheritCoverGrammar(this.parseBinaryExpression),r=this.captureStartMarker(),a=this.getMatchingPunctuator(Vi);if(!a)return n;n.type!==b.Identifier&&n.type!==b.MemberExpression&&this.throwError(F.InvalidExpression,t,r),this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInAssignment,t),this.matchPunctuator("=")||(this.context.isAssignmentTarget=!1),this.readNextRawToken();const u=this.isolateCoverGrammar(this.parseAssignmentExpression);return this.finalize({type:b.AssignmentExpression,left:n,operator:a,right:u,...this.getItemLocation(t)})}parseExpression(){return this.isolateCoverGrammar(this.parseAssignmentExpression)}parseStatements(t){const n=[];for(;this.rawToken.type!==E.EOF&&!this.matchPunctuator(t);){const r=this.parseStatementListItem();hu(r)||n.push(r)}return n}parseStatementListItem(){return this.context.isAssignmentTarget=!0,this.matchKeyword(L.Function)?this.parseFunctionDeclaration():this.matchKeyword(L.Export)?this.parseExportDeclaration():this.matchKeyword(L.Import)?this.parseImportDeclaration():this.parseStatement()}parseBlock(){const t=this.captureStartMarker();this.expectPunctuator("{");const n=this.parseStatements("}");return this.expectPunctuator("}"),this.finalize({type:b.BlockStatement,body:n,...this.getItemLocation(t)})}parseObjectStatement(){const t=this.captureStartMarker(),n=this.parseObjectExpression();return this.finalize({type:b.ExpressionStatement,expression:n,...this.getItemLocation(t)})}parseBlockOrObjectStatement(){return this.context.curlyParsingType===Nt.AsObject?this.parseObjectStatement():this.peekAhead(t=>{let n=t();return(n.type===E.Identifier||n.type===E.StringLiteral)&&(n=t(),n.type===E.Punctuator&&n.value===":")})?this.parseObjectStatement():this.parseBlock()}parseIdentifier(){const t=this.rawToken;if(t.type!==E.Identifier)return null;const n=this.captureStartMarker();return this.readNextRawToken(),this.finalize({type:b.Identifier,name:t.value,...this.getItemLocation(n)})}parseVariableDeclarator(){const t=this.captureStartMarker(),n=this.parseIdentifier();n||this.throwUnexpectedToken({code:F.IdentiferExpected});let r=null;if(this.matchPunctuator("=")){this.readNextRawToken();const a=this.rawToken;try{r=this.isolateCoverGrammar(this.parseAssignmentExpression)}catch{this.throwUnexpectedToken({rawToken:a,code:F.InvalidVariableAssignment})}}return this.finalize({type:b.VariableDeclarator,id:n,init:r,...this.getItemLocation(t)})}parseVariableDeclarationList(){const t=[this.parseVariableDeclarator()];for(;this.matchPunctuator(",");)this.readNextRawToken(),t.push(this.parseVariableDeclarator());return t}parseVariableDeclaration(){const t=this.captureStartMarker();this.expectKeyword(L.Var);const n=this.parseVariableDeclarationList();return this.consumeSemicolon(),this.finalize({type:b.VariableDeclaration,declarations:n,kind:"var",...this.getItemLocation(t)})}parseEmptyStatement(){const t=this.captureStartMarker();return this.expectPunctuator(";"),this.finalize({type:b.EmptyStatement,...this.getItemLocation(t)})}parseExpressionStatement(){const t=this.captureStartMarker(),n=this.parseExpression();return this.consumeSemicolon(),this.finalize({type:b.ExpressionStatement,expression:n,...this.getItemLocation(t)})}parseIfClause(){return this.withBlockContext(ce.IfClause,this.parseStatement)}parseIfStatement(){const t=this.captureStartMarker();this.expectKeyword(L.If),this.expectPunctuator("(");const n=this.captureStartMarker(),r=this.parseExpression(),a=this.captureStartMarker();this.expectPunctuator(")"),r.type!==b.AssignmentExpression&&r.type!==b.UpdateExpression||this.throwError(F.InvalidExpression,n,a);const u=this.parseIfClause();let o=null;return this.matchKeyword(L.Else)&&(this.readNextRawToken(),o=this.parseIfClause()),this.finalize({type:b.IfStatement,test:r,consequent:u,alternate:o,...this.getItemLocation(t)})}parseWhileStatement(){const t=this.captureStartMarker();this.expectKeyword(L.While),this.expectPunctuator("(");const n=this.captureStartMarker(),r=this.parseExpression(),a=this.captureStartMarker();this.expectPunctuator(")"),r.type!==b.AssignmentExpression&&r.type!==b.UpdateExpression||this.throwError(F.InvalidExpression,n,a);const u=this.withBlockContext(ce.WhileLoop,this.parseStatement);return this.finalize({type:b.WhileStatement,test:r,body:u,...this.getItemLocation(t)})}parseForStatement(){let t=null,n=null,r=null,a=null,u=null;const o=this.captureStartMarker();if(this.expectKeyword(L.For),this.expectPunctuator("("),this.matchPunctuator(";"))this.readNextRawToken();else if(this.matchKeyword(L.Var)){const s=this.captureStartMarker();this.readNextRawToken();const c=this.parseVariableDeclarationList();c.length===1&&this.matchKeyword(L.In)?(c[0].init&&this.throwError(F.ForInOfLoopInitializer,s),a=this.finalize({type:b.VariableDeclaration,declarations:c,kind:"var",...this.getItemLocation(s)}),this.readNextRawToken(),u=this.parseExpression()):(this.matchKeyword(L.In)&&this.throwError(F.InvalidLeftHandSideInForIn,s),t=this.finalize({type:b.VariableDeclaration,declarations:c,kind:"var",...this.getItemLocation(s)}),this.expectPunctuator(";"))}else{const s=this.context.isAssignmentTarget,c=this.captureStartMarker();t=this.inheritCoverGrammar(this.parseAssignmentExpression),this.matchKeyword(L.In)?(this.context.isAssignmentTarget||this.tolerateError(F.InvalidLeftHandSideInForIn,c),t.type!==b.Identifier&&this.throwError(F.InvalidLeftHandSideInForIn,c),this.readNextRawToken(),a=t,u=this.parseExpression(),t=null):(this.context.isAssignmentTarget=s,this.expectPunctuator(";"))}a||(this.matchPunctuator(";")||(n=this.isolateCoverGrammar(this.parseExpression)),this.expectPunctuator(";"),this.matchPunctuator(")")||(r=this.isolateCoverGrammar(this.parseExpression))),this.expectPunctuator(")");const i=this.withBlockContext(ce.ForLoop,()=>this.isolateCoverGrammar(this.parseStatement));return a&&u?this.finalize({type:b.ForInStatement,left:a,right:u,body:i,...this.getItemLocation(o)}):this.finalize({type:b.ForStatement,init:t,test:n,update:r,body:i,...this.getItemLocation(o)})}parseContinueStatement(){const t=this.captureStartMarker();return this.expectKeyword(L.Continue),this.consumeSemicolon(),this.finalize({type:b.ContinueStatement,...this.getItemLocation(t)})}parseBreakStatement(){const t=this.captureStartMarker();return this.expectKeyword(L.Break),this.consumeSemicolon(),this.finalize({type:b.BreakStatement,...this.getItemLocation(t)})}parseReturnStatement(){const t=this.captureStartMarker();this.expectKeyword(L.Return);const n=!this.matchPunctuator(";")&&!this.matchPunctuator("}")&&!this.hasLineTerminator&&this.rawToken.type!==E.EOF||this.rawToken.type===E.StringLiteral||this.rawToken.type===E.Template?this.parseExpression():null;return this.consumeSemicolon(),this.finalize({type:b.ReturnStatement,argument:n,...this.getItemLocation(t)})}parseStatement(){switch(this.rawToken.type){case E.BooleanLiteral:case E.NullLiteral:case E.NumericLiteral:case E.StringLiteral:case E.Template:case E.Identifier:return this.parseExpressionStatement();case E.Punctuator:return this.rawToken.value==="{"?this.parseBlockOrObjectStatement():this.rawToken.value==="("?this.parseExpressionStatement():this.rawToken.value===";"?this.parseEmptyStatement():this.parseExpressionStatement();case E.Keyword:switch(this.rawToken.value.toLowerCase()){case L.Break:return this.parseBreakStatement();case L.Continue:return this.parseContinueStatement();case L.For:return this.parseForStatement();case L.Function:return this.parseFunctionDeclaration();case L.If:return this.parseIfStatement();case L.Return:return this.parseReturnStatement();case L.Var:return this.parseVariableDeclaration();case L.While:return this.parseWhileStatement();default:return this.parseExpressionStatement()}default:return this.throwUnexpectedToken({rawToken:this.rawToken})}}parseFormalParameters(){const t=[];if(this.expectPunctuator("("),!this.matchPunctuator(")"))for(;this.rawToken.type!==E.EOF;){const n=this.parseIdentifier();if(n||this.throwUnexpectedToken({rawToken:this.rawToken,code:F.IdentiferExpected}),t.push(n),this.matchPunctuator(")")||(this.expectPunctuator(","),this.matchPunctuator(")")))break}return this.expectPunctuator(")"),t}parseFunctionDeclaration(){(this.context.blockContext&ce.Function)===ce.Function&&this.throwUnexpectedToken({code:F.NoFunctionInsideFunction}),(this.context.blockContext&ce.WhileLoop)!==ce.WhileLoop&&(this.context.blockContext&ce.IfClause)!==ce.IfClause||this.throwUnexpectedToken({code:F.NoFunctionInsideBlock});const t=this.captureStartMarker();this.expectKeyword(L.Function);const n=this.parseIdentifier();n||this.throwUnexpectedToken({code:F.InvalidFunctionIdentifier});const r=this.parseFormalParameters(),a=this.context.blockContext;this.context.blockContext=this.context.blockContext|ce.Function;const u=this.parseBlock();return this.context.blockContext=a,this.finalize({type:b.FunctionDeclaration,id:n,params:r,body:u,...this.getItemLocation(t)})}parseScript(){const t=this.captureStartMarker(),n=this.parseStatements(),r=this.finalize({type:b.Program,body:n,...this.getItemLocation(t)});return this.options.tokens&&(r.tokens=this.tokens),this.options.tolerant&&(r.errors=this.errorHandler.errors),r}parseExportDeclaration(){this.context.blockContext!==ce.None&&this.throwUnexpectedToken({code:F.ModuleExportRootOnly});let t=null;const n=this.captureStartMarker();return this.expectKeyword(L.Export),this.matchKeyword(L.Var)?t=this.parseVariableDeclaration():this.matchKeyword("function")?t=this.parseFunctionDeclaration():this.throwUnexpectedToken({code:F.InvalidExpression}),this.finalize({type:b.ExportNamedDeclaration,declaration:t,specifiers:[],source:null,...this.getItemLocation(n)})}parseModuleSpecifier(){const t=this.captureStartMarker(),n=this.rawToken;if(n.type===E.StringLiteral)return this.readNextRawToken(),this.finalize({type:b.Literal,value:n.value,raw:this.getSourceValue(n),isString:!0,...this.getItemLocation(t)});this.throwError(F.InvalidModuleUri,t)}parseDefaultSpecifier(){const t=this.captureStartMarker(),n=this.parseIdentifier();return n||this.throwUnexpectedToken({code:F.IdentiferExpected}),this.finalize({type:b.ImportDefaultSpecifier,local:n,...this.getItemLocation(t)})}parseImportDeclaration(){this.context.blockContext!==ce.None&&this.throwUnexpectedToken({code:F.ModuleImportRootOnly});const t=this.captureStartMarker();this.expectKeyword(L.Import);const n=this.parseDefaultSpecifier();this.expectContextualKeyword(L.From);const r=this.parseModuleSpecifier();return this.finalize({type:b.ImportDeclaration,specifiers:[n],source:r,...this.getItemLocation(t)})}}function wu(e,t,n){return new yu(e,t,n).parseScript()}function nn(e,t=[]){const n=wu(e);if(n.body===null||n.body===void 0)throw new Ot({index:0,line:0,column:0,data:null,description:"",code:F.InvalidExpression});return n.loadedModules={},zt(n,t),n}class rn{constructor(t){const n=this;n._keys=[],n._values=[],n.length=0,t&&t.forEach(r=>{n.set(r[0],r[1])})}entries(){return[].slice.call(this.keys().map((t,n)=>[t,this._values[n]]))}keys(){return[].slice.call(this._keys)}values(){return[].slice.call(this._values)}has(t){return this._keys.includes(t)}get(t){const n=this._keys.indexOf(t);return n>-1?this._values[n]:null}deepGet(t){if(!(t!=null&&t.length))return null;const n=(r,a)=>r==null?null:a.length?n(r instanceof rn?r.get(a[0]):r[a[0]],a.slice(1)):r;return n(this.get(t[0]),t.slice(1))}set(t,n){const r=this,a=this._keys.indexOf(t);return a>-1?r._values[a]=n:(r._keys.push(t),r._values.push(n),r.length=r._values.length),this}sortedSet(t,n,r,a){const u=this,o=this._keys.length,i=r||0,s=a!==void 0?a:o-1;if(o===0)return u._keys.push(t),u._values.push(n),u;if(t===this._keys[i])return this._values.splice(i,0,n),this;if(t===this._keys[s])return this._values.splice(s,0,n),this;if(t>this._keys[s])return this._keys.splice(s+1,0,t),this._values.splice(s+1,0,n),this;if(t=s)return this;const c=i+Math.floor((s-i)/2);return tthis._keys[c]?this.sortedSet(t,n,c+1,s):this}size(){return this.length}clear(){const t=this;return t._keys.length=t.length=t._values.length=0,this}delete(t){const n=this,r=n._keys.indexOf(t);return r>-1&&(n._keys.splice(r,1),n._values.splice(r,1),n.length=n._keys.length,!0)}forEach(t){this._keys.forEach((n,r)=>{t(this._values[r],n,r)})}map(t){return this.keys().map((n,r)=>t(this._values[r],n,r))}filter(t){const n=this;return n._keys.forEach((r,a)=>{t(n._values[a],r,a)===!1&&n.delete(r)}),this}clone(){return new rn(this.entries())}}class Hr{constructor(t=20){this._maxEntries=t,this._values=new rn}delete(t){this._values.has(t)&&this._values.delete(t)}get(t){let n=null;return this._values.has(t)&&(n=this._values.get(t),this._values.delete(t),this._values.set(t,n)),n}put(t,n){if(this._values.size()>=this._maxEntries){const r=this._values.keys()[0];this._values.delete(r)}this._values.set(t,n)}}class xu{constructor(t=20){this._maxEntries=t,this._cache=new Hr(this._maxEntries)}clear(){this._cache=new Hr(this._maxEntries)}addToCache(t,n){this._cache.put(t,n)}removeFromCache(t){this._cache.delete(t)}getFromCache(t){return this._cache.get(t)}}class me{constructor(t){this.portalUri=t}normalizeModuleUri(t){const n=/^[a-z0-9A-Z]+(@[0-9]+\.[0-9]+\.[0-9]+)?([\?|\/].*)?$/gi,r=/(?.+)\/home\/item\.html\?id\=(?.+)$/gi,a=/(?.+)\/sharing\/rest\/content\/users\/[a-zA-Z0-9]+\/items\/(?.+)$/gi,u=/(?.+)\/sharing\/rest\/content\/items\/(?.+)$/gi,o=/(?.*)@(?[0-9]+\.[0-9]+\.[0-9]+)([\?|\/].*)?$/gi;if(t.startsWith("portal+")){let i=t.substring(7),s="",c=i,p=!1;for(const g of[r,u,a]){const x=g.exec(i);if(x!==null){const M=x.groups;c=M.itemid,s=M.portalurl,p=!0;break}}if(p===!1){if(!n.test(i))throw new pn(et.UnsupportedUriProtocol,{uri:t});c=i,s=this.portalUri}c.includes("/")&&(c=c.split("/")[0]),c.includes("?")&&(c=c.split("?")[0]);let f="current";const m=o.exec(c);if(m!==null){const g=m.groups;c=g.itemid,f=g.versionstring}return i=new Wn({url:s}).restUrl+"/content/items/"+c+"/resources/"+f+".arc",{url:i,scheme:"portal",uri:"PO:"+i}}if(t.startsWith("mock")){if(t==="mock")return{url:"",scheme:"mock",data:` + export var hello = 1; + export function helloWorld() { + return "Hello World " + hello; + } + `,uri:"mock"};const i=t.replace("mock:","");if(me.mocks[i]!==void 0)return{url:"",scheme:"mock",data:me.mocks[i],uri:t}}throw new pn(et.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=me.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);me.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(u){throw me.cachedModules.removeFromCache(t.uri),u}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await ba(t.url,{responseType:"text",query:{}});if(n.data)return nn(n.data,[])}if(t.scheme==="mock")return nn(t.data??"",[]);throw new pn(et.UnsupportedUriProtocol)}static create(t){return new me(t)}static getDefault(){return this._default??(me._default=me._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}me.mocks={},me.cachedModules=new xu(30),me._default=null,me._moduleResolverFactory=()=>{const e=Wn.getDefault();return new me(e.url)};let Fu=class extends tt{constructor(t,n){super(),this.definition=null,this.context=null,this.definition=t,this.context=n}createFunction(t){return(...n)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter.depth+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new d(t,l.MaximumCallDepth,null);return Sn(this.definition,r,n,null)}}call(t,n){return Ue(t,n,(r,a,u)=>{const o={spatialReference:t.spatialReference,services:t.services,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,timeZone:t.timeZone??null,console:t.console,lrucache:t.lrucache,interceptor:t.interceptor,localScope:{}};if(o.depthCounter.depth>64)throw new d(t,l.MaximumCallDepth,n);return Sn(this.definition,o,u,n)})}marshalledCall(t,n,r,a){return a(t,n,(u,o,i)=>{const s={spatialReference:t.spatialReference,globalScope:r.globalScope,services:t.services,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,timeZone:t.timeZone??null,lrucache:t.lrucache,interceptor:t.interceptor,localScope:{}};return i=i.map(c=>!X(c)||c instanceof ze?c:dt(c,t,a)),dt(Sn(this.definition,s,i,n),r,a)})}},gt=class extends Pt{constructor(t){super(t)}global(t){const n=this.executingContext.globalScope[t.toLowerCase()];if(n.valueset||(n.value=v(this.executingContext,n.node),n.valueset=!0),X(n.value)&&!(n.value instanceof ze)){const r=new ze;r.fn=n.value,r.parameterEvaluator=Ue,r.context=this.executingContext,n.value=r}return n.value}setGlobal(t,n){if(X(n))throw new d(null,l.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:n,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}loadModule(t){let n=t.spatialReference;n==null&&(n=new yt({wkid:102100})),this.moduleScope=Xi({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:n,globalScope:this.moduleScope,localScope:null,libraryResolver:new an(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:t.services,console:t.console??Qi,timeZone:t.timeZone??null,lrucache:t.lrucache,interceptor:t.interceptor,depthCounter:{depth:1}},v(this.executingContext,this.source.syntax)}};function Cu(e,t){const n=[];for(let r=0;r=r.length)throw new d(e,l.OutOfBounds,t);n=h(r[a]),r[a]=t.operator==="++"?n+1:n-1}else if(r instanceof k){if(C(a)===!1)throw new d(e,l.KeyAccessorMustBeString,t);if(r.hasField(a)!==!0)throw new d(e,l.FieldNotFound,t);n=h(r.field(a)),r.setField(a,t.operator==="++"?n+1:n-1)}else if(ee(r)){if(C(a)===!1)throw new d(e,l.KeyAccessorMustBeString,t);if(r.hasField(a)!==!0)throw new d(e,l.FieldNotFound,t);n=h(r.field(a)),r.setField(a,t.operator==="++"?n+1:n-1)}else{if(R(r))throw new d(e,l.Immutable,t);if(!(r instanceof gt))throw new d(e,l.InvalidParameter,t);if(C(a)===!1)throw new d(e,l.ModuleAccessorMustBeString,t);if(r.hasGlobal(a)!==!0)throw new d(e,l.ModuleExportNotFound,t);n=h(r.global(a)),r.setGlobal(a,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}if(r=t.argument.type==="Identifier"?t.argument.name.toLowerCase():"",!r)throw new d(e,l.InvalidIdentifier,t);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=h(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=h(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new d(e,l.InvalidIdentifier,t)}function Oe(e,t,n,r,a){switch(t){case"=":return e===A?null:e;case"/=":return h(n)/h(e);case"*=":return h(n)*h(e);case"-=":return h(n)-h(e);case"+=":return C(n)||C(e)?w(n)+w(e):h(n)+h(e);case"%=":return h(n)%h(e);default:throw new d(a,l.UnsupportedOperator,r)}}function Tu(e,t){let n=null,r="";if(t.left.type==="MemberExpression"){if(n=v(e,t.left.object),t.left.computed===!0)r=v(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new d(e,l.InvalidIdentifier,t);r=t.left.property.name}const u=v(e,t.right);if(T(n)){if(!q(r))throw new d(e,l.ArrayAccessorMustBeNumber,t);if(r<0&&(r=n.length+r),r<0||r>n.length)throw new d(e,l.OutOfBounds,t);if(r===n.length){if(t.operator!=="=")throw new d(e,l.OutOfBounds,t);n[r]=Oe(u,t.operator,n[r],t,e)}else n[r]=Oe(u,t.operator,n[r],t,e)}else if(n instanceof k){if(C(r)===!1)throw new d(e,l.KeyAccessorMustBeString,t);if(n.hasField(r)===!0)n.setField(r,Oe(u,t.operator,n.field(r),t,e));else{if(t.operator!=="=")throw new d(e,l.FieldNotFound,t,{key:r});n.setField(r,Oe(u,t.operator,null,t,e))}}else if(ee(n)){if(C(r)===!1)throw new d(e,l.KeyAccessorMustBeString,t);if(n.hasField(r)===!0)n.setField(r,Oe(u,t.operator,n.field(r),t,e));else{if(t.operator!=="=")throw new d(e,l.FieldNotFound,t,{key:r});n.setField(r,Oe(u,t.operator,null,t,e))}}else{if(R(n))throw new d(e,l.Immutable,t);if(!(n instanceof gt))throw new d(e,l.InvalidIdentifier,t);if(C(r)===!1)throw new d(e,l.ModuleAccessorMustBeString,t);if(n.hasGlobal(r)!==!0)throw new d(e,l.ModuleExportNotFound,t);n.setGlobal(r,Oe(u,t.operator,n.global(r),t,e))}return A}n=t.left.name.toLowerCase();const a=v(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Oe(a,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},A;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Oe(a,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},A;throw new d(e,l.InvalidIdentifier,t)}function Bu(e,t){if(t.expression.type==="AssignmentExpression"||t.expression.type==="UpdateExpression")return v(e,t.expression);if(t.expression.type==="CallExpression"){const n=v(e,t.expression);return n===A?A:new ft(n)}{const n=v(e,t.expression);return n===A?A:new ft(n)}}function Nu(e,t){const n=v(e,t.test);if(n===!0)return v(e,t.consequent);if(n===!1)return t.alternate!==null?v(e,t.alternate):A;throw new d(e,l.BooleanConditionRequired,t)}function _u(e,t){let n=A;for(let r=0;r=n.length||r<0)throw new d(e,l.OutOfBounds,t);return n[r]}throw new d(e,l.InvalidMemberAccessKey,t)}if(C(n)){if(q(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new d(e,l.OutOfBounds,t);return n[r]}throw new d(e,l.InvalidMemberAccessKey,t)}if(R(n)){if(q(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new d(e,l.OutOfBounds,t);return n.get(r)}throw new d(e,l.InvalidMemberAccessKey,t)}throw new d(e,l.InvalidMemberAccessKey,t)}}catch(n){throw n}}function zu(e,t){try{const n=v(e,t.argument);if(z(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*h(n);if(t.operator==="+")return 1*h(n);if(t.operator==="~")return~h(n);throw new d(e,l.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~h(n);if(t.operator==="-")return-1*h(n);if(t.operator==="+")return 1*h(n);throw new d(e,l.UnsupportedUnaryOperator,t)}catch(n){throw n}}function Gu(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return ir(h(r),h(a),t.operator);case"==":return Ee(r,a);case"!=":return!Ee(r,a);case"<":case">":case"<=":case">=":return rr(r,a,t.operator);case"+":return C(r)||C(a)?w(r)+w(a):h(r)+h(a);case"-":return h(r)-h(a);case"*":return h(r)*h(a);case"/":return h(r)/h(a);case"%":return h(r)%h(a);default:throw new d(e,l.UnsupportedOperator,t)}}catch(n){throw n}}function Ju(e,t){try{const n=v(e,t.left);if(z(n))switch(t.operator){case"||":if(n===!0)return n;{const r=v(e,t.right);if(z(r))return r;throw new d(e,l.LogicExpressionOrAnd,t)}case"&&":if(n===!1)return n;{const r=v(e,t.right);if(z(r))return r;throw new d(e,l.LogicExpressionOrAnd,t)}default:throw new d(e,l.LogicExpressionOrAnd,t)}throw new d(e,l.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function qu(e,t){return t.value?t.value.cooked:""}function Vu(e,t,n){if(X(e))throw new d(t,l.NoFunctionInTemplateLiteral,n);return e}function ju(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?w(Vu(v(e,t.expressions[r]),e,t)):"",r++);return n}function Ki(e,t){let n;try{const r=t.name.toLowerCase();if(e.localScope!=null&&e.localScope[r]!==void 0)return n=e.localScope[r],n.valueset===!0||(n.value=v(e,n.node),n.valueset=!0),n.value;if(e.globalScope[r]!==void 0)return n=e.globalScope[r],n.valueset===!0||(n.value=v(e,n.node),n.valueset=!0),n.value;throw new d(e,l.InvalidIdentifier,t)}catch(r){throw r}}function Hu(e,t){try{if(t.callee.type==="MemberExpression"){const n=v(e,t.callee.object);if(!(n instanceof gt))throw new d(e,l.FunctionNotFound,t);const r=t.callee.computed===!1?t.callee.property.name:v(e,t.callee.property);if(!n.hasGlobal(r))throw new d(e,l.FunctionNotFound,t);const a=n.global(r);if(!X(a))throw new d(e,l.CallNonFunction,t);return a.call(e,t)}if(t.callee.type!=="Identifier")throw new d(e,l.FunctionNotFound,t);if(e.localScope!=null&&e.localScope[t.callee.name.toLowerCase()]!==void 0){const n=e.localScope[t.callee.name.toLowerCase()];if(X(n.value))return n.value.call(e,t);throw new d(e,l.CallNonFunction,t)}if(e.globalScope[t.callee.name.toLowerCase()]!==void 0){const n=e.globalScope[t.callee.name.toLowerCase()];if(X(n.value))return n.value.call(e,t);throw new d(e,l.CallNonFunction,t)}throw new d(e,l.FunctionNotFound,t)}catch(n){throw n}}const he={};function Wi(e,t,n,r){try{const a=t.arguments,u=v(e,a[n]);if(Ee(u,r))return v(e,a[n+1]);{const o=a.length-n;return o===1?v(e,a[n]):o===2?null:o===3?v(e,a[n+2]):Wi(e,t,n+2,r)}}catch(a){throw a}}function Yi(e,t,n,r){try{const a=t.arguments;if(r===!0)return v(e,a[n+1]);if(a.length-n===3)return v(e,a[n+2]);{const u=v(e,a[n+2]);if(z(u)===!1)throw new d(e,l.BooleanConditionRequired,a[n+2]);return Yi(e,t,n+2,u)}}catch(a){throw a}}function Sn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new d(t,l.WrongNumberOfParameters,r);if(t.localScope!=null)for(let o=0;oimport("./index-J0iiHjMT.js").then(t=>t.zJ),__vite__mapDeps([1,2]));return na=!0,ao(e),!0}let In=null;function fr(){return In!==null||(In=oa()),In}async function oa(){await au(),ke=await Ve(()=>import("./arcadeAsyncRuntime-RlgIDugP.js"),__vite__mapDeps([7,0,1,2,3,4,5,6]));for(const e of jn)ke.extend(e),rt(e,"async");return jn=null,!0}function ua(){return ta}function sa(){return!!ke}function la(){return na}let kn=null;function hr(){return kn||(kn=ca(),kn)}async function ca(){await fr();const[e,t,n,r,a]=await Promise.all([Ve(()=>import("./featureSetUtils-DaHg3px6.js").then(u=>u.l),__vite__mapDeps([8,1,2,9,3,10,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])),Ve(()=>import("./featuresetbase-WjFIOCEy.js"),__vite__mapDeps([34,3,1,2,8,9,10,5,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,4,6])),Ve(()=>import("./featuresetgeom-3-0z5YnY.js"),__vite__mapDeps([35,3,1,2,10,9,5,6])),Ve(()=>import("./featuresetstats-NfM8OXOZ.js"),__vite__mapDeps([36,3,1,2,9,6])),Ve(()=>import("./featuresetstring-bt3R_cQ2.js"),__vite__mapDeps([37,1,2,3,6]))]);return pa=e,ke.extend([t,n,r,a]),rt([t,n,r,a],"async"),ta=!0,!0}function da(e,t=[]){return e.usesFeatureSet===void 0&&zt(e,t),e.usesFeatureSet===!0}function ts(e,t=[]){return e.isAsync===void 0&&zt(e,t),e.isAsync===!0}function ns(e,t){if(t){for(const n of t)if(dn(e,n))return!0;return!1}return!1}async function fa(e,t,n=[],r=!1,a=null){return mr(new Set,e,t,n,r,a)}async function mr(e,t,n,r=[],a=!1,u=null){const o=typeof t=="string"?lr(t):t,i=[];return o&&(la()===!1&&(fn(o)||a)&&i.push(dr()),sa()===!1&&(o.isAsync===!0||n)&&i.push(fr()),ua()===!1&&(da(o)||ns(o,r))&&i.push(hr())),i.length&&await Promise.all(i),await ha(e,o,u,n,a),!0}function rs(e,t=[]){return e.usesModules===void 0&&zt(e,t),e.usesModules===!0}async function ha(e,t,n=null,r=!1,a=!1){const u=Si(t);n===null&&u.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of u){ti(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new d(null,l.CircularModules,null);e.add(i.uri);const s=await n.fetchModule(i);await mr(e,s,r,[],a,n),e.delete(i.uri),s.isAsync&&(t.isAsync=!0),s.usesFeatureSet&&(t.usesFeatureSet=!0),s.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:s}}}function ma(e){if(fn(e))return!0;const t=Ln(e);let n=!1;for(let r=0;r{Kr.test(o)&&(o=o.replace(Kr,""),a.push(o))});const u=a.filter(o=>o.includes("*"));return a=a.filter(o=>!u.includes(o)),t&&u.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(os).join(".*")}$`,"i");t.forEach(s=>i.test(s)?a.push(s):null)}),[...new Set(a.sort())]}function Ds(e){return dn(e,"$view")}function gs(e,t){return!!e&&dn(e,t)}function ys(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new k({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function ws({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=hn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function xs({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:u}){if(e===null)return null;const o=hn();return o?o.constructFeatureSet(e,t,n,r??!0,a,u):null}function Fs(e){if((e==null?void 0:e.map)===null)return null;const t=hn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function Cs(e,t){return k.convertJsonToArcade(e,t)}function As(e,t,n=[]){return fa(e,t,n)}function bs(){return dr()}function Es(){return hr()}function Ss(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function vs(e){return e.declaredClass==="esri.layers.support.LabelClass"}function Is(e){return e.declaredClass==="esri.PopupTemplate"}function Da(e,t){var r,a;if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(Ss(n)){if(n.type==="dot-density"){const i=(r=n.attributes)==null?void 0:r.some(s=>t(s.valueExpression));if(i)return i}const u=n.visualVariables,o=!!u&&u.some(i=>{let s=t(i.valueExpression);return i.type==="size"&&(Wr(i.minSize)&&(s=s||t(i.minSize.valueExpression)),Wr(i.maxSize)&&(s=s||t(i.maxSize.valueExpression))),s});return!(!("valueExpression"in n)||!t(n.valueExpression))||o}if(vs(n)){const u=(a=n.labelExpressionInfo)==null?void 0:a.expression;return!(!u||!t(u))||!1}return!!Is(n)&&(!!n.expressionInfos&&n.expressionInfos.some(u=>t(u.expression))||Array.isArray(n.content)&&n.content.some(u=>{var o;return u.type==="expression"&&t((o=u.expressionInfo)==null?void 0:o.expression)}))}function ks(e){const t=Gt(e);return!!t&&ma(t)}function Ts(e){return Da(e,ks)}function Bs(e){const t=Gt(e);return!!t&&fn(t)}function Ns(e){return Da(e,Bs)}function Wr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const hl=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:k,arcade:is,arcadeFeature:Q,convertFeatureLayerToFeatureSet:xs,convertJsonToArcade:Cs,convertMapToFeatureSetCollection:Fs,convertServiceUrlToWorkspace:ws,createExecContext:ls,createFeature:cs,createFunction:ss,createSyntaxTree:Gt,dependsOnView:Ds,enableFeatureSetOperations:Es,enableGeometryOperations:bs,evalSyntaxTree:fs,executeAsyncFunction:ms,executeFunction:hs,extractFieldNames:ps,getArcadeType:us,getViewInfo:ys,hasGeometryFunctions:Ts,hasGeometryOperations:Ns,hasVariable:gs,loadScriptDependencies:As,updateExecContext:ds},Symbol.toStringTag,{value:"Module"}));export{Ri as $,$ as A,ht as B,vi as C,Q as D,Pn as E,ye as F,z as G,xt as H,ir as I,se as J,J as K,$t as L,ft as M,k as N,Ie as O,C as P,V as Q,wt as R,Na as S,He as T,ee as U,Zs as V,Bi as W,P as X,yn as Y,Z,gi as _,d as a,un as a0,jt as a1,yi as a2,mi as a3,wi as a4,pi as a5,we as a6,xi as a7,Cr as a8,Mn as a9,so as aA,$a as aB,Di as aC,hl as aD,kt as aa,Vt as ab,Ya as ac,Xa as ad,ja as ae,Ct as af,gr as ag,wr as ah,Vs as ai,Hs as aj,xr as ak,js as al,qs as am,Js as an,Ks as ao,el as ap,yr as aq,Ws as ar,Xs as as,Ta as at,Fr as au,Ys as av,_a as aw,Qs as ax,nl as ay,tl as az,R as b,h as c,w as d,nt as e,$i as f,rr as g,Ee as h,te as i,tt as j,ze as k,dt as l,_i as m,D as n,$n as o,On as p,T as q,l as r,an as s,Pt as t,Ia as u,X as v,A as w,ae as x,_ as y,q as z}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/geomasync-_hAyjeTi.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/TimeOnly-ljWtUK7N.js","assets/portalUtils-MqaWunxU.js","assets/geometryEngineAsync-QjQc0riy.js","assets/hash-SS5GKVPY.js","assets/arcadeAsyncRuntime-RlgIDugP.js","assets/featureSetUtils-DaHg3px6.js","assets/WhereClause-XAMIZ4-B.js","assets/SpatialFilter-CXhA7RaJ.js","assets/FeatureLayer--S4epFk-.js","assets/FeatureLayerBase-jpFp8gE3.js","assets/serviceCapabilitiesUtils-26KpT1VN.js","assets/editsZScale-Wgw9kbYG.js","assets/queryZScale-IaMm02_2.js","assets/FeatureSet-d4S1oKME.js","assets/CustomParametersMixin-Y1bOcayO.js","assets/FeatureEffectLayer-oBa8pIG5.js","assets/FeatureEffect-5bEV-xG1.js","assets/FeatureReductionLayer-RlitE1N6.js","assets/OrderedLayer-M7k5gLgx.js","assets/FeatureTemplate-kUgbbA00.js","assets/FeatureType-MpRe7WJj.js","assets/versionUtils-4v9zIDlv.js","assets/TopFeaturesQuery-E6D2tV-x.js","assets/SubtypeGroupLayer-xK5RtU9X.js","assets/executeQueryJSON-ACj9qY0y.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/executeQueryPBF-vdaOUMid.js","assets/AttachmentInfo-kbEMEIl0.js","assets/executeForIds-wXO8-pll.js","assets/featuresetbase-WjFIOCEy.js","assets/featuresetgeom-3-0z5YnY.js","assets/featuresetstats-NfM8OXOZ.js","assets/featuresetstring-bt3R_cQ2.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/arcgis-knowledge-client-core-k0_SaRI-.js b/dist/assets/arcgis-knowledge-client-core-k0_SaRI-.js new file mode 100644 index 0000000..67663df --- /dev/null +++ b/dist/assets/arcgis-knowledge-client-core-k0_SaRI-.js @@ -0,0 +1,3 @@ +import{cg as Ke,g_ as Rr}from"./index-J0iiHjMT.js";function Qe(S,c){for(var z=0;zE[U]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var $e,Yr,ke,Pr={exports:{}};Pr.exports,$e=Pr,Pr.exports,Yr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,ke=function(S){var c,z,E;S=S||{},c||(c=S!==void 0?S:{}),c.ready=new Promise(function(r,e){z=r,E=e});var U=Object.assign({},c),q="./this.program",x="";typeof document<"u"&&document.currentScript&&(x=document.currentScript.src),Yr&&(x=Yr),x=x.indexOf("blob:")!==0?x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var J,Oe=c.print||console.log.bind(console),N=c.printErr||console.warn.bind(console);Object.assign(c,U),U=null,c.thisProgram&&(q=c.thisProgram),c.wasmBinary&&(J=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&K("no native wasm support detected");var Cr,$r,F,_,Y,X,w,y,Hr,Vr,Br,zr,qr=!1,Nr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ur(r,e,n){var t=e+n;for(n=e;r[n]&&!(n>=t);)++n;if(16(a=(240&a)==224?(15&a)<<12|i<<6|f:(7&a)<<18|i<<12|f<<6|63&r[e++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Lr(r,e,n,t){if(0=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),127>=i){if(n>=t)break;e[n++]=i}else{if(2047>=i){if(n+1>=t)break;e[n++]=192|i>>6}else{if(65535>=i){if(n+2>=t)break;e[n++]=224|i>>12}else{if(n+3>=t)break;e[n++]=240|i>>18,e[n++]=128|i>>12&63}e[n++]=128|i>>6&63}e[n++]=128|63&i}}e[n]=0}}function Gr(r){for(var e=0,n=0;n=t?e++:2047>=t?e+=2:55296<=t&&57343>=t?(e+=4,++n):e+=3}return e}function Jr(){var r=Cr.buffer;$r=r,c.HEAP8=F=new Int8Array(r),c.HEAP16=Y=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=_=new Uint8Array(r),c.HEAPU16=X=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Hr=new Float32Array(r),c.HEAPF64=zr=new Float64Array(r),c.HEAP64=Vr=new BigInt64Array(r),c.HEAPU64=Br=new BigUint64Array(r)}var Xr,Zr=[],Kr=[],Qr=[];function Ee(){var r=c.preRun.shift();Zr.unshift(r)}var D,H=0,Z=null;function K(r){throw c.onAbort&&c.onAbort(r),N(r="Aborted("+r+")"),qr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),E(r),r}function re(){return D.startsWith("data:application/octet-stream;base64,")}if(D="arcgis-knowledge-client-core.wasm",!re()){var ee=D;D=c.locateFile?c.locateFile(ee,x):x+ee}function ne(){var r=D;try{if(r==D&&J)return new Uint8Array(J);throw"both async and sync fetching of the wasm failed"}catch(e){K(e)}}function je(){return J||typeof fetch!="function"?Promise.resolve().then(function(){return ne()}):fetch(D,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+D+"'";return r.arrayBuffer()}).catch(function(){return ne()})}function kr(r){for(;0>2]=e},this.Oa=function(e){y[this.fa+8>>2]=e},this.Ua=function(){w[this.fa>>2]=0},this.Ma=function(){F[this.fa+12>>0]=0},this.Va=function(){F[this.fa+13>>0]=0},this.Ia=function(e,n){this.La(),this.Ya(e),this.Oa(n),this.Ua(),this.Ma(),this.Va()},this.La=function(){y[this.fa+16>>2]=0}}var cr={};function fr(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function Q(r){return this.fromWireType(w[r>>2])}var L={},V={},sr={};function te(r){if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+r:r}function Wr(r,e){return r=te(r),function(){return e.apply(this,arguments)}}function Or(r){var e=Error,n=Wr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` +`+t.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var ae=void 0;function lr(r){throw new ae(r)}function $(r,e,n){function t(u){(u=n(u)).length!==r.length&&lr("Mismatched type converter count");for(var l=0;l{V.hasOwnProperty(u)?a[l]=V[u]:(i.push(u),L.hasOwnProperty(u)||(L[u]=[]),L[u].push(()=>{a[l]=V[u],++f===i.length&&t(a)}))}),i.length===0&&t(a)}function rr(r){if(r===null)return"null";var e=typeof r;return e==="object"||e==="array"||e==="function"?r.toString():""+r}var ie=void 0;function b(r){for(var e="";_[r];)e+=ie[_[r++]];return e}var G=void 0;function m(r){throw new G(r)}function k(r,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||m('type "'+t+'" must have a positive integer typeid pointer'),V.hasOwnProperty(r)){if(n.Wa)return;m("Cannot register type '"+t+"' twice")}V[r]=e,delete sr[r],L.hasOwnProperty(r)&&(e=L[r],delete L[r],e.forEach(a=>a()))}function oe(r,e,n){switch(e){case 0:return n?function(t){return F[t]}:function(t){return _[t]};case 1:return n?function(t){return Y[t>>1]}:function(t){return X[t>>1]};case 2:return n?function(t){return w[t>>2]}:function(t){return y[t>>2]};case 3:return n?function(t){return Vr[t>>3]}:function(t){return Br[t>>3]};default:throw new TypeError("Unknown integer type: "+r)}}function er(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function Er(r){m(r.da.ga.ea.name+" instance already deleted")}var jr=!1;function ue(){}function ce(r){--r.count.value,r.count.value===0&&(r.ia?r.ka.na(r.ia):r.ga.ea.na(r.fa))}function fe(r,e,n){return e===n?r:n.la===void 0||(r=fe(r,e,n.la))===null?null:n.Ka(r)}var se={},nr=[];function Sr(){for(;nr.length;){var r=nr.pop();r.da.ta=!1,r.delete()}}var tr=void 0,ar={};function Fe(r,e){for(e===void 0&&m("ptr should not be undefined");r.la;)e=r.va(e),r=r.la;return ar[e]}function hr(r,e){return e.ga&&e.fa||lr("makeClassHandle requires ptr and ptrType"),!!e.ka!=!!e.ia&&lr("Both smartPtrType and smartPtr must be specified"),e.count={value:1},dr(Object.create(r,{da:{value:e}}))}function dr(r){return typeof FinalizationRegistry>"u"?(dr=e=>e,r):(jr=new FinalizationRegistry(e=>{ce(e.da)}),ue=e=>{jr.unregister(e)},(dr=e=>{var n=e.da;return n.ia&&jr.register(e,{da:n},e),e})(r))}function I(){}function Fr(r,e,n){if(r[e].ha===void 0){var t=r[e];r[e]=function(){return r[e].ha.hasOwnProperty(arguments.length)||m("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].ha+")!"),r[e].ha[arguments.length].apply(this,arguments)},r[e].ha=[],r[e].ha[t.sa]=t}}function Dr(r,e,n){c.hasOwnProperty(r)?((n===void 0||c[r].ha!==void 0&&c[r].ha[n]!==void 0)&&m("Cannot register public name '"+r+"' twice"),Fr(c,r,r),c.hasOwnProperty(n)&&m("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),c[r].ha[n]=e):(c[r]=e,n!==void 0&&(c[r].kb=n))}function De(r,e,n,t,a,i,f,u){this.name=r,this.constructor=e,this.oa=n,this.na=t,this.la=a,this.Pa=i,this.va=f,this.Ka=u,this.$a=[]}function pr(r,e,n){for(;e!==n;)e.va||m("Expected null or instance of "+n.name+", got an instance of "+e.name),r=e.va(r),e=e.la;return r}function Me(r,e){return e===null?(this.Aa&&m("null is not a valid "+this.name),0):(e.da||m('Cannot pass "'+rr(e)+'" as a '+this.name),e.da.fa||m("Cannot pass deleted object as a pointer of type "+this.name),pr(e.da.fa,e.da.ga.ea,this.ea))}function Ue(r,e){if(e===null){if(this.Aa&&m("null is not a valid "+this.name),this.xa){var n=this.Ba();return r!==null&&r.push(this.na,n),n}return 0}if(e.da||m('Cannot pass "'+rr(e)+'" as a '+this.name),e.da.fa||m("Cannot pass deleted object as a pointer of type "+this.name),!this.wa&&e.da.ga.wa&&m("Cannot convert argument of type "+(e.da.ka?e.da.ka.name:e.da.ga.name)+" to parameter type "+this.name),n=pr(e.da.fa,e.da.ga.ea,this.ea),this.xa)switch(e.da.ia===void 0&&m("Passing raw pointer to smart pointer is illegal"),this.fb){case 0:e.da.ka===this?n=e.da.ia:m("Cannot convert argument of type "+(e.da.ka?e.da.ka.name:e.da.ga.name)+" to parameter type "+this.name);break;case 1:n=e.da.ia;break;case 2:if(e.da.ka===this)n=e.da.ia;else{var t=e.clone();n=this.ab(n,O(function(){t.delete()})),r!==null&&r.push(this.na,n)}break;default:m("Unsupporting sharing policy")}return n}function xe(r,e){return e===null?(this.Aa&&m("null is not a valid "+this.name),0):(e.da||m('Cannot pass "'+rr(e)+'" as a '+this.name),e.da.fa||m("Cannot pass deleted object as a pointer of type "+this.name),e.da.ga.wa&&m("Cannot convert argument of type "+e.da.ga.name+" to parameter type "+this.name),pr(e.da.fa,e.da.ga.ea,this.ea))}function j(r,e,n,t,a,i,f,u,l,s,h){this.name=r,this.ea=e,this.Aa=n,this.wa=t,this.xa=a,this.Za=i,this.fb=f,this.Ga=u,this.Ba=l,this.ab=s,this.na=h,a||e.la!==void 0?this.toWireType=Ue:(this.toWireType=t?Me:xe,this.ja=null)}function le(r,e,n){c.hasOwnProperty(r)||lr("Replacing nonexistant public symbol"),c[r].ha!==void 0&&n!==void 0?c[r].ha[n]=e:(c[r]=e,c[r].sa=n)}var vr=[];function T(r,e){r=b(r);var n=vr[e];return n||(e>=vr.length&&(vr.length=e+1),vr[e]=n=Xr.get(e)),typeof n!="function"&&m("unknown function pointer with signature "+r+": "+e),n}var he=void 0;function de(r){var e=b(r=_e(r));return M(r),e}function B(r,e){function n(i){a[i]||V[i]||(sr[i]?sr[i].forEach(n):(t.push(i),a[i]=!0))}var t=[],a={};throw e.forEach(n),new he(r+": "+t.map(de).join([", "]))}function gr(r,e,n,t,a){var i=e.length;2>i&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=e[1]!==null&&n!==null,u=!1;for(n=1;n>2]);return n}function pe(r,e,n){return r instanceof Object||m(n+' with invalid "this": '+r),r instanceof e.ea.constructor||m(n+' incompatible with "this" of type '+r.constructor.name),r.da.fa||m("cannot call emscripten binding method "+n+" on deleted object"),pr(r.da.fa,r.da.ga.ea,e.ea)}var Mr=[],W=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ur(r){4(r||m("Cannot use deleted val. handle = "+r),W[r].value),O=r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Mr.length?Mr.pop():W.length;return W[e]={Ca:1,value:r},e}};function Ie(r,e,n){switch(e){case 0:return function(t){return this.fromWireType((n?F:_)[t])};case 1:return function(t){return this.fromWireType((n?Y:X)[t>>1])};case 2:return function(t){return this.fromWireType((n?w:y)[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function ir(r,e){var n=V[r];return n===void 0&&m(e+" has unknown type "+de(r)),n}function Re(r,e){switch(e){case 2:return function(n){return this.fromWireType(Hr[n>>2])};case 3:return function(n){return this.fromWireType(zr[n>>3])};default:throw new TypeError("Unknown float type: "+r)}}var ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Ye(r,e){for(var n=r>>1,t=n+e/2;!(n>=t)&&X[n];)++n;if(32<(n<<=1)-r&&ve)return ve.decode(_.subarray(r,n));for(n="",t=0;!(t>=e/2);++t){var a=Y[r+2*t>>1];if(a==0)break;n+=String.fromCharCode(a)}return n}function He(r,e,n){if(n===void 0&&(n=2147483647),2>n)return 0;var t=e;n=(n-=2)<2*r.length?n/2:r.length;for(var a=0;a>1]=r.charCodeAt(a),e+=2;return Y[e>>1]=0,e-t}function Ve(r){return 2*r.length}function Be(r,e){for(var n=0,t="";!(n>=e/4);){var a=w[r+4*n>>2];if(a==0)break;++n,65536<=a?(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a)):t+=String.fromCharCode(a)}return t}function ze(r,e,n){if(n===void 0&&(n=2147483647),4>n)return 0;var t=e;n=t+n-4;for(var a=0;a=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),w[e>>2]=i,(e+=4)+4>n)break}return w[e>>2]=0,e-t}function qe(r){for(var e=0,n=0;n=t&&++n,e+=4}return e}function ge(r,e){for(var n=Array(r),t=0;t>2],"parameter "+t);return n}var Ne={};function yr(r){var e=Ne[r];return e===void 0?b(r):e}var br=[];function me(){function r(e){e.$$$embind_global$$$=e;var n=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return n||delete e.$$$embind_global$$$,n}if(typeof globalThis=="object")return globalThis;if(typeof $$$embind_global$$$=="object"||(typeof Rr=="object"&&r(Rr)?$$$embind_global$$$=Rr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function Le(r){var e=br.length;return br.push(r),e}var ye=[],xr={};function be(){if(!Ir){var r,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:q||"./this.program"};for(r in xr)xr[r]===void 0?delete e[r]:e[r]=xr[r];var n=[];for(r in e)n.push(r+"="+e[r]);Ir=n}return Ir}var Ir,Ge=[null,[],[]];function wr(r){return r%4==0&&(r%100!=0||r%400==0)}var we=[31,29,31,30,31,30,31,31,30,31,30,31],Ae=[31,28,31,30,31,30,31,31,30,31,30,31];function Je(r){var e=Array(Gr(r)+1);return Lr(r,e,0,e.length),e}function Xe(r,e,n,t){function a(o,d,g){for(o=typeof o=="number"?o.toString():o||"";o.lengthC?-1:0A-o.getDate())){o.setDate(o.getDate()+d);break}d-=A-o.getDate()+1,o.setDate(1),11>g?o.setMonth(g+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1))}return g=new Date(o.getFullYear()+1,0,4),d=u(new Date(o.getFullYear(),0,4)),g=u(g),0>=f(d,o)?0>=f(g,o)?o.getFullYear()+1:o.getFullYear():o.getFullYear()-1}var s=w[t+40>>2];for(var h in t={ib:w[t>>2],hb:w[t+4>>2],ya:w[t+8>>2],Da:w[t+12>>2],za:w[t+16>>2],ra:w[t+20>>2],ma:w[t+24>>2],qa:w[t+28>>2],lb:w[t+32>>2],gb:w[t+36>>2],jb:s&&s?ur(_,s):""},n=n?ur(_,n):"",s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(h,"g"),s[h]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),v="January February March April May June July August September October November December".split(" ");for(h in s={"%a":function(o){return p[o.ma].substring(0,3)},"%A":function(o){return p[o.ma]},"%b":function(o){return v[o.za].substring(0,3)},"%B":function(o){return v[o.za]},"%C":function(o){return i((o.ra+1900)/100|0,2)},"%d":function(o){return i(o.Da,2)},"%e":function(o){return a(o.Da,2," ")},"%g":function(o){return l(o).toString().substring(2)},"%G":function(o){return l(o)},"%H":function(o){return i(o.ya,2)},"%I":function(o){return(o=o.ya)==0?o=12:12o.ya?"AM":"PM"},"%S":function(o){return i(o.ib,2)},"%t":function(){return" "},"%u":function(o){return o.ma||7},"%U":function(o){return i(Math.floor((o.qa+7-o.ma)/7),2)},"%V":function(o){var d=Math.floor((o.qa+7-(o.ma+6)%7)/7);if(2>=(o.ma+371-o.qa-2)%7&&d++,d)d==53&&((g=(o.ma+371-o.qa)%7)==4||g==3&&wr(o.ra)||(d=1));else{d=52;var g=(o.ma+7-o.qa-1)%7;(g==4||g==5&&wr(o.ra%400-1))&&d++}return i(d,2)},"%w":function(o){return o.ma},"%W":function(o){return i(Math.floor((o.qa+7-(o.ma+6)%7)/7),2)},"%y":function(o){return(o.ra+1900).toString().substring(2)},"%Y":function(o){return o.ra+1900},"%z":function(o){var d=0<=(o=o.gb);return o=Math.abs(o)/60,(d?"+":"-")+("0000"+(o/60*100+o%60)).slice(-4)},"%Z":function(o){return o.jb},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),s)n.includes(h)&&(n=n.replace(new RegExp(h,"g"),s[h](t)));return(h=Je(n=n.replace(/\0\0/g,"%"))).length>e?0:(F.set(h,r),h.length-1)}ae=c.InternalError=Or("InternalError");for(var Te=Array(256),Ar=0;256>Ar;++Ar)Te[Ar]=String.fromCharCode(Ar);ie=Te,G=c.BindingError=Or("BindingError"),I.prototype.isAliasOf=function(r){if(!(this instanceof I&&r instanceof I))return!1;var e=this.da.ga.ea,n=this.da.fa,t=r.da.ga.ea;for(r=r.da.fa;e.la;)n=e.va(n),e=e.la;for(;t.la;)r=t.va(r),t=t.la;return e===t&&n===r},I.prototype.clone=function(){if(this.da.fa||Er(this),this.da.ua)return this.da.count.value+=1,this;var r=dr,e=Object,n=e.create,t=Object.getPrototypeOf(this),a=this.da;return(r=r(n.call(e,t,{da:{value:{count:a.count,ta:a.ta,ua:a.ua,fa:a.fa,ga:a.ga,ia:a.ia,ka:a.ka}}}))).da.count.value+=1,r.da.ta=!1,r},I.prototype.delete=function(){this.da.fa||Er(this),this.da.ta&&!this.da.ua&&m("Object already scheduled for deletion"),ue(this),ce(this.da),this.da.ua||(this.da.ia=void 0,this.da.fa=void 0)},I.prototype.isDeleted=function(){return!this.da.fa},I.prototype.deleteLater=function(){return this.da.fa||Er(this),this.da.ta&&!this.da.ua&&m("Object already scheduled for deletion"),nr.push(this),nr.length===1&&tr&&tr(Sr),this.da.ta=!0,this},c.getInheritedInstanceCount=function(){return Object.keys(ar).length},c.getLiveInheritedInstances=function(){var r,e=[];for(r in ar)ar.hasOwnProperty(r)&&e.push(ar[r]);return e},c.flushPendingDeletes=Sr,c.setDelayFunction=function(r){tr=r,nr.length&&tr&&tr(Sr)},j.prototype.Qa=function(r){return this.Ga&&(r=this.Ga(r)),r},j.prototype.Ea=function(r){this.na&&this.na(r)},j.prototype.argPackAdvance=8,j.prototype.readValueFromPointer=Q,j.prototype.deleteObject=function(r){r!==null&&r.delete()},j.prototype.fromWireType=function(r){function e(){return this.xa?hr(this.ea.oa,{ga:this.Za,fa:n,ka:this,ia:r}):hr(this.ea.oa,{ga:this,fa:r})}var n=this.Qa(r);if(!n)return this.Ea(r),null;var t=Fe(this.ea,n);if(t!==void 0)return t.da.count.value===0?(t.da.fa=n,t.da.ia=r,t.clone()):(t=t.clone(),this.Ea(r),t);if(t=this.ea.Pa(n),!(t=se[t]))return e.call(this);t=this.wa?t.Ha:t.pointerType;var a=fe(n,this.ea,t.ea);return a===null?e.call(this):this.xa?hr(t.ea.oa,{ga:t,fa:a,ka:this,ia:r}):hr(t.ea.oa,{ga:t,fa:a})},he=c.UnboundTypeError=Or("UnboundTypeError"),c.count_emval_handles=function(){for(var r=0,e=5;ei.Ta).concat(a.map(i=>i.cb)),i=>{var f={};return a.forEach((u,l)=>{var s=i[l],h=u.Ra,p=u.Sa,v=i[l+a.length],o=u.bb,d=u.eb;f[u.Na]={read:g=>s.fromWireType(h(p,g)),write:(g,A)=>{var C=[];o(d,g,v.toWireType(C,A)),fr(C)}}}),[{name:e.name,fromWireType:function(u){var l,s={};for(l in f)s[l]=f[l].read(u);return t(u),s},toWireType:function(u,l){for(var s in f)if(!(s in l))throw new TypeError('Missing field: "'+s+'"');var h=n();for(s in f)f[s].write(h,l[s]);return u!==null&&u.push(t,h),h},argPackAdvance:8,readValueFromPointer:Q,ja:t}]})},E:function(r,e,n,t,a){e=b(e),n=er(n);var i=e.indexOf("u")!=-1;i&&(a=(1n<<64n)-1n),k(r,{name:e,fromWireType:function(f){return f},toWireType:function(f,u){if(typeof u!="bigint"&&typeof u!="number")throw new TypeError('Cannot convert "'+rr(u)+'" to '+this.name);if(ua)throw new TypeError('Passing a number "'+rr(u)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+t+", "+a+"]!");return u},argPackAdvance:8,readValueFromPointer:oe(e,n,!i),ja:null})},S:function(r,e,n,t,a){var i=er(n);k(r,{name:e=b(e),fromWireType:function(f){return!!f},toWireType:function(f,u){return u?t:a},argPackAdvance:8,readValueFromPointer:function(f){if(n===1)var u=F;else if(n===2)u=Y;else{if(n!==4)throw new TypeError("Unknown boolean type size: "+e);u=w}return this.fromWireType(u[f>>i])},ja:null})},f:function(r,e,n,t,a,i,f,u,l,s,h,p,v){h=b(h),i=T(a,i),u&&(u=T(f,u)),s&&(s=T(l,s)),v=T(p,v);var o=te(h);Dr(o,function(){B("Cannot construct "+h+" due to unbound types",[t])}),$([r,e,n],t?[t]:[],function(d){if(d=d[0],t)var g=d.ea,A=g.oa;else A=I.prototype;d=Wr(o,function(){if(Object.getPrototypeOf(this)!==C)throw new G("Use 'new' to construct "+h);if(R.pa===void 0)throw new G(h+" has no accessible constructor");var Ce=R.pa[arguments.length];if(Ce===void 0)throw new G("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(R.pa).toString()+") parameters instead!");return Ce.apply(this,arguments)});var C=Object.create(A,{constructor:{value:d}});d.prototype=C;var R=new De(h,d,C,v,g,i,u,s);g=new j(h,R,!0,!1,!1),A=new j(h+"*",R,!1,!1,!1);var or=new j(h+" const*",R,!1,!0,!1);return se[r]={pointerType:A,Ha:or},le(o,d),[g,A,or]})},o:function(r,e,n,t,a,i,f){var u=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(l){function s(){B("Cannot call "+h+" due to unbound types",u)}var h=(l=l[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var p=l.ea.constructor;return p[e]===void 0?(s.sa=n-1,p[e]=s):(Fr(p,e,h),p[e].ha[n-1]=s),$([],u,function(v){return v=gr(h,[v[0],null].concat(v.slice(1)),null,i,f),p[e].ha===void 0?(v.sa=n-1,p[e]=v):p[e].ha[n-1]=v,[]}),[]})},i:function(r,e,n,t,a,i){0{B("Cannot construct "+u.name+" due to unbound types",f)},$([],f,function(s){return s.splice(1,0,null),u.ea.pa[e-1]=gr(l,s,null,a,i),[]}),[]})},b:function(r,e,n,t,a,i,f,u){var l=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(s){function h(){B("Cannot call "+p+" due to unbound types",l)}var p=(s=s[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&s.ea.$a.push(e);var v=s.ea.oa,o=v[e];return o===void 0||o.ha===void 0&&o.className!==s.name&&o.sa===n-2?(h.sa=n-2,h.className=s.name,v[e]=h):(Fr(v,e,p),v[e].ha[n-2]=h),$([],l,function(d){return d=gr(p,d,s,i,f),v[e].ha===void 0?(d.sa=n-2,v[e]=d):v[e].ha[n-2]=d,[]}),[]})},c:function(r,e,n,t,a,i,f,u,l,s){e=b(e),a=T(t,a),$([],[r],function(h){var p=(h=h[0]).name+"."+e,v={get:function(){B("Cannot access "+p+" due to unbound types",[n,f])},enumerable:!0,configurable:!0};return v.set=l?()=>{B("Cannot access "+p+" due to unbound types",[n,f])}:()=>{m(p+" is a read-only property")},Object.defineProperty(h.ea.oa,e,v),$([],l?[n,f]:[n],function(o){var d=o[0],g={get:function(){var C=pe(this,h,p+" getter");return d.fromWireType(a(i,C))},enumerable:!0};if(l){l=T(u,l);var A=o[1];g.set=function(C){var R=pe(this,h,p+" setter"),or=[];l(s,R,A.toWireType(or,C)),fr(or)}}return Object.defineProperty(h.ea.oa,e,g),[]}),[]})},R:function(r,e){k(r,{name:e=b(e),fromWireType:function(n){var t=P(n);return Ur(n),t},toWireType:function(n,t){return O(t)},argPackAdvance:8,readValueFromPointer:Q,ja:null})},s:function(r,e,n,t){function a(){}n=er(n),e=b(e),a.values={},k(r,{name:e,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:function(i,f){return f.value},argPackAdvance:8,readValueFromPointer:Ie(e,n,t),ja:null}),Dr(e,a)},e:function(r,e,n){var t=ir(r,"enum");e=b(e),r=t.constructor,t=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:Wr(t.name+"_"+e,function(){})}}),r.values[n]=t,r[e]=t},D:function(r,e,n){n=er(n),k(r,{name:e=b(e),fromWireType:function(t){return t},toWireType:function(t,a){return a},argPackAdvance:8,readValueFromPointer:Re(e,n),ja:null})},V:function(r,e,n,t,a,i){var f=mr(e,n);r=b(r),a=T(t,a),Dr(r,function(){B("Cannot call "+r+" due to unbound types",f)},e-1),$([],f,function(u){return le(r,gr(r,[u[0],null].concat(u.slice(1)),null,a,i),e-1),[]})},w:function(r,e,n,t,a){e=b(e),a===-1&&(a=4294967295),a=er(n);var i=u=>u;if(t===0){var f=32-8*n;i=u=>u<>>f}n=e.includes("unsigned")?function(u,l){return l>>>0}:function(u,l){return l},k(r,{name:e,fromWireType:i,toWireType:n,argPackAdvance:8,readValueFromPointer:oe(e,a,t!==0),ja:null})},q:function(r,e,n){function t(i){var f=y;return new a($r,f[1+(i>>=2)],f[i])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];k(r,{name:n=b(n),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{Wa:!0})},h:function(r,e,n,t,a,i,f,u,l,s,h,p){n=b(n),i=T(a,i),u=T(f,u),s=T(l,s),p=T(h,p),$([r],[e],function(v){return v=v[0],[new j(n,v.ea,!1,!1,!0,v,t,i,u,s,p)]})},F:function(r,e){var n=(e=b(e))==="std::string";k(r,{name:e,fromWireType:function(t){var a=y[t>>2],i=t+4;if(n)for(var f=i,u=0;u<=a;++u){var l=i+u;if(u==a||_[l]==0){if(f=f?ur(_,f,l-f):"",s===void 0)var s=f;else s+="\0",s+=f;f=l+1}}else{for(s=Array(a),u=0;u>2]=f,n&&i)Lr(a,_,l,f+1);else if(i)for(i=0;iX,u=1;else e===4&&(t=Be,a=ze,i=qe,f=()=>y,u=2);k(r,{name:n,fromWireType:function(l){for(var s,h=y[l>>2],p=f(),v=l+4,o=0;o<=h;++o){var d=l+4+o*e;o!=h&&p[d>>u]!=0||(v=t(v,d-v),s===void 0?s=v:(s+="\0",s+=v),v=d+e)}return M(l),s},toWireType:function(l,s){typeof s!="string"&&m("Cannot pass non-string to C++ string type "+n);var h=i(s),p=_r(4+h+e);return y[p>>2]=h>>u,a(s,p+4,h+e),l!==null&&l.push(M,p),p},argPackAdvance:8,readValueFromPointer:Q,ja:function(l){M(l)}})},v:function(r,e,n,t,a,i){cr[r]={name:b(e),Ba:T(n,t),na:T(a,i),Fa:[]}},l:function(r,e,n,t,a,i,f,u,l,s){cr[r].Fa.push({Na:b(e),Ta:n,Ra:T(t,a),Sa:i,cb:f,bb:T(u,l),eb:s})},T:function(r,e){k(r,{Xa:!0,name:e=b(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},k:function(r,e,n){r=P(r),e=ir(e,"emval::as");var t=[],a=O(t);return y[n>>2]=a,e.toWireType(t,r)},z:function(r,e){return r=P(r),(e=ir(e,"emval::as")).toWireType(null,r)},W:function(r,e,n,t){r=P(r),n=ge(e,n);for(var a=Array(e),i=0;i>2]=O(i),r(e,n,i,a)},G:function(r,e,n,t){(r=br[r])(e=P(e),n=yr(n),null,t)},a:Ur,H:function(r){return r===0?O(me()):(r=yr(r),O(me()[r]))},B:function(r,e){var n=ge(r,e),t=n[0];e=t.name+"_$"+n.slice(1).map(function(f){return f.name}).join("_")+"$";var a=ye[e];if(a!==void 0)return a;var i=Array(r-1);return a=Le((f,u,l,s)=>{for(var h=0,p=0;p>>=0))return!1;for(var n=1;4>=n;n*=2){var t=e*(1+.2/n);t=Math.min(t,r+100663296);var a=Math;t=Math.max(r,t),a=a.min.call(a,2147483648,t+(65536-t%65536)%65536);r:{try{Cr.grow(a-$r.byteLength+65535>>>16),Jr();var i=1;break r}catch{}i=void 0}if(i)return!0}return!1},K:function(r,e){var n=0;return be().forEach(function(t,a){var i=e+n;for(a=y[r+4*a>>2]=i,i=0;i>0]=t.charCodeAt(i);F[a>>0]=0,n+=t.length+1}),0},L:function(r,e){var n=be();y[r>>2]=n.length;var t=0;return n.forEach(function(a){t+=a.length+1}),y[e>>2]=t,0},Q:function(){return 52},P:function(){return 70},O:function(r,e,n,t){for(var a=0,i=0;i>2],u=y[e+4>>2];e+=8;for(var l=0;l>2]=a,0},J:function(r,e,n,t){return Xe(r,e,n,t)}};(function(){function r(a){c.asm=a.exports,Cr=c.asm.X,Jr(),Xr=c.asm.ba,Kr.unshift(c.asm.Y),H--,c.monitorRunDependencies&&c.monitorRunDependencies(H),H==0&&Z&&(a=Z,Z=null,a())}function e(a){r(a.instance)}function n(a){return je().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(a,function(i){N("failed to asynchronously prepare wasm: "+i),K(i)})}var t={a:Ze};if(H++,c.monitorRunDependencies&&c.monitorRunDependencies(H),c.instantiateWasm)try{return c.instantiateWasm(t,r)}catch(a){N("Module.instantiateWasm callback failed with error: "+a),E(a)}(J||typeof WebAssembly.instantiateStreaming!="function"||re()||typeof fetch!="function"?n(e):fetch(D,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(e,function(i){return N("wasm streaming compile failed: "+i),N("falling back to ArrayBuffer instantiation"),n(e)})})).catch(E)})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.Y).apply(null,arguments)};var Tr,_r=c._malloc=function(){return(_r=c._malloc=c.asm.Z).apply(null,arguments)},M=c._free=function(){return(M=c._free=c.asm._).apply(null,arguments)},_e=c.___getTypeName=function(){return(_e=c.___getTypeName=c.asm.$).apply(null,arguments)};function Pe(){function r(){if(!Tr&&(Tr=!0,c.calledRun=!0,!qr)){if(kr(Kr),z(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var e=c.postRun.shift();Qr.unshift(e)}kr(Qr)}}if(!(0E[U]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var $e,Yr,ke,Pr={exports:{}};Pr.exports,$e=Pr,Pr.exports,Yr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,ke=function(S){var c,z,E;S=S||{},c||(c=S!==void 0?S:{}),c.ready=new Promise(function(r,e){z=r,E=e});var U=Object.assign({},c),q="./this.program",x="";typeof document<"u"&&document.currentScript&&(x=document.currentScript.src),Yr&&(x=Yr),x=x.indexOf("blob:")!==0?x.substr(0,x.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var J,Oe=c.print||console.log.bind(console),N=c.printErr||console.warn.bind(console);Object.assign(c,U),U=null,c.thisProgram&&(q=c.thisProgram),c.wasmBinary&&(J=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&K("no native wasm support detected");var Cr,$r,F,_,Y,X,w,y,Hr,Vr,Br,zr,qr=!1,Nr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ur(r,e,n){var t=e+n;for(n=e;r[n]&&!(n>=t);)++n;if(16(a=(240&a)==224?(15&a)<<12|i<<6|f:(7&a)<<18|i<<12|f<<6|63&r[e++])?t+=String.fromCharCode(a):(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else t+=String.fromCharCode(a)}return t}function Lr(r,e,n,t){if(0=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),127>=i){if(n>=t)break;e[n++]=i}else{if(2047>=i){if(n+1>=t)break;e[n++]=192|i>>6}else{if(65535>=i){if(n+2>=t)break;e[n++]=224|i>>12}else{if(n+3>=t)break;e[n++]=240|i>>18,e[n++]=128|i>>12&63}e[n++]=128|i>>6&63}e[n++]=128|63&i}}e[n]=0}}function Gr(r){for(var e=0,n=0;n=t?e++:2047>=t?e+=2:55296<=t&&57343>=t?(e+=4,++n):e+=3}return e}function Jr(){var r=Cr.buffer;$r=r,c.HEAP8=F=new Int8Array(r),c.HEAP16=Y=new Int16Array(r),c.HEAP32=w=new Int32Array(r),c.HEAPU8=_=new Uint8Array(r),c.HEAPU16=X=new Uint16Array(r),c.HEAPU32=y=new Uint32Array(r),c.HEAPF32=Hr=new Float32Array(r),c.HEAPF64=zr=new Float64Array(r),c.HEAP64=Vr=new BigInt64Array(r),c.HEAPU64=Br=new BigUint64Array(r)}var Xr,Zr=[],Kr=[],Qr=[];function Ee(){var r=c.preRun.shift();Zr.unshift(r)}var D,H=0,Z=null;function K(r){throw c.onAbort&&c.onAbort(r),N(r="Aborted("+r+")"),qr=!0,r=new WebAssembly.RuntimeError(r+". Build with -sASSERTIONS for more info."),E(r),r}function re(){return D.startsWith("data:application/octet-stream;base64,")}if(D="arcgis-knowledge-client-core-simd.wasm",!re()){var ee=D;D=c.locateFile?c.locateFile(ee,x):x+ee}function ne(){var r=D;try{if(r==D&&J)return new Uint8Array(J);throw"both async and sync fetching of the wasm failed"}catch(e){K(e)}}function je(){return J||typeof fetch!="function"?Promise.resolve().then(function(){return ne()}):fetch(D,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+D+"'";return r.arrayBuffer()}).catch(function(){return ne()})}function kr(r){for(;0>2]=e},this.Oa=function(e){y[this.fa+8>>2]=e},this.Ua=function(){w[this.fa>>2]=0},this.Ma=function(){F[this.fa+12>>0]=0},this.Va=function(){F[this.fa+13>>0]=0},this.Ia=function(e,n){this.La(),this.Ya(e),this.Oa(n),this.Ua(),this.Ma(),this.Va()},this.La=function(){y[this.fa+16>>2]=0}}var cr={};function fr(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function Q(r){return this.fromWireType(w[r>>2])}var L={},V={},sr={};function te(r){if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=e&&57>=e?"_"+r:r}function Wr(r,e){return r=te(r),function(){return e.apply(this,arguments)}}function Or(r){var e=Error,n=Wr(r,function(t){this.name=r,this.message=t,(t=Error(t).stack)!==void 0&&(this.stack=this.toString()+` +`+t.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var ae=void 0;function lr(r){throw new ae(r)}function $(r,e,n){function t(u){(u=n(u)).length!==r.length&&lr("Mismatched type converter count");for(var l=0;l{V.hasOwnProperty(u)?a[l]=V[u]:(i.push(u),L.hasOwnProperty(u)||(L[u]=[]),L[u].push(()=>{a[l]=V[u],++f===i.length&&t(a)}))}),i.length===0&&t(a)}function rr(r){if(r===null)return"null";var e=typeof r;return e==="object"||e==="array"||e==="function"?r.toString():""+r}var ie=void 0;function b(r){for(var e="";_[r];)e+=ie[_[r++]];return e}var G=void 0;function m(r){throw new G(r)}function k(r,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||m('type "'+t+'" must have a positive integer typeid pointer'),V.hasOwnProperty(r)){if(n.Wa)return;m("Cannot register type '"+t+"' twice")}V[r]=e,delete sr[r],L.hasOwnProperty(r)&&(e=L[r],delete L[r],e.forEach(a=>a()))}function oe(r,e,n){switch(e){case 0:return n?function(t){return F[t]}:function(t){return _[t]};case 1:return n?function(t){return Y[t>>1]}:function(t){return X[t>>1]};case 2:return n?function(t){return w[t>>2]}:function(t){return y[t>>2]};case 3:return n?function(t){return Vr[t>>3]}:function(t){return Br[t>>3]};default:throw new TypeError("Unknown integer type: "+r)}}function er(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function Er(r){m(r.da.ga.ea.name+" instance already deleted")}var jr=!1;function ue(){}function ce(r){--r.count.value,r.count.value===0&&(r.ia?r.ka.na(r.ia):r.ga.ea.na(r.fa))}function fe(r,e,n){return e===n?r:n.la===void 0||(r=fe(r,e,n.la))===null?null:n.Ka(r)}var se={},nr=[];function Sr(){for(;nr.length;){var r=nr.pop();r.da.ta=!1,r.delete()}}var tr=void 0,ar={};function Fe(r,e){for(e===void 0&&m("ptr should not be undefined");r.la;)e=r.va(e),r=r.la;return ar[e]}function hr(r,e){return e.ga&&e.fa||lr("makeClassHandle requires ptr and ptrType"),!!e.ka!=!!e.ia&&lr("Both smartPtrType and smartPtr must be specified"),e.count={value:1},dr(Object.create(r,{da:{value:e}}))}function dr(r){return typeof FinalizationRegistry>"u"?(dr=e=>e,r):(jr=new FinalizationRegistry(e=>{ce(e.da)}),ue=e=>{jr.unregister(e)},(dr=e=>{var n=e.da;return n.ia&&jr.register(e,{da:n},e),e})(r))}function I(){}function Fr(r,e,n){if(r[e].ha===void 0){var t=r[e];r[e]=function(){return r[e].ha.hasOwnProperty(arguments.length)||m("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].ha+")!"),r[e].ha[arguments.length].apply(this,arguments)},r[e].ha=[],r[e].ha[t.sa]=t}}function Dr(r,e,n){c.hasOwnProperty(r)?((n===void 0||c[r].ha!==void 0&&c[r].ha[n]!==void 0)&&m("Cannot register public name '"+r+"' twice"),Fr(c,r,r),c.hasOwnProperty(n)&&m("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),c[r].ha[n]=e):(c[r]=e,n!==void 0&&(c[r].kb=n))}function De(r,e,n,t,a,i,f,u){this.name=r,this.constructor=e,this.oa=n,this.na=t,this.la=a,this.Pa=i,this.va=f,this.Ka=u,this.$a=[]}function pr(r,e,n){for(;e!==n;)e.va||m("Expected null or instance of "+n.name+", got an instance of "+e.name),r=e.va(r),e=e.la;return r}function Me(r,e){return e===null?(this.Aa&&m("null is not a valid "+this.name),0):(e.da||m('Cannot pass "'+rr(e)+'" as a '+this.name),e.da.fa||m("Cannot pass deleted object as a pointer of type "+this.name),pr(e.da.fa,e.da.ga.ea,this.ea))}function Ue(r,e){if(e===null){if(this.Aa&&m("null is not a valid "+this.name),this.xa){var n=this.Ba();return r!==null&&r.push(this.na,n),n}return 0}if(e.da||m('Cannot pass "'+rr(e)+'" as a '+this.name),e.da.fa||m("Cannot pass deleted object as a pointer of type "+this.name),!this.wa&&e.da.ga.wa&&m("Cannot convert argument of type "+(e.da.ka?e.da.ka.name:e.da.ga.name)+" to parameter type "+this.name),n=pr(e.da.fa,e.da.ga.ea,this.ea),this.xa)switch(e.da.ia===void 0&&m("Passing raw pointer to smart pointer is illegal"),this.fb){case 0:e.da.ka===this?n=e.da.ia:m("Cannot convert argument of type "+(e.da.ka?e.da.ka.name:e.da.ga.name)+" to parameter type "+this.name);break;case 1:n=e.da.ia;break;case 2:if(e.da.ka===this)n=e.da.ia;else{var t=e.clone();n=this.ab(n,O(function(){t.delete()})),r!==null&&r.push(this.na,n)}break;default:m("Unsupporting sharing policy")}return n}function xe(r,e){return e===null?(this.Aa&&m("null is not a valid "+this.name),0):(e.da||m('Cannot pass "'+rr(e)+'" as a '+this.name),e.da.fa||m("Cannot pass deleted object as a pointer of type "+this.name),e.da.ga.wa&&m("Cannot convert argument of type "+e.da.ga.name+" to parameter type "+this.name),pr(e.da.fa,e.da.ga.ea,this.ea))}function j(r,e,n,t,a,i,f,u,l,s,h){this.name=r,this.ea=e,this.Aa=n,this.wa=t,this.xa=a,this.Za=i,this.fb=f,this.Ga=u,this.Ba=l,this.ab=s,this.na=h,a||e.la!==void 0?this.toWireType=Ue:(this.toWireType=t?Me:xe,this.ja=null)}function le(r,e,n){c.hasOwnProperty(r)||lr("Replacing nonexistant public symbol"),c[r].ha!==void 0&&n!==void 0?c[r].ha[n]=e:(c[r]=e,c[r].sa=n)}var vr=[];function T(r,e){r=b(r);var n=vr[e];return n||(e>=vr.length&&(vr.length=e+1),vr[e]=n=Xr.get(e)),typeof n!="function"&&m("unknown function pointer with signature "+r+": "+e),n}var he=void 0;function de(r){var e=b(r=_e(r));return M(r),e}function B(r,e){function n(i){a[i]||V[i]||(sr[i]?sr[i].forEach(n):(t.push(i),a[i]=!0))}var t=[],a={};throw e.forEach(n),new he(r+": "+t.map(de).join([", "]))}function gr(r,e,n,t,a){var i=e.length;2>i&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");var f=e[1]!==null&&n!==null,u=!1;for(n=1;n>2]);return n}function pe(r,e,n){return r instanceof Object||m(n+' with invalid "this": '+r),r instanceof e.ea.constructor||m(n+' incompatible with "this" of type '+r.constructor.name),r.da.fa||m("cannot call emscripten binding method "+n+" on deleted object"),pr(r.da.fa,r.da.ga.ea,e.ea)}var Mr=[],W=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Ur(r){4(r||m("Cannot use deleted val. handle = "+r),W[r].value),O=r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Mr.length?Mr.pop():W.length;return W[e]={Ca:1,value:r},e}};function Ie(r,e,n){switch(e){case 0:return function(t){return this.fromWireType((n?F:_)[t])};case 1:return function(t){return this.fromWireType((n?Y:X)[t>>1])};case 2:return function(t){return this.fromWireType((n?w:y)[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function ir(r,e){var n=V[r];return n===void 0&&m(e+" has unknown type "+de(r)),n}function Re(r,e){switch(e){case 2:return function(n){return this.fromWireType(Hr[n>>2])};case 3:return function(n){return this.fromWireType(zr[n>>3])};default:throw new TypeError("Unknown float type: "+r)}}var ve=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function Ye(r,e){for(var n=r>>1,t=n+e/2;!(n>=t)&&X[n];)++n;if(32<(n<<=1)-r&&ve)return ve.decode(_.subarray(r,n));for(n="",t=0;!(t>=e/2);++t){var a=Y[r+2*t>>1];if(a==0)break;n+=String.fromCharCode(a)}return n}function He(r,e,n){if(n===void 0&&(n=2147483647),2>n)return 0;var t=e;n=(n-=2)<2*r.length?n/2:r.length;for(var a=0;a>1]=r.charCodeAt(a),e+=2;return Y[e>>1]=0,e-t}function Ve(r){return 2*r.length}function Be(r,e){for(var n=0,t="";!(n>=e/4);){var a=w[r+4*n>>2];if(a==0)break;++n,65536<=a?(a-=65536,t+=String.fromCharCode(55296|a>>10,56320|1023&a)):t+=String.fromCharCode(a)}return t}function ze(r,e,n){if(n===void 0&&(n=2147483647),4>n)return 0;var t=e;n=t+n-4;for(var a=0;a=i&&(i=65536+((1023&i)<<10)|1023&r.charCodeAt(++a)),w[e>>2]=i,(e+=4)+4>n)break}return w[e>>2]=0,e-t}function qe(r){for(var e=0,n=0;n=t&&++n,e+=4}return e}function ge(r,e){for(var n=Array(r),t=0;t>2],"parameter "+t);return n}var Ne={};function yr(r){var e=Ne[r];return e===void 0?b(r):e}var br=[];function me(){function r(e){e.$$$embind_global$$$=e;var n=typeof $$$embind_global$$$=="object"&&e.$$$embind_global$$$==e;return n||delete e.$$$embind_global$$$,n}if(typeof globalThis=="object")return globalThis;if(typeof $$$embind_global$$$=="object"||(typeof Rr=="object"&&r(Rr)?$$$embind_global$$$=Rr:typeof self=="object"&&r(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function Le(r){var e=br.length;return br.push(r),e}var ye=[],xr={};function be(){if(!Ir){var r,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:q||"./this.program"};for(r in xr)xr[r]===void 0?delete e[r]:e[r]=xr[r];var n=[];for(r in e)n.push(r+"="+e[r]);Ir=n}return Ir}var Ir,Ge=[null,[],[]];function wr(r){return r%4==0&&(r%100!=0||r%400==0)}var we=[31,29,31,30,31,30,31,31,30,31,30,31],Ae=[31,28,31,30,31,30,31,31,30,31,30,31];function Je(r){var e=Array(Gr(r)+1);return Lr(r,e,0,e.length),e}function Xe(r,e,n,t){function a(o,d,g){for(o=typeof o=="number"?o.toString():o||"";o.lengthC?-1:0A-o.getDate())){o.setDate(o.getDate()+d);break}d-=A-o.getDate()+1,o.setDate(1),11>g?o.setMonth(g+1):(o.setMonth(0),o.setFullYear(o.getFullYear()+1))}return g=new Date(o.getFullYear()+1,0,4),d=u(new Date(o.getFullYear(),0,4)),g=u(g),0>=f(d,o)?0>=f(g,o)?o.getFullYear()+1:o.getFullYear():o.getFullYear()-1}var s=w[t+40>>2];for(var h in t={ib:w[t>>2],hb:w[t+4>>2],ya:w[t+8>>2],Da:w[t+12>>2],za:w[t+16>>2],ra:w[t+20>>2],ma:w[t+24>>2],qa:w[t+28>>2],lb:w[t+32>>2],gb:w[t+36>>2],jb:s&&s?ur(_,s):""},n=n?ur(_,n):"",s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(h,"g"),s[h]);var p="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),v="January February March April May June July August September October November December".split(" ");for(h in s={"%a":function(o){return p[o.ma].substring(0,3)},"%A":function(o){return p[o.ma]},"%b":function(o){return v[o.za].substring(0,3)},"%B":function(o){return v[o.za]},"%C":function(o){return i((o.ra+1900)/100|0,2)},"%d":function(o){return i(o.Da,2)},"%e":function(o){return a(o.Da,2," ")},"%g":function(o){return l(o).toString().substring(2)},"%G":function(o){return l(o)},"%H":function(o){return i(o.ya,2)},"%I":function(o){return(o=o.ya)==0?o=12:12o.ya?"AM":"PM"},"%S":function(o){return i(o.ib,2)},"%t":function(){return" "},"%u":function(o){return o.ma||7},"%U":function(o){return i(Math.floor((o.qa+7-o.ma)/7),2)},"%V":function(o){var d=Math.floor((o.qa+7-(o.ma+6)%7)/7);if(2>=(o.ma+371-o.qa-2)%7&&d++,d)d==53&&((g=(o.ma+371-o.qa)%7)==4||g==3&&wr(o.ra)||(d=1));else{d=52;var g=(o.ma+7-o.qa-1)%7;(g==4||g==5&&wr(o.ra%400-1))&&d++}return i(d,2)},"%w":function(o){return o.ma},"%W":function(o){return i(Math.floor((o.qa+7-(o.ma+6)%7)/7),2)},"%y":function(o){return(o.ra+1900).toString().substring(2)},"%Y":function(o){return o.ra+1900},"%z":function(o){var d=0<=(o=o.gb);return o=Math.abs(o)/60,(d?"+":"-")+("0000"+(o/60*100+o%60)).slice(-4)},"%Z":function(o){return o.jb},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),s)n.includes(h)&&(n=n.replace(new RegExp(h,"g"),s[h](t)));return(h=Je(n=n.replace(/\0\0/g,"%"))).length>e?0:(F.set(h,r),h.length-1)}ae=c.InternalError=Or("InternalError");for(var Te=Array(256),Ar=0;256>Ar;++Ar)Te[Ar]=String.fromCharCode(Ar);ie=Te,G=c.BindingError=Or("BindingError"),I.prototype.isAliasOf=function(r){if(!(this instanceof I&&r instanceof I))return!1;var e=this.da.ga.ea,n=this.da.fa,t=r.da.ga.ea;for(r=r.da.fa;e.la;)n=e.va(n),e=e.la;for(;t.la;)r=t.va(r),t=t.la;return e===t&&n===r},I.prototype.clone=function(){if(this.da.fa||Er(this),this.da.ua)return this.da.count.value+=1,this;var r=dr,e=Object,n=e.create,t=Object.getPrototypeOf(this),a=this.da;return(r=r(n.call(e,t,{da:{value:{count:a.count,ta:a.ta,ua:a.ua,fa:a.fa,ga:a.ga,ia:a.ia,ka:a.ka}}}))).da.count.value+=1,r.da.ta=!1,r},I.prototype.delete=function(){this.da.fa||Er(this),this.da.ta&&!this.da.ua&&m("Object already scheduled for deletion"),ue(this),ce(this.da),this.da.ua||(this.da.ia=void 0,this.da.fa=void 0)},I.prototype.isDeleted=function(){return!this.da.fa},I.prototype.deleteLater=function(){return this.da.fa||Er(this),this.da.ta&&!this.da.ua&&m("Object already scheduled for deletion"),nr.push(this),nr.length===1&&tr&&tr(Sr),this.da.ta=!0,this},c.getInheritedInstanceCount=function(){return Object.keys(ar).length},c.getLiveInheritedInstances=function(){var r,e=[];for(r in ar)ar.hasOwnProperty(r)&&e.push(ar[r]);return e},c.flushPendingDeletes=Sr,c.setDelayFunction=function(r){tr=r,nr.length&&tr&&tr(Sr)},j.prototype.Qa=function(r){return this.Ga&&(r=this.Ga(r)),r},j.prototype.Ea=function(r){this.na&&this.na(r)},j.prototype.argPackAdvance=8,j.prototype.readValueFromPointer=Q,j.prototype.deleteObject=function(r){r!==null&&r.delete()},j.prototype.fromWireType=function(r){function e(){return this.xa?hr(this.ea.oa,{ga:this.Za,fa:n,ka:this,ia:r}):hr(this.ea.oa,{ga:this,fa:r})}var n=this.Qa(r);if(!n)return this.Ea(r),null;var t=Fe(this.ea,n);if(t!==void 0)return t.da.count.value===0?(t.da.fa=n,t.da.ia=r,t.clone()):(t=t.clone(),this.Ea(r),t);if(t=this.ea.Pa(n),!(t=se[t]))return e.call(this);t=this.wa?t.Ha:t.pointerType;var a=fe(n,this.ea,t.ea);return a===null?e.call(this):this.xa?hr(t.ea.oa,{ga:t,fa:a,ka:this,ia:r}):hr(t.ea.oa,{ga:t,fa:a})},he=c.UnboundTypeError=Or("UnboundTypeError"),c.count_emval_handles=function(){for(var r=0,e=5;ei.Ta).concat(a.map(i=>i.cb)),i=>{var f={};return a.forEach((u,l)=>{var s=i[l],h=u.Ra,p=u.Sa,v=i[l+a.length],o=u.bb,d=u.eb;f[u.Na]={read:g=>s.fromWireType(h(p,g)),write:(g,A)=>{var C=[];o(d,g,v.toWireType(C,A)),fr(C)}}}),[{name:e.name,fromWireType:function(u){var l,s={};for(l in f)s[l]=f[l].read(u);return t(u),s},toWireType:function(u,l){for(var s in f)if(!(s in l))throw new TypeError('Missing field: "'+s+'"');var h=n();for(s in f)f[s].write(h,l[s]);return u!==null&&u.push(t,h),h},argPackAdvance:8,readValueFromPointer:Q,ja:t}]})},E:function(r,e,n,t,a){e=b(e),n=er(n);var i=e.indexOf("u")!=-1;i&&(a=(1n<<64n)-1n),k(r,{name:e,fromWireType:function(f){return f},toWireType:function(f,u){if(typeof u!="bigint"&&typeof u!="number")throw new TypeError('Cannot convert "'+rr(u)+'" to '+this.name);if(ua)throw new TypeError('Passing a number "'+rr(u)+'" from JS side to C/C++ side to an argument of type "'+e+'", which is outside the valid range ['+t+", "+a+"]!");return u},argPackAdvance:8,readValueFromPointer:oe(e,n,!i),ja:null})},S:function(r,e,n,t,a){var i=er(n);k(r,{name:e=b(e),fromWireType:function(f){return!!f},toWireType:function(f,u){return u?t:a},argPackAdvance:8,readValueFromPointer:function(f){if(n===1)var u=F;else if(n===2)u=Y;else{if(n!==4)throw new TypeError("Unknown boolean type size: "+e);u=w}return this.fromWireType(u[f>>i])},ja:null})},f:function(r,e,n,t,a,i,f,u,l,s,h,p,v){h=b(h),i=T(a,i),u&&(u=T(f,u)),s&&(s=T(l,s)),v=T(p,v);var o=te(h);Dr(o,function(){B("Cannot construct "+h+" due to unbound types",[t])}),$([r,e,n],t?[t]:[],function(d){if(d=d[0],t)var g=d.ea,A=g.oa;else A=I.prototype;d=Wr(o,function(){if(Object.getPrototypeOf(this)!==C)throw new G("Use 'new' to construct "+h);if(R.pa===void 0)throw new G(h+" has no accessible constructor");var Ce=R.pa[arguments.length];if(Ce===void 0)throw new G("Tried to invoke ctor of "+h+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(R.pa).toString()+") parameters instead!");return Ce.apply(this,arguments)});var C=Object.create(A,{constructor:{value:d}});d.prototype=C;var R=new De(h,d,C,v,g,i,u,s);g=new j(h,R,!0,!1,!1),A=new j(h+"*",R,!1,!1,!1);var or=new j(h+" const*",R,!1,!0,!1);return se[r]={pointerType:A,Ha:or},le(o,d),[g,A,or]})},o:function(r,e,n,t,a,i,f){var u=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(l){function s(){B("Cannot call "+h+" due to unbound types",u)}var h=(l=l[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]);var p=l.ea.constructor;return p[e]===void 0?(s.sa=n-1,p[e]=s):(Fr(p,e,h),p[e].ha[n-1]=s),$([],u,function(v){return v=gr(h,[v[0],null].concat(v.slice(1)),null,i,f),p[e].ha===void 0?(v.sa=n-1,p[e]=v):p[e].ha[n-1]=v,[]}),[]})},i:function(r,e,n,t,a,i){0{B("Cannot construct "+u.name+" due to unbound types",f)},$([],f,function(s){return s.splice(1,0,null),u.ea.pa[e-1]=gr(l,s,null,a,i),[]}),[]})},b:function(r,e,n,t,a,i,f,u){var l=mr(n,t);e=b(e),i=T(a,i),$([],[r],function(s){function h(){B("Cannot call "+p+" due to unbound types",l)}var p=(s=s[0]).name+"."+e;e.startsWith("@@")&&(e=Symbol[e.substring(2)]),u&&s.ea.$a.push(e);var v=s.ea.oa,o=v[e];return o===void 0||o.ha===void 0&&o.className!==s.name&&o.sa===n-2?(h.sa=n-2,h.className=s.name,v[e]=h):(Fr(v,e,p),v[e].ha[n-2]=h),$([],l,function(d){return d=gr(p,d,s,i,f),v[e].ha===void 0?(d.sa=n-2,v[e]=d):v[e].ha[n-2]=d,[]}),[]})},c:function(r,e,n,t,a,i,f,u,l,s){e=b(e),a=T(t,a),$([],[r],function(h){var p=(h=h[0]).name+"."+e,v={get:function(){B("Cannot access "+p+" due to unbound types",[n,f])},enumerable:!0,configurable:!0};return v.set=l?()=>{B("Cannot access "+p+" due to unbound types",[n,f])}:()=>{m(p+" is a read-only property")},Object.defineProperty(h.ea.oa,e,v),$([],l?[n,f]:[n],function(o){var d=o[0],g={get:function(){var C=pe(this,h,p+" getter");return d.fromWireType(a(i,C))},enumerable:!0};if(l){l=T(u,l);var A=o[1];g.set=function(C){var R=pe(this,h,p+" setter"),or=[];l(s,R,A.toWireType(or,C)),fr(or)}}return Object.defineProperty(h.ea.oa,e,g),[]}),[]})},R:function(r,e){k(r,{name:e=b(e),fromWireType:function(n){var t=P(n);return Ur(n),t},toWireType:function(n,t){return O(t)},argPackAdvance:8,readValueFromPointer:Q,ja:null})},s:function(r,e,n,t){function a(){}n=er(n),e=b(e),a.values={},k(r,{name:e,constructor:a,fromWireType:function(i){return this.constructor.values[i]},toWireType:function(i,f){return f.value},argPackAdvance:8,readValueFromPointer:Ie(e,n,t),ja:null}),Dr(e,a)},e:function(r,e,n){var t=ir(r,"enum");e=b(e),r=t.constructor,t=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:Wr(t.name+"_"+e,function(){})}}),r.values[n]=t,r[e]=t},D:function(r,e,n){n=er(n),k(r,{name:e=b(e),fromWireType:function(t){return t},toWireType:function(t,a){return a},argPackAdvance:8,readValueFromPointer:Re(e,n),ja:null})},V:function(r,e,n,t,a,i){var f=mr(e,n);r=b(r),a=T(t,a),Dr(r,function(){B("Cannot call "+r+" due to unbound types",f)},e-1),$([],f,function(u){return le(r,gr(r,[u[0],null].concat(u.slice(1)),null,a,i),e-1),[]})},w:function(r,e,n,t,a){e=b(e),a===-1&&(a=4294967295),a=er(n);var i=u=>u;if(t===0){var f=32-8*n;i=u=>u<>>f}n=e.includes("unsigned")?function(u,l){return l>>>0}:function(u,l){return l},k(r,{name:e,fromWireType:i,toWireType:n,argPackAdvance:8,readValueFromPointer:oe(e,a,t!==0),ja:null})},q:function(r,e,n){function t(i){var f=y;return new a($r,f[1+(i>>=2)],f[i])}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][e];k(r,{name:n=b(n),fromWireType:t,argPackAdvance:8,readValueFromPointer:t},{Wa:!0})},h:function(r,e,n,t,a,i,f,u,l,s,h,p){n=b(n),i=T(a,i),u=T(f,u),s=T(l,s),p=T(h,p),$([r],[e],function(v){return v=v[0],[new j(n,v.ea,!1,!1,!0,v,t,i,u,s,p)]})},F:function(r,e){var n=(e=b(e))==="std::string";k(r,{name:e,fromWireType:function(t){var a=y[t>>2],i=t+4;if(n)for(var f=i,u=0;u<=a;++u){var l=i+u;if(u==a||_[l]==0){if(f=f?ur(_,f,l-f):"",s===void 0)var s=f;else s+="\0",s+=f;f=l+1}}else{for(s=Array(a),u=0;u>2]=f,n&&i)Lr(a,_,l,f+1);else if(i)for(i=0;iX,u=1;else e===4&&(t=Be,a=ze,i=qe,f=()=>y,u=2);k(r,{name:n,fromWireType:function(l){for(var s,h=y[l>>2],p=f(),v=l+4,o=0;o<=h;++o){var d=l+4+o*e;o!=h&&p[d>>u]!=0||(v=t(v,d-v),s===void 0?s=v:(s+="\0",s+=v),v=d+e)}return M(l),s},toWireType:function(l,s){typeof s!="string"&&m("Cannot pass non-string to C++ string type "+n);var h=i(s),p=_r(4+h+e);return y[p>>2]=h>>u,a(s,p+4,h+e),l!==null&&l.push(M,p),p},argPackAdvance:8,readValueFromPointer:Q,ja:function(l){M(l)}})},v:function(r,e,n,t,a,i){cr[r]={name:b(e),Ba:T(n,t),na:T(a,i),Fa:[]}},l:function(r,e,n,t,a,i,f,u,l,s){cr[r].Fa.push({Na:b(e),Ta:n,Ra:T(t,a),Sa:i,cb:f,bb:T(u,l),eb:s})},T:function(r,e){k(r,{Xa:!0,name:e=b(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},k:function(r,e,n){r=P(r),e=ir(e,"emval::as");var t=[],a=O(t);return y[n>>2]=a,e.toWireType(t,r)},z:function(r,e){return r=P(r),(e=ir(e,"emval::as")).toWireType(null,r)},W:function(r,e,n,t){r=P(r),n=ge(e,n);for(var a=Array(e),i=0;i>2]=O(i),r(e,n,i,a)},G:function(r,e,n,t){(r=br[r])(e=P(e),n=yr(n),null,t)},a:Ur,H:function(r){return r===0?O(me()):(r=yr(r),O(me()[r]))},B:function(r,e){var n=ge(r,e),t=n[0];e=t.name+"_$"+n.slice(1).map(function(f){return f.name}).join("_")+"$";var a=ye[e];if(a!==void 0)return a;var i=Array(r-1);return a=Le((f,u,l,s)=>{for(var h=0,p=0;p>>=0))return!1;for(var n=1;4>=n;n*=2){var t=e*(1+.2/n);t=Math.min(t,r+100663296);var a=Math;t=Math.max(r,t),a=a.min.call(a,2147483648,t+(65536-t%65536)%65536);r:{try{Cr.grow(a-$r.byteLength+65535>>>16),Jr();var i=1;break r}catch{}i=void 0}if(i)return!0}return!1},K:function(r,e){var n=0;return be().forEach(function(t,a){var i=e+n;for(a=y[r+4*a>>2]=i,i=0;i>0]=t.charCodeAt(i);F[a>>0]=0,n+=t.length+1}),0},L:function(r,e){var n=be();y[r>>2]=n.length;var t=0;return n.forEach(function(a){t+=a.length+1}),y[e>>2]=t,0},Q:function(){return 52},P:function(){return 70},O:function(r,e,n,t){for(var a=0,i=0;i>2],u=y[e+4>>2];e+=8;for(var l=0;l>2]=a,0},J:function(r,e,n,t){return Xe(r,e,n,t)}};(function(){function r(a){c.asm=a.exports,Cr=c.asm.X,Jr(),Xr=c.asm.ba,Kr.unshift(c.asm.Y),H--,c.monitorRunDependencies&&c.monitorRunDependencies(H),H==0&&Z&&(a=Z,Z=null,a())}function e(a){r(a.instance)}function n(a){return je().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(a,function(i){N("failed to asynchronously prepare wasm: "+i),K(i)})}var t={a:Ze};if(H++,c.monitorRunDependencies&&c.monitorRunDependencies(H),c.instantiateWasm)try{return c.instantiateWasm(t,r)}catch(a){N("Module.instantiateWasm callback failed with error: "+a),E(a)}(J||typeof WebAssembly.instantiateStreaming!="function"||re()||typeof fetch!="function"?n(e):fetch(D,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(e,function(i){return N("wasm streaming compile failed: "+i),N("falling back to ArrayBuffer instantiation"),n(e)})})).catch(E)})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.Y).apply(null,arguments)};var Tr,_r=c._malloc=function(){return(_r=c._malloc=c.asm.Z).apply(null,arguments)},M=c._free=function(){return(M=c._free=c.asm._).apply(null,arguments)},_e=c.___getTypeName=function(){return(_e=c.___getTypeName=c.asm.$).apply(null,arguments)};function Pe(){function r(){if(!Tr&&(Tr=!0,c.calledRun=!0,!qr)){if(kr(Kr),z(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var e=c.postRun.shift();Qr.unshift(e)}kr(Qr)}}if(!(0import("./index-J0iiHjMT.js").then(n=>n.zF),__vite__mapDeps([0,1]))).default({title:e.parsedUrl.title});return await _(l,e,t),l}function O(r,s){return r?r.find(e=>e.id===s):null}async function _(r,s,e){function t(a,n,u,i){const c={...e,layerId:n,sublayerTitleMode:"service-name"};return a!=null&&(c.url=a),u!=null&&(c.sourceJSON=u),i(c)}const l=s.sublayerConstructorProvider;for(const{id:a,serverUrl:n}of s.layers){const u=O(s.sublayerInfos,a),i=(u&&(l==null?void 0:l(u)))??s.Constructor,c=t(n,a,u,d=>new i(d));r.add(c)}if(s.tables.length){const a=await p("FeatureLayer");s.tables.forEach(({id:n,serverUrl:u})=>{const i=t(u,n,O(s.tableInfos,n),c=>new a(c));r.tables.add(i)})}}async function x(r,s){var d,v,w,S,b,h,I;let e=F(r);if(e==null&&(e=await $(r,s)),e==null)throw new T("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:l}=e;let a;const n={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"},u=t==="FeatureServer",i=t==="SceneServer",c={parsedUrl:e,Constructor:null,layerId:u||i?l??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":l!=null?a="FeatureLayer":a=await z(r,s)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const o=await f(r,{customParameters:s}),{tileInfo:y,cacheType:m}=o;a=y?((d=y==null?void 0:y.format)==null?void 0:d.toUpperCase())!=="LERC"||m&&m.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const o=await f(e.url.path,{customParameters:s});if(a="SceneLayer",o){const y=o==null?void 0:o.layers;if((o==null?void 0:o.layerType)==="Voxel")a="VoxelLayer";else if(y!=null&&y.length){const m=(v=y[0])==null?void 0:v.layerType;m!=null&&L[m]!=null&&(a=L[m])}}break}case"FeatureServer":if(a="FeatureLayer",l!=null){const o=await f(r,{customParameters:s});c.sourceJSON=o,o.type==="Oriented Imagery Layer"&&(a="OrientedImageryLayer")}break;default:a=n[t]}if(k[a]&&l==null){const o=await M(r,t,s);if(u&&(c.sublayerInfos=o.layerInfos,c.tableInfos=o.tableInfos),o.layers.length+o.tables.length!==1)c.layers=o.layers,c.tables=o.tables,u&&((w=o.layerInfos)!=null&&w.length)&&(c.sublayerConstructorProvider=await j(o.layerInfos));else if(u||i){const y=((S=o.layerInfos)==null?void 0:S[0])??((b=o.tableInfos)==null?void 0:b[0]);c.layerId=((h=o.layers[0])==null?void 0:h.id)??((I=o.tables[0])==null?void 0:I.id),c.sourceJSON=y,u&&(y==null?void 0:y.type)==="Oriented Imagery Layer"&&(a="OrientedImageryLayer")}}return c.Constructor=await p(a),c}async function $(r,s){var u;const e=await f(r,{customParameters:s});let t=null,l=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",l=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":P(e)?(t="SceneServer",l=e.id):e.hasOwnProperty("layers")&&P((u=e.layers)==null?void 0:u[0])&&(t="SceneServer"),!t)return null;const n=l!=null?U(r):null;return{title:n!=null&&e.name||C(r),serverType:t,sublayer:l,url:{path:n!=null?n.serviceUrl:N(r).path}}}function P(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function M(r,s,e){let t,l,a=!1;switch(s){case"FeatureServer":{const i=await V(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await R(r,e);t=i.serviceInfo,l=i.tableServerUrl;break}default:t=await f(r,{customParameters:e})}const n=t==null?void 0:t.layers,u=t==null?void 0:t.tables;return{layers:(n==null?void 0:n.map(i=>({id:i.id})).reverse())||[],tables:(u==null?void 0:u.map(i=>({serverUrl:l,id:i.id})).reverse())||[],layerInfos:a?n:[],tableInfos:a?u:[]}}async function R(r,s){var l;const e=await f(r,{customParameters:s});if(!((l=e.layers)==null?void 0:l[0]))return{serviceInfo:e};try{const{serverUrl:a}=await J(r),n=await f(a,{customParameters:s}).catch(()=>null);return n&&(e.tables=n.tables),{serviceInfo:e,tableServerUrl:a}}catch{return{serviceInfo:e}}}async function p(r){return(0,E[r])()}async function z(r,s){return(await f(r,{customParameters:s})).tileInfo}async function j(r){const s=[],e=[];if(r.forEach(a=>{const{type:n}=a;n==="Oriented Imagery Layer"?(s.push(n),e.push(p("OrientedImageryLayer"))):(s.push(n),e.push(p("FeatureLayer")))}),!e.length)return;const t=await Promise.all(e),l=new Map;return s.forEach((a,n)=>{l.set(a,t[n])}),a=>l.get(a.type)}export{X as fromUrl}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/automaticAreaMeasurementUtils-nVd6Y5mX.js b/dist/assets/automaticAreaMeasurementUtils-nVd6Y5mX.js new file mode 100644 index 0000000..a6dcfd7 --- /dev/null +++ b/dist/assets/automaticAreaMeasurementUtils-nVd6Y5mX.js @@ -0,0 +1 @@ +import{h,g,k as i}from"./euclideanAreaMeasurementUtils-zmzttSyV.js";import{kQ as q,as as $,aa as k,cT as o,kH as l,aD as b,ar as y}from"./index-J0iiHjMT.js";import{r as M}from"./Tooltip-ON77BKb3.js";function R({hasZ:r,spatialReference:n,rings:s},e,a=0){const u=q(n);if(u==null)return!1;const m=r?t=>t:t=>$(d,t[0],t[1],a);for(const t of s){const c=[];for(const p of t){const f=[0,0,a];u(m(p),0,f,0),c.push(f)}e.push(c)}return!0}const d=k();function G(r){const{spatialReference:n}=r;return M(n,w,x,D,r)}function w(r){return o(Math.abs(l([r],"square-meters")[0]),"square-meters")}function x(r){try{return o(Math.abs(b(r,"square-meters")),"square-meters")}catch{return null}}function D(r){const n=[];return R(r,n)?o(Math.abs(l([{type:"polygon",rings:n,spatialReference:y.WGS84}],"square-meters")[0]),"square-meters"):null}function H(r,n,s=i()){if(n==="on-the-ground"){const e=G(r);return e??h(r,s)}return g(r,s)}function W(r,n=i()){return H(r,"on-the-ground",n)}export{H as o,W as u}; diff --git a/dist/assets/basis_transcoder-FsrOzl2Q.js b/dist/assets/basis_transcoder-FsrOzl2Q.js new file mode 100644 index 0000000..8f03c0b --- /dev/null +++ b/dist/assets/basis_transcoder-FsrOzl2Q.js @@ -0,0 +1,2 @@ +import{cg as Sn,g_ as ze}from"./index-J0iiHjMT.js";function On(k,Y){for(var H=0;Hn[C]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var Ar,se,Wr,_e={exports:{}};_e.exports,Ar=_e,_e.exports,se=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(se=se||__filename),Wr=function(k){var Y,H,n=(k=k||{})!==void 0?k:{};n.ready=new Promise(function(e,r){Y=e,H=r});var C,E={};for(C in n)n.hasOwnProperty(C)&&(E[C]=n[C]);var le=!1,I=!1,Pe=!1,qe=!1;le=typeof window=="object",I=typeof importScripts=="function",Pe=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",qe=!le&&!Pe&&!I;var ce,Z,Ae,We,T="";function Sr(e){return n.locateFile?n.locateFile(e,T):T+e}Pe?(T=I?require("path").dirname(T)+"/":__dirname+"/",ce=function(e,r){return Ae||(Ae=require("fs")),We||(We=require("path")),e=We.normalize(e),Ae.readFileSync(e,r?null:"utf8")},Z=function(e){var r=ce(e,!0);return r.buffer||(r=new Uint8Array(r)),Ee(r.buffer),r},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(e){if(!(e instanceof Wn))throw e}),process.on("unhandledRejection",B),n.inspect=function(){return"[Emscripten Module object]"}):qe?(typeof read<"u"&&(ce=function(e){return read(e)}),Z=function(e){var r;return typeof readbuffer=="function"?new Uint8Array(readbuffer(e)):(Ee(typeof(r=read(e,"binary"))=="object"),r)},typeof scriptArgs<"u"&&scriptArgs,typeof print<"u"&&(typeof console>"u"&&(console={}),console.log=print,console.warn=console.error=typeof printErr<"u"?printErr:print)):(le||I)&&(I?T=self.location.href:document.currentScript&&(T=document.currentScript.src),se&&(T=se),T=T.indexOf("blob:")!==0?T.substr(0,T.lastIndexOf("/")+1):"",ce=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},I&&(Z=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}));var K,Q,Or=n.print||console.log.bind(console),z=n.printErr||console.warn.bind(console);for(C in E)E.hasOwnProperty(C)&&(n[C]=E[C]);E=null,n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,n.quit&&n.quit,n.wasmBinary&&(K=n.wasmBinary),n.noExitRuntime&&n.noExitRuntime,typeof WebAssembly!="object"&&B("no native wasm support detected");var jr=new WebAssembly.Table({initial:157,maximum:157,element:"anyfunc"}),Be=!1;function Ee(e,r){e||B("Assertion failed: "+r)}var Ne=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ge(e,r,t){for(var i=r+t,o=r;e[o]&&!(o>=i);)++o;if(o-r>16&&e.subarray&&Ne)return Ne.decode(e.subarray(r,o));for(var a="";r>10,56320|1023&c)}}else a+=String.fromCharCode((31&s)<<6|u)}else a+=String.fromCharCode(s)}return a}function Le(e,r){return e?Ge(b,e,r):""}function kr(e,r,t,i){if(!(i>0))return 0;for(var o=t,a=t+i-1,s=0;s=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++s)),u<=127){if(t>=a)break;r[t++]=u}else if(u<=2047){if(t+1>=a)break;r[t++]=192|u>>6,r[t++]=128|63&u}else if(u<=65535){if(t+2>=a)break;r[t++]=224|u>>12,r[t++]=128|u>>6&63,r[t++]=128|63&u}else{if(t+3>=a)break;r[t++]=240|u>>18,r[t++]=128|u>>12&63,r[t++]=128|u>>6&63,r[t++]=128|63&u}}return r[t]=0,t-o}function Fr(e,r,t){return kr(e,b,r,t)}function Rr(e){for(var r=0,t=0;t=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++t)),i<=127?++r:r+=i<=2047?2:i<=65535?3:4}return r}var Xe=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0;function xr(e,r){for(var t=e,i=t>>1,o=i+r/2;!(i>=o)&&ee[i];)++i;if((t=i<<1)-e>32&&Xe)return Xe.decode(b.subarray(e,t));for(var a=0,s="";;){var u=U[e+2*a>>1];if(u==0||a==r/2)return s;++a,s+=String.fromCharCode(u)}}function Dr(e,r,t){if(t===void 0&&(t=2147483647),t<2)return 0;for(var i=r,o=(t-=2)<2*e.length?t/2:e.length,a=0;a>1]=s,r+=2}return U[r>>1]=0,r-i}function Ir(e){return 2*e.length}function Ur(e,r){for(var t=0,i="";!(t>=r/4);){var o=g[e+4*t>>2];if(o==0)break;if(++t,o>=65536){var a=o-65536;i+=String.fromCharCode(55296|a>>10,56320|1023&a)}else i+=String.fromCharCode(o)}return i}function Mr(e,r,t){if(t===void 0&&(t=2147483647),t<4)return 0;for(var i=r,o=i+t-4,a=0;a=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),g[r>>2]=s,(r+=4)+4>o)break}return g[r>>2]=0,r-i}function Vr(e){for(var r=0,t=0;t=55296&&i<=57343&&++t,r+=4}return r}var q,fe,b,U,ee,g,P,Je,Ye,Ze=65536;function Hr(e,r){return e%r>0&&(e+=r-e%r),e}function Ke(e){q=e,n.HEAP8=fe=new Int8Array(e),n.HEAP16=U=new Int16Array(e),n.HEAP32=g=new Int32Array(e),n.HEAPU8=b=new Uint8Array(e),n.HEAPU16=ee=new Uint16Array(e),n.HEAPU32=P=new Uint32Array(e),n.HEAPF32=Je=new Float32Array(e),n.HEAPF64=Ye=new Float64Array(e)}var zr=5565536,qr=322496,Qe=n.INITIAL_MEMORY||16777216;function pe(e){for(;e.length>0;){var r=e.shift();if(typeof r!="function"){var t=r.func;typeof t=="number"?r.arg===void 0?n.dynCall_v(t):n.dynCall_vi(t,r.arg):t(r.arg===void 0?null:r.arg)}else r(n)}}(Q=n.wasmMemory?n.wasmMemory:new WebAssembly.Memory({initial:Qe/Ze,maximum:2147483648/Ze}))&&(q=Q.buffer),Qe=q.byteLength,Ke(q),g[qr>>2]=zr;var er=[],rr=[],Br=[],tr=[];function Nr(){if(n.preRun)for(typeof n.preRun=="function"&&(n.preRun=[n.preRun]);n.preRun.length;)Jr(n.preRun.shift());pe(er)}function Gr(){pe(rr)}function Lr(){pe(Br)}function Xr(){if(n.postRun)for(typeof n.postRun=="function"&&(n.postRun=[n.postRun]);n.postRun.length;)Yr(n.postRun.shift());pe(tr)}function Jr(e){er.unshift(e)}function Yr(e){tr.unshift(e)}var Zr=Math.ceil,Kr=Math.floor,M=0,re=null;function Qr(e){M++,n.monitorRunDependencies&&n.monitorRunDependencies(M)}function et(e){if(M--,n.monitorRunDependencies&&n.monitorRunDependencies(M),M==0&&re){var r=re;re=null,r()}}function B(e){n.onAbort&&n.onAbort(e),z(e+=""),Be=!0,e="abort("+e+"). Build with -s ASSERTIONS=1 for more info.";var r=new WebAssembly.RuntimeError(e);throw H(r),r}function nr(e,r){return String.prototype.startsWith?e.startsWith(r):e.indexOf(r)===0}n.preloadedImages={},n.preloadedAudios={};var rt="data:application/octet-stream;base64,";function ir(e){return nr(e,rt)}var tt="file://";function or(e){return nr(e,tt)}var A="basis_transcoder.wasm";function ar(){try{if(K)return new Uint8Array(K);if(Z)return Z(A);throw"both async and sync fetching of the wasm failed"}catch(e){B(e)}}function nt(){return K||!le&&!I||typeof fetch!="function"||or(A)?new Promise(function(e,r){e(ar())}):fetch(A,{credentials:"same-origin"}).then(function(e){if(!e.ok)throw"failed to load wasm binary file at '"+A+"'";return e.arrayBuffer()}).catch(function(){return ar()})}function it(){var e={a:An};function r(a,s){var u=a.exports;n.asm=u,et()}function t(a){r(a.instance)}function i(a){return nt().then(function(s){return WebAssembly.instantiate(s,e)}).then(a,function(s){z("failed to asynchronously prepare wasm: "+s),B(s)})}function o(){if(K||typeof WebAssembly.instantiateStreaming!="function"||ir(A)||or(A)||typeof fetch!="function")return i(t);fetch(A,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,e).then(t,function(s){return z("wasm streaming compile failed: "+s),z("falling back to ArrayBuffer instantiation"),i(t)})})}if(Qr(),n.instantiateWasm)try{return n.instantiateWasm(e,r)}catch(a){return z("Module.instantiateWasm callback failed with error: "+a),!1}return o(),{}}ir(A)||(A=Sr(A)),rr.push({func:function(){Cr()}});var de={};function ye(e){for(;e.length;){var r=e.pop();e.pop()(r)}}function te(e){return this.fromWireType(P[e>>2])}var N={},V={},me={},ot=48,at=57;function ur(e){if(e===void 0)return"_unknown";var r=(e=e.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return r>=ot&&r<=at?"_"+e:e}function Se(e,r){return e=ur(e),function(){return r.apply(this,arguments)}}function Oe(e,r){var t=Se(r,function(i){this.name=r,this.message=i;var o=new Error(i).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},t}var sr=void 0;function he(e){throw new sr(e)}function F(e,r,t){function i(u){var l=t(u);l.length!==e.length&&he("Mismatched type converter count");for(var c=0;c>a])},destructorFunction:null})}function ct(e){if(!(this instanceof R)||!(e instanceof R))return!1;for(var r=this.$$.ptrType.registeredClass,t=this.$$.ptr,i=e.$$.ptrType.registeredClass,o=e.$$.ptr;r.baseClass;)t=r.upcast(t),r=r.baseClass;for(;i.baseClass;)o=i.upcast(o),i=i.baseClass;return r===i&&t===o}function ft(e){return{count:e.count,deleteScheduled:e.deleteScheduled,preservePointerOnDelete:e.preservePointerOnDelete,ptr:e.ptr,ptrType:e.ptrType,smartPtr:e.smartPtr,smartPtrType:e.smartPtrType}}function je(e){function r(t){return t.$$.ptrType.registeredClass.name}p(r(e)+" instance already deleted")}var ke=!1;function cr(e){}function pt(e){e.smartPtr?e.smartPtrType.rawDestructor(e.smartPtr):e.ptrType.registeredClass.rawDestructor(e.ptr)}function fr(e){e.count.value-=1,e.count.value===0&&pt(e)}function ne(e){return typeof FinalizationGroup>"u"?(ne=function(r){return r},e):(ke=new FinalizationGroup(function(r){for(var t=r.next();!t.done;t=r.next()){var i=t.value;i.ptr?fr(i):console.warn("object already deleted: "+i.ptr)}}),ne=function(r){return ke.register(r,r.$$,r.$$),r},cr=function(r){ke.unregister(r.$$)},ne(e))}function dt(){if(this.$$.ptr||je(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var e=ne(Object.create(Object.getPrototypeOf(this),{$$:{value:ft(this.$$)}}));return e.$$.count.value+=1,e.$$.deleteScheduled=!1,e}function yt(){this.$$.ptr||je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&p("Object already scheduled for deletion"),cr(this),fr(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)}function mt(){return!this.$$.ptr}var ie=void 0,oe=[];function Fe(){for(;oe.length;){var e=oe.pop();e.$$.deleteScheduled=!1,e.delete()}}function ht(){return this.$$.ptr||je(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&p("Object already scheduled for deletion"),oe.push(this),oe.length===1&&ie&&ie(Fe),this.$$.deleteScheduled=!0,this}function vt(){R.prototype.isAliasOf=ct,R.prototype.clone=dt,R.prototype.delete=yt,R.prototype.isDeleted=mt,R.prototype.deleteLater=ht}function R(){}var pr={};function dr(e,r,t){if(e[r].overloadTable===void 0){var i=e[r];e[r]=function(){return e[r].overloadTable.hasOwnProperty(arguments.length)||p("Function '"+t+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+e[r].overloadTable+")!"),e[r].overloadTable[arguments.length].apply(this,arguments)},e[r].overloadTable=[],e[r].overloadTable[i.argCount]=i}}function Re(e,r,t){n.hasOwnProperty(e)?((t===void 0||n[e].overloadTable!==void 0&&n[e].overloadTable[t]!==void 0)&&p("Cannot register public name '"+e+"' twice"),dr(n,e,e),n.hasOwnProperty(t)&&p("Cannot register multiple overloads of a function with the same number of arguments ("+t+")!"),n[e].overloadTable[t]=r):(n[e]=r,t!==void 0&&(n[e].numArguments=t))}function gt(e,r,t,i,o,a,s,u){this.name=e,this.constructor=r,this.instancePrototype=t,this.rawDestructor=i,this.baseClass=o,this.getActualType=a,this.upcast=s,this.downcast=u,this.pureVirtualFunctions=[]}function xe(e,r,t){for(;r!==t;)r.upcast||p("Expected null or instance of "+t.name+", got an instance of "+r.name),e=r.upcast(e),r=r.baseClass;return e}function bt(e,r){if(r===null)return this.isReference&&p("null is not a valid "+this.name),0;r.$$||p('Cannot pass "'+L(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name);var t=r.$$.ptrType.registeredClass;return xe(r.$$.ptr,t,this.registeredClass)}function $t(e,r){var t;if(r===null)return this.isReference&&p("null is not a valid "+this.name),this.isSmartPointer?(t=this.rawConstructor(),e!==null&&e.push(this.rawDestructor,t),t):0;r.$$||p('Cannot pass "'+L(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name),!this.isConst&&r.$$.ptrType.isConst&&p("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);var i=r.$$.ptrType.registeredClass;if(t=xe(r.$$.ptr,i,this.registeredClass),this.isSmartPointer)switch(r.$$.smartPtr===void 0&&p("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:r.$$.smartPtrType===this?t=r.$$.smartPtr:p("Cannot convert argument of type "+(r.$$.smartPtrType?r.$$.smartPtrType.name:r.$$.ptrType.name)+" to parameter type "+this.name);break;case 1:t=r.$$.smartPtr;break;case 2:if(r.$$.smartPtrType===this)t=r.$$.smartPtr;else{var o=r.clone();t=this.rawShare(t,O(function(){o.delete()})),e!==null&&e.push(this.rawDestructor,t)}break;default:p("Unsupporting sharing policy")}return t}function Ct(e,r){if(r===null)return this.isReference&&p("null is not a valid "+this.name),0;r.$$||p('Cannot pass "'+L(r)+'" as a '+this.name),r.$$.ptr||p("Cannot pass deleted object as a pointer of type "+this.name),r.$$.ptrType.isConst&&p("Cannot convert argument of type "+r.$$.ptrType.name+" to parameter type "+this.name);var t=r.$$.ptrType.registeredClass;return xe(r.$$.ptr,t,this.registeredClass)}function wt(e){return this.rawGetPointee&&(e=this.rawGetPointee(e)),e}function Tt(e){this.rawDestructor&&this.rawDestructor(e)}function _t(e){e!==null&&e.delete()}function yr(e,r,t){if(r===t)return e;if(t.baseClass===void 0)return null;var i=yr(e,r,t.baseClass);return i===null?null:t.downcast(i)}function Pt(){return Object.keys(ae).length}function At(){var e=[];for(var r in ae)ae.hasOwnProperty(r)&&e.push(ae[r]);return e}function Wt(e){ie=e,oe.length&&ie&&ie(Fe)}function Et(){n.getInheritedInstanceCount=Pt,n.getLiveInheritedInstances=At,n.flushPendingDeletes=Fe,n.setDelayFunction=Wt}var ae={};function St(e,r){for(r===void 0&&p("ptr should not be undefined");e.baseClass;)r=e.upcast(r),e=e.baseClass;return r}function Ot(e,r){return r=St(e,r),ae[r]}function ge(e,r){return r.ptrType&&r.ptr||he("makeClassHandle requires ptr and ptrType"),!!r.smartPtrType!=!!r.smartPtr&&he("Both smartPtrType and smartPtr must be specified"),r.count={value:1},ne(Object.create(e,{$$:{value:r}}))}function jt(e){var r=this.getPointee(e);if(!r)return this.destructor(e),null;var t=Ot(this.registeredClass,r);if(t!==void 0){if(t.$$.count.value===0)return t.$$.ptr=r,t.$$.smartPtr=e,t.clone();var i=t.clone();return this.destructor(e),i}function o(){return this.isSmartPointer?ge(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:r,smartPtrType:this,smartPtr:e}):ge(this.registeredClass.instancePrototype,{ptrType:this,ptr:e})}var a,s=this.registeredClass.getActualType(r),u=pr[s];if(!u)return o.call(this);a=this.isConst?u.constPointerType:u.pointerType;var l=yr(r,this.registeredClass,a.registeredClass);return l===null?o.call(this):this.isSmartPointer?ge(a.registeredClass.instancePrototype,{ptrType:a,ptr:l,smartPtrType:this,smartPtr:e}):ge(a.registeredClass.instancePrototype,{ptrType:a,ptr:l})}function kt(){S.prototype.getPointee=wt,S.prototype.destructor=Tt,S.prototype.argPackAdvance=8,S.prototype.readValueFromPointer=te,S.prototype.deleteObject=_t,S.prototype.fromWireType=jt}function S(e,r,t,i,o,a,s,u,l,c,f){this.name=e,this.registeredClass=r,this.isReference=t,this.isConst=i,this.isSmartPointer=o,this.pointeeType=a,this.sharingPolicy=s,this.rawGetPointee=u,this.rawConstructor=l,this.rawShare=c,this.rawDestructor=f,o||r.baseClass!==void 0?this.toWireType=$t:i?(this.toWireType=bt,this.destructorFunction=null):(this.toWireType=Ct,this.destructorFunction=null)}function mr(e,r,t){n.hasOwnProperty(e)||he("Replacing nonexistant public symbol"),n[e].overloadTable!==void 0&&t!==void 0?n[e].overloadTable[t]=r:(n[e]=r,n[e].argCount=t)}function _(e,r){function t(o){var a=[r];return function(){a.length=arguments.length+1;for(var s=0;s>2)+i]);return t}function Rt(e,r,t,i,o,a){Ee(r>0);var s=De(r,t);o=_(i,o);var u=[a],l=[];F([],[e],function(c){var f="constructor "+(c=c[0]).name;if(c.registeredClass.constructor_body===void 0&&(c.registeredClass.constructor_body=[]),c.registeredClass.constructor_body[r-1]!==void 0)throw new G("Cannot register multiple constructors with identical number of parameters ("+(r-1)+") for class '"+c.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return c.registeredClass.constructor_body[r-1]=function(){be("Cannot construct "+c.name+" due to unbound types",s)},F([],s,function(m){return c.registeredClass.constructor_body[r-1]=function(){arguments.length!==r-1&&p(f+" called with "+arguments.length+" arguments, expected "+(r-1)),l.length=0,u.length=r;for(var d=1;d4&&--w[e].refcount==0&&(w[e]=void 0,Ie.push(e))}function It(){for(var e=0,r=5;r>1])};case 2:return function(i){var o=t?g:P;return this.fromWireType(o[i>>2])};default:throw new TypeError("Unknown integer type: "+e)}}function zt(e,r,t,i){var o=ve(t);function a(){}r=v(r),a.values={},W(e,{name:r,constructor:a,fromWireType:function(s){return this.constructor.values[s]},toWireType:function(s,u){return u.value},argPackAdvance:8,readValueFromPointer:Ht(r,o,i),destructorFunction:null}),Re(r,a)}function $e(e,r){var t=V[e];return t===void 0&&p(r+" has unknown type "+vr(e)),t}function qt(e,r,t){var i=$e(e,"enum");r=v(r);var o=i.constructor,a=Object.create(i.constructor.prototype,{value:{value:t},constructor:{value:Se(i.name+"_"+r,function(){})}});o.values[t]=a,o[r]=a}function L(e){if(e===null)return"null";var r=typeof e;return r==="object"||r==="array"||r==="function"?e.toString():""+e}function Bt(e,r){switch(r){case 2:return function(t){return this.fromWireType(Je[t>>2])};case 3:return function(t){return this.fromWireType(Ye[t>>3])};default:throw new TypeError("Unknown float type: "+e)}}function Nt(e,r,t){var i=ve(t);W(e,{name:r=v(r),fromWireType:function(o){return o},toWireType:function(o,a){if(typeof a!="number"&&typeof a!="boolean")throw new TypeError('Cannot convert "'+L(a)+'" to '+this.name);return a},argPackAdvance:8,readValueFromPointer:Bt(r,i),destructorFunction:null})}function Gt(e,r,t,i,o,a){var s=De(r,t);e=v(e),o=_(i,o),Re(e,function(){be("Cannot call "+e+" due to unbound types",s)},r-1),F([],s,function(u){var l=[u[0],null].concat(u.slice(1));return mr(e,gr(e,l,null,o,a),r-1),[]})}function Lt(e,r,t){switch(r){case 0:return t?function(i){return fe[i]}:function(i){return b[i]};case 1:return t?function(i){return U[i>>1]}:function(i){return ee[i>>1]};case 2:return t?function(i){return g[i>>2]}:function(i){return P[i>>2]};default:throw new TypeError("Unknown integer type: "+e)}}function Xt(e,r,t,i,o){r=v(r),o===-1&&(o=4294967295);var a=ve(t),s=function(c){return c};if(i===0){var u=32-8*t;s=function(c){return c<>>u}}var l=r.indexOf("unsigned")!=-1;W(e,{name:r,fromWireType:s,toWireType:function(c,f){if(typeof f!="number"&&typeof f!="boolean")throw new TypeError('Cannot convert "'+L(f)+'" to '+this.name);if(fo)throw new TypeError('Passing a number "'+L(f)+'" from JS side to C/C++ side to an argument of type "'+r+'", which is outside the valid range ['+i+", "+o+"]!");return l?f>>>0:0|f},argPackAdvance:8,readValueFromPointer:Lt(r,a,i!==0),destructorFunction:null})}function Jt(e,r,t){var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][r];function o(a){var s=P,u=s[a>>=2],l=s[a+1];return new i(q,l,u)}W(e,{name:t=v(t),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function Yt(e,r){var t=(r=v(r))==="std::string";W(e,{name:r,fromWireType:function(i){var o,a=P[i>>2];if(t)for(var s=i+4,u=0;u<=a;++u){var l=i+4+u;if(u==a||b[l]==0){var c=Le(s,l-s);o===void 0?o=c:(o+="\0",o+=c),s=l+1}}else{var f=new Array(a);for(u=0;u>2]=s,t&&a)Fr(o,u+4,s+1);else if(a)for(var l=0;l255&&(j(u),p("String has UTF-16 code units that do not fit in 8 bits")),b[u+4+l]=c}else for(l=0;l>2],m=a(),d=l+4,h=0;h<=f;++h){var $=l+4+h*r;if(h==f||m[$>>u]==0){var y=i(d,$-d);c===void 0?c=y:(c+="\0",c+=y),d=$+r}}return j(l),c},toWireType:function(l,c){typeof c!="string"&&p("Cannot pass non-string to C++ string type "+t);var f=s(c),m=Ve(4+f+r);return P[m>>2]=f>>u,o(c,m+4,f+r),l!==null&&l.push(j,m),m},argPackAdvance:8,readValueFromPointer:te,destructorFunction:function(l){j(l)}})}function Kt(e,r,t,i,o,a){de[e]={name:v(r),rawConstructor:_(t,i),rawDestructor:_(o,a),fields:[]}}function Qt(e,r,t,i,o,a,s,u,l,c){de[e].fields.push({fieldName:v(r),getterReturnType:t,getter:_(i,o),getterContext:a,setterArgumentType:s,setter:_(u,l),setterContext:c})}function en(e,r){W(e,{isVoid:!0,name:r=v(r),argPackAdvance:0,fromWireType:function(){},toWireType:function(t,i){}})}function ue(e){return e||p("Cannot use deleted val. handle = "+e),w[e].value}function rn(e,r,t){e=ue(e),r=$e(r,"emval::as");var i=[],o=O(i);return g[t>>2]=o,r.toWireType(i,e)}var tn={};function Ce(e){var r=tn[e];return r===void 0?v(e):r}var Me=[];function nn(e,r,t,i){(e=Me[e])(r=ue(r),t=Ce(t),null,i)}function br(){if(typeof globalThis=="object")return globalThis;function e(r){r.$$$embind_global$$$=r;var t=typeof $$$embind_global$$$=="object"&&r.$$$embind_global$$$===r;return t||delete r.$$$embind_global$$$,t}if(typeof $$$embind_global$$$=="object"||(typeof ze=="object"&&e(ze)?$$$embind_global$$$=ze:typeof self=="object"&&e(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")}function on(e){return e===0?O(br()):(e=Ce(e),O(br()[e]))}function an(e){var r=Me.length;return Me.push(e),r}function un(e,r){for(var t=new Array(e),i=0;i>2)+i],"parameter "+i);return t}function sn(e,r){var t=un(e,r),i=t[0],o=new Array(e-1);return an(function(a,s,u,l){for(var c=0,f=0;f4&&(w[e].refcount+=1)}function pn(e){var r=new Array(e+1);return function(t,i,o){r[0]=t;for(var a=0;a>2)+a],"parameter "+a);r[a+1]=s.readValueFromPointer(o),o+=s.argPackAdvance}return O(new(t.bind.apply(t,r)))}}var $r={};function dn(e,r,t,i){e=ue(e);var o=$r[r];return o||(o=pn(r),$r[r]=o),o(e,t,i)}function yn(e){return O(Ce(e))}function mn(e){ye(w[e].value),Ue(e)}function hn(){B()}function vn(e,r,t){b.copyWithin(e,r,r+t)}function gn(){return b.length}function bn(e){try{return Q.grow(e-q.byteLength+65535>>>16),Ke(Q.buffer),1}catch{}}function $n(e){e>>>=0;var r=gn(),t=65536,i=2147483648;if(e>i)return!1;for(var o=16777216,a=1;a<=4;a*=2){var s=r*(1+.2/a);if(s=Math.min(s,e+100663296),bn(Math.min(i,Hr(Math.max(o,e,s),t))))return!0}return!1}var we={mappings:{},buffers:[null,[],[]],printChar:function(e,r){var t=we.buffers[e];r===0||r===10?((e===1?Or:z)(Ge(t,0)),t.length=0):t.push(r)},varargs:void 0,get:function(){return we.varargs+=4,g[we.varargs-4>>2]},getStr:function(e){return Le(e)},get64:function(e,r){return e}};function Cn(e){return 0}function wn(e,r,t,i,o){}function Tn(e,r,t,i){for(var o=0,a=0;a>2],u=g[r+(8*a+4)>>2],l=0;l>2]=o,0}function _n(e){return(e=+e)>=0?+Kr(e+.5):+Zr(e-.5)}function Pn(e){}sr=n.InternalError=Oe(Error,"InternalError"),st(),G=n.BindingError=Oe(Error,"BindingError"),vt(),kt(),Et(),hr=n.UnboundTypeError=Oe(Error,"UnboundTypeError"),Mt();var An={u:ut,J:lt,y:Ft,x:Rt,d:xt,k:Dt,I:Vt,n:zt,a:qt,B:Nt,i:Gt,j:Xt,h:Jt,C:Yt,w:Zt,v:Kt,c:Qt,K:en,m:rn,s:nn,b:Ue,z:on,t:sn,r:ln,e:cn,g:fn,q:dn,f:yn,l:mn,p:hn,F:vn,G:$n,H:Cn,D:wn,A:Tn,memory:Q,o:_n,E:Pn,table:jr};it();var Te,Cr=n.___wasm_call_ctors=function(){return(Cr=n.___wasm_call_ctors=n.asm.L).apply(null,arguments)},Ve=n._malloc=function(){return(Ve=n._malloc=n.asm.M).apply(null,arguments)},j=n._free=function(){return(j=n._free=n.asm.N).apply(null,arguments)},wr=n.___getTypeName=function(){return(wr=n.___getTypeName=n.asm.O).apply(null,arguments)};function Wn(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function He(e){function r(){Te||(Te=!0,n.calledRun=!0,Be||(Gr(),Lr(),Y(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),Xr()))}M>0||(Nr(),M>0||(n.setStatus?(n.setStatus("Running..."),setTimeout(function(){setTimeout(function(){n.setStatus("")},1),r()},1)):r()))}if(n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.P).apply(null,arguments)},n.dynCall_viii=function(){return(n.dynCall_viii=n.asm.Q).apply(null,arguments)},n.dynCall_vi=function(){return(n.dynCall_vi=n.asm.R).apply(null,arguments)},n.dynCall_v=function(){return(n.dynCall_v=n.asm.S).apply(null,arguments)},n.dynCall_i=function(){return(n.dynCall_i=n.asm.T).apply(null,arguments)},n.dynCall_iii=function(){return(n.dynCall_iii=n.asm.U).apply(null,arguments)},n.dynCall_ii=function(){return(n.dynCall_ii=n.asm.V).apply(null,arguments)},n.dynCall_vii=function(){return(n.dynCall_vii=n.asm.W).apply(null,arguments)},n.dynCall_iiii=function(){return(n.dynCall_iiii=n.asm.X).apply(null,arguments)},n.dynCall_iiiii=function(){return(n.dynCall_iiiii=n.asm.Y).apply(null,arguments)},n.dynCall_iiiiii=function(){return(n.dynCall_iiiiii=n.asm.Z).apply(null,arguments)},n.dynCall_iiiiiiii=function(){return(n.dynCall_iiiiiiii=n.asm._).apply(null,arguments)},n.dynCall_iiiiiiiii=function(){return(n.dynCall_iiiiiiiii=n.asm.$).apply(null,arguments)},n.dynCall_viiii=function(){return(n.dynCall_viiii=n.asm.aa).apply(null,arguments)},n.dynCall_iiiiiii=function(){return(n.dynCall_iiiiiii=n.asm.ba).apply(null,arguments)},n.dynCall_iiiiiiiiiiiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiiiiiiiiiiii=n.asm.ca).apply(null,arguments)},n.dynCall_iiiiiiiiiiiiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiiiiiiiiiiiii=n.asm.da).apply(null,arguments)},n.dynCall_iiiiiiiiiiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiiiiiiiiiii=n.asm.ea).apply(null,arguments)},n.dynCall_viiiii=function(){return(n.dynCall_viiiii=n.asm.fa).apply(null,arguments)},n.dynCall_iiiiiiiiii=function(){return(n.dynCall_iiiiiiiiii=n.asm.ga).apply(null,arguments)},n.dynCall_iiiiiiiiiii=function(){return(n.dynCall_iiiiiiiiiii=n.asm.ha).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.ia).apply(null,arguments)},n.dynCall_viiiiii=function(){return(n.dynCall_viiiiii=n.asm.ja).apply(null,arguments)},re=function e(){Te||He(),Te||(re=e)},n.run=He,n.preInit)for(typeof n.preInit=="function"&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.pop()();return He(),k.ready},Ar.exports=Wr;var Er=_e.exports;const kn=On({__proto__:null,default:Sn(Er)},[Er]);export{kn as b}; diff --git a/dist/assets/bg_BG-Zh0O8yIZ.js b/dist/assets/bg_BG-Zh0O8yIZ.js new file mode 100644 index 0000000..2b2d85f --- /dev/null +++ b/dist/assets/bg_BG-Zh0O8yIZ.js @@ -0,0 +1 @@ +const d={firstDayOfWeek:1,_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"януари",February:"февруари",March:"март",April:"април",May:"май",June:"юни",July:"юли",August:"август",September:"септември",October:"октомври",November:"ноември",December:"декември",Jan:"януари",Feb:"февруари",Mar:"март",Apr:"април","May (short)":"май",Jun:"юни",Jul:"юли",Aug:"август",Sep:"септември",Oct:"октомври",Nov:"ноември",Dec:"декември",Sunday:"неделя",Monday:"понеделник",Tuesday:"вторник",Wednesday:"сряда",Thursday:"четвъртък",Friday:"петък",Saturday:"събота",Sun:"нд",Mon:"пн",Tues:"вт",Wed:"ср",Thu:"чт",Fri:"пт",Sat:"сб",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Отдалечаване",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};export{d as default}; diff --git a/dist/assets/bs_BA-EoGo05fu.js b/dist/assets/bs_BA-EoGo05fu.js new file mode 100644 index 0000000..337a06a --- /dev/null +++ b/dist/assets/bs_BA-EoGo05fu.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. e.",_era_bc:"p. n. e.",A:"prijepodne",P:"popodne",AM:"AM",PM:"PM","A.M.":"prijepodne","P.M.":"popodne",January:"januar",February:"februar",March:"mart",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"septembar",October:"oktobar",November:"novembar",December:"decembar",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"maj",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/dist/assets/button-dkwNndhL.js b/dist/assets/button-dkwNndhL.js new file mode 100644 index 0000000..e1ddc7f --- /dev/null +++ b/dist/assets/button-dkwNndhL.js @@ -0,0 +1,19 @@ +import{q as g,H as f,t as r}from"./index-J0iiHjMT.js";import{s as k,r as m,f as x}from"./form-2Iq0hI3D.js";import{c as w,d as y,u as z}from"./interactive-NKzPUNL4.js";import{c as E,d as C,g as L}from"./label2-d2vWQ7x7.js";import{s as S,a as O,c as T}from"./loadable-sxY2K1G3.js";import{c as A,d as F}from"./locale-pfkq1d6A.js";import{c as u}from"./observers-JyBmMU24.js";import{g as h}from"./component-dtiBfYiX.js";import{c as M,d as R,s as I,u as H}from"./t9n-od6MEnI1.js";import{d as j}from"./icon-ZwpY5ksA.js";import{d as G}from"./loader-QqciGs1c.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const P=["lang","role","aria-expanded"],d=new Map;let c;function p(t,e,n=!1){const{el:o}=t,s=n?t.globalAttributes:{};e.filter(i=>!!P.includes(i)&&!!o.hasAttribute(i)).forEach(i=>{const l=o.getAttribute(i);l!==null&&(s[i]=l)}),t.globalAttributes=s}function b(t){t.forEach(({target:e})=>{const[n,o]=d.get(e);p(n,o.attributeFilter)})}function _(t,e){const{el:n}=t,o={attributeFilter:e};d.set(n,[t,o]),p(t,e,!0),c||(c=u("mutation",b)),c.observe(n,o)}function D(t){d.delete(t.el),b(c.takeRecords()),c.disconnect();for(const[e,[,n]]of d.entries())c.observe(e,n)}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const a={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},W=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([loading]:not([disabled])) *,:host([disabled]) *,:host([loading]:not([disabled])) ::slotted(*),:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host button,:host a{--calcite-button-content-margin-internal:0.5rem;--calcite-button-padding-x-internal:7px;--calcite-button-padding-y-internal:3px;padding-block:var(--calcite-button-padding-y-internal);padding-inline:var(--calcite-button-padding-x-internal);position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-radius:0px;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;transition:color var(--calcite-animation-timing) ease-in-out, background-color var(--calcite-animation-timing) ease-in-out, box-shadow var(--calcite-animation-timing) ease-in-out, outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host button:hover,:host a:hover{text-decoration-line:none}:host button span,:host a span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.content{margin-inline:var(--calcite-button-content-margin-internal)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-content-margin-internal:0.75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-button-content-margin-internal:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-button-content-margin-internal)}.icon{position:relative;margin:0px;display:inline-flex;font-weight:var(--calcite-font-weight-normal);line-height:inherit}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([loading]:not([disabled])) button,:host([loading]:not([disabled])) a{opacity:var(--calcite-ui-opacity-disabled)}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(0.5)}100%{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}100%{inline-size:0;opacity:0;transform:scale(0.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0px;transition:inline-size var(--calcite-internal-animation-timing-slow) ease-in-out, opacity var(--calcite-internal-animation-timing-slow) ease-in-out, transform var(--calcite-internal-animation-timing-slow) ease-in-out}.calcite-button--loader calcite-loader.loading-in{animation-name:loader-in;animation-duration:var(--calcite-internal-animation-timing-slow)}.calcite-button--loader calcite-loader.loading-out{animation-name:loader-out;animation-duration:var(--calcite-internal-animation-timing-slow)}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-button-content-margin-internal)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{border-width:1px;border-style:solid;border-color:transparent}:host([kind=brand]) button,:host([kind=brand]) a{background-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) button:focus,:host([kind=brand]) a:hover,:host([kind=brand]) a:focus{background-color:var(--calcite-ui-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{background-color:var(--calcite-ui-brand-press)}:host([kind=brand]) button calcite-loader,:host([kind=brand]) a calcite-loader{color:var(--calcite-ui-text-inverse)}:host([kind=danger]) button,:host([kind=danger]) a{background-color:var(--calcite-ui-danger);color:var(--calcite-ui-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) button:focus,:host([kind=danger]) a:hover,:host([kind=danger]) a:focus{background-color:var(--calcite-ui-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{background-color:var(--calcite-ui-danger-press)}:host([kind=danger]) button calcite-loader,:host([kind=danger]) a calcite-loader{color:var(--calcite-ui-text-inverse)}:host([kind=neutral]) button,:host([kind=neutral]) a{background-color:var(--calcite-ui-foreground-3);color:var(--calcite-ui-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) button:focus,:host([kind=neutral]) a:hover,:host([kind=neutral]) a:focus{background-color:var(--calcite-ui-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{background-color:var(--calcite-ui-foreground-1)}:host([kind=neutral]) button calcite-loader,:host([kind=neutral]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{color:var(--calcite-ui-text-inverse);background-color:var(--calcite-ui-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) button:focus,:host([kind=inverse]) a:hover,:host([kind=inverse]) a:focus{background-color:var(--calcite-ui-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{background-color:var(--calcite-ui-inverse-press)}:host([kind=inverse]) button calcite-loader,:host([kind=inverse]) a calcite-loader{color:var(--calcite-ui-text-inverse)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{border-width:1px;border-style:solid;background-color:var(--calcite-ui-foreground-1);box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{border-color:var(--calcite-ui-brand);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{border-color:var(--calcite-ui-brand-hover);color:var(--calcite-ui-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-brand);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{border-color:var(--calcite-ui-brand-press);color:var(--calcite-ui-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{color:var(--calcite-ui-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{border-color:var(--calcite-ui-danger);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{border-color:var(--calcite-ui-danger-hover);color:var(--calcite-ui-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{border-color:var(--calcite-ui-danger);color:var(--calcite-ui-danger);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{border-color:var(--calcite-ui-danger-press);color:var(--calcite-ui-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{color:var(--calcite-ui-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-border-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-ui-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button calcite-loader,:host([appearance=outline-fill][kind=neutral]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-inverse)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{border-color:var(--calcite-ui-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{border-color:var(--calcite-ui-inverse);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{border-color:var(--calcite-ui-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse-press)}:host([appearance=outline-fill][kind=inverse]) button calcite-loader,:host([appearance=outline-fill][kind=inverse]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline]) button,:host([appearance=outline]) a{border-width:1px;border-style:solid;background-color:transparent;box-shadow:inset 0 0 0 1px transparent}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{border-color:var(--calcite-ui-brand);background-color:transparent;color:var(--calcite-ui-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{border-color:var(--calcite-ui-brand-hover);color:var(--calcite-ui-brand-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-brand);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{border-color:var(--calcite-ui-brand-press);color:var(--calcite-ui-brand-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{color:var(--calcite-ui-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{border-color:var(--calcite-ui-danger);background-color:transparent;color:var(--calcite-ui-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{border-color:var(--calcite-ui-danger-hover);color:var(--calcite-ui-danger-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{border-color:var(--calcite-ui-danger);color:var(--calcite-ui-danger);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{border-color:var(--calcite-ui-danger-press);color:var(--calcite-ui-danger-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{color:var(--calcite-ui-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{background-color:transparent;color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-border-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{box-shadow:inset 0 0 0 1px var(--calcite-ui-foreground-3)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{box-shadow:inset 0 0 0 2px var(--calcite-ui-foreground-3)}:host([appearance=outline][kind=neutral]) button calcite-loader,:host([appearance=outline][kind=neutral]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{background-color:transparent;color:var(--calcite-ui-text-1);border-color:var(--calcite-ui-inverse)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{border-color:var(--calcite-ui-inverse-hover);box-shadow:inset 0 0 0 1px var(--calcite-ui-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{border-color:var(--calcite-ui-inverse);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{border-color:var(--calcite-ui-inverse-press);box-shadow:inset 0 0 0 2px var(--calcite-ui-inverse-press)}:host([appearance=outline][kind=inverse]) button calcite-loader,:host([appearance=outline][kind=inverse]) a calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:transparent}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) button:focus,:host([appearance=transparent]:not(.enable-editing-button)) a:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:focus{background-color:var(--calcite-button-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-button-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{color:var(--calcite-ui-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{color:var(--calcite-ui-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{color:var(--calcite-ui-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{color:var(--calcite-ui-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{color:var(--calcite-ui-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{color:var(--calcite-ui-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{color:var(--calcite-ui-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{color:var(--calcite-ui-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{color:var(--calcite-ui-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{color:var(--calcite-ui-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{color:var(--calcite-ui-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{border-block-start-width:1px;border-block-end-width:1px;color:var(--calcite-ui-text-3);border-block-start-color:var(--calcite-ui-border-input);border-block-end-color:var(--calcite-ui-border-input);border-block-style:solid}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:not(.content--slotted){--calcite-button-padding-y-internal:0}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{color:var(--calcite-ui-text-1)}:host([appearance=transparent][kind=neutral].enable-editing-button) button{background-color:transparent}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button,:host([appearance=transparent][kind=inverse]) a,:host([appearance=transparent][kind=inverse]) calcite-loader{color:var(--calcite-ui-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-button-padding-y-internal:3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-button-padding-x-internal:11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-button-padding-y-internal:7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-button-padding-x-internal:0.75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-button-padding-x-internal:15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-button-padding-x-internal:1rem;--calcite-button-padding-y-internal:11px}:host([scale=l]) .button-padding--shrunk{--calcite-button-padding-y-internal:9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-button-padding-x-internal:0.125rem;--calcite-button-padding-y-internal:9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-y-internal:0.625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-button-padding-x-internal:43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-button-padding-x-internal:2.75rem}:host([hidden]){display:none}[hidden]{display:none}`,B=g(class extends f{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=u("mutation",()=>this.updateHasContent()),this.resizeObserver=u("resize",()=>this.setTooltipText()),this.handleClick=()=>{const{type:t}=this;this.href||(t==="submit"?k(this):t==="reset"&&m(this))},this.setTooltipText=()=>{const{contentEl:t}=this;t&&(this.tooltipText=t.offsetWidth{var e;this.childEl=t,t&&((e=this.resizeObserver)==null||e.observe(t))},this.alignment="center",this.appearance="solid",this.label=void 0,this.kind="brand",this.disabled=!1,this.form=void 0,this.href=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.name=void 0,this.rel=void 0,this.round=!1,this.scale="m",this.splitChild=!1,this.target=void 0,this.type="button",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.hasContent=!1,this.hasLoader=!1,this.effectiveLocale="",this.defaultMessages=void 0,this.tooltipText=void 0,this.globalAttributes={ariaExpanded:void 0}}loadingChanged(t,e){t&&!e&&(this.hasLoader=!0),!t&&e&&window.setTimeout(()=>{this.hasLoader=!1},300)}onMessagesChange(){}async connectedCallback(){w(this),A(this),M(this),_(this,["aria-expanded"]),this.hasLoader=this.loading,this.setupTextContentObserver(),E(this),this.formEl=x(this)}disconnectedCallback(){var t,e;(t=this.mutationObserver)==null||t.disconnect(),y(this),C(this),F(this),R(this),(e=this.resizeObserver)==null||e.disconnect(),this.formEl=null,D(this)}async componentWillLoad(){S(this),this.updateHasContent(),await I(this)}componentDidLoad(){O(this),this.setTooltipText()}componentDidRender(){z(this)}render(){const t=this.href?"a":"button",e=t,n=this.hasLoader?r("div",{class:a.buttonLoader},r("calcite-loader",{class:this.loading?a.loadingIn:a.loadingOut,inline:!0,label:this.messages.loading,scale:this.scale==="l"?"m":"s"})):null,o=!this.iconStart&&!this.iconEnd,s=r("calcite-icon",{class:{[a.icon]:!0,[a.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:h(this.scale)}),i=r("calcite-icon",{class:{[a.icon]:!0,[a.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:h(this.scale)}),l=r("span",{class:a.content,ref:v=>this.contentEl=v},r("slot",null));return r(e,{"aria-label":this.loading?this.messages.loading:L(this),"aria-live":"polite",class:{[a.buttonPadding]:o,[a.buttonPaddingShrunk]:!o,[a.contentSlotted]:this.hasContent,[a.iconStartEmpty]:!this.iconStart,[a.iconEndEmpty]:!this.iconEnd},disabled:this.disabled||this.loading,href:t==="a"&&this.href,name:t==="button"&&this.name,onClick:this.handleClick,rel:t==="a"&&this.rel,tabIndex:this.disabled||this.loading?-1:null,target:t==="a"&&this.target,title:this.tooltipText,type:t==="button"&&this.type,...this.globalAttributes,ref:this.setChildEl},n,this.iconStart?s:null,this.hasContent?l:null,this.iconEnd?i:null)}async setFocus(){var t;await T(this),(t=this.childEl)==null||t.focus()}effectiveLocaleChange(){H(this,this.effectiveLocale)}updateHasContent(){var e,n;const t=this.el.textContent.trim().length>0||this.el.childNodes.length>0;this.hasContent=this.el.childNodes.length===1&&((e=this.el.childNodes[0])==null?void 0:e.nodeName)==="#text"?((n=this.el.textContent)==null?void 0:n.trim().length)>0:t}setupTextContentObserver(){var t;(t=this.mutationObserver)==null||t.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{loading:["loadingChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return W}},[1,"calcite-button",{alignment:[513],appearance:[513],label:[1],kind:[513],disabled:[516],form:[513],href:[513],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],loading:[516],name:[513],rel:[513],round:[516],scale:[513],splitChild:[520,"split-child"],target:[513],type:[513],width:[513],messages:[1040],messageOverrides:[1040],hasContent:[32],hasLoader:[32],effectiveLocale:[32],defaultMessages:[32],tooltipText:[32],globalAttributes:[32],setFocus:[64]}]);function U(){if(typeof customElements>"u")return;["calcite-button","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-button":customElements.get(e)||customElements.define(e,B);break;case"calcite-icon":customElements.get(e)||j();break;case"calcite-loader":customElements.get(e)||G();break}})}U();export{B,U as d}; diff --git a/dist/assets/ca_ES-hscFeNNn.js b/dist/assets/ca_ES-hscFeNNn.js new file mode 100644 index 0000000..36fafe3 --- /dev/null +++ b/dist/assets/ca_ES-hscFeNNn.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"dC",_era_bc:"aC",A:"a. m.",P:"p. m.",AM:"a. m.",PM:"p. m.","A.M.":"a. m.","P.M.":"p. m.",January:"de gener",February:"de febrer",March:"de març",April:"d’abril",May:"de maig",June:"de juny",July:"de juliol",August:"d’agost",September:"de setembre",October:"d’octubre",November:"de novembre",December:"de desembre",Jan:"de gen.",Feb:"de febr.",Mar:"de març",Apr:"d’abr.","May(short)":"de maig",Jun:"de juny",Jul:"de jul.",Aug:"d’ag.",Sep:"de set.",Oct:"d’oct.",Nov:"de nov.",Dec:"de des.",Sunday:"diumenge",Monday:"dilluns",Tuesday:"dimarts",Wednesday:"dimecres",Thursday:"dijous",Friday:"divendres",Saturday:"dissabte",Sun:"dg.",Mon:"dl.",Tue:"dt.",Wed:"dc.",Thu:"dj.",Fri:"dv.",Sat:"ds.",_dateOrd:function(d){let e="th";if(d<11||d>13)switch(d%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Reprodueix",Stop:"Parada",Legend:"Llegenda","Press ENTER to toggle":"",Loading:"S'està carregant",Home:"Inici",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimeix",Image:"Imatge",Data:"Dades",Print:"Imprimeix","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"De %1 a %2","From %1":"De %1","To %1":"A %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/dist/assets/calcite-action-bar-yKX8eCZY.js b/dist/assets/calcite-action-bar-yKX8eCZY.js new file mode 100644 index 0000000..c24f8fa --- /dev/null +++ b/dist/assets/calcite-action-bar-yKX8eCZY.js @@ -0,0 +1,9 @@ +import{ch as T,t as r,cn as H,q as O,H as D,r as k,kr as v,h7 as A,ks as B,x as G}from"./index-J0iiHjMT.js";import{c as M,d as $}from"./conditionalSlot-e55zipTI.js";import{a as q,s as P,c as R}from"./loadable-sxY2K1G3.js";import{c as W,d as I}from"./locale-pfkq1d6A.js";import{c as E}from"./observers-JyBmMU24.js";import{u as F,c as _,s as U,d as j}from"./t9n-od6MEnI1.js";import{S as m,d as J}from"./action-group-8XaPC2xM.js";import{S as K,d as Q}from"./action-menu-h_LAlWK7.js";import{d as V}from"./action-W5zDPNjG.js";import{d as X}from"./icon-ZwpY5ksA.js";import{d as Y}from"./loader-QqciGs1c.js";import{d as Z}from"./popover-Jm1QI0N1.js";import{d as N}from"./debounce-HnHf1UOZ.js";import"./key-qdHumIlA.js";import"./guid-6vN-YNJI.js";import"./interactive-NKzPUNL4.js";import"./component-dtiBfYiX.js";import"./floating-ui-McpI0u1Z.js";import"./openCloseComponent-yw47Oy2q.js";import"./FloatingArrow-BghsONry.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const tt=150,et=2,C=t=>t.reduce((e,o)=>e+o,0)/t.length,ot=t=>{const e=t.filter(s=>s.slot!==m.menuActions),o=e==null?void 0:e.length;return{actionWidth:o?C(e.map(s=>s.clientWidth||0)):0,actionHeight:o?C(e.map(s=>s.clientHeight||0)):0}},st=({width:t,actionWidth:e,layout:o,height:s,actionHeight:c,groupCount:i})=>{const a=o==="horizontal"?t:s,n=o==="horizontal"?e:c;return Math.floor((a-i*et)/n)},nt=({layout:t,actionCount:e,actionWidth:o,width:s,actionHeight:c,height:i,groupCount:a})=>Math.max(e-st({width:s,actionWidth:o,layout:t,height:i,actionHeight:c,groupCount:a}),0),x=t=>Array.from(t.querySelectorAll("calcite-action")).filter(e=>e.closest("calcite-action-menu")?e.slot===K.trigger:!0),it=({actionGroups:t,expanded:e,overflowCount:o})=>{let s=o;t.reverse().forEach(c=>{let i=0;const a=x(c).reverse();a.forEach(n=>{n.slot===m.menuActions&&(n.removeAttribute("slot"),n.textEnabled=e)}),s>0&&a.some(n=>(a.filter(l=>!l.slot).length>1&&a.length>2&&!n.closest("calcite-action-menu")&&(n.textEnabled=!0,n.setAttribute("slot",m.menuActions),i++,i>1&&s--),s<1)),H(c)})},y={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function at(t,e){var o;return t||((o=e.closest("calcite-shell-panel"))==null?void 0:o.position)||"start"}function f({el:t,expanded:e}){x(t).filter(o=>o.slot!==m.menuActions).forEach(o=>o.textEnabled=e),t.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=e)}const ct=({tooltip:t,referenceElement:e,expanded:o,ref:s})=>(t&&(t.referenceElement=!o&&e?e:null),s&&s(e),e),lt=({expanded:t,expandText:e,collapseText:o,toggle:s,el:c,position:i,tooltip:a,ref:n,scale:h})=>{const l=T(c)==="rtl",u=t?o:e,d=[y.chevronsLeft,y.chevronsRight];l&&d.reverse();const p=at(i,c)==="end",g=p?d[1]:d[0],z=p?d[0]:d[1];return r("calcite-action",{icon:t?g:z,onClick:s,scale:h,text:u,textEnabled:t,title:!t&&!a?u:null,ref:L=>ct({tooltip:a,referenceElement:L,expanded:t,ref:n})})};/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const rt={actionGroupEnd:"action-group--end"},b={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},dt=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;--calcite-action-bar-expanded-max-width:auto}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=vertical][overflow-actions-disabled]){overflow-y:auto}:host([layout=horizontal][overflow-actions-disabled]){overflow-x:auto}:host([layout=vertical][expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width)}::slotted(calcite-action-group){border-block-end:1px solid var(--calcite-ui-border-3)}:host([layout=horizontal]) ::slotted(calcite-action-group){border-block-end:0;border-inline-end:1px solid var(--calcite-ui-border-3)}:host([layout=horizontal][expand-disabled]) ::slotted(calcite-action-group:last-of-type){border-inline-end:0}::slotted(calcite-action-group:last-child){border-block-end:0;border-inline-end:0}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",w=O(class extends D{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=k(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:t,expanded:e}=this;f({el:t,expanded:e}),this.overflowActions()}),this.resizeObserver=E("resize",t=>this.resizeHandlerEntries(t)),this.actionMenuOpenHandler=t=>{if(t.target.menuOpen){const e=t.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{e.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=t=>{t.forEach(this.resizeHandler)},this.resizeHandler=t=>{const{width:e,height:o}=t.contentRect;this.resize({width:e,height:o})},this.resize=N(({width:t,height:e})=>{const{el:o,expanded:s,expandDisabled:c,layout:i,overflowActionsDisabled:a}=this;if(a||i==="vertical"&&!e||i==="horizontal"&&!t)return;const n=x(o),h=c?n.length:n.length+1,l=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(l);const u=this.hasActionsEnd||this.hasBottomActions||!c?l.length+1:l.length,{actionHeight:d,actionWidth:p}=ot(n),g=nt({layout:i,actionCount:h,actionHeight:d,actionWidth:p,height:e,width:t,groupCount:u});it({actionGroups:l,expanded:s,overflowCount:g})},tt),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.setExpandToggleRef=t=>{this.expandToggleEl=t},this.handleDefaultSlotChange=t=>{const e=v(t).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(e)},this.handleActionsEndSlotChange=t=>{this.hasActionsEnd=A(t)},this.handleBottomActionsSlotChange=t=>{this.hasBottomActions=A(t)},this.handleTooltipSlotChange=t=>{const e=v(t).filter(o=>o==null?void 0:o.matches("calcite-tooltip"));this.expandTooltip=e[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:t,expanded:e}=this;f({el:t,expanded:e}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(t){var e,o;if(t){(e=this.resizeObserver)==null||e.disconnect();return}(o=this.resizeObserver)==null||o.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){F(this,this.effectiveLocale)}componentDidLoad(){const{el:t,expanded:e}=this;q(this),f({el:t,expanded:e}),this.overflowActions()}connectedCallback(){var o,s;const{el:t,expanded:e}=this;W(this),_(this),f({el:t,expanded:e}),(o=this.mutationObserver)==null||o.observe(t,{childList:!0,subtree:!0}),this.overflowActionsDisabled||(s=this.resizeObserver)==null||s.observe(t),this.overflowActions(),M(this)}async componentWillLoad(){P(this),await U(this)}disconnectedCallback(){var t,e;(t=this.mutationObserver)==null||t.disconnect(),(e=this.resizeObserver)==null||e.disconnect(),$(this),I(this),j(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await R(this),B(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(t){t.forEach(e=>e.layout=this.layout)}renderBottomActionGroup(){const{expanded:t,expandDisabled:e,el:o,position:s,toggleExpand:c,scale:i,layout:a,messages:n,actionsEndGroupLabel:h}=this,l=e?null:r(lt,{collapseText:n.collapse,el:o,expandText:n.expand,expanded:t,position:s,scale:i,toggle:c,tooltip:this.expandTooltip,ref:this.setExpandToggleRef});return r("calcite-action-group",{class:rt.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:h,layout:a,scale:i},r("slot",{name:b.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),r("slot",{name:b.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),r("slot",{name:b.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),l)}render(){return r(G,{onCalciteActionMenuOpen:this.actionMenuOpenHandler},r("slot",{onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return dt}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]}]);function S(){if(typeof customElements>"u")return;["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,w);break;case"calcite-action":customElements.get(e)||V();break;case"calcite-action-group":customElements.get(e)||J();break;case"calcite-action-menu":customElements.get(e)||Q();break;case"calcite-icon":customElements.get(e)||X();break;case"calcite-loader":customElements.get(e)||Y();break;case"calcite-popover":customElements.get(e)||Z();break}})}S();const kt=w,Bt=S;export{kt as CalciteActionBar,Bt as defineCustomElement}; diff --git a/dist/assets/calcite-action-group-_Xoggrsa.js b/dist/assets/calcite-action-group-_Xoggrsa.js new file mode 100644 index 0000000..daf7a4f --- /dev/null +++ b/dist/assets/calcite-action-group-_Xoggrsa.js @@ -0,0 +1,5 @@ +import{A as o,d as t}from"./action-group-8XaPC2xM.js";import"./index-J0iiHjMT.js";import"./conditionalSlot-e55zipTI.js";import"./observers-JyBmMU24.js";import"./loadable-sxY2K1G3.js";import"./locale-pfkq1d6A.js";import"./key-qdHumIlA.js";import"./t9n-od6MEnI1.js";import"./action-menu-h_LAlWK7.js";import"./guid-6vN-YNJI.js";import"./action-W5zDPNjG.js";import"./interactive-NKzPUNL4.js";import"./component-dtiBfYiX.js";import"./icon-ZwpY5ksA.js";import"./loader-QqciGs1c.js";import"./popover-Jm1QI0N1.js";import"./floating-ui-McpI0u1Z.js";import"./debounce-HnHf1UOZ.js";import"./openCloseComponent-yw47Oy2q.js";import"./FloatingArrow-BghsONry.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const g=o,h=t;export{g as CalciteActionGroup,h as defineCustomElement}; diff --git a/dist/assets/calcite-action-mEzyoc-Z.js b/dist/assets/calcite-action-mEzyoc-Z.js new file mode 100644 index 0000000..6f70815 --- /dev/null +++ b/dist/assets/calcite-action-mEzyoc-Z.js @@ -0,0 +1,5 @@ +import{A as t,d as o}from"./action-W5zDPNjG.js";import"./index-J0iiHjMT.js";import"./guid-6vN-YNJI.js";import"./interactive-NKzPUNL4.js";import"./loadable-sxY2K1G3.js";import"./locale-pfkq1d6A.js";import"./key-qdHumIlA.js";import"./observers-JyBmMU24.js";import"./component-dtiBfYiX.js";import"./t9n-od6MEnI1.js";import"./icon-ZwpY5ksA.js";import"./loader-QqciGs1c.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const A=t,C=o;export{A as CalciteAction,C as defineCustomElement}; diff --git a/dist/assets/calcite-button-tOn16zeN.js b/dist/assets/calcite-button-tOn16zeN.js new file mode 100644 index 0000000..e2b7d39 --- /dev/null +++ b/dist/assets/calcite-button-tOn16zeN.js @@ -0,0 +1,5 @@ +import{B as t,d as o}from"./button-dkwNndhL.js";import"./index-J0iiHjMT.js";import"./form-2Iq0hI3D.js";import"./interactive-NKzPUNL4.js";import"./label2-d2vWQ7x7.js";import"./loadable-sxY2K1G3.js";import"./locale-pfkq1d6A.js";import"./key-qdHumIlA.js";import"./observers-JyBmMU24.js";import"./component-dtiBfYiX.js";import"./t9n-od6MEnI1.js";import"./icon-ZwpY5ksA.js";import"./loader-QqciGs1c.js";import"./guid-6vN-YNJI.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const C=t,E=o;export{C as CalciteButton,E as defineCustomElement}; diff --git a/dist/assets/calcite-checkbox-OaFCWd7i.js b/dist/assets/calcite-checkbox-OaFCWd7i.js new file mode 100644 index 0000000..deb1cf7 --- /dev/null +++ b/dist/assets/calcite-checkbox-OaFCWd7i.js @@ -0,0 +1,19 @@ +import{q as n,H as a,r as o,t,v as l,x as r}from"./index-J0iiHjMT.js";import{c as h,d,H as u}from"./form-2Iq0hI3D.js";import{g as m}from"./guid-6vN-YNJI.js";import{c as b,d as g,u as p}from"./interactive-NKzPUNL4.js";import{i as k}from"./key-qdHumIlA.js";import{c as f,d as v,g as x}from"./label2-d2vWQ7x7.js";import{c as C,s as y,a as w}from"./loadable-sxY2K1G3.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const z=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([scale=s]){--calcite-checkbox-size:0.75rem}:host([scale=m]){--calcite-checkbox-size:var(--calcite-font-size--1)}:host([scale=l]){--calcite-checkbox-size:1rem}:host{position:relative;display:inline-flex;cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}:host .check-svg,:host .toggle{inline-size:var(--calcite-checkbox-size);block-size:var(--calcite-checkbox-size)}:host .check-svg{pointer-events:none;box-sizing:border-box;display:block;overflow:hidden;background-color:var(--calcite-ui-foreground-1);fill:currentColor;stroke:currentColor;stroke-width:1;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;box-shadow:inset 0 0 0 1px var(--calcite-ui-border-input);color:var(--calcite-ui-background)}:host([checked]) .check-svg,:host([indeterminate]) .check-svg{background-color:var(--calcite-ui-brand);box-shadow:inset 0 0 0 1px var(--calcite-ui-brand)}:host([hovered]) .toggle .check-svg,:host .toggle:hover .check-svg{box-shadow:inset 0 0 0 2px var(--calcite-ui-brand)}.toggle{position:relative;outline-color:transparent}.toggle:active,.toggle:focus,.toggle:focus-visible{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.toggle::after{content:"";inset-block-start:50%;inset-inline-start:50%;min-block-size:1.5rem;min-inline-size:1.5rem;position:absolute;transform:translateX(-50%) translateY(-50%)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,s=n(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalCheckboxBlur=o(this,"calciteInternalCheckboxBlur",6),this.calciteCheckboxChange=o(this,"calciteCheckboxChange",6),this.calciteInternalCheckboxFocus=o(this,"calciteInternalCheckboxFocus",6),this.checkedPath="M5.5 12L2 8.689l.637-.636L5.5 10.727l8.022-7.87.637.637z",this.indeterminatePath="M13 8v1H3V8z",this.getPath=()=>this.indeterminate?this.indeterminatePath:this.checked?this.checkedPath:"",this.toggle=()=>{this.disabled||(this.checked=!this.checked,this.setFocus(),this.indeterminate=!1,this.calciteCheckboxChange.emit())},this.keyDownHandler=e=>{k(e.key)&&(this.toggle(),e.preventDefault())},this.clickHandler=()=>{this.disabled||this.toggle()},this.onToggleBlur=()=>{this.calciteInternalCheckboxBlur.emit(!1)},this.onToggleFocus=()=>{this.calciteInternalCheckboxFocus.emit(!0)},this.onLabelClick=()=>{this.toggle()},this.checked=!1,this.disabled=!1,this.form=void 0,this.guid=void 0,this.hovered=!1,this.indeterminate=!1,this.label=void 0,this.name=void 0,this.required=!1,this.scale="m",this.value=void 0}async setFocus(){var e;await C(this),(e=this.toggleEl)==null||e.focus()}syncHiddenFormInput(e){e.type="checkbox"}connectedCallback(){this.guid=this.el.id||`calcite-checkbox-${m()}`,b(this),f(this),h(this)}disconnectedCallback(){g(this),v(this),d(this)}componentWillLoad(){y(this)}componentDidLoad(){w(this)}componentDidRender(){p(this)}render(){return t(r,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},t("div",{"aria-checked":l(this.checked),"aria-label":x(this),class:"toggle",onBlur:this.onToggleBlur,onFocus:this.onToggleFocus,role:"checkbox",tabIndex:this.disabled?void 0:0,ref:e=>this.toggleEl=e},t("svg",{"aria-hidden":"true",class:"check-svg",viewBox:"0 0 16 16"},t("path",{d:this.getPath()})),t("slot",null)),t(u,{component:this}))}get el(){return this}static get style(){return z}},[1,"calcite-checkbox",{checked:[1540],disabled:[516],form:[513],guid:[1537],hovered:[516],indeterminate:[1540],label:[1],name:[513],required:[516],scale:[513],value:[8],setFocus:[64]}]);function c(){if(typeof customElements>"u")return;["calcite-checkbox"].forEach(i=>{switch(i){case"calcite-checkbox":customElements.get(i)||customElements.define(i,s);break}})}c();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const P=s,T=c;export{P as CalciteCheckbox,T as defineCustomElement}; diff --git a/dist/assets/calcite-chip-MkTbFpRn.js b/dist/assets/calcite-chip-MkTbFpRn.js new file mode 100644 index 0000000..fc81fe7 --- /dev/null +++ b/dist/assets/calcite-chip-MkTbFpRn.js @@ -0,0 +1,29 @@ +import{q as h,H as p,r as s,h7 as u,t,v as o,x as m}from"./index-J0iiHjMT.js";import{c as v,d as g}from"./conditionalSlot-e55zipTI.js";import{a as b,s as f,c as k}from"./loadable-sxY2K1G3.js";import{u as x,c as C,d as y,s as z}from"./t9n-od6MEnI1.js";import{c as I,u as E,d as w}from"./interactive-NKzPUNL4.js";import{c as S,d as M}from"./locale-pfkq1d6A.js";import{c as L}from"./observers-JyBmMU24.js";import{i as H}from"./key-qdHumIlA.js";import{g as a}from"./component-dtiBfYiX.js";import{d as D}from"./icon-ZwpY5ksA.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const i={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle"},O={image:"image"},c={close:"x",unchecked:"circle",checkedSingle:"circle-f",checked:"check-circle-f"},T=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host([scale=s]){block-size:1.5rem;font-size:var(--calcite-font-size--2);--calcite-chip-spacing-s-internal:0.25rem;--calcite-chip-spacing-l-internal:0.5rem}:host([scale=s]) .close,:host([scale=s]) .select-icon--active{block-size:1rem;inline-size:1rem}:host([scale=s]) .image-container{block-size:1.25rem;inline-size:1.25rem}:host([scale=s]) .container.is-circle{block-size:1.5rem;inline-size:1.5rem}:host([scale=m]){block-size:2rem;font-size:var(--calcite-font-size--1);--calcite-chip-spacing-s-internal:0.375rem;--calcite-chip-spacing-l-internal:0.5rem}:host([scale=m]) .close,:host([scale=m]) .image-container,:host([scale=m]) .select-icon--active{block-size:1.5rem;inline-size:1.5rem}:host([scale=m]) .container.is-circle{block-size:2rem;inline-size:2rem}:host([scale=l]){block-size:2.75rem;font-size:var(--calcite-font-size-0);--calcite-chip-spacing-s-internal:0.5rem;--calcite-chip-spacing-l-internal:0.75rem}:host([scale=l]) .image-container,:host([scale=l]) .close,:host([scale=l]) .select-icon--active{block-size:2rem;inline-size:2rem}:host([scale=l]) .container.is-circle{block-size:2.75rem;inline-size:2.75rem}:host{display:inline-flex;cursor:default;border-radius:9999px}.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1);font-weight:var(--calcite-font-weight-medium);outline-color:transparent}.container:not(.is-circle){padding-inline:var(--calcite-chip-spacing-s-internal)}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([scale=s]) .container.image--slotted{padding-inline-start:calc(0.125rem / 2)}:host([scale=s]) .container.is-circle{padding-inline:0}.container.text--slotted .title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding-inline:var(--calcite-chip-spacing-s-internal)}.container:not(.text--slotted) .title{display:none}.container:not(.image--slotted) .image-container{display:none}.container.closable{padding-inline-end:calc(var(--calcite-chip-spacing-l-internal) / 2)}.container:not(.is-circle).image--slotted{padding-inline-start:calc(var(--calcite-chip-spacing-l-internal) / 2)}.container:not(.is-circle).image--slotted .image-container{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle).image--slotted .image-container~.chip-icon{margin-inline-start:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle).selectable:not(.text--slotted) .chip-icon{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.selectable):not(.text--slotted) .chip-icon{margin-inline-start:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.text--slotted) .chip-icon{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.text-slotted).image--slotted .image-container{margin-inline-end:var(--calcite-chip-spacing-s-internal)}.container:not(.is-circle):not(.closable):not(.text--slotted).image--slotted.selectable .image-container{margin-inline-end:0}.container:not(.is-circle):not(.closable):not(.text--slotted).image--slotted.selectable .image-container~.chip-icon{margin-inline-start:calc(var(--calcite-chip-spacing-s-internal) * 2)}.chip-icon{position:relative;margin-block:0px;display:inline-flex;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);margin-inline:var(--calcite-chip-spacing-s-internal)}.image-container{display:inline-flex;overflow:hidden;align-items:center;justify-content:center;pointer-events:none}.close{margin:0px;cursor:pointer;align-items:center;border-style:none;background-color:transparent;color:var(--calcite-ui-text-1);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;-webkit-appearance:none;display:flex;border-radius:50%;align-content:center;justify-content:center;--calcite-chip-transparent-hover:var(--calcite-button-transparent-hover);--calcite-chip-transparent-press:var(--calcite-button-transparent-press)}.close:hover{background-color:var(--calcite-chip-transparent-hover)}.close:focus{background-color:var(--calcite-chip-transparent-hover);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.close:active{background-color:var(--calcite-chip-transparent-press)}.close calcite-icon{color:inherit}.select-icon{align-self:center;justify-content:center;align-items:center;display:flex;inset-block-start:-1px;position:relative;visibility:hidden;inline-size:0;opacity:0;transition:opacity 0.15s ease-in-out, inline-size 0.15s ease-in-out}.select-icon.select-icon--active{visibility:visible;opacity:0.5}.container:not(.is-circle).image--slotted .select-icon.select-icon--active{margin-inline-end:var(--calcite-chip-spacing-s-internal)}:host([selected]) .select-icon{opacity:1}.container:hover .select-icon--active{opacity:1}slot[name=image]::slotted(*){display:flex;block-size:100%;inline-size:100%;overflow:hidden;border-radius:50%}:host([kind=neutral]){background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}:host([kind=neutral]) .container{border-color:transparent}:host([kind=neutral]) .close{color:var(--calcite-ui-text-3)}:host([kind=neutral]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([kind=inverse]){background-color:var(--calcite-ui-inverse);color:var(--calcite-ui-text-inverse)}:host([kind=inverse]) .container{border-color:transparent}:host([kind=inverse]) .close{color:var(--calcite-ui-text-inverse)}:host([kind=inverse]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-inverse))}:host([kind=brand]){background-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-inverse)}:host([kind=brand]) .container{border-color:transparent}:host([kind=brand]) .close{color:var(--calcite-ui-text-inverse)}:host([kind=brand]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-inverse))}:host([appearance=outline-fill]),:host([appearance=outline]){background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1)}:host([appearance=outline-fill]) .close,:host([appearance=outline]) .close{color:var(--calcite-ui-text-3)}:host([appearance=outline-fill]) .chip-icon,:host([appearance=outline]) .chip-icon{color:var(--calcite-ui-icon-color, var(--calcite-ui-text-3))}:host([appearance=outline-fill]){background-color:var(--calcite-ui-foreground-1)}:host([appearance=outline]){background-color:transparent}:host([kind=neutral][appearance=outline-fill]) .container,:host([kind=neutral][appearance=outline]) .container{border-color:var(--calcite-ui-border-1)}:host([kind=inverse][appearance=outline-fill]) .container,:host([kind=inverse][appearance=outline]) .container{border-color:var(--calcite-ui-border-inverse)}:host([kind=brand][appearance=outline-fill]) .container,:host([kind=brand][appearance=outline]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand][appearance=solid]) button,:host([kind=inverse][appearance=solid]) button{outline-color:var(--calcite-ui-text-inverse)}:host([closed]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([hidden]){display:none}[hidden]{display:none}`,l=h(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteChipClose=s(this,"calciteChipClose",6),this.calciteChipSelect=s(this,"calciteChipSelect",6),this.calciteInternalChipKeyEvent=s(this,"calciteInternalChipKeyEvent",6),this.mutationObserver=L("mutation",()=>this.updateHasText()),this.close=()=>{this.calciteChipClose.emit(),this.selected=!1,this.closed=!0},this.closeButtonKeyDownHandler=e=>{H(e.key)&&(e.preventDefault(),this.close())},this.handleSlotImageChange=e=>{this.hasImage=u(e)},this.handleEmittingEvent=()=>{this.interactive&&this.calciteChipSelect.emit()},this.disabled=!1,this.appearance="solid",this.kind="neutral",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.label=void 0,this.value=void 0,this.closed=!1,this.selectionMode="none",this.selected=!1,this.messageOverrides=void 0,this.messages=void 0,this.interactive=!1,this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasText=!1,this.hasImage=!1}onMessagesChange(){}effectiveLocaleChange(){x(this,this.effectiveLocale)}connectedCallback(){var e;v(this),I(this),S(this),C(this),(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0,subtree:!0})}componentDidLoad(){b(this)}componentDidRender(){E(this)}disconnectedCallback(){var e;g(this),w(this),M(this),y(this),(e=this.mutationObserver)==null||e.disconnect()}async componentWillLoad(){f(this),await z(this),this.updateHasText()}keyDownHandler(e){if(e.target===this.el)switch(e.key){case" ":case"Enter":this.handleEmittingEvent(),e.preventDefault();break;case"ArrowRight":case"ArrowLeft":case"Home":case"End":this.calciteInternalChipKeyEvent.emit(e),e.preventDefault();break}}clickHandler(){!this.interactive&&this.closable&&this.closeButtonEl.focus()}async setFocus(){var e,n;await k(this),!this.disabled&&this.interactive?(e=this.containerEl)==null||e.focus():!this.disabled&&this.closable&&((n=this.closeButtonEl)==null||n.focus())}updateHasText(){this.hasText=this.el.textContent.trim().length>0}renderChipImage(){return t("div",{class:i.imageContainer},t("slot",{name:O.image,onSlotchange:this.handleSlotImageChange}))}renderSelectionIcon(){const e=this.selectionMode==="multiple"&&this.selected?c.checked:this.selectionMode==="multiple"?c.unchecked:this.selected?c.checkedSingle:void 0;return t("div",{class:{[i.selectIcon]:!0,[i.selectIconActive]:this.selectionMode==="multiple"||this.selected}},t("calcite-icon",{icon:e,scale:a(this.scale)}))}renderCloseButton(){return t("button",{"aria-label":this.messages.dismissLabel,class:i.close,onClick:this.close,onKeyDown:this.closeButtonKeyDownHandler,tabIndex:this.disabled?-1:0,ref:e=>this.closeButtonEl=e},t("calcite-icon",{icon:c.close,scale:a(this.scale)}))}renderIcon(){return t("calcite-icon",{class:i.chipIcon,flipRtl:this.iconFlipRtl,icon:this.icon,scale:a(this.scale)})}render(){const e=this.disabled||!this.disabled&&!this.interactive,n=this.selectionMode==="multiple"&&this.interactive?"checkbox":this.selectionMode!=="none"&&this.interactive?"radio":this.interactive?"button":void 0;return t(m,null,t("div",{"aria-checked":this.selectionMode!=="none"&&this.interactive?o(this.selected):void 0,"aria-disabled":e?o(this.disabled):void 0,"aria-label":this.label,class:{[i.container]:!0,[i.textSlotted]:this.hasText,[i.imageSlotted]:this.hasImage,[i.selectable]:this.selectionMode!=="none",[i.multiple]:this.selectionMode==="multiple",[i.closable]:this.closable,[i.nonInteractive]:!this.interactive,[i.isCircle]:!this.closable&&!this.hasText&&(!this.icon||!this.hasImage)&&(this.selectionMode==="none"||!!this.selectionMode&&this.selectionMode!=="multiple"&&!this.selected)},onClick:this.handleEmittingEvent,role:n,tabIndex:e?-1:0,ref:d=>this.containerEl=d},this.selectionMode!=="none"&&this.renderSelectionIcon(),this.renderChipImage(),this.icon&&this.renderIcon(),t("span",{class:i.title},t("slot",null)),this.closable&&this.renderCloseButton()))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return T}},[1,"calcite-chip",{disabled:[516],appearance:[513],kind:[513],closable:[516],icon:[513],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],label:[1],value:[8],closed:[1540],selectionMode:[1,"selection-mode"],selected:[1540],messageOverrides:[1040],messages:[1040],interactive:[4],defaultMessages:[32],effectiveLocale:[32],hasText:[32],hasImage:[32],setFocus:[64]},[[0,"keydown","keyDownHandler"],[0,"click","clickHandler"]]]);function r(){if(typeof customElements>"u")return;["calcite-chip","calcite-icon"].forEach(n=>{switch(n){case"calcite-chip":customElements.get(n)||customElements.define(n,l);break;case"calcite-icon":customElements.get(n)||D();break}})}r();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const W=l,G=r;export{W as CalciteChip,G as defineCustomElement}; diff --git a/dist/assets/calcite-color-picker-iQ658ZQD.js b/dist/assets/calcite-color-picker-iQ658ZQD.js new file mode 100644 index 0000000..030b7df --- /dev/null +++ b/dist/assets/calcite-color-picker-iQ658ZQD.js @@ -0,0 +1,139 @@ +import{q as R,H as V,r as y,db as oe,B as X,dc as re,ch as q,t as c,dd as Ze,x as te,ac as Dt,qB as Pt,ad as Te,qC as Qe,j$ as Mt,qD as Ve,v as Rt}from"./index-J0iiHjMT.js";import{a as de,s as he,c as ue}from"./loadable-sxY2K1G3.js";import{d as ie}from"./icon-ZwpY5ksA.js";import{s as et,c as tt,d as it,H as nt}from"./form-2Iq0hI3D.js";import{c as pe,d as be,u as fe}from"./interactive-NKzPUNL4.js";import{n as Vt,i as Nt}from"./key-qdHumIlA.js";import{c as st,d as at,g as ot}from"./label2-d2vWQ7x7.js";import{n as A,i as K,p as Bt,s as $t,a as Kt,c as me,d as ge,B as Wt}from"./locale-pfkq1d6A.js";import{c as J}from"./observers-JyBmMU24.js";import{u as ve,c as ye,d as xe,s as Ce}from"./t9n-od6MEnI1.js";import{g as M}from"./component-dtiBfYiX.js";import{d as we}from"./progress-puB9lhY4.js";import{r as Ne,c as qt,a as _t}from"./math-SoUQJWjz.js";import{d as Ut}from"./button-dkwNndhL.js";import{d as jt}from"./loader-QqciGs1c.js";import{g as rt}from"./guid-6vN-YNJI.js";import{c as Gt,d as Xt}from"./debounce-HnHf1UOZ.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function lt(e,t,i){return i={path:t,exports:{},require:function(n,s){return Jt()}},e(i,i.exports),i.exports}function Jt(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var Y={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]},Yt=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},Z=lt(function(e){var t=Array.prototype.concat,i=Array.prototype.slice,n=e.exports=function(a){for(var o=[],r=0,l=a.length;r=4&&r[3]!==1&&(l=", "+r[3]),"hwb("+r[0]+", "+r[1]+"%, "+r[2]+"%"+l+")"},s.to.keyword=function(r){return i[r.slice(0,3)]};function a(r,l,d){return Math.min(Math.max(l,r),d)}function o(r){var l=Math.round(r).toString(16).toUpperCase();return l.length<2?"0"+l:l}}),ee={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};const ct={};for(const e of Object.keys(ee))ct[ee[e]]=e;const h={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var _=h;for(const e of Object.keys(h)){if(!("channels"in h[e]))throw new Error("missing channels property: "+e);if(!("labels"in h[e]))throw new Error("missing channel labels property: "+e);if(h[e].labels.length!==h[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:i}=h[e];delete h[e].channels,delete h[e].labels,Object.defineProperty(h[e],"channels",{value:t}),Object.defineProperty(h[e],"labels",{value:i})}h.rgb.hsl=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,s=Math.min(t,i,n),a=Math.max(t,i,n),o=a-s;let r,l;a===s?r=0:t===a?r=(i-n)/o:i===a?r=2+(n-t)/o:n===a&&(r=4+(t-i)/o),r=Math.min(r*60,360),r<0&&(r+=360);const d=(s+a)/2;return a===s?l=0:d<=.5?l=o/(a+s):l=o/(2-a-s),[r,l*100,d*100]};h.rgb.hsv=function(e){let t,i,n,s,a;const o=e[0]/255,r=e[1]/255,l=e[2]/255,d=Math.max(o,r,l),u=d-Math.min(o,r,l),f=function(v){return(d-v)/6/u+1/2};return u===0?(s=0,a=0):(a=u/d,t=f(o),i=f(r),n=f(l),o===d?s=n-i:r===d?s=1/3+t-n:l===d&&(s=2/3+i-t),s<0?s+=1:s>1&&(s-=1)),[s*360,a*100,d*100]};h.rgb.hwb=function(e){const t=e[0],i=e[1];let n=e[2];const s=h.rgb.hsl(e)[0],a=1/255*Math.min(t,Math.min(i,n));return n=1-1/255*Math.max(t,Math.max(i,n)),[s,a*100,n*100]};h.rgb.cmyk=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,s=Math.min(1-t,1-i,1-n),a=(1-t-s)/(1-s)||0,o=(1-i-s)/(1-s)||0,r=(1-n-s)/(1-s)||0;return[a*100,o*100,r*100,s*100]};function Zt(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}h.rgb.keyword=function(e){const t=ct[e];if(t)return t;let i=1/0,n;for(const s of Object.keys(ee)){const a=ee[s],o=Zt(e,a);o.04045?((t+.055)/1.055)**2.4:t/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;const s=t*.4124+i*.3576+n*.1805,a=t*.2126+i*.7152+n*.0722,o=t*.0193+i*.1192+n*.9505;return[s*100,a*100,o*100]};h.rgb.lab=function(e){const t=h.rgb.xyz(e);let i=t[0],n=t[1],s=t[2];i/=95.047,n/=100,s/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;const a=116*n-16,o=500*(i-n),r=200*(n-s);return[a,o,r]};h.hsl.rgb=function(e){const t=e[0]/360,i=e[1]/100,n=e[2]/100;let s,a,o;if(i===0)return o=n*255,[o,o,o];n<.5?s=n*(1+i):s=n+i-n*i;const r=2*n-s,l=[0,0,0];for(let d=0;d<3;d++)a=t+1/3*-(d-1),a<0&&a++,a>1&&a--,6*a<1?o=r+(s-r)*6*a:2*a<1?o=s:3*a<2?o=r+(s-r)*(2/3-a)*6:o=r,l[d]=o*255;return l};h.hsl.hsv=function(e){const t=e[0];let i=e[1]/100,n=e[2]/100,s=i;const a=Math.max(n,.01);n*=2,i*=n<=1?n:2-n,s*=a<=1?a:2-a;const o=(n+i)/2,r=n===0?2*s/(a+s):2*i/(n+i);return[t,r*100,o*100]};h.hsv.rgb=function(e){const t=e[0]/60,i=e[1]/100;let n=e[2]/100;const s=Math.floor(t)%6,a=t-Math.floor(t),o=255*n*(1-i),r=255*n*(1-i*a),l=255*n*(1-i*(1-a));switch(n*=255,s){case 0:return[n,l,o];case 1:return[r,n,o];case 2:return[o,n,l];case 3:return[o,r,n];case 4:return[l,o,n];case 5:return[n,o,r]}};h.hsv.hsl=function(e){const t=e[0],i=e[1]/100,n=e[2]/100,s=Math.max(n,.01);let a,o;o=(2-i)*n;const r=(2-i)*s;return a=i*s,a/=r<=1?r:2-r,a=a||0,o/=2,[t,a*100,o*100]};h.hwb.rgb=function(e){const t=e[0]/360;let i=e[1]/100,n=e[2]/100;const s=i+n;let a;s>1&&(i/=s,n/=s);const o=Math.floor(6*t),r=1-n;a=6*t-o,o&1&&(a=1-a);const l=i+a*(r-i);let d,u,f;switch(o){default:case 6:case 0:d=r,u=l,f=i;break;case 1:d=l,u=r,f=i;break;case 2:d=i,u=r,f=l;break;case 3:d=i,u=l,f=r;break;case 4:d=l,u=i,f=r;break;case 5:d=r,u=i,f=l;break}return[d*255,u*255,f*255]};h.cmyk.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100,s=e[3]/100,a=1-Math.min(1,t*(1-s)+s),o=1-Math.min(1,i*(1-s)+s),r=1-Math.min(1,n*(1-s)+s);return[a*255,o*255,r*255]};h.xyz.rgb=function(e){const t=e[0]/100,i=e[1]/100,n=e[2]/100;let s,a,o;return s=t*3.2406+i*-1.5372+n*-.4986,a=t*-.9689+i*1.8758+n*.0415,o=t*.0557+i*-.204+n*1.057,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[s*255,a*255,o*255]};h.xyz.lab=function(e){let t=e[0],i=e[1],n=e[2];t/=95.047,i/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;const s=116*i-16,a=500*(t-i),o=200*(i-n);return[s,a,o]};h.lab.xyz=function(e){const t=e[0],i=e[1],n=e[2];let s,a,o;a=(t+16)/116,s=i/500+a,o=a-n/200;const r=a**3,l=s**3,d=o**3;return a=r>.008856?r:(a-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,o=d>.008856?d:(o-16/116)/7.787,s*=95.047,a*=100,o*=108.883,[s,a,o]};h.lab.lch=function(e){const t=e[0],i=e[1],n=e[2];let s;s=Math.atan2(n,i)*360/2/Math.PI,s<0&&(s+=360);const o=Math.sqrt(i*i+n*n);return[t,o,s]};h.lch.lab=function(e){const t=e[0],i=e[1],s=e[2]/360*2*Math.PI,a=i*Math.cos(s),o=i*Math.sin(s);return[t,a,o]};h.rgb.ansi16=function(e,t=null){const[i,n,s]=e;let a=t===null?h.rgb.hsv(e)[2]:t;if(a=Math.round(a/50),a===0)return 30;let o=30+(Math.round(s/255)<<2|Math.round(n/255)<<1|Math.round(i/255));return a===2&&(o+=60),o};h.hsv.ansi16=function(e){return h.rgb.ansi16(h.hsv.rgb(e),e[2])};h.rgb.ansi256=function(e){const t=e[0],i=e[1],n=e[2];return t===i&&i===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)};h.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const i=(~~(e>50)+1)*.5,n=(t&1)*i*255,s=(t>>1&1)*i*255,a=(t>>2&1)*i*255;return[n,s,a]};h.ansi256.rgb=function(e){if(e>=232){const a=(e-232)*10+8;return[a,a,a]}e-=16;let t;const i=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,s=t%6/5*255;return[i,n,s]};h.rgb.hex=function(e){const i=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(i.length)+i};h.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let i=t[0];t[0].length===3&&(i=i.split("").map(r=>r+r).join(""));const n=parseInt(i,16),s=n>>16&255,a=n>>8&255,o=n&255;return[s,a,o]};h.rgb.hcg=function(e){const t=e[0]/255,i=e[1]/255,n=e[2]/255,s=Math.max(Math.max(t,i),n),a=Math.min(Math.min(t,i),n),o=s-a;let r,l;return o<1?r=a/(1-o):r=0,o<=0?l=0:s===t?l=(i-n)/o%6:s===i?l=2+(n-t)/o:l=4+(t-i)/o,l/=6,l%=1,[l*360,o*100,r*100]};h.hsl.hcg=function(e){const t=e[1]/100,i=e[2]/100,n=i<.5?2*t*i:2*t*(1-i);let s=0;return n<1&&(s=(i-.5*n)/(1-n)),[e[0],n*100,s*100]};h.hsv.hcg=function(e){const t=e[1]/100,i=e[2]/100,n=t*i;let s=0;return n<1&&(s=(i-n)/(1-n)),[e[0],n*100,s*100]};h.hcg.rgb=function(e){const t=e[0]/360,i=e[1]/100,n=e[2]/100;if(i===0)return[n*255,n*255,n*255];const s=[0,0,0],a=t%1*6,o=a%1,r=1-o;let l=0;switch(Math.floor(a)){case 0:s[0]=1,s[1]=o,s[2]=0;break;case 1:s[0]=r,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=o;break;case 3:s[0]=0,s[1]=r,s[2]=1;break;case 4:s[0]=o,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=r}return l=(1-i)*n,[(i*s[0]+l)*255,(i*s[1]+l)*255,(i*s[2]+l)*255]};h.hcg.hsv=function(e){const t=e[1]/100,i=e[2]/100,n=t+i*(1-t);let s=0;return n>0&&(s=t/n),[e[0],s*100,n*100]};h.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let s=0;return n>0&&n<.5?s=t/(2*n):n>=.5&&n<1&&(s=t/(2*(1-n))),[e[0],s*100,n*100]};h.hcg.hwb=function(e){const t=e[1]/100,i=e[2]/100,n=t+i*(1-t);return[e[0],(n-t)*100,(1-n)*100]};h.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,s=n-t;let a=0;return s<1&&(a=(n-s)/(1-s)),[e[0],s*100,a*100]};h.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};h.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};h.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};h.gray.hsl=function(e){return[0,0,e[0]]};h.gray.hsv=h.gray.hsl;h.gray.hwb=function(e){return[0,100,e[0]]};h.gray.cmyk=function(e){return[0,0,0,e[0]]};h.gray.lab=function(e){return[e[0],0,0]};h.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};h.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function Qt(){const e={},t=Object.keys(_);for(let i=t.length,n=0;n1&&(i=n),e(i))};return"conversion"in e&&(t.conversion=e.conversion),t}function oi(e){const t=function(...i){const n=i[0];if(n==null)return n;n.length>1&&(i=n);const s=e(i);if(typeof s=="object")for(let a=s.length,o=0;o{G[e]={},Object.defineProperty(G[e],"channels",{value:_[e].channels}),Object.defineProperty(G[e],"labels",{value:_[e].labels});const t=ni(e);Object.keys(t).forEach(n=>{const s=t[n];G[e][n]=oi(s),G[e][n].raw=ai(s)})});var T=G;const dt=["keyword","gray","hex"],Ee={};for(const e of Object.keys(T))Ee[[...T[e].labels].sort().join("")]=e;const le={};function I(e,t){if(!(this instanceof I))return new I(e,t);if(t&&t in dt&&(t=null),t&&!(t in T))throw new Error("Unknown model: "+t);let i,n;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof I)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const s=j.get(e);if(s===null)throw new Error("Unable to parse color from string: "+e);this.model=s.model,n=T[this.model].channels,this.color=s.value.slice(0,n),this.valpha=typeof s.value[n]=="number"?s.value[n]:1}else if(e.length>0){this.model=t||"rgb",n=T[this.model].channels;const s=Array.prototype.slice.call(e,0,n);this.color=ze(s,n),this.valpha=typeof e[n]=="number"?e[n]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const s=Object.keys(e);"alpha"in e&&(s.splice(s.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const a=s.sort().join("");if(!(a in Ee))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Ee[a];const{labels:o}=T[this.model],r=[];for(i=0;i(e%360+360)%360),saturationl:C("hsl",1,k(100)),lightness:C("hsl",2,k(100)),saturationv:C("hsv",1,k(100)),value:C("hsv",2,k(100)),chroma:C("hcg",1,k(100)),gray:C("hcg",2,k(100)),white:C("hwb",1,k(100)),wblack:C("hwb",2,k(100)),cyan:C("cmyk",0,k(100)),magenta:C("cmyk",1,k(100)),yellow:C("cmyk",2,k(100)),black:C("cmyk",3,k(100)),x:C("xyz",0,k(95.047)),y:C("xyz",1,k(100)),z:C("xyz",2,k(108.833)),l:C("lab",0,k(100)),a:C("lab",1),b:C("lab",2),keyword(e){return e!==void 0?new I(e):T[this.model].keyword(this.color)},hex(e){return e!==void 0?new I(e):j.to.hex(this.rgb().round().color)},hexa(e){if(e!==void 0)return new I(e);const t=this.rgb().round().color;let i=Math.round(this.valpha*255).toString(16).toUpperCase();return i.length===1&&(i="0"+i),j.to.hex(t)+i},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[i,n]of e.entries()){const s=n/255;t[i]=s<=.04045?s/12.92:((s+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),i=e.luminosity();return t>i?(t+.05)/(i+.05):(i+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return I.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let i=t.color[0];return i=(i+e)%360,i=i<0?360+i:i,t.color[0]=i,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const i=e.rgb(),n=this.rgb(),s=t===void 0?.5:t,a=2*s-1,o=i.alpha()-n.alpha(),r=((a*o===-1?a:(a+o)/(1+a*o))+1)/2,l=1-r;return I.rgb(r*i.red()+l*n.red(),r*i.green()+l*n.green(),r*i.blue()+l*n.blue(),i.alpha()*s+n.alpha()*(1-s))}};for(const e of Object.keys(T)){if(dt.includes(e))continue;const{channels:t}=T[e];I.prototype[e]=function(...i){return this.model===e?new I(this):i.length>0?new I(i,e):new I([...ci(T[this.model][e].raw(this.color)),this.valpha],e)},I[e]=function(...i){let n=i[0];return typeof n=="number"&&(n=ze(i,t)),new I(n,e)}}function ri(e,t){return Number(e.toFixed(t))}function li(e){return function(t){return ri(t,e)}}function C(e,t,i){e=Array.isArray(e)?e:[e];for(const n of e)(le[n]||(le[n]=[]))[t]=i;return e=e[0],function(n){let s;return n!==void 0?(i&&(n=i(n)),s=this[e](),s.color[t]=n,s):(s=this[e]().color[t],i&&(s=i(s)),s)}}function k(e){return function(t){return Math.max(0,Math.min(e,t))}}function ci(e){return Array.isArray(e)?e:[e]}function ze(e,t){for(let i=0;iNumber((e*100).toFixed()),ce=e=>Number((e/100).toFixed(2));function W(e,t=!1){return Ae(e,t)||ut(e,t)}function ht(e,t,i){return e?e.length===t&&i.test(e):!1}function Ae(e,t=!1){return ht(e,t?5:4,t?pi:hi)}function ut(e,t=!1){return ht(e,t?9:7,t?bi:ui)}function D(e,t=!1,i=!1){if(e=e.toLowerCase(),e.startsWith("#")||(e=`#${e}`),Ae(e,t))return He(Be(e,t));if(t&&i&&W(e,!1)){const n=Ae(e,!1);return He(Be(`${e}${n?"f":"ff"}`,!0))}return e}function E(e,t=!1){return t?e.hexa():e.hex()}function He(e){const{r:t,g:i,b:n}=e,s=ne(t),a=ne(i),o=ne(n),r="a"in e?ne(e.a*255):"";return`#${s}${a}${o}${r}`.toLowerCase()}function ne(e){return e.toString(16).padStart(2,"0")}function fi(e){const t={...e,a:e.alpha??1};return delete t.alpha,t}function mi(e){const t={...e,alpha:e.a??1};return delete t.a,t}function Be(e,t=!1){if(!W(e,t))return null;e=e.replace("#","");let i,n,s,a;if(e.length===3||e.length===4){const[r,l,d,u]=e.split("");i=parseInt(`${r}${r}`,16),n=parseInt(`${l}${l}`,16),s=parseInt(`${d}${d}`,16),a=parseInt(`${u}${u}`,16)/255}else i=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),s=parseInt(e.slice(4,6),16),a=parseInt(e.slice(6,8),16)/255;return isNaN(a)?{r:i,g:n,b:s}:{r:i,g:n,b:s,a}}const pt=e=>e,x=pt({HEX:"hex",HEXA:"hexa",RGB_CSS:"rgb-css",RGBA_CSS:"rgba-css",HSL_CSS:"hsl-css",HSLA_CSS:"hsla-css"}),w=pt({RGB:"rgb",RGBA:"rgba",HSL:"hsl",HSLA:"hsla",HSV:"hsv",HSVA:"hsva"});function $e(e){if(typeof e=="string"){if(e.startsWith("#")){const{length:t}=e;if(t===4||t===7)return x.HEX;if(t===5||t===9)return x.HEXA}if(e.startsWith("rgba("))return x.RGBA_CSS;if(e.startsWith("rgb("))return x.RGB_CSS;if(e.startsWith("hsl("))return x.HSL_CSS;if(e.startsWith("hsla("))return x.HSLA_CSS}if(typeof e=="object"){if(U(e,"r","g","b"))return U(e,"a")?w.RGBA:w.RGB;if(U(e,"h","s","l"))return U(e,"a")?w.HSLA:w.HSL;if(U(e,"h","s","v"))return U(e,"a")?w.HSVA:w.HSV}return null}function U(e,...t){return t.every(i=>i&&e&&`${i}`in e)}function Ke(e,t){return(e==null?void 0:e.rgb().array().toString())===(t==null?void 0:t.rgb().array().toString())}function se(e){return e===x.HEXA||e===x.RGBA_CSS||e===x.HSLA_CSS||e===w.RGBA||e===w.HSLA||e===w.HSVA}function gi(e){return e===x.HEX?x.HEXA:e===x.RGB_CSS?x.RGBA_CSS:e===x.HSL_CSS?x.HSLA_CSS:e===w.RGB?w.RGBA:e===w.HSL?w.HSLA:e===w.HSV?w.HSVA:e}function We(e){return e===x.HEXA?x.HEX:e===x.RGBA_CSS?x.RGB_CSS:e===x.HSLA_CSS?x.HSL_CSS:e===w.RGBA?w.RGB:e===w.HSLA?w.HSL:e===w.HSVA?w.HSV:e}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const S={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},vi={action:"action"},yi=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;text-overflow:ellipsis;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}input:placeholder-shown{text-overflow:ellipsis}input{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}input::placeholder,input:-ms-input-placeholder,input::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}input:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}input[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus{color:var(--calcite-ui-text-1)}calcite-icon{color:var(--calcite-ui-text-3)}input{outline-color:transparent}input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([status=invalid]) input{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;z-index:var(--calcite-app-z-index);display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) input{text-align:start}:host([alignment=end]) input{text-align:end}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}.inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.inline-child .editing-enabled{background-color:inherit}.inline-child:not(.editing-enabled){display:flex;cursor:pointer;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,xi=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputNumberFocus=y(this,"calciteInternalInputNumberFocus",6),this.calciteInternalInputNumberBlur=y(this,"calciteInternalInputNumberBlur",6),this.calciteInputNumberInput=y(this,"calciteInputNumberInput",7),this.calciteInputNumberChange=y(this,"calciteInputNumberChange",6),this.previousValueOrigin="initial",this.mutationObserver=J("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&!e.defaultPrevented&&et(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setNumberValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedNumberValue&&(this.calciteInputNumberChange.emit(),this.setPreviousEmittedNumberValue(this.value))},this.inputNumberBlurHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId),this.calciteInternalInputNumberBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=oe(this.el,"action");e.target!==t&&this.setFocus()},this.inputNumberFocusHandler=()=>{this.calciteInternalInputNumberFocus.emit()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly)return;const t=e.target.value;A.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=A.delocalize(t);e.inputType==="insertFromPaste"?((!K(i)||this.integer&&(i.includes("e")||i.includes(".")))&&e.preventDefault(),this.setNumberValue({nativeEvent:e,origin:"user",value:Bt(i)}),this.childNumberEl.value=this.localizedValue):this.setNumberValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.disabled||this.readOnly)return;if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[...Vt,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}A.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===A.decimal&&!this.integer&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(A.decimal)===-1))&&(/[eE]/.test(e.key)&&!this.integer&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat)return;const i=this.maxString?parseFloat(this.maxString):null,n=this.minString?parseFloat(this.minString):null,s=150;this.incrementOrDecrementNumberValue(e,i,n,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let a=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(a){a=!1;return}this.incrementOrDecrementNumberValue(e,i,n,t)},s)},this.nudgeButtonPointerUpHandler=e=>{X(e)&&window.clearInterval(this.nudgeNumberValueIntervalId)},this.nudgeButtonPointerOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.nudgeButtonPointerDownHandler=e=>{if(!X(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.hiddenInputChangeHandler=e=>{e.target.name===this.name&&this.setNumberValue({value:e.target.value,origin:"direct"}),e.stopPropagation()},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputNumberValue=e=>{this.childNumberEl&&(this.childNumberEl.value=e)},this.setPreviousEmittedNumberValue=e=>{this.previousEmittedNumberValue=this.normalizeValue(e)},this.setPreviousNumberValue=e=>{this.previousValue=this.normalizeValue(e)},this.setNumberValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:n,value:s})=>{var f,v;A.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const a=((f=this.previousValue)==null?void 0:f.length)>s.length||((v=this.value)==null?void 0:v.length)>s.length,o=this.integer?s.replace(/[e.]/g,""):s,r=o.charAt(o.length-1)===".",l=r&&a?o:$t(o),d=s&&!l?K(this.previousValue)?this.previousValue:"":l;let u=A.localize(d);i!=="connected"&&!r&&(u=Kt(u,d,A)),this.localizedValue=r&&a?`${u}${A.decimal}`:u,this.setPreviousNumberValue(n??this.value),this.previousValueOrigin=i,this.userChangedValue=i==="user"&&this.value!==d,this.value=["-","."].includes(d)?"":d,i==="direct"&&(this.setInputNumberValue(u),this.setPreviousEmittedNumberValue(u)),t&&(this.calciteInputNumberInput.emit().defaultPrevented?(this.value=this.previousValue,this.localizedValue=A.localize(this.previousValue)):e&&this.emitChangeIfUserModified())},this.inputNumberKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.integer=!1,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.inputMode="decimal",this.enterKeyHint=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.localizedValue=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}maxWatcher(){var e;this.maxString=((e=this.max)==null?void 0:e.toString())||null}minWatcher(){var e;this.minString=((e=this.min)==null?void 0:e.toString())||null}onMessagesChange(){}valueWatcher(e,t){this.userChangedValue||(this.setNumberValue({origin:"direct",previousValue:t,value:e==null||e==""?"":K(e)?e:this.previousValue||""}),this.warnAboutInvalidNumberValue(e)),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=re({},this.icon,"number")}get isClearable(){return this.clearable&&this.value.length>0}effectiveLocaleWatcher(e){ve(this,this.effectiveLocale),A.numberFormatOptions={locale:e,numberingSystem:this.numberingSystem,useGrouping:!1}}connectedCallback(){var e;pe(this),me(this),ye(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),st(this),tt(this),this.setPreviousEmittedNumberValue(this.value),this.setPreviousNumberValue(this.value),this.warnAboutInvalidNumberValue(this.value),this.setNumberValue({origin:"connected",value:K(this.value)?this.value:""}),(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}componentDidLoad(){de(this)}disconnectedCallback(){var e;be(this),at(this),it(this),ge(this),xe(this),(e=this.mutationObserver)==null||e.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){var e,t;he(this),this.maxString=(e=this.max)==null?void 0:e.toString(),this.minString=(t=this.min)==null?void 0:t.toString(),this.requestedIcon=re({},this.icon,"number"),await Ce(this)}componentShouldUpdate(e,t,i){return i==="value"&&e&&!K(e)?(this.setNumberValue({origin:"reset",value:t}),!1):!0}componentDidRender(){fe(this)}async setFocus(){var e;await ue(this),(e=this.childNumberEl)==null||e.focus()}async selectText(){var e;(e=this.childNumberEl)==null||e.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,n){const{value:s}=this,a=e==="up"?1:-1,o=this.integer&&this.step!=="any"?Math.round(this.step):this.step,r=o==="any"?1:Math.abs(o||1),d=new Wt(s!==""?s:"0").add(`${r*a}`),u=()=>typeof i=="number"&&!isNaN(i)&&d.subtract(`${i}`).isNegative,f=()=>typeof t=="number"&&!isNaN(t)&&!d.subtract(`${t}`).isNegative,v=u()?`${i}`:f()?`${t}`:d.toString();this.setNumberValue({committing:!0,nativeEvent:n,origin:"user",value:v})}onFormReset(){this.setNumberValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(e){var t,i;e.type="number",e.min=((t=this.min)==null?void 0:t.toString(10))??"",e.max=((i=this.max)==null?void 0:i.toString(10))??""}setDisabledAction(){const e=oe(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return K(e)?e:""}warnAboutInvalidNumberValue(e){e&&!K(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=q(this.el),t=c("div",{class:S.loader},c("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),i=c("button",{"aria-label":this.messages.clear,class:S.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},c("calcite-icon",{icon:"x",scale:M(this.scale)})),n=c("calcite-icon",{class:S.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:M(this.scale)}),s=this.numberButtonType==="horizontal",a=c("button",{"aria-hidden":"true",class:{[S.numberButtonItem]:!0,[S.buttonItemHorizontal]:s},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.nudgeButtonPointerDownHandler,onPointerOut:this.nudgeButtonPointerOutHandler,onPointerUp:this.nudgeButtonPointerUpHandler,tabIndex:-1,type:"button"},c("calcite-icon",{icon:"chevron-up",scale:M(this.scale)})),o=c("button",{"aria-hidden":"true",class:{[S.numberButtonItem]:!0,[S.buttonItemHorizontal]:s},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.nudgeButtonPointerDownHandler,onPointerOut:this.nudgeButtonPointerOutHandler,onPointerUp:this.nudgeButtonPointerUpHandler,tabIndex:-1,type:"button"},c("calcite-icon",{icon:"chevron-down",scale:M(this.scale)})),r=c("div",{class:S.numberButtonWrapper},a,o),l=c("div",{class:S.prefix},this.prefixText),d=c("div",{class:S.suffix},this.suffixText),u=c("input",{"aria-label":ot(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,name:void 0,onBlur:this.inputNumberBlurHandler,onFocus:this.inputNumberFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputNumberKeyUpHandler,placeholder:this.placeholder||"",readOnly:this.readOnly,type:"text",value:this.localizedValue,ref:this.setChildNumberElRef});return c(te,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},c("div",{class:{[S.inputWrapper]:!0,[Ze.rtl]:e==="rtl"}},this.numberButtonType==="horizontal"&&!this.readOnly?o:null,this.prefixText?l:null,c("div",{class:S.wrapper},u,this.isClearable?i:null,this.requestedIcon?n:null,this.loading?t:null),c("div",{class:S.actionWrapper},c("slot",{name:vi.action})),this.numberButtonType==="vertical"&&!this.readOnly?r:null,this.suffixText?d:null,this.numberButtonType==="horizontal"&&!this.readOnly?a:null,c(nt,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleWatcher"]}}static get style(){return yi}},[1,"calcite-input-number",{alignment:[513],autofocus:[516],clearable:[516],disabled:[516],form:[513],groupSeparator:[516,"group-separator"],hidden:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],integer:[4],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],inputMode:[1,"input-mode"],enterKeyHint:[1,"enter-key-hint"],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],localizedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]}]);function Fe(){if(typeof customElements>"u")return;["calcite-input-number","calcite-icon","calcite-progress"].forEach(t=>{switch(t){case"calcite-input-number":customElements.get(t)||customElements.define(t,xi);break;case"calcite-icon":customElements.get(t)||ie();break;case"calcite-progress":customElements.get(t)||we();break}})}Fe();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const L={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper"},Ci={action:"action"},wi=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input{padding-inline-start:0.5rem;padding-inline-end:var(--calcite-internal-input-text-input-padding-inline-end, 0.5rem)}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .prefix,:host([scale=s]) .suffix{padding-inline:0.5rem}:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=m]) input{padding-inline-start:0.75rem;padding-inline-end:var(--calcite-internal-input-text-input-padding-inline-end, 0.75rem)}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .prefix,:host([scale=m]) .suffix{padding-inline:0.75rem}:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=l]) input{padding-inline-start:1rem;padding-inline-end:var(--calcite-internal-input-text-input-padding-inline-end, 1rem)}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .prefix,:host([scale=l]) .suffix{padding-inline:1rem}:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;text-overflow:ellipsis;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}input:placeholder-shown{text-overflow:ellipsis}input{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}input::placeholder,input:-ms-input-placeholder,input::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}input:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}input[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus{color:var(--calcite-ui-text-1)}calcite-icon{color:var(--calcite-ui-text-3)}input{outline-color:transparent}input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([status=invalid]) input{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;z-index:var(--calcite-app-z-index);display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) input{text-align:start}:host([alignment=end]) input{text-align:end}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}.inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.inline-child .editing-enabled{background-color:inherit}.inline-child:not(.editing-enabled){display:flex;cursor:pointer;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,ki=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputTextFocus=y(this,"calciteInternalInputTextFocus",7),this.calciteInternalInputTextBlur=y(this,"calciteInternalInputTextBlur",7),this.calciteInputTextInput=y(this,"calciteInputTextInput",7),this.calciteInputTextChange=y(this,"calciteInputTextChange",7),this.previousValueOrigin="initial",this.mutationObserver=J("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||(this.isClearable&&e.key==="Escape"&&(this.clearInputTextValue(e),e.preventDefault()),e.key==="Enter"&&!e.defaultPrevented&&et(this)&&e.preventDefault())},this.clearInputTextValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputTextChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputTextBlurHandler=()=>{this.calciteInternalInputTextBlur.emit({element:this.childEl,value:this.value}),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=oe(this.el,"action");e.target!==t&&this.setFocus()},this.inputTextFocusHandler=()=>{this.calciteInternalInputTextFocus.emit({element:this.childEl,value:this.value})},this.inputTextInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputTextKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.hiddenInputChangeHandler=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setInputValue=e=>{this.childEl&&(this.childEl.value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=e},this.setPreviousValue=e=>{this.previousValue=e},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:n,value:s})=>{this.setPreviousValue(n??this.value),this.previousValueOrigin=i,this.userChangedValue=i==="user"&&s!==this.value,this.value=s,i==="direct"&&(this.setInputValue(s),this.setPreviousEmittedValue(s)),t&&(this.calciteInputTextInput.emit().defaultPrevented?this.value=this.previousValue:e&&this.emitChangeIfUserModified())},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.form=void 0,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.autocomplete=void 0,this.inputMode="text",this.enterKeyHint=void 0,this.pattern=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}onMessagesChange(){}valueWatcher(e,t){this.userChangedValue||this.setValue({origin:"direct",previousValue:t,value:e||""}),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=re({},this.icon,"text")}get isClearable(){return this.clearable&&this.value.length>0}effectiveLocaleChange(){ve(this,this.effectiveLocale)}connectedCallback(){var e;pe(this),me(this),ye(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),st(this),tt(this),(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){var e;be(this),at(this),it(this),ge(this),xe(this),(e=this.mutationObserver)==null||e.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){he(this),this.requestedIcon=re({},this.icon,"text"),await Ce(this)}componentDidLoad(){de(this)}componentDidRender(){fe(this)}async setFocus(){var e;await ue(this),(e=this.childEl)==null||e.focus()}async selectText(){var e;(e=this.childEl)==null||e.select()}onLabelClick(){this.setFocus()}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(e){this.minLength!=null&&(e.minLength=this.minLength),this.maxLength!=null&&(e.maxLength=this.maxLength)}setDisabledAction(){const e=oe(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}render(){const e=q(this.el),t=c("div",{class:L.loader},c("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),i=c("button",{"aria-label":this.messages.clear,class:L.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputTextValue,tabIndex:-1,type:"button"},c("calcite-icon",{icon:"x",scale:M(this.scale)})),n=c("calcite-icon",{class:L.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:M(this.scale)}),s=c("div",{class:L.prefix},this.prefixText),a=c("div",{class:L.suffix},this.suffixText),o=c("input",{"aria-label":ot(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,class:{[L.editingEnabled]:this.editingEnabled,[L.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,maxLength:this.maxLength,minLength:this.minLength,name:this.name,onBlur:this.inputTextBlurHandler,onFocus:this.inputTextFocusHandler,onInput:this.inputTextInputHandler,onKeyDown:this.inputTextKeyDownHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,required:this.required?!0:null,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:"text",value:this.value,ref:this.setChildElRef});return c(te,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},c("div",{class:{[L.inputWrapper]:!0,[Ze.rtl]:e==="rtl"}},this.prefixText?s:null,c("div",{class:L.wrapper},o,this.isClearable?i:null,this.requestedIcon?n:null,this.loading?t:null),c("div",{class:L.actionWrapper},c("slot",{name:Ci.action})),this.suffixText?a:null,c(nt,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{disabled:["disabledWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return wi}},[1,"calcite-input-text",{alignment:[513],autofocus:[516],clearable:[516],disabled:[516],form:[513],hidden:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],label:[1],loading:[516],maxLength:[514,"max-length"],minLength:[514,"min-length"],name:[513],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],autocomplete:[1],inputMode:[1,"input-mode"],enterKeyHint:[1,"enter-key-hint"],pattern:[1],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]}]);function Oe(){if(typeof customElements>"u")return;["calcite-input-text","calcite-icon","calcite-progress"].forEach(t=>{switch(t){case"calcite-input-text":customElements.get(t)||customElements.define(t,ki);break;case"calcite-icon":customElements.get(t)||ie();break;case"calcite-progress":customElements.get(t)||we();break}})}Oe();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const p={channel:"channel",channels:"channels",colorField:"color-field",colorFieldScope:"scope--color-field",colorMode:"color-mode",colorModeContainer:"color-mode-container",container:"container",control:"control",controlAndScope:"control-and-scope",controlSection:"control-section",deleteColor:"delete-color",header:"header",hexAndChannelsGroup:"hex-and-channels-group",hexOptions:"color-hex-options",hueScope:"scope--hue",hueSlider:"hue-slider",opacityScope:"scope--opacity",opacitySlider:"opacity-slider",preview:"preview",previewAndSliders:"preview-and-sliders",saveColor:"save-color",savedColor:"saved-color",savedColors:"saved-colors",savedColorsButtons:"saved-colors-buttons",savedColorsSection:"saved-colors-section",scope:"scope",section:"section",slider:"slider",sliders:"sliders",splitSection:"section--split"},N=F("#007AC2"),Ie="calcite-color-",qe={r:255,g:255,b:255},H={h:360,s:100,v:100},_e=H.h-1,$={min:0,max:100},Ue={s:{slider:{height:12,width:104},colorField:{height:80,width:160},thumb:{radius:10}},m:{slider:{height:12,width:204},colorField:{height:150,width:272},thumb:{radius:10}},l:{slider:{height:12,width:384},colorField:{height:200,width:464},thumb:{radius:10}}},je=1,Se={container:"container",hexInput:"hex-input",opacityInput:"opacity-input"},Ii=":host{display:block}.container{display:flex;inline-size:100%;flex-wrap:nowrap;align-items:center}.hex-input{flex-grow:1;text-transform:uppercase}.opacity-input{inline-size:68px;margin-inline-start:-1px}:host([scale=s]) .container{flex-wrap:wrap;row-gap:0.125rem}:host([scale=s]) .opacity-input{inline-size:unset;margin-inline-start:unset}:host([scale=l]) .opacity-input{inline-size:88px}:host([hidden]){display:none}[hidden]{display:none}",Ge=F(),Si=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteColorPickerHexInputChange=y(this,"calciteColorPickerHexInputChange",6),this.onHexInputBlur=()=>{const e=this.hexInputNode,t=e.value,i=`#${t}`,{allowEmpty:n,internalColor:s}=this,a=n&&!t,o=ut(i);this.onHexInputChange(),!(a||W(i)&&o)&&(e.value=n&&!s?"":this.formatHexForInternalInput(He(s.object())))},this.onOpacityInputBlur=()=>{const e=this.opacityInputNode,t=e.value,{allowEmpty:i,internalColor:n}=this;i&&!t||(e.value=i&&!n?"":this.formatOpacityForInternalInput(n))},this.onHexInputChange=()=>{let t=this.hexInputNode.value;if(t){const i=D(t,!1);if(W(i)&&this.alphaChannel&&this.internalColor){const s=D(this.internalColor.hexa(),!0).slice(-2);t=`${i+s}`}}this.internalSetValue(t,this.value)},this.onOpacityInputChange=()=>{var i;const e=this.opacityInputNode;let t;if(!e.value)t=e.value;else{const n=ce(Number(e.value));t=(i=this.internalColor)==null?void 0:i.alpha(n).hexa()}this.internalSetValue(t,this.value)},this.onInputKeyDown=e=>{const{altKey:t,ctrlKey:i,metaKey:n,shiftKey:s}=e,{alphaChannel:a,hexInputNode:o,internalColor:r,value:l}=this,{key:d}=e,u=e.composedPath();if(d==="Tab"||d==="Enter"){u.includes(o)?this.onHexInputChange():this.onOpacityInputChange(),d==="Enter"&&e.preventDefault();return}const f=d==="ArrowDown"||d==="ArrowUp",v=this.value;if(f){if(!l){this.internalSetValue(this.previousNonNullValue,v),e.preventDefault();return}const z=d==="ArrowUp"?1:-1,O=s?10:1;this.internalSetValue(E(this.nudgeRGBChannels(r,O*z,u.includes(o)?"rgb":"a"),a),v),e.preventDefault();return}const m=t||i||n,b=d.length===1,g=di.test(d);b&&!m&&!g&&e.preventDefault()},this.onHexInputPaste=e=>{const t=e.clipboardData.getData("text");W(t)&&(e.preventDefault(),this.hexInputNode.value=t.slice(1))},this.previousNonNullValue=this.value,this.storeHexInputRef=e=>{this.hexInputNode=e},this.storeOpacityInputRef=e=>{this.opacityInputNode=e},this.allowEmpty=!1,this.alphaChannel=!1,this.hexLabel="Hex",this.messages=void 0,this.numberingSystem=void 0,this.scale="m",this.value=D(E(Ge,this.alphaChannel),this.alphaChannel,!0),this.internalColor=Ge}connectedCallback(){const{allowEmpty:e,alphaChannel:t,value:i}=this;if(i){const n=D(i,t);W(n,t)&&this.internalSetValue(n,n,!1);return}e&&this.internalSetValue(null,null,!1)}componentWillLoad(){he(this)}componentDidLoad(){de(this)}handleValueChange(e,t){this.internalSetValue(e,t,!1)}render(){const{alphaChannel:e,hexLabel:t,internalColor:i,messages:n,scale:s,value:a}=this,o=this.formatHexForInternalInput(a),r=this.formatOpacityForInternalInput(i),l=s==="l"?"m":"s";return c("div",{class:Se.container},c("calcite-input-text",{class:Se.hexInput,label:(n==null?void 0:n.hex)||t,maxLength:6,onCalciteInputTextChange:this.onHexInputChange,onCalciteInternalInputTextBlur:this.onHexInputBlur,onKeyDown:this.onInputKeyDown,onPaste:this.onHexInputPaste,prefixText:"#",scale:l,value:o,ref:this.storeHexInputRef}),e?c("calcite-input-number",{class:Se.opacityInput,key:"opacity-input",label:n==null?void 0:n.opacity,max:$.max,maxLength:3,min:$.min,numberButtonType:"none",numberingSystem:this.numberingSystem,onCalciteInputNumberChange:this.onOpacityInputChange,onCalciteInternalInputNumberBlur:this.onOpacityInputBlur,onKeyDown:this.onInputKeyDown,scale:l,suffixText:"%",value:r,ref:this.storeOpacityInputRef}):null)}async setFocus(){return await ue(this),Dt(this.hexInputNode)}internalSetValue(e,t,i=!0){if(e){const{alphaChannel:n}=this,s=D(e,n,n);if(W(s,n)){const{internalColor:a}=this,o=F(s),r=D(E(o,n),n),l=!a||r!==D(E(a,n),n);this.internalColor=o,this.previousNonNullValue=r,this.value=r,l&&i&&this.calciteColorPickerHexInputChange.emit();return}}else if(this.allowEmpty){this.internalColor=null,this.value=null,i&&this.calciteColorPickerHexInputChange.emit();return}this.value=t}formatHexForInternalInput(e){return e?e.replace("#","").slice(0,6):""}formatOpacityForInternalInput(e){return e?`${Q(e.alpha())}`:""}nudgeRGBChannels(e,t,i){let n;const s=e.array(),a=s.slice(0,3);if(i==="rgb")n=[...a.map(r=>r+t),this.alphaChannel?s[3]:void 0];else{const o=ce(Q(e.alpha())+t);n=[...a,o]}return F(n)}get el(){return this}static get watchers(){return{value:["handleValueChange"]}}static get style(){return Ii}},[1,"calcite-color-picker-hex-input",{allowEmpty:[4,"allow-empty"],alphaChannel:[4,"alpha-channel"],hexLabel:[1,"hex-label"],messages:[16],numberingSystem:[1,"numbering-system"],scale:[513],value:[1537],internalColor:[32],setFocus:[64]}]);function bt(){if(typeof customElements>"u")return;["calcite-color-picker-hex-input","calcite-icon","calcite-input-number","calcite-input-text","calcite-progress"].forEach(t=>{switch(t){case"calcite-color-picker-hex-input":customElements.get(t)||customElements.define(t,Si);break;case"calcite-icon":customElements.get(t)||ie();break;case"calcite-input-number":customElements.get(t)||Fe();break;case"calcite-input-text":customElements.get(t)||Oe();break;case"calcite-progress":customElements.get(t)||we();break}})}bt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const ae={swatch:"swatch",noColorSwatch:"swatch--no-color",checker:"checker"},Xe={borderLight:"rgba(0, 0, 0, 0.3)",borderDark:"rgba(255, 255, 255, 0.15)"},Je=4,B={squareSize:Je,size:Je*2},Ti=":host{position:relative;display:inline-flex}:host([scale=s]){block-size:1.25rem;inline-size:1.25rem}:host([scale=m]){block-size:1.5rem;inline-size:1.5rem}:host([scale=l]){block-size:2rem;inline-size:2rem}.swatch{overflow:hidden;block-size:inherit;inline-size:inherit}.swatch rect{transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.swatch--no-color rect{fill:var(--calcite-ui-foreground-1)}.swatch--no-color line{stroke:var(--calcite-ui-danger)}.checker{fill:#cacaca}:host([hidden]){display:none}[hidden]{display:none}",Ei=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.active=!1,this.color=void 0,this.scale="m"}handleColorChange(e){this.internalColor=e?F(e):null}componentWillLoad(){this.handleColorChange(this.color)}render(){const e=!this.internalColor,t={[ae.swatch]:!0,[ae.noColorSwatch]:e};return c("svg",{class:t,xmlns:"http://www.w3.org/2000/svg"},this.renderSwatch())}renderSwatch(){const{active:e,el:t,internalColor:i}=this,n=e?"100%":"0",a=Pt(t)==="light"?Xe.borderLight:Xe.borderDark,o={height:"100%",rx:n,stroke:a,"stroke-width":"2",width:"100%"};if(!i)return c(Te,null,c("clipPath",{id:"shape"},c("rect",{height:"100%",rx:n,width:"100%"})),c("rect",{"clip-path":`inset(0 round ${n})`,rx:n,...o}),c("line",{"clip-path":"url(#shape)","stroke-width":"3",x1:"100%",x2:"0",y1:"0",y2:"100%"}));const l=i.alpha(),d=E(i),u=E(i,l<1);return c(Te,null,c("title",null,u),c("defs",null,c("pattern",{height:B.size,id:"checker",patternUnits:"userSpaceOnUse",width:B.size,x:"0",y:"0"},c("rect",{class:ae.checker,height:B.squareSize,width:B.squareSize,x:"0",y:"0"}),c("rect",{class:ae.checker,height:B.squareSize,width:B.squareSize,x:B.squareSize,y:B.squareSize}))),c("rect",{fill:"url(#checker)",height:"100%",rx:n,width:"100%"}),c("rect",{fill:d,style:{"clip-path":l<1?"polygon(100% 0, 0 0, 0 100%)":`inset(0 round ${n})`},...o}),l<1?c("rect",{fill:u,key:"opacity-fill",style:{"clip-path":"polygon(100% 0, 100% 100%, 0 100%)"},...o}):null)}get el(){return this}static get watchers(){return{color:["handleColorChange"]}}static get style(){return Ti}},[1,"calcite-color-picker-swatch",{active:[516],color:[1],scale:[513]}]);function ft(){if(typeof customElements>"u")return;["calcite-color-picker-swatch"].forEach(t=>{switch(t){case"calcite-color-picker-swatch":customElements.get(t)||customElements.define(t,Ei);break}})}ft();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const Ye={container:"container",content:"content"},zi=":host([selected]) section,:host([selected]) .container{display:block}:host{display:none;block-size:100%;inline-size:100%}:host([selected]){display:block;block-size:100%;inline-size:100%;overflow:auto}.scale-s .content{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}.scale-m .content{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}.scale-l .content{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}section,.container{display:none;block-size:100%;inline-size:100%}:host([hidden]){display:none}[hidden]{display:none}",Ai=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalTabRegister=y(this,"calciteInternalTabRegister",6),this.guid=`calcite-tab-title-${rt()}`,this.tab=void 0,this.selected=!1,this.scale="m",this.labeledBy=void 0}render(){const e=this.el.id||this.guid;return c(te,{"aria-labelledby":this.labeledBy,id:e},c("div",{class:{[Ye.container]:!0,[`scale-${this.scale}`]:!0},role:"tabpanel",tabIndex:this.selected?0:-1},c("section",{class:Ye.content},c("slot",null))))}connectedCallback(){this.parentTabsEl=this.el.closest("calcite-tabs")}componentDidLoad(){this.calciteInternalTabRegister.emit()}disconnectedCallback(){var e;(e=document.body)==null||e.dispatchEvent(new CustomEvent("calciteTabUnregister",{detail:this.el}))}internalTabChangeHandler(e){e.composedPath().find(i=>i.tagName==="CALCITE-TABS")===this.parentTabsEl&&(this.tab?this.selected=this.tab===e.detail.tab:this.getTabIndex().then(i=>{this.selected=i===e.detail.tab}),e.stopPropagation())}async getTabIndex(){return Array.prototype.indexOf.call(Qe(this.el.parentElement.children).filter(e=>e.matches("calcite-tab")),this.el)}async updateAriaInfo(e=[],t=[]){this.labeledBy=t[e.indexOf(this.el.id)]||null}get el(){return this}static get style(){return zi}},[1,"calcite-tab",{tab:[513],selected:[1540],scale:[1],labeledBy:[32],getTabIndex:[64],updateAriaInfo:[64]},[[16,"calciteInternalTabChange","internalTabChangeHandler"]]]);function mt(){if(typeof customElements>"u")return;["calcite-tab"].forEach(t=>{switch(t){case"calcite-tab":customElements.get(t)||customElements.define(t,Ai);break}})}mt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const Hi={container:"tab-nav"},Fi=":host{position:relative;display:flex}.scale-s{min-block-size:1.5rem}.scale-m{min-block-size:2rem}.scale-l{min-block-size:2.75rem}:host([layout=center]:not([bordered])){padding-inline:1.25rem}:host([layout=center]:not([bordered])) .tab-nav ::slotted(calcite-tab-title:last-child){margin-inline-end:0px}:host(:not([bordered])) .scale-l ::slotted(calcite-tab-title){margin-inline-end:1.5rem}:host(:not([bordered])) .scale-m ::slotted(calcite-tab-title){margin-inline-end:1.25rem}:host(:not([bordered])) .scale-s ::slotted(calcite-tab-title){margin-inline-end:1rem}.tab-nav{display:flex;inline-size:100%;justify-content:flex-start;overflow:auto}.tab-nav-active-indicator-container{position:absolute;inset-inline:0px;inset-block-end:0px;block-size:0.125rem;inline-size:100%;overflow:hidden}.tab-nav-active-indicator{position:absolute;inset-block-end:0px;display:block;block-size:0.125rem;background-color:var(--calcite-ui-brand);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-timing-function:cubic-bezier(0, 0, 0.2, 1)}:host([layout=center]) .tab-nav{justify-content:space-evenly}:host .position-bottom .tab-nav-active-indicator{inset-block-end:unset;inset-block-start:0px}:host .position-bottom .tab-nav-active-indicator-container{inset-block-end:unset;inset-block-start:0px}:host([bordered]) .tab-nav-active-indicator-container{inset-block-end:unset}:host([bordered]) .position-bottom .tab-nav-active-indicator-container{inset-block-end:0;inset-block-start:unset}@media (forced-colors: active){.tab-nav-active-indicator{background-color:highlight}}:host([hidden]){display:none}[hidden]{display:none}",Oi=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTabChange=y(this,"calciteTabChange",6),this.calciteInternalTabChange=y(this,"calciteInternalTabChange",6),this.animationActiveDuration=.3,this.resizeObserver=J("resize",()=>{this.activeIndicatorEl&&(this.activeIndicatorEl.style.transitionDuration="0s",this.updateActiveWidth(),this.updateOffsetPosition())}),this.handleTabFocus=(e,t,i)=>{Mt(this.enabledTabTitles,t,i),e.stopPropagation()},this.handleContainerScroll=()=>{this.activeIndicatorEl.style.transitionDuration="0s",this.updateOffsetPosition()},this.storageId=void 0,this.syncId=void 0,this.selectedTitle=null,this.scale="m",this.layout="inline",this.position="bottom",this.bordered=!1,this.indicatorOffset=void 0,this.indicatorWidth=void 0,this.selectedTabId=void 0}async selectedTabIdChanged(){localStorage&&this.storageId&&this.selectedTabId!==void 0&&this.selectedTabId!==null&&localStorage.setItem(`calcite-tab-nav-${this.storageId}`,JSON.stringify(this.selectedTabId)),this.calciteInternalTabChange.emit({tab:this.selectedTabId}),this.selectedTitle=await this.getTabTitleById(this.selectedTabId)}selectedTitleChanged(){this.updateOffsetPosition(),this.updateActiveWidth(),this.activeIndicatorEl.style.transitionDuration=`${this.animationActiveDuration}s`}connectedCallback(){var e;this.parentTabsEl=this.el.closest("calcite-tabs"),(e=this.resizeObserver)==null||e.observe(this.el)}componentWillLoad(){const e=`calcite-tab-nav-${this.storageId}`;if(localStorage&&this.storageId&&localStorage.getItem(e)){const t=JSON.parse(localStorage.getItem(e));this.selectedTabId=t}}componentWillRender(){const{parentTabsEl:e}=this;this.layout=e==null?void 0:e.layout,this.bordered=e==null?void 0:e.bordered,this.selectedTitle&&this.updateOffsetPosition()}componentDidRender(){this.tabTitles.length&&this.tabTitles.every(e=>!e.selected)&&!this.selectedTabId&&this.tabTitles[0].getTabIdentifier().then(e=>{this.calciteInternalTabChange.emit({tab:e})})}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.disconnect()}render(){const e=q(this.el),t=`${this.indicatorWidth}px`,i=`${this.indicatorOffset}px`,n=e!=="rtl"?{width:t,left:i}:{width:t,right:i};return c(te,{role:"tablist"},c("div",{class:{[Hi.container]:!0,[`scale-${this.scale}`]:!0,[`position-${this.position}`]:!0},onScroll:this.handleContainerScroll,ref:s=>this.tabNavEl=s},c("slot",null),c("div",{class:"tab-nav-active-indicator-container",ref:s=>this.activeIndicatorContainerEl=s},c("div",{class:"tab-nav-active-indicator",style:n,ref:s=>this.activeIndicatorEl=s}))))}focusPreviousTabHandler(e){this.handleTabFocus(e,e.target,"previous")}focusNextTabHandler(e){this.handleTabFocus(e,e.target,"next")}focusFirstTabHandler(e){this.handleTabFocus(e,e.target,"first")}focusLastTabHandler(e){this.handleTabFocus(e,e.target,"last")}internalActivateTabHandler(e){this.selectedTabId=e.detail.tab?e.detail.tab:this.getIndexOfTabTitle(e.target),e.stopPropagation()}activateTabHandler(e){this.calciteTabChange.emit(),e.stopPropagation()}internalCloseTabHandler(e){const t=e.target;this.handleTabTitleClose(t),e.stopPropagation()}updateTabTitles(e){e.target.selected&&(this.selectedTabId=e.detail)}globalInternalTabChangeHandler(e){this.syncId&&e.target!==this.el&&e.target.syncId===this.syncId&&this.selectedTabId!==e.detail.tab&&(this.selectedTabId=e.detail.tab),e.stopPropagation()}iconStartChangeHandler(){this.updateActiveWidth(),this.updateOffsetPosition()}updateOffsetPosition(){var a,o,r,l,d;const e=q(this.el),t=(a=this.activeIndicatorContainerEl)==null?void 0:a.offsetWidth,i=(o=this.selectedTitle)==null?void 0:o.offsetLeft,n=(r=this.selectedTitle)==null?void 0:r.offsetWidth,s=t-(i+n);this.indicatorOffset=e!=="rtl"?i-((l=this.tabNavEl)==null?void 0:l.scrollLeft):s+((d=this.tabNavEl)==null?void 0:d.scrollLeft)}updateActiveWidth(){var e;this.indicatorWidth=(e=this.selectedTitle)==null?void 0:e.offsetWidth}getIndexOfTabTitle(e,t=this.tabTitles){return t.indexOf(e)}async getTabTitleById(e){return Promise.all(this.tabTitles.map(t=>t.getTabIdentifier())).then(t=>this.tabTitles[t.indexOf(e)])}get tabTitles(){return Ve(this.el,"calcite-tab-title")}get enabledTabTitles(){return Ve(this.el,"calcite-tab-title:not([disabled])").filter(e=>!e.closed)}handleTabTitleClose(e){const{tabTitles:t}=this,i=t.reduce((s,a,o)=>a.closed?s:[...s,o],[]),n=i.length;if(n===1&&t[i[0]].closable)t[i[0]].closable=!1,this.selectedTabId=i[0];else if(n>1){const s=t.findIndex(o=>o===e),a=i.find(o=>o>s);this.selectedTabId===s&&(this.selectedTabId=a||n-1)}requestAnimationFrame(()=>{this.updateOffsetPosition(),this.updateActiveWidth(),t[this.selectedTabId].focus()})}get el(){return this}static get watchers(){return{selectedTabId:["selectedTabIdChanged"],selectedTitle:["selectedTitleChanged"]}}static get style(){return Fi}},[1,"calcite-tab-nav",{storageId:[513,"storage-id"],syncId:[513,"sync-id"],selectedTitle:[1040],scale:[1],layout:[1537],position:[1],bordered:[1540],indicatorOffset:[1026,"indicator-offset"],indicatorWidth:[1026,"indicator-width"],selectedTabId:[32]},[[0,"calciteInternalTabsFocusPrevious","focusPreviousTabHandler"],[0,"calciteInternalTabsFocusNext","focusNextTabHandler"],[0,"calciteInternalTabsFocusFirst","focusFirstTabHandler"],[0,"calciteInternalTabsFocusLast","focusLastTabHandler"],[0,"calciteInternalTabsActivate","internalActivateTabHandler"],[0,"calciteTabsActivate","activateTabHandler"],[0,"calciteInternalTabsClose","internalCloseTabHandler"],[0,"calciteInternalTabTitleRegister","updateTabTitles"],[16,"calciteInternalTabChange","globalInternalTabChangeHandler"],[0,"calciteInternalTabIconChanged","iconStartChangeHandler"]]]);function gt(){if(typeof customElements>"u")return;["calcite-tab-nav"].forEach(t=>{switch(t){case"calcite-tab-nav":customElements.get(t)||customElements.define(t,Oi);break}})}gt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const P={closeButton:"close-button",container:"container",content:"content",contentHasText:"content--has-text",iconEnd:"icon-end",iconPresent:"icon-present",iconStart:"icon-start",titleIcon:"calcite-tab-title--icon"},Li={close:"x"},Di=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block;outline:2px solid transparent;outline-offset:2px;margin-inline-start:0px}:host([layout=inline]){flex:0 1 auto}:host([layout=center]){flex:1 1 auto}:host([layout=center]) .scale-s,:host([layout=center]) .scale-m,:host([layout=center]) .scale-l{margin-block:0px;text-align:center;flex-basis:12rem}:host([layout=center]) .scale-s .content,:host([layout=center]) .scale-m .content,:host([layout=center]) .scale-l .content{margin:auto}:host([layout=center][closable]) .content{padding-inline-start:32px}:host([layout=center][bordered][closable]) .scale-s .content{padding-inline-start:36px}:host([layout=center][bordered][closable]) .scale-m .content{padding-inline-start:40px}:host([layout=center][closable]) .scale-l .content{padding-inline-start:40px}:host([layout=center][closable][bordered]) .scale-s .content{padding-inline-start:52px}:host([position=bottom]) .container{border-block-end-width:0px;border-block-start-width:2px;border-block-start-color:transparent;border-block-start-style:solid}:host([closed]){display:none}.container{outline-color:transparent}:host(:focus) .container{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host(:focus) .container:focus-within{outline-color:transparent}:host(:active) a,:host(:focus) a,:host(:hover) a{border-color:var(--calcite-ui-border-2);color:var(--calcite-ui-text-1);text-decoration-line:none}:host([selected]) .container{border-color:transparent;color:var(--calcite-ui-text-1)}:host([disabled]) .container{pointer-events:none;opacity:0.5}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale-s .content{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem}.scale-m .content{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem}.scale-l .content{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}.container{box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;align-content:center;justify-content:space-between;border-block-end-width:2px;padding-inline:0px;font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-3);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-block-end-color:transparent;border-block-end-style:solid}.content{display:flex;align-items:center;justify-content:center}.calcite-tab-title--icon{position:relative;margin:0px;display:inline-flex;align-self:center}.calcite-tab-title--icon svg{transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.content--has-text{padding:0.25rem}.content--has-text .calcite-tab-title--icon.icon-start{margin-inline-end:0.5rem}.content--has-text .calcite-tab-title--icon.icon-end{margin-inline-start:0.5rem}.close-button{display:flex;cursor:pointer;appearance:none;align-content:center;align-items:center;justify-content:center;align-self:center;border-style:none;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;block-size:calc(100% - 2px);background-color:var(--calcite-button-transparent-1);margin-inline-start:auto}.close-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + );outline-offset:-1px}.close-button:focus,.close-button:hover{color:var(--calcite-ui-text-1);background-color:var(--calcite-ui-foreground-2)}.close-button:active{color:var(--calcite-ui-text-1);background-color:var(--calcite-ui-foreground-3)}.close-button calcite-icon{color:inherit}:host([icon-start][icon-end]) .calcite-tab-title--icon:first-child{margin-inline-end:0.5rem}:host([bordered]){margin-inline-end:0}:host([bordered][selected]){box-shadow:inset 0px -2px var(--calcite-ui-foreground-1)}:host([bordered][selected][position=bottom]){box-shadow:inset 0 2px 0 var(--calcite-ui-foreground-1)}:host([bordered]:hover) .container,:host([bordered]:focus) .container,:host([bordered]:active) .container{position:relative}:host([bordered]:hover) .container{background-color:var(--calcite-button-transparent-hover)}:host([closable]) .container,:host([bordered]) .container{border-inline-start:1px solid transparent;border-inline-end:1px solid transparent}:host([closable]) .container .close-button,:host([bordered]) .container .close-button{margin-inline:0}:host([closable]) .content{box-sizing:border-box;block-size:100%;border-block-end-color:transparent}:host([closable][position=bottom]) .container,:host([bordered][position=bottom]) .container{border-block-start-style:unset}:host([selected][bordered]) .container{border-inline-start-color:var(--calcite-ui-border-1);border-inline-end-color:var(--calcite-ui-border-1)}:host([bordered]) .content{padding-inline:0.75rem}:host([bordered]) .scale-s .content{padding-inline:0.5rem}:host([bordered]) .scale-l .content{padding-inline:1rem}@media (forced-colors: active){:host{outline-width:0;outline-offset:0}:host(:focus) .container{outline-color:highlight}:host([bordered]) .container{border-block-end-style:solid}:host([bordered][position=bottom]) .container{border-block-start-style:solid}:host([bordered][selected]) .container{border-block-end-style:none}:host([bordered][position=bottom][selected]) .container{border-block-start-style:none}.close-button{z-index:var(--calcite-app-z-index)}}:host([hidden]){display:none}[hidden]{display:none}`,Pi=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTabsActivate=y(this,"calciteTabsActivate",6),this.calciteInternalTabsActivate=y(this,"calciteInternalTabsActivate",6),this.calciteTabsClose=y(this,"calciteTabsClose",6),this.calciteInternalTabsClose=y(this,"calciteInternalTabsClose",6),this.calciteInternalTabsFocusNext=y(this,"calciteInternalTabsFocusNext",6),this.calciteInternalTabsFocusPrevious=y(this,"calciteInternalTabsFocusPrevious",6),this.calciteInternalTabsFocusFirst=y(this,"calciteInternalTabsFocusFirst",6),this.calciteInternalTabsFocusLast=y(this,"calciteInternalTabsFocusLast",6),this.calciteInternalTabTitleRegister=y(this,"calciteInternalTabTitleRegister",6),this.calciteInternalTabIconChanged=y(this,"calciteInternalTabIconChanged",6),this.closeClickHandler=()=>{this.closeTabTitleAndNotify()},this.mutationObserver=J("mutation",()=>this.updateHasText()),this.resizeObserver=J("resize",()=>{this.calciteInternalTabIconChanged.emit()}),this.guid=`calcite-tab-title-${rt()}`,this.selected=!1,this.closable=!1,this.closed=!1,this.disabled=!1,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.layout=void 0,this.position="top",this.scale="m",this.bordered=!1,this.tab=void 0,this.messages=void 0,this.messageOverrides=void 0,this.controls=void 0,this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasText=!1}selectedHandler(){this.selected&&this.emitActiveTab(!1)}onMessagesChange(){}connectedCallback(){pe(this),me(this),ye(this),this.setupTextContentObserver(),this.parentTabNavEl=this.el.closest("calcite-tab-nav"),this.parentTabsEl=this.el.closest("calcite-tabs")}disconnectedCallback(){var e,t,i;(e=this.mutationObserver)==null||e.disconnect(),(t=document.body)==null||t.dispatchEvent(new CustomEvent("calciteTabTitleUnregister",{detail:this.el})),(i=this.resizeObserver)==null||i.disconnect(),be(this),ge(this),xe(this)}async componentWillLoad(){await Ce(this),this.updateHasText(),this.tab&&this.selected&&this.emitActiveTab(!1)}componentWillRender(){this.parentTabsEl&&(this.layout=this.parentTabsEl.layout,this.bordered=this.parentTabsEl.bordered)}render(){const{el:e,closed:t}=this,i=e.id||this.guid,n=c("calcite-icon",{class:{[P.titleIcon]:!0,[P.iconStart]:!0},flipRtl:this.iconFlipRtl==="start"||this.iconFlipRtl==="both",icon:this.iconStart,scale:M(this.scale)}),s=c("calcite-icon",{class:{[P.titleIcon]:!0,[P.iconEnd]:!0},flipRtl:this.iconFlipRtl==="end"||this.iconFlipRtl==="both",icon:this.iconEnd,scale:M(this.scale)});return c(te,{"aria-controls":this.controls,"aria-selected":Rt(this.selected),id:i,role:"tab",tabIndex:this.selected?0:-1},c("div",{class:{container:!0,[P.iconPresent]:!!this.iconStart||!!this.iconEnd,[`scale-${this.scale}`]:!0},hidden:t,ref:a=>{var o;return(o=this.resizeObserver)==null?void 0:o.observe(a)}},c("div",{class:{[P.content]:!0,[P.contentHasText]:this.hasText}},this.iconStart?n:null,c("slot",null),this.iconEnd?s:null),this.renderCloseButton()))}renderCloseButton(){const{closable:e,messages:t}=this;return e?c("button",{"aria-label":t.close,class:P.closeButton,disabled:!1,key:P.closeButton,onClick:this.closeClickHandler,title:t.close,type:"button",ref:i=>this.closeButtonEl=i},c("calcite-icon",{icon:Li.close,scale:M(this.scale)})):null}async componentDidLoad(){this.calciteInternalTabTitleRegister.emit(await this.getTabIdentifier())}componentDidRender(){fe(this,()=>this.selected)}internalTabChangeHandler(e){e.composedPath().find(i=>i.tagName==="CALCITE-TABS")===this.parentTabsEl&&(this.tab?this.selected=this.tab===e.detail.tab:this.getTabIndex().then(i=>{this.selected=i===e.detail.tab}),e.stopPropagation())}onClick(){this.disabled||this.emitActiveTab()}keyDownHandler(e){switch(e.key){case" ":case"Enter":e.composedPath().includes(this.closeButtonEl)||(this.emitActiveTab(),e.preventDefault());break;case"ArrowRight":e.preventDefault(),q(this.el)==="ltr"?this.calciteInternalTabsFocusNext.emit():this.calciteInternalTabsFocusPrevious.emit();break;case"ArrowLeft":e.preventDefault(),q(this.el)==="ltr"?this.calciteInternalTabsFocusPrevious.emit():this.calciteInternalTabsFocusNext.emit();break;case"Home":e.preventDefault(),this.calciteInternalTabsFocusFirst.emit();break;case"End":e.preventDefault(),this.calciteInternalTabsFocusLast.emit();break}}async getTabIndex(){return Array.prototype.indexOf.call(Qe(this.el.parentElement.children).filter(e=>e.matches("calcite-tab-title")),this.el)}async getTabIdentifier(){return this.tab?this.tab:this.getTabIndex()}async updateAriaInfo(e=[],t=[]){this.controls=e[t.indexOf(this.el.id)]||null}effectiveLocaleChange(){ve(this,this.effectiveLocale)}updateHasText(){this.hasText=this.el.textContent.trim().length>0}setupTextContentObserver(){var e;(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0,subtree:!0})}emitActiveTab(e=!0){if(this.disabled||this.closed)return;const t={tab:this.tab};this.calciteInternalTabsActivate.emit(t),e&&requestAnimationFrame(()=>this.calciteTabsActivate.emit())}closeTabTitleAndNotify(){this.closed=!0,this.calciteInternalTabsClose.emit({tab:this.tab}),this.calciteTabsClose.emit()}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{selected:["selectedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Di}},[1,"calcite-tab-title",{selected:[1540],closable:[516],closed:[1540],disabled:[516],iconEnd:[513,"icon-end"],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],layout:[1537],position:[1],scale:[1],bordered:[1540],tab:[513],messages:[1040],messageOverrides:[1040],controls:[32],defaultMessages:[32],effectiveLocale:[32],hasText:[32],getTabIndex:[64],getTabIdentifier:[64],updateAriaInfo:[64]},[[16,"calciteInternalTabChange","internalTabChangeHandler"],[0,"click","onClick"],[0,"keydown","keyDownHandler"]]]);function vt(){if(typeof customElements>"u")return;["calcite-tab-title","calcite-icon"].forEach(t=>{switch(t){case"calcite-tab-title":customElements.get(t)||customElements.define(t,Pi);break;case"calcite-icon":customElements.get(t)||ie();break}})}vt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const Mi={titleGroup:"title-group"},Ri=":host{display:flex;flex-direction:column}:host([bordered]){box-shadow:inset 0 1px 0 var(--calcite-ui-border-1);background-color:var(--calcite-ui-foreground-1)}:host([bordered]:not([position=bottom])) ::slotted(calcite-tab-nav){margin-block-end:-1px}:host([bordered][position=bottom]){box-shadow:inset 0 1px 0 var(--calcite-ui-border-1), inset 0 -1px 0 var(--calcite-ui-border-1)}:host([bordered]) section{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-1)}:host([bordered][scale=s]) section{padding:0.75rem}:host([bordered][scale=m]) section{padding:0.5rem}:host([bordered][scale=l]) section{padding:1rem}:host([position=bottom]){flex-direction:column-reverse}section{display:flex;flex-grow:1;overflow:hidden;border-block-start-width:1px;border-block-start-color:var(--calcite-ui-border-1);border-block-start-style:solid}:host([position=bottom]) section{flex-direction:column-reverse;border-block-start-width:0px;border-block-end-width:1px;border-block-end-color:var(--calcite-ui-border-1)}:host([position=bottom]:not([bordered])) section{border-block-end-style:solid}@media (forced-colors: active){:host([bordered]) section{border-block-start-width:0px;border-block-end-width:1px}:host([position=bottom][bordered]) section{border-block-start-width:1px;border-block-end-width:0px}}:host([hidden]){display:none}[hidden]{display:none}",Vi=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.mutationObserver=J("mutation",e=>{for(const t of e){const i=t.target;(i.nodeName==="CALCITE-TAB-NAV"||i.nodeName==="CALCITE-TAB-TITLE"||i.nodeName==="CALCITE-TAB")&&this.updateItems()}}),this.layout="inline",this.position="top",this.scale="m",this.bordered=!1,this.titles=[],this.tabs=[]}handleInheritableProps(){this.updateItems()}connectedCallback(){this.mutationObserver.observe(this.el,{childList:!0}),this.updateItems()}async componentWillLoad(){this.updateItems()}disconnectedCallback(){var e;(e=this.mutationObserver)==null||e.disconnect()}render(){return c(Te,null,c("slot",{name:Mi.titleGroup}),c("section",null,c("slot",null)))}calciteInternalTabTitleRegister(e){this.titles=[...this.titles,e.target],this.registryHandler(),e.stopPropagation()}calciteTabTitleUnregister(e){this.titles=this.titles.filter(t=>t!==e.detail),this.registryHandler(),e.stopPropagation()}calciteInternalTabRegister(e){this.tabs=[...this.tabs,e.target],this.registryHandler(),e.stopPropagation()}calciteTabUnregister(e){this.tabs=this.tabs.filter(t=>t!==e.detail),this.registryHandler(),e.stopPropagation()}updateItems(){const{position:e,scale:t}=this,i=this.el.querySelector("calcite-tab-nav");i&&(i.position=e,i.scale=t),Array.from(this.el.querySelectorAll("calcite-tab")).forEach(n=>{n.parentElement===this.el&&(n.scale=t)}),Array.from(this.el.querySelectorAll("calcite-tab-nav > calcite-tab-title")).forEach(n=>{n.position=e,n.scale=t})}async registryHandler(){let e,t;if(this.tabs.some(i=>i.tab)||this.titles.some(i=>i.tab))e=this.tabs.sort((i,n)=>i.tab.localeCompare(n.tab)).map(i=>i.id),t=this.titles.sort((i,n)=>i.tab.localeCompare(n.tab)).map(i=>i.id);else{const i=await Promise.all(this.tabs.map(s=>s.getTabIndex())),n=await Promise.all(this.titles.map(s=>s.getTabIndex()));e=i.reduce((s,a,o)=>(s[a]=this.tabs[o].id,s),[]),t=n.reduce((s,a,o)=>(s[a]=this.titles[o].id,s),[])}this.tabs.forEach(i=>i.updateAriaInfo(e,t)),this.titles.forEach(i=>i.updateAriaInfo(e,t))}get el(){return this}static get watchers(){return{position:["handleInheritableProps"],scale:["handleInheritableProps"]}}static get style(){return Ri}},[1,"calcite-tabs",{layout:[513],position:[513],scale:[513],bordered:[4],titles:[32],tabs:[32]},[[0,"calciteInternalTabTitleRegister","calciteInternalTabTitleRegister"],[16,"calciteTabTitleUnregister","calciteTabTitleUnregister"],[0,"calciteInternalTabRegister","calciteInternalTabRegister"],[16,"calciteTabUnregister","calciteTabUnregister"]]]);function yt(){if(typeof customElements>"u")return;["calcite-tabs"].forEach(t=>{switch(t){case"calcite-tabs":customElements.get(t)||customElements.define(t,Vi);break}})}yt();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */var Ni="Expected a function";function Bi(e,t,i){var n=!0,s=!0;if(typeof e!="function")throw new TypeError(Ni);return Gt(i)&&(n="leading"in i?!!i.leading:n,s="trailing"in i?!!i.trailing:s),Xt(e,t,{leading:n,maxWait:t,trailing:s})}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const $i=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-normal)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){--calcite-color-picker-spacing:8px}:host([scale=s]) .container{inline-size:160px}:host([scale=s]) .saved-colors{gap:0.25rem;grid-template-columns:repeat(auto-fill, 20px)}:host([scale=m]){--calcite-color-picker-spacing:12px}:host([scale=m]) .container{inline-size:272px}:host([scale=l]){--calcite-color-picker-spacing:16px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) .container{inline-size:464px}:host([scale=l]) .section:first-of-type{padding-block-start:var(--calcite-color-picker-spacing)}:host([scale=l]) .saved-colors{grid-template-columns:repeat(auto-fill, 32px)}:host([scale=l]) .control-section{flex-wrap:nowrap;align-items:baseline;flex-wrap:wrap}:host([scale=l]) .color-hex-options{display:flex;flex-shrink:1;flex-direction:column;justify-content:space-around}:host([scale=l]) .color-mode-container{flex-shrink:3}.container{background-color:var(--calcite-ui-foreground-1);display:inline-block;border:1px solid var(--calcite-ui-border-1)}.control-and-scope{position:relative;display:flex;cursor:pointer;touch-action:none}.scope{pointer-events:none;position:absolute;z-index:var(--calcite-app-z-index);block-size:1px;inline-size:1px;border-radius:9999px;background-color:transparent;font-size:var(--calcite-font-size--1);outline-color:transparent}.scope:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + );outline-offset:11px}.hex-and-channels-group{inline-size:100%}.hex-and-channels-group,.control-section{display:flex;flex-direction:row;flex-wrap:wrap}.section{padding-block:0 var(--calcite-color-picker-spacing);padding-inline:var(--calcite-color-picker-spacing)}.section:first-of-type{padding-block-start:var(--calcite-color-picker-spacing)}.sliders{display:flex;flex-direction:column;justify-content:space-between;margin-inline-start:var(--calcite-color-picker-spacing)}.preview-and-sliders{display:flex;align-items:center;padding:var(--calcite-color-picker-spacing)}.color-hex-options,.section--split{flex-grow:1}.header{display:flex;align-items:center;justify-content:space-between;color:var(--calcite-ui-text-1)}.color-mode-container{padding-block-start:var(--calcite-color-picker-spacing)}.channels{display:flex;row-gap:0.125rem}.channel[data-channel-index="3"]{inline-size:159px}:host([scale=s]) .channels{flex-wrap:wrap}:host([scale=s]) .channel{flex-basis:30%;flex-grow:1}:host([scale=s]) .channel[data-channel-index="3"]{inline-size:unset;margin-inline-start:unset}:host([scale=l]) .channel[data-channel-index="3"]{inline-size:131px}.saved-colors{display:grid;gap:0.5rem;padding-block-start:var(--calcite-color-picker-spacing);grid-template-columns:repeat(auto-fill, 24px)}.saved-colors-buttons{display:flex}.saved-color{outline-offset:0;outline-color:transparent;cursor:pointer}.saved-color:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.saved-color:hover{transition:outline-color var(--calcite-internal-animation-timing-fast) ease-in-out;outline:2px solid var(--calcite-ui-border-2);outline-offset:2px}:host([hidden]){display:none}[hidden]{display:none}`,Ki=16,xt=R(class extends V{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteColorPickerChange=y(this,"calciteColorPickerChange",6),this.calciteColorPickerInput=y(this,"calciteColorPickerInput",6),this.internalColorUpdateContext=null,this.mode=x.HEX,this.shiftKeyChannelAdjustment=0,this.handleTabActivate=e=>{this.channelMode=e.currentTarget.getAttribute("data-color-mode"),this.updateChannelsFromColor(this.color)},this.handleColorFieldScopeKeyDown=e=>{const{key:t}=e,i={ArrowUp:{x:0,y:-10},ArrowRight:{x:10,y:0},ArrowDown:{x:0,y:10},ArrowLeft:{x:-10,y:0}};i[t]&&(e.preventDefault(),this.scopeOrientation=t==="ArrowDown"||t==="ArrowUp"?"vertical":"horizontal",this.captureColorFieldColor(this.colorFieldScopeLeft+i[t].x||0,this.colorFieldScopeTop+i[t].y||0,!1))},this.handleHueScopeKeyDown=e=>{const t=e.shiftKey?10:1,{key:i}=e,n={ArrowUp:1,ArrowRight:1,ArrowDown:-1,ArrowLeft:-1};if(n[i]){e.preventDefault();const s=n[i]*t,a=this.baseColorFieldColor.hue(),o=this.baseColorFieldColor.hue(a+s);this.internalColorSet(o,!1)}},this.handleHexInputChange=e=>{e.stopPropagation();const{allowEmpty:t,color:i}=this,s=e.target.value;if(t&&!s){this.internalColorSet(null);return}const a=i&&D(E(i,se(this.mode)));s!==a&&this.internalColorSet(F(s))},this.handleSavedColorSelect=e=>{const t=e.currentTarget;this.internalColorSet(F(t.color))},this.handleChannelInput=e=>{const t=e.currentTarget,i=Number(t.getAttribute("data-channel-index")),s=i===3?$.max:this.channelMode==="rgb"?qe[Object.keys(qe)[i]]:H[Object.keys(H)[i]];let a;if(this.allowEmpty&&!t.value)a="";else{const r=Number(t.value)+this.shiftKeyChannelAdjustment;a=qt(r,0,s).toString()}t.value=a},this.handleChannelChange=e=>{const t=e.currentTarget,i=Number(t.getAttribute("data-channel-index")),n=[...this.channels];if(this.allowEmpty&&!t.value){this.channels=[null,null,null,null],this.internalColorSet(null);return}const a=i===3,o=Number(t.value);n[i]=a?ce(o):o,this.updateColorFromChannels(n)},this.handleSavedColorKeyDown=e=>{Nt(e.key)&&(e.preventDefault(),this.handleSavedColorSelect(e))},this.handleColorFieldPointerDown=e=>{if(!X(e))return;const{offsetX:t,offsetY:i}=e;document.addEventListener("pointermove",this.globalPointerMoveHandler),document.addEventListener("pointerup",this.globalPointerUpHandler,{once:!0}),this.activeCanvasInfo={context:this.colorFieldRenderingContext,bounds:this.colorFieldRenderingContext.canvas.getBoundingClientRect()},this.captureColorFieldColor(t,i),this.colorFieldScopeNode.focus()},this.handleHueSliderPointerDown=e=>{if(!X(e))return;const{offsetX:t}=e;document.addEventListener("pointermove",this.globalPointerMoveHandler),document.addEventListener("pointerup",this.globalPointerUpHandler,{once:!0}),this.activeCanvasInfo={context:this.hueSliderRenderingContext,bounds:this.hueSliderRenderingContext.canvas.getBoundingClientRect()},this.captureHueSliderColor(t),this.hueScopeNode.focus()},this.handleOpacitySliderPointerDown=e=>{if(!X(e))return;const{offsetX:t}=e;document.addEventListener("pointermove",this.globalPointerMoveHandler),document.addEventListener("pointerup",this.globalPointerUpHandler,{once:!0}),this.activeCanvasInfo={context:this.opacitySliderRenderingContext,bounds:this.opacitySliderRenderingContext.canvas.getBoundingClientRect()},this.captureOpacitySliderValue(t),this.opacityScopeNode.focus()},this.globalPointerUpHandler=e=>{if(!X(e))return;const t=this.activeCanvasInfo;this.activeCanvasInfo=null,this.drawColorControls(),t&&this.calciteColorPickerChange.emit()},this.globalPointerMoveHandler=e=>{const{activeCanvasInfo:t,el:i}=this;if(!i.isConnected||!t)return;const{context:n,bounds:s}=t;let a,o;const{clientX:r,clientY:l}=e;n.canvas.matches(":hover")?(a=r-s.x,o=l-s.y):(rs.x?a=r-s.x:rs.y?o=l-s.y:l{this.colorFieldScopeNode=e},this.storeHueScope=e=>{this.hueScopeNode=e},this.renderChannelsTabTitle=e=>{const{channelMode:t,messages:i}=this,n=e===t,s=e==="rgb"?i.rgb:i.hsv;return c("calcite-tab-title",{class:p.colorMode,"data-color-mode":e,key:e,onCalciteTabsActivate:this.handleTabActivate,selected:n},s)},this.renderChannelsTab=e=>{const{allowEmpty:t,channelMode:i,channels:n,messages:s,alphaChannel:a}=this,o=e===i,l=e==="rgb"?[s.red,s.green,s.blue]:[s.hue,s.saturation,s.value],d=q(this.el),u=a?n:n.slice(0,3);return c("calcite-tab",{class:p.control,key:e,selected:o},c("div",{class:p.channels,dir:"ltr"},u.map((f,v)=>{const m=v===3;return m&&(f=t&&!f?f:Q(f)),this.renderChannel(f,v,l[v],d,m?"%":"")})))},this.renderChannel=(e,t,i,n,s)=>c("calcite-input-number",{class:p.channel,"data-channel-index":t,dir:n,key:t,label:i,lang:this.effectiveLocale,numberButtonType:"none",numberingSystem:this.numberingSystem,onCalciteInputNumberChange:this.handleChannelChange,onCalciteInputNumberInput:this.handleChannelInput,onKeyDown:this.handleKeyDown,scale:this.scale==="l"?"m":"s",style:{marginLeft:t>0&&!(this.scale==="s"&&this.alphaChannel&&t===3)?"-1px":""},suffixText:s,value:e==null?void 0:e.toString()}),this.deleteColor=()=>{const e=E(this.color,this.alphaChannel);if(!(this.savedColors.indexOf(e)>-1))return;const i=this.savedColors.filter(s=>s!==e);this.savedColors=i;const n=`${Ie}${this.storageId}`;this.storageId&&localStorage.setItem(n,JSON.stringify(i))},this.saveColor=()=>{const e=E(this.color,this.alphaChannel);if(this.savedColors.indexOf(e)>-1)return;const i=[...this.savedColors,e];this.savedColors=i;const n=`${Ie}${this.storageId}`;this.storageId&&localStorage.setItem(n,JSON.stringify(i))},this.drawColorControls=Bi((e="all")=>{(e==="all"||e==="color-field")&&this.colorFieldRenderingContext&&this.drawColorField(),(e==="all"||e==="hue-slider")&&this.hueSliderRenderingContext&&this.drawHueSlider(),this.alphaChannel&&(e==="all"||e==="opacity-slider")&&this.opacitySliderRenderingContext&&this.drawOpacitySlider()},Ki),this.captureColorFieldColor=(e,t,i=!0)=>{const{dimensions:{colorField:{height:n,width:s}}}=this,a=Math.round(H.s/s*e),o=Math.round(H.v/n*(n-t));this.internalColorSet(this.baseColorFieldColor.hsv().saturationv(a).value(o),i)},this.initColorField=e=>{this.colorFieldRenderingContext=e.getContext("2d"),this.updateCanvasSize("color-field"),this.drawColorControls()},this.initHueSlider=e=>{this.hueSliderRenderingContext=e.getContext("2d"),this.updateCanvasSize("hue-slider"),this.drawHueSlider()},this.initOpacitySlider=e=>{e&&(this.opacitySliderRenderingContext=e.getContext("2d"),this.updateCanvasSize("opacity-slider"),this.drawOpacitySlider())},this.storeOpacityScope=e=>{this.opacityScopeNode=e},this.handleOpacityScopeKeyDown=e=>{const t=e.shiftKey?10:1,{key:i}=e,n={ArrowUp:.01,ArrowRight:.01,ArrowDown:-.01,ArrowLeft:-.01};if(n[i]){e.preventDefault();const s=n[i]*t,a=this.baseColorFieldColor.alpha(),o=this.baseColorFieldColor.alpha(a+s);this.internalColorSet(o,!1)}},this.allowEmpty=!1,this.alphaChannel=!1,this.channelsDisabled=!1,this.color=N,this.disabled=!1,this.format="auto",this.hideChannels=!1,this.hexDisabled=!1,this.hideHex=!1,this.hideSaved=!1,this.savedDisabled=!1,this.scale="m",this.storageId=void 0,this.messageOverrides=void 0,this.numberingSystem=void 0,this.value=D(E(N,this.alphaChannel)),this.defaultMessages=void 0,this.channelMode="rgb",this.channels=this.toChannels(N),this.dimensions=Ue.m,this.effectiveLocale="",this.messages=void 0,this.savedColors=[],this.colorFieldScopeTop=void 0,this.colorFieldScopeLeft=void 0,this.hueScopeLeft=void 0,this.opacityScopeLeft=void 0,this.scopeOrientation=void 0}handleAlphaChannelChange(e){const{format:t}=this;e&&t!=="auto"&&!se(t)&&(console.warn(`ignoring alphaChannel as the current format (${t}) does not support alpha`),this.alphaChannel=!1)}handleColorChange(e,t){this.drawColorControls(),this.updateChannelsFromColor(e),this.previousColor=t}handleFormatOrAlphaChannelChange(){this.setMode(this.format),this.internalColorSet(this.color,!1,"internal")}handleScaleChange(e="m"){this.updateDimensions(e),this.updateCanvasSize("all"),this.drawColorControls()}onMessagesChange(){}handleValueChange(e,t){const{allowEmpty:i,format:n}=this,s=!i||e;let a=!1;if(s){const d=$e(e);if(!d||n!=="auto"&&d!==n){this.showIncompatibleColorWarning(e,n),this.value=t;return}a=this.mode!==d,this.setMode(d,this.internalColorUpdateContext===null)}const o=this.activeCanvasInfo;if(this.internalColorUpdateContext==="initial")return;if(this.internalColorUpdateContext==="user-interaction"){this.calciteColorPickerInput.emit(),o||this.calciteColorPickerChange.emit();return}const r=i&&!e?null:F(e!=null&&typeof e=="object"&&se(this.mode)?mi(e):e),l=!Ke(r,this.color);(a||l)&&this.internalColorSet(r,this.alphaChannel&&!(this.mode.endsWith("a")||this.mode.endsWith("a-css")),"internal")}get baseColorFieldColor(){return this.color||this.previousColor||N}effectiveLocaleChange(){ve(this,this.effectiveLocale)}handleChannelKeyUpOrDown(e){this.shiftKeyChannelAdjustment=0;const{key:t}=e;if(t!=="ArrowUp"&&t!=="ArrowDown"||!e.composedPath().some(s=>{var a;return(a=s.classList)==null?void 0:a.contains(p.channel)}))return;const{shiftKey:i}=e;if(e.preventDefault(),!this.color){this.internalColorSet(this.previousColor),e.stopPropagation();return}const n=9;this.shiftKeyChannelAdjustment=t==="ArrowUp"&&i?n:t==="ArrowDown"&&i?-n:0}async setFocus(){await ue(this),this.el.focus()}async componentWillLoad(){he(this);const{allowEmpty:e,color:t,format:i,value:n}=this,s=e&&!n,a=$e(n),o=s||i==="auto"&&a||i===a,r=s?null:o?F(n):t;o||this.showIncompatibleColorWarning(n,i),this.setMode(i,!1),this.internalColorSet(r,!1,"initial"),this.updateDimensions(this.scale);const l=`${Ie}${this.storageId}`;this.storageId&&localStorage.getItem(l)&&(this.savedColors=JSON.parse(localStorage.getItem(l))),await Ce(this)}connectedCallback(){pe(this),me(this),ye(this)}componentDidLoad(){de(this)}disconnectedCallback(){document.removeEventListener("pointermove",this.globalPointerMoveHandler),document.removeEventListener("pointerup",this.globalPointerUpHandler),be(this),ge(this),xe(this)}componentDidRender(){fe(this)}render(){const{allowEmpty:e,channelsDisabled:t,color:i,colorFieldScopeLeft:n,colorFieldScopeTop:s,dimensions:{slider:{width:a},thumb:{radius:o}},hexDisabled:r,hideChannels:l,hideHex:d,hideSaved:u,hueScopeLeft:f,messages:v,alphaChannel:m,opacityScopeLeft:b,savedColors:g,savedDisabled:z,scale:O,scopeOrientation:wt}=this,Le=i?E(i,m):null,kt=o,It=f??a*N.hue()/H.h,St=o,Tt=b??a*Q(N.alpha())/$.max,De=i===null,ke=wt==="vertical",Pe=r||d,Me=t||l,Et=z||u,[zt,At]=this.getAdjustedScopePosition(n,s),[Ht,Ft]=this.getAdjustedScopePosition(It,kt),[Ot,Lt]=this.getAdjustedScopePosition(Tt,St);return c("div",{class:p.container},c("div",{class:p.controlAndScope},c("canvas",{class:p.colorField,onPointerDown:this.handleColorFieldPointerDown,ref:this.initColorField}),c("div",{"aria-label":ke?v.value:v.saturation,"aria-valuemax":ke?H.v:H.s,"aria-valuemin":"0","aria-valuenow":(ke?i==null?void 0:i.saturationv():i==null?void 0:i.value())||"0",class:{[p.scope]:!0,[p.colorFieldScope]:!0},onKeyDown:this.handleColorFieldScopeKeyDown,role:"slider",style:{top:`${At||0}px`,left:`${zt||0}px`},tabindex:"0",ref:this.storeColorFieldScope})),c("div",{class:p.previewAndSliders},c("calcite-color-picker-swatch",{class:p.preview,color:Le,scale:"l"}),c("div",{class:p.sliders},c("div",{class:p.controlAndScope},c("canvas",{class:{[p.slider]:!0,[p.hueSlider]:!0},onPointerDown:this.handleHueSliderPointerDown,ref:this.initHueSlider}),c("div",{"aria-label":v.hue,"aria-valuemax":H.h,"aria-valuemin":"0","aria-valuenow":(i==null?void 0:i.round().hue())||N.round().hue(),class:{[p.scope]:!0,[p.hueScope]:!0},onKeyDown:this.handleHueScopeKeyDown,role:"slider",style:{top:`${Ft}px`,left:`${Ht}px`},tabindex:"0",ref:this.storeHueScope})),m?c("div",{class:p.controlAndScope},c("canvas",{class:{[p.slider]:!0,[p.opacitySlider]:!0},onPointerDown:this.handleOpacitySliderPointerDown,ref:this.initOpacitySlider}),c("div",{"aria-label":v.opacity,"aria-valuemax":$.max,"aria-valuemin":$.min,"aria-valuenow":(i||N).round().alpha(),class:{[p.scope]:!0,[p.opacityScope]:!0},onKeyDown:this.handleOpacityScopeKeyDown,role:"slider",style:{top:`${Lt}px`,left:`${Ot}px`},tabindex:"0",ref:this.storeOpacityScope})):null)),Pe&&Me?null:c("div",{class:{[p.controlSection]:!0,[p.section]:!0}},c("div",{class:p.hexAndChannelsGroup},Pe?null:c("div",{class:p.hexOptions},c("calcite-color-picker-hex-input",{allowEmpty:e,alphaChannel:m,class:p.control,messages:v,numberingSystem:this.numberingSystem,onCalciteColorPickerHexInputChange:this.handleHexInputChange,scale:O,value:Le})),Me?null:c("calcite-tabs",{class:{[p.colorModeContainer]:!0,[p.splitSection]:!0},scale:O==="l"?"m":"s"},c("calcite-tab-nav",{slot:"title-group"},this.renderChannelsTabTitle("rgb"),this.renderChannelsTabTitle("hsv")),this.renderChannelsTab("rgb"),this.renderChannelsTab("hsv")))),Et?null:c("div",{class:{[p.savedColorsSection]:!0,[p.section]:!0}},c("div",{class:p.header},c("label",null,v.saved),c("div",{class:p.savedColorsButtons},c("calcite-button",{appearance:"transparent",class:p.deleteColor,disabled:De,iconStart:"minus",kind:"neutral",label:v.deleteColor,onClick:this.deleteColor,scale:O,type:"button"}),c("calcite-button",{appearance:"transparent",class:p.saveColor,disabled:De,iconStart:"plus",kind:"neutral",label:v.saveColor,onClick:this.saveColor,scale:O,type:"button"}))),g.length>0?c("div",{class:p.savedColors},[...g.map(Re=>c("calcite-color-picker-swatch",{class:p.savedColor,color:Re,key:Re,onClick:this.handleSavedColorSelect,onKeyDown:this.handleSavedColorKeyDown,scale:O,tabIndex:0}))]):null))}handleKeyDown(e){e.key==="Enter"&&e.preventDefault()}showIncompatibleColorWarning(e,t){console.warn(`ignoring color value (${e}) as it is not compatible with the current format (${t})`)}setMode(e,t=!0){const i=e==="auto"?this.mode:e;this.mode=this.ensureCompatibleMode(i,t)}ensureCompatibleMode(e,t){const{alphaChannel:i}=this,n=se(e);if(i&&!n){const s=gi(e);return t&&console.warn(`setting format to (${s}) as the provided one (${e}) does not support alpha`),s}if(!i&&n){const s=We(e);return t&&console.warn(`setting format to (${s}) as the provided one (${e}) does not support alpha`),s}return e}captureHueSliderColor(e){const{dimensions:{slider:{width:t}}}=this,i=_e/t*e;this.internalColorSet(this.baseColorFieldColor.hue(i),!1)}captureOpacitySliderValue(e){const{dimensions:{slider:{width:t}}}=this,i=ce($.max/t*e);this.internalColorSet(this.baseColorFieldColor.alpha(i),!1)}internalColorSet(e,t=!0,i="user-interaction"){t&&Ke(e,this.color)||(this.internalColorUpdateContext=i,this.color=e,this.value=this.toValue(e),this.internalColorUpdateContext=null)}toValue(e,t=this.mode){if(!e)return null;const i="hex";if(t.includes(i)){const s=t===x.HEXA;return D(E(e.round(),s),s)}if(t.includes("-css")){const s=e[t.replace("-css","").replace("a","")]().round().string();if((t.endsWith("a")||t.endsWith("a-css"))&&e.alpha()===1){const o=s.slice(0,3),r=s.slice(4,-1);return`${o}a(${r}, ${e.alpha()})`}return s}const n=e[We(t)]().round().object();return t.endsWith("a")?fi(n):n}getSliderCapSpacing(){const{dimensions:{slider:{height:e},thumb:{radius:t}}}=this;return t*2-e}updateDimensions(e="m"){this.dimensions=Ue[e]}drawColorField(){const e=this.colorFieldRenderingContext,{dimensions:{colorField:{height:t,width:i}}}=this;e.fillStyle=this.baseColorFieldColor.hsv().saturationv(100).value(100).alpha(1).string(),e.fillRect(0,0,i,t);const n=e.createLinearGradient(0,0,i,0);n.addColorStop(0,"rgba(255,255,255,1)"),n.addColorStop(1,"rgba(255,255,255,0)"),e.fillStyle=n,e.fillRect(0,0,i,t);const s=e.createLinearGradient(0,0,0,t);s.addColorStop(0,"rgba(0,0,0,0)"),s.addColorStop(1,"rgba(0,0,0,1)"),e.fillStyle=s,e.fillRect(0,0,i,t),this.drawActiveColorFieldColor()}setCanvasContextSize(e,{height:t,width:i}){if(!e)return;const n=window.devicePixelRatio||1;e.width=i*n,e.height=t*n,e.style.height=`${t}px`,e.style.width=`${i}px`,e.getContext("2d").scale(n,n)}updateCanvasSize(e="all"){var n,s,a;const{dimensions:t}=this;(e==="all"||e==="color-field")&&this.setCanvasContextSize((n=this.colorFieldRenderingContext)==null?void 0:n.canvas,t.colorField);const i={width:t.slider.width,height:t.slider.height+(t.thumb.radius-t.slider.height/2)*2};(e==="all"||e==="hue-slider")&&this.setCanvasContextSize((s=this.hueSliderRenderingContext)==null?void 0:s.canvas,i),(e==="all"||e==="opacity-slider")&&this.setCanvasContextSize((a=this.opacitySliderRenderingContext)==null?void 0:a.canvas,i)}drawActiveColorFieldColor(){const{color:e}=this;if(!e)return;const t=e.hsv(),{dimensions:{colorField:{height:i,width:n},thumb:{radius:s}}}=this,a=t.saturationv()/(H.s/n),o=i-t.value()/(H.v/i);requestAnimationFrame(()=>{this.colorFieldScopeLeft=a,this.colorFieldScopeTop=o}),this.drawThumb(this.colorFieldRenderingContext,s,a,o,t)}drawThumb(e,t,i,n,s){const o=2*Math.PI,r=1;e.beginPath(),e.arc(i,n,t,0,o),e.fillStyle="#fff",e.fill(),e.strokeStyle="rgba(0,0,0,0.3)",e.lineWidth=r,e.stroke(),e.beginPath(),e.arc(i,n,t-3,0,o),e.fillStyle=s.rgb().alpha(1).string(),e.fill()}drawActiveHueSliderColor(){const{color:e}=this;if(!e)return;const t=e.hsv().saturationv(100).value(100),{dimensions:{slider:{width:i},thumb:{radius:n}}}=this,s=t.hue()/(_e/i),a=n,o=this.getSliderBoundX(s,i,n);requestAnimationFrame(()=>{this.hueScopeLeft=o}),this.drawThumb(this.hueSliderRenderingContext,n,o,a,t)}drawHueSlider(){const e=this.hueSliderRenderingContext,{dimensions:{slider:{height:t,width:i},thumb:{radius:n}}}=this,s=0,a=n-t/2,o=e.createLinearGradient(0,0,i,0),r=["red","yellow","lime","cyan","blue","magenta","#ff0004"],l=1/(r.length-1);let d=0;r.forEach(u=>{o.addColorStop(d,F(u).string()),d+=l}),e.clearRect(0,0,i,t+this.getSliderCapSpacing()*2),this.drawSliderPath(e,t,i,s,a),e.fillStyle=o,e.fill(),e.strokeStyle="rgba(0,0,0,0.3)",e.lineWidth=1,e.stroke(),this.drawActiveHueSliderColor()}drawOpacitySlider(){const e=this.opacitySliderRenderingContext,{baseColorFieldColor:t,dimensions:{slider:{height:i,width:n},thumb:{radius:s}}}=this,a=0,o=s-i/2;e.clearRect(0,0,n,i+this.getSliderCapSpacing()*2);const r=e.createLinearGradient(0,o,n,0),l=t.rgb().alpha(0),d=t.rgb().alpha(.5),u=t.rgb().alpha(1);r.addColorStop(0,l.string()),r.addColorStop(.5,d.string()),r.addColorStop(1,u.string()),this.drawSliderPath(e,i,n,a,o);const f=e.createPattern(this.getCheckeredBackgroundPattern(),"repeat");e.fillStyle=f,e.fill(),e.fillStyle=r,e.fill(),e.strokeStyle="rgba(0,0,0,0.3)",e.lineWidth=1,e.stroke(),this.drawActiveOpacitySliderColor()}drawSliderPath(e,t,i,n,s){const a=t/2+1;e.beginPath(),e.moveTo(n+a,s),e.lineTo(n+i-a,s),e.quadraticCurveTo(n+i,s,n+i,s+a),e.lineTo(n+i,s+t-a),e.quadraticCurveTo(n+i,s+t,n+i-a,s+t),e.lineTo(n+a,s+t),e.quadraticCurveTo(n,s+t,n,s+t-a),e.lineTo(n,s+a),e.quadraticCurveTo(n,s,n+a,s),e.closePath()}getCheckeredBackgroundPattern(){if(this.checkerPattern)return this.checkerPattern;const e=document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.fillStyle="#ccc",t.fillRect(0,0,10,10),t.fillStyle="#fff",t.fillRect(0,0,5,5),t.fillRect(5,5,5,5),this.checkerPattern=e,e}drawActiveOpacitySliderColor(){const{color:e}=this;if(!e)return;const t=e,{dimensions:{slider:{width:i},thumb:{radius:n}}}=this,s=Q(t.alpha())/($.max/i),a=n,o=this.getSliderBoundX(s,i,n);requestAnimationFrame(()=>{this.opacityScopeLeft=o}),this.drawThumb(this.opacitySliderRenderingContext,n,o,a,t)}getSliderBoundX(e,t,i){const n=_t(e,t,i);return n===0?e:n===-1?Ne(e,0,t,i,i*2):Ne(e,0,t,t-i*2,t-i)}updateColorFromChannels(e){this.internalColorSet(F(e,this.channelMode))}updateChannelsFromColor(e){this.channels=e?this.toChannels(e):[null,null,null,null]}toChannels(e){const{channelMode:t}=this,i=e[t]().array().map((n,s)=>s===3?n:Math.floor(n));return i.length===3&&i.push(1),i}getAdjustedScopePosition(e,t){return[e-je/2,t-je/2]}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{alphaChannel:["handleAlphaChannelChange","handleFormatOrAlphaChannelChange"],color:["handleColorChange"],format:["handleFormatOrAlphaChannelChange"],scale:["handleScaleChange"],messageOverrides:["onMessagesChange"],value:["handleValueChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $i}},[17,"calcite-color-picker",{allowEmpty:[516,"allow-empty"],alphaChannel:[4,"alpha-channel"],channelsDisabled:[4,"channels-disabled"],color:[1040],disabled:[516],format:[513],hideChannels:[516,"hide-channels"],hexDisabled:[4,"hex-disabled"],hideHex:[516,"hide-hex"],hideSaved:[516,"hide-saved"],savedDisabled:[516,"saved-disabled"],scale:[513],storageId:[513,"storage-id"],messageOverrides:[1040],numberingSystem:[513,"numbering-system"],value:[1025],messages:[1040],defaultMessages:[32],channelMode:[32],channels:[32],dimensions:[32],effectiveLocale:[32],savedColors:[32],colorFieldScopeTop:[32],colorFieldScopeLeft:[32],hueScopeLeft:[32],opacityScopeLeft:[32],scopeOrientation:[32],setFocus:[64]},[[2,"keydown","handleChannelKeyUpOrDown"],[2,"keyup","handleChannelKeyUpOrDown"]]]);function Ct(){if(typeof customElements>"u")return;["calcite-color-picker","calcite-button","calcite-color-picker-hex-input","calcite-color-picker-swatch","calcite-icon","calcite-input-number","calcite-input-text","calcite-loader","calcite-progress","calcite-tab","calcite-tab-nav","calcite-tab-title","calcite-tabs"].forEach(t=>{switch(t){case"calcite-color-picker":customElements.get(t)||customElements.define(t,xt);break;case"calcite-button":customElements.get(t)||Ut();break;case"calcite-color-picker-hex-input":customElements.get(t)||bt();break;case"calcite-color-picker-swatch":customElements.get(t)||ft();break;case"calcite-icon":customElements.get(t)||ie();break;case"calcite-input-number":customElements.get(t)||Fe();break;case"calcite-input-text":customElements.get(t)||Oe();break;case"calcite-loader":customElements.get(t)||jt();break;case"calcite-progress":customElements.get(t)||we();break;case"calcite-tab":customElements.get(t)||mt();break;case"calcite-tab-nav":customElements.get(t)||gt();break;case"calcite-tab-title":customElements.get(t)||vt();break;case"calcite-tabs":customElements.get(t)||yt();break}})}Ct();const rn=xt,ln=Ct;export{rn as CalciteColorPicker,ln as defineCustomElement}; diff --git a/dist/assets/calcite-dropdown-caxGPYrb.js b/dist/assets/calcite-dropdown-caxGPYrb.js new file mode 100644 index 0000000..67e8261 --- /dev/null +++ b/dist/assets/calcite-dropdown-caxGPYrb.js @@ -0,0 +1,9 @@ +import{q as v,H as E,r,t as s,v as d,x as D,B as y,j$ as a,ac as p}from"./index-J0iiHjMT.js";import{f as C,c as h,b as x,a as O,F as m,r as I}from"./floating-ui-McpI0u1Z.js";import{g as H}from"./guid-6vN-YNJI.js";import{c as P,u as S,d as k}from"./interactive-NKzPUNL4.js";import{i as F}from"./key-qdHumIlA.js";import{c as z,s as T,a as A}from"./loadable-sxY2K1G3.js";import{c as f}from"./observers-JyBmMU24.js";import{o as u}from"./openCloseComponent-yw47Oy2q.js";import"./debounce-HnHf1UOZ.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const B={dropdownTrigger:"trigger"},L=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;flex:0 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width=s]){--calcite-dropdown-width:12rem}:host([width=m]){--calcite-dropdown-width:14rem}:host([width=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}",w=v(class extends E{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownSelect=r(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=r(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=r(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=r(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=r(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=f("mutation",()=>this.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${H()}`,this.defaultAssignedElements=[],this.slotChangeHandler=e=>{this.defaultAssignedElements=e.target.assignedElements({flatten:!0}),this.updateItems()},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?C(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e==null?void 0:e.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i==null?void 0:i.matches("calcite-dropdown-group"));this.groups=t,this.updateItems()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e==null?void 0:e.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,h(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,h(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(this.open){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}else if(e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}}F(i)?(this.openCalciteDropdown(),e.preventDefault()):i==="Escape"&&(this.closeCalciteDropdown(),e.preventDefault())}},this.focusOnFirstActiveOrFirstItem=()=>{this.getFocusableElement(this.items.find(e=>e.selected)||this.items[0])},this.toggleOpenEnd=()=>{this.focusOnFirstActiveOrFirstItem(),this.el.removeEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.openCalciteDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=x,this.selectedItems=[],this.type="click",this.width=void 0,this.scale="m"}openHandler(e){if(!this.disabled){e&&this.reposition(!0),u(this);return}this.open=!1}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems()}async setFocus(){await z(this),this.el.focus()}connectedCallback(){var e;(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.reposition(!0),this.open&&(this.openHandler(this.open),u(this)),P(this),this.updateItems()}componentWillLoad(){T(this)}componentDidLoad(){A(this),this.reposition(!0)}componentDidRender(){S(this)}disconnectedCallback(){var e,t;(e=this.mutationObserver)==null||e.disconnect(),(t=this.resizeObserver)==null||t.disconnect(),k(this),O(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return s(D,null,s("div",{class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.openCalciteDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},s("slot",{"aria-controls":`${t}-menu`,"aria-expanded":d(e),"aria-haspopup":"menu",name:B.dropdownTrigger,onSlotchange:this.updateTriggers})),s("div",{"aria-hidden":d(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},s("div",{"aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,role:"menu",ref:this.setScrollerAndTransitionEl},s("slot",{onSlotchange:this.updateGroups}))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:o,overlayPositioning:n,filteredFlipPlacements:l}=this;return I(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:o,flipPlacements:l,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!y(e)||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.openCalciteDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target;switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":a(this.items,i,"next");break;case"ArrowUp":a(this.items,i,"previous");break;case"Home":a(this.items,i,"first");break;case"End":a(this.items,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,o=0,n;return this.groups.forEach(l=>{e>0&&i{b===0&&(isNaN(n)&&(n=c.offsetTop),o+=n),ie?o:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}getFocusableElement(e){if(!e)return;const t=e.attributes.isLink?e.shadowRoot.querySelector("a"):e;p(t)}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return L}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],width:[513],scale:[513],setFocus:[64],reposition:[64]},[[9,"pointerdown","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]]]);function g(){if(typeof customElements>"u")return;["calcite-dropdown"].forEach(t=>{switch(t){case"calcite-dropdown":customElements.get(t)||customElements.define(t,w);break}})}g();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const X=w,Y=g;export{X as CalciteDropdown,Y as defineCustomElement}; diff --git a/dist/assets/calcite-dropdown-group-bJt5U1w-.js b/dist/assets/calcite-dropdown-group-bJt5U1w-.js new file mode 100644 index 0000000..68dcfb8 --- /dev/null +++ b/dist/assets/calcite-dropdown-group-bJt5U1w-.js @@ -0,0 +1,5 @@ +import{q as s,H as a,r as d,t as o,x as l}from"./index-J0iiHjMT.js";import{c}from"./observers-JyBmMU24.js";import{C as r}from"./resources2-gI505pgk.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const p=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}",i=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=d(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=c("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var e;this.updateItems(),(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var e;(e=this.mutationObserver)==null||e.disconnect()}render(){const e=this.groupTitle?o("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,t=this.groupPosition>0?o("div",{class:"dropdown-separator",role:"separator"}):null;return o(l,{"aria-label":this.groupTitle,role:"group"},o("div",{class:{[r.container]:!0,[`${r.container}--${this.scale}`]:!0}},t,e,o("slot",null)))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return p}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[1],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]]]);function n(){if(typeof customElements>"u")return;["calcite-dropdown-group"].forEach(t=>{switch(t){case"calcite-dropdown-group":customElements.get(t)||customElements.define(t,i);break}})}n();const g=i,w=n;export{g as CalciteDropdownGroup,w as defineCustomElement}; diff --git a/dist/assets/calcite-dropdown-item-HvBJs5CH.js b/dist/assets/calcite-dropdown-item-HvBJs5CH.js new file mode 100644 index 0000000..9b82e5d --- /dev/null +++ b/dist/assets/calcite-dropdown-item-HvBJs5CH.js @@ -0,0 +1,15 @@ +import{q as k,H as v,r as c,t as i,v as I,x as D}from"./index-J0iiHjMT.js";import{C as t}from"./resources2-gI505pgk.js";import{c as E,s as x,a as y}from"./loadable-sxY2K1G3.js";import{g as a}from"./component-dtiBfYiX.js";import{d as C}from"./icon-ZwpY5ksA.js";import"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const z=`.container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}.container--s.container--none-selection{padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{padding-inline-start:0px}.container--m.container--none-selection{padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{padding-inline-start:0px}.container--l.container--none-selection{padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;padding-inline-end:auto;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;padding-inline-end:0.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;padding-inline-end:0.75rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;padding-inline-end:1rem;padding-inline-start:2.5rem}:host(:hover) .container,:host(:active) .container{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1);text-decoration-line:none}:host(:hover) .container--link .dropdown-link,:host(:active) .container--link .dropdown-link{color:var(--calcite-ui-text-1)}:host(:focus) .container{color:var(--calcite-ui-text-1);text-decoration-line:none}:host(:active) .container{background-color:var(--calcite-ui-foreground-3)}:host(:hover) .container:before,:host(:active) .container:before,:host(:focus) .container:before{opacity:1}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}:host([selected]) .container:not(.container--none-selection):before,:host([selected]) .container--link .dropdown-link:before{opacity:1;color:var(--calcite-ui-brand)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-ui-brand)}.container--multi-selection:before,.container--none-selection:before{display:none}.container--s:before{inset-inline-start:0.5rem}.container--m:before{inset-inline-start:0.75rem}.container--l:before{inset-inline-start:1rem}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover) .dropdown-item-icon{color:var(--calcite-ui-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-ui-brand);opacity:1}.container--s .dropdown-item-icon-start{margin-inline-end:0.5rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{margin-inline-end:0.75rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{margin-inline-end:1rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{margin-inline-start:1rem}:host([hidden]){display:none}[hidden]{display:none}`,p=k(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownItemSelect=c(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=c(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=c(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=c(this,"calciteInternalDropdownCloseRequest",6),this.selected=!1,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.href=void 0,this.label=void 0,this.rel=void 0,this.target=void 0,this.selectionMode="single",this.scale="m"}async setFocus(){var e;await E(this),(e=this.el)==null||e.focus()}componentWillLoad(){x(this),this.initialize()}componentDidLoad(){y(this)}connectedCallback(){this.initialize()}render(){const{href:e,selectionMode:n,label:s,iconFlipRtl:o,scale:u}=this,l=i("calcite-icon",{class:t.iconStart,flipRtl:o==="start"||o==="both",icon:this.iconStart,scale:a(this.scale)}),r=i("span",{class:t.itemContent},i("slot",null)),d=i("calcite-icon",{class:t.iconEnd,flipRtl:o==="end"||o==="both",icon:this.iconEnd,scale:a(this.scale)}),m=this.iconStart&&this.iconEnd?[l,r,d]:this.iconStart?[l,r]:this.iconEnd?[r,d]:r,f=e?i("a",{"aria-label":s,class:t.link,href:e,rel:this.rel,tabIndex:-1,target:this.target,ref:b=>this.childLink=b},m):m,g=e?null:n==="single"?"menuitemradio":n==="multiple"?"menuitemcheckbox":"menuitem",w=n!=="none"?I(this.selected):null;return i(D,{"aria-checked":w,"aria-label":e?"":s,role:g,tabindex:"0"},i("div",{class:{[t.container]:!0,[t.containerLink]:!!e,[`${t.container}--${u}`]:!0,[t.containerMulti]:n==="multiple",[t.containerSingle]:n==="single",[t.containerNone]:n==="none"}},n!=="none"?i("calcite-icon",{class:t.icon,icon:n==="multiple"?"check":"bullet-point",scale:a(this.scale)}):null,f))}onClick(){this.emitRequestedItem()}keyDownHandler(e){switch(e.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),e.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),e.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":e.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:e});break}}updateActiveItemOnChange(e){e.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.determineActiveItem()),e.stopPropagation()}initialize(){this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),this.selectionMode==="none"&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1;break}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return this}static get style(){return z}},[1,"calcite-dropdown-item",{selected:[1540],iconFlipRtl:[513,"icon-flip-rtl"],iconStart:[513,"icon-start"],iconEnd:[513,"icon-end"],href:[513],label:[1],rel:[513],target:[513],selectionMode:[1,"selection-mode"],scale:[1],setFocus:[64]},[[0,"click","onClick"],[0,"keydown","keyDownHandler"],[16,"calciteInternalDropdownItemChange","updateActiveItemOnChange"]]]);function h(){if(typeof customElements>"u")return;["calcite-dropdown-item","calcite-icon"].forEach(n=>{switch(n){case"calcite-dropdown-item":customElements.get(n)||customElements.define(n,p);break;case"calcite-icon":customElements.get(n)||C();break}})}h();const F=p,H=h;export{F as CalciteDropdownItem,H as defineCustomElement}; diff --git a/dist/assets/calcite-flow-A39UdeqN.js b/dist/assets/calcite-flow-A39UdeqN.js new file mode 100644 index 0000000..f5beaec --- /dev/null +++ b/dist/assets/calcite-flow-A39UdeqN.js @@ -0,0 +1,5 @@ +import{q as h,H as u,t as m}from"./index-J0iiHjMT.js";import{c as p}from"./observers-JyBmMU24.js";import{c as g,s as w,a as b}from"./loadable-sxY2K1G3.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const r={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=p("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const s=t>1;return!(t&&e>1)&&!s?null:e{const{customItemSelectors:t,el:e,items:s}=this,o=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),c=s.length,n=o.length,a=o[n-1],l=o[n-2];if(n&&a&&o.forEach(i=>{i.showBackButton=i===a&&n>1,i.hidden=i!==a}),l&&(l.menuOpen=!1),this.items=o,c!==n){const i=this.getFlowDirection(c,n);this.itemCount=n,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const s=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await s.call(e)}catch{return}return e.remove(),e}async setFocus(){await g(this);const{items:t}=this,e=t[t.length-1];return e==null?void 0:e.setFocus()}connectedCallback(){var t;(t=this.itemMutationObserver)==null||t.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){w(this)}componentDidLoad(){b(this)}disconnectedCallback(){var t;(t=this.itemMutationObserver)==null||t.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[r.frame]:!0,[r.frameAdvancing]:t==="advancing",[r.frameRetreating]:t==="retreating"};return m("div",{class:e},m("slot",null))}get el(){return this}static get style(){return v}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){if(typeof customElements>"u")return;["calcite-flow"].forEach(e=>{switch(e){case"calcite-flow":customElements.get(e)||customElements.define(e,f);break}})}d();const C=f,D=d;export{C as CalciteFlow,D as defineCustomElement}; diff --git a/dist/assets/calcite-flow-item-mBjWFd-U.js b/dist/assets/calcite-flow-item-mBjWFd-U.js new file mode 100644 index 0000000..387a227 --- /dev/null +++ b/dist/assets/calcite-flow-item-mBjWFd-U.js @@ -0,0 +1,9 @@ +import{q as S,H as w,r as u,h7 as p,kr as J,ks as Q,t as n,v as k,ad as V,ch as X,x as Y}from"./index-J0iiHjMT.js";import{c as E,u as A,d as y}from"./interactive-NKzPUNL4.js";import{s as H,a as F,c as B}from"./loadable-sxY2K1G3.js";import{c as z,d as L}from"./locale-pfkq1d6A.js";import{c as I,s as M,d as P,u as O}from"./t9n-od6MEnI1.js";import{c as Z}from"./observers-JyBmMU24.js";import{d as T,S as N}from"./action-menu-h_LAlWK7.js";import{d as D,H as ee}from"./popover-Jm1QI0N1.js";import{d as $}from"./action-W5zDPNjG.js";import{d as R}from"./icon-ZwpY5ksA.js";import{d as _}from"./loader-QqciGs1c.js";import{d as W}from"./scrim-OeyGkB0-.js";import"./key-qdHumIlA.js";import"./guid-6vN-YNJI.js";import"./floating-ui-McpI0u1Z.js";import"./debounce-HnHf1UOZ.js";import"./openCloseComponent-yw47Oy2q.js";import"./FloatingArrow-BghsONry.js";import"./component-dtiBfYiX.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const o={actionBarContainer:"action-bar-container",backButton:"back-button",container:"container",header:"header",headerContainer:"header-container",headerContainerBorderEnd:"header-container--border-end",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",fabContainer:"fab-container",footer:"footer"},C={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right",expand:"chevron-down",collapse:"chevron-up"},s={actionBar:"action-bar",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},te=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-ui-text-2);color:var(--calcite-ui-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.container{margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-ui-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{z-index:var(--calcite-app-z-index-header);display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);border-block-end:var(--calcite-panel-header-border-block-end, 1px solid var(--calcite-ui-border-3))}.header-container{display:flex;inline-size:100%;flex-direction:row;align-items:stretch;justify-content:flex-start;flex:0 0 auto}.header-container--border-end{border-block-end:1px solid var(--calcite-ui-border-3)}.action-bar-container{inline-size:100%}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;font-weight:var(--calcite-font-weight-medium)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem;color:var(--calcite-ui-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{display:flex;block-size:100%;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:auto;background-color:var(--calcite-ui-background)}.footer{display:flex;inline-size:100%;justify-content:space-evenly;background-color:var(--calcite-ui-foreground-1);flex:0 0 auto;padding:var(--calcite-panel-footer-padding, 0.5rem);border-block-start:1px solid var(--calcite-ui-border-3)}.fab-container{position:sticky;inset-block-end:0px;z-index:var(--calcite-app-z-index-sticky);margin-block:0px;margin-inline:auto;display:block;padding:0.5rem;inset-inline:0;inline-size:-moz-fit-content;inline-size:fit-content}:host([hidden]){display:none}[hidden]{display:none}",ne=S(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePanelClose=u(this,"calcitePanelClose",6),this.calcitePanelToggle=u(this,"calcitePanelToggle",6),this.calcitePanelScroll=u(this,"calcitePanelScroll",6),this.resizeObserver=Z("resize",()=>this.resizeHandler()),this.resizeHandler=()=>{const{panelScrollEl:e}=this;!e||typeof e.scrollHeight!="number"||typeof e.offsetHeight!="number"||(e.tabIndex=e.scrollHeight>e.offsetHeight?0:-1)},this.setContainerRef=e=>{this.containerEl=e},this.panelKeyDownHandler=e=>{this.closable&&e.key==="Escape"&&!e.defaultPrevented&&(this.close(),e.preventDefault())},this.close=()=>{this.closed=!0,this.calcitePanelClose.emit()},this.collapse=()=>{this.collapsed=!this.collapsed,this.calcitePanelToggle.emit()},this.panelScrollHandler=()=>{this.calcitePanelScroll.emit()},this.handleHeaderActionsStartSlotChange=e=>{this.hasStartActions=p(e)},this.handleHeaderActionsEndSlotChange=e=>{this.hasEndActions=p(e)},this.handleHeaderMenuActionsSlotChange=e=>{this.hasMenuItems=p(e)},this.handleActionBarSlotChange=e=>{const t=J(e).filter(a=>a==null?void 0:a.matches("calcite-action-bar"));t.forEach(a=>a.layout="horizontal"),this.hasActionBar=!!t.length},this.handleHeaderContentSlotChange=e=>{this.hasHeaderContent=p(e)},this.handleFooterSlotChange=e=>{this.hasFooterContent=p(e)},this.handleFooterActionsSlotChange=e=>{this.hasFooterActions=p(e)},this.handleFabSlotChange=e=>{this.hasFab=p(e)},this.setPanelScrollEl=e=>{var t,a;this.panelScrollEl=e,(t=this.resizeObserver)==null||t.disconnect(),e&&((a=this.resizeObserver)==null||a.observe(e),this.resizeHandler())},this.closed=!1,this.disabled=!1,this.closable=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.headingLevel=void 0,this.loading=!1,this.heading=void 0,this.description=void 0,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.hasStartActions=!1,this.hasEndActions=!1,this.hasMenuItems=!1,this.hasHeaderContent=!1,this.hasActionBar=!1,this.hasFooterContent=!1,this.hasFooterActions=!1,this.hasFab=!1,this.defaultMessages=void 0,this.effectiveLocale="",this.showHeaderContent=!1}onMessagesChange(){}connectedCallback(){E(this),z(this),I(this)}async componentWillLoad(){H(this),await M(this)}componentDidLoad(){F(this)}componentDidRender(){A(this)}disconnectedCallback(){var e;y(this),L(this),P(this),(e=this.resizeObserver)==null||e.disconnect()}effectiveLocaleChange(){O(this,this.effectiveLocale)}async setFocus(){await B(this),Q(this.containerEl)}async scrollContentTo(e){var t;(t=this.panelScrollEl)==null||t.scrollTo(e)}renderHeaderContent(){const{heading:e,headingLevel:t,description:a,hasHeaderContent:i}=this,c=e?n(ee,{class:o.heading,level:t},e):null,l=a?n("span",{class:o.description},a):null;return!i&&(c||l)?n("div",{class:o.headerContent,key:"header-content"},c,l):null}renderActionBar(){return n("div",{class:o.actionBarContainer,hidden:!this.hasActionBar},n("slot",{name:s.actionBar,onSlotchange:this.handleActionBarSlotChange}))}renderHeaderSlottedContent(){return n("div",{class:o.headerContent,hidden:!this.hasHeaderContent,key:"slotted-header-content"},n("slot",{name:s.headerContent,onSlotchange:this.handleHeaderContentSlotChange}))}renderHeaderStartActions(){const{hasStartActions:e}=this;return n("div",{class:{[o.headerActionsStart]:!0,[o.headerActions]:!0},hidden:!e,key:"header-actions-start"},n("slot",{name:s.headerActionsStart,onSlotchange:this.handleHeaderActionsStartSlotChange}))}renderHeaderActionsEnd(){const{hasEndActions:e,messages:t,closable:a,collapsed:i,collapseDirection:c,collapsible:l,hasMenuItems:r}=this,{collapse:d,expand:f,close:m}=t,b=[C.expand,C.collapse];c==="up"&&b.reverse();const g=l?n("calcite-action",{"aria-expanded":k(!i),"aria-label":d,"data-test":"collapse",icon:i?b[0]:b[1],onClick:this.collapse,text:d,title:i?f:d}):null,v=a?n("calcite-action",{"aria-label":m,"data-test":"close",icon:C.close,onClick:this.close,text:m,title:m}):null,q=n("slot",{name:s.headerActionsEnd,onSlotchange:this.handleHeaderActionsEndSlotChange}),G=e||g||v||r;return n("div",{class:{[o.headerActionsEnd]:!0,[o.headerActions]:!0},hidden:!G,key:"header-actions-end"},q,this.renderMenu(),g,v)}renderMenu(){const{hasMenuItems:e,messages:t,menuOpen:a}=this;return n("calcite-action-menu",{flipPlacements:["top","bottom"],hidden:!e,key:"menu",label:t.options,open:a,placement:"bottom-end"},n("calcite-action",{icon:C.menu,slot:N.trigger,text:t.options}),n("slot",{name:s.headerMenuActions,onSlotchange:this.handleHeaderMenuActionsSlotChange}))}renderHeaderNode(){const{hasHeaderContent:e,hasStartActions:t,hasEndActions:a,closable:i,collapsible:c,hasMenuItems:l,hasActionBar:r}=this,d=this.renderHeaderContent(),f=e||!!d||t||a||c||i||l;return this.showHeaderContent=f,n("header",{class:o.header,hidden:!(f||r)},n("div",{class:{[o.headerContainer]:!0,[o.headerContainerBorderEnd]:r},hidden:!f},this.renderHeaderStartActions(),this.renderHeaderSlottedContent(),d,this.renderHeaderActionsEnd()),this.renderActionBar())}renderFooterNode(){const{hasFooterContent:e,hasFooterActions:t}=this,a=e||t;return n("footer",{class:o.footer,hidden:!a},n("slot",{key:"footer-slot",name:s.footer,onSlotchange:this.handleFooterSlotChange}),n("slot",{key:"footer-actions-slot",name:s.footerActions,onSlotchange:this.handleFooterActionsSlotChange}))}renderContent(){return n("div",{class:o.contentWrapper,hidden:this.collapsible&&this.collapsed,onScroll:this.panelScrollHandler,ref:this.setPanelScrollEl},n("slot",null),this.renderFab())}renderFab(){return n("div",{class:o.fabContainer,hidden:!this.hasFab},n("slot",{name:s.fab,onSlotchange:this.handleFabSlotChange}))}render(){const{loading:e,panelKeyDownHandler:t,closed:a,closable:i}=this,c=n("article",{"aria-busy":k(e),class:o.container,hidden:a,onKeyDown:t,tabIndex:i?0:-1,ref:this.setContainerRef},this.renderHeaderNode(),this.renderContent(),this.renderFooterNode());return n(V,null,e?n("calcite-scrim",{loading:e}):null,c)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return te}},[1,"calcite-panel",{closed:[1540],disabled:[516],closable:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],headingLevel:[514,"heading-level"],loading:[516],heading:[1],description:[1],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],hasStartActions:[32],hasEndActions:[32],hasMenuItems:[32],hasHeaderContent:[32],hasActionBar:[32],hasFooterContent:[32],hasFooterActions:[32],hasFab:[32],defaultMessages:[32],effectiveLocale:[32],showHeaderContent:[32],setFocus:[64],scrollContentTo:[64]}]);function K(){if(typeof customElements>"u")return;["calcite-panel","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover","calcite-scrim"].forEach(t=>{switch(t){case"calcite-panel":customElements.get(t)||customElements.define(t,ne);break;case"calcite-action":customElements.get(t)||$();break;case"calcite-action-menu":customElements.get(t)||T();break;case"calcite-icon":customElements.get(t)||R();break;case"calcite-loader":customElements.get(t)||_();break;case"calcite-popover":customElements.get(t)||D();break;case"calcite-scrim":customElements.get(t)||W();break}})}K();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const ae={backButton:"back-button"},x={backLeft:"chevron-left",backRight:"chevron-right"},h={actionBar:"action-bar",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions"},oe=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",j=S(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=u(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=u(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=u(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=u(this,"calciteFlowItemToggle",6),this.handlePanelScroll=e=>{e.stopPropagation(),this.calciteFlowItemScroll.emit()},this.handlePanelClose=e=>{e.stopPropagation(),this.calciteFlowItemClose.emit()},this.handlePanelToggle=e=>{e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit()},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){E(this),z(this),I(this)}async componentWillLoad(){await M(this),H(this)}componentDidRender(){A(this)}disconnectedCallback(){y(this),L(this),P(this)}componentDidLoad(){F(this)}effectiveLocaleChange(){O(this,this.effectiveLocale)}async setFocus(){await B(this);const{backButtonEl:e,containerEl:t}=this;if(e)return e.setFocus();if(t)return t.setFocus()}async scrollContentTo(e){var t;await((t=this.containerEl)==null?void 0:t.scrollContentTo(e))}renderBackButton(){const{el:e}=this,t=X(e)==="rtl",{showBackButton:a,backButtonClick:i,messages:c}=this,l=c.back,r=t?x.backRight:x.backLeft;return a?n("calcite-action",{"aria-label":l,class:ae.backButton,icon:r,key:"flow-back-button",onClick:i,scale:"s",slot:"header-actions-start",text:l,title:l,ref:this.setBackRef}):null}render(){const{collapsed:e,collapseDirection:t,collapsible:a,closable:i,closed:c,description:l,disabled:r,heading:d,headingLevel:f,loading:m,menuOpen:b,messages:g}=this;return n(Y,null,n("calcite-panel",{closable:i,closed:c,collapseDirection:t,collapsed:e,collapsible:a,description:l,disabled:r,heading:d,headingLevel:f,loading:m,menuOpen:b,messageOverrides:g,onCalcitePanelClose:this.handlePanelClose,onCalcitePanelScroll:this.handlePanelScroll,onCalcitePanelToggle:this.handlePanelToggle,ref:this.setContainerRef},this.renderBackButton(),n("slot",{name:h.actionBar,slot:s.actionBar}),n("slot",{name:h.headerActionsStart,slot:s.headerActionsStart}),n("slot",{name:h.headerActionsEnd,slot:s.headerActionsEnd}),n("slot",{name:h.headerContent,slot:s.headerContent}),n("slot",{name:h.headerMenuActions,slot:s.headerMenuActions}),n("slot",{name:h.fab,slot:s.fab}),n("slot",{name:h.footerActions,slot:s.footerActions}),n("slot",{name:h.footer,slot:s.footer}),n("slot",null)))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return oe}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]}]);function U(){if(typeof customElements>"u")return;["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(t=>{switch(t){case"calcite-flow-item":customElements.get(t)||customElements.define(t,j);break;case"calcite-action":customElements.get(t)||$();break;case"calcite-action-menu":customElements.get(t)||T();break;case"calcite-icon":customElements.get(t)||R();break;case"calcite-loader":customElements.get(t)||_();break;case"calcite-panel":customElements.get(t)||K();break;case"calcite-popover":customElements.get(t)||D();break;case"calcite-scrim":customElements.get(t)||W();break}})}U();const Ee=j,Ae=U;export{Ee as CalciteFlowItem,Ae as defineCustomElement}; diff --git a/dist/assets/calcite-icon-itD416se.js b/dist/assets/calcite-icon-itD416se.js new file mode 100644 index 0000000..43cf19a --- /dev/null +++ b/dist/assets/calcite-icon-itD416se.js @@ -0,0 +1,5 @@ +import{I as o,d as t}from"./icon-ZwpY5ksA.js";import"./index-J0iiHjMT.js";import"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const i=o,s=t;export{i as CalciteIcon,s as defineCustomElement}; diff --git a/dist/assets/calcite-input-V4_hyPVg.js b/dist/assets/calcite-input-V4_hyPVg.js new file mode 100644 index 0000000..6b2a72a --- /dev/null +++ b/dist/assets/calcite-input-V4_hyPVg.js @@ -0,0 +1,5 @@ +import{I as t,d as o}from"./input-9jE7tcJD.js";import"./index-J0iiHjMT.js";import"./form-2Iq0hI3D.js";import"./interactive-NKzPUNL4.js";import"./key-qdHumIlA.js";import"./label2-d2vWQ7x7.js";import"./loadable-sxY2K1G3.js";import"./locale-pfkq1d6A.js";import"./observers-JyBmMU24.js";import"./t9n-od6MEnI1.js";import"./component-dtiBfYiX.js";import"./icon-ZwpY5ksA.js";import"./progress-puB9lhY4.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const C=t,I=o;export{C as CalciteInput,I as defineCustomElement}; diff --git a/dist/assets/calcite-label-lSeWOYbm.js b/dist/assets/calcite-label-lSeWOYbm.js new file mode 100644 index 0000000..8da2a24 --- /dev/null +++ b/dist/assets/calcite-label-lSeWOYbm.js @@ -0,0 +1,9 @@ +import{q as l,H as s,r as o,t,x as c}from"./index-J0iiHjMT.js";import{l as r,a as d}from"./label2-d2vWQ7x7.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-ui-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([hidden]){display:none}[hidden]{display:none}",a=l(class extends s{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=n=>{this.calciteInternalLabelClick.emit({sourceEvent:n})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(c,{onClick:this.labelClickHandler},t("div",{class:h.container},t("slot",null)))}get el(){return this}static get style(){return m}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]}]);function i(){if(typeof customElements>"u")return;["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const p=a,g=i;export{p as CalciteLabel,g as defineCustomElement}; diff --git a/dist/assets/calcite-list-LJfGqLbO.js b/dist/assets/calcite-list-LJfGqLbO.js new file mode 100644 index 0000000..073e00d --- /dev/null +++ b/dist/assets/calcite-list-LJfGqLbO.js @@ -0,0 +1,27 @@ +import{q as pe,H as ge,h7 as pt,t as w,x as _n,r as Ct,ad as An,v as On}from"./index-J0iiHjMT.js";import{c as Ye,u as $e,d as Ge}from"./interactive-NKzPUNL4.js";import{c as Fn}from"./observers-JyBmMU24.js";import{u as Ln,a as Pn,M as kn}from"./utils3-_ao2jQXg.js";import{s as We,a as Ue,c as qe}from"./loadable-sxY2K1G3.js";import{S as Se,i as me,r as Mn,b as be,f as Nn,a as jn,c as Ke,d as Ve}from"./debounce-HnHf1UOZ.js";import{c as Hn,d as Rn}from"./locale-pfkq1d6A.js";import{u as Bn,s as zn,c as Xn,d as Yn}from"./t9n-od6MEnI1.js";import{d as Ze}from"./icon-ZwpY5ksA.js";import{d as Qe}from"./input-9jE7tcJD.js";import{d as Je}from"./progress-puB9lhY4.js";import{d as $n}from"./loader-QqciGs1c.js";import{d as Gn}from"./scrim-OeyGkB0-.js";import"./key-qdHumIlA.js";import"./form-2Iq0hI3D.js";import"./label2-d2vWQ7x7.js";import"./component-dtiBfYiX.js";import"./guid-6vN-YNJI.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + *//**! + * Sortable 1.15.0 + * @author RubaXa + * @author owenm + * @license MIT + */function Ie(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function W(t){for(var e=1;e=0)&&(n[r]=t[r]);return n}function qn(t,e){if(t==null)return{};var n=Un(t,e),i,r;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}var Kn="1.15.0";function K(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Z=K(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),kt=K(/Edge/i),Ce=K(/firefox/i),_t=K(/safari/i)&&!K(/chrome/i)&&!K(/android/i),tn=K(/iP(ad|od|hone)/i),en=K(/chrome/i)&&K(/android/i),nn={capture:!1,passive:!1};function E(t,e,n){t.addEventListener(e,n,!Z&&nn)}function v(t,e,n){t.removeEventListener(e,n,!Z&&nn)}function Wt(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function Vn(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function $(t,e,n,i){if(t){n=n||document;do{if(e!=null&&(e[0]===">"?t.parentNode===n&&Wt(t,e):Wt(t,e))||i&&t===n)return t;if(t===n)break}while(t=Vn(t))}return null}var De=/\s+/g;function N(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var i=(" "+t.className+" ").replace(De," ").replace(" "+e+" "," ");t.className=(i+(n?" "+e:"")).replace(De," ")}}function h(t,e,n){var i=t&&t.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),e===void 0?n:n[e];!(e in i)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),i[e]=n+(typeof n=="string"?"":"px")}}function bt(t,e){var n="";if(typeof t=="string")n=t;else do{var i=h(t,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!e&&(t=t.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function rn(t,e,n){if(t){var i=t.getElementsByTagName(e),r=0,a=i.length;if(n)for(;r=a:o=r<=a,!o)return i;if(i===G())break;i=nt(i,!1)}return!1}function vt(t,e,n,i){for(var r=0,a=0,o=t.children;a2&&arguments[2]!==void 0?arguments[2]:{},r=i.evt,a=qn(i,ri);Mt.pluginEvent.bind(p)(e,n,W({dragEl:d,parentEl:T,ghostEl:g,rootEl:C,nextEl:ct,lastDownEl:Xt,cloneEl:D,cloneHidden:et,dragStarted:Dt,putSortable:A,activeSortable:p.active,originalEvent:r,oldIndex:gt,oldDraggableIndex:Ot,newIndex:j,newDraggableIndex:tt,hideGhostForTarget:un,unhideGhostForTarget:fn,cloneNowHidden:function(){et=!0},cloneNowShown:function(){et=!1},dispatchSortableEvent:function(s){L({sortable:n,name:s,originalEvent:r})}},a))};function L(t){ii(W({putSortable:A,cloneEl:D,targetEl:d,rootEl:C,oldIndex:gt,oldDraggableIndex:Ot,newIndex:j,newDraggableIndex:tt},t))}var d,T,g,C,ct,Xt,D,et,gt,j,Ot,tt,jt,A,ht=!1,Ut=!1,qt=[],ot,X,ee,ne,_e,Ae,Dt,ut,Ft,Lt=!1,Ht=!1,Yt,O,ie=[],ce=!1,Kt=[],Zt=typeof document<"u",Rt=tn,Oe=kt||Z?"cssFloat":"float",ai=Zt&&!en&&!tn&&"draggable"in document.createElement("div"),ln=function(){if(Zt){if(Z)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),cn=function(e,n){var i=h(e),r=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),a=vt(e,0,n),o=vt(e,1,n),s=a&&h(a),l=o&&h(o),c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+_(a).width,f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+_(o).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&s.float&&s.float!=="none"){var u=s.float==="left"?"left":"right";return o&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return a&&(s.display==="block"||s.display==="flex"||s.display==="table"||s.display==="grid"||c>=r&&i[Oe]==="none"||o&&i[Oe]==="none"&&c+f>r)?"vertical":"horizontal"},oi=function(e,n,i){var r=i?e.left:e.top,a=i?e.right:e.bottom,o=i?e.width:e.height,s=i?n.left:n.top,l=i?n.right:n.bottom,c=i?n.width:n.height;return r===s||a===l||r+o/2===s+c/2},si=function(e,n){var i;return qt.some(function(r){var a=r[H].options.emptyInsertThreshold;if(!(!a||ve(r))){var o=_(r),s=e>=o.left-a&&e<=o.right+a,l=n>=o.top-a&&n<=o.bottom+a;if(s&&l)return i=r}}),i},dn=function(e){function n(a,o){return function(s,l,c,f){var u=s.options.group.name&&l.options.group.name&&s.options.group.name===l.options.group.name;if(a==null&&(o||u))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return n(a(s,l,c,f),o)(s,l,c,f);var m=(o?s:l).options.group.name;return a===!0||typeof a=="string"&&a===m||a.join&&a.indexOf(m)>-1}}var i={},r=e.group;(!r||zt(r)!="object")&&(r={name:r}),i.name=r.name,i.checkPull=n(r.pull,!0),i.checkPut=n(r.put),i.revertClone=r.revertClone,e.group=i},un=function(){!ln&&g&&h(g,"display","none")},fn=function(){!ln&&g&&h(g,"display","")};Zt&&!en&&document.addEventListener("click",function(t){if(Ut)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),Ut=!1,!1},!0);var st=function(e){if(d){e=e.touches?e.touches[0]:e;var n=si(e.clientX,e.clientY);if(n){var i={};for(var r in e)e.hasOwnProperty(r)&&(i[r]=e[r]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[H]._onDragOver(i)}}},li=function(e){d&&d.parentNode[H]._isOutsideThisEl(e.target)};function p(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=V({},e),t[H]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return cn(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,s){o.setData("Text",s.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!_t,emptyInsertThreshold:5};Mt.initializePlugins(this,t,n);for(var i in n)!(i in e)&&(e[i]=n[i]);dn(e);for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this));this.nativeDraggable=e.forceFallback?!1:ai,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?E(t,"pointerdown",this._onTapStart):(E(t,"mousedown",this._onTapStart),E(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(t,"dragover",this),E(t,"dragenter",this)),qt.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),V(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ut=null)},_getDirection:function(e,n){return typeof this.options.direction=="function"?this.options.direction.call(this,e,n,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,i=this.el,r=this.options,a=r.preventOnFilter,o=e.type,s=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,l=(s||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,f=r.filter;if(mi(i),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&_t&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=$(l,r.draggable,i,!1),!(l&&l.animated)&&Xt!==l)){if(gt=R(l),Ot=R(l,r.draggable),typeof f=="function"){if(f.call(this,e,l,this)){L({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:i,fromEl:i}),P("filter",n,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(f&&(f=f.split(",").some(function(u){if(u=$(c,u.trim(),i,!1),u)return L({sortable:n,rootEl:u,name:"filter",targetEl:l,fromEl:i,toEl:i}),P("filter",n,{evt:e}),!0}),f)){a&&e.cancelable&&e.preventDefault();return}r.handle&&!$(c,r.handle,i,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,n,i){var r=this,a=r.el,o=r.options,s=a.ownerDocument,l;if(i&&!d&&i.parentNode===a){var c=_(i);if(C=a,d=i,T=d.parentNode,ct=d.nextSibling,Xt=i,jt=o.group,p.dragged=d,ot={target:d,clientX:(n||e).clientX,clientY:(n||e).clientY},_e=ot.clientX-c.left,Ae=ot.clientY-c.top,this._lastX=(n||e).clientX,this._lastY=(n||e).clientY,d.style["will-change"]="all",l=function(){if(P("delayEnded",r,{evt:e}),p.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Ce&&r.nativeDraggable&&(d.draggable=!0),r._triggerDragStart(e,n),L({sortable:r,name:"choose",originalEvent:e}),N(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(f){rn(d,f.trim(),re)}),E(s,"dragover",st),E(s,"mousemove",st),E(s,"touchmove",st),E(s,"mouseup",r._onDrop),E(s,"touchend",r._onDrop),E(s,"touchcancel",r._onDrop),Ce&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),P("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(kt||Z))){if(p.eventCanceled){this._onDrop();return}E(s,"mouseup",r._disableDelayedDrag),E(s,"touchend",r._disableDelayedDrag),E(s,"touchcancel",r._disableDelayedDrag),E(s,"mousemove",r._delayedDragTouchMoveHandler),E(s,"touchmove",r._delayedDragTouchMoveHandler),o.supportPointer&&E(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(l,o.delay)}else l()}},_delayedDragTouchMoveHandler:function(e){var n=e.touches?e.touches[0]:e;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&re(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;v(e,"mouseup",this._disableDelayedDrag),v(e,"touchend",this._disableDelayedDrag),v(e,"touchcancel",this._disableDelayedDrag),v(e,"mousemove",this._delayedDragTouchMoveHandler),v(e,"touchmove",this._delayedDragTouchMoveHandler),v(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,n){n=n||e.pointerType=="touch"&&e,!this.nativeDraggable||n?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):n?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?$t(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,n){if(ht=!1,C&&d){P("dragStarted",this,{evt:n}),this.nativeDraggable&&E(document,"dragover",li);var i=this.options;!e&&N(d,i.dragClass,!1),N(d,i.ghostClass,!0),p.active=this,e&&this._appendGhost(),L({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,un();for(var e=document.elementFromPoint(X.clientX,X.clientY),n=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==n);)n=e;if(d.parentNode[H]._isOutsideThisEl(e),n)do{if(n[H]){var i=void 0;if(i=n[H]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:n}),i&&!this.options.dragoverBubble)break}e=n}while(n=n.parentNode);fn()}},_onTouchMove:function(e){if(ot){var n=this.options,i=n.fallbackTolerance,r=n.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&bt(g,!0),s=g&&o&&o.a,l=g&&o&&o.d,c=Rt&&O&&xe(O),f=(a.clientX-ot.clientX+r.x)/(s||1)+(c?c[0]-ie[0]:0)/(s||1),u=(a.clientY-ot.clientY+r.y)/(l||1)+(c?c[1]-ie[1]:0)/(l||1);if(!p.active&&!ht){if(i&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(L({rootEl:T,name:"add",toEl:T,fromEl:C,originalEvent:e}),L({sortable:this,name:"remove",toEl:T,originalEvent:e}),L({rootEl:T,name:"sort",toEl:T,fromEl:C,originalEvent:e}),L({sortable:this,name:"sort",toEl:T,originalEvent:e})),A&&A.save()):j!==gt&&j>=0&&(L({sortable:this,name:"update",toEl:T,originalEvent:e}),L({sortable:this,name:"sort",toEl:T,originalEvent:e})),p.active&&((j==null||j===-1)&&(j=gt,tt=Ot),L({sortable:this,name:"end",toEl:T,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){P("nulling",this),C=d=T=g=ct=D=Xt=et=ot=X=Dt=j=tt=gt=Ot=ut=Ft=A=jt=p.dragged=p.ghost=p.clone=p.active=null,Kt.forEach(function(e){e.checked=!0}),Kt.length=ee=ne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),ci(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],n,i=this.el.children,r=0,a=i.length,o=this.options;ri.right+r||t.clientX<=i.right&&t.clientY>i.bottom&&t.clientX>=i.left:t.clientX>i.right&&t.clientY>i.top||t.clientX<=i.right&&t.clientY>i.bottom+r}function hi(t,e,n,i,r,a,o,s){var l=i?t.clientY:t.clientX,c=i?n.height:n.width,f=i?n.top:n.left,u=i?n.bottom:n.right,m=!1;if(!o){if(s&&Ytf+c*a/2:lu-Yt)return-Ft}else if(l>f+c*(1-r)/2&&lu-c*a/2)?l>f+c/2?1:-1:0}function pi(t){return R(d)t.canPull({toEl:a.el,fromEl:o.el,dragEl:s,newIndex:l,oldIndex:c})},...!!t.canPut&&{put:(a,o,s,{newIndex:l,oldIndex:c})=>t.canPut({toEl:a.el,fromEl:o.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,onStart:()=>{he.active=!0,yi()},onEnd:()=>{he.active=!1,wi()},onSort:({from:a,item:o,to:s,newIndex:l,oldIndex:c})=>{t.onDragSort({fromEl:a,dragEl:o,toEl:s,newIndex:l,oldIndex:c})}})}function pn(t){var e;Qt.delete(t),(e=t.sortable)==null||e.destroy(),t.sortable=null}const he={active:!1};function Le(t){return t.dragEnabled&&he.active}function yi(){Array.from(Qt).forEach(t=>t.onDragStart())}function wi(){Array.from(Qt).forEach(t=>t.onDragEnd())}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const ft={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},mt={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Si=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ii=pe(class extends ge{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=t=>{this.hasActionsStart=pt(t)},this.handleActionsEndSlotChange=t=>{this.hasActionsEnd=pt(t)},this.handleContentStartSlotChange=t=>{this.hasContentStart=pt(t)},this.handleContentEndSlotChange=t=>{this.hasContentEnd=pt(t)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:t}=this;return w("div",{class:ft.actionsStart,hidden:!t,key:"actions-start-container"},w("slot",{name:mt.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:t}=this;return w("div",{class:ft.actionsEnd,hidden:!t,key:"actions-end-container"},w("slot",{name:mt.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:t}=this;return w("div",{class:ft.contentStart,hidden:!t},w("slot",{name:mt.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return w("div",{class:ft.content},w("slot",null))}renderContentEnd(){const{hasContentEnd:t}=this;return w("div",{class:ft.contentEnd,hidden:!t},w("slot",{name:mt.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return w(_n,null,w("div",{class:ft.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Si}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function gn(){if(typeof customElements>"u")return;["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,Ii);break}})}gn();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function Ci(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n-1&&t%1==0&&t-1&&t%1==0&&t<=Mi}function Ni(t){return t!=null&&vn(t.length)&&!Fi(t)}var ji=Object.prototype;function Hi(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||ji;return t===n}function Ri(t,e){for(var n=-1,i=Array(t);++n{const n=Mr(e),i=new RegExp(n,"i");t.length===0&&console.warn(`No data was passed to the filter function. + The data argument should be an array of objects`);const r=(o,s)=>{if(o!=null&&o.constant||o!=null&&o.filterDisabled)return!0;let l=!1;return Nr(o,c=>{typeof c=="function"||c==null||(Array.isArray(c)||typeof c=="object"&&c!==null?r(c,s)&&(l=!0):s.test(c)&&(l=!0))}),l};return t.filter(o=>r(o,i))};/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const jr={container:"container",searchIcon:"search-icon"},Hr={search:"search",close:"x"},Rr=250,Br=":host{box-sizing:border-box;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-ui-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-ui-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-ui-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-ui-text-1)}:host([hidden]){display:none}[hidden]{display:none}",zr=pe(class extends ge{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=Ct(this,"calciteFilterChange",6),this.filterDebounced=Ve((t,e=!1,n)=>this.updateFiltered(Be(this.items,t),e,n),Rr),this.inputHandler=t=>{const e=t.target;this.value=e.value,this.filterDebounced(e.value,!0)},this.keyDownHandler=t=>{t.key==="Escape"&&(this.clear(),t.preventDefault()),t.key==="Enter"&&t.preventDefault()},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(t){this.filterDebounced(t)}effectiveLocaleChange(){Bn(this,this.effectiveLocale)}async componentWillLoad(){We(this),this.updateFiltered(Be(this.items,this.value)),await zn(this)}connectedCallback(){Ye(this),Hn(this),Xn(this)}componentDidRender(){$e(this)}disconnectedCallback(){Ge(this),Rn(this),Yn(this),this.filterDebounced.cancel()}componentDidLoad(){Ue(this)}async filter(t=this.value){return new Promise(e=>{this.value=t,this.filterDebounced(t,!1,e)})}async setFocus(){var t;await qe(this),(t=this.el)==null||t.focus()}updateFiltered(t,e=!1,n){this.filteredItems=t,e&&this.calciteFilterChange.emit(),n==null||n()}render(){const{disabled:t,scale:e}=this;return w(An,null,w("div",{class:jr.container},w("label",null,w("calcite-input",{clearable:!0,disabled:t,icon:Hr.search,label:this.messages.label,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,scale:e,type:"text",value:this.value,ref:n=>{this.textInput=n}}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Br}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]}]);function In(){if(typeof customElements>"u")return;["calcite-filter","calcite-icon","calcite-input","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,zr);break;case"calcite-icon":customElements.get(e)||Ze();break;case"calcite-input":customElements.get(e)||Qe();break;case"calcite-progress":customElements.get(e)||Je();break}})}In();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const lt={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},Xr=0,ze={filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Yr=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}::slotted(calcite-list-item){--tw-shadow:0 -1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 -1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);margin-block-start:1px}::slotted(calcite-list-item:first-of-type){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}::slotted(calcite-list-item[data-filter]){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);margin-block-start:0px}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-app-z-index-sticky);background-color:var(--calcite-ui-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",Xe="calcite-list-item",$r=":scope > calcite-list-item",Gr="calcite-list-item-group, calcite-list-item",Cn=pe(class extends ge{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=Ct(this,"calciteListChange",6),this.calciteListFilter=Ct(this,"calciteListFilter",6),this.calciteListOrderChange=Ct(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=Ct(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector="calcite-list-item",this.enabledListItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=Fn("mutation",()=>this.updateListItems()),this.handleDefaultSlotChange=t=>{Ln(Pn(t.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=t=>{this.hasFilterActionsStart=pt(t)},this.handleFilterActionsEndSlotChange=t=>{this.hasFilterActionsEnd=pt(t)},this.setActiveListItem=()=>{const{enabledListItems:t}=this;t.some(e=>e.active)||t[0]&&(t[0].active=!0)},this.updateSelectedItems=(t=!1)=>{this.selectedItems=this.enabledListItems.filter(e=>e.selected),t&&this.calciteListChange.emit()},this.updateFilteredItems=(t=!1)=>{const{listItems:e,filteredData:n,filterText:i}=this,r=n.map(l=>l.value),a=e==null?void 0:e.filter(l=>e.every(c=>c===l||!l.contains(c))),o=e.filter(l=>!i||r.includes(l.value))||[],s=new WeakSet;a.forEach(l=>this.filterElements({el:l,filteredItems:o,visibleParents:s})),o.length>0&&this.findAncestorOfFirstFilteredItem(o),this.filteredItems=o,t&&this.calciteListFilter.emit()},this.setFilterEl=t=>{this.filterEl=t,this.performFilter()},this.handleFilterChange=t=>{t.stopPropagation();const{value:e}=t.currentTarget;this.filterText=e,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(t=>({label:t.label,description:t.description,metadata:t.metadata,value:t.value})),this.updateListItems=Ve((t=!1)=>{const{selectionAppearance:e,selectionMode:n,dragEnabled:i}=this;if(this.parentListEl){this.queryListItems(!0).forEach(s=>{s.dragHandle=i}),this.setUpSorting();return}const r=this.queryListItems();r.forEach(o=>{o.selectionAppearance=e,o.selectionMode=n}),this.queryListItems(!0).forEach(o=>{o.dragHandle=i}),this.listItems=r,this.filterEnabled&&(this.dataForFilter=this.getItemData(),this.filterEl&&(this.filterEl.items=this.dataForFilter)),this.updateFilteredItems(t),this.enabledListItems=this.filteredItems.filter(o=>!o.disabled&&!o.closed),this.setActiveListItem(),this.updateSelectedItems(t),this.setUpSorting()},Xr),this.queryListItems=(t=!1)=>Array.from(this.el.querySelectorAll(t?$r:Xe)),this.focusRow=t=>{const{enabledListItems:e}=this;t&&(e.forEach(n=>n.active=n===t),t.setFocus())},this.isNavigable=t=>{var n;const e=(n=t.parentElement)==null?void 0:n.closest(Xe);return e?e.open&&this.isNavigable(e):!0},this.handleListKeydown=t=>{var r;if(t.defaultPrevented||this.parentListEl)return;const{key:e}=t,n=this.enabledListItems.filter(a=>this.isNavigable(a)),i=n.findIndex(a=>a.active);if(e==="ArrowDown"){t.preventDefault();const a=t.target===this.filterEl?0:i+1;n[a]&&this.focusRow(n[a])}else if(e==="ArrowUp"){if(t.preventDefault(),i===0&&this.filterEnabled){(r=this.filterEl)==null||r.setFocus();return}const a=i-1;n[a]&&this.focusRow(n[a])}else if(e==="Home"){t.preventDefault();const a=n[0];a&&this.focusRow(a)}else if(e==="End"){t.preventDefault();const a=n[n.length-1];a&&this.focusRow(a)}},this.findAncestorOfFirstFilteredItem=t=>{var e,n;(e=this.ancestorOfFirstFilteredItem)==null||e.removeAttribute("data-filter"),t.forEach(i=>{i.removeAttribute("data-filter")}),this.ancestorOfFirstFilteredItem=this.getTopLevelAncestorItemElement(t[0]),t[0].setAttribute("data-filter","0"),(n=this.ancestorOfFirstFilteredItem)==null||n.setAttribute("data-filter","0")},this.getTopLevelAncestorItemElement=t=>{let e=t.parentElement.closest("calcite-list-item");for(;e;){const n=e.parentElement.closest("calcite-list-item");if(n)e=n;else return e}return null},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1}async handleFilterTextChange(){this.performFilter()}handleListItemChange(){this.updateListItems()}handleCalciteInternalFocusPreviousItem(t){if(this.parentListEl)return;t.stopPropagation();const{enabledListItems:e}=this,i=e.findIndex(r=>r.active)-1;e[i]&&this.focusRow(e[i])}handleCalciteInternalListItemActive(t){if(this.parentListEl)return;t.stopPropagation();const e=t.target,{listItems:n}=this;n.forEach(i=>{i.active=i===e})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalHandleChange(t){this.assistiveText=t.detail.message,t.stopPropagation()}handleCalciteHandleNudge(t){this.parentListEl||this.handleNudgeEvent(t)}handleCalciteInternalListItemSelect(t){if(this.parentListEl)return;t.stopPropagation();const e=t.target,{listItems:n,selectionMode:i}=this;e.selected&&(i==="single"||i==="single-persist")&&n.forEach(r=>r.selected=r===e),this.updateSelectedItems()}handleCalciteInternalListItemChange(t){this.parentListEl||(t.stopPropagation(),this.updateListItems())}handleCalciteInternalListItemGroupDefaultSlotChange(t){t.stopPropagation()}connectedCallback(){Le(this)||(this.connectObserver(),this.updateListItems(),this.setUpSorting(),Ye(this),this.setParentList())}disconnectedCallback(){Le(this)||(this.disconnectObserver(),pn(this),Ge(this))}componentWillLoad(){We(this)}componentDidRender(){$e(this)}componentDidLoad(){Ue(this)}async setFocus(){var t,e;return await qe(this),this.filterEnabled?(t=this.filterEl)==null?void 0:t.setFocus():(e=this.enabledListItems.find(n=>n.active))==null?void 0:e.setFocus()}render(){const{loading:t,label:e,disabled:n,dataForFilter:i,filterEnabled:r,filterPlaceholder:a,filterText:o,hasFilterActionsStart:s,hasFilterActionsEnd:l}=this;return w("div",{class:lt.container},this.dragEnabled?w("span",{"aria-live":"assertive",class:lt.assistiveText},this.assistiveText):null,t?w("calcite-scrim",{class:lt.scrim,loading:t}):null,w("table",{"aria-busy":On(t),"aria-label":e||"",class:lt.table,onKeyDown:this.handleListKeydown,role:"treegrid"},r||s||l?w("thead",null,w("tr",{class:{[lt.sticky]:!0}},w("th",{colSpan:kn},w("calcite-stack",{class:lt.stack},w("slot",{name:ze.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:mt.actionsStart}),w("calcite-filter",{"aria-label":a,disabled:t||n,items:i,onCalciteFilterChange:this.handleFilterChange,placeholder:a,value:o,ref:this.setFilterEl}),w("slot",{name:ze.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:mt.actionsEnd}))))):null,w("tbody",{class:lt.tableContainer},w("slot",{onSlotchange:this.handleDefaultSlotChange}))))}connectObserver(){var t;(t=this.mutationObserver)==null||t.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){var t;(t=this.mutationObserver)==null||t.disconnect()}setUpSorting(){const{dragEnabled:t}=this;t&&Ei(this)}onDragStart(){this.disconnectObserver()}onDragEnd(){this.connectObserver()}onDragSort(t){this.setParentList(),this.updateListItems(),this.calciteListOrderChange.emit(t)}setParentList(){var t;this.parentListEl=(t=this.el.parentElement)==null?void 0:t.closest("calcite-list")}filterElements({el:t,filteredItems:e,visibleParents:n}){const i=!n.has(t)&&!e.includes(t);t.hidden=i;const r=t.parentElement.closest(Gr);r&&(i||n.add(r),this.filterElements({el:r,filteredItems:e,visibleParents:n}))}updateFilteredData(t=!1){const{filterEl:e}=this;e&&(e.filteredItems&&(this.filteredData=e.filteredItems),this.updateListItems(t))}async performFilter(){const{filterEl:t,filterText:e}=this;t&&(t.value=e,await t.filter(e),this.updateFilteredData())}handleNudgeEvent(t){const{direction:e}=t.detail,n=t.composedPath(),i=n.find(m=>m.tagName==="CALCITE-HANDLE"),r=n.find(m=>m.tagName==="CALCITE-LIST-ITEM"),a=r==null?void 0:r.parentElement;if(!a)return;const{enabledListItems:o}=this,s=o.filter(m=>m.parentElement===a),l=s.length-1,c=s.indexOf(r);let f=!1,u;e==="up"?c===0?(f=!0,u=l):u=c-1:c===l?u=0:c===l-1?(f=!0,u=l):u=c+2,this.disconnectObserver(),f?a.appendChild(r):a.insertBefore(r,s[u]),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:r,fromEl:a,toEl:a,newIndex:u,oldIndex:c}),i.setFocus().then(()=>{i.activated=!0})}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"]}}static get style(){return Yr}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],setFocus:[64]},[[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalHandleChange","handleCalciteInternalHandleChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]]]);function Dn(){if(typeof customElements>"u")return;["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,Cn);break;case"calcite-filter":customElements.get(e)||In();break;case"calcite-icon":customElements.get(e)||Ze();break;case"calcite-input":customElements.get(e)||Qe();break;case"calcite-loader":customElements.get(e)||$n();break;case"calcite-progress":customElements.get(e)||Je();break;case"calcite-scrim":customElements.get(e)||Gn();break;case"calcite-stack":customElements.get(e)||gn();break}})}Dn();const ua=Cn,fa=Dn;export{ua as CalciteList,fa as defineCustomElement}; diff --git a/dist/assets/calcite-list-item-OtIyVNHT.js b/dist/assets/calcite-list-item-OtIyVNHT.js new file mode 100644 index 0000000..7dc9033 --- /dev/null +++ b/dist/assets/calcite-list-item-OtIyVNHT.js @@ -0,0 +1,29 @@ +import{q as I,H as L,r as p,t as i,v,h7 as g,ch as U,x as j}from"./index-J0iiHjMT.js";import{c as R,u as W,d as q}from"./interactive-NKzPUNL4.js";import{g as x,I as m,C as a,S as C,a as G,u as J}from"./utils3-_ao2jQXg.js";import{c as E,d as k}from"./locale-pfkq1d6A.js";import{c as A,s as w,d as D,u as H}from"./t9n-od6MEnI1.js";import{s as M,a as B,c as P}from"./loadable-sxY2K1G3.js";import{d as Q}from"./action-W5zDPNjG.js";import{d as z}from"./icon-ZwpY5ksA.js";import{d as V}from"./loader-QqciGs1c.js";import"./key-qdHumIlA.js";import"./observers-JyBmMU24.js";import"./guid-6vN-YNJI.js";import"./component-dtiBfYiX.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const y={handle:"handle",handleActivated:"handle--activated"},X={drag:"drag"},Y=`:host{display:flex}.handle{display:flex;cursor:move;align-items:center;justify-content:center;align-self:stretch;border-style:none;background-color:transparent;outline-color:transparent;color:var(--calcite-ui-border-input);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle:hover{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.handle:focus{color:var(--calcite-ui-text-1);outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.handle--activated{background-color:var(--calcite-ui-foreground-3);color:var(--calcite-ui-text-1)}.handle calcite-icon{color:inherit}:host([hidden]){display:none}[hidden]{display:none}`,Z=I(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteHandleNudge=p(this,"calciteHandleNudge",6),this.calciteInternalHandleChange=p(this,"calciteInternalHandleChange",6),this.handleKeyDown=e=>{switch(e.key){case" ":this.activated=!this.activated,e.preventDefault();break;case"ArrowUp":if(!this.activated)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"up"});break;case"ArrowDown":if(!this.activated)return;e.preventDefault(),this.calciteHandleNudge.emit({direction:"down"});break}},this.handleBlur=()=>{this.activated=!1},this.activated=!1,this.dragHandle=void 0,this.messages=void 0,this.setPosition=void 0,this.setSize=void 0,this.label=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}handleAriaTextChange(){const e=this.getAriaText("live");e&&this.calciteInternalHandleChange.emit({message:e})}onMessagesChange(){}connectedCallback(){A(this),E(this)}async componentWillLoad(){M(this),await w(this)}componentDidLoad(){B(this)}disconnectedCallback(){D(this),k(this)}effectiveLocaleChange(){H(this,this.effectiveLocale)}async setFocus(){var e;await P(this),(e=this.handleButton)==null||e.focus()}getAriaText(e){const{setPosition:t,setSize:n,label:s,messages:l,activated:o}=this;return!l||!s||typeof n!="number"||typeof t!="number"?null:(e==="label"?o?l.dragHandleChange:l.dragHandleIdle:o?l.dragHandleActive:l.dragHandleCommit).replace("{position}",t.toString()).replace("{itemLabel}",s).replace("{total}",n.toString())}render(){var e;return i("span",{"aria-label":this.getAriaText("label"),"aria-pressed":v(this.activated),class:{[y.handle]:!0,[y.handleActivated]:this.activated},onBlur:this.handleBlur,onKeyDown:this.handleKeyDown,role:"button",tabindex:"0",title:(e=this.messages)==null?void 0:e.dragHandle,ref:t=>{this.handleButton=t}},i("calcite-icon",{icon:X.drag,scale:"s"}))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messages:["handleAriaTextChange"],label:["handleAriaTextChange"],activated:["handleAriaTextChange"],setPosition:["handleAriaTextChange"],setSize:["handleAriaTextChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Y}},[1,"calcite-handle",{activated:[1540],dragHandle:[513,"drag-handle"],messages:[16],setPosition:[2,"set-position"],setSize:[2,"set-size"],label:[1],messageOverrides:[16],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function O(){if(typeof customElements>"u")return;["calcite-handle","calcite-icon"].forEach(t=>{switch(t){case"calcite-handle":customElements.get(t)||customElements.define(t,Z);break;case"calcite-icon":customElements.get(t)||z();break}})}O();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const N=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;--calcite-list-item-icon-color:var(--calcite-ui-brand);--calcite-list-item-spacing-indent:1rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{box-sizing:border-box;display:flex;flex:1 1 0%;background-color:var(--calcite-ui-foreground-1);font-family:var(--calcite-sans-family);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.container *{box-sizing:border-box}.container:hover{cursor:pointer;background-color:var(--calcite-ui-foreground-2)}.container:active{background-color:var(--calcite-ui-foreground-1)}.container--border-selected{border-inline-start:4px solid var(--calcite-ui-brand)}.container--border-unselected{border-inline-start:4px solid transparent}.nested-container{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1)}.nested-container--hidden{display:none}.content-container{display:flex;flex:1 1 auto;align-items:stretch;padding:0px;font-family:var(--calcite-sans-family);font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}tr,td{outline-color:transparent}tr:focus,td:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.content,.custom-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--2);line-height:1.375}.label,.description,.content-bottom{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);word-wrap:break-word;word-break:break-word}.label:only-child,.description:only-child,.content-bottom:only-child{margin:0px;padding-block:0.25rem}.label{color:var(--calcite-ui-text-1)}.description{margin-block-start:0.125rem;color:var(--calcite-ui-text-3)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:1 1 auto}.content-bottom{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}.content-container--has-center-content .content-start,.content-container--has-center-content .content-end{flex:0 1 auto}.selection-container{display:flex;padding-inline:0.75rem;color:var(--calcite-list-item-icon-color)}.actions-start,.actions-end,.content-start,.content-end,.selection-container,.drag-container,.open-container{display:flex;align-items:center}.open-container,.selection-container{cursor:pointer}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}::slotted(calcite-list-item){border-width:0px;border-block-start-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}`,b=new Map,ee="calcite-list",T=I(class extends L{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListItemSelect=p(this,"calciteListItemSelect",6),this.calciteListItemClose=p(this,"calciteListItemClose",6),this.calciteInternalListItemSelect=p(this,"calciteInternalListItemSelect",6),this.calciteInternalListItemActive=p(this,"calciteInternalListItemActive",6),this.calciteInternalFocusPreviousItem=p(this,"calciteInternalFocusPreviousItem",6),this.calciteInternalListItemChange=p(this,"calciteInternalListItemChange",6),this.closeClickHandler=()=>{this.closed=!0,this.calciteListItemClose.emit()},this.handleContentSlotChange=e=>{this.hasCustomContent=g(e)},this.handleActionsStartSlotChange=e=>{this.hasActionsStart=g(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=g(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=g(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=g(e)},this.handleContentBottomSlotChange=e=>{this.hasContentBottom=g(e)},this.handleDefaultSlotChange=e=>{this.handleOpenableChange(e.target)},this.toggleOpen=()=>{this.open=!this.open},this.itemClicked=e=>{e.defaultPrevented||(this.toggleSelected(),this.calciteInternalListItemActive.emit())},this.toggleSelected=()=>{const{selectionMode:e,selected:t}=this;this.disabled||(e==="multiple"||e==="single"?this.selected=!t:e==="single-persist"&&(this.selected=!0),this.calciteListItemSelect.emit())},this.handleItemKeyDown=e=>{if(e.defaultPrevented)return;const{key:t}=e,n=e.composedPath(),{containerEl:s,contentEl:l,actionsStartEl:o,actionsEndEl:c,open:d,openable:f}=this,r=[o,l,c].filter(Boolean),h=r.findIndex(u=>n.includes(u));if(t==="Enter"&&!n.includes(o)&&!n.includes(c))e.preventDefault(),this.toggleSelected();else if(t==="ArrowRight"){e.preventDefault();const u=h+1;h===-1?!d&&f?(this.open=!0,this.focusCell(null)):r[0]&&this.focusCell(r[0]):r[h]&&r[u]&&this.focusCell(r[u])}else if(t==="ArrowLeft"){e.preventDefault();const u=h-1;h===-1?(this.focusCell(null),d&&f?this.open=!1:this.calciteInternalFocusPreviousItem.emit()):h===0?(this.focusCell(null),s.focus()):r[h]&&r[u]&&this.focusCell(r[u])}},this.focusCellNull=()=>{this.focusCell(null)},this.focusCell=(e,t=!0)=>{const{contentEl:n,actionsStartEl:s,actionsEndEl:l,parentListEl:o}=this;t&&b.set(o,null),[s,n,l].filter(Boolean).forEach((c,d)=>{const f="tabindex";c===e?(c.setAttribute(f,"0"),t&&b.set(o,d)):c.removeAttribute(f)}),e==null||e.focus()},this.active=!1,this.closable=!1,this.closed=!1,this.description=void 0,this.disabled=!1,this.dragHandle=!1,this.label=void 0,this.metadata=void 0,this.open=!1,this.setSize=null,this.setPosition=null,this.selected=!1,this.value=void 0,this.selectionMode=null,this.selectionAppearance=null,this.messageOverrides=void 0,this.messages=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.level=null,this.visualLevel=null,this.parentListEl=void 0,this.openable=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasCustomContent=!1,this.hasContentStart=!1,this.hasContentEnd=!1,this.hasContentBottom=!1}activeHandler(e){e||this.focusCell(null,!1)}handleClosedChange(){this.emitCalciteInternalListItemChange()}handleDisabledChange(){this.emitCalciteInternalListItemChange()}handleSelectedChange(){this.calciteInternalListItemSelect.emit()}onMessagesChange(){}handleCalciteInternalListDefaultSlotChanges(e){e.stopPropagation(),this.handleOpenableChange(this.defaultSlotEl)}effectiveLocaleChange(){H(this,this.effectiveLocale)}connectedCallback(){R(this),E(this),A(this);const{el:e}=this;this.parentListEl=e.closest(ee),this.level=x(e)+1,this.visualLevel=x(e,!0),this.setSelectionDefaults()}async componentWillLoad(){M(this),await w(this)}componentDidLoad(){B(this)}componentDidRender(){W(this)}disconnectedCallback(){q(this),k(this),D(this)}async setFocus(){await P(this);const{containerEl:e,contentEl:t,actionsStartEl:n,actionsEndEl:s,parentListEl:l}=this,o=b.get(l);if(typeof o=="number"){const c=[n,t,s].filter(Boolean);c[o]?this.focusCell(c[o]):e==null||e.focus();return}e==null||e.focus()}renderSelected(){const{selected:e,selectionMode:t,selectionAppearance:n}=this;return t==="none"||n==="border"?null:i("td",{class:a.selectionContainer,key:"selection-container",onClick:this.itemClicked},i("calcite-icon",{icon:e?t==="multiple"?m.selectedMultiple:m.selectedSingle:m.unselected,scale:"s"}))}renderDragHandle(){return this.dragHandle?i("td",{class:a.dragContainer,key:"drag-handle-container"},i("calcite-handle",{label:this.label,setPosition:this.setPosition,setSize:this.setSize})):null}renderOpen(){const{el:e,open:t,openable:n,parentListEl:s}=this,l=U(e),o=n?t?m.open:l==="rtl"?m.closedRTL:m.closedLTR:m.blank,c=n?this.toggleOpen:this.itemClicked;return n||s!=null&&s.openable?i("td",{class:a.openContainer,key:"open-container",onClick:c},i("calcite-icon",{icon:o,key:o,scale:"s"})):null}renderActionsStart(){const{label:e,hasActionsStart:t}=this;return i("td",{"aria-label":e,class:a.actionsStart,hidden:!t,key:"actions-start-container",role:"gridcell",ref:n=>this.actionsStartEl=n},i("slot",{name:C.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{label:e,hasActionsEnd:t,closable:n,messages:s}=this;return i("td",{"aria-label":e,class:a.actionsEnd,hidden:!(t||n),key:"actions-end-container",role:"gridcell",ref:l=>this.actionsEndEl=l},i("slot",{name:C.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),n?i("calcite-action",{appearance:"transparent",icon:m.close,key:"close-action",label:s.close,onClick:this.closeClickHandler,text:s.close}):null)}renderContentStart(){const{hasContentStart:e}=this;return i("div",{class:a.contentStart,hidden:!e},i("slot",{name:C.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderCustomContent(){const{hasCustomContent:e}=this;return i("div",{class:a.customContent,hidden:!e},i("slot",{name:C.content,onSlotchange:this.handleContentSlotChange}))}renderContentEnd(){const{hasContentEnd:e}=this;return i("div",{class:a.contentEnd,hidden:!e},i("slot",{name:C.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}renderContentBottom(){const{hasContentBottom:e,visualLevel:t}=this;return i("div",{class:a.contentBottom,hidden:!e,style:{"--calcite-list-item-spacing-indent-multiplier":`${t}`}},i("slot",{name:C.contentBottom,onSlotchange:this.handleContentBottomSlotChange}))}renderDefaultContainer(){return i("div",{class:{[a.nestedContainer]:!0,[a.nestedContainerHidden]:this.openable&&!this.open}},i("slot",{onSlotchange:this.handleDefaultSlotChange,ref:e=>this.defaultSlotEl=e}))}renderContentProperties(){const{label:e,description:t,hasCustomContent:n}=this;return!n&&(e||t)?i("div",{class:a.content,key:"content"},e?i("div",{class:a.label,key:"label"},e):null,t?i("div",{class:a.description,key:"description"},t):null):null}renderContentContainer(){const{description:e,label:t,selectionMode:n,hasCustomContent:s}=this,l=s||!!t||!!e,o=[this.renderContentStart(),this.renderCustomContent(),this.renderContentProperties(),this.renderContentEnd()];return i("td",{"aria-label":t,class:{[a.contentContainer]:!0,[a.contentContainerSelectable]:n!=="none",[a.contentContainerHasCenterContent]:l},key:"content-container",onClick:this.itemClicked,role:"gridcell",ref:c=>this.contentEl=c},o)}render(){const{openable:e,open:t,level:n,setPosition:s,setSize:l,active:o,label:c,selected:d,selectionAppearance:f,selectionMode:r,closed:h,visualLevel:u}=this,S=r!=="none"&&f==="border",F=S&&d,_=S&&!d;return i(j,null,i("tr",{"aria-expanded":e?v(t):null,"aria-label":c,"aria-level":n,"aria-posinset":s,"aria-selected":v(d),"aria-setsize":l,class:{[a.container]:!0,[a.containerBorderSelected]:F,[a.containerBorderUnselected]:_},hidden:h,onFocus:this.focusCellNull,onKeyDown:this.handleItemKeyDown,role:"row",style:{"--calcite-list-item-spacing-indent-multiplier":`${u}`},tabIndex:o?0:-1,ref:K=>this.containerEl=K},this.renderDragHandle(),this.renderSelected(),this.renderOpen(),this.renderActionsStart(),this.renderContentContainer(),this.renderActionsEnd()),this.renderContentBottom(),this.renderDefaultContainer())}emitCalciteInternalListItemChange(){this.calciteInternalListItemChange.emit()}setSelectionDefaults(){const{parentListEl:e,selectionMode:t,selectionAppearance:n}=this;e&&(t||(this.selectionMode=e.selectionMode),n||(this.selectionAppearance=e.selectionAppearance))}handleOpenableChange(e){if(!e)return;const{parentListEl:t}=this,n=G(e);J(n);const s=!!n.length;s&&t&&!t.openable&&(t.openable=!0),this.openable=s,s||(this.open=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{active:["activeHandler"],closed:["handleClosedChange"],disabled:["handleDisabledChange"],selected:["handleSelectedChange"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return N}},[1,"calcite-list-item",{active:[4],closable:[516],closed:[1540],description:[1],disabled:[516],dragHandle:[4,"drag-handle"],label:[1],metadata:[16],open:[1540],setSize:[2,"set-size"],setPosition:[2,"set-position"],selected:[1540],value:[8],selectionMode:[1025,"selection-mode"],selectionAppearance:[1025,"selection-appearance"],messageOverrides:[1040],messages:[1040],effectiveLocale:[32],defaultMessages:[32],level:[32],visualLevel:[32],parentListEl:[32],openable:[32],hasActionsStart:[32],hasActionsEnd:[32],hasCustomContent:[32],hasContentStart:[32],hasContentEnd:[32],hasContentBottom:[32],setFocus:[64]},[[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"],[0,"calciteInternalListDefaultSlotChange","handleCalciteInternalListDefaultSlotChanges"]]]);function $(){if(typeof customElements>"u")return;["calcite-list-item","calcite-action","calcite-handle","calcite-icon","calcite-loader"].forEach(t=>{switch(t){case"calcite-list-item":customElements.get(t)||customElements.define(t,T);break;case"calcite-action":customElements.get(t)||Q();break;case"calcite-handle":customElements.get(t)||O();break;case"calcite-icon":customElements.get(t)||z();break;case"calcite-loader":customElements.get(t)||V();break}})}$();const me=T,pe=$;export{me as CalciteListItem,pe as defineCustomElement}; diff --git a/dist/assets/calcite-list-item-group-havhVECR.js b/dist/assets/calcite-list-item-group-havhVECR.js new file mode 100644 index 0000000..4f0ff59 --- /dev/null +++ b/dist/assets/calcite-list-item-group-havhVECR.js @@ -0,0 +1,5 @@ +import{q as o,H as l,r as c,t as i,x as r}from"./index-J0iiHjMT.js";import{c as d,u as h,d as u}from"./interactive-NKzPUNL4.js";import{g as m,M as p}from"./utils3-_ao2jQXg.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const a={container:"container",heading:"heading"},g=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-ui-foreground-1);--calcite-list-item-spacing-indent:1rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.container{margin:0px;display:flex;flex:1 1 0%;background-color:var(--calcite-ui-foreground-2);padding:0.75rem;font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-2)}.heading{padding-inline-start:calc(var(--calcite-list-item-spacing-indent) * var(--calcite-list-item-spacing-indent-multiplier))}::slotted(calcite-list-item){--tw-shadow:0 -1px 0 var(--calcite-ui-border-3);--tw-shadow-colored:0 -1px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);margin-block-start:1px}::slotted(calcite-list-item:nth-child(1 of :not([hidden]))){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);margin-block-start:0px}:host([hidden]){display:none}[hidden]{display:none}",s=o(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=c(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.heading=void 0,this.visualLevel=null}connectedCallback(){const{el:e}=this;this.visualLevel=m(e,!0),d(this)}componentDidRender(){h(this)}disconnectedCallback(){u(this)}render(){const{heading:e,visualLevel:t}=this;return i(r,null,i("tr",{class:a.container,style:{"--calcite-list-item-spacing-indent-multiplier":`${t}`}},i("td",{class:a.heading,colSpan:p},e)),i("slot",{onSlotchange:this.handleDefaultSlotChange}))}get el(){return this}static get style(){return g}},[1,"calcite-list-item-group",{disabled:[516],heading:[513],visualLevel:[32]}]);function n(){if(typeof customElements>"u")return;["calcite-list-item-group"].forEach(t=>{switch(t){case"calcite-list-item-group":customElements.get(t)||customElements.define(t,s);break}})}n();const b=s,x=n;export{b as CalciteListItemGroup,x as defineCustomElement}; diff --git a/dist/assets/calcite-loader-Z65agR8e.js b/dist/assets/calcite-loader-Z65agR8e.js new file mode 100644 index 0000000..ab0d2cd --- /dev/null +++ b/dist/assets/calcite-loader-Z65agR8e.js @@ -0,0 +1,5 @@ +import{L as e,d as o}from"./loader-QqciGs1c.js";import"./index-J0iiHjMT.js";import"./guid-6vN-YNJI.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const i=e,n=o;export{i as CalciteLoader,n as defineCustomElement}; diff --git a/dist/assets/calcite-notice-zH528nES.js b/dist/assets/calcite-notice-zH528nES.js new file mode 100644 index 0000000..5c60f98 --- /dev/null +++ b/dist/assets/calcite-notice-zH528nES.js @@ -0,0 +1,19 @@ +import{q as p,H as f,r as s,dc as a,t,db as u}from"./index-J0iiHjMT.js";import{c as v,d as k}from"./conditionalSlot-e55zipTI.js";import{s as b,a as x,c as w}from"./loadable-sxY2K1G3.js";import{c as C,d as z}from"./locale-pfkq1d6A.js";import{c as y,d as E,s as L,u as B}from"./t9n-od6MEnI1.js";import{o as l}from"./openCloseComponent-yw47Oy2q.js";import{g as r}from"./component-dtiBfYiX.js";import{d as O}from"./icon-ZwpY5ksA.js";import"./observers-JyBmMU24.js";import"./key-qdHumIlA.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */var c;(function(e){e.brand="lightbulb",e.danger="exclamationMarkTriangle",e.info="information",e.success="checkCircle",e.warning="exclamationMarkTriangle"})(c||(c={}));/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},n={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},N=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:none;inline-size:100%;background-color:var(--calcite-ui-foreground-1);opacity:0;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;max-block-size:0;text-align:start;border-inline-start:0px solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host{display:flex}:host([open]) .container{pointer-events:auto;display:flex;max-block-size:100%;align-items:center;border-width:2px;opacity:1;--tw-shadow:0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);--tw-shadow-colored:0 4px 8px -1px var(--tw-shadow-color), 0 2px 4px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.container slot[name=title]::slotted(*),.container *::slotted([slot=title]){margin:0px;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.container slot[name=message]::slotted(*),.container *::slotted([slot=message]){margin:0px;display:inline;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2);margin-inline-end:var(--calcite-notice-spacing-token-small)}.notice-content{box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;display:flex;min-inline-size:0px;flex-direction:column;overflow-wrap:break-word;flex:1 1 0;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:0 var(--calcite-notice-spacing-token-small)}.notice-content:first-of-type:not(:only-child){padding-inline-start:var(--calcite-notice-spacing-token-large)}.notice-content:only-of-type{padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large)}.notice-icon{display:flex;align-items:center;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto}.notice-close{display:flex;cursor:pointer;align-items:center;align-self:stretch;border-style:none;background-color:transparent;color:var(--calcite-ui-text-3);outline:2px solid transparent;outline-offset:2px;box-sizing:border-box;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;padding-block:var(--calcite-notice-spacing-token-small);padding-inline:var(--calcite-notice-spacing-token-large);flex:0 0 auto;-webkit-appearance:none}.notice-close:hover,.notice-close:focus{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1)}.notice-close:active{background-color:var(--calcite-ui-foreground-3)}.actions-end{display:flex;align-self:stretch}:host([kind=brand]) .container{border-color:var(--calcite-ui-brand)}:host([kind=brand]) .container .notice-icon{color:var(--calcite-ui-brand)}:host([kind=info]) .container{border-color:var(--calcite-ui-info)}:host([kind=info]) .container .notice-icon{color:var(--calcite-ui-info)}:host([kind=danger]) .container{border-color:var(--calcite-ui-danger)}:host([kind=danger]) .container .notice-icon{color:var(--calcite-ui-danger)}:host([kind=success]) .container{border-color:var(--calcite-ui-success)}:host([kind=success]) .container .notice-icon{color:var(--calcite-ui-success)}:host([kind=warning]) .container{border-color:var(--calcite-ui-warning)}:host([kind=warning]) .container .notice-icon{color:var(--calcite-ui-warning)}:host([hidden]){display:none}[hidden]{display:none}`,d=p(class extends f{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteNoticeBeforeClose=s(this,"calciteNoticeBeforeClose",6),this.calciteNoticeBeforeOpen=s(this,"calciteNoticeBeforeOpen",6),this.calciteNoticeClose=s(this,"calciteNoticeClose",6),this.calciteNoticeOpen=s(this,"calciteNoticeOpen",6),this.setTransitionEl=e=>{this.transitionEl=e},this.close=()=>{this.open=!1},this.openTransitionProp="opacity",this.open=!1,this.kind="brand",this.closable=!1,this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.width="auto",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){l(this)}onMessagesChange(){}updateRequestedIcon(){this.requestedIcon=a(c,this.icon,this.kind)}connectedCallback(){v(this),C(this),y(this)}disconnectedCallback(){k(this),z(this),E(this)}async componentWillLoad(){b(this),this.requestedIcon=a(c,this.icon,this.kind),await L(this),this.open&&l(this)}componentDidLoad(){x(this)}render(){const{el:e}=this,i=t("button",{"aria-label":this.messages.close,class:n.close,onClick:this.close,ref:g=>this.closeButton=g},t("calcite-icon",{icon:"x",scale:r(this.scale)})),m=u(e,o.actionsEnd);return t("div",{class:n.container,ref:this.setTransitionEl},this.requestedIcon?t("div",{class:n.icon},t("calcite-icon",{flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:r(this.scale)})):null,t("div",{class:n.content},t("slot",{name:o.title}),t("slot",{name:o.message}),t("slot",{name:o.link})),m?t("div",{class:n.actionsEnd},t("slot",{name:o.actionsEnd})):null,this.closable?i:null)}async setFocus(){await w(this);const e=this.el.querySelector("calcite-link");if(!(!this.closeButton&&!e)){if(e)return e.setFocus();this.closeButton&&this.closeButton.focus()}}onBeforeClose(){this.calciteNoticeBeforeClose.emit()}onBeforeOpen(){this.calciteNoticeBeforeOpen.emit()}onClose(){this.calciteNoticeClose.emit()}onOpen(){this.calciteNoticeOpen.emit()}effectiveLocaleChange(){B(this,this.effectiveLocale)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],icon:["updateRequestedIcon"],kind:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return N}},[1,"calcite-notice",{open:[1540],kind:[513],closable:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],width:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],setFocus:[64]}]);function h(){if(typeof customElements>"u")return;["calcite-notice","calcite-icon"].forEach(i=>{switch(i){case"calcite-notice":customElements.get(i)||customElements.define(i,d);break;case"calcite-icon":customElements.get(i)||O();break}})}h();const U=d,$=h;export{U as CalciteNotice,$ as defineCustomElement}; diff --git a/dist/assets/calcite-option-LMeeGK3H.js b/dist/assets/calcite-option-LMeeGK3H.js new file mode 100644 index 0000000..b170a21 --- /dev/null +++ b/dist/assets/calcite-option-LMeeGK3H.js @@ -0,0 +1,5 @@ +import{q as o,H as r,r as c,t as h}from"./index-J0iiHjMT.js";import{c as d}from"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const u=":host{display:block}:host([hidden]){display:none}[hidden]{display:none}",i=o(class extends r{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalOptionChange=c(this,"calciteInternalOptionChange",6),this.mutationObserver=d("mutation",()=>{this.ensureTextContentDependentProps(),this.calciteInternalOptionChange.emit()}),this.disabled=!1,this.label=void 0,this.selected=void 0,this.value=void 0}handlePropChange(e,t,n){(n==="label"||n==="value")&&this.ensureTextContentDependentProps(),this.calciteInternalOptionChange.emit()}ensureTextContentDependentProps(){const{el:{textContent:e},internallySetLabel:t,internallySetValue:n,label:s,value:l}=this;(!s||s===t)&&(this.label=e,this.internallySetLabel=e),(l==null||l===n)&&(this.value=e,this.internallySetValue=e)}connectedCallback(){var e;this.ensureTextContentDependentProps(),(e=this.mutationObserver)==null||e.observe(this.el,{attributeFilter:["label","value"],characterData:!0,childList:!0,subtree:!0})}disconnectedCallback(){var e;(e=this.mutationObserver)==null||e.disconnect()}render(){return h("slot",null,this.label)}get el(){return this}static get watchers(){return{disabled:["handlePropChange"],label:["handlePropChange"],selected:["handlePropChange"],value:["handlePropChange"]}}static get style(){return u}},[1,"calcite-option",{disabled:[516],label:[1025],selected:[516],value:[1032]}]);function a(){if(typeof customElements>"u")return;["calcite-option"].forEach(t=>{switch(t){case"calcite-option":customElements.get(t)||customElements.define(t,i);break}})}a();const m=i,C=a;export{m as CalciteOption,C as defineCustomElement}; diff --git a/dist/assets/calcite-popover-PeZ1jQob.js b/dist/assets/calcite-popover-PeZ1jQob.js new file mode 100644 index 0000000..3e3e9b5 --- /dev/null +++ b/dist/assets/calcite-popover-PeZ1jQob.js @@ -0,0 +1,5 @@ +import{P as o,d as t}from"./popover-Jm1QI0N1.js";import"./index-J0iiHjMT.js";import"./floating-ui-McpI0u1Z.js";import"./debounce-HnHf1UOZ.js";import"./guid-6vN-YNJI.js";import"./openCloseComponent-yw47Oy2q.js";import"./locale-pfkq1d6A.js";import"./key-qdHumIlA.js";import"./observers-JyBmMU24.js";import"./t9n-od6MEnI1.js";import"./loadable-sxY2K1G3.js";import"./FloatingArrow-BghsONry.js";import"./component-dtiBfYiX.js";import"./action-W5zDPNjG.js";import"./interactive-NKzPUNL4.js";import"./icon-ZwpY5ksA.js";import"./loader-QqciGs1c.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const x=o,$=t;export{x as CalcitePopover,$ as defineCustomElement}; diff --git a/dist/assets/calcite-scrim-iUD6Tmec.js b/dist/assets/calcite-scrim-iUD6Tmec.js new file mode 100644 index 0000000..4aadf6e --- /dev/null +++ b/dist/assets/calcite-scrim-iUD6Tmec.js @@ -0,0 +1,5 @@ +import{S as t,d as m}from"./scrim-OeyGkB0-.js";import"./index-J0iiHjMT.js";import"./locale-pfkq1d6A.js";import"./key-qdHumIlA.js";import"./observers-JyBmMU24.js";import"./t9n-od6MEnI1.js";import"./loader-QqciGs1c.js";import"./guid-6vN-YNJI.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const a=t,d=m;export{a as CalciteScrim,d as defineCustomElement}; diff --git a/dist/assets/calcite-select-0Yw6DsYN.js b/dist/assets/calcite-select-0Yw6DsYN.js new file mode 100644 index 0000000..1fa6331 --- /dev/null +++ b/dist/assets/calcite-select-0Yw6DsYN.js @@ -0,0 +1,15 @@ +import{q as r,H as d,r as h,ac as m,t as s,ad as p}from"./index-J0iiHjMT.js";import{c as u,d as f,a as b,H as v}from"./form-2Iq0hI3D.js";import{c as g,d as E,u as C}from"./interactive-NKzPUNL4.js";import{c as x,d as w,g as N}from"./label2-d2vWQ7x7.js";import{s as S,a as y,c as I}from"./loadable-sxY2K1G3.js";import{c as z}from"./observers-JyBmMU24.js";import{g as T}from"./component-dtiBfYiX.js";import{d as O}from"./icon-ZwpY5ksA.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const a={icon:"icon",iconContainer:"icon-container",select:"select"},k=`:host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;align-items:stretch;inline-size:var(--select-width)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]){block-size:1.5rem;--calcite-select-font-size:var(--calcite-font-size--2);--calcite-select-spacing-inline:0.5rem 2rem}:host([scale=s]) .icon-container{padding-inline:0.5rem}:host([scale=m]){block-size:2rem;--calcite-select-font-size:var(--calcite-font-size--1);--calcite-select-spacing-inline:0.75rem 2.5rem}:host([scale=m]) .icon-container{padding-inline:0.75rem}:host([scale=l]){block-size:44px;--calcite-select-font-size:var(--calcite-font-size-0);--calcite-select-spacing-inline:1rem 3rem}:host([scale=l]) .icon-container{padding-inline:1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}.select{margin:0px;box-sizing:border-box;inline-size:100%;cursor:pointer;appearance:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:0px;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);font-family:inherit;color:var(--calcite-ui-text-2);outline-color:transparent;font-size:var(--calcite-select-font-size);padding-inline:var(--calcite-select-spacing-inline);border-inline-end-width:0px}.select:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.select:hover{background-color:var(--calcite-ui-foreground-2)}select:disabled{border-color:var(--calcite-ui-border-input);--tw-bg-opacity:1}.icon-container{pointer-events:none;position:absolute;inset-block:0px;display:flex;align-items:center;border-width:0px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:transparent;color:var(--calcite-ui-text-2);inset-inline-end:0px;border-inline-width:0px 1px}.select:focus~.icon-container{border-color:transparent}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`;function c(e){return e.tagName==="CALCITE-OPTION"}function A(e){return e.tagName==="CALCITE-OPTION-GROUP"}const l=r(class extends d{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteSelectChange=h(this,"calciteSelectChange",6),this.componentToNativeEl=new Map,this.mutationObserver=z("mutation",()=>this.populateInternalSelect()),this.handleInternalSelectChange=()=>{const e=this.selectEl.selectedOptions[0];this.selectFromNativeOption(e),requestAnimationFrame(()=>this.emitChangeEvent())},this.populateInternalSelect=()=>{const e=Array.from(this.el.children).filter(t=>t.tagName==="CALCITE-OPTION"||t.tagName==="CALCITE-OPTION-GROUP");this.clearInternalSelect(),e.forEach(t=>{var i;return(i=this.selectEl)==null?void 0:i.append(this.toNativeElement(t))})},this.storeSelectRef=e=>{this.selectEl=e,this.populateInternalSelect();const t=this.selectEl.selectedOptions[0];this.selectFromNativeOption(t)},this.emitChangeEvent=()=>{this.calciteSelectChange.emit()},this.disabled=!1,this.form=void 0,this.label=void 0,this.name=void 0,this.required=!1,this.scale="m",this.value=null,this.selectedOption=void 0,this.width="auto"}valueHandler(e){this.el.querySelectorAll("calcite-option").forEach(i=>i.selected=i.value===e)}selectedOptionHandler(e){this.value=e==null?void 0:e.value}connectedCallback(){var t;const{el:e}=this;(t=this.mutationObserver)==null||t.observe(e,{subtree:!0,childList:!0}),g(this),x(this),u(this)}disconnectedCallback(){var e;(e=this.mutationObserver)==null||e.disconnect(),E(this),w(this),f(this)}componentWillLoad(){S(this)}componentDidLoad(){var e;y(this),b(this,((e=this.selectedOption)==null?void 0:e.value)??"")}componentDidRender(){C(this)}async setFocus(){await I(this),m(this.selectEl)}handleOptionOrGroupChange(e){e.stopPropagation();const t=e.target,i=this.componentToNativeEl.get(t);i&&(this.updateNativeElement(t,i),c(t)&&t.selected&&(this.deselectAllExcept(t),this.selectedOption=t))}onLabelClick(){this.setFocus()}updateNativeElement(e,t){if(t.disabled=e.disabled,t.label=e.label,c(e)){const i=t;i.selected=e.selected,i.value=e.value,i.innerText=e.label}}clearInternalSelect(){this.componentToNativeEl.forEach(e=>e.remove()),this.componentToNativeEl.clear()}selectFromNativeOption(e){if(!e)return;let t;this.componentToNativeEl.forEach((i,n)=>{c(n)&&i===e&&(n.selected=!0,t=n,this.deselectAllExcept(n))}),t&&(this.selectedOption=t)}toNativeElement(e){if(c(e)){const t=document.createElement("option");return this.updateNativeElement(e,t),this.componentToNativeEl.set(e,t),t}if(A(e)){const t=document.createElement("optgroup");return this.updateNativeElement(e,t),Array.from(e.children).forEach(i=>{const n=this.toNativeElement(i);t.append(n),this.componentToNativeEl.set(e,n)}),this.componentToNativeEl.set(e,t),t}throw new Error("unsupported element child provided")}deselectAllExcept(e){this.el.querySelectorAll("calcite-option").forEach(t=>{t!==e&&(t.selected=!1)})}renderChevron(){return s("div",{class:a.iconContainer},s("calcite-icon",{class:a.icon,icon:"chevron-down",scale:T(this.scale)}))}render(){return s(p,null,s("select",{"aria-label":N(this),class:a.select,disabled:this.disabled,onChange:this.handleInternalSelectChange,ref:this.storeSelectRef},s("slot",null)),this.renderChevron(),s(v,{component:this}))}get el(){return this}static get watchers(){return{value:["valueHandler"],selectedOption:["selectedOptionHandler"]}}static get style(){return k}},[1,"calcite-select",{disabled:[516],form:[513],label:[1],name:[513],required:[516],scale:[513],value:[1025],selectedOption:[1040],width:[513],setFocus:[64]},[[0,"calciteInternalOptionChange","handleOptionOrGroupChange"],[0,"calciteInternalOptionGroupChange","handleOptionOrGroupChange"]]]);function o(){if(typeof customElements>"u")return;["calcite-select","calcite-icon"].forEach(t=>{switch(t){case"calcite-select":customElements.get(t)||customElements.define(t,l);break;case"calcite-icon":customElements.get(t)||O();break}})}o();const U=l,$=o;export{U as CalciteSelect,$ as defineCustomElement}; diff --git a/dist/assets/calcite-slider--uw2bYfU.js b/dist/assets/calcite-slider--uw2bYfU.js new file mode 100644 index 0000000..6e8a605 --- /dev/null +++ b/dist/assets/calcite-slider--uw2bYfU.js @@ -0,0 +1,39 @@ +import{q as C,H as F,cn as G,t as s,r as S,B as _,x as W,kp as P}from"./index-J0iiHjMT.js";import{g as B}from"./guid-6vN-YNJI.js";import{c as Y,d as Z,a as K,H as J}from"./form-2Iq0hI3D.js";import{c as N,d as Q,u as ee}from"./interactive-NKzPUNL4.js";import{i as te}from"./key-qdHumIlA.js";import{c as ae,d as ie,g as se}from"./label2-d2vWQ7x7.js";import{s as ne,a as le,c as re}from"./loadable-sxY2K1G3.js";import{n as z,c as oe,d as he}from"./locale-pfkq1d6A.js";import{d as w,c as ce}from"./math-SoUQJWjz.js";import{c as de}from"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function ue(e,t,i){const a=t[0]-e[0],n=i[0]-t[0],h=t[1]-e[1],d=i[1]-t[1],r=h/(a||n<0&&0),o=d/(n||a<0&&0),c=(r*n+o*a)/(a+n);return(Math.sign(r)+Math.sign(o))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs(c))||0}function R(e,t,i){const a=t[0]-e[0],n=t[1]-e[1];return a?(3*n/a-i)/2:i}function T(e,t,i,a,n){const[h,d]=e,[r,o]=t,c=(r-h)/3,m=n([h+c,d+c*i]).join(","),u=n([r-c,o-c*a]).join(","),p=n([r,o]).join(",");return`C ${m} ${u} ${p}`}function me({width:e,height:t,min:i,max:a}){const n=a[0]-i[0],h=a[1]-i[1];return d=>{const r=(d[0]-i[0])/n*e,o=t-d[1]/h*t;return[r,o]}}function be(e){const[t,i]=e[0],a=[t,i],n=[t,i];return e.reduce(({min:h,max:d},[r,o])=>({min:[Math.min(h[0],r),Math.min(h[1],o)],max:[Math.max(d[0],r),Math.max(d[1],o)]}),{min:a,max:n})}function ge({data:e,min:t,max:i,t:a}){if(e.length===0)return"";const[n,h]=a(e[0]),[d,r]=a(t),[o]=a(i);let c,m,u;const p=e.reduce((v,b,k)=>{if(m=e[k-2],u=e[k-1],k>1){const x=ue(m,u,b),y=c===void 0?R(m,u,x):c,L=T(m,u,y,x,a);return c=x,`${v} ${L}`}return v},`M ${d},${r} L ${d},${h} L ${n},${h}`),g=e[e.length-1],f=T(u,g,c,R(u,g,c),a);return`${p} ${f} L ${o},${r} Z`}const pe=":host{display:block;block-size:100%}.svg{fill:currentColor;stroke:transparent;margin:0px;display:block;block-size:100%;inline-size:100%;padding:0px}.svg .graph-path--highlight{fill:var(--calcite-ui-brand);opacity:0.5}:host([hidden]){display:none}[hidden]{display:none}",fe=C(class extends F{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.graphId=`calcite-graph-${B()}`,this.resizeObserver=de("resize",()=>G(this)),this.data=[],this.colorStops=void 0,this.highlightMin=void 0,this.highlightMax=void 0,this.min=void 0,this.max=void 0}connectedCallback(){var e;(e=this.resizeObserver)==null||e.observe(this.el)}disconnectedCallback(){var e;(e=this.resizeObserver)==null||e.disconnect()}render(){const{data:e,colorStops:t,el:i,highlightMax:a,highlightMin:n,min:h,max:d}=this,r=this.graphId,{clientHeight:o,clientWidth:c}=i;if(!e||e.length===0)return s("svg",{"aria-hidden":"true",class:"svg",height:o,preserveAspectRatio:"none",viewBox:`0 0 ${c} ${o}`,width:c});const{min:m,max:u}=be(e);let p=m,g=u;(hm[0])&&(p=[h,0]),(d>u[0]||ds("stop",{offset:`${y*100}%`,"stop-color":L,"stop-opacity":M})))):null,n!==void 0?[s("mask",{height:"100%",id:`${r}1`,width:"100%",x:"0%",y:"0%"},s("path",{d:` + M 0,0 + L ${v-1},0 + L ${v-1},${o} + L 0,${o} + Z + `,fill:"white"})),s("mask",{height:"100%",id:`${r}2`,width:"100%",x:"0%",y:"0%"},s("path",{d:` + M ${v+1},0 + L ${b-1},0 + L ${b-1},${o} + L ${v+1}, ${o} + Z + `,fill:"white"})),s("mask",{height:"100%",id:`${r}3`,width:"100%",x:"0%",y:"0%"},s("path",{d:` + M ${b+1},0 + L ${c},0 + L ${c},${o} + L ${b+1}, ${o} + Z + `,fill:"white"})),s("path",{class:"graph-path",d:k,fill:x,mask:`url(#${r}1)`}),s("path",{class:"graph-path--highlight",d:k,fill:x,mask:`url(#${r}2)`}),s("path",{class:"graph-path",d:k,fill:x,mask:`url(#${r}3)`})]:s("path",{class:"graph-path",d:k,fill:x}))}get el(){return this}static get style(){return pe}},[1,"calcite-graph",{data:[16],colorStops:[16],highlightMin:[2,"highlight-min"],highlightMax:[2,"highlight-max"],min:[514],max:[514]}]);function O(){if(typeof customElements>"u")return;["calcite-graph"].forEach(t=>{switch(t){case"calcite-graph":customElements.get(t)||customElements.define(t,fe);break}})}O();/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const H={handleLabel:"handle__label",handleLabelMinValue:"handle__label--minValue",handleLabelValue:"handle__label--value",tickMin:"tick__label--min",tickMax:"tick__label--max"},ve=250,xe=`@charset "UTF-8";:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{--calcite-slider-handle-size:0.625rem;--calcite-slider-handle-extension-height:0.4rem;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:0.875rem;--calcite-slider-handle-extension-height:0.5rem;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:1rem;--calcite-slider-handle-extension-height:0.65rem;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc( + var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height) + );touch-action:none}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.375rem}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.5rem}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-0.55rem}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + 2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-0.125rem}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.4375rem}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-1.875rem}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-2rem}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-2.075rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-2.75rem}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-3.0625rem}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`;function V(e){return Array.isArray(e)}const E=C(class extends F{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteSliderInput=S(this,"calciteSliderInput",6),this.calciteSliderChange=S(this,"calciteSliderChange",6),this.activeProp="value",this.guid=`calcite-slider-${B()}`,this.dragUpdate=e=>{if(!this.disabled&&(e.preventDefault(),this.dragProp)){const t=this.translate(e.clientX||e.pageX);if(V(this.value)&&this.dragProp==="minMaxValue")if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,a=t+this.maxValueDragRange;a<=this.max&&i>=this.min&&a-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(a,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=e=>{this.disabled||!_(e)||this.dragEnd(e)},this.dragEnd=e=>{this.disabled||(this.removeDragListeners(),this.focusActiveHandle(e.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null)},this.storeTrackRef=e=>{this.trackEl=e},this.determineGroupSeparator=e=>{if(typeof e=="number")return z.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},z.localize(e.toString())},this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hasHistogram=!1,this.histogram=void 0,this.histogramStops=void 0,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.maxLabel=void 0,this.maxValue=void 0,this.min=0,this.minLabel=void 0,this.minValue=void 0,this.mirrored=!1,this.name=void 0,this.numberingSystem=void 0,this.pageStep=void 0,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.ticks=void 0,this.value=0,this.scale="m",this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[]}histogramWatcher(e){this.hasHistogram=!!e}ticksWatcher(){this.tickValues=this.generateTickValues()}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){N(this),oe(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),ae(this),Y(this)}disconnectedCallback(){Q(this),ie(this),Z(this),he(this),this.removeDragListeners()}componentWillLoad(){ne(this),V(this.value)||(this.value=this.snap?this.getClosestStep(this.value):this.clamp(this.value)),this.ticksWatcher(),this.histogramWatcher(this.histogram),K(this,this.value)}componentDidLoad(){le(this)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),V(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),ee(this)}render(){const e=this.el.id||this.guid,t=V(this.value)?"maxValue":"value",i=V(this.value)?this.maxValue:this.value,a=this.determineGroupSeparator(i),n=this.determineGroupSeparator(this.minValue),h=this.minValue||this.min,d=this.shouldUseMinValue(),r=this.getUnitInterval(d?this.minValue:h)*100,o=this.getUnitInterval(i)*100,c=this.shouldMirror(),m=`${c?100-r:r}%`,u=`${c?o:100-o}%`,p=V(this.value),g=`${H.handleLabel} ${H.handleLabelMinValue}`,f=`${H.handleLabel} ${H.handleLabelValue}`,v=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("div",{class:"handle"})),b=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("span",{"aria-hidden":"true",class:f},a),s("span",{"aria-hidden":"true",class:`${f} static`},a),s("span",{"aria-hidden":"true",class:`${f} transformed`},a),s("div",{class:"handle"})),k=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:f},a),s("span",{"aria-hidden":"true",class:`${f} static`},a),s("span",{"aria-hidden":"true",class:`${f} transformed`},a)),x=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("div",{class:"handle"}),s("div",{class:"handle-extension"})),y=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("div",{class:"handle-extension"}),s("div",{class:"handle"})),L=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("span",{"aria-hidden":"true",class:f},a),s("span",{"aria-hidden":"true",class:`${f} static`},a),s("span",{"aria-hidden":"true",class:`${f} transformed`},a),s("div",{class:"handle"}),s("div",{class:"handle-extension"})),M=s("div",{"aria-disabled":this.disabled,"aria-label":p?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":i,class:{thumb:!0,"thumb--value":!0,"thumb--active":this.lastDragProp!=="minMaxValue"&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:l=>this.pointerDownDragStart(l,t),role:"slider",style:{right:u},tabIndex:0,ref:l=>this.maxHandle=l},s("div",{class:"handle-extension"}),s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:f},a),s("span",{"aria-hidden":"true",class:`${f} static`},a),s("span",{"aria-hidden":"true",class:`${f} transformed`},a)),X=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":this.dragProp==="minValue"},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:l=>this.pointerDownDragStart(l,"minValue"),role:"slider",style:{left:m},tabIndex:0,ref:l=>this.minHandle=l},s("div",{class:"handle"})),q=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":this.dragProp==="minValue"},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:l=>this.pointerDownDragStart(l,"minValue"),role:"slider",style:{left:m},tabIndex:0,ref:l=>this.minHandle=l},s("span",{"aria-hidden":"true",class:g},n),s("span",{"aria-hidden":"true",class:`${g} static`},n),s("span",{"aria-hidden":"true",class:`${g} transformed`},n),s("div",{class:"handle"})),A=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":this.dragProp==="minValue"},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:l=>this.pointerDownDragStart(l,"minValue"),role:"slider",style:{left:m},tabIndex:0,ref:l=>this.minHandle=l},s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:g},n),s("span",{"aria-hidden":"true",class:`${g} static`},n),s("span",{"aria-hidden":"true",class:`${g} transformed`},n)),U=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":this.dragProp==="minValue","thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:l=>this.pointerDownDragStart(l,"minValue"),role:"slider",style:{left:m},tabIndex:0,ref:l=>this.minHandle=l},s("div",{class:"handle-extension"}),s("div",{class:"handle"})),j=s("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":this.dragProp==="minValue","thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:l=>this.pointerDownDragStart(l,"minValue"),role:"slider",style:{left:m},tabIndex:0,ref:l=>this.minHandle=l},s("div",{class:"handle-extension"}),s("div",{class:"handle"}),s("span",{"aria-hidden":"true",class:g},n),s("span",{"aria-hidden":"true",class:`${g} static`},n),s("span",{"aria-hidden":"true",class:`${g} transformed`},n));return s(W,{id:e,onTouchStart:this.handleTouchStart},s("div",{"aria-label":se(this),class:{container:!0,"container--range":p,[`scale--${this.scale}`]:!0}},this.renderGraph(),s("div",{class:"track",ref:this.storeTrackRef},s("div",{class:"track__range",onPointerDown:l=>this.pointerDownDragStart(l,"minMaxValue"),style:{left:`${c?100-o:r}%`,right:`${c?r:100-o}%`}}),s("div",{class:"ticks"},this.tickValues.map(l=>{const $=`${this.getUnitInterval(l)*100}%`;let D=l>=h&&l<=i;return d&&(D=l>=this.minValue&&l<=this.maxValue),s("span",{class:{tick:!0,"tick--active":D},style:{left:c?"":$,right:c?$:""}},this.renderTickLabel(l))}))),s("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&p&&X,!this.hasHistogram&&!this.precise&&this.labelHandles&&p&&q,this.precise&&!this.labelHandles&&p&&U,this.precise&&this.labelHandles&&p&&j,this.hasHistogram&&!this.precise&&this.labelHandles&&p&&A,!this.precise&&!this.labelHandles&&v,!this.hasHistogram&&!this.precise&&this.labelHandles&&b,!this.hasHistogram&&this.precise&&!this.labelHandles&&x,this.hasHistogram&&this.precise&&!this.labelHandles&&y,!this.hasHistogram&&this.precise&&this.labelHandles&&L,this.hasHistogram&&!this.precise&&this.labelHandles&&k,this.hasHistogram&&this.precise&&this.labelHandles&&M,s(J,{component:this}))))}renderGraph(){return this.histogram?s("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:V(this.value)?this.maxValue:this.value,highlightMin:V(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(e){const t=V(this.value),i=e===this.min,a=e===this.max,n=this.determineGroupSeparator(e),h=s("span",{class:{tick__label:!0,[H.tickMin]:i,[H.tickMax]:a}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(i||a)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(i||a)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(i||a)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(i||a)?h:null}keyDownHandler(e){const t=this.shouldMirror(),{activeProp:i,max:a,min:n,pageStep:h,step:d}=this,r=this[i],{key:o}=e;if(te(o)){e.preventDefault();return}let c;if(o==="ArrowUp"||o==="ArrowRight"?c=r+d*(t&&o==="ArrowRight"?-1:1):o==="ArrowDown"||o==="ArrowLeft"?c=r-d*(t&&o==="ArrowLeft"?-1:1):o==="PageUp"?h&&(c=r+h):o==="PageDown"?h&&(c=r-h):o==="Home"?c=n:o==="End"&&(c=a),isNaN(c))return;e.preventDefault();const m=Number(c.toFixed(w(d)));this.setValue({[i]:this.clamp(m,i)})}pointerDownHandler(e){if(this.disabled||!_(e))return;const t=e.clientX||e.pageX,i=this.translate(t);let a="value";V(this.value)&&(i>=this.minValue&&i<=this.maxValue&&this.lastDragProp==="minMaxValue"?a="minMaxValue":a=Math.abs(this.maxValue-i)this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(i,a)}),this.focusActiveHandle(t)}handleTouchStart(e){e.preventDefault()}async setFocus(){await re(this);const e=this.minHandle?this.minHandle:this.maxHandle;e==null||e.focus()}setValueFromMinMax(){const{minValue:e,maxValue:t}=this;typeof e=="number"&&typeof t=="number"&&(this.value=[e,t])}setMinMaxFromValue(){const{value:e}=this;V(e)&&(this.minValue=e[0],this.maxValue=e[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return V(this.value)?this.hasHistogram&&this.maxValue===0||!this.hasHistogram&&this.minValue===0:!1}getTickDensity(){const e=(this.max-this.min)/this.ticks/ve;return e<1?1:e}generateTickValues(){const e=this.ticks??0;if(e<=0)return[];const t=[this.min],i=this.getTickDensity(),a=e*i;let n=this.min;for(;n{const n=e[a];t||(t=this[a]!==n),this[a]=n}),!t)return;this.dragProp||this.emitChange(),this.emitInput()}clamp(e,t){return e=ce(e,this.min,this.max),t==="maxValue"&&(e=Math.max(e,this.minValue)),t==="minValue"&&(e=Math.min(e,this.maxValue)),e}translate(e){const t=this.max-this.min,{left:i,width:a}=this.trackEl.getBoundingClientRect(),n=(e-i)/a,h=this.shouldMirror(),d=this.clamp(this.min+t*(h?1-n:n));let r=Number(d.toFixed(w(this.step)));return this.snap&&this.step&&(r=this.getClosestStep(r)),r}getClosestStep(e){if(e=Number(this.clamp(e).toFixed(w(this.step))),this.step){const t=Math.round(e/this.step)*this.step;e=Number(this.clamp(t).toFixed(w(this.step)))}return e}getClosestHandle(e){return this.getDistanceX(this.maxHandle,e)>this.getDistanceX(this.minHandle,e)?this.minHandle:this.maxHandle}getDistanceX(e,t){return Math.abs(e.getBoundingClientRect().left-t)}getFontSizeForElement(e){return Number(window.getComputedStyle(e).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(e){e=this.clamp(e);const t=this.max-this.min;return(e-this.min)/t}adjustHostObscuredHandleLabel(e){const t=this.el.shadowRoot.querySelector(`.handle__label--${e}`),i=this.el.shadowRoot.querySelector(`.handle__label--${e}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${e}.transformed`),n=i.getBoundingClientRect(),h=this.getHostOffset(n.left,n.right);t.style.transform=`translateX(${h}px)`,a.style.transform=`translateX(${h}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:e}=this.el,t=this.shouldMirror(),i=t?"value":"minValue",a=t?"minValue":"value",n=e.querySelector(`.handle__label--${i}`),h=e.querySelector(`.handle__label--${i}.static`),d=e.querySelector(`.handle__label--${i}.transformed`),r=this.getHostOffset(h.getBoundingClientRect().left,h.getBoundingClientRect().right),o=e.querySelector(`.handle__label--${a}`),c=e.querySelector(`.handle__label--${a}.static`),m=e.querySelector(`.handle__label--${a}.transformed`),u=this.getHostOffset(c.getBoundingClientRect().left,c.getBoundingClientRect().right),p=this.getFontSizeForElement(n),g=this.getRangeLabelOverlap(d,m),f=n,v=p/2;if(g>0){if(f.classList.add("hyphen","hyphen--wrap"),u===0&&r===0){let b=g/2-v;b=Math.sign(b)===-1?Math.abs(b):-b;const k=this.getHostOffset(d.getBoundingClientRect().left+b-v,d.getBoundingClientRect().right+b-v);let x=g/2;const y=this.getHostOffset(m.getBoundingClientRect().left+x,m.getBoundingClientRect().right+x);k!==0&&(b+=k,x+=k),y!==0&&(b+=y,x+=y),n.style.transform=`translateX(${b}px)`,d.style.transform=`translateX(${b-v}px)`,o.style.transform=`translateX(${x}px)`,m.style.transform=`translateX(${x}px)`}else if(r>0||u>0)n.style.transform=`translateX(${r+v}px)`,o.style.transform=`translateX(${g+u}px)`,m.style.transform=`translateX(${g+u}px)`;else if(r<0||u<0){let b=Math.abs(r)+g-v;b=Math.sign(b)===-1?Math.abs(b):-b,n.style.transform=`translateX(${b}px)`,d.style.transform=`translateX(${b-v}px)`}}else f.classList.remove("hyphen","hyphen--wrap"),n.style.transform=`translateX(${r}px)`,d.style.transform=`translateX(${r}px)`,o.style.transform=`translateX(${u}px)`,m.style.transform=`translateX(${u}px)`}hideObscuredBoundingTickLabels(){const e=V(this.value);if(!this.hasHistogram&&!e&&!this.labelHandles&&!this.precise||!this.hasHistogram&&!e&&this.labelHandles&&!this.precise||!this.hasHistogram&&!e&&!this.labelHandles&&this.precise||!this.hasHistogram&&!e&&this.labelHandles&&this.precise||!this.hasHistogram&&e&&!this.precise||this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),i=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),n=this.el.shadowRoot.querySelector(".tick__label--max");!t&&i&&a&&n&&(a.style.opacity=this.isMinTickLabelObscured(a,i)?"0":"1",n.style.opacity=this.isMaxTickLabelObscured(n,i)?"0":"1"),t&&i&&a&&n&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,i)?"0":"1",n.style.opacity=this.isMaxTickLabelObscured(n,t)||this.isMaxTickLabelObscured(n,i)&&this.hasHistogram?"0":"1")}getHostOffset(e,t){const i=this.el.getBoundingClientRect(),a=7;return e+ai.right?-(t-i.right)+a:0}getRangeLabelOverlap(e,t){const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),n=this.getFontSizeForElement(e),h=i.right+n-a.left;return Math.max(h,0)}isMinTickLabelObscured(e,t){const i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return P(i,a)}isMaxTickLabelObscured(e,t){const i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return P(i,a)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{histogram:["histogramWatcher"],ticks:["ticksWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}static get style(){return xe}},[17,"calcite-slider",{disabled:[516],form:[513],groupSeparator:[516,"group-separator"],hasHistogram:[1540,"has-histogram"],histogram:[16],histogramStops:[16],labelHandles:[516,"label-handles"],labelTicks:[516,"label-ticks"],max:[514],maxLabel:[1,"max-label"],maxValue:[1026,"max-value"],min:[514],minLabel:[1,"min-label"],minValue:[1026,"min-value"],mirrored:[516],name:[513],numberingSystem:[1,"numbering-system"],pageStep:[514,"page-step"],precise:[516],required:[516],snap:[516],step:[514],ticks:[514],value:[1538],scale:[513],effectiveLocale:[32],minMaxValueRange:[32],minValueDragRange:[32],maxValueDragRange:[32],tickValues:[32],setFocus:[64]},[[0,"keydown","keyDownHandler"],[1,"pointerdown","pointerDownHandler"]]]);function I(){if(typeof customElements>"u")return;["calcite-slider","calcite-graph"].forEach(t=>{switch(t){case"calcite-slider":customElements.get(t)||customElements.define(t,E);break;case"calcite-graph":customElements.get(t)||O();break}})}I();const Se=E,Pe=I;export{Se as CalciteSlider,Pe as defineCustomElement}; diff --git a/dist/assets/calcite-tooltip-DucKIjb_.js b/dist/assets/calcite-tooltip-DucKIjb_.js new file mode 100644 index 0000000..90dcc72 --- /dev/null +++ b/dist/assets/calcite-tooltip-DucKIjb_.js @@ -0,0 +1,5 @@ +import{q as g,H as T,r as l,t as r,v as E,x as w,z as C,B as y,D as H}from"./index-J0iiHjMT.js";import{c as b,d as L,a as k,r as O,F as d}from"./floating-ui-McpI0u1Z.js";import{g as R}from"./guid-6vN-YNJI.js";import{o as c}from"./openCloseComponent-yw47Oy2q.js";import{F as S}from"./FloatingArrow-BghsONry.js";import"./debounce-HnHf1UOZ.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const x={container:"container"},D=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?C(o,{id:e}):e)||null}class P{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.hoveredTooltip=null,this.clickedTooltip=null,this.activeTooltip=null,this.registeredElementCount=0,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(s=>t.has(s));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t!=null&&t.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this;if((i==null?void 0:i.open)&&t.includes(i)){this.clearHoverTimeout();return}const n=this.queryTooltip(t);this.hoveredTooltip=n,!this.isClosableClickedTooltip(n)&&(this.clickedTooltip=null,n?this.openHoveredTooltip(n):i&&this.closeHoveredTooltip())},this.pointerDownHandler=e=>{if(!y(e))return;const t=this.queryTooltip(e.composedPath());this.clickedTooltip=t,t!=null&&t.closeOnClick&&(this.toggleTooltip(t,!1),this.clearHoverTimeout())},this.focusInHandler=e=>{this.queryFocusedTooltip(e,!0)},this.focusOutHandler=e=>{this.queryFocusedTooltip(e,!1)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.activeTooltip!==this.hoveredTooltip&&(this.closeActiveTooltip(),e===this.hoveredTooltip&&this.toggleTooltip(e,!0)))},this.activeTooltip?0:D)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0}),e.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0}),e.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}addListeners(){document.addEventListener("keydown",this.keyDownHandler,{capture:!0}),document.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.addEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.addEventListener("focusin",this.focusInHandler,{capture:!0}),document.addEventListener("focusout",this.focusOutHandler,{capture:!0})}removeListeners(){document.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),document.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),document.removeEventListener("pointerdown",this.pointerDownHandler,{capture:!0}),document.removeEventListener("focusin",this.focusInHandler,{capture:!0}),document.removeEventListener("focusout",this.focusOutHandler,{capture:!0})}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeActiveTooltip(){const{activeTooltip:e}=this;e!=null&&e.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){this.closeActiveTooltip(),t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}queryFocusedTooltip(e,t){const i=this.queryTooltip(e.composedPath());!i||this.isClosableClickedTooltip(i)||this.toggleFocusedTooltip(i,t)}isClosableClickedTooltip(e){return(e==null?void 0:e.closeOnClick)&&e===this.clickedTooltip}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=(t.get(e)??0)+1;i===1&&this.addShadowListeners(e),t.set(e,i)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e)-1;i===0&&this.removeShadowListeners(e),t.set(e,i)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const z=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-app-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-app-z-index) * -1);fill:var(--calcite-ui-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-ui-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}:host([hidden]){display:none}[hidden]{display:none}",u=new P,p=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${R()}`,this.hasLoaded=!1,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),b(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),u.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),u.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=L,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(o){c(this),o&&this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(this.hasLoaded),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(!0),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),k(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:s,offsetDistance:n,offsetSkidding:a,arrowEl:v}=this;return O(this,{floatingEl:e,referenceEl:t,overlayPositioning:s,placement:i,offsetDistance:n,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,s=o&&t,n=!s;return r(w,{"aria-hidden":E(n),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":n,id:this.getId(),role:"tooltip"},r("div",{class:{[d.animation]:!0,[d.animationActive]:s},ref:this.setTransitionEl},r(S,{floatingLayout:i,ref:a=>this.arrowEl=a}),r("div",{class:x.container},r("slot",null))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]}]);function m(){if(typeof customElements>"u")return;["calcite-tooltip"].forEach(e=>{switch(e){case"calcite-tooltip":customElements.get(e)||customElements.define(e,p);break}})}m();const U=p,Y=m;export{U as CalciteTooltip,Y as defineCustomElement}; diff --git a/dist/assets/chartCommon-ZPkVkRIK.js b/dist/assets/chartCommon-ZPkVkRIK.js new file mode 100644 index 0000000..7ec79cf --- /dev/null +++ b/dist/assets/chartCommon-ZPkVkRIK.js @@ -0,0 +1 @@ +import{Q as v,b as w,W as x,g as f,l as m,i as T,t as B}from"./Theme-QNc_77AM.js";import{l as R,d as j}from"./Responsive-QKXcW_1q.js";import{n as y,o as P}from"./Button-1STHXt3M.js";import{u as E}from"./Tooltip-lrFZgXdG.js";import{s as F}from"./ColorSet-j9kKRPwP.js";import"./index-J0iiHjMT.js";class c extends v{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=w(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=y.new(this._root,{themeTags:w(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(P.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:x.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(y.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,e=this.endGrip,i=this.thumb,r=this.get("background");r&&this._disposers.push(r.events.on("click",s=>{this.setPrivateRaw("isBusy",!0);const a=this._display.toLocal(s.point),h=this.width(),o=this.height(),u=this.get("orientation");let n,d,p;n=u=="vertical"?(a.y-i.height()/2)/o:(a.x-i.width()/2)/h,u=="vertical"?(d=n*o,p="y"):(d=n*h,p="x");const l=this.get("animationDuration",0);l>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:p,to:d,duration:l,easing:this.get("animationEasing")}))):(this.thumb.set(p,d),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(i.events.on("dblclick",s=>{if(!f(s.originalEvent,this))return;const a=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:a,easing:h}),this.animate({key:"end",to:1,duration:a,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(e.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&this.setPrivateRaw("isBusy",!1),this._startDown=!1})),this._disposers.push(e.events.on("globalpointerup",()=>{this._endDown&&this.setPrivateRaw("isBusy",!1),this._endDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._thumbDown&&this.setPrivateRaw("isBusy",!1),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(e.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(e.on("y",()=>{this._updateThumb()})),this._disposers.push(i.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),e.set("x",0),this._disposers.push(i.adapters.add("y",s=>Math.max(Math.min(Number(s),this.height()-i.height()),0))),this._disposers.push(i.adapters.add("x",s=>this.width()/2)),this._disposers.push(t.adapters.add("x",s=>this.width()/2)),this._disposers.push(e.adapters.add("x",s=>this.width()/2)),this._disposers.push(t.adapters.add("y",s=>Math.max(Math.min(Number(s),this.height()),0))),this._disposers.push(e.adapters.add("y",s=>Math.max(Math.min(Number(s),this.height()),0)))):(t.set("y",0),e.set("y",0),this._disposers.push(i.adapters.add("x",s=>Math.max(Math.min(Number(s),this.width()-i.width()),0))),this._disposers.push(i.adapters.add("y",s=>this.height()/2)),this._disposers.push(t.adapters.add("y",s=>this.height()/2)),this._disposers.push(e.adapters.add("y",s=>this.height()/2)),this._disposers.push(t.adapters.add("x",s=>Math.max(Math.min(Number(s),this.width()),0))),this._disposers.push(e.adapters.add("x",s=>Math.max(Math.min(Number(s),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}updateGrips(){const t=this.startGrip,e=this.endGrip,i=this.get("orientation"),r=this.height(),s=this.width();i=="vertical"?(t.set("y",r*this.get("start",0)),e.set("y",r*this.get("end",1))):(t.set("x",s*this.get("start",0)),e.set("x",s*this.get("end",1)));const a=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),o=Math.round(100*this.get("end",0));let u,n;a?(u=a.call(this,this.get("start",0)),n=a.call(this,this.get("end",0))):(u=h+"%",n=o+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),e.set("ariaLabel",this._t("To %1",void 0,n)),e.set("ariaValueNow",""+o),e.set("ariaValueText",o+"%"),e.set("ariaValueMin","0"),e.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,e=this.startGrip,i=this.endGrip,r=this.height(),s=this.width();let a=e.x(),h=i.x(),o=e.y(),u=i.y(),n=0,d=1;this.get("orientation")=="vertical"?m(o)&&m(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-o),t.set("y",o)),n=o/r,d=u/r):m(a)&&m(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-a),t.set("x",a)),n=a/s,d=h/s),!this.getPrivate("isBusy")||this.get("start")==n&&this.get("end")==d||(this.set("start",n),this.set("end",d));const p=this.getPrivate("positionTextFunction"),l=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let g,b;p?(g=p.call(this,this.get("start",0)),b=p.call(this,this.get("end",0))):(g=l+"%",b=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,g,b)),t.set("ariaValueNow",""+l),t.set("ariaValueText",l+"%")}_updateGripsByThumb(){const t=this.thumb,e=this.startGrip,i=this.endGrip;if(this.get("orientation")=="vertical"){const r=t.height();e.set("y",t.y()),i.set("y",t.y()+r)}else{const r=t.width();e.set("x",t.x()),i.set("x",t.x()+r)}}}Object.defineProperty(c,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(c,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:v.classNames.concat([c.className])});const N=class extends T{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}},G=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(_=>B(_));export{N as AnimatedThemeAm5,F as ColorSetAm5,R as DarkThemeAm5,j as ResponsiveThemeAm5,c as ScrollbarAm5,T as ThemeAm5,E as TooltipAm5,B as colorAm5,G as esriChartColorSet}; diff --git a/dist/assets/chartUtils-P39aKol1.js b/dist/assets/chartUtils-P39aKol1.js new file mode 100644 index 0000000..b450c4d --- /dev/null +++ b/dist/assets/chartUtils-P39aKol1.js @@ -0,0 +1,2 @@ +import{d as F,l as _}from"./Responsive-QKXcW_1q.js";import{s as N,hv as q,hw as $,fv as R,gL as v,hx as G,hy as J,hz as K,cy as O,hA as Q,d8 as ee,hB as ie,hC as te,a2 as ne,hD as P,hE as oe}from"./index-J0iiHjMT.js";import{Y as ae,S as se}from"./chartUtilsAm5-QfmFJ3lc.js";import{o as le,u as Y,_ as re,b as de,r as ce,x as ue}from"./LineSeries-VcEznTH7.js";import{a2 as b,t as x,Y as pe,Z as xe}from"./Theme-QNc_77AM.js";import{u as W}from"./Tooltip-lrFZgXdG.js";import"./DefaultTheme-T7-VnRhA.js";import"./ColorSet-j9kKRPwP.js";import"./Tick-WQ_bPwW2.js";import"./Button-1STHXt3M.js";function fe(e,n,t=10){const i=X(n-e,!1);if(i===0)return[e,n];const o=X(i/(t-1),!0);return[Math.floor(e/o)*o,Math.ceil(n/o)*o]}function X(e,n){const t=Math.floor(Math.log10(e)),i=e/10**t;let o;return o=n?i<1.5?1:i<3?2:i<5?2.5:i<7?5:10:i<=1?1:i<=2?2:i<=3?2.5:i<=5?5:10,o*10**t}const A="#f8f8f8",E="#a9a9a9",g="#323232",me="line",ge="fill",h=15,m=12,z=.001,he=.1,Ae=.02,I={fontFamily:"Avenir Next",paddingBottom:m/2,paddingLeft:0,paddingRight:0,paddingTop:0,axisGridStroke:"#f4f4f4",axisLabelsFontSize:9,axisLabelsFontWeight:"400",axisLabelsColor:E,axisTooltipFontSize:12,axisTooltipBackgroundColor:g,axisTooltipLabelColor:A,axisTooltipPaddingTop:Math.round(m/4),axisTooltipPaddingBottom:Math.round(m/4),axisTooltipPaddingHorizontal:Math.round(h/4),xAxisMinGridDistance:50,xAxisLabelsSpacing:Math.round(m/2),xAxisMinLabelPosition:.05,xAxisMaxLabelPosition:.9,yAxisMinGridDistance:30,yAxisLabelSpacing:Math.round(h/4),yAxisMinLabelPosition:0,yAxisMaxLabelPosition:.8,seriesTooltipFontSize:12,seriesTooltipBackgroundColor:A,seriesTooltipLabelColor:g,seriesFillLighten:.9,seriesTooltipSpacing:m/2,seriesTooltipPaddingVertical:Math.round(h/4),seriesTooltipPaddingHorizontal:Math.round(h/4)},ve={...I,axisGridStroke:g,axisLabelsColor:E,axisTooltipBackgroundColor:g,axisTooltipLabelColor:A,seriesTooltipBackgroundColor:g,seriesTooltipLabelColor:A,seriesFillLighten:-.75},y={minX:void 0,maxX:void 0,minY:void 0,maxY:void 0};async function je(e){const n=await ae(e.container);N(e.abortOptions);const t=q(),i=t?ve:I;n.setThemes(t?[F.new(n),_.new(n)]:[F.new(n)]);const o=$(e.container),a=n.container.children.push(le.new(n,{panX:!0,panY:!0,paddingTop:i.paddingTop,paddingBottom:i.paddingBottom,paddingLeft:o?i.paddingRight:i.paddingLeft,paddingRight:o?i.paddingLeft:i.paddingRight,maxTooltipDistance:0}));a.zoomOutButton.set("forceHidden",!0);const s=a.xAxes.push(Y.new(n,{renderer:re.new(n,{})})),l=a.yAxes.push(Y.new(n,{renderer:de.new(n,{})})),c=P(null),r=P("loading"),d={params:e,chart:a,xAxis:s,yAxis:l,seriesInfos:new Map,messages:null,theme:i,pointerIsOver:!1,get state(){return r.value},get data(){return c.value},set data(u){c.value=u}};ye(d),Te(d),be(d);const p=R([Ce(d,e.onRangeChange),ke(d,e.onCursorPositionChange),L(n.events.once("frameended",()=>{r.value="ready"})),L(n)]);return{destroy:()=>{p.remove(),r.value="destroyed"},update:u=>{u.data===d.data&&u.messages===d.messages||M(d)||Le(d,u)},zoomOut:()=>V(d)}}function M(e){return e.state==="destroyed"}function be({chart:e,xAxis:n,yAxis:t}){const i=ce.new(e.root,{behavior:"none",xAxis:n,yAxis:t});i.lineY.set("visible",!1),e.set("cursor",i)}function ye(e){var s;const{chart:n,xAxis:t,theme:i}=e;t.setAll({extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:U(e,"distance"),strictMinMax:!0,strictMinMaxSelection:!0}),t.axisHeader.set("forceHidden",!0);const o=t.get("renderer");o.setAll({inside:!1,minGridDistance:i.xAxisMinGridDistance}),o.labels.template.setAll({centerX:b,centerY:b,fill:x(i.axisLabelsColor),fontFamily:i.fontFamily,fontSize:i.axisLabelsFontSize,fontWeight:i.axisLabelsFontWeight,maxPosition:i.xAxisMaxLabelPosition,minPosition:i.xAxisMinLabelPosition,paddingLeft:0,paddingRight:0,paddingTop:i.xAxisLabelsSpacing});const a=t.set("tooltip",W.new(n.root,{paddingBottom:0,paddingLeft:0,paddingRight:0,paddingTop:0}));(s=a.get("background"))==null||s.setAll({fill:x(i.axisTooltipBackgroundColor),stroke:void 0}),a.label.setAll({fill:x(i.axisTooltipLabelColor),fontFamily:i.fontFamily,fontSize:i.axisTooltipFontSize,paddingBottom:i.axisTooltipPaddingBottom,paddingLeft:i.axisTooltipPaddingHorizontal,paddingRight:i.axisTooltipPaddingHorizontal,paddingTop:i.axisTooltipPaddingTop}),o.grid.template.setAll({strokeOpacity:1,stroke:x(i.axisGridStroke)})}function Te(e){const{yAxis:n,theme:t}=e;n.setAll({baseValue:v().noDataValue,extraMax:0,extraMin:0,maxDeviation:0,numberFormatter:U(e,"elevation"),strictMinMax:!0,strictMinMaxSelection:!0,tooltip:void 0}),n.axisHeader.set("visible",!1);const i=$(e.params.container),o=n.get("renderer");o.setAll({minGridDistance:t.yAxisMinGridDistance,opposite:i,inside:!0}),o.labels.template.setAll({centerX:b,centerY:pe,fill:x(t.axisLabelsColor),fontFamily:t.fontFamily,fontSize:t.axisLabelsFontSize,fontWeight:t.axisLabelsFontWeight,maxPosition:t.yAxisMaxLabelPosition,minPosition:t.yAxisMinLabelPosition,paddingBottom:0,paddingLeft:i?0:t.yAxisLabelSpacing,paddingRight:i?t.yAxisLabelSpacing:0,paddingTop:0,textAlign:"start"}),o.grid.template.setAll({strokeOpacity:1,stroke:x(t.axisGridStroke)})}function Le(e,n){var l;if(M(e))return;const t=e.data??void 0,i=n.data??void 0;(l=e.chart.get("cursor"))==null||l.set("forceHidden",!(i!=null&&i.refined));const o=t!==i,a=(t==null?void 0:t.effectiveUnits)!==(i==null?void 0:i.effectiveUnits),s=(t==null?void 0:t.uniformScaling)!==(i==null?void 0:i.uniformScaling);e.data=i,e.messages=n.messages,(o||a)&&(Me(e),Pe(e)),s&&V(e),T(e)}function V(e){M(e)||(e.xAxis.zoom(0,1),e.yAxis.zoom(0,1))}function Me(e){const{chart:n,data:t,xAxis:i,yAxis:o}=e,{minX:a,maxX:s,minY:l,maxY:c}=Se({data:t,pixelWidth:i.width(),pixelHeight:o.height()}),r=!!(t!=null&&t.uniformScaling),d=!!(t!=null&&t.refined);n.setAll({panX:!0,panY:r,pinchZoomX:d,pinchZoomY:d&&r,wheelX:"panX",wheelY:d?r?"zoomXY":"zoomX":"none"}),i.setAll({max:s,min:a,panX:!0,panY:!1,zoomX:!0,zoomY:r}),o.setAll({max:c,min:l,panX:!1,panY:r,zoomX:r,zoomY:r})}function Se({data:e,pixelWidth:n,pixelHeight:t}){if(e==null)return y;const i=e.statistics,o=0,a=i==null?void 0:i.maxDistance;let s=i==null?void 0:i.minElevation,l=i==null?void 0:i.maxElevation;if(a==null||s==null||l==null)return y;const c=Math.max(a-o,z);let r=Math.max(l-s,z);const d=e.effectiveUnits;if(e.dynamicElevationRange){const p=G(c,d.distance,d.elevation);r=Math.max(r,p/v().maxChartRatio)}return s-=Ae*r,l=s+r+he*r,[s,l]=fe(s,l,10),r=l-s,e.uniformScaling?Fe({data:e,bounds:{minX:o,maxX:a,minY:s,maxY:l},pixelWidth:n,pixelHeight:t,centered:!0}):{minX:o,maxX:o+c,minY:s,maxY:s+r}}function Fe({data:e,bounds:n,pixelWidth:t,pixelHeight:i,centered:o}){if(e==null)return n;let{minX:a,maxX:s,minY:l,maxY:c}=n;if(a==null||s==null||l==null||c==null)return y;const r=s-a,d=c-l,p=e.effectiveUnits,u=G(d,p.elevation,p.distance)/i/(r/t);return u>=1?[a,s]=C([a,s],u,o):[l,c]=C([l,c],1/u,o),{minX:a,maxX:s,minY:l,maxY:c}}function C([e,n],t,i){const o=(n-e)*t;if(i){const a=(e+n)/2-o/2;return[a,a+o]}return[e,e+o]}function Pe(e){var r;const{chart:n,data:t,seriesInfos:i,xAxis:o,yAxis:a}=e;if(t==null||t.lines.length===0)return void n.series.clear();const s=new Map,l=new Set(n.series.values),c=t.lines.length;for(let d=0;d0,{line:s,fill:l}=n;s.set("visible",a),s.set("stroke",i),l==null||l.set("visible",a),l==null||l.set("fill",xe.lighten(i,e.seriesFillLighten)),s.data.setAll(o),l==null||l.data.setAll(o)}function Xe(e,n){const{id:t}=n,i=k(e,`${me}-${t}`);i.setAll({dy:n.chartStrokeOffsetY,tooltip:ze(e)}),i.strokes.template.setAll({strokeWidth:n.chartStrokeWidth});let o=null;return n.chartFillEnabled&&(o=k(e,`${ge}-${t}`),o.fills.template.setAll({fillOpacity:1,visible:!0})),{id:t,line:i,fill:o}}function k(e,n){return ue.new(e.chart.root,{connect:!1,excludeFromTotal:!0,fill:void 0,id:n,stroke:void 0,valueXField:"distance",valueYField:"elevation",xAxis:e.xAxis,yAxis:e.yAxis})}function ze({theme:e,chart:n}){var a;const t=W.new(n.root,{forceHidden:!0,getFillFromSprite:!1,getLabelFillFromSprite:!1,pointerOrientation:"vertical",visible:!1}),i=e.seriesTooltipPaddingHorizontal,o=e.seriesTooltipPaddingVertical;return t.label.setAll({fill:x(e.seriesTooltipLabelColor),fontFamily:e.fontFamily,fontSize:e.seriesTooltipFontSize,paddingBottom:o,paddingLeft:i,paddingRight:i,paddingTop:o,textAlign:"start"}),(a=t.get("background"))==null||a.setAll({stroke:void 0,fill:x(e.seriesTooltipBackgroundColor)}),t.adapters.add("dy",s=>{var r;const l=e.seriesTooltipSpacing,c=((r=t.get("pointTo"))==null?void 0:r.y)??0;return(s??0)+(t.y()>c?l:-l)}),t}function Ce(e,n){const{xAxis:t,yAxis:i}=e,o=()=>{n(w(t),w(i))},a=s=>[s.on("start",o),s.on("end",o)];return j([...a(t),...a(i)])}function w(e){const n=Math.abs((e.get("end")??0)-(e.get("start")??0)),t=n!==0?1/n:1;return Math.abs(1-t){e.pointerIsOver=r,T(e)},c=()=>{l(!1),n(null,null)};return j([a==null?void 0:a.events.on("cursormoved",()=>{if(!e.pointerIsOver)return;T(e);let r=(a==null?void 0:a.getPrivate("positionX"))??0,d=(a==null?void 0:a.getPrivate("positionY"))??0;const p=e.data;if((p==null?void 0:p.statistics)!=null){const{maxDistance:u,minElevation:f,maxElevation:S}=p.statistics;u!=null&&(r=B(r,H(i),D(i),0,u)),f!=null&&S!=null&&(d=B(d,H(o),D(o),f,S))}n(r,d)}),s.on("pointerover",()=>l(!0)),s.on("pointerout",c),s.on("blur",c)])}function B(e,n,t,i,o){return(n+e*(t-n)-i)/(o-i)}function T(e){const n=we(e);if(!n)return void e.seriesInfos.forEach(t=>{var i;(i=t.line.get("tooltip"))==null||i.set("forceHidden",!0)});e.seriesInfos.forEach(t=>{const i=t.line.get("tooltip");i.set("forceHidden",!1),i.label.set("text",n)}),e.xAxis.getTooltip().setAll({tooltipText:De(e)})}function we(e){const{data:n}=e,t=n==null?void 0:n.lines.map(i=>{var o;return{line:i,y:(o=Z(e,i))==null?void 0:o.elevation}}).sort(Be);return t&&t.length!==0&&t[0].y!=null?t.map(({y:i,line:o})=>He(e,o,i)).join(` +`):null}function Be({y:e},{y:n}){return e==null?1:n==null?-1:n-e}function He(e,n,t){const{data:i,messages:o}=e;if(i==null||o==null)return"";const a=v().formatPrecision,s=J(o.chartTooltip,{name:K(n,o),elevation:t!=null?O(o,t,i.effectiveUnits.elevation,a):Q});return`[${n.color.toHex()}]●[/] ${s}`}function De(e){const{data:n,messages:t}=e;if(n==null||t==null)return"";const i=n.lines[0],o=i?Z(e,i):null,a=v().formatPrecision;return o!=null?O(t,o.distance,n.effectiveUnits.distance,a):"-"}function U(e,n){const t=se.new(e.chart.root,{});return t.format=(i,o,a)=>{const{data:s,messages:l}=e;return l==null||s==null||typeof i=="string"?"":`${ee(i,{maximumFractionDigits:a})} ${ie(l,s.effectiveUnits[n],"abbr")}`},t}function Z({chart:e,xAxis:n},t){const i=t.samples??[];if(i.length===0)return null;const o=e.get("cursor"),a=(o==null?void 0:o.getPrivate("positionX"))??0,s=n.toAxisPosition(a),l=n.positionToValue(s);return te(i,l,c=>c.distance)}function H(e){return e.positionToValue(e.get("start")??0)}function D(e){return e.positionToValue(e.get("end")??1)}function j(e){return R(e.map(L))}function L(e){return ne(()=>{e==null||e.dispose()})}export{je as createChart,Se as getAdjustedBounds}; diff --git a/dist/assets/chartUtilsAm5-QfmFJ3lc.js b/dist/assets/chartUtilsAm5-QfmFJ3lc.js new file mode 100644 index 0000000..ff6d7e7 --- /dev/null +++ b/dist/assets/chartUtilsAm5-QfmFJ3lc.js @@ -0,0 +1,7 @@ +import{mF as nt,de as w}from"./index-J0iiHjMT.js";import{E as te,a3 as ot,a4 as pe,a5 as qe,a6 as De,J as lt,a7 as Q,a8 as K,q as ue,a9 as ht,aa as U,ab as ut,ac as ct,ad as dt,A as bt,ae as _t,m as v,af as ie,Q as q,z as Ze,Y as Z,V as ft,t as re,W as ze,ag as J,r as ge,c as A,ah as pt,ai as gt,aj as me,$ as se,ak as mt,al as X,y as Ce,am as yt,v as ae,an as Ie,ao as Te,a1 as vt,M as wt,ap as Je,l as H,aq as xt,ar as C,as as de,at as be,au as Re,av as Pt,aw as Fe,ax as Ot,ay as kt,az as V,aA as Ye,aB as Et,_ as Mt,aC as St,aD as Tt,Z as ee,aE as xe,aF as jt,H as He,aG as je,aH as Ke,D as Dt,aI as Ct,aJ as Qe,K as et,U as Bt,aK as At,aL as Lt,N as zt,aM as le,aN as Pe}from"./Theme-QNc_77AM.js";import{u as Ve}from"./Tooltip-lrFZgXdG.js";import{s as It}from"./DefaultTheme-T7-VnRhA.js";class Rt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{v(e,t=>{v(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),me(this._targets,t=>t.target!==e)}}class ye{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+ye.delay)&&(r=s,v(this._targets,n=>{let u=n.target.getBoundingClientRect();u.width===n.size.width&&u.height===n.size.height||(n.size=u,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){me(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(ye,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Oe=null;function Ft(){return Oe===null&&(Oe=typeof ResizeObserver<"u"?new Rt:new ye),Oe}class Yt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Ft(),this._element=e,this._listener=Je(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class fe extends te{}Object.defineProperty(fe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(fe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([fe.className])});class Ht extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||pe(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(qe(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=De(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(u.parsed)return;let h=u.source;h.toLowerCase()==="number"&&(h=this.get("numberFormat","#,###.#####"));let p=U.chunk(h,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){let c=Math.pow(10,t.decimals.passive);e=Math.round(e*c)/c}let n="",u=ht(e).split("."),h=u[0];if(h.length0){let c=[],b=h.split("").reverse().join("");for(let l=0,m=h.length;l<=m;l+=t.thousands.interval){let o=b.substr(l,t.thousands.interval).split("").reverse().join("");o!==""&&c.unshift(o)}h=c.join(t.thousands.separator)}n+=h,u.length===1&&u.push("");let p=u[1];return p.length{switch(p.type){case"year":t=+p.value;break;case"month":i=+p.value-1;break;case"day":r=+p.value;break;case"hour":a=+p.value;break;case"minute":s=+p.value;break;case"second":n=+p.value;break;case"fractionalSecond":u=+p.value;break;case"weekday":switch(p.value){case"Sun":h=0;break;case"Mon":h=1;break;case"Tue":h=2;break;case"Wed":h=3;break;case"Thu":h=4;break;case"Fri":h=5;break;case"Sat":h=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:u,weekday:h}}function We(d,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:u}=tt(d,e);return Date.UTC(t,i,r,a,s,n,u)}class Vt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(We(this._utc,e)-We(this._dtf,e))/6e4}parseDate(e){return tt(this._dtf,e)}}class Wt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t){let i;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let r=e;if(qe(t))try{const n=this.get("intlLocales");return n?new Intl.DateTimeFormat(n,t).format(r):new Intl.DateTimeFormat(void 0,t).format(r)}catch{return"Invalid"}let a=this.parseFormat(t);const s=this._root.timezone;return s&&!this._root.utc&&(r=s.convertLocal(r)),H(r.getTime())?(i=this.applyFormat(r,a),this.get("capitalize")&&(i=i.replace(/^.{1}/,i.substr(0,1).toUpperCase())),i):"Invalid date"}applyFormat(e,t){let i,r,a,s,n,u,h,p,c=t.template,b=e.getTime();this._root.utc?(i=e.getUTCFullYear(),r=e.getUTCMonth(),a=e.getUTCDay(),s=e.getUTCDate(),n=e.getUTCHours(),u=e.getUTCMinutes(),h=e.getUTCSeconds(),p=e.getUTCMilliseconds()):(i=e.getFullYear(),r=e.getMonth(),a=e.getDay(),s=e.getDate(),n=e.getHours(),u=e.getMinutes(),h=e.getSeconds(),p=e.getMilliseconds());for(let l=0,m=t.parts.length;l=12?this._t("PM"):this._t("AM");break;case"aa":o=n>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":o=n>=12?this._t("P"):this._t("A");break;case"h":o=be(n).toString();break;case"hh":o=C(be(n),2,"0");break;case"H":o=n.toString();break;case"HH":o=C(n,2,"0");break;case"K":o=be(n,0).toString();break;case"KK":o=C(be(n,0),2,"0");break;case"k":o=(n+1).toString();break;case"kk":o=C(n+1,2,"0");break;case"m":o=u.toString();break;case"mm":o=C(u,2,"0");break;case"s":o=h.toString();break;case"ss":o=C(h,2,"0");break;case"S":case"SS":case"SSS":o=Math.round(p/1e3*Math.pow(10,t.parts[l].length)).toString();break;case"x":o=b.toString();break;case"n":case"nn":case"nnn":o=C(p,t.parts[l].length,"0");break;case"z":o=de(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zz":o=de(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":o=de(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzzz":o=de(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let g=this._root.utc?"UTC":this._root.timezone;g instanceof Vt&&(g=g.name);const x=g?xt(g):e.getTimezoneOffset();let y=Math.abs(x)/60,_=Math.floor(y),P=60*y-60*_;this._root.utc&&(_=0,P=0),t.parts[l]=="Z"?(o="GMT",o+=x>0?"-":"+",o+=C(_,2)+":"+C(P,2)):(o=x>0?"-":"+",o+=C(_,2)+C(P,2));break;case"i":o=e.toISOString();break;case"I":o=e.toUTCString()}c=c.replace(Q,o)}return c}parseFormat(e){let t={template:"",parts:[]},i=U.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let b=parseInt(c[s.year3]);b+=1e3,n.year=b}if(s.year2>-1){let b=parseInt(c[s.year2]);b+=b>50?1e3:2e3,n.year=b}if(s.year1>-1){let b=parseInt(c[s.year1]);b=10*Math.floor(new Date().getFullYear()/10)+b,n.year=b}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=kt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let b=parseInt(c[s.hour12Base0]);b==11&&(b=0),s.am>-1&&!this.isAm(c[s.am])&&(b+=12),n.hour=b}if(s.hour12Base1>-1){let b=parseInt(c[s.hour12Base1]);b==12&&(b=0),s.am>-1&&!this.isAm(c[s.am])&&(b+=12),n.hour=b}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let b=parseInt(c[s.millisecond]);s.millisecondDigits==2?b*=10:s.millisecondDigits==1&&(b*=100),n.millisecond=b}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const b=new Date(n.timestamp);n.year=b.getUTCFullYear(),n.month=b.getUTCMonth(),n.day=b.getUTCDate(),n.hour=b.getUTCHours(),n.minute=b.getUTCMinutes(),n.second=b.getUTCSeconds(),n.millisecond=b.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let u=n.source,h=[];h=n.source.match(/^\[([^\]]*)\]/),h&&h.length&&h[0]!==""&&(u=n.source.substr(h[0].length),n.color=h[1]);let p=U.chunk(u,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const it={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(d){let e="th";if(d<11||d>13)switch(d%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class $t extends te{_setDefaults(){this.setPrivate("defaultLocale",it),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Mt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class ke{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Xt=function(){function d(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,u=e[Symbol.iterator]();!(r=(n=u.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(h){a=!0,s=h}finally{try{!r&&u.return&&u.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return d(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Ee=function(d,e,t,i,r,a,s){var n=d.x,u=d.y;return{x:i*(n*=e)-r*(u*=t)+a,y:r*n+i*u+s}},Nt=function(d,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(d),r=Math.sin(d),a=Math.cos(d+e),s=Math.sin(d+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},Ue=function(d,e,t,i){var r=d*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(d*i-e*t<0?-1:1)*Math.acos(r)},Gt=function(d,e,t,i,r,a,s,n,u,h,p,c){var b=Math.pow(r,2),l=Math.pow(a,2),m=Math.pow(p,2),o=Math.pow(c,2),f=b*l-b*o-l*m;f<0&&(f=0),f/=b*o+l*m;var g=(f=Math.sqrt(f)*(s===n?-1:1))*r/a*c,x=f*-a/r*p,y=h*g-u*x+(d+t)/2,_=u*g+h*x+(e+i)/2,P=(p-g)/r,E=(c-x)/a,S=(-p-g)/r,T=(-c-x)/a,D=Ue(1,0,P,E),O=Ue(P,E,S,T);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[y,_,D,O]},qt=function(d){var e=d.px,t=d.py,i=d.cx,r=d.cy,a=d.rx,s=d.ry,n=d.xAxisRotation,u=n===void 0?0:n,h=d.largeArcFlag,p=h===void 0?0:h,c=d.sweepFlag,b=c===void 0?0:c,l=[];if(a===0||s===0)return[];var m=Math.sin(u*he/360),o=Math.cos(u*he/360),f=o*(e-i)/2+m*(t-r)/2,g=-m*(e-i)/2+o*(t-r)/2;if(f===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var x=Math.pow(f,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);x>1&&(a*=Math.sqrt(x),s*=Math.sqrt(x));var y=Gt(e,t,i,r,a,s,p,b,m,o,f,g),_=Xt(y,4),P=_[0],E=_[1],S=_[2],T=_[3],D=Math.abs(T)/(he/4);Math.abs(1-D)<1e-7&&(D=1);var O=Math.max(Math.ceil(D),1);T/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(d.splice(t,0,r[1]),++t,d.splice(t,0,r[2]),++t,r[3].length>0?d[t]=r[3]:d.splice(t,1))}if(++t,i=d[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(d.splice(t,0,r[1]),++t,d[t]=r[2])}}}function $e(d){if(d===0||d===1)return d;throw new Error("Flag must be 0 or 1")}function Kt(d){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&d,d>>=1;return(0|e[2])+(e[1]<<8)+(e[0]<<16)}function _e(d,e){for(;(!d.interactive||e(d))&&d._parent;)d=d._parent}function Qt(d,e,t){return A(d,je(e),i=>{const r=Ke(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(Dt(a),r)):t([i],r)})}function Xe(d){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(d,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+d.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(d){d.width=0,d.height=0,d.style.width="0px",d.style.height="0px"}class ei{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class ve extends Lt{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ei}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new ke}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&J(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(){return this.inactive==0&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(){return this._isInteractive()}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Math.floor(r)+.5,a=Math.floor(a)+.5),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this._renderer.resolution,i=this._renderer.layers,r=this._renderer._ghostLayer,a=r.context,s=this.mask;s&&s._setMatrix(),v(i,n=>{if(n){const u=n.context;u.save(),s&&(s._transformLayer(u,t,n),s._runPath(u),u.clip()),u.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(u,t,n),this.filter&&(u.filter=this.filter)}}),a.save(),s&&this._isInteractiveMask()&&(s._transformMargin(a,t,r.margin),s._runPath(a),a.clip()),this._transformMargin(a,t,r.margin),this._render(e),a.restore(),v(i,n=>{n&&n.context.restore()})}}_render(e){this.exportable===!1&&((this._layer||e).tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class ti extends ve{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(){return this.interactiveChildren||super._isInteractiveMask()}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ce(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive;const i=this._layer||e;v(this._children,r=>{r.compoundAlpha=this.compoundAlpha*this.alpha,r.render(i)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),Te(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&v(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&v(this._childLayers,e=>{e.dirty=!0})}}function M(d,e){d.left=Math.min(d.left,e.x),d.top=Math.min(d.top,e.y),d.right=Math.max(d.right,e.x),d.bottom=Math.max(d.bottom,e.y)}class j{colorize(e,t){}path(e){}addBounds(e){}}class ii extends j{colorize(e,t){e.beginPath()}}class Me extends j{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class ri extends j{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class si extends j{colorize(e,t){e.stroke()}}class Se extends j{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ai extends j{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class ni extends j{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class oi extends j{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;M(e,{x:t,y:i}),M(e,{x:r,y:i}),M(e,{x:t,y:a}),M(e,{x:r,y:a})}}class li extends j{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){M(e,{x:this.x-this.radius,y:this.y-this.radius}),M(e,{x:this.x+this.radius,y:this.y+this.radius})}}class hi extends j{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){M(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),M(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class ui extends j{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=zt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);M(e,{x:t.left,y:t.top}),M(e,{x:t.right,y:t.bottom})}}class ci extends j{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class di extends j{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){M(e,{x:this.x,y:this.y})}}class bi extends j{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){M(e,{x:this.x,y:this.y})}}class _i extends j{path(e){e.closePath()}}class fi extends j{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){M(e,{x:this.cpX,y:this.cpY}),M(e,{x:this.cpX2,y:this.cpY2}),M(e,{x:this.toX,y:this.toY})}}class pi extends j{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){M(e,{x:this.cpX,y:this.cpY}),M(e,{x:this.toX,y:this.toY})}}class gi extends j{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}}class mi extends j{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){M(e,{x:this.x,y:this.y}),M(e,{x:this.width,y:this.height})}}class yi extends ve{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:Ct.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof ee?this._pushOp(new Me(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Me(e))):this._pushOp(new Me("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new ri(this._hasShadows))}endStroke(){this._pushOp(new si)}beginPath(){this._pushOp(new ii)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof ee?this._pushOp(new Se(e,t.toCSS(i),r)):this._pushOp(new Se(e,t,r)):this._pushOp(new Se(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ai(e||[]))}setLineDashOffset(e=0){this._pushOp(new ni(e))}drawRect(e,t,i,r){this._pushOp(new oi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new li(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new hi(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new ui(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new ci(e,t,i,r,a))}lineTo(e,t){this._pushOp(new di(e,t))}moveTo(e,t){this._pushOp(new bi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new fi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new pi(e,t,i,r))}closePath(){this._pushOp(new _i)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new gi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new mi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const u=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,h=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let p;for(;(p=u.exec(e))!==null;){const c=p[1],b=p[2],l=[];for(;(p=h.exec(b))!==null;)l.push(p[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,l.length,2),t=+l[0],i=+l[1],this.moveTo(t,i);for(let o=2;o{this.bezierCurveTo(y.x1,y.y1,y.x2,y.y2,y.x,y.y),t=y.x,i=y.y})}break;case"Z":case"z":Zt(c,l.length,0),this.closePath()}}}_runPath(e){e.beginPath(),v(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=this._layer||e,i=t.dirty,r=this._isInteractive();if(i||r){const a=t.context,s=this._renderer._ghostLayer.context;let n;i&&(a.globalCompositeOperation=this.blendMode,a.beginPath()),r&&(s.beginPath(),n=this._getColorId()),v(this._operations,u=>{i&&(u.path(a),u.colorize(a,void 0)),r&&(u.path(s),u.colorize(s,n))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),v(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&v(this._operations,t=>{t.addBounds(e)})}}class rt extends ve{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive()&&!t&&(a.font=n),s.fill&&(s.fill instanceof ee?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive()&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){const t=this._layer||e;if(this._textInfo||this._measure(t),this.textVisible){const i=this._isInteractive(),r=t.context,a=t.dirty,s=this._renderer._ghostLayer.context;r.save(),s.save(),this._prerender(t),v(this._textInfo,(n,u)=>{v(n.textChunks,(h,p)=>{if(h.style&&(r.save(),s.save(),r.font=h.style,this._isInteractive()&&(s.font=h.style)),h.fill&&(r.save(),r.fillStyle=h.fill.toCSS()),a&&r.fillText(h.text,h.offsetX,n.offsetY+h.offsetY),h.textDecoration=="underline"||h.textDecoration=="line-through"){let c,b=1,l=1,m=h.height,o=h.offsetX;switch(this.style.textAlign){case"right":case"end":o-=h.width;break;case"center":o-=h.width/2}if(h.style)switch(U.getTextStyle(h.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":b=2}m&&(l=m/20),c=h.textDecoration=="line-through"?b+n.offsetY+h.offsetY-h.height/2:b+1.5*l+n.offsetY+h.offsetY,r.save(),r.beginPath(),h.fill?r.strokeStyle=h.fill.toCSS():this.style.fill&&this.style.fill instanceof ee&&(r.strokeStyle=this.style.fill.toCSS()),r.lineWidth=b*l,r.moveTo(o,c),r.lineTo(o+h.width,c),r.stroke(),r.restore()}i&&this.interactive&&s.fillText(h.text,h.offsetX,n.offsetY+h.offsetY),h.fill&&r.restore(),h.style&&(r.restore(),s.restore())})}),r.restore(),s.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure(this.getLayer());M(e,{x:t.left,y:t.top}),M(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",u=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const h="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",p=this.text.toString().replace(/\r/g,"").split(/\n/);let c,b=!0,l=0,m=0,o=0;v(p,(g,x)=>{let y;for(y=g==""?[{type:"value",text:""}]:U.chunk(g,!1,this.style.ignoreFormatting);y.length>0;){let _={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const P=this._measureText(h,t),E=P.actualBoundingBoxAscent+P.actualBoundingBoxDescent;let S;_.height=E,_.ascent=P.actualBoundingBoxAscent;let T,D,O,I=this.style.textDecoration,L=!1,F=!0,N=[];Qe(y,(B,ce)=>{if(B.type=="format")if(B.text=="[/]")b||(t.restore(),i.restore(),b=!0),T=void 0,c=void 0,D=void 0,I=this.style.textDecoration,O=void 0,S=B.text;else{b||(t.restore(),i.restore());let k=U.getTextStyle(B.text);const R=this._getFontStyle(k);t.save(),i.save(),t.font=R,c=R,S=B.text,k.textDecoration&&(I=k.textDecoration),k.fill&&(T=k.fill),k.width&&(D=V(k.width)),k.verticalAlign&&(O=k.verticalAlign),b=!1;const Y=this._measureText(h,t),G=Y.actualBoundingBoxAscent+Y.actualBoundingBoxDescent;G>_.height&&(_.height=G),Y.actualBoundingBoxAscent>_.ascent&&(_.ascent=Y.actualBoundingBoxAscent)}else if(B.type=="value"&&!L){const k=this._measureText(B.text,t);let R=k.actualBoundingBoxLeft+k.actualBoundingBoxRight;if(n){let W=F||this.style.breakWords||!1;const $=this.style.ellipsis||"",Le=this._measureText($,t),st=Le.actualBoundingBoxLeft+Le.actualBoundingBoxRight;if(_.width+R>s){const at=s-_.width-st;B.text=this._truncateText(t,B.text,at,W),B.text+=$,L=!0}}else if(u&&_.width+R>s){const W=s-_.width,$=this._truncateText(t,B.text,W,!1,F&&this.style.oversizedBehavior!="wrap-no-break");if($=="")return this.textVisible=!0,!1;N=y.slice(ce+1),Pe($)!=Pe(B.text)&&(N.unshift({type:"value",text:B.text.substr($.length)}),S&&N.unshift({type:"format",text:S})),B.text=Pe($),y=[],L=!0}let Y=1,G=1;if(c&&D&&D>R){const W=R/D;switch(this.style.textAlign){case"right":case"end":Y=W;break;case"center":Y=W,G=W;break;default:G=W}R=D}const we=k.actualBoundingBoxAscent+k.actualBoundingBoxDescent;we>_.height&&(_.height=we),k.actualBoundingBoxAscent>_.ascent&&(_.ascent=k.actualBoundingBoxAscent),_.width+=R,_.left+=k.actualBoundingBoxLeft/Y,_.right+=k.actualBoundingBoxRight/G,_.textChunks.push({style:c,fill:T,text:B.text,width:R,height:we,left:k.actualBoundingBoxLeft,right:k.actualBoundingBoxRight,ascent:k.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),F=!1}return!0}),this.style.lineHeight instanceof et?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),l<_.left&&(l=_.left),m<_.right&&(m=_.right),this._textInfo.push(_),o+=_.height,y=N||[]}}),b||(t.restore(),i.restore()),v(this._textInfo,(g,x)=>{let y=0;v(g.textChunks,_=>{if(_.offsetX=y+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),y+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const f={left:r?-m:-l,top:0,right:r?l:m,bottom:o};if(a!=="none"){const g=this._fitRatio(f);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const u=n.height,h=i.width;r={actualBoundingBoxAscent:u,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:h,fontBoundingBoxAscent:u,fontBoundingBoxDescent:0,width:h}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class vi{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:Ze(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class wi extends rt{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){const t=this._layer||e;this._prerender(t);const i=this._isInteractive(),r=t.context,a=t.dirty,s=this._renderer._ghostLayer.context;r.save(),i&&s.save(),this._textInfo||this._measure(t);let n=this.radius||0,u=this.startAngle||0,h=0,p=this.orientation,c=p=="auto"?"auto":p=="inward";const b=this.inside,l=this.style.textAlign||"left",m=this.kerning||0;let o=l=="left"?1:-1;const f=!this._textReversed;if(c=="auto"){let g=0,x=0;v(this._textInfo,(y,_)=>{const P=u+y.width/(n-y.height)/2*-o;P>g&&(g=P)}),x=l=="left"?(g+h/2)*le:l=="right"?(g-h/2)*le:u*le,x=Bt(x),c=x>=270||x<=90}c==1&&f&&(this._textInfo.reverse(),this._textReversed=!0),v(this._textInfo,(g,x)=>{const y=g.height;b||(n+=y),(o==-1&&c||o==1&&!c)&&f&&g.textChunks.reverse();let _=u;h=0,l=="center"&&(_+=g.width/(n-y)/2*-o,h=_-u),_+=Math.PI*(c?0:1),r.save(),i&&s.save(),r.rotate(_),i&&s.rotate(_);let P=0;v(g.textChunks,(E,S)=>{const T=E.text,D=E.width;P=D/2/(n-y)*o,r.rotate(P),i&&s.rotate(P),E.style&&(r.save(),s.save(),r.font=E.style,i&&(s.font=E.style)),E.fill&&(r.save(),r.fillStyle=E.fill.toCSS()),r.textBaseline="middle",r.textAlign="center",i&&(s.textBaseline="middle",s.textAlign="center"),a&&r.fillText(T,0,(c?1:-1)*(0-n+y/2)),i&&s.fillText(T,0,(c?1:-1)*(0-n+y/2)),E.fill&&r.restore(),E.style&&(r.restore(),s.restore()),P=(D/2+m)/(n-y)*o,r.rotate(P),i&&s.rotate(P)}),r.restore(),i&&s.restore(),b&&(n-=y)}),r.restore(),i&&s.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",u=this.style.ellipsis||"";let h;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const p=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,b=0,l=0;return v(p,(m,o)=>{let f,g,x,y=U.chunk(m,!1,this.style.ignoreFormatting),_={offsetY:l,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};v(y,(P,E)=>{if(P.type=="format"){if(P.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,f=void 0,x=void 0;else{let S=U.getTextStyle(P.text);const T=this._getFontStyle(S);t.save(),i.save(),t.font=T,f=T,S.fill&&(g=S.fill),S.width&&(x=V(S.width)),c=!1}n&&(h=this._measureText(u,t))}else if(P.type=="value"){const S=P.text.match(/./gu)||[];r&&S.reverse();for(let T=0;TI&&(I=x);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:f,fill:g,text:D,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}),b+=I,n){h||(h=this._measureText(u,t));const F=h.actualBoundingBoxLeft+h.actualBoundingBoxRight;if(b+=F,b+F>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=F,_.left+=h.actualBoundingBoxLeft,_.right+=h.actualBoundingBoxRight,_.textChunks.push({style:f,fill:g,text:u,width:F,height:L+h.actualBoundingBoxDescent,left:h.actualBoundingBoxLeft,right:h.actualBoundingBoxRight,ascent:h.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}if(r)break}}}),this.style.lineHeight instanceof et?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),l+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&b>s&&(this.textVisible=!1),v(this._textInfo,m=>{v(m.textChunks,o=>{o.offsetY+=Math.round((m.height-o.height+(m.ascent-o.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class xi extends ve{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){const t=this._layer||e;if(this.tainted===void 0&&(this.tainted=Xe(this.image),t.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(t.dirty){this.shadowColor&&(t.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(t.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(t.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(t.context.shadowOffsetY=this.shadowOffsetY);const i=this.width||this.image.naturalWidth,r=this.height||this.image.naturalHeight;t.context.drawImage(this.image,0,0,i,r)}if(this.interactive&&this._isInteractive()){const i=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(i,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Xe(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Pi{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class Oi extends St{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new ki}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),v(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(Je(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Qe(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(A(window,"touchstart",t,{passive:!1})),this._disposers.push(A(this.view,"touchstart",t,{passive:!1})),this._disposers.push(A(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(A(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(A(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(A(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new ti(this)}makeGraphics(){return new yi(this)}makeText(e,t){return new rt(this,e,t)}makeTextStyle(){return new vi}makeRadialText(e,t){return new wi(this,e,t)}makePicture(e){return new xi(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,v(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Ei(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;ru.order>h.order?1:u.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render(this.defaultLayer),this._ghostLayer.context.restore(),v(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),v(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;v(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=Kt(++this._colorId),i=ee.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,u={x:r-i.left,y:a-i.top},h={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Pi(e,u,h,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=ee.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,me(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{v(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{v(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;_e(a,u=>{const h={id:s,value:u};return this._mousedown.push(h),!n&&this._dispatchEvent("pointerdown",u,r)&&(n=!0,this._dragging.some(p=>p.value===u&&p.id===s)||this._dragging.push(h)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&xe(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&_e(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=At(document.body,"cursor"),xe(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&xe(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(u=>{u.id===s&&u.value.contains(n)&&this._dispatchEvent(r,u.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&_e(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&_e(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new jt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new He([new X(()=>{r!==null&&clearTimeout(r),a()}),A(this.view,je(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),Qt(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},v(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new He([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{v(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{v(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{v(s,u=>{this._dispatchMousedown(u,n)})}),i=this._onPointerEvent("pointermove",s=>{v(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{v(s,u=>{this._dispatchDragEnd(u,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{v(s,u=>{this._dispatchDragEnd(u,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{v(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>A(window,je("wheel"),t=>{this._dispatchWheel(t,Ke(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ce(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let l=t.minWidth/r;l>i&&(i=l*this.resolution)}if(t.minHeight&&t.minHeight>a){let l=t.minHeight/a;l>i&&(i=l*this.resolution)}if(t.maxWidth&&t.maxWidtha){let l=t.maxHeight/a;l{if(l&&l.visible&&(l.tainted||n)){b=!0,l.exportableView=l.view,l.exportableContext=l.context,l.view=document.createElement("canvas"),l.view.style.position="fixed",l.view.style.top="-10000px",this.view.appendChild(l.view),s.push(l.view);let m=0,o=0;l.margin&&(m+=l.margin.left||0+l.margin.right||0,o+=l.margin.top||0+l.margin.bottom||0),l.view.width=r+m,l.view.height=a+o,l.context=l.view.getContext("2d"),l.dirty=!0,l.scale=i}}),b&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),v(this.layers,l=>{if(l&&l.visible){let m=0,o=0;l.margin&&(m=-(l.margin.left||0)*this.resolution,o=-(l.margin.top||0)*this.resolution),h.drawImage(l.view,m,o),l.exportableView&&(l.view=l.exportableView,l.exportableView=void 0),l.exportableContext&&(l.context=l.exportableContext,l.exportableContext=void 0),p{l.style.position="",l.style.top="",this.view.removeChild(l)}),u}}class ki{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,v(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Ei{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Ne(d,e){d==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/d)}class Be{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new ut}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:it}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Ht.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Wt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Ut.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ct.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:dt.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=_t()),this._renderer=new Oi(r),a=e instanceof HTMLElement?e:document.getElementById(e),v(ie.rootElements,u=>{if(u.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=fe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new Be(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(q.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:Ze(100),centerY:Z,tooltipText:"Created using amCharts 5",tooltipX:Z,cursorOverStyle:"pointer",background:ft.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=Ve.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(ze.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(ze.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),u=Math.floor(i.height),h=q.new(this,{visible:!0,width:a,height:s});this._rootContainer=h,this._rootContainer._defaultThemes.push(It.new(this));const p=h.children.push(q.new(this,{visible:!0,width:Z,height:Z}));this.container=p,t.resize(n,u,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const b=document.createElement("div");b.className="am5-reader-container",b.setAttribute("role","alert"),b.style.position="absolute",b.style.width="1px",b.style.height="1px",b.style.overflow="hidden",b.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=b,this._inner.appendChild(this._readerAlertElement);const l=document.createElement("div");l.className="am5-focus-container",l.style.position="absolute",l.style.pointerEvents="none",l.style.top="0px",l.style.left="0px",l.style.overflow="hidden",l.style.width=a+"px",l.style.height=s+"px",l.setAttribute("role","graphics-document"),J(l,!1),this._focusElementContainer=l,this._inner.appendChild(this._focusElementContainer);const m=document.createElement("div");this._tooltipElementContainer=m,m.className="am5-tooltip-container",this._inner.appendChild(m),ge("keyboardevents")&&(this._disposers.push(A(window,"keydown",o=>{o.keyCode==16?this._isShift=!0:o.keyCode==9&&(this._isShift=o.shiftKey)})),this._disposers.push(A(window,"keyup",o=>{o.keyCode==16&&(this._isShift=!1)})),this._disposers.push(A(l,"click",()=>{const o=this._focusedSprite;if(o){const f=t.getEvent(new MouseEvent("click"));o.events.dispatch("click",{type:"click",originalEvent:f.event,point:f.point,simulated:!0,target:o})}})),this._disposers.push(A(l,"keydown",o=>{const f=this._focusedSprite;if(f){o.keyCode==27&&(pt(),this._focusedSprite=void 0);let g=0,x=0;switch(o.keyCode){case 13:o.preventDefault();const y=t.getEvent(new MouseEvent("click"));return void f.events.dispatch("click",{type:"click",originalEvent:y.event,point:y.point,simulated:!0,target:f});case 37:g=-6;break;case 39:g=6;break;case 38:x=-6;break;case 40:x=6;break;default:return}if(g!=0||x!=0){if(o.preventDefault(),!f.isDragging()){this._keyboardDragPoint={x:0,y:0};const P=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));f.events.isEnabled("pointerdown")&&f.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:P.event,point:P.point,simulated:!0,target:f})}const y=this._keyboardDragPoint;y.x+=g,y.y+=x;const _=t.getEvent(new MouseEvent("mousemove",{clientX:y.x,clientY:y.y}),!1);f.events.isEnabled("globalpointermove")&&f.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:_.event,point:_.point,simulated:!0,target:f})}}})),this._disposers.push(A(l,"keyup",o=>{if(this._focusedSprite){const f=this._focusedSprite,g=o.keyCode;switch(g){case 37:case 39:case 38:case 40:if(f.isDragging()){const x=this._keyboardDragPoint,y=t.getEvent(new MouseEvent("mouseup",{clientX:x.x,clientY:x.y}));return f.events.isEnabled("globalpointerup")&&f.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:y.event,point:y.point,simulated:!0,target:f}),void(this._keyboardDragPoint=void 0)}if(f.get("focusableGroup")){const x=f.get("focusableGroup"),y=this._tabindexes.filter(E=>E.get("focusableGroup")==x&&E.getPrivate("focusable")!==!1);let _=y.indexOf(f);const P=y.length-1;_+=g==39||g==40?1:-1,_<0?_=P:_>P&&(_=0),gt(y[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Yt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const h=this._focusElementContainer;h.style.width=i+"px",h.style.height=r+"px"}this._renderer.resize(a,s,i,r);const u=this._rootContainer;u.setPrivate("width",i),u.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){v(this._tickers,t=>{t(e)})}_runAnimations(e){me(this._animations,t=>t._runAnimation(e))}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>mt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){return!this._updateTick||(this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e),this._runAnimations(e),this._runDirties(),this._render(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&this._animations.length===0&&!this._isDirty)}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Ne(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Ne(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._dirty[e.uid]===void 0&&(this._isDirty=!0,this._dirty[e.uid]=e,this._startTicker())}_addDirtyParent(e){this._dirtyParents[e.uid]===void 0&&(this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]=e,this._startTicker())}_addDirtyBounds(e){this._dirtyBounds[e.uid]===void 0&&(this._isDirty=!0,this._dirtyBounds[e.uid]=e,this._startTicker())}_addDirtyPosition(e){this._dirtyPositions[e.uid]===void 0&&(this._isDirty=!0,this._dirtyPositions[e.uid]=e,this._startTicker())}_addAnimation(e){this._animations.indexOf(e)===-1&&(this._animations.push(e),this._startTicker())}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ce(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof q&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),v(this._disposers,e=>{e.dispose()}),this._inner&&yt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ie(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(q.new(this,{position:"absolute",isMeasured:!1,width:Z,height:Z,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=Ve.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?Te(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];v(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const l=vt(e,r);t.setAttribute("aria-label",l)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const n=e.get("ariaOrientation");n?t.setAttribute("aria-orientation",n):t.removeAttribute("aria-orientation");const u=e.get("ariaValueNow");u?t.setAttribute("aria-valuenow",u):t.removeAttribute("aria-valuenow");const h=e.get("ariaValueMin");h?t.setAttribute("aria-valuemin",h):t.removeAttribute("aria-valuemin");const p=e.get("ariaValueMax");p?t.setAttribute("aria-valuemax",p):t.removeAttribute("aria-valuemax");const c=e.get("ariaValueText");c?t.setAttribute("aria-valuetext",c):t.removeAttribute("aria-valuetext");const b=e.get("ariaControls");b?t.setAttribute("aria-controls",b):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",J(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(A(i,"focus",a=>{this._handleFocus(a,e)})),r.push(A(i,"blur",a=>{this._handleBlur(a,e)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),v(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top,a=t.left-2,s=t.top-2;i<0&&(a+=i,i=Math.abs(i)),r<0&&(s+=r,r=Math.abs(r));const n=e.getPrivate("focusElement").dom;n.style.top=s+"px",n.style.left=a+"px",n.style.width=i+4+"px",n.style.height=r+4+"px"}_handleFocus(e,t){if(this._a11yD==1)return;const i=this._tabindexes[t];i.isVisibleDeep()?(this._positionFocusElement(i),this._focusedSprite=i,i.events.isEnabled("focus")&&i.events.dispatch("focus",{type:"focus",originalEvent:e,target:i})):this._focusNext(e.target,this._isShift?-1:1)}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e,t){if(this._a11yD==1)return;const i=this._focusedSprite;i&&i.events.isEnabled("blur")&&i.events.dispatch("blur",{type:"blur",originalEvent:e,target:i}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ie(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t)):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",J(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{pe(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof q?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof wt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),Te(this._htmlEnabledContainers,e),i}_positionHTMLElements(){v(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){v(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],p=>{const c=e.get(p);t.style[p]=c?c+"px":""});const i=e.compositeOpacity();setTimeout(()=>{t.style.opacity=i+""},10);const r=e.isVisibleDeep();r&&(t.style.display="block");const a=e.globalBounds();t.style.top=a.top+"px",t.style.left=a.left+"px";const s=e.get("width"),n=e.get("height");let u=0,h=0;if(s&&(u=e.width()),n&&(h=e.height()),s&&n)e.removePrivate("minWidth"),e.removePrivate("minHeight");else{t.style.position="fixed",t.style.width="",t.style.height="";const p=t.getBoundingClientRect();t.style.position="absolute",u=p.width,h=p.height,e._adjustedLocalBounds={left:0,right:0,top:0,bottom:0},e.setPrivate("minWidth",u),e.setPrivate("minHeight",h)}u>0&&(t.style.minWidth=u+"px"),h>0&&(t.style.minHeight=h+"px"),r&&i!=0||(t.style.display="none")}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&this._htmlElementContainer.removeChild(t),ae(this._htmlEnabledContainers,e)}}ot("AM5C241025748");const Ge="en-us",Ae=new Map([["ar",()=>w(()=>import("./ar-m2Ru99Kw.js"),__vite__mapDeps([]))],["bg-bg",()=>w(()=>import("./bg_BG-Zh0O8yIZ.js"),__vite__mapDeps([]))],["bs-ba",()=>w(()=>import("./bs_BA-EoGo05fu.js"),__vite__mapDeps([]))],["ca-es",()=>w(()=>import("./ca_ES-hscFeNNn.js"),__vite__mapDeps([]))],["cs-cz",()=>w(()=>import("./cs_CZ-6GM5cGtg.js"),__vite__mapDeps([]))],["da-dk",()=>w(()=>import("./da_DK-havyKYv2.js"),__vite__mapDeps([]))],["de-de",()=>w(()=>import("./de_DE-Fwy8dxxc.js"),__vite__mapDeps([]))],["de-ch",()=>w(()=>import("./de_CH-V5QttSa-.js"),__vite__mapDeps([]))],["el-gr",()=>w(()=>import("./el_GR-Yz-QyhSI.js"),__vite__mapDeps([]))],["en-us",()=>w(()=>import("./en_US-eyWLRifP.js"),__vite__mapDeps([]))],["en-ca",()=>w(()=>import("./en_CA-eyWLRifP.js"),__vite__mapDeps([]))],["es-es",()=>w(()=>import("./es_ES-o2wkmEuo.js"),__vite__mapDeps([]))],["et-ee",()=>w(()=>import("./et_EE-jAuARBOS.js"),__vite__mapDeps([]))],["fi-fi",()=>w(()=>import("./fi_FI-d4Rs7vi8.js"),__vite__mapDeps([]))],["fr-fr",()=>w(()=>import("./fr_FR-hDvN628_.js"),__vite__mapDeps([]))],["he-il",()=>w(()=>import("./he_IL-uMiAw4Wl.js"),__vite__mapDeps([]))],["hr-hr",()=>w(()=>import("./hr_HR-tOrtwB1u.js"),__vite__mapDeps([]))],["hu-hu",()=>w(()=>import("./hu_HU-tBJnhXJb.js"),__vite__mapDeps([]))],["id-id",()=>w(()=>import("./id_ID-XHyCBpw9.js"),__vite__mapDeps([]))],["it-it",()=>w(()=>import("./it_IT-AbCCe__c.js"),__vite__mapDeps([]))],["ja-jp",()=>w(()=>import("./ja_JP-Rlf-hOL0.js"),__vite__mapDeps([]))],["ko-kr",()=>w(()=>import("./ko_KR-_v1iWWtT.js"),__vite__mapDeps([]))],["lt-lt",()=>w(()=>import("./lt_LT-UBpPtM2w.js"),__vite__mapDeps([]))],["lv-lv",()=>w(()=>import("./lv_LV-Wuccr2bP.js"),__vite__mapDeps([]))],["nb-no",()=>w(()=>import("./nb_NO-QiKaA4xA.js"),__vite__mapDeps([]))],["nl-nl",()=>w(()=>import("./nl_NL-YPMyQFKz.js"),__vite__mapDeps([]))],["pl-pl",()=>w(()=>import("./pl_PL-1aQ453OS.js"),__vite__mapDeps([]))],["pt-br",()=>w(()=>import("./pt_BR-lyUqGwB2.js"),__vite__mapDeps([]))],["pt-pt",()=>w(()=>import("./pt_PT-o6ZnsHgl.js"),__vite__mapDeps([]))],["ro-ro",()=>w(()=>import("./ro_RO-YIwLBwwg.js"),__vite__mapDeps([]))],["ru-ru",()=>w(()=>import("./ru_RU-Xn7Ds-ry.js"),__vite__mapDeps([]))],["sk-sk",()=>w(()=>import("./sk_SK-lW-A9Llp.js"),__vite__mapDeps([]))],["sl-sl",()=>w(()=>import("./sl_SL-DJbbPhCy.js"),__vite__mapDeps([]))],["sr-rs",()=>w(()=>import("./sr_RS-HTzJ9Pkx.js"),__vite__mapDeps([]))],["sv-se",()=>w(()=>import("./sv_SE-Z8LyXaIi.js"),__vite__mapDeps([]))],["th-th",()=>w(()=>import("./th_TH-4uUl3VxF.js"),__vite__mapDeps([]))],["tr-tr",()=>w(()=>import("./tr_TR-vXXQf5Mr.js"),__vite__mapDeps([]))],["uk-ua",()=>w(()=>import("./uk_UA-DutcYu8K.js"),__vite__mapDeps([]))],["vi-vn",()=>w(()=>import("./vi_VN-bEo-fMOP.js"),__vite__mapDeps([]))],["zh-cn",()=>w(()=>import("./zh_Hans-l-imEkFY.js"),__vite__mapDeps([]))],["zh-hk",()=>w(()=>import("./zh_Hant-8IW9KGhY.js"),__vite__mapDeps([]))],["zh-tw",()=>w(()=>import("./zh_Hant-8IW9KGhY.js"),__vite__mapDeps([]))]]);function Mi(d){const e=d.split("-")[0].toLowerCase();let t=null;for(const i of Ae.keys())if(i.startsWith(e)){t=i;break}return t}function Si(d){return d?Ae.has(d.toLowerCase())?d.toLowerCase():Mi(d)||Ge:Ge}async function Ti(d,e=nt()){const t=Be.new(d);return t.locale=(await Ae.get(Si(e))()).default,t}const Ai=Object.freeze(Object.defineProperty({__proto__:null,createRoot:Ti},Symbol.toStringTag,{value:"Module"}));export{Ht as S,Ti as Y,Ai as c}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = [] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/cimAnalyzer-DtyBzAGI.js b/dist/assets/cimAnalyzer-DtyBzAGI.js new file mode 100644 index 0000000..1fa1858 --- /dev/null +++ b/dist/assets/cimAnalyzer-DtyBzAGI.js @@ -0,0 +1 @@ +import{wH as St,wI as pe,wJ as wt,k7 as De,ar as He,wK as k,wL as D,wM as Ft,eJ as st,k8 as Ye,wN as he,wO as tt,wy as ft,wP as Ce,uA as ci,wQ as Et,wR as ce,wS as Bi,gO as rt,gY as Ji,Z as Ve,dz as nt,eK as bt,eI as ve,wT as x,wU as It,a4 as Ot,bI as ot,a6 as j,a7 as mt,wV as Be,wW as Je,wX as Wi,wY as ui,wZ as fi,w_ as Ct,w$ as $e,x0 as _e,x1 as Ui,x2 as qi,d_ as ji,eH as qe,r3 as Ki,ae as Zi,eL as Qi,mH as ts,x3 as es,x4 as is,x5 as ss,x6 as rs,x7 as ns,x8 as je,x9 as os,xa as as,xb as Ke,ky as ls,xc as hs,xd as cs,ve as mi,wD as Lt,xe as us,xf as fs,ab as pi,dJ as ms,xg as ps,xh as _s,fX as ds,lV as F,ww as ge,xi as H,xj as ue,wz as w,xk as gs,xl as ys,md as Ps,me as Ze,xm as Nt,kk as we,kl as ke}from"./index-J0iiHjMT.js";import{a as $,l as Ms}from"./labelPoint-ysDT9nFH.js";import{t as Qe,e as bs}from"./TileClipper-NSFZXMR1.js";import{C as _i,g as di}from"./definitions-DqQMJYPH.js";import"./number-sTjsTbdA.js";import{C as xs}from"./BidiEngine-8z8MVveq.js";const Ie=new xs;function Ss(u){if(u==null)return["",!1];if(!Ie.hasBidiChar(u))return[u,!1];let t;return t=Ie.checkContextual(u)==="rtl"?"IDNNN":"ICNNN",[Ie.bidiTransform(u,t,"VLYSN"),!0]}const Cs=512;let et,Ge=class{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}};function We(u,t){et||(et=new bs(0,0,0,1));const e=u.geometryType==="esriGeometryPolygon",i=e?Qe.Polygon:Qe.LineString,n=e?3:2;let s,r;for(et.reset(i),et.setPixelMargin(t+1),et.setExtent(Cs);u.nextPath();)if(!(u.pathSize1&&y>0&&l>0&&(o*d+a*g)/y/l<=this._maxCosAngle&&t.setControlPointAt(f-1),f===1&&(h=d,c=g,m=y),y>0&&(n=_,s=p,o=d,a=g,l=y)}this._isClosed&&l>0&&m>0&&(o*h+a*c)/m/l<=this._maxCosAngle&&t.setControlPointAt(0)}}},At=class{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}};function Le(u,t){u[4]=t}let ne=class{constructor(t,e=!0,i=!0,n=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!e&&t.geometryType==="esriGeometryPolygon"||!i&&t.geometryType==="esriGeometryPolyline"?null:t,this.geomUnitsPerPoint=n,this.iteratePath=!1,this.internalPlacement=new At}next(){if(!this.geometryCursor)return null;for(;this.iteratePath||this.geometryCursor.nextPath();){this.geometryCursor.seekPathStart();const t=this.processPath(this.geometryCursor);if(t)return t}return this.geometryCursor=null,null}},be=class{constructor(t,e,i,n=0){this.isClosed=!1,this.inputGeometries=t,this.acceptPolygon=e,this.acceptPolyline=i,this.geomUnitsPerPoint=n,this.iteratePath=!1,this.multiPathCursor=null}next(){for(;;){if(!this.multiPathCursor){let t=this.inputGeometries.next();for(;t&&(this.isClosed=this.acceptPolygon&&t.geometryType==="esriGeometryPolygon"||t.geometryType==="esriGeometryEnvelope",this.multiPathCursor=t,!this.multiPathCursor);)t=this.inputGeometries.next();if(!this.multiPathCursor)return null}for(;this.iteratePath||this.multiPathCursor.nextPath();){this.multiPathCursor.seekPathStart();const t=this.processPath(this.multiPathCursor);if(t)return t}this.multiPathCursor=null}}};const re=.03;let at=class{constructor(t=0,e=!1){}isEmpty(t){if(!t.nextPoint())return!0;let e,i,n,s;for(e=t.x,i=t.y;t.nextPoint();e=i,i=s)if(n=t.x,s=t.y,n!==e||s!==i)return t.seekPathStart(),!1;return t.seekPathStart(),!0}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);e!==0&&(t[0]/=e,t[1]/=e)}getLength(t,e,i,n){const s=i-t,r=n-e;return Math.sqrt(s*s+r*r)}getSegLength(t){const[[e,i],[n,s]]=t;return this.getLength(e,i,n,s)}getCoord2D(t,e,i,n,s){return[t+(i-t)*s,e+(n-e)*s]}getSegCoord2D(t,e){const[[i,n],[s,r]]=t;return this.getCoord2D(i,n,s,r,e)}getAngle(t,e,i,n,s){const r=i-t,o=n-e;return Math.atan2(o,r)}getAngleCS(t,e,i,n,s){const r=i-t,o=n-e,a=Math.sqrt(r*r+o*o);return a>0?[r/a,o/a]:[1,0]}getSegAngleCS(t,e){const[[i,n],[s,r]]=t;return this.getAngleCS(i,n,s,r,e)}cut(t,e,i,n,s,r){return[s<=0?[t,e]:this.getCoord2D(t,e,i,n,s),r>=1?[i,n]:this.getCoord2D(t,e,i,n,r)]}getSubCurve(t,e,i){const n=$.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(n,t,e,i)?n:null}appendSubCurve(t,e,i,n){t.startPath(),e.seekPathStart();let s=0,r=!0;if(!e.nextPoint())return!1;let o=e.x,a=e.y;for(;e.nextPoint();){const l=this.getLength(o,a,e.x,e.y);if(l!==0){if(r){if(s+l>i){const h=(i-s)/l;let c=1,m=!1;s+l>=n&&(c=(n-s)/l,m=!0);const f=this.cut(o,a,e.x,e.y,h,c);if(f&&t.pushPoints(f),m)break;r=!1}}else{if(s+l>n){const h=this.cut(o,a,e.x,e.y,0,(n-s)/l);h&&t.pushPoint(h[1]);break}t.pushXY(e.x,e.y)}s+=l,o=e.x,a=e.y}else o=e.x,a=e.y}return!0}getCIMPointAlong(t,e){if(!t.nextPoint())return null;let i,n,s,r,o=0;for(i=t.x,n=t.y;t.nextPoint();i=s,n=r){s=t.x,r=t.y;const a=this.getLength(i,n,s,r);if(a!==0){if(o+a>e){const l=(e-o)/a;return this.getCoord2D(i,n,s,r,l)}o+=a}}return null}offset(t,e,i,n,s){if(!t||t.length<2)return null;let r=0,o=t[r++],a=r;for(;r=0==e<=0){if(g<1){const y=[_[0]-p[0],_[1]-p[1]];this.normalize(y);const M=Math.sqrt((1+g)/2);if(M>1/n){const P=-Math.abs(e)/M;h.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(i){case St.Mitered:{const y=Math.sqrt((1+g)/2);if(y>0&&1/y0){const M=1/y;let P=M;for(let b=1;b0){const s=$.createEmptyOptimizedCIM(t.geometryType),r=De(t)[0],o=this._curveHelper.offset(r,this._size,St.Rounded,4,this._offsetFlattenError);if(o)return s.pushPath(o),s}else if(this._size<0){const s=t.asJSON();if(Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._size>0)return $.fromJSONCIM({xmin:s.xmin-this._size,xmax:s.xmax+this._size,ymin:s.ymin-this._size,ymax:s.ymax+this._size})}}const e=this._geometryEngine;if(e==null)return null;const i=this._tileKey?We(t,this._maxInflateSize):t;if(!i)continue;const n=e.buffer(He.WebMercator,i.asJSON(),this._size,1);return n?$.fromJSONCIM(n):null}return null}},Pi=class Xt{static local(){return Xt.instance===null&&(Xt.instance=new Xt),Xt.instance}execute(t,e,i,n,s){return new Os(t,e,i)}};Pi.instance=null;let Os=class{constructor(t,e,i){this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=i,this._rule=e.rule??k.FullGeometry,this._defaultSize=this._defaultPointSize*i}next(){let t;for(;t=this._inputGeometries.next();){const e=this._processGeom(De(t));if(e&&e.length)return $.fromJSONCIM({paths:e})}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,i,n){return[t[0]*e+i[0]*n,t[1]*e+i[1]*n]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,i){return[t[0]+e,t[1]+i]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const i=e/this._norm(t);t[0]*=i,t[1]*=i}_leftPerpendicular(t){const e=-t[1],i=t[0];t[0]=e,t[1]=i}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],i=-t[0];t[0]=e,t[1]=i}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,i){const n=t[0]*e-t[1]*i,s=t[0]*i+t[1]*e;t[0]=n,t[1]=s}_makeCtrlPt(t){const e=[t[0],t[1]];return Le(e,1),e}_addAngledTicks(t,e,i,n){const s=this._sub(i,e);this._normalize(s);const r=this._crossProduct(s,this._sub(n,e));let o;o=r>0?this._rightPerp(s):this._leftPerp(s);const a=Math.abs(r)/2,l=[];l.push([e[0]+(o[0]-s[0])*a,e[1]+(o[1]-s[1])*a]),l.push(e),l.push(i),l.push([i[0]+(o[0]+s[0])*a,i[1]+(o[1]+s[1])*a]),t.push(l)}_addBezier2(t,e,i,n,s){if(s--==0)return void t.push(n);const r=this._mid(e,i),o=this._mid(i,n),a=this._mid(r,o);this._addBezier2(t,e,r,a,s),this._addBezier2(t,a,o,n,s)}_addBezier3(t,e,i,n,s,r){if(r--==0)return void t.push(s);const o=this._mid(e,i),a=this._mid(i,n),l=this._mid(n,s),h=this._mid(o,a),c=this._mid(a,l),m=this._mid(h,c);this._addBezier3(t,e,o,h,m,r),this._addBezier3(t,m,c,l,s,r)}_add90DegArc(t,e,i,n,s){const r=s??this._crossProduct(this._sub(i,e),this._sub(n,e))>0,o=this._mid(e,i),a=this._sub(o,e);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(i,.33333,o,.66667),i,4)}_addArrow(t,e,i){const n=e[0],s=e[1],r=e[e.length-1],o=this._sub(n,s);this._normalize(o);const a=this._crossProduct(o,this._sub(r,s)),l=.5*a,h=this._leftPerp(o),c=[r[0]-h[0]*a,r[1]-h[1]*a],m=e.length-1,f=[];f.push(i?[-h[0],-h[1]]:h);let _=[-o[0],-o[1]];for(let p=1;p0;p--)t.push([e[p][0]+f[p][0]*l,e[p][1]+f[p][1]*l]);t.push([c[0]+f[0][0]*l,c[1]+f[0][1]*l]),t.push([c[0]+f[0][0]*a,c[1]+f[0][1]*a]),t.push(n),t.push([c[0]-f[0][0]*a,c[1]-f[0][1]*a]),t.push([c[0]-f[0][0]*l,c[1]-f[0][1]*l]);for(let p=1;p=2?t[1]:this._add2(t[0],e*this._defaultSize,i*this._defaultSize)}_cp3(t,e,i,n){if(t.length>=3)return t[2];const s=this._mix(t[0],1-i,e,i),r=this._sub(e,t[0]);return this._normalize(r),this._rightPerpendicular(r),[s[0]+r[0]*n*this._defaultSize,s[1]+r[1]*n*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],i=this._cp2(t,-4,0),n=this._sub(e,i);this._normalize(n);const s=this._rightPerp(n);return[e,i,[e[0]+(s[0]-n[0])*this._defaultSize,e[1]+(s[1]-n[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],i=this._cp2(t,-4,0);let n;if(t.length>=3)n=t[t.length-1];else{const s=this._sub(e,i);this._normalize(s);const r=this._rightPerp(s);n=[e[0]+(r[0]-s[0])*this._defaultSize,e[1]+(r[1]-s[1])*this._defaultSize]}return[i,n]}_processGeom(t){if(!t)return null;const e=[];for(const i of t){if(!i||i.length===0)continue;const n=i.length;let s=i[0];switch(this._rule){case k.PerpendicularFromFirstSegment:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,4),a=[];a.push(o),a.push(this._mid(s,r)),e.push(a);break}case k.ReversedFirstSegment:{const r=this._cp2(i,0,-1);e.push([r,s]);break}case k.PerpendicularToSecondSegment:{const r=this._cp2(i,-4,1),o=this._cp3(i,r,.882353,-1.94),a=[];a.push(this._mid(r,o)),a.push(s),e.push(a);break}case k.SecondSegmentWithTicks:{const r=this._cp2(i,-4,1),o=this._cp3(i,r,.882353,-1.94),a=this._sub(o,r);let l;l=this._crossProduct(a,this._sub(s,r))>0?this._rightPerp(l):this._leftPerp(a);const h=[];h.push([r[0]+(l[0]-a[0])/3,r[1]+(l[1]-a[1])/3]),h.push(r),h.push(o),h.push([o[0]+(l[0]+a[0])/3,o[1]+(l[1]+a[1])/3]),e.push(h);break}case k.DoublePerpendicular:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,3),a=this._mid(s,r),l=this._sub(a,o);this._normalize(l);const h=this._crossProduct(l,this._sub(s,o));this._leftPerpendicular(l);const c=[];c.push(s),c.push([o[0]+l[0]*h,o[1]+l[1]*h]),e.push(c);const m=[];m.push([o[0]-l[0]*h,o[1]-l[1]*h]),m.push(r),e.push(m);break}case k.OppositeToFirstSegment:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,3),a=this._mid(s,r),l=this._sub(a,o);this._normalize(l);const h=this._crossProduct(l,this._sub(s,o));this._leftPerpendicular(l);const c=[];c.push([o[0]+l[0]*h,o[1]+l[1]*h]),c.push([o[0]-l[0]*h,o[1]-l[1]*h]),e.push(c);break}case k.TriplePerpendicular:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,4),a=this._mid(s,r),l=this._sub(a,o);this._normalize(l);const h=this._crossProduct(l,this._sub(s,o));this._leftPerpendicular(l);const c=[];c.push([o[0]+l[0]*h*.8,o[1]+l[1]*h*.8]),c.push([a[0]+.8*(s[0]-a[0]),a[1]+.8*(s[1]-a[1])]),e.push(c),e.push([o,a]);const m=[];m.push([o[0]-l[0]*h*.8,o[1]-l[1]*h*.8]),m.push([a[0]+.8*(r[0]-a[0]),a[1]+.8*(r[1]-a[1])]),e.push(m);break}case k.HalfCircleFirstSegment:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,4),a=this._mid(s,r);let l=this._sub(r,s);const h=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),m=Math.sqrt((1+h)/2),f=Math.sqrt((1-h)/2),_=[];let p;this._crossProduct(l,this._sub(o,s))>0?(_.push(s),l=this._sub(s,a),p=r):(_.push(r),l=this._sub(r,a),p=s),this._rotateDirect(l,m,f),l[0]/=m,l[1]/=m;for(let d=1;d<=18;d++)_.push(this._add(a,l)),this._rotateDirect(l,h,c);_.push(p),e.push(_);break}case k.HalfCircleSecondSegment:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,1,-1);let a=this._sub(s,r);this._normalize(a);const l=this._crossProduct(a,this._sub(o,r))/2;this._leftPerpendicular(a);const h=[r[0]+a[0]*l,r[1]+a[1]*l];a=this._sub(r,h);const c=Math.cos(Math.PI/18);let m=Math.sin(Math.PI/18);l>0&&(m=-m);const f=[r];for(let _=1;_<=18;_++)this._rotateDirect(a,c,m),f.push(this._add(h,a));e.push(f);break}case k.HalfCircleExtended:{const r=this._cp2(i,0,-2),o=this._cp3(i,r,1,-1);let a;if(n>=4)a=i[3];else{const _=this._sub(s,r);a=this._add(o,_)}const l=this._dist(r,o)/2/.75,h=this._sub(r,s);this._normalize(h,l);const c=this._sub(o,a);this._normalize(c,l);const m=[a,o];e.push(m);const f=[this._clone(o)];this._addBezier3(f,o,this._add(o,c),this._add(r,h),r,4),f.push(s),e.push(f);break}case k.OpenCircle:{const r=this._cp2(i,-2,0),o=this._sub(r,s),a=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),h=[r];for(let c=1;c<=33;c++)this._rotateDirect(o,a,l),h.push(this._add(s,o));e.push(h);break}case k.CoverageEdgesWithTicks:{const r=this._cp2(i,0,-1);let o,a;if(n>=3)o=i[2];else{const m=this._sub(r,s),f=this._leftPerp(m);o=[s[0]+f[0]-.25*m[0],s[1]+f[1]-.25*m[1]]}if(n>=4)a=i[3];else{const m=this._mid(s,r),f=this._sub(s,r);this._normalize(f),this._leftPerpendicular(f);const _=this._crossProduct(f,this._sub(o,m));this._rightPerpendicular(f),a=[o[0]+f[0]*_*2,o[1]+f[1]*_*2]}const l=this._sub(r,s);let h,c;h=this._crossProduct(l,this._sub(o,s))>0?this._rightPerp(l):this._leftPerp(l),c=[],c.push(o),c.push(s),c.push([s[0]+(h[0]-l[0])/3,s[1]+(h[1]-l[1])/3]),e.push(c),h=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(h):this._leftPerp(l),c=[],c.push([r[0]+(h[0]+l[0])/3,r[1]+(h[1]+l[1])/3]),c.push(r),c.push(a),e.push(c);break}case k.GapExtentWithDoubleTicks:{const r=this._cp2(i,0,2),o=this._cp3(i,r,0,1);let a;if(n>=4)a=i[3];else{const l=this._sub(r,s);a=this._add(o,l)}this._addAngledTicks(e,s,r,this._mid(o,a)),this._addAngledTicks(e,o,a,this._mid(s,r));break}case k.GapExtentMidline:{const r=this._cp2(i,2,0),o=this._cp3(i,r,0,1);let a;if(n>=4)a=i[3];else{const h=this._sub(r,s);a=this._add(o,h)}const l=[];l.push(this._mid(s,o)),l.push(this._mid(r,a)),e.push(l);break}case k.Chevron:{const r=this._cp2(i,-1,-1);let o;if(n>=3)o=i[2];else{const a=this._sub(r,s);this._leftPerpendicular(a),o=this._add(s,a)}e.push([r,this._makeCtrlPt(s),o]);break}case k.PerpendicularWithArc:{const r=this._cp2(i,0,-2),o=this._cp3(i,r,.5,-1);let a=this._sub(r,s);const l=this._norm(a);a[0]/=l,a[1]/=l;const h=this._crossProduct(a,this._sub(o,s));let c=this._dotProduct(a,this._sub(o,s));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const m=[s[0]+a[0]*c,s[1]+a[1]*c];this._leftPerpendicular(a);let f=[];f.push([m[0]-a[0]*h,m[1]-a[1]*h]),f.push([m[0]+a[0]*h,m[1]+a[1]*h]),e.push(f);const _=[r[0]+a[0]*h,r[1]+a[1]*h];a=this._sub(r,_);const p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);h<0&&(d=-d),f=[s,r];for(let g=1;g<=9;g++)this._rotateDirect(a,p,d),f.push(this._add(_,a));e.push(f);break}case k.ClosedHalfCircle:{const r=this._cp2(i,2,0),o=this._mid(s,r),a=this._sub(r,o),l=Math.cos(Math.PI/18),h=Math.sin(Math.PI/18),c=[s,r];for(let m=1;m<=18;m++)this._rotateDirect(a,l,h),c.push(this._add(o,a));e.push(c);break}case k.TripleParallelExtended:{const r=this._cp2(i,0,-2),o=this._cp3(i,r,1,-2),a=this._mid(s,r),l=this._sub(o,r);this._normalize(l);const h=Math.abs(this._crossProduct(l,this._sub(a,r)))/2,c=this._dist(r,o),m=[r,s];m.push([s[0]+l[0]*c*.5,s[1]+l[1]*c*.5]),e.push(m);const f=[];f.push([a[0]-l[0]*h,a[1]-l[1]*h]),f.push([a[0]+l[0]*c*.375,a[1]+l[1]*c*.375]),Le(f[f.length-1],1),f.push([a[0]+l[0]*c*.75,a[1]+l[1]*c*.75]),e.push(f);const _=[r,o];e.push(_);break}case k.ParallelWithTicks:{const r=this._cp2(i,3,0),o=this._cp3(i,r,.5,-1),a=this._sub(o,r);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s));this._leftPerpendicular(a),this._addAngledTicks(e,s,r,o),this._addAngledTicks(e,this._mix(s,1,a,l),this._mix(r,1,a,l),this._mid(s,r));break}case k.Parallel:{const r=this._cp2(i,3,0),o=this._cp3(i,r,.5,-1),a=this._sub(r,s);this._normalize(a);const l=this._leftPerp(a),h=this._crossProduct(a,this._sub(o,s));let c=[s,r];e.push(c),c=[],c.push([s[0]+l[0]*h,s[1]+l[1]*h]),c.push([r[0]+l[0]*h,r[1]+l[1]*h]),e.push(c);break}case k.PerpendicularToFirstSegment:{const r=this._cp2(i,3,0),o=this._cp3(i,r,.5,-1),a=this._mid(s,r),l=this._sub(r,s);this._normalize(l);const h=this._crossProduct(l,this._sub(o,s));this._leftPerpendicular(l);const c=[];c.push([a[0]-l[0]*h*.25,a[1]-l[1]*h*.25]),c.push([a[0]+l[0]*h*1.25,a[1]+l[1]*h*1.25]),e.push(c);break}case k.ParallelOffset:{const r=this._cp2(i,3,0),o=this._cp3(i,r,.5,-1),a=this._sub(r,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s));this._leftPerpendicular(a);const h=[];h.push([s[0]-a[0]*l,s[1]-a[1]*l]),h.push([r[0]-a[0]*l,r[1]-a[1]*l]),e.push(h);const c=[];c.push([s[0]+a[0]*l,s[1]+a[1]*l]),c.push([r[0]+a[0]*l,r[1]+a[1]*l]),e.push(c);break}case k.OffsetOpposite:{const r=this._cp2(i,3,0),o=this._cp3(i,r,.5,-1),a=this._sub(r,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s));this._leftPerpendicular(a);const h=[];h.push([s[0]-a[0]*l,s[1]-a[1]*l]),h.push([r[0]-a[0]*l,r[1]-a[1]*l]),e.push(h);break}case k.OffsetSame:{const r=this._cp2(i,3,0),o=this._cp3(i,r,.5,-1),a=this._sub(r,s);this._normalize(a);const l=this._crossProduct(a,this._sub(o,s));this._leftPerpendicular(a);const h=[];h.push([s[0]+a[0]*l,s[1]+a[1]*l]),h.push([r[0]+a[0]*l,r[1]+a[1]*l]),e.push(h);break}case k.CircleWithArc:{let r=this._cp2(i,3,0);const o=this._cp3(i,r,.5,-1);let a,l;if(n>=4)a=i[3],l=this._crossProduct(this._sub(a,r),this._sub(o,r))>0;else{a=r,l=this._crossProduct(this._sub(a,s),this._sub(o,s))>0;const _=24*this._geomUnitsPerPoint,p=this._sub(a,s);this._normalize(p,_);const d=Math.sqrt(2)/2;this._rotateDirect(p,d,l?d:-d),r=this._add(s,p)}const h=this._sub(r,s),c=Math.cos(Math.PI/18),m=Math.sin(Math.PI/18),f=[r];for(let _=1;_<=36;_++)this._rotateDirect(h,c,m),f.push(this._add(s,h));this._add90DegArc(f,r,a,o,l),Le(f[f.length-8],1),e.push(f);break}case k.DoubleJog:{let r,o,a=this._cp2(i,-3,1);if(r=n>=3?i[2]:this._add(s,this._sub(s,a)),n>=4)o=i[3];else{const g=s;s=a,o=r;const y=this._dist(s,g),M=this._dist(o,g);let P=30*this._geomUnitsPerPoint;.5*y0?this._rotateDirect(p,_,-_):this._rotateDirect(p,_,_);let d=[];d.push(a),d.push(this._add(l,p)),d.push(this._sub(l,p)),d.push(s),e.push(d),p=this._sub(o,r),this._normalize(p,f),this._crossProduct(p,this._sub(s,r))<0?this._rotateDirect(p,_,_):this._rotateDirect(p,_,-_),d=[],d.push(r),d.push(this._add(h,p)),d.push(this._sub(h,p)),d.push(o),e.push(d);break}case k.PerpendicularOffset:{const r=this._cp2(i,-4,1),o=this._cp3(i,r,.882353,-1.94),a=this._sub(o,r);this._crossProduct(a,this._sub(s,r))>0?this._rightPerpendicular(a):this._leftPerpendicular(a);const l=[a[0]/8,a[1]/8],h=this._sub(this._mid(r,o),l);e.push([h,s]);break}case k.LineExcludingLastSegment:{const r=this._arrowPath(i),o=[];let a=r.length-2;for(;a--;)o.push(r[a]);e.push(o);break}case k.MultivertexArrow:{const r=this._arrowPath(i),o=[];this._addArrow(o,r,!1),e.push(o);break}case k.CrossedArrow:{const r=this._arrowPath(i),o=[];this._addArrow(o,r,!0),e.push(o);break}case k.ChevronArrow:{const[r,o]=this._arrowLastSeg(i),a=10*this._geomUnitsPerPoint,l=this._sub(s,r);this._normalize(l);const h=this._crossProduct(l,this._sub(o,r)),c=this._leftPerp(l),m=[o[0]-c[0]*h*2,o[1]-c[1]*h*2],f=[];f.push([o[0]+l[0]*a,o[1]+l[1]*a]),f.push(s),f.push([m[0]+l[0]*a,m[1]+l[1]*a]),e.push(f);break}case k.ChevronArrowOffset:{const[r,o]=this._arrowLastSeg(i),a=this._sub(s,r);this._normalize(a);const l=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);const h=[o[0]-a[0]*l,o[1]-a[1]*l],c=[];c.push([h[0]+a[0]*l*.5,h[1]+a[1]*l*.5]),c.push(this._mid(h,s)),c.push([h[0]-a[0]*l*.5,h[1]-a[1]*l*.5]),e.push(c);break}case k.PartialFirstSegment:{const[r,o]=this._arrowLastSeg(i),a=this._sub(s,r);this._normalize(a);const l=this._crossProduct(a,this._sub(o,r));this._leftPerpendicular(a);const h=[o[0]-a[0]*l,o[1]-a[1]*l];e.push([r,h]);break}case k.Arch:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,1),a=this._sub(s,r),l=this._mix(o,1,a,.55),h=this._mix(o,1,a,-.55),c=[s];this._addBezier2(c,s,l,o,4),this._addBezier2(c,o,h,r,4),e.push(c);break}case k.CurvedParallelTicks:{const r=this._cp2(i,-4,1),o=this._cp3(i,r,.882353,-1.94),a=this._sub(o,r);this._crossProduct(a,this._sub(s,r))>0?this._rightPerpendicular(a):this._leftPerpendicular(a);const l=[a[0]/8,a[1]/8],h=this._sub(this._mid(r,o),l),c=this._sub(this._mix(r,.75,o,.25),l),m=this._sub(this._mix(r,.25,o,.75),l),f=[r];this._addBezier2(f,r,c,h,3),this._addBezier2(f,h,m,o,3),e.push(f);for(let _=0;_<8;_++){const p=f[2*_+1],d=[this._clone(p)];d.push(this._add(p,[a[0]/4,a[1]/4])),e.push(d)}break}case k.Arc90Degrees:{const r=this._cp2(i,0,-1),o=this._cp3(i,r,.5,1),a=[r];this._add90DegArc(a,r,s,o),e.push(a);break}case k.FullGeometry:default:e.push(i)}}return e}},Mi=class Dt{static local(){return Dt.instance===null&&(Dt.instance=new Dt),Dt.instance}execute(t,e,i,n,s){return new As(t,e,i)}};Mi.instance=null;let As=class extends be{constructor(t,e,i){super(t,!0,!0),this._curveHelper=new at,this._beginCut=(e.beginCut!==void 0?e.beginCut:1)*i,this._endCut=(e.endCut!==void 0?e.endCut:1)*i,this._middleCut=(e.middleCut!==void 0?e.middleCut:0)*i,this._invert=e.invert!==void 0&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const{_beginCut:e,_endCut:i,_middleCut:n}=this,s=t.pathLength(),r=$.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(e!==0||i!==0||n!==0)if(e+i+n>=s)for(r.startPath();t.nextPoint();)r.pushXY(t.x,t.y);else this._curveHelper.appendSubCurve(r,t,0,e),this._curveHelper.appendSubCurve(r,t,.5*(s-n),.5*(s+n)),this._curveHelper.appendSubCurve(r,t,s-i,i)}else if(e===0&&i===0&&n===0)for(r.startPath();t.nextPoint();)r.pushXY(t.x,t.y);else e+i+n0&&(s/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(i){if(i.pathSize===0)if(s===0){const o=e.segment[0];i.pushXY(o[0],o[1])}else i.pushPoint(this.getSegCoord2D(e.segment,s));const r=e.segment[1];i.pushXY(r[0],r[1])}if(s=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.getSegLength(e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return n!==ut.FAIL&&(e.segmentLength=this.getSegLength(e.segment),e.isPartEnd=!0,n===ut.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,i){i.pathSize===0&&(s===0?i.pushPoint(e.segment[0]):i.pushPoint(this.getSegCoord2D(e.segment,s)));const r=e.abscissa/e.segmentLength;r===1?i.pushPoint(e.segment[1]):i.pushPoint(this.getSegCoord2D(e.segment,r))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)=this._pathCursor.pathSize&&(i=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(i),this._patternLength>0){const n=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,s=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(n+s))/this._patternLength);r<=0&&(r=n+s>0?0:1),this._partLengthRatio=this._partLength/(n+s+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=e;)n-=e,e=this._pattern.nextValue(),r=!r;e-=n,r?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let i=this._walker.nextCurve(e);if(i)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)i.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(i.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,i=this._firstCurve,this._firstCurve=null;return i==null||i.reset(),i}},xi=class Yt{static local(){return Yt.instance===null&&(Yt.instance=new Yt),Yt.instance}execute(t,e,i,n,s,r){return new Fs(t,e,i,n,s,r)}};xi.instance=null;let Fs=class{constructor(t,e,i,n,s,r){switch(this._inputGeometries=t,this._tileKey=n,this._geometryEngine=s,this._maxInflateSize=r*i,this._width=(e.width!==void 0?e.width:2)*i,e.method){case Ft.Mitered:case Ft.Bevelled:case Ft.Rounded:case Ft.TrueBuffer:case Ft.Square:}this._option=e.option}next(){let t;for(;t=this._inputGeometries.next();){if(t.geometryType==="esriGeometryEnvelope"&&this._width>0){const e=t.asJSON();return Math.min(e.xmax-e.xmin,e.ymax-e.ymin)-2*this._width<0?t:$.fromJSONCIM({paths:[[[e.xmin+this._width,e.ymin+this._width],[e.xmax-this._width,e.ymin+this._width],[e.xmax-this._width,e.ymax-this._width],[e.xmin+this._width,e.ymax-this._width],[e.xmin+this._width,e.ymin+this._width]],[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]})}if(t.geometryType==="esriGeometryPolygon"){if(this._width===0)return t.clone();const e=this._geometryEngine;if(e==null)return null;const i=this._tileKey?We(t,this._maxInflateSize):t.clone();if(!i)continue;const n=e.buffer(He.WebMercator,i.asJSON(),-this._width,1);if(n)for(const s of n.rings)s&&i.pushPath(s.reverse());return i}}return null}},Si=class Vt{static local(){return Vt.instance===null&&(Vt.instance=new Vt),Vt.instance}execute(t,e,i,n,s){return new Es(t,e,i)}};Si.instance=null;let Es=class extends be{constructor(t,e,i){super(t,!1,!0),this._curveHelper=new at,this._length=(e.length!==void 0?e.length:20)*i,this._angle=e.angle!==void 0?e.angle:225,this._position=e.position!==void 0?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){const e=$.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(t))return null;t.seekInPath(0);const i=t.x,n=t.y;t.seekInPath(t.pathSize-1);const s=t.x,r=t.y,o=[s-i,r-n];this._curveHelper.normalize(o);const a=i+(s-i)*this._position/100,l=n+(r-n)*this._position/100,h=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const m=[a-this._length/2*h,l-this._length/2*c],f=[a+this._length/2*h,l+this._length/2*c];return e.pushPath([[i,n],m,f,[s,r]]),e}},Ci=class Bt{static local(){return Bt.instance===null&&(Bt.instance=new Bt),Bt.instance}execute(t,e,i,n,s){return new Ns(t,e,i)}};Ci.instance=null;let Ns=class{constructor(t,e,i){this._inputGeometries=t,this._offsetX=e.offsetX!==void 0?e.offsetX*i:0,this._offsetY=e.offsetY!==void 0?e.offsetY*i:0}next(){let t=this._inputGeometries.next();for(;t;){if(t.totalSize>0)return this._move(t.clone(),this._offsetX,this._offsetY);t=this._inputGeometries.next()}return null}_move(t,e,i){for(;t.nextPath();)for(;t.nextPoint();)t.x=t.x+e,t.y=t.y+i;return t.reset(),t}},vi=class Jt{static local(){return Jt.instance===null&&(Jt.instance=new Jt),Jt.instance}execute(t,e,i,n,s,r){return new $s(t,e,i,n,s,r)}};vi.instance=null;let $s=class{constructor(t,e,i,n,s,r){this._inputGeometries=t,this._tileKey=n,this._geometryEngine=s,this._curveHelper=new at,this._offset=(e.offset??1)*i,this._method=e.method,this._maxInflateSize=r*i,this._option=e.option,this._offsetFlattenError=re*i}next(){let t;for(;t=this._inputGeometries.next();){if(this._offset===0)return t.clone();if(t.geometryType==="esriGeometryEnvelope"){if(this._method===St.Rounded&&this._offset>0){const r=wt(t),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=$.createEmptyOptimizedCIM(t.geometryType);return a.pushPath(o),a}return null}const s=t.asJSON();if(st(s)&&Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._offset>0)return $.fromJSONCIM({xmin:s.xmin-this._offset,xmax:s.xmax+this._offset,ymin:s.ymin-this._offset,ymax:s.ymax+this._offset})}const e=this._geometryEngine;if(e==null)continue;const i=this._tileKey?We(t,this._maxInflateSize):t.clone();if(!i)continue;const n=e.offset(He.WebMercator,i.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return n?$.fromJSONCIM(n):null}return null}},wi=class Wt{static local(){return Wt.instance===null&&(Wt.instance=new Wt),Wt.instance}execute(t,e,i,n,s){return new Gs(t,e,i)}};wi.instance=null;let Gs=class{constructor(t,e,i){this._inputGeometries=t,this._reverse=e.reverse===void 0||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if(t.geometryType==="esriGeometryPolyline")return Rs(t.clone());t=this._inputGeometries.next()}return null}};function Rs(u){for(;u.nextPath();)for(let t=0;t0){const e=Ye(t),i=(e[2]+e[0])/2,n=(e[3]+e[1])/2;return t.reset(),this._rotate(t.clone(),i,n)}t=this._inputGeometries.next()}return null}_rotate(t,e,i){const n=Math.cos(this._rotateAngle),s=Math.sin(this._rotateAngle);for(;t.nextPath();)for(;t.nextPoint();){const r=t.x-e,o=t.y-i;t.x=e+r*n-o*s,t.y=i+r*s+o*n}return t.reset(),t}},Ii=class qt{static local(){return qt.instance===null&&(qt.instance=new qt),qt.instance}execute(t,e,i,n,s){return new Ds(t,e,i)}};Ii.instance=null;let Ds=class{constructor(t,e,i){this._inputGeometries=t,this._xFactor=e.XScaleFactor!==void 0?e.XScaleFactor:1.15,this._yFactor=e.YScaleFactor!==void 0?e.YScaleFactor:1.15}next(){const t=this._inputGeometries.next();if(t){if(this._xFactor===1&&this._yFactor===1||t.geometryType==="esriGeometryPoint")return t;if(t.totalSize>0){const e=Ye(t),i=(e[2]+e[0])/2,n=(e[3]+e[1])/2;return t.reset(),this._scaleCursor(t.clone(),i,n)}}return null}_scaleCursor(t,e,i){for(;t.nextPath();)for(;t.nextPoint();)t.x=e+(t.x-e)*this._xFactor,t.y=i+(t.y-i)*this._yFactor;return t.reset(),t}},Li=class jt{static local(){return jt.instance===null&&(jt.instance=new jt),jt.instance}execute(t,e,i,n,s){return new Hs(t,e,i)}};Li.instance=null;let Hs=class{constructor(t,e,i){this._inputGeometries=t,this._height=(e.amplitude!==void 0?e.amplitude:2)*i,this._period=(e.period!==void 0?e.period:3)*i,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new xe,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Se,this._walker.updateTolerance(i)}next(){let t=this._inputGeometries.next();for(;t;){if(this._height===0||this._period===0)return t;const e=this._processGeom(t);if(e)return e;t=this._inputGeometries.next()}return null}_processGeom(t){const e=$.createEmptyOptimizedCIM(t.geometryType);for(;t.nextPath();){e.startPath();const i=t.pathLength();if(this._walker.init(t,this._pattern))switch(this._style){case he.Sinus:default:this._constructCurve(e,i,!1);break;case he.Square:this._constructSquare(e,i);break;case he.Triangle:this._constructTriangle(e,i);break;case he.Random:this._constructCurve(e,i,!0)}else for(;t.nextPoint();)e.pushXY(t.x,t.y)}return e}_constructCurve(t,e,i){let n=Math.round(e/this._period);n===0&&(n=1);const s=n*16+1,r=e/n,o=this._period/16,a=1/s,l=2*Math.PI*e/r,h=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),m=2*Math.PI*Math.random(),f=.75-Math.random()/2,_=.75-Math.random()/2,p=new it;this._walker.curPointAndAngle(p),t.pushPoint(p.pt);let d=0;for(;;){if(!this._walker.nextPointAndAngle(o,p)){t.pushPoint(this._walker.getPathEnd());break}{const g=d;let y;if(d+=a,i){const M=this._height/2*(1+.3*Math.sin(f*l*g+h));y=M*Math.sin(l*g+c),y+=M*Math.sin(_*l*g+m),y/=2}else y=.5*this._height*Math.sin(.5*l*g);t.pushXY(p.pt[0]-y*p.sa,p.pt[1]+y*p.ca)}}}_constructSquare(t,e){Math.round(e/this._period);let i=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const s=new it;this._walker.curPointAndAngle(s);const r=new it;if(this._walker.nextPointAndAngle(this._period,r)){const o=new it;this._walker.nextPointAndAngle(this._period,o)&&(i?(t.pushPoint(s.pt),i=!1):t.pushPoint(s.pt),t.pushXY(s.pt[0]-this._height/2*s.sa,s.pt[1]+this._height/2*s.ca),t.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),t.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),t.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),n=!0)}}if(!n){t.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(t,e){Math.round(e/this._period);let i=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const s=new it;this._walker.curPointAndAngle(s);const r=new it;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new it;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(i?(t.pushPoint(s.pt),i=!1):t.pushPoint(s.pt),t.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),t.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),n=!0)}}if(!n){t.pushPoint(this._walker.getPathEnd());break}}}},zi=class Kt{static local(){return Kt.instance===null&&(Kt.instance=new Kt),Kt.instance}execute(t,e,i,n,s){return new Ys(t,e,i)}};zi.instance=null;let Ys=class extends ne{constructor(t,e,i){super(t),this._geometryWalker=new Se,this._geometryWalker.updateTolerance(i),this._angleToLine=e.angleToLine??!0,this._offset=(e.offset?e.offset:0)*i,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*i,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*i,this._pattern=new xe,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(i),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===tt.WithFullGap&&this.isClosed?this._endings=tt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let n,s=!0;switch(this._endings){case tt.NoConstraint:n=-this._position,n=this._adjustPosition(n),s=!1;break;case tt.WithHalfGap:default:n=-this._pattern.lastValue()/2;break;case tt.WithFullGap:n=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case tt.WithMarkers:n=0;break;case tt.Custom:n=-this._position,n=this._adjustPosition(n),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,s))return null;this._pattern.reset();let r=0;for(;n>r;)n-=r,r=this._pattern.nextValue();r-=n,e=r,this.iteratePath=!0}const i=new it;return this._geometryWalker.nextPointAndAngle(e,i)?this._endings===tt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===tt.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(i.pt[0]-this._offset*i.sa,i.pt[1]+this._offset*i.ca),this._angleToLine&&this.internalPlacement.setRotateCS(i.ca,i.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}},Oi=class Zt{static local(){return Zt.instance===null&&(Zt.instance=new Zt),Zt.instance}execute(t,e,i,n,s){return new Vs(t,e,i)}};Oi.instance=null;let Vs=class extends ne{constructor(t,e,i){super(t,!1,!0),this._curveHelper=new at,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*i:0,this._type=e.extremityPlacement,this._position=e.offsetAlongLine!==void 0?e.offsetAlongLine*i:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case ft.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case ft.JustBegin:e=this._atExtremities(t,this._position,!0);break;case ft.JustEnd:e=this._atExtremities(t,this._position,!1);case ft.None:}return e}_atExtremities(t,e,i){if(i||t.seekPathEnd(),i?t.nextPoint():t.prevPoint()){let n=0,[s,r]=[0,0],[o,a]=[t.x,t.y];for(;i?t.nextPoint():t.prevPoint();){s=o,r=a,o=t.x,a=t.y;const l=this._curveHelper.getLength(s,r,o,a);if(n+l>e){const h=(e-n)/l,[c,m]=this._curveHelper.getAngleCS(s,r,o,a,h),f=this._curveHelper.getCoord2D(s,r,o,a,h);return this.internalPlacement.setTranslate(f[0]-this._offset*m,f[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-m),this.internalPlacement}n+=l}}return null}},Ai=class Qt{static local(){return Qt.instance===null&&(Qt.instance=new Qt),Qt.instance}execute(t,e,i,n,s){return new Bs(t,e,i)}};Ai.instance=null;let Bs=class extends ne{constructor(t,e,i){super(t),this._walker=new Se,this._walker.updateTolerance(i),this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*i:0,this._beginGap=e.beginPosition!==void 0?e.beginPosition*i:0,this._endGap=e.endPosition!==void 0?e.endPosition*i:0,this._flipFirst=e.flipFirst===void 0||e.flipFirst,this._pattern=new xe,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;e=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=t.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;e=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const i=new it;if(!this._walker.nextPointAndAngle(e,i,ut.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(i.pt[0]-this._offset*i.sa,i.pt[1]+this._offset*i.ca);const n=this._isFirst&&this._flipFirst;let s,r;return this._angleToLine?(s=i.ca,r=i.sa):(s=1,r=0),n&&(s=-s,r=-r),this.internalPlacement.setRotateCS(s,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const ct=512,Js=10,W=24,ye=1e-6;let Ti=class te{static local(){return te.instance===null&&(te.instance=new te),te.instance}execute(t,e,i,n,s){return new Ws(t,e,i,n,s)}};Ti.instance=null;let Ws=class Pt{constructor(t,e,i,n,s){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(e.stepX??16)*i,this._stepY=Math.abs(e.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=e.gridType??Ce.Fixed,this._gridType===Ce.Random){const r=e.seed??13,o=1;this._randomLCG=new ci(r*o),this._randomness=(e.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=e.gridAngle??0,this._shiftOddRows=e.shiftOddRows??!1,this._offsetX=(e.offsetX??0)*i,this._offsetY=(e.offsetY??0)*i,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[r,o,a,l]=n.split("/"),h=parseFloat(r),c=parseFloat(o),m=parseFloat(a),f=parseFloat(l);this._graphicOriginX=-(f*2**h+m)*ct,this._graphicOriginY=c*ct,this._testInsidePolygon=!0}this._internalPlacement=new At,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Pt._randValues){Pt._randValues=[];for(let t=0;t=y,this._polygonMin=this._verticalSubdivision?m:_,this._testInsidePolygon){let M=0-this._graphicOriginX-this._offsetX-this._stepX,P=ct-this._graphicOriginX-this._offsetX+this._stepX,b=-ct-this._graphicOriginY-this._offsetY-this._stepY,S=0-this._graphicOriginY-this._offsetY+this._stepY;if(d){const v=[[M,b],[M,S],[P,b],[P,S]];M=b=Number.MAX_VALUE,P=S=-Number.MAX_VALUE;for(const C of v){const I=this._cosAngle*C[0]-this._sinAngle*C[1],L=this._sinAngle*C[0]+this._cosAngle*C[1];M=Math.min(M,I),P=Math.max(P,I),b=Math.min(b,L),S=Math.max(S,L)}}a=a!==Number.MAX_VALUE?Math.max(a,M):M,l=l!==Number.MAX_VALUE?Math.max(l,b):b,h=h!==-Number.MAX_VALUE?Math.min(h,P):P,c=c!==-Number.MAX_VALUE?Math.min(c,S):S}this._xMin=Math.round(a/this._stepX),this._xMax=Math.round(h/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(c/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,_,p,m,f)}_buildAccelerationMap(t,e,i,n,s){t.reset();const r=new Map,o=this._verticalSubdivision,a=o?s-n:i-e;let l=Math.ceil(a/Js);if(l<=1)return;const h=Math.floor(a/l);let c,m,f,_,p,d,g,y,M,P,b;for(l++,this._delta=h,o?(M=-ct-this._stepY,P=this._stepY,b=n):(M=-this._stepX,P=ct+this._stepX,b=e);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(c=t.x,m=t.y;t.nextPoint();c=f,m=_){if(f=t.x,_=t.y,o){if(m===_||mP&&_>P)continue;p=Math.min(m,_),d=Math.max(m,_)}else{if(c===f||cP&&f>P)continue;p=Math.min(c,f),d=Math.max(c,f)}for(;pg&&ei(y,c,m,f,_,r)}this._accelerationMap=r}_nextInside(){for(;;){if(this._currentX>this._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===Ce.Random){const s=(this._currentX%W+W)%W,r=(this._currentY%W+W)%W;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Pt._randValues[r*W+s])*2/3,n=this._graphicOriginY+e+this._stepY*this._randomness*(.5-Pt._randValues[r*W+s+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,e,i){if(this._accelerationMap==null)return Us(t,e,i);t+=ye,e+=ye;const n=this._verticalSubdivision,s=n?e:t,r=Math.floor((s-this._polygonMin)/this._delta),o=this._accelerationMap.get(r);if(!o)return!1;let a,l,h,c=0;for(const m of o){if(a=m[0],l=m[1],n){if(a[1]>e==l[1]>e)continue;h=(l[0]-a[0])*(e-a[1])-(l[1]-a[1])*(t-a[0])}else{if(a[0]>t==l[0]>t)continue;h=(l[1]-a[1])*(t-a[0])-(l[0]-a[0])*(e-a[1])}h>0?c++:c--}return c!==0}};function Us(u,t,e){let i,n,s,r,o=0;for(u+=ye,t+=ye,e.reset();e.nextPath();)if(e.nextPoint())for(i=e.x,n=e.y;e.nextPoint();i=s,n=r)s=e.x,r=e.y,n>t!=r>t&&((s-i)*(t-n)-(r-n)*(u-i)>0?o++:o--);return o!==0}function ei(u,t,e,i,n,s){let r=s.get(u);r||(r=[],s.set(u,r)),r.push([[t,e],[i,n]])}const qs=.001;let Fi=class ee{static local(){return ee.instance===null&&(ee.instance=new ee),ee.instance}execute(t,e,i,n,s){return new js(t,e,i)}};Fi.instance=null;let js=class extends ne{constructor(t,e,i){super(t),this._curveHelper=new at,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*i:0,this._relativeTo=e.relativeTo,this._position=e.startPointOffset!==void 0?e.startPointOffset*i:0,this._epsilon=qs*i}processPath(t){const e=this._position;if(this._relativeTo===Et.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),t.nextPoint()){let[n,s]=[t.x,t.y],[r,o]=[0,0];for(;t.nextPoint();){r=t.x,o=t.y;const a=this._curveHelper.getLength(n,s,r,o);if(an){const m=(n-r)/c,[f,_]=this._curveHelper.getAngleCS(o,a,l,h,m),p=this._curveHelper.getCoord2D(o,a,l,h,m),d=s?-this._offset:this._offset;return this.internalPlacement.setTranslate(p[0]-d*_,p[1]+d*f),this._angleToLine&&(s?this.internalPlacement.setRotateCS(-f,-_):this.internalPlacement.setRotateCS(f,_)),this.internalPlacement}o=l,a=h,r+=c}}return null}};const Ks=1e-15;let Ei=class ie{static local(){return ie.instance===null&&(ie.instance=new ie),ie.instance}execute(t,e,i,n,s){return new Zs(t,e,i)}};Ei.instance=null;let Zs=class extends ne{constructor(t,e,i){super(t),this._curveHelper=new at,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*i:0,this._endPoints=e.placeOnEndPoints===void 0||e.placeOnEndPoints,this._controlPoints=e.placeOnControlPoints===void 0||e.placeOnControlPoints,this._regularVertices=e.placeOnRegularVertices===void 0||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let i=e[0],n=e[1];if(this._offset!==0){const s=Math.cos(e[2]),r=Math.sin(e[2]);i-=this._offset*r,n+=this._offset*s}return this.internalPlacement.setTranslate(i,n),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0,t.seekPathStart();const e=t.isClosed();let i=0,n=!1,s=0,r=0;if(t.seekPathStart(),t.nextPoint()){let o=t.x,a=t.y,l=t.getControlPoint(),h=!0,c=t.nextPoint();for(;c;){const m=t.x,f=t.y,_=t.getControlPoint();(this._angleToLine||this._offset!==0)&&(s=this._curveHelper.getAngle(o,a,m,f,0)),h?(h=!1,e?(i=s,n=l):(this._endPoints||this._controlPoints&&l)&&this._tags.push([o,a,s])):l?this._controlPoints&&this._tags.push([o,a,me(r,s)]):this._regularVertices&&this._tags.push([o,a,me(r,s)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,m,f,1)),c=t.nextPoint(),c||(e?_||n?this._controlPoints&&this._tags.push([m,f,me(r,i)]):this._regularVertices&&this._tags.push([m,f,me(r,i)]):(this._endPoints||this._controlPoints&&_)&&this._tags.push([m,f,r])),o=m,a=f,l=_}}this._tagIterator=0}};function me(u,t){const e=Math.PI;for(;Math.abs(t-u)>e+2*Ks;)t-u>e?t-=2*e:t+=2*e;return(u+t)/2}let Ni=class se{static local(){return se.instance===null&&(se.instance=new se),se.instance}execute(t,e,i,n,s){return new Qs(t,e,i)}};Ni.instance=null;let Qs=class{constructor(t,e,i){this._geometryCursor=t,this._offsetX=e.offsetX!==void 0?e.offsetX*i:0,this._offsetY=e.offsetY!==void 0?e.offsetY*i:0,this._method=e.method!==void 0?e.method:ce.OnPolygon,this._internalPlacement=new At}next(){const t=this._geometryCursor;return this._geometryCursor=null,t?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case ce.CenterOfMass:{const i=Bi(t);i&&(this._internalPlacement.setTranslate(i[0]+this._offsetX,i[1]+this._offsetY),e=!0)}break;case ce.BoundingBoxCenter:{const i=Ye(t);i&&(this._internalPlacement.setTranslate((i[2]+i[0])/2+this._offsetX,(i[3]+i[1])/2+this._offsetY),e=!0)}break;case ce.OnPolygon:default:{const i=Ms(t);i!==null&&(this._internalPlacement.setTranslate(i[0]+this._offsetX,i[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}};function Re(u){if(!u)return null;switch(u.type){case"CIMGeometricEffectAddControlPoints":return gi.local();case"CIMGeometricEffectArrow":return vt.local();case"CIMGeometricEffectBuffer":return yi.local();case"CIMGeometricEffectControlMeasureLine":return Pi.local();case"CIMGeometricEffectCut":return Mi.local();case"CIMGeometricEffectDashes":return bi.local();case"CIMGeometricEffectDonut":return xi.local();case"CIMGeometricEffectJog":return Si.local();case"CIMGeometricEffectMove":return Ci.local();case"CIMGeometricEffectOffset":return vi.local();case"CIMGeometricEffectReverse":return wi.local();case"CIMGeometricEffectRotate":return ki.local();case"CIMGeometricEffectScale":return Ii.local();case"CIMGeometricEffectWave":return Li.local()}return null}function tr(u){if(!u)return null;switch(u.type){case"CIMMarkerPlacementAlongLineSameSize":return zi.local();case"CIMMarkerPlacementAtExtremities":return Oi.local();case"CIMMarkerPlacementAtRatioPositions":return Ai.local();case"CIMMarkerPlacementInsidePolygon":return Ti.local();case"CIMMarkerPlacementOnLine":return Fi.local();case"CIMMarkerPlacementOnVertices":return Ei.local();case"CIMMarkerPlacementPolygonCenter":return Ni.local()}return null}function Oe(u){const t=u.getFrame(0);if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)return t;const e=document.createElement("canvas");e.width=u.width,e.height=u.height;const i=e.getContext("2d");return t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0),e}let $i=class{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}};function er(u){return`rgb(${u.slice(0,3).toString()})`}function Ae(u){return`rgba(${u.slice(0,3).toString()},${u[3]})`}let Gi=class{constructor(t){t&&(this._textRasterizationCanvas=t)}rasterizeText(t,e){var A,R;this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const i=this._textRasterizationCanvas,n=i.getContext("2d");this._setFontProperties(n,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const{decoration:s,weight:r}=e.font;this._lineThroughWidthOffset=s&&s==="line-through"?.1*this._lineHeight:0;const o=e.backgroundColor!=null||e.borderLine!=null,a=o?Ji:0,l=this._computeTextWidth(n,e)+2*a,h=this._lineHeight*this._textLines.length+2*a;if(i.width=l+2*this._lineThroughWidthOffset,i.height=h,i.width===0||i.height===0)return i.width=i.height=1,{size:[0,0],image:new Uint32Array(0),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0,canvas:i};this._renderedLineHeight=Math.round(this._lineHeight*e.pixelRatio),this._renderedHaloSize=rt(e.halo.size)*e.pixelRatio,this._renderedWidth=l*e.pixelRatio,this._renderedHeight=h*e.pixelRatio,this._lineThroughWidthOffset*=e.pixelRatio;const c=e.color??[0,0,0,0],m=e.halo&&e.halo.color?e.halo.color:[0,0,0,0];this._fillStyle=Ae(c),this._haloStyle=er(m);const f=this._renderedLineHeight,_=this._renderedHaloSize;n.save(),n.clearRect(0,0,i.width,i.height),this._setFontProperties(n,e);const p=a*e.pixelRatio,d=ir(n.textAlign,this._renderedWidth-2*p)+_+p,g=_+p,y=_>0;let M=this._lineThroughWidthOffset,P=0;if(o){n.save();const z=e.backgroundColor??[0,0,0,0],E=((A=e.borderLine)==null?void 0:A.color)??[0,0,0,0],V=2*rt(((R=e.borderLine)==null?void 0:R.size)??0);n.fillStyle=Ae(z),n.strokeStyle=Ae(E),n.lineWidth=V,n.fillRect(0,0,i.width,i.height),n.strokeRect(0,0,i.width,i.height),n.restore()}y&&this._renderHalo(n,d,g,M,P,e),P+=g,M+=d;for(const z of this._textLines)y?(n.globalCompositeOperation="destination-out",n.fillStyle="rgb(0, 0, 0)",n.fillText(z,M,P),n.globalCompositeOperation="source-over",n.fillStyle=this._fillStyle,n.fillText(z,M,P)):(n.fillStyle=this._fillStyle,n.fillText(z,M,P)),s&&s!=="none"&&this._renderDecoration(n,M,P,s,r),P+=f;n.restore();const b=this._renderedWidth+2*this._lineThroughWidthOffset,S=this._renderedHeight,v=n.getImageData(0,0,b,S),C=new Uint8Array(v.data);if(e.premultiplyColors){let z;for(let E=0;E600)&&(i+=.3*t.measureText("w").width),i+=2*rt(this._parameters.halo.size),Math.round(i)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&e==="underline"&&(t*=1.3),Math.round(t+2*rt(this._parameters.halo.size))}_renderDecoration(t,e,i,n,s,r){const o=.9*this._lineHeight,a=s==="bold"?.06:s==="bolder"?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if(n==="underline")switch(l){case"top":i+=o;break;case"middle":i+=o/2}else if(n==="line-through")switch(l){case"top":i+=o/1.5;break;case"middle":i+=o/3}const h=r?1.5*r:Math.ceil(o*a);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=h,t.moveTo(e-this._lineThroughWidthOffset,i),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,i),t.stroke(),t.restore()}};function ir(u,t){return u==="center"?.5*t:u==="right"?t:0}var N,G;function xn(u){switch(u){case"left":return N.Left;case"right":return N.Right;case"center":return N.Center}}function Sn(u){switch(u){case"top":return G.Top;case"middle":return G.Center;case"baseline":return G.Baseline;case"bottom":return G.Bottom}}function Cn(u){switch(u){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[N.Right,G.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[N.Center,G.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[N.Left,G.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[N.Right,G.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[N.Center,G.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[N.Left,G.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[N.Right,G.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[N.Center,G.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[N.Left,G.Top];default:return console.debug(`Found invalid placement type ${u}`),[N.Center,G.Center]}}function vn(u){switch(u){case N.Right:return-1;case N.Center:return 0;case N.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${u}`),0}}function wn(u){switch(u){case G.Top:return 1;case G.Center:return 0;case G.Bottom:case G.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${u}`),0}}function kn(u){switch(u){case"left":return N.Left;case"right":return N.Right;case"center":return N.Center}}function In(u){switch(u){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}(function(u){u[u.Left=-1]="Left",u[u.Center=0]="Center",u[u.Right=1]="Right"})(N||(N={})),function(u){u[u.Top=1]="Top",u[u.Center=0]="Center",u[u.Bottom=-1]="Bottom",u[u.Baseline=2]="Baseline"}(G||(G={}));const yt=Math.PI/180,sr=Ve.getLogger("esri.symbols.cim.CIMSymbolDrawHelper"),zt=4,Pe=10,rr=10,Ue=4,Ri=10;let Mt=class q{constructor(t){this._t=t}static createIdentity(){return new q([1,0,0,0,1,0])}clone(){const t=this._t;return new q(t.slice())}transform(t){const e=this._t;return[e[0]*t[0]+e[1]*t[1]+e[2],e[3]*t[0]+e[4]*t[1]+e[5]]}static createScale(t,e){return new q([t,0,0,0,e,0])}scale(t,e){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=e,i[4]*=e,i[5]*=e,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,e){return new q([0,0,t,0,0,e])}translate(t,e){const i=this._t;return i[2]+=t,i[5]+=e,this}static createRotate(t){const e=Math.cos(t),i=Math.sin(t);return new q([e,-i,0,i,e,0])}rotate(t){return q.multiply(this,q.createRotate(t),this)}angle(){const t=this._t[0],e=this._t[3],i=Math.sqrt(t*t+e*e);return[t/i,e/i]}static multiply(t,e,i){const n=t._t,s=e._t,r=n[0]*s[0]+n[3]*s[1],o=n[1]*s[0]+n[4]*s[1],a=n[2]*s[0]+n[5]*s[1]+s[2],l=n[0]*s[3]+n[3]*s[4],h=n[1]*s[3]+n[4]*s[4],c=n[2]*s[3]+n[5]*s[4]+s[5],m=i._t;return m[0]=r,m[1]=o,m[2]=a,m[3]=l,m[4]=h,m[5]=c,i}invert(){const t=this._t;let e=t[0]*t[4]-t[1]*t[3];if(e===0)return new q([0,0,0,0,0,0]);e=1/e;const i=(t[1]*t[5]-t[2]*t[4])*e,n=(t[2]*t[3]-t[0]*t[5])*e,s=t[4]*e,r=-t[1]*e,o=-t[3]*e,a=t[0]*e;return new q([s,r,i,o,a,n])}},Xi=class{constructor(t,e){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new ji(At,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(e||Mt.createIdentity()),this._sizeTransfos.push(e?e.scaleRatio():1)}setTransform(t,e){this._transfos=[t||Mt.createIdentity()],this._sizeTransfos=[e||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const i=e?t.scaleRatio():1;Mt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,i)}}drawMultiLayerSymbol(t,e){if(!t||!e)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const s=this.executeEffects(n,e);if(s){let r=s.next();for(;r;)this.drawSymbolLayers(i,r.asJSON()),r=s.next()}}else this.drawSymbolLayers(i,e)}executeEffects(t,e){const i=this._resourceManager.geometryEngine;let n=new Ge($.fromJSONCIM(e));for(const s of t){const r=Re(s);r&&(n=r.execute(n,s,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,e){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const s=n.effects;if(s&&s.length>0){const r=this.executeEffects(s,e);if(r){let o=null;for(;(o=r.next())&&(this.drawSymbolLayer(n,o.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const i=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,i),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const i=t.markerPlacement;if(i){const n=tr(i);if(n){const s=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;s&&this.pushClipPath(e);const r=n.execute($.fromJSONCIM(e),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(r){let o=null;for(;(o=r.next())&&(this.drawMarker(t,o),!this._earlyReturn););}s&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(qe(e))n.tx=e.x,n.ty=e.y,this.drawMarker(t,n);else if(nt(e)){const s=Ki(e);s&&([n.tx,n.ty]=s,this.drawMarker(t,n))}else for(const s of e.points)if(n.tx=s[0],n.ty=s[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){if(!t)return;const i=this._resourceManager.getResource(t.url),n=x(t.size,Pe);if(i==null||n<=0)return;const s=i.width,r=i.height;if(!s||!r)return;const o=s/r,a=x(t.scaleX,1),l=Mt.createIdentity(),h=t.anchorPoint;if(h){let d=h.x,g=h.y;t.anchorPointUnits!=="Absolute"&&(d*=n*o*a,g*=n),l.translate(-d,-g)}let c=x(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&l.rotate(c*yt);let m=x(t.offsetX),f=x(t.offsetY);if(m||f){if(this._mapRotation){const d=yt*this._mapRotation,g=Math.cos(d),y=Math.sin(d),M=m*y+f*g;m=m*g-f*y,f=M}l.translate(m,f)}const _=this.geomUnitsPerPoint();_!==1&&l.scale(_,_);const p=e.getAngle();p&&l.rotate(p),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,e){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=x(t.size,Pe),s=t.frame,r=s?s.ymax-s.ymin:0,o=n&&r?n/r:1,a=Mt.createIdentity();s&&a.translate(.5*-(s.xmax+s.xmin),.5*-(s.ymax+s.ymin));const l=t.anchorPoint;if(l){let p=l.x,d=l.y;t.anchorPointUnits!=="Absolute"?s&&(p*=s.xmax-s.xmin,d*=s.ymax-s.ymin):(p/=o,d/=o),a.translate(-p,-d)}o!==1&&a.scale(o,o);let h=x(t.rotation);t.rotateClockwise&&(h=-h),this._mapRotation&&(h+=this._mapRotation),h&&a.rotate(h*yt);let c=x(t.offsetX),m=x(t.offsetY);if(c||m){if(this._mapRotation){const p=yt*this._mapRotation,d=Math.cos(p),g=Math.sin(p),y=c*g+m*d;c=c*d-m*g,m=y}a.translate(c,m)}const f=this.geomUnitsPerPoint();f!==1&&a.scale(f,f);const _=e.getAngle();_&&a.rotate(_),a.translate(e.tx,e.ty),this.push(a,t.scaleSymbolsProportionally);for(const p of i)if(p!=null&&p.symbol&&p.geometry||sr.error("Invalid marker graphic",p),this.drawSymbol(p.symbol,p.geometry,p.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(t,e,i){if(!t||!qe(e)||x(t.height,Ri)<=0)return;const n=Mt.createIdentity();let s=x(t.angle);s=-s,s&&n.rotate(s*yt);const r=x(t.offsetX),o=x(t.offsetY);(r||o)&&n.translate(r,o);const a=this.geomUnitsPerPoint();a!==1&&n.scale(a,a),n.translate(e.x,e.y),this.push(n,!1),this.drawText(t,i),this.pop()}_buildHatchPolyline(t,e,i){let n=x(t.separation,Ue)*i,s=x(t.rotation);if(n===0)return null;n<0&&(n=-n);let r=0;const o=.5*n;for(;r>o;)r-=n;for(;r<-o;)r+=n;const a=Zi();Qi(a,e),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const l=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;s>180;)s-=180;for(;s<0;)s+=180;const h=Math.cos(s*yt),c=Math.sin(s*yt),m=-n*c,f=n*h;let _,p,d,g;r=x(t.offsetX)*i*c-x(t.offsetY)*i*h,_=d=Number.MAX_VALUE,p=g=-Number.MAX_VALUE;for(const C of l){const I=C[0],L=C[1],A=h*I+c*L,R=-c*I+h*L;_=Math.min(_,A),d=Math.min(d,R),p=Math.max(p,A),g=Math.max(g,R)}d=Math.floor(d/n)*n;let y=h*_-c*d-m*r/n,M=c*_+h*d-f*r/n,P=h*p-c*d-m*r/n,b=c*p+h*d-f*r/n;const S=1+Math.round((g-d)/n),v=[];for(let C=0;C0))if(nt(t))this._processPath(t.rings,0);else if(bt(t))this._processPath(t.paths,0);else if(st(t)){const e=xt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,i){if(!t||this._clipCount>0)return;const n=.5*this.transformSize(x(i,zt));if(nt(t))this._processPath(t.rings,n);else if(bt(t))this._processPath(t.paths,n);else if(st(t)){const s=xt(t);s&&this._processPath(s.rings,n)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){nt(e)&&t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){const{url:i}=t,n=x(t.scaleX,1);let s=n*e,r=e;const o=this._resourceManager.getResource(i);e||o==null||(s=n*o.width,r=o.height),this._merge(this.transformPt([-s/2,-r/2]),0),this._merge(this.transformPt([-s/2,r/2]),0),this._merge(this.transformPt([s/2,-r/2]),0),this._merge(this.transformPt([s/2,r/2]),0)}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new Gi);const i=Di(t),[n,s]=this._textRasterizer.computeTextSize(e,i);let r=0;switch(t.horizontalAlignment){case"Left":r=n/2;break;case"Right":r=-n/2}let o=0;switch(t.verticalAlignment){case"Bottom":o=s/2;break;case"Top":o=-s/2;break;case"Baseline":o=s/6}this._merge(this.transformPt([-n/2+r,-s/2+o]),0),this._merge(this.transformPt([-n/2+r,s/2+o]),0),this._merge(this.transformPt([n/2+r,-s/2+o]),0),this._merge(this.transformPt([n/2+r,s/2+o]),0)}_processPath(t,e){if(t)for(const i of t){const n=i?i.length:0;if(n>1){this._merge(this.transformPt(i[0]),e);for(let s=1;sthis._xmax&&(this._xmax=t[0]+e),t[1]-ethis._ymax&&(this._ymax=t[1]+e)}};class or extends Xi{constructor(t,e,i,n){super(e,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new vs,this._ctx=t}drawSolidFill(t,e){if(!t)return;if(nt(t))this._buildPath(t.rings,!0);else if(bt(t))this._buildPath(t.paths,!0);else if(st(t))this._buildPath(xt(t).rings,!0);else{if(!ve(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof e=="string"?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,e,i,n,s,r){if(!t||!e||i===0)return;if(nt(t))this._buildPath(t.rings,!0);else if(bt(t))this._buildPath(t.paths,!1);else{if(!st(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(xt(t).rings,!0)}const o=this._ctx;o.strokeStyle=typeof e=="string"?e:"rgba("+Math.round(e[0])+","+Math.round(e[1])+","+Math.round(e[2])+","+(e[3]??255)/255+")",o.lineWidth=Math.max(this.transformSize(i),.5),this._setCapStyle(n),this._setJoinStyle(s),o.miterLimit=r,o.stroke()}pushClipPath(t){if(this._ctx.save(),nt(t))this._buildPath(t.rings,!0);else if(bt(t))this._buildPath(t.paths,!0);else{if(!st(t))return;this._buildPath(xt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,e){const{colorSubstitutions:i,url:n,tintColor:s}=t,r=x(t.scaleX,1),o=this._resourceManager.getResource(n);if(o==null)return;let a=e*(o.width/o.height),l=e;e||(a=o.width,l=o.height);const h=It(n)||"src"in o&&It(o.src);let c="getFrame"in o?Oe(o):o;i&&(c=this._colorSubstitutionHelper.applyColorSubstituition(c,i)),this._applyAdditionalRenderProps&&!h&&s&&(c=this._colorSubstitutionHelper.tintImageData(c,s));const m=this.transformPt([0,0]),[f,_]=this.getTransformAngle(),p=this.transformSize(1),d=this._ctx;d.save(),d.setTransform({m11:r*p*f,m12:r*p*_,m21:-p*_,m22:p*f,m41:m[0],m42:m[1]}),d.drawImage(c,-a/2,-l/2,a,l),d.restore()}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new Gi);const i=Di(t);i.size*=this.transformSize(Ot(1));const n=this._textRasterizer.rasterizeText(e,i);if(!n)return;const{size:s,anchorX:r,anchorY:o,canvas:a}=n,l=s[0]*(r+.5),h=s[1]*(o-.5),c=this._ctx,m=this.transformPt([0,0]),[f,_]=this.getTransformAngle(),p=1;c.save(),c.setTransform({m11:p*f,m12:p*_,m21:-p*_,m22:p*f,m41:m[0]-p*l,m42:m[1]+p*h}),c.drawImage(a,0,0),c.restore()}drawPictureFill(t,e){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:s,offsetY:r,rotation:o,scaleX:a,tintColor:l,url:h}=e;const c=this._resourceManager.getResource(h);if(c==null)return;if(nt(t))this._buildPath(t.rings,!0);else if(bt(t))this._buildPath(t.paths,!0);else if(st(t))this._buildPath(xt(t).rings,!0);else{if(!ve(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const m=this._ctx,f=It(h)||"src"in c&&It(c.src);let _,p="getFrame"in c?Oe(c):c;if(i&&(p=this._colorSubstitutionHelper.applyColorSubstituition(p,i)),this._applyAdditionalRenderProps){f||l&&(p=this._colorSubstitutionHelper.tintImageData(p,l)),_=m.createPattern(p,"repeat");const d=this.transformSize(1);o||(o=0),s?s*=d:s=0,r?r*=d:r=0,n&&(n*=d);const g=n?n/c.height:1,y=a&&n?a*n/c.width:1;if(o!==0||g!==1||y!==1||s!==0||r!==0){const M=new DOMMatrix;M.rotateSelf(0,0,-o).translateSelf(s,r).scaleSelf(y,g,1),_.setTransform(M)}}else _=m.createPattern(p,"repeat");m.save(),m.fillStyle=_,m.fill("evenodd"),m.restore()}drawPictureStroke(t,e){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:s,miterLimit:r,tintColor:o,url:a,width:l}=e;const h=this._resourceManager.getResource(a);if(h==null)return;let c;if(nt(t))c=t.rings;else if(bt(t))c=t.paths;else{if(!st(t))return ve(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;c=xt(t).rings}l||(l=h.width);const m=It(a)||"src"in h&&It(h.src);let f="getFrame"in h?Oe(h):h;i&&(f=this._colorSubstitutionHelper.applyColorSubstituition(f,i)),this._applyAdditionalRenderProps&&(m||o&&(f=this._colorSubstitutionHelper.tintImageData(f,o)));const _=Math.max(this.transformSize(rt(l)),.5),p=_/f.width,d=this._ctx,g=d.createPattern(f,"repeat-y");let y,M;d.save(),this._setCapStyle(n),this._setJoinStyle(s),r!==void 0&&(d.miterLimit=r),d.lineWidth=_;for(let P of c)if(P=ot(P),hr(P),P&&!(P.length<=1)){y=this.transformPt(P[0]);for(let b=1;b1){let r=this.transformPt(n[0]);i.moveTo(r[0],r[1]);for(let o=1;ou?{spatialReference:u.spatialReference,rings:[[[u.xmin,u.ymin],[u.xmin,u.ymax],[u.xmax,u.ymax],[u.xmax,u.ymin],[u.xmin,u.ymin]]]}:null;function Di(u,t=1){var g;const e=Be(u),i=Je(u.fontStyleName),n=u.fontFamilyName??Wi,{weight:s,style:r}=i,o=t*(u.height||5),a=ui(u.horizontalAlignment),l=fi(u.verticalAlignment),h=Ct(u),c=Ct(u.haloSymbol),m=c?t*(0|u.haloSize):0,f=((g=u.callout)==null?void 0:g.type)==="CIMBackgroundCallout"?u.callout.backgroundSymbol:null,_=Ct(f),p=$e(f),d=_e(f);return{color:h,size:o,horizontalAlignment:a,verticalAlignment:l,font:{family:n,style:Ui(r),weight:qi(s),decoration:e},halo:{size:m||0,color:c,style:r},backgroundColor:_,borderLine:p!=null&&d!=null?{size:p,color:d}:null,pixelRatio:1,premultiplyColors:!0}}const lr=1e-4;function hr(u){let t,e,i,n,s,r=u[0],o=1;for(;oh.width&&h.width>0?_*h.width:_),lineDashEnding:m,controlPointEnding:D.FullPattern}]:void 0;r.push({type:"CIMSolidStroke",capStyle:c?j.Round:j.Butt,enable:!0,width:h.width!=null&&h.width>.667?rt(Math.round(Ot(h.width))):h.width,color:Y(h.color),effects:f})}else!e||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[o,a]=$t(n):([o,a]=$t(n),r.push({type:"CIMSolidStroke",enable:!0,width:e,color:Y(s)}));r.push({type:"CIMSolidFill",enable:!0,color:Y(s)});const l={type:"CIMPolygonSymbol",symbolLayers:r};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:x(-t.angle),size:x(t.size||6*e),offsetX:x(t.xoffset),offsetY:x(t.yoffset),frame:o,markerGraphics:[{type:"CIMMarkerGraphic",geometry:a,symbol:l}]}]}}static fromCIMHatchFill(t,e){var a;const i=e*(t.separation??Ue),n=i/2,s=ot(t.lineSymbol);(a=s.symbolLayers)==null||a.forEach(l=>{var h;switch(l.type){case"CIMSolidStroke":l.width!=null&&(l.width*=e),(h=l.effects)==null||h.forEach(c=>{c.type==="CIMGeometricEffectDashes"&&(c.dashTemplate=c.dashTemplate.map(m=>m*e))});break;case"CIMVectorMarker":{l.size!=null&&(l.size*=e);const c=l.markerPlacement;c!=null&&"placementTemplate"in c&&(c.placementTemplate=c.placementTemplate.map(m=>m*e));break}}});let r=this._getLineSymbolPeriod(s)||ii;for(;r{Me.error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const s=this._getPlacementRepeat(i.markerPlacement);if(s)return s}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const i=e.dashTemplate;if(i&&i.length){let n=0;for(const s of i)n+=s;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return e.period;default:Me.error(`unsupported geometric effect type ${e.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let i=0;for(const n of e)i+=+n;return 1&e.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const e=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(e.stepX),s=Math.abs(e.stepY),r=(e.randomness??100)/100;let o,a,l,h;if(e.gridType==="Random"){const c=Ot(_i),m=Math.max(Math.floor(c/n),1),f=Math.max(Math.floor(c/s),1);o=m*n/2,a=f*s/2,l=2*a;const _=new ci(e.seed),p=r*n/1.5,d=r*s/1.5;h=[];for(let g=0;g({type:"CIMMarkerGraphic",geometry:c,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}static getSize(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let e=0;if(t.symbolLayers){for(const i of t.symbolLayers)if(i)switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=i.size;n!=null&&n>e&&(e=n);break}}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(t.symbolLayers){for(const i of t.symbolLayers)if(i)switch(i.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const n=i.width;n!=null&&n>e&&(e=n);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(i.markerPlacement&&hs(i.markerPlacement)){const n=i.size;n!=null&&n>e&&(e=n)}}}return e}}}static getMarkerScaleRatio(t){if(t&&t.type==="CIMVectorMarker"&&t.scaleSymbolsProportionally!==!1&&t.frame&&t.size!=null){const e=t.frame.ymax-t.frame.ymin;return t.size/e}return 1}}class O{static findApplicableOverrides(t,e,i){if(t&&e){if(t.primitiveName){let n=!1;for(const s of i)if(s.primitiveName===t.primitiveName){n=!0;break}if(!n)for(const s of e)s.primitiveName===t.primitiveName&&i.push(s)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const n of t.effects)O.findApplicableOverrides(n,e,i);if(t.symbolLayers)for(const n of t.symbolLayers)O.findApplicableOverrides(n,e,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(t.effects)for(const n of t.effects)O.findApplicableOverrides(n,e,i);if(t.markerPlacement&&O.findApplicableOverrides(t.markerPlacement,e,i),t.type==="CIMVectorMarker"){if(t.markerGraphics)for(const n of t.markerGraphics)O.findApplicableOverrides(n,e,i),O.findApplicableOverrides(n.symbol,e,i)}else t.type==="CIMCharacterMarker"?O.findApplicableOverrides(t.symbol,e,i):t.type==="CIMHatchFill"?O.findApplicableOverrides(t.lineSymbol,e,i):t.type==="CIMPictureMarker"&&O.findApplicableOverrides(t.animatedSymbolProperties,e,i)}}}static findEffectOverrides(t,e,i){if(!e||!t)return;const n=t.length;for(let s=0;s{var f;return!((f=m.valueExpressionInfo)!=null&&f.expression.includes("$feature"))})),o||(l=l.filter(m=>{var f;return!((f=m.valueExpressionInfo)!=null&&f.expression.includes("$view"))})),l.length>0){const m=cs(e.attributes);await O.evaluateOverrides(l,e,{spatialReference:i,fields:m,geometryType:s},r,o)}O.applyOverrides(a,l)}return n&&O.applyDictionaryTextOverrides(a,e,n),a}static async evaluateOverrides(t,e,i,n,s){if(!e)return;let r;for(const o of t){const a=o.valueExpressionInfo;if(a&&(i!=null&&i.geometryType)){r||(r=[]),o.value=void 0;const l=mi(a.expression,i.spatialReference,i.fields).then(h=>{o.value=Lt(h,e,{$view:s},i.geometryType,n)});r.push(l)}}r!==void 0&&r.length>0&&await Promise.all(r)}static applyDictionaryTextOverrides(t,e,i,n="Normal"){if(t!=null&&t.type)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const s=t.symbolLayers;if(!s)return;for(const r of s)r&&r.type==="CIMVectorMarker"&&O.applyDictionaryTextOverrides(r,e,i,t.type==="CIMTextSymbol"?t.textCase:n)}break;case"CIMVectorMarker":{const s=t.markerGraphics;if(!s)return;for(const r of s)r&&O.applyDictionaryTextOverrides(r,e,i)}break;case"CIMMarkerGraphic":{const s=t.textString;if(s&&s.includes("[")){const r=us(s,i);t.textString=fs(e,r,n)}}}}static applyOverrides(t,e,i,n){if(t.primitiveName){for(const s of e)if(s.primitiveName===t.primitiveName){const r=yr(s.propertyName);if(n&&n.push({cim:t,nocapPropertyName:r,value:t[r]}),s.expression&&(s.value=O.toValue(s.propertyName,s.expression)),i){let o=!1;for(const a of i)a.primitiveName===t.primitiveName&&(o=!0);o||i.push(s)}s.value!=null&&(t[r]=s.value)}}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const s of t.effects)O.applyOverrides(s,e,i,n);if(t.symbolLayers)for(const s of t.symbolLayers)O.applyOverrides(s,e,i,n);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects)for(const s of t.effects)O.applyOverrides(s,e,i,n);if(t.type==="CIMVectorMarker"&&t.markerGraphics)for(const s of t.markerGraphics)O.applyOverrides(s,e,i,n),O.applyOverrides(s.symbol,e,i,n)}}static restoreOverrides(t){for(const e of t)e.cim[e.nocapPropertyName]=e.value}static buildOverrideKey(t){let e="";for(const i of t)i.value!==void 0&&(e+=`${i.primitiveName}${i.propertyName}${JSON.stringify(i.value)}`);return e}static toValue(t,e){if(t==="DashTemplate")return e.split(" ").map(i=>Number(i));if(t==="Color"){const i=new pi(e).toRgba();return i[3]*=255,i}return e}}const Yi=u=>{if(!u)return j.Butt;switch(u){case"butt":return j.Butt;case"square":return j.Square;case"round":return j.Round}},Vi=u=>{if(!u)return mt.Miter;switch(u){case"miter":return mt.Miter;case"round":return mt.Round;case"bevel":return mt.Bevel}},fr=u=>{if(u==null)return"Center";switch(u){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},mr=u=>{if(u==null)return"Center";switch(u){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Y=u=>{if(!u)return[0,0,0,0];const{r:t,g:e,b:i,a:n}=u;return[t,e,i,255*n]},pr=(u,t)=>{const e=_r(t),i=dr(u);return e&&i?`${e}-${i}`:`${e}${i}`},_r=u=>{if(!u)return"";switch(u.toLowerCase()){case"bold":case"bolder":return"bold"}return""},dr=u=>{if(!u)return"";switch(u.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Xe=(u,t)=>{const e=ms("safari")?.001:0,i=t==="butt";switch(u){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,e,4];case"dot":case"esriSLSDot":return i?[1,3]:[e,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,e,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,e,4,e,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,e,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,e,2,e,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[e,2];case"solid":case"esriSLSSolid":case"none":return Me.error("Unexpected: style does not require rasterization"),[0,0];default:return Me.error(`Tried to rasterize SLS, but found an unexpected style: ${u}!`),[0,0]}},$t=(u,t=100)=>{const e=t/2;let i,n;const s=u;if(s==="circle"||s==="esriSMSCircle"){let o=Math.acos(1-.25/e),a=Math.ceil(Hi/o/4);a===0&&(a=1),o=cr/a,a*=4;const l=[];l.push([e,0]);for(let h=1;hu==="vertical"||u==="horizontal"||u==="cross"||u==="esriSFSCross"||u==="esriSFSVertical"||u==="esriSFSHorizontal",yr=u=>u&&u.charAt(0).toLowerCase()+u.substr(1);function Pr(u,t,e){if(!(!u.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void e.push(t.geometryEnginePromise);ps(u.effects)&&(t.geometryEnginePromise=_s(),e.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function ri(u){if(!u)return null;let t=null;const{cap:e,color:i,join:n,miterLimit:s,style:r,width:o}=u;return r!=="solid"&&r!=="none"&&r!=="esriSLSSolid"&&r!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Xe(r,e),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:r!=="esriSLSNull"&&r!=="none"?Y(i):[0,0,0,0],capStyle:Yi(e),joinStyle:Vi(n),miterLimit:s,width:o,effects:t}}const ni=.05;function Mr(u){return Math.max(Math.round(u/ni),1)*ni}const br=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function xr(u,t){return br.has(t)?Mr(u):u}function Sr(u){var t;if(!u)return null;switch(u.type){case"CIMPointSymbol":{const e=u.symbolLayers;return e&&e.length===1?Sr(e[0]):null}case"CIMVectorMarker":{const e=u.markerGraphics;if(!e||e.length!==1)return null;const i=e[0];if(!i)return null;const n=i.geometry;if(!n)return null;const s=i.symbol;return!s||s.type!=="CIMPolygonSymbol"&&s.type!=="CIMLineSymbol"||(t=s.symbolLayers)!=null&&t.some(r=>!!r.effects)?null:{geom:n,asFill:s.type==="CIMPolygonSymbol"}}case"sdf":return{geom:u.geom,asFill:u.asFill}}return null}function Cr(u){return u?u.rings?u.rings:u.paths?u.paths:u.xmin!==void 0&&u.ymin!==void 0&&u.xmax!==void 0&&u.ymax!==void 0?[[[u.xmin,u.ymin],[u.xmin,u.ymax],[u.xmax,u.ymax],[u.xmax,u.ymin],[u.xmin,u.ymin]]]:null:null}function vr(u){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of u)for(const r of s)r[0]e&&(e=r[0]),r[1]n&&(n=r[1]);return new $i(t,i,e-t,n-i)}function oi(u){let t=1/0,e=-1/0,i=1/0,n=-1/0;for(const s of u)for(const r of s)r[0]e&&(e=r[0]),r[1]n&&(n=r[1]);return[t,i,e,n]}function ai(u){return u?u.rings?oi(u.rings):u.paths?oi(u.paths):st(u)?[u.xmin,u.ymin,u.xmax,u.ymax]:null:null}function li(u,t,e,i,n){const[s,r,o,a]=u;if(o0&&(P=(t.xmax-t.xmin)/(t.ymax-t.ymin),y=i.x/(e*P),M=i.y/e):(y=i.x,M=i.y)),t&&(y=.5*(t.xmax+t.xmin)+y*(t.xmax-t.xmin),M=.5*(t.ymax+t.ymin)+M*(t.ymax-t.ymin)),y-=s,M-=r,y*=_,M*=_,y+=f,M+=f;let b=y/p-.5,S=M/d-.5;return n&&e&&(b*=e*P,S*=e),[g,b,S]}function On(u){const t=Cr(u.geom),e=vr(t),i=128,n=di,s=Math.floor(.5*(.5*i-n)),r=(i-2*(s+n))/Math.max(e.width,e.height),o=Math.round(e.width*r)+2*s,a=Math.round(e.height*r)+2*s,l=[];for(const c of t)if(c&&c.length>1){const m=[];for(const f of c){let[_,p]=f;_-=e.x,p-=e.y,_*=r,p*=r,_+=s-.5,p+=s-.5,u.asFill?m.push([_,p]):m.push([Math.round(_),Math.round(p)])}if(u.asFill){const f=m.length-1;m[0][0]===m[f][0]&&m[0][1]===m[f][1]||m.push(m[0])}l.push(m)}const h=wr(l,o,a,s);return u.asFill&&kr(l,o,a,s,h),[Ir(h,s),o,a]}function wr(u,t,e,i){const n=t*e,s=new Array(n),r=i*i+1;for(let o=0;ot&&(g=t),y<0&&(y=0),M>e&&(M=e);const P=c[0]-h[0],b=c[1]-h[1],S=P*P+b*b;for(let v=d;vS?(I=c[0],L=c[1]):(A/=S,I=h[0]+A*P,L=h[1]+A*b);const R=(v-I)*(v-I)+(C-L)*(C-L),z=(e-C-1)*t+v;Rt-i&&(p=t-i),de-i&&(g=e-i);for(let y=d;yy==l[1]>y)continue;const M=(e-y-1)*t;for(let P=_;P>8^e)+i|0;while(--i!=0)}return(1+e/(1<<31))/2}function Or(u){return Math.floor(zr(u,Ar)*Tr)}const Ar=53290320,Tr=10,Fr=Ve.getLogger("esri.symbols.cim.cimAnalyzer");function Te(u){switch(u){case"Butt":return we.BUTT;case"Square":return we.SQUARE;default:return we.ROUND}}function Fe(u){switch(u){case"Bevel":return ke.BEVEL;case"Miter":return ke.MITER;default:return ke.ROUND}}function Er(u){const t=u.markerPlacement;return t&&t.angleToLine?ge.MAP:ge.SCREEN}class An{constructor(t,e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],this._resourceManager=t,this._info=e}async analyzeSymbolReference(t,e,i){if(this._cimLayers=i??[],!t)return this._cimLayers;if(t.primitiveOverrides){this._primitiveOverrides=t.primitiveOverrides,this._poMap={};const r=[],o=this._info;for(const a of this._primitiveOverrides){const l=a.valueExpressionInfo;if(l&&o){const h=l.expression,c=mi(h,o.spatialReference,o.fields).then(m=>{m!=null&&this._setPoMap(a.primitiveName,a.propertyName,m)});r.push(c)}else a.value!=null&&this._setPoMap(a.primitiveName,a.propertyName,a.value);r.length>0&&await Promise.all(r)}}const n=t.symbol,s=[];return kt.fetchResources(n,this._resourceManager,s),s.length>0&&await Promise.all(s),this._analyzeSymbol(n,e),this._cimLayers}_analyzeSymbol(t,e){switch(t==null?void 0:t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(t,e,1,0,0,0)}}_analyzeMultiLayerSymbol(t,e,i,n,s,r){const o=t==null?void 0:t.symbolLayers;if(!o)return;const a=t.effects;let l=ge.SCREEN;const h=kt.getSize(t)??0;t.type==="CIMPointSymbol"&&t.angleAlignment==="Map"&&(l=ge.MAP);const c=t.type==="CIMPolygonSymbol";let m=o.length;for(;m--;){const f=o[m];if(!f||f.enable===!1)continue;let _;a!=null&&a.length&&(_=[...a]);const p=f.effects;p!=null&&p.length&&(a?_.push(...p):_=[...p]);const d=[];let g;O.findEffectOverrides(_,this._primitiveOverrides,d),g=d.length>0?this._createEffectsOverrideFunction(_,d):_;const y=[];switch(O.findApplicableOverrides(f,this._primitiveOverrides,y),f.type){case"CIMSolidFill":this._analyzeSolidFill(f,g);break;case"CIMPictureFill":this._analyzePictureFill(f,g);break;case"CIMHatchFill":this._analyzeHatchFill(f,g);break;case"CIMGradientFill":this._analyzeGradientFill(f,g);break;case"CIMSolidStroke":this._analyzeSolidStroke(f,g,c,h);break;case"CIMPictureStroke":this._analyzePictureStroke(f,g,c,h);break;case"CIMGradientStroke":this._analyzeGradientStroke(f,g,c,h);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{t.type==="CIMLineSymbol"&&(l=Er(f));const M=[],P=f.primitiveName;P&&M.push(P),this._analyzeMarker(f,g,null,M,l,h,1,e,i,n,s,r);break}default:Fr.error("Cannot analyze CIM layer",f.type)}}}_analyzeSolidFill(t,e){const i=t.primitiveName,n=H(t.color),[s,r]=this._analyzePrimitiveOverrides(i,e,null,null),o=F(JSON.stringify(t)+r).toString();this._cimLayers.push({type:"fill",templateHash:o,materialHash:s?()=>o:o,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,color:this._createOverrideFunction(i,"Color",n,X),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:e,applyRandomOffset:!1,sampleAlphaOnly:!0})}_analyzePictureFill(t,e){const i=t.primitiveName,n=ue(t),[s,r]=this._analyzePrimitiveOverrides(i,e,null,null),o=F(JSON.stringify(t)+r).toString(),a=F(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),l=x(t.height,rr);let h=x(t.scaleX,1);if("width"in t&&typeof t.width=="number"){const c=t.width;let m=1;const f=this._resourceManager.getResource(t.url);f!=null&&(m=f.width/f.height),h/=m*(l/c)}this._cimLayers.push({type:"fill",templateHash:o,materialHash:s?()=>a:a,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:this._createOverrideFunction(i,"TintColor",n,X),height:this._createOverrideFunction(i,"Height",l),scaleX:this._createOverrideFunction(i,"ScaleX",h),angle:this._createOverrideFunction(i,"Rotation",x(t.rotation)),offsetX:this._createOverrideFunction(i,"OffsetX",x(t.offsetX)),offsetY:this._createOverrideFunction(i,"OffsetY",x(t.offsetY)),url:t.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeHatchFill(t,e){var m,f;const i=t.primitiveName,n=this._analyzeMaterialOverrides(i,["Rotation","OffsetX","OffsetY"]);let[s,r]=this._analyzePrimitiveOverrides(i,e,null,null);const o=F(JSON.stringify(t)+r).toString(),a=F(`${t.separation}${JSON.stringify(t.lineSymbol)}`).toString();let l={r:255,g:255,b:255,a:1},h=!1;const c=(f=(m=t.lineSymbol)==null?void 0:m.symbolLayers)==null?void 0:f.find(_=>{var p;return _.type==="CIMSolidStroke"&&((p=this._poMap[_.primitiveName])==null?void 0:p.Color)!=null});if(c){l=H(c.color),l=this._createOverrideFunction(c.primitiveName,"Color",l,X);const _=typeof l=="function";s=s||_,h=c.color!=null||_}this._cimLayers.push({type:"fill",templateHash:o,materialHash:s&&n?this._createMaterialHashFunction(a,n):a,cim:t,materialOverrides:n,colorLocked:!!t.colorLocked,effects:e,color:l,height:this._createOverrideFunction(i,"Separation",x(t.separation,Ue)),scaleX:1,angle:this._createOverrideFunction(i,"Rotation",x(t.rotation)),offsetX:this._createOverrideFunction(i,"OffsetX",x(t.offsetX)),offsetY:this._createOverrideFunction(i,"OffsetY",x(t.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!h})}_analyzeGradientFill(t,e){const i=t.primitiveName,[n,s]=this._analyzePrimitiveOverrides(i,e,null,null),r=F(JSON.stringify(t)+s).toString();this._cimLayers.push({type:"fill",templateHash:r,materialHash:n?()=>r:r,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}_analyzeSolidStroke(t,e,i,n){const s=t.primitiveName,r=H(t.color),o=x(t.width,zt),a=Te(t.capStyle),l=Fe(t.joinStyle),h=t.miterLimit,[c,m]=this._analyzePrimitiveOverrides(s,e,null,null),f=F(JSON.stringify(t)+m).toString();let _,p;if(e&&e instanceof Array&&e.length>0){const d=e[e.length-1];if(d.type==="CIMGeometricEffectDashes"&&d.lineDashEnding==="NoConstraint"&&d.offsetAlongLine===null){const g=(e=[...e]).pop();_=g.dashTemplate,p=g.scaleDash}}this._cimLayers.push({type:"line",templateHash:f,materialHash:c?()=>f:f,cim:t,materialOverrides:null,isOutline:i,colorLocked:!!t.colorLocked,effects:e,color:this._createOverrideFunction(s,"Color",r,X),width:this._createOverrideFunction(s,"Width",o),cap:this._createOverrideFunction(s,"CapStyle",a),join:this._createOverrideFunction(s,"JoinStyle",l),miterLimit:h&&this._createOverrideFunction(s,"MiterLimit",h),referenceWidth:n,zOrder:Ee(t.name),dashTemplate:_,scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(t,e,i,n){const s=F(`${t.url}${JSON.stringify(t.colorSubstitutions)}`).toString(),r=t.primitiveName,o=ue(t),a=x(t.width,zt),l=Te(t.capStyle),h=Fe(t.joinStyle),c=t.miterLimit,[m,f]=this._analyzePrimitiveOverrides(r,e,null,null),_=F(JSON.stringify(t)+f).toString();this._cimLayers.push({type:"line",templateHash:_,materialHash:m?()=>s:s,cim:t,materialOverrides:null,isOutline:i,colorLocked:!!t.colorLocked,effects:e,color:this._createOverrideFunction(r,"TintColor",o,X),width:this._createOverrideFunction(r,"Width",a),cap:this._createOverrideFunction(r,"CapStyle",l),join:this._createOverrideFunction(r,"JoinStyle",h),miterLimit:c&&this._createOverrideFunction(r,"MiterLimit",c),referenceWidth:n,zOrder:Ee(t.name),dashTemplate:null,scaleDash:!1,url:t.url,sampleAlphaOnly:!1})}_analyzeGradientStroke(t,e,i,n){const s=t.primitiveName,r=x(t.width,zt),o=Te(t.capStyle),a=Fe(t.joinStyle),l=t.miterLimit,[h,c]=this._analyzePrimitiveOverrides(s,e,null,null),m=F(JSON.stringify(t)+c).toString();this._cimLayers.push({type:"line",templateHash:m,materialHash:h?()=>m:m,cim:t,materialOverrides:null,isOutline:i,colorLocked:!!t.colorLocked,effects:e,color:{r:128,g:128,b:128,a:1},width:this._createOverrideFunction(s,"Width",r),cap:this._createOverrideFunction(s,"CapStyle",o),join:this._createOverrideFunction(s,"JoinStyle",a),miterLimit:l&&this._createOverrideFunction(s,"MiterLimit",l),referenceWidth:n,zOrder:Ee(t.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(t,e,i,n,s,r,o,a,l,h,c,m,f=!1){if(this._analyzeMarkerInsidePolygon(t,e))return;const _=x(t.size,Pe),p=x(t.rotation),d=x(t.offsetX),g=x(t.offsetY);let y=this._createOverrideFunction(t.primitiveName,"Size",_),M=this._createOverrideFunction(t.primitiveName,"Rotation",p),P=this._createOverrideFunction(t.primitiveName,"OffsetX",d),b=this._createOverrideFunction(t.primitiveName,"OffsetY",g);y=this._transformSize(y,o),M=this._transformRotation(M,!!t.rotateClockwise,h);const S=this._transformOffsetX(P,b,h,o,c),v=this._transformOffsetY(P,b,h,o,m);switch(P=S,b=v,t.type){case"CIMPictureMarker":this._analyzePictureMarker(t,e,i,n,s,r,y,M,P,b,t.colorLocked||f);break;case"CIMVectorMarker":this._analyzeVectorMarker(t,e,i,n,s,r,o,a,y,M,P,b,t.colorLocked||f)}}_analyzeMarkerInsidePolygon(t,e){const{markerPlacement:i,type:n}=t;if(!i||i.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(n==="CIMVectorMarker"||n==="CIMPictureMarker"){const d=t.primitiveName;if(d){const[y,M]=this._analyzePrimitiveOverrides([d],e,null,null);if(y)return!1}const g=i.primitiveName;if(g){const[y,M]=this._analyzePrimitiveOverrides([g],e,null,null);if(y)return!1}if(n==="CIMVectorMarker"){const{markerGraphics:y}=t;if(y)for(const M of y){const{symbol:P}=M;if((P==null?void 0:P.type)==="CIMPolygonSymbol"&&P.symbolLayers){const{symbolLayers:b}=P;for(const S of b)if(S.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:y}=t;if(y)return!1}}const s=i,r=Math.abs(s.stepX),o=Math.abs(s.stepY);if(r===0||o===0)return!0;const a=new Set(["Rotation","OffsetX","OffsetY"]),l=this._primitiveOverrides.filter(d=>d.primitiveName!==t.primitiveName||!a.has(d.propertyName)),h="url"in t&&typeof t.url=="string"?t.url:void 0,c=F(JSON.stringify(t)).toString();let m,f,_=null;if(i.gridType==="Random"){const d=Ot(_i),g=Math.max(Math.floor(d/r),1),y=Math.max(Math.floor(d/o),1);m=o*y,_=M=>M?M*y:0,f=g*r/m}else i.shiftOddRows?(m=2*o,_=d=>d?2*d:0,f=r/o*.5):(m=o,_=null,f=r/o);const p=ue(t);return this._cimLayers.push({type:"fill",templateHash:c,materialHash:c,cim:t,materialOverrides:l,colorLocked:!!t.colorLocked,effects:e,color:p,height:this._createOverrideFunction(s.primitiveName,"StepY",m,_),scaleX:f,angle:s.gridAngle,offsetX:x(s.offsetX),offsetY:x(s.offsetY),url:h,applyRandomOffset:i.gridType==="Random",sampleAlphaOnly:!h,hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(t,e,i,n,s,r,o,a,l,h,c){let m=x(t.scaleX,1);const f=ue(t),_=F(`${t.url}${JSON.stringify(t.colorSubstitutions)}${JSON.stringify(t.animatedSymbolProperties)}`).toString();i||(i=this._createMarkerPlacementOverrideFunction(t.markerPlacement));const p=this._createAnimatedSymbolPropertiesOverrideFunction(t.animatedSymbolProperties),[d,g]=this._analyzePrimitiveOverrides(n,e,i,p),y=F(JSON.stringify(t)+g).toString(),M=t.anchorPoint??{x:0,y:0};if("width"in t&&typeof t.width=="number"){const S=t.width;let v=1;const C=this._resourceManager.getResource(t.url);C!=null&&(v=C.width/C.height),m/=v*(x(t.size)/S)}function P(S,v){return p!=null?Ze(p,S,v):null}const b=t.animatedSymbolProperties&&t.animatedSymbolProperties.randomizeStartTime===!0?(S,v,C,I)=>{const L=Or(I??0),A=P(S,v);return _+`-MATERIALGROUP(${L})-ASP(${JSON.stringify(A)})`}:d?(S,v)=>{const C=P(S,v);return _+`-ASP(${JSON.stringify(C)})`}:_;this._cimLayers.push({type:"marker",templateHash:y,materialHash:b,cim:t,materialOverrides:null,colorLocked:!!t.colorLocked||!!c,effects:e,scaleSymbolsProportionally:!1,alignment:s,size:o,scaleX:this._createOverrideFunction(t.primitiveName,"ScaleX",m),rotation:a,offsetX:l,offsetY:h,color:this._createOverrideFunction(t.primitiveName,"TintColor",f,X),anchorPoint:{x:M.x,y:M.y},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:!1,referenceSize:r,sizeRatio:1,markerPlacement:i,url:t.url,animatedSymbolProperties:p})}_analyzeVectorMarker(t,e,i,n,s,r,o,a,l,h,c,m,f){const _=t.markerGraphics;if(!_)return;const p=t.frame;let d=0,g=1;t.scaleSymbolsProportionally&&p&&(d=p.ymax-p.ymin,g=this._transformSize(l,1/d)),g=this._transformSize(g,o),i||(i=this._createMarkerPlacementOverrideFunction(t.markerPlacement));for(const y of _)if(y){const M=y.symbol;if(!M)continue;const P=y.primitiveName;P&&n.push(P);let b=c,S=m;if((M.type==="CIMPointSymbol"||M.type==="CIMTextSymbol")&&p){let v=0,C=0;const I=y.geometry;"x"in I&&"y"in I&&(v+=I.x-.5*(p.xmin+p.xmax),C+=I.y-.5*(p.ymin+p.ymax));const L=t.anchorPoint;L&&(t.anchorPointUnits==="Absolute"?(v-=L.x,C-=L.y):p&&(v-=(p.xmax-p.xmin)*L.x,C-=(p.ymax-p.ymin)*L.y)),b=this._transformOffsetX(v,C,h,g,c),S=this._transformOffsetY(v,C,h,g,m)}switch(M.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":a||$r(M)?this._analyzeMultiLayerGraphicNonSDF(t,e,i,null,y,n,s,r,d,!!f||!!t.colorLocked):this._analyzeMultiLayerGraphic(t,e,i,null,y,n,s,r,d,g,l,h,b,S,!!f||!!t.colorLocked);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,e,i,y,n,s,r,d,g,l,h,b,S,!!f||!!t.colorLocked)}P&&n.pop()}}_analyzeMultiLayerGraphic(t,e,i,n,s,r,o,a,l,h,c,m,f,_,p){const d=s.symbol,g=d.symbolLayers;if(!g)return;let y=g.length;if(Nr(g))return void this._analyzeCompositeMarkerGraphic(t,e,i,n,s,g,r,o,a,l,c,m,f,_,!!p||!!t.colorLocked);const M=this._resourceManager.geometryEngine,P=hi.applyEffects(d.effects,s.geometry,M);if(P)for(;y--;){const b=g[y];if(!b||b.enable===!1)continue;const S=b.primitiveName;switch(S&&r.push(S),b.type){case"CIMSolidFill":case"CIMSolidStroke":{const v=hi.applyEffects(b.effects,P,M),C=ai(v);if(!C)continue;const I=t.anchorPointUnits!=="Relative",[L,A,R]=li(C,t.frame,t.size,t.anchorPoint,I),z=b.type==="CIMSolidFill",E={type:"sdf",geom:v,asFill:z},V=b.path,J=z?H(Ct(b)):V==null?H(_e(b)):{r:0,g:0,b:0,a:0},K=z?{r:0,g:0,b:0,a:0}:H(_e(b)),Z=$e(b)??0;if(!z&&!Z)break;const B=s.primitiveName;let lt=null;z&&!b.colorLocked&&(lt=this._createOverrideFunction(B,"FillColor",J,X));let pt=null;z||b.colorLocked||(pt=this._createOverrideFunction(B,"StrokeColor",K,X));const _t=this._createOverrideFunction(B,"StrokeWidth",Z);let ht=!1,T="";for(const Q of this._primitiveOverrides)r.includes(Q.primitiveName)&&(Q.value!=null?T+=`-${Q.primitiveName}-${Q.propertyName}-${JSON.stringify(Q.value)}`:Q.valueExpressionInfo&&(ht=!0));(e!=null&&typeof e=="function"||i!=null&&typeof i=="function")&&(ht=!0),(w(c)||w(m)||w(f)||w(_))&&(ht=!0);const oe=JSON.stringify({...t,markerGraphics:null}),Tt=F(JSON.stringify(E)+V).toString(),ae=F(JSON.stringify(s)+JSON.stringify(b)+oe+T).toString();this._cimLayers.push({type:"marker",templateHash:ae,materialHash:ht?()=>Tt:Tt,cim:E,materialOverrides:null,colorLocked:!!b.colorLocked||!!p,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:A,y:R},isAbsoluteAnchorPoint:I,size:c,rotation:m,offsetX:f,offsetY:_,scaleX:1,frameHeight:l,rotateClockwise:!1,referenceSize:a,sizeRatio:L,color:w(lt)?lt:this._createOverrideFunction(S,"Color",J,X),outlineColor:w(pt)?pt:this._createOverrideFunction(S,"Color",K,X),outlineWidth:w(_t)?_t:this._createOverrideFunction(S,"Width",Z),markerPlacement:i,animatedSymbolProperties:n,path:V});break}case"CIMVectorMarker":b.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(t,e,i,n,s,r,o,a,l,!!p||!!b.colorLocked):this._analyzeMarker(b,e,i,r,o,a,h,!1,c,m,f,_,!!p||!!t.colorLocked);break;default:this._analyzeMultiLayerGraphicNonSDF(t,e,i,n,s,r,o,a,l,!!p||!!t.colorLocked)}S&&r.pop()}}_analyzeTextGraphic(t,e,i,n,s,r,o,a,l,h,c,m,f,_){var Q;const p=[];O.findApplicableOverrides(n,this._primitiveOverrides,p);const d=n.geometry;if(!("x"in d)||!("y"in d))return;const g=n.symbol,y=Be(g),M=Je(g.fontStyleName),P=gs(g.fontFamilyName);g.font={family:P,decoration:y,...M};let b=x(g.height,Ri),S=x(g.angle),v=x(g.offsetX),C=x(g.offsetY);b=this._transformSize(b,l),S=this._transformRotation(S,!1,c);const I=this._transformOffsetX(v,C,c,l,m),L=this._transformOffsetY(v,C,c,l,f);v=I,C=L;const A=H(Ct(g));let R=H(_e(g)),z=$e(g)??0;z||(R=H(Ct(g.haloSymbol)),z=x(g.haloSize)),z=this._transformSize(z,l);let E=!1;if((Q=g.symbol)!=null&&Q.symbolLayers)for(const dt of g.symbol.symbolLayers)Ct(dt)!=null&&(E=!!dt.colorLocked);const V=n.primitiveName;let J=null;E||(J=this._createOverrideFunction(V,"Color",A,X));let K=null,Z=null,B=0;if(g.callout&&g.callout.type==="CIMBackgroundCallout"){const dt=g.callout;if(dt.backgroundSymbol){const le=dt.backgroundSymbol.symbolLayers;if(le)for(const gt of le)gt.type==="CIMSolidFill"?K=H(gt.color):gt.type==="CIMSolidStroke"&&(Z=H(gt.color),B=x(gt.width,zt))}}const[lt,pt]=this._analyzePrimitiveOverrides(s,e,i,null),_t=JSON.stringify(t.effects)+Number(t.colorLocked||_).toString()+JSON.stringify(t.anchorPoint)+t.anchorPointUnits+JSON.stringify(t.markerPlacement)+t.size.toString(),ht=F(JSON.stringify(n)+_t+pt).toString();let T=this._createOverrideFunction(n.primitiveName,"TextString",n.textString??"",ys,g.textCase);if(T==null)return;const{fontStyleName:oe}=g,Tt=P+(oe?"-"+oe.toLowerCase():"-regular"),ae=Tt;typeof T=="string"&&T.includes("[")&&g.fieldMap&&(T=Ps(g.fieldMap,T,g.textCase)),this._cimLayers.push({type:"text",templateHash:ht,materialHash:lt||typeof T=="function"||/\[(.*?)\]/.test(T)?(dt,le,gt)=>ae+"-"+Ze(T,dt,le,gt):ae+"-"+F(T),cim:g,materialOverrides:null,colorLocked:!!_||!!E,effects:e,alignment:r,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:t.anchorPointUnits!=="Relative",fontName:Tt,decoration:y,weight:M.weight,style:M.style,size:b,angle:S,offsetX:v,offsetY:C,horizontalAlignment:ui(g.horizontalAlignment),verticalAlignment:fi(g.verticalAlignment),text:T,color:w(J)?J:A,outlineColor:R,outlineSize:z,backgroundColor:K,borderLineColor:Z,borderLineWidth:B,lineWidth:null,referenceSize:o,sizeRatio:1,markerPlacement:i})}_analyzeMultiLayerGraphicNonSDF(t,e,i,n,s,r,o,a,l,h){const c=this._buildSimpleMarker(t,s),m=t.primitiveName,f=this._analyzeMaterialOverrides(m,["Rotation","OffsetX","OffsetY"]),[_,p]=this._analyzePrimitiveOverrides(r,null,null,null),[d,g,y]=kt.getTextureAnchor(c,this._resourceManager),M=x(t.rotation),P=x(t.offsetX),b=x(t.offsetY),S=F(JSON.stringify(c)+p).toString(),v=f&&f.length>0||e!=null&&typeof e=="function";this._cimLayers.push({type:"marker",templateHash:S,materialHash:v&&f?this._createMaterialHashFunction(S,f):S,cim:c,materialOverrides:f,colorLocked:!!t.colorLocked||!!h,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:d,y:g},isAbsoluteAnchorPoint:!1,size:x(t.size,Pe),rotation:this._createOverrideFunction(m,"Rotation",M),offsetX:this._createOverrideFunction(m,"OffsetX",P),offsetY:this._createOverrideFunction(m,"OffsetY",b),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:l,rotateClockwise:!!t.rotateClockwise,referenceSize:a,sizeRatio:y/rt(t.size),markerPlacement:i,animatedSymbolProperties:n,avoidSDFRasterization:!0})}_buildSimpleMarker(t,e){return{type:t.type,enable:!0,name:t.name,colorLocked:t.colorLocked,primitiveName:t.primitiveName,anchorPoint:t.anchorPoint,anchorPointUnits:t.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:t.rotateClockwise,rotation:0,size:t.size,billboardMode3D:t.billboardMode3D,depth3D:t.depth3D,frame:t.frame,markerGraphics:[e],scaleSymbolsProportionally:t.scaleSymbolsProportionally,respectFrame:t.respectFrame,clippingPath:t.clippingPath}}_analyzeCompositeMarkerGraphic(t,e,i,n,s,r,o,a,l,h,c,m,f,_,p){const d=s.geometry,g=r[0],y=r[1],M=ai(d);if(!M)return;const P=t.anchorPointUnits!=="Relative",[b,S,v]=li(M,t.frame,t.size,t.anchorPoint,P),C={type:"sdf",geom:d,asFill:!0},I=y.path,L=y.primitiveName,A=g.primitiveName,R=H(y.color),z=H(g.color),E=x(g.width,zt),V=s.primitiveName;let J=null;y.colorLocked||p||(J=this._createOverrideFunction(V,"FillColor",R,X));let K=null;g.colorLocked||p||(K=this._createOverrideFunction(V,"StrokeColor",z,X));const Z=this._createOverrideFunction(V,"StrokeWidth",E);let B=!1,lt="";for(const T of this._primitiveOverrides)(T.primitiveName===L||T.primitiveName===A||o.includes(T.primitiveName))&&(T.value!=null?lt+=`-${T.primitiveName}-${T.propertyName}-${JSON.stringify(T.value)}`:T.valueExpressionInfo&&(B=!0));i!=null&&typeof i=="function"&&(B=!0),(w(c)||w(m)||w(f)||w(_))&&(B=!0);const pt=JSON.stringify({...t,markerGraphics:null}),_t=F(JSON.stringify(C)+I).toString(),ht=F(JSON.stringify(s)+JSON.stringify(y)+JSON.stringify(g)+pt+lt).toString();this._cimLayers.push({type:"marker",templateHash:ht,materialHash:B?()=>_t:_t,cim:C,materialOverrides:null,colorLocked:!!p,effects:e,scaleSymbolsProportionally:!!t.scaleSymbolsProportionally,alignment:a,anchorPoint:{x:S,y:v},isAbsoluteAnchorPoint:P,size:c,rotation:m,offsetX:f,offsetY:_,scaleX:1,frameHeight:h,rotateClockwise:!1,referenceSize:l,sizeRatio:b,color:w(J)?J:this._createOverrideFunction(L,"Color",R,X),outlineColor:w(K)?K:this._createOverrideFunction(A,"Color",z,X),outlineWidth:w(Z)?Z:this._createOverrideFunction(A,"Width",E),markerPlacement:i,path:I,animatedSymbolProperties:n})}_createMaterialHashFunction(t,e){var n;const i=(n=this._info)==null?void 0:n.geometryType;if(i){const s=this._poMap;for(const r of e)if(r.valueExpressionInfo){const o=s[r.primitiveName]&&s[r.primitiveName][r.propertyName];o instanceof Nt&&(r.fn=(a,l,h)=>Lt(o,a,{$view:h},i,l))}}return(s,r,o)=>{for(const a of e)a.fn&&(a.value=a.fn(s,r,o));return F(t+O.buildOverrideKey(e)).toString()}}_setPoMap(t,e,i){let n;this._poMap[t]?n=this._poMap[t]:(n={},this._poMap[t]=n),n[e]=i}_createOverrideFunction(t,e,i,n,s){var l;if(t==null)return i;const r=this._poMap[t];if(r==null)return i;const o=r[e];if(typeof o=="string"||typeof o=="number"||o instanceof Array)return n?n.call(null,o,s):o;const a=(l=this._info)==null?void 0:l.geometryType;return o!=null&&o instanceof Nt&&a!=null?(h,c,m)=>{let f=Lt(o,h,{$view:m},a,c);return f!==null&&n&&(f=n.call(null,f,s)),f!==null?f:i}:i}_createEffectsOverrideFunction(t,e){var s;const i=this._poMap,n=(s=this._info)==null?void 0:s.geometryType;for(const r of e)if(r.valueExpressionInfo&&n){const o=i[r.primitiveName]&&i[r.primitiveName][r.propertyName];o instanceof Nt&&(r.fn=(a,l,h)=>Lt(o,a,{$view:h},n,l))}return(r,o,a)=>{for(const h of e)h.fn&&(h.value=h.fn(r,o,a));const l=[];for(let h of t){const c=h==null?void 0:h.primitiveName;if(c){let m=!1;for(const f of e)if(f.primitiveName===c){const _=Ne(f.propertyName);f.value!=null&&f.value!==h[_]&&(m||(h=ot(h),m=!0),h[_]=f.value)}}l.push(h)}return l}}_createMarkerPlacementOverrideFunction(t){var s;const e=[];if(O.findApplicableOverrides(t,this._primitiveOverrides,e),t==null||e.length===0)return t;const i=this._poMap,n=(s=this._info)==null?void 0:s.geometryType;for(const r of e)if(r.valueExpressionInfo&&n){const o=i[r.primitiveName]&&i[r.primitiveName][r.propertyName];o instanceof Nt&&(r.fn=(a,l,h)=>Lt(o,a,{$view:h},n,l))}return(r,o,a)=>{for(const c of e)c.fn&&(c.value=c.fn(r,o,a));const l=ot(t),h=t.primitiveName;for(const c of e)if(c.primitiveName===h){const m=Ne(c.propertyName);c.value!=null&&c.value!==l[m]&&(l[m]=c.value)}return l}}_createAnimatedSymbolPropertiesOverrideFunction(t){var n;const e=[];if(O.findApplicableOverrides(t,this._primitiveOverrides,e),t==null||e.length===0)return t;const i=(n=this._info)==null?void 0:n.geometryType;if(i){const s=this._poMap;for(const r of e)if(r.valueExpressionInfo){const o=s[r.primitiveName]&&s[r.primitiveName][r.propertyName];o instanceof Nt&&(r.fn=(a,l,h)=>Lt(o,a,{$view:h},i,l))}}return(s,r,o)=>{for(const h of e)h.fn&&(h.value=h.fn(s,r,o));const a=ot(t),l=t.primitiveName;for(const h of e)if(h.primitiveName===l){const c=Ne(h.propertyName);if(h.value!=null){const m=xr(h.value,h.propertyName);m!==a[c]&&(a[c]=m)}}return a}}_analyzePrimitiveOverrides(t,e,i,n){let s=!1,r="";typeof t=="string"&&(t=[t]);for(const o of this._primitiveOverrides)t!=null&&t.includes(o.primitiveName)&&(o.value!=null?r+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`:o.valueExpressionInfo&&(s=!0));return e!=null&&typeof e=="function"&&(s=!0),i!=null&&typeof i=="function"&&(s=!0),n!=null&&typeof n=="function"&&(s=!0),[s,r]}_analyzeMaterialOverrides(t,e){return this._primitiveOverrides.filter(i=>i.primitiveName!==t||!e.includes(i.propertyName))}_transformSize(t,e){return w(t)||w(e)?(i,n,s)=>(w(t)?t(i,n,s):t)*(w(e)?e(i,n,s):e):t*e}_transformRotation(t,e,i){return w(t)||w(i)?(n,s,r)=>{const o=w(t)?t(n,s,r):t,a=w(i)?i(n,s,r):i;return e?a-o:a+o}:e?i-t:i+t}_transformOffsetX(t,e,i,n,s){if(!(w(t)||w(e)||w(i)||w(n)||w(s))){const r=i*Math.PI/180;if(r){const o=Math.cos(r),a=Math.sin(r);return(o*t-a*e)*n+s}return t*n+s}return(r,o,a)=>{let l=w(i)?i(r,o,a):i;const h=w(n)?n(r,o,a):n,c=w(t)?t(r,o,a):t,m=w(s)?s(r,o,a):s;return l?(l*=Math.PI/180,(Math.cos(l)*c-Math.sin(l)*(w(e)?e(r,o,a):e))*h+m):c*h+m}}_transformOffsetY(t,e,i,n,s){if(!(w(t)||w(e)||w(i)||w(n)||w(s))){const r=i*Math.PI/180;if(r){const o=Math.cos(r);return(Math.sin(r)*t+o*e)*n+s}return e*n+s}return(r,o,a)=>{let l=w(i)?i(r,o,a):i;const h=w(n)?n(r,o,a):n,c=w(e)?e(r,o,a):e,m=w(s)?s(r,o,a):s;if(l){l*=Math.PI/180;const f=Math.cos(l);return(Math.sin(l)*(w(t)?t(r,o,a):t)+f*c)*h+m}return c*h+m}}}function Ee(u){if(u&&u.indexOf("Level_")===0){const t=parseInt(u.substr(6),10);if(!isNaN(t))return t}return 0}function X(u){if(!u||u.length===0)return null;const t=new pi(u).toRgba();return{r:t[0],g:t[1],b:t[2],a:t[3]}}function Ne(u){return u&&u.charAt(0).toLowerCase()+u.substr(1)}function Tn(u,t){if(!t||t.length===0)return u;const e=ot(u);return O.applyOverrides(e,t),e}const Nr=u=>u&&u.length===2&&u[0].enable&&u[1].enable&&u[0].type==="CIMSolidStroke"&&u[1].type==="CIMSolidFill"&&u[0].path==null&&u[1].path==null&&!u[0].effects&&!u[1].effects;function $r(u){const t=u.symbolLayers;if(!t||t.length!==2)return!1;const e=t.find(n=>{var s;return(s=n.effects)==null?void 0:s.find(r=>r.type==="CIMGeometricEffectDashes")}),i=t.find(n=>{var s;return(s=n.effects)==null?void 0:s.find(r=>r.type==="CIMGeometricEffectAddControlPoints")});return!!e&&!!i}export{Mt as Q,Tn as V,Sr as a,On as b,G as c,Xe as d,or as e,hi as f,tr as g,xn as h,In as i,An as j,Sn as k,O as l,Ss as m,kt as n,Cn as o,vn as p,wn as q,Gi as r,kn as s,$i as t}; diff --git a/dist/assets/clientSideDefaults-F-CNnR0g.js b/dist/assets/clientSideDefaults-F-CNnR0g.js new file mode 100644 index 0000000..2149a82 --- /dev/null +++ b/dist/assets/clientSideDefaults-F-CNnR0g.js @@ -0,0 +1,7 @@ +import{dG as o,dH as u,dI as n,dJ as i,bI as a}from"./index-J0iiHjMT.js";import{t as l}from"./QueryEngineCapabilities-PzVpW5yD.js";function h(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?o:t==="esriGeometryPolyline"?u:n}}}const c=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let d=1;function A(t,s){if(i("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let e=`this.${s} = null;`;for(const r in t)e+=`this${c.test(r)?`.${r}`:`["${r}"]`} = ${JSON.stringify(t[r])};`;const p=new Function(` + return class AttributesClass$${d++} { + constructor() { + ${e}; + } + } + `)();return()=>new p}catch{return()=>({[s]:null,...t})}}function $(t={}){return[{name:"New Feature",description:"",prototype:{attributes:a(t)}}]}function f(t,s){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:t},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:s,supportsExceedsLimitStatistics:!0,supportsAsyncConvert3D:!1},query:l,queryRelated:{supportsCount:!0,supportsOrderBy:!0,supportsPagination:!0,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsGeometryUpdate:s,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}export{$ as a,A as i,f as l,h as o}; diff --git a/dist/assets/component-dtiBfYiX.js b/dist/assets/component-dtiBfYiX.js new file mode 100644 index 0000000..4816796 --- /dev/null +++ b/dist/assets/component-dtiBfYiX.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function n(e){return e==="l"?"m":"s"}export{n as g}; diff --git a/dist/assets/conditionalSlot-e55zipTI.js b/dist/assets/conditionalSlot-e55zipTI.js new file mode 100644 index 0000000..b2b0a75 --- /dev/null +++ b/dist/assets/conditionalSlot-e55zipTI.js @@ -0,0 +1,5 @@ +import{cn as c}from"./index-J0iiHjMT.js";import{c as i}from"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const n=new Set;let e;const r={childList:!0};function f(o){e||(e=i("mutation",s)),e.observe(o.el,r)}function l(o){n.delete(o.el),s(e.takeRecords()),e.disconnect();for(const[t]of n.entries())e.observe(t,r)}function s(o){o.forEach(({target:t})=>{c(t)})}export{f as c,l as d}; diff --git a/dist/assets/createConnection-4ppGVnSc.js b/dist/assets/createConnection-4ppGVnSc.js new file mode 100644 index 0000000..e8ba23c --- /dev/null +++ b/dist/assets/createConnection-4ppGVnSc.js @@ -0,0 +1,7 @@ +import{K as L,E as a,e as d,y as p,c as S,dB as v,l5 as F,Z as c,mo as N,bH as C,bW as O,dy as E,de as x,ca as P,ar as W}from"./index-J0iiHjMT.js";import{c as k}from"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";let m=class extends L.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new a("stream-connection",this.errorString):null}onFeature(t){this.emit("data-received",t)}onMessage(t){this.emit("message-received",t)}};d([p({readOnly:!0})],m.prototype,"connectionError",null),m=d([S("esri.layers.support.StreamConnection")],m);const R=m;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends R{constructor(t){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:r,spatialReference:s,sourceSpatialReference:o}=t;this._config=t,this._featureZScaler=v(r,o,s),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(t){this._websocket!=null?this._websocket.send(JSON.stringify(t)):this._outstandingMessages.push(t)}sendMessageToClient(t){this._onMessage(t)}updateCustomParameters(t){this._config.customParameters=t,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(t=this._config.source.path,r=1e3,s=0){try{if(this.destroyed)return;const o=F(t,this._config.customParameters??{});this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const n=r/1e3;return this._config.maxReconnectionAttempts&&s>=this._config.maxReconnectionAttempts?(c.getLogger(this).error(new a("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(c.getLogger(this).error(new a("websocket-connection",`Failed to connect. Attempting to reconnect in ${n}s`,o)),await N(r),this._tryCreateWebSocket(t,Math.min(1.5*r,1e3*this._config.maxReconnectionInterval),s+1))}}_setWebSocketJSONParseHandler(t){t.onmessage=r=>{try{const s=JSON.parse(r.data);this._onMessage(s)}catch(s){return void c.getLogger(this).error(new a("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}}}_createWebSocket(t){return new Promise((r,s)=>{const o=new WebSocket(t);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=n=>this._onClose(n),o.onerror=n=>this._onError(n),this._setWebSocketJSONParseHandler(o),r(o)},o.onclose=n=>{o.onopen=o.onclose=null,s(n)}})}async _handshake(t=1e4){const r=this._websocket;if(r==null)return;const s=C(),o=r.onmessage,{filter:n,outFields:u,spatialReference:l}=this._config;return s.timeout(t),r.onmessage=h=>{var w;let i=null;try{i=JSON.parse(h.data)}catch{}i&&typeof i=="object"||(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),s.reject(),this.destroy()),((w=i.spatialReference)==null?void 0:w.wkid)!==(l==null?void 0:l.wkid)&&(c.getLogger(this).error(new a("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,h.data)),s.reject(),this.destroy()),i.format!=="json"&&(c.getLogger(this).error(new a("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),s.reject(),this.destroy()),n&&i.filter!==n&&c.getLogger(this).error(new a("websocket-connection","Tried to set filter, but server doesn't support it")),u&&i.outFields!==u&&c.getLogger(this).error(new a("websocket-connection","Tried to set outFields, but server doesn't support it")),r.onmessage=o;for(const y of this._outstandingMessages)r.send(JSON.stringify(y));this._outstandingMessages=[],s.resolve()},r.send(JSON.stringify({filter:n,outFields:u,format:"json",spatialReference:{wkid:l.wkid}})),s.promise}_onMessage(t){if(this.onMessage(t),"type"in t)switch(t.type){case"features":case"featureResult":for(const r of t.features)this._featureZScaler!=null&&this._featureZScaler(r.geometry),this.onFeature(r)}}_onError(t){const r="Encountered an error over WebSocket connection";this._set("errorString",r),c.getLogger(this).error("websocket-connection",r)}_onClose(t){this._websocket=null,this.notifyChange("connectionStatus"),t.code!==1e3&&c.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${t.code}`),this.destroyed||this._open()}};d([p()],f.prototype,"connectionStatus",null),d([p()],f.prototype,"errorString",void 0),f=d([S("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let b=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||c.getLogger(this).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:s}=this._config;this.destroyed||this._setFilter(r,s)}_onMessage(e){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void c.getLogger(this).error(new a("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),s=(await r).data;return this._serviceDefinition=s,s}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,n=this._inferWebSocketBaseUrl(s);return F(`${n}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return c.getLogger(this).error(new a("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const s=JSON.stringify({filter:this._serializeFilter(e,t)});let o=!1;const n=C(),u=()=>{o||(this.destroyed||this._websocket!==r||c.getLogger(this).error(new a("geoevent-connection","Server timed out when setting filter")),n.reject())},l=h=>{const i=JSON.parse(h.data);i.filter&&(i.error&&(c.getLogger(this).error(new a("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),this._setWebSocketJSONParseHandler(r),o=!0,n.resolve())};return r.onmessage=l,r.send(s),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e!=null&&e.geometry)try{const s=E(e.geometry);if(s.type!=="extent")throw new a(`Expected extent but found type ${s.type}`);r.geometry=JSON.stringify(s.shiftCentralMeridian())}catch(s){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when setting connection geometryDefinition",s))}return e!=null&&e.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],s=this._relatedFeatures.get(r);if(!s)return c.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:n}=s;for(const u in o)e.attributes[u]=o[u];return n&&(e.geometry=n),e.geometry||e.centroid||c.getLogger(this).error(new a("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const n of o.features)this.onFeature(this._enrich(n))}catch(e){c.getLogger(this).error(new a("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){var y;const t=new(await x(()=>import("./FeatureLayer--S4epFk-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))).default({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,l=t.capabilities.query.maxRecordCount,h=s?l*u:l,i=new P;if(i.outFields=this._config.outFields??["*"],i.where=((y=this._config.filter)==null?void 0:y.where)??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=W.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),s&&(i.maxRecordCountFactor=u),o)return i.num=h,t.destroy(),this._queryPages(e,i);const w=await k(e,i,this._config.sourceSpatialReference);return t.destroy(),w.data}async _queryPages(e,t,r=[],s=0){t.start=t.num!=null?s*t.num:null;const{data:o}=await k(e,t,this._config.sourceSpatialReference);return o.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(o.features.forEach(n=>r.push(n)),this._queryPages(e,t,r,s+1)):(r.forEach(n=>o.features.push(n)),o)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const n=o.attributes[s];t.set(n,o)}this._relatedFeatures=t}};b=d([S("esri.layers.graphics.sources.connections.GeoEventConnection")],b);const q=b;let _=class extends R{constructor(e){super(),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:s}=e;this._featureZScaler=v(t,s,r)}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([p()],_.prototype,"connectionStatus",void 0),d([p()],_.prototype,"errorString",void 0),_=d([S("esri.layers.support.ClientSideConnection")],_);function Z(e,t,r,s,o,n,u,l){const h={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:s,filter:o,maxReconnectionAttempts:n,maxReconnectionInterval:u,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(h):new q(h):new _(h)}export{Z as createConnection}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/FeatureLayer--S4epFk-.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/FeatureLayerBase-jpFp8gE3.js","assets/serviceCapabilitiesUtils-26KpT1VN.js","assets/editsZScale-Wgw9kbYG.js","assets/queryZScale-IaMm02_2.js","assets/FeatureSet-d4S1oKME.js","assets/CustomParametersMixin-Y1bOcayO.js","assets/FeatureEffectLayer-oBa8pIG5.js","assets/FeatureEffect-5bEV-xG1.js","assets/FeatureReductionLayer-RlitE1N6.js","assets/OrderedLayer-M7k5gLgx.js","assets/FeatureTemplate-kUgbbA00.js","assets/FeatureType-MpRe7WJj.js","assets/versionUtils-4v9zIDlv.js","assets/TopFeaturesQuery-E6D2tV-x.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/createSymbolSchema-Tv2jMAOE.js b/dist/assets/createSymbolSchema-Tv2jMAOE.js new file mode 100644 index 0000000..fa428e2 --- /dev/null +++ b/dist/assets/createSymbolSchema-Tv2jMAOE.js @@ -0,0 +1 @@ +import{n as V}from"./cimAnalyzer-DtyBzAGI.js";import{E as c,S as b}from"./enums-uQoFEhYh.js";import{f as h,_ as S,A as d}from"./SymbolProcessor-pXDjnfSh.js";import"./index-J0iiHjMT.js";import"./labelPoint-ysDT9nFH.js";import"./TileClipper-NSFZXMR1.js";import"./definitions-DqQMJYPH.js";import"./number-sTjsTbdA.js";import"./BidiEngine-8z8MVveq.js";import"./Pipeline--6jAENf8.js";import"./QueryEngine-8tLWlkSE.js";import"./WhereClause-XAMIZ4-B.js";import"./TimeOnly-ljWtUK7N.js";import"./json-v6EOeNTY.js";import"./QueryEngineCapabilities-PzVpW5yD.js";import"./utils-P5wTOmqv.js";import"./generateRendererUtils-_1jVE02H.js";import"./StreamFeatureManager-QrKJ84_c.js";import"./quickselect-UFB0jJTZ.js";import"./ogcFeatureUtils-dtzP0u64.js";import"./geojson-fSjaGZrp.js";import"./date-be_IQzZd.js";import"./clientSideDefaults-F-CNnR0g.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./createConnection-4ppGVnSc.js";import"./geohashUtils-U0jvYCSY.js";import"./BaseProcessor-nWGHAt7P.js";import"./TurboLine-SWK4qRwh.js";import"./Rect-bBBxMtVp.js";import"./GeometryUtils-K2DOc0l8.js";function y(e){var t;return e.type==="line-marker"?{type:"line-marker",color:(t=e.color)==null?void 0:t.toJSON(),placement:e.placement,style:e.style}:e.constructor.fromJSON(e.toJSON()).toJSON()}function u(e){return d(e)}function x(e,t,r=!1){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return g(e,t,r);case"simple-marker":case"picture-marker":return E(e,t,r);case"simple-line":return z(e,t,r);case"text":return k(e,t,r);case"label":return K(e,t,r);case"cim":return{type:"cim",rendererKey:t.vvFlags,data:e.data,maxVVSize:t.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:t.vvFlags,data:e,maxVVSize:t.maxVVSize};case"web-style":return{...y(e),type:"web-style",hash:e.hash(),rendererKey:t.vvFlags,maxVVSize:t.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function K(e,t,r){const o=e.toJSON(),a=h(c.LABEL,{...t,placement:o.labelPlacement});return{materialKey:r?u(a):a,hash:e.hash(),...o,labelPlacement:o.labelPlacement}}function g(e,t,r){const o=h(c.FILL,t),a=r?u(o):o,i=e.clone(),m=i.outline,s=S(t.symbologyType);s||(i.outline=null);const p={materialKey:a,hash:i.hash(),...y(i)};if(s)return p;const l=[];if(l.push(p),m){const n=h(c.LINE,{...t,isOutline:!0}),f={materialKey:r?u(n):n,hash:m.hash(),...y(m)};l.push(f)}return{type:"composite-symbol",layers:l,hash:l.reduce((n,f)=>f.hash+n,"")}}function z(e,t,r){const o=S(t.symbologyType)?b.DEFAULT:t.symbologyType,a=h(c.LINE,{...t,symbologyType:o}),i=r?u(a):a,m=e.clone(),s=m.marker;m.marker=null;const p=[];if(p.push({materialKey:i,hash:m.hash(),...y(m)}),s){const l=h(c.MARKER,t),n=r?u(l):l;s.color=s.color??m.color,p.push({materialKey:n,hash:s.hash(),lineWidth:m.width,...y(s)})}return{type:"composite-symbol",layers:p,hash:p.reduce((l,n)=>n.hash+l,"")}}function E(e,t,r){if(e.type==="simple-marker"&&(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"))return x({type:"CIMSymbolReference",symbol:V.fromSimpleMarker(e)},t,r);const o=h(c.MARKER,t),a=r?u(o):o,i=y(e);return{materialKey:a,hash:e.hash(),...i,angle:e.angle,maxVVSize:t.maxVVSize}}function k(e,t,r){const o=h(c.TEXT,t),a=r?u(o):o,i=y(e);return{materialKey:a,hash:e.hash(),...i,angle:e.angle,maxVVSize:t.maxVVSize}}export{x as createSymbolSchema}; diff --git a/dist/assets/cs_CZ-6GM5cGtg.js b/dist/assets/cs_CZ-6GM5cGtg.js new file mode 100644 index 0000000..5cee446 --- /dev/null +++ b/dist/assets/cs_CZ-6GM5cGtg.js @@ -0,0 +1 @@ +const d={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"př. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"ledna",February:"února",March:"března",April:"dubna",May:"května",June:"června",July:"července",August:"srpna",September:"září",October:"října",November:"listopadu",December:"prosince",Jan:"led",Feb:"úno",Mar:"bře",Apr:"dub","May(short)":"kvě",Jun:"čvn",Jul:"čvc",Aug:"srp",Sep:"zář",Oct:"říj",Nov:"lis",Dec:"pro",Sunday:"neděle",Monday:"pondělí",Tuesday:"úterý",Wednesday:"středa",Thursday:"čtvrtek",Friday:"pátek",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"út",Wed:"st",Thu:"čt",Fri:"pá",Sat:"so",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zvětšení",Play:"Přehrát",Stop:"Ukončit iteraci (Stop)",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Načítání",Home:"Domů",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tisk",Image:"Snímek",Data:"Data",Print:"Tisk","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/da_DK-havyKYv2.js b/dist/assets/da_DK-havyKYv2.js new file mode 100644 index 0000000..00aacdf --- /dev/null +++ b/dist/assets/da_DK-havyKYv2.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"januar",February:"februar",March:"marts",April:"april",May:"maj",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"maj",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Afspil",Stop:"Stop",Legend:"Signaturforklaring","Press ENTER to toggle":"",Loading:"Indlæser",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Udskriv",Image:"Billede",Data:"Data",Print:"Udskriv","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/dist/assets/dataUtils-s_UKlouc.js b/dist/assets/dataUtils-s_UKlouc.js new file mode 100644 index 0000000..906e190 --- /dev/null +++ b/dist/assets/dataUtils-s_UKlouc.js @@ -0,0 +1,7 @@ +import{dp as ve,eE as Er,sn as Pe,uz as Jt,sl as Ee,sm as Rr,ab as Re,e as O,y as N,f6 as Lr,c as Dt,dr as Ot,E as yt,bI as et,Z as gt,uu as Xt,dt as Ur,du as Dr,T as Or,dT as Le,ar as Gr,cg as ir,g as Br,jP as Nr,de as $r,kj as Fr,u8 as xe,iZ as qt,dJ as Vr,s as _r,uA as sr}from"./index-J0iiHjMT.js";const xn=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],ar=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],jr=new ve({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Wt(t,e){if(!t||!e||t.length!==e.length)return!1;for(let r=0;re[r]+2||t[r]Ue(o))),r}return Ue(t)}function De(t,e){if(!t)return;const r=e??ar;let o=null;return t.type==="algorithmic"?r.some(c=>{if(Wt(t.fromColor.toRgb(),c.fromColor)&&Wt(t.toColor.toRgb(),c.toColor))return o=c.id,!0}):t.type==="multipart"&&r.some(c=>{const i=t.colorRamps,u=c.colorRamps;if(i&&u&&i.length===u.length&&!u.some((n,s)=>{if(!Wt(i[s].fromColor.toRgb(),new Re(n.fromColor).toRgb())||!Wt(i[s].toColor.toRgb(),new Re(n.toColor).toRgb()))return!0})){if(o)return!0;o=c.id}}),o}function Wr(t,e,r=!1){if(!t)return;let o=De(t,e);return o!=null||r||(o=De(t=zr(t),e)),o}function Hr(t,e=!1){const r=typeof t=="string"?t:Wr(t,void 0,e);return r?jr.toJSON(r):null}function kn(t,e="esriCIELabAlgorithm"){const r=ar.find(({id:o})=>o===t);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:e,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:e,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function lr(t){const e=(t=t||{}).numColors||256,r=t.distanceOffset||0,o=t.isCustomInterval!=null?t.isCustomInterval:t.distanceInterval!==null&&t.distanceInterval!==1/(e-1),c=t.distanceInterval||1/(e-1);return{...t,numColors:e,distanceOffset:r,interpolateAlpha:!!t.interpolateAlpha,distanceInterval:c,isCustomInterval:o,weights:t.weights}}function qr(t,e,r){const{numColors:o,distanceOffset:c,distanceInterval:i,isCustomInterval:u}=r,n=t.s===0,s=e.s===0;let l=t.h,a=e.h;n&&!s?l=a:s&&!n&&(e={...e,h:l},a=l);let h,p=Math.abs(a-l);const f=360;pa?p*i:-p*i);const m=(e.s-t.s)*i,g=(e.v-t.v)*i;let{s:v,v:d}=t,y=l;if(c){const C=c/i;y=(y+C*h+f)%f,v+=C*m,d+=C*g}const w=[];for(let C=0;Cf+m);c=c.map(f=>f/p)}else{c=[];for(let p=0;p{c.unshift(i),o||c.pop()}),r}function Ge(t){const e=Jt(t);return{type:"HsvColor",Hue:e.h,Saturation:e.s,Value:e.v,AlphaValue:255}}function Be(t){const e=t.toJSON();return{Algorithm:(e==null?void 0:e.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:Ge(t.fromColor),ToColor:Ge(t.toColor)}}function An(t){const e=Hr(t);if(!e)return null;if(t.type==="algorithmic")return{...Be(t),Name:e};if(t.colorRamps){const r=t.colorRamps.map(Be);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:e}}return null}function Sn(t){const e=t.reverse().map(r=>{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(e.join(""),16)}const Tn=new ve({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Zr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};let Ne=class{constructor(e=null,r=null,o=null){this.minValue=e,this.maxValue=r,this.noDataValue=o}};var St;let it=St=class extends Ot{static createEmptyBand(t,e){return new(St.getPixelArrayConstructor(t))(e)}static getPixelArrayConstructor(t){let e;switch(t){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":e=Float32Array;break;case"f64":e=Float64Array}return e}constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.premultiplyAlpha=!1,this.statistics=null,this.depthCount=1}castPixelType(t){if(!t)return"f32";let e=t.toLowerCase();return["u1","u2","u4"].includes(e)?e="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(e)||(e="f32"),e}getPlaneCount(){var t;return(t=this.pixels)==null?void 0:t.length}addData(t){if(!t.pixels||t.pixels.length!==this.width*this.height)throw new yt("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push(t.statistics??new Ne)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map(r=>this._calculateBandStatistics(r,this.mask));const t=this.mask;let e=0;if(t!=null)for(let r=0;rr?r:np>=e.length),i=o===t.length&&!t.some((p,f)=>p!==f);if(c||i)return this;const u=((h=this.bandMasks)==null?void 0:h.length)===o?t.map(p=>this.bandMasks[p]):void 0;let{mask:n,validPixelCount:s}=this;const{width:l,height:a}=this;if(u){if(u.length===1)n=u[0];else{const p=l*a;n=new Uint8Array(p).fill(255);for(let f=0;f!!p).length}return new St({pixelType:this.pixelType,width:l,height:a,mask:n,bandMasks:u,validPixelCount:s,maskIsAlpha:this.maskIsAlpha,pixels:t.map(p=>e[p]),statistics:r&&t.map(p=>r[p])})}clone(){const t=new St({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(o=>new Uint8Array(o)));const r=St.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const o=!!this.pixels[0].slice;for(e=0;e=3?(u=c[1],n=c[2]):c.length===2&&(u=c[1]);const l=new Uint32Array(t),a=this.width*this.height;if(i.length===a)if(e!=null&&e.length===a)if(r)for(s=0;s0){for(const g of o)if(g.minValue!=null&&(u=Math.min(u,g.minValue)),g.maxValue!=null&&g.minValue!=null){const v=g.maxValue-g.minValue;n=Math.max(n,v)}i=255/n}else{let g=255;c==="s8"?(u=-128,g=127):c==="u16"?g=65535:c==="s16"?(u=-32768,g=32767):c==="u32"?g=4294967295:c==="s32"?(u=-2147483648,g=2147483647):c==="f32"?(u=-34e38,g=34e38):c==="f64"&&(u=-Number.MAX_VALUE,g=Number.MAX_VALUE),i=255/(g-u)}const s=new Uint32Array(t),l=this.width*this.height;let a,h,p,f,m;if(a=h=p=e[0],a.length!==l)return gt.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(h=e[1],e.length>=3&&(p=e[2]),r!=null&&r.length===l)for(f=0;f=3?(c=e[1],i=e[2]):e.length===2&&(c=e[1]);const n=this.width*this.height;if(o.length!==n)return gt.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let s=0;if(r!=null&&r.length===n)for(u=0;uo?u:o);else for(i=0;io?u:o;return new Ne(r,o)}};O([N({json:{write:!0}})],it.prototype,"width",void 0),O([N({json:{write:!0}})],it.prototype,"height",void 0),O([N({json:{write:!0}})],it.prototype,"pixelType",void 0),O([Lr("pixelType")],it.prototype,"castPixelType",null),O([N({json:{write:!0}})],it.prototype,"validPixelCount",void 0),O([N({json:{write:!0}})],it.prototype,"mask",void 0),O([N({json:{write:!0}})],it.prototype,"maskIsAlpha",void 0),O([N({json:{write:!0}})],it.prototype,"pixels",void 0),O([N()],it.prototype,"premultiplyAlpha",void 0),O([N({json:{write:!0}})],it.prototype,"statistics",void 0),O([N({json:{write:!0}})],it.prototype,"depthCount",void 0),O([N({json:{write:!0}})],it.prototype,"noDataValues",void 0),O([N({json:{write:!0}})],it.prototype,"bandMasks",void 0),it=St=O([Dt("esri.layers.support.PixelBlock")],it);const H=it;var $e,Fe;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})($e||($e={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(Fe||(Fe={}));const Mn=6;function Q(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Pn(t){var a;if(!(t!=null&&t.length)||t.some(h=>!Q(h)))return null;if(t.length===1)return((a=t[0])==null?void 0:a.clone())??null;const e=t,{width:r,height:o,pixelType:c}=e[0];if(e.some(h=>h.width!==r||h.height!==o))return null;const i=e.map(({mask:h})=>h).filter(h=>h!=null);let u=null;i.length&&(u=new Uint8Array(r*o),u.set(i[0]),i.length>1&&hr(i.slice(1),u));const n=[];e.forEach(({pixels:h})=>n.push(...h));const s=e.map(({statistics:h})=>h).filter(h=>h==null?void 0:h.length),l=[];return s.forEach(h=>l.push(...h)),new H({pixelType:c,width:r,height:o,mask:u,pixels:n,statistics:l.length?l:null})}function Bt(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const r=e.sort((h,p)=>h[0]-p[0]);let o=0;r[0][0]<0&&(o=r[0][0]);const c=Math.max(256,r[r.length-1][0]-o+1),i=new Uint8Array(4*c),u=[];let n,s=0,l=0;const a=r[0].length===5;if(c>65536)return r.forEach(h=>{u[h[0]-o]=a?h.slice(1):h.slice(1).concat([255])}),{indexed2DColormap:u,offset:o,alphaSpecified:a};if(t.fillUnspecified)for(n=r[l],s=n[0]-o;sd?c[a]=0:(p[a]=u[v],f[a]=u[v+1],m[a]=u[v+2],c[a]=u[v+3]));else{for(c=new Uint8Array(i),a=0;ad?c[a]=0:(p[a]=u[v],f[a]=u[v+1],m[a]=u[v+2],c[a]=u[v+3]);r.mask=c}}else if(n)if(c!=null)for(a=0;ai));const n=[],s=e.outputPixelType||"u8";for(let a=0;a1;){if(l===a.value){g=!0;break}l>a.value?h=m:p=m,m=Math.floor((h+p)/2),a=e[Math.floor(m)]}g||(l===e[h].value?(a=e[h],g=!0):l===e[p].value?(a=e[p],g=!0):le[h].value&&(lC-m);g[0]=c[0],g[g.length-1]=c[c.length-1]+(l?1e-6:0);const v=c.length/2,[d,y]=Xt(u);for(let C=0;C=0;A--)if(k===g[2*A]||k>g[2*A]&&ky?y:k=n[S]&&k<=n[S+1]){h[x]=0,f[x]=0;break}}}return new H({width:r,height:o,pixelType:u,pixels:[h],mask:f})}function _e(t,e,r,o){const c=r!=null&&r.length>=2?new Set(r):null,i=(r==null?void 0:r.length)===1?r[0]:null,u=!!(e!=null&&e.length);for(let n=0;n=e[a]&&s<=e[a+1]){l=!0;break}l||(o[n]=0)}o[n]&&(s===i||c!=null&&c.has(s))&&(o[n]=0)}}function je(t,e){const r=t[0].length;for(let o=0;ov-1e-6);g[0]=r[0],u&&(g[g.length-1]=r[r.length-1]);for(let v=0;vf?f:o[v]g?m=i.rightPadding:d>=g&&(f=i.leftMargin-i.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let g=p.ymin;gQ(T));if(n==null)return null;const s=c?c.width:e.width,l=c?c.height:e.height,a=n.width,h=n.height,p=e.width/a,f=e.height/h,m={offset:o||{x:0,y:0},mosaic:c||e,block:{width:a,height:h}},g=n.pixelType,v=H.getPixelArrayConstructor(g),d=n.pixels.length,y=[];let w,C;for(let T=0;TT==null||T.mask!=null&&T.mask.length>0),x=t.some(T=>(T==null?void 0:T.bandMasks)&&T.bandMasks.length>1),k=b?new Uint8Array(s*l):void 0,S=x?[]:void 0;if(k){for(let T=0;Td!=null);if(o==null)return null;const c=t.some(d=>d==null||!!d.mask),{width:i,height:u}=e,n=c?new Uint8Array(i*u):null,{blockWidths:s}=r,l=[],a=o.getPlaneCount(),h=H.getPixelArrayConstructor(o.pixelType);if(c)for(let d=0,y=0;d(d==null?void 0:d.bandMasks)&&d.bandMasks.length>1),f=p?[]:void 0,m=i*u;for(let d=0;do||s>c||i===0&&u===0&&n===o&&s===c)return t;t.mask||(t.mask=new Uint8Array(o*c));const l=t.mask;for(let a=0;a=s||p=n?0:1}return t.updateStatistics(),t}function ro(t){if(!Q(t))return null;const e=t.clone(),{width:r,height:o,pixels:c}=t,i=c[0],u=e.pixels[0],n=t.mask;for(let s=2;se&&(r=i.value,e=o),i=c.next();return r}function Ht(t,e,r){if(r===0)return;const o=t.get(e);o===1?t.delete(e):t.set(e,o-1)}function Nt(t,e,r){r!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function oo(t,e,r){let{x:o,y:c}=e;const{width:i,height:u}=r;if(o===0&&c===0&&u===t.height&&i===t.width)return t;const{width:n,height:s}=t,l=Math.max(0,c),a=Math.max(0,o),h=Math.min(o+i,n),p=Math.min(c+u,s);if(h<0||p<0||!Q(t))return null;o=Math.max(0,-o),c=Math.max(0,-c);const{pixels:f}=t,m=i*u,g=f.length,v=[];for(let C=0;C{const U=I instanceof Float32Array||I instanceof Float64Array?0:.5;for(let R=0;RHe.fromJSON(o));for(let o=0;oc&&(o=c)}else{for(;!this.eof;)this.readBlock();o=this.bufferLength}return this.pos=o,this.buffer.subarray(r,o)},lookChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(e,r,o){for(var c=e+r;this.bufferLength<=c&&!this.eof;)this.readBlock();return new Stream(this.buffer,e,r,o)},skip:function(e){e||(e=1),this.pos+=e},reset:function(){this.pos=0}},t}(),(Ke=function(){if(!self||!self.Uint32Array)return null;var t=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),o=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],c=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function i(n){throw new Error(n)}function u(n){var s=0,l=n[s++],a=n[s++];l!=-1&&a!=-1||i("Invalid header in flate stream"),(15&l)!=8&&i("Unknown compression method in flate stream"),((l<<8)+a)%31!=0&&i("Bad FCHECK in flate stream"),32&a&&i("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=s,this.codeSize=0,this.codeBuf=0,ne.call(this)}return u.prototype=Object.create(ne.prototype),u.prototype.getBits=function(n){for(var s,l=this.codeSize,a=this.codeBuf,h=this.bytes,p=this.bytesPos;l>n,this.codeSize=l-=n,this.bytesPos=p,s},u.prototype.getCode=function(n){for(var s=n[0],l=n[1],a=this.codeSize,h=this.codeBuf,p=this.bytes,f=this.bytesPos;a>16,d=65535&g;return(a==0||a>v,this.codeSize=a-v,this.bytesPos=f,d},u.prototype.generateHuffmanTable=function(n){for(var s=n.length,l=0,a=0;al&&(l=n[a]);for(var h=1<>=1;for(a=d;a0;)j[g++]=_}var s=this.getBits(3);if(1&s&&(this.eof=!0),(s>>=1)!=0){var l,a;if(s==1)l=o,a=c;else if(s==2){for(var h=this.getBits(5)+257,p=this.getBits(5)+1,f=this.getBits(4)+4,m=Array(t.length),g=0;g=b&&(b=(R=this.ensureBuffer(x+1)).length),R[x++]=k;else{if(k==256)return void(this.bufferLength=x);var S=(k=e[k-=257])>>16;S>0&&(S=this.getBits(S)),d=(65535&k)+S,k=this.getCode(a),(S=(k=r[k])>>16)>0&&(S=this.getBits(S));var A=(65535&k)+S;x+d>=b&&(b=(R=this.ensureBuffer(x+d)).length);for(var M=0;M{let a=null;u==="jpg"&&n&&(a=dr._getMask(e,{width:c,height:i}));const h=new Blob([new Uint8Array(e)],{type:"image/"+u=="jpg"?"jpeg":u}),p=URL.createObjectURL(h),f=new Image;let m;f.src=p,f.onload=()=>{if(URL.revokeObjectURL(p),Br(o))return void l(Nr());c=f.width,i=f.height,this._canvas&&this._ctx?(this._canvas.width===c&&this._canvas.height===i||(this._canvas.width=c,this._canvas.height=i),this._ctx.clearRect(0,0,c,i)):(this._canvas=document.createElement("canvas"),this._canvas.width=c,this._canvas.height=i,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(f,0,0);const g=this._ctx.getImageData(0,0,c,i);let v;if(m=g.data,r.renderOnCanvas){if(a)for(v=0;v{URL.revokeObjectURL(p),l("cannot load image")}})}static _getMask(e,r){let o=null;try{const c=new Uint8Array(e),i=Math.ceil(c.length/2);let u=0;const n=c.length-2;for(u=i;u=0;h--)o[l++]=s[a]>>h&1}}catch{}return o}};var Je,Ye,Xe,me={exports:{}};me.exports,Je=me,Ye=function(){var t=function(){function e(r){this.message="JPEG error: "+r}return e.prototype=new Error,e.prototype.name="JpegError",e.constructor=e,e}();return function(){if(!self||!self.Uint8ClampedArray)return null;var e=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,o=799,c=3406,i=2276,u=1567,n=3784,s=5793,l=2896;function a(){this.decodeTransform=null,this.colorTransform=-1}function h(d,y){for(var w,C,b=0,x=[],k=16;k>0&&!d[k-1];)k--;x.push({children:[],index:0});var S,A=x[0];for(w=0;w0;)A=x.pop();for(A.index++,x.push(A);x.length<=w;)x.push(S={children:[],index:0}),A.children[A.index]=S.children,A=S;b++}w+10)return L--,P>>L&1;if((P=d[y++])===255){var $=d[y++];if($)throw new t("unexpected marker "+(P<<8|$).toString(16))}return L=7,P>>>7}function U($){for(var W=$;;){if(typeof(W=W[E()])=="number")return W;if(typeof W!="object")throw new t("invalid huffman sequence")}}function R($){for(var W=0;$>0;)W=W<<1|E(),$--;return W}function B($){if($===1)return E()===1?1:-1;var W=R($);return W>=1<<$-1?W:W+(-1<<$)+1}function G($,W){var K=U($.huffmanTableDC),rt=K===0?0:B(K);$.blockData[W]=$.pred+=rt;for(var at=1;at<64;){var ft=U($.huffmanTableAC),ot=15&ft,lt=ft>>4;if(ot!==0){var Pr=e[at+=lt];$.blockData[W+Pr]=B(ot),at++}else{if(lt<15)break;at+=16}}}function D($,W){var K=U($.huffmanTableDC),rt=K===0?0:B(K)<0)F--;else for(var K=x,rt=k;K<=rt;){var at=U($.huffmanTableAC),ft=15&at,ot=at>>4;if(ft!==0){var lt=e[K+=ot];$.blockData[W+lt]=B(ft)*(1<>4,(K=15&rt)==0)ot<15?(F=R(ot)+(1<=65488&&kt<=65495))break;y+=2}return(ut=v(d,y))&&ut.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+ut.invalid),y=ut.offset),y-I}function m(d,y,w){var C,b,x,k,S,A,M,T,I,P,L,E,U,R,B,G,D,j=d.quantizationTable,F=d.blockData;if(!j)throw new t("missing required Quantization Table.");for(var V=0;V<64;V+=8)I=F[y+V],P=F[y+V+1],L=F[y+V+2],E=F[y+V+3],U=F[y+V+4],R=F[y+V+5],B=F[y+V+6],G=F[y+V+7],I*=j[V],P|L|E|U|R|B|G?(P*=j[V+1],L*=j[V+2],E*=j[V+3],U*=j[V+4],R*=j[V+5],B*=j[V+6],G*=j[V+7],b=(C=(C=s*I+128>>8)+(b=s*U+128>>8)+1>>1)-b,D=(x=L)*n+(k=B)*u+128>>8,x=x*u-k*n+128>>8,M=(S=(S=l*(P-G)+128>>8)+(M=R<<4)+1>>1)-M,A=(T=(T=l*(P+G)+128>>8)+(A=E<<4)+1>>1)-A,k=(C=C+(k=D)+1>>1)-k,x=(b=b+x+1>>1)-x,D=S*i+T*c+2048>>12,S=S*c-T*i+2048>>12,T=D,D=A*o+M*r+2048>>12,A=A*r-M*o+2048>>12,M=D,w[V]=C+T,w[V+7]=C-T,w[V+1]=b+M,w[V+6]=b-M,w[V+2]=x+A,w[V+5]=x-A,w[V+3]=k+S,w[V+4]=k-S):(D=s*I+512>>10,w[V]=D,w[V+1]=D,w[V+2]=D,w[V+3]=D,w[V+4]=D,w[V+5]=D,w[V+6]=D,w[V+7]=D);for(var _=0;_<8;++_)I=w[_],(P=w[_+8])|(L=w[_+16])|(E=w[_+24])|(U=w[_+32])|(R=w[_+40])|(B=w[_+48])|(G=w[_+56])?(b=(C=4112+((C=s*I+2048>>12)+(b=s*U+2048>>12)+1>>1))-b,D=(x=L)*n+(k=B)*u+2048>>12,x=x*u-k*n+2048>>12,k=D,M=(S=(S=l*(P-G)+2048>>12)+(M=R)+1>>1)-M,A=(T=(T=l*(P+G)+2048>>12)+(A=E)+1>>1)-A,D=S*i+T*c+2048>>12,S=S*c-T*i+2048>>12,T=D,D=A*o+M*r+2048>>12,A=A*r-M*o+2048>>12,I=(I=(C=C+k+1>>1)+T)<16?0:I>=4080?255:I>>4,P=(P=(b=b+x+1>>1)+(M=D))<16?0:P>=4080?255:P>>4,L=(L=(x=b-x)+A)<16?0:L>=4080?255:L>>4,E=(E=(k=C-k)+S)<16?0:E>=4080?255:E>>4,U=(U=k-S)<16?0:U>=4080?255:U>>4,R=(R=x-A)<16?0:R>=4080?255:R>>4,B=(B=b-M)<16?0:B>=4080?255:B>>4,G=(G=C-T)<16?0:G>=4080?255:G>>4,F[y+_]=I,F[y+_+8]=P,F[y+_+16]=L,F[y+_+24]=E,F[y+_+32]=U,F[y+_+40]=R,F[y+_+48]=B,F[y+_+56]=G):(D=(D=s*I+8192>>14)<-2040?0:D>=2024?255:D+2056>>4,F[y+_]=D,F[y+_+8]=D,F[y+_+16]=D,F[y+_+24]=D,F[y+_+32]=D,F[y+_+40]=D,F[y+_+48]=D,F[y+_+56]=D)}function g(d,y){for(var w=y.blocksPerLine,C=y.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var k=C(y);if(k>=65472&&k<=65534)return{invalid:null,marker:k,offset:y};for(var S=C(x);!(S>=65472&&S<=65534);){if(++x>=b)return null;S=C(x)}return{invalid:k.toString(16),marker:S,offset:x}}return a.prototype={parse:function(d){function y(){var $=d[k]<<8|d[k+1];return k+=2,$}function w(){var $=y(),W=k+$-2,K=v(d,W,k);K&&K.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+K.invalid),W=K.offset);var rt=d.subarray(k,W);return k+=rt.length,rt}function C($){for(var W=Math.ceil($.samplesPerLine/8/$.maxH),K=Math.ceil($.scanLines/8/$.maxV),rt=0;rt<$.components.length;rt++){Z=$.components[rt];var at=Math.ceil(Math.ceil($.samplesPerLine/8)*Z.h/$.maxH),ft=Math.ceil(Math.ceil($.scanLines/8)*Z.v/$.maxV),ot=W*Z.h,lt=K*Z.v*64*(ot+1);Z.blockData=new Int16Array(lt),Z.blocksPerLine=at,Z.blocksPerColumn=ft}$.mcusPerLine=W,$.mcusPerColumn=K}var b,x,k=0,S=null,A=null,M=[],T=[],I=[],P=y();if(P!==65496)throw new t("SOI not found");for(P=y();P!==65497;){var L,E,U;switch(P){case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var R=w();P===65504&&R[0]===74&&R[1]===70&&R[2]===73&&R[3]===70&&R[4]===0&&(S={version:{major:R[5],minor:R[6]},densityUnits:R[7],xDensity:R[8]<<8|R[9],yDensity:R[10]<<8|R[11],thumbWidth:R[12],thumbHeight:R[13],thumbData:R.subarray(14,14+3*R[12]*R[13])}),P===65518&&R[0]===65&&R[1]===100&&R[2]===111&&R[3]===98&&R[4]===101&&(A={version:R[5]<<8|R[6],flags0:R[7]<<8|R[8],flags1:R[9]<<8|R[10],transformCode:R[11]});break;case 65499:for(var B=y()+k-2;k>4){if(G>>4!=1)throw new t("DQT - invalid table spec");for(E=0;E<64;E++)D[e[E]]=y()}else for(E=0;E<64;E++)D[e[E]]=d[k++];M[15&G]=D}break;case 65472:case 65473:case 65474:if(b)throw new t("Only single frame JPEGs supported");y(),(b={}).extended=P===65473,b.progressive=P===65474,b.precision=d[k++],b.scanLines=y(),b.samplesPerLine=y(),b.components=[],b.componentIds={};var j,F=d[k++],V=0,_=0;for(L=0;L>4,tt=15&d[k+1];V>4?T:I)[15&J]=h(q,dt)}break;case 65501:y(),x=y();break;case 65498:y();var Z,Gt=d[k++],vt=[];for(L=0;L>4],Z.huffmanTableAC=T[15&xt],vt.push(Z)}var _t=d[k++],jt=d[k++],mt=d[k++],zt=f(d,k,b,vt,x,_t,jt,mt>>4,15&mt);k+=zt;break;case 65535:d[k]!==255&&k--;break;default:if(d[k-3]===255&&d[k-2]>=192&&d[k-2]<=254){k-=3;break}throw new t("unknown marker "+P.toString(16))}P=y()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=S,this.eof=k,this.adobe=A,this.components=[],L=0;L>8)+F[T+1];return G},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var y,w,C,b=0,x=d.length;b4)throw new t("Unsupported color mode");var C=this._getLinearizedBlockData(d,y);if(this.numComponents===1&&w){for(var b=C.length,x=new Uint8ClampedArray(3*b),k=0,S=0;S=0;g--)p[d++]=v[f]>>g&1}catch{}if(n===1&&l.length===i*u){const v=new Uint8Array(l.buffer);h=[v,v,v]}else{for(h=[],f=0;f<3;f++)h.push(new Uint8Array(a));for(g=0,m=0;mimport("./lerc-wasm-v7WMG2so.js"),__vite__mapDeps([0,1,2])).then(t=>t.l).then(({default:t})=>t({locateFile:e=>Fr(`esri/layers/support/rasterFormats/${e}`)})).then(t=>{po(t)}),ie)}const Yt={getBlobInfo:null,decode:null};function fo(t){return 16+(t>>3<<3)}function bt(t,e,r){r.set(t.slice(e,e+r.length))}function po(t){const{_malloc:e,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:c,_lerc_decode_4D:i,asm:u}=t;let n;const s=Object.values(u).find(a=>a&&"buffer"in a&&a.buffer===t.HEAPU8.buffer),l=a=>{const h=a.map(g=>fo(g)),p=h.reduce((g,v)=>g+v),f=e(p);n=new Uint8Array(s.buffer);let m=h[0];h[0]=f;for(let g=1;g{const f=new Uint8Array(48),m=new Uint8Array(8*3),[g,v,d]=l([a.length,f.length,m.length]);n.set(a,g),n.set(f,v),n.set(m,d);let y=o(g,a.length,v,d,12,3);if(y)throw r(g),new Error(`lerc-getBlobInfo: error code is ${y}`);n=new Uint8Array(s.buffer),bt(n,v,f),bt(n,d,m);const w=new Uint32Array(f.buffer),C=new Float64Array(m.buffer),[b,x,,k,S,A,M,T,I,P,L]=w,E={version:b,depthCount:P,width:k,height:S,validPixelCount:M,bandCount:A,blobSize:T,maskCount:I,dataType:x,minValue:C[0],maxValue:C[1],maxZerror:C[2],statistics:[],bandCountWithNoData:L};if(L&&P>1)return r(g),E;if(P===1&&A===1)return r(g),E.statistics.push({minValue:C[0],maxValue:C[1]}),E;const U=P*A*8,R=new Uint8Array(U),B=new Uint8Array(U);let G=g,D=0,j=0,F=!1;if(n.byteLength1){const wt=V.slice(tt*P,(tt+1)*P),Ct=_.slice(tt*P,(tt+1)*P),J=Math.min.apply(null,wt),q=Math.max.apply(null,Ct);X.push({minValue:J,maxValue:q,depthStats:{minValues:wt,maxValues:Ct}})}else X.push({minValue:V[tt],maxValue:_[tt]});return r(G),F||r(D),E},Yt.decode=(a,h)=>{const{maskCount:p,depthCount:f,bandCount:m,width:g,height:v,dataType:d,bandCountWithNoData:y}=h,w=gr[d],C=g*v,b=new Uint8Array(C*m),x=C*f*m*w.size,k=new Uint8Array(x),S=new Uint8Array(m),A=new Uint8Array(8*m),[M,T,I,P,L]=l([a.length,b.length,k.length,S.length,A.length]);n.set(a,M),n.set(b,T),n.set(k,I),n.set(S,P),n.set(A,L);const E=i(M,a.length,p,T,f,g,v,m,d,I,P,L);if(E)throw r(M),new Error(`lerc-decode: error code is ${E}`);n=new Uint8Array(s.buffer),bt(n,I,k),bt(n,T,b);let U=null;if(y){bt(n,P,S),bt(n,L,A),U=[];const R=new Float64Array(A.buffer);for(let B=0;B1){b.set(y[0]);for(let M=1;M=x;if(f>0&&k)for(let M=0;M1?y:null,{pixelType:A}=g;return{width:s,height:l,bandCount:a,pixelType:A,depthCount:h,statistics:m,pixels:d,mask:b,bandMasks:S,noDataValues:n}}function go(t,e,r,o=!0){if(e%4!=0||r%4!=0){const c=new ArrayBuffer(4*Math.ceil(r/4)),i=new Uint8Array(c),u=new Uint8Array(t,e,r);if(o)for(let n=0;n=i)n-=i,p=h>>>32-i,h<<=i;else{p=h>>>32-n,h=c[a++];const d=i-n;n=32-d,p=(p<>>n),h<<=d}if(p===257)break;if(p===256){i=9,u=Ze(),s=u.length,l=[];continue}const v=u[p];if(v==null){if(p>u.length)throw new Error("data integrity issue: code does not exist on code page");l.push(l[0]),u[s++]=l.slice(),Qe(g,l)}else Qe(g,v),l.push(v[0]),l.length>1&&(u[s++]=l.slice()),l=v.slice();if(Et.has(s)&&i++,n===0&&(h=c[a++],n=32),a>f||a===f&&n<=m)break}return new Uint8Array(g)}Et.add(511),Et.add(1023),Et.add(2047),Et.add(4095),Et.add(8191);const tr=(t,e)=>{const r=e.width*e.height,o=e.pixelType;return Math.floor(t.byteLength/(r*Cr(o)))},Cr=t=>{let e=1;switch(t){case Uint8Array:case Int8Array:e=1;break;case Uint16Array:case Int16Array:e=2;break;case Uint32Array:case Int32Array:case Float32Array:e=4;break;case Float64Array:e=8}return e},yo=(t,e)=>{if(8*t.byteLength=0;n--)o[c++]=i>>n&1;for(n=7;c>n&1,n--;return o};let wo=class{static decode(e,r){const o=r.pixelType,c=[],i=r.width*r.height,u=tr(e,r),{bandIds:n,format:s}=r,l=(n==null?void 0:n.length)||tr(e,r),a=e.byteLength-e.byteLength%(i*Cr(o)),h=new o(e,0,i*u);let p,f,m,g,v=null;if(s==="bip")for(p=0;p>4,c<8?c=1:c===15?(c=4,i=(7&i)<<18|(63&t[r++])<<12|(63&t[r++])<<6|63&t[r++]):c===14?(c=3,i=(15&i)<<12|(63&t[r++])<<6|63&t[r++]):(c=2,i=(31&i)<<6|63&t[r++]),(i!==0||e)&&(o+=String.fromCharCode(i));return o}const Ae=(()=>{const t=[];return t[254]="NEWSUBFILETYPE",t[255]="SUBFILETYPE",t[256]="IMAGEWIDTH",t[257]="IMAGELENGTH",t[258]="BITSPERSAMPLE",t[259]="COMPRESSION",t[262]="PHOTOMETRICINTERPRETATION",t[263]="THRESHHOLDING",t[264]="CELLWIDTH",t[265]="CELLLENGTH",t[266]="FILLORDER",t[269]="DOCUMENTNAME",t[270]="IMAGEDESCRIPTION",t[271]="MAKE",t[272]="MODEL",t[273]="STRIPOFFSETS",t[274]="ORIENTATION",t[277]="SAMPLESPERPIXEL",t[278]="ROWSPERSTRIP",t[279]="STRIPBYTECOUNTS",t[280]="MINSAMPLEVALUE",t[281]="MAXSAMPLEVALUE",t[282]="XRESOLUTION",t[283]="YRESOLUTION",t[284]="PLANARCONFIGURATION",t[285]="PAGENAME",t[286]="XPOSITION",t[287]="YPOSITION",t[288]="FREEOFFSETS",t[289]="FREEBYTECOUNTS",t[290]="GRAYRESPONSEUNIT",t[291]="GRAYRESPONSECURVE",t[292]="T4OPTIONS",t[293]="T6OPTIONS",t[296]="RESOLUTIONUNIT",t[297]="PAGENUMBER",t[300]="COLORRESPONSEUNIT",t[301]="TRANSFERFUNCTION",t[305]="SOFTWARE",t[306]="DATETIME",t[315]="ARTIST",t[316]="HOSTCOMPUTER",t[317]="PREDICTOR",t[318]="WHITEPOINT",t[319]="PRIMARYCHROMATICITIES",t[320]="COLORMAP",t[321]="HALFTONEHINTS",t[322]="TILEWIDTH",t[323]="TILELENGTH",t[324]="TILEOFFSETS",t[325]="TILEBYTECOUNTS",t[326]="BADFAXLINES",t[327]="CLEANFAXDATA",t[328]="CONSECUTIVEBADFAXLINES",t[330]="SUBIFD",t[332]="INKSET",t[333]="INKNAMES",t[334]="NUMBEROFINKS",t[336]="DOTRANGE",t[337]="TARGETPRINTER",t[338]="EXTRASAMPLES",t[339]="SAMPLEFORMAT",t[340]="SMINSAMPLEVALUE",t[341]="SMAXSAMPLEVALUE",t[342]="TRANSFERRANGE",t[347]="JPEGTABLES",t[512]="JPEGPROC",t[513]="JPEGIFOFFSET",t[514]="JPEGIFBYTECOUNT",t[515]="JPEGRESTARTINTERVAL",t[517]="JPEGLOSSLESSPREDICTORS",t[518]="JPEGPOINTTRANSFORM",t[519]="JPEGQTABLES",t[520]="JPEGDCTABLES",t[521]="JPEGACTABLES",t[529]="YCBCRCOEFFICIENTS",t[530]="YCBCRSUBSAMPLING",t[531]="YCBCRPOSITIONING",t[532]="REFERENCEBLACKWHITE",t[700]="XMP",t[33550]="GEOPIXELSCALE",t[33922]="GEOTIEPOINTS",t[33432]="COPYRIGHT",t[42112]="GDAL_METADATA",t[42113]="GDAL_NODATA",t[50844]="RPCCOEFFICIENT",t[34264]="GEOTRANSMATRIX",t[34735]="GEOKEYDIRECTORY",t[34736]="GEODOUBLEPARAMS",t[34737]="GEOASCIIPARAMS",t[34665]="EXIFIFD",t[34853]="GPSIFD",t[40965]="INTEROPERABILITYIFD",t})(),bo=(()=>{const t=Ae.slice();return t[36864]="ExifVersion",t[40960]="FlashpixVersion",t[40961]="ColorSpace",t[42240]="Gamma",t[37121]="ComponentsConfiguration",t[37122]="CompressedBitsPerPixel",t[40962]="PixelXDimension",t[40963]="PixelYDimension",t[37500]="MakerNote",t[37510]="UserComment",t[40964]="RelatedSoundFile",t[36867]="DateTimeOriginal",t[36868]="DateTimeDigitized",t[36880]="OffsetTime",t[36881]="OffsetTimeOriginal",t[36882]="OffsetTimeDigitized",t[37520]="SubSecTime",t[37521]="SubSecTimeOriginal",t[37522]="SubSecTimeDigitized",t[37888]="Temperature",t[37889]="Humidity",t[37890]="Pressure",t[37891]="WaterDepth",t[37892]="Acceleration",t[37893]="CameraElevationAngle",t[42016]="ImageUniqueID",t[42032]="CameraOwnerName",t[42033]="BodySerialNumber",t[42034]="LensSpecification",t[42035]="LensMake",t[42036]="LensModel",t[42037]="LensSerialNumber",t[33434]="ExposureTime",t[33437]="FNumber",t[34850]="ExposureProgram",t[34852]="SpectralSensitivity",t[34855]="PhotographicSensitivity",t[34856]="OECF",t[34864]="SensitivityType",t[34865]="StandardOutputSensitivity",t[34866]="RecommendedExposureIndex",t[34867]="ISOSpeed",t[34868]="ISOSpeedLatitudeyyy",t[34869]="ISOSpeedLatitudezzz",t[37377]="ShutterSpeedValue",t[37378]="ApertureValue",t[37379]="BrightnessValue",t[37380]="ExposureBiasValue",t[37381]="MaxApertureValue",t[37382]="SubjectDistance",t[37383]="MeteringMode",t[37384]="LightSource",t[37385]="Flash",t[37386]="FocalLength",t[37396]="SubjectArea",t[41483]="FlashEnergy",t[41484]="SpatialFrequencyResponse",t[41486]="FocalPlaneXResolution",t[41487]="FocalPlaneYResolution",t[41488]="FocalPlaneResolutionUnit",t[41492]="SubjectLocation",t[41493]="ExposureIndex",t[41495]="SensingMethod",t[41728]="FileSource",t[41729]="SceneType",t[41730]="CFAPattern",t[41985]="CustomRendered",t[41986]="ExposureMode",t[41987]="WhiteBalance",t[41988]="DigitalZoomRatio",t[41989]="FocalLengthIn35mmFilm",t[41990]="SceneCaptureType",t[41991]="GainControl",t[41992]="Contrast",t[41993]="Saturation",t[41994]="Sharpness",t[41995]="DeviceSettingDescription",t[41996]="SubjectDistanceRange",t})(),vo=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],xo=(()=>{const t=[];return t[1024]="GTModelTypeGeoKey",t[1025]="GTRasterTypeGeoKey",t[1026]="GTCitationGeoKey",t[2048]="GeographicTypeGeoKey",t[2049]="GeogCitationGeoKey",t[2050]="GeogGeodeticDatumGeoKey",t[2051]="GeogPrimeMeridianGeoKey",t[2052]="GeogLinearUnitsGeoKey",t[2053]="GeogLinearUnitSizeGeoKey",t[2054]="GeogAngularUnitsGeoKey",t[2055]="GeogAngularUnitSizeGeoKey",t[2056]="GeogEllipsoidGeoKey",t[2057]="GeogSemiMajorAxisGeoKey",t[2058]="GeogSemiMinorAxisGeoKey",t[2059]="GeogInvFlatteningGeoKey",t[2061]="GeogPrimeMeridianLongGeoKey",t[2060]="GeogAzimuthUnitsGeoKey",t[3072]="ProjectedCSTypeGeoKey",t[3073]="PCSCitationGeoKey",t[3074]="ProjectionGeoKey",t[3075]="ProjCoordTransGeoKey",t[3076]="ProjLinearUnitsGeoKey",t[3077]="ProjLinearUnitSizeGeoKey",t[3078]="ProjStdParallel1GeoKey",t[3079]="ProjStdParallel2GeoKey",t[3080]="ProjNatOriginLongGeoKey",t[3081]="ProjNatOriginLatGeoKey",t[3082]="ProjFalseEastingGeoKey",t[3083]="ProjFalseNorthingGeoKey",t[3084]="ProjFalseOriginLongGeoKey",t[3085]="ProjFalseOriginLatGeoKey",t[3086]="ProjFalseOriginEastingGeoKey",t[3087]="ProjFalseOriginNorthingGeoKey",t[3088]="ProjCenterLongGeoKey",t[3090]="ProjCenterEastingGeoKey",t[3091]="ProjCenterNorthingGeoKey",t[3092]="ProjScaleAtNatOriginGeoKey",t[3093]="ProjScaleAtCenterGeoKey",t[3094]="ProjAzimuthAngleGeoKey",t[3095]="ProjStraightVertPoleLongGeoKey",t[4096]="VerticalCSTypeGeoKey",t[4097]="VerticalCitationGeoKey",t[4098]="VerticalDatumGeoKey",t[4099]="VerticalUnitsGeoKey",t})(),ko=(t,e)=>{let r=(e||Ae)[t];return r===void 0&&(r="unknown"+String(t)),r},ge=new Map;ge.set("EXIFIFD",bo),ge.set("GPSIFD",vo);const Lt={tiffTags:Ae,ifdTags:ge,geoKeys:xo,getTagName:ko},Se=(()=>{const t=new ArrayBuffer(4),e=new Uint8Array(t);return new Uint32Array(t)[0]=1,e[0]===1})(),er=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ut=4294967296,Ao=new Set([1,5,6,7,8,34712,34887]);function Te(t,e){let r="unknown";return t===3?r=e===64?"f64":"f32":t===1?e===1?r="u1":e===2?r="u2":e===4?r="u4":e<=8?r="u8":e<=16?r="u16":e<=32&&(r="u32"):t===2&&(e<=8?r="s8":e<=16?r="s16":e<=32&&(r="s32")),r}function Zt(t){let e=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f64":e=Float64Array;break;default:e=Float32Array}return e}function So(t,e){return{x:e[0]*t.x+e[1]*t.y+e[2],y:e[3]*t.x+e[4]*t.y+e[5]}}function br(t,e){var r;return(r=t.get(e))==null?void 0:r.values}function Mt(t,e){var r;return(r=t.get(e))==null?void 0:r.values}function rr(t,e){var r,o;return(o=(r=t.get(e))==null?void 0:r.values)==null?void 0:o[0]}function z(t,e){var r,o;return(o=(r=t.get(e))==null?void 0:r.values)==null?void 0:o[0]}function se(t,e,r,o=0,c=Lt.tiffTags,i=4){const u=i===8,n=u?Me(new DataView(t,r,8),0,e):new DataView(t,r,2).getUint16(0,e),s=4+2*i,l=u?8:2,a=l+n*s;if(r+a>t.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:a};const h=r+a+4<=t.byteLength?Kt(new DataView(t,r+a,i===8?8:4),0,e,i===8):null,p=r+l,f=new Map;let m,g,v,d,y,w=0,C=0;for(let b=0;bwr(t,{inputOffset:e}).pixels[0];function ye(t,e){if(e!==1&&e!==2&&e!==4)return t;const r=new Uint8Array(t),o=8/e,c=new Uint8Array(t.byteLength*o);let i=0;const u=2**e-1;for(let n=0;n>>8-e&u}return c.buffer}function we(t,e,r){const o=new mr;o.parse(t),o.colorTransform=r===6?-1:0;const c=o.getData(o.width,o.height,e!==1&&e!==4);return new Uint8Array(c.buffer)}function Ce(t){const e=new Vt(t).getBytes(),r=new ArrayBuffer(e.length),o=new Uint8Array(r);return o.set(e),o}async function be(t,e,r,o,c){const i=Se===e,u=z(r,"BITSPERSAMPLE"),n=z(r,"SAMPLESPERPIXEL")??1,s=z(r,"PHOTOMETRICINTERPRETATION"),l=z(r,"SAMPLEFORMAT")??1,a=Te(l,u),h=z(r,"COMPRESSION")??1,p=Zt(a);let f,m,g;if(h===34887)return await yr(),To(t,o);if(h===1)f=t.slice(o,o+c),m=new Uint8Array(f);else if(h===8||h===32946)m=new Uint8Array(t,o,c),m=Ce(m),f=m.buffer;else if(h===6)m=new Uint8Array(t,o,c),m=we(m,n,s),f=m.buffer;else if(h===7){const w=r.get("JPEGTABLES").values,C=w.length-2;m=new Uint8Array(C+c-2);for(let x=0;x1&&(h===5||h===8||h===32946)&&d&&y){const w=Qt(r),C=new p(g.length);C.set(g),g=Go(C,y,d,l===3&&v===3,w?1:n)}return g}async function Io(t,e,r){const o=Mt(r,"TILEOFFSETS");if(o===void 0)return null;const c=Mt(r,"TILEBYTECOUNTS"),{width:i,height:u,pixelType:n,tileWidth:s,tileHeight:l}=Ie([r]),a=Qt(r,e),h=z(r,"SAMPLESPERPIXEL")||e.planes,p=i*u,f=z(r,"BITSPERSAMPLE"),m=(z(r,"COMPRESSION")??1)===34887,g=Zt(n),v=[];for(let R=0;R1){const R=Math.round(o.length/h);for(d=0;d{const o=Se===e.littleEndian,c=Mt(r,"STRIPOFFSETS");if(c===void 0)return null;const{width:i,height:u,pixelType:n}=Ie([r]),s=z(r,"SAMPLESPERPIXEL")||e.planes,l=z(r,"PHOTOMETRICINTERPRETATION"),a=i*u,h=z(r,"BITSPERSAMPLE"),p=Zt(n),f=new p(a*s),m=Mt(r,"STRIPBYTECOUNTS"),g=z(r,"ROWSPERSTRIP"),v=z(r,"COMPRESSION")??1;let d,y,w,C,b,x,k,S,A,M=g;if(h%8==0)for(d=0;du?u-d*g:g,n==="u8"||n==="s8"||o)v===8||v===32946?(k=new Uint8Array(t,c[d],m[d]),k=Ce(k),x=k.buffer):v===6?(k=new Uint8Array(t,c[d],m[d]),k=we(k,s,l),x=k.buffer):v===5?(k=ke(t,c[d],m[d],e.littleEndian),x=k.buffer):(m[d]!==M*i*s*h/8&&console.log("strip byte counts is different than expected"),x=t.slice(c[d],c[d]+m[d])),x=ye(x,h),C=new p(x);else{switch(v===6||v===8||v===32946?(k=new Uint8Array(t,c[d],m[d]),S=Ce(k),x=S.buffer):(m[d]!==M*i*s*h/8&&console.log("strip byte counts is different than expected"),x=new ArrayBuffer(m[d]),k=new Uint8Array(t,c[d],m[d]),S=new Uint8Array(x)),n){case"u16":case"s16":for(w=0;w{if(!(t&&t.length>0&&e&&r))return null;let o,c,i;const u=t[0].length,n=t.length,s=new Uint8Array(u);for(let l=0;li?0:1;else for(let a=0;ai?0:1);return s},Eo=t=>{if(!t)return null;const e=t.match(//gi);if(!e||e.length===0)return null;const r=new Map;let o,c,i,u,n;for(let d=0;d")),u=o.indexOf("sample="),u>-1&&(n=o.slice(u+8,o.indexOf('"',u+8))),u=o.indexOf("name="),u>-1&&(c=o.slice(u+6,o.indexOf('"',u+6))),c&&(i=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),n!=null?r.has(c)?r.get(c)[n]=i:r.set(c,[i]):r.set(c,i)),n=null;const s=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),a=r.get("STATISTICS_MEAN"),h=r.get("STATISTICS_STDDEV");let p=null;if(s&&l){p=[];for(let d=0;dv&&p>(c?t.byteLength:t?t.byteLength-s+o:0))return r.offlineOffsetSize=[s,p],r.values=null,!1;if(f<=v){if(!e)if(v<=32)s>>>=32-f;else{const y=d!=null&&d.length?d[0]:s>>>0,w=d!=null&&d.length?d[1]:Math.round((s-y)/Ut);f<=32?(s=y>>>32-f,d[0]=s):(s=y*2**(32-f)+(w>>>32-f),d[0]=y,d[1]=w>>>32-f)}if(n===1&&h===v)l=[s];else if(v===64){const y=d!=null&&d.length?d[0]:s>>>0,w=d!=null&&d.length?d[1]:Math.round((s-y)/Ut);let C=y,b=32;for(g=1;g<=n;g++){const x=32-h*g%32;if(b>>32-b,S=w<<32-b>>>32-b;C=w,l.push(k+S*2**(h-b)),b-=32-(h-b)}else l.push(C<>>32-h),b-=h;b===0&&(b=32,C=w)}}else for(g=1;g<=n;g++){const y=32-h*g;l.push(s<>>32-h)}}else{s-=o,c&&(s=0);for(let y=s;yparseFloat(G)),p.some(G=>isNaN(G))&&(p=null));const f=z(e,"COMPRESSION")??1;let m;switch(f){case 1:m="NONE";break;case 2:case 3:case 4:case 32771:m="CCITT";break;case 5:m="LZW";break;case 6:case 7:m="JPEG";break;case 32773:m="PACKBITS";break;case 8:case 32946:m="DEFLATE";break;case 34712:m="JPEG2000";break;case 34887:m="LERC";break;default:m=String(f)}let g=!0,v="";Ao.has(f)||(g=!1,v+="unsupported tag compression "+f),s>3&&(g=!1,v+="unsupported tag sampleFormat "+s),u!==1&&u!==2&&u!==4&&u%8!=0&&(g=!1,v+="unsupported tag bitsPerSample "+u);const d=rr(e,"GEOASCIIPARAMS");let y;if(d){const G=d.split("|").find(j=>j.includes("ESRI PE String = ")),D=G?G.replace("ESRI PE String = ",""):"";y=D.startsWith("COMPD_CS")||D.startsWith("PROJCS")||D.startsWith("GEOGCS")?{wkid:null,wkt:D}:null}const w=Mt(e,"GEOTIEPOINTS"),C=Mt(e,"GEOPIXELSCALE"),b=Mt(e,"GEOTRANSMATRIX"),x=e.has("GEOKEYDIRECTORY")?e.get("GEOKEYDIRECTORY").data:null;let k,S,A=!1,M=!1;if(x){A=z(x,"GTRasterTypeGeoKey")===2;const G=z(x,"GTModelTypeGeoKey");if(G===2){const D=z(x,"GeographicTypeGeoKey");D>=1024&&D<=32766&&(y={wkid:D}),y||D!==32767||(M=!0,y={wkid:4326})}else if(G===1){const D=z(x,"ProjectedCSTypeGeoKey");D>=1024&&D<=32766&&(y={wkid:D})}}if(C&&w&&w.length>=6?(k=[C[0],0,w[3]-w[0]*C[0],0,-Math.abs(C[1]),w[4]-w[1]*C[1]],A&&(k[2]-=.5*k[0]+.5*k[1],k[5]-=.5*k[3]+.5*k[4])):b&&b.length===16&&(k=A?[b[0],b[1],b[3]-.5*b[0],b[4],b[5],b[7]-.5*b[5]]:[b[0],b[1],b[3],b[4],b[5],b[7]]),k){const G=[{x:0,y:i},{x:0,y:0},{x:c,y:i},{x:c,y:0}];let D,j=Number.POSITIVE_INFINITY,F=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,_=Number.NEGATIVE_INFINITY;for(let X=0;Xj?j:D.x,V=D.xF?F:D.y,_=D.y<_?_:D.y;S={xmin:j,xmax:V,ymin:F,ymax:_,spatialReference:y}}else S={xmin:-.5,ymin:.5-i,xmax:c-.5,ymax:.5,spatialReference:y};M&&(S.xmax-S.xmin>400||Math.max(Math.abs(S.xmin),Math.abs(S.xmax))>361)&&(y=null,S.spatialReference=null);const T=vr(t);let I,P,L,E,U;if(T.length>0){L=Math.round(Math.log(c/z(T[0],"IMAGEWIDTH"))/Math.LN2);const G=T[T.length-1];E=Math.round(Math.log(c/z(G,"IMAGEWIDTH"))/Math.LN2),I=z(G,"TILEWIDTH"),P=z(G,"TILELENGTH")}I=E!=null&&E>0?I||r:null,P=E!=null&&E>0?P||o:null,r&&(U=[{maxCol:Math.ceil(c/r)-1,maxRow:Math.ceil(i/o)-1,minRow:0,minCol:0}],T.forEach(G=>{U.push({maxCol:Math.ceil(z(G,"IMAGEWIDTH")/z(G,"TILEWIDTH"))-1,maxRow:Math.ceil(z(G,"IMAGELENGTH")/z(G,"TILELENGTH"))-1,minRow:0,minCol:0})}));const R=rr(t[0],"GDAL_METADATA"),B=Eo(R);return v+=" "+kr({width:c,height:i,tileWidth:r,tileHeight:o,planes:n,ifds:t}),{width:c,height:i,tileWidth:r,tileHeight:o,planes:n,isBSQ:a,pixelType:l,compression:m,noData:p,hasMaskBand:xr(t).length===T.length+1,isSupported:g,message:v,extent:S,isPseudoGeographic:M,affine:C?null:k,firstPyramidLevel:L,maximumPyramidLevel:E,pyramidBlockWidth:I,pyramidBlockHeight:P,tileBoundary:U,metadata:B}}function Qt(t,e){const r=br(t,"PLANARCONFIGURATION");return r?r[0]===2:!!e&&e.isBSQ}function vr(t){return t.filter(e=>z(e,"NEWSUBFILETYPE")===1)}function xr(t){return t.filter(e=>{const r=(4&(z(e,"NEWSUBFILETYPE")??0))==4,o=z(e,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function Lo(t){const{littleEndian:e,isBigTiff:r,firstIFDPos:o}=Do(t);let c=o;const i=[];do{const u=Oo(t,e,c,0,Lt.tiffTags,r?8:4);if(!u.success)break;i.push(u.ifd),c=u.nextIFD}while(c>0);return{...Ie(i),littleEndian:e,isBigTiff:r,ifds:i,pyramidIFDs:vr(i),maskIFDs:xr(i)}}function Me(t,e,r){const o=t.getUint32(e,r),c=t.getUint32(e+4,r);return r?c*Ut+o:o*Ut+c}function Uo(t,e,r){let o=r?t.getInt32(e,r):t.getUint32(e,r),c=r?t.getUint32(e+4,r):t.getInt32(e+4,r);const i=(r?o:c)>=0?1:-1;return r?o*=i:c*=i,i*(r?c*Ut+o:o*Ut+c)}function Kt(t,e,r,o){return o?Me(t,e,r):t.getUint32(e,r)}function Do(t){const e=new DataView(t,0,16),r=e.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const c=e.getUint16(2,o);if(c!==42&&c!==43)throw new Error("unexpected tiff identifier");let i=4;const u=c===43;if(u){const n=e.getUint16(i,o);if(i+=2,n!==8)throw new Error("unsupported bigtiff version");if(e.getUint16(i,o)!==0)throw new Error("unsupported bigtiff version");i+=2}return{littleEndian:o,isBigTiff:u,firstIFDPos:Kt(e,i,o,u)}}function Oo(t,e,r,o=0,c=Lt.tiffTags,i=4){const u=se(t,e,r,o,c,i);let n;const s=u.ifd;if(s){if(Lt.ifdTags.forEach((l,a)=>{s.has(a)&&(n=s.get(a),n.data=se(t,e,n.valueOffset-o,o,l).ifd)}),s.has("GEOKEYDIRECTORY")){n=s.get("GEOKEYDIRECTORY");const l=n.values;if(l&&l.length>4){const a=l[0]+"."+l[1]+"."+l[2];n.data=se(t,e,n.valueOffset+6-o,o,Lt.geoKeys,2).ifd,n.data&&n.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(s.has("XMP")){n=s.get("XMP");const l=n.values;typeof l[0]=="number"&&n.type===7&&(n.values=[Co(new Uint8Array(l))])}}return u}function kr(t){const{width:e,height:r,tileHeight:o,tileWidth:c}=t,i=t.planes,u=c?c*o:e*r,n=z(t.ifds[0],"BITSPERSAMPLE");let s="";return u*i>2**30/(n>8?n/8:1)&&(s=c?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function Go(t,e,r,o,c){const i=o?4:1,u=r*i*c;o&&(t=new Uint8Array(t.buffer));for(let l=0;lA.min):null,k=b?b.map(A=>A.max):null,S={pixelType:l,width:p,height:f,pixels:d,noDataValue:C};return C!=null?xe(S,C):x&&k&&e.applyMinMaxConstraint&&(S.mask=Po(d,x,k)),S}async function No(t,e={}){const r=e.pyramidLevel||0,o=e.headerInfo||Lo(t),{ifds:c,noData:i}=o;if(c.length===0)throw new Error("no valid image file directory");const u=kr(o);if(u)throw u;let n=null;const s=r===-1?c[c.length-1]:c[r],l=i??e.noDataValue;return n=o.tileWidth?await Io(t,o,s):Mo(t,o,s),n&&(l!=null&&xe(n,l),n)}var $o=function(t){var e,r,o,c,i,u;function n(s){var l,a,h,p,f,m,g,v,d,y,w,C,b;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},f=null;;){switch(l=this.readUInt32(),v=(function(){var x,k;for(k=[],x=0;x<4;++x)k.push(String.fromCharCode(this.data[this.pos++]));return k}).call(this).join(""),v){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(l);break;case"fcTL":f&&this.animation.frames.push(f),this.pos+=4,f={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},p=this.readUInt16(),h=this.readUInt16()||100,f.delay=1e3*p/h,f.disposeOp=this.data[this.pos++],f.blendOp=this.data[this.pos++],f.data=[];break;case"IDAT":case"fdAT":for(v==="fdAT"&&(this.pos+=4,l-=4),s=(f!=null?f.data:void 0)||this.imgData,w=0;0<=l?wl;0<=l?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(d=255-this.transparency.indexed.length)>0)for(C=0;0<=d?Cd;0<=d?++C:--C)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":m=(y=this.read(l)).indexOf(0),g=String.fromCharCode.apply(String,y.slice(0,m)),this.text[g]=String.fromCharCode.apply(String,y.slice(m+1));break;case"IEND":return f&&this.animation.frames.push(f),this.colors=(function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}).call(this),this.hasAlphaChannel=(b=this.colorType)===4||b===6,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=(function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}).call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return n.load=function(s,l,a){var h;return typeof l=="function"&&(a=l),(h=new XMLHttpRequest).open("GET",s,!0),h.responseType="arraybuffer",h.onload=function(){var p;return p=new n(new Uint8Array(h.response||h.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&p.render(l),typeof a=="function"?a(p):void 0},h.send(null)},r=1,o=2,e=0,n.prototype.read=function(s){var l,a;for(a=[],l=0;0<=s?ls;0<=s?++l:--l)a.push(this.data[this.pos++]);return a},n.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},n.prototype.decodePixels=function(s){var l,a,h,p,f,m,g,v,d,y,w,C,b,x,k,S,A,M,T,I,P,L,E;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Vt(s)).getBytes(),S=(C=this.pixelBitlength/8)*this.width,b=new Uint8Array(S*this.height),m=s.length,k=0,x=0,a=0;x1&&a/pHo(r,o,t);break;case"tiff":e=_o;break;case"deflate":e=zo;break;case"lzw":e=Wo;break;case"error":e=()=>{throw new yt("rasterCodec:decode","input data contains error")};break;default:e=()=>{throw new yt("rasterCodec:decode","unsupported raster format")}}return e}function Xo(t){let e=null,r=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,e=Uint8Array;break;case"u16":r=r||65535,e=Uint16Array;break;case"u32":r=r||2**32-1,e=Uint32Array;break;case"s8":r=r||-128,e=Int8Array;break;case"s16":r=r||-32768,e=Int16Array;break;case"s32":r=r||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:r}}function Zo(t,e=1){if(!t)return;const{pixels:r,width:o,height:c,mask:i}=t;if(!r||r.length===0)return;const u=r.length,n=o-1,s=c-1,l=[];let a,h,p,f,m,g,v=null;const d=H.getPixelArrayConstructor(t.pixelType);if(e===0){for(a=0;a1||e&&r.fields.find(c=>c.name.toLowerCase()===e.toLowerCase())==null)}function en(t){const{bandCount:e,dataType:r,pixelType:o}=t;return r==="elevation"||r==="generic"&&e===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function rn(t,e=!1){const{bandCount:r,colormap:o,pixelType:c}=t;return r===1&&(!!(o!=null&&o.length)||!e&&c==="u8")}function qn(t,e=!1){const{attributeTable:r,bandCount:o}=t;return o===1&&(!e||r!=null||t.histograms!=null)}function Kn(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}function Jn(t){const{dataType:e}=t;return e==="vector-uv"||e==="vector-magdir"}const ae=1,on=[.299,.587,.114];function Tr(t,e=256){e=Math.min(e,256);const{size:r,counts:o}=t,c=new Uint8Array(r),i=o.reduce((a,h)=>a+h/e,0);let u=0,n=0,s=0,l=i;for(let a=0;a=s){const b=Ir(s,o);for(l=0;l1&&(w-=(1/g)**(v*b[l])),ye[l]){const x=w*g*v**(1/o[l])+u;C[a]=i==="floor"?Math.floor(x):i==="round"?Math.round(x):x}else y>=r[l]?C[a]=n:C[a]=u;else C[a]=u;d[l]=C}}else for(l=0;l=r[l])C[a]=n;else{const b=(y-e[l])*f[l]+u;C[a]=i==="floor"?Math.floor(b):i==="round"?Math.round(b):b}d[l]=C}if(t.contrastOffset!=null){const b=nn(t.contrastOffset,t.brightnessOffset);for(l=0;l0&&r<100?n=(200*u-100*c+2*c*o)/(2*(100-r))+i:r<=0&&r>-100?n=(200*u-100*c+2*c*o)*(100+r)/2e4+i:r===100?(n=200*u-100*c+(c+1)*(100-r)+2*c*o,n=n>0?c:0):r===-100&&(n=i),s[u]=n>c?c:n<0?0:n;return s}function sn(t,e,r){const o=[];for(let c=0;c=255)return ae;let e=0;t!==150&&(e=t<=150?45*Math.cos(.01047*t):17*Math.sin(.021*t));const r=255,o=t+e,c=Math.log(t/r),i=Math.log(o/r);if(i===0)return ae;const u=c/i;return isNaN(u)?ae:Math.min(9.9,Math.max(.01,u))}function ln(t,e,r,o){let c=1/0,i=-1/0,u=0,n=0,s=0,l=0;const a=t.length,h=new Map,p=[];for(let k=0;kl&&(l=A,s=S),c=Si?S:i,u+=S,n++}}if(n===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const f=u/n;let m=0;for(let k=0;kk).length:a,v=g<=1?0:Math.sqrt(m/(g-1));p.sort((k,S)=>k-S);const d=n>>>1,y={min:c,max:i,avg:f,stddev:v,mode:s,median:n%2?p[Math.floor(d)]:(p[d-1]+p[d])/2};if(!o)return{statistics:y,histogram:null};if(["u8","s8","u4","u2","u1"].includes(r)){const k=i-c+1,S=new Uint32Array(k);for(let A=0;Aln(u,(c==null?void 0:c[n])??r,o,!0));return{statistics:i.map(({statistics:u})=>u),histograms:i.map(({histogram:u})=>u)}}function cn(t){var A;if(!((A=t==null?void 0:t.pixels)!=null&&A.length))return null;const{pixels:e,mask:r,bandMasks:o,pixelType:c}=t,i=t.width*t.height,u=e.length;let n,s,l,a,h;const p=[],f=[];let m,g,v,d,y,w,C,b,x,k;const S=256;for(a=0;a[T.minValue,T.maxValue,0,0]);else{const T=cn(r);u=T!=null?T.statistics:null,n=T!=null?T.histograms:null}else u=(M=t.statistics)!=null&&M.length?t.statistics:i.statistics,n="histograms"in t?t.histograms:void 0,n||(n=i.histograms);s!=="percentClip"&&s!=="histogramEqualization"||n!=null&&n.length||(s="minMax");const l=(u==null?void 0:u.length)||(n==null?void 0:n.length)||i.bandCount,a=[],h=[];let p,f,m,g,v,d,y,w,C;u&&!Array.isArray(u[0])&&(u=u.map(T=>[T.min,T.max,T.avg,T.stddev]));const[b,x]=Xt(i.pixelType);if(!(u!=null&&u.length)){for(u=[],w=0;wI[1]&&(h[w]=I[1])}}break;case"histogramEqualization":for(qt(n),w=0;w=20&&(g[0]=g[1]=g[2]=g[g.length-1]=g[g.length-2]=0),m=0,f=(p.max-p.min)/p.size,y=p.min===-.5&&f===1?.5:0,C=0;Cd){a[w]=p.min+f*(C+y);break}for(d=(1-(t.maxPercent||0)/100)*m,h[w]=p.max+y,C=p.size-2;C>=0;C--)if(v[C]Tr(T)))):(S=t.max||255,k=t.min||0),un({minCutOff:a,maxCutOff:h,outMax:S,outMin:k,histogramLut:A},o)}function un(t,e){if(e==null||e.length===0)return t;const r=Math.max.apply(null,e),{minCutOff:o,maxCutOff:c,outMin:i,outMax:u,histogramLut:n}=t;return o.length===e.length||o.length<=r?t:{minCutOff:e.map(s=>o[s]),maxCutOff:e.map(s=>c[s]),histogramLut:n?e.map(s=>n[s]):null,outMin:i,outMax:u}}function Ir(t,e){const r=new Float32Array(t);for(let o=0;o1?e[o]>2?r[o]=6.5+(e[o]-2)**2.5:r[o]=6.5+100*(2-e[o])**4:r[o]=1;return r}function le(t,e){var k;if(!((k=t==null?void 0:t.pixels)!=null&&k.length))return t;const{mask:r,bandMasks:o,width:c,height:i,pixels:u}=t,{minCutOff:n,maxCutOff:s,gamma:l}=e,a=e.outMin||0,h=e.outMax||255,p=c*i,f=e.outputPixelType||"u8",m=t.pixels.map(()=>H.createEmptyBand(f,p)),g=m.length,v=h-a,d=[],y=[];for(let S=0;S=g,b=!!e.isRenderer;if(C){const S=Ir(g,l);for(let A=0;A1&&(L-=(1/v)**(P*S[A])),In[A]){const E=L*v*P**(1/l[A])+a;m[A][T]=b?Math.floor(E):w?Math.round(E):E}else I>=s[A]?m[A][T]=h:m[A][T]=a}}}else for(let S=0;Sn[S]){const I=(T-n[S])*d[S]+a;m[S][M]=b?Math.floor(I):w?Math.round(I):I}else T>=s[S]?m[S][M]=h:m[S][M]=a}}const x=new H({width:c,height:i,mask:r,bandMasks:o,pixels:m,pixelType:f});return x.updateStatistics(),x}const st=1,Rt=1/111e3;function Mr(t){let{altitude:e,azimuth:r}=t;const{hillshadeType:o,pixelSizePower:c=1,pixelSizeFactor:i=1,scalingType:u,isGCS:n,resolution:s}=t,l=o==="multi-directional"?2*t.zFactor:t.zFactor,{x:a,y:h}=s;let p=l/(8*a),f=l/(8*h);if(n&&l>.001&&(p/=Rt,f/=Rt),u==="adjusted")if(n){const I=a*Rt,P=h*Rt;p=(l+I**c*i)/(8*I),f=(l+P**c*i)/(8*P)}else p=(l+a**c*i)/(8*a),f=(l+h**c*i)/(8*h);let m=(90-e)*Math.PI/180,g=Math.cos(m),v=(360-r+90)*Math.PI/180,d=Math.sin(m)*Math.cos(v),y=Math.sin(m)*Math.sin(v);const w=[315,270,225,360,180,0],C=[60,60,60,60,60,90],b=new Float32Array([3,5,3,2,1,4]),x=b.reduce((I,P)=>I+P),k=b.map(I=>I/x),S=o==="multi-directional"?w.length:1,A=new Float32Array(6),M=new Float32Array(6),T=new Float32Array(6);if(o==="multi-directional")for(let I=0;Im?m:v],w=u[g],C=w*y,b=C*(1-Math.abs(d%2-1)),x=w-C;switch(Math.floor(d)){case 0:h[g]=C+x,p[g]=b+x,f[g]=x;break;case 1:h[g]=b+x,p[g]=C+x,f[g]=x;break;case 2:h[g]=x,p[g]=C+x,f[g]=b+x;break;case 3:h[g]=x,p[g]=b+x,f[g]=C+x;break;case 4:h[g]=b+x,p[g]=x,f[g]=C+x;break;case 5:case 6:h[g]=C+x,p[g]=x,f[g]=b+x}}t.pixels=[h,p,f],t.updateStatistics()}function Zn(t,e){if(!Q(t))return t;const r=e.zFactor,o=e.pixelSizePower??1,c=e.pixelSizeFactor??1,i=e.slopeType,u=e.isGCS,{x:n,y:s}=e.resolution;let l=r/(8*n),a=r/(8*s);u&&Math.abs(r-1)<1e-4&&(l/=Rt,a/=Rt),i==="adjusted"&&(l=(r+n**o*c)/(8*n),a=(r+s**o*c)/(8*s));const{dzxs:h,dzys:p,outMask:f}=te(t),{width:m,height:g}=t,v=new Float32Array(m*g);for(let y=st;y360&&(d%=360)),a[p+f]=d}}}return ee(a,s,l),new H({width:s,height:l,pixels:[a],mask:n,pixelType:"f32",validPixelCount:t.validPixelCount,statistics:[{minValue:-1,maxValue:360}]})}function ti(t,e){if(!Q(t))return t;const{curvatures:r,outMask:o}=te(t,e),{width:c,height:i}=t;ee(r,c,i);const u=new H({width:c,height:i,pixels:[r],mask:o,pixelType:"f32",validPixelCount:t.validPixelCount});return u.updateStatistics(),u}let Tt=class extends Ot{constructor(t){super(t)}bind(){const{rendererJSON:t}=this;if(!t)return{success:!1};let e;switch(this.lookup={rendererJSON:{}},t.type){case"uniqueValue":e=this._updateUVRenderer(t);break;case"rasterColormap":e=this._updateColormapRenderer(t);break;case"rasterStretch":e=this._updateStretchRenderer(t);break;case"classBreaks":e=this._updateClassBreaksRenderer(t);break;case"rasterShadedRelief":e=this._updateShadedReliefRenderer(t);break;case"vectorField":e=this._updateVectorFieldRenderer();break;case"flowRenderer":e=this._updateFlowRenderer()}return e}symbolize(t){let e=t==null?void 0:t.pixelBlock;if(!nr(e))return e;if(t.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(e,t.simpleStretchParams);try{let r;switch(e.pixels.length>3&&(e=e.extractBands([0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(e);break;case"classBreaks":r=this._symbolizeClassBreaks(e);break;case"rasterStretch":r=this._symbolizeStretch(e,t.bandIds);break;case"rasterShadedRelief":{const o=t.extent,c=o.spatialReference.isGeographic,i={x:(o.xmax-o.xmin)/e.width,y:(o.ymax-o.ymin)/e.height};r=this._symbolizeShadedRelief(e,{isGCS:c,resolution:i});break}}return r}catch(r){return gt.getLogger(this).error("symbolize",r.message),e}}simpleStretch(t,e){if(!nr(t))return t;try{return t.pixels.length>3&&(t=t.extractBands([0,1,2])),le(t,{...e,isRenderer:!0})}catch(r){return gt.getLogger(this).error("symbolize",r.message),t}}generateWebGLParameters(t){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:u,offset:n}=this.lookup.colormapLut||{};return{colormap:u,colormapOffset:n,type:"lut"}}const{pixelBlock:e,isGCS:r,resolution:o,bandIds:c}=t,{rendererJSON:i}=this;return i.type==="rasterStretch"?this._generateStretchWebGLParams(e,i,c):i.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(i,r,o??void 0):i.type==="vectorField"?this._generateVectorFieldWebGLParams(i):null}_isLUTChanged(t){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const e=this.rendererJSON.colorRamp;return t?JSON.stringify(e)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(t){return this._isLUTChanged()&&!this.bind().success?t:re(t,this.lookup.colormapLut)}_symbolizeClassBreaks(t){const{canUseIndexedLUT:e}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?t:e?re(t,this.lookup.colormapLut):Qr(t,this.lookup.remapLut??[])}_symbolizeStretch(t,e){var h,p;const{rasterInfo:r}=this,{pixelType:o,bandCount:c}=r,i=this.rendererJSON,u=["u8","u16","s8","s16"].includes(o);let n,s;const{dra:l}=i,{gamma:a}=this.lookup;if(i.stretchType==="histogramEqualization"){const f=l?null:(h=this.lookup)==null?void 0:h.histogramLut,m=Ft(i,{rasterInfo:r,pixelBlock:t,bandIds:e,returnHistogramLut:!f}),g=le(t,{...m,gamma:a,isRenderer:!0});s=Ve(g,{lut:l?m.histogramLut:f,offset:0})}else if(u){if(l){const f=Ft(i,{rasterInfo:r,pixelBlock:t,bandIds:e});n=or({pixelType:o,...f,gamma:a,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return t;n=this.lookup?this.lookup.stretchLut:null}else n=this.lookup?this.lookup.stretchLut:null;if(!n)return t;c>1&&e!=null&&e.length===(t==null?void 0:t.pixels.length)&&(n==null?void 0:n.lut.length)===c&&(n={lut:e.map(f=>n.lut[f]),offset:n.offset}),s=Ve(t,n)}else{const f=Ft(i,{rasterInfo:r,pixelBlock:t,bandIds:e});s=le(t,{...f,gamma:a,isRenderer:!0})}if(i.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return t;s=re(s,(p=this.lookup)==null?void 0:p.colormapLut)}return s}_symbolizeShadedRelief(t,e){var n;const r=this.rendererJSON,o={...r,...e},c=hn(t,o);if(!r.colorRamp)return c;let i;if(this._isLUTChanged(!0)){if(!this.bind().success)return c;i=this.lookup?this.lookup.hsvMap:null}else i=this.lookup?this.lookup.hsvMap:null;if(!i)return c;const u=((n=this.rasterInfo.statistics)==null?void 0:n[0])??{min:0,max:8e3};return fn(c,t,i,u),c}_isVectorFieldData(){const{bandCount:t,dataType:e}=this.rasterInfo;return t===2&&(e==="vector-magdir"||e==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(t){var l;const{bandCount:e,attributeTable:r,pixelType:o}=this.rasterInfo,c=t.field1;if(!c)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const i=t.defaultSymbol,u=e===1&&["u8","s8"].includes(o);if(!tn(this.rasterInfo,c)&&!u)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const n=[];if(r!=null){const a=r.fields.find(h=>h.name.toLowerCase()==="value");if(!a)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(h=>{var m,g;const p=(m=t.uniqueValueInfos)==null?void 0:m.find(v=>String(v.value)===String(h.attributes[c])),f=(g=p==null?void 0:p.symbol)==null?void 0:g.color;f?n.push([h.attributes[a.name]].concat(f)):i&&n.push([h.attributes[a.name]].concat(i.color))})}else{if(c.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=t.uniqueValueInfos)==null||l.forEach(a=>{var p;const h=(p=a==null?void 0:a.symbol)==null?void 0:p.color;h?n.push([parseInt(""+a.value,10)].concat(h)):i&&n.push([parseInt(""+a.value,10)].concat(i==null?void 0:i.color))})}if(n.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Bt({colormap:n});return this.lookup={rendererJSON:t,colormapLut:s},this.canRenderInWebGL=this._isColormapSupportedByWebGL(s==null?void 0:s.indexedColormap),{success:!0}}_updateColormapRenderer(t){if(!rn(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const e=t.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,c)=>o[0]-c[0]);if(!e||e.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Bt({colormap:e});return this.lookup={rendererJSON:t,colormapLut:r},this.canRenderInWebGL=this._isColormapSupportedByWebGL(r==null?void 0:r.indexedColormap),{success:!0}}_updateShadedReliefRenderer(t){if(!en(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(t.colorRamp){const e=Oe(t.colorRamp,{interpolateAlpha:!0}),r=Bt({colormap:e}),o=[],c=r.indexedColormap;for(let i=0;iu.name.toLowerCase()==="value"):null,c=e!=null?e.fields.find(u=>u.name.toLowerCase()===t.field.toLowerCase()):null,i=o!=null&&c!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||i,tableValueField:o,tableBreakField:c}}_updateClassBreaksRenderer(t){const{attributeTable:e}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:c}=this._analyzeClassBreaks(t),i=t.classBreakInfos;if(!(i!=null&&i.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const u=i.sort((h,p)=>h.classMaxValue-p.classMaxValue),n=u[u.length-1];let s=t.minValue;if(!r){const h=[];for(let p=0;pw>d);y&&l.push([v].concat(y.symbol.color))}}else{s=Math.floor(t.minValue);for(let h=0;h0&&t[0].min!=null&&t[0].max!=null}_updateStretchRenderer(t){var a,h;let{stretchType:e,dra:r}=t;if(!(e==="none"||(a=t.statistics)!=null&&a.length||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const o=t.histograms||this.rasterInfo.histograms;!this._isHistogramRequired(t.stretchType)||o!=null&&o.length||r||(e="minMax");const{computeGamma:c,useGamma:i,colorRamp:u}=t;let{gamma:n}=t;if(i&&c&&!(n!=null&&n.length)){const p=(h=t.statistics)!=null&&h.length?t.statistics:this.rasterInfo.statistics;n=sn(this.rasterInfo.pixelType,p)}const s=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(s);if(e==="histogramEqualization"){const p=o.map(f=>Tr(f));this.lookup={rendererJSON:t,histogramLut:p}}else if(l){const p=Ft(t,{rasterInfo:this.rasterInfo}),f=or({pixelType:s,...p,gamma:i?n:null,rounding:"floor"});this.lookup={rendererJSON:t,stretchLut:f}}if(u&&!this._isStretchColorRampNoop(u)){const p=Oe(u,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:t}),this.lookup.colormapLut=Bt({colormap:p}),this.lookup.rendererJSON=t}return this.lookup.gamma=i&&(n!=null&&n.length)?n:null,this.canRenderInWebGL=!0,{success:!0}}_isStretchColorRampNoop(t){return t.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(t.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(t.toColor.join(","))}_generateStretchWebGLParams(t,e,r){var w;let o=null,c=null;const i=(w=this.lookup)==null?void 0:w.colormapLut;e.colorRamp&&i&&(o=i.indexedColormap,c=i.offset),e.stretchType==="histogramEqualization"&&(e={...e,stretchType:"minMax"});const{gamma:u}=this.lookup,n=!!(e.useGamma&&u&&u.some(C=>C!==1)),{minCutOff:s,maxCutOff:l,outMin:a,outMax:h}=Ft(e,{rasterInfo:this.rasterInfo,pixelBlock:t,bandIds:r});let p=0;t!=null&&(p=t.getPlaneCount(),p===2&&((t=t.clone()).statistics=[t.statistics[0]],t.pixels=[t.pixels[0]]));const{bandCount:f}=this.rasterInfo,m=Math.min(3,(r==null?void 0:r.length)||p||f,f),g=new Float32Array(m),v=o||n?1:255;let d;for(d=0;d1?u[d]>2?y[d]=6.5+(u[d]-2)**2.5:y[d]=6.5+100*(2-u[d])**4:y[d]=1;return{bandCount:m,outMin:a/v,outMax:h/v,minCutOff:s,maxCutOff:l,factor:g,useGamma:n,gamma:n?u:[1,1,1],gammaCorrection:n?y:[1,1,1],colormap:o,colormapOffset:c,stretchType:e.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(t,e=!1,r={x:0,y:0}){var l,a;let o=null,c=null;const i=(l=this.lookup)==null?void 0:l.colormapLut;t.colorRamp&&i&&(o=i.indexedColormap,c=i.offset);const u={...t,isGCS:e,resolution:r},n=Mr(u),s=(a=this.rasterInfo.statistics)==null?void 0:a[0];return{...n,minValue:(s==null?void 0:s.min)??0,maxValue:(s==null?void 0:s.max)??8e3,hillshadeType:t.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:c}}_generateVectorFieldWebGLParams(t){var d,y,w;const{style:e,inputUnit:r,outputUnit:o,visualVariables:c,symbolTileSize:i,flowRepresentation:u}=t;let n;const s=((d=this.rasterInfo.statistics)==null?void 0:d[0].min)??0,l=((y=this.rasterInfo.statistics)==null?void 0:y[0].max)??50,a=(c==null?void 0:c.find(C=>C.type==="sizeInfo"))??{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*i,minDataValue:s,minSize:.2*i},h=a.minDataValue??s,p=a.maxDataValue??l,f=a.maxSize!=null&&a.minSize!=null?[a.minSize/i,a.maxSize/i]:[.2,.8];if(e==="wind_speed"){const C=(f[0]+f[1])/2;f[0]=f[1]=C}const m=h!=null&&p!=null?[h,p]:null;if(e==="classified_arrow")if(h!=null&&p!=null&&a!=null){n=[];const C=(a.maxDataValue-a.minDataValue)/5;for(let b=0;b<6;b++)n.push(a.minDataValue+C*b)}else n=[0,1e-6,3.5,7,10.5,14];const g=u==="flow_to"==(e==="ocean_current_kn"||e==="ocean_current_m")?0:Math.PI,v=c==null?void 0:c.find(C=>C.type==="rotationInfo");return{breakValues:n,dataRange:m,inputUnit:r,outputUnit:o,symbolTileSize:i,symbolPercentRange:f,style:e||"single_arrow",rotation:g,rotationType:(w=this.rasterInfo.storageInfo)!=null&&w.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":(v==null?void 0:v.rotationType)||t.rotationType,type:"vectorField"}}};function nr(t){return Q(t)&&t.validPixelCount!==0}O([N({json:{write:!0}})],Tt.prototype,"rendererJSON",void 0),O([N({type:co,json:{write:!0}})],Tt.prototype,"rasterInfo",void 0),O([N({json:{write:!0}})],Tt.prototype,"lookup",void 0),O([N()],Tt.prototype,"canRenderInWebGL",void 0),Tt=O([Dt("esri.renderers.support.RasterSymbolizer")],Tt);const ei=Tt,Pt=gt.getLogger("esri.views.2d.engine.flow.dataUtils"),pn=10;async function ri(t,e,r,o){const c=performance.now(),i=dn(e,r),u=performance.now(),n=gn(e,i,r.width,r.height),s=performance.now(),l=wn(n,!0),a=performance.now(),h=t==="Streamlines"?Cn(l,pn):bn(l),p=performance.now();return Vr("esri-2d-profiler")&&(Pt.info("I.1","_createFlowFieldFromData (ms)",Math.round(u-c)),Pt.info("I.2","_getStreamlines (ms)",Math.round(s-u)),Pt.info("I.3","createAnimatedLinesData (ms)",Math.round(a-s)),Pt.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-a)),Pt.info("I.5","createFlowMesh (ms)",Math.round(p-c)),Pt.info("I.6","Mesh size (bytes)",h.vertexData.buffer.byteLength+h.indexData.buffer.byteLength)),await Promise.resolve(),_r(o),h}function dn(t,e){const r=yn(e.data,e.width,e.height,t.smoothing);return t.interpolate?(o,c)=>{const i=Math.floor(o),u=Math.floor(c);if(i<0||i>=e.width)return[0,0];if(u<0||u>=e.height)return[0,0];const n=o-i,s=c-u,l=i,a=u,h=i{const i=Math.round(o),u=Math.round(c);return i<0||i>=e.width||u<0||u>=e.height?[0,0]:[r[2*(u*e.width+i)],r[2*(u*e.width+i)+1]]}}function mn(t,e,r,o,c,i,u,n,s){const l=[];let a=r,h=o,p=0,[f,m]=e(a,h);f*=t.velocityScale,m*=t.velocityScale;const g=Math.sqrt(f*f+m*m);let v,d;l.push({x:a,y:h,t:p,speed:g});for(let y=0;yt.maxTurnAngle)return l;if(t.collisions){const S=Math.round(a*s),A=Math.round(h*s);if(S<0||S>u-1||A<0||A>n-1)return l;const M=i[A*u+S];if(M!==-1&&M!==c)return l;i[A*u+S]=c}l.push({x:a,y:h,t:p,speed:b}),v=x,d=k}return l}function gn(t,e,r,o){const c=[],i=new sr,u=1/Math.max(t.lineCollisionWidth,1),n=Math.round(r*u),s=Math.round(o*u),l=new Int32Array(n*s);for(let h=0;hh.sort-p.sort);for(const{x:h,y:p}of a)if(i.getFloat()=e)continue;const m=i[f+c];h+=m*t[2*(l*e+(a+f))],p+=m*t[2*(l*e+(a+f))+1]}n[2*(l*e+a)]=h,n[2*(l*e+a)+1]=p}const s=new Float32Array(t.length);for(let l=0;l=r)continue;const m=i[f+c];h+=m*n[2*((a+f)*e+l)],p+=m*n[2*((a+f)*e+l)+1]}s[2*(a*e+l)]=h,s[2*(a*e+l)+1]=p}return s}function wn(t,e){const r=new sr,o=t.reduce((s,l)=>s+l.length,0),c=new Float32Array(4*o),i=new Array(t.length);let u=0,n=0;for(const s of t){const l=u;for(const a of s)c[4*u]=a.x,c[4*u+1]=a.y,c[4*u+2]=a.t,c[4*u+3]=a.speed,u++;i[n++]={startVertex:l,numberOfVertices:s.length,totalTime:s[s.length-1].t,timeSeed:e?r.getFloat():0}}return{lineVertices:c,lineDescriptors:i}}function Cn(t,e){const{lineVertices:o,lineDescriptors:c}=t;let i=0,u=0;for(const f of c)i+=2*f.numberOfVertices,u+=6*(f.numberOfVertices-1);const n=new Float32Array(i*9),s=new Uint32Array(u);let l=0,a=0;function h(){s[a++]=l-2,s[a++]=l,s[a++]=l-1,s[a++]=l,s[a++]=l+1,s[a++]=l-1}function p(f,m,g,v,d,y,w,C){const b=l*9;let x=0;n[b+x++]=f,n[b+x++]=m,n[b+x++]=1,n[b+x++]=g,n[b+x++]=y,n[b+x++]=w,n[b+x++]=v/2,n[b+x++]=d/2,n[b+x++]=C,l++,n[b+x++]=f,n[b+x++]=m,n[b+x++]=-1,n[b+x++]=g,n[b+x++]=y,n[b+x++]=w,n[b+x++]=-v/2,n[b+x++]=-d/2,n[b+x++]=C,l++}for(const f of c){const{totalTime:m,timeSeed:g}=f;let v=null,d=null,y=null,w=null,C=null,b=null;for(let x=0;x0){T=k-v,I=S-d;const E=Math.sqrt(T*T+I*I);if(T/=E,I/=E,x>1){let U=T+C,R=I+b;const B=Math.sqrt(U*U+R*R);U/=B,R/=B;const G=Math.min(1/(U*T+R*I),e);U*=G,R*=G,P=-R,L=U}else P=-I,L=T;P!==null&&L!==null&&(p(v,d,y,P,L,m,g,M),h())}v=k,d=S,y=A,C=T,b=I,w=M}p(v,d,y,-b,C,m,g,w)}return{vertexData:n,indexData:s}}function bn(t){const{lineVertices:c,lineDescriptors:i}=t;let u=0,n=0;for(const E of i){const U=E.numberOfVertices-1;u+=4*U*2,n+=6*U*2}const s=new Float32Array(u*16),l=new Uint32Array(n);let a,h,p,f,m,g,v,d,y,w,C,b,x,k,S=0,A=0;function M(){l[A++]=S-8,l[A++]=S-7,l[A++]=S-6,l[A++]=S-7,l[A++]=S-5,l[A++]=S-6,l[A++]=S-4,l[A++]=S-3,l[A++]=S-2,l[A++]=S-3,l[A++]=S-1,l[A++]=S-2}function T(E,U,R,B,G,D,j,F,V,_,X,tt,wt,Ct){const J=S*16;let q=0;for(const ht of[1,2])for(const dt of[1,2,3,4])s[J+q++]=E,s[J+q++]=U,s[J+q++]=R,s[J+q++]=B,s[J+q++]=j,s[J+q++]=F,s[J+q++]=V,s[J+q++]=_,s[J+q++]=ht,s[J+q++]=dt,s[J+q++]=wt,s[J+q++]=Ct,s[J+q++]=G/2,s[J+q++]=D/2,s[J+q++]=X/2,s[J+q++]=tt/2,S++}function I(E,U){let R=y+C,B=w+b;const G=Math.sqrt(R*R+B*B);R/=G,B/=G;const D=y*R+w*B;R/=D,B/=D;let j=C+x,F=b+k;const V=Math.sqrt(j*j+F*F);j/=V,F/=V;const _=C*j+b*F;j/=_,F/=_,T(a,h,p,f,-B,R,m,g,v,d,-F,j,E,U),M()}function P(E,U,R,B,G,D){if(y=C,w=b,C=x,b=k,y==null&&w==null&&(y=C,w=b),m!=null&&g!=null){x=E-m,k=U-g;const j=Math.sqrt(x*x+k*k);x/=j,k/=j}y!=null&&w!=null&&I(G,D),a=m,h=g,p=v,f=d,m=E,g=U,v=R,d=B}function L(E,U){y=C,w=b,C=x,b=k,y==null&&w==null&&(y=C,w=b),y!=null&&w!=null&&I(E,U)}for(const E of i){a=null,h=null,p=null,f=null,m=null,g=null,v=null,d=null,y=null,w=null,C=null,b=null,x=null,k=null;const{totalTime:U,timeSeed:R}=E;for(let B=0;B __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/date-be_IQzZd.js b/dist/assets/date-be_IQzZd.js new file mode 100644 index 0000000..6f35666 --- /dev/null +++ b/dist/assets/date-be_IQzZd.js @@ -0,0 +1 @@ +function p(t){return d(t)!=null||c(t)!=null}function C(t){return g.test(t)}function D(t){return d(t)??c(t)}function c(t){const n=new Date(t);return T(n,t)?Number.isNaN(n.getTime())?null:n.getTime()-6e4*n.getTimezoneOffset():null}function d(t){const n=g.exec(t);if(!(n!=null&&n.groups))return null;const e=n.groups,u=+e.year,r=+e.month-1,s=+e.day,i=+(e.hours??"0"),f=+(e.minutes??"0"),l=+(e.seconds??"0");if(i>23||f>59||l>59)return null;const m=e.ms??"0",a=m?+m.padEnd(3,"0").substring(0,3):0;let o;if(e.isUTC||!e.offsetSign)o=Date.UTC(u,r,s,i,f,l,a);else{const N=+e.offsetHours,b=+e.offsetMinutes;o=6e4*(e.offsetSign==="+"?-1:1)*(60*N+b)+Date.UTC(u,r,s,i,f,l,a)}return Number.isNaN(o)?null:o}const g=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/;function T(t,n){if(Number.isNaN(t.getTime()))return!1;let e=!0;if(h&&/\d+\W*$/.test(n)){const u=n.match(/[a-zA-Z]{2,}/);if(u){let r=!1,s=0;for(;!r&&s<=u.length;)r=!y.test(u[s]),s++;e=!r}}return e}const y=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,h=!Number.isNaN(new Date("technology 10").getTime());export{p as e,D as n,C as t}; diff --git a/dist/assets/de_CH-V5QttSa-.js b/dist/assets/de_CH-V5QttSa-.js new file mode 100644 index 0000000..f522391 --- /dev/null +++ b/dist/assets/de_CH-V5QttSa-.js @@ -0,0 +1 @@ +const r={_decimalSeparator:".",_thousandSeparator:"'",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"K",_big_number_suffix_6:"Mio",_big_number_suffix_9:"Mrd",_big_number_suffix_12:"Bio",_big_number_suffix_15:"Brd",_big_number_suffix_18:"Trill",_big_number_suffix_21:"Trd",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd. MMM, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd. MMM, yyyy",_date_day:"dd. MMM",_date_day_full:"dd. MMM, yyyy",_date_week:"ww",_date_week_full:"dd. MMM, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"v. Chr.",_era_bc:"n. Chr.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",Jan:"Jan.",Feb:"Febr.",Mar:"März",Apr:"Apr.","May(short)":"Mai",Jun:"Juni",Jul:"Juli",Aug:"Aug.",Sep:"Sept.",Oct:"Okt.",Nov:"Nov.",Dec:"Dez.",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",Sun:"So.",Mon:"Mo.",Tue:"Di.",Wed:"Mi.",Thu:"Do.",Fri:"Fr.",Sat:"Sa.",_dateOrd:function(e){return e+"."},"Zoom Out":"Herauszoomen",Play:"Abspielen",Stop:"Stop",Legend:"Legende","Press ENTER to toggle":"Klicken, tippen oder ENTER drücken zum Umschalten",Loading:"Wird geladen",Home:"Home",Chart:"Diagramm","Serial chart":"Seriendiagramm","X/Y chart":"X-Y-Diagramm","Pie chart":"Kreisdiagramm","Gauge chart":"Messdiagramm","Radar chart":"Netzdiagramm","Sankey diagram":"Sankey-Diagramm","Chord diagram":"","Flow diagram":"Flussdiagramm","TreeMap chart":"Baumdiagramm",Series:"Serie","Candlestick Series":"Kerzendiagramm","Column Series":"Balkendiagramm","Line Series":"Liniendiagramm","Pie Slice Series":"Kreisdiagramm","X/Y Series":"Punktdiagramm",Map:"Karte","Press ENTER to zoom in":"Drücke ENTER zum Hereinzoomen","Press ENTER to zoom out":"Drücke ENTER zum Herauszoomen","Use arrow keys to zoom in and out":"Benutze die Pfeiltasten zum Zoomen","Use plus and minus keys on your keyboard to zoom in and out":"Benutze Plus- und Minustasten zum Zoomen",Export:"Export",Image:"Bild",Data:"Daten",Print:"Drucken","Press ENTER to open":"Zum Öffnen klicken, tippen oder ENTER drücken","Press ENTER to print.":"Zum Drucken klicken, tippen oder ENTER drücken.","Press ENTER to export as %1.":"Klicken, tippen oder ENTER drücken um als %1 zu exportieren","(Press ESC to close this message)":"ESC drücken um diese Nachricht zu schließen","Image Export Complete":"Bildexport komplett","Export operation took longer than expected. Something might have gone wrong.":"Der Export dauert länger als geplant. Vielleicht ist etwas schiefgelaufen.","Saved from":"Gespeichert von",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder linke und rechte Pfeiltaste um die Auswahl zu ändern","Use left and right arrows to move selection":"Linke und rechte Pfeiltaste nutzen um die Auswahl zu verschieben","Use left and right arrows to move left selection":"Linke und rechte Pfeiltaste nutzen um die linke Auswahl zu verschieben","Use left and right arrows to move right selection":"Linke und rechte Pfeiltaste nutzen um die rechte Auswahl zu verschieben","Use TAB select grip buttons or up and down arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder Pfeiltaste nach oben und unten drücken, um die Auswahl zu ändern","Use up and down arrows to move selection":"Pfeiltaste nach oben und unten drücken, um die Auswahl zu verschieben","Use up and down arrows to move lower selection":"Pfeiltaste nach oben und unten drücken, um die untere Auswahl zu verschieben","Use up and down arrows to move upper selection":"Pfeiltaste nach oben und unten drücken, um die obere Auswahl zu verschieben","From %1 to %2":"Von %1 bis %2","From %1":"Von %1","To %1":"Bis %1","No parser available for file: %1":"Kein Parser für Datei %1 verfügbar","Error parsing file: %1":"Fehler beim Parsen von Datei %1","Unable to load file: %1":"Datei %1 konnte nicht geladen werden","Invalid date":"Kein Datum"};export{r as default}; diff --git a/dist/assets/de_DE-Fwy8dxxc.js b/dist/assets/de_DE-Fwy8dxxc.js new file mode 100644 index 0000000..1ba2cec --- /dev/null +++ b/dist/assets/de_DE-Fwy8dxxc.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"K",_big_number_suffix_6:"Mio",_big_number_suffix_9:"Mrd",_big_number_suffix_12:"Bio",_big_number_suffix_15:"Brd",_big_number_suffix_18:"Trill",_big_number_suffix_21:"Trd",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd. MMM, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd. MMM, yyyy",_date_day:"dd. MMM",_date_day_full:"dd. MMM, yyyy",_date_week:"ww",_date_week_full:"dd. MMM, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"v. Chr.",_era_bc:"n. Chr.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Januar",February:"Februar",March:"März",April:"April",May:"Mai",June:"Juni",July:"Juli",August:"August",September:"September",October:"Oktober",November:"November",December:"Dezember",Jan:"Jan.",Feb:"Febr.",Mar:"März",Apr:"Apr.","May(short)":"Mai",Jun:"Juni",Jul:"Juli",Aug:"Aug.",Sep:"Sept.",Oct:"Okt.",Nov:"Nov.",Dec:"Dez.",Sunday:"Sonntag",Monday:"Montag",Tuesday:"Dienstag",Wednesday:"Mittwoch",Thursday:"Donnerstag",Friday:"Freitag",Saturday:"Samstag",Sun:"So.",Mon:"Mo.",Tue:"Di.",Wed:"Mi.",Thu:"Do.",Fri:"Fr.",Sat:"Sa.",_dateOrd:function(e){return e+"."},"Zoom Out":"Herauszoomen",Play:"Abspielen",Stop:"Stop",Legend:"Legende","Press ENTER to toggle":"Klicken, tippen oder ENTER drücken zum Umschalten",Loading:"Wird geladen",Home:"Home",Chart:"Diagramm","Serial chart":"Seriendiagramm","X/Y chart":"X-Y-Diagramm","Pie chart":"Kreisdiagramm","Gauge chart":"Messdiagramm","Radar chart":"Netzdiagramm","Sankey diagram":"Sankey-Diagramm","Chord diagram":"","Flow diagram":"Flussdiagramm","TreeMap chart":"Baumdiagramm",Series:"Serie","Candlestick Series":"Kerzendiagramm","Column Series":"Balkendiagramm","Line Series":"Liniendiagramm","Pie Slice Series":"Kreisdiagramm","X/Y Series":"Punktdiagramm",Map:"Karte","Press ENTER to zoom in":"Drücke ENTER zum Hereinzoomen","Press ENTER to zoom out":"Drücke ENTER zum Herauszoomen","Use arrow keys to zoom in and out":"Benutze die Pfeiltasten zum Zoomen","Use plus and minus keys on your keyboard to zoom in and out":"Benutze Plus- und Minustasten zum Zoomen",Export:"Export",Image:"Bild",Data:"Daten",Print:"Drucken","Press ENTER to open":"Zum Öffnen klicken, tippen oder ENTER drücken","Press ENTER to print.":"Zum Drucken klicken, tippen oder ENTER drücken.","Press ENTER to export as %1.":"Klicken, tippen oder ENTER drücken um als %1 zu exportieren","(Press ESC to close this message)":"ESC drücken um diese Nachricht zu schließen","Image Export Complete":"Bildexport komplett","Export operation took longer than expected. Something might have gone wrong.":"Der Export dauert länger als geplant. Vielleicht ist etwas schiefgelaufen.","Saved from":"Gespeichert von",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder linke und rechte Pfeiltaste um die Auswahl zu ändern","Use left and right arrows to move selection":"Linke und rechte Pfeiltaste nutzen um die Auswahl zu verschieben","Use left and right arrows to move left selection":"Linke und rechte Pfeiltaste nutzen um die linke Auswahl zu verschieben","Use left and right arrows to move right selection":"Linke und rechte Pfeiltaste nutzen um die rechte Auswahl zu verschieben","Use TAB select grip buttons or up and down arrows to change selection":"TAB nutzen, um Ankerpunkte auszuwählen oder Pfeiltaste nach oben und unten drücken, um die Auswahl zu ändern","Use up and down arrows to move selection":"Pfeiltaste nach oben und unten drücken, um die Auswahl zu verschieben","Use up and down arrows to move lower selection":"Pfeiltaste nach oben und unten drücken, um die untere Auswahl zu verschieben","Use up and down arrows to move upper selection":"Pfeiltaste nach oben und unten drücken, um die obere Auswahl zu verschieben","From %1 to %2":"Von %1 bis %2","From %1":"Von %1","To %1":"Bis %1","No parser available for file: %1":"Kein Parser für Datei %1 verfügbar","Error parsing file: %1":"Fehler beim Parsen von Datei %1","Unable to load file: %1":"Datei %1 konnte nicht geladen werden","Invalid date":"Kein Datum"};export{r as default}; diff --git a/dist/assets/debounce-HnHf1UOZ.js b/dist/assets/debounce-HnHf1UOZ.js new file mode 100644 index 0000000..4096e8a --- /dev/null +++ b/dist/assets/debounce-HnHf1UOZ.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */var M=typeof global=="object"&&global&&global.Object===Object&&global,R=typeof self=="object"&&self&&self.Object===Object&&self,W=M||R||Function("return this")(),T=W.Symbol,L=Object.prototype,B=L.hasOwnProperty,F=L.toString,g=T?T.toStringTag:void 0;function w(e){var n=B.call(e,g),i=e[g];try{e[g]=void 0;var a=!0}catch{}var f=F.call(e);return a&&(n?e[g]=i:delete e[g]),f}var G=Object.prototype,U=G.toString;function _(e){return U.call(e)}var D="[object Null]",H="[object Undefined]",E=T?T.toStringTag:void 0;function X(e){return e==null?e===void 0?H:D:E&&E in Object(e)?w(e):_(e)}function q(e){return e!=null&&typeof e=="object"}var z="[object Symbol]";function J(e){return typeof e=="symbol"||q(e)&&X(e)==z}var K=/\s/;function Q(e){for(var n=e.length;n--&&K.test(e.charAt(n)););return n}var V=/^\s+/;function Y(e){return e&&e.slice(0,Q(e)+1).replace(V,"")}function O(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var k=NaN,Z=/^[-+]0x[0-9a-f]+$/i,ee=/^0b[01]+$/i,ne=/^0o[0-7]+$/i,te=parseInt;function $(e){if(typeof e=="number")return e;if(J(e))return k;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=Y(e);var i=ee.test(e);return i||ne.test(e)?te(e.slice(2),i?2:8):Z.test(e)?k:+e}var S=function(){return W.Date.now()},re="Expected a function",ie=Math.max,ae=Math.min;function oe(e,n,i){var a,f,s,u,r,c,d=0,v=!1,l=!1,y=!0;if(typeof e!="function")throw new TypeError(re);n=$(n)||0,O(i)&&(v=!!i.leading,l="maxWait"in i,s=l?ie($(i.maxWait)||0,n):s,y="trailing"in i?!!i.trailing:y);function j(t){var o=a,b=f;return a=f=void 0,d=t,u=e.apply(b,o),u}function N(t){return d=t,r=setTimeout(m,n),v?j(t):u}function P(t){var o=t-c,b=t-d,I=n-o;return l?ae(I,s-b):I}function h(t){var o=t-c,b=t-d;return c===void 0||o>=n||o<0||l&&b>=s}function m(){var t=S();if(h(t))return x(t);r=setTimeout(m,P(t))}function x(t){return r=void 0,y&&a?j(t):(a=f=void 0,u)}function A(){r!==void 0&&clearTimeout(r),d=0,a=c=f=r=void 0}function C(){return r===void 0?u:x(S())}function p(){var t=S(),o=h(t);if(a=arguments,f=this,c=t,o){if(r===void 0)return N(c);if(l)return clearTimeout(r),r=setTimeout(m,n),j(c)}return r===void 0&&(r=setTimeout(m,n)),u}return p.cancel=A,p.flush=C,p}export{T as S,J as a,X as b,O as c,oe as d,M as f,q as i,W as r}; diff --git a/dist/assets/definitions-DqQMJYPH.js b/dist/assets/definitions-DqQMJYPH.js new file mode 100644 index 0000000..8078fe6 --- /dev/null +++ b/dist/assets/definitions-DqQMJYPH.js @@ -0,0 +1 @@ +import{dJ as a}from"./index-J0iiHjMT.js";const r=1e-30,t=4294967295,o=512,c=128,d=511,f=29,m=24,n=8,p=1,x=2,h=3,i=2,k=1,l=1.05;a("featurelayer-force-marker-text-draw-order");const u=5,w=6,y=1.15,e=2,b=128-2*e,g=8,j=500,v=10,q=1024,z=2,A=0,B=1,C=4,J=8,Q=16,R=4,S=1,V=4,W=8,$=32,D=64;export{l as $,$ as A,D as B,q as C,p as Q,x as R,h as S,i as V,k as W,r as a,m as b,o as c,g as d,u as e,j as f,e as g,b as h,C as i,t as j,S as k,A as l,v as m,B as n,R as o,z as p,n as q,w as r,Q as s,y as t,V as u,W as v,f as w,J as x,d as y,c as z}; diff --git a/dist/assets/dehydratedFeatureComparison-hdPq-zad.js b/dist/assets/dehydratedFeatureComparison-hdPq-zad.js new file mode 100644 index 0000000..2b394ff --- /dev/null +++ b/dist/assets/dehydratedFeatureComparison-hdPq-zad.js @@ -0,0 +1 @@ +import{al as u}from"./index-J0iiHjMT.js";function l(e,r){if(e===r)return!0;if(e==null||r==null||e.length!==r.length)return!1;for(let t=0;te)}function Z(n){return C(n,e=>e.plane)}function C(n,e){const t=i(),a=i();let l=!1;return r=>{const o=e(r);if(r.action==="start"){const c=m(r.screenStart,$(x.get())),u=R(n.state.camera,c,T);u!=null&&(l=g(o,u,t))}if(!l)return null;const s=m(r.screenEnd,$(x.get())),d=R(n.state.camera,s,T);return d==null?null:g(o,d,a)?{...r,renderStart:t,renderEnd:a,plane:o,ray:d}:null}}function _(n,e,t=0,a=null,l=null){let r=null;return o=>{if(o.action==="start"&&(r=n.sceneIntersectionHelper.intersectElevationFromScreen(E(o.screenStart.x,o.screenStart.y),e,t,l),r!=null&&a!=null&&!I(r,r,a))||r==null)return null;const s=n.sceneIntersectionHelper.intersectElevationFromScreen(E(o.screenEnd.x,o.screenEnd.y),e,t,l);return s!=null&&(a==null||I(s,s,a))?{...o,mapStart:r,mapEnd:s}:null}}function z(n,e,t,a=null,l=null){return _(n,t,N(e,n,t),a,l)}function J(n,e,t,a=null,l=null){return z(n,t,b(e),a,l)}function j(n,e,t,a){const l=e.toMap(n.screenStart,{include:[t]});return l!=null?J(e,t,l,a):null}function K(n,e){const t=V,a=W,l=w();n.renderCoordsHelper.worldUpAtPosition(e,t);const r=U(l,t,S(a,e,n.state.camera.eye));return U(r,r,t),D(e,r,l)}function nn(n,e,t){let a=null;const l=new q;return l.next(B(n,K(n,e))).next(L(n,e)).next(Q(n,t)).next(r=>{r.mapEnd.x=r.mapStart.x,r.mapEnd.y=r.mapStart.y,a=r}),r=>(a=null,l.execute(r),a)}function L(n,e){const t=i(),a=y(e);n.renderCoordsHelper.worldUpAtPosition(e,t);const l=i(),r=i(),o=s=>(S(s,s,e),G(t,s,s),n.viewingMode==="global"&&y(s)*Math.sign(P(t,s))<.001-a&&S(s,v(s,t,.001),e),A(s,s,e),s);return s=>(s.renderStart=o(H(l,s.renderStart)),s.renderEnd=o(H(r,s.renderEnd)),s)}function Q(n,e){const t=n.renderCoordsHelper;return a=>{const l=t.fromRenderCoords(a.renderStart,e),r=t.fromRenderCoords(a.renderEnd,e);return l!=null&&r!=null?{...a,mapStart:l,mapEnd:r}:null}}var f;function en(n){let e=null;return t=>{switch(t.action){case"start":e=n.disableDisplay();break;case"end":case"cancel":e!=null&&(e.remove(),e=null)}return t}}function tn(n,e=null){const t=h(n.state.viewingMode);t.options.selectionMode=!0,t.options.store=k.MIN,t.options.hud=!1;const a=E(),l={requiresGroundFeedback:!0,enableDraped:!0,exclude:new Set},r=i(),o=e??n.spatialReference,s=c=>{n.map.ground&&n.map.ground.opacity<1?l.exclude.add(O):l.exclude.delete(O),n.sceneIntersectionHelper.intersectIntersectorScreen(m(c,a),t,l);const u=t.results.min;let p;if(u.getIntersectionPoint(r))p=u.intersector===F.TERRAIN?f.GROUND:f.OTHER;else{if(!t.results.ground.getIntersectionPoint(r))return null;p=f.GROUND}return{location:n.renderCoordsHelper.fromRenderCoords(r,o),surfaceType:p}};let d;return c=>{if(c.action==="start"){const p=s(c.screenStart);d=p!=null?p.location:null}if(d==null)return null;const u=s(c.screenEnd);return(u==null?void 0:u.location)!=null?{...c,mapStart:d,mapEnd:u.location,surfaceType:u.surfaceType}:null}}(function(n){n[n.GROUND=0]="GROUND",n[n.OTHER=1]="OTHER"})(f||(f={}));const V=i(),W=i(),T=M();export{en as A,J as D,tn as F,f as G,B as H,j as M,nn as P,z as T,Z as U,Q as k}; diff --git a/dist/assets/drapedUtils-9db1OpTX.js b/dist/assets/drapedUtils-9db1OpTX.js new file mode 100644 index 0000000..cac67ee --- /dev/null +++ b/dist/assets/drapedUtils-9db1OpTX.js @@ -0,0 +1 @@ +import{dT as m,e2 as c}from"./index-J0iiHjMT.js";function u(e,n){return n?"xoffset"in n&&n.xoffset?Math.max(e,Math.abs(n.xoffset)):"yoffset"in n&&n.yoffset?Math.max(e,Math.abs(n.yoffset||0)):e:e}function h(e){let n=0,t=0;for(let r=0;ro.type==="size").map(o=>{const{maxSize:a,minSize:f}=o;return(p(a,e)+p(f,e))/2});let r=0;const s=t.length;if(s===0)return e;for(let o=0;o{a=u(a,f.symbol)}),a}if(n.type==="class-breaks"){let a=s;return n.classBreakInfos.forEach(f=>{a=u(a,f.symbol)}),a}return n.type==="dot-density"||n.type,s}function d(e,n,t,r=new m){let s=0;if(t.type==="2d")s=n*(t.resolution??0);else if(t.type==="3d"){const x=t.overlayPixelSizeInMapUnits(e),l=t.basemapSpatialReference;s=l==null||l.equals(t.spatialReference)?n*x:c(l)/c(t.spatialReference)}const i=e.x-s,o=e.y-s,a=e.x+s,f=e.y+s,{spatialReference:y}=t;return r.xmin=Math.min(i,a),r.ymin=Math.min(o,f),r.xmax=Math.max(i,a),r.ymax=Math.max(o,f),r.spatialReference=y,r}function R(e,n,t){const r=t.toMap(e);return r==null?!1:d(r,b(),t,z).intersects(n)}const z=new m;export{R as i,b as o,d as r}; diff --git a/dist/assets/drawUtils-woTYaREB.js b/dist/assets/drawUtils-woTYaREB.js new file mode 100644 index 0000000..cd660cc --- /dev/null +++ b/dist/assets/drawUtils-woTYaREB.js @@ -0,0 +1 @@ +import{R,ae as k,af as w,ag as F}from"./index-J0iiHjMT.js";function Z(n,a,e,o){if(o==null||n.hasZ||(o=void 0),n.type==="point")return n.x+=a,n.y+=e,n.hasZ&&o!=null&&(n.z+=o),n;if(n.type==="multipoint"){const x=n.points;for(let i=0;ir.xmax){const z=r.xmin,T=r.xmax;r.xmin=T,r.xmax=z}if(r.ymin>r.ymax){const z=r.ymin,T=r.ymax;r.ymin=T,r.ymax=z}return r}const m=R(n),t=k(),[x,i,s,l]=w(t,m),y=o?o[0]:(x+s)/2,c=o?o[1]:(l+i)/2,p=n.clone(),M=p.type==="polyline"?p.paths:p.rings;for(let f=0;f2&&m.push(o??n[2]),n.length>3&&m.push(n[3]),m}export{J as a,H as i,K as m,Z as r,I as s}; diff --git a/dist/assets/editPlaneUtils-4qxd7h1E.js b/dist/assets/editPlaneUtils-4qxd7h1E.js new file mode 100644 index 0000000..a527b88 --- /dev/null +++ b/dist/assets/editPlaneUtils-4qxd7h1E.js @@ -0,0 +1 @@ +import{hq as qt,N as Zt,po as Ct,bI as Qt,fo as Wt,l as Yt,hp as jt,gk as Pt,kF as Kt,e3 as lt,hP as Jt,aa as I,pp as Xt,e2 as Bt,pq as te,pr as ee,T as Rt,as as ot,aq as ie,aC as dt,aU as oe,aF as ne,ps as re,pt as ae,pu as Y,aB as se,aH as le,pv as nt,hx as j,bn as rt,ar as yt,pw as pe,px as ce,cr as gt,nq as at,py as St,pz as ue,pA as he,nw as de,cM as ye,az as ge,pB as fe,pC as ve,cq as me,pD as xe,e as r,y as l,c as V,p as we,p5 as _e,I as w,cp as K,cz as pt,pE as Ut,iC as $e,pF as L,cT as Oe,K as be,no as kt,L as Et,gD as H,Q as Me,d as ft,pG as Te,n as N,pH as Ie,S as Ve,a2 as vt,ns as ze,dA as Ge,A as mt,b1 as Ce,at as Pe,pI as J,pJ as xt,bv as wt,au as _t,pK as $t,nX as Re,hL as E,aL as q,pL as Ot,pM as Se,pN as Ue,a0 as ke,hM as B,hK as bt}from"./index-J0iiHjMT.js";import{g as v,F as Mt}from"./surfaceCoordinateSystems-siQq4eBA.js";import{l as Ee}from"./InteractiveToolBase-WDic4GPF.js";import{i as Dt}from"./measurementUtils-84-ZBArh.js";import{s as A,p as De,d as Fe,a as tt,u as Le}from"./Tooltip-ON77BKb3.js";import{o as Tt}from"./automaticAreaMeasurementUtils-nVd6Y5mX.js";import{t as Ae,a as He,s as Ne,c as qe}from"./EditGeometryOperations-TPE5Wzab.js";function S(t,e){const i=new Rt({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(i.z=t[2]),i}function Ze(t,e){return new qt({points:t,spatialReference:e})}function It(t,e,i){const o=new Zt({paths:t,spatialReference:e});return i&&Ct(o),o}function U(t,e,i,o=!0){const s=Qt(t);s.forEach(a=>{const u=a[0],p=a[a.length-1];Wt(u,p)&&a.length!==1||a.push(a[0])});let n=new Yt({rings:s,spatialReference:e});return n.rings.forEach(a=>{jt(a)||a.reverse()}),i&&Ct(n),o&&n.isSelfIntersecting&&Pt(e)&&(n=Kt(n)),n}function Vt(t,e,i){const o=e.mapToLocalMultiple(t),s=[],n={x:o[0].x,y:o[0].y},a={x:o[1].x,y:o[1].y},u=Math.round(a.x-n.x),p=Math.round(a.y-n.y),h=Math.max(Math.abs(u),Math.abs(p));if(i){const y={x:n.x+h,y:n.y+h},g={x:n.x-h,y:n.y-h};s.push(v(y.x,g.y),v(g.x,g.y),v(g.x,y.y),v(y.x,y.y))}else{const y={x:u>0?n.x+h:n.x-h,y:p>0?n.y+h:n.y-h};s.push(v(n.x,n.y),v(y.x,n.y),v(y.x,y.y),v(n.x,y.y))}return Ft(U([s.map(y=>e.localToMap(y)).filter(lt)],e.spatialReference,e.doUnnormalization,!0),s,e)}function Qe(t,e,i){let o=e.mapToLocalMultiple(t);if(o.length===1){const p=o[0];o=[v(p.x-48,p.y+48),v(p.x+48,p.y-48),v(p.x+48,p.y-48),v(p.x-48,p.y+48)]}const s=[],n={x:o[0].x,y:o[0].y},a={x:o[1].x,y:o[1].y};if(i){const u=Math.round(a.x-n.x),p=Math.round(a.y-n.y);s.push(v(n.x-u,n.y-p),v(a.x,n.y-p),v(a.x,a.y),v(n.x-u,a.y))}else s.push(v(n.x,n.y),v(a.x,n.y),v(a.x,a.y),v(n.x,a.y));return Ft(U([s.map(u=>e.localToMap(u)).filter(lt)],e.spatialReference,e.doUnnormalization,!0),s,e)}function Ft(t,e,i){const o=Z(e[3],e[2],i),s=Z(e[1],e[2],i),n=Z(e[0],e[1],i),a=Z(e[0],e[3],i);return{geometry:t,midpoints:o!=null&&s!=null&&n!=null&&a!=null?{top:o,right:s,bottom:n,left:a}:null}}function Z(t,e,i){D[0]=t.x,D[1]=t.y,D[2]=0,F[0]=e.x,F[1]=e.y,F[2]=0,Jt(D,D,F,.5),Q.x=D[0],Q.y=F[1],Q.z=F[2];const o=i.localToMap(Q);return o!=null?S(o,i.spatialReference):null}const Q=v(0,0,0),D=I(),F=I();function zt(t,e,i,o){const s=e.mapToLocalMultiple(t);let n=null,a=null;if(i)n=s[0],a=s[1];else{const f=s[0],x=s[1],_=Math.round(x.x-f.x),k=Math.round(x.y-f.y),O=Math.max(Math.abs(_),Math.abs(k));n=v(_>0?f.x+O/2:f.x-O/2,k>0?f.y+O/2:f.y-O/2),a=v(Math.abs(_)>Math.abs(k)?n.x-O/2:n.x,Math.abs(_)>Math.abs(k)?n.y:n.y-O/2)}const u=e.localToMap(n),p=e.localToMap(a);if(u==null||p==null)return null;e.doUnnormalization&&Xt([[u,p]],e.spatialReference);const h=S(u,e.spatialReference),y=S(p,e.spatialReference),g=Bt(e.spatialReference);let c=0;if(Pt(e.spatialReference))c=g*te(h,y,null);else{const f=n.x-a.x,x=n.y-a.y;c=g*Math.sqrt(f*f+x*x)*(o||1)}const C=new ee({center:h,radius:c,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:U(C.rings,C.spatialReference,!1),center:h,edge:y}}function We(t,e,i){const o=e.mapToLocalMultiple(t),s=o[0],n=o[1],a=Math.round(n.x-s.x),u=Math.round(n.y-s.y),p=v(i?s.x:s.x+a/2,i?s.y:s.y+u/2),h=i?a:a/2,y=i?u:u/2,g=60,c=[],C=2*Math.PI/g;function f(z){const Ht=Math.cos(z),Nt=Math.sin(z);return v(h*Ht+p.x,y*Nt+p.y)}for(let z=0;ze.localToMap(z)).filter(lt)],x,_,!1),O=e.localToMap(f(Math.PI/2)),ct=e.localToMap(f(0)),ut=e.localToMap(f(-Math.PI/2)),ht=e.localToMap(f(Math.PI));return{geometry:k,midpoints:O!=null&&ct!=null&&ut!=null&&ht!=null?{top:S(O,x),right:S(ct,x),bottom:S(ut,x),left:S(ht,x)}:null}}function et(t,e){switch(t){case"point":case"multipoint":return Ye();case"polyline":return je(e);case"polygon":return Ke(e);default:return}}function Ye(t){return"point"}function je(t){return(t!=null&&t.type==="polyline"&&t.paths.length?t.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function Ke(t){const e=t!=null&&t.type==="polygon"&&t.rings.length?t.rings[0].length:0;return e<3?"polylineZeroVertices":e<4?"polygonOneVertex":"polygonTwoVertices"}const Je=(()=>{const t=I(),e=I(),i=I();return(o,s)=>{if(ot(e,o.x,o.y,o.z??0),ot(i,s.x,s.y,s.z??0),ie(e,i))return null;if(!dt(e,o.spatialReference,e)||!dt(i,s.spatialReference,i)){oe(t,i,e),t[2]=0,ne(t,t);let a=re(ae,t);return t[0]<0&&(a=2*Math.PI-a),Y(a,"radians","geographic")}const{azimuth:n}=se(Be,e,i);return n!=null?Y(n,"degrees","geographic"):void 0}})(),Xe=(()=>{const t=I(),e=I();return({x:i,y:o,z:s,spatialReference:n},a,u)=>{const p=s??0;ot(t,i,o,p);const h=nt(j(u.value,u.unit,"degrees"),u.rotationType,"geographic");if(!rt(t,n,t,yt.WGS84)){const y=nt(h,"geographic","arithmetic"),g=j(y,"degrees","radians");return new Rt({x:i+a*Math.cos(g),y:o+a*Math.sin(g),z:p,spatialReference:n})}return pe(e,t,h,a),e[2]=p,ce(e,yt.WGS84,n)}})(),Be=new le;function ti(t,e,i,o){if(!e)return;const{spatialReference:s}=t;if(!gt(s))return;const n=Dt(s),a=gt(n);if(!a)return;const u=at(t,i,o),p=ni;if(!rt(u,s,p,n))return;const h=St(e,a);if((i==null?void 0:i.type)==="3d"&&i.viewingMode==="local")p[0]+=h;else{const g=ue(n),c=he(g,p,de.X,ri);ye(p,p,c,h)}if(!rt(p,n,p,s))return;const y=ge(u,p);return new fe(u,y)}function ei(t,e,i,o){if(!e)return;const s=at(t,i,o),n=Xe(t,1,e);if(!n)return;const a=at(n,i,o);return new ve(s,a)}function ii(t,e,i,o){if(t==null)return;const s=Dt(e),n=me(s);return n?new xe(St(t,n)):void 0}function oi(t){let e;for(const i of t)i&&(e=(e==null?void 0:e.intersect(i))??i);return e}const ni=I(),ri=I();let m=class extends we{constructor(e){super(e),this.committed=null,this.disabled=!1,this.hidden=!1,this.id=_e(),this.inputValue=null,this.readOnly=!1}get dirty(){return this.inputValue!=null}get locked(){return this.committed!=null}lock(e){this.inputValue=null,this.committed=e??this.actual}unlock(){this.committed=null,this.inputValue=null}};r([l()],m.prototype,"actual",void 0),r([l()],m.prototype,"committed",void 0),r([l()],m.prototype,"createQuantity",void 0),r([l()],m.prototype,"disabled",void 0),r([l()],m.prototype,"hidden",void 0),r([l()],m.prototype,"format",void 0),r([l()],m.prototype,"id",void 0),r([l()],m.prototype,"inputValue",void 0),r([l()],m.prototype,"readOnly",void 0),r([l()],m.prototype,"suffix",void 0),r([l()],m.prototype,"title",void 0),r([l()],m.prototype,"toInputUnits",void 0),r([l()],m.prototype,"dirty",null),r([l()],m.prototype,"locked",null),m=r([V("esri.views.interactive.tooltip.fields.TooltipField")],m);let W=class extends m{constructor(e){super(e),this.mode="absolute-height"}normalizeCtorArgs(e){const i=o=>o.inputUnitInfos.verticalLength.unit;return{actual:w,createQuantity:(o,s)=>K(o,i(s)),toInputUnits:(o,s)=>pt(o,i(s)),format:(o,s)=>s.formatters.verticalLength(o),suffix:o=>o.inputUnitInfos.verticalLength.abbreviation,title:o=>o.messages.sketch.elevation,...e}}};r([l()],W.prototype,"mode",void 0),W=r([V("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],W);const Lt=t=>{const e=i=>i.inputUnitInfos.orientation.unit;return new m({actual:Ut,createQuantity:(i,o)=>Y(i,e(o),"geographic"),toInputUnits:({value:i,unit:o,rotationType:s},n)=>{const p=nt(j(i,o,"degrees"),s,"geographic"),h=$e.normalize(p,0,!0),y=e(n),g=j(h,"degrees",y);return Y(g,y,"geographic")},format:(i,o)=>o.formatters.angle(i),suffix:i=>i.inputUnitInfos.orientation.abbreviation,title:i=>i.messages.sketch.orientation,...t})},st=t=>{const e=i=>i.inputUnitInfos.length.unit;return new m({actual:w,createQuantity:(i,o)=>K(i,e(o)),toInputUnits:(i,o)=>pt(i,e(o)),format:(i,o)=>o.formatters.length(i),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...t})},X=t=>new W(t),ai=t=>{const e=i=>i.inputUnitInfos.area.unit;return new m({actual:L,createQuantity:(i,o)=>Oe(i,e(o)),toInputUnits:(i,o)=>pt(i,e(o)),format:(i,o)=>o.formatters.area(i),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,...t})};let P=class extends A{constructor(e){super(e),this.type="draw-point",this.elevation=X()}get allFields(){return[this.elevation]}};r([l()],P.prototype,"type",void 0),r([l()],P.prototype,"elevation",void 0),r([l()],P.prototype,"allFields",null),r([l()],P.prototype,"helpMessage",void 0),P=r([V("esri.views.interactive.tooltip.DrawPointTooltipInfo")],P);let $=class extends A{constructor(t){super(t),this.type="draw-polyline",this.orientation=Lt(),this.distance=st({title:e=>e.messages.sketch.distance}),this.elevation=X(),this.totalLength=st({format:(e,i)=>i.formatters.totalLength(e),title:e=>e.messages.sketch.totalLength,readOnly:!0})}get allFields(){return[this.orientation,this.distance,this.elevation,this.totalLength]}};r([l()],$.prototype,"type",void 0),r([l()],$.prototype,"orientation",void 0),r([l()],$.prototype,"distance",void 0),r([l()],$.prototype,"elevation",void 0),r([l()],$.prototype,"totalLength",void 0),r([l()],$.prototype,"allFields",null),r([l()],$.prototype,"helpMessage",void 0),$=r([V("esri.views.interactive.tooltip.DrawPolylineTooltipInfo")],$);let M=class extends A{constructor(t){super(t),this.type="draw-polygon",this.orientation=Lt(),this.distance=st({title:e=>e.messages.sketch.distance}),this.elevation=X(),this.area=ai({readOnly:!0})}get allFields(){return[this.orientation,this.distance,this.elevation,this.area]}};r([l()],M.prototype,"type",void 0),r([l()],M.prototype,"distance",void 0),r([l()],M.prototype,"elevation",void 0),r([l()],M.prototype,"area",void 0),r([l()],M.prototype,"allFields",null),r([l()],M.prototype,"helpMessage",void 0),M=r([V("esri.views.interactive.tooltip.DrawPolygonTooltipInfo")],M);let R=class extends A{constructor(e){super(e),this.type="draw-mesh",this.elevation=X()}get allFields(){return[this.elevation]}};r([l()],R.prototype,"type",void 0),r([l()],R.prototype,"elevation",void 0),r([l()],R.prototype,"allFields",null),r([l()],R.prototype,"helpMessage",void 0),R=r([V("esri.views.interactive.tooltip.DrawMeshTooltipInfo")],R);let G=class extends A{constructor(e){super(e),this.type="draw-rectangle",this.xSize=w,this.ySize=w,this.area=L}get allFields(){return[]}};r([l()],G.prototype,"type",void 0),r([l()],G.prototype,"xSize",void 0),r([l()],G.prototype,"ySize",void 0),r([l()],G.prototype,"area",void 0),r([l()],G.prototype,"allFields",null),G=r([V("esri.views.interactive.tooltip.DrawRectangleTooltipInfo")],G);let T=class extends A{constructor(t){super(t),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=L}get allFields(){return[]}};r([l()],T.prototype,"type",void 0),r([l()],T.prototype,"radius",void 0),r([l()],T.prototype,"xSize",void 0),r([l()],T.prototype,"ySize",void 0),r([l()],T.prototype,"area",void 0),r([l()],T.prototype,"allFields",null),T=r([V("esri.views.interactive.tooltip.DrawCircleTooltipInfo")],T);class si{constructor(){this.regularVertices=null,this.activeVertex=null,this.full=null,this.outline=null,this.circle=null,this.rectangle=null}}let d=class extends be.EventedMixin(Ee){constructor(t){super(t),this._graphic=null,this._createOperationGeometry=null,this.defaultZ=0,this.geometryType=null,this.hasZ=!0,this.labelOptions=new kt,this.geometryToPlace=null,this.mode=null,this.snappingManager=null,this.snapToScene=!1,this.tooltip=null,this.tooltipOptions=new Et,this._getPointConstraint=H(e=>e),this._getPolylineOrPolygonConstraint=H((e,i,o)=>oi([e,i,o])),this._getDistanceConstraint=H(ti),this._getOrientationConstraint=H(ei),this._getElevationConstraint=H(ii)}initialize(){this.internalGraphicsLayer=new Me({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer),this.drawOperation=this.makeDrawOperation();const t=this.tooltipOptions,e=this.view.type;this.tooltipInfos={point:new P({tooltipOptions:t,viewType:e}),polyline:new $({tooltipOptions:t,viewType:e}),polygon:new M({tooltipOptions:t,viewType:e}),mesh:new R({tooltipOptions:t,viewType:e}),rectangle:new G({tooltipOptions:t}),circle:new T({tooltipOptions:t})},this.addHandles([this.drawOperation.on("vertex-add",i=>this.onVertexAdd(i)),this.drawOperation.on("vertex-remove",i=>this.onVertexRemove(i)),this.drawOperation.on("vertex-update",i=>this.onVertexUpdate(i)),this.drawOperation.on("cursor-update",i=>this.onCursorUpdate(i)),this.drawOperation.on("complete",i=>this.onComplete(i)),ft(()=>this.cursor,i=>{this.drawOperation.cursor=i},mt),ft(()=>this.tooltipOptions.enabled,i=>{this.tooltip=i?new Le({view:this.view,info:this._tooltipInfo}):N(this.tooltip)},mt),Te(()=>this._updateTooltipInfo())]),this.finishToolCreation()}destroy(){this.drawOperation=N(this.drawOperation),this.tooltip=N(this.tooltip),this._destroyAllVisualisations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=N(this.internalGraphicsLayer),this._set("view",null)}get _defaultElevation(){return K(this.defaultZ,"meters")}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(t){this._set("centered",t),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(t){this._set("cursor",t)}set enabled(t){this.drawOperation.interactive=t,this._set("enabled",t)}set forceUniformSize(t){this._set("forceUniformSize",t),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(t){this._set("graphicSymbol",t),this._graphic!=null&&(this._graphic.symbol=t)}get updating(){var t;return((t=this.drawOperation)==null?void 0:t.updating)??!1}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(t){const e=this._tooltipInfo;if(t.type==="key-down"&&t.key===Ie.enterInputMode&&e!=null&&e.editableFields.length>0&&this.tooltipOptions.inputEnabled)return e.enterInputMode(),void t.stopPropagation();this.drawOperation.onInputEvent(t)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo()}_destroyAllVisualisations(){this.removeHandles(b.outline),this.removeHandles(b.regularVertices),this.removeHandles(b.activeVertex),this.removeHandles(it)}_createOrUpdateGraphic(t){if(this._graphic!=null)return this.updateGraphicGeometry(this._graphic,t),this._graphic;const e=this._graphic=new Ve({...this.graphicProperties,symbol:this.graphicSymbol});return this.updateGraphicGeometry(e,t),this.internalGraphicsLayer.add(e),this.addHandles(this.initializeGraphic(e)),this.notifyChange("graphic"),this.addHandles(vt(()=>{this.internalGraphicsLayer.remove(e),N(e),this._graphic===e&&(this._graphic=null)}),it),e}updateGraphicGeometry(t,e){t.geometry=e}_getCreateOperationGeometry(t={operationComplete:!1}){var C;const{drawOperation:e}=this;if(e==null||e.numVertices===0)return null;const{coordinateHelper:i,view:o}=e,s=e.stagedVertex,n=e.committedVertices,a=n.slice(),u=s!=null;u&&a.push(i.pointToArray(s));const p=u?i.pointToArray(s):n.splice(-1)[0],h=a.length,y=o.spatialReference,g=o.type==="3d"&&o.viewingMode==="global",c=new si;switch(this.geometryType){case"point":case"mesh":c.regularVertices=n,c.activeVertex=p,c.full=i.arrayToPoint(a[0]);break;case"multipoint":c.regularVertices=n,c.activeVertex=p,h>0&&(c.full=Ze(a,y));break;case"polyline":c.regularVertices=n,c.activeVertex=p,h>0&&(c.full=It([a],y,g));break;case"polygon":c.regularVertices=n,c.activeVertex=p,h>0&&(c.full=U([a],y,g,!0));break;case"circle":if(h>0){const f=Mt(o,a[0]);if(h===1&&t.operationComplete){const x=a[0],_=f.makeMapPoint(x[0]+Gt*o.resolution,x[1]);c.circle=zt([x,_],f,!0),c.full=c.circle!=null?c.circle.geometry:null}else h===2&&(this.forceUniformSize?(c.circle=zt(a,f,this.centered),c.full=c.circle!=null?c.circle.geometry:null):(c.rectangle=We(a,f,this.centered),c.full=c.rectangle.geometry))}break;case"rectangle":if(h>0){const f=Mt(o,a[0]);if(h===1&&t.operationComplete){const x=a[0],_=f.makeMapPoint(x[0]+Gt*o.resolution,x[1]);c.rectangle=Vt([x,_],f,!0),c.full=c.rectangle.geometry}else h===2&&(c.rectangle=this.forceUniformSize?Vt(a,f,this.centered):Qe(a,f,this.centered),c.full=c.rectangle.geometry)}break;default:return null}switch(this.geometryType){case"point":case"multipoint":break;case"polyline":c.outline=h>1?It([a],y,g):null;break;case"polygon":c.outline=h>1?U([a],y,g):null;break;case"circle":case"rectangle":c.outline=((C=c.full)==null?void 0:C.type)==="polygon"?U(c.full.rings,y,g):null}return c}initializeGraphic(t){return vt()}onComplete(t){this._updateGraphic();let e=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(e=this._createOrUpdateGraphic(i.full).clone())}this._createOperationGeometry=null,this.emit("complete",{graphic:e,...t})}onCursorUpdate(t){this._updateGraphic(),this.emit("cursor-update",t)}onDeactivate(){this.drawOperation.isCompleted||this.drawOperation.cancel()}onVertexAdd(t){this._updateGraphic(),this._clearConstraints(),this.emit("vertex-add",t)}onVertexRemove(t){this._updateGraphic(),this._clearConstraints(),this.emit("vertex-remove",t)}onVertexUpdate(t){this._updateGraphic(),this.emit("vertex-update",t)}_updateGraphic(){const t=this._getCreateOperationGeometry();this._createOperationGeometry=t,t!=null?(t.outline!=null?this.addHandles(this.onOutlineChanged(t.outline),b.outline):this.removeHandles(b.outline),t.regularVertices!=null?this.addHandles(this.onRegularVerticesChanged(t.regularVertices),b.regularVertices):this.removeHandles(b.regularVertices),t.activeVertex!=null?this.addHandles(this.onActiveVertexChanged(t.activeVertex),b.activeVertex):this.removeHandles(b.activeVertex),t.full!=null?this._createOrUpdateGraphic(t.full):this.removeHandles(it)):this._destroyAllVisualisations()}get _tooltipInfo(){var n;const{drawOperation:t,graphic:e,view:i}=this;if(!t)return null;const o=this.tooltipInfos,s=(n=e==null?void 0:e.geometry)==null?void 0:n.type;switch(this.geometryType){case"point":return i.type==="2d"&&this.defaultZ===0?null:s==="point"?o.point:null;case"polyline":return s==="polyline"?o.polyline:null;case"polygon":return s==="polygon"?o.polygon:null;case"rectangle":return s==="polygon"?o.rectangle:null;case"circle":return s==="polygon"?o.circle:null;case"mesh":return s==="mesh"?o.mesh:null;default:return null}}_updateTooltipInfo(){const{_tooltipInfo:t,tooltip:e}=this;if(t&&e){switch(t.type){case"draw-point":this._updateDrawPointTooltipInfo(t);break;case"draw-polyline":this._updateDrawPolylineTooltipInfo(t);break;case"draw-polygon":this._updateDrawPolygonTooltipInfo(t);break;case"draw-rectangle":this._updateDrawRectangleTooltipInfo(t);break;case"draw-circle":this._updateDrawCircleTooltipInfo(t);break;case"draw-mesh":this.updateDrawMeshTooltipInfo(t)}e.info=t}}_updateDrawPointTooltipInfo(t){const{drawOperation:e,graphic:i,view:o,tooltipOptions:s}=this,{elevationInfo:n,stagedVertex:a}=e;if(t.tooltipOptions=s,t.viewType=o.type,t.helpMessage=et("point",i==null?void 0:i.geometry),this.updateElevation(t.elevation),!a)return void(e.constraint=void 0);const u=e.coordinateHelper.spatialReference;e.constraint=this._getPointConstraint(this._getElevationConstraint(t.elevation.committed,u,o,n))}_updateDrawPolylineTooltipInfo(t){const e=this._createOperationGeometry,i=e!=null?e.full:null;if((i==null?void 0:i.type)!=="polyline")return;const{drawOperation:o,tooltipOptions:s,view:n}=this,{lastVertex:a,stagedVertex:u}=o;this._updatePolylineOrPolygonCommon(t,u);const p=De(i,this._elevationMode);t.totalLength.actual=p??w,t.totalLength.hidden=length==null||!a,t.tooltipOptions=s,t.viewType=n.type,t.helpMessage=et("polyline",i),this.updateElevation(t.elevation)}_updateDrawPolygonTooltipInfo(t){const e=this._createOperationGeometry,i=e!=null?e.full:null;if((i==null?void 0:i.type)!=="polygon")return;const{drawOperation:o,tooltipOptions:s,view:n}=this,{lastVertex:a}=o;let u=o.stagedVertex;(i==null?void 0:i.type)==="polygon"&&a&&!u&&(u=i.getPoint(0,i.rings[0].length-1)),this._updatePolylineOrPolygonCommon(t,u);const p=Tt(i,this._elevationMode);t.area.actual=p??L,t.area.hidden=p==null&&!a,t.tooltipOptions=s,t.viewType=n.type,t.helpMessage=et("polygon",i),this.updateElevation(t.elevation)}_updatePolylineOrPolygonCommon(t,e){const{view:i,drawOperation:o}=this,{elevationInfo:s,lastVertex:n}=o;if(!n||!e)return t.distance.hidden=!0,t.orientation.hidden=!0,void(o.constraint=void 0);const a=Fe(n,e,this._elevationMode);t.distance.actual=a??w,t.distance.hidden=!1;const u=Je(n,e);t.orientation.actual=u??Ut,t.orientation.hidden=!1;const p=o.coordinateHelper.spatialReference;o.constraint=this._getPolylineOrPolygonConstraint(this._getDistanceConstraint(n,t.distance.committed,i,s),this._getOrientationConstraint(n,t.orientation.committed,i,s),this._getElevationConstraint(t.elevation.committed,p,i,s))}updateDrawMeshTooltipInfo(t){}_updateDrawRectangleTooltipInfo(t){t.tooltipOptions=this.tooltipOptions,t.xSize=this._xSize??w,t.ySize=this._ySize??w,t.area=this._fullGeometryArea??L}_updateDrawCircleTooltipInfo(t){const{forceUniformSize:e}=this;t.tooltipOptions=this.tooltipOptions,t.radius=e?this._circleRadius??w:null,t.xSize=e?null:this._xSize??w,t.ySize=e?null:this._ySize??w,t.area=this._fullGeometryArea??L}get _circleRadius(){var e;const t=this._createOperationGeometry;return((e=t==null?void 0:t.circle)==null?void 0:e.center)!=null&&t.circle.edge!=null?tt(t.circle.center,t.circle.edge,this._elevationMode):null}get _xSize(){var e,i;const t=(i=(e=this._createOperationGeometry)==null?void 0:e.rectangle)==null?void 0:i.midpoints;return t!=null?tt(t.left,t.right,this._elevationMode):null}get _ySize(){var e,i;const t=(i=(e=this._createOperationGeometry)==null?void 0:e.rectangle)==null?void 0:i.midpoints;return t!=null?tt(t.top,t.bottom,this._elevationMode):null}get _fullGeometryArea(){var e;const t=(e=this._createOperationGeometry)==null?void 0:e.full;return(t==null?void 0:t.type)!=="polygon"?null:Tt(t,this._elevationMode)}updateElevation(t){t.actual=this._vertexTooltipElevation}get _vertexTooltipElevation(){const{tooltipOptions:t,view:e,drawOperation:i}=this;if(i==null)return this._defaultElevation;const o=i.stagedVertex??i.lastVertex;if(o==null||e.type==="2d")return this._defaultElevation;const s={mode:t.elevation.mode,offset:0},n=(ze(e,o,i.elevationInfo,s)??0)*Ge(o.spatialReference);return K(n,"meters")}get _elevationMode(){return this.drawOperation.isDraped?"on-the-ground":"absolute-height"}_clearConstraints(){for(const[,t]of Object.entries(this.tooltipInfos))t.unlockAllFields()}};r([l()],d.prototype,"_createOperationGeometry",void 0),r([l()],d.prototype,"_defaultElevation",null),r([l({value:!0})],d.prototype,"centered",null),r([l()],d.prototype,"cursor",null),r([l({nonNullable:!0})],d.prototype,"defaultZ",void 0),r([l()],d.prototype,"drawOperation",void 0),r([l({value:!0})],d.prototype,"enabled",null),r([l({value:!0})],d.prototype,"forceUniformSize",null),r([l({constructOnly:!0})],d.prototype,"geometryType",void 0),r([l()],d.prototype,"graphic",null),r([l({constructOnly:!0})],d.prototype,"graphicProperties",void 0),r([l()],d.prototype,"graphicSymbol",null),r([l({constructOnly:!0})],d.prototype,"hasZ",void 0),r([l({constructOnly:!0,type:kt})],d.prototype,"labelOptions",void 0),r([l({constructOnly:!0})],d.prototype,"geometryToPlace",void 0),r([l({constructOnly:!0})],d.prototype,"mode",void 0),r([l()],d.prototype,"snappingManager",void 0),r([l()],d.prototype,"snapToScene",void 0),r([l()],d.prototype,"tooltip",void 0),r([l()],d.prototype,"tooltipInfos",void 0),r([l({constructOnly:!0,type:Et})],d.prototype,"tooltipOptions",void 0),r([l({readOnly:!0})],d.prototype,"type",void 0),r([l({readOnly:!0})],d.prototype,"updating",null),r([l({constructOnly:!0,nonNullable:!0})],d.prototype,"view",void 0),r([l()],d.prototype,"_tooltipInfo",null),r([l()],d.prototype,"_circleRadius",null),r([l()],d.prototype,"_xSize",null),r([l()],d.prototype,"_ySize",null),r([l()],d.prototype,"_fullGeometryArea",null),r([l()],d.prototype,"_vertexTooltipElevation",null),r([l()],d.prototype,"_elevationMode",null),d=r([V("esri.views.draw.DrawGraphicTool")],d);const it="create-operation-graphic",b={outline:"outline-visual",regularVertices:"regular-vertices-visual",activeVertex:"active-vertex-visual"};function Oi(t){switch(t){case"point":case"polyline":case"polygon":case"multipoint":return t;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const Gt=48;function bi(t,e){return At(t,e,!1)}function Mi(t,e){return At(t,e,!0)}function At(t,e,i){if(t instanceof Ae){if(t.operation instanceof He)return li(t.operation,e,i),!0;if(t.operation instanceof Ne)return pi(t.operation,e,i),!0;if(t.operation instanceof qe)return ci(t.operation,e,i),!0}return!1}function li(t,e,i=!1){const o=i?-1:1,s=Ce(o*t.dx,o*t.dy,o*t.dz);Pe(e.origin,e.origin,s),J(e)}function pi(t,e,i=!1){const o=i?-t.angle:t.angle;xt(e.basis1,e.basis1,wt,o),xt(e.basis2,e.basis2,wt,o),J(e)}function ci(t,e,i=!1){const o=i?1/t.factor1:t.factor1,s=i?1/t.factor2:t.factor2;_t(e.basis1,e.basis1,o),_t(e.basis2,e.basis2,s),$t(e.origin,e.origin,t.origin,t.axis1,o),$t(e.origin,e.origin,t.origin,t.axis2,s),J(e)}function Ti(t,e,i,o){o||(o=Re());const s=E(q.get(),t[1],-t[0]),n=E(q.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),a=E(q.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=q.get();e.components.forEach(y=>y.vertices.forEach(g=>{const c=g.pos;E(u,Ot(t,c),Ot(s,c)),Se(n,n,u),Ue(a,a,u)}));const p=1e-6,h=E(q.get(),a[0]-n[0]{(u.addedFeatures.length||u.updatedFeatures.length||u.deletedFeatures.length||u.addedAttachments.length||u.updatedAttachments.length||u.deletedAttachments.length)&&e.emit("edits",u)});const n={result:s.promise};e.emit("apply-edits",n)}try{const{results:n,edits:u}=await M(e,t,a,r),c=h=>h.filter(A=>!A.error).map(E),l={edits:u,addedFeatures:c(n.addFeatureResults),updatedFeatures:c(n.updateFeatureResults),deletedFeatures:c(n.deleteFeatureResults),addedAttachments:c(n.addAttachmentResults),updatedAttachments:c(n.updateAttachmentResults),deletedAttachments:c(n.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:n.editMoment?new Date(n.editMoment):null,globalIdToObjectId:r.globalIdToObjectId};return(d=n.editedFeatureResults)!=null&&d.length&&(l.editedFeatures=n.editedFeatureResults),s.resolve(l),n}catch(n){throw s.reject(n),n}}async function M(e,t,a,r){var p,d,n,u,c,l;if(await e.load(),!F(t))throw new i(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!S(e))throw new i(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:o}=await W(e,a,r);return(p=s.addFeatures)!=null&&p.length||(d=s.updateFeatures)!=null&&d.length||(n=s.deleteFeatures)!=null&&n.length||(u=s.addAttachments)!=null&&u.length||(c=s.updateAttachments)!=null&&c.length||(l=s.deleteAttachments)!=null&&l.length?{edits:s,results:await t.applyEdits(s,o)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function W(e,t,a){const r=g(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),o=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(H(t,r,a,!!s,!!o,`${e.type}-layer`),!r.data.isVersioned&&(a==null?void 0:a.gdbVersion))throw new i(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!r.editing.supportsRollbackOnFailure&&(a!=null&&a.rollbackOnFailureEnabled))throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const d={...a};if(d.rollbackOnFailureEnabled!=null||r.editing.supportsRollbackOnFailure||(d.rollbackOnFailureEnabled=!0),d.rollbackOnFailureEnabled||d.returnServiceEditsOption!=="original-and-current-features"||(d.rollbackOnFailureEnabled===!1&&R.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwrritten and set to true."),d.rollbackOnFailureEnabled=!0),!r.editing.supportsReturnServiceEditsInSourceSpatialReference&&d.returnServiceEditsInSourceSR)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(d.returnServiceEditsInSourceSR&&d.returnServiceEditsOption!=="original-and-current-features")throw new i(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const n=_(t,r,`${e.type}-layer`),u=(a==null?void 0:a.globalIdUsed)||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new i(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");n.addFeatures.forEach(h=>q(h,l))}return n.addFeatures.forEach(l=>z(l,e,u,c)),n.updateFeatures.forEach(l=>x(l,e,u,c)),n.deleteFeatures.forEach(l=>C(l,e,u,c)),n.addAttachments.forEach(l=>f(l,e)),n.updateAttachments.forEach(l=>f(l,e)),p&&await J(n,e),{edits:await N(n),options:d}}function y(e,t,a,r){var s,o;if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new i(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(r.length&&"attributes"in e)for(const p of r){const d=e.attributes[p.name];if(d!==void 0&&!V(p,d))throw new i(`${t.type}-layer:invalid-parameter`,`Big-integer field '${p.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&((s=t.capabilities)==null?void 0:s.data.supportsZ)===!1)throw new i(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&((o=t.capabilities)==null?void 0:o.data.supportsM)===!1)throw new i(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function w(e,t){var a;if("geometry"in e&&((a=e.geometry)==null?void 0:a.type)==="mesh"&&t.infoFor3D!=null){const{geometry:r}=e;if(r.vertexSpace.isGeoreferenced)throw new i(`${t.type}-layer:georeferenced-mesh-unsupported`,"Uploading georeferenced meshes to a layer is not supported.")}}function z(e,t,a,r){y(e,t,a,r),w(e,t)}function C(e,t,a,r){y(e,t,a,r)}function x(e,t,a,r){y(e,t,a,r),w(e,t);const s=g(t);if("geometry"in e&&e.geometry!=null&&!(s!=null&&s.editing.supportsGeometryUpdate))throw new i(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function f(e,t){var s;const{feature:a,attachment:r}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!r.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!r.data&&!r.uploadId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(r.data instanceof File&&r.data.name)&&!r.name)throw new i(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!((s=t.capabilities)!=null&&s.editing.supportsUploadWithItemId)&&r.uploadId)throw new i(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof r.data=="string"){const o=O(r.data);if(o&&!o.isBase64)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:a}=e;a[t]==null&&(a[t]=k())}async function N(e){const t=e.addFeatures??[],a=e.updateFeatures??[],r=t.concat(a).map(d=>d.geometry),s=await L(r),o=t.length,p=a.length;return s.slice(0,o).forEach((d,n)=>t[n].geometry=d),s.slice(o,o+p).forEach((d,n)=>a[n].geometry=d),e}function Z(e){return{addFeatures:Array.from((e==null?void 0:e.addFeatures)??[]),updateFeatures:Array.from((e==null?void 0:e.updateFeatures)??[]),deleteFeatures:e&&U.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function _(e,t,a){var s,o,p;const r=Z(e);if((s=r.addFeatures)!=null&&s.length&&!t.operations.supportsAdd)throw new i(`${a}:unsupported-operation`,"Layer does not support adding features.");if((o=r.updateFeatures)!=null&&o.length&&!t.operations.supportsUpdate)throw new i(`${a}:unsupported-operation`,"Layer does not support updating features.");if((p=r.deleteFeatures)!=null&&p.length&&!t.operations.supportsDelete)throw new i(`${a}:unsupported-operation`,"Layer does not support deleting features.");return r.addFeatures=r.addFeatures.map(m),r.updateFeatures=r.updateFeatures.map(m),r.addAssetFeatures=[],r}function H(e,t,a,r,s,o){if(!e||!r&&!s)throw new i(`${o}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&(a!=null&&a.globalIdUsed))throw new i(`${o}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new i(`${o}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!(a!=null&&a.globalIdUsed)&&s)throw new i(`${o}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function m(e){const t=new G;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function J(e,t){if(t.infoFor3D==null)return;const{infoFor3D:a}=t,r=j("model/gltf-binary",a.supportedFormats)??T("glb",a.supportedFormats);if(!(r&&a.editFormats.includes(r)))throw new i(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??(e.addAssetFeatures=[]);const{addAssetFeatures:s}=e;for(const o of e.addFeatures??[])b(o)&&s.push(o);for(const o of e.updateFeatures??[])b(o)&&s.push(o)}function b(e){var t;return((t=e==null?void 0:e.geometry)==null?void 0:t.type)==="mesh"}function Y(e,t,a,r){if(!F(t))throw new i(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new i(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(a,r)}export{X as applyEdits,H as checkEditingCapabilities,Q as isFeatureIdentifierArrayWithGlobalId,P as isFeatureIdentifierArrayWithObjectId,D as isFeatureIdentifierWithGlobalId,B as isFeatureIdentifierWithObjectId,Z as normalizeCollections,_ as normalizeEdits,N as normalizeGeometries,m as shallowCloneFeature,Y as uploadAssets}; diff --git a/dist/assets/editingTools-1yHclJT1.js b/dist/assets/editingTools-1yHclJT1.js new file mode 100644 index 0000000..dc3b45b --- /dev/null +++ b/dist/assets/editingTools-1yHclJT1.js @@ -0,0 +1 @@ +import{a3 as ft,J as Y,d as $,a2 as G,T as b,S as M,hq as Ot,e as h,y as d,P as Lt,n as U,c as J,ab as $t,Q as St,gk as Vt,e1 as Z,pj as dt,O as rt,fd as wt,pk as bt,ag as Dt,pl as Ht,kn as Pt,aa as v,aE as H,nX as q,a9 as Tt,n_ as K,e4 as Ut,cM as B,aU as L,hL as zt,hJ as Et,aQ as z,ax as _t,a0 as It,al as Ft,e2 as ut,au as st,l as Nt,aF as jt,at as O,hP as W,bX as Bt,kz as mt,kS as Wt,pm as Xt,pn as Kt,p as Yt}from"./index-J0iiHjMT.js";import{S as Zt}from"./SnappingVisualizer2D-NnEm1PvQ.js";import{K as qt,X as Jt,V as Gt,l as Qt}from"./editPlaneUtils-4qxd7h1E.js";import{k as te,a as ee}from"./surfaceCoordinateSystems-siQq4eBA.js";import{d as nt,v as lt,l as kt,U as Rt}from"./InteractiveToolBase-WDic4GPF.js";import{s as ie,S as ht}from"./GraphicManipulator-ku6oRBpa.js";import{E,V as Mt,e as ct,p as se}from"./EditGeometryOperations-TPE5Wzab.js";import{m as ae}from"./drawUtils-woTYaREB.js";import"./SnappingContext-6K6JmvvY.js";import"./PointSnappingHint-ULetRXiW.js";import"./measurementUtils-84-ZBArh.js";import"./Tooltip-ON77BKb3.js";import"./euclideanLengthMeasurementUtils-VQw5qWk6.js";import"./quantityFormatUtils-NiAiojad.js";import"./automaticAreaMeasurementUtils-nVd6Y5mX.js";import"./euclideanAreaMeasurementUtils-zmzttSyV.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./SnappingDragPipelineStep-THHIXt-p.js";import"./SnappingOperation-2U48wt1k.js";import"./drapedUtils-9db1OpTX.js";const oe=new ft({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),re=new Y({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),ne=new Y({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});let D=class extends qt{constructor(e){super(e),this._visualElementGraphics={outline:null,regularVertices:null,activeVertex:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??oe,regularVertices:e.regularVerticesSymbol??re,activeVertex:e.activeVertexSymbol??ne,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles($(()=>{var t,s;return(s=(t=this.view)==null?void 0:t.effectiveTheme)==null?void 0:s.accentColor},t=>{var i;if(!t)return;const s=this._visualElementSymbols.activeVertex.clone().set({color:t});(i=this._visualElementGraphics.activeVertex)==null||i.set("symbol",s),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:s}},Lt))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),G()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:s}=this;return this._createOrUpdateGraphic(null),new te({view:s,manipulators:this.manipulators,geometryType:Jt(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new ee(s,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new Zt(this.internalGraphicsLayer),tooltipOptions:this.tooltipOptions,graphic:this.graphic,cursor:this.cursor})}onActiveVertexChanged(e){if(this.geometryType==="point")return G();const[t,s]=e,i=new b({x:t,y:s,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=i,G()):(this._visualElementGraphics.activeVertex=new M({geometry:i,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(at),G(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=U(this._visualElementGraphics.activeVertex))}))}onOutlineChanged(e){const t=e.clone();if(t.type==="polyline"){const s=t.paths[t.paths.length-1];s.splice(0,s.length-2)}return this._visualElementGraphics.outline!=null?(this._visualElementGraphics.outline.geometry=t,G()):(this._visualElementGraphics.outline=new M({geometry:t,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.outline),this.internalGraphicsLayer.graphics.sort(at),G(()=>{this._visualElementGraphics.outline!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.outline),this._visualElementGraphics.outline=U(this._visualElementGraphics.outline))}))}onRegularVerticesChanged(e){const t=new Ot({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,G()):(this._visualElementGraphics.regularVertices=new M({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(at),G(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=U(this._visualElementGraphics.regularVertices))}))}};function at(e,t){var s,i;return(((s=e.attributes)==null?void 0:s.displayOrder)??-1/0)-(((i=t.attributes)==null?void 0:i.displayOrder)??-1/0)}h([d()],D.prototype,"activeFillSymbol",void 0),h([d({readOnly:!0})],D.prototype,"type",void 0),h([d({constructOnly:!0,nonNullable:!0})],D.prototype,"view",void 0),D=h([J("esri.views.2d.interactive.draw.DrawGraphicTool2D")],D);let pt=class{get hovering(){return this.someManipulator(t=>t.hovering)}get grabbing(){return this.someManipulator(t=>t.grabbing)}get dragging(){return this.someManipulator(t=>t.dragging)}hasManipulator(t){return this.someManipulator(s=>s===t)}someManipulator(t){let s=!1;return this.forEachManipulator(i=>{!s&&t(i)&&(s=!0)}),s}};var I;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(I||(I={}));let At=class extends pt{constructor(t){super(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._manipulator=this._createManipulator(),this.forEachManipulator(s=>this._tool.manipulators.add(s))}destroy(){this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(t){t(this._manipulator,I.TRANSLATE_XY)}createDragPipeline(t,s){let i=null,a=null,r=0,n=0,o=0;const{offsetX:c,offsetY:p,size:u}=ie(this._graphic.symbol);return nt(this._manipulator,(m,P)=>{P.next(g=>{if(g.action==="start"){const l=t();i=l.editGeometryOperations,a=l.constraints}return g}).next(lt(this._view)).next(g=>{const{x:l,y:_,z:y}=g.mapEnd;if(a&&(l+ca.xmax||_+p-u>a.ymax))return g;(g.action==="start"||r===0&&n===0&&o===0)&&(r=g.mapStart.x,n=g.mapStart.y,o=g.mapStart.z);const f=l-r,V=_-n,A=y-o;r=l,n=_,o=y;const C=[];for(const tt of i.data.components)C.push(...tt.vertices);const F=g.action==="start"?E.NEW_STEP:E.ACCUMULATE_STEPS,Q=i.moveVertices(C,f,V,A,F);return s(g,Q),g})})}_createManipulator(){const t=this._view,s=this._graphic;return new ht({view:t,graphic:s,selectable:!0,cursor:"move"})}};const T={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:bt},le=1,he=10,gt=new $t("#009AF2");let R=class extends kt{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new St({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=U(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Vt(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:s},i)=>{const a=this._controlPointEditGeometryOperations[i],r=a.data.components[0].vertices[0];a.setVertexPosition(r,a.data.coordinateHelper.pointToVector(s))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,s=t[0].mapPoint.spatialReference,i=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((a,r)=>{const n=a.data.geometry;return this._controlPointGraphics[r].geometry=n,{mapPoint:Z(n,s),sourcePoint:i?t[r].sourcePoint:e.toSource(n)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();dt(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const s=this._controlPointGraphics[e].symbol.clone();dt(s,gt),this._controlPointGraphics[e].symbol=s,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const s=t.georeference;s.type==="control-points"&&s.coords!=null&&(this._georeference=s,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:i})=>Mt.fromGeometry(Z(i,e.spatialReference),rt.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((i,a)=>new M({symbol:new ft({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:a===this.activeHandle?gt.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:i.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(i=>new At({tool:this,view:e,graphic:i})),this.addHandles([...this._controlPointManipulations.map((i,a)=>i.createDragPipeline(this._getInfo.bind(this,a),(r,n)=>{r.action==="start"&&(this._undoStack.push(a),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:n}),this._sharedRedoStack.length=0),this.updateGraphics()})),$(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((i,a)=>{const r=n=>{this.addHandles([n.events.on(["click","grab-changed"],o=>this.updateActiveHandle(a))])};i.forEachManipulator(r)}),this.addHandles([e.on("key-down",i=>{e.activeTool===this&&(i.key!==T.shift||i.repeat||(this._isModifierActive=!0,i.stopPropagation()),i.key!==T.toggleOpacity||i.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,i.stopPropagation()),i.key!==T.primaryKey||i.repeat||(this._factor=he,i.stopPropagation()),this._isModifierActive&&(i.key===T.up&&(this._move(0,this._factor),i.stopPropagation()),i.key===T.down&&(this._move(0,-this._factor),i.stopPropagation()),i.key===T.left&&(this._move(-this._factor,0),i.stopPropagation()),i.key===T.right&&(this._move(this._factor,0),i.stopPropagation())))}),e.on("key-up",i=>{e.activeTool===this&&(i.key===T.shift&&(this._isModifierActive=!1,i.stopPropagation()),i.key===T.primaryKey&&(this._factor=le,i.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return wt(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const s=this._controlPointEditGeometryOperations[this.activeHandle],i=[];for(const r of s.data.components)i.push(...r.vertices);const a=s.moveVertices(i,e*this.view.resolution,t*this.view.resolution,0,E.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:a}),this._sharedRedoStack.length=0,this.updateGraphics()}};h([d()],R.prototype,"_hasValidSpatialReference",null),h([d()],R.prototype,"activeHandle",void 0),h([d({constructOnly:!0,nonNullable:!0})],R.prototype,"mediaElement",void 0),h([d({constructOnly:!0})],R.prototype,"view",void 0),R=h([J("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],R);function xt(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class ce{constructor(){this._lastDragEvent=null,this.next=new Rt,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const s={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(s),this.next.execute(s)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const s=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-s:s,t.factor2=t.factor2<0?-s:s}}class pe{constructor(){this._lastDragEvent=null,this.next=new Rt,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const s={...this._lastDragEvent,action:"update"};t&&this._adjustRotateAngle(s),this.next.execute(s)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustRotateAngle(t),t)}_adjustRotateAngle(t){const s=Dt(t.rotateAngle);t.rotateAngle=Ht(5*Math.round(s/5))}}class de extends pt{constructor(t){super(),this._handles=new Pt,this._originCache=v(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._snapRotation=t.snapRotation,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",s=>xt(s,this._manipulator))]),this.forEachManipulator(s=>this._tool.manipulators.add(s))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,I.ROTATE)}createDragPipeline(t,s){let i=null,a=null;return nt(this._manipulator,(r,n)=>{n.next(o=>{if(o.action==="start"){r.cursor="grabbing";const c=t();i=c.plane,a=c.editGeometryOperations}return o}).next(lt(this._view)).next(o=>({...o,rotateAngle:ae(o.mapStart,o.mapEnd,{x:i.origin[0],y:i.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(o=>{const c=H(this._originCache,i.origin),p=[];for(const P of a.data.components)p.push(...P.vertices);const u=o.action==="start"?E.NEW_STEP:E.ACCUMULATE_STEPS,m=a.rotateVertices(p,c,o.rotateAngle,u,ct.REPLACE);return Gt(m,i),s(o,m),o}).next(o=>(o.action==="end"&&(r.cursor="grab"),o))})}_createManipulator(){const t=this._view,s=this._graphic;return new ht({view:t,graphic:s,selectable:!0,cursor:"grab"})}}const ot=10,yt=1e-6,_e=.3;function vt(e){const t=z(e.basis1),s=z(e.basis2);return _e*Math.min(t,s)}class ue extends pt{constructor(t){super(),this._handles=new Pt,this._planeStart=q(),this._displayPlaneStart=q(),this._originCache=v(),this._axisCache=Tt(),this._renderStartCache=v(),this._renderEndCache=v(),this._resizeOriginCache=v(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",s=>xt(s,this._manipulator))]),this.forEachManipulator(s=>this._tool.manipulators.add(s))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,I.SCALE)}createDragPipeline(t,s){let i=null,a=null,r=null,n=0,o=null,c=null;const p=this._planeStart,u=this._displayPlaneStart,m=this._direction;return nt(this._manipulator,(P,g)=>{g.next(l=>{if(l.action==="start"){P.cursor="grabbing";const _=t();i=_.plane,a=_.displayPlane,r=_.editGeometryOperations,n=ot*this._view.resolution,K(i,p),K(a,u);const y=Ut(r.data.spatialReference);o=y?y.valid[1]-y.valid[0]-3*ot*this._view.resolution:null}return l}).next(lt(this._view)).next(l=>{const _=H(this._renderStartCache,[l.mapStart.x,l.mapStart.y,0]),y=H(this._renderEndCache,[l.mapEnd.x,l.mapEnd.y,0]),f=H(this._resizeOriginCache,u.origin);B(f,f,u.basis1,-m[0]),B(f,f,u.basis2,-m[1]),L(y,y,f),L(_,_,f);const V=m[0]!==0&&m[1]!==0,A=vt(u),C=vt(a)/A,F=(et,it)=>{if(et===0)return 1;let x=z(it),N=.5*et*_t(it,y)/x;const j=N<0?-1:1;V&&(N+=(x-.5*et*_t(it,_)/x)*j*C);const Ct=x<1.5*n?1:yt;return x=Math.max(x-n,yt),j>0&&(N-=ot*this._view.resolution),j*Math.max(j*(N/x),Ct)},Q=F(m[0],u.basis1),tt=F(m[1],u.basis2);return{...l,direction:m,factor1:Q,factor2:tt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(l=>{const _=H(this._originCache,p.origin);B(_,_,p.basis1,-m[0]),B(_,_,p.basis2,-m[1]);const y=zt(this._axisCache,p.basis1[0],p.basis1[1]);Et(y,y);const f=[];for(const C of r.data.components)f.push(...C.vertices);const V=l.action==="start"?E.NEW_STEP:E.ACCUMULATE_STEPS,A=r.scaleVertices(f,_,y,l.factor1,l.factor2,V,ct.REPLACE);return o&&o(l.action==="end"&&(P.cursor="grab"),l))})}_createManipulator(){return new ht({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}const S={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",toggleOpacity:"t",shift:"Shift",primaryKey:bt},me=80,ge=10,ye=30,ve=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],fe=1,Se=10;let w=class extends kt{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=q(),this._displayPlaneCache=q(),this._mainAxisCache=Tt(),this._rotationHandleCache=v(),this._cornerA=v(),this._cornerB=v(),this._cornerC=v(),this._cornerD=v(),this._avgAB=v(),this._avgBC=v(),this._avgCD=v(),this._avgDA=v(),this._preserveAspectRatio=new ce,this._snapRotation=new pe,this._graphicsLayer=new St({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=U(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,s=t.components[0].edges[0],i=It(this._mainAxisCache,s.leftVertex.pos,s.rightVertex.pos);Et(i,i);let a=me*this.view.resolution;const r=this.view.spatialReference;return Ft(r,e.spatialReference)&&(a*=ut(r)/ut(e.spatialReference)),Qt(i,t,a,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;K(e,t);const s=ge*this.view.resolution;return st(t.basis1,t.basis1,1+s/z(t.basis1)),st(t.basis2,t.basis2,1+s/z(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new Nt({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return jt(t,e.basis1),st(t,t,ye*this.view.resolution),O(t,t,e.origin),O(t,t,e.basis1),new b({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:s,_cornerB:i,_cornerC:a,_cornerD:r}=this,n=W(this._avgAB,s,i,.5),o=W(this._avgBC,i,a,.5),c=W(this._avgCD,a,r,.5),p=W(this._avgDA,r,s,.5);return[new b({x:s[0],y:s[1],spatialReference:t}),new b({x:i[0],y:i[1],spatialReference:t}),new b({x:a[0],y:a[1],spatialReference:t}),new b({x:r[0],y:r[1],spatialReference:t}),new b({x:n[0],y:n[1],spatialReference:t}),new b({x:o[0],y:o[1],spatialReference:t}),new b({x:c[0],y:c[1],spatialReference:t}),new b({x:p[0],y:p[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,s="georeference"in t?t.georeference.coords:t.geometry,i=this._editGeometryOperations,a=i.data.components[0].vertices,r=se.fromGeometry(Z(s,e.spatialReference),rt.Local).components[0].vertices;a.forEach((n,o)=>{i.setVertexPosition(n,r[o].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,s)=>{this._scaleGraphics[s].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const i=t.georeference;this._graphic=new M({geometry:i.coords}),this._initialControlPoints=i.type==="control-points"?i.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=Mt.fromGeometry(Z(this._graphic.geometry,e.spatialReference),rt.Local),this._backgroundGraphic=new M({symbol:new Bt({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new M({symbol:new Y({color:mt(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(i=>new M({symbol:new Y({size:6,style:"square",color:mt(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:i})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new At({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new de({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((i,a)=>new ue({tool:this,view:e,graphic:i,direction:ve[a],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(i=>i.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),$(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async i=>{if(e.activeTool!=null&&e.activeTool!==this)return;const a=Wt(i),r=[];e.map.allLayers.forEach(c=>{c.type!=="vector-tile"&&c.type!=="imagery"||r.push(c)});const n=await this.view.hitTest(a,{exclude:r}),o=n.results;if(o.length===0)e.activeTool=null;else{const c=Xt(n.results),p="georeference"in t,u=o.map(P=>P.type==="media"?P.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&u.includes(t)||c!=null&&m.has(c.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const s=i=>{this.addHandles(i.events.on("grab-changed",a=>{"georeference"in t&&(a.action==="start"?t.opacity*=.5:a.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(s),this._rotateManipulation.forEachManipulator(s),this._scaleManipulations.forEach(i=>i.forEachManipulator(s)),this.addHandles([e.on("key-down",i=>{e.activeTool===this&&(i.key!==S.shift||i.repeat||(this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!0,i.stopPropagation()),i.key!==S.toggleOpacity||i.repeat||("georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled),i.stopPropagation()),i.key!==S.primaryKey||i.repeat||(this._factor=Se,i.stopPropagation()),this._isModifierActive&&(i.key===S.plus&&(this._scale(this._factor),i.stopPropagation()),i.key===S.minus&&(this._scale(-this._factor),i.stopPropagation()),i.key===S.up&&(this._move(0,this._factor),i.stopPropagation()),i.key===S.down&&(this._move(0,-this._factor),i.stopPropagation()),i.key===S.left&&(this._move(-this._factor,0),i.stopPropagation()),i.key===S.right&&(this._move(this._factor,0),i.stopPropagation())))}),e.on("key-up",i=>{e.activeTool===this&&(i.key===S.shift&&(this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._isModifierActive=!1,i.stopPropagation()),i.key===S.primaryKey&&(this._factor=fe,i.stopPropagation()))})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return wt(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:s,origin:i}=e,a=this._cornerA;O(a,i,t),O(a,a,s);const r=this._cornerB;O(r,i,t),L(r,r,s);const n=this._cornerC;L(n,i,t),L(n,n,s);const o=this._cornerD;L(o,i,t),O(o,o,s)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){var n;const t=this._editGeometryOperations,s=[];for(const o of t.data.components)s.push(...o.vertices);const i=(n=t.data.geometry.extent)==null?void 0:n.width,a=(i+e*this.view.resolution)/i,r=t.scaleVertices(s,this._plane.origin,Kt,a,a,E.NEW_STEP,ct.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const s=this._editGeometryOperations,i=[];for(const r of s.data.components)i.push(...r.vertices);const a=s.moveVertices(i,e*this.view.resolution,t*this.view.resolution,0,E.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:a}),this._sharedRedoStack.length=0,this.updateGraphics()}};h([d()],w.prototype,"_plane",null),h([d()],w.prototype,"_backgroundGraphicGeometry",null),h([d()],w.prototype,"_rotateGraphicGeometry",null),h([d()],w.prototype,"_scaleGraphicGeometries",null),h([d()],w.prototype,"preserveAspectRatio",void 0),h([d()],w.prototype,"snapRotation",void 0),h([d({constructOnly:!0,nonNullable:!0})],w.prototype,"target",void 0),h([d({constructOnly:!0})],w.prototype,"view",void 0),w=h([J("esri.views.2d.interactive.editingTools.TransformTool")],w);const X={redo:"r",undo:"z"};let k=class extends Yt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:s,snapRotation:i,advancedMode:a}=this;this._originalOpacity=t.opacity,this._transformTool=new w({target:t,view:e,preserveAspectRatio:s,snapRotation:i}),this._controlPointsTransformTool=new R({mediaElement:t,view:e}),this._advancedModeTransformTool=new R({mediaElement:a.mediaElement,view:a.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const r=t.georeference,n=a.mediaElement.georeference;a.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in n&&"controlPoints"in r&&this.addHandles([a.view.on("key-down",o=>{o.key===X.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===X.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())}),a.view.on("focus",async o=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),$(()=>n.controlPoints,o=>{var c;r.controlPoints=o.map(({sourcePoint:p},u)=>({sourcePoint:p,mapPoint:r.controlPoints[u].mapPoint})),(c=this._activeTool)==null||c.refresh()}),$(()=>this._controlPointsTransformTool.activeHandle,o=>{this._advancedModeTransformTool.updateActiveHandle(o),this.activeHandle=o}),$(()=>this._advancedModeTransformTool.activeHandle,o=>{this._controlPointsTransformTool.updateActiveHandle(o),this.activeHandle=o})]),this.addHandles([e.on("key-down",o=>{o.key===X.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===X.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())}),e.on("focus",async o=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){var e,t;(e=this._transformTool)==null||e.destroy(),(t=this._controlPointsTransformTool)==null||t.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){var e;if(this._sharedUndoStack.length>0){const{tool:t,operation:s}=this._sharedUndoStack.pop();t!==this._activeTool&&t.refresh(),s.undo(),t.updateGraphics(),this._sharedRedoStack.push({tool:t,operation:s}),this._activeTool!==t&&((e=this._activeTool)==null||e.refresh())}}redo(){var e;if(this._sharedRedoStack.length>0){const{tool:t,operation:s}=this._sharedRedoStack.pop();t!==this._activeTool&&t.refresh(),s.apply(),t.updateGraphics(),this._sharedUndoStack.push({tool:t,operation:s}),this._activeTool!==t&&((e=this._activeTool)==null||e.refresh())}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};h([d()],k.prototype,"activeHandle",void 0),h([d({constructOnly:!0})],k.prototype,"advancedMode",void 0),h([d()],k.prototype,"preserveAspectRatio",void 0),h([d()],k.prototype,"snapRotation",void 0),h([d({constructOnly:!0,nonNullable:!0})],k.prototype,"mediaElement",void 0),h([d({constructOnly:!0})],k.prototype,"view",void 0),k=h([J("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],k);export{R as ControlPointsTransformTool,D as DrawGraphicTool2D,k as MediaTransformToolsWrapper,w as TransformTool}; diff --git a/dist/assets/editingTools-eh7FxppI.js b/dist/assets/editingTools-eh7FxppI.js new file mode 100644 index 0000000..dac2384 --- /dev/null +++ b/dist/assets/editingTools-eh7FxppI.js @@ -0,0 +1 @@ +import{e as h,y as u,c as k,p as Yt,b as za,kw as Ha,s as Va,d as y,fl as ka,a2 as Z,ab as He,hS as Ua,kz as Xa,kA as Na,pU as Ya,hp as Za,hu as Fa,l0 as Ba,rl as ja,hL as Et,hJ as pa,hK as ha,oV as qa,hM as Wa,a9 as re,aR as Ve,hV as Ka,aa as H,A as Qt,kU as ca,e2 as Ee,dA as Ja,as as rt,aP as z,q4 as Qa,hs as tn,np as en,fv as F,vT as Ei,b2 as Dt,bp as pi,F as Xt,bq as hi,P as $,kY as Y,n as R,vU as an,oW as nn,vV as ci,fw as Gt,pl as ke,vW as ua,hD as Te,at as At,au as Vt,eh as on,bn as Ti,fN as sn,vX as rn,ay as ln,vY as da,kn as Ue,K as $t,vZ as Ae,v_ as ga,bw as Ai,br as x,o4 as B,rm as O,v$ as pn,o7 as Oe,o3 as _a,b1 as j,o6 as Ge,bu as ui,i2 as di,bA as Xe,aO as hn,w0 as cn,ak as gt,w1 as un,w2 as dn,q2 as gn,aU as L,aF as ai,ax as De,aG as It,w3 as _n,w4 as mn,w5 as ma,bx as va,bm as ni,dJ as vn,V as fn,L as Rt,k as gi,w6 as yn,w7 as fa,I as ct,bB as Ne,w8 as Ie,ns as Mn,cQ as me,aV as ya,aT as _i,rz as Ma,w9 as bn,j_ as Gi,cP as Sn,wa as xn,wb as Di,qJ as wn,aQ as te,i3 as ye,gK as On,hP as Pt,q9 as Ii,wc as En,cp as ce,ar as Tn,q8 as yt,N as An,no as ba,wd as Gn,we as Dn,C as $e,o5 as In,pu as Je,wf as $i,nk as $n,ki as le,wg as Rn,ag as ue,wh as Cn,av as Ln,wi as Ri,wj as Ci,qr as Pn,qu as zn,wk as Hn,O as oi,qs as Li,qx as Vn,qt as kn,T as Un,e3 as Xn,wl as Nn,n$ as Sa,aN as xa,aE as si,n_ as de,nX as pe,mj as Yn,pI as Zn,cM as Ht,wm as Pi,cr as Fn}from"./index-J0iiHjMT.js";import{q as Bn}from"./quantityFormatUtils-NiAiojad.js";import{x as jn}from"./TextOverlayItem-eCjvS6IO.js";import{l as qn,a as bt,u as ve,s as Ye,p as Wn,b as Kn,c as Me}from"./Tooltip-ON77BKb3.js";import{O as ge}from"./SnappingVisualizer3D-KWlqByBu.js";import{z as Zt,e as Ft,w as Nt}from"./GraphicState-2UcU5UAX.js";import{G as mi}from"./ExtendedLineVisualElement-YbjiXiBG.js";import{d as zi}from"./VerticesVisualElement-oQAA_hbc.js";import{K as Jn,X as Qn,g as to,V as Ze,l as eo,x as Hi}from"./editPlaneUtils-4qxd7h1E.js";import{k as io,o as ao,r as no}from"./surfaceCoordinateSystems-siQq4eBA.js";import{$ as et,e as w,w as Mt,k as wa,b as ne,v as Oa,F as Ea}from"./ShadedColorMaterial.glsl-Fp4o6LjC.js";import{n as kt}from"./manipulatorUtils-1y2yxq3d.js";import{c as ri}from"./Laserlines.glsl-nvjcCsAw.js";import{x as oo}from"./PointVisualElement-bX-_4FqS.js";import{T as vi,P as Ta,M as so,U as ro,k as lo,D as po,H as fi}from"./dragEventPipeline3D-4CqrlxD2.js";import{x as ho,z as co,d as lt,D as he,y as uo,q as ie,U as Aa,P as Kt,l as Fe,j as go,w as _o,C as Vi,O as mo}from"./InteractiveToolBase-WDic4GPF.js";import{S as vo}from"./GraphicManipulator-ku6oRBpa.js";import{V as Be,y as ki,N as fo,E as St,e as Ga}from"./EditGeometryOperations-TPE5Wzab.js";import{e as Re}from"./SnappingContext-6K6JmvvY.js";import{f as Ce}from"./SnappingDragPipelineStep-THHIXt-p.js";import{r as _e,a as je,l as yi,n as yo,c as Mo,p as bo}from"./TranslateTooltipInfos-J6BygtUO.js";import{y as Le,R as So,d as xo}from"./euclideanLengthMeasurementUtils-VQw5qWk6.js";import{o as wo}from"./automaticAreaMeasurementUtils-nVd6Y5mX.js";import{I as Oo,H as Eo,y as To,g as Ao,c as Go,C as Do,a as Io,h as $o,z as Da,B as Ui,d as Ro,N as Co,D as Lo}from"./SlicePlaneMaterial.glsl-RxywoUhm.js";import{l as Po}from"./Factory-m-O4WAoG.js";import{i as zo,p as Ho}from"./ExtentTooltipInfos-LPjFe37b.js";import"./vec4f32-NvfHy9q7.js";import"./EngineVisualElement-eZNKTKsI.js";import"./VisualElement-kjYXz27t.js";import"./RightAngleQuadVisualElement-y_W8r903.js";import"./Object3DVisualElement-TMb7y_wl.js";import"./measurementUtils-84-ZBArh.js";import"./dehydratedFeatureComparison-hdPq-zad.js";import"./SnappingOperation-2U48wt1k.js";import"./drawUtils-woTYaREB.js";import"./drapedUtils-9db1OpTX.js";import"./PointSnappingHint-ULetRXiW.js";import"./euclideanAreaMeasurementUtils-zmzttSyV.js";import"./ImageMaterial.glsl-TdPtjVc_.js";import"./LineVisualElement-4BP10o6v.js";const Vo=3025,ko={default:15,far:25};let at=class extends Yt{constructor(i){super(i),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const i=za(async t=>{const e=await Ha("esri/core/t9n/Units");Va(t),this._messagesUnits=e});this.addHandles([y(()=>[this.context!=null&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits],()=>this._update()),...["vertex-add","vertex-update","vertex-remove"].map(t=>ka(()=>{var e;return(e=this.context)==null?void 0:e.editGeometryOperations},t,()=>this._update())),Z(()=>i.abort()),y(()=>this._colors,t=>this._updateStyle(t))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return this._messagesUnits==null}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map(i=>i.label.text)}}get _edgeDistancePixels(){return ko[this.edgeDistance]}get _colors(){var t;const i=((t=this.context)==null?void 0:t.view.effectiveTheme.textColor)??He.fromArray([255,255,255]);return{textColor:i,backgroundColor:Ua(Xa(i,Na.Low),.6)}}_update(){if(this.destroyed)return;this._nextLabelIndex=0;const i=this.context;if(i==null)return void this._destroyUnusedLabels();const{components:t,geometry:e,coordinateHelper:n}=i.editGeometryOperations.data;if(!e)return void this._destroyUnusedLabels();const a=t.length;for(let o=0;o{s.push(n.toXYZ(g.pos))}),o===0&&this.stagedVertex!=null&&s.push(n.toXYZ(this.stagedVertex)),s.length<2)continue;const r=s[0],l=s[s.length-1];e.type==="polygon"&&s.length>2&&!Ya(r,l)&&s.push(r);const p=a===1&&!Za(s);let c=Uo,d=Xo;this.toScreenPointArray(i,r,c);for(let g=1;gMath.abs(it[1])?s.anchor=it[0]>0?"left":"right":s.anchor=-it[1]<0?"top":"bottom"}_getOrCreateLabel(i){var s;const t=this._labelInfos.length>this._nextLabelIndex,{textColor:e,backgroundColor:n}=this._colors;if(t){const r=this._labelInfos[this._nextLabelIndex++],{label:l}=r;return l.textColor=e,l.backgroundColor=n,r}const a=new jn({anchor:"center",fontSize:10,textColor:e,backgroundColor:n});(s=i.view.overlay)==null||s.items.add(a);const o={label:a};return this._labelInfos.push(o),this._nextLabelIndex=this._labelInfos.length,o}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:i}){var t,e;(e=(t=this.context)==null?void 0:t.view.overlay)==null||e.items.remove(i),i.destroy()}};h([u()],at.prototype,"context",void 0),h([u()],at.prototype,"stagedVertex",void 0),h([u()],at.prototype,"visible",void 0),h([u()],at.prototype,"edgeDistance",void 0),h([u()],at.prototype,"updating",null),h([u()],at.prototype,"_messagesUnits",void 0),h([u()],at.prototype,"_edgeDistancePixels",null),h([u()],at.prototype,"_colors",null),at=h([k("esri.views.interactive")],at);const it=re(),oe=re(),Uo=Ve(),Xo=Ve();let Pe=class extends at{getCameraOrExtent({view:t}){return t.state.camera}toScreenPointArray({view:t,elevationInfo:e,editGeometryOperations:n},a,o=Ve()){const{spatialReference:s}=n.data.coordinateHelper;return Ka(a,s,e,t,Xi),t.state.camera.projectToScreen(Xi,o),o}};Pe=h([k("esri.views.3d.interactive.SegmentLabels3D")],Pe);const Xi=H();function Mi(i){const{graphic:t}=i;return[y(()=>i.displaying,e=>{e?No(t):Ni(t)},{...Qt}),Z(()=>Ni(t))]}function No(i){const{geometry:t}=i;Ia(t)&&i.notifyMeshTransformChanged({action:ca.EnableFastUpdates})}function Ni(i){const{geometry:t}=i;Ia(t)&&i.notifyMeshTransformChanged({action:ca.DisableFastUpdates})}function Ia(i){return(i==null?void 0:i.type)==="mesh"&&!i.vertexSpace.isGeoreferenced}function Yo(i,t){const e=i==null?void 0:i.geometry;if(!i||(e==null?void 0:e.type)!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:a}=t,{camera:o}=t.state,{extent:s}=e,{center:r,spatialReference:l}=s,p=Ee(l),c=Ja(l),d=Ee(n.spatialReference),g=s.width*p,_=s.height*c,m=(s.zmax??0)*c,v=m-(s.zmin??0)*c,M=Math.max(g,_,v)/d,{x:b,y:f}=r,E=r.z??0;rt(be,b,f,E),n.toRenderCoords(be,l,be);const D=M/o.computeScreenPixelSizeAt(be);if(D>o.width*Fo)return"meshTooClose";if(Dthis.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:i,offset:t}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new tn({mode:i,offset:t})}normalizeCtorArgs(i){if(!i.elevationInfo){const t=i.hasZ??!0;return{...i,elevationInfo:en(t)}}return i}initializeGraphic(i){const{view:t}=this,e=this._createGraphicState=new Ft({graphic:i});return F([t.maskOccludee(i),t.trackGraphicState(e),y(()=>({element:this._outlineVisualElement,isDraped:e.isDraped}),({element:n,isDraped:a})=>{n&&(n.isDraped=a)},Qt),this._setupLoadingIndicator(e),...Mi(e)])}updateDrawMeshTooltipInfo(i){const{graphic:t,tooltipOptions:e,view:n}=this;i.tooltipOptions=e,i.viewType=n.type,i.helpMessage=Yo(t,this.view),this.updateElevation(i.elevation)}makeDrawOperation(){const{geometryType:i}=this,t=i!=="circle"&&i!=="rectangle";return new io({view:this.view,manipulators:this.manipulators,geometryType:Qn(i),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new ao(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new no(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new ge,segmentLabels:t?new Pe:null,labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions,isDraped:this._createGraphicState?this._createGraphicState.isDraped:Ei(this.hasZ,this.elevationInfo)==="on-the-ground",cursor:this.cursor})}onActiveVertexChanged(i){const{view:t}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[i],this._updateVerticalLineVisualElement(i),Z();const e=this._settings,n=e.manipulators.vertex,a=new zi({view:t,spatialReference:t.spatialReference,vertices:[i],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:n.size,outlineSize:n.outlineSize,renderOccluded:n.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=a;const o=e.visualElements.zVerticalLine,s=new mi({view:t,extensionType:o.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:Dt.OccludeAndTransparent,isDecoration:!0});this._verticalLineVisualElement=s;const r=F([y(()=>e.visualElements.zVerticalLine,l=>l.apply(s),$),y(()=>({selectedColor:Y(e.colors.selected),outlineColor:Y(e.manipulators.vertex.outlineColor)}),({selectedColor:l,outlineColor:p})=>{a.color=l,a.outlineColor=p},$),Z(()=>{this._activeVertexVisualElement=R(this._activeVertexVisualElement),this._verticalLineVisualElement=R(this._verticalLineVisualElement)})]);return a.attached=!0,r}_updateVerticalLineVisualElement(i){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:e,elevationProvider:n}=this.view;rt(jt,i[0],i[1],i[2]),Yi.setFromElevationInfo(this.elevationInfo),jt[2]=pi(jt,n,Yi,e),e.toRenderCoords(jt,this.view.spatialReference,jt)?(t.setStartEndFromWorldDownAtLocation(jt),t.attached=!0):t.attached=!1}onOutlineChanged(i){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=i,Z();const t=this.internalGraphicsLayer.elevationInfo,{view:e}=this,n=this._settings,a=new Nt({view:e,geometry:i,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:Ei(this.hasZ,t)==="on-the-ground",attached:!1,isDecoration:!0});this._outlineVisualElement=a;const o=F([y(()=>n.visualElements.lineGraphics.outline,s=>s.apply(a),$),y(()=>n.visualElements.lineGraphics.shadowStyle,s=>s.apply(a),$),Z(()=>{this._outlineVisualElement=R(this._outlineVisualElement)})]);return a.attached=!0,a.laserlineEnabled=!0,o}onRegularVerticesChanged(i){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=i,Z();const{view:t}=this,e=this._settings,n=e.manipulators.vertex,a=new zi({view:t,spatialReference:t.spatialReference,vertices:i,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:n.size,outlineSize:n.outlineSize,renderOccluded:n.renderOccluded,attached:!1,isDecoration:!0}),o=F([y(()=>({color:Y(e.manipulators.vertex.color),outlineColor:Y(e.manipulators.vertex.outlineColor)}),({color:s,outlineColor:r})=>{a.color=s,a.outlineColor=r},$),Z(()=>{this._verticesVisualElement=R(this._verticesVisualElement)})]);return a.attached=!0,this._verticesVisualElement=a,o}updateGraphicGeometry(i,t){if(this.geometryType==="mesh"&&(t==null?void 0:t.type)==="point"){const e=this.geometryToPlace;return e&&e.centerAt(t),void(e&&i.geometry===e?e.vertexSpace.isGeoreferenced?i.notifyGeometryChanged():i.notifyMeshTransformChanged():i.geometry=e)}super.updateGraphicGeometry(i,t)}_setupLoadingIndicator(i){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const e=Z(()=>{t.loading=!1});let n;const a=()=>n&&cancelAnimationFrame(n);return F([Xt(()=>i.displaying,()=>{a(),n=requestAnimationFrame(()=>e.remove())},{...Qt,once:!0}),Z(a),e])}};h([u({constructOnly:!0})],Bt.prototype,"elevationInfo",void 0),h([u({constructOnly:!0})],Bt.prototype,"geometryType",void 0),h([u()],Bt.prototype,"type",void 0),h([u({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=h([k("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],Bt);const Yi=new hi,jt=H();function jo(i){const t=bi(i);return nn(Math.cos(t),Math.sin(t))}function bi(i){if(i==null||i.type!=="polyline"&&i.type!=="polygon")return 0;const t=i.type==="polyline"?i.paths:i.rings;for(const e of t)for(let n=0;nan)return Math.atan2(o[1]-a[1],o[0]-a[0])}return 0}var st;(function(i){i[i.NONE=0]="NONE",i[i.ANY=1]="ANY",i[i.Z=2]="Z",i[i.XY=4]="XY"})(st||(st={}));var G;(function(i){i[i.TRANSLATE_Z=0]="TRANSLATE_Z",i[i.TRANSLATE_XY=1]="TRANSLATE_XY",i[i.SCALE=2]="SCALE",i[i.ROTATE=3]="ROTATE",i[i.SCALE_ROTATE=4]="SCALE_ROTATE"})(G||(G={}));let $a=class{constructor(){this.grabbingState=st.NONE,this.zManipulator=null,this.firstSelected=null,this.numSelected=0,this.firstGrabbedXY=null}update(t){this.grabbingState=st.NONE,this.zManipulator=null,this.numSelected=0,this.firstSelected=null,this.firstGrabbedXY=null,t.forEachManipulator((e,n)=>{if(n===G.TRANSLATE_Z&&(this.zManipulator=e),e instanceof et&&(e.selected&&(this.numSelected===0&&(this.firstSelected=e),this.numSelected++),this.firstGrabbedXY==null&&e.grabbing&&n===G.TRANSLATE_XY&&(this.firstGrabbedXY=e)),e.grabbing)switch(this.grabbingState|=st.ANY,n){case G.TRANSLATE_Z:this.grabbingState|=st.Z;break;case G.TRANSLATE_XY:this.grabbingState|=st.XY}})}};function qo(i){const{view:t,graphic:e}=i,n=new Ft({graphic:e}),a=Wo(i,n),o=[a,Ko(i,a.visualElement,n),t.maskOccludee(e),t.trackGraphicState(n)];return{visualElement:a.visualElement,remove:()=>ci(o)}}function Wo(i,t){const{view:e,graphic:n}=i,a=new Nt({view:e,geometry:li(n)?n.geometry:null,elevationInfo:z(n),attached:!1,isDecoration:!0}),o=new Zt({getTheme:()=>e.effectiveTheme}),s=()=>{a.attached=t.displaying},r=F([y(()=>o.visualElements.lineGraphics.outline,l=>l.apply(a),$),y(()=>o.visualElements.lineGraphics.shadowStyle,l=>l.apply(a),$),y(()=>t.displaying,s),y(()=>t.isDraped,l=>{a.isDraped=l}),t.on("changed",()=>a.geometry=li(n)?n.geometry:null),Gt(a)]);return s(),{visualElement:a,remove:()=>r.remove()}}function Ko(i,t,e){const{graphic:n,view:a}=i,o=[],s=z(n),r=s.mode==="on-the-ground"||!s.offset&&s.mode!=="absolute-height",l=new $a,p=new Zt({getTheme:()=>a.effectiveTheme}),c=p.visualElements,d=new mi({view:a,extensionType:c.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:Dt.OccludeAndTransparent,isDecoration:!0}),g=ke(c.heightPlaneAngleCutoff),_=new ri({view:a,attached:!1,angleCutoff:g,isDecoration:!0}),m=Te(1);o.push(y(()=>({lineShadowStyle:p.visualElements.lineGraphics.shadowStyle,pointShadowStyle:p.visualElements.pointGraphics.shadowStyle,alpha:m.value}),({lineShadowStyle:E,pointShadowStyle:D,alpha:V})=>{E.apply(t,V),D.apply(d,V)},$));const v=Te(1);o.push(y(()=>({heightPlane:p.visualElements.heightPlane,alpha:v.value}),({heightPlane:E,alpha:D})=>E.apply(_,D),$));const M=()=>{if(l.update(i),!e.displaying||r&&(e.isDraped||!li(n)||!n.geometry.hasZ))return t.laserlineEnabled=!1,d.attached=!1,void(_.attached=!1);t.laserlineEnabled=!0;const E=l.grabbingState&st.XY?c.laserlineAlphaMultiplier:1;m.value=E;const D=l.grabbingState&st.Z?c.laserlineAlphaMultiplier:1;v.value=D,Jo(d,l),Qo(i,t,_,l)};o.push(y(()=>p.visualElements.zVerticalLine,E=>E.apply(d),$)),o.push(e.on("changed",M),y(()=>e.displaying,M),t.events.on("attachment-origin-changed",M),Gt(d),Gt(_));const b=[],f=()=>{ci(b),b.length=0,i.forEachManipulator(E=>b.push(E.events.on("grab-changed",M))),i.forEachManipulator(E=>b.push(E.events.on("select-changed",M))),M()};return f(),o.push(i.onManipulatorsChanged(f),ua(()=>F(b))),F(o)}function Jo(i,t){const e=t.numSelected===1?t.firstSelected:t.numSelected>1&&t.firstGrabbedXY!=null?t.firstGrabbedXY:null;e!=null?(i.setStartEndFromWorldDownAtLocation(e.renderLocation),i.attached=!0):i.attached=!1}function Qo(i,t,e,n){if(n.numSelected>0){rt(Lt,0,0,0);let a=0;i.forEachManipulator((o,s)=>{s===G.TRANSLATE_XY&&o.selected&&o instanceof et&&(At(Lt,Lt,o.renderLocation),a++)}),a>0?(e.heightManifoldTarget=Vt(Lt,Lt,1/a),e.attached=!0):e.attached=!1}else{const a=t.attachmentOrigin;a!=null&&i.view.renderCoordsHelper.toRenderCoords(a,Lt)?(e.heightManifoldTarget=Lt,e.attached=!0):e.attached=!1}}function li(i){return i.geometry!=null&&(i.geometry.type==="polygon"||i.geometry.type==="polyline")}const Lt=H();function ts(i){const{view:t,graphic:e}=i,n=new Ft({graphic:e}),a=[],o=is(i,n,a);return es(i,n,a,o),a.push(t.trackGraphicState(n)),{visualElement:o,remove:()=>ci(a)}}function es(i,t,e,n){const{view:a,graphic:o}=i,s=new Zt({getTheme:()=>a.effectiveTheme}),r=new mi({view:a,extensionType:s.visualElements.zVerticalLine.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:Dt.OccludeAndTransparent,isDecoration:!0});e.push(y(()=>s.visualElements.zVerticalLine,f=>f.apply(r),$));const l=new ri({view:a,intersectsLineInfinite:!0,attached:!1,isDecoration:!0}),p=ke(s.visualElements.heightPlaneAngleCutoff),c=new ri({view:a,attached:!1,angleCutoff:p,isDecoration:!0}),d=z(i.graphic),g=hi.fromElevationInfo(d),_=d.mode==="on-the-ground"||!d.offset&&d.mode!=="absolute-height",m=new $a,v=Te(1);e.push(y(()=>({heightPlane:s.visualElements.heightPlane,alpha:v.value}),({heightPlane:f,alpha:E})=>f.apply(c,E),$));const M=Te(1);e.push(y(()=>({shadowStyle:s.visualElements.pointGraphics.shadowStyle,alpha:M.value}),({shadowStyle:f,alpha:E})=>f.apply(l,E),$));const b=()=>{m.update(i);const f=Si(o),E=_&&(t.isDraped||f==null||!f.hasZ);let D=!0;if(E||f==null)D=!1;else{const tt=pi(f,a.elevationProvider,g,a.renderCoordsHelper);rt(ot,f.x,f.y,tt),Ti(ot,f.spatialReference,ot,a.renderCoordsHelper.spatialReference),r.setStartEndFromWorldDownAtLocation(ot),l.intersectsWorldUpAtLocation=ot}const V=m.grabbingState&st.Z?s.visualElements.laserlineAlphaMultiplier:1;v.value=V;const N=sn(ss);!E&&t.displaying&&n.calculateMapBounds(N)&&Ti(rn(N,ot),a.spatialReference,ot,a.renderCoordsHelper.spatialReference)?(c.heightManifoldTarget=ot,c.attached=!0):c.attached=!1;const A=m.grabbingState&st.XY?s.visualElements.laserlineAlphaMultiplier:1;M.value=A;const q=D&&t.displaying&&!E;l.attached=q,r.attached=q};e.push(y(()=>[t.displaying,t.isDraped],b),t.on("changed",b)),i.forEachManipulator(f=>{e.push(f.events.on("grab-changed",b))}),e.push(Gt(l)),e.push(Gt(r)),e.push(Gt(c)),b()}function is(i,t,e){const{view:n,graphic:a}=i,o=new oo({view:n,geometry:Si(a),elevationInfo:z(a),isDecoration:!0});return as(i,o,t,e),e.push(Gt(o)),o}function Si(i){const t=i.geometry;return t==null?null:t.type==="point"?t:t.type==="mesh"?t.anchor.clone():null}function as(i,t,e,n){const a=()=>{t.attached=e.displaying},o=new Zt({getTheme:()=>i.view.effectiveTheme});ns(i,t,e,n),o.visualElements.pointGraphics.outline.apply(t),n.push(y(()=>e.displaying,a,$))}function ns(i,t,e,n){const{view:a,graphic:o}=i;let s=null;const r=p=>{s!=null&&(s.remove(),s=null),e.isDraped&&p!=null&&(s=os(a,p,()=>{t.geometry=p}))},l=()=>{const p=Si(o);r(p),t.geometry=p};n.push(e.on("changed",l),ua(()=>s)),l()}function os(i,t,e){const n=i.elevationProvider.spatialReference;ln(t,ot,n);const a=ot[0],o=ot[1];return i.elevationProvider.on("elevation-change",s=>{da(s.extent,a,o)&&e()})}const ot=H(),ss=on();function qe(i){switch(i.graphic.geometry.type){case"point":case"mesh":return ts(i);case"polygon":case"polyline":return qo(i);default:return null}}const Ra=128,ut=70,rs=80,Ca=.02,ls=54,ps=100,La=Math.ceil(ut/3*2),zt=160,Qe=.5,ti=24,qt=9,hs=zt+30,Zi=zt+53,cs=60,us=23,ds=5*Math.PI/12,gs=1*Math.PI/3,Fi=10,Bi=.2,ji=30,qi=53,Wi=.2,Ki=.3,_s=200,ms=3,vs=1e6;let fe=class{constructor(){this._available=!0}set location(t){this._forEachManipulator3D(e=>e.location=t)}set elevationAlignedLocation(t){this._forEachManipulator3D(e=>e.elevationAlignedLocation=t)}set elevationInfo(t){this._forEachManipulator3D(e=>e.elevationInfo=t)}get renderLocation(){let t;return this._forEachManipulator3D(e=>{t||(t=e.renderLocation)}),t}get available(){return this._available}set available(t){this._available=t,this._forEachManipulator3D(e=>e.available=t)}get hovering(){return this.someManipulator(t=>t.hovering)}get grabbing(){return this.someManipulator(t=>t.grabbing)}get dragging(){return this.someManipulator(t=>t.dragging)}hasManipulator(t){return this.someManipulator(e=>e===t)}someManipulator(t){let e=!1;return this.forEachManipulator(n=>{!e&&t(n)&&(e=!0)}),e}_forEachManipulator3D(t){this.forEachManipulator((e,n)=>{e instanceof et&&t(e,n)})}};function We(i,t,e,n){const a=(o,s)=>t({action:o,graphic:i,dxScreen:s.screenDeltaX,dyScreen:s.screenDeltaY});return e((o,s,r)=>(s.next(l=>(l.action==="start"&&a("start",l),l)).next(ho(i,n)).next(l=>{switch(l.action){case"start":case"update":(l.translationX||l.translationY||l.translationZ)&&a("update",l);break;case"end":a("end",l)}return l}),{steps:s,cancel:r=r.next(co(i)).next(l=>(a("end",{screenDeltaX:0,screenDeltaY:0}),l))}))}function ze(i){if((i==null?void 0:i.axis)==null)return 1;const{mapStart:t,mapEnd:e,axis:n}=i,a=[e.x-t.x,e.y-t.y];return a[0]*n[0]+a[1]*n[1]>0?1:-1}let fs=class extends fe{constructor(t){super(),this._handles=new Ue,this._arrowManipulatorInfos=new Array,this._angle=0,this._scale=1,this._radius=ut,this._updateAfterDrag=!1,this.events=new $t,this._tool=t.tool,this._view=t.view,this._opaqueMaterial=this._createMaterial(),this._transparentMaterial=this._createMaterial(.5),t.radius!=null&&(this._radius=t.radius),this._createManipulators(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}set orthogonalAvailable(t){this._arrowManipulatorInfos.length>=3&&(this._arrowManipulatorInfos[1].manipulator.available=t,this._arrowManipulatorInfos[3].manipulator.available=t)}destroy(){this._handles=R(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._arrowManipulatorInfos.length=0}forEachManipulator(t){for(const{manipulator:e}of this._arrowManipulatorInfos)t(e,G.TRANSLATE_XY)}createGraphicDragPipeline(t,e,n){const a=e.graphic,o=z(a),s=a.geometry.spatialReference;return We(a,n,r=>this.createDragPipeline((l,p,c,d,g)=>({steps:p,cancel:c}=t(l,p,c,d,g),r(l,p,c)),o,s,a),this._view.state.viewingMode)}createDragPipeline(t,e,n,a){return F(this._arrowManipulatorInfos.map(({manipulator:o},s)=>lt(o,(r,l,p,c,d)=>{const g=l.next(_=>({..._,manipulatorType:G.TRANSLATE_XY})).next(he(this._view,r.elevationAlignedLocation)).next(vi(this._view,r.elevationAlignedLocation,e,n,a)).next(uo(r.location,this.angle+(s+1)*Math.PI*.5)).next(ie());t(r,g,p,c,d)})))}get angle(){return this._angle}set angle(t){this._angle=t,this.dragging?this._updateAfterDrag=!0:this._updateManipulatorTransform()}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get radius(){return this._radius}set radius(t){this._radius!==t&&(this._radius=t,this._updateManipulators())}_updateManipulators(){for(let t=0;t{this._updateAfterDrag&&a.action==="end"&&!this.dragging&&(this._updateManipulatorTransform(),this._updateAfterDrag=!1)})),n}_createMaterial(t=1){const e=new ui({cullFace:di.Back,renderOccluded:Dt.Transparent,isDecoration:!0});return this._handles.add(y(()=>He.toUnitRGBA(this._view.effectiveTheme.accentColor),n=>{n[3]*=t,e.setParameters({color:n})},$)),e}get test(){return{arrowManipulators:this._arrowManipulatorInfos.map(({manipulator:t})=>t)}}},ys=class{constructor(){this._view=null,this._elevationInfo=null,this._lastDragEvent=null,this._next=null,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null&&this._next!=null){const e=this._lastDragEvent.mapEnd,n=this._snap(this._lastDragEvent.screenEnd);if(n!=null){const a={action:"update",mapStart:this._lastDragEvent.mapStart,mapEnd:t===!0?n:e,screenStart:this._lastDragEvent.screenEnd,screenEnd:this._lastDragEvent.screenEnd};this._next.execute(a)}}this._enabled=t}_snap(t){const e=this._view!=null?this._view.toMap(t,{exclude:[]}):null;return e!=null&&this._view!=null&&(e.z=hn(e,this._view,this._elevationInfo)),e}createDragEventPipelineStep(t,e){this._view=t,this._elevationInfo=e,this._lastDragEvent=null;const n=new Aa;return this._next=n,[a=>{if(this._lastDragEvent=a.action!=="end"?{...a}:null,this._enabled){const o=this._snap(a.screenEnd);return o!=null?{action:a.action,mapStart:a.mapStart,mapEnd:o,screenStart:a.screenStart,screenEnd:a.screenEnd}:null}return{action:a.action,mapStart:a.mapStart,mapEnd:a.mapEnd,screenStart:a.screenStart,screenEnd:a.screenEnd}},n]}};class Ms extends fe{constructor(t){super(),this._handles=new Ue,this._snapToScene=new ys,this._scale=1,this._radius=ut,this._view=t.view,this._tool=t.tool,this._discMaterial=this._createMaterial(),this._discMaterialTransparent=this._createMaterial(.5),t.snapToScene!=null&&(this.snapToScene=t.snapToScene),t.radius!=null&&(this._radius=t.radius),this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this._handles=R(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null}forEachManipulator(t){t(this._manipulator,G.TRANSLATE_XY)}get displayScale(){return this._scale}set displayScale(t){this._scale=t,this._updateManipulatorTransform()}get snapToScene(){return this._snapToScene.enabled}set snapToScene(t){this._snapToScene.enabled=t}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}createGraphicDragPipeline(t,e,n){const a=e.graphic,o=z(a),s=a.geometry.spatialReference;return We(a,n,r=>this.createDragPipeline((l,p,c,d,g)=>({steps:p,cancel:c}=t(l,p,c,d,g),r(l,p,c)),o,s,a),this._view.state.viewingMode)}createDragPipeline(t,e,n,a){const o=this._view;return lt(this._manipulator,(s,r,l,p,c)=>{const d=r.next(he(o,s.elevationAlignedLocation)).next(vi(o,s.elevationAlignedLocation,e,n,a)).next(...this._snapToScene.createDragEventPipelineStep(o,e)).next(g=>({...g,manipulatorType:G.TRANSLATE_XY})).next(ie());t(s,d,l,p,c)})}_updateManipulatorTransform(){const t=Ge(B.get(),rt(x.get(),this.displayScale,this.displayScale,this.displayScale));this._manipulator.modelTransform=t}_createManipulator(){const t=this._view;this._manipulator=new et({view:t,worldSized:!1,autoScaleRenderObjects:!1,focusMultiplier:1,touchMultiplier:1,collisionType:{type:"disc",direction:j(0,0,1)},worldOriented:!0}),this._updateManipulator()}_updateManipulator(){const t=cn(this._discMaterial,Ca,1,Ra,j(0,0,1),j(0,0,0));t.transformation=Ge(Xe(),j(this._radius,this._radius,this._radius)),this._manipulator.renderObjects=[new w(t,O.Focused),new w(t.instantiate({material:this._discMaterialTransparent}),O.Unfocused)],this._manipulator.radius=rs*(this._radius/ut)}_createMaterial(t=1){const e=new ui({cullFace:di.Back,renderOccluded:Dt.Transparent,isDecoration:!0});return this._handles.add(y(()=>He.toUnitRGBA(this._view.effectiveTheme.accentColor),n=>{n[3]*=t,e.setParameters({color:n})},$)),e}get test(){return{discManipulator:this._manipulator}}}class bs extends fe{constructor(t){super(),this._radius=ut,this.events=new $t,this._tool=t.tool,this._view=t.view;const e=new Zt({getTheme:()=>this._view.effectiveTheme});this._settings=e,t.radius!=null&&(this._radius=t.radius);const n=this._view.effectiveTheme.accentColor;this._materials={materialUnfocused:Mt(this._createDarkenedColor(n,1,.25),Dt.Occlude),materialFocused:Mt(this._createDarkenedColor(n,1,0),Dt.Occlude),materialOccludedUnfocused:Mt(this._createDarkenedColor(n,.7,0),e.zManipulator.renderOccluded),materialOccludedFocused:Mt(this._createDarkenedColor(n,.85,0),e.zManipulator.renderOccluded)},this._themeHandle=y(()=>this._view.effectiveTheme.accentColor,a=>{const o=this._createDarkenedColor(a,1,.25),s=this._createDarkenedColor(a,1,0),r=this._createDarkenedColor(a,.7,0),l=this._createDarkenedColor(a,.85,0),{materialUnfocused:p,materialFocused:c,materialOccludedUnfocused:d,materialOccludedFocused:g}=this._materials;p.setParameters({color:o}),c.setParameters({color:s}),d.setParameters({color:r}),g.setParameters({color:l})}),this._createManipulator(),this.forEachManipulator(a=>this._tool.manipulators.add(a))}destroy(){this._themeHandle=gt(this._themeHandle),this._manipulator.applyObjectTransform=xs,this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){t(this._manipulator,G.TRANSLATE_Z)}createGraphicDragPipeline(t,e,n){const a=e.graphic.geometry.spatialReference;return We(e.graphic,n,o=>this.createDragPipeline((s,r,l,p,c)=>({steps:r,cancel:l}=t(s,r,l,p,c),o(s,r,l)),a),this._view.state.viewingMode)}createDragPipeline(t,e){const n=this._view;return lt(this._manipulator,(a,o,s,r,l)=>{const p=o.next(c=>({...c,manipulatorType:G.TRANSLATE_Z})).next(Ta(n,a.renderLocation,e)).next(ie());t(a,p,s,r,l)})}get radius(){return this._radius}set radius(t){t!==this._radius&&(this._radius=t,this._updateManipulator())}_updateManipulator(){const t=this._settings,e=this._radius/ut,n=t.zManipulator.height*e,a=t.zManipulator.coneHeight*e,o=t.zManipulator.coneWidth*e,s=t.zManipulator.width*e,r=[j(0,0,0),j(0,0,n)],l=[j(0,0,0),j(0,0,n+a)],p=b=>{const f=Xe();if(mn(f,f,[0,0,n]),ma(f,f,Math.PI/2),b){const E=1+2*b/o;va(f,f,[E,E,E])}return f},c=p(0),{materialUnfocused:d,materialFocused:g,materialOccludedUnfocused:_,materialOccludedFocused:m}=this._materials,v=un(d,r,s/2,16,!1),M=dn(d,a,o/2,16,!1);M.transformation=c,this._manipulator.renderObjects=[new w(M,O.Unfocused),new w(v,O.Unfocused),new w(M.instantiate({material:g}),O.Focused),new w(v.instantiate({material:g}),O.Focused),new w(M.instantiate({material:_}),O.Unfocused),new w(v.instantiate({material:_}),O.Unfocused),new w(M.instantiate({material:m}),O.Focused),new w(v.instantiate({material:m}),O.Focused)],this._manipulator.radius=s/2+2,this._manipulator.collisionType={type:"line",paths:[l]}}_createManipulator(){const t=this._view,e=new et({view:t,autoScaleRenderObjects:!1,worldSized:!1,selectable:!1,cursor:"ns-resize",elevationInfo:this.elevationInfo,worldOriented:!0,collisionPriority:1.6});e.applyObjectTransform=n=>{const a=t.state.camera,o=Ji;t.renderCoordsHelper.toRenderCoords(this._manipulator.elevationAlignedLocation,o);const s=gn(a.eye,o),r=a.computeRenderPixelSizeAtDist(s),l=L(Wt,o,a.eye);ai(l,l);const p=Ss;t.renderCoordsHelper.worldUpAtPosition(Ji,p);const c=Math.abs(De(l,p)),d=It(Wt,l,p),g=It(Wt,d,p),_=ni(c,.01,1),m=1-Math.sqrt(1-_*_)/_/a.fullWidth,v=this._settings,M=this._radius/ut,b=v.zManipulator.width*M;Vt(g,ai(g,g),(1/m-1)*s+r*b),n[12]-=Wt[0],n[13]-=Wt[1],n[14]-=Wt[2]},this._manipulator=e,this._updateManipulator()}_createDarkenedColor(t,e,n){const a=_n(t,n);return a.a*=e,He.toUnitRGBA(a)}get test(){return{manipulator:this._manipulator}}}const Ji=H(),Wt=H(),Ss=H(),xs=()=>{};let Ut=class extends fe{constructor(t){super(),this._handles=new Ue,this._interactive=!0;const{tool:e,view:n,snapToScene:a,radius:o}=t;this._view=n,this.xyManipulation=new Ms({tool:e,view:n,snapToScene:a,radius:o}),this.xyAxisManipulation=new fs({tool:e,view:n,radius:o}),this.zManipulation=new bs({tool:e,view:n,radius:o}),this.xyManipulation.available=t.xyAvailable,this.xyAxisManipulation.available=t.xyAxisAvailable,this.zManipulation.available=t.zAvailable,this._autoHideXYAxis(),this.forEachManipulator(s=>this._handles.add(s.events.on("grab-changed",()=>this._updateManipulatorInteractivity())))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createGraphicDragPipeline(t,e,n){return F([this.xyManipulation.createGraphicDragPipeline((a,o,s,r,l)=>t(S.XY,a,o,s,r,l),e,n),this.xyAxisManipulation.createGraphicDragPipeline((a,o,s,r,l)=>t(S.XY_AXIS,a,o,s,r,l),e,n),this.zManipulation.createGraphicDragPipeline((a,o,s,r,l)=>t(S.Z,a,o,s,r,l),e,n)])}createDragPipeline(t,e,n,a){return F([this.xyManipulation.createDragPipeline((o,s,r,l,p)=>t(S.XY,o,s,r,l,p),e,n,a),this.xyAxisManipulation.createDragPipeline((o,s,r,l,p)=>t(S.XY_AXIS,o,s,r,l,p),e,n,a),this.zManipulation.createDragPipeline((o,s,r,l,p)=>t(S.Z,o,s,r,l,p),n)])}set snapToScene(t){this.xyManipulation.snapToScene=t}set angle(t){this.xyAxisManipulation.angle=t}set interactive(t){this._interactive!==t&&(this._interactive=t,this._updateManipulatorInteractivity())}set radius(t){this.xyAxisManipulation.radius=t,this.xyManipulation.radius=t,this.zManipulation.radius=t}set displayScale(t){this.xyManipulation.displayScale=t,this.xyAxisManipulation.displayScale=t}forEachManipulator(t){this.xyManipulation.forEachManipulator(e=>t(e,G.TRANSLATE_XY)),this.xyAxisManipulation.forEachManipulator(e=>t(e,G.TRANSLATE_XY)),this.zManipulation.forEachManipulator(e=>t(e,G.TRANSLATE_Z))}get _xyAxisVisible(){const t=this.xyManipulation.someManipulator(e=>e.focused)||this.xyAxisManipulation.someManipulator(e=>e.focused);return this._view.inputManager&&this._view.inputManager.latestPointerType==="touch"||t}_autoHideXYAxis(){const t=this.xyAxisManipulation,e=this.xyManipulation;if(vn("esri-mobile"))return;const n=[];e.forEachManipulator(o=>n.push(o)),t.forEachManipulator(o=>n.push(o));const a=()=>{const o=[];this._xyAxisVisible||t.forEachManipulator(s=>o.push(s.disableDisplay())),this._handles.remove(Qi),this._handles.add(o,Qi)};for(const o of n)this._handles.add(o.events.on("focus-changed",a));this._view.inputManager&&this._handles.add(Xt(()=>{var o;return(o=this._view.inputManager)==null?void 0:o.latestPointerType},a)),a()}_updateManipulatorInteractivity(){const t=this.grabbing;this.forEachManipulator(e=>{e.interactive=!t&&this._interactive||e.grabbing})}static radiusForSymbol(t){const e=t!=null&&t.type==="point-3d"&&t.symbolLayers;return e&&e.some(n=>n.type==="icon")?La:ut}};const Qi="disable-xy-axis-display";var S;(function(i){i[i.XY=0]="XY",i[i.XY_AXIS=1]="XY_AXIS",i[i.Z=2]="Z"})(S||(S={}));class xi extends fe{constructor(t){super(),this._view=t.view,this._tool=t.tool,this._graphicState=t.graphicState,this._createManipulator(),this.forEachManipulator(e=>this._tool.manipulators.add(e))}destroy(){this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphicState=null}forEachManipulator(t){t(this._manipulator,G.TRANSLATE_XY)}createGraphicDragPipeline(t){return We(this._graphicState.graphic,t,e=>this.createDragPipeline(e),this._view.state.viewingMode)}createDragPipeline(t){const e=this._view,n=this._graphicState.graphic,a=n.geometry!=null?n.geometry.spatialReference:null;return lt(this._manipulator,(o,s,r,l,p)=>{const c=s.next(so(p,e,n,a)).next(Kt()).next(ie());t(o,c,r,l,p)})}_createManipulator(){const t=this._view,e=this._graphicState.graphic;this._manipulator=new vo({graphic:e,view:t,selectable:!0,cursor:"move"})}}let ws=class{constructor(t){this.allGraphics=t,this.type="graphic-move-start"}};class Os{constructor(t,e,n){this.dx=t,this.dy=e,this.allGraphics=n,this.type="graphic-move"}}class ta{constructor(t){this.allGraphics=t,this.type="graphic-move-stop"}}const pt="manipulators";let dt=class extends $t.EventedMixin(Fe){constructor(i){super(i),this._infos=new Map,this.graphics=new fn,this.enableZ=!0,this.tooltipOptions=new Rt,this.type="move-3d",this._updatingHandles=new gi,this._moveManipulation=null,this._tooltip=null,this._translateGraphicTooltipInfo=null,this._translateGraphicXYTooltipInfo=null,this._translateGraphicZTooltipInfo=null}initialize(){const{view:i}=this;this.addHandles([this.graphics.on("change",e=>{e.removed.forEach(n=>this.removeHandles(n)),this._updateGraphicInfos(e),this._setupFastTransformUpdates(e.added),this._refreshManipulators()}),y(()=>this.tooltipOptions.enabled,e=>{this._tooltip=e?new ve({view:i}):R(this._tooltip)},Qt)]);const t=this.graphics.toArray();this._updateGraphicInfos({added:t,removed:[]}),this._setupFastTransformUpdates(t),this._refreshManipulators(),this.finishToolCreation()}destroy(){this._tooltip=R(this._tooltip),this._moveManipulation=R(this._moveManipulation),this._set("view",null),this._updatingHandles.destroy()}get updating(){return this._updatingHandles.updating}reset(){}_updateGraphicInfos({added:i,removed:t}){var e;for(const n of i){if(yn(n)!==fa.SUPPORTED)continue;const a=new Es(n),o=this.view.trackGraphicState(a.state);this._infos.set(a.graphic,{info:a,handle:o})}for(const n of t)(e=this._infos.get(n))==null||e.handle.remove(),this._infos.delete(n)}_setupFastTransformUpdates(i){for(const t of i){const{info:e}=this._infos.get(t);this.addHandles(Mi(e.state),t)}}_refreshManipulators(){if(this.removeHandles(pt),this._moveManipulation=R(this._moveManipulation),this.manipulators.removeAll(),this._infos.size===0)return;const i=Array.from(this._infos.values(),({info:t})=>t);this._createManipulators(i),this._createVisualElements(i),this._updateMoveManipulation(i)}_createManipulators(i){for(const t of i){const e=t.state;t.manipulationXY=new xi({tool:this,view:this.view,graphicState:e}),t.manipulationXY.forEachManipulator(n=>this.addHandles([n.events.on("immediate-click",a=>{this.emit("immediate-click",{...a,graphic:e.graphic}),a.stopPropagation()}),n.events.on("grab-changed",({action:a})=>{const{tooltipOptions:o,_tooltip:s}=this;s!=null&&(a==="start"?(this._translateGraphicTooltipInfo??(this._translateGraphicTooltipInfo=new _e({tooltipOptions:o})),s.info=this._translateGraphicTooltipInfo,s.info.tooltipOptions=o,s.info.distance=ct):s.clear())})],pt)),this.addHandles(t.manipulationXY.createDragPipeline((n,a,o,s)=>this._buildDragEventPipeline(i,S.XY,n,a,o,s)),pt)}this._createMoveManipulation(i)}_createMoveManipulation(i){const t=new Ut({tool:this,view:this.view,snapToScene:!1,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:!0,radius:i.length===1?Ut.radiusForSymbol(i[0].graphic.symbol):ut});this._moveManipulation=t,t.elevationInfo={mode:"absolute-height",offset:0},t.forEachManipulator(o=>{this.addHandles(o.events.on("immediate-click",s=>{t.zManipulation.hasManipulator(o)||this.graphics.length!==1||this.emit("immediate-click",{...s,graphic:this.graphics.at(0)}),s.stopPropagation()}),pt)});const e=o=>s=>{this.addHandles(s.events.on("focus-changed",({action:r})=>{const l=this._tooltip;l!=null&&(r==="focus"?this._updateMoveTooltip(i,o):l.clear())}),pt)};this._moveManipulation.xyManipulation.forEachManipulator(e(S.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(S.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(S.Z));const n=()=>this._updateMoveManipulation(i);for(const o of i)this.addHandles([o.state.on("changed",n),y(()=>o.state.displaying,n)],pt);const a=i[i.length-1];this.addHandles(a.state.on("changed",()=>this._updateMoveManipulationAngle(a)),pt),this.addHandles(t.createDragPipeline((o,s,r,l,p)=>this._buildDragEventPipeline(i,o,s,r,l,p),z(a.graphic),a.graphic.geometry.spatialReference,a.graphic),pt),this._updateMoveManipulationAngle(a)}_createVisualElements(i){for(const t of i){const e=t.graphic,n=qe({view:this.view,graphic:e,forEachManipulator:a=>{var o,s;(o=t.manipulationXY)==null||o.forEachManipulator(a),(s=this._moveManipulation)==null||s.forEachManipulator(a)},onManipulatorsChanged:()=>Z()});n!=null&&(t.geometryRepresentation=n.visualElement,t.geometryRepresentation instanceof Nt&&this.addHandles([t.geometryRepresentation.events.on("attachment-origin-changed",()=>{t.state.isDraped||this._updateMoveManipulation(i)}),y(()=>t.state.isDraped,()=>this._updateMoveManipulation(i))],pt),this.addHandles(n,pt))}}_updateMoveManipulationAngle(i){this._moveManipulation&&(this._moveManipulation.angle=bi(i.graphic.geometry))}_updateMoveManipulation(i){const t=Ne(0,0,0,this.view.spatialReference);let e=0,n=!1;const a=this._moveManipulation;if(a){for(const o of i){if(!o.state.displaying)continue;const s=o.state.graphic;this.enableZ&&kt(s)&&(n=!0);const r=o.geometryRepresentation instanceof Nt&&!o.state.isDraped?o.geometryRepresentation.attachmentOrigin:wa(this.view,s);if(r!=null){const{x:l,y:p,z:c}=r;t.x+=l,t.y+=p,c&&(t.z??(t.z=0),t.z+=c),e++}}e>0?(t.x/=e,t.y/=e,t.z??(t.z=0),t.z/=e,a.location=t,a.xyManipulation.available=!0,a.xyAxisManipulation.available=!0,a.zManipulation.available=n):a.available=!1}}_buildDragEventPipeline(i,t,e,n,a,o){const s=[],r=[];let l=null,p=null;const c=()=>{for(const d of s)d.dragging=!1;s.length=0,r.length=0,l=null,p=null,this._moveManipulation&&(this._moveManipulation.interactive=!0)};if(i.length===1&&t===S.XY){const d=i[0].graphic;({steps:n,cancel:a}=this._buildSnappingPipelineSteps(d,z(d),n,a,o))}return a=a.next(d=>p==null?void 0:p(d)).next(()=>(this.emit("graphic-move-stop",new ta(r)),this.destroyed||c(),null)),{steps:n=n.next(d=>{var g,_;if(d.action==="start"){s.length=0,r.length=0;for(const m of i)m.dragging||!((g=m.manipulationXY)!=null&&g.hasManipulator(e))&&((_=m.manipulationXY)!=null&&_.grabbing)||(s.push(m),r.push(m.graphic),m.dragging=!0);if(r.length!==0&&(this._moveManipulation&&(this._moveManipulation.interactive=!1),l=go(r,this.view.state.viewingMode),p=_o(r),this.emit("graphic-move-start",new ws(r)),this.destroyed))return null}return r.length!==0?d:null}).next(d=>l==null?void 0:l(d)).next(d=>(this._updateMoveTooltip(i,t,d),d)).next(d=>{switch(d.action){case"start":case"update":if(d.translationX||d.translationY||d.translationZ){const g=this.view.toScreen(d.mapStart),_=this.view.toScreen(d.mapEnd),m=_.x-g.x,v=_.y-g.y;if(this.emit("graphic-move",new Os(m,v,r)),this.destroyed)return null}break;case"end":if(this.emit("graphic-move-stop",new ta(r)),this.destroyed)return null;c()}return null}),cancel:a}}_updateMoveTooltip(i,t,e){const{tooltipOptions:n,_tooltip:a}=this;if(a==null)return;a.clear();const o=i.length===0?"absolute-height":i[0].state.isDraped?"on-the-ground":"absolute-height";switch(t){case S.XY:a.info=this._translateGraphicTooltipInfo??(this._translateGraphicTooltipInfo=new _e({tooltipOptions:n})),this._updateMoveTooltipDistance(a.info,e,(s,r)=>bt(s,r,o));break;case S.XY_AXIS:a.info=this._translateGraphicXYTooltipInfo??(this._translateGraphicXYTooltipInfo=new yi({tooltipOptions:n})),this._updateMoveTooltipDistance(a.info,e,(s,r)=>{const l=bt(s,r,o);return Ie(l,ze(e))});break;case S.Z:a.info=this._translateGraphicZTooltipInfo??(this._translateGraphicZTooltipInfo=new je({tooltipOptions:n})),this._updateMoveTooltipDistance(a.info,e,Le)}a.info.tooltipOptions=n}_updateMoveTooltipDistance(i,t,e){if(t!=null&&t.action!=="end"){const{mapStart:n,mapEnd:a}=t,o=e(n,a);i.distance=o??ct}else i.distance=ct}_buildSnappingPipelineSteps(i,t,e,n,a){const o=i.geometry;if(o==null||o.type!=="point"&&o.type!=="mesh")return{steps:e,cancel:n};const s=(o.type==="point"?o:o.anchor).clone(),r=new Re({elevationInfo:t,pointer:a,editGeometryOperations:Be.fromGeometry(s,this.view.state.viewingMode),visualizer:new ge,excludeFeature:i}),l=this.snappingManager,{snappingStep:p,cancelSnapping:c}=Ce({snappingContext:r,snappingManager:l,updatingHandles:this._updatingHandles});return n=n.next(c),{steps:e=e.next(d=>(s.z=Mn(this.view,s,z(i),{mode:"absolute-height",offset:0}),{...d,snapOrigin:r.coordinateHelper.pointToVector(s)})).next(...p),cancel:n}}get test(){return{tooltip:this._tooltip}}};h([u({constructOnly:!0,nonNullable:!0})],dt.prototype,"view",void 0),h([u()],dt.prototype,"graphics",void 0),h([u({constructOnly:!0,nonNullable:!0})],dt.prototype,"enableZ",void 0),h([u({constructOnly:!0,type:Rt})],dt.prototype,"tooltipOptions",void 0),h([u({constructOnly:!0})],dt.prototype,"snappingManager",void 0),h([u()],dt.prototype,"type",void 0),h([u()],dt.prototype,"updating",null),dt=h([k("esri.views.3d.interactive.editingTools.graphicMove3D.GraphicMoveTool")],dt);class Es{constructor(t){this.geometryRepresentation=null,this.manipulationXY=null,this.dragging=!1,this.state=new Ft({graphic:t})}get graphic(){return this.state.graphic}}function ea(i,t,e){const n=e.mode==="on-the-ground"?ki.XY:ki.XYZ;return new fo(i,n,t,0)}function ia(i,t,e){const n=H();if(!i.renderCoordsHelper.toRenderCoords(t,n))return null;const a=aa(i,t,me(e.plane)),o=aa(i,t,e.edgeDirection);if(a==null||o==null)return null;const s=It(H(),a,o);return ya(n,s,_i())}function aa(i,t,e){const n=Ne(t.x+e[0],t.y+e[1],t.z+e[2],t.spatialReference),a=H(),o=H();return i.renderCoordsHelper.toRenderCoords(t,a)&&i.renderCoordsHelper.toRenderCoords(n,o)?Ma(o,a,o):null}function Ts(i,t,e){const n=me(i),a=Ma(H(),t,e),o=It(H(),a,n),s=It(H(),a,o);return bn(a[0],a[1],a[2],0,o[0],o[1],o[2],0,s[0],s[1],s[2],0,0,0,0,1)}function As(i,t,e){const n=e.projectToRenderScreen(i,Gi()),a=e.projectToRenderScreen(t,Gi());return n!=null&&a!=null?Sn(L(n,n,a)):0}let Tt=class extends Ye{constructor(t){super(t),this.type="reshape-edge-offset",this.distance=ct,this.area=null,this.totalLength=null}};h([u()],Tt.prototype,"type",void 0),h([u()],Tt.prototype,"distance",void 0),h([u()],Tt.prototype,"area",void 0),h([u()],Tt.prototype,"totalLength",void 0),Tt=h([k("esri.views.interactive.tooltip.ReshapeEdgeOffsetTooltipInfo")],Tt);let C=class extends $t.EventedMixin(Yt){constructor(t){super(t),this._selectedIndex=0,this._manipulatorHandles=new Ue,this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0,this._reshapeEventState=I.NONE,this._updatingHandles=new gi,this._recreatingManipulators=!1,this._settings=new Zt({getTheme:()=>this.view.effectiveTheme}),this._translateGraphicTooltipInfo=null,this._translateGraphicXYTooltipInfo=null,this._translateGraphicZTooltipInfo=null,this._translateVertexTooltipInfo=null,this._translateVertexXYTooltipInfo=null,this._translateVertexZTooltipInfo=null,this._edgeOffsetTooltipInfo=null,this.outputGeometry=null,this._vertexLaserLineVisualElement=null}initialize(){const{graphic:t,view:e}=this,n=this._settings.manipulators,a=n.vertex;this._vertexManipulatorMaterial=Mt(Y(a.color),a.renderOccluded),this._vertexManipulatorOutlineMaterial=ne(Y(a.outlineColor),a.renderOccluded),this._vertexManipulatorHoverOutlineMaterial=ne(Y(a.hoverOutlineColor),a.renderOccluded);const o=n.edge;this._edgeManipulatorMaterial=Mt(Y(o.color),o.renderOccluded),this._edgeManipulatorOutlineMaterial=ne(Y(o.outlineColor),o.renderOccluded);const s=n.edgeOffset;this._edgeOffsetManipulatorMaterial=Mt(Y(s.color),s.renderOccluded,!1),this._edgeOffsetManipulatorHoverMaterial=Mt(Y(s.hoverColor),s.renderOccluded,!1);const r=n.selected;this._selectedManipulatorMaterial=Mt(Y(r.color),r.renderOccluded),this._selectedManipulatorOutlineMaterial=ne(Y(r.outlineColor),r.renderOccluded),this._selectedManipulatorHoverOutlineMaterial=ne(Y(r.hoverOutlineColor),r.renderOccluded);const l=this._graphicState=new Ft({graphic:t});this._tooltip=new ve({view:e}),this.addHandles([y(()=>{const p=this._settings.manipulators;return{vertexSettings:p.vertex,edgeSettings:p.edge,edgeOffsetSettings:p.edgeOffset,selectedSettings:p.selected}},({vertexSettings:p,edgeSettings:c,edgeOffsetSettings:d,selectedSettings:g})=>{p.applyColor(this._vertexManipulatorMaterial),p.applyOutline(this._vertexManipulatorOutlineMaterial),p.applyHoverOutline(this._vertexManipulatorHoverOutlineMaterial),c.applyColor(this._edgeManipulatorMaterial),c.applyOutline(this._edgeManipulatorOutlineMaterial),d.applyColor(this._edgeOffsetManipulatorMaterial),d.applyHover(this._edgeOffsetManipulatorHoverMaterial),g.applyColor(this._selectedManipulatorMaterial),g.applyOutline(this._selectedManipulatorOutlineMaterial),g.applyHoverOutline(this._selectedManipulatorHoverOutlineMaterial)}),y(()=>l.displaying,p=>{for(const c of this._manipulatorInfos)c.manipulator.available=p}),y(()=>({labels:this._segmentLabels,enabled:this._labelOptions.enabled,edgeOffsetEnabled:this.enableEdgeOffset}),({labels:p,enabled:c,edgeOffsetEnabled:d})=>{p!=null&&(p.visible=c,p.edgeDistance=d?"far":"default")},$),Xt(()=>!this._tooltipOptions.enabled,()=>this._tooltip.clear(),$),this.view.trackGraphicState(l)])}destroy(){this._segmentLabels=R(this._segmentLabels),this._tooltip=R(this._tooltip),this._removeManipulators(),this._updatingHandles.destroy()}get inputGeometry(){return this._editGeometryOperations!=null?this._editGeometryOperations.data.geometry:null}set inputGeometry(t){this._recreateEditGeometryAndManipulators(t)}get updating(){return this._updatingHandles.updating}get manipulators(){return this.tool.manipulators}get view(){return this.tool.view}get graphic(){return this.tool.graphic}get enableZShape(){return this.tool.enableZShape}get enableZVertex(){return this.tool.enableZVertex}get enableMoveGraphic(){return this.tool.enableMoveGraphic}get enableMidpoints(){return this.tool.enableMidpoints}get enableEdgeOffset(){return this.tool.enableEdgeOffset}get _labelOptions(){return this.tool.labelOptions}get _tooltipOptions(){return this.tool.tooltipOptions}get _accentColor(){return this.view.effectiveTheme.accentColor}removeSelectedVertices(){const t=this._manipulatorInfos.filter(e=>e.manipulator.selected&&e.type==="vertex");this._removeVertices(t)}onManipulatorSelectionChanged(){this.emit("manipulators-changed")}_removeManipulators(){this._manipulatorHandles.removeAll(),this._moveManipulation=R(this._moveManipulation),this._graphicMoveManipulation=R(this._graphicMoveManipulation),this.manipulators.removeAll(),this._manipulatorInfos=[],this._numGrabbing=0,this._numDragging=0}_createManipulators(t){if(this._editGeometryOperations==null)return;const e=z(this.graphic);for(const n of this._editGeometryOperations.data.components){const a=t==null?void 0:t.byComponentIndex.get(n.index);for(const o of n.vertices){const s=a==null?void 0:a.has(o.index);this._createVertexOrEdgeManipulator(o,e,s)}for(const o of n.edges)this._createVertexOrEdgeManipulator(o,e)}this._createGraphicMoveManipulation(),this._createMoveManipulation(e),this._createVisualElements()}get canRedo(){return this._editGeometryOperations!=null&&this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations!=null&&this._editGeometryOperations.canUndo}redo(){if(this._editGeometryOperations==null)return null;const t=this._editGeometryOperations.redo();return t!=null&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),t}undo(){if(this._editGeometryOperations==null)return null;this.emit("undo");const t=this._editGeometryOperations.undo();return t!=null&&(this.outputGeometry=this._editGeometryOperations.data.geometry,this._recreateManipulators()),t}_recreateManipulators(){this._recreatingManipulators||(this._recreatingManipulators=!0,this._removeManipulators(),this._tooltip.clear(),this._createManipulators(),this._recreatingManipulators=!1)}_recreateEditGeometryAndManipulators(t){const e={byComponentIndex:new Map};if(t!=null&&this.inputGeometry!=null&&xn(t,this.inputGeometry)){for(const a of this._manipulatorInfos)if(a.type==="vertex"&&a.manipulator.selected){const{index:o,component:{index:s}}=a.handle,{byComponentIndex:r}=e,l=r.get(s)||new Set;l.add(o),r.set(s,l)}}if(this._recreatingManipulators=!0,this._removeManipulators(),this._tooltip.clear(),this._editGeometryOperations=R(this._editGeometryOperations),this._segmentLabels=R(this._segmentLabels),t==null)return void(this._recreatingManipulators=!1);const n=t.type==="mesh"?t.anchor:t;this._editGeometryOperations=Be.fromGeometry(n,this.view.state.viewingMode),this._createManipulators(e),this._segmentLabels=new Pe({context:{view:this.view,editGeometryOperations:this._editGeometryOperations,elevationInfo:z(this.graphic),labelOptions:this._labelOptions,graphic:this.graphic,graphicState:this._graphicState},visible:this._labelOptions.enabled}),this._recreatingManipulators=!1}_perGraphicManipulatorDragAction(t,e){if(e.action==="end")return e;let n=0;const a=[],o=this._manipulatorInfos.some(r=>r.type==="vertex"&&r.manipulator.selected),s=t===Jt.SELECTED_OR_ALL&&o;for(const r of this._manipulatorInfos)r.type==="vertex"&&(r.manipulator.grabbing||s&&!r.manipulator.selected||a.push(r),n++);if(a.length===0)return e;if(this._moveVertices(a,e),a.length===n){if(this._updateEventState(I.MOVING),this.destroyed)return e;this.emit("move",{type:"move",dx:e.screenDeltaX,dy:e.screenDeltaY,mover:this.graphic})}else{if(this._updateEventState(I.RESHAPING),this.destroyed)return e;this.emit("reshape",{type:"reshape",mover:this.graphic})}return e}_isMultiVertexSelection(){return this._manipulatorInfos.reduce((t,e)=>e.type==="vertex"&&e.manipulator.selected?t+1:t,0)>1}_perVertexManipulatorDragAction(t){if(this._updateEventState(I.RESHAPING),this.destroyed)return;const{mapDeltaX:e,mapDeltaY:n,mapDeltaZ:a}=t;if(!e&&!n&&!a)return;const o=[];for(const s of this._manipulatorInfos)s.type==="vertex"&&(s.manipulator.selected&&!s.manipulator.grabbing||s===t.info)&&o.push(s);this._moveVertices(o,t,St.ACCUMULATE_STEPS),this.emit("reshape",{type:"reshape",mover:this.graphic})}_updateEventState(t){if(t===this._reshapeEventState)return!1;switch(t){case I.NONE:if(this._numGrabbing!==0||this._numDragging!==0)return!1;switch(this._reshapeEventState){case I.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic});break;case I.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic})}break;case I.MOVING:switch(this._reshapeEventState){case I.NONE:this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic});break;case I.RESHAPING:this.emit("reshape",{type:"reshape-stop",mover:this.graphic}),this.destroyed||this.emit("move",{type:"move-start",dx:0,dy:0,mover:this.graphic})}break;case I.RESHAPING:switch(this._reshapeEventState){case I.NONE:this.emit("reshape",{type:"reshape-start",mover:this.graphic});break;case I.MOVING:this.emit("move",{type:"move-stop",dx:0,dy:0,mover:this.graphic}),this.destroyed||this.emit("reshape",{type:"reshape-start",mover:this.graphic})}}if(this.destroyed)return!1;const e=this._reshapeEventState!==t;return this._reshapeEventState=t,e}_createGraphicMoveManipulation(){const{tool:t,view:e}=this,n=this._graphicState;if(this._graphicMoveManipulation=new xi({tool:t,view:e,graphicState:n}),this.enableMoveGraphic){let a=null;this._manipulatorHandles.add(this._graphicMoveManipulation.createDragPipeline((o,s,r)=>{s.next(l=>this._trackNumDragging(l)).next(l=>(l.action==="start"&&(a=this._editGeometryOperations.createUndoGroup()),l)).next(l=>this._perGraphicManipulatorDragAction(Jt.ALL,l)).next(l=>(this._updateTranslateGraphicTooltip(S.XY,l),l)).next(l=>{l.action==="end"&&(this._tooltip.clear(),a=gt(a))}),r.next(()=>this._onDragCancel(!0,()=>a=gt(a)))})),this._graphicMoveManipulation.forEachManipulator(o=>this._manipulatorHandles.add(this._watchAndUpdateGrabState(o,!1)))}else this._graphicMoveManipulation.forEachManipulator(a=>{a.grabbable=!1,a.cursor=null});this._graphicMoveManipulation.forEachManipulator(a=>this._manipulatorHandles.add(a.events.on("immediate-click",o=>{this._manipulatorInfos.some(s=>s.manipulator.selected)?this._clearSelection():this.emit("immediate-click",{...o,graphic:this.graphic}),o.stopPropagation()})))}_createMoveManipulation(t){const{graphic:e,tool:n,view:a}=this,o=this._graphicState;this._moveManipulation=new Ut({tool:n,view:a,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZShape&&kt(e),snapToScene:!1,radius:Ut.radiusForSymbol(e.symbol)}),this._moveManipulation.forEachManipulator(l=>this.addHandles([l.events.on("immediate-click",p=>{this._moveManipulation.zManipulation.hasManipulator(l)||this._manipulatorInfos.some(c=>c.manipulator.selected)||this.emit("immediate-click",{...p,graphic:e}),p.stopPropagation()}),this._watchAndUpdateGrabState(l,!1)]));const s=l=>p=>{this.addHandles(p.events.on("focus-changed",({action:c})=>{c==="focus"&&this._tooltipOptions.enabled?this._updateTranslateTooltip(l):this._tooltip.clear()}))};this._moveManipulation.xyManipulation.forEachManipulator(s(S.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(s(S.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(s(S.Z)),this._moveManipulation.elevationInfo={mode:"absolute-height",offset:0};const r=e.geometry.spatialReference;this.addHandles([this._moveManipulation.createDragPipeline((l,p,c,d,g)=>{const{snappingStep:_,cancelSnapping:m}=Ce({predicate:v=>!!v.info,snappingManager:n.snappingManager,snappingContext:new Re({editGeometryOperations:this._editGeometryOperations,elevationInfo:t,pointer:g,excludeFeature:e,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});return d=d.next(v=>(this._onDragCancel(),v)).next(m),{steps:c=c.next(v=>this._trackNumDragging(v)).next(v=>{const M=this._manipulatorInfos.filter(b=>b.type==="vertex"&&b.manipulator.selected);return v.manipulatorType===G.TRANSLATE_XY&&M.length===1?{...v,info:M[0],snapOrigin:M[0].handle.pos}:v}).next(Vi(this.view,t,e)).next(..._).next(Kt()).next(v=>this._perGraphicManipulatorDragAction(Jt.SELECTED_OR_ALL,v)).next(v=>(this._updateTranslateTooltip(l,v),v)),cancel:d}},t,r,e),y(()=>o.displaying,()=>this._updateMoveManipulationPosition(),$),o.on("changed",()=>{this._recreatingManipulators||this._updateMoveManipulationPosition()}),y(()=>o.isDraped,l=>{this._updateMoveManipulationPosition();const p="align-move-manipulation";l?this.addHandles(this.view.elevationProvider.on("elevation-change",()=>this._updateMoveManipulationPosition()),p):this.removeHandles(p)},$)])}_createVisualElements(){const{graphic:t,view:e}=this,n=qe({view:e,graphic:t,forEachManipulator:a=>{if(!this.destroyed&&!this._recreatingManipulators){this._graphicMoveManipulation.forEachManipulator(a),this._moveManipulation.forEachManipulator(a);for(const o of this._manipulatorInfos)a(o.manipulator,G.TRANSLATE_XY)}},onManipulatorsChanged:a=>this.on("manipulators-changed",a)});n!=null&&(this._outlineVisualElement=n.visualElement instanceof Nt?n.visualElement:null),this._outlineVisualElement!=null&&this._manipulatorHandles.add(this._outlineVisualElement.events.on("attachment-origin-changed",()=>{this._graphicState.isDraped||this._updateMoveManipulationPosition()})),this._manipulatorHandles.add(n)}_createEdgeOffsetManipulator(t,e=z(this.graphic)){var m,v;const n=this._settings.manipulators.edgeOffset,a=n.size/2,o=a+n.collisionPadding,s=a/o,r=s*Math.sqrt(3)/2;this._edgeOffsetManipulatorGeometryInside==null&&(this._edgeOffsetManipulatorGeometryInside=Ae(this._edgeOffsetManipulatorMaterial,r,s/2,s/2,n.height,n.offset)),this._edgeOffsetManipulatorGeometryOutside==null&&(this._edgeOffsetManipulatorGeometryOutside=Ae(this._edgeOffsetManipulatorMaterial,-r,s/2,s/2,n.height,-n.offset));const l=[new w(this._edgeOffsetManipulatorGeometryInside.instantiate(),O.Unfocused),new w(this._edgeOffsetManipulatorGeometryInside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),O.Focused),new w(this._edgeOffsetManipulatorGeometryOutside.instantiate(),O.Unfocused),new w(this._edgeOffsetManipulatorGeometryOutside.instantiate({material:this._edgeOffsetManipulatorHoverMaterial}),O.Focused)],p=new et({view:this.view,renderObjects:l,elevationInfo:e.mode!=="on-the-ground"||Di(this.graphic.symbol)?{mode:"absolute-height",offset:0}:e,worldOriented:!1,focusMultiplier:1,radius:o,available:!(!this.graphic.visible||!((m=this.graphic.layer)!=null&&m.visible)),collisionType:{type:"disc",direction:j(0,0,1)},collisionPriority:1,metadata:{deleting:!1}}),c=new et({view:this.view,worldSized:!0,worldOriented:!1,available:!(!this.graphic.visible||!((v=this.graphic.layer)!=null&&v.visible)),collisionPriority:-10,cursor:this.enableMoveGraphic?"move":"default",metadata:{deleting:!1}}),d={manipulator:p,handle:t,locationUpdateHandle:null,type:"edge",selectedIndex:0,edgeManipulator:c,elevationInfo:e,visibilityHandle:null};this._autoHideEdgeOffsetManipulator(d,n.minSquaredEdgeLength),this._updateEdgeOffsetManipulator(d);const g=[];for(const M of[d.handle.leftVertex,d.handle.rightVertex]){const b=this._getManipulatorInfoFromHandle(M);b!=null&&g.push(b.manipulator.events.on("location-update",()=>this._updateEdgeOffsetManipulator(d)))}d.locationUpdateHandle=F(g),this._manipulatorHandles.add(d.locationUpdateHandle,p),this._manipulatorHandles.add([this._watchAndUpdateGrabState(p,!0),this._watchAndUpdateGrabState(c,!0)],p),this._manipulatorHandles.add(lt(p,this._createEdgeOffsetPipeline(d,e)),p),this._manipulatorHandles.add(lt(c,(M,b,f,E)=>{if(E==="touch")this._createEdgeOffsetPipeline(d,e)(M,b,f);else if(this.enableMoveGraphic){const D=this.graphic,V=D.geometry!=null?D.geometry.spatialReference:null;b.next(N=>this._trackNumDragging(N)).next(he(this.view,M.elevationAlignedLocation)).next(vi(this.view,M.elevationAlignedLocation,e,V,D)).next(ie()).next(Kt()).next(N=>this._perGraphicManipulatorDragAction(Jt.ALL,N)).next(N=>(this._updateTranslateGraphicTooltip(S.XY,N),N)).next(N=>{N.action==="end"&&this._tooltip.clear()}),f.next(()=>this._onDragCancel(!M.metadata.deleting))}}),p);const _=M=>{this._manipulatorInfos.some(b=>b.manipulator.selected)?this._clearSelection():this.emit("immediate-click",{...M,graphic:this.graphic}),M.stopPropagation()};return this._manipulatorHandles.add([p.events.on("immediate-click",_),c.events.on("immediate-click",_),p.events.on("focus-changed",({action:M})=>{const{_tooltipOptions:b,_tooltip:f}=this;M==="focus"&&b.enabled?(f.info=this._edgeOffsetTooltipInfo??(this._edgeOffsetTooltipInfo=new Tt({tooltipOptions:b})),f.info.distance=ct,f.info.tooltipOptions=b,this._updateTooltipAreaOrTotalLength(f.info)):f.clear()})],p),this._manipulatorInfos.push(d),this.manipulators.add(p),this.manipulators.add(c),this.emit("manipulators-changed"),d}_autoHideEdgeOffsetManipulator(t,e){const n=t.manipulator,a=t.edgeManipulator,o=()=>{t.visibilityHandle=gt(t.visibilityHandle);const s=this._getManipulatorInfoFromHandle(t.handle.leftVertex),r=this._getManipulatorInfoFromHandle(t.handle.rightVertex),l=s!=null&&r!=null&&As(s.manipulator.renderLocation,r.manipulator.renderLocation,this.view.state.camera){n.grabbable=!0,a.grabbable=this.enableMoveGraphic})]))};this._manipulatorHandles.add([n.events.on("focus-changed",o),a.events.on("focus-changed",o),Z(()=>{gt(t.visibilityHandle),a.metadata.deleting=!0,this.manipulators.remove(a)})],n),o()}_updateEdgeOffsetManipulator(t){this._updateManipulatorPosition(t);const{coordinateHelper:e}=this._editGeometryOperations.data,n=ia(this.view,t.manipulator.elevationAlignedLocation,ea(e,t.handle,t.manipulator.elevationInfo)),a=this._getManipulatorInfoFromHandle(t.handle.leftVertex),o=this._getManipulatorInfoFromHandle(t.handle.rightVertex);if(a==null||o==null)return;const s=a.manipulator.renderLocation,r=o.manipulator.renderLocation,l=n!=null?Ts(n,s,r):wn;t.manipulator.modelTransform=l,t.edgeManipulator.elevationAlignedLocation=t.manipulator.elevationAlignedLocation,t.edgeManipulator.modelTransform=l;const p=te(L(Se,s,r))/2;t.edgeManipulator.collisionType={type:"line",paths:[[[-p,0,0],[p,0,0]]]}}_createEdgeOffsetPipeline(t,e){return(n,a,o)=>{this._clearSelection();const{step:s,cleanup:r}=this._initializeEdgeOffset(t,e);a.next(l=>this._trackNumDragging(l)).next(he(this.view,n.elevationAlignedLocation)).next(s).next(ro(this.view)).next(lo(this.view,this._editGeometryOperations.data.spatialReference)).next(Kt()).next(this._applyComputeEdgeOffsetDistanceStep()).next(this._applyEdgeOffsetStep(t)).next(this._showEdgeOffsetTooltip()).next(l=>{l.action==="end"&&r()}),o.next(()=>{n.metadata.deleting||(r(),this._onDragCancel())})}}_initializeEdgeOffset(t,e){const{view:n}=this,a=this._editGeometryOperations,o=ea(a.data.coordinateHelper,t.handle,e),s=a.createUndoGroup(),r=ia(n,t.manipulator.elevationAlignedLocation,o);if(o.requiresSplitEdgeLeft){const m=this._getManipulatorInfoFromHandle(t.handle.leftVertex.leftEdge);m!=null&&this._splitEdgeManipulator(m,1)}if(o.requiresSplitEdgeRight){const m=this._getManipulatorInfoFromHandle(t.handle.rightVertex.rightEdge);m!=null&&this._splitEdgeManipulator(m,0)}const l=()=>new An({paths:[[t.handle.leftVertex.pos,t.handle.rightVertex.pos]],spatialReference:a.data.spatialReference}),p=this._settings,c=new Nt({view:n,isDraped:this._graphicState.isDraped,geometry:l(),elevationInfo:t.elevationInfo,width:p.visualElements.lineGraphics.outline.width,attached:!1,isDecoration:!0});let d;const g=()=>{this._cleanEdgeOffsetCollapsedEdges(t),d=gt(d)},_=this.on("undo",g);return d=F([y(()=>Y(this._accentColor),m=>c.color=m,$),Gt(c),y(()=>this._graphicState.isDraped,m=>c.isDraped=m),this._graphicState.on("changed",()=>c.geometry=l()),s,_]),c.attached=!0,{step:m=>o==null||r==null?(g(),null):{...m,operation:o,plane:r},cleanup:g}}_applyEdgeOffsetStep(t){return e=>{if(this.destroyed||e.operation==null)return e;this._updateEventState(I.RESHAPING);const{mapDeltaX:n,mapDeltaY:a,mapDeltaZ:o}=e;return(n||a||o)&&(this._offsetEdge(t,e),this.emit("reshape",{type:"reshape",mover:this.graphic})),e}}_applyComputeEdgeOffsetDistanceStep(){return t=>{const{operation:e,mapEnd:n}=t;return e==null||n==null?t:(t.action==="start"&&e.selectArrowFromStartPoint(n),{...t,signedDistance:e.signedDistanceToPoint(n)})}}_showEdgeOffsetTooltip(){return t=>{const{mapEnd:e,signedDistance:n,operation:a}=t,{_tooltip:o,_tooltipOptions:s}=this;return s.enabled&&n!=null?(o.info=this._edgeOffsetTooltipInfo??(this._edgeOffsetTooltipInfo=new Tt({tooltipOptions:s})),o.info.tooltipOptions=s,o.info.distance=t.action==="end"?ct:Gs(this._graphicState.isDraped,n*a.selectedArrow,e,a.plane,this._editGeometryOperations.data.coordinateHelper),this._updateTooltipAreaOrTotalLength(o.info),t):(o.clear(),t)}}_cleanEdgeOffsetCollapsedEdges(t){var l,p;const e=(l=t.handle.leftVertex.leftEdge)==null?void 0:l.leftVertex,n=t.handle.leftVertex,a=(p=t.handle.rightVertex.rightEdge)==null?void 0:p.rightVertex,o=t.handle.rightVertex,s=this._editGeometryOperations.data.coordinateHelper,r=[];if(e&&s.distance(e.pos,n.pos)this._updateManipulatorPosition(c)))}c.locationUpdateHandle=F(_),this._manipulatorHandles.add(c.locationUpdateHandle,p)}this._manipulatorHandles.add(this._watchAndUpdateGrabState(p,!0),p);const d=lt(p,(_,m,v,M)=>{let b=null;const{snappingStep:f,cancelSnapping:E}=Ce({predicate:()=>!this._isMultiVertexSelection(),snappingManager:this.tool.snappingManager,snappingContext:new Re({editGeometryOperations:this._editGeometryOperations,elevationInfo:e,pointer:M,excludeFeature:this.graphic,visualizer:new ge}),updatingHandles:this._updatingHandles,useZ:!1});v=v.next(D=>(this._onDragCancel(!_.metadata.deleting,()=>b=gt(b)),D)).next(E),m.next(D=>this._trackNumDragging(D)).next(D=>{if(D.action==="start"&&(b=this._editGeometryOperations.createUndoGroup()),c.type==="edge"){const V=this._splitEdgeManipulator(c);return{...D,info:V,snapOrigin:V.handle.pos}}return{...D,info:c,snapOrigin:c.handle.pos}}).next(he(this.view,_.elevationAlignedLocation)).next(po(this.view,this.graphic,_.elevationAlignedLocation,_.location.spatialReference,this.graphic)).next(Vi(this.view,e,this.graphic)).next(...f).next(Kt()).next(D=>{this._perVertexManipulatorDragAction(D),D.action==="end"&&(b=gt(b)),this._updateTranslateVertexTooltip(_,S.XY,D)})});return this._manipulatorHandles.add([d,p.events.on("immediate-click",_=>this._manipulatorClickCallback(_,c)),p.events.on("select-changed",()=>{c.selectedIndex=++this._selectedIndex,this._updateMoveManipulationPosition()}),p.events.on("focus-changed",({action:_})=>{_==="focus"&&c.type!=="edge"?this._updateTranslateVertexTooltip(p,S.XY):this._tooltip.clear()})],p),this.emit("manipulators-changed"),c}_trackNumDragging(t){switch(t.action){case"start":this._numDragging++;break;case"end":this._numDragging--}return t}_onDragCancel(t=!0,e){switch(this._numDragging--,t&&(this.undo(),this.outputGeometry=this._editGeometryOperations!=null?this._editGeometryOperations.data.geometry:null),this.tool.snappingManager!=null&&this.tool.snappingManager.doneSnapping(),this._tooltip.clear(),this._reshapeEventState){case I.NONE:break;case I.MOVING:this.emit("move",{type:"move",dx:0,dy:0,mover:this.graphic});break;case I.RESHAPING:this.emit("reshape",{type:"reshape",mover:this.graphic})}e&&e(),this.destroyed||this._updateEventState(I.NONE)}_setTypeSpecificManipulatorSettings(t,e,n){const{graphic:a}=this,o=this._settings;switch(e.type){case"vertex":{t.state=nt.Vertex,t.selectable=!0,t.cursor="move",t.collisionPriority=2;const{size:s,collisionPadding:r}=o.manipulators.vertex;t.radius=s/2+r,t.elevationInfo=n;const{geometry:l}=a,p=l==null?void 0:l.type;t.interactive=p!=null&&p!=="point"&&p!=="mesh";break}case"edge":{t.state=nt.Edge,t.selectable=!1,t.cursor="copy",t.collisionPriority=-1;const{size:s,collisionPadding:r}=o.manipulators.edge;t.radius=s/2+r,t.elevationInfo=n.mode!=="on-the-ground"||Di(a.symbol)?{mode:"absolute-height",offset:0}:n;break}}}_watchAndUpdateGrabState(t,e){return t.events.on("grab-changed",n=>this._onGrabStateChanged(t,e,n.action,n.pointerType))}_onGrabStateChanged(t,e,n,a="mouse"){if(!this._recreatingManipulators){if(n==="start")e&&this._updateSelection(t),this._numGrabbing++;else if(this._numGrabbing--,this._updateEventState(I.NONE),this.destroyed)return;this._moveManipulation.interactive=!this._numGrabbing,(a!=="touch"||this.enableEdgeOffset)&&(this._manipulatorInfos.forEach(o=>{const{manipulator:s}=o,{geometry:r}=this.graphic,l=r==null?void 0:r.type;s.interactive=s.grabbing||!this._numGrabbing&&l!=null&&l!=="point"&&l!=="mesh","edgeManipulator"in o&&(o.edgeManipulator.interactive=o.edgeManipulator.grabbing||!this._numGrabbing)}),this._graphicMoveManipulation.forEachManipulator(o=>{o.interactive=o.grabbing||!this._numGrabbing}))}}_clearSelection(){for(const t of this._manipulatorInfos)t.manipulator.grabbing||(t.manipulator.selected=!1)}_updateSelection(t){t.grabbing&&!t.selected&&t.selectable&&(this._clearSelection(),t.selected=!0,this.emit("manipulators-changed"))}_removeManipulator(t){t!=null&&(t.manipulator.metadata.deleting=!0,this.manipulators.remove(t.manipulator),this._manipulatorHandles.remove(t.manipulator),On(this._manipulatorInfos,t),this.emit("manipulators-changed"))}_getManipulatorInfoFromHandle(t){if(t){for(const e of this._manipulatorInfos)if(t===e.handle)return e}return null}_updateManipulatorPosition(t){if(t==null)return;const e=this._editGeometryOperations;if(t.type==="vertex")t.manipulator.location=e.data.coordinateHelper.vectorToDehydratedPoint(t.handle.pos,se),t.manipulator.grabbing&&this._vertexLaserLineVisualElement!=null&&(this._vertexLaserLineVisualElement.visualElement.intersectsWorldUpAtLocation=t.manipulator.renderLocation);else if(t.type==="edge"){const n=this._getManipulatorInfoFromHandle(t.handle.leftVertex),a=this._getManipulatorInfoFromHandle(t.handle.rightVertex);if(n==null||a==null)return;const o=n.manipulator,s=a.manipulator;if(t.manipulator.elevationInfo!=null&&t.manipulator.elevationInfo.mode==="on-the-ground"){const r=o.location,l=s.location,p=.5,c=r.x+p*(l.x-r.x),d=r.y+p*(l.y-r.y),g=r.hasZ&&l.hasZ?0:void 0;t.manipulator.location=Ne(c,d,g,e.data.spatialReference)}else Pt(Se,o.renderLocation,s.renderLocation,.5),t.manipulator.renderLocation=Se}}_splitEdgeManipulator(t,e=.5){const n=this._editGeometryOperations,a=n.splitEdge(t.handle,e).createdVertex;t.locationUpdateHandle=gt(t.locationUpdateHandle);const o=z(this.graphic);let s;this.enableEdgeOffset?(this._removeManipulator(t),s=this._createVertexOrEdgeManipulator(a)):(s=t,s.handle=a,s.type="vertex",this._setTypeSpecificManipulatorSettings(t.manipulator,t.handle,o)),a.leftEdge&&this._createVertexOrEdgeManipulator(a.leftEdge),a.rightEdge&&this._createVertexOrEdgeManipulator(a.rightEdge),this.outputGeometry=n.data.geometry,this._updateManipulatorPosition(s),this.enableEdgeOffset||this._updateTranslateVertexTooltip(s.manipulator,S.XY),this._updateSelection(t.manipulator);const r=this._updateEventState(I.RESHAPING),l=n.data.coordinateHelper.vectorToArray(s.handle.pos),p=n.data.components.indexOf(a.component);return this.emit("vertex-add",{type:"vertex-add",vertices:[{coordinates:l,componentIndex:p,vertexIndex:a.index}],added:l}),r&&this._updateEventState(I.NONE),s}_updateMoveManipulationPosition(){const t=rt(Se,0,0,0);let e=0,n=!1,a=null,o=null;for(const s of this._manipulatorInfos)s.type==="vertex"&&(s.manipulator.selected?(e++,At(t,t,s.manipulator.renderLocation),a==null||s.selectedIndex>a.selectedIndex?(o=a,a=s):(o==null||s.selectedIndex>o.selectedIndex)&&(o=s)):n=!0);if(e===0){const s=this._graphicState.displaying&&this.enableMoveGraphic;this._moveManipulation.xyManipulation.available=s,this._moveManipulation.xyAxisManipulation.available=s,this._moveManipulation.xyAxisManipulation.orthogonalAvailable=s,this._moveManipulation.zManipulation.available=s&&this.enableZShape&&kt(this.graphic),this._moveManipulation.angle=bi(this.graphic.geometry),this._moveManipulation.radius=Ut.radiusForSymbol(this.graphic.symbol)}else{const s=this._graphicState.displaying;this._moveManipulation.xyManipulation.available=s,this._moveManipulation.xyAxisManipulation.available=s,this._moveManipulation.zManipulation.available=s&&this.enableZVertex&&kt(this.graphic),this._moveManipulation.xyAxisManipulation.orthogonalAvailable=s&&e!==1;let r=0;if(a!=null){const l=a.handle.pos,p=o!=null?o.handle.pos:a.handle.leftEdge&&a.handle.leftEdge.leftVertex?a.handle.leftEdge.leftVertex.pos:null,c=o==null&&a.handle.rightEdge&&a.handle.rightEdge.rightVertex?a.handle.rightEdge.rightVertex.pos:null;p&&c?this._moveManipulation.xyAxisManipulation.available=!1:p?r=na(p,l):c&&(r=na(l,c))}this._moveManipulation.angle=r,this._moveManipulation.radius=La}e!==0&&n?(Vt(t,t,1/e),se.spatialReference=this._editGeometryOperations.data.spatialReference,se.hasZ=!0,this.view.renderCoordsHelper.fromRenderCoords(t,se),this._moveManipulation.elevationAlignedLocation=se):this._outlineVisualElement==null||this._graphicState.isDraped||this._outlineVisualElement.attachmentOrigin==null?Oa(this.view,this._moveManipulation,this.graphic):this._moveManipulation.elevationAlignedLocation=this._outlineVisualElement.attachmentOrigin}_removeVertices(t){var a;const e=new Array,n=this._editGeometryOperations;for(const o of t)if(o.type==="vertex"&&n.canRemoveVertex(o.handle.component)){e.push(o.handle),this._removeManipulator(o),this._removeManipulator(this._getManipulatorInfoFromHandle(o.handle.leftEdge)),this._removeManipulator(this._getManipulatorInfoFromHandle(o.handle.rightEdge));const s=n.removeVertices([o.handle]),r=(a=s.removedVertices)==null?void 0:a[0].createdEdge;r&&this._createVertexOrEdgeManipulator(r)}if(e.length>0){const o=e.map(r=>{const l=n.data.components.indexOf(r.component);return{coordinates:n.data.coordinateHelper.vectorToArray(r.pos),componentIndex:l,vertexIndex:r.index}});this.outputGeometry=n.data.geometry;const s=this._updateEventState(I.RESHAPING);if(this.destroyed||(this.emit("vertex-remove",{type:"vertex-remove",removed:o.map(r=>r.coordinates),vertices:o}),this.destroyed)||s&&(this._updateEventState(I.NONE),this.destroyed))return;this._updateMoveManipulationPosition()}}_moveVertices(t,e,n=e.action==="start"?St.NEW_STEP:St.ACCUMULATE_STEPS){const a=this._editGeometryOperations;a.moveVertices(t.map(o=>o.handle),e.mapDeltaX,e.mapDeltaY,e.mapDeltaZ,n),this.outputGeometry=a.data.geometry;for(const o of t)this._updateManipulatorPosition(o)}_offsetEdge(t,e){if(e.operation==null||e.signedDistance==null)return;const n=this._editGeometryOperations,a=e.operation.clone();a.distance=e.signedDistance,n.updateVertices([t.handle.leftVertex,t.handle.rightVertex],a),this.outputGeometry=n.data.geometry,this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t.handle.leftVertex)),this._updateManipulatorPosition(this._getManipulatorInfoFromHandle(t.handle.rightVertex))}_manipulatorClickCallback(t,e){t.shiftKey||this._clearSelection(),e.type==="vertex"&&(e.manipulator.selected=!e.manipulator.selected,t.button===Ii.Right&&this._removeVertices([e])),e.type==="edge"&&t.button===Ii.Left&&this._splitEdgeManipulator(e),t.stopPropagation()}_updateTranslateTooltip(t,e){const n=this._manipulatorInfos.filter(a=>a.type==="vertex"&&a.manipulator.selected);n.length===1?this._updateTranslateVertexTooltip(n[0].manipulator,t,e):this._updateTranslateGraphicTooltip(t,e)}_updateTranslateGraphicTooltip(t,e){const{_tooltipOptions:n,_tooltip:a}=this;if(!n.enabled)return;const o=this._graphicState.isDraped?"on-the-ground":"absolute-height";switch(t){case S.XY:a.info=this._translateGraphicTooltipInfo??(this._translateGraphicTooltipInfo=new _e({tooltipOptions:n})),this._updateTranslateTooltipDistance(a.info,e,(s,r)=>bt(s,r,o));break;case S.XY_AXIS:a.info=this._translateGraphicXYTooltipInfo??(this._translateGraphicXYTooltipInfo=new yi({tooltipOptions:n})),this._updateTranslateTooltipDistance(a.info,e,(s,r)=>{const l=bt(s,r,o);return Ie(l,ze(e))});break;case S.Z:a.info=this._translateGraphicZTooltipInfo??(this._translateGraphicZTooltipInfo=new je({tooltipOptions:n})),this._updateTranslateTooltipDistance(a.info,e,Le)}a.info.tooltipOptions=n}_updateTranslateVertexTooltip(t,e,n){const{_tooltipOptions:a,_tooltip:o}=this;if(!a.enabled)return;const s=this._graphicState.isDraped?"on-the-ground":"absolute-height";switch(e){case S.XY:o.info=this._translateVertexTooltipInfo??(this._translateVertexTooltipInfo=new bo({tooltipOptions:a})),this._updateTranslateTooltipDistance(o.info,n,(l,p)=>bt(l,p,s)),this._updateTooltipAreaOrTotalLength(o.info);break;case S.XY_AXIS:o.info=this._translateVertexXYTooltipInfo??(this._translateVertexXYTooltipInfo=new Mo({tooltipOptions:a})),this._updateTranslateTooltipDistance(o.info,n,(l,p)=>{const c=bt(l,p,s);return Ie(c,ze(n))}),this._updateTooltipAreaOrTotalLength(o.info);break;case S.Z:o.info=this._translateVertexZTooltipInfo??(this._translateVertexZTooltipInfo=new yo({tooltipOptions:a})),this._updateTranslateTooltipDistance(o.info,n,Le)}const r=So(t.elevationAlignedLocation);r!=null&&(o.info.elevation=to({actual:r})),o.info.tooltipOptions=a}_updateTranslateTooltipDistance(t,e,n){if(e!=null&&e.action!=="end"){const{mapStart:a,mapEnd:o}=e,s=n(a,o);t.distance=s??ct}else t.distance=ct}_updateTooltipAreaOrTotalLength(t){const{geometry:e}=this.graphic;if(e==null)return t.area=null,void(t.totalLength=null);const n=this._graphicState.isDraped?"on-the-ground":"absolute-height";t.area=e.type==="polygon"?wo(e,n):null,t.totalLength=e.type==="polyline"?Wn(e,n):null}get test(){return{segmentLabels:this._segmentLabels,tooltip:this._tooltip}}};function na(i,t){return Math.atan2(t[1]-i[1],t[0]-i[0])+Math.PI/2}function Gs(i,t,e,n,a){if(i){const o=a.toXYZ(a.pointToVector(e)),s=En(n,o,x.get()),r=Kn(s,o,a.spatialReference);if(r!=null)return ce(r.value*Math.sign(t),r.unit)}return ce(t*Ee(e.spatialReference),"meters")}h([u()],C.prototype,"_editGeometryOperations",void 0),h([u()],C.prototype,"_segmentLabels",void 0),h([u({constructOnly:!0})],C.prototype,"tool",void 0),h([u()],C.prototype,"_tooltip",void 0),h([u()],C.prototype,"inputGeometry",null),h([u()],C.prototype,"outputGeometry",void 0),h([u({readOnly:!0})],C.prototype,"updating",null),h([u()],C.prototype,"manipulators",null),h([u()],C.prototype,"view",null),h([u()],C.prototype,"graphic",null),h([u()],C.prototype,"enableZShape",null),h([u()],C.prototype,"enableZVertex",null),h([u()],C.prototype,"enableMoveGraphic",null),h([u()],C.prototype,"enableMidpoints",null),h([u()],C.prototype,"enableEdgeOffset",null),h([u()],C.prototype,"_labelOptions",null),h([u()],C.prototype,"_tooltipOptions",null),h([u()],C.prototype,"_accentColor",null),C=h([k("esri.views.3d.interactive.editingTools.reshapeGraphic.ReshapeOperation")],C);const se=Ne(0,0,void 0,Tn.WGS84),Se=H(),ei=1e-6;var nt,I,Jt;(function(i){i.Vertex=yt.Custom1,i.Edge=yt.Custom2})(nt||(nt={})),function(i){i[i.NONE=0]="NONE",i[i.MOVING=1]="MOVING",i[i.RESHAPING=2]="RESHAPING"}(I||(I={})),function(i){i[i.ALL=0]="ALL",i[i.SELECTED_OR_ALL=1]="SELECTED_OR_ALL"}(Jt||(Jt={}));let X=class extends $t.EventedMixin(Fe){constructor(i){super(i),this._internalGeometryUpdate=!1,this.enableZShape=!0,this.enableZVertex=!0,this.enableMoveGraphic=!0,this.enableMidpoints=!0,this.enableEdgeOffset=!1,this.type="reshape-3d",this.labelOptions=new ba,this.tooltipOptions=new Rt,this.snappingManager=null,this.automaticManipulatorSelection=!1}initialize(){const i=this._reshapeOperation=new C({tool:this});this.addHandles([i.on("reshape",t=>{t.type==="reshape"&&this._onReshapeGeometryChanged(),this.emit("reshape",t)}),i.on("move",t=>{t.type==="move"&&this._onReshapeGeometryChanged(),this.emit("move",t)}),i.on("vertex-add",t=>{this._onReshapeGeometryChanged(),this.emit("vertex-add",t)}),i.on("vertex-remove",t=>{this._onReshapeGeometryChanged(),this.emit("vertex-remove",t)}),i.on("immediate-click",t=>this.emit("immediate-click",t)),this.view.on("pointer-down",["Shift"],t=>t.stopPropagation()),y(()=>this.graphic,()=>this._updateGraphic(),Qt)]),this.finishToolCreation()}destroy(){this._reshapeOperation=R(this._reshapeOperation)}get updating(){var i;return((i=this._reshapeOperation)==null?void 0:i.updating)??!1}_updateGeometry(){const i=Gn(this.graphic);this._reshapeOperation.inputGeometry=i!=null?i.clone():null}_updateGraphic(){if(this.removeHandles("onGraphicGeometryChange"),this._updateGeometry(),Dn(this.graphic)!==fa.SUPPORTED)return;const i=y(()=>{var t;return(t=this.graphic)==null?void 0:t.geometry},()=>{this._internalGeometryUpdate===!1&&this._updateGeometry()},$e);this.addHandles(i,"onGraphicGeometryChange")}onManipulatorSelectionChanged(){this._reshapeOperation&&this._reshapeOperation.onManipulatorSelectionChanged()}_updateGeometryInternally(i){this._internalGeometryUpdate=!0;const{graphic:t}=this,{geometry:e}=t;(e==null?void 0:e.type)==="mesh"&&i.type==="point"?(t.geometry=e.centerAt(i),t.notifyGeometryChanged()):t.geometry=i,this._internalGeometryUpdate=!1}_onReshapeGeometryChanged(){const{outputGeometry:i}=this._reshapeOperation;this.graphic!=null&&i&&this._updateGeometryInternally(i.clone())}get canUndo(){return this._reshapeOperation.canUndo??!1}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping();const i=this._reshapeOperation.undo(),{outputGeometry:t}=this._reshapeOperation;i&&t&&this._updateGeometryInternally(t.clone())}get canRedo(){return this._reshapeOperation.canRedo??!1}redo(){this.snappingManager!=null&&this.snappingManager.doneSnapping();const i=this._reshapeOperation.redo(),{outputGeometry:t}=this._reshapeOperation;i&&t&&this._updateGeometryInternally(t.clone())}onInputEvent(i){i.type!=="key-down"||i.key!=="Delete"&&i.key!=="Backspace"||this._reshapeOperation.removeSelectedVertices()}reset(){}get test(){return{snappingManager:this.snappingManager,reshapeOperation:this._reshapeOperation}}};h([u()],X.prototype,"_reshapeOperation",void 0),h([u({constructOnly:!0,nonNullable:!0})],X.prototype,"view",void 0),h([u({constructOnly:!0})],X.prototype,"graphic",void 0),h([u({constructOnly:!0,nonNullable:!0})],X.prototype,"enableZShape",void 0),h([u({constructOnly:!0,nonNullable:!0})],X.prototype,"enableZVertex",void 0),h([u({constructOnly:!0,nonNullable:!0})],X.prototype,"enableMoveGraphic",void 0),h([u({constructOnly:!0,nonNullable:!0})],X.prototype,"enableMidpoints",void 0),h([u({constructOnly:!0,nonNullable:!0})],X.prototype,"enableEdgeOffset",void 0),h([u()],X.prototype,"type",void 0),h([u({constructOnly:!0,type:ba})],X.prototype,"labelOptions",void 0),h([u({constructOnly:!0,type:Rt})],X.prototype,"tooltipOptions",void 0),h([u({constructOnly:!0})],X.prototype,"snappingManager",void 0),h([u()],X.prototype,"updating",null),h([u()],X.prototype,"automaticManipulatorSelection",void 0),X=h([k("esri.views.3d.interactive.editingTools.graphicReshape3D.GraphicReshapeTool")],X);let _t=class extends Ye{constructor(t){super(t),this.type="transform-rotate",this.rotation=null,this.rotationPrecision=null,this.orientation=null,this.orientationPrecision=null,this.rotationType="geographic"}};h([u()],_t.prototype,"type",void 0),h([u()],_t.prototype,"rotation",void 0),h([u()],_t.prototype,"rotationPrecision",void 0),h([u()],_t.prototype,"orientation",void 0),h([u()],_t.prototype,"orientationPrecision",void 0),h([u()],_t.prototype,"rotationType",void 0),_t=h([k("esri.views.interactive.tooltip.TransformRotateTooltipInfo")],_t);let Ot=class extends Ye{constructor(i){super(i),this.type="transform-scale",this.size=null,this.sizeUnit=null,this.sizePrecision=null}};h([u()],Ot.prototype,"type",void 0),h([u()],Ot.prototype,"scale",void 0),h([u()],Ot.prototype,"size",void 0),h([u()],Ot.prototype,"sizeUnit",void 0),h([u()],Ot.prototype,"sizePrecision",void 0),Ot=h([k("esri.views.interactive.tooltip.TransformScaleTooltipInfo")],Ot);let ht=class extends Ye{constructor(t){super(t),this.type="transform-absolute",this.orientation=null,this.orientationPrecision=null,this.rotationType="geographic",this.size=null,this.sizePrecision=null,this.sizeUnit=null}};h([u()],ht.prototype,"type",void 0),h([u()],ht.prototype,"orientation",void 0),h([u()],ht.prototype,"orientationPrecision",void 0),h([u()],ht.prototype,"rotationType",void 0),h([u()],ht.prototype,"size",void 0),h([u()],ht.prototype,"sizePrecision",void 0),h([u()],ht.prototype,"sizeUnit",void 0),ht=h([k("esri.views.interactive.tooltip.TransformAbsoluteTooltipInfo")],ht);var T;(function(i){i.ScaleIn=yt.Custom2,i.ScaleOut=yt.Custom3,i.RotateLeft=yt.Custom4,i.RotateRight=yt.Custom5,i.Unlocked=yt.Custom7,i.DelayedFocused=yt.Custom8,i.TouchInput=yt.Custom12})(T||(T={}));let mt=class extends Yt{get angle(){return this.adapter.angle}get scale(){return this.adapter.scale}set location(i){this._ringManipulator.location=i}set elevationAlignedLocation(i){this._ringManipulator.elevationAlignedLocation=i}get grabbing(){return this._ringManipulator.grabbing}set interactive(i){this._ringManipulator.interactive=i}get updating(){return!!this._activeAnimation}constructor(i){super(i),this.mode=null,this._scaleRotateDragData=null,this._activeAnimation=null,this._ringIndicatorDelayMs=_s,this._absoluteTooltipInfo=null,this._scaleTooltipInfo=null,this._rotateTooltipInfo=null,this.events=new $t,this.getFocused=()=>this._ringManipulator.focused,this.getScale=()=>{var t;return((t=this._scaleRotateDragData)==null?void 0:t.mode)==="scale"?this.adapter.scale:1}}initialize(){this._tooltip=new ve({view:this.tool.view}),this._createManipulator(),this._updateDragState(),this._updateManipulatorTransform(),this.addHandles([Xt(()=>!this.tooltipOptions.enabled,()=>this._tooltip.clear(),$),y(()=>{const{adapter:i}=this,{info:t}=this._tooltip;return t===this._absoluteTooltipInfo&&this.getFocused()?[t,i.size,i.orientationClockwise]:[null]},([i])=>{i&&this._updateFocusTooltip()})])}destroy(){var i;(i=this._activeAnimation)==null||i.frameTask.remove(),this._activeAnimation=null,this.tool.manipulators.remove(this._ringManipulator),this._ringManipulator=null,this._tooltip=R(this._tooltip)}startAnimation(i){this.cancelActiveAnimation(),i.start();const t=In({update:({deltaTime:e})=>{i.update(e)&&this.cancelActiveAnimation()}});this._activeAnimation={...i,frameTask:t}}cancelActiveAnimation(){var i;(i=this._activeAnimation)==null||i.frameTask.remove(),this._activeAnimation=R(this._activeAnimation)}forEachManipulator(i){i(this._ringManipulator,G.SCALE_ROTATE)}_createManipulator(){const i=this._createRingManipulator();this._ringManipulator=i,this.tool.manipulators.add(i);const t=this.tool.graphicState.graphic,e=lt(i,(n,a,o)=>{this._scaleRotateDragData=null;const s=this.adapter.startInteraction(),r={mode:"none",origin:le(n.renderLocation),initialAngle:this.adapter.angle,angle:0,angleDir:0,scaleDir:0};this._scaleRotateDragData=r,this._updateDragState();const l=x.get();this.tool.view.renderCoordsHelper.worldUpAtPosition(n.renderLocation,l),a.next(fi(this.tool.view,ya(n.renderLocation,l,_i()))).next(p=>{const c=me(p.plane),d=Ea(p.renderStart,p.renderEnd,r.origin,c),g=Rn.shortestSignedDiff(r.angle,d);r.angleDir=ni(r.angleDir+g,-Ki,Ki),r.angle=d;const _=Ds(r,p),m=_-this.adapter.scale;if(r.scaleDir=ni(r.scaleDir+m,-Wi,Wi),this._onScaleChanged(),r.mode==="none"){const v=this.mode||Is(p,p.plane,r.origin,this.tool.view.state.camera);if(v!=null){switch(v){case"rotate":this.tool.emit("graphic-rotate-start",{graphic:t,angle:0}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()});break;case"scale":this.tool.emit("graphic-scale-start",{graphic:t,xScale:1,yScale:1}),this.tool.emit("record-undo",{record:this.adapter.createUndoRecord()})}r.mode=v}}switch(r.mode){case"rotate":s.state.angle=r.initialAngle+d;break;case"scale":s.state.scale=_,this._onScaleChanged()}switch(this._updateDragState(),this._updateManipulatorTransform(),p.action){case"start":case"update":switch(r.mode){case"rotate":this.tool.emit("graphic-rotate",{graphic:t,angle:ue(r.angle)});break;case"scale":this.tool.emit("graphic-scale",{graphic:t,xScale:_,yScale:_})}break;case"end":switch(r.mode){case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:t,angle:ue(r.angle)});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:t,xScale:_,yScale:_})}}return p.action==="end"&&(this.startAnimation(oa(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState(),s.done()),p}).next(this._updateTooltipPipelineStep(r)),o.next(()=>{if(s.cancel(),this._scaleRotateDragData!=null){switch(this._scaleRotateDragData.mode){case"none":break;case"rotate":this.tool.emit("graphic-rotate-stop",{graphic:t,angle:0});break;case"scale":this.tool.emit("graphic-scale-stop",{graphic:t,xScale:1,yScale:1})}this.startAnimation(oa(this,()=>this._onScaleChanged())),this._scaleRotateDragData=null,this._updateDragState()}this._updateFocusTooltip()})});this.addHandles([e,i.events.on("focus-changed",n=>{n.action==="focus"?this.startAnimation($s(this,()=>this._updateDelayedFocusedState(),{delayMs:this._ringIndicatorDelayMs})):this._updateDelayedFocusedState()}),i.events.on("immediate-click",n=>{n.stopPropagation()}),y(()=>{var n;return(n=this.tool.graphicState)==null?void 0:n.displaying},n=>this._ringManipulator.available=n,$)])}_updateTooltipPipelineStep(i){return t=>{const e=this.tooltipOptions;if(!e.enabled)return t;if(t.action==="end")return this._updateFocusTooltip(),t;const n=this._tooltip,a=this.tooltipOptions.visualVariables;switch(i.mode){case"scale":{n.info=this._scaleTooltipInfo??(this._scaleTooltipInfo=new Ot({tooltipOptions:e}));const{size:o,scale:s}=this.adapter,r=a==null?void 0:a.size,l=n.info;l.tooltipOptions=e,l.scale={value:s},l.size=o!=null?ce(o,"meters"):void 0,l.sizePrecision=we(r==null?void 0:r.valueType),l.sizeUnit=r==null?void 0:r.unit;break}case"rotate":{n.info=this._rotateTooltipInfo??(this._rotateTooltipInfo=new _t({tooltipOptions:e}));const{orientationClockwise:o,relativeAngleClockwise:s}=this.adapter,r=a==null?void 0:a.rotation,l=we(r==null?void 0:r.valueType),p=n.info;p.tooltipOptions=e,p.rotation=s!=null?Je(s,"radians","geographic"):void 0,p.rotationPrecision=l,p.rotationType=(r==null?void 0:r.rotationType)??"geographic",p.orientation=o!=null?Je(o,"radians","geographic"):void 0,p.orientationPrecision=l;break}}return t}}_updateFocusTooltip(){const{tooltipOptions:i,_tooltip:t}=this;if(i.enabled)if(this.getFocused()){const e=i.visualVariables,n=e==null?void 0:e.rotation,a=e==null?void 0:e.size,o=this.mode,{size:s,orientationClockwise:r}=this.adapter,l=r!=null&&(o==null||o==="rotate"),p=s!=null&&(o==null||o==="scale");t.info=this._absoluteTooltipInfo??(this._absoluteTooltipInfo=new ht({tooltipOptions:i}));const c=t.info;c.tooltipOptions=i,c.orientation=l?Je(r,"radians","geographic"):void 0,c.orientationPrecision=we(n==null?void 0:n.valueType),c.rotationType=(n==null?void 0:n.rotationType)??"geographic",c.size=p?ce(s,"meters"):void 0,c.sizeUnit=a==null?void 0:a.unit,c.sizePrecision=we(a==null?void 0:a.valueType)}else t.clear()}_onScaleChanged(){this.events.emit("scale-changed"),this._updateManipulatorTransform()}_updateDelayedFocusedState(){this._ringManipulator.updateStateEnabled(T.DelayedFocused,this.getFocused()),this._updateFocusTooltip()}_updateDragState(){var i;if(this._ringManipulator.updateStateEnabled(T.Unlocked,!(this._scaleRotateDragData!=null&&((i=this._scaleRotateDragData)==null?void 0:i.mode)!=="none")),this._scaleRotateDragData!=null)switch(this._scaleRotateDragData.mode){case"rotate":this._ringManipulator.updateStateEnabled(T.ScaleIn|T.ScaleOut,!1),this._ringManipulator.updateStateEnabled(T.RotateLeft,this._scaleRotateDragData.angleDir<0),this._ringManipulator.updateStateEnabled(T.RotateRight,this._scaleRotateDragData.angleDir>=0);break;case"scale":this._ringManipulator.updateStateEnabled(T.RotateLeft|T.RotateRight,!1),this._ringManipulator.updateStateEnabled(T.ScaleIn,this._scaleRotateDragData.scaleDir<0),this._ringManipulator.updateStateEnabled(T.ScaleOut,this._scaleRotateDragData.scaleDir>=0)}else this._ringManipulator.updateStateEnabled(T.ScaleIn|T.ScaleOut|T.RotateLeft|T.RotateRight,!1)}_updateManipulatorTransform(){const i=_a(B.get(),this.adapter.angle,j(0,0,1));if(i==null)return;const t=this.getScale(),e=Ge(B.get(),rt(x.get(),t,t,t));this._ringManipulator.modelTransform=Oe(B.get(),e,i)}_createRingManipulator(){const i=(A,q,tt)=>{const xt=[],wt=Math.ceil(Ra*(q-A)/(2*Math.PI));for(let U=0;Ui(0,2*Math.PI,A),e=A=>[[-A/2,0],[A/2,0],[A/2,Qe/2],[-A/2,Qe/2]],n=this._createMaterial(1),a=(A,q,tt=n)=>Cn(tt,e(q),A,[],[],!1),o=t(zt),s=a(o,ti),r={left:new Array,right:new Array},l=[];for(let A=0;A<2;A++){const q=A*Math.PI-Math.PI/4,tt=Math.PI/2-ds,xt=q+tt,wt=q+Math.PI/2-tt,U=i(xt,wt,hs),ae=a(U,qt);l.push(U),l.push(i(xt,wt,Zi-ti/2)),r.left.push(ae),r.right.push(ae.instantiate());for(let Ke=0;Ke<2;Ke++){const wi=Ke===0,W=Xe();if(wi){va(W,W,[1,-1,1]),$i(W,W,-xt,[0,0,1]);const Ct=Math.round(Bi*(U.length-1));W[12]=U[Ct][0],W[13]=U[Ct][1],W[14]=U[Ct][2]}else{$i(W,W,wt,[0,0,1]);const Ct=Math.round((1-Bi)*(U.length-1));W[12]=U[Ct][0],W[13]=U[Ct][1],W[14]=U[Ct][2]}const Oi=Ae(n,cs,0,us,Qe);ga(Oi,W),(wi?r.left:r.right).push(Oi)}}const p=[];for(let A=0;A<2;A++){const q=A*Math.PI-Math.PI/4,tt=Math.PI/2-gs,xt=q+tt,wt=q+Math.PI/2-tt,U=i(xt,wt,Zi);p.push(a(U,qt))}const c=this._createMaterial(.66),d=this._createMaterial(.5),g=this._createMaterial(.33),_=t(zt+ji),m=t(zt+qi),v=a(_,qt,c),M=a(m,qt,g),b=t(zt-ji),f=t(zt-qi),E=a(b,qt,c),D=a(f,qt,g);let V=[new w(s,T.DelayedFocused),new w(s.instantiate({material:d}),O.None)];this.mode&&this.mode!=="scale"||(V=V.concat([...p.map(A=>new w(A,T.DelayedFocused|T.Unlocked)),new w(v,T.DelayedFocused|T.ScaleIn),new w(M,T.DelayedFocused|T.ScaleIn),new w(E,T.DelayedFocused|T.ScaleOut),new w(D,T.DelayedFocused|T.ScaleOut)])),this.mode&&this.mode!=="rotate"||(V=V.concat([...r.right.map(A=>new w(A.instantiate(),T.DelayedFocused|T.Unlocked)),...r.left.map(A=>new w(A,T.DelayedFocused|T.RotateLeft)),...r.right.map(A=>new w(A,T.DelayedFocused|T.RotateRight))]));const N=[o,...l];return new et({view:this.tool.view,renderObjects:V,autoScaleRenderObjects:!1,worldOriented:!0,radius:ti,focusMultiplier:1,touchMultiplier:1.5,elevationInfo:z(this.tool.graphicState.graphic),collisionType:{type:"ribbon",paths:N,direction:j(0,0,1)}})}_createMaterial(i){const t=new ui({cullFace:di.Back,renderOccluded:Dt.Transparent,isDecoration:!0});return this.addHandles(y(()=>({color:$n(this.tool.view.effectiveTheme.accentColor,i)}),e=>t.setParameters(e),$)),t}get test(){return{ringManipulator:this._ringManipulator,setRingIndicatorDelayMs:i=>this._ringIndicatorDelayMs=i,tooltip:this._tooltip}}};function Ds(i,t){const e=L(x.get(),t.renderStart,i.origin),n=L(x.get(),t.renderEnd,i.origin),a=te(e),o=te(n);return a===0?0:o/a}function Is(i,t,e,n){const{renderStart:a,renderEnd:o}=i,s=xe(a,n,x.get()),r=xe(o,n,x.get());if(Ln(s,r)n;return{start:()=>{n=i.getScale(),e=i.getScale,i.getScale=a,t()},update:o=>(n+=((n+1)/2-n)*Math.min(o*ms,1),t(),Math.abs(n-1)<.01?ee.STOP:ee.CONTINUE),destroy:()=>{e&&(i.getScale=e),t()}}}function $s(i,t,e){let n=0,a=null;const o=()=>!1;return{start:()=>{a=i.getFocused,i.getFocused=o,n=0,t()},update:s=>(n+=s,!(a!=null&&a())||n>=e.delayMs?ee.STOP:ee.CONTINUE),destroy:()=>{a&&(i.getFocused=a),t()}}}function we(i){switch(i){case"integer":case"long":return 0;default:return null}}h([u({constructOnly:!0})],mt.prototype,"tool",void 0),h([u({constructOnly:!0})],mt.prototype,"adapter",void 0),h([u({constructOnly:!0})],mt.prototype,"tooltipOptions",void 0),h([u()],mt.prototype,"mode",void 0),h([u()],mt.prototype,"_activeAnimation",void 0),h([u()],mt.prototype,"updating",null),mt=h([k("esri.views.3d.interactive.editingTools.transformGraphic.GraphicScaleRotateTransform")],mt),function(i){i[i.CONTINUE=0]="CONTINUE",i[i.STOP=1]="STOP"}(ee||(ee={}));const ii=Ve();function Pa(i){return i.geometry!=null&&i.geometry.type==="mesh"?Rs(i.geometry):Cs(i)}function Rs(i){return i.vertexSpace.isRelative?Ls(i,i.transform,i.vertexSpace):Ps(i)}function Cs(i){let t=i.geometry,e=null;return{undo(n){e=n.geometry,n.geometry=t},redo(n){t=n.geometry,n.geometry=e}}}function Ls(i,t,e){let n=t==null?void 0:t.clone(),a=le(e.origin),o=null,s=null;return{undo:r=>{var l;o=(l=i.transform)==null?void 0:l.clone(),s=le(e.origin),i.transform=n,i.vertexSpace.origin=a,r.notifyMeshTransformChanged()},redo:r=>{var l;n=(l=i.transform)==null?void 0:l.clone(),a=le(e.origin),i.transform=o,i.vertexSpace.origin=s,r.notifyMeshTransformChanged()}}}function Ps(i){let t,e=i.vertexAttributes.clonePositional();return{undo:n=>{t=i.vertexAttributes.clonePositional(),i.vertexAttributes=e,n.notifyGeometryChanged()},redo:n=>{e=i.vertexAttributes.clonePositional(),i.vertexAttributes=t,n.notifyGeometryChanged()}}}let Q=class extends Yt{constructor(i){super(i),this._interactionState=null}initialize(){this.addHandles([Xt(()=>{const i=this._interactionState;return i&&i.angle!==i.previousAngle?{interactionState:i,angle:i.state.angle}:null},({interactionState:i})=>{this._updateMeshRotation(i)},$e),Xt(()=>{const i=this._interactionState;return i&&i.scale!==i.previousScale?{interactionState:i,scale:i.state.scale}:null},({interactionState:i})=>{this._updateMeshSize(i)},$e)])}get initialAngle(){var i;return((i=this._interactionState)==null?void 0:i.initialAngle)??0}get angle(){var e;const i=this.geometry.transform;if(i==null)return((e=this._interactionState)==null?void 0:e.angle)??0;const t=zn(i.rotation)[2];return Math.abs(t)>.999999?ke(Hn(i.rotation))*Math.sign(t):0}get angleClockwise(){return-this.angle}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){var i;return((i=this._interactionState)==null?void 0:i.scale)??1}startInteraction(){const i=new vt({angle:this.angle});this._interactionState=i;const t=()=>{this._interactionState=null};return{state:i,done:t,cancel:()=>{i.cancel(),t()}}}createUndoRecord(){return Pa(this.graphic)}_updateMeshRotation(i){const{angle:t,previousAngle:e}=i;i.previousAngle=t;const{geometry:n}=this,{vertexSpace:a}=n,o=ue(t-e);if(a.isGeoreferenced){const s=!a.isRelative&&this.viewingMode===oi.Global,r=this.geometry.anchor;this.geometry.rotate(0,0,o,{origin:r,geographic:s}),this.graphic.notifyGeometryChanged()}else{n.transform??(n.transform=new Li);const{transform:s}=n,r=Vn(0,0,o,zs);s.rotation=kn(s.rotation,r,s.rotation),this.graphic.notifyMeshTransformChanged()}}_updateMeshSize(i){const{scale:t,previousScale:e}=i;i.previousScale=t;const{geometry:n}=this,{vertexSpace:a}=n,o=t/e;if(a.isGeoreferenced){const s=!a.isRelative&&this.viewingMode===oi.Global,r=this.geometry.anchor;this.geometry.scale(o,{origin:r,geographic:s}),this.graphic.notifyGeometryChanged()}else{n.transform??(n.transform=new Li);const{transform:s}=n;s.scale=Vt(s.scale,s.scale,o),this.graphic.notifyMeshTransformChanged()}}};h([u({constructOnly:!0})],Q.prototype,"graphic",void 0),h([u({constructOnly:!0})],Q.prototype,"geometry",void 0),h([u({constructOnly:!0})],Q.prototype,"viewingMode",void 0),h([u()],Q.prototype,"initialAngle",null),h([u()],Q.prototype,"angle",null),h([u()],Q.prototype,"angleClockwise",null),h([u()],Q.prototype,"relativeAngle",null),h([u()],Q.prototype,"relativeAngleClockwise",null),h([u()],Q.prototype,"scale",null),h([u()],Q.prototype,"_interactionState",void 0),Q=h([k("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateMeshAdapter")],Q);let vt=class extends Yt{get state(){const{angle:i,scale:t}=this;return{angle:i,scale:t}}constructor(i){super(i),this.angle=0,this.initialAngle=0,this.previousAngle=0,this.previousScale=1,this.scale=1,this.initialAngle=i.angle,this.previousAngle=i.angle}cancel(){this.angle=this.initialAngle,this.scale=1}};h([u()],vt.prototype,"angle",void 0),h([u()],vt.prototype,"initialAngle",void 0),h([u()],vt.prototype,"previousAngle",void 0),h([u()],vt.prototype,"previousScale",void 0),h([u()],vt.prototype,"scale",void 0),h([u()],vt.prototype,"state",null),vt=h([k("InteractionState")],vt);const zs=Pn();let P=class extends Yt{constructor(i){super(i),this.sizeAxis=null,this._interactionState=null}initialize(){this.addHandles(Xt(()=>this._interactionState!=null?this._interactionState.state:null,i=>{this._updateSymbol(i)},$e))}get initialAngle(){var i;return((i=this._interactionState)==null?void 0:i.initialAngle)??0}get angle(){return this._interactionState!=null?this._interactionState.angle:this._orientationReferenceSymbolLayer!=null?Hs(this._orientationReferenceSymbolLayer.heading??0):0}get angleClockwise(){return-this.angle}get orientation(){return this.angle}get orientationClockwise(){return this.angleClockwise}get relativeAngle(){return this.angle-this.initialAngle}get relativeAngleClockwise(){return-this.relativeAngle}get scale(){var i;return((i=this._interactionState)==null?void 0:i.scale)??1}get size(){const i=this._sizeReferenceSymbolLayer;if(i==null)return null;const t=this.findLayerView(),e=this._graphicSymbol;if(t==null||e==null||e.type!=="point-3d")return null;const n=t.getSymbolLayerSize(e,i);if("size"in n&&n.size!=null)return n.size;const a=this.sizeAxis;return!("width"in n)||n.width==null||a!=null&&a!=="width"&&a!=="all"&&a!=="width-and-depth"?!("depth"in n)||i.depth==null||a!=null&&a!=="depth"&&a!=="all"&&a!=="width-and-depth"?!("height"in n)||i.height==null||a!=null&&a!=="height"&&a!=="all"?null:n.height:n.depth:n.width}get _sizeReferenceSymbolLayer(){const i=this._graphicSymbol;return i==null||i.symbolLayers.length===0?null:i.symbolLayers.find(t=>t.type==="object")}get _orientationReferenceSymbolLayer(){const i=this._graphicSymbol;return i==null||i.symbolLayers.length===0?null:i.symbolLayers.find(t=>t.type==="object"&&t.heading!=null)}get _graphicSymbol(){var i;return((i=this.graphic)==null?void 0:i.symbol)!=null&&this.graphic.symbol.type==="point-3d"?this.graphic.symbol:null}set _graphicSymbol(i){this.graphic.symbol=i}startInteraction(){const i=this._graphicSymbol,t=this.findLayerView();if(this._interactionState!=null||i==null||t==null)return Vs;const e=i.symbolLayers.map(r=>r.type==="object"?t.getSymbolLayerSize(i,r):null).toArray(),n=i.clone(),a=this.angle,o=new ft({originalSymbol:n,angle:a,initialSizes:e});this._interactionState=o;const s=()=>{this._interactionState=null};return{state:o,done:s,cancel:()=>{this._graphicSymbol=n,s()}}}createUndoRecord(){let i=this.graphic.symbol,t=null;return{undo:e=>{t=e.symbol,e.symbol=i},redo:e=>{i=e.symbol,e.symbol=t}}}_updateSymbol({scale:i,angle:t,originalSymbol:e,initialSizes:n}){const a=this._graphicSymbol;if(a==null||a.type!=="point-3d")return;const o=a.clone(),s=-ue(t-this.initialAngle);let r=!1;this._forEachObjectSymbolLayerPair(e,o,(l,p,c)=>{const d=(l.heading??0)+s;p.heading!==d&&(p.heading=d,r=!0);const g=n[c];if(g!=null&&"width"in g){g.width=this.sizeFilter(g.width),g.height=this.sizeFilter(g.height),g.depth=this.sizeFilter(g.depth);const _=g.width*i;p.width!==_&&(p.width=_,r=!0);const m=g.depth*i;p.depth!==m&&(p.depth=m,r=!0);const v=g.height*i;p.height!==v&&(p.height=v,r=!0)}}),r&&(this._graphicSymbol=o)}_forEachObjectSymbolLayerPair(i,t,e){i.symbolLayers.forEach((n,a)=>{const o=t.symbolLayers.at(a);n.type==="object"&&o.type==="object"&&e(n,o,a)})}};function Hs(i){return-ke(i)}h([u()],P.prototype,"initialAngle",null),h([u()],P.prototype,"angle",null),h([u()],P.prototype,"angleClockwise",null),h([u()],P.prototype,"orientation",null),h([u()],P.prototype,"orientationClockwise",null),h([u()],P.prototype,"relativeAngle",null),h([u()],P.prototype,"relativeAngleClockwise",null),h([u()],P.prototype,"scale",null),h([u()],P.prototype,"size",null),h([u()],P.prototype,"sizeAxis",void 0),h([u({constructOnly:!0})],P.prototype,"graphic",void 0),h([u()],P.prototype,"_interactionState",void 0),h([u({constructOnly:!0})],P.prototype,"findLayerView",void 0),h([u({constructOnly:!0})],P.prototype,"sizeFilter",void 0),h([u()],P.prototype,"_sizeReferenceSymbolLayer",null),h([u()],P.prototype,"_orientationReferenceSymbolLayer",null),h([u()],P.prototype,"_graphicSymbol",null),P=h([k("esri.views.3d.interactive.editingTools.transformGraphic.ScaleRotateObjectSymbol3DAdapter")],P);const Vs={state:{angle:0,scale:0},done:()=>{},cancel:()=>{}};let ft=class extends Yt{get state(){const{originalSymbol:i,angle:t,initialAngle:e,scale:n,initialSizes:a}=this;return{originalSymbol:i,angle:t,initialAngle:e,scale:n,initialSizes:a}}constructor(i){super(i),this.angle=0,this.initialAngle=0,this.scale=1,this.initialAngle=i.angle}};h([u()],ft.prototype,"originalSymbol",void 0),h([u()],ft.prototype,"angle",void 0),h([u()],ft.prototype,"initialAngle",void 0),h([u()],ft.prototype,"initialSizes",void 0),h([u()],ft.prototype,"scale",void 0),h([u()],ft.prototype,"state",null),ft=h([k("InteractionState")],ft);let K=class extends $t.EventedMixin(Fe){constructor(i){super(i),this.enableZ=!0,this.enableRotation=!0,this.enableScaling=!0,this.tooltipOptions=new Rt,this.type="transform-3d",this._updatingHandles=new gi,this._scaleRotate=null,this._tooltip=null,this._translateGraphicTooltipInfo=null,this._translateGraphicXYTooltipInfo=null,this._translateGraphicZTooltipInfo=null}initialize(){const{graphic:i,view:t}=this;this.graphicState=new Ft({graphic:i}),this.addHandles(y(()=>this.tooltipOptions.enabled,o=>{this._tooltip=o?new ve({view:t}):R(this._tooltip)},Qt)),this._moveManipulation=new Ut({tool:this,view:t,snapToScene:this.snapToScene,xyAvailable:!0,xyAxisAvailable:!0,zAvailable:this.enableZ&&kt(i),radius:Ut.radiusForSymbol(i.symbol)}),this._moveManipulation.forEachManipulator(o=>this.addHandles(o.events.on("immediate-click",s=>{this.emit("immediate-click",{...s,graphic:i}),s.stopPropagation()})));const e=o=>s=>{this.addHandles(s.events.on("focus-changed",({action:r})=>{const l=this._tooltip;l!=null&&(r==="focus"?this._updateMoveTooltip(o):l.clear())}))};this._moveManipulation.xyManipulation.forEachManipulator(e(S.XY)),this._moveManipulation.xyAxisManipulation.forEachManipulator(e(S.XY_AXIS)),this._moveManipulation.zManipulation.forEachManipulator(e(S.Z));const n=z(i);this._moveManipulation.elevationInfo=n,this.addHandles(Mi(this.graphicState));const{geometry:a}=i;if(this._moveManipulation.createGraphicDragPipeline((o,s,r,l,p)=>{if(a!=null&&o===S.XY){const{snappingStep:c,cancelSnapping:d}=Ce({snappingContext:new Re({elevationInfo:n,pointer:p,editGeometryOperations:Be.fromGeometry(new Un({spatialReference:a.spatialReference}),t.state.viewingMode),visualizer:new ge,excludeFeature:i}),snappingManager:this.snappingManager,updatingHandles:this._updatingHandles,useZ:!1});l=l.next(d),r=r.next(mo(this.view,n)).next(...c)}return{steps:r=r.next(c=>(this._updateMoveTooltip(o,c),c)),cancel:l}},this.graphicState,o=>{const{action:s,graphic:r,dxScreen:l,dyScreen:p}=o,c={graphic:r,dxScreen:l,dyScreen:p};switch(s){case"start":this.emit("graphic-translate-start",c),this.emit("record-undo",{record:this._createGeometryUndoRecord()});break;case"update":this.emit("graphic-translate",c);break;case"end":this.emit("graphic-translate-stop",c)}}),this._moveManipulation.angle=this._scaleRotate!=null?this._scaleRotate.angle:0,this._scaleRotateAdapter=this._createScaleRotateAdapter(),this.addHandles(y(()=>this._scaleRotateAdapter.angle,()=>this._updateMoveAngle())),this.enableScaling||this.enableRotation){const o=this.enableScaling&&this.enableRotation?null:this.enableScaling?"scale":"rotate";this._scaleRotate=new mt({tool:this,mode:o,adapter:this._scaleRotateAdapter,tooltipOptions:this.tooltipOptions}),this.addHandles(this._scaleRotate.events.on("scale-changed",()=>this._onScaleChanged()))}this.addHandles([qe({view:this.view,graphic:this.graphic,forEachManipulator:o=>this._forEachManipulator(o),onManipulatorsChanged:()=>Z()}),this.graphicState.on("changed",()=>this._onGeometryChanged()),this._hideManipulatorsForGraphicState(),y(()=>t.scale,()=>this._updateMoveAngle())].filter(Xn)),this.addHandles(this.view.trackGraphicState(this.graphicState)),this._onGeometryChanged(),this._updateMoveAngle(),this._forEachManipulator(o=>{o instanceof et&&this.addHandles(o.events.on("grab-changed",()=>this._updateManipulatorsInteractive()))}),this.finishToolCreation()}destroy(){this._tooltip=R(this._tooltip),this._moveManipulation.destroy(),this._scaleRotate=R(this._scaleRotate),this._scaleRotateAdapter=R(this._scaleRotateAdapter),this._updatingHandles.destroy(),this._set("view",null),this._set("graphic",null)}_updateManipulatorsInteractive(){this._scaleRotate!=null&&(this._scaleRotate.interactive=!this._moveManipulation.grabbing,this._moveManipulation.interactive=!this._scaleRotate.grabbing)}_createScaleRotateAdapter(){var i,t,e;return this.graphic.geometry!=null&&this.graphic.geometry.type==="mesh"?new Q({graphic:this.graphic,geometry:this.graphic.geometry,viewingMode:this.view.state.viewingMode}):new P({graphic:this.graphic,sizeFilter:n=>this._enforceNonZeroSize(n),findLayerView:()=>this.view.allLayerViews.find(n=>n.layer===this.graphic.layer),sizeAxis:((e=(t=(i=this.tooltipOptions)==null?void 0:i.visualVariables)==null?void 0:t.size)==null?void 0:e.axis)??null})}_forEachManipulator(i){var t,e;(t=this._moveManipulation)==null||t.forEachManipulator(i),(e=this._scaleRotate)==null||e.forEachManipulator(i)}_hideManipulatorsForGraphicState(){return y(()=>this.graphicState.displaying,i=>{this._forEachManipulator(t=>t.available=i),this._moveManipulation.zManipulation.available=i&&this.enableZ&&kt(this.graphic)})}_createGeometryUndoRecord(){return Pa(this.graphic)}set snapToScene(i){this._moveManipulation&&(this._moveManipulation.snapToScene=i),this._set("snapToScene",i)}get updating(){var i;return this._updatingHandles.updating||!!((i=this._scaleRotate)!=null&&i.updating)}set location(i){this._moveManipulation.location=i,this._scaleRotate&&(this._scaleRotate.location=i)}set elevationAlignedLocation(i){this._moveManipulation.elevationAlignedLocation=i,this._scaleRotate&&(this._scaleRotate.elevationAlignedLocation=i)}reset(){}onHide(){var i;(i=this._scaleRotate)==null||i.cancelActiveAnimation()}_onScaleChanged(){this._scaleRotate!=null&&(this._moveManipulation.displayScale=this._scaleRotate.getScale())}_updateMoveAngle(){this.view.state.viewingMode===oi.Local||this.view.scalebt(o,s,a));break;case S.XY_AXIS:n.info=this._translateGraphicXYTooltipInfo??(this._translateGraphicXYTooltipInfo=new yi({tooltipOptions:e})),this._updateMoveTooltipDistance(n.info,t,(o,s)=>{const r=bt(o,s,a);return Ie(r,ze(t))});break;case S.Z:n.info=this._translateGraphicZTooltipInfo??(this._translateGraphicZTooltipInfo=new je({tooltipOptions:e})),this._updateMoveTooltipDistance(n.info,t,Le)}n.info.tooltipOptions=e}_updateMoveTooltipDistance(i,t,e){if(t!=null&&t.action!=="end"){const{mapStart:n,mapEnd:a}=t,o=e(n,a);i.distance=o??ct}else i.distance=ct}get test(){return{discManipulator:this._moveManipulation.xyManipulation.test.discManipulator,zManipulator:this._moveManipulation.zManipulation.test.manipulator,ringManipulator:this._scaleRotate!=null?this._scaleRotate.test.ringManipulator:null,arrowManipulators:this._moveManipulation.xyAxisManipulation.test.arrowManipulators,setRingIndicatorDelayMs:i=>this._scaleRotate!=null?this._scaleRotate.test.setRingIndicatorDelayMs(i):null,scaleRotateAdapter:this._scaleRotateAdapter,scaleRotateTransform:this._scaleRotate,tooltip:this._tooltip}}};h([u({constructOnly:!0,nonNullable:!0})],K.prototype,"view",void 0),h([u({constructOnly:!0,nonNullable:!0})],K.prototype,"graphic",void 0),h([u({constructOnly:!0,nonNullable:!0})],K.prototype,"enableZ",void 0),h([u()],K.prototype,"enableRotation",void 0),h([u()],K.prototype,"enableScaling",void 0),h([u({constructOnly:!0,type:Rt})],K.prototype,"tooltipOptions",void 0),h([u()],K.prototype,"graphicState",void 0),h([u({value:!1})],K.prototype,"snapToScene",null),h([u({constructOnly:!0})],K.prototype,"snappingManager",void 0),h([u({readOnly:!0})],K.prototype,"type",void 0),h([u({readOnly:!0})],K.prototype,"updating",null),K=h([k("esri.views.3d.interactive.editingTools.graphicTransform3D.GraphicTransformTool")],K);let ks=class{constructor(t,e,n,a){this._tool=t,this._graphicState=e,this._editGeometryOperations=n,this._bounds=a,this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null;const o=this._tool,s=o.view;this.moveXYGraphicManipulation=new xi({view:s,tool:o,graphicState:this._graphicState}),o.addHandles(this._createMoveXYGraphicDragPipeline()),this.moveZManipulator=new Oo(s,Eo.CENTER_ON_CALLOUT),this.moveZManipulator.state|=To,o.manipulators.add(this.moveZManipulator),o.addHandles([this._createMoveZDragPipeline()]),o.addHandles([o.on("graphic-translate-stop",()=>{this._moveXYTooltipInfo=null,this._moveZTooltipInfo=null})])}destroy(){this.moveXYGraphicManipulation.destroy(),this._tool.manipulators.remove(this.moveZManipulator),this.moveZManipulator.destroy()}forEachManipulator(t){this.moveXYGraphicManipulation.forEachManipulator(t),t(this.moveZManipulator,G.TRANSLATE_Z)}updateManipulators(t,e){const n=this.moveZManipulator,a=Nn(B.get(),t,Math.PI);a[12]=0,a[13]=0,a[14]=0,n.modelTransform=a,n.renderLocation=L(x.get(),e.origin,e.basis1)}getUpdatedTooltipInfo(){return this.moveXYGraphicManipulation.grabbing||this.moveXYGraphicManipulation.dragging?this._computeMoveXYTooltipInfo():this.moveZManipulator.focused?this._computeMoveZTooltipInfo():null}_computeMoveXYTooltipInfo(){const t=this._tool.tooltipOptions;return this._moveXYTooltipInfo??(this._moveXYTooltipInfo=new _e({tooltipOptions:t}))}_computeMoveZTooltipInfo(){const t=this._tool,e=t.tooltipOptions,n=this._moveZTooltipInfo??(this._moveZTooltipInfo=new je({tooltipOptions:e}));if(this.moveZManipulator.dragging){const a=this._bounds,o=a.mapBoundsStart.origin,s=a.mapBounds.origin,r=xo(o,s,this._tool.view.spatialReference);if(r==null)return null;n.distance=r}else n.distance=ce(0,t.moveUnit);return n}_updateMoveTooltip(t,e){if(e===S.XY||e===S.XY_AXIS){const n=bt(t.mapStart,t.mapEnd,this._graphicState.isDraped?"on-the-ground":"absolute-height");n!=null&&this._moveXYTooltipInfo!=null&&(this._moveXYTooltipInfo.distance=n)}return t}_createMoveXYGraphicDragPipeline(){return this.moveXYGraphicManipulation.createDragPipeline((t,e,n)=>this._applyGraphicMoveSteps(e,n,S.XY))}_createMoveZDragPipeline(){const t=this._editGeometryOperations.data.spatialReference;return lt(this.moveZManipulator,(e,n,a)=>{const o=le(e.renderLocation),s=n.next(Ta(this._tool.view,o,t)).next(ie());this._applyGraphicMoveSteps(s,a,S.Z)})}_applyGraphicMoveSteps(t,e,n){const a=this._tool,o=a.graphic,s=t.next(r=>(r.action==="start"&&(a.inputState={type:"move"},this._bounds.backupMapBounds(),a.emit("graphic-translate-start",{graphic:o,dxScreen:r.screenDeltaX,dyScreen:r.screenDeltaY})),r)).next(Kt()).next(this._moveDragUpdateGeometry()).next(r=>{const l={graphic:o,dxScreen:r.screenDeltaX,dyScreen:r.screenDeltaY};switch(r.action){case"start":case"update":(r.mapEnd.x-r.mapStart.x||r.mapEnd.y-r.mapStart.y||(r.mapEnd.z??0)-(r.mapStart.z??0))&&a.emit("graphic-translate",l);break;case"end":a.inputState=null,a.emit("graphic-translate-stop",l)}return r}).next(r=>this._updateMoveTooltip(r,n));return e.next(()=>{a.inputState!=null&&a.emit("graphic-translate-stop",{graphic:o,dxScreen:0,dyScreen:0}),a.cancel()}),s}_moveDragUpdateGeometry(){const t=this._tool;return e=>{if(t.inputState==null||t.inputState.type!=="move")return e;const n=[];for(const s of this._editGeometryOperations.data.components)n.push(...s.vertices);const a=e.action==="start"?St.NEW_STEP:St.ACCUMULATE_STEPS,o=this._editGeometryOperations.moveVertices(n,e.mapDeltaX,e.mapDeltaY,e.mapDeltaZ,a);return Ze(o,this._bounds.mapBounds),t.graphic.geometry=this._editGeometryOperations.data.geometry,e}}};class Us{constructor(t,e,n){var r;this._tool=t,this._editGeometryOperations=e,this._bounds=n,this._rotateTooltipInfo=null,this._startAngle=0,this._endAngle=0;const a=this._tool,o=a.view,s=!((r=o._stage)!=null&&r.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result);this.rotateManipulator=new Ao(o,(l,p)=>Po(o.textures,{accentColor:l,contrastColor:p,preMultiplyAlpha:s})),a.addHandles([this.rotateManipulator.events.on("grab-changed",l=>this._onRotateGrab(l)),this._createRotateDragPipeline(this.rotateManipulator)]),a.manipulators.add(this.rotateManipulator),a.addHandles([a.on("graphic-rotate-start",l=>{this._startAngle=l.angle}),a.on("graphic-rotate",l=>{this._endAngle=l.angle}),a.on("graphic-rotate-stop",()=>{this._startAngle=0,this._endAngle=0})])}destroy(){this._tool.manipulators.remove(this.rotateManipulator),this.rotateManipulator.destroy()}forEachManipulator(t){t(this.rotateManipulator,G.ROTATE)}updateManipulators(t,e){const n=this._bounds.mapBounds.plane[2]<0?Math.PI:0,a=ma(B.get(),t,n);a[12]=0,a[13]=0,a[14]=0,this.rotateManipulator.modelTransform=a,this.rotateManipulator.renderLocation=At(x.get(),e.origin,e.basis1)}getUpdatedTooltipInfo(){return this.rotateManipulator.focused?this._computeRotateTooltipInfo():null}_computeRotateTooltipInfo(){const t=this._tool.tooltipOptions,e=this._rotateTooltipInfo??(this._rotateTooltipInfo=new zo({tooltipOptions:t}));return e.angle=this._startAngle-this._endAngle,e}_onRotateGrab({action:t,screenPoint:e}){const n=this._tool,a=this._bounds;if(t!=="start"||!e)return;const o=Go(a.displayBounds,n.view.renderCoordsHelper,Do.HEADING,_i()),s=Sa(n.view.state.camera,e);xa(o,s,x.get())&&(a.backupMapBounds(),n.inputState={type:"rotate",rotatePlane:o})}_createRotateDragPipeline(t){const e=this._tool,n=e.graphic;return lt(t,(a,o,s)=>{const r=e.inputState;r!=null&&(o.next(l=>(l.action==="start"&&e.emit("graphic-rotate-start",{graphic:n,angle:0}),l)).next(fi(e.view,r.rotatePlane)).next(this._rotateDragRenderPlaneToRotate(r)).next(this._rotateDragUpdateGeometry()).next(l=>{const p={graphic:n,angle:ue(l.rotateAngle)};switch(l.action){case"start":case"update":e.emit("graphic-rotate",p);break;case"end":e.inputState=null,e.emit("graphic-rotate-stop",p)}return l}),s.next(()=>{e.inputState!=null&&e.emit("graphic-rotate-stop",{graphic:n,angle:0}),e.cancel()}))})}_rotateDragRenderPlaneToRotate(t){return e=>{const n=me(t.rotatePlane),a=Ea(e.renderStart,e.renderEnd,this._bounds.displayBounds.origin,n);return{...e,rotateAxis:n,rotateAngle:a}}}_rotateDragUpdateGeometry(){const t=this._tool,e=this._bounds;return n=>{const a=si(H(),e.mapBoundsStart.origin),o=[];for(const l of this._editGeometryOperations.data.components)o.push(...l.vertices);const s=n.action==="start"?St.NEW_STEP:St.ACCUMULATE_STEPS,r=this._editGeometryOperations.rotateVertices(o,a,n.rotateAngle,s,Ga.REPLACE);return de(e.mapBoundsStart,e.mapBounds),Ze(r,e.mapBounds),t.graphic.geometry=this._editGeometryOperations.data.geometry,n}}}class Xs{constructor(t,e,n){this._tool=t,this._onDisplayBoundsChanged=e,this.mapBounds=pe(),this.mapBoundsStart=pe(),this.displayBounds=pe(),this._calculateMapBounds(n)}get displayBoundsMargin(){var a,o,s;const{view:t,graphic:e}=this._tool,n=((a=t.pointsOfInterest)==null?void 0:a.centerOnSurfaceFrequent.location)??((s=(o=e.geometry)==null?void 0:o.extent)==null?void 0:s.center);return n?Ns*t.pixelSizeAt(n):0}backupMapBounds(){de(this.mapBounds,this.mapBoundsStart)}updateDisplayBounds(){this._calculateDisplayBounds(),this._onDisplayBoundsChanged()}_calculateMapBounds(t){const{view:e,attachmentOrigin:n}=this._tool,a=t.geometry,o=jo(a);ha(o,o,-1);const s=e.spatialReference,r=a.spatialReference,l=n?e.pixelSizeAt(n)*Yn(s)/Ee(r):0;eo(o,t,Ys*l,this.mapBounds)}_calculateDisplayBounds(){const{view:t,attachmentOrigin:e,graphic:n}=this._tool;if(!n.geometry)return;const a=(e==null?void 0:e.z)??pi(this.mapBounds.origin,t.elevationProvider,hi.fromElevationInfo(z(n)),t.renderCoordsHelper),o=de(this.mapBounds);o.origin[2]=a??0,Zs(o,t.renderCoordsHelper,n.geometry.spatialReference,this.displayBoundsMargin,this.displayBounds)}}const Ns=10,Ys=80;function Zs(i,t,e,n=0,a){a||(a=pe()),t.toRenderCoords(i.origin,e,a.origin);const o=x.get();At(o,i.origin,i.basis1),At(o,o,i.basis2),t.toRenderCoords(o,e,o);const s=x.get();At(s,i.origin,i.basis1),L(s,s,i.basis2),t.toRenderCoords(s,e,s);const r=x.get();L(r,i.origin,i.basis1),L(r,r,i.basis2),t.toRenderCoords(r,e,r);const l=x.get();L(l,i.origin,i.basis1),At(l,l,i.basis2),t.toRenderCoords(l,e,l);const p=Pt(x.get(),o,s,.5);L(p,p,a.origin);const c=Pt(x.get(),r,l,.5);L(c,a.origin,c),Pt(a.basis1,p,c,.5);const d=Pt(x.get(),l,o,.5);L(d,d,a.origin);const g=Pt(x.get(),s,r,.5);L(g,a.origin,g),Pt(a.basis2,d,g,.5);const _=It(x.get(),a.basis1,a.basis2),m=It(_,_,a.basis1);return ai(m,m),Vt(a.basis2,m,De(a.basis2,m)),Vt(a.basis1,a.basis1,1+n/te(a.basis1)),Vt(a.basis2,a.basis2,1+n/te(a.basis2)),Zn(a),a}function sa(i,t,e,n){const a=x.get();L(a,L(a,i.origin,i.basis1),i.basis2);const o=x.get();Ht(o,a,i.basis1,2);const s=x.get();Ht(s,o,i.basis2,2);const r=x.get();Ht(r,a,i.basis2,2),a[2]=o[2]=s[2]=r[2]=t;const l=n?"on-the-ground":"absolute-height",p=Pi(Me(a,o,e,l),Me(r,s,e,l)),c=Pi(Me(o,s,e,l),Me(a,r,e,l));return c==null||p==null?null:[p,c]}class Fs{get zMax(){if(!this._zMaxDirty)return this._zMax;const t=this._editGeometryOperations.data;if(t.geometry.hasZ){const e=t.coordinateHelper;this._zMax=Number.NEGATIVE_INFINITY;for(const n of t.components)for(const a of n.vertices){const o=e.getZ(a.pos)??0;this._zMax=Math.max(o,this._zMax)}}else this._zMax=0;return this._zMaxDirty=!1,this._zMax}constructor(t,e,n,a,o){this._tool=t,this._graphicState=e,this._editGeometryOperations=n,this._bounds=a,this._preserveAspectRatioStep=o,this._resizeHandles=[{direction:[1,0]},{direction:[1,1]},{direction:[0,1]},{direction:[-1,1]},{direction:[-1,0]},{direction:[-1,-1]},{direction:[0,-1]},{direction:[1,-1]}],this._scaleTooltipInfo=null,this._displayBoundsStart=pe(),this._displayBoundsMarginStart=0,this._startScale=re(),this._endScale=re(),this._sizeStart=null,this._zMax=0,this._zMaxDirty=!0;const s=this._tool,r=s.view;this.resizeManipulators=this._resizeHandles.map(l=>{const p=new Io(r,l);return s.addHandles([p.events.on("grab-changed",c=>this._onResizeGrab(c)),this._createResizeDragPipeline(p,l)]),p}),s.manipulators.addMany(this.resizeManipulators),s.addHandles([s.on("graphic-scale-start",l=>{Et(this._startScale,l.xScale,l.yScale),Et(this._endScale,l.xScale,l.yScale)}),s.on("graphic-scale",l=>{Et(this._endScale,l.xScale,l.yScale)}),s.on("graphic-scale-stop",()=>{Et(this._startScale,0,0),Et(this._endScale,0,0)}),this._graphicState.on("changed",()=>{var l;((l=s.inputState)==null?void 0:l.type)!=="resize"&&(this._zMaxDirty=!0)})])}destroy(){this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()})}forEachManipulator(t){this.resizeManipulators.forEach(e=>t(e,G.SCALE))}updateManipulators(t,e){this.resizeManipulators.forEach((n,a)=>{$o(n,this._resizeHandles[a],t,e)})}getUpdatedTooltipInfo(){return this.resizeManipulators.some(t=>t.focused)?this._computeScaleTooltipInfo():null}_computeScaleTooltipInfo(){const t=this._tool,e=t.tooltipOptions,n=this._scaleTooltipInfo??(this._scaleTooltipInfo=new Ho({tooltipOptions:e})),a=t.graphic.geometry;if(a==null)return null;const o=sa(this._bounds.mapBounds,this.zMax,a.spatialReference,this._graphicState.isDraped);return o==null?null:(n.xSize=o[0],n.ySize=o[1],this._sizeStart!=null&&this.resizeManipulators.some(s=>s.dragging)?(n.xScale=o[0].value/this._sizeStart[0].value,n.yScale=o[1].value/this._sizeStart[1].value):(n.xScale=1,n.yScale=1),n)}_onResizeGrab({action:t,screenPoint:e}){const n=this._tool,a=this._bounds;if(t!=="start"||!e||!n.graphic.geometry)return;const o=Sa(n.view.state.camera,e);xa(a.displayBounds.plane,o,x.get())&&(a.backupMapBounds(),de(a.displayBounds,this._displayBoundsStart),this._displayBoundsMarginStart=a.displayBoundsMargin,this._sizeStart=sa(a.mapBoundsStart,this.zMax,n.graphic.geometry.spatialReference,this._graphicState.isDraped),n.inputState={type:"resize"})}_createResizeDragPipeline(t,e){const n=this._tool,a=n.graphic;return lt(t,(o,s,r)=>{n.inputState!=null&&(s.next(l=>(l.action==="start"&&n.emit("graphic-scale-start",{graphic:a,xScale:1,yScale:1}),l)).next(fi(n.view,this._displayBoundsStart.plane)).next(l=>({...l,handle:e})).next(this._resizeDragRenderPlaneToFactors()).next(...this._preserveAspectRatioStep()).next(this._resizeDragUpdateGeometry()).next(l=>{const p={graphic:a,xScale:l.factor1,yScale:l.factor2};switch(l.action){case"start":case"update":n.emit("graphic-scale",p);break;case"end":n.inputState=null,n.emit("graphic-scale-stop",p)}return l}),r.next(()=>{n.inputState!=null&&n.emit("graphic-scale-stop",{graphic:a,xScale:1,yScale:1}),n.cancel()}))})}_resizeDragRenderPlaneToFactors(){const t=this._bounds;return e=>{const n=this._displayBoundsStart,a=e.handle.direction,o=t.displayBoundsMargin,s=this._displayBoundsMarginStart,r=si(x.get(),n.origin);Ht(r,r,n.basis1,-a[0]),Ht(r,r,n.basis2,-a[1]);const l=L(x.get(),e.renderEnd,r),p=L(x.get(),e.renderStart,r),c=Da(e.handle),d=Ui(n),g=Ui(t.displayBounds)/d,_=(m,v)=>{if(m===0)return 1;let M=te(v),b=.5*m*De(v,l)/M;const f=b<0?-1:1;c&&(b+=(M-.5*m*De(v,p)/M)*f*g);const E=M<1.5*s?1:ra;return M=Math.max(M-s,ra),f>0&&(b-=o),f*Math.max(f*(b/M),E)};return{...e,factor1:_(a[0],n.basis1),factor2:_(a[1],n.basis2)}}}_resizeDragUpdateGeometry(){const t=this._tool,e=this._bounds;return n=>{const a=si(H(),e.mapBoundsStart.origin);Ht(a,a,e.mapBoundsStart.basis1,-n.handle.direction[0]),Ht(a,a,e.mapBoundsStart.basis2,-n.handle.direction[1]);const o=Et(re(),e.mapBoundsStart.basis1[0],e.mapBoundsStart.basis1[1]);pa(o,o);const s=[];for(const p of this._editGeometryOperations.data.components)s.push(...p.vertices);const r=n.action==="start"?St.NEW_STEP:St.ACCUMULATE_STEPS,l=this._editGeometryOperations.scaleVertices(s,a,o,n.factor1,n.factor2,r,Ga.REPLACE);return de(e.mapBoundsStart,e.mapBounds),Ze(l,e.mapBounds),t.graphic.geometry=this._editGeometryOperations.data.geometry,n}}}const ra=1e-6;class Bs{constructor(){this._lastDragEvent=null,this._next=null,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null&&this._next!=null){const e={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(e),this._next.execute(e)}this._enabled=t}createDragEventPipelineStep(){this._lastDragEvent=null;const t=new Aa;return this._next=t,[e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustScaleFactors(e),e),t]}_adjustScaleFactors(t){const e=Da(t.handle)?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.handle.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-e:e,t.factor2=t.factor2<0?-e:e}get test(){return{_adjustScaleFactors:t=>this._adjustScaleFactors(t)}}}let J=class extends $t.EventedMixin(Fe){constructor(i){super(i),this.enableZ=!0,this.enableScaling=!0,this.enableRotation=!0,this.tooltipOptions=new Rt,this._preserveAspectRatio=new Bs,this.grabbing=!1,this.inputState=null,this._attachmentOrigin=null,this.type="transform-3d",this._outlineVisualElement=null}initialize(){const{view:i,graphic:t}=this,e=this._graphicState=new Ft({graphic:t}),n=t.geometry,a=this._editGeometryOperations=Be.fromGeometry(n,i.state.viewingMode),o=this._bounds=new Xs(this,()=>this._updateManipulators(),a.data);this._extentMove=new ks(this,e,a,o),this._extentScale=new Fs(this,e,a,o,()=>this._preserveAspectRatio.createDragEventPipelineStep()),this._extentRotate=new Us(this,a,o),this.addHandles([y(()=>this.enableZ,()=>this._updateManipulatorAvailability(this._extentMove.moveZManipulator,G.TRANSLATE_Z)),y(()=>this.enableScaling,()=>this._extentScale.forEachManipulator(p=>this._updateManipulatorAvailability(p,G.SCALE))),y(()=>this.enableRotation,()=>this._updateManipulatorAvailability(this._extentRotate.rotateManipulator,G.ROTATE))]),this._updateAllManipulatorAvailability();const s=qe({view:i,graphic:t,forEachManipulator:p=>this._forEachManipulator(p),onManipulatorsChanged:()=>Z()});if(s!=null){const{visualElement:p}=s;p instanceof Nt&&(this._outlineVisualElement=p,this.addHandles(p.events.on("attachment-origin-changed",()=>this._bounds.updateDisplayBounds()))),this.addHandles(s)}this.addHandles([e.on("changed",()=>this._onGeometryChanged()),y(()=>e.displaying,()=>this._updateAllManipulatorAvailability()),y(()=>e.isDraped,()=>this._graphicDrapedChanged(),$),y(()=>{var p;return(p=i.pointsOfInterest)==null?void 0:p.centerOnSurfaceFrequent.location},()=>o.updateDisplayBounds()),i.trackGraphicState(e)]);const r=p=>{this.addHandles(p.events.on("grab-changed",()=>{this.grabbing=p.grabbing,this._updateAllManipulatorAvailability()}))};this._forEachManipulator(r);const l=(p,c)=>{this.addHandles(p.events.on("immediate-click",d=>{c===G.TRANSLATE_XY&&this.emit("immediate-click",{...d,graphic:t}),d.stopPropagation()}))};this._forEachManipulator(l),this._initializeTooltip(),this.finishToolCreation()}destroy(){this._extentMove.destroy(),this._extentScale.destroy(),this._extentRotate.destroy(),this._editGeometryOperations.destroy(),this._tooltip.destroy(),this._set("view",null),this._set("graphic",null)}_initializeTooltip(){const{view:i}=this,t=this._tooltip=new ve({view:i}),e=()=>{t.info=this._getUpdatedTooltipInfo()};this.addHandles([this.on("graphic-translate-start",e),this.on("graphic-translate",e),this.on("graphic-translate-stop",()=>{this._tooltip.clear()}),this.on("graphic-rotate-start",e),this.on("graphic-rotate",e),this.on("graphic-rotate-stop",e),this.on("graphic-scale-start",e),this.on("graphic-scale",e),this.on("graphic-scale-stop",e)]),this._forEachManipulator(n=>{this.addHandles([n.events.on("focus-changed",e),n.events.on("grab-changed",e),n.events.on("drag",a=>{a.action==="cancel"?this._tooltip.clear():e()})])})}_getUpdatedTooltipInfo(){return this.tooltipOptions.enabled?this._extentMove.getUpdatedTooltipInfo()??this._extentScale.getUpdatedTooltipInfo()??this._extentRotate.getUpdatedTooltipInfo():null}_onGeometryChanged(){this._bounds.updateDisplayBounds()}_graphicDrapedChanged(){this.removeHandles(la),this._bounds.updateDisplayBounds(),this._graphicState.isDraped&&this.addHandles(this.view.elevationProvider.on("elevation-change",i=>{this._attachmentOrigin!=null&&da(i.extent,this._attachmentOrigin.x,this._attachmentOrigin.y)&&this._bounds.updateDisplayBounds()}),la)}_updateManipulators(){if(!this.visible)return;const i=this._bounds.displayBounds,t=Ro(i,B.get());this._extentMove.updateManipulators(t,i),this._extentScale.updateManipulators(t,i),this._extentRotate.updateManipulators(t,i)}_updateAllManipulatorAvailability(){this._forEachManipulator((i,t)=>this._updateManipulatorAvailability(i,t))}_updateManipulatorAvailability(i,t){const e=this.grabbing&&!i.grabbing;if(i.interactive=!e,i instanceof et){const n=this._graphicState.displaying,a=this.enableZ&&kt(this.graphic);switch(t){case G.ROTATE:i.available=n&&this.enableRotation;break;case G.SCALE:i.available=n&&(this.enableScaling||this.enableRotation||a),i.interactive=!e&&this.enableScaling,i.state=this.enableScaling?Co:Lo;break;case G.TRANSLATE_Z:i.available=n&&a;break;default:i.available=n}}}_forEachManipulator(i){this._extentMove.forEachManipulator(i),this._extentScale.forEachManipulator(i),this._extentRotate.forEachManipulator(i)}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(i){this._preserveAspectRatio.enabled=i,this._set("preserveAspectRatio",i)}get moveUnit(){return Fn(this.view.spatialReference)??"meters"}get attachmentOrigin(){var e,n;const i=this.graphic.geometry,t=this._graphicState.isDraped?null:(e=this._outlineVisualElement)==null?void 0:e.attachmentOrigin;return this._attachmentOrigin=t??wa(this.view,this.graphic)??((n=i==null?void 0:i.extent)==null?void 0:n.center),this._attachmentOrigin}reset(){}cancel(){if(this.canUndo){const i=this._editGeometryOperations.undo();Hi(i,this._bounds.mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry}this.inputState=null}get canUndo(){return this._editGeometryOperations.canUndo}undo(){if(this.inputState!=null)this.view.activeTool=null;else if(this.canUndo){const i=this._editGeometryOperations.undo();Hi(i,this._bounds.mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry}}get canRedo(){return this._editGeometryOperations.canRedo}redo(){if(this.canRedo){const i=this._editGeometryOperations.redo();Ze(i,this._bounds.mapBounds),this.graphic.geometry=this._editGeometryOperations.data.geometry}}get test(){return{moveZManipulator:this._extentMove.moveZManipulator,resizeManipulators:this._extentScale.resizeManipulators,rotateManipulator:this._extentRotate.rotateManipulator,tooltip:this._tooltip}}};h([u({constructOnly:!0,nonNullable:!0})],J.prototype,"view",void 0),h([u({constructOnly:!0,nonNullable:!0})],J.prototype,"graphic",void 0),h([u()],J.prototype,"enableZ",void 0),h([u()],J.prototype,"enableScaling",void 0),h([u()],J.prototype,"enableRotation",void 0),h([u({constructOnly:!0,type:Rt})],J.prototype,"tooltipOptions",void 0),h([u()],J.prototype,"preserveAspectRatio",null),h([u()],J.prototype,"moveUnit",null),h([u()],J.prototype,"grabbing",void 0),h([u()],J.prototype,"inputState",void 0),h([u({readOnly:!0})],J.prototype,"type",void 0),J=h([k("esri.views.3d.interactive.editingTools.transformGraphic.ExtentTransformTool")],J);const la="draped-elevation-changes";export{Bt as DrawGraphicTool3D,J as ExtentTransformTool,dt as GraphicMoveTool,X as GraphicReshapeTool,K as GraphicTransformTool}; diff --git a/dist/assets/editsZScale-Wgw9kbYG.js b/dist/assets/editsZScale-Wgw9kbYG.js new file mode 100644 index 0000000..22096b9 --- /dev/null +++ b/dist/assets/editsZScale-Wgw9kbYG.js @@ -0,0 +1 @@ +import{dA as a,al as l}from"./index-J0iiHjMT.js";function t(n,o,s){if(n.hasM==null||n.hasZ)for(const f of o)for(const e of f)e.length>2&&(e[2]*=s)}function u(n,o,s){if(!n&&!o||!s)return;const f=a(s);r(n,s,f),r(o,s,f)}function r(n,o,s){if(n)for(const f of n)c(f.geometry,o,s)}function c(n,o,s){if(!(n!=null&&n.spatialReference)||l(n.spatialReference,o))return;const f=a(n.spatialReference)/s;if(f!==1){if("x"in n)n.z!=null&&(n.z*=f);else if("rings"in n)t(n,n.rings,f);else if("paths"in n)t(n,n.paths,f);else if("points"in n&&(n.hasM==null||n.hasZ))for(const e of n.points)e.length>2&&(e[2]*=f)}}export{u as i}; diff --git a/dist/assets/el_GR-Yz-QyhSI.js b/dist/assets/el_GR-Yz-QyhSI.js new file mode 100644 index 0000000..95dfc16 --- /dev/null +++ b/dist/assets/el_GR-Yz-QyhSI.js @@ -0,0 +1 @@ +const d={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"μ.Χ.",_era_bc:"π.Χ.",A:"πμ",P:"μμ",AM:"π.μ.",PM:"μ.μ.","A.M.":"π.μ.","P.M.":"μ.μ.",January:"Ιανουαρίου",February:"Φεβρουαρίου",March:"Μαρτίου",April:"Απριλίου",May:"Μαΐου",June:"Ιουνίου",July:"Ιουλίου",August:"Αυγούστου",September:"Σεπτεμβρίου",October:"Οκτωβρίου",November:"Νοεμβρίου",December:"Δεκεμβρίου",Jan:"Ιαν",Feb:"Φεβ",Mar:"Μαρ",Apr:"Απρ","May(short)":"Μαΐ",Jun:"Ιουν",Jul:"Ιουλ",Aug:"Αυγ",Sep:"Σεπ",Oct:"Οκτ",Nov:"Νοε",Dec:"Δεκ",Sunday:"Κυριακή",Monday:"Δευτέρα",Tuesday:"Τρίτη",Wednesday:"Τετάρτη",Thursday:"Πέμπτη",Friday:"Παρασκευή",Saturday:"Σάββατο",Sun:"Κυρ",Mon:"Δευ",Tue:"Τρί",Wed:"Τετ",Thu:"Πέμ",Fri:"Παρ",Sat:"Σάβ",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Εστίαση",Play:"Αναπαραγωγή",Stop:"Στάση",Legend:"Υπόμνημα","Press ENTER to toggle":"",Loading:"Φόρτωση",Home:"Αρχική",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Εκτύπωση",Image:"Image",Data:"Δεδομένα",Print:"Εκτύπωση","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Από %1 έως %2","From %1":"Από %1","To %1":"Έως %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/en_CA-eyWLRifP.js b/dist/assets/en_CA-eyWLRifP.js new file mode 100644 index 0000000..84ef54c --- /dev/null +++ b/dist/assets/en_CA-eyWLRifP.js @@ -0,0 +1 @@ +const o={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"hh:mm:ss a",_date_second_full:"hh:mm:ss a",_date_minute:"hh:mm a",_date_minute_full:"hh:mm a - MMM dd, yyyy",_date_hour:"hh:mm a",_date_hour_full:"hh:mm a - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},Play:"",Stop:"","Zoom Out":"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{o as default}; diff --git a/dist/assets/en_US-eyWLRifP.js b/dist/assets/en_US-eyWLRifP.js new file mode 100644 index 0000000..84ef54c --- /dev/null +++ b/dist/assets/en_US-eyWLRifP.js @@ -0,0 +1 @@ +const o={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"hh:mm:ss a",_date_second_full:"hh:mm:ss a",_date_minute:"hh:mm a",_date_minute_full:"hh:mm a - MMM dd, yyyy",_date_hour:"hh:mm a",_date_hour_full:"hh:mm a - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},Play:"",Stop:"","Zoom Out":"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Chord diagram":"","Flow diagram":"","TreeMap chart":"",Series:"","Candlestick Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{o as default}; diff --git a/dist/assets/enums-uQoFEhYh.js b/dist/assets/enums-uQoFEhYh.js new file mode 100644 index 0000000..03f6254 --- /dev/null +++ b/dist/assets/enums-uQoFEhYh.js @@ -0,0 +1 @@ +var I,L,A,_,S,O,N;(function(T){T[T.FILL=0]="FILL",T[T.LINE=1]="LINE",T[T.MARKER=2]="MARKER",T[T.TEXT=3]="TEXT",T[T.LABEL=4]="LABEL"})(I||(I={})),function(T){T[T.NONE=0]="NONE",T[T.MAP=1]="MAP",T[T.LABEL=2]="LABEL",T[T.LABEL_ALPHA=4]="LABEL_ALPHA",T[T.HITTEST=8]="HITTEST",T[T.HIGHLIGHT=16]="HIGHLIGHT",T[T.CLIP=32]="CLIP",T[T.DEBUG=64]="DEBUG",T[T.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(L||(L={})),function(T){T[T.SIZE=0]="SIZE",T[T.COLOR=1]="COLOR",T[T.OPACITY=2]="OPACITY",T[T.ROTATION=3]="ROTATION"}(A||(A={})),function(T){T[T.NONE=0]="NONE",T[T.OPACITY=1]="OPACITY",T[T.COLOR=2]="COLOR",T[T.ROTATION=4]="ROTATION",T[T.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",T[T.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",T[T.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",T[T.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(_||(_={})),function(T){T[T.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",T[T.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",T[T.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",T[T.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(S||(S={})),function(T){T[T.SPRITE=0]="SPRITE",T[T.GLYPH=1]="GLYPH"}(O||(O={})),function(T){T[T.DEFAULT=0]="DEFAULT",T[T.SIMPLE=1]="SIMPLE",T[T.DOT_DENSITY=2]="DOT_DENSITY",T[T.OUTLINE_FILL=3]="OUTLINE_FILL",T[T.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",T[T.HEATMAP=5]="HEATMAP",T[T.PIE_CHART=6]="PIE_CHART"}(N||(N={}));export{S as A,I as E,_ as L,N as S,L as T}; diff --git a/dist/assets/es_ES-o2wkmEuo.js b/dist/assets/es_ES-o2wkmEuo.js new file mode 100644 index 0000000..1db4450 --- /dev/null +++ b/dist/assets/es_ES-o2wkmEuo.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Enero",February:"Febrero",March:"Marzo",April:"Abril",May:"Mayo",June:"Junio",July:"Julio",August:"Agosto",September:"Septiembre",October:"Octubre",November:"Noviembre",December:"Diciembre",Jan:"Ene",Feb:"Feb",Mar:"Mar",Apr:"Abr","May(short)":"May",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Dic",Sunday:"Domingo",Monday:"Lunes",Tuesday:"Martes",Wednesday:"Miércoles",Thursday:"Jueves",Friday:"Viernes",Saturday:"Sábado",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mie",Thu:"Jue",Fri:"Vie",Sat:"Sáb",_dateOrd:function(e){return"º"},"Zoom Out":"Aumentar Zoom",Play:"Reproducir",Stop:"Detener",Legend:"Leyenda","Press ENTER to toggle":"Haga clic, toque o presione ENTER para alternar",Loading:"Cargando",Home:"Inicio",Chart:"Gráfico","Serial chart":"Gráfico de serie","X/Y chart":"Gráfico X/Y","Pie chart":"Gráfico circular","Gauge chart":"Gráfico de medidor radial","Radar chart":"Gráfico de radar","Sankey diagram":"Diagrama de sankey","Chord diagram":"Diagrama de cuerdas","Flow diagram":"Diagrama de flujo","TreeMap chart":"Gráfico de mapa de árbol",Series:"Series","Candlestick Series":"Series de velas","Column Series":"Series de columnas","Line Series":"Series de líneas","Pie Slice Series":"Series de trozos circular","X/Y Series":"Series de X/Y",Map:"Mapa","Press ENTER to zoom in":"Presione ENTER para aumentar el zoom","Press ENTER to zoom out":"Presione ENTER para disminuir el zoom","Use arrow keys to zoom in and out":"Use los cursores para disminuir o aumentar el zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use las teclas mas o menos en su teclado para disminuir ou aumentar el zoom",Export:"Exportar",Image:"Imagen",Data:"Datos",Print:"Imprimir","Press ENTER to open":"Haga clic, toque o presione ENTER para abrir","Press ENTER to print.":"Haga clic, toque o presione ENTER para imprimir","Press ENTER to export as %1.":"Haga clic, toque o presione ENTER para exportar como %1.","(Press ESC to close this message)":"(Presione ESC para cerrar este mensaje)","Image Export Complete":"Exportación de imagen completada","Export operation took longer than expected. Something might have gone wrong.":"La operación de exportación llevó más tiempo de lo esperado. Algo pudo haber salido mal.","Saved from":"Guardado de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para seleccionar los botones de agarre o las flechas izquierda y derecha para cambiar la selección","Use left and right arrows to move selection":"Use las flechas izquierda y derecha para mover la selección","Use left and right arrows to move left selection":"Use las flechas izquierda y derecha para mover la selección izquierda","Use left and right arrows to move right selection":"Use las flechas izquierda y derecha para mover la selección derecha","Use TAB select grip buttons or up and down arrows to change selection":"Utilice los botones de control de selección TAB o flechas arriba y abajo para cambiar la selección","Use up and down arrows to move selection":"Use las flechas hacia arriba y hacia abajo para mover la selección","Use up and down arrows to move lower selection":"Use las flechas hacia arriba y hacia abajo para mover la selección inferior","Use up and down arrows to move upper selection":"Use las flechas hacia arriba y hacia abajo para mover la selección superior","From %1 to %2":"Desde %1 hasta %2","From %1":"Desde %1","To %1":"Hasta %1","No parser available for file: %1":"No hay analizador disponible para el archivo: %1","Error parsing file: %1":"Error al analizar el archivo: %1","Unable to load file: %1":"No se puede cargar el archivo: %1","Invalid date":"Fecha inválida"};export{a as default}; diff --git a/dist/assets/et_EE-jAuARBOS.js b/dist/assets/et_EE-jAuARBOS.js new file mode 100644 index 0000000..cb8970e --- /dev/null +++ b/dist/assets/et_EE-jAuARBOS.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"pKr",_era_bc:"eKr",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"jaanuar",February:"veebruar",March:"märts",April:"aprill",May:"mai",June:"juuni",July:"juuli",August:"august",September:"september",October:"oktoober",November:"november",December:"detsember",Jan:"jaan",Feb:"veebr",Mar:"märts",Apr:"apr","May(short)":"mai",Jun:"juuni",Jul:"juuli",Aug:"aug",Sep:"sept",Oct:"okt",Nov:"nov",Dec:"dets",Sunday:"pühapäev",Monday:"esmaspäev",Tuesday:"teisipäev",Wednesday:"kolmapäev",Thursday:"neljapäev",Friday:"reede",Saturday:"laupäev",Sun:"P",Mon:"E",Tue:"T",Wed:"K",Thu:"N",Fri:"R",Sat:"L",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Suumi",Play:"Esita",Stop:"Lõpeta",Legend:"Legend","Press ENTER to toggle":"",Loading:"Laadin",Home:"Kodu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Prindi",Image:"Pilt",Data:"Andmed",Print:"Prindi","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Alates %1 kuni %2","From %1":"Alates %1","To %1":"Kuni %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/dist/assets/euclideanAreaMeasurementUtils-zmzttSyV.js b/dist/assets/euclideanAreaMeasurementUtils-zmzttSyV.js new file mode 100644 index 0000000..5d4afb8 --- /dev/null +++ b/dist/assets/euclideanAreaMeasurementUtils-zmzttSyV.js @@ -0,0 +1 @@ +import{cL as q,aa as u,as as $,bn as C,cM as j,cN as v,cO as y,cP as A,cQ as S,cR as U,cS as W,cT as Z,cU as b}from"./index-J0iiHjMT.js";import{i as w}from"./measurementUtils-84-ZBArh.js";function P(t,s=m()){return d(t,s)}function Q(t,s=m()){return d(t,s,!1)}function d(t,s,e=t.hasZ){const c=w(t.spatialReference),l=q(c);if(l==null)return null;const R=(a,r)=>!(r.length<2)&&($(a,r[0],r[1],e&&r[2]||0),!0);let h=0;for(const a of t.rings){const r=a.length;if(r<3)continue;const{positionsWorldCoords:o}=s;for(;o.lengtha.data.count)}async function d(n,t,o){const r=c(n);return e(r,s.from(t),{...o}).then(a=>a.data.objectIds)}export{u as n,d as s}; diff --git a/dist/assets/executeForTopCount-bR-K9CPn.js b/dist/assets/executeForTopCount-bR-K9CPn.js new file mode 100644 index 0000000..a3afb27 --- /dev/null +++ b/dist/assets/executeForTopCount-bR-K9CPn.js @@ -0,0 +1 @@ +import{dZ as i}from"./index-J0iiHjMT.js";import{a as p}from"./queryTopFeatures-L2nDK2pi.js";import{S as a}from"./TopFeaturesQuery-E6D2tV-x.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";async function x(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{x as executeForTopCount}; diff --git a/dist/assets/executeForTopExtents--je_5dPa.js b/dist/assets/executeForTopExtents--je_5dPa.js new file mode 100644 index 0000000..9845ea1 --- /dev/null +++ b/dist/assets/executeForTopExtents--je_5dPa.js @@ -0,0 +1 @@ +import{dZ as e,dT as n}from"./index-J0iiHjMT.js";import{d as p}from"./queryTopFeatures-L2nDK2pi.js";import{S as i}from"./TopFeaturesQuery-E6D2tV-x.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";async function T(o,r,m){const a=e(o),t=await p(a,i.from(r),{...m});return{count:t.data.count,extent:n.fromJSON(t.data.extent)}}export{T as executeForTopExtents}; diff --git a/dist/assets/executeForTopIds-kKHpaQVu.js b/dist/assets/executeForTopIds-kKHpaQVu.js new file mode 100644 index 0000000..780fd14 --- /dev/null +++ b/dist/assets/executeForTopIds-kKHpaQVu.js @@ -0,0 +1 @@ +import{dZ as i}from"./index-J0iiHjMT.js";import{m as p}from"./queryTopFeatures-L2nDK2pi.js";import{S as a}from"./TopFeaturesQuery-E6D2tV-x.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";async function x(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{x as executeForTopIds}; diff --git a/dist/assets/executeQueryJSON-ACj9qY0y.js b/dist/assets/executeQueryJSON-ACj9qY0y.js new file mode 100644 index 0000000..788e956 --- /dev/null +++ b/dist/assets/executeQueryJSON-ACj9qY0y.js @@ -0,0 +1 @@ +import{dZ as f,ca as i}from"./index-J0iiHjMT.js";import{c as e}from"./query-rG0aX6cE.js";import{d as m}from"./FeatureSet-d4S1oKME.js";async function y(a,r,o){const t=await p(a,r,o);return m.fromJSON(t)}async function p(a,r,o){const t=f(a),c={...o},n=i.from(r),{data:s}=await e(t,n,n.sourceSpatialReference,c);return s}export{p as a,y as s}; diff --git a/dist/assets/executeQueryPBF-vdaOUMid.js b/dist/assets/executeQueryPBF-vdaOUMid.js new file mode 100644 index 0000000..ab4b208 --- /dev/null +++ b/dist/assets/executeQueryPBF-vdaOUMid.js @@ -0,0 +1 @@ +import{dB as c,iZ as l,i_ as f,eT as p,dZ as _,ca as m}from"./index-J0iiHjMT.js";import{f as y}from"./query-rG0aX6cE.js";import"./FeatureSet-d4S1oKME.js";function P(o,t){return t}function h(o,t,e,r){switch(e){case 0:return n(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?n(o,t+r,1):G(o,t+r,1)}}function u(o,t,e,r){return e===2?n(o,t,2):h(o,t,e,r)}function C(o,t,e,r){return e===2?n(o,t,3):h(o,t,e,r)}function g(o,t,e,r){return e===3?n(o,t,3):u(o,t,e,r)}function n({translate:o,scale:t},e,r){return o[r]+e*t[r]}function G({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=P,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=c(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;l(r),r.push(e);const s=r.map(i=>i.name);this._attributesConstructor=function(){for(const i of s)this[i]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,i=f(r.clone(),r,!1,!1,this._transform),a=p(i,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),i=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),i.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?g:e?u:r?C:h}}async function b(o,t,e){const r=_(o),s={...e},i=m.from(t),a=!i.quantizationParameters,{data:d}=await y(r,i,new M({sourceSpatialReference:i.sourceSpatialReference,applyTransform:a}),s);return d}export{b as n}; diff --git a/dist/assets/executeRelationshipQuery-A9rcFpIX.js b/dist/assets/executeRelationshipQuery-A9rcFpIX.js new file mode 100644 index 0000000..03cdcbe --- /dev/null +++ b/dist/assets/executeRelationshipQuery-A9rcFpIX.js @@ -0,0 +1 @@ +import{bW as m,et as p,kq as l,dZ as f}from"./index-J0iiHjMT.js";import{t as j}from"./query-rG0aX6cE.js";import{d as R}from"./FeatureSet-d4S1oKME.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";function b(r,t){const e=r.toJSON();return e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.orderByFields&&(e.orderByFields=e.orderByFields.join(",")),e.outFields&&!(t!=null&&t.returnCountOnly)?e.outFields.includes("*")?e.outFields="*":e.outFields=e.outFields.join(","):delete e.outFields,e.outSR&&(e.outSR=p(e.outSR)),e.dynamicDataSource&&(e.layer=JSON.stringify({source:e.dynamicDataSource}),delete e.dynamicDataSource),e}async function F(r,t,e){const n=await y(r,t,e),o=n.data,s=o.geometryType,a=o.spatialReference,c={};for(const d of o.relatedRecordGroups){const u={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:d.relatedRecords};if(d.objectId!=null)c[d.objectId]=u;else for(const i of Object.keys(d))i!=="relatedRecords"&&(c[d[i]]=u)}return{...n,data:c}}async function h(r,t,e){const n=await y(r,t,e,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function y(r,t,e={},n){const o=j({...r.query,f:"json",...n,...b(t,n)});return m(r.path+"/queryRelatedRecords",{...e,query:{...e.query,...o}})}async function k(r,t,e){t=l.from(t);const n=f(r);return F(n,t,e).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(c=>a[c]=R.fromJSON(s[c])),a})}async function x(r,t,e){t=l.from(t);const n=f(r);return h(n,t,{...e}).then(o=>o.data)}export{k as executeRelationshipQuery,x as executeRelationshipQueryForCount}; diff --git a/dist/assets/executeTopFeaturesQuery-se6h6fh4.js b/dist/assets/executeTopFeaturesQuery-se6h6fh4.js new file mode 100644 index 0000000..9b1b9c4 --- /dev/null +++ b/dist/assets/executeTopFeaturesQuery-se6h6fh4.js @@ -0,0 +1 @@ +import{dZ as f}from"./index-J0iiHjMT.js";import{p as e}from"./queryTopFeatures-L2nDK2pi.js";import{d as s}from"./FeatureSet-d4S1oKME.js";import{S as n}from"./TopFeaturesQuery-E6D2tV-x.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";async function F(r,o,t,m){const i=f(r),p={...m},{data:a}=await e(i,n.from(o),t,p);return s.fromJSON(a)}export{F as executeTopFeaturesQuery}; diff --git a/dist/assets/favicon-kHK20mPJ.ico b/dist/assets/favicon-kHK20mPJ.ico new file mode 100644 index 0000000..65fe5f3 Binary files /dev/null and b/dist/assets/favicon-kHK20mPJ.ico differ diff --git a/dist/assets/featureLayerUtils-o55B7eEP.js b/dist/assets/featureLayerUtils-o55B7eEP.js new file mode 100644 index 0000000..1a28850 --- /dev/null +++ b/dist/assets/featureLayerUtils-o55B7eEP.js @@ -0,0 +1 @@ +import{bT as A,g$ as Y,dj as _,df as m,e3 as G,h0 as P,h1 as T,h as u,h2 as $,h3 as j,E as y,i as b}from"./index-J0iiHjMT.js";import{I as k,y as E,w as N,b as z,u as B,v as V,l as g,d as q,m as I}from"./utils-rBsg-VY8.js";import{t as C}from"./fetchService-wPWKuma6.js";import{o as x}from"./jsonContext-cWV_-jAj.js";import"./requestPresets-18nzHK5y.js";const h="Feature Service",w="feature-layer-utils",H=`${w}-save`,Q=`${w}-save-as`,p=`${w}-saveall`,f=`${w}-saveall-as`;function v(e){return{isValid:j(e)&&(e.type!=="feature"||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function O(e){const a=[],t=[];for(const{layer:n,layerJSON:o}of e)n.isTable?t.push(o):a.push(o);return{layers:a,tables:t}}function F(e){return O([e])}async function J(e,a){return/\/\d+\/?$/.test(e.url)?F(a[0]):M(a,e)}async function M(e,a){if(!a)return e.reverse(),O(e);const{layer:{url:t,customParameters:n,apiKey:o}}=e[0];let r=await a.fetchData("json");(r==null?void 0:r.layers)!=null&&(r==null?void 0:r.tables)!=null||(r=await W(r,{url:t??"",customParameters:n,apiKey:o},e.map(s=>s.layer.layerId)));for(const s of e)R(s.layer,s.layerJSON,r);return r}async function W(e,a,t){e||(e={}),e.layers||(e.layers=[]),e.tables||(e.tables=[]);const{url:n,customParameters:o,apiKey:r}=a,{serviceJSON:s,layersJSON:l}=await C(n,{customParameters:o,apiKey:r}),i=S(e.layers,s.layers,t),c=S(e.tables,s.tables,t);e.layers=i.itemResources,e.tables=c.itemResources;const d=[...i.added,...c.added],K=l?[...l.layers,...l.tables]:[];return await X(e,d,n,K),e}function S(e,a,t){const n=Y(e,a,(r,s)=>r.id===s.id);e=e.filter(r=>!n.removed.some(s=>s.id===r.id));const o=n.added;return o.forEach(({id:r})=>{e.push({id:r})}),{itemResources:e,added:o.filter(({id:r})=>!t.includes(r))}}async function X(e,a,t,n){const o=await Z(a),r=a.map(({id:s,type:l})=>new(o.get(l))({url:t,layerId:s,sourceJSON:n.find(({id:i})=>i===s)}));await Promise.allSettled(r.map(s=>s.load())),r.forEach(s=>{const{layerId:l,loaded:i,defaultPopupTemplate:c}=s;if(!i||c==null)return;const d={id:l,popupInfo:c.toJSON()};s.operationalLayerType!=="ArcGISFeatureLayer"&&(d.layerType=s.operationalLayerType),R(s,d,e)})}async function Z(e){const a=[];e.forEach(({type:o})=>{const r=ee(o),s=_[r];a.push(s())});const t=await Promise.all(a),n=new Map;return e.forEach(({type:o},r)=>{n.set(o,t[r])}),n}function ee(e){let a;switch(e){case"Feature Layer":case"Table":a="FeatureLayer";break;case"Oriented Imagery Layer":a="OrientedImageryLayer"}return a}function R(e,a,t){e.isTable?L(t.tables,a):L(t.layers,a)}function L(e,a){const t=e.findIndex(({id:n})=>n===a.id);t===-1?e.push(a):e[t]=a}function D(e,a){if(!e.length)throw new y(`${a}:missing-parameters`,"'layers' array should contain at least one feature layer")}function ae(e,a){const t=e.map(n=>n.portalItem.id);if(new Set(t).size>1)throw new y(`${a}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function U(e,a){const t=e.map(n=>n.layerId);if(new Set(t).size!==t.length)throw new y(`${a}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function te(e){D(e,p),await Promise.all(e.map(a=>a.load()));for(const a of e)g(a,p,v),q({layer:a,itemType:h,errorNamePrefix:p});ae(e,p),U(e,p)}async function re(e,a){const{url:t,layerId:n,title:o,fullExtent:r,isTable:s}=e,l=m(t);a.url=(l==null?void 0:l.serverType)==="FeatureServer"?t:`${t}/${n}`,a.title||(a.title=o),a.extent=null,s||r==null||(a.extent=await P(r)),T(a,u.METADATA),T(a,u.MULTI_LAYER),b(a,u.SINGLE_LAYER),s&&b(a,u.TABLE)}function se(e,a){for(const r of e){const s=r.parsedUrl.path,l=m(s);if(!(l==null?void 0:l.url.path))throw new y(`${a}:invalid-parameters`,I(r,`has unsupported url pattern: ${s}`),{layer:r});const c=l==null?void 0:l.serverType;if(c!=="FeatureServer"&&c!=="MapServer")throw new y(`${a}:invalid-parameters`,I(r,`has unsupported server type: ${c}`),{layer:r});if(c==="MapServer"&&e.length>1)throw new y(`${a}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const t=m(e[0].parsedUrl.path),n=t==null?void 0:t.url.path;if(!e.every(r=>{const s=m(r.parsedUrl.path);return(s==null?void 0:s.url.path)===n}))throw new y(`${a}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function ne(e){D(e,f),await Promise.all(e.map(a=>a.load()));for(const a of e)g(a,f,v);se(e,f),U(e,f)}async function le(e,a){let t=0,n=0;for(const{isTable:s}of a)s?n++:t++;const o=a[0].parsedUrl.path,r=m(o);if(e.url=(r==null?void 0:r.serverType)==="FeatureServer"?r.url.path:o,e.title||(e.title=r.title),e.extent=null,t>0){const s=a.map(l=>l.fullExtent).filter(G).reduce((l,i)=>l.clone().union(i));s&&(e.extent=await P(s))}T(e,u.METADATA),$(e,u.MULTI_LAYER,a.length>1),$(e,u.SINGLE_LAYER,a.length===1),$(e,u.TABLE,n>0&&t===0),N(e)}async function pe(e,a){return k({layer:e,itemType:h,validateLayer:v,createItemData:(t,n)=>J(n,[t]),errorNamePrefix:H},a)}async function fe(e,a){await te(e);const t=e[0].portalItem,n=x(t),o=await Promise.all(e.map(s=>E(s,n,a))),r=await J(t,e.map((s,l)=>({layer:s,layerJSON:o[l]})));return N(t),await t.update({data:r}),await Promise.all(e.slice(1).map(s=>s.portalItem.reload())),A(n),t.clone()}async function me(e,a,t){return z({layer:e,itemType:h,validateLayer:v,createItemData:(n,o)=>Promise.resolve(F(n)),errorNamePrefix:Q,newItem:a,setItemProperties:re},t)}async function de(e,a,t){await ne(e);const n=B({itemType:h,errorNamePrefix:f,newItem:a}),o=x(n),r=await Promise.all(e.map(l=>E(l,o,t))),s=await M(e.map((l,i)=>({layer:l,layerJSON:r[i]})));await le(n,e),await V(n,s,t);for(const l of e)l.portalItem=n.clone();return A(o),n}export{pe as save,fe as saveAll,de as saveAllAs,me as saveAs}; diff --git a/dist/assets/featureSetUtils-DaHg3px6.js b/dist/assets/featureSetUtils-DaHg3px6.js new file mode 100644 index 0000000..6fe96f8 --- /dev/null +++ b/dist/assets/featureSetUtils-DaHg3px6.js @@ -0,0 +1,7 @@ +import{ar as se,fx as je,iZ as Ge,S as q,eQ as Ue,dw as U,oH as Re,rf as ke,dJ as Be,gG as Me,de as We,ca as x,iY as $e,bO as ce,bP as he,E as Ve,rg as fe,et as Qe,bW as G,dy as Ze,kt as pe,ha as ze,kq as _e,bR as Je}from"./index-J0iiHjMT.js";import{ap as ae,aq as b,V as Ke,ag as v,ah as ye,ai as ge,aj as me,ak as we,al as Fe,aw as W,ax as re,ay as Xe,az as K,N as Ye,aA as He,aB as $,aC as et}from"./arcadeUtils-OUqwHs4P.js";import{x as T,s as C,a as D,n as N,t as A,r as tt}from"./WhereClause-XAMIZ4-B.js";import{x as O,t as y,g as P,m as V,a as R,y as it,L as st,w as J,E as Se,T as Ie,S as be,F as at,v as ve,p as rt,D as Q,I as nt,d as j,b as lt,f as ot,c as w}from"./SpatialFilter-CXhA7RaJ.js";import{c as ut,b as dt,n as ct}from"./TimeOnly-ljWtUK7N.js";import k from"./FeatureLayer--S4epFk-.js";import xe from"./SubtypeGroupLayer-xK5RtU9X.js";import{a as ht,s as Ce}from"./executeQueryJSON-ACj9qY0y.js";import{n as ft}from"./executeQueryPBF-vdaOUMid.js";import{d as pt}from"./FeatureSet-d4S1oKME.js";import"./AttachmentInfo-kbEMEIl0.js";import{n as _t,s as yt}from"./executeForIds-wXO8-pll.js";import"./pbf-o0zzptPp.js";import"./TopFeaturesQuery-E6D2tV-x.js";import{n as gt}from"./FeatureType-MpRe7WJj.js";let Ne=class{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,i){this._layerById[t]=i,this._layerByName[e]=i}async featureSetByName(e,t=!0,i=["*"]){return this._layerByName[e]===void 0?null:this._layerByName[e]}async featureSetById(e,t=!0,i=["*"]){return this._layerById[e]===void 0?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}},Ae=class X extends O{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof T?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new se({wkid:4326}),this.geometryType=ae.point)}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),this._whereClauseFunction!==null?this._wset=new y(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new y(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){var i;let t=(i=this._parent)==null?void 0:i._isInFeatureSet(e);return t===b.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?b.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){var t;return((t=this._whereclause)==null?void 0:t.testFeature(e))??!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return je(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){var r,l,u;const s=new y([],e,!1,null),a=Math.min(t,e.length);if(await((r=this._parent)==null?void 0:r._getFeatures(s,-1,a,i)),this._checkCancelled(i),this._whereClauseFunction==null){for(let o=0;o":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+s+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+s+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,a)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,a)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,a)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return st(e.mode==="date",t);case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+s+")":e.column;case"data-type":return e.value;case"function":{const o=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,a);return it(e.name,o,t)}}throw new N(A.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof T?this.reverseLkp[T.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}};wt.BADNESS="_!!!_BAD_LKP_!!!!";class Ft extends Z{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:V(e,this.field.name,R(this._sql,v.Standardised),t.getFieldsIndex())}}extractValue(e){return T.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let St=class extends O{static findField(e,t){for(const i of e)if(i.name.toLowerCase()===t.toString().toLowerCase())return i;return null}constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new se({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ae.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){var t;if(this._wset===null){await this._ensureLoaded();let i=null;return i=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await((t=this._parent)==null?void 0:t._getSet(e)),this._checkCancelled(e),Ge(i),this._wset=new y(i._candidates.slice(0),i._known.slice(0),i._ordered,this._clonePageDefinition(i.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}async _getFeatures(e,t,i,s){var o,d;const a=[];t!==-1&&this._featureCache[t]===void 0&&a.push(t);const n=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,n)===!0)return await this._expandPagedSet(e,n,0,0,s),this._getFeatures(e,t,i,s);let r=0;for(let h=e._lastFetchedIndex;h=n)));h++);if(a.length===0)return"success";e=new y([],a,e._ordered,null);const l=Math.min(a.length,i);await((o=this._parent)==null?void 0:o._getFeatures(e,-1,l,s)),this._checkCancelled(s);const u=[];for(let h=0;h0&&(s=s.replaceFields(d))}i!==null?this._extraFilter!==null&&(i=P(this._extraFilter,i)):i=this._extraFilter,await this._ensureLoaded();const u=await this._parent._getFilteredSet(e,t,i,s,a);let o;return this._checkCancelled(a),o=n===!0?new y(u._candidates.slice(0).concat(u._known.slice(0)),[],l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)):new y(u._candidates.slice(0),u._known.slice(0),l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)),o}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(e!==null){for(const i of this.adaptedFields)if(ve(e,i.field.name)===!0){const s=i.rewriteSql(e,this);if(s.rewritten!==!0){t.cannot=!0,t.where=null;break}t.where=s.where}}return t}async _stat(e,t,i,s,a,n,r){let l=!1,u=this._reformulateWithoutAdaptions(t);if(l=u.cannot,t=u.where,u=this._reformulateWithoutAdaptions(a),l=l||u.cannot,(a=u.where)!==null?this._extraFilter!==null&&(a=P(this._extraFilter,a)):a=this._extraFilter,l===!0)return a===null&&i===""&&s===null?this._manualStat(e,t,n,r):{calculated:!1};const o=await this._parent._stat(e,t,i,s,a,n,r);return o.calculated===!1?a===null&&i===""&&s===null?this._manualStat(e,t,n,r):{calculated:!1}:o}async _canDoAggregates(e,t,i,s,a){if(this._parent===null)return!1;for(let l=0;l{for(let s=0;s0?(await W(this._refineSetBlock(e,this._maxProcessingRate(),s)),this._checkCancelled(s),this.getIdColumnDictionary(e,t,i,s)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,s){return this._parent._getFeatures(e,t,i,s)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new C(D.NeverReach)}async _getFilteredSet(e,t,i,s,a){await this._ensureLoaded();const n=await this._parent._getFilteredSet(e,t,i,s===null?this._orderbyclause:s,a);this._checkCancelled(a);const r=new y(n._candidates.slice(0),n._known.slice(0),n._ordered,this._clonePageDefinition(n.pagesDefinition));let l=!0;if(n._candidates.length>0&&(l=!1),r._ordered===!1){let u=await this.manualOrderSet(r,a);return l===!1&&(t===null&&i===null||(u=new y(u._candidates.slice(0).concat(u._known.slice(0)),[],u._ordered,this._clonePageDefinition(u.pagesDefinition)))),u}return r}static registerAction(){O._featuresetFunctions.orderBy=function(e){return e===""?this:new Le({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function It(c){if(c.parseTree.type==="function"){if(c.parseTree.args.value.length===0)return{name:c.parseTree.name,expr:null};if(c.parseTree.args.value.length>1)throw new N(A.MissingStatisticParameters);const e=T.create(rt(c.parseTree.args.value[0],v.Standardised,c.parameters),c.fieldsIndex,c.timeZone);return{name:c.parseTree.name,expr:e}}return null}let Te=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,s){const a=new ee;a.field=e;const n=T.create(t,i,s),r=It(n);if(r===null)throw new N(A.UnsupportedSqlFunction,{function:""});const l=r.name.toUpperCase().trim();if(l==="MIN"){if(a.typeofstat="MIN",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(a.typeofstat="MAX",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")a.typeofstat="COUNT",a.workingexpr=r.expr;else if(l==="STDEV"){if(a.typeofstat="STDDEV",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(a.typeofstat="SUM",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(a.typeofstat="AVG",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(a.typeofstat="AVG",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new N(A.UnsupportedSqlFunction,{function:l});if(a.typeofstat="VAR",a.workingexpr=r.expr,n===null)throw new N(A.InvalidFunctionParameters,{function:"var"})}return a}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}};function bt(c){if(!c)return"COUNT";switch(c.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}let Ct=class Oe extends O{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return b.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,i=1;const s=this._parent?this._parent.getFieldsIndex():new Ue([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let n=!1;for(let r=0;r0)for(const n of this._parent.fields)this._adaptedFields.push(new Y(n));for(let n=0;n0&&(l=new St({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),r.nowhereclause===!0)n=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new H({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let u=l;if(i!==null){let o=null;i&&(o=this._reformulateWhereClauseWithoutGroupByFields(i)),u=new Ae({parentfeatureset:u,whereclause:o})}n=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new H({parentfeatureset:u,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return n}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=V(e,t.tofieldname,R(t.workingexpr,v.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=V(e,t.tofieldname,R(t.expression,v.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const s=await this._getAgregagtePhysicalPage(e,t,i);for(const a of s){const n={geometry:a.geometry,attributes:{}},r={};for(const l in a.attributes)r[l.toLowerCase()]=a.attributes[l];for(const l of this._decodedGroupbyfield)n.attributes[l.tofieldname]=r[l.name.toLowerCase()];for(const l of this._decodedStatsfield)n.attributes[l.tofieldname]=r[l.field.toLowerCase()];this._featureCache[n.attributes[this.objectIdField]]=new q(n)}return s.length}_sequentialGetPhysicalItem(e,t,i,s){return new Promise((a,n)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?a(s.length):this._nextAggregateItem(e,t,i,s,r=>{r===null?a(s.length):(t-=1,a(this._sequentialGetPhysicalItem(e,t,i,s)))},n)})}_nextAggregateItem(e,t,i,s,a,n){try{W(e.pagesDefinition.internal.iterator.next()).then(r=>{if(r===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);s.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,a(null)}else e.pagesDefinition.internal.fullyResolved=!0,a(null);else{const l=this._generateAggregateHash(r);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[r],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const u=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return s.push(u),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(u.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[r],id:l},void a(u)}e.pagesDefinition.internal.workingItem.features.push(r)}this._nextAggregateItem(e,t,i,s,a,n)}},n)}catch(r){n(r)}}_calculateFieldStat(e,t,i){const s=[];for(let a=0;athis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===b.NotInFeatureSet)return t;const i=this._idstates[e];return i===b.InFeatureSet||i===b.NotInFeatureSet?i:t===b.InFeatureSet&&i===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let r=e._known.length;return r>0&&e._known[r-1]==="GETPAGES"&&(e._known.length=r-1),r=e._candidates.length,r>0&&e._candidates[r-1]==="GETPAGES"&&(e._candidates.length=r-1),"success"}const n=await this._parent._expandPagedSet(e,t,i,s,a);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),n}async _getFeatures(e,t,i,s){const a=[],n=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,n)===!0)return await this._expandPagedSet(e,n,0,0,s),this._getFeatures(e,t,i,s);t!==-1&&this._featureCache[t]===void 0&&a.push(t);let r=0;for(let o=e._lastFetchedIndex;on)));o++);if(a.length===0)return"success";const l=new y([],a,!1,null),u=Math.min(a.length,i);await this._parent._getFeatures(l,-1,u,s);for(let o=0;o=this._topnum)break}else if(r===b.NotInFeatureSet)s===null?s={start:n,end:n}:s.end===n-1?s.end=n:(a.push(s),s={start:n,end:n}),i+=1;else if(r===b.Unknown)break;if(i>=t)break}s!==null&&a.push(s);for(let n=a.length-1;n>=0;n--)e._candidates.splice(a[n].start,a[n].end-a[n].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){O._featuresetFunctions.top=function(e){return new ne({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}async function Dt(c,e,t,i){return kt(e,await Tt(c,e,t,i),t,i)}async function Tt(c,e,t,i){var o;const s={...i},a=vt(e,t),n=((o=e.outStatistics)==null?void 0:o[0])!=null,r=Be("featurelayer-pbf-statistics"),l=!n||r;let u;if((t==null?void 0:t.format)==="pbf"&&l)try{u=await ft(c,a,s)}catch(d){if(d.name!=="query:parsing-pbf")throw d;t.format="json"}return(t==null?void 0:t.format)!=="json"&&l||(u=await ht(c,a,s)),Rt(t==null?void 0:t.fieldsIndex,u.fields),u}function Rt(c,e){if(c!=null&&e!=null)for(const t of e){const i=c.get(t.name);i&&Object.assign(t,i.toJSON())}}async function kt(c,e,t,i){var n;const s=t==null?void 0:t.infoFor3D;if(!Ee(c,s)||s==null||!e.assetMaps||!((n=e.features)!=null&&n.length))return pt.fromJSON(e);const{meshFeatureSetFromJSON:a}=await Me(We(()=>import("./meshFeatureSet-Mcou8mDC.js"),__vite__mapDeps([0,1,2,3,4])),i);return a(c,s,e)}function vt(c,e){let t=x.from(c);t.sourceSpatialReference=t.sourceSpatialReference??(e==null?void 0:e.sourceSpatialReference)??null,(e!=null&&e.gdbVersion||e!=null&&e.dynamicDataSource)&&(t=t===c?t.clone():t,t.gdbVersion=c.gdbVersion||e.gdbVersion,t.dynamicDataSource=c.dynamicDataSource?$e.from(c.dynamicDataSource):e.dynamicDataSource);const i=e==null?void 0:e.infoFor3D;if(i!=null&&Ee(c,i)){t=t===c?t.clone():t,t.formatOf3DObjects=null;const{supportedFormats:s,queryFormats:a}=i,n=ce("model/gltf-binary",s)??he("glb",s),r=ce("model/gltf+json",s)??he("gtlf",s);for(const l of a){if(l===n){t.formatOf3DObjects=l;break}l!==r||t.formatOf3DObjects||(t.formatOf3DObjects=l)}if(!t.formatOf3DObjects)throw new Ve("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outFields==null||!t.outFields.includes("*")){t=t===c?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:l,originY:u,originZ:o,translationX:d,translationY:h,translationZ:p,scaleX:g,scaleY:m,scaleZ:I,rotationX:S,rotationY:f,rotationZ:_,rotationDeg:M}=i.transformFieldRoles;t.outFields.push(l,u,o,d,h,p,g,m,I,S,f,_,M)}}return t}function Ee(c,e){return e!=null&&c.returnGeometry===!0&&c.multipatchOption!=="xyFootprint"&&!c.outStatistics}let xt=class te extends O{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Xe(e.toJSON());return Re(t,ke.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){var e,t,i,s,a,n;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((n=(a=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:a.data)==null?void 0:n.supportsM)===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const r=[],l=[];for(const u of this.fields)if(u.type==="oid")r.push(u),l.push(u.name);else for(const o of this._overrideFields)if(o.toLowerCase()===u.name.toLowerCase()){r.push(u),l.push(u.name);break}this.fields=r,this._overrideFields=l}if(this._layer.source&&this._layer.source.sourceJSON){const r=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=v.StandardisedNoInterval,r!=null&&r>=10.61&&(this._databaseType=v.Standardised)):r!=null&&(r>=10.5&&(this._databaseType=v.StandardisedNoInterval,this._requestStandardised=!0),r>=10.61&&(this._databaseType=v.Standardised))}this.objectIdField=this._layer.objectIdField;for(const r of this.fields)r.type==="global-id"&&(this.globalIdField=r.name);this._layer instanceof xe?(this.typeIdField=this._layer.subtypeField??"",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types)}_isInFeatureSet(){return b.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new x;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){var i,s;const t=(s=(i=this._layer)==null?void 0:i.capabilities)==null?void 0:s.query;return!e.outStatistics&&(t==null?void 0:t.supportsFormatPBF)===!0&&(t==null?void 0:t.supportsQuantizationEditMode)===!0}async queryPBF(e){return e.quantizationParameters={mode:"edit"},(await Dt(this._layer.parsedUrl,e,{format:"pbf"},{})).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){e.returnZ=this.hasZ,e.returnM=this.hasM;const i=t==="execute"?Ce:t==="executeForCount"?_t:yt,s=t==="execute"&&this.pbfSupportedForQuery(e);let a=null;if(this.recentlyUsedQueries){const n=this.convertQueryToLruCacheKey(e);a=this.recentlyUsedQueries.getFromCache(n),a===null&&(a=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(n,a),a=a.catch(r=>{var l;throw(l=this.recentlyUsedQueries)==null||l.removeFromCache(n),r}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),a===null&&(a=s!==!0?i(this._layer.parsedUrl.path,e):this.queryPBF(e)),a}async _getFilteredSet(e,t,i,s,a){const n=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,i,s,a);let r="",l=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(r=s.constructClause(),l=!0);const u=new x;this.datesInUnknownTimezone&&(u.timeReferenceUnknownClient=!0),u.where=i===null?t===null?"1=1":"":R(i,n),this._requestStandardised&&(u.sqlFormat="standard"),u.spatialRelationship=this._makeRelationshipEnum(e),u.outSpatialReference=this.spatialReference,u.orderByFields=r!==""?r.split(","):null,u.geometry=t===null?null:t,u.relationParameter=this._makeRelationshipParam(e);let o=await this.executeQuery(u,"executeForIds");return o===null&&(o=[]),this._checkCancelled(a),new y([],o,l,null)}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}async _getFilteredSetUsingPaging(e,t,i,s,a){var p;let n="",r=!1;s!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=s.constructClause(),r=!0);const l=await this.databaseType();let u=i===null?t===null?"1=1":"":R(i,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(u=u!==""?"(("+this._layer.definitionExpression+") AND ("+u+"))":this._layer.definitionExpression);let o=this._maxQueryRate();const d=(p=this._layer.capabilities)==null?void 0:p.query.maxRecordCount;d!=null&&d=this._maxProcessingRate()-1))break}if(n>=i&&a.length===0)break}if(a.length===0)return"success";const r=new x;this._requestStandardised&&(r.sqlFormat="standard"),this.datesInUnknownTimezone&&(r.timeReferenceUnknownClient=!0),r.objectIds=a,r.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),r.returnGeometry=!0,this._removeGeometry===!0&&(r.returnGeometry=!1),r.outSpatialReference=this.spatialReference;const l=await this.executeQuery(r,"execute");if(this._checkCancelled(s),l.error!==void 0)throw new C(D.RequestFailed,{reason:l.error});const u=this._layer.objectIdField;for(let o=0;o=r)break}return m.features.length===0?l:m.features.length===((S=this._layer.capabilities)==null?void 0:S.query.maxRecordCount)&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const a=e.pagesDefinition.internal.lastRetrieved,n=a,r=e.pagesDefinition.internal.lastPage,l=new x;if(this._requestStandardised&&(l.sqlFormat="standard"),l.where=s,l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,this.datesInUnknownTimezone&&(l.timeReferenceUnknownClient=!0),l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const u=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!u.hasOwnProperty("features"))throw new C(D.InvalidStatResponse);const o=[];if(e.pagesDefinition.internal.lastPage!==r)return[];u.features.length>0&&u.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let d=0;d0||i&&i>0)&&(r.size=[t&&t>0?t:0,i&&i>0?i:t+1]),s&&s.length>0&&(r.attachmentTypes=s),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"attachments"});const l=await this._layer.queryAttachments(r),u=[];return l&&l[e]&&l[e].forEach(o=>{const d=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+o.id.toString();let h=null;a&&o.exifInfo&&(h=Ye.convertJsonToArcade(o.exifInfo,"system",!0)),u.push(new He(o.id,o.name,o.contentType,o.size,d,h,o.keywords??null))}),u}return[]}async queryRelatedFeatures(e){var s;const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:(s=e.outFields)==null?void 0:s.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=Qe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await G(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const a={},n=i.data;if(n!=null&&n.relatedRecordGroups){const r=n.spatialReference;for(const l of n.relatedRecordGroups){const u=l.objectId,o=[];for(const d of l.relatedRecords){d.geometry&&(d.geometry.spatialReference=r);const h=new q({geometry:d.geometry?Ze(d.geometry):null,attributes:d.attributes});o.push(h)}a[u]={features:o,exceededTransferLimit:n.exceededTransferLimit===!0}}}return a}throw new C(D.InvalidRequest)}async getFeatureByObjectId(e,t){const i=new x;i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=this.objectIdField+"="+e.toString(),this.datesInUnknownTimezone&&(i.timeReferenceUnknownClient=!0),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const s=await Ce(this._layer.parsedUrl.path,i);return s.features.length===1?s.features[0]:null}async getIdentityUser(){var t;await this.load();const e=(t=pe)==null?void 0:t.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){var s,a;await this.load();const e=(s=pe)==null?void 0:s.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.substring(0,i):t,t){t+="/rest/info";try{const n=await G(t,{query:{f:"json"}});let r="";return(a=n.data)!=null&&a.owningSystemUrl&&(r=n.data.owningSystemUrl),r}catch{return""}}return""}getDataSourceFeatureSet(){const e=new te({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){var a,n;if(this.fsetInfo)return this.fsetInfo;let e=null,{parsedUrl:{path:t},serviceItemId:i=null}=this._layer;if(t){const r=await G(t,{responseType:"json",query:{f:"json"}});e=((a=r==null?void 0:r.data)==null?void 0:a.name)??null,i=((n=r==null?void 0:r.data)==null?void 0:n.serviceItemId)??null}const s=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:i===""?null:i,serviceLayerUrl:t===""?null:t,webMapLayerId:s?this._layer.id??null:null,webMapLayerTitle:s?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}};class le extends O{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){var e,t,i,s,a,n;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const r=[],l=[];for(const u of this.fields)if(u.type==="oid")r.push(u),l.push(u.name);else for(const o of this._overrideFields)if(o.toLowerCase()===u.name.toLowerCase()){r.push(u),l.push(u.name);break}this.fields=r,this._overrideFields=l}this.objectIdField=this._layer.objectIdField;for(const r of this.fields)r.type==="global-id"&&(this.globalIdField=r.name);this._databaseType=v.Standardised,this.hasZ=((i=(t=(e=this._layer)==null?void 0:e.capabilities)==null?void 0:t.data)==null?void 0:i.supportsZ)===!0,this.hasM=((n=(a=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:a.data)==null?void 0:n.supportsM)===!0,this._layer instanceof xe?(this.typeIdField=this._layer.subtypeField??"",this.types=this._layer.subtypes):(this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types)}isTable(){return this._forceIsTable||this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return b.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const i of this.fields)t[i.name]=e.attributes[i.name];return new q({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,s,a){let n="",r=!1;if(s!==null&&(n=s.constructClause(),r=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=new x;l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=i===null?t===null?"1=1":"":R(i,v.Standardised),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=n!==""?n.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const u=await this._layer.queryFeatures(l);if(u===null)return new y([],[],r,null);this._checkCancelled(a);const o=[];return u.features.forEach(d=>{const h=d.attributes[this._layer.objectIdField];o.push(h),this._featureCache[h]=this._changeFeature(d)}),new y([],o,r,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new x;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const s=[];return this._layer.source.items.forEach(a=>{const n=a.attributes[this._layer.objectIdField];s.push(n),this._featureCache[n]=this._changeFeature(a)}),this._wset=new y([],s,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(s=>{const a=s.attributes[this._layer.objectIdField];i.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const s=[];t!==-1&&this._featureCache[t]===void 0&&s.push(t);for(let a=e._lastFetchedIndex;ai)));a++);if(s.length===0)return"success";throw new C(D.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){var g,m,I,S;let i=e.layerDefinition.objectIdField;const s=e.layerDefinition.typeIdField??"",a=[];if(e.layerDefinition.types)for(const f of e.layerDefinition.types)a.push(gt.fromJSON(f));let n=e.layerDefinition.geometryType;n===void 0&&(n=e.featureSet.geometryType||"");let r=e.featureSet.features;const l=t.toJSON();if(!i){let f=!1;for(const _ of e.layerDefinition.fields)if(_.type==="oid"||_.type==="esriFieldTypeOID"){i=_.name,f=!0;break}if(f===!1){let _="FID",M=!0,de=0;for(;M;){let E=!0;for(const qe of e.layerDefinition.fields)if(qe.name===_){E=!1;break}E===!0?M=!1:(de++,_="FID"+de.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:_,alias:_});const z=[];for(let E=0;E_.name):["*"]);u.outFields=o,u.relationshipId=this.relationship.id,u.where="1=1";let d=!0;this._removeGeometry===!0&&(d=!1),u.returnGeometry=d,this._requestStandardised&&(u.sqlFormat="standard"),u.outSpatialReference=this.spatialReference,u.orderByFields=r!==""?r.split(","):null;const h=await n.source.queryRelatedFeatures(u);this._checkCancelled(a);const p=h[this._findObjectId]?h[this._findObjectId].features:[],g=[];for(let _=0;__.name):["*"]);return g=new y(h||p?["GETPAGES"]:[],h||p?[]:["GETPAGES"],r,{outFields:I.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:u,orderByFields:n,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(g,o,0,0,a),g}_expandPagedSet(e,t,i,s,a){return this._expandPagedSetFeatureSet(e,t,i,s,a)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,i){const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,r=this._layer.nativeCapabilities(),l=new _e;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const u=await r.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==n)return 0;const o=u[this._findObjectId]?u[this._findObjectId].features:[];for(let h=0;hi)))&&!(r>=i&&a.length===0);l++);if(a.length===0)return"success";throw new C(D.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,s,a,n,r){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,s,a){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,s,a){return this._relatedLayer.queryAttachments(e,t,i,s,a)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){var e;return((e=this._relatedLayer)==null?void 0:e.preferredTimeZone)??null}get dateFieldsTimeZone(){var e;return((e=this._relatedLayer)==null?void 0:e.dateFieldsTimeZone)??null}get datesInUnknownTimezone(){var e;return(e=this._relatedLayer)==null?void 0:e.datesInUnknownTimezone}get editFieldsInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.editFieldsInfo)??null}get timeInfo(){var e;return((e=this._relatedLayer)==null?void 0:e.timeInfo)??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function At(){w.applicationCache===null&&(w.applicationCache=new w)}async function ie(c,e){if(w.applicationCache){const t=w.applicationCache.getLayerInfo(c);if(t){const a=await t;return new k({url:c,outFields:e,sourceJSON:a})}const i=new k({url:c,outFields:e}),s=(async()=>(await i.load(),i.sourceJSON))();if(w.applicationCache){w.applicationCache.setLayerInfo(c,s);try{return await s,i}catch(a){throw w.applicationCache.clearLayerInfo(c),a}}return await s,i}return new k({url:c,outFields:e})}async function oe(c,e,t,i,s,a=null){return L(await ie(c,["*"]),e,t,i,s,a)}function L(c,e=null,t=null,i=!0,s=null,a=null){if(c instanceof k||$(c)){const r={layer:c,spatialReference:e,outFields:t,includeGeometry:i,lrucache:s,interceptor:a};return c.url||!c.source?new xt(r):new le(r)}const n=L(c.parent,e,t,i,s,a);return n.filter(T.create(c.parent.subtypeField+"="+c.subtypeCode.toString(),c.parent.fieldsIndex,n.dateFieldsTimeZoneDefaultUTC))}async function Lt(c){if(w.applicationCache!==null){const t=w.applicationCache.getLayerInfo(c);if(t!==null)return t}const e=(async()=>{const t=await G(c,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(w.applicationCache!==null){w.applicationCache.setLayerInfo(c,e);try{return await e}catch(t){throw w.applicationCache.clearLayerInfo(c),t}}return e}async function Ot(c,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+c;if(w.applicationCache!==null){const s=w.applicationCache.getLayerInfo(t);if(s!==null)return s}const i=(async()=>{var a;const s=await G(c+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(s.data){const n=s.data;if((a=n.layerDataElements)!=null&&a[0])return n.layerDataElements[0]}throw new C(D.DataElementsNotFound)})();if(w.applicationCache!==null){w.applicationCache.setLayerInfo(t,i);try{return await i}catch(s){throw w.applicationCache.clearLayerInfo(t),s}}return i}async function Pe(c){if(w.applicationCache!==null){const t=w.applicationCache.getLayerInfo(c);if(t!==null)return t}const e=(async()=>{const t=await G(c,{responseType:"json",query:{f:"json"}});if(t.data){const i=t.data;return i.layers||(i.layers=[]),i.tables||(i.tables=[]),i}return{layers:[],tables:[]}})();if(w.applicationCache!==null){w.applicationCache.setLayerInfo(c,e);try{return await e}catch(t){throw w.applicationCache.clearLayerInfo(c),t}}return e}async function Et(c,e){var s,a,n;const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await Pe(c);if(t.metadata=i,((s=i.controllerDatasetLayers)==null?void 0:s.utilityNetworkLayerId)!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const u of i.layers)t.layerNameLkp[u.id]=u.name;if(i.tables)for(const u of i.tables)t.layerNameLkp[u.id]=u.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const l=await Ot(c,r);if(l){t.queryelem=l,(a=t.queryelem)!=null&&a.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const o of t.queryelem.dataElement.domainNetworks){for(const d of o.edgeSources??[]){const h={layerId:d.layerId,sourceId:d.sourceId,className:t.layerNameLkp[d.layerId]??null};h.className&&(t.lkp[h.className]=h)}for(const d of o.junctionSources??[]){const h={layerId:d.layerId,sourceId:d.sourceId,className:t.layerNameLkp[d.layerId]??null};h.className&&(t.lkp[h.className]=h)}}if(t.queryelem.dataElement.terminalConfigurations)for(const o of t.queryelem.dataElement.terminalConfigurations)for(const d of o.terminals)t.terminals.push({terminalId:d.terminalId,terminalName:d.terminalName});const u=await Lt(c+"/"+r);if(((n=u.systemLayers)==null?void 0:n.associationsTableId)!==void 0&&u.systemLayers.associationsTableId!==null){const o=[];t.unVersion>=4&&(o.push("STATUS"),o.push("PERCENTALONG"));let d=await oe(c+"/"+u.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...o],!1,null,null);return await d.load(),t.unVersion>=4&&(d=d.filter(T.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",d.getFieldsIndex(),d.dateFieldsTimeZoneDefaultUTC)),await d.load()),{lkp:t.lkp,associations:d,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function Pt(c,e,t,i=null,s=null,a=!0,n=null,r=null){let l=c.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const u=await oe(l,i,s,a,n,r);return new Nt({layer:c,relatedLayer:u,relationship:e,objectId:t,spatialReference:i,outFields:s,includeGeometry:a,lrucache:n,interceptor:r})}Ae.registerAction(),Ct.registerAction(),H.registerAction(),ot.registerAction(),ne.registerAction();class qt extends Ne{constructor(e,t=null,i=null,s=null){super(),this._map=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const s=L(e,this._overridespref,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async featureSetByName(e,t=!0,i=null){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r{if(r instanceof k){if(r.title===e)return!0}else if($(r)){if(r.title===e)return!0;a.push(r)}return!1});if(n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.tables){const r=this._map.tables.find(l=>!!(l.title&&l.title===e||l.title&&l.title===e));if(r){if(r instanceof k)return this._makeAndAddFeatureSet(r,t,i);if(!r._materializedTable){const l=r.outFields?r:{...r,outFields:["*"]};r._materializedTable=new k(l)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}for(const r of a){if(r.loadStatus==="not-loaded"||r.loadStatus==="loading")try{await r.load()}catch{}const l=r.sublayers.find(u=>u.title===e);if(l)return this._makeAndAddFeatureSet(l,t,i)}return null}async featureSetById(e,t=!0,i=["*"]){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r{if(r instanceof k){if(r.id===e)return!0}else if($(r)){if(r.id===e)return!0;a.push(r)}return!1});if(n)return this._makeAndAddFeatureSet(n,t,i);if(this._map.tables){const r=this._map.tables.find(l=>l.id===e);if(r){if(r instanceof k)return this._makeAndAddFeatureSet(r,t,i);if(!r._materializedTable){const l={...r,outFields:["*"]};r._materializedTable=new k(l)}return await r._materializedTable.load(),this._makeAndAddFeatureSet(r._materializedTable,t,i)}}for(const r of a){if(r.loadStatus==="not-loaded"||r.loadStatus==="loading")try{await r.load()}catch{}const l=r.sublayers.find(u=>u.id===e);if(l)return this._makeAndAddFeatureSet(l,t,i)}return null}}class ue extends Ne{constructor(e,t=null,i=null,s=null){super(),this._url=e,this._overridespref=t,this._lrucache=i,this._interceptor=s,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const s=L(e,this._overridespref,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:s,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),s}async _loadMetaData(){const e=await Pe(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ue(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice(0)).sort();const s=JSON.stringify(i);for(let r=0;r __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/featureUtils-itZGjo5c.js b/dist/assets/featureUtils-itZGjo5c.js new file mode 100644 index 0000000..591bbdf --- /dev/null +++ b/dist/assets/featureUtils-itZGjo5c.js @@ -0,0 +1 @@ +import{Z as U,c_ as g,c$ as L,d0 as b,bK as k,d1 as D,d2 as z,d3 as G,d4 as O,d5 as E,d6 as S,d7 as T,d8 as I,d9 as p}from"./index-J0iiHjMT.js";const _="esri.widgets.Feature.support.featureUtils",F=U.getLogger(_),P=/href=(""|'')/gi,Q=/(\{([^\{\r\n]+)\})/g,H=/\'/g,x=/^\s*expression\//i,B=/(\n)/gi,J=/[\u00A0-\u9999<>\&]/gim,K=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,V=/^(?:mailto:|tel:)/,C="relationships/",w=z("short-date-short-time");function Fe(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function we(e,n){return typeof e=="function"?e(n):e}function Ne(e=""){if(e)return!V.test(e.trim().toLowerCase())}function W(e){return!!e&&x.test(e)}function X(e,n){if(!W(n)||!e)return null;const t=n.replace(x,"").toLowerCase();let r=null;return e.some(i=>i.name.toLowerCase()===t&&(r=i,!0)),r}function Ze(e,n){const t=X(n,e==null?void 0:e.fieldName);return t?t.title||null:e?e.label||e.fieldName:null}function Y(e,n){const t=n.get(e.toLowerCase());return`{${(t==null?void 0:t.fieldName)||e}}`}function ee(e){return e.replaceAll(P,"")}function j(e,n){const t=h(n,e);return t?t.name:e}function $e(e,n){return e&&e.map(t=>j(t,n))}function h(e,n){return e&&typeof e.getField=="function"&&n?e.getField(n)??null:null}function q(e){return`${e}`.trim()}function Ee({attributes:e,globalAttributes:n,layer:t,text:r,expressionAttributes:i,fieldInfoMap:o}){return r?ne({formattedAttributes:n,template:ae(r,{...n,...i,...e},t),fieldInfoMap:o}):""}function ne({formattedAttributes:e,template:n,fieldInfoMap:t}){return q(ee(g(g(n,r=>Y(r,t)),e)))}function te(e,n,t=!1){const r=n[e];if(typeof r=="string"){const i="%27",o=(t?encodeURIComponent(r):r).replaceAll(H,i);n[e]=o}}function re(e,n=!1){const t={...e};return Object.keys(t).forEach(r=>te(r,t,n)),t}function ie(e,n,t){const r=(n=q(n))&&n[0]!=="{";return g(e,re(t,r||!1))}function oe(e,n){return e.replaceAll(Q,(t,r,i)=>{const o=h(n,i);return o?`{${o.name}}`:r})}function ae(e,n,t){const r=oe(e,t);return r&&r.replaceAll(K,(i,o,u)=>ie(i,o||u,n))}function le(e,n){if(typeof e=="string"&&n&&n.dateFormat==null&&(n.places!=null||n.digitSeparator!=null)){const t=Number(e);if(!isNaN(t))return t}return e}function ue(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene")&&"when"in e}function se(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function fe(e){return ue(e)&&se(e)}function ce(e,n){var c;const{fieldInfos:t,fieldName:r,preventPlacesFormatting:i,layer:o,timeZone:u}=n,a=pe(t,r),l=h(o,r);if(a&&!T(r)){const f=l==null?void 0:l.type,d=(c=a.format)==null?void 0:c.dateFormat;if(f==="date"||f==="date-only"||f==="time-only"||f==="timestamp-offset"||d)return E(e,{format:d,fieldType:f,timeZoneOptions:{layerTimeZone:o&&"preferredTimeZone"in o?o.preferredTimeZone:null,viewTimeZone:u,datesInUnknownTimezone:!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone}})}const s=a==null?void 0:a.format;return typeof e=="string"&&T(r)&&s?de(e,s):typeof(e=le(e,s))=="string"||e==null||s==null?A(e):I(e,i?{...p(s),minimumFractionDigits:0,maximumFractionDigits:20}:p(s))}function de(e,n){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?y(e,",",", ",n):e.includes(";")?y(e,";","; ",n):e.includes(" ")?y(e," "," ",n):I(Number(e),p(n))}function y(e,n,t,r){return e.trim().split(n).map(i=>I(Number(i),p(r))).join(t)}function pe(e,n){if(e!=null&&e.length&&n)return e.find(t=>{var r;return((r=t.fieldName)==null?void 0:r.toLowerCase())===n.toLowerCase()})}function me({fieldName:e,graphic:n,layer:t}){if(v(e)||!t||typeof t.getFeatureType!="function")return null;const{typeIdField:r}=t;if(!r||e!==r)return null;const i=t.getFeatureType(n);return i?i.name:null}function ye({fieldName:e,value:n,graphic:t,layer:r}){if(v(e)||!r||typeof r.getFieldDomain!="function")return null;const i=t&&r.getFieldDomain(e,{feature:t});return i&&i.type==="coded-value"?i.getName(n):null}function xe(e,n,t,r){const{creatorField:i,creationDateField:o,editorField:u,editDateField:a}=e;if(!n)return;const l=L(r&&"preferredTimeZone"in r?r.preferredTimeZone:null,!(!r||!("datesInUnknownTimezone"in r))&&!!r.datesInUnknownTimezone,t,w,"date"),s={...w,...l},c=n[a];if(typeof c=="number"){const d=n[u];return{type:"edit",date:b(c,s),user:d}}const f=n[o];if(typeof f=="number"){const d=n[i];return{type:"create",date:b(f,s),user:d}}return null}function Ce(e,n){const t=new Map;return e&&e.forEach(r=>{const i=j(r.fieldName,n);r.fieldName=i,t.set(i.toLowerCase(),r)}),t}function je(e){const n=[];if(!e)return n;const{fieldInfos:t,content:r}=e;return t&&n.push(...t),r&&Array.isArray(r)&&r.forEach(i=>{if(i.type==="fields"){const o=i==null?void 0:i.fieldInfos;o&&n.push(...o)}}),n}function qe(e){return e.replaceAll(J,n=>`&#${n.charCodeAt(0)};`)}function A(e){return typeof e=="string"?e.replaceAll(B,'
'):e}function M(e){var f;const{value:n,fieldName:t,fieldInfos:r,fieldInfoMap:i,layer:o,graphic:u,timeZone:a}=e;if(n==null)return"";const l=ye({fieldName:t,value:n,graphic:u,layer:o});if(l)return l;const s=me({fieldName:t,graphic:u,layer:o});if(s)return s;if(i.get(t.toLowerCase()))return ce(n,{fieldInfos:r||Array.from(i.values()),fieldName:t,layer:o,timeZone:a});const c=(f=o==null?void 0:o.fieldsIndex)==null?void 0:f.get(t);return c&&(G(c)||O(c))?E(n,{fieldType:c.type,timeZoneOptions:{layerTimeZone:o&&"preferredTimeZone"in o?o.preferredTimeZone:null,viewTimeZone:a,datesInUnknownTimezone:!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone}}):A(n)}function Ae({fieldInfos:e,attributes:n,layer:t,graphic:r,fieldInfoMap:i,relatedInfos:o,timeZone:u}){const a={};return o==null||o.forEach(l=>be({attributes:a,relatedInfo:l,fieldInfoMap:i,fieldInfos:e,layer:t,timeZone:u})),n&&Object.keys(n).forEach(l=>{const s=n[l];a[l]=M({fieldName:l,fieldInfos:e,fieldInfoMap:i,layer:t,value:s,graphic:r,timeZone:u})}),a}async function ge(e,n){var c,f;const{layer:t,graphic:r,outFields:i,objectIds:o,returnGeometry:u,spatialReference:a}=e,l=o[0];if(typeof l!="number"&&typeof l!="string"){const d="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:t,graphic:r,objectId:l,requiredFields:i};return F.warn(d,m),null}if(!((f=(c=k(t))==null?void 0:c.operations)!=null&&f.supportsQuery)){const d="The specified layer cannot be queried. The following fields will not be available.",m={layer:t,graphic:r,requiredFields:i,returnGeometry:u};return F.warn(d,m),null}const s=t.createQuery();return s.objectIds=o,s.outFields=i!=null&&i.length?i:[t.objectIdField],s.returnGeometry=!!u,s.returnZ=!!u,s.returnM=!!u,s.outSpatialReference=a,(await t.queryFeatures(s,n)).features[0]}async function Ie(e){var r;if(!((r=e.expressionInfos)!=null&&r.length))return!1;const n=await S(),{arcadeUtils:{hasGeometryFunctions:t}}=n;return t(e)}async function Me({graphic:e,popupTemplate:n,layer:t,spatialReference:r},i){if(!t||!n||(typeof t.load=="function"&&await t.load(i),!e.attributes))return;const o=e.attributes[t.objectIdField];if(o==null)return;const u=[o],a=await n.getRequiredFields(t.fieldsIndex),l=D(a,e),s=l?[]:a,c=n.returnGeometry||await Ie(n);if(l&&!c)return;const f=await ge({layer:t,graphic:e,outFields:s,objectIds:u,returnGeometry:c,spatialReference:r},i);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function v(e=""){return!!e&&e.includes(C)}function he(e){return e?`${C}${e.layerId}/${e.fieldName}`:""}function N({attributes:e,graphic:n,relatedInfo:t,fieldInfos:r,fieldInfoMap:i,layer:o,timeZone:u}){e&&n&&t&&Object.keys(n.attributes).forEach(a=>{const l=he({layerId:t.relation.id.toString(),fieldName:a}),s=n.attributes[a];e[l]=M({fieldName:l,fieldInfos:r,fieldInfoMap:i,layer:o,value:s,graphic:n,timeZone:u})})}function be({attributes:e,relatedInfo:n,fieldInfoMap:t,fieldInfos:r,layer:i,timeZone:o}){var u,a;e&&n&&((u=n.relatedFeatures)==null||u.forEach(l=>N({attributes:e,graphic:l,relatedInfo:n,fieldInfoMap:t,fieldInfos:r,layer:i,timeZone:o})),(a=n.relatedStatsFeatures)==null||a.forEach(l=>N({attributes:e,graphic:l,relatedInfo:n,fieldInfoMap:t,fieldInfos:r,layer:i,timeZone:o})))}const Z=e=>{if(!e)return!1;const n=e.toUpperCase();return n.includes("CURRENT_TIMESTAMP")||n.includes("CURRENT_DATE")||n.includes("CURRENT_TIME")},R=({layer:e,method:n,query:t,definitionExpression:r})=>{var u,a;if(!((a=(u=e.capabilities)==null?void 0:u.query)!=null&&a.supportsCacheHint)||n==="attachments")return;const i=t.where!=null?t.where:null,o=t.geometry!=null?t.geometry:null;Z(r)||Z(i)||(o==null?void 0:o.type)==="extent"||t.resultType==="tile"||(t.cacheHint=!0)},ve=({query:e,layer:n,method:t})=>{R({layer:n,method:t,query:e,definitionExpression:`${n.definitionExpression} ${n.serviceDefinitionExpression}`})},Re=({queryPayload:e,layer:n,method:t})=>{R({layer:n,method:t,query:e,definitionExpression:`${n.definitionExpression} ${n.serviceDefinitionExpression}`})};function Ue(e,n,t){return e&&n&&t?$(e.allLayers,n,t)||$(e.allTables,n,t):null}function $(e,n,t){const r=n.type==="scene"&&n.associatedLayer?n.associatedLayer.url:n.url;return e.filter(fe).find(i=>i!==n&&i.url===r&&i.layerId===t.relatedTableId)}function Le(e){const n=e.getObjectId();return n!=null?`oid:${n}`:`uid:${e.uid}`}export{Ne as C,Ee as D,Fe as E,Le as F,fe as J,W as M,oe as P,$e as R,Ue as T,pe as Y,A as a,Re as b,Me as c,v as d,ve as h,je as i,xe as n,qe as o,Ze as q,Ce as r,ge as s,Ae as u,j as v,we as x,ne as z}; diff --git a/dist/assets/featuresetbase-WjFIOCEy.js b/dist/assets/featuresetbase-WjFIOCEy.js new file mode 100644 index 0000000..ccbace5 --- /dev/null +++ b/dist/assets/featuresetbase-WjFIOCEy.js @@ -0,0 +1 @@ +import{m as Ie}from"./TimeOnly-ljWtUK7N.js";import{n as N,K as De,X as J,H as L,N as v,a as m,r as p,P,d as b,x as Te,y as fe,Q as ue,A as S,B as U,q as x,U as G,E as Ee,b as M,J as be,v as Ne,c as O,D as xe,S as Ae,T as _,V as X,Y}from"./arcadeUtils-OUqwHs4P.js";import{e as de,j as Le,q as ce,f as Se,c as me,a as Ce,b as ve,d as Pe,g as q,k as Ze,F as Re,T as $e,B as k,h as ke,i as B,L as C,I as ee}from"./featureSetUtils-DaHg3px6.js";import{l as Me}from"./portalUtils-MqaWunxU.js";import{u as Ue,D as pe}from"./SpatialFilter-CXhA7RaJ.js";import{bS as ye,fx as Oe,dw as W}from"./index-J0iiHjMT.js";import{x as T}from"./WhereClause-XAMIZ4-B.js";import ne from"./FeatureLayer--S4epFk-.js";import"./hash-SS5GKVPY.js";import"./SubtypeGroupLayer-xK5RtU9X.js";import"./CustomParametersMixin-Y1bOcayO.js";import"./FeatureLayerBase-jpFp8gE3.js";import"./serviceCapabilitiesUtils-26KpT1VN.js";import"./FeatureTemplate-kUgbbA00.js";import"./versionUtils-4v9zIDlv.js";import"./executeQueryJSON-ACj9qY0y.js";import"./query-rG0aX6cE.js";import"./pbfQueryUtils-pWizwTQZ.js";import"./pbf-o0zzptPp.js";import"./queryZScale-IaMm02_2.js";import"./FeatureSet-d4S1oKME.js";import"./executeQueryPBF-vdaOUMid.js";import"./AttachmentInfo-kbEMEIl0.js";import"./executeForIds-wXO8-pll.js";import"./TopFeaturesQuery-E6D2tV-x.js";import"./FeatureType-MpRe7WJj.js";import"./geometryEngineAsync-QjQc0riy.js";import"./editsZScale-Wgw9kbYG.js";import"./FeatureEffectLayer-oBa8pIG5.js";import"./FeatureEffect-5bEV-xG1.js";import"./FeatureReductionLayer-RlitE1N6.js";import"./OrderedLayer-M7k5gLgx.js";function ze(s,n,r,c){if(c.length===1){if(x(c[0]))return Y(s,c[0],-1);if(M(c[0]))return Y(s,c[0].toArray(),-1)}return Y(s,c,-1)}async function te(s,n,r){const c=s.getVariables();if(c.length>0){const F=[];for(let t=0;t{var u,y;if(N(e,1,2,n,r),De(e[0])||J(e[0]))return"Unknown";if(L(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof v)||e[1].hasField("type")===!1)throw new m(n,p.InvalidParameter,r);const o=e[1].field("type");if(P(o)===!1)throw new m(n,p.InvalidParameter,r);switch(b(o).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(((u=e[0].editFieldsInfo)==null?void 0:u.timeZone)??null);case"timeinfo":return z(((y=e[0].timeInfo)==null?void 0:y.timeZone)??null);case"field":if(e[1].hasField("fieldname")&&P(e[1].field("fieldname")))return z(e[0].fieldTimeZone(b(e[1].field("fieldname"))))}throw new m(n,p.InvalidParameter,r)}const t=Te(e[0],fe(n));if(t===null)return null;const a=t.timeZone;return a==="system"?Ie.systemTimeZoneCanonicalName:a.toLowerCase()==="utc"?"UTC":a.toLowerCase()==="unknown"?"Unknown":a})},s.functions.sqltimestamp=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{N(e,1,3,n,r);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(b(e[1])).toSQLWithKeyword();throw new m(n,p.InvalidParameter,r)}if(J(t))return t.toSQLWithKeyword();if(L(t)){if(e.length!==3)throw new m(n,p.InvalidParameter,r);await t.load();const a=b(e[1]);if(J(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new m(n,p.InvalidParameter,r);const u=t.fieldTimeZone(a);return u===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(u).toSQLWithKeyword()}throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"sqltimestamp",min:2,max:4}),s.functions.featuresetbyid=function(n,r){return s.standardFunctionAsync(n,r,(c,F,e)=>{if(N(e,2,4,n,r),e[0]instanceof de){const t=b(e[1]);let a=S(e[2],null);const u=U(S(e[3],!0));if(a===null&&(a=["*"]),x(a)===!1)throw new m(n,p.InvalidParameter,r);return e[0].featureSetById(t,u,a)}throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"featuresetbyid",min:2,max:4}),s.functions.getfeatureset=function(n,r){return s.standardFunctionAsync(n,r,(c,F,e)=>{if(N(e,1,2,n,r),G(e[0])){let t=S(e[1],"datasource");return t===null&&(t="datasource"),t=b(t).toLowerCase(),Le(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference)}throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"getfeatureset",min:1,max:2}),s.functions.featuresetbyportalitem=function(n,r){return s.standardFunctionAsync(n,r,(c,F,e)=>{var o,i;if(N(e,2,5,n,r),e[0]===null)throw new m(n,p.PortalRequired,r);if(e[0]instanceof Ee){const l=b(e[1]),f=b(e[2]);let I=S(e[3],null);const D=U(S(e[4],!0));if(I===null&&(I=["*"]),x(I)===!1)throw new m(n,p.InvalidParameter,r);let w=null;return w=(o=n.services)!=null&&o.portal?n.services.portal:ye.getDefault(),w=Me(e[0],w),ce(l,f,n.spatialReference,I,D,w,n.lrucache,n.interceptor)}if(P(e[0])===!1)throw new m(n,p.PortalRequired,r);const t=b(e[0]),a=b(e[1]);let u=S(e[2],null);const y=U(S(e[3],!0));if(u===null&&(u=["*"]),x(u)===!1)throw new m(n,p.InvalidParameter,r);return ce(t,a,n.spatialReference,u,y,((i=n.services)==null?void 0:i.portal)??ye.getDefault(),n.lrucache,n.interceptor)})},s.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),s.functions.featuresetbyname=function(n,r){return s.standardFunctionAsync(n,r,(c,F,e)=>{if(N(e,2,4,n,r),e[0]instanceof de){const t=b(e[1]);let a=S(e[2],null);const u=U(S(e[3],!0));if(a===null&&(a=["*"]),x(a)===!1)throw new m(n,p.InvalidParameter,r);return e[0].featureSetByName(t,u,a)}throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"featuresetbyname",min:2,max:4}),s.functions.featureset=function(n,r){return s.standardFunction(n,r,(c,F,e)=>{N(e,1,1,n,r);let t=e[0];const a={layerDefinition:{geometryType:"",objectIdField:"",hasM:!1,hasZ:!1,globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(P(t))t=JSON.parse(t),t.layerDefinition!==void 0?(a.layerDefinition=t.layerDefinition,a.featureSet=t.featureSet,t.layerDefinition.spatialReference&&(a.layerDefinition.spatialReference=t.layerDefinition.spatialReference)):(a.featureSet.features=t.features,a.featureSet.geometryType=t.geometryType,a.layerDefinition.geometryType=a.featureSet.geometryType,a.layerDefinition.objectIdField=t.objectIdFieldName??"",a.layerDefinition.typeIdField=t.typeIdFieldName,a.layerDefinition.globalIdField=t.globalIdFieldName,a.layerDefinition.fields=t.fields,t.spatialReference&&(a.layerDefinition.spatialReference=t.spatialReference));else{if(!(e[0]instanceof v))throw new m(n,p.InvalidParameter,r);{t=JSON.parse(e[0].castToText(!0));const u=d(t,"layerdefinition");if(u!==null){a.layerDefinition.geometryType=d(u,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.globalIdField=d(u,"globalidfield",""),a.layerDefinition.objectIdField=d(u,"objectidfield",""),a.layerDefinition.typeIdField=d(u,"typeidfield",""),a.layerDefinition.hasZ=d(u,"hasz",!1)===!0,a.layerDefinition.hasM=d(u,"hasm",!1)===!0;const y=d(u,"spatialreference",null);y&&(a.layerDefinition.spatialReference=ie(y));for(const i of d(u,"fields",[])){const l={name:d(i,"name",""),alias:d(i,"alias",""),type:d(i,"type",""),nullable:d(i,"nullable",!0),editable:d(i,"editable",!0),length:d(i,"length",null),domain:we(d(i,"domain"))};a.layerDefinition.fields.push(l)}const o=d(t,"featureset",null);if(o){const i={};for(const l of a.layerDefinition.fields)i[l.name.toLowerCase()]=l.name;for(const l of d(o,"features",[])){const f={},I=d(l,"attributes",{});for(const D in I)f[i[D.toLowerCase()]]=I[D];a.featureSet.features.push({attributes:f,geometry:he(d(l,"geometry",null))})}}}else{a.layerDefinition.hasZ=d(t,"hasz",!1)===!0,a.layerDefinition.hasM=d(t,"hasm",!1)===!0,a.layerDefinition.geometryType=d(t,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.objectIdField=d(t,"objectidfieldname",""),a.layerDefinition.typeIdField=d(t,"typeidfieldname","");const y=d(t,"spatialreference",null);y&&(a.layerDefinition.spatialReference=ie(y));let o=d(t,"fields",null);if(x(o))for(const f of o){const I={name:d(f,"name",""),alias:d(f,"alias",""),type:d(f,"type",""),nullable:d(f,"nullable",!0),editable:d(f,"editable",!0),length:d(f,"length",null),domain:we(d(f,"domain"))};a.layerDefinition.fields.push(I)}else o=null,a.layerDefinition.fields=o;const i={};for(const f of a.layerDefinition.fields)i[f.name.toLowerCase()]=f.name;let l=d(t,"features",null);if(x(l))for(const f of l){const I={},D=d(f,"attributes",{});for(const w in D)I[i[w.toLowerCase()]]=D[w];a.featureSet.features.push({attributes:I,geometry:he(d(f,"geometry",null))})}else l=null,a.featureSet.features=l}}}if(He(a)===!1)throw new m(n,p.InvalidParameter,r);return a.layerDefinition.geometryType||(a.layerDefinition.geometryType="esriGeometryNull"),Se.create(a,n.spatialReference)})},s.signatures.push({name:"featureset",min:1,max:1}),s.functions.filter=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{if(N(e,2,2,n,r),x(e[0])||M(e[0])){const t=[];let a=e[0];a instanceof be&&(a=a.toArray());let u=null;if(!Ne(e[1]))throw new m(n,p.InvalidParameter,r);u=e[1].createFunction(n);for(const y of a){const o=u(y);Oe(o)?await o===!0&&t.push(y):o===!0&&t.push(y)}return t}if(L(e[0])){const t=await e[0].load(),a=T.create(e[1],t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),u=a.getVariables();if(u.length>0){const y=[];for(let i=0;i{if(N(e,2,2,n,r),L(e[0])){const t=new Ce(e[1]);return new ve({parentfeatureset:e[0],orderbyclause:t})}throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"orderby",min:2,max:2}),s.functions.top=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{if(N(e,2,2,n,r),L(e[0]))return new Pe({parentfeatureset:e[0],topnum:e[1]});if(x(e[0]))return O(e[1])>=e[0].length?e[0].slice(0):e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice(0):e[0].slice(0,O(e[1]));throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"top",min:2,max:2}),s.functions.first=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{if(N(e,1,1,n,r),L(e[0])){const t=await e[0].first(c.abortSignal);if(t!==null){const a=xe.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return a._underlyingGraphic=t,a}return t}return x(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},s.signatures.push({name:"first",min:1,max:1}),s.functions.attachments=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{N(e,1,2,n,r);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof v){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=U(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const a=Ae(e[1].field("types"),!1);a.length>0&&(t.types=a)}}else if(e[1]!==null)throw new m(n,p.InvalidParameter,r)}if(G(e[0])){let a=e[0]._layer;return a instanceof ne&&(a=q(a,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),a===null?[]:L(a)===!1?[]:(await a.load(),a.queryAttachments(e[0].field(a.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new m(n,p.InvalidParameter,r)})},s.signatures.push({name:"attachments",min:1,max:2}),s.functions.featuresetbyrelationshipname=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{N(e,2,4,n,r);const t=e[0],a=b(e[1]);let u=S(e[2],null);const y=U(S(e[3],!0));if(u===null&&(u=["*"]),x(u)===!1)throw new m(n,p.InvalidParameter,r);if(e[0]===null)return null;if(!G(e[0]))throw new m(n,p.InvalidParameter,r);let o=t._layer;if(o instanceof ne&&(o=q(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null||L(o)===!1)return null;o=await o.load();const i=o.relationshipMetaData().filter(w=>w.name===a);if(i.length===0)return null;if(i[0].relationshipTableId!==void 0&&i[0].relationshipTableId!==null&&i[0].relationshipTableId>-1)return Ze(o,i[0],t.field(o.objectIdField),o.spatialReference,u,y,n.lrucache,n.interceptor);let l=o.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+i[0].relatedTableId.toString():l+"/"+i[0].relatedTableId.toString();const f=await Re(l,o.spatialReference,u,y,n.lrucache,n.interceptor);await f.load();let I=f.relationshipMetaData();if(I=I.filter(w=>w.id===i[0].id),t.hasField(i[0].keyField)===!1||t.field(i[0].keyField)===null){const w=await o.getFeatureByObjectId(t.field(o.objectIdField),[i[0].keyField]);if(w){const E=T.create(I[0].keyField+"= @id",f.getFieldsIndex(),f.dateFieldsTimeZoneDefaultUTC);return E.parameters={id:w.attributes[i[0].keyField]},f.filter(E)}return new Ue({parentfeatureset:f})}const D=T.create(I[0].keyField+"= @id",f.getFieldsIndex(),f.dateFieldsTimeZoneDefaultUTC);return D.parameters={id:t.field(i[0].keyField)},f.filter(D)})},s.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),s.functions.featuresetbyassociation=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{N(e,2,3,n,r);const t=e[0],a=b(S(e[1],"")).toLowerCase(),u=P(e[2])?b(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new m(n,p.InvalidParameter,r);let y=t._layer;if(y instanceof ne&&(y=q(y,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),y===null||L(y)===!1)return null;await y.load();const o=y.serviceUrl(),i=await $e(o,n.spatialReference);let l=null,f=null,I=!1;if(u!==null&&u!==""&&u!==void 0){for(const g of i.terminals)g.terminalName===u&&(f=g.terminalId);f===null&&(I=!0)}const D=i.associations.getFieldsIndex(),w=D.get("TOGLOBALID").name,E=D.get("FROMGLOBALID").name,K=D.get("TOTERMINALID").name,V=D.get("FROMTERMINALID").name,j=D.get("FROMNETWORKSOURCEID").name,H=D.get("TONETWORKSOURCEID").name,$=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Fe=D.get("OBJECTID").name;for(const g of y.fields)if(g.type==="global-id"){l=t.field(g.name);break}let Z=null,ae=new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),T.create("0",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),re=new k(new W({name:"side",alias:"side",type:"string"}),T.create("''",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));const A="globalid",se="globalId",le={};for(const g in i.lkp)le[g]=i.lkp[g].sourceId;const R=new ke(new W({name:"classname",alias:"classname",type:"string"}),null,le);let h="";switch(a){case"midspan":{h=`((${w}='${l}') OR ( ${E}='${l}')) AND (${$} IN (5))`,R.codefield=T.create(`CASE WHEN (${w}='${l}') THEN ${j} ELSE ${H} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const g=X(C.findField(i.associations.fields,E));g.name=A,g.alias=A,Z=new k(g,T.create(`CASE WHEN (${E}='${l}') THEN ${w} ELSE ${E} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),ae=i.unVersion>=4?new ee(C.findField(i.associations.fields,D.get("PERCENTALONG").name)):new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),T.create("0",i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"junctionedge":{h=`((${w}='${l}') OR ( ${E}='${l}')) AND (${$} IN (4,6))`,R.codefield=T.create(`CASE WHEN (${w}='${l}') THEN ${j} ELSE ${H} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const g=X(C.findField(i.associations.fields,E));g.name=A,g.alias=A,Z=new k(g,T.create(`CASE WHEN (${E}='${l}') THEN ${w} ELSE ${E} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC)),re=new k(new W({name:"side",alias:"side",type:"string"}),T.create(`CASE WHEN (${$}=4) THEN 'from' ELSE 'to' END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"connected":{let g=`${w}='@T'`,oe=`${E}='@T'`;f!==null&&(g+=` AND ${K}=@A`,oe+=` AND ${V}=@A`),h="(("+g+") OR ("+oe+"))",h=_(h,"@T",l??""),g=_(g,"@T",l??""),f!==null&&(g=_(g,"@A",f.toString()),h=_(h,"@A",f.toString())),R.codefield=T.create("CASE WHEN "+g+` THEN ${j} ELSE ${H} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC);const Q=X(C.findField(i.associations.fields,E));Q.name=A,Q.alias=A,Z=new k(Q,T.create("CASE WHEN "+g+` THEN ${E} ELSE ${w} END`,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC));break}case"container":h=`${w}='${l}' AND ${$} = 2`,f!==null&&(h+=` AND ${K} = `+f.toString()),R.codefield=j,h="( "+h+" )",Z=new B(C.findField(i.associations.fields,E),A,A);break;case"content":h=`(${E}='${l}' AND ${$} = 2)`,f!==null&&(h+=` AND ${V} = `+f.toString()),R.codefield=H,h="( "+h+" )",Z=new B(C.findField(i.associations.fields,w),A,A);break;case"structure":h=`(${w}='${l}' AND ${$} = 3)`,f!==null&&(h+=` AND ${K} = `+f.toString()),R.codefield=j,h="( "+h+" )",Z=new B(C.findField(i.associations.fields,E),A,se);break;case"attached":h=`(${E}='${l}' AND ${$} = 3)`,f!==null&&(h+=` AND ${V} = `+f.toString()),R.codefield=H,h="( "+h+" )",Z=new B(C.findField(i.associations.fields,w),A,se);break;default:throw new m(n,p.InvalidParameter,r)}return I&&(h="1 <> 1"),new C({parentfeatureset:i.associations,adaptedFields:[new ee(C.findField(i.associations.fields,Fe)),new ee(C.findField(i.associations.fields,ge)),Z,re,R,ae],extraFilter:h?T.create(h,i.associations.getFieldsIndex(),i.associations.dateFieldsTimeZoneDefaultUTC):null})})},s.signatures.push({name:"featuresetbyassociation",min:2,max:6}),s.functions.groupby=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{if(N(e,3,3,n,r),!L(e[0]))throw new m(n,p.InvalidParameter,r);const t=await e[0].load(),a=[],u=[];let y=!1,o=[];if(P(e[1]))o.push(e[1]);else if(e[1]instanceof v)o.push(e[1]);else if(x(e[1]))o=e[1];else{if(!M(e[1]))throw new m(n,p.InvalidParameter,r);o=e[1].toArray()}for(const i of o)if(P(i)){const l=T.create(b(i),t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),f=pe(l)===!0?b(i):"%%%%FIELDNAME";a.push({name:f,expression:l}),f==="%%%%FIELDNAME"&&(y=!0)}else{if(!(i instanceof v))throw new m(n,p.InvalidParameter,r);{const l=i.hasField("name")?i.field("name"):"%%%%FIELDNAME",f=i.hasField("expression")?i.field("expression"):"";if(l==="%%%%FIELDNAME"&&(y=!0),!l)throw new m(n,p.InvalidParameter,r);a.push({name:l,expression:T.create(f||l,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(o=[],P(e[2]))o.push(e[2]);else if(x(e[2]))o=e[2];else if(M(e[2]))o=e[2].toArray();else{if(!(e[2]instanceof v))throw new m(n,p.InvalidParameter,r);o.push(e[2])}for(const i of o){if(!(i instanceof v))throw new m(n,p.InvalidParameter,r);{const l=i.hasField("name")?i.field("name"):"",f=i.hasField("statistic")?i.field("statistic"):"",I=i.hasField("expression")?i.field("expression"):"";if(!l||!f||!I)throw new m(n,p.InvalidParameter,r);u.push({name:l,statistic:f.toLowerCase(),expression:T.create(I,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(y){const i={};for(const f of t.fields)i[f.name.toLowerCase()]=1;for(const f of a)f.name!=="%%%%FIELDNAME"&&(i[f.name.toLowerCase()]=1);for(const f of u)f.name!=="%%%%FIELDNAME"&&(i[f.name.toLowerCase()]=1);let l=0;for(const f of a)if(f.name==="%%%%FIELDNAME"){for(;i["field_"+l.toString()]===1;)l++;i["field_"+l.toString()]=1,f.name="FIELD_"+l.toString()}}for(const i of a)await te(i.expression,s,n);for(const i of u)await te(i.expression,s,n);return e[0].groupby(a,u)})},s.signatures.push({name:"groupby",min:3,max:3}),s.functions.distinct=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{if(L(e[0])){N(e,2,2,n,r);const t=await e[0].load(),a=[];let u=[];if(P(e[1]))u.push(e[1]);else if(e[1]instanceof v)u.push(e[1]);else if(x(e[1]))u=e[1];else{if(!M(e[1]))throw new m(n,p.InvalidParameter,r);u=e[1].toArray()}let y=!1;for(const o of u)if(P(o)){const i=T.create(b(o),t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC),l=pe(i)===!0?b(o):"%%%%FIELDNAME";a.push({name:l,expression:i}),l==="%%%%FIELDNAME"&&(y=!0)}else{if(!(o instanceof v))throw new m(n,p.InvalidParameter,r);{const i=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if(i==="%%%%FIELDNAME"&&(y=!0),!i)throw new m(n,p.InvalidParameter,r);a.push({name:i,expression:T.create(l||i,t.getFieldsIndex(),t.dateFieldsTimeZoneDefaultUTC)})}}if(y){const o={};for(const l of t.fields)o[l.name.toLowerCase()]=1;for(const l of a)l.name!=="%%%%FIELDNAME"&&(o[l.name.toLowerCase()]=1);let i=0;for(const l of a)if(l.name==="%%%%FIELDNAME"){for(;o["field_"+i.toString()]===1;)i++;o["field_"+i.toString()]=1,l.name="FIELD_"+i.toString()}}for(const o of a)await te(o.expression,s,n);return e[0].groupby(a,[])}return ze("distinct",c,F,e)})}),s.functions.getfeaturesetinfo=function(n,r){return s.standardFunctionAsync(n,r,async(c,F,e)=>{if(N(e,1,1,n,r),!L(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?v.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},fe(n),!1,!1):null})},s.signatures.push({name:"getfeaturesetinfo",min:1,max:1})}export{Tn as registerFunctions}; diff --git a/dist/assets/featuresetgeom-3-0z5YnY.js b/dist/assets/featuresetgeom-3-0z5YnY.js new file mode 100644 index 0000000..eb2b317 --- /dev/null +++ b/dist/assets/featuresetgeom-3-0z5YnY.js @@ -0,0 +1 @@ +import{Z as S,n as F,d as p,H as i,a as o,r as l}from"./arcadeUtils-OUqwHs4P.js";import{s as w}from"./TimeOnly-ljWtUK7N.js";import{u as c,f as h}from"./SpatialFilter-CXhA7RaJ.js";import{ha as u}from"./index-J0iiHjMT.js";import{relate as I,crosses as A,touches as P,within as g,overlaps as C,contains as O,intersects as R}from"./geometryEngineAsync-QjQc0riy.js";import"./hash-SS5GKVPY.js";import"./WhereClause-XAMIZ4-B.js";function f(r){return r instanceof u}function a(r,t,s,d){return d(r,t,async(y,e,n)=>{if(n.length<2)throw new o(r,l.WrongNumberOfParameters,t);if((n=S(n))[0]===null&&n[1]===null)return!1;if(i(n[0])){if(n[1]instanceof u)return new h({parentfeatureset:n[0],relation:s,relationGeom:n[1]});if(n[1]===null)return new c({parentfeatureset:n[0]});throw new o(r,l.InvalidParameter,t)}if(f(n[0])){if(f(n[1])){switch(s){case"esriSpatialRelEnvelopeIntersects":return R(w(n[0]),w(n[1]));case"esriSpatialRelIntersects":return R(n[0],n[1]);case"esriSpatialRelContains":return O(n[0],n[1]);case"esriSpatialRelOverlaps":return C(n[0],n[1]);case"esriSpatialRelWithin":return g(n[0],n[1]);case"esriSpatialRelTouches":return P(n[0],n[1]);case"esriSpatialRelCrosses":return A(n[0],n[1])}throw new o(r,l.InvalidParameter,t)}if(i(n[1]))return new h({parentfeatureset:n[1],relation:s,relationGeom:n[0]});if(n[1]===null)return!1;throw new o(r,l.InvalidParameter,t)}if(n[0]!==null)throw new o(r,l.InvalidParameter,t);return i(n[1])?new c({parentfeatureset:n[1]}):!(n[1]instanceof u||n[1]===null)&&void 0})}function H(r){r.mode==="async"&&(r.functions.intersects=function(t,s){return a(t,s,"esriSpatialRelIntersects",r.standardFunctionAsync)},r.functions.envelopeintersects=function(t,s){return a(t,s,"esriSpatialRelEnvelopeIntersects",r.standardFunctionAsync)},r.signatures.push({name:"envelopeintersects",min:2,max:2}),r.functions.contains=function(t,s){return a(t,s,"esriSpatialRelContains",r.standardFunctionAsync)},r.functions.overlaps=function(t,s){return a(t,s,"esriSpatialRelOverlaps",r.standardFunctionAsync)},r.functions.within=function(t,s){return a(t,s,"esriSpatialRelWithin",r.standardFunctionAsync)},r.functions.touches=function(t,s){return a(t,s,"esriSpatialRelTouches",r.standardFunctionAsync)},r.functions.crosses=function(t,s){return a(t,s,"esriSpatialRelCrosses",r.standardFunctionAsync)},r.functions.relate=function(t,s){return r.standardFunctionAsync(t,s,(d,y,e)=>{if(e=S(e),F(e,3,3,t,s),f(e[0])&&f(e[1]))return I(e[0],e[1],p(e[2]));if(e[0]instanceof u&&e[1]===null||e[1]instanceof u&&e[0]===null)return!1;if(i(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(i(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(i(e[0])&&e[1]instanceof u)return e[0].relate(e[1],p(e[2]));if(i(e[1])&&e[0]instanceof u)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new o(t,l.InvalidParameter,s)})})}export{H as registerFunctions}; diff --git a/dist/assets/featuresetstats-NfM8OXOZ.js b/dist/assets/featuresetstats-NfM8OXOZ.js new file mode 100644 index 0000000..f207c7a --- /dev/null +++ b/dist/assets/featuresetstats-NfM8OXOZ.js @@ -0,0 +1 @@ +import{m as g}from"./TimeOnly-ljWtUK7N.js";import{n as h,H as l,q as m,P as p,b as d,a as w,r as S,Y as f,A as c,y as v}from"./arcadeUtils-OUqwHs4P.js";import{x as y,r as x}from"./WhereClause-XAMIZ4-B.js";import"./index-J0iiHjMT.js";import"./hash-SS5GKVPY.js";async function s(n,e,a,t,i,r){if(t.length===1){if(m(t[0]))return f(n,t[0],c(t[1],-1));if(d(t[0]))return f(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return f(n,t[0],c(t[1],-1));if(d(t[0]))return f(n,t[0].toArray(),c(t[1],-1));if(l(t[0])){const o=await t[0].load(),u=await F(y.create(t[1],o.getFieldsIndex(),o.dateFieldsTimeZoneDefaultUTC),r,i);return A(i,await t[0].calculateStatistic(n,u,c(t[2],1e3),e.abortSignal))}}else if(t.length===3&&l(t[0])){const o=await t[0].load(),u=await F(y.create(t[1],o.getFieldsIndex(),o.dateFieldsTimeZoneDefaultUTC),r,i);return A(i,await t[0].calculateStatistic(n,u,c(t[2],1e3),e.abortSignal))}return f(n,t,-1)}function A(n,e){return e instanceof x?g.fromReaderAsTimeStampOffset(e.toStorageFormat()):e instanceof Date?g.dateJSAndZoneToArcadeDate(e,v(n)):e}async function F(n,e,a){const t=n.getVariables();if(t.length>0){const i=[];for(let o=0;os("stdev",t,i,r,e,n))},n.functions.variance=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>s("variance",t,i,r,e,n))},n.functions.average=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>s("mean",t,i,r,e,n))},n.functions.mean=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>s("mean",t,i,r,e,n))},n.functions.sum=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>s("sum",t,i,r,e,n))},n.functions.min=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>s("min",t,i,r,e,n))},n.functions.max=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>s("max",t,i,r,e,n))},n.functions.count=function(e,a){return n.standardFunctionAsync(e,a,(t,i,r)=>{if(h(r,1,1,e,a),l(r[0]))return r[0].count(t.abortSignal);if(m(r[0])||p(r[0]))return r[0].length;if(d(r[0]))return r[0].length();throw new w(e,S.InvalidParameter,a)})})}export{Z as registerFunctions}; diff --git a/dist/assets/featuresetstring-bt3R_cQ2.js b/dist/assets/featuresetstring-bt3R_cQ2.js new file mode 100644 index 0000000..4569d6f --- /dev/null +++ b/dist/assets/featuresetstring-bt3R_cQ2.js @@ -0,0 +1 @@ +import{n as o,U as s,_ as T,d as u,H as c,a0 as w,a as m,r as y,a1 as b,N as v,y as f,a2 as A,a3 as x,a4 as g,a5 as F,a6 as D,A as L,a7 as V,a8 as l}from"./arcadeUtils-OUqwHs4P.js";import"./index-J0iiHjMT.js";import"./TimeOnly-ljWtUK7N.js";import"./hash-SS5GKVPY.js";function p(a,e){return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:l[a.field.type],codedValues:a.domain.codedValues.map(t=>({name:t.name,code:t.code}))},f(e)):v.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:l[a.field.type],min:a.domain.min,max:a.domain.max},f(e)):null}function _(a){a.mode==="async"&&(a.functions.domain=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,3,e,t),s(n[0]))return p(T(n[0],u(n[1]),n[2]===void 0?void 0:n[2]),e);if(c(n[0]))return await n[0]._ensureLoaded(),p(w(u(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),e);throw new m(e,y.InvalidParameter,t)})},a.functions.subtypes=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0])){const r=b(n[0]);return r?v.convertObjectToArcadeDictionary(r,f(e)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypes();return r?v.convertObjectToArcadeDictionary(r,f(e)):null}throw new m(e,y.InvalidParameter,t)})},a.functions.domainname=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return A(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=w(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domainname",min:2,max:4}),a.functions.domaincode=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return g(n[0],u(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=w(u(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return F(r,n[2])}throw new m(e,y.InvalidParameter,t)})},a.signatures.push({name:"domaincode",min:2,max:4})),a.functions.text=function(e,t){return a.standardFunctionAsync(e,t,(i,d,n)=>{if(o(n,1,2,e,t),!c(n[0]))return D(n[0],n[1]);{const r=L(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",i.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",i.abortSignal)}})},a.functions.gdbversion=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new m(e,y.InvalidParameter,t)})},a.functions.schema=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),c(n[0]))return await n[0].load(),v.convertObjectToArcadeDictionary(n[0].schema(),f(e));if(s(n[0])){const r=V(n[0]);return r?v.convertObjectToArcadeDictionary(r,f(e)):null}throw new m(e,y.InvalidParameter,t)})}}export{_ as registerFunctions}; diff --git a/dist/assets/fetchService-wPWKuma6.js b/dist/assets/fetchService-wPWKuma6.js new file mode 100644 index 0000000..aea1fe5 --- /dev/null +++ b/dist/assets/fetchService-wPWKuma6.js @@ -0,0 +1 @@ +import{t as s}from"./requestPresets-18nzHK5y.js";async function b(t,a){const r=await s(t,a);y(r),o(r);const n={serviceJSON:r};if((r.currentVersion??0)<10.5)return n;const e=await s(t+"/layers",a);return y(e),o(e),n.layersJSON={layers:e.layers,tables:e.tables},n}function i(t){return t.type==="Feature Layer"||t.type==="Oriented Imagery Layer"}function l(t){return t.type==="Table"}function o(t){var a,r;t.layers=(a=t.layers)==null?void 0:a.filter(i),t.tables=(r=t.tables)==null?void 0:r.filter(l)}function c(t){t.type||(t.type="Feature Layer")}function u(t){t.type||(t.type="Table")}function y(t){var a,r;(a=t.layers)==null||a.forEach(c),(r=t.tables)==null||r.forEach(u)}export{b as t}; diff --git a/dist/assets/fi_FI-d4Rs7vi8.js b/dist/assets/fi_FI-d4Rs7vi8.js new file mode 100644 index 0000000..8fa9a0f --- /dev/null +++ b/dist/assets/fi_FI-d4Rs7vi8.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"jKr.",_era_bc:"eKr.",A:"ap.",P:"ip.",AM:"ap.",PM:"ip.","A.M.":"ap.","P.M.":"ip.",January:"tammikuuta",February:"helmikuuta",March:"maaliskuuta",April:"huhtikuuta",May:"toukokuuta",June:"kesäkuuta",July:"heinäkuuta",August:"elokuuta",September:"syyskuuta",October:"lokakuuta",November:"marraskuuta",December:"joulukuuta",Jan:"tammik.",Feb:"helmik.",Mar:"maalisk.",Apr:"huhtik.","May(short)":"toukok.",Jun:"kesäk.",Jul:"heinäk.",Aug:"elok.",Sep:"syysk.",Oct:"lokak.",Nov:"marrask.",Dec:"jouluk.",Sunday:"sunnuntaina",Monday:"maanantaina",Tuesday:"tiistaina",Wednesday:"keskiviikkona",Thursday:"torstaina",Friday:"perjantaina",Saturday:"lauantaina",Sun:"su",Mon:"ma",Tue:"ti",Wed:"ke",Thu:"to",Fri:"pe",Sat:"la",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Tarkennus",Play:"Toista",Stop:"Lopeta",Legend:"Selite","Press ENTER to toggle":"",Loading:"Ladataan",Home:"Aloitussivu",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Tulosta",Image:"kuva",Data:"Data",Print:"Tulosta","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Mistä %1 mihin %2","From %1":"Mistä %1","To %1":"Mihin %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/dist/assets/floating-ui-McpI0u1Z.js b/dist/assets/floating-ui-McpI0u1Z.js new file mode 100644 index 0000000..05c8a63 --- /dev/null +++ b/dist/assets/floating-ui-McpI0u1Z.js @@ -0,0 +1,5 @@ +import{ch as It}from"./index-J0iiHjMT.js";import{d as zt}from"./debounce-HnHf1UOZ.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const Tt=["top","right","bottom","left"],ht=["start","end"],wt=Tt.reduce((t,e)=>t.concat(e,e+"-"+ht[0],e+"-"+ht[1]),[]),X=Math.min,_=Math.max,Z=Math.round,Q=Math.floor,$=t=>({x:t,y:t}),_t={left:"right",right:"left",bottom:"top",top:"bottom"},jt={start:"end",end:"start"};function lt(t,e,n){return _(t,X(e,n))}function U(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function k(t){return t.split("-")[1]}function Lt(t){return t==="x"?"y":"x"}function ut(t){return t==="y"?"height":"width"}function it(t){return["top","bottom"].includes(W(t))?"y":"x"}function dt(t){return Lt(it(t))}function Et(t,e,n){n===void 0&&(n=!1);const o=k(t),i=dt(t),r=ut(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=et(s)),[s,et(s)]}function Ut(t){const e=et(t);return[tt(t),e,tt(e)]}function tt(t){return t.replace(/start|end/g,e=>jt[e])}function Yt(t,e,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?r:s;default:return[]}}function Xt(t,e,n,o){const i=k(t);let r=Yt(W(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(tt)))),r}function et(t){return t.replace(/left|right|bottom|top/g,e=>_t[e])}function qt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Dt(t){return typeof t!="number"?qt(t):{top:t,right:t,bottom:t,left:t}}function nt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function yt(t,e,n){let{reference:o,floating:i}=t;const r=it(e),s=dt(e),c=ut(s),l=W(e),a=r==="y",p=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[c]/2-i[c]/2;let f;switch(l){case"top":f={x:p,y:o.y-i.height};break;case"bottom":f={x:p,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(k(e)){case"start":f[s]-=h*(n&&a?-1:1);break;case"end":f[s]+=h*(n&&a?-1:1);break}return f}const Gt=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:d}=yt(a,o,l),h=o,f={},u=0;for(let g=0;g({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:l}=e,{element:a,padding:p=0}=U(t,e)||{};if(a==null)return{};const d=Dt(p),h={x:n,y:o},f=dt(i),u=ut(f),g=await s.getDimensions(a),w=f==="y",m=w?"top":"left",y=w?"bottom":"right",x=w?"clientHeight":"clientWidth",b=r.reference[u]+r.reference[f]-h[f]-r.floating[u],v=h[f]-r.reference[f],R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let O=R?R[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(R)))&&(O=c.floating[x]||r.floating[u]);const L=b/2-v/2,D=O/2-g[u]/2-1,A=X(d[m],D),E=X(d[y],D),P=A,z=O-g[u]-E,C=O/2-g[u]/2+L,F=lt(P,C,z),M=!l.arrow&&k(i)!=null&&C!=F&&r.reference[u]/2-(Ck(i)===t),...n.filter(i=>k(i)!==t)]:n.filter(i=>W(i)===i)).filter(i=>t?k(i)===t||(e?tt(i)!==i:!1):!0)}const Qt=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:c,platform:l,elements:a}=e,{crossAxis:p=!1,alignment:d,allowedPlacements:h=wt,autoAlignment:f=!0,...u}=U(t,e),g=d!==void 0||h===wt?Jt(d||null,f,h):h,w=await G(e,u),m=((n=s.autoPlacement)==null?void 0:n.index)||0,y=g[m];if(y==null)return{};const x=Et(y,r,await(l.isRTL==null?void 0:l.isRTL(a.floating)));if(c!==y)return{reset:{placement:g[0]}};const b=[w[W(y)],w[x[0]],w[x[1]]],v=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:b}],R=g[m+1];if(R)return{data:{index:m+1,overflows:v},reset:{placement:R}};const O=v.map(A=>{const E=k(A.placement);return[A.placement,E&&p?A.overflows.slice(0,2).reduce((P,z)=>P+z,0):A.overflows[0],A.overflows]}).sort((A,E)=>A[1]-E[1]),D=((i=O.filter(A=>A[2].slice(0,k(A[0])?2:3).every(E=>E<=0))[0])==null?void 0:i[0])||O[0][0];return D!==c?{data:{index:m+1,overflows:v},reset:{placement:D}}:{}}}},xt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:l,elements:a}=e,{mainAxis:p=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:u="none",flipAlignment:g=!0,...w}=U(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const m=W(i),y=W(c)===c,x=await(l.isRTL==null?void 0:l.isRTL(a.floating)),b=h||(y||!g?[et(c)]:Ut(c));!h&&u!=="none"&&b.push(...Xt(c,g,u,x));const v=[c,...b],R=await G(e,w),O=[];let L=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&O.push(R[m]),d){const P=Et(i,s,x);O.push(R[P[0]],R[P[1]])}if(L=[...L,{placement:i,overflows:O}],!O.every(P=>P<=0)){var D,A;const P=(((D=r.flip)==null?void 0:D.index)||0)+1,z=v[P];if(z)return{data:{index:P,overflows:L},reset:{placement:z}};let C=(A=L.filter(F=>F.overflows[0]<=0).sort((F,M)=>F.overflows[1]-M.overflows[1])[0])==null?void 0:A.placement;if(!C)switch(f){case"bestFit":{var E;const F=(E=L.map(M=>[M.placement,M.overflows.filter(B=>B>0).reduce((B,$t)=>B+$t,0)]).sort((M,B)=>M[1]-B[1])[0])==null?void 0:E[0];F&&(C=F);break}case"initialPlacement":C=c;break}if(i!==C)return{reset:{placement:C}}}return{}}}};function vt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function bt(t){return Tt.some(e=>t[e]>=0)}const Zt=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=U(t,e);switch(o){case"referenceHidden":{const r=await G(e,{...i,elementContext:"reference"}),s=vt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:bt(s)}}}case"escaped":{const r=await G(e,{...i,altBoundary:!0}),s=vt(r,n.floating);return{data:{escapedOffsets:s,escaped:bt(s)}}}default:return{}}}}};async function te(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=W(n),c=k(n),l=it(n)==="y",a=["left","top"].includes(s)?-1:1,p=r&&l?-1:1,d=U(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:u}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return c&&typeof u=="number"&&(f=c==="end"?u*-1:u),l?{x:f*p,y:h*a}:{x:h*a,y:f*p}}const ee=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:o}=e,i=await te(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},ne=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:m,y}=w;return{x:m,y}}},...l}=U(t,e),a={x:n,y:o},p=await G(e,l),d=it(W(i)),h=Lt(d);let f=a[h],u=a[d];if(r){const w=h==="y"?"top":"left",m=h==="y"?"bottom":"right",y=f+p[w],x=f-p[m];f=lt(y,f,x)}if(s){const w=d==="y"?"top":"left",m=d==="y"?"bottom":"right",y=u+p[w],x=u-p[m];u=lt(y,u,x)}const g=c.fn({...e,[h]:f,[d]:u});return{...g,data:{x:g.x-n,y:g.y-o}}}}};function I(t){return Ft(t)?(t.nodeName||"").toLowerCase():"#document"}function S(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function V(t){var e;return(e=(Ft(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ft(t){return t instanceof Node||t instanceof S(t).Node}function H(t){return t instanceof Element||t instanceof S(t).Element}function N(t){return t instanceof HTMLElement||t instanceof S(t).HTMLElement}function Ot(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof S(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function oe(t){return["table","td","th"].includes(I(t))}function mt(t){const e=gt(),n=T(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function ie(t){let e=q(t);for(;N(e)&&!st(e);){if(mt(e))return e;e=q(e)}return null}function gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function st(t){return["html","body","#document"].includes(I(t))}function T(t){return S(t).getComputedStyle(t)}function rt(t){return H(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function q(t){if(I(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ot(t)&&t.host||V(t);return Ot(e)?e.host:e}function Mt(t){const e=q(t);return st(e)?t.ownerDocument?t.ownerDocument.body:t.body:N(e)&&J(e)?e:Mt(e)}function K(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Mt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=S(i);return r?e.concat(s,s.visualViewport||[],J(i)?i:[],s.frameElement&&n?K(s.frameElement):[]):e.concat(i,K(i,[],n))}function kt(t){const e=T(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=N(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,c=Z(n)!==r||Z(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function pt(t){return H(t)?t:t.contextElement}function Y(t){const e=pt(t);if(!N(e))return $(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=kt(e);let s=(r?Z(n.width):n.width)/o,c=(r?Z(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const se=$(0);function Nt(t){const e=S(t);return!gt()||!e.visualViewport?se:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function re(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==S(t)?!1:e}function j(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=pt(t);let s=$(1);e&&(o?H(o)&&(s=Y(o)):s=Y(t));const c=re(r,n,o)?Nt(r):$(0);let l=(i.left+c.x)/s.x,a=(i.top+c.y)/s.y,p=i.width/s.x,d=i.height/s.y;if(r){const h=S(r),f=o&&H(o)?S(o):o;let u=h.frameElement;for(;u&&o&&f!==h;){const g=Y(u),w=u.getBoundingClientRect(),m=T(u),y=w.left+(u.clientLeft+parseFloat(m.paddingLeft))*g.x,x=w.top+(u.clientTop+parseFloat(m.paddingTop))*g.y;l*=g.x,a*=g.y,p*=g.x,d*=g.y,l+=y,a+=x,u=S(u).frameElement}}return nt({width:p,height:d,x:l,y:a})}function ce(t){let{rect:e,offsetParent:n,strategy:o}=t;const i=N(n),r=V(n);if(n===r)return e;let s={scrollLeft:0,scrollTop:0},c=$(1);const l=$(0);if((i||!i&&o!=="fixed")&&((I(n)!=="body"||J(r))&&(s=rt(n)),N(n))){const a=j(n);c=Y(n),l.x=a.x+n.clientLeft,l.y=a.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-s.scrollLeft*c.x+l.x,y:e.y*c.y-s.scrollTop*c.y+l.y}}function le(t){return Array.from(t.getClientRects())}function Bt(t){return j(V(t)).left+rt(t).scrollLeft}function ae(t){const e=V(t),n=rt(t),o=t.ownerDocument.body,i=_(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=_(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Bt(t);const c=-n.scrollTop;return T(o).direction==="rtl"&&(s+=_(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function fe(t,e){const n=S(t),o=V(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,l=0;if(i){r=i.width,s=i.height;const a=gt();(!a||a&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:r,height:s,x:c,y:l}}function ue(t,e){const n=j(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=N(t)?Y(t):$(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,l=i*r.x,a=o*r.y;return{width:s,height:c,x:l,y:a}}function At(t,e,n){let o;if(e==="viewport")o=fe(t,n);else if(e==="document")o=ae(V(t));else if(H(e))o=ue(e,n);else{const i=Nt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return nt(o)}function Wt(t,e){const n=q(t);return n===e||!H(n)||st(n)?!1:T(n).position==="fixed"||Wt(n,e)}function de(t,e){const n=e.get(t);if(n)return n;let o=K(t,[],!1).filter(c=>H(c)&&I(c)!=="body"),i=null;const r=T(t).position==="fixed";let s=r?q(t):t;for(;H(s)&&!st(s);){const c=T(s),l=mt(s);!l&&c.position==="fixed"&&(i=null),(r?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||J(s)&&!l&&Wt(t,s))?o=o.filter(p=>p!==s):i=c,s=q(s)}return e.set(t,o),o}function me(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?de(e,this._c):[].concat(n),o],c=s[0],l=s.reduce((a,p)=>{const d=At(e,p,i);return a.top=_(d.top,a.top),a.right=X(d.right,a.right),a.bottom=X(d.bottom,a.bottom),a.left=_(d.left,a.left),a},At(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ge(t){return kt(t)}function pe(t,e,n){const o=N(e),i=V(e),r=n==="fixed",s=j(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const l=$(0);if(o||!o&&!r)if((I(e)!=="body"||J(i))&&(c=rt(e)),o){const a=j(e,!0,r,e);l.x=a.x+e.clientLeft,l.y=a.y+e.clientTop}else i&&(l.x=Bt(i));return{x:s.left+c.scrollLeft-l.x,y:s.top+c.scrollTop-l.y,width:s.width,height:s.height}}function Rt(t,e){return!N(t)||T(t).position==="fixed"?null:e?e(t):t.offsetParent}function Ht(t,e){const n=S(t);if(!N(t))return n;let o=Rt(t,e);for(;o&&oe(o)&&T(o).position==="static";)o=Rt(o,e);return o&&(I(o)==="html"||I(o)==="body"&&T(o).position==="static"&&!mt(o))?n:o||ie(t)||n}const he=async function(t){let{reference:e,floating:n,strategy:o}=t;const i=this.getOffsetParent||Ht,r=this.getDimensions;return{reference:pe(e,await i(n),o),floating:{x:0,y:0,...await r(n)}}};function we(t){return T(t).direction==="rtl"}const at={convertOffsetParentRelativeRectToViewportRelativeRect:ce,getDocumentElement:V,getClippingRect:me,getOffsetParent:Ht,getElementRects:he,getClientRects:le,getDimensions:ge,getScale:Y,isElement:H,isRTL:we};function ye(t,e){let n=null,o;const i=V(t);function r(){clearTimeout(o),n&&n.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),r();const{left:a,top:p,width:d,height:h}=t.getBoundingClientRect();if(c||e(),!d||!h)return;const f=Q(p),u=Q(i.clientWidth-(a+d)),g=Q(i.clientHeight-(p+h)),w=Q(a),y={rootMargin:-f+"px "+-u+"px "+-g+"px "+-w+"px",threshold:_(0,X(1,l))||1};let x=!0;function b(v){const R=v[0].intersectionRatio;if(R!==l){if(!x)return s();R?s(!1,R):o=setTimeout(()=>{s(!1,1e-7)},100)}x=!1}try{n=new IntersectionObserver(b,{...y,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,y)}n.observe(t)}return s(!0),r}function xe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,a=pt(t),p=i||r?[...a?K(a):[],...K(e)]:[];p.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),r&&m.addEventListener("resize",n)});const d=a&&c?ye(a,n):null;let h=-1,f=null;s&&(f=new ResizeObserver(m=>{let[y]=m;y&&y.target===a&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(e)})),n()}),a&&!l&&f.observe(a),f.observe(e));let u,g=l?j(t):null;l&&w();function w(){const m=j(t);g&&(m.x!==g.x||m.y!==g.y||m.width!==g.width||m.height!==g.height)&&n(),g=m,u=requestAnimationFrame(w)}return n(),()=>{p.forEach(m=>{i&&m.removeEventListener("scroll",n),r&&m.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(u)}}const ve=(t,e,n)=>{const o=new Map,i={platform:at,...n},r={...i.platform,_c:o};return Gt(t,e,{...i,platform:r})};function be(t){return Oe(t)}function ct(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Oe(t){for(let e=t;e;e=ct(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=ct(t);e;e=ct(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||n.filter!=="none"||e.tagName==="BODY"))return e}return null}(function(){{const e=at.getOffsetParent;at.getOffsetParent=n=>e(n,be)}})();const Vt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:r,flipPlacements:s,offsetDistance:c,offsetSkidding:l,arrowEl:a,type:p})=>{var b;if(!e||!n)return null;const{x:d,y:h,placement:f,strategy:u,middlewareData:g}=await ve(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:Pe(n,i),middleware:Re({placement:i,flipDisabled:r,flipPlacements:s,offsetDistance:c,offsetSkidding:l,arrowEl:a,type:p})});if(a&&g.arrow){const{x:v,y:R}=g.arrow,O=f.split("-")[0],L=v!=null?"left":"top",D=Se[O],A={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=O==="left"||O==="right"?"horizontal":"vertical"),Object.assign(a.style,{...A,[L]:`${L=="left"?v:R}px`,[O]:"100%",transform:D})}const m=((b=g.hide)==null?void 0:b.referenceHidden)?"hidden":null,y=m?"none":null;n.setAttribute(Ae,f);const x=`translate(${Math.round(d)}px,${Math.round(h)}px)`;Object.assign(n.style,{visibility:m,pointerEvents:y,position:u,top:"0",left:"0",transform:x})},Ae="data-placement",Pt=100,Ct=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],De="bottom-start",Fe={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function Re({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:r,type:s}){const c=[ne(),Zt()];if(s==="menu")return[...c,xt({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(s==="popover"||s==="tooltip"){const l=[...c,ee({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?l.push(Qt({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||l.push(xt(n?{fallbackPlacements:n}:{})),r&&l.push(Kt({element:r})),l}return[]}function Me(t,e){const n=t.filter(o=>Ct.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${Ct.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function Pe(t,e){const n=["left","right"];return It(t)==="rtl"&&n.reverse(),e.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function ke(t,e,n=!1){return(n?Ce(t):Vt)(t,e)}function Ce(t){let e=ot.get(t);return e||(e=zt(Vt,Pt,{leading:!0,maxWait:Pt}),ot.set(t,e),e)}const Se={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},ft=new WeakMap,ot=new WeakMap;function Ne(t,e,n){if(!n||!e)return;Te(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning,top:"0",left:"0"});const o=xe;ft.set(t,o(e,n,()=>t.reposition()))}function Te(t,e,n){var o,i;!n||!e||((o=ft.get(t))==null||o(),ft.delete(t),(i=ot.get(t))==null||i.cancel(),ot.delete(t))}const St=4,Be=Math.ceil(Math.hypot(St,St));export{Fe as F,Te as a,De as b,Ne as c,Be as d,Me as f,ke as r}; diff --git a/dist/assets/form-2Iq0hI3D.js b/dist/assets/form-2Iq0hI3D.js new file mode 100644 index 0000000..b624e60 --- /dev/null +++ b/dist/assets/form-2Iq0hI3D.js @@ -0,0 +1,5 @@ +import{z as I,cm as b,t as S}from"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function R(e,t){if(b(t.parentElement,"[form]"))return!0;const n="calciteInternalFormComponentRegister";let a=!1;return e.addEventListener(n,d=>{a=d.composedPath().some(u=>E.has(u)),d.stopPropagation()},{once:!0}),t.dispatchEvent(new CustomEvent(n,{bubbles:!0,composed:!0})),a}function L(e){const{formEl:t}=e;return t?(t.requestSubmit(),!0):!1}function P(e){var t;(t=e.formEl)==null||t.reset()}function V(e){const{el:t,value:r}=e,n=y(e);if(!n||R(n,t))return;e.formEl=n,e.defaultValue=r,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||H).bind(e);n.addEventListener("reset",a),m.set(e.el,a),E.add(t)}function y(e){const{el:t,form:r}=e;return r?I(t,{id:r}):b(t,"form")}function H(){if(h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function q(e){const{el:t,formEl:r}=e;if(!r)return;const n=m.get(t);r.removeEventListener("reset",n),m.delete(t),e.formEl=null,E.delete(t)}function W(e,t){e.defaultValue=t}const g=e=>{e.target.dispatchEvent(new CustomEvent("calciteInternalHiddenInputChange",{bubbles:!0}))},v=e=>e.removeEventListener("change",g);function w(e){const{el:t,formEl:r,name:n,value:a}=e,{ownerDocument:d}=t,u=t.querySelectorAll(`input[slot="${f}"]`);if(!r||!n){u.forEach(s=>{v(s),s.remove()});return}const i=Array.isArray(a)?a:[a],l=[],F=new Set;u.forEach(s=>{const o=i.find(k=>k==s.value);o!=null?(F.add(o),C(e,s,o)):l.push(s)});let c;i.forEach(s=>{if(F.has(s))return;let o=l.pop();o||(o=d.createElement("input"),o.slot=f),c||(c=d.createDocumentFragment()),c.append(o),o.addEventListener("change",g),C(e,o,s)}),c&&t.append(c),l.forEach(s=>{v(s),s.remove()})}function C(e,t,r){var l;const{defaultValue:n,disabled:a,form:d,name:u,required:i}=e;t.defaultValue=n,t.disabled=a,t.name=u,t.required=i,t.tabIndex=-1,d?t.setAttribute("form",d):t.removeAttribute("form"),h(e)?(t.checked=e.checked,t.defaultChecked=e.defaultChecked,t.value=e.checked?r||"on":""):t.value=r||"",(l=e.syncHiddenFormInput)==null||l.call(e,t)}const x=({component:e})=>(w(e),S("slot",{name:f}));export{x as H,W as a,V as c,q as d,y as f,P as r,L as s}; diff --git a/dist/assets/fr_FR-hDvN628_.js b/dist/assets/fr_FR-hDvN628_.js new file mode 100644 index 0000000..2acbfe2 --- /dev/null +++ b/dist/assets/fr_FR-hDvN628_.js @@ -0,0 +1 @@ +const o={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",January:"Janvier",February:"Février",March:"Mars",April:"Avril",May:"Mai",June:"Juin",July:"Juillet",August:"Août",September:"Septembre",October:"Octobre",November:"Novembre",December:"Décembre",Jan:"Jan",Feb:"Fév",Mar:"Mar",Apr:"Avr","May(short)":"Mai",Jun:"Jui",Jul:"Jul",Aug:"Aoû",Sep:"Sep",Oct:"Oct",Nov:"Nov",Dec:"Déc",Sunday:"Dimanche",Monday:"Lundi",Tuesday:"Mardi",Wednesday:"Mercredi",Thursday:"Jeudi",Friday:"Vendredi",Saturday:"Samedi",Sun:"Dim",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Jeu",Fri:"Ven",Sat:"Sam",_dateOrd:function(e){let r="e";return(e<11||e>13)&&e%10==1&&(r="er"),r},"Zoom Out":"Zoom Arrière",Play:"Joue",Stop:"Arrête",Legend:"Légende","Press ENTER to toggle":"cliquez, appuyez ou appuyez sur entrée pour basculer",Loading:"Charger",Home:"Accueil",Chart:"Graphique","Serial chart":"Graphique sérial","X/Y chart":"Graphique X/Y","Pie chart":"Camembert","Gauge chart":"Jauge graphique","Radar chart":"Carte radar","Sankey diagram":"Graphique Sankey","Flow diagram":"représentation schématique","Chord diagram":"diagramme d'accord","TreeMap chart":"carte de l'arbre","Sliced chart":"graphique en tranches",Series:"Séries","Candlestick Series":"Séries chandelier","OHLC Series":"Séries OHLC","Column Series":"Séries de colonnes","Line Series":"Série de lignes","Pie Slice Series":"Tarte tranche Séries","Funnel Series":"Séries d'entonnoir","Pyramid Series":"Séries pyramidale","X/Y Series":"Séries X/Y",Map:"Mappe","Press ENTER to zoom in":"Appuyez sur ENTER pour zoomer","Press ENTER to zoom out":"Appuyez sur ENTER pour effectuer un zoom arrière","Use arrow keys to zoom in and out":"Utilisez les touches fléchées pour zoomer et dézoomer","Use plus and minus keys on your keyboard to zoom in and out":"Utilisez les touches plus et moins de votre clavier pour effectuer un zoom avant ou arrière",Export:"Exporter",Image:"Image",Data:"Data",Print:"Imprimer","Press ENTER to open":"Cliquez, appuyez ou appuyez sur ENTER pour ouvrir","Press ENTER to print.":"Cliquez, appuyez ou appuyez sur ENTER pour imprimer","Press ENTER to export as %1.":"Cliquez, appuyez ou appuyez sur ENTER pour exporter comme %1","(Press ESC to close this message)":"(Appuyez sur ESC pour fermer ce message)","Image Export Complete":"Exportation d'image terminée","Export operation took longer than expected. Something might have gone wrong.":"L'exportation a pris plus de temps que prévu. Quelque chose aurait mal tourné.","Saved from":"Enregistré de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilisez la touche TAB pour sélectionner les boutons des poignées ou les flèches gauche et droite pour modifier la sélection.","Use left and right arrows to move selection":"Utilisez les flèches gauche et droite pour déplacer la sélection","Use left and right arrows to move left selection":"Utilisez les flèches gauche et droite pour déplacer la sélection gauche","Use left and right arrows to move right selection":"Utilisez les flèches gauche et droite pour déplacer la sélection droite","Use TAB select grip buttons or up and down arrows to change selection":"Utilisez les boutons de sélection TAB ou les flèches vers le haut et le bas pour modifier la sélection.","Use up and down arrows to move selection":"Utilisez les flèches haut et bas pour déplacer la sélection","Use up and down arrows to move lower selection":"Utilisez les flèches haut et bas pour déplacer la sélection inférieure","Use up and down arrows to move upper selection":"Utilisez les flèches haut et bas pour déplacer la sélection supérieure","From %1 to %2":"De %1 à %2","From %1":"De %1","To %1":"à %1","No parser available for file: %1":"Aucun analyseur disponible pour le fichier: %1","Error parsing file: %1":"Erreur d'analyse du fichier: %1","Unable to load file: %1":"Impossible de charger le fichier: %1","Invalid date":"Date invalide"};export{o as default}; diff --git a/dist/assets/generateRendererUtils-_1jVE02H.js b/dist/assets/generateRendererUtils-_1jVE02H.js new file mode 100644 index 0000000..4f938cf --- /dev/null +++ b/dist/assets/generateRendererUtils-_1jVE02H.js @@ -0,0 +1 @@ +import{dp as C,e as v,iw as I,y as g,c as S,dr as F,Z as B}from"./index-J0iiHjMT.js";const q=new C({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),w=new C({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let V=class extends F{constructor(s){super(s),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(s){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",s)}set definedInterval(s){this.classificationMethod==="defined-interval"&&this._set("definedInterval",s)}};v([I({classBreaksDef:"class-breaks-definition"})],V.prototype,"type",void 0),v([g({json:{write:!0}})],V.prototype,"breakCount",void 0),v([g({json:{write:!0}})],V.prototype,"classificationField",void 0),v([g({type:String,json:{read:q.read,write:q.write}})],V.prototype,"classificationMethod",void 0),v([g({json:{write:!0}})],V.prototype,"normalizationField",void 0),v([g({json:{read:w.read,write:w.write}})],V.prototype,"normalizationType",void 0),v([g({value:null,json:{write:!0}})],V.prototype,"standardDeviationInterval",null),v([g({value:null,json:{write:!0}})],V.prototype,"definedInterval",null),V=v([S("esri.rest.support.ClassBreaksDefinition")],V);const O=V,N=B.getLogger("esri.rest.support.generateRendererUtils");function M(a,s){return Number(a.toFixed(s))}function P(a){const{normalizationTotal:s}=a;return{classBreaks:j(a),normalizationTotal:s}}function j(a){const s=a.definition,{classificationMethod:n,normalizationType:i,definedInterval:h}=s,f=s.breakCount??1,u=[];let l=a.values;if(l.length===0)return[];l=l.sort((r,c)=>r-c);const d=l[0],p=l[l.length-1];if(n==="equal-interval")if(l.length>=f){const r=(p-d)/f;let c=d;for(let t=1;t{u.push({minValue:r,maxValue:r,label:b(r,r,i)})});else if(n==="natural-breaks"){const r=D(l),c=a.valueFrequency||r.valueFrequency,t=$(r.uniqueValues,c,f);let e=d;for(let o=1;oo){const m=M(r.uniqueValues[t[o]],6);u.push({minValue:e,maxValue:m,label:b(e,m,i)}),e=m}u.push({minValue:e,maxValue:p,label:b(e,p,i)})}else if(n==="quantile")if(l.length>=f&&d!==p){let r=d,c=Math.ceil(l.length/f),t=0;for(let e=1;el.length&&(o=l.length-1),o<0&&(o=0),u.push({minValue:r,maxValue:l[o],label:b(r,l[o],i)}),r=l[o],t+=c,c=Math.ceil((l.length-t)/(f-e))}u.push({minValue:r,maxValue:p,label:b(r,p,i)})}else{let r=-1;for(let c=0;c=1;y--){const k=M(r-(y-.5)*t,6);u.push({minValue:o,maxValue:k,label:b(o,k,i)}),o=k,e++}let m=M(r+.5*t,6);u.push({minValue:o,maxValue:m,label:b(o,m,i)}),o=m,e++;for(let y=1;y<=f;y++)m=e===2*f?p:M(r+(y+.5)*t,6),u.push({minValue:o,maxValue:m,label:b(o,m,i)}),o=m,e++}}else if(n==="defined-interval"){if(!h)return u;const r=l[0],c=l[l.length-1],t=Math.ceil((c-r)/h);let e=r;for(let o=1;oi&&(n=i);for(let u=0;u0&&o!==a[e+1]&&Math.abs(r-d[e])>Math.abs(r-d[e-1]))a[e]=o;else if(eMath.abs(r-d[e+1])){a[e+1]=o-1;break}c=l,l=0,f=[],u=[];for(let e=0;ec){for(let e=0;e0;t--)for(;n[t]!==n[t-1]+1;){n[t]=n[t]-1;const e=x(t-1,n,i,h);d=e.sbMean,u=e.sbSdcm;const o=x(t,n,i,h);if(p=o.sbMean,l=o.sbSdcm,!(u+l=1?1:f>=.5?.5:.25,f}function L(a){let s=0;for(let n=0;nX(o);return m(o,c),c}function q(o,r){let c=-90,l=90,e=-180,s=180;for(let u=0;u>g,b=(a&o.geohashY)>>i;for(let p=f-1;p>=0;p--){const y=(e+s)/2,d=Y&1<=0;p--){const y=(c+l)/2,d=b&1<f?1:0;e|=t<<29-(i+5*g),w=(1-t)*w+t*f,h=(1-t)*f+t*h}for(let i=0;i<5;i++){const f=(u+n)/2,t=r>f?1:0;s|=t<<29-(i+5*g),u=(1-t)*u+t*f,n=(1-t)*f+t*n}}o.geohashX=e,o.geohashY=s}function z(o,r,c,l,e){e%2&&(e+=1);let s=0,u=0,n=-90,w=90,h=-180,g=180;for(let i=0;it?1:0;s|=a<<29-(f+5*i),h=(1-a)*h+a*t,g=(1-a)*t+a*g}for(let f=0;f<5;f++){const t=(n+w)/2,a=c>t?1:0;u|=a<<29-(f+5*i),n=(1-a)*n+a*t,w=(1-a)*t+a*w}}o[2*r]=s,o[2*r+1]=u}function B(o,r,c){let l="";const e=M(x,-90,90),s=M(F,-180,180);for(let u=0;u2)return!0;return!1}function A(t){return!T(t)}function H(t){return T(t)}function T(t){let n=0;for(let e=0;e=0;o--)S(t,n[o],e);t.lengths.push(n.length)}function S(t,n,e){const[o,r,s]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(s||0)}function Q(t){switch(typeof t){case"string":return I(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function W(t,n=4326){if(!t)throw new P("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new P("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=N({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new P("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function tt(t,n={}){const e=[],o=new Set,r=new Set;let s,p=!1,i=null,l=!1,{geometryType:c=null}=n,m=!1;for(const d of M(t)){const{geometry:h,properties:u,id:a}=d;if((!h||(c||(c=b(h.type)),b(h.type)===c))&&(p||(p=v(J(h))),l||(l=a!=null,l&&(s=typeof a,u&&(i=Object.keys(u).filter(y=>u[y]===a)))),u&&i&&l&&a!=null&&(i.length>1?i=i.filter(y=>u[y]===a):i.length===1&&(i=u[i[0]]===a?i:[])),!m&&u)){let y=!0;for(const f in u){if(o.has(f))continue;const F=u[f];if(F==null){y=!1,r.add(f);continue}const k=Q(F);if(k==="unknown"){r.add(f);continue}r.delete(f),o.add(f);const j=G(f);j&&e.push({name:j,alias:f,type:k})}m=y}}const w=G((i==null?void 0:i.length)===1&&i[0]||null)??void 0;if(w){for(const d of e)if(d.name===w&&R(d)){d.type="esriFieldTypeOID";break}}return{fields:e,geometryType:c,hasZ:p,objectIdFieldName:w,objectIdFieldType:s,unknownFields:Array.from(r)}}function nt(t,n){return Array.from(Z(M(t),n))}export{W as E,tt as I,nt as N,b as u}; diff --git a/dist/assets/geomasync-_hAyjeTi.js b/dist/assets/geomasync-_hAyjeTi.js new file mode 100644 index 0000000..0e39137 --- /dev/null +++ b/dist/assets/geomasync-_hAyjeTi.js @@ -0,0 +1 @@ +import{kt as fn,bW as W,ha as d,dT as j,N as x,T as O,l as R,hq as B,dy as H,bS as V,ku as ln,e2 as on}from"./index-J0iiHjMT.js";import{Z as o,n as h,Q as K,K as Q,X,d as Z,a as s,r as u,q as I,b as F,i as L,H as T,A as w,a9 as G,aa as z,ab as U,c as N,B as dn,ac as wn,ad as hn,E as Y,N as C,y as J,ae as mn,af as M}from"./arcadeUtils-OUqwHs4P.js";import{c as P,r as D,a as y}from"./TimeOnly-ljWtUK7N.js";import{l as _}from"./portalUtils-MqaWunxU.js";import{disjoint as yn,intersects as pn,touches as gn,crosses as vn,within as Pn,contains as An,overlaps as In,equals as Fn,relate as Nn,intersect as bn,union as xn,difference as Rn,symmetricDifference as Sn,clip as On,cut as jn,planarArea as $,geodesicArea as nn,planarLength as k,geodesicLength as E,distance as Dn,densify as en,geodesicDensify as rn,generalize as Ln,buffer as Tn,geodesicBuffer as Cn,offset as Jn,rotate as tn,simplify as an,isSimple as Mn,convexHull as kn,nearestCoordinate as qn,nearestVertex as Zn}from"./geometryEngineAsync-QjQc0riy.js";import"./hash-SS5GKVPY.js";async function sn(t,e,r){var a,i;if(!((a=fn)==null?void 0:a.findCredential(t.restUrl)))return null;if(t.loadStatus==="loaded"&&e===""&&((i=t.user)!=null&&i.sourceJSON)&&r===!1)return t.user.sourceJSON;const l={responseType:"json",query:{f:"json"}};if(r&&(l.query.returnUserLicenseTypeExtensions=!0),e===""){const f=await W(t.restUrl+"/community/self",l);if(f.data){const m=f.data;if(m!=null&&m.username)return m}return null}const n=await W(t.restUrl+"/community/users/"+e,l);if(n.data){const f=n.data;return f.error?null:f}return null}function un(t){return ln.indexOf("4.")===0?R.fromExtent(t):new R({spatialReference:t.spatialReference,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}function A(t,e,r){if(h(t,2,2,e,r),!(t[0]instanceof d&&t[1]instanceof d)){if(!(t[0]instanceof d&&t[1]===null)){if(!(t[1]instanceof d&&t[0]===null)){if(t[0]!==null||t[1]!==null)throw new s(e,u.InvalidParameter,r)}}}}async function cn(t,e){if(t.type!=="polygon"&&t.type!=="polyline"&&t.type!=="extent")return 0;let r=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(r=mn(t.spatialReference)/on(t.spatialReference));let c=0;if(t.type==="polyline")for(const n of t.paths)for(let a=1;a(A(n=o(n),e,r),n[0]===null||n[1]===null||yn(n[0],n[1])))},t.functions.intersects=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]!==null&&n[1]!==null&&pn(n[0],n[1])))},t.functions.touches=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]!==null&&n[1]!==null&&gn(n[0],n[1])))},t.functions.crosses=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]!==null&&n[1]!==null&&vn(n[0],n[1])))},t.functions.within=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]!==null&&n[1]!==null&&Pn(n[0],n[1])))},t.functions.contains=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]!==null&&n[1]!==null&&An(n[0],n[1])))},t.functions.overlaps=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]!==null&&n[1]!==null&&In(n[0],n[1])))},t.functions.equals=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(h(n,2,2,e,r),n[0]===n[1]||(n[0]instanceof d&&n[1]instanceof d?Fn(n[0],n[1]):(K(n[0])&&K(n[1])||!!(Q(n[0])&&Q(n[1])||X(n[0])&&X(n[1])))&&n[0].equals(n[1]))))},t.functions.relate=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,3,3,e,r),n[0]instanceof d&&n[1]instanceof d)return Nn(n[0],n[1],Z(n[2]));if(n[0]instanceof d&&n[1]===null||n[1]instanceof d&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new s(e,u.InvalidParameter,r)})},t.functions.intersection=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]===null||n[1]===null?null:bn(n[0],n[1])))},t.functions.union=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{const a=[];if((n=o(n)).length===0)throw new s(e,u.WrongNumberOfParameters,r);if(n.length===1)if(I(n[0])){const i=o(n[0]);for(let f=0;f(A(n=o(n),e,r),n[0]!==null&&n[1]===null?P(n[0]):n[0]===null?null:Rn(n[0],n[1])))},t.functions.symmetricdifference=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>(A(n=o(n),e,r),n[0]===null&&n[1]===null?null:n[0]===null?P(n[1]):n[1]===null?P(n[0]):Sn(n[0],n[1])))},t.functions.clip=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[1]instanceof j)&&n[1]!==null)throw new s(e,u.InvalidParameter,r);if(n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[1]===null?null:On(n[0],n[1])})},t.functions.cut=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[1]instanceof x)&&n[1]!==null)throw new s(e,u.InvalidParameter,r);if(n[0]===null)return[];if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[1]===null?[P(n[0])]:jn(n[0],n[1])})},t.functions.area=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(T(n[0])){const a=await n[0].sumArea(D(w(n[1],-1)),!1,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return a}if(I(n[0])||F(n[0])){const a=G(n[0],e.spatialReference);return a===null?0:$(a,D(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return $(n[0],D(w(n[1],-1)))})},t.functions.areageodetic=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(T(n[0])){const a=await n[0].sumArea(D(w(n[1],-1)),!0,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return a}if(I(n[0])||F(n[0])){const a=G(n[0],e.spatialReference);return a===null?0:nn(a,D(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return nn(n[0],D(w(n[1],-1)))})},t.functions.length=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(T(n[0])){const a=await n[0].sumLength(y(w(n[1],-1)),!1,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return a}if(I(n[0])||F(n[0])){const a=z(n[0],e.spatialReference);return a===null?0:k(a,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return k(n[0],y(w(n[1],-1)))})},t.functions.length3d=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(I(n[0])||F(n[0])){const a=z(n[0],e.spatialReference);return a===null?0:a.hasZ===!0?cn(a,y(w(n[1],-1))):k(a,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return n[0].hasZ===!0?cn(n[0],y(w(n[1],-1))):k(n[0],y(w(n[1],-1)))})},t.functions.lengthgeodetic=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{if(h(n,1,2,e,r),(n=o(n))[0]===null)return 0;if(T(n[0])){const a=await n[0].sumLength(y(w(n[1],-1)),!0,e.abortSignal);if(e.abortSignal.aborted)throw new s(e,u.Cancelled,r);return a}if(I(n[0])||F(n[0])){const a=z(n[0],e.spatialReference);return a===null?0:E(a,y(w(n[1],-1)))}if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return E(n[0],y(w(n[1],-1)))})},t.functions.distance=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);let a=n[0];(I(n[0])||F(n[0]))&&(a=U(n[0],e.spatialReference));let i=n[1];if((I(n[1])||F(n[1]))&&(i=U(n[1],e.spatialReference)),!(a instanceof d))throw new s(e,u.InvalidParameter,r);if(!(i instanceof d))throw new s(e,u.InvalidParameter,r);return Dn(a,i,y(w(n[2],-1)))})},t.functions.distancegeodetic=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);const a=n[0],i=n[1];if(!(a instanceof O))throw new s(e,u.InvalidParameter,r);if(!(i instanceof O))throw new s(e,u.InvalidParameter,r);const f=new x({paths:[],spatialReference:a.spatialReference});return f.addPath([a,i]),E(f,y(w(n[2],-1)))})},t.functions.densify=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const a=N(n[1]);if(isNaN(a))throw new s(e,u.InvalidParameter,r);if(a<=0)throw new s(e,u.InvalidParameter,r);return n[0]instanceof R||n[0]instanceof x?en(n[0],a,y(w(n[2],-1))):n[0]instanceof j?en(un(n[0]),a,y(w(n[2],-1))):n[0]})},t.functions.densifygeodetic=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const a=N(n[1]);if(isNaN(a))throw new s(e,u.InvalidParameter,r);if(a<=0)throw new s(e,u.InvalidParameter,r);return n[0]instanceof R||n[0]instanceof x?rn(n[0],a,y(w(n[2],-1))):n[0]instanceof j?rn(un(n[0]),a,y(w(n[2],-1))):n[0]})},t.functions.generalize=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,4,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const a=N(n[1]);if(isNaN(a))throw new s(e,u.InvalidParameter,r);return Ln(n[0],a,dn(w(n[2],!0)),y(w(n[3],-1)))})},t.functions.buffer=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const a=N(n[1]);if(isNaN(a))throw new s(e,u.InvalidParameter,r);return a===0?P(n[0]):Tn(n[0],a,y(w(n[2],-1)))})},t.functions.buffergeodetic=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,3,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);const a=N(n[1]);if(isNaN(a))throw new s(e,u.InvalidParameter,r);return a===0?P(n[0]):Cn(n[0],a,y(w(n[2],-1)))})},t.functions.offset=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,2,6,e,r),n[0]===null)return null;if(!(n[0]instanceof R||n[0]instanceof x))throw new s(e,u.InvalidParameter,r);const a=N(n[1]);if(isNaN(a))throw new s(e,u.InvalidParameter,r);const i=N(w(n[4],10));if(isNaN(i))throw new s(e,u.InvalidParameter,r);const f=N(w(n[5],0));if(isNaN(f))throw new s(e,u.InvalidParameter,r);return Jn(n[0],a,y(w(n[2],-1)),Z(w(n[3],"round")).toLowerCase(),i,f)})},t.functions.rotate=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{n=o(n),h(n,2,3,e,r);let a=n[0];if(a===null)return null;if(!(a instanceof d))throw new s(e,u.InvalidParameter,r);a instanceof j&&(a=R.fromExtent(a));const i=N(n[1]);if(isNaN(i))throw new s(e,u.InvalidParameter,r);const f=w(n[2],null);if(f===null)return tn(a,i);if(f instanceof O)return tn(a,i,f);throw new s(e,u.InvalidParameter,r)})},t.functions.centroid=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;let a=n[0];if((I(n[0])||F(n[0]))&&(a=U(n[0],e.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(e,u.InvalidParameter,r);return a instanceof O?L(P(n[0]),e.spatialReference):a instanceof R?a.centroid:a instanceof x?wn(a):a instanceof B?hn(a):a instanceof j?a.center:null})},t.functions.multiparttosinglepart=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{n=o(n),h(n,1,1,e,r);const a=[];if(n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);if(n[0]instanceof O)return[L(P(n[0]),e.spatialReference)];if(n[0]instanceof j)return[L(P(n[0]),e.spatialReference)];const i=await an(n[0]);if(i instanceof R){const f=[],m=[];for(let p=0;p{if(n=o(n),h(n,1,1,e,r),n[0]===null)return!0;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return Mn(n[0])})},t.functions.simplify=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return an(n[0])})},t.functions.convexhull=function(e,r){return t.standardFunctionAsync(e,r,(c,l,n)=>{if(n=o(n),h(n,1,1,e,r),n[0]===null)return null;if(!(n[0]instanceof d))throw new s(e,u.InvalidParameter,r);return kn(n[0])})},t.functions.getuser=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{var m,p;h(n,0,2,e,r);let a=w(n[1],""),i=a===!0;if(a=a===!0||a===!1?"":Z(a),n.length===0||n[0]instanceof Y){let g=null;g=(m=e.services)!=null&&m.portal?e.services.portal:V.getDefault(),n.length>0&&(g=_(n[0],g));const S=await sn(g,a,i);if(S){const b=JSON.parse(JSON.stringify(S));for(const v of["lastLogin","created","modified"])b[v]!==void 0&&b[v]!==null&&(b[v]=new Date(b[v]));return C.convertObjectToArcadeDictionary(b,J(e))}return null}let f=null;if(T(n[0])&&(f=n[0]),f){if(i=!1,a)return null;await f.load();const g=await f.getOwningSystemUrl();if(!g){if(!a){const v=await f.getIdentityUser();return v?C.convertObjectToArcadeDictionary({username:v},J(e)):null}return null}let S=null;S=(p=e.services)!=null&&p.portal?e.services.portal:V.getDefault(),S=_(new Y(g),S);const b=await sn(S,a,i);if(b){const v=JSON.parse(JSON.stringify(b));for(const q of["lastLogin","created","modified"])v[q]!==void 0&&v[q]!==null&&(v[q]=new Date(v[q]));return C.convertObjectToArcadeDictionary(v,J(e))}return null}throw new s(e,u.InvalidParameter,r)})}),t.functions.nearestcoordinate=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[0]instanceof d||n[0]===null))throw new s(e,u.InvalidParameter,r);if(!(n[1]instanceof O||n[1]===null))throw new s(e,u.InvalidParameter,r);if(n[0]===null||n[1]===null)return null;const a=await qn(n[0],n[1]);return a===null?null:C.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance},J(e),!1,!0)})},t.functions.nearestvertex=function(e,r){return t.standardFunctionAsync(e,r,async(c,l,n)=>{if(n=o(n),h(n,2,2,e,r),!(n[0]instanceof d||n[0]===null))throw new s(e,u.InvalidParameter,r);if(!(n[1]instanceof O||n[1]===null))throw new s(e,u.InvalidParameter,r);if(n[0]===null||n[1]===null)return null;const a=await Zn(n[0],n[1]);return a===null?null:C.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance},J(e),!1,!0)})}}export{Vn as registerFunctions}; diff --git a/dist/assets/geometryEngineAsync-QjQc0riy.js b/dist/assets/geometryEngineAsync-QjQc0riy.js new file mode 100644 index 0000000..6c6b4df --- /dev/null +++ b/dist/assets/geometryEngineAsync-QjQc0riy.js @@ -0,0 +1 @@ +import{T as l,dy as w,g1 as h}from"./index-J0iiHjMT.js";function n(e){var t;return Array.isArray(e)?(t=e[0])==null?void 0:t.spatialReference:e==null?void 0:e.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let r;return Array.isArray(e)?r=e:(r=[],r.push(e),t!=null&&r.push(t)),r}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function a(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const r=await d();return Promise.all(r.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function R(e){return a("extendedSpatialReferenceInfo",[e])}async function A(e,t){return c(await a("clip",[n(e),e,t]))}async function O(e,t){return c(await a("cut",[n(e),e,t]))}function D(e,t){return a("contains",[n(e),e,t])}function J(e,t){return a("crosses",[n(e),e,t])}function N(e,t,r){return a("distance",[n(e),e,t,r])}function T(e,t){return a("equals",[n(e),e,t])}function L(e,t){return a("intersects",[n(e),e,t])}function V(e,t){return a("touches",[n(e),e,t])}function v(e,t){return a("within",[n(e),e,t])}function E(e,t){return a("disjoint",[n(e),e,t])}function b(e,t){return a("overlaps",[n(e),e,t])}function z(e,t,r){return a("relate",[n(e),e,t,r])}function H(e){return a("isSimple",[n(e),e])}async function I(e){return c(await a("simplify",[n(e),e]))}async function P(e,t=!1){return c(await a("convexHull",[n(e),e,t]))}async function j(e,t){return c(await a("difference",[n(e),e,t]))}async function k(e,t){return c(await a("symmetricDifference",[n(e),e,t]))}async function q(e,t){return c(await a("intersect",[n(e),e,t]))}async function B(e,t=null){const r=S(e,t);return c(await a("union",[n(r),r]))}async function C(e,t,r,i,s,u){return c(await a("offset",[n(e),e,t,r,i,s,u]))}async function G(e,t,r,i=!1){const s=[n(e),e,t,r,i];return c(await a("buffer",s))}async function $(e,t,r,i,s,u){const g=[n(e),e,t,r,i,s,u];return c(await a("geodesicBuffer",g))}async function W(e,t,r=!0){const i=await a("nearestCoordinate",[n(e),e,t,r]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function F(e,t){const r=await a("nearestVertex",[n(e),e,t]);return{...r,coordinate:l.fromJSON(r.coordinate)}}async function K(e,t,r,i){return(await a("nearestVertices",[n(e),e,t,r,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){var t;return"xmin"in e?e.center:"x"in e?e:(t=e.extent)==null?void 0:t.center}async function M(e,t,r){if(e==null)throw new o;const i=e.spatialReference;if((r=r??y(e))==null)throw new o;const s=e.constructor.fromJSON(await a("rotate",[i,e,t,r]));return s.spatialReference=i,s}async function Q(e,t){if(e==null)throw new o;const r=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await a("flipHorizontal",[r,e,t]));return i.spatialReference=r,i}async function U(e,t){if(e==null)throw new o;const r=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await a("flipVertical",[r,e,t]));return i.spatialReference=r,i}async function X(e,t,r,i){return c(await a("generalize",[n(e),e,t,r,i]))}async function Y(e,t,r){return c(await a("densify",[n(e),e,t,r]))}async function Z(e,t,r,i=0){return c(await a("geodesicDensify",[n(e),e,t,r,i]))}function _(e,t){return a("planarArea",[n(e),e,t])}function ee(e,t){return a("planarLength",[n(e),e,t])}function te(e,t,r){return a("geodesicArea",[n(e),e,t,r])}function re(e,t,r){return a("geodesicLength",[n(e),e,t,r])}async function ae(e,t){return c(await a("intersectLinesToPoints",[n(e),e,t]))}async function ne(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function ie(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{G as buffer,ne as changeDefaultSpatialReferenceTolerance,ie as clearDefaultSpatialReferenceTolerance,A as clip,D as contains,P as convexHull,J as crosses,O as cut,Y as densify,j as difference,E as disjoint,N as distance,T as equals,R as extendedSpatialReferenceInfo,Q as flipHorizontal,U as flipVertical,X as generalize,te as geodesicArea,$ as geodesicBuffer,Z as geodesicDensify,re as geodesicLength,q as intersect,ae as intersectLinesToPoints,L as intersects,H as isSimple,W as nearestCoordinate,F as nearestVertex,K as nearestVertices,C as offset,b as overlaps,_ as planarArea,ee as planarLength,z as relate,M as rotate,I as simplify,k as symmetricDifference,V as touches,B as union,v as within}; diff --git a/dist/assets/geometryEngineJSON-FxYgI0L3.js b/dist/assets/geometryEngineJSON-FxYgI0L3.js new file mode 100644 index 0000000..fdf9ac3 --- /dev/null +++ b/dist/assets/geometryEngineJSON-FxYgI0L3.js @@ -0,0 +1 @@ +import{xo as r}from"./index-J0iiHjMT.js";import{t as i}from"./json-v6EOeNTY.js";function a(e){return r.extendedSpatialReferenceInfo(e)}function l(e,n,t){return r.clip(i,e,n,t)}function s(e,n,t){return r.cut(i,e,n,t)}function p(e,n,t){return r.contains(i,e,n,t)}function d(e,n,t){return r.crosses(i,e,n,t)}function g(e,n,t,o){return r.distance(i,e,n,t,o)}function m(e,n,t){return r.equals(i,e,n,t)}function h(e,n,t){return r.intersects(i,e,n,t)}function y(e,n,t){return r.touches(i,e,n,t)}function S(e,n,t){return r.within(i,e,n,t)}function x(e,n,t){return r.disjoint(i,e,n,t)}function D(e,n,t){return r.overlaps(i,e,n,t)}function R(e,n,t,o){return r.relate(i,e,n,t,o)}function T(e,n){return r.isSimple(i,e,n)}function b(e,n){return r.simplify(i,e,n)}function w(e,n,t=!1){return r.convexHull(i,e,n,t)}function A(e,n,t){return r.difference(i,e,n,t)}function L(e,n,t){return r.symmetricDifference(i,e,n,t)}function V(e,n,t){return r.intersect(i,e,n,t)}function v(e,n,t=null){return r.union(i,e,n,t)}function z(e,n,t,o,c,u,f){return r.offset(i,e,n,t,o,c,u,f)}function _(e,n,t,o,c=!1){return r.buffer(i,e,n,t,o,c)}function j(e,n,t,o,c,u,f){return r.geodesicBuffer(i,e,n,t,o,c,u,f)}function E(e,n,t,o=!0){return r.nearestCoordinate(i,e,n,t,o)}function H(e,n,t){return r.nearestVertex(i,e,n,t)}function I(e,n,t,o,c){return r.nearestVertices(i,e,n,t,o,c)}function O(e,n,t,o){if(n==null||o==null)throw new Error("Illegal Argument Exception");const c=r.rotate(n,t,o);return c.spatialReference=e,c}function P(e,n,t){if(n==null||t==null)throw new Error("Illegal Argument Exception");const o=r.flipHorizontal(n,t);return o.spatialReference=e,o}function q(e,n,t){if(n==null||t==null)throw new Error("Illegal Argument Exception");const o=r.flipVertical(n,t);return o.spatialReference=e,o}function B(e,n,t,o,c){return r.generalize(i,e,n,t,o,c)}function C(e,n,t,o){return r.densify(i,e,n,t,o)}function M(e,n,t,o,c=0){return r.geodesicDensify(i,e,n,t,o,c)}function $(e,n,t){return r.planarArea(i,e,n,t)}function G(e,n,t){return r.planarLength(i,e,n,t)}function J(e,n,t,o){return r.geodesicArea(i,e,n,t,o)}function N(e,n,t,o){return r.geodesicLength(i,e,n,t,o)}function k(e,n,t){return n==null||t==null?[]:r.intersectLinesToPoints(i,e,n,t)}function F(e,n){r.changeDefaultSpatialReferenceTolerance(e,n)}function K(e){r.clearDefaultSpatialReferenceTolerance(e)}const W=Object.freeze(Object.defineProperty({__proto__:null,buffer:_,changeDefaultSpatialReferenceTolerance:F,clearDefaultSpatialReferenceTolerance:K,clip:l,contains:p,convexHull:w,crosses:d,cut:s,densify:C,difference:A,disjoint:x,distance:g,equals:m,extendedSpatialReferenceInfo:a,flipHorizontal:P,flipVertical:q,generalize:B,geodesicArea:J,geodesicBuffer:j,geodesicDensify:M,geodesicLength:N,intersect:V,intersectLinesToPoints:k,intersects:h,isSimple:T,nearestCoordinate:E,nearestVertex:H,nearestVertices:I,offset:z,overlaps:D,planarArea:$,planarLength:G,relate:R,rotate:O,simplify:b,symmetricDifference:L,touches:y,union:v,within:S},Symbol.toStringTag,{value:"Module"})),X=Object.freeze(Object.defineProperty({__proto__:null,buffer:_,changeDefaultSpatialReferenceTolerance:F,clearDefaultSpatialReferenceTolerance:K,clip:l,contains:p,convexHull:w,crosses:d,cut:s,densify:C,difference:A,disjoint:x,distance:g,equals:m,extendedSpatialReferenceInfo:a,flipHorizontal:P,flipVertical:q,generalize:B,geodesicArea:J,geodesicBuffer:j,geodesicDensify:M,geodesicLength:N,intersect:V,intersectLinesToPoints:k,intersects:h,isSimple:T,nearestCoordinate:E,nearestVertex:H,nearestVertices:I,offset:z,overlaps:D,planarArea:$,planarLength:G,relate:R,rotate:O,simplify:b,symmetricDifference:L,touches:y,union:v,within:S},Symbol.toStringTag,{value:"Module"}));export{W as O,X as g}; diff --git a/dist/assets/geometryEngineWorker-yTomxYzK.js b/dist/assets/geometryEngineWorker-yTomxYzK.js new file mode 100644 index 0000000..8d3a7eb --- /dev/null +++ b/dist/assets/geometryEngineWorker-yTomxYzK.js @@ -0,0 +1 @@ +import{O as t}from"./geometryEngineJSON-FxYgI0L3.js";import"./index-J0iiHjMT.js";import"./json-v6EOeNTY.js";function i(r){return(0,t[r.operation])(...r.parameters)}export{i as executeGEOperation}; diff --git a/dist/assets/gif--X7Hb6fX.js b/dist/assets/gif--X7Hb6fX.js new file mode 100644 index 0000000..e66f1a3 --- /dev/null +++ b/dist/assets/gif--X7Hb6fX.js @@ -0,0 +1 @@ +import{gM as E}from"./index-J0iiHjMT.js";var x={},O={},w={};Object.defineProperty(w,"__esModule",{value:!0}),w.loop=w.conditional=w.parse=void 0;var q=function t(a,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n;if(Array.isArray(e))e.forEach(function(o){return t(a,o,n,i)});else if(typeof e=="function")e(a,n,i,t);else{var d=Object.keys(e)[0];Array.isArray(e[d])?(i[d]={},t(a,e[d],n,i[d])):i[d]=e[d](a,n,i,t)}return n};w.parse=q;var V=function(t,a){return function(e,n,i,d){a(e,n,i)&&d(e,t,n,i)}};w.conditional=V;var $=function(t,a){return function(e,n,i,d){for(var o=[],c=e.pos;a(e,n,i);){var l={};if(d(e,t,n,l),e.pos===c)break;c=e.pos,o.push(l)}return o}};w.loop=$;var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.readBits=f.readArray=f.readUnsigned=f.readString=f.peekBytes=f.readBytes=f.peekByte=f.readByte=f.buildStream=void 0;var H=function(t){return{data:t,pos:0}};f.buildStream=H;var T=function(){return function(t){return t.data[t.pos++]}};f.readByte=T;var J=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(a){return a.data[a.pos+t]}};f.peekByte=J;var _=function(t){return function(a){return a.data.subarray(a.pos,a.pos+=t)}};f.readBytes=_;var K=function(t){return function(a){return a.data.subarray(a.pos,a.pos+t)}};f.peekBytes=K;var L=function(t){return function(a){return Array.from(_(t)(a)).map(function(e){return String.fromCharCode(e)}).join("")}};f.readString=L;var N=function(t){return function(a){var e=_(2)(a);return t?(e[1]<<8)+e[0]:(e[0]<<8)+e[1]}};f.readUnsigned=N;var Q=function(t,a){return function(e,n,i){for(var d=typeof a=="function"?a(e,n,i):a,o=_(t),c=new Array(d),l=0;l=g){var m=g-r.pos;u.push((0,e.readBytes)(m)(r)),h+=m;break}u.push((0,e.readBytes)(y)(r)),h+=y}for(var B=new Uint8Array(h),b=0,v=0;v>=o,h-=o,r>n||r==c)break;if(r==i){d=(1<<(o=u+1))-1,n=i+2,p=C;continue}if(p==C){A[m++]=k[r],p=r,y=r;continue}for(l=r,r==n&&(A[m++]=y,r=p);r>i;)A[m++]=k[r],r=M[r];y=255&k[r],A[m++]=y,nc[r],width:i,height:d}}function ce(t){return U??(U=document.createElement("canvas")),D??(D=U.getContext("2d",{willReadFrequently:!0})),U.width=t.width,U.height=t.height,D.putImageData(t,0,0),U}G=x.decompressFrames=se;const le=[71,73,70];function fe(t){const a=new Uint8Array(t);return!le.some((e,n)=>e!==a[n])}function ye(t){if(!fe(t))return!1;const a=new DataView(t),e=a.getUint8(10);let n=13+(128&e?3*2**(1+(7&e)):0),i=0,d=!1;for(;!d;){switch(a.getUint8(n++)){case 33:if(!o())return!1;break;case 44:c();break;case 59:d=!0;break;default:return!1}if(i>1)return!0}function o(){switch(a.getUint8(n++)){case 249:l();break;case 1:p();break;case 254:r();break;case 255:s();break;default:return!1}return!0}function c(){i++,n+=8;const g=a.getUint8(n++);n+=128&g?3*2**(1+(7&g)):0,n++,u()}function l(){n++,n+=4,u()}function p(){i++,n++,n+=12,u()}function r(){u()}function s(){n++,n+=8,n+=3,u()}function u(){let g;for(;g=a.getUint8(n++);)n+=g}return!1}export{ye as isAnimatedGIF,fe as isGIF,ge as parseGif}; diff --git a/dist/assets/gltfexport-gleus-sO.js b/dist/assets/gltfexport-gleus-sO.js new file mode 100644 index 0000000..dce13db --- /dev/null +++ b/dist/assets/gltfexport-gleus-sO.js @@ -0,0 +1 @@ +import{qE as p,as as L,aU as Z,aG as re,aF as ne,T as k,aa as O,E as H,o$ as ae,bL as oe,Z as ce,aq as j,bv as he,ki as C,qF as le,qG as fe,qH as ue,qI as ee,mj as de,bx as _e,qJ as pe,qK as me,ln as ge,qw as we,qL as Te,mU as Ae,pl as ye,ld as be,mT as v,fA as A,bA as Ee,qM as xe,gr as Re,qN as Ne,qO as Ie}from"./index-J0iiHjMT.js";var z;(function(i){i[i.JSON=1313821514]="JSON",i[i.BIN=5130562]="BIN"})(z||(z={}));class T{constructor(e,t){if(!e)throw new Error("GLB requires a JSON gltf chunk");this._length=T.HEADER_SIZE,this._length+=T.CHUNK_HEADER_SIZE;const s=this._textToArrayBuffer(e);if(this._length+=this._alignTo(s.byteLength,4),t&&(this._length+=T.CHUNK_HEADER_SIZE,this._length+=t.byteLength,t.byteLength%4))throw new Error("Expected BIN chunk length to be divisible by 4 at this point");this.buffer=new ArrayBuffer(this._length),this._outView=new DataView(this.buffer),this._writeHeader();const r=this._writeChunk(s,12,z.JSON,32);t&&this._writeChunk(t,r,z.BIN)}_writeHeader(){this._outView.setUint32(0,T.MAGIC,!0),this._outView.setUint32(4,T.VERSION,!0),this._outView.setUint32(8,this._length,!0)}_writeChunk(e,t,s,r=0){const n=this._alignTo(e.byteLength,4);for(this._outView.setUint32(t,n,!0),this._outView.setUint32(t+=4,s,!0),this._writeArrayBuffer(this._outView.buffer,e,t+=4,0,e.byteLength),t+=e.byteLength;t%4;)r&&this._outView.setUint8(t,r),t++;return t}_writeArrayBuffer(e,t,s,r,n){new Uint8Array(e,s,n).set(new Uint8Array(t,r,n),0)}_textToArrayBuffer(e){return new TextEncoder().encode(e).buffer}_alignTo(e,t){return t*Math.ceil(e/t)}}T.HEADER_SIZE=12,T.CHUNK_HEADER_SIZE=8,T.MAGIC=1179937895,T.VERSION=2;var R,y,x,w,K,V,J;(function(i){i[i.External=0]="External",i[i.DataURI=1]="DataURI",i[i.GLB=2]="GLB"})(R||(R={})),function(i){i[i.External=0]="External",i[i.DataURI=1]="DataURI",i[i.GLB=2]="GLB"}(y||(y={})),function(i){i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(x||(x={})),function(i){i.SCALAR="SCALAR",i.VEC2="VEC2",i.VEC3="VEC3",i.VEC4="VEC4",i.MAT2="MAT2",i.MAT3="MAT3",i.MAT4="MAT4"}(w||(w={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(K||(K={})),function(i){i.OPAQUE="OPAQUE",i.MASK="MASK",i.BLEND="BLEND"}(V||(V={})),function(i){i[i.NoColor=0]="NoColor",i[i.FaceColor=1]="FaceColor",i[i.VertexColor=2]="VertexColor"}(J||(J={}));let Me=class{constructor(e,t,s,r,n){this._buffer=e,this._componentType=s,this._dataType=r,this._data=[],this._isFinalized=!1,this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,t.bufferViews||(t.bufferViews=[]),this.index=t.bufferViews.length,this._bufferView={buffer:e.index,byteLength:-1,target:n};const a=this._getElementSize();a>=4&&n!==x.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?e:Math.min(r,e);const n=this._accessorMax[s];this._accessorMax[s]=typeof n!="number"?e:Math.max(n,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function e(t,s){return s*Math.ceil(t/s)}return e(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case p.BYTE:return new Int8Array(e,t);case p.FLOAT:return new Float32Array(e,t);case p.SHORT:return new Int16Array(e,t);case p.UNSIGNED_BYTE:return new Uint8Array(e,t);case p.UNSIGNED_INT:return new Uint32Array(e,t);case p.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(t=>{const s=new Uint8Array(t);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let n=0;nthis._finalizedPromiseResolve=e)}async finalize(){const e=this._bufferView,t=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&t.push(this._asyncWritePromise),await Promise.allSettled(t),this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case w.SCALAR:return 1;case w.VEC2:return 2;case w.VEC3:return 3;case w.VEC4:case w.MAT2:return 4;case w.MAT3:return 9;case w.MAT4:return 16}}},W=class{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new Me(this,this._gltf,e,t,s);return this._bufferViews.push(r),r}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(t,s),s+=r.byteSize;return t}finalize(){var e;if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),(e=this._gltf.extras)==null||e.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}};function Oe(i,e){if(i.components)for(const t of i.components)t.faces&&t.shading==="smooth"&&Se(t,e)}function Se(i,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const t=i.faces,{position:s,normal:r}=e,n=t.length/3;for(let a=0;ae.toBlob(r,t));if(!s)throw new H("imageToArrayBuffer","Failed to encode image");return{data:await s.arrayBuffer(),type:t}}async function Fe(i){if(!(i instanceof HTMLImageElement))return"image/png";const e=i.src;if(ae(e)){const t=oe(e);return(t==null?void 0:t.mediaType)==="image/jpeg"?t.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function te(i){if(i instanceof HTMLCanvasElement)return i;if(i instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=i.width,e.height=i.height;const t=e.getContext("2d");return i instanceof HTMLImageElement?t.drawImage(i,0,0,i.width,i.height):i instanceof ImageData&&t.putImageData(i,0,0),e}function De(i){const e=[],t=new Uint8Array(i);for(let s=0;s{this._addScene(r)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(s=>{t.nodes||(t.nodes=[]),t.nodes.push(...this._addNodes(s))}),this.gltf.scenes.push(t)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;j(s,he)||(t.translation=C(s));const r=e.rotation;le(r,fe)||(t.rotation=ue(r));const n=e.scale;j(n,ee)||(t.scale=C(n));const a=this.gltf.nodes.length;if(this.gltf.nodes.push(t),e.mesh&&e.mesh.vertexAttributes.position){const o=this._createMeshes(e.mesh),l=[a];if(o.length===1)this._addMesh(t,o[0]);else for(const c of o){const h={};this._addMesh(h,c),l.push(this.gltf.nodes.length),this.gltf.nodes.push(h)}return l}return e.forEachNode(o=>{t.children||(t.children=[]),t.children.push(...this._addNodes(o))}),[a]}_addMesh(e,t){var r;(r=this.gltf).meshes??(r.meshes=[]);const s=this.gltf.meshes.length;this.gltf.meshes.push(t),e.mesh=s}_createMeshes(e){const t=this.gltf.extras,s=t.options.bufferOutputType===R.GLB;let r;r=s?t.binChunkBuffer:new W(this.gltf),this.params.origin||(this.params.origin=Be(e));const{ignoreLocalTransform:n}=this.params,a=n?null:e.transform,{vertexSpace:o,spatialReference:l}=e,c=e.vertexAttributes;let h=null;if(o.type==="local"){const f=de(l);_e(Q,(a==null?void 0:a.localMatrix)??pe,[f,f,f]),h=me(c,Q)}else{const f=n?o.isRelative?new ge({origin:C(o.origin)}):new we:o;h=Te(c,f,a,this.params.origin,{geographic:this.params.geographic,unit:"meters"})}if(h==null)throw new H("Error during gltf export.");c.position&&h.position===c.position&&(h.position=c.position.slice()),c.normal&&h.normal===c.normal&&(h.normal=c.normal.slice()),c.tangent&&h.tangent===c.tangent&&(h.tangent=c.tangent.slice()),Oe(e,h),this._flipYZAxis(h);const g=r.addBufferView(p.FLOAT,w.VEC3,x.ARRAY_BUFFER);let _,m,u,d;h.normal&&(_=r.addBufferView(p.FLOAT,w.VEC3,x.ARRAY_BUFFER)),c.uv&&(m=r.addBufferView(p.FLOAT,w.VEC2,x.ARRAY_BUFFER)),h.tangent&&(u=r.addBufferView(p.FLOAT,w.VEC4,x.ARRAY_BUFFER)),c.color&&(d=r.addBufferView(p.UNSIGNED_BYTE,w.VEC4,x.ARRAY_BUFFER)),g.startAccessor("POSITION"),_&&_.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),u&&u.startAccessor("TANGENT"),d&&d.startAccessor("COLOR_0");const b=h.position.length/3,{position:E,normal:S,tangent:I}=h,{color:M,uv:F}=c;for(let f=0;f0&&e.components[0].faces?(B=r.addBufferView(p.UNSIGNED_INT,w.SCALAR,x.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(B,e.components,G,q,D,P,U,$)):this._addMeshVertexNonIndexed(e.components,G,q,D,P,U,$),g.finalize(),_&&_.finalize(),m&&m.finalize(),u&&u.finalize(),B&&B.finalize(),d&&d.finalize(),s||r.finalize(),G}_flipYZAxis({position:e,normal:t,tangent:s}){this._flipYZBuffer(e,3),this._flipYZBuffer(t,3),this._flipYZBuffer(s,4)}_flipYZBuffer(e,t){if(e!=null)for(let s=1,r=2;so**2.1,n=o=>{const l=o.toRgba();return l[0]=r(l[0]/255),l[1]=r(l[1]/255),l[2]=r(l[2]/255),l};if(e.color!=null&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),e.colorTexture!=null&&(s.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(s.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof Ae){if(e.emissiveTexture!=null&&(s.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const o=n(e.emissiveColor);s.emissiveFactor=[o[0],o[1],o[2]]}e.occlusionTexture!=null&&(s.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(s.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,Y.warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const a=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),a}_createTextureInfo(e,t){const s={index:this._addTexture(e)};return t&&(s.extensions||(s.extensions={}),s.extensions.KHR_texture_transform={scale:t.scale,offset:t.offset,rotation:ye(t.rotation)}),s}_addTexture(e){const t=this.gltf.textures??[];return this.gltf.textures=t,be(this._textureMap,e,()=>{const s={sampler:this._addSampler(e),source:this._addImage(e)},r=t.length;return t.push(s),r})}_addImage(e){const t=this._imageMap.get(e);if(t!=null)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const n=e.data;s.extras=n;for(let o=0;o(s.mimeType=h,c));o.writeAsync(l).then(()=>{o.finalize()})}s.bufferView=o.index;break}case y.DataURI:if(v(n)){Y.warnOnce("Image export for basis compressed textures not available.");break}s.uri=Ve(n);break;default:if(v(n)){Y.warnOnce("Image export for basis compressed textures not available.");break}a.promises.push(X(n).then(({data:o,type:l})=>{s.uri=o,s.mimeType=l}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=A.REPEAT,s=A.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":t=A.CLAMP_TO_EDGE,s=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT,s=A.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=A.CLAMP_TO_EDGE;break;case"mirror":s=A.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=A.CLAMP_TO_EDGE;break;case"mirror":t=A.MIRRORED_REPEAT}}const r={wrapS:t,wrapT:s};for(let a=0;a{if(d!=="extras"){if(b instanceof ArrayBuffer){if(Pe(b))switch(e.imageOutputType){case y.DataURI:case y.GLB:break;case y.External:default:{const E=`img${c}.png`;return c++,g[E]=b,E}}switch(e.bufferOutputType){case R.DataURI:return De(b);case R.GLB:if(h)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(h=b);case R.External:default:{const E=`data${l}.bin`;return l++,g[E]=b,E}}}return b}},_);return e.bufferOutputType===R.GLB||e.imageOutputType===y.GLB?g[se]=new T(m,h).buffer:g[Ye]=m,g}function He(i,e){return ke(i,{bufferOutputType:R.GLB,imageOutputType:y.GLB,jsonSpacing:0},e)}class qe{constructor(e,t){this._file={type:"model/gltf-binary",data:e},this.origin=t}buffer(){return Promise.resolve(this._file)}download(e){Ie(new Blob([this._file.data],{type:this._file.type}),e)}}function We(i,e){const t=new $e,s=new Ge;return t.addScene(s),s.addNode(new ve(i)),He(t,e).then(r=>new qe(r[se],r.origin))}export{We as toBinaryGLTF}; diff --git a/dist/assets/groupLayerUtils-ciLlAkrK.js b/dist/assets/groupLayerUtils-ciLlAkrK.js new file mode 100644 index 0000000..fc16cb1 --- /dev/null +++ b/dist/assets/groupLayerUtils-ciLlAkrK.js @@ -0,0 +1 @@ +import{I as y,b as m}from"./utils-rBsg-VY8.js";import{a as o}from"./jsonContext-cWV_-jAj.js";import{u as n,i as p,h as f,j as v}from"./index-J0iiHjMT.js";const c="Group Layer",d="group-layer-save",I="group-layer-save-as",s=f.GROUP_LAYER_MAP;function i(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function g(e){return{isValid:v(e,s),errorMessage:`Layer.portalItem.typeKeywords should have '${s}'`}}function u(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function P(e,r){r.title||(r.title=e.title),p(r,s)}async function x(e,r){return y({layer:e,itemType:c,validateLayer:i,validateItem:g,createJSONContext:a=>o(a,e),createItemData:u,errorNamePrefix:d,saveResources:async(a,t)=>(e.sourceIsPortalItem||await a.removeAllResources().catch(()=>{}),n(e.resourceReferences,t))},r)}async function N(e,r,a){return m({layer:e,itemType:c,validateLayer:i,createJSONContext:t=>o(t,e),createItemData:u,errorNamePrefix:I,newItem:r,setItemProperties:P,saveResources:(t,l)=>n(e.resourceReferences,l)},a)}export{x as save,N as saveAs}; diff --git a/dist/assets/guid-6vN-YNJI.js b/dist/assets/guid-6vN-YNJI.js new file mode 100644 index 0000000..783c47e --- /dev/null +++ b/dist/assets/guid-6vN-YNJI.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function e(r){return r.map(o=>{let t="";for(let n=0;ne([2,1,1,1,3]);export{i as g}; diff --git a/dist/assets/hash-SS5GKVPY.js b/dist/assets/hash-SS5GKVPY.js new file mode 100644 index 0000000..6e15555 --- /dev/null +++ b/dist/assets/hash-SS5GKVPY.js @@ -0,0 +1 @@ +function p(u){const s=[];for(let n=0,e=u.length;n>6,128|63&t):t<55296||t>=57344?s.push(224|t>>12,128|t>>6&63,128|63&t):(n++,t=65536+((1023&t)<<10|1023&u.charCodeAt(n)),s.push(240|t>>18,128|t>>12&63,128|t>>6&63,128|63&t))}return new Uint8Array(s)}class b{constructor(s){this._seed=s,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(s){const n=[];for(const e of s)isNaN(e)?n.push("NaN"):e===1/0?n.push("Infinity"):e===-1/0?n.push("-Infinity"):e===0?n.push("0"):n.push(e.toString(16));this.update(p(n.join("")))}updateIntArray(s){const n=Int32Array.from(s);this.update(new Uint8Array(n.buffer))}updateUint8Array(s){this.update(Uint8Array.from(s))}updateWithString(s){return this.update(p(s))}update(s){return this._bufs.push(s),this._totallen+=s.length,this}digest(){const s=new Uint8Array(this._totallen);let n=0;for(const e of this._bufs)s.set(e,n),n+=e.length;return this.init(),this._xxHash32(s,this._seed)}_xxHash32(s,n=0){const e=s;let t=n+374761393&4294967295,h=0;if(e.length>=16){const r=[n+2654435761+2246822519&4294967295,n+2246822519&4294967295,n+0&4294967295,n-2654435761&4294967295],i=s,f=i.length-16;let a=0;for(h=0;(4294967280&h)<=f;h+=4){const l=h,d=i[l]+(i[l+1]<<8),_=i[l+2]+(i[l+3]<<8),g=d*2246822519+(_*2246822519<<16);let o=r[a]+g&4294967295;o=o<<13|o>>>19;const y=65535&o,A=o>>>16;r[a]=y*2654435761+(A*2654435761<<16)&4294967295,a=a+1&3}t=(r[0]<<1|r[0]>>>31)+(r[1]<<7|r[1]>>>25)+(r[2]<<12|r[2]>>>20)+(r[3]<<18|r[3]>>>14)&4294967295}t=t+s.length&4294967295;const c=s.length-4;for(;h<=c;h+=4){const r=h,i=e[r]+(e[r+1]<<8),f=e[r+2]+(e[r+3]<<8);t=t+(i*3266489917+(f*3266489917<<16))&4294967295,t=t<<17|t>>>15,t=(65535&t)*668265263+((t>>>16)*668265263<<16)&4294967295}for(;h>>21,t=(65535&t)*2654435761+((t>>>16)*2654435761<<16)&4294967295;return t^=t>>>15,t=((65535&t)*2246822519&4294967295)+((t>>>16)*2246822519<<16),t^=t>>>13,t=((65535&t)*3266489917&4294967295)+((t>>>16)*3266489917<<16),t^=t>>>16,t<0?t+4294967296:t}}export{b as i}; diff --git a/dist/assets/he_IL-uMiAw4Wl.js b/dist/assets/he_IL-uMiAw4Wl.js new file mode 100644 index 0000000..63f600a --- /dev/null +++ b/dist/assets/he_IL-uMiAw4Wl.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"לספירה",_era_bc:"לפנה״ס",A:"לפנה״צ",P:"אחה״צ",AM:"לפנה״צ",PM:"אחה״צ","A.M.":"לפנה״צ","P.M.":"אחה״צ",January:"ינואר",February:"פברואר",March:"מרץ",April:"אפריל",May:"מאי",June:"יוני",July:"יולי",August:"אוגוסט",September:"ספטמבר",October:"אוקטובר",November:"נובמבר",December:"דצמבר",Jan:"ינו׳",Feb:"פבר׳",Mar:"מרץ",Apr:"אפר׳","May(short)":"מאי",Jun:"יוני",Jul:"יולי",Aug:"אוג׳",Sep:"ספט׳",Oct:"אוק׳",Nov:"נוב׳",Dec:"דצמ׳",Sunday:"יום ראשון",Monday:"יום שני",Tuesday:"יום שלישי",Wednesday:"יום רביעי",Thursday:"יום חמישי",Friday:"יום שישי",Saturday:"יום שבת",Sun:"יום א׳",Mon:"יום ב׳",Tue:"יום ג׳",Wed:"יום ד׳",Thu:"יום ה׳",Fri:"יום ו׳",Sat:"שבת",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"התמקד",Play:"נגן",Stop:"עצור",Legend:"מקרא","Press ENTER to toggle":"",Loading:"טעינה",Home:"דף הבית",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"הדפס",Image:"תמונה",Data:"נתונים",Print:"הדפס","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"מ %1 עד %2","From %1":"מ %1","To %1":"עד %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/hr_HR-tOrtwB1u.js b/dist/assets/hr_HR-tOrtwB1u.js new file mode 100644 index 0000000..fd34196 --- /dev/null +++ b/dist/assets/hr_HR-tOrtwB1u.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"po. Kr.",_era_bc:"pr. Kr.",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"siječnja",February:"veljače",March:"ožujka",April:"travnja",May:"svibnja",June:"lipnja",July:"srpnja",August:"kolovoza",September:"rujna",October:"listopada",November:"studenoga",December:"prosinca",Jan:"sij",Feb:"velj",Mar:"ožu",Apr:"tra","May(short)":"svi",Jun:"lip",Jul:"srp",Aug:"kol",Sep:"ruj",Oct:"lis",Nov:"stu",Dec:"pro",Sunday:"nedjelja",Monday:"ponedjeljak",Tuesday:"utorak",Wednesday:"srijeda",Thursday:"četvrtak",Friday:"petak",Saturday:"subota",Sun:"ned",Mon:"pon",Tue:"uto",Wed:"sri",Thu:"čet",Fri:"pet",Sat:"sub",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Povećaj",Play:"Reproduciraj",Stop:"Zaustavi",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Učitavanje",Home:"Početna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Ispis",Image:"Slika",Data:"Podaci",Print:"Ispis","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/dist/assets/hu_HU-tBJnhXJb.js b/dist/assets/hu_HU-tBJnhXJb.js new file mode 100644 index 0000000..04d5f17 --- /dev/null +++ b/dist/assets/hu_HU-tBJnhXJb.js @@ -0,0 +1 @@ +const d={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"i. sz.",_era_bc:"i. e.",A:"de.",P:"du.",AM:"de.",PM:"du.","A.M.":"de.","P.M.":"du.",January:"január",February:"február",March:"március",April:"április",May:"május",June:"június",July:"július",August:"augusztus",September:"szeptember",October:"október",November:"november",December:"december",Jan:"jan.",Feb:"febr.",Mar:"márc.",Apr:"ápr.","May(short)":"máj.",Jun:"jún.",Jul:"júl.",Aug:"aug.",Sep:"szept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"vasárnap",Monday:"hétfő",Tuesday:"kedd",Wednesday:"szerda",Thursday:"csütörtök",Friday:"péntek",Saturday:"szombat",Sun:"V",Mon:"H",Tue:"K",Wed:"Sze",Thu:"Cs",Fri:"P",Sat:"Szo",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Nagyítás/kicsinyítés",Play:"Lejátszás",Stop:"Megálló",Legend:"Jelmagyarázat","Press ENTER to toggle":"",Loading:"Betöltés",Home:"Kezdőlap",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Nyomtatás",Image:"Kép",Data:"Adatok",Print:"Nyomtatás","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Ettől %1 eddig %2","From %1":"Ettől %1","To %1":"Eddig %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/i3s-038C_b0B.js b/dist/assets/i3s-038C_b0B.js new file mode 100644 index 0000000..65cec8d --- /dev/null +++ b/dist/assets/i3s-038C_b0B.js @@ -0,0 +1,2 @@ +import{cg as ur}from"./index-J0iiHjMT.js";function cr(k,H){for(var P=0;Pi[E]})}}}return Object.freeze(Object.defineProperty(k,Symbol.toStringTag,{value:"Module"}))}var Ot,ct,Dt,tt={exports:{}};tt.exports,Ot=tt,tt.exports,ct=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Dt=function(k={}){var H,P,i=k!==void 0?k:{};i.ready=new Promise((t,e)=>{H=t,P=e});var E=Object.assign({},i),x=typeof window=="object",q=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&process.versions.node;var et,b="";function zt(t){return i.locateFile?i.locateFile(t,b):b+t}(x||q)&&(q?b=self.location.href:typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),ct&&(b=ct),b=b.indexOf("blob:")!==0?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",q&&(et=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}));var z,N,Vt=i.print||console.log.bind(console),U=i.printErr||console.warn.bind(console);Object.assign(i,E),E=null,i.arguments&&i.arguments,i.thisProgram&&i.thisProgram,i.quit&&i.quit,i.wasmBinary&&(z=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&$("no native wasm support detected");var j,v,I,L,F,p,st,ft,lt,dt=!1;function pt(){var t=N.buffer;i.HEAP8=j=new Int8Array(t),i.HEAP16=I=new Int16Array(t),i.HEAP32=F=new Int32Array(t),i.HEAPU8=v=new Uint8Array(t),i.HEAPU16=L=new Uint16Array(t),i.HEAPU32=p=new Uint32Array(t),i.HEAPF32=st=new Float32Array(t),i.HEAPF64=ft=new Float64Array(t)}var vt=[],ht=[],mt=[];function Mt(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Nt(i.preRun.shift());rt(vt)}function Bt(){rt(ht)}function qt(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)$t(i.postRun.shift());rt(mt)}function Nt(t){vt.unshift(t)}function Lt(t){ht.unshift(t)}function $t(t){mt.unshift(t)}var R=0,V=null;function Gt(t){R++,i.monitorRunDependencies&&i.monitorRunDependencies(R)}function Xt(t){if(R--,i.monitorRunDependencies&&i.monitorRunDependencies(R),R==0&&V){var e=V;V=null,e()}}function $(t){i.onAbort&&i.onAbort(t),U(t="Aborted("+t+")"),dt=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw P(e),e}var M,Zt="data:application/octet-stream;base64,";function gt(t){return t.startsWith(Zt)}function yt(t){try{if(t==M&&z)return new Uint8Array(z);if(et)return et(t);throw"both async and sync fetching of the wasm failed"}catch(e){$(e)}}function Jt(t){return z||!x&&!q||typeof fetch!="function"?Promise.resolve().then(()=>yt(t)):fetch(t,{credentials:"same-origin"}).then(e=>{if(!e.ok)throw"failed to load wasm binary file at '"+t+"'";return e.arrayBuffer()}).catch(()=>yt(t))}function _t(t,e,r){return Jt(t).then(n=>WebAssembly.instantiate(n,e)).then(n=>n).then(r,n=>{U("failed to asynchronously prepare wasm: "+n),$(n)})}function Kt(t,e,r,n){return t||typeof WebAssembly.instantiateStreaming!="function"||gt(e)||typeof fetch!="function"?_t(e,r,n):fetch(e,{credentials:"same-origin"}).then(o=>WebAssembly.instantiateStreaming(o,r).then(n,function(u){return U("wasm streaming compile failed: "+u),U("falling back to ArrayBuffer instantiation"),_t(e,r,n)}))}function Qt(){var t={env:St,wasi_snapshot_preview1:St};function e(n,o){var u=n.exports;return i.asm=u,N=i.asm.memory,pt(),lt=i.asm.__indirect_function_table,Lt(i.asm.__wasm_call_ctors),Xt(),u}function r(n){e(n.instance)}if(Gt(),i.instantiateWasm)try{return i.instantiateWasm(t,e)}catch(n){U("Module.instantiateWasm callback failed with error: "+n),P(n)}return Kt(z,M,t,r).catch(P),{}}function rt(t){for(;t.length>0;)t.shift()(i)}gt(M="i3s.wasm")||(M=zt(M));var G=[];function nt(t){var e=G[t];return e||(t>=G.length&&(G.length=t+1),G[t]=e=lt.get(t)),e}function Yt(t,e){nt(t)(e)}function te(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(e){p[this.ptr+4>>2]=e},this.get_type=function(){return p[this.ptr+4>>2]},this.set_destructor=function(e){p[this.ptr+8>>2]=e},this.get_destructor=function(){return p[this.ptr+8>>2]},this.set_caught=function(e){e=e?1:0,j[this.ptr+12>>0]=e},this.get_caught=function(){return j[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,j[this.ptr+13>>0]=e},this.get_rethrown=function(){return j[this.ptr+13>>0]!=0},this.init=function(e,r){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(r)},this.set_adjusted_ptr=function(e){p[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return p[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Ut(this.get_type()))return p[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}function ee(t,e,r){throw new te(t).init(e,r),t}var X={};function wt(t){for(;t.length;){var e=t.pop();t.pop()(e)}}function Z(t){return this.fromWireType(F[t>>2])}var O={},S={},J={},re=48,ne=57;function ie(t){if(t===void 0)return"_unknown";var e=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=re&&e<=ne?"_"+t:t}function oe(t,e){return{[t=ie(t)]:function(){return e.apply(this,arguments)}}[t]}function it(t,e){var r=oe(e,function(n){this.name=e,this.message=n;var o=new Error(n).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},r}var bt=void 0;function At(t){throw new bt(t)}function Tt(t,e,r){function n(a){var s=r(a);s.length!==t.length&&At("Mismatched type converter count");for(var f=0;f{S.hasOwnProperty(a)?o[s]=S[a]:(u.push(a),O.hasOwnProperty(a)||(O[a]=[]),O[a].push(()=>{o[s]=S[a],++c===u.length&&n(o)}))}),u.length===0&&n(o)}function ae(t){var e=X[t];delete X[t];var r=e.rawConstructor,n=e.rawDestructor,o=e.fields;Tt([t],o.map(u=>u.getterReturnType).concat(o.map(u=>u.setterArgumentType)),u=>{var c={};return o.forEach((a,s)=>{var f=a.fieldName,l=u[s],d=a.getter,C=a.getterContext,y=u[s+o.length],_=a.setter,W=a.setterContext;c[f]={read:w=>l.fromWireType(d(C,w)),write:(w,ut)=>{var Y=[];_(W,w,y.toWireType(Y,ut)),wt(Y)}}}),[{name:e.name,fromWireType:function(a){var s={};for(var f in c)s[f]=c[f].read(a);return n(a),s},toWireType:function(a,s){for(var f in c)if(!(f in s))throw new TypeError('Missing field: "'+f+'"');var l=r();for(f in c)c[f].write(l,s[f]);return a!==null&&a.push(n,l),l},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:n}]})}function ue(t,e,r,n,o){}function ot(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function ce(){for(var t=new Array(256),e=0;e<256;++e)t[e]=String.fromCharCode(e);Ct=t}var Ct=void 0;function h(t){for(var e="",r=t;v[r];)e+=Ct[v[r++]];return e}var Pt=void 0;function m(t){throw new Pt(t)}function A(t,e,r={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var n=e.name;if(t||m('type "'+n+'" must have a positive integer typeid pointer'),S.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;m("Cannot register type '"+n+"' twice")}if(S[t]=e,delete J[t],O.hasOwnProperty(t)){var o=O[t];delete O[t],o.forEach(u=>u())}}function se(t,e,r,n,o){var u=ot(r);A(t,{name:e=h(e),fromWireType:function(c){return!!c},toWireType:function(c,a){return a?n:o},argPackAdvance:8,readValueFromPointer:function(c){var a;if(r===1)a=j;else if(r===2)a=I;else{if(r!==4)throw new TypeError("Unknown boolean type size: "+e);a=F}return this.fromWireType(a[c>>u])},destructorFunction:null})}function fe(){this.allocated=[void 0],this.freelist=[],this.get=function(t){return this.allocated[t]},this.allocate=function(t){let e=this.freelist.pop()||this.allocated.length;return this.allocated[e]=t,e},this.free=function(t){this.allocated[t]=void 0,this.freelist.push(t)}}var g=new fe;function Et(t){t>=g.reserved&&--g.get(t).refcount==0&&g.free(t)}function le(){for(var t=0,e=g.reserved;e(t||m("Cannot use deleted val. handle = "+t),g.get(t).value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:return g.allocate({refcount:1,value:t})}}};function pe(t,e){A(t,{name:e=h(e),fromWireType:function(r){var n=K.toValue(r);return Et(r),n},toWireType:function(r,n){return K.toHandle(n)},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:null})}function ve(t,e){switch(e){case 2:return function(r){return this.fromWireType(st[r>>2])};case 3:return function(r){return this.fromWireType(ft[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function he(t,e,r){var n=ot(r);A(t,{name:e=h(e),fromWireType:function(o){return o},toWireType:function(o,u){return u},argPackAdvance:8,readValueFromPointer:ve(e,n),destructorFunction:null})}function me(t,e,r,n,o,u){var c=e.length;c<2&&m("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var a=e[1]!==null&&r!==null,s=!1,f=1;f>2]);return r}function we(t,e,r){i.hasOwnProperty(t)||At("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&r!==void 0?i[t].overloadTable[r]=e:(i[t]=e,i[t].argCount=r)}function be(t,e,r){var n=i["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}function Ae(t,e,r){return t.includes("j")?be(t,e,r):nt(e).apply(null,r)}function Te(t,e){var r=[];return function(){return r.length=0,Object.assign(r,arguments),Ae(t,e,r)}}function B(t,e){function r(){return t.includes("j")?Te(t,e):nt(e)}t=h(t);var n=r();return typeof n!="function"&&m("unknown function pointer with signature "+t+": "+e),n}var Wt=void 0;function kt(t){var e=xt(t),r=h(e);return T(e),r}function Ce(t,e){var r=[],n={};function o(u){n[u]||S[u]||(J[u]?J[u].forEach(o):(r.push(u),n[u]=!0))}throw e.forEach(o),new Wt(t+": "+r.map(kt).join([", "]))}function Pe(t,e,r,n,o,u,c){var a=_e(e,r);t=h(t),o=B(n,o),ye(t,function(){Ce("Cannot call "+t+" due to unbound types",a)},e-1),Tt([],a,function(s){var f=[s[0],null].concat(s.slice(1));return we(t,me(t,f,null,o,u),e-1),[]})}function Ee(t,e,r){switch(e){case 0:return r?function(n){return j[n]}:function(n){return v[n]};case 1:return r?function(n){return I[n>>1]}:function(n){return L[n>>1]};case 2:return r?function(n){return F[n>>2]}:function(n){return p[n>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function We(t,e,r,n,o){e=h(e);var u=ot(r),c=l=>l;if(n===0){var a=32-8*r;c=l=>l<>>a}var s=e.includes("unsigned"),f=(l,d)=>{};A(t,{name:e,fromWireType:c,toWireType:s?function(l,d){return f(d,this.name),d>>>0}:function(l,d){return f(d,this.name),d},argPackAdvance:8,readValueFromPointer:Ee(e,u,n!==0),destructorFunction:null})}function ke(t,e,r){var n=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function o(u){var c=p,a=c[u>>=2],s=c[u+1];return new n(c.buffer,s,a)}A(t,{name:r=h(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function je(t,e,r,n){if(!(n>0))return 0;for(var o=r,u=r+n-1,c=0;c=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++c)),a<=127){if(r>=u)break;e[r++]=a}else if(a<=2047){if(r+1>=u)break;e[r++]=192|a>>6,e[r++]=128|63&a}else if(a<=65535){if(r+2>=u)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a}else{if(r+3>=u)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a}}return e[r]=0,r-o}function Fe(t,e,r){return je(t,v,e,r)}function Re(t){for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3}return e}var jt=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function Ft(t,e,r){for(var n=e+r,o=e;t[o]&&!(o>=n);)++o;if(o-e>16&&t.buffer&&jt)return jt.decode(t.subarray(e,o));for(var u="";e>10,56320|1023&f)}}else u+=String.fromCharCode((31&c)<<6|a)}else u+=String.fromCharCode(c)}return u}function Se(t,e){return t?Ft(v,t,e):""}function xe(t,e){var r=(e=h(e))==="std::string";A(t,{name:e,fromWireType:function(n){var o,u=p[n>>2],c=n+4;if(r)for(var a=c,s=0;s<=u;++s){var f=c+s;if(s==u||v[f]==0){var l=Se(a,f-a);o===void 0?o=l:(o+="\0",o+=l),a=f+1}}else{var d=new Array(u);for(s=0;s>2]=u,r&&c)Fe(o,s,u+1);else if(c)for(var f=0;f255&&(T(s),m("String has UTF-16 code units that do not fit in 8 bits")),v[s+f]=l}else for(f=0;f>1,o=n+e/2;!(n>=o)&&L[n];)++n;if((r=n<<1)-t>32&&Rt)return Rt.decode(v.subarray(t,r));for(var u="",c=0;!(c>=e/2);++c){var a=I[t+2*c>>1];if(a==0)break;u+=String.fromCharCode(a)}return u}function Ie(t,e,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=e,o=(r-=2)<2*t.length?r/2:t.length,u=0;u>1]=c,e+=2}return I[e>>1]=0,e-n}function Oe(t){return 2*t.length}function De(t,e){for(var r=0,n="";!(r>=e/4);){var o=F[t+4*r>>2];if(o==0)break;if(++r,o>=65536){var u=o-65536;n+=String.fromCharCode(55296|u>>10,56320|1023&u)}else n+=String.fromCharCode(o)}return n}function He(t,e,r){if(r===void 0&&(r=2147483647),r<4)return 0;for(var n=e,o=n+r-4,u=0;u=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&t.charCodeAt(++u)),F[e>>2]=c,(e+=4)+4>o)break}return F[e>>2]=0,e-n}function ze(t){for(var e=0,r=0;r=55296&&n<=57343&&++r,e+=4}return e}function Ve(t,e,r){var n,o,u,c,a;r=h(r),e===2?(n=Ue,o=Ie,c=Oe,u=()=>L,a=1):e===4&&(n=De,o=He,c=ze,u=()=>p,a=2),A(t,{name:r,fromWireType:function(s){for(var f,l=p[s>>2],d=u(),C=s+4,y=0;y<=l;++y){var _=s+4+y*e;if(y==l||d[_>>a]==0){var W=n(C,_-C);f===void 0?f=W:(f+="\0",f+=W),C=_+e}}return T(s),f},toWireType:function(s,f){typeof f!="string"&&m("Cannot pass non-string to C++ string type "+r);var l=c(f),d=at(4+l+e);return p[d>>2]=l>>a,o(f,d+4,l+e),s!==null&&s.push(T,d),d},argPackAdvance:8,readValueFromPointer:Z,destructorFunction:function(s){T(s)}})}function Me(t,e,r,n,o,u){X[t]={name:h(e),rawConstructor:B(r,n),rawDestructor:B(o,u),fields:[]}}function Be(t,e,r,n,o,u,c,a,s,f){X[t].fields.push({fieldName:h(e),getterReturnType:r,getter:B(n,o),getterContext:u,setterArgumentType:c,setter:B(a,s),setterContext:f})}function qe(t,e){A(t,{isVoid:!0,name:e=h(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(r,n){}})}function Ne(t){t>4&&(g.get(t).refcount+=1)}var Le={};function $e(t){var e=Le[t];return e===void 0?h(t):e}function Ge(t){return K.toHandle($e(t))}function Xe(t,e){var r=S[t];return r===void 0&&m(e+" has unknown type "+kt(t)),r}function Ze(t,e){var r=(t=Xe(t,"_emval_take_value")).readValueFromPointer(e);return K.toHandle(r)}function Je(){$("")}function Ke(t,e,r){v.copyWithin(t,e,e+r)}function Qe(){return 2147483648}function Ye(t){var e=N.buffer;try{return N.grow(t-e.byteLength+65535>>>16),pt(),1}catch{}}function tr(t){var e=v.length;t>>>=0;var r=Qe();if(t>r)return!1;let n=(c,a)=>c+(a-c%a)%a;for(var o=1;o<=4;o*=2){var u=e*(1+.2/o);if(u=Math.min(u,t+100663296),Ye(Math.min(r,n(Math.max(t,u),65536))))return!0}return!1}function er(t){return 52}function rr(t,e,r,n,o){return 70}var nr=[null,[],[]];function ir(t,e){var r=nr[t];e===0||e===10?((t===1?Vt:U)(Ft(r,0)),r.length=0):r.push(e)}function or(t,e,r,n){for(var o=0,u=0;u>2],a=p[e+4>>2];e+=8;for(var s=0;s>2]=o,0}bt=i.InternalError=it(Error,"InternalError"),ce(),Pt=i.BindingError=it(Error,"BindingError"),de(),Wt=i.UnboundTypeError=it(Error,"UnboundTypeError");var St={__call_sighandler:Yt,__cxa_throw:ee,_embind_finalize_value_object:ae,_embind_register_bigint:ue,_embind_register_bool:se,_embind_register_emval:pe,_embind_register_float:he,_embind_register_function:Pe,_embind_register_integer:We,_embind_register_memory_view:ke,_embind_register_std_string:xe,_embind_register_std_wstring:Ve,_embind_register_value_object:Me,_embind_register_value_object_field:Be,_embind_register_void:qe,_emval_decref:Et,_emval_incref:Ne,_emval_new_cstring:Ge,_emval_take_value:Ze,abort:Je,emscripten_memcpy_big:Ke,emscripten_resize_heap:tr,fd_close:er,fd_seek:rr,fd_write:or};Qt();var at=function(){return(at=i.asm.malloc).apply(null,arguments)},T=function(){return(T=i.asm.free).apply(null,arguments)},xt=function(){return(xt=i.asm.__getTypeName).apply(null,arguments)};i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm._embind_initialize_bindings).apply(null,arguments)};var Q,Ut=function(){return(Ut=i.asm.__cxa_is_pointer_type).apply(null,arguments)};function It(){function t(){Q||(Q=!0,i.calledRun=!0,dt||(Bt(),H(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),qt()))}R>0||(Mt(),R>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),t()},1)):t()))}if(i.dynCall_vij=function(){return(i.dynCall_vij=i.asm.dynCall_vij).apply(null,arguments)},i.dynCall_jiji=function(){return(i.dynCall_jiji=i.asm.dynCall_jiji).apply(null,arguments)},V=function t(){Q||It(),Q||(V=t)},i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return It(),k.ready},Ot.exports=Dt;var Ht=tt.exports;const fr=cr({__proto__:null,default:ur(Ht)},[Ht]);export{fr as i}; diff --git a/dist/assets/icon-ZwpY5ksA.js b/dist/assets/icon-ZwpY5ksA.js new file mode 100644 index 0000000..be343ff --- /dev/null +++ b/dist/assets/icon-ZwpY5ksA.js @@ -0,0 +1,5 @@ +import{q as f,H as m,ch as b,t as h,v as x,x as g,ci as v}from"./index-J0iiHjMT.js";import{c as z}from"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const y={icon:"icon",flipRtl:"flip-rtl"},p={},d={},u={s:16,m:24,l:32};async function C({icon:t,scale:e}){const s=u[e],n=w(t),c=n.charAt(n.length-1)==="F",i=`${c?n.substring(0,n.length-1):n}${s}${c?"F":""}`;if(p[i])return p[i];d[i]||(d[i]=fetch(v(`./assets/icon/${i}.json`)).then(r=>r.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const o=await d[i];return p[i]=o,o}function w(t){const e=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const c=/[a-z]/i;t=s.map((l,i)=>l.replace(c,function(r,a){return i===0&&a===0?r:r.toUpperCase()})).join("")}return e?`i${t}`:t}const D=":host{display:inline-flex;color:var(--calcite-ui-icon-color)}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",I=f(class extends m{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect(),this.intersectionObserver=null}async componentWillLoad(){this.loadIconPathData()}render(){const{el:t,flipRtl:e,pathData:s,scale:n,textLabel:c}=this,l=b(t),i=u[n],o=!!c,r=[].concat(s||"");return h(g,{"aria-hidden":x(!o),"aria-label":o?c:null,role:o?"img":null},h("svg",{"aria-hidden":"true",class:{[y.flipRtl]:l==="rtl"&&e,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${i} ${i}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},r.map(a=>typeof a=="string"?h("path",{d:a}):h("path",{d:a.d,opacity:"opacity"in a?a.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:e,visible:s}=this;if(!t||!s)return;const n=await C({icon:t,scale:e});t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=z("intersection",e=>{e.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return D}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]}]);function k(){if(typeof customElements>"u")return;["calcite-icon"].forEach(e=>{switch(e){case"calcite-icon":customElements.get(e)||customElements.define(e,I);break}})}k();export{I,k as d}; diff --git a/dist/assets/id_ID-XHyCBpw9.js b/dist/assets/id_ID-XHyCBpw9.js new file mode 100644 index 0000000..6e14cfd --- /dev/null +++ b/dist/assets/id_ID-XHyCBpw9.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"M",_era_bc:"SM",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"Januari",February:"Februari",March:"Maret",April:"April",May:"Mei",June:"Juni",July:"Juli",August:"Agustus",September:"September",October:"Oktober",November:"November",December:"Desember",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mei",Jun:"Jun",Jul:"Jul",Aug:"Agu",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Des",Sunday:"Minggu",Monday:"Senin",Tuesday:"Selasa",Wednesday:"Rabu",Thursday:"Kamis",Friday:"Jumat",Saturday:"Sabtu",Sun:"Min",Mon:"Sen",Tue:"Sel",Wed:"Rab",Thu:"Kam",Fri:"Jum",Sat:"Sab",_dateOrd:function(a){let e="th";if(a<11||a>13)switch(a%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Perkecil",Play:"Putar",Stop:"Hentikan",Legend:"Legenda","Press ENTER to toggle":"Klik, ketuk atau tekan ENTER untuk beralih",Loading:"Memuat",Home:"Beranda",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"Peta","Press ENTER to zoom in":"Tekan ENTER untuk memperbesar","Press ENTER to zoom out":"Tekan ENTER untuk memperkecil","Use arrow keys to zoom in and out":"Gunakan tombol panah untuk memperbesar dan memperkecil","Use plus and minus keys on your keyboard to zoom in and out":"Gunakan tombol plus dan minus pada keyboard Anda untuk memperbesar dan memperkecil",Export:"Cetak",Image:"Gambar",Data:"Data",Print:"Cetak","Press ENTER to open":"Klik, ketuk atau tekan ENTER untuk membuka","Press ENTER to print.":"Klik, ketuk atau tekan ENTER untuk mencetak","Press ENTER to export as %1.":"Klik, ketuk atau tekan ENTER untuk mengekspor sebagai %1","(Press ESC to close this message)":"Tekan ESC untuk menutup pesan ini","Image Export Complete":"Ekspor gambar selesai","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Dari %1 ke %2","From %1":"Dari %1","To %1":"Ke %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/dist/assets/imageryUtils-djrWgZtb.js b/dist/assets/imageryUtils-djrWgZtb.js new file mode 100644 index 0000000..fdd20f1 --- /dev/null +++ b/dist/assets/imageryUtils-djrWgZtb.js @@ -0,0 +1 @@ +import{I as n,b as m}from"./utils-rBsg-VY8.js";import{h0 as o,i as c,h as p}from"./index-J0iiHjMT.js";import"./jsonContext-cWV_-jAj.js";const i="Image Service",u="imagery-layer-save",g="imagery-layer-save-as",f="imagery-tile-layer-save",v="imagery-tile-layer-save-as";function s(a){var t;if(a.type==="imagery")return{isValid:!0};const{raster:e}=a,r=(e==null?void 0:e.datasetFormat)==="Function"?(t=e.primaryRasters)==null?void 0:t.rasters[0]:e;return{isValid:(r==null?void 0:r.datasetFormat)==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function l(a){const e=a.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function d(a,e){const{parsedUrl:r,title:t,fullExtent:y}=a;e.url=r.path,e.title||(e.title=t),e.extent=await o(y),a.type==="imagery-tile"&&c(e,p.TILED_IMAGERY)}async function x(a,e){const r=a.type==="imagery"?u:f;return n({layer:a,itemType:i,validateLayer:s,createItemData:l,errorNamePrefix:r},e)}async function P(a,e,r){const t=a.type==="imagery"?g:v;return m({layer:a,itemType:i,validateLayer:s,createItemData:l,errorNamePrefix:t,newItem:e,setItemProperties:d},r)}export{x as save,P as saveAs}; diff --git a/dist/assets/index-J0iiHjMT.js b/dist/assets/index-J0iiHjMT.js new file mode 100644 index 0000000..16fb4e4 --- /dev/null +++ b/dist/assets/index-J0iiHjMT.js @@ -0,0 +1,5591 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function i(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(n){if(n.ep)return;n.ep=!0;const s=i(n);fetch(n.href,s)}})();function y(t,e,i,r){var n,s=arguments.length,o=s<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,i):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(o=(s<3?n(o):s>3?n(e,i,o):n(e,i))||o);return s>3&&o&&Object.defineProperty(e,i,o),o}function QWt(t,e,i,r){function n(s){return s instanceof i?s:new i(function(o){o(s)})}return new(i||(i=Promise))(function(s,o){function l(_){try{f(r.next(_))}catch(x){o(x)}}function c(_){try{f(r.throw(_))}catch(x){o(x)}}function f(_){_.done?s(_.value):n(_.value).then(l,c)}f((r=r.apply(t,e||[])).next())})}let Xw;function Le(t){return typeof Xw[t]=="function"?Xw[t]=Xw[t](globalThis):Xw[t]}var S3e,T3e,E3e,C3e;Xw=(S3e=globalThis.dojoConfig)!=null&&S3e.has||(T3e=globalThis.esriConfig)!=null&&T3e.has?{...(E3e=globalThis.dojoConfig)==null?void 0:E3e.has,...(C3e=globalThis.esriConfig)==null?void 0:C3e.has}:{},Le.add=(t,e,i,r)=>((r||Xw[t]===void 0)&&(Xw[t]=e),i&&Le(t)),Le.cache=Xw,Le.add("big-integer-warning-enabled",!0),Le.add("esri-deprecation-warnings",!0),Le.add("esri-tests-disable-screenshots",!1),Le.add("esri-tests-use-full-window",!1),Le.add("esri-tests-post-to-influx",!0),(()=>{var e;Le.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const t=typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document;if(Le.add("host-browser",t),Le.add("host-node",typeof globalThis.process=="object"&&((e=globalThis.process.versions)==null?void 0:e.node)&&globalThis.process.versions.v8),Le.add("dom",t),Le("host-browser")){const i=navigator,r=i.userAgent,n=i.appVersion,s=parseFloat(n);if(Le.add("wp",parseFloat(r.split("Windows Phone")[1])||void 0),Le.add("msapp",parseFloat(r.split("MSAppHost/")[1])||void 0),Le.add("khtml",n.includes("Konqueror")?s:void 0),Le.add("edge",parseFloat(r.split("Edge/")[1])||void 0),Le.add("opr",parseFloat(r.split("OPR/")[1])||void 0),Le.add("webkit",!Le("wp")&&!Le("edge")&&parseFloat(r.split("WebKit/")[1])||void 0),Le.add("chrome",!Le("edge")&&!Le("opr")&&parseFloat(r.split("Chrome/")[1])||void 0),Le.add("android",!Le("wp")&&parseFloat(r.split("Android ")[1])||void 0),Le.add("safari",!n.includes("Safari")||Le("wp")||Le("chrome")||Le("android")||Le("edge")||Le("opr")?void 0:parseFloat(n.split("Version/")[1])),Le.add("mac",n.includes("Macintosh")),!Le("wp")&&/(iPhone|iPod|iPad)/.test(r)){const o=RegExp.$1.replace(/P/,"p"),l=/OS ([\d_]+)/.test(r)?RegExp.$1:"1",c=parseFloat(l.replace(/_/,".").replaceAll("_",""));Le.add(o,c),Le.add("ios",c)}Le("webkit")||(!r.includes("Gecko")||Le("wp")||Le("khtml")||Le("edge")||Le.add("mozilla",s),Le("mozilla")&&Le.add("ff",parseFloat(r.split("Firefox/")[1]||r.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const t=navigator.userAgent,e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(t),i=/iPhone/i.test(t);e&&Le.add("esri-mobile",e),i&&Le.add("esri-iPhone",i),Le.add("esri-geolocation",!!navigator.geolocation)}Le.add("esri-wasm","WebAssembly"in globalThis),Le.add("esri-performance-mode-frames-between-render",20),Le.add("esri-force-performance-mode",!1),Le.add("esri-shared-array-buffer",()=>{const t="SharedArrayBuffer"in globalThis,e=globalThis.crossOriginIsolated===!1;return t&&!e}),Le.add("wasm-simd",()=>{const t=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(t))}),Le.add("esri-atomics","Atomics"in globalThis),Le.add("esri-workers","Worker"in globalThis),Le.add("web-feat:cache","caches"in globalThis),Le.add("esri-workers-arraybuffer-transfer",!Le("safari")||Number(Le("safari"))>=12),Le.add("workers-pool-size",8),Le.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),Le.add("featurelayer-simplify-payload-size-factors",[1,1,4]),Le.add("featurelayer-animation-enabled",!0),Le.add("featurelayer-snapshot-enabled",!0),Le.add("featurelayer-snapshot-point-min-threshold",8e4),Le.add("featurelayer-snapshot-point-max-threshold",4e5),Le.add("featurelayer-snapshot-point-coverage",.1),Le.add("featurelayer-advanced-symbols",!1),Le.add("featurelayer-pbf",!0),Le.add("featurelayer-pbf-statistics",!1),Le.add("feature-layers-workers",!0),Le.add("feature-polyline-generalization-factor",1),Le.add("mapview-transitions-duration",200),Le.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),Le.add("mapserver-pbf-version-support",10.81),Le.add("mapservice-popup-identify-max-tolerance",20),Le.add("heatmap-allow-raster-fallback",!1),Le.add("heatmap-force-raster",!1),Le("host-webworker")||Le("host-browser")&&(Le.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),Le.add("esri-image-decode",()=>{if("decode"in new Image){const t=new Image;return t.src='data:image/svg+xml;charset=UTF-8,',void t.decode().then(()=>{Le.add("esri-image-decode",!0,!0,!0)}).catch(()=>{Le.add("esri-image-decode",!1,!0,!0)})}return!1}),Le.add("esri-url-encodes-apostrophe",()=>{const t=window.document.createElement("a");return t.href="?'",t.href.includes("?%27")}))})();const Jue=new Set;function _je(t,e,i=!1){i&&Jue.has(e)||(i&&Jue.add(e),t.warn(`🛑 DEPRECATED - ${e}`))}function R3e(t,e,i={}){if(Le("esri-deprecation-warnings")){const{moduleName:r}=i;NO(t,`Function: ${(r?r+"::":"")+e+"()"}`,i)}}function pm(t,e,i={}){if(Le("esri-deprecation-warnings")){const{moduleName:r}=i;NO(t,`Property: ${(r?r+"::":"")+e}`,i)}}function NO(t,e,i={}){if(Le("esri-deprecation-warnings")){const{replacement:r,version:n,see:s,warnOnce:o}=i;let l=e;r&&(l+=` + 🛠️ Replacement: ${r}`),n&&(l+=` + ⚙️ Version: ${n}`),s&&(l+=` + 🔗 See ${s} for more details.`),_je(t,l,o)}}function eYt(t){const e=[];return function*(){yield*e;for(const i of t)e.push(i),yield i}}function bje(t,e){for(const i of t)if(i!=null&&e(i))return i}function BX(t){return t!=null&&typeof t[Symbol.iterator]=="function"}let O_=class jX{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach(i=>{e+=i.length}),e}add(e,i){if(BX(e)){const r=this._getOrCreateGroup(i);for(const n of e)this._isHandle(n)&&r.push(n)}else this._isHandle(e)&&this._getOrCreateGroup(i).push(e);return this}forEach(e,i){if(typeof e=="function")this._groups.forEach(r=>r.forEach(e));else{const r=this._getGroup(e);r&&i&&r.forEach(i)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(typeof e!="string"&&BX(e)){for(const i of e)this.remove(i);return this}return this.has(e)?(this._removeAllFromGroup(this._getGroup(e)),this._groups.delete(this._ensureGroupKey(e)),this):this}removeAll(){return this._groups.forEach(e=>this._removeAllFromGroup(e)),this._groups.clear(),this}_isHandle(e){return e&&(!!e.remove||e instanceof jX)}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const i=[];return this._groups.set(this._ensureGroupKey(e),i),i}_getGroup(e){return this._groups.get(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}_removeAllFromGroup(e){for(const i of e)i instanceof jX?i.removeAll():i.remove()}},zI=class u3{constructor(e=1){this._seed=e}set seed(e){this._seed=e??Math.random()*u3._m}getInt(){return this._seed=(u3._a*this._seed+u3._c)%u3._m,this._seed}getFloat(){return this.getInt()/(u3._m-1)}getIntRange(e,i){return Math.round(this.getFloatRange(e,i))}getFloatRange(e,i){const r=i-e;return e+this.getInt()/u3._m*r}};zI._m=2147483647,zI._a=48271,zI._c=0;const VV=1.5,wje=1/VV,xje=.5;function Sje(t){if(!t)return;const e=t.length;return e>0?t[e-1]:void 0}function I3e(t){return t}function Tje(t,e=I3e){if(!t||t.length===0)return;let i=t[0],r=e(i);for(let n=1;nr&&(r=o,i=s)}return i}function $3e(t,e=I3e){return Tje(t,i=>-e(i))}function c9(t,e){return e?t.filter((i,r,n)=>n.findIndex(e.bind(null,i))===r):Array.from(new Set(t))}function Fy(t,e,i){if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;if(i){for(let r=0;r!t.some(o=>i(o,s))),n=t.filter(s=>!e.some(o=>i(o,s)))):(r=e.filter(s=>!t.includes(s)),n=t.filter(s=>!e.includes(s))),{added:r,removed:n}}function Cje(t){return t&&typeof t.length=="number"}function L3e(t,e){const i=t.length;if(i===0)return[];const r=[];for(let n=0;nt[l]?n=l+1:s=l}const o=t[n];return i?e>=t[r-1]?-1:o===e?n:n-1:o===e?n:-1}function Pje(t,e,i){if(!t||t.length===0)return;const r=t.length-1,n=t[0];if(e<=i(n))return n;const s=t[r];if(e>=i(s))return s;let o=0,l=0,c=r;for(;o0){const x=t[l-1],T=i(x);if(e>T)return e-T>=_-e?f:x}c=l}else{if(l=T-e?x:f}o=l+1}}return t[l]}let N3e=class{constructor(){this.last=0}};const F3e=new N3e;function GX(t,e,i,r){r=r||F3e;const n=Math.max(0,r.last-10);for(let o=n;oKue.getFloat()):Math.random}function iYt(t,e){const i=$je(e);for(let r=t.length-1;r>0;r--){const n=Math.floor(i()*(r+1)),s=t[r];t[r]=t[n],t[n]=s}return t}const Kue=new zI;function Gre(t,e){const i=t.indexOf(e);return i!==-1?(t.splice(i,1),e):null}function rYt(t,e){const i=new Map,r=t.length;for(let n=0;ne+(i?zf(i)?Nje(i,Hre()):i.byteLength+H3e:0),0)}const H3e=145,td=1024;function Fje(t){return W5(t)||q5(t)||GV(t)||BV(t)||qre(t)}function kje(t){return W5(t)||q5(t)}function zje(t){return W5(t)?179769e303:q5(t)?3402823e32:HV(t)?4294967295:jV(t)?65535:Zw(t)||G3e(t)?255:GV(t)?2147483647:BV(t)?32767:qre(t)?127:256}function q3e(t,e){let i;if(e)for(i in t)t.hasOwnProperty(i)&&(t[i]===void 0?delete t[i]:t[i]instanceof Object&&q3e(t[i],!0));else for(i in t)t.hasOwnProperty(i)&&t[i]===void 0&&delete t[i];return t}function Re(t){if(!t||typeof t!="object"||typeof t=="function")return t;const e=X3e(t);if(e!=null)return e;if(Uk(t))return t.clone();if(W3e(t))return t.map(Re);if(Y3e(t))return t.clone();const i={};for(const r of Object.getOwnPropertyNames(t))i[r]=Re(t[r]);return i}function HX(t){if(!t||typeof t!="object"||typeof t=="function"||"HTMLElement"in globalThis&&t instanceof HTMLElement)return t;const e=X3e(t);if(e!=null)return e;if(W3e(t)){let i=!0;const r=t.map(n=>{const s=HX(n);return n!=null&&s==null&&(i=!1),s});return i?r:null}if(Uk(t))return t.clone();if(t instanceof File||t instanceof Blob)return t;if(!Y3e(t)){const i=new(Object.getPrototypeOf(t)).constructor;for(const r of Object.getOwnPropertyNames(t)){const n=t[r],s=HX(n);if(n!=null&&s==null)return null;i[r]=s}return i}return null}function Uk(t){return typeof t.clone=="function"}function W3e(t){return typeof t.map=="function"&&typeof t.forEach=="function"}function Y3e(t){return typeof t.notifyChange=="function"&&typeof t.watch=="function"}function Que(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function X3e(t){if(qre(t)||Zw(t)||G3e(t)||BV(t)||jV(t)||GV(t)||HV(t)||q5(t)||W5(t))return t.slice();if(t instanceof Date)return new Date(t.getTime());if(t instanceof ArrayBuffer)return t.slice(0,t.byteLength);if(t instanceof Map){const e=new Map;for(const[i,r]of t)e.set(i,Re(r));return e}if(t instanceof Set){const e=new Set;for(const i of t)e.add(Re(i));return e}return null}function Wre(t,e){return t===e||typeof t=="number"&&isNaN(t)&&typeof e=="number"&&isNaN(e)||typeof(t==null?void 0:t.getTime)=="function"&&typeof(e==null?void 0:e.getTime)=="function"&&t.getTime()===e.getTime()||!1}function Z3e(t,e){return t===e||(t==null||typeof t=="string"?t===e:typeof t=="number"?t===e||typeof e=="number"&&isNaN(t)&&isNaN(e):t instanceof Date?e instanceof Date&&t.getTime()===e.getTime():Array.isArray(t)?Array.isArray(e)&&Fy(t,e):t instanceof Set?e instanceof Set&&Vje(t,e):t instanceof Map?e instanceof Map&&Bje(t,e):!!Que(t)&&Que(e)&&Uje(t,e))}function Uje(t,e){if(t===null||e===null)return!1;const i=Object.keys(t);if(e===null||Object.keys(e).length!==i.length)return!1;for(const r of i)if(t[r]!==e[r]||!Object.prototype.hasOwnProperty.call(e,r))return!1;return!0}function Vje(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function Bje(t,e){if(t.size!==e.size)return!1;for(const[i,r]of t){const n=e.get(i);if(n!==r||n===void 0&&!e.has(i))return!1}return!0}function Yre(t,e,i=!1){return K3e(t,e,i)}function u9(t,e){if(e!=null)return e[t]||J3e(t.split("."),!1,e)}function sE(t,e,i){const r=t.split("."),n=r.pop(),s=J3e(r,!0,i);s&&n&&(s[n]=e)}function J3e(t,e,i){let r=i;for(const n of t){if(r==null)return;if(!(n in r)){if(!e)return;r[n]={}}r=r[n]}return r}function K3e(t,e,i){return e?Object.keys(e).reduce((r,n)=>{let s=r[n],o=e[n];return s===o?r:s===void 0?(r[n]=Re(o),r):(Array.isArray(o)||Array.isArray(r)?(s=s?Array.isArray(s)?r[n]=s.concat():r[n]=[s]:r[n]=[],o&&(Array.isArray(o)||(o=[o]),i?o.forEach(l=>{s.includes(l)||s.push(l)}):r[n]=o.concat())):o&&typeof o=="object"?r[n]=K3e(s,o,i):r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[n]=o),r)},t||{}):t}var A3e;const Ar={apiKey:void 0,applicationName:"",applicationUrl:(A3e=globalThis.location)==null?void 0:A3e.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(Yre(Ar,globalThis.esriConfig,!0),delete Ar.has),!Ar.assetsPath){{const t="4.28";Ar.assetsPath=`https://js.arcgis.com/${t}/@arcgis/core/assets`}Ar.defaultAssetsPath=Ar.assetsPath}const jje=/\{([^\}]+)\}/g;function ehe(t){return t??""}function h9(t,e){return e?t.replaceAll(jje,typeof e=="object"?(i,r)=>ehe(u9(r,e)):(i,r)=>ehe(e(r))):t}function Xre(t,e){return t.replaceAll(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,i=>e&&e.includes(i)?i:`\\${i}`)}function Zre(t){let e=0;for(let i=0;ie._loggedMessages.warn.clear()}}static get test(){return{resetLoggers(e=new Map){const i=jc._loggers;return jc._loggers=e,i},set throttlingDisabled(e){jc._throttlingDisabled=e}}}static getLogger(e){return e=typeof e!="string"?e.declaredClass:e,jc._loggers.get(e)||new jc({module:e})}_log(e,i,...r){if(this._matchLevel(e)){if(i!=="always"&&!jc._throttlingDisabled){const n=this._argsToKey(r),s=this._loggedMessages[e].get(n);if(i==="once"&&s!=null||i==="oncePerTick"&&s&&s>=jc._tickCounter)return;this._loggedMessages[e].set(n,jc._tickCounter),jc._scheduleTickCounterIncrement()}for(const n of Ar.log.interceptors)if(n(e,this.module,...r))return;this._inheritedWriter()(e,this.module,...r)}}_parentWithMember(e,i){let r=this;for(;r!=null;){const n=r[e];if(n!=null)return n;r=r.parent}return i}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(e,i,...r){console[e](`[${i}]`,...r)}_matchLevel(e){const i=Ar.log.level||"warn";return the[this._parentWithMember("level",i)]<=the[e]}_argsToKey(...e){return Zre(JSON.stringify(e,(r,n)=>typeof n!="object"||Array.isArray(n)?n:"[Object]"))}static _scheduleTickCounterIncrement(){jc._tickCounterScheduled||(jc._tickCounterScheduled=!0,Promise.resolve().then(()=>{jc._tickCounter++,jc._tickCounterScheduled=!1}))}};Ce._loggers=new Map,Ce._tickCounter=0,Ce._tickCounterScheduled=!1,Ce._throttlingDisabled=!1;function ky(t,e){if(t==null)throw new Error(e??"value is None")}function et(t){return t==null||t.destroy(),null}function Kt(t){return t==null||t.dispose(),null}function en(t){return t==null||t.remove(),null}function gn(t){return t==null||t.abort(),null}function ir(t){return t==null||t.release(),null}function FO(t,e,i){return t!=null&&e!=null?i!=null?i(t,e):t.equals(e):t===e}function ihe(t,e){return t==null?void 0:t[e]}function Hje(t,e){let i;return t.some((r,n)=>(i=e(r,n),i!=null)),i??void 0}const Q3e=Symbol("Accessor-beforeDestroy"),qje={remove:()=>{}};function rr(t){return t?{remove(){t&&(t(),t=void 0)}}:qje}function Wje(t){t.forEach(e=>e==null?void 0:e.remove())}function id(t){return rr(()=>Wje(t))}function sYt(t){return rr(()=>{var e;return(e=t())==null?void 0:e.remove()})}function Jre(t){return rr(t!=null?()=>t.destroy():void 0)}function Zl(t){return t.__accessor__??null}function Yje(t,e){var i;return((i=t==null?void 0:t.metadatas)==null?void 0:i[e])!=null}function c7(t,e,i){return i?Vk(t,e,{policy:i,path:""}):Vk(t,e,null)}function Vk(t,e,i){return e?Object.keys(e).reduce((r,n)=>{const s=n;let o=null,l="merge";if(i&&(o=i.path?`${i.path}.${n}`:n,l=i.policy(o)),l==="replace"||l==="replace-arrays"&&Array.isArray(r[s]))return r[s]=e[s],r;if(r[s]===void 0)return r[s]=Re(e[s]),r;let c=r[s],f=e[s];if(c===f)return r;if(Array.isArray(f)||Array.isArray(r))c=c?Array.isArray(c)?r[s]=c.concat():r[s]=[c]:r[s]=[],f&&(Array.isArray(f)||(f=[f]),f.forEach(_=>{c.includes(_)||c.push(_)}));else if(f&&typeof f=="object")if(i){const _=i.path;i.path=o,r[s]=Vk(c,f,i),i.path=_}else r[s]=Vk(c,f,null);else r.hasOwnProperty(n)&&!e.hasOwnProperty(n)||(r[s]=f);return r},t||{}):t}function eSe(t){return Array.isArray(t)?t:t.split(".")}function rhe(t){return t.includes(",")?t.split(",").map(e=>e.trim()):[t.trim()]}function Xje(t){if(Array.isArray(t)){const e=[];for(const i of t)e.push(...rhe(i));return e}return rhe(t)}function tSe(t,e,i,r){const n=Xje(e);if(n.length!==1){const s=n.map(o=>r(t,o,i));return id(s)}return r(t,n[0],i)}function iSe(t,e){const i=t[t.length-1]==="?"?t.slice(0,-1):t;if(e.getItemAt!=null||Array.isArray(e)){const n=parseInt(i,10);if(!isNaN(n))return Array.isArray(e)?e[n]:e.at(n)}const r=Zl(e);return Yje(r,i)?r.get(i):e[i]}function rSe(t,e,i){if(t==null)return t;const r=iSe(e[i],t);return!r&&i=this._pool.length)){for(let i=e;i0){if(!(n+r{},onTrackingEnd:()=>{}},ZR=[];let UI=jk;function wi(t){UI.onObservableAccessed(t)}let u7=!1,h7=!1;function c_(t,e,i){if(u7)return Kre(t,e,i);sSe(t);const r=e.call(i);return oSe(),r}function nGe(t,e){return c_(jk,t,e)}function Kre(t,e,i){const r=u7;u7=!0,sSe(t);let n=null;try{n=e.call(i)}catch(s){h7&&Ce.getLogger("esri.core.accessorSupport.tracking").error(s)}return oSe(),u7=r,n}function sSe(t){UI=t,ZR.push(t)}function oSe(){const t=ZR.length;if(t>1){const e=ZR.pop();UI=ZR[t-2],e.onTrackingEnd()}else if(t===1){const e=ZR.pop();UI=jk,e.onTrackingEnd()}else UI=jk}function aSe(t,e){if(e.flags&qn.DepTrackingInitialized)return;const i=h7;h7=!1,e.flags&qn.AutoTracked?Kre(e,e.metadata.get,t):lSe(t,e),h7=i}const sGe=[];function lSe(t,e){e.flags&qn.ExplicitlyTracking||(e.flags|=qn.ExplicitlyTracking,Kre(e,()=>{const i=e.metadata.dependsOn||sGe;for(const r of i)if(typeof r!="string"||r.includes(".")){const n=eSe(r);for(let s=0,o=t;s0)for(const i of e)i.onInvalidated()}onCommitted(){const e=this._observers;if(e&&e.length>0){const i=e.slice();for(const r of i)r.onCommitted()}}},oGe=class cSe{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const i=new cSe;return this._values.forEach((r,n)=>{e&&e.has(n)||i.set(n,Re(r))}),i}get(e){return this._values.get(e)}originOf(){return Di.USER}keys(){return[...this._values.keys()]}set(e,i){this._values.set(e,i)}delete(e){this._values.delete(e)}has(e){return this._values.has(e)}forEach(e){this._values.forEach(e)}};function T6(t,e,i){return t!==void 0}function ahe(t,e,i,r){return t!==void 0&&(!(i==null&&t.flags&qn.NonNullable)||(r.lifecycle,Lv.INITIALIZING,!1))}function aGe(t){return t&&typeof t.destroy=="function"}Ce.getLogger("esri.core.accessorSupport.Properties");let lGe=class{constructor(e){this.host=e,this.propertiesByName=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=Lv.INITIALIZING,this.store=new oGe,this._origin=Di.USER;const i=this.host.constructor.__accessorMetadata__;for(const r in i){const n=new ohe(r,i[r]);this.propertiesByName.set(r,n)}this.metadatas=i}initialize(){this.lifecycle=Lv.CONSTRUCTING}constructed(){this.lifecycle=Lv.CONSTRUCTED}destroy(){this.destroyed=!0;for(const[e,i]of this.propertiesByName){if(i.metadata.autoDestroy){const r=this.internalGet(e);r&&aGe(r)&&(r.destroy(),~i.flags&qn.NonNullable&&this._internalSet(i,null))}i.destroy()}}get initialized(){return this.lifecycle!==Lv.INITIALIZING}get(e){const i=this.propertiesByName.get(e);if(i.metadata.get)return i.getComputed(this);wi(i);const r=this.store;return r.has(e)?r.get(e):i.metadata.value}originOf(e){const i=this.store.originOf(e);if(i===void 0){const r=this.propertiesByName.get(e);if(r!==void 0&&r.flags&qn.HasDefaultValue)return"defaults"}return Bk(i)}has(e){return!!this.propertiesByName.has(e)&&this.store.has(e)}keys(){return[...this.propertiesByName.keys()]}internalGet(e){const i=this.propertiesByName.get(e);if(T6(i))return this.store.has(e)?this.store.get(e):i.metadata.value}internalSet(e,i){const r=this.propertiesByName.get(e);T6(r)&&this._internalSet(r,i)}getDependsInfo(e,i,r){const n=this.propertiesByName.get(i);if(!T6(n))return"";const s=new Set,o=c_({onObservableAccessed:c=>s.add(c),onTrackingEnd:()=>{}},()=>{var c;return(c=n.metadata.get)==null?void 0:c.call(e)});let l=`${r}${e.declaredClass.split(".").pop()}.${i}: ${o} +`;if(s.size===0)return l;r+=" ";for(const c of s)c instanceof ohe&&(l+=`${r}${c.propertyName}: undefined +`);return l}setAtOrigin(e,i,r){const n=this.propertiesByName.get(e);if(T6(n))return this._setAtOrigin(n,i,r)}isOverridden(e){const i=this.propertiesByName.get(e);return i!==void 0&&!!(i.flags&qn.Overriden)}clearOverride(e){const i=this.propertiesByName.get(e);i&&i.flags&qn.Overriden&&(i.flags&=~qn.Overriden,i.notifyChange())}override(e,i){const r=this.propertiesByName.get(e);if(!ahe(r,e,i,this))return;const n=r.metadata.cast;if(n){const s=this._cast(n,i),{valid:o,value:l}=s;if(ZG.release(s),!o)return;i=l}r.flags|=qn.Overriden,this._internalSet(r,i)}set(e,i){const r=this.propertiesByName.get(e);if(!ahe(r,e,i,this))return;const n=r.metadata.cast;if(n){const o=this._cast(n,i),{valid:l,value:c}=o;if(ZG.release(o),!l)return;i=c}const s=r.metadata.set;s?s.call(this.host,i):this._internalSet(r,i)}setDefaultOrigin(e){this._origin=kv(e)}getDefaultOrigin(){return Bk(this._origin)}notifyChange(e){const i=this.propertiesByName.get(e);i!==void 0&&i.notifyChange()}invalidate(e){const i=this.propertiesByName.get(e);i!==void 0&&i.invalidate()}commit(e){const i=this.propertiesByName.get(e);i!==void 0&&i.commit()}_internalSet(e,i){const r=this.lifecycle!==Lv.INITIALIZING?this._origin:Di.DEFAULTS;this._setAtOrigin(e,i,r)}_setAtOrigin(e,i,r){const n=this.store,s=e.propertyName;n.has(s,r)&&Wre(i,n.get(s))&&~e.flags&qn.Overriden&&r===n.originOf(s)||(e.invalidate(),n.set(s,i,r),e.commit(),aSe(this.host,e))}_cast(e,i){const r=ZG.acquire();return r.valid=!0,r.value=i,e&&(r.value=e.call(this.host,i,r)),r}},cGe=class{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}};const ZG=new Ec(cGe);function uGe(t,e){return t.replaceAll(/\$\{([^\s\:\}]*)(?:\:([^\s\:\}]+))?\}/g,(i,r)=>r===""?"$":(u9(r,e)??"").toString())}let uSe=class{constructor(e,i,r){this.name=e,this.details=r,this.message=(i&&uGe(i,r))??""}toString(){return"["+this.name+"]: "+this.message}},se=class hSe extends uSe{constructor(e,i,r){super(e,i,r)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(e,i)=>{if(i&&typeof i=="object"&&typeof i.toJSON=="function")return i;try{return Re(i)}catch{return"[object]"}}))}}catch(e){throw Ce.getLogger("esri.core.Error").error(e),e}return{name:this.name,message:this.message,details:this.details}}static fromJSON(e){return new hSe(e.name,e.message,e.details)}};se.prototype.type="error";function Gk(t,e,i){if(t&&e)if(typeof e=="object")for(const r of Object.getOwnPropertyNames(e))Gk(t,r,e[r]);else{if(e.includes(".")){const n=e.split("."),s=n.splice(-1,1)[0];return void Gk(au(t,n),s,i)}const r=t.__accessor__;r!=null&&hGe(e,r),t[e]=i}}function hGe(t,e){if(Le("esri-unknown-property-errors")&&!dGe(t,e))throw new se("set:unknown-property",pGe(t,e))}function dGe(t,e){return e.metadatas[t]!=null}function pGe(t,e){return"setting unknown property '"+t+"' on instance of "+e.host.declaredClass}let fGe;function mGe(){return fGe}var lhe;(function(t){t[t.Ignore=0]="Ignore",t[t.Destroy=1]="Destroy",t[t.ThrowError=2]="ThrowError"})(lhe||(lhe={}));function gGe(t){t.length=0}let Uh=class{constructor(e=50,i=50){this._pool=new Ec(Array,void 0,gGe,i,e)}acquire(){return this._pool.acquire()}release(e){this._pool.release(e)}prune(){this._pool.prune(0)}static acquire(){return JG.acquire()}static release(e){return JG.release(e)}static prune(){JG.prune()}};const JG=new Uh(100);let dSe=class extends Ec{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=null}acquire(...e){const i=super.acquire(...e);return this._set.delete(i),i}release(e){e&&!this._set.has(e)&&(super.release(e),this._set.add(e))}_dispose(e){this._set.delete(e),super._dispose(e)}};const E6=[];function kO(t){E6.push(t),E6.length===1&&queueMicrotask(()=>{const e=E6.slice();E6.length=0;for(const i of e)i()})}let zv=class{constructor(e,i=30){this.name=e,this._counter=0,this._samples=new Array(i)}record(e){e!=null&&(this._samples[++this._counter%this._samples.length]=e)}get median(){return this._samples.slice().sort((e,i)=>e-i)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((e,i)=>e+i,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}};var YX;(function(t){const e=(s,o,l,c)=>{let f=o,_=o;const x=l>>>1,T=s[f-1];for(;_<=x;){_=f<<1,_so?1:0;function r(s,o,l,c){o===void 0&&(o=0),l===void 0&&(l=s.length),c===void 0&&(c=i);for(let _=l>>>1;_>o;_--)e(s,_,l,c);const f=o+1;for(let _=l-1;_>o;_--){const x=s[o];s[o]=s[_],s[_]=x,e(s,f,_,c)}}function*n(s,o,l,c){o===void 0&&(o=0),l===void 0&&(l=s.length),c===void 0&&(c=i);for(let _=l>>>1;_>o;_--)e(s,_,l,c),yield;const f=o+1;for(let _=l-1;_>o;_--){const x=s[o];s[o]=s[_],s[_]=x,e(s,f,_,c),yield}}t.sort=r,t.iterableSort=n})(YX||(YX={}));const che=YX,yGe=1.5,vGe=1.1;let Pi=class{constructor(e){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new N3e,e&&(e.initialSize&&(this.data=new Array(e.initialSize)),e.allocator&&(this._allocator=e.allocator),e.deallocator!==void 0&&(this._deallocator=e.deallocator),e.shrink&&(this._shrink=()=>uhe(this)))}toArray(){return this.data.slice(0,this.length)}filter(e){const i=new Array;for(let r=0;r=this._length))return this.data[e]}includes(e,i){const r=this.data.indexOf(e,i);return r!==-1&&rthis._length){if(this._allocator){for(;this._length=this.length||e<0))return this.swapElements(e,this.length-1),this.pop()}removeUnorderedMany(e,i=e.length,r){this.length=Rje(this.data,e,this.length,i,this._hint,r),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(e,i){if(e>=this.length||i>=this.length||e===i)return;const r=this.data[e];this.data[e]=this.data[i],this.data[i]=r}sort(e){che.sort(this.data,0,this.length,e)}iterableSort(e){return che.iterableSort(this.data,0,this.length,e)}some(e,i){for(let r=0;ryGe*t.length&&(t.data.length=Math.floor(t.length*vGe))}function _Ge(t){return{setTimeout:(e,i)=>{const r=t.setTimeout(e,i);return rr(()=>t.clearTimeout(r))}}}const m9=_Ge(globalThis);function qV(t){return t&&(typeof t.on=="function"||typeof t.addEventListener=="function")}function Y5(t,e,i){if(!qV(t))throw new TypeError("target is not a Evented or EventTarget object");if("on"in t)return t.on(e,i);if(Array.isArray(e)){const r=e.slice();for(const n of r)t.addEventListener(n,i);return rr(()=>{for(const n of r)t.removeEventListener(n,i)})}return t.addEventListener(e,i),rr(()=>t.removeEventListener(e,i))}function pSe(t,e,i){if(!qV(t))throw new TypeError("target is not a Evented or EventTarget object");if("once"in t)return t.once(e,i);const r=Y5(t,e,n=>{r.remove(),i.call(t,n)});return r}const bGe={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};function Sf({key:t}){return bGe[t]||t}function ur(t="Aborted"){return new se("AbortError",t)}function St(t,e="Aborted"){if(xo(t))throw ur(e)}function WV(t){return t!=null?"aborted"in t?t:t.signal:t}function xo(t){const e=WV(t);return e!=null&&e.aborted}function zo(t){if(sn(t))throw t}function XX(t){if(!sn(t))throw t}function Yl(t,e){const i=WV(t);if(i!=null){if(!i.aborted)return pSe(i,"abort",()=>e());e()}}function g9(t,e){const i=WV(t);if(i!=null)return St(i),pSe(i,"abort",()=>e(ur()))}function oT(t,e){return WV(e)==null?t:new Promise((i,r)=>{let n=Yl(e,()=>r(ur()));const s=()=>{n=en(n)};t.then(s,s),t.then(i,r)})}function sn(t){return(t==null?void 0:t.name)==="AbortError"}async function $m(t){try{return await t}catch(e){if(!sn(e))throw e;return}}async function gYt(t,e=Ce.getLogger("esri")){try{return await t}catch(i){sn(i)||e.error(i)}}async function Uv(t){if(!t)return;if(typeof t.forEach!="function"){const i=Object.keys(t),r=i.map(o=>t[o]),n=await Uv(r),s={};return i.map((o,l)=>s[o]=n[l]),s}const e=t;return Promise.allSettled(e).then(i=>Array.from(e,(r,n)=>{const s=i[n];return s.status==="fulfilled"?{promise:r,value:s.value}:{promise:r,error:s.reason}}))}async function wGe(t){return(await Uv(t)).filter(e=>!!e.value).map(e=>e.value)}async function ZX(t){return(await Promise.allSettled(t)).filter(e=>e.status==="fulfilled").map(e=>e.value)}async function xGe(t){return(await Promise.allSettled(t)).filter(e=>e.status==="rejected").map(e=>e.reason)}function T2(t,e=void 0,i){const r=new AbortController;return Yl(i,()=>r.abort()),new Promise((n,s)=>{let o=setTimeout(()=>{o=0,n(e)},t);Yl(r,()=>{o&&(clearTimeout(o),s(ur()))})})}function pd(t){return t&&typeof t.then=="function"}function JX(t){return pd(t)?t:Promise.resolve(t)}function X5(t,e=-1){let i,r,n,s,o=null;const l=(...c)=>{if(i){r=c,s&&s.reject(ur()),s=Jl();const T=s.promise;if(o){const A=o;o=null,A.abort()}return T}if(n=s||Jl(),s=null,e>0){const T=new AbortController;i=JX(t(...c,T.signal));const A=i;T2(e).then(()=>{i===A&&(s?T.abort():o=T)})}else i=1,i=JX(t(...c));const f=()=>{const T=r;r=n=i=o=null,T!=null&&l(...T)},_=i,x=n;return _.then(f,f),_.then(x.resolve,x.reject),x.promise};return l}function Jl(){let t,e;const i=new Promise((n,s)=>{t=n,e=s}),r=n=>{t(n)};return r.resolve=n=>t(n),r.reject=n=>e(n),r.timeout=(n,s)=>m9.setTimeout(()=>r.reject(s),n),r.promise=i,r}function yYt(t,e){return t.then(e,e)}async function Hk(t){await Promise.resolve(),St(t)}function vYt(t){return t}function fSe(t){return 1e3*t}function _Yt(t){return t}function Qre(t){return .001*t}let SGe=class{constructor(e){this.phases=e,this.paused=!1,this.ticks=-1,this.removed=!1}},TGe=class{constructor(e){this.callback=e,this.isActive=!0}remove(){this.isActive=!1}},KX=0,QX=0;const IP={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},eZ=["prepare","preRender","render","postRender","update","finish"],tZ=[],CT=new Pi;let EGe=class{constructor(e){this._task=e}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}};const qk={frameTasks:CT,willDispatch:!1,clearFrameTasks:CGe,dispatch:ySe,executeFrameTasks:MGe};function tx(t){const e=new TGe(t);return tZ.push(e),qk.willDispatch||(qk.willDispatch=!0,kO(ySe)),e}function AT(t){const e=new SGe(t);return CT.push(e),Wk==null&&(KX=performance.now(),Wk=requestAnimationFrame(mSe)),new EGe(e)}let Wk=null;function CGe(t=!1){CT.forAll(e=>{e.removed=!0}),t&&gSe()}function AGe(t){QX=Math.max(0,t)}function mSe(){const t=performance.now();Wk=null,Wk=CT.length>0?requestAnimationFrame(mSe):null,qk.executeFrameTasks(t)}function MGe(t){const e=t-KX;KX=t;const i=QX>0?QX:1e3/60,r=Math.max(0,e-i);IP.time=t,IP.frameDuration=i-r;for(let n=0;n{var c;l.paused||l.removed||(n===0&&l.ticks++,l.phases[o]&&(IP.elapsedFrameTime=performance.now()-t,IP.deltaTime=l.ticks===0?0:e,(c=l.phases[o])==null||c.call(l,IP)))}),PGe[n].record(performance.now()-s)}gSe(),RGe.record(performance.now()-t)}const C6=new Pi;function gSe(){CT.forAll(t=>{t.removed&&C6.push(t)}),CT.removeUnorderedMany(C6.data,C6.length),C6.clear()}function ySe(){for(;tZ.length;){const t=tZ.shift();t.isActive&&t.callback()}qk.willDispatch=!1}function OGe(t=1,e){const i=Jl(),r=()=>{xo(e)?i.reject(ur()):t===0?i():(--t,kO(()=>r()))};return r(),i.promise}const PGe=eZ.map(t=>new zv(t)),RGe=new zv("total");function d7(t,e){for(const i of t.entries())if(e(i[0]))return!0;return!1}function hhe(t,e){if(!e)return t;for(const i of e)t.add(i);return t}function vSe(t,e){const i=new Set;return hhe(i,t),hhe(i,e),i}function IGe(t,e){const i=new Set;for(const r of e)t.has(r)&&i.add(r);return i}function SYt(t,e){if(!t||!e)return!1;if(t===e)return!0;for(const i of t)if(!e.has(i))return!1;return!0}function TYt(t,e){if(t==null&&e==null)return!0;if(t==null||e==null||t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function EYt(t,e){const i=new Set(t);for(const r of e)i.delete(r);return i}let $Ge=0;const LGe=0;function hp(){return++$Ge}let YV=class{constructor(e){this._accessed=[],this._handles=[],this._observerObject=new DGe(e),dhe.register(this,new WeakRef(this._observerObject),this)}destroy(){var e;dhe.unregister(this._observerObject),this._accessed.length=0,(e=this._observerObject)==null||e.destroy(),this.clear()}onObservableAccessed(e){const i=this._accessed;i.includes(e)||i.push(e)}onTrackingEnd(){const e=this._handles,i=this._accessed,r=this._observerObject;for(let n=0;n0?e-1:0}destroy(){this.destroyed=!0,this._notify=NGe}};const dhe=new FinalizationRegistry(t=>{var e;(e=t.deref())==null||e.destroy()});function NGe(){}let ZM=!1;const Yk=[];function _Se(t,e){let i=new YV(s),r=null,n=!1;function s(){if(!i||n)return;if(ZM)return void xSe(s);const l=r;i.clear(),ZM=!0,n=!0,r=c_(i,t),n=!1,ZM=!1,e(r,l),SSe()}function o(){i&&(i.destroy(),i=null,r=null)}return n=!0,r=c_(i,t),n=!1,rr(o)}function bSe(t,e){let i=new YV(n),r=null;function n(){e(r,o)}function s(){i&&(i.destroy(),i=null),r=null}function o(){return i?(i.clear(),r=c_(i,t),r):null}return o(),rr(s)}function wSe(t){let e=new YV(r),i=!1;function r(){e&&!i&&(ZM?xSe(r):(e.clear(),ZM=!0,i=!0,c_(e,t),i=!1,ZM=!1,SSe()))}function n(){e&&(e.destroy(),e=null)}return i=!0,c_(e,t),i=!1,rr(n)}function xSe(t){Yk.includes(t)||Yk.unshift(t)}function SSe(){for(;Yk.length;)Yk.pop()()}var VI;(function(t){t[t.Untracked=0]="Untracked",t[t.Tracked=1]="Tracked"})(VI||(VI={}));let eL=class{constructor(){this.uid=hp(),this.removed=!1,this.type=null,this.oldValue=null,this.callback=null,this.getValue=null,this.target=null,this.path=null,this.equals=null}static acquireUntracked(e,i,r,n,s){return this.pool.acquire(VI.Untracked,e,i,r,n,s,Wre)}static acquireTracked(e,i,r,n){return this.pool.acquire(VI.Tracked,e,i,r,null,null,n)}notify(e,i){this.type===VI.Untracked?this.callback.call(this.target,e,i,this.path,this.target):this.callback.call(null,e,i,void 0,void 0)}acquire(e,i,r,n,s,o,l){this.uid=hp(),this.removed=!1,this.type=e,this.oldValue=i,this.callback=r,this.getValue=n,this.target=s,this.path=o,this.equals=l}release(){this.target=this.path=this.oldValue=this.callback=this.getValue=null,this.uid=hp(),this.removed=!0}};eL.pool=new dSe(eL);const p7=new Uh,Yv=new Set;let Xk;function Zk(t){Yv.delete(t),Yv.add(t),Xk||(Xk=tx(zGe))}function FGe(t){if(t.removed)return;const e=t.oldValue,i=t.getValue();t.equals(e,i)||(t.oldValue=i,t.notify(i,e))}function kGe(t){for(const e of Yv.values())e.target===t&&(e.removed=!0)}function zGe(){let t=10;for(;Xk&&t--;){Xk=null;const e=UGe(),i=p7.acquire();for(const r of e){const n=r.uid;FGe(r),n===r.uid&&r.removed&&i.push(r)}for(const r of Yv)r.removed&&(i.push(r),Yv.delete(r));for(const r of i)eL.pool.release(r);p7.release(i),p7.release(e),iZ.forEach(r=>r())}}function UGe(){const t=p7.acquire();t.length=Yv.size;let e=0;for(const i of Yv)t[e]=i,++e;return Yv.clear(),t}const iZ=new Set;function TSe(t){return iZ.add(t),rr(()=>iZ.delete(t))}function VGe(t,e,i){let r=tSe(t,e,i,(n,s,o)=>{let l,c,f=bSe(()=>d9(n,s),(_,x)=>{n.__accessor__.destroyed||l&&l.uid!==c?r.remove():(l||(l=eL.acquireUntracked(_,o,x,n,s),c=l.uid),Zk(l))});return rr(()=>{f.remove(),l&&(l.uid!==c||l.removed||(l.removed=!0,Zk(l)),l=null),r=f=null})});return r}function BGe(t,e,i){const r=tSe(t,e,i,(n,s,o)=>{let l=!1;return _Se(()=>d9(n,s),(c,f)=>{n.__accessor__.destroyed?r.remove():l||(l=!0,Wre(f,c)||o.call(n,c,f,s,n),l=!1)})});return r}function jGe(t,e,i,r=!1){return!t.__accessor__||t.__accessor__.destroyed?rr():r?BGe(t,e,i):VGe(t,e,i)}function GGe(t,e,i){let r,n,s=bSe(t,(o,l)=>{r&&r.uid!==n?s.remove():(r||(r=eL.acquireTracked(o,e,l,i),n=r.uid),Zk(r))});return rr(()=>{s.remove(),r&&(r.uid!==n||r.removed||(r.removed=!0,Zk(r)),r=null),s=null})}function HGe(t,e,i){let r=!1;return _Se(t,(n,s)=>{r||(r=!0,i(s,n)||e(n,s),r=!1)})}function qGe(t,e,i=!1,r=Z3e){return i?HGe(t,e,r):GGe(t,e,r)}function phe(t){return d7(Yv,e=>e.oldValue===t)}function rp(t,e){for(const[i,r]of t)if(e(r,i))return!0;return!1}function OYt(t,e){for(const[i,r]of t)if(e(r,i))return r;return null}function XV(t,e,i){const r=t.get(e);if(r!==void 0)return r;const n=i();return t.set(e,n),n}const JM=Ce.getLogger("esri.core.accessorSupport.ensureTypes");function WGe(t){return t==null?t:new Date(t)}function YGe(t){return t==null?t:!!t}function y9(t){return t==null?t:t.toString()}function Vh(t){return t==null?t:(t=parseFloat(t),isNaN(t)?0:t)}function ene(t){return t==null?t:Math.round(parseFloat(t))}function ESe(t){return(t==null?void 0:t.constructor)&&t.constructor.__accessorMetadata__!==void 0}function Jk(t,e){return e!=null&&t&&!(e instanceof t)}function CSe(t){return t&&"isCollection"in t}function fhe(t){return t!=null&&t.Type?typeof t.Type=="function"?t.Type:t.Type.base:null}function XGe(t,e){if(!(e!=null&&e.constructor)||!CSe(e.constructor))return rZ(t,e)?e:new t(e);const i=fhe(t.prototype.itemType),r=fhe(e.constructor.prototype.itemType);return i?r?i===r?e:i.prototype.isPrototypeOf(r.prototype)?new t(e):(rZ(t,e),e):new t(e):e}function rZ(t,e){return!!ESe(e)&&(JM.error("Accessor#set","Assigning an instance of '"+(e.declaredClass||"unknown")+"' which is not a subclass of '"+ZV(t)+"'"),!0)}function MT(t,e){return e==null?e:CSe(t)?XGe(t,e):Jk(t,e)?rZ(t,e)?e:new t(e):e}function ZV(t){var e;return((e=t==null?void 0:t.prototype)==null?void 0:e.declaredClass)||"unknown"}const ZGe=new WeakMap;function JGe(t){switch(t){case Number:return Vh;case $n:return ene;case Boolean:return YGe;case String:return y9;case Date:return WGe;default:return XV(ZGe,t,()=>MT.bind(null,t))}}function $s(t,e){const i=JGe(t);return arguments.length===1?i:i(e)}function tL(t,e,i){return arguments.length===1?tL.bind(null,t):e&&(Array.isArray(e)?e.map(r=>t(r,i)):[t(e,i)])}function KGe(t,e){return arguments.length===1?tL(i=>$s(t,i)):tL(i=>$s(t,i),e)}function ASe(t,e,i){return e!==0&&Array.isArray(i)?i.map(r=>ASe(t,e-1,r)):t(i)}function Kk(t,e,i){if(arguments.length===2)return s=>Kk(t,e,s);if(!i)return i;i=ASe(t,e,i);let r=e,n=i;for(;r>0&&Array.isArray(n);)r--,n=n[0];if(n!==void 0)for(let s=0;s$s(t,r),e):Kk(r=>$s(t,r),e,i)}function MSe(t){return!!Array.isArray(t)&&!t.some(e=>{const i=typeof e;return!(i==="string"||i==="number"||i==="function"&&t.length>1)})}function nZ(t,e){if(arguments.length===2)return nZ(t).call(null,e);const i=new Set,r=t.filter(l=>typeof l!="function"),n=t.filter(l=>typeof l=="function");for(const l of t)typeof l!="string"&&typeof l!="number"||i.add(l);let s=null,o=null;return(l,c)=>{if(l==null)return l;const f=typeof l,_=f==="string"||f==="number";return _&&(i.has(l)||n.some(x=>f==="string"&&x===String||f==="number"&&x===Number))||f==="object"&&n.some(x=>!Jk(l,x))?l:(_&&r.length?(s||(s=r.map(x=>typeof x=="string"?`'${x}'`:`${x}`).join(", ")),JM.error("Accessor#set",`'${l}' is not a valid value for this property, only the following values are valid: ${s}`)):typeof l=="object"&&n.length?(o||(o=n.map(x=>ZV(x)).join(", ")),JM.error("Accessor#set",`'${l}' is not a valid value for this property, value must be one of ${o}`)):JM.error("Accessor#set",`'${l}' is not a valid value for this property`),c&&(c.valid=!1),null)}}function zy(t,e){if(arguments.length===2)return zy(t).call(null,e);const i={},r=[],n=[];for(const c in t.typeMap){const f=t.typeMap[c];i[c]=$s(f),r.push(ZV(f)),n.push(c)}const s=()=>`'${r.join("', '")}'`,o=()=>`'${n.join("', '")}'`,l=typeof t.key=="string"?c=>c[t.key]:t.key;return c=>{if(t.base&&!Jk(t.base,c)||c==null)return c;const f=l(c)||t.defaultKeyValue,_=i[f];if(!_)return JM.error("Accessor#set",`Invalid property value, value needs to be one of ${s()}, or a plain object that can autocast (having .type = ${o()})`),null;if(!Jk(t.typeMap[f],c))return c;if(typeof t.key=="string"&&!ESe(c)){const x={};for(const T in c)T!==t.key&&(x[T]=c[T]);return _(x)}return _(c)}}let $n=class{};const RYt={native:t=>({type:"native",value:t}),array:t=>({type:"array",value:t}),oneOf:t=>({type:"one-of",values:t})};function eHe(t){if(!t||!("type"in t))return!1;switch(t.type){case"native":case"array":case"one-of":return!0}return!1}function OSe(t){switch(t.type){case"native":return $s(t.value);case"array":return tL(OSe(t.value));case"one-of":return tHe(t);default:return null}}function tHe(t){let e=null;return(i,r)=>oZ(i,t)?i:(e==null&&(e=sZ(t)),JM.error("Accessor#set",`Invalid property value, value needs to be of type ${e}`),r&&(r.valid=!1),null)}function sZ(t){switch(t.type){case"native":switch(t.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case $n:return"integer";case Date:return"date";default:return ZV(t.value)}case"array":return`array of ${sZ(t.value)}`;case"one-of":{const e=t.values.map(i=>sZ(i));return`one of ${e.slice(0,-1)} or ${e[e.length-1]}`}}return"unknown"}function oZ(t,e){if(t==null)return!0;switch(e.type){case"native":switch(e.value){case Number:case $n:return typeof t=="number";case Boolean:return typeof t=="boolean";case String:return typeof t=="string"}return t instanceof e.value;case"array":return!!Array.isArray(t)&&!t.some(i=>!oZ(i,e.value));case"one-of":return e.values.some(i=>oZ(t,i))}}function w(t={}){return(e,i)=>{if(e===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${e.name}.${i}. Accessor does not support static properties.`);const r=Object.getOwnPropertyDescriptor(e,i),n=f9(e,i);r&&(r.get||r.set?(n.get=r.get||n.get,n.set=r.set||n.set):"value"in r&&("value"in t&&Ce.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${i}" on "${e.constructor.name}" already defined in the metadata`,t),n.value=t.value=r.value)),t.readOnly!=null&&(n.readOnly=t.readOnly);const s=t.aliasOf;if(s){const c=typeof s=="string"?s:s.source,f=typeof s=="string"?null:s.overridable===!0;let _;n.dependsOn=[c],n.get=function(){let x=au(this,c);if(typeof x=="function"){_||(_=c.split(".").slice(0,-1).join("."));const T=au(this,_);T&&(x=x.bind(T))}return x},n.readOnly||(n.set=f?function(x){this._override(i,x)}:function(x){Gk(this,c,x)})}const o=t.type,l=t.types;n.cast||(o?n.cast=iHe(o):l&&(Array.isArray(l)?n.cast=tL(zy(l[0])):n.cast=zy(l))),Zje(n,t),t.range&&(n.cast=rHe(n.cast,t.range))}}function tne(t,e,i){const r=f9(t,i);r.json||(r.json={});let n=r.json;return e!==void 0&&(n.origins||(n.origins={}),n.origins[e]||(n.origins[e]={}),n=n.origins[e]),n}function iHe(t){let e=0,i=t;if(eHe(t))return OSe(t);for(;Array.isArray(i)&&i.length===1&&typeof i[0]!="string"&&typeof i[0]!="number";)i=i[0],e++;const r=i;if(MSe(r))return e===0?nZ(r):Kk(nZ(r),e);if(e===1)return KGe(r);if(e>1)return QGe(r,e);const n=t;return n.from?n.from:$s(n)}function rHe(t,e){return i=>{let r=+t(i);return e.step!=null&&(r=Math.round(r/e.step)*e.step),e.min!=null&&(r=Math.max(e.min,r)),e.max!=null&&(r=Math.min(e.max,r)),r}}function nHe(t){if(t.json&&t.json.origins){const e=t.json.origins,i={"web-document":["web-scene","web-map"]};for(const r in i)if(e[r]){const n=e[r];i[r].forEach(s=>{e[s]=n}),delete e[r]}}}let Uf=class extends uSe{constructor(e,i,r){super(e,i,r)}};Uf.prototype.type="warning";function PSe(t){var e;return!!t&&((e=t.prototype)==null?void 0:e.declaredClass)&&t.prototype.declaredClass.indexOf("esri.core.Collection")===0}const aZ=Ce.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function mhe(t,e,i){var r,n;t&&(!i&&!e.read||(r=e.read)!=null&&r.reader||((n=e.read)==null?void 0:n.enabled)===!1||aHe(t)&&sE("read.reader",Z5(t),e))}function Z5(t){var i,r;const e=t.ndimArray??0;if(e>1)return oHe(t);if(e===1)return ghe(t);if("type"in t&&ISe(t.type)){const n=(r=(i=t.type.prototype)==null?void 0:i.itemType)==null?void 0:r.Type,s=ghe(typeof n=="function"?{type:n}:{types:n});return(o,l,c)=>{const f=s(o,l,c);return f&&new t.type(f)}}return ine(t)}function ine(t){return"type"in t?sHe(t.type):lHe(t.types)}function sHe(t){return t.prototype.read?(e,i,r)=>{if(e==null)return e;const n=typeof e;if(n!=="object")return void aZ.error(`Expected JSON value of type 'object' to deserialize type '${t.prototype.declaredClass}', but got '${n}'`);const s=new t;return s.read(e,r),s}:t.fromJSON}function RSe(t,e,i,r){return r!==0&&Array.isArray(e)?e.map(n=>RSe(t,n,i,r-1)):t(e,void 0,i)}function oHe(t){const e=ine(t),i=RSe.bind(null,e),r=t.ndimArray??0;return(n,s,o)=>{if(n==null)return n;n=i(n,o,r);let l=r,c=n;for(;l>0&&Array.isArray(c);)l--,c=c[0];if(c!==void 0)for(let f=0;f{if(i==null)return i;if(Array.isArray(i)){const o=[];for(const l of i){const c=e(l,void 0,n);c!==void 0&&o.push(c)}return o}const s=e(i,void 0,n);return s!==void 0?[s]:void 0}}function ISe(t){if(!PSe(t))return!1;const e=t.prototype.itemType;return!(!e||!e.Type)&&(typeof e.Type=="function"?rne(e.Type):$Se(e.Type))}function aHe(t){return"types"in t?$Se(t.types):rne(t.type)}function rne(t){return!Array.isArray(t)&&!!t&&t.prototype&&("read"in t.prototype||"fromJSON"in t||ISe(t))}function $Se(t){for(const e in t.typeMap)if(!rne(t.typeMap[e]))return!1;return!0}function lHe(t){let e=null;const i=t.errorContext??"type",r=t.validate;return(n,s,o)=>{if(n==null)return n;const l=typeof n;if(l!=="object")return void aZ.error(`Expected JSON value of type 'object' to deserialize, but got '${l}'`);e||(e=cHe(t));const c=t.key;if(typeof c!="string")return;const f=n[c],_=f?e[f]:t.defaultKeyValue?t.typeMap[t.defaultKeyValue]:void 0;if(!_){const T=`Type '${f||"unknown"}' is not supported`;return o!=null&&o.messages&&n&&o.messages.push(new Uf(`${i}:unsupported`,T,{definition:n,context:o})),void aZ.error(T)}const x=new _;return x.read(n,o),r?r(x):x}}function cHe(t){var i,r;const e={};for(const n in t.typeMap){const s=t.typeMap[n],o=p9(s.prototype);if(typeof t.key=="function")continue;const l=o[t.key];if(!l)continue;(i=l.json)!=null&&i.type&&Array.isArray(l.json.type)&&l.json.type.length===1&&typeof l.json.type[0]=="string"&&(e[l.json.type[0]]=s);const c=(r=l.json)==null?void 0:r.write;if(!(c!=null&&c.writer)){e[n]=s;continue}const f=c.target,_=typeof f=="string"?f:t.key,x={};c.writer(n,x,_),x[_]&&(e[x[_]]=s)}return e}function uHe(t){if(t.json||(t.json={}),vhe(t.json),_he(t.json),yhe(t.json),t.json.origins)for(const e in t.json.origins)vhe(t.json.origins[e]),_he(t.json.origins[e]),yhe(t.json.origins[e]);return!0}function yhe(t){t.name&&(t.read&&typeof t.read=="object"?t.read.source===void 0&&(t.read.source=t.name):t.read={source:t.name},t.write&&typeof t.write=="object"?t.write.target===void 0&&(t.write.target=t.name):t.write={target:t.name})}function vhe(t){typeof t.read=="boolean"?t.read={enabled:t.read}:typeof t.read=="function"?t.read={enabled:!0,reader:t.read}:t.read&&typeof t.read=="object"&&t.read.enabled===void 0&&(t.read.enabled=!0)}function _he(t){typeof t.write=="boolean"?t.write={enabled:t.write}:typeof t.write=="function"?t.write={enabled:!0,writer:t.write}:t.write&&typeof t.write=="object"&&t.write.enabled===void 0&&(t.write.enabled=!0)}function bhe(t,e){if(!e.write||e.write.writer||e.write.enabled===!1&&!e.write.overridePolicy)return;const i=(t==null?void 0:t.ndimArray)??0;t&&(i===1||"type"in t&&PSe(t.type))?e.write.writer=pHe:i>1?e.write.writer=fHe(i):e.types?Array.isArray(e.types)?e.write.writer=dHe(e.types[0]):e.write.writer=hHe(e.types):e.write.writer=iL}function hHe(t){return(e,i,r,n)=>e?LSe(e,t,n)?iL(e,i,r,n):void 0:iL(e,i,r,n)}function LSe(t,e,i){for(const r in e.typeMap)if(t instanceof e.typeMap[r])return!0;if(i!=null&&i.messages){const r=e.errorContext??"type",n=`Values of type '${(typeof e.key!="function"?t[e.key]:t.declaredClass)??"Unknown"}' cannot be written`;i&&i.messages&&t&&i.messages.push(new se(`${r}:unsupported`,n,{definition:t,context:i})),Ce.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(n)}return!1}function dHe(t){return(e,i,r,n)=>!e||!Array.isArray(e)?iL(e,i,r,n):iL(e.filter(s=>LSe(s,t,n)),i,r,n)}function iL(t,e,i,r){sE(i,Qk(t,r),e)}function Qk(t,e){return t&&typeof t.write=="function"?t.write({},e):t&&typeof t.toJSON=="function"?t.toJSON():typeof t=="number"?ez(t):t}function ez(t){return t===-1/0?-Number.MAX_VALUE:t===1/0?Number.MAX_VALUE:isNaN(t)?null:t}function pHe(t,e,i,r){let n;t===null?n=null:t&&typeof t.map=="function"?(n=t.map(s=>Qk(s,r)),typeof n.toArray=="function"&&(n=n.toArray())):n=[Qk(t,r)],sE(i,n,e)}function DSe(t,e,i){return i!==0&&Array.isArray(t)?t.map(r=>DSe(r,e,i-1)):Qk(t,e)}function fHe(t){return(e,i,r,n)=>{let s;if(e===null)s=null;else{s=DSe(e,n,t);let o=t,l=s;for(;o>0&&Array.isArray(l);)o--,l=l[0];if(l!==void 0)for(let c=0;c{t??(t="esri.core.Accessor"),e.prototype.declaredClass=t,wHe(e);const i=[],r=[];let n=e.prototype;for(;n;)n.hasOwnProperty("initialize")&&!KG.has(n.initialize)&&(KG.add(n.initialize),i.push(n.initialize)),n.hasOwnProperty("destroy")&&!QG.has(n.destroy)&&(QG.add(n.destroy),r.push(n.destroy)),n=Object.getPrototypeOf(n);KG.clear(),QG.clear();const s=class extends e{constructor(...l){if(super(...l),this.constructor===s&&typeof this.postscript=="function"){if(i.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let c=i.length-1;c>=0;c--)i[c].call(this)}}),r.length){let c=!1;const f=this[Q3e];Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!c){c=!0,f.call(this);for(let _=0;_0&&this.normalizeCtorArgs&&(i.ctorArgs=this.normalizeCtorArgs.apply(this,e))}postscript(e){const i=this.__accessor__,r=i.ctorArgs||e;i.initialize(),r&&(this.set(r),i.ctorArgs=null),i.constructed(),this.initialize(),this[uZ]=!0}initialize(){}[Q3e](){this[kb]=et(this[kb])}destroy(){var e;this.destroyed||(kGe(this),this.__accessor__.destroy(),(e=mGe())==null||e.onInstanceDestroy(this))}[Symbol.dispose](){this.destroy()}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[uZ]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(e){au(this,e)}get(e){return R3e(Ce.getLogger(this),"`Accessor.get` is deprecated in favor of using optional chaining",{version:"4.28",see:"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"}),au(this,e)}hasOwnProperty(e){return this.__accessor__?this.__accessor__.has(e):Object.prototype.hasOwnProperty.call(this,e)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(e,i){return Gk(this,e,i),this}watch(e,i,r){return jGe(this,e,i,r)}addHandles(e,i){if(this.destroyed){const n=Array.isArray(e)?e:[e];for(const s of n)s.remove();return}let r=this[kb];r==null&&(r=this[kb]=new O_),r.add(e,i)}removeHandles(e){const i=this[kb];i!=null&&i.remove(e)}removeAllHandles(){const e=this[kb];e!=null&&e.removeAll()}hasHandles(e){const i=this[kb];return i!=null&&i.has(e)}_override(e,i){i===void 0?this.__accessor__.clearOverride(e):this.__accessor__.override(e,i)}_clearOverride(e){return this.__accessor__.clearOverride(e)}_overrideIfSome(e,i){i==null?this.__accessor__.clearOverride(e):this.__accessor__.override(e,i)}_isOverridden(e){return this.__accessor__.isOverridden(e)}notifyChange(e){this.__accessor__.notifyChange(e)}_get(e){return this.__accessor__.internalGet(e)}_set(e,i){return this.__accessor__.internalSet(e,i),this}};kSe=kb,zSe=uZ;let sA=class extends ze{constructor(e){super(e),this.format=null,this.position={coordinate:null,location:null}}get displayCoordinate(){var e,i;return(i=this.format)==null?void 0:i.getDisplayCoordinate((e=this.position)==null?void 0:e.coordinate)}};y([w({readOnly:!0})],sA.prototype,"displayCoordinate",null),y([w()],sA.prototype,"format",void 0),y([w()],sA.prototype,"position",void 0),sA=y([Z("esri.widgets.CoordinateConversion.support.Conversion")],sA);const BS=sA,SHe="modulepreload",THe=function(t){return"/elb-js-api/"+t},whe={},we=function(e,i,r){let n=Promise.resolve();if(i&&i.length>0){const s=document.getElementsByTagName("link");n=Promise.all(i.map(o=>{if(o=THe(o),o in whe)return;whe[o]=!0;const l=o.endsWith(".css"),c=l?'[rel="stylesheet"]':"";if(!!r)for(let x=s.length-1;x>=0;x--){const T=s[x];if(T.href===o&&(!l||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${c}`))return;const _=document.createElement("link");if(_.rel=l?"stylesheet":SHe,l||(_.as="script",_.crossOrigin=""),_.href=o,document.head.appendChild(_),l)return new Promise((x,T)=>{_.addEventListener("load",x),_.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${o}`)))})}))}return n.then(()=>e()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};function JV(t,e,i){return Uv(t.map((r,n)=>e.apply(i,[r,n])))}async function EHe(t,e,i){return(await Uv(t.map((r,n)=>e.apply(i,[r,n])))).map(r=>r.value)}function sne(t){return{ok:!0,value:t}}function one(t){return{ok:!1,error:t}}function CHe(t){return t!=null&&t.ok===!0?t.value:null}function AHe(t){return t!=null&&t.ok===!1?t.error:null}async function Ju(t){if(t==null)return{ok:!1,error:new Error("no promise provided")};try{return sne(await t)}catch(e){return one(e)}}async function MHe(t){try{return sne(await t)}catch(e){return zo(e),one(e)}}function LYt(t){if(t.ok===!0)return t.value;throw t.error}function Cc(t,e){return new zb(t,e)}let zb=class extends ze{get value(){return CHe(this._result)}get error(){return AHe(this._result)}get finished(){return this._result!=null}constructor(e,i){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=gn(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:r}=this._abortController;this.promise=e(r),this.promise.then(n=>{this._result=sne(n),this._cleanup()},n=>{this._result=one(n),this._cleanup()}),this._abortHandle=Yl(i,this.abort)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=en(this._abortHandle),this._abortController=null}};y([w()],zb.prototype,"value",null),y([w()],zb.prototype,"error",null),y([w()],zb.prototype,"finished",null),y([w()],zb.prototype,"promise",void 0),y([w()],zb.prototype,"_result",void 0),zb=y([Z("esri.core.asyncUtils.ReactiveTask")],zb);let f7=class VSe{constructor(){this._emitter=new VSe.EventEmitter(this)}emit(e,i){return this._emitter.emit(e,i)}on(e,i){return this._emitter.on(e,i)}once(e,i){return this._emitter.once(e,i)}hasEventListener(e){return this._emitter.hasEventListener(e)}};(function(t){class e{constructor(n=null){this._target=n,this._listenersMap=null}clear(){var n;(n=this._listenersMap)==null||n.clear(),this._listenersMap=null}destroy(){this.clear()}emit(n,s){var f;let o=(f=this._listenersMap)==null?void 0:f.get(n);if(!o)return!1;const l=this._target||this;let c=!1;for(const _ of o.slice()){const x="deref"in _?_.deref():_;x?x==null||x.call(l,s):c=!0}return c&&(o=o.filter(_=>!("deref"in _)||_.deref()!=null),this._listenersMap.set(n,o)),o.length>0}on(n,s){if(Array.isArray(n)){const l=n.map(c=>this.on(c,s));return id(l)}if(n.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap??(this._listenersMap=new Map);const o=this._listenersMap.get(n)||[];return o.push(s),this._listenersMap.set(n,o),rr(()=>{var f;const l=(f=this._listenersMap)==null?void 0:f.get(n),c=(l==null?void 0:l.indexOf(s))??-1;c>=0&&l.splice(c,1)})}once(n,s){const o=this.on(n,l=>{o.remove();const c="deref"in s?s.deref():s;c==null||c.call(null,l)});return o}hasEventListener(n){var o;const s=(o=this._listenersMap)==null?void 0:o.get(n);return s!=null&&s.length>0}}t.EventEmitter=e,t.EventedMixin=r=>{let n=class extends r{constructor(){super(...arguments),this._emitter=new e}destroy(){this._emitter.clear()}emit(s,o){return this._emitter.emit(s,o)}on(s,o){return this._emitter.on(s,o)}once(s,o){return this._emitter.once(s,o)}hasEventListener(s){return this._emitter.hasEventListener(s)}};return n=y([Z("esri.core.Evented")],n),n};let i=class extends ze{constructor(){super(...arguments),this._emitter=new f7.EventEmitter(this)}destroy(){this._emitter.clear()}emit(r,n){return this._emitter.emit(r,n)}on(r,n){return this._emitter.on(r,n)}once(r,n){return this._emitter.once(r,n)}hasEventListener(r){return this._emitter.hasEventListener(r)}};i=y([Z("esri.core.Evented")],i),t.EventedAccessor=i})(f7||(f7={}));const Dn=f7;var wn;(function(t){t[t.ADD=1]="ADD",t[t.REMOVE=2]="REMOVE",t[t.MOVE=4]="MOVE"})(wn||(wn={}));function BSe(t){return(e,i)=>{e[i]=t}}let v9=class extends nSe{notify(){const e=this._observers;if(e&&e.length>0){const i=e.slice();for(const r of i)r.onInvalidated(),r.onCommitted()}}};var Ov;let OHe=class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},PHe=class{constructor(e,i,r,n,s){this.target=e,this.added=i,this.removed=r,this.start=n,this.deleteCount=s}};const Mp=new Ec(OHe,void 0,t=>{t.item=null,t.target=null,t.defaultPrevented=!1,t.cancellable=!1});function eH(t){return t?t instanceof wS?t.toArray():t.length?Array.prototype.slice.apply(t):[]:[]}function tH(t){if(t!=null&&t.length)return t[0]}function RHe(t,e,i,r){const n=Math.min(t.length-i,e.length-r);let s=0;for(;s{t.push(n),jSe(t,i.call(r,n,s,o),i,r)})}const J_=new Set,K_=new Set,Q_=new Set,iH=new Map;let IHe=0,wS=Ov=class extends Dn.EventedAccessor{static isCollection(t){return t!=null&&t instanceof Ov}constructor(t){super(t),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new v9,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:IHe++})}normalizeCtorArgs(t){return t?Array.isArray(t)||t instanceof Ov?{items:t}:t:{}}destroy(){this._removeAllRaw()}*[Symbol.iterator](){yield*this.items}get items(){return wi(this._observable),this._items}set items(t){this._emitBeforeChanges(wn.ADD)||(this._splice(0,this.length,eH(t)),this._emitAfterChanges(wn.ADD))}hasEventListener(t){return t==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(t)}on(t,e){if(t==="change"){const i=this._chgListeners,r={removed:!1,callback:e};return i.push(r),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),rr(()=>{r.removed=!0,i.splice(i.indexOf(r),1)})}return this._emitter.on(t,e)}once(t,e){const i="deref"in e?()=>e.deref():()=>e,r=this.on(t,n=>{var s;(s=i())==null||s.call(null,n),r.remove()});return r}add(t,e){if(wi(this._observable),this._emitBeforeChanges(wn.ADD))return this;const i=this.getNextIndex(e??null);return this._splice(i,0,[t]),this._emitAfterChanges(wn.ADD),this}addMany(t,e=this._items.length){if(wi(this._observable),!(t!=null&&t.length))return this;if(this._emitBeforeChanges(wn.ADD))return this;const i=this.getNextIndex(e);return this._splice(i,0,eH(t)),this._emitAfterChanges(wn.ADD),this}at(t){if(wi(this._observable),(t=Math.trunc(t)||0)<0&&(t+=this.length),!(t<0||t>=this.length))return this._items[t]}removeAll(){if(wi(this._observable),!this.length||this._emitBeforeChanges(wn.REMOVE))return[];const t=this._removeAllRaw();return this._emitAfterChanges(wn.REMOVE),t}_removeAllRaw(){return this.length===0?[]:this._splice(0,this.length)||[]}clone(){return wi(this._observable),this._createNewInstance({items:this._items.map(Re)})}concat(...t){wi(this._observable);const e=t.map(eH);return this._createNewInstance({items:this._items.concat(...e)})}drain(t,e){if(wi(this._observable),!this.length||this._emitBeforeChanges(wn.REMOVE))return;const i=this._splice(0,this.length),r=i.length;for(let n=0;ne&&(t=e),t}includes(t,e=0){return wi(this._observable),this._items.includes(t,e)}indexOf(t,e=0){return wi(this._observable),this._items.indexOf(t,e)}join(t=","){return wi(this._observable),this._items.join(t)}lastIndexOf(t,e=this.length-1){return wi(this._observable),this._items.lastIndexOf(t,e)}map(t,e){wi(this._observable);const i=this._items.map(t,e);return new Ov({items:i})}reorder(t,e=this.length-1){wi(this._observable);const i=this.indexOf(t);if(i!==-1){if(e<0?e=0:e>=this.length&&(e=this.length-1),i!==e){if(this._emitBeforeChanges(wn.MOVE))return t;this._splice(i,1),this._splice(e,0,[t]),this._emitAfterChanges(wn.MOVE)}return t}}pop(){if(wi(this._observable),!this.length||this._emitBeforeChanges(wn.REMOVE))return;const t=tH(this._splice(this.length-1,1));return this._emitAfterChanges(wn.REMOVE),t}push(...t){return wi(this._observable),this._emitBeforeChanges(wn.ADD)||(this._splice(this.length,0,t),this._emitAfterChanges(wn.ADD)),this.length}reduce(t,e){wi(this._observable);const i=this._items;return arguments.length===2?i.reduce(t,e):i.reduce(t)}reduceRight(t,e){wi(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(t,e):i.reduceRight(t)}remove(t){return wi(this._observable),this.removeAt(this.indexOf(t))}removeAt(t){if(wi(this._observable),t<0||t>=this.length||this._emitBeforeChanges(wn.REMOVE))return;const e=tH(this._splice(t,1));return this._emitAfterChanges(wn.REMOVE),e}removeMany(t){if(wi(this._observable),!(t!=null&&t.length)||this._emitBeforeChanges(wn.REMOVE))return[];const e=t instanceof Ov?t.toArray():t,i=this._items,r=[],n=e.length;for(let s=0;s-1){const c=1+RHe(e,i,s+1,l+1),f=this._splice(l,c);f&&f.length>0&&r.push.apply(r,f),s+=c-1}}return this._emitAfterChanges(wn.REMOVE),r}reverse(){if(wi(this._observable),this._emitBeforeChanges(wn.MOVE))return this;const t=this._splice(0,this.length);return t&&(t.reverse(),this._splice(0,0,t)),this._emitAfterChanges(wn.MOVE),this}shift(){if(wi(this._observable),!this.length||this._emitBeforeChanges(wn.REMOVE))return;const t=tH(this._splice(0,1));return this._emitAfterChanges(wn.REMOVE),t}slice(t=0,e=this.length){return wi(this._observable),this._createNewInstance({items:this._items.slice(t,e)})}some(t,e){return wi(this._observable),this._items.some(t,e)}sort(t){if(wi(this._observable),!this.length||this._emitBeforeChanges(wn.MOVE))return this;const e=this._splice(0,this.length);return arguments.length?e.sort(t):e.sort(),this._splice(0,0,e),this._emitAfterChanges(wn.MOVE),this}splice(t,e,...i){wi(this._observable);const r=(e?wn.REMOVE:0)|(i.length?wn.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(t,e,i)||[];return this._emitAfterChanges(r),n}toArray(){return wi(this._observable),this._items.slice()}toJSON(){return wi(this._observable),this.toArray()}toLocaleString(){return wi(this._observable),this._items.toLocaleString()}toString(){return wi(this._observable),this._items.toString()}unshift(...t){return wi(this._observable),!t.length||this._emitBeforeChanges(wn.ADD)||(this._splice(0,0,t),this._emitAfterChanges(wn.ADD)),this.length}_createNewInstance(t){return new this.constructor(t)}_splice(t,e,i){const r=this._items,n=this.itemType;let s,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=tx(()=>this._dispatchChange())),t<0&&(t+=this.length),e){if(o=r.splice(t,e),this.hasEventListener("before-remove")){const l=Mp.acquire();l.target=this,l.cancellable=!0;for(let c=0,f=o.length;c{r.push(c)});const n=Uh.acquire();K_.forEach(c=>{n.push(c)});const s=this._items,o=e.items,l=Uh.acquire();if(Q_.forEach(c=>{o.indexOf(c)!==s.indexOf(c)&&l.push(c)}),e.listeners&&(r.length||n.length||l.length)){const c={target:this,added:r,removed:n,moved:l},f=e.listeners.length;for(let _=0;_{if(!t)return Ov;if(iH.has(t))return iH.get(t);let e=null;if(typeof t=="function")e=t.prototype.declaredClass;else if(t.base)e=t.base.prototype.declaredClass;else for(const r in t.typeMap){const n=t.typeMap[r].prototype.declaredClass;e?e+=` | ${n}`:e=n}let i=class extends Ov{};return y([BSe({Type:t,ensureType:typeof t=="function"?$s(t):zy(t)})],i.prototype,"itemType",void 0),i=y([Z(`esri.core.Collection<${e}>`)],i),iH.set(t,i),i},y([w()],wS.prototype,"length",void 0),y([w()],wS.prototype,"items",null),wS=Ov=y([Z("esri.core.Collection")],wS);const it=wS;function _e(t,e,i={}){return ane(t,e,i,GSe)}function Mo(t,e,i={}){return ane(t,e,i,HSe)}function ane(t,e,i={},r){let n=null;const s=i.once?(o,l)=>{r(o)&&(en(n),e(o,l))}:(o,l)=>{r(o)&&e(o,l)};if(n=qGe(t,s,i.sync,i.equals),i.initial){const o=t();s(o,o)}return n}function Jr(t,e,i,r={}){let n=null,s=null,o=null;function l(){var _;n&&s&&(s.remove(),(_=r.onListenerRemove)==null||_.call(r,n),n=null,s=null)}function c(_){r.once&&r.once&&en(o),i(_)}const f=_e(t,(_,x)=>{var T;l(),qV(_)&&(n=_,s=Y5(_,e,c),(T=r.onListenerAdd)==null||T.call(r,_))},{sync:r.sync,initial:!0});return o=rr(()=>{f.remove(),l()}),o}function rd(t,e){return $He(t,HSe,e)}function $He(t,e,i){if(xo(i))return Promise.reject(ur());const r=t();if(e!=null&&e(r))return Promise.resolve(r);let n=null;function s(){n=en(n)}return new Promise((o,l)=>{n=id([Yl(i,()=>{s(),l(ur())}),ane(t,c=>{s(),o(c)},{sync:!1,once:!0},e??GSe)])})}function GSe(t){return!0}function HSe(t){return!!t}function LHe(t,e,i={}){let r=!1;const n=_e(t,(s,o)=>{r||e(s,o)},i);return{remove(){n.remove()},pause(){r=!0},resume(){r=!1}}}function DHe(t,e){const i=new it,r=Jr(t,"after-splice",({added:n,start:s,deleteCount:o})=>{const l=i.splice(s,o);for(const c of l)c.remove();if(n!=null&&n.length){const c=n.map(e);i.addMany(c,s)}},{sync:!0,onListenerRemove:()=>i.drain(n=>n.remove()),onListenerAdd:n=>i.addMany(n.items.map(e))});return i.addHandles(r),i}function NHe(t,e){const i=new it,r=DHe(t,l=>Cc(async c=>{const f=await e(l,c);if(xo(c))throw f.remove(),ur();return f})),n=()=>null,s=async l=>{const c=await l.promise,f=r.indexOf(l);f<0||i.splice(f,1,c)};i.addMany(r.items.map(n));for(const l of r)$m(s(l));const o=r.on("after-splice",({added:l,start:c,deleteCount:f})=>{const _=i.splice(c,f);for(const x of _)x==null||x.remove();if(l!=null&&l.length){i.addMany(l.map(n),c);for(const x of l)$m(s(x))}});return i.addHandles([Jre(r),o]),i}const Li={sync:!0},ii={initial:!0},kt={sync:!0,initial:!0};let yn=class{constructor(e,i={ignoreUnknown:!1,useNumericKeys:!1}){this._jsonToAPI=e,this._options=i,this.apiValues=[],this.jsonValues=[],this._apiToJSON=this._invertMap(e),this.apiValues=this._getKeysSorted(this._apiToJSON),this.jsonValues=this._getKeysSorted(this._jsonToAPI),this.read=r=>this.fromJSON(r),this.write=(r,n,s)=>{const o=this.toJSON(r);o!==void 0&&sE(s,o,n)},this.write.isJSONMapWriter=!0}toJSON(e){if(e==null)return null;if(this._apiToJSON.hasOwnProperty(e)){const i=this._apiToJSON[e];return this._options.useNumericKeys?+i:i}return this._options.ignoreUnknown?void 0:e}fromJSON(e){return e!=null&&this._jsonToAPI.hasOwnProperty(e)?this._jsonToAPI[e]:this._options.ignoreUnknown?void 0:e}_invertMap(e){const i={};for(const r in e)i[e[r]]=r;return i}_getKeysSorted(e){const i=[];for(const r in e)i.push(r);return i.sort(),i}};function fu(){return function(t,e){return new yn(t,{ignoreUnknown:!0,...e})}}let BI;var M3e,O3e;const FHe=((M3e=globalThis.esriConfig)==null?void 0:M3e.locale)??((O3e=globalThis.dojoConfig)==null?void 0:O3e.locale);function qSe(){var t;return FHe??((t=globalThis.navigator)==null?void 0:t.language)??"en"}function fa(){return BI===void 0&&(BI=qSe()),BI}function lne(t=fa()){const e=/^([a-zA-Z]{2,3})(?:[_\-]\w+)*$/.exec(t);return e==null?void 0:e[1].toLowerCase()}const jI=[];function oE(t){return jI.push(t),rr(()=>jI.splice(jI.indexOf(t),1))}const hZ=[];function cne(t){return hZ.push(t),rr(()=>jI.splice(hZ.indexOf(t),1))}function kHe(){const t=qSe();BI!==t&&(BI=t,[...hZ].forEach(e=>{e.call(null,t)}),[...jI].forEach(e=>{e.call(null,t)}))}var P3e;(P3e=globalThis.addEventListener)==null||P3e.call(globalThis,"languagechange",kHe);const xhe=new Map([["AUS Central Standard Time","Australia/Darwin"],["AUS Eastern Standard Time","Australia/Sydney"],["Afghanistan Standard Time","Asia/Kabul"],["Alaskan Standard Time","America/Anchorage"],["Aleutian Standard Time","America/Adak"],["Altai Standard Time","Asia/Barnaul"],["Arab Standard Time","Asia/Riyadh"],["Arabian Standard Time","Asia/Dubai"],["Arabic Standard Time","Asia/Baghdad"],["Argentina Standard Time","America/Buenos_Aires"],["Astrakhan Standard Time","Europe/Astrakhan"],["Atlantic Standard Time","America/Halifax"],["Aus Central W. Standard Time","Australia/Eucla"],["Azerbaijan Standard Time","Asia/Baku"],["Azores Standard Time","Atlantic/Azores"],["Bahia Standard Time","America/Bahia"],["Bangladesh Standard Time","Asia/Dhaka"],["Belarus Standard Time","Europe/Minsk"],["Bougainville Standard Time","Pacific/Bougainville"],["Canada Central Standard Time","America/Regina"],["Cape Verde Standard Time","Atlantic/Cape_Verde"],["Caucasus Standard Time","Asia/Yerevan"],["Cen. Australia Standard Time","Australia/Adelaide"],["Central America Standard Time","America/Guatemala"],["Central Asia Standard Time","Asia/Almaty"],["Central Brazilian Standard Time","America/Cuiaba"],["Central Europe Standard Time","Europe/Budapest"],["Central European Standard Time","Europe/Warsaw"],["Central Pacific Standard Time","Pacific/Guadalcanal"],["Central Standard Time","America/Chicago"],["Central Standard Time (Mexico)","America/Mexico_City"],["Chatham Islands Standard Time","Pacific/Chatham"],["China Standard Time","Asia/Shanghai"],["Cuba Standard Time","America/Havana"],["Dateline Standard Time","Etc/GMT+12"],["E. Africa Standard Time","Africa/Nairobi"],["E. Australia Standard Time","Australia/Brisbane"],["E. Europe Standard Time","Europe/Chisinau"],["E. South America Standard Time","America/Sao_Paulo"],["Easter Island Standard Time","Pacific/Easter"],["Eastern Standard Time","America/New_York"],["Eastern Standard Time (Mexico)","America/Cancun"],["Egypt Standard Time","Africa/Cairo"],["Ekaterinburg Standard Time","Asia/Yekaterinburg"],["FLE Standard Time","Europe/Kiev"],["Fiji Standard Time","Pacific/Fiji"],["GMT Standard Time","Europe/London"],["GTB Standard Time","Europe/Bucharest"],["Georgian Standard Time","Asia/Tbilisi"],["Greenland Standard Time","America/Godthab"],["Greenwich Standard Time","Atlantic/Reykjavik"],["Haiti Standard Time","America/Port-au-Prince"],["Hawaiian Standard Time","Pacific/Honolulu"],["India Standard Time","Asia/Calcutta"],["Iran Standard Time","Asia/Tehran"],["Israel Standard Time","Asia/Jerusalem"],["Jordan Standard Time","Asia/Amman"],["Kaliningrad Standard Time","Europe/Kaliningrad"],["Korea Standard Time","Asia/Seoul"],["Libya Standard Time","Africa/Tripoli"],["Line Islands Standard Time","Pacific/Kiritimati"],["Lord Howe Standard Time","Australia/Lord_Howe"],["Magadan Standard Time","Asia/Magadan"],["Magallanes Standard Time","America/Punta_Arenas"],["Marquesas Standard Time","Pacific/Marquesas"],["Mauritius Standard Time","Indian/Mauritius"],["Middle East Standard Time","Asia/Beirut"],["Montevideo Standard Time","America/Montevideo"],["Morocco Standard Time","Africa/Casablanca"],["Mountain Standard Time","America/Denver"],["Mountain Standard Time (Mexico)","America/Mazatlan"],["Myanmar Standard Time","Asia/Rangoon"],["N. Central Asia Standard Time","Asia/Novosibirsk"],["Namibia Standard Time","Africa/Windhoek"],["Nepal Standard Time","Asia/Katmandu"],["New Zealand Standard Time","Pacific/Auckland"],["Newfoundland Standard Time","America/St_Johns"],["Norfolk Standard Time","Pacific/Norfolk"],["North Asia East Standard Time","Asia/Irkutsk"],["North Asia Standard Time","Asia/Krasnoyarsk"],["North Korea Standard Time","Asia/Pyongyang"],["Omsk Standard Time","Asia/Omsk"],["Pacific SA Standard Time","America/Santiago"],["Pacific Standard Time","America/Los_Angeles"],["Pacific Standard Time (Mexico)","America/Tijuana"],["Pakistan Standard Time","Asia/Karachi"],["Paraguay Standard Time","America/Asuncion"],["Qyzylorda Standard Time","Asia/Qyzylorda"],["Romance Standard Time","Europe/Paris"],["Russia Time Zone 10","Asia/Srednekolymsk"],["Russia Time Zone 11","Asia/Kamchatka"],["Russia Time Zone 3","Europe/Samara"],["Russian Standard Time","Europe/Moscow"],["SA Eastern Standard Time","America/Cayenne"],["SA Pacific Standard Time","America/Bogota"],["SA Western Standard Time","America/La_Paz"],["SE Asia Standard Time","Asia/Bangkok"],["Saint Pierre Standard Time","America/Miquelon"],["Sakhalin Standard Time","Asia/Sakhalin"],["Samoa Standard Time","Pacific/Apia"],["Sao Tome Standard Time","Africa/Sao_Tome"],["Saratov Standard Time","Europe/Saratov"],["Singapore Standard Time","Asia/Singapore"],["South Africa Standard Time","Africa/Johannesburg"],["South Sudan Standard Time","Africa/Juba"],["Sri Lanka Standard Time","Asia/Colombo"],["Sudan Standard Time","Africa/Khartoum"],["Syria Standard Time","Asia/Damascus"],["Taipei Standard Time","Asia/Taipei"],["Tasmania Standard Time","Australia/Hobart"],["Tocantins Standard Time","America/Araguaina"],["Tokyo Standard Time","Asia/Tokyo"],["Tomsk Standard Time","Asia/Tomsk"],["Tonga Standard Time","Pacific/Tongatapu"],["Transbaikal Standard Time","Asia/Chita"],["Turkey Standard Time","Europe/Istanbul"],["Turks And Caicos Standard Time","America/Grand_Turk"],["US Eastern Standard Time","America/Indianapolis"],["US Mountain Standard Time","America/Phoenix"],["UTC","Etc/GMT"],["UTC+01","Etc/GMT-1"],["UTC+02","Etc/GMT-2"],["UTC+03","Etc/GMT-3"],["UTC+04","Etc/GMT-4"],["UTC+05","Etc/GMT-5"],["UTC+06","Etc/GMT-6"],["UTC+07","Etc/GMT-7"],["UTC+08","Etc/GMT-8"],["UTC+09","Etc/GMT-9"],["UTC+10","Etc/GMT-10"],["UTC+11","Etc/GMT-11"],["UTC+12","Etc/GMT-12"],["UTC+13","Etc/GMT-13"],["UTC+14","Etc/GMT-14"],["UTC-01","Etc/GMT+1"],["UTC-02","Etc/GMT+2"],["UTC-03","Etc/GMT+3"],["UTC-04","Etc/GMT+4"],["UTC-05","Etc/GMT+5"],["UTC-06","Etc/GMT+6"],["UTC-07","Etc/GMT+7"],["UTC-08","Etc/GMT+8"],["UTC-09","Etc/GMT+9"],["UTC-10","Etc/GMT+10"],["UTC-11","Etc/GMT+11"],["UTC-12","Etc/GMT+12"],["Ulaanbaatar Standard Time","Asia/Ulaanbaatar"],["Venezuela Standard Time","America/Caracas"],["Vladivostok Standard Time","Asia/Vladivostok"],["Volgograd Standard Time","Europe/Volgograd"],["W. Australia Standard Time","Australia/Perth"],["W. Central Africa Standard Time","Africa/Lagos"],["W. Europe Standard Time","Europe/Berlin"],["W. Mongolia Standard Time","Asia/Hovd"],["West Asia Standard Time","Asia/Tashkent"],["West Bank Standard Time","Asia/Hebron"],["West Pacific Standard Time","Pacific/Port_Moresby"],["Yakutsk Standard Time","Asia/Yakutsk"],["Yukon Standard Time","America/Whitehorse"]]);class aE extends Error{}class zHe extends aE{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class UHe extends aE{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class VHe extends aE{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class _M extends aE{}class WSe extends aE{constructor(e){super(`Invalid unit ${e}`)}}class Bh extends aE{}class eb extends aE{constructor(){super("Zone is an abstract class")}}const Ut="numeric",Lm="short",dp="long",tz={year:Ut,month:Ut,day:Ut},YSe={year:Ut,month:Lm,day:Ut},BHe={year:Ut,month:Lm,day:Ut,weekday:Lm},XSe={year:Ut,month:dp,day:Ut},ZSe={year:Ut,month:dp,day:Ut,weekday:dp},JSe={hour:Ut,minute:Ut},KSe={hour:Ut,minute:Ut,second:Ut},QSe={hour:Ut,minute:Ut,second:Ut,timeZoneName:Lm},eTe={hour:Ut,minute:Ut,second:Ut,timeZoneName:dp},tTe={hour:Ut,minute:Ut,hourCycle:"h23"},iTe={hour:Ut,minute:Ut,second:Ut,hourCycle:"h23"},rTe={hour:Ut,minute:Ut,second:Ut,hourCycle:"h23",timeZoneName:Lm},nTe={hour:Ut,minute:Ut,second:Ut,hourCycle:"h23",timeZoneName:dp},sTe={year:Ut,month:Ut,day:Ut,hour:Ut,minute:Ut},oTe={year:Ut,month:Ut,day:Ut,hour:Ut,minute:Ut,second:Ut},aTe={year:Ut,month:Lm,day:Ut,hour:Ut,minute:Ut},lTe={year:Ut,month:Lm,day:Ut,hour:Ut,minute:Ut,second:Ut},jHe={year:Ut,month:Lm,day:Ut,weekday:Lm,hour:Ut,minute:Ut},cTe={year:Ut,month:dp,day:Ut,hour:Ut,minute:Ut,timeZoneName:Lm},uTe={year:Ut,month:dp,day:Ut,hour:Ut,minute:Ut,second:Ut,timeZoneName:Lm},hTe={year:Ut,month:dp,day:Ut,weekday:dp,hour:Ut,minute:Ut,timeZoneName:dp},dTe={year:Ut,month:dp,day:Ut,weekday:dp,hour:Ut,minute:Ut,second:Ut,timeZoneName:dp};class J5{get type(){throw new eb}get name(){throw new eb}get ianaName(){return this.name}get isUniversal(){throw new eb}offsetName(e,i){throw new eb}formatOffset(e,i){throw new eb}offset(e){throw new eb}equals(e){throw new eb}get isValid(){throw new eb}}let rH=null;class KV extends J5{static get instance(){return rH===null&&(rH=new KV),rH}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:i,locale:r}){return wTe(e,i,r)}formatOffset(e,i){return GI(this.offset(e),i)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let m7={};function GHe(t){return m7[t]||(m7[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),m7[t]}const HHe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function qHe(t,e){const i=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(i),[,n,s,o,l,c,f,_]=r;return[o,n,s,l,c,f,_]}function WHe(t,e){const i=t.formatToParts(e),r=[];for(let n=0;n=0?M:1e3+M,(T-A)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let She={};function YHe(t,e={}){const i=JSON.stringify([t,e]);let r=She[i];return r||(r=new Intl.ListFormat(t,e),She[i]=r),r}let dZ={};function pZ(t,e={}){const i=JSON.stringify([t,e]);let r=dZ[i];return r||(r=new Intl.DateTimeFormat(t,e),dZ[i]=r),r}let fZ={};function XHe(t,e={}){const i=JSON.stringify([t,e]);let r=fZ[i];return r||(r=new Intl.NumberFormat(t,e),fZ[i]=r),r}let mZ={};function ZHe(t,e={}){const{base:i,...r}=e,n=JSON.stringify([t,r]);let s=mZ[n];return s||(s=new Intl.RelativeTimeFormat(t,e),mZ[n]=s),s}let JR=null;function JHe(){return JR||(JR=new Intl.DateTimeFormat().resolvedOptions().locale,JR)}let The={};function KHe(t){let e=The[t];if(!e){const i=new Intl.Locale(t);e="getWeekInfo"in i?i.getWeekInfo():i.weekInfo,The[t]=e}return e}function QHe(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const i=t.indexOf("-u-");if(i===-1)return[t];{let r,n;try{r=pZ(t).resolvedOptions(),n=t}catch{const c=t.substring(0,i);r=pZ(c).resolvedOptions(),n=c}const{numberingSystem:s,calendar:o}=r;return[n,s,o]}}function eqe(t,e,i){return(i||e)&&(t.includes("-u-")||(t+="-u"),i&&(t+=`-ca-${i}`),e&&(t+=`-nu-${e}`)),t}function tqe(t){const e=[];for(let i=1;i<=12;i++){const r=$i.utc(2009,i,1);e.push(t(r))}return e}function iqe(t){const e=[];for(let i=1;i<=7;i++){const r=$i.utc(2016,11,13+i);e.push(t(r))}return e}function M6(t,e,i,r){const n=t.listingMode();return n==="error"?null:n==="en"?i(e):r(e)}function rqe(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class nqe{constructor(e,i,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...o}=r;if(!i||Object.keys(o).length>0){const l={useGrouping:!1,...r};r.padTo>0&&(l.minimumIntegerDigits=r.padTo),this.inf=XHe(e,l)}}format(e){if(this.inf){const i=this.floor?Math.floor(e):e;return this.inf.format(i)}else{const i=this.floor?Math.floor(e):pne(e,3);return ja(i,this.padTo)}}}class sqe{constructor(e,i,r){this.opts=r,this.originalZone=void 0;let n;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),l=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&wp.create(l).valid?(n=l,this.dt=e):(n="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=pZ(i,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(i=>{if(i.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...i,value:r}}else return i}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class oqe{constructor(e,i,r){this.opts={style:"long",...r},!i&&_Te()&&(this.rtf=ZHe(e,r))}format(e,i){return this.rtf?this.rtf.format(e,i):Cqe(i,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,i){return this.rtf?this.rtf.formatToParts(e,i):[]}}const aqe={firstDay:1,minimalDays:4,weekend:[6,7]};class As{static fromOpts(e){return As.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,i,r,n,s=!1){const o=e||xa.defaultLocale,l=o||(s?"en-US":JHe()),c=i||xa.defaultNumberingSystem,f=r||xa.defaultOutputCalendar,_=gZ(n)||xa.defaultWeekSettings;return new As(l,c,f,_,o)}static resetCache(){JR=null,dZ={},fZ={},mZ={}}static fromObject({locale:e,numberingSystem:i,outputCalendar:r,weekSettings:n}={}){return As.create(e,i,r,n)}constructor(e,i,r,n,s){const[o,l,c]=QHe(e);this.locale=o,this.numberingSystem=i||l||null,this.outputCalendar=r||c||null,this.weekSettings=n,this.intl=eqe(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=rqe(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),i=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&i?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:As.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,gZ(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,i=!1){return M6(this,e,TTe,()=>{const r=i?{month:e,day:"numeric"}:{month:e},n=i?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=tqe(s=>this.extract(s,r,"month"))),this.monthsCache[n][e]})}weekdays(e,i=!1){return M6(this,e,ATe,()=>{const r=i?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=i?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=iqe(s=>this.extract(s,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return M6(this,void 0,()=>MTe,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[$i.utc(2016,11,13,9),$i.utc(2016,11,13,19)].map(i=>this.extract(i,e,"dayperiod"))}return this.meridiemCache})}eras(e){return M6(this,e,OTe,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[$i.utc(-40,1,1),$i.utc(2017,1,1)].map(r=>this.extract(r,i,"era"))),this.eraCache[e]})}extract(e,i,r){const n=this.dtFormatter(e,i),s=n.formatToParts(),o=s.find(l=>l.type.toLowerCase()===r);return o?o.value:null}numberFormatter(e={}){return new nqe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,i={}){return new sqe(e,this.intl,i)}relFormatter(e={}){return new oqe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return YHe(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bTe()?KHe(this.locale):aqe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let nH=null;class bc extends J5{static get utcInstance(){return nH===null&&(nH=new bc(0)),nH}static instance(e){return e===0?bc.utcInstance:new bc(e)}static parseSpecifier(e){if(e){const i=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(i)return new bc(tB(i[1],i[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${GI(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${GI(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,i){return GI(this.fixed,i)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class lqe extends J5{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Vw(t,e){if(mr(t)||t===null)return e;if(t instanceof J5)return t;if(hqe(t)){const i=t.toLowerCase();return i==="default"?e:i==="local"||i==="system"?KV.instance:i==="utc"||i==="gmt"?bc.utcInstance:bc.parseSpecifier(i)||wp.create(t)}else return aT(t)?bc.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new lqe(t)}let Ehe=()=>Date.now(),Che="system",Ahe=null,Mhe=null,Ohe=null,Phe=60,Rhe,Ihe=null;class xa{static get now(){return Ehe}static set now(e){Ehe=e}static set defaultZone(e){Che=e}static get defaultZone(){return Vw(Che,KV.instance)}static get defaultLocale(){return Ahe}static set defaultLocale(e){Ahe=e}static get defaultNumberingSystem(){return Mhe}static set defaultNumberingSystem(e){Mhe=e}static get defaultOutputCalendar(){return Ohe}static set defaultOutputCalendar(e){Ohe=e}static get defaultWeekSettings(){return Ihe}static set defaultWeekSettings(e){Ihe=gZ(e)}static get twoDigitCutoffYear(){return Phe}static set twoDigitCutoffYear(e){Phe=e%100}static get throwOnInvalid(){return Rhe}static set throwOnInvalid(e){Rhe=e}static resetCaches(){As.resetCache(),wp.resetCache()}}class fm{constructor(e,i){this.reason=e,this.explanation=i}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const pTe=[0,31,59,90,120,151,181,212,243,273,304,334],fTe=[0,31,60,91,121,152,182,213,244,274,305,335];function Tf(t,e){return new fm("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function une(t,e,i){const r=new Date(Date.UTC(t,e-1,i));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const n=r.getUTCDay();return n===0?7:n}function mTe(t,e,i){return i+(_9(t)?fTe:pTe)[e-1]}function gTe(t,e){const i=_9(t)?fTe:pTe,r=i.findIndex(s=>srL(r,e,i)?(f=r+1,c=1):f=r,{weekYear:f,weekNumber:c,weekday:l,...iB(t)}}function $he(t,e=4,i=1){const{weekYear:r,weekNumber:n,weekday:s}=t,o=hne(une(r,1,e),i),l=KM(r);let c=n*7+s-o-7+e,f;c<1?(f=r-1,c+=KM(f)):c>l?(f=r+1,c-=KM(r)):f=r;const{month:_,day:x}=gTe(f,c);return{year:f,month:_,day:x,...iB(t)}}function sH(t){const{year:e,month:i,day:r}=t,n=mTe(e,i,r);return{year:e,ordinal:n,...iB(t)}}function Lhe(t){const{year:e,ordinal:i}=t,{month:r,day:n}=gTe(e,i);return{year:e,month:r,day:n,...iB(t)}}function Dhe(t,e){if(!mr(t.localWeekday)||!mr(t.localWeekNumber)||!mr(t.localWeekYear)){if(!mr(t.weekday)||!mr(t.weekNumber)||!mr(t.weekYear))throw new _M("Cannot mix locale-based week fields with ISO-based week fields");return mr(t.localWeekday)||(t.weekday=t.localWeekday),mr(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),mr(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function cqe(t,e=4,i=1){const r=QV(t.weekYear),n=Ef(t.weekNumber,1,rL(t.weekYear,e,i)),s=Ef(t.weekday,1,7);return r?n?s?!1:Tf("weekday",t.weekday):Tf("week",t.weekNumber):Tf("weekYear",t.weekYear)}function uqe(t){const e=QV(t.year),i=Ef(t.ordinal,1,KM(t.year));return e?i?!1:Tf("ordinal",t.ordinal):Tf("year",t.year)}function yTe(t){const e=QV(t.year),i=Ef(t.month,1,12),r=Ef(t.day,1,rz(t.year,t.month));return e?i?r?!1:Tf("day",t.day):Tf("month",t.month):Tf("year",t.year)}function vTe(t){const{hour:e,minute:i,second:r,millisecond:n}=t,s=Ef(e,0,23)||e===24&&i===0&&r===0&&n===0,o=Ef(i,0,59),l=Ef(r,0,59),c=Ef(n,0,999);return s?o?l?c?!1:Tf("millisecond",n):Tf("second",r):Tf("minute",i):Tf("hour",e)}function mr(t){return typeof t>"u"}function aT(t){return typeof t=="number"}function QV(t){return typeof t=="number"&&t%1===0}function hqe(t){return typeof t=="string"}function dqe(t){return Object.prototype.toString.call(t)==="[object Date]"}function _Te(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bTe(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function pqe(t){return Array.isArray(t)?t:[t]}function Nhe(t,e,i){if(t.length!==0)return t.reduce((r,n)=>{const s=[e(n),n];return r&&i(r[0],s[0])===r[0]?r:s},null)[1]}function fqe(t,e){return e.reduce((i,r)=>(i[r]=t[r],i),{})}function zO(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function gZ(t){if(t==null)return null;if(typeof t!="object")throw new Bh("Week settings must be an object");if(!Ef(t.firstDay,1,7)||!Ef(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!Ef(e,1,7)))throw new Bh("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function Ef(t,e,i){return QV(t)&&t>=e&&t<=i}function mqe(t,e){return t-e*Math.floor(t/e)}function ja(t,e=2){const i=t<0;let r;return i?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Ow(t){if(!(mr(t)||t===null||t===""))return parseInt(t,10)}function vx(t){if(!(mr(t)||t===null||t===""))return parseFloat(t)}function dne(t){if(!(mr(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function pne(t,e,i=!1){const r=10**e;return(i?Math.trunc:Math.round)(t*r)/r}function _9(t){return t%4===0&&(t%100!==0||t%400===0)}function KM(t){return _9(t)?366:365}function rz(t,e){const i=mqe(e-1,12)+1,r=t+(e-i)/12;return i===2?_9(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][i-1]}function eB(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Fhe(t,e,i){return-hne(une(t,1,e),i)+e-1}function rL(t,e=4,i=1){const r=Fhe(t,e,i),n=Fhe(t+1,e,i);return(KM(t)-r+n)/7}function yZ(t){return t>99?t:t>xa.twoDigitCutoffYear?1900+t:2e3+t}function wTe(t,e,i,r=null){const n=new Date(t),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(s.timeZone=r);const o={timeZoneName:e,...s},l=new Intl.DateTimeFormat(i,o).formatToParts(n).find(c=>c.type.toLowerCase()==="timezonename");return l?l.value:null}function tB(t,e){let i=parseInt(t,10);Number.isNaN(i)&&(i=0);const r=parseInt(e,10)||0,n=i<0||Object.is(i,-0)?-r:r;return i*60+n}function xTe(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Bh(`Invalid unit value ${t}`);return e}function nz(t,e){const i={};for(const r in t)if(zO(t,r)){const n=t[r];if(n==null)continue;i[e(r)]=xTe(n)}return i}function GI(t,e){const i=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),n=t>=0?"+":"-";switch(e){case"short":return`${n}${ja(i,2)}:${ja(r,2)}`;case"narrow":return`${n}${i}${r>0?`:${r}`:""}`;case"techie":return`${n}${ja(i,2)}${ja(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function iB(t){return fqe(t,["hour","minute","second","millisecond"])}const gqe=["January","February","March","April","May","June","July","August","September","October","November","December"],STe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yqe=["J","F","M","A","M","J","J","A","S","O","N","D"];function TTe(t){switch(t){case"narrow":return[...yqe];case"short":return[...STe];case"long":return[...gqe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ETe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],CTe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],vqe=["M","T","W","T","F","S","S"];function ATe(t){switch(t){case"narrow":return[...vqe];case"short":return[...CTe];case"long":return[...ETe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const MTe=["AM","PM"],_qe=["Before Christ","Anno Domini"],bqe=["BC","AD"],wqe=["B","A"];function OTe(t){switch(t){case"narrow":return[...wqe];case"short":return[...bqe];case"long":return[..._qe];default:return null}}function xqe(t){return MTe[t.hour<12?0:1]}function Sqe(t,e){return ATe(e)[t.weekday-1]}function Tqe(t,e){return TTe(e)[t.month-1]}function Eqe(t,e){return OTe(e)[t.year<0?0:1]}function Cqe(t,e,i="always",r=!1){const n={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=["hours","minutes","seconds"].indexOf(t)===-1;if(i==="auto"&&s){const x=t==="days";switch(e){case 1:return x?"tomorrow":`next ${n[t][0]}`;case-1:return x?"yesterday":`last ${n[t][0]}`;case 0:return x?"today":`this ${n[t][0]}`}}const o=Object.is(e,-0)||e<0,l=Math.abs(e),c=l===1,f=n[t],_=r?c?f[1]:f[2]||f[1]:c?n[t][0]:t;return o?`${l} ${_} ago`:`in ${l} ${_}`}function khe(t,e){let i="";for(const r of t)r.literal?i+=r.val:i+=e(r.val);return i}const Aqe={D:tz,DD:YSe,DDD:XSe,DDDD:ZSe,t:JSe,tt:KSe,ttt:QSe,tttt:eTe,T:tTe,TT:iTe,TTT:rTe,TTTT:nTe,f:sTe,ff:aTe,fff:cTe,ffff:hTe,F:oTe,FF:lTe,FFF:uTe,FFFF:dTe};class nu{static create(e,i={}){return new nu(e,i)}static parseFormat(e){let i=null,r="",n=!1;const s=[];for(let o=0;o0&&s.push({literal:n||/^\s+$/.test(r),val:r}),i=null,r="",n=!n):n||l===i?r+=l:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=l,i=l)}return r.length>0&&s.push({literal:n||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return Aqe[e]}constructor(e,i){this.opts=i,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,i){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...i}).format()}dtFormatter(e,i={}){return this.loc.dtFormatter(e,{...this.opts,...i})}formatDateTime(e,i){return this.dtFormatter(e,i).format()}formatDateTimeParts(e,i){return this.dtFormatter(e,i).formatToParts()}formatInterval(e,i){return this.dtFormatter(e.start,i).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,i){return this.dtFormatter(e,i).resolvedOptions()}num(e,i=0){if(this.opts.forceSimple)return ja(e,i);const r={...this.opts};return i>0&&(r.padTo=i),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,i){const r=this.loc.listingMode()==="en",n=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(A,M)=>this.loc.extract(e,A,M),o=A=>e.isOffsetFixed&&e.offset===0&&A.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,A.format):"",l=()=>r?xqe(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),c=(A,M)=>r?Tqe(e,A):s(M?{month:A}:{month:A,day:"numeric"},"month"),f=(A,M)=>r?Sqe(e,A):s(M?{weekday:A}:{weekday:A,month:"long",day:"numeric"},"weekday"),_=A=>{const M=nu.macroTokenToFormatOpts(A);return M?this.formatWithSystemDefault(e,M):A},x=A=>r?Eqe(e,A):s({era:A},"era"),T=A=>{switch(A){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return l();case"d":return n?s({day:"numeric"},"day"):this.num(e.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return f("short",!0);case"cccc":return f("long",!0);case"ccccc":return f("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return f("short",!1);case"EEEE":return f("long",!1);case"EEEEE":return f("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return c("short",!0);case"LLLL":return c("long",!0);case"LLLLL":return c("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(e.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return c("short",!1);case"MMMM":return c("long",!1);case"MMMMM":return c("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(e.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return x("short");case"GG":return x("long");case"GGGGG":return x("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return _(A)}};return khe(nu.parseFormat(i),T)}formatDurationFromString(e,i){const r=c=>{switch(c[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},n=c=>f=>{const _=r(f);return _?this.num(c.get(_),f.length):f},s=nu.parseFormat(i),o=s.reduce((c,{literal:f,val:_})=>f?c:c.concat(_),[]),l=e.shiftTo(...o.map(r).filter(c=>c));return khe(s,n(l))}}const PTe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function K5(...t){const e=t.reduce((i,r)=>i+r.source,"");return RegExp(`^${e}$`)}function Q5(...t){return e=>t.reduce(([i,r,n],s)=>{const[o,l,c]=s(e,n);return[{...i,...o},l||r,c]},[{},null,1]).slice(0,2)}function eP(t,...e){if(t==null)return[null,null];for(const[i,r]of e){const n=i.exec(t);if(n)return r(n)}return[null,null]}function RTe(...t){return(e,i)=>{const r={};let n;for(n=0;nA!==void 0&&(M||A&&_)?-A:A;return[{years:T(vx(i)),months:T(vx(r)),weeks:T(vx(n)),days:T(vx(s)),hours:T(vx(o)),minutes:T(vx(l)),seconds:T(vx(c),c==="-0"),milliseconds:T(dne(f),x)}]}const Uqe={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function gne(t,e,i,r,n,s,o){const l={year:e.length===2?yZ(Ow(e)):Ow(e),month:STe.indexOf(i)+1,day:Ow(r),hour:Ow(n),minute:Ow(s)};return o&&(l.second=Ow(o)),t&&(l.weekday=t.length>3?ETe.indexOf(t)+1:CTe.indexOf(t)+1),l}const Vqe=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Bqe(t){const[,e,i,r,n,s,o,l,c,f,_,x]=t,T=gne(e,n,r,i,s,o,l);let A;return c?A=Uqe[c]:f?A=0:A=tB(_,x),[T,new bc(A)]}function jqe(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Gqe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Hqe=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,qqe=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zhe(t){const[,e,i,r,n,s,o,l]=t;return[gne(e,n,r,i,s,o,l),bc.utcInstance]}function Wqe(t){const[,e,i,r,n,s,o,l]=t;return[gne(e,l,i,r,n,s,o),bc.utcInstance]}const Yqe=K5(Oqe,mne),Xqe=K5(Pqe,mne),Zqe=K5(Rqe,mne),Jqe=K5($Te),DTe=Q5(Nqe,tP,b9,w9),Kqe=Q5(Iqe,tP,b9,w9),Qqe=Q5($qe,tP,b9,w9),eWe=Q5(tP,b9,w9);function tWe(t){return eP(t,[Yqe,DTe],[Xqe,Kqe],[Zqe,Qqe],[Jqe,eWe])}function iWe(t){return eP(jqe(t),[Vqe,Bqe])}function rWe(t){return eP(t,[Gqe,zhe],[Hqe,zhe],[qqe,Wqe])}function nWe(t){return eP(t,[kqe,zqe])}const sWe=Q5(tP);function oWe(t){return eP(t,[Fqe,sWe])}const aWe=K5(Lqe,Dqe),lWe=K5(LTe),cWe=Q5(tP,b9,w9);function uWe(t){return eP(t,[aWe,DTe],[lWe,cWe])}const Uhe="Invalid Duration",NTe={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},hWe={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...NTe},Op=146097/400,IE=146097/4800,dWe={years:{quarters:4,months:12,weeks:Op/7,days:Op,hours:Op*24,minutes:Op*24*60,seconds:Op*24*60*60,milliseconds:Op*24*60*60*1e3},quarters:{months:3,weeks:Op/28,days:Op/4,hours:Op*24/4,minutes:Op*24*60/4,seconds:Op*24*60*60/4,milliseconds:Op*24*60*60*1e3/4},months:{weeks:IE/7,days:IE,hours:IE*24,minutes:IE*24*60,seconds:IE*24*60*60,milliseconds:IE*24*60*60*1e3},...NTe},jS=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],pWe=jS.slice(0).reverse();function tb(t,e,i=!1){const r={values:i?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new hn(r)}function FTe(t,e){let i=e.milliseconds??0;for(const r of pWe.slice(1))e[r]&&(i+=e[r]*t[r].milliseconds);return i}function Vhe(t,e){const i=FTe(t,e)<0?-1:1;jS.reduceRight((r,n)=>{if(mr(e[n]))return r;if(r){const s=e[r]*i,o=t[n][r],l=Math.floor(s/o);e[n]+=l*i,e[r]-=l*o*i}return n},null),jS.reduce((r,n)=>{if(mr(e[n]))return r;if(r){const s=e[r]%1;e[r]-=s,e[n]+=s*t[r][n]}return n},null)}function fWe(t){const e={};for(const[i,r]of Object.entries(t))r!==0&&(e[i]=r);return e}class hn{constructor(e){const i=e.conversionAccuracy==="longterm"||!1;let r=i?dWe:hWe;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||As.create(),this.conversionAccuracy=i?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,i){return hn.fromObject({milliseconds:e},i)}static fromObject(e,i={}){if(e==null||typeof e!="object")throw new Bh(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new hn({values:nz(e,hn.normalizeUnit),loc:As.fromObject(i),conversionAccuracy:i.conversionAccuracy,matrix:i.matrix})}static fromDurationLike(e){if(aT(e))return hn.fromMillis(e);if(hn.isDuration(e))return e;if(typeof e=="object")return hn.fromObject(e);throw new Bh(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,i){const[r]=nWe(e);return r?hn.fromObject(r,i):hn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,i){const[r]=oWe(e);return r?hn.fromObject(r,i):hn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,i=null){if(!e)throw new Bh("need to specify a reason the Duration is invalid");const r=e instanceof fm?e:new fm(e,i);if(xa.throwOnInvalid)throw new VHe(r);return new hn({invalid:r})}static normalizeUnit(e){const i={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!i)throw new WSe(e);return i}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,i={}){const r={...i,floor:i.round!==!1&&i.floor!==!1};return this.isValid?nu.create(this.loc,r).formatDurationFromString(this,e):Uhe}toHuman(e={}){if(!this.isValid)return Uhe;const i=jS.map(r=>{const n=this.values[r];return mr(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=pne(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const i=this.toMillis();return i<0||i>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},$i.fromMillis(i,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?FTe(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const i=hn.fromDurationLike(e),r={};for(const n of jS)(zO(i.values,n)||zO(this.values,n))&&(r[n]=i.get(n)+this.get(n));return tb(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const i=hn.fromDurationLike(e);return this.plus(i.negate())}mapUnits(e){if(!this.isValid)return this;const i={};for(const r of Object.keys(this.values))i[r]=xTe(e(this.values[r],r));return tb(this,{values:i},!0)}get(e){return this[hn.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const i={...this.values,...nz(e,hn.normalizeUnit)};return tb(this,{values:i})}reconfigure({locale:e,numberingSystem:i,conversionAccuracy:r,matrix:n}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:i}),matrix:n,conversionAccuracy:r};return tb(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Vhe(this.matrix,e),tb(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=fWe(this.normalize().shiftToAll().toObject());return tb(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>hn.normalizeUnit(o));const i={},r={},n=this.toObject();let s;for(const o of jS)if(e.indexOf(o)>=0){s=o;let l=0;for(const f in r)l+=this.matrix[f][o]*r[f],r[f]=0;aT(n[o])&&(l+=n[o]);const c=Math.trunc(l);i[o]=c,r[o]=(l*1e3-c*1e3)/1e3}else aT(n[o])&&(r[o]=n[o]);for(const o in r)r[o]!==0&&(i[s]+=o===s?r[o]:r[o]/this.matrix[s][o]);return Vhe(this.matrix,i),tb(this,{values:i},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const i of Object.keys(this.values))e[i]=this.values[i]===0?0:-this.values[i];return tb(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function i(r,n){return r===void 0||r===0?n===void 0||n===0:r===n}for(const r of jS)if(!i(this.values[r],e.values[r]))return!1;return!0}}const $E="Invalid Interval";function mWe(t,e){return!t||!t.isValid?Xo.invalid("missing or invalid start"):!e||!e.isValid?Xo.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:i}={}){return this.isValid?Xo.fromDateTimes(e||this.s,i||this.e):this}splitAt(...e){if(!this.isValid)return[];const i=e.map(LP).filter(o=>this.contains(o)).sort((o,l)=>o.toMillis()-l.toMillis()),r=[];let{s:n}=this,s=0;for(;n+this.e?this.e:o;r.push(Xo.fromDateTimes(n,l)),n=l,s+=1}return r}splitBy(e){const i=hn.fromDurationLike(e);if(!this.isValid||!i.isValid||i.as("milliseconds")===0)return[];let{s:r}=this,n=1,s;const o=[];for(;rc*n));s=+l>+this.e?this.e:l,o.push(Xo.fromDateTimes(r,s)),r=s,n+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const i=this.s>e.s?this.s:e.s,r=this.e=r?null:Xo.fromDateTimes(i,r)}union(e){if(!this.isValid)return this;const i=this.se.e?this.e:e.e;return Xo.fromDateTimes(i,r)}static merge(e){const[i,r]=e.sort((n,s)=>n.s-s.s).reduce(([n,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[n,s.union(o)]:[n.concat([s]),o]:[n,o],[[],null]);return r&&i.push(r),i}static xor(e){let i=null,r=0;const n=[],s=e.map(c=>[{time:c.s,type:"s"},{time:c.e,type:"e"}]),o=Array.prototype.concat(...s),l=o.sort((c,f)=>c.time-f.time);for(const c of l)r+=c.type==="s"?1:-1,r===1?i=c.time:(i&&+i!=+c.time&&n.push(Xo.fromDateTimes(i,c.time)),i=null);return Xo.merge(n)}difference(...e){return Xo.xor([this].concat(e)).map(i=>this.intersection(i)).filter(i=>i&&!i.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:$E}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=tz,i={}){return this.isValid?nu.create(this.s.loc.clone(i),e).formatInterval(this):$E}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:$E}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:$E}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:$E}toFormat(e,{separator:i=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${i}${this.e.toFormat(e)}`:$E}toDuration(e,i){return this.isValid?this.e.diff(this.s,e,i):hn.invalid(this.invalidReason)}mapEndpoints(e){return Xo.fromDateTimes(e(this.s),e(this.e))}}class KR{static hasDST(e=xa.defaultZone){const i=$i.now().setZone(e).set({month:12});return!e.isUniversal&&i.offset!==i.set({month:6}).offset}static isValidIANAZone(e){return wp.isValidZone(e)}static normalizeZone(e){return Vw(e,xa.defaultZone)}static getStartOfWeek({locale:e=null,locObj:i=null}={}){return(i||As.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:i=null}={}){return(i||As.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:i=null}={}){return(i||As.create(e)).getWeekendDays().slice()}static months(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||As.create(i,r,s)).months(e)}static monthsFormat(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||As.create(i,r,s)).months(e,!0)}static weekdays(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null}={}){return(n||As.create(i,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:i=null,numberingSystem:r=null,locObj:n=null}={}){return(n||As.create(i,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return As.create(e).meridiems()}static eras(e="short",{locale:i=null}={}){return As.create(i,null,"gregory").eras(e)}static features(){return{relative:_Te(),localeWeek:bTe()}}}function Bhe(t,e){const i=n=>n.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=i(e)-i(t);return Math.floor(hn.fromMillis(r).as("days"))}function gWe(t,e,i){const r=[["years",(c,f)=>f.year-c.year],["quarters",(c,f)=>f.quarter-c.quarter+(f.year-c.year)*4],["months",(c,f)=>f.month-c.month+(f.year-c.year)*12],["weeks",(c,f)=>{const _=Bhe(c,f);return(_-_%7)/7}],["days",Bhe]],n={},s=t;let o,l;for(const[c,f]of r)i.indexOf(c)>=0&&(o=c,n[c]=f(t,e),l=s.plus(n),l>e?(n[c]--,t=s.plus(n),t>e&&(l=t,n[c]--,t=s.plus(n))):t=l);return[t,n,l,o]}function yWe(t,e,i,r){let[n,s,o,l]=gWe(t,e,i);const c=e-n,f=i.filter(x=>["hours","minutes","seconds","milliseconds"].indexOf(x)>=0);f.length===0&&(o0?hn.fromMillis(c,r).shiftTo(...f).plus(_):_}const yne={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},jhe={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},vWe=yne.hanidec.replace(/[\[|\]]/g,"").split("");function _We(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let i=0;i=s&&r<=o&&(e+=r-s)}}return parseInt(e,10)}else return e}function u0({numberingSystem:t},e=""){return new RegExp(`${yne[t||"latn"]}${e}`)}const bWe="missing Intl.DateTimeFormat.formatToParts support";function jn(t,e=i=>i){return{regex:t,deser:([i])=>e(_We(i))}}const wWe=" ",kTe=`[ ${wWe}]`,zTe=new RegExp(kTe,"g");function xWe(t){return t.replace(/\./g,"\\.?").replace(zTe,kTe)}function Ghe(t){return t.replace(/\./g,"").replace(zTe," ").toLowerCase()}function h0(t,e){return t===null?null:{regex:RegExp(t.map(xWe).join("|")),deser:([i])=>t.findIndex(r=>Ghe(i)===Ghe(r))+e}}function Hhe(t,e){return{regex:t,deser:([,i,r])=>tB(i,r),groups:e}}function O6(t){return{regex:t,deser:([e])=>e}}function SWe(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function TWe(t,e){const i=u0(e),r=u0(e,"{2}"),n=u0(e,"{3}"),s=u0(e,"{4}"),o=u0(e,"{6}"),l=u0(e,"{1,2}"),c=u0(e,"{1,3}"),f=u0(e,"{1,6}"),_=u0(e,"{1,9}"),x=u0(e,"{2,4}"),T=u0(e,"{4,6}"),A=L=>({regex:RegExp(SWe(L.val)),deser:([F])=>F,literal:!0}),I=(L=>{if(t.literal)return A(L);switch(L.val){case"G":return h0(e.eras("short"),0);case"GG":return h0(e.eras("long"),0);case"y":return jn(f);case"yy":return jn(x,yZ);case"yyyy":return jn(s);case"yyyyy":return jn(T);case"yyyyyy":return jn(o);case"M":return jn(l);case"MM":return jn(r);case"MMM":return h0(e.months("short",!0),1);case"MMMM":return h0(e.months("long",!0),1);case"L":return jn(l);case"LL":return jn(r);case"LLL":return h0(e.months("short",!1),1);case"LLLL":return h0(e.months("long",!1),1);case"d":return jn(l);case"dd":return jn(r);case"o":return jn(c);case"ooo":return jn(n);case"HH":return jn(r);case"H":return jn(l);case"hh":return jn(r);case"h":return jn(l);case"mm":return jn(r);case"m":return jn(l);case"q":return jn(l);case"qq":return jn(r);case"s":return jn(l);case"ss":return jn(r);case"S":return jn(c);case"SSS":return jn(n);case"u":return O6(_);case"uu":return O6(l);case"uuu":return jn(i);case"a":return h0(e.meridiems(),0);case"kkkk":return jn(s);case"kk":return jn(x,yZ);case"W":return jn(l);case"WW":return jn(r);case"E":case"c":return jn(i);case"EEE":return h0(e.weekdays("short",!1),1);case"EEEE":return h0(e.weekdays("long",!1),1);case"ccc":return h0(e.weekdays("short",!0),1);case"cccc":return h0(e.weekdays("long",!0),1);case"Z":case"ZZ":return Hhe(new RegExp(`([+-]${l.source})(?::(${r.source}))?`),2);case"ZZZ":return Hhe(new RegExp(`([+-]${l.source})(${r.source})?`),2);case"z":return O6(/[a-z_+-/]{1,256}?/i);case" ":return O6(/[^\S\n\r]/);default:return A(L)}})(t)||{invalidReason:bWe};return I.token=t,I}const EWe={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function CWe(t,e,i){const{type:r,value:n}=t;if(r==="literal"){const c=/^\s+$/.test(n);return{literal:!c,val:c?" ":n}}const s=e[r];let o=r;r==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=i.hour12?"hour12":"hour24");let l=EWe[o];if(typeof l=="object"&&(l=l[s]),l)return{literal:!1,val:l}}function AWe(t){return[`^${t.map(i=>i.regex).reduce((i,r)=>`${i}(${r.source})`,"")}$`,t]}function MWe(t,e,i){const r=t.match(e);if(r){const n={};let s=1;for(const o in i)if(zO(i,o)){const l=i[o],c=l.groups?l.groups+1:1;!l.literal&&l.token&&(n[l.token.val[0]]=l.deser(r.slice(s,s+c))),s+=c}return[r,n]}else return[r,{}]}function OWe(t){const e=s=>{switch(s){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let i=null,r;return mr(t.z)||(i=wp.create(t.z)),mr(t.Z)||(i||(i=new bc(t.Z)),r=t.Z),mr(t.q)||(t.M=(t.q-1)*3+1),mr(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),mr(t.u)||(t.S=dne(t.u)),[Object.keys(t).reduce((s,o)=>{const l=e(o);return l&&(s[l]=t[o]),s},{}),i,r]}let oH=null;function PWe(){return oH||(oH=$i.fromMillis(1555555555555)),oH}function RWe(t,e){if(t.literal)return t;const i=nu.macroTokenToFormatOpts(t.val),r=BTe(i,e);return r==null||r.includes(void 0)?t:r}function UTe(t,e){return Array.prototype.concat(...t.map(i=>RWe(i,e)))}function VTe(t,e,i){const r=UTe(nu.parseFormat(i),t),n=r.map(o=>TWe(o,t)),s=n.find(o=>o.invalidReason);if(s)return{input:e,tokens:r,invalidReason:s.invalidReason};{const[o,l]=AWe(n),c=RegExp(o,"i"),[f,_]=MWe(e,c,l),[x,T,A]=_?OWe(_):[null,null,void 0];if(zO(_,"a")&&zO(_,"H"))throw new _M("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:c,rawMatches:f,matches:_,result:x,zone:T,specificOffset:A}}}function IWe(t,e,i){const{result:r,zone:n,specificOffset:s,invalidReason:o}=VTe(t,e,i);return[r,n,s,o]}function BTe(t,e){if(!t)return null;const r=nu.create(e,t).dtFormatter(PWe()),n=r.formatToParts(),s=r.resolvedOptions();return n.map(o=>CWe(o,t,s))}const aH="Invalid DateTime",qhe=864e13;function P6(t){return new fm("unsupported zone",`the zone "${t.name}" is not supported`)}function lH(t){return t.weekData===null&&(t.weekData=iz(t.c)),t.weekData}function cH(t){return t.localWeekData===null&&(t.localWeekData=iz(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function _x(t,e){const i={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new $i({...i,...e,old:i})}function jTe(t,e,i){let r=t-e*60*1e3;const n=i.offset(r);if(e===n)return[r,e];r-=(n-e)*60*1e3;const s=i.offset(r);return n===s?[r,n]:[t-Math.min(n,s)*60*1e3,Math.max(n,s)]}function R6(t,e){t+=e*60*1e3;const i=new Date(t);return{year:i.getUTCFullYear(),month:i.getUTCMonth()+1,day:i.getUTCDate(),hour:i.getUTCHours(),minute:i.getUTCMinutes(),second:i.getUTCSeconds(),millisecond:i.getUTCMilliseconds()}}function g7(t,e,i){return jTe(eB(t),e,i)}function Whe(t,e){const i=t.o,r=t.c.year+Math.trunc(e.years),n=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...t.c,year:r,month:n,day:Math.min(t.c.day,rz(r,n))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=hn.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),l=eB(s);let[c,f]=jTe(l,i,t.zone);return o!==0&&(c+=o,f=t.zone.offset(c)),{ts:c,o:f}}function $P(t,e,i,r,n,s){const{setZone:o,zone:l}=i;if(t&&Object.keys(t).length!==0||e){const c=e||l,f=$i.fromObject(t,{...i,zone:c,specificOffset:s});return o?f:f.setZone(l)}else return $i.invalid(new fm("unparsable",`the input "${n}" can't be parsed as ${r}`))}function I6(t,e,i=!0){return t.isValid?nu.create(As.create("en-US"),{allowZ:i,forceSimple:!0}).formatDateTimeFromString(t,e):null}function uH(t,e){const i=t.c.year>9999||t.c.year<0;let r="";return i&&t.c.year>=0&&(r+="+"),r+=ja(t.c.year,i?6:4),e?(r+="-",r+=ja(t.c.month),r+="-",r+=ja(t.c.day)):(r+=ja(t.c.month),r+=ja(t.c.day)),r}function Yhe(t,e,i,r,n,s){let o=ja(t.c.hour);return e?(o+=":",o+=ja(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!i)&&(o+=":")):o+=ja(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!i)&&(o+=ja(t.c.second),(t.c.millisecond!==0||!r)&&(o+=".",o+=ja(t.c.millisecond,3))),n&&(t.isOffsetFixed&&t.offset===0&&!s?o+="Z":t.o<0?(o+="-",o+=ja(Math.trunc(-t.o/60)),o+=":",o+=ja(Math.trunc(-t.o%60))):(o+="+",o+=ja(Math.trunc(t.o/60)),o+=":",o+=ja(Math.trunc(t.o%60)))),s&&(o+="["+t.zone.ianaName+"]"),o}const GTe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},$We={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},LWe={ordinal:1,hour:0,minute:0,second:0,millisecond:0},HTe=["year","month","day","hour","minute","second","millisecond"],DWe=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],NWe=["year","ordinal","hour","minute","second","millisecond"];function FWe(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new WSe(t);return e}function Xhe(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return FWe(t)}}function Zhe(t,e){const i=Vw(e.zone,xa.defaultZone),r=As.fromObject(e),n=xa.now();let s,o;if(mr(t.year))s=n;else{for(const f of HTe)mr(t[f])&&(t[f]=GTe[f]);const l=yTe(t)||vTe(t);if(l)return $i.invalid(l);const c=i.offset(n);[s,o]=g7(t,c,i)}return new $i({ts:s,zone:i,loc:r,o})}function Jhe(t,e,i){const r=mr(i.round)?!0:i.round,n=(o,l)=>(o=pne(o,r||i.calendary?0:2,!0),e.loc.clone(i).relFormatter(i).format(o,l)),s=o=>i.calendary?e.hasSame(t,o)?0:e.startOf(o).diff(t.startOf(o),o).get(o):e.diff(t,o).get(o);if(i.unit)return n(s(i.unit),i.unit);for(const o of i.units){const l=s(o);if(Math.abs(l)>=1)return n(l,o)}return n(t>e?-0:0,i.units[i.units.length-1])}function Khe(t){let e={},i;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],i=Array.from(t).slice(0,t.length-1)):i=Array.from(t),[e,i]}class $i{constructor(e){const i=e.zone||xa.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new fm("invalid input"):null)||(i.isValid?null:P6(i));this.ts=mr(e.ts)?xa.now():e.ts;let n=null,s=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(i))[n,s]=[e.old.c,e.old.o];else{const l=i.offset(this.ts);n=R6(this.ts,l),r=Number.isNaN(n.year)?new fm("invalid input"):null,n=r?null:n,s=r?null:l}this._zone=i,this.loc=e.loc||As.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new $i({})}static local(){const[e,i]=Khe(arguments),[r,n,s,o,l,c,f]=i;return Zhe({year:r,month:n,day:s,hour:o,minute:l,second:c,millisecond:f},e)}static utc(){const[e,i]=Khe(arguments),[r,n,s,o,l,c,f]=i;return e.zone=bc.utcInstance,Zhe({year:r,month:n,day:s,hour:o,minute:l,second:c,millisecond:f},e)}static fromJSDate(e,i={}){const r=dqe(e)?e.valueOf():NaN;if(Number.isNaN(r))return $i.invalid("invalid input");const n=Vw(i.zone,xa.defaultZone);return n.isValid?new $i({ts:r,zone:n,loc:As.fromObject(i)}):$i.invalid(P6(n))}static fromMillis(e,i={}){if(aT(e))return e<-qhe||e>qhe?$i.invalid("Timestamp out of range"):new $i({ts:e,zone:Vw(i.zone,xa.defaultZone),loc:As.fromObject(i)});throw new Bh(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,i={}){if(aT(e))return new $i({ts:e*1e3,zone:Vw(i.zone,xa.defaultZone),loc:As.fromObject(i)});throw new Bh("fromSeconds requires a numerical input")}static fromObject(e,i={}){e=e||{};const r=Vw(i.zone,xa.defaultZone);if(!r.isValid)return $i.invalid(P6(r));const n=As.fromObject(i),s=nz(e,Xhe),{minDaysInFirstWeek:o,startOfWeek:l}=Dhe(s,n),c=xa.now(),f=mr(i.specificOffset)?r.offset(c):i.specificOffset,_=!mr(s.ordinal),x=!mr(s.year),T=!mr(s.month)||!mr(s.day),A=x||T,M=s.weekYear||s.weekNumber;if((A||_)&&M)throw new _M("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(T&&_)throw new _M("Can't mix ordinal dates with month/day");const I=M||s.weekday&&!A;let L,F,z=R6(c,f);I?(L=DWe,F=$We,z=iz(z,o,l)):_?(L=NWe,F=LWe,z=sH(z)):(L=HTe,F=GTe);let k=!1;for(const re of L){const he=s[re];mr(he)?k?s[re]=F[re]:s[re]=z[re]:k=!0}const U=I?cqe(s,o,l):_?uqe(s):yTe(s),j=U||vTe(s);if(j)return $i.invalid(j);const H=I?$he(s,o,l):_?Lhe(s):s,[Y,Q]=g7(H,f,r),ne=new $i({ts:Y,zone:r,o:Q,loc:n});return s.weekday&&A&&e.weekday!==ne.weekday?$i.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${ne.toISO()}`):ne}static fromISO(e,i={}){const[r,n]=tWe(e);return $P(r,n,i,"ISO 8601",e)}static fromRFC2822(e,i={}){const[r,n]=iWe(e);return $P(r,n,i,"RFC 2822",e)}static fromHTTP(e,i={}){const[r,n]=rWe(e);return $P(r,n,i,"HTTP",i)}static fromFormat(e,i,r={}){if(mr(e)||mr(i))throw new Bh("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=r,o=As.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[l,c,f,_]=IWe(o,e,i);return _?$i.invalid(_):$P(l,c,r,`format ${i}`,e,f)}static fromString(e,i,r={}){return $i.fromFormat(e,i,r)}static fromSQL(e,i={}){const[r,n]=uWe(e);return $P(r,n,i,"SQL",e)}static invalid(e,i=null){if(!e)throw new Bh("need to specify a reason the DateTime is invalid");const r=e instanceof fm?e:new fm(e,i);if(xa.throwOnInvalid)throw new zHe(r);return new $i({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,i={}){const r=BTe(e,As.fromObject(i));return r?r.map(n=>n?n.val:null).join(""):null}static expandFormat(e,i={}){return UTe(nu.parseFormat(e),As.fromObject(i)).map(n=>n.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?lH(this).weekYear:NaN}get weekNumber(){return this.isValid?lH(this).weekNumber:NaN}get weekday(){return this.isValid?lH(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cH(this).weekday:NaN}get localWeekNumber(){return this.isValid?cH(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cH(this).weekYear:NaN}get ordinal(){return this.isValid?sH(this.c).ordinal:NaN}get monthShort(){return this.isValid?KR.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?KR.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?KR.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?KR.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,i=6e4,r=eB(this.c),n=this.zone.offset(r-e),s=this.zone.offset(r+e),o=this.zone.offset(r-n*i),l=this.zone.offset(r-s*i);if(o===l)return[this];const c=r-o*i,f=r-l*i,_=R6(c,o),x=R6(f,l);return _.hour===x.hour&&_.minute===x.minute&&_.second===x.second&&_.millisecond===x.millisecond?[_x(this,{ts:c}),_x(this,{ts:f})]:[this]}get isInLeapYear(){return _9(this.year)}get daysInMonth(){return rz(this.year,this.month)}get daysInYear(){return this.isValid?KM(this.year):NaN}get weeksInWeekYear(){return this.isValid?rL(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?rL(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:i,numberingSystem:r,calendar:n}=nu.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:i,numberingSystem:r,outputCalendar:n}}toUTC(e=0,i={}){return this.setZone(bc.instance(e),i)}toLocal(){return this.setZone(xa.defaultZone)}setZone(e,{keepLocalTime:i=!1,keepCalendarTime:r=!1}={}){if(e=Vw(e,xa.defaultZone),e.equals(this.zone))return this;if(e.isValid){let n=this.ts;if(i||r){const s=e.offset(this.ts),o=this.toObject();[n]=g7(o,s,e)}return _x(this,{ts:n,zone:e})}else return $i.invalid(P6(e))}reconfigure({locale:e,numberingSystem:i,outputCalendar:r}={}){const n=this.loc.clone({locale:e,numberingSystem:i,outputCalendar:r});return _x(this,{loc:n})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const i=nz(e,Xhe),{minDaysInFirstWeek:r,startOfWeek:n}=Dhe(i,this.loc),s=!mr(i.weekYear)||!mr(i.weekNumber)||!mr(i.weekday),o=!mr(i.ordinal),l=!mr(i.year),c=!mr(i.month)||!mr(i.day),f=l||c,_=i.weekYear||i.weekNumber;if((f||o)&&_)throw new _M("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new _M("Can't mix ordinal dates with month/day");let x;s?x=$he({...iz(this.c,r,n),...i},r,n):mr(i.ordinal)?(x={...this.toObject(),...i},mr(i.day)&&(x.day=Math.min(rz(x.year,x.month),x.day))):x=Lhe({...sH(this.c),...i});const[T,A]=g7(x,this.o,this.zone);return _x(this,{ts:T,o:A})}plus(e){if(!this.isValid)return this;const i=hn.fromDurationLike(e);return _x(this,Whe(this,i))}minus(e){if(!this.isValid)return this;const i=hn.fromDurationLike(e).negate();return _x(this,Whe(this,i))}startOf(e,{useLocaleWeeks:i=!1}={}){if(!this.isValid)return this;const r={},n=hn.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks")if(i){const s=this.loc.getStartOfWeek(),{weekday:o}=this;othis.valueOf(),l=o?this:e,c=o?e:this,f=yWe(l,c,s,n);return o?f.negate():f}diffNow(e="milliseconds",i={}){return this.diff($i.now(),e,i)}until(e){return this.isValid?Xo.fromDateTimes(this,e):this}hasSame(e,i,r){if(!this.isValid)return!1;const n=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(i,r)<=n&&n<=s.endOf(i,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const i=e.base||$i.fromObject({},{zone:this.zone}),r=e.padding?thisi.valueOf(),Math.min)}static max(...e){if(!e.every($i.isDateTime))throw new Bh("max requires all arguments be DateTimes");return Nhe(e,i=>i.valueOf(),Math.max)}static fromFormatExplain(e,i,r={}){const{locale:n=null,numberingSystem:s=null}=r,o=As.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});return VTe(o,e,i)}static fromStringExplain(e,i,r={}){return $i.fromFormatExplain(e,i,r)}static get DATE_SHORT(){return tz}static get DATE_MED(){return YSe}static get DATE_MED_WITH_WEEKDAY(){return BHe}static get DATE_FULL(){return XSe}static get DATE_HUGE(){return ZSe}static get TIME_SIMPLE(){return JSe}static get TIME_WITH_SECONDS(){return KSe}static get TIME_WITH_SHORT_OFFSET(){return QSe}static get TIME_WITH_LONG_OFFSET(){return eTe}static get TIME_24_SIMPLE(){return tTe}static get TIME_24_WITH_SECONDS(){return iTe}static get TIME_24_WITH_SHORT_OFFSET(){return rTe}static get TIME_24_WITH_LONG_OFFSET(){return nTe}static get DATETIME_SHORT(){return sTe}static get DATETIME_SHORT_WITH_SECONDS(){return oTe}static get DATETIME_MED(){return aTe}static get DATETIME_MED_WITH_SECONDS(){return lTe}static get DATETIME_MED_WITH_WEEKDAY(){return jHe}static get DATETIME_FULL(){return cTe}static get DATETIME_FULL_WITH_SECONDS(){return uTe}static get DATETIME_HUGE(){return hTe}static get DATETIME_HUGE_WITH_SECONDS(){return dTe}}function LP(t){if($i.isDateTime(t))return t;if(t&&t.valueOf&&aT(t.valueOf()))return $i.fromJSDate(t);if(t&&typeof t=="object")return $i.fromObject(t);throw new Bh(`Unknown datetime argument: ${t}, of type ${typeof t}`)}const Uy="system",OT="unknown",Vy="UTC",kWe=Intl.DateTimeFormat().resolvedOptions().timeZone,zWe="shortOffset";function UWe(t){return"timeZoneIANA"in t}function VWe(t){return t.startsWith("UTC")}function BWe(t,e=!1){return{json:{read:{source:t,reader:(i,r)=>r[t]?y7(r[t]):null},write:!!e&&{allowNull:!0,writer(i,r){r[t]=i?jWe(i):null}}}}}function y7(t,e=Uy){return t?UWe(t)?t.timeZoneIANA:GWe(t,e):e}function jWe(t){return{timeZoneIANA:t}}function GWe(t,e=Uy){if(!t||!xhe.has(t.timeZone))return e;const i=xhe.get(t.timeZone);return VWe(t.timeZone)||t.respectsDaylightSaving?i:HWe(i)}function HWe(t){const e=$i.local().setZone(t),i=Math.min(e.set({month:1,day:1}).offset,e.set({month:5}).offset);return i===0?"Etc/UTC":`Etc/GMT${bc.instance(-i).formatOffset(0,"narrow")}`}function qWe(t,e,i,r,n){if(e&&n==="date")return{timeZone:Vy,timeZoneName:void 0};const s=r.timeStyle||r.hour,o=i===OT;return{timeZone:o?n==="timestamp-offset"?void 0:t??Vy:i,timeZoneName:o&&s?zWe:void 0}}const WWe={year:void 0,month:void 0,day:void 0,weekday:void 0},YWe={hour:void 0,minute:void 0,second:void 0},qTe={timeZone:Vy},Xm={year:"numeric",month:"numeric",day:"numeric"},DP={year:"numeric",month:"long",day:"numeric"},NP={year:"numeric",month:"short",day:"numeric"},FP={year:"numeric",month:"long",weekday:"long",day:"numeric"},Pw={hour:"numeric",minute:"numeric"},h3={...Pw,second:"numeric"},WTe={hourCycle:"h23"},kP={...Pw,...WTe},zP={...h3,...WTe},YTe={"short-date":Xm,"short-date-short-time":{...Xm,...Pw},"short-date-short-time-24":{...Xm,...kP},"short-date-long-time":{...Xm,...h3},"short-date-long-time-24":{...Xm,...zP},"short-date-le":Xm,"short-date-le-short-time":{...Xm,...Pw},"short-date-le-short-time-24":{...Xm,...kP},"short-date-le-long-time":{...Xm,...h3},"short-date-le-long-time-24":{...Xm,...zP},"long-month-day-year":DP,"long-month-day-year-short-time":{...DP,...Pw},"long-month-day-year-short-time-24":{...DP,...kP},"long-month-day-year-long-time":{...DP,...h3},"long-month-day-year-long-time-24":{...DP,...zP},"day-short-month-year":NP,"day-short-month-year-short-time":{...NP,...Pw},"day-short-month-year-short-time-24":{...NP,...kP},"day-short-month-year-long-time":{...NP,...h3},"day-short-month-year-long-time-24":{...NP,...zP},"long-date":FP,"long-date-short-time":{...FP,...Pw},"long-date-short-time-24":{...FP,...kP},"long-date-long-time":{...FP,...h3},"long-date-long-time-24":{...FP,...zP},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Pw,"long-time":h3},XWe=fu()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"}),XTe={ar:"ar-u-nu-latn-ca-gregory"};let vZ=new WeakMap;const rB=YTe["short-date-short-time"];function ZTe(t){let e=vZ.get(t);if(!e){const i=fa(),r=XTe[i]||i,n=vne(t.timeZone??Uy),s={...t,timeZone:n};e=new Intl.DateTimeFormat(r,s),vZ.set(t,e)}return e}function oA(t){return YTe[t]}function js(t,e=rB){return ZTe(e).format(t)}function ZWe(t,e=rB){return js(new Date(t),{...e,...qTe,...YWe})}function JWe(t,e=rB){return js(new Date(`1970-01-01T${t}Z`),{...e,...qTe,...WWe})}function KWe(t,e=rB){if(e.timeZone)return js(new Date(t),e);const i=$i.fromISO(t,{setZone:!0}),r=fa(),n=XTe[r]??r,s=i.offset===0?Vy:e.timeZone,o={...e,timeZone:s};return i.toLocaleString(o,{locale:n})}function vne(t){switch(t){case Uy:return kWe;case OT:return Vy;default:return t}}cne(()=>{vZ=new WeakMap});const QWe={ar:"ar-u-nu-latn"};let v7=new WeakMap,JTe={};function eYe(t){const e=t||JTe;if(!v7.has(e)){const i=fa(),r=QWe[fa()]||i;v7.set(e,new Intl.NumberFormat(r,t))}return v7.get(e)}function UYt(t={}){const e={};return t.digitSeparator!=null&&(e.useGrouping=t.digitSeparator),t.places!=null&&(e.minimumFractionDigits=e.maximumFractionDigits=t.places),e}function nd(t,e){return Object.is(t,-0)&&(t=0),eYe(e).format(t)}cne(()=>{v7=new WeakMap,JTe={}});const KTe=Ce.getLogger("esri.intl.substitute");function By(t,e,i={}){const{format:r={}}=i;return h9(t,n=>tYe(n,e,r))}function tYe(t,e,i){let r,n;const s=t.indexOf(":");if(s===-1?r=t.trim():(r=t.slice(0,s).trim(),n=t.slice(s+1).trim()),!r)return"";const o=u9(r,e);if(o==null)return"";const l=(n?i==null?void 0:i[n]:null)??(i==null?void 0:i[r]);return l?iYe(o,l):n?rYe(o,n):_ne(o)}function iYe(t,e){switch(e.type){case"date":return js(t,e.intlOptions);case"number":return nd(t,e.intlOptions);default:return KTe.warn("missing format descriptor for key {key}"),_ne(t)}}function rYe(t,e){switch(e.toLowerCase()){case"dateformat":return js(t);case"numberformat":return nd(t);default:return KTe.warn(`inline format is unsupported since 4.12: ${e}`),/^(dateformat|datestring)/i.test(e)?js(t):/^numberformat/i.test(e)?nd(t):_ne(t)}}function _ne(t){switch(typeof t){case"string":return t;case"number":return nd(t);case"boolean":return""+t;default:return t instanceof Date?js(t):""}}const Qhe=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,nYe={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function ede(t){return t in nYe}const QR=[],eO=new Map;function tde(t){for(const e of eO.keys())QTe(t.pattern,e)&&eO.delete(e)}function sYe(t){return QR.includes(t)||(tde(t),QR.unshift(t)),rr(()=>{const e=QR.indexOf(t);e>-1&&(QR.splice(e,1),tde(t))})}async function lE(t){const e=fa();eO.has(t)||eO.set(t,aYe(t,e));const i=eO.get(t);return i&&await lYe.add(i),i}function oYe(t){if(!Qhe.test(t))return null;const e=Qhe.exec(t);if(e===null)return null;const[,i,r]=e,n=i+(r?"-"+r.toUpperCase():"");return ede(n)?n:ede(i)?i:null}async function aYe(t,e){const i=[];for(const r of QR)if(QTe(r.pattern,t))try{return await r.fetchMessageBundle(t,e)}catch(n){i.push(n)}throw i.length?new se("intl:message-bundle-error",`Errors occurred while loading "${t}"`,{errors:i}):new se("intl:no-message-bundle-loader",`No loader found for message bundle "${t}"`)}function QTe(t,e){return typeof t=="string"?e.startsWith(t):t.test(e)}cne(()=>{eO.clear()});const lYe=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(t){return this._increase(),t.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=Jl())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}};let cYe=class eEe{constructor(){this._values=new Map,this.multipleOriginsSupported=!1}clone(e){const i=new eEe;return this._values.forEach((r,n)=>{e&&e.has(n)||i.set(n,Re(r.value),r.origin)}),i}get(e,i){i=this._normalizeOrigin(i);const r=this._values.get(e);return i==null||(r==null?void 0:r.origin)===i?r==null?void 0:r.value:void 0}originOf(e){var i;return((i=this._values.get(e))==null?void 0:i.origin)??Di.USER}keys(e){e=this._normalizeOrigin(e);const i=[...this._values.keys()];return e==null?i:i.filter(r=>{var n;return((n=this._values.get(r))==null?void 0:n.origin)===e})}set(e,i,r){if((r=this._normalizeOrigin(r))===Di.DEFAULTS){const n=this._values.get(e);if((n==null?void 0:n.origin)!=null&&n.origin>r)return}this._values.set(e,new uYe(i,r))}delete(e,i){var r;(i=this._normalizeOrigin(i))!=null&&((r=this._values.get(e))==null?void 0:r.origin)!==i||this._values.delete(e)}has(e,i){var r;return(i=this._normalizeOrigin(i))!=null?((r=this._values.get(e))==null?void 0:r.origin)===i:this._values.has(e)}forEach(e){this._values.forEach(({value:i},r)=>e(i,r))}_normalizeOrigin(e){if(e!=null)return e===Di.DEFAULTS?e:Di.USER}},uYe=class{constructor(e,i){this.value=e,this.origin=i}};function tEe(t,e,i){e.keys().forEach(n=>{i.set(n,e.get(n),Di.DEFAULTS)});const r=t.metadatas;Object.keys(r).forEach(n=>{t.internalGet(n)&&i.set(n,t.internalGet(n),Di.DEFAULTS)})}function hYe(t,e,i){if(!(t!=null&&t.read)||t.read.enabled===!1||!t.read.source)return!1;const r=t.read.source;if(typeof r=="string"){if(r===e||r.includes(".")&&r.indexOf(e)===0&&nhe(r,i))return!0}else for(const n of r)if(n===e||n.includes(".")&&n.indexOf(e)===0&&nhe(n,i))return!0;return!1}function dYe(t){return t&&(!t.read||t.read.enabled!==!1&&!t.read.source)}function pYe(t,e,i,r,n){let s=lZ(e[i],n);dYe(s)&&(t[i]=!0);for(const o of Object.getOwnPropertyNames(e))s=lZ(e[o],n),hYe(s,i,r)&&(t[o]=!0)}function fYe(t,e,i,r){const n=i.metadatas,s=mHe(n[e],r),o=s==null?void 0:s.default;if(o===void 0)return;const l=typeof o=="function"?o.call(t,e,r):o;l!==void 0&&i.set(e,l)}const iEe={origin:"service"};function rEe(t,e,i=iEe){if(!e||typeof e!="object")return;const r=Zl(t),n=r.metadatas,s={};for(const o of Object.getOwnPropertyNames(e))pYe(s,n,o,e,i);r.setDefaultOrigin(i.origin);for(const o of Object.getOwnPropertyNames(s)){const l=lZ(n[o],i).read,c=l==null?void 0:l.source;let f;f=c&&typeof c=="string"?d9(e,c):e[o],l!=null&&l.reader&&(f=l.reader.call(t,f,e,i)),f!==void 0&&r.set(o,f)}if(!i||!i.ignoreDefaults){r.setDefaultOrigin("defaults");for(const o of Object.getOwnPropertyNames(n))s[o]||fYe(t,o,r,i)}r.setDefaultOrigin("user")}function nEe(t,e,i,r=iEe){var s;const n={...r,messages:[]};i(n),(s=n.messages)==null||s.forEach(o=>{o.type!=="warning"||t.loaded?r!=null&&r.messages&&r.messages.push(o):t.loadWarnings.push(o)})}function mYe(t,e,i,r,n){var o,l;const s={};return(l=(o=e.write)==null?void 0:o.writer)==null||l.call(t,r,s,i,n),s}function sEe(t,e,i,r,n,s){if(!(r!=null&&r.write))return!1;const o=au(t,i);if(!n&&r.write.overridePolicy){const l=r.write.overridePolicy.call(t,o,i,s??void 0);l!==void 0&&(n=l)}if(n||(n=r.write),!n||n.enabled===!1||n.layerContainerTypes&&(s!=null&&s.layerContainerType)&&!n.layerContainerTypes.includes(s.layerContainerType))return!1;if((o===null&&!n.allowNull&&!n.writerEnsuresNonNull||o===void 0)&&n.isRequired){const l=new se("web-document-write:property-required",`Missing value for required property '${i}' on '${t.declaredClass}'`,{propertyName:i,target:t});return l&&(s!=null&&s.messages)?s.messages.push(l):l&&!s&&Ce.getLogger("esri.core.accessorSupport.write").error(l.name,l.message),!1}return!(o===void 0||o===null&&!n.allowNull&&!n.writerEnsuresNonNull||!n.alwaysWriteDefaults&&(!e.store.multipleOriginsSupported||e.store.originOf(i)===Di.DEFAULTS)&&gYe(t,i,s,r,o)||!n.ignoreOrigin&&(s!=null&&s.origin)&&e.store.multipleOriginsSupported&&e.store.originOf(i)0&&(e=c7(e,_),(o=(s=i==null?void 0:i.resources)==null?void 0:s.pendingOperations)!=null&&o.length&&i.resources.pendingOperations.push(Promise.all(i.resources.pendingOperations).then(()=>c7(e,_,()=>"replace-arrays"))),i!=null&&i.writtenProperties&&i.writtenProperties.push({target:t,propName:l,oldOrigin:rGe(r.store.originOf(l)),newOrigin:i.origin}))}return e}const P_=t=>{let e=class extends t{constructor(...i){super(...i);const r=Zl(this),n=r.store,s=new cYe;r.store=s,tEe(r,n,s)}read(i,r){rEe(this,i,r)}write(i,r){return aEe(this,i??{},r)}toJSON(i){return this.write({},i)}static fromJSON(i,r){return yYe.call(this,i,r)}};return e=y([Z("esri.core.JSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function yYe(t,e){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const i=new this;return i.read(t,e),i}function sz(t){return t&&typeof t=="object"&&"toJSON"in t&&typeof t.toJSON=="function"}let Ue=class extends P_(ze){};Ue=y([Z("esri.core.JSONSupport")],Ue);const vYe=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,_Ye={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function ide(t){const e=t==null?void 0:t.match(vYe);if(!e)return null;const[,i,r,n]=e;if(!i)return null;let s=null,o=null,l=null;const{devext:c,qaext:f,www:_}=_Ye;if(r)if(s=i,n)switch(n.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:l}=c);break;case"qa":({customBaseUrl:o,portalHostname:l}=f);break;default:return null}else({customBaseUrl:o,portalHostname:l}=_);else switch(i.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:l}=c);break;case"qaext":({customBaseUrl:o,portalHostname:l}=f);break;case"www":({customBaseUrl:o,portalHostname:l}=_);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:l,urlKey:s}}function bYe(t){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(t)}function lEe(t){const e=atob(t),i=new Uint8Array(e.length);for(let r=0;rsu,GYt=()=>bne;function RYe(){const t=su.path,e=t.substring(0,t.lastIndexOf(t.split("/")[t.split("/").length-1]));return`${`${su.scheme}://${su.host}${su.port!=null?`:${su.port}`:""}`}${e}`}function qs(t){if(!t)return null;const e={path:null,query:null},i=new m2(t),r=t.indexOf("?");return i.query===null?e.path=t:(e.path=t.substring(0,r),e.query=xne(i.query)),i.fragment&&(e.hash=i.fragment,i.query===null&&(e.path=e.path.substring(0,e.path.length-(i.fragment.length+1)))),e}function xne(t){const e=t.split("&"),i={};for(const r of e){if(!r)continue;const n=r.indexOf("=");let s,o;n<0?(s=decodeURIComponent(r),o=""):(s=decodeURIComponent(r.slice(0,n)),o=decodeURIComponent(r.slice(n+1)));let l=i[s];typeof l=="string"&&(l=i[s]=[l]),Array.isArray(l)?l.push(o):i[s]=o}return i}function PT(t,e){return t?e&&typeof e=="function"?Object.keys(t).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(e(i,t[i]))).join("&"):Object.keys(t).map(i=>{const r=t[i];if(r==null)return"";const n=encodeURIComponent(i)+"=",s=e==null?void 0:e[i];return s?n+encodeURIComponent(s(r)):Array.isArray(r)?r.map(o=>sz(o)?n+encodeURIComponent(JSON.stringify(o)):n+encodeURIComponent(o)).join("&"):sz(r)?n+encodeURIComponent(JSON.stringify(r)):n+encodeURIComponent(r)}).filter(i=>i).join("&"):""}function IYe(t=!1){let e,i=iP.proxyUrl;if(typeof t=="string"){e=UYe(t);const r=nB(t);r&&(i=r.proxyUrl)}else e=!!t;if(!i)throw xYe.warn(rde),new se("urlutils:proxy-not-set",rde);return e&&_Z()&&(i=Mne(i)),qs(i)}function $Ye(t){const e=nB(t);let i,r;if(e){const n=Sne(e.proxyUrl);i=n.path,r=n.query?xne(n.query):null}if(i){const n=qs(t);t=i+"?"+n.path;const s=PT({...r,...n.query});s&&(t=`${t}?${s}`)}return t}const UP={path:"",query:""};function Sne(t){const e=t.indexOf("?");return e!==-1?(UP.path=t.slice(0,e),UP.query=t.slice(e+1)):(UP.path=t,UP.query=null),UP}function hEe(t){return t=(t=az(t=HYe(t=Sne(t).path),!0)).toLowerCase()}function LYe(t){const e={proxyUrl:t.proxyUrl,urlPrefix:hEe(t.urlPrefix)},i=iP.proxyRules,r=e.urlPrefix;let n=i.length;for(let s=0;s0?t.substring(0,e):t.replace(/\/+$/,"")}function pEe(t){const e=r=>r==null||r instanceof RegExp&&r.test(t)||typeof r=="string"&&t.startsWith(r),i=iP.interceptors;if(i){for(const r of i)if(Array.isArray(r.urls)){if(r.urls.some(e))return r}else if(e(r.urls))return r}return null}function UO(t,e,i=!1){if(!t||!e)return!1;const r=wZ(t),n=wZ(e);return!(!i&&r.scheme!==n.scheme)&&r.host!=null&&n.host!=null&&r.host.toLowerCase()===n.host.toLowerCase()&&r.port===n.port}function Tne(t){if(typeof t=="string"){if(!Zh(t))return!0;t=wZ(t)}if(UO(t,su))return!0;const e=iP.trustedServers||[];for(let i=0;i(A=x.indexOf(T,A))===-1?x.length:A;let c=l(n,"/",n.indexOf("//")+2),f=-1;for(;n.slice(0,c+1)===s.slice(0,c)+"/"&&(f=c+1,c!==n.length);)c=l(n,"/",c+1);if(f===-1||o&&f0)for(let x=0;x<_;x++)t=`../${t}`;else t=`./${t}`;return t}function Mf(t){return t=YYe(t=WYe(t=qYe(t=Gh(t=t.trim()))))}function s0(...t){const e=t.filter(ys);if(!(e!=null&&e.length))return;const i=[];if(Zh(e[0])){const n=e[0],s=n.indexOf("//");s!==-1&&(i.push(n.slice(0,s+1)),BYe(e[0])&&(i[0]+="/"),e[0]=n.slice(s+2))}else e[0][0]==="/"&&i.push("");const r=e.reduce((n,s)=>s?n.concat(s.split("/")):n,[]);for(let n=0;n0&&i[i.length-1]!==".."?i.pop():(!s&&n===r.length-1||s&&(s!=="."||i.length===0))&&i.push(s)}return i.join("/")}function Tm(t,e=!1){if(t==null||E2(t)||i1(t))return null;let i=t.indexOf("://");if(i===-1&&jy(t))i=2;else{if(i===-1)return null;i+=3}const r=t.indexOf("/",i);return r!==-1&&(t=t.slice(0,r)),e&&(t=az(t,!0)),t}function Zh(t){return jy(t)||Ane(t)}function E2(t){return t!=null&&t.slice(0,5)==="blob:"}function i1(t){return t!=null&&t.slice(0,5)==="data:"}function Cne(t){const e=C2(t);return e&&e.isBase64?lEe(e.data):null}function HYt(t){return wYe(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}const FYe=/^data:(.*?)(;base64)?,(.*)$/;function C2(t){const e=t.match(FYe);if(!e)return null;const[,i,r,n]=e;return{mediaType:i,isBase64:!!r,data:n}}function fEe(t){return t.isBase64?`data:${t.mediaType};base64,${t.data}`:`data:${t.mediaType},${t.data}`}async function kYe(t){return(await fetch(t)).blob()}function qYt(t){const e=Cne(t);if(!e)return null;const i=C2(t);return new Blob([e],{type:i.mediaType})}function WYt(t,e){zYe(t,e)}function zYe(t,e){if(!t)return!1;const i=document.createElement("a");if(!("download"in i))return!1;const r=URL.createObjectURL(t);return i.download=e,i.href=r,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r),!0}function jy(t){return t!=null&&t[0]==="/"&&t[1]==="/"}function Ane(t){return t!=null&&cEe.test(t)}function UYe(t){return t!=null&&SYe.test(t)||su.scheme==="https"&&jy(t)}function VYe(t){return t!=null&&uEe.test(t)||su.scheme==="http"&&jy(t)}function BYe(t){return t!=null&&TYe.test(t)}function Mne(t){return jy(t)?`https:${t}`:t.replace(uEe,"https:")}function jYe(){return su.scheme==="http"}function _Z(){return su.scheme==="https"}function az(t,e=!1){return jy(t)?t.slice(2):(t=t.replace(cEe,""),e&&t.length>1&&t[0]==="/"&&t[1]==="/"&&(t=t.slice(2)),t)}function GYe(t){const e=t.indexOf("//"),i=t.indexOf("/",e+2);return i===-1?t:t.slice(0,i)}function One(t){let e=0;if(Zh(t)){const r=t.indexOf("//");r!==-1&&(e=r+2)}const i=t.lastIndexOf("/");return ir===n||r.endsWith(`.${n}`))||_Z()&&!nB(t))&&(t=Mne(t)),t}function bZ(t,e,i){if(!(e&&i&&t&&Zh(t)))return t;const r=t.indexOf("//"),n=t.indexOf("/",r+2),s=t.indexOf(":",r+2),o=Math.min(n<0?t.length:n,s<0?t.length:s);return t.slice(r+2,o).toLowerCase()!==e.toLowerCase()?t:`${t.slice(0,r+2)}${i}${t.slice(o)}`}function wZ(t){return typeof t=="string"?new m2(Gh(t)):(t.scheme||(t.scheme=su.scheme),t)}function gEe(t){return XYe.test(t)}function yEe(t,e){const i=qs(t),r=Object.keys(i.query||{});return r.length>0&&e&&e.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${r.join(", ")}.`),i.path}function Pne(t,e,i){const r=qs(t),n=r.query||{};return n[e]=String(i),`${r.path}?${PT(n)}`}function tO(t,e){if(!e)return t;const i=qs(t),r=i.query||{};for(const[s,o]of Object.entries(e))o!=null&&(r[s]=o);const n=PT(r);return n?`${i.path}?${n}`:i.path}function Rne(t){if(t==null)return null;const e=t.match(vEe);return e?e[2]:null}function nde(t){if(t==null)return null;const e=t.match(vEe);return e?{path:e[1],extension:e[2]}:{path:t,extension:null}}async function XYt(t){return typeof t=="string"?C2(t)??{data:t}:new Promise((e,i)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>e(C2(r.result)),r.onerror=n=>i(n)})}const vEe=/([^.]*)\.([^\/]*)$/,XYe=/(^data:image\/svg|\.svg$)/i,_Ee="20231115",bEe="a6fcf2901ef678ef17a528e11b93ffe09e3ec267";Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));const wEe="4.28";let yr,Ine=wEe;Ine="4.28.10";function ZYt(t){yr=t}function ZYe(t){const e=yr==null?void 0:yr.findCredential(t);return e!=null&&e.token?Pne(t,"token",e.token):t}Le("host-webworker");const JYe=new Set(["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"]);function $ne(t){const e=Tm(t,!0);return!!e&&e.endsWith(".arcgis.com")&&!JYe.has(e)&&!t.endsWith("/sharing/rest/generateToken")}function xEe(t,e,i=!1,r){return new Promise((n,s)=>{if(xo(r))return void s(sde());let o=()=>{f(),s(new Error(`Unable to load ${e}`))},l=()=>{const _=t;f(),n(_)},c=()=>{if(!t)return;const _=t;f(),_.src="",s(sde())};const f=()=>{Le("esri-image-decode")||(t.removeEventListener("error",o),t.removeEventListener("load",l)),o=null,l=null,t=null,r!=null&&r.removeEventListener("abort",c),c=null,i&&URL.revokeObjectURL(e)};r!=null&&r.addEventListener("abort",c),Le("esri-image-decode")?t.decode().then(l,o):(t.addEventListener("error",o),t.addEventListener("load",l))})}function sde(){try{return new DOMException("Aborted","AbortError")}catch{const t=new Error;return t.name="AbortError",t}}const SEe="Timeout exceeded";function KYe(){return new Error(SEe)}function JYt(t){return typeof t=="object"&&!!t&&"message"in t&&t.message===SEe}function QYe(t){Ar.request.crossOriginNoCorsDomains||(Ar.request.crossOriginNoCorsDomains={});const e=Ar.request.crossOriginNoCorsDomains;for(let i of t)i=i.toLowerCase(),/^https?:\/\//.test(i)?e[Tm(i)??""]=0:(e[Tm("http://"+i)??""]=0,e[Tm("https://"+i)??""]=0)}function eXe(t){const e=Ar.request.crossOriginNoCorsDomains;if(e){let i=Tm(t);if(i)return i=i.toLowerCase(),!UO(i,wne())&&e[i]o.abort());const l={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:s,params:n,redoRequest:!1,useIdentity:im.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},c=await hXe(l);return(f=s==null?void 0:s.after)==null||f.call(s,c),c}let lz;const im=Ar.request,TEe="FormData"in globalThis,iXe=new Set([499,498,403,401]),rXe=new Set(["COM_0056","COM_0057","SB_0008"]),nXe=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],Lne=()=>null,cz=Symbol();function sXe(t){const e=Tm(t);e&&!bi._corsServers.includes(e)&&bi._corsServers.push(e)}function ode(t){const e=Tm(t);return!e||e.endsWith(".arcgis.com")||bi._corsServers.includes(e)||Tne(e)}function xy(t,e,i,r){let n="Error";const s={url:i.url,requestOptions:i.requestOptions,getHeader:Lne,ssl:!1};if(e instanceof se)return e.details?(e.details=Re(e.details),e.details.url=i.url,e.details.requestOptions=i.requestOptions):e.details=s,e;if(e){const o=r&&(f=>r.headers.get(f)),l=r==null?void 0:r.status,c=e.message;c&&(n=c),o&&(s.getHeader=o),s.httpStatus=(e.httpCode!=null?e.httpCode:e.code)||l||0,s.subCode=e.subcode,s.messageCode=e.messageCode,typeof e.details=="string"?s.messages=[e.details]:s.messages=e.details,s.raw=cz in e?e[cz]:e}return sn(e)?ur():new se(t,n,s)}async function oXe(){Le("host-webworker")?lz||(lz=await we(()=>import("./request-VBZq5-ns.js"),__vite__mapDeps([]))):bi._abortableFetch||(bi._abortableFetch=globalThis.fetch.bind(globalThis))}async function xZ(){yr||await we(()=>import("./IdentityManager-DTERQ1-w.js"),__vite__mapDeps([]))}async function aXe(t){var l;const e=t.params.url,i=t.params.requestOptions,r=t.controller.signal,n=i.body;let s=null,o=null;if(TEe&&"HTMLFormElement"in globalThis&&(n instanceof FormData?s=n:n instanceof HTMLFormElement&&(s=new FormData(n))),typeof n=="string"&&(o=n),t.fetchOptions={cache:i.cacheBust&&!("polyfill"in bi._abortableFetch)?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:im.priority,redirect:"follow",signal:r},(s||o)&&(t.fetchOptions.body=s||o),i.authMode==="anonymous"&&(t.useIdentity=!1),t.hasToken=!!(/token=/i.test(e)||(l=i.query)!=null&&l.token||s!=null&&s.get("token")),!t.hasToken&&Ar.apiKey&&$ne(e)&&(i.query||(i.query={}),i.query.token=Ar.apiKey,t.hasToken=!0),t.useIdentity&&!t.hasToken&&!t.credentialToken&&!EEe(e)&&!xo(r)){let c;i.authMode==="immediate"?(await xZ(),c=await yr.getCredential(e,{signal:r}),t.credential=c):i.authMode==="no-prompt"?(await xZ(),c=await yr.getCredential(e,{prompt:!1,signal:r}).catch(()=>{}),t.credential=c):yr&&(c=yr.findCredential(e)),c&&(t.credentialToken=c.token,t.useSSL=!!c.ssl)}}function EEe(t){return nXe.some(e=>e.test(t))}async function lXe(t){let e=t.params.url;const i=t.params.requestOptions,r=t.fetchOptions??{},n=E2(e)||i1(e),s=i.responseType||"json",o=n?0:i.timeout!=null?i.timeout:im.timeout;let l=!1;if(!n){t.useSSL&&(e=Mne(e)),i.cacheBust&&r.cache==="default"&&(e=Pne(e,"request.preventCache",Date.now()));let T={...i.query};t.credentialToken&&(T.token=t.credentialToken);let A=PT(T);Le("esri-url-encodes-apostrophe")&&(A=A.replaceAll("'","%27"));const M=e.length+1+A.length;let I;l=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||M>im.maxUrlLength;const L=i.useProxy||!!nB(e);if(L){const F=IYe(e);I=F.path,!l&&I.length+1+M>im.maxUrlLength&&(l=!0),F.query&&(T={...F.query,...T})}if(r.method==="HEAD"&&(l||L)){if(l)throw M>im.maxUrlLength?xy("request:invalid-parameters",new Error("URL exceeds maximum length"),t.params):xy("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),t.params);if(L)throw xy("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),t.params)}if(l?(r.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?e=tO(e,T):(r.body=PT(T),r.headers||(r.headers={}),r.headers["Content-Type"]="application/x-www-form-urlencoded")):e=tO(e,T),L&&(t.useProxy=!0,e=`${I}?${e}`),T.token&&TEe&&r.body instanceof FormData&&!bYe(e)&&r.body.set("token",T.token),i.hasOwnProperty("withCredentials"))t.withCredentials=i.withCredentials;else if(!UO(e,wne())){if(Tne(e))t.withCredentials=!0;else if(yr){const F=yr.findServerInfo(e);F!=null&&F.webTierAuth&&(t.withCredentials=!0)}}t.withCredentials&&(r.credentials="include",eXe(e)&&await tXe(l?tO(e,T):e))}let c,f,_=0,x=!1;o>0&&(_=setTimeout(()=>{x=!0,t.controller.abort()},o));try{if(i.responseType==="native-request-init")f=r,f.url=e;else if(i.responseType!=="image"||r.cache!=="default"||r.method!=="GET"||l||uXe(i.headers)||!n&&!t.useProxy&&im.proxyUrl&&!ode(e)){if(c=await bi._abortableFetch(e,r),t.useProxy||sXe(e),i.responseType==="native")f=c;else if(r.method!=="HEAD")if(c.ok){switch(s){case"array-buffer":f=await c.arrayBuffer();break;case"blob":case"image":f=await c.blob();break;default:f=await c.text()}if(_&&(clearTimeout(_),_=0),s==="json"||s==="xml"||s==="document")if(f)switch(s){case"json":f=JSON.parse(f);break;case"xml":f=ade(f,"application/xml");break;case"document":f=ade(f,"text/html")}else f=null;if(f){if(s==="array-buffer"||s==="blob"){const T=c.headers.get("Content-Type");if(T&&/application\/json|text\/plain/i.test(T)&&f[s==="blob"?"size":"byteLength"]<=750)try{const A=await new Response(f).json();A.error&&(f=A)}catch{}}s==="image"&&f instanceof Blob&&(f=await lde(URL.createObjectURL(f),t,!0))}}else{f=await c.text();try{f=JSON.parse(f)}catch{}}}else f=await lde(e,t)}catch(T){if(T.name==="AbortError")throw x?KYe():ur("Request canceled");if(!(!c&&T instanceof TypeError&&im.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||t.useProxy||ode(e))throw T;t.redoRequest=!0,LYe({proxyUrl:im.proxyUrl,urlPrefix:Tm(e)??""})}finally{_&&clearTimeout(_)}return[c,f]}async function cXe(t,e){if(t.responseData!=null)return t.responseData;if(t.headers&&(e.requestOptions.headers={...e.requestOptions.headers,...t.headers}),t.query&&(e.requestOptions.query={...e.requestOptions.query,...t.query}),t.before){let i,r;try{r=await t.before(e)}catch(n){i=xy("request:interceptor",n,e)}if((r instanceof Error||r instanceof se)&&(i=xy("request:interceptor",r,e)),i)throw t.error&&t.error(i),i;return r}}function uXe(t){if(t){for(const e of Object.getOwnPropertyNames(t))if(t[e])return!0}return!1}function ade(t,e){let i;try{i=new DOMParser().parseFromString(t,e)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function hXe(t){var s,o;let e,i;await aXe(t);try{do[e,i]=await lXe(t);while(!await dXe(t,e,i))}catch(l){const c=xy("request:server",l,t.params,e);throw c.details.ssl=t.useSSL,(s=t.interceptor)!=null&&s.error&&t.interceptor.error(c),c}const r=t.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(r)){if(!t.hasToken&&!t.credentialToken&&((o=i.user)!=null&&o.username)&&!Tne(r)){const l=Tm(r,!0);l&&im.trustedServers.push(l)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&QYe(i.authorizedCrossOriginNoCorsDomains)}const n=t.credential;if(n&&yr){const l=yr.findServerInfo(n.server);let c=l==null?void 0:l.owningSystemUrl;if(c){c=c.replace(/\/?$/,"/sharing");const f=yr.findCredential(c,n.userId);f&&yr._getIdenticalSvcIdx(c,f)===-1&&f.resources.unshift(c)}}return{data:i,getHeader:e?l=>e==null?void 0:e.headers.get(l):Lne,httpStatus:(e==null?void 0:e.status)??200,requestOptions:t.params.requestOptions,ssl:t.useSSL,url:t.params.url}}async function dXe(t,e,i){var f;if(t.redoRequest)return t.redoRequest=!1,!1;const r=t.params.requestOptions;if(!e||r.responseType==="native"||r.responseType==="native-request-init")return!0;let n,s;if(i&&(i.error?n=i.error:i.status==="error"&&Array.isArray(i.messages)&&(n={...i},n[cz]=i,n.details=i.messages)),!n&&!e.ok)throw n=new Error(`Unable to load ${e.url} status: ${e.status}`),n[cz]=i,n;let o,l=null;n&&(s=Number(n.code),l=n.hasOwnProperty("subcode")?Number(n.subcode):null,o=n.messageCode,o=o==null?void 0:o.toUpperCase());const c=r.authMode;if(s===403&&(l===4||(f=n.message)!=null&&f.toLowerCase().includes("ssl")&&!n.message.toLowerCase().includes("permission"))){if(!t.useSSL)return t.useSSL=!0,!1}else if(!t.hasToken&&t.useIdentity&&(c!=="no-prompt"||s===498)&&s!==void 0&&iXe.has(s)&&!EEe(t.params.url)&&(s!==403||(!o||!rXe.has(o))&&(l==null||l===2&&t.credentialToken))){await xZ();try{const _=await yr.getCredential(t.params.url,{error:xy("request:server",n,t.params),prompt:c!=="no-prompt",signal:t.controller.signal,token:t.credentialToken});return t.credential=_,t.credentialToken=_.token,t.useSSL=t.useSSL||_.ssl,!1}catch(_){if(c==="no-prompt")return t.credential=void 0,t.credentialToken=void 0,!1;n=_}}if(n)throw n;return!0}function lde(t,e,i=!1){const r=e.controller.signal,n=new Image;return e.withCredentials?n.crossOrigin="use-credentials":n.crossOrigin="anonymous",n.alt="",n.fetchPriority=im.priority,n.src=t,xEe(n,t,i,r)}bi._abortableFetch=null,bi._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];async function pXe(t,e,i,r){const n=e.exec(i);if(!n)throw new se("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${e}"`);const s=n[1]?`${n[1]}/`:"",o=n[2],l=oYe(r),c=`${s}${o}.json`,f=l?`${s}${o}_${l}.json`:c;let _;try{_=await cde(t(f))}catch(x){if(f===c)throw new se("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:x});try{_=await cde(t(c))}catch(T){throw new se("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:T})}}return _}async function cde(t){if(ude.fetchBundleAsset!=null)return ude.fetchBundleAsset(t);const e=await bi(t,{responseType:"text"});return JSON.parse(e.data)}let fXe=class{constructor({base:e="",pattern:i,location:r=new URL(window.location.href)}){let n;n=typeof r=="string"?s=>new URL(s,new URL(r,window.location.href)).href:r instanceof URL?s=>new URL(s,r).href:r,this.pattern=typeof i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=n,e=e?e.endsWith("/")?e:e+"/":"",this.matcher=new RegExp(`^${e}(?:(.*)/)?(.*)$`)}fetchMessageBundle(e,i){return pXe(this.getAssetUrl,this.matcher,e,i)}};function mXe(t){return new fXe(t)}const ude={},gXe=Ce.getLogger("esri.assets");function yXe(t,e){return bi(Wr(t),e)}function Wr(t){if(!Ar.assetsPath)throw gXe.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new se("assets:path-not-set","config.assetsPath is not set");return s0(Ar.assetsPath,t)}sYe(mXe({pattern:"esri/",location:Wr}));function x9(t){return typeof t=="string"?document.getElementById(t):t??null}function CEe(t){for(;t.hasChildNodes();)t.removeChild(t.firstChild)}function hde(t,e){const i=e.parentNode;i&&i.insertBefore(t,e)}function dde(t,e){for(;;){const i=t.firstChild;if(!i)break;e.appendChild(i)}}function vXe(t){t.parentNode&&t.parentNode.removeChild(t)}var Rw;(function(t){t[t.PENDING=0]="PENDING",t[t.RESOLVED=1]="RESOLVED",t[t.REJECTED=2]="REJECTED"})(Rw||(Rw={}));let _Xe=class{constructor(){this._resolver=Jl(),this._status=Rw.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=Rw.RESOLVED,this._cleanUp()},()=>{this._status=Rw.REJECTED,this._cleanUp()}),this.promise=this._resolver.promise}destroy(){this._cleanUp()}addResolvingPromise(e){this._resolvingPromises.push(e),this._tryResolve()}isResolved(){return this._status===Rw.RESOLVED}isRejected(){return this._status===Rw.REJECTED}isFulfilled(){return this._status!==Rw.PENDING}abort(){this._resolver.reject(ur())}_cleanUp(){this._allPromise=null,this._resolvingPromises=null}_tryResolve(){if(this.isFulfilled())return;const e=Jl(),i=[...this._resolvingPromises,e.promise],r=this._allPromise=Promise.all(i);r.then(()=>{this.isFulfilled()||this._allPromise!==r||this._resolver.resolve()},n=>{this.isFulfilled()||this._allPromise!==r||sn(n)||this._resolver.reject(n)}),e.resolve()}};const S9=t=>{let e=class extends t{constructor(...i){super(...i),this._promiseProps=new _Xe,this.addResolvingPromise(Promise.resolve())}destroy(){this._promiseProps.destroy()}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(i,r){return this._promiseProps.promise.then(()=>this).then(i,r)}catch(i){return this.when(null,i)}addResolvingPromise(i){i&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in i?i.when():i)}};return e=y([Z("esri.core.Promise")],e),e};let uz=class extends S9(ze){};uz=y([Z("esri.core.Promise")],uz);const bXe="randomUUID"in crypto;function Vf(){if(bXe)return crypto.randomUUID();const t=crypto.getRandomValues(new Uint16Array(8));t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const e=i=>t[i].toString(16).padStart(4,"0");return e(0)+e(1)+"-"+e(2)+"-"+e(3)+"-"+e(4)+"-"+e(5)+e(6)+e(7)}function tXt(){return`{${Vf().toUpperCase()}}`}function wXe(){return`{${Vf()}}`}const xXe=Object.prototype.toString;function SXe(t){const e="__accessorMetadata__"in t?$s(t):t;return function(...i){if(i.push(e),typeof i[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return TXe.apply(this,i)}}function TXe(t,e,i,r){f9(t,e).cast=r}function EXe(t){return(e,i)=>{f9(e,t).cast=e[i]}}function Ci(...t){if(t.length!==3||typeof t[1]!="string")return t.length===1&&xXe.call(t[0])==="[object Function]"?SXe(t[0]):t.length===1&&typeof t[0]=="string"?EXe(t[0]):void 0}/*! + * @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time) + * Copyright (c) 2022 - Environmental Systems Research Institute, Inc. + * Apache-2.0 + * + * js-xss + * Copyright (c) 2012-2018 Zongmin Lei(雷宗民) + * http://ucdok.com + * MIT License, see https://github.com/leizongmin/js-xss/blob/master/LICENSE for details + */var CXe=function(t){if(typeof t!="object"||t===null||Object.prototype.toString.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e},xS={exports:{}},ea={},nL={exports:{}},cE={};function AEe(){var t={};return t["align-content"]=!1,t["align-items"]=!1,t["align-self"]=!1,t["alignment-adjust"]=!1,t["alignment-baseline"]=!1,t.all=!1,t["anchor-point"]=!1,t.animation=!1,t["animation-delay"]=!1,t["animation-direction"]=!1,t["animation-duration"]=!1,t["animation-fill-mode"]=!1,t["animation-iteration-count"]=!1,t["animation-name"]=!1,t["animation-play-state"]=!1,t["animation-timing-function"]=!1,t.azimuth=!1,t["backface-visibility"]=!1,t.background=!0,t["background-attachment"]=!0,t["background-clip"]=!0,t["background-color"]=!0,t["background-image"]=!0,t["background-origin"]=!0,t["background-position"]=!0,t["background-repeat"]=!0,t["background-size"]=!0,t["baseline-shift"]=!1,t.binding=!1,t.bleed=!1,t["bookmark-label"]=!1,t["bookmark-level"]=!1,t["bookmark-state"]=!1,t.border=!0,t["border-bottom"]=!0,t["border-bottom-color"]=!0,t["border-bottom-left-radius"]=!0,t["border-bottom-right-radius"]=!0,t["border-bottom-style"]=!0,t["border-bottom-width"]=!0,t["border-collapse"]=!0,t["border-color"]=!0,t["border-image"]=!0,t["border-image-outset"]=!0,t["border-image-repeat"]=!0,t["border-image-slice"]=!0,t["border-image-source"]=!0,t["border-image-width"]=!0,t["border-left"]=!0,t["border-left-color"]=!0,t["border-left-style"]=!0,t["border-left-width"]=!0,t["border-radius"]=!0,t["border-right"]=!0,t["border-right-color"]=!0,t["border-right-style"]=!0,t["border-right-width"]=!0,t["border-spacing"]=!0,t["border-style"]=!0,t["border-top"]=!0,t["border-top-color"]=!0,t["border-top-left-radius"]=!0,t["border-top-right-radius"]=!0,t["border-top-style"]=!0,t["border-top-width"]=!0,t["border-width"]=!0,t.bottom=!1,t["box-decoration-break"]=!0,t["box-shadow"]=!0,t["box-sizing"]=!0,t["box-snap"]=!0,t["box-suppress"]=!0,t["break-after"]=!0,t["break-before"]=!0,t["break-inside"]=!0,t["caption-side"]=!1,t.chains=!1,t.clear=!0,t.clip=!1,t["clip-path"]=!1,t["clip-rule"]=!1,t.color=!0,t["color-interpolation-filters"]=!0,t["column-count"]=!1,t["column-fill"]=!1,t["column-gap"]=!1,t["column-rule"]=!1,t["column-rule-color"]=!1,t["column-rule-style"]=!1,t["column-rule-width"]=!1,t["column-span"]=!1,t["column-width"]=!1,t.columns=!1,t.contain=!1,t.content=!1,t["counter-increment"]=!1,t["counter-reset"]=!1,t["counter-set"]=!1,t.crop=!1,t.cue=!1,t["cue-after"]=!1,t["cue-before"]=!1,t.cursor=!1,t.direction=!1,t.display=!0,t["display-inside"]=!0,t["display-list"]=!0,t["display-outside"]=!0,t["dominant-baseline"]=!1,t.elevation=!1,t["empty-cells"]=!1,t.filter=!1,t.flex=!1,t["flex-basis"]=!1,t["flex-direction"]=!1,t["flex-flow"]=!1,t["flex-grow"]=!1,t["flex-shrink"]=!1,t["flex-wrap"]=!1,t.float=!1,t["float-offset"]=!1,t["flood-color"]=!1,t["flood-opacity"]=!1,t["flow-from"]=!1,t["flow-into"]=!1,t.font=!0,t["font-family"]=!0,t["font-feature-settings"]=!0,t["font-kerning"]=!0,t["font-language-override"]=!0,t["font-size"]=!0,t["font-size-adjust"]=!0,t["font-stretch"]=!0,t["font-style"]=!0,t["font-synthesis"]=!0,t["font-variant"]=!0,t["font-variant-alternates"]=!0,t["font-variant-caps"]=!0,t["font-variant-east-asian"]=!0,t["font-variant-ligatures"]=!0,t["font-variant-numeric"]=!0,t["font-variant-position"]=!0,t["font-weight"]=!0,t.grid=!1,t["grid-area"]=!1,t["grid-auto-columns"]=!1,t["grid-auto-flow"]=!1,t["grid-auto-rows"]=!1,t["grid-column"]=!1,t["grid-column-end"]=!1,t["grid-column-start"]=!1,t["grid-row"]=!1,t["grid-row-end"]=!1,t["grid-row-start"]=!1,t["grid-template"]=!1,t["grid-template-areas"]=!1,t["grid-template-columns"]=!1,t["grid-template-rows"]=!1,t["hanging-punctuation"]=!1,t.height=!0,t.hyphens=!1,t.icon=!1,t["image-orientation"]=!1,t["image-resolution"]=!1,t["ime-mode"]=!1,t["initial-letters"]=!1,t["inline-box-align"]=!1,t["justify-content"]=!1,t["justify-items"]=!1,t["justify-self"]=!1,t.left=!1,t["letter-spacing"]=!0,t["lighting-color"]=!0,t["line-box-contain"]=!1,t["line-break"]=!1,t["line-grid"]=!1,t["line-height"]=!1,t["line-snap"]=!1,t["line-stacking"]=!1,t["line-stacking-ruby"]=!1,t["line-stacking-shift"]=!1,t["line-stacking-strategy"]=!1,t["list-style"]=!0,t["list-style-image"]=!0,t["list-style-position"]=!0,t["list-style-type"]=!0,t.margin=!0,t["margin-bottom"]=!0,t["margin-left"]=!0,t["margin-right"]=!0,t["margin-top"]=!0,t["marker-offset"]=!1,t["marker-side"]=!1,t.marks=!1,t.mask=!1,t["mask-box"]=!1,t["mask-box-outset"]=!1,t["mask-box-repeat"]=!1,t["mask-box-slice"]=!1,t["mask-box-source"]=!1,t["mask-box-width"]=!1,t["mask-clip"]=!1,t["mask-image"]=!1,t["mask-origin"]=!1,t["mask-position"]=!1,t["mask-repeat"]=!1,t["mask-size"]=!1,t["mask-source-type"]=!1,t["mask-type"]=!1,t["max-height"]=!0,t["max-lines"]=!1,t["max-width"]=!0,t["min-height"]=!0,t["min-width"]=!0,t["move-to"]=!1,t["nav-down"]=!1,t["nav-index"]=!1,t["nav-left"]=!1,t["nav-right"]=!1,t["nav-up"]=!1,t["object-fit"]=!1,t["object-position"]=!1,t.opacity=!1,t.order=!1,t.orphans=!1,t.outline=!1,t["outline-color"]=!1,t["outline-offset"]=!1,t["outline-style"]=!1,t["outline-width"]=!1,t.overflow=!1,t["overflow-wrap"]=!1,t["overflow-x"]=!1,t["overflow-y"]=!1,t.padding=!0,t["padding-bottom"]=!0,t["padding-left"]=!0,t["padding-right"]=!0,t["padding-top"]=!0,t.page=!1,t["page-break-after"]=!1,t["page-break-before"]=!1,t["page-break-inside"]=!1,t["page-policy"]=!1,t.pause=!1,t["pause-after"]=!1,t["pause-before"]=!1,t.perspective=!1,t["perspective-origin"]=!1,t.pitch=!1,t["pitch-range"]=!1,t["play-during"]=!1,t.position=!1,t["presentation-level"]=!1,t.quotes=!1,t["region-fragment"]=!1,t.resize=!1,t.rest=!1,t["rest-after"]=!1,t["rest-before"]=!1,t.richness=!1,t.right=!1,t.rotation=!1,t["rotation-point"]=!1,t["ruby-align"]=!1,t["ruby-merge"]=!1,t["ruby-position"]=!1,t["shape-image-threshold"]=!1,t["shape-outside"]=!1,t["shape-margin"]=!1,t.size=!1,t.speak=!1,t["speak-as"]=!1,t["speak-header"]=!1,t["speak-numeral"]=!1,t["speak-punctuation"]=!1,t["speech-rate"]=!1,t.stress=!1,t["string-set"]=!1,t["tab-size"]=!1,t["table-layout"]=!1,t["text-align"]=!0,t["text-align-last"]=!0,t["text-combine-upright"]=!0,t["text-decoration"]=!0,t["text-decoration-color"]=!0,t["text-decoration-line"]=!0,t["text-decoration-skip"]=!0,t["text-decoration-style"]=!0,t["text-emphasis"]=!0,t["text-emphasis-color"]=!0,t["text-emphasis-position"]=!0,t["text-emphasis-style"]=!0,t["text-height"]=!0,t["text-indent"]=!0,t["text-justify"]=!0,t["text-orientation"]=!0,t["text-overflow"]=!0,t["text-shadow"]=!0,t["text-space-collapse"]=!0,t["text-transform"]=!0,t["text-underline-position"]=!0,t["text-wrap"]=!0,t.top=!1,t.transform=!1,t["transform-origin"]=!1,t["transform-style"]=!1,t.transition=!1,t["transition-delay"]=!1,t["transition-duration"]=!1,t["transition-property"]=!1,t["transition-timing-function"]=!1,t["unicode-bidi"]=!1,t["vertical-align"]=!1,t.visibility=!1,t["voice-balance"]=!1,t["voice-duration"]=!1,t["voice-family"]=!1,t["voice-pitch"]=!1,t["voice-range"]=!1,t["voice-rate"]=!1,t["voice-stress"]=!1,t["voice-volume"]=!1,t.volume=!1,t["white-space"]=!1,t.widows=!1,t.width=!0,t["will-change"]=!1,t["word-break"]=!0,t["word-spacing"]=!0,t["word-wrap"]=!0,t["wrap-flow"]=!1,t["wrap-through"]=!1,t["writing-mode"]=!1,t["z-index"]=!1,t}function AXe(t,e,i){}function MXe(t,e,i){}var OXe=/javascript\s*\:/img;function PXe(t,e){return OXe.test(e)?"":e}cE.whiteList=AEe();cE.getDefaultWhiteList=AEe;cE.onAttr=AXe;cE.onIgnoreAttr=MXe;cE.safeAttrValue=PXe;var RXe={indexOf:function(t,e){var i,r;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,r=t.length;i/g,qXe=/"/g,WXe=/"/g,YXe=/&#([a-zA-Z0-9]*);?/gim,XXe=/:?/gim,ZXe=/&newline;?/gim,D6=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,fde=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,mde=/u\s*r\s*l\s*\(.*/gi;function IEe(t){return t.replace(qXe,""")}function $Ee(t){return t.replace(WXe,'"')}function LEe(t){return t.replace(YXe,function(i,r){return r[0]==="x"||r[0]==="X"?String.fromCharCode(parseInt(r.substr(1),16)):String.fromCharCode(parseInt(r,10))})}function DEe(t){return t.replace(XXe,":").replace(ZXe," ")}function NEe(t){for(var e="",i=0,r=t.length;i",r);if(n===-1)break;i=n+3}return e}function eZe(t){var e=t.split("");return e=e.filter(function(i){var r=i.charCodeAt(0);return r===127?!1:r<=31?r===10||r===13:!0}),e.join("")}ea.whiteList=OEe();ea.getDefaultWhiteList=OEe;ea.onTag=zXe;ea.onIgnoreTag=UXe;ea.onTagAttr=VXe;ea.onIgnoreTagAttr=BXe;ea.safeAttrValue=jXe;ea.escapeHtml=REe;ea.escapeQuote=IEe;ea.unescapeQuote=$Ee;ea.escapeHtmlEntities=LEe;ea.escapeDangerHtml5Entities=DEe;ea.clearNonPrintableCharacter=NEe;ea.friendlyAttrValue=FEe;ea.escapeAttrValue=kEe;ea.onIgnoreTagStripAll=JXe;ea.StripTagBody=KXe;ea.stripCommentTag=QXe;ea.stripBlankChar=eZe;ea.cssFilter=PEe;ea.getDefaultCSSWhiteList=kXe;var sB={},Iw=Dne;function tZe(t){var e=Iw.spaceIndex(t),i;return e===-1?i=t.slice(1,-1):i=t.slice(1,e+1),i=Iw.trim(i).toLowerCase(),i.slice(0,1)==="/"&&(i=i.slice(1)),i.slice(-1)==="/"&&(i=i.slice(0,-1)),i}function iZe(t){return t.slice(0,2)===""){r+=i(t.slice(n,s)),_=t.slice(s,l+1),f=tZe(_),r+=e(s,r.length,f,_,iZe(_)),n=l+1,s=!1;continue}if(x==='"'||x==="'")for(var T=1,A=t.charAt(l-T);A.trim()===""||A==="=";){if(A==="="){o=x;continue e}A=t.charAt(l-++T)}}else if(x===o){o=!1;continue}}return n0;e--){var i=t[e];if(i!==" ")return i==="="?e:-1}}function cZe(t){return t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'"}function gde(t){return cZe(t)?t.substr(1,t.length-2):t}sB.parseTag=rZe;sB.parseAttr=sZe;var uZe=nL.exports.FilterCSS,em=ea,zEe=sB,hZe=zEe.parseTag,dZe=zEe.parseAttr,_7=Dne;function N6(t){return t==null}function pZe(t){var e=_7.spaceIndex(t);if(e===-1)return{html:"",closing:t[t.length-2]==="/"};t=_7.trim(t.slice(e+1,-1));var i=t[t.length-1]==="/";return i&&(t=_7.trim(t.slice(0,-1))),{html:t,closing:i}}function fZe(t){var e={};for(var i in t)e[i]=t[i];return e}function mZe(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map(function(r){return r.toLowerCase()}):e[i.toLowerCase()]=t[i];return e}function UEe(t){t=fZe(t||{}),t.stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=em.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=mZe(t.whiteList||t.allowList):t.whiteList=em.whiteList,t.onTag=t.onTag||em.onTag,t.onTagAttr=t.onTagAttr||em.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||em.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||em.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||em.safeAttrValue,t.escapeHtml=t.escapeHtml||em.escapeHtml,this.options=t,t.css===!1?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new uZe(t.css))}UEe.prototype.process=function(t){if(t=t||"",t=t.toString(),!t)return"";var e=this,i=e.options,r=i.whiteList,n=i.onTag,s=i.onIgnoreTag,o=i.onTagAttr,l=i.onIgnoreTagAttr,c=i.safeAttrValue,f=i.escapeHtml,_=e.cssFilter;i.stripBlankChar&&(t=em.stripBlankChar(t)),i.allowCommentTag||(t=em.stripCommentTag(t));var x=!1;i.stripIgnoreTagBody&&(x=em.StripTagBody(i.stripIgnoreTagBody,s),s=x.onIgnoreTag);var T=hZe(t,function(A,M,I,L,F){var z={sourcePosition:A,position:M,isClosing:F,isWhite:Object.prototype.hasOwnProperty.call(r,I)},k=n(I,L,z);if(!N6(k))return k;if(z.isWhite){if(z.isClosing)return"";var U=pZe(L),j=r[I],H=dZe(U.html,function(Y,Q){var ne=_7.indexOf(j,Y)!==-1,re=o(I,Y,Q,ne);return N6(re)?ne?(Q=c(I,Y,Q,_),Q?Y+'="'+Q+'"':Y):(re=l(I,Y,Q,ne),N6(re)?void 0:re):re});return L="<"+I,H&&(L+=" "+H),U.closing&&(L+=" /"),L+=">",L}else return k=s(I,L,z),N6(k)?f(L):k},f);return x&&(T=x.remove(T)),T};var gZe=UEe;(function(t,e){var i=ea,r=sB,n=gZe;function s(l,c){var f=new n(c);return f.process(l)}e=t.exports=s,e.filterXSS=s,e.FilterXSS=n,function(){for(var l in i)e[l]=i[l];for(var c in r)e[c]=r[c]}();function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=t.exports)})(xS,xS.exports);var yZe=function(){function t(e,i){var r=this;this.arcgisWhiteList={a:["href","style","target"],abbr:["title"],audio:["autoplay","controls","loop","muted","preload"],b:[],br:[],dd:["style"],div:["align","style"],dl:["style"],dt:["style"],em:[],figcaption:["style"],figure:["style"],font:["color","face","size","style"],h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],hr:[],i:[],img:["alt","border","height","src","style","width"],li:[],ol:[],p:["style"],source:["media","src","type"],span:["style"],strong:[],sub:["style"],sup:["style"],table:["border","cellpadding","cellspacing","height","style","width"],tbody:[],tr:["align","height","style","valign"],td:["align","colspan","height","nowrap","rowspan","style","valign","width"],th:["align","colspan","height","nowrap","rowspan","style","valign","width"],u:[],ul:[],video:["autoplay","controls","height","loop","muted","poster","preload","width"]},this.allowedProtocols=["http","https","mailto","iform","tel","flow","lfmobile","arcgis-navigator","arcgis-appstudio-player","arcgis-survey123","arcgis-collector","arcgis-workforce","arcgis-explorer","arcgis-trek2there","arcgis-quickcapture","mspbi","comgooglemaps","pdfefile","pdfehttp","pdfehttps","boxapp","boxemm","awb","awbs","gropen","radarscope"],this.arcgisFilterOptions={allowCommentTag:!0,safeAttrValue:function(s,o,l,c){return s==="a"&&o==="href"||(s==="img"||s==="source")&&o==="src"?r.sanitizeUrl(l):xS.exports.safeAttrValue(s,o,l,c)}},this._entityMap={"&":"8","<":"<",">":">",'"':""","'":"'","/":"/"};var n;e&&!i?n=e:e&&i?(n=Object.create(this.arcgisFilterOptions),Object.keys(e).forEach(function(s){s==="whiteList"?n.whiteList=r._extendObjectOfArrays([r.arcgisWhiteList,e.whiteList||{}]):n[s]=e[s]})):(n=Object.create(this.arcgisFilterOptions),n.whiteList=this.arcgisWhiteList),this.xssFilterOptions=n,this._xssFilter=new xS.exports.FilterXSS(n)}return t.prototype.sanitize=function(e,i){switch(i===void 0&&(i={}),typeof e){case"number":return isNaN(e)||!isFinite(e)?null:e;case"boolean":return e;case"string":return this._xssFilter.process(e);case"object":return this._iterateOverObject(e,i);default:return i.allowUndefined&&typeof e>"u"?void 0:null}},t.prototype.sanitizeUrl=function(e,i){var r=(i??{}).isProtocolRequired,n=r===void 0?!0:r,s=this._trim(e.substring(0,e.indexOf(":"))),o=e==="/",l=/^#/.test(e),c=s&&this.allowedProtocols.indexOf(s.toLowerCase())>-1;return o||l||c?xS.exports.escapeAttrValue(e):!s&&!n?xS.exports.escapeAttrValue("https://".concat(e)):""},t.prototype.sanitizeHTMLAttribute=function(e,i,r,n){return typeof this.xssFilterOptions.safeAttrValue=="function"?this.xssFilterOptions.safeAttrValue(e,i,r,n):xS.exports.safeAttrValue(e,i,r,n)},t.prototype.validate=function(e,i){i===void 0&&(i={});var r=this.sanitize(e,i);return{isValid:e===r,sanitized:r}},t.prototype.encodeHTML=function(e){var i=this;return String(e).replace(/[&<>"'\/]/g,function(r){return i._entityMap[r]})},t.prototype.encodeAttrValue=function(e){var i=/^[a-zA-Z0-9]$/;return String(e).replace(/[\x00-\xFF]/g,function(r,n){return i.test(r)?r:"&#x".concat(Number(e.charCodeAt(n)).toString(16),";")})},t.prototype._extendObjectOfArrays=function(e){var i={};return e.forEach(function(r){Object.keys(r).forEach(function(n){Array.isArray(r[n])&&Array.isArray(i[n])?i[n]=i[n].concat(r[n]):i[n]=r[n]})}),i},t.prototype._iterateOverObject=function(e,i){var r=this;i===void 0&&(i={});try{var n=!1,s=void 0;if(Array.isArray(e))s=e.reduce(function(l,c){var f=r.validate(c,i);return f.isValid?l.concat([c]):(n=!0,l.concat([f.sanitized]))},[]);else if(CXe(e)){var o=Object.keys(e);s=o.reduce(function(l,c){var f=e[c],_=r.validate(f,i);return _.isValid?l[c]=f:(n=!0,l[c]=_.sanitized),l},{})}else return i.allowUndefined&&typeof e>"u"?void 0:null;return n?s:e}catch{return null}},t.prototype._trim=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},t}();const oB=new Map;function VEe(){oB.clear()}function vZe(t){return oB.get(t)}function _Ze(t,e){oB.set(t,e)}function hH(t){oB.delete(t)}const bZe=Ce.getLogger("esri.widgets.support.widgetUtils");function GS(t){const e=Uh.acquire();for(let r=0;r{const t=new Map,e=new ResizeObserver(r=>{var n;VEe();for(const s of r)(n=t.get(s.target))==null||n(s)}),i=(r,n,s)=>(t.has(r)&&bZe.error("Already observing element",r),t.set(r,n),e.observe(r,s),rr(()=>{e.unobserve(r),t.delete(r)}));return(r,n,s)=>{let o=null;return id([_e(()=>typeof r=="function"?r():r,l=>{o==null||o.remove(),l&&(o=i(l,n,s))},kt),rr(()=>o==null?void 0:o.remove())])}})();function RT(t){const e=t==null?void 0:t.closest("[dir]");return e!==null&&e instanceof HTMLElement&&e.dir==="rtl"||document.dir==="rtl"}function wZe(t){return RT(t)?"rtl":"ltr"}function iXt(t){const e="data-node-ref";this[t.getAttribute(e)]=null}function Vv(t){const e="data-node-ref";this[t.getAttribute(e)]=t}const xZe=["dd","dl","dt","h1","h2","h3","h4","h5","h6","sub","sup","animate","animatetransform","circle","clippath","defs","ellipse","g","image","line","lineargradient","marker","mask","path","pattern","polygon","polyline","radialgradient","rect","stop","svg","switch","symbol","text","textpath","tspan","use"],SZe=xZe.reduce((t,e)=>(t[e]=[],t),{}),TZe=["align","alink","alt","bgcolor","border","cellpadding","cellspacing","class","color","cols","colspan","coords","d","dir","face","height","hspace","ismap","lang","marginheight","marginwidth","multiple","nohref","noresize","noshade","nowrap","ref","rel","rev","rows","rowspan","scrolling","shape","span","summary","tabindex","title","usemap","valign","value","vlink","vspace","width"],BEe=new yZe({whiteList:SZe,onTagAttr:(t,e,i)=>{const r=`${e}="${i}"`;if(TZe.includes(e))return r},stripIgnoreTag:!0,stripIgnoreTagBody:["script","style"]},!0);function EZe(t,e){const i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),n=i.top+i.height,s=r.top+r.height,o=i.top,l=r.top;(n>s||o{let i={};return Object.keys(t).forEach(r=>{i[r]=t[r]}),e&&Object.keys(e).forEach(r=>{i[r]=e[r]}),i},Fne=(t,e)=>t.vnodeSelector===e.vnodeSelector&&(t.properties&&e.properties?t.properties.key===e.properties.key&&t.properties.bind===e.properties.bind:!t.properties&&!e.properties),HEe=t=>{if(typeof t!="string")throw new Error("Style values must be strings")},CZe=(t,e,i)=>{if(e.vnodeSelector!==""){for(let r=i;r{let n=t[e];if(n.vnodeSelector==="")return;let s=n.properties;if(!(s&&(s.key===void 0?s.bind:s.key))){for(let o=0;o{if(t.properties){let e=t.properties.enterAnimation;e&&e(t.domNode,t.properties)}},SZ=[],TZ=!1,qEe=t=>{(t.children||[]).forEach(qEe),t.properties&&t.properties.afterRemoved&&t.properties.afterRemoved.apply(t.properties.bind||t.properties,[t.domNode])},vde=()=>{TZ=!1,SZ.forEach(qEe),SZ.length=0},_de=t=>{SZ.push(t),TZ||(TZ=!0,typeof window<"u"&&"requestIdleCallback"in window?window.requestIdleCallback(vde,{timeout:16}):setTimeout(vde,16))},bde=t=>{let e=t.domNode;if(t.properties){let i=t.properties.exitAnimation;if(i)return e.style.pointerEvents="none",void i(e,()=>{e.parentNode&&(e.parentNode.removeChild(e),_de(t))},t.properties)}e.parentNode&&(e.parentNode.removeChild(e),_de(t))},MZe=(t,e,i)=>{if(!e)return;let r=i.eventHandlerInterceptor,n=Object.keys(e),s=n.length;for(let o=0;o{if(e)for(let r of e)wM(r,t,void 0,i)},WEe=(t,e,i)=>{OZe(t,e.children,i),e.text&&(t.textContent=e.text),MZe(t,e.properties,i),e.properties&&e.properties.afterCreate&&e.properties.afterCreate.apply(e.properties.bind||e.properties,[t,i,e.vnodeSelector,e.properties,e.children])},wM=(t,e,i,r)=>{let n,s=0,o=t.vnodeSelector,l=e.ownerDocument;if(o==="")n=t.domNode=l.createTextNode(t.text),i!==void 0?e.insertBefore(n,i):e.appendChild(n);else{for(let c=0;c<=o.length;++c){let f=o.charAt(c);if(c===o.length||f==="."||f==="#"){let _=o.charAt(s-1),x=o.slice(s,c);_==="."?n.classList.add(x):_==="#"?n.id=x:(x==="svg"&&(r=Nne(r,{namespace:lB})),r.namespace!==void 0?n=t.domNode=l.createElementNS(r.namespace,x):(n=t.domNode=t.domNode||l.createElement(x),x==="input"&&t.properties&&t.properties.type!==void 0&&n.setAttribute("type",t.properties.type)),i!==void 0?e.insertBefore(n,i):n.parentNode!==e&&e.appendChild(n)),s=c+1}}WEe(n,t,r)}},CZ=(t,e,i)=>{e&&e.split(" ").forEach(r=>{r&&t.classList.toggle(r,i)})},PZe=(t,e,i,r)=>{if(!i)return;let n=!1,s=Object.keys(i),o=s.length;for(let l=0;l{if(i===r)return!1;r=r||yde;let s,o=(i=i||yde).length,l=r.length,c=0,f=0,_=!1;for(;f=0){for(s=c;sc)for(s=c;s{let r=t.domNode,n=!1;if(t===e)return!1;let s=!1;if(e.vnodeSelector===""){if(e.text!==t.text){let o=r.ownerDocument.createTextNode(e.text);return r.parentNode.replaceChild(o,r),e.domNode=o,n=!0,n}e.domNode=r}else e.vnodeSelector.lastIndexOf("svg",0)===0&&(i=Nne(i,{namespace:lB})),t.text!==e.text&&(s=!0,e.text===void 0?r.removeChild(r.firstChild):r.textContent=e.text),e.domNode=r,s=RZe(e,r,t.children,e.children,i)||s,s=PZe(r,t.properties,e.properties,i)||s,e.properties&&e.properties.afterUpdate&&e.properties.afterUpdate.apply(e.properties.bind||e.properties,[r,i,e.vnodeSelector,e.properties,e.children]);return s&&e.properties&&e.properties.updateAnimation&&e.properties.updateAnimation(r,e.properties,t.properties),n};let BP=(t,e)=>({getLastRender:()=>t,update:i=>{if(t.vnodeSelector!==i.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");let r=t;t=i,dz(r,i,e)},domNode:t.domNode});const IZe={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,i)=>{e.charAt(0)==="-"?t.style.setProperty(e,i):t.style[e]=i}};let aA=t=>Nne(IZe,t),Jw={create:(t,e)=>(e=aA(e),wM(t,document.createElement("div"),void 0,e),BP(t,e)),append:(t,e,i)=>(i=aA(i),wM(e,t,void 0,i),BP(e,i)),insertBefore:(t,e,i)=>(i=aA(i),wM(e,t.parentNode,t,i),BP(e,i)),merge:(t,e,i)=>(i=aA(i),e.domNode=t,WEe(t,e,i),BP(e,i)),replace:(t,e,i)=>(i=aA(i),wM(e,t.parentNode,t,i),t.parentNode.removeChild(t),BP(e,i))},YEe,$Ze=(t,e)=>{let i=[];for(;t&&t!==e;)i.push(t),t=t.parentNode;return i};YEe=Array.prototype.find?(t,e)=>t.find(e):(t,e)=>t.filter(e)[0];let LZe=(t,e)=>{let i=t;return e.forEach(r=>{i=i&&i.children?YEe(i.children,n=>n.domNode===r):void 0}),i},DZe=(t,e,i)=>{let r=function(n){i("domEvent",n);let s=e(),o=$Ze(n.currentTarget,s.domNode);o.reverse();let l,c=LZe(s.getLastRender(),o);return t.scheduleRender(),c&&(l=c.properties[`on${n.type}`].apply(c.properties.bind||this,arguments)),i("domEventProcessed",n),l};return(n,s,o,l)=>r},pz=t=>{let e,i,r=aA(t),n=r.performanceLogger,s=!0,o=!1,l=[],c=[],f=(x,T,A)=>{let M,I=()=>M;r.eventHandlerInterceptor=DZe(e,I,n),M=x(T,A(),r),l.push(M),c.push(A)},_=()=>{if(i=void 0,s){s=!1,n("renderStart",void 0);for(let x=0;x{i||o||(i=requestAnimationFrame(_))},stop:()=>{i&&(cancelAnimationFrame(i),i=void 0),o=!0},resume:()=>{o=!1,s=!0,e.scheduleRender()},append:(x,T)=>{f(Jw.append,x,T)},insertBefore:(x,T)=>{f(Jw.insertBefore,x,T)},merge:(x,T)=>{f(Jw.merge,x,T)},replace:(x,T)=>{f(Jw.replace,x,T)},detach:x=>{for(let T=0;T(t.scheduleRender(),e.properties[`on${r.type}`].apply(e.properties.bind||i,[r]))},FZe={namespace:void 0,performanceLogger:()=>{},eventHandlerInterceptor:void 0,styleApplyer:(t,e,i)=>{e.charAt(0)==="-"?t.style.setProperty(e,i):t.style[e]=i}},kZe=t=>({...FZe,...t}),zZe=(t,e)=>{const i=[];for(;t&&t!==e;)i.push(t),t=t.parentNode;return i},UZe=(t,e)=>t.find(e),wde=(t,e,i=!1)=>{let r=t;return e.forEach((n,s)=>{const o=r!=null&&r.children?UZe(r.children,l=>l.domNode===n):void 0;i&&!o&&s!==e.length-1||(r=o)}),r},VZe=t=>{let e;const i={...NZe,...t},r=kZe(i),n=r.performanceLogger;let s,o=!0,l=!1;const c=[],f=[],_=(T,A,M)=>{var F;let I;r.eventHandlerInterceptor=(z,k,U,j)=>function(H){let Y;n("domEvent",H);const Q=zZe(H.currentTarget,I.domNode),ne=Q.some(he=>{var ce;return customElements.get((ce=he==null?void 0:he.tagName)==null?void 0:ce.toLowerCase())});if(H.eventPhase===Event.CAPTURING_PHASE||!ne)Q.reverse(),Y=wde(I.getLastRender(),Q);else{const he=H.composedPath(),ce=he.slice(he.indexOf(H.currentTarget),he.indexOf(I.domNode)).reverse();Y=wde(I.getLastRender(),ce,!0)}let re;return Y&&(re=i.handleInterceptedEvent(e,Y,this,H)),n("domEventProcessed",H),re},(F=i.postProcessProjectionOptions)==null||F.call(i,r);const L=M();I=T(A,L,r),r.eventHandlerInterceptor=void 0,c.push(I),f.push(M),i.afterFirstVNodeRendered&&i.afterFirstVNodeRendered(I,L)};let x=()=>{if(s=void 0,o){o=!1,n("renderStart",void 0);for(let T=0;T{s||l||(s=requestAnimationFrame(x))},stop:()=>{s&&(cancelAnimationFrame(s),s=void 0),l=!0},resume:()=>{l=!1,o=!0,e.scheduleRender()},append:(T,A)=>{_(Jw.append,T,A)},insertBefore:(T,A)=>{_(Jw.insertBefore,T,A)},merge:(T,A)=>{_(Jw.merge,T,A)},replace:(T,A)=>{_(Jw.replace,T,A)},detach:T=>{for(let A=0;A{const e=new URL(t,Kl.$resourcesUrl$);return e.origin!==C9.location.origin?e.href:e.pathname},jZe=t=>Kl.$resourcesUrl$=t,IT=(t,e="")=>()=>{},Sde="http://www.w3.org/1999/xlink",Tde={},GZe="http://www.w3.org/2000/svg",HZe="http://www.w3.org/1999/xhtml",qZe=t=>t!=null,zne=t=>(t=typeof t,t==="object"||t==="function");function WZe(t){var e,i,r;return(r=(i=(e=t.head)===null||e===void 0?void 0:e.querySelector('meta[name="csp-nonce"]'))===null||i===void 0?void 0:i.getAttribute("content"))!==null&&r!==void 0?r:void 0}const JEe=(t,e,...i)=>{let r=null,n=null,s=null,o=!1,l=!1;const c=[],f=x=>{for(let T=0;Tx[T]).join(" "))}}if(typeof t=="function")return t(e===null?{}:e,c,ZZe);const _=mz(t,null);return _.$attrs$=e,c.length>0&&(_.$children$=c),_.$key$=n,_.$name$=s,_},mz=(t,e)=>{const i={$flags$:0,$tag$:t,$text$:e,$elm$:null,$children$:null};return i.$attrs$=null,i.$key$=null,i.$name$=null,i},YZe={},XZe=t=>t&&t.$tag$===YZe,ZZe={forEach:(t,e)=>t.map(Ede).forEach(e),map:(t,e)=>t.map(Ede).map(e).map(JZe)},Ede=t=>({vattrs:t.$attrs$,vchildren:t.$children$,vkey:t.$key$,vname:t.$name$,vtag:t.$tag$,vtext:t.$text$}),JZe=t=>{if(typeof t.vtag=="function"){const i=Object.assign({},t.vattrs);return t.vkey&&(i.key=t.vkey),t.vname&&(i.name=t.vname),JEe(t.vtag,i,...t.vchildren||[])}const e=mz(t.vtag,t.vtext);return e.$attrs$=t.vattrs,e.$children$=t.vchildren,e.$key$=t.vkey,e.$name$=t.vname,e},KZe=t=>EJe.map(e=>e(t)).find(e=>!!e),QZe=(t,e)=>t!=null&&!zne(t)?e&4?t==="false"?!1:t===""||!!t:e&2?parseFloat(t):e&1?String(t):t:t,eJe=t=>t,rXt=(t,e,i)=>{const r=eJe(t);return{emit:n=>tJe(r,e,{bubbles:!!(i&4),composed:!!(i&2),cancelable:!!(i&1),detail:n})}},tJe=(t,e,i)=>{const r=Kl.ce(e,i);return t.dispatchEvent(r),r},Cde=new WeakMap,iJe=(t,e,i)=>{let r=yz.get(t);MJe&&i?(r=r||new CSSStyleSheet,typeof r=="string"?r=e:r.replaceSync(e)):r=e,yz.set(t,r)},rJe=(t,e,i,r)=>{var n;let s=KEe(e,i);const o=yz.get(s);if(t=t.nodeType===11?t:Em,o)if(typeof o=="string"){t=t.head||t;let l=Cde.get(t),c;if(l||Cde.set(t,l=new Set),!l.has(s)){{c=Em.createElement("style"),c.innerHTML=o;const f=(n=Kl.$nonce$)!==null&&n!==void 0?n:WZe(Em);f!=null&&c.setAttribute("nonce",f),t.insertBefore(c,t.querySelector("link"))}l&&l.add(s)}}else t.adoptedStyleSheets.includes(o)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,o]);return s},nJe=t=>{const e=t.$cmpMeta$,i=t.$hostElement$,r=e.$flags$,n=IT("attachStyles",e.$tagName$),s=rJe(i.shadowRoot?i.shadowRoot:i.getRootNode(),e,t.$modeName$);r&10&&(i["s-sc"]=s,i.classList.add(s+"-h"),r&2&&i.classList.add(s+"-s")),n()},KEe=(t,e)=>"sc-"+(e&&t.$flags$&32?t.$tagName$+"-"+e:t.$tagName$),Ade=(t,e,i,r,n,s)=>{if(i!==r){let o=Rde(t,e),l=e.toLowerCase();if(e==="class"){const c=t.classList,f=Mde(i),_=Mde(r);c.remove(...f.filter(x=>x&&!_.includes(x))),c.add(..._.filter(x=>x&&!f.includes(x)))}else if(e==="style"){for(const c in i)(!r||r[c]==null)&&(c.includes("-")?t.style.removeProperty(c):t.style[c]="");for(const c in r)(!i||r[c]!==i[c])&&(c.includes("-")?t.style.setProperty(c,r[c]):t.style[c]=r[c])}else if(e!=="key")if(e==="ref")r&&r(t);else if(!t.__lookupSetter__(e)&&e[0]==="o"&&e[1]==="n")e[2]==="-"?e=e.slice(3):Rde(C9,l)?e=l.slice(2):e=l[2]+e.slice(3),i&&Kl.rel(t,e,i,!1),r&&Kl.ael(t,e,r,!1);else{const c=zne(r);if((o||c&&r!==null)&&!n)try{if(t.tagName.includes("-"))t[e]=r;else{const _=r??"";e==="list"?o=!1:(i==null||t[e]!=_)&&(t[e]=_)}}catch{}let f=!1;l!==(l=l.replace(/^xlink\:?/,""))&&(e=l,f=!0),r==null||r===!1?(r!==!1||t.getAttribute(e)==="")&&(f?t.removeAttributeNS(Sde,e):t.removeAttribute(e)):(!o||s&4||n)&&!c&&(r=r===!0?"":r,f?t.setAttributeNS(Sde,e,r):t.setAttribute(e,r))}}},sJe=/\s/,Mde=t=>t?t.split(sJe):[],QEe=(t,e,i,r)=>{const n=e.$elm$.nodeType===11&&e.$elm$.host?e.$elm$.host:e.$elm$,s=t&&t.$attrs$||Tde,o=e.$attrs$||Tde;for(r in s)r in o||Ade(n,r,s[r],void 0,i,e.$flags$);for(r in o)Ade(n,r,s[r],o[r],i,e.$flags$)},gz=(t,e,i,r)=>{const n=e.$children$[i];let s=0,o,l,c;if(ZEe||(kne=!0,n.$tag$==="slot"&&(cA&&r.classList.add(cA+"-s"),n.$flags$|=n.$children$?2:1)),n.$text$!==null)o=n.$elm$=Em.createTextNode(n.$text$);else if(n.$flags$&1)o=n.$elm$=Em.createTextNode("");else{if(Xd||(Xd=n.$tag$==="svg"),o=n.$elm$=Em.createElementNS(Xd?GZe:HZe,n.$flags$&2?"slot-fb":n.$tag$),Xd&&n.$tag$==="foreignObject"&&(Xd=!1),QEe(null,n,Xd),qZe(cA)&&o["s-si"]!==cA&&o.classList.add(o["s-si"]=cA),n.$children$)for(s=0;s{Kl.$flags$|=1;const i=t.childNodes;for(let r=i.length-1;r>=0;r--){const n=i[r];n["s-hn"]!==cB&&n["s-ol"]&&(iCe(n).insertBefore(n,Une(n)),n["s-ol"].remove(),n["s-ol"]=void 0,kne=!0),e&&sL(n,e)}Kl.$flags$&=-2},eCe=(t,e,i,r,n,s)=>{let o=t["s-cr"]&&t["s-cr"].parentNode||t,l;for(o.shadowRoot&&o.tagName===cB&&(o=o.shadowRoot);n<=s;++n)r[n]&&(l=gz(null,i,n,t),l&&(r[n].$elm$=l,o.insertBefore(l,Une(e))))},tCe=(t,e,i,r,n)=>{for(;e<=i;++e)(r=t[e])&&(n=r.$elm$,sCe(r),fz=!0,n["s-ol"]?n["s-ol"].remove():sL(n,!0),n.remove())},oJe=(t,e,i,r)=>{let n=0,s=0,o=0,l=0,c=e.length-1,f=e[0],_=e[c],x=r.length-1,T=r[0],A=r[x],M,I;for(;n<=c&&s<=x;)if(f==null)f=e[++n];else if(_==null)_=e[--c];else if(T==null)T=r[++s];else if(A==null)A=r[--x];else if(F6(f,T))uA(f,T),f=e[++n],T=r[++s];else if(F6(_,A))uA(_,A),_=e[--c],A=r[--x];else if(F6(f,A))(f.$tag$==="slot"||A.$tag$==="slot")&&sL(f.$elm$.parentNode,!1),uA(f,A),t.insertBefore(f.$elm$,_.$elm$.nextSibling),f=e[++n],A=r[--x];else if(F6(_,T))(f.$tag$==="slot"||A.$tag$==="slot")&&sL(_.$elm$.parentNode,!1),uA(_,T),t.insertBefore(_.$elm$,f.$elm$),_=e[--c],T=r[++s];else{for(o=-1,l=n;l<=c;++l)if(e[l]&&e[l].$key$!==null&&e[l].$key$===T.$key$){o=l;break}o>=0?(I=e[o],I.$tag$!==T.$tag$?M=gz(e&&e[s],i,o,t):(uA(I,T),e[o]=void 0,M=I.$elm$),T=r[++s]):(M=gz(e&&e[s],i,s,t),T=r[++s]),M&&iCe(f.$elm$).insertBefore(M,Une(f.$elm$))}n>c?eCe(t,r[x+1]==null?null:r[x+1].$elm$,i,r,s,x):s>x&&tCe(e,n,c)},F6=(t,e)=>t.$tag$===e.$tag$?t.$tag$==="slot"?t.$name$===e.$name$:t.$key$===e.$key$:!1,Une=t=>t&&t["s-ol"]||t,iCe=t=>(t["s-ol"]?t["s-ol"]:t).parentNode,uA=(t,e)=>{const i=e.$elm$=t.$elm$,r=t.$children$,n=e.$children$,s=e.$tag$,o=e.$text$;let l;o===null?(Xd=s==="svg"?!0:s==="foreignObject"?!1:Xd,s==="slot"||QEe(t,e,Xd),r!==null&&n!==null?oJe(i,r,e,n):n!==null?(t.$text$!==null&&(i.textContent=""),eCe(i,null,e,n,0,n.length-1)):r!==null&&tCe(r,0,r.length-1),Xd&&s==="svg"&&(Xd=!1)):(l=i["s-cr"])?l.parentNode.textContent=o:t.$text$!==o&&(i.data=o)},rCe=t=>{const e=t.childNodes;let i,r,n,s,o,l;for(r=0,n=e.length;r{let e,i,r,n,s,o,l=0;const c=t.childNodes,f=c.length;for(;l=0;o--)i=r[o],!i["s-cn"]&&!i["s-nr"]&&i["s-hn"]!==e["s-hn"]&&(Ode(i,n)?(s=lm.find(_=>_.$nodeToRelocate$===i),fz=!0,i["s-sn"]=i["s-sn"]||n,s?s.$slotRefNode$=e:lm.push({$slotRefNode$:e,$nodeToRelocate$:i}),i["s-sr"]&&lm.map(_=>{Ode(_.$nodeToRelocate$,i["s-sn"])&&(s=lm.find(x=>x.$nodeToRelocate$===i),s&&!_.$slotRefNode$&&(_.$slotRefNode$=s.$slotRefNode$))})):lm.some(_=>_.$nodeToRelocate$===i)||lm.push({$nodeToRelocate$:i}));e.nodeType===1&&nCe(e)}},Ode=(t,e)=>t.nodeType===1?t.getAttribute("slot")===null&&e===""||t.getAttribute("slot")===e:t["s-sn"]===e?!0:e==="",sCe=t=>{t.$attrs$&&t.$attrs$.ref&&t.$attrs$.ref(null),t.$children$&&t.$children$.map(sCe)},aJe=(t,e)=>{const i=t.$hostElement$,r=t.$cmpMeta$,n=t.$vnode$||mz(null,null),s=XZe(e)?e:JEe(null,null,e);cB=i.tagName,r.$attrsToReflect$&&(s.$attrs$=s.$attrs$||{},r.$attrsToReflect$.map(([o,l])=>s.$attrs$[l]=i[o])),s.$tag$=null,s.$flags$|=4,t.$vnode$=s,s.$elm$=n.$elm$=i.shadowRoot||i,cA=i["s-sc"],XEe=i["s-cr"],ZEe=(r.$flags$&1)!==0,fz=!1,uA(n,s);{if(Kl.$flags$|=1,kne){nCe(s.$elm$);let o,l,c,f,_,x,T=0;for(;T{},Vne=(t,e)=>(t.$flags$|=16,lJe(t,t.$ancestorComponent$),PJe(()=>cJe(t,e))),cJe=(t,e)=>{const i=t.$hostElement$,r=IT("scheduleUpdate",t.$cmpMeta$.$tagName$),n=i;let s;return e?s=iO(n,"componentWillLoad"):s=iO(n,"componentWillUpdate"),s=Pde(s,()=>iO(n,"componentWillRender")),r(),Pde(s,()=>uJe(t,n,e))},uJe=async(t,e,i)=>{const r=t.$hostElement$,n=IT("update",t.$cmpMeta$.$tagName$);r["s-rc"],i&&nJe(t);const s=IT("render",t.$cmpMeta$.$tagName$);hJe(t,e,r),s(),n(),dJe(t)},hJe=(t,e,i)=>{try{xde=e,e=e.render&&e.render(),t.$flags$&=-17,t.$flags$|=2,(lA.hasRenderFn||lA.reflect)&&(lA.vdomRender||lA.reflect)&&(lA.hydrateServerSide||aJe(t,e))}catch(l){E9(l,t.$hostElement$)}return xde=null,null},dJe=t=>{const e=t.$cmpMeta$.$tagName$,i=t.$hostElement$,r=IT("postUpdate",e),n=i;t.$ancestorComponent$,iO(n,"componentDidRender"),t.$flags$&64?(iO(n,"componentDidUpdate"),r()):(t.$flags$|=64,iO(n,"componentDidLoad"),r())},nXt=t=>{{const e=T9(t),i=e.$hostElement$.isConnected;return i&&(e.$flags$&18)===2&&Vne(e,!1),i}},iO=(t,e,i)=>{if(t&&t[e])try{return t[e](i)}catch(r){E9(r)}},Pde=(t,e)=>t&&t.then?t.then(e):e(),pJe=(t,e)=>T9(t).$instanceValues$.get(e),fJe=(t,e,i,r)=>{const n=T9(t),s=t,o=n.$instanceValues$.get(e),l=n.$flags$,c=s;i=QZe(i,r.$members$[e][0]);const f=Number.isNaN(o)&&Number.isNaN(i);if(i!==o&&!f){n.$instanceValues$.set(e,i);{if(r.$watchers$&&l&128){const x=r.$watchers$[e];x&&x.map(T=>{try{c[T](i,o,e)}catch(A){E9(A,s)}})}if((l&18)===2){if(c.componentShouldUpdate&&c.componentShouldUpdate(i,o,e)===!1)return;Vne(n,!1)}}}},mJe=(t,e,i)=>{if(e.$members$){t.watchers&&(e.$watchers$=t.watchers);const r=Object.entries(e.$members$),n=t.prototype;r.map(([s,[o]])=>{(o&31||o&32)&&Object.defineProperty(n,s,{get(){return pJe(this,s)},set(l){fJe(this,s,l,e)},configurable:!0,enumerable:!0})});{const s=new Map;n.attributeChangedCallback=function(o,l,c){Kl.jmp(()=>{const f=s.get(o);if(this.hasOwnProperty(f))c=this[f],delete this[f];else if(n.hasOwnProperty(f)&&typeof this[f]=="number"&&this[f]==c)return;this[f]=c===null&&typeof this[f]=="boolean"?!1:c})},t.observedAttributes=r.filter(([o,l])=>l[0]&15).map(([o,l])=>{const c=l[1]||o;return s.set(c,o),l[0]&512&&e.$attrsToReflect$.push([o,c]),c})}}return t},gJe=async(t,e,i,r,n)=>{if(!(e.$flags$&32)&&(n=t.constructor,e.$flags$|=32,customElements.whenDefined(i.$tagName$).then(()=>e.$flags$|=128),n.style)){let o=n.style;typeof o!="string"&&(o=o[e.$modeName$=KZe(t)]);const l=KEe(i,e.$modeName$);if(!yz.has(l)){const c=IT("registerStyles",i.$tagName$);iJe(l,o,!!(i.$flags$&1)),c()}}e.$ancestorComponent$,Vne(e,!0)},yJe=t=>{},vJe=t=>{if(!(Kl.$flags$&1)){const e=T9(t),i=e.$cmpMeta$,r=IT("connectedCallback",i.$tagName$);e.$flags$&1?(oCe(t,e,i.$listeners$),yJe(e.$lazyInstance$)):(e.$flags$|=1,i.$flags$&12&&_Je(t),i.$members$&&Object.entries(i.$members$).map(([n,[s]])=>{if(s&31&&t.hasOwnProperty(n)){const o=t[n];delete t[n],t[n]=o}}),gJe(t,e,i)),r()}},_Je=t=>{const e=t["s-cr"]=Em.createComment("");e["s-cn"]=!0,t.insertBefore(e,t.firstChild)},bJe=t=>{if(!(Kl.$flags$&1)){const e=T9(t);e.$rmListeners$&&(e.$rmListeners$.map(i=>i()),e.$rmListeners$=void 0)}},sXt=(t,e)=>{const i={$flags$:e[0],$tagName$:e[1]};i.$members$=e[2],i.$listeners$=e[3],i.$watchers$=t.$watchers$,i.$attrsToReflect$=[];const r=t.prototype.connectedCallback,n=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__registerHost(){TJe(this,i)},connectedCallback(){vJe(this),r&&r.call(this)},disconnectedCallback(){bJe(this),n&&n.call(this)},__attachShadow(){this.attachShadow({mode:"open",delegatesFocus:!!(i.$flags$&16)})}}),t.is=i.$tagName$,mJe(t,i)},oXt=(t,e)=>e,oCe=(t,e,i,r)=>{i&&i.map(([n,s,o])=>{const l=xJe(t,n),c=wJe(e,o),f=SJe(n);Kl.ael(l,s,c,f),(e.$rmListeners$=e.$rmListeners$||[]).push(()=>Kl.rel(l,s,c,f))})},wJe=(t,e)=>i=>{try{lA.lazyLoad||t.$hostElement$[e](i)}catch(r){E9(r)}},xJe=(t,e)=>e&4?Em:e&8?C9:e&16?Em.body:t,SJe=t=>CJe?{passive:(t&1)!==0,capture:(t&2)!==0}:(t&2)!==0,aCe=new WeakMap,T9=t=>aCe.get(t),TJe=(t,e)=>{const i={$flags$:0,$hostElement$:t,$cmpMeta$:e,$instanceValues$:new Map};return oCe(t,i,e.$listeners$),aCe.set(t,i)},Rde=(t,e)=>e in t,E9=(t,e)=>(0,console.error)(t,e),yz=new Map,EJe=[],C9=typeof window<"u"?window:{},Em=C9.document||{head:{}},aXt=C9.HTMLElement||class{},Kl={$flags$:0,$resourcesUrl$:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,i,r)=>t.addEventListener(e,i,r),rel:(t,e,i,r)=>t.removeEventListener(e,i,r),ce:(t,e)=>new CustomEvent(t,e)},CJe=(()=>{let t=!1;try{Em.addEventListener("e",null,Object.defineProperty({},"passive",{get(){t=!0}}))}catch{}return t})(),AJe=t=>Promise.resolve(t),MJe=(()=>{try{return new CSSStyleSheet,typeof new CSSStyleSheet().replaceSync=="function"}catch{}return!1})(),MZ=[],lCe=[],cCe=(t,e)=>i=>{t.push(i),AZ||(AZ=!0,e&&Kl.$flags$&4?OJe(OZ):Kl.raf(OZ))},Ide=t=>{for(let e=0;e{Ide(MZ),Ide(lCe),(AZ=MZ.length>0)&&Kl.raf(OZ)},OJe=t=>AJe().then(t),lXt=cCe(MZ,!1),PJe=cCe(lCe,!0);/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const uCe="calcite-mode-auto",hCe="calcite-mode-dark",RJe="calcite-mode-light",$de={autoMode:uCe,darkMode:hCe,lightMode:RJe,rtl:"calcite--rtl",calciteAnimate:"calcite-animate",calciteAnimateIn:"calcite-animate__in",calciteAnimateInUp:"calcite-animate__in-up",calciteAnimateInDown:"calcite-animate__in-down",calciteAnimateInRight:"calcite-animate__in-right",calciteAnimateInLeft:"calcite-animate__in-left",calciteAnimateInScale:"calcite-animate__in-scale"};/*! +* tabbable 6.2.0 +* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE +*/var dCe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],vz=dCe.join(","),pCe=typeof Element>"u",$T=pCe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_z=!pCe&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},bz=function t(e,i){var r;i===void 0&&(i=!0);var n=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=n===""||n==="true",o=s||i&&e&&t(e.parentNode);return o},IJe=function(e){var i,r=e==null||(i=e.getAttribute)===null||i===void 0?void 0:i.call(e,"contenteditable");return r===""||r==="true"},fCe=function(e,i,r){if(bz(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(vz));return i&&$T.call(e,vz)&&n.unshift(e),n=n.filter(r),n},mCe=function t(e,i,r){for(var n=[],s=Array.from(e);s.length;){var o=s.shift();if(!bz(o,!1))if(o.tagName==="SLOT"){var l=o.assignedElements(),c=l.length?l:o.children,f=t(c,!0,r);r.flatten?n.push.apply(n,f):n.push({scopeParent:o,candidates:f})}else{var _=$T.call(o,vz);_&&r.filter(o)&&(i||!e.includes(o))&&n.push(o);var x=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),T=!bz(x,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(x&&T){var A=t(x===!0?o.children:x.children,!0,r);r.flatten?n.push.apply(n,A):n.push({scopeParent:o,candidates:A})}else s.unshift.apply(s,o.children)}}return n},gCe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},yCe=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||IJe(e))&&!gCe(e)?0:e.tabIndex},$Je=function(e,i){var r=yCe(e);return r<0&&i&&!gCe(e)?0:r},LJe=function(e,i){return e.tabIndex===i.tabIndex?e.documentOrder-i.documentOrder:e.tabIndex-i.tabIndex},vCe=function(e){return e.tagName==="INPUT"},DJe=function(e){return vCe(e)&&e.type==="hidden"},NJe=function(e){var i=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return i},FJe=function(e,i){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if($T.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof n=="function"){for(var l=e;e;){var c=e.parentElement,f=_z(e);if(c&&!c.shadowRoot&&n(c)===!0)return Lde(e);e.assignedSlot?e=e.assignedSlot:!c&&f!==e.ownerDocument?e=f.host:e=c}e=l}if(VJe(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Lde(e);return!1},jJe=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var i=e.parentElement;i;){if(i.tagName==="FIELDSET"&&i.disabled){for(var r=0;r=0)},HJe=function t(e){var i=[],r=[];return e.forEach(function(n,s){var o=!!n.scopeParent,l=o?n.scopeParent:n,c=$Je(l,o),f=o?t(n.candidates):l;c===0?o?i.push.apply(i,f):i.push(l):r.push({documentOrder:s,tabIndex:c,item:n,isScope:o,content:f})}),r.sort(LJe).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(i)},qJe=function(e,i){i=i||{};var r;return i.getShadowRoot?r=mCe([e],i.includeContainer,{filter:PZ.bind(null,i),flatten:!1,getShadowRoot:i.getShadowRoot,shadowRootFilter:GJe}):r=fCe(e,i.includeContainer,PZ.bind(null,i)),HJe(r)},cXt=function(e,i){i=i||{};var r;return i.getShadowRoot?r=mCe([e],i.includeContainer,{filter:wz.bind(null,i),flatten:!0,getShadowRoot:i.getShadowRoot}):r=fCe(e,i.includeContainer,wz.bind(null,i)),r},uXt=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return $T.call(e,vz)===!1?!1:PZ(i,e)},WJe=dCe.concat("iframe").join(","),hXt=function(e,i){if(i=i||{},!e)throw new Error("No node provided");return $T.call(e,WJe)===!1?!1:wz(i,e)};const YJe={getShadowRoot:!0};function dXt(t){return Array.isArray(t)?t:Array.from(t)}function pXt(t){const e=bCe(t,`.${$de.darkMode}, .${$de.lightMode}`);return e!=null&&e.classList.contains("calcite-mode-dark")?"dark":"light"}function fXt(t){const e="dir",i=`[${e}]`,r=bCe(t,i);return r?r.getAttribute(e):"ltr"}function Bne(t){return t.getRootNode()}function mXt(t){const e=Bne(t);return"host"in e?e:null}function _Ce(t){return t.host||null}function gXt(t,{selector:e,id:i}){function r(n){if(!n)return null;n.assignedSlot&&(n=n.assignedSlot);const s=Bne(n),o=i?"getElementById"in s?s.getElementById(i):null:e?s.querySelector(e):null,l=_Ce(s);return o||(l?r(l):null)}return r(t)}function bCe(t,e){function i(r){return r?r.closest(e)||i(_Ce(Bne(r))):null}return i(t)}function XJe(t,e){return wCe(t,e)}function wCe(t,e){if(!t)return;const i=e(t);if(i!==void 0)return i;const{parentNode:r}=t;return wCe(r instanceof ShadowRoot?r.host:r,e)}function yXt(t,e){return!!XJe(e,i=>i===t?!0:void 0)}function ZJe(t){return typeof(t==null?void 0:t.setFocus)=="function"}async function JJe(t){if(t)return ZJe(t)?t.setFocus():t.focus()}function vXt(t){t&&(qJe(t,YJe)[0]||t).focus()}const oL=":not([slot])";function _Xt(t,e,i){e&&!Array.isArray(e)&&typeof e!="string"&&(i=e,e=null);const r=e?Array.isArray(e)?e.map(n=>`[slot="${n}"]`).join(","):`[slot="${e}"]`:oL;return i!=null&&i.all?KJe(t,r,i):QJe(t,r,i)}function xCe(t,e){return t?Array.from(t.children||[]).filter(i=>i==null?void 0:i.matches(e)):[]}function KJe(t,e,i){let r=e===oL?xCe(t,oL):Array.from(t.querySelectorAll(e));r=i&&i.direct===!1?r:r.filter(s=>s.parentElement===t),r=i!=null&&i.matches?r.filter(s=>s==null?void 0:s.matches(i.matches)):r;const n=i==null?void 0:i.selector;return n?r.map(s=>Array.from(s.querySelectorAll(n))).reduce((s,o)=>[...s,...o],[]).filter(s=>!!s):r}function QJe(t,e,i){let r=e===oL?xCe(t,oL)[0]||null:t.querySelector(e);r=i&&i.direct===!1||(r==null?void 0:r.parentElement)===t?r:null,r=i!=null&&i.matches?r!=null&&r.matches(i.matches)?r:null:r;const n=i==null?void 0:i.selector;return n?r==null?void 0:r.querySelector(n):r}function bXt(t,e){return Array.from(t.children).filter(i=>i.matches(e))}function wXt(t,e,i){if(typeof e=="string"&&e!=="")return e;if(e==="")return t[i]}function xXt(t,e){return!(e.left>t.right||e.rightt.bottom||e.bottome.nodeType===Node.TEXT_NODE).map(e=>e.textContent).join("").trim()}function tKe(t){return!!eKe(t)}function iKe(t){return t.target.assignedNodes({flatten:!0})}function rKe(t){return!!nKe(t).length}function nKe(t){return t.target.assignedElements({flatten:!0})}function EXt(t){return!!(t.isPrimary&&t.button===0)}const CXt=(t,e,i,r=!0)=>{const n=t.indexOf(e),s=n===0,o=n===t.length-1;r&&(i=i==="previous"&&s?"last":i==="next"&&o?"first":i);let l;return i==="previous"?l=t[n-1]||t[r?t.length-1:n]:i==="next"?l=t[n+1]||t[r?0:n]:i==="last"?l=t[t.length-1]:l=t[0],JJe(l),l};function AXt(t,e){if(t.parentNode!==e.parentNode)return!1;const i=Array.from(t.parentNode.children);return i.indexOf(t)t.contains(hCe)||t.contains(uCe)&&e?"dark":"light",r=o=>document.body.dispatchEvent(new CustomEvent("calciteModeChange",{bubbles:!0,detail:{mode:o}})),n=o=>{s!==o&&r(o),s=o};let s=i();r(s),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",o=>n(o.matches?"dark":"light")),new MutationObserver(()=>n(i())).observe(document.body,{attributes:!0,attributeFilter:["class"]})}function sKe(){typeof window<"u"&&typeof location<"u"&&typeof document<"u"&&window.location===location&&window.document===document&&(document.readyState==="interactive"?Dde():document.addEventListener("DOMContentLoaded",()=>Dde(),{once:!0}))}const oKe=sKe;oKe();let SCe;function aKe(){try{BZe(".")}catch{jZe(Gh(Wr(SCe)))}}function Pl(t){var i;const e=[];for(const r of Object.keys(t))customElements.get(`calcite-${r}`)||e.push((i=t[r])==null?void 0:i.call(t));return e.length>0?Promise.all(e):null}SCe="components/assets";const TCe=Symbol("widget"),ECe=Symbol("widget-test-data"),lKe=[],cKe={},xz=new WeakMap;function CCe(t,e){let i=e.children;if(i!=null&&i.length)for(let n=0;nACe(t))),queueMicrotask(()=>{o[ECe].projector.renderNow()})}function hKe(t,e,i,{widgetProperties:r}){var s;const n=xz.get(t);n&&(n.set(r),(s=n.afterUpdate)==null||s.call(n,n,t))}function ACe(t){var i;const e=xz.get(t);e&&((i=e.afterRemoved)==null||i.call(e,e,t),e.destroy(),xz.delete(t))}function Sz(t){return typeof t=="function"&&t[TCe]}const si={arrowDown:"esri-icon-arrow-down",arrowUp:"esri-icon-arrow-up",basemap:"esri-icon-basemap",bookmark:"esri-icon-bookmark",calendar:"esri-icon-calendar",checkMark:"esri-icon-check-mark",checkboxUnchecked:"esri-icon-checkbox-unchecked",close:"esri-icon-close",collapse:"esri-icon-collapse",defaultAction:"esri-icon-default-action",description:"esri-icon-description",directions:"esri-icon-directions",dockBottom:"esri-icon-dock-bottom",dockLeft:"esri-icon-dock-left",dockRight:"esri-icon-dock-right",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",download:"esri-icon-download",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",edit:"esri-icon-edit",elevationProfile:"esri-icon-elevation-profile",environmentSettings:"esri-icon-environment-settings",erase:"esri-icon-erase",error:"esri-icon-error",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",gear:"esri-icon-gear",handleHorizontal:"esri-icon-handle-horizontal",handleVertical:"esri-icon-handle-vertical",home:"esri-icon-home",icon:"esri-icon",launchLinkExternal:"esri-icon-launch-link-external",layerList:"esri-icon-layer-list",layers:"esri-icon-layers",left:"esri-icon-left",leftArrows:"esri-icon-left-arrow",leftTriangleArrow:"esri-icon-left-triangle-arrow",lineOfSight:"esri-icon-line-of-sight",link:"esri-icon-link",linkExternal:"esri-icon-link-external",linkHorizontal:"esri-icon-link-horizontal",loadingIndicator:"esri-icon-loading-indicator",locate:"esri-icon-locate",locateCircled:"esri-icon-locate-circled",locked:"esri-icon-locked",mapPin:"esri-icon-map-pin",maximize:"esri-icon-maximize",measure:"esri-icon-measure",measureArea:"esri-icon-measure-area",measureBuildingHeightShadow:"esri-icon-measure-building-height-shadow",measureLine:"esri-icon-measure-line",menu:"esri-icon-menu",minimize:"esri-icon-minimize",minus:"esri-icon-minus",nonVisible:"esri-icon-non-visible",northNavigation:"esri-icon-north-navigation",noticeTriangle:"esri-icon-notice-triangle",organization:"esri-icon-organization",pan:"esri-icon-pan",pan2:"esri-icon-pan2",partlyCloudy:"esri-icon-partly-cloudy",pause:"esri-icon-pause",play:"esri-icon-play",playCircled:"esri-icon-play-circled",plus:"esri-icon-plus",polyline:"esri-icon-polyline",printer:"esri-icon-printer",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",rightArrow:"esri-icon-right-arrow",rightTriangleArrow:"esri-icon-right-triangle-arrow",rotate:"esri-icon-rotate",save:"esri-icon-save",search:"esri-icon-search",settings2:"esri-icon-settings2",slice:"esri-icon-slice",swap:"esri-icon-swap",table:"esri-icon-table",timeClock:"esri-icon-time-clock",tracking:"esri-icon-tracking",trash:"esri-icon-trash",unlockedLinkHorizontal:"esri-icon-unlocked-link-horizontal",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",vertexGps:"esri-icon-vertex-gps",visible:"esri-icon-visible",zoomInFixed:"esri-icon-zoom-in-fixed",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomOutFixed:"esri-icon-zoom-out-fixed",zoomToObject:"esri-icon-zoom-to-object"},Nde=new Set;function dKe(t){Nde.add(t),t.finally(()=>Nde.delete(t))}var MCe;const pKe="esri.widgets.Widget";let fKe=0;const mKe={widgetIcon:si.checkboxUnchecked};function OCe(t,e){for(const i in e)t[i]!=null&&(typeof t[i]=="object"&&typeof e[i]=="object"?OCe(t[i],e==null?void 0:e[i]):t[i]=e[i]);return t}const gKe=VZe({postProcessProjectionOptions(t){const e=t.eventHandlerInterceptor,i=/capture$/i;t.eventHandlerInterceptor=(r,n,s,o)=>{const l=e==null?void 0:e(r,n,s,o),c=i.test(r);if(!((r=r.replace(i,"")).toLowerCase()in s)||c){const f=r[2].toLowerCase()+r.slice(3),_=A=>l==null?void 0:l.call(s,A);s.addEventListener(f,_,c);const x=()=>s.removeEventListener(f,_,c),T=o.afterRemoved;o.afterRemoved=A=>{T==null||T(A),x()}}return l}},handleInterceptedEvent(t,e,i,r){const{eventPhase:n,type:s}=r,o=n===Event.CAPTURING_PHASE;let l=`on${s}${o?"capture":""}`;const c=e.properties;(c&&l in c||(l=`on${s[0].toUpperCase()}${s.slice(1)}${o?"Capture":""}`,c&&l in c))&&(VEe(),t.scheduleRender(),c[l].call(c.bind||i,r))}});let pH=!1,Ia=class extends S9(Dn.EventedAccessor){constructor(e,i){super(e,i),this._attached=!1,this._projector=gKe,this._readyForTrueRender=!1,this.iconClass=mKe.widgetIcon,this.icon=null,this.key=this,this._loadLocale=X5(async()=>{var l;if((l=this._messageBundleProps)!=null&&l.length){const c=await Promise.allSettled(this._messageBundleProps.map(async({bundlePath:f,propertyName:_})=>{if(this.destroyed)return;let x=await lE(f);this.uiStrings&&Object.keys(this.uiStrings)&&(x=OCe(Re(x),this.uiStrings)),this[_]=x}));if(this.destroyed)return;for(const f of c)f.status==="rejected"&&Ce.getLogger(this).error("widget-intl:locale-error",this.declaredClass,f.reason)}await this.loadLocale()}),aKe();const r="esri-widget-uid-"+Vf(),n=this.render.bind(this);this._trackingTarget=new YV(()=>this.scheduleRender());const s=()=>{var x;if(!this._readyForTrueRender||this.destroyed)return null;const l=n();let{properties:c}=l;c||(l.properties=c={});const{key:f}=c;if(f||(c.key=r),Sz(l.vnodeSelector)){if(!this.visible)return{vnodeSelector:"div",properties:{key:`${r}-hidden`,class:"",styles:{display:"none"}},domNode:null,children:void 0,text:void 0}}else this.visible?c.styles||(c.styles={}):(c.class="",c.styles={display:"none"}),c.styles.display||(c.styles.display="");let _=0;return(x=l.children)==null||x.forEach(T=>{if(Sz(T.vnodeSelector))return;let{properties:A}=T;A||(T.properties=A={}),A.key||(A.key=`${this.id}--${_++}`)}),CCe(this,l)};this.render=()=>{if(pH)return s();let l=vZe(this)??null;if(l)return l;this._trackingTarget.clear(),pH=!0;try{l=c_(this._trackingTarget,s)}catch(c){throw console.error(c),c}finally{pH=!1}return l&&_Ze(this,l),l};const o=this.beforeFirstRender();o?this._resourcesFetch=o.then(()=>{this._readyForTrueRender=!0,this._postInitialize()}):(this._resourcesFetch=Promise.resolve().then(()=>{this._postInitialize()}),this._readyForTrueRender=!0),this.addResolvingPromise(this._resourcesFetch),dKe(this._resourcesFetch)}normalizeCtorArgs(e,i){const r={...e};return i&&(r.container=i),r}postInitialize(){}beforeFirstRender(){var i;const e=this.loadDependencies();return(i=this._messageBundleProps)!=null&&i.length||e?Promise.all([e,this._loadLocale()]).then(()=>{}).catch(XX):null}loadDependencies(){return null}loadLocale(){return null}destroy(){this.destroyed||(et(this._trackingTarget),et(this.viewModel),this._detach(this.container),this._set("container",null),this._emitter.clear(),this.render=()=>null,this._projector=null,hH(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return x9(e)}get domNode(){return this.container}set domNode(e){this.container=e}get id(){var e;return this._get("id")||((e=this.container)==null?void 0:e.id)||Date.now().toString(16)+"-widget-"+fKe++}set id(e){e&&this._set("id",e)}get label(){return this.declaredClass.split(".").pop()}set label(e){this._overrideIfSome("label",e)}get renderable(){return this._resourcesFetch}get visible(){return this._get("visible")}set visible(e){this._set("visible",e)}get[(MCe=TCe,ECe)](){return{projector:this._projector}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(hH(this),this._projector.scheduleRender())}own(e){R3e(Ce.getLogger(this.declaredClass),"`Widget.own()` is deprecated in favor of Widget.addHandles()'",{replacement:"Widget.addHandles()",version:"4.28"}),this.addHandles(e)}classes(...e){return GS.apply(this,e)}renderNow(){hH(this),this._projector.renderNow()}_postInitialize(){var i;if(this.destroyed)return;this.scheduleRender(),(i=this._delegatedEventNames)!=null&&i.length&&this.addHandles(_e(()=>this.viewModel,(r,n)=>{n&&this.removeHandles("delegated-events"),r&&qV(r)&&this.addHandles(this._delegatedEventNames.map(s=>Y5(r,s,o=>{this.emit(s,o)})),"delegated-events")},kt)),this.postInitialize();const e=async()=>{await this._loadLocale().catch(XX),this.scheduleRender()};this.addHandles([oE(e),_e(()=>this.uiStrings,e),Mo(()=>this.container,r=>{this.destroyed||this._attach(r)},{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){var i;this._attached&&(this._projector.detach(this.render),this._attached=!1),(i=e==null?void 0:e.parentNode)==null||i.removeChild(e)}};Ia[MCe]=!0,y([w()],Ia.prototype,"_readyForTrueRender",void 0),y([w({value:null})],Ia.prototype,"container",null),y([Ci("container")],Ia.prototype,"castContainer",null),y([w()],Ia.prototype,"iconClass",void 0),y([w()],Ia.prototype,"icon",void 0),y([w()],Ia.prototype,"id",null),y([w()],Ia.prototype,"label",null),y([w()],Ia.prototype,"renderable",null),y([w()],Ia.prototype,"uiStrings",void 0),y([w()],Ia.prototype,"viewModel",void 0),y([w({value:!0})],Ia.prototype,"visible",null),y([w()],Ia.prototype,"key",void 0),y([w()],Ia.prototype,"children",void 0),y([w()],Ia.prototype,"afterCreate",void 0),y([w()],Ia.prototype,"afterUpdate",void 0),y([w()],Ia.prototype,"afterRemoved",void 0),Ia=y([Z(pKe)],Ia);const cn=Ia;let jne=class{constructor(e,i,r,n){this.semiMajorAxis=e,this.flattening=i,this.outerAtmosphereRimWidth=r;const s=1-this.flattening;this.semiMinorAxis=this.semiMajorAxis*s,this.halfSemiMajorAxis=this.semiMajorAxis/2,this.halfCircumference=Math.PI*this.semiMajorAxis,this.metersPerDegree=this.halfCircumference/180,this.inverseFlattening=1/(1-this.flattening)-1,this.eccentricitySquared=n||2*this.flattening-this.flattening*this.flattening,this.meanRadiusSemiAxes=(2*this.semiMajorAxis+this.semiMinorAxis)/3}get radius(){return this.semiMajorAxis}};const Mr=new jne(6378137,1/298.257223563,3e5,.006694379990137799),Sy=new jne(3396190,1/169.8944472236118,23e4),u_=new jne(1737400,0,0);let fH,$e=null;function PCe(){return!!$e}function yKe(){return!!Le("esri-wasm")}function RCe(){return fH||(fH=we(()=>import("./pe-wasm-Rr_waIie.js"),__vite__mapDeps([])).then(t=>t.p).then(({default:t})=>t({locateFile:e=>Wr(`esri/geometry/support/${e}`)})).then(t=>{$Ce(t)}),fH)}var RZ,to,aL;(function(t){function e(s,o,l){$e.ensureCache.prepare();const c=SS(l),f=l===c,_=$e.ensureFloat64(c),x=$e._pe_geog_to_proj($e.getPointer(s),o,_);return x&&Bw(l,o,_,f),x}function i(s,o,l,c){switch(c){case to.PE_TRANSFORM_P_TO_G:return r(s,o,l);case to.PE_TRANSFORM_G_TO_P:return e(s,o,l)}return 0}function r(s,o,l){return n(s,o,l,0)}function n(s,o,l,c){$e.ensureCache.prepare();const f=SS(l),_=l===f,x=$e.ensureFloat64(f),T=$e._pe_proj_to_geog_center($e.getPointer(s),o,x,c);return T&&Bw(l,o,x,_),T}t.geogToProj=e,t.projGeog=i,t.projToGeog=r,t.projToGeogCenter=n})(RZ||(RZ={})),function(t){function e(){t.PE_BUFFER_MAX=$e.PeDefs.prototype.PE_BUFFER_MAX,t.PE_NAME_MAX=$e.PeDefs.prototype.PE_NAME_MAX,t.PE_MGRS_MAX=$e.PeDefs.prototype.PE_MGRS_MAX,t.PE_USNG_MAX=$e.PeDefs.prototype.PE_USNG_MAX,t.PE_DD_MAX=$e.PeDefs.prototype.PE_DD_MAX,t.PE_DDM_MAX=$e.PeDefs.prototype.PE_DDM_MAX,t.PE_DMS_MAX=$e.PeDefs.prototype.PE_DMS_MAX,t.PE_UTM_MAX=$e.PeDefs.prototype.PE_UTM_MAX,t.PE_PARM_MAX=$e.PeDefs.prototype.PE_PARM_MAX,t.PE_TYPE_NONE=$e.PeDefs.prototype.PE_TYPE_NONE,t.PE_TYPE_GEOGCS=$e.PeDefs.prototype.PE_TYPE_GEOGCS,t.PE_TYPE_PROJCS=$e.PeDefs.prototype.PE_TYPE_PROJCS,t.PE_TYPE_GEOGTRAN=$e.PeDefs.prototype.PE_TYPE_GEOGTRAN,t.PE_TYPE_COORDSYS=$e.PeDefs.prototype.PE_TYPE_COORDSYS,t.PE_TYPE_UNIT=$e.PeDefs.prototype.PE_TYPE_UNIT,t.PE_TYPE_LINUNIT=$e.PeDefs.prototype.PE_TYPE_LINUNIT,t.PE_STR_OPTS_NONE=$e.PeDefs.prototype.PE_STR_OPTS_NONE,t.PE_STR_AUTH_NONE=$e.PeDefs.prototype.PE_STR_AUTH_NONE,t.PE_STR_AUTH_TOP=$e.PeDefs.prototype.PE_STR_AUTH_TOP,t.PE_STR_NAME_CANON=$e.PeDefs.prototype.PE_STR_NAME_CANON,t.PE_STR_FMT_WKT=$e.PeDefs.prototype.PE_STR_FMT_WKT,t.PE_STR_FMT_WKT2=$e.PeDefs.prototype.PE_STR_FMT_WKT2,t.PE_PARM_X0=$e.PeDefs.prototype.PE_PARM_X0,t.PE_PARM_ND=$e.PeDefs.prototype.PE_PARM_ND,t.PE_TRANSFORM_1_TO_2=$e.PeDefs.prototype.PE_TRANSFORM_1_TO_2,t.PE_TRANSFORM_2_TO_1=$e.PeDefs.prototype.PE_TRANSFORM_2_TO_1,t.PE_TRANSFORM_P_TO_G=$e.PeDefs.prototype.PE_TRANSFORM_P_TO_G,t.PE_TRANSFORM_G_TO_P=$e.PeDefs.prototype.PE_TRANSFORM_G_TO_P,t.PE_HORIZON_RECT=$e.PeDefs.prototype.PE_HORIZON_RECT,t.PE_HORIZON_POLY=$e.PeDefs.prototype.PE_HORIZON_POLY,t.PE_HORIZON_LINE=$e.PeDefs.prototype.PE_HORIZON_LINE,t.PE_HORIZON_DELTA=$e.PeDefs.prototype.PE_HORIZON_DELTA}t.init=e}(to||(to={})),function(t){const e={},i={},r=A=>{if(A){const M=A.getType();switch(M){case to.PE_TYPE_GEOGCS:A=$e.castObject(A,$e.PeGeogcs);break;case to.PE_TYPE_PROJCS:A=$e.castObject(A,$e.PeProjcs);break;case to.PE_TYPE_GEOGTRAN:A=$e.castObject(A,$e.PeGeogtran);break;default:M&to.PE_TYPE_UNIT&&(A=$e.castObject(A,$e.PeUnit))}}return A};function n(){$e.PeFactory.prototype.initialize(null)}function s(A){return o(to.PE_TYPE_COORDSYS,A)}function o(A,M){let I=null,L=e[A];if(L||(L={},e[A]=L),L.hasOwnProperty(String(M)))I=L[M];else{const F=$e.PeFactory.prototype.factoryByType(A,M);$e.compare(F,$e.NULL)||(I=F,L[M]=I)}return I=r(I),I}function l(A,M){let I=null,L=i[A];if(L||(L={},i[A]=L),L.hasOwnProperty(M))I=L[M];else{const F=$e.PeFactory.prototype.fromString(A,M);$e.compare(F,$e.NULL)||(I=F,L[M]=I)}return I=r(I),I}function c(A){return o(to.PE_TYPE_GEOGCS,A)}function f(A){return o(to.PE_TYPE_GEOGTRAN,A)}function _(A){return $e.PeFactory.prototype.getCode(A)}function x(A){return o(to.PE_TYPE_PROJCS,A)}function T(A){return o(to.PE_TYPE_UNIT,A)}t.initialize=n,t.coordsys=s,t.factoryByType=o,t.fromString=l,t.geogcs=c,t.geogtran=f,t.getCode=_,t.projcs=x,t.unit=T}(aL||(aL={}));let ICe=null;var Tz,IZ,$Z,lT,Nh,lL,h_,Ez,LZ;function $Ce(t){function e(s,o,l){s[o]=l(s[o])}$e=t,to.init(),Tz.init(),Nh.init(),h_.init(),Ez.init(),ICe=class extends $e.PeGCSExtent{destroy(){$e.destroy(this)}};const i=[$e.PeDatum,$e.PeGeogcs,$e.PeGeogtran,$e.PeObject,$e.PeParameter,$e.PePrimem,$e.PeProjcs,$e.PeSpheroid,$e.PeUnit];for(const s of i)e(s.prototype,"getName",o=>function(){return o.call(this,new Array(to.PE_NAME_MAX))});for(const s of[$e.PeGeogtran,$e.PeProjcs])e(s.prototype,"getParameters",o=>function(){const l=new Array(to.PE_PARM_MAX);let c=o.call(this);for(let f=0;ffunction(){const o=this.getSize();if(!o)return null;const l=[];return Bw(l,o,s.call(this)),l}),e($e.PeGTlistExtendedEntry.prototype,"getEntries",s=>{const o=$e._pe_getPeGTlistExtendedGTsSize();return function(){let l=null;const c=s.call(this);if(!$e.compare(c,$e.NULL)){l=[c];const f=this.getSteps();if(f>1){const _=$e.getPointer(c);for(let x=1;xfunction(){let o=this._cache;if(o||(o=new Map,this._cache=o),o.has(s))return o.get(s);let l=null;const c=s.call(this);if(!$e.compare(c,$e.NULL)){l=[c];const f=c.getNump();if(f>1){const _=$e.getPointer(c);for(let x=1;x{e.push(i[0],i[1])})):e=t,e}function Bw(t,e,i,r=!1){if(r)for(let n=0;n<2*e;n++)t[n]=$e.getValue(i+n*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=t.length===0;for(let s=0;s1)){const A=$e.getPointer(T);for(let M=1;M{g1(n);const s=n.getGeogtran();g1(s),s.getParameters().forEach(g1),[s.getGeogcs1(),s.getGeogcs2()].forEach(o=>{g1(o);const l=o.getDatum();g1(l),g1(l.getSpheroid()),g1(o.getPrimem()),g1(o.getUnit())})});$e.PeGTlistExtendedEntry.prototype.Delete(i[0])}}t.destroy=e}(IZ||(IZ={})),function(t){function e(i,r,n,s,o){$e.ensureCache.prepare();const l=SS(n),c=n===l,f=$e.ensureFloat64(l);let _=0;s&&(_=$e.ensureFloat64(s));const x=$e._pe_geog_to_geog($e.getPointer(i),r,f,_,o);return x&&Bw(n,r,f,c),x}t.geogToGeog=e}($Z||($Z={})),function(t){const e=(f,_,x,T,A,M)=>{let I,L;switch($e.ensureCache.prepare(),f){case"dd":I=$e._pe_geog_to_dd,L=to.PE_DD_MAX;break;case"ddm":I=$e._pe_geog_to_ddm,L=to.PE_DDM_MAX;break;case"dms":I=$e._pe_geog_to_dms,L=to.PE_DMS_MAX}let F=0;_&&(F=$e.getPointer(_));const z=SS(T),k=$e.ensureFloat64(z),U=k6(x,L),j=I(F,x,k,A,$e.ensureInt32(U));if(j)for(let H=0;H{let M;switch($e.ensureCache.prepare(),f){case"dd":M=$e._pe_dd_to_geog;break;case"ddm":M=$e._pe_ddm_to_geog;break;case"dms":M=$e._pe_dms_to_geog}let I=0;_&&(I=$e.getPointer(_));const L=T.map(U=>$e.ensureString(U)),F=$e.ensureInt32(L),z=$e.ensureFloat64(new Array(2*x)),k=M(I,x,F,z);return k&&Bw(A,x,z),k};function r(f,_,x,T,A){return e("dms",f,_,x,T,A)}function n(f,_,x,T){return i("dms",f,_,x,T)}function s(f,_,x,T,A){return e("ddm",f,_,x,T,A)}function o(f,_,x,T){return i("ddm",f,_,x,T)}function l(f,_,x,T,A){return e("dd",f,_,x,T,A)}function c(f,_,x,T){return i("dd",f,_,x,T)}t.geogToDms=r,t.dmsToGeog=n,t.geogToDdm=s,t.ddmToGeog=o,t.geogToDd=l,t.ddToGeog=c}(lT||(lT={})),function(t){function e(){t.PE_MGRS_STYLE_NEW=$e.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,t.PE_MGRS_STYLE_OLD=$e.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,t.PE_MGRS_STYLE_AUTO=$e.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,t.PE_MGRS_180_ZONE_1_PLUS=$e.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,t.PE_MGRS_ADD_SPACES=$e.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(n,s,o,l,c,f,_){$e.ensureCache.prepare();let x=0;n&&(x=$e.getPointer(n));const T=SS(o),A=$e.ensureFloat64(T),M=k6(s,to.PE_MGRS_MAX),I=$e.ensureInt32(M),L=$e._pe_geog_to_mgrs_extended(x,s,A,l,c,f,I);if(L)for(let F=0;F$e.ensureString(M)),x=$e.ensureInt32(_),T=$e.ensureFloat64(new Array(2*s)),A=$e._pe_mgrs_to_geog_extended(f,s,x,l,T);return A&&Bw(c,s,T),A}t.init=e,t.geogToMgrsExtended=i,t.mgrsToGeogExtended=r}(Nh||(Nh={})),function(t){function e(r,n,s,o,l,c,f){$e.ensureCache.prepare();let _=0;r&&(_=$e.getPointer(r));const x=SS(s),T=$e.ensureFloat64(x),A=k6(n,to.PE_MGRS_MAX),M=$e.ensureInt32(A),I=$e._pe_geog_to_usng(_,n,T,o,l,c,M);if(I)for(let L=0;L$e.ensureString(T)),f=$e.ensureInt32(c),_=$e.ensureFloat64(new Array(2*n)),x=$e._pe_usng_to_geog(l,n,f,_);return x&&Bw(o,n,_),x}t.geogToUsng=e,t.usngToGeog=i}(lL||(lL={})),function(t){function e(){t.PE_UTM_OPTS_NONE=$e.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,t.PE_UTM_OPTS_ADD_SPACES=$e.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,t.PE_UTM_OPTS_NS=$e.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(n,s,o,l,c){$e.ensureCache.prepare();let f=0;n&&(f=$e.getPointer(n));const _=SS(o),x=$e.ensureFloat64(_),T=k6(s,to.PE_UTM_MAX),A=$e.ensureInt32(T),M=$e._pe_geog_to_utm(f,s,x,l,A);if(M)for(let I=0;I$e.ensureString(M)),x=$e.ensureInt32(_),T=$e.ensureFloat64(new Array(2*s)),A=$e._pe_utm_to_geog(f,s,x,l,T);return A&&Bw(c,s,T),A}t.init=e,t.geogToUtm=i,t.utmToGeog=r}(h_||(h_={})),function(t){const e=new Map;function i(){t.PE_PCSINFO_OPTION_NONE=$e.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,t.PE_PCSINFO_OPTION_DOMAIN=$e.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,t.PE_POLE_OUTSIDE_BOUNDARY=$e.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,t.PE_POLE_POINT=$e.PePCSInfo.prototype.PE_POLE_POINT}function r(n,s=t.PE_PCSINFO_OPTION_DOMAIN){let o=null,l=null;return e.has(n)&&(l=e.get(n),l[s]&&(o=l[s])),o||(o=$e.PePCSInfo.prototype.generate(n,s),l||(l=[],e.set(n,l)),l[s]=o),o}t.init=i,t.generate=r}(Ez||(Ez={})),function(t){function e(){return $e.PeVersion.prototype.version_string()}t.versionString=e}(LZ||(LZ={}));const vKe=Object.freeze(Object.defineProperty({__proto__:null,get PeCSTransformations(){return RZ},get PeDefs(){return to},get PeFactory(){return aL},get PeGCSExtent(){return ICe},get PeGTTransformations(){return $Z},get PeGTlistExtended(){return Tz},get PeGTlistExtendedEntry(){return IZ},get PeNotationDms(){return lT},get PeNotationMgrs(){return Nh},get PeNotationUsng(){return lL},get PeNotationUtm(){return h_},get PePCSInfo(){return Ez},get PeVersion(){return LZ},_init:$Ce,get _pe(){return $e},isLoaded:PCe,isSupported:yKe,load:RCe},Symbol.toStringTag,{value:"Module"}));var wf;(function(t){t[t.CGCS2000=4490]="CGCS2000",t[t.GCSMARS2000=104971]="GCSMARS2000",t[t.GCSMARS2000_SPHERE=104905]="GCSMARS2000_SPHERE",t[t.GCSMOON2000=104903]="GCSMOON2000"})(wf||(wf={}));let P;const ae={values:[1,.3048,.3048006096012192,.3047972654,.9143917962,.201166195164,.9143984146160287,.3047994715386762,20.11676512155263,20.11678249437587,.9143985307444408,.91439523,.3047997101815088,20.1168,20.116756,5e4,15e4],units:["Meter","Foot","Foot_US","Foot_Clarke","Yard_Clarke","Link_Clarke","Yard_Sears","Foot_Sears","Chain_Sears","Chain_Benoit_1895_B","Yard_Indian","Yard_Indian_1937","Foot_Gold_Coast","Chain","Chain_Sears_1922_Truncated","50_Kilometers","150_Kilometers"],2066:5,2136:12,2155:2,2157:0,2158:0,2159:12,2160:12,2204:2,2219:0,2220:0,2254:2,2255:2,2256:1,2265:1,2266:1,2267:2,2268:2,2269:1,2270:1,2271:2,2272:2,2273:1,2294:0,2295:0,2314:3,2899:2,2900:2,2901:1,2909:1,2910:1,2911:2,2912:2,2913:1,2914:1,2992:1,2993:0,2994:1,3080:1,3089:2,3090:0,3091:2,3102:2,3141:0,3142:0,3167:14,3359:2,3360:0,3361:1,3362:0,3363:2,3364:0,3365:2,3366:3,3404:2,3405:0,3406:0,3407:3,3439:0,3440:0,3479:1,3480:0,3481:1,3482:0,3483:1,3484:0,3485:2,3486:0,3487:2,3488:0,3489:0,3490:2,3491:0,3492:2,3493:0,3494:2,3495:0,3496:2,3497:0,3498:2,3499:0,3500:2,3501:0,3502:2,3503:0,3504:2,3505:0,3506:2,3507:0,3508:2,3509:0,3510:2,3511:0,3512:2,3513:0,3514:0,3515:2,3516:0,3517:2,3518:0,3519:2,3520:0,3521:2,3522:0,3523:2,3524:0,3525:2,3526:0,3527:2,3528:0,3529:2,3530:0,3531:2,3532:0,3533:2,3534:0,3535:2,3536:0,3537:2,3538:0,3539:2,3540:0,3541:2,3542:0,3543:2,3544:0,3545:2,3546:0,3547:2,3548:0,3549:2,3550:0,3551:2,3552:0,3553:2,3582:2,3583:0,3584:2,3585:0,3586:2,3587:0,3588:1,3589:0,3590:1,3591:0,3592:0,3593:1,3598:2,3599:0,3600:2,3605:1,3606:0,3607:0,3608:2,3609:0,3610:2,3611:0,3612:2,3613:0,3614:2,3615:0,3616:2,3617:0,3618:2,3619:0,3620:2,3621:0,3622:2,3623:0,3624:2,3625:0,3626:2,3627:0,3628:2,3629:0,3630:2,3631:0,3632:2,3633:0,3634:1,3635:0,3636:1,3640:2,3641:0,3642:2,3643:0,3644:1,3645:0,3646:1,3647:0,3648:1,3649:0,3650:2,3651:0,3652:2,3653:0,3654:2,3655:0,3656:1,3657:0,3658:2,3659:0,3660:2,3661:0,3662:2,3663:0,3664:2,3668:2,3669:0,3670:2,3671:0,3672:2,3673:0,3674:2,3675:0,3676:1,3677:2,3678:0,3679:1,3680:2,3681:0,3682:1,3683:2,3684:0,3685:0,3686:2,3687:0,3688:2,3689:0,3690:2,3691:0,3692:2,3696:2,3697:0,3698:2,3699:0,3700:2,3793:0,3794:0,3812:0,3854:0,3857:0,3920:0,3978:0,3979:0,3991:2,3992:2,4026:0,4037:0,4038:0,4071:0,4082:0,4083:0,4087:0,4088:0,4217:2,4414:0,4415:0,4417:0,4434:0,4437:0,4438:2,4439:2,4462:0,4467:0,4471:0,4474:0,4559:0,4647:0,4822:0,4826:0,4839:0,5018:0,5041:0,5042:0,5048:0,5221:0,5223:0,5234:0,5235:0,5243:0,5247:0,5266:0,5316:0,5320:0,5321:0,5325:0,5337:0,5361:0,5362:0,5367:0,5382:0,5383:0,5396:0,5456:0,5457:0,5469:0,5472:4,5490:0,5513:0,5514:0,5523:0,5559:0,5588:1,5589:3,5596:0,5627:0,5629:0,5641:0,5643:0,5644:0,5646:2,5654:2,5655:2,5659:0,5700:0,5825:0,5836:0,5837:0,5839:0,5842:0,5844:0,5858:0,5879:0,5880:0,5887:0,5890:0,6128:1,6129:1,6141:1,6204:0,6210:0,6211:0,6307:0,6312:0,6316:0,6362:0,6391:1,6405:1,6406:0,6407:1,6408:0,6409:1,6410:0,6411:2,6412:0,6413:2,6414:0,6415:0,6416:2,6417:0,6418:2,6419:0,6420:2,6421:0,6422:2,6423:0,6424:2,6425:0,6426:2,6427:0,6428:2,6429:0,6430:2,6431:0,6432:2,6433:0,6434:2,6435:0,6436:2,6437:0,6438:2,6439:0,6440:0,6441:2,6442:0,6443:2,6444:0,6445:2,6446:0,6447:2,6448:0,6449:2,6450:0,6451:2,6452:0,6453:2,6454:0,6455:2,6456:0,6457:2,6458:0,6459:2,6460:0,6461:2,6462:0,6463:2,6464:0,6465:2,6466:0,6467:2,6468:0,6469:2,6470:0,6471:2,6472:0,6473:2,6474:0,6475:2,6476:0,6477:2,6478:0,6479:2,6484:2,6485:0,6486:2,6487:0,6488:2,6489:0,6490:2,6491:0,6492:2,6493:0,6494:1,6495:0,6496:1,6497:0,6498:0,6499:1,6500:0,6501:2,6502:0,6503:2,6504:0,6505:2,6506:0,6507:2,6508:0,6509:0,6510:2,6515:1,6516:0,6518:0,6519:2,6520:0,6521:2,6522:0,6523:2,6524:0,6525:2,6526:0,6527:2,6528:0,6529:2,6530:0,6531:2,6532:0,6533:2,6534:0,6535:2,6536:0,6537:2,6538:0,6539:2,6540:0,6541:2,6542:0,6543:2,6544:0,6545:1,6546:0,6547:1,6548:0,6549:2,6550:0,6551:2,6552:0,6553:2,6554:0,6555:2,6556:0,6557:1,6558:0,6559:1,6560:0,6561:1,6562:0,6563:2,6564:0,6565:2,6566:0,6567:0,6568:2,6569:0,6570:1,6571:0,6572:2,6573:0,6574:2,6575:0,6576:2,6577:0,6578:2,6582:2,6583:0,6584:2,6585:0,6586:2,6587:0,6588:2,6589:0,6590:2,6591:0,6592:0,6593:2,6594:0,6595:2,6596:0,6597:2,6598:0,6599:2,6600:0,6601:2,6602:0,6603:2,6605:2,6606:0,6607:2,6608:0,6609:2,6610:0,6611:0,6612:2,6613:0,6614:2,6615:0,6616:2,6617:0,6618:2,6633:2,6646:0,6703:0,6784:0,6785:1,6786:0,6787:1,6788:0,6789:1,6790:0,6791:1,6792:0,6793:1,6794:0,6795:1,6796:0,6797:1,6798:0,6799:1,6800:0,6801:1,6802:0,6803:1,6804:0,6805:1,6806:0,6807:1,6808:0,6809:1,6810:0,6811:1,6812:0,6813:1,6814:0,6815:1,6816:0,6817:1,6818:0,6819:1,6820:0,6821:1,6822:0,6823:1,6824:0,6825:1,6826:0,6827:1,6828:0,6829:1,6830:0,6831:1,6832:0,6833:1,6834:0,6835:1,6836:0,6837:1,6838:0,6839:1,6840:0,6841:1,6842:0,6843:1,6844:0,6845:1,6846:0,6847:1,6848:0,6849:1,6850:0,6851:1,6852:0,6853:1,6854:0,6855:1,6856:0,6857:1,6858:0,6859:1,6860:0,6861:1,6862:0,6863:1,6867:0,6868:1,6870:0,6875:0,6876:0,6879:0,6880:2,6884:0,6885:1,6886:0,6887:1,6915:0,6922:0,6923:2,6924:0,6925:2,6962:0,6984:0,6991:0,7128:2,7131:0,7132:2,7142:0,7257:0,7258:2,7259:0,7260:2,7261:0,7262:2,7263:0,7264:2,7265:0,7266:2,7267:0,7268:2,7269:0,7270:2,7271:0,7272:2,7273:0,7274:2,7275:0,7276:2,7277:0,7278:2,7279:0,7280:2,7281:0,7282:2,7283:0,7284:2,7285:0,7286:2,7287:0,7288:2,7289:0,7290:2,7291:0,7292:2,7293:0,7294:2,7295:0,7296:2,7297:0,7298:2,7299:0,7300:2,7301:0,7302:2,7303:0,7304:2,7305:0,7306:2,7307:0,7308:2,7309:0,7310:2,7311:0,7312:2,7313:0,7314:2,7315:0,7316:2,7317:0,7318:2,7319:0,7320:2,7321:0,7322:2,7323:0,7324:2,7325:0,7326:2,7327:0,7328:2,7329:0,7330:2,7331:0,7332:2,7333:0,7334:2,7335:0,7336:2,7337:0,7338:2,7339:0,7340:2,7341:0,7342:2,7343:0,7344:2,7345:0,7346:2,7347:0,7348:2,7349:0,7350:2,7351:0,7352:2,7353:0,7354:2,7355:0,7356:2,7357:0,7358:2,7359:0,7360:2,7361:0,7362:2,7363:0,7364:2,7365:0,7366:2,7367:0,7368:2,7369:0,7370:2,7877:0,7878:0,7882:0,7883:0,7887:0,7899:0,7991:0,7992:0,8035:2,8036:2,8058:0,8059:0,8082:0,8083:0,8088:0,8090:0,8091:2,8092:0,8093:2,8095:0,8096:2,8097:0,8098:2,8099:0,8100:2,8101:0,8102:2,8103:0,8104:2,8105:0,8106:2,8107:0,8108:2,8109:0,8110:2,8111:0,8112:2,8113:0,8114:2,8115:0,8116:2,8117:0,8118:2,8119:0,8120:2,8121:0,8122:2,8123:0,8124:2,8125:0,8126:2,8127:0,8128:2,8129:0,8130:2,8131:0,8132:2,8133:0,8134:2,8135:0,8136:2,8137:0,8138:2,8139:0,8140:2,8141:0,8142:2,8143:0,8144:2,8145:0,8146:2,8147:0,8148:2,8149:0,8150:2,8151:0,8152:2,8153:0,8154:2,8155:0,8156:2,8157:0,8158:2,8159:0,8160:2,8161:0,8162:2,8163:0,8164:2,8165:0,8166:2,8167:0,8168:2,8169:0,8170:2,8171:0,8172:2,8173:0,8177:2,8179:0,8180:2,8181:0,8182:2,8184:0,8185:2,8187:0,8189:2,8191:0,8193:2,8196:0,8197:2,8198:0,8200:2,8201:0,8202:2,8203:0,8204:2,8205:0,8206:2,8207:0,8208:2,8209:0,8210:2,8212:0,8213:2,8214:0,8216:2,8218:0,8220:2,8222:0,8224:2,8225:0,8226:2,8311:0,8312:1,8313:0,8314:1,8315:0,8316:1,8317:0,8318:1,8319:0,8320:1,8321:0,8322:1,8323:0,8324:1,8325:0,8326:1,8327:0,8328:1,8329:0,8330:1,8331:0,8332:1,8333:0,8334:1,8335:0,8336:1,8337:0,8338:1,8339:0,8340:1,8341:0,8342:1,8343:0,8344:1,8345:0,8346:1,8347:0,8348:1,8352:0,8353:0,8379:0,8380:2,8381:0,8382:2,8383:0,8384:2,8385:0,8387:2,8391:0,8395:0,8433:0,8441:0,8455:0,8456:0,8531:2,8682:0,8686:0,8687:0,8692:0,8693:0,8826:0,8903:0,8950:0,8951:0,9039:0,9040:0,9141:0,9149:0,9150:0,9191:0,9221:0,9222:0,9249:0,9250:0,9252:0,9254:0,9265:0,9284:0,9285:0,9300:0,9354:0,9367:0,9373:0,9377:0,9387:0,9391:0,9456:0,9473:0,9498:0,9674:0,9678:0,9680:0,9709:0,9712:0,9713:0,9716:0,9741:0,9748:2,9749:2,9761:0,9766:0,9793:0,9794:0,9869:0,9874:0,9875:0,9880:0,9895:0,9943:0,9945:0,9947:0,9967:0,9972:0,9977:0,10160:0,10183:0,10188:0,10194:0,10199:0,10207:0,10212:0,10217:0,10222:0,10227:0,10235:0,10240:0,10250:0,10254:0,10270:0,10275:0,10280:0,10306:0,10329:0,10471:0,20002:0,20042:0,20050:1,20499:0,20538:0,20539:0,20790:0,20791:0,21291:0,21292:0,21500:0,21817:0,21818:0,22032:0,22033:0,22091:0,22092:0,22239:0,22240:0,22332:0,22337:0,22338:0,22391:0,22392:0,22639:0,22700:0,22739:0,22770:0,22780:0,22832:0,23090:0,23095:0,23239:0,23240:0,23433:0,23700:0,24047:0,24048:0,24100:3,24200:0,24305:0,24306:0,24382:10,24383:0,24500:0,24547:0,24548:0,24571:9,24600:0,25e3:0,25231:0,25884:0,25932:0,26237:0,26331:0,26332:0,26432:0,26591:0,26592:0,26632:0,26692:0,27120:0,27200:0,27291:6,27292:6,27429:0,27492:0,27493:0,27500:0,27700:0,28232:0,28600:0,28991:0,28992:0,29100:0,29101:0,29220:0,29221:0,29333:0,29635:0,29636:0,29701:0,29738:0,29739:0,29849:0,29850:0,29871:8,29872:7,29873:0,29874:0,30200:5,30339:0,30340:0,30591:0,30592:0,30791:0,30792:0,30800:0,31028:0,31121:0,31154:0,31170:0,31171:0,31370:0,31528:0,31529:0,31600:0,31700:0,31838:0,31839:0,31900:0,31901:0,32061:0,32062:0,32098:0,32099:2,32100:0,32104:0,32161:0,32766:0,53048:0,53049:0,54090:0,54091:0,65061:2,65062:2,65161:0,65163:0,102041:2,102064:11,102068:15,102069:16,102118:2,102119:1,102120:2,102121:2,102217:2,102218:0,102219:2,102220:2,102378:1,102379:1,102380:0,102381:1,102589:2,102599:2,102600:2,102604:2,102647:0,102704:2,102705:2,102706:0,102731:0,102732:0,102759:1,102760:1,102761:2,102762:0,102763:2,102764:0,102765:0,102766:2,102970:1,102974:2,102993:0,102994:0,102995:2,102996:2,103015:0,103016:2,103017:0,103018:2,103025:0,103026:0,103027:2,103028:2,103035:0,103036:0,103037:2,103038:2,103039:0,103040:0,103041:2,103042:2,103043:0,103044:0,103045:2,103046:2,103047:0,103048:0,103049:2,103050:2,103051:0,103052:2,103053:0,103054:2,103055:0,103056:2,103057:0,103058:0,103059:2,103060:2,103061:0,103062:0,103063:2,103064:2,103069:2,103070:0,103071:0,103072:2,103073:2,103086:0,103087:0,103088:2,103089:2,103094:1,103095:0,103096:2,103103:0,103104:2,103105:0,103106:2,103121:0,103122:2,103123:0,103124:0,103125:1,103126:1,103127:0,103128:0,103129:2,103130:2,103131:0,103132:0,103133:2,103134:2,103135:0,103136:0,103137:1,103138:1,103139:0,103140:2,103141:0,103142:2,103143:0,103144:2,103145:0,103146:1,103147:0,103148:0,103149:2,103150:2,103151:0,103152:2,103172:0,103173:2,103174:0,103175:0,103176:2,103177:2,103178:0,103179:0,103180:2,103181:2,103182:0,103183:0,103184:2,103185:2,103228:0,103229:0,103230:2,103231:2,103250:0,103251:2,103252:0,103253:2,103260:0,103261:0,103262:2,103263:2,103270:0,103271:0,103272:2,103273:2,103274:0,103275:0,103276:2,103277:2,103278:0,103279:0,103280:2,103281:2,103282:0,103283:0,103284:2,103285:2,103286:0,103287:2,103288:0,103289:2,103290:0,103291:2,103292:0,103293:0,103294:2,103295:2,103296:0,103297:0,103298:2,103299:2,103376:2,103377:0,103378:0,103379:2,103380:2,103393:0,103394:0,103395:2,103396:2,103472:0,103473:1,103474:0,103475:2,103482:0,103483:2,103484:0,103485:2,103500:0,103501:2,103502:0,103503:0,103504:1,103505:1,103506:0,103507:0,103508:2,103509:2,103510:0,103511:0,103512:2,103513:2,103514:0,103515:2,103516:0,103517:2,103518:0,103519:2,103520:0,103521:1,103522:0,103523:0,103524:2,103525:2,103526:0,103527:2,103561:2,103562:2,103563:0,103564:0,103565:2,103566:2,103567:0,103568:0,103569:2,103570:2,103584:0,103585:2,103586:0,103587:2,103588:1,103589:0,103590:2,103591:1,103592:0,103593:2,103594:1,103695:2,103897:1};for(P=2e3;P<=2045;P++)ae[P]=0;for(P=2056;P<=2065;P++)ae[P]=0;for(P=2067;P<=2135;P++)ae[P]=0;for(P=2137;P<=2154;P++)ae[P]=0;for(P=2161;P<=2170;P++)ae[P]=0;for(P=2172;P<=2193;P++)ae[P]=0;for(P=2195;P<=2198;P++)ae[P]=0;for(P=2200;P<=2203;P++)ae[P]=0;for(P=2205;P<=2217;P++)ae[P]=0;for(P=2222;P<=2224;P++)ae[P]=1;for(P=2225;P<=2250;P++)ae[P]=2;for(P=2251;P<=2253;P++)ae[P]=1;for(P=2257;P<=2264;P++)ae[P]=2;for(P=2274;P<=2279;P++)ae[P]=2;for(P=2280;P<=2282;P++)ae[P]=1;for(P=2283;P<=2289;P++)ae[P]=2;for(P=2290;P<=2292;P++)ae[P]=0;for(P=2308;P<=2313;P++)ae[P]=0;for(P=2315;P<=2491;P++)ae[P]=0;for(P=2494;P<=2866;P++)ae[P]=0;for(P=2867;P<=2869;P++)ae[P]=1;for(P=2870;P<=2888;P++)ae[P]=2;for(P=2891;P<=2895;P++)ae[P]=2;for(P=2896;P<=2898;P++)ae[P]=1;for(P=2902;P<=2908;P++)ae[P]=2;for(P=2915;P<=2920;P++)ae[P]=2;for(P=2921;P<=2923;P++)ae[P]=1;for(P=2924;P<=2930;P++)ae[P]=2;for(P=2931;P<=2962;P++)ae[P]=0;for(P=2964;P<=2968;P++)ae[P]=2;for(P=2969;P<=2973;P++)ae[P]=0;for(P=2975;P<=2991;P++)ae[P]=0;for(P=2995;P<=3051;P++)ae[P]=0;for(P=3054;P<=3079;P++)ae[P]=0;for(P=3081;P<=3088;P++)ae[P]=0;for(P=3092;P<=3101;P++)ae[P]=0;for(P=3106;P<=3138;P++)ae[P]=0;for(P=3146;P<=3151;P++)ae[P]=0;for(P=3153;P<=3166;P++)ae[P]=0;for(P=3168;P<=3172;P++)ae[P]=0;for(P=3174;P<=3203;P++)ae[P]=0;for(P=3294;P<=3358;P++)ae[P]=0;for(P=3367;P<=3403;P++)ae[P]=0;for(P=3408;P<=3416;P++)ae[P]=0;for(P=3417;P<=3438;P++)ae[P]=2;for(P=3441;P<=3446;P++)ae[P]=2;for(P=3447;P<=3450;P++)ae[P]=0;for(P=3451;P<=3459;P++)ae[P]=2;for(P=3460;P<=3478;P++)ae[P]=0;for(P=3554;P<=3559;P++)ae[P]=0;for(P=3560;P<=3570;P++)ae[P]=2;for(P=3571;P<=3581;P++)ae[P]=0;for(P=3594;P<=3597;P++)ae[P]=0;for(P=3601;P<=3604;P++)ae[P]=0;for(P=3637;P<=3639;P++)ae[P]=0;for(P=3665;P<=3667;P++)ae[P]=0;for(P=3693;P<=3695;P++)ae[P]=0;for(P=3701;P<=3727;P++)ae[P]=0;for(P=3728;P<=3739;P++)ae[P]=2;for(P=3740;P<=3751;P++)ae[P]=0;for(P=3753;P<=3760;P++)ae[P]=2;for(P=3761;P<=3773;P++)ae[P]=0;for(P=3775;P<=3777;P++)ae[P]=0;for(P=3779;P<=3781;P++)ae[P]=0;for(P=3783;P<=3785;P++)ae[P]=0;for(P=3788;P<=3791;P++)ae[P]=0;for(P=3797;P<=3802;P++)ae[P]=0;for(P=3814;P<=3816;P++)ae[P]=0;for(P=3825;P<=3829;P++)ae[P]=0;for(P=3832;P<=3841;P++)ae[P]=0;for(P=3844;P<=3852;P++)ae[P]=0;for(P=3873;P<=3885;P++)ae[P]=0;for(P=3890;P<=3893;P++)ae[P]=0;for(P=3907;P<=3912;P++)ae[P]=0;for(P=3942;P<=3950;P++)ae[P]=0;for(P=3968;P<=3970;P++)ae[P]=0;for(P=3973;P<=3976;P++)ae[P]=0;for(P=3986;P<=3989;P++)ae[P]=0;for(P=3994;P<=3997;P++)ae[P]=0;for(P=4048;P<=4051;P++)ae[P]=0;for(P=4056;P<=4063;P++)ae[P]=0;for(P=4093;P<=4096;P++)ae[P]=0;for(P=4390;P<=4398;P++)ae[P]=0;for(P=4399;P<=4413;P++)ae[P]=2;for(P=4418;P<=4433;P++)ae[P]=2;for(P=4455;P<=4457;P++)ae[P]=2;for(P=4484;P<=4489;P++)ae[P]=0;for(P=4491;P<=4554;P++)ae[P]=0;for(P=4568;P<=4589;P++)ae[P]=0;for(P=4652;P<=4656;P++)ae[P]=0;for(P=4766;P<=4800;P++)ae[P]=0;for(P=5014;P<=5016;P++)ae[P]=0;for(P=5069;P<=5072;P++)ae[P]=0;for(P=5105;P<=5130;P++)ae[P]=0;for(P=5167;P<=5188;P++)ae[P]=0;for(P=5253;P<=5259;P++)ae[P]=0;for(P=5269;P<=5275;P++)ae[P]=0;for(P=5292;P<=5311;P++)ae[P]=0;for(P=5329;P<=5331;P++)ae[P]=0;for(P=5343;P<=5349;P++)ae[P]=0;for(P=5355;P<=5357;P++)ae[P]=0;for(P=5387;P<=5389;P++)ae[P]=0;for(P=5459;P<=5463;P++)ae[P]=0;for(P=5479;P<=5482;P++)ae[P]=0;for(P=5518;P<=5520;P++)ae[P]=0;for(P=5530;P<=5539;P++)ae[P]=0;for(P=5550;P<=5552;P++)ae[P]=0;for(P=5562;P<=5583;P++)ae[P]=0;for(P=5623;P<=5625;P++)ae[P]=2;for(P=5631;P<=5639;P++)ae[P]=0;for(P=5649;P<=5653;P++)ae[P]=0;for(P=5663;P<=5680;P++)ae[P]=0;for(P=5682;P<=5685;P++)ae[P]=0;for(P=5875;P<=5877;P++)ae[P]=0;for(P=5896;P<=5899;P++)ae[P]=0;for(P=5921;P<=5940;P++)ae[P]=0;for(P=6050;P<=6125;P++)ae[P]=0;for(P=6244;P<=6275;P++)ae[P]=0;for(P=6328;P<=6348;P++)ae[P]=0;for(P=6350;P<=6356;P++)ae[P]=0;for(P=6366;P<=6372;P++)ae[P]=0;for(P=6381;P<=6387;P++)ae[P]=0;for(P=6393;P<=6404;P++)ae[P]=0;for(P=6480;P<=6483;P++)ae[P]=0;for(P=6511;P<=6514;P++)ae[P]=0;for(P=6579;P<=6581;P++)ae[P]=0;for(P=6619;P<=6624;P++)ae[P]=0;for(P=6625;P<=6627;P++)ae[P]=2;for(P=6628;P<=6632;P++)ae[P]=0;for(P=6634;P<=6637;P++)ae[P]=0;for(P=6669;P<=6692;P++)ae[P]=0;for(P=6707;P<=6709;P++)ae[P]=0;for(P=6720;P<=6723;P++)ae[P]=0;for(P=6732;P<=6738;P++)ae[P]=0;for(P=6931;P<=6933;P++)ae[P]=0;for(P=6956;P<=6959;P++)ae[P]=0;for(P=7005;P<=7007;P++)ae[P]=0;for(P=7057;P<=7070;P++)ae[P]=2;for(P=7074;P<=7082;P++)ae[P]=0;for(P=7109;P<=7118;P++)ae[P]=0;for(P=7119;P<=7127;P++)ae[P]=1;for(P=7374;P<=7376;P++)ae[P]=0;for(P=7528;P<=7586;P++)ae[P]=0;for(P=7587;P<=7645;P++)ae[P]=2;for(P=7692;P<=7696;P++)ae[P]=0;for(P=7755;P<=7787;P++)ae[P]=0;for(P=7791;P<=7795;P++)ae[P]=0;for(P=7799;P<=7801;P++)ae[P]=0;for(P=7803;P<=7805;P++)ae[P]=0;for(P=7825;P<=7831;P++)ae[P]=0;for(P=7845;P<=7859;P++)ae[P]=0;for(P=8013;P<=8032;P++)ae[P]=0;for(P=8065;P<=8068;P++)ae[P]=1;for(P=8518;P<=8529;P++)ae[P]=2;for(P=8533;P<=8536;P++)ae[P]=2;for(P=8538;P<=8540;P++)ae[P]=2;for(P=8677;P<=8679;P++)ae[P]=0;for(P=8836;P<=8840;P++)ae[P]=0;for(P=8857;P<=8859;P++)ae[P]=0;for(P=8908;P<=8910;P++)ae[P]=0;for(P=9154;P<=9159;P++)ae[P]=0;for(P=9205;P<=9218;P++)ae[P]=0;for(P=9271;P<=9273;P++)ae[P]=0;for(P=9295;P<=9297;P++)ae[P]=0;for(P=9356;P<=9360;P++)ae[P]=0;for(P=9404;P<=9407;P++)ae[P]=0;for(P=9476;P<=9482;P++)ae[P]=0;for(P=9487;P<=9494;P++)ae[P]=0;for(P=9697;P<=9699;P++)ae[P]=0;for(P=9821;P<=9865;P++)ae[P]=0;for(P=10285;P<=10291;P++)ae[P]=0;for(P=10314;P<=10317;P++)ae[P]=0;for(P=10448;P<=10465;P++)ae[P]=0;for(P=11114;P<=11118;P++)ae[P]=0;for(P=20004;P<=20032;P++)ae[P]=0;for(P=20047;P<=20049;P++)ae[P]=0;for(P=20062;P<=20092;P++)ae[P]=0;for(P=20135;P<=20138;P++)ae[P]=0;for(P=20248;P<=20258;P++)ae[P]=0;for(P=20348;P<=20358;P++)ae[P]=0;for(P=20436;P<=20440;P++)ae[P]=0;for(P=20822;P<=20824;P++)ae[P]=0;for(P=20904;P<=20932;P++)ae[P]=0;for(P=20934;P<=20936;P++)ae[P]=0;for(P=21004;P<=21032;P++)ae[P]=0;for(P=21035;P<=21037;P++)ae[P]=0;for(P=21095;P<=21097;P++)ae[P]=0;for(P=21148;P<=21150;P++)ae[P]=0;for(P=21207;P<=21264;P++)ae[P]=0;for(P=21307;P<=21364;P++)ae[P]=0;for(P=21413;P<=21423;P++)ae[P]=0;for(P=21453;P<=21463;P++)ae[P]=0;for(P=21473;P<=21483;P++)ae[P]=0;for(P=21780;P<=21782;P++)ae[P]=0;for(P=21891;P<=21894;P++)ae[P]=0;for(P=21896;P<=21899;P++)ae[P]=0;for(P=22171;P<=22177;P++)ae[P]=0;for(P=22181;P<=22187;P++)ae[P]=0;for(P=22191;P<=22197;P++)ae[P]=0;for(P=22207;P<=22222;P++)ae[P]=0;for(P=22229;P<=22232;P++)ae[P]=0;for(P=22234;P<=22236;P++)ae[P]=0;for(P=22243;P<=22250;P++)ae[P]=0;for(P=22262;P<=22265;P++)ae[P]=0;for(P=22307;P<=22322;P++)ae[P]=0;for(P=22348;P<=22357;P++)ae[P]=0;for(P=22407;P<=22422;P++)ae[P]=0;for(P=22462;P<=22465;P++)ae[P]=0;for(P=22521;P<=22525;P++)ae[P]=0;for(P=22607;P<=22622;P++)ae[P]=0;for(P=22641;P<=22646;P++)ae[P]=0;for(P=22648;P<=22657;P++)ae[P]=0;for(P=22707;P<=22722;P++)ae[P]=0;for(P=22762;P<=22765;P++)ae[P]=0;for(P=22807;P<=22822;P++)ae[P]=0;for(P=22991;P<=22994;P++)ae[P]=0;for(P=23028;P<=23038;P++)ae[P]=0;for(P=23301;P<=23333;P++)ae[P]=2;for(P=23830;P<=23853;P++)ae[P]=0;for(P=23866;P<=23872;P++)ae[P]=0;for(P=23877;P<=23884;P++)ae[P]=0;for(P=23886;P<=23894;P++)ae[P]=0;for(P=23946;P<=23948;P++)ae[P]=0;for(P=24311;P<=24313;P++)ae[P]=0;for(P=24342;P<=24347;P++)ae[P]=0;for(P=24370;P<=24374;P++)ae[P]=10;for(P=24375;P<=24381;P++)ae[P]=0;for(P=24718;P<=24721;P++)ae[P]=0;for(P=24817;P<=24821;P++)ae[P]=0;for(P=24877;P<=24882;P++)ae[P]=0;for(P=24891;P<=24893;P++)ae[P]=0;for(P=25391;P<=25395;P++)ae[P]=0;for(P=25828;P<=25838;P++)ae[P]=0;for(P=26191;P<=26195;P++)ae[P]=0;for(P=26391;P<=26393;P++)ae[P]=0;for(P=26701;P<=26722;P++)ae[P]=0;for(P=26729;P<=26799;P++)ae[P]=2;for(P=26801;P<=26803;P++)ae[P]=2;for(P=26811;P<=26813;P++)ae[P]=2;for(P=26847;P<=26870;P++)ae[P]=2;for(P=26891;P<=26899;P++)ae[P]=0;for(P=26901;P<=26923;P++)ae[P]=0;for(P=26929;P<=26946;P++)ae[P]=0;for(P=26948;P<=26998;P++)ae[P]=0;for(P=27037;P<=27040;P++)ae[P]=0;for(P=27205;P<=27232;P++)ae[P]=0;for(P=27258;P<=27260;P++)ae[P]=0;for(P=27391;P<=27398;P++)ae[P]=0;for(P=27561;P<=27564;P++)ae[P]=0;for(P=27571;P<=27574;P++)ae[P]=0;for(P=27581;P<=27584;P++)ae[P]=0;for(P=27591;P<=27594;P++)ae[P]=0;for(P=28191;P<=28193;P++)ae[P]=0;for(P=28348;P<=28358;P++)ae[P]=0;for(P=28402;P<=28432;P++)ae[P]=0;for(P=28462;P<=28492;P++)ae[P]=0;for(P=29118;P<=29122;P++)ae[P]=0;for(P=29168;P<=29172;P++)ae[P]=0;for(P=29177;P<=29185;P++)ae[P]=0;for(P=29187;P<=29195;P++)ae[P]=0;for(P=29900;P<=29903;P++)ae[P]=0;for(P=30161;P<=30179;P++)ae[P]=0;for(P=30491;P<=30494;P++)ae[P]=0;for(P=30729;P<=30732;P++)ae[P]=0;for(P=31251;P<=31259;P++)ae[P]=0;for(P=31265;P<=31268;P++)ae[P]=0;for(P=31275;P<=31279;P++)ae[P]=0;for(P=31281;P<=31297;P++)ae[P]=0;for(P=31461;P<=31469;P++)ae[P]=0;for(P=31491;P<=31495;P++)ae[P]=0;for(P=31917;P<=31922;P++)ae[P]=0;for(P=31965;P<=32e3;P++)ae[P]=0;for(P=32001;P<=32003;P++)ae[P]=2;for(P=32005;P<=32031;P++)ae[P]=2;for(P=32033;P<=32060;P++)ae[P]=2;for(P=32064;P<=32067;P++)ae[P]=2;for(P=32074;P<=32077;P++)ae[P]=2;for(P=32081;P<=32086;P++)ae[P]=0;for(P=32107;P<=32130;P++)ae[P]=0;for(P=32133;P<=32159;P++)ae[P]=0;for(P=32164;P<=32167;P++)ae[P]=2;for(P=32180;P<=32199;P++)ae[P]=0;for(P=32201;P<=32260;P++)ae[P]=0;for(P=32301;P<=32360;P++)ae[P]=0;for(P=32401;P<=32460;P++)ae[P]=0;for(P=32501;P<=32560;P++)ae[P]=0;for(P=32601;P<=32662;P++)ae[P]=0;for(P=32664;P<=32667;P++)ae[P]=2;for(P=32701;P<=32761;P++)ae[P]=0;for(P=53001;P<=53004;P++)ae[P]=0;for(P=53008;P<=53019;P++)ae[P]=0;for(P=53021;P<=53032;P++)ae[P]=0;for(P=53034;P<=53037;P++)ae[P]=0;for(P=53042;P<=53046;P++)ae[P]=0;for(P=53074;P<=53080;P++)ae[P]=0;for(P=54001;P<=54004;P++)ae[P]=0;for(P=54008;P<=54019;P++)ae[P]=0;for(P=54021;P<=54032;P++)ae[P]=0;for(P=54034;P<=54037;P++)ae[P]=0;for(P=54042;P<=54046;P++)ae[P]=0;for(P=54048;P<=54053;P++)ae[P]=0;for(P=54074;P<=54080;P++)ae[P]=0;for(P=54098;P<=54101;P++)ae[P]=0;for(P=102001;P<=102040;P++)ae[P]=0;for(P=102042;P<=102063;P++)ae[P]=0;for(P=102065;P<=102067;P++)ae[P]=0;for(P=102070;P<=102117;P++)ae[P]=0;for(P=102122;P<=102216;P++)ae[P]=0;for(P=102221;P<=102377;P++)ae[P]=0;for(P=102382;P<=102388;P++)ae[P]=0;for(P=102389;P<=102398;P++)ae[P]=2;for(P=102399;P<=102444;P++)ae[P]=0;for(P=102445;P<=102447;P++)ae[P]=2;for(P=102448;P<=102458;P++)ae[P]=0;for(P=102459;P<=102468;P++)ae[P]=2;for(P=102469;P<=102499;P++)ae[P]=0;for(P=102500;P<=102519;P++)ae[P]=1;for(P=102520;P<=102524;P++)ae[P]=0;for(P=102525;P<=102529;P++)ae[P]=2;for(P=102530;P<=102588;P++)ae[P]=0;for(P=102590;P<=102598;P++)ae[P]=0;for(P=102601;P<=102603;P++)ae[P]=0;for(P=102605;P<=102628;P++)ae[P]=0;for(P=102629;P<=102646;P++)ae[P]=2;for(P=102648;P<=102700;P++)ae[P]=2;for(P=102701;P<=102703;P++)ae[P]=0;for(P=102707;P<=102730;P++)ae[P]=2;for(P=102733;P<=102758;P++)ae[P]=2;for(P=102767;P<=102900;P++)ae[P]=0;for(P=102901;P<=102933;P++)ae[P]=2;for(P=102934;P<=102950;P++)ae[P]=13;for(P=102951;P<=102955;P++)ae[P]=0;for(P=102961;P<=102963;P++)ae[P]=0;for(P=102965;P<=102969;P++)ae[P]=0;for(P=102971;P<=102973;P++)ae[P]=0;for(P=102975;P<=102989;P++)ae[P]=0;for(P=102990;P<=102992;P++)ae[P]=1;for(P=102997;P<=103002;P++)ae[P]=0;for(P=103003;P<=103008;P++)ae[P]=2;for(P=103009;P<=103011;P++)ae[P]=0;for(P=103012;P<=103014;P++)ae[P]=2;for(P=103019;P<=103021;P++)ae[P]=0;for(P=103022;P<=103024;P++)ae[P]=2;for(P=103029;P<=103031;P++)ae[P]=0;for(P=103032;P<=103034;P++)ae[P]=2;for(P=103065;P<=103068;P++)ae[P]=0;for(P=103074;P<=103076;P++)ae[P]=0;for(P=103077;P<=103079;P++)ae[P]=1;for(P=103080;P<=103082;P++)ae[P]=0;for(P=103083;P<=103085;P++)ae[P]=2;for(P=103090;P<=103093;P++)ae[P]=0;for(P=103097;P<=103099;P++)ae[P]=0;for(P=103100;P<=103102;P++)ae[P]=2;for(P=103107;P<=103109;P++)ae[P]=0;for(P=103110;P<=103112;P++)ae[P]=2;for(P=103113;P<=103116;P++)ae[P]=0;for(P=103117;P<=103120;P++)ae[P]=2;for(P=103153;P<=103157;P++)ae[P]=0;for(P=103158;P<=103162;P++)ae[P]=2;for(P=103163;P<=103165;P++)ae[P]=0;for(P=103166;P<=103168;P++)ae[P]=1;for(P=103169;P<=103171;P++)ae[P]=2;for(P=103186;P<=103188;P++)ae[P]=0;for(P=103189;P<=103191;P++)ae[P]=2;for(P=103192;P<=103195;P++)ae[P]=0;for(P=103196;P<=103199;P++)ae[P]=2;for(P=103200;P<=103224;P++)ae[P]=0;for(P=103225;P<=103227;P++)ae[P]=1;for(P=103232;P<=103237;P++)ae[P]=0;for(P=103238;P<=103243;P++)ae[P]=2;for(P=103244;P<=103246;P++)ae[P]=0;for(P=103247;P<=103249;P++)ae[P]=2;for(P=103254;P<=103256;P++)ae[P]=0;for(P=103257;P<=103259;P++)ae[P]=2;for(P=103264;P<=103266;P++)ae[P]=0;for(P=103267;P<=103269;P++)ae[P]=2;for(P=103300;P<=103375;P++)ae[P]=0;for(P=103381;P<=103383;P++)ae[P]=0;for(P=103384;P<=103386;P++)ae[P]=1;for(P=103387;P<=103389;P++)ae[P]=0;for(P=103390;P<=103392;P++)ae[P]=2;for(P=103397;P<=103399;P++)ae[P]=0;for(P=103400;P<=103471;P++)ae[P]=2;for(P=103476;P<=103478;P++)ae[P]=0;for(P=103479;P<=103481;P++)ae[P]=2;for(P=103486;P<=103488;P++)ae[P]=0;for(P=103489;P<=103491;P++)ae[P]=2;for(P=103492;P<=103495;P++)ae[P]=0;for(P=103496;P<=103499;P++)ae[P]=2;for(P=103528;P<=103543;P++)ae[P]=0;for(P=103544;P<=103548;P++)ae[P]=2;for(P=103549;P<=103551;P++)ae[P]=0;for(P=103552;P<=103554;P++)ae[P]=1;for(P=103555;P<=103557;P++)ae[P]=2;for(P=103558;P<=103560;P++)ae[P]=0;for(P=103571;P<=103573;P++)ae[P]=0;for(P=103574;P<=103576;P++)ae[P]=2;for(P=103577;P<=103580;P++)ae[P]=0;for(P=103581;P<=103583;P++)ae[P]=2;for(P=103595;P<=103694;P++)ae[P]=0;for(P=103696;P<=103699;P++)ae[P]=0;for(P=103700;P<=103793;P++)ae[P]=2;for(P=103794;P<=103890;P++)ae[P]=0;for(P=103891;P<=103896;P++)ae[P]=2;for(P=103900;P<=103971;P++)ae[P]=2;for(P=103972;P<=103977;P++)ae[P]=0;for(P=112e3;P<=112101;P++)ae[P]=0;const _Ke={102113:!0,102100:!0,3857:!0,3785:!0},bKe={4326:!0,3785:!0,3857:!0,102113:!0,102100:!0,104905:!0,104971:!0},Fde='PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0]]',z6=[-20037508342788905e-9,20037508342788905e-9],U6=[-20037508342787e-6,20037508342787e-6],LCe={102113:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:z6,origin:U6,dx:1e-5},102100:{wkTemplate:Fde,valid:z6,origin:U6,dx:1e-5},3785:{wkTemplate:'PROJCS["WGS_1984_Web_Mercator",GEOGCS["GCS_WGS_1984_Major_Auxiliary_Sphere",DATUM["D_WGS_1984_Major_Auxiliary_Sphere",SPHEROID["WGS_1984_Major_Auxiliary_Sphere",6378137.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],PARAMETER["Standard_Parallel_1",0.0],UNIT["Meter",1.0]]',valid:z6,origin:U6,dx:1e-5},3857:{wkTemplate:Fde,valid:z6,origin:U6,dx:1e-5},4326:{wkTemplate:'GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",{Central_Meridian}],UNIT["Degree",0.0174532925199433]]',altTemplate:'PROJCS["WGS_1984_Plate_Carree",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Plate_Carree"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",{Central_Meridian}],UNIT["Degrees",111319.491]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104971:{wkTemplate:'GEOGCS["Mars_2000_(Sphere)",DATUM["Mars_2000_(Sphere)",SPHEROID["Mars_2000_(Sphere)",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5},104905:{wkTemplate:'GEOGCS["GCS_Mars_2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190.0,169.8944472236118]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]]',valid:[-180,180],origin:[-180,90],dx:1e-5}};function Zn(t,e){if(t===e)return!0;if(t==null||e==null)return!1;if(t.wkid!=null||e.wkid!=null)return t.wkid===e.wkid||LT(t)&<(e)||e.latestWkid!=null&&t.wkid===e.latestWkid||t.latestWkid!=null&&e.wkid===t.latestWkid;const i=t.wkt2??t.wkt,r=e.wkt2??e.wkt;return!(!i||!r)&&i.toUpperCase()===r.toUpperCase()}function pp(t){return wc(t)&&t.wkid&&LCe[t.wkid]||null}function Cz(t){if(!t)return;if(t.wkid)return String(t.wkid);const e=t.wkt||t.wkt2;return JSON.stringify(e?{wkt:e}:{})}function uB(t){if(!wc(t))return!1;if(t.wkid)return ae[t.wkid]==null;const e=t.wkt2||t.wkt;return!!e&&/^\s*(?:GEOGCS|GEOGCRS|GEOGRAPHICCRS)/i.test(e)}function VO(t){return!(r1(t)||n1(t))}function cL(t){return wc(t)&&t.wkid===4326}function PXt(t){return/^\s*(?:GEOD|GEODETIC|GEOG|GEOGRAPHIC|PROJ|PROJECTED|VERT|VERTICAL|ENG|ENGINEERING|PARAMETRIC|TIME|DERIVEDPROJ|COMPOUND|BOUND)CRS/i.test(t)}function DCe(t){return wc(t)&&t.wkid===wf.CGCS2000}function LT(t){return wc(t)&&t.wkid!=null&&_Ke[t.wkid]===!0}function uL(t){return wc(t)&&t.wkid===32662}function Gne(t){return t===wf.GCSMARS2000||t===wf.GCSMARS2000_SPHERE}function r1(t){return wc(t)&&t.wkid!=null&&Gne(t.wkid)}function Hne(t){return t===wf.GCSMOON2000}function n1(t){return wc(t)&&t.wkid!=null&&Hne(t.wkid)}function wKe(t){return wc(t)&&t.wkid!=null&&bKe[t.wkid]===!0}function wc(t){return t!=null&&(t.wkid!=null&&t.wkid>=2e3||t.wkt2!=null||t.wkt!=null)}const xKe={wkid:4326,wkt:h9(LCe[4326].wkTemplate,{Central_Meridian:"0.0"})},SKe={wkid:102100,latestWkid:3857},TKe={wkid:32662};function qne(t){return{wkt:`GEOCCS["Spherical geocentric", + DATUM["Not specified", + SPHEROID["Sphere",${t.radius},0]], + PRIMEM["Greenwich",0.0, + AUTHORITY["EPSG","8901"]], + UNIT["m",1.0], + AXIS["Geocentric X",OTHER], + AXIS["Geocentric Y",EAST], + AXIS["Geocentric Z",NORTH] + ]`}}const NCe=qne(Mr),hB=qne(Sy),dB=qne(u_),FCe={wkt:`GEOCCS["WGS 84", + DATUM["WGS_1984", + SPHEROID["WGS 84",${Mr.radius},298.257223563, + AUTHORITY["EPSG","7030"]], + AUTHORITY["EPSG","6326"]], + PRIMEM["Greenwich",0, + AUTHORITY["EPSG","8901"]], + UNIT["m",1.0, + AUTHORITY["EPSG","9001"]], + AXIS["Geocentric X",OTHER], + AXIS["Geocentric Y",OTHER], + AXIS["Geocentric Z",NORTH], + AUTHORITY["EPSG","4978"] +]`};function Sr(t){return t!=null&&(r1(t)||Zn(t,hB))?Sy:t!=null&&(n1(t)||Zn(t,dB))?u_:Mr}function RXt(t){return Gne(t)?Sy:Hne(t)?u_:Mr}function Az(t){return Zn(t,NCe)}function A2(t){return Az(t)||Zn(t,hB)||Zn(t,dB)}const Wne=39.37,EKe=Mr.radius*Math.PI/200,kCe=/(?:LENGTH)?UNIT\[([^\]]+)]]$/i,cT=ae,zCe=/UNIT\[([^\]]+)]/i,CKe=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),AKe=fu()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),Zm=t=>t*t,ib=t=>t*t*t,hL={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:Zm(.001)},"square-centimeters":{inBaseUnits:Zm(.01)},"square-decimeters":{inBaseUnits:Zm(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:Zm(1e3)},"square-inches":{inBaseUnits:Zm(.0254)},"square-feet":{inBaseUnits:Zm(.3048)},"square-yards":{inBaseUnits:Zm(.9144)},"square-miles":{inBaseUnits:Zm(1609.344)},"square-us-feet":{inBaseUnits:Zm(1200/3937)},acres:{inBaseUnits:.0015625*Zm(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*ib(.001)},"cubic-centimeters":{inBaseUnits:1e3*ib(.01)},"cubic-decimeters":{inBaseUnits:1e3*ib(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*ib(1e3)},"cubic-inches":{inBaseUnits:1e3*ib(.0254)},"cubic-feet":{inBaseUnits:1e3*ib(.3048)},"cubic-yards":{inBaseUnits:1e3*ib(.9144)},"cubic-miles":{inBaseUnits:1e3*ib(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},MKe=(()=>{const t={};for(const e in hL)for(const i in hL[e].units)t[i]=e;return t})();function OKe(t,e,i){return t*hL[i].units[e].inBaseUnits}function PKe(t,e,i){return t/hL[i].units[e].inBaseUnits}const RKe=["metric","imperial","square-inches","square-feet","square-yards","square-miles","square-us-feet","square-meters","square-kilometers","acres","ares","hectares"],dL=["metric","imperial","inches","feet","yards","miles","nautical-miles","us-feet","meters","kilometers"],IKe=new Map([["meters","square-meters"],["feet","square-feet"],["us-feet","square-us-feet"]]);function $Ke(t){return t==="imperial"||t==="metric"}function DT(t){const e=MKe[t];if(!e)throw new Error("unknown type");return e}function kde(t,e=null){return e=e||DT(t),hL[e].baseUnit===t}function Ur(t,e,i){if(e===i)return t;const r=DT(e);if(r!==DT(i))throw new Error("incompatible units");const n=kde(e,r)?t:OKe(t,e,r);return kde(i,r)?n:PKe(n,i,r)}function LKe(t){switch(t){case"metric":return"meters";case"imperial":return"feet";default:return t}}function IXt(t){return LKe(t)}function $Xt(t){switch(t){case"metric":return"square-meters";case"imperial":return"square-feet";default:return t}}function DKe(t,e,i){switch(i){case"metric":return Yne(t,e);case"imperial":return Zne(t,e);default:return i}}function NKe(t,e,i){switch(i){case"metric":return Xne(t,e);case"imperial":return Jne(t,e);default:return i}}function Yne(t,e){const i=Ur(t,e,"meters");return Math.abs(i)<3e3?"meters":"kilometers"}function Xne(t,e){const i=Ur(t,e,"meters");return Math.abs(i)<1e5?"meters":"kilometers"}function Zne(t,e){const i=Ur(t,e,"feet");return Math.abs(i)<1e3?"feet":"miles"}function Jne(t,e){const i=Ur(t,e,"feet");return Math.abs(i)<1e5?"feet":"miles"}function FKe(t,e){const i=Ur(t,e,"square-meters");return Math.abs(i)<3e6?"square-meters":"square-kilometers"}function kKe(t,e){const i=Ur(t,e,"square-feet");return Math.abs(i)<1e6?"square-feet":"square-miles"}function UCe(t,e,i){return Ur(t,e,"meters")/(i*Math.PI/180)}function VCe(t){return AKe.fromJSON(t.toLowerCase())||null}function Bf(t){if(t!=null&&!VO(t))return 1;const e=ws(t);return e>1e5?1:e}function BCe(t){return ws(t)>=Sr(t).metersPerDegree?"meters":A9(t)}function ws(t,e=Mr.metersPerDegree){return jCe(t,!0)??e}function jCe(t,e=!1){const i=(t==null?void 0:t.wkid)??null,r=(t==null?void 0:t.wkt2)??(t==null?void 0:t.wkt)??null;let n=null;if(i){if(Gne(i))return Sy.metersPerDegree;if(Hne(i))return u_.metersPerDegree;n=cT.values[cT[i]],!n&&e&&CKe.has(i)&&(n=EKe)}else r&&(Kne(r)?n=zde(kCe.exec(r),n):HCe(r)&&(n=zde(zCe.exec(r),n)));return n}function DZ(t){return uB(t)?1:ws(t)}function zde(t,e){return t!=null&&t[1]?GCe(t[1]):e}function GCe(t){return parseFloat(t.split(",")[1])}function A9(t){const e=(t==null?void 0:t.wkid)??null,i=(t==null?void 0:t.wkt2)??(t==null?void 0:t.wkt)??null;let r=null;if(e)r=cT.units[cT[e]];else if(i){const n=Kne(i)?kCe:HCe(i)?zCe:null;if(n){const s=n.exec(i);s!=null&&s[1]&&(r=UKe(s[1]))}}return r!=null?VCe(r):null}function LXt(t){const e=A9(t);return e!=null&&dL.includes(e)?e:null}function DXt(t){const e=BCe(t);return e!=null&&dL.includes(e)?e:null}function NXt(t){const e=A9(t);return e==null?null:IKe.get(e)}function HCe(t){return/^GEOCCS/i.test(t)}function Kne(t){return/^\s*(?:PROJCS|PROJCRS|PROJECTEDCRS)/i.test(t)}const zKe=1e-7;function UKe(t){const e=/[\\"']{1}([^\\"']+)/.exec(t);let i=e==null?void 0:e[1];if(!i||!cT.units.includes(i)){const r=GCe(t);i=null;const n=cT.values;for(let s=0;s{let e=class extends t{constructor(...i){super(...i),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(r=>{const n=this.load.bind(this);this.load=s=>{const o=new Promise((l,c)=>{const f=g9(s,c);this.destroyed&&c(new se("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this.when(l,c).finally(()=>{f&&f.remove()})});if(this.loadStatus===HKe){this._set("loadStatus",qKe);const l=this._loadController=new AbortController;n({signal:l.signal})}return r(),o}})),this.when(()=>{this._set("loadStatus",Ude),this._loadController=null},r=>{this._set("loadStatus",WKe),this._set("loadError",r),this._loadController=null})}destroy(){this._loadController&&(this._loadController=gn(this._loadController),this._promiseProps.abort()),this._set("loadError",null),this._set("loadWarnings",[])}get loaded(){return this.loadStatus===Ude}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){var i;return this.isFulfilled()||(this._set("loadError",new se("load:cancelled","Cancelled")),(i=this._loadController)==null||i.abort(),this._promiseProps.abort()),this}};return y([w({readOnly:!0})],e.prototype,"loaded",null),y([w({readOnly:!0})],e.prototype,"loadError",void 0),y([w({clonable:!1})],e.prototype,"loadStatus",void 0),y([w({type:[Uf],readOnly:!0})],e.prototype,"loadWarnings",null),e=y([Z("esri.core.Loadable")],e),e};let e4=class extends qCe(uz){};e4=y([Z("esri.core.Loadable")],e4),function(t){function e(i){return!(!i||!i.load)}t.LoadableMixin=qCe,t.isLoadable=e}(e4||(e4={}));const jf=e4;function $t(t,e,i){let r,n;return e===void 0||Array.isArray(e)?(n=t,i=e,r=[void 0]):(n=e,r=Array.isArray(t)?t:[t]),(s,o)=>{const l=s.constructor.prototype;r.forEach(c=>{const f=tne(s,c,n);f.read&&typeof f.read=="object"||(f.read={}),f.read.reader=l[o],i&&(f.read.source=(f.read.source||[]).concat(i))})}}function Pt(t,e,i){let r,n;return e===void 0?(n=t,r=[void 0]):typeof e!="string"?(n=t,r=[void 0],i=e):(n=e,r=Array.isArray(t)?t:[t]),(s,o)=>{const l=s.constructor.prototype;for(const c of r){const f=tne(s,c,n);f.write&&typeof f.write=="object"||(f.write={}),i&&(f.write.target=i),f.write.writer=l[o]}}}var yg;let An=yg=class extends Ue{static fromJSON(t){if(!t)return null;if(t.wkid){if(t.wkid===102100)return yg.WebMercator;if(t.wkid===4326)return yg.WGS84}const e=new yg;return e.read(t),e}constructor(t){super(t),this.latestWkid=null,this.wkid=null,this.wkt=null,this.wkt2=null,this.vcsWkid=null,this.latestVcsWkid=null,this.imageCoordinateSystem=null}normalizeCtorArgs(t){return t&&typeof t=="object"?t:{[typeof t=="string"?"wkt":"wkid"]:t}}get isWGS84(){return cL(this)}get isWebMercator(){return LT(this)}get isGeographic(){return uB(this)}get isWrappable(){return wKe(this)}get metersPerUnit(){return ws(this)}get unit(){return A9(this)||(this.isGeographic?"degrees":null)}writeWkt(t,e){this.wkid||(e.wkt=t)}clone(){if(this===yg.WGS84)return yg.WGS84;if(this===yg.WebMercator)return yg.WebMercator;const t=new yg;return this.wkid!=null?(t.wkid=this.wkid,this.latestWkid!=null&&(t.latestWkid=this.latestWkid),this.vcsWkid!=null&&(t.vcsWkid=this.vcsWkid),this.latestVcsWkid!=null&&(t.latestVcsWkid=this.latestVcsWkid)):(this.wkt!=null&&(t.wkt=this.wkt),this.wkt2!=null&&(t.wkt2=this.wkt2)),this.imageCoordinateSystem&&(t.imageCoordinateSystem=Re(this.imageCoordinateSystem)),t}equals(t){if(t==null)return!1;if(this.imageCoordinateSystem||t.imageCoordinateSystem){if(this.imageCoordinateSystem==null||t.imageCoordinateSystem==null)return!1;const{id:e,referenceServiceName:i}=t.imageCoordinateSystem,{geodataXform:r}=t.imageCoordinateSystem,n=this.imageCoordinateSystem;return e==null||r?JSON.stringify(n)===JSON.stringify(t.imageCoordinateSystem):i?n.id===e&&n.referenceServiceName===i:n.id===e}return Zn(this,t)}toJSON(t){return this.write(void 0,t)}};An.GCS_NAD_1927=null,An.WGS84=null,An.WebMercator=null,An.PlateCarree=null,y([w({readOnly:!0})],An.prototype,"isWGS84",null),y([w({readOnly:!0})],An.prototype,"isWebMercator",null),y([w({readOnly:!0})],An.prototype,"isGeographic",null),y([w({readOnly:!0})],An.prototype,"isWrappable",null),y([w({type:$n,json:{write:!0}})],An.prototype,"latestWkid",void 0),y([w({readOnly:!0})],An.prototype,"metersPerUnit",null),y([w({readOnly:!0})],An.prototype,"unit",null),y([w({type:$n,json:{write:!0,origins:{"web-scene":{write:{overridePolicy(){return{isRequired:this.wkt==null}}}}}}})],An.prototype,"wkid",void 0),y([w({type:String,json:{origins:{"web-scene":{write:{overridePolicy(){return{isRequired:this.wkid==null}}}}}}})],An.prototype,"wkt",void 0),y([Pt("wkt"),Pt("web-scene","wkt")],An.prototype,"writeWkt",null),y([w({type:String,json:{write:!1}})],An.prototype,"wkt2",void 0),y([w({type:$n,json:{write:!0}})],An.prototype,"vcsWkid",void 0),y([w({type:$n,json:{write:!0}})],An.prototype,"latestVcsWkid",void 0),y([w()],An.prototype,"imageCoordinateSystem",void 0),An=yg=y([Z("esri.geometry.SpatialReference")],An),An.prototype.toJSON.isDefaultToJSON=!0,An.GCS_NAD_1927=new An({wkid:4267,wkt:'GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]'}),An.WGS84=new An(xKe),An.WebMercator=new An(SKe),An.PlateCarree=new An(TKe),Object.freeze&&(Object.freeze(An.GCS_NAD_1927),Object.freeze(An.WGS84),Object.freeze(An.WebMercator));const at=An;let vg=class extends Ue{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=at.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,i){if(e instanceof at)return e;if(e!=null){const r=new at;return r.read(e,i),r}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,i){this.cache[e]=i}};y([w()],vg.prototype,"type",void 0),y([w({readOnly:!0})],vg.prototype,"cache",null),y([w({readOnly:!0})],vg.prototype,"extent",null),y([w({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],vg.prototype,"hasM",void 0),y([w({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],vg.prototype,"hasZ",void 0),y([w({type:at,json:{write:!0},value:at.WGS84})],vg.prototype,"spatialReference",void 0),y([$t("spatialReference")],vg.prototype,"readSpatialReference",null),vg=y([Z("esri.geometry.Geometry")],vg);const ix=vg;function YKe(t,e){const i=t.x-e.x,r=t.y-e.y,n=t.hasZ&&e.hasZ?t.z-e.z:0;return Math.sqrt(i*i+r*r+n*n)}const XKe=57.29577951308232,ZKe=.017453292519943;function Vde(t){return t*XKe}function Bde(t){return t*ZKe}function jde(t){return t/Mr.radius}function Mz(t){return Math.PI/2-2*Math.atan(Math.exp(-t/Mr.radius))}function NZ(t){return t.wkid!=null||t.wkt!=null}const mH=[0,0];function Oz(t,e,i,r,n){const s=t,o=n;if(o.spatialReference=i,"x"in s&&"x"in o)[o.x,o.y]=e(s.x,s.y,mH,r);else if("xmin"in s&&"xmin"in o)[o.xmin,o.ymin]=e(s.xmin,s.ymin,mH,r),[o.xmax,o.ymax]=e(s.xmax,s.ymax,mH,r);else if("paths"in s&&"paths"in o||"rings"in s&&"rings"in o){const l="paths"in s?s.paths:s.rings,c=[];let f;for(let _=0;_2&&f[T].push(x[T][2]),x[T].length>3&&f[T].push(x[T][3])}"paths"in o?o.paths=c:o.rings=c}else if("points"in s&&"points"in o){const l=s.points,c=[];for(let f=0;f2&&c[f].push(l[f][2]),l[f].length>3&&c[f].push(l[f][3]);o.points=c}return n}function HI(t,e){const i=t&&(NZ(t)?t:t.spatialReference),r=e&&(NZ(e)?e:e.spatialReference);return!(t&&"type"in t&&t.type==="mesh"||e&&"type"in e&&e.type==="mesh"||!i||!r)&&(!!Zn(r,i)||LT(r)&&cL(i)||LT(i)&&cL(r))}function rP(t,e){if(t==null)return null;const i=t.spatialReference,r=e&&(NZ(e)?e:e.spatialReference);return HI(i,r)?Zn(i,r)?Re(t):LT(r)?Oz(t,xM,at.WebMercator,!1,Re(t)):cL(r)?Oz(t,qI,at.WGS84,!1,Re(t)):null:null}function xM(t,e,i=[0,0]){e>89.99999?e=89.99999:e<-89.99999&&(e=-89.99999);const r=Bde(e);return i[0]=Bde(t)*Mr.radius,i[1]=Mr.halfSemiMajorAxis*Math.log((1+Math.sin(r))/(1-Math.sin(r))),i}function qI(t,e,i=[0,0],r=!1){const n=Vde(t/Mr.radius);return i[0]=r?n:n-360*Math.floor((n+180)/360),i[1]=Vde(Math.PI/2-2*Math.atan(Math.exp(-e/Mr.radius))),i}function Ty(t,e=!1,i=Re(t)){return Oz(t,xM,at.WebMercator,e,i)}function HS(t,e=!1,i=Re(t)){return Oz(t,qI,at.WGS84,e,i)}var b7;const jP=[0,0];function Gde(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let Eu=b7=class extends ix{static copy(t,e){e._set("x",t._get("x")),e._set("y",t._get("y")),e._set("z",t._get("z")),e._set("m",t._get("m"));const i=t._get("spatialReference");e._set("spatialReference",Object.isFrozen(i)?i:i.clone())}constructor(...t){super(...t),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}normalizeCtorArgs(t,e,i,r,n){let s;if(Array.isArray(t))s=t,n=e,t=s[0],e=s[1],i=s[2],r=s[3];else if(t&&typeof t=="object"){if(s=t,t=s.x!=null?s.x:s.longitude,e=s.y!=null?s.y:s.latitude,i=s.z,r=s.m,(n=s.spatialReference)&&n.declaredClass!=="esri.geometry.SpatialReference"&&(n=new at(n)),s.longitude!=null||s.latitude!=null){if(s.longitude==null)Ce.getLogger(this).warn(".longitude=","Latitude was defined without longitude");else if(s.latitude==null)Ce.getLogger(this).warn(".latitude=","Longitude was defined without latitude");else if(!s.declaredClass&&n&&n.isWebMercator){const l=xM(s.longitude,s.latitude,jP);t=l[0],e=l[1]}}}else Gde(i)?(n=i,i=null):Gde(r)&&(n=r,r=null);const o={x:t,y:e};return o.x==null&&o.y!=null?Ce.getLogger(this).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&Ce.getLogger(this).warn(".x=","X coordinate was defined without a Y coordinate"),n!=null&&(o.spatialReference=n),i!=null&&(o.z=i),r!=null&&(o.m=r),o}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(t){t!==(this._get("m")!==void 0)&&(this._set("m",t?0:void 0),this._set("hasM",t))}get hasZ(){return this.z!==void 0}set hasZ(t){t!==(this._get("z")!==void 0)&&(this._set("z",t?0:void 0),this._set("hasZ",t))}get latitude(){const{spatialReference:t,x:e,y:i}=this;if(t){if(t.isWebMercator)return qI(e,i,jP)[1];if(t.isGeographic)return i}return null}set latitude(t){const{spatialReference:e,x:i}=this;t!=null&&e&&(e.isWebMercator?this._set("y",xM(i,t,jP)[1]):e.isGeographic&&this._set("y",t),this._set("latitude",t))}get longitude(){const{x:t,y:e,spatialReference:i}=this;if(i){if(i.isWebMercator)return qI(t,e,jP)[0];if(i.isGeographic)return t}return null}set longitude(t){const{y:e,spatialReference:i}=this;t!=null&&i&&(i.isWebMercator?this._set("x",xM(t,e,jP)[0]):i.isGeographic&&this._set("x",t),this._set("longitude",t))}writeX(t,e,i){e[i]=isNaN(t)?"NaN":t}readX(t){return typeof t=="string"?NaN:t}clone(){const t=new b7;return t.x=this.x,t.y=this.y,t.z=this.z,t.m=this.m,t.spatialReference=this.spatialReference,t}copy(t){return b7.copy(t,this),this}equals(t){if(t==null)return!1;const{x:e,y:i,z:r,m:n,spatialReference:s}=this,{z:o,m:l}=t;let{x:c,y:f,spatialReference:_}=t;if(!s.equals(_))if(s.isWebMercator&&_.isWGS84)[c,f]=xM(c,f),_=s;else{if(!s.isWGS84||!_.isWebMercator)return!1;[c,f]=qI(c,f),_=s}return e===c&&i===f&&r===o&&n===l&&s.wkid===_.wkid}offset(t,e,i){return this.x+=t,this.y+=e,i!=null&&(this.z=(this.z??0)+i),this}normalize(){if(!this.spatialReference)return this;const t=pp(this.spatialReference);if(!t)return this;let e=this.x;const[i,r]=t.valid,n=2*r;let s;return e>r?(s=Math.ceil(Math.abs(e-r)/n),e-=s*n):eisNaN(t)?t:Vh(t))],Eu.prototype,"x",void 0),y([Pt("x")],Eu.prototype,"writeX",null),y([$t("x")],Eu.prototype,"readX",null),y([w({type:Number,json:{write:!0}})],Eu.prototype,"y",void 0),y([w({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],Eu.prototype,"z",void 0),y([w({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],Eu.prototype,"m",void 0),Eu=b7=y([Z("esri.geometry.Point")],Eu),Eu.prototype.toJSON.isDefaultToJSON=!0;const mt=Eu,gH=[0,0];function Qne(t,e){return e!=null&&Kc(t,e.x,e.y,e.z)}function BXt(t,e){if(!e.points||e.points.length)return!1;for(const i of e.points)if(!BO(t,i))return!1;return!0}function JKe(t,e){const{xmin:i,ymin:r,zmin:n,xmax:s,ymax:o,zmax:l}=e;return t.hasZ&&e.hasZ?Kc(t,i,r,n)&&Kc(t,i,o,n)&&Kc(t,s,o,n)&&Kc(t,s,r,n)&&Kc(t,i,r,l)&&Kc(t,i,o,l)&&Kc(t,s,o,l)&&Kc(t,s,r,l):Kc(t,i,r)&&Kc(t,i,o)&&Kc(t,s,o)&&Kc(t,s,r)}function BO(t,e){return Kc(t,e[0],e[1])}function KKe(t,e){return Kc(t,e[0],e[1],e[2])}function Kc(t,e,i,r){return e>=t.xmin&&e<=t.xmax&&i>=t.ymin&&i<=t.ymax&&(r==null||!t.hasZ||r>=t.zmin&&r<=t.zmax)}function QKe(t,e){return gH[1]=e.y,gH[0]=e.x,eQe(t,gH)}function eQe(t,e){return WCe(t.rings,e)}function WCe(t,e){if(!t)return!1;if(tQe(t))return Hde(!1,t,e);let i=!1;for(let r=0,n=t.length;r=n||T=n)&&f+(n-_)/(T-_)*(x-f)=0&&U<=1&&j>=0&&j<=1&&(n&&(n[0]=s+U*(l-s),n[1]=o+U*(c-o)),!0)}function uQe(t){switch(t){case"esriGeometryEnvelope":case"extent":return rQe;case"esriGeometryMultipoint":case"multipoint":return nQe;case"esriGeometryPoint":case"point":return iQe;case"esriGeometryPolygon":case"polygon":return oQe;case"esriGeometryPolyline":case"polyline":return lQe}}var Vp;function hQe(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}function rb(t,e,i){return e==null?i:i==null?e:t(e,i)}let ul=Vp=class extends ix{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,e,i,r,n){return hQe(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:typeof t=="object"?(t.spatialReference=t.spatialReference==null?at.WGS84:t.spatialReference,t):{xmin:t,ymin:e,xmax:i,ymax:r,spatialReference:n??at.WGS84}}static fromBounds(t,e){return new Vp({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}static fromPoint(t){return new Vp({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new mt({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const e=this.center;return t.z!=null&&this.hasZ?this.offset(t.x-e.x,t.y-e.y,t.z-e.z):this.offset(t.x-e.x,t.y-e.y)}clone(){const t=new Vp;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,this.zmin!=null&&(t.zmin=this.zmin,t.zmax=this.zmax),this.mmin!=null&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const e=this.spatialReference,i=t.spatialReference;return e&&i&&!e.equals(i)&&HI(e,i)&&(t=e.isWebMercator?Ty(t):HS(t,!0)),t.type==="point"?Qne(this,t):t.type==="extent"&&JKe(this,t)}equals(t){if(this===t)return!0;if(t==null)return!1;const e=this.spatialReference,i=t.spatialReference;return e&&i&&!e.equals(i)&&HI(e,i)&&(t=e.isWebMercator?Ty(t):HS(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const e=.5*(1-t),i=this.width*e,r=this.height*e;if(this.xmin+=i,this.ymin+=r,this.xmax-=i,this.ymax-=r,this.hasZ){const n=(this.zmax-this.zmin)*e;this.zmin+=n,this.zmax-=n}if(this.hasM){const n=(this.mmax-this.mmin)*e;this.mmin+=n,this.mmax-=n}return this}intersects(t){if(t==null)return!1;t.type==="mesh"&&(t=t.extent);const e=this.spatialReference,i=t.spatialReference;return e&&i&&!Zn(e,i)&&HI(e,i)&&(t=e.isWebMercator?Ty(t):HS(t,!0)),uQe(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,e,i){return this.xmin+=t,this.ymin+=e,this.xmax+=t,this.ymax+=e,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=rb(Math.min,this.zmin,t.zmin),this.zmax=rb(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=rb(Math.min,this.mmin,t.mmin),this.mmax=rb(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:t!=null&&this.intersects(t)?(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=rb(Math.max,this.zmin,t.zmin),this.zmax=rb(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=rb(Math.max,this.mmin,t.mmin),this.mmax=rb(Math.min,this.mmax,t.mmax)),this):null}toJSON(t){return this.write({},t)}_shiftCM(t=pp(this.spatialReference)){if(!t||!this.spatialReference)return this;const e=this.spatialReference,i=this._getCM(t);if(i){const r=e.isWebMercator?HS(i):i;this.xmin-=i.x,this.xmax-=i.x,e.isWebMercator||(r.x=this._normalizeX(r.x,t).x),this.spatialReference=new at(h9((e.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(t){let e=null;const[i,r]=t.valid,n=this.xmin,s=this.xmax;return n>=i&&n<=r&&s>=i&&s<=r||(e=this.center),e}_normalize(t,e,i){const r=this.spatialReference;if(!r)return this;const n=i??pp(r);if(n==null)return this;const s=this._getParts(n).map(c=>c.extent);if(s.length<2)return s[0]||this;if(s.length>2)return t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)return this._shiftCM(n);if(e)return s;let o=!0,l=!0;return s.forEach(c=>{c.hasZ||(o=!1),c.hasM||(l=!1)}),{rings:s.map(c=>{const f=[[c.xmin,c.ymin],[c.xmin,c.ymax],[c.xmax,c.ymax],[c.xmax,c.ymin],[c.xmin,c.ymin]];if(o){const _=(c.zmax-c.zmin)/2;for(let x=0;x0;if(l>2*T){const z=new Vp(cI||F?e.push({extent:new Vp(A,n,T,s,o),frameIds:[M]},{extent:new Vp(x,n,I,s,o),frameIds:[L]}):e.push({extent:new Vp(A,n,I,s,o),frameIds:[M]});this.cache._parts=e}const i=this.hasZ,r=this.hasM;if(i||r){const n={};i&&(n.zmin=this.zmin,n.zmax=this.zmax),r&&(n.mmin=this.mmin,n.mmax=this.mmax);for(let s=0;sr?(s=Math.ceil(Math.abs(t-r)/n),t-=s*n,o=s):tArray.isArray(o)?JSON.stringify(o):o));let r="";if(this.extent){const o=rP(this.extent,at.WGS84);o!=null&&(r=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let n=this.query;!this.disableExtraQuery&&t.extraQuery&&(n="("+n+")"+t.extraQuery);const s={categories:i,bbox:r,q:n,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(s.sortField=this.sortField.split(",").map(o=>pQe.toJSON(o.trim())).join(","),s.sortOrder=this.sortOrder),{query:{...e,...s}}}};y([w()],Bp.prototype,"categories",void 0),y([w()],Bp.prototype,"disableExtraQuery",void 0),y([w({type:Vi})],Bp.prototype,"extent",void 0),y([w()],Bp.prototype,"filter",void 0),y([w()],Bp.prototype,"num",void 0),y([w()],Bp.prototype,"query",void 0),y([w()],Bp.prototype,"sortField",void 0),y([w()],Bp.prototype,"sortOrder",null),y([w()],Bp.prototype,"start",void 0),Bp=kZ=y([Z("esri.portal.PortalQueryParams")],Bp);const ay=Bp;var zZ;let $a=zZ=class extends Ue{constructor(t){super(t),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.sourceJSON=null,this.tags=null,this.title=null}get thumbnailUrl(){var i;const t=this.url,e=this.thumbnail;return t&&e&&this.portal?(i=this.portal)==null?void 0:i.normalizeUrl(`${t}/info/${e}?f=json`):null}get url(){var e;const t=(e=this.portal)==null?void 0:e.restUrl;return t?t+"/community/groups/"+this.id:null}fetchCategorySchema(t){return this.portal.request(this.url+"/categorySchema",t).then(e=>{const i=e.categorySchema||[];return i.some(r=>r.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",t):i})}fetchMembers(t){return this.portal.request(this.url+"/users",t)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}toJSON(){throw new se("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new zZ;return e.sourceJSON=t,e.read(t),e}queryItems(t,e){let i=$s(ay,t);const r=this.portal;return parseFloat(r.currentVersion)>5?(i=i||new ay,r.queryPortal(`/content/groups/${this.id}/search`,i,"PortalItem",e)):(i=i?i.clone():new ay,i.query="group:"+this.id+(i.query?" "+i.query:""),r.queryItems(i,e))}_fetchCategorySchemaSet(t,e){const i=this.portal;return i.fetchSelf(i.authMode,!0,e).then(r=>{const n=r.contentCategorySetsGroupQuery;if(n){const s=new ay;return s.disableExtraQuery=!0,s.num=1,s.query=n,i.queryGroups(s,e)}throw new se("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(r=>{if(r.total){const n=r.results[0],s=new ay;return s.num=1,s.query=`typekeywords:"${t}"`,n.queryItems(s,e)}throw new se("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(r=>r.total?r.results[0].fetchData("json",e).then(n=>{const s=n==null?void 0:n.categorySchema;return s!=null&&s.length?s:[]}):[])}};y([w()],$a.prototype,"access",void 0),y([w({type:Date})],$a.prototype,"created",void 0),y([w()],$a.prototype,"description",void 0),y([w()],$a.prototype,"id",void 0),y([w()],$a.prototype,"isInvitationOnly",void 0),y([w({type:Date})],$a.prototype,"modified",void 0),y([w()],$a.prototype,"owner",void 0),y([w()],$a.prototype,"portal",void 0),y([w()],$a.prototype,"snippet",void 0),y([w()],$a.prototype,"sortField",void 0),y([w()],$a.prototype,"sortOrder",void 0),y([w()],$a.prototype,"sourceJSON",void 0),y([w()],$a.prototype,"tags",void 0),y([w()],$a.prototype,"thumbnail",void 0),y([w({readOnly:!0})],$a.prototype,"thumbnailUrl",null),y([w()],$a.prototype,"title",void 0),y([w({readOnly:!0})],$a.prototype,"url",null),$a=zZ=y([Z("esri.portal.PortalGroup")],$a);const UZ=$a;let d3=class extends ze{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};y([w()],d3.prototype,"nextQueryParams",void 0),y([w()],d3.prototype,"queryParams",void 0),y([w()],d3.prototype,"results",void 0),y([w()],d3.prototype,"total",void 0),d3=y([Z("esri.portal.PortalQueryResult")],d3);const fQe=d3;let z1=class extends Ue{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){var i;const e=(i=this.portal)==null?void 0:i.restUrl;return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new se("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};y([w({type:Date})],z1.prototype,"created",void 0),y([w()],z1.prototype,"id",void 0),y([w()],z1.prototype,"portal",void 0),y([w()],z1.prototype,"title",void 0),y([w({readOnly:!0})],z1.prototype,"url",null),y([w()],z1.prototype,"username",void 0),z1=y([Z("esri.portal.PortalFolder")],z1);const mQe=z1;var VZ;let Zs=VZ=class extends Ue{constructor(...t){super(...t),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const t=this.url,e=this.thumbnail;return t&&e?this.portal.normalizeUrl(`${t}/info/${e}?f=json`):null}get userContentUrl(){var e;const t=(e=this.portal)==null?void 0:e.restUrl;return t?`${t}/content/users/${this.username}`:null}get url(){var e;const t=(e=this.portal)==null?void 0:e.restUrl;return t?`${t}/community/users/${this.username}`:null}addItem(t){const e=t&&t.item,i=t==null?void 0:t.data,r=t==null?void 0:t.folder,n={method:"post"};e&&(n.query=e.createPostQuery(),i!=null&&(typeof i=="string"?n.query.text=i:typeof i=="object"&&(n.query.text=JSON.stringify(i))));let s=this.userContentUrl;return r&&(s+="/"+(typeof r=="string"?r:r.id)),this.portal.request(s+"/addItem",n).then(o=>(e.id=o.id,e.portal=this.portal,e.loaded?e.reload():e.load()))}deleteItem(t){let e=this.userContentUrl;return t.ownerFolder&&(e+="/"+t.ownerFolder),this.portal.request(e+`/items/${t.id}/delete`,{method:"post"}).then(()=>{t.id=null,t.portal=null})}deleteItems(t){const e=this.userContentUrl+"/deleteItems",i=t.map(r=>r.id);if(i.length){const r={method:"post",query:{items:i.join(",")}};return this.portal.request(e,r).then(()=>{t.forEach(n=>{n.id=null,n.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){const t={query:{num:1}};return this.portal.request(this.userContentUrl??"",t).then(e=>{let i;return i=e&&e.folders?e.folders.map(r=>{const n=mQe.fromJSON(r);return n.portal=this.portal,n}):[],i})}fetchGroups(){return this.portal.request(this.url??"").then(t=>{let e;return e=t&&t.groups?t.groups.map(i=>{const r=UZ.fromJSON(i);return r.portal=this.portal,r}):[],e})}fetchItems(t){const e=t??{};let i,r=this.userContentUrl??"";return e.folder&&(r+="/"+e.folder.id),we(()=>Promise.resolve().then(()=>x5e),void 0).then(({default:n})=>{i=n;const s={folders:!1,num:e.num||10,start:e.start||1,sortField:e.sortField||"created",sortOrder:e.sortOrder||"asc"};return this.portal.request(r,{query:s})}).then(n=>{let s;return n!=null&&n.items?(s=n.items.map(o=>{const l=i.fromJSON(o);return l.portal=this.portal,l}),Promise.all(s.map(o=>o.load())).catch(o=>o).then(()=>({items:s,nextStart:n.nextStart,total:n.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal.request(this.url+"/tags").then(t=>t.tags)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}queryFavorites(t){return this.favGroupId?(this._favGroup||(this._favGroup=new UZ({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(t)):Promise.reject(new se("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new se("internal:not-yet-implemented","PortalUser.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");const e=new VZ;return e.sourceJSON=t,e.read(t),e}};y([w()],Zs.prototype,"access",void 0),y([w({type:Date})],Zs.prototype,"created",void 0),y([w()],Zs.prototype,"culture",void 0),y([w()],Zs.prototype,"description",void 0),y([w()],Zs.prototype,"email",void 0),y([w()],Zs.prototype,"favGroupId",void 0),y([w()],Zs.prototype,"fullName",void 0),y([w({type:Date})],Zs.prototype,"modified",void 0),y([w()],Zs.prototype,"orgId",void 0),y([w()],Zs.prototype,"portal",void 0),y([w()],Zs.prototype,"preferredView",void 0),y([w()],Zs.prototype,"privileges",void 0),y([w()],Zs.prototype,"region",void 0),y([w()],Zs.prototype,"role",void 0),y([w()],Zs.prototype,"roleId",void 0),y([w()],Zs.prototype,"sourceJSON",void 0),y([w()],Zs.prototype,"thumbnail",void 0),y([w({readOnly:!0})],Zs.prototype,"thumbnailUrl",null),y([w()],Zs.prototype,"units",void 0),y([w({readOnly:!0})],Zs.prototype,"userContentUrl",null),y([w({readOnly:!0})],Zs.prototype,"url",null),y([w()],Zs.prototype,"username",void 0),y([w()],Zs.prototype,"userType",void 0),Zs=VZ=y([Z("esri.portal.PortalUser")],Zs);const ese=Zs;var U1;let B6;const qde={PortalGroup:()=>Promise.resolve({default:UZ}),PortalItem:()=>we(()=>Promise.resolve().then(()=>x5e),void 0),PortalUser:()=>Promise.resolve({default:ese})};let wt=U1=class extends P_(jf){constructor(t){super(t),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.basemapGalleryGroupQuery3D=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=Ar.portalUrl,this.urlKey=null,this.user=null,this.use3dBasemaps=!0,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(t){return typeof t=="string"?{url:t}:t}destroy(){Wde.unregister(this),this.defaultBasemap=et(this.defaultBasemap),this.defaultDevBasemap=et(this.defaultDevBasemap),this.defaultVectorBasemap=et(this.defaultVectorBasemap),this._esriIdCredentialCreateHandle=en(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(t){if(t)for(const e of t)Ar.request.trustedServers.includes(e)||Ar.request.trustedServers.push(e);return t}readDefaultBasemap(t){return this._readBasemap(t)}readDefaultDevBasemap(t){return this._readBasemap(t)}readDefaultVectorBasemap(t){return this._readBasemap(t)}get extraQuery(){var i;const t=(i=this.user)==null?void 0:i.orgId,e=!t||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let t=this.url;if(t){const e=t.indexOf("/sharing");t=e>0?t.substring(0,e):this.url.replace(/\/+$/,""),t+="/sharing/rest"}return t}get thumbnailUrl(){const t=this.restUrl,e=this.thumbnail;return t&&e?this._normalizeSSL(t+"/portals/self/resources/"+e):null}readUrlKey(t){return t&&t.toLowerCase()}readUser(t){let e=null;return t&&(e=ese.fromJSON(t),e.portal=this),e}load(t){const e=we(()=>Promise.resolve().then(()=>Edt),void 0).then(({default:i})=>{St(t),B6=i}).then(()=>this.sourceJSON?this.sourceJSON:this.fetchSelf(this.authMode,!1,t)).then(i=>{var r;if(yr){const n=yr;this.credential=n.findCredential(this.restUrl),this.credential||this.authMode!==U1.AUTH_MODE_AUTO||((r=this._esriIdCredentialCreateHandle)==null||r.remove(),this._esriIdCredentialCreateHandle=n.on("credential-create",gQe(new WeakRef(this))),Wde.register(this,this._esriIdCredentialCreateHandle,this))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(e),Promise.resolve(this)}async createElevationLayers(){await this.load();const t=this._getHelperService("defaultElevationLayers"),e=(await we(()=>Promise.resolve().then(()=>mje),void 0)).default;return t?t.map(i=>new e({id:i.id,url:i.url})):[]}async fetchBasemaps(t,e){const i=await this._fetchBasemaps(t,e);if((e==null?void 0:e.include3d)===!0&&this.use3dBasemaps!==!1){const r=await this._fetchBasemaps3D(t,e);i.unshift(...r)}return i}fetchCategorySchema(t){return this.hasCategorySchema?this.request(this.restUrl+"/portals/self/categorySchema",t).then(e=>e.categorySchema):xo(t)?Promise.reject(ur()):Promise.resolve([])}fetchFeaturedGroups(t){const e=this.featuredGroups,i=new ay;if(i.num=100,i.sortField="title",e&&e.length){const r=[];for(const n of e)r.push(`(title:"${n.title}" AND owner:${n.owner})`);return i.query=r.join(" OR "),this.queryGroups(i,t).then(n=>n.results)}return xo(t)?Promise.reject(ur()):Promise.resolve([])}fetchRegions(t){var i;const e=((i=this.user)==null?void 0:i.culture)||this.culture||fa();return this.request(this.restUrl+"/portals/regions",{...t,query:{culture:e}})}fetchSettings(t){var i;const e=((i=this.user)==null?void 0:i.culture)||this.culture||fa();return this.request(this.restUrl+"/portals/self/settings",{...t,query:{culture:e}})}static getDefault(){return dQe(()=>new U1)}queryGroups(t,e){return this.queryPortal("/community/groups",t,"PortalGroup",e)}queryItems(t,e){return this.queryPortal("/search",t,"PortalItem",e)}queryUsers(t,e){return t.sortField||(t.sortField="username"),this.queryPortal("/community/users",t,"PortalUser",e)}fetchSelf(t=this.authMode,e=!1,i){const r=this.restUrl+"/portals/self",n={authMode:t,query:{culture:fa().toLowerCase()},...i};return n.authMode==="auto"&&(n.authMode="no-prompt"),e&&(n.query.default=!0),this.request(r,n)}queryPortal(t,e,i,r){const n=$s(ay,e),s=o=>this.request(this.restUrl+t,{...n.toRequestOptions(this),...r}).then(l=>{const c=n.clone();return c.start=l.nextStart,new fQe({nextQueryParams:c,queryParams:n,total:l.total,results:U1._resultsToTypedArray(o,{portal:this},l,r)})}).then(l=>Promise.all(l.results.map(c=>typeof c.when=="function"?c.when():l)).then(()=>l,c=>(zo(c),l)));return i&&qde[i]?qde[i]().then(({default:o})=>(St(r),s(o))):s()}signIn(){if(this.authMode===U1.AUTH_MODE_ANONYMOUS)return Promise.reject(new se("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const t=e=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(e||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=e,this.fetchSelf("immediate"))):this.user&&this.credential===e?null:(this.credential=e,this.fetchSelf("immediate"))).then(i=>{i&&(this.sourceJSON=i,this.read(i))});return yr?yr.getCredential(this.restUrl).then(e=>t(e)):t(this.credential)}normalizeUrl(t){var i;const e=(i=this.credential)==null?void 0:i.token;return this._normalizeSSL(e?t+(t.includes("?")?"&":"?")+"token="+e:t)}requestToTypedArray(t,e,i){return this.request(t,e).then(r=>{const n=U1._resultsToTypedArray(i,{portal:this},r);return Promise.all(n.map(s=>typeof s.when=="function"?s.when():r)).then(()=>n,()=>n)})}request(t,e={}){const i={f:"json",...e.query},{authMode:r=this.authMode===U1.AUTH_MODE_ANONYMOUS?"anonymous":"auto",body:n=null,cacheBust:s=!1,method:o="auto",responseType:l="json",signal:c}=e,f={authMode:r,body:n,cacheBust:s,method:o,query:i,responseType:l,timeout:0,signal:c};return bi(this._normalizeSSL(t),f).then(_=>_.data)}toJSON(){throw new se("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new U1({sourceJSON:t})}_getHelperService(t){const e=this.helperServices&&this.helperServices[t];if(!e)throw new se("portal:service-not-found",`The \`helperServices\` do not include an entry named "${t}"`);return e}async _fetchBasemaps(t,e){const i=new ay;i.query=t||(Ar.apiKey&&$ne(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0;const r=await this.queryGroups(i,e);if(!r.total)return[];const n=r.results[0];i.num=100,i.query='type:"Web Map" -type:"Web Application"',i.sortField=n.sortField||"name",i.sortOrder=n.sortOrder||"desc";const s=await n.queryItems(i,e);return s.total?s.results.filter(o=>o.type==="Web Map").map(o=>new B6({portalItem:o})):[]}async _fetchBasemaps3D(t,e){const i=t||this.basemapGalleryGroupQuery3D;if(!i)return[];const r=new ay({query:i,disableExtraQuery:!0}),n=await this.queryGroups(r,e);if(!n.total)return[];const s=n.results[0];r.num=100,r.query='type:"Web Scene"',r.sortField=s.sortField||"name",r.sortOrder=s.sortOrder||"desc";const o=await s.queryItems(r,e);return o.total?o.results.filter(l=>l.type==="Web Scene").map(l=>new B6({portalItem:l})):[]}_normalizeSSL(t){return t.replace(/^http:/i,"https:").replace(":7080",":7443")}_readBasemap(t){if(t){const e=B6.fromJSON(t);return e.portalItem={portal:this},e}return null}static _resultsToTypedArray(t,e,i,r){let n=[];if(i){const s=r!=null?r.signal:null;n=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(t||e)&&(n=n.map(o=>{const l=Object.assign(t?t.fromJSON(o):o,e);return typeof l.load=="function"&&l.load(s),l}))}else n=[];return n}};wt.AUTH_MODE_ANONYMOUS="anonymous",wt.AUTH_MODE_AUTO="auto",wt.AUTH_MODE_IMMEDIATE="immediate",y([w()],wt.prototype,"access",void 0),y([w()],wt.prototype,"allSSL",void 0),y([w()],wt.prototype,"authMode",void 0),y([w()],wt.prototype,"authorizedCrossOriginDomains",void 0),y([$t("authorizedCrossOriginDomains")],wt.prototype,"readAuthorizedCrossOriginDomains",null),y([w()],wt.prototype,"basemapGalleryGroupQuery",void 0),y([w({json:{name:"3DBasemapGalleryGroupQuery"}})],wt.prototype,"basemapGalleryGroupQuery3D",void 0),y([w()],wt.prototype,"bingKey",void 0),y([w()],wt.prototype,"canListApps",void 0),y([w()],wt.prototype,"canListData",void 0),y([w()],wt.prototype,"canListPreProvisionedItems",void 0),y([w()],wt.prototype,"canProvisionDirectPurchase",void 0),y([w()],wt.prototype,"canSearchPublic",void 0),y([w()],wt.prototype,"canShareBingPublic",void 0),y([w()],wt.prototype,"canSharePublic",void 0),y([w()],wt.prototype,"canSignInArcGIS",void 0),y([w()],wt.prototype,"canSignInIDP",void 0),y([w()],wt.prototype,"colorSetsGroupQuery",void 0),y([w()],wt.prototype,"commentsEnabled",void 0),y([w({type:Date})],wt.prototype,"created",void 0),y([w()],wt.prototype,"credential",void 0),y([w()],wt.prototype,"culture",void 0),y([w()],wt.prototype,"currentVersion",void 0),y([w()],wt.prototype,"customBaseUrl",void 0),y([w()],wt.prototype,"defaultBasemap",void 0),y([$t("defaultBasemap")],wt.prototype,"readDefaultBasemap",null),y([w()],wt.prototype,"defaultDevBasemap",void 0),y([$t("defaultDevBasemap")],wt.prototype,"readDefaultDevBasemap",null),y([w({type:Vi})],wt.prototype,"defaultExtent",void 0),y([w()],wt.prototype,"defaultVectorBasemap",void 0),y([$t("defaultVectorBasemap")],wt.prototype,"readDefaultVectorBasemap",null),y([w()],wt.prototype,"description",void 0),y([w()],wt.prototype,"devBasemapGalleryGroupQuery",void 0),y([w()],wt.prototype,"eueiEnabled",void 0),y([w({readOnly:!0})],wt.prototype,"extraQuery",null),y([w()],wt.prototype,"featuredGroups",void 0),y([w()],wt.prototype,"featuredItemsGroupQuery",void 0),y([w()],wt.prototype,"galleryTemplatesGroupQuery",void 0),y([w()],wt.prototype,"livingAtlasGroupQuery",void 0),y([w()],wt.prototype,"hasCategorySchema",void 0),y([w()],wt.prototype,"helpBase",void 0),y([w()],wt.prototype,"helperServices",void 0),y([w()],wt.prototype,"helpMap",void 0),y([w()],wt.prototype,"homePageFeaturedContent",void 0),y([w()],wt.prototype,"homePageFeaturedContentCount",void 0),y([w()],wt.prototype,"httpPort",void 0),y([w()],wt.prototype,"httpsPort",void 0),y([w()],wt.prototype,"id",void 0),y([w()],wt.prototype,"ipCntryCode",void 0),y([w({readOnly:!0})],wt.prototype,"isOrganization",null),y([w()],wt.prototype,"isPortal",void 0),y([w()],wt.prototype,"isReadOnly",void 0),y([w({readOnly:!0})],wt.prototype,"itemPageUrl",null),y([w()],wt.prototype,"layerTemplatesGroupQuery",void 0),y([w()],wt.prototype,"maxTokenExpirationMinutes",void 0),y([w({type:Date})],wt.prototype,"modified",void 0),y([w()],wt.prototype,"name",void 0),y([w()],wt.prototype,"portalHostname",void 0),y([w()],wt.prototype,"portalMode",void 0),y([w()],wt.prototype,"portalProperties",void 0),y([w()],wt.prototype,"region",void 0),y([w({readOnly:!0})],wt.prototype,"restUrl",null),y([w()],wt.prototype,"rotatorPanels",void 0),y([w()],wt.prototype,"showHomePageDescription",void 0),y([w()],wt.prototype,"sourceJSON",void 0),y([w()],wt.prototype,"staticImagesUrl",void 0),y([w({json:{name:"2DStylesGroupQuery"}})],wt.prototype,"stylesGroupQuery2d",void 0),y([w({json:{name:"stylesGroupQuery"}})],wt.prototype,"stylesGroupQuery3d",void 0),y([w()],wt.prototype,"supportsHostedServices",void 0),y([w()],wt.prototype,"symbolSetsGroupQuery",void 0),y([w()],wt.prototype,"templatesGroupQuery",void 0),y([w()],wt.prototype,"thumbnail",void 0),y([w({readOnly:!0})],wt.prototype,"thumbnailUrl",null),y([w()],wt.prototype,"units",void 0),y([w()],wt.prototype,"url",void 0),y([w()],wt.prototype,"urlKey",void 0),y([$t("urlKey")],wt.prototype,"readUrlKey",null),y([w()],wt.prototype,"user",void 0),y([$t("user")],wt.prototype,"readUser",null),y([w()],wt.prototype,"use3dBasemaps",void 0),y([w()],wt.prototype,"useStandardizedQuery",void 0),y([w()],wt.prototype,"useVectorBasemaps",void 0),y([w()],wt.prototype,"vectorBasemapGalleryGroupQuery",void 0),wt=U1=y([Z("esri.portal.Portal")],wt);const os=wt,Wde=new FinalizationRegistry(t=>{t.remove()});function gQe(t){const e=yr;return()=>{const i=t.deref();i&&e.findCredential(i.restUrl)&&i.signIn().catch(()=>{})}}function yQe(t){var n,s;const e="metric";if(t==null)return e;const i=t.map,r=(i&&"portalItem"in i?(n=i.portalItem)==null?void 0:n.portal:null)??os.getDefault();switch(((s=r.user)==null?void 0:s.units)??r.units){case e:return e;case"english":return"imperial"}return VKe(t.spatialReference)??e}const ZCe={readOnly:!0,get(){return yQe(this.view)}};let _g=class extends ze{constructor(e){super(e),this.activeTool=null,this.activeViewModel=null,this.view=null}get areaUnit(){return this.defaultUnit}set areaUnit(e){this._overrideIfSome("areaUnit",e)}get linearUnit(){return this.defaultUnit}set linearUnit(e){this._overrideIfSome("linearUnit",e)}get state(){const{activeViewModel:e}=this;return e?e.state:"disabled"}};y([w({type:["area","distance","direct-line"]})],_g.prototype,"activeTool",void 0),y([w()],_g.prototype,"activeViewModel",void 0),y([w({type:RKe})],_g.prototype,"areaUnit",null),y([w(ZCe)],_g.prototype,"defaultUnit",void 0),y([w({type:dL})],_g.prototype,"linearUnit",null),y([w({readOnly:!0})],_g.prototype,"state",null),y([w()],_g.prototype,"view",void 0),_g=y([Z("esri.widgets.Measurement.MeasurementViewModel")],_g);const JCe=_g;function Gr(t){return(e,i)=>{e.hasOwnProperty("_messageBundleProps")||(e._messageBundleProps=e._messageBundleProps?e._messageBundleProps.slice():[]),e._messageBundleProps.push({bundlePath:t,propertyName:i})}}var vQe=function(t){return{vnodeSelector:"",properties:void 0,children:void 0,text:t.toString(),domNode:null}},KCe=function(t,e){for(var i=0,r=t.length;i{this._set("activeWidget",e)}),this.addHandles([_e(()=>[this.view,this.activeTool],async()=>{this._set("activeWidget",await this._getActiveWidget())}),_e(()=>this.activeWidget,(e,i)=>{this.viewModel.set("activeViewModel",e?e.viewModel:null),i&&(i.visible=!1)}),_e(()=>[this.areaUnit,this.linearUnit,this.uiStrings],()=>this._updateSubWidgetProperties())])}destroy(){this._destroyWidgets()}get activeTool(){return this.viewModel.activeTool}set activeTool(e){this.viewModel.activeTool=e}get areaUnit(){return this.viewModel.areaUnit}set areaUnit(e){this.viewModel.areaUnit=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get linearUnit(){return this.viewModel.linearUnit}set linearUnit(e){this.viewModel.linearUnit=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{activeWidget:e}=this,i=e&&!e.destroyed?e.render():null;return X("div",{class:Yde.base},i)}clear(){this.activeTool=null,this._destroyWidgets()}startMeasurement(){const{activeViewModel:e}=this.viewModel;e&&$m(e.start())}async _createWidget(e){const{areaUnit:i,linearUnit:r,view:n}=this;if(!n)return null;switch(e){case"area":{const{type:s}=n;switch(s){case"2d":return new(await we(()=>import("./AreaMeasurement2D-5lnD5-Sk.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))).default({view:n,unit:i,uiStrings:this._createUIStringsForWidget(e)});case"3d":return new(await we(()=>import("./AreaMeasurement3D-GOBHGg9B.js"),__vite__mapDeps([15,16,17,18,19,20,21,22,23,24,25,3,4,26,9,10,27,28,5,29,11,8,6,30,14]))).default({view:n,unit:i,uiStrings:this._createUIStringsForWidget(e)});default:return null}}case"distance":{const{type:s}=n;return s==="2d"?new(await we(()=>import("./DistanceMeasurement2D-0EP_w-h3.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))).default({view:n,unit:r,uiStrings:this._createUIStringsForWidget(e)}):null}case"direct-line":{const{type:s}=n;return s==="3d"?new(await we(()=>import("./DirectLineMeasurement3D-3Pkkgamv.js"),__vite__mapDeps([32,16,17,18,19,20,21,22,23,24,25,3,4,26,9,10,33,34,27,28,5,29,11,8,30,14]))).default({view:n,unit:r,uiStrings:this._createUIStringsForWidget(e)}):null}default:return null}}_destroyWidgets(){this._widgets.forEach(e=>e.destroy()),this._widgets.clear()}async _getActiveWidget(){const{activeTool:e,view:i}=this;if(!i||!e)return null;let r=null;if(this._widgets.has(e))r=this._widgets.get(e),r.visible=!0;else{if(r=await this._createWidget(e),!r)return null;await r.viewModel.start(),this._widgets.set(e,r)}return r}_createUIStringsForWidget(e){var r;if(!this.uiStrings)return;const i=e+"-"+((r=this.view)==null?void 0:r.type);return this.uiStrings[i]}_updateSubWidgetProperties(){this._widgets.forEach((e,i)=>{const{areaUnit:r,linearUnit:n}=this;e.unit=bQe(e)?r:n,e.uiStrings=this._createUIStringsForWidget(i)})}};y([w()],_h.prototype,"activeTool",null),y([w({readOnly:!0})],_h.prototype,"activeWidget",void 0),y([w()],_h.prototype,"areaUnit",null),y([w()],_h.prototype,"iconClass",void 0),y([w()],_h.prototype,"icon",void 0),y([w()],_h.prototype,"label",null),y([w()],_h.prototype,"linearUnit",null),y([w(),Gr("esri/widgets/Measurement/t9n/Measurement")],_h.prototype,"messages",void 0),y([w()],_h.prototype,"uiStrings",void 0),y([w()],_h.prototype,"view",null),y([w({type:JCe})],_h.prototype,"viewModel",void 0),_h=y([Z("esri.widgets.Measurement")],_h);const wQe=_h;function sd(t,e,i=it){return e||(e=new i),e===t||(e.removeAll(),xQe(t)?e.addMany(t):t&&e.add(t)),e}function nP(t){return t}function xQe(t){return t&&(Array.isArray(t)||"items"in t&&Array.isArray(t.items))}let YI=class extends it{constructor(e){super(e),this.addHandles([this.on("before-add",i=>{i.item==null&&i.preventDefault()}),this.on("after-add",i=>this._own(i.item)),this.on("after-remove",i=>this._release(i.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(it.ofType(this.itemType.Type))(e):new it(e)}};function Pz(t,e){return{type:t,cast:nP,set(i){const r=sd(i,this._get(e),t);r.owner=this,this._set(e,r)}}}y([w()],YI.prototype,"owner",null),YI=y([Z("esri.core.support.OwningCollection")],YI);function jO(t,e,i=!1){let{hasM:r,hasZ:n}=t;Array.isArray(e)?e.length!==4||r||n?e.length===3&&i&&!r?(n=!0,r=!1):e.length===3&&r&&n&&(r=!1,n=!1):(r=!0,n=!0):(n=!n&&e.hasZ&&(!r||e.hasM),r=!r&&e.hasM&&(!n||e.hasZ)),t.hasZ=n,t.hasM=r}var BZ;function Xde(t){return(e,i)=>e==null?i:i==null?e:t(e,i)}function SQe(t){return t&&(t.declaredClass==="esri.geometry.SpatialReference"||t.wkid!=null)}let Ub=BZ=class extends ix{constructor(...t){super(...t),this.points=[],this.type="multipoint"}normalizeCtorArgs(t,e){var n;if(!t&&!e)return{};const i={};Array.isArray(t)?(i.points=t,i.spatialReference=e):SQe(t)?i.spatialReference=t:(t.points&&(i.points=t.points),t.spatialReference&&(i.spatialReference=t.spatialReference),t.hasZ&&(i.hasZ=t.hasZ),t.hasM&&(i.hasM=t.hasM));const r=(n=i.points)==null?void 0:n[0];return r&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=r.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=r.length>3:i.hasM===void 0&&(i.hasM=r.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const t=this.points;if(!t.length)return null;const e=new Vi,i=this.hasZ,r=this.hasM,n=i?3:2,s=t[0],o=Xde(Math.min),l=Xde(Math.max);let c,f,_,x,[T,A]=s,[M,I]=s;for(let L=0,F=t.length;L2){const j=z[2];c=o(c,j),_=l(_,j)}if(r&&z.length>n){const j=z[n];f=o(f,j),x=l(x,j)}}return e.xmin=T,e.ymin=A,e.xmax=M,e.ymax=I,e.spatialReference=this.spatialReference,i?(e.zmin=c,e.zmax=_):(e.zmin=void 0,e.zmax=void 0),r?(e.mmin=f,e.mmax=x):(e.mmin=void 0,e.mmax=void 0),e}writePoints(t,e){e.points=Re(this.points)}addPoint(t){return jO(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange("points"),this}clone(){const t={points:Re(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new BZ(t)}getPoint(t){if(!this._validateInputs(t))return null;const e=this.points[t],i={x:e[0],y:e[1],spatialReference:this.spatialReference};let r=2;return this.hasZ&&(i.z=e[2],r=3),this.hasM&&(i.m=e[r]),new mt(i)}removePoint(t){if(!this._validateInputs(t))return null;const e=new mt(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange("points"),e}setPoint(t,e){return this._validateInputs(t)?(jO(this,e),Array.isArray(e)||(e=e.toArray()),this.points[t]=e,this.notifyChange("points"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return t!=null&&t>=0&&t{o.hasZ&&(n=!0),o.hasM&&(s=!0)}),r.map(o=>{const l=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(n&&o.hasZ){const c=.5*(o.zmax-o.zmin);for(let f=0;f2&&e.length>2){const n=t[2]-e[2];return Math.sqrt(i*i+r*r+n*n)}return Math.sqrt(i*i+r*r)}function QCe(t,e,i){const r=t[0]+i*(e[0]-t[0]),n=t[1]+i*(e[1]-t[1]);return t.length>2&&e.length>2?[r,n,t[2]+i*(e[2]-t[2])]:[r,n]}function XXt(t,e,i,r){const[n,s]=e,[o,l]=i,[c,f]=r,_=c-o,x=f-l,T=_*_+x*x,A=(n-o)*_+(s-l)*x,M=Math.min(1,Math.max(0,A/T));return t[0]=o+_*M,t[1]=l+x*M,t}function eAe(t,e){return QCe(t,e,.5)}function tAe(t){const e=t.length;let i=0;for(let r=0;r=0}function EQe(t){const e=t.length;return e>2&&Fy(t[0],t[e-1])}function ZXt(t){if("rings"in t&&(CQe(t),t.rings.length>0&&!XI(t.rings[0])))for(const e of t.rings)e.reverse()}function CQe(t){if("rings"in t)for(const e of t.rings)EQe(e)||e.push(e[0].slice())}function JXt(t){return t.type!=="polygon"&&t.type!=="polyline"||AQe(t.type==="polygon"?t.rings:t.paths,t.spatialReference),t}function AQe(t,e){const i=pp(e);if(!i)return;const r=i.valid[0],n=i.valid[1],s=n-r;for(const o of t){let l=1/0,c=-1/0;for(const _ of o){const x=rAe(_[0],r,n);l=Math.min(l,x),c=Math.max(c,x),_[0]=x}const f=c-l;s-f{_[0]<0&&(_[0]+=s)})}}function rAe(t,e,i){const r=i-e;return ti?e+(t-e)%r:t}function KXt(t,e){if(t===e)return!0;if(t.type!==e.type)return!1;if(t.type==="point"||t.type==="mesh"||t.type==="extent")return!0;if(t.type==="multipoint")return t.points.length===e.points.length;const[i,r]=t.type==="polyline"?[t.paths,e.paths]:[t.rings,e.rings];return i.length===r.length&&i.every((n,s)=>n.length===r[s].length)}function QXt(t){return t?t.hasZ?[t.xmax-t.xmin/2,t.ymax-t.ymin/2,t.zmax-t.zmin/2]:[t.xmax-t.xmin/2,t.ymax-t.ymin/2]:null}function MQe(t){return t?nAe(t.rings,t.hasZ??!1):null}function nAe(t,e){if(!(t!=null&&t.length))return null;const i=[],r=[],n=e?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let s=0,o=t.length;s{let l=s[2]-o[2];return l===0&&e&&(l=s[4]-o[4]),l}),r.length&&(i[0]=r[0][0],i[1]=r[0][1],e&&(i[2]=r[0][3]),(i[0]n[1]||i[1]n[3]||e&&(i[2]n[5]))&&(i.length=0)),!i.length){const s=t[0]&&t[0].length?OQe(t[0],e):null;if(!s)return null;i[0]=s[0],i[1]=s[1],e&&s.length>2&&(i[2]=s[2])}return i}function sAe(t,e,i){let r=0,n=0,s=0,o=0,l=0;const c=t.length?t[0][0]:0,f=t.length?t[0][1]:0,_=t.length&&e?t[0][2]:0;for(let T=0;T2&&M.length>2){const re=F-_,he=H-_,ce=z*he-Y*re;s+=(re+he)*ce,l+=ce}Ii[1]&&(i[1]=I),Li[3]&&(i[3]=L),e&&(Fi[5]&&(i[5]=F))}if(o>0&&(o*=-1),l>0&&(l*=-1),!o)return null;o*=.5,l*=.5;const x=[r/(6*o)+c,n/(6*o)+f,o];return e&&(i[4]===i[5]||l===0?(x[3]=(i[4]+i[5])/2,x[4]=0):(x[3]=s/(6*l)+_,x[4]=l)),x}function eZt(t,e){let i=0,r=0,n=0;t.nextPoint();const s=t.pathSize?t.x:0,o=t.pathSize?t.y:0;for(let l=0;le[1]&&(e[1]=_),xe[3]&&(e[3]=x)}return n>0&&(n*=-1),n?(n*=.5,[i/(6*n)+s,r/(6*n)+o,n]):null}function OQe(t,e){const i=e?[0,0,0]:[0,0],r=e?[0,0,0]:[0,0];let n=0,s=0,o=0,l=0;for(let c=0,f=t.length;c2&&x.length>2&&(i[2]=_[2],r[2]=x[2]);const T=pB(i,r);if(T){n+=T;const A=eAe(_,x);s+=T*A[0],o+=T*A[1],e&&A.length>2&&(l+=T*A[2])}}}return n>0?e?[s/n,o/n,l/n]:[s/n,o/n]:t.length?t[0]:null}function PQe(t){const{hasZ:e,totalSize:i}=t;if(i===0)return null;const r=[],n=[],s=e?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];for(t.reset();t.nextPath();){const o=sAe(TQe(t),t.hasZ,s);o&&n.push(o)}if(n.sort((o,l)=>{let c=o[2]-l[2];return c===0&&e&&(c=o[4]-l[4]),c}),n.length&&(r[0]=n[0][0],r[1]=n[0][1],e&&(r[2]=n[0][3]),(r[0]s[1]||r[1]s[3]||e&&(r[2]s[5]))&&(r.length=0)),!r.length){t.reset(),t.nextPath();const o=t.pathSize?RQe(t):null;if(!o)return null;r[0]=o[0],r[1]=o[1],e&&o.length>2&&(r[2]=o[2])}return r}function RQe(t){const{hasZ:e}=t,i=e?[0,0,0]:[0,0],r=e?[0,0,0]:[0,0];let n=0,s=0,o=0,l=0;if(t.nextPoint()){let c=t.x,f=t.y,_=t.z;for(;t.nextPoint();){const x=t.x,T=t.y,A=t.z;i[0]=c,i[1]=f,r[0]=x,r[1]=T,e&&(i[2]=_,r[2]=A);const M=pB(i,r);if(M){n+=M;const I=eAe(i,r);s+=M*I[0],o+=M*I[1],e&&I.length>2&&(l+=M*I[2])}c=x,f=T,_=A}}return n>0?e?[s/n,o/n,l/n]:[s/n,o/n]:t.pathSize?(t.seekPathStart(),t.nextPoint(),[t.x,t.y]):null}const IQe=1e-6;function tZt(t){let e=0;for(t.reset();t.nextPath();)e+=t.getCurrentRingArea();if(e0&&(s=1/Math.sqrt(s),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s),t}function Ve(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Wt(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[0],l=i[1],c=i[2];return t[0]=n*c-s*l,t[1]=s*o-r*c,t[2]=r*l-n*o,t}function Qr(t,e,i,r){const n=e[0],s=e[1],o=e[2];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t[2]=o+r*(i[2]-o),t}function jQe(t,e,i,r,n,s){const o=s*s,l=o*(2*s-3)+1,c=o*(s-2)+s,f=o*(s-1),_=o*(3-2*s);return t[0]=e[0]*l+i[0]*c+r[0]*f+n[0]*_,t[1]=e[1]*l+i[1]*c+r[1]*f+n[1]*_,t[2]=e[2]*l+i[2]*c+r[2]*f+n[2]*_,t}function GQe(t,e,i,r,n,s){const o=1-s,l=o*o,c=s*s,f=l*o,_=3*s*l,x=3*c*o,T=c*s;return t[0]=e[0]*f+i[0]*_+r[0]*x+n[0]*T,t[1]=e[1]*f+i[1]*_+r[1]*x+n[1]*T,t[2]=e[2]*f+i[2]*_+r[2]*x+n[2]*T,t}function HQe(t,e){e=e||1;const i=M9,r=2*i()*Math.PI,n=2*i()-1,s=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*s,t[1]=Math.sin(r)*s,t[2]=n*e,t}function bt(t,e,i){const r=e[0],n=e[1],s=e[2];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12],t[1]=i[1]*r+i[5]*n+i[9]*s+i[13],t[2]=i[2]*r+i[6]*n+i[10]*s+i[14],t}function qh(t,e,i){const r=e[0],n=e[1],s=e[2];return t[0]=r*i[0]+n*i[3]+s*i[6],t[1]=r*i[1]+n*i[4]+s*i[7],t[2]=r*i[2]+n*i[5]+s*i[8],t}function Of(t,e,i){const r=i[0],n=i[1],s=i[2],o=i[3],l=e[0],c=e[1],f=e[2];let _=n*f-s*c,x=s*l-r*f,T=r*c-n*l,A=n*T-s*x,M=s*_-r*T,I=r*x-n*_;const L=2*o;return _*=L,x*=L,T*=L,A*=2,M*=2,I*=2,t[0]=l+_+A,t[1]=c+x+M,t[2]=f+T+I,t}function qQe(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],s[0]=n[0],s[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),s[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function WQe(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],s[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),s[1]=n[1],s[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function YQe(t,e,i,r){const n=[],s=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],s[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),s[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),s[2]=n[2],t[0]=s[0]+i[0],t[1]=s[1]+i[1],t[2]=s[2]+i[2],t}function mAe(t,e){Ne(j6,t),Ne(G6,e),Ye(j6,j6),Ye(G6,G6);const i=Ve(j6,G6);return i>1?0:i<-1?Math.PI:Math.acos(i)}const j6=W(),G6=W();function XQe(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function jr(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function M2(t,e){if(t===e)return!0;const i=t[0],r=t[1],n=t[2],s=e[0],o=e[1],l=e[2],c=sl();return Math.abs(i-s)<=c*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-o)<=c*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-l)<=c*Math.max(1,Math.abs(n),Math.abs(l))}function R_(t,e,i){const r=i[0]-e[0],n=i[1]-e[1],s=i[2]-e[2];let o=r*r+n*n+s*s;return o>0?(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=s*o,t):(t[0]=0,t[1]=0,t[2]=0,t)}const xn=je,ZQe=gB,JQe=Rz,O9=Sn,vB=Co,$h=rt,HO=El,Jde=Object.freeze(Object.defineProperty({__proto__:null,abs:GO,add:Be,angle:mAe,bezier:GQe,ceil:UQe,copy:Ne,cross:Wt,direction:R_,dist:O9,distance:Sn,div:JQe,divide:Rz,dot:Ve,equals:M2,exactEquals:jr,floor:pAe,hermite:jQe,inverse:BQe,len:$h,length:rt,lerp:Qr,max:fAe,min:yB,mul:ZQe,multiply:gB,negate:Sc,normalize:Ye,random:HQe,rotateX:qQe,rotateY:WQe,rotateZ:YQe,round:VQe,scale:De,scaleAndAdd:ao,set:Ie,sign:Iz,sqrDist:vB,sqrLen:HO,squaredDistance:Co,squaredLength:El,str:XQe,sub:xn,subtract:je,transformMat3:qh,transformMat4:bt,transformQuat:Of},Symbol.toStringTag,{value:"Module"}));function mm(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function rs(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}function rse(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function gAe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function yAe(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t}function vAe(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3],t}function KQe(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function QQe(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function eet(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t[2]=Math.min(e[2],i[2]),t[3]=Math.min(e[3],i[3]),t}function tet(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t[2]=Math.max(e[2],i[2]),t[3]=Math.max(e[3],i[3]),t}function iet(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function UT(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function ret(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t}function _Ae(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return Math.sqrt(i*i+r*r+n*n+s*s)}function $z(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2],s=e[3]-t[3];return i*i+r*r+n*n+s*s}function nse(t){const e=t[0],i=t[1],r=t[2],n=t[3];return Math.sqrt(e*e+i*i+r*r+n*n)}function sse(t){const e=t[0],i=t[1],r=t[2],n=t[3];return e*e+i*i+r*r+n*n}function net(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function set(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function bAe(t,e){const i=e[0],r=e[1],n=e[2],s=e[3];let o=i*i+r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o),t[0]=i*o,t[1]=r*o,t[2]=n*o,t[3]=s*o),t}function wAe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function _B(t,e,i,r){const n=e[0],s=e[1],o=e[2],l=e[3];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t[2]=o+r*(i[2]-o),t[3]=l+r*(i[3]-l),t}function oet(t,e){const i=M9;let r,n,s,o,l,c;e=e||1;do r=2*i()-1,n=2*i()-1,l=r*r+n*n;while(l>=1);do s=2*i()-1,o=2*i()-1,c=s*s+o*o;while(c>=1);const f=Math.sqrt((1-l)/c);return t[0]=e*r,t[1]=e*n,t[2]=e*s*f,t[3]=e*o*f,t}function lp(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*o,t[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*o,t[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*o,t[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*o,t}function aet(t,e,i){const r=e[0],n=e[1],s=e[2],o=i[0],l=i[1],c=i[2],f=i[3],_=f*r+l*s-c*n,x=f*n+c*r-o*s,T=f*s+o*n-l*r,A=-o*r-l*n-c*s;return t[0]=_*f+A*-o+x*-c-T*-l,t[1]=x*f+A*-l+T*-o-_*-c,t[2]=T*f+A*-c+_*-l-x*-o,t[3]=e[3],t}function cet(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function rO(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function VT(t,e){const i=t[0],r=t[1],n=t[2],s=t[3],o=e[0],l=e[1],c=e[2],f=e[3],_=sl();return Math.abs(i-o)<=_*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-l)<=_*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(n-c)<=_*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(s-f)<=_*Math.max(1,Math.abs(s),Math.abs(f))}const uet=gAe,het=yAe,det=vAe,pet=_Ae,fet=$z,met=nse,get=sse,xAe=Object.freeze(Object.defineProperty({__proto__:null,add:rse,ceil:KQe,copy:mm,dist:pet,distance:_Ae,div:det,divide:vAe,dot:wAe,equals:VT,exactEquals:rO,floor:QQe,inverse:set,len:met,length:nse,lerp:_B,max:tet,min:eet,mul:het,multiply:yAe,negate:net,normalize:bAe,random:oet,round:iet,scale:UT,scaleAndAdd:ret,set:rs,sqrDist:fet,sqrLen:get,squaredDistance:$z,squaredLength:sse,str:cet,sub:uet,subtract:gAe,transformMat4:lp,transformQuat:aet},Symbol.toStringTag,{value:"Module"})),Kde=new Float32Array(1);function SAe(t){--t;for(let e=1;e<32;e<<=1)t|=t>>e;return t+1}function Je(t,e,i){return Math.min(Math.max(t,e),i)}function yet(t,e){return e===0?0:Math.round(t/e)*e}function BT(t){return(t&t-1)==0}function iZt(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}function rZt(t){return 10**Math.ceil(Math.LOG10E*Math.log(t))}function ui(t,e,i){return t+(e-t)*i}function nZt(t,e,i,r,n){return ui(r,n,(t-e)/(i-e))}function Ei(t){return t*Math.PI/180}function pu(t){return 180*t/Math.PI}function jZ(t,e=1e-6){return(t<0?-1:1)/Math.max(Math.abs(t),e)}function Ca(t){return Math.acos(Je(t,-1,1))}function Gf(t){return Math.asin(Je(t,-1,1))}function Ey(t,e,i=1e-6){return t===e?!0:!Number.isFinite(t)||!Number.isFinite(e)?!1:(t>e?t-e:e-t)<=i}const Lz=new DataView(new ArrayBuffer(Float64Array.BYTES_PER_ELEMENT));function GZ(t){return Lz.setFloat64(0,t),Lz.getBigInt64(0)}function vet(t){return Lz.setBigInt64(0,t),Lz.getFloat64(0)}const w7=BigInt("1000000"),_et=TAe(1);function TAe(t){const e=GZ(t=Math.abs(t)),i=vet(e<=w7?w7:e-w7);return Math.abs(t-i)}function sZt(t,e,i=_et){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;if(i!=null&&TAe(Math.min(Math.abs(t),Math.abs(e)))w7)}function bet(t,e,i=1e-6){if(t===e)return!0;if(!Number.isFinite(t)||!Number.isFinite(e))return!1;const r=Math.abs(t-e),n=Math.abs(t),s=Math.abs(e);if(t===0||e===0||n<1e-12&&s<1e-12){if(r>.01*i)return!1}else if(r/(n+s)>i)return!1;return!0}function wet(t){return EAe(Math.max(-HZ,Math.min(t,HZ)))}function EAe(t){return Kde[0]=t,Kde[0]}function pL(t,e,i){const r=Je((i-t)/(e-t),0,1);return r*r*(3-2*r)}function Qde(t,e){const i=rt(t),r=Gf(t[2]/i),n=Math.atan2(t[1]/i,t[0]/i);return Ie(e,i,r,n),e}function oZt(t){const e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[3]*t[3]+t[4]*t[4]+t[5]*t[5],r=t[6]*t[6]+t[7]*t[7]+t[8]*t[8];return!(Ey(e,1)&&Ey(i,1)&&Ey(r,1))}function xet(t,e){return(t%e+e)%e}const HZ=EAe(34028234663852886e22);function Ni(t=Aet){return[t[0],t[1],t[2],t[3]]}function aZt(t){return[t[0],t[1],t[2],t[3]]}function d_(t,e){return t!==e&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3]),t}function ose(t,e,i,r,n=Ni()){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function ase(t,e=Ni()){return e[0]=t.xmin,e[1]=t.ymin,e[2]=t.xmax,e[3]=t.ymax,e}function bB(t,e){return new Vi({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:e})}function nO(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])}function g2(t,e,i){if(e!=null)if("length"in e)YZ(e)?(i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.max(t[2],e[2]),i[3]=Math.max(t[3],e[3])):e.length!==2&&e.length!==3||(i[0]=Math.min(t[0],e[0]),i[1]=Math.min(t[1],e[1]),i[2]=Math.max(t[2],e[0]),i[3]=Math.max(t[3],e[1]));else switch(e.type){case"extent":i[0]=Math.min(t[0],e.xmin),i[1]=Math.min(t[1],e.ymin),i[2]=Math.max(t[2],e.xmax),i[3]=Math.max(t[3],e.ymax);break;case"point":i[0]=Math.min(t[0],e.x),i[1]=Math.min(t[1],e.y),i[2]=Math.max(t[2],e.x),i[3]=Math.max(t[3],e.y)}else d_(i,t)}function yH(t,e,i=t){const r=e.length;let n=t[0],s=t[1],o=t[2],l=t[3];for(let c=0;c=t[2]?0:t[2]-t[0]}function qu(t){return t==null||t[1]>=t[3]?0:t[3]-t[1]}function lZt(t){return _c(t)*qu(t)}function Dz(t){return _c(t)>0&&qu(t)>0}function lse(t,e=[0,0]){return e[0]=(t[0]+t[2])/2,e[1]=(t[1]+t[3])/2,e}function CAe(t,e){return wB(t,e[0],e[1])}function epe(t,e){const i=e[3],r=.5*(t[0]+t[2]),n=Math.abs(e[0]-r),s=.5*(t[2]-t[0]);if(n>i+s)return!1;const o=.5*(t[1]+t[3]),l=.5*(t[3]-t[1]),c=Math.abs(e[1]-o);if(c>i+l)return!1;if(n(_-c)*L+(l-f)*F+(f*c-l*_)<0,T=x(r,o),A=x(s,o),M=x(s,n),I=x(r,n);return!(T===A&&A===M&&M===I&&I===T||ls&&f>s||c>o&&_>o||c=t[0]&&i>=t[1]&&e<=t[2]&&i<=t[3]}function Tet(t,e,i){return e[0]>=t[0]-i&&e[1]>=t[1]-i&&e[0]<=t[2]+i&&e[1]<=t[3]+i}function P9(t,e){return Math.max(e[0],t[0])<=Math.min(e[2],t[2])&&Math.max(e[1],t[1])<=Math.min(e[3],t[3])}function Nz(t,e){return e[0]>=t[0]&&e[2]<=t[2]&&e[1]>=t[1]&&e[3]<=t[3]}function WZ(t,e,i){if(e==null)return d_(i,t);const r=e[0],n=e[1],s=e[2],o=e[3];return i[0]=Je(t[0],r,s),i[1]=Je(t[1],n,o),i[2]=Je(t[2],r,s),i[3]=Je(t[3],n,o),i}function Eet(t,e){const i=(t[0]+t[2])/2,r=(t[1]+t[3])/2,n=Math.max(Math.abs(e[0]-i)-_c(t)/2,0),s=Math.max(Math.abs(e[1]-r)-qu(t)/2,0);return Math.sqrt(n*n+s*s)}function Fz(t,e,i,r=t){return r[0]=t[0]+e,r[1]=t[1]+i,r[2]=t[2]+e,r[3]=t[3]+i,r}function od(t){return t?d_(t,XZ):Ni(XZ)}function YZ(t){return t!=null&&t.length===4}function Cet(t){return!(_c(t)!==0&&isFinite(t[0])||qu(t)!==0&&isFinite(t[1]))}function uT(t,e){return YZ(t)&&YZ(e)?t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]:t===e}const hZt=[-1/0,-1/0,1/0,1/0],XZ=[1/0,1/0,-1/0,-1/0],Aet=[0,0,0,0];function AAe(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function MAe(t){return t.points!==void 0}function OAe(t){return t.x!==void 0&&t.y!==void 0}function PAe(t){return t.paths!==void 0}function RAe(t){return t.rings!==void 0}function IAe(t){function e(i,r){return i==null?r:r==null?i:t(i,r)}return e}const Kw=IAe(Math.min),Qw=IAe(Math.max);function dZt(t,e){return PAe(e)?qO(t,e.paths,!1,!1):RAe(e)?qO(t,e.rings,!1,!1):MAe(e)?cse(t,e.points,!1,!1,!1,!1):AAe(e)?$Ae(t,e):(OAe(e)&&(t[0]=e.x,t[1]=e.y,t[2]=e.x,t[3]=e.y),t)}function pZt(t){let e,i,r,n;for(t.reset(),e=r=1/0,i=n=-1/0;t.nextPath();){const s=Met(t);e=Math.min(s[0],e),r=Math.min(s[1],r),i=Math.max(s[2],i),n=Math.max(s[3],n)}return Ni([e,r,i,n])}function Met(t){let e,i,r,n;for(e=r=1/0,i=n=-1/0;t.nextPoint();)e=Math.min(t.x,e),r=Math.min(t.y,r),i=Math.max(t.x,i),n=Math.max(t.y,n);return Ni([e,r,i,n])}function fZt(t,e){return PAe(e)?qO(t,e.paths,!0,!1):RAe(e)?qO(t,e.rings,!0,!1):MAe(e)?cse(t,e.points,!0,!1,!0,!1):AAe(e)?$Ae(t,e,!0,!1,!0,!1):(OAe(e)&&(t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.x,t[4]=e.y,t[5]=e.z),t)}function qO(t,e,i,r){const n=i?3:2;if(!e.length||!e[0].length)return null;let s,o,l,c,[f,_]=e[0][0],[x,T]=e[0][0];for(let A=0;A2){const k=L[2];s=Kw(s,k),o=Qw(o,k)}if(r&&L.length>n){const k=L[n];l=Kw(s,k),c=Qw(o,k)}}}return i?r?(t[0]=f,t[1]=_,t[2]=s,t[3]=l,t[4]=x,t[5]=T,t[6]=o,t[7]=c,t.length=8,t):(t[0]=f,t[1]=_,t[2]=s,t[3]=x,t[4]=T,t[5]=o,t.length=6,t):r?(t[0]=f,t[1]=_,t[2]=l,t[3]=x,t[4]=T,t[5]=c,t.length=6,t):(t[0]=f,t[1]=_,t[2]=x,t[3]=T,t.length=4,t)}function $Ae(t,e,i,r,n,s){const o=e.xmin,l=e.xmax,c=e.ymin,f=e.ymax;let _=e.zmin,x=e.zmax,T=e.mmin,A=e.mmax;return n?(_=_||0,x=x||0,s?(T=T||0,A=A||0,t[0]=o,t[1]=c,t[2]=_,t[3]=T,t[4]=l,t[5]=f,t[6]=x,t[7]=A,t):(t[0]=o,t[1]=c,t[2]=_,t[3]=l,t[4]=f,t[5]=x,t)):s?(T=T||0,A=A||0,t[0]=o,t[1]=c,t[2]=T,t[3]=l,t[4]=f,t[5]=A,t):(t[0]=o,t[1]=c,t[2]=l,t[3]=f,t)}function cse(t,e,i,r,n,s){const o=i?3:2,l=r&&s,c=i&&n;if(!e.length||!e[0].length)return null;let f,_,x,T,[A,M]=e[0],[I,L]=e[0];for(let F=0;F2){const j=z[2];f=Kw(f,j),_=Qw(_,j)}if(l&&z.length>o){const j=z[o];x=Kw(f,j),T=Qw(_,j)}}return n?(f=f||0,_=_||0,s?(x=x||0,T=T||0,t[0]=A,t[1]=M,t[2]=f,t[3]=x,t[4]=I,t[5]=L,t[6]=_,t[7]=T,t):(t[0]=A,t[1]=M,t[2]=f,t[3]=I,t[4]=L,t[5]=_,t)):s?(x=x||0,T=T||0,t[0]=A,t[1]=M,t[2]=x,t[3]=I,t[4]=L,t[5]=T,t):(t[0]=A,t[1]=M,t[2]=I,t[3]=L,t)}function Oet(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function Pet(t){return t.points!==void 0}function Ret(t){return t.x!==void 0&&t.y!==void 0}function Iet(t){return t.paths!==void 0}function $et(t){return t.rings!==void 0}const use=[];function LAe(t,e,i,r){return{xmin:t,ymin:e,xmax:i,ymax:r}}function DAe(t,e,i,r,n,s){return{xmin:t,ymin:e,zmin:i,xmax:r,ymax:n,zmax:s}}function NAe(t,e,i,r,n,s){return{xmin:t,ymin:e,mmin:i,xmax:r,ymax:n,mmax:s}}function FAe(t,e,i,r,n,s,o,l){return{xmin:t,ymin:e,zmin:i,mmin:r,xmax:n,ymax:s,zmax:o,mmax:l}}function hse(t,e=!1,i=!1){return e?i?FAe(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]):DAe(t[0],t[1],t[2],t[3],t[4],t[5]):i?NAe(t[0],t[1],t[2],t[3],t[4],t[5]):LAe(t[0],t[1],t[2],t[3])}function mZt(t){return t?Oet(t)?t:Ret(t)?Det(t):$et(t)?kAe(t):Iet(t)?zAe(t):Pet(t)?Let(t):null:null}function Let(t){const{hasZ:e,hasM:i,points:r}=t;return hse(cse(use,r,e??!1,i??!1),e,i)}function Det(t){const{x:e,y:i,z:r,m:n}=t,s=n!=null;return r!=null?s?FAe(e,i,r,n,e,i,r,n):DAe(e,i,r,e,i,r):s?NAe(e,i,n,e,i,n):LAe(e,i,e,i)}function kAe(t){const{hasZ:e,hasM:i,rings:r}=t,n=qO(use,r,e??!1,i??!1);return n?hse(n,e,i):null}function zAe(t){const{hasZ:e,hasM:i,paths:r}=t,n=qO(use,r,e??!1,i??!1);return n?hse(n,e,i):null}var x7;function tpe(t){return!Array.isArray(t[0])}let bg=x7=class extends ix{static fromExtent(t){const e=t.clone().normalize(),i=t.spatialReference;let r=!1,n=!1;for(const o of e)o.hasZ&&(r=!0),o.hasM&&(n=!0);const s={rings:e.map(o=>{const l=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(r&&o.hasZ){const c=o.zmin+.5*(o.zmax-o.zmin);for(let f=0;f2,r=s.length>3):i===void 0?i=r?s.length>3:s.length>2:r===void 0&&(r=i?s.length>3:s.length>2)),{rings:n,spatialReference:e,hasZ:i,hasM:r}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const t=MQe(this);if(!t||isNaN(t[0])||isNaN(t[1])||this.hasZ&&isNaN(t[2]))return null;const e=new mt;return e.x=t[0],e.y=t[1],e.spatialReference=this.spatialReference,this.hasZ&&(e.z=t[2]),e}get extent(){const{spatialReference:t}=this,e=kAe(this);if(!e)return null;const i=new Vi(e);return i.spatialReference=t,i}get isSelfIntersecting(){return cQe(this.rings)}writeRings(t,e){e.rings=Re(this.rings)}addRing(t){if(!t)return;const e=this.rings,i=e.length;if(tpe(t)){const r=[];for(let n=0,s=t.length;nn===c&&s===f&&(o==null&&_==null||o===_)&&(l==null&&x==null||l===x);for(let n=0;nthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):t,XI(e)}getPoint(t,e){if(!this._validateInputs(t,e))return null;const i=this.rings[t][e],r=this.hasZ,n=this.hasM;return r&&!n?new mt(i[0],i[1],i[2],void 0,this.spatialReference):n&&!r?new mt(i[0],i[1],void 0,i[2],this.spatialReference):r&&n?new mt(i[0],i[1],i[2],i[3],this.spatialReference):new mt(i[0],i[1],this.spatialReference)}insertPoint(t,e,i){return this._validateInputs(t,e,!0)?(jO(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[t].splice(e,0,i),this.notifyChange("rings"),this):this}removePoint(t,e){if(!this._validateInputs(t,e))return null;const i=new mt(this.rings[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(t){if(!this._validateInputs(t,null))return null;const e=this.rings.splice(t,1)[0],i=this.spatialReference,r=e.map(n=>new mt(n,i));return this.notifyChange("rings"),r}setPoint(t,e,i){return this._validateInputs(t,e)?(jO(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[t][e]=i,this.notifyChange("rings"),this):this}_validateInputs(t,e,i=!1){if(t==null||t<0||t>=this.rings.length)return!1;if(e!=null){const r=this.rings[t];if(i&&(e<0||e>r.length)||!i&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};y([w({readOnly:!0})],bg.prototype,"cache",null),y([w({readOnly:!0})],bg.prototype,"centroid",null),y([w({readOnly:!0})],bg.prototype,"extent",null),y([w({readOnly:!0})],bg.prototype,"isSelfIntersecting",null),y([w({type:[[[Number]]],json:{write:{isRequired:!0}}})],bg.prototype,"rings",void 0),y([Pt("rings")],bg.prototype,"writeRings",null),bg=x7=y([Z("esri.geometry.Polygon")],bg),bg.prototype.toJSON.isDefaultToJSON=!0;const Qa=bg;var ZZ;function Net(t){return!Array.isArray(t[0])}let Vb=ZZ=class extends ix{constructor(...t){super(...t),this.paths=[],this.type="polyline"}normalizeCtorArgs(t,e){var o,l;let i,r,n=null,s=null;return t&&!Array.isArray(t)?(n=t.paths??null,e||(t.spatialReference?e=t.spatialReference:t.paths||(e=t)),i=t.hasZ,r=t.hasM):n=t,n=n||[],e=e||at.WGS84,n.length&&((o=n[0])==null?void 0:o[0])!=null&&typeof n[0][0]=="number"&&(n=[n]),s=(l=n[0])==null?void 0:l[0],s&&(i===void 0&&r===void 0?(i=s.length>2,r=!1):i===void 0?i=!r&&s.length>3:r===void 0&&(r=!i&&s.length>3)),{paths:n,spatialReference:e,hasZ:i,hasM:r}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:t}=this,e=zAe(this);if(!e)return null;const i=new Vi(e);return i.spatialReference=t,i}writePaths(t,e){e.paths=Re(this.paths)}addPath(t){if(!t)return;const e=this.paths,i=e.length;if(Net(t)){const r=[];for(let n=0,s=t.length;nnew mt(n,i));return this.notifyChange("paths"),r}removePoint(t,e){if(!this._validateInputs(t,e))return null;const i=new mt(this.paths[t].splice(e,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(t,e,i){return this._validateInputs(t,e)?(jO(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[t][e]=i,this.notifyChange("paths"),this):this}_validateInputs(t,e,i=!1){if(t==null||t<0||t>=this.paths.length)return!1;if(e!=null){const r=this.paths[t];if(i&&(e<0||e>r.length)||!i&&(e<0||e>=r.length))return!1}return!0}toJSON(t){return this.write({},t)}};y([w({readOnly:!0})],Vb.prototype,"cache",null),y([w({readOnly:!0})],Vb.prototype,"extent",null),y([w({type:[[[Number]]],json:{write:{isRequired:!0}}})],Vb.prototype,"paths",void 0),y([Pt("paths")],Vb.prototype,"writePaths",null),Vb=ZZ=y([Z("esri.geometry.Polyline")],Vb),Vb.prototype.toJSON.isDefaultToJSON=!0;const xc=Vb,UAe=fu()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),gZt=fu()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"});function VAe(t){return t.xmin!==void 0&&t.ymin!==void 0&&t.xmax!==void 0&&t.ymax!==void 0}function dse(t){return t.points!==void 0}function pse(t){return t.x!==void 0&&t.y!==void 0}function fse(t){return t.paths!==void 0}function xB(t){return t.rings!==void 0}function O2(t){return t==null?null:t instanceof ix?t:pse(t)?mt.fromJSON(t):fse(t)?xc.fromJSON(t):xB(t)?Qa.fromJSON(t):dse(t)?Cm.fromJSON(t):VAe(t)?Vi.fromJSON(t):null}function R9(t){return t?pse(t)?"esriGeometryPoint":fse(t)?"esriGeometryPolyline":xB(t)?"esriGeometryPolygon":VAe(t)?"esriGeometryEnvelope":dse(t)?"esriGeometryMultipoint":null:null}const Fet={esriGeometryPoint:mt,esriGeometryPolyline:xc,esriGeometryPolygon:Qa,esriGeometryEnvelope:Vi,esriGeometryMultipoint:Cm};function ket(t){return t&&Fet[t]||null}const I9={base:ix,key:"type",typeMap:{extent:Vi,multipoint:Cm,point:mt,polyline:xc,polygon:Qa}};zy(I9);let BAe=0;const I_=t=>{let e=class extends t{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+BAe++})}};return e=y([Z("esri.core.Identifiable")],e),e},yZt=t=>{let e=class extends t{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:BAe++})}};return e=y([Z("esri.core.NumericIdentifiable")],e),e};let ipe=class extends I_(class{}){};ipe=y([Z("esri.core.Identifiable")],ipe);async function zet(t){const e="portalItem"in t?t:{portalItem:t},{fromItem:i}=await we(()=>import("./portalLayers-AqjAd9kT.js").then(r=>r.p),__vite__mapDeps([35,36]));try{return await i(e)}catch(r){const n=e&&e.portalItem,s=(n==null?void 0:n.id)||"unset",o=n&&n.portal&&n.portal.url||Ar.portalUrl;throw Ce.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+s+"')",r),r}}let Uet=0,La=class extends Dn.EventedMixin(I_(jf)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Vi(-180,-90,180,90,at.WGS84),this.id=Date.now().toString(16)+"-layer-"+Uet++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=at.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const i=typeof e=="string"?{url:e}:e;return(await we(()=>import("./arcgisLayers-Ja4-CB3n.js"),__vite__mapDeps([37,38,36]))).fromUrl(i)}static fromPortalItem(e){return zet(e)}initialize(){this.when().catch(e=>{sn(e)||Ce.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const i=this;"layers"in e&&e.layers.includes(i)?e.layers.remove(i):"tables"in e&&e.tables.includes(i)?e.tables.remove(i):"baseLayers"in e&&e.baseLayers.includes(i)?e.baseLayers.remove(i):"referenceLayers"in e&&e.referenceLayers.includes(i)&&e.referenceLayers.remove(i),this._set("parent",null)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return qs(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await bi(e,{query:{f:"json"},responseType:"json"})).data;throw new se("layer:no-attribution-data","Layer does not have attribution data")}};y([w({type:String})],La.prototype,"attributionDataUrl",void 0),y([w({type:Vi})],La.prototype,"fullExtent",void 0),y([w({readOnly:!0})],La.prototype,"hasAttributionData",null),y([w({type:String,clonable:!1})],La.prototype,"id",void 0),y([w({type:Boolean,nonNullable:!0})],La.prototype,"legendEnabled",void 0),y([w({type:["show","hide","hide-children"]})],La.prototype,"listMode",void 0),y([w({type:Number,range:{min:0,max:1},nonNullable:!0})],La.prototype,"opacity",void 0),y([w({clonable:!1})],La.prototype,"parent",void 0),y([w({readOnly:!0})],La.prototype,"parsedUrl",null),y([w({type:Boolean,readOnly:!0})],La.prototype,"persistenceEnabled",void 0),y([w({type:Boolean})],La.prototype,"popupEnabled",void 0),y([w({type:Boolean})],La.prototype,"attributionVisible",void 0),y([w({type:at})],La.prototype,"spatialReference",void 0),y([w({type:String})],La.prototype,"title",void 0),y([w({readOnly:!0,json:{read:!1}})],La.prototype,"type",void 0),y([w()],La.prototype,"url",void 0),y([w({type:Boolean,nonNullable:!0})],La.prototype,"visible",void 0),La=y([Z("esri.layers.Layer")],La);const uE=La,kz={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function jAe(t){return!!kz[t]||!!kz[t.toLowerCase()]}function mse(t){return kz[t]??kz[t.toLowerCase()]}function Vet(t){return[...mse(t)]}function vH(t,e,i){i<0&&++i,i>1&&--i;const r=6*i;return r<1?t+(e-t)*r:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function GAe(t,e,i,r=1){const n=(t%360+360)%360/360,s=i<=.5?i*(e+1):i+e-i*e,o=2*i-s;return[Math.round(255*vH(o,s,n+1/3)),Math.round(255*vH(o,s,n)),Math.round(255*vH(o,s,n-1/3)),r]}function Bet(t){const e=t.length>5,i=e?8:4,r=(1<>=i,l[3]=n*c/255),c=o&r,o>>=i,l[2]=n*c,c=o&r,o>>=i,l[1]=n*c,c=o&r,o>>=i,l[0]=n*c,l}const jet=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,Get="screenUtils.toPt: input not recognized!",HAe=96;function Tr(t){return t?t/72*HAe:0}function ad(t){return t?72*t/HAe:0}function vs(t){if(typeof t=="string"){const e=t.match(jet);if(e){const i=Number(e[1]),r=e[3]&&e[3].toLowerCase(),n=t.charAt(0)==="-",s=r==="px"?ad(i):i;return n?-s:s}return console.warn(Get),null}return t}function Ku(t=0,e=0){return{x:t,y:e}}function ss(t=0,e=0){return[t,e]}function gse(t=0,e=0){return[t,e]}function Za(t=0,e=0,i=0){return[t,e,i]}function bZt(t){return t}function wZt(t){return t}function xZt(t){return t}function dm(t,e){return e?(e[0]=t.x,e[1]=t.y,e.length>2&&(e[2]=0),e):[t.x,t.y]}function SB(){const t=new Float32Array(16);return t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function Het(t){const e=new Float32Array(16);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 qet(t,e,i,r,n,s,o,l,c,f,_,x,T,A,M,I){const L=new Float32Array(16);return L[0]=t,L[1]=e,L[2]=i,L[3]=r,L[4]=n,L[5]=s,L[6]=o,L[7]=l,L[8]=c,L[9]=f,L[10]=_,L[11]=x,L[12]=T,L[13]=A,L[14]=M,L[15]=I,L}function Wet(t,e){return new Float32Array(t,e,16)}const Yet=SB();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:Yet,clone:Het,create:SB,createView:Wet,fromValues:qet},Symbol.toStringTag,{value:"Module"}));function Ao(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[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 s1(t,e,i,r,n,s,o,l,c,f,_,x,T,A,M,I,L){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=s,t[5]=o,t[6]=l,t[7]=c,t[8]=f,t[9]=_,t[10]=x,t[11]=T,t[12]=A,t[13]=M,t[14]=I,t[15]=L,t}function Hf(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ld(t,e){if(t===e){const i=e[1],r=e[2],n=e[3],s=e[6],o=e[7],l=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=s,t[11]=e[14],t[12]=n,t[13]=o,t[14]=l}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function sP(t,e){return Vo(t,e)||Hf(t),t}function Vo(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],_=e[8],x=e[9],T=e[10],A=e[11],M=e[12],I=e[13],L=e[14],F=e[15],z=i*l-r*o,k=i*c-n*o,U=i*f-s*o,j=r*c-n*l,H=r*f-s*l,Y=n*f-s*c,Q=_*I-x*M,ne=_*L-T*M,re=_*F-A*M,he=x*L-T*I,ce=x*F-A*I,be=T*F-A*L;let ye=z*be-k*ce+U*he+j*re-H*ne+Y*Q;return ye?(ye=1/ye,t[0]=(l*be-c*ce+f*he)*ye,t[1]=(n*ce-r*be-s*he)*ye,t[2]=(I*Y-L*H+F*j)*ye,t[3]=(T*H-x*Y-A*j)*ye,t[4]=(c*re-o*be-f*ne)*ye,t[5]=(i*be-n*re+s*ne)*ye,t[6]=(L*U-M*Y-F*k)*ye,t[7]=(_*Y-T*U+A*k)*ye,t[8]=(o*ce-l*re+f*Q)*ye,t[9]=(r*re-i*ce-s*Q)*ye,t[10]=(M*H-I*U+F*z)*ye,t[11]=(x*U-_*H-A*z)*ye,t[12]=(l*ne-o*he-c*Q)*ye,t[13]=(i*he-r*ne+n*Q)*ye,t[14]=(I*k-M*j-L*z)*ye,t[15]=(_*j-x*k+T*z)*ye,t):null}function Xet(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],_=e[8],x=e[9],T=e[10],A=e[11],M=e[12],I=e[13],L=e[14],F=e[15];return t[0]=l*(T*F-A*L)-x*(c*F-f*L)+I*(c*A-f*T),t[1]=-(r*(T*F-A*L)-x*(n*F-s*L)+I*(n*A-s*T)),t[2]=r*(c*F-f*L)-l*(n*F-s*L)+I*(n*f-s*c),t[3]=-(r*(c*A-f*T)-l*(n*A-s*T)+x*(n*f-s*c)),t[4]=-(o*(T*F-A*L)-_*(c*F-f*L)+M*(c*A-f*T)),t[5]=i*(T*F-A*L)-_*(n*F-s*L)+M*(n*A-s*T),t[6]=-(i*(c*F-f*L)-o*(n*F-s*L)+M*(n*f-s*c)),t[7]=i*(c*A-f*T)-o*(n*A-s*T)+_*(n*f-s*c),t[8]=o*(x*F-A*I)-_*(l*F-f*I)+M*(l*A-f*x),t[9]=-(i*(x*F-A*I)-_*(r*F-s*I)+M*(r*A-s*x)),t[10]=i*(l*F-f*I)-o*(r*F-s*I)+M*(r*f-s*l),t[11]=-(i*(l*A-f*x)-o*(r*A-s*x)+_*(r*f-s*l)),t[12]=-(o*(x*L-T*I)-_*(l*L-c*I)+M*(l*T-c*x)),t[13]=i*(x*L-T*I)-_*(r*L-n*I)+M*(r*T-n*x),t[14]=-(i*(l*L-c*I)-o*(r*L-n*I)+M*(r*c-n*l)),t[15]=i*(l*T-c*x)-o*(r*T-n*x)+_*(r*c-n*l),t}function Zet(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],l=t[6],c=t[7],f=t[8],_=t[9],x=t[10],T=t[11],A=t[12],M=t[13],I=t[14],L=t[15];return(e*o-i*s)*(x*L-T*I)-(e*l-r*s)*(_*L-T*M)+(e*c-n*s)*(_*I-x*M)+(i*l-r*o)*(f*L-T*A)-(i*c-n*o)*(f*I-x*A)+(r*c-n*l)*(f*M-_*A)}function nn(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],f=e[6],_=e[7],x=e[8],T=e[9],A=e[10],M=e[11],I=e[12],L=e[13],F=e[14],z=e[15];let k=i[0],U=i[1],j=i[2],H=i[3];return t[0]=k*r+U*l+j*x+H*I,t[1]=k*n+U*c+j*T+H*L,t[2]=k*s+U*f+j*A+H*F,t[3]=k*o+U*_+j*M+H*z,k=i[4],U=i[5],j=i[6],H=i[7],t[4]=k*r+U*l+j*x+H*I,t[5]=k*n+U*c+j*T+H*L,t[6]=k*s+U*f+j*A+H*F,t[7]=k*o+U*_+j*M+H*z,k=i[8],U=i[9],j=i[10],H=i[11],t[8]=k*r+U*l+j*x+H*I,t[9]=k*n+U*c+j*T+H*L,t[10]=k*s+U*f+j*A+H*F,t[11]=k*o+U*_+j*M+H*z,k=i[12],U=i[13],j=i[14],H=i[15],t[12]=k*r+U*l+j*x+H*I,t[13]=k*n+U*c+j*T+H*L,t[14]=k*s+U*f+j*A+H*F,t[15]=k*o+U*_+j*M+H*z,t}function Qu(t,e,i){const r=i[0],n=i[1],s=i[2];if(e===t)t[12]=e[0]*r+e[4]*n+e[8]*s+e[12],t[13]=e[1]*r+e[5]*n+e[9]*s+e[13],t[14]=e[2]*r+e[6]*n+e[10]*s+e[14],t[15]=e[3]*r+e[7]*n+e[11]*s+e[15];else{const o=e[0],l=e[1],c=e[2],f=e[3],_=e[4],x=e[5],T=e[6],A=e[7],M=e[8],I=e[9],L=e[10],F=e[11];t[0]=o,t[1]=l,t[2]=c,t[3]=f,t[4]=_,t[5]=x,t[6]=T,t[7]=A,t[8]=M,t[9]=I,t[10]=L,t[11]=F,t[12]=o*r+_*n+M*s+e[12],t[13]=l*r+x*n+I*s+e[13],t[14]=c*r+T*n+L*s+e[14],t[15]=f*r+A*n+F*s+e[15]}return t}function $9(t,e,i){const r=i[0],n=i[1],s=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Wh(t,e,i,r){let n,s,o,l,c,f,_,x,T,A,M,I,L,F,z,k,U,j,H,Y,Q,ne,re,he,ce=r[0],be=r[1],ye=r[2],pe=Math.sqrt(ce*ce+be*be+ye*ye);return pe0?(i[0]=2*(l*o+_*r+c*s-f*n)/x,i[1]=2*(c*o+_*n+f*r-l*s)/x,i[2]=2*(f*o+_*s+l*n-c*r)/x):(i[0]=2*(l*o+_*r+c*s-f*n),i[1]=2*(c*o+_*n+f*r-l*s),i[2]=2*(f*o+_*s+l*n-c*r)),YAe(t,e,i),t}const ett=W();function zz(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function XAe(t,e){const i=e[0],r=e[1],n=e[2],s=e[4],o=e[5],l=e[6],c=e[8],f=e[9],_=e[10];return t[0]=Math.sqrt(i*i+r*r+n*n),t[1]=Math.sqrt(s*s+o*o+l*l),t[2]=Math.sqrt(c*c+f*f+_*_),t}function ttt(t,e){const i=e[0]+e[5]+e[10];let r=0;return i>0?(r=2*Math.sqrt(i+1),t[3]=.25*r,t[0]=(e[6]-e[9])/r,t[1]=(e[8]-e[2])/r,t[2]=(e[1]-e[4])/r):e[0]>e[5]&&e[0]>e[10]?(r=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/r,t[0]=.25*r,t[1]=(e[1]+e[4])/r,t[2]=(e[8]+e[2])/r):e[5]>e[10]?(r=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/r,t[0]=(e[1]+e[4])/r,t[1]=.25*r,t[2]=(e[6]+e[9])/r):(r=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/r,t[0]=(e[8]+e[2])/r,t[1]=(e[6]+e[9])/r,t[2]=.25*r),t}function ZAe(t,e,i,r){const n=e[0],s=e[1],o=e[2],l=e[3],c=n+n,f=s+s,_=o+o,x=n*c,T=n*f,A=n*_,M=s*f,I=s*_,L=o*_,F=l*c,z=l*f,k=l*_,U=r[0],j=r[1],H=r[2];return t[0]=(1-(M+L))*U,t[1]=(T+k)*U,t[2]=(A-z)*U,t[3]=0,t[4]=(T-k)*j,t[5]=(1-(x+L))*j,t[6]=(I+F)*j,t[7]=0,t[8]=(A+z)*H,t[9]=(I-F)*H,t[10]=(1-(x+M))*H,t[11]=0,t[12]=i[0],t[13]=i[1],t[14]=i[2],t[15]=1,t}function itt(t,e,i,r,n){const s=e[0],o=e[1],l=e[2],c=e[3],f=s+s,_=o+o,x=l+l,T=s*f,A=s*_,M=s*x,I=o*_,L=o*x,F=l*x,z=c*f,k=c*_,U=c*x,j=r[0],H=r[1],Y=r[2],Q=n[0],ne=n[1],re=n[2],he=(1-(I+F))*j,ce=(A+U)*j,be=(M-k)*j,ye=(A-U)*H,pe=(1-(T+F))*H,Ee=(L+z)*H,te=(M+k)*Y,le=(L-z)*Y,de=(1-(T+I))*Y;return t[0]=he,t[1]=ce,t[2]=be,t[3]=0,t[4]=ye,t[5]=pe,t[6]=Ee,t[7]=0,t[8]=te,t[9]=le,t[10]=de,t[11]=0,t[12]=i[0]+Q-(he*Q+ye*ne+te*re),t[13]=i[1]+ne-(ce*Q+pe*ne+le*re),t[14]=i[2]+re-(be*Q+Ee*ne+de*re),t[15]=1,t}function rtt(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,l=r+r,c=n+n,f=i*o,_=r*o,x=r*l,T=n*o,A=n*l,M=n*c,I=s*o,L=s*l,F=s*c;return t[0]=1-x-M,t[1]=_+F,t[2]=T-L,t[3]=0,t[4]=_-F,t[5]=1-f-M,t[6]=A+I,t[7]=0,t[8]=T+L,t[9]=A-I,t[10]=1-f-x,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function JAe(t,e,i,r,n,s,o){const l=1/(i-e),c=1/(n-r),f=1/(s-o);return t[0]=2*s*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*c,t[6]=0,t[7]=0,t[8]=(i+e)*l,t[9]=(n+r)*c,t[10]=(o+s)*f,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*s*2*f,t[15]=0,t}function ntt(t,e,i,r,n){const s=1/Math.tan(e/2);let o;return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,n!=null&&n!==1/0?(o=1/(r-n),t[10]=(n+r)*o,t[14]=2*n*r*o):(t[10]=-1,t[14]=-2*r),t}function stt(t,e,i,r){const n=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),l=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+l),f=2/(n+s);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=-(o-l)*c*.5,t[9]=(n-s)*f*.5,t[10]=r/(i-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*i/(i-r),t[15]=0,t}function KAe(t,e,i,r,n,s,o){const l=1/(e-i),c=1/(r-n),f=1/(s-o);return t[0]=-2*l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*f,t[11]=0,t[12]=(e+i)*l,t[13]=(n+r)*c,t[14]=(o+s)*f,t[15]=1,t}function EB(t,e,i,r){const n=e[0],s=e[1],o=e[2];let l=n-i[0],c=s-i[1],f=o-i[2];const _=sl();if(Math.abs(l)<_&&Math.abs(c)<_&&Math.abs(f)<_)return void Hf(t);let x=1/Math.sqrt(l*l+c*c+f*f);l*=x,c*=x,f*=x;const T=r[0],A=r[1],M=r[2];let I=A*f-M*c,L=M*l-T*f,F=T*c-A*l;x=Math.sqrt(I*I+L*L+F*F),x?(x=1/x,I*=x,L*=x,F*=x):(I=0,L=0,F=0);let z=c*F-f*L,k=f*I-l*F,U=l*L-c*I;x=Math.sqrt(z*z+k*k+U*U),x?(x=1/x,z*=x,k*=x,U*=x):(z=0,k=0,U=0),t[0]=I,t[1]=z,t[2]=l,t[3]=0,t[4]=L,t[5]=k,t[6]=c,t[7]=0,t[8]=F,t[9]=U,t[10]=f,t[11]=0,t[12]=-(I*n+L*s+F*o),t[13]=-(z*n+k*s+U*o),t[14]=-(l*n+c*s+f*o),t[15]=1}function QAe(t,e,i,r){const n=e[0],s=e[1],o=e[2],l=r[0],c=r[1],f=r[2];let _=n-i[0],x=s-i[1],T=o-i[2],A=_*_+x*x+T*T;A>0&&(A=1/Math.sqrt(A),_*=A,x*=A,T*=A);let M=c*T-f*x,I=f*_-l*T,L=l*x-c*_;return A=M*M+I*I+L*L,A>0&&(A=1/Math.sqrt(A),M*=A,I*=A,L*=A),t[0]=M,t[1]=I,t[2]=L,t[3]=0,t[4]=x*L-T*I,t[5]=T*M-_*L,t[6]=_*I-x*M,t[7]=0,t[8]=_,t[9]=x,t[10]=T,t[11]=0,t[12]=n,t[13]=s,t[14]=o,t[15]=1,t}function ott(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function att(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2+t[9]**2+t[10]**2+t[11]**2+t[12]**2+t[13]**2+t[14]**2+t[15]**2)}function ltt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t[9]=e[9]+i[9],t[10]=e[10]+i[10],t[11]=e[11]+i[11],t[12]=e[12]+i[12],t[13]=e[13]+i[13],t[14]=e[14]+i[14],t[15]=e[15]+i[15],t}function eMe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t[9]=e[9]-i[9],t[10]=e[10]-i[10],t[11]=e[11]-i[11],t[12]=e[12]-i[12],t[13]=e[13]-i[13],t[14]=e[14]-i[14],t[15]=e[15]-i[15],t}function ctt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t[9]=e[9]*i,t[10]=e[10]*i,t[11]=e[11]*i,t[12]=e[12]*i,t[13]=e[13]*i,t[14]=e[14]*i,t[15]=e[15]*i,t}function utt(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t[9]=e[9]+i[9]*r,t[10]=e[10]+i[10]*r,t[11]=e[11]+i[11]*r,t[12]=e[12]+i[12]*r,t[13]=e[13]+i[13]*r,t[14]=e[14]+i[14]*r,t[15]=e[15]+i[15]*r,t}function yse(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[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]}function CB(t,e){if(t===e)return!0;const i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],l=t[5],c=t[6],f=t[7],_=t[8],x=t[9],T=t[10],A=t[11],M=t[12],I=t[13],L=t[14],F=t[15],z=e[0],k=e[1],U=e[2],j=e[3],H=e[4],Y=e[5],Q=e[6],ne=e[7],re=e[8],he=e[9],ce=e[10],be=e[11],ye=e[12],pe=e[13],Ee=e[14],te=e[15],le=sl();return Math.abs(i-z)<=le*Math.max(1,Math.abs(i),Math.abs(z))&&Math.abs(r-k)<=le*Math.max(1,Math.abs(r),Math.abs(k))&&Math.abs(n-U)<=le*Math.max(1,Math.abs(n),Math.abs(U))&&Math.abs(s-j)<=le*Math.max(1,Math.abs(s),Math.abs(j))&&Math.abs(o-H)<=le*Math.max(1,Math.abs(o),Math.abs(H))&&Math.abs(l-Y)<=le*Math.max(1,Math.abs(l),Math.abs(Y))&&Math.abs(c-Q)<=le*Math.max(1,Math.abs(c),Math.abs(Q))&&Math.abs(f-ne)<=le*Math.max(1,Math.abs(f),Math.abs(ne))&&Math.abs(_-re)<=le*Math.max(1,Math.abs(_),Math.abs(re))&&Math.abs(x-he)<=le*Math.max(1,Math.abs(x),Math.abs(he))&&Math.abs(T-ce)<=le*Math.max(1,Math.abs(T),Math.abs(ce))&&Math.abs(A-be)<=le*Math.max(1,Math.abs(A),Math.abs(be))&&Math.abs(M-ye)<=le*Math.max(1,Math.abs(M),Math.abs(ye))&&Math.abs(I-pe)<=le*Math.max(1,Math.abs(I),Math.abs(pe))&&Math.abs(L-Ee)<=le*Math.max(1,Math.abs(L),Math.abs(Ee))&&Math.abs(F-te)<=le*Math.max(1,Math.abs(F),Math.abs(te))}function vse(t){const e=sl(),i=t[0],r=t[1],n=t[2],s=t[4],o=t[5],l=t[6],c=t[8],f=t[9],_=t[10];return Math.abs(1-(i*i+s*s+c*c))<=e&&Math.abs(1-(r*r+o*o+f*f))<=e&&Math.abs(1-(n*n+l*l+_*_))<=e}function AB(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[8]===0&&t[9]===0&&t[10]===1}const htt=nn,dtt=eMe;Object.freeze(Object.defineProperty({__proto__:null,add:ltt,adjoint:Xet,copy:Ao,determinant:Zet,equals:CB,exactEquals:yse,frob:att,fromQuat:rtt,fromQuat2:Qet,fromRotation:xp,fromRotationTranslation:YAe,fromRotationTranslationScale:ZAe,fromRotationTranslationScaleOrigin:itt,fromScaling:Jet,fromTranslation:L9,fromXRotation:qAe,fromYRotation:Ket,fromZRotation:WAe,frustum:JAe,getRotation:ttt,getScaling:XAe,getTranslation:zz,hasIdentityRotation:AB,identity:Hf,invert:Vo,invertOrIdentity:sP,isOrthoNormal:vse,lookAt:EB,mul:htt,multiply:nn,multiplyScalar:ctt,multiplyScalarAndAdd:utt,ortho:KAe,perspective:ntt,perspectiveFromFieldOfView:stt,rotate:Wh,rotateX:WO,rotateY:TB,rotateZ:YO,scale:$9,set:s1,str:ott,sub:dtt,subtract:eMe,targetTo:QAe,translate:Qu,transpose:ld},Symbol.toStringTag,{value:"Module"}));const ptt=(t,e)=>{const i=s1(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1);return ld(i,i)},ftt=(t,e)=>{const i=s1(t,e,0,0,.5-.5*e,0,e,0,.5-.5*e,0,0,e,.5-.5*e,0,0,0,1);return ld(i,i)},mtt=(t,e)=>{const i=1-e,r=s1(t,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return ld(r,r)},gtt=(t,e)=>{const i=Math.sin(e*Math.PI/180),r=Math.cos(e*Math.PI/180),n=s1(t,.213+.787*r-.213*i,.715-.715*r-.715*i,.072-.072*r+.928*i,0,.213-.213*r+.143*i,.715+.285*r+.14*i,.072-.072*r-.283*i,0,.213-.213*r-.787*i,.715-.715*r+.715*i,.072+.928*r+.072*i,0,0,0,0,1);return ld(n,n)},ytt=(t,e)=>{const i=1-2*e,r=s1(t,i,0,0,e,0,i,0,e,0,0,i,e,0,0,0,1);return ld(r,r)},vtt=(t,e)=>{const i=s1(t,.213+.787*e,.715-.715*e,.072-.072*e,0,.213-.213*e,.715+.285*e,.072-.072*e,0,.213-.213*e,.715-.715*e,.072+.928*e,0,0,0,0,1);return ld(i,i)},_tt=(t,e)=>{const i=1-e,r=s1(t,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return ld(r,r)};let tMe=class iMe{constructor(e,i,r){this.strength=e,this.radius=i,this.threshold=r,this.type="bloom"}interpolate(e,i,r){this.strength=Fh(e.strength,i.strength,r),this.radius=Fh(e.radius,i.radius,r),this.threshold=Fh(e.threshold,i.threshold,r)}clone(){return new iMe(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:ZI(this.radius),strength:this.strength,threshold:this.threshold}}},rMe=class nMe{constructor(e){this.radius=e,this.type="blur"}interpolate(e,i,r){this.radius=Math.round(Fh(e.radius,i.radius,r))}clone(){return new nMe(this.radius)}toJSON(){return{type:"blur",radius:ZI(this.radius)}}},JZ=class sMe{constructor(e,i){this.type=e,this.amount=i,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,i,r){this.amount=Fh(e.amount,i.amount,r),this._updateMatrix()}clone(){return new sMe(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const e=this._colorMatrix||SB();switch(this.type){case"brightness":this._colorMatrix=ptt(e,this.amount);break;case"contrast":this._colorMatrix=ftt(e,this.amount);break;case"grayscale":this._colorMatrix=mtt(e,this.amount);break;case"invert":this._colorMatrix=ytt(e,this.amount);break;case"saturate":this._colorMatrix=vtt(e,this.amount);break;case"sepia":this._colorMatrix=_tt(e,this.amount)}}},oMe=class aMe{constructor(e,i,r,n){this.offsetX=e,this.offsetY=i,this.blurRadius=r,this.color=n,this.type="drop-shadow"}interpolate(e,i,r){this.offsetX=Fh(e.offsetX,i.offsetX,r),this.offsetY=Fh(e.offsetY,i.offsetY,r),this.blurRadius=Fh(e.blurRadius,i.blurRadius,r),this.color[0]=Math.round(Fh(e.color[0],i.color[0],r)),this.color[1]=Math.round(Fh(e.color[1],i.color[1],r)),this.color[2]=Math.round(Fh(e.color[2],i.color[2],r)),this.color[3]=Fh(e.color[3],i.color[3],r)}clone(){return new aMe(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const e=[...this.color];return e[3]*=255,{type:"drop-shadow",xoffset:ZI(this.offsetX),yoffset:ZI(this.offsetY),blurRadius:ZI(this.blurRadius),color:e}}},lMe=class cMe{constructor(e){this.angle=e,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(e,i,r){this.angle=Fh(e.angle,i.angle,r),this._updateMatrix()}clone(){return new cMe(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const e=this._colorMatrix||SB();this._colorMatrix=gtt(e,this.angle)}},uMe=class hMe{constructor(e){this.amount=e,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(e,i,r){this.amount=Fh(e.amount,i.amount,r)}clone(){return new hMe(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}};function Fh(t,e,i){return t+(e-t)*i}function ZI(t){return Math.round(1e3*ad(t))/1e3}function btt(t){switch(t.type){case"grayscale":case"sepia":case"invert":return new JZ(t.type,0);case"saturate":case"brightness":case"contrast":return new JZ(t.type,1);case"opacity":return new uMe(1);case"hue-rotate":return new lMe(0);case"blur":return new rMe(0);case"drop-shadow":return new oMe(0,0,0,[...mse("transparent")]);case"bloom":return new tMe(0,0,1)}}var SZt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oP(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function dMe(t,e){const i=t.length>e.length?t:e;return(t.length>e.length?e:t).every((r,n)=>r.type===i[n].type)}function pMe(t,e){const i=t.length>e.length?t:e,r=t.length>e.length?e:t;for(let n=r.length;ns?n:(s-=n.length,n+(o+=o.repeat(s)).slice(0,s))}function r(n,s){var o,l={},c=(s=s!==void 0?s:{}).grammarSource,f={start:cs},_=cs,x="none",T=")",A=",",M="(",I="%",L="px",F="cm",z="mm",k="in",U="pt",j="pc",H="deg",Y="rad",Q="grad",ne="turn",re="#",he=".",ce="e",be=/^[ \t\n\r]/,ye=/^[a-z\-]/,pe=/^[0-9a-fA-F]/,Ee=/^[+\-]/,te=/^[0-9]/,le=lt("none"),de=Xe("none",!1),ve=Xe(")",!1),Se=Xe(",",!1),Ae=lt("whitespace"),Pe=We([" "," ",` +`,"\r"],!1,!1),Ge=lt("function"),ut=Xe("(",!1),Ft=lt("identifier"),Qt=We([["a","z"],"-"],!1,!1),At=lt("percentage"),ri=Xe("%",!1),Rt=lt("length"),dt=Xe("px",!1),pt=Xe("cm",!1),oi=Xe("mm",!1),ht=Xe("in",!1),Et=Xe("pt",!1),Dt=Xe("pc",!1),Tt=lt("angle"),ie=Xe("deg",!1),Ht=Xe("rad",!1),hr=Xe("grad",!1),Ke=Xe("turn",!1),Lt=lt("number"),vt=lt("color"),Bt=Xe("#",!1),qt=We([["0","9"],["a","f"],["A","F"]],!1,!1),li=We(["+","-"],!1,!1),mi=We([["0","9"]],!1,!1),Lr=Xe(".",!1),Dr=Xe("e",!1),Ze=function(){return[]},xi=function(xe,He){return{type:"function",name:xe,parameters:He||[]}},m=function(xe,He){return He.length>0?RP(xe,He,3):[xe]},D=function(xe){return{type:"quantity",value:xe.value,unit:xe.unit}},E=function(xe){return{type:"color",colorType:xe.type,value:xe.value}},p=function(xe){return xe},h=function(){return Fe()},a=function(xe){return{value:xe,unit:"%"}},u=function(xe){return{value:xe,unit:"px"}},d=function(xe){return{value:xe,unit:"cm"}},g=function(xe){return{value:xe,unit:"mm"}},v=function(xe){return{value:xe,unit:"in"}},b=function(xe){return{value:xe,unit:"pt"}},S=function(xe){return{value:xe,unit:"pc"}},C=function(xe){return{value:xe,unit:"deg"}},O=function(xe){return{value:xe,unit:"rad"}},R=function(xe){return{value:xe,unit:"grad"}},$=function(xe){return{value:xe,unit:"turn"}},N=function(xe){return{value:xe,unit:null}},B=function(){return{type:"hex",value:Fe()}},G=function(xe){return{type:"function",value:xe}},K=function(){return{type:"named",value:Fe()}},ee=function(){return parseFloat(Fe())},q=0,oe=0,ge=[{line:1,column:1}],me=0,Me=[],Te=0;if("startRule"in s){if(!(s.startRule in f))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');_=f[s.startRule]}function Fe(){return n.substring(oe,q)}function Xe(xe,He){return{type:"literal",text:xe,ignoreCase:He}}function We(xe,He,ct){return{type:"class",parts:xe,inverted:He,ignoreCase:ct}}function Mt(){return{type:"end"}}function lt(xe){return{type:"other",description:xe}}function yi(xe){var He,ct=ge[xe];if(ct)return ct;for(He=xe-1;!ge[He];)He--;for(ct={line:(ct=ge[He]).line,column:ct.column};Heme&&(me=q,Me=[]),Me.push(xe))}function rn(xe,He,ct){return new e(e.buildMessage(xe,He),xe,He,ct)}function cs(){var xe;return(xe=on())===l&&(xe=Gi()),xe}function on(){var xe,He;return Te++,xe=q,Ri(),n.substr(q,4)===x?(He=x,q+=4):(He=l,Te===0&&Ct(de)),He!==l?(Ri(),oe=xe,xe=Ze()):(q=xe,xe=l),Te--,xe===l&&Te===0&&Ct(le),xe}function Gi(){var xe,He;if(xe=[],(He=nr())!==l)for(;He!==l;)xe.push(He),He=nr();else xe=l;return xe}function nr(){var xe,He,ct,fr;return xe=q,Ri(),(He=Aa())!==l?(Ri(),(ct=zi())===l&&(ct=null),Ri(),n.charCodeAt(q)===41?(fr=T,q++):(fr=l,Te===0&&Ct(ve)),fr!==l?(Ri(),oe=xe,xe=xi(He,ct)):(q=xe,xe=l)):(q=xe,xe=l),xe}function zi(){var xe,He,ct,fr,Go,Fn,Rc,yx;if(xe=q,(He=pr())!==l){for(ct=[],fr=q,Go=Ri(),n.charCodeAt(q)===44?(Fn=A,q++):(Fn=l,Te===0&&Ct(Se)),Fn===l&&(Fn=null),Rc=Ri(),(yx=pr())!==l?fr=Go=[Go,Fn,Rc,yx]:(q=fr,fr=l);fr!==l;)ct.push(fr),fr=q,Go=Ri(),n.charCodeAt(q)===44?(Fn=A,q++):(Fn=l,Te===0&&Ct(Se)),Fn===l&&(Fn=null),Rc=Ri(),(yx=pr())!==l?fr=Go=[Go,Fn,Rc,yx]:(q=fr,fr=l);oe=xe,xe=m(He,ct)}else q=xe,xe=l;return xe}function pr(){var xe,He;return xe=q,(He=jo())===l&&(He=Kr())===l&&(He=Ap())===l&&(He=gd()),He!==l&&(oe=xe,He=D(He)),(xe=He)===l&&(xe=q,(He=m1())!==l&&(oe=xe,He=E(He)),xe=He),xe}function Ri(){var xe,He;for(Te++,xe=[],be.test(n.charAt(q))?(He=n.charAt(q),q++):(He=l,Te===0&&Ct(Pe));He!==l;)xe.push(He),be.test(n.charAt(q))?(He=n.charAt(q),q++):(He=l,Te===0&&Ct(Pe));return Te--,He=l,Te===0&&Ct(Ae),xe}function Aa(){var xe,He,ct;return Te++,xe=q,(He=dr())!==l?(n.charCodeAt(q)===40?(ct=M,q++):(ct=l,Te===0&&Ct(ut)),ct!==l?(oe=xe,xe=p(He)):(q=xe,xe=l)):(q=xe,xe=l),Te--,xe===l&&(He=l,Te===0&&Ct(Ge)),xe}function dr(){var xe,He,ct;if(Te++,xe=q,He=[],ye.test(n.charAt(q))?(ct=n.charAt(q),q++):(ct=l,Te===0&&Ct(Qt)),ct!==l)for(;ct!==l;)He.push(ct),ye.test(n.charAt(q))?(ct=n.charAt(q),q++):(ct=l,Te===0&&Ct(Qt));else He=l;return He!==l&&(oe=xe,He=h()),Te--,(xe=He)===l&&(He=l,Te===0&&Ct(Ft)),xe}function jo(){var xe,He,ct;return Te++,xe=q,Ri(),(He=ol())!==l?(n.charCodeAt(q)===37?(ct=I,q++):(ct=l,Te===0&&Ct(ri)),ct!==l?(oe=xe,xe=a(He)):(q=xe,xe=l)):(q=xe,xe=l),Te--,xe===l&&Te===0&&Ct(At),xe}function Kr(){var xe,He,ct;return Te++,xe=q,Ri(),(He=ol())!==l?(n.substr(q,2)===L?(ct=L,q+=2):(ct=l,Te===0&&Ct(dt)),ct!==l?(oe=xe,xe=u(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,Ri(),(He=ol())!==l?(n.substr(q,2)===F?(ct=F,q+=2):(ct=l,Te===0&&Ct(pt)),ct!==l?(oe=xe,xe=d(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,Ri(),(He=ol())!==l?(n.substr(q,2)===z?(ct=z,q+=2):(ct=l,Te===0&&Ct(oi)),ct!==l?(oe=xe,xe=g(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,Ri(),(He=ol())!==l?(n.substr(q,2)===k?(ct=k,q+=2):(ct=l,Te===0&&Ct(ht)),ct!==l?(oe=xe,xe=v(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,Ri(),(He=ol())!==l?(n.substr(q,2)===U?(ct=U,q+=2):(ct=l,Te===0&&Ct(Et)),ct!==l?(oe=xe,xe=b(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,Ri(),(He=ol())!==l?(n.substr(q,2)===j?(ct=j,q+=2):(ct=l,Te===0&&Ct(Dt)),ct!==l?(oe=xe,xe=S(He)):(q=xe,xe=l)):(q=xe,xe=l)))))),Te--,xe===l&&Te===0&&Ct(Rt),xe}function Ap(){var xe,He,ct;return Te++,xe=q,(He=ol())!==l?(n.substr(q,3)===H?(ct=H,q+=3):(ct=l,Te===0&&Ct(ie)),ct!==l?(oe=xe,xe=C(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,(He=ol())!==l?(n.substr(q,3)===Y?(ct=Y,q+=3):(ct=l,Te===0&&Ct(Ht)),ct!==l?(oe=xe,xe=O(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,(He=ol())!==l?(n.substr(q,4)===Q?(ct=Q,q+=4):(ct=l,Te===0&&Ct(hr)),ct!==l?(oe=xe,xe=R(He)):(q=xe,xe=l)):(q=xe,xe=l),xe===l&&(xe=q,(He=ol())!==l?(n.substr(q,4)===ne?(ct=ne,q+=4):(ct=l,Te===0&&Ct(Ke)),ct!==l?(oe=xe,xe=$(He)):(q=xe,xe=l)):(q=xe,xe=l)))),Te--,xe===l&&(He=l,Te===0&&Ct(Tt)),xe}function gd(){var xe,He;return Te++,xe=q,Ri(),(He=ol())!==l?(oe=xe,xe=N(He)):(q=xe,xe=l),Te--,xe===l&&Te===0&&Ct(Lt),xe}function m1(){var xe,He,ct,fr;if(Te++,xe=q,n.charCodeAt(q)===35?(He=re,q++):(He=l,Te===0&&Ct(Bt)),He!==l){if(ct=[],pe.test(n.charAt(q))?(fr=n.charAt(q),q++):(fr=l,Te===0&&Ct(qt)),fr!==l)for(;fr!==l;)ct.push(fr),pe.test(n.charAt(q))?(fr=n.charAt(q),q++):(fr=l,Te===0&&Ct(qt));else ct=l;ct!==l?(oe=xe,xe=B()):(q=xe,xe=l)}else q=xe,xe=l;return xe===l&&(xe=q,(He=nr())!==l&&(oe=xe,He=G(He)),(xe=He)===l&&(xe=q,(He=dr())!==l&&(oe=xe,He=K()),xe=He)),Te--,xe===l&&(He=l,Te===0&&Ct(vt)),xe}function ol(){var xe,He,ct,fr,Go,Fn,Rc;for(xe=q,Ee.test(n.charAt(q))?(n.charAt(q),q++):Te===0&&Ct(li),He=q,ct=[],te.test(n.charAt(q))?(fr=n.charAt(q),q++):(fr=l,Te===0&&Ct(mi));fr!==l;)ct.push(fr),te.test(n.charAt(q))?(fr=n.charAt(q),q++):(fr=l,Te===0&&Ct(mi));if(n.charCodeAt(q)===46?(fr=he,q++):(fr=l,Te===0&&Ct(Lr)),fr!==l){if(Go=[],te.test(n.charAt(q))?(Fn=n.charAt(q),q++):(Fn=l,Te===0&&Ct(mi)),Fn!==l)for(;Fn!==l;)Go.push(Fn),te.test(n.charAt(q))?(Fn=n.charAt(q),q++):(Fn=l,Te===0&&Ct(mi));else Go=l;Go!==l?He=ct=[ct,fr,Go]:(q=He,He=l)}else q=He,He=l;if(He===l)if(He=[],te.test(n.charAt(q))?(ct=n.charAt(q),q++):(ct=l,Te===0&&Ct(mi)),ct!==l)for(;ct!==l;)He.push(ct),te.test(n.charAt(q))?(ct=n.charAt(q),q++):(ct=l,Te===0&&Ct(mi));else He=l;if(He!==l){if(ct=q,n.charCodeAt(q)===101?(fr=ce,q++):(fr=l,Te===0&&Ct(Dr)),fr!==l){if(Ee.test(n.charAt(q))?(Go=n.charAt(q),q++):(Go=l,Te===0&&Ct(li)),Go===l&&(Go=null),Fn=[],te.test(n.charAt(q))?(Rc=n.charAt(q),q++):(Rc=l,Te===0&&Ct(mi)),Rc!==l)for(;Rc!==l;)Fn.push(Rc),te.test(n.charAt(q))?(Rc=n.charAt(q),q++):(Rc=l,Te===0&&Ct(mi));else Fn=l;Fn!==l?ct=fr=[fr,Go,Fn]:(q=ct,ct=l)}else q=ct,ct=l;ct===l&&(ct=null),oe=xe,xe=ee()}else q=xe,xe=l;return xe}function PP(xe,He){return xe.map(function(ct){return ct[He]})}function RP(xe,He,ct){return[xe].concat(PP(He,ct))}if((o=_())!==l&&q===n.length)return o;throw o!==l&&q `+_+` +`+T+` | +`+f.line+" | "+A+` +`+T+" | "+i("",c.column-1," ")+i("",M,"^")}else s+=` + at `+_}return s},e.buildMessage=function(n,s){var o={literal:function(A){return'"'+c(A.text)+'"'},class:function(A){var M=A.parts.map(function(I){return Array.isArray(I)?f(I[0])+"-"+f(I[1]):f(I)});return"["+(A.inverted?"^":"")+M.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(A){return A.description}};function l(A){return A.charCodeAt(0).toString(16).toUpperCase()}function c(A){return A.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(M){return"\\x0"+l(M)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(M){return"\\x"+l(M)})}function f(A){return A.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(M){return"\\x0"+l(M)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(M){return"\\x"+l(M)})}function _(A){return o[A.type](A)}function x(A){var M,I,L=A.map(_);if(L.sort(),L.length>0){for(M=1,I=1;M{if(!Number.isFinite(i.scale)||i.scale<=0)throw new se("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:spe(i.value)}});e.sort((i,r)=>r.effects.length-i.effects.length);for(let i=0;ir.scale-i.scale),e}function spe(t){let e;if(!t)return[];try{e=Stt.parse(t)}catch(i){throw new se("effect:invalid-syntax","Invalid effect syntax",{value:t,error:i})}return e.map(i=>Ttt(i))}function Ttt(t){try{switch(t.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return Ett(t);case"opacity":return Ctt(t);case"hue-rotate":return Att(t);case"blur":return Mtt(t);case"drop-shadow":return Ott(t);case"bloom":return Ptt(t)}}catch(e){throw e.details.filter=t,e}throw new se("effect:unknown-effect",`Effect '${t.name}' is not supported`,{effect:t})}function Ett(t){let e=1;return aP(t.parameters,1),t.parameters.length===1&&(e=rm(t.parameters[0])),new JZ(t.name,e)}function Ctt(t){let e=1;return aP(t.parameters,1),t.parameters.length===1&&(e=rm(t.parameters[0])),new uMe(e)}function Att(t){let e=0;return aP(t.parameters,1),t.parameters.length===1&&(e=Ntt(t.parameters[0])),new lMe(e)}function Mtt(t){let e=0;return aP(t.parameters,1),t.parameters.length===1&&(e=xse(t.parameters[0]),D9(e,t.parameters[0])),new rMe(e)}function Ott(t){const e=[];let i=null;for(const r of t.parameters)if(r.type==="color"){if(e.length&&Object.freeze(e),i)throw new se("effect:type-error","Accepts only one color",{});i=Ftt(r)}else{const n=xse(r);if(Object.isFrozen(e))throw new se("effect:type-error"," parameters not consecutive",{lengths:e});e.push(n),e.length===3&&D9(n,r)}if(e.length<2||e.length>3)throw new se("effect:type-error",`Expected {2,3}, Actual: {${e.length}}`,{lengths:e});return new oMe(e[0],e[1],e[2]||0,i||fMe("black"))}function Ptt(t){let e=1,i=0,r=0;return aP(t.parameters,3),t.parameters[0]&&(e=rm(t.parameters[0])),t.parameters[1]&&(i=xse(t.parameters[1]),D9(i,t.parameters[1])),t.parameters[2]&&(r=rm(t.parameters[2])),new tMe(e,i,r)}function aP(t,e){if(t.length>e)throw new se("effect:type-error",`Function supports up to ${e} parameters, Actual: ${t.length}`,{parameters:t})}function MB(t){if(t.type==="color")return"";if(t.unit){if(t.unit in wse)return"";if(t.unit in bse)return"";if(t.unit==="%")return""}return""}function D9(t,e){if(t<0)throw new se("effect:type-error",`Negative values are not allowed, Actual: ${t}`,{term:e})}function Rtt(t){if(t.type!=="quantity"||t.unit!==null)throw new se("effect:type-error",`Expected , Actual: ${MB(t)}`,{term:t})}function Itt(t){if(t.type!=="quantity"||t.unit!==null&&t.unit!=="%")throw new se("effect:type-error",`Expected or , Actual: ${MB(t)}`,{term:t})}const bse={deg:1,grad:.9,rad:180/Math.PI,turn:360};function $tt(t){if(t.type!=="quantity"||!(t.value===0&&t.unit===null||t.unit&&bse[t.unit]!=null))throw new se("effect:type-error",`Expected , Actual: ${MB(t)}`,{term:t})}const wse={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function Ltt(t){if(t.type!=="quantity"||!(t.value===0&&t.unit===null||t.unit&&wse[t.unit]!=null))throw new se("effect:type-error",`Expected , Actual: ${MB(t)}`,{term:t})}function rm(t){Itt(t);const e=t.value;return D9(e,t),t.unit==="%"?.01*e:e}function Dtt(t){return Rtt(t),D9(t.value,t),t.value}function Ntt(t){return $tt(t),t.value*bse[t.unit]||0}function xse(t){return Ltt(t),t.value*wse[t.unit]||0}function Ftt(t){switch(t.colorType){case"hex":return Bet(t.value);case"named":return fMe(t.value);case"function":return Utt(t.value)}}function fMe(t){if(!jAe(t))throw new se("effect:unknown-color",`color '${t}' isn't valid`,{namedColor:t});return Vet(t)}const ktt=/^rgba?/i,ztt=/^hsla?/i;function Utt(t){if(aP(t.parameters,4),ktt.test(t.name))return[rm(t.parameters[0]),rm(t.parameters[1]),rm(t.parameters[2]),t.parameters[3]?rm(t.parameters[3]):1];if(ztt.test(t.name))return GAe(Dtt(t.parameters[0]),rm(t.parameters[1]),rm(t.parameters[2]),t.parameters[3]?rm(t.parameters[3]):1);throw new se("effect:syntax-error",`Invalid color function '${t.name}'`,{colorFunction:t})}function Vtt(t,e,i){var r;try{return Gtt(t)}catch(n){(r=i==null?void 0:i.messages)==null||r.push(n)}return null}function Btt(t,e,i,r){try{const n=jtt(t);sE(i,n,e)}catch(n){r.messages&&r.messages.push(n)}}function jtt(t){const e=_se(t);return e?wtt(e)?e.map(i=>i.toJSON()):e.map(({scale:i,effects:r})=>({scale:i,value:r.map(n=>n.toJSON())})):null}function Gtt(t){if(!t||t.length===0)return null;if(Htt(t)){const e=[];for(const i of t)e.push({scale:i.scale,value:Uz(i.value)});return e}return Uz(t)}function Htt(t){const e=t[0];return!!e&&"scale"in e}function Uz(t){if(!(t!=null&&t.length))return"";const e=[];for(const i of t){let r=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":r=[y1(i,"amount")];break;case"blur":r=[y1(i,"radius","pt")];break;case"hue-rotate":r=[y1(i,"angle","deg")];break;case"drop-shadow":r=[y1(i,"xoffset","pt"),y1(i,"yoffset","pt"),y1(i,"blurRadius","pt"),qtt(i,"color")];break;case"bloom":r=[y1(i,"strength"),y1(i,"radius","pt"),y1(i,"threshold")]}const n=`${i.type}(${r.filter(Boolean).join(" ")})`;_se(n),e.push(n)}return e.join(" ")}function y1(t,e,i){if(t[e]==null)throw new se("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});return i?t[e]+i:""+t[e]}function qtt(t,e){if(t[e]==null)throw new se("effect:missing-parameter",`Missing parameter '${e}' in ${t.type} effect`,{effect:t});const i=t[e];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const ope={read:{reader:Vtt},write:{allowNull:!0,writer:Btt}},Sse=t=>{let e=class extends t{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return y([w({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],e.prototype,"blendMode",void 0),y([w({json:{read:!1,write:!1,origins:{"web-map":ope,"portal-item":ope}}})],e.prototype,"effect",void 0),e=y([Z("esri.layers.mixins.BlendLayer")],e),e},OB=t=>{let e=class extends t{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const i={minScale:this.minScale,maxScale:this.maxScale},r=this.parent;r&&"effectiveScaleRange"in r&&Wtt(i,r.effectiveScaleRange);const n=this._get("effectiveScaleRange");return n&&n.minScale===i.minScale&&n.maxScale===i.maxScale?n:i}};return y([w({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),y([w({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),y([w({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=y([Z("esri.layers.mixins.ScaleRangeLayer")],e),e};function Wtt(t,e){return t.minScale=t.minScale>0?e.minScale>0?Math.min(t.minScale,e.minScale):t.minScale:e.minScale,t.maxScale=t.maxScale>0?e.maxScale>0?Math.max(t.maxScale,e.maxScale):t.maxScale:e.maxScale,t}const Xs=t=>{let e=class extends t{clone(){var c;const i=Zl(this);ky(i,"unable to clone instance of non-accessor class");const r=i.metadatas,n=i.store,s={},o=new Map;for(const f in r){const _=r[f],x=n==null?void 0:n.originOf(f),T=_.clonable;if(_.readOnly||T===!1||x!==Di.USER&&x!==Di.DEFAULTS&&x!==Di.WEB_MAP&&x!==Di.WEB_SCENE)continue;const A=this[f];let M=null;M=typeof T=="function"?T(A):T==="reference"?A:HX(A),A!=null&&M==null||(x===Di.DEFAULTS?o.set(f,M):s[f]=M)}const l=new(Object.getPrototypeOf(this)).constructor(s);if(o.size){const f=(c=Zl(l))==null?void 0:c.store;if(f)for(const[_,x]of o)f.set(_,x,Di.DEFAULTS)}return l}};return e=y([Z("esri.core.Clonable")],e),e};let QZ=class extends Xs(ze){};QZ=y([Z("esri.core.Clonable")],QZ);async function Tse(t,e){const{WhereClause:i}=await we(()=>import("./WhereClause-XAMIZ4-B.js").then(r=>r.W),__vite__mapDeps([39,40]));return i.create(t,e)}function PB(t,e){return t!=null?e!=null?`(${t}) AND (${e})`:t:e}function LE(t){return typeof t=="string"||t instanceof String}const Ytt="yyyy-MM-dd",Xtt="TT";var JI;(function(t){t.HM="HH:mm",t.HMS="HH:mm:ss",t.HMS_MS="HH:mm:ss.SSS"})(JI||(JI={}));const Ztt=[JI.HMS_MS,JI.HMS,JI.HM,Xtt];function ape(t){return $i.fromFormat(t,Ytt)}function lpe(t){let e=null;return Ztt.find(i=>(e=$i.fromFormat(t,i),e.isValid)),e}function cpe(t){return $i.fromISO(t)}var XO;(function(t){t.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",t.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(XO||(XO={}));const Jtt=new Set(["integer","small-integer","big-integer","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"]);function Ktt(t){return t!=null&&Jtt.has(t.type)}function mMe(t){return t!=null&&(t.type==="date-only"||t.type==="esriFieldTypeDateOnly")}function gMe(t){return t!=null&&(t.type==="timestamp-offset"||t.type==="esriFieldTypeTimestampOffset")}function yMe(t){return t!=null&&(t.type==="time-only"||t.type==="esriFieldTypeTimeOnly")}function Qtt(t,e){const i=t==null?void 0:t.domain;if(!i)return null;switch(i.type){case"range":{const{min:r,max:n}=vMe(t);if(r!=null&&+en)return XO.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(i.codedValues==null||i.codedValues.every(r=>r==null||r.code!==e))return XO.INVALID_CODED_VALUE}return null}function vMe(t,e){const i=e??(t==null?void 0:t.domain);if(!i||i.type!=="range")return;const r="range"in i?i.range[0]:i.minValue,n="range"in i?i.range[1]:i.maxValue,s=Ktt(t);return mMe(t)||yMe(t)||gMe(t)?{...eit(t,n,r),isInteger:s}:{min:r!=null&&typeof r=="number"?r:null,max:n!=null&&typeof n=="number"?n:null,rawMin:r,rawMax:n,isInteger:s}}function eit(t,e,i){return mMe(t)?{min:i!=null&&LE(i)?ape(i).toMillis():null,max:e!=null&&LE(e)?ape(e).toMillis():null,rawMin:i,rawMax:e}:yMe(t)?{min:i!=null&&LE(i)?lpe(i).toMillis():null,max:e!=null&&LE(e)?lpe(e).toMillis():null,rawMin:i,rawMax:e}:gMe(t)?{min:i!=null&&LE(i)?cpe(i).toMillis():null,max:e!=null&&LE(e)?cpe(e).toMillis():null,rawMin:i,rawMax:e}:{max:null,min:null}}const tit=Ce.getLogger("esri.support.arcadeOnDemand");let _H;function p_(){return _H||(_H=(async()=>{const t=await we(()=>import("./arcadeUtils-OUqwHs4P.js").then(e=>e.aD),__vite__mapDeps([41,40,42]));return{arcade:t.arcade,arcadeUtils:t,Dictionary:t.Dictionary,Feature:t.arcadeFeature}})()),_H}const iit=(t,e,i)=>Ese.create(t,e,i,null,["$feature","$view"],[]),rit=(t,e,i)=>Ese.create(t,e,i,null,["$feature","$view"],[]),nit=(t,e,i,r)=>Ese.create(t,e,i,r,["$feature","$view"],[]);let Ese=class _Me{constructor(e,i,r,n,s,o,l){this.services=null,this.script=e,this.evaluate=n;const c=Array.isArray(o)?o:o.fields;this.fields=c,this._syntaxTree=r,this._arcade=i,this._arcadeFeature=s,this._spatialReference=l,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(e,i,r,n,s,o){const{arcade:l,Feature:c,Dictionary:f}=await p_(),_=at.fromJSON(i);let x;try{x=l.parseScript(e,o)}catch(Q){return tit.error(new se("arcade-bad-expression","Failed to parse arcade script",{script:e,error:Q})),null}const T=s.reduce((Q,ne)=>({...Q,[ne]:null}),{});let A=null;n!=null&&(A=new f(n),A.immutable=!0,T.$config=null);const M=l.scriptUsesGeometryEngine(x),I=M&&l.enableGeometrySupport(),L=l.scriptUsesFeatureSet(x)&&l.enableFeatureSetSupport(),F=l.scriptIsAsync(x),z=F&&l.enableAsyncSupport(),k={vars:T,spatialReference:_,useAsync:!!z};await Promise.all([I,L,z]);const U=new Set;await l.loadDependentModules(U,x,null,F,M);const j=new f;j.immutable=!1,j.setField("scale",0);const H=l.compileScript(x,k),Y=(Q,ne)=>{var he;const re=(he=Q.$view)==null?void 0:he.timeZone;return"$view"in Q&&Q.$view&&(j.setField("scale",typeof Q.$view=="object"&&"scale"in Q.$view?Q.$view.scale:void 0),Q.$view=j),A&&(Q.$config=A),H({vars:Q,spatialReference:_,services:ne,timeZone:re})};return new _Me(e,l,x,Y,new c,r,_)}repurposeFeature(e){return e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(e.geometry,e.attributes,{fields:this.fields}),this._arcadeFeature}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}};const sit=/^([0-9_])/,oit=/[^a-z0-9_\u0080-\uffff]+/gi;function ait(t){return t==null?null:t.trim().replaceAll(oit,"_").replace(sit,"F$1")||null}const lit=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],cit=["field","normalizationField"];function upe(t,e){if(t!=null&&e!=null){for(const i of Array.isArray(t)?t:[t])if(hpe(lit,i,e),"visualVariables"in i&&i.visualVariables)for(const r of i.visualVariables)hpe(cit,r,e)}}function hpe(t,e,i){if(t)for(const r of t){const n=u9(r,e),s=n&&typeof n!="function"&&i.get(n);s&&sE(r,s.name,e)}}function uit(t,e){var i;if(t!=null&&((i=e==null?void 0:e.fields)!=null&&i.length))if("startField"in t){const r=e.get(t.startField),n=e.get(t.endField);t.startField=(r==null?void 0:r.name)??null,t.endField=(n==null?void 0:n.name)??null}else{const r=e.get(t.startTimeField),n=e.get(t.endTimeField);t.startTimeField=(r==null?void 0:r.name)??null,t.endTimeField=(n==null?void 0:n.name)??null}}const bH=new Set;function RB(t,e){return t&&e?(bH.clear(),fL(bH,t,e),Array.from(bH).sort()):[]}function fL(t,e,i){var r;if(i)if((r=e==null?void 0:e.fields)!=null&&r.length)if(i.includes("*"))for(const{name:n}of e.fields)t.add(n);else for(const n of i)fp(t,e,n);else{if(i.includes("*"))return t.clear(),void t.add("*");for(const n of i)n!=null&&t.add(n)}}function fp(t,e,i){if(typeof i=="string")if(e){const r=e.get(i);r&&t.add(r.name)}else t.add(i)}function hit(t,e){return e==null||t==null?[]:e.includes("*")?(t.fields??[]).map(i=>i.name):e}async function eh(t,e,i){var s;if(!i)return;const{arcadeUtils:r}=await p_(),n=r.extractFieldNames(i,(s=e==null?void 0:e.fields)==null?void 0:s.map(o=>o.name));for(const o of n)fp(t,e,o)}async function bMe(t,e,i){if(i&&i!=="1=1"){const r=await Tse(i,e);if(!r.isStandardized)throw new se("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});fL(t,e,r.fieldNames)}}function dit({displayField:t,fields:e}){return t||(e!=null&&e.length?wH(e,"name-or-title")||wH(e,"unique-identifier")||wH(e,"type-or-category")||pit(e):null)}function pit(t){for(const e of t){if(!(e!=null&&e.name))continue;const i=e.name.toLowerCase();if(i.includes("name")||i.includes("title"))return e.name}return null}function wH(t,e){for(const i of t)if(i!=null&&i.valueType&&i.valueType===e)return i.name;return null}async function EZt(t,e){var r;if(!e)return;const i=(r=e.elevationInfo)==null?void 0:r.featureExpressionInfo;return i?i.collectRequiredFields(t,e.fieldsIndex):void 0}function fit(t,e,i){i.onStatisticExpression?eh(t,e,i.onStatisticExpression.expression):t.add(i.onStatisticField)}async function CZt(t,e,i){if(!e||!i||!("fields"in i))return;const r=[],n=i.popupTemplate;r.push(mit(t,e,n)),i.fields&&r.push(...i.fields.map(async s=>fit(t,e.fieldsIndex,s))),await Promise.all(r)}async function mit(t,e,i){const r=[];i!=null&&i.expressionInfos&&r.push(...i.expressionInfos.map(s=>eh(t,e.fieldsIndex,s.expression)));const n=i==null?void 0:i.content;if(Array.isArray(n))for(const s of n)s.type==="expression"&&s.expressionInfo&&r.push(eh(t,e.fieldsIndex,s.expressionInfo.expression));await Promise.all(r)}async function AZt(t,e,i){e&&(e.timeInfo&&(i!=null&&i.timeExtent)&&fL(t,e.fieldsIndex,[e.timeInfo.startField,e.timeInfo.endField]),e.floorInfo&&fL(t,e.fieldsIndex,[e.floorInfo.floorField]),(i==null?void 0:i.where)!=null&&await bMe(t,e.fieldsIndex,i.where))}async function MZt(t,e,i){e&&i&&await Promise.all(i.map(r=>git(t,e,r)))}async function git(t,e,i){e&&i&&(i.valueExpression?await eh(t,e.fieldsIndex,i.valueExpression):i.field&&fp(t,e.fieldsIndex,i.field))}function yit(t){return t?RB(t.fieldsIndex,wMe(t)):[]}function vit(t){if(!t)return[];const e=t.geometryFieldsInfo;return e?RB(t.fieldsIndex,[e.shapeAreaField,e.shapeLengthField]):[]}const _it=new Set(["oid","global-id","guid"]),bit=new Set(["oid","global-id"]),wit=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i];function xit(t){const e=new Set;xMe(t).forEach(r=>e.add(r)),vit(t).forEach(r=>e.add(r.toLowerCase()));const i=t&&"infoFor3D"in t?t.infoFor3D:void 0;return i&&(Object.values(i.assetMapFieldRoles).forEach(r=>e.add(r.toLowerCase())),Object.values(i.transformFieldRoles).forEach(r=>e.add(r.toLowerCase()))),Array.from(e)}function wMe(t){if(!t)return[];const e="editFieldsInfo"in t&&t.editFieldsInfo;if(!e)return[];const{creationDateField:i,creatorField:r,editDateField:n,editorField:s}=e;return[i,r,n,s].filter(Boolean)}function xMe(t){return wMe(t).map(e=>e.toLowerCase())}function Sit(t,e){var i;return t.editable&&!_it.has(t.type)&&!xMe(e).includes(((i=t.name)==null?void 0:i.toLowerCase())??"")}function Tit(t,e){var r;const i=((r=t.name)==null?void 0:r.toLowerCase())??"";return!((e==null?void 0:e.objectIdField)!=null&&i===e.objectIdField.toLowerCase()||(e==null?void 0:e.globalIdField)!=null&&i===e.globalIdField.toLowerCase()||xit(e).includes(i)||bit.has(t.type)||wit.some(n=>n.test(i)))}async function OZt(t,e){const{labelingInfo:i,fieldsIndex:r}=e;i!=null&&i.length&&await Promise.all(i.map(n=>Eit(t,r,n)))}async function Eit(t,e,i){if(!i)return;const r=i.getLabelExpression(),n=i.where;if(r.type==="arcade")await eh(t,e,r.expression);else{const s=r.expression.match(/{[^}]*}/g);s&&s.forEach(o=>{fp(t,e,o.slice(1,-1))})}await bMe(t,e,n)}function Cit(t){const e=t.defaultValue;return e!==void 0&&EMe(t,e)?e:t.nullable?null:void 0}function PZt(t){const e=typeof t=="string"?{type:t}:t;return kit(e)?255:e.type==="esriFieldTypeDate"||e.type==="date"?8:void 0}function SMe(t){return typeof t=="number"&&!isNaN(t)&&isFinite(t)}function Ait(t){return t===null||SMe(t)}function Mit(t){return t===null||Number.isInteger(t)}function TMe(t){return t!=null&&typeof t=="string"}function Oit(t){return t===null||TMe(t)}function Pit(){return!0}function EMe(t,e){let i;switch(t.type){case"date":case"integer":case"long":case"small-integer":case"big-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":case"esriFieldTypeBigInteger":i=t.nullable?Mit:Number.isInteger;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=t.nullable?Ait:SMe;break;case"string":case"esriFieldTypeString":i=t.nullable?Oit:TMe;break;default:i=Pit}return arguments.length===1?i:i(e)}const Rit=["integer","small-integer","big-integer"],Iit=["single","double"],$it=["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeBigInteger"],Lit=["esriFieldTypeSingle","esriFieldTypeDouble"],Dit=new Set([...Rit,...$it]),Nit=new Set([...Iit,...Lit]),Fit=vSe(Dit,Nit);function Cse(t){return t!=null&&Fit.has(t.type)}function kit(t){return t!=null&&(t.type==="string"||t.type==="esriFieldTypeString")}function Ase(t){return t!=null&&(t.type==="date"||t.type==="esriFieldTypeDate")}function zit(t){return t!=null&&(t.type==="date-only"||t.type==="esriFieldTypeDateOnly")}function Uit(t){return t!=null&&(t.type==="timestamp-offset"||t.type==="esriFieldTypeTimestampOffset")}function CMe(t){return t!=null&&(t.type==="time-only"||t.type==="esriFieldTypeTimeOnly")}function dpe(t){return t!=null&&(t.type==="oid"||t.type==="esriFieldTypeOID")}function ppe(t){return t!=null&&(t.type==="global-id"||t.type==="esriFieldTypeGlobalID")}function RZt(t,e){return Vit(t,e)===null}var Vz,Bz;function IZt(t){return t==null||typeof t=="number"&&isNaN(t)?null:t}function Vit(t,e){return t==null||t.nullable&&e===null?null:Cse(t)&&!Bit(t.type,Number(e))?Vz.OUT_OF_RANGE:EMe(t,e)?t.domain?Qtt(t,e):null:Bz.INVALID_TYPE}function Bit(t,e){const i=typeof t=="string"?AMe(t):t;if(!i)return!1;const r=i.min,n=i.max;return i.isInteger?Number.isInteger(e)&&e>=r&&e<=n:e>=r&&e<=n}function AMe(t){switch(t){case"esriFieldTypeSmallInteger":case"small-integer":return jit;case"esriFieldTypeInteger":case"integer":return Git;case"esriFieldTypeBigInteger":case"big-integer":return Hit;case"esriFieldTypeSingle":case"single":return qit;case"esriFieldTypeDouble":case"double":return Wit}}(function(t){t.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(Vz||(Vz={})),function(t){t.INVALID_TYPE="type-validation-error::invalid-type"}(Bz||(Bz={}));const jit={min:-32768,max:32767,isInteger:!0,rawMin:-32768,rawMax:32767},Git={min:-2147483648,max:2147483647,isInteger:!0,rawMin:-2147483648,rawMax:2147483647},Hit={min:-Number.MAX_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,isInteger:!0,rawMin:-Number.MAX_SAFE_INTEGER,rawMax:Number.MAX_SAFE_INTEGER},qit={min:-34e37,max:12e37,isInteger:!1,rawMin:-34e37,rawMax:12e37},Wit={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1,rawMin:-Number.MAX_VALUE,rawMax:Number.MAX_VALUE};function $Zt(t,e,i){switch(t){case XO.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case XO.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${e.name}, domain: ${JSON.stringify(e.domain)}`;case Bz.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${e.name}, type: ${e.type}, nullable: ${e.nullable}`;case Vz.OUT_OF_RANGE:{const{min:r,max:n}=AMe(e.type);return`Value ${i} is out of range for the number type - field: ${e.name}, type: ${e.type}, value range is ${r} to ${n}`}}}function LZt(t,e){return!Yit(t,e,null)}function Yit(t,e,i){if(!(e!=null&&e.attributes)||!t){if(i!=null)for(const s of t??[])i.add(s);return!0}const r=new Set(Object.keys(e.attributes));let n=!1;for(const s of t)if(!r.has(s)){if(n=!0,i==null)break;i.add(s)}return n}function Xit(t){return!!t&&["raster.itempixelvalue","raster.servicepixelvalue"].some(e=>t.toLowerCase().startsWith(e))}let S7=class extends Ue{constructor(e){super(e),this.type=null}};y([w({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],S7.prototype,"type",void 0),S7=y([Z("esri.popup.content.Content")],S7);const rx=S7;var eJ;let p3=eJ=class extends rx{constructor(t){super(t),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new eJ({description:this.description,displayType:this.displayType,title:this.title})}};y([w({type:String,json:{write:!0}})],p3.prototype,"description",void 0),y([w({type:["auto","preview","list"],json:{write:!0}})],p3.prototype,"displayType",void 0),y([w({type:String,json:{write:!0}})],p3.prototype,"title",void 0),y([w({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],p3.prototype,"type",void 0),p3=eJ=y([Z("esri.popup.content.AttachmentsContent")],p3);const mL=p3;var tJ;let f3=tJ=class extends rx{constructor(t){super(t),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new tJ({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?Re(this.outFields):null})}};y([w()],f3.prototype,"creator",void 0),y([w()],f3.prototype,"destroyer",void 0),y([w()],f3.prototype,"outFields",void 0),y([w({type:["custom"],readOnly:!0})],f3.prototype,"type",void 0),f3=tJ=y([Z("esri.popup.content.CustomContent")],f3);const Zit=f3;var iJ;let hA=iJ=class extends Ue{constructor(t){super(t),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new iJ({title:this.title,expression:this.expression})}};y([w({type:String,json:{write:!0}})],hA.prototype,"title",void 0),y([w({type:String,json:{write:!0}})],hA.prototype,"expression",void 0),y([w({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],hA.prototype,"returnType",void 0),hA=iJ=y([Z("esri.popup.ElementExpressionInfo")],hA);const Jit=hA;var rJ;let t4=rJ=class extends rx{constructor(t){super(t),this.expressionInfo=null,this.type="expression"}clone(){var t;return new rJ({expressionInfo:(t=this.expressionInfo)==null?void 0:t.clone()})}};y([w({type:Jit,json:{write:!0}})],t4.prototype,"expressionInfo",void 0),y([w({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],t4.prototype,"type",void 0),t4=rJ=y([Z("esri.popup.content.ExpressionContent")],t4);const Mse=t4;function Vt(t,e={}){const i=t instanceof yn?t:new yn(t,e),r={type:(e==null?void 0:e.ignoreUnknown)??1?i.apiValues:String,json:{type:i.jsonValues,read:!(e!=null&&e.readOnly)&&{reader:i.read},write:{writer:i.write}}};return(e==null?void 0:e.readOnly)!==void 0&&(r.readOnly=!!e.readOnly),(e==null?void 0:e.default)!==void 0&&(r.json.default=e.default),(e==null?void 0:e.name)!==void 0&&(r.json.name=e.name),(e==null?void 0:e.nonNullable)!==void 0&&(r.nonNullable=e.nonNullable),w(r)}let dA=class extends Xs(Ue){constructor(e){super(e),this.dateFormat=null,this.digitSeparator=!1,this.places=null}};y([Vt(XWe)],dA.prototype,"dateFormat",void 0),y([w({type:Boolean,json:{write:!0}})],dA.prototype,"digitSeparator",void 0),y([w({type:$n,json:{write:!0}})],dA.prototype,"places",void 0),dA=y([Z("esri.popup.support.FieldInfoFormat")],dA);const T7=dA;var nJ;let C0=nJ=class extends Ue{constructor(t){super(t),this.fieldName=null,this.format=null,this.isEditable=!0,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new nJ({fieldName:this.fieldName,format:this.format?Re(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};y([w({type:String,json:{write:!0}})],C0.prototype,"fieldName",void 0),y([w({type:T7,json:{write:!0}})],C0.prototype,"format",void 0),y([w({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],C0.prototype,"isEditable",void 0),y([w({type:String,json:{write:!0}})],C0.prototype,"label",void 0),y([Vt(new yn({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],C0.prototype,"stringFieldOption",void 0),y([w({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],C0.prototype,"statisticType",void 0),y([w({type:String,json:{write:!0}})],C0.prototype,"tooltip",void 0),y([w({type:Boolean,json:{write:!0}})],C0.prototype,"visible",void 0),C0=nJ=y([Z("esri.popup.FieldInfo")],C0);const Ose=C0;var sJ;let V1=sJ=class extends rx{constructor(t){super(t),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(t,e){e.fieldInfos=t&&t.map(i=>i.toJSON())}clone(){return new sJ(Re({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};y([w({type:Object,json:{write:!0}})],V1.prototype,"attributes",void 0),y([w({type:String,json:{write:!0}})],V1.prototype,"description",void 0),y([w({type:[Ose]})],V1.prototype,"fieldInfos",void 0),y([Pt("fieldInfos")],V1.prototype,"writeFieldInfos",null),y([w({type:String,json:{write:!0}})],V1.prototype,"title",void 0),y([w({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],V1.prototype,"type",void 0),V1=sJ=y([Z("esri.popup.content.FieldsContent")],V1);const gL=V1;let m3=class extends Ue{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};y([w({type:String,json:{write:!0}})],m3.prototype,"altText",void 0),y([w({type:String,json:{write:!0}})],m3.prototype,"caption",void 0),y([w({type:String,json:{write:!0}})],m3.prototype,"title",void 0),y([w({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],m3.prototype,"type",void 0),m3=y([Z("esri.popup.content.mixins.MediaInfo")],m3);const Pse=m3;function H6(t){return Je(ene(t),0,255)}function q6(t,e,i){return t=Number(t),isNaN(t)?i:ti?i:t}function W6(t,e){const i=t.toString(16).padStart(2,"0");return e?i.substring(0,1):i}let E7=class hl{static blendColors(e,i,r,n=new hl){return n.r=Math.round(e.r+(i.r-e.r)*r),n.g=Math.round(e.g+(i.g-e.g)*r),n.b=Math.round(e.b+(i.b-e.b)*r),n.a=e.a+(i.a-e.a)*r,n._sanitize()}static fromRgb(e,i){const r=e.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(r){const n=r[2].split(/\s*,\s*/),s=r[1];if(s==="rgb"&&n.length===3||s==="rgba"&&n.length===4){const o=n[0];if(o.charAt(o.length-1)==="%"){const l=n.map(c=>2.56*parseFloat(c));return n.length===4&&(l[3]=parseFloat(n[3])),hl.fromArray(l,i)}return hl.fromArray(n.map(l=>parseFloat(l)),i)}if(s==="hsl"&&n.length===3||s==="hsla"&&n.length===4)return hl.fromArray(GAe(parseFloat(n[0]),parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])),i)}return null}static fromHex(e,i=new hl){if(e[0]!=="#"||isNaN(+`0x${e.substring(1)}`))return null;switch(e.length){case 4:case 5:{const r=parseInt(e.substring(1,2),16),n=parseInt(e.substring(2,3),16),s=parseInt(e.substring(3,4),16),o=e.length===5?15:parseInt(e.substring(4),16);return hl.fromArray([r+16*r,n+16*n,s+16*s,(o+16*o)/255],i)}case 7:case 9:{const r=parseInt(e.substring(1,3),16),n=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16),o=e.length===7?255:parseInt(e.substring(7),16);return hl.fromArray([r,n,s,o/255],i)}default:return null}}static fromArray(e,i=new hl){return i._set(Number(e[0]),Number(e[1]),Number(e[2]),Number(e[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(e,i){const r=jAe(e)?mse(e):null;return r&&hl.fromArray(r,i)||hl.fromRgb(e,i)||hl.fromHex(e,i)}static fromJSON(e){return e!=null?new hl([e[0],e[1],e[2],(e[3]??255)/255]):void 0}static toUnitRGB(e){return e!=null?[e.r/255,e.g/255,e.b/255]:null}static toUnitRGBA(e){return e!=null?[e.r/255,e.g/255,e.b/255,e.a!=null?e.a:1]:null}constructor(e){this.r=255,this.g=255,this.b=255,this.a=1,e&&this.setColor(e)}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(e){return typeof e=="string"?hl.fromString(e,this):Array.isArray(e)?hl.fromArray(e,this):(this._set(e.r??0,e.g??0,e.b??0,e.a??1),e instanceof hl||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(e){const i=(e==null?void 0:e.capitalize)??!1,r=(e==null?void 0:e.digits)??6,n=r===3||r===4,s=r===4||r===8,o=`#${W6(this.r,n)}${W6(this.g,n)}${W6(this.b,n)}${s?W6(Math.round(255*this.a),n):""}`;return i?o.toUpperCase():o}toCss(e=!1){const i=this.r+", "+this.g+", "+this.b;return e?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(e=hl.AlphaMode.ALWAYS){const i=H6(this.r),r=H6(this.g),n=H6(this.b);return e===hl.AlphaMode.ALWAYS||this.a!==1?[i,r,n,H6(255*this.a)]:[i,r,n]}clone(){return new hl(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(e){return e!=null&&e.r===this.r&&e.g===this.g&&e.b===this.b&&e.a===this.a}_sanitize(){return this.r=Math.round(q6(this.r,0,255)),this.g=Math.round(q6(this.g,0,255)),this.b=Math.round(q6(this.b,0,255)),this.a=q6(this.a,0,1),this}_set(e,i,r,n){this.r=e,this.g=i,this.b=r,this.a=n}};E7.prototype.declaredClass="esri.Color",function(t){var e;(e=t.AlphaMode||(t.AlphaMode={}))[e.ALWAYS=0]="ALWAYS",e[e.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(E7||(E7={}));const qe=E7;var oJ;let g3=oJ=class extends ze{constructor(t){super(t),this.color=null,this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new oJ({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};y([w()],g3.prototype,"color",void 0),y([w()],g3.prototype,"fieldName",void 0),y([w()],g3.prototype,"tooltip",void 0),y([w()],g3.prototype,"value",void 0),g3=oJ=y([Z("esri.popup.content.support.ChartMediaInfoValueSeries")],g3);const Kit=g3;var aJ;let Bb=aJ=class extends Ue{constructor(t){super(t),this.colors=null,this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new aJ({colors:Re(this.colors),fields:Re(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};y([w({type:[qe],json:{type:[[$n]],write:!0}})],Bb.prototype,"colors",void 0),y([w({type:[String],json:{write:!0}})],Bb.prototype,"fields",void 0),y([w({type:String,json:{write:!0}})],Bb.prototype,"normalizeField",void 0),y([w({type:[Kit],json:{read:!1}})],Bb.prototype,"series",void 0),y([w({type:String,json:{write:!0}})],Bb.prototype,"tooltipField",void 0),Bb=aJ=y([Z("esri.popup.content.support.ChartMediaInfoValue")],Bb);const Qit=Bb;let i4=class extends Pse{constructor(e){super(e),this.type=null,this.value=null}};y([w({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],i4.prototype,"type",void 0),y([w({type:Qit,json:{write:!0}})],i4.prototype,"value",void 0),i4=y([Z("esri.popup.content.mixins.ChartMediaInfo")],i4);const IB=i4,$B=fu()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var lJ;let C7=lJ=class extends IB{constructor(t){super(t),this.type="bar-chart"}clone(){return new lJ({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};y([w({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:$B.write}})],C7.prototype,"type",void 0),C7=lJ=y([Z("esri.popup.content.BarChartMediaInfo")],C7);const MMe=C7;var cJ;let A7=cJ=class extends IB{constructor(t){super(t),this.type="column-chart"}clone(){return new cJ({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};y([w({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:$B.write}})],A7.prototype,"type",void 0),A7=cJ=y([Z("esri.popup.content.ColumnChartMediaInfo")],A7);const OMe=A7;var uJ;let r4=uJ=class extends Ue{constructor(t){super(t),this.linkURL=null,this.sourceURL=null}clone(){return new uJ({linkURL:this.linkURL,sourceURL:this.sourceURL})}};y([w({type:String,json:{write:!0}})],r4.prototype,"linkURL",void 0),y([w({type:String,json:{write:!0}})],r4.prototype,"sourceURL",void 0),r4=uJ=y([Z("esri.popup.content.support.ImageMediaInfoValue")],r4);const ert=r4;var hJ;let pA=hJ=class extends Pse{constructor(t){super(t),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new hJ({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};y([w({type:Number,json:{write:!0}})],pA.prototype,"refreshInterval",void 0),y([w({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],pA.prototype,"type",void 0),y([w({type:ert,json:{write:!0}})],pA.prototype,"value",void 0),pA=hJ=y([Z("esri.popup.content.ImageMediaInfo")],pA);const PMe=pA;var dJ;let M7=dJ=class extends IB{constructor(t){super(t),this.type="line-chart"}clone(){return new dJ({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};y([w({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:$B.write}})],M7.prototype,"type",void 0),M7=dJ=y([Z("esri.popup.content.LineChartMediaInfo")],M7);const RMe=M7;var pJ;let O7=pJ=class extends IB{constructor(t){super(t),this.type="pie-chart"}clone(){return new pJ({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};y([w({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:$B.write}})],O7.prototype,"type",void 0),O7=pJ=y([Z("esri.popup.content.PieChartMediaInfo")],O7);const IMe=O7,$Me={base:Pse,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":MMe,"column-chart":OMe,"line-chart":RMe,"pie-chart":IMe,image:PMe}};var fJ;let A0=fJ=class extends rx{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(e=>e.type==="image"?PMe.fromJSON(e):e.type==="barchart"?MMe.fromJSON(e):e.type==="columnchart"?OMe.fromJSON(e):e.type==="linechart"?RMe.fromJSON(e):e.type==="piechart"?IMe.fromJSON(e):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(i=>i.toJSON())}clone(){return new fJ(Re({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};y([w()],A0.prototype,"activeMediaInfoIndex",void 0),y([w({type:Object,json:{write:!0}})],A0.prototype,"attributes",void 0),y([w({type:String,json:{write:!0}})],A0.prototype,"description",void 0),y([w({types:[$Me]})],A0.prototype,"mediaInfos",void 0),y([$t("mediaInfos")],A0.prototype,"readMediaInfos",null),y([Pt("mediaInfos")],A0.prototype,"writeMediaInfos",null),y([w({type:String,json:{write:!0}})],A0.prototype,"title",void 0),y([w({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],A0.prototype,"type",void 0),A0=fJ=y([Z("esri.popup.content.MediaContent")],A0);const jz=A0;var mJ;let n4=mJ=class extends Ue{constructor(t){super(t),this.field=null,this.order=null}clone(){return new mJ({field:this.field,order:this.order})}};y([w({type:String,json:{write:!0}})],n4.prototype,"field",void 0),y([w({type:["asc","desc"],json:{write:!0}})],n4.prototype,"order",void 0),n4=mJ=y([Z("esri.popup.support.RelatedRecordsInfoFieldOrder")],n4);const LMe=n4;let wg=class extends Xs(rx){constructor(e){super(e),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};y([w({type:String,json:{write:!0}})],wg.prototype,"description",void 0),y([w({type:Number,json:{type:$n,write:!0}})],wg.prototype,"displayCount",void 0),y([w({type:["list"],json:{write:!0}})],wg.prototype,"displayType",void 0),y([w({type:[LMe],json:{write:!0}})],wg.prototype,"orderByFields",void 0),y([w({type:Number,json:{type:$n,write:!0}})],wg.prototype,"relationshipId",void 0),y([w({type:String,json:{write:!0}})],wg.prototype,"title",void 0),y([w({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],wg.prototype,"type",void 0),wg=y([Z("esri.popup.content.RelationshipContent")],wg);const Gz=wg;var gJ;let s4=gJ=class extends rx{constructor(t){super(t),this.text=null,this.type="text"}clone(){return new gJ({text:this.text})}};y([w({type:String,json:{write:!0}})],s4.prototype,"text",void 0),y([w({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],s4.prototype,"type",void 0),s4=gJ=y([Z("esri.popup.content.TextContent")],s4);const Hz=s4,trt={base:null,key:"type",typeMap:{attachment:mL,media:jz,text:Hz,expression:Mse,field:gL,relationship:Gz}};var yJ;let y3=yJ=class extends Ue{constructor(t){super(t),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new yJ({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};y([w({type:String,json:{write:!0}})],y3.prototype,"name",void 0),y([w({type:String,json:{write:!0}})],y3.prototype,"title",void 0),y([w({type:String,json:{write:!0}})],y3.prototype,"expression",void 0),y([w({type:["string","number"],json:{write:!0}})],y3.prototype,"returnType",void 0),y3=yJ=y([Z("esri.popup.ExpressionInfo")],y3);const irt=y3;var vJ;let o4=vJ=class extends Ue{constructor(t){super(t),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new vJ({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};y([w({type:Boolean,json:{write:!0}})],o4.prototype,"returnTopmostRaster",void 0),y([w({type:Boolean,json:{write:!0}})],o4.prototype,"showNoDataRecords",void 0),o4=vJ=y([Z("esri.popup.LayerOptions")],o4);const rrt=o4;var _J;let a4=_J=class extends Ue{constructor(t){super(t),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new _J({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?Re(this.orderByFields):null})}};y([w({type:Boolean,json:{write:!0}})],a4.prototype,"showRelatedRecords",void 0),y([w({type:[LMe],json:{write:!0}})],a4.prototype,"orderByFields",void 0),a4=_J=y([Z("esri.popup.RelatedRecordsInfo")],a4);const nrt=a4;var bJ;let jp=bJ=class extends I_(ze){constructor(t){super(t),this.active=!1,this.className=null,this.disabled=!1,this.icon=null,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new bJ({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};y([w()],jp.prototype,"active",void 0),y([w()],jp.prototype,"className",void 0),y([w()],jp.prototype,"disabled",void 0),y([w()],jp.prototype,"icon",void 0),y([w()],jp.prototype,"id",void 0),y([w()],jp.prototype,"indicator",void 0),y([w()],jp.prototype,"title",void 0),y([w()],jp.prototype,"type",void 0),y([w()],jp.prototype,"visible",void 0),jp=bJ=y([Z("esri.support.actions.ActionBase")],jp);const lP=jp;var wJ;let P7=wJ=class extends lP{constructor(t){super(t),this.image=null,this.type="button"}clone(){return new wJ({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};y([w()],P7.prototype,"image",void 0),P7=wJ=y([Z("esri.support.Action.ActionButton")],P7);const cP=P7;var xJ;let l4=xJ=class extends lP{constructor(t){super(t),this.image=null,this.type="toggle",this.value=!1}clone(){return new xJ({active:this.active,className:this.className,disabled:this.disabled,icon:this.icon,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};y([w()],l4.prototype,"image",void 0),y([w()],l4.prototype,"value",void 0),l4=xJ=y([Z("esri.support.Action.ActionToggle")],l4);const LB=l4,srt="esri.PopupTemplate",ort=Ce.getLogger(srt),GP="relationships/",fpe="expression/",art=it.ofType({key:"type",defaultKeyValue:"button",base:lP,typeMap:{button:cP,toggle:LB}}),lrt={base:rx,key:"type",typeMap:{media:jz,custom:Zit,text:Hz,attachments:mL,fields:gL,expression:Mse,relationship:Gz}},crt=new Set(["attachments","fields","media","text","expression","relationship"]);let dl=class extends Xs(Ue){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(e){return Array.isArray(e)?e.map(i=>zy(lrt,i)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||pd(e)?e:(ort.error("content error","unsupported content value",{value:e}),null)}readContent(e,i){const{popupElements:r}=i;return Array.isArray(r)&&r.length>0?this._readPopupInfoElements(i.description,i.mediaInfos,r):this._readPopupInfo(i)}writeContent(e,i,r,n){typeof e!="string"?Array.isArray(e)&&(i.popupElements=e.filter(s=>crt.has(s.type)).map(s=>s==null?void 0:s.toJSON(n)),i.popupElements.forEach(s=>{s.type==="attachments"?this._writeAttachmentContent(i):s.type==="media"?this._writeMediaContent(s,i):s.type==="text"?this._writeTextContent(s,i):s.type==="relationship"&&this._writeRelationshipContent(s,i)})):i.description=e}writeFieldInfos(e,i,r,n){const{content:s}=this,o=Array.isArray(s)?s:null;if(e){const l=o?o.filter(f=>f.type==="fields"):[],c=l.length&&l.every(f=>{var _;return(_=f.fieldInfos)==null?void 0:_.length});i.fieldInfos=e.filter(Boolean).map(f=>{const _=f.toJSON(n);return c&&(_.visible=!1),_})}if(o)for(const l of o)l.type==="fields"&&this._writeFieldsContent(l,i)}writeLayerOptions(e,i,r,n){i[r]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(n)}writeTitle(e,i){i.title=e||""}async collectRequiredFields(e,i){const r=this.expressionInfos||[];await this._collectExpressionInfoFields(e,i,[...r,...this._getContentExpressionInfos(this.content,r)]),fL(e,i,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const i=new Set;return await this.collectRequiredFields(i,e),[...i].sort()}_writeFieldsContent(e,i){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const r=Re(e.fieldInfos);Array.isArray(i.fieldInfos)?r.forEach(n=>{const s=i.fieldInfos.find(o=>o.fieldName.toLowerCase()===n.fieldName.toLowerCase());s?s.visible=!0:i.fieldInfos.push(n)}):i.fieldInfos=r}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,i){var s,o;const r=((s=e.orderByFields)==null?void 0:s.map(l=>this._toFieldOrderJSON(l,e.relationshipId)))||[],n=[...((o=i.relatedRecordsInfo)==null?void 0:o.orderByFields)||[],...r];i.relatedRecordsInfo={showRelatedRecords:!0,...(n==null?void 0:n.length)&&{orderByFields:n}}}_writeTextContent(e,i){!i.description&&e.text&&(i.description=e.text)}_writeMediaContent(e,i){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const r=Re(e.mediaInfos);Array.isArray(i.mediaInfos)?i.mediaInfos=[...i.mediaInfos,...r]:i.mediaInfos=r}_readPopupInfoElements(e,i,r){const n={description:!1,mediaInfos:!1};return r.map(s=>s.type==="media"?(s.mediaInfos||!i||n.mediaInfos||(s.mediaInfos=i,n.mediaInfos=!0),jz.fromJSON(s)):s.type==="text"?(s.text||!e||n.description||(s.text=e,n.description=!0),Hz.fromJSON(s)):s.type==="attachments"?mL.fromJSON(s):s.type==="fields"?gL.fromJSON(s):s.type==="expression"?Mse.fromJSON(s):s.type==="relationship"?Gz.fromJSON(s):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:i,order:r}=e;if(!(i!=null&&i.startsWith(GP)))return null;const n=i.replace(GP,"").split("/");if(n.length!==2)return null;const s=parseInt(n[0],10),o=n[1];return typeof s=="number"&&o?Gz.fromJSON({relationshipId:s,orderByFields:[{field:o,order:r}]}):null}_toFieldOrderJSON(e,i){const{order:r,field:n}=e;return{field:`${GP}${i}/${n}`,order:r}}_readPopupInfo({description:e,mediaInfos:i,showAttachments:r,relatedRecordsInfo:n={showRelatedRecords:!1}}){const s=[];e?s.push(new Hz({text:e})):s.push(new gL),Array.isArray(i)&&i.length&&s.push(jz.fromJSON({mediaInfos:i})),r&&s.push(mL.fromJSON({displayType:"auto"}));const{showRelatedRecords:o,orderByFields:l}=n;return o&&(l!=null&&l.length)&&l.forEach(c=>{const f=this._toRelationshipContent(c);f&&s.push(f)}),s.length?s:e}_getContentElementFields(e){const i=e==null?void 0:e.type;if(i==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(i==="custom")return e.outFields||[];if(i==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields(e.fieldInfos??this.fieldInfos)];if(i==="media"){const r=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...r.reduce((n,s)=>[...n,...this._getMediaInfoFields(s)],[])]}return i==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:i,title:r,value:n}=e,s=n||{},{fields:o,normalizeField:l,tooltipField:c,sourceURL:f,linkURL:_}=s,x=[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(f),...this._extractFieldNames(_),...o??[]];return l&&x.push(l),c&&x.push(c),x}_getContentExpressionInfos(e,i){return Array.isArray(e)?e.reduce((r,n)=>[...r,...n.type==="expression"&&n.expressionInfo?[n.expressionInfo]:[]],i):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((i,r)=>[...i,...this._getContentElementFields(r)],[]):[]}async _collectExpressionInfoFields(e,i,r){r&&await Promise.all(r.map(n=>eh(e,i,n.expression)))}_getFieldInfoFields(e){return e?e.filter(i=>i.visible===void 0||!!i.visible).map(i=>i.fieldName).filter(i=>!i.startsWith(GP)&&!i.startsWith(fpe)):[]}_getActionsFields(e){return e?e.toArray().reduce((i,r)=>[...i,...this._getActionFields(r)],[]):[]}_getActionFields(e){const{className:i,title:r,type:n}=e,s=n==="button"||n==="toggle"?e.image:"";return[...this._extractFieldNames(r),...this._extractFieldNames(i),...this._extractFieldNames(s)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const i=/{[^}]*}/g,r=e.match(i);if(!r)return[];const n=/\{(\w+):.+\}/,s=r.filter(o=>!(o.indexOf(`{${GP}`)===0||o.indexOf(`{${fpe}`)===0)).map(o=>o.replace(n,"{$1}"));return s?s.map(o=>o.slice(1,-1)):[]}};y([w({type:art})],dl.prototype,"actions",void 0),y([w()],dl.prototype,"content",void 0),y([Ci("content")],dl.prototype,"castContent",null),y([$t("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],dl.prototype,"readContent",null),y([Pt("content",{popupElements:{type:it.ofType(trt)},showAttachments:{type:Boolean},mediaInfos:{type:it.ofType($Me)},description:{type:String},relatedRecordsInfo:{type:nrt}})],dl.prototype,"writeContent",null),y([w({type:[irt],json:{write:!0}})],dl.prototype,"expressionInfos",void 0),y([w({type:[Ose]})],dl.prototype,"fieldInfos",void 0),y([Pt("fieldInfos")],dl.prototype,"writeFieldInfos",null),y([w({type:rrt})],dl.prototype,"layerOptions",void 0),y([Pt("layerOptions")],dl.prototype,"writeLayerOptions",null),y([w({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],dl.prototype,"lastEditInfoEnabled",void 0),y([w()],dl.prototype,"outFields",void 0),y([w()],dl.prototype,"overwriteActions",void 0),y([w()],dl.prototype,"returnGeometry",void 0),y([w({json:{type:String}})],dl.prototype,"title",void 0),y([Pt("title")],dl.prototype,"writeTitle",null),dl=y([Z("esri.PopupTemplate")],dl);const hE=dl,mpe=new yn({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let urt=0,fA=class extends Ue{constructor(e){super(e),this.id="sym"+urt++,this.type=null,this.color=new qe([0,0,0,1])}readColor(e){return(e==null?void 0:e[0])!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,i){}hash(){return JSON.stringify(this.toJSON())}clone(){}};y([w({type:mpe.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:mpe.write}}})],fA.prototype,"type",void 0),y([w({type:qe,json:{write:{allowNull:!0}}})],fA.prototype,"color",void 0),y([$t("color")],fA.prototype,"readColor",null),fA=y([Z("esri.symbols.Symbol")],fA);const fd=fA;var SJ;let jb=SJ=class extends fd{constructor(t){super(t),this.data=null,this.type="cim"}readData(t,e){return e}writeData(t,e){Object.assign(e,t)}async collectRequiredFields(t,e){var i;if(((i=this.data)==null?void 0:i.type)==="CIMSymbolReference"){const r=this.data.primitiveOverrides;if(r){const n=r.map(s=>{const o=s.valueExpressionInfo;return eh(t,e,o.expression)});await Promise.all(n)}}}clone(){return new SJ({data:Re(this.data)})}hash(){return Zre(JSON.stringify(this.data)).toString()}};y([w({json:{write:!1}})],jb.prototype,"color",void 0),y([w({json:{write:!0}})],jb.prototype,"data",void 0),y([$t("data",["symbol"])],jb.prototype,"readData",null),y([Pt("data",{})],jb.prototype,"writeData",null),y([Vt({CIMSymbolReference:"cim"},{readOnly:!0})],jb.prototype,"type",void 0),jb=SJ=y([Z("esri.symbols.CIMSymbol")],jb);const nx=jb;let mA=class extends Ue{constructor(e){super(e),this.enabled=!0,this.type=null,this.ignoreDrivers=!1}writeEnabled(e,i,r){e||(i[r]=e)}};y([w({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],mA.prototype,"enabled",void 0),y([Pt("enabled")],mA.prototype,"writeEnabled",null),y([w({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],mA.prototype,"type",void 0),mA=y([Z("esri.symbols.Symbol3DLayer")],mA);const o1=mA;function DB(t){const e=ene(100*(1-t));return Math.max(0,Math.min(e,100))}function jT(t){const e=1-t/100;return Math.max(0,Math.min(e,1))}function hrt(t,e){const i=e.transparency!=null?jT(e.transparency):1,r=e.color;return r&&Array.isArray(r)?new qe([r[0]||0,r[1]||0,r[2]||0,i]):null}function drt(t,e){e.color=t.toJSON().slice(0,3);const i=DB(t.a);i!==0&&(e.transparency=i)}const $_={type:qe,json:{type:[$n],default:null,read:{source:["color","transparency"],reader:hrt},write:{target:{color:{type:[$n]},transparency:{type:$n}},writer:drt}}},Gy={type:Number,cast:vs,json:{write:!0}};let v3=class extends Ue{constructor(e){super(e),this.color=new qe([0,0,0,1]),this.extensionLength=0,this.size=ad(1)}clone(){}cloneProperties(){return{color:Re(this.color),size:this.size,extensionLength:this.extensionLength}}};y([w({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],v3.prototype,"type",void 0),y([w($_)],v3.prototype,"color",void 0),y([w({...Gy,json:{write:{overridePolicy:t=>({enabled:!!t})}}})],v3.prototype,"extensionLength",void 0),y([w(Gy)],v3.prototype,"size",void 0),v3=y([Z("esri.symbols.edges.Edges3D")],v3);const Rse=v3;var TJ;let R7=TJ=class extends Rse{constructor(t){super(t),this.type="sketch"}clone(){return new TJ(this.cloneProperties())}};y([Vt({sketch:"sketch"},{readOnly:!0})],R7.prototype,"type",void 0),R7=TJ=y([Z("esri.symbols.edges.SketchEdges3D")],R7);const prt=R7;var EJ;let I7=EJ=class extends Rse{constructor(t){super(t),this.type="solid"}clone(){return new EJ(this.cloneProperties())}};y([Vt({solid:"solid"},{readOnly:!0})],I7.prototype,"type",void 0),I7=EJ=y([Z("esri.symbols.support.SolidEdges3D")],I7);const frt=I7,DMe={types:{key:"type",base:Rse,typeMap:{solid:frt,sketch:prt}},json:{write:!0}};var CJ;let mp=CJ=class extends Ue{constructor(t){super(t),this.color=null}clone(){const t={color:this.color!=null?this.color.clone():null};return new CJ(t)}};y([w($_)],mp.prototype,"color",void 0),mp=CJ=y([Z("esri.symbols.support.Symbol3DMaterial")],mp);var AJ;let Gb=AJ=class extends o1{constructor(t){super(t),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new AJ({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};y([Vt({Extrude:"extrude"},{readOnly:!0})],Gb.prototype,"type",void 0),y([w({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],Gb.prototype,"size",void 0),y([w({type:mp,json:{write:!0}})],Gb.prototype,"material",void 0),y([w({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Gb.prototype,"castShadows",void 0),y([w(DMe)],Gb.prototype,"edges",void 0),Gb=AJ=y([Z("esri.symbols.ExtrudeSymbol3DLayer")],Gb);const NMe=Gb;let c4=class extends fd{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};y([Vt({esriSLS:"simple-line"},{readOnly:!0})],c4.prototype,"type",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],c4.prototype,"width",void 0),c4=y([Z("esri.symbols.LineSymbol")],c4);const mrt=c4,grt=["begin","end","begin-end"],FMe=["arrow","circle","square","diamond","cross","x"];var MJ;let xg=MJ=class extends Ue{constructor(t){super(t),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(t,e,i,r){e[i]=(r==null?void 0:r.origin)==="web-map"?"arrow":t}set color(t){this._set("color",t)}readColor(t){return(t==null?void 0:t[0])!=null?[t[0],t[1],t[2],t[3]/255]:t}writeColor(t,e,i,r){(r==null?void 0:r.origin)==="web-map"||(e[i]=t)}clone(){return new MJ({color:Re(this.color),placement:this.placement,style:this.style})}hash(){var t;return`${this.placement}.${(t=this.color)==null?void 0:t.hash()}.${this.style}`}};y([w({type:["begin","end","begin-end"],json:{write:!0}})],xg.prototype,"placement",void 0),y([Vt({"line-marker":"line-marker"},{readOnly:!0}),w({json:{origins:{"web-map":{write:!1}}}})],xg.prototype,"type",void 0),y([w({type:FMe})],xg.prototype,"style",void 0),y([Pt("style")],xg.prototype,"writeStyle",null),y([w({type:qe,value:null,json:{write:{allowNull:!0}}})],xg.prototype,"color",null),y([$t("color")],xg.prototype,"readColor",null),y([Pt("color")],xg.prototype,"writeColor",null),xg=MJ=y([Z("esri.symbols.LineSymbolMarker")],xg);const yrt=xg;var OJ;const xH=new yn({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let B1=OJ=class extends mrt{constructor(...t){super(...t),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(t,e,i,r,n,s){if(t&&typeof t!="string")return t;const o={};return t!=null&&(o.style=t),e!=null&&(o.color=e),i!=null&&(o.width=vs(i)),r!=null&&(o.cap=r),n!=null&&(o.join=n),s!=null&&(o.miterLimit=vs(s)),o}clone(){var t;return new OJ({color:Re(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:(t=this.marker)==null?void 0:t.clone()})}hash(){var t,e;return`${super.hash()}.${(t=this.color)==null?void 0:t.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${(e=this.marker)==null?void 0:e.hash()}`}};y([Vt({esriSLS:"simple-line"},{readOnly:!0})],B1.prototype,"type",void 0),y([w({type:xH.apiValues,json:{read:xH.read,write:xH.write}})],B1.prototype,"style",void 0),y([w({type:["butt","round","square"],json:{write:{overridePolicy:(t,e,i)=>({enabled:t!=="round"&&(i==null?void 0:i.origin)==null})}}})],B1.prototype,"cap",void 0),y([w({type:["miter","round","bevel"],json:{write:{overridePolicy:(t,e,i)=>({enabled:t!=="round"&&(i==null?void 0:i.origin)==null})}}})],B1.prototype,"join",void 0),y([w({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":yrt}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],B1.prototype,"marker",void 0),y([w({type:Number,json:{read:!1,write:!1}})],B1.prototype,"miterLimit",void 0),B1=OJ=y([Z("esri.symbols.SimpleLineSymbol")],B1);const Oc=B1;let u4=class extends fd{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};y([w({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Oc}},json:{default:null,write:!0}})],u4.prototype,"outline",void 0),y([w({type:["simple-fill","picture-fill"],readOnly:!0})],u4.prototype,"type",void 0),u4=y([Z("esri.symbols.FillSymbol")],u4);const kMe=u4;let $7=class extends Ue{constructor(e){super(e)}clone(){}};y([w({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],$7.prototype,"type",void 0),$7=y([Z("esri.symbols.patterns.LinePattern3D")],$7);const zMe=$7,vrt=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var PJ;const _rt=fu()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let h4=PJ=class extends zMe{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new PJ(t)}};y([w({type:["style"]})],h4.prototype,"type",void 0),y([Vt(_rt),w({type:vrt})],h4.prototype,"style",void 0),h4=PJ=y([Z("esri.symbols.patterns.LineStylePattern3D")],h4);const Ise=h4;let L7=class extends Ue{constructor(e){super(e)}clone(){}};y([w({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],L7.prototype,"type",void 0),L7=y([Z("esri.symbols.patterns.Pattern3D")],L7);const UMe=L7,brt=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var RJ;let d4=RJ=class extends UMe{constructor(t){super(t),this.type="style",this.style="solid"}clone(){const t={style:this.style};return new RJ(t)}};y([w({type:["style"]})],d4.prototype,"type",void 0),y([w({type:brt,json:{read:!0,write:!0}})],d4.prototype,"style",void 0),d4=RJ=y([Z("esri.symbols.patterns.StylePattern3D")],d4);const VMe=d4,wrt={types:{key:"type",base:UMe,typeMap:{style:VMe}},json:{write:!0}},BMe={types:{key:"type",base:zMe,typeMap:{style:Ise}},json:{write:!0}},KI=new qe("white");new qe("black");const xrt=new qe([255,255,255,0]);function Srt(t){return t.r===0&&t.g===0&&t.b===0}var IJ;let QI=IJ=class extends mp{constructor(t){super(t),this.colorMixMode=null}clone(){const t={color:this.color!=null?this.color.clone():null,colorMixMode:this.colorMixMode};return new IJ(t)}};y([Vt({multiply:"multiply",replace:"replace",tint:"tint"})],QI.prototype,"colorMixMode",void 0),QI=IJ=y([Z("esri.symbols.support.Symbol3DFillMaterial")],QI);function ya(t=WMe){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function P2(t,e,i,r,n,s,o=ya()){return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o[4]=n,o[5]=s,o}function Trt(t,e){const i=isFinite(t[2])||isFinite(t[5]);return new Vi(i?{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],zmin:t[2],zmax:t[5],spatialReference:e}:{xmin:t[0],xmax:t[3],ymin:t[1],ymax:t[4],spatialReference:e})}function ZO(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[3]),t[4]=Math.max(t[4],e[4]),t[5]=Math.max(t[5],e[5])}function Ert(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[3]=Math.max(t[3],e[2]),t[4]=Math.max(t[4],e[3])}function qf(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.min(t[2],e[2]),t[3]=Math.max(t[3],e[0]),t[4]=Math.max(t[4],e[1]),t[5]=Math.max(t[5],e[2])}function cp(t,e,i=0,r=e.length/3){let n=t[0],s=t[1],o=t[2],l=t[3],c=t[4],f=t[5];for(let _=0;_=t[3]?0:t[3]-t[0]}function pE(t){return t[1]>=t[4]?0:t[4]-t[1]}function sx(t){return t[2]>=t[5]?0:t[5]-t[2]}function jMe(t){const e=dE(t),i=sx(t),r=pE(t);return Math.sqrt(e*e+i*i+r*r)}function gm(t,e=[0,0,0]){return e[0]=t[0]+dE(t)/2,e[1]=t[1]+pE(t)/2,e[2]=t[2]+sx(t)/2,e}function Y6(t,e=[0,0,0]){return e[0]=dE(t),e[1]=pE(t),e[2]=sx(t),e}function $se(t,e){return e[0]>=t[0]&&e[1]>=t[1]&&e[2]>=t[2]&&e[0]<=t[3]&&e[1]<=t[4]&&e[2]<=t[5]}function YZt(t,e){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]}function Art(t,e){return Math.max(e[0],t[0])<=Math.min(e[3],t[3])&&Math.max(e[1],t[1])<=Math.min(e[4],t[4])&&Math.max(e[2],t[2])<=Math.min(e[5],t[5])}function ym(t,e){return e==null||Art(t,e)}function GMe(t,e,i,r,n=t){return n[0]=t[0]+e,n[1]=t[1]+i,n[2]=t[2]+r,n[3]=t[3]+e,n[4]=t[4]+i,n[5]=t[5]+r,n}function XZt(t,e,i=t){const r=t[0]+dE(t)/2,n=t[1]+pE(t)/2,s=t[2]+sx(t)/2;return i[0]=r+(t[0]-r)*e,i[1]=n+(t[1]-n)*e,i[2]=s+(t[2]-s)*e,i[3]=r+(t[3]-r)*e,i[4]=n+(t[4]-n)*e,i[5]=s+(t[5]-s)*e,i}function ZZt(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function HMe(t,e,i=t){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i!==t&&(i[3]=t[3],i[4]=t[4],i[5]=t[5]),i}function qMe(t,e,i=t){return i[3]=e[0],i[4]=e[1],i[5]=e[2],i!==t&&(i[0]=t[0],i[1]=t[1],i[2]=t[2]),t}function NB(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Bn(t){return t?NB(t,gpe):ya(gpe)}function Lse(t,e){return e||(e=Ni()),e[0]=t[0],e[1]=t[1],e[2]=t[3],e[3]=t[4],e}function JZt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=Number.NEGATIVE_INFINITY,t[3]=e[2],t[4]=e[3],t[5]=Number.POSITIVE_INFINITY,t}function Mrt(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=Number.NEGATIVE_INFINITY,t[3]=r,t[4]=n,t[5]=Number.POSITIVE_INFINITY,t}function $J(t){return t.length===6}function Dse(t){return dE(t)===0&&pE(t)===0&&sx(t)===0}function KZt(t,e,i){if(t==null||e==null)return t===e;if(!$J(t)||!$J(e))return!1;if(i){for(let r=0;r{const e=Vh(t);return e===0?1:Je(e,.1,4)},nonNullable:!0},zrt=["left","right","center"],Urt=["baseline","top","middle","bottom"],ZMe={type:zrt,nonNullable:!0},JMe={type:Urt,nonNullable:!0},eJt=8;var DJ;let G1=DJ=class extends Ue{constructor(t){super(t),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(t){return vs(t)}clone(){return new DJ({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};y([w({type:Nrt,json:{default:"none",write:!0}})],G1.prototype,"decoration",void 0),y([w({type:String,json:{write:!0}})],G1.prototype,"family",void 0),y([w({type:Number,json:{write:{overridePolicy:(t,e,i)=>({enabled:!i||!i.textSymbol3D})}}})],G1.prototype,"size",void 0),y([Ci("size")],G1.prototype,"castSize",null),y([w({type:Frt,json:{default:"normal",write:!0}})],G1.prototype,"style",void 0),y([w({type:krt,json:{default:"normal",write:!0}})],G1.prototype,"weight",void 0),G1=DJ=y([Z("esri.symbols.Font")],G1);const FB=G1;function f_(t,e){var r;const i=(r=e==null?void 0:e.url)==null?void 0:r.path;if(t&&i&&(t=Gh(t,i,{preserveProtocolRelative:!0}),e.portalItem&&e.readResourcePaths)){const n=Ene(t,e.portalItem.itemUrl);n!=null&&Vrt.test(n)&&e.readResourcePaths.push(e.portalItem.resourceFromPath(n).path)}return NJ(t,e==null?void 0:e.portal)}function m_(t,e,i=JO.YES){var n,s;if(t==null)return t;!Zh(t)&&(e!=null&&e.blockedRelativeUrls)&&e.blockedRelativeUrls.push(t);let r=Gh(t);if(e){const o=((n=e.verifyItemRelativeUrls)==null?void 0:n.rootPath)||((s=e.url)==null?void 0:s.path);if(o){const l=NJ(o,e.portal),c=NJ(r,e.portal);r=Ene(c,l,l),r!=null&&r!==c&&r!==t&&e.verifyItemRelativeUrls&&e.verifyItemRelativeUrls.writtenUrls.push(r)}}return r=tOe(r,e==null?void 0:e.portal),Zh(r)&&(r=Mf(r)),e!=null&&e.resources&&(e!=null&&e.portalItem)&&!Zh(r)&&!i1(r)&&i===JO.YES&&e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(r),compress:!1}),r}function kB(t,e,i){return f_(t,i)}function R2(t,e,i,r){const n=m_(t,r);n!==void 0&&(e[i]=n)}const KMe=/\/items\/([^\/]+)\/resources\/(.*)/,Vrt=/^\.\/resources\//;function QMe(t){const e=(t==null?void 0:t.match(KMe))??null;return(e==null?void 0:e[1])??null}function eOe(t){const e=(t==null?void 0:t.match(KMe))??null;if(e==null)return null;const i=e[2],r=i.lastIndexOf("/");if(r===-1){const{path:o,extension:l}=nde(i);return{prefix:null,filename:o,extension:l}}const{path:n,extension:s}=nde(i.slice(r+1));return{prefix:i.slice(0,r),filename:n,extension:s}}function tOe(t,e){return e&&!e.isPortal&&e.urlKey&&e.customBaseUrl?bZ(t,`${e.urlKey}.${e.customBaseUrl}`,e.portalHostname):t}function NJ(t,e){if(!e||e.isPortal||!e.urlKey||!e.customBaseUrl)return t;const i=`${e.urlKey}.${e.customBaseUrl}`,r=wne();return UO(r,`${r.scheme}://${i}`)?bZ(t,e.portalHostname,i):bZ(t,i,e.portalHostname)}var JO;(function(t){t[t.YES=0]="YES",t[t.NO=1]="NO"})(JO||(JO={}));const Brt=Object.freeze(Object.defineProperty({__proto__:null,get MarkKeep(){return JO},ensureMainOnlineDomain:tOe,fromJSON:f_,itemIdFromResourceUrl:QMe,prefixAndFilenameFromResourceUrl:eOe,read:kB,toJSON:m_,write:R2},Symbol.toStringTag,{value:"Module"}));var FJ;const jrt=fu()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let b3=FJ=class extends Ue{constructor(t){super(t)}readHref(t,e,i){return t?f_(t,i):e.dataURI}writeHref(t,e,i,r){t&&(i1(t)?e.dataURI=t:(e.href=m_(t,r),Zh(e.href)&&(e.href=Mf(e.href))))}clone(){return new FJ({href:this.href,primitive:this.primitive})}};y([w({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],b3.prototype,"href",void 0),y([$t("href")],b3.prototype,"readHref",null),y([Pt("href",{href:{type:String},dataURI:{type:String}})],b3.prototype,"writeHref",null),y([Vt(jrt)],b3.prototype,"primitive",void 0),b3=FJ=y([Z("esri.symbols.support.IconSymbol3DLayerResource")],b3);const iOe="circle";var kJ;let SM=kJ=class extends ze{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new kJ({x:this.x,y:this.y})}};y([w({type:Number})],SM.prototype,"x",void 0),y([w({type:Number})],SM.prototype,"y",void 0),SM=kJ=y([Z("esri.symbols.support.Symbol3DAnchorPosition2D")],SM);var zJ;let p4=zJ=class extends Ue{constructor(t){super(t),this.color=new qe([0,0,0,1]),this.size=ad(1)}clone(){const t={color:this.color!=null?this.color.clone():null,size:this.size};return new zJ(t)}};y([w($_)],p4.prototype,"color",void 0),y([w(Gy)],p4.prototype,"size",void 0),p4=zJ=y([Z("esri.symbols.support.Symbol3DIconOutline")],p4);var gA;const rOe="esri.symbols.IconSymbol3DLayer";let Sg=gA=class extends o1{constructor(t){super(t),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new gA({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:this.material!=null?this.material.clone():null,outline:this.outline!=null?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(t){const e=t.color||KI,i=ype(t),r=t.outline&&t.outline.width>0?{size:t.outline.width,color:(t.outline.color||KI).clone()}:null;return new gA({size:t.size,resource:{primitive:Hrt(t.style)},material:{color:e},outline:r,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(t){const e=!t.color||Srt(t.color)?KI:t.color,i=ype(t);return new gA({size:t.width<=t.height?t.height:t.width,resource:{href:t.url},material:{color:e.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(t){return new gA({resource:{href:fEe({mediaType:"application/json",data:JSON.stringify(t.data)})}})}};function ype(t){const e="width"in t?t.width:t.size,i="height"in t?t.height:t.size,r=vpe(t.xoffset),n=vpe(t.yoffset);return(r||n)&&e&&i?{x:-r/e,y:n/i}:null}function vpe(t){return isFinite(t)?t:0}y([w({type:mp,json:{write:!0}})],Sg.prototype,"material",void 0),y([w({type:b3,json:{write:!0}})],Sg.prototype,"resource",void 0),y([Vt({Icon:"icon"},{readOnly:!0})],Sg.prototype,"type",void 0),y([w(Gy)],Sg.prototype,"size",void 0),y([Vt({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),w({json:{default:"center"}})],Sg.prototype,"anchor",void 0),y([w({type:SM,json:{type:[Number],read:{reader:t=>new SM({x:t[0],y:t[1]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Sg.prototype,"anchorPosition",void 0),y([w({type:p4,json:{write:!0}})],Sg.prototype,"outline",void 0),Sg=gA=y([Z(rOe)],Sg);const Grt={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function Hrt(t){return Grt[t]||(Ce.getLogger(rOe).warn(`${t} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const e2=Sg;let w3=class extends Xs(Ue){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return e!=null&&e.placement===this.placement&&e.style===this.style&&(this.color==null&&e.color==null||this.color!=null&&e.color!=null&&this.color.toJSON()===e.color.toJSON())}};y([w({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],w3.prototype,"type",void 0),y([w({type:grt,json:{default:"begin-end",write:!0}})],w3.prototype,"placement",void 0),y([w({type:FMe,json:{default:"arrow",write:!0}})],w3.prototype,"style",void 0),y([w({type:qe,json:{type:[$n],default:null,write:!0}})],w3.prototype,"color",void 0),w3=y([Z("esri.symbols.LineStyleMarker3D")],w3);const UJ=w3;var N7;let Tg=N7=class extends o1{constructor(t){super(t),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=ad(1),this.pattern=null,this.marker=null}clone(){const t={enabled:this.enabled,material:this.material!=null?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:this.pattern!=null?this.pattern.clone():null,marker:this.marker!=null?this.marker.clone():null};return new N7(t)}static fromSimpleLineSymbol(t){var i;const e={enabled:!0,size:t.width??ad(1),cap:t.cap||"butt",join:t.join||"miter",pattern:t.style&&t.style!=="inside-frame"?new Ise({style:t.style}):null,material:new mp({color:(t.color||KI).clone()}),marker:t.marker?new UJ({placement:t.marker.placement,style:t.marker.style,color:((i=t.marker.color)==null?void 0:i.clone())??null}):null};return new N7(e)}};y([w({type:mp,json:{write:!0}})],Tg.prototype,"material",void 0),y([Vt({Line:"line"},{readOnly:!0})],Tg.prototype,"type",void 0),y([w({type:YMe,json:{write:!0,default:"miter"}})],Tg.prototype,"join",void 0),y([w({type:Nse,json:{write:!0,default:"butt"}})],Tg.prototype,"cap",void 0),y([w(Gy)],Tg.prototype,"size",void 0),y([w(BMe)],Tg.prototype,"pattern",void 0),y([w({types:{key:"type",base:UJ,typeMap:{style:UJ}},json:{write:!0}})],Tg.prototype,"marker",void 0),Tg=N7=y([Z("esri.symbols.LineSymbol3DLayer")],Tg);const N9=Tg;var VJ;const qrt=fu()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let f4=VJ=class extends Ue{clone(){return new VJ({href:this.href,primitive:this.primitive})}};y([w({type:String,json:{read:kB,write:R2}})],f4.prototype,"href",void 0),y([Vt(qrt)],f4.prototype,"primitive",void 0),f4=VJ=y([Z("esri.symbols.support.ObjectSymbol3DLayerResource")],f4);const Fse="sphere";var BJ;let TS=BJ=class extends ze{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new BJ({x:this.x,y:this.y,z:this.z})}};y([w({type:Number})],TS.prototype,"x",void 0),y([w({type:Number})],TS.prototype,"y",void 0),y([w({type:Number})],TS.prototype,"z",void 0),TS=BJ=y([Z("esri.symbols.support.Symbol3DAnchorPosition3D")],TS);var jJ;let Gc=jJ=class extends o1{constructor(t){super(t),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){var t,e,i;return new jJ({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:(t=this.anchorPosition)==null?void 0:t.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:((e=this.material)==null?void 0:e.clone())??null,castShadows:this.castShadows,resource:(i=this.resource)==null?void 0:i.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};y([w({type:mp,json:{write:!0}})],Gc.prototype,"material",void 0),y([w({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Gc.prototype,"castShadows",void 0),y([w({type:f4,json:{write:!0}})],Gc.prototype,"resource",void 0),y([Vt({Object:"object"},{readOnly:!0})],Gc.prototype,"type",void 0),y([w({type:Number,json:{write:!0}})],Gc.prototype,"width",void 0),y([w({type:Number,json:{write:!0}})],Gc.prototype,"height",void 0),y([w({type:Number,json:{write:!0}})],Gc.prototype,"depth",void 0),y([Vt({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),w({json:{default:"origin"}})],Gc.prototype,"anchor",void 0),y([w({type:TS,json:{type:[Number],read:{reader:t=>new TS({x:t[0],y:t[1],z:t[2]})},write:{writer:(t,e)=>{e.anchorPosition=[t.x,t.y,t.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Gc.prototype,"anchorPosition",void 0),y([w({type:Number,json:{write:!0}})],Gc.prototype,"heading",void 0),y([w({type:Number,json:{write:!0}})],Gc.prototype,"tilt",void 0),y([w({type:Number,json:{write:!0}})],Gc.prototype,"roll",void 0),y([w({readOnly:!0})],Gc.prototype,"isPrimitive",null),Gc=jJ=y([Z("esri.symbols.ObjectSymbol3DLayer")],Gc);const kse=Gc;var GJ;let Cu=GJ=class extends o1{constructor(t){super(t),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(t,e){return t??(e.height==null&&e.size!=null?e.size:void 0)}readHeight(t,e){return t??(e.width==null&&e.size!=null?e.size:void 0)}clone(){return new GJ({enabled:this.enabled,material:this.material!=null?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};y([w({type:mp,json:{write:!0}})],Cu.prototype,"material",void 0),y([w({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Cu.prototype,"castShadows",void 0),y([Vt({Path:"path"},{readOnly:!0})],Cu.prototype,"type",void 0),y([w({type:["circle","quad"],json:{write:!0,default:"circle"}})],Cu.prototype,"profile",void 0),y([w({type:YMe,json:{write:!0,default:"miter"}})],Cu.prototype,"join",void 0),y([w({type:Drt,json:{write:!0,default:"butt"}})],Cu.prototype,"cap",void 0),y([w({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],Cu.prototype,"width",void 0),y([$t("width",["width","size","height"])],Cu.prototype,"readWidth",null),y([w({type:Number,json:{write:!0}})],Cu.prototype,"height",void 0),y([$t("height",["height","size","width"])],Cu.prototype,"readHeight",null),y([w({type:["center","bottom","top"],json:{write:!0,default:"center"}})],Cu.prototype,"anchor",void 0),y([w({type:["heading","all"],json:{write:!0,default:"all"}})],Cu.prototype,"profileRotation",void 0),Cu=GJ=y([Z("esri.symbols.PathSymbol3DLayer")],Cu);const zse=Cu;var HJ;let TM=HJ=class extends Ue{constructor(){super(...arguments),this.color=new qe([0,0,0,1]),this.size=0}clone(){const t={color:Re(this.color),size:this.size};return new HJ(t)}};y([w($_)],TM.prototype,"color",void 0),y([w(Gy)],TM.prototype,"size",void 0),TM=HJ=y([Z("esri.symbols.support.Symbol3DHalo")],TM);let e$=class extends Xs(Ue){constructor(e){super(e),this.color=null}};y([w($_)],e$.prototype,"color",void 0),e$=y([Z("esri.symbols.support.Symbol3DTextBackground")],e$);var F7;let bh=F7=class extends o1{constructor(t){super(t),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(t){t!=null&&this._userSize!=null&&(t.size=this._userSize),this._set("font",t)}writeFont(t,e,i,r){const n={...r,textSymbol3D:!0};e.font=t.write({},n),delete e.font.size}get size(){var t;return this._userSize!=null?this._userSize:((t=this.font)==null?void 0:t.size)!=null?this.font.size:9}set size(t){this._userSize=t,this.font!=null&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const t=new F7({enabled:this.enabled,font:this.font&&Re(this.font),halo:this.halo&&Re(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:this.material!=null?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:Re(this.background)});return t._userSize=this._userSize,t}static fromTextSymbol(t){return new F7({font:t.font!=null?t.font.clone():new FB,halo:Wrt(t.haloColor,t.haloSize),horizontalAlignment:t.horizontalAlignment,lineHeight:t.lineHeight,material:t.color?new mp({color:t.color.clone()}):null,text:t.text,verticalAlignment:t.verticalAlignment,background:t.backgroundColor?new e$({color:t.backgroundColor.clone()}):null})}};function Wrt(t,e){return t&&e!=null&&e>0?new TM({color:Re(t),size:e}):null}y([w({type:FB,json:{write:!0}})],bh.prototype,"font",null),y([Pt("font")],bh.prototype,"writeFont",null),y([w({type:TM,json:{write:!0}})],bh.prototype,"halo",void 0),y([w({...ZMe,json:{default:"center",write:!0}})],bh.prototype,"horizontalAlignment",void 0),y([w({...XMe,json:{default:1,write:!0}})],bh.prototype,"lineHeight",void 0),y([w({type:mp,json:{write:!0}})],bh.prototype,"material",void 0),y([w({type:e$,json:{write:!0}})],bh.prototype,"background",void 0),y([w(Gy)],bh.prototype,"size",null),y([w({type:String,json:{write:!0}})],bh.prototype,"text",void 0),y([Vt({Text:"text"},{readOnly:!0})],bh.prototype,"type",void 0),y([w({...JMe,json:{default:"baseline",write:!0}})],bh.prototype,"verticalAlignment",void 0),bh=F7=y([Z("esri.symbols.TextSymbol3DLayer")],bh);const fE=bh;var qJ;let Hb=qJ=class extends o1{constructor(t){super(t),this.color=WJ.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new qJ({color:Re(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};y([w({type:qe,nonNullable:!0,json:{type:[$n],write:(t,e,i)=>e[i]=t.toArray(qe.AlphaMode.UNLESS_OPAQUE),default:()=>WJ.clone(),defaultEquals:t=>t.toCss(!0)===WJ.toCss(!0)}})],Hb.prototype,"color",void 0),y([Vt({Water:"water"},{readOnly:!0})],Hb.prototype,"type",void 0),y([w({type:["small","medium","large"],json:{write:!0,default:"medium"}})],Hb.prototype,"waterbodySize",void 0),y([w({type:Number,json:{write:!0,default:null}})],Hb.prototype,"waveDirection",void 0),y([w({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],Hb.prototype,"waveStrength",void 0),Hb=qJ=y([Z("esri.symbols.WaterSymbol3DLayer")],Hb);const WJ=new qe([0,119,190]),nOe=Hb;var YJ;let x3=YJ=class extends ze{constructor(t){super(t),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new YJ({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};y([w({type:String})],x3.prototype,"name",void 0),y([w({type:String})],x3.prototype,"styleUrl",void 0),y([w({type:String})],x3.prototype,"styleName",void 0),y([w({type:os})],x3.prototype,"portal",void 0),x3=YJ=y([Z("esri.symbols.support.StyleOrigin")],x3);const yL=x3;var XJ;let hT=XJ=class extends ze{constructor(){super(...arguments),this.url=""}clone(){return new XJ({url:this.url})}};y([w({type:String})],hT.prototype,"url",void 0),hT=XJ=y([Z("esri.symbols.support.Thumbnail")],hT);const sOe={icon:e2,object:kse,line:N9,path:zse,fill:uP,extrude:NMe,text:fE,water:nOe},Yrt=it.ofType({base:o1,key:"type",typeMap:sOe,errorContext:"symbol-layer"});let Eg=class extends fd{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const i=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,r=i==null?void 0:i.type,n=r||it;this._set("symbolLayers",new n)}get color(){return null}set color(e){this.constructed&&Ce.getLogger(this).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){sd(e,this._get("symbolLayers"))}readStyleOrigin(e,i,r){if(e.styleUrl&&e.name){const n=f_(e.styleUrl,r);return new yL({styleUrl:n,name:e.name})}if(e.styleName&&e.name)return new yL({portal:(r==null?void 0:r.portal)||os.getDefault(),styleName:e.styleName,name:e.name});r!=null&&r.messages&&r.messages.push(new Uf("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:r,definition:e}))}writeStyleOrigin(e,i,r,n){if(e.styleUrl&&e.name){let s=m_(e.styleUrl,n);Zh(s)&&(s=Mf(s)),i.styleOrigin={styleUrl:s,name:e.name}}else e.styleName&&e.name&&(e.portal&&(n!=null&&n.portal)&&!dEe(e.portal.restUrl,n.portal.restUrl)?n!=null&&n.messages&&n.messages.push(new Uf("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):i.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof o1||e&&sOe[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};y([w({json:{read:!1,write:!1}})],Eg.prototype,"color",null),y([w({type:Yrt,nonNullable:!0,json:{write:!0}}),Ci(nP)],Eg.prototype,"symbolLayers",null),y([w({type:yL})],Eg.prototype,"styleOrigin",void 0),y([$t("styleOrigin")],Eg.prototype,"readStyleOrigin",null),y([Pt("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],Eg.prototype,"writeStyleOrigin",null),y([w({type:hT,json:{read:!1}})],Eg.prototype,"thumbnail",void 0),y([w({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],Eg.prototype,"type",void 0),Eg=y([Z("esri.symbols.Symbol3D")],Eg);const hP=Eg;let m4=class extends Ue{constructor(e){super(e),this.visible=!0}clone(){}};y([w({type:["line"],constructOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],m4.prototype,"type",void 0),y([w({readOnly:!0})],m4.prototype,"visible",void 0),m4=y([Z("esri.symbols.callouts.Callout3D")],m4);const oOe=m4;var ZJ;let k7=ZJ=class extends Ue{constructor(t){super(t),this.color=new qe("white")}clone(){return new ZJ({color:Re(this.color)})}};y([w($_)],k7.prototype,"color",void 0),k7=ZJ=y([Z("esri.symbols.callouts.LineCallout3DBorder")],k7);const Xrt=k7;var JJ;let qb=JJ=class extends oOe{constructor(t){super(t),this.type="line",this.color=new qe([0,0,0,1]),this.size=ad(1),this.border=null}get visible(){return this.size>0&&this.color!=null&&this.color.a>0}clone(){return new JJ({color:Re(this.color),size:this.size,border:Re(this.border)})}};y([Vt({line:"line"})],qb.prototype,"type",void 0),y([w($_)],qb.prototype,"color",void 0),y([w(Gy)],qb.prototype,"size",void 0),y([w({type:Xrt,json:{write:!0}})],qb.prototype,"border",void 0),y([w({readOnly:!0})],qb.prototype,"visible",null),qb=JJ=y([Z("esri.symbols.callouts.LineCallout3D")],qb);const aOe=qb;function Use(t){if(!t)return!1;const e=t.verticalOffset;return!!e&&!(e.screenLength<=0||e.maxWorldLength!=null&&e.maxWorldLength<=0)}function lOe(t){if(!t||!t.supportsCallout||!t.supportsCallout())return!1;const e=t.callout;return!!e&&!!e.visible&&!!Use(t)}function Vse(t){return t.type==="point-3d"||t.type==="label-3d"}function cOe(t){return t.horizontalAlignment==="center"}const uOe={types:{key:"type",base:oOe,typeMap:{line:aOe}},json:{write:!0}};var KJ;let yA=KJ=class extends Ue{constructor(t){super(t),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new KJ({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};y([w(Gy)],yA.prototype,"screenLength",void 0),y([w({type:Number,nonNullable:!0,json:{write:!0,default:0}})],yA.prototype,"minWorldLength",void 0),y([w({type:Number,json:{write:!0}})],yA.prototype,"maxWorldLength",void 0),yA=KJ=y([Z("esri.symbols.support.Symbol3DVerticalOffset")],yA);const Bse=yA;var z7;const hOe=it.ofType({base:null,key:"type",typeMap:{text:fE}});let Wb=z7=class extends hP{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new hOe,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return lOe(this)}hasVisibleVerticalOffset(){return Use(this)}clone(){return new z7({styleOrigin:Re(this.styleOrigin),symbolLayers:Re(this.symbolLayers),thumbnail:Re(this.thumbnail),callout:Re(this.callout),verticalOffset:Re(this.verticalOffset)})}static fromTextSymbol(t){return new z7({symbolLayers:new it([fE.fromTextSymbol(t)])})}};y([w({type:Bse,json:{write:!0}})],Wb.prototype,"verticalOffset",void 0),y([w(uOe)],Wb.prototype,"callout",void 0),y([w({json:{read:!1,write:!1}})],Wb.prototype,"styleOrigin",void 0),y([w({type:hOe})],Wb.prototype,"symbolLayers",void 0),y([Vt({LabelSymbol3D:"label-3d"},{readOnly:!0})],Wb.prototype,"type",void 0),Wb=z7=y([Z("esri.symbols.LabelSymbol3D")],Wb);const zB=Wb;var U7;const dOe=it.ofType({base:null,key:"type",typeMap:{line:N9,path:zse}}),Zrt=it.ofType({base:null,key:"type",typeMap:{line:N9,path:zse}});let g4=U7=class extends hP{constructor(t){super(t),this.symbolLayers=new dOe,this.type="line-3d"}clone(){return new U7({styleOrigin:Re(this.styleOrigin),symbolLayers:Re(this.symbolLayers),thumbnail:Re(this.thumbnail)})}static fromSimpleLineSymbol(t){return new U7({symbolLayers:new it([N9.fromSimpleLineSymbol(t)])})}};y([w({type:dOe,json:{type:Zrt}})],g4.prototype,"symbolLayers",void 0),y([Vt({LineSymbol3D:"line-3d"},{readOnly:!0})],g4.prototype,"type",void 0),g4=U7=y([Z("esri.symbols.LineSymbol3D")],g4);const UB=g4;let Yb=class extends fd{constructor(e){super(e),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};y([w({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],Yb.prototype,"angle",void 0),y([w({type:["simple-marker","picture-marker"],readOnly:!0})],Yb.prototype,"type",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Yb.prototype,"xoffset",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Yb.prototype,"yoffset",void 0),y([w({type:Number,cast:t=>t==="auto"?t:vs(t),json:{write:!0}})],Yb.prototype,"size",void 0),Yb=y([Z("esri.symbols.MarkerSymbol")],Yb);const pOe=Yb;var V7;const fOe=it.ofType({base:null,key:"type",typeMap:{fill:uP}});let y4=V7=class extends hP{constructor(t){super(t),this.symbolLayers=new fOe,this.type="mesh-3d"}clone(){return new V7({styleOrigin:Re(this.styleOrigin),symbolLayers:Re(this.symbolLayers),thumbnail:Re(this.thumbnail)})}static fromSimpleFillSymbol(t){return new V7({symbolLayers:new it([uP.fromSimpleFillSymbol(t)])})}};y([w({type:fOe})],y4.prototype,"symbolLayers",void 0),y([Vt({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],y4.prototype,"type",void 0),y4=V7=y([Z("esri.symbols.MeshSymbol3D")],y4);const F9=y4;function Jrt(t,e,i){return e.imageData?fEe({mediaType:e.contentType||"image/png",isBase64:!0,data:e.imageData}):mOe(e.url,i)}function mOe(t,e){var i;return Qrt(e)&&!Zh(t)&&((i=e==null?void 0:e.layer)!=null&&i.parsedUrl)?s0(e.layer.parsedUrl.path,"images",t):f_(t,e)}function Krt(t,e,i,r){if(i1(t)){const n=C2(t);if(!n)return;e.contentType=n.mediaType,e.imageData=n.data,i&&i.imageData===e.imageData&&i.url&&R2(i.url,e,"url",r)}else R2(t,e,"url",r)}const gOe={json:{read:{source:["imageData","url"],reader:Jrt},write:{writer(t,e,i,r){Krt(t,e,this.source,r)}}}},yOe={readOnly:!0,json:{read:{source:["imageData","url"],reader(t,e,i){const r={};return e.imageData&&(r.imageData=e.imageData),e.contentType&&(r.contentType=e.contentType),e.url&&(r.url=mOe(e.url,i)),r}}}};function Qrt(t){var e,i;return!(t==null||t.origin!=="service"&&t.origin!=="portal-item"||((e=t.layer)==null?void 0:e.type)!=="feature"&&((i=t.layer)==null?void 0:i.type)!=="stream")}var QJ;let Gp=QJ=class extends kMe{constructor(...t){super(...t),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(t,e,i,r){if(t&&typeof t!="string"&&t.imageData==null)return t;const n={};return t&&(n.url=t),e&&(n.outline=e),i!=null&&(n.width=vs(i)),r!=null&&(n.height=vs(r)),n}clone(){const t=new QJ({color:Re(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return t._set("source",Re(this.source)),t}hash(){var t;return`${super.hash()}.${(t=this.color)==null?void 0:t.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};y([Vt({esriPFS:"picture-fill"},{readOnly:!0})],Gp.prototype,"type",void 0),y([w(gOe)],Gp.prototype,"url",void 0),y([w({type:Number,json:{write:!0}})],Gp.prototype,"xscale",void 0),y([w({type:Number,json:{write:!0}})],Gp.prototype,"yscale",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Gp.prototype,"width",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Gp.prototype,"height",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Gp.prototype,"xoffset",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Gp.prototype,"yoffset",void 0),y([w(yOe)],Gp.prototype,"source",void 0),Gp=QJ=y([Z("esri.symbols.PictureFillSymbol")],Gp);const vOe=Gp;var eK;let M0=eK=class extends pOe{constructor(...t){super(...t),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string"&&t.imageData==null)return t;const r={};return t&&(r.url=t),e!=null&&(r.width=vs(e)),i!=null&&(r.height=vs(i)),r}readHeight(t,e){return e.size||t}readWidth(t,e){return e.size||t}clone(){const t=new eK({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return t._set("source",Re(this.source)),t}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};y([w({json:{write:!1}})],M0.prototype,"color",void 0),y([Vt({esriPMS:"picture-marker"},{readOnly:!0})],M0.prototype,"type",void 0),y([w(gOe)],M0.prototype,"url",void 0),y([w(yOe)],M0.prototype,"source",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],M0.prototype,"height",void 0),y([$t("height",["height","size"])],M0.prototype,"readHeight",null),y([w({type:Number,cast:vs,json:{write:!0}})],M0.prototype,"width",void 0),y([w({json:{write:!1}})],M0.prototype,"size",void 0),M0=eK=y([Z("esri.symbols.PictureMarkerSymbol")],M0);const dP=M0;var S3;const _Oe=it.ofType({base:null,key:"type",typeMap:{icon:e2,object:kse,text:fE}});let T3=S3=class extends hP{constructor(t){super(t),this.verticalOffset=null,this.callout=null,this.symbolLayers=new _Oe,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const t of this.symbolLayers.items)switch(t.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return lOe(this)}hasVisibleVerticalOffset(){return Use(this)}clone(){return new S3({verticalOffset:Re(this.verticalOffset),callout:Re(this.callout),styleOrigin:Re(this.styleOrigin),symbolLayers:Re(this.symbolLayers),thumbnail:Re(this.thumbnail)})}static fromSimpleMarkerSymbol(t){return new S3({symbolLayers:new it([e2.fromSimpleMarkerSymbol(t)])})}static fromPictureMarkerSymbol(t){return new S3({symbolLayers:new it([e2.fromPictureMarkerSymbol(t)])})}static fromCIMSymbol(t){var r,n;if(((n=(r=t.data)==null?void 0:r.symbol)==null?void 0:n.type)!=="CIMPointSymbol")return null;const i=t.data.symbol;return new S3(i!=null&&i.callout?{symbolLayers:new it([e2.fromCIMSymbol(t)]),callout:new aOe({size:.5,color:new qe([0,0,0])}),verticalOffset:new Bse({screenLength:40})}:{symbolLayers:new it([e2.fromCIMSymbol(t)])})}static fromTextSymbol(t){return new S3({symbolLayers:new it([fE.fromTextSymbol(t)])})}};y([w({type:Bse,json:{write:!0}})],T3.prototype,"verticalOffset",void 0),y([w(uOe)],T3.prototype,"callout",void 0),y([w({type:_Oe,json:{origins:{"web-scene":{write:!0}}}})],T3.prototype,"symbolLayers",void 0),y([Vt({PointSymbol3D:"point-3d"},{readOnly:!0})],T3.prototype,"type",void 0),T3=S3=y([Z("esri.symbols.PointSymbol3D")],T3);const t2=T3;var v4;const bOe=it.ofType({base:null,key:"type",typeMap:{extrude:NMe,fill:uP,icon:e2,line:N9,object:kse,text:fE,water:nOe}});let _4=v4=class extends hP{constructor(t){super(t),this.symbolLayers=new bOe,this.type="polygon-3d"}initialize(){const t=e=>{e.type==="line"&&NO(Ce.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),e.type==="text"&&NO(Ce.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const e of this.symbolLayers)t(e);this.addHandles(Jr(()=>this.symbolLayers,"after-add",({item:e})=>t(e),Li))}clone(){return new v4({styleOrigin:Re(this.styleOrigin),symbolLayers:Re(this.symbolLayers),thumbnail:Re(this.thumbnail)})}static fromJSON(t){var i;const e=new v4;if(e.read(t),e.symbolLayers.length===2&&e.symbolLayers.at(0).type==="fill"&&e.symbolLayers.at(1).type==="line"){const r=e.symbolLayers.at(0),n=e.symbolLayers.at(1);!n.enabled||(i=t.symbolLayers)!=null&&i[1]&&t.symbolLayers[1].enable===!1||(r.outline={size:n.size,color:n.material!=null?n.material.color:null}),e.symbolLayers.removeAt(1)}return e}static fromSimpleFillSymbol(t){return new v4({symbolLayers:new it([uP.fromSimpleFillSymbol(t)])})}};y([w({type:bOe,json:{write:!0}})],_4.prototype,"symbolLayers",void 0),y([Vt({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],_4.prototype,"type",void 0),_4=v4=y([Z("esri.symbols.PolygonSymbol3D")],_4);const k9=_4;var tK;const EH=new yn({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let E3=tK=class extends kMe{constructor(...t){super(...t),this.color=new qe([0,0,0,.25]),this.outline=new Oc,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string")return t;const r={};return t&&(r.style=t),e&&(r.outline=e),i&&(r.color=i),r}clone(){return new tK({color:Re(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};y([w()],E3.prototype,"color",void 0),y([w()],E3.prototype,"outline",void 0),y([Vt({esriSFS:"simple-fill"},{readOnly:!0})],E3.prototype,"type",void 0),y([w({type:EH.apiValues,json:{read:EH.read,write:EH.write}})],E3.prototype,"style",void 0),E3=tK=y([Z("esri.symbols.SimpleFillSymbol")],E3);const Bm=E3;var iK;const CH=new yn({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let Cg=iK=class extends pOe{constructor(...t){super(...t),this.color=new qe([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new Oc}normalizeCtorArgs(t,e,i,r){if(t&&typeof t!="string")return t;const n={};return t&&(n.style=t),e!=null&&(n.size=vs(e)),i&&(n.outline=i),r&&(n.color=r),n}writeColor(t,e){t&&this.style!=="x"&&this.style!=="cross"&&(e.color=t.toJSON()),t===null&&(e.color=null)}set path(t){this.style="path",this._set("path",t)}clone(){return new iK({angle:this.angle,color:Re(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var t;return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${(t=this.outline)==null?void 0:t.hash()}`}};y([w()],Cg.prototype,"color",void 0),y([Pt("color")],Cg.prototype,"writeColor",null),y([Vt({esriSMS:"simple-marker"},{readOnly:!0})],Cg.prototype,"type",void 0),y([w()],Cg.prototype,"size",void 0),y([w({type:CH.apiValues,json:{read:CH.read,write:CH.write}})],Cg.prototype,"style",void 0),y([w({type:String,json:{write:!0}})],Cg.prototype,"path",null),y([w({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":Oc}},json:{default:null,write:!0}})],Cg.prototype,"outline",void 0),Cg=iK=y([Z("esri.symbols.SimpleMarkerSymbol")],Cg);const cu=Cg;var rK;let po=rK=class extends fd{constructor(...t){super(...t),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new FB,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(t,e,i){if(t&&typeof t!="string")return t;const r={};return t&&(r.text=t),e&&(r.font=e),i&&(r.color=i),r}writeLineWidth(t,e,i,r){r&&typeof r!="string"?r.origin:e[i]=t}castLineWidth(t){return vs(t)}writeLineHeight(t,e,i,r){r&&typeof r!="string"?r.origin:e[i]=t}clone(){return new rK({angle:this.angle,backgroundColor:Re(this.backgroundColor),borderLineColor:Re(this.borderLineColor),borderLineSize:this.borderLineSize,color:Re(this.color),font:this.font&&this.font.clone(),haloColor:Re(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var t,e,i;return`${(t=this.backgroundColor)==null?void 0:t.hash()}.${this.borderLineColor}.${this.borderLineSize}.${(e=this.color)==null?void 0:e.hash()}.${this.font&&this.font.hash()}.${(i=this.haloColor)==null?void 0:i.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};y([w({type:qe,json:{write:!0}})],po.prototype,"backgroundColor",void 0),y([w({type:qe,json:{write:!0}})],po.prototype,"borderLineColor",void 0),y([w({type:Number,json:{write:!0},cast:vs})],po.prototype,"borderLineSize",void 0),y([w({type:FB,json:{write:!0}})],po.prototype,"font",void 0),y([w({...ZMe,json:{write:!0}})],po.prototype,"horizontalAlignment",void 0),y([w({type:Boolean,json:{write:!0}})],po.prototype,"kerning",void 0),y([w({type:qe,json:{write:!0}})],po.prototype,"haloColor",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],po.prototype,"haloSize",void 0),y([w({type:Boolean,json:{write:!0}})],po.prototype,"rightToLeft",void 0),y([w({type:Boolean,json:{write:!0}})],po.prototype,"rotated",void 0),y([w({type:String,json:{write:!0}})],po.prototype,"text",void 0),y([Vt({esriTS:"text"},{readOnly:!0})],po.prototype,"type",void 0),y([w({...JMe,json:{write:!0}})],po.prototype,"verticalAlignment",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],po.prototype,"xoffset",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],po.prototype,"yoffset",void 0),y([w({type:Number,json:{read:t=>t&&-1*t,write:(t,e)=>e.angle=t&&-1*t}})],po.prototype,"angle",void 0),y([w({type:Number,json:{write:!0}})],po.prototype,"width",void 0),y([w({type:Number})],po.prototype,"lineWidth",void 0),y([Pt("lineWidth")],po.prototype,"writeLineWidth",null),y([Ci("lineWidth")],po.prototype,"castLineWidth",null),y([w(XMe)],po.prototype,"lineHeight",void 0),y([Pt("lineHeight")],po.prototype,"writeLineHeight",null),po=rK=y([Z("esri.symbols.TextSymbol")],po);const mE=po;var nK;let O0=nK=class extends fd{constructor(t){super(t),this.color=null,this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const t=this.portal!=null?this.portal:os.getDefault(),e=t.user?t.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${e}:${t.url}`}read(t,e){this.portal=e==null?void 0:e.portal,super.read(t,e)}clone(){return new nK({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(t){return this._fetchSymbol("webRef",t)}fetchCIMSymbol(t){return this._fetchSymbol("cimRef",t)}async _fetchSymbol(t,e){const i=e!=null?e.cache:null,r=i?this._fetchCacheKey:null;if(i!=null){const l=r&&i.get(r);if(l)return l.clone()}const{resolveWebStyleSymbol:n}=await we(()=>Promise.resolve().then(()=>u5t),void 0);St(e);const s=n(this,{portal:this.portal},t,e);s.catch(l=>{Ce.getLogger(this).error("#fetchSymbol()","Failed to create symbol from style",l)});const o=await s;return t==="webRef"&&o.type==="point-3d"||t==="cimRef"&&o.type==="cim"?(i!=null&&i.set(r,o.clone()),o):null}};y([w({json:{write:!1}})],O0.prototype,"color",void 0),y([w({type:String,json:{write:!0}})],O0.prototype,"styleName",void 0),y([w({type:os,json:{write:!1}})],O0.prototype,"portal",void 0),y([w({type:String,json:{read:kB,write:R2}})],O0.prototype,"styleUrl",void 0),y([w({type:hT,json:{read:!1}})],O0.prototype,"thumbnail",void 0),y([w({type:String,json:{write:!0}})],O0.prototype,"name",void 0),y([Vt({styleSymbolReference:"web-style"},{readOnly:!0})],O0.prototype,"type",void 0),y([w()],O0.prototype,"_fetchCacheKey",null),O0=nK=y([Z("esri.symbols.WebStyleSymbol")],O0);const gE=O0;function VB(t){if(!t)return!1;switch(t.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function Hy(t){if(!t)return!1;switch(t.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const py={base:fd,key:"type",typeMap:{"simple-fill":Bm,"picture-fill":vOe,"picture-marker":dP,"simple-line":Oc,"simple-marker":cu,text:mE,"label-3d":zB,"line-3d":UB,"mesh-3d":F9,"point-3d":t2,"polygon-3d":k9,"web-style":gE,cim:nx},errorContext:"symbol"},oJt={base:fd,key:"type",typeMap:{"picture-marker":dP,"simple-marker":cu,text:mE,"web-style":gE,cim:nx},errorContext:"symbol"},ent=Z5({types:py}),wOe={base:fd,key:"type",typeMap:{"simple-fill":Bm,"picture-fill":vOe,"picture-marker":dP,"simple-line":Oc,"simple-marker":cu,text:mE,"line-3d":UB,"mesh-3d":F9,"point-3d":t2,"polygon-3d":k9,"web-style":gE,cim:nx},errorContext:"symbol"},tnt={base:fd,key:"type",typeMap:{text:mE,"label-3d":zB},errorContext:"symbol"},_pe={base:fd,key:"type",typeMap:{"line-3d":UB,"mesh-3d":F9,"point-3d":t2,"polygon-3d":k9,"web-style":gE,cim:nx},errorContext:"symbol"},int={base:fd,key:"type",typeMap:{"label-3d":zB},errorContext:"symbol"},xOe=zy(py);var sK;function rnt(t){if(!t)return null;const e={};for(const i in t){const r=O2(t[i]);r&&(e[i]=r)}return Object.keys(e).length!==0?e:null}function nnt(t){if(t==null)return null;const e={};for(const i in t){const r=t[i];r&&(e[i]=r.toJSON())}return Object.keys(e).length!==0?e:null}let wh=sK=class extends Xs(Ue){constructor(...t){super(...t),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:hp(),configurable:!0})}normalizeCtorArgs(t,e,i,r){return t&&!t.declaredClass?t:{geometry:t,symbol:e,attributes:i,popupTemplate:r}}set aggregateGeometries(t){const e=this._get("aggregateGeometries");JSON.stringify(e)!==JSON.stringify(t)&&this._set("aggregateGeometries",t)}set attributes(t){const e=this._get("attributes");e!==t&&(this._set("attributes",t),this._notifyLayer("attributes",e,t))}set geometry(t){const e=this._get("geometry");e!==t&&(this._set("geometry",t),this._notifyLayer("geometry",e,t))}set symbol(t){const e=this._get("symbol");e!==t&&(this._set("symbol",t),this._notifyLayer("symbol",e,t))}set visible(t){const e=this._get("visible");e!==t&&(this._set("visible",t),this._notifyLayer("visible",e,t))}cloneShallow(){return new sK({aggregateGeometries:this.aggregateGeometries,attributes:this.attributes,geometry:this.geometry,isAggregate:this.isAggregate,layer:this.layer,popupTemplate:this.popupTemplate,sourceLayer:this.sourceLayer,symbol:this.symbol,visible:this.visible})}getEffectivePopupTemplate(t=!1){if(this.popupTemplate)return this.popupTemplate;for(const e of[this.sourceLayer,this.layer])if(e){if("popupTemplate"in e&&e.popupTemplate)return e.popupTemplate;if(t&&"defaultPopupTemplate"in e&&e.defaultPopupTemplate!=null)return e.defaultPopupTemplate}return null}getAttribute(t){var e;return(e=this.attributes)==null?void 0:e[t]}setAttribute(t,e){if(this.attributes){const i=this.getAttribute(t);this.attributes[t]=e,this._notifyLayer("attributes",i,e,t)}else this.attributes={[t]:e},this._notifyLayer("attributes",void 0,e,t)}getObjectId(){return this.sourceLayer&&"objectIdField"in this.sourceLayer&&this.sourceLayer.objectIdField?this.getAttribute(this.sourceLayer.objectIdField):null}toJSON(){var t;return{aggregateGeometries:nnt(this.aggregateGeometries),geometry:this.geometry!=null?this.geometry.toJSON():null,symbol:this.symbol!=null?this.symbol.toJSON():null,attributes:sz(this.attributes)?this.attributes.toJSON():{...this.attributes},popupTemplate:((t=this.popupTemplate)==null?void 0:t.toJSON())??null}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(t={}){const{geometry:e}=this;if((e==null?void 0:e.type)==="mesh"){const i={origin:e.origin,transform:e.transform};this._notifyLayer("origin-transform",i,i,t.action)}}_notifyLayer(t,e,i,r){if(!this.layer||!("graphicChanged"in this.layer))return;const n={graphic:this,property:t,oldValue:e,newValue:i};t==="origin-transform"&&(n.action=r),t==="attributes"&&(n.attributeName=r),this.layer.graphicChanged(n)}};y([w({value:null,json:{read:rnt}})],wh.prototype,"aggregateGeometries",null),y([w({value:null})],wh.prototype,"attributes",null),y([w({value:null,types:I9,json:{read:O2}})],wh.prototype,"geometry",null),y([w({type:Boolean})],wh.prototype,"isAggregate",void 0),y([w({clonable:"reference"})],wh.prototype,"layer",void 0),y([w({type:hE})],wh.prototype,"popupTemplate",void 0),y([w({clonable:"reference"})],wh.prototype,"sourceLayer",void 0),y([w({value:null,types:py})],wh.prototype,"symbol",null),y([w({type:Boolean,value:!0})],wh.prototype,"visible",null),wh=sK=y([Z("esri.Graphic")],wh),function(t){t.generateUID=hp}(wh||(wh={}));const Ml=wh;let dT=class extends YI{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};y([BSe({Type:Ml,ensureType:$s(Ml)})],dT.prototype,"itemType",void 0),dT=y([Z("esri.support.GraphicsCollection")],dT);var oK;let b4=oK=class extends Ue{constructor(t){super(t)}async collectRequiredFields(t,e){return eh(t,e,this.expression)}clone(){return new oK({expression:this.expression,title:this.title})}equals(t){return this.expression===t.expression&&this.title===t.title}};y([w({type:String,json:{write:!0}})],b4.prototype,"expression",void 0),y([w({type:String,json:{write:!0}})],b4.prototype,"title",void 0),b4=oK=y([Z("esri.layers.support.FeatureExpressionInfo")],b4);const bpe=b4,KO={unknown:1,inches:Ur(1,"meters","inches"),feet:Ur(1,"meters","feet"),"us-feet":Ur(1,"meters","us-feet"),yards:Ur(1,"meters","yards"),miles:Ur(1,"meters","miles"),"nautical-miles":Ur(1,"meters","nautical-miles"),millimeters:Ur(1,"meters","millimeters"),centimeters:Ur(1,"meters","centimeters"),decimeters:Ur(1,"meters","decimeters"),meters:Ur(1,"meters","meters"),kilometers:Ur(1,"meters","kilometers"),"decimal-degrees":1/UCe(1,"meters",Mr.radius)};function snt(t){return!!t&&KO[t]!=null}function SOe(t){return 1/(KO[t]||1)}function ont(){const t=Object.keys(KO);return t.sort(),t}const ant=ont();var aK;const X6=fu()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),wpe=new yn({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let H1=aK=class extends Ue{constructor(t){super(t),this.offset=null}readFeatureExpressionInfo(t,e){return t??(e.featureExpression&&e.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(t,e,i,r){e[i]=t.write({},r),t.expression==="0"&&(e.featureExpression={value:0})}get mode(){const{offset:t,featureExpressionInfo:e}=this;return this._isOverridden("mode")?this._get("mode"):t!=null||e?"relative-to-ground":"on-the-ground"}set mode(t){this._override("mode",t)}set unit(t){this._set("unit",t)}write(t,e){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(t,e):null}clone(){return new aK({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(t){return this.mode===t.mode&&this.offset===t.offset&&this.unit===t.unit&&FO(this.featureExpressionInfo,t.featureExpressionInfo)}};y([w({type:bpe,json:{write:!0}})],H1.prototype,"featureExpressionInfo",void 0),y([$t("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],H1.prototype,"readFeatureExpressionInfo",null),y([Pt("featureExpressionInfo",{featureExpressionInfo:{type:bpe},"featureExpression.value":{type:[0]}})],H1.prototype,"writeFeatureExpressionInfo",null),y([w({type:X6.apiValues,nonNullable:!0,json:{type:X6.jsonValues,read:X6.read,write:{writer:X6.write,isRequired:!0}}})],H1.prototype,"mode",null),y([w({type:Number,json:{write:!0}})],H1.prototype,"offset",void 0),y([w({type:ant,json:{type:String,read:wpe.read,write:wpe.write}})],H1.prototype,"unit",null),H1=aK=y([Z("esri.layers.support.ElevationInfo")],H1);const BB=H1;let q1=class extends Sse(OB(uE)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new dT,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,i){return super.on(e,i)}graphicChanged(e){this.emit("graphic-update",e)}};y([w({type:BB})],q1.prototype,"elevationInfo",void 0),y([w(Pz(dT,"graphics"))],q1.prototype,"graphics",void 0),y([w({type:["show","hide"]})],q1.prototype,"listMode",void 0),y([w()],q1.prototype,"screenSizePerspectiveEnabled",void 0),y([w({readOnly:!0})],q1.prototype,"type",void 0),y([w({constructOnly:!0})],q1.prototype,"internal",void 0),q1=y([Z("esri.layers.GraphicsLayer")],q1);const jse=q1;var lK;let w4=lK=class extends Ue{constructor(t){super(t),this.minValue=0,this.maxValue=0}clone(){return new lK({minValue:this.minValue,maxValue:this.maxValue})}};y([w({type:Number,json:{write:!0}})],w4.prototype,"minValue",void 0),y([w({type:Number,json:{write:!0}})],w4.prototype,"maxValue",void 0),w4=lK=y([Z("esri.renderer.support.AuthoringInfoClassBreakInfo")],w4);var cK;let $w=cK=class extends Ue{constructor(t){super(t),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new cK({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:Re(this.classBreakInfos)})}};y([w({type:String,json:{write:!0}})],$w.prototype,"field",void 0),y([w({type:String,json:{write:!0}})],$w.prototype,"normalizationField",void 0),y([w({type:String,json:{write:!0}})],$w.prototype,"label",void 0),y([w({type:[w4],json:{write:!0}})],$w.prototype,"classBreakInfos",void 0),$w=cK=y([Z("esri.renderers.support.AuthoringInfoFieldInfo")],$w);var uK;const Z6=new yn({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),J6=new yn({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),xpe={key:t=>typeof t=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},Spe=["high-to-low","above-and-below","centered-on","extremes"],Tpe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],Epe=["seconds","minutes","hours","days","months","years"];let xh=uK=class extends Ue{constructor(t){super(t),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(t){return typeof t=="string"||typeof t=="number"?t:null}castStartTime(t){return typeof t=="string"||typeof t=="number"?t:null}get style(){return this.type==="color"?this._get("style"):null}set style(t){this._set("style",t)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(t){this._set("theme",t)}clone(){return new uK({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};y([w({types:xpe,json:{write:!0}})],xh.prototype,"endTime",void 0),y([Ci("endTime")],xh.prototype,"castEndTime",null),y([w({type:String,json:{write:!0}})],xh.prototype,"field",void 0),y([w({type:Number,json:{write:!0}})],xh.prototype,"maxSliderValue",void 0),y([w({type:Number,json:{write:!0}})],xh.prototype,"minSliderValue",void 0),y([w({types:xpe,json:{write:!0}})],xh.prototype,"startTime",void 0),y([Ci("startTime")],xh.prototype,"castStartTime",null),y([w({type:Z6.apiValues,value:null,json:{type:Z6.jsonValues,read:Z6.read,write:Z6.write}})],xh.prototype,"style",null),y([w({type:Tpe,value:null,json:{type:Tpe,origins:{"web-scene":{type:Spe,write:{writer:(t,e)=>{Spe.includes(t)&&(e.theme=t)}}}},write:!0}})],xh.prototype,"theme",null),y([w({type:J6.apiValues,json:{type:J6.jsonValues,read:J6.read,write:J6.write}})],xh.prototype,"type",void 0),y([w({type:Epe,json:{type:Epe,write:!0}})],xh.prototype,"units",void 0),xh=uK=y([Z("esri.renderers.support.AuthoringInfoVisualVariable")],xh);const lnt=xh;let B7=class extends Ue{constructor(e){super(e),this.type=null}};y([w({readOnly:!0,json:{read:!1,write:!0}})],B7.prototype,"type",void 0),B7=y([Z("esri.rest.support.ColorRamp")],B7);const Gse=B7;var hK;let C3=hK=class extends Gse{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new hK({fromColor:Re(this.fromColor),toColor:Re(this.toColor),algorithm:this.algorithm})}};y([Vt({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],C3.prototype,"algorithm",void 0),y([w({type:qe,json:{type:[$n],write:!0}})],C3.prototype,"fromColor",void 0),y([w({type:qe,json:{type:[$n],write:!0}})],C3.prototype,"toColor",void 0),y([w({type:["algorithmic"]})],C3.prototype,"type",void 0),C3=hK=y([Z("esri.rest.support.AlgorithmicColorRamp")],C3);const Hse=C3;var dK;let x4=dK=class extends Gse{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new dK({colorRamps:Re(this.colorRamps)})}};y([w({type:[Hse],json:{write:!0}})],x4.prototype,"colorRamps",void 0),y([w({type:["multipart"]})],x4.prototype,"type",void 0),x4=dK=y([Z("esri.rest.support.MultipartColorRamp")],x4);const TOe=x4,cnt={key:"type",base:Gse,typeMap:{algorithmic:Hse,multipart:TOe}};function unt(t){return t!=null&&t.type?t.type==="algorithmic"?Hse.fromJSON(t):t.type==="multipart"?TOe.fromJSON(t):null:null}var pK;const bx=new yn({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),K6=new yn({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Cpe=new yn({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),Ape=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],hnt=["high-to-low","above-and-below","above","below","90-10"],dnt=["flow-line","wave-front"],pnt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let qo=pK=class extends Ue{constructor(t){super(t),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const t=this._get("classificationMethod"),e=this.type;return e&&e!=="relationship"?e==="class-breaks-size"||e==="class-breaks-color"?t||"manual":null:t}set classificationMethod(t){this._set("classificationMethod",t)}readColorRamp(t){return t?unt(t):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(t){this._set("fields",t)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(t){this._set("field1",t)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(t){this._set("field2",t)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(t){this._set("flowTheme",t)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(t){this._set("focus",t)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(t){this._set("numClasses",t)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(t){this._set("statistics",t)}get standardDeviationInterval(){const t=this.type;return t&&t!=="relationship"&&t!=="class-breaks-size"&&t!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(t){this._set("standardDeviationInterval",t)}get type(){return this._get("type")}set type(t){let e=t;t==="classed-size"?e="class-breaks-size":t==="classed-color"&&(e="class-breaks-color"),this._set("type",e)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(t){this._set("univariateSymbolStyle",t)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(t){this._set("univariateTheme",t)}clone(){var t;return new pK({classificationMethod:this.classificationMethod,colorRamp:Re(this.colorRamp),fadeRatio:Re(this.fadeRatio),fields:(t=this.fields)==null?void 0:t.slice(0),field1:Re(this.field1),field2:Re(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};y([w({type:bx.apiValues,value:null,json:{type:bx.jsonValues,read:bx.read,write:bx.write,origins:{"web-document":{default:"manual",type:bx.jsonValues,read:bx.read,write:bx.write}}}})],qo.prototype,"classificationMethod",null),y([w({types:cnt,json:{write:!0}})],qo.prototype,"colorRamp",void 0),y([$t("colorRamp")],qo.prototype,"readColorRamp",null),y([w({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],qo.prototype,"fadeRatio",void 0),y([w({type:[String],value:null,json:{write:!0}})],qo.prototype,"fields",null),y([w({type:$w,value:null,json:{write:!0}})],qo.prototype,"field1",null),y([w({type:$w,value:null,json:{write:!0}})],qo.prototype,"field2",null),y([w({type:dnt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],qo.prototype,"flowTheme",null),y([w({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],qo.prototype,"focus",null),y([w({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],qo.prototype,"isAutoGenerated",void 0),y([w({type:Number,value:null,json:{type:$n,write:!0}})],qo.prototype,"numClasses",null),y([w({type:Ape,json:{type:Ape,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],qo.prototype,"lengthUnit",void 0),y([w({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],qo.prototype,"maxSliderValue",void 0),y([w({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],qo.prototype,"minSliderValue",void 0),y([w({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],qo.prototype,"statistics",null),y([w({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],qo.prototype,"standardDeviationInterval",null),y([w({type:K6.apiValues,value:null,json:{type:K6.jsonValues,read:K6.read,write:K6.write,origins:{"web-scene":{type:Cpe.jsonValues,write:{writer:Cpe.write,overridePolicy:t=>({enabled:t!=="flow"})}}}}})],qo.prototype,"type",null),y([w({type:[lnt],json:{write:!0}})],qo.prototype,"visualVariables",void 0),y([w({type:pnt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],qo.prototype,"univariateSymbolStyle",null),y([w({type:hnt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],qo.prototype,"univariateTheme",null),qo=pK=y([Z("esri.renderers.support.AuthoringInfo")],qo);const EOe=qo,AH=new yn({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let S4=class extends Ue{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const i=new Set;return await this.collectRequiredFields(i,e),Array.from(i).sort()}getSymbol(e,i){}async getSymbolAsync(e,i){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};y([w({type:EOe,json:{write:!0}})],S4.prototype,"authoringInfo",void 0),y([w({type:AH.apiValues,readOnly:!0,json:{type:AH.jsonValues,read:!1,write:{writer:AH.write,ignoreOrigin:!0}}})],S4.prototype,"type",void 0),S4=y([Z("esri.renderers.Renderer")],S4);const L_=S4;function fnt(t){var e,i;return((i=(e=t.match(mnt))==null?void 0:e[1])==null?void 0:i.replace(/\\'/g,"'"))??null}const mnt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var fK;let sO=fK=class extends Ue{constructor(){super(...arguments),this.title=null}clone(){return new fK({title:this.title})}};y([w({type:String,json:{write:!0}})],sO.prototype,"title",void 0),sO=fK=y([Z("esri.renderers.support.LegendOptions")],sO);var mK;let j7=mK=class extends sO{constructor(){super(...arguments),this.showLegend=null}clone(){return new mK({title:this.title,showLegend:this.showLegend})}};y([w({type:Boolean,json:{write:!0}})],j7.prototype,"showLegend",void 0),j7=mK=y([Z("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],j7);const COe=j7,MH=new yn({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let P0=class extends Ue{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(Ce.getLogger(this).error(".field: field must be a string value"),null):y9(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};y([w()],P0.prototype,"index",void 0),y([w({type:MH.apiValues,readOnly:!0,json:{read:MH.read,write:MH.write}})],P0.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],P0.prototype,"field",void 0),y([Ci("field")],P0.prototype,"castField",null),y([w({type:String,json:{write:!0}})],P0.prototype,"valueExpression",void 0),y([w({type:String,json:{write:!0}})],P0.prototype,"valueExpressionTitle",void 0),y([w({readOnly:!0})],P0.prototype,"arcadeRequired",null),y([w({type:COe,json:{write:!0}})],P0.prototype,"legendOptions",void 0),P0=y([Z("esri.renderers.visualVariables.VisualVariable")],P0);const z9=P0;var gK;let A3=gK=class extends Ue{constructor(t){super(t),this.color=null,this.label=null,this.value=null}writeValue(t,e,i){e[i]=t??0}clone(){return new gK({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};y([w({type:qe,json:{type:[$n],write:!0}})],A3.prototype,"color",void 0),y([w({type:String,json:{write:!0}})],A3.prototype,"label",void 0),y([w({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],A3.prototype,"value",void 0),y([Pt("value")],A3.prototype,"writeValue",null),A3=gK=y([Z("esri.renderers.visualVariables.support.ColorStop")],A3);const gnt=A3;var yK;let M3=yK=class extends z9{constructor(t){super(t),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,i)=>e.value-i.value),this._set("stops",t)}clone(){var t;return new yK({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:(t=this.legendOptions)==null?void 0:t.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};y([w({readOnly:!0})],M3.prototype,"cache",null),y([w({type:["color"],json:{type:["colorInfo"]}})],M3.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],M3.prototype,"normalizationField",void 0),y([w({type:[gnt],json:{write:!0}})],M3.prototype,"stops",null),M3=yK=y([Z("esri.renderers.visualVariables.ColorVariable")],M3);const AOe=M3;var vK;let Xb=vK=class extends Ue{constructor(t){super(t),this.label=null,this.opacity=null,this.value=null}readOpacity(t,e){return jT(e.transparency)}writeOpacity(t,e,i){e[i]=DB(t)}clone(){return new vK({label:this.label,opacity:this.opacity,value:this.value})}};y([w({type:String,json:{write:!0}})],Xb.prototype,"label",void 0),y([w({type:Number,json:{type:$n,write:{target:"transparency"}}})],Xb.prototype,"opacity",void 0),y([$t("opacity",["transparency"])],Xb.prototype,"readOpacity",null),y([Pt("opacity")],Xb.prototype,"writeOpacity",null),y([w({type:Number,json:{write:!0}})],Xb.prototype,"value",void 0),Xb=vK=y([Z("esri.renderers.visualVariables.support.OpacityStop")],Xb);const ynt=Xb;var _K;let O3=_K=class extends z9{constructor(t){super(t),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(e=>!!e)).sort((e,i)=>e.value-i.value),this._set("stops",t)}clone(){var t;return new _K({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:(t=this.legendOptions)==null?void 0:t.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};y([w({readOnly:!0})],O3.prototype,"cache",null),y([w({type:["opacity"],json:{type:["transparencyInfo"]}})],O3.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],O3.prototype,"normalizationField",void 0),y([w({type:[ynt],json:{write:!0}})],O3.prototype,"stops",null),O3=_K=y([Z("esri.renderers.visualVariables.OpacityVariable")],O3);const MOe=O3;var bK;let W1=bK=class extends z9{constructor(t){super(t),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(t,e,i,r){if(r!=null&&r.messages){const n=`visualVariables[${this.index}]`;r.messages.push(new se("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpressionTitle",context:r}))}}clone(){var t;return new bK({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:(t=this.legendOptions)==null?void 0:t.clone()})}};y([w({readOnly:!0})],W1.prototype,"cache",null),y([w({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],W1.prototype,"axis",void 0),y([w({type:["rotation"],json:{type:["rotationInfo"]}})],W1.prototype,"type",void 0),y([w({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],W1.prototype,"rotationType",void 0),y([w({type:String,json:{write:!0}})],W1.prototype,"valueExpressionTitle",void 0),y([Pt("web-scene","valueExpressionTitle")],W1.prototype,"writeValueExpressionTitleWebScene",null),W1=bK=y([Z("esri.renderers.visualVariables.RotationVariable")],W1);const OOe=W1;var wK;let vA=wK=class extends Ue{constructor(t){super(t),this.label=null,this.size=null,this.value=null}clone(){return new wK({label:this.label,size:this.size,value:this.value})}};y([w({type:String,json:{write:!0}})],vA.prototype,"label",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],vA.prototype,"size",void 0),y([w({type:Number,json:{write:!0}})],vA.prototype,"value",void 0),vA=wK=y([Z("esri.renderers.visualVariables.support.SizeStop")],vA);const vnt=vA;var xK;let G7=xK=class extends COe{constructor(){super(...arguments),this.customValues=null}clone(){var t;return new xK({title:this.title,showLegend:this.showLegend,customValues:(t=this.customValues)==null?void 0:t.slice(0)})}};y([w({type:[Number],json:{write:!0}})],G7.prototype,"customValues",void 0),G7=xK=y([Z("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],G7);const POe=G7;var Xv,Sl;function EM(t){return t&&t.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function vL(t){return t!=null&&!isNaN(t)&&isFinite(t)}function ROe(t){return t.valueExpression?Xv.Expression:t.field&&typeof t.field=="string"?Xv.Field:Xv.Unknown}function _nt(t,e){const i=e||ROe(t),r=t.valueUnit||"unknown";return i===Xv.Unknown?Sl.Constant:t.stops?Sl.Stops:t.minSize!=null&&t.maxSize!=null&&t.minDataValue!=null&&t.maxDataValue!=null?Sl.ClampedLinear:r==="unknown"?t.minSize!=null&&t.minDataValue!=null?t.minSize&&t.minDataValue?Sl.Proportional:Sl.Additive:Sl.Identity:Sl.RealWorldSize}(function(t){t.Unknown="unknown",t.Expression="expression",t.Field="field"})(Xv||(Xv={})),function(t){t.Unknown="unknown",t.Stops="stops",t.ClampedLinear="clamped-linear",t.Proportional="proportional",t.Additive="additive",t.Constant="constant",t.Identity="identity",t.RealWorldSize="real-world-size"}(Sl||(Sl={}));function dJt(t){}function bnt(t){return()=>t}const I2=Ce.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),Mpe=new Ml,H7=Math.PI,IOe=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function $Oe(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(M=>M.type==="color"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void I2.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const n=typeof e=="number",s=n?null:e,o=s==null?void 0:s.attributes;let l=n?e:null;const c=r.field,{ipData:f,hasExpression:_}=r.cache;let x=r.cache.compiledFunc;if(!c&&!_){const M=r.stops;return M&&M[0]&&M[0].color}if(typeof l!="number")if(_){if((i==null?void 0:i.arcade)==null)return void I2.error("Use of arcade expressions requires an arcade context");const M={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},I=i.arcade.arcadeUtils,L=I.getViewInfo(M),F=I.createExecContext(s,L,i.timeZone);if(!x){const z=I.createSyntaxTree(r.valueExpression);x=I.createFunction(z),r.cache.compiledFunc=x}l=I.executeFunction(x,F)}else o&&(l=o[c]);const T=r.normalizationField,A=o!=null&&T!=null?parseFloat(o[T]):void 0;if(l!=null&&(!T||n||!isNaN(A)&&A!==0)){isNaN(A)||n||(l/=A);const M=Wse(l,f);if(M){const I=M[0],L=M[1],F=I===L?r.stops[I].color:qe.blendColors(r.stops[I].color,r.stops[L].color,M[2],i!=null?i.color:void 0);return new qe(F)}}}function LOe(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(M=>M.type==="opacity"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void I2.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const n=typeof e=="number",s=n?null:e,o=s==null?void 0:s.attributes;let l=n?e:null;const c=r.field,{ipData:f,hasExpression:_}=r.cache;let x=r.cache.compiledFunc;if(!c&&!_){const M=r.stops;return M&&M[0]&&M[0].opacity}if(typeof l!="number")if(_){if((i==null?void 0:i.arcade)==null)return void I2.error("Use of arcade expressions requires an arcade context");const M={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},I=i.arcade.arcadeUtils,L=I.getViewInfo(M),F=I.createExecContext(s,L,i.timeZone);if(!x){const z=I.createSyntaxTree(r.valueExpression);x=I.createFunction(z),r.cache.compiledFunc=x}l=I.executeFunction(x,F)}else o&&(l=o[c]);const T=r.normalizationField,A=o!=null&&T!=null?parseFloat(o[T]):void 0;if(l!=null&&(!T||n||!isNaN(A)&&A!==0)){isNaN(A)||n||(l/=A);const M=Wse(l,f);if(M){const I=M[0],L=M[1];if(I===L)return r.stops[I].opacity;{const F=r.stops[I].opacity;return F+(r.stops[L].opacity-F)*M[2]}}}}function DOe(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(A=>A.type==="rotation"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void I2.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const n=r.axis||"heading",s=n==="heading"&&r.rotationType==="arithmetic"?90:0,o=n==="heading"&&r.rotationType==="arithmetic"?-1:1,l=typeof e=="number"?null:e,c=l==null?void 0:l.attributes,f=r.field,{hasExpression:_}=r.cache;let x=r.cache.compiledFunc,T=0;if(!f&&!_)return T;if(_){if((i==null?void 0:i.arcade)==null)return void I2.error("Use of arcade expressions requires an arcade context");const A={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},M=i.arcade.arcadeUtils,I=M.getViewInfo(A),L=M.createExecContext(l,I,i.timeZone);if(!x){const F=M.createSyntaxTree(r.valueExpression);x=M.createFunction(F),r.cache.compiledFunc=x}T=M.executeFunction(x,L)}else c&&(T=c[f]||0);return T=typeof T!="number"||isNaN(T)?null:s+o*T,T}function wnt(t,e,i){const r=typeof e=="number",n=r?null:e,s=n==null?void 0:n.attributes;let o=r?e:null;const{isScaleDriven:l}=t.cache;let c=t.cache.compiledFunc;if(l){const _=i!=null?i.scale:void 0,x=i!=null?i.view:void 0;o=_==null||x==="3d"?xnt(t):_}else if(!r)switch(t.inputValueType){case Xv.Expression:{if((i==null?void 0:i.arcade)==null)return void I2.error("Use of arcade expressions requires an arcade context");const _={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},x=i.arcade.arcadeUtils,T=x.getViewInfo(_),A=x.createExecContext(n,T,i.timeZone);if(!c){const M=x.createSyntaxTree(t.valueExpression);c=x.createFunction(M),t.cache.compiledFunc=c}o=x.executeFunction(c,A);break}case Xv.Field:s&&(o=s[t.field]);break;case Xv.Unknown:o=null}if(!vL(o))return null;if(r||!t.normalizationField)return o;const f=s?parseFloat(s[t.normalizationField]):null;return vL(f)&&f!==0?o/f:null}function xnt(t){let e=null,i=null;const r=t.stops;return r?(e=r[0].value,i=r[r.length-1].value):(e=t.minDataValue||0,i=t.maxDataValue||0),(e+i)/2}function jB(t,e,i){const r="visualVariables"in t&&t.visualVariables?t.visualVariables.find(s=>s.type==="size"):t;if(!r)return;if(r.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void I2.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const n=FOe(wnt(r,e,i),r,e,i,r.cache.ipData);return n==null||isNaN(n)?0:n}function Jh(t,e,i){return t==null?null:EM(t)?jB(t,e,i):vL(t)?t:null}function NOe(t,e,i){return vL(i)&&t>i?i:vL(e)&&t=e.maxDataValue)return o;if(s==null||o==null)return null;if(e.scaleBy==="area"&&l){const c=l==="circle",f=c?H7*(s/2)**2:s*s,_=f+n*((c?H7*(o/2)**2:o*o)-f);return c?2*Math.sqrt(_/H7):Math.sqrt(_)}return s+n*(o-s)}function Cnt(t,e,i,r){const n=r!=null?r.shape:void 0,s=t/e.minDataValue,o=Jh(e.minSize,i,r),l=Jh(e.maxSize,i,r);let c=null;return c=n==="circle"?2*Math.sqrt(s*(o/2)**2):n==="square"||n==="diamond"||n==="image"?Math.sqrt(s*o**2):s*o,NOe(c,o,l)}function Ant(t,e,i,r,n){var c,f,_;const[s,o,l]=Wse(t,n);if(s===o)return Jh((c=e.stops)==null?void 0:c[s].size,i,r);{const x=Jh((f=e.stops)==null?void 0:f[s].size,i,r);return x+(Jh((_=e.stops)==null?void 0:_[o].size,i,r)-x)*l}}function Mnt(t,e,i,r){const n=((r==null?void 0:r.resolution)??1)*KO[e.valueUnit],s=Jh(e.minSize,i,r),o=Jh(e.maxSize,i,r),{valueRepresentation:l}=e;let c=null;return c=l==="area"?2*Math.sqrt(t/H7)/n:l==="radius"||l==="distance"?2*t/n:t/n,NOe(c,s,o)}function FOe(t,e,i,r,n){switch(e.transformationType){case Sl.Additive:return Snt(t,e,i,r);case Sl.Constant:return Tnt(e,i,r);case Sl.ClampedLinear:return Ent(t,e,i,r);case Sl.Proportional:return Cnt(t,e,i,r);case Sl.Stops:return Ant(t,e,i,r,n);case Sl.RealWorldSize:return Mnt(t,e,i,r);case Sl.Identity:return t;case Sl.Unknown:return null}}function Ont(t,e,i){const{isScaleDriven:r}=t.cache;if(!(r&&i==="3d"||e))return null;const n={scale:e,view:i};let s=Jh(t.minSize,Mpe,n),o=Jh(t.maxSize,Mpe,n);if(s!=null||o!=null){if(s>o){const l=o;o=s,s=l}return{minSize:s,maxSize:o}}}function qse(t,e,i){if(!t.visualVariables)return;const r=[],n=[],s=[],o=[],l=[];for(const c of t.visualVariables)switch(c.type){case"color":n.push(c);break;case"opacity":s.push(c);break;case"rotation":l.push(c);break;case"size":o.push(c)}return n.forEach(c=>{const f=$Oe(c,e,i);r.push({variable:c,value:f})}),s.forEach(c=>{const f=LOe(c,e,i);r.push({variable:c,value:f})}),l.forEach(c=>{const f=DOe(c,e,i);r.push({variable:c,value:f})}),o.forEach(c=>{const f=jB(c,e,i);r.push({variable:c,value:f})}),r.filter(c=>c.value!=null)}function Wse(t,e){if(!e)return;let i=0,r=e.length-1;return e.some((n,s)=>t!!e)).sort((e,i)=>e.value-i.value):t&&(Ce.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),t=null),this._set("stops",t)}get transformationType(){return _nt(this,this.inputValueType)}readValueExpression(t,e){return t||e.expression&&"$view.scale"}writeValueExpressionWebScene(t,e,i,r){if(t==="$view.scale"){if(r!=null&&r.messages){const n=this.index,s=typeof n=="string"?n:`visualVariables[${n}]`;r.messages.push(new se("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:s+".valueExpression",context:r}))}}else e[i]=t}readValueUnit(t){return t?TK.read(t):null}clone(){var t,e;return new SK({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:EM(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:EM(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:(t=this.stops)==null?void 0:t.map(i=>i.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:(e=this.legendOptions)==null?void 0:e.clone()})}flipSizes(){if(this.transformationType===Sl.ClampedLinear){const{minSize:t,maxSize:e}=this;return this.minSize=e,this.maxSize=t,this}if(this.transformationType===Sl.Stops){const t=this.stops;if(!t)return this;const e=t.map(r=>r.size).reverse(),i=t.length;for(let r=0;re.value||0)}};y([w({readOnly:!0})],Mn.prototype,"cache",null),y([w({type:Q6.apiValues,json:{type:Q6.jsonValues,origins:{"web-map":{read:!1}},read:Q6.read,write:Q6.write}})],Mn.prototype,"axis",void 0),y([w({type:String,value:null,json:{read:!1}})],Mn.prototype,"expression",null),y([w()],Mn.prototype,"index",null),y([w({type:String,readOnly:!0})],Mn.prototype,"inputValueType",null),y([w({type:POe,json:{write:!0}})],Mn.prototype,"legendOptions",void 0),y([w({type:Number,value:null,json:{write:!0}})],Mn.prototype,"maxDataValue",null),y([w({type:Number,value:null,json:{write:!0}})],Mn.prototype,"maxSize",null),y([Ci("maxSize")],Mn.prototype,"castMaxSize",null),y([$t("maxSize")],Mn.prototype,"readMaxSize",null),y([w({type:Number,value:null,json:{write:!0}})],Mn.prototype,"minDataValue",null),y([w({type:Number,value:null,json:{write:!0}})],Mn.prototype,"minSize",null),y([Ci("minSize")],Mn.prototype,"castMinSize",null),y([$t("minSize")],Mn.prototype,"readMinSize",null),y([w({type:String,json:{write:!0}})],Mn.prototype,"normalizationField",void 0),y([w({readOnly:!0})],Mn.prototype,"arcadeRequired",null),y([w({type:String})],Mn.prototype,"scaleBy",void 0),y([w({type:[vnt],value:null,json:{write:!0}})],Mn.prototype,"stops",null),y([w({type:["outline"],json:{write:!0}})],Mn.prototype,"target",void 0),y([w({type:String,readOnly:!0})],Mn.prototype,"transformationType",null),y([w({type:["size"],json:{type:["sizeInfo"]}})],Mn.prototype,"type",void 0),y([w({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],Mn.prototype,"useSymbolValue",void 0),y([w({type:String,json:{write:!0}})],Mn.prototype,"valueExpression",void 0),y([$t("valueExpression",["valueExpression","expression"])],Mn.prototype,"readValueExpression",null),y([Pt("web-scene","valueExpression")],Mn.prototype,"writeValueExpressionWebScene",null),y([w({type:["radius","diameter","area","width","distance"],json:{write:!0}})],Mn.prototype,"valueRepresentation",void 0),y([w({type:TK.apiValues,json:{write:TK.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],Mn.prototype,"valueUnit",void 0),y([$t("valueUnit")],Mn.prototype,"readValueUnit",null),Mn=SK=y([Z("esri.renderers.visualVariables.SizeVariable")],Mn);const Yse=Mn,Rnt={color:AOe,size:Yse,opacity:MOe,rotation:OOe},Int=new yn({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),$nt=/^\[([^\]]+)\]$/i;let q7=class extends ze{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),e=e&&e.filter(i=>!!i),e==null?void 0:e.length){for(const i of e)switch(i.type){case"color":this.colorVariables.push(i);break;case"opacity":this.opacityVariables.push(i);break;case"rotation":this.rotationVariables.push(i);break;case"size":this.sizeVariables.push(i)}this.sizeVariables.length&&this.sizeVariables.some(i=>!!i.target)&&e.sort((i,r)=>{let n=null;return n=i.target===r.target?0:i.target?1:-1,n});for(let i=0;i{const f=Int.read(c.type),_=Rnt[f];_||(Ce.getLogger(this).warn(`Unknown variable type: ${f}`),r!=null&&r.messages&&r.messages.push(new Uf("visual-variable:unsupported",`visualVariable of type '${f}' is not supported`,{definition:c,context:r})));const x=new _;return x.read(c,r),x})}writeVariables(e,i){const r=[];for(const n of e){const s=n.toJSON(i);s&&r.push(s)}return r}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};y([w()],q7.prototype,"visualVariables",null),q7=y([Z("esri.renderers.visualVariables.VisualVariableFactory")],q7);const Lnt=q7,Dnt={base:z9,key:"type",typeMap:{opacity:MOe,color:AOe,rotation:OOe,size:Yse}},pP=t=>{let e=class extends t{constructor(){super(...arguments),this._vvFactory=new Lnt}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,n){return this._vvFactory.readVariables(i,r,n)}writeVisualVariables(i,r,n,s){r[n]=this._vvFactory.writeVariables(i,s)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const n=this.visualVariables;return n?n.filter(s=>s.type===i&&(typeof r=="string"?s.target===r:r!==!1||!s.target)):[]}async collectVVRequiredFields(i,r){let n=[];this.visualVariables&&(n=n.concat(this.visualVariables));for(const s of n)s&&(s.field&&fp(i,r,s.field),s.normalizationField&&fp(i,r,s.normalizationField),s.valueExpression&&(Nnt(s.valueExpression,i,r)||await eh(i,r,s.valueExpression)))}};return y([w({types:[Dnt],value:null,json:{write:!0}})],e.prototype,"visualVariables",null),y([$t("visualVariables",["visualVariables","rotationType","rotationExpression"])],e.prototype,"readVisualVariables",null),y([Pt("visualVariables")],e.prototype,"writeVisualVariables",null),e=y([Z("esri.renderers.mixins.VisualVariablesMixin")],e),e};function Nnt(t,e,i){const r=fnt(t);return r!=null&&(fp(e,i,r),!0)}function Fnt(t){return kOe(t)||knt(t)}function W7(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type==="feature"}function knt(t){return(t==null?void 0:t.type)==="scene"}function znt(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type==="subtype-group"&&"sublayers"in t}function kOe(t){const e=t==null?void 0:t.type;return e==="imagery-tile"||e==="tile"||e==="open-street-map"||e==="vector-tile"||e==="web-tile"||e==="wmts"}function oO(t){const e=t==null?void 0:t.type;return e==="base-tile"||e==="tile"||e==="elevation"||e==="imagery-tile"||e==="base-elevation"||e==="open-street-map"||e==="wcs"||e==="web-tile"||e==="wmts"||e==="vector-tile"}function QO(t){return t!=null&&"type"in t&&t.type==="group"}const fJt={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function zOe(t){const e=t==null?void 0:t.type;return e==="building-scene"||e==="integrated-mesh"||e==="point-cloud"||e==="scene"}function Rpe(t){return(t==null?void 0:t.type)==="voxel"}function Ipe(t){return(t==null?void 0:t.type)==="imagery-tile"}function Y7(t){return(t==null?void 0:t.parent)!=null&&"declaredClass"in t.parent&&t.parent.declaredClass==="esri.Basemap"&&t.parent.baseLayers.includes(t)}function GB(t){var e;return(t==null?void 0:t.type)==="feature"&&!t.url&&((e=t.source)==null?void 0:e.type)==="memory"}function mJt(t){var e;return((t==null?void 0:t.type)==="feature"||(t==null?void 0:t.type)==="subtype-group")&&((e=t.source)==null?void 0:e.type)==="feature-layer"}function Unt(t){if(t.activeLayer){const e=t.activeLayer.tileMatrixSet;if(e)return e;const i=t.activeLayer.tileMatrixSets;if(i)return i}return null}async function UOe(t,e){const i=yr==null?void 0:yr.findServerInfo(t);if((i==null?void 0:i.currentVersion)!=null)return i.owningSystemUrl||null;const r=t.toLowerCase().indexOf("/rest/services");if(r===-1)return null;const n=`${t.substring(0,r)}/rest/info`,s=e!=null?e.signal:null,{data:o}=await bi(n,{query:{f:"json"},responseType:"json",signal:s});return(o==null?void 0:o.owningSystemUrl)||null}function Vnt(t){if(!("capabilities"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function Bnt(t){return Vnt(t)?"effectiveCapabilities"in t?t.effectiveCapabilities:t.capabilities:null}function jnt(t){if(!("editingEnabled"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":return!0;default:return!1}}function Gnt(t){return!!jnt(t)&&("effectiveEditingEnabled"in t?t.effectiveEditingEnabled:t.editingEnabled)}const _A={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function e5(t,e=_A){var l,c;if(!t)return{symbol:null};const{retainId:i=_A.retainId,ignoreDrivers:r=_A.ignoreDrivers,hasLabelingContext:n=_A.hasLabelingContext,retainCIM:s=_A.retainCIM}=e;let o=null;if(Hy(t)||t instanceof gE)o=t.clone();else if(t.type==="cim"){const f=(c=(l=t.data)==null?void 0:l.symbol)==null?void 0:c.type;if(f!=="CIMPointSymbol")return{error:new se("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${f||"unknown"}' is unsupported in 3D`,{symbol:t})};o=s?t.clone():t2.fromCIMSymbol(t)}else if(t instanceof Oc)o=UB.fromSimpleLineSymbol(t);else if(t instanceof cu)o=t2.fromSimpleMarkerSymbol(t);else if(t instanceof dP)o=t2.fromPictureMarkerSymbol(t);else if(t instanceof Bm)o=e.geometryType&&e.geometryType==="mesh"?F9.fromSimpleFillSymbol(t):k9.fromSimpleFillSymbol(t);else{if(!(t instanceof mE))return{error:new se("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${t.type||t.declaredClass}' is unsupported in 3D`,{symbol:t})};o=n?zB.fromTextSymbol(t):t2.fromTextSymbol(t)}return i&&o&&o.type!=="cim"&&(o.id=t.id),r&&Hy(o)&&o.symbolLayers.forEach(f=>f.ignoreDrivers=!0),{symbol:o}}function qz(t,e,i,r){const n=VOe(t,{},{context:r,isLabelSymbol:!1});n!=null&&(e[i]=n)}function $pe(t,e,i,r){const n=VOe(t,{},{context:r,isLabelSymbol:!0});n!=null&&(e[i]=n)}function Lpe(t){return t instanceof hP||t instanceof gE}function VOe(t,e,i){if(t==null)return null;const{context:r,isLabelSymbol:n}=i,s=r==null?void 0:r.origin,o=r==null?void 0:r.messages;if(s==="web-scene"&&!Lpe(t)){const l=e5(t,{retainCIM:!0,hasLabelingContext:n});return l.symbol!=null?l.symbol.write(e,r):(o==null||o.push(new se("symbol:unsupported",`Symbols of type '${t.declaredClass}' are not supported in scenes. Use 3D symbology instead when working with WebScene and SceneView`,{symbol:t,context:r,error:l.error})),null)}return(s==="web-map"||s==="portal-item"&&!zOe(r==null?void 0:r.layer))&&Lpe(t)?(o==null||o.push(new se("symbol:unsupported",`Symbols of type '${t.declaredClass}' are not supported in web maps and portal items. Use 2D symbology and CIMSymbol instead when working with MapView`,{symbol:t,context:r})),null):t.write(e,r)}function BOe(t,e){return ent(t,null,e)}const HB={types:wOe,json:{write:{writer:qz},origins:{"web-scene":{types:_pe,write:{writer:qz},read:{reader:Z5({types:_pe})}}}}},Xse=Yre({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},HB),jOe={types:{base:fd,key:"type",typeMap:{"simple-fill":py.typeMap["simple-fill"],"picture-fill":py.typeMap["picture-fill"],"polygon-3d":py.typeMap["polygon-3d"]}},json:{write:{writer:qz},origins:{"web-scene":{type:k9,write:{writer:qz}}}}},X7={cast:t=>t==null||typeof t=="string"||typeof t=="number"?t:`${t}`,json:{type:String,write:{writer:(t,e)=>{e.value=t==null?void 0:t.toString()}}}};var EK;let Zb=EK=class extends Ue{constructor(t){super(t),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new EK({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const t=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${t}`}};y([w({type:String,json:{write:!0}})],Zb.prototype,"description",void 0),y([w({type:String,json:{write:!0}})],Zb.prototype,"label",void 0),y([w({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],Zb.prototype,"minValue",void 0),y([w({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],Zb.prototype,"maxValue",void 0),y([w(Xse)],Zb.prototype,"symbol",void 0),Zb=EK=y([Z("esri.renderers.support.ClassBreakInfo")],Zb);const Wz=Zb;var CK;const GOe="log",Z7="percent-of-total",J7="field",eD=new yn({esriNormalizeByLog:GOe,esriNormalizeByPercentOfTotal:Z7,esriNormalizeByField:J7}),Hnt=$s(Wz);let Da=CK=class extends pP(L_){constructor(t){super(t),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(t,e,i){if(!Array.isArray(t))return;let r=e.minValue;return t.map(n=>{const s=new Wz;return s.read(n,i),s.minValue==null&&(s.minValue=r),s.maxValue==null&&(s.maxValue=s.minValue),r=s.maxValue,s})}writeClassBreakInfos(t,e,i,r){const n=t.map(s=>s.write({},r));this._areClassBreaksConsecutive()&&n.forEach(s=>delete s.classMinValue),e[i]=n}castField(t){return t==null?t:typeof t=="function"?(Ce.getLogger(this).error(".field: field must be a string value"),null):y9(t)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let t=this._get("normalizationType");const e=!!this.normalizationField,i=this.normalizationTotal!=null;return e||i?(t=e&&J7||i&&Z7||null,e&&i&&Ce.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):t!==J7&&t!==Z7||(t=null),t}set normalizationType(t){this._set("normalizationType",t)}addClassBreakInfo(t,e,i){let r=null;r=typeof t=="number"?new Wz({minValue:t,maxValue:e,symbol:xOe(i)}):Hnt(Re(t)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(t,e){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(t,e){let i=e;if(this.valueExpression&&(e==null?void 0:e.arcade)==null){const n=await p_(),{arcadeUtils:s}=n;s.hasGeometryOperations(this.valueExpression)&&await s.enableGeometryOperations(),i={...i,arcade:n}}const r=this.getBreakIndex(t,i);return r>-1?this.classBreakInfos[r].symbol:this.defaultSymbol}getSymbols(){const t=[];return this.classBreakInfos.forEach(e=>{e.symbol&&t.push(e.symbol)}),this.defaultSymbol&&t.push(this.defaultSymbol),t}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){const t=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${t}.${e}.${this.classBreakInfos.reduce((r,n)=>r+n.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){var t,e;return new CK({field:this.field,backgroundFillSymbol:(t=this.backgroundFillSymbol)==null?void 0:t.clone(),defaultLabel:this.defaultLabel,defaultSymbol:(e=this.defaultSymbol)==null?void 0:e.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:Re(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:Re(this.visualVariables),legendOptions:Re(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(t,e){const i=[this.collectVVRequiredFields(t,e),this.collectSymbolFields(t,e)];await Promise.all(i)}async collectSymbolFields(t,e){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(t,e)),eh(t,e,this.valueExpression)];fp(t,e,this.field),fp(t,e,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(t,e){const{viewingMode:i,scale:r,spatialReference:n,arcade:s,timeZone:o}=e??{},{valueExpression:l}=this;let c=this._compiledValueExpression.valueExpression===l?this._compiledValueExpression.compiledFunction:null;const f=s.arcadeUtils;if(!c){const x=f.createSyntaxTree(l);c=f.createFunction(x),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=l;const _=f.executeFunction(c,f.createExecContext(t,f.getViewInfo({viewingMode:i,scale:r,spatialReference:n}),o));return this._getBreakIndexfromInfos(_)}_getBreakIndexForField(t){const e=this.field,i=t.attributes,r=this.normalizationType;let n=parseFloat(i[e]);if(r){const s=this.normalizationTotal,o=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===GOe)n=Math.log(n)*Math.LOG10E;else if(r!==Z7||s==null||isNaN(s)){if(r===J7&&!isNaN(o)){if(isNaN(n)||isNaN(o))return-1;n/=o}}else n=n/s*100}return this._getBreakIndexfromInfos(n)}_getBreakIndexfromInfos(t){const e=this.isMaxInclusive;if(t!=null&&typeof t=="number"&&!isNaN(t))for(let i=0;iVh(t),json:{write:!0}})],Da.prototype,"normalizationTotal",void 0),y([w({type:eD.apiValues,value:null,json:{type:eD.jsonValues,read:eD.read,write:eD.write}})],Da.prototype,"normalizationType",null),y([Vt({classBreaks:"class-breaks"})],Da.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],Da.prototype,"valueExpression",void 0),y([w({type:String,json:{write:!0}})],Da.prototype,"valueExpressionTitle",void 0),Da=CK=y([Z("esri.renderers.ClassBreaksRenderer")],Da);const HOe=Da,t$=-3;var nm;(function(t){t[t.ALL=0]="ALL",t[t.SOME=1]="SOME"})(nm||(nm={}));let qnt=class{constructor(e,i,r){this.name=e,this._storage=i,this.id=Wnt+++":",this.size=0,this.maxSize=0,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),r&&(this._storage.registerRemoveFunc(this.id,r),this._removeFunc=!0)}destroy(){this._storage.clear(this),this._removeFunc&&this._storage.deregisterRemoveFunc(this.id),this._storage.deregister(this),this._storage=null}get hitRate(){return this._hit/(this._hit+this._miss)}get sizeAll(){return this._storage.size}resetHitRate(){this._hit=this._miss=0}put(e,i,r,n=0){this._storage.put(this,e,i,r,n)}get(e){const i=this._storage.get(this,e);return i===void 0?++this._miss:++this._hit,i}peek(e){return this._storage.peek(this,e)}pop(e){const i=this._storage.pop(this,e);return i===void 0?++this._miss:++this._hit,i}updateSize(e,i,r){this._storage.updateSize(this,e,i,r)}clear(){this._storage.clear(this)}clearAll(){this._storage.clearAll()}get performanceInfo(){return this._storage.performanceInfo}resetStats(){this._storage.resetStats()}},qOe=class{get size(){return this._size}constructor(e=10485760){this._maxSize=e,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new Pi,this._users=new Pi}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(e){this._users.push(e)}deregister(e){this._users.removeUnordered(e)}registerRemoveFunc(e,i){this._removeFuncs.push([e,i])}deregisterRemoveFunc(e){this._removeFuncs.filterInPlace(i=>i[0]!==e)}get maxSize(){return this._maxSize}set maxSize(e){this._maxSize=Math.max(e,0),this._checkSizeLimits()}put(e,i,r,n,s){i=e.id+i;const o=this._db.get(i);if(o&&(this._size-=o.size,e.size-=o.size,this._db.delete(i),o.entry!==r&&this._notifyRemove(i,o.entry,nm.ALL)),n>this._maxSize)return void this._notifyRemove(i,r,nm.ALL);if(r===void 0)return void console.warn("Refusing to cache undefined entry ");if(!n||n<0)return console.warn(`Refusing to cache entry with size ${n} for key ${i}`),void this._notifyRemove(i,r,nm.ALL);const l=1+Math.max(s,t$)-t$;this._db.set(i,{entry:r,size:n,lifetime:l,lives:l}),this._size+=n,e.size+=n,this._checkSizeLimits()}updateSize(e,i,r,n){i=e.id+i;const s=this._db.get(i);if(s&&s.entry===r){for(this._size-=s.size,e.size-=s.size;n>this._maxSize;){const o=this._notifyRemove(i,r,nm.SOME);if(!(o!=null&&o>0))return void this._db.delete(i);n=o}s.size=n,this._size+=n,e.size+=n,this._checkSizeLimits()}}pop(e,i){i=e.id+i;const r=this._db.get(i);if(r)return this._size-=r.size,e.size-=r.size,this._db.delete(i),++this._hit,r.entry;++this._miss}get(e,i){i=e.id+i;const r=this._db.get(i);if(r!==void 0)return this._db.delete(i),r.lives=r.lifetime,this._db.set(i,r),++this._hit,r.entry;++this._miss}peek(e,i){const r=this._db.get(e.id+i);return r?++this._hit:++this._miss,r==null?void 0:r.entry}get performanceInfo(){const e={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},i={},r=new Array;this._db.forEach((o,l)=>{const c=o.lifetime;r[c]=(r[c]||0)+o.size,this._users.forAll(f=>{const{id:_,name:x}=f;if(l.startsWith(_)){const T=i[x]||0;i[x]=T+o.size}})});const n={};this._users.forAll(o=>{const l=o.name;if("hitRate"in o&&typeof o.hitRate=="number"&&!isNaN(o.hitRate)&&o.hitRate>0){const c=i[l]||0;i[l]=c,n[l]=Math.round(100*o.hitRate)+"%"}else n[l]="0%"});const s=Object.keys(i);s.sort((o,l)=>i[l]-i[o]),s.forEach(o=>e[o]=Math.round(i[o]/2**20)+"MB / "+n[o]);for(let o=r.length-1;o>=0;--o){const l=r[o];l&&(e["Priority "+(o+t$-1)]=Math.round(l/this._size*100)+"%")}return e}resetStats(){this._hit=this._miss=0,this._users.forAll(e=>e.resetHitRate())}clear(e){const i=e.id;this._db.forEach((r,n)=>{n.startsWith(i)&&(this._size-=r.size,this._db.delete(n),this._notifyRemove(n,r.entry,nm.ALL))}),e.size=0}clearAll(){this._db.forEach((e,i)=>this._notifyRemove(i,e.entry,nm.ALL)),this._users.forEach(e=>e.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(e,i,r){let n;return this._removeFuncs.some(s=>{if(e.startsWith(s[0])){const o=s[1](i,r);return typeof o=="number"&&(n=o),!0}return!1}),n}_checkSizeLimits(){if(this._size>this._maxSize){for(const[e,i]of this._db)if(this._purgeItem(e,i),this._size<=.9*this.maxSize)return}this._users.forEach(e=>{if(e.maxSize>0&&e.size>e.maxSize){for(const[i,r]of this._db)if(i.startsWith(e.id)&&(this._purgeItem(i,r,e),e.size<=.9*e.maxSize))return}})}_purgeItem(e,i,r=this._users.find(n=>e.startsWith(n.id))){if(this._db.delete(e),i.lives<=1){this._size-=i.size,r&&(r.size-=i.size);const n=this._notifyRemove(e,i.entry,nm.SOME);n!=null&&n>0&&(this._size+=n,r&&(r.size+=n),i.lives=i.lifetime,i.size=n,this._db.set(e,i))}else--i.lives,this._db.set(e,i)}},Wnt=0,qB=class{constructor(e,i){this._storage=new qOe,this.id="",this.name="",this.size=0,this._storage.maxSize=e,this._storage.register(this),i&&this._storage.registerRemoveFunc("",i)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(e,i,r=1){this._storage.put(this,e,i,r,1)}pop(e){return this._storage.pop(this,e)}get(e){return this._storage.get(this,e)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(e){this._storage.maxSize=e}resetHitRate(){}},$2=class{constructor(e,i,r=""){this.major=e,this.minor=i,this._context=r}lessThan(e,i){return this.majorwp.create(i)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return CMe(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){var i;return((i=this.get(e))==null?void 0:i.name)??void 0}toJSON(){return{fields:this.fields.map(e=>sz(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function ES(t){return t.trim().toLowerCase()}function Dpe(t){var e;return((e=ait(t))==null?void 0:e.toLowerCase())??""}const WOe=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function Npe(t){const e=new Map;if(!t.fields)return e;const i=t.datesInUnknownTimezone===!0,{timeInfo:r,editFieldsInfo:n}=t,s=(r?"startField"in r?r.startField:r.startTimeField:"")??"",o=(r?"endField"in r?r.endField:r.endTimeField:"")??"",l=Jnt(t)?t.dateFieldsTimeZone??null:t.dateFieldsTimeReference?y7(t.dateFieldsTimeReference):null,c=n?Xnt(n)?n.timeZone??l:n.dateFieldsTimeReference?y7(n.dateFieldsTimeReference):l??Vy:null,f=r?Znt(r)?r.timeZone??l:r.timeReference?y7(r.timeReference):l:null,_=new Map([[ES((n==null?void 0:n.creationDateField)??""),c],[ES((n==null?void 0:n.editDateField)??""),c],[ES(s),f],[ES(o),f]]);for(const{name:x,type:T}of t.fields)if(WOe.has(T))e.set(x,OT);else if(T!=="date"&&T!=="esriFieldTypeDate")e.set(x,null);else if(i)e.set(x,OT);else{const A=_.get(ES(x??""))??l;e.set(x,A)}return e}const Fpe="esri.renderers.support.DictionaryLoader",Qnt={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let Jse=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new qB(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(M){if(sn(M))return this._dictionaryPromise=null,null}const n=this._dictionaryVersion&&this._dictionaryVersion.since(4,0),s={};if(this.fieldMap)for(const M of this._symbolFields){const I=this._getFieldName(this.fieldMap[M]);if(I){const L=e.attributes[I];s[M]=n?L:L!=null?""+e.attributes[I]:""}else s[M]=""}let o=null;try{o=r==null?void 0:r(s,i)}catch{return null}if(!o||typeof o!="string")return null;const l=Zre(o).toString(),c=this._symbolCache.get(l);if(c)return c.catch(()=>{this._symbolCache.pop(l)}),c;const f=o.split(";"),_=[],x=[];for(const M of f)if(M)if(M.includes("po:")){const I=M.substr(3).split("|");if(I.length===3){const L=I[0],F=I[1];let z=I[2];if(F==="DashTemplate")z=z.split(" ").map(k=>Number(k));else if(F==="Color"){const k=new qe(z).toRgba();z=[k[0],k[1],k[2],255*k[3]]}else z=Number(z);x.push({primitiveName:L,propertyName:F,value:z})}}else if(M.includes("|")){for(const I of M.split("|"))if(this._itemNames.has(I)){_.push(I);break}}else this._itemNames.has(M)&&_.push(M);const T=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point",A=this._cimPartsToCIMSymbol(_,x,T,i);return this._symbolCache.put(l,A,1),A}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void Ce.getLogger(Fpe).error("no valid URL!");const i=bi(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,p_()]);if(!r)throw this._dictionaryPromise=null,new se("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:n,dictionary_version:s,expression:o,itemsNames:l}=r,c=o;let f=!1;s&&(this._dictionaryVersion=$2.parse(s),f=this._dictionaryVersion.since(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(l),this._symbolFields=n.symbol;const _={};if(this.config){const A=this.config;for(const M in A)_[M]=A[M]}if(n.configuration)for(const A of n.configuration)_.hasOwnProperty(A.name)||(_[A.name]=A.value);const x=[];if(e!=null&&e.fields&&this.fieldMap)for(const A of this._symbolFields){const M=this.fieldMap[A],I=e.fields.filter(L=>L.name.toLowerCase()===(M==null?void 0:M.toLowerCase()));I.length>0&&x.push({...I[0],type:f?I[0].type:"esriFieldTypeString"})}x.length>0&&(this._fieldIndex=new Zse(x));const T=nit(c,e!=null?e.spatialReference:null,x,_).then(A=>{const M={scale:0};return(I,L)=>{if(A==null)return null;const F=A.repurposeFeature({geometry:null,attributes:I});return M.scale=L!=null?L.scale??void 0:void 0,A.evaluate({$feature:F,$view:M},A.services)}}).catch(A=>(Ce.getLogger(Fpe).error("Creating dictinoary expression failed:",A),null));return this._dictionaryPromise=T,T}async _cimPartsToCIMSymbol(e,i,r,n){const s=new Array(e.length);for(let c=0;cs.data);const r=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),n=bi(r,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,n);try{return(await n).data}catch(s){throw this._ongoingRequests.delete(e),s}}_combineSymbolParts(e,i,r){if(!e||e.length===0)return null;const n={...e[0]};if(e.length>1){n.symbolLayers=[];for(const s of e){const o=s;n.symbolLayers.unshift(...o.symbolLayers)}}return r&&(n.callout=Qnt),{type:"CIMSymbolReference",symbol:n,primitiveOverrides:i}}_getFieldName(e){if(this._fieldIndex!==null){const i=this._fieldIndex.get(e);return i?i.name:e}return e}};function YOe(t,e){if(!t)return;const i=t.symbolLayers;if(!i)return;let r=i.length;for(;r--;){const n=i[r];n&&n.enable!==!1&&n.type==="CIMVectorMarker"&&est(n,e)}}function est(t,e){const i=t.markerGraphics;if(i)for(const r of i){if(!r)continue;const n=r.symbol;if(n)switch(n.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":YOe(n,e);break;case"CIMTextSymbol":n.fieldMap=e}}}const SJt=Object.freeze(Object.defineProperty({__proto__:null,DictionaryLoader:Jse},Symbol.toStringTag,{value:"Module"}));var AK;let R0=AK=class extends pP(L_){constructor(t){super(t),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new Jse(this.url,this.config,this.fieldMap)}writeData(t,e){t&&(e.scalingExpressionInfo={expression:t,returnType:"number"})}writeVisualVariables(t,e,i,r){r!=null&&r.origin||super.writeVisualVariables(t,e,i,r)}clone(){return new AK({config:Re(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:Re(this.fieldMap),url:Re(this.url),visualVariables:Re(this.visualVariables)})}async getSymbolAsync(t,e){return this._loader.getSymbolAsync(t,e)}async collectRequiredFields(t,e){await this.collectVVRequiredFields(t,e),this.scaleExpression&&await eh(t,e,this.scaleExpression);for(const i in this.fieldMap){const r=this.fieldMap[i];e.has(r)&&t.add(r)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};y([w({type:Jse})],R0.prototype,"_loader",null),y([w({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],R0.prototype,"config",void 0),y([w({type:Object,json:{write:!0}})],R0.prototype,"fieldMap",void 0),y([w({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],R0.prototype,"scaleExpression",void 0),y([Pt("scaleExpression")],R0.prototype,"writeData",null),y([w({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(t){return{enabled:!!t&&!!this.scaleExpression}}}}})],R0.prototype,"scaleExpressionTitle",void 0),y([w({type:String,json:{write:!0}})],R0.prototype,"url",void 0),y([Pt("visualVariables")],R0.prototype,"writeVisualVariables",null),R0=AK=y([Z("esri.renderers.DictionaryRenderer")],R0);const tst=R0;var MK;let Y1=MK=class extends Ue{constructor(t){super(t),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(t){return t==null?t:typeof t=="function"?(Ce.getLogger(this).error(".field: field must be a string value"),null):y9(t)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){var t;return new MK({color:(t=this.color)==null?void 0:t.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};y([w({type:qe,json:{type:[Number],write:!0}})],Y1.prototype,"color",void 0),y([w({type:String,json:{write:!0}})],Y1.prototype,"field",void 0),y([Ci("field")],Y1.prototype,"castField",null),y([w({type:String,json:{write:!0}})],Y1.prototype,"label",void 0),y([w({type:String,json:{write:!0}})],Y1.prototype,"valueExpression",void 0),y([w({type:String,json:{write:!0}})],Y1.prototype,"valueExpressionTitle",void 0),Y1=MK=y([Z("esri.renderers.support.AttributeColorInfo")],Y1);const XOe=Y1;var OK;let Q7=OK=class extends Ue{constructor(){super(...arguments),this.unit=null}clone(){return new OK({unit:this.unit})}};y([w({type:String,json:{write:!0}})],Q7.prototype,"unit",void 0),Q7=OK=y([Z("esri.renderers.support.DotDensityLegendOptions")],Q7);const ist=Q7;var PK;let Sh=PK=class extends pP(L_){constructor(t){super(t),this.attributes=null,this.backgroundColor=new qe([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new Oc,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(t){if(this.referenceScale==null)return this.dotValue;const e=t/this.referenceScale*this.dotValue;return e<1?1:e}getSymbol(){return new Bm({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){var t;return((t=this.attributes)==null?void 0:t.reduce((e,i)=>e+i.getAttributeHash(),""))??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new PK({attributes:Re(this.attributes),backgroundColor:Re(this.backgroundColor),dotBlendingEnabled:Re(this.dotBlendingEnabled),dotShape:Re(this.dotShape),dotSize:Re(this.dotSize),dotValue:Re(this.dotValue),legendOptions:Re(this.legendOptions),outline:Re(this.outline),referenceScale:Re(this.referenceScale),visualVariables:Re(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){var e;return`${(e=this.attributes)==null?void 0:e.map(i=>i.field||i.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(t,e){await this.collectVVRequiredFields(t,e);for(const i of this.attributes??[])i.valueExpression&&await eh(t,e,i.valueExpression),i.field&&t.add(i.field)}};y([w({type:[XOe],json:{write:!0}})],Sh.prototype,"attributes",void 0),y([w({type:qe,json:{write:!0}})],Sh.prototype,"backgroundColor",void 0),y([w({type:Boolean,json:{write:!0}})],Sh.prototype,"dotBlendingEnabled",void 0),y([w({type:String,json:{write:!1}})],Sh.prototype,"dotShape",void 0),y([w({type:Number,json:{write:!0}})],Sh.prototype,"dotSize",void 0),y([w({type:ist,json:{write:!0}})],Sh.prototype,"legendOptions",void 0),y([w({type:Oc,json:{default:null,write:!0}})],Sh.prototype,"outline",void 0),y([w({type:Number,json:{write:!0}})],Sh.prototype,"dotValue",void 0),y([w({type:Number,json:{write:!0}})],Sh.prototype,"referenceScale",void 0),y([w({type:Number,json:{write:!0}})],Sh.prototype,"seed",void 0),y([Vt({dotDensity:"dot-density"})],Sh.prototype,"type",void 0),Sh=PK=y([Z("esri.renderers.DotDensityRenderer")],Sh);const rst=Sh;var RK;let T4=RK=class extends Ue{constructor(t){super(t),this.color=null,this.ratio=null}clone(){return new RK({color:this.color,ratio:this.ratio})}};y([w({type:qe,json:{type:[$n],default:null,write:!0}})],T4.prototype,"color",void 0),y([w({type:Number,json:{write:!0}})],T4.prototype,"ratio",void 0),T4=RK=y([Z("esri.renderers.support.HeatmapColorStop")],T4);const i$=T4;let bA=class extends Xs(Ue){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};y([w({type:String,json:{write:!0}})],bA.prototype,"minLabel",void 0),y([w({type:String,json:{write:!0}})],bA.prototype,"maxLabel",void 0),y([w({type:String,json:{write:!0}})],bA.prototype,"title",void 0),bA=y([Z("esri.renderers.support.HeatmapLegendOptions")],bA);function Xi(){return[0,0,0,0]}function U9(t){return[t[0],t[1],t[2],t[3]]}function Mi(t,e,i,r){return[t,e,i,r]}function YB(t,e=Xi()){const i=Math.min(4,t.length);for(let r=0;rl>=0&&l<=1).sort((l,c)=>l.ratio-c.ratio).map(({color:l,ratio:c})=>({color:l,ratio:Math.max(c,.001)})),t.length<1)return i;let r=t[0],n=t[0],s=1;const o=Xi();for(let l=0;l<512;l++){const c=(l+.5)/512;for(;c>n.ratio&&s=i+F||L.y<-F||L.y>r+F)continue;const z=+x(M),k=Math.max(0,Math.round(L.x)-l),U=Math.max(0,Math.round(L.y)-l),j=Math.min(r,Math.round(L.y)+l),H=Math.min(i,Math.round(L.x)+l);for(let Y=U;Y_&&(_=f)}}}return{matrix:c.buffer,max:_}}function hst(t,e,i){const r=Math.sqrt(t**2+e**2)/i;return r>1?0:3/(Math.PI*i**2)*(1-r**2)**2}function AJt(t,e){return typeof t=="function"?t:t?typeof e=="string"?i=>-1*+i[t]:i=>+i[t]+e:()=>1}function dst(t,e){return t!=null?typeof e=="string"?i=>-1*+i.readAttribute(t):i=>+i.readAttribute(t)+e:i=>1}var IK;const r5e="esri.renderers.HeatmapRenderer",pst=Ce.getLogger(r5e);function kpe(t){if(t!=null){const{maxDensity:e,minDensity:i,radius:r}=t;if(e!=null||i!=null||r!=null){const{blurRadius:n,maxPixelIntensity:s,minPixelIntensity:o,...l}=t;return l}}return t}let pl=IK=class extends L_{constructor(t){super(t),this.authoringInfo=null,this.colorStops=[new i$({ratio:0,color:new qe("rgba(255, 140, 0, 0)")}),new i$({ratio:.75,color:new qe("rgba(255, 140, 0, 1)")}),new i$({ratio:.9,color:new qe("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(t){return kpe(t)}get blurRadius(){return cst(this.radius)}set blurRadius(t){const e=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",lst(t)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",e*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(t){this._set("maxDensity",t*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(t){this._set("minDensity",t*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(Kse**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(t,e){this._warnedProps[t]||Zl(this).getDefaultOrigin()==="user"&&(this._warnedProps[t]=!0,tx(()=>{pm(pst,t,{replacement:`${String(e)} (suggested value: ${this._get(e)})`,version:"4.24"})}))}read(t,e){t=kpe(t),super.read(t,e)}getSymbol(){return new cu}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(t,e){const i=this.field,r=this.valueExpression;i&&typeof i=="string"&&fp(t,e,i),r&&typeof r=="string"&&await eh(t,e,r)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new IK({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:Re(this.colorStops),field:this.field,legendOptions:Re(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};y([w({type:EOe,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],pl.prototype,"authoringInfo",void 0),y([w({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],pl.prototype,"blurRadius",null),y([w({type:[i$],json:{write:!0}})],pl.prototype,"colorStops",void 0),y([w({type:String,json:{write:!0}})],pl.prototype,"field",void 0),y([w({type:Number,json:{write:{overridePolicy:(t,e,i)=>({enabled:i==null})},origins:{"web-scene":{write:!1}}}})],pl.prototype,"fieldOffset",void 0),y([w({type:bA,json:{write:!0}})],pl.prototype,"legendOptions",void 0),y([w({type:Number,json:{write:!0}})],pl.prototype,"maxDensity",void 0),y([w({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],pl.prototype,"maxPixelIntensity",null),y([w({type:Number,json:{write:!0}})],pl.prototype,"minDensity",void 0),y([w({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],pl.prototype,"minPixelIntensity",null),y([w({type:Number,cast:vs,json:{write:!0}})],pl.prototype,"radius",void 0),y([w({type:Number,range:{min:0},json:{default:0,write:!0}})],pl.prototype,"referenceScale",void 0),y([Vt({heatmap:"heatmap"})],pl.prototype,"type",void 0),y([w({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],pl.prototype,"valueExpression",void 0),y([w({type:String})],pl.prototype,"valueExpressionTitle",void 0),y([w({readOnly:!0})],pl.prototype,"_pixelIntensityToDensity",null),pl=IK=y([Z(r5e)],pl);const n5e=pl;let CS=class extends Xs(Ue){constructor(){super(...arguments),this.color=new qe([0,0,0,0]),this.label=null,this.threshold=0}};y([w({type:qe,json:{write:!0}})],CS.prototype,"color",void 0),y([w({type:String,json:{write:!0}})],CS.prototype,"label",void 0),y([w({type:Number,range:{min:0,max:1},json:{write:!0}})],CS.prototype,"threshold",void 0),CS=y([Z("esri.renderers.support.OthersCategory")],CS);let eF=class extends Xs(Ue){constructor(){super(...arguments),this.title=null}};y([w({type:String,json:{write:!0}})],eF.prototype,"title",void 0),eF=y([Z("esri.renderers.support.PieChartLegendOptions")],eF);let Od=class extends pP(Xs(L_)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new qe([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new CS,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){var e;return new cu({size:this.size?this.size/2+(((e=this.outline)==null?void 0:e.width)||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ys)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,i)=>e+i.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await eh(e,i,r.valueExpression),r.field&&e.add(r.field)}};y([w({type:[XOe],json:{write:!0}})],Od.prototype,"attributes",void 0),y([w({type:Bm,json:{default:null,write:!0}})],Od.prototype,"backgroundFillSymbol",void 0),y([w({type:qe,json:{write:!0}})],Od.prototype,"defaultColor",void 0),y([w({type:String,json:{write:!0}})],Od.prototype,"defaultLabel",void 0),y([w({type:Number,range:{min:0,max:1},json:{write:!0}})],Od.prototype,"holePercentage",void 0),y([w({type:CS,json:{write:!0}})],Od.prototype,"othersCategory",void 0),y([w({type:eF,json:{write:!0}})],Od.prototype,"legendOptions",void 0),y([w({type:Oc,json:{default:null,write:!0}})],Od.prototype,"outline",void 0),y([w({type:Number,cast:vs,json:{write:!0}})],Od.prototype,"size",void 0),y([Vt({pieChart:"pie-chart"})],Od.prototype,"type",void 0),Od=y([Z("esri.renderers.PieChartRenderer")],Od);const fst=Od;var $K;let P3=$K=class extends pP(L_){constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(t,e){await Promise.all([this.collectSymbolFields(t,e),this.collectVVRequiredFields(t,e)])}async collectSymbolFields(t,e){await Promise.all(this.getSymbols().map(i=>i.collectRequiredFields(t,e)))}getSymbol(t,e){return this.symbol}async getSymbolAsync(t,e){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((t,e)=>t+e.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((t,e)=>t+JSON.stringify(e),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new $K({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:Re(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};y([w({type:String,json:{write:!0}})],P3.prototype,"description",void 0),y([w({type:String,json:{write:!0}})],P3.prototype,"label",void 0),y([w(Xse)],P3.prototype,"symbol",void 0),y([Vt({simple:"simple"})],P3.prototype,"type",void 0),P3=$K=y([Z("esri.renderers.SimpleRenderer")],P3);const Qse=P3,mst=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function LK(t){return t instanceof ze}function zpe(t){return t instanceof it?Object.keys(t.items):LK(t)?Zl(t).keys():t?Object.keys(t):[]}function tD(t,e){return t instanceof it?t.items[e]:t[e]}function gst(t,e){return!(!Array.isArray(t)||!Array.isArray(e))&&t.length!==e.length}function r$(t){return t?t.declaredClass:null}function s5e(t,e){var x;const i=t.diff;if(i&&typeof i=="function")return i(t,e);const r=zpe(t),n=zpe(e);if(r.length===0&&n.length===0)return;if(!r.length||!n.length||gst(t,e))return{type:"complete",oldValue:t,newValue:e};const s=n.filter(T=>!r.includes(T)),o=r.filter(T=>!n.includes(T)),l=r.filter(T=>n.includes(T)&&tD(t,T)!==tD(e,T)).concat(s,o).sort(),c=r$(t);if(c&&mst.has(c)&&l.length)return{type:"complete",oldValue:t,newValue:e};let f;const _=LK(t)&&LK(e);for(const T of l){const A=tD(t,T),M=tD(e,T);let I;if((_||typeof A!="function"&&typeof M!="function")&&A!==M&&(A!=null||M!=null)){if(i&&i[T]&&typeof i[T]=="function")I=(x=i[T])==null?void 0:x.call(i,A,M);else if(A instanceof Date&&M instanceof Date){if(A.getTime()===M.getTime())continue;I={type:"complete",oldValue:A,newValue:M}}else I=typeof A=="object"&&typeof M=="object"&&r$(A)===r$(M)?s5e(A,M):{type:"complete",oldValue:A,newValue:M};I!=null&&(f!=null?f.diff[T]=I:f={type:"partial",diff:{[T]:I}})}}return f}function yst(t,e){if(t==null)return!1;const i=e.split(".");let r=t;for(const n of i){if(r.type==="complete")return!0;if(r.type!=="partial")return!1;{const s=r.diff[n];if(!s)return!1;r=s}}return!0}function RJt(t,e){for(const i of e)if(yst(t,i))return!0;return!1}function vst(t,e){if(typeof t!="function"&&typeof e!="function"&&(t!=null||e!=null))return t==null||e==null||typeof t=="object"&&typeof e=="object"&&r$(t)!==r$(e)?{type:"complete",oldValue:t,newValue:e}:s5e(t,e)}function iD(t){if(t==null)return!0;switch(t.type){case"complete":return!1;case"collection":{const e=t;for(const i of e.added)if(!iD(i))return!1;for(const i of e.removed)if(!iD(i))return!1;for(const i of e.changed)if(!iD(i))return!1;return!0}case"partial":for(const e in t.diff)if(!iD(t.diff[e]))return!1;return!0}}let wA=class extends Xs(Ue){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};y([w(X7)],wA.prototype,"value",void 0),y([w(X7)],wA.prototype,"value2",void 0),y([w(X7)],wA.prototype,"value3",void 0),wA=y([Z("esri.renderers.support.UniqueValue")],wA);const aO=wA;let Jb=class extends Xs(Ue){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const i=typeof(e=Array.isArray(e)?e:[e])[0];return i==="string"||i==="number"?e.map(r=>new aO({value:r})):i==="object"?e[0]instanceof aO?e:e.map(r=>new aO(r)):null}};y([w({type:String,json:{write:!0}})],Jb.prototype,"description",void 0),y([w({type:String,json:{write:!0}})],Jb.prototype,"label",void 0),y([w(HB)],Jb.prototype,"symbol",void 0),y([w({type:[aO],json:{type:[[String]],read:{reader:t=>t?t.map(e=>new aO({value:e[0],value2:e[1],value3:e[2]})):null},write:{writer:(t,e)=>{const i=[];for(const r of t){const n=[r.value,r.value2,r.value3].filter(ys).map(s=>s.toString());i.push(n)}e.values=i}}}})],Jb.prototype,"values",void 0),y([Ci("values")],Jb.prototype,"castValues",null),Jb=y([Z("esri.renderers.support.UniqueValueClass")],Jb);const o5e=Jb;let E4=class extends Xs(Ue){constructor(e){super(e),this.heading=null,this.classes=null}};y([w({type:String,json:{write:!0}})],E4.prototype,"heading",void 0),y([w({type:[o5e],json:{write:!0}})],E4.prototype,"classes",void 0),E4=y([Z("esri.renderers.support.UniqueValueGroup")],E4);const DK=E4;var NK;let R3=NK=class extends Ue{constructor(t){super(t),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new NK({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){var e;const t=JSON.stringify((e=this.symbol)==null?void 0:e.toJSON());return`${this.value}.${t}`}};y([w({type:String,json:{write:!0}})],R3.prototype,"description",void 0),y([w({type:String,json:{write:!0}})],R3.prototype,"label",void 0),y([w(Xse)],R3.prototype,"symbol",void 0),y([w(X7)],R3.prototype,"value",void 0),R3=NK=y([Z("esri.renderers.support.UniqueValueInfo")],R3);const n$=R3,_st=()=>!!Le("enable-feature:force-wosr"),DJt=()=>!!Le("enable-feature:direct-3d-object-feature-layer-display"),bst=()=>Le.add("enable-feature:direct-3d-object-feature-layer-display",!0,!0,!0),wst=()=>Le.add("enable-feature:direct-3d-object-feature-layer-display",!1,!0,!0),NJt=()=>!!Le("enable-i3s-patching"),xst=()=>Le.add("enable-i3s-patching",!0,!0,!0),Sst=()=>Le.add("enable-i3s-patching",!1,!0,!0),Upe=()=>!!Le("enable-feature:SceneLayer-editing"),Tst=(t="i3s-patching")=>{switch(Sst(),wst(),Le.add("enable-feature:SceneLayer-editing",!0,!0,!0),t){case"feature-layer-view":bst();break;case"i3s-patching":xst()}};Tst("i3s-patching");let OH={};async function Est(t,e){try{return{data:(await toe(t,e)).data,baseUrl:One(t),styleUrl:t}}catch(i){return zo(i),null}}function Cst(t,e,i){const r=e.portal!=null?e.portal:os.getDefault();let n;const s=`${r.url} - ${r.user&&r.user.username} - ${t}`;return OH[s]||(OH[s]=Ast(t,r,i).then(o=>(n=o,o.fetchData())).then(o=>({data:o,baseUrl:n.itemUrl??"",styleName:t}))),OH[s]}function Ast(t,e,i){return e.load(i).then(()=>{const r=new ay({disableExtraQuery:!0,query:`owner:${Vpe} AND type:${Bpe} AND typekeywords:"${t}"`});return e.queryItems(r,i)}).then(({results:r})=>{var o;let n=null;const s=t.toLowerCase();if(r&&Array.isArray(r)){for(const l of r)if(((o=l.typeKeywords)==null?void 0:o.some(f=>f.toLowerCase()===s))&&l.type===Bpe&&l.owner===Vpe){n=l;break}}if(!n)throw new se("symbolstyleutils:style-not-found",`The style '${t}' could not be found`,{styleName:t});return n.load(i)})}function eoe(t,e,i){return(t==null?void 0:t.styleUrl)!=null?Est(t.styleUrl,i):(t==null?void 0:t.styleName)!=null?Cst(t.styleName,e,i):Promise.reject(new se("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function a5e(t){return t===null||t.type==="CIMSymbolReference"?t:{type:"CIMSymbolReference",symbol:t}}function l5e(t,e,i=["gltf"]){if(e==="cimRef")return t.cimRef;if(t.formatInfos&&!_st())for(const r of i){const n=t.formatInfos.find(s=>s.type===r);if(n)return n.href}return t.webRef}function toe(t,e){const i={responseType:"json",query:{f:"json"},...e};return bi(Mf(t),i)}const Vpe="esri_en",Bpe="Style",Mst="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var C4;const c5e="esri.renderers.UniqueValueRenderer",nb=Ce.getLogger(c5e),jpe="uvInfos-watcher",Gpe="uvGroups-watcher",Ost=",",Pst=$s(n$);function Rst(t){const{field1:e,field2:i,field3:r,fieldDelimiter:n,uniqueValueInfos:s,valueExpression:o}=t,l=!(!e||!i);return[{classes:(s??[]).map(c=>{var F;const{symbol:f,label:_,value:x,description:T}=c,[A,M,I]=l?((F=x==null?void 0:x.toString())==null?void 0:F.split(n||""))||[]:[x],L=[];return(e||o)&&L.push(A),i&&L.push(M),r&&L.push(I),{symbol:f,label:_,values:[L],description:T}})}]}let fo=C4=class extends pP(L_){constructor(t){super(t),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(e,i){if(!e&&!i)return;if(!e||!i)return{type:"complete",oldValue:e,newValue:i};let r=!1;const n={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let s=0;sl.value===i[s].value);o?vst(o,i[s])?(n.changed.push({type:"complete",oldValue:o,newValue:i[s]}),r=!0):n.unchanged.push({oldValue:o,newValue:i[s]}):(n.added.push(i[s]),r=!0)}for(let s=0;so.value===e[s].value)||(n.removed.push(e[s]),r=!0);return r?n:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(t){this._set("field",t),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(t){return t==null||typeof t=="function"?t:y9(t)}writeField(t,e,i,r){typeof t=="string"?e[i]=t:r!=null&&r.messages?r.messages.push(new se("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):nb.error(".field: cannot write field to JSON since it's not a string value")}set field2(t){this._set("field2",t),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(t){this._set("field3",t),this._updateUniqueValues()}set valueExpression(t){this._set("valueExpression",t),this._updateUniqueValues()}set defaultSymbol(t){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",t)}set fieldDelimiter(t){this._set("fieldDelimiter",t),this._updateUniqueValues()}readPortal(t,e,i){return i.portal||os.getDefault()}readStyleOrigin(t,e,i){if(e.styleName)return Object.freeze({styleName:e.styleName});if(e.styleUrl){const r=f_(e.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(t,e,i,r){t.styleName?e.styleName=t.styleName:t.styleUrl&&(e.styleUrl=m_(t.styleUrl,r))}set uniqueValueGroups(t){this.styleOrigin?nb.error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",t),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(t){this.styleOrigin?nb.error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",t),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(t,e){var r;if(this.styleOrigin)return void nb.error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof t=="object"?Pst(t):new n$({value:t,symbol:xOe(e)}),(r=this.uniqueValueInfos)==null||r.push(i),this._valueInfoMap[i.value]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(t){if(this.styleOrigin)return void nb.error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const e=this.uniqueValueInfos;if(e)for(let i=0;it+e.getAttributeHash(),"")}getMeshHash(){var r;const t=JSON.stringify(this.backgroundFillSymbol),e=JSON.stringify(this.defaultSymbol),i=(r=this.uniqueValueInfos)==null?void 0:r.reduce((n,s)=>n+s.getMeshHash(),"");return`${t}.${e}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const t=new C4({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:Re(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:Re(this.visualVariables),legendOptions:Re(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:Re(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(t._isDefaultSymbolDerived=!0),t._set("portal",this.portal);const e=Re(this.uniqueValueInfos),i=Re(this.uniqueValueGroups);return this.styleOrigin&&(t._set("styleOrigin",Object.freeze(Re(this.styleOrigin))),Object.freeze(e),Object.freeze(i)),t._set("uniqueValueInfos",e),t._updateValueInfoMap(),t._set("uniqueValueGroups",i),t._isInfosSource=this._isInfosSource,t._watchUniqueValueInfosAndGroups(),t}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(t,e){const i=[this.collectVVRequiredFields(t,e),this.collectSymbolFields(t,e)];await Promise.all(i)}async collectSymbolFields(t,e){const i=[...this.getSymbols().map(r=>r.collectRequiredFields(t,e)),eh(t,e,this.valueExpression)];fp(t,e,this.field),fp(t,e,this.field2),fp(t,e,this.field3),await Promise.all(i)}populateFromStyle(){return eoe(this.styleOrigin,{portal:this.portal}).then(t=>{var i;const e=[];return this._valueInfoMap={},t&&t.data&&Array.isArray(t.data.items)&&t.data.items.forEach(r=>{const n=new gE({styleUrl:t.styleUrl,styleName:t.styleName,portal:this.portal,name:r.name});this.defaultSymbol||r.name!==t.data.defaultItem||(this.defaultSymbol=n,this._isDefaultSymbolDerived=!0);const s=new n$({value:r.name,symbol:n});e.push(s),this._valueInfoMap[r.name]=s}),this._set("uniqueValueInfos",Object.freeze(e)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&((i=this.uniqueValueInfos)!=null&&i.length)&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",Ost)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:t}=this;if(t)for(const e of t)this._valueInfoMap[e.value+""]=e}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(jpe);const{uniqueValueInfos:t}=this;if(t){const e=[];for(const i of t)e.push(_e(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,n)=>{r!==n&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(e,jpe)}}_watchUniqueValueGroups(){this.removeHandles(Gpe);const{uniqueValueGroups:t}=this;if(t){const e=[];for(const i of t){e.push(_e(()=>({classes:i.classes}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])e.push(_e(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(n,s)=>{n!==s&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(e,Gpe)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const t=[],{field:e,field2:i,field3:r,fieldDelimiter:n,uniqueValueGroups:s,valueExpression:o}=this;if(!e&&!o)return this._set("uniqueValueInfos",t),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const l=!(!e||!i);for(const c of s)for(const f of c.classes??[]){const{symbol:_,label:x,values:T,description:A}=f;for(const M of T??[]){const{value:I,value2:L,value3:F}=M,z=[I];i&&z.push(L),r&&z.push(F);const k=l?z.join(n||""):z[0];t.push(new n$({symbol:_,label:x,value:k,description:A}))}}this._set("uniqueValueInfos",t),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(t=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:e,field2:i,valueExpression:r,fieldDelimiter:n,uniqueValueInfos:s}=this;if(!e&&!r||!s.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!e||!i),l=s.map(f=>{var F;const{symbol:_,label:x,value:T,description:A}=f,[M,I,L]=o?((F=T==null?void 0:T.toString())==null?void 0:F.split(n||""))||[]:[T];return new o5e({symbol:_,label:x,description:A,values:[new aO({value:M,value2:I,value3:L})]})}),c=[new DK({classes:l})];t&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(t,e){return this.valueExpression?this._getUnqiueValueInfoForExpression(t,e):this._getUnqiueValueInfoForFields(t)}_getUnqiueValueInfoForExpression(t,e){const{viewingMode:i,scale:r,spatialReference:n,arcade:s,timeZone:o}=e??{};let l=this._cache.compiledFunc;const c=s.arcadeUtils;if(!l){const _=c.createSyntaxTree(this.valueExpression);l=c.createFunction(_),this._cache.compiledFunc=l}const f=c.executeFunction(l,c.createExecContext(t,c.getViewInfo({viewingMode:i,scale:r,spatialReference:n}),o));return this._valueInfoMap[f+""]}_getUnqiueValueInfoForFields(t){const e=this.field,i=t.attributes;let r;if(typeof e!="function"&&this.field2){const n=this.field2,s=this.field3,o=[];e&&o.push(i[e]),n&&o.push(i[n]),s&&o.push(i[s]),r=o.join(this.fieldDelimiter||"")}else typeof e=="function"?r=e(t):e&&(r=i[e]);return this._valueInfoMap[r+""]}static fromPortalStyle(t,e){const i=new C4(e==null?void 0:e.properties);i._set("styleOrigin",Object.freeze({styleName:t})),i._set("portal",(e==null?void 0:e.portal)||os.getDefault());const r=i.populateFromStyle();return r.catch(n=>{nb.error(`#fromPortalStyle('${t}'[, ...])`,"Failed to create unique value renderer from style name",n)}),r}static fromStyleUrl(t,e){const i=new C4(e==null?void 0:e.properties);i._set("styleOrigin",Object.freeze({styleUrl:t}));const r=i.populateFromStyle();return r.catch(n=>{nb.error(`#fromStyleUrl('${t}'[, ...])`,"Failed to create unique value renderer from style URL",n)}),r}};y([w({readOnly:!0})],fo.prototype,"_cache",null),y([Vt({uniqueValue:"unique-value"})],fo.prototype,"type",void 0),y([w(jOe)],fo.prototype,"backgroundFillSymbol",void 0),y([w({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],fo.prototype,"field",null),y([Ci("field")],fo.prototype,"castField",null),y([Pt("field")],fo.prototype,"writeField",null),y([w({type:String,value:null,json:{write:!0}})],fo.prototype,"field2",null),y([w({type:String,value:null,json:{write:!0}})],fo.prototype,"field3",null),y([w({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],fo.prototype,"orderByClassesEnabled",void 0),y([w({type:String,value:null,json:{write:!0}})],fo.prototype,"valueExpression",null),y([w({type:String,json:{write:!0}})],fo.prototype,"valueExpressionTitle",void 0),y([w({type:sO,json:{write:!0}})],fo.prototype,"legendOptions",void 0),y([w({type:String,json:{write:!0}})],fo.prototype,"defaultLabel",void 0),y([w(Yre({...HB},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],fo.prototype,"defaultSymbol",null),y([w({type:String,value:null,json:{write:!0}})],fo.prototype,"fieldDelimiter",null),y([w({type:os,readOnly:!0})],fo.prototype,"portal",void 0),y([$t("portal",["styleName"])],fo.prototype,"readPortal",null),y([w({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],fo.prototype,"styleOrigin",void 0),y([$t("styleOrigin",["styleName","styleUrl"])],fo.prototype,"readStyleOrigin",null),y([Pt("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],fo.prototype,"writeStyleOrigin",null),y([w({type:[DK],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(t,e,i)=>(e.uniqueValueGroups||Rst(e)).map(r=>DK.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],fo.prototype,"uniqueValueGroups",null),y([w({type:[n$],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],fo.prototype,"uniqueValueInfos",null),fo=C4=y([Z(c5e)],fo);const ioe=fo,Ist={key:"type",base:L_,typeMap:{heatmap:n5e,simple:Qse,"unique-value":ioe,"class-breaks":HOe,"dot-density":rst,dictionary:tst,"pie-chart":fst},errorContext:"renderer"},$st={key:"type",base:L_,typeMap:{simple:Qse,"unique-value":ioe,"class-breaks":HOe,heatmap:n5e},errorContext:"renderer",validate:Lst};function Lst(t){switch(t.type){case"simple":return Dst(t);case"unique-value":return Nst(t);case"class-breaks":return Fst(t);case"heatmap":return t}}function Dst(t){if(t.symbol)return t;Ce.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Nst(t){const e=t.uniqueValueInfos,i=e==null?void 0:e.filter(({symbol:r,label:n},s)=>(r||Ce.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${s}] ${n}) without a symbol from web scene.`),!!r));return(i==null?void 0:i.length)!==(e==null?void 0:e.length)&&(t.uniqueValueInfos=i),t}function Fst(t){const e=t.classBreakInfos,i=e==null?void 0:e.filter(({symbol:r,label:n},s)=>(r||Ce.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${s}] ${n}) without a symbol from web scene.`),!!r));return(i==null?void 0:i.length)!==(e==null?void 0:e.length)&&(t.classBreakInfos=i),t}function kst(t,e){return Ust(t,null,e)}const zst=Z5({types:Ist});function Ust(t,e,i){return t?t&&(t.styleName||t.styleUrl)&&t.type!=="uniqueValue"?(i!=null&&i.messages&&i.messages.push(new Uf("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+t.type+"'",{definition:t,context:i})),null):zst(t,e,i):null}let Vst=class u5e{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(WX),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const i=new u5e,r=this._originStores[Di.DEFAULTS];r&&r.forEach((n,s)=>{i.set(s,Re(n),Di.DEFAULTS)});for(let n=Di.SERVICE;n{e&&e.has(l)||i.set(l,Re(o),n)})}return i}get(e,i){const r=i===void 0?this._values:this._originStores[i];return r?r.get(e):void 0}keys(e){const i=e==null?this._values:this._originStores[e];return i?[...i.keys()]:[]}set(e,i,r=Di.USER){let n=this._originStores[r];if(n||(n=new Map,this._originStores[r]=n),n.set(e,i),!this._values.has(e)||this._propertyOriginMap.get(e)<=r){const s=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,r),s!==i}return!1}delete(e,i=Di.USER){const r=this._originStores[i];if(!r)return;const n=r.get(e);if(r.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===i){this._values.delete(e);for(let s=i-1;s>=0;s--){const o=this._originStores[s];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,s);break}}}return n}has(e,i){const r=i===void 0?this._values:this._originStores[i];return!!r&&r.has(e)}revert(e,i){for(;i>0&&!this.has(e,i);)--i;const r=this._originStores[i],n=r==null?void 0:r.get(e),s=this._values.get(e);return this._values.set(e,n),this._propertyOriginMap.set(e,i),s!==n}originOf(e){return this._propertyOriginMap.get(e)||Di.DEFAULTS}forEach(e){this._values.forEach(e)}};const h5e=t=>{let e=class extends t{constructor(...i){super(...i);const r=Zl(this),n=r.store,s=new Vst;r.store=s,tEe(r,n,s)}read(i,r){rEe(this,i,r)}getAtOrigin(i,r){const n=PH(this),s=kv(r);if(typeof i=="string")return n.get(i,s);const o={};return i.forEach(l=>{o[l]=n.get(l,s)}),o}originOf(i){return Bk(this.originIdOf(i))}originIdOf(i){return PH(this).originOf(i)}revert(i,r){const n=PH(this),s=kv(r),o=Zl(this);let l;l=typeof i=="string"?i==="*"?n.keys(s):[i]:i,l.forEach(c=>{o.invalidate(c),n.revert(c,s),o.commit(c)})}};return e=y([Z("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function PH(t){return Zl(t).store}let Hpe=class extends h5e(ze){};Hpe=y([Z("esri.core.ReadOnlyMultiOriginJSONSupport")],Hpe);const Bst=t=>{let e=class extends t{constructor(...i){super(...i)}clear(i,r="user"){return RH(this).delete(i,kv(r))}write(i,r){return aEe(this,i=i||{},r),i}setAtOrigin(i,r,n){Zl(this).setAtOrigin(i,r,kv(n))}removeOrigin(i){const r=RH(this),n=kv(i),s=r.keys(n);for(const o of s)r.originOf(o)===n&&r.set(o,r.get(o,n),Di.USER)}updateOrigin(i,r){const n=RH(this),s=kv(r),o=au(this,i);for(let l=s+1;l{let e=class extends Bst(h5e(t)){constructor(...i){super(...i)}};return e=y([Z("esri.core.MultiOriginJSONSupport")],e),e};let Yz=class extends fP(ze){};Yz=y([Z("esri.core.MultiOriginJSONSupport")],Yz);function jst(t){return"portalItem"in t}const Gst=t=>{let e=class extends t{get apiKey(){var i;return this._isOverridden("apiKey")?this._get("apiKey"):jst(this)?(i=this.portalItem)==null?void 0:i.apiKey:null}set apiKey(i){i!=null?this._override("apiKey",i):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return y([w({type:String})],e.prototype,"apiKey",null),e=y([Z("esri.layers.mixins.APIKeyMixin")],e),e},d5e={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},p5e=Object.values(d5e),f5e=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${p5e.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),Hst=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${p5e.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),qst=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function zJt(t){return!!f5e.test(t)}function vE(t){if(t==null)return null;const e=qs(t),i=(e==null?void 0:e.path.match(f5e))||(e==null?void 0:e.path.match(Hst));if(!i)return null;const[,r,n,s,o]=i,l=n.indexOf("/");return{title:roe(l!==-1?n.slice(l+1):n),serverType:d5e[s.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:r}}}function Wst(t){const e=qs(t).path.match(qst);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function roe(t){return(t=t.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+t.slice(1)}function Yst(t,e){const i=[];if(t){const r=vE(t);r!=null&&r.title&&i.push(r.title)}if(e){const r=roe(e);i.push(r)}if(i.length===2){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function qpe(t){if(!t)return!1;const e=".arcgis.com/",i="//services",r="//tiles",n="//features",s=(t=t.toLowerCase()).includes(e),o=t.includes(i)||t.includes(r)||t.includes(n);return s&&o}function Xst(t,e){return t&&mEe(yEe(t,e))}function Zst(t){let{url:e}=t;if(!e)return{url:e};e=yEe(e,t.logger);const i=qs(e),r=vE(i.path);let n;if(r!=null)r.sublayer!=null&&t.layer.layerId==null&&(n=r.sublayer),e=r.url.path;else if(t.nonStandardUrlAllowed){const s=Wst(i.path);s!=null&&(e=s.serviceUrl,n=s.sublayerId)}return{url:mEe(e),layerId:n}}function Jst(t,e,i,r,n){R2(e,r,"url",n),r.url&&t.layerId!=null&&(r.url=s0(r.url,i,t.layerId.toString()))}function Kst(t){if(!t)return!1;const e=t.toLowerCase(),i=e.includes("/services/"),r=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),s=e.includes("/wmsserver");return i&&(r||n||s)}const m5e=t=>{let e=class extends t{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const i=vE(this.url);if(i!=null&&i.title)return i.title}return this._get("title")||""}set title(i){this._set("title",i)}set url(i){this._set("url",Xst(i,Ce.getLogger(this)))}};return y([w()],e.prototype,"title",null),y([w({type:String})],e.prototype,"url",null),e=y([Z("esri.layers.mixins.ArcGISService")],e),e},Qst=wXe(),eot=new Map,g5e=new Map;async function UJt(t,e,i=!1){var s,o;if(!t||!e)return!0;const r=t.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),n=(s=g5e.get(r))==null?void 0:s.entries();if(n){for(const[l,c]of n)if(c.name===e){const f=!((o=c.stack)!=null&&o.hasForwardEdits());if(!f&&i){const[{deleteForwardEdits:_},{default:x}]=await Promise.all([we(()=>import("./deleteForwardEdits-Pq-0h4Vp.js"),__vite__mapDeps([])),we(()=>import("./DeleteForwardEditsParameters-DGoRlX6R.js"),__vite__mapDeps([]))]);return _(r,l,new x({sessionId:Qst,moment:c.moment}))}return f}}return!0}function tot(t,e){var n;if(!t)return!1;const i=t.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),r=(n=g5e.get(i))==null?void 0:n.entries();if(r){for(const[s,o]of r)if(o.name===e)return o.lockType==="edit"}return!1}const noe=new Dn.EventEmitter;function iot(t){return noe.on("apply-edits",new WeakRef(t))}function rot(t){return noe.on("update-moment",new WeakRef(t))}function VJt(t,e,i=null,r=!1){const n=Jl();return r=e==null||r,noe.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:r,result:n.promise}),n}const y5e="esri.layers.mixins.EditBusLayer",v5e=Symbol(y5e);function BJt(t){return t!=null&&typeof t=="object"&&v5e in t}function HP(t){return t!=null&&typeof t=="object"&&"gdbVersion"in t}function IH(t,e,i){const r=new URL(t).host,n=eot.get(r),s=o=>!o||o===n;return s(e)&&s(i)||e===i}const not=t=>{var e;let i=class extends t{constructor(...r){super(...r),this[e]=!0,this._applyEditsHandler=n=>{const{serviceUrl:s,layerId:o,gdbVersion:l,mayReceiveServiceEdits:c,result:f}=n,_=s===this.url,x=o!=null&&this.layerId!=null&&o===this.layerId,T=HP(this),A=HP(this)&&IH(s,l,this.gdbVersion);if(!_||T&&!A||!x&&!c)return;const M=f.then(I=>{var F;if(x&&(I.addedFeatures.length||I.updatedFeatures.length||I.deletedFeatures.length||I.addedAttachments.length||I.updatedAttachments.length||I.deletedAttachments.length))return this.emit("edits",Re(I)),I;const L=(F=I.editedFeatures)==null?void 0:F.find(({layerId:z})=>z===this.layerId);if(L){const{adds:z,updates:k,deletes:U}=L.editedFeatures,j={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:z?z.map(({attributes:H})=>({objectId:this.objectIdField&&H[this.objectIdField],globalId:this.globalIdField&&H[this.globalIdField]})):[],deletedFeatures:U?U.map(({attributes:H})=>({objectId:this.objectIdField&&H[this.objectIdField],globalId:this.globalIdField&&H[this.globalIdField]})):[],updatedFeatures:k?k.map(({current:{attributes:H}})=>({objectId:this.objectIdField&&H[this.objectIdField],globalId:this.globalIdField&&H[this.globalIdField]})):[],editedFeatures:Re(I.editedFeatures),exceededTransferLimit:!1,historicMoment:Re(I.historicMoment)};return this.emit("edits",j),j}return{edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:Re(I.editedFeatures),exceededTransferLimit:!1,historicMoment:Re(I.historicMoment)}}).then(I=>("historicMoment"in this&&this.historicMoment!==I.historicMoment&&tot(s,l)&&(this.historicMoment=I.historicMoment),I));this.emit("apply-edits",{result:M})},this._updateMomentHandler=n=>{const{serviceUrl:s,gdbVersion:o,moment:l}=n,c=s===this.url,f=HP(this),_=HP(this)&&IH(s,o,this.gdbVersion),x=HP(this)&&!IH(s,this.gdbVersion,null);c&&f&&_&&x&&"historicMoment"in this&&this.historicMoment!==l&&(this.historicMoment=l)},this.when().then(()=>{this.addHandles(iot(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(rot(this._updateMomentHandler))},()=>{})}};return e=v5e,i=y([Z(y5e)],i),i},Wf=(t=>t)(["operational-layers","basemap","ground"]),Wpe={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},Ype={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},Xpe={ArcGISFeatureLayer:!0},sot={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":Wpe,"web-map/basemap":Ype,"web-map/tables":Xpe,"link-chart/operational-layers":{...Wpe,LinkChartLayer:!0},"link-chart/basemap":Ype,"link-chart/tables":Xpe,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISImageServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0}},FK={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function Pf(t,e,i,r=Uy){const n=new wp(vne(r)),s=$i.fromJSDate(t,{zone:n}),o=i==="decades"||i==="centuries"?"year":_5e(i);return i==="decades"&&(e*=10),i==="centuries"&&(e*=100),s.plus({[o]:e}).toJSDate()}function rD(t,e,i="milliseconds"){const r=t.getTime(),n=Gs(e,i,"milliseconds");return new Date(r+n)}function Zpe(t,e,i=Uy){const r=new wp(vne(i)),n=$i.fromJSDate(t,{zone:r});if(e==="decades"||e==="centuries"){const o=n.startOf("year"),{year:l}=o,c=l-l%(e==="decades"?10:100);return o.set({year:c}).toJSDate()}const s=_5e(e);return n.startOf(s).toJSDate()}function oot(t,e,i="milliseconds"){const r=new Date(Gs(e,i,"milliseconds"));return r.setUTCFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),r}function aot(t,e="milliseconds"){const i=Gs(t.getUTCHours(),"hours","milliseconds"),r=Gs(t.getUTCMinutes(),"minutes","milliseconds"),n=Gs(t.getUTCSeconds(),"seconds","milliseconds");return Gs(i+r+n+t.getUTCMilliseconds(),"milliseconds",e)}function lot(t,e){const i=new Date(t.getTime());return i.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),i}function cot(t){const e=new Date(0);return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),e}function Gs(t,e,i){return t===0?0:t*FK[e]/FK[i]}function tF(t){return t instanceof Date&&!isNaN(t.getTime())}function uot(t,e){return t&&e?t.intersection(e):t||e}function _5e(t){switch(t){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var I0;let Yd=I0=class extends Ue{static get allTime(){return Jpe}static get empty(){return hot}constructor(t){super(t),this.end=null,this.start=null}readEnd(t,e){return e.end!=null?new Date(e.end):null}writeEnd(t,e){e.end=(t==null?void 0:t.getTime())??null}get isAllTime(){return this.equals(I0.allTime)}get isEmpty(){return this.equals(I0.empty)}readStart(t,e){return e.start!=null?new Date(e.start):null}writeStart(t,e){e.start=(t==null?void 0:t.getTime())??null}clone(){return new I0({end:this.end,start:this.start})}equals(t){var s,o,l,c;if(!t)return!1;const e=((s=this.start)==null?void 0:s.getTime())??this.start,i=((o=this.end)==null?void 0:o.getTime())??this.end,r=((l=t.start)==null?void 0:l.getTime())??t.start,n=((c=t.end)==null?void 0:c.getTime())??t.end;return e===r&&i===n}expandTo(t,e=Uy){if(this.isEmpty||this.isAllTime)return this.clone();let i=this.start;i&&(i=Zpe(i,t,e));let r=this.end;if(r){const n=Zpe(r,t,e);r=r.getTime()===n.getTime()?n:Pf(n,1,t,e)}return new I0({start:i,end:r})}intersection(t){var l,c,f,_;if(!t)return this.clone();if(this.isEmpty||t.isEmpty)return I0.empty;if(this.isAllTime)return t.clone();if(t.isAllTime)return this.clone();const e=((l=this.start)==null?void 0:l.getTime())??-1/0,i=((c=this.end)==null?void 0:c.getTime())??1/0,r=((f=t.start)==null?void 0:f.getTime())??-1/0,n=((_=t.end)==null?void 0:_.getTime())??1/0;let s,o;if(r>=e&&r<=i?s=r:e>=r&&e<=n&&(s=e),i>=r&&i<=n?o=i:n>=e&&n<=i&&(o=n),s!=null&&o!=null&&!isNaN(s)&&!isNaN(o)){const x=new I0;return x.start=s===-1/0?null:new Date(s),x.end=o===1/0?null:new Date(o),x}return I0.empty}offset(t,e,i=Uy){if(this.isEmpty||this.isAllTime)return this.clone();const r=new I0,{start:n,end:s}=this;return n!=null&&(r.start=Pf(n,t,e,i)),s!=null&&(r.end=Pf(s,t,e,i)),r}union(t){if(!t||t.isEmpty)return this.clone();if(this.isEmpty)return t.clone();if(this.isAllTime||t.isAllTime)return Jpe.clone();const e=this.start!=null&&t.start!=null?new Date(Math.min(this.start.getTime(),t.start.getTime())):null,i=this.end!=null&&t.end!=null?new Date(Math.max(this.end.getTime(),t.end.getTime())):null;return new I0({start:e,end:i})}};y([w({type:Date,json:{write:{allowNull:!0}}})],Yd.prototype,"end",void 0),y([$t("end")],Yd.prototype,"readEnd",null),y([Pt("end")],Yd.prototype,"writeEnd",null),y([w({readOnly:!0,json:{read:!1}})],Yd.prototype,"isAllTime",null),y([w({readOnly:!0,json:{read:!1}})],Yd.prototype,"isEmpty",null),y([w({type:Date,json:{write:{allowNull:!0}}})],Yd.prototype,"start",void 0),y([$t("start")],Yd.prototype,"readStart",null),y([Pt("start")],Yd.prototype,"writeStart",null),Yd=I0=y([Z("esri.TimeExtent")],Yd);const Jpe=new Yd,hot=new Yd({start:void 0,end:void 0}),D_=Yd;function dot(t){if(!t)return t;const{start:e,end:i}=t;return new D_({start:e!=null?Pf(e,-e.getTimezoneOffset(),"minutes"):e,end:i!=null?Pf(i,-i.getTimezoneOffset(),"minutes"):i})}function pot(t){if(!t)return t;const{start:e,end:i}=t;return new D_({start:e!=null?Pf(e,e.getTimezoneOffset(),"minutes"):e,end:i!=null?Pf(i,i.getTimezoneOffset(),"minutes"):i})}const fot={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:Wf}}},mot={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(t,e)=>!e.disablePopup},write:{enabled:!0,writer(t,e,i){e[i]=!t}}}},got={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:Wf}}},soe={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:R2}}},b5e={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:Wf}}},yot={value:null,type:BB,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:Wf}}};function jJt(t){return{type:t,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const w5e={write:{enabled:!0,layerContainerTypes:Wf},read:!0},kK={type:Number,json:{origins:{"web-document":w5e,"portal-item":{write:!0}}}},GJt={...kK,json:{...kK.json,origins:{"web-document":{...w5e,write:{enabled:!0,layerContainerTypes:Wf,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(t,e,i)=>{var r;return i&&i.origin!=="service"||!e.drawingInfo||e.drawingInfo.transparency===void 0?(r=e.layerDefinition)!=null&&r.drawingInfo&&e.layerDefinition.drawingInfo.transparency!==void 0?jT(e.layerDefinition.drawingInfo.transparency):void 0:jT(e.drawingInfo.transparency)}}}},vot={type:D_,readOnly:!0,get(){var l,c;if(!((l=this.layer)!=null&&l.timeInfo))return null;const{datesInUnknownTimezone:t,timeOffset:e,useViewTime:i}=this.layer,r=(c=this.view)==null?void 0:c.timeExtent;let n=this.layer.timeExtent;t&&(n=pot(n));let s=i?r&&n?r.intersection(n):r||n:n;if(!s||s.isEmpty||s.isAllTime)return s;e&&(s=s.offset(-e.value,e.unit)),t&&(s=dot(s));const o=this._get("timeExtent");return s.equals(o)?o:s}},HJt={type:Vi,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(t,e)=>{const i=Vi.fromJSON(t);return e.spatialReference!=null&&typeof e.spatialReference=="object"&&(i.spatialReference=at.fromJSON(e.spatialReference)),i}}}},read:!1}},_ot={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},qJt={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:Wf}}},name:"layerDefinition.minScale",write:!0}},WJt={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:Wf}}},name:"layerDefinition.maxScale",write:!0}},bot={json:{write:{ignoreOrigin:!0,layerContainerTypes:Wf},origins:{"web-map":{read:!1,write:!1}}}},XB=t=>{let e=class extends t{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(i,r,n){var s;return((s=n==null?void 0:n.portalItem)==null?void 0:s.type)==="Group Layer"?void 0:i}writeListMode(i,r,n,s){(s&&s.layerContainerType==="ground"||i&&oEe(this,n,{},s))&&(r[n]=i)}writeOperationalLayerType(i,r,n,s){i&&(s==null?void 0:s.layerContainerType)!=="tables"&&(r.layerType=i)}writeTitle(i,r){r.title=i??"Layer"}read(i,r){r&&(r.layer=this),nEe(this,i,n=>super.read(i,n),r)}write(i,r){var o,l;if(!this.persistenceEnabled)return null;if(r!=null&&r.origin){const c=`${r.origin}/${r.layerContainerType||"operational-layers"}`,f=sot[c];let _=!!(f!=null&&f[this.operationalLayerType]);if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&c==="web-scene/operational-layers"&&(_=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&c==="web-map/operational-layers"&&(_=!1),!_)return(o=r.messages)==null||o.push(new se("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${c}'`,{layer:this})),null}const n=super.write(i,{...r,layer:this}),s=!!r&&!!r.messages&&!!r.messages.filter(c=>c instanceof se&&c.name==="web-document-write:property-required").length;return E2(n==null?void 0:n.url)?((l=r==null?void 0:r.messages)==null||l.push(new se("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&s?null:n}beforeSave(){}};return y([w({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],e.prototype,"id",void 0),y([$t("id",["id"])],e.prototype,"readId",null),y([w(bot)],e.prototype,"listMode",void 0),y([Pt("listMode")],e.prototype,"writeListMode",null),y([w({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:Wf}}}}})],e.prototype,"operationalLayerType",void 0),y([Pt("operationalLayerType")],e.prototype,"writeOperationalLayerType",null),y([w(kK)],e.prototype,"opacity",void 0),y([w({type:Boolean,readOnly:!1})],e.prototype,"persistenceEnabled",void 0),y([w({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],e.prototype,"title",void 0),y([Pt("title"),Pt(["web-scene"],"title")],e.prototype,"writeTitle",null),y([w({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:Wf}}},name:"visibility",write:!0}})],e.prototype,"visible",void 0),e=y([Z("esri.layers.mixins.OperationalLayer")],e),e};let X1=class extends ze{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e!=null&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){e!=null&&Zh(e)?Ce.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",i){const r=this.cdnUrl;if(r==null)throw new se("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey},signal:i==null?void 0:i.signal})}async update(e,i){const{addOrUpdateResource:r}=await we(()=>Promise.resolve().then(()=>P4),void 0);return r(this,"update",e,i)}hasPath(){return this.path!=null}_normalizePath(e,i){return e==null?e:(e=e.replace(/^\/+/,""),i!=null&&Zh(e)&&(e=Ene(e,i.itemUrl)),e==null?void 0:e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};y([w()],X1.prototype,"portalItem",void 0),y([w({type:String,value:null})],X1.prototype,"path",null),y([Ci("path")],X1.prototype,"_castPath",null),y([w({type:String,readOnly:!0})],X1.prototype,"url",null),y([w({type:String,readOnly:!0})],X1.prototype,"cdnUrl",null),y([w({type:String,readOnly:!0})],X1.prototype,"itemRelativeUrl",null),X1=y([Z("esri.portal.PortalItemResource")],X1);const wot=X1;let A4=class extends ze{constructor(e){super(e),this.created=null,this.rating=null}};y([w()],A4.prototype,"created",void 0),y([w()],A4.prototype,"rating",void 0),A4=y([Z("esri.portal.PortalRating")],A4);const $H=A4;var I3;const xot=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),Sot=new Set(["KML","GeoJson","CSV"]);let ar=I3=class extends P_(jf){static from(t){return MT(I3,t)}constructor(t){super(t),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const t=this.type,e=this.typeKeywords||[];let i=t;return t==="Feature Service"||t==="Feature Collection"?i=e.includes("Table")?"Table":e.includes("Route Layer")?"Route Layer":e.includes("Markup")?"Markup":"Feature Layer":t==="Image Service"?i=e.includes("Elevation 3D Layer")?"Elevation Layer":e.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":t==="Scene Service"?i="Scene Layer":t==="Video Service"?i="Video Layer":t==="Scene Package"?i="Scene Layer Package":t==="Stream Service"?i="Feature Layer":t==="Geoprocessing Service"?i=e.includes("Web Tool")?"Tool":"Geoprocessing Service":t==="Geocoding Service"?i="Locator":t==="Geoenrichment Service"?i="GeoEnrichment Service":t==="Microsoft Powerpoint"?i="Microsoft PowerPoint":t==="GeoJson"?i="GeoJSON":t==="Globe Service"?i="Globe Layer":t==="Vector Tile Service"?i="Tile Layer":t==="netCDF"?i="NetCDF":t==="Map Service"?i=e.includes("Spatiotemporal")||!e.includes("Hosted Service")&&!e.includes("Tiled")||e.includes("Relational")?"Map Image Layer":"Tile Layer":t&&t.toLowerCase().includes("add in")?i=t.replaceAll(/(add in)/gi,"Add-In"):t==="datastore catalog service"?i="Big Data File Share":t==="Compact Tile Package"?i="Tile Package (tpkx)":t==="OGCFeatureServer"?i="OGC Feature Layer":t==="web mapping application"&&e.includes("configurableApp")?i="Instant App":t==="Insights Page"?i="Insights Report":t==="Excalibur Imagery Project"&&(i="Excalibur Project"),i}readExtent(t){return t&&t.length?new Vi(t[0][0],t[0][1],t[1][0],t[1][1]):null}get iconUrl(){var T;const t=((T=this.type)==null?void 0:T.toLowerCase())||"",e=this.typeKeywords||[],i="esri/images/portal/",r="16";let n,s=!1,o=!1,l=!1,c=!1,f=!1,_=!1,x=!1;return t.indexOf("service")>0||t==="feature collection"||t==="kml"||t==="wms"||t==="wmts"||t==="wfs"?(s=e.includes("Hosted Service"),t==="feature service"||t==="feature collection"||t==="kml"||t==="wfs"?(o=e.includes("Table"),l=e.includes("Route Layer"),c=e.includes("Markup"),f=e.includes("Spatiotemporal"),_=e.includes("UtilityNetwork"),n=f&&o?"spatiotemporaltable":o?"table":l?"routelayer":c?"markup":f?"spatiotemporal":s?"featureshosted":_?"utilitynetwork":"features"):n=t==="map service"||t==="wms"||t==="wmts"?s||e.includes("Tiled")||t==="wmts"?"maptiles":"mapimages":t==="scene service"?e.includes("Line")?"sceneweblayerline":e.includes("3DObject")?"sceneweblayermultipatch":e.includes("Point")?"sceneweblayerpoint":e.includes("IntegratedMesh")?"sceneweblayermesh":e.includes("PointCloud")?"sceneweblayerpointcloud":e.includes("Polygon")?"sceneweblayerpolygon":e.includes("Building")?"sceneweblayerbuilding":e.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":t==="image service"?e.includes("Elevation 3D Layer")?"elevationlayer":e.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":t==="stream service"?"streamlayer":t==="video service"?e.includes("Live Stream")?"livestreamvideolayer":"videolayer":t==="vector tile service"?"vectortile":t==="datastore catalog service"?"datastorecollection":t==="geocoding service"?"geocodeservice":t==="geoprocessing service"?e.includes("Web Tool")?"tool":"layers":t==="geodata service"?"geodataservice":t==="3dtiles service"?"3dtileslayer":"layers"):t==="web map"||t==="cityengine web scene"?n="maps":t==="web scene"?n=e.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":t==="web mapping application"&&e.includes("configurableApp")?n="instantapps":t==="web mapping application"||t==="mobile application"||t==="application"||t==="operation view"||t==="desktop application"?n="apps":t==="map document"||t==="map package"||t==="published map"||t==="scene document"||t==="globe document"||t==="basemap package"||t==="mobile basemap package"||t==="mobile map package"||t==="project package"||t==="project template"||t==="pro map"||t==="layout"||t==="layer"&&e.includes("ArcGIS Pro")||t==="explorer map"&&e.indexOf("Explorer Document")?n="mapsgray":t==="service definition"||t==="csv"||t==="shapefile"||t==="cad drawing"||t==="geojson"||t==="netcdf"||t==="administrative report"?n="datafiles":t==="explorer add in"||t==="desktop add in"||t==="windows viewer add in"||t==="windows viewer configuration"?n="appsgray":t==="360 vr experience"?n="360vr":t==="arcgis pro add in"||t==="arcgis pro configuration"?n="addindesktop":t==="rule package"||t==="file geodatabase"||t==="sqlite geodatabase"||t==="csv collection"||t==="kml collection"||t==="windows mobile package"||t==="map template"||t==="desktop application template"||t==="gml"||t==="arcpad package"||t==="code sample"||t==="document link"||t==="earth configuration"||t==="operations dashboard add in"||t==="rules package"||t==="image"||t==="workflow manager package"||t==="explorer map"&&e.includes("Explorer Mapping Application")||e.includes("Document")?n="datafilesgray":t==="network analysis service"||t==="geoprocessing service"||t==="geodata service"||t==="geometry service"||t==="geoprocessing package"||t==="locator package"||t==="geoprocessing sample"||t==="workflow manager service"?n="toolsgray":t==="layer"||t==="layer package"||t==="explorer layer"?n="layersgray":t==="scene package"?n="scenepackage":t==="3dtiles package"?n="3dtileslayerpackage":t==="mobile scene package"?n="mobilescenepackage":t==="tile package"||t==="compact tile package"?n="tilepackage":t==="task file"?n="taskfile":t==="report template"?n="report-template":t==="statistical data collection"?n="statisticaldatacollection":t==="insights workbook"?n="workbook":t==="insights model"?n="insightsmodel":t==="insights page"?n="insightspage":t==="insights theme"?n="insightstheme":t==="hub initiative"?n="hubinitiative":t==="hubpage"?n="hubpage":t==="hub event"?n="hubevent":t==="hub site application"?n="hubsite":t==="hub project"?n="hubproject":t==="relational database connection"?n="relationaldatabaseconnection":t==="big data file share"?n="datastorecollection":t==="image collection"?n="imagecollection":t==="style"?n="style":t==="desktop style"?n="desktopstyle":t==="dashboard"?n="dashboard":t==="raster function template"?n="rasterprocessingtemplate":t==="vector tile package"?n="vectortilepackage":t==="ortho mapping project"?n="orthomappingproject":t==="ortho mapping template"?n="orthomappingtemplate":t==="solution"?n="solutions":t==="geopackage"?n="geopackage":t==="deep learning package"?n="deeplearningpackage":t==="real time analytic"?n="realtimeanalytics":t==="big data analytic"?n="bigdataanalytics":t==="feed"?n="feed":t==="excalibur imagery project"?n="excaliburimageryproject":t==="notebook"?n="notebook":t==="storymap"?n="storymap":t==="survey123 add in"?n="survey123addin":t==="mission"?n="mission":t==="mission report"?n="missionreport":t==="mission template"?n="missiontemplate":t==="quickcapture project"?n="quickcaptureproject":t==="pro report"?n="proreport":t==="pro report template"?n="proreporttemplate":t==="urban model"?n="urbanmodel":t==="web experience"?n="experiencebuilder":t==="web experience template"?n="webexperiencetemplate":t==="experience builder widget"?n="experiencebuilderwidget":t==="experience builder widget package"?n="experiencebuilderwidgetpackage":t==="workflow"?n="workflow":t==="insights script"?n="insightsscript":t==="kernel gateway connection"?n="kernelgatewayconnection":t==="hub initiative template"?n="hubinitiativetemplate":t==="storymap theme"?n="storymaptheme":t==="knowledge graph"?n="knowledgegraph":t==="knowledge studio project"?n="knowledgestudio":t==="native application"?n="nativeapp":t==="native application installer"?n="nativeappinstaller":t==="link chart"?n="linkchart":t==="investigation"?n="investigation":t==="ogcfeatureserver"?n="features":t==="pro project"?n="proproject":t==="insights workbook package"?n="insightsworkbookpackage":t==="apache parquet"?n="apacheparquet":t==="notebook code snippets"||t==="notebook code snippet library"?n="notebookcodesnippets":t==="suitability model"?n="suitabilitymodel":t==="esri classifier definition"?n="classifierdefinition":t==="esri classification schema"?n="classificationschema":t==="insights data engineering workbook"?n="dataengineeringworkbook":t==="insights data engineering model"?n="dataengineeringmodel":t==="deep learning studio project"?n="deeplearningproject":t==="discussion"?n="discussion":t==="allsource project"?n="allsourceproject":t==="api key"?n="apikey":t==="data pipeline"?n="datapipelines":t==="group layer"?(x=e.includes("Map"),n=x?"layergroup2d":"layergroup"):n=t==="media layer"?"onlinemedialayer":t==="form"?e.includes("Survey123")?"survey":"datafilesgray":"maps",n?Wr(i+n+r+".png"):null}get isLayer(){return this.type!=null&&xot.has(this.type)}get itemCdnUrl(){let t=this.itemUrl;return t&&yr&&!yr.findCredential(t)&&(t=yr._normalizeAGOLorgDomain(t),t=t.replace(/^https?:\/\/www\.arcgis\.com/,"https://cdn.arcgis.com"),t=t.replace(/^https?:\/\/devext\.arcgis\.com/,"https://cdndev.arcgis.com"),t=t.replace(/^https?:\/\/qaext\.arcgis\.com/,"https://cdnqa.arcgis.com")),t}get itemPageUrl(){var e;const t=(e=this.portal)==null?void 0:e.itemPageUrl;return t&&this.id?`${t}?id=${this.id}`:null}get itemUrl(){var e;const t=(e=this.portal)==null?void 0:e.restUrl;return t&&this.id?`${t}/content/items/${this.id}`:null}get thumbnailUrl(){var i;const t=this.itemUrl,e=this.thumbnail;return t&&e?((i=this.portal)==null?void 0:i.normalizeUrl(`${t}/info/${e}?f=json`))??null:null}get userItemUrl(){var i,r,n;const t=(i=this.portal)==null?void 0:i.restUrl;if(!t)return null;const e=this.owner||((n=(r=this.portal)==null?void 0:r.user)==null?void 0:n.username);return e?`${t}/content/users/${this.ownerFolder?`${e}/${this.ownerFolder}`:e}/items/${this.id}`:null}load(t){const e=this.portal??(this.portal=os.getDefault()),i=e.load(t).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?e.request(this.itemUrl,{signal:t!=null?t.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(t){const e={method:"post",query:{}};return t instanceof $H&&(t=t.rating),t==null||isNaN(t)||typeof t!="number"||(e.query.rating=t),this.portal?(await this.portal.request(this.itemUrl+"/addRating",e),new $H({rating:t,created:new Date})):null}clone(){const t={access:this.access,accessInformation:this.accessInformation,applicationProxies:Re(this.applicationProxies),avgRating:this.avgRating,categories:Re(this.categories),created:Re(this.created),culture:this.culture,description:this.description,extent:Re(this.extent),groupCategories:Re(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:Re(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:Re(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:Re(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:Re(this.typeKeywords),url:this.url};this.loaded&&(t.loadStatus="loaded");const e=new I3({sourceJSON:this.sourceJSON}).set(t);return e._set("isOrgItem",this.isOrgItem),e}createPostQuery(){var i;const t=this.toJSON();for(const r of["tags","typeKeywords","categories"])t[r]=(i=t[r])==null?void 0:i.join(", ");const{extent:e}=t;return e&&(t.extent=JSON.stringify(e)),t}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(t="json",e){return this.portal.request(this.itemUrl+"/data",{responseType:t,...e,query:{token:this.apiKey}})}async fetchRating(t){const e=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...t});return e.rating!=null?(e.created=new Date(e.created),new $H(e)):null}fetchRelatedItems(t,e){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...t,token:this.apiKey},...e},I3)}getThumbnailUrl(t){let e=this.thumbnailUrl;return e&&t&&(e+=`&w=${t}`),e}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(t=>(this.sourceJSON=t,this.read(t),this))}update(t){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=t==null?void 0:t.data,i={method:"post"};i.query=this.createPostQuery();for(const r in i.query)i.query[r]===null&&(i.query[r]="");return i.query.clearEmptyFields=!0,e!=null&&(typeof e=="string"?i.query.text=e:typeof e=="object"&&(i.query.text=JSON.stringify(e))),this.portal.request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new se("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(t){if(!this.id)throw new se("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:e,itemUrl:i}=this;await e.signIn();const{copyResources:r,folder:n,tags:s,title:o}=t||{},l={method:"post",query:{copyPrivateResources:r==="all",folder:typeof n=="string"?n:n==null?void 0:n.id,includeResources:!!r,tags:s==null?void 0:s.join(","),title:o}},{itemId:c}=await e.request(`${i}/copy`,l);return new I3({id:c,portal:e})}updateThumbnail(t){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const e=t.thumbnail,i=t.filename,r={method:"post"};if(typeof e=="string")i1(e)?r.query={data:e}:r.query={url:Gh(e)},i!=null&&(r.query.filename=i);else{const n=new FormData;i!=null?n.append("file",e,i):n.append("file",e),r.body=n}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,r).then(()=>this.reload())}):Promise.reject(new se("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(t={},e){const{fetchResources:i}=await we(()=>Promise.resolve().then(()=>P4),void 0);return i(this,t,e)}async addResource(t,e,i){const{addOrUpdateResource:r}=await we(()=>Promise.resolve().then(()=>P4),void 0);return t.portalItem=this,r(t,"add",e,i)}async removeResource(t,e){const{removeResource:i}=await we(()=>Promise.resolve().then(()=>P4),void 0);if(t.portalItem&&t.portalItem.itemUrl!==this.itemUrl)throw new se("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i(this,t,e)}async removeAllResources(t){const{removeAllResources:e}=await we(()=>Promise.resolve().then(()=>P4),void 0);return e(this,t)}resourceFromPath(t){return new wot({portalItem:this,path:t})}toJSON(){var i,r;const t=this.extent,e={accessInformation:this.accessInformation,categories:Re(this.categories),created:(i=this.created)==null?void 0:i.getTime(),description:this.description,extent:t&&[[t.xmin,t.ymin],[t.xmax,t.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:(r=this.modified)==null?void 0:r.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:Re(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:Re(this.typeKeywords),url:this.url};return q3e(e)}static fromJSON(t){if(!t)return null;if(t.declaredClass)throw new Error("JSON object is already hydrated");return new I3({sourceJSON:t})}_getPostQuery(){const t=this.toJSON();for(const e in t)e==="tags"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="typeKeywords"&&t[e]!==null&&(t[e]=t[e].join(", ")),e==="extent"&&t[e]&&(t[e]=JSON.stringify(t[e]));return t}};y([w({type:["private","shared","org","public"]})],ar.prototype,"access",void 0),y([w()],ar.prototype,"accessInformation",void 0),y([w({type:String})],ar.prototype,"apiKey",void 0),y([w({json:{read:{source:"appProxies"}}})],ar.prototype,"applicationProxies",void 0),y([w()],ar.prototype,"avgRating",void 0),y([w()],ar.prototype,"categories",void 0),y([w({type:Date})],ar.prototype,"created",void 0),y([w()],ar.prototype,"culture",void 0),y([w()],ar.prototype,"description",void 0),y([w({readOnly:!0})],ar.prototype,"displayName",null),y([w({type:Vi})],ar.prototype,"extent",void 0),y([$t("extent")],ar.prototype,"readExtent",null),y([w()],ar.prototype,"groupCategories",void 0),y([w({readOnly:!0})],ar.prototype,"iconUrl",null),y([w()],ar.prototype,"id",void 0),y([w({readOnly:!0})],ar.prototype,"isLayer",null),y([w({type:Boolean,readOnly:!0})],ar.prototype,"isOrgItem",void 0),y([w()],ar.prototype,"itemControl",void 0),y([w({readOnly:!0})],ar.prototype,"itemPageUrl",null),y([w({readOnly:!0})],ar.prototype,"itemUrl",null),y([w()],ar.prototype,"licenseInfo",void 0),y([w({type:Date})],ar.prototype,"modified",void 0),y([w()],ar.prototype,"name",void 0),y([w()],ar.prototype,"numComments",void 0),y([w()],ar.prototype,"numRatings",void 0),y([w()],ar.prototype,"numViews",void 0),y([w()],ar.prototype,"owner",void 0),y([w()],ar.prototype,"ownerFolder",void 0),y([w({type:os})],ar.prototype,"portal",void 0),y([w()],ar.prototype,"screenshots",void 0),y([w()],ar.prototype,"size",void 0),y([w()],ar.prototype,"snippet",void 0),y([w()],ar.prototype,"sourceJSON",void 0),y([w({type:String})],ar.prototype,"sourceUrl",void 0),y([w({type:String})],ar.prototype,"spatialReference",void 0),y([w()],ar.prototype,"tags",void 0),y([w()],ar.prototype,"thumbnail",void 0),y([w({readOnly:!0})],ar.prototype,"thumbnailUrl",null),y([w()],ar.prototype,"title",void 0),y([w()],ar.prototype,"type",void 0),y([w()],ar.prototype,"typeKeywords",void 0),y([w({type:String,json:{read(t,e){var i;if(Sot.has(e.type)){const r=(i=this.portal)==null?void 0:i.restUrl;t||(t=r&&this.id?`${r}/content/items/${this.id}/data`:null)}return t}}})],ar.prototype,"url",void 0),y([w({readOnly:!0})],ar.prototype,"userItemUrl",null),ar=I3=y([Z("esri.portal.PortalItem")],ar);const Am=ar,x5e=Object.freeze(Object.defineProperty({__proto__:null,default:Am},Symbol.toStringTag,{value:"Module"})),kh=Math.PI/180,Tot=/(?:SPHEROID|ELLIPSOID)\[([^\]]+)]/i,sb=Mr.radius,d0=Mr.eccentricitySquared,Eot={a1:sb*d0,a2:sb*d0*sb*d0,a3:sb*d0*d0/2,a4:sb*d0*sb*d0*2.5,a5:sb*d0+sb*d0*d0/2,a6:1-d0},Cot={4267:{a:63782064e-1,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:Mr.radius,f:Mr.flattening},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:u_.radius,f:u_.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:Sy.radius,f:Sy.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:Sy.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};var Oe;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",t[t.WGS84=2]="WGS84",t[t.WEB_MERCATOR=3]="WEB_MERCATOR",t[t.WGS84_ECEF=4]="WGS84_ECEF",t[t.CGCS2000=5]="CGCS2000",t[t.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",t[t.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",t[t.GCSMARS2000=8]="GCSMARS2000",t[t.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",t[t.GCSMOON2000=10]="GCSMOON2000",t[t.LON_LAT=11]="LON_LAT",t[t.PLATE_CARREE=12]="PLATE_CARREE"})(Oe||(Oe={}));const CM={[Oe.WGS84]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:Qn,[Oe.WGS84_COMPARABLE_LON_LAT]:Qn,[Oe.SPHERICAL_ECEF]:r2,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:t5,[Oe.PLATE_CARREE]:i2,[Oe.WGS84]:Qn,[Oe.WGS84_ECEF]:s2},[Oe.CGCS2000]:{[Oe.CGCS2000]:Qn,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:Qn,[Oe.WGS84_COMPARABLE_LON_LAT]:Qn,[Oe.SPHERICAL_ECEF]:r2,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:i2,[Oe.WGS84]:null,[Oe.WGS84_ECEF]:s2},[Oe.GCSMARS2000]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:Qn,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:Qn,[Oe.WGS84_COMPARABLE_LON_LAT]:null,[Oe.SPHERICAL_ECEF]:null,[Oe.SPHERICAL_MARS_PCPF]:UK,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:null,[Oe.WGS84]:null,[Oe.WGS84_ECEF]:null},[Oe.GCSMOON2000]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:Qn,[Oe.LON_LAT]:Qn,[Oe.WGS84_COMPARABLE_LON_LAT]:null,[Oe.SPHERICAL_ECEF]:null,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:zK,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:null,[Oe.WGS84]:null,[Oe.WGS84_ECEF]:null},[Oe.WEB_MERCATOR]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:pT,[Oe.WGS84_COMPARABLE_LON_LAT]:pT,[Oe.SPHERICAL_ECEF]:T5e,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:Qn,[Oe.PLATE_CARREE]:C5e,[Oe.WGS84]:pT,[Oe.WGS84_ECEF]:E5e},[Oe.WGS84_ECEF]:{[Oe.CGCS2000]:o2,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:o2,[Oe.WGS84_COMPARABLE_LON_LAT]:o2,[Oe.SPHERICAL_ECEF]:O5e,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:P5e,[Oe.PLATE_CARREE]:Aot,[Oe.WGS84]:o2,[Oe.WGS84_ECEF]:Qn},[Oe.SPHERICAL_ECEF]:{[Oe.CGCS2000]:n2,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:n2,[Oe.WGS84_COMPARABLE_LON_LAT]:n2,[Oe.SPHERICAL_ECEF]:Qn,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:A5e,[Oe.PLATE_CARREE]:Mot,[Oe.WGS84]:n2,[Oe.WGS84_ECEF]:M5e},[Oe.SPHERICAL_MARS_PCPF]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:BK,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:BK,[Oe.WGS84_COMPARABLE_LON_LAT]:null,[Oe.SPHERICAL_ECEF]:null,[Oe.SPHERICAL_MARS_PCPF]:Qn,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:null,[Oe.WGS84]:null,[Oe.WGS84_ECEF]:null},[Oe.SPHERICAL_MOON_PCPF]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:VK,[Oe.LON_LAT]:VK,[Oe.WGS84_COMPARABLE_LON_LAT]:null,[Oe.SPHERICAL_ECEF]:null,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:Qn,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:null,[Oe.WGS84]:null,[Oe.WGS84_ECEF]:null},[Oe.UNKNOWN]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:null,[Oe.WGS84_COMPARABLE_LON_LAT]:null,[Oe.SPHERICAL_ECEF]:null,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:Qn,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:null,[Oe.WGS84]:null,[Oe.WGS84_ECEF]:null},[Oe.LON_LAT]:{[Oe.CGCS2000]:Qn,[Oe.GCSMARS2000]:Qn,[Oe.GCSMOON2000]:Qn,[Oe.LON_LAT]:Qn,[Oe.WGS84_COMPARABLE_LON_LAT]:Qn,[Oe.SPHERICAL_ECEF]:r2,[Oe.SPHERICAL_MARS_PCPF]:UK,[Oe.SPHERICAL_MOON_PCPF]:zK,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:t5,[Oe.PLATE_CARREE]:i2,[Oe.WGS84]:Qn,[Oe.WGS84_ECEF]:s2},[Oe.WGS84_COMPARABLE_LON_LAT]:{[Oe.CGCS2000]:null,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:Qn,[Oe.WGS84_COMPARABLE_LON_LAT]:Qn,[Oe.SPHERICAL_ECEF]:r2,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:null,[Oe.PLATE_CARREE]:i2,[Oe.WGS84]:Qn,[Oe.WGS84_ECEF]:s2},[Oe.PLATE_CARREE]:{[Oe.CGCS2000]:qS,[Oe.GCSMARS2000]:null,[Oe.GCSMOON2000]:null,[Oe.LON_LAT]:qS,[Oe.WGS84_COMPARABLE_LON_LAT]:qS,[Oe.SPHERICAL_ECEF]:Oot,[Oe.SPHERICAL_MARS_PCPF]:null,[Oe.SPHERICAL_MOON_PCPF]:null,[Oe.UNKNOWN]:null,[Oe.WEB_MERCATOR]:Pot,[Oe.PLATE_CARREE]:Qn,[Oe.WGS84]:qS,[Oe.WGS84_ECEF]:Rot}};function S5e(t){const e=_L(t,I5e);return CM[e][Oe.WGS84_COMPARABLE_LON_LAT]}function ooe(t,e,i=R5e()){return t==null||e==null?null:$ot(t,e,i).projector}function ZJt(t,e){switch(ooe(t,e,uoe)){case Qn:return"copy3";case r2:return"wgs84ToSphericalECEF";case t5:return"wgs84ToWebMercator";case i2:return"wgs84ToPlateCarree";case s2:return"wgs84ToWGS84ECEF";case pT:return"webMercatorToWGS84";case T5e:return"webMercatorToSphericalECEF";case E5e:return"webMercatorToWGS84ECEF";case C5e:return"webMercatorToPlateCarree";case o2:return"wgs84ECEFToWGS84";case O5e:return"wgs84ECEFToSphericalECEF";case P5e:return"wgs84ECEFToWebMercator";case n2:return"sphericalECEFToWGS84";case A5e:return"sphericalECEFToWebMercator";case BK:return"sphericalMarsPCPFToMars2000";case VK:return"sphericalMoonPCPFToMoon2000";case M5e:return"sphericalECEFToWGS84ECEF";case UK:return"mars2000ToSphericalPCPF";case zK:return"moon2000ToSphericalPCPF";default:return null}}function _L(t,e){return t?e.spatialReference===t?e.spatialReferenceId:(e.spatialReference=t,"metersPerUnit"in e&&(e.metersPerUnit=ws(t,1)),Az(t)?e.spatialReferenceId=Oe.SPHERICAL_ECEF:cL(t)?e.spatialReferenceId=Oe.WGS84:LT(t)?e.spatialReferenceId=Oe.WEB_MERCATOR:uL(t)?e.spatialReferenceId=Oe.PLATE_CARREE:t.wkt===FCe.wkt?e.spatialReferenceId=Oe.WGS84_ECEF:t.wkid===wf.CGCS2000?e.spatialReferenceId=Oe.CGCS2000:t.wkt===hB.wkt?e.spatialReferenceId=Oe.SPHERICAL_MARS_PCPF:t.wkt===dB.wkt?e.spatialReferenceId=Oe.SPHERICAL_MOON_PCPF:r1(t)?e.spatialReferenceId=Oe.GCSMARS2000:n1(t)?e.spatialReferenceId=Oe.GCSMOON2000:e.spatialReferenceId=Oe.UNKNOWN):Oe.UNKNOWN}function Qn(t,e,i,r){t!==i&&(i[r++]=t[e++],i[r++]=t[e++],i[r]=t[e])}function pT(t,e,i,r){i[r++]=r5*(t[e++]/Mr.radius),i[r++]=r5*(Math.PI/2-2*Math.atan(Math.exp(-t[e++]/Mr.radius))),i[r]=t[e]}function T5e(t,e,i,r){pT(t,e,i,r),r2(i,r,i,r)}function E5e(t,e,i,r){pT(t,e,i,r),s2(i,r,i,r)}function aoe(t,e,i,r,n){const s=.4999999*Math.PI,o=Je(i5*t[e+1],-s,s),l=Math.sin(o);i[r++]=i5*t[e]*n.radius,i[r++]=n.halfSemiMajorAxis*Math.log((1+l)/(1-l)),i[r]=t[e+2]}function t5(t,e,i,r){aoe(t,e,i,r,Mr)}const Kpe=Mr.radius*Math.PI/180,Qpe=180/(Mr.radius*Math.PI);function i2(t,e,i,r){i[r]=t[e]*Kpe,i[r+1]=t[e+1]*Kpe,i[r+2]=t[e+2]}function qS(t,e,i,r){i[r]=t[e]*Qpe,i[r+1]=t[e+1]*Qpe,i[r+2]=t[e+2]}function C5e(t,e,i,r){pT(t,e,i,r),i2(i,r,i,r)}function Aot(t,e,i,r){o2(t,e,i,r),i2(i,r,i,r)}function Mot(t,e,i,r){n2(t,e,i,r),i2(i,r,i,r)}function Oot(t,e,i,r){qS(t,e,i,r),r2(i,r,i,r)}function Pot(t,e,i,r){qS(t,e,i,r),t5(i,r,i,r)}function Rot(t,e,i,r){qS(t,e,i,r),s2(i,r,i,r)}function loe(t,e,i,r,n){const s=n+t[e+2],o=i5*t[e+1],l=i5*t[e],c=Math.cos(o);i[r++]=Math.cos(l)*c*s,i[r++]=Math.sin(l)*c*s,i[r]=Math.sin(o)*s}function zK(t,e,i,r){loe(t,e,i,r,u_.radius)}function UK(t,e,i,r){loe(t,e,i,r,Sy.radius)}function r2(t,e,i,r){loe(t,e,i,r,Mr.radius)}function coe(t,e,i,r,n){const s=t[e],o=t[e+1],l=t[e+2],c=Math.sqrt(s*s+o*o+l*l),f=Gf(l/(c===0?1:c)),_=Math.atan2(o,s);i[r++]=r5*_,i[r++]=r5*f,i[r]=c-n}function VK(t,e,i,r){coe(t,e,i,r,u_.radius)}function BK(t,e,i,r){coe(t,e,i,r,Sy.radius)}function n2(t,e,i,r){coe(t,e,i,r,Mr.radius)}function A5e(t,e,i,r){n2(t,e,i,r),t5(i,r,i,r)}function M5e(t,e,i,r){n2(t,e,i,r),s2(i,r,i,r)}function Iot(t,e,i,r,n){const s=i5*t[e],o=i5*t[e+1],l=t[e+2],c=Math.sin(o),f=Math.cos(o),_=n.radius/Math.sqrt(1-n.eccentricitySquared*c*c);i[r++]=(_+l)*f*Math.cos(s),i[r++]=(_+l)*f*Math.sin(s),i[r++]=(_*(1-n.eccentricitySquared)+l)*c}function s2(t,e,i,r){Iot(t,e,i,r,Mr)}function o2(t,e,i,r){const n=Eot,s=t[e],o=t[e+1],l=t[e+2];let c,f,_,x,T,A,M,I,L,F,z,k,U,j,H,Y,Q,ne,re,he,ce;c=Math.abs(l),f=s*s+o*o,_=Math.sqrt(f),x=f+l*l,T=Math.sqrt(x),he=Math.atan2(o,s),A=l*l/x,M=f/x,j=n.a2/T,H=n.a3-n.a4/T,M>.3?(I=c/T*(1+M*(n.a1+j+A*H)/T),re=Math.asin(I),F=I*I,L=Math.sqrt(1-F)):(L=_/T*(1-A*(n.a5-j-M*H)/T),re=Math.acos(L),F=1-L*L,I=Math.sqrt(F)),z=1-Mr.eccentricitySquared*F,k=Mr.radius/Math.sqrt(z),U=n.a6*k,j=_-k*L,H=c-U*I,Q=L*j+I*H,Y=L*H-I*j,ne=Y/(U/z+Q),re+=ne,ce=Q+Y*ne/2,l<0&&(re=-re),i[r++]=r5*he,i[r++]=r5*re,i[r]=ce}function O5e(t,e,i,r){o2(t,e,i,r),r2(i,r,i,r)}function P5e(t,e,i,r){o2(t,e,i,r),t5(i,r,i,r)}function $ot(t,e,i){if(t==null||e==null||i.source.spatialReference===t&&i.dest.spatialReference===e)return i;const r=_L(t,i.source),n=_L(e,i.dest);return r===Oe.UNKNOWN&&n===Oe.UNKNOWN?Zn(t,e)?i.projector=Qn:i.projector=null:i.projector=CM[r][n],i}function R5e(){return{source:{spatialReference:null,spatialReferenceId:Oe.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:Oe.UNKNOWN,metersPerUnit:1},projector:Qn}}const I5e={spatialReference:null,spatialReferenceId:Oe.UNKNOWN},Lot={spatialReference:null,spatialReferenceId:Oe.UNKNOWN},uoe=R5e(),i5=Ei(1),r5=pu(1);function vn(t,e,i,r,n,s,o=1){const l=ooe(e,n,uoe);if(l==null)return!1;if(l===Qn){if(t===r&&i===s)return!0;const f=i+3*o;for(let _=i,x=s;_=0;i--){const r=this.steps[i];e.steps.push(r.getInverse())}return e}getGTListEntry(){let e="";for(const i of this.steps)e+=i.uid.toString()+",";return e!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=e),this._gtlistentry}assignCachedGe(e,i,r){this._cachedProjection[M4.cacheKey(e,i)]=r}getCachedGeTransformation(e,i){let r="";for(const s of this.steps)r+=s.uid.toString()+",";r!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=r);const n=this._cachedProjection[M4.cacheKey(e,i)];return n===void 0?null:n}};function Dot(t,e,i){if(e==null||i==null||i.vcsWkid||Zn(e,i)||A2(e)||A2(i))return null;const r=Bf(e)/Bf(i);if(r===1)return null;switch(t){case"point":case"esriGeometryPoint":return n=>Not(n,r);case"polyline":case"esriGeometryPolyline":return n=>kot(n,r);case"polygon":case"esriGeometryPolygon":return n=>Fot(n,r);case"multipoint":case"esriGeometryMultipoint":return n=>zot(n,r);case"extent":case"esriGeometryEnvelope":return n=>Uot(n,r);default:return null}}function Not(t,e){(t==null?void 0:t.z)!=null&&(t.z*=e)}function Fot(t,e){if(t)for(const i of t.rings)for(const r of i)r.length>2&&(r[2]*=e)}function kot(t,e){if(t)for(const i of t.paths)for(const r of i)r.length>2&&(r[2]*=e)}function zot(t,e){if(t)for(const i of t.points)i.length>2&&(i[2]*=e)}function Uot(t,e){t&&t.zmin!=null&&t.zmax!=null&&(t.zmin*=e,t.zmax*=e)}let Mm=null,L2=null,s$=null,iF={};const hoe=new v9;function ox(){return!!Mm&&PCe()}function Vot(){return!!ox()||(wi(hoe),g_(),!1)}function g_(t){return s$==null&&(s$=Promise.all([RCe(),we(()=>Promise.resolve().then(()=>LVt),void 0).then(e=>e.g),we(()=>Promise.resolve().then(()=>VVt),void 0)])),s$.then(([,e,{hydratedAdapter:i}])=>{St(t),L2=i,Mm=e.default,Mm._enableProjection(vKe),hoe.notify()})}function rl(t,e,i=null,r=null){return Array.isArray(t)?t.length===0?[]:GK(L2,t,t[0].spatialReference,e,i,r):GK(L2,[t],t.spatialReference,e,i,r)[0]}function GK(t,e,i,r,n=null,s=null){if(i==null||r==null)return e;if(th(i,r,n))return e.map(o=>o$(o,i,r));if(n==null&&Az(i))return e.map(o=>o$(o,i,at.WGS84)).map(o=>bL(o,r));if(n==null&&Az(r))return e.map(o=>bL(o,at.WGS84)).map(o=>o$(o,at.WGS84,r));if(n==null){const o=Xz.cacheKey(i,r);iF[o]!==void 0?n=iF[o]:((n=D5e(i,r,void 0))==null&&(n=new Xz),iF[o]=n)}if(Mm==null||t==null)throw new ZB;return s!=null?Mm._project(t,e,i,r,n,s):Mm._project(t,e,i,r,n)}function $5e(t,e){const i=L5e([t],e);return i.pending!=null?{pending:i.pending,geometry:null}:i.geometries!=null?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function L5e(t,e){if(!ox()){for(const i of t)if(i!=null&&!Zn(i.spatialReference,e)&&wc(i.spatialReference)&&wc(e)&&!th(i.spatialReference,e))return wi(hoe),{pending:g_(),geometries:null}}return{pending:null,geometries:t.map(i=>i==null?null:Zn(i.spatialReference,e)?i:wc(i.spatialReference)&&wc(e)?bL(i,e):null)}}function D5e(t,e,i=null){if(t==null||e==null)return null;if(Mm==null||L2==null)throw new ZB;const r=Mm._getTransformation(L2,t,e,i,i==null?void 0:i.spatialReference);return r!==null?Xz.fromGE(r):null}function Bot(t,e,i=null){if(Mm==null||L2==null)throw new ZB;const r=Mm._getTransformationBySuitability(L2,t,e,i,i==null?void 0:i.spatialReference);if(r!==null){const n=[];for(const s of r)n.push(Xz.fromGE(s));return n}return[]}let ZB=class extends se{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}};function jot(){Mm=null,L2=null,s$=null,iF={}}const Got={get loadPromise(){return s$}};function bL(t,e){try{const i=rl(t,e);if(i==null)return null;"xmin"in t&&"xmin"in i&&(i.zmin=t.zmin,i.zmax=t.zmax);const r=Dot(i.type,t.spatialReference,e);return r!=null&&r(i),i}catch(i){if(!(i instanceof ZB))throw i;return null}}async function qy(t,e,i){const r=t.spatialReference;return r!=null&&e!=null&&await y_(r,e,null,i),bL(t,e)}function th(t,e,i){return!i&&(!!Zn(t,e)||wc(t)&&wc(e)&&!!ooe(t,e,uoe))}async function y_(t,e,i,r){if(ox())return Hk(r);if(Array.isArray(t)){for(const{source:n,dest:s,geographicTransformation:o}of t)if(!th(n,s,o))return g_(r)}else if(!th(t,e,i))return g_(r);return Hk(r)}function o$(t,e,i){return t?"x"in t?F5e(t,e,new mt,i,0):"xmin"in t?B5e(t,e,new Vi,i,0):"rings"in t?V5e(t,e,new Qa,i,0):"paths"in t?z5e(t,e,new xc,i,0):"points"in t?k5e(t,e,new Cm,i,0):null:null}function N5e(t,e,i=e.spatialReference,r=0){return i!=null&&t.spatialReference!=null&&F5e(t,t.spatialReference,e,i,r)!=null}function F5e(t,e,i,r,n){eu[0]=t.x,eu[1]=t.y;const s=t.z;return eu[2]=s!==void 0?s:n,vn(eu,e,0,eu,r,0,1)?(i.x=eu[0],i.y=eu[1],i.spatialReference=r,s!==void 0||A2(r)?(i.z=eu[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),t.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=t.m,i.hasM=!0),i):null}function Hot(t,e,i=e.spatialReference,r=0){return t.spatialReference!=null&&i!=null&&k5e(t,t.spatialReference,e,i,r)!=null}function k5e(t,e,i,r,n){const{points:s,hasZ:o,hasM:l}=t,c=[],f=s.length,_=[];for(const T of s)_.push(T[0],T[1],o?T[2]:n);if(!vn(_,e,0,_,r,0,f))return null;const x=o||A2(r);for(let T=0;T-1&&i.splice(r,1)}}function tfe(t,e,i){i?Xot(t,e):Zot(t,e)}async function tKt(t){const e=t.clone().normalize();let i;if(e.length>1)for(const r of e)i?r.width>i.width&&(i=r):i=r;else i=e[0];return Yot(i)}const HK={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map"};function ife(t){var c;const{portal:e,isOrgItem:i,itemControl:r}=t,n=(c=e.user)==null?void 0:c.privileges;let s=!n||n.includes("features:user:edit"),o=!!i&&!!(n!=null&&n.includes("features:user:fullEdit"));const l=r==="update"||r==="admin";return l?o=s=!0:o&&(s=!0),{features:{edit:s,fullEdit:o},content:{updateItem:l}}}const JB=t=>{let e=class extends t{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=et(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,r,n){if(r.itemId)return new Am({id:r.itemId,portal:n==null?void 0:n.portal})}writePortalItem(i,r){i!=null&&i.id&&(r.itemId=i.id)}async loadFromPortal(i,r){var n;if((n=this.portalItem)!=null&&n.id)try{const{load:s}=await we(()=>import("./layersLoader-5063dwjn.js"),__vite__mapDeps([43,38,36,35,44,45]));return St(r),await s({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},r)}catch(s){throw sn(s)||Ce.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${s}`),s}}async finishLoadEditablePortalLayer(i){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(i).catch(r=>(zo(r),!0)))}async setUserPrivileges(i,r){if(!Ar.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(r);if(this.url)try{const{features:{edit:n,fullEdit:s},content:{updateItem:o}}=await this._fetchUserPrivileges(i,r);this._set("userHasEditingPrivileges",n),this._set("userHasFullEditingPrivileges",s),this._set("userHasUpdateItemPrivileges",o)}catch(n){zo(n)}}async _fetchUserPrivileges(i,r){let n=this.portalItem;if(!i||!n||!n.loaded||n.sourceUrl)return this._fetchFallbackUserPrivileges(r);const s=i===n.id;if(s&&n.portal.user)return ife(n);let o,l;if(s)o=n.portal.url;else try{o=await UOe(this.url,r)}catch(x){zo(x)}if(!o||!DYe(o,n.portal.url))return this._fetchFallbackUserPrivileges(r);try{const x=r!=null?r.signal:null;l=await(yr==null?void 0:yr.getCredential(`${o}/sharing`,{prompt:!1,signal:x}))}catch(x){zo(x)}const c=!0,f=!1,_=!1;if(!l)return{features:{edit:c,fullEdit:f},content:{updateItem:_}};try{if(s?await n.reload():(n=new Am({id:i,portal:{url:o}}),await n.load(r)),n.portal.user)return ife(n)}catch(x){zo(x)}return{features:{edit:c,fullEdit:f},content:{updateItem:_}}}async _fetchFallbackUserPrivileges(i){let r=!0;try{r=await this._fetchUserHasEditingPrivileges(i)}catch(n){zo(n)}return{features:{edit:r,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(i){const r=this.url?yr==null?void 0:yr.findCredential(this.url):null;if(!r)return!0;const n=oD.credential===r?oD.user:await this._fetchEditingUser(i);return oD.credential=r,oD.user=n,(n==null?void 0:n.privileges)==null||n.privileges.includes("features:user:edit")}async _fetchEditingUser(i){var _,x;const r=(x=(_=this.portalItem)==null?void 0:_.portal)==null?void 0:x.user;if(r)return r;const n=yr.findServerInfo(this.url??"");if(!(n!=null&&n.owningSystemUrl))return null;const s=`${n.owningSystemUrl}/sharing/rest`,o=os.getDefault();if(o&&o.loaded&&Mf(o.restUrl)===Mf(s))return o.user;const l=`${s}/community/self`,c=i!=null?i.signal:null,f=await Ju(bi(l,{authMode:"no-prompt",query:{f:"json"},signal:c}));return f.ok?ese.fromJSON(f.value.data):null}read(i,r){r&&(r.layer=this),super.read(i,r)}write(i,r){var o;const n=r==null?void 0:r.portal,s=((o=this.portalItem)==null?void 0:o.id)&&(this.portalItem.portal||os.getDefault());return n&&s&&!dEe(s.restUrl,n.restUrl)?(r.messages&&r.messages.push(new se("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(i,{...r,layer:this})}};return y([w({type:Am})],e.prototype,"portalItem",null),y([$t("web-document","portalItem",["itemId"])],e.prototype,"readPortalItem",null),y([Pt("web-document","portalItem",{itemId:{type:String}})],e.prototype,"writePortalItem",null),y([w({clonable:!1})],e.prototype,"resourceReferences",void 0),y([w({type:Boolean,readOnly:!0})],e.prototype,"userHasEditingPrivileges",void 0),y([w({type:Boolean,readOnly:!0})],e.prototype,"userHasFullEditingPrivileges",void 0),y([w({type:Boolean,readOnly:!0})],e.prototype,"userHasUpdateItemPrivileges",void 0),e=y([Z("esri.layers.mixins.PortalLayer")],e),e},oD={credential:null,user:null};function H5e(t){return t&&"getAtOrigin"in t&&"originOf"in t}function Zz(t){t!=null&&t.writtenProperties&&t.writtenProperties.forEach(({target:e,propName:i,newOrigin:r})=>{H5e(e)&&r&&e.originOf(i)!==r&&e.updateOrigin(i,r)})}var O4;const Jz=fu()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),q5e=Jz.jsonValues.slice();Q$(q5e,"orthometric");const a$=fu()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let $0=O4=class extends Ue{constructor(t){super(t),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(t,e,i){return Jz.write(t,e,i)}readHeightModel(t,e,i){return Jz.read(t)||(i!=null&&i.messages&&i.messages.push(Jot(t,{context:i})),null)}readHeightUnit(t,e,i){return a$.read(t)||(i!=null&&i.messages&&i.messages.push(rfe(t,{context:i})),null)}readHeightUnitService(t,e,i){return VCe(t)||a$.read(t)||(i!=null&&i.messages&&i.messages.push(rfe(t,{context:i})),null)}readVertCRS(t,e){return e.vertCRS||e.ellipsoid||e.geoid}clone(){return new O4({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(t){return!!t&&(this===t||this.heightModel===t.heightModel&&this.heightUnit===t.heightUnit&&this.vertCRS===t.vertCRS)}static deriveUnitFromSR(t,e){const i=BCe(e);return new O4({heightModel:t.heightModel,heightUnit:i,vertCRS:t.vertCRS})}write(t,e){return e={origin:"web-scene",...e},super.write(t,e)}static fromJSON(t){if(!t)return null;const e=new O4;return e.read(t,{origin:"web-scene"}),e}};function rfe(t,e){return new Uf("height-unit:unsupported",`Height unit of value '${t}' is not supported`,e)}function Jot(t,e){return new Uf("height-model:unsupported",`Height model of value '${t}' is not supported`,e)}y([w({type:Jz.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:q5e,default:"ellipsoidal"}}}})],$0.prototype,"heightModel",void 0),y([Pt("web-scene","heightModel")],$0.prototype,"writeHeightModel",null),y([$t(["web-scene","service"],"heightModel")],$0.prototype,"readHeightModel",null),y([w({type:a$.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:a$.jsonValues,write:a$.write}}}})],$0.prototype,"heightUnit",void 0),y([$t("web-scene","heightUnit")],$0.prototype,"readHeightUnit",null),y([$t("service","heightUnit")],$0.prototype,"readHeightUnitService",null),y([w({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],$0.prototype,"vertCRS",void 0),y([$t("service","vertCRS",["vertCRS","ellipsoid","geoid"])],$0.prototype,"readVertCRS",null),$0=O4=y([Z("esri.geometry.HeightModelInfo")],$0);const N_=$0;async function Kot(t,e,i,r,n,s){let o=null;if(i!=null){const _=`${t}/nodepages/`,x=_+Math.floor(i.rootIndex/i.nodesPerPage);try{return{type:"page",rootPage:(await bi(x,{query:{f:"json",token:r},responseType:"json",signal:s})).data,rootIndex:i.rootIndex,pageSize:i.nodesPerPage,lodMetric:i.lodSelectionMetricType,urlPrefix:_}}catch(T){n!=null&&n.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",x,T),o=T}}if(!e)return null;const l=e==null?void 0:e.split("/").pop(),c=`${t}/nodes/`,f=c+l;try{return{type:"node",rootNode:(await bi(f,{query:{f:"json",token:r},responseType:"json",signal:s})).data,urlPrefix:c}}catch(_){throw new se("sceneservice:root-node-missing","Root node missing.",{pageError:o,nodeError:_,url:f})}}let Qot=null;function eat(){return Qot}function Kz(t){if(Ar.apiKey&&$ne(t.portal.url))throw new se("save-api-key-utils:api-key-not-supported",`Saving is not supported on ${t.portal.url} when using an api key`)}async function tat(t,e={},i){await t.load(i);const r=s0(t.itemUrl,"resources"),{start:n=1,num:s=10,sortOrder:o="asc",sortField:l="created"}=e,c={query:{start:n,num:s,sortOrder:o,sortField:l,token:t.apiKey},signal:i==null?void 0:i.signal},f=await t.portal.request(r,c);return{total:f.total,nextStart:f.nextStart,resources:f.resources.map(({created:_,size:x,resource:T})=>({created:new Date(_),size:x,resource:t.resourceFromPath(T)}))}}async function iat(t,e,i,r){if(!t.hasPath())throw new se(`portal-item-resource-${e}:invalid-path`,"Resource does not have a valid path");const n=t.portalItem;await n.load(r);const s=s0(n.userItemUrl,e==="add"?"addResources":"updateResources"),[o,l]=W5e(t.path),c=new FormData;return o&&o!=="."&&c.append("resourcesPrefix",o),r!=null&&r.compress&&c.append("compress","true"),c.append("fileName",l),c.append("file",i,l),c.append("f","json"),r!=null&&r.access&&c.append("access",r.access),await n.portal.request(s,{method:"post",body:c,signal:r==null?void 0:r.signal}),t}async function rat(t,e,i){if(!e.hasPath())throw new se("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await t.load(i);const r=s0(t.userItemUrl,"removeResources");await t.portal.request(r,{method:"post",query:{resource:e.path},signal:i==null?void 0:i.signal}),e.portalItem=null}async function nat(t,e){await t.load(e);const i=s0(t.userItemUrl,"removeResources");return t.portal.request(i,{method:"post",query:{deleteAll:!0},signal:e==null?void 0:e.signal})}function W5e(t){const e=t.lastIndexOf("/");return e===-1?[".",t]:[t.slice(0,e),t.slice(e+1)]}function doe(t){const[e,i]=sat(t),[r,n]=W5e(e);return[r,n,i]}function sat(t){const e=Rne(t);return e==null?[t,""]:[t.slice(0,t.length-e.length-1),`.${e}`]}async function poe(t){return t.type==="blob"?t.blob:t.type==="json"?new Blob([t.jsonString],{type:"application/json"}):(await bi(t.url,{responseType:"blob"})).data}function oat(t,e){if(!t.hasPath())return null;const[i,,r]=doe(t.path);return t.portalItem.resourceFromPath(s0(i,e+r))}function Y5e(t,e){if(!t.hasPath())return null;const[i,,r]=doe(t.path);return t.portalItem.resourceFromPath(s0(i,e+r))}const P4=Object.freeze(Object.defineProperty({__proto__:null,addOrUpdateResource:iat,contentToBlob:poe,fetchResources:tat,getSiblingOfSameType:oat,getSiblingOfSameTypeI:Y5e,removeAllResources:nat,removeResource:rat,splitPrefixFileNameAndExtension:doe},Symbol.toStringTag,{value:"Module"}));async function X5e(t,e,i=null){const r=await J5e(t,e,i);await K5e(r,e,i)}async function Z5e(t,e,i,r,n=null){const s=await J5e(i,r,n);await t.update({data:e}),await K5e(s,r,n)}async function J5e(t,e,i=null){if(!(e!=null&&e.resources))return;const r=e.portalItem===t.portalItem?new Set(t.paths):new Set;t.paths.length=0,t.portalItem=e.portalItem;const n=new Set(e.resources.toKeep.map(c=>c.resource.path)),s=new Set,o=[];n.forEach(c=>{r.delete(c),t.paths.push(c)});for(const c of e.resources.toUpdate)if(r.delete(c.resource.path),n.has(c.resource.path)||s.has(c.resource.path)){const{resource:f,content:_,finish:x,error:T}=c,A=Y5e(f,Vf());t.paths.push(A.path),o.push(nfe({resource:A,content:_,compress:c.compress,finish:x,error:T},i))}else t.paths.push(c.resource.path),o.push(aat(c,i)),s.add(c.resource.path);for(const c of e.resources.toAdd)t.paths.push(c.resource.path),r.has(c.resource.path)?r.delete(c.resource.path):o.push(nfe(c,i));if(o.length===0)return r;const l=await xGe(o);if(St(i),l.length>0)throw new se("save:resources","Failed to save one or more resources",{errors:l});return r}async function K5e(t,e,i=null){if(!t||!e.portalItem)return;const r=[];for(const n of t){const s=e.portalItem.resourceFromPath(n);r.push(s.portalItem.removeResource(s,i))}await Uv(r)}async function nfe(t,e){var n,s;const i={...e??{},compress:t.compress},r=await Ju(t.resource.portalItem.addResource(t.resource,await poe(t.content),i));if(r.ok!==!0)throw(n=t.error)==null||n.call(t,r.error),r.error;(s=t.finish)==null||s.call(t,t.resource)}async function aat(t,e){var r,n;const i=await Ju(t.resource.update(await poe(t.content),e));if(i.ok!==!0)throw(r=t.error)==null||r.call(t,i.error),i.error;(n=t.finish)==null||n.call(t,t.resource)}async function lat(t){const e=[];for(const i of t.allLayers)if("beforeSave"in i&&typeof i.beforeSave=="function"){const r=i.beforeSave();r&&e.push(r)}await Promise.allSettled(e)}const Q5e="esri.layers.mixins.SceneService",DH=Ce.getLogger(Q5e),cat=t=>{let e=class extends t{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=X5(async(i,r,n)=>{switch(i){case n5.SAVE:return this._save(r);case n5.SAVE_AS:return this._saveAs(n,r)}})}readSpatialReference(i,r){return this._readSpatialReference(r)}_readSpatialReference(i){if(i.spatialReference!=null)return at.fromJSON(i.spatialReference);{const r=i.store,n=r.indexCRS||r.geographicCRS,s=n&&parseInt(n.substring(n.lastIndexOf("/")+1,n.length),10);return s!=null?new at(s):null}}readFullExtent(i,r,n){if(i!=null&&typeof i=="object"){const l=i.spatialReference==null?{...i,spatialReference:this._readSpatialReference(r)}:i;return Vi.fromJSON(l,n)}const s=r.store,o=this._readSpatialReference(r);return o==null||(s==null?void 0:s.extent)==null||!Array.isArray(s.extent)||s.extent.some(l=>l=2&&(r.major=parseInt(n[0],10),r.minor=parseInt(n[1],10)),r}readVersion(i,r){const n=r.store,s=n.version!=null?n.version.toString():"";return this.parseVersionString(s)}readTitlePortalItem(i){return this.sublayerTitleMode!=="item-title"?void 0:i}readTitleService(i,r){var o;const n=(o=this.portalItem)==null?void 0:o.title;if(this.sublayerTitleMode==="item-title")return Yst(this.url,r.name);let s=r.name;if(!s&&this.url){const l=vE(this.url);l!=null&&(s=l.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&n&&(s=n+" - "+s),roe(s)}set url(i){const r=Zst({layer:this,url:i,nonStandardUrlAllowed:!1,logger:DH});this._set("url",r.url),r.layerId!=null&&this._set("layerId",r.layerId)}writeUrl(i,r,n,s){Jst(this,i,"layers",r,s)}get parsedUrl(){const i=this._get("url"),r=qs(i);return this.layerId!=null&&(r.path=`${r.path}/layers/${this.layerId}`),r}async _fetchIndexAndUpdateExtent(i,r){this.indexInfo=Kot(this.parsedUrl.path,this.rootNode,i,this.apiKey,DH,r),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(i){var r,n,s,o;if((i==null?void 0:i.type)==="page"){const l=i.rootIndex%i.pageSize,c=(n=(r=i.rootPage)==null?void 0:r.nodes)==null?void 0:n[l];if(((s=c==null?void 0:c.obb)==null?void 0:s.center)==null||c.obb.halfSize==null)throw new se("sceneservice:invalid-node-page","Invalid node page.");if(c.obb.center[0]0)return r.data.layers[0].id}async _fetchServiceLayer(i){var o;const r=await bi(((o=this.parsedUrl)==null?void 0:o.path)??"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:i});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let n=!1;if(r.data.layerType&&r.data.layerType==="Voxel"&&(n=!0),n)return this._fetchVoxelServiceLayer();const s=r.data;this.read(s,this._getServiceContext()),this.validateLayer(s)}async _fetchVoxelServiceLayer(i){var n;const r=(await bi(((n=this.parsedUrl)==null?void 0:n.path)+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:i})).data;this.read(r,this._getServiceContext()),this.validateLayer(r)}_getServiceContext(){var i;return{origin:"service",portalItem:this.portalItem,portal:(i=this.portalItem)==null?void 0:i.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(i){}_updateTypeKeywords(i,r,n){i.typeKeywords||(i.typeKeywords=[]);const s=r.getTypeKeywords();for(const o of s)i.typeKeywords.push(o);i.typeKeywords&&(i.typeKeywords=i.typeKeywords.filter((o,l,c)=>c.indexOf(o)===l),n===l$.newItem&&(i.typeKeywords=i.typeKeywords.filter(o=>o!=="Hosted Service")))}async _saveAs(i,r){var f;const n={...sfe,...r};let s=Am.from(i);if(!s)throw new se("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");Kz(s),s.id&&(s=s.clone(),s.id=null);const o=s.portal||os.getDefault();await this._ensureLoadBeforeSave(),s.type=FH,s.portal=o;const l={origin:"portal-item",url:null,messages:[],portal:o,portalItem:s,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},c={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(c,l,n),s.url=this.url,s.title||(s.title=this.title),this._updateTypeKeywords(s,n,l$.newItem),await o.signIn(),await((f=o.user)==null?void 0:f.addItem({item:s,folder:n==null?void 0:n.folder,data:c})),await X5e(this.resourceReferences,l,null),this.portalItem=s,Zz(l),l.portalItem=s,s}async _save(i){const r={...sfe,...i};if(!this.portalItem)throw new se("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(Kz(this.portalItem),this.portalItem.type!==FH)throw new se("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${FH}"`);await this._ensureLoadBeforeSave();const n={origin:"portal-item",url:this.portalItem.itemUrl&&qs(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||os.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},s={layers:[this.write({},n)]};return await Promise.all(n.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(s,n,r),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,r,l$.existingItem),await Z5e(this.portalItem,s,this.resourceReferences,n,null),Zz(n),this.portalItem}async _validateAgainstJSONSchema(i,r,n){var f,_;let s=((f=r.messages)==null?void 0:f.filter(x=>x.type==="error").map(x=>new se(x.name,x.message,x.details)))??[];(_=n==null?void 0:n.validationOptions)!=null&&_.ignoreUnsupported&&(s=s.filter(x=>x.name!=="layer:unsupported"&&x.name!=="symbol:unsupported"&&x.name!=="symbol-layer:unsupported"&&x.name!=="property:unsupported"&&x.name!=="url:unsupported"&&x.name!=="scenemodification:unsupported"));const o=n==null?void 0:n.validationOptions,l=o==null?void 0:o.enabled,c=eat();if(l&&c){const x=(await c()).validate(i,n.portalItemLayerType);if(x.length>0){const T=`Layer item did not validate: +${x.join(` +`)}`;if(DH.error(`_validateAgainstJSONSchema(): ${T}`),o.failPolicy==="throw"){const A=x.map(M=>new se("sceneservice:schema-validation",M)).concat(s);throw new se("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:A})}}}if(s.length>0)throw new se("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:s})}};return y([w(_ot)],e.prototype,"id",void 0),y([w({type:at})],e.prototype,"spatialReference",void 0),y([$t("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],e.prototype,"readSpatialReference",null),y([w({type:Vi})],e.prototype,"fullExtent",void 0),y([$t("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],e.prototype,"readFullExtent",null),y([w({readOnly:!0,type:N_})],e.prototype,"heightModelInfo",void 0),y([w({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],e.prototype,"minScale",void 0),y([w({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],e.prototype,"maxScale",void 0),y([w({readOnly:!0})],e.prototype,"version",void 0),y([$t("version",["store.version"])],e.prototype,"readVersion",null),y([w({type:String,json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),y([w({type:String,json:{read:!1}})],e.prototype,"sublayerTitleMode",void 0),y([w({type:String})],e.prototype,"title",void 0),y([$t("portal-item","title")],e.prototype,"readTitlePortalItem",null),y([$t("service","title",["name"])],e.prototype,"readTitleService",null),y([w({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],e.prototype,"layerId",void 0),y([w(soe)],e.prototype,"url",null),y([Pt("url")],e.prototype,"writeUrl",null),y([w()],e.prototype,"parsedUrl",null),y([w({readOnly:!0})],e.prototype,"store",void 0),y([w({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],e.prototype,"rootNode",void 0),e=y([Z(Q5e)],e),e},NH=-1e38;var l$;(function(t){t[t.existingItem=0]="existingItem",t[t.newItem=1]="newItem"})(l$||(l$={}));const FH="Scene Service",sfe={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var n5;(function(t){t[t.SAVE=0]="SAVE",t[t.SAVE_AS=1]="SAVE_AS"})(n5||(n5={}));async function uat(t,e){const i=vE(t);if(!i)throw new se("invalid-url","Invalid scene service url");const r={...e,sceneServerUrl:i.url.path,layerId:i.sublayer??void 0};if(r.sceneLayerItem??(r.sceneLayerItem=await hat(r)),r.sceneLayerItem==null)return ofe(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const n=await pat(r);if(!(n!=null&&n.url))throw new se("related-service-not-found","Could not find feature service through portal item relationship");const s=await ofe(n.url,r);return s.portalItem=n,s}async function hat(t){const e=(await ePe(t)).serviceItemId;if(!e)return null;const i=new Am({id:e,apiKey:t.apiKey}),r=await dat(t);r!=null&&(i.portal=new os({url:r}));try{return i.load({signal:t.signal})}catch(n){return zo(n),null}}async function ePe(t){if(t.rootDocument)return t.rootDocument;const e={query:{f:"json",token:t.apiKey},responseType:"json",signal:t.signal};try{const i=await bi(t.sceneServerUrl,e);t.rootDocument=i.data}catch{t.rootDocument={}}return t.rootDocument}async function dat(t){const e=yr==null?void 0:yr.findServerInfo(t.sceneServerUrl);if(e!=null&&e.owningSystemUrl)return e.owningSystemUrl;const i=t.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await bi(i,{query:{f:"json"},responseType:"json",signal:t.signal})).data.owningSystemUrl;if(r)return r}catch(r){zo(r)}return null}async function ofe(t,e){const i=vE(t);if(!i)throw new se("invalid-feature-service-url","Invalid feature service url");const r=i.url.path,n=e.layerId;if(n==null)return{serverUrl:r};const s=ePe(e),o=T=>{const A={query:{f:"json"},responseType:"json",authMode:T,signal:e.signal};return bi(r,A)},l=o("anonymous").catch(()=>o("no-prompt")),[c,f]=await Promise.all([l,s]),_=f==null?void 0:f.layers,x=c.data&&c.data.layers;if(!Array.isArray(x))throw new Error("expected layers array");if(Array.isArray(_)){for(let T=0;Tn.type==="Feature Service")||null;if(!i)return null;const r=new Am({portal:i.portal,id:i.id});return await r.load(),r}catch(i){return zo(i),null}}const fat={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};var qK;let R4=qK=class extends Ue{constructor(t){super(t),this.name=null,this.code=null}clone(){return new qK({name:this.name,code:this.code})}};y([w({type:String,json:{write:!0}})],R4.prototype,"name",void 0),y([w({type:[String,Number],json:{write:!0}})],R4.prototype,"code",void 0),R4=qK=y([Z("esri.layers.support.CodedValue")],R4);const mat=new yn({inherited:"inherited",codedValue:"coded-value",range:"range"});let I4=class extends Ue{constructor(e){super(e),this.name=null,this.type=null}};y([w({type:String,json:{write:!0}})],I4.prototype,"name",void 0),y([Vt(mat)],I4.prototype,"type",void 0),I4=y([Z("esri.layers.support.Domain")],I4);const KB=I4;var WK;let $4=WK=class extends KB{constructor(t){super(t),this.codedValues=null,this.type="coded-value"}getName(t){let e=null;if(this.codedValues){const i=String(t);this.codedValues.some(r=>(String(r.code)===i&&(e=r.name),!!e))}return e}clone(){return new WK({codedValues:Re(this.codedValues),name:this.name})}};y([w({type:[R4],json:{write:!0}})],$4.prototype,"codedValues",void 0),y([Vt({codedValue:"coded-value"})],$4.prototype,"type",void 0),$4=WK=y([Z("esri.layers.support.CodedValueDomain")],$4);const tPe=$4;var YK;let rF=YK=class extends KB{constructor(t){super(t),this.type="inherited"}clone(){return new YK}};y([Vt({inherited:"inherited"})],rF.prototype,"type",void 0),rF=YK=y([Z("esri.layers.support.InheritedDomain")],rF);const iPe=rF;var XK;let xA=XK=class extends KB{constructor(t){super(t),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new XK({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};y([w({json:{type:[Number],read:{source:"range",reader:(t,e)=>{var i;return(i=e.range)==null?void 0:i[1]}},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(t,e,i){e[i]=[this.minValue||0,t]}}}})],xA.prototype,"maxValue",void 0),y([w({json:{type:[Number],read:{source:"range",reader:(t,e)=>{var i;return(i=e.range)==null?void 0:i[0]}},write:{target:"range",writer(t,e,i){e[i]=[t,this.maxValue||0]}}}})],xA.prototype,"minValue",void 0),y([Vt({range:"range"})],xA.prototype,"type",void 0),xA=XK=y([Z("esri.layers.support.RangeDomain")],xA);const rPe=xA,gat={key:"type",base:KB,typeMap:{range:rPe,"coded-value":tPe,inherited:iPe}};function yat(t){if(!(t!=null&&t.type))return null;switch(t.type){case"range":return rPe.fromJSON(t);case"codedValue":return tPe.fromJSON(t);case"inherited":return iPe.fromJSON(t)}return null}const foe=new yn({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});var ZK;const vat=new yn({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let Hc=ZK=class extends Ue{constructor(t){super(t),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(t,{description:e}){let i=null;try{i=e?JSON.parse(e):null}catch{}return(i==null?void 0:i.value)??null}readValueType(t,{description:e}){let i=null;try{i=e?JSON.parse(e):null}catch{}return i?vat.fromJSON(i.fieldValueType):null}clone(){return new ZK({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};y([w({type:String,json:{write:!0}})],Hc.prototype,"alias",void 0),y([w({type:[String,Number],json:{write:{allowNull:!0}}})],Hc.prototype,"defaultValue",void 0),y([w()],Hc.prototype,"description",void 0),y([$t("description")],Hc.prototype,"readDescription",null),y([w({types:gat,json:{read:{reader:yat},write:!0}})],Hc.prototype,"domain",void 0),y([w({type:Boolean,json:{write:!0}})],Hc.prototype,"editable",void 0),y([w({type:$n,json:{write:{overridePolicy:t=>({enabled:Number.isFinite(t)})}}})],Hc.prototype,"length",void 0),y([w({type:String,json:{write:!0}})],Hc.prototype,"name",void 0),y([w({type:Boolean,json:{write:!0}})],Hc.prototype,"nullable",void 0),y([Vt(foe)],Hc.prototype,"type",void 0),y([w()],Hc.prototype,"valueType",void 0),y([$t("valueType",["description"])],Hc.prototype,"readValueType",null),y([w({type:Boolean,json:{read:!1}})],Hc.prototype,"visible",void 0),Hc=ZK=y([Z("esri.layers.support.Field")],Hc);const moe=Hc;var JK;let SA=JK=class extends Ue{constructor(t){super(t),this.type="map-layer"}clone(){const{mapLayerId:t,gdbVersion:e}=this;return new JK({mapLayerId:t,gdbVersion:e})}};y([Vt({mapLayer:"map-layer"})],SA.prototype,"type",void 0),y([w({type:$n,json:{write:!0}})],SA.prototype,"mapLayerId",void 0),y([w({type:String,json:{write:!0}})],SA.prototype,"gdbVersion",void 0),SA=JK=y([Z("esri.layers.support.source.MapLayerSource")],SA);var KK;let Z1=KK=class extends Ue{constructor(t){super(t),this.type="query-table"}clone(){const{workspaceId:t,query:e,oidFields:i,spatialReference:r,geometryType:n}=this,s={workspaceId:t,query:e,oidFields:i,spatialReference:(r==null?void 0:r.clone())??void 0,geometryType:n};return new KK(s)}};y([Vt({queryTable:"query-table"})],Z1.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],Z1.prototype,"workspaceId",void 0),y([w({type:String,json:{write:!0}})],Z1.prototype,"query",void 0),y([w({type:String,json:{write:!0}})],Z1.prototype,"oidFields",void 0),y([w({type:at,json:{write:!0}})],Z1.prototype,"spatialReference",void 0),y([Vt(UAe)],Z1.prototype,"geometryType",void 0),Z1=KK=y([Z("esri.layers.support.source.QueryTableDataSource")],Z1);var QK;let TA=QK=class extends Ue{constructor(t){super(t),this.type="raster"}clone(){const{workspaceId:t,dataSourceName:e}=this;return new QK({workspaceId:t,dataSourceName:e})}};y([Vt({raster:"raster"})],TA.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],TA.prototype,"dataSourceName",void 0),y([w({type:String,json:{write:!0}})],TA.prototype,"workspaceId",void 0),TA=QK=y([Z("esri.layers.support.source.RasterDataSource")],TA);var eQ;let $3=eQ=class extends Ue{constructor(t){super(t),this.type="table"}clone(){const{workspaceId:t,gdbVersion:e,dataSourceName:i}=this;return new eQ({workspaceId:t,gdbVersion:e,dataSourceName:i})}};y([Vt({table:"table"})],$3.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],$3.prototype,"workspaceId",void 0),y([w({type:String,json:{write:!0}})],$3.prototype,"gdbVersion",void 0),y([w({type:String,json:{write:!0}})],$3.prototype,"dataSourceName",void 0),$3=eQ=y([Z("esri.layers.support.source.TableDataSource")],$3);var tQ,iQ;const _at=fu()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let Pd=tQ=class extends Ue{constructor(t){super(t),this.type="join-table"}readLeftTableSource(t,e,i){return afe()(t,e,i)}castLeftTableSource(t){return zy(rQ(),t)}readRightTableSource(t,e,i){return afe()(t,e,i)}castRightTableSource(t){return zy(rQ(),t)}clone(){const{leftTableKey:t,rightTableKey:e,leftTableSource:i,rightTableSource:r,joinType:n}=this,s={leftTableKey:t,rightTableKey:e,leftTableSource:(i==null?void 0:i.clone())??void 0,rightTableSource:(r==null?void 0:r.clone())??void 0,joinType:n};return new tQ(s)}};y([Vt({joinTable:"join-table"})],Pd.prototype,"type",void 0),y([w({type:String,json:{write:!0}})],Pd.prototype,"leftTableKey",void 0),y([w({type:String,json:{write:!0}})],Pd.prototype,"rightTableKey",void 0),y([w({json:{write:!0}})],Pd.prototype,"leftTableSource",void 0),y([$t("leftTableSource")],Pd.prototype,"readLeftTableSource",null),y([Ci("leftTableSource")],Pd.prototype,"castLeftTableSource",null),y([w({json:{write:!0}})],Pd.prototype,"rightTableSource",void 0),y([$t("rightTableSource")],Pd.prototype,"readRightTableSource",null),y([Ci("rightTableSource")],Pd.prototype,"castRightTableSource",null),y([Vt(_at)],Pd.prototype,"joinType",void 0),Pd=tQ=y([Z("esri.layers.support.source.JoinTableDataSource")],Pd);let kH=null;function afe(){return kH||(kH=Z5({types:rQ()})),kH}let zH=null;function rQ(){return zH||(zH={key:"type",base:null,typeMap:{"data-layer":ty,"map-layer":SA}}),zH}const bat={key:"type",base:null,typeMap:{"join-table":Pd,"query-table":Z1,raster:TA,table:$3}};let ty=iQ=class extends Ue{constructor(t){super(t),this.type="data-layer"}clone(){const{fields:t,dataSource:e}=this;return new iQ({fields:t,dataSource:e})}};y([Vt({dataLayer:"data-layer"})],ty.prototype,"type",void 0),y([w({type:[moe],json:{write:!0}})],ty.prototype,"fields",void 0),y([w({types:bat,json:{write:!0}})],ty.prototype,"dataSource",void 0),ty=iQ=y([Z("esri.layers.support.source.DataLayerSource")],ty),ty.from=$s(ty);let L3=class extends Xs(Ue){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};y([w({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],L3.prototype,"onFields",void 0),y([w({type:String,json:{write:!0}})],L3.prototype,"operator",void 0),y([w({type:String,json:{write:!0}})],L3.prototype,"searchTerm",void 0),y([w({type:String,json:{write:!0}})],L3.prototype,"searchType",void 0),L3=y([Z("esri.rest.support.FullTextSearch")],L3);const nPe=L3;var nQ;const lfe=new yn({upperLeft:"upper-left",lowerLeft:"lower-left"});let D3=nQ=class extends Ue{constructor(t){super(t),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new nQ(Re({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};y([w({type:Vi,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],D3.prototype,"extent",void 0),y([w({type:["view","edit"],json:{write:!0}})],D3.prototype,"mode",void 0),y([w({type:String,json:{read:lfe.read,write:lfe.write}})],D3.prototype,"originPosition",void 0),y([w({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],D3.prototype,"tolerance",void 0),D3=nQ=y([Z("esri.rest.support.QuantizationParameters")],D3);const wat=D3;var sQ;const cfe=new yn({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let L0=sQ=class extends Ue{constructor(t){super(t),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(t,e){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(e.statisticParameters=Re(t))}clone(){return new sQ({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:Re(this.statisticParameters)})}};y([w({type:Number,json:{write:!0}})],L0.prototype,"maxPointCount",void 0),y([w({type:Number,json:{write:!0}})],L0.prototype,"maxRecordCount",void 0),y([w({type:Number,json:{write:!0}})],L0.prototype,"maxVertexCount",void 0),y([w({type:String,json:{write:!0}})],L0.prototype,"onStatisticField",void 0),y([w({type:String,json:{write:!0}})],L0.prototype,"outStatisticFieldName",void 0),y([w({type:String,json:{read:{source:"statisticType",reader:cfe.read},write:{target:"statisticType",writer:cfe.write}}})],L0.prototype,"statisticType",void 0),y([w({type:Object})],L0.prototype,"statisticParameters",void 0),y([Pt("statisticParameters")],L0.prototype,"writeStatisticParameters",null),L0=sQ=y([Z("esri.rest.support.StatisticDefinition")],L0);const xat=L0;var nF;const Sat=new yn({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),Tat=new yn({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Si=nF=class extends Ue{static from(t){return MT(nF,t)}constructor(t){super(t),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}castDatumTransformation(t){return typeof t=="number"||typeof t=="object"?t:null}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeParameterValues(t,e){if(t){const i={};for(const r in t){const n=t[r];Array.isArray(n)?i[r]=n.map(s=>s instanceof Date?s.getTime():s):n instanceof Date?i[r]=n.getTime():i[r]=n}e.parameterValues=i}}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,e.where="1=1"}writeWhere(t,e){e.where=t||"1=1"}clone(){return new nF(Re({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};Si.MAX_MAX_RECORD_COUNT_FACTOR=5,y([w({json:{write:!0}})],Si.prototype,"aggregateIds",void 0),y([w({type:Boolean,json:{write:!0}})],Si.prototype,"cacheHint",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"compactGeometryEnabled",void 0),y([w({json:{write:!0}})],Si.prototype,"datumTransformation",void 0),y([Ci("datumTransformation")],Si.prototype,"castDatumTransformation",null),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"defaultSpatialReferenceEnabled",void 0),y([w({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],Si.prototype,"distance",void 0),y([w({type:ty,json:{write:!0}})],Si.prototype,"dynamicDataSource",void 0),y([w({type:String,json:{write:!0}})],Si.prototype,"formatOf3DObjects",void 0),y([w({type:[nPe],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],Si.prototype,"fullText",void 0),y([w({type:String,json:{write:!0}})],Si.prototype,"gdbVersion",void 0),y([w({types:I9,json:{read:O2,write:!0}})],Si.prototype,"geometry",void 0),y([w({type:Number,json:{write:!0}})],Si.prototype,"geometryPrecision",void 0),y([w({type:[String],json:{write:!0}})],Si.prototype,"groupByFieldsForStatistics",void 0),y([w({type:String,json:{write:!0}})],Si.prototype,"having",void 0),y([w({type:Date})],Si.prototype,"historicMoment",void 0),y([Pt("historicMoment")],Si.prototype,"writeHistoricMoment",null),y([w({type:Number,json:{write:!0}})],Si.prototype,"maxAllowableOffset",void 0),y([w({type:Number,cast:t=>t<1?1:t>Si.MAX_MAX_RECORD_COUNT_FACTOR?Si.MAX_MAX_RECORD_COUNT_FACTOR:t,json:{write:{overridePolicy:t=>({enabled:t>1})}}})],Si.prototype,"maxRecordCountFactor",void 0),y([w({type:["xyFootprint"],json:{write:!0}})],Si.prototype,"multipatchOption",void 0),y([w({type:Number,json:{read:{source:"resultRecordCount"}}})],Si.prototype,"num",void 0),y([w({json:{write:!0}})],Si.prototype,"objectIds",void 0),y([w({type:[String],json:{write:!0}})],Si.prototype,"orderByFields",void 0),y([w({type:[String],json:{write:!0}})],Si.prototype,"outFields",void 0),y([w({type:at,json:{name:"outSR",write:!0}})],Si.prototype,"outSpatialReference",void 0),y([w({type:[xat],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],Si.prototype,"outStatistics",void 0),y([w({json:{write:!0}})],Si.prototype,"parameterValues",void 0),y([Pt("parameterValues")],Si.prototype,"writeParameterValues",null),y([w({type:mt,json:{write:!0}})],Si.prototype,"pixelSize",void 0),y([w({type:wat,json:{write:!0}})],Si.prototype,"quantizationParameters",void 0),y([w({type:[Object],json:{write:!0}})],Si.prototype,"rangeValues",void 0),y([w({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],Si.prototype,"relationParameter",void 0),y([w({type:String,json:{write:!0}})],Si.prototype,"resultType",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"returnCentroid",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"returnDistinctValues",void 0),y([w({type:Boolean,json:{default:!0,write:!0}})],Si.prototype,"returnExceededLimitFeatures",void 0),y([w({type:Boolean,json:{write:!0}})],Si.prototype,"returnGeometry",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"returnQueryGeometry",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"returnM",void 0),y([w({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Si.prototype,"returnZ",void 0),y([w({type:at,json:{write:!0}})],Si.prototype,"sourceSpatialReference",void 0),y([Vt(Sat,{ignoreUnknown:!1,name:"spatialRel"})],Si.prototype,"spatialRelationship",void 0),y([w({type:Number,json:{read:{source:"resultOffset"}}})],Si.prototype,"start",void 0),y([Pt("start"),Pt("num")],Si.prototype,"writeStart",null),y([w({type:String,json:{write:!0}})],Si.prototype,"sqlFormat",void 0),y([w({type:String,json:{write:!0}})],Si.prototype,"text",void 0),y([w({type:D_,json:{write:!0}})],Si.prototype,"timeExtent",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Si.prototype,"timeReferenceUnknownClient",void 0),y([Vt(Tat,{ignoreUnknown:!1}),w({json:{write:{overridePolicy(t){return{enabled:!!t&&this.distance!=null&&this.distance>0}}}}})],Si.prototype,"units",void 0),y([w({type:String,json:{write:{overridePolicy(t){return{enabled:t!=null||this.start!=null&&this.start>0}}}}})],Si.prototype,"where",void 0),y([Pt("where")],Si.prototype,"writeWhere",null),Si=nF=y([Z("esri.rest.support.Query")],Si);const F_=Si;async function Eat(t,e,i){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=sPe(t));const r=Cat(t),n=t.capabilities.query.supportsPagination;e.start=0,e.num=r;let s=null;for(;;){const o=await t.source.queryFeaturesJSON(e,i);if(s==null?s=o:s.features=s.features.concat(o.features),s.exceededTransferLimit=o.exceededTransferLimit,!n||!o.exceededTransferLimit)break;e.start+=r}return s}function Cat(t){return sPe(t)*Aat(t)}function Aat(t){return t.capabilities.query.maxRecordCount||2e3}function sPe(t){return t.capabilities.query.supportsMaxRecordCountFactor?F_.MAX_MAX_RECORD_COUNT_FACTOR:1}var oQ;let Dl=oQ=class extends Ue{constructor(t){super(t),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10}clone(){return new oQ(Re({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};y([w({type:[String],json:{write:!0}})],Dl.prototype,"attachmentTypes",void 0),y([w({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],Dl.prototype,"attachmentsWhere",void 0),y([w({type:Boolean,json:{write:!0}})],Dl.prototype,"cacheHint",void 0),y([w({type:[String],json:{write:!0}})],Dl.prototype,"keywords",void 0),y([w({type:[Number],json:{write:!0}})],Dl.prototype,"globalIds",void 0),y([w({json:{write:!0}})],Dl.prototype,"name",void 0),y([w({type:Number,json:{read:{source:"resultRecordCount"}}})],Dl.prototype,"num",void 0),y([w({type:[Number],json:{write:!0}})],Dl.prototype,"objectIds",void 0),y([w({type:Boolean,json:{default:!1,write:!0}})],Dl.prototype,"returnMetadata",void 0),y([w({type:[Number],json:{write:!0}})],Dl.prototype,"size",void 0),y([w({type:Number,json:{read:{source:"resultOffset"}}})],Dl.prototype,"start",void 0),y([Pt("start"),Pt("num")],Dl.prototype,"writeStart",null),y([w({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],Dl.prototype,"where",void 0),Dl=oQ=y([Z("esri.rest.support.AttachmentQuery")],Dl),Dl.from=$s(Dl);const Mat=Dl;var aQ;let Ro=aQ=class extends Ue{constructor(t){super(t),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}writeStart(t,e){e.resultOffset=this.start,e.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(e.definitionExpression="1=1")}clone(){return new aQ(Re({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};y([w({type:Boolean,json:{write:!0}})],Ro.prototype,"cacheHint",void 0),y([w({type:ty,json:{write:!0}})],Ro.prototype,"dynamicDataSource",void 0),y([w({type:String,json:{write:!0}})],Ro.prototype,"gdbVersion",void 0),y([w({type:Number,json:{write:!0}})],Ro.prototype,"geometryPrecision",void 0),y([w({type:Date})],Ro.prototype,"historicMoment",void 0),y([Pt("historicMoment")],Ro.prototype,"_writeHistoricMoment",null),y([w({type:Number,json:{write:!0}})],Ro.prototype,"maxAllowableOffset",void 0),y([w({type:[Number],json:{write:!0}})],Ro.prototype,"objectIds",void 0),y([w({type:[String],json:{write:!0}})],Ro.prototype,"orderByFields",void 0),y([w({type:[String],json:{write:!0}})],Ro.prototype,"outFields",void 0),y([w({type:at,json:{read:{source:"outSR"},write:{target:"outSR"}}})],Ro.prototype,"outSpatialReference",void 0),y([w({json:{write:!0}})],Ro.prototype,"relationshipId",void 0),y([w({type:Number,json:{read:{source:"resultOffset"}}})],Ro.prototype,"start",void 0),y([Pt("start"),Pt("num")],Ro.prototype,"writeStart",null),y([w({type:Number,json:{read:{source:"resultRecordCount"}}})],Ro.prototype,"num",void 0),y([w({json:{write:!0}})],Ro.prototype,"returnGeometry",void 0),y([w({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Ro.prototype,"returnM",void 0),y([w({type:Boolean,json:{write:{overridePolicy:t=>({enabled:t})}}})],Ro.prototype,"returnZ",void 0),y([w({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],Ro.prototype,"where",void 0),Ro=aQ=y([Z("esri.rest.support.RelationshipQuery")],Ro),Ro.from=$s(Ro);const goe=Ro,nKt=Object.freeze(Object.defineProperty({__proto__:null,default:goe},Symbol.toStringTag,{value:"Module"})),sKt=new yn({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function oKt(t,e,i,r){const n=await ax(t);if(await yoe(t,e,r),!n.addAttachment)throw new se(r,"Layer source does not support addAttachment capability");return n.addAttachment(e,i)}function yoe(t,e,i){var s,o;const{attributes:r}=e,{objectIdField:n}=t;return(o=(s=t.capabilities)==null?void 0:s.data)!=null&&o.supportsAttachment?e?r?n&&r[n]?Promise.resolve():Promise.reject(new se(i,`feature is missing the identifying attribute ${n}`)):Promise.reject(new se(i,"'attributes' are required on a feature to query attachments")):Promise.reject(new se(i,"A feature is required to add/delete/update attachments")):Promise.reject(new se(i,"this layer doesn't support attachments"))}async function aKt(t,e,i,r,n){const s=await ax(t);if(await yoe(t,e,n),!s.updateAttachment)throw new se(n,"Layer source does not support updateAttachment capability");return s.updateAttachment(e,i,r)}async function lKt(t,e,i){const{applyEdits:r}=await we(()=>import("./editingSupport-EiPa9PKq.js"),__vite__mapDeps([])),n=await t.load(),{source:s,globalIdField:o}=n;let l=i;return n.type==="feature"&&n.infoFor3D&&e.deleteFeatures!=null&&o!=null&&(l={...l,globalIdToObjectId:await oPe(t,e.deleteFeatures,o)}),r(n,s,e,i)}async function cKt(t,e,i){const{uploadAssets:r}=await we(()=>import("./editingSupport-EiPa9PKq.js"),__vite__mapDeps([])),n=await t.load();return r(n,n.source,e,i)}async function uKt(t,e,i,r){const n=await ax(t);if(await yoe(t,e,r),!n.deleteAttachments)throw new se(r,"Layer source does not support deleteAttachments capability");return n.deleteAttachments(e,i)}async function hKt(t,e,i){const r=(await t.load({signal:e==null?void 0:e.signal})).source;if(!r.fetchRecomputedExtents)throw new se(i,"Layer source does not support fetchUpdates capability");return r.fetchRecomputedExtents(e)}async function dKt(t,e,i,r){var A,M;e=Mat.from(e),await t.load();const n=t.source,s=t.capabilities;if(!((A=s==null?void 0:s.data)!=null&&A.supportsAttachment))throw new se(r,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:l,globalIds:c,num:f,size:_,start:x,where:T}=e;if(!((M=s==null?void 0:s.operations)!=null&&M.supportsQueryAttachments)&&((o==null?void 0:o.length)>0||(c==null?void 0:c.length)>0||(_==null?void 0:_.length)>0||f||x||T))throw new se(r,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l!=null&&l.length||c!=null&&c.length||T))throw new se(r,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!n.queryAttachments)throw new se(r,"Layer source does not support queryAttachments capability",e);return n.queryAttachments(e)}async function pKt(t,e,i,r){const n=await ax(t);if(!n.queryObjectIds)throw new se(r,"Layer source does not support queryObjectIds capability");return n.queryObjectIds(F_.from(e)??t.createQuery(),i)}async function fKt(t,e,i,r){const n=await ax(t);if(!n.queryFeatureCount)throw new se(r,"Layer source does not support queryFeatureCount capability");return n.queryFeatureCount(F_.from(e)??t.createQuery(),i)}async function mKt(t,e,i,r){const n=await ax(t);if(!n.queryExtent)throw new se(r,"Layer source does not support queryExtent capability");return n.queryExtent(F_.from(e)??t.createQuery(),i)}async function gKt(t,e,i,r){const n=await ax(t);if(!n.queryRelatedFeatures)throw new se(r,"Layer source does not support queryRelatedFeatures capability");return n.queryRelatedFeatures(goe.from(e),i)}async function yKt(t,e,i,r){const n=await ax(t);if(!n.queryRelatedFeaturesCount)throw new se(r,"Layer source does not support queryRelatedFeaturesCount capability");return n.queryRelatedFeaturesCount(goe.from(e),i)}async function vKt(t){const e=t.source;if(e!=null&&e.refresh)try{const{dataChanged:i,updates:r}=await e.refresh();if(r!=null&&(t.sourceJSON={...t.sourceJSON,...r},t.read(r,{origin:"service",url:t.parsedUrl})),i)return!0}catch{}if(t.definitionExpression)try{return(await Tse(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function _Kt(t){var o,l;const e=new F_,i=(o=t.capabilities)==null?void 0:o.data,r=(l=t.capabilities)==null?void 0:l.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),i&&(i.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),i.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:n,timeExtent:s}=t;return e.timeExtent=n!=null&&s!=null?s.offset(-n.value,n.unit):s||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function bKt(t){const{globalIdField:e,fields:i}=t;if(e)return e;if(i){for(const r of i)if(r.type==="esriFieldTypeGlobalID")return r.name}}function wKt(t){const{objectIdField:e,fields:i}=t;if(e)return e;if(i){for(const r of i)if(r.type==="esriFieldTypeOID")return r.name}}function xKt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}async function ax(t){return(await t.load()).source}async function Oat(t,e){if(!yr||yr.findCredential(t))return;let i;try{const r=await UOe(t,e);r&&(i=await yr.checkSignInStatus(`${r}/sharing`))}catch{}if(i)try{const r=e!=null?e.signal:null;await yr.getCredential(t,{signal:r})}catch{}}async function SKt(t,e,i){var n;const r=(n=t.parsedUrl)==null?void 0:n.path;r&&t.authenticationTriggerEvent===e&&await Oat(r,i)}function Pat(t){var e;return!((e=t.sourceJSON)!=null&&e.isMultiServicesView)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const UH=Z5({types:wOe});function TKt(t,e){var i;if(t.defaultSymbol)return(i=t.types)!=null&&i.length?new ioe({defaultSymbol:UH(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:UH(r.symbol,r,e)}))}):new Qse({symbol:UH(t.defaultSymbol,t,e)})}function EKt(t){var r,n,s;let e=(r=t.sourceJSON)==null?void 0:r.cacheMaxAge;if(!e)return!1;const i=(s=(n=t.editingInfo)==null?void 0:n.lastEditDate)==null?void 0:s.getTime();return i==null||(e*=1e3,Date.now()-i{let _=null;if("attributes"in f){const{attributes:x}=f;_={globalId:x[i],objectId:x[n]!=null&&x[n]!==-1?x[n]:null}}else _={globalId:f.globalId,objectId:f.objectId!=null&&f.objectId!==-1?f.objectId:null};_.globalId!=null&&(_.objectId!=null&&_.objectId!==-1||r.push(_.globalId))}),r.length===0)return null;const s=t.createQuery();s.where=r.map(f=>`${i}='${f}'`).join(" OR "),s.returnGeometry=!1,s.outFields=[n,i],s.cacheHint=!1;const o=await MHe(Eat(t,s));if(!o.ok)return null;const l=new Map,c=o.value.features;for(const f of c){const _=f.attributes[i],x=f.attributes[n];_!=null&&x!=null&&x!==-1&&l.set(_,x)}return l}let c$=class extends Ue{constructor(){super(...arguments),this.type=null}};y([w({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],c$.prototype,"type",void 0),c$=y([Z("esri.layers.support.FeatureReduction")],c$);var lQ;let sF=lQ=class extends c${constructor(t){super(t),this.type="selection"}clone(){return new lQ}};y([w({type:["selection"]})],sF.prototype,"type",void 0),sF=lQ=y([Z("esri.layers.support.FeatureReductionSelection")],sF);const Rat=sF;function Iat(){return{fields:{type:[moe],value:null,set:function(t){if(t&&Le("big-integer-warning-enabled")){const e=t.filter(i=>i.type==="big-integer"||i.type==="oid"&&(i.length||0)>=8);if(e.length){const i=e.map(r=>`'${r.name}'`).join(", ");Ce.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${i}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",t)}},fieldsIndex:{readOnly:!0,get(){return Zse.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(t){this._userOutFields=t,this.notifyChange("outFields")},get:function(){var e;const t=this._userOutFields;if(!(t!=null&&t.length))return null;if(t.includes("*"))return["*"];if(!this.fields)return t;for(const i of t)((e=this.fieldsIndex)==null?void 0:e.has(i))||Ce.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:t});return RB(this.fieldsIndex,t)}}}}let AS=class extends Ue{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};y([w({type:Number})],AS.prototype,"nodesPerPage",void 0),y([w({type:Number})],AS.prototype,"rootIndex",void 0),y([w({type:String})],AS.prototype,"lodSelectionMetricType",void 0),AS=y([Z("esri.layer.support.I3SNodePageDefinition")],AS);let jv=class extends Ue{constructor(){super(...arguments),this.factor=1}};y([w({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],jv.prototype,"id",void 0),y([w({type:Number})],jv.prototype,"factor",void 0),jv=y([Z("esri.layer.support.I3SMaterialTexture")],jv);let Kb=class extends Ue{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};y([w({type:[Number]})],Kb.prototype,"baseColorFactor",void 0),y([w({type:jv})],Kb.prototype,"baseColorTexture",void 0),y([w({type:jv})],Kb.prototype,"metallicRoughnessTexture",void 0),y([w({type:Number})],Kb.prototype,"metallicFactor",void 0),y([w({type:Number})],Kb.prototype,"roughnessFactor",void 0),Kb=y([Z("esri.layer.support.I3SMaterialPBRMetallicRoughness")],Kb);let Hp=class extends Ue{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};y([Vt({opaque:"opaque",mask:"mask",blend:"blend"})],Hp.prototype,"alphaMode",void 0),y([w({type:Number})],Hp.prototype,"alphaCutoff",void 0),y([w({type:Boolean})],Hp.prototype,"doubleSided",void 0),y([Vt({none:"none",back:"back",front:"front"})],Hp.prototype,"cullFace",void 0),y([w({type:jv})],Hp.prototype,"normalTexture",void 0),y([w({type:jv})],Hp.prototype,"occlusionTexture",void 0),y([w({type:jv})],Hp.prototype,"emissiveTexture",void 0),y([w({type:[Number]})],Hp.prototype,"emissiveFactor",void 0),y([w({type:Kb})],Hp.prototype,"pbrMetallicRoughness",void 0),Hp=y([Z("esri.layer.support.I3SMaterialDefinition")],Hp);let L4=class extends Ue{};y([w({type:String,json:{read:{source:["name","index"],reader:(t,e)=>t??`${e.index}`}}})],L4.prototype,"name",void 0),y([Vt({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],L4.prototype,"format",void 0),L4=y([Z("esri.layer.support.I3STextureFormat")],L4);let D4=class extends Ue{constructor(){super(...arguments),this.atlas=!1}};y([w({type:[L4]})],D4.prototype,"formats",void 0),y([w({type:Boolean})],D4.prototype,"atlas",void 0),D4=y([Z("esri.layer.support.I3STextureSetDefinition")],D4);let sm=class extends Ue{};y([Vt({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],sm.prototype,"type",void 0),y([w({type:Number})],sm.prototype,"component",void 0),sm=y([Z("esri.layer.support.I3SGeometryAttribute")],sm);let N4=class extends Ue{};y([Vt({draco:"draco"})],N4.prototype,"encoding",void 0),y([w({type:[String]})],N4.prototype,"attributes",void 0),N4=y([Z("esri.layer.support.I3SGeometryCompressedAttributes")],N4);let p0=class extends Ue{constructor(){super(...arguments),this.offset=0}};y([w({type:Number})],p0.prototype,"offset",void 0),y([w({type:sm})],p0.prototype,"position",void 0),y([w({type:sm})],p0.prototype,"normal",void 0),y([w({type:sm})],p0.prototype,"uv0",void 0),y([w({type:sm})],p0.prototype,"color",void 0),y([w({type:sm})],p0.prototype,"uvRegion",void 0),y([w({type:sm})],p0.prototype,"featureId",void 0),y([w({type:sm})],p0.prototype,"faceRange",void 0),y([w({type:N4})],p0.prototype,"compressedAttributes",void 0),p0=y([Z("esri.layer.support.I3SGeometryBuffer")],p0);let F4=class extends Ue{};y([Vt({triangle:"triangle"})],F4.prototype,"topology",void 0),y([w()],F4.prototype,"geometryBuffers",void 0),F4=y([Z("esri.layer.support.I3SGeometryDefinition")],F4);const voe="__begin__",_oe="__end__",$at=new RegExp(voe,"ig"),Lat=new RegExp(_oe,"ig"),ufe=new RegExp("^"+voe,"i"),hfe=new RegExp(_oe+"$","i"),Qz='"',Dat=Qz+" + ",Nat=" + "+Qz;function Fat(t){return t.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function kat(t){return t.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function QB(t){const e={expression:"",type:"none"};return t.labelExpressionInfo?t.labelExpressionInfo.value?(e.expression=t.labelExpressionInfo.value,e.type="conventional"):t.labelExpressionInfo.expression&&(e.expression=t.labelExpressionInfo.expression,e.type="arcade"):t.labelExpression!=null&&(e.expression=Fat(t.labelExpression),e.type="conventional"),e}function zat(t){const e=QB(t);if(!e)return null;switch(e.type){case"conventional":return cQ(e.expression);case"arcade":return e.expression}return null}function Uat(t){const e=QB(t);if(!e)return null;switch(e.type){case"conventional":return Bat(e.expression);case"arcade":return boe(e.expression)}return null}function cQ(t){let e;return t?(e=h9(t,i=>voe+'$feature["'+i+'"]'+_oe),e=ufe.test(e)?e.replace(ufe,""):Qz+e,e=hfe.test(e)?e.replace(hfe,""):e+Qz,e=e.replaceAll($at,Dat).replaceAll(Lat,Nat)):e='""',e}const Vat=/^\s*\{([^}]+)\}\s*$/i;function Bat(t){const e=t==null?void 0:t.match(Vat);return(e==null?void 0:e[1].trim())||null}const jat=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,Gat=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,Hat=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function boe(t){if(!t)return null;let e=jat.exec(t)||Gat.exec(t);return e?e[1]||e[3]:(e=Hat.exec(t),e?e[2]:null)}var uQ;let Qb=uQ=class extends Ue{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(t,e){return e.value?cQ(e.value):t}writeExpression(t,e,i){this.value!=null&&(t=cQ(this.value)),t!=null&&(e[i]=t)}clone(){return new uQ({expression:this.expression,title:this.title,value:this.value})}};y([w({type:String,json:{write:{writerEnsuresNonNull:!0}}})],Qb.prototype,"expression",void 0),y([$t("expression",["expression","value"])],Qb.prototype,"readExpression",null),y([Pt("expression")],Qb.prototype,"writeExpression",null),y([w({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],Qb.prototype,"title",void 0),y([w({json:{read:!1,write:!1}})],Qb.prototype,"value",void 0),Qb=uQ=y([Z("esri.layers.support.LabelExpressionInfo")],Qb);const aPe=Qb,lPe=[252,146,31,255],FKt=[153,153,153,255],qat={type:"esriSMS",style:"esriSMSCircle",size:6,color:lPe,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},Wat={type:"esriSLS",style:"esriSLSSolid",width:.75,color:lPe},Yat={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},Xat={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},Zat={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},Jat={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},Kat={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},Qat=cu.fromJSON(qat),elt=Oc.fromJSON(Wat),tlt=Bm.fromJSON(Yat),ilt=mE.fromJSON(Xat);function kKt(t){if(t==null)return null;switch(t.type){case"mesh":return null;case"point":case"multipoint":return Qat;case"polyline":return elt;case"polygon":case"extent":return tlt}return null}cu.fromJSON(Zat);Oc.fromJSON(Jat);Bm.fromJSON(Kat);var hQ;const aD=new yn({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function lD(t,e,i){return{enabled:!zOe(i==null?void 0:i.layer)}}function cPe(t){var e;return!t||t.origin!=="service"&&((e=t.layer)==null?void 0:e.type)!=="map-image"}function rlt(t){return(t==null?void 0:t.type)==="map-image"}function uPe(t){var e,i;return!!rlt(t)&&!!((i=(e=t.capabilities)==null?void 0:e.exportMap)!=null&&i.supportsArcadeExpressionForLabeling)}function nlt(t){return cPe(t)||uPe(t==null?void 0:t.layer)}let ta=hQ=class extends Ue{static evaluateWhere(t,e){const i=(r,n,s)=>{switch(n){case"=":return r==s;case"<>":return r!=s;case">":return r>s;case">=":return r>=s;case"<":return rnlt(i)?{allowNull:!0}:{enabled:!1}}}})],ta.prototype,"labelExpressionInfo",void 0),y([Pt("labelExpressionInfo")],ta.prototype,"writeLabelExpressionInfo",null),y([w({type:aD.apiValues,json:{type:aD.jsonValues,read:aD.read,write:aD.write}})],ta.prototype,"labelPlacement",void 0),y([w({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],ta.prototype,"labelPosition",void 0),y([w({type:Number})],ta.prototype,"maxScale",void 0),y([Pt("maxScale")],ta.prototype,"writeMaxScale",null),y([w({type:Number})],ta.prototype,"minScale",void 0),y([Pt("minScale")],ta.prototype,"writeMinScale",null),y([w({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:lD}}}}})],ta.prototype,"repeatLabel",void 0),y([w({type:Number,cast:vs,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:lD}}}}})],ta.prototype,"repeatLabelDistance",void 0),y([w({types:tnt,json:{origins:{"web-scene":{types:int,write:$pe,default:null}},write:$pe,default:null}})],ta.prototype,"symbol",void 0),y([w({type:Boolean,json:{write:!0}})],ta.prototype,"useCodedValues",void 0),y([w({type:String,json:{write:!0}})],ta.prototype,"where",void 0),ta=hQ=y([Z("esri.layers.support.LabelClass")],ta);const hPe=ta,VH=Ce.getLogger("esri.layers.support.labelingInfo"),slt=/\[([^\[\]]+)\]/gi;function dfe(t,e,i){return t?t.map(r=>{var s;const n=new hPe;if(n.read(r,i),n.labelExpression){const o=e.fields||((s=e.layerDefinition)==null?void 0:s.fields)||this.fields;n.labelExpression=n.labelExpression.replaceAll(slt,(l,c)=>`[${olt(c,o)}]`)}return n}):null}function olt(t,e){if(!e)return t;const i=t.toLowerCase();for(let r=0;rllt(r,e))?[]:i}function llt(t,e){const i=t.labelPlacement,r=alt[e];if(!t.symbol)return VH.warn("No ILabelClass symbol specified."),!0;if(!r)return VH.error(new se("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${e}' is not supported`)),!0;if(!r.includes(i)){const n=r[0];i&&VH.warn(`Found invalid label placement type ${i} for ${e}. Defaulting to ${n}`),t.labelPlacement=n}return!1}var dQ;let EA=dQ=class extends Ue{constructor(t){super(t),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new it}clone(){return new dQ({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};y([w({type:String,json:{write:!0}})],EA.prototype,"floorField",void 0),y([w({json:{read:!1,write:!1}})],EA.prototype,"viewAllMode",void 0),y([w({json:{read:!1,write:!1}})],EA.prototype,"viewAllLevelIds",void 0),EA=dQ=y([Z("esri.layers.support.LayerFloorInfo")],EA);const clt=EA,dPe={BingMapsLayer:async()=>(await we(()=>import("./BingMapsLayer-d48O8tVq.js"),__vite__mapDeps([]))).default,BuildingSceneLayer:async()=>(await we(()=>import("./BuildingSceneLayer-YaRBOuhA.js"),__vite__mapDeps([46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]))).default,CSVLayer:async()=>(await we(()=>import("./CSVLayer-tIBvmg-7.js"),__vite__mapDeps([64,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,65,66]))).default,DimensionLayer:async()=>(await we(()=>import("./DimensionLayer-WWUzEsQc.js"),__vite__mapDeps([67,68]))).default,ElevationLayer:async()=>(await we(()=>Promise.resolve().then(()=>mje),void 0)).default,FeatureLayer:async()=>(await we(()=>import("./FeatureLayer--S4epFk-.js"),__vite__mapDeps([48,49,50,51,52,53,54,55,56,57,58,59,60,61,62]))).default,GeoJSONLayer:async()=>(await we(()=>import("./GeoJSONLayer-T9kwyVNs.js"),__vite__mapDeps([69,65,66,53,54,55,56,57,58,59,60]))).default,GeoRSSLayer:async()=>(await we(()=>import("./GeoRSSLayer-hfhcgYql.js"),__vite__mapDeps([]))).default,GroupLayer:async()=>(await we(()=>Promise.resolve().then(()=>hdt),void 0)).default,ImageryLayer:async()=>(await we(()=>import("./ImageryLayer-G7gb-fJC.js"),__vite__mapDeps([70,71,72,73,53,74,75,76,77,52,78,79,62,54,61]))).default,ImageryTileLayer:async()=>(await we(()=>import("./ImageryTileLayer-ce5u7kmi.js"),__vite__mapDeps([80,54,71,72,73,53,81,82]))).default,IntegratedMeshLayer:async()=>(await we(()=>import("./IntegratedMeshLayer-T6vTIezB.js"),__vite__mapDeps([83,84]))).default,KMLLayer:async()=>(await we(()=>import("./KMLLayer-c7r_kLDp.js"),__vite__mapDeps([85,53]))).default,LineOfSightLayer:async()=>(await we(()=>import("./LineOfSightLayer-JMoACZan.js"),__vite__mapDeps([]))).default,LinkChartLayer:async()=>(await we(()=>import("./LinkChartLayer-uIn6uT3L.js"),__vite__mapDeps([86,87,88,89,90,91,92,39,40,93,66,94,73,95,65,57,53]))).default,MapImageLayer:async()=>(await we(()=>import("./MapImageLayer-qMOOMfH7.js"),__vite__mapDeps([96,97,98,79,75,76,77,52,74,53,99,60,59,50,54,61]))).default,MapNotesLayer:async()=>(await we(()=>import("./MapNotesLayer-CdG3vHcH.js"),__vite__mapDeps([100,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,101]))).default,MediaLayer:async()=>(await we(()=>import("./MediaLayer-39dmiD7K.js"),__vite__mapDeps([102,103,104,89,90,91]))).default,OGCFeatureLayer:async()=>(await we(()=>import("./OGCFeatureLayer--w0HTnNu.js"),__vite__mapDeps([105,106,107,108,65,66,53,54,55,56,57,58,60,59]))).default,OpenStreetMapLayer:async()=>(await we(()=>import("./OpenStreetMapLayer-6XrQQ-kN.js"),__vite__mapDeps([109,110]))).default,OrientedImageryLayer:async()=>(await we(()=>import("./OrientedImageryLayer-LKoItije.js"),__vite__mapDeps([111,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62]))).default,PointCloudLayer:async()=>(await we(()=>import("./PointCloudLayer-qVzMPRjJ.js"),__vite__mapDeps([112,113]))).default,RouteLayer:async()=>(await we(()=>import("./RouteLayer-GamYzZdr.js"),__vite__mapDeps([114,115,53]))).default,SceneLayer:async()=>(await we(()=>Promise.resolve().then(()=>Mht),void 0)).default,StreamLayer:async()=>(await we(()=>import("./StreamLayer-KHxHoWyI.js"),__vite__mapDeps([116,54,55,56,57]))).default,SubtypeGroupLayer:async()=>(await we(()=>import("./SubtypeGroupLayer-xK5RtU9X.js"),__vite__mapDeps([117,54,49,50,59,61]))).default,TileLayer:async()=>(await we(()=>import("./TileLayer-bPSfr5GU.js"),__vite__mapDeps([118,97,98,79,75,76,77,52,74,53,99,60,59,50,54]))).default,UnknownLayer:async()=>(await we(()=>import("./UnknownLayer-3OKGB96U.js"),__vite__mapDeps([]))).default,UnsupportedLayer:async()=>(await we(()=>import("./UnsupportedLayer-s0OShVnj.js"),__vite__mapDeps([]))).default,VectorTileLayer:async()=>(await we(()=>import("./VectorTileLayer-0SVRfneU.js"),__vite__mapDeps([119,54,45,120,121,122]))).default,VoxelLayer:async()=>(await we(()=>import("./VoxelLayer-NKOtejie.js"),__vite__mapDeps([]))).default,WFSLayer:async()=>(await we(()=>import("./WFSLayer-VPxAc_vg.js"),__vite__mapDeps([123,65,66,124,107,108,125,53,54,55,56,57,58]))).default,WMSLayer:async()=>(await we(()=>Promise.resolve().then(()=>idt),void 0)).default,WMTSLayer:async()=>(await we(()=>import("./WMTSLayer-Qx8zOTb2.js"),__vite__mapDeps([126,110,125]))).default,WebTileLayer:async()=>(await we(()=>import("./WebTileLayer-JxqArsF7.js").then(t=>t.W),__vite__mapDeps([]))).default};let ew=class extends Ue{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};y([w({type:String,json:{read:!0,write:!0}})],ew.prototype,"name",void 0),y([w({type:String,json:{read:!0,write:!0}})],ew.prototype,"field",void 0),y([w({type:[Number],json:{read:!0,write:!0}})],ew.prototype,"currentRangeExtent",void 0),y([w({type:[Number],json:{read:!0,write:!0}})],ew.prototype,"fullRangeExtent",void 0),y([w({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],ew.prototype,"type",void 0),ew=y([Z("esri.layers.support.RangeInfo")],ew);const DE={Base64:0,Hex:1,String:2,Raw:3},lO=8,pPe=(1<>16)+(e>>16)+(i>>16)<<16|65535&i}function ult(t){const e=[];for(let i=0,r=t.length*lO;i>5]|=(t.charCodeAt(i/lO)&pPe)<>5]>>>i%32&pPe));return e.join("")}function dlt(t){const e="0123456789abcdef",i=[];for(let r=0,n=4*t.length;r>2]>>r%4*8+4&15)+e.charAt(t[r>>2]>>r%4*8&15));return i.join("")}function plt(t){const e="=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=[];for(let n=0,s=4*t.length;n>2]>>n%4*8&255)<<16|(t[n+1>>2]>>(n+1)%4*8&255)<<8|t[n+2>>2]>>(n+2)%4*8&255;for(let l=0;l<4;l++)8*n+6*l>32*t.length?r.push(e):r.push(i.charAt(o>>6*(3-l)&63))}return r.join("")}function flt(t,e){return t<>>32-e}function ej(t,e,i,r,n,s){return a2(flt(a2(a2(e,t),a2(r,s)),n),i)}function Ic(t,e,i,r,n,s,o){return ej(e&i|~e&r,t,e,n,s,o)}function $c(t,e,i,r,n,s,o){return ej(e&r|i&~r,t,e,n,s,o)}function Lc(t,e,i,r,n,s,o){return ej(e^i^r,t,e,n,s,o)}function Dc(t,e,i,r,n,s,o){return ej(i^(e|~r),t,e,n,s,o)}function mlt(t,e){t[e>>5]|=128<>>9<<4)]=e;let i=1732584193,r=-271733879,n=-1732584194,s=271733878;for(let o=0;o{const n=blt(t,i,r);for(const s of e){const o=tne(i,s,r);for(const l in n)o[l]=n[l]}}}function blt(t,e,i){if((t==null?void 0:t.type)==="resource")return wlt(t,e,i);switch((t==null?void 0:t.type)??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:r,write:n}=Brt;return{read:r,write:n}}}}function wlt(t,e,i){const r=f9(e,i);return{type:String,read:(n,s,o)=>{const l=kB(n,s,o);return r.type===String?l:typeof r.type=="function"?new r.type({url:l}):void 0},write:{writer(n,s,o,l){if(!(l!=null&&l.resources))return typeof n=="string"?void(s[o]=m_(n,l)):void(s[o]=n.write({},l));const c=Tlt(n),f=m_(c,{...l,verifyItemRelativeUrls:l!=null&&l.verifyItemRelativeUrls?{writtenUrls:l.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},JO.NO),_=r.type!==String&&(!H5e(this)||(l==null?void 0:l.origin)&&this.originIdOf(i)>kv(l.origin)),x={object:this,propertyName:i,value:n,targetUrl:f,dest:s,targetPropertyName:o,context:l,params:t};l!=null&&l.portalItem&&f&&!Zh(f)?_&&(t!=null&&t.contentAddressed)?mQ(x):_?xlt(x):Slt(x):l!=null&&l.portalItem&&(f==null||QMe(f)!=null||E2(f)||_)?mQ(x):s[o]=f}}}}function mQ(t){var M;const{targetUrl:e,params:i,value:r,context:n,dest:s,targetPropertyName:o}=t;if(!n.portalItem)return;const l=eOe(e),c=gPe(r,e,n);if(i!=null&&i.contentAddressed&&c.type!=="json")return void((M=n.messages)==null?void 0:M.push(new se("persistable:contentAddressingUnsupported",`Property "${o}" is trying to serializing a resource with content of type ${c.type} with content addressing. Content addressing is only supported for json resources.`,{content:c})));const f=i!=null&&i.contentAddressed&&c.type==="json"?glt(c.jsonString):(l==null?void 0:l.filename)??Vf(),_=s0((i==null?void 0:i.prefix)??(l==null?void 0:l.prefix),f),x=`${_}.${pQ(c)}`;if(i!=null&&i.contentAddressed&&n.resources&&c.type==="json"){const I=n.resources.toKeep.find(L=>L.resource.path===x)??n.resources.toAdd.find(L=>L.resource.path===x);if(I)return void(s[o]=I.resource.itemRelativeUrl)}const T=n.portalItem.resourceFromPath(x);E2(e)&&n.resources&&n.resources.pendingOperations.push(kYe(e).then(I=>{T.path=`${_}.${pQ({type:"blob",blob:I})}`,s[o]=T.itemRelativeUrl}).catch(()=>{}));const A=(i==null?void 0:i.compress)??!1;n.resources&&mPe({...t,resource:T,content:c,compress:A,updates:n.resources.toAdd}),s[o]=T.itemRelativeUrl}function xlt(t){const{context:e,targetUrl:i,params:r,value:n,dest:s,targetPropertyName:o}=t;if(!e.portalItem)return;const l=e.portalItem.resourceFromPath(i),c=gPe(n,i,e),f=pQ(c),_=Rne(l.path),x=(r==null?void 0:r.compress)??!1;f===_?(e.resources&&mPe({...t,resource:l,content:c,compress:x,updates:e.resources.toUpdate}),s[o]=i):mQ(t)}function Slt({context:t,targetUrl:e,dest:i,targetPropertyName:r}){t.portalItem&&t.resources&&(t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(e),compress:!1}),i[r]=e)}function mPe({object:t,propertyName:e,updates:i,resource:r,content:n,compress:s}){i.push({resource:r,content:n,compress:s,finish:o=>{Elt(t,e,o)}})}function gPe(t,e,i){return typeof t=="string"?{type:"url",url:e}:{type:"json",jsonString:JSON.stringify(t.toJSON(i))}}function Tlt(t){return t==null?null:typeof t=="string"?t:t.url}function Elt(t,e,i){typeof t[e]=="string"?t[e]=i.url:t[e].url=i.url}var oF;let gQ=oF=class extends P_(it.ofType(Qa)){constructor(t){super(t)}clone(){return new oF(this.items.map(t=>t.clone()))}write(t,e){return this.toJSON(e)}toJSON(t){var i;const e=(i=t==null?void 0:t.layer)==null?void 0:i.spatialReference;return e?this.toArray().map(r=>{if(!e.equals(r.spatialReference)){if(!th(r.spatialReference,e))return t!=null&&t.messages&&t.messages.push(new Uf("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:t.layer.spatialReference,context:t})),null;const s=new Qa;U5e(r,s,e),r=s}const n=r.toJSON(t);return delete n.spatialReference,n}).filter(r=>r!=null):(t!=null&&t.messages&&t.messages.push(new Uf("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:t.layer.spatialReference,context:t})),this.toArray().map(r=>r.toJSON(t)))}static fromJSON(t,e){const i=new oF;return t.forEach(r=>i.add(Qa.fromJSON(r,e))),i}};gQ=oF=y([Z("esri.layers.support.PolygonCollection")],gQ);const aF=gQ;var yQ;let CA=yQ=class extends Ue{constructor(t){super(t),this.spatialRelationship="disjoint",this.geometries=new aF,this._geometriesSource=null}initialize(){this.addHandles(Jr(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,Li))}readGeometries(t,e,i){Array.isArray(t)?this.geometries=aF.fromJSON(t,i):this._geometriesSource={url:f_(t,i),context:i}}async loadGeometries(t,e){if(this._geometriesSource==null)return;const{url:i,context:r}=this._geometriesSource,n=await bi(i,{responseType:"json",signal:e==null?void 0:e.signal}),s=t.toJSON(),o=n.data.map(l=>({...l,spatialReference:s}));this.geometries=aF.fromJSON(o,r),this._geometriesSource=null}clone(){const t=new yQ({geometries:Re(this.geometries),spatialRelationship:this.spatialRelationship});return t._geometriesSource=this._geometriesSource,t}};y([w({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],CA.prototype,"spatialRelationship",void 0),y([w({type:aF,nonNullable:!0,json:{write:!0}}),Dv({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],CA.prototype,"geometries",void 0),y([$t(["web-scene","portal-item"],"geometries")],CA.prototype,"readGeometries",null),CA=yQ=y([Z("esri.layers.support.SceneFilter")],CA);const Clt=CA;async function Alt(t,e,i){const r=t&&t.getAtOrigin&&t.getAtOrigin("renderer",e.origin);if(r&&r.type==="unique-value"&&r.styleOrigin){const n=await Ju(r.populateFromStyle());if(St(i),n.ok===!1){const s=n.error;e!=null&&e.messages&&e.messages.push(new Uf("renderer:style-reference",`Failed to create unique value renderer from style reference: ${s.message}`,{error:s,context:e})),t.clear("renderer",e==null?void 0:e.origin)}}}function yPe(t){return t?ma:$lt}function Mlt(t,e){return e!=null&&e.mode?e.mode:yPe(t).mode}function vPe(t,e){return e??yPe(t)}function xoe(t,e){return Mlt(t!=null&&t.hasZ,e)}function VKt(t,e){return vPe(t!=null&&!!t.hasZ,e)}function tj(t){const e=Soe(t);return xoe(t.geometry,e)}function _Pe(t){const e=Soe(t),i=xoe(t.geometry,e);return{mode:i,offset:e!=null&&i!=="on-the-ground"?(e.offset??0)*SOe(e.unit??"meters"):0}}function ij(t){if(tj(t)==="on-the-ground")return!1;const e=Soe(t),i=e!=null&&e.featureExpressionInfo?e.featureExpressionInfo.expression:null;return!(!i||i==="0")}function Soe(t){return t.layer&&"elevationInfo"in t.layer?t.layer.elevationInfo:null}function BKt(t,e,i){if(!(i!=null&&i.mode))return;const r=t.hasZ?t.z:0,n=i.offset!=null?i.offset:0;switch(i.mode){case"absolute-height":return r-n;case"on-the-ground":return 0;case"relative-to-ground":return r-((e.elevationProvider.getElevation(t.x,t.y,r,t.spatialReference,"ground")??0)+n);case"relative-to-scene":return r-((e.elevationProvider.getElevation(t.x,t.y,r,t.spatialReference,"scene")??0)+n)}}function bPe(t,e,i,r=null){return xPe(t,e.x,e.y,e.hasZ?e.z:0,e.spatialReference,i,r)}function wPe(t,e,i,r,n=null){return xPe(t,e[0],e[1],e.length>2?e[2]:0,i,r,n)}function xPe(t,e,i,r,n,s,o=null){if(s==null)return;const l=o!=null?o.mode:"absolute-height";if(l==="on-the-ground")return 0;const{absoluteZ:c}=Olt(e,i,r,n,t,s);return Plt(c,e,i,r,n,t,o,l)}function Olt(t,e,i,r,n,s){const o=s.offset!=null?s.offset:0;switch(s.mode){case"absolute-height":return{absoluteZ:i+o,elevation:0};case"on-the-ground":{const l=n.elevationProvider.getElevation(t,e,0,r,"ground")??0;return{absoluteZ:l,elevation:l}}case"relative-to-ground":{const l=n.elevationProvider.getElevation(t,e,i,r,"ground")??0;return{absoluteZ:i+l+o,elevation:l}}case"relative-to-scene":{const l=n.elevationProvider.getElevation(t,e,i,r,"scene")??0;return{absoluteZ:i+l+o,elevation:l}}}}function Plt(t,e,i,r,n,s,o,l){const c=(o==null?void 0:o.offset)!=null?o.offset:0;switch(l){case"absolute-height":return t-c;case"relative-to-ground":return t-((s.elevationProvider.getElevation(e,i,r,n,"ground")??0)+c);case"relative-to-scene":return t-((s.elevationProvider.getElevation(e,i,r,n,"scene")??0)+c)}}function jKt(t,e){if(e==null)return!1;const{mode:i}=e;return i!=null&&(t==="scene"&&i==="relative-to-scene"||t==="ground"&&i!=="absolute-height")}function GKt(t,e,i){return i&&i.mode!==e?`${t} only support ${e} elevation mode`:null}function Rlt(t,e,i){return(i==null?void 0:i.mode)===e?`${t} do not support ${e} elevation mode`:null}function Ilt(t,e){return(e==null?void 0:e.featureExpressionInfo)!=null&&e.featureExpressionInfo.expression!=="0"?`${t} do not support featureExpressionInfo`:null}function pfe(t,e){e&&t.warn(".elevationInfo=",e)}const ma={mode:"absolute-height",offset:0},$lt={mode:"on-the-ground",offset:null};function Llt({displayField:t,editFieldsInfo:e,fields:i,objectIdField:r,title:n},s){if(!i)return null;const o=klt({editFieldsInfo:e,fields:i,objectIdField:r},s);if(!o.length)return null;const l=Vlt({titleBase:n,fields:i,displayField:t}),c=Ult();return new hE({title:l,content:c,fieldInfos:o})}const Dlt=(t,e)=>e.visibleFieldNames?e.visibleFieldNames.has(t.name):Tit(t,e);function Nlt(t,e){const i=t;return e&&(t=t.filter(r=>!e.includes(r.type))),t===i&&(t=t.slice()),t.sort(Flt),t}function Flt(t,e){return t.type==="oid"?-1:e.type==="oid"?1:ffe(t)?-1:ffe(e)?1:(t.alias||t.name).toLocaleLowerCase().localeCompare((e.alias||e.name).toLocaleLowerCase())}function klt(t,e){const i=e==null?void 0:e.visibleFieldNames;return Nlt(t.fields??[],(e==null?void 0:e.ignoreFieldTypes)||Blt).map(r=>new Ose({fieldName:r.name,isEditable:Sit(r,t),label:r.alias,format:zlt(r),visible:Dlt(r,{...t,visibleFieldNames:i})}))}function zlt(t){switch(t.type){case"small-integer":case"integer":case"single":return new T7({digitSeparator:!0,places:0});case"double":return new T7({digitSeparator:!0,places:2});case"string":return Xit(t.name)?new T7({digitSeparator:!0,places:0}):null;default:return null}}function Ult(){return[new gL,new mL]}function Vlt(t){const e=dit(t),{titleBase:i}=t;return e?`${i}: {${e.trim()}}`:i??""}function ffe(t){return(t.name&&t.name.toLowerCase())==="name"?!0:(t.alias&&t.alias.toLowerCase())==="name"}const Blt=["geometry","blob","raster","guid","xml"];function Yf(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function jlt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function Toe(t,e,i,r,n,s,o,l,c,f){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t[4]=s,t[5]=o,t[6]=l,t[7]=c,t[8]=f,t}function Eoe(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Xf(t,e){if(t===e){const i=e[1],r=e[2],n=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=n}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function _E(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],_=e[8],x=_*o-l*f,T=-_*s+l*c,A=f*s-o*c;let M=i*x+r*T+n*A;return M?(M=1/M,t[0]=x*M,t[1]=(-_*r+n*f)*M,t[2]=(l*r-n*o)*M,t[3]=T*M,t[4]=(_*i-n*c)*M,t[5]=(-l*i+n*s)*M,t[6]=A*M,t[7]=(-f*i+r*c)*M,t[8]=(o*i-r*s)*M,t):null}function Glt(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],_=e[8];return t[0]=o*_-l*f,t[1]=n*f-r*_,t[2]=r*l-n*o,t[3]=l*c-s*_,t[4]=i*_-n*c,t[5]=n*s-i*l,t[6]=s*f-o*c,t[7]=r*c-i*f,t[8]=i*o-r*s,t}function Hlt(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],l=t[6],c=t[7],f=t[8];return e*(f*s-o*c)+i*(-f*n+o*l)+r*(c*n-s*l)}function s5(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],f=e[6],_=e[7],x=e[8],T=i[0],A=i[1],M=i[2],I=i[3],L=i[4],F=i[5],z=i[6],k=i[7],U=i[8];return t[0]=T*r+A*o+M*f,t[1]=T*n+A*l+M*_,t[2]=T*s+A*c+M*x,t[3]=I*r+L*o+F*f,t[4]=I*n+L*l+F*_,t[5]=I*s+L*c+F*x,t[6]=z*r+k*o+U*f,t[7]=z*n+k*l+U*_,t[8]=z*s+k*c+U*x,t}function eU(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],f=e[6],_=e[7],x=e[8],T=i[0],A=i[1];return t[0]=r,t[1]=n,t[2]=s,t[3]=o,t[4]=l,t[5]=c,t[6]=T*r+A*o+f,t[7]=T*n+A*l+_,t[8]=T*s+A*c+x,t}function Coe(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],l=e[4],c=e[5],f=e[6],_=e[7],x=e[8],T=Math.sin(i),A=Math.cos(i);return t[0]=A*r+T*o,t[1]=A*n+T*l,t[2]=A*s+T*c,t[3]=A*o-T*r,t[4]=A*l-T*n,t[5]=A*c-T*s,t[6]=f,t[7]=_,t[8]=x,t}function Aoe(t,e,i){const r=i[0],n=i[1],s=i[2];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t[6]=s*e[6],t[7]=s*e[7],t[8]=s*e[8],t}function qlt(t,e,i){const r=i[0],n=i[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=n*e[3],t[4]=n*e[4],t[5]=n*e[5],t}function Wlt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function Ylt(t,e){const i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Xlt(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function Zlt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function rj(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i+i,l=r+r,c=n+n,f=i*o,_=r*o,x=r*l,T=n*o,A=n*l,M=n*c,I=s*o,L=s*l,F=s*c;return t[0]=1-x-M,t[3]=_-F,t[6]=T+L,t[1]=_+F,t[4]=1-f-M,t[7]=A-I,t[2]=T-L,t[5]=A+I,t[8]=1-f-x,t}function SPe(t,e){const i=e[0],r=e[1],n=e[2],s=e[4],o=e[5],l=e[6],c=e[8],f=e[9],_=e[10],x=_*o-l*f,T=-_*s+l*c,A=f*s-o*c,M=i*x+r*T+n*A;if(!M)return null;const I=1/M;return t[0]=x*I,t[1]=(-_*r+n*f)*I,t[2]=(l*r-n*o)*I,t[3]=T*I,t[4]=(_*i-n*c)*I,t[5]=(-l*i+n*s)*I,t[6]=A*I,t[7]=(-f*i+r*c)*I,t[8]=(o*i-r*s)*I,t}function v_(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=e[4],l=e[5],c=e[6],f=e[7],_=e[8],x=e[9],T=e[10],A=e[11],M=e[12],I=e[13],L=e[14],F=e[15],z=i*l-r*o,k=i*c-n*o,U=i*f-s*o,j=r*c-n*l,H=r*f-s*l,Y=n*f-s*c,Q=_*I-x*M,ne=_*L-T*M,re=_*F-A*M,he=x*L-T*I,ce=x*F-A*I,be=T*F-A*L;let ye=z*be-k*ce+U*he+j*re-H*ne+Y*Q;return ye?(ye=1/ye,t[0]=(l*be-c*ce+f*he)*ye,t[1]=(c*re-o*be-f*ne)*ye,t[2]=(o*ce-l*re+f*Q)*ye,t[3]=(n*ce-r*be-s*he)*ye,t[4]=(i*be-n*re+s*ne)*ye,t[5]=(r*re-i*ce-s*Q)*ye,t[6]=(I*Y-L*H+F*j)*ye,t[7]=(L*U-M*Y-F*k)*ye,t[8]=(M*H-I*U+F*z)*ye,t):null}function Jlt(t,e,i){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/i,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function Klt(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function Qlt(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+t[6]**2+t[7]**2+t[8]**2)}function ect(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t[6]=e[6]+i[6],t[7]=e[7]+i[7],t[8]=e[8]+i[8],t}function TPe(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t[6]=e[6]-i[6],t[7]=e[7]-i[7],t[8]=e[8]-i[8],t}function tct(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*i,t}function ict(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t[3]=e[3]+i[3]*r,t[4]=e[4]+i[4]*r,t[5]=e[5]+i[5]*r,t[6]=e[6]+i[6]*r,t[7]=e[7]+i[7]*r,t[8]=e[8]+i[8]*r,t}function rct(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function nct(t,e){const i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],l=t[5],c=t[6],f=t[7],_=t[8],x=e[0],T=e[1],A=e[2],M=e[3],I=e[4],L=e[5],F=e[6],z=e[7],k=e[8],U=sl();return Math.abs(i-x)<=U*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(r-T)<=U*Math.max(1,Math.abs(r),Math.abs(T))&&Math.abs(n-A)<=U*Math.max(1,Math.abs(n),Math.abs(A))&&Math.abs(s-M)<=U*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-I)<=U*Math.max(1,Math.abs(o),Math.abs(I))&&Math.abs(l-L)<=U*Math.max(1,Math.abs(l),Math.abs(L))&&Math.abs(c-F)<=U*Math.max(1,Math.abs(c),Math.abs(F))&&Math.abs(f-z)<=U*Math.max(1,Math.abs(f),Math.abs(z))&&Math.abs(_-k)<=U*Math.max(1,Math.abs(_),Math.abs(k))}function Moe(t){const e=sl(),i=t[0],r=t[1],n=t[2],s=t[3],o=t[4],l=t[5],c=t[6],f=t[7],_=t[8];return Math.abs(1-(i*i+s*s+c*c))<=e&&Math.abs(1-(r*r+o*o+f*f))<=e&&Math.abs(1-(n*n+l*l+_*_))<=e}const sct=s5,oct=TPe;Object.freeze(Object.defineProperty({__proto__:null,add:ect,adjoint:Glt,copy:jlt,determinant:Hlt,equals:nct,exactEquals:rct,frob:Qlt,fromMat2d:Zlt,fromMat4:Yf,fromQuat:rj,fromRotation:Ylt,fromScaling:Xlt,fromTranslation:Wlt,identity:Eoe,invert:_E,isOrthoNormal:Moe,mul:sct,multiply:s5,multiplyScalar:tct,multiplyScalarAndAdd:ict,normalFromMat4:v_,normalFromMat4Legacy:SPe,projection:Jlt,rotate:Coe,scale:Aoe,scaleByVec2:qlt,set:Toe,str:Klt,sub:oct,subtract:TPe,translate:eU,transpose:Xf},Symbol.toStringTag,{value:"Module"}));function as(){return[1,0,0,0,1,0,0,0,1]}function EPe(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}function act(t,e,i,r,n,s,o,l,c){return[t,e,i,r,n,s,o,l,c]}function CPe(t,e){return new Float64Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:EPe,create:as,createView:CPe,fromValues:act},Symbol.toStringTag,{value:"Module"}));function Qe(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function o5(t){return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}function Ooe(t,e,i,r,n,s,o,l,c,f,_,x,T,A,M,I){return[t,e,i,r,n,s,o,l,c,f,_,x,T,A,M,I]}function APe(t,e){return new Float64Array(t,e,16)}const gs=Qe();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:gs,clone:o5,create:Qe,createView:APe,fromValues:Ooe},Symbol.toStringTag,{value:"Module"}));function Cp(){return[0,0,0,1]}function MPe(t){return[t[0],t[1],t[2],t[3]]}function lct(t,e,i,r){return[t,e,i,r]}function OPe(t,e){return new Float64Array(t,e,4)}const cct=Cp();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:cct,clone:MPe,create:Cp,createView:OPe,fromValues:lct},Symbol.toStringTag,{value:"Module"}));function uct(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function wL(t,e,i){i*=.5;const r=Math.sin(i);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i),t}function Poe(t,e){const i=2*Math.acos(e[3]),r=Math.sin(i/2);return r>sl()?(t[0]=e[0]/r,t[1]=e[1]/r,t[2]=e[2]/r):(t[0]=1,t[1]=0,t[2]=0),i}function nj(t,e,i){const r=e[0],n=e[1],s=e[2],o=e[3],l=i[0],c=i[1],f=i[2],_=i[3];return t[0]=r*_+o*l+n*f-s*c,t[1]=n*_+o*c+s*l-r*f,t[2]=s*_+o*f+r*c-n*l,t[3]=o*_-r*l-n*c-s*f,t}function hct(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],l=Math.sin(i),c=Math.cos(i);return t[0]=r*c+o*l,t[1]=n*c+s*l,t[2]=s*c-n*l,t[3]=o*c-r*l,t}function dct(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],l=Math.sin(i),c=Math.cos(i);return t[0]=r*c-s*l,t[1]=n*c+o*l,t[2]=s*c+r*l,t[3]=o*c-n*l,t}function pct(t,e,i){i*=.5;const r=e[0],n=e[1],s=e[2],o=e[3],l=Math.sin(i),c=Math.cos(i);return t[0]=r*c+n*l,t[1]=n*c-r*l,t[2]=s*c+o*l,t[3]=o*c-s*l,t}function fct(t,e){const i=e[0],r=e[1],n=e[2];return t[0]=i,t[1]=r,t[2]=n,t[3]=Math.sqrt(Math.abs(1-i*i-r*r-n*n)),t}function lF(t,e,i,r){const n=e[0],s=e[1],o=e[2],l=e[3];let c,f,_,x,T,A=i[0],M=i[1],I=i[2],L=i[3];return f=n*A+s*M+o*I+l*L,f<0&&(f=-f,A=-A,M=-M,I=-I,L=-L),1-f>sl()?(c=Math.acos(f),_=Math.sin(c),x=Math.sin((1-r)*c)/_,T=Math.sin(r*c)/_):(x=1-r,T=r),t[0]=x*n+T*A,t[1]=x*s+T*M,t[2]=x*o+T*I,t[3]=x*l+T*L,t}function mct(t){const e=M9,i=e(),r=e(),n=e(),s=Math.sqrt(1-i),o=Math.sqrt(i);return t[0]=s*Math.sin(2*Math.PI*r),t[1]=s*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function gct(t,e){const i=e[0],r=e[1],n=e[2],s=e[3],o=i*i+r*r+n*n+s*s,l=o?1/o:0;return t[0]=-i*l,t[1]=-r*l,t[2]=-n*l,t[3]=s*l,t}function __(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function PPe(t,e){const i=e[0]+e[4]+e[8];let r;if(i>0)r=Math.sqrt(i+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{let n=0;e[4]>e[0]&&(n=1),e[8]>e[3*n+n]&&(n=2);const s=(n+1)%3,o=(n+2)%3;r=Math.sqrt(e[3*n+n]-e[3*s+s]-e[3*o+o]+1),t[n]=.5*r,r=.5/r,t[3]=(e[3*s+o]-e[3*o+s])*r,t[s]=(e[3*s+n]+e[3*n+s])*r,t[o]=(e[3*o+n]+e[3*n+o])*r}return t}function yct(t,e,i,r){const n=.5*Math.PI/180;e*=n,i*=n,r*=n;const s=Math.sin(e),o=Math.cos(e),l=Math.sin(i),c=Math.cos(i),f=Math.sin(r),_=Math.cos(r);return t[0]=s*c*_-o*l*f,t[1]=o*l*_+s*c*f,t[2]=o*c*f-s*l*_,t[3]=o*c*_+s*l*f,t}function vct(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}const V9=mm,_ct=rs,bct=rse,wct=nj,xct=UT,Sct=wAe,Tct=_B,RPe=nse,Ect=RPe,IPe=sse,Cct=IPe,Roe=bAe,Act=rO,Mct=VT;function Oct(t,e,i){const r=Ve(e,i);return r<-.999999?(Wt(Jm,Pct,e),$h(Jm)<1e-6&&Wt(Jm,Rct,e),Ye(Jm,Jm),wL(t,Jm,Math.PI),t):r>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(Wt(Jm,e,i),t[0]=Jm[0],t[1]=Jm[1],t[2]=Jm[2],t[3]=1+r,Roe(t,t))}const Jm=W(),Pct=nt(1,0,0),Rct=nt(0,1,0);function Ict(t,e,i,r,n,s){return lF(mfe,e,n,s),lF(gfe,i,r,s),lF(t,mfe,gfe,2*s*(1-s)),t}const mfe=Cp(),gfe=Cp();function $ct(t,e,i,r){const n=Lct;return n[0]=i[0],n[3]=i[1],n[6]=i[2],n[1]=r[0],n[4]=r[1],n[7]=r[2],n[2]=-e[0],n[5]=-e[1],n[8]=-e[2],Roe(t,PPe(t,n))}const Lct=as();Object.freeze(Object.defineProperty({__proto__:null,add:bct,calculateW:fct,conjugate:__,copy:V9,dot:Sct,equals:Mct,exactEquals:Act,fromEuler:yct,fromMat3:PPe,getAxisAngle:Poe,identity:uct,invert:gct,len:Ect,length:RPe,lerp:Tct,mul:wct,multiply:nj,normalize:Roe,random:mct,rotateX:hct,rotateY:dct,rotateZ:pct,rotationTo:Oct,scale:xct,set:_ct,setAxes:$ct,setAxisAngle:wL,slerp:lF,sqlerp:Ict,sqrLen:Cct,squaredLength:IPe,str:vct},Symbol.toStringTag,{value:"Module"}));const Dct=new at(NCe),yfe=new at(hB),vfe=new at(dB),HKt=new at(FCe);function Zf(t){return t&&(r1(t)||Zn(t,yfe))?yfe:t&&(n1(t)||Zn(t,vfe))?vfe:Dct}function $Pe(t,e,i){const r=Math.sin(t),n=Math.cos(t),s=Math.sin(e),o=Math.cos(e),l=i;return l[0]=-r,l[4]=-s*n,l[8]=o*n,l[12]=0,l[1]=n,l[5]=-s*r,l[9]=o*r,l[13]=0,l[2]=0,l[6]=o,l[10]=s,l[14]=0,l[3]=0,l[7]=0,l[11]=0,l[15]=1,l}function Nct(t,e,i){return $Pe(t,e,i),ld(i,i),i}function uu(t,e,i,r){if(t==null||r==null)return!1;const n=_L(t,I5e),s=_L(r,Lot);if(n===s&&!_fe(s)&&(n!==Oe.UNKNOWN||Zn(t,r)))return L9(i,e),!0;if(_fe(s)){const o=CM[n][Oe.LON_LAT],l=CM[Oe.LON_LAT][s];return o!=null&&l!=null&&(o(e,0,ob,0),l(ob,0,ab,0),$Pe(cD*ob[0],cD*ob[1],i),i[12]=ab[0],i[13]=ab[1],i[14]=ab[2],!0)}if((s===Oe.WEB_MERCATOR||s===Oe.PLATE_CARREE)&&(n===Oe.WGS84||n===Oe.CGCS2000&&s===Oe.PLATE_CARREE||n===Oe.SPHERICAL_ECEF||n===Oe.WEB_MERCATOR)){const o=CM[n][Oe.LON_LAT],l=CM[Oe.LON_LAT][s];return o!=null&&l!=null&&(o(e,0,ob,0),l(ob,0,ab,0),n===Oe.SPHERICAL_ECEF?Nct(cD*ob[0],cD*ob[1],i):Hf(i),i[12]=ab[0],i[13]=ab[1],i[14]=ab[2],!0)}return!1}function _fe(t){return t===Oe.SPHERICAL_ECEF||t===Oe.SPHERICAL_MARS_PCPF||t===Oe.SPHERICAL_MOON_PCPF}const cD=Ei(1),ob=W(),ab=W();function el(t,e,i,r){return!(e==null||r==null||t.length<2)&&(t.length===2&&(uD[0]=t[0],uD[1]=t[1],uD[2]=0,t=uD),vn(t,e,0,i,r,0,1))}const uD=W(),vo=!0,WS={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function Ioe(t,e,i){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,i+WS.identifierOffset,WS.identifierLength)),version:e.getUint16(i+WS.versionOffset,vo),checksum:e.getUint32(i+WS.checksumOffset,vo)}}const Th={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function Fct(t,e){return{sizeLo:t.getUint32(e+Th.sizeLo,vo),sizeHi:t.getUint32(e+Th.sizeHi,vo),minX:t.getFloat64(e+Th.minX,vo),minY:t.getFloat64(e+Th.minY,vo),minZ:t.getFloat64(e+Th.minZ,vo),maxX:t.getFloat64(e+Th.maxX,vo),maxY:t.getFloat64(e+Th.maxY,vo),maxZ:t.getFloat64(e+Th.maxZ,vo),errorX:t.getFloat64(e+Th.errorX,vo),errorY:t.getFloat64(e+Th.errorY,vo),errorZ:t.getFloat64(e+Th.errorZ,vo),count:t.getUint32(e+Th.count,vo),reserved:t.getUint32(e+Th.reserved,vo)}}function qKt(t){const e=new DataView(t,0);let i=0;const{identifier:r,version:n}=Ioe(t,e,i);if(i+=WS.byteCount,r!=="LEPCC ")throw new se("lepcc-decode-error","Bad identifier");if(n>1)throw new se("lepcc-decode-error","Unknown version");const s=Fct(e,i);if(i+=Th.byteCount,s.sizeHi*2**32+s.sizeLo!==t.byteLength)throw new se("lepcc-decode-error","Bad size");const o=new Float64Array(3*s.count),l=[],c=[],f=[],_=[];if(i=hD(t,i,l),i=hD(t,i,c),i=hD(t,i,f),i=hD(t,i,_),i!==t.byteLength)throw new se("lepcc-decode-error","Bad length");let x=0,T=0;for(let A=0;A>6;let c=0;if(l===0)c=r.getUint32(1,vo),e+=5;else if(l===1)c=r.getUint16(1,vo),e+=3;else{if(l!==2)throw new se("lepcc-decode-error","Bad count type");c=r.getUint8(1),e+=2}if(o)throw new se("lepcc-decode-error","LUT not implemented");const f=Math.ceil(c*s/8),_=new Uint8Array(t,e,f);let x=0,T=0,A=0;const M=-1>>>32-s;for(let I=0;I>>=s,T-=s,T+s>32&&(x|=_[A-1]>>8-T)}return e+A}const N3={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function kct(t,e){return{sizeLo:t.getUint32(e+N3.sizeLo,vo),sizeHi:t.getUint32(e+N3.sizeHi,vo),count:t.getUint32(e+N3.count,vo),colorMapCount:t.getUint16(e+N3.colorMapCount,vo),lookupMethod:t.getUint8(e+N3.lookupMethod),compressionMethod:t.getUint8(e+N3.compressionMethod)}}function zct(t){const e=new DataView(t,0);let i=0;const{identifier:r,version:n}=Ioe(t,e,i);if(i+=WS.byteCount,r!=="ClusterRGB")throw new se("lepcc-decode-error","Bad identifier");if(n>1)throw new se("lepcc-decode-error","Unknown version");const s=kct(e,i);if(i+=N3.byteCount,s.sizeHi*2**32+s.sizeLo!==t.byteLength)throw new se("lepcc-decode-error","Bad size");if((s.lookupMethod===2||s.lookupMethod===1)&&s.compressionMethod===0){if(3*s.colorMapCount+s.count+i!==t.byteLength||s.colorMapCount>256)throw new se("lepcc-decode-error","Bad count");const o=new Uint8Array(t,i,3*s.colorMapCount),l=new Uint8Array(t,i+3*s.colorMapCount,s.count),c=new Uint8Array(3*s.count);for(let f=0;f1)throw new se("lepcc-decode-error","Unknown version");const s=Uct(e,i);if(i+=F3.byteCount,s.sizeHi*2**32+s.sizeLo!==t.byteLength)throw new se("lepcc-decode-error","Bad size");const o=new Uint16Array(s.count);if(s.bitsPerPoint===8){if(s.count+i!==t.byteLength)throw new se("lepcc-decode-error","Bad size");const l=new Uint8Array(t,i,s.count);for(let c=0;c=192&&s<224){if(n+1>=i)throw new se("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const o=(31&s)<<6|63&t[e+n+1];r+=String.fromCharCode(o),n+=2}else if(s>=224&&s<240){if(n+2>=i)throw new se("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(15&s)<<12|(63&t[e+n+1])<<6|63&t[e+n+2];r+=String.fromCharCode(o),n+=3}else{if(!(s>=240&&s<248))throw new se("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(n+3>=i)throw new se("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const o=(7&s)<<18|(63&t[e+n+1])<<12|(63&t[e+n+2])<<6|63&t[e+n+3];if(o>=65536){const l=55296+(o-65536>>10),c=56320+(1023&o);r+=String.fromCharCode(l,c)}else r+=String.fromCharCode(o);n+=4}}}return r}function LPe(t,e){const i={byteOffset:0,byteCount:0,fields:Object.create(null)};let r=0;for(let n=0;n{const n=r?Date.parse(r):null;return n&&!Number.isNaN(n)?n:null})}function DPe(t,e,i){const r=[];let n,s,o=0;for(s=0;s0){if(r.push(jct(i,o,n-1)),i[o+n-1]!==0)throw new se("string-array-error","Invalid string array: missing null termination.")}else r.push(null);o+=n}return r}function bfe(t,e){return new sj[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function Hct(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function qct(t,e,i){const r=e.header!=null?LPe(t,e.header):{byteOffset:0,byteCount:0,fields:{count:i}},n={header:r,byteOffset:r.byteCount,byteCount:0,entries:Object.create(null)};let s=r.byteCount;for(let o=0;onew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function FPe(t){return sj.hasOwnProperty(t)}function cF(t){return FPe(t)?sj[t].BYTES_PER_ELEMENT:0}function Qct(t,e,i,r){const n=eut(t,e,i),s=Qe();return uu(i,n,s,r),s}const kPe=1,wfe=5-kPe;function eut(t,e,i){const r=W(),n=t[3],s=2**(Math.ceil(Math.log(n)*Math.LOG2E/wfe)*wfe+kPe);if(i.isGeographic){const c=s/Sr(i).radius*180/Math.PI,f=Math.round(t[1]/c),_=Math.max(-90,Math.min(90,f*c)),x=c/Math.cos((Math.abs(_)-c/2)/180*Math.PI),T=Math.round(t[0]/x)*x;r[0]=T,r[1]=_}else{const c=Math.round(t[0]/s),f=Math.round(t[1]/s);r[0]=c*s,r[1]=f*s}const o=t[2]+e,l=Math.round(o/s);return r[2]=l*s,r}function tut(t){return t.type==="fill"}function iut(t){return t.type==="extrude"}var Wi;(function(t){t[t.INVISIBLE=0]="INVISIBLE",t[t.TRANSPARENT=1]="TRANSPARENT",t[t.OPAQUE=2]="OPAQUE"})(Wi||(Wi={}));function rut(t){return t&&t.enabled&&(iut(t)||tut(t))&&t.edges!=null}function nut(t){return t&&t.enabled&&t.edges||null}function zPe(t,e){return UPe(nut(t),e)}function UPe(t,e){if(t==null)return null;const i=t.color!=null?YB(qe.toUnitRGBA(t.color)):Mi(0,0,0,0),r=Tr(t.size),n=Tr(t.extensionLength);switch(t.type){case"solid":return VPe({color:i,size:r,extensionLength:n,...e});case"sketch":return sut({color:i,size:r,extensionLength:n,...e});default:return}}function VPe(t){return{...out,...t,type:"solid"}}function sut(t){return{...aut,...t,type:"sketch"}}const out={color:Mi(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:Wi.OPAQUE,hasSlicePlane:!1},aut={color:Mi(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:Wi.OPAQUE,hasSlicePlane:!1};var Uo;function BPe(t){switch(t){case"multiply":default:return Uo.Multiply;case"ignore":return Uo.Ignore;case"replace":return Uo.Replace;case"tint":return Uo.Tint}}function jPe(t,e,i){if(t==null||e===Uo.Ignore)return i[0]=255,i[1]=255,i[2]=255,void(i[3]=255);const r=Je(Math.round(t[3]*tU),0,tU),n=r===0||e===Uo.Tint?0:e===Uo.Replace?lut:cut;i[0]=Je(Math.round(t[0]*NE),0,NE),i[1]=Je(Math.round(t[1]*NE),0,NE),i[2]=Je(Math.round(t[2]*NE),0,NE),i[3]=r+n}(function(t){t[t.Multiply=1]="Multiply",t[t.Ignore=2]="Ignore",t[t.Replace=3]="Replace",t[t.Tint=4]="Tint"})(Uo||(Uo={}));const NE=255,tU=85,lut=tU,cut=2*tU;let k_=class{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&kO(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*xfe);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;ethis._reset());const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const i=new ArrayBuffer(this._itemsPerBuffer*this._itemByteSize);for(let r=0;re;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0}static createVec2f64(e=FE){return new k3(16,HPe,e)}static createVec3f64(e=FE){return new k3(24,oAe,e)}static createVec4f64(e=FE){return new k3(32,ZOe,e)}static createMat3f64(e=FE){return new k3(72,CPe,e)}static createMat4f64(e=FE){return new k3(128,APe,e)}static createQuatf64(e=FE){return new k3(32,OPe,e)}get test(){return{size:this._buffers.length*this._itemsPerBuffer*this._itemByteSize}}};const FE=4*N2.KILOBYTES,ZKt=mP.createVec2f64(),xt=mP.createVec3f64(),$oe=mP.createVec4f64();mP.createMat3f64();const Loe=mP.createMat4f64(),JKt=mP.createQuatf64();function Ko(t){return t?Sfe(Xr(t.origin),Xr(t.direction)):Sfe(W(),W())}function Sfe(t,e){return{origin:t,direction:e}}function KKt(t,e){return Fy(t.origin,e.origin)&&Fy(t.direction,e.direction)}function Sp(t,e){const i=fut.get();return i.origin=t,i.direction=e,i}function iU(t,e=Ko()){return JPe(t.origin,t.direction,e)}function Doe(t,e,i=Ko()){return Ne(i.origin,t),je(i.direction,e,t),i}function JPe(t,e,i=Ko()){return Ne(i.origin,t),Ne(i.direction,e),i}function dut(t,e){const i=Wt(xt.get(),Ye(xt.get(),t.direction),je(xt.get(),e,t.origin));return Ve(i,i)}function put(t,e,i){const r=Ve(t.direction,je(i,e,t.origin));return Be(i,t.origin,De(i,t.direction,r)),i}const fut=new k_(()=>Ko());function QKt(t,e,i){const r=Ve(t,e)/Ve(t,t);return De(i,t,r)}function y2(t,e){return Ve(t,e)/rt(t)}function oj(t,e){const i=Ve(t,e)/(rt(t)*rt(e));return-Ca(i)}function KPe(t,e,i){Ye(dD,t),Ye(BH,e);const r=Ve(dD,BH),n=Ca(r),s=Wt(dD,dD,BH);return Ve(s,i)<0?2*Math.PI-n:n}const dD=W(),BH=W(),QPe=co();function co(){return Xi()}const eRe=VT,mut=VT;function a5(t,e=co()){return mm(e,t)}function Noe(t,e){return Mi(t[0],t[1],t[2],e)}function gut(t){return t}function yut(t){t[0]=t[1]=t[2]=t[3]=0}function aj(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function Zv(t){return t[3]}function vut(t){return t}function tRe(t,e,i,r){return Mi(t,e,i,r)}function _ut(t,e,i){return t!==i&&Ne(i,t),i[3]=t[3]+e,i}function but(t,e,i){return Ce.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===i?i:a5(t,i)}function lx(t,e,i){if(e==null||!rRe(t,e,rU))return!1;let{t0:r,t1:n}=rU;if((r<0||n0)&&(r=n),r<0)return!1;if(i){const{origin:s,direction:o}=e;i[0]=s[0]+o[0]*r,i[1]=s[1]+o[1]*r,i[2]=s[2]+o[2]*r}return!0}function iRe(t,e,i){const r=Doe(e,i);if(!rRe(t,r,rU))return[];const{origin:n,direction:s}=r,{t0:o,t1:l}=rU,c=f=>{const _=W();return ao(_,n,s,f),lj(t,_,_)};return Math.abs(o-l)Math.abs(t[1])?Ie(e,0,1,0):Ie(e,1,0,0),Wt(i,t,e),Ye(e,e),Wt(e,i,t),Ye(i,i)}function pD(t,e,i,r,n,s){const o=t+(e-t)*n;return o+(i+(r-i)*n-o)*s}function Out(t,e,i,r=W()){const n=rt(t),s=rt(e),o=Ve(t,e)/(n*s);if(o<.9999999999999999){const l=Math.acos(o),c=((1-i)*n+i*s)/Math.sin(l),f=c/n*Math.sin((1-i)*l),_=c/s*Math.sin(i*l);return De(YS,t,f),De(XS,e,_),Be(r,YS,XS)}return Qr(r,t,e,i)}function tQt(t,e,i,r=W(),n=W()){const s=rt(t),o=rt(e),l=Ve(t,e)/(s*o);if(l<.9999999999999999){const c=Math.acos(l),f=Math.sin(c),_=Math.sin(i*c),x=Math.sin((1-i)*c),T=(1-i)*s+i*o;{const A=T/f,M=A/o*_;De(YS,t,A/s*x),De(XS,e,M),Be(r,YS,XS)}{const A=1/s*(-Math.cos((1-i)*c)*c*T+x*(-s+o));De(YS,t,A);const M=1/o*(Math.cos(i*c)*c*T+_*(-s+o));De(XS,e,M),Be(n,YS,XS),De(n,n,1/f)}return n}return Qr(r,t,e,i),je(n,e,t),Ye(n,n),n}function uF(t,e,i){t=Ye(YS,t),e=Ye(XS,e);const r=Ca(Ve(t,e));if(i){const n=Wt(Put,t,e);if(Ve(n,i)<0)return-r}return r}function hF(t){const e=t.length;return i=>{if(i<=t[0][0])return t[0][1];if(i>=t[e-1][0])return t[e-1][1];let r=1;for(;i>t[r][0];)r++;const n=t[r-1][0],s=t[r][0],o=(s-i)/(s-n);return o*t[r-1][1]+(1-o)*t[r][1]}}function iQt(t,e,i,r){je(Tfe,e,t),je(Efe,i,t),Wt(r,Tfe,Efe),Ye(r,r),r[3]=-Ve(t,r)}const Tfe=W(),Efe=W(),Put=W(),YS=W(),XS=W();function Fi(t=k4){return[t[0],t[1],t[2],t[3]]}function Rut(t=k4[0],e=k4[1],i=k4[2],r=k4[3]){return Foe(t,e,i,r,$oe.get())}function uj(t,e){return Foe(e[0],e[1],e[2],e[3],t)}function Foe(t,e,i,r,n=Fi()){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function cRe(t,e,i){return Ne(i,t),i[3]=e,i}function z_(t,e,i){const r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=Math.abs(r-1)>1e-5&&r>1e-12?1/Math.sqrt(r):1;return i[0]=e[0]*n,i[1]=e[1]*n,i[2]=e[2]*n,i[3]=-(i[0]*t[0]+i[1]*t[1]+i[2]*t[2]),i}function jl(t,e,i,r=Fi()){const n=i[0]-e[0],s=i[1]-e[1],o=i[2]-e[2],l=t[0]-e[0],c=t[1]-e[1],f=t[2]-e[2],_=s*f-o*c,x=o*l-n*f,T=n*c-s*l,A=_*_+x*x+T*T,M=Math.abs(A-1)>1e-5&&A>1e-12?1/Math.sqrt(A):1;return r[0]=_*M,r[1]=x*M,r[2]=T*M,r[3]=-(r[0]*t[0]+r[1]*t[1]+r[2]*t[2]),r}function koe(t,e,i,r=0,n=Math.floor(i*(1/3)),s=Math.floor(i*(2/3))){if(i<3)return!1;e(qP,r);let o=n,l=!1;for(;oIe(n,e[3*s+0],e[3*s+1],e[3*s+2]),i?r-1:r)}const $ut=.99619469809,qP=W(),kE=W(),MS=W(),fD=W(),mD=W();function xQ(t,e,i){return e!==t&&uj(t,e),t[3]=-Ve(t,i),t}function SQ(t,e){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function xL(t,e,i,r){return Wt(MS,e,t),z_(i,MS,r)}function uRe(t,e,i,r){return hj(t,e,je(xt.get(),i,e),zut,r)}function bE(t,e,i){return e!=null&&hj(t,e.origin,e.direction,Uut,i)}function Lut(t,e,i){return hj(t,e.origin,e.vector,Cy.NONE,i)}function Dut(t,e,i){return hj(t,e.origin,e.vector,Cy.CLAMP,i)}const Nut=(()=>{const t=W();return(e,i,r)=>{const n=e,s=i;if(Wt(t,n,s),El(t)x&&_>T?(f[1]=(U*I-k*z)/o,f[2]=(k*F-U*M)/o):x>T?(f[0]=(k*z-U*I)/l,f[2]=(U*A-k*L)/l):(f[0]=(U*M-k*F)/c,f[1]=(k*L-U*A)/c),Ne(r.direction,t),!0}})();function zoe(t,e){return fn(t,e)>=0}function Fut(t,e){const i=Ve(t,e.ray.direction),r=-fn(t,e.ray.origin);if(r<0&&i>=0)return!1;if(i>-1e-6&&i<1e-6)return r>0;if((r<0||i<0)&&!(r<0&&i<0))return!0;const n=r/i;return i>0?ne.c0&&(e.c0=n),e.c0<=e.c1}function kut(t,e){const i=Ve(t,e.ray.direction),r=-fn(t,e.ray.origin);if(i>-1e-6&&i<1e-6)return r>0;const n=r/i;return i>0?ne.c0&&(e.c0=n),e.c0<=e.c1}function Uoe(t,e,i){const r=De(xt.get(),t,-t[3]),n=TQ(t,je(xt.get(),e,r),xt.get());return Be(i,n,r),i}function rQt(t,e,i,r){const n=t,s=xt.get(),o=xt.get();lRe(n,s,o);const l=je(xt.get(),i,e),c=y2(s,l),f=y2(o,l),_=y2(n,l);return Ie(r,c,f,_)}function TQ(t,e,i){const r=De(xt.get(),t,Ve(t,e));return je(i,e,r),i}function EQ(t,e){return Math.abs(fn(t,e))}function fn(t,e){return Ve(t,e)+t[3]}function hj(t,e,i,r,n){const s=Ve(t,i);if(s===0)return!1;let o=-(Ve(t,e)+t[3])/s;return r&Cy.CLAMP&&(o=Je(o,0,1)),!(!(r&Cy.INFINITE_MIN)&&o<0||!(r&Cy.INFINITE_MAX)&&o>1)&&(Be(n,e,De(n,i,o)),!0)}function nQt(t){return t}function Cfe(t){return Math.abs(t[2])r&&(r=o,n=s)}Yh(e,t.minVert[n]),Yh(i,t.maxVert[n])}const $p=[0,0,0];function Hut(t,e,i,r){const{data:n,size:s}=t;let o=Number.NEGATIVE_INFINITY,l=0;for(let c=0;co&&(o=x,l=c)}return Yh(r,n,l),o}const Sa=[0,0];function qut(t,e,i,r,n){Yut(t,e,Sa,n,r);const s=fRe(i,e);Sa[1]-c5<=s&&(r[0]=void 0),Sa[0]+c5>=s&&(n[0]=void 0)}const Mfe=[0,0,0],Ofe=[0,0,0],Pfe=[0,0,0],zE=[0,0,0],UE=[0,0,0],yD=[0,0,0];function z3(t,e,i,r,n,s){if(pRe(e)i[1]&&(i[1]=c,Yh(n,s,l))}}function Rfe(t,e,i){Yh(i.center,t),OS(i.halfSize,e,.5),i.quaternion[0]=0,i.quaternion[1]=0,i.quaternion[2]=0,i.quaternion[3]=1}const v1=[0,0,0],VE=[0,0,0],ZP=[0,0,0],uO=[0,0,0],hO=[0,0,0],Ife=[0,0,0];function Xut(t,e,i){Yh(v1,e),Math.abs(e[0])>Math.abs(e[1])&&Math.abs(e[0])>Math.abs(e[2])?v1[0]=0:Math.abs(e[1])>Math.abs(e[2])?v1[1]=0:v1[2]=0,pRe(v1)this.maxProj[0]&&(this.maxProj[0]=f,s[0]=c),f=o[c+1],fthis.maxProj[1]&&(this.maxProj[1]=f,s[1]=c),f=o[c+2],fthis.maxProj[2]&&(this.maxProj[2]=f,s[2]=c),f=o[c]+o[c+1]+o[c+2],fthis.maxProj[3]&&(this.maxProj[3]=f,s[3]=c),f=o[c]+o[c+1]-o[c+2],fthis.maxProj[4]&&(this.maxProj[4]=f,s[4]=c),f=o[c]-o[c+1]+o[c+2],fthis.maxProj[5]&&(this.maxProj[5]=f,s[5]=c),f=o[c]-o[c+1]-o[c+2],fthis.maxProj[6]&&(this.maxProj[6]=f,s[6]=c)}for(let c=0;c0){const r=1/Math.sqrt(i);t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r}}function pRe(t){return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function AQ(t,e){const i=e[0]-t[0],r=e[1]-t[1],n=e[2]-t[2];return i*i+r*r+n*n}function fRe(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Kut(t,e){const i=e[0]+e[4]+e[8];if(i>0){let r=Math.sqrt(i+1);t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r}else{let r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);const n=(r+1)%3,s=(r+2)%3;let o=Math.sqrt(e[3*r+r]-e[3*n+n]-e[3*s+s]+1);t[r]=.5*o,o=.5/o,t[3]=(e[3*n+s]-e[3*s+n])*o,t[n]=(e[3*n+r]+e[3*r+n])*o,t[s]=(e[3*s+r]+e[3*r+s])*o}}const fT=Cp(),Qc=W(),MQ=W(),Qut=as();function dj(t=[0,0,0],e=[-1,-1,-1],i=Cp()){return{center:Xr(t),halfSize:Xr(e),quaternion:MPe(i)}}function $fe(t){return dj(t.center,t.halfSize,t.quaternion)}function cQt(t,e){Ne(e.center,t.center),Ne(e.halfSize,t.halfSize),V9(e.quaternion,t.quaternion)}function mRe(t,e){return e=e||dj(),Vut(t,e),e}function U3(t,e){const i=fn(e,t.center),r=pj(t,e);return i>r?1:i<-r?-1:0}function uQt(t,e){return Qc[0]=t.center[0]-e[0],Qc[1]=t.center[1]-e[1],Qc[2]=t.center[2]-e[2],__(fT,t.quaternion),Of(Qc,Qc,fT),GO(Qc,Qc),yB(MQ,Qc,t.halfSize),vB(MQ,Qc)1e-6){const f=(r+t.halfSize[c]-n[c])/s[c],_=(-r-t.halfSize[c]-n[c])/s[c];o=Math.max(o,Math.min(f,_)),l=Math.min(l,Math.max(f,_))}else if(n[c]>t.halfSize[c]+r||n[c]<-t.halfSize[c]-r)return!1;return o<=l}(()=>{const t=new Int8Array(162);let e=0;const i=r=>{for(let n=0;n0?1+e/o:1,c=s>0?1+i/s:1,f=(c+l)/2,_=(c-l)/2;De(n.halfSize,jE,_),ao(n.halfSize,n.halfSize,t.halfSize,f),De(n.center,jE,f),ao(n.center,n.center,t.halfSize,_),Iz(hb,hb),gB(n.center,n.center,hb),Of(n.center,n.center,n.quaternion)}}else{const s=Ie(hb,0,0,1);ao(n.center,t.center,s,(i+e)/2),__(_D,t.quaternion),Of(s,s,_D),GO(s,s),ao(n.halfSize,t.halfSize,s,(i-e)/2)}return n}const hb=W(),jE=W(),GE=W(),_D=Cp();function vRe(t){return t?parseInt(t.substring(t.lastIndexOf("/")+1,t.length),10):void 0}function gQt(t){var e;if(Le("disable-feature:i3s-draco")||!t)return!1;for(const i of t)for(const r of i.geometryBuffers)if(((e=r.compressedAttributes)==null?void 0:e.encoding)==="draco")return!0;return!1}function yQt(t,e,i,r){i.traverse(e,n=>{const s=n.mbs;return(s!=null&&tht(t,s))!==ZS.OUTSIDE&&(r(n),!0)})}function vQt(t,e,i){let r=0,n=0;for(let s=0;s=0===e&&(i[n]=i[r],n++),r++;i.length=n}const JP=Ni();function bQt(t,e){if(e.rotationScale[1]===0&&e.rotationScale[2]===0&&e.rotationScale[3]===0&&e.rotationScale[5]===0&&e.rotationScale[6]===0&&e.rotationScale[7]===0)return JP[0]=(t[0]-e.position[0])/e.rotationScale[0],JP[1]=(t[1]-e.position[1])/e.rotationScale[4],JP[2]=(t[2]-e.position[0])/e.rotationScale[0],JP[3]=(t[3]-e.position[1])/e.rotationScale[4],JP}var ZS;function tht(t,e){const i=e[0],r=e[1],n=e[3],s=t[0]-i,o=i-t[2],l=t[1]-r,c=r-t[3],f=Math.max(s,o,0),_=Math.max(l,c,0),x=f*f+_*_;return x>n*n?ZS.OUTSIDE:x>0?ZS.INTERSECTS_CENTER_OUTSIDE:-Math.max(s,o,l,c)>n?ZS.INSIDE:ZS.INTERSECTS_CENTER_INSIDE}function iht(t,e,i){const r=[],n=i==null?void 0:i.missingFields,s=i==null?void 0:i.originalFields;for(const o of t){const l=o.toLowerCase();let c=!1;for(const f of e)if(l===f.name.toLowerCase()){r.push(f.name),c=!0,s&&s.push(o);break}!c&&n&&n.push(o)}return r}async function wQt(t,e,i,r,n){if(e.length===0)return[];const s=t.attributeStorageInfo;if(t.associatedLayer!=null)try{return await nht(t.associatedLayer,e,i,r)}catch(o){if(t.associatedLayer.loaded)throw o}if(s){const o=rht(e,i,n);if(o==null)throw new se("scenelayer:features-not-loaded","Tried to query attributes for unloaded features");const l=t.parsedUrl.path;return(await Promise.all(o.map(c=>sht(l,s,c.node,c.indices,r).then(f=>{for(let _=0;_=0){let x=r.get(f.node);x||(x={node:f.node,indices:[],graphics:[]},n.push(x),r.set(f.node,x)),x.indices.push(_),x.graphics.push(o);for(let T=c;T>0;T--)s[T]=s[T-1];s[0]=f;break}}}return n}async function nht(t,e,i,r){e.sort((c,f)=>c.attributes[i]-f.attributes[i]);const n=e.map(c=>c.attributes[i]),s=[],o=iht(r,t.fields,{originalFields:s}),l=await _Re(t,n,o);for(let c=0;cr){const s=L3e(e,r);return Promise.all(s.map(o=>_Re(t,o,i))).then(o=>o.flat())}const n=new F_({objectIds:e,outFields:i,orderByFields:[t.objectIdField]});return t.queryFeatures(n).then(s=>{if(s&&s.features&&s.features.length===e.length)return s.features.map(o=>o.attributes);throw new se("scenelayer:feature-not-in-associated-layer","Feature not found in associated feature layer")})}function sht(t,e,i,r,n){return bRe(t,e,i.resources.attributes,r,n)}async function bRe(t,e,i,r,n){const s=[];for(const c of e)if(c&&n.includes(c.name)){const f=`${t}/nodes/${i}/attributes/${c.key}/0`;s.push({url:f,storageInfo:c})}const o=await Promise.allSettled(s.map(c=>bi(c.url,{responseType:"array-buffer"}).then(f=>Jct(c.storageInfo,f.data)))),l=[];for(const c of r){const f={};for(let _=0;_{if(!l)if(l=PQ,od(bD),t.serviceObb!=null){vht(t.serviceObb,i,Dfe,e,n),gRe(Dfe,l);for(const A of l)bt(A,A,wD),nO(bD,A)}else{const A=t.mbs;if(!A)return;const M=A[3];el(A,i,zr,e),bt(zr,zr,wD),zr[2]+=n;for(let I=0;I<8;++I){const L=1&I?M:-M,F=2&I?M:-M,z=4&I?M:-M,k=l[I];Ne(k,[zr[0]+L,zr[1]+F,zr[2]+z]),nO(bD,k)}}};let f=1/0,_=-1/0;const x=A=>{if(A.type!=="replace")return;const M=A.geometry;if(!(M!=null&&M.hasZ))return;od(GH);const I=M.spatialReference||r,L=M.rings.reduce((F,z)=>z.reduce((k,U)=>(el(U,I,zr,e),bt(zr,zr,wD),nO(GH,zr),Math.min(zr[2],k)),F),1/0);c(),P9(bD,GH)&&(f=Math.min(f,L),_=Math.max(_,L))};if(s.forEach(A=>x(A)),f===1/0)return null;const T=(A,M,I)=>{bt(zr,I,o),A[M]=zr[0],A[M+1]=zr[1],A[M+2]=zr[2],M+=24,I[2]=f,bt(zr,I,o),A[M]=zr[0],A[M+1]=zr[1],A[M+2]=zr[2],M+=24,I[2]=_,bt(zr,I,o),A[M]=zr[0],A[M+1]=zr[1],A[M+2]=zr[2]};for(let A=0;A<8;++A)T(Nfe.data,3*A,l[A]);return mRe(Nfe)}function LQt(t){return t!=null&&t.halfSize[0]>=0}function DQt(t){return t[3]>=0}function NQt(t){t!=null&&(t.halfSize[0]=-1)}function FQt(t){t!=null&&(t[3]=-1)}const vd=Qe(),xv=Cp(),PQ=[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],GH=Ni(),bD=Ni(),Dfe=dj(),zr=W(),Nfe={data:new Array(72),size:3,exclusive:!0,stride:3},wD=Qe();async function Eht(t,e=t.popupTemplate){var _,x;if(e==null)return[];const i=await e.getRequiredFields(t.fieldsIndex),{lastEditInfoEnabled:r}=e,{objectIdField:n,typeIdField:s,globalIdField:o,relationships:l}=t;if(i.includes("*"))return["*"];const c=r?yit(t):[],f=RB(t.fieldsIndex,[...i,...c]);return s&&f.push(s),f&&n&&((_=t.fieldsIndex)!=null&&_.has(n))&&!f.includes(n)&&f.push(n),f&&o&&((x=t.fieldsIndex)!=null&&x.has(o))&&!f.includes(o)&&f.push(o),l&&l.forEach(T=>{var M;const{keyField:A}=T;f&&A&&((M=t.fieldsIndex)!=null&&M.has(A))&&!f.includes(A)&&f.push(A)}),f}function xRe(t,e){return t.popupTemplate?t.popupTemplate:e!=null&&e.defaultPopupTemplateEnabled&&t.defaultPopupTemplate!=null?t.defaultPopupTemplate:null}function kQt(t,e){return xRe(t,{defaultPopupTemplateEnabled:e})!=null}const Cht=new Set(["3DObject","Point"]),Ffe=Iat();let _i=class extends not(cat(m5e(XB(JB(OB(fP(Gst(Xs(uE))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new it,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){var n,s,o;const r=(s=(n=this.getFeatureType(i==null?void 0:i.feature))==null?void 0:n.domains)==null?void 0:s[e];return r&&r.type!=="inherited"?r:((o=this.getField(e))==null?void 0:o.domain)??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){var e;return((e=this.associatedLayer)==null?void 0:e.types)??[]}get typeIdField(){var e;return((e=this.associatedLayer)==null?void 0:e.typeIdField)??null}get templates(){var e;return((e=this.associatedLayer)==null?void 0:e.templates)??null}get formTemplate(){var e;return((e=this.associatedLayer)==null?void 0:e.formTemplate)??null}get fieldsIndex(){return new Zse(this.fields)}readNodePages(e,i,r){return i.layerType==="Point"&&(e=i.pointNodePages),e==null||typeof e!="object"?null:AS.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){var e;return this._capabilitiesFromAssociatedFeatureLayer((e=this.associatedLayer)==null?void 0:e.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Pat(this.associatedLayer)}get geometryType(){return Aht[this.profile]||"mesh"}set renderer(e){upe(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){var e;return this._capabilitiesFromAssociatedFeatureLayer((e=this.associatedLayer)==null?void 0:e.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){var H;e=e??fat;const{query:i,queryRelated:r,editing:{supportsGlobalId:n,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:l,supportsReturnServiceEditsInSourceSpatialReference:c},data:{supportsZ:f,supportsM:_,isVersioned:x,supportsAttachment:T},operations:{supportsEditing:A,supportsAdd:M,supportsUpdate:I,supportsDelete:L,supportsQuery:F,supportsQueryAttachments:z,supportsAsyncConvert3D:k}}=e,U=e.operations.supportsChangeTracking,j=!!((H=this.associatedLayer)!=null&&H.infoFor3D)&&Upe();return{query:i,queryRelated:r,editing:{supportsGlobalId:n,supportsReturnServiceEditsInSourceSpatialReference:c,supportsRollbackOnFailure:s,supportsGeometryUpdate:j&&l,supportsUploadWithItemId:o},data:{supportsAttachment:T,supportsZ:f,supportsM:_,isVersioned:x},operations:{supportsQuery:F,supportsQueryAttachments:z,supportsEditing:A&&U,supportsAdd:j&&M&&U,supportsDelete:j&&L&&U,supportsUpdate:I&&U,supportsAsyncConvert3D:k}}}get editingEnabled(){var e;return this._isOverridden("editingEnabled")?this._get("editingEnabled"):((e=this.associatedLayer)==null?void 0:e.editingEnabled)??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){var e;return((e=this.associatedLayer)==null?void 0:e.infoFor3D)??null}get relationships(){var e;return(e=this.associatedLayer)==null?void 0:e.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,i){return!e&&i.fields&&i.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,i){return!e&&i.fields&&i.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){var e;return((e=this.associatedLayer)==null?void 0:e.displayField)??null}readProfile(e,i){const r=i.store.profile;return r!=null&&kfe[r]?kfe[r]:(Ce.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const i=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(zo),await this._fetchService(i),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,i),this._setAssociatedFeatureLayer(i),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await Alt(this,{origin:"service"},i),upe(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){Ce.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new F_;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,i){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),i))}queryFeatureCount(e,i){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),i))}queryFeatures(e,i){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),i)).then(r=>{if(r!=null&&r.features)for(const n of r.features)n.layer=this,n.sourceLayer=this;return r})}async queryRelatedFeatures(e,i){if(await this.load(),!this.associatedLayer)throw new se("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,i)}async queryRelatedFeaturesCount(e,i){if(await this.load(),!this.associatedLayer)throw new se("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,i)}async queryCachedAttributes(e,i){const r=hit(this.fieldsIndex,await Eht(this,xRe(this)));return bRe(this.parsedUrl.path,this.attributeStorageInfo??[],e,i,r)}async queryCachedFeature(e,i){const r=await this.queryCachedAttributes(e,[i]);if(!r||r.length===0)throw new se("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const n=new Ml;return n.attributes=r[0],n.layer=this,n.sourceLayer=this,n}queryObjectIds(e,i){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),i))}queryAttachments(e,i){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,i))}getFieldUsageInfo(e){const i={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||i:(Ce.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),i)}createPopupTemplate(e){return Llt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new se("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new se("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(i=>i.name===e)}async queryCachedStatistics(e,i){if(await this.load(i),!this.statisticsInfo)throw new se("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new se("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const n of this.statisticsInfo)if(n.name===r.name){const s=s0(this.parsedUrl.path,n.href);return bi(s,{query:{f:"json",token:this.apiKey},responseType:"json",signal:i?i.signal:null}).then(o=>o.data)}throw new se("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,i){return this._debouncedSaveOperations(n5.SAVE_AS,{...i,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(n5.SAVE,e)}async applyEdits(e,i){const{applyEdits:r}=await we(()=>import("./editingSupport-EiPa9PKq.js"),__vite__mapDeps([]));let n=i;await this.load();const s=this.associatedLayer;if(!s)throw new se(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,l=!!s.infoFor3D,c=(n==null?void 0:n.globalIdUsed)??!0;if(l&&o==null)throw new se(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(l&&!c)throw new se(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return qpe(s.url)&&l&&e.deleteFeatures!=null&&o!=null&&(n={...n,globalIdToObjectId:await oPe(s,e.deleteFeatures,o)}),r(this,s.source,e,n)}async uploadAssets(e,i){if(await this.load(),this.associatedLayer==null)throw new se(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,i)}on(e,i){return super.on(e,i)}validateLayer(e){if(e.layerType&&!Cht.has(e.layerType))throw new se("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new se("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new se("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function i(r,n){let s=!1,o=!1;if(r==null)s=!0,o=!0;else{const l=n&&n.isGeographic;switch(r){case"east-north-up":case"earth-centered":s=!0,o=l;break;case"vertex-reference-frame":s=!0,o=!l;break;default:s=!1}}if(!s)throw new se("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!o)throw new se("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}i(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new se("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){var e,i;if(this._fieldUsageInfo={},this.fields)for(const r of this.fields){const n=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(l=>l.name===r.name)),s=!!((i=(e=this.associatedLayer)==null?void 0:e.fields)!=null&&i.some(l=>l&&r.name===l.name)),o={supportsLabelingInfo:n,supportsRenderer:n,supportsPopupTemplate:n||s,supportsLayerQuery:s};this._fieldUsageInfo[r.name]=o}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){var i;if(!((i=this.associatedLayer)!=null&&i.fields))return;let e=null;for(const r of this.associatedLayer.fields){const n=this.getField(r.name);n?(!n.domain&&r.domain&&(n.domain=r.domain.clone()),n.editable=r.editable,n.nullable=r.nullable,n.length=r.length):(e||(e=this.fields?this.fields.slice():[]),e.push(r.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],i=Zl(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?Ce.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):Ce.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&pfe(Ce.getLogger(this),Rlt("Mesh scene layers","relative-to-scene",e)),pfe(Ce.getLogger(this),Ilt("Scene layers",e))}};y([w({types:{key:"type",base:c$,typeMap:{selection:Rat}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],_i.prototype,"featureReduction",void 0),y([w({type:[ew],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],_i.prototype,"rangeInfos",void 0),y([w({json:{read:!1}})],_i.prototype,"associatedLayer",void 0),y([w({type:["show","hide"]})],_i.prototype,"listMode",void 0),y([w({type:["ArcGISSceneServiceLayer"]})],_i.prototype,"operationalLayerType",void 0),y([w({json:{read:!1},readOnly:!0})],_i.prototype,"type",void 0),y([w({...Ffe.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_i.prototype,"fields",void 0),y([w()],_i.prototype,"types",null),y([w()],_i.prototype,"typeIdField",null),y([w()],_i.prototype,"templates",null),y([w()],_i.prototype,"formTemplate",null),y([w({readOnly:!0,clonable:!1})],_i.prototype,"fieldsIndex",null),y([w({type:clt,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],_i.prototype,"floorInfo",void 0),y([w(Ffe.outFields)],_i.prototype,"outFields",void 0),y([w({type:AS,readOnly:!0,json:{read:!1}})],_i.prototype,"nodePages",void 0),y([$t("service","nodePages",["nodePages","pointNodePages"])],_i.prototype,"readNodePages",null),y([w({type:[Hp],readOnly:!0})],_i.prototype,"materialDefinitions",void 0),y([w({type:[D4],readOnly:!0})],_i.prototype,"textureSetDefinitions",void 0),y([w({type:[F4],readOnly:!0})],_i.prototype,"geometryDefinitions",void 0),y([w({readOnly:!0})],_i.prototype,"serviceUpdateTimeStamp",void 0),y([w({readOnly:!0})],_i.prototype,"attributeStorageInfo",void 0),y([w({readOnly:!0})],_i.prototype,"statisticsInfo",void 0),y([w({type:it.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],_i.prototype,"excludeObjectIds",void 0),y([w({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],_i.prototype,"definitionExpression",void 0),y([w({type:Clt,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],_i.prototype,"filter",void 0),y([w({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],_i.prototype,"path",void 0),y([w(yot)],_i.prototype,"elevationInfo",null),y([w({readOnly:!0,json:{read:!1}})],_i.prototype,"effectiveCapabilities",null),y([w({readOnly:!0})],_i.prototype,"effectiveEditingEnabled",null),y([w({type:String})],_i.prototype,"geometryType",null),y([w(got)],_i.prototype,"labelsVisible",void 0),y([w({type:[hPe],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:dfe},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:dfe},write:!0}})],_i.prototype,"labelingInfo",void 0),y([w(b5e)],_i.prototype,"legendEnabled",void 0),y([w({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(t,e){var r,n;if(typeof t=="number"&&t>=0&&t<=1)return t;const i=(n=(r=e.layerDefinition)==null?void 0:r.drawingInfo)==null?void 0:n.transparency;return i!==void 0?jT(i):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],_i.prototype,"opacity",void 0),y([w({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_i.prototype,"priority",void 0),y([w({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],_i.prototype,"semantic",void 0),y([w({types:$st,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],_i.prototype,"renderer",null),y([w({json:{read:!1}})],_i.prototype,"cachedDrawingInfo",void 0),y([$t("service","cachedDrawingInfo")],_i.prototype,"readCachedDrawingInfo",null),y([w({readOnly:!0,json:{read:!1}})],_i.prototype,"capabilities",null),y([w({type:Boolean,json:{read:!1}})],_i.prototype,"editingEnabled",null),y([w({readOnly:!0,json:{write:!1,read:!1}})],_i.prototype,"infoFor3D",null),y([w({readOnly:!0,json:{write:!1,read:!1}})],_i.prototype,"relationships",null),y([w(mot)],_i.prototype,"popupEnabled",void 0),y([w({type:hE,json:{name:"popupInfo",write:!0}})],_i.prototype,"popupTemplate",void 0),y([w({readOnly:!0,json:{read:!1}})],_i.prototype,"defaultPopupTemplate",null),y([w({type:String,json:{read:!1}})],_i.prototype,"objectIdField",void 0),y([$t("service","objectIdField",["objectIdField","fields"])],_i.prototype,"readObjectIdField",null),y([w({type:String,json:{read:!1}})],_i.prototype,"globalIdField",void 0),y([$t("service","globalIdField",["globalIdField","fields"])],_i.prototype,"readGlobalIdField",null),y([w({readOnly:!0,type:String,json:{read:!1}})],_i.prototype,"displayField",null),y([w({type:String,json:{read:!1}})],_i.prototype,"profile",void 0),y([$t("service","profile",["store.profile"])],_i.prototype,"readProfile",null),y([w({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],_i.prototype,"normalReferenceFrame",void 0),y([w(fot)],_i.prototype,"screenSizePerspectiveEnabled",void 0),y([w({json:{read:!1,origins:{service:{read:!0}}}})],_i.prototype,"serviceItemId",void 0),_i=y([Z("esri.layers.SceneLayer")],_i);const kfe={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Aht={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},SRe=_i,Mht=Object.freeze(Object.defineProperty({__proto__:null,default:SRe},Symbol.toStringTag,{value:"Module"}));let AA=class extends it{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(wSe(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let i=0;for(const r of e)r!=null&&(i=this._processCollection(i,r));this.splice(i,this.length)}_createNewInstance(e){return new it(e)}_processCollection(e,i){if(!i)return e;const r=this.itemFilterFunction??(n=>!!n);for(const n of i)if(n){if(r(n)){const s=this.indexOf(n,e);s>=0?s!==e&&this.reorder(n,e):this.add(n,e),++e}if(this.getChildrenFunction){const s=this.getChildrenFunction(n);if(Array.isArray(s))for(const o of s)e=this._processCollection(e,o);else e=this._processCollection(e,s)}}return e}};y([w()],AA.prototype,"getCollections",void 0),y([w()],AA.prototype,"getChildrenFunction",void 0),y([w()],AA.prototype,"itemFilterFunction",void 0),AA=y([Z("esri.core.CollectionFlattener")],AA);const GT=AA,Voe=96;function zfe(t,e){const i=e||t.extent,r=t.width,n=ws(i==null?void 0:i.spatialReference);return i&&r?i.width/r*n*Wne*Voe:0}function TRe(t,e){return t/(ws(e)*Wne*Voe)}function Oht(t){return t/(Wne*Voe)}function Pht(t,e){const i=t.extent,r=t.width-(t.padding?t.padding.left+t.padding.right:0),n=TRe(e,i.spatialReference);return i.clone().expand(n*r/i.width)}function Rht(t,e,i){return Iht(t,e)&&$ht(t,i)}function Iht(t,e){return e===0||Ey(t,e)||te}const l2=new it,h$=new WeakMap;function Lht(t){Nht(t)&&l2.push(new WeakRef(t))}function Dht(t){const e=l2.find(i=>i.deref()===t);e&&l2.remove(e)}function Nht(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function ERe(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:ERe(e,t%e):0}let HH=0,xD=0;function Fht(){const t=Date.now();let e=!1;for(const i of l2){const r=i.deref();r?r.refreshInterval&&t-(h$.get(r)??0)+5>=6e4*r.refreshInterval&&(h$.set(r,t),r.refresh(t)):e=!0}if(e)for(let i=l2.length-1;i>=0;i--)l2.at(i).deref()||l2.removeAt(i)}wSe(()=>{const t=Date.now();let e=0;for(const i of l2){const r=i.deref();r&&(e=ERe(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?h$.get(r)||h$.set(r,t):h$.delete(r))}if(e!==xD){if(xD=e,clearInterval(HH),xD===0)return void(HH=0);HH=setInterval(Fht,xD)}});function kht(t){return t!=null&&typeof t=="object"&&"refreshTimestamp"in t&&"refresh"in t}const Ufe=.1,zht=t=>{let e=class extends t{constructor(...i){super(...i),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=X5(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||Lht(this)},()=>{})}destroy(){Dht(this)}castRefreshInterval(i){return i>=Ufe?i:i<=0?0:Ufe}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(i=Date.now()){$m(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",i),this.emit("refresh",{dataChanged:r})},r=>{Ce.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){const i=this;return{set refreshInterval(r){i._set("refreshInterval",r)}}}};return y([w({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:Wf}}}}})],e.prototype,"refreshInterval",void 0),y([Ci("refreshInterval")],e.prototype,"castRefreshInterval",null),y([w({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),y([w({readOnly:!0})],e.prototype,"refreshParameters",null),e=y([Z("esri.layers.mixins.RefreshableLayer")],e),e},CRe=fu()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let z4=class extends Xs(Ue){constructor(e){super(e),this.unit="milliseconds",this.value=0}toMilliseconds(){return Gs(this.value,this.unit,"milliseconds")}};y([Vt(CRe,{nonNullable:!0})],z4.prototype,"unit",void 0),y([w({type:Number,json:{write:!0},nonNullable:!0})],z4.prototype,"value",void 0),z4=y([Z("esri.TimeInterval")],z4);const nU=z4;function Vfe(t,e){return nU.fromJSON({value:t,unit:e})}let qc=class extends Xs(Ue){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,i){if(!i.timeExtent||!Array.isArray(i.timeExtent)||i.timeExtent.length!==2)return null;const r=new Date(i.timeExtent[0]),n=new Date(i.timeExtent[1]);return new D_({start:r,end:n})}writeFullTimeExtent(e,i){(e==null?void 0:e.start)!=null&&e.end!=null?i.timeExtent=[e.start.getTime(),e.end.getTime()]:i.timeExtent=null}readInterval(e,i){return i.timeInterval&&i.timeIntervalUnits?Vfe(i.timeInterval,i.timeIntervalUnits):i.defaultTimeInterval&&i.defaultTimeIntervalUnits?Vfe(i.defaultTimeInterval,i.defaultTimeIntervalUnits):null}writeInterval(e,i){i.timeInterval=(e==null?void 0:e.toJSON().value)??null,i.timeIntervalUnits=(e==null?void 0:e.toJSON().unit)??null}};y([w({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],qc.prototype,"cumulative",void 0),y([w({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],qc.prototype,"endField",void 0),y([w({type:D_,json:{write:{enabled:!0,allowNull:!0}}})],qc.prototype,"fullTimeExtent",void 0),y([$t("fullTimeExtent",["timeExtent"])],qc.prototype,"readFullTimeExtent",null),y([Pt("fullTimeExtent")],qc.prototype,"writeFullTimeExtent",null),y([w({type:Boolean,json:{write:!0}})],qc.prototype,"hasLiveData",void 0),y([w({type:nU,json:{write:{enabled:!0,allowNull:!0}}})],qc.prototype,"interval",void 0),y([$t("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],qc.prototype,"readInterval",null),y([Pt("interval")],qc.prototype,"writeInterval",null),y([w({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],qc.prototype,"startField",void 0),y([w(BWe("timeReference",!0))],qc.prototype,"timeZone",void 0),y([w({type:String,json:{write:{enabled:!0,allowNull:!0}}})],qc.prototype,"trackIdField",void 0),y([w({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],qc.prototype,"useTime",void 0),qc=y([Z("esri.layers.support.TimeInfo")],qc);const Uht=qc,Vht=t=>{let e=class extends t{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(i,r){const n=r.timeInfo.exportOptions;if(!n)return null;const s=n.timeOffset,o=CRe.fromJSON(n.timeOffsetUnits);return s&&o?new nU({value:s,unit:o}):null}set timeInfo(i){uit(i,this.fieldsIndex),this._set("timeInfo",i)}};return y([w({type:D_,json:{write:!1}})],e.prototype,"timeExtent",void 0),y([w({type:nU})],e.prototype,"timeOffset",void 0),y([$t("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),y([w({value:null,type:Uht,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),y([w({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"useViewTime",void 0),e=y([Z("esri.layers.mixins.TemporalLayer")],e),e},Bht=[[3819,3819],[3821,3824],[3889,3889],[3906,3906],[4001,4025],[4027,4036],[4039,4047],[4052,4055],[4074,4075],[4080,4081],[4120,4176],[4178,4185],[4188,4216],[4218,4289],[4291,4304],[4306,4319],[4322,4326],[4463,4463],[4470,4470],[4475,4475],[4483,4483],[4490,4490],[4555,4558],[4600,4646],[4657,4765],[4801,4811],[4813,4821],[4823,4824],[4901,4904],[5013,5013],[5132,5132],[5228,5229],[5233,5233],[5246,5246],[5252,5252],[5264,5264],[5324,5340],[5354,5354],[5360,5360],[5365,5365],[5370,5373],[5381,5381],[5393,5393],[5451,5451],[5464,5464],[5467,5467],[5489,5489],[5524,5524],[5527,5527],[5546,5546],[2044,2045],[2081,2083],[2085,2086],[2093,2093],[2096,2098],[2105,2132],[2169,2170],[2176,2180],[2193,2193],[2200,2200],[2206,2212],[2319,2319],[2320,2462],[2523,2549],[2551,2735],[2738,2758],[2935,2941],[2953,2953],[3006,3030],[3034,3035],[3038,3051],[3058,3059],[3068,3068],[3114,3118],[3126,3138],[3150,3151],[3300,3301],[3328,3335],[3346,3346],[3350,3352],[3366,3366],[3389,3390],[3416,3417],[3833,3841],[3844,3850],[3854,3854],[3873,3885],[3907,3910],[4026,4026],[4037,4038],[4417,4417],[4434,4434],[4491,4554],[4839,4839],[5048,5048],[5105,5130],[5253,5259],[5269,5275],[5343,5349],[5479,5482],[5518,5519],[5520,5520],[20004,20032],[20064,20092],[21413,21423],[21473,21483],[21896,21899],[22171,22177],[22181,22187],[22191,22197],[25884,25884],[27205,27232],[27391,27398],[27492,27492],[28402,28432],[28462,28492],[30161,30179],[30800,30800],[31251,31259],[31275,31279],[31281,31290],[31466,31700]];function RQ(t){return t!=null&&Bht.some(([e,i])=>t>=e&&t<=i)}const jht={visible:"visibleSublayers"};let Sv=class extends ze{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",i=>this.notifyChange(jht[i.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:i}=this,r=e==null?void 0:e.sublayers,n=[],s=o=>{const{minScale:l,maxScale:c,sublayers:f,visible:_}=o;_&&(i===0||(l===0||i<=l)&&(c===0||i>=c))&&(f?f.forEach(s):n.push(o))};return r==null||r.forEach(s),n}toJSON(){const{layer:e,layers:i}=this,{imageFormat:r,imageTransparency:n,version:s}=e;return{format:r,request:"GetMap",service:"WMS",styles:"",transparent:n?"TRUE":"FALSE",version:s,layers:i}}};y([w()],Sv.prototype,"layer",null),y([w({readOnly:!0})],Sv.prototype,"layers",null),y([w({type:Number})],Sv.prototype,"scale",void 0),y([w({readOnly:!0})],Sv.prototype,"version",null),y([w({readOnly:!0})],Sv.prototype,"visibleSublayers",null),Sv=y([Z("esri.layers.support.ExportWMSImageParameters")],Sv);async function Ght(t,e,i){let r;try{r=await createImageBitmap(t)}catch(n){throw new se("request:server",`Unable to load ${e}`,{url:e,error:n})}return St(i),r}async function GQt(t,e,i,r,n){let s;try{s=await createImageBitmap(t)}catch(o){throw new se("request:server",`Unable to load tile ${e}/${i}/${r}`,{error:o,level:e,row:i,col:r})}return St(n),s}var fF;let Hht=0,Io=fF=class extends I_(Yz){constructor(t){super(t),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([Jr(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},Li),Jr(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},Li),_e(()=>this.sublayers,(e,i)=>{if(i)for(const r of i)r.layer=r.parent=null;if(e)for(const r of e)r.parent=this,r.layer=this.layer},Li),_e(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},Li)])}get id(){return this._get("id")??Hht++}set id(t){this._set("id",t)}readLegendUrl(t,e){return e.legendUrl??e.legendURL??null}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}castSublayers(t){return $s(it.ofType(fF),t)}set visible(t){this._setAndNotifyLayer("visible",t)}clone(){var e,i,r;const t=new fF;return this.hasOwnProperty("description")&&(t.description=this.description),this.hasOwnProperty("fullExtent")&&(t.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(t.fullExtents=((e=this.fullExtents)==null?void 0:e.map(n=>n.clone()))??null),this.hasOwnProperty("legendUrl")&&(t.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(t.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(t.layer=this.layer),this.hasOwnProperty("name")&&(t.name=this.name),this.hasOwnProperty("parent")&&(t.parent=this.parent),this.hasOwnProperty("queryable")&&(t.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(t.sublayers=(i=this.sublayers)==null?void 0:i.map(n=>n.clone())),this.hasOwnProperty("spatialReferences")&&(t.spatialReferences=(r=this.spatialReferences)==null?void 0:r.map(n=>n)),this.hasOwnProperty("visible")&&(t.visible=this.visible),this.hasOwnProperty("title")&&(t.title=this.title),t}_setAndNotifyLayer(t,e){const i=this.layer;this._get(t)!==e&&(this._set(t,e),i&&i.emit("wms-sublayer-update",{propertyName:t,id:this.id}))}};y([w()],Io.prototype,"description",void 0),y([w({readOnly:!0})],Io.prototype,"dimensions",void 0),y([w({type:Vi,json:{name:"extent"}})],Io.prototype,"fullExtent",void 0),y([w()],Io.prototype,"fullExtents",void 0),y([w({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],Io.prototype,"id",null),y([w({type:String,json:{name:"legendUrl",write:{ignoreOrigin:!0}}})],Io.prototype,"legendUrl",void 0),y([$t("legendUrl",["legendUrl","legendURL"])],Io.prototype,"readLegendUrl",null),y([w({type:Boolean,json:{name:"showLegend",origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],Io.prototype,"legendEnabled",void 0),y([w()],Io.prototype,"layer",void 0),y([w()],Io.prototype,"maxScale",void 0),y([w()],Io.prototype,"minScale",void 0),y([w({readOnly:!0})],Io.prototype,"effectiveScaleRange",null),y([w({type:String,json:{write:{ignoreOrigin:!0}}})],Io.prototype,"name",void 0),y([w()],Io.prototype,"parent",void 0),y([w({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],Io.prototype,"popupEnabled",void 0),y([w({type:Boolean,json:{write:{ignoreOrigin:!0}}})],Io.prototype,"queryable",void 0),y([w()],Io.prototype,"sublayers",void 0),y([Ci("sublayers")],Io.prototype,"castSublayers",null),y([w({type:[Number],json:{read:{source:"spatialReferences"}}})],Io.prototype,"spatialReferences",void 0),y([w({type:String,json:{write:{ignoreOrigin:!0}}})],Io.prototype,"title",void 0),y([w({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],Io.prototype,"visible",null),Io=fF=y([Z("esri.layers.support.WMSSublayer")],Io);const IQ=Io,Bfe={84:4326,83:4269,27:4267};function qht(t){if(!t)return null;const e={idCounter:-1};typeof t=="string"&&(t=new DOMParser().parseFromString(t,"text/xml"));const i=t.documentElement;if(i.nodeName==="ServiceExceptionReport"){const de=Array.prototype.slice.call(i.childNodes).map(ve=>ve.textContent).join(`\r +`);throw new se("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",de)}const r=lu("Capability",i),n=lu("Service",i),s=r&&lu("Request",r);if(!r||!n||!s)return null;const o=lu("Layer",r);if(!o)return null;const l=i.nodeName==="WMS_Capabilities"||i.nodeName==="WMT_MS_Capabilities"?i.getAttribute("version"):"1.3.0",c=oy("Title",n,"")||oy("Name",n,""),f=oy("AccessConstraints",n,""),_=/^none$/i.test(f)?"":f,x=oy("Abstract",n,""),T=parseInt(oy("MaxWidth",n,"5000"),10),A=parseInt(oy("MaxHeight",n,"5000"),10),M=Gfe(s,"GetMap"),I=jfe(s,"GetMap"),L=U4(o,l,e);if(!L)return null;let F,z=0;const k=Array.prototype.slice.call(r.childNodes),U=L.sublayers??[],j=de=>{de!=null&&U.push(de)};k.forEach(de=>{de.nodeName==="Layer"&&(z===0?F=de:(z===1&&L.name&&(L.name="",j(U4(F,l,e))),j(U4(de,l,e))),z++)});let H=L.sublayers,Y=L.extent;const Q=L.fullExtents??[];if(H||(H=[]),H.length===0&&H.push(L),!Y){const de=new Vi(H[0].extent);L.extent=de.toJSON(),Y=L.extent}const ne=L.spatialReferences.length>0?L.spatialReferences:ARe(L),re=jfe(s,"GetFeatureInfo"),he=re?Gfe(s,"GetFeatureInfo"):null,ce=MRe(H),be=L.minScale||0,ye=L.maxScale||0,pe=L.dimensions??[],Ee=ce.reduce((de,ve)=>de.concat(ve.dimensions??[]),[]),te=pe.concat(Ee).filter(PRe);let le=null;if(te.length){const de=te.map(ve=>{const{extent:Se}=ve;return Xht(Se)?Se.map(Ae=>Ae.getTime()):Se==null?void 0:Se.map(Ae=>[Ae.min.getTime(),Ae.max.getTime()])}).flat(2).filter(ys);le={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...de),Math.max(...de)]}}return{copyright:_,description:x,dimensions:pe,extent:Y,fullExtents:Q,featureInfoFormats:he,featureInfoUrl:re,mapUrl:I,maxWidth:T,maxHeight:A,maxScale:ye,minScale:be,layers:ce,spatialReferences:ne,supportedImageFormatTypes:M,timeInfo:le,title:c,version:l}}function Wht(t){const e=t.filter(i=>i.popupEnabled&&i.name&&i.queryable);return e.length?e.map(({name:i})=>i).join():null}function ARe(t){if(t.spatialReferences.length>0)return t.spatialReferences;if(t.sublayers)for(const e of t.sublayers){const i=ARe(e);if(i.length>0)return i}return[]}function MRe(t){var i;let e=[];for(const r of t)e.push(r),(i=r.sublayers)!=null&&i.length&&(e=e.concat(MRe(r.sublayers)),delete r.sublayers);return e}function mF(t,e,i){return e.getAttribute(t)??i}function Yht(t,e,i,r){const n=lu(t,i);return n?mF(e,n,r):r}function lu(t,e){for(let i=0;in).filter(ys);const r=[];for(const n of i)if(n.getAttribute("name")===e){const s=gF("Format",n);for(const{textContent:o}of s)o!=null&&r.push(o)}return r}function Hfe(t,e,i){const r=lu(e,t);if(!r)return i;const{textContent:n}=r;if(n==null||n==="")return i;const s=Number(n);return isNaN(s)?i:s}function U4(t,e,i){if(!t)return null;const r={id:i.idCounter++,fullExtents:[],parentLayerId:null,queryable:t.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},n=lu("LatLonBoundingBox",t),s=lu("EX_GeographicBoundingBox",t);let o=null;n&&(o=KP(n,4326)),s&&(o=new Vi(0,0,0,0,new at({wkid:4326})),o.xmin=parseFloat(oy("westBoundLongitude",s,"0")),o.ymin=parseFloat(oy("southBoundLatitude",s,"0")),o.xmax=parseFloat(oy("eastBoundLongitude",s,"0")),o.ymax=parseFloat(oy("northBoundLatitude",s,"0"))),n||s||(o=new Vi(-180,-90,180,90,new at({wkid:4326}))),r.minScale=Hfe(t,"MaxScaleDenominator",0),r.maxScale=Hfe(t,"MinScaleDenominator",0);const l=["1.0.0","1.1.0","1.1.1"].includes(e)?"SRS":"CRS";return Array.prototype.slice.call(t.childNodes).forEach(c=>{var f;if(c.nodeName==="Name")r.name=c.textContent||"";else if(c.nodeName==="Title")r.title=c.textContent||"";else if(c.nodeName==="Abstract")r.description=c.textContent||"";else if(c.nodeName==="BoundingBox"){const _=c.getAttribute(l);if(_&&_.indexOf("EPSG:")===0){const T=parseInt(_.substring(5),10);T===0||isNaN(T)||o||(o=e==="1.3.0"?KP(c,T,RQ(T)):KP(c,T))}const x=_&&_.indexOf(":");if(x&&x>-1){let T=parseInt(_.substring(x+1,_.length),10);T===0||isNaN(T)||(T=Bfe[T]??T);const A=e==="1.3.0"?KP(c,T,RQ(T)):KP(c,T);A&&r.fullExtents&&r.fullExtents.push(A)}}else if(c.nodeName===l)(((f=c.textContent)==null?void 0:f.split(" "))??[]).forEach(_=>{const x=_.includes(":")?parseInt(_.split(":")[1],10):parseInt(_,10);if(x!==0&&!isNaN(x)){const T=Bfe[x]??x;r.spatialReferences.includes(T)||r.spatialReferences.push(T)}});else if(c.nodeName!=="Style"||r.legendUrl){if(c.nodeName==="Layer"){const _=U4(c,e,i);_&&(_.parentLayerId=r.id,r.sublayers||(r.sublayers=[]),r.sublayers.push(_))}}else{const _=lu("LegendURL",c);if(_){const x=lu("OnlineResource",_);x&&(r.legendUrl=x.getAttribute("xlink:href"))}}}),r.extent=o==null?void 0:o.toJSON(),r.dimensions=gF("Dimension",t).filter(c=>c.getAttribute("name")&&c.getAttribute("units")&&c.textContent).map(c=>{const f=c.getAttribute("name"),_=c.getAttribute("units"),x=c.textContent,T=c.getAttribute("unitSymbol")??void 0,A=c.getAttribute("default")??void 0,M=mF("default",c,"0")!=="0",I=mF("nearestValue",c,"0")!=="0",L=mF("current",c,"0")!=="0";return PRe({name:f,units:_})?{name:"time",units:"ISO8601",extent:Yfe(x),default:Yfe(A),multipleValues:M,nearestValue:I,current:L}:Zht({name:f,units:_})?{name:"elevation",units:_,extent:qfe(x),unitSymbol:T,default:qfe(A),multipleValues:M,nearestValue:I}:{name:f,units:_,extent:Wfe(x),unitSymbol:T,default:Wfe(A),multipleValues:M,nearestValue:I}}),r}function Xht(t){return Array.isArray(t)&&t.length>0&&t[0]instanceof Date}function ORe(t){return t.nodeType===Node.ELEMENT_NODE}function Zht(t){return/^elevation$/i.test(t.name)&&/^(epsg|crs):\d+$/i.test(t.units)}function PRe(t){return/^time$/i.test(t.name)&&/^iso8601$/i.test(t.units)}function Jht(t,e){const i=[],r=qs(t);for(const n in r.query)r.query.hasOwnProperty(n)&&(e.includes(n.toLowerCase())||i.push(n+"="+r.query[n]));return r.path+(i.length?"?"+i.join("&"):"")}function qfe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.map(r=>{const n=r.split("/");return n.length<2?null:{min:parseFloat(n[0]),max:parseFloat(n[1]),resolution:n.length>=3&&n[2]!=="0"?parseFloat(n[2]):void 0}}).filter(ys):i.map(r=>parseFloat(r))}function Wfe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.map(r=>{const n=r.split("/");return n.length<2?null:{min:n[0],max:n[1],resolution:n.length>=3&&n[2]!=="0"?n[2]:void 0}}).filter(ys):i}function Yfe(t){if(!t)return;const e=t.includes("/"),i=t.split(",");return e?i.map(r=>{const n=r.split("/");return n.length<2?null:{min:new Date(n[0]),max:new Date(n[1]),resolution:n.length>=3&&n[2]!=="0"?Kht(n[2]):void 0}}).filter(ys):i.map(r=>new Date(r))}function Kht(t){const e=/(?:p(\d+y|\d+(?:\.|,)\d+y)?(\d+m|\d+(?:\.|,)\d+m)?(\d+d|\d+(?:\.|,)\d+d)?)?(?:t(\d+h|\d+(?:\.|,)\d+h)?(\d+m|\d+(?:\.|,)\d+m)?(\d+s|\d+(?:\.|,)\d+s)?)?/i,i=t.match(e);return i?{years:HE(i[1]),months:HE(i[2]),days:HE(i[3]),hours:HE(i[4]),minutes:HE(i[5]),seconds:HE(i[6])}:null}function HE(t){if(!t)return 0;const e=/(?:\d+(?:\.|,)\d+|\d+)/,i=t.match(e);if(!i)return 0;const r=i[0].replace(",",".");return Number(r)}function qE(t){return t.toISOString().replace(/\.[0-9]{3}/,"")}const Xfe=new Set([102100,3857,102113,900913]),Qht=new Set([3395,54004]);function edt(t,e){let i=t.wkid;return e==null?i:(i!=null&&e.includes(i)||!t.latestWkid||(i=t.latestWkid),i!=null&&Xfe.has(i)?e.find(r=>Xfe.has(r))||e.find(r=>Qht.has(r))||102100:i)}const qH=new yn({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function Zfe(t){return t==="text/html"}function Jfe(t){return t==="text/plain"}let qr=class extends Sse(Vht(zht(OB(XB(JB(fP(uE))))))){constructor(...e){super(...e),this.allSublayers=new GT({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.version=null,this.addHandles([Jr(()=>this.sublayers,"after-add",({item:i})=>{i.parent=i.layer=this},Li),Jr(()=>this.sublayers,"after-remove",({item:i})=>{i.layer=i.parent=null},Li),_e(()=>this.sublayers,(i,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(i)for(const n of i)n.parent=n.layer=this},Li)])}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}destroy(){this.allSublayers.destroy()}load(e){const i=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(zo).then(()=>this._fetchService(i))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,i){const r=i.extent;return r?new Vi({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,i){i.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(Zfe)??this.featureInfoFormats.find(Jfe)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(Zfe(e)||Jfe(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,i){const r=i.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,i){return new at(i.spatialReferences[0])}writeSpatialReferences(e,i){var n;const r=(n=this.spatialReference)==null?void 0:n.wkid;e&&r?(i.spatialReferences=e.filter(s=>s!==r),i.spatialReferences.unshift(r)):i.spatialReferences=e}readSublayersFromItemOrMap(e,i,r){return Kfe(i.layers,r,i.visibleLayers)}readSublayers(e,i,r){return Kfe(i.layers,r)}writeSublayers(e,i,r,n){var l,c;i.layers=[];const s=new Map,o=e.flatten(({sublayers:f})=>f??[]);for(const f of o)if(typeof((l=f.parent)==null?void 0:l.id)=="number"){const _=s.get(f.parent.id);_!=null?_.push(f.id):s.set(f.parent.id,[f.id])}for(const f of o){const _={sublayer:f,...n},x=f.write({parentLayerId:typeof((c=f.parent)==null?void 0:c.id)=="number"?f.parent.id:-1},_);if(s.has(f.id)&&(x.sublayerIds=s.get(f.id)),!f.sublayers&&f.name){const T=f.write({},_);delete T.id,i.layers.push(T)}}i.visibleLayers=o.filter(({visible:f,sublayers:_})=>f&&!_).map(({name:f})=>f).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:i,query:r}=qs(e);for(const s in r)/^(request|service)$/i.test(s)&&delete r[s];const n=tO(i,r??{});this._set("url",n)}createExportImageParameters(e,i,r,n){const s=(n==null?void 0:n.pixelRatio)??1,o=zfe({extent:e,width:i})*s,l=new Sv({layer:this,scale:o}),{xmin:c,ymin:f,xmax:_,ymax:x,spatialReference:T}=e,A=edt(T,this.spatialReferences),M=this.version==="1.3.0"&&RQ(A)?`${f},${c},${x},${_}`:`${c},${f},${_},${x}`,I=l.toJSON();return{bbox:M,[this.version==="1.3.0"?"crs":"srs"]:A==null||isNaN(A)?void 0:"EPSG:"+A,...I}}async fetchImage(e,i,r,n){var x,T;const s=this.mapUrl,o=this.createExportImageParameters(e,i,r,n);if(!o.layers){const A=document.createElement("canvas");return A.width=i,A.height=r,A}const l=(x=n==null?void 0:n.timeExtent)==null?void 0:x.start,c=(T=n==null?void 0:n.timeExtent)==null?void 0:T.end,f=l!=null&&c!=null?l.getTime()===c.getTime()?qE(l):`${qE(l)}/${qE(c)}`:void 0,_={responseType:"image",query:this._mixCustomParameters({width:i,height:r,...o,time:f,...this.refreshParameters}),signal:n==null?void 0:n.signal};return bi(s??"",_).then(A=>A.data)}async fetchImageBitmap(e,i,r,n){var T,A;const s=this.mapUrl??"",o=this.createExportImageParameters(e,i,r,n);if(!o.layers){const M=document.createElement("canvas");return M.width=i,M.height=r,M}const l=(T=n==null?void 0:n.timeExtent)==null?void 0:T.start,c=(A=n==null?void 0:n.timeExtent)==null?void 0:A.end,f=l!=null&&c!=null?l.getTime()===c.getTime()?qE(l):`${qE(l)}/${qE(c)}`:void 0,_={responseType:"blob",query:this._mixCustomParameters({width:i,height:r,...o,time:f,...this.refreshParameters}),signal:n==null?void 0:n.signal},{data:x}=await bi(s,_);return Ght(x,s,n==null?void 0:n.signal)}fetchFeatureInfo(e,i,r,n,s){const o=zfe({extent:e,width:i}),l=new Sv({layer:this,scale:o}),c=Wht(l.visibleSublayers);if(this.featureInfoUrl==null||c==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const f=this.version==="1.3.0"?{I:n,J:s}:{x:n,y:s},_={query_layers:c,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:i,height:r,...f},x={...this.createExportImageParameters(e,i,r),..._},T=this._mixCustomParameters(x);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(T):this._defaultFetchFeatureInfoFunction(tO(this.featureInfoUrl,T))}findSublayerById(e){return this.allSublayers.find(i=>i.id===e)}findSublayerByName(e){return this.allSublayers.find(i=>i.name===e)}serviceSupportsSpatialReference(e){return Kst(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(i=>{const r=i===900913?at.WebMercator:new at({wkid:i});return Zn(r,e)})}_defaultFetchFeatureInfoFunction(e){const i=document.createElement("iframe");i.src=$Ye(e),i.style.border="none",i.style.margin="0",i.style.width="100%",i.setAttribute("sandbox","");const r=new hE({title:this.title,content:i}),n=new Ml({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){var i;if(!this.resourceInfo&&((i=this.parsedUrl)!=null&&i.path)){const{path:r,query:n}=this.parsedUrl,{data:s}=await bi(r,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...n,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=qht(s)}if(this.parsedUrl){const r=new m2(this.parsedUrl.path),{httpsDomains:n}=Ar.request;r.scheme!=="https"||r.port&&r.port!=="443"||!r.host||n.includes(r.host)||n.push(r.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const i={...this.customParameters,...this.customLayerParameters};for(const r in i)e[r.toLowerCase()]=i[r];return e}};function tdt(t,e){return t.some(i=>{for(const r in i)if(oEe(i,r,null,e))return!0;return!1})}function Kfe(t,e,i){t=t??[];const r=new Map;t.every(s=>s.id==null)&&(t=Re(t)).forEach((s,o)=>s.id=o);for(const s of t){const o=new IQ;o.read(s,e),i&&!i.includes(o.name)&&(o.visible=!1),r.set(o.id,o)}const n=[];for(const s of t){const o=s.id!=null?r.get(s.id):null;if(o)if(s.parentLayerId!=null&&s.parentLayerId>=0){const l=r.get(s.parentLayerId);if(!l)continue;l.sublayers||(l.sublayers=new it),l.sublayers.push(o)}else n.push(o)}return n}y([w({readOnly:!0})],qr.prototype,"allSublayers",void 0),y([w({json:{type:Object,write:!0}})],qr.prototype,"customParameters",void 0),y([w({json:{type:Object,write:!0}})],qr.prototype,"customLayerParameters",void 0),y([w({type:String,json:{write:!0}})],qr.prototype,"copyright",void 0),y([w()],qr.prototype,"description",void 0),y([w({readOnly:!0})],qr.prototype,"dimensions",void 0),y([w({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],qr.prototype,"fullExtent",void 0),y([$t(["web-document","portal-item"],"fullExtent",["extent"])],qr.prototype,"readFullExtentFromItemOrMap",null),y([Pt(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],qr.prototype,"writeFullExtent",null),y([w()],qr.prototype,"fullExtents",void 0),y([w({type:String,json:{write:{ignoreOrigin:!0}}})],qr.prototype,"featureInfoFormat",null),y([w({type:[String],readOnly:!0})],qr.prototype,"featureInfoFormats",void 0),y([w({type:String,json:{write:{ignoreOrigin:!0}}})],qr.prototype,"featureInfoUrl",void 0),y([w()],qr.prototype,"fetchFeatureInfoFunction",void 0),y([w({type:String,json:{origins:{"web-document":{default:"image/png",type:qH.jsonValues,read:{reader:qH.read,source:"format"},write:{writer:qH.write,target:"format"}}}}})],qr.prototype,"imageFormat",void 0),y([$t("imageFormat",["supportedImageFormatTypes"])],qr.prototype,"readImageFormat",null),y([w({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],qr.prototype,"imageMaxHeight",void 0),y([w({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],qr.prototype,"imageMaxWidth",void 0),y([w()],qr.prototype,"imageTransparency",void 0),y([w(b5e)],qr.prototype,"legendEnabled",void 0),y([w({type:["show","hide","hide-children"]})],qr.prototype,"listMode",void 0),y([w({type:String,json:{write:{ignoreOrigin:!0}}})],qr.prototype,"mapUrl",void 0),y([w({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],qr.prototype,"isReference",void 0),y([w({type:["WMS"]})],qr.prototype,"operationalLayerType",void 0),y([w()],qr.prototype,"resourceInfo",void 0),y([w({type:at,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],qr.prototype,"spatialReference",void 0),y([$t(["web-document","portal-item"],"spatialReference",["spatialReferences"])],qr.prototype,"readSpatialReferenceFromItemOrDocument",null),y([w({type:[$n],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],qr.prototype,"spatialReferences",void 0),y([Pt(["web-document","portal-item"],"spatialReferences")],qr.prototype,"writeSpatialReferences",null),y([w({type:it.ofType(IQ),json:{write:{target:"layers",overridePolicy(t,e,i){if(tdt(this.allSublayers,i))return{ignoreOrigin:!0}}}}})],qr.prototype,"sublayers",void 0),y([$t(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],qr.prototype,"readSublayersFromItemOrMap",null),y([$t("service","sublayers",["layers"])],qr.prototype,"readSublayers",null),y([Pt("sublayers",{layers:{type:[IQ]},visibleLayers:{type:[String]}})],qr.prototype,"writeSublayers",null),y([w({json:{read:!1},readOnly:!0,value:"wms"})],qr.prototype,"type",void 0),y([w(soe)],qr.prototype,"url",null),y([w({type:String,json:{write:{ignoreOrigin:!0}}})],qr.prototype,"version",void 0),qr=y([Z("esri.layers.WMSLayer")],qr);const RRe=qr,idt=Object.freeze(Object.defineProperty({__proto__:null,default:RRe},Symbol.toStringTag,{value:"Module"}));async function fj(t,e){return await t.load(),rdt(t,e)}async function rdt(t,e){const i=[],r=(...s)=>{for(const o of s)o!=null&&(Array.isArray(o)?r(...o):it.isCollection(o)?o.forEach(l=>r(l)):jf.isLoadable(o)&&i.push(o))};e(r);let n=null;if(await EHe(i,async s=>{const o=await Ju(ndt(s)?s.loadAll():s.load());o.ok!==!1||n||(n=o)}),n)throw n.error;return t}function ndt(t){return"loadAll"in t&&typeof t.loadAll=="function"}function IRe(t){return new GT({getCollections:()=>[t.tables,t.layers],getChildrenFunction:e=>{const i=[];return"tables"in e&&i.push(e.tables),"layers"in e&&i.push(e.layers),i},itemFilterFunction:e=>{const i=e.parent;return!!i&&"tables"in i&&i.tables.includes(e)}})}function WH(t){for(const e of t.values())e==null||e.destroy();t.clear()}function $Q(t,e,i){let r,n;if(t)for(let s=0,o=t.length;s{let e=class extends t{constructor(...i){super(...i),this.layers=new it;const r=o=>{o.parent&&"remove"in o.parent&&o.parent.remove(o)},n=o=>{o.parent=this,this.layerAdded(o),o.type!=="elevation"&&o.type!=="base-elevation"||Ce.getLogger(this).error(`Layer 'title:${o.title}, id:${o.id}' of type '${o.type}' is not supported as an operational layer and will therefore be ignored.`)},s=o=>{o.parent=null,this.layerRemoved(o)};this.addHandles([this.layers.on("before-add",o=>r(o.item)),this.layers.on("after-add",o=>n(o.item)),this.layers.on("after-remove",o=>s(o.item))])}destroy(){const i=this.layers.toArray();for(const r of i)r.destroy();this.layers.destroy()}set layers(i){this._set("layers",sd(i,this._get("layers")))}add(i,r){const n=this.layers;if(r=n.getNextIndex(r),i instanceof uE){const s=i;s.parent===this?this.reorder(s,r):n.add(s,r)}else pd(i)?i.then(s=>{this.destroyed||this.add(s,r)}):Ce.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,r){const n=this.layers;let s=n.getNextIndex(r);i.slice().forEach(o=>{o.parent!==this?(n.add(o,s),s+=1):this.reorder(o,s)})}findLayerById(i){return $Q(this.layers,"id",i)}findLayerByUid(i){return $Q(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,r){return this.layers.reorder(i,r)}layerAdded(i){}layerRemoved(i){}};return y([w()],e.prototype,"layers",null),e=y([Z("esri.support.LayersMixin")],e),e};function LQ(t,e,i){if(t)for(let r=0,n=t.length;r{let e=class extends t{constructor(...i){super(...i),this.tables=new it,this.addHandles([this.tables.on("after-add",r=>{const n=r.item;n.parent&&n.parent!==this&&"tables"in n.parent&&n.parent.tables.remove(n),n.parent=this,n.type!=="feature"&&Ce.getLogger(this).error(`Layer 'title:${n.title}, id:${n.id}' of type '${n.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const i=this.tables.toArray();for(const r of i)r.destroy();this.tables.destroy()}set tables(i){this._set("tables",sd(i,this._get("tables")))}findTableById(i){return LQ(this.tables,"id",i)}findTableByUid(i){return LQ(this.tables,"uid",i)}};return y([w()],e.prototype,"tables",null),e=y([Z("esri.support.TablesMixin")],e),e},DRe=Symbol("WebScene");var fy;(function(t){t[t.SAVE=0]="SAVE",t[t.SAVE_AS=1]="SAVE_AS"})(fy||(fy={}));const sdt=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),odt=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","media","ogc-feature","oriented-imagery","route","stream","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function adt(t){return t.layerContainerType==="basemap"?sdt:t.layerContainerType==="operational-layers"?odt:null}function ldt(t,e){if(e.restrictedWebMapWriting){const i=adt(e);return i==null||i.has(t.type)&&!GB(t)}return!0}function cdt(t,e){var i;if(e)if(GB(t)){const r=u9("featureCollection.layers",e),n=(i=r==null?void 0:r[0])==null?void 0:i.layerDefinition;n&&Qfe(t,n)}else t.type!=="group"&&Qfe(t,e)}function Qfe(t,e){"maxScale"in t&&(e.maxScale=ez(t.maxScale)??void 0),"minScale"in t&&(e.minScale=ez(t.minScale)??void 0)}function udt(t,e){if(cdt(t,e),e&&(e.id=t.id,"blendMode"in t&&(e.blendMode=t.blendMode,e.blendMode==="normal"&&delete e.blendMode),e.opacity=ez(t.opacity)??void 0,e.title=t.title||"Layer",e.visibility=t.visible,"legendEnabled"in t&&t.type!=="wmts"))if(GB(t)){const i=e.featureCollection;i&&(i.showLegend=t.legendEnabled)}else e.showLegend=t.legendEnabled}function DQ(t,e,i){if(!t.persistenceEnabled)return null;if(!("write"in t)||!t.write)return i!=null&&i.messages&&i.messages.push(new se("layer:unsupported",`Layers (${t.title}, ${t.id}) of type '${t.declaredClass}' cannot be persisted`,{layer:t})),null;if(GB(t)&&!t.isTable)e=t.resourceInfo;else if(ldt(t,i)){const r={};return t.write(r,i)?r:null}return e!=null&&udt(t,e=Re(e)),e}let nc=class extends Sse(OB(XB(JB(LRe($Re(fP(uE))))))){constructor(e){super(e),this.allLayers=new GT({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=IRe(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=X5(async(i,r,n)=>{const{save:s,saveAs:o}=await we(()=>import("./groupLayerUtils-ciLlAkrK.js"),__vite__mapDeps([127,128,45]));switch(i){case fy.SAVE:return s(this,r);case fy.SAVE_AS:return o(this,n,r)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([_e(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&DRe in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(Jr(()=>this.tables,"before-add",r=>{r.preventDefault(),Ce.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},kt),_e(()=>this.visible,this._onVisibilityChange.bind(this),Li)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===Di.USER}_writeLayers(e,i,r,n){const s=[];if(!e)return s;e.forEach(o=>{const l=DQ(o,n.webmap?n.webmap.getLayerJSONFromResourceInfo(o):null,n);l!=null&&l.layerType&&s.push(l)}),i.layers=s}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,r){const{itemId:n,layerType:s}=i;if(s==="GroupLayer"&&n)return new Am({id:n,portal:r==null?void 0:r.portal})}writePortalItem(e,i){e!=null&&e.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return lat(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:dPe},e).catch(r=>{if(zo(r),this.sourceIsPortalItem)throw r});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return fj(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(fy.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(fy.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer readded to Grouplayer: uid=${e.uid}`):this.addHandles(_e(()=>e.visible,i=>this._onChildVisibilityChange(e,i),Li),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!Zl(this).initialized)return;const r=this.layers;let n=r.find(s=>s.visible);switch(e){case"exclusive":r.length&&!n&&(n=r.at(0),n.visible=!0),this._turnOffOtherLayers(n);break;case"inherited":r.forEach(s=>{s.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};y([w({readOnly:!0,dependsOn:[]})],nc.prototype,"allLayers",void 0),y([w({readOnly:!0})],nc.prototype,"allTables",void 0),y([w({json:{read:!0,write:!0}})],nc.prototype,"blendMode",void 0),y([w()],nc.prototype,"fullExtent",void 0),y([w({readOnly:!0})],nc.prototype,"sourceIsPortalItem",null),y([w({json:{read:!1,write:{ignoreOrigin:!0}}})],nc.prototype,"layers",void 0),y([Pt("layers")],nc.prototype,"_writeLayers",null),y([w({type:["GroupLayer"]})],nc.prototype,"operationalLayerType",void 0),y([w({json:{origins:{"web-map":{read:!1,write:{overridePolicy(t,e,i){return{enabled:(t==null?void 0:t.type)==="Group Layer"&&(i==null?void 0:i.initiator)!==this}}}},"web-scene":{read:!1,write:!1}}}})],nc.prototype,"portalItem",null),y([$t("web-map","portalItem",["itemId"])],nc.prototype,"readPortalItem",null),y([Pt("web-map","portalItem",{itemId:{type:String}})],nc.prototype,"writePortalItem",null),y([w()],nc.prototype,"spatialReference",void 0),y([w({json:{read:!1},readOnly:!0,value:"group"})],nc.prototype,"type",void 0),y([w({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(t,e,i)=>{t!=="inherited"&&(e[i]=t)}}}}})],nc.prototype,"visibilityMode",null),nc=y([Z("esri.layers.GroupLayer")],nc);const NRe=nc,hdt=Object.freeze(Object.defineProperty({__proto__:null,default:NRe},Symbol.toStringTag,{value:"Module"})),ddt=()=>new jse({elevationInfo:{mode:"absolute-height"},title:"Joonistatud kihid"}),pdt=(t,e)=>new SRe({portalItem:{id:t},title:e}),fdt=()=>new RRe({portalItem:{id:"38a98f83f3a248faaea9ce793e50ddee"},title:"Ortofoto WMS",visible:!1,listMode:"hide"}),e0e=(t,e,i=!1)=>new NRe({title:t,visible:i,visibilityMode:e}),mdt=(t,e)=>{const i=e.map.allLayers.find(n=>n.title==="Taimkate analüütiline");i.visible=!0;const r=e.map.allLayers.find(n=>n.title==="Taimkate realistlik");t.addMany([i,r]),e.map.removeMany([i,r])},gdt=t=>{const e=["Puurkaevud/puuraugud","Ehitusgeoloogia","Geoloogia WMS"],i={};return t.map.layers.forEach(n=>{const s=n.title;e.includes(s)&&(i[s]=n)}),{items:e.map(n=>i[n]).filter(Boolean)}},t0e=t=>{const{items:e}=t.map.allLayers,{initVisible:i}=e.reduce((r,n)=>(n.visible===!0&&r.initVisible.push(n),r),{initVisible:[]});return i},ydt=(t,e)=>{const i=t.filter(f=>!e.includes(f)),r=e.filter(f=>!t.includes(f)),n=f=>f.title,s=[...i.map(n),...r.map(n)],o=["Kõrgusmudel","Aluspõhi 50m","Aluskord 50m"],l=s.filter(f=>!o.includes(f)),c=s.filter(f=>o.includes(f));return[l,c]};async function vdt(t){if(!t)return;const e=t.includes("-vector")?t.slice(0,t.indexOf("-vector")):t.includes("-3d")?t.slice(0,t.indexOf("-3d")):t,i=await lE("esri/t9n/basemaps");return i[t]||i[e]}const u5={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Wr("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return Wr("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return Wr("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return Wr("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Wr("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Wr("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Wr("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Wr("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Wr("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Wr("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Wr("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Wr("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Wr("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}},_dt=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let MA=class extends ze{constructor(e){super(e),this.id=null,this.language=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps"}getLanguageParamValue(){if(this.language)return this.language;const e=fa().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const i=lne(e);return i==="pt"?"pt-BR":i&&_dt.has(i)?i:"global"}};y([w()],MA.prototype,"id",void 0),y([w()],MA.prototype,"language",void 0),y([w()],MA.prototype,"serviceUrl",void 0),MA=y([Z("esri.support.BasemapStyle")],MA);const bdt=MA;var V4;let wdt=0;const xdt="esri.Basemap";let Rd=V4=class extends P_(jf){constructor(t){super(t),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+wdt++,this.baseLayers=new it,this.referenceLayers=new it;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type==="elevation"&&Ce.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=r=>{r.parent=null};this.addHandles([this.baseLayers.on("after-add",r=>e(r.item)),this.referenceLayers.on("after-add",r=>e(r.item)),this.baseLayers.on("after-remove",r=>i(r.item)),this.referenceLayers.on("after-remove",r=>i(r.item))])}initialize(){this.when().catch(t=>{Ce.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.baseLayers.toArray();for(const i of t)i.destroy();const e=this.referenceLayers.toArray();for(const i of e)i.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=et(this.portalItem)}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set baseLayers(t){this._set("baseLayers",sd(t,this._get("baseLayers")))}_writeBaseLayers(t,e,i){const r=[];t&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(n=>{const s=DQ(n,i.webmap?i.webmap.getLayerJSONFromResourceInfo(n):null,i);s!=null&&r.push(s)}),this.referenceLayers.forEach(n=>{const s=DQ(n,i.webmap?i.webmap.getLayerJSONFromResourceInfo(n):null,i);s!=null&&(n.type!=="scene"&&(s.isReference=!0),r.push(s))})),e.baseMapLayers=r}set referenceLayers(t){this._set("referenceLayers",sd(t,this._get("referenceLayers")))}writeTitle(t,e){e.title=t||"Basemap"}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return fj(this,t=>{t(this.baseLayers,this.referenceLayers)})}clone(){const t={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(e=>Uk(e)?e.clone():e),referenceLayers:this.referenceLayers.map(e=>Uk(e)?e.clone():e)};return this.loaded&&(t.loadStatus="loaded"),new V4({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}write(t,e){var i;return t=t||{},e!=null&&e.origin||(e={origin:"web-map",...e}),super.write(t,e),!this.loaded&&((i=this.resourceInfo)!=null&&i.data.baseMapLayers)&&(t.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(r=>{const n=Re(r);return n.url&&jy(n.url)&&(n.url=`https:${n.url}`),n.templateUrl&&jy(n.templateUrl)&&(n.templateUrl=`https:${n.templateUrl}`),n})),t}async _loadFromSource(t){const{resourceInfo:e,portalItem:i,style:r}=this;St(t);const n=[];if(e){const s=e.context?e.context.url:null;if(n.push(this._loadLayersFromJSON(e.data,s,t)),e.data.id&&!e.data.title){const o=e.data.id;n.push(vdt(o).then(l=>{l&&this.read({title:l},e.context)}))}}else i?n.push(this._loadFromItem(i,t)):r&&n.push(this._loadFromStylesService(r,t));await Promise.all(n)}async _loadLayersFromJSON(t,e,i){var c,f;const r=(c=this.resourceInfo)==null?void 0:c.context,n=((f=this.portalItem)==null?void 0:f.portal)||(r==null?void 0:r.portal)||null,s=Tdt[(r==null?void 0:r.origin)||""]??"web-map",{populateOperationalLayers:o}=await we(()=>import("./layersCreator-aC1PvuFa.js"),__vite__mapDeps([44,35,36])),l=[];if(St(i),t.baseMapLayers&&Array.isArray(t.baseMapLayers)){const _={context:{...r,origin:s,url:e,portal:n,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},x=M=>s==="web-scene"&&M.layerType==="ArcGISSceneServiceLayer"||M.isReference,T=o(this.baseLayers,t.baseMapLayers.filter(M=>!x(M)),_);l.push(T);const A=o(this.referenceLayers,t.baseMapLayers.filter(x),_);l.push(A)}await Promise.allSettled(l)}async _loadFromItem(t,e){const i=await t.load(e),r=await i.fetchData("json",e),n=qs(t.itemUrl??"");return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:Sdt[t.type||""]??"web-map",portal:t.portal||os.getDefault(),url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this.read({title:t.title,thumbnailUrl:t.thumbnailUrl},{origin:"portal-item",portal:t.portal||os.getDefault(),url:n}),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}async _loadFromStylesService(t,e){var s;const i=`${t.serviceUrl}/${t.id}`,r=(await bi(i,{query:{language:t.getLanguageParamValue()},signal:e==null?void 0:e.signal})).data;if(r.baseMap&&Array.isArray(r.baseMap.baseMapLayers)){for(const o of r.baseMap.baseMapLayers)if(!o.customParameters&&((s=o.styleUrl)!=null&&s.includes("?"))){const l=qs(o.styleUrl);l.query&&(o.styleUrl=l.path,o.customParameters=l.query)}}const n=qs(i);return this._set("resourceInfo",{data:r.baseMap??{},context:{origin:"web-map",url:n}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:r.spatialReference},this.resourceInfo.context),this._loadLayersFromJSON(this.resourceInfo.data,n,e)}static fromId(t){const e=u5[t];return e?e.itemId?new V4({portalItem:{id:e.itemId,portal:{url:"https://www.arcgis.com"}}}):V4.fromJSON(e,{origin:e.is3d?"web-scene":"web-map"}):null}};y([w({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(t,e,i,r){this._writeBaseLayers(t,e,r)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:it}},writer(t,e,i,r){this._writeBaseLayers(t,e,r)}}}}}})],Rd.prototype,"baseLayers",null),y([w({type:String,json:{origins:{"web-scene":{write:!0}}}})],Rd.prototype,"id",void 0),y([w({type:Am})],Rd.prototype,"portalItem",void 0),y([w()],Rd.prototype,"referenceLayers",null),y([w({readOnly:!0})],Rd.prototype,"resourceInfo",void 0),y([w({type:at})],Rd.prototype,"spatialReference",void 0),y([w({type:bdt})],Rd.prototype,"style",void 0),y([w()],Rd.prototype,"thumbnailUrl",void 0),y([w({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],Rd.prototype,"title",void 0),y([Pt("title")],Rd.prototype,"writeTitle",null),Rd=V4=y([Z(xdt)],Rd);const Sdt={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},Tdt={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Ay=Rd,Edt=Object.freeze(Object.defineProperty({__proto__:null,default:Ay},Symbol.toStringTag,{value:"Module"}));var NQ;let yF=NQ=class extends Ue{constructor(t){super(t),this.type="none"}clone(){return new NQ({type:this.type})}};y([Vt({none:"none",stayAbove:"stay-above"})],yF.prototype,"type",void 0),yF=NQ=y([Z("esri.ground.NavigationConstraint")],yF);var FQ;let J1=FQ=class extends P_(jf){constructor(t){super(t),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new it;const e=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&Ce.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},i=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>e(r.item)),this.layers.on("after-remove",r=>i(r.item))])}initialize(){this.when().catch(t=>{sn(t)||Ce.getLogger(this).error("#load()","Failed to load ground",t)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const t=this.layers.removeAll();for(const e of t)et(e);this.layers.destroy()}normalizeCtorArgs(t){return t&&"resourceInfo"in t&&(this._set("resourceInfo",t.resourceInfo),delete(t={...t}).resourceInfo),t}set layers(t){this._set("layers",sd(t,this._get("layers")))}writeLayers(t,e,i,r){const n=[];t&&(r={...r,layerContainerType:"ground"},t.forEach(s=>{if("write"in s){const o={};bnt(s)().write(o,r)&&n.push(o)}else r!=null&&r.messages&&r.messages.push(new se("layer:unsupported",`Layers (${s.title}, ${s.id}) of type '${s.declaredClass}' cannot be persisted in the ground`,{layer:s}))})),e.layers=n}load(t){return this.addResolvingPromise(this._loadFromSource(t)),Promise.resolve(this)}loadAll(){return fj(this,t=>{t(this.layers)})}async queryElevation(t,e){await this.load({signal:e==null?void 0:e.signal});const{ElevationQuery:i}=await we(()=>Promise.resolve().then(()=>zV),void 0);St(e);const r=new i,n=this.layers.filter(i0e).toArray();return r.queryAll(n,t,e)}async createElevationSampler(t,e){await this.load({signal:e==null?void 0:e.signal});const{ElevationQuery:i}=await we(()=>Promise.resolve().then(()=>zV),void 0);St(e);const r=new i,n=this.layers.filter(i0e).toArray();return r.createSamplerAll(n,t,e)}clone(){const t={opacity:this.opacity,surfaceColor:Re(this.surfaceColor),navigationConstraint:Re(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(t.loadStatus="loaded"),new FQ({resourceInfo:this.resourceInfo}).set(t)}read(t,e){this.resourceInfo||this._set("resourceInfo",{data:t,context:e}),super.read(t,e)}_loadFromSource(t){const e=this.resourceInfo;return e?this._loadLayersFromJSON(e.data,e.context,t):Promise.resolve()}async _loadLayersFromJSON(t,e,i){const r=(e==null?void 0:e.origin)||"web-scene",n=(e==null?void 0:e.portal)||null,s=(e==null?void 0:e.url)||null,{populateOperationalLayers:o}=await we(()=>import("./layersCreator-aC1PvuFa.js"),__vite__mapDeps([44,35,36]));St(i);const l=[];if(t.layers&&Array.isArray(t.layers)){const c={context:{origin:r,url:s,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};l.push(o(this.layers,t.layers,c))}await Promise.allSettled(l)}};function Cdt(t){return t&&"createElevationSampler"in t}function i0e(t){return t.type==="elevation"||Cdt(t)}y([w({json:{read:!1}})],J1.prototype,"layers",null),y([Pt("layers")],J1.prototype,"writeLayers",null),y([w({readOnly:!0})],J1.prototype,"resourceInfo",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:$n,read:{reader:jT,source:"transparency"},write:{writer:(t,e)=>{e.transparency=DB(t)},target:"transparency"}}})],J1.prototype,"opacity",void 0),y([w({type:qe,json:{type:[$n],write:(t,e)=>{e.surfaceColor=t.toJSON().slice(0,3)}}})],J1.prototype,"surfaceColor",void 0),y([w({type:yF,json:{write:!0}})],J1.prototype,"navigationConstraint",void 0),J1=FQ=y([Z("esri.Ground")],J1);const h5=J1,Adt=[["binary","application/octet-stream","bin",""]];function YQt(t,e){return zRe(e.name,(t==null?void 0:t.supportedFormats)??[])!=null}function XQt(t,e){if(!t)return!1;const i=Mdt(e,t.supportedFormats??[]);return i!=null&&t.editFormats.includes(i)}function FRe(t,e){return joe(Pdt(t,e))}function kRe(t,e){return joe(zRe(t,e))}function ZQt(t,e){return URe(Odt(t,e))}function Mdt(t,e){return kRe(t.name,e)??FRe(t.type,e)}function Boe(t){return[...Adt,...t]}function Odt(t,e){return Boe(e).find(i=>joe(i)===t)}function Pdt(t,e){const i=t.toLowerCase();return Boe(e).find(r=>URe(r)===i)}function zRe(t,e){const i=t.toLowerCase();return Boe(e).find(r=>Rdt(r).some(n=>i.endsWith(n)))}function joe(t){return t==null?void 0:t[0]}function URe(t){return t==null?void 0:t[1].toLowerCase()}function Rdt(t){return(t==null?void 0:t[2].split(",").map(e=>e.toLowerCase()))??[]}function JQt(t){var e;return(e=t.tables)==null?void 0:e.find(i=>i.role==="assetMaps")}function Idt(t){var e,i;return!(!(t&&typeof t=="object"&&"loaded"in t&&t.loaded&&((i=(e=Bnt(t))==null?void 0:e.operations)!=null&&i.supportsEditing)&&"type"in t)||"editingEnabled"in t&&!Gnt(t)||t.type==="scene"&&!$dt(t))}function $dt(t){const{associatedLayer:e}=t,i=e==null?void 0:e.infoFor3D;if(!i)return!0;const{supportedFormats:r,queryFormats:n}=i,s=FRe("model/gltf-binary",r)??kRe("glb",r);if(!(s!=null&&n.includes(s)))return Ce.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${t.title??"Untitled layer"}, ${t.id}) is not editable because it does not support GLB queries.`),!1;const o=t.spatialReference,l=e.spatialReference;if(!Zn(o,l))return Ce.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${t.title??"Untitled layer"}, ${t.id}) is not editable because its spatial reference (wkid:${o.wkid}) is different from its associated FeatureLayer's spatial reference (wkid:${l.wkid}).`),!1;const c=e.sourceJSON.sourceSpatialReference;return!(c!=null&&!Zn(c,l))||(Ce.getLogger("esri.layers.support.editableLayers").warnOnce(`SceneLayer (${t.title??"Untitled layer"}, ${t.id}) is not editable because the spatial reference of its associated FeatureLayer's service (wkid:${l.wkid}) is different from its source spatial reference (wkid:${c.wkid}).`),!1)}const r0e=Ce.getLogger("esri.support.basemapUtils");function Ldt(){return{}}function Ddt(t){for(const e in t){const i=t[e];et(i),delete t[e]}}function Goe(t,e){let i;if(typeof t=="string"){const r=t in u5,n=!r&&t.includes("/");if(!r&&!n){const s=Object.entries(u5).filter(([o,l])=>Ar.apiKey&&!l.classic||!Ar.apiKey&&(l.classic||l.is3d)).map(([o])=>`"${o}"`).sort().join(", ");return r0e.warn(`Unable to find basemap definition for: ${t}. Try one of these: ${s}`),null}e&&(i=e[t]),i||(i=r?Ay.fromId(t):new Ay({style:{id:t}}),e&&(e[t]=i))}else i=$s(Ay,t);return i!=null&&i.destroyed&&(r0e.warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function Ndt(t){var e;return((e=t.portalItem)==null?void 0:e.type)==="Web Scene"}function Fdt(t){var e,i;return!!((i=(e=t==null?void 0:t.portalItem)==null?void 0:e.tags)!=null&&i.some(r=>r.toLowerCase()==="beta"))}function KQt(t,e){var i,r,n,s;return((r=(i=t.basemap)==null?void 0:i.referenceLayers)==null?void 0:r.some(o=>o.uid===e))||((s=(n=t.basemap)==null?void 0:n.baseLayers)==null?void 0:s.some(o=>o.uid===e))}function kdt(t,e=null){const i=Goe(t);if(!i)return null;const r=i.clone();return e&&(r.baseLayers=n0e(r.baseLayers,e.baseLayers),r.referenceLayers=n0e(r.referenceLayers,e.referenceLayers)),r}function zdt(t){let e=null;const i=kQ(t),r=!(i!=null&&i.baseLayers.length);for(const n in u5){const s=BRe(i,VRe(u5[n]),{mustMatchReferences:r});if(s==="equal"){e=n;break}s==="base-layers-equal"&&(e=n)}return e}function Udt(t,e){var i,r;return t===e||((i=t==null?void 0:t.portalItem)==null?void 0:i.id)!=null&&t.portalItem.id===((r=e==null?void 0:e.portalItem)==null?void 0:r.id)?!0:BRe(kQ(t),kQ(e),{mustMatchReferences:!0})==="equal"}function n0e(t,e){const i=new it;return t.forEach(r=>{const n=e.find(s=>s.type!=="scene"&&jRe(zQ(r),zQ(s)))||r;i.includes(n)?i.push(r):i.push(n)}),i}function s0e(t){return!!(t!=null&&t.baseLayers.concat(t.referenceLayers).some(Vdt))}function Vdt(t){if(o0e(t.url))return!0;if(t.type==="vector-tile")for(const e in t.sourceNameToSource){const i=t.sourceNameToSource[e];if(o0e(i==null?void 0:i.sourceUrl))return!0}return!1}function Bdt(t,e){var s;if(e==null||t==null)return{spatialReference:null,updating:!1};if(e.loadStatus==="not-loaded")return e.load(),{spatialReference:null,updating:!0};if(e.spatialReference)return{spatialReference:e.spatialReference,updating:!1};if(e.baseLayers.length===0)return{spatialReference:null,updating:!1};const i=e.baseLayers.at(0);switch(i.loadStatus){case"not-loaded":i.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const r=(("supportedSpatialReferences"in i?i.supportedSpatialReferences:null)||["tileInfo"in i?(s=i.tileInfo)==null?void 0:s.spatialReference:i.spatialReference]).filter(Boolean),n=t.spatialReference;return n?{spatialReference:r.find(o=>n.equals(o))??r[0]??null,updating:!1}:{spatialReference:r[0],updating:!1}}const jdt=/^(basemaps|ibasemaps).*-api\.arcgis\.com$/i;function o0e(t){if(!t)return!1;const e=new m2(Gh(t));return!!e.authority&&jdt.test(e.authority)}function kQ(t){return t?!t.loaded&&t.resourceInfo?VRe(t.resourceInfo.data):{baseLayers:a0e(t.baseLayers),referenceLayers:a0e(t.referenceLayers)}:null}function a0e(t){return(it.isCollection(t)?t.toArray():t).map(zQ)}function zQ(t){var e,i;return{type:t.type,effect:"effect"in t?t.effect:void 0,url:GRe("urlTemplate"in t&&t.urlTemplate||t.url||"styleUrl"in t&&t.styleUrl||""),minScale:"minScale"in t&&t.minScale!=null?t.minScale:0,maxScale:"maxScale"in t&&t.maxScale!=null?t.maxScale:0,opacity:t.opacity!=null?t.opacity:1,visible:t.visible==null||!!t.visible,sublayers:t.type!=="map-image"&&t.type!=="wms"||t.sublayers==null||(e=t.sublayers)==null?void 0:e.map(r=>({id:r.id,visible:r.visible})),activeLayerId:t.type==="wmts"?(i=t.activeLayer)==null?void 0:i.id:void 0}}function l0e(t){return t.isReference||t.layerType==="ArcGISSceneServiceLayer"}function VRe(t){return t?{baseLayers:c0e((t.baseMapLayers??[]).filter(e=>!l0e(e))),referenceLayers:c0e((t.baseMapLayers??[]).filter(e=>l0e(e)))}:null}function c0e(t){return t.map(e=>Gdt(e))}function Gdt(t){let e;switch(t.layerType){case"VectorTileLayer":e="vector-tile";break;case"ArcGISTiledMapServiceLayer":e="tile";break;case"ArcGISSceneServiceLayer":e="scene";break;default:e="unknown"}return{type:e,effect:t.effect,url:GRe(t.templateUrl||t.urlTemplate||t.styleUrl||t.url),minScale:t.minScale??0,maxScale:t.maxScale??0,opacity:t.opacity??1,visible:t.visibility==null||!!t.visibility,sublayers:void 0,activeLayerId:void 0}}function BRe(t,e,i){return t!=null!=(e!=null)?"not-equal":!t||!e?"equal":u0e(t.baseLayers,e.baseLayers)?u0e(t.referenceLayers,e.referenceLayers)?"equal":i.mustMatchReferences?"not-equal":"base-layers-equal":"not-equal"}function u0e(t,e){if(t.length!==e.length)return!1;for(let i=0;i{var i,r,n;return[(i=this.basemap)==null?void 0:i.baseLayers,(r=this.ground)==null?void 0:r.layers,this.layers,(n=this.basemap)==null?void 0:n.referenceLayers]},getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=IRe(this),this.basemap=null,this.editableLayers=new GT({getCollections:()=>[this.allLayers],itemFilterFunction:Idt}),this.ground=new h5,this._basemapCache=Ldt()}destroy(){Ddt(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=et(this.basemap),et(this.ground),this._set("ground",null)}castBasemap(e){return Goe(e,this._basemapCache)}castGround(e){return Wdt(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(i=>i.id===e)}findTableById(e){return this.allTables.find(i=>i.id===e)}};y([w({readOnly:!0,dependsOn:[]})],Ag.prototype,"allLayers",void 0),y([w({readOnly:!0})],Ag.prototype,"allTables",void 0),y([w({type:Ay,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Ag.prototype,"basemap",void 0),y([Ci("basemap")],Ag.prototype,"castBasemap",null),y([w({readOnly:!0})],Ag.prototype,"editableLayers",void 0),y([w({type:h5,nonNullable:!0})],Ag.prototype,"ground",void 0),y([Ci("ground")],Ag.prototype,"castGround",null),Ag=y([Z("esri.Map")],Ag);const HRe=Ag;let F2=class{constructor(e,i){this.min=e,this.max=i,this.range=i-e}ndiff(e,i=0){return Math.ceil((e-i)/this.range)*this.range+i}_normalize(e,i,r,n=0,s=!1){return(r-=n)i&&(r-=this.ndiff(r-i)),s&&r===i&&(r=e),r+n}normalize(e,i=0,r=!1){return this._normalize(this.min,this.max,e,i,r)}clamp(e,i=0){return Je(e-i,this.min,this.max)+i}monotonic(e,i,r){return ee&&rd5.normalize(Vh(t)))],K1.prototype,"heading",void 0),y([w({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Ci(t=>Je(Vh(t),-180,180))],K1.prototype,"tilt",void 0),y([w({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],K1.prototype,"fov",void 0),K1=y([Z("esri.Camera")],K1);const cd=K1;var UQ;let tw=UQ=class extends Ue{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new UQ({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};function YH(){return{enabled:!this.camera}}y([w({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:YH}}}}})],tw.prototype,"rotation",void 0),y([Ci("rotation")],tw.prototype,"castRotation",null),y([w({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:YH}}}}})],tw.prototype,"scale",void 0),y([w({types:I9,json:{read:O2,write:!0,origins:{"web-scene":{read:O2,write:{overridePolicy:YH}}}}})],tw.prototype,"targetGeometry",void 0),y([w({type:cd,json:{write:!0}})],tw.prototype,"camera",void 0),tw=UQ=y([Z("esri.Viewpoint")],tw);const ih=tw;function Xdt(t,e){if(!t)return null;if(!VQ(t))return new se("webscene:unsupported-height-model-info","The vertical coordinate system of the scene is not supported",{heightModelInfo:t});const i=t.heightUnit,r=N_.deriveUnitFromSR(t,e).heightUnit;return i!==r?new se("webscene:incompatible-height-unit",`The vertical units of the scene (${i}) must match the horizontal units of the scene (${r})`,{verticalUnit:i,horizontalUnit:r}):null}function iei(t,e,i){const r=qRe(t),n=e,s=Zdt(r,n,i);if(r){const o=N_.deriveUnitFromSR(r,t.spatialReference).heightUnit;if(!i&&o!==r.heightUnit){const l=new se("layerview:unmatched-height-unit",`The vertical units of the layer must match the horizontal units (${o})`,{horizontalUnit:o});return new se("layerview:unsupported-height-model-info","The vertical coordinate system of the layer is not supported",{heightModelInfo:r,error:l})}}if(!Jdt(t)||s===Lh.Unsupported)return new se("layerview:unsupported-height-model-info","The vertical coordinate system of the layer is not supported",{heightModelInfo:r});switch(s){case Lh.Units:{const o=(r==null?void 0:r.heightUnit)||"unknown",l=(n==null?void 0:n.heightUnit)||"unknown",c=new se("layerview:incompatible-height-unit",`The vertical units of the layer (${o}) must match the vertical units of the scene (${l})`,{layerUnit:o,sceneUnit:l});return new se("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:r,sceneHeightModelInfo:n,error:c})}case Lh.HeightModel:{const o=(r==null?void 0:r.heightModel)||"unknown",l=(n==null?void 0:n.heightModel)||"unknown",c=new se("layerview:incompatible-height-model",`The height model of the layer (${o}) must match the height model of the scene (${l})`,{layerHeightModel:o,sceneHeightModel:l});return new se("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:r,sceneHeightModelInfo:n,error:c})}case Lh.CRS:{const o=(r==null?void 0:r.vertCRS)||"unknown",l=(n==null?void 0:n.vertCRS)||"unknown",c=new se("layerview:incompatible-vertical-datum",`The vertical datum of the layer (${o}) must match the vertical datum of the scene (${l})`,{layerDatum:o,sceneDatum:l});return new se("layerview:incompatible-height-model-info","The vertical coordinate system of the layer is incompatible with the scene",{layerHeightModelInfo:r,sceneHeightModelInfo:n,error:c})}}return null}function Zdt(t,e,i){if(!VQ(t)||!VQ(e))return Lh.Unsupported;if(t==null||e==null)return Lh.Ok;if(!i&&t.heightUnit!==e.heightUnit)return Lh.Units;if(t.heightModel!==e.heightModel)return Lh.HeightModel;switch(t.heightModel){case"gravity-related-height":return Lh.Ok;case"ellipsoidal":return t.vertCRS===e.vertCRS?Lh.Ok:Lh.CRS;default:return Lh.Unsupported}}var Lh;function VQ(t){return t==null||t.heightModel!=null&&t.heightUnit!=null}function Jdt(t){return"heightModelInfo"in t&&t.heightModelInfo!=null||t.spatialReference!=null||!XRe(t)}function qRe(t){var r;const e=t.url?vE(t.url):void 0;return!(((r=t.spatialReference)==null?void 0:r.vcsWkid)==null&&e!=null&&e.serverType==="ImageServer")&&WRe(t)&&t.heightModelInfo?t.heightModelInfo:XRe(t)?N_.deriveUnitFromSR(Qdt,t.spatialReference):null}function WRe(t){return"heightModelInfo"in t}function YRe(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function XRe(t){return YRe(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):ZRe(t)}function Kdt(t){return t.layers!=null||ZRe(t)||YRe(t)||WRe(t)}function ZRe(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"csv":case"dimension":case"geojson":case"feature":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(Lh||(Lh={}));const Qdt=new N_({heightModel:"gravity-related-height"});let iw=class extends Ue{constructor(e){super(e),this.facilityIdField=null,this.layerId=null,this.nameField=null,this.siteIdField=null,this.sublayerId=null}};y([w({type:String,json:{write:!0}})],iw.prototype,"facilityIdField",void 0),y([w({type:String,json:{write:!0}})],iw.prototype,"layerId",void 0),y([w({type:String,json:{write:!0}})],iw.prototype,"nameField",void 0),y([w({type:String,json:{write:!0}})],iw.prototype,"siteIdField",void 0),y([w({type:Number,json:{read:{source:"subLayerId"},write:{target:"subLayerId"},origins:{"web-scene":{read:!1,write:!1}}}})],iw.prototype,"sublayerId",void 0),iw=y([Z("esri.layers.support.FacilityLayerInfo")],iw);const ept=iw;let D0=class extends Ue{constructor(e){super(e),this.facilityIdField=null,this.layerId=null,this.levelIdField=null,this.levelNumberField=null,this.longNameField=null,this.shortNameField=null,this.sublayerId=null,this.verticalOrderField=null}};y([w({type:String,json:{write:!0}})],D0.prototype,"facilityIdField",void 0),y([w({type:String,json:{write:!0}})],D0.prototype,"layerId",void 0),y([w({type:String,json:{write:!0}})],D0.prototype,"levelIdField",void 0),y([w({type:String,json:{write:!0}})],D0.prototype,"levelNumberField",void 0),y([w({type:String,json:{write:!0}})],D0.prototype,"longNameField",void 0),y([w({type:String,json:{write:!0}})],D0.prototype,"shortNameField",void 0),y([w({type:Number,json:{read:{source:"subLayerId"},write:{target:"subLayerId"},origins:{"web-scene":{read:!1,write:!1}}}})],D0.prototype,"sublayerId",void 0),y([w({type:String,json:{write:!0}})],D0.prototype,"verticalOrderField",void 0),D0=y([Z("esri.layers.support.LevelLayerInfo")],D0);const tpt=D0;let V3=class extends Ue{constructor(e){super(e),this.layerId=null,this.nameField=null,this.siteIdField=null,this.sublayerId=null}};y([w({type:String,json:{write:!0}})],V3.prototype,"layerId",void 0),y([w({type:String,json:{write:!0}})],V3.prototype,"nameField",void 0),y([w({type:String,json:{write:!0}})],V3.prototype,"siteIdField",void 0),y([w({type:Number,json:{read:{source:"subLayerId"},write:{target:"subLayerId"},origins:{"web-scene":{read:!1,write:!1}}}})],V3.prototype,"sublayerId",void 0),V3=y([Z("esri.layers.support.SiteLayerInfo")],V3);const ipt=V3;let OA=class extends Ue{constructor(e){super(e),this.levelLayer=null,this.facilityLayer=null,this.siteLayer=null}};y([w({type:tpt,json:{write:!0}})],OA.prototype,"levelLayer",void 0),y([w({type:ept,json:{write:!0}})],OA.prototype,"facilityLayer",void 0),y([w({type:ipt,json:{write:!0}})],OA.prototype,"siteLayer",void 0),OA=y([Z("esri.support.MapFloorInfo")],OA);const rpt=OA,npt="webscene:failed-to-copy-embedded-resources",spt="webscene:schema-validation";function opt(){return new se(npt,"Copying of embedded resources is currently not supported")}function apt(t){return new se(spt,"Failed to save webscene due to schema validation errors. See 'details.errors' for more detailed information",{errors:t})}function p5(t,e){return t!=null&&(e==null||(e===_t.Local?!t.isGeographic||t.isWGS84||t.wkid===wf.CGCS2000:t.isWebMercator||t.isWGS84||t.wkid===wf.CGCS2000||t.wkid===wf.GCSMARS2000||t.wkid===wf.GCSMARS2000_SPHERE||t.wkid===wf.GCSMOON2000))}const lpt={width:600,height:400},SD=1.5;function cpt(t,e){e=e||lpt;let{width:i,height:r}=e;const n=i/r;return nSD&&(i=r*SD),i>t.width&&(r*=t.width/i,i=t.width),r>t.height&&(i*=t.height/r,r=t.height),{width:Math.round(i),height:Math.round(r)}}function d0e(t){return{enabled:!!(t!=null&&t.length)}}var BQ;let PA=BQ=class extends Ue{constructor(t){super(t),this.exactMatch=!1,this.name=null,this.type=null}clone(){return new BQ({exactMatch:this.exactMatch,type:this.type,name:this.name})}};y([w({type:Boolean,json:{write:!0}})],PA.prototype,"exactMatch",void 0),y([w({type:String,json:{write:!0}})],PA.prototype,"name",void 0),y([Vt(foe)],PA.prototype,"type",void 0),PA=BQ=y([Z("esri.webdoc.applicationProperties.SearchLayerField")],PA);const upt=PA;var jQ;let RA=jQ=class extends Ue{constructor(t){super(t),this.field=null,this.id=null,this.subLayer=null}clone(){return new jQ(Re({field:this.field,id:this.id,subLayer:this.subLayer}))}};y([w({type:upt,json:{write:{isRequired:!0}}})],RA.prototype,"field",void 0),y([w({type:String,json:{write:{isRequired:!0}}})],RA.prototype,"id",void 0),y([w({type:$n,json:{write:!0}})],RA.prototype,"subLayer",void 0),RA=jQ=y([Z("esri.webdoc.applicationProperties.SearchLayer")],RA);const hpt=RA;var GQ;let IA=GQ=class extends Ue{constructor(t){super(t),this.exactMatch=!1,this.name=null,this.type=null}clone(){return new GQ({exactMatch:this.exactMatch,type:this.type,name:this.name})}};y([w({type:Boolean,json:{write:!0}})],IA.prototype,"exactMatch",void 0),y([w({type:String,json:{write:!0}})],IA.prototype,"name",void 0),y([Vt(foe)],IA.prototype,"type",void 0),IA=GQ=y([Z("esri.webdoc.applicationProperties.SearchTableField")],IA);const dpt=IA;var HQ;let B4=HQ=class extends Ue{constructor(t){super(t),this.field=null,this.id=null}clone(){return new HQ(Re({field:this.field,id:this.id}))}};y([w({type:dpt,json:{write:{isRequired:!0}}})],B4.prototype,"field",void 0),y([w({type:String,json:{write:{isRequired:!0}}})],B4.prototype,"id",void 0),B4=HQ=y([Z("esri.webdoc.applicationProperties.SearchTable")],B4);const ppt=B4;var qQ;const JRe=it.ofType(hpt),KRe=it.ofType(ppt);let Mg=qQ=class extends Ue{constructor(t){super(t),this.addressSearchEnabled=!0,this.enabled=!0,this.hintText=null,this.layers=new JRe,this.tables=new KRe}readAddressSearchEnabled(t){return!t}writeAddressSearchEnabled(t,e,i){e[i]=!t}clone(){return new qQ(Re({addressSearchEnabled:this.addressSearchEnabled,enabled:this.enabled,hintText:this.hintText,layers:this.layers,tables:this.tables}))}};y([w({type:Boolean,nonNullable:!0,json:{read:{source:"disablePlaceFinder"},write:{target:"disablePlaceFinder",isRequired:!0},origins:{"web-scene":{read:!1,write:!1}}}})],Mg.prototype,"addressSearchEnabled",void 0),y([$t("addressSearchEnabled")],Mg.prototype,"readAddressSearchEnabled",null),y([Pt("addressSearchEnabled")],Mg.prototype,"writeAddressSearchEnabled",null),y([w({type:Boolean,nonNullable:!0,json:{write:!0,origins:{"web-map":{write:{isRequired:!0}},"web-scene":{default:!0,write:!0}}}})],Mg.prototype,"enabled",void 0),y([w({type:String,json:{write:!0}})],Mg.prototype,"hintText",void 0),y([w({type:JRe,json:{write:{overridePolicy:d0e},origins:{"web-scene":{write:{isRequired:!0}}}}})],Mg.prototype,"layers",void 0),y([w({type:KRe,json:{read:!0,write:{overridePolicy:d0e}}})],Mg.prototype,"tables",void 0),Mg=qQ=y([Z("esri.webdoc.applicationProperties.Search")],Mg);const fpt=Mg;var WQ;let vF=WQ=class extends Ue{constructor(t){super(t),this.search=null}clone(){return new WQ(Re({search:this.search}))}};y([w({type:fpt,json:{write:!0}})],vF.prototype,"search",void 0),vF=WQ=y([Z("esri.webdoc.applicationProperties.Viewing")],vF);const mpt=vF;var YQ;let _F=YQ=class extends Ue{constructor(t){super(t),this.viewing=null}clone(){return new YQ({viewing:this.viewing?this.viewing.clone():null})}};y([w({type:mpt,json:{write:!0}})],_F.prototype,"viewing",void 0),_F=YQ=y([Z("esri.webscene.ApplicationProperties")],_F);const gpt=_F;var XQ;let j4=XQ=class extends Ue{constructor(t){super(t),this.type="sunny",this.cloudCover=.5}clone(){return new XQ({cloudCover:this.cloudCover})}};y([Vt({sunny:"sunny"})],j4.prototype,"type",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],j4.prototype,"cloudCover",void 0),j4=XQ=y([Z("esri.views.3d.environment.SunnyWeather")],j4);const sU=j4;var ZQ;let G4=ZQ=class extends Ue{constructor(t){super(t),this.type="cloudy",this.cloudCover=.5}clone(){return new ZQ({cloudCover:this.cloudCover})}};y([Vt({cloudy:"cloudy"})],G4.prototype,"type",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],G4.prototype,"cloudCover",void 0),G4=ZQ=y([Z("esri.views.3d.environment.CloudyWeather")],G4);const ypt=G4;var JQ;let H4=JQ=class extends Ue{constructor(t){super(t),this.type="foggy",this.fogStrength=.5}clone(){return new JQ({fogStrength:this.fogStrength})}};y([Vt({foggy:"foggy"})],H4.prototype,"type",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],H4.prototype,"fogStrength",void 0),H4=JQ=y([Z("esri.views.3d.environment.FoggyWeather")],H4);const vpt=H4;var KQ;let $A=KQ=class extends Ue{constructor(t){super(t),this.type="rainy",this.cloudCover=.5,this.precipitation=.5}clone(){return new KQ({cloudCover:this.cloudCover,precipitation:this.precipitation})}};y([Vt({rainy:"rainy"})],$A.prototype,"type",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],$A.prototype,"cloudCover",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],$A.prototype,"precipitation",void 0),$A=KQ=y([Z("esri.views.3d.environment.RainyWeather")],$A);const _pt=$A;var QQ;let B3=QQ=class extends Ue{constructor(t){super(t),this.type="snowy",this.cloudCover=.5,this.precipitation=.5,this.snowCover="disabled"}clone(){return new QQ({cloudCover:this.cloudCover,precipitation:this.precipitation,snowCover:this.snowCover})}};y([Vt({snowy:"snowy"})],B3.prototype,"type",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],B3.prototype,"cloudCover",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],B3.prototype,"precipitation",void 0),y([w({type:["enabled","disabled"],nonNullable:!0,json:{write:!0}})],B3.prototype,"snowCover",void 0),B3=QQ=y([Z("esri.views.3d.environment.SnowyWeather")],B3);const bpt=B3,qoe={key:"type",base:sU,typeMap:{sunny:sU,cloudy:ypt,rainy:_pt,snowy:bpt,foggy:vpt}},wpt=Object.keys(qoe.typeMap);function xpt(t,e){return!!wpt.includes(t)||(e.error(`"${t}" is not a valid weather type`),!1)}const Pv=1e4,Spt=1e5;var eee;let qp=eee=class extends Ue{constructor(t){super(t),this.type="sun",this.date=null,this.directShadowsEnabled=!1,this.displayUTCOffset=null}readDate(t,e){return e.datetime!=null&&new Date(e.datetime)||null}writeDate(t,e,i){e[i]=t.getTime()}readDirectShadowsEnabled(t,e){return!!e.directShadows}writedirectShadowsEnabled(t,e,i){t&&(e[i]=t)}writeDisplayUTCOffset(t,e){t!=null&&(e.displayUTCOffset=t)}clone(){return new eee(this.cloneConstructProperties())}cloneConstructProperties(){const t={directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:this.displayUTCOffset!=null?this.displayUTCOffset:null};return this.date!=null&&(t.date=new Date(this.date.getTime())),t}};y([w({readOnly:!0,type:["sun"],json:{write:!0}})],qp.prototype,"type",void 0),y([w({type:Date,json:{type:Number,write:{target:"datetime"}}})],qp.prototype,"date",void 0),y([$t("date",["datetime"])],qp.prototype,"readDate",null),y([Pt("date")],qp.prototype,"writeDate",null),y([w({type:Boolean,json:{default:!1,write:{target:"directShadows"}}})],qp.prototype,"directShadowsEnabled",void 0),y([$t("directShadowsEnabled",["directShadows"])],qp.prototype,"readDirectShadowsEnabled",null),y([Pt("directShadowsEnabled")],qp.prototype,"writedirectShadowsEnabled",null),y([w({type:Number,json:{write:!0}})],qp.prototype,"displayUTCOffset",void 0),y([Pt("displayUTCOffset")],qp.prototype,"writeDisplayUTCOffset",null),qp=eee=y([Z("esri.webscene.SunLighting")],qp);const HT=qp;var tee;let q4=tee=class extends Ue{constructor(t){super(t),this.type="virtual",this.directShadowsEnabled=!1}clone(){return new tee(this.cloneConstructProperties())}cloneConstructProperties(){return{directShadowsEnabled:this.directShadowsEnabled}}};y([w({readOnly:!0,type:["virtual"],json:{write:!0}})],q4.prototype,"type",void 0),y([w({type:Boolean,json:{default:!1,name:"directShadows",write:!0}})],q4.prototype,"directShadowsEnabled",void 0),q4=tee=y([Z("esri.webscene.VirtualLighting")],q4);const B9=q4,QRe={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:HT,virtual:B9}};let bF=class extends Ue{constructor(e){super(e)}clone(){}};y([w({readOnly:!0,json:{read:!1}})],bF.prototype,"type",void 0),bF=y([Z("esri.webscene.background.Background")],bF);const e4e=bF;var iee;const Tpt={...$_,nonNullable:!0};let W4=iee=class extends e4e{constructor(t){super(t),this.type="color",this.color=new qe([0,0,0,1])}clone(){return new iee(this.cloneProperties())}cloneProperties(){return{color:this.color.clone()}}};y([Vt({color:"color"},{readOnly:!0})],W4.prototype,"type",void 0),y([w(Tpt)],W4.prototype,"color",void 0),W4=iee=y([Z("esri.webscene.background.ColorBackground")],W4);const t4e=W4,p0e={base:e4e,key:"type",typeMap:{color:t4e}};function Ept(t){return(e,i,r)=>{if(!e)return e;for(const n in t.typeMap)if(e.type===n){const s=new t.typeMap[n];return s.read(e,r),s}}}const Cpt={types:p0e,json:{read:Ept(p0e),write:{overridePolicy:(t,e,i)=>({enabled:!i||!i.isPresentation})}}};var ree;const i4e="esri.webscene.Environment",Apt=Ce.getLogger(i4e),f0e=(t,e,i)=>({enabled:!i||!i.isPresentation});let rw=ree=class extends Ue{constructor(t){super(t),this.lighting=new HT,this.background=null,this.atmosphereEnabled=!0,this.starsEnabled=!0}set weather(t){xpt(t==null?void 0:t.type,Apt)&&this._set("weather",t)}clone(){return new ree(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&this.lighting.type==="virtual"?B9.prototype.clone.call(this.lighting):HT.prototype.clone.call(this.lighting),background:Re(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};y([w({types:QRe,nonNullable:!0,json:{write:!0}})],rw.prototype,"lighting",void 0),y([w(Cpt)],rw.prototype,"background",void 0),y([w({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:f0e}}})],rw.prototype,"atmosphereEnabled",void 0),y([w({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:f0e}}})],rw.prototype,"starsEnabled",void 0),y([w({types:qoe,nonNullable:!0,json:{write:!0},value:new sU})],rw.prototype,"weather",null),rw=ree=y([Z(i4e)],rw);const f5=rw;var nee;let j3=nee=class extends Ue{constructor(t){super(t),this.environment=new f5,this.spatialReference=null,this.viewpoint=null}set viewingMode(t){this._set("viewingMode",t)}clone(){return new nee({environment:this.environment.clone(),spatialReference:this.spatialReference?this.spatialReference.clone():null,viewingMode:this.viewingMode,viewpoint:this.viewpoint?this.viewpoint.clone():null})}};y([w({type:f5,json:{write:{isRequired:!0}}})],j3.prototype,"environment",void 0),y([w({type:at})],j3.prototype,"spatialReference",void 0),y([w({type:["local","global"]})],j3.prototype,"viewingMode",null),y([w({type:ih,json:{write:{isRequired:!0}}})],j3.prototype,"viewpoint",void 0),j3=nee=y([Z("esri.webscene.InitialViewProperties")],j3);const oU=j3;let Mpt=class{constructor(e,i){this._observable=new v9,this._value=e,this._equalityFunction=i}get value(){return wi(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}};function m5(t,e=Z3e){return new Mpt(t,e)}let Opt=class{constructor(){this._tasks=new Array,this._running=m5(!1)}get length(){return this._tasks.length}get running(){return this._running.value}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,i,r){return this._running.value=!0,new Promise((n,s)=>this._tasks.push(new m0e(n,s,e,i,r)))}unshift(e,i,r){return this._running.value=!0,new Promise((n,s)=>this._tasks.unshift(new m0e(n,s,e,i,r)))}_process(e){var r;if(this._tasks.length===0)return!1;const i=this._tasks.shift();try{const n=xo(i.signal);if(n&&!i.abortCallback)i.reject(ur());else{const s=n?(r=i.abortCallback)==null?void 0:r.call(i,ur()):i.callback(e);pd(s)?s.then(i.resolve,i.reject):i.resolve(s)}}catch(n){i.reject(n)}return this._running.value=this._tasks.length>0,!0}cancelAll(){const e=ur();for(const i of this._tasks)if(i.abortCallback){const r=i.abortCallback(e);i.resolve(r)}else i.reject(e);this._tasks.length=0,this._running.value=!1}},m0e=class{constructor(e,i,r,n=void 0,s=void 0){this.resolve=e,this.reject=i,this.callback=r,this.signal=n,this.abortCallback=s}},Y4=class extends ze{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};y([w()],Y4.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),y([w()],Y4.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Y4=y([Z("esri.views.support.DebugFlags")],Y4);const Ppt=new Y4;var Vr;(function(t){t[t.ANIMATING=0]="ANIMATING",t[t.INTERACTING=1]="INTERACTING",t[t.IDLE=2]="IDLE"})(Vr||(Vr={}));function Rpt(){return new aU.Scheduler}var Xl,ni;(function(t){t[t.YIELD=1]="YIELD"})(Xl||(Xl={})),function(t){t.RESOURCE_CONTROLLER_IMMEDIATE="immediate",t.RESOURCE_CONTROLLER="schedule",t.SLIDE="slide",t.STREAM_DATA_LOADER="stream loader",t.ELEVATION_QUERY="elevation query",t.TERRAIN_SURFACE="terrain",t.SURFACE_GEOMETRY_UPDATES="surface geometry updates",t.LOD_RENDERER="LoD renderer",t.GRAPHICS_CORE="Graphics3D",t.I3S_CONTROLLER="I3S",t.POINT_CLOUD_LAYER="point cloud",t.FEATURE_TILE_FETCHER="feature fetcher",t.OVERLAY="overlay",t.STAGE="stage",t.GRAPHICS_DECONFLICTOR="graphics deconflictor",t.FILTER_VISIBILITY="Graphics3D filter visibility",t.SCALE_VISIBILITY="Graphics3D scale visibility",t.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",t.POINT_OF_INTEREST_FREQUENT="POI frequent",t.POINT_OF_INTEREST_INFREQUENT="POI infrequent",t.LABELER="labeler",t.FEATURE_QUERY_ENGINE="feature query",t.FEATURE_TILE_TREE="feature tile tree",t.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",t.ELEVATION_ALIGNMENT="elevation alignment",t.TEXT_TEXTURE_ATLAS="text texture atlas",t.TEXTURE_UNLOAD="texture unload",t.LINE_OF_SIGHT_TOOL="line of sight tool",t.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",t.ELEVATION_PROFILE="elevation profile",t.SNAPPING="snapping",t.SHADOW_ACCUMULATOR="shadow accumulator",t.CLOUDS_GENERATOR="clouds generator",t[t.NONE=0]="NONE",t[t.TEST_PRIO=1]="TEST_PRIO"}(ni||(ni={}));const iy=0,g0e=new Map([[ni.RESOURCE_CONTROLLER_IMMEDIATE,iy],[ni.RESOURCE_CONTROLLER,4],[ni.SLIDE,iy],[ni.STREAM_DATA_LOADER,iy],[ni.ELEVATION_QUERY,iy],[ni.TERRAIN_SURFACE,1],[ni.SURFACE_GEOMETRY_UPDATES,1],[ni.LOD_RENDERER,2],[ni.GRAPHICS_CORE,2],[ni.I3S_CONTROLLER,2],[ni.POINT_CLOUD_LAYER,2],[ni.FEATURE_TILE_FETCHER,2],[ni.OVERLAY,4],[ni.STAGE,4],[ni.GRAPHICS_DECONFLICTOR,4],[ni.FILTER_VISIBILITY,4],[ni.SCALE_VISIBILITY,4],[ni.FRUSTUM_VISIBILITY,4],[ni.CLOUDS_GENERATOR,4],[ni.POINT_OF_INTEREST_FREQUENT,6],[ni.POINT_OF_INTEREST_INFREQUENT,30],[ni.LABELER,8],[ni.FEATURE_QUERY_ENGINE,8],[ni.FEATURE_TILE_TREE,16],[ni.FEATURE_TILE_TREE_ACTIVE,iy],[ni.ELEVATION_ALIGNMENT,12],[ni.TEXT_TEXTURE_ATLAS,12],[ni.TEXTURE_UNLOAD,12],[ni.LINE_OF_SIGHT_TOOL,16],[ni.LINE_OF_SIGHT_TOOL_INTERACTIVE,iy],[ni.SNAPPING,iy],[ni.SHADOW_ACCUMULATOR,30]]);function y0e(t){return g0e.has(t)?g0e.get(t):typeof t=="number"?t:1}const v0e=6.5,_0e=1,Ipt=30,b0e=1e3/30,w0e=100,x0e=.9;var aU,wx;(function(t){class e{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(s=>s.needsUpdate)}constructor(){this._updating=m5(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new zv("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new r,this._state=Vr.INTERACTING,this._tasks=new Pi,this._runQueue=new Pi,this._load=0,this._idleStateCallbacks=new Pi,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=_e(()=>Ppt.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,ii);for(const o of Object.keys(ni))this.performanceInfo.tasks.set(ni[o],new zv(ni[o]));const s=this;this._test={FRAME_SAFETY_BUDGET:v0e,INTERACTING_BUDGET:b0e,IDLE_BUDGET:w0e,get availableBudget(){return s._budget.budget},usedBudget:0,getBudget:()=>s._budget,setBudget:o=>s._budget=o,updateTask:o=>this._updateTask(o),getState:o=>this._getState(o),getRuntime:o=>this._getRuntime(o),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach(s=>s.remove()),this._tasks.clear(),en(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(s){this._updatingChanged(),s&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(s,o){const l=y0e(s),c=new i(this,s,o,l);return this._tasks.push(c),this._updatingChanged(),this.performanceInfo.tasks.has(s)||this.performanceInfo.tasks.set(s,new zv(s)),c}registerIdleStateCallbacks(s,o){const l={idleBegin:s,idleEnd:o};this._idleStateCallbacks.push(l),this.state===Vr.IDLE&&this._idleUpdatesStartFired&&l.idleBegin();const c=this;return{remove:()=>this._removeIdleStateCallbacks(l),set idleBegin(f){c._idleUpdatesStartFired&&(l.idleEnd(),c._state===Vr.IDLE&&f()),l.idleBegin=f},set idleEnd(f){l.idleEnd=f}}}get load(){return this._load}set state(s){this._state!==s&&(this._state=s,this.state!==Vr.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(o=>o.idleEnd())))}get state(){return this._state}updateBudget(s){this._test.usedBudget=0,++this._frameNumber;let o=v0e,l=s.frameDuration,c=_0e;switch(this.state){case Vr.IDLE:o=0,l=Math.max(w0e,s.frameDuration),c=Ipt;break;case Vr.INTERACTING:l=Math.max(b0e,s.frameDuration);case Vr.ANIMATING:}return l=l-s.elapsedFrameTime-o,this.state!==Vr.IDLE&&l<_0e&&!this._forceTask?(this._forceTask=!0,!1):(l=Math.max(l,c),this._budget.reset(l,this.state),this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case Vr.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll(s=>s.idleBegin())),this._runIdle();break;case Vr.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(0,this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(s){this._idleUpdatesStartFired&&s.idleEnd(),this._idleStateCallbacks.removeUnordered(s)}removeTask(s){this._tasks.removeUnordered(s),this._runQueue.removeUnordered(s),this._updatingChanged()}_updateTask(s){this._tasks.forAll(o=>{o.name===s&&o.setPriority(s)})}_getState(s){if(this._runQueue.some(l=>l.name===s))return wx.SCHEDULED;let o=wx.IDLE;return this._tasks.forAll(l=>{l.name===s&&l.needsUpdate&&(l.schedulePriority<=1?o=wx.READY:o!==wx.READY&&(o=wx.WAITING))}),o}_getRuntime(s){let o=0;return this._tasks.forAll(l=>{l.name===s&&(o+=l.runtime)}),o}_resetRuntimes(){this._tasks.forAll(s=>s.runtime=0)}_getRunning(){const s=new Map;if(this._tasks.forAll(l=>{l.needsUpdate&&s.set(l.name,(s.get(l.name)||0)+1)}),s.size===0)return null;let o="";return s.forEach((l,c)=>{o+=l>1?` ${l}x ${c}`:` ${c}`}),o}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const s=this._tasks.reduce((o,l)=>l.needsUpdate?++o:o,0);this._load=this._load*x0e+s*(1-x0e)}_schedule(){for(this._runQueue.filterInPlace(s=>!!s.needsUpdate||(s.schedulePriority=s.basePriority,!1)),this._tasks.forAll(s=>{s.basePriority===iy&&s.needsUpdate&&!this._runQueue.includes(s)&&s.blockFrame!==this._frameNumber&&this._runQueue.unshift(s)});this._runQueue.length===0;){let s=!1,o=0;if(this._tasks.forAll(l=>{l.needsUpdate&&l.schedulePriority!==0&&l.basePriority!==iy&&l.blockFrame!==this._frameNumber&&(s=!0,o=Math.max(o,l.basePriority),l.schedulePriority===1?(l.schedulePriority=0,this._runQueue.push(l)):--l.schedulePriority)}),!s)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const s=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const o=this._budget.now(),l=this._runQueue.pop();this._budget.resetProgress();try{l.task.runTask(this._budget)===Xl.YIELD&&(l.blockFrame=this._frameNumber)}catch(f){Ce.getLogger("esri.views.support.Scheduler").error(`Exception in task "${l.name}"`,f),l.blockFrame=this._frameNumber}!this._budget.hasProgressed&&l.blockFrame!==this._frameNumber&&l.needsUpdate&&(l.name,ni.I3S_CONTROLLER,l.blockFrame=this._frameNumber),l.schedulePriority=l.basePriority;const c=this._budget.now()-o;if(l.runtime+=c,this._frameTaskTimes.set(l.priority,this._frameTaskTimes.get(l.priority)+c),this._debug&&c>2*this._budget.budget&&console.log("Task",l.name,"used",c,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-s)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-s)}_startFrameTaskTimes(){for(const s of Object.keys(ni))this._frameTaskTimes.set(ni[s],0)}_recordFrameTaskTimes(s){this._frameTaskTimes.forEach((o,l)=>this.performanceInfo.tasks.get(l).record(o)),this.performanceInfo.total.record(s)}get test(){return this._test}}t.Scheduler=e;class i{get task(){return this._task.value}get updating(){return this._queue.running}constructor(s,o,l,c){this._scheduler=s,this.name=o,this._basePriority=c,this.blockFrame=0,this.runtime=0,this._queue=new Opt,this._handles=new O_,this.schedulePriority=this._basePriority,this._task=m5(l??this._queue),this._handles.add(Mo(()=>this.task.running,f=>s.taskRunningChanged(f)))}remove(){this.processQueue(ou),this._scheduler.removeTask(this),this.schedule=g5.schedule,this.reschedule=g5.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(s){this.name=s;const o=y0e(s);this._basePriority!==iy&&this.schedulePriority===0||(this.schedulePriority=o),this._basePriority=o}get priority(){return this.name}set priority(s){this.setPriority(s)}get needsUpdate(){return this.updating||this.task.running}schedule(s,o,l){return this._queue.push(s,o,l)}reschedule(s,o,l){return this._queue.unshift(s,o,l)}processQueue(s){this._queue.runTask(s)}}class r{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=Vr.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(s){return!this.done&&(s()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(s){this._enabled=s}reset(s,o){this._begin=this.now(),this._budget=s,this._state=o,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}t.Budget=r})(aU||(aU={})),function(t){t.SCHEDULED="s",t.READY="r",t.WAITING="w",t.IDLE="i"}(wx||(wx={}));const ou=(()=>{const t=new aU.Budget;return t.enabled=!1,t})();let $pt=class{remove(){}processQueue(){}schedule(e,i,r){try{if(xo(i)){const n=ur();return r?Promise.resolve(r(n)):Promise.reject(n)}return JX(e(ou))}catch(n){return Promise.reject(n)}}reschedule(e,i,r){return this.schedule(e,i,r)}};const g5=new $pt;var see;let Gv=see=class extends Ue{constructor(){super(...arguments),this.url=""}destroy(){this.url=""}clone(){return new see({url:this.url})}};y([w({type:String,json:{write:{isRequired:!0}}})],Gv.prototype,"url",void 0),Gv=see=y([Z("esri.webdoc.support.SlideThumbnail")],Gv);var oee;let wF=oee=class extends Ue{constructor(){super(...arguments),this.text=""}clone(){return new oee({text:this.text})}};y([w({type:String,json:{write:!0}})],wF.prototype,"text",void 0),wF=oee=y([Z("esri.webscene.support.Description")],wF);const xF=wF;var aee;let MM=aee=class extends Ue{constructor(){super(...arguments),this.lighting=new HT,this.weather=new sU}clone(){return new aee({lighting:Re(this.lighting),weather:Re(this.weather)})}};y([w({types:QRe,json:{write:!0}})],MM.prototype,"lighting",void 0),y([w({types:qoe,json:{write:!0}})],MM.prototype,"weather",void 0),MM=aee=y([Z("esri.webscene.Environment")],MM);var SF;let TF=SF=class extends Ue{constructor(){super(...arguments),this.opacity=null}clone(){return new SF({opacity:this.opacity})}cloneAndApplyTo(t){return this.opacity==null||((t=(t==null?void 0:t.clone())??new h5).opacity=this.opacity),t}static fromGround(t){return new SF({opacity:t.opacity})}};y([w({type:Number,json:{type:$n,read:{reader:jT,source:"transparency"},write:{writer:(t,e)=>{e.transparency=DB(t)},target:"transparency"}}})],TF.prototype,"opacity",void 0),TF=SF=y([Z("esri.webscene.support.SlideGround")],TF);const r4e=TF;var lee;let OM=lee=class extends Ue{constructor(t){super(t),this.id="",this.sublayerIds=null}clone(){return new lee({id:this.id,sublayerIds:Re(this.sublayerIds)})}};y([w({type:String,json:{write:!0}})],OM.prototype,"id",void 0),y([w({type:[$n],json:{read:{source:"subLayerIds"},write:{target:"subLayerIds"}}})],OM.prototype,"sublayerIds",void 0),OM=lee=y([Z("esri.webscene.support.SlideVisibleLayer")],OM);var cee;let EF=cee=class extends Ue{constructor(){super(...arguments),this.text=""}clone(){return new cee({text:this.text})}};y([w({type:String,json:{write:{isRequired:!0}}})],EF.prototype,"text",void 0),EF=cee=y([Z("esri.webscene.support.Title")],EF);const d$=EF;let Lpt=0;const uee=it.ofType(OM);let Nl=class extends Ue{constructor(e){super(e),this.id=Date.now().toString(16)+"-slide-"+Lpt++,this.title=new d$,this.description=new xF,this.hidden=!1,this.thumbnail=new Gv,this.viewpoint=null,this.basemap=null,this.ground=null,this.environment=new MM,this.visibleLayers=new uee}destroy(){this.visibleLayers.removeAll(),this.basemap=null,this.thumbnail=et(this.thumbnail),this.description=null,this.title=null,this.thumbnail=null}castTitle(e){return typeof e=="string"?new d$({text:e}):$s(d$,e)}castDescription(e){return typeof e=="string"?new xF({text:e}):$s(xF,e)}castThumbnail(e){return typeof e=="string"?new Gv({url:e}):$s(Gv,e)}castBasemap(e){return Goe(e)}set visibleLayers(e){this._set("visibleLayers",sd(e,this._get("visibleLayers"),uee))}castVisibleLayers(e){return e&&typeof e.map=="function"?e.map(i=>{if(typeof i=="string")return{id:i};if(i instanceof uE){const r=S0e(i);return{id:i.id,sublayerIds:r}}return i.id?{id:i.id,sublayerIds:"sublayerIds"in i?i.sublayerIds:void 0}:(Ce.getLogger(this).warn('Invalid visible layer, expected { id }, Layer or "id"'),i)}):null}clone(){var e,i;return new this.constructor({id:this.id,title:this.title.clone(),thumbnail:this.thumbnail.clone(),description:this.description&&this.description.clone()||null,viewpoint:this.viewpoint&&this.viewpoint.clone()||null,basemap:((e=this.basemap)==null?void 0:e.clone())||null,ground:((i=this.ground)==null?void 0:i.clone())||null,visibleLayers:this.visibleLayers.clone(),environment:this.environment&&this.environment.clone()||null,hidden:this.hidden})}async _updateVisibleLayersFrom(e){const i=[];await Promise.allSettled(this._getLayers(e.map).map(r=>e.whenLayerView(r).then(n=>{if(n.visible){const s=S0e(r);i.push(new OM({id:n.layer.id,sublayerIds:s}))}})).toArray()),this.visibleLayers.removeAll(),this.visibleLayers.addMany(i)}updateFrom(e,i){const r={format:"png",quality:80,width:120,height:75,disableDecorations:!0,...i==null?void 0:i.screenshot};return e.when(()=>(this.viewpoint=e.viewpoint.clone(),this.environment.lighting=e.environment.lighting.type==="virtual"?B9.prototype.clone.apply(e.environment.lighting):HT.prototype.clone.apply(e.environment.lighting),this.environment.weather=e.environment.weather.clone(),this.basemap=e.map.basemap&&e.map.basemap.clone()||null,this.ground=e.map.ground?r4e.fromGround(e.map.ground):null,this._updateVisibleLayersFrom(e))).then(()=>e.takeScreenshot(r)).then(n=>(this.thumbnail=new Gv({url:n.dataUrl}),this))}async applyTo(e,i){this._applyToController!=null&&this._applyToController.abort();let r=new AbortController;this._applyToController=r;const n=g9(i,()=>r==null?void 0:r.abort()),s=e.resourceController.scheduler.registerTask(ni.SLIDE);let o=!1;const l={animate:!0,...i,signal:this._applyToController.signal},c=async()=>{await Promise.all([s.schedule(async()=>o=await this._setViewpointOfInterest(e,l)),s.schedule(()=>this._applyBasemap(e,l),l.signal)]),await this._loadLayersWithSublayerVisibility(e),await Promise.all([s.schedule(()=>this._applyLayerVisibility(e),l.signal),s.schedule(()=>this._applyGround(e),l.signal),s.schedule(()=>this._applyViewpoint(e,l),l.signal)]),await s.schedule(()=>e.environment.weather=this.environment.weather.clone())},f=await Ju(e.addUpdatingPromise(c()));if(o&&(e.contentCamera=null),s.remove(),this._applyToController===r&&(this._applyToController=null),r=null,n==null||n.remove(),f.ok===!1)throw f.error;return this}async _applyBasemap(e,i){if(this.basemap){try{await this.basemap.load(i)}catch(r){if(sn(r))throw r}e.map.basemap=kdt(this.basemap,e.map.basemap)}}_applyGround(e){this.ground&&(e.map.ground=this.ground.cloneAndApplyTo(e.map.ground))}_getLayers(e){const i=new it;return this._collectLayers(e,i),this._collectLayers(e.ground,i),i}_collectLayers(e,i){e.layers.forEach(r=>{r.persistenceEnabled&&(i.add(r),"layers"in r&&this._collectLayers(r,i))})}async _loadLayersWithSublayerVisibility(e){this.visibleLayers&&await Promise.allSettled(this._getLayers(e.map).items.map(i=>{var n;return((n=this.visibleLayers.find(s=>s.id===i.id))==null?void 0:n.sublayerIds)?i.load():null}))}_applyLayerVisibility(e){this.visibleLayers&&this._getLayers(e.map).forEach(i=>{const r=this.visibleLayers.find(o=>o.id===i.id);i.visible=r!=null;const n=r==null?void 0:r.sublayerIds,s=n4e(i);n&&s&&s.forEach(o=>o.visible=n.includes(o.id))})}async _setViewpointOfInterest(e,i){if(e.state.fixedContentCamera||!this.viewpoint||i!=null&&i.ignoreViewpoint||!(i!=null&&i.useDestinationCamera))return!1;const{toCameraAsync:r}=await we(()=>Promise.resolve().then(()=>Swt),void 0),n=await r(e,this.viewpoint);return e.contentCamera=n,n!=null}async _applyViewpoint(e,i){if(this._applyCachedCameraTrackingEnabled(e),this.viewpoint&&!i.ignoreViewpoint){this.viewpoint.camera!=null&&(this.viewpoint.camera.fov=e.camera.fov);const r=this.environment.lighting;if(i.animate&&r.type==="sun"&&r.date)return this._animateToLighting(e,i);i.animate&&(e.environment.applyLighting(r.clone()),await e.goTo(this.viewpoint,i)),e.viewpoint=this.viewpoint}e.environment.applyLighting(this.environment.lighting.clone())}async _animateToLighting(e,i){let r=null;return e.environment.lighting.type!=="virtual"&&this.environment.lighting.type!=="virtual"&&(e.viewingMode==="global"&&(r=this._animateLightingWithCamera(e,e.environment.lighting,this.environment.lighting)),e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1),e.environment.lighting.directShadowsEnabled=this.environment.lighting.directShadowsEnabled,this.environment.lighting.type==="virtual"||e.environment.lighting.type==="virtual"?(e.environment.applyLighting(this.environment.lighting.clone()),e.environment.lighting.type!=="virtual"&&(e.environment.cachedCameraTrackingEnabled=e.environment.lighting.cameraTrackingEnabled,e.environment.lighting.cameraTrackingEnabled=!1)):this.environment.lighting.displayUTCOffset!=null&&(e.environment.lighting.displayUTCOffset=this.environment.lighting.displayUTCOffset),e.goTo(this.viewpoint,i).then(()=>{this._applyCachedCameraTrackingEnabled(e),e.environment.applyLighting(this.environment.lighting.clone())}).catch(n=>{throw e.animation==null&&this._applyCachedCameraTrackingEnabled(e),n}).finally(()=>{en(r)})}_applyCachedCameraTrackingEnabled(e){e.environment.cachedCameraTrackingEnabled!=null&&(e.environment.lighting.cameraTrackingEnabled=e.environment.cachedCameraTrackingEnabled,e.environment.cachedCameraTrackingEnabled=null)}_getTime(e){return[e.getTime(),3600*e.getUTCHours()+60*e.getUTCMinutes()+e.getUTCSeconds()]}_setTime(e,i,r){return e.setTime(i),e.setUTCHours(r/3600),e.setUTCMinutes(r%3600/60),e.setUTCSeconds(r%3600%60),e}_animateLightingWithCamera(e,i,r){const n=new Date(i.date.toString()),[s,o]=this._getTime(n),[l,c]=this._getTime(r.date),f=Dpt(o,c),_=e.renderCoordsHelper,x=W();_.toRenderCoords(e.camera.position,x);const T=W(),A=W();this.viewpoint.camera!=null&&_.toRenderCoords(this.viewpoint.camera.position,T);const M=new Date;return Mo(()=>e.camera,I=>{_.toRenderCoords(I.position,A);const L=Co(x,A),F=Co(T,A);let z=0;L+F!==0&&(z=L/(L+F));const k=s+(l-s)*z,U=Npt(o,f*z);i.date=this._setTime(M,k,U)})}static createFrom(e,i){return new this().updateFrom(e,i)}};function n4e(t){if(t.type==="building-scene"||t.type==="map-image")return t.allSublayers.toArray()}function S0e(t){const e=n4e(t);if(e)return e.filter(i=>i.visible).map(i=>i.id)}y([w({type:String,json:{write:{isRequired:!0}}})],Nl.prototype,"id",void 0),y([w({type:d$,json:{default:()=>new d$({text:""}),write:{isRequired:!0}}})],Nl.prototype,"title",void 0),y([Ci("title")],Nl.prototype,"castTitle",null),y([w({type:xF,json:{write:{overridePolicy:t=>({enabled:!(!t||!t.text)})}}})],Nl.prototype,"description",void 0),y([Ci("description")],Nl.prototype,"castDescription",null),y([w({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],Nl.prototype,"hidden",void 0),y([w({type:Gv,json:{default:()=>new Gv({url:""}),write:{isRequired:!0}}})],Nl.prototype,"thumbnail",void 0),y([Ci("thumbnail")],Nl.prototype,"castThumbnail",null),y([w({type:ih,nonNullable:!0,json:{write:{isRequired:!0}}})],Nl.prototype,"viewpoint",void 0),y([w({type:Ay,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],Nl.prototype,"basemap",void 0),y([Ci("basemap")],Nl.prototype,"castBasemap",null),y([w({type:r4e,json:{write:!0}})],Nl.prototype,"ground",void 0),y([w({type:uee,json:{write:{isRequired:!0}}})],Nl.prototype,"visibleLayers",null),y([Ci("visibleLayers")],Nl.prototype,"castVisibleLayers",null),y([w({type:MM,json:{write:!0}})],Nl.prototype,"environment",void 0),Nl=y([Z("esri.webscene.Slide")],Nl);const hee=86400,T0e=43200;function Dpt(t,e){let i=e-t;return i>T0e&&(i-=hee),i<-T0e&&(i+=hee),i}function Npt(t,e){return xet(t+e,hee)}const Fpt=Nl,dee=it.ofType(Fpt);let CF=class extends Ue{constructor(e){super(e),this.slides=new dee}destroy(){this.slides.forEach(e=>e.destroy()),this.slides.removeAll()}set slides(e){e&&(e=e.filter(i=>!!i.viewpoint)),this._set("slides",sd(e,this._get("slides"),dee))}clone(){return new this.constructor({slides:this.slides.clone()})}};y([w({type:dee,nonNullable:!0,json:{write:!0}}),Ci(nP)],CF.prototype,"slides",null),CF=y([Z("esri.webscene.Presentation")],CF);const s4e=CF;var pee;let LA=pee=class extends Ue{constructor(t){super(t)}clone(){return new pee({name:this.name,path:this.path,title:this.title})}};y([w({type:String,json:{write:!0}})],LA.prototype,"name",void 0),y([w({type:String,json:{write:!0}})],LA.prototype,"path",void 0),y([w({type:String,json:{write:!0}})],LA.prototype,"title",void 0),LA=pee=y([Z("esri.webscene.TransportationNetwork")],LA);const kpt=LA;let lU=class extends $2{constructor(e,i){super(e,i,"webscene")}get supportsGround(){return this.since(1,8)}get supportsVisibleElevationLayersInSlides(){return this.lessThan(1,8)}},zpt=null;function Upt(){return zpt}var o4e;const mT=new lU(1,32),Vpt=()=>{const e=[],i=mT.major;for(let r=8;r<=mT.minor;r++)e.push(`${i}.${r}`);return e},XH="Web Scene";let bn=class extends jf.LoadableMixin(S9(fP(HRe))){constructor(e){super(e),this[o4e]=!0,this._layersIdGCTimeoutId=void 0,this._updateFromPromise=null,this.applicationProperties=null,this.clippingArea=null,this.clippingEnabled=!1,this.floorInfo=null,this.heightModelInfo=void 0,this.sourceVersion=null,this.transportationNetworks=null,this.presentation=new s4e,this.initialViewProperties=new oU,this.portalItem=null,this.resourceInfo=null,this._debouncedSaveOperations=X5(async(i,r,n)=>{switch(i){case fy.SAVE:return this._saveImpl(r);case fy.SAVE_AS:return this._saveAsImpl(n,r)}}),this._resourceReferences={portalItem:null,paths:[]},this.authoringApp=null,this.authoringAppVersion=null,this._isAuthoringAppSetByUser=!1,this._isAuthoringAppVersionSetByUser=!1}initialize(){if(this.when().catch(e=>{Ce.getLogger(this).error("#load()","Failed to load web scene",e)}),this.resourceInfo){let e;try{e=this._validateJSON(this.resourceInfo)}catch(i){return void this.addResolvingPromise(Promise.reject(i))}this.read(e),this.addResolvingPromise(this._validateSpatialReference()),this.addResolvingPromise(this._validateHeightModelInfo())}this.addHandles(Jr(()=>this.allLayers,"change",()=>this._scheduleLayersIdGC()))}destroy(){this._unscheduleLayersIdGC(),this.presentation&&this.presentation.destroy(),this.portalItem=et(this.portalItem)}writeClippingArea(e,i){i.clippingArea||(i.clippingArea={}),i.clippingArea.geometry=e.toJSON()}readClippingEnabled(e,i){return!!i.clippingArea&&!!i.clippingArea.clip}writeClippingEnabled(e,i){this.clippingArea&&(i.clippingArea||(i.clippingArea={}),i.clippingArea.clip=e)}writeLayers(e,i,r,n){i[r]=this._layersToJSON(e,"operational-layers",n)}readSourceVersion(e,i){const[r,n]=i.version.split(".");return new lU(parseInt(r,10),parseInt(n,10))}writeSourceVersion(e,i,r){i[r]=`${mT.major}.${mT.minor}`}writeTables(e,i,r,n){const s=this._layersToJSON(e,"tables",n);s.length&&(i[r]=s)}get thumbnailUrl(){var e;return((e=this.portalItem)==null?void 0:e.thumbnailUrl)??null}set thumbnailUrl(e){e?this._override("thumbnailUrl",e):(this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}set authoringApp(e){this._isAuthoringAppSetByUser=!0,this._set("authoringApp",e)}writeAuthoringApp(e,i){e&&this._isAuthoringAppSetByUser?i.authoringApp=e:i.authoringApp="ArcGIS API for JavaScript"}set authoringAppVersion(e){this._isAuthoringAppVersionSetByUser=!0,this._set("authoringAppVersion",e)}writeAuthoringAppVersion(e,i){e&&this._isAuthoringAppVersionSetByUser?i.authoringAppVersion=e:i.authoringAppVersion=wEe}writeGround(e,i,r,n){i[r]=e?e.write({},n):{transparency:0,layers:[]}}readInitialViewProperties(e,i){var n,s;const r={};return(n=i.initialState)!=null&&n.environment&&(r.environment=f5.fromJSON(i.initialState.environment)),r.spatialReference=i.spatialReference?at.fromJSON(i.spatialReference):at.WebMercator,r.viewingMode=i.viewingMode??"global",(s=i.initialState)!=null&&s.viewpoint&&(r.viewpoint=ih.fromJSON(i.initialState.viewpoint)),new oU(r)}get spatialReference(){var e;return((e=this.initialViewProperties)==null?void 0:e.spatialReference)??at.WebMercator}get viewingMode(){var e;return((e=this.initialViewProperties)==null?void 0:e.viewingMode)??"global"}load(e){const i=this.ground;return this.addResolvingPromise(this._loadFromSource().then(()=>{i&&i!==this.ground&&i.destroy()})),Promise.resolve(this)}loadAll(){return fj(this,e=>{const i=this.presentation&&this.presentation.slides;e(this.ground,this.basemap,this.layers,i&&i.map(r=>r.basemap),this.tables)})}read(e,i){var s;i={...i,origin:"web-scene"};const r=this._isAuthoringAppVersionSetByUser,n=this._isAuthoringAppSetByUser;if(nEe(this,e,o=>super.read(e,o),i),n||(this._isAuthoringAppSetByUser=!1),r||(this._isAuthoringAppVersionSetByUser=!1),e.baseMap&&Array.isArray(e.baseMap.elevationLayers)&&((s=this.sourceVersion)==null?void 0:s.supportsVisibleElevationLayersInSlides)){const o=e.baseMap.elevationLayers.map(_=>({id:_.id})),l=this.presentation.slides,c=(_,x)=>_.visibleLayers.some(T=>T.id===x),f=o.filter(_=>!l.some(x=>c(x,_.id)));l.forEach(_=>{_.visibleLayers.addMany(f)})}}_writeBasemapElevationLayers(e){var r;const i=(r=e.ground)==null?void 0:r.layers;!e.baseMap&&(i!=null&&i.length)&&(e.baseMap={title:"Basemap",baseMapLayers:[]}),e.baseMap&&(e.baseMap.elevationLayers=Re(i))}_layersToJSON(e,i,r){const n={...r,layerContainerType:i};return e.map(s=>this._verifyWritableLayer(s,r)?s.write({},n):null).filter(s=>!!s).toArray()}_verifyWritableLayer(e,i){return!!e.persistenceEnabled&&("write"in e||(i!=null&&i.messages&&i.messages.push(new se("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted in web scenes`,{layer:e})),!1))}write(e,i){var s;if(this.loadStatus!=="loaded"){const o=new se("webscene:not-loaded","Web scene must be loaded before it can be serialized");throw Ce.getLogger(this).error("#toJSON()","Web scene must be loaded before it can be serialized",this.loadError||this.loadStatus),o}this._runLayersIdGC();const r=!(i!=null&&i.messages);i={messages:[],...i,origin:"web-scene"};const n=super.write(e,i);if(r){const o=((s=i.messages)==null?void 0:s.filter(l=>l.name==="web-document-write:property-required"))??[];if(o.length){const l=new se("web-document:property-required","One or more properties that are required in the webscene JSON are missing, see details for the specific errors",{errors:o});throw Ce.getLogger(this).error("#toJSON()","One or more properties that are required in the webscene JSON are missing",o),l}}return this._writeBasemapElevationLayers(n),n}async save(e){return this._debouncedSaveOperations(fy.SAVE,e)}async _saveImpl(e){var s;if(!this.portalItem)throw new se("webscene:portal-item-not-set","Portal item to save to has not been set on the WebScene");if(Kz(this.portalItem),((s=this.portalItem)==null?void 0:s.type)!==XH)throw new se("webscene:portal-item-wrong-type",`Portal item needs to have type "${XH}"`);const i=this._updateFromPromise;await this._ensureLoadBeforeSave();const r=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:this.portalItem.itemUrl?qs(this.portalItem.itemUrl):null,messages:[],portal:this.portalItem.portal??os.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),n=this.write({},r);return await Promise.all(r.resources.pendingOperations),await this._verifySave(n,r,e),this._updateTypeKeywords(this.portalItem),await Z5e(this.portalItem,n,this._resourceReferences,r,null),Zz(r),i&&await i,await this._saveThumbnail(),this.portalItem}async saveAs(e,i){return this._debouncedSaveOperations(fy.SAVE_AS,i,e)}async _saveAsImpl(e,i){let r=Am.from(e);if(!r)throw new se("webscene:portal-item-required","saveAs requires a portal item to save to");Kz(r),r.id&&(r=r.clone(),r.id=null);const n=r.portal||os.getDefault();await this._ensureLoadBeforeSave(),r.type=XH,r.portal=n;const s=this._enableVerifyItemRelativeUrls({origin:"web-scene",url:null,messages:[],portal:n,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}),o=this.write({},s);await Promise.all(s.resources.pendingOperations),await this._verifySaveAs(o,s,i);const l=this.thumbnailUrl,c=!this._isOverridden("thumbnailUrl");if(this._updateTypeKeywords(r),await n.signIn(),!n.user)throw new se("webscene:user-not-signed-in","saveAs requires a user to be signed in to the portal");return await n.user.addItem({item:r,folder:i==null?void 0:i.folder,data:o}),await X5e(this._resourceReferences,s,null),this.portalItem=r,Yz.prototype.read.call(this,{version:o.version,authoringApp:o.authoringApp,authoringAppVersion:o.authoringAppVersion},{name:"web-scene",ignoreDefaults:!0,url:r.itemUrl?qs(r.itemUrl):void 0}),Zz(s),l&&(this.thumbnailUrl=c?Pne(l,"w","8192"):l),s.portalItem=r,await this._saveThumbnail(),r}async _saveThumbnail(){var e;this._isOverridden("thumbnailUrl")&&(await((e=this.portalItem)==null?void 0:e.updateThumbnail({thumbnail:this.thumbnailUrl})),this._clearOverride("thumbnailUrl"),this.clear("thumbnailUrl","user"))}_verifySave(e,i,r,n=!1){var f;if(!VO(this.spatialReference))return Promise.reject(new se("webscene:unsupported-spatial-reference","Webscenes using spatial reference systems from Mars or Moon can not be saved currently."));let s,o=((f=i.messages)==null?void 0:f.filter(_=>_.type==="error").map(_=>new se(_.name,_.message,_.details)))??[];i.blockedRelativeUrls&&(o=o.concat(i.blockedRelativeUrls.map(_=>new se("url:unsupported",`Relative url '${_}' is not supported in Web Scene`)))),r&&r.ignoreUnsupported&&(o=o.filter(_=>_.name!=="layer:unsupported"&&_.name!=="symbol:unsupported"&&_.name!=="symbol-layer:unsupported"&&_.name!=="property:unsupported"&&_.name!=="url:unsupported"&&_.name!=="scenemodification:unsupported")),r!=null&&r.requiredPropertyChecksDisabled&&(o=o.filter(_=>_.name!=="web-document-write:property-required"));const l=!!(r!=null&&r.strictSchemaValidationEnabled),c=Upt();return s=l&&c?c().then(_=>{const x=_.validate(e);if(x.length>0){const T=`webscene did not validate: +${x.join(` +`)}`;Ce.getLogger(this).error(`${n?"saveAs":"save"}(): ${T}`)}return x.map(T=>new se("webscene:schema-validation",T))}).then(_=>{if(_.length>0)throw apt(_.concat(o));return o}):Promise.resolve(o),s.then(_=>{if(_.length>0)throw new se("webscene:save","Failed to save webscene due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:_})})}_verifySaveAs(e,i,r){return this.canNotSaveAs(i)?Promise.reject(opt()):this._verifySave(e,i,r,!0)}verifySaveAs(e){const i=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),r=this.write({},i);return this._verifySaveAs(r,i,e)}canNotSaveAs(e){var i,r;return e||(e=this._enableVerifyItemRelativeUrls({origin:"web-scene",messages:[]}),this.write({},e)),(((r=(i=e.verifyItemRelativeUrls)==null?void 0:i.writtenUrls)==null?void 0:r.length)??0)>0}async updateFrom(e,i={}){const r=this._updateFrom(e,i);this._updateFromPromise=r,await r,this._updateFromPromise===r&&(this._updateFromPromise=null)}async _updateFrom(e,i={}){if(await e.whenReady(),!i.environmentExcluded&&e.environment&&(this.initialViewProperties.environment=f5.prototype.clone.apply(e.environment)),!i.viewpointExcluded&&e.viewpoint&&(this.initialViewProperties.viewpoint=e.viewpoint.clone()),this.initialViewProperties.spatialReference=e.spatialReference.clone(),this.initialViewProperties.viewingMode=e.viewingMode,e.clippingArea!=null?e.clippingArea!==this.clippingArea&&(this.clippingArea=e.clippingArea.clone(),this.clippingEnabled=!0):this.clippingEnabled=!1,e.heightModelInfo&&(this.heightModelInfo=e.heightModelInfo.clone()),e.map===this)for(const r of e.allLayerViews){const n="visible";n in r&&n in r.layer&&r._isOverridden(n)&&(r.layer[n]=r[n])}(i.thumbnailExcluded===!1||i.thumbnailExcluded==null&&!i.viewpointExcluded)&&await this._updateFromThumbnail(e,i.thumbnailSize??void 0)}async _updateFromThumbnail(e,i){const r=cpt(e,i),n=await e.takeScreenshot({format:"jpg",width:r.width,height:r.height,disableDecorations:!0});this.thumbnailUrl=n.dataUrl}_loadFromSource(){var e;return this.resourceInfo?this._loadFromJSON(this.resourceInfo,{origin:"web-scene"}):(e=this.portalItem)!=null&&e.id?this._loadFromItem(this.portalItem):this._loadObjectsWithLayers()}_readAndLoadFromJSON(e,i){const r=this._validateJSON(e);return this.read(r,i),this._loadFromJSON(r,i)}_extractOperationalLayers(e){var s;const i=[];if(!((s=this.sourceVersion)!=null&&s.supportsGround)&&e.baseMap&&Array.isArray(e.baseMap.elevationLayers))for(const o of e.baseMap.elevationLayers)i.push(o);const r=[],n=o=>{var l;return o.layers&&(o.layers=o.layers.filter(n)),o.layerType!=="ArcGISTiledElevationServiceLayer"||((l=this.sourceVersion)!=null&&l.supportsGround||r.push(o),!1)};return{operationalLayers:e.operationalLayers?e.operationalLayers.filter(n):[],operationalElevationLayers:r,basemapElevationLayers:i}}async _loadFromJSON(e,i){var _;const r=new it;await this._validateSpatialReference(),await this._validateHeightModelInfo();const{populateOperationalLayers:n}=await we(()=>import("./layersCreator-aC1PvuFa.js"),__vite__mapDeps([44,35,36])),{operationalLayers:s,operationalElevationLayers:o,basemapElevationLayers:l}=this._extractOperationalLayers(e),c=[],f={context:{...i,layerContainerType:"operational-layers"}};if(this.portalItem&&(f.context.portal=this.portalItem.portal||os.getDefault()),l.length>0){const x={...f,context:{...f.context,layerContainerType:"ground"}};x.defaultLayerType="ArcGISTiledElevationServiceLayer",c.push(n(this.ground.layers,l,x))}if(o.length>0){const x={...f,context:{...f.context,layerContainerType:"ground"}};x.defaultLayerType="ArcGISTiledElevationServiceLayer",c.push(n(r,o,x))}s&&s.length>0&&c.push(n(this.layers,s,f)),(_=e.tables)!=null&&_.length&&c.push(n(this.tables,e.tables,{...f,context:{...f.context,layerContainerType:"tables"},defaultLayerType:"ArcGISFeatureLayer"})),await Promise.allSettled(c),await this._loadObjectsWithLayers(),this.ground.layers.addMany(r)}async _ensureLoadBeforeSave(){await this.load(),await this._loadObjectsWithLayers();const e=[],i=[...this.allLayers.items];for(const{basemap:r}of this.presentation.slides.items)r&&(i.push(...r.baseLayers.items),i.push(...r.referenceLayers.items));for(const r of i)if("beforeSave"in r&&typeof r.beforeSave=="function"){const n=r.beforeSave();n&&e.push(n)}await Promise.allSettled(e)}async _loadObjectsWithLayers(){const e=[];this.ground&&e.push(this.ground.load()),this.basemap&&e.push(this.basemap.load()),this.presentation.slides.forEach(i=>{i.basemap&&e.push(i.basemap.load())}),await Promise.allSettled(e)}async _loadFromItem(e){if(await e.load().catch(n=>{throw new se("webscene:load-portal-item","Failed to load portal item",{error:n})}),e.type!=="Web Scene")throw new se("webscene:invalid-portal-item","Invalid portal item type '${type}', expected 'Web Scene'",{type:e.type});const i=await e.fetchData();this.resourceInfo=i;const r={origin:"web-scene",url:qs(e.itemUrl),portal:e.portal||os.getDefault(),portalItem:e,readResourcePaths:[]};await this._readAndLoadFromJSON(i,r),this._resourceReferences={portalItem:e,paths:r.readResourcePaths??[]}}_validateSpatialReference(){const e=this.initialViewProperties,i=this._sceneSpatialReference;let r;if(e.viewingMode!=="local"){if(!p5(i,_t.Global))return Promise.reject(new se("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in global mode, only Web Mercator, WGS84 GCS or CGCS2000 are supported",{spatialReference:i,viewingMode:e.viewingMode}));r=c=>!c||th(c,i)}else{if(!p5(i,_t.Local))return Promise.reject(new se("webscene:unsupported-spatial-reference","Unsupported spatial reference (${spatialReference.wkid}) in local mode, only projected coordinate systems are supported",{spatialReference:i,viewingMode:e.viewingMode}));r=c=>!c||c.equals(i)}const n=c=>{var f,_;return((f=c==null?void 0:c.camera)==null?void 0:f.position.spatialReference)??((_=c==null?void 0:c.targetGeometry)==null?void 0:_.spatialReference)},s=e.viewpoint,o=n(s);if(o&&!r(o))return Promise.reject(new se("webscene:incompatible-camera-spatial-reference","Camera spatial reference (${cameraSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{cameraSpatialReference:o,sceneSpatialReference:i,viewingMode:e.viewingMode}));const l=this.presentation.slides.find(c=>!r(n(c.viewpoint)));if(l){const c=n(l.viewpoint);return Promise.reject(new se("webscene:incompatible-slide-spatial-reference","Slide spatial reference (${slideSpatialReference.wkid}) is incompatible with the scene spatial reference (${sceneSpatialReference.wkid})",{slideSpatialReference:c,sceneSpatialReference:i,viewingMode:e.viewingMode}))}return Promise.resolve()}_validateHeightModelInfo(){const e=this._sceneSpatialReference,i=Xdt(this.heightModelInfo,e);return i?Promise.reject(i):Promise.resolve()}_validateJSON(e){const i=lU.parse(e.version||"","webscene");return mT.validate(i),e.version=`${i.major}.${i.minor}`,i.major===1&&i.minor<=2&&(e.spatialReference=at.WebMercator.toJSON()),e}_updateTypeKeywords(e){tfe(e,HK.LOCAL_SCENE,this.initialViewProperties.viewingMode==="local"),tfe(e,HK.DEVELOPER_BASEMAP,s0e(this.basemap)||this.presentation.slides.some(({basemap:i})=>!!i&&s0e(i))),e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((i,r,n)=>n.indexOf(i)===r))}get _sceneSpatialReference(){return this.initialViewProperties.spatialReference||at.WebMercator}get _verifyItemRelativeRootPath(){var e;return(e=this.portalItem)!=null&&e.itemUrl?qs(this.portalItem.itemUrl).path:null}_enableVerifyItemRelativeUrls(e){const i=this._verifyItemRelativeRootPath;return i&&(e.verifyItemRelativeUrls={rootPath:i,writtenUrls:[]}),e}_unscheduleLayersIdGC(){this._layersIdGCTimeoutId&&(clearTimeout(this._layersIdGCTimeoutId),this._layersIdGCTimeoutId=0)}_scheduleLayersIdGC(){this._unscheduleLayersIdGC(),this._layersIdGCTimeoutId=setTimeout(()=>{this._layersIdGCTimeoutId=0,this._runLayersIdGC()},3e3)}_runLayersIdGC(){var n,s;this._unscheduleLayersIdGC();const e=(s=(n=this.applicationProperties)==null?void 0:n.viewing)==null?void 0:s.search,i=o=>this.allLayers.some(l=>l.id===o&&l.persistenceEnabled);e&&e.layers&&(e.layers=e.layers.filter(o=>i(o.id)));const r=this.presentation&&this.presentation.slides;r&&r.forEach(o=>{o.visibleLayers&&(o.visibleLayers=o.visibleLayers.filter(l=>i(l.id)))})}static fromJSON(e){if(!e)throw new se("webscene:empty-resource","Expected a JSON resource but got nothing");return new this({resourceInfo:e})}};o4e=DRe,bn.version=`${mT.major}.${mT.minor}`,y([w({type:gpt,json:{write:!0}})],bn.prototype,"applicationProperties",void 0),y([w({type:Vi,json:{read:{source:"clippingArea.geometry",reader:O2},write:{target:"clippingArea.geometry"}}})],bn.prototype,"clippingArea",void 0),y([Pt("clippingArea")],bn.prototype,"writeClippingArea",null),y([w({type:Boolean,json:{write:{target:"clippingArea.clip"}}})],bn.prototype,"clippingEnabled",void 0),y([$t("clippingEnabled",["clippingArea"])],bn.prototype,"readClippingEnabled",null),y([Pt("clippingEnabled")],bn.prototype,"writeClippingEnabled",null),y([w({type:rpt,json:{read:{source:"mapFloorInfo"},write:{target:"mapFloorInfo"}}})],bn.prototype,"floorInfo",void 0),y([w({type:N_,json:{write:!0}})],bn.prototype,"heightModelInfo",void 0),y([w({json:{write:{target:"operationalLayers",ignoreOrigin:!0}}})],bn.prototype,"layers",void 0),y([Pt("layers")],bn.prototype,"writeLayers",null),y([w({readOnly:!0,type:lU,json:{type:Vpt(),write:{ignoreOrigin:!0,target:"version",isRequired:!0,overridePolicy:()=>({enabled:!0,allowNull:!0,ignoreOrigin:!0})}}})],bn.prototype,"sourceVersion",void 0),y([$t("sourceVersion",["version"])],bn.prototype,"readSourceVersion",null),y([Pt("sourceVersion")],bn.prototype,"writeSourceVersion",null),y([w({json:{read:!1,write:{enabled:!0,ignoreOrigin:!0}}})],bn.prototype,"tables",void 0),y([Pt("tables")],bn.prototype,"writeTables",null),y([w()],bn.prototype,"thumbnailUrl",null),y([w({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],bn.prototype,"authoringApp",null),y([Pt("authoringApp")],bn.prototype,"writeAuthoringApp",null),y([w({type:String,json:{write:{writerEnsuresNonNull:!0,ignoreOrigin:!0}}})],bn.prototype,"authoringAppVersion",null),y([Pt("authoringAppVersion")],bn.prototype,"writeAuthoringAppVersion",null),y([w({json:{write:{isRequired:!0,allowNull:!0,ignoreOrigin:!0,enabled:!0}}})],bn.prototype,"ground",void 0),y([Pt("ground")],bn.prototype,"writeGround",null),y([w({type:it.ofType(kpt),json:{write:!0}})],bn.prototype,"transportationNetworks",void 0),y([w({type:s4e,nonNullable:!0,json:{write:{ignoreOrigin:!0,writer:(t,e,i,r)=>{if(t.slides&&t.slides.length>0){const n={...r,isPresentation:!0};e.presentation=t.write({},n)}}}}})],bn.prototype,"presentation",void 0),y([w({type:oU,nonNullable:!0,json:{write:{target:"initialState",isRequired:!0,ignoreOrigin:!0},default:()=>new oU({viewingMode:"global",spatialReference:at.WebMercator})}})],bn.prototype,"initialViewProperties",void 0),y([$t("initialViewProperties",["initialState.environment","initialState.viewpoint","spatialReference","viewingMode"])],bn.prototype,"readInitialViewProperties",null),y([w({type:at,json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],bn.prototype,"spatialReference",null),y([w({type:["local","global"],json:{read:!1,write:{isRequired:!0,ignoreOrigin:!0}}})],bn.prototype,"viewingMode",null),y([w({type:Am})],bn.prototype,"portalItem",void 0),y([w()],bn.prototype,"resourceInfo",void 0),bn=y([Z("esri.WebScene")],bn);const Bpt=bn;let cU=class{constructor(e=i=>i.values().next().value){this._peeker=e,this._observable=new v9,this._items=new Set}get length(){return wi(this._observable),this._items.size}clear(){this.length!==0&&(this._items.clear(),this._observable.notify())}last(){if(this.length===0)return;let e;for(e of this._items);return e}peek(){if(this.length!==0)return this._peeker(this._items)}push(e){this.contains(e)||(this._items.add(e),this._observable.notify())}contains(e){return wi(this._observable),this._items.has(e)}pop(){if(this.length===0)return;const e=this.peek();return this._items.delete(e),this._observable.notify(),e}popLast(){if(this.length===0)return;const e=this.last();return this._items.delete(e),this._observable.notify(),e}remove(e){this.contains(e)&&(this._items.delete(e),this._observable.notify())}filter(e){const i=this.length;return this._items.forEach(r=>{e(r)||this._items.delete(r)}),i!==this._items.size&&this._observable.notify(),this}*[Symbol.iterator](){wi(this._observable),yield*this._items}};const a4e=new FinalizationRegistry(t=>{t.close()});function jpt(t,e){a4e.register(t,e,e)}function Gpt(t){a4e.unregister(t)}const Hpt={statsWorker:()=>we(()=>import("./statsWorker-HfKfr9Es.js"),__vite__mapDeps([129,94,73])),geometryEngineWorker:()=>we(()=>import("./geometryEngineWorker-yTomxYzK.js"),__vite__mapDeps([130,131,93])),CSVSourceWorker:()=>we(()=>import("./CSVSourceWorker-GlkXsKJn.js"),__vite__mapDeps([132,108,93,88,89,90,91,92,39,40,66,94,73,95,65])),EdgeProcessingWorker:()=>we(()=>import("./EdgeProcessingWorker-V8L8etpG.js"),__vite__mapDeps([])),ElevationSamplerWorker:()=>we(()=>import("./ElevationSamplerWorker-_kiMcA-u.js"),__vite__mapDeps([133,90,91])),FeatureServiceSnappingSourceWorker:()=>we(()=>import("./FeatureServiceSnappingSourceWorker-TBw9rhlL.js"),__vite__mapDeps([134,88,89,90,91,92,39,40,93,66,94,73,95,135,76,77,75,52])),GeoJSONSourceWorker:()=>we(()=>import("./GeoJSONSourceWorker-Sd5A35h-.js"),__vite__mapDeps([136,88,89,90,91,92,39,40,93,66,94,73,95,107,108,65,137])),LercWorker:()=>we(()=>import("./LercWorker-e_UqPfL3.js"),__vite__mapDeps([])),MemorySourceWorker:()=>we(()=>import("./MemorySourceWorker-K3WXTL5J.js"),__vite__mapDeps([138,101,88,89,90,91,92,39,40,93,66,94,73,95,65,137,108])),PBFDecoderWorker:()=>we(()=>import("./PBFDecoderWorker--NqrOA1Y.js"),__vite__mapDeps([139,76,77])),Pipeline:()=>we(()=>import("./Pipeline--6jAENf8.js").then(t=>t.P),__vite__mapDeps([140,92,39,40,93,66,94,73,141,91,142,106,107,108,65,75,76,77,52,143,122,144,145,87])),PointCloudWorker:()=>we(()=>import("./PointCloudWorker-UgniuzRB.js"),__vite__mapDeps([146,147,113])),RasterWorker:()=>we(()=>import("./RasterWorker-0s4_fI9v.js"),__vite__mapDeps([148,72,82,81])),SceneLayerSnappingSourceWorker:()=>we(()=>import("./SceneLayerSnappingSourceWorker-gaKuqg8q.js"),__vite__mapDeps([])),SceneLayerWorker:()=>we(()=>import("./SceneLayerWorker-o7OZRrjZ.js").then(t=>t.S),__vite__mapDeps([149,150])),WFSSourceWorker:()=>we(()=>import("./WFSSourceWorker-iUwpu94Y.js"),__vite__mapDeps([151,88,89,90,91,92,39,40,93,66,94,73,95,107,108,137,124,125])),WorkerTileHandler:()=>we(()=>import("./WorkerTileHandler-9KieSe2P.js"),__vite__mapDeps([152,121,120,122,153,77,154,155]))};var Gl;(function(t){t[t.HANDSHAKE=0]="HANDSHAKE",t[t.OPEN=1]="OPEN",t[t.OPENED=2]="OPENED",t[t.RESPONSE=3]="RESPONSE",t[t.INVOKE=4]="INVOKE",t[t.ABORT=5]="ABORT",t[t.CLOSE=6]="CLOSE",t[t.OPEN_PORT=7]="OPEN_PORT",t[t.ON=8]="ON"})(Gl||(Gl={}));let qpt=0;function l4e(){return qpt++}function Wpt(t){return t&&typeof t=="object"&&("result"in t||"transferList"in t)}function SL(t){return t?typeof t=="string"?JSON.stringify({name:"message",message:t}):t.toJSON?JSON.stringify(t):JSON.stringify({name:t.name,message:t.message,details:t.details||{stack:t.stack}}):null}function Woe(t,e,i,r){if(e.type===Gl.OPEN_PORT)return void t.postMessage(e,[e.port]);if(e.type!==Gl.INVOKE&&e.type!==Gl.RESPONSE)return void t.postMessage(e);let n;if(Wpt(i)?(n=E0e(i.transferList),e.data=i.result):(n=E0e(r),e.data=i),n){if(Le("ff")){for(const s of n)if("byteLength"in s&&s.byteLength>267386880){const o="Worker call with large ArrayBuffer would crash Firefox";switch(e.type){case Gl.INVOKE:throw o;case Gl.RESPONSE:return void Woe(t,{type:Gl.RESPONSE,jobId:e.jobId,error:SL(o)})}}}t.postMessage(e,n)}else t.postMessage(e)}function TL(t){if(!t)return null;const e=t.data;return e?typeof e=="string"?JSON.parse(e):e:null}function E0e(t){if(!(t!=null&&t.length))return null;if(Le("esri-workers-arraybuffer-transfer"))return t;const e=t.filter(i=>!Ypt(i));return e.length?e:null}function Ypt(t){var e;return t instanceof ArrayBuffer||((e=t==null?void 0:t.constructor)==null?void 0:e.name)==="ArrayBuffer"}const{CLOSE:C0e,ABORT:A0e,INVOKE:M0e,RESPONSE:QP,OPEN_PORT:O0e,ON:Xpt}=Gl,Zpt=2;let Jpt=class{constructor(e){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=e,this._timer=null,this._process=this._process.bind(this)}push(e){e.type===Gl.ABORT?this._cancelledJobIds.add(e.jobId):(this._invokeMessages.push(e),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const e of this._invokeMessages)this._cancelledJobIds.has(e.jobId)||this._invoke(e);this._cancelledJobIds.clear(),this._invokeMessages.length=0}},z2=class DA{static connect(e){const i=new MessageChannel;let r;r=typeof e=="function"?new e:"default"in e&&typeof e.default=="function"?new e.default:e;const n=new DA(i.port1,{channel:i,client:r});return typeof r=="object"&&"remoteClient"in r&&(r.remoteClient=n),DA.clients.set(n,r),i.port2}static loadWorker(e){const i=Hpt[e];return i?i():Promise.resolve(null)}constructor(e,i,r){this._port=e,this._jobQueue=r,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new Jpt(n=>this._onInvokeMessage(n)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}close(){this._post({type:C0e}),this._close()}isBusy(){return this._outJobs.size>0}invoke(e,i,r){const n=r==null?void 0:r.signal,s=r==null?void 0:r.transferList;if(!this._port)return Promise.reject(new se("worker:port-closed",`Cannot call invoke('${e}'), port is closed`,{methodName:e,data:i}));const o=l4e();return new Promise((l,c)=>{if(xo(n))return this._processWork(),void c(ur());const f=Yl(n,()=>{const x=this._outJobs.get(o);x&&(this._outJobs.delete(o),this._processWork(),en(x.abortHandle),this._post({type:A0e,jobId:o}),c(ur()))}),_={resolve:l,reject:c,abortHandle:f,debugInfo:e};this._outJobs.set(o,_),this._post({type:M0e,jobId:o,methodName:e,abortable:n!=null},i,s)})}on(e,i){const r=new MessageChannel;function n(s){i(s.data)}return this._port.postMessage({type:Gl.ON,eventType:e,port:r.port2},[r.port2]),r.port1.addEventListener("message",n),r.port1.start(),rr(()=>{r.port1.postMessage({type:Gl.CLOSE}),r.port1.close(),r.port1.removeEventListener("message",n)})}jobAdded(){this._processWork()}openPort(){const e=new MessageChannel;return this._post({type:O0e,port:e.port2}),e.port1}_processWork(){var o;if(this._outJobs.size>=Zpt)return;const e=(o=this._jobQueue)==null?void 0:o.pop();if(!e)return;const{methodName:i,data:r,invokeOptions:n,resolver:s}=e;this.invoke(i,r,n).then(l=>s.resolve(l)).catch(l=>s.reject(l))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(e=>{en(e.abortHandle),e.reject(ur(`Worker closing, aborting job calling '${e.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=null,this._client=null,this._schedule=null}_onMessage(e){this._schedule!=null?this._schedule(()=>this._processMessage(e)):this._processMessage(e)}_processMessage(e){const i=TL(e);if(i)switch(i.type){case QP:this._onResponseMessage(i);break;case M0e:this._invokeQueue.push(i);break;case A0e:this._onAbortMessage(i);break;case C0e:this._onCloseMessage();break;case O0e:this._onOpenPortMessage(i);break;case Xpt:this._onOnMessage(i)}}_onAbortMessage(e){const i=this._inJobs,r=e.jobId,n=i.get(r);this._invokeQueue.push(e),n&&(n.controller&&n.controller.abort(),i.delete(r))}_onCloseMessage(){const e=this._client;this._close(),e&&"destroy"in e&&DA.clients.get(this)===e&&e.destroy(),DA.clients.delete(this),e!=null&&e.remoteClient&&(e.remoteClient=null)}_onInvokeMessage(e){const{methodName:i,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,l=this._inJobs;let c,f=this._client,_=f[i];try{if(!_&&i&&i.includes(".")){const x=i.split(".");for(let T=0;T{l.has(r)&&(l.delete(r),this._post({type:QP,jobId:r},x))},x=>{l.has(r)&&(l.delete(r),sn(x)||this._post({type:QP,jobId:r,error:SL(x||{message:`Error encountered at method ${i}`})}))})):this._post({type:QP,jobId:r},c)}_onOpenPortMessage(e){new DA(e.port,{client:this._client})}_onOnMessage(e){const{port:i}=e,r=this._client.on(e.eventType,s=>{i.postMessage(s)}),n=Y5(e.port,"message",s=>{const o=TL(s);(o==null?void 0:o.type)===Gl.CLOSE&&(n.remove(),r.remove(),i.close())})}_onResponseMessage(e){const{jobId:i,error:r,data:n}=e,s=this._outJobs;if(!s.has(i))return;const o=s.get(i);s.delete(i),this._processWork(),en(o.abortHandle),r?o.reject(se.fromJSON(JSON.parse(r))):o.resolve(n)}_post(e,i,r){return Woe(this._port,e,i,r)}};z2.kernelInfo={buildDate:_Ee,fullVersion:Ine,revision:bEe},z2.clients=new Map;let Kpt=class{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new cU}destroy(){this.close()}get closed(){var e;return!((e=this._clients)!=null&&e.length)}open(e,i){return new Promise((r,n)=>{let s=!0;const o=l=>{St(i.signal),s&&(s=!1,l())};this._clients.length=e.length,this._clientPromises.length=e.length,this._inUseClients.length=e.length;for(let l=0;l(this._clients[l]=new z2(f,i,this._ongoingJobsQueue),o(r),this._clients[l]),()=>(o(n),null)):(this._clients[l]=new z2(c,i,this._ongoingJobsQueue),this._clientPromises[l]=Promise.resolve(this._clients[l]),o(r))}})}broadcast(e,i,r){const n=new Array(this._clientPromises.length);for(let s=0;sl==null?void 0:l.invoke(e,i,r))}return n}close(){let e;for(;e=this._ongoingJobsQueue.pop();)e.resolver.reject(ur(`Worker closing, aborting job calling '${e.methodName}'`));for(const i of this._clientPromises)i.then(r=>r==null?void 0:r.close());this._clients.length=0,this._clientPromises.length=0,this._inUseClients.length=0,Gpt(this)}invoke(e,i,r){let n;Array.isArray(r)?(Ce.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),n={transferList:r}):n=r;const s=Jl();this._ongoingJobsQueue.push({methodName:e,data:i,invokeOptions:n,resolver:s});for(let o=0;oc==null?void 0:c.jobAdded())}return s.promise}on(e,i){return Promise.all(this._clientPromises).then(()=>id(this._clients.map(r=>r.on(e,i))))}openPorts(){return new Promise(e=>{const i=new Array(this._clientPromises.length);let r=i.length;for(let n=0;n{s&&(i[n]=s.openPort()),--r==0&&e(i)})})}get test(){return{numClients:this._clients.length}}};const Qpt={async request(t,e){var o,l;const i=t.options,r=i.responseType;i.signal=e==null?void 0:e.signal,i.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&((o=pEe(t.url))!=null&&o.after)?r:"array-buffer";const n=await bi(t.url,i),s={data:n.data,httpStatus:n.httpStatus,ssl:n.ssl};switch((l=n.requestOptions)==null?void 0:l.responseType){case"native-request-init":return delete s.data.signal,s;case"blob":s.data=await s.data.arrayBuffer();break;case"json":s.data=new TextEncoder().encode(JSON.stringify(s.data)).buffer;break;case"text":s.data=new TextEncoder().encode(s.data).buffer}return{result:s,transferList:[s.data]}}},eft={};function tft(t){var i;const e={async:t.async,isDebug:t.isDebug,locale:t.locale,baseUrl:t.baseUrl,has:{...t.has},map:{...t.map},packages:((i=t.packages)==null?void 0:i.concat())||[],paths:{...t.paths}};return t.hasOwnProperty("async")||(e.async=!0),t.hasOwnProperty("isDebug")||(e.isDebug=!1),t.baseUrl||(e.baseUrl=eft.baseUrl),e}let ift=class{constructor(){const e=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...r)=>e[i](...r)})}},AF=class{constructor(){this._dispatcher=new ift,this._workerPostMessage({type:Gl.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(e){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=e,e&&this.addEventListener("message",e)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(e){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=e,e&&this.addEventListener("messageerror",e)}get onerror(){return this._onerrorHandler}set onerror(e){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=e,e&&this.addEventListener("error",e)}postMessage(e){kO(()=>{this._workerMessageHandler(new MessageEvent("message",{data:e}))})}dispatchEvent(e){return this._dispatcher.dispatchEvent(e)}addEventListener(e,i,r){this._dispatcher.addEventListener(e,i,r)}removeEventListener(e,i,r){this._dispatcher.removeEventListener(e,i,r)}_workerPostMessage(e){kO(()=>{this.dispatchEvent(new MessageEvent("message",{data:e}))})}async _workerMessageHandler(e){const i=TL(e);if(i&&i.type===Gl.OPEN){const{modulePath:r,jobId:n}=i;let s=await z2.loadWorker(r);s||(s=await we(()=>import(r),__vite__mapDeps([])));const o=z2.connect(s);this._workerPostMessage({type:Gl.OPENED,jobId:n,data:o})}}};const fee=Ce.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:rft}=Gl,nft='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,s)=>{if(t){if(t.aborted)return s(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:ABORT,jobId:n}),s(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:s}),self.postMessage({type:INVOKE,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,fullVersion:r}=configuration.kernelInfo,{revision:t,fullVersion:n,version:s}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS Maps SDK for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n??s}\\nAssets path: ${esriConfig.assetsPath}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case OPEN:let n;function t(e){const o=n.connect(e);self.postMessage({type:OPENED,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case RESPONSE:if(outgoing.has(r)){const s=outgoing.get(r);outgoing.delete(r),o.error?s.reject(JSON.parse(o.error)):s.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let TD,ED;const P0e="Failed to create Worker. Fallback to execute module in main thread";async function sft(){if(!Le("esri-workers"))return R0e(new AF);if(!TD&&!ED)try{const e=nft.split('"{CONFIGURATION}"').join(`'${oft()}'`);TD=URL.createObjectURL(new Blob([e],{type:"text/javascript"}))}catch(e){ED=e||{}}let t;if(TD)try{t=new Worker(TD,{name:"esri-worker-"+aft++})}catch{fee.warn(P0e,ED),t=new AF}else fee.warn(P0e,ED),t=new AF;return R0e(t)}async function R0e(t){return new Promise(e=>{function i(n){const s=TL(n);s&&s.type===rft&&(t.removeEventListener("message",i),t.removeEventListener("error",r),e(t))}function r(n){n.preventDefault(),t.removeEventListener("message",i),t.removeEventListener("error",r),fee.warn("Failed to create Worker. Fallback to execute module in main thread",n),(t=new AF).addEventListener("message",i),t.addEventListener("error",r)}t.addEventListener("message",i),t.addEventListener("error",r)})}function oft(){let t;if(Ar.default!=null){const n={...Ar};delete n.default,t=JSON.parse(JSON.stringify(n))}else t=JSON.parse(JSON.stringify(Ar));t.assetsPath=Gh(t.assetsPath),t.defaultAssetsPath=t.defaultAssetsPath?Gh(t.defaultAssetsPath):void 0,t.request.interceptors=[],t.log.interceptors=[],t.locale=fa(),t.has={"esri-csp-restrictions":Le("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":Le("esri-2d-update-debug"),"esri-2d-log-updating":Le("esri-2d-log-updating"),"featurelayer-pbf":Le("featurelayer-pbf"),"featurelayer-simplify-thresholds":Le("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":Le("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":Le("featurelayer-simplify-mobile-factor"),"esri-atomics":Le("esri-atomics"),"esri-shared-array-buffer":Le("esri-shared-array-buffer"),"esri-tiles-debug":Le("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":Le("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":Le("feature-polyline-generalization-factor"),"host-webworker":1},t.workers.loaderUrl&&(t.workers.loaderUrl=Gh(t.workers.loaderUrl)),t.workers.workerPath?t.workers.workerPath=Gh(t.workers.workerPath):t.workers.workerPath=Gh(Wr("esri/core/workers/RemoteClient.js")),t.workers.useDynamicImport=!1;const e=Ar.workers.loaderConfig,i=tft({baseUrl:e==null?void 0:e.baseUrl,locale:fa(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...e==null?void 0:e.has},map:{...e==null?void 0:e.map},paths:{...e==null?void 0:e.paths},packages:(e==null?void 0:e.packages)||[]});return JSON.stringify({esriConfig:t,loaderConfig:i,kernelInfo:{buildDate:_Ee,fullVersion:Ine,revision:bEe}})}let aft=0;const{ABORT:I0e,INVOKE:lft,OPEN:cft,OPENED:uft,RESPONSE:eR}=Gl;let hft=class c4e{static async create(e){const i=await sft();return new c4e(i,e)}constructor(e,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=e,this.id=i,e.addEventListener("message",this._onMessage.bind(this)),e.addEventListener("error",r=>{r.preventDefault(),Ce.getLogger("esri.core.workers.WorkerOwner").error(r)})}terminate(){this.worker.terminate()}async open(e,i={}){const{signal:r}=i,n=l4e();return new Promise((s,o)=>{const l={resolve:s,reject:o,abortHandle:g9(r,()=>{this._outJobs.delete(n),this._post({type:I0e,jobId:n})})};this._outJobs.set(n,l),this._post({type:cft,jobId:n,modulePath:e})})}_onMessage(e){const i=TL(e);if(i)switch(i.type){case uft:this._onOpenedMessage(i);break;case eR:this._onResponseMessage(i);break;case I0e:this._onAbortMessage(i);break;case lft:this._onInvokeMessage(i)}}_onAbortMessage(e){const i=this._inJobs,r=e.jobId,n=i.get(r);n&&(n.controller&&n.controller.abort(),i.delete(r))}_onInvokeMessage(e){const{methodName:i,jobId:r,data:n,abortable:s}=e,o=s?new AbortController:null,l=this._inJobs,c=Qpt[i];let f;try{if(typeof c!="function")throw new TypeError(`${i} is not a function`);f=c.call(null,n,{signal:o?o.signal:null})}catch(_){return void this._post({type:eR,jobId:r,error:SL(_)})}pd(f)?(l.set(r,{controller:o,promise:f}),f.then(_=>{l.has(r)&&(l.delete(r),this._post({type:eR,jobId:r},_))},_=>{l.has(r)&&(l.delete(r),_||(_={message:"Error encountered at method"+i}),sn(_)||this._post({type:eR,jobId:r,error:SL(_||{message:`Error encountered at method ${i}`})}))})):this._post({type:eR,jobId:r},f)}_onOpenedMessage(e){const{jobId:i,data:r}=e,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),en(n.abortHandle),n.resolve(r))}_onResponseMessage(e){const{jobId:i,error:r,data:n}=e,s=this._outJobs.get(i);s&&(this._outJobs.delete(i),en(s.abortHandle),r?s.reject(se.fromJSON(JSON.parse(r))):s.resolve(n))}_post(e,i,r){return Woe(this.worker,e,i,r)}};const $0e=Le("host-browser")?Math.min(navigator.hardwareConcurrency-1,Le("workers-pool-size")):0;let JS=Le("esri-mobile")?Math.min($0e,3):$0e;JS||(JS=Le("safari")&&Le("mac")?7:2);let L0e=0;const MF=[];function dft(){u4e()}async function CD(t,e){const i=new Kpt,{registryTarget:r,...n}=e;return await i.open(t,n),r&&jpt(r,i),i}async function pft(t,e={}){if(typeof t!="string")throw new se("workers:undefined-module","modulePath is missing");let i=e.strategy||"distributed";if(Le("host-webworker")&&!Le("esri-workers")&&(i="local"),i==="local"){let r=await z2.loadWorker(t);r||(r=await we(()=>import(t),__vite__mapDeps([]))),St(e.signal);const n=e.client||r;return CD([z2.connect(r)],{...e,client:n})}if(await u4e(),St(e.signal),i==="dedicated"){const r=L0e++%JS;return CD([await MF[r].open(t,e)],e)}if(e.maxNumWorkers&&e.maxNumWorkers>0){const r=Math.min(e.maxNumWorkers,JS);if(rr.open(t,e)),e)}let AD=null;async function u4e(){if(AD)return AD;new AbortController;const t=[];for(let e=0;e(MF[e]=r,r));t.push(i)}return AD=Promise.all(t),AD}function mj(t,e,i,r){return t!=null&&(Zn(e,r)?(d_(i,t),!0):(sh[0]=t[0],sh[1]=t[1],sh[2]=0,!!vn(sh,e,0,sh,r,0,1)&&(i[0]=sh[0],i[1]=sh[1],sh[0]=t[2],sh[1]=t[3],sh[2]=0,!!vn(sh,e,0,sh,r,0,1)&&(i[2]=sh[0],i[3]=sh[1],!0))))}const sh=W();function ud(t,e,i,r=0){MD[0]=t.x,MD[1]=t.y;const n=t.z;return MD[2]=n!==void 0?n:r,vn(MD,t.spatialReference,0,e,i,0,1)}const MD=W();function jm(t){return t?{origin:Xr(t.origin),vector:Xr(t.vector)}:{origin:W(),vector:W()}}function fft(t,e){const i=gft.get();return i.origin=t,i.vector=e,i}function xei(t,e=jm()){return mft(t.origin,t.vector,e)}function mft(t,e,i=jm()){return Ne(i.origin,t),Ne(i.vector,e),i}function gT(t,e,i=jm()){return Ne(i.origin,t),je(i.vector,e,t),i}function Yoe(t,e){const i=je(xt.get(),e,t.origin),r=Ve(t.vector,i),n=Ve(t.vector,t.vector),s=Je(r/n,0,1),o=je(xt.get(),De(xt.get(),t.vector,s),i);return Ve(o,o)}function Sei(t,e,i){return mee(t,e,0,1,i)}function Tei(t,e,i){return Be(i,t.origin,De(i,t.vector,e))}function mee(t,e,i,r,n){const{vector:s,origin:o}=t,l=je(xt.get(),e,o),c=Ve(s,l)/El(s);return De(n,s,Je(c,i,r)),Be(n,n,t.origin)}function Eei(t,e){if(d4e(t,fft(e.origin,e.direction),!1,uU)){const{tA:i,pB:r,distance2:n}=uU;if(i>=0&&i<=1)return n;if(i<0)return Co(t.origin,r);if(i>1)return Co(Be(xt.get(),t.origin,t.vector),r)}return null}function h4e(t,e,i){return!!d4e(t,e,!0,uU)&&(Ne(i,uU.pA),!0)}function d4e(t,e,i,r){const s=t.origin,o=Be(xt.get(),s,t.vector),l=e.origin,c=Be(xt.get(),l,e.vector),f=xt.get(),_=xt.get();if(f[0]=s[0]-l[0],f[1]=s[1]-l[1],f[2]=s[2]-l[2],_[0]=c[0]-l[0],_[1]=c[1]-l[1],_[2]=c[2]-l[2],Math.abs(_[0])<1e-6&&Math.abs(_[1])<1e-6&&Math.abs(_[2])<1e-6)return!1;const x=xt.get();if(x[0]=o[0]-s[0],x[1]=o[1]-s[1],x[2]=o[2]-s[2],Math.abs(x[0])<1e-6&&Math.abs(x[1])<1e-6&&Math.abs(x[2])<1e-6)return!1;const T=f[0]*_[0]+f[1]*_[1]+f[2]*_[2],A=_[0]*x[0]+_[1]*x[1]+_[2]*x[2],M=f[0]*x[0]+f[1]*x[1]+f[2]*x[2],I=_[0]*_[0]+_[1]*_[1]+_[2]*_[2],L=(x[0]*x[0]+x[1]*x[1]+x[2]*x[2])*I-A*A;if(Math.abs(L)<1e-6)return!1;let F=(T*A-M*I)/L,z=(T+A*F)/I;i&&(F=Je(F,0,1),z=Je(z,0,1));const k=xt.get(),U=xt.get();return k[0]=s[0]+F*x[0],k[1]=s[1]+F*x[1],k[2]=s[2]+F*x[2],U[0]=l[0]+z*_[0],U[1]=l[1]+z*_[1],U[2]=l[2]+z*_[2],r.tA=F,r.tB=z,r.pA=k,r.pB=U,r.distance2=Co(k,U),!0}const uU={tA:0,tB:0,pA:W(),pB:W(),distance2:0},gft=new k_(()=>jm()),ZH=Ce.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");let yft=class{constructor(){this.plane=Fi(),this.origin=W(),this.basis1=W(),this.basis2=W()}};const p4e=yft;function U_(t=T4e){return{plane:Fi(t.plane),origin:Xr(t.origin),basis1:Xr(t.basis1),basis2:Xr(t.basis2)}}function vft(t,e,i){const r=Pft.get();return r.origin=t,r.basis1=e,r.basis2=i,r.plane=Rut(0,0,0,0),gj(r),r}function wE(t,e=U_()){return Xoe(t.origin,t.basis1,t.basis2,e)}function _ft(t,e){Ne(e.origin,t.origin),Ne(e.basis1,t.basis1),Ne(e.basis2,t.basis2),uj(e.plane,t.plane)}function Xoe(t,e,i,r=U_()){return Ne(r.origin,t),Ne(r.basis1,e),Ne(r.basis2,i),gj(r),Mft(r,"fromValues()"),r}function gj(t){xL(t.basis2,t.basis1,t.origin,t.plane)}function f4e(t,e,i){t!==i&&wE(t,i);const r=De(xt.get(),b_(t),e);return Be(i.origin,i.origin,r),i.plane[3]-=e,i}function bft(t,e,i){return m4e(e,i),f4e(i,Qoe(t,t.origin),i),i}function m4e(t,e=U_()){const i=(t[2]-t[0])/2,r=(t[3]-t[1])/2;return Ie(e.origin,t[0]+i,t[1]+r,0),Ie(e.basis1,i,0,0),Ie(e.basis2,0,r,0),Foe(0,0,1,0,e.plane),e}function Zoe(t,e,i){return!!bE(t.plane,e,i)&&x4e(t,i)}function wft(t,e,i){if(Zoe(t,e,i))return i;const r=g4e(t,e,xt.get());return Be(i,e.origin,De(xt.get(),e.direction,Sn(e.origin,r)/rt(e.direction))),i}function g4e(t,e,i){const r=hU.get();S4e(t,e,r,hU.get());let n=Number.POSITIVE_INFINITY;for(const s of tae){const o=eae(t,s,yj.get()),l=xt.get();if(Lut(r,o,l)){const c=R_(xt.get(),e.origin,l),f=Math.abs(Ca(Ve(e.direction,c)));fi&&(i=s)}return Math.sqrt(i)}function Koe(t,e){return zoe(t.plane,e)&&x4e(t,e)}function Tft(t,e,i,r){return Aft(t,i,r)}function Qoe(t,e){const i=-t.plane[3];return y2(b_(t),e)-i}function Eft(t,e,i,r){const n=Qoe(t,e),s=De(Oft,b_(t),i-n);return Be(r,e,s),r}function b4e(t,e){return jr(t.basis1,e.basis1)&&jr(t.basis2,e.basis2)&&jr(t.origin,e.origin)}function w4e(t,e,i){return t!==i&&wE(t,i),Vo(WE,e),ld(WE,WE),bt(i.basis1,t.basis1,WE),bt(i.basis2,t.basis2,WE),bt(i.plane,t.plane,WE),bt(i.origin,t.origin,e),xQ(i.plane,i.plane,i.origin),i}function Cft(t,e,i,r){return t!==r&&wE(t,r),xp(JH,e,i),bt(r.basis1,t.basis1,JH),bt(r.basis2,t.basis2,JH),gj(r),r}function b_(t){return t.plane}function Aft(t,e,i){switch(e){case Ms.X:Ne(i,t.basis1),Ye(i,i);break;case Ms.Y:Ne(i,t.basis2),Ye(i,i);break;case Ms.Z:Ne(i,b_(t))}return i}function x4e(t,e){const i=je(xt.get(),e,t.origin),r=El(t.basis1),n=El(t.basis2),s=Ve(t.basis1,i),o=Ve(t.basis2,i);return-s-r<0&&s-r<0&&-o-n<0&&o-n<0}function D0e(t,e){const i=yj.get();return Ne(i.origin,t.origin),Ne(i.vector,e),i}function eae(t,e,i){const{basis1:r,basis2:n,origin:s}=t,o=De(xt.get(),r,e.origin[0]),l=De(xt.get(),n,e.origin[1]);Be(i.origin,o,l),Be(i.origin,i.origin,s);const c=De(xt.get(),r,e.direction[0]),f=De(xt.get(),n,e.direction[1]);return De(i.vector,Be(c,c,f),2),i}function Mft(t,e){Math.abs(Ve(t.basis1,t.basis2)/(rt(t.basis1)*rt(t.basis2)))>1e-6&&ZH.warn(e,"Provided basis vectors are not perpendicular"),Math.abs(Ve(t.basis1,b_(t)))>1e-6&&ZH.warn(e,"Basis vectors and plane normal are not perpendicular"),Math.abs(-Ve(b_(t),t.origin)-t.plane[3])>1e-6&&ZH.warn(e,"Plane offset is not consistent with plane origin")}function S4e(t,e,i,r){const n=b_(t);xL(n,e.direction,e.origin,i),xL(i,n,e.origin,r)}const T4e={plane:Fi(),origin:nt(0,0,0),basis1:nt(1,0,0),basis2:nt(0,1,0)},hU=new k_(Fi),yj=new k_(jm),Oft=W(),Pft=new k_(()=>U_()),tae=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],WE=Qe(),JH=Qe(),Rft=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:p4e,altitudeAt:Qoe,axisAt:Tft,closestPoint:y4e,closestPointOnSilhouette:g4e,copy:wE,copyWithoutVerify:_ft,create:U_,distance:xft,distance2:Joe,distanceToSilhouette:Sft,elevate:f4e,equals:b4e,extrusionContainsPoint:Koe,fromAABoundingRect:m4e,fromValues:Xoe,intersectRay:Zoe,intersectRayClosestSilhouette:wft,normal:b_,projectPoint:v4e,projectPointLocal:_4e,rotate:Cft,setAltitudeAt:Eft,setExtent:bft,transform:w4e,up:T4e,updateUnboundedPlane:gj,wrap:vft},Symbol.toStringTag,{value:"Module"}));function Ift(t){const{value:e,operations:i}=t;return{operations:i,value:i.create(e)}}function $ft(t,e,i){return t.operations.setExtent(t.value,e,i.value),i}function Lft(t){return{operations:t,value:t.create()}}function E4e(t,e,i=Lft(t)){return i.operations=t,t.copy(e,i.value),i}function Dft(t){return E4e(Aut,tRe(0,0,0,Sr(t).radius))}const N0e=2**50;function Nft(){return E4e(Rft,Xoe([0,0,0],[N0e,0,0],[0,N0e,0]))}function Fft(t,e,i){return t.operations.axisAt(t.value,e,Ms.Z,i)}function kft(t,e,i,r){return t.operations.axisAt(t.value,e,i,r)}function zft(t,e,i){return t.operations.intersectRay(t.value,e,i)}function Uft(t,e,i){return t.operations.intersectRayClosestSilhouette(t.value,e,i)}function Vft(t,e){return t.operations.altitudeAt(t.value,e)}function C4e(t,e,i,r){return t.operations.setAltitudeAt(t.value,e,i,r)}function Bft(t,e,i,r){return e!==r&&Ao(r,e),Ie(YE,r[12],r[13],r[14]),C4e(t,YE,i,YE),r[12]=YE[0],r[13]=YE[1],r[14]=YE[2],r}function KH(t,e,i){return t.operations.elevate(t.value,e,i.value)}const YE=W();function F0e(t,e,i,r,n){return n[0]=Ve(t,e),n[1]=Ve(t,i),n[2]=Ve(t,r),n}function gee(t,e,i,r,n){Ne(i,t),Ne(OD,e),Ye(OD,OD),Wt(r,OD,i),Wt(n,r,i)}function jft(t,e){return t?Zf(e):e.isGeographic?at.PlateCarree:e}const OD=W(),Gft="OBJECTID";let y5=class extends YI{constructor(e){super(e),this.addHandles(this.on("before-add",i=>{i.item!=null&&i.item.parent===this.owner&&(Ce.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),i.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};y5=y([Z("esri.support.AnalysesCollection")],y5);const OF={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,r=this.values;return e<=i.xsmall?r.xsmall:e<=i.small?r.small:e<=i.medium?r.medium:e<=i.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(t){const e=t.viewSize[1],i=t.breakpoints,r=this.values;return e<=i.xsmall?r.xsmall:e<=i.small?r.small:e<=i.medium?r.medium:e<=i.large?r.large:r.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(t){const e=t.viewSize,i=e[0],r=e[1],n=this.values;return r>=i?n.portrait:n.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},QH={xsmall:544,small:768,medium:992,large:1200};function Hft(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=QH}initialize(){this.addHandles(_e(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),ii))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i===this._get("breakpoints"))return;const r=Hft(i);if(!r){const n=JSON.stringify(QH,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n)}i=r?i:QH,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=Uh.acquire(),r=Uh.acquire();let n,s=!1;for(n in OF){const o=this[n],l=OF[n].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==l&&(s=!0,this[n]=l,eq(n,o).forEach(c=>r.push(c)),eq(n,l).forEach(c=>i.push(c)))}s&&(this._applyClassNameChanges(i,r),Uh.release(i),Uh.release(r))}_applyClassNameChanges(i,r){const n=this.container;n&&(r.forEach(s=>n.classList.remove(s)),i.forEach(s=>n.classList.add(s)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let r;for(r in OF)eq(r,this[r]).forEach(n=>i.classList.remove(n))}};return y([w()],e.prototype,"breakpoints",null),y([w()],e.prototype,"orientation",void 0),y([w()],e.prototype,"widthBreakpoint",void 0),y([w()],e.prototype,"heightBreakpoint",void 0),e=y([Z("esri.views.BreakpointsOwner")],e),e};let Rf=class extends ze{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,i,r={}){return this._installWatch(e,i,r,_e)}addWhen(e,i,r={}){return this._installWatch(e,i,r,Mo)}addOnCollectionChange(e,i,{initial:r=!1,final:n=!1}={}){const s=++this._handleId;return this.addHandles([Jr(e,"after-changes",this._createSyncUpdatingCallback(),Li),Jr(e,"change",i,{onListenerAdd:r?o=>i({added:o.toArray(),removed:[]}):void 0,onListenerRemove:n?o=>i({added:[],removed:o.toArray()}):void 0})],s),rr(()=>this.removeHandles(s))}addPromise(e){if(e==null)return e;const i=++this._handleId;this.addHandles(rr(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(PD)||this._set("updating",!1))}),i),this._pendingPromises.add(e),this._set("updating",!0);const r=()=>this.removeHandles(i);return e.then(r,r),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,i,r={},n){const s=++this._handleId;r.sync||this._installSyncUpdatingWatch(e,s);const o=n(e,i,r);return this.addHandles(o,s),rr(()=>this.removeHandles(s))}_installSyncUpdatingWatch(e,i){const r=this._createSyncUpdatingCallback(),n=_e(e,r,{sync:!0,equals:()=>!1});return this.addHandles(n,i),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(PD),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(tx(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(PD))}),PD)}}};y([w({readOnly:!0})],Rf.prototype,"updating",void 0),Rf=y([Z("esri.core.support.UpdatingHandles")],Rf);const PD=-42;let nw=class extends ze{constructor(){super(...arguments),this.items=new it,this._watchUpdatingTracking=new Rf,this._callbacks=new Map,this._projector=pz(),this._hiddenProjector=pz()}get needsRender(){return this.items.length>0}get updating(){var e;return((e=this._watchUpdatingTracking)==null?void 0:e.updating)??!1}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,i=>{for(const r of i.added){const n=()=>r.render();this._callbacks.set(r,n),this._projector.append(this.surface,n)}for(const r of i.removed){const n=this._projector.detach(this._callbacks.get(r));this.surface.removeChild(n.domNode),this._callbacks.delete(r)}})}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach(e=>this._projector.detach(e)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const i=this._hiddenSurface,r=this._hiddenProjector;let n;const s=()=>(n=e.render(),n);r.append(i,s),r.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n!=null&&n.domNode){const l=n.domNode.getBoundingClientRect();o.left=l.left,o.top=l.top,o.right=l.right,o.bottom=l.bottom}for(r.detach(s);i.firstChild;)i.removeChild(i.firstChild);return o}overlaps(e,i){const r=this.computeBoundingRect(e),n=this.computeBoundingRect(i);return Math.max(r.left,n.left)<=Math.min(r.right,n.right)&&Math.max(r.top,n.top)<=Math.min(r.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(e=>e.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(e,i){const r=!!(i!=null&&i.disableDecorations);if(!this.items.some(s=>s.visible&&!(r&&s.isDecoration)))return;const n=e.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{r&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};y([w({readOnly:!0})],nw.prototype,"surface",void 0),y([w({readOnly:!0})],nw.prototype,"items",void 0),y([w({readOnly:!0})],nw.prototype,"needsRender",null),y([w({readOnly:!0})],nw.prototype,"_watchUpdatingTracking",void 0),y([w({readOnly:!0})],nw.prototype,"updating",null),nw=y([Z("esri.views.overlay.ViewOverlay")],nw);const k0e=nw,tq=[0,0];function Wft(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return tq[0]=i.left+((e==null?void 0:e.pageXOffset)??0),tq[1]=i.top+((e==null?void 0:e.pageYOffset)??0),tq}function z0e(t){t&&(CEe(t),t.parentNode&&t.parentNode.removeChild(t))}function Yft(t){const e=document.createElement("div");return t.appendChild(e),e}const tR=16,RD=750,Xft=512,Zft=2,Jft=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:tR,time:RD},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,this.addHandles([_e(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),_e(()=>this.navigating,r=>{const{surface:n}=this;n&&n.setAttribute("data-navigating",r.toString())})])}initialize(){const i=Le("mac"),r=async()=>{i&&(await rd(()=>this.ready),this.messagesCommon=await lE("esri/t9n/common").catch(()=>{}))};r(),this.addHandles([_e(()=>this.ui,(n,s)=>this._handleUIChange(n,s),ii),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused")),oE(r)])}destroy(){this.destroyed||(this.ui=et(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const r=this._get("container"),n=x9(i);if(n||typeof i!="string"||Ce.getLogger(this).error("#container",`element with id '${i}' not found`),r===n)return;if(this._stopMeasuring(),r&&(r.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(z0e(this.root),this._set("root",null)),this.userContent&&(dde(this.userContent,r),z0e(this.userContent),this._set("userContent",null))),!n)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);n.classList.add("esri-view");const s=document.createElement("div");s.className="esri-view-user-storage",dde(n,s),n.appendChild(s),this._set("userContent",s);const o=document.createElement("div");o.className="esri-view-root",n.insertBefore(o,n.firstChild),this._set("root",o);const l=document.createElement("div");l.className="esri-view-surface",l.setAttribute("role","application"),l.tabIndex=0,o.appendChild(l),this._set("surface",l);const c=new k0e;o.appendChild(c.surface),this._set("overlay",c),this.addHandles(_e(()=>c.needsRender,f=>{f&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=AT({render:()=>{var _;return(_=this.overlay)==null?void 0:_.render()}}):this._overlayRenderTaskHandle=en(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",n),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){var i;(i=this.surface)==null||i.blur()}focus(){var i;(i=this.surface)==null||i.focus()}pageToContainer(i,r,n){const s=this.position;return i-=s?s[0]:0,r-=s?s[1]:0,n?(n[0]=i,n[1]=r):n=[i,r],n}containerToPage(i,r,n){const s=this.position;return i+=s?s[0]:0,r+=s?s[1]:0,n?(n[0]=i,n[1]=r):n=[i,r],n}_handleUIChange(i,r){this.removeHandles("ui"),r&&r!==i&&r.destroy(),i&&(i.view=this,this.addHandles(_e(()=>this.root,n=>{i.container=n?Yft(n):null},ii),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=tR,i.time=RD,this.addHandles([Y5(window,"resize",()=>{i.freq=tR,i.time=RD}),AT({prepare:r=>{const n=this._measure(),s=this._freqInfo;if(s.time+=r.deltaTime,n&&(s.freq=tR,this._get("resizing")||this._set("resizing",!0)),s.time=Xft&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,r=i?i.clientWidth:0,n=i?i.clientHeight:0;if(r===0||n===0)return this.suspended||this._set("suspended",!0),!1;const s=this.width,o=this.height;return r===s&&n===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",r),this._set("height",n),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:s,oldHeight:o,width:r,height:n}),!0)}_position(){const i=this.container,r=this.position,n=i&&Wft(i);return!!n&&(!r||n[0]!==r[0]||n[1]!==r[1])&&(this._set("position",[n[0],n[1]]),!0)}forceDOMReadyCycle(){}};return y([w()],e.prototype,"container",null),y([w({readOnly:!0})],e.prototype,"focused",null),y([w({readOnly:!0})],e.prototype,"height",void 0),y([w()],e.prototype,"messagesCommon",void 0),y([w({type:k0e})],e.prototype,"overlay",void 0),y([w({readOnly:!0})],e.prototype,"position",void 0),y([w({readOnly:!0})],e.prototype,"resizing",void 0),y([w({readOnly:!0})],e.prototype,"root",void 0),y([w({value:null,readOnly:!0})],e.prototype,"size",null),y([w({readOnly:!0})],e.prototype,"surface",void 0),y([w({readOnly:!0})],e.prototype,"suspended",void 0),y([w()],e.prototype,"ui",void 0),y([w({readOnly:!0})],e.prototype,"userContent",void 0),y([w({readOnly:!0})],e.prototype,"width",void 0),y([w()],e.prototype,"widthBreakpoint",void 0),e=y([Z("esri.views.DOMContainer")],e),e};function Xu(t,e,i,r){return{x:t,y:e,z:i,hasZ:i!=null,hasM:!1,spatialReference:r,type:"point"}}async function dU(t,e,i,r,n){r??(r=0);const s=t.spatialReference;if(th(s,i)||s==null||i==null||Zn(s,i))return ID[0]=t.x,ID[1]=t.y,ID[2]=t.z??r,void vn(ID,t.spatialReference,0,e,i,0,1);const o=Xu(t.x,t.y,t.z??r,s),l=await qy(o,i,n);e[0]=l.x,e[1]=l.y,e[2]=l.z??0}const ID=W();function w_(t,e,i){if(e==null||i==null)return null;const r=new mt({spatialReference:i});return vn(t,e,0,$D,i,0,1)?(r.x=$D[0],r.y=$D[1],r.z=$D[2],r):null}const $D=W();async function A4e(t,e,i,r){const n=w_(t,e,i);if(n!=null)return n;const s=new mt({x:t[0],y:t[1],z:t[2],spatialReference:e,hasZ:!0});return qy(s,i,r)}var ms,tl;(function(t){t[t.OBJECT=0]="OBJECT",t[t.HUD=1]="HUD",t[t.TERRAIN=2]="TERRAIN",t[t.OVERLAY=3]="OVERLAY",t[t.I3S=4]="I3S",t[t.PCL=5]="PCL",t[t.LOD=6]="LOD",t[t.VOXEL=7]="VOXEL"})(ms||(ms={}));let Kft=class{constructor(){this.verticalOffset=0,this.selectionMode=!1,this.hud=!0,this.selectOpaqueTerrainOnly=!0,this.invisibleTerrain=!1,this.backfacesTerrain=!0,this.isFiltered=!1,this.filteredLayerUids=[],this.store=tl.ALL}};(function(t){t[t.MIN=0]="MIN",t[t.MINMAX=1]="MINMAX",t[t.ALL=2]="ALL"})(tl||(tl={}));let Qft=class{constructor(e,i,r){this.object=e,this.geometryId=i,this.triangleNr=r}},e0t=class extends Qft{constructor(e,i,r,n){super(e,i,r),this.center=n!=null?Xr(n):null}},M4e=class{constructor(e){this.layerUid=e}},vj=class extends M4e{constructor(e,i){super(e),this.graphicUid=i}};function Gm(t){return(t==null?void 0:t.dist)!=null}function U0e(t){return(e,i,r)=>(Qr(V0e,e,i,r),!Koe(t,V0e))}function _j(t){return Gm(t)&&t.intersector===ms.OBJECT&&!!t.target}function bj(t){return Gm(t)&&t.intersector===ms.HUD&&!!t.target&&"center"in t.target&&t.target.center!=null}const V0e=W();let t0t=class{constructor(){this._transform=Qe(),this._transformInverse=new LD({value:this._transform},Vo,Qe),this._transformInverseTranspose=new LD(this._transformInverse,ld,Qe),this._transformTranspose=new LD({value:this._transform},ld,Qe),this._transformInverseRotation=new LD({value:this._transform},SPe,as)}_invalidateLazyTransforms(){this._transformInverse.invalidate(),this._transformInverseTranspose.invalidate(),this._transformTranspose.invalidate(),this._transformInverseRotation.invalidate()}get transform(){return this._transform}get inverse(){return this._transformInverse.value}get inverseTranspose(){return this._transformInverseTranspose.value}get inverseRotation(){return this._transformInverseRotation.value}get transpose(){return this._transformTranspose.value}setTransformMatrix(e){Ao(this._transform,e)}multiplyTransform(e){nn(this._transform,this._transform,e)}set(e){Ao(this._transform,e),this._invalidateLazyTransforms()}setAndInvalidateLazyTransforms(e,i){this.setTransformMatrix(e),this.multiplyTransform(i),this._invalidateLazyTransforms()}},LD=class{constructor(e,i,r){this._original=e,this._update=i,this._dirty=!0,this._transform=r()}invalidate(){this._dirty=!0}get value(){return this._dirty&&(this._update(this._transform,this._original.value),this._dirty=!1),this._transform}},i0t=class{constructor(e=0){this.offset=e,this.tmpVertex=W()}applyToVertex(e,i,r){const n=Ie(pU,e,i,r),s=Be(vee,n,this.localOrigin),o=this.offset/rt(s);return ao(this.tmpVertex,n,s,o),this.tmpVertex}applyToAabb(e){const i=O4e,r=P4e,n=R4e;for(let c=0;c<3;++c)i[c]=e[0+c]+this.localOrigin[c],r[c]=e[3+c]+this.localOrigin[c],n[c]=i[c];const s=this.applyToVertex(i[0],i[1],i[2]);for(let c=0;c<3;++c)e[c]=s[c],e[c+3]=s[c];const o=c=>{const f=this.applyToVertex(c[0],c[1],c[2]);for(let _=0;_<3;++_)e[_]=Math.min(e[_],f[_]),e[_+3]=Math.max(e[_+3],f[_])};for(let c=1;c<8;++c){for(let f=0;f<3;++f)n[f]=c&1<0?this._totalOffset:0,e[4]+=r[1]>0?this._totalOffset:0,e[5]+=r[2]>0?this._totalOffset:0,e;const _=fAe(H0e,o,l),x=rt(_),T=this._totalOffset/x,A=this._totalOffset/f;return e[0]+=i[0]*(i[0]>0?T:A),e[1]+=i[1]*(i[1]>0?T:A),e[2]+=i[2]*(i[2]>0?T:A),e[3]+=r[0]*(r[0]<0?T:A),e[4]+=r[1]*(r[1]<0?T:A),e[5]+=r[2]*(r[2]<0?T:A),e}applyToMbs(e){const i=rt(e),r=this._totalOffset/i;return ao(this._mbs,e,e,r),this._mbs[3]=e[3]+e[3]*this._totalOffset/i,this._mbs}applyToObb(e){return yRe(e,this._totalOffset,this._totalOffset,_t.Global,this._obb),this._obb}},n0t=class{constructor(e=0){this.offset=e,this.sphere=co(),this.tmpVertex=W()}applyToVertex(e,i,r){const n=this.objectTransform.transform,s=Ie(pU,e,i,r),o=bt(s,s,n),l=this.offset/rt(o);ao(o,o,o,l);const c=this.objectTransform.inverse;return bt(this.tmpVertex,o,c),this.tmpVertex}applyToMinMax(e,i){const r=this.offset/rt(e);ao(e,e,e,r);const n=this.offset/rt(i);ao(i,i,i,n)}applyToAabb(e){const i=this.offset/Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]+=e[0]*i,e[1]+=e[1]*i,e[2]+=e[2]*i;const r=this.offset/Math.sqrt(e[3]*e[3]+e[4]*e[4]+e[5]*e[5]);return e[3]+=e[3]*r,e[4]+=e[4]*r,e[5]+=e[5]*r,e}applyToBoundingSphere(e){const i=rt(e),r=this.offset/i;return ao(this.sphere,e,e,r),this.sphere[3]=e[3]+e[3]*this.offset/i,this.sphere}};const B0e=new n0t;function yee(t){return t!=null?(B0e.offset=t,B0e):null}const j0e=new r0t;function s0t(t){return t!=null?(j0e.offset=t,j0e):null}const G0e=new i0t;function o0t(t){return t!=null?(G0e.offset=t,G0e):null}const Gw="terrain",pU=W(),vee=W(),O4e=W(),P4e=W(),R4e=W(),a0t=W(),H0e=W(),v5=1e-5;let l0t=class{constructor(e){this.options=new Kft,this._results=new c0t,this.transform=new t0t,this.tolerance=v5,this.verticalOffset=null,this._ray=Ko(),this._rayEnd=W(),this._rayBeginTransformed=W(),this._rayEndTransformed=W(),this.viewingMode=e??_t.Global}get results(){return this._results}get ray(){return this._ray}get rayBegin(){return this._ray.origin}get rayEnd(){return this._rayEnd}reset(e,i,r){this.resetWithRay(Doe(e,i,this._ray),r)}resetWithRay(e,i){this.camera=i,e!==this._ray&&iU(e,this._ray),this.options.verticalOffset!==0?this.viewingMode===_t.Local?this._ray.origin[2]-=this.options.verticalOffset:this.verticalOffset=this.options.verticalOffset:this.verticalOffset=null,Be(this._rayEnd,this._ray.origin,this._ray.direction),this._results.init(this._ray)}intersect(e=null,i,r,n,s){var l;this.point=i,this.filterPredicate=n,this.tolerance=r??v5;const o=yee(this.verticalOffset);if(e&&e.length>0){const c=s?f=>{s(f)&&this.intersectObject(f)}:f=>{this.intersectObject(f)};for(const f of e){const _=(l=f.getSpatialQueryAccelerator)==null?void 0:l.call(f);_!=null?(o!=null?_.forEachAlongRayWithVerticalOffset(this._ray.origin,this._ray.direction,c,o):_.forEachAlongRay(this._ray.origin,this._ray.direction,c),this.options.selectionMode&&this.options.hud&&_.forEachDegenerateObject(c)):f.objects.forAll(x=>c(x))}}this.sortResults()}intersectObject(e){const i=e.geometries;if(!i)return;const r=e.effectiveTransformation,n=yee(this.verticalOffset);for(const s of i){if(!s.visible)continue;const{material:o,id:l}=s;this.transform.setAndInvalidateLazyTransforms(r,s.transformation),bt(this._rayBeginTransformed,this.rayBegin,this.transform.inverse),bt(this._rayEndTransformed,this.rayEnd,this.transform.inverse);const c=this.transform.transform;n!=null&&(n.objectTransform=this.transform),o.intersect(s,this.transform.transform,this,this._rayBeginTransformed,this._rayEndTransformed,(f,_,x,T,A,M)=>{if(f>=0){if(this.filterPredicate!=null&&!this.filterPredicate(this._ray.origin,this._rayEnd,f))return;const I=T?this._results.hud:this._results,L=T?F=>{const z=new e0t(e,l,x,M);F.set(ms.HUD,z,f,_,gs,A)}:F=>F.set(ms.OBJECT,{object:e,geometryId:l,triangleNr:x},f,_,c,A);if((I.min.drapedLayerOrder==null||A>=I.min.drapedLayerOrder)&&(I.min.dist==null||fI.max.dist)&&L(I.max),this.options.store===tl.ALL)if(T){const F=new _ee(this._ray);L(F),this._results.hud.all.push(F)}else{const F=new dO(this._ray);L(F),this._results.all.push(F)}}})}}sortResults(e=this._results.all){e.sort((i,r)=>i.dist!==r.dist?(i.dist??0)-(r.dist??0):i.drapedLayerOrder!==r.drapedLayerOrder?(i.drapedLayerOrder??Number.MAX_VALUE)-(r.drapedLayerOrder??Number.MAX_VALUE):(r.drapedLayerGraphicOrder??Number.MIN_VALUE)-(i.drapedLayerGraphicOrder??Number.MIN_VALUE))}};function Tp(t){return new l0t(t)}let c0t=class{constructor(){this.min=new dO(Ko()),this.max=new dO(Ko()),this.hud={min:new _ee(Ko()),max:new _ee(Ko()),all:new Array},this.ground=new dO(Ko()),this.all=[]}init(e){this.min.init(e),this.max.init(e),this.ground.init(e),this.all.length=0,this.hud.min.init(e),this.hud.max.init(e),this.hud.all.length=0}},dO=class{get ray(){return this._ray}get distanceInRenderSpace(){return this.dist!=null?(De(DD,this.ray.direction,this.dist),rt(DD)):null}getIntersectionPoint(e){return!!Gm(this)&&(De(DD,this.ray.direction,this.dist),Be(e,this.ray.origin,DD),!0)}getTransformedNormal(e){return Ne(iR,this.normal),iR[3]=0,lp(iR,iR,this.transformation),Ne(e,iR),Ye(e,e)}constructor(e){this.intersector=ms.OBJECT,this.normal=W(),this.transformation=Qe(),this._ray=Ko(),this.init(e)}init(e){this.dist=null,this.target=null,this.drapedLayerOrder=null,this.drapedLayerGraphicOrder=null,this.intersector=ms.OBJECT,iU(e,this._ray)}set(e,i,r,n,s,o,l){this.intersector=e,this.dist=r,Ne(this.normal,n??fB),Ao(this.transformation,s??gs),this.target=i,this.drapedLayerOrder=o,this.drapedLayerGraphicOrder=l}copy(e){iU(e.ray,this._ray),this.intersector=e.intersector,this.dist=e.dist,this.target=e.target,this.drapedLayerOrder=e.drapedLayerOrder,this.drapedLayerGraphicOrder=e.drapedLayerGraphicOrder,Ne(this.normal,e.normal),Ao(this.transformation,e.transformation)}},_ee=class extends dO{constructor(){super(...arguments),this.intersector=ms.HUD}};function iae(t){return new dO(t)}const DD=W(),iR=Xi();function I4e(t,e,i,r){return t.renderCoordsHelper.fromRenderCoords(e.eye,fU,r)!=null&&CAe(i,fU)}function wj(t,e){return t.elevationProvider?t.elevationProvider.getElevation(e[0],e[1],e[2],t.renderCoordsHelper.spatialReference,"ground")??0:0}function xE(t,e,i,r){const n=t.state.camera.clone();e&&i&&r&&(n.eye=e,n.center=i,n.up=r),u0t(t,n.ray,db)||Ne(db,n.center);const s=t.state.constraints,o=s.minimumPoiDistance;if(Co(n.eye,db)o}function u0t(t,e,i){let r=W0e[t.viewingMode];r||(r=Tp(t.state.viewingMode),r.options.backfacesTerrain=!t.state.isGlobal,r.options.invisibleTerrain=!0,W0e[t.viewingMode]=r);const{isGlobal:n}=t.state;return!(!t.sceneIntersectionHelper.intersectRay(e,r,i)||q0e(t,e.origin,i))||!(!t.renderCoordsHelper.intersectManifold(e,0,i)||q0e(t,e.origin,i))||!!n&&h0t(e,i,Sr(t.spatialReference).radius)}function h0t(t,e,i){const r=Ve(t.origin,t.origin)-i*i,n=r>0?Math.sqrt(r)/3:1;return De(e,t.direction,n/rt(t.direction)),Be(e,e,t.origin),!0}const W0e={},fU=W(),db=W(),xx=W(),d0t={near:0,far:0},p0t=W(),ND=W();function rae(){return{direction:W(),up:W()}}function $4e(t,e,i,r,n){let s=Ye(p0t,t),o=Ve(s,r);const l=o>0;o=Math.abs(o),o>.99&&(o=Math.abs(Ve(e,r)),o<.99?(Ne(s,e),l&&De(s,s,-1)):s=null);let c=0;if(s){De(ND,r,Ve(r,s)),je(s,s,ND);const _=Ve(s,n)/(rt(s)*rt(n));Wt(ND,s,n),c=(Ve(ND,r)>0?1:-1)*pu(Ca(_))}const f=pu(Ca(-Ve(r,t)/rt(t)));return i?(i.heading=c,i.tilt=f,i):{heading:c,tilt:f}}const L4e=nt(0,1,0),D4e=nt(0,0,1),rR=Qe(),_1=W(),b1=W();function N4e(t,e,i,r=rae()){const{direction:n,up:s}=r;return WAe(rR,-Ei(e)),WO(rR,rR,Ei(i)),bt(n,D4e,rR),De(n,n,-1),bt(s,L4e,rR),r}function f0t(t,e,i,r){return $4e(e,i,r,D4e,L4e)}function m0t(t,e,i,r){const n=N4e(t,i,r),s=W();return De(s,n.direction,-e),Be(s,s,t),{up:n.up,eye:s,heading:i,tilt:r}}function g0t(t){return pu(t)}function y0t(t){return Ei(t)}function F4e(t,e,i,r,n){const s=t.renderSpatialReference,o=t.map&&t.spatialReference||e.spatialReference;return ud(e,_1,s),ud(e,b1,s),_1[0]-=i/2,b1[0]+=i/2,_1[1]-=r/2,b1[1]+=r/2,el(_1,s,_1,o),el(b1,s,b1,o),n?(n.xmin=_1[0],n.ymin=_1[1],n.xmax=b1[0],n.ymax=b1[1],n.spatialReference=o):n=new Vi(_1[0],_1[1],b1[0],b1[1],o),n}const v0t=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:f0t,eyeForCenterWithHeadingTilt:m0t,eyeTiltToLookAtTilt:y0t,headingTiltToDirectionUp:N4e,lookAtTiltToEyeTilt:g0t,toExtent:F4e},Symbol.toStringTag,{value:"Module"}));function Y0e(t,e,i){if(e.longitude==null||e.latitude==null||i.longitude==null||i.latitude==null)throw new Error("Invalid points: no lon/lat");return _0t(t,e.longitude,e.latitude,i.longitude,i.latitude)}function _0t(t,e,i,r,n){const s=Ei(i),o=Ei(n),l=s-o,c=Ei(e)-Ei(r),f=Math.sin(l/2),_=Math.sin(c/2),x=2*Gf(Math.sqrt(f*f+Math.cos(s)*Math.cos(o)*_*_))*t;return Math.round(1e4*x)/1e4}function b0t(t,e,i){const r=e.spatialReference,n=Sr(r),s=new mt(e.x,t.y,r),o=new mt(i.x,t.y,r),l=new mt(t.x,e.y,r),c=new mt(t.x,i.y,r);return{lon:Y0e(n.radius,s,o),lat:Y0e(n.radius,l,c)}}function w0t(t,e,i){const r=e/i,n=Ei(t),s=Math.sin(r/2),o=Math.cos(n),l=2*Gf(Math.sqrt(s*s/(o*o)));return pu(l)}function k4e(t,e){let i=t/15;return e||(i=Math.round(i)),i}function bee(t,e){const i=t==null?void 0:t[0];if(i==null)return null;e||(e={hours:0,minutes:0,seconds:0}),e.hours=k4e(i,!0);const r=e.hours%1;e.hours-=r,e.minutes=60*r;const n=e.minutes%1;return e.minutes-=n,e.seconds=Math.round(60*n),e}const z4e=nt(0,0,1),U4e=Ye(W(),nt(1,1,1)),x0t=new F2(-180,180),nR=Qe(),Lw=W(),XE=W();function V4e(t,e,i,r=rae()){Wt(Lw,t,z4e),Ve(Lw,Lw)===0&&Wt(Lw,t,U4e),xp(nR,-Ei(e),t),Wh(nR,nR,-Ei(i),Lw);const{up:n,direction:s}=r;return Wt(n,Lw,t),Ye(n,n),bt(n,n,nR),Ye(s,t),Sc(s,s),bt(s,s,nR),r}function S0t(t,e,i,r){const n=Lw,s=XE;return Ye(n,t),Wt(XE,n,z4e),Ve(XE,XE)===0&&Wt(XE,n,U4e),Wt(s,XE,n),$4e(e,i,r,n,s)}function T0t(t,e,i,r){const n={eye:W(),up:null,tilt:r,heading:i},s=Lw;s[0]=t[0],s[1]=t[2],s[2]=-t[1];const o=e,l=Ei(i),c=Ei(r),f=Math.sin(l),_=Math.cos(l),x=Math.sin(c),T=Math.cos(c),A=rt(s);let M;if(Math.abs(c)<1e-8)M=o+A;else{const Ee=A/x,te=Gf(o/Ee),le=Math.PI-c-te;M=Ee*Math.sin(le)}const I=T*o,L=o*o*(x*x),F=_*_*L,z=M-I,k=z*z,U=F*(F+k-s[1]*s[1]);if(U<0)return De(n.eye,s,M/A),n.tilt=0,FD(n,t);const j=Math.sqrt(U),H=s[1]*z,Y=F+k;let Q;if(Q=_>0?-j+H:j+H,Math.abs(Y)<1e-8)return A<1e-8?(n.eye[0]=0,n.eye[1]=0,n.eye[2]=o):De(n.eye,s,M/A),n.tilt=0,iq(n.eye),FD(n,t);n.eye[1]=Q/Y;const ne=f*f*L,re=x*o,he=_*re*n.eye[1],ce=n.eye[1]*n.eye[1],be=1-ce,ye=Math.sqrt(be),pe=F*ce+ne-2*he*ye*z+be*k;return Math.abs(pe)<1e-8?(De(n.eye,s,M/A),n.tilt=0,iq(n.eye),FD(n,t)):(n.eye[0]=(be*(M*s[0]-I*s[0])-re*ye*(s[0]*n.eye[1]*_+s[2]*f))/pe,n.eye[2]=(be*(M*s[2]-I*s[2])-re*ye*(s[2]*n.eye[1]*_-s[0]*f))/pe,De(n.eye,n.eye,M),iq(n.eye),FD(n,t))}function iq(t){const e=t[1];t[1]=-t[2],t[2]=e}function FD(t,e){const i=V4e(e,t.heading,t.tilt);return t.up=i.up,t}function E0t(t,e,i){const r=rt(e),n=Math.sqrt(i*i+r*r-2*i*r*Math.cos(Math.PI-t)),s=Gf(i/(n/Math.sin(t)));return pu(t-s)}function C0t(t,e,i){const r=Ei(t),n=rt(e);return Gf(i/(n/Math.sin(r)))+r}function B4e(t,e,i,r,n){let s,o,l,c;const f=e.latitude,_=Sr(t.spatialReference).radius,x=e.longitude,T=w0t(f,i,_)/2;s=x-T,o=x+T;const A=Ei(f),M=(1+Math.sin(A))/(1-Math.sin(A)),I=(M+1)*Math.tan(r/_/2),L=I*I;function F(k){const U=Math.PI/2;return(k=Ydt.normalize(k,-U))>U&&(k=Math.PI-k),k}if(l=1.5*Math.PI-2*Math.atan(.5*(I+Math.sqrt(4*M+L))),c=l+r/_,l=F(l),c=F(c),c180){const k=(o-s-180)/2;s+=k,o-=k}const z=t.spatialReference&&t.spatialReference.isGeographic?t.spatialReference:at.WGS84;return n?(n.xmin=s,n.ymin=l,n.xmax=o,n.ymax=c,n.spatialReference=z):n=new Vi(s,l,o,c,z),t.spatialReference&&t.spatialReference.isWebMercator&&Ty(n,!1,n),n}const A0t=Object.freeze(Object.defineProperty({__proto__:null,directionToHeadingTilt:S0t,eyeForCenterWithHeadingTilt:T0t,eyeTiltToLookAtTilt:C0t,headingTiltToDirectionUp:V4e,lookAtTiltToEyeTilt:E0t,toExtent:B4e},Symbol.toStringTag,{value:"Module"}));function mU(t){return t.type==="point"}let nae=class{constructor(e,i=null,r=0){this.array=e,this.spatialReference=i,this.offset=r}};function j4e(t){return"array"in t}function my(t,e,i="ground"){if(mU(e))return t.getElevation(e.x,e.y,e.z||0,e.spatialReference,i);if(j4e(e)){let r=e.offset;return t.getElevation(e.array[r++],e.array[r++],e.array[r]||0,e.spatialReference??t.spatialReference,i)}return t.getElevation(e[0],e[1],e[2]||0,t.spatialReference,i)}const G4e=Ce.getLogger("esri.views.3d.support.cameraUtils"),H4e=39.37,q4e=96,wee=1,M0t=8,O0t=5,W4e=1,X0e=W(),P0t={heading:0,tilt:0},p$=W(),R0t=new F2(-20037508342788905e-9,20037508342788905e-9),I0t=new F2(-180,180);var ql;function V_(t){return t.spatialReference??at.WGS84}function vP(t){return t.viewingMode==="global"?A0t:v0t}function $0t(t,e,i,r,n){return vP(t).headingTiltToDirectionUp(e,i,r,n)}function Tv(t,e){if(e==null)return null;const i=t.renderSpatialReference,r=vP(t).headingTiltToDirectionUp,n=W();if(!ud(e.position,n,i))return null;const s=r(n,e.heading,e.tilt);De(s.direction,s.direction,t.state.camera.distance),Be(s.direction,s.direction,n);const o=xE(t,n,s.direction,s.up);return o.fov=Ei(e.fov),o}(function(t){t[t.LOCKED=0]="LOCKED",t[t.ADJUST=1]="ADJUST"})(ql||(ql={}));const ZE=W();function _5(t,e,i){const r=t.renderSpatialReference,n=Sj(t,e.eye,e.viewForward,e.up,P0t);let s=V_(t);return el(e.eye,r,ZE,s)||(s=at.WGS84,el(e.eye,r,ZE,s)),i==null?new cd(new mt(ZE,s),n.heading,n.tilt,pu(e.fov)):(i.position.x=ZE[0],i.position.y=ZE[1],i.position.z=ZE[2],i.position.spatialReference=s,i.heading=n.heading,i.tilt=n.tilt,i.fov=pu(e.fov),i)}function xj(t,e,i){const r=t.state.camera,n=r.width/2/r.pixelRatio;return t.renderCoordsHelper.viewingMode===_t.Global&&i!=null&&(e*=Math.cos(Ei(i))),e/=t.renderCoordsHelper.unitInMeters,n/(q4e*H4e/e)/Math.tan(r.fovX/2)}function qT(t,e,i){const r=t.state.camera,n=e*Math.tan(r.fovX/2),s=r.width/2/r.pixelRatio;let o=q4e*H4e/(s/n);return t.renderCoordsHelper.viewingMode===_t.Global&&i!=null&&(o/=Math.cos(Ei(i))),o*t.renderCoordsHelper.unitInMeters}async function Y4e(t,e,i,r,n,s){return X4e(t,e,xj(t,i,e.latitude),r,n,s)}function L0t(t,e,i,r,n,s){return cIe(t,sae(t,r.heading,r.tilt,e,i,n),r.fov,s)}async function X4e(t,e,i,r,n,s){const o=await J4e(t,r.heading,r.tilt,e,i,n,s);return St(s),uIe(t,o,r.fov,s)}function Sj(t,e,i,r,n){return vP(t).directionToHeadingTilt(e,i,r,n)}function Z4e(t,e){return!!(t.basemapTerrain&&t.renderCoordsHelper.fromRenderCoords(e,p$,t.spatialReference)&&t.elevationProvider&&(my(t.elevationProvider,p$)??0)>p$[2]-W4e)}async function D0t(t,e,i){if(Z4e(t,e))return!0;const{elevationProvider:r,spatialReference:n,renderCoordsHelper:s}=t;if(r==null||!s.fromRenderCoords(e,p$,n))return!1;const[o,l,c]=p$,f=await r.queryElevation(o,l,c,n,"ground",i)??0;return St(i),f>c-W4e}async function N0t(t,e,i){const r=W();if(e==null)return Ne(r,t.state.camera.center);if(e instanceof mt){const{renderSpatialReference:n,basemapTerrain:s,elevationProvider:o}=t,l=e.spatialReference;if(await dU(e,r,n,0,{signal:i}),St(i),e.z==null&&s!=null&&o!=null){const c=await o.queryElevation(e.x,e.y,e.z??0,l,"ground",i);St(i),c!=null&&t.renderCoordsHelper.setAltitude(r,c)}return r}return Ne(r,e)}function F0t(t,e){const i=W();if(e==null)return Ne(i,t.state.camera.center);if(e instanceof mt){if(!ud(e,i,t.renderSpatialReference))return null;const{basemapTerrain:r,elevationProvider:n}=t;if(e.z==null&&r!=null&&n!=null){const s=my(n,e);s!=null&&t.renderCoordsHelper.setAltitude(i,s)}return i}return Ne(i,e)}function sae(t,e,i,r,n,s){return K4e(t,e,i,r instanceof mt?r:null,F0t(t,r),n,s)}async function J4e(t,e,i,r,n,s,o){const l=r instanceof mt?r:null,c=await N0t(t,r,o);return St(o),Q4e(t,e,i,l,c,n,s,o)}function K4e(t,e,i,r,n,s,o){if(n==null||(r??(r=w_(n,t.renderSpatialReference,V_(t))),r==null))return null;const l=eIe(t,e,i,n,s,o);if(tIe(t,i,o)&&Z4e(t,l.eye)){const{tilt:c,mode:f}=iIe(t,i,n,s);return K4e(t,e,c,r,n,s,f)}return rIe(l,n)}async function Q4e(t,e,i,r,n,s,o,l){r??(r=await A4e(n,t.renderSpatialReference,V_(t),{signal:l})),St(l);const c=eIe(t,e,i,n,s,o);if(tIe(t,i,o)&&await D0t(t,c.eye,l)){St(l);const{tilt:f,mode:_}=iIe(t,i,n,s);return Q4e(t,e,f,r,n,s,_,l)}return rIe(c,n)}function eIe(t,e,i,r,n,s){const o=z0t(t,e,i,r,n=Math.max(n,t.state.constraints.minimumPoiDistance),s);return(0,vP(t).eyeForCenterWithHeadingTilt)(r,n,o.heading,o.tilt)}function tIe(t,e,i){const r=t.map.ground.navigationConstraint;return i===ql.ADJUST&&t.viewingMode==="global"&&e>0&&(r==null||r.type==="stay-above")}function iIe(t,e,i,r){const n=lIe(t,i,r,V0t(t,r,e,i));return{tilt:n,mode:e-n<1?ql.LOCKED:ql.ADJUST}}function rIe(t,e){return{...t,center:Xr(e)}}function nIe(t,e){const{state:i,spatialReference:r}=t,n=e.spatialReference;return i.isGlobal&&p5(n,_t.Global)||i.isLocal&&r.equals(n)}function sIe(t,e){let i,r,n;if(t.state.isGlobal){const _=new mt(e.xmin,e.ymin,e.spatialReference),x=new mt(e.xmax,e.ymax,e.spatialReference),T=e.spatialReference.isGeographic?I0t:R0t;i=new mt({x:T.center(_.x,x.x),y:(x.y+_.y)/2,z:e.zmax!=null&&e.zmin!=null?(e.zmax+e.zmin)/2:void 0,spatialReference:e.spatialReference});const A=Sr(e.spatialReference),M=b0t(i,_,x);r=M.lon,n=M.lat,T.diff(_.x,x.x)>T.range/2&&(r+=A.halfCircumference),r=Math.min(r,A.halfCircumference),n=Math.min(n,A.halfCircumference)}else{const _=t.renderSpatialReference??e.spatialReference;_.equals(e.spatialReference)||(e=rl(e,_)),r=e.xmax-e.xmin,n=e.ymax-e.ymin;const x=e.zmax!=null&&e.zmin!=null?(e.zmax+e.zmin)/2:void 0;i=new mt({x:e.xmin+.5*r,y:e.ymin+.5*n,z:x,spatialReference:_})}const s=e.zmax!=null&&e.zmin!=null?e.zmax-e.zmin:0,o=t.state.camera,l=1/Math.tan(o.fovX/2),c=1/Math.tan(o.fovY/2),f=1/Math.tan(o.fov/2);return{center:i,distance:Math.max(.5*r*l,.5*n*c,.5*s*f)/wee}}async function oIe(t,e,i,r,n,s){const o=nIe(t,e)?e:await qy(e,t.spatialReference,{signal:s});St(s);const{center:l,distance:c}=sIe(t,o),f=await J4e(t,i,r,l,c,n,s);return St(s),uIe(t,f,t.camera.fov,s)}function PF(t,e,i,r,n,s){let o;try{o=nIe(t,e)?e:rl(e,t.spatialReference)}catch{return null}const{center:l,distance:c}=sIe(t,o),f=sae(t,i,r,l,c,n);return f==null?null:cIe(t,f,t.camera.fov,s)}function aIe(t,e,i){const r=t.renderSpatialReference,n=w_(i,r,V_(t));if(n==null)return null;const s=Math.tan(e.fovX/2),o=Math.tan(e.fovY/2),l=O9(e.eye,i),c=2*l*s*wee,f=2*l*o*wee;return t.viewingMode==="global"?B4e(t,n,c,f):F4e(t,n,c,f)}function k0t(t,e,i){const r=t.pointsOfInterest.centerOnSurfaceFrequent.distance;if(Math.log(i/r)/Math.LN2>M0t)return!0;const n=t.renderSpatialReference,s=V_(t),o=w_(e,n,s),l=w_(t.pointsOfInterest.centerOnSurfaceFrequent.renderLocation,n,s);if(o==null||l==null)return!1;const c=Math.tan(.5*t.state.camera.fov)*r;return l.distance(o)/c>O0t}function z0t(t,e,i,r,n,s){let o=0;return s===ql.ADJUST&&k0t(t,r,n)?(e=0,o=U0t(t,n,i,r)):o=oae(t,r,n,i),o=t.state.constraints.clampTilt(n,o),{heading:e,tilt:i=lIe(t,r,n,o)}}const gU=.7;function U0t(t,e,i,r){const n=oae(t,r,e,i);if(!t.state.constraints.tilt)return n;const s=t.state.constraints.tilt(e);s.max=Math.min(s.max,.5*Math.PI);const o=s.min*(1-gU)+s.max*gU;return Math.min(n,o)}function V0t(t,e,i,r){let n=oae(t,r,e,i);if(!t.state.constraints.tilt)return n;const s=t.state.constraints.tilt(e);return n=Math.min(n,.5*Math.PI),s.min*(1-gU)+n*gU}function lIe(t,e,i,r){return vP(t).lookAtTiltToEyeTilt(r,e,i)}function oae(t,e,i,r){return vP(t).eyeTiltToLookAtTilt(r,e,i)}function cIe(t,e,i,r){if(e==null)return null;const n=t.renderSpatialReference,s=w_(e.eye,n,V_(t));return s==null?null:(r??(r=new cd),r.position=s,r.heading=e.heading,r.tilt=e.tilt,r.fov=i,r)}async function uIe(t,e,i,r){const n=t.renderSpatialReference,s=await A4e(e.eye,n,V_(t),{signal:r});return St(r),new cd(s,e.heading,e.tilt,i)}function B0t(t,e){var r;const i=(r=t.basemapTerrain)==null?void 0:r.tilingScheme;if(i)return i.levelAtScale(e);G4e.error("#scaleToZoom()","Cannot compute zoom from scale without a tiling scheme")}function hIe(t,e){var r;const i=(r=t.basemapTerrain)==null?void 0:r.tilingScheme;if(i)return i.scaleAtLevel(e);G4e.error("#zoomToScale()","Cannot compute scale from zoom without a tiling scheme")}function dIe(t,e){return el(e.center,t.renderSpatialReference,X0e,at.WGS84),qT(t,e.distance,X0e[1])}const aae=Ce.getLogger("esri.layers.support.ElevationSampler");let pIe=class{queryElevation(e){return fIe(e.clone(),this)}on(){return rr()}projectIfRequired(e,i){return mIe(e,i)}},j0t=class extends pIe{get spatialReference(){return this.extent.spatialReference}constructor(e,i,r){super(),this.tile=e,this.noDataValue=r;const n=e.tile.extent;this.extent=bB(n,i.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=n;const s=ws(i.spatialReference),o=i.lodAt(e.tile.level).resolution*s;this.demResolution={min:o,max:o}}contains(e){const i=this.projectIfRequired(e,this.spatialReference);return i!=null&&this.containsAt(i.x,i.y)}containsAt(e,i){return wB(this._aaExtent,e,i)}elevationAt(e,i){if(!this.containsAt(e,i)){const r=this.extent,n=`${r.xmin}, ${r.ymin}, ${r.xmax}, ${r.ymax}`;return aae.warn("#elevationAt()",`Point used to sample elevation (${e}, ${i}) is outside of the sampler extent (${n})`),this.noDataValue}return this.tile.sample(e,i)??this.noDataValue}},Z0e=class extends pIe{get spatialReference(){return this.extent.spatialReference}constructor(e,i,r){let n;super(),typeof i=="number"?(this.noDataValue=i,n=null):(n=i,this.noDataValue=r),this.samplers=n?e.map(o=>new j0t(o,n,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:o,max:l}=s.demResolution;this.demResolution={min:o,max:l};for(let c=1;c=0;A--)x.unshift(new cm({level:A,scale:T,resolution:T})),T*=2}return new sw({dpi:96,lods:x,origin:new mt(0,0,n),size:[r,r],spatialReference:n})}const o=pp(n),l=t.origin?new mt({x:t.origin.x,y:t.origin.y,spatialReference:n}):new mt(o?{x:o.origin[0],y:o.origin[1],spatialReference:n}:{x:0,y:0,spatialReference:n}),c=96,f=1/(ws(n)*39.37*c),_=[];if(i)for(let x=0;x{r.push(s.scale),e=s.scale>e?s.scale:e,i=s.scale=e.length-1)return e[e.length-1];const i=Math.floor(t),r=i+1;return e[i]/(e[i]/e[r])**(t-i)}scaleToZoom(t){const e=this.scales,i=e.length-1;let r=0;for(;rt&&s=e?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(t,e,i,r){const n=this.lodAt(t);if(!n)return null;let s,o;if(typeof e=="number")s=e,o=i;else if(Zn(e.spatialReference,this.spatialReference))s=e.x,o=e.y,r=i;else{const f=rP(e,this.spatialReference);if(f==null)return null;s=f.x,o=f.y,r=i}const l=n.resolution*this.size[0],c=n.resolution*this.size[1];return r||(r=new Tj(null,0,0,0,Ni())),r.level=t,r.row=Math.floor((this.origin.y-o)/c+.001),r.col=Math.floor((s-this.origin.x)/l+.001),this.updateTileInfo(r),r}updateTileInfo(t,e=sw.ExtrapolateOptions.NONE){let i=this.lodAt(t.level);if(!i&&e===sw.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(t)?t:typeof t=="number"?[t,t]:[256,256]})],sc.prototype,"size",void 0),y([$t("size",["rows","cols"])],sc.prototype,"readSize",null),y([Pt("size",{cols:{type:$n},rows:{type:$n}})],sc.prototype,"writeSize",null),y([w({type:at,json:{write:!0}})],sc.prototype,"spatialReference",void 0),sc=sw=y([Z("esri.layers.support.TileInfo")],sc),function(t){var e;(e=t.ExtrapolateOptions||(t.ExtrapolateOptions={}))[e.NONE=0]="NONE",e[e.POWER_OF_TWO=1]="POWER_OF_TWO"}(sc||(sc={}));const pO=sc,W0t=12;let Bu=class Au{constructor(e){const i=Au.checkUnsupported(e);if(i!=null)throw i;const r=e;this.spatialReference=r.spatialReference,this._isWebMercator=this.spatialReference.isWebMercator,this._isGCS=D2(this.spatialReference)||r1(this.spatialReference)||n1(this.spatialReference),this.origin=[r.origin.x,r.origin.y],this.pixelSize=r.size[0],this.dpi=r.dpi;const n=r.lods.reduce((f,_,x)=>(_.levelnew cm({level:i,scale:e.scale,resolution:e.resolution}))})}getExtent(e,i,r,n){const s=this.levels[e],o=s.tileSize[0],l=s.tileSize[1];n[0]=this.origin[0]+r*o,n[2]=this.origin[0]+(r+1)*o,n[3]=this.origin[1]-i*l,n[1]=this.origin[1]-(i+1)*l}convertExtentToRadians(e,i){this._isWebMercator?(i[0]=jde(e[0]),i[1]=Mz(e[1]),i[2]=jde(e[2]),i[3]=Mz(e[3])):this._isGCS&&(i[0]=Ei(e[0]),i[1]=Ei(e[1]),i[2]=Ei(e[2]),i[3]=Ei(e[3]))}getExtentGeometry(e,i,r,n=new Vi){return this.getExtent(e,i,r,Qm),n.spatialReference=this.spatialReference,n.xmin=Qm[0],n.ymin=Qm[1],n.xmax=Qm[2],n.ymax=Qm[3],n.zmin=void 0,n.zmax=void 0,n}ensureMaxLod(e){if(e==null)return!1;let i=!1;for(;this.levels.length<=e;){const r=this.levels[this.levels.length-1],n=r.resolution/2;this.levels.push({resolution:n,scale:r.scale/2,tileSize:[n*this.pixelSize,n*this.pixelSize]}),i=!0}return i}capMaxLod(e){this.levels.length>e+1&&(this.levels.length=e+1)}getMaxLod(){return this.levels.length-1}scaleAtLevel(e){return this.levels[0].scale/2**e}levelAtScale(e){const i=this.levels[0].scale;return e>=i?0:Math.log(i/e)*Math.LOG2E}resolutionAtLevel(e){return this.levels[0].resolution/2**e}compatibleWith(e){if(!(e instanceof Au)){if(Au.checkUnsupported(e))return!1;e=new Au(e)}if(!e.spatialReference.equals(this.spatialReference)||e.pixelSize!==this.pixelSize)return!1;const i=Math.min(this.levels.length,e.levels.length)-1,r=this.levels[i].resolution;let n=.5*r;return!Ey(e.origin[0],this.origin[0],n)||!Ey(e.origin[1],this.origin[1],n)?!1:(n=.5*r/2**i/this.pixelSize*W0t,Ey(r,e.levels[i].resolution,n))}rootTilesInExtent(e,i=null,r=1/0){const n=new Array,s=this.levels[0].tileSize;if(e==null||s[0]===0||s[1]===0)return n;Au.computeRowColExtent(e,s,this.origin,Qm);let o=Qm[1],l=Qm[3],c=Qm[0],f=Qm[2];const _=f-c,x=l-o;if(_*x>r){const T=Math.floor(Math.sqrt(r));x>T&&(o=o+Math.floor(.5*x)-Math.floor(.5*T),l=o+T),_>T&&(c=c+Math.floor(.5*_)-Math.floor(.5*T),f=c+T)}for(let T=o;T!bet(n.resolution,r/2**n.level))}static hasGapInLevels(e){const i=e.lods.map(r=>r.level);i.sort((r,n)=>r-n);for(let r=1;r=128&&i<=512}static hasOriginPerLODs(e){const i=e.origin;return e.lods.some(r=>r.origin!=null&&(r.origin[0]!==i.x||r.origin[1]!==i.y))}static getMissingTileInfoError(){return new se("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}static checkUnsupported(e){return e==null?lae():e.lods.length<1?new se("tilingscheme:generic","Tiling scheme must have at least one level"):Au.isPowerOfTwo(e)?Au.hasGapInLevels(e)?new se("tilingscheme:gaps","Tiling scheme levels must not have gaps between min and max level"):Au.tileSizeSupported(e)?Au.hasOriginPerLODs(e)?new se("tilingscheme:multiple-origin","Tiling scheme levels must not have their own origin"):null:new se("tilingscheme:tile-size","Tiles must be square and size must be one of [128, 256, 512]"):new se("tilingscheme:power-of-two","Tiling scheme must be power of two")}static fromExtent(e,i){const r=e[2]-e[0],n=e[3]-e[1],s=ws(i),o=1.2*Math.max(r,n),l=256,c=96,f=.0254,_=new Au(new pO({size:[l,l],origin:new mt({x:e[0]-.5*(o-r),y:e[3]+.5*(o-n)}),lods:[new cm({level:0,resolution:o/l,scale:1/(l/c*f/(o*s))})],spatialReference:i}));return _.ensureMaxLod(20),_}static makeWebMercatorAuxiliarySphere(e){const i=new Au(Au.WebMercatorAuxiliarySphereTileInfo);return i.ensureMaxLod(e),i}static makeGCSWithTileSize(e,i=256,r=16){const n=256/i,s=new Au(new pO({size:[i,i],origin:new mt({x:-180,y:90,spatialReference:e}),spatialReference:e,lods:[new cm({level:0,resolution:.703125*n,scale:295497598570834e-6*n})]}));return s.ensureMaxLod(r),s}get test(){return{isWebMercator:this._isWebMercator,isGCS:this._isGCS}}};function lae(){return new se("tilingscheme:tile-info-missing","Tiling scheme must have tiling information")}Bu.WebMercatorAuxiliarySphereTileInfo=new pO({size:[256,256],origin:new mt({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:at.WebMercator}),spatialReference:at.WebMercator,lods:[new cm({level:0,resolution:156543.03392800014,scale:591657527591555e-6})]}),Bu.WebMercatorAuxiliarySphere=Bu.makeWebMercatorAuxiliarySphere(19);const Qm=Ni(),PM=64,X4=512,Y0t=2.5,EL=wet(HZ/10),gIe=2,yIe=Ni();Bu.WebMercatorAuxiliarySphere.getExtent(0,0,0,yIe);const X0t=Ni([-180,-90,180,90]),Z0t="Cannot extend surface to encompass all layers because it would result in too many root tiles.",J0t="Surface extent is too large for tile resolution at level 0.",K0t=3;let Q0t=K0t;function See(t){return t<4?3:Q0t}let ow=class extends Dn.EventedAccessor{constructor(e){super(e),this.demResolution={min:-1,max:-1},this.noDataValue=EL}initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get extent(){const e=this.view.basemapTerrain;if((e==null?void 0:e.extent)==null||e.spatialReference==null)return null;const i=bB(e.extent,e.spatialReference);return i.zmin=e.visibleElevationBounds.min,i.zmax=e.visibleElevationBounds.max,i}get spatialReference(){var e;return((e=this.view.basemapTerrain)==null?void 0:e.spatialReference)??at.WGS84}elevationAt(e,i){var r;if(this.extent==null||!Kc(this.extent,e,i)){const n=this.extent!=null?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;return Ce.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${e}, ${i}) is outside of the sampler extent (${n})`),this.noDataValue}return((r=this.view.elevationProvider)==null?void 0:r.getElevation(e,i,0,this.spatialReference,"ground"))??this.noDataValue}queryElevation(e){return fIe(e.clone(),this)}};y([w({readOnly:!0})],ow.prototype,"demResolution",void 0),y([w({readOnly:!0})],ow.prototype,"extent",null),y([w({readOnly:!0})],ow.prototype,"noDataValue",void 0),y([w()],ow.prototype,"spatialReference",null),y([w({constructOnly:!0})],ow.prototype,"view",void 0),ow=y([Z("esri.views.support.GroundViewElevationSampler")],ow);const emt=ow;let Q1=class extends ze{constructor(e){super(e),this.view=null,this.layerViews=new it}initialize(){this.addHandles(Mo(()=>{var e,i;return(i=(e=this.view)==null?void 0:e.map)==null?void 0:i.ground},e=>e.load())),this.addHandles(this.layerViews.on("after-changes",()=>this._layerViewsAfterChangesHandler()))}destroy(){this._set("view",null);for(const e of this.layerViews)e.destroy();this.layerViews.length=0}get elevationSampler(){return this.view?this.view.type==="2d"?null:this.view.ready&&this.view.basemapTerrain&&this.view.basemapTerrain.ready?new emt({view:this.view}):null:null}get extent(){const e=this.view;return e&&e.type!=="2d"&&e.ready?aIe(e,e.state.camera,e.pointsOfInterest.centerOnSurfaceFrequent.renderLocation):null}get updating(){return!this.suspended&&this.layerViews.some(e=>e.updating)}get suspended(){return!this.view||this.view.suspended}_layerViewsAfterChangesHandler(){this.removeHandles("updating"),this.addHandles(this.layerViews.map(e=>_e(()=>e.updating,()=>this._updateUpdating(),Li)).toArray(),"updating"),this._updateUpdating()}_updateUpdating(){this.notifyChange("updating")}};y([w({readOnly:!0})],Q1.prototype,"elevationSampler",null),y([w({readOnly:!0})],Q1.prototype,"extent",null),y([w({type:Boolean,readOnly:!0})],Q1.prototype,"updating",null),y([w({constructOnly:!0})],Q1.prototype,"view",void 0),y([w({type:it,readOnly:!0})],Q1.prototype,"layerViews",void 0),y([w({readOnly:!0})],Q1.prototype,"suspended",null),Q1=y([Z("esri.views.GroundView")],Q1);const tmt=Q1;let x_=class{constructor(e,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const r in e){const n=e[r],s=new dSe(n,void 0,void 0,2,2);this._properties[r]={pool:s,acquired:[]}}this._afterDispatchHandle=TSe(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const e in this._properties){const i=this._properties[e];for(const r of i.acquired)phe(r)||i.pool.release(r);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(e){const i=this._owner._get(e),r=this._properties[e];let n=r.pool.acquire();for(r.acquired.push(n);n===i;)r.acquired.push(n),n=r.pool.acquire();return n}_release(){for(const e in this._properties){const i=this._properties[e];let r=0;for(const n of i.acquired)phe(n)?i.acquired[r++]=n:i.pool.release(n);i.acquired.length=r}}};const imt=Le("mac")?"Meta":"Ctrl",Ej={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let t=48;t<58;t++)Ej[t]=String.fromCharCode(t);for(let t=1;t<25;t++)Ej[111+t]=`F${t}`;for(let t=65;t<91;t++)Ej[t]=[String.fromCharCode(t+32),String.fromCharCode(t)];function rmt(t){if(t.key!==void 0)return Sf(t);const e=Ej[t.keyCode];return Array.isArray(e)?t.shiftKey?e[1]:e[0]:e}function nmt(t){switch(t){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}let smt=class{constructor(e,i=[]){this.eventType=e,this.keyModifiers=i}matches(e){if(e.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=e.modifiers;for(const r of this.keyModifiers)if(!i.has(r))return!1;return!0}};const K0e=Ce.getLogger("esri.views.input.InputHandler");let Rl=class{constructor(e){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=e}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const e in this._incoming){const i=this._incoming[e];for(const r of i)this._incomingEventMatches.push(r.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(e=>e.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(e){this._manager?K0e.error("This InputHandler has already been registered with an InputManager"):(e.setEventCallback(i=>this._handleEvent(i)),e.setUninstallCallback(()=>this._onUninstall()),this._manager=e)}onUninstall(){}registerIncoming(e,i,r){let n;typeof i=="function"?(r=i,n=[]):n=i||[];const s=typeof e=="string"?new smt(e,n):e,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},l=_=>{const x=this._incoming[_.match.eventType];if(x){const T=x.indexOf(_);x.splice(T,1),o(),this._manager&&this._manager.updateDependencies()}},c=new omt(s,r,{onPause:l,onRemove:l,onResume:_=>{const x=this._incoming[_.match.eventType];x&&!x.includes(_)&&(x.push(_),o(),this._manager&&this._manager.updateDependencies())}});let f=this._incoming[s.eventType];return f||(f=[],this._incoming[s.eventType]=f),f.push(c),o(),this._manager&&this._manager.updateDependencies(),c}registerOutgoing(e){if(this._outgoing[e])throw new Error("There is already a callback registered for this outgoing InputEvent: "+e);const i=new amt(e,{onEmit:(r,n,s,o)=>{var l;(l=this._manager)==null||l.emit(r.eventType,n,s,o)},onRemove:r=>{var n;delete this._outgoing[r.eventType],(n=this._manager)==null||n.updateDependencies()}});return this._outgoing[e]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}startCapturingPointer(e){var i;(i=this._manager)==null||i.setPointerCapture(e,!0)}stopCapturingPointer(e){var i;(i=this._manager)==null||i.setPointerCapture(e,!1)}refreshHasPendingInputs(){var e;(e=this._manager)==null||e.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):K0e.error("This InputHandler is not registered with an InputManager")}_handleEvent(e){var r;const i=this._incoming[e.type];if(i){for(const n of i)if(n.match.matches(e)&&((r=n.callback)==null||r.call(n,e),e.shouldStopPropagation()))break}}},omt=class{constructor(e,i,r){this.match=e,this._callback=i,this._handler=r}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},amt=class{constructor(e,i){this.eventType=e,this._removed=!1,this._handler=i}emit(e,i,r){this._removed||this._handler.onEmit(this,e,i,r)}remove(){this._removed=!0,this._handler.onRemove(this)}},lmt=class extends Rl{constructor(e){super(!0),this._onChange=e,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(e){const i=e.native.pointerType==="touch"?"touch":"mouse",{x:r,y:n}=e;i===this._value&&this._x===r&&this._y===n||(this._value=i,this._x=r,this._y=n,this._onChange(i,r,n))}},cmt=class extends Rl{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=m5(!1),this._onPointerAdd=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.add(e.native.pointerId),this._update())},this._onPointerRemove=({data:e})=>{e.pointerType==="touch"&&(this._activeTouchPointerIds.delete(e.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Wp=class extends ze{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=imt,this._latestPointerType="mouse",this._propertiesPool=new x_({latestPointerLocation:dmt},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const i of e)this.uninstallHandlers(i);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,i,r=Es.INTERNAL){if(this._nameToGroup[e])return void Ce.getLogger(this).error("There is already an InputHandler group registered under the name `"+e+"`");if(i.length===0)return void Ce.getLogger(this).error("Can't register a group of zero handlers");const n={name:e,handlers:i.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:r,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(l,c,f,_,x)=>{this._emitInputEvent(o.priorityIndex+1,l,c,f,x,_)},setPointerCapture:(l,c)=>{this._setPointerCapture(n,o,l,c)},setEventCallback:l=>{o.eventCallback=l},setUninstallCallback:l=>{o.uninstallCallback=l},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const i=this._nameToGroup[e];i?(i.handlers.forEach(r=>{var n;r.removed=!0,(n=r.uninstallCallback)==null||n.call(r)}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):Ce.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,i=new Set;this._handlersPriority=[];for(let r=this._handlers.length-1;r>=0;r--){const n=this._handlers[r];n.priorityIndex=r,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let r=this._handlersPriority.length-1;r>=0;r--){const n=this._handlersPriority[r];n.priorityIndex=r;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(e.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){e.add(o.eventType);for(const l of o.keyModifiers)nmt(l)||i.add(l)}n.active=s}this._sourceEvents=e,this._keyModifiers=i,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,i,r){this._latestPointerType=e;const n=this._get("latestPointerLocation");if(n==null||n.x!==i||n.y!==r){const s=this._propertiesPool.get("latestPointerLocation");s.x=i,s.y=r,this._set("latestPointerLocation",s)}}_onEventReceived(e,i){if(e==="pointer-capture-lost"){const s=i;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(e,i);const r=this.test.timestamp!=null?this.test.timestamp:i.native?i.native.timestamp:void 0,n=i.native?i.native.cancelable:void 0;this._emitInputEventFromSource(e,i,r,n)}_updateKeyModifiers(e,i){if(!i)return;let r=!1;const n=()=>{if(!r){const l=new Set;this._activeKeyModifiers.forEach(c=>{l.add(c)}),this._activeKeyModifiers=l,r=!0}},s=(l,c)=>{c&&!this._activeKeyModifiers.has(l)?(n(),this._activeKeyModifiers.add(l)):!c&&this._activeKeyModifiers.has(l)&&(n(),this._activeKeyModifiers.delete(l))};if(e==="key-down"||e==="key-up"){const l=i.key;this._keyModifiers.has(l)&&s(l,e==="key-down")}const o=i.native;s("Alt",!(!o||!o.altKey)),s("Ctrl",!(!o||!o.ctrlKey)),s("Shift",!(!o||!o.shiftKey)),s("Meta",!(!o||!o.metaKey)),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new lmt((e,i,r)=>this._setLatestPointer(e,i,r)),this._multiTouchHandler=new cmt,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],Es.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,Es.INTERNAL)}_setPointerCapture(e,i,r,n){const s=e.name+"-"+i.priorityIndex,o=this._pointerCaptures.get(r.pointerId)||new Set;this._pointerCaptures.set(r.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(r,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(r.pointerId),this.eventSource&&this.eventSource.setPointerCapture(r,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,i,r,n){this._emitInputEvent(0,e,i,r,n)}_emitInputEvent(e,i,r,n,s,o){const l=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),c=s!==void 0&&s,f={event:new umt(i,r,l,o||this._activeKeyModifiers,c),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(f):this._doNewPropagation(f)}_doNewPropagation(e){this._currentPropagation={events:new cU,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){var i,r,n;this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:s,priorityIndex:o}=e.events.pop(),l=(i=s.data)==null?void 0:i.eventId;if(!(l!=null&&this._stoppedPropagationEventIds.has(l)))for(e.currentHandler=this._handlersPriority[o];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!s.shouldStopPropagation()&&((n=(r=e.currentHandler).eventCallback)==null||n.call(r,s)),s.shouldStopPropagation()){l!=null&&this._stoppedPropagationEventIds.add(l);break}if(s.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:s,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const i=new cU;i.push(e);const r=this._currentPropagation;if(r){for(;r.events.length;)i.push(r.events.pop());r.events=i,r.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,i){if(e.handler.hasSideEffects!==i.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==i.groupPriority)return e.groupPriority>i.groupPriority?-1:1;for(const r of e.handler.incomingEventMatches)for(const n of i.handler.incomingEventMatches){if(r.eventType!==n.eventType)continue;const s=r.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===r.keyModifiers.length!=(s.length===n.keyModifiers.length))return r.keyModifiers.length>n.keyModifiers.length?-1:1}return e.priorityIndex>i.priorityIndex?-1:1}_sortHandlersPriority(e){const i=[];for(const r of e){let n=0;for(;n=0;)n++;i.splice(n,0,r)}return i}get debug(){const e=i=>{const r=this._setPointerCapture;this._setPointerCapture=()=>{},i(),this._setPointerCapture=r};return{injectEvent:(i,r)=>{e(()=>{this._onEventReceived(i,r)})},disablePointerCapture:e}}};y([w({readOnly:!0})],Wp.prototype,"hasPendingInputs",null),y([w({constructOnly:!0})],Wp.prototype,"eventSource",void 0),y([w({constructOnly:!0})],Wp.prototype,"recognizers",void 0),y([w()],Wp.prototype,"_latestPointerType",void 0),y([w()],Wp.prototype,"latestPointerType",null),y([w()],Wp.prototype,"multiTouchActive",null),y([w({readOnly:!0})],Wp.prototype,"latestPointerLocation",void 0),y([w()],Wp.prototype,"_paused",void 0),y([w({readOnly:!0})],Wp.prototype,"updating",null),Wp=y([Z("esri.views.input.InputManager")],Wp);let umt=class{constructor(e,i,r,n,s){this.type=e,this.data=i,this.timestamp=r,this.modifiers=n,this.cancelable=s,this._propagationState=Dw.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Dw.STOPPED}shouldStopPropagation(){return(this._propagationState&Dw.STOPPED)!=0}async(e){this._propagationState|=Dw.PAUSED;const i=(r,n)=>{this._propagationState&=~Dw.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw r;return r};return(typeof e=="function"?e():e).then(r=>i(r,!1),r=>i(r,!0))}shouldPausePropagation(e){return!!(this._propagationState&Dw.PAUSED)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}};var Dw;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Dw||(Dw={}));const Es={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let hmt=class{};const dmt=hmt;function eg(t){return t!=null&&"open"in t&&"declaredClass"in t}function Q0e(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const pmt=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([_e(()=>[this.ui,this.popup],([i,r],n)=>{const s="popup",o="manual";if(n){const[l,c]=n;l&&eg(c)&&(c.view=null,Q0e(c)&&l.remove(c,s))}i&&eg(r)&&(r.view=this,Q0e(r)&&i.add(r,{key:s,position:o,internal:!0}))},ii),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(!eg(this.popup)&&"autoOpenEnabled"in this.popup&&this.popup.autoOpenEnabled===!1||(eg(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),eg(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)})))},Es.WIDGET)]),rd(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{we(()=>import("./Popup-aRK3Vd3w.js"),__vite__mapDeps([156,78,157,74,75,76,77,52,53,62,48,49,50,51,54,55,56,57,58,59,60,61,158,159]))})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(eg(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void Ce.getLogger(this).error(new se("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){var i;(i=this._popupSetupTask)==null||i.abort(),eg(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,r){await this.when();const{location:n,queryArea:s,layerViewsAndGraphics:o,clientOnlyGraphics:l}=await this._prepareFetchPopupFeatures(i,r),c=Promise.resolve(l),f=this._queryLayerPopupFeatures(s,o,r),_=f.map(x=>x.promise);return{location:n,clientOnlyGraphics:l,allGraphicsPromise:wGe([c,..._]).then(x=>Array.from(new Set(x.flat()))),promisesPerLayerView:f}}async setupPopup(){var i;if((i=this._popupSetupTask)==null||i.abort(),this.popup&&!eg(this.popup))return this._popupSetupTask=Cc(async r=>{const{default:n}=await we(()=>import("./Popup-aRK3Vd3w.js"),__vite__mapDeps([156,78,157,74,75,76,77,52,53,62,48,49,50,51,54,55,56,57,58,59,60,61,158,159]));if(St(r),!this.popup||eg(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}_queryLayerPopupFeatures(i,r,n){return r.map(({layerView:s,graphics:o})=>{const l={clientGraphics:o,event:n!=null?n.event:void 0,signal:n!=null?n.signal:void 0,defaultPopupTemplateEnabled:n!=null&&!!n.defaultPopupTemplateEnabled},c=s.fetchPopupFeatures(i,l);return{layerView:s,promise:c}})}_isValidPopupGraphic(i,r){return i&&!!i.getEffectivePopupTemplate(r!=null&&r.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(i,r){const{clientGraphics:n,queryArea:s,location:o}=await this._popupHitTestGraphics(i,r),l=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:c,clientOnlyGraphics:f}=this._graphicsPerFetchPopupLayerView(n,l);return{clientOnlyGraphics:f,layerViewsAndGraphics:c,queryArea:s,location:o}}async _popupHitTestGraphics(i,r){const n=await this.popupHitTest(i),s=n.results,o=n.mapPoint,l=s.filter(f=>f.type==="graphic"&&this._isValidPopupGraphic(f.graphic,r)),c=l.length?l[0].mapPoint:null;return{clientGraphics:l.map(f=>f.graphic),queryArea:o,location:o||c}}_getFetchPopupLayerViews(){const i=[];return this.allLayerViews.forEach(r=>{this._isValidPopupLayerView(r)&&i.push(r)}),this.graphicsView!=null&&this._isValidPopupLayerView(this.graphicsView)&&i.push(this.graphicsView),i.reverse()}_isValidPopupLayerView(i){return i!=null&&(!("layer"in i)||!i.suspended)&&"fetchPopupFeatures"in i}_graphicsPerFetchPopupLayerView(i,r){const n=[],s=new Map,o=r.map(l=>{const c=[];return"layer"in l?s.set(l.layer,c):s.set(l.graphics,c),{layerView:l,graphics:c}});for(const l of i){const c=s.get(l.layer)||s.get(l.sourceLayer)||null;c?c.push(l):n.push(l)}return{layerViewsAndGraphics:o,clientOnlyGraphics:n}}};return y([w({cast(i){return!i||eg(i)||typeof i=="object"&&(i.open=r=>(NO(Ce.getLogger(this),"view.popup is no longer created by default. view.popup.open() will stop working when the popup isn't created",{replacement:"Use view.openPopup() instead.",version:"4.27"}),this.openPopup(r)),i.close=()=>(NO(Ce.getLogger(this),"view.popup is no longer created by default. view.popup.close() will stop working when the popup isn't created",{replacement:"Use view.closePopup() instead.",version:"4.27"}),this.closePopup())),i}})],e.prototype,"popup",void 0),y([w()],e.prototype,"popupEnabled",void 0),e=y([Z("esri.views.PopupView")],e),e};let aw=class extends ze{constructor(e){super(e),this.view=null,this.baseLayerViews=new it,this.referenceLayerViews=new it,this._loadingHandle=_e(()=>{var i,r;return(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.basemap},i=>{i&&i.load().catch(()=>{})},ii)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const e of this.baseLayerViews)e.destroy();this.baseLayerViews.length=0;for(const e of this.referenceLayerViews)e.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){var i,r;if(this.view&&this.view.suspended)return!1;const e=(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.basemap;return!!e&&!!e.loaded&&(this.baseLayerViews.some(n=>n.updating)||this.referenceLayerViews.some(n=>n.updating))}};y([w({constructOnly:!0})],aw.prototype,"view",void 0),y([w({readOnly:!0})],aw.prototype,"baseLayerViews",void 0),y([w({readOnly:!0})],aw.prototype,"referenceLayerViews",void 0),y([w({readOnly:!0})],aw.prototype,"suspended",null),y([w({type:Boolean,readOnly:!0})],aw.prototype,"updating",null),aw=y([Z("esri.views.BasemapView")],aw);function fmt(t){return"tryRecycleWith"in t}let mmt=class{constructor(e,i,r){this.layer=e,this.view=i,this.layerViewImporter=r,this._controller=new AbortController,this._deferred=Jl(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Yl(this._controller.signal,()=>{const n=new se("cancelled:layerview-create","layerview creation cancelled",{layer:e});this._deferred.reject(n)})}tryRecycle(e){if(!this.done||!this.layerView||!fmt(this.layerView))return null;const i=this.layer.type,r=this._controller.signal;for(let n=0;n(St(this._controller.signal),s.emit("layerview-destroy",{view:c,layerView:l}),c.emit("layerview-destroy",{view:c,layerView:l}),s.emit("layerview-create",{view:c,layerView:l}),c.emit("layerview-create",{view:c,layerView:l}),l)),new Promise((f,_)=>Yl(this._controller.signal,()=>_(ur())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:e}=this;if(e){const{layer:i,view:r}=this;i.emit("layerview-destroy",{view:r,layerView:e}),r.emit("layerview-destroy",{layer:i,layerView:e})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){var n,s;if(this._started)return;this._started=!0;const{_controller:{signal:e},layer:i,view:r}=this;this._map=r.map;try{let o,l;if(await i.load({signal:e}),i.prefetchResources&&await i.prefetchResources({signal:e}),ymt(i))o=await i.createLayerView(r,{signal:e});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new se("layer:view-not-supported","No layerview implementation was found");const _=await this.layerViewImporter.importLayerView(i);St(e),o="default"in _?new _.default({layer:i,view:r}):new _({layer:i,view:r})}const c=()=>{l=en(l),o.destroyed||o.destroy(),o.layer=null,o.parent=null,o.view=null,this.done=!0};l=Yl(e,c),St(e);try{await o.when()}catch(_){throw c(),_}if(!((s=(n=this._map)==null?void 0:n.allLayers)==null?void 0:s.includes(i)))return c(),void this._deferred.reject(new se("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=o,i.emit("layerview-create",{view:r,layerView:o}),r.emit("layerview-create",{layer:i,layerView:o}),this.done=!0,this._deferred.resolve(o)}catch(o){i.emit("layerview-create-error",{view:r,error:o}),r.emit("layerview-create-error",{layer:i,error:o}),this.done=!0,this._deferred.reject(new se("layerview:create-error","layerview creation failed",{layer:i,error:o}))}}},Yp=class extends ze{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new Rf,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var r;const i=(r=this.view.map)==null?void 0:r.allLayers;if(i)for(const n of i)this.layerViewImporter.hasLayerViewModule(n)&&this.layerViewImporter.importLayerView(n)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=Jl(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(tx(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var c,f,_;if(this.destroyed)return;const i=this.view.map;if(this._map!==i&&(this.clear(),this._map=i),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const r=new Set,n=[],s=this.view.ready,o=x=>{if(x!=null){for(const T of x)if(T){r.add(T);const A=this._layerLayerViewInfoMap.get(T);A&&s?A.start():A||this._recyclingInfoMap.has(T)||n.push(T),"layers"in T&&T.layers&&o(T.layers)}}};for(const x of this._rootCollectionNames)o(au(this,x));for(const[x,T]of this._layerLayerViewInfoMap)if(!r.has(x)){this._layerLayerViewInfoMap.delete(T.layer);const A=T.tryRecycle(n);A?(this.notifyChange("updating"),this._recyclingInfoMap.set(T.layer,T),A.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(T.layer),this._layerLayerViewInfoMap.set(T.layer,T),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(T.layer),T.destroy(),this._reschedule()})):T.destroy()}for(const[x,T]of this._recyclingInfoMap)r.has(x)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(T.layer),T.destroy());for(const x of n)this._createLayerView(x);this._refreshCollections();const l=[(c=i==null?void 0:i.ground)==null?void 0:c.layers,(f=i==null?void 0:i.basemap)==null?void 0:f.baseLayers,(_=i==null?void 0:i.basemap)==null?void 0:_.referenceLayers,i==null?void 0:i.layers].filter(x=>!!x);r.forEach(x=>"layers"in x&&l.push(x.layers)),this.addHandles(l.map(x=>this._watchUpdatingTracking.addOnCollectionChange(()=>x,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([Jr(()=>{var e,i;return(i=(e=this.view)==null?void 0:e.map)==null?void 0:i.allLayers},"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),_e(()=>{const e=this.view,i=e==null?void 0:e.map;return[i==null?void 0:i.basemap,i==null?void 0:i.ground,i==null?void 0:i.layers,e==null?void 0:e.ready]},()=>this._reschedule(),kt)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),WH(this._recyclingInfoMap),WH(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(ur()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||rp(this._layerLayerViewInfoMap,e=>!e.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let e=0;for(const i of this._layerLayerViewInfoMap.values())i.done||++e;return e}clear(){this.destroyed||(WH(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e)){if(this._recyclingInfoMap.has(e))return this._recyclingInfoMap.get(e).promise;throw new se("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e})}return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,i]of this._layersToLayerViews)this._populateLayerViewsOwners(au(this,e),au(this,i),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,i,r){if(!e||!i)return void(i&&i.removeAll());let n=0;for(const s of e){const o=this._layerLayerViewInfoMap.get(s);if(!(o!=null&&o.layerView))continue;const l=o.layerView;l.layer=s,l.parent=r,i.at(n)!==l&&i.splice(n,0,l),s.layers&&this._populateLayerViewsOwners(s.layers,l.layerViews,l),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const i=new mmt(e,this.view,this.layerViewImporter);i.promise.then(()=>this._refreshCollections(),r=>{r&&(sn(r)||r.name==="cancelled:layerview-create")||Ce.getLogger(this).error(`Failed to create layerview for layer title:'${e.title??"no title"}', id:'${e.id??"no id"}' of type '${e.type}'.`,{layer:e,error:r}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,i),this.view.ready&&i.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};y([w()],Yp.prototype,"_workPromise",void 0),y([w({readOnly:!0})],Yp.prototype,"_watchUpdatingTracking",void 0),y([w({readOnly:!0})],Yp.prototype,"_layersToLayerViews",null),y([w({readOnly:!0})],Yp.prototype,"_rootCollectionNames",null),y([w()],Yp.prototype,"layerViewImporter",void 0),y([w()],Yp.prototype,"supportsGround",void 0),y([w({readOnly:!0})],Yp.prototype,"updating",null),y([w({readOnly:!0})],Yp.prototype,"updatingRemaining",null),y([w({constructOnly:!0})],Yp.prototype,"view",void 0),Yp=y([Z("esri.views.LayerViewManager")],Yp);const gmt=Yp;function ymt(t){return"createLayerView"in t&&t.createLayerView!=null}let Id=class extends ze{constructor(e){super(e),this.factor=1.5,this.offset=Ku(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};y([w({type:Number})],Id.prototype,"factor",void 0),y([w({nonNullable:!0})],Id.prototype,"offset",void 0),y([w()],Id.prototype,"position",void 0),y([w({type:Number,range:{min:0}})],Id.prototype,"size",void 0),y([w()],Id.prototype,"maskUrl",void 0),y([w()],Id.prototype,"maskEnabled",void 0),y([w()],Id.prototype,"overlayUrl",void 0),y([w()],Id.prototype,"overlayEnabled",void 0),y([w({readOnly:!0})],Id.prototype,"version",null),y([w({type:Boolean})],Id.prototype,"visible",void 0),Id=y([Z("esri.views.Magnifier")],Id);const vIe=Id;let Z4=class extends Xs(ze){constructor(e){super(e),this.accentColor=new qe([255,127,0]),this.textColor=new qe([255,255,255])}};y([w({type:qe,nonNullable:!0})],Z4.prototype,"accentColor",void 0),y([w({type:qe,nonNullable:!0})],Z4.prototype,"textColor",void 0),Z4=y([Z("esri.views.Theme")],Z4);const Tee=Z4;var eme;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(eme||(eme={}));const _Ie=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],bIe={};function wIe(t){return!!bIe[t]}function vmt(t){for(const e of t)if(!wIe(e))return!1;return!0}_Ie.forEach(t=>{bIe[t]=!0});let _mt=class{constructor(e){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=e,this.inputManager=null}connect(e){e&&this.disconnect(),this.inputManager=e,this._handlers.forEach(({handler:i,priority:r},n)=>{var s;return(s=this.inputManager)==null?void 0:s.installHandlers(n,[i],r)})}disconnect(){this.inputManager&&this._handlers.forEach((e,i)=>{var r;return(r=this.inputManager)==null?void 0:r.uninstallHandlers(i)}),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(e,i,r,n){const s=Array.isArray(e)?e:e.split(",");if(!vmt(s))return s.some(wIe)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,l;Array.isArray(i)?l=i:(o=i,l=[]),typeof r=="function"?o=r:n=r,n=n??Es.DEFAULT;const c=this._createUniqueGroupName(),f=new bmt(this.view,s,l,o);this._handlers.set(c,{handler:f,priority:n});for(const _ of s){const x=this._handlerCounts.get(_)||0;this._handlerCounts.set(_,x+1)}return this.inputManager&&this.inputManager.installHandlers(c,[f],n),rr(()=>this._removeHandler(c,s))}hasHandler(e){return!!this._handlerCounts.get(e)}_removeHandler(e,i){if(this._handlers.has(e)){this._handlers.delete(e);for(const r of i){const n=this._handlerCounts.get(r);n===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",r):n===1?this._handlerCounts.delete(r):this._handlerCounts.set(r,n-1)}}this.inputManager&&this.inputManager.uninstallHandlers(e)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},bmt=class extends Rl{constructor(e,i,r,n){super(!0),this._latestDragStart=void 0,this.view=e;for(const s of i)switch(s){case"click":this.registerIncoming("click",r,o=>n(this._wrapClick(o)));break;case"double-click":this.registerIncoming("double-click",r,o=>n(this._wrapDoubleClick(o)));break;case"immediate-click":this.registerIncoming("immediate-click",r,o=>n(this._wrapImmediateClick(o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",r,o=>n(this._wrapImmediateDoubleClick(o)));break;case"hold":this.registerIncoming("hold",r,o=>n(this._wrapHold(o)));break;case"drag":this.registerIncoming("drag",r,o=>{const l=this._wrapDrag(o);l&&n(l)});break;case"key-down":this.registerIncoming("key-down",r,o=>n(this._wrapKeyDown(o)));break;case"key-up":this.registerIncoming("key-up",r,o=>n(this._wrapKeyUp(o)));break;case"pointer-down":this.registerIncoming("pointer-down",r,o=>n(this._wrapPointer(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",r,o=>n(this._wrapPointer(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",r,o=>n(this._wrapPointer(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",r,o=>n(this._wrapPointerDrag(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",r,o=>n(this._wrapMouseWheel(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",r,o=>n(this._wrapPointer(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",r,o=>n(this._wrapPointer(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",r,o=>{n(this._wrapGamepad(o))});break;case"focus":this.registerIncoming("focus",r,o=>{n(this._wrapFocus(o))});break;case"blur":this.registerIncoming("blur",r,o=>{n(this._wrapBlur(o))})}}_wrapFocus(e){return{type:"focus",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:i=>e.async(i),preventDefault:()=>e.preventDefault()}}_wrapBlur(e){return{type:"blur",timestamp:e.timestamp,native:e.data.native,cancelable:e.cancelable,stopPropagation:()=>e.stopPropagation(),async:i=>e.async(i),preventDefault:()=>e.preventDefault()}}_wrapClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:l,eventId:c}=e.data,{cancelable:f,timestamp:_}=e;return{type:"click",pointerType:i,button:r,buttons:n,x:s,y:o,native:l,timestamp:_,screenPoint:Ku(s,o),mapPoint:this._getMapPoint(s,o),eventId:c,cancelable:f,stopPropagation:()=>e.stopPropagation(),async:x=>e.async(x),preventDefault:()=>e.preventDefault()}}_wrapDoubleClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:l,eventId:c}=e.data,{cancelable:f,timestamp:_}=e;return{type:"double-click",pointerType:i,button:r,buttons:n,x:s,y:o,native:l,timestamp:_,mapPoint:this._getMapPoint(s,o),eventId:c,cancelable:f,stopPropagation:()=>e.stopPropagation(),async:x=>e.async(x),preventDefault:()=>e.preventDefault()}}_wrapImmediateClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:l,eventId:c}=e.data,f=l.pointerId,{cancelable:_,timestamp:x}=e;return{type:"immediate-click",pointerId:f,pointerType:i,button:r,buttons:n,x:s,y:o,native:l,timestamp:x,mapPoint:this._getMapPoint(s,o),eventId:c,cancelable:_,stopPropagation:()=>e.stopPropagation(),async:T=>e.async(T),preventDefault:()=>e.preventDefault()}}_wrapImmediateDoubleClick(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:l,eventId:c}=e.data,f=l.pointerId,{cancelable:_,timestamp:x}=e;return{type:"immediate-double-click",pointerId:f,pointerType:i,button:r,buttons:n,x:s,y:o,native:l,timestamp:x,mapPoint:this._getMapPoint(s,o),eventId:c,cancelable:_,stopPropagation:()=>e.stopPropagation(),async:T=>e.async(T),preventDefault:()=>e.preventDefault()}}_wrapHold(e){const{pointerType:i,button:r,buttons:n,x:s,y:o,native:l}=e.data,{cancelable:c,timestamp:f}=e;return{type:"hold",pointerType:i,button:r,buttons:n,x:s,y:o,native:l,timestamp:f,mapPoint:this._getMapPoint(s,o),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:_=>e.async(_),preventDefault:()=>e.preventDefault()}}_getMapPoint(e,i){return this.view.toMap(Ku(e,i),{exclude:[]})}_wrapDrag(e){const i=e.data,{x:r,y:n}=i.center,{action:s,pointerType:o,button:l}=i;if(s==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const c=i.pointer.native,f=i.buttons,{cancelable:_,timestamp:x}=e,T={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:r,y:n,origin:T,pointerType:o,button:l,buttons:f,radius:i.radius,angle:pu(i.angle),native:c,timestamp:x,cancelable:_,stopPropagation:()=>e.stopPropagation(),async:A=>e.async(A),preventDefault:()=>e.preventDefault()}}_wrapKeyDown(e){const{key:i,repeat:r,native:n}=e.data,{cancelable:s,timestamp:o}=e;return{type:"key-down",key:i,repeat:r,native:n,timestamp:o,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:l=>e.async(l),preventDefault:()=>e.preventDefault()}}_wrapKeyUp(e){const{key:i,native:r}=e.data,{cancelable:n,timestamp:s}=e;return{type:"key-up",key:i,native:r,timestamp:s,cancelable:n,stopPropagation:()=>e.stopPropagation(),async:o=>e.async(o),preventDefault:()=>e.preventDefault()}}_wrapPointer(e,i){const{x:r,y:n,button:s,buttons:o,native:l,eventId:c}=e.data,f=l.pointerId,_=l.pointerType,{cancelable:x,timestamp:T}=e;return{type:i,x:r,y:n,pointerId:f,pointerType:_,button:s,buttons:o,native:l,timestamp:T,eventId:c,cancelable:x,stopPropagation:()=>e.stopPropagation(),async:A=>e.async(A),preventDefault:()=>e.preventDefault()}}_wrapPointerDrag(e){const{x:i,y:r,buttons:n,native:s,eventId:o}=e.data.currentEvent,{button:l}=e.data.startEvent,c=e.data.startEvent.native.pointerId,f=e.data.startEvent.native.pointerType,_=e.data.action,x={x:e.data.startEvent.x,y:e.data.startEvent.y},{cancelable:T,timestamp:A}=e;return{type:"pointer-drag",x:i,y:r,pointerId:c,pointerType:f,button:l,buttons:n,action:_,origin:x,native:s,timestamp:A,eventId:o,cancelable:T,stopPropagation:()=>e.stopPropagation(),async:M=>e.async(M),preventDefault:()=>e.preventDefault()}}_wrapMouseWheel(e){const{cancelable:i,data:r,timestamp:n}=e,{x:s,y:o,deltaY:l,native:c}=r;return{type:"mouse-wheel",x:s,y:o,deltaY:l,native:c,timestamp:n,cancelable:i,stopPropagation:()=>e.stopPropagation(),async:f=>e.async(f),preventDefault:()=>e.preventDefault()}}_wrapGamepad(e){const{action:i,state:r,device:n}=e.data,{cancelable:s,timestamp:o}=e,{buttons:l,axes:c}=r;return{type:"gamepad",device:n,timestamp:o,action:i,buttons:l,axes:c,cancelable:s,stopPropagation:()=>e.stopPropagation(),async:f=>e.async(f),preventDefault:()=>e.preventDefault()}}};var CL,tme,ime;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(CL||(CL={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(tme||(tme={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(ime||(ime={}));function wmt(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return Ce.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Eee(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(CL.USER)&&t.getEditableFlag(CL.MANAGER)}function sf(t){return Ku(t.x,t.y)}function fti(t){return ss(t.x,t.y)}function xIe(t,e){var r;const i=(r=t instanceof HTMLElement?t:t.surface)==null?void 0:r.getBoundingClientRect();return i?Ku(e.clientX-i.left,e.clientY-i.top):Ku(0,0)}function rme(t,e){return e instanceof Event?xIe(t,e):sf(e)}function nme(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}let xmt=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(e,i){const r=()=>e.stopPropagation();switch(e.type){case"pointer-move":sme(e.pointerType)&&this._pointerLocations.set(e.pointerId,{x:e.x,y:e.y,pointerType:e.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(r(),e.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!ome(e))break;const n=sf(e),s=this._intersect(n,e.pointerType,i.forEachTool);if(s==null)break;const o=s.manipulator,l=s.tool;o==null||l==null||!o.interactive||o.grabbable&&o.grabbableForEvent(e)||!o.grabbing||o.dragging||this._ungrabManipulatorBeforeDragging(o,e,i),o!=null&&l!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(e)&&!o.grabbing&&(this._grabbedManipulators.set(e.pointerId,{manipulator:o,tool:l,start:n,pointerType:e.pointerType}),this._grabbedManipulators.size===1&&i.activeTool==null&&(this._revertToNullActiveTool=!0,i.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:e.pointerType,screenPoint:n}),r());break}case"pointer-up":this._draggedManipulators.has(e.pointerId)||this._handlePointerEnd(e,i);break;case"pointer-drag":{if(!ome(e))break;const n=this._grabbedManipulators.get(e.pointerId),s=n==null?void 0:n.manipulator,o=n==null?void 0:n.tool;if(s==null||o==null)break;const l=sf(e);l.x=Je(l.x,0,i.view.width),l.y=Je(l.y,0,i.view.height);const c=n.start,f=this._draggedManipulators.get(e.pointerId);switch(e.action){case"start":case"update":e.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,f?s.events.emit("drag",{action:"update",start:c,screenPoint:l}):s.events.emit("drag",{action:"start",start:c,screenPoint:l,pointerType:e.pointerType}),this._draggedManipulators.set(e.pointerId,{tool:o,manipulator:s,start:c}));break;case"end":s.dragging=!1,f&&s.events.emit("drag",{action:"end",start:c,screenPoint:l}),this._draggedManipulators.delete(e.pointerId),this._handlePointerEnd(e,i)}r();break}case"immediate-click":{const n=sf(e),s=this._intersect(n,e.pointerType,i.forEachTool);if(Smt(e)||i.forEachTool(f=>{if((s==null||s.tool!==f||f.automaticManipulatorSelection)&&f.manipulators){let _=!1;f.manipulators.forEach(({manipulator:x})=>{x.selected&&(x.selected=!1,_=!0)}),_&&f.onManipulatorSelectionChanged&&f.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:l}=s;if(!o.interactive)break;o.selectable&&l.automaticManipulatorSelection&&(o.selected=!o.selected,l.onManipulatorSelectionChanged&&l.onManipulatorSelectionChanged());const c=e.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:c,stopPropagation:r}),rq(o,r);break}case"click":{const n=sf(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=s==null?void 0:s.manipulator;if(o==null||!o.interactive)break;const l=e.native.shiftKey;o.events.emit(e.type,{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:l}),r();break}case"double-click":{const n=sf(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const l=e.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:r}),rq(o,r);break}case"immediate-double-click":{const n=sf(e),s=this._intersect(n,e.pointerType,i.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const l=e.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:e.button,pointerType:e.pointerType,shiftKey:l,stopPropagation:r}),rq(o,r);break}}this._onFocusChange(i.forEachTool)}_ungrabManipulatorBeforeDragging(e,i,r){e.grabbing=!1,e.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:sf(i)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===e&&this._grabbedManipulators.delete(s)}),this._afterManipulatorUngrab(r.setActiveTool)}_handlePointerEnd(e,i){var n;const r=(n=this._grabbedManipulators.get(e.pointerId))==null?void 0:n.manipulator;r!=null&&r.grabbing&&(r.grabbing=!1,r.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:sf(e)}),this._grabbedManipulators.delete(e.pointerId),this._afterManipulatorUngrab(i.setActiveTool))}_cursorFromMap(e){let i=null;return rp(e,({manipulator:r})=>!(r==null||!r.interactive)&&(r.grabbing&&r.grabCursor?(i=r.grabCursor,!0):!!r.cursor&&(i=r.cursor,!0))),i}_onFocusChange(e){this._updateCursor(),this._updateFocusedManipulatorTools(e)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(e){const i=new Set,r=new Set;this._grabbedManipulators.forEach(({tool:n})=>{i.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{r.add(n)}),e(n=>{n.hasGrabbedManipulators=i.has(n),n.hasHoveredManipulators=r.has(n);const s=this._grabbedManipulators.values(),o=bje(s,({tool:l})=>l===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(e,{forEachTool:i,setActiveTool:r},n=!0,s){const o=(l,c)=>l===e&&(s==null||s===c);this._grabbedManipulators.forEach(({tool:l,manipulator:c,pointerType:f},_)=>{o(l,c)&&(this._grabbedManipulators.delete(_),c.grabbing=!1,c.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:f}))}),this._draggedManipulators.forEach(({tool:l,manipulator:c},f)=>{o(l,c)&&(this._draggedManipulators.delete(f),c.dragging=!1,c.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:l,manipulator:c},f)=>{o(l,c)&&(this._hoveredManipulators.delete(f),c.hovering=!1)}),this._afterManipulatorUngrab(r),this._onFocusChange(i)}_intersect(e,i,r){let n=null;return r(s=>{if(s.manipulators==null||!Eee(s))return!1;const o=s.manipulators.intersect(e,i);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}updateHoveredStateFromKnownPointers(e){this._pointerLocations.forEach((i,r)=>{this._updateHoveredStateForPointerAtScreenPosition(Ku(i.x,i.y),r,i.pointerType,e)})}handleHoverEvent(e,i){e.type!=="pointer-up"&&e.type!=="immediate-click"&&e.type!=="pointer-move"||!sme(e.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(sf(e),e.pointerId,e.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(e,i,r,n){var l;let s=this._intersect(e,r,n);const o=(l=this._hoveredManipulators.get(i))==null?void 0:l.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(i,s)):this._hoveredManipulators.delete(i),this._onFocusChange(n))}_afterManipulatorUngrab(e){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(e(null),this._revertToNullActiveTool=!1)}};function sme(t){return t==="mouse"}function ome(t){return t.pointerType!=="mouse"||t.button===0}function Smt(t){return!!t.native.shiftKey}function rq(t,e){t!=null&&t.consumesClicks&&e()}const ame="attached",nq="tools",lme=1e3;let Pg=class extends ze{constructor(e){super(e),this._updatingHandles=new Rf,this._clock=m9,this._manipulatorState=new xmt,this.tools=new it,this.cursor=null,this._interacting=!1,this._interactingTimeout=lme,this._interactingTimeoutHandle=null,this._forEachTool=i=>{for(const r of this.tools.items)if(i(r))return}}initialize(){this.addHandles([this.view.on(_Ie,e=>{this._handleInputEvent(e)},Es.TOOL),...wmt(this.tools),this.tools.on("before-add",({item:e})=>{this._updateToolEditableFlag(e)}),this.tools.on("before-remove",({item:e})=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(e=>e.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(e!=null&&!this.view.ready)return void Ce.getLogger(this).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const i=this.activeTool;this._set("activeTool",e),i!=null&&i.deactivate(),e!=null&&e.activate(),this._removeIncompleteTools(e);for(const r of this.tools){this._updateToolEditableFlag(r);const n=Eee(r);this.activeTool!=null&&n||this._manipulatorState.clearPointers(r,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(e=>e.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=en(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){var e;this.view.type==="3d"?this.addHandles([_e(()=>{const{state:i}=this.view;return"camera"in i&&i.camera},()=>this._forEachManipulator(i=>i.onViewChange())),(e=this.view.elevationProvider)==null?void 0:e.on("elevation-change",i=>this._forEachManipulator(r=>r.onElevationChange(i)))],ame):this.addHandles(_e(()=>this.view.extent,()=>this._forEachManipulator(i=>i.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ame),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(e){this._forEachTool(i=>{i.manipulators&&i.manipulators.forEach(({manipulator:r})=>e(r,i))})}_handleInputEvent(e){let i=!1;const r={...e,stopPropagation:()=>{i=!0,e.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(r):this._forEachTool(n=>{!i&&n.visible&&n.handleInputEvent(r)}),!i&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(r,this._manipulatorStateEventArgs),i||this.activeTool==null||this.activeTool.handleInputEventAfter(r),this._manipulatorState.handleHoverEvent(r,this._forEachTool),this._updateCursor(),e.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(nq),this._forEachTool(e=>{if(e instanceof ze){const i=_e(()=>[e.cursor,e.visible,e.editable],()=>{Eee(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(i,nq)}e.manipulators&&this.addHandles([e.manipulators.on("after-remove",i=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,i.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],nq)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){var i;(i=e.setEditableFlag)==null||i.call(e,CL.MANAGER,this.activeTool==null||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;e==null&&this._forEachTool(i=>!(i.cursor==null||!i.visible)&&(e=i.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(i=>(e==null||i!==e)&&!i.created&&i.removeIncompleteOnCancel).forEach(i=>{this.tools.remove(i)})}get test(){const e=this;return{setClock:i=>this._clock=i,set interactingTimeoutEnabled(i){e._interactingTimeout=i?lme:0},get interactingTimeoutEnabled(){return e._interactingTimeout!==0}}}};y([w({constructOnly:!0,nonNullable:!0})],Pg.prototype,"view",void 0),y([w({value:null})],Pg.prototype,"activeTool",null),y([w({readOnly:!0,type:it})],Pg.prototype,"tools",void 0),y([w({readOnly:!0})],Pg.prototype,"cursor",void 0),y([w({readOnly:!0})],Pg.prototype,"updating",null),y([w()],Pg.prototype,"_interacting",void 0),y([w({readOnly:!0})],Pg.prototype,"interacting",null),Pg=y([Z("esri.views.ToolViewManager")],Pg);let NA=class extends ze{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":Tmt.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexPromise.resolve().then(()=>n4t),void 0).then(e=>Cee=e)),await sq,St(t)}async function EIe(t,e,i,r){if(!t)return null;const n=t.spatialReference;return ox()||th(n,e)?rl(t,e):Cee?Cee.projectGeometry(t,e,i,r):(await Promise.race([Mmt(r),g_(r)]),EIe(t,e,i,r))}let us=class extends ze{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=gn(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return this.userSpatialReference!=null?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){var r,n,s,o;const e=(r=this.map)==null?void 0:r.call(this),i=[];return this.priorityCollection!=null&&i.push(this.priorityCollection),i.push({parent:e==null?void 0:e.basemap,layers:(n=e==null?void 0:e.basemap)==null?void 0:n.baseLayers},{layers:e==null?void 0:e.layers},{parent:e==null?void 0:e.ground,layers:(s=e==null?void 0:e.ground)==null?void 0:s.layers},{parent:e==null?void 0:e.basemap,layers:(o=e==null?void 0:e.basemap)==null?void 0:o.referenceLayers}),i}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};const{layers:e,updating:i}=this._allLayers;let r=null;for(const s of e){const o=this._getSupportedSpatialReferences(s);if(o.length>0){const l=this._narrowDownSpatialReferenceCandidates(r,o);l!=null&&(r=l)}if(r!=null&&r.length===1)break}if(i&&(r==null||r.length!==1))return{updating:!0};const n=this._pickSpatialReferenceCandidate(r);return{spatialReference:n!=null?n.spatialReference:null,viewingMode:n!=null?n.viewingMode:null,updating:!1}}get _tileInfoTask(){var r,n,s,o,l,c,f;if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:i}=this._collectLayers([{parent:(n=(r=this.map)==null?void 0:r.call(this))==null?void 0:n.basemap,layers:(l=(o=(s=this.map)==null?void 0:s.call(this))==null?void 0:o.basemap)==null?void 0:l.baseLayers},{layers:(f=(c=this.map)==null?void 0:c.call(this))==null?void 0:f.layers}]);if(e&&e.length>0&&"tileInfo"in e[0]){const _=e[0].tileInfo;return{tileInfo:_&&_.spatialReference.equals(this.spatialReference)?_:null,updating:!1}}return{updating:i}}get _heightModelInfoTask(){var r,n,s;if(!this.required.heightModelInfo||this.suspended&&((r=this._get("_heightModelInfoTask"))!=null&&r.heightModelInfo))return this._get("_heightModelInfoTask")??{updating:!1};const{layers:e,updating:i}=this._allLayers;for(const o of e)if(Kdt(o)){const l=qRe(o);if(l)return{heightModelInfo:l,vcsWkid:(n=o.spatialReference)==null?void 0:n.vcsWkid,latestVcsWkid:(s=o.spatialReference)==null?void 0:s.latestVcsWkid,updating:!1}}return{updating:i}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,i=e.updating,r=[];for(const n of e.layers){const s="fullExtents"in n&&n.fullExtents||(n.fullExtent!=null?[n.fullExtent]:[]),o=this.requiresExtentInSpatialReference?null:s[0],l=s.find(c=>c.spatialReference.equals(this.spatialReference))??o;if(l)return{candidates:[{extent:l,layer:n}],updating:!1};if(this._getSupportedSpatialReferences(n).length>0)for(const c of s)r.push({extent:c,layer:n})}return{candidates:r,updating:i}}get _extentTask(){const{candidates:e,updating:i}=this._extentCandidatesTask;if(i)return{updating:i};if(e==null||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const r=this._pickExtentCandidate(e),n=this.spatialReference;return r.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=gn(this._projectExtentTask.task)),this._projectExtentTask={input:r.extent.clone(),output:null,spatialReference:n.clone(),task:Cc(async s=>{try{const o=await EIe(r.extent,n,"portalItem"in r.layer?r.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(xo(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,i){if(e==null)return i;const r=[],n=(s,o)=>s!=null?o!=null?s===o&&s:s:o;for(const s of e)for(const o of i){if(!s.spatialReference.equals(o.spatialReference))continue;const l=n(s.viewingMode,o.viewingMode);if(l!==!1){r.push({spatialReference:s.spatialReference,viewingMode:l});break}}return r.length>0?r:null}_pickSpatialReferenceCandidate(e){const i=this.defaultSpatialReference;return e==null||e.length<1?i!=null?{spatialReference:i,viewingMode:null}:null:(i!=null&&e.length>1&&e.some(({spatialReference:r})=>r.equals(i))&&(e=e.filter(({spatialReference:r})=>r.equals(i))),e.length>1&&e.some(({viewingMode:r})=>r!==_t.Local)&&(e=e.filter(({viewingMode:r})=>r!==_t.Local)),e[0])}_getSupportedSpatialReferences(e){const i="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(i.length===0)return[];const r=[];for(const n of i){const s=this.getSpatialReferenceSupport({spatialReference:n,layer:e});if(s!=null){const o=s.constraints!=null?s.constraints:[{spatialReference:n,viewingMode:null}];for(const{spatialReference:l,viewingMode:c}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!l.equals(this.userSpatialReference)||r.push({spatialReference:l,viewingMode:c})}}return r}_pickExtentCandidate(e){const i=this.spatialReference;return e.find(({extent:r})=>i.equals(r.spatialReference))||e[0]}_collectLayers(e){var r;if(this._loadMaybe((r=this.map)==null?void 0:r.call(this))!=="loaded")return{layers:[],updating:!0};const i=new Omt;for(const n of e)if(this._collectCollection(n,i),i.preloading===this.sourcePreloadCount)break;return{layers:i.layers,updating:i.updating}}_collectCollection(e,i){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return i.updating=!0,void++i.preloading;case"failed":return}for(const r of e.layers){switch(this._loadMaybe(r)){case"failed":continue;case"loading":i.updating=!0,++i.preloading;break;case"loaded":i.updating||i.layers.push(r),"layers"in r&&this._collectCollection({layers:r.layers},i)}if(i.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e&&e.loadStatus!=null?e.loadStatus==="not-loaded"?(e.load().catch(i=>{sn(i)||console.log(i)}),"loading"):e.loadStatus:"loaded"}};y([w()],us.prototype,"required",void 0),y([w({constructOnly:!0})],us.prototype,"map",void 0),y([w({constructOnly:!0})],us.prototype,"getSpatialReferenceSupport",void 0),y([w()],us.prototype,"defaultSpatialReference",void 0),y([w()],us.prototype,"userSpatialReference",void 0),y([w()],us.prototype,"sourcePreloadCount",void 0),y([w()],us.prototype,"priorityCollection",void 0),y([w()],us.prototype,"requiresExtentInSpatialReference",void 0),y([w()],us.prototype,"suspended",void 0),y([w({readOnly:!0})],us.prototype,"ready",null),y([w({readOnly:!0})],us.prototype,"heightModelInfoReady",null),y([w({readOnly:!0})],us.prototype,"spatialReference",null),y([w({readOnly:!0})],us.prototype,"extent",null),y([w({readOnly:!0})],us.prototype,"heightModelInfo",null),y([w({readOnly:!0})],us.prototype,"vcsWkid",null),y([w({readOnly:!0})],us.prototype,"latestVcsWkid",null),y([w({readOnly:!0})],us.prototype,"viewingMode",null),y([w({readOnly:!0})],us.prototype,"tileInfo",null),y([w({readOnly:!0})],us.prototype,"mapCollections",null),y([w({readOnly:!0})],us.prototype,"_allLayers",null),y([w({readOnly:!0})],us.prototype,"_spatialReferenceTask",null),y([w({readOnly:!0})],us.prototype,"_tileInfoTask",null),y([w({readOnly:!0})],us.prototype,"_heightModelInfoTask",null),y([w({readOnly:!0})],us.prototype,"_extentCandidatesTask",null),y([w()],us.prototype,"_extentTask",null),y([w()],us.prototype,"_projectExtentTask",void 0),us=y([Z("esri.views.support.DefaultsFromMap")],us);let Omt=class{constructor(){this.layers=new Array,this.preloading=-1,this.updating=!1}};var K4;let gi=K4=class extends Dn.EventedMixin(S9(ze)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new O_,this.updatingHandles=new Rf,this.allLayerViews=new GT({getCollections:()=>{var e,i,r;return[(e=this.basemapView)==null?void 0:e.baseLayerViews,(i=this.groundView)==null?void 0:i.layerViews,this.layerViews,(r=this.basemapView)==null?void 0:r.referenceLayerViews]},getChildrenFunction:Rmt}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new dT,this.analyses=new y5,this.typeSpecificPreconditionsReady=!0,this.layerViews=new it,this.magnifier=new vIe,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new Amt,this.navigation=new TIe,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new _mt(this),this.persistableViewModels=new it,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this.theme=null,this.handles.add(_e(()=>this.preconditionsReady,e=>{var i,r;e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,K4.views.add(this)):(this._lockedSpatialReference=null,K4.views.remove(this)),this.notifyChange("spatialReference"),!e&&this.ready?((i=this.toolViewManager)==null||i.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),(r=this.layerViewManager)==null||r.clear(),this._teardown()):e&&!this.ready&&(this._startup(),this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach())},Li))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,rd(()=>this.ready)))),this.basemapView=new aw({view:this}),this.layerViewManager=new gmt({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new Pg({view:this}),this._setupSpatialReferenceLogger(),this.addHandles([_e(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},{sync:!0,initial:!0}),_e(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},{sync:!0}),_e(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([_e(()=>{var e;return(e=this.defaultsFromMap)==null?void 0:e.ready},e=>{var r;const i=((r=this.map)==null?void 0:r.allLayers.length)>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=rr(()=>t=gn(t));t=Cc(async s=>{try{await T2(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}Ce.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){var t,e;this.destroyed||(K4.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=et(this.graphics),this.analyses=et(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),et(this.analysisViewManager),this.toolViewManager=et(this.toolViewManager),this.layerViewManager=et(this.layerViewManager),this.basemapView=et(this.basemapView),(t=this.groundView)==null||t.destroy(),(e=this.layerViews)==null||e.forEach(i=>i.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=et(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return Ce.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){var t;return(t=this.toolViewManager)==null?void 0:t.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new us({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:t=>this.getSpatialReferenceSupport(t),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){var t;return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||jf.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!((t=this.defaultsFromMap)!=null&&t.ready)||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t!=null&&t.destroyed&&(Ce.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),jf.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){var e,i;let t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;return t&&((i=(e=this.defaultsFromMap)==null?void 0:e.required)!=null&&i.heightModelInfo)&&(t=t.clone(),t.vcsWkid=this.defaultsFromMap.vcsWkid,t.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),t}set spatialReference(t){const e=!Zn(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??Uy}set timeZone(t){const e=new Set(["etc/utc","etc/gmt","gmt"]),i=new Set(Intl.supportedValuesOf("timeZone").map(r=>r.toLowerCase()));this._userTimeZone=t,t===Uy||t===OT||e.has(t.toLowerCase())||i.has(t.toLowerCase())||Ce.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){var t;return(t=this.toolViewManager)==null?void 0:t.tools}get initialExtent(){var t;return(t=this.defaultsFromMap)==null?void 0:t.extent}get cursor(){var t;return((t=this.toolViewManager)==null?void 0:t.cursor)??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Tee}whenLayerView(t){var e;return((e=this.layerViewManager)==null?void 0:e.whenLayerView(t))??Promise.reject()}getDefaultSpatialReference(){var t;return(t=this.defaultsFromMap)==null?void 0:t.spatialReference}getDefaultHeightModelInfo(){var t;return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??((t=this.defaultsFromMap)==null?void 0:t.heightModelInfo)??null}getDefaultTimeZone(){return null}importLayerView(t){throw new se("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport({spatialReference:t})!=null}when(t,e){return this.isResolved()&&!this.ready&&Ce.getLogger(this).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(t,e)}forceReadyCycle(){this.ready&&(Mo(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};gi.views=new it,y([w()],gi.prototype,"_userSpatialReference",void 0),y([w()],gi.prototype,"activeTool",null),y([w({readOnly:!0})],gi.prototype,"allLayerViews",void 0),y([w()],gi.prototype,"groundView",void 0),y([w()],gi.prototype,"animation",null),y([w()],gi.prototype,"basemapView",void 0),y([w()],gi.prototype,"center",null),y([w({readOnly:!0})],gi.prototype,"_defaultsFromMapSettings",null),y([w()],gi.prototype,"defaultsFromMap",null),y([w()],gi.prototype,"fatalError",void 0),y([w({type:Vi})],gi.prototype,"extent",null),y([w(Pz(dT,"graphics"))],gi.prototype,"graphics",void 0),y([w(Pz(y5,"analyses"))],gi.prototype,"analyses",void 0),y([w({readOnly:!0,type:N_})],gi.prototype,"heightModelInfo",null),y([w({readOnly:!0})],gi.prototype,"interacting",null),y([w({readOnly:!0})],gi.prototype,"navigating",null),y([w({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],gi.prototype,"preconditionsReady",null),y([w({readOnly:!0})],gi.prototype,"typeSpecificPreconditionsReady",void 0),y([w({type:it,readOnly:!0})],gi.prototype,"layerViews",void 0),y([w()],gi.prototype,"resolution",null),y([w({type:vIe})],gi.prototype,"magnifier",void 0),y([w({value:null,type:HRe})],gi.prototype,"map",null),y([w()],gi.prototype,"padding",void 0),y([w({readOnly:!0})],gi.prototype,"ready",void 0),y([w({type:at})],gi.prototype,"spatialReference",null),y([w()],gi.prototype,"spatialReferenceWarningDelay",void 0),y([w()],gi.prototype,"stationary",null),y([w({readOnly:!0})],gi.prototype,"supportsGround",void 0),y([w({type:D_})],gi.prototype,"timeExtent",void 0),y([w({type:String,nonNullable:!0})],gi.prototype,"timeZone",null),y([w()],gi.prototype,"tools",null),y([w()],gi.prototype,"toolViewManager",void 0),y([w({readOnly:!0})],gi.prototype,"type",void 0),y([w({type:Number})],gi.prototype,"scale",void 0),y([w({readOnly:!0})],gi.prototype,"updating",void 0),y([w({readOnly:!0})],gi.prototype,"initialExtentRequired",void 0),y([w({readOnly:!0})],gi.prototype,"initialExtent",null),y([w()],gi.prototype,"cursor",null),y([w({readOnly:!0})],gi.prototype,"input",void 0),y([w({type:TIe,nonNullable:!0})],gi.prototype,"navigation",void 0),y([w()],gi.prototype,"layerViewManager",void 0),y([w()],gi.prototype,"analysisViewManager",void 0),y([w()],gi.prototype,"width",void 0),y([w()],gi.prototype,"height",void 0),y([w({readOnly:!0})],gi.prototype,"resizing",void 0),y([w({value:null,readOnly:!0})],gi.prototype,"size",null),y([w({readOnly:!0})],gi.prototype,"suspended",void 0),y([w({readOnly:!0})],gi.prototype,"viewEvents",void 0),y([w({readOnly:!0})],gi.prototype,"persistableViewModels",void 0),y([w()],gi.prototype,"_isValid",void 0),y([w()],gi.prototype,"_readyCycleForced",void 0),y([w()],gi.prototype,"_lockedSpatialReference",void 0),y([w()],gi.prototype,"_userTimeZone",void 0),y([w()],gi.prototype,"_lockedTimeZone",void 0),y([w({type:Tee})],gi.prototype,"theme",void 0),y([w({readOnly:!0,type:Tee})],gi.prototype,"effectiveTheme",null),gi=K4=y([Z("esri.views.View")],gi);const Pmt=gi;function Rmt(t){return t.layerViews}let cw=class extends uz{constructor(e){super(e),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=Jl(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),(e=this._resolver)==null||e.reject(new se("ViewAnimation stopped")))}finish(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),(e=this._resolver)==null||e.resolve())}update(e,i){i||(i=pd(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",i)}};y([w({readOnly:!0})],cw.prototype,"done",null),y([w({readOnly:!0,type:String})],cw.prototype,"state",void 0),y([w()],cw.prototype,"target",void 0),cw=y([Z("esri.views.ViewAnimation")],cw),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(cw||(cw={}));const b5=cw,sR=()=>we(()=>import("./TileLayerView3D-5Hf3FIEh.js"),__vite__mapDeps([160,161,162,163,164,165,13])),cme=()=>we(()=>import("./ElevationLayerView3D-aDJhr4Zv.js"),__vite__mapDeps([166,161,162,163])),ume={"base-dynamic":()=>we(()=>import("./BaseDynamicLayerView3D-aiAW9HKo.js"),__vite__mapDeps([167,168,161,169,170,163,164])),"base-elevation":cme,"base-tile":sR,"bing-maps":sR,"building-scene":()=>we(()=>import("./BuildingSceneLayerView3D-jychJ4lg.js"),__vite__mapDeps([171,63,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,39,40,172,173,150,159,174,175,176,177,178,8,179,42,180,95,90,91,92,93,66,94,73,88,89,169,161,75,76,77,181,163,164,84,149,182,183])),csv:()=>we(()=>import("./CSVLayerView3D-t0wtEtZq.js"),__vite__mapDeps([184,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,75,76,77,52,181,56,163,164])),dimension:()=>we(()=>import("./DimensionLayerView3D-sKnmIRMF.js"),__vite__mapDeps([185,161,163])),elevation:cme,feature:()=>we(()=>import("./FeatureLayerView3D-t6NDkLO0.js"),__vite__mapDeps([176,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,75,76,77,52,181,56,163,164])),geojson:()=>we(()=>import("./GeoJSONLayerView3D-4MSCbPJp.js"),__vite__mapDeps([186,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,75,76,77,52,181,56,163,164])),graphics:()=>we(()=>import("./GraphicsLayerView3D-TqJxY2EU.js"),__vite__mapDeps([187,161,179,188,180,95,90,91,169,163])),group:()=>we(()=>import("./GroupLayerView-do80uFuS.js"),__vite__mapDeps([189,163])),imagery:()=>we(()=>import("./ImageryLayerView3D-Ajt9-b41.js"),__vite__mapDeps([190,168,161,169,170,163,164])),"integrated-mesh":()=>we(()=>import("./IntegratedMeshLayerView3D-EW3nzBgf.js"),__vite__mapDeps([191,172,173,150,159,174,175,53,176,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,88,89,169,161,75,76,77,52,181,56,163,164,84,149])),"line-of-sight":()=>we(()=>import("./LineOfSightLayerView3D-rUjgrEFl.js"),__vite__mapDeps([192,161,163])),"map-image":()=>we(()=>import("./MapImageLayerView3D-GIO-oWiM.js"),__vite__mapDeps([193,168,161,169,170,163,164,165,13])),media:()=>we(()=>import("./MediaLayerView3D-CIdxGOiQ.js"),__vite__mapDeps([194,103,104,161,170,163])),"ogc-feature":()=>we(()=>import("./OGCFeatureLayerView3D-FLI41Ca4.js"),__vite__mapDeps([195,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,75,76,77,52,181,56,163,164])),"open-street-map":sR,"oriented-imagery":()=>we(()=>import("./FeatureLayerView3D-t6NDkLO0.js"),__vite__mapDeps([176,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,75,76,77,52,181,56,163,164])),"point-cloud":()=>we(()=>import("./PointCloudLayerView3D-KHREaqUZ.js"),__vite__mapDeps([196,161,147,113,197,163])),voxel:()=>we(()=>import("./VoxelLayerView3D-FruX8zyo.js"),__vite__mapDeps([198,161,197,163])),route:()=>we(()=>import("./RouteLayerView3D-tOy-WtTD.js"),__vite__mapDeps([199,115,161,188,180,95,90,91,169,181,163])),scene:t=>t.profile==null||t.profile==="mesh-pyramids"?we(()=>import("./SceneLayerView3D-7NpyxR5M.js"),__vite__mapDeps([200,159,39,40,172,173,150,174,175,53,176,177,178,8,179,42,180,95,90,91,92,93,66,94,73,88,89,169,161,75,76,77,52,181,56,163,164,84,149,201,183,182,197])):we(()=>import("./SceneLayerGraphicsView3D-Abn6jwJk.js"),__vite__mapDeps([202,173,150,159,174,175,53,176,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,88,89,169,161,75,76,77,52,181,56,163,164,201,183,197])),stream:()=>we(()=>import("./StreamLayerView3D-nu_wqFzJ.js"),__vite__mapDeps([203,141,143,75,76,77,52,181,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,163])),tile:sR,"imagery-tile":()=>we(()=>import("./ImageryTileLayerView3D-kyd0hRhY.js"),__vite__mapDeps([204,81,161,162,163,164,13])),"vector-tile":()=>we(()=>import("./VectorTileLayerView3D-eexSRj3E.js"),__vite__mapDeps([205,153,77,206,19,122,144,145,207,120,121,161,162,163])),wcs:()=>we(()=>import("./ImageryTileLayerView3D-kyd0hRhY.js"),__vite__mapDeps([204,81,161,162,163,164,13])),"web-tile":sR,wfs:()=>we(()=>import("./WFSLayerView3D-OjHmKjv_.js"),__vite__mapDeps([208,177,178,8,179,42,180,95,90,91,92,39,40,93,66,94,73,53,88,89,169,161,75,76,77,52,181,56,163,164])),wms:()=>we(()=>import("./WMSLayerView3D-HO_hwLwX.js"),__vite__mapDeps([209,168,161,169,170,163,164])),wmts:()=>we(()=>import("./WMTSLayerView3D-oO1etwl-.js"),__vite__mapDeps([210,161,162,163,164])),"geo-rss":null,kml:null,"knowledge-graph":null,"link-chart":null,"knowledge-graph-sublayer":null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null,video:null};function Imt(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new se(`${i}:view-not-supported`,`${e} is not supported in 3D`)}const hme={hasLayerViewModule:t=>ume[t.type]!=null,importLayerView:t=>{const e=ume[t.type];if(e==null)throw Imt(t);return e(t)}},dme="analyses-owner-handles";var RM,PS;(function(t){t[t.PENDING=0]="PENDING",t[t.CREATED=1]="CREATED"})(RM||(RM={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED"}(PS||(PS={}));let H3=class extends ze{constructor(e){super(e),this._allAnalysisViews=new it,this._creatingViewCount=0,this._items=new Map,this._scheduledUpdateHandle=null,this._attachedToViewResolver=pme(),this._analysisModules={"area-measurement":{module:null},dimension:{module:null},"direct-line-measurement":{module:null},"line-of-sight":{module:null},slice:{module:null}}}destroy(){this._disconnectOwners(),this._attachedToViewResolver.reject(ur("AnalysisViewManager was destroyed"))}attach(){this._connectOwners(),this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners(),this._attachedToViewResolver.reject(ur()),this._attachedToViewResolver=pme()}get updating(){return!this.view.ready||this._creatingViewCount!==0||this._allAnalysisViews.some(e=>e.updating)}get testInfo(){return{allAnalysisViews:this._allAnalysisViews}}async whenAnalysisView(e){await this._attachedToViewResolver.promise;const i=this._items.get(e);if(i==null||i.state.list===PS.REMOVED)throw new se("AnalysisViewManager:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});return i.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses),dme)}_disconnectOwners(){this.removeHandles(dme),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const n of e)this._addAnalysis(n);const i=e.on("after-add",n=>this._addAnalysis(n.item)),r=e.on("after-remove",n=>this._removeAnalysis(n.item));return rr(()=>{i.remove(),r.remove();for(const n of e)this._removeAnalysis(n)})}_addAnalysis(e){const i=this._items.get(e);if(i==null){const r={state:{view:RM.PENDING,list:PS.ADDED},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,r),r.createAnalysisViewTask=Cc(n=>this._createAnalysisViewPromise(r,n))}else i.state.list=PS.ADDED}_removeAnalysis(e){const i=this._items.get(e);i!=null?(i.state.list=PS.REMOVED,this._scheduleUpdate()):Ce.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){this._scheduledUpdateHandle==null&&(this._scheduledUpdateHandle=tx(()=>this._update()))}_update(){this._scheduledUpdateHandle=en(this._scheduledUpdateHandle),this._items.forEach(e=>{if(e.state.list===PS.REMOVED)switch(this._items.delete(e.analysis),e.state.view){case RM.PENDING:e.createAnalysisViewTask=gn(e.createAnalysisViewTask);break;case RM.CREATED:e.view!=null&&(this._allAnalysisViews.remove(e.view),e.view=et(e.view),e.createAnalysisViewTask=null)}})}async _createAnalysisViewPromise(e,i){const r=e.analysis,n=r.type,s=this._analysisModules[n];if(this._creatingViewCount+=1,s.module==null)try{s.module=await this._loadAnalysisModule(n)}catch(l){throw this._creatingViewCount-=1,l}if(xo(i))throw this._creatingViewCount-=1,ur("AnalysisView creation aborted");const o=new s.module.default({analysis:r,view:this.view});try{await o.when()}catch(l){throw this._creatingViewCount-=1,l}if(xo(i))throw this._creatingViewCount-=1,o.destroy(),ur("AnalysisView creation aborted");return e.view=o,e.state.view=RM.CREATED,this._allAnalysisViews.add(o),this._creatingViewCount-=1,o}_loadAnalysisModule(e){switch(e){case"area-measurement":return we(()=>import("./AreaMeasurementAnalysisView3D-AasBQOV-.js"),__vite__mapDeps([211,212,33,16,213,214,215,216,24,21,5,217,218,219]));case"dimension":return we(()=>import("./DimensionAnalysisView3D-W2fgoQBr.js"),__vite__mapDeps([220,212,68,218,21,219,221,215,27,26,9,10,170,222,17,18,19,20,22,23,24,25,3,4,216,223,5,29,11,8,6,28,217,224]));case"direct-line-measurement":return we(()=>import("./DirectLineMeasurementAnalysisView3D-AgdgP6Nj.js"),__vite__mapDeps([225,212,33,216,24,21,213,217,34,218,219,25,20]));case"line-of-sight":return we(()=>import("./LineOfSightAnalysisView3D-lX-OBMBB.js"),__vite__mapDeps([226,212,216,24,21,27,227,22,28,9,10,23,224]));case"slice":return we(()=>import("./SliceAnalysisView3D--IcVdus9.js"),__vite__mapDeps([228,212,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,229,27,170,216,24,21,222,26,9,10,28,224]))}}};function pme(){const t=Jl();return t.promise.catch(()=>{}),t}y([w()],H3.prototype,"updating",null),y([w({constructOnly:!0})],H3.prototype,"view",void 0),y([w()],H3.prototype,"_allAnalysisViews",void 0),y([w()],H3.prototype,"_creatingViewCount",void 0),H3=y([Z("esri.views.3d.analysis.AnalysisViewManager3D")],H3);const $mt=H3;let ev=class extends ze{constructor(e){super(e),this.collision=new Q4,this.distance=1/0,this.minimumPoiDistance=4,this.tilt=null}get altitude(){return this.mode===_t.Local?null:this._get("altitude")||null}set altitude(e){this.mode!==_t.Local?this._set("altitude",e):Ce.getLogger(this).warn("Altitude constraint is ignored in local scenes")}clampAltitude(e){return this.altitude?Je(e,this.altitude.min,this.altitude.max):e}clampTilt(e,i){if(!this.tilt)return i;const r=this.tilt(e);return Je(i,r.min,r.max)}clampDistance(e){return Math.min(e,this.distance)}createDefaultTilt(){return this.mode===_t.Local?this._createDefaultTiltLocal():this._createDefaultTiltGlobal()}createConstantMaxTilt(e){return(i,r=oq)=>(r.min=Bl.min,r.max=e,r)}_createDefaultTiltLocal(){const e=this.collision.enabled?hF([[4e3,Bl.max],[1e4,Ei(88)],[6e6,Ei(88)]]):()=>Bl.max;return(i,r=oq)=>(r.min=Bl.min,r.max=e(i),r)}_createDefaultTiltGlobal(){const e=this.collision.enabled?hF([[4e3,Bl.max],[5e4,Ei(88)],[6e6,Ei(88)],[2e7,Bl.min]]):hF([[3e5,Bl.max],[3e6,Ei(88)],[6e6,Ei(88)],[2e7,Bl.min]]);return(i,r=oq)=>(r.min=Bl.min,r.max=e(i),r)}};function Lmt(t){return{min:-2e5,max:4*t.radius}}y([w()],ev.prototype,"altitude",null),y([w({readOnly:!0})],ev.prototype,"collision",void 0),y([w()],ev.prototype,"distance",void 0),y([w({readOnly:!0})],ev.prototype,"minimumPoiDistance",void 0),y([w()],ev.prototype,"tilt",void 0),y([w({constructOnly:!0})],ev.prototype,"mode",void 0),ev=y([Z("esri.views.3d.state.Constraints")],ev);const fme=Lmt(Mr),Bl={min:Ei(.5),max:Ei(179.5)},oq={min:0,max:0};let Q4=class extends ze{constructor(){super(...arguments),this.enabled=!0,this.elevationMargin=5}};y([w({type:Boolean})],Q4.prototype,"enabled",void 0),y([w({type:Number})],Q4.prototype,"elevationMargin",void 0),Q4=y([Z("esri.views.3d.state.Constraints.CollisionConstraint")],Q4);let IM=class extends ze{constructor(){super(...arguments),this.min=fme.min,this.max=fme.max}};y([w({type:Number})],IM.prototype,"min",void 0),y([w({type:Number})],IM.prototype,"max",void 0),IM=y([Z("esri.views.3d.constraints.AltitudeConstraint")],IM);let Ev=class extends ze{constructor(){super(...arguments),this.mode="auto"}get near(){return this._get("near")}set near(e){this._set("near",e),e>=this._get("far")&&(this.far=e+1e-9),this.mode="manual"}castNear(e){return Math.max(1e-8,e)}get far(){return this._get("far")}set far(e){this._set("far",e),e<=this._get("near")&&(this.near=e-1e-9),this.mode="manual"}castFar(e){return Math.max(1e-8,e)}autoUpdate(e,i){this.mode==="auto"&&(this._get("near")!==e&&this._set("near",e),this._get("far")!==i&&this._set("far",i))}};y([w({type:Number,value:1e-8})],Ev.prototype,"near",null),y([Ci("near")],Ev.prototype,"castNear",null),y([w({type:Number,value:1e-8})],Ev.prototype,"far",null),y([Ci("far")],Ev.prototype,"castFar",null),y([w({type:["auto","manual"]})],Ev.prototype,"mode",void 0),Ev=y([Z("esri.views.3d.constraints.ClipDistanceConstraint")],Ev);const Aee={min:pu(Bl.min),max:pu(Bl.max)};let RS=class extends ze{constructor(){super(...arguments),this.mode="auto"}get max(){return this._get("max")}set max(e){this._set("max",e),this.mode="manual"}castMax(e){return Je(e,Aee.min,Aee.max)}autoUpdate(e){this.mode==="auto"&&this._get("max")!==e&&this._set("max",e)}};y([w({type:["auto","manual"]})],RS.prototype,"mode",void 0),y([w({type:Number,value:Aee.max})],RS.prototype,"max",null),y([Ci("max")],RS.prototype,"castMax",null),RS=y([Z("esri.views.3d.constraints.TiltConstraint")],RS);let IS=class extends ze{constructor(){super(...arguments),this.tilt=new RS,this.altitude=new IM,this.clipDistance=new Ev}};y([w({type:RS})],IS.prototype,"tilt",void 0),y([w({type:IM})],IS.prototype,"altitude",void 0),y([w({type:Ev})],IS.prototype,"clipDistance",void 0),IS=y([Z("esri.views.3d.constraints.Constraints")],IS);var FA;const CIe="esri.views.3d.environment.SunLighting",kD=Ce.getLogger(CIe);let Rg=FA=class extends Dn.EventedMixin(HT){constructor(t){super(t),this.cameraTrackingEnabled=!0,this.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};const e=new Date().getFullYear(),i=new Date("March 15, "+e+" 12:00:00 UTC");this._set("defaultDate",i),this._set("date",i)}get ambientOcclusionEnabled(){return pm(kD,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._get("ambientOcclusionEnabled")??!1}set ambientOcclusionEnabled(t){pm(kD,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._set("ambientOcclusionEnabled",t)}get waterReflectionEnabled(){return pm(kD,"waterReflectionEnabled",{replacement:"reflections are automatically shown and this property has no effect",version:"4.27"}),this._get("waterReflectionEnabled")??!1}set waterReflectionEnabled(t){pm(kD,"waterReflectionEnabled",{replacement:"reflections are automatically shown and this property has no effect",version:"4.27"}),this._set("waterReflectionEnabled",t)}get defaultDate(){return new Date(this._get("defaultDate").getTime())}static fromWebsceneLighting(t){return new FA(t.cloneConstructProperties())}set defaultDate(t){const e=this._get("date")===this._get("defaultDate");t=new Date(t.getTime()),this._set("defaultDate",t),e&&this._set("date",t)}set date(t){t!=null&&(this.positionTimezoneInfo.autoUpdated=!1,this._set("date",new Date(t.getTime())))}autoUpdate(t,e){const i=FA.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=e.hours,this.positionTimezoneInfo.minutes=e.minutes,this.positionTimezoneInfo.seconds=e.seconds;let r=null;t!=null&&(this.positionTimezoneInfo.autoUpdated=!0,isNaN(t.getTime())?(r=this.defaultDate.getTime(),this._set("date",this.defaultDate)):(r=this.date&&this.date.getTime(),this._set("date",new Date(t.getTime()))));const n=FA.calculateTimezoneOffset(this.positionTimezoneInfo);if(i!==n&&(zD.target=this,zD.timezoneOffset=n,this.emit("timezone-will-change",zD),zD.target=null),t!=null)return isNaN(t.getTime())||r!==t.getTime()}clone(){const t=this._get("date")===this._get("defaultDate"),e=new FA({...this.cloneConstructProperties(),defaultDate:this.defaultDate,cameraTrackingEnabled:this.cameraTrackingEnabled});return t&&e._set("date",e._get("defaultDate")),e.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,e.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,e.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,e.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,e}cloneWithWebsceneLighting(t){const e=this.clone();return t.date!=null&&(e.date=t.date),e.directShadowsEnabled=t.directShadowsEnabled,e.displayUTCOffset=t.displayUTCOffset,e}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};y([w({type:Boolean})],Rg.prototype,"cameraTrackingEnabled",void 0),y([w({type:Boolean})],Rg.prototype,"ambientOcclusionEnabled",null),y([w({type:Boolean})],Rg.prototype,"waterReflectionEnabled",null),y([w({type:Date})],Rg.prototype,"defaultDate",null),y([w({type:Date})],Rg.prototype,"date",null),Rg=FA=y([Z(CIe)],Rg),function(t){function e({hours:i,minutes:r,seconds:n}){return Math.round(i+r/60+n/3600)}t.calculateTimezoneOffset=e}(Rg||(Rg={}));const zD={target:null,timezoneOffset:0},Rv=Rg;var IF;const AIe="esri.views.3d.environment.VirtualLighting",UD=Ce.getLogger(AIe);let kA=IF=class extends Dn.EventedMixin(B9){constructor(t){super(t),this.cameraTrackingEnabled=!0}get ambientOcclusionEnabled(){return pm(UD,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._get("ambientOcclusionEnabled")??!1}set ambientOcclusionEnabled(t){pm(UD,"ambientOcclusionEnabled",{replacement:"ambient occlusion is automatically shown and this property has no effect",version:"4.27"}),this._set("ambientOcclusionEnabled",t)}get waterReflectionEnabled(){return pm(UD,"waterReflectionEnabled",{replacement:"water reflections are automatically shown and this property has no effect",version:"4.27"}),this._get("waterReflectionEnabled")??!1}set waterReflectionEnabled(t){pm(UD,"waterReflectionEnabled",{replacement:"water reflections are automatically shown and this property has no effect",version:"4.27"}),this._set("waterReflectionEnabled",t)}clone(){return new IF({...this.cloneConstructProperties(),cameraTrackingEnabled:this.cameraTrackingEnabled})}static fromWebsceneLighting(t){return new IF(t.cloneConstructProperties())}cloneWithWebsceneLighting(t){const e=this.clone();return e.directShadowsEnabled=t.directShadowsEnabled,e}cloneNonPersistentConstructProperties(){return{cameraTrackingEnabled:this.cameraTrackingEnabled}}};y([w({type:Boolean})],kA.prototype,"ambientOcclusionEnabled",null),y([w({type:Boolean})],kA.prototype,"waterReflectionEnabled",null),y([w({type:Boolean})],kA.prototype,"cameraTrackingEnabled",void 0),kA=IF=y([Z(AIe)],kA);const $M=kA,Dmt={key:"type",defaultKeyValue:"sun",base:null,typeMap:{sun:Rv,virtual:$M}};var Mee;let f$=Mee=class extends ze{set quality(t){["low","high"].includes(t)&&this._set("quality",t)}clone(){return new Mee({quality:this.quality})}};y([w({type:["low","high"],value:"low"})],f$.prototype,"quality",null),f$=Mee=y([Z("esri.views.3d.environment.SceneViewAtmosphere")],f$);var eI;let zA=eI=class extends f5{constructor(t){super(t),this.atmosphere=new f$,this.lighting=this.castLighting(),this.cachedCameraTrackingEnabled=null}static fromWebsceneEnvironment(t){const e=t.cloneConstructProperties();return new eI({...e,lighting:e.lighting?e.lighting.type==="virtual"?$M.fromWebsceneLighting(e.lighting):Rv.fromWebsceneLighting(e.lighting):void 0})}castLighting(t){return this._convertLightingWithDestroy(t)}applyLighting(t){this.lighting=this._convertLightingWithDestroy(t)}_convertLightingWithDestroy(t){const e=this._convertLighting(t);return e!==t&&this.addHandles(Jre(e)),e}_convertLighting(t){var e,i;return t?t instanceof Rv||t instanceof $M?t:t instanceof HT?this.lighting&&this.lighting.type!=="virtual"?this.lighting.cloneWithWebsceneLighting(t):new Rv({...t.cloneConstructProperties(),...(e=this.lighting)==null?void 0:e.cloneNonPersistentConstructProperties()}):t instanceof B9?this.lighting&&this.lighting.type==="virtual"?this.lighting.cloneWithWebsceneLighting(t):new $M({...t.cloneConstructProperties(),...(i=this.lighting)==null?void 0:i.cloneNonPersistentConstructProperties()}):zy(Dmt,t):new Rv}clone(){return new eI({lighting:this.lighting.clone(),atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:Re(this.background)})}cloneWithWebsceneEnvironment(t){return new eI({atmosphere:this.atmosphere.clone(),weather:this.weather.clone(),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,background:Re(this.background),...t.cloneConstructProperties(),lighting:this._getLighting(t)})}_getLighting(t){switch(t.lighting.type){case"sun":return this.lighting&&this.lighting.type==="sun"?this.lighting.cloneWithWebsceneLighting(t.lighting):Rv.fromWebsceneLighting(t.lighting);case"virtual":return this.lighting&&this.lighting.type==="virtual"?this.lighting.cloneWithWebsceneLighting(t.lighting):$M.fromWebsceneLighting(t.lighting);default:return t.lighting,Rv.fromWebsceneLighting(t.lighting)}}};y([w({type:f$,json:{read:!1},nonNullable:!0})],zA.prototype,"atmosphere",void 0),y([w({nonNullable:!0})],zA.prototype,"lighting",void 0),y([Ci("lighting")],zA.prototype,"castLighting",null),zA=eI=y([Z("esri.views.3d.environment.SceneViewEnvironment")],zA);const UA=zA;function Nmt(t,e,i){if(e==null)return!1;const r=S5e(e);return r!=null&&(r(t,0,oR,0),i!==oR&&(i[0]=oR[0],i[1]=oR[1],i.length>2&&(i[2]=oR[2])),!0)}const oR=W();function Fmt(t,e){VD[0]=t.x,VD[1]=t.y;const i=t.z;return VD[2]=i!==void 0?i:0,Nmt(VD,t.spatialReference,e)}const VD=W();var pc;(function(t){t[t.Realistic=0]="Realistic",t[t.Local=1]="Local",t[t.Mars=2]="Mars",t[t.None=3]="None"})(pc||(pc={}));function kmt(t){return"r"in t&&"g"in t&&"b"in t}function MIe(t){return"h"in t&&"s"in t&&"v"in t}function OIe(t){return"l"in t&&"a"in t&&"b"in t}function PIe(t){return"l"in t&&"c"in t&&"h"in t}function zmt(t){return"x"in t&&"y"in t&&"z"in t}const Umt=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],Vmt=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function RIe(t,e){const i=[];let r,n;if(t[0].length!==e.length)throw new Error("dimensions do not match");const s=t.length,o=t[0].length;let l=0;for(r=0;rr<=.04045?r/12.92:((r+.055)/1.055)**2.4),i=RIe(Umt,e);return{x:100*i[0],y:100*i[1],z:100*i[2]}}function uae(t){const e=RIe(Vmt,[t.x/100,t.y/100,t.z/100]).map(i=>{const r=i<=.0031308?12.92*i:1.055*i**.4166666666666667-.055;return Math.min(1,Math.max(r,0))});return{r:Math.round(255*e[0]),g:Math.round(255*e[1]),b:Math.round(255*e[2])}}function $Ie(t){const e=[t.x/95.047,t.y/100,t.z/108.883].map(i=>i>.008856451679035631?i**.3333333333333333:7.787037037037035*i+.13793103448275862);return{l:116*e[1]-16,a:500*(e[0]-e[1]),b:200*(e[1]-e[2])}}function LIe(t){const e=t.l,i=[(e+16)/116+t.a/500,(e+16)/116,(e+16)/116-t.b/200].map(r=>r>6/29?r**3:3*(6/29)**2*(r-4/29));return{x:95.047*i[0],y:100*i[1],z:108.883*i[2]}}function Bmt(t){const e=t.l,i=t.a,r=t.b,n=Math.sqrt(i*i+r*r);let s=Math.atan2(r,i);return s=s>0?s:s+2*Math.PI,{l:e,c:n,h:s}}function jmt(t){const e=t.l,i=t.c,r=t.h;return{l:e,a:i*Math.cos(r),b:i*Math.sin(r)}}function Gmt(t){return $Ie(IIe(t))}function Hmt(t){return uae(LIe(t))}function qmt(t){return Bmt($Ie(IIe(t)))}function Wmt(t){return uae(LIe(jmt(t)))}function Ymt(t){const e=t.r,i=t.g,r=t.b,n=Math.max(e,i,r),s=n-Math.min(e,i,r);let o=n,l=s===0?0:n===e?(i-r)/s%6:n===i?(r-e)/s+2:(e-i)/s+4,c=s===0?0:s/o;return l<0&&(l+=6),l*=60,c*=100,o*=100/255,{h:l,s:c,v:o}}function Xmt(t){const e=(t.h+360)%360/60,i=t.s/100,r=t.v/100*255,n=r*i,s=n*(1-Math.abs(e%2-1));let o;switch(Math.floor(e)){case 0:o={r:n,g:s,b:0};break;case 1:o={r:s,g:n,b:0};break;case 2:o={r:0,g:n,b:s};break;case 3:o={r:0,g:s,b:n};break;case 4:o={r:s,g:0,b:n};break;case 5:case 6:o={r:n,g:0,b:s};break;default:o={r:0,g:0,b:0}}return o.r=Math.round(o.r+r-n),o.g=Math.round(o.g+r-n),o.b=Math.round(o.b+r-n),o}function SE(t){return kmt(t)?t:PIe(t)?Wmt(t):OIe(t)?Hmt(t):zmt(t)?uae(t):MIe(t)?Xmt(t):t}function Cj(t){return MIe(t)?t:Ymt(SE(t))}function Zmt(t){return OIe(t)?t:Gmt(SE(t))}function Iti(t){return PIe(t)?t:qmt(SE(t))}function Jmt(t){let{r:e,g:i,b:r,a:n}=t;return n<1&&(e=Math.round(n*e+255*(1-n)),i=Math.round(n*i+255*(1-n)),r=Math.round(n*r+255*(1-n))),new qe({r:e,g:i,b:r})}function Kmt(t,e){const{r:i,g:r,b:n}=e!=null&&e.ignoreAlpha?t:Jmt(t);return .2126*i+.7152*r+.0722*n}var Oee;function $ti(t,e=Oee.High){return Kmt(t,{ignoreAlpha:!0})>e?new qe([0,0,0,t.a]):new qe([255,255,255,t.a])}function Lti(t,e){const i=Zmt(t);i.l*=1-e;const r=SE(i),n=t.clone();return n.setColor(r),n.a=t.a,n}function Dti(t,e){const i=t.clone();return i.a*=e,i}function Nti(t,e){const i=Cj(t);i.s*=e;const r=SE(i),n=t.clone();return n.setColor(r),n.a=t.a,n}function AL(t){return qe.toUnitRGBA(t)}function Fti(t,e){return t===e||t!=null&&t.equals(e)}function kti(t,e){return t===e||t!=null&&e!=null&&VT(t,e)}function zti(t){return Mi(t[0],t[1],t[2],t.length>3?t[3]:1)}function Uti(t,e){const i=qe.toUnitRGBA(t);return i[3]*=e,i}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(Oee||(Oee={}));function Qo(t,e){return t[0]=e[0],t[1]=e[1],t}function or(t,e,i){return t[0]=e,t[1]=i,t}function df(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function Ps(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function DIe(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}function NIe(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}function Qmt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function egt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function tgt(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function igt(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}function rgt(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function Gu(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function If(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t}function Dm(t,e){const i=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(i*i+r*r)}function Jf(t,e){const i=e[0]-t[0],r=e[1]-t[1];return i*i+r*r}function j9(t){const e=t[0],i=t[1];return Math.sqrt(e*e+i*i)}function Yy(t){const e=t[0],i=t[1];return e*e+i*i}function hae(t,e){return t[0]=-e[0],t[1]=-e[1],t}function ngt(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function w5(t,e){const i=e[0],r=e[1];let n=i*i+r*r;return n>0&&(n=1/Math.sqrt(n),t[0]=e[0]*n,t[1]=e[1]*n),t}function fs(t,e){return t[0]*e[0]+t[1]*e[1]}function sgt(t,e,i){const r=e[0]*i[1]-e[1]*i[0];return t[0]=t[1]=0,t[2]=r,t}function ju(t,e,i,r){const n=e[0],s=e[1];return t[0]=n+r*(i[0]-n),t[1]=s+r*(i[1]-s),t}function ogt(t,e){e=e||1;const i=2*M9()*Math.PI;return t[0]=Math.cos(i)*e,t[1]=Math.sin(i)*e,t}function FIe(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n,t[1]=i[1]*r+i[3]*n,t}function uw(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n+i[4],t[1]=i[1]*r+i[3]*n+i[5],t}function agt(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[3]*n+i[6],t[1]=i[1]*r+i[4]*n+i[7],t}function lgt(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t}function cgt(t,e,i,r){const n=e[0]-i[0],s=e[1]-i[1],o=Math.sin(r),l=Math.cos(r);return t[0]=n*l-s*o+i[0],t[1]=n*o+s*l+i[1],t}function ugt(t,e){const i=t[0],r=t[1],n=e[0],s=e[1];let o=i*i+r*r;o>0&&(o=1/Math.sqrt(o));let l=n*n+s*s;l>0&&(l=1/Math.sqrt(l));const c=(i*n+r*s)*o*l;return c>1?0:c<-1?Math.PI:Math.acos(c)}function hgt(t){return"vec2("+t[0]+", "+t[1]+")"}function kIe(t,e){return t[0]===e[0]&&t[1]===e[1]}function zIe(t,e){const i=t[0],r=t[1],n=e[0],s=e[1],o=sl();return Math.abs(i-n)<=o*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-s)<=o*Math.max(1,Math.abs(r),Math.abs(s))}function dgt(t,e,i,r,n){let s=e[0]-i[0],o=e[1]-i[1];const l=(r[0]*s+r[1]*o)*(n-1);return s=r[0]*l,o=r[1]*l,t[0]=e[0]+s,t[1]=e[1]+o,t}const pgt=j9,UIe=Ps,fgt=DIe,mgt=NIe,VIe=Dm,ggt=Jf,ygt=Yy;Object.freeze(Object.defineProperty({__proto__:null,add:df,angle:ugt,ceil:Qmt,copy:Qo,cross:sgt,dist:VIe,distance:Dm,div:mgt,divide:NIe,dot:fs,equals:zIe,exactEquals:kIe,floor:egt,inverse:ngt,len:pgt,length:j9,lerp:ju,max:igt,min:tgt,mul:fgt,multiply:DIe,negate:hae,normalize:w5,projectAndScale:dgt,random:ogt,rotate:cgt,round:rgt,scale:Gu,scaleAndAdd:If,set:or,sqrDist:ggt,sqrLen:ygt,squaredDistance:Jf,squaredLength:Yy,str:hgt,sub:UIe,subtract:Ps,transformMat2:FIe,transformMat2d:uw,transformMat3:agt,transformMat4:lgt},Symbol.toStringTag,{value:"Module"}));function dae(t){return Je((t-1e5)/9e5,0,1)}const Pee=1e4,vgt=.085,Nw=1e5;let _gt=class{};const _n=_gt;function V(t,...e){let i="";for(let r=0;rr.setUniform3fv(e,i(n,s)))}};function B_(t){t.uniforms.add(new Oi("mainLightDirection",(e,i)=>i.lighting.mainLight.direction))}function a1(t){t.uniforms.add(new Oi("mainLightIntensity",(e,i)=>i.lighting.mainLight.intensity))}function yU(t){B_(t.fragment),a1(t.fragment),t.fragment.code.add(V`vec3 evaluateMainLighting(vec3 normal_global, float shadowing) { +float dotVal = clamp(dot(normal_global, mainLightDirection), 0.0, 1.0); +return mainLightIntensity * ((1.0 - shadowing) * dotVal); +}`)}let ln=class extends Ls{constructor(e,i){super(e,"vec2",Or.Pass,(r,n,s)=>r.setUniform2fv(e,i(n,s)))}},gr=class extends Ls{constructor(e,i){super(e,"vec4",Or.Pass,(r,n,s)=>r.setUniform4fv(e,i(n,s)))}},ft=class extends Ls{constructor(e,i){super(e,"float",Or.Pass,(r,n,s)=>r.setUniform1f(e,i(n,s)))}},_s=class extends Ls{constructor(e,i){super(e,"mat4",Or.Pass,(r,n,s)=>r.setUniformMatrix4fv(e,i(n,s)))}};const Nc=Xi();let bgt=class{constructor(e){this.message=e}toString(){return`AssertException: ${this.message}`}};function Xt(t,e){if(!t){e=e||"Assertion";const i=new Error(e).stack;throw new bgt(`${e} at ${i}`)}}function JE(t,e){t||(e=e||"",console.warn("Verify failed: "+e+` +`+new Error("verify").stack))}function mme(t,e,i,r){let n,s=(i[0]-t[0])/e[0],o=(r[0]-t[0])/e[0];s>o&&(n=s,s=o,o=n);let l=(i[1]-t[1])/e[1],c=(r[1]-t[1])/e[1];if(l>c&&(n=l,l=c,c=n),s>c||l>o)return!1;l>s&&(s=l),c_&&(n=f,f=_,_=n),!(s>_||f>o)&&(_2&&(n[2]=-Nc[2]),lp(Nc,Nc,i),Xt(Nc[3]!==0),n[0]=Nc[0]/Nc[3],n[1]=Nc[1]/Nc[3],n[2]=Nc[2]/Nc[3],n[0]=(.5*n[0]+.5)*r[2]+r[0],n[1]=(.5*n[1]+.5)*r[3]+r[1]}function wgt(t,e){return Math.log(t)/Math.log(e)}function xgt(t,e,i,r){t[12]=e,t[13]=i,t[14]=r}function BIe(t){return t[0]===1&&t[1]===0&&t[2]===0&&t[3]===0&&t[4]===0&&t[5]===1&&t[6]===0&&t[7]===0&&t[8]===0&&t[9]===0&&t[10]===1&&t[11]===0&&t[15]===1}const jIe=Ce.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let GIe=class{constructor(){this._includedModules=new Map}include(e,i){if(this._includedModules.has(e)){const r=this._includedModules.get(e);if(r!==i){jIe.error("Trying to include shader module multiple times with different sets of options.");const n=new Set;for(const s of Object.keys(r))r[s]!==e[s]&&n.add(s);for(const s of Object.keys(e))r[s]!==e[s]&&n.add(s);n.forEach(s=>console.error(` ${s}: current ${r[s]} new ${e[s]}`))}}else this._includedModules.set(e,i),e(this.builder,i)}},Cr=class extends GIe{constructor(){super(...arguments),this.vertex=new yme,this.fragment=new yme,this.attributes=new Egt,this.varyings=new Cgt,this.extensions=new Ree,this.constants=new HIe,this.outputs=new $ee}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e){const i=this.extensions.generateSource(e),r=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s=e==="vertex"?this.vertex:this.fragment,o=s.uniforms.generateSource(),l=s.code.generateSource(),c=e==="vertex"?Mgt:Agt,f=this.constants.generateSource().concat(s.constants.generateSource()),_=this.outputs.generateSource(e);return`#version 300 es +${i.join(` +`)} + +${c} + +${f.join(` +`)} + +${o.join(` +`)} + +${r.join(` +`)} + +${n.join(` +`)} + +${_.join(` +`)} + +${l.join(` +`)}`}generateBindPass(e){const i=new Map;this.vertex.uniforms.entries.forEach(s=>{const o=s.bind[Or.Pass];o&&i.set(s.name,o)}),this.fragment.uniforms.entries.forEach(s=>{const o=s.bind[Or.Pass];o&&i.set(s.name,o)});const r=Array.from(i.values()),n=r.length;return(s,o)=>{for(let l=0;l{const o=s.bind[Or.Draw];o&&i.set(s.name,o)}),this.fragment.uniforms.entries.forEach(s=>{const o=s.bind[Or.Draw];o&&i.set(s.name,o)});const r=Array.from(i.values()),n=r.length;return(s,o,l)=>{for(let c=0;ce.arraySize!=null?`uniform ${e.type} ${e.name}[${e.arraySize}];`:`uniform ${e.type} ${e.name};`)}get entries(){return Array.from(this._entries.values())}},Tgt=class{constructor(){this._entries=new Array}add(e){this._entries.push(e)}generateSource(){return this._entries}},yme=class extends GIe{constructor(){super(...arguments),this.uniforms=new Sgt,this.code=new Tgt,this.constants=new HIe}get builder(){return this}},Egt=class{constructor(){this._entries=new Array}add(e,i){this._entries.push([e,i])}generateSource(e){return e==="fragment"?[]:this._entries.map(i=>`in ${i[1]} ${i[0]};`)}},Cgt=class{constructor(){this._entries=new Map}add(e,i){this._entries.has(e)&&Xt(this._entries.get(e)===i),this._entries.set(e,i)}generateSource(e){const i=new Array;return this._entries.forEach((r,n)=>i.push(e==="vertex"?`out ${r} ${n};`:`in ${r} ${n};`)),i}},Ree=class Iee{constructor(){this._entries=new Set}add(e){this._entries.add(e)}generateSource(e){const i=e==="vertex"?Iee.ALLOWLIST_VERTEX:Iee.ALLOWLIST_FRAGMENT;return Array.from(this._entries).filter(r=>i.includes(r)).map(r=>`#extension ${r} : enable`)}};Ree.ALLOWLIST_FRAGMENT=["GL_EXT_shader_texture_lod","GL_OES_standard_derivatives"],Ree.ALLOWLIST_VERTEX=[];let $ee=class Lee{constructor(){this._entries=new Map}add(e,i,r=0){const n=this._entries.get(r);n?Xt(n.name===e&&n.type===i,`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:i})}generateSource(e){if(e==="vertex")return[];this._entries.size===0&&this._entries.set(0,{name:Lee.DEFAULT_NAME,type:Lee.DEFAULT_TYPE});const i=new Array;return this._entries.forEach((r,n)=>i.push(`layout(location = ${n}) out ${r.type} ${r.name};`)),i}};$ee.DEFAULT_TYPE="vec4",$ee.DEFAULT_NAME="fragColor";let HIe=class ia{constructor(){this._entries=new Set}add(e,i,r){let n="ERROR_CONSTRUCTOR_STRING";switch(i){case"float":n=ia._numberToFloatStr(r);break;case"int":n=ia._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${ia._numberToFloatStr(r[0])}, ${ia._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${ia._numberToFloatStr(r[0])}, ${ia._numberToFloatStr(r[1])}, ${ia._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${ia._numberToFloatStr(r[0])}, ${ia._numberToFloatStr(r[1])}, ${ia._numberToFloatStr(r[2])}, ${ia._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${ia._numberToIntStr(r[0])}, ${ia._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${ia._numberToIntStr(r[0])}, ${ia._numberToIntStr(r[1])}, ${ia._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${ia._numberToIntStr(r[0])}, ${ia._numberToIntStr(r[1])}, ${ia._numberToIntStr(r[2])}, ${ia._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${i}(${Array.prototype.map.call(r,s=>ia._numberToFloatStr(s)).join(", ")})`}return this._entries.add(`const ${i} ${e} = ${n};`),this}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}};const Agt=`#ifdef GL_FRAGMENT_PRECISION_HIGH + precision highp float; + precision highp sampler2D; +#else + precision mediump float; + precision mediump sampler2D; +#endif`,Mgt=`precision highp float; +precision highp sampler2D;`;let Zt=class extends Ls{constructor(e,i){super(e,"sampler2D",Or.Pass,(r,n,s)=>r.bindTexture(e,i(n,s)))}};const fO=nt(parseFloat(5802e-9.toFixed(6)),parseFloat(13558e-9.toFixed(6)),parseFloat(331e-7.toFixed(6))),aq=3,lq=nt(aq*parseFloat(65e-8.toFixed(6)),aq*parseFloat(1881e-9.toFixed(6)),aq*parseFloat(85e-9.toFixed(6))),Ogt=3996e-9,Pgt=nt(parseFloat(Number(fO[0]+lq[0]).toFixed(6)),parseFloat(Number(fO[1]+lq[1]).toFixed(6)),parseFloat(Number(fO[2]+lq[2]).toFixed(6)));function qIe(t){const e=new Cr;e.attributes.add(J.POSITION,"vec2"),e.include(My,{textureCoordinateType:So.Default}),e.varyings.add("worldRay","vec3"),e.varyings.add("eyeDir","vec3");const{vertex:i,fragment:r}=e;return i.uniforms.add(new _s("inverseProjectionMatrix",(n,s)=>s.camera.inverseProjectionMatrix),new _s("inverseViewMatrix",(n,s)=>sP(Rgt,s.camera.viewMatrix))),i.code.add(V`void main(void) { +vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz; +eyeDir = posViewNear; +worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz; +forwardTextureCoordinates(); +gl_Position = vec4(position, 1, 1); +}`),r.uniforms.add(new Oi("backgroundColor",n=>n.backgroundColor),new ln("radii",n=>n.radii),new Oi("cameraPosition",(n,s)=>s.camera.eye),new gr("heightParameters",n=>n.heightParameters),new ft("innerFadeDistance",n=>n.innerFadeDistance),new ft("altitudeFade",n=>n.altitudeFade),new Zt("depthTexture",n=>n.depthTexture),new ft("hazeStrength",n=>n.hazeStrength)),r.constants.add("betaRayleigh","vec3",fO),r.constants.add("betaCombined","vec3",Pgt),r.constants.add("betaMie","float",Ogt),r.constants.add("scaleHeight","float",vgt*Nw),B_(r),e.include(Aj),t.haze&&(r.include(Kf),r.uniforms.add(new ln("nearFar",(n,s)=>s.camera.nearFar))),r.code.add(V`vec2 sphereIntersect(vec3 start, vec3 dir, float radius, bool planet) { +float a = dot(dir, dir); +float b = 2.0 * dot(dir, start); +float c = planet ? heightParameters[1] - radius * radius : heightParameters[2]; +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)); +}`),r.code.add(V`float chapmanApproximation(float X, float h, float cosZenith) { +float c = sqrt(X + h); +float cExpH = c * exp(-h); +if (cosZenith >= 0.0) { +return cExpH / (c * cosZenith + 1.0); +} else { +float x0 = sqrt(1.0 - cosZenith * cosZenith) * (X + h); +float c0 = sqrt(x0); +return 2.0 * c0 * exp(X - x0) - cExpH / (1.0 - c * cosZenith); +} +}`),r.code.add(V`float getOpticalDepth(vec3 position, vec3 dir, float h) { +return scaleHeight * chapmanApproximation(radii[0] / scaleHeight, h, dot(normalize(position), dir)); +}`),r.code.add(V` + const int STEPS = 6; + + vec3 getAtmosphereColour(vec3 cameraPos, vec3 rayDir, vec3 lightDir, float terrainDepth) { + float reducedPlanetRadius = radii[0] - 20000.0; + vec2 rayPlanetIntersect = sphereIntersect(cameraPos, rayDir, reducedPlanetRadius, true); + vec2 rayAtmosphereIntersect = sphereIntersect(cameraPos, rayDir, radii[1], false); + bool hitsAtmosphere = (rayAtmosphereIntersect.x <= rayAtmosphereIntersect.y) && rayAtmosphereIntersect.x > 0.0; + bool insideAtmosphere = heightParameters[0] < radii[1]; + + if (!(hitsAtmosphere || insideAtmosphere)) { + return vec3(0); + } + + bool hitsPlanet = (rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.x > 0.0; + + float start = insideAtmosphere ? 0.0 : rayAtmosphereIntersect.x; + + if (heightParameters[0] < reducedPlanetRadius) { + // Long light rays from the night side of the planet lead to numerical instability + // Do not render the atmosphere in such cases + if (dot(rayDir, normalize(cameraPos)) < -0.025) { + return vec3(0); + } + start = rayPlanetIntersect.y; + } + + float end = hitsPlanet ? rayPlanetIntersect.x : rayAtmosphereIntersect.y; + float maxEnd = end; + + ${t.haze?V`if (terrainDepth != -1.0) { end = terrainDepth; }`:""} + + vec3 samplePoint = cameraPos + rayDir * end; + float multiplier = hitsPlanet ? -1.0 : 1.0; + + vec3 scattering = vec3(0); + float scaleFract = (length(samplePoint) - radii[0]) / scaleHeight; + float lastOpticalDepth = getOpticalDepth(samplePoint, rayDir, scaleFract); + float stepSize = (end - start) / float(STEPS); + for (int i = 0; i < STEPS; i++) { + samplePoint -= stepSize * rayDir; + scaleFract = (length(samplePoint) - radii[0]) / scaleHeight; + float opticalDepth = multiplier * getOpticalDepth(samplePoint, rayDir * multiplier, scaleFract); + + if (i > 0) { + scattering *= ${t.haze?"":V`mix(2.5, 1.0, clamp((length(cameraPos) - radii[0]) / 50e3, 0.0, 1.0)) * `} exp(-(mix(betaCombined, betaRayleigh, 0.5) + betaMie) * max(0.0, (opticalDepth - lastOpticalDepth))); + } + + if (dot(normalize(samplePoint), lightDir) > -0.3) { + + float scale = exp(-scaleFract); + float lightDepth = getOpticalDepth(samplePoint, lightDir, scaleFract); + + scattering += scale * exp(-(betaCombined + betaMie) * lightDepth); + ${t.haze?"":V`scattering += scale * exp(-(0.25 * betaCombined ) * lightDepth);`} + } + + lastOpticalDepth = opticalDepth; + + } + + float mu = dot(rayDir, lightDir); + float mumu = 1.0 + mu * mu; + + float phaseRayleigh = 0.0596831 * mumu; + + ${t.haze?V`return 3.0 * scattering * stepSize * phaseRayleigh * betaRayleigh;`:V` + const float g = 0.8; + const float gg = g * g; + float phaseMie = end == maxEnd ? 0.1193662 * ((1.0 - gg) * mumu) / (pow(1.0 + gg - 2.0 * mu * g, 1.5) * (2.0 + gg)) : 0.0; + phaseMie = clamp(phaseMie, 0.0, 128.0); + return 3.0 * scattering * stepSize * (phaseRayleigh * betaRayleigh + 0.025 * phaseMie * betaMie);`} + } + + ${t.haze?"":V` + vec4 applyUndergroundAtmosphere(vec3 rayDir, vec3 lightDirection, vec4 fragColor) { + vec2 rayPlanetIntersect = sphereIntersect(cameraPosition, rayDir, radii[0], true); + if (!((rayPlanetIntersect.x <= rayPlanetIntersect.y) && rayPlanetIntersect.y > 0.0)) { + return fragColor; + } + + float lightAngle = dot(lightDirection, normalize(cameraPosition + rayDir * max(0.0, rayPlanetIntersect.x))); + vec4 surfaceColor = vec4(vec3(max(0.0, (smoothstep(-1.0, 0.8, 2.0 * lightAngle)))), 1.0 - altitudeFade); + float relDist = (rayPlanetIntersect.y - max(0.0, rayPlanetIntersect.x)) / innerFadeDistance; + if (relDist > 1.0) { + return surfaceColor; + } + + return mix(fragColor, surfaceColor, smoothstep(0.0, 1.0, relDist * relDist)); + } + + float getGlow(float dist, float radius, float intensity) { + return pow(radius / max(dist, 1e-6), intensity); + } + + vec3 getSun(vec3 cameraPos, vec3 rayDir, vec3 lightDir){ + + // Get the amount of atmosphere between camera and the Sun along the view ray + float scaleFract = (length(cameraPos) - radii[0]) / scaleHeight; + float sunOpticalDepth = getOpticalDepth(cameraPos, rayDir, max(scaleFract, 0.0)); + + // Find the amount of light that remains after travelling through the atmosphere from the Sun along the view ray + // This will make the colour of the Sun reddish on the horizon and white from space + vec3 sunTransmittance = exp(-(mix(betaCombined, betaRayleigh, 0.5)) * max(0.0, sunOpticalDepth)); + + // Alignment of light direction and view ray + float mu = clamp(dot(rayDir, lightDir), 0.0, 1.0); + // Draw the Sun as a bright disc + float sunDisc = 256.0 * smoothstep(0.0, 128.0, clamp(getGlow(1.0 - mu, 3e-5, 3.0), 0.0, 128.0)); + + return normalize(sunTransmittance) * sunDisc; + }`} + + ${t.haze&&t.reduced?V` + float getDepth(vec2 uv){ + return linearDepthFromTexture(depthTexture, uv, nearFar); + } + + float textureBilinear(vec2 uv) { + // Information about the high-resolution depth texture + vec2 depthTextureSize = vec2(textureSize(depthTexture, 0)); + vec2 texelSize = 1.0 / depthTextureSize; + + // The uv inside the upper right pixel - of the tile of 4 pixels - + // that the atmosphere uv maps to in the depth texture + vec2 depthUV = (uv * depthTextureSize) - vec2(0.5); + + // Relative distance of the uv coordinates inside the depth texture pixel + vec2 f = fract(depthUV); + + // Snap to the centre of the depth texture pixel + vec2 snapUV = (floor(depthUV) + vec2(0.5)) / depthTextureSize; + + // Read the depth texture pixel and its three neighbours + float d0 = getDepth(snapUV); + float d1 = getDepth(snapUV + vec2(texelSize.x, 0.0)); + float d2 = getDepth(snapUV + vec2(0.0, texelSize.y)); + float d3 = getDepth(snapUV + texelSize); + + // Return the bilinearly interpolated value of the neighbouring pixels based + // on the sample position in the depth texture pixel + return mix(mix(d0, d1, f.x), mix(d2, d3, f.x), f.y); + } + `:""} + + vec3 tonemapACES(vec3 x) { + return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); + } + + void main() { + vec3 rayDir = normalize(worldRay); + float terrainDepth = -1.0; + ${t.haze?V` + vec4 depthSample = texture(depthTexture, vuv0).rgba; + if (depthSample != vec4(0)) { + vec3 cameraSpaceRay = normalize(eyeDir); + cameraSpaceRay /= cameraSpaceRay.z; + + ${t.reduced?V`cameraSpaceRay *= -textureBilinear(vuv0);`:V`cameraSpaceRay *= -linearDepthFromTexture(depthTexture, vuv0, nearFar);`} + + terrainDepth = max(0.0, length(cameraSpaceRay)); + }else{ + discard; + } + `:V`${t.reduced?"":V` + float depthSample = texture(depthTexture, vuv0).r; + if (depthSample != 1.0) { + fragColor = vec4(0); + return; + }`}`} + + ${t.haze?V` + vec3 col = vec3(0); + float fadeOut = smoothstep(-10000.0, -15000.0, heightParameters[0] - radii[0]); + if(depthSample != vec4(0)){ + col = (1.0 - fadeOut) * hazeStrength * getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth); + } + // Alpha is ignored for haze blending + float alpha = 1.0; + `:V` + vec3 col = linearizeGamma(backgroundColor); + col += getAtmosphereColour(cameraPosition, rayDir, mainLightDirection, terrainDepth); + col += getSun(cameraPosition, rayDir, mainLightDirection); + float alpha = smoothstep(0.0, mix(0.15, 0.01, heightParameters[3]), length(col));`} + + col = tonemapACES(col); + fragColor = delinearizeGamma(vec4(col, alpha)); + ${t.haze?"":V`fragColor = applyUndergroundAtmosphere(rayDir, mainLightDirection, fragColor);`} + } + `),e}const Rgt=Qe(),Igt=Object.freeze(Object.defineProperty({__proto__:null,betaRayleigh:fO,build:qIe},Symbol.toStringTag,{value:"Module"}));let Rr=class{constructor(e,i){this._module=e,this._loadModule=i}get(){return this._module}async reload(){return this._module=await this._loadModule(),this._module}};var In,sr,st,Xy,fi,vm,x5,Yt,Zr,bs,ki,Bi,Hs,ci,zt,ga,Wa,Pr,tp,Vl;(function(t){t[t.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",t[t.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",t[t.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(In||(In={})),function(t){t[t.POINTS=0]="POINTS",t[t.LINES=1]="LINES",t[t.LINE_LOOP=2]="LINE_LOOP",t[t.LINE_STRIP=3]="LINE_STRIP",t[t.TRIANGLES=4]="TRIANGLES",t[t.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",t[t.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(sr||(sr={})),function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SRC_COLOR=768]="SRC_COLOR",t[t.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",t[t.SRC_ALPHA=770]="SRC_ALPHA",t[t.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",t[t.DST_ALPHA=772]="DST_ALPHA",t[t.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",t[t.DST_COLOR=774]="DST_COLOR",t[t.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",t[t.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",t[t.CONSTANT_COLOR=32769]="CONSTANT_COLOR",t[t.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",t[t.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",t[t.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"}(st||(st={})),function(t){t[t.ADD=32774]="ADD",t[t.MIN=32775]="MIN",t[t.MAX=32776]="MAX",t[t.SUBTRACT=32778]="SUBTRACT",t[t.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"}(Xy||(Xy={})),function(t){t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t[t.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",t[t.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",t[t.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",t[t.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",t[t.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER"}(fi||(fi={})),function(t){t[t.FRONT=1028]="FRONT",t[t.BACK=1029]="BACK",t[t.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(vm||(vm={})),function(t){t[t.CW=2304]="CW",t[t.CCW=2305]="CCW"}(x5||(x5={})),function(t){t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.INT=5124]="INT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.FLOAT=5126]="FLOAT"}(Yt||(Yt={})),function(t){t[t.NEVER=512]="NEVER",t[t.LESS=513]="LESS",t[t.EQUAL=514]="EQUAL",t[t.LEQUAL=515]="LEQUAL",t[t.GREATER=516]="GREATER",t[t.NOTEQUAL=517]="NOTEQUAL",t[t.GEQUAL=518]="GEQUAL",t[t.ALWAYS=519]="ALWAYS"}(Zr||(Zr={})),function(t){t[t.ZERO=0]="ZERO",t[t.KEEP=7680]="KEEP",t[t.REPLACE=7681]="REPLACE",t[t.INCR=7682]="INCR",t[t.DECR=7683]="DECR",t[t.INVERT=5386]="INVERT",t[t.INCR_WRAP=34055]="INCR_WRAP",t[t.DECR_WRAP=34056]="DECR_WRAP"}(bs||(bs={})),function(t){t[t.NEAREST=9728]="NEAREST",t[t.LINEAR=9729]="LINEAR",t[t.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",t[t.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",t[t.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",t[t.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(ki||(ki={})),function(t){t[t.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",t[t.REPEAT=10497]="REPEAT",t[t.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"}(Bi||(Bi={})),function(t){t[t.TEXTURE_2D=3553]="TEXTURE_2D",t[t.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",t[t.TEXTURE_3D=32879]="TEXTURE_3D",t[t.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",t[t.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",t[t.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",t[t.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",t[t.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",t[t.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"}(Hs||(Hs={})),function(t){t[t.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.ALPHA=6406]="ALPHA",t[t.RGB=6407]="RGB",t[t.RGBA=6408]="RGBA",t[t.LUMINANCE=6409]="LUMINANCE",t[t.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",t[t.RED=6403]="RED",t[t.RG=33319]="RG",t[t.RED_INTEGER=36244]="RED_INTEGER",t[t.RG_INTEGER=33320]="RG_INTEGER",t[t.RGB_INTEGER=36248]="RGB_INTEGER",t[t.RGBA_INTEGER=36249]="RGBA_INTEGER"}(ci||(ci={})),function(t){t[t.RGBA4=32854]="RGBA4",t[t.R16F=33325]="R16F",t[t.RG16F=33327]="RG16F",t[t.RGB32F=34837]="RGB32F",t[t.RGBA16F=34842]="RGBA16F",t[t.R32F=33326]="R32F",t[t.RG32F=33328]="RG32F",t[t.RGBA32F=34836]="RGBA32F",t[t.R11F_G11F_B10F=35898]="R11F_G11F_B10F",t[t.RGB8=32849]="RGB8",t[t.RGBA8=32856]="RGBA8",t[t.RGB5_A1=32855]="RGB5_A1",t[t.R8=33321]="R8",t[t.RG8=33323]="RG8",t[t.R8I=33329]="R8I",t[t.R8UI=33330]="R8UI",t[t.R16I=33331]="R16I",t[t.R16UI=33332]="R16UI",t[t.R32I=33333]="R32I",t[t.R32UI=33334]="R32UI",t[t.RG8I=33335]="RG8I",t[t.RG8UI=33336]="RG8UI",t[t.RG16I=33337]="RG16I",t[t.RG16UI=33338]="RG16UI",t[t.RG32I=33339]="RG32I",t[t.RG32UI=33340]="RG32UI",t[t.RGB16F=34843]="RGB16F",t[t.RGB9_E5=35901]="RGB9_E5",t[t.SRGB8=35905]="SRGB8",t[t.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",t[t.RGB565=36194]="RGB565",t[t.RGBA32UI=36208]="RGBA32UI",t[t.RGB32UI=36209]="RGB32UI",t[t.RGBA16UI=36214]="RGBA16UI",t[t.RGB16UI=36215]="RGB16UI",t[t.RGBA8UI=36220]="RGBA8UI",t[t.RGB8UI=36221]="RGB8UI",t[t.RGBA32I=36226]="RGBA32I",t[t.RGB32I=36227]="RGB32I",t[t.RGBA16I=36232]="RGBA16I",t[t.RGB16I=36233]="RGB16I",t[t.RGBA8I=36238]="RGBA8I",t[t.RGB8I=36239]="RGB8I",t[t.R8_SNORM=36756]="R8_SNORM",t[t.RG8_SNORM=36757]="RG8_SNORM",t[t.RGB8_SNORM=36758]="RGB8_SNORM",t[t.RGBA8_SNORM=36759]="RGBA8_SNORM",t[t.RGB10_A2=32857]="RGB10_A2",t[t.RGB10_A2UI=36975]="RGB10_A2UI"}(zt||(zt={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",t[t.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",t[t.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",t[t.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",t[t.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",t[t.BYTE=5120]="BYTE",t[t.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",t[t.SHORT=5122]="SHORT",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.INT=5124]="INT",t[t.HALF_FLOAT=5131]="HALF_FLOAT",t[t.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",t[t.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",t[t.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",t[t.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"}(ga||(ga={})),function(t){t[t.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",t[t.STENCIL_INDEX8=36168]="STENCIL_INDEX8",t[t.DEPTH_STENCIL=34041]="DEPTH_STENCIL",t[t.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",t[t.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",t[t.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",t[t.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8"}(Wa||(Wa={})),function(t){t[t.STATIC_DRAW=35044]="STATIC_DRAW",t[t.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",t[t.STREAM_DRAW=35040]="STREAM_DRAW",t[t.STATIC_READ=35045]="STATIC_READ",t[t.DYNAMIC_READ=35049]="DYNAMIC_READ",t[t.STREAM_READ=35041]="STREAM_READ",t[t.STATIC_COPY=35046]="STATIC_COPY",t[t.DYNAMIC_COPY=35050]="DYNAMIC_COPY",t[t.STREAM_COPY=35042]="STREAM_COPY"}(Pr||(Pr={})),function(t){t[t.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",t[t.VERTEX_SHADER=35633]="VERTEX_SHADER"}(tp||(tp={})),function(t){t[t.FRAMEBUFFER=36160]="FRAMEBUFFER",t[t.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",t[t.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"}(Vl||(Vl={}));const cq=33984;var _o,zu,Dee;(function(t){t[t.Texture=0]="Texture",t[t.BufferObject=1]="BufferObject",t[t.VertexArrayObject=2]="VertexArrayObject",t[t.Shader=3]="Shader",t[t.Program=4]="Program",t[t.FramebufferObject=5]="FramebufferObject",t[t.Renderbuffer=6]="Renderbuffer",t[t.Sync=7]="Sync",t[t.UNCOUNTED=8]="UNCOUNTED",t[t.LinesOfCode=8]="LinesOfCode",t[t.Uniform=9]="Uniform",t[t.COUNT=10]="COUNT"})(_o||(_o={})),function(t){t[t.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",t[t.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",t[t.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",t[t.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",t[t.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",t[t.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",t[t.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",t[t.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",t[t.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",t[t.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",t[t.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",t[t.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",t[t.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",t[t.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",t[t.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",t[t.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"}(zu||(zu={})),function(t){t[t.NONE=0]="NONE",t[t.BACK=1029]="BACK"}(Dee||(Dee={}));const vme=33306;var eo,_me,bme,wme,vU,Nee,xme;(function(t){t[t.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",t[t.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",t[t.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",t[t.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",t[t.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",t[t.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",t[t.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",t[t.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",t[t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",t[t.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",t[t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(eo||(eo={})),function(t){t[t.FLOAT=5126]="FLOAT",t[t.FLOAT_VEC2=35664]="FLOAT_VEC2",t[t.FLOAT_VEC3=35665]="FLOAT_VEC3",t[t.FLOAT_VEC4=35666]="FLOAT_VEC4",t[t.INT=5124]="INT",t[t.INT_VEC2=35667]="INT_VEC2",t[t.INT_VEC3=35668]="INT_VEC3",t[t.INT_VEC4=35669]="INT_VEC4",t[t.BOOL=35670]="BOOL",t[t.BOOL_VEC2=35671]="BOOL_VEC2",t[t.BOOL_VEC3=35672]="BOOL_VEC3",t[t.BOOL_VEC4=35673]="BOOL_VEC4",t[t.FLOAT_MAT2=35674]="FLOAT_MAT2",t[t.FLOAT_MAT3=35675]="FLOAT_MAT3",t[t.FLOAT_MAT4=35676]="FLOAT_MAT4",t[t.SAMPLER_2D=35678]="SAMPLER_2D",t[t.SAMPLER_CUBE=35680]="SAMPLER_CUBE",t[t.UNSIGNED_INT=5125]="UNSIGNED_INT",t[t.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",t[t.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",t[t.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",t[t.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",t[t.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",t[t.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",t[t.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",t[t.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",t[t.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",t[t.SAMPLER_3D=35679]="SAMPLER_3D",t[t.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",t[t.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",t[t.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",t[t.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",t[t.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",t[t.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",t[t.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",t[t.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",t[t.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",t[t.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",t[t.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",t[t.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"}(_me||(_me={})),function(t){t[t.OBJECT_TYPE=37138]="OBJECT_TYPE",t[t.SYNC_CONDITION=37139]="SYNC_CONDITION",t[t.SYNC_STATUS=37140]="SYNC_STATUS",t[t.SYNC_FLAGS=37141]="SYNC_FLAGS"}(bme||(bme={})),function(t){t[t.UNSIGNALED=37144]="UNSIGNALED",t[t.SIGNALED=37145]="SIGNALED"}(wme||(wme={})),function(t){t[t.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",t[t.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",t[t.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",t[t.WAIT_FAILED=37149]="WAIT_FAILED"}(vU||(vU={})),function(t){t[t.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"}(Nee||(Nee={})),function(t){t[t.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"}(xme||(xme={}));let Hr=class{constructor(e,i,r){this.release=r,this.initializeConfiguration(e,i),this._configuration=i.snapshot(),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}destroy(){this._program=Kt(this._program),this._pipeline=this._configuration=null}reload(e){Kt(this._program),this._program=this.initializeProgram(e),this._pipeline=this.initializePipeline(e.rctx.capabilities)}get program(){return this._program}get compiled(){return this.program.compiled}get key(){return this._configuration.key}get configuration(){return this._configuration}ensureAttributeLocations(e){this.program.assertCompatibleVertexAttributeLocations(e)}get primitiveType(){return sr.TRIANGLES}getPipeline(e,i,r){return this._pipeline}initializeConfiguration(e,i){}};const Er=new Map([[J.POSITION,0],[J.NORMAL,1],[J.NORMALCOMPRESSED,1],[J.UV0,2],[J.COLOR,3],[J.COLORFEATUREATTRIBUTE,3],[J.SIZE,4],[J.TANGENT,4],[J.AUXPOS1,5],[J.SYMBOLCOLOR,5],[J.AUXPOS2,6],[J.FEATUREATTRIBUTE,6],[J.INSTANCEFEATUREATTRIBUTE,6],[J.INSTANCECOLOR,7],[J.OBJECTANDLAYERIDCOLOR,7],[J.INSTANCEOBJECTANDLAYERIDCOLOR,7],[J.INSTANCEMODEL,8],[J.INSTANCEMODELNORMAL,12],[J.INSTANCEMODELORIGINHI,11],[J.INSTANCEMODELORIGINLO,15]]),$gt=Ce.getLogger("esri.views.webgl.checkWebGLError");function Lgt(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const WIe=!!Le("enable-feature:webgl-debug");function om(){return WIe}function Fee(){return WIe}function cy(t){if(om()){const e=t.getError();if(e){const i=Lgt(t,e),r=new Error().stack;$gt.error(new se("webgl-error","WebGL error occurred",{message:i,stack:r}))}}}let Ir=class{constructor(e,i,r){this._context=e,this._locations=r,this._textures=new Map,this._freeTextureUnits=new Pi({deallocator:null}),this._glProgram=e.programCache.acquire(i.generate("vertex"),i.generate("fragment"),r),this._glProgram.stop=()=>{throw new Error("Wrapped _glProgram used directly")},this.bindPass=i.generateBindPass(this),this.bindDraw=i.generateBindDraw(this),this._fragmentUniforms=om()?i.fragmentUniforms:null}dispose(){this._glProgram.dispose()}get glName(){return this._glProgram.glName}get compiled(){return this._glProgram.compiled}setUniform1b(e,i){this._glProgram.setUniform1i(e,i?1:0)}setUniform1i(e,i){this._glProgram.setUniform1i(e,i)}setUniform1f(e,i){this._glProgram.setUniform1f(e,i)}setUniform2fv(e,i){this._glProgram.setUniform2fv(e,i)}setUniform3fv(e,i){this._glProgram.setUniform3fv(e,i)}setUniform4fv(e,i){this._glProgram.setUniform4fv(e,i)}setUniformMatrix3fv(e,i){this._glProgram.setUniformMatrix3fv(e,i)}setUniformMatrix4fv(e,i){this._glProgram.setUniformMatrix4fv(e,i)}setUniform1fv(e,i){this._glProgram.setUniform1fv(e,i)}setUniform1iv(e,i){this._glProgram.setUniform1iv(e,i)}setUniform2iv(e,i){this._glProgram.setUniform3iv(e,i)}setUniform3iv(e,i){this._glProgram.setUniform3iv(e,i)}setUniform4iv(e,i){this._glProgram.setUniform4iv(e,i)}assertCompatibleVertexAttributeLocations(e){e.locations!==this._locations&&console.error("VertexAttributeLocations are incompatible")}stop(){this._textures.clear(),this._freeTextureUnits.clear()}bindTexture(e,i){if((i==null?void 0:i.glName)==null){const n=this._textures.get(e);return n&&(this._context.bindTexture(null,n.unit),this._freeTextureUnit(n),this._textures.delete(e)),null}let r=this._textures.get(e);return r==null?(r=this._allocTextureUnit(i),this._textures.set(e,r)):r.texture=i,this._context.useProgram(this),this.setUniform1i(e,r.unit),this._context.bindTexture(i,r.unit),r.unit}rebindTextures(){this._context.useProgram(this),this._textures.forEach((e,i)=>{this._context.bindTexture(e.texture,e.unit),this.setUniform1i(i,e.unit)}),this._fragmentUniforms!=null&&this._fragmentUniforms.forEach(e=>{e.type!=="sampler2D"&&e.type!=="samplerCube"||this._textures.has(e.name)||console.error(`Texture sampler ${e.name} has no bound texture`)})}_allocTextureUnit(e){return{texture:e,unit:this._freeTextureUnits.length===0?this._textures.size:this._freeTextureUnits.pop()}}_freeTextureUnit(e){this._freeTextureUnits.push(e.unit)}};var Ln,WT,no,U2,Zu,S_,mn,Xh,Jv;(function(t){t[t.None=0]="None",t[t.Front=1]="Front",t[t.Back=2]="Back",t[t.COUNT=3]="COUNT"})(Ln||(Ln={})),function(t){t[t.Less=0]="Less",t[t.Lequal=1]="Lequal",t[t.COUNT=2]="COUNT"}(WT||(WT={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.UPDATE=1]="UPDATE"}(no||(no={})),function(t){t[t.NOT_LOADED=0]="NOT_LOADED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED"}(U2||(U2={})),function(t){t[t.IntegratedMeshMaskExcluded=1]="IntegratedMeshMaskExcluded",t[t.OutlineVisualElementMask=2]="OutlineVisualElementMask"}(Zu||(Zu={})),function(t){t[t.Highlight=0]="Highlight",t[t.MaskOccludee=1]="MaskOccludee",t[t.COUNT=2]="COUNT"}(S_||(S_={})),function(t){t[t.Blend=0]="Blend",t[t.Opaque=1]="Opaque",t[t.Mask=2]="Mask",t[t.MaskBlend=3]="MaskBlend",t[t.COUNT=4]="COUNT"}(mn||(mn={})),function(t){t[t.OFF=0]="OFF",t[t.ON=1]="ON"}(Xh||(Xh={})),function(t){t.DDS_ENCODING="image/vnd-ms.dds",t.KTX2_ENCODING="image/ktx2",t.BASIS_ENCODING="image/x.basis"}(Jv||(Jv={}));function hd(t,e,i=Xy.ADD,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}function Ol(t,e,i,r,n=Xy.ADD,s=Xy.ADD,o=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:r,opRgb:n,opAlpha:s,color:{r:o[0],g:o[1],b:o[2],a:o[3]}}}const pae={face:vm.BACK,mode:x5.CCW},YIe={face:vm.FRONT,mode:x5.CCW},Mj=t=>t===Ln.Back?pae:t===Ln.Front?YIe:null,rh={zNear:0,zFar:1},ji={r:!0,g:!0,b:!0,a:!0};function Dgt(t){return Ggt.intern(t)}function Ngt(t){return Hgt.intern(t)}function Fgt(t){return qgt.intern(t)}function kgt(t){return Wgt.intern(t)}function zgt(t){return Ygt.intern(t)}function Ugt(t){return Xgt.intern(t)}function Vgt(t){return Zgt.intern(t)}function Bgt(t){return Jgt.intern(t)}function jgt(t){return Kgt.intern(t)}function Ti(t){return Qgt.intern(t)}let l1=class{constructor(e,i){this._makeKey=e,this._makeRef=i,this._interns=new Map}intern(e){if(!e)return null;const i=this._makeKey(e),r=this._interns;return r.has(i)||r.set(i,this._makeRef(e)),r.get(i)??null}};function c1(t){return"["+t.join(",")+"]"}const Ggt=new l1(XIe,t=>({__tag:"Blending",...t}));function XIe(t){return t?c1([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const Hgt=new l1(ZIe,t=>({__tag:"Culling",...t}));function ZIe(t){return t?c1([t.face,t.mode]):null}const qgt=new l1(JIe,t=>({__tag:"PolygonOffset",...t}));function JIe(t){return t?c1([t.factor,t.units]):null}const Wgt=new l1(KIe,t=>({__tag:"DepthTest",...t}));function KIe(t){return t?c1([t.func]):null}const Ygt=new l1(QIe,t=>({__tag:"StencilTest",...t}));function QIe(t){return t?c1([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const Xgt=new l1(e$e,t=>({__tag:"DepthWrite",...t}));function e$e(t){return t?c1([t.zNear,t.zFar]):null}const Zgt=new l1(t$e,t=>({__tag:"ColorWrite",...t}));function t$e(t){return t?c1([t.r,t.g,t.b,t.a]):null}const Jgt=new l1(i$e,t=>({__tag:"StencilWrite",...t}));function i$e(t){return t?c1([t.mask]):null}const Kgt=new l1(r$e,t=>({__tag:"DrawBuffers",...t}));function r$e(t){return t?c1(t.buffers):null}const Qgt=new l1(eyt,t=>({blending:Dgt(t.blending),culling:Ngt(t.culling),polygonOffset:Fgt(t.polygonOffset),depthTest:kgt(t.depthTest),stencilTest:zgt(t.stencilTest),depthWrite:Ugt(t.depthWrite),colorWrite:Vgt(t.colorWrite),stencilWrite:Bgt(t.stencilWrite),drawBuffers:jgt(t.drawBuffers)}));function eyt(t){return t?c1([XIe(t.blending),ZIe(t.culling),JIe(t.polygonOffset),KIe(t.depthTest),QIe(t.stencilTest),e$e(t.depthWrite),t$e(t.colorWrite),i$e(t.stencilWrite),r$e(t.drawBuffers)]):null}let tyt=class{constructor(e){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=e}setPipeline(e){(this._pipelineInvalid||e!==this._pipeline)&&(this._setBlending(e.blending),this._setCulling(e.culling),this._setPolygonOffset(e.polygonOffset),this._setDepthTest(e.depthTest),this._setStencilTest(e.stencilTest),this._setDepthWrite(e.depthWrite),this._setColorWrite(e.colorWrite),this._setStencilWrite(e.stencilWrite),this._setDrawBuffers(e.drawBuffers),this._pipeline=e),this._pipelineInvalid=!1}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(e){this._blending=this._setSubState(e,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(e){this._culling=this._setSubState(e,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(e){this._polygonOffset=this._setSubState(e,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(e){this._depthTest=this._setSubState(e,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(e){this._stencilTest=this._setSubState(e,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(e){this._depthWrite=this._setSubState(e,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(e){this._colorWrite=this._setSubState(e,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(e){this._stencilWrite=this._setSubState(e,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(e){this._drawBuffers=this._setSubState(e,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(e,i,r,n){return(r||e!==i)&&(n(e),this._pipelineInvalid=!0),e}},iyt=class extends _n{constructor(){super(...arguments),this.heightParameters=Xi(),this.radii=yt(),this.innerFadeDistance=0,this.altitudeFade=0,this.hazeStrength=1,this.renderScale=yt(),this.backgroundColor=W()}},tI=class n$e extends Hr{initializeProgram(e){return new Ir(e.rctx,n$e.shader.get().build(this.configuration),Er)}initializePipeline(){return this.configuration.reduced?Ti({blending:hd(st.ONE,st.ZERO),depthTest:{func:Zr.ALWAYS},colorWrite:ji}):this.configuration.haze?Ti({blending:Ol(st.ONE,st.ZERO,st.ONE_MINUS_SRC_COLOR,st.ONE),colorWrite:ji}):Ti({blending:hd(st.SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),depthTest:{func:Zr.LEQUAL},colorWrite:ji})}};tI.shader=new Rr(Igt,()=>we(()=>Promise.resolve().then(()=>dWt),void 0));let nh=class extends _n{constructor(){super(),this._key="",this._keyDirty=!1,this._parameterBits=this._parameterBits?this._parameterBits.map(()=>0):[],this._parameterNames||(this._parameterNames=[])}get key(){return this._keyDirty&&(this._keyDirty=!1,this._key=String.fromCharCode.apply(String,this._parameterBits)),this._key}snapshot(){const e=this._parameterNames,i={key:this.key};for(const r of e)i[r]=this[r];return i}};function fe(t={}){return(e,i)=>{if(e._parameterNames=e._parameterNames??[],e._parameterNames.push(i),t.constValue!=null)Object.defineProperty(e,i,{get:()=>t.constValue});else{const r=e._parameterNames.length-1,n=t.count||2,s=Math.ceil(Math.log2(n)),o=e._parameterBits??[0];let l=0;for(;o[l]+s>16;)l++,l>=o.length&&o.push(0);e._parameterBits=o;const c=o[l],f=(1<this._remove(r,n))}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}pop(e){const i=this._cache.peek(e);if(!i)return;const r=i.pop();if(i.length>0){const n=i.reduce((s,o)=>s+o.usedMemory,0);this._cache.updateSize(e,i,n)}else this._cache.pop(e);return r}put(e,i,r=t$){const n=this._cache.peek(e);if(!n)return void this._cache.put(e,[i],i.usedMemory,r);n.push(i);const s=n.reduce((o,l)=>o+l.usedMemory,0);this._cache.updateSize(e,n,s)}_remove(e,i){var r;switch(i){case nm.ALL:return e.forEach(n=>n.dispose()),0;case nm.SOME:return(r=e.shift())==null||r.dispose(),e.reduce((n,s)=>n+s.usedMemory,0)}}},uq=class{constructor(e,i){this._last=new Pi,this._incarnation=0,this._cache=new G9(e,i)}destroy(){var e;(e=this._last)==null||e.forAll(i=>i.dispose()),this._last=null,this._cache.destroy()}set interactive(e){var i;e&&!this._last?this._last=new Pi:e||((i=this._last)==null||i.forAll(r=>r.dispose()),this._last=null)}clean(){var e;(e=this._last)==null||e.filterInPlace(i=>!(i.incarnationr.key===e);if(i)return this._last.removeUnordered(i),i}return this._cache.pop(e)}put(e){e.incarnation=this._incarnation,this._last?this._last.push(e):this._cache.put(e.key,e)}get usedMemory(){var e;return((e=this._last)==null?void 0:e.reduce((i,r)=>i+r.usedMemory,0))??0}};var cr;function kee(t,e,i={}){const r=e===cr.WEBGL1?"webgl":"webgl2";return t.getContext(r,i)||null}function ryt(t,e,i={}){const r=s$e(t);for(const n of r){const s=kee(e,n,i);if(s)return s}return null}function s$e(t){if(t==="3d")return[cr.WEBGL2];const e=Le("esri-force-webgl");return e===cr.WEBGL1||e===cr.WEBGL2?[e]:Le("mac")&&Le("chrome")?[cr.WEBGL1,cr.WEBGL2]:[cr.WEBGL2,cr.WEBGL1]}(function(t){t[t.WEBGL1=1]="WEBGL1",t[t.WEBGL2=2]="WEBGL2"})(cr||(cr={}));const tg=Ce.getLogger("esri.views.webgl.BufferObject");let Yr=class VA{static createIndex(e,i,r){return new VA(e,fi.ELEMENT_ARRAY_BUFFER,i,r)}static createVertex(e,i,r){return new VA(e,fi.ARRAY_BUFFER,i,r)}static createUniform(e,i,r){if(e.type!==cr.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new VA(e,fi.UNIFORM_BUFFER,i,r)}static createPixelPack(e,i=Pr.STREAM_READ,r){if(e.type!==cr.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const n=new VA(e,fi.PIXEL_PACK_BUFFER,i);return r&&n.setSize(r),n}static createPixelUnpack(e,i=Pr.STREAM_DRAW,r){if(e.type!==cr.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new VA(e,fi.PIXEL_UNPACK_BUFFER,i,r)}constructor(e,i,r,n){this._context=e,this.bufferType=i,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(_o.BufferObject,this),this._glName=this._context.gl.createBuffer(),cy(this._context.gl),n&&this.setData(n)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===fi.ELEMENT_ARRAY_BUFFER?this._indexType===Yt.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===fi.ELEMENT_ARRAY_BUFFER||this.bufferType===fi.ARRAY_BUFFER}dispose(){var e;(e=this._context)!=null&&e.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(_o.BufferObject,this),this._context=null):this._glName&&tg.warn("Leaked WebGL buffer object")}setSize(e,i=null){if(e<=0&&tg.error("Buffer size needs to be positive!"),this.bufferType===fi.ELEMENT_ARRAY_BUFFER&&i!=null)switch(this._indexType=i,i){case Yt.UNSIGNED_SHORT:e*=2;break;case Yt.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let i=e.byteLength;this.bufferType===fi.ELEMENT_ARRAY_BUFFER&&(jV(e)&&(i/=2,this._indexType=Yt.UNSIGNED_SHORT),HV(e)&&(i/=4,this._indexType=Yt.UNSIGNED_INT)),this._setBufferData(i,e)}_setBufferData(e,i=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;i!=null?n.bufferData(this.bufferType,i,this.usage):n.bufferData(this.bufferType,e,this.usage),cy(n),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,i,r,n){if(!e)return;(i<0||i*e.BYTES_PER_ELEMENT>=this.byteLength)&&tg.error("offset is out of range!"),r>=n&&tg.error("end must be bigger than start!"),(i+(n-r))*e.BYTES_PER_ELEMENT>this.byteLength&&tg.error("An attempt to write beyond the end of the buffer!");const s=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const o=this._context.gl;if(this._context.type===cr.WEBGL2)o.bufferSubData(this.bufferType,i*e.BYTES_PER_ELEMENT,e,r,n-r);else{const l=r===0&&n===e.length?e:e.subarray(r,n);o.bufferSubData(this.bufferType,i*e.BYTES_PER_ELEMENT,l)}cy(o),this._isVAOAware&&this._context.bindVAO(s)}getSubData(e,i=0,r,n){if(this._context.type!==cr.WEBGL2)return void tg.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||n<0)return void tg.error("Problem getting subdata: offset and length were less than zero!");const s=nyt(e)?e.BYTES_PER_ELEMENT:1;if(s*((r??0)+(n??0))>e.byteLength)return void tg.error("Problem getting subdata: offset and length exceeded destination size!");i+s*(n??0)>this.byteLength&&tg.warn("Potential problem getting subdata: requested data exceeds buffer size!");const o=this._context.gl;this._context.bindBuffer(this,fi.COPY_READ_BUFFER),o.getBufferSubData(fi.COPY_READ_BUFFER,i,e,r,n),this._context.unbindBuffer(fi.COPY_READ_BUFFER)}async getSubDataAsync(e,i=0,r,n){this._context.type===cr.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,i,r,n)):tg.error("Get buffer subdata is supported in WebGL2 only!")}};function nyt(t){return Cje(t)}var V2;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(V2||(V2={}));function syt(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function Kv(t,e){return t.vertexBuffers[e].byteLength/oyt(t.layout[e])}function oyt(t){return t[0].stride}function fae(t,e,i,r,n=0){var o,l,c;const s=t.gl;t.bindBuffer(i);for(const f of r){const _=e.get(f.name);_===void 0&&console.error(`There is no location for vertex attribute '${f.name}' defined.`);const x=n*f.stride;if(f.count<=4)s.vertexAttribPointer(_,f.count,f.type,f.normalized,f.stride,f.offset+x),s.enableVertexAttribArray(_),f.divisor>0&&((o=t.gl2)==null||o.vertexAttribDivisor(_,f.divisor));else if(f.count===9)for(let T=0;T<3;T++)s.vertexAttribPointer(_+T,3,f.type,f.normalized,f.stride,f.offset+12*T+x),s.enableVertexAttribArray(_+T),f.divisor>0&&((l=t.gl2)==null||l.vertexAttribDivisor(_+T,f.divisor));else if(f.count===16)for(let T=0;T<4;T++)s.vertexAttribPointer(_+T,4,f.type,f.normalized,f.stride,f.offset+16*T+x),s.enableVertexAttribArray(_+T),f.divisor>0&&((c=t.gl2)==null||c.vertexAttribDivisor(_+T,f.divisor));else console.error("Unsupported vertex attribute element count: "+f.count)}}function mae(t,e,i,r){var s,o,l;const n=t.gl;t.bindBuffer(i);for(const c of r){const f=e.get(c.name);if(c.count<=4)n.disableVertexAttribArray(f),c.divisor&&c.divisor>0&&((s=t.gl2)==null||s.vertexAttribDivisor(f,0));else if(c.count===9)for(let _=0;_<3;_++)n.disableVertexAttribArray(f+_),c.divisor&&c.divisor>0&&((o=t.gl2)==null||o.vertexAttribDivisor(f+_,0));else if(c.count===16)for(let _=0;_<4;_++)n.disableVertexAttribArray(f+_),c.divisor&&c.divisor>0&&((l=t.gl2)==null||l.vertexAttribDivisor(f+_,0));else console.error("Unsupported vertex attribute element count: "+c.count)}t.unbindBuffer(fi.ARRAY_BUFFER)}function gae(t){switch(t){case ci.ALPHA:case ci.LUMINANCE:case ci.RED:case ci.RED_INTEGER:case zt.R8:case zt.R8I:case zt.R8UI:case zt.R8_SNORM:case Wa.STENCIL_INDEX8:return 1;case ci.LUMINANCE_ALPHA:case ci.RG:case ci.RG_INTEGER:case zt.RGBA4:case zt.R16F:case zt.R16I:case zt.R16UI:case zt.RG8:case zt.RG8I:case zt.RG8UI:case zt.RG8_SNORM:case zt.RGB565:case zt.RGB5_A1:case Wa.DEPTH_COMPONENT16:return 2;case ci.DEPTH_COMPONENT:case ci.RGB:case ci.RGB_INTEGER:case zt.RGB8:case zt.RGB8I:case zt.RGB8UI:case zt.RGB8_SNORM:case zt.SRGB8:case Wa.DEPTH_COMPONENT24:return 3;case ci.DEPTH_STENCIL:case ci.DEPTH24_STENCIL8:case ci.RGBA:case ci.RGBA_INTEGER:case zt.RGBA8:case zt.R32F:case zt.R11F_G11F_B10F:case zt.RG16F:case zt.R32I:case zt.R32UI:case zt.RG16I:case zt.RG16UI:case zt.RGBA8I:case zt.RGBA8UI:case zt.RGBA8_SNORM:case zt.SRGB8_ALPHA8:case zt.RGB9_E5:case zt.RGB10_A2UI:case zt.RGB10_A2:case Wa.DEPTH_STENCIL:case Wa.DEPTH_COMPONENT32F:case Wa.DEPTH24_STENCIL8:return 4;case Wa.DEPTH32F_STENCIL8:return 5;case zt.RGB16F:case zt.RGB16I:case zt.RGB16UI:return 6;case zt.RG32F:case zt.RG32I:case zt.RG32UI:case zt.RGBA16F:case zt.RGBA16I:case zt.RGBA16UI:return 8;case zt.RGB32F:case zt.RGB32I:case zt.RGB32UI:return 12;case zt.RGBA32F:case zt.RGBA32I:case zt.RGBA32UI:return 16;case eo.COMPRESSED_RGB_S3TC_DXT1_EXT:case eo.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case eo.COMPRESSED_RGBA_S3TC_DXT3_EXT:case eo.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case eo.COMPRESSED_R11_EAC:case eo.COMPRESSED_SIGNED_R11_EAC:case eo.COMPRESSED_RGB8_ETC2:case eo.COMPRESSED_SRGB8_ETC2:case eo.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case eo.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case eo.COMPRESSED_RG11_EAC:case eo.COMPRESSED_SIGNED_RG11_EAC:case eo.COMPRESSED_RGBA8_ETC2_EAC:case eo.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let $F=class{constructor(e,i,r=i){this.internalFormat=e,this.width=i,this.height=r,this.multisampled=!1,this.samples=1}};function ayt(t){return t.width<=0||t.height<=0||t.internalFormat==null?0:t.width*t.height*gae(t.internalFormat)}let o$e=class{constructor(e,i){this._context=e,this._descriptor=i,this.type=V2.RenderBuffer,this._context.instanceCounter.increment(_o.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:n,height:s,internalFormat:o,multisampled:l}=i;if(l){if(this._context.type!==cr.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,o,n,s)}else r.renderbufferStorage(r.RENDERBUFFER,o,n,s)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,i=this._context.parameters.maxSamples;return e?Math.min(e,i):i}get gpuMemoryUsage(){return ayt(this._descriptor)}resize(e,i){const r=this._descriptor;if(r.width===e&&r.height===i)return;r.width=e,r.height=i;const n=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?n.renderbufferStorageMultisample(n.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):n.renderbufferStorage(n.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(_o.Renderbuffer,this),this._context=null)}},tn=class{constructor(e=0,i=e){this.width=e,this.height=i,this.target=Hs.TEXTURE_2D,this.pixelFormat=ci.RGBA,this.dataType=ga.UNSIGNED_BYTE,this.samplingMode=ki.LINEAR,this.wrapMode=Bi.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function lyt(t){return t.width<=0||t.height<=0?0:t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:gae(t.internalFormat))}let cyt=class a$e extends tn{constructor(e,i){switch(super(),this.context=e,Object.assign(this,i),this.internalFormat){case zt.R16F:case zt.R16I:case zt.R16UI:case zt.R32F:case zt.R32I:case zt.R32UI:case zt.R8_SNORM:case zt.R8:case zt.R8I:case zt.R8UI:this.pixelFormat=ci.RED}}static validate(e,i){return new a$e(e,i)}};const Sme=4;let Ai=class{constructor(e,i=null,r=null){if(this.type=V2.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,r=i;else{const n=cyt.validate(e,i);if(!n)throw new se("Texture descriptor invalid");this._descriptor=n}if(this._descriptor.context.type!==cr.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),q3(this._descriptor.target)))throw new se("3D and array textures are not supported in WebGL1");this._descriptor.target===Hs.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get gpuMemoryUsage(){return fyt.delete(this),lyt(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(_o.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new se("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===Hs.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let i=Hs.TEXTURE_CUBE_MAP_POSITIVE_X;i<=Hs.TEXTURE_CUBE_MAP_NEGATIVE_Z;i++)this._setData(e,i)}setData(e){this._setData(e)}_setData(e,i){var f;if(!((f=this._descriptor.context)!=null&&f.gl))return;const r=this._descriptor.context.gl;cy(r),this._glName||(this._glName=r.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(_o.Texture,this)),e===void 0&&(e=null);const n=this._descriptor,s=i??n.target,o=q3(s);e===null&&(n.width=n.width||Sme,n.height=n.height||Sme,o&&(n.depth=n.depth??1));const l=this._descriptor.context.bindTexture(this,Ai.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(Ai.TEXTURE_UNIT_FOR_UPDATES),hq(this._descriptor.context,n),this._configurePixelStorage(),cy(r);const c=this._deriveInternalFormat();if(dq(e)){let _="width"in e?e.width:e.codedWidth,x="height"in e?e.height:e.codedHeight;const T=1;e instanceof HTMLVideoElement&&(_=e.videoWidth,x=e.videoHeight),n.width&&n.height,o&&n.depth,n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,c,n.hasMipmap,_,x,T),this._texImage(s,0,c,_,x,T,e),cy(r),n.hasMipmap&&this.generateMipmap(),n.width||(n.width=_),n.height||(n.height=x),o&&!n.depth&&(n.depth=T)}else{const{width:_,height:x,depth:T}=n;if(_==null||x==null)throw new se("Width and height must be specified!");if(o&&T==null)throw new se("Depth must be specified!");if(n.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(s,c,n.hasMipmap,_,x,T),LF(e)){const A=e.levels,M=Cme(s,_,x,T),I=Math.min(M-1,A.length-1);this._descriptor.context.gl2!=null?r.texParameteri(n.target,this._descriptor.context.gl2.TEXTURE_MAX_LEVEL,I):n.hasMipmap=n.hasMipmap&&M===A.length;const L=c;if(!dyt(L))throw new se("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((F,z,k,U)=>{const j=A[Math.min(F,A.length-1)];this._compressedTexImage(s,F,L,z,k,U,j)},I)}else this._texImage(s,0,c,_,x,T,e),cy(r),n.hasMipmap&&this.generateMipmap()}Tme(r,this._descriptor),Eme(r,this._descriptor),uyt(this._descriptor.context,this._descriptor),cy(r),this._descriptor.context.bindTexture(l,Ai.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,i,r,n,s,o,l=0){o||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const c=this._descriptor.context.gl,f=this._descriptor.context.gl2,_=this._descriptor,x=this._deriveInternalFormat(),{pixelFormat:T,dataType:A,target:M,isImmutable:I}=_;if(I&&!this._wasImmutablyAllocated)throw new se("Cannot update immutable texture before allocation!");const L=this._descriptor.context.bindTexture(this,Ai.TEXTURE_UNIT_FOR_UPDATES,!0);if((i<0||r<0||n>_.width||s>_.height||i+n>_.width||r+s>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),l){if(!f)return void console.error("Webgl2 must be enabled to use dataRowOffset!");c.pixelStorei(f.UNPACK_SKIP_ROWS,l)}if(dq(o)?f?f.texSubImage2D(M,e,i,r,n,s,T,A,o):c.texSubImage2D(M,e,i,r,T,A,o):LF(o)?c.compressedTexSubImage2D(M,e,i,r,n,s,x,o.levels[e]):c.texSubImage2D(M,e,i,r,n,s,T,A,o),l){if(!f)return void console.error("Webgl2 must be enabled to use dataRowOffset!");c.pixelStorei(f.UNPACK_SKIP_ROWS,0)}this._descriptor.context.bindTexture(L,Ai.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,i,r,n,s,o,l,c){c||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const f=this._descriptor.context.gl2;if(f==null)throw new se("3D textures are not supported in WebGL1");const _=this._descriptor,x=this._deriveInternalFormat(),{pixelFormat:T,dataType:A,isImmutable:M,target:I}=_;if(M&&!this._wasImmutablyAllocated)throw new se("Cannot update immutable texture before allocation!");q3(I)||console.warn("Attempting to set 3D texture data on a non-3D texture");const L=this._descriptor.context.bindTexture(this,Ai.TEXTURE_UNIT_FOR_UPDATES);if(this._descriptor.context.setActiveTexture(Ai.TEXTURE_UNIT_FOR_UPDATES),(i<0||r<0||n<0||s>_.width||o>_.height||l>_.depth||i+s>_.width||r+o>_.height||n+l>_.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),LF(c))c=c.levels[e],f.compressedTexSubImage3D(I,e,i,r,n,s,o,l,x,c);else{const F=c;f.texSubImage3D(I,e,i,r,n,s,o,l,T,A,F)}this._descriptor.context.bindTexture(L,Ai.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new se("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,hq(this._descriptor.context,e)}e.samplingMode===ki.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=ki.LINEAR_MIPMAP_NEAREST):e.samplingMode===ki.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=ki.NEAREST_MIPMAP_NEAREST);const i=this._descriptor.context.bindTexture(this,Ai.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(Ai.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(i,Ai.TEXTURE_UNIT_FOR_UPDATES)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,hq(this._descriptor.context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor.context.gl,i=this._descriptor;this._samplingModeDirty&&(Tme(e,i),this._samplingModeDirty=!1),this._wrapModeDirty&&(Eme(e,i),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.context.type===cr.WEBGL1)return this._descriptor.internalFormat=this._descriptor.pixelFormat;if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===ci.DEPTH_STENCIL&&(this._descriptor.internalFormat=ci.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case ga.FLOAT:switch(this._descriptor.pixelFormat){case ci.RGBA:return this._descriptor.internalFormat=zt.RGBA32F;case ci.RGB:return this._descriptor.internalFormat=zt.RGB32F;default:throw new se("Unable to derive format")}case ga.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case ci.RGBA:return this._descriptor.internalFormat=zt.RGBA8;case ci.RGB:return this._descriptor.internalFormat=zt.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===ci.DEPTH_STENCIL?ci.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:i,flipped:r,preMultiplyAlpha:n}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,i),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n?1:0)}_texStorage(e,i,r,n,s,o){const l=this._descriptor.context.gl2;if(l==null)throw new se("Immutable textures are not supported in WebGL1");if(!hyt(i))throw new se("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const c=r?Cme(e,n,s,o):1;if(q3(e)){if(o==null)throw new se("Missing depth dimension for 3D texture upload");l.texStorage3D(e,c,i,n,s,o)}else l.texStorage2D(e,c,i,n,s);this._wasImmutablyAllocated=!0}_texImage(e,i,r,n,s,o,l){const c=this._descriptor.context.gl,f=q3(e),{isImmutable:_,pixelFormat:x,dataType:T}=this._descriptor,A=this._descriptor.context.type===cr.WEBGL2,M=A?c:null;if(A||!dq(l))if(_){if(l!=null){const I=l;if(f){if(o==null)throw new se("Missing depth dimension for 3D texture upload");M.texSubImage3D(e,i,0,0,0,n,s,o,x,T,I)}else c.texSubImage2D(e,i,0,0,n,s,x,T,I)}}else{const I=l;if(f){if(o==null)throw new se("Missing depth dimension for 3D texture upload");M.texImage3D(e,i,r,n,s,o,0,x,T,I)}else c.texImage2D(e,i,r,n,s,0,x,T,I)}else c.texImage2D(e,0,r,x,T,l)}_compressedTexImage(e,i,r,n,s,o,l){const c=this._descriptor.context.gl;let f=null;const _=q3(e),x=this._descriptor.isImmutable;if(_){if(this._descriptor.context.type!==cr.WEBGL2)throw new se("3D textures are not supported in WebGL1");f=c}if(x){if(l!=null)if(_){if(o==null)throw new se("Missing depth dimension for 3D texture upload");f.compressedTexSubImage3D(e,i,0,0,0,n,s,o,r,l)}else c.compressedTexSubImage2D(e,i,0,0,n,s,r,l)}else if(_){if(o==null)throw new se("Missing depth dimension for 3D texture upload");f.compressedTexImage3D(e,i,r,n,s,o,0,l)}else c.compressedTexImage2D(e,i,r,n,s,0,l)}_forEachMipmapLevel(e,i=1/0){let{width:r,height:n,depth:s,hasMipmap:o,target:l}=this._descriptor;const c=l===Hs.TEXTURE_3D;if(r==null||n==null||c&&s==null)throw new se("Missing texture dimensions for mipmap calculation");for(let f=0;e(f,r,n,s),o&&(r!==1||n!==1||c&&s!==1)&&!(f>=i);++f)r=Math.max(1,r>>1),n=Math.max(1,n>>1),c&&(s=Math.max(1,s>>1))}};function hq(t,e){(e.width!=null&&e.width<0||e.height!=null&&e.height<0||e.depth!=null&&e.depth<0)&&console.error("Negative dimension parameters are not allowed!");const i=t.type===cr.WEBGL2;i||!e.isImmutable&&!q3(e.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),!i&&(e.width!=null&&BT(e.width)&&e.height!=null&&BT(e.height)||(typeof e.wrapMode=="number"?e.wrapMode!==Bi.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):e.wrapMode.s===Bi.CLAMP_TO_EDGE&&e.wrapMode.t===Bi.CLAMP_TO_EDGE||console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"),e.hasMipmap&&console.error("Mipmapping requires power-of-two textures!")))}function Tme(t,e){let i=e.samplingMode,r=e.samplingMode;i===ki.LINEAR_MIPMAP_NEAREST||i===ki.LINEAR_MIPMAP_LINEAR?(i=ki.LINEAR,e.hasMipmap||(r=ki.LINEAR)):i!==ki.NEAREST_MIPMAP_NEAREST&&i!==ki.NEAREST_MIPMAP_LINEAR||(i=ki.NEAREST,e.hasMipmap||(r=ki.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,i),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,r)}function Eme(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function uyt(t,e){const i=t.capabilities.textureFilterAnisotropic;i&&t.gl.texParameterf(e.target,i.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function hyt(t){return t in zt}function dyt(t){return t in eo}function LF(t){return t!=null&&"type"in t&&t.type==="compressed"}function pyt(t){return t!=null&&"byteLength"in t}function dq(t){return t!=null&&!LF(t)&&!pyt(t)}function q3(t){return t===Hs.TEXTURE_3D||t===Hs.TEXTURE_2D_ARRAY}function Cme(t,e,i,r=1){let n=Math.max(e,i);return t===Hs.TEXTURE_3D&&(n=Math.max(n,r)),Math.round(Math.log(n)/Math.LN2)+1}Ai.TEXTURE_UNIT_FOR_UPDATES=0;const fyt=new Map,myt=Ce.getLogger("esri.views.webgl.FramebufferObject");let Hm=class BA{constructor(e,i,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(_o.FramebufferObject,this);const n=DF(i)?i:new Ai(this._context,i);if(this._colorAttachments.set(zu.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(zu.COLOR_ATTACHMENT0),r!=null)if(yyt(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=DF(r)?r:new Ai(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const s=gyt(r)?r:new o$e(this._context,r);this._depthStencilBuffer=s,this._validateRenderBufferDescriptor(s.descriptor)}}dispose(){var i,r;if(this._colorAttachments.size===0&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((n,s)=>{var o;return(o=this.detachColorTexture(s))==null?void 0:o.dispose()}),(i=this.detachDepthStencilBuffer())==null||i.dispose(),(r=this.detachDepthStencilTexture())==null||r.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(_o.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(zu.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){var i;const e=this._colorAttachments.get(zu.COLOR_ATTACHMENT0);return((i=e==null?void 0:e.descriptor)==null?void 0:i.width)??0}get height(){var i;const e=this._colorAttachments.get(zu.COLOR_ATTACHMENT0);return((i=e==null?void 0:e.descriptor)==null?void 0:i.height)??0}get gpuMemoryUsage(){var e;return[...this._colorAttachments].reduce((i,[r,n])=>i+n.gpuMemoryUsage,((e=this.depthStencil)==null?void 0:e.gpuMemoryUsage)??0)}getColorTexture(e){const i=this._colorAttachments.get(e);return i&&DF(i)?i:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,i=zu.COLOR_ATTACHMENT0){var n;if(!e)return;this._validateColorAttachmentPoint(i);const r=e.descriptor;this._validateTextureDescriptor(r),(n=this.detachColorTexture(i))==null||n.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,i)),this._colorAttachments.set(i,e)}detachColorTexture(e=zu.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);if(i){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(e),i}}setColorTextureTarget(e,i=zu.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(i);r&&this._framebufferTexture2D(r.glName,i,e)}attachDepthStencil(e){if(e)switch(e.type){case V2.Texture:return this._attachDepthStencilTexture(e);case V2.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){var r;if(e==null)return;const i=e.descriptor;i.pixelFormat!==ci.DEPTH_STENCIL&&i.pixelFormat!==ci.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),i.dataType!==ga.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(i),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,vme)),(r=this._depthStencilTexture)==null||r.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,vme)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(e==null)return;const i=e.descriptor;if(this._validateRenderBufferDescriptor(i),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(i);r.framebufferRenderbuffer(Vl.FRAMEBUFFER,n,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const i=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);i.framebufferRenderbuffer(Vl.FRAMEBUFFER,r,i.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,i,r,n,s,o,l){(e<0||i<0||s<0||o<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const c=l.descriptor;l.descriptor.target!==Hs.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),((c==null?void 0:c.width)==null||(c==null?void 0:c.height)==null||e+r>this.width||i+n>this.height||s+r>c.width||o+n>c.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const f=this._context,_=f.bindTexture(l,Ai.TEXTURE_UNIT_FOR_UPDATES);f.setActiveTexture(Ai.TEXTURE_UNIT_FOR_UPDATES),f.bindFramebuffer(this),f.gl.copyTexSubImage2D(Hs.TEXTURE_2D,0,s,o,e,i,r,n),f.bindTexture(_,Ai.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,i,r,n,s,o,l){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),l||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,i,r,n,s,o,l)}async readPixelsAsync(e,i,r,n,s,o,l){if(this._context.type!==cr.WEBGL2)return om()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,i,r,n,s,o,l);const c=this._context.gl,f=Yr.createPixelPack(this._context,Pr.STREAM_READ,l.byteLength);this._context.bindBuffer(f),this._context.bindFramebuffer(this),c.readPixels(e,i,r,n,s,o,0),this._context.unbindBuffer(fi.PIXEL_PACK_BUFFER),await f.getSubDataAsync(l),f.dispose()}resize(e,i){var n,s;if(this.width===e&&this.height===i)return;const r={width:e,height:i};KS(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(o=>o.resize(r.width,r.height)),(n=this._depthStencilTexture)==null||n.resize(r.width,r.height),this._initialized&&(KS(r,this._context.parameters.maxRenderbufferSize),(s=this._depthStencilBuffer)==null||s.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=Vl.FRAMEBUFFER){const i=this._context.gl;if(this._initialized)return void i.bindFramebuffer(e,this.glName);this._glName&&i.deleteFramebuffer(this._glName);const r=i.createFramebuffer();if(i.bindFramebuffer(e,r),this._colorAttachments.forEach((n,s)=>this._framebufferTexture2D(n.glName,s,Ame(n),e)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);i.framebufferRenderbuffer(e,n,i.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,i.DEPTH_STENCIL_ATTACHMENT,Ame(this._depthStencilTexture),e);om()&&i.checkFramebufferStatus(e)!==i.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,i=zu.COLOR_ATTACHMENT0,r=Hs.TEXTURE_2D,n=Vl.FRAMEBUFFER,s=0){this._context.gl.framebufferTexture2D(n,i,r,e,s)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const i=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(Vl.FRAMEBUFFER,i,e.RENDERBUFFER,null)}this._depthStencilBuffer=Kt(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=Kt(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==Hs.TEXTURE_2D&&e.target!==Hs.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),KS(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){KS(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case Wa.DEPTH_COMPONENT16:case Wa.DEPTH_COMPONENT24:case Wa.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case Wa.DEPTH24_STENCIL8:case Wa.DEPTH32F_STENCIL8:case Wa.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case Wa.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(BA._MAX_COLOR_ATTACHMENTS===-1){const r=this._context.capabilities.drawBuffers;if(r){const n=this._context.gl;BA._MAX_COLOR_ATTACHMENTS=n.getParameter(r.MAX_COLOR_ATTACHMENTS)}else BA._MAX_COLOR_ATTACHMENTS=1}const i=e-zu.COLOR_ATTACHMENT0;i+1>BA._MAX_COLOR_ATTACHMENTS&&Ce.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${i+1}. Implementation supports up to ${BA._MAX_COLOR_ATTACHMENTS} color attachments`)}};function DF(t){return t!=null&&"type"in t&&t.type===V2.Texture}function gyt(t){return t!=null&&"type"in t&&t.type===V2.RenderBuffer}function yyt(t){return DF(t)||t!=null&&"pixelFormat"in t}function KS(t,e){const i=Math.max(t.width,t.height);if(i>e){myt.warn(`Resizing FBO attachment size ${t.width}x${t.height} to device limit ${e}`);const r=e/i;return t.width=Math.round(t.width*r),t.height=Math.round(t.height*r),!1}return!0}function Ame(t){return t.descriptor.target===Hs.TEXTURE_CUBE_MAP?Hs.TEXTURE_CUBE_MAP_POSITIVE_X:Hs.TEXTURE_2D}Hm._MAX_COLOR_ATTACHMENTS=-1;let vyt=class{constructor(e){this.rctx=e,this._acquired=new Set,this._cache=new uq(e.newCache,"FBOCache"),this._depthCache=new uq(e.newCache,"DepthAttachmentCache"),this._colorCache=new uq(e.newCache,"ColorAttachmentCache")}destroy(){this._cache.destroy(),this._depthCache.destroy(),this._colorCache.destroy()}clean(){this._cache.clean(),this._colorCache.clean(),this._depthCache.clean()}frame(){this._cache.frame(),this._colorCache.frame(),this._depthCache.frame()}get usedMemory(){return Array.from(this._acquired.values()).reduce((e,i)=>{var r;return e+("colorTexture"in i?((r=i.colorTexture)==null?void 0:r.gpuMemoryUsage)??0:i.usedMemory)},this._cache.usedMemory+this._colorCache.usedMemory+this._depthCache.usedMemory)}set interactive(e){this._cache.interactive=this._colorCache.interactive=this._depthCache.interactive=e}acquire(e,i,r){const n=pq(e,i,r),s=this._cache.pop(n)||new _yt(n,new Hm(this.rctx,{...Ome[e],width:i,height:r}),o=>(s.releaseDepth(),s.depth=this._acquireDepth(o,s.fbo.width,s.fbo.height),s.fbo.attachDepthStencil(s.depth.attachment),s),(o,l)=>{const c=this._acquireColor(o,i,r);return s.colors??(s.colors=new Map),s.colors.set(l,c),s.fbo.attachColorTexture(c.attachment,l),s});return s.release=()=>{this._acquired.delete(s),s.releaseDepth(),this._cache.put(s),s.release=()=>console.log(`Double FBO release in ${new Error().stack}`)},this.rctx.unbindTexture(s.fbo.colorTexture),this._trackHandle(s)}acquireDepth(e,i,r){return this._acquireDepth(e,i,r)}_acquireDepth(e,i,r){const n=pq(e,i,r),s=this._depthCache.pop(n);if(s)return this._trackHandle(s);const o=e===la.DEPTH_STENCIL_TEXTURE?new Mme(n,new Ai(this.rctx,{...Pme[e],width:i,height:r}),()=>{this._acquired.delete(o),this._depthCache.put(o)}):new Mme(n,new o$e(this.rctx,{...Pme[e],width:i,height:r}),()=>{this._acquired.delete(o),this._depthCache.put(o)});return this._trackHandle(o)}_acquireColor(e,i,r){const n=pq(e,i,r),s=this._colorCache.pop(n);if(s)return this._trackHandle(s);const o=new byt(n,new Ai(this.rctx,{...Ome[e],width:i,height:r}),()=>{this._acquired.delete(o),this._colorCache.put(o)});return this._trackHandle(o)}_trackHandle(e){return this._acquired.add(e),e}},_yt=class{constructor(e,i,r,n){this.key=e,this.fbo=i,this.acquireDepth=r,this.acquireColor=n,this.release=()=>{},this.incarnation=0}dispose(){this.fbo.dispose()}releaseDepth(){this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),this.depth=ir(this.depth)}detachDepth(){const e=this.depth;return this.depth=void 0,this.fbo.detachDepthStencilTexture(),this.fbo.detachDepthStencilBuffer(),e}attachDepth(e){return this.releaseDepth(),e&&(this.fbo.attachDepthStencil(e.attachment),this.depth=e),this}releaseColor(e){var r,n;this.fbo.detachColorTexture(e);const i=(r=this.colors)==null?void 0:r.get(e);(n=this.colors)==null||n.delete(e),ir(i)}get colorTexture(){var e;return(e=this.fbo)==null?void 0:e.colorTexture}getColorTexture(e=zu.COLOR_ATTACHMENT0){var i;return(i=this.fbo)==null?void 0:i.getColorTexture(e)}get usedMemory(){return this.fbo.gpuMemoryUsage}},l$e=class{constructor(e,i,r){this.key=e,this.attachment=i,this.release=r,this.incarnation=0}dispose(){this.attachment.dispose()}get usedMemory(){return this.attachment.gpuMemoryUsage}},Mme=class extends l$e{},byt=class extends l$e{constructor(e,i,r){super(e,i,r),this.attachment=i,this.release=r}};function pq(t,e,i){return`${t}x${e}x${i}`}var xr;(function(t){t[t.RED=0]="RED",t[t.RG=1]="RG",t[t.RGBA4=2]="RGBA4",t[t.RGBA=3]="RGBA",t[t.RGBA_MIPMAP=4]="RGBA_MIPMAP",t[t.R16F=5]="R16F",t[t.RGBA16F=6]="RGBA16F"})(xr||(xr={}));const NF=new tn;NF.pixelFormat=ci.RED,NF.internalFormat=zt.R8,NF.wrapMode=Bi.CLAMP_TO_EDGE;const FF=new tn;FF.pixelFormat=ci.RG,FF.internalFormat=zt.RG8,FF.wrapMode=Bi.CLAMP_TO_EDGE;const kF=new tn;kF.internalFormat=zt.RGBA4,kF.dataType=ga.UNSIGNED_SHORT_4_4_4_4,kF.wrapMode=Bi.CLAMP_TO_EDGE;const c$e=new tn;c$e.wrapMode=Bi.CLAMP_TO_EDGE;const iI=new tn;iI.wrapMode=Bi.CLAMP_TO_EDGE,iI.samplingMode=ki.LINEAR_MIPMAP_LINEAR,iI.hasMipmap=!0,iI.maxAnisotropy=8;const rI=new tn;rI.pixelFormat=ci.RED,rI.dataType=ga.HALF_FLOAT,rI.internalFormat=zt.R16F,rI.samplingMode=ki.NEAREST;const zF=new tn;zF.dataType=ga.HALF_FLOAT,zF.internalFormat=zt.RGBA16F,zF.samplingMode=ki.NEAREST;const Ome={[xr.RED]:NF,[xr.RG]:FF,[xr.RGBA4]:kF,[xr.RGBA]:c$e,[xr.RGBA_MIPMAP]:iI,[xr.R16F]:rI,[xr.RGBA16F]:zF};var la;(function(t){t[t.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",t[t.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",t[t.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",t[t.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"})(la||(la={}));const nI=new tn;nI.pixelFormat=ci.DEPTH_STENCIL,nI.dataType=ga.UNSIGNED_INT_24_8,nI.samplingMode=ki.NEAREST,nI.wrapMode=Bi.CLAMP_TO_EDGE;const Pme={[la.DEPTH_STENCIL_TEXTURE]:nI,[la.DEPTH_STENCIL_BUFFER]:new $F(Wa.DEPTH24_STENCIL8,4),[la.DEPTH24_BUFFER]:new $F(Wa.DEPTH_COMPONENT24,4),[la.DEPTH16_BUFFER]:new $F(Wa.DEPTH_COMPONENT16,4)};let Al=class{constructor(e,i,r,n,s,o=!1,l=0){this.name=e,this.count=i,this.type=r,this.offset=n,this.stride=s,this.normalized=o,this.divisor=l}};new Al(J.POSITION,3,Yt.FLOAT,0,12);new Al(J.POSITION,3,Yt.FLOAT,0,20),new Al(J.UV0,2,Yt.FLOAT,12,20);new Al(J.POSITION,3,Yt.FLOAT,0,32),new Al(J.NORMAL,3,Yt.FLOAT,12,32),new Al(J.UV0,2,Yt.FLOAT,24,32);new Al(J.POSITION,3,Yt.FLOAT,0,16),new Al(J.COLOR,4,Yt.UNSIGNED_BYTE,12,16);const yae=[new Al(J.POSITION,2,Yt.FLOAT,0,8)],H9=[new Al(J.POSITION,2,Yt.FLOAT,0,16),new Al(J.UV0,2,Yt.FLOAT,8,16)],KE=Ce.getLogger("esri.views.webgl.VertexArrayObject");let Qf=class{constructor(e,i,r,n,s=null){this._context=e,this._locations=i,this._layout=r,this._buffers=n,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((e,i)=>e+this._buffers[i].byteLength,this._indexBuffer!=null?this._indexBuffer.byteLength:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*H3e}dispose(){var e;if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const i in this._buffers)(e=this._buffers[i])==null||e.dispose(),delete this._buffers[i];this._indexBuffer=Kt(this._indexBuffer),this.disposeVAOOnly()}else(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&KE.warn("Leaked WebGL VAO")}disposeVAOOnly(){var e,i;this._glName&&(((i=(e=this._context)==null?void 0:e.capabilities)==null?void 0:i.vao).deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(_o.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const e=this._context.capabilities.vao;if(e){const i=e.createVertexArray();e.bindVertexArray(i),this._bindLayout(),e.bindVertexArray(null),this._glName=i,this._context.instanceCounter.increment(_o.VertexArrayObject,this)}this._initialized=!0}bind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:e,_layout:i,_indexBuffer:r}=this;e||KE.error("Vertex buffer dictionary is empty!");const n=this._context.gl;for(const s in e){const o=e[s];o||KE.error("Vertex buffer is uninitialized!");const l=i[s];l||KE.error("Vertex element descriptor is empty!"),fae(this._context,this._locations,o,l)}r!=null&&(this._context.capabilities.vao?n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,r.glName):this._context.bindBuffer(r))}unbind(){this.initialize();const e=this._context.capabilities.vao;e?e.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:e,_layout:i}=this;e||KE.error("Vertex buffer dictionary is empty!");for(const r in e){const n=e[r];n||KE.error("Vertex buffer is uninitialized!");const s=i[r];mae(this._context,this._locations,n,s)}this._indexBuffer!=null&&this._context.unbindBuffer(this._indexBuffer.bufferType)}},qm=class extends Qf{};function u1(t,e=yae,i=Er,r=-1,n=1){let s=null;return e===H9?s=new Float32Array([r,r,0,0,n,r,1,0,r,n,0,1,n,n,1,1]):s=new Float32Array([r,r,n,r,r,n,n,n]),new qm(t,i,{geometry:e},{geometry:Yr.createVertex(t,Pr.STATIC_DRAW,s)})}function wyt(t,e=yae,i=Er){const r=new Float32Array([-1,-1,3,-1,-1,3]);return new qm(t,i,{geometry:e},{geometry:Yr.createVertex(t,Pr.STATIC_DRAW,r)})}const xyt=4;function u$e(t){const e=new tn(xyt);return e.samplingMode=ki.NEAREST,new Ai(t,e)}function Syt(t){const e=new tn(1);return e.samplingMode=ki.NEAREST,new Ai(t,e,new Uint8Array([255,255,255,255]))}const Rme=16;function yT(t){return Math.ceil(t/Rme)*Rme}function Tyt(t,e){let s=t.width*t.height;if(s<4096)return t instanceof ImageData?h$e(t):t;let o=t.width,l=t.height;do o=Math.ceil(o/2),l=Math.ceil(l/2),s=o*l;while(s>1048576||e!=null&&(o>e||l>e));return vae(t,o,l)}function Eyt(t,e){const i=Math.max(t.width,t.height);if(i<=e)return t;const r=e/i;return vae(t,Math.round(t.width*r),Math.round(t.height*r))}function vae(t,e,i){if(t instanceof ImageData)return vae(h$e(t),e,i);const r=document.createElement("canvas");return r.width=e,r.height=i,r.getContext("2d").drawImage(t,0,0,r.width,r.height),r}function h$e(t){const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");if(i==null)throw new se("Failed to create 2d context from HTMLCanvasElement");return i.putImageData(t,0,0),e}function Pc(t,e=!0){t.attributes.add(J.POSITION,"vec2"),e&&t.varyings.add("uv","vec2"),t.vertex.code.add(V` + void main(void) { + gl_Position = vec4(position, 0.0, 1.0); + ${e?V`uv = position * 0.5 + vec2(0.5);`:""} + } + `)}let _ae=class extends _n{};function d$e(t){const e=new Cr;e.include(Pc),e.fragment.uniforms.add(new Zt("colorTexture",r=>r.color),new Zt("depthTexture",r=>r.depth));const i=t.haze;return e.fragment.code.add(V` + void main() { + ${i?V`vec4`:V`float`} depthSample = texture(depthTexture, uv) ${i?"":V`.r`}; + if (depthSample ${i?V`== vec4(0)`:V`!= 1.0`} ) { + fragColor = vec4(0); + return; + } + fragColor = texture(colorTexture, uv); + } + `),e}const Cyt=Object.freeze(Object.defineProperty({__proto__:null,AtmosphereCompositingPassParameters:_ae,build:d$e},Symbol.toStringTag,{value:"Module"}));let p$e=class f$e extends Hr{initializeProgram(e){return new Ir(e.rctx,f$e.shader.get().build(this.configuration),Er)}initializePipeline(){return this.configuration.haze?Ti({blending:Ol(st.ONE,st.ZERO,st.ONE_MINUS_SRC_COLOR,st.ONE),depthTest:{func:Zr.ALWAYS},colorWrite:ji}):Ti({blending:hd(st.SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),depthTest:{func:Zr.ALWAYS},colorWrite:ji})}};p$e.shader=new Rr(Cyt,()=>we(()=>Promise.resolve().then(()=>pWt),void 0));let Ime=class{constructor(e,i){this._view=e,this._context=i,this.type=pc.Realistic,this._handles=new O_,this._atmosphereCompositionParameters=new _ae,this._atmosphereConfiguration=new _U,this._passParameters=new iyt,this._rootTileElevationMin=NaN,this._lowerBoundEarthRadius=Mr.radius,this._fadeHaze=0,this._updateRadius(Mr.radius);const r=this._context.renderContext.rctx;this._updateRootTileElevationBounds(),this._handles.add([_e(()=>{var s,o;return(o=(s=this._view)==null?void 0:s.basemapTerrain)==null?void 0:o.rootTileElevationBounds},()=>{var s;return(s=this._view)!=null&&s.basemapTerrain?this._updateRootTileElevationBounds():null}),_e(()=>{var s,o;return(o=(s=this._view)==null?void 0:s.basemapTerrain)==null?void 0:o.visibleElevationBounds},()=>{var s;return(s=this._view)!=null&&s.basemapTerrain?this._updateVisibleElevationBounds():null}),_e(()=>{var s;return(s=this._view)==null?void 0:s.environment.background},s=>{const o=s instanceof t4e?AL(s.color):gp;Ie(this._passParameters.backgroundColor,o[0]*o[3],o[1]*o[3],o[2]*o[3])},kt)]);const n=new _U;n.haze=!1,this._atmosphereTechnique=this._context.techniqueRepository.acquire(tI,n),n.haze=!0,this._atmosphereHazeTechnique=this._context.techniqueRepository.acquire(tI,n),n.reduced=!0,n.haze=!1,this._atmosphereReducedTechnique=this._context.techniqueRepository.acquire(tI,n),n.haze=!0,this._atmosphereHazeReducedTechnique=this._context.techniqueRepository.acquire(tI,n),this._vao=u1(r,H9)}destroy(){this._handles.destroy(),this._atmosphereTechnique.release(),this._atmosphereHazeTechnique.release(),this._atmosphereReducedTechnique.release(),this._atmosphereHazeReducedTechnique.release(),this._vao.dispose()}render(e,i){this._render(e,i?this._atmosphereTechnique:this._atmosphereReducedTechnique,e.offscreenRenderingHelper.depthTexture,i,!1)}renderHaze(e,i,r){var n;this._fadeHaze=i,this._render(e,r?this._atmosphereHazeTechnique:this._atmosphereHazeReducedTechnique,(n=e.bindParameters.linearDepth)==null?void 0:n.colorTexture,r,!0)}_render(e,i,r,n,s){if(r==null)return;const o=e.offscreenRenderingHelper;this._update(e.bindParameters.camera),this._passParameters.depthTexture=r;const l=e.rctx.bindTechnique(i,this._passParameters,e.bindParameters);if(n)o.renderDepthDetached(()=>this._renderCommon(l,e));else{const c=e.rctx.getViewport(),f=rt(e.bindParameters.camera.eye)-Mr.radius;let _;if(fthis._renderCommon(l,e),[0,0,0,1],xr.RGBA,null,x,T);e.rctx.setViewport(c.x,c.y,c.width,c.height),this._atmosphereCompositionParameters.color=A.colorTexture,this._atmosphereCompositionParameters.depth=r,this._atmosphereConfiguration.haze=s;const M=this._context.techniqueRepository.acquire(p$e,this._atmosphereConfiguration);e.rctx.bindTechnique(M,this._atmosphereCompositionParameters,e.bindParameters),o.renderDepthDetached(()=>e.rctx.screen.draw()),M.release(),A.release()}}_renderCommon(e,i){this._vao!=null&&(i.rctx.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),i.rctx.drawArrays(sr.TRIANGLE_STRIP,0,4))}_adjustRadiusForTesselation(e){return e*Math.cos(Math.PI/16/16)}_updateRootTileElevationBounds(){const e=this._view.basemapTerrain.rootTileElevationBounds.min;e!==this._rootTileElevationMin&&(this._rootTileElevationMin=e,this._lowerBoundEarthRadius=Mr.radius,this._updateVisibleElevationBounds())}_updateVisibleElevationBounds(){const e=this._adjustRadiusForTesselation(Mr.radius+this._view.basemapTerrain.visibleElevationBounds.min);er.setUniform3fv(e,i(n,s,o)))}},$f=class extends Ls{constructor(e,i){super(e,"sampler2D",Or.Draw,(r,n,s)=>r.bindTexture(e,i(n,s)))}},cx=class{constructor(e){this._material=e.material,this._techniqueRepository=e.techniqueRep,this._output=e.output}dispose(){this._techniqueRepository.release(this._technique)}get technique(){return this._technique}get _stippleTextureRepository(){return this._techniqueRepository.constructionContext.stippleTextureRepository}get _markerTextureRepository(){return this._techniqueRepository.constructionContext.markerTextureRepository}ensureTechnique(e,i){return this._technique=this._techniqueRepository.releaseAndAcquire(e,this._material.getConfiguration(this._output,i),this._technique),this._technique}ensureResources(e){return U2.LOADED}},wae=class extends cx{constructor(e){super(e),this._numLoading=0,this._disposed=!1,this._textureRepository=e.textureRepository,this._textureId=e.textureId,this._acquire(e.textureId,i=>this._texture=i),this._acquire(e.normalTextureId,i=>this._textureNormal=i),this._acquire(e.emissiveTextureId,i=>this._textureEmissive=i),this._acquire(e.occlusionTextureId,i=>this._textureOcclusion=i),this._acquire(e.metallicRoughnessTextureId,i=>this._textureMetallicRoughness=i)}dispose(){this._texture=ir(this._texture),this._textureNormal=ir(this._textureNormal),this._textureEmissive=ir(this._textureEmissive),this._textureOcclusion=ir(this._textureOcclusion),this._textureMetallicRoughness=ir(this._textureMetallicRoughness),this._disposed=!0}ensureResources(e){return this._numLoading===0?U2.LOADED:U2.LOADING}get textureBindParameters(){return new g$e(this._texture!=null?this._texture.glTexture:null,this._textureNormal!=null?this._textureNormal.glTexture:null,this._textureEmissive!=null?this._textureEmissive.glTexture:null,this._textureOcclusion!=null?this._textureOcclusion.glTexture:null,this._textureMetallicRoughness!=null?this._textureMetallicRoughness.glTexture:null)}updateTexture(e){this._texture!=null&&e===this._texture.id||(this._texture=ir(this._texture),this._textureId=e,this._acquire(this._textureId,i=>this._texture=i))}_acquire(e,i){if(e==null)return void i(null);const r=this._textureRepository.acquire(e);if(pd(r))return++this._numLoading,void r.then(n=>{if(this._disposed)return ir(n),void i(null);i(n)}).finally(()=>--this._numLoading);i(r)}},g$e=class extends _n{constructor(e=null,i=null,r=null,n=null,s=null){super(),this.texture=e,this.textureNormal=i,this.textureEmissive=r,this.textureOcclusion=n,this.textureMetallicRoughness=s}};var ei;(function(t){t[t.Disabled=0]="Disabled",t[t.Normal=1]="Normal",t[t.Schematic=2]="Schematic",t[t.Water=3]="Water",t[t.WaterOnIntegratedMesh=4]="WaterOnIntegratedMesh",t[t.Terrain=5]="Terrain",t[t.TerrainWithWater=6]="TerrainWithWater",t[t.COUNT=7]="COUNT"})(ei||(ei={}));function xae(t,e){const i=t.fragment,r=e.hasMetallicRoughnessTexture||e.hasEmissionTexture||e.hasOcclusionTexture;if(e.pbrMode===ei.Normal&&r&&t.include(bae,e),e.pbrMode!==ei.Schematic)if(e.pbrMode!==ei.Disabled){if(e.pbrMode===ei.Normal){i.code.add(V`vec3 mrr; +vec3 emission; +float occlusion;`);const n=e.pbrTextureBindType;e.hasMetallicRoughnessTexture&&(i.uniforms.add(n===Or.Pass?new Zt("texMetallicRoughness",s=>s.textureMetallicRoughness):new $f("texMetallicRoughness",s=>s.textureMetallicRoughness)),i.code.add(V`void applyMetallnessAndRoughness(vec2 uv) { +vec3 metallicRoughness = textureLookup(texMetallicRoughness, uv).rgb; +mrr[0] *= metallicRoughness.b; +mrr[1] *= metallicRoughness.g; +}`)),e.hasEmissionTexture&&(i.uniforms.add(n===Or.Pass?new Zt("texEmission",s=>s.textureEmissive):new $f("texEmission",s=>s.textureEmissive)),i.code.add(V`void applyEmission(vec2 uv) { +emission *= textureLookup(texEmission, uv).rgb; +}`)),e.hasOcclusionTexture?(i.uniforms.add(n===Or.Pass?new Zt("texOcclusion",s=>s.textureOcclusion):new $f("texOcclusion",s=>s.textureOcclusion)),i.code.add(V`void applyOcclusion(vec2 uv) { +occlusion *= textureLookup(texOcclusion, uv).r; +} +float getBakedOcclusion() { +return occlusion; +}`)):i.code.add(V`float getBakedOcclusion() { return 1.0; }`),n===Or.Pass?i.uniforms.add(new Oi("emissionFactor",s=>s.emissiveFactor),new Oi("mrrFactors",s=>s.mrrFactors)):i.uniforms.add(new yp("emissionFactor",s=>s.emissiveFactor),new yp("mrrFactors",s=>s.mrrFactors)),i.code.add(V` + void applyPBRFactors() { + mrr = mrrFactors; + emission = emissionFactor; + occlusion = 1.0; + + ${e.hasMetallicRoughnessTexture?V`applyMetallnessAndRoughness(${e.hasMetallicRoughnessTextureTransform?V`metallicRoughnessUV`:"vuv0"});`:""} + + ${e.hasEmissionTexture?V`applyEmission(${e.hasEmissiveTextureTransform?V`emissiveUV`:"vuv0"});`:""} + + ${e.hasOcclusionTexture?V`applyOcclusion(${e.hasOcclusionTextureTransform?V`occlusionUV`:"vuv0"});`:""} + } + `)}}else i.code.add(V`float getBakedOcclusion() { return 1.0; }`);else i.code.add(V`vec3 mrr = vec3(0.0, 0.6, 0.2); +vec3 emission = vec3(0.0); +float occlusion = 1.0; +void applyPBRFactors() {} +float getBakedOcclusion() { return 1.0; }`)}function Sae(t,e){const i=t.fragment,r=e.lightingSphericalHarmonicsOrder!==void 0?e.lightingSphericalHarmonicsOrder:2;r===0?(i.uniforms.add(new Oi("lightingAmbientSH0",(n,s)=>Ie($me,s.lighting.sh.r[0],s.lighting.sh.g[0],s.lighting.sh.b[0]))),i.code.add(V`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +return ambientLight * (1.0 - ambientOcclusion); +}`)):r===1?(i.uniforms.add(new gr("lightingAmbientSH_R",(n,s)=>rs(w1,s.lighting.sh.r[0],s.lighting.sh.r[1],s.lighting.sh.r[2],s.lighting.sh.r[3])),new gr("lightingAmbientSH_G",(n,s)=>rs(w1,s.lighting.sh.g[0],s.lighting.sh.g[1],s.lighting.sh.g[2],s.lighting.sh.g[3])),new gr("lightingAmbientSH_B",(n,s)=>rs(w1,s.lighting.sh.b[0],s.lighting.sh.b[1],s.lighting.sh.b[2],s.lighting.sh.b[3]))),i.code.add(V`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec4 sh0 = vec4( +0.282095, +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y +); +vec3 ambientLight = vec3( +dot(lightingAmbientSH_R, sh0), +dot(lightingAmbientSH_G, sh0), +dot(lightingAmbientSH_B, sh0) +); +return ambientLight * (1.0 - ambientOcclusion); +}`)):r===2&&(i.uniforms.add(new Oi("lightingAmbientSH0",(n,s)=>Ie($me,s.lighting.sh.r[0],s.lighting.sh.g[0],s.lighting.sh.b[0])),new gr("lightingAmbientSH_R1",(n,s)=>rs(w1,s.lighting.sh.r[1],s.lighting.sh.r[2],s.lighting.sh.r[3],s.lighting.sh.r[4])),new gr("lightingAmbientSH_G1",(n,s)=>rs(w1,s.lighting.sh.g[1],s.lighting.sh.g[2],s.lighting.sh.g[3],s.lighting.sh.g[4])),new gr("lightingAmbientSH_B1",(n,s)=>rs(w1,s.lighting.sh.b[1],s.lighting.sh.b[2],s.lighting.sh.b[3],s.lighting.sh.b[4])),new gr("lightingAmbientSH_R2",(n,s)=>rs(w1,s.lighting.sh.r[5],s.lighting.sh.r[6],s.lighting.sh.r[7],s.lighting.sh.r[8])),new gr("lightingAmbientSH_G2",(n,s)=>rs(w1,s.lighting.sh.g[5],s.lighting.sh.g[6],s.lighting.sh.g[7],s.lighting.sh.g[8])),new gr("lightingAmbientSH_B2",(n,s)=>rs(w1,s.lighting.sh.b[5],s.lighting.sh.b[6],s.lighting.sh.b[7],s.lighting.sh.b[8]))),i.code.add(V`vec3 calculateAmbientIrradiance(vec3 normal, float ambientOcclusion) { +vec3 ambientLight = 0.282095 * lightingAmbientSH0; +vec4 sh1 = vec4( +0.488603 * normal.x, +0.488603 * normal.z, +0.488603 * normal.y, +1.092548 * normal.x * normal.y +); +vec4 sh2 = vec4( +1.092548 * normal.y * normal.z, +0.315392 * (3.0 * normal.z * normal.z - 1.0), +1.092548 * normal.x * normal.z, +0.546274 * (normal.x * normal.x - normal.y * normal.y) +); +ambientLight += vec3( +dot(lightingAmbientSH_R1, sh1), +dot(lightingAmbientSH_G1, sh1), +dot(lightingAmbientSH_B1, sh1) +); +ambientLight += vec3( +dot(lightingAmbientSH_R2, sh2), +dot(lightingAmbientSH_G2, sh2), +dot(lightingAmbientSH_B2, sh2) +); +return ambientLight * (1.0 - ambientOcclusion); +}`),e.pbrMode!==ei.Normal&&e.pbrMode!==ei.Schematic||i.code.add(V`const vec3 skyTransmittance = vec3(0.9, 0.9, 1.0); +vec3 calculateAmbientRadiance(float ambientOcclusion) +{ +vec3 ambientLight = 1.2 * (0.282095 * lightingAmbientSH0) - 0.2; +return ambientLight *= (1.0 - ambientOcclusion) * skyTransmittance; +}`))}const $me=W(),w1=Xi();function q9(t){t.vertex.code.add(V`const float PI = 3.141592653589793;`),t.fragment.code.add(V`const float PI = 3.141592653589793; +const float LIGHT_NORMALIZATION = 1.0 / PI; +const float INV_PI = 0.3183098861837907; +const float HALF_PI = 1.570796326794897;`)}var gy,YT;function Ayt(t){return(t==null?void 0:t.cubeMap)!=null}function Myt(t){return t!=null&&!t.running}(function(t){t[t.RENDERING=0]="RENDERING",t[t.FADING=1]="FADING",t[t.FINISHED=2]="FINISHED"})(gy||(gy={})),function(t){t[t.RG=0]="RG",t[t.BA=1]="BA"}(YT||(YT={}));function j_(t=y$e){return[t[0],t[1],t[2],t[3]]}function UF(t,e,i=j_()){return Ne(i,t),i[3]=e,i}function Lme(t,e,i=j_()){return Wt(i,t,e),Ye(i,i),i[3]=-mAe(t,e),i}function Dme(t,e,i=j_()){return wL(jD,t,zee(t)),wL(Nme,e,zee(e)),nj(jD,Nme,jD),Pyt(i,pu(Poe(i,jD)))}function Iii(t,e,i,r=j_()){return UF(hAe,t,GD),UF(dAe,e,Fme),UF(fB,i,kme),Dme(GD,Fme,GD),Dme(GD,kme,r),r}function $ii(t){return t}function Oyt(t){return t[3]}function zee(t){return Ei(t[3])}function Pyt(t,e){return t[3]=e,t}const y$e=[0,0,1,0],jD=Cp(),Nme=Cp();j_();const GD=j_(),Fme=j_(),kme=j_();let Ryt=class{constructor(){this.readChannels=YT.RG,this.renderingStage=gy.FINISHED,this.startTime=0,this.startTimeHeightFade=0,this.cameraPositionLastFrame=W(),this.parallax=new zme,this.parallaxNew=new zme,this.pointOnGround=W(),this.fadeMode=Vn.HIDE,this.fadeFactor=0,this.opacity=0}updateParallax(e){const i=this.parallax,r=rt(e.eye);if(i.radiusCurvatureCorrectionFactor=.84*Math.sqrt(Math.max(r*r-Mr.radius*Mr.radius,0))/r,Lme(Ume,i.anchorPointClouds,QE),Wh(i.transform,gs,QE[3],QE),this.fadeMode===Vn.CROSS_FADE){const n=this.parallaxNew;Lme(Ume,n.anchorPointClouds,QE),Wh(n.transform,gs,QE[3],QE)}}updateFading(e,i,r,n){this.isFading&&this._advanceFading(r,n),this._evaluateFading(e,i,r)}_evaluateFading(e,i,r){const n=e.relativeElevation,s=this._calculateDistanceToAnchorPoint(e);if((n>1.7*Pv||n<-Pv||s>Nyt)&&this.opacity>0)this._setFade(Vn.HIDE,r);else if(!this.isFading){if((n>Pv||n<-.35*Pv||s>Dyt)&&this.opacity>0)this._setFade(Vn.FADE_OUT,r);else if(n<=Pv&&n>=-.35*Pv&&i===Vr.IDLE&&Myt(this.data)){if(this.opacity===0)return void this._setFade(Vn.FADE_IN,r);(s>Lyt||this.renderingStage===gy.FADING)&&this._setFade(Vn.CROSS_FADE,r)}}}_advanceFading(e,i){this._switchReadChannels(),this._updateAnchorPoint(),this._advanceFadingFactorAndOpacity(e,i)}_advanceFadingFactorAndOpacity(e,i){if(this.fadeFactor<1)return this.fadeFactor=i?Je((e-this.startTime)/($yt*i),0,1):1,this.fadeMode===Vn.FADE_OUT&&(this.opacity=1-this.fadeFactor),this.fadeMode===Vn.FADE_IN&&(this.opacity=this.fadeFactor),void(this.fadeMode===Vn.CROSS_FADE&&(this.opacity=1));this.fadeFactor=0,this.fadeMode===Vn.FADE_OUT&&(this.opacity=0),this.fadeMode===Vn.FADE_IN&&(this.opacity=1),this.fadeMode===Vn.CROSS_FADE&&(this.opacity=1),this.fadeMode=Vn.NONE}_switchReadChannels(){const e=this.fadeMode===Vn.CROSS_FADE&&this.fadeFactor===1,i=this.fadeMode===Vn.FADE_IN&&this.fadeFactor===0;this.renderingStage===gy.FADING&&(e||i)&&(this.readChannels=1-this.readChannels,this.renderingStage=gy.FINISHED)}_calculateDistanceToAnchorPoint(e){return Ye(this.pointOnGround,e.eye),De(this.pointOnGround,this.pointOnGround,Mr.radius),rt(je(Iyt,this.parallax.anchorPointClouds,this.pointOnGround))}_updateAnchorPoint(){this.fadeMode===Vn.CROSS_FADE&&(this.fadeFactor===0&&Ne(this.parallaxNew.anchorPointClouds,this.pointOnGround),this.fadeFactor===1&&Ne(this.parallax.anchorPointClouds,this.parallaxNew.anchorPointClouds)),this.fadeMode===Vn.FADE_IN&&this.fadeFactor===0&&Ne(this.parallax.anchorPointClouds,this.pointOnGround)}_setFade(e,i){switch(e){case Vn.HIDE:this.opacity=0;break;case Vn.FADE_OUT:this.opacity=1;break;case Vn.FADE_IN:this.opacity=0;break;case Vn.CROSS_FADE:this.opacity=1}this.fadeMode=e,this.fadeFactor=0,this.startTime=i}get isFading(){return this.fadeMode===Vn.FADE_OUT||this.fadeMode===Vn.FADE_IN||this.fadeMode===Vn.CROSS_FADE}};var Vn;(function(t){t[t.NONE=0]="NONE",t[t.HIDE=1]="HIDE",t[t.FADE_OUT=2]="FADE_OUT",t[t.FADE_IN=3]="FADE_IN",t[t.CROSS_FADE=4]="CROSS_FADE"})(Vn||(Vn={}));let zme=class{constructor(){this.anchorPointClouds=W(),this.radiusCurvatureCorrectionFactor=0,this.transform=Qe()}};const Ume=nt(0,0,1),QE=j_(),Iyt=W(),$yt=1.25,Lyt=34e3,Dyt=64e3,Nyt=2e5;let Oy=class extends Ls{constructor(e,i){super(e,"bool",Or.Pass,(r,n,s)=>r.setUniform1b(e,i(n,s)))}},Fyt=class extends Ls{constructor(e,i){super(e,"samplerCube",Or.Pass,(r,n,s)=>r.bindTexture(e,i(n,s)))}};function v$e(t){const e=t.fragment;e.uniforms.add(new _s("rotationMatrixClouds",(i,r)=>r.cloudsFade.parallax.transform),new _s("rotationMatrixCloudsCrossFade",(i,r)=>r.cloudsFade.parallaxNew.transform),new Oi("anchorPosition",(i,r)=>r.cloudsFade.parallax.anchorPointClouds),new Oi("anchorPositionCrossFade",(i,r)=>r.cloudsFade.parallaxNew.anchorPointClouds),new ft("cloudsHeight",()=>Spt),new ft("radiusCurvatureCorrectionFactor",(i,r)=>r.cloudsFade.parallax.radiusCurvatureCorrectionFactor),new ft("totalFadeInOut",(i,r)=>1-r.cloudsFade.opacity),new ft("crossFadeAnchorFactor",(i,r)=>Je(r.cloudsFade.fadeFactor,0,1)),new Fyt("cubeMap",(i,r)=>{var n,s;return((s=(n=r.cloudsFade.data)==null?void 0:n.cubeMap)==null?void 0:s.colorTexture)??null}),new Oy("crossFade",(i,r)=>r.cloudsFade.fadeMode===Vn.CROSS_FADE),new Oy("readChannelsRG",(i,r)=>r.cloudsFade.readChannels===YT.RG),new Oy("fadeTextureChannels",(i,r)=>r.cloudsFade.renderingStage===gy.FADING)),e.constants.add("planetRadius","float",Mr.radius),e.code.add(V`vec3 intersectWithCloudLayer(vec3 dir, vec3 cameraPosition, vec3 spherePos) +{ +float radiusClouds = planetRadius + cloudsHeight; +float B = 2.0 * dot(cameraPosition, dir); +float C = dot(cameraPosition, cameraPosition) - radiusClouds * radiusClouds; +float det = B * B - 4.0 * C; +float pointIntDist = max(0.0, 0.5 *(-B + sqrt(det))); +vec3 intersectionPont = cameraPosition + dir * pointIntDist; +intersectionPont = intersectionPont - spherePos; +return intersectionPont; +}`),e.code.add(V`vec3 correctForPlanetCurvature(vec3 dir) +{ +dir.z = dir.z*(1.-radiusCurvatureCorrectionFactor) + radiusCurvatureCorrectionFactor; +return dir; +}`),e.code.add(V`vec3 rotateDirectionToAnchorPoint(mat4 rotMat, vec3 inVec) +{ +return (rotMat * vec4(inVec, 0.0)).xyz; +}`),B_(e),a1(e),e.code.add(V`const float SUNSET_TRANSITION_FACTOR = 0.3; +const vec3 RIM_COLOR = vec3(0.28, 0.175, 0.035); +const float RIM_SCATTERING_FACTOR = 140.0; +const float BACKLIGHT_FACTOR = 0.2; +const float BACKLIGHT_SCATTERING_FACTOR = 10.0; +const float BACKLIGHT_TRANSITION_FACTOR = 0.3; +vec3 calculateCloudColor(vec3 cameraPosition, vec3 worldSpaceRay, vec4 clouds) +{ +float upDotLight = dot(normalize(cameraPosition), normalize(mainLightDirection)); +float dirDotLight = max(dot(normalize(-worldSpaceRay), normalize(mainLightDirection)), 0.0); +float sunsetTransition = clamp(pow(max(upDotLight, 0.0), SUNSET_TRANSITION_FACTOR), 0.0, 1.0); +vec3 ambientLight = calculateAmbientIrradiance(normalize(cameraPosition), 0.0); +vec3 mainLight = evaluateMainLighting(normalize(cameraPosition), 0.0); +vec3 combinedLight = clamp((mainLightIntensity + ambientLight )/PI, vec3(0.0), vec3(1.0)); +vec3 baseCloudColor = pow(combinedLight * pow(clouds.xyz, vec3(GAMMA)), vec3(INV_GAMMA)); +float scatteringMod = max(clouds.a < 0.5 ? clouds.a / 0.5 : - clouds.a / 0.5 + 2.0, 0.0); +float rimLightIntensity = 0.5 + 0.5 *pow(max(upDotLight, 0.0), 0.35); +vec3 directSunScattering = RIM_COLOR * rimLightIntensity * (pow(dirDotLight, RIM_SCATTERING_FACTOR)) * scatteringMod; +float additionalLight = BACKLIGHT_FACTOR * pow(dirDotLight, BACKLIGHT_SCATTERING_FACTOR) * (1. - pow(sunsetTransition, BACKLIGHT_TRANSITION_FACTOR)) ; +return vec3(baseCloudColor * (1. + additionalLight) + directSunScattering); +}`),e.code.add(V`vec4 getCloudData(vec3 rayDir, bool readOtherChannel) +{ +vec4 cloudData = texture(cubeMap, rayDir); +float mu = dot(rayDir, vec3(0, 0, 1)); +bool readChannels = readChannelsRG ^^ readOtherChannel; +if (readChannels) { +cloudData = vec4(vec3(cloudData.r), cloudData.g); +} else { +cloudData = vec4(vec3(cloudData.b), cloudData.a); +} +if (length(cloudData) == 0.0) { +return vec4(cloudData.rgb, 1.0); +} +return cloudData; +}`),e.code.add(V`vec4 renderCloudsNoFade(vec3 worldRay, vec3 cameraPosition) +{ +vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition); +vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint)); +vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); +vec4 cloudData = getCloudData(worldRayRotatedCorrected, false); +float totalTransmittance = clamp(cloudData.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0); +if (length(cloudData.rgb) == 0.0) { +totalTransmittance = 1.0; +} +return vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), totalTransmittance); +}`),e.code.add(V`vec4 renderCloudsCrossFade(vec3 worldRay, vec3 cameraPosition) +{ +vec3 intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPosition); +vec3 worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixClouds, normalize(intersectionPoint)); +vec3 worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); +vec4 cloudData = getCloudData(worldRayRotatedCorrected, false); +vec4 cloudColor = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a); +intersectionPoint = intersectWithCloudLayer(normalize(worldRay), cameraPosition, anchorPositionCrossFade); +worldRayRotated = rotateDirectionToAnchorPoint(rotationMatrixCloudsCrossFade, normalize(intersectionPoint)); +worldRayRotatedCorrected = correctForPlanetCurvature(worldRayRotated); +cloudData = getCloudData(worldRayRotatedCorrected, fadeTextureChannels); +vec4 cloudColorCrossFade = vec4(calculateCloudColor(cameraPosition, normalize(-worldRay), cloudData), cloudData.a); +cloudColor = mix(cloudColor, cloudColorCrossFade, crossFadeAnchorFactor); +float totalTransmittance = clamp(cloudColor.a * (1.0 - totalFadeInOut) + totalFadeInOut, 0.0 , 1.0); +if (length(cloudColor.rgb) == 0.0) { +totalTransmittance = 1.0; +} +return vec4(cloudColor.rgb, totalTransmittance); +}`),e.code.add(V`vec4 renderClouds(vec3 worldRay, vec3 cameraPosition) +{ +return crossFade ? renderCloudsCrossFade(worldRay, cameraPosition) : renderCloudsNoFade(worldRay, cameraPosition); +}`)}function h1(t){t.code.add(V`vec4 premultiplyAlpha(vec4 v) { +return vec4(v.rgb * v.a, v.a); +} +vec3 rgb2hsv(vec3 c) { +vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +float d = q.x - min(q.w, q.y); +float e = 1.0e-10; +return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), min(d / (q.x + e), 1.0), q.x); +} +vec3 hsv2rgb(vec3 c) { +vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} +float rgb2v(vec3 c) { +return max(c.x, max(c.y, c.z)); +}`)}function _$e(){const t=new Cr,{attributes:e,varyings:i,vertex:r,fragment:n}=t;return e.add(J.POSITION,"vec2"),i.add("worldRay","vec3"),r.uniforms.add(new _s("inverseProjectionMatrix",(s,o)=>o.camera.inverseProjectionMatrix),new _s("inverseViewMatrix",(s,o)=>sP(kyt,o.camera.viewMatrix))),r.code.add(V`void main(void) { +vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1.0, 1.0)).xyz; +worldRay = (inverseViewMatrix * vec4(posViewNear, 0.0)).xyz; +gl_Position = vec4(position, 1.0, 1.0); +}`),n.include(h1),n.include(o0),t.include(Sae,{pbrMode:ei.Disabled,lightingSphericalHarmonicsOrder:2}),t.include(q9),t.include(Aj),t.include(yU),t.include(v$e),n.uniforms.add(new Oi("cameraPosition",(s,o)=>o.camera.eye)),n.code.add(V`void main() { +vec4 cloudsColor = renderClouds(normalize(worldRay), cameraPosition); +fragColor = vec4((1.0 - totalFadeInOut) * cloudsColor.rgb, cloudsColor.a); +}`),t}const kyt=Qe(),zyt=Object.freeze(Object.defineProperty({__proto__:null,build:_$e},Symbol.toStringTag,{value:"Module"}));let b$e=class w$e extends Hr{constructor(e){super(e,new nh,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,w$e.shader.get().build(),Er)}initializePipeline(){return Ti({blending:Ol(st.ONE,st.ZERO,st.SRC_ALPHA,st.ONE),depthTest:{func:Zr.LEQUAL},colorWrite:ji})}};b$e.shader=new Rr(zyt,()=>we(()=>Promise.resolve().then(()=>fWt),void 0));let W3=class extends ze{constructor(e){super(e),this._technique=new b$e(e),this._vao=u1(e.rctx)}destroy(){this._technique=ir(this._technique),this._vao=Kt(this._vao)}render(e){if(!this._technique.compiled)return void this.requestRender();const i=e.bindParameters.cloudsFade;if(this._vao==null||i.data==null)return;const r=e.rctx.bindTechnique(this._technique,Uyt,e.bindParameters);e.rctx.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),e.rctx.drawArrays(sr.TRIANGLE_STRIP,0,4)}};y([w({constructOnly:!0})],W3.prototype,"rctx",void 0),y([w({constructOnly:!0})],W3.prototype,"viewingMode",void 0),y([w({constructOnly:!0})],W3.prototype,"planetRadius",void 0),y([w({constructOnly:!0})],W3.prototype,"requestRender",void 0),W3=y([Z("esri.views.3d.environment.CloudsComposition")],W3);const Uyt=new _n;function Bs(){return new Float32Array(3)}function Uee(t){const e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function pn(t,e,i){const r=new Float32Array(3);return r[0]=t,r[1]=e,r[2]=i,r}function Vyt(t,e){return new Float32Array(t,e,3)}function Tae(){return Bs()}function x$e(){return pn(1,1,1)}function S$e(){return pn(1,0,0)}function T$e(){return pn(0,1,0)}function E$e(){return pn(0,0,1)}const Byt=Tae(),jyt=x$e(),Gyt=S$e(),Hyt=T$e(),qyt=E$e();Object.freeze(Object.defineProperty({__proto__:null,ONES:jyt,UNIT_X:Gyt,UNIT_Y:Hyt,UNIT_Z:qyt,ZEROS:Byt,clone:Uee,create:Bs,createView:Vyt,fromValues:pn,ones:x$e,unitX:S$e,unitY:T$e,unitZ:E$e,zeros:Tae},Symbol.toStringTag,{value:"Module"}));var Wu;(function(t){t[t.SIXTEEN=0]="SIXTEEN",t[t.HUNDRED=1]="HUNDRED",t[t.TWOHUNDRED=2]="TWOHUNDRED",t[t.COUNT=3]="COUNT"})(Wu||(Wu={}));let VF=class extends nh{constructor(){super(...arguments),this.steps=Wu.SIXTEEN,this.writeTextureChannels=YT.RG}};y([fe({count:Wu.COUNT})],VF.prototype,"steps",void 0),y([fe({constValue:Le("esri-mobile")?1024:2048})],VF.prototype,"cubeMapSize",void 0),y([fe()],VF.prototype,"writeTextureChannels",void 0);let sI=class{constructor(e,i,r,n,s,o,l,c,f=.5){this.coverage=e,this.density=i,this.absorption=r,this.cloudSize=n,this.detailSize=s,this.smoothness=o,this.cloudHeight=l,this.raymarchingSteps=c,this.median=f}};const Vme=new sI([0,.6],[.03,.03],[0,0],[.9,.9],[.8,.8],[.7,.7],[.05,.05],Wu.SIXTEEN),cc={sunny:Vme,cloudy:new sI([.3,.65],[.2,.4],[0,0],[.85,.85],[.75,.75],[.3,.4],[1,1],Wu.TWOHUNDRED,.6),rainy:new sI([.6,.8],[.5,.8],[.1,.5],[.9,.9],[.75,.75],[.5,.5],[1,1],Wu.TWOHUNDRED,.4),snowy:new sI([.25,.75],[.3,.3],[0,0],[.95,.95],[.7,.7],[.69,.75],[.3,1],Wu.HUNDRED,.65),foggy:new sI([.8,.8],[.5,.5],[0,0],[.95,.95],[.9,.9],[.55,.55],[.3,.3],Wu.SIXTEEN),default:Vme},pf=Le("esri-mobile")?64:128,Wyt=pf/128,Q0=Math.ceil(Math.sqrt(pf)),v2=(pf+2)*Q0,Yyt=1e5,fq=128,Xyt=v2/1560;let ML=class extends Ls{constructor(e,i){super(e,"mat3",Or.Draw,(r,n,s)=>r.setUniformMatrix3fv(e,i(n,s)))}},Eae=class extends _n{constructor(){super(...arguments),this.cloudRadius=0,this.cloudSize=0,this.detailSize=0,this.absorption=0,this.density=0,this.smoothness=0,this.cloudHeight=0,this.coverage=0,this.raymarchingSteps=cc.default.raymarchingSteps,this.weatherTile=yt()}},Cae=class extends _n{constructor(){super(...arguments),this.viewMatrix=as()}};function C$e(t){const e=new Cr;e.include(Pc,!1);const i=e.fragment;return i.uniforms.add(new ft("cloudRadius",r=>r.cloudRadius),new ft("power",r=>ui(35,120,r.absorption)),new ft("sigmaE",r=>1+r.absorption),new ft("density",r=>ui(0,.3,r.density)),new ft("cloudSize",r=>ui(0,.02,Math.max(.01,1-r.cloudSize))),new ft("detailSize",r=>ui(0,.2,Math.max(.01,1-r.detailSize))),new ft("smoothness",r=>ui(0,.5,1-r.smoothness)),new ft("cloudHeight",r=>ui(0,1500,r.cloudHeight)),new ft("coverage",r=>r.coverage),new ML("view",r=>r.viewMatrix),new Zt("cloudShapeTexture",r=>r.noiseTexture!=null?r.noiseTexture.textureAtlas:null),new ln("cloudVariables",r=>or(Zyt,r.coverage,r.absorption))),i.constants.add("halfCubeMapSize","float",.5*t.cubeMapSize),i.code.add(V` + const int STEPS = ${t.steps===Wu.SIXTEEN?V`16`:t.steps===Wu.HUNDRED?V`100`:V`200`}; + const int STEPS_LIGHT = 6; + const float stepL = 300.0 / float(STEPS_LIGHT); + const float cloudStart = 1500.0; + + vec3 rayDirection(vec2 fragCoord) { + vec2 xy = fragCoord - halfCubeMapSize; + return normalize(vec3(-xy, -halfCubeMapSize)); + } + + float remap(float x, float low1, float high1, float low2, float high2) { + return low2 + (x - low1) * (high2 - low2) / (high1 - low1); + } + + float saturate(float x) { + return clamp(x, 0.0, 1.0); + }`),i.code.add(V` + float getCloudShape(vec3 pos, float pOffset) { + const float textureWidth = ${V.float(v2)}; + const float dataWidth = ${V.float(v2)}; + const float tileRows = ${V.float(Q0)}; + const vec3 atlasDimensions = vec3(${V.float(pf)}, ${V.float(pf)}, tileRows * tileRows); + + //Change from Y being height to Z being height + vec3 p = float(${V.float(Wyt)}) * pos.xzy; + + //Pixel coordinates of point in the 3D data + vec3 coord = vec3(mod(p - pOffset * atlasDimensions, atlasDimensions)); + float f = fract(coord.z); + float level = floor(coord.z); + float tileY = floor(level / tileRows); + float tileX = level - tileY * tileRows; + + //The data coordinates are offset by the x and y tile, the two boundary cells between each tile pair and the initial boundary cell on the first row/column + vec2 offset = atlasDimensions.x * vec2(tileX, tileY) + 2.0 * vec2(tileX, tileY) + 1.0; + vec2 pixel = coord.xy + offset; + vec2 data = texture(cloudShapeTexture, mod(pixel, dataWidth) / textureWidth).xy; + + return 1.0 - mix(data.x, data.y, f); + } + + float getCloudMap(vec2 p){ + // Shift the texture center to origin to avoid seam artifacts + vec2 uv = (${V.float(Xyt)} * p) / ${V.float(v2)} + 0.5; + + return texture(cloudShapeTexture, uv).a; + } + `),i.code.add(V`float clouds(vec3 p) { +float cloud = saturate(0.5 * mix(0.0, 1.0, min(2.0 * coverage, 1.0))); +if (cloud <= 0.0) { +return 0.0; +} +float cloudMap = getCloudMap(cloudSize * p.xy); +cloud = mix(cloud, min(2.0 * (coverage), 1.0) * cloudMap, min(2.0 * (1.0 - coverage), 1.0)); +if (cloud <= 0.0) { +return 0.0; +} +float shape = getCloudShape(8.0 * cloudSize * p, 0.0); +cloud = saturate(remap(cloud, smoothness * shape, 1.0, 0.0, 1.0)); +if (cloud <= 0.0) { +return 0.0; +} +float heightFraction = saturate((length(p) - cloudRadius - cloudStart) / cloudHeight); +cloud *= saturate(remap(heightFraction, 0.0, 0.25, 0.0, 1.0)) * smoothstep(1.0, 0.25, heightFraction); +if (cloud <= 0.0) { +return 0.0; +} +return density * saturate(remap(cloud, 0.35 * smoothness * getCloudShape(detailSize * p, 0.0), 1.0, 0.0, 1.0)); +}`),i.code.add(V`vec2 sphereIntersections(vec3 start, vec3 dir, float radius) { +float a = dot(dir, dir); +float b = 2.0 * dot(dir, start); +float c = dot(start, start) - (radius * radius); +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)); +} +float HenyeyGreenstein(float g, float costh) { +return (1.0 / (4.0 * 3.1415)) * ((1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * costh, 1.5)); +}`),i.code.add(` + float multipleOctaves(float extinction, float mu, float stepL) { + float attenuation = 1.0; + float contribution = 1.0; + float phaseAttenuation = 1.0; + float luminance = 0.0; + + for (int i = 0; i < 4; i++) { + float phase = mix(HenyeyGreenstein(0.0, mu), HenyeyGreenstein(0.3 * phaseAttenuation, mu), 0.7); + luminance += contribution * phase * exp(-stepL * extinction * sigmaE * attenuation); + attenuation *= 0.2; + contribution *= 0.6; + phaseAttenuation *= 0.5; + } + + return luminance; + }`),i.code.add(V`float lightRay(vec3 org, vec3 p, float phaseFunction, float mu, vec3 sunDirection) { +float lightRayDensity = clouds(p); +lightRayDensity += clouds(p + sunDirection * 1.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 2.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 3.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 4.0 * stepL); +lightRayDensity += clouds(p + sunDirection * 5.0 * stepL); +float beersLaw = multipleOctaves(lightRayDensity, mu, stepL); +return mix(beersLaw * 2.0 * (1.0 - (exp(-stepL * lightRayDensity * 2.0 * sigmaE ))), beersLaw, 0.5 + 0.5 * mu); +}`),i.code.add(V`float mainRay(vec3 org, vec3 dir, vec3 sunDirection, float distToStart, float totalDistance, out float totalTransmittance) { +if (dir.z < 0.0) { +return 0.0; +} +totalTransmittance = 1.0; +float stepS = totalDistance / float(STEPS); +float cameraHeight = length(org); +float mu = 0.5 + 0.5 * dot(sunDirection, dir); +float phaseFunction = mix(HenyeyGreenstein(-0.3, mu), HenyeyGreenstein(0.3, mu), 0.7); +vec3 p = org + distToStart * dir; +float dist = distToStart; +float shading = 0.0; +for (int i = 0; i < STEPS; i++) { +float sampleDensity = clouds(p); +float sampleSigmaE = sampleDensity * sigmaE; +if (sampleDensity > 0.0 ) { +float ambient = mix((1.2), (1.6), saturate((length(p) - cloudRadius - cloudStart) / cloudHeight)); +float luminance = sampleDensity * (ambient + power * phaseFunction * lightRay(org, p, phaseFunction, mu, sunDirection)); +float transmittance = exp(-sampleSigmaE * stepS); +shading += totalTransmittance * (luminance - luminance * transmittance) / sampleSigmaE; +totalTransmittance *= transmittance; +if (totalTransmittance <= 0.001) { +totalTransmittance = 0.0; +break; +} +} +dist += stepS; +p = org + dir * dist; +} +return shading; +}`),i.code.add(V`void main() { +if (coverage == 0.0) { +fragColor = vec4(0.0, 1.0, 0.0, 1.0); +return; +} +vec3 rayDir = rayDirection(gl_FragCoord.xy); +rayDir = normalize(view * rayDir); +vec3 viewPos = vec3(0, 0, cloudRadius + 1.0); +bool hitsPlanet = rayDir.z < 0.0; +float hazeFactor = smoothstep(-0.01, mix(0.0, 0.075, cloudVariables.x), abs(dot(rayDir, vec3(0, 0, 1)))); +float totalTransmittance = 1.0; +float shading = 0.0; +if (hitsPlanet) { +shading = clamp(1.0 - cloudVariables.y, 0.6, 1.0) * (1.0 - hazeFactor); +totalTransmittance = hazeFactor; +fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance); +return; +} +vec2 rayStartIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart); +vec2 rayEndIntersect = sphereIntersections(viewPos, rayDir, cloudRadius + cloudStart + cloudHeight); +float distToStart = rayStartIntersect.y; +float totalDistance = rayEndIntersect.y - distToStart; +vec3 sunDirection = normalize(vec3(0, 0, 1)); +shading = 0.5 * mainRay(viewPos, rayDir, sunDirection, distToStart, totalDistance, totalTransmittance); +shading = mix(clamp(1.0 - cloudVariables.y, 0.6, 1.0), shading, hazeFactor); +totalTransmittance = mix(0.0, totalTransmittance, hazeFactor); +fragColor = vec4(shading, totalTransmittance, shading, totalTransmittance); +}`),e}const Zyt=yt(),Jyt=Object.freeze(Object.defineProperty({__proto__:null,CloudsDrawParameters:Cae,CloudsPassParameters:Eae,build:C$e},Symbol.toStringTag,{value:"Module"}));let A$e=class M$e extends Hr{constructor(e,i){super(e,i,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,M$e.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:hd(st.CONSTANT_COLOR,st.ONE_MINUS_CONSTANT_COLOR,Xy.ADD,this.configuration.writeTextureChannels===YT.RG?[1,1,0,0]:[0,0,1,1]),depthTest:{func:Zr.LEQUAL},colorWrite:ji})}};A$e.shader=new Rr(Jyt,()=>we(()=>Promise.resolve().then(()=>mWt),void 0));var np;(function(t){t[t.Full=0]="Full",t[t.WeatherMap=1]="WeatherMap",t[t.COUNT=2]="COUNT"})(np||(np={}));let Vee=class extends nh{constructor(){super(...arguments),this.mode=np.Full}};y([fe({count:np.COUNT})],Vee.prototype,"mode",void 0);let Aae=class extends _n{constructor(){super(...arguments),this.weatherTile=Ji(0,0)}};function O$e(t){const e=new Cr;return e.include(Pc,!1),e.fragment.code.add(V`float remap(float x, float low1, float high1, float low2, float high2) { +return low2 + (x - low1) * (high2 - low2) / (high1 - low1); +}`),t.mode===np.Full&&e.fragment.code.add(V` + float saturate(float x) { + return clamp(x, 0.0, 1.0); + } + + // Safer modulo for positive and negative values + vec3 modulo(vec3 m, float n){ + return mod(mod(m, n) + n, n); + } + + vec3 hash(vec3 p3, float frequency){ + p3 = modulo(p3, frequency); + p3 = fract(p3 * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yxz + 33.33); + return -1.0 + 2.0 * fract((p3.xxy + p3.yxx) * p3.zyx); + } + + // 5th order polynomial interpolation + vec3 fade(vec3 t){ + return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0); + } + + float gradientNoise(vec3 p, float frequency){ + // Cell point is in + vec3 i = floor(p); + + // Position in the cell in [0, 1] + vec3 f = fract(p); + + // Interpolation value for gradient mixing + vec3 u = fade(f); + + // Trilinear interpolation of gradients at cube vertices around point + return mix( mix( mix( dot( hash( i + vec3(0.0,0.0,0.0), frequency), f - vec3(0.0,0.0,0.0) ), + dot( hash( i + vec3(1.0,0.0,0.0), frequency), f - vec3(1.0,0.0,0.0) ), u.x), + mix( dot( hash( i + vec3(0.0,1.0,0.0), frequency), f - vec3(0.0,1.0,0.0) ), + dot( hash( i + vec3(1.0,1.0,0.0), frequency), f - vec3(1.0,1.0,0.0) ), u.x), u.y), + mix( mix( dot( hash( i + vec3(0.0,0.0,1.0), frequency), f - vec3(0.0,0.0,1.0) ), + dot( hash( i + vec3(1.0,0.0,1.0), frequency), f - vec3(1.0,0.0,1.0) ), u.x), + mix( dot( hash( i + vec3(0.0,1.0,1.0), frequency), f - vec3(0.0,1.0,1.0) ), + dot( hash( i + vec3(1.0,1.0,1.0), frequency), f - vec3(1.0,1.0,1.0) ), u.x), u.y), u.z ); + } + + float getPerlinNoise(vec3 pos, float frequency) { + float octaveFrequencyFactor = 2.0; + float sum = 0.0; + float weightSum = 0.0; + float weight = 1.0; + + for (int oct = 0; oct < 3; oct++) { + vec3 p = pos * frequency; + float val = 0.5 + 0.5 * gradientNoise(p, frequency); + sum += val * weight; + weightSum += weight; + weight *= 0.5; + frequency *= octaveFrequencyFactor; + } + + float noise = (sum / weightSum); + noise = saturate(noise); + return noise; + } + + float worley(vec3 pos, float numCells) { + vec3 p = pos * numCells; + float d = 1.0e10; + + for (int x = -1; x <= 1; x++) { + for (int y = -1; y <= 1; y++) { + for (int z = -1; z <= 1; z++) { + vec3 tp = floor(p) + vec3(x, y, z); + tp = p - tp - (hash(tp, numCells) * 0.5 + 0.5); + d = min(d, dot(tp, tp)); + } + } + } + + return 1.0 - clamp(d, 0.0, 1.0); + } + + vec3 get3Dfrom2D(vec2 uv) { + vec2 tile = floor(uv); + float z = floor(${V.float(Q0)} * tile.y + tile.x); + return vec3(fract(uv), z); + } + + float getTextureForPointPerlinWorley(vec3 p) { + float perlinNoise = getPerlinNoise(p, ${V.float(8)}); + + float worley0 = worley(p, ${V.float(2)} * 2.0); + float worley1 = worley(p, ${V.float(2)} * 8.0); + float worley2 = worley(p, ${V.float(2)} * 14.0); + + float worleyFBM = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125; + return remap(perlinNoise, 0.0, 1.0, worleyFBM, 1.0); + } + + float getTextureForPointWorley(vec3 p) { + float worley0 = worley(p, ${V.float(2)}); + float worley1 = worley(p, ${V.float(2)} * 2.0); + float worley2 = worley(p, ${V.float(2)} * 4.0); + float worley3 = worley(p, ${V.float(2)} * 8.0); + + float FBM0 = worley0 * 0.625 + worley1 * 0.25 + worley2 * 0.125; + float FBM1 = worley1 * 0.625 + worley2 * 0.25 + worley3 * 0.125; + float FBM2 = worley2 * 0.75 + worley3 * 0.25; + + return FBM0 * 0.625 + FBM1 * 0.25 + FBM2 * 0.125; + } + `),e.fragment.uniforms.add(new ln("weatherTile",i=>i.weatherTile)),e.fragment.code.add(V` + vec2 modulo(vec2 m, float n){ + return mod(mod(m, n) + n, n); + } + + vec2 hash(vec2 p){ + // Get position of p in weather tile + p = modulo(p, ${V.float(fq)}); + + // Get global coordinates of p + p += weatherTile * ${V.float(fq)}; + + // Limit position to avoid numerical instability + p = modulo(p, ${V.float(Yyt)}); + + vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yzx + 33.33); + return 2.0 * fract((p3.xx + p3.yz) * p3.zy) - 1.0; + } + + vec2 fade(vec2 t){ + return (t * t * t) * (t * (t * 6.0 - 15.0) + 10.0); + } + + float gradientNoise(vec2 p){ + vec2 i = floor( p ); + vec2 f = fract( p ); + + vec2 u = fade(f); + + // Bilinear interpolation of gradients at cell vertices around point + return mix( + mix(dot( hash( i + vec2(0.0,0.0) ), f - vec2(0.0,0.0) ), + dot( hash( i + vec2(1.0,0.0) ), f - vec2(1.0,0.0) ), u.x), + mix(dot( hash( i + vec2(0.0,1.0) ), f - vec2(0.0,1.0) ), + dot( hash( i + vec2(1.0,1.0) ), f - vec2(1.0,1.0) ), u.x), + u.y); + } + + float worley(vec2 p){ + float d = 1.0e10; + for (int x = -1; x <= 1; x++){ + for (int y = -1; y <= 1; y++){ + vec2 tp = floor(p) + vec2(x, y); + tp = p - tp - (0.5 + 0.5 * hash(tp)); + d = min(d, dot(tp, tp)); + } + } + return 1.0 - clamp(d, 0.0, 1.0); + } + `),e.fragment.code.add(V`void main() {`),t.mode===np.Full&&e.fragment.code.add(V` + float padWidth = 1.0; + float paddedSize = ${V.float(pf)} + 2.0 * padWidth; + float tileCount = ${V.float(Q0)} * ${V.float(Q0)}; + vec2 tile = floor((gl_FragCoord.xy - 0.5) / paddedSize); + + bool padCell = false; + if (mod(gl_FragCoord.x, paddedSize) == 0.5 || mod(gl_FragCoord.x, paddedSize) == paddedSize - 0.5) { + padCell = true; + } + + if (mod(gl_FragCoord.y, paddedSize) == 0.5 || mod(gl_FragCoord.y, paddedSize) == paddedSize - 0.5) { + padCell = true; + } + + bool startPadX = false; + bool startPadY = false; + bool endPadX = false; + bool endPadY = false; + + if (gl_FragCoord.x == tile.x * paddedSize + 0.5) { + startPadX = true; + } + + if (gl_FragCoord.y == tile.y * paddedSize + 0.5) { + startPadY = true; + } + + if (gl_FragCoord.x == (tile.x + 1.0) * paddedSize - 0.5) { + endPadX = true; + } + + if (gl_FragCoord.y == (tile.y + 1.0) * paddedSize - 0.5) { + endPadY = true; + } + + vec2 padding = vec2(2.0 * padWidth) * tile; + vec2 uv; + + if (padCell) { + vec2 pixel = gl_FragCoord.xy - padWidth - padding; + + if (startPadX) { + pixel.x += ${V.float(pf)}; + } + + if (startPadY) { + pixel.y += ${V.float(pf)}; + } + + if (endPadX) { + pixel.x -= ${V.float(pf)}; + } + + if (endPadY) { + pixel.y -= ${V.float(pf)}; + } + + uv = vec2(pixel.xy / ${V.float(pf)}); + } else { + vec2 pixel = gl_FragCoord.xy - padWidth - padding; + uv = vec2(pixel.xy / ${V.float(pf)}); + } + + vec3 p_ = get3Dfrom2D(uv); + vec3 p = p_; + p.z /= (${V.float(Q0)} * ${V.float(Q0)}); + + float worleyPerlinNoise = getTextureForPointPerlinWorley(p); + float worleyNoise = getTextureForPointWorley(p); + + fragColor.r = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0)); + + p_ = mod(p_ + 1.0, ${V.float(Q0)} * ${V.float(Q0)}); + p = p_; + p.z /= (${V.float(Q0)} * ${V.float(Q0)}); + + worleyPerlinNoise = getTextureForPointPerlinWorley(p); + worleyNoise = getTextureForPointWorley(p); + + fragColor.g = saturate(remap(worleyPerlinNoise, worleyNoise, 1.0, 0.0, 1.0)); + `),e.fragment.code.add(V` + vec2 mapUV = ${V.float(fq)} * (gl_FragCoord.xy / ${V.float(v2)}); + float map = abs(gradientNoise(mapUV)); + map = remap(map, 0.25 * (1.0 - worley(8.0 * mapUV)), 1.0, 0.0, 1.0); + + ${t.mode===np.Full?V`fragColor.ba = vec2(0.0, map);`:V`fragColor = vec4(map);`}; + } + `),e}const Kyt=Object.freeze(Object.defineProperty({__proto__:null,NoiseTextureAtlasPassParameters:Aae,build:O$e},Symbol.toStringTag,{value:"Module"}));let Bee=class P$e extends Hr{initializeProgram(e){return new Ir(e.rctx,P$e.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:this.configuration.mode===np.Full?hd(st.ONE,st.ZERO):Ol(st.ZERO,st.ONE,st.ONE,st.ZERO),depthTest:{func:Zr.ALWAYS},colorWrite:ji})}};Bee.shader=new Rr(Kyt,()=>we(()=>Promise.resolve().then(()=>gWt),void 0));let oI=class extends ze{constructor(e){super(e),this._needsRender=!0,this._passParameters=new Aae,this._frameBuffer=new Hm(e.context.renderContext.rctx,new tn(v2)),this._vao=u1(e.context.renderContext.rctx)}get _techniqueRepository(){return this.context.techniqueRepository}get textureAtlas(){return this._texture!=null?this._weatherMapTechnique!=null&&this._weatherMapTechnique.compiled&&this._needsRender&&(this._texture=this._render(np.WeatherMap)):this._fullTechnique!=null&&this._fullTechnique.compiled&&(this._texture=this._render(np.Full)),this._texture}_setDirty(){this._needsRender=!0}updateWeatherMap(e){this._passParameters.weatherTile[0]===e[0]&&this._passParameters.weatherTile[1]===e[1]||(Qo(this._passParameters.weatherTile,e),this._setDirty())}destroy(){this._fullTechniqueCached=ir(this._fullTechniqueCached),this._weatherMapTechniqueCached=ir(this._weatherMapTechniqueCached),this._frameBuffer=Kt(this._frameBuffer),this._vao=Kt(this._vao)}get _fullTechnique(){if(this._fullTechniqueCached==null){const e=new Vee;e.mode=np.Full,this._fullTechniqueCached=this._techniqueRepository.acquire(Bee,e)}return this._fullTechniqueCached}get _weatherMapTechnique(){if(this._weatherMapTechniqueCached==null){const e=new Vee;e.mode=np.WeatherMap,this._weatherMapTechniqueCached=this._techniqueRepository.acquire(Bee,e)}return this._weatherMapTechniqueCached}_render(e){if(this._vao==null||this._frameBuffer==null)return null;const i=e===np.Full?this._fullTechnique:this._weatherMapTechnique,r=this.context.renderContext.rctx,n=r.getViewport();r.setViewport(0,0,v2,v2),r.bindFramebuffer(this._frameBuffer);const s=r.bindTechnique(i,this._passParameters,null);return r.bindVAO(this._vao),s.assertCompatibleVertexAttributeLocations(this._vao),r.gl.drawArrays(r.gl.TRIANGLE_STRIP,0,4),r.setViewport(n.x,n.y,n.width,n.height),this._needsRender=!1,this._frameBuffer.colorTexture}};y([w({constructOnly:!0})],oI.prototype,"context",void 0),y([w({readOnly:!0})],oI.prototype,"_techniqueRepository",null),oI=y([Z("esri.views.3d.environment.NoiseTextureAtlas")],oI);var Ih;(function(t){t[t.Occluded=0]="Occluded",t[t.NotOccluded=1]="NotOccluded",t[t.Both=2]="Both",t[t.COUNT=3]="COUNT"})(Ih||(Ih={}));function R$e(t){t.include(Kf),t.uniforms.add(new Zt("geometryDepthTexture",(e,i)=>{var r;return(r=i.multipassGeometry.linearDepth)==null?void 0:r.colorTexture}),new ln("nearFar",(e,i)=>i.camera.nearFar)),t.code.add(V`bool geometryDepthTest(vec2 pos, float elementDepth) { +float geometryDepth = linearDepthFromTexture(geometryDepthTexture, pos, nearFar); +return (elementDepth < (geometryDepth - 1.0)); +}`)}let Qyt=class{};function dd(t,e){if(!e.multipassEnabled)return;t.fragment.include(Kf),t.fragment.uniforms.add(new Zt("terrainDepthTexture",(r,n)=>{var s;return(s=n.multipassTerrain.linearDepth)==null?void 0:s.colorTexture})),t.fragment.uniforms.add(new ln("nearFar",(r,n)=>n.camera.nearFar));const i=e.occlusionPass;t.fragment.code.add(V` + ${i?"bool":"void"} terrainDepthTest(float fragmentDepth) { + vec4 data = texelFetch(terrainDepthTexture, ivec2(gl_FragCoord.xy), 0); + float linearDepth = linearDepthFromRGBA(data, nearFar); + ${i?V`return fragmentDepth < linearDepth && data != vec4(0.0, 0.0, 0.0, 1.0);`:V` + if(fragmentDepth ${e.cullAboveGround?">":"<="} linearDepth){ + discard; + }`} + }`)}let e1t=class{constructor(){this.cullAboveGround=!1}};function Oj(t){return t?{ray:Ko(t.ray),c0:t.c0,c1:t.c1}:{ray:Ko(),c0:0,c1:Number.MAX_VALUE}}function t1t(t,e=Oj()){return iU(t,e.ray),e.c0=0,e.c1=Number.MAX_VALUE,e}function i1t(t,e,i=Oj()){const r=rt(t.vector);return JPe(t.origin,e,i.ray),i.c0=0,i.c1=r,i}function Xii(t,e){return I$e(t,t.c0,e)}function Zii(t,e){return I$e(t,t.c1,e)}function I$e(t,e,i){return Be(i,t.ray.origin,De(i,t.ray.direction,e))}new k_(()=>Oj());function OL(t){return t?[Fi(t[0]),Fi(t[1]),Fi(t[2]),Fi(t[3]),Fi(t[4]),Fi(t[5])]:[Fi(),Fi(),Fi(),Fi(),Fi(),Fi()]}function $$e(){return[W(),W(),W(),W(),W(),W(),W(),W()]}function bU(t,e){for(let i=0;i<_P;i++)uj(t[i],e[i]);return t}function L$e(t,e,i,r=l1t){const n=nn(Loe.get(),e,t);Vo(n,n);for(let s=0;s=e[3])return!1}return!0}function r1t(t,e){return F$e(t,t1t(e,k$e.get()))}function Jii(t,e){for(let i=0;i<_P;i++){const r=t[i];if(!kut(r,e))return!1}return!0}function n1t(t,e,i){return F$e(t,i1t(e,i,k$e.get()))}function N$e(t,e){for(let i=0;i<_P;i++)if(fn(t[i],e)>0)return!1;return!0}function F$e(t,e){for(let i=0;i<_P;i++)if(!Fut(t[i],e))return!1;return!0}var Rn,Gt;(function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.TOP=3]="TOP",t[t.NEAR=4]="NEAR",t[t.FAR=5]="FAR"})(Rn||(Rn={})),function(t){t[t.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",t[t.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",t[t.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",t[t.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",t[t.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",t[t.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",t[t.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",t[t.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(Gt||(Gt={}));const s1t={bottom:[Gt.FAR_BOTTOM_RIGHT,Gt.NEAR_BOTTOM_RIGHT,Gt.NEAR_BOTTOM_LEFT,Gt.FAR_BOTTOM_LEFT],near:[Gt.NEAR_BOTTOM_LEFT,Gt.NEAR_BOTTOM_RIGHT,Gt.NEAR_TOP_RIGHT,Gt.NEAR_TOP_LEFT],far:[Gt.FAR_BOTTOM_RIGHT,Gt.FAR_BOTTOM_LEFT,Gt.FAR_TOP_LEFT,Gt.FAR_TOP_RIGHT],right:[Gt.NEAR_BOTTOM_RIGHT,Gt.FAR_BOTTOM_RIGHT,Gt.FAR_TOP_RIGHT,Gt.NEAR_TOP_RIGHT],left:[Gt.FAR_BOTTOM_LEFT,Gt.NEAR_BOTTOM_LEFT,Gt.NEAR_TOP_LEFT,Gt.FAR_TOP_LEFT],top:[Gt.FAR_TOP_LEFT,Gt.NEAR_TOP_LEFT,Gt.NEAR_TOP_RIGHT,Gt.FAR_TOP_RIGHT]},_P=6,o1t=8,a1t=[Mi(-1,-1,-1,1),Mi(1,-1,-1,1),Mi(1,1,-1,1),Mi(-1,1,-1,1),Mi(-1,-1,1,1),Mi(1,-1,1,1),Mi(1,1,1,1),Mi(-1,1,1,1)],k$e=new k_(Oj),l1t=$$e();function c1t(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/e)}function u1t(t,e,i){return 2*Math.atan(Math.sqrt(e*e+i*i)*Math.tan(.5*t)/i)}function h1t(t,e,i){return 2*Math.atan(e*Math.tan(.5*t)/Math.sqrt(e*e+i*i))}function d1t(t,e,i){return 2*Math.atan(i*Math.tan(.5*t)/Math.sqrt(e*e+i*i))}var jee;let ai=jee=class extends ze{constructor(t={}){super(t),this._center=W(),this._up=W(),this._viewUp=W(),this._viewForward=W(),this._viewRight=W(),this._ray=Ko(),this._viewport=Mi(0,0,1,1),this._padding=Mi(0,0,0,0),this._fov=55/180*Math.PI,this._nearFar=Ji(1,1e3),this._viewDirty=!0,this._viewMatrix=Qe(),this._viewProjectionDirty=!0,this._viewProjectionMatrix=Qe(),this._viewInverseTransposeMatrixDirty=!0,this._viewInverseTransposeMatrix=Qe(),this._frustumDirty=!0,this._frustum=OL(),this._fullViewport=Xi(),this._pixelRatio=1,this.relativeElevation=0}get pixelRatio(){return this._pixelRatio}set pixelRatio(t){this._pixelRatio=t>0?t:1}get eye(){return this._ray.origin}set eye(t){this._compareAndSetView(t,this._ray.origin)}get center(){return this._center}set center(t){this._compareAndSetView(t,this._center,"_center")}get ray(){return je(this._ray.direction,this.center,this.eye),this._ray}get up(){return this._up}set up(t){this._compareAndSetView(t,this._up,"_up")}get viewMatrix(){return this._ensureViewClean(),this._viewMatrix}set viewMatrix(t){Ao(this._viewMatrix,t),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0,this._viewProjectionDirty=!0,this._frustumDirty=!0}get viewForward(){return this._ensureViewClean(),this._viewForward}get viewUp(){return this._ensureViewClean(),this._viewUp}get viewRight(){return this._ensureViewClean(),this._viewRight}get nearFar(){return this._nearFar}get near(){return this._nearFar[0]}set near(t){this._nearFar[0]!==t&&(this._nearFar[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get far(){return this._nearFar[1]}set far(t){this._nearFar[1]!==t&&(this._nearFar[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_nearFar"))}get viewport(){return this._viewport}set viewport(t){this.x=t[0],this.y=t[1],this.width=t[2],this.height=t[3]}get screenViewport(){if(this.pixelRatio===1)return this._viewport;const t=UT(Xi(),this._viewport,1/this.pixelRatio),e=this._get("screenViewport");return e&&VT(t,e)?e:t}get screenPadding(){if(this.pixelRatio===1)return this._padding;const t=UT(Xi(),this._padding,1/this.pixelRatio),e=this._get("screenPadding");return e&&VT(t,e)?e:t}get x(){return this._viewport[0]}set x(t){t+=this._padding[er.LEFT],this._viewport[0]!==t&&(this._viewport[0]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get y(){return this._viewport[1]}set y(t){t+=this._padding[er.BOTTOM],this._viewport[1]!==t&&(this._viewport[1]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get width(){return this._viewport[2]}set width(t){this._viewport[2]!==t&&(this._viewport[2]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get height(){return this._viewport[3]}set height(t){this._viewport[3]!==t&&(this._viewport[3]=t,this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_viewport"))}get fullWidth(){return this._viewport[2]+this._padding[er.RIGHT]+this._padding[er.LEFT]}set fullWidth(t){this.width=t-(this._padding[er.RIGHT]+this._padding[er.LEFT])}get fullHeight(){return this._viewport[3]+this._padding[er.TOP]+this._padding[er.BOTTOM]}set fullHeight(t){this.height=t-(this._padding[er.TOP]+this._padding[er.BOTTOM])}get fullViewport(){return this._fullViewport[0]=this._viewport[0]-this._padding[er.LEFT],this._fullViewport[1]=this._viewport[1]-this._padding[er.BOTTOM],this._fullViewport[2]=this.fullWidth,this._fullViewport[3]=this.fullHeight,this._fullViewport}get _aspect(){return this.width/this.height}get padding(){return this._padding}set padding(t){rO(this._padding,t)||(this._viewport[0]+=t[er.LEFT]-this._padding[er.LEFT],this._viewport[1]+=t[er.BOTTOM]-this._padding[er.BOTTOM],this._viewport[2]-=t[er.RIGHT]+t[er.LEFT]-(this._padding[er.RIGHT]+this._padding[er.LEFT]),this._viewport[3]-=t[er.TOP]+t[er.BOTTOM]-(this._padding[er.TOP]+this._padding[er.BOTTOM]),mm(this._padding,t),this._viewProjectionDirty=!0,this._frustumDirty=!0,this.notifyChange("_padding"),this.notifyChange("_viewport"))}get viewProjectionMatrix(){return this._viewProjectionDirty&&(nn(this._viewProjectionMatrix,this.projectionMatrix,this.viewMatrix),this._viewProjectionDirty=!1),this._viewProjectionMatrix}get projectionMatrix(){const t=this.width,e=this.height,i=this.near*Math.tan(this.fovY/2),r=i*this._aspect,n=JAe(Qe(),-r*(1+2*this._padding[er.LEFT]/t),r*(1+2*this._padding[er.RIGHT]/t),-i*(1+2*this._padding[er.BOTTOM]/e),i*(1+2*this._padding[er.TOP]/e),this.near,this.far),s=this._get("projectionMatrix");return s&&CB(s,n)?s:n}get inverseProjectionMatrix(){return Vo(Qe(),this.projectionMatrix)||this._get("inverseProjectionMatrix")||Qe()}get fov(){return this._fov}set fov(t){this._fov=t,this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovX(){return h1t(this._fov,this.width,this.height)}set fovX(t){this._fov=c1t(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get fovY(){return d1t(this._fov,this.width,this.height)}set fovY(t){this._fov=u1t(t,this.width,this.height),this._viewProjectionDirty=!0,this._frustumDirty=!0}get distance(){return Sn(this.center,this.eye)}get frustum(){return this._recomputeFrustum(),this._frustum}get viewInverseTransposeMatrix(){return(this._viewInverseTransposeMatrixDirty||this._viewDirty)&&(Vo(this._viewInverseTransposeMatrix,this.viewMatrix),ld(this._viewInverseTransposeMatrix,this._viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),this._viewInverseTransposeMatrix}depthNDCToWorld(t){const e=2*t-1;return 2*this.near*this.far/(this.far+this.near-e*(this.far-this.near))}get perRenderPixelRatio(){return Math.tan(this.fovX/2)/(this.width/2)}get perScreenPixelRatio(){return this.perRenderPixelRatio*this.pixelRatio}get aboveGround(){return this.relativeElevation!=null&&this.relativeElevation>=0}copyFrom(t){Ne(this._ray.origin,t.eye),this.center=t.center,this.up=t.up,mm(this._viewport,t.viewport),this.notifyChange("_viewport"),mm(this._padding,t.padding),this.notifyChange("_padding"),Qo(this._nearFar,t.nearFar),this.notifyChange("_nearFar"),this._fov=t.fov,this.relativeElevation=t.relativeElevation;const e=t;return this._viewDirty=e._viewDirty,this._viewDirty||(Ao(this._viewMatrix,t.viewMatrix),Ne(this._viewRight,t.viewRight),Ne(this._viewUp,t.viewUp),Ne(this._viewForward,t.viewForward)),this._viewProjectionDirty=!0,this._frustumDirty=e._frustumDirty,this._frustumDirty||(bU(this._frustum,t.frustum),this._frustumDirty=!1),e._viewInverseTransposeMatrixDirty?this._viewInverseTransposeMatrixDirty=!0:(Ao(this._viewInverseTransposeMatrix,t.viewInverseTransposeMatrix),this._viewInverseTransposeMatrixDirty=!1),mm(this._fullViewport,t.fullViewport),this.pixelRatio=t.pixelRatio,this}copyViewFrom(t){this.eye=t.eye,this.center=t.center,this.up=t.up}clone(){return new jee().copyFrom(this)}equals(t){return jr(this.eye,t.eye)&&jr(this.center,t.center)&&jr(this.up,t.up)&&rO(this._viewport,t.viewport)&&rO(this._padding,t.padding)&&kIe(this.nearFar,t.nearFar)&&this._fov===t.fov&&this.pixelRatio===t.pixelRatio&&this.relativeElevation===t.relativeElevation}almostEquals(t){const e=Math.max(1,1/this.pixelRatio,1/t.pixelRatio);if(Math.abs(t.fov-this._fov)>=.001||$z(t.screenPadding,this.screenPadding)>=e||$z(this.screenViewport,t.screenViewport)>=e)return!1;xn(Ql,t.eye,t.center),xn(mq,this.eye,this.center);const i=Ve(Ql,mq),r=HO(Ql),n=HO(mq),s=5e-4;return i*i>=(1-1e-10)*r*n&&vB(t.eye,this.eye)2&&(e[2]=.5*(Qi[2]+1))),e}unprojectFromScreen(t,e){return this.unprojectFromRenderScreen(this.screenToRender(t,gq),e)}unprojectFromRenderScreen(t,e){if(nn(HD,this.projectionMatrix,this.viewMatrix),!Vo(HD,HD))return null;const i=this.fullViewport;return Qi[0]=2*(t[0]-i[0])/i[2]-1,Qi[1]=2*(t[1]-i[1])/i[3]-1,Qi[2]=2*t[2]-1,Qi[3]=1,lp(Qi,Qi,HD),Qi[3]===0?null:(e[0]=Qi[0]/Qi[3],e[1]=Qi[1]/Qi[3],e[2]=Qi[2]/Qi[3],e)}constrainWindowSize(t,e,i,r){const n=t*this.pixelRatio,s=e*this.pixelRatio,o=Math.max(n-i/2,0),l=Math.max(this.fullHeight-s-r/2,0),c=-Math.min(n-i/2,0),f=-Math.min(this.fullHeight-s-r/2,0),_=i-c- -Math.min(this.fullWidth-n-i/2,0),x=r-f- -Math.min(s-r/2,0);return[Math.round(o),Math.round(l),Math.round(_),Math.round(x)]}computeUp(t){t===_t.Global?this._computeUpGlobal():this._computeUpLocal()}screenToRender(t,e){const i=t[0]*this.pixelRatio,r=this.fullHeight-t[1]*this.pixelRatio;return e[0]=i,e[1]=r,e}renderToScreen(t,e){const i=t[0]/this.pixelRatio,r=(this.fullHeight-t[1])/this.pixelRatio;e[0]=i,e[1]=r}_computeUpGlobal(){je(Ql,this.center,this.eye);const t=rt(this.center);t<1?(Ie(this._up,0,0,1),this._markViewDirty(),this.notifyChange("_up")):Math.abs(Ve(Ql,this.center))>.9999*rt(Ql)*t||(Wt(this._up,Ql,this.center),Wt(this._up,this._up,Ql),Ye(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_computeUpLocal(){R_(Ql,this.eye,this.center),Math.abs(Ql[2])<=.9999&&(De(Ql,Ql,Ql[2]),Ie(this._up,-Ql[0],-Ql[1],1-Ql[2]),Ye(this._up,this._up),this.notifyChange("_up"),this._markViewDirty())}_compareAndSetView(t,e,i=""){typeof t[0]=="number"&&isFinite(t[0])&&typeof t[1]=="number"&&isFinite(t[1])&&typeof t[2]=="number"&&isFinite(t[2])?jr(t,e)||(Ne(e,t),this._markViewDirty(),i.length&&this.notifyChange(i)):Ce.getLogger("esri.views.3d.webgl-engine.lib.Camera").warn("Camera vector contains invalid number, ignoring value")}_markViewDirty(){this._viewDirty=!0,this._frustumDirty=!0,this._viewProjectionDirty=!0}_recomputeFrustum(){this._frustumDirty&&(L$e(this.viewMatrix,this.projectionMatrix,this._frustum),this._frustumDirty=!1)}_ensureViewClean(){this._viewDirty&&(EB(this._viewMatrix,this.eye,this.center,this.up),Ie(this._viewForward,-this._viewMatrix[2],-this._viewMatrix[6],-this._viewMatrix[10]),Ie(this._viewUp,this._viewMatrix[1],this._viewMatrix[5],this._viewMatrix[9]),Ie(this._viewRight,this._viewMatrix[0],this._viewMatrix[4],this._viewMatrix[8]),this._viewDirty=!1,this._viewInverseTransposeMatrixDirty=!0)}};y([w()],ai.prototype,"_center",void 0),y([w()],ai.prototype,"_up",void 0),y([w()],ai.prototype,"_viewport",void 0),y([w()],ai.prototype,"_padding",void 0),y([w()],ai.prototype,"_fov",void 0),y([w()],ai.prototype,"_nearFar",void 0),y([w()],ai.prototype,"_pixelRatio",void 0),y([w()],ai.prototype,"pixelRatio",null),y([w()],ai.prototype,"eye",null),y([w()],ai.prototype,"center",null),y([w()],ai.prototype,"up",null),y([w({readOnly:!0})],ai.prototype,"nearFar",null),y([w()],ai.prototype,"near",null),y([w()],ai.prototype,"far",null),y([w()],ai.prototype,"viewport",null),y([w({readOnly:!0})],ai.prototype,"screenViewport",null),y([w({readOnly:!0})],ai.prototype,"screenPadding",null),y([w()],ai.prototype,"x",null),y([w()],ai.prototype,"y",null),y([w()],ai.prototype,"width",null),y([w()],ai.prototype,"height",null),y([w()],ai.prototype,"fullWidth",null),y([w()],ai.prototype,"fullHeight",null),y([w({readOnly:!0})],ai.prototype,"_aspect",null),y([w()],ai.prototype,"padding",null),y([w({readOnly:!0})],ai.prototype,"projectionMatrix",null),y([w({readOnly:!0})],ai.prototype,"inverseProjectionMatrix",null),y([w()],ai.prototype,"fov",null),y([w()],ai.prototype,"fovX",null),y([w()],ai.prototype,"fovY",null),ai=jee=y([Z("esri.views.3d.webgl-engine.lib.Camera")],ai);const Qi=Xi(),HD=Qe(),Ql=W(),mq=W(),gq=Za();var er;(function(t){t[t.TOP=0]="TOP",t[t.RIGHT=1]="RIGHT",t[t.BOTTOM=2]="BOTTOM",t[t.LEFT=3]="LEFT"})(er||(er={}));var ke;(function(t){t[t.INTEGRATED_MESH=0]="INTEGRATED_MESH",t[t.OPAQUE_TERRAIN=1]="OPAQUE_TERRAIN",t[t.OPAQUE_MATERIAL=2]="OPAQUE_MATERIAL",t[t.TRANSPARENT_MATERIAL=3]="TRANSPARENT_MATERIAL",t[t.TRANSPARENT_TERRAIN=4]="TRANSPARENT_TERRAIN",t[t.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL=5]="TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL",t[t.OCCLUDED_TERRAIN=6]="OCCLUDED_TERRAIN",t[t.OCCLUDER_MATERIAL=7]="OCCLUDER_MATERIAL",t[t.TRANSPARENT_OCCLUDER_MATERIAL=8]="TRANSPARENT_OCCLUDER_MATERIAL",t[t.OCCLUSION_PIXELS=9]="OCCLUSION_PIXELS",t[t.ANTIALIASING=10]="ANTIALIASING",t[t.COMPOSITE=11]="COMPOSITE",t[t.BLIT=12]="BLIT",t[t.SSAO=13]="SSAO",t[t.HIGHLIGHT=14]="HIGHLIGHT",t[t.SHADOW_HIGHLIGHT=15]="SHADOW_HIGHLIGHT",t[t.ENVIRONMENT_OPAQUE=16]="ENVIRONMENT_OPAQUE",t[t.ENVIRONMENT_TRANSPARENT=17]="ENVIRONMENT_TRANSPARENT",t[t.LASERLINES=18]="LASERLINES",t[t.LASERLINES_CONTRAST_CONTROL=19]="LASERLINES_CONTRAST_CONTROL",t[t.HUD_MATERIAL=20]="HUD_MATERIAL",t[t.LABEL_MATERIAL=21]="LABEL_MATERIAL",t[t.LINE_CALLOUTS=22]="LINE_CALLOUTS",t[t.LINE_CALLOUTS_HUD_DEPTH=23]="LINE_CALLOUTS_HUD_DEPTH",t[t.DRAPED_MATERIAL=24]="DRAPED_MATERIAL",t[t.DRAPED_WATER=25]="DRAPED_WATER",t[t.VOXEL=26]="VOXEL",t[t.MAX_SLOTS=27]="MAX_SLOTS"})(ke||(ke={}));var Jt;(function(t){t[t.Color=0]="Color",t[t.Alpha=1]="Alpha",t[t.FrontFace=2]="FrontFace",t[t.NONE=3]="NONE",t[t.COUNT=4]="COUNT"})(Jt||(Jt={}));let Mae=class{constructor(e=W()){this.intensity=e}},z$e=class{constructor(e=W(),i=nt(.57735,.57735,.57735)){this.intensity=e,this.direction=i}},wU=class{constructor(e=W(),i=nt(.57735,.57735,.57735),r=!0,n=1,s=1){this.intensity=e,this.direction=i,this.castShadows=r,this.specularStrength=n,this.environmentStrength=s}},U$e=class{constructor(){this.r=[0],this.g=[0],this.b=[0]}};function p1t(t,e,i){(i=i||t).length=t.length;for(let r=0;r=0&&(o[0]=.28209479177),e>=1&&(o[1]=.4886025119*r,o[2]=.4886025119*s,o[3]=.4886025119*n),e>=2&&(o[4]=1.09254843059*r*n,o[5]=1.09254843059*n*s,o[6]=.31539156525*(3*s*s-1),o[7]=1.09254843059*r*s,o[8]=.54627421529*(r*r-n*n)),o}function m1t(t,e){const i=V$e(t),r=e||{r:[],g:[],b:[]};r.r.length=r.g.length=r.b.length=i;for(let n=0;n=1?this._lighting=r:(this._fadedLighting.lerpLighting(i,r,e),this._lighting=this._fadedLighting)}},S1t=class{constructor(){this.fadeFactor=1,this.reprojectionMatrix=Qe()}},Mu=class extends ze{constructor(e){super(e),this._techniques=new Array,this._techniqueConfiguration=new VF,this._bindParameters=new Pj(null,null),this._passParameters=new Eae,this._drawParameters=new Cae,this._weatherTile=yt(),this._weatherTileCount=128,this._faceIndex=0,this._tileIndex=0,this.coverage=ui(cc.default.coverage[0],cc.default.coverage[1],.5),this.density=ui(cc.default.density[0],cc.default.density[1],.5),this.absorption=ui(cc.default.absorption[0],cc.default.absorption[1],.5),this.cloudSize=ui(cc.default.cloudSize[0],cc.default.cloudSize[1],.5),this.detailSize=ui(cc.default.detailSize[0],cc.default.detailSize[1],.5),this.smoothness=ui(cc.default.smoothness[0],cc.default.smoothness[1],.5),this.cloudHeight=ui(cc.default.cloudHeight[0],cc.default.cloudHeight[1],.5),this.raymarchingSteps=cc.default.raymarchingSteps,this._viewMatrix=Qe(),this._dirty=!1,this.running=!1,this._vao=u1(e.context.renderContext.rctx)}_getTechnique(e){const i=1-this.context.renderContext.bindParameters.cloudsFade.readChannels,r=i===YT.RG?2*e:2*e+1;return this._techniques[r]||(this._techniqueConfiguration.writeTextureChannels=i,this._techniqueConfiguration.steps=e,this._techniques[r]=new A$e({rctx:this.context.renderContext.rctx,viewingMode:this.view.state.viewingMode},this._techniqueConfiguration),this._techniques[r])}updateWeatherTile(){const e=this.view.camera.position.latitude,i=this.view.camera.position.longitude;if(e==null||i==null)return;or(this._weatherTile,(e+90)/180,(i+180)/360);const r=Math.floor(this._weatherTileCount*Math.abs(2*this._weatherTile[0]-1));this._weatherTile[0]=Math.floor(2*this._weatherTileCount*this._weatherTile[0]),this._weatherTile[1]=Math.floor(4*(this._weatherTileCount-r)*this._weatherTile[1]);let n=0,s=0;if(this.view.environment!=null&&this.view.environment.lighting.type!=="virtual"&&this.view.environment.lighting.date!=null){const o=new Date(this.view.environment.lighting.date);o.setUTCHours(this.view.environment.lighting.date.getUTCHours()+(this.view.environment.lighting.displayUTCOffset??0)),n=31*o.getUTCMonth()+o.getUTCDate(),s=o.getUTCFullYear()}this._weatherTile[0]=(this._weatherTile[0]+n)%(2*this._weatherTileCount),this._weatherTile[1]=(this._weatherTile[1]+s%100)%(4*this._weatherTileCount),zIe(this._passParameters.weatherTile,this._weatherTile)||this.setDirty()}initialize(){const e=Sr(this.view.spatialReference);this._passParameters.cloudRadius=.5*e.radius,this.setDirty(),this.updateWeatherTile(),this.addHandles([this.view.resourceController.scheduler.registerTask(ni.CLOUDS_GENERATOR,this),_e(()=>[this.coverage,this.density,this.absorption,this.cloudSize,this.detailSize,this.smoothness,this.cloudHeight,this.raymarchingSteps],()=>this.setDirty(),ii)])}destroy(){this._techniques.forEach(e=>ir(e)),this._frameBufferCube=Kt(this._frameBufferCube),this._techniques.length=0,this._vao.dispose(),this._passParameters.noiseTexture=et(this._passParameters.noiseTexture)}get _tilesPerFace(){switch(this._techniqueConfiguration.steps){case Wu.SIXTEEN:return 1;case Wu.HUNDRED:return 4;case Wu.COUNT:case Wu.TWOHUNDRED:return 8}}get usedMemory(){var e,i,r;return(((e=this._frameBufferCube)==null?void 0:e.gpuMemoryUsage)??0)+(((r=(i=this._passParameters.noiseTexture)==null?void 0:i.textureAtlas)==null?void 0:r.gpuMemoryUsage)??0)}_ensureNoiseTexture(){if(this._passParameters.noiseTexture!=null)this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile);else{const e=this.context;this._passParameters.noiseTexture=new oI({context:e}),this._passParameters.noiseTexture.updateWeatherMap(this._passParameters.weatherTile)}return this._passParameters.noiseTexture.textureAtlas!=null}_ensureFrameBufferCube(e){if(this._frameBufferCube==null){const i=new tn(e);i.target=Hs.TEXTURE_CUBE_MAP,i.wrapMode=Bi.CLAMP_TO_EDGE,this._frameBufferCube=new Hm(this.context.renderContext.rctx,i)}return this._frameBufferCube}get cubeMap(){return this._frameBufferCube}destroyFrameBufferCube(){this._frameBufferCube=Kt(this._frameBufferCube)}applyPreset(e,i){const r=e.median,n=s=>{const o=ui(s[0],s[1],r);return i<.5?ui(s[0],o,2*i):ui(o,s[1],2*(i-.5))};this.coverage=n(e.coverage),this.density=n(e.density),this.absorption=n(e.absorption),this.cloudSize=n(e.cloudSize),this.detailSize=n(e.detailSize),this.smoothness=n(e.smoothness),this.cloudHeight=n(e.cloudHeight),this.raymarchingSteps=e.raymarchingSteps}setDirty(){this._dirty=this.running=!0}runTask(e){this._faceIndex===0&&this._tileIndex===0&&(this._passParameters.raymarchingSteps=this.raymarchingSteps,this.updateWeatherTile(),Qo(this._passParameters.weatherTile,this._weatherTile));const i=this._getTechnique(this._passParameters.raymarchingSteps);if(!i.compiled||this.context.renderContext.bindParameters.cloudsFade.fadeMode===Vn.CROSS_FADE||!this._ensureNoiseTexture())return Xl.YIELD;this._faceIndex===0&&this._tileIndex===0&&(this.context.renderContext.bindParameters.cloudsFade.renderingStage=gy.RENDERING,this._passParameters.absorption=this.absorption,this._passParameters.density=this.density,this._passParameters.cloudSize=this.cloudSize,this._passParameters.detailSize=this.detailSize,this._passParameters.smoothness=this.smoothness,this._passParameters.cloudHeight=this.cloudHeight,this._passParameters.coverage=this.coverage,this._dirty=!1);const r=this.context.renderContext.rctx,n=r.bindTechnique(i,this._passParameters,this._bindParameters);r.bindVAO(this._vao),n.assertCompatibleVertexAttributeLocations(this._vao);const s=r.getViewport(),o=i.configuration.cubeMapSize,l=o/this._tilesPerFace,c=this._tileIndex*l;r.setViewport(0,c,o,l);const f=this._ensureFrameBufferCube(o);r.bindFramebuffer(f);const _=T1t[this._faceIndex],x=E1t[this._faceIndex];QAe(this._viewMatrix,C1t,_,x),Yf(this._drawParameters.viewMatrix,this._viewMatrix);const T=Hs.TEXTURE_CUBE_MAP_POSITIVE_X+this._faceIndex;return f.setColorTextureTarget(T),n.bindDraw(this._drawParameters,this._bindParameters,this._passParameters),r.gl.drawArrays(r.gl.TRIANGLE_STRIP,0,4),r.gl.flush(),r.setViewport(s.x,s.y,s.width,s.height),this.requestRender(),++this._tileIndex,this._faceIndex===4&&this._tileIndex===this._tilesPerFace?(this.running=this._dirty,this._faceIndex=0,this._tileIndex=0,this.running||(this.context.renderContext.bindParameters.cloudsFade.renderingStage=gy.FADING)):this._tileIndex===this._tilesPerFace&&(++this._faceIndex,this._tileIndex=0),e.madeProgress(),Xl.YIELD}};y([w({constructOnly:!0})],Mu.prototype,"context",void 0),y([w({constructOnly:!0})],Mu.prototype,"view",void 0),y([w({constructOnly:!0})],Mu.prototype,"requestRender",void 0),y([w()],Mu.prototype,"coverage",void 0),y([w()],Mu.prototype,"density",void 0),y([w()],Mu.prototype,"absorption",void 0),y([w()],Mu.prototype,"cloudSize",void 0),y([w()],Mu.prototype,"detailSize",void 0),y([w()],Mu.prototype,"smoothness",void 0),y([w()],Mu.prototype,"cloudHeight",void 0),y([w()],Mu.prototype,"raymarchingSteps",void 0),y([w()],Mu.prototype,"running",void 0),Mu=y([Z("esri.views.3d.environment.CloudsGenerator")],Mu);const T1t=[pn(1,0,0),pn(-1,0,0),pn(0,1,0),pn(0,-1,0),pn(0,0,1)],E1t=[pn(0,1,0),pn(0,1,0),pn(0,0,-1),pn(0,0,1),pn(0,1,0)],C1t=Tae();let Oae=class extends _n{constructor(){super(...arguments),this.fogColor=W(),this.fogStrength=4e-6,this.atmosphereC=1,this.fogAmount=0}};function G$e(){const t=new Cr;t.attributes.add(J.POSITION,"vec2"),t.include(My,{textureCoordinateType:So.Default}),t.varyings.add("worldRay","vec3"),t.varyings.add("eyeDir","vec3");const{vertex:e,fragment:i}=t;return e.uniforms.add(new _s("inverseProjectionMatrix",(r,n)=>n.camera.inverseProjectionMatrix),new _s("inverseViewMatrix",(r,n)=>sP(A1t,n.camera.viewMatrix))),e.code.add(V`void main(void) { +vec3 posViewNear = (inverseProjectionMatrix * vec4(position, -1, 1)).xyz; +eyeDir = posViewNear; +worldRay = (inverseViewMatrix * vec4(posViewNear, 0)).xyz; +forwardTextureCoordinates(); +gl_Position = vec4(position, 1, 1); +}`),i.uniforms.add(new ft("atmosphereC",r=>r.atmosphereC),new Oi("cameraPosition",(r,n)=>n.camera.eye),new ln("nearFar",(r,n)=>n.camera.nearFar),new Zt("depthTexture",r=>r.depthTexture),new ft("fogStrength",r=>r.fogStrength),new ft("fogAmount",r=>r.fogAmount),new Oi("fogColor",r=>r.fogColor)),t.include(Aj),i.include(Kf),i.code.add(V`vec2 sphereIntersect(vec3 start, vec3 dir) { +float a = dot(dir, dir); +float b = 2.0 * dot(dir, start); +float d = (b * b) - 4.0 * a * atmosphereC; +if (d < 0.0) { +return vec2(1e5, -1e5); +} +return vec2((-b - sqrt(d)) / (2.0 * a), (-b + sqrt(d)) / (2.0 * a)); +}`),i.code.add(V`vec4 applyFog(float dist, vec3 rayDir){ +if(dist == -1.0){ +vec2 rayAtmosphereIntersect = sphereIntersect(cameraPosition, rayDir); +dist = 0.055 * rayAtmosphereIntersect.y; +} +float fogAmount = fogAmount * (1.0 - exp(-dist * fogStrength)); +return vec4(fogAmount * fogColor, fogAmount); +}`),i.code.add(V`vec3 tonemapACES(vec3 x) { +return clamp((x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14), 0.0, 1.0); +} +void main() { +vec3 rayDir = normalize(worldRay); +float terrainDepth = -1.0; +float depthSample = texture(depthTexture, vuv0).r; +float zNorm = 2.0 * depthSample - 1.0; +float linDepth = 2.0 * nearFar[0] * nearFar[1] / (nearFar[1] + nearFar[0] - zNorm * (nearFar[1] - nearFar[0])); +if(depthSample < 1.0 && depthSample > 0.0){ +vec3 cameraSpaceRay = normalize(eyeDir); +cameraSpaceRay /= cameraSpaceRay.z; +cameraSpaceRay *= linDepth; +terrainDepth = max(0.0, length(cameraSpaceRay)); +} +vec4 fog = applyFog(terrainDepth, rayDir); +fragColor = delinearizeGamma(vec4(tonemapACES(fog.rgb), fog.a)); +}`),t}const A1t=Qe(),M1t=Object.freeze(Object.defineProperty({__proto__:null,FogPassParameters:Oae,build:G$e},Symbol.toStringTag,{value:"Module"}));let H$e=class q$e extends Hr{constructor(e){super(e,new nh,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,q$e.shader.get().build(),Er)}initializePipeline(){return Ti({blending:Ol(st.SRC_ALPHA,st.ZERO,st.ONE_MINUS_SRC_ALPHA,st.ONE),colorWrite:ji})}};H$e.shader=new Rr(M1t,()=>we(()=>Promise.resolve().then(()=>yWt),void 0));const O1t=.95,P1t=1;let Y3=class extends ze{constructor(e){super(e),this._passParameters=new Oae;const i=e.context.renderContext.rctx;this._vao=u1(i,H9),this._technique=new H$e(e);const r=Sr(e.view.spatialReference);this._planetRadius=r.radius,this._atmosphereRadius=r.radius+Nw}destroy(){this._technique.release(),this._vao.dispose()}set strength(e){this._passParameters.fogStrength=e}get strength(){return this._passParameters.fogStrength}render(e,i){if(this._update(e,i),this._passParameters.fogAmount<=0)return;const r=this._technique;if(!r.compiled)return void this.context.requestRender();const n=e.offscreenRenderingHelper;n.renderDepthDetached(()=>{this._passParameters.depthTexture=n.depthTexture;const s=e.rctx.bindTechnique(r,this._passParameters,e.bindParameters);this._renderFog(s,e)})}_renderFog(e,i){const r=i.rctx;r.bindVAO(this._vao),e.assertCompatibleVertexAttributeLocations(this._vao),r.drawArrays(sr.TRIANGLE_STRIP,0,4)}_update(e,i){const r=e.bindParameters.camera;Ye(jme,r.eye);const n=Math.max(0,Ve(jme,e.bindParameters.lighting.mainLight.direction)),s=i.color;De(Gme,s,.1),Qr(this._passParameters.fogColor,Gme,s,n);const o=rt(r.eye),l=o*o;this._passParameters.atmosphereC=l-this._atmosphereRadius*this._atmosphereRadius,this._passParameters.fogAmount=(1-pL(O1t*Pv,P1t*Pv,Math.abs(o-this._planetRadius)))*i.amount,this._passParameters.fogStrength=i.strength}static isSupported(e){return e.capabilities.depthTexture}};y([w({constructOnly:!0})],Y3.prototype,"context",void 0),y([w({constructOnly:!0})],Y3.prototype,"view",void 0),y([w({constructOnly:!0})],Y3.prototype,"rctx",void 0),y([w({constructOnly:!0})],Y3.prototype,"viewingMode",void 0),Y3=y([Z("esri.views.3d.environment.Fog")],Y3);let R1t=class{constructor(){this.color=W(),this.strength=0,this.amount=0}};const jme=W(),Gme=W();var ue;(function(t){t[t.Color=0]="Color",t[t.Depth=1]="Depth",t[t.Normal=2]="Normal",t[t.Shadow=3]="Shadow",t[t.ShadowHighlight=4]="ShadowHighlight",t[t.ShadowExcludeHighlight=5]="ShadowExcludeHighlight",t[t.Highlight=6]="Highlight",t[t.Alpha=7]="Alpha",t[t.ObjectAndLayerIdColor=8]="ObjectAndLayerIdColor",t[t.CompositeColor=9]="CompositeColor",t[t.COUNT=10]="COUNT"})(ue||(ue={}));function Pae({code:t},e){e.doublePrecisionRequiresObfuscation?t.add(V`vec3 dpPlusFrc(vec3 a, vec3 b) { +return mix(a, a + b, vec3(notEqual(b, vec3(0)))); +} +vec3 dpMinusFrc(vec3 a, vec3 b) { +return mix(vec3(0), a - b, vec3(notEqual(a, b))); +} +vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = dpPlusFrc(hiA, hiB); +vec3 e = dpMinusFrc(t1, hiA); +vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; +return t1 + t2; +}`):t.add(V`vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { +vec3 t1 = hiA + hiB; +vec3 e = t1 - hiA; +vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; +return t1 + t2; +}`)}let W$e=class extends Ls{constructor(e,i){super(e,"mat4",Or.Draw,(r,n,s)=>r.setUniformMatrix4fv(e,i(n,s)))}};function Nm(t,e){e.instancedDoublePrecision?t.constants.add("cameraPosition","vec3",Ka):t.uniforms.add(new yp("cameraPosition",(i,r)=>Ie(Y$e,r.camera.viewInverseTransposeMatrix[3]-i.origin[0],r.camera.viewInverseTransposeMatrix[7]-i.origin[1],r.camera.viewInverseTransposeMatrix[11]-i.origin[2])))}function Kh(t,e){if(!e.instancedDoublePrecision)return void t.uniforms.add(new _s("proj",(r,n)=>n.camera.projectionMatrix),new W$e("view",(r,n)=>Qu(Hme,n.camera.viewMatrix,r.origin)),new yp("localOrigin",r=>r.origin));const i=r=>Ie(Y$e,r.camera.viewInverseTransposeMatrix[3],r.camera.viewInverseTransposeMatrix[7],r.camera.viewInverseTransposeMatrix[11]);t.uniforms.add(new _s("proj",(r,n)=>n.camera.projectionMatrix),new _s("view",(r,n)=>Qu(Hme,n.camera.viewMatrix,i(n))),new Oi("localOrigin",(r,n)=>i(n)))}const Hme=Qe(),Y$e=W();function S5(t){t.uniforms.add(new _s("viewNormal",(e,i)=>i.camera.viewInverseTransposeMatrix))}function bP(t){t.uniforms.add(new ft("pixelRatio",(e,i)=>i.camera.pixelRatio/i.overlayStretch))}let Wm=class extends Ls{constructor(e,i){super(e,"mat3",Or.Pass,(r,n,s)=>r.setUniformMatrix3fv(e,i(n,s)))}};function Hee(t,e,i){for(let r=0;rs.modelTransformation??gs)),t.vertex.uniforms.add(new Wm("normalLocalOriginFromModel",s=>(v_(qme,s.modelTransformation??gs),qme)))),e.instanced&&r&&(t.attributes.add(J.INSTANCEMODELORIGINHI,"vec3"),t.attributes.add(J.INSTANCEMODELORIGINLO,"vec3"),t.attributes.add(J.INSTANCEMODEL,"mat3"),t.attributes.add(J.INSTANCEMODELNORMAL,"mat3"));const n=t.vertex;r&&(n.include(Pae,e),n.uniforms.add(new yp("viewOriginHi",(s,o)=>I1t(Ie(WD,o.camera.viewInverseTransposeMatrix[3],o.camera.viewInverseTransposeMatrix[7],o.camera.viewInverseTransposeMatrix[11]),WD)),new yp("viewOriginLo",(s,o)=>$1t(Ie(WD,o.camera.viewInverseTransposeMatrix[3],o.camera.viewInverseTransposeMatrix[7],o.camera.viewInverseTransposeMatrix[11]),WD)))),n.code.add(V` + vec3 getVertexInLocalOriginSpace() { + return ${i?r?"(model * vec4(instanceModel * localPosition().xyz, 1.0)).xyz":"(model * localPosition()).xyz":r?"instanceModel * localPosition().xyz":"localPosition().xyz"}; + } + + vec3 subtractOrigin(vec3 _pos) { + ${r?V` + // Negated inputs are intentionally the first two arguments. The other way around the obfuscation in dpAdd() stopped + // working for macOS 14+ and iOS 17+. + // Issue: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/56280 + vec3 originDelta = dpAdd(-instanceModelOriginHi, -instanceModelOriginLo, viewOriginHi, viewOriginLo); + return _pos - originDelta;`:"return vpos;"} + } + `),n.code.add(V` + vec3 dpNormal(vec4 _normal) { + return normalize(${i?r?"normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz)":"normalLocalOriginFromModel * _normal.xyz":r?"instanceModelNormal * _normal.xyz":"_normal.xyz"}); + } + `),e.output===ue.Normal&&(S5(n),n.code.add(V` + vec3 dpNormalView(vec4 _normal) { + return normalize((viewNormal * ${i?r?"vec4(normalLocalOriginFromModel * (instanceModelNormal * _normal.xyz), 1.0)":"vec4(normalLocalOriginFromModel * _normal.xyz, 1.0)":r?"vec4(instanceModelNormal * _normal.xyz, 1.0)":"_normal"}).xyz); + } + `)),e.hasVertexTangents&&n.code.add(V` + vec4 dpTransformVertexTangent(vec4 _tangent) { + ${i?r?"return vec4(normalLocalOriginFromModel * (instanceModelNormal * _tangent.xyz), _tangent.w);":"return vec4(normalLocalOriginFromModel * _tangent.xyz, _tangent.w);":r?"return vec4(instanceModelNormal * _tangent.xyz, _tangent.w);":"return _tangent;"} + }`)}const WD=W();let hu=class extends qee{};y([fe({constValue:!0})],hu.prototype,"hasSliceHighlight",void 0),y([fe({constValue:!1})],hu.prototype,"hasSliceInVertexProgram",void 0),y([fe({constValue:Or.Pass})],hu.prototype,"pbrTextureBindType",void 0);var Zy;(function(t){t[t.Cone=0]="Cone",t[t.Cylinder=1]="Cylinder",t[t.Underground=2]="Underground",t[t.COUNT=3]="COUNT"})(Zy||(Zy={}));let Rae=class extends hu{constructor(){super(...arguments),this.geometry=Zy.Cone}};y([fe({count:Zy.COUNT})],Rae.prototype,"geometry",void 0);function W9(t){t.attributes.add(J.POSITION,"vec3"),t.vertex.code.add(V`vec3 positionModel() { return position; }`)}function gO(t,e){t.include(W9);const i=t.vertex;i.include(Pae,e),t.varyings.add("vPositionWorldCameraRelative","vec3"),t.varyings.add("vPosition_view","vec3"),i.uniforms.add(new Oi("transformWorldFromViewTH",r=>r.transformWorldFromViewTH),new Oi("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new Wm("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new _s("transformProjFromView",r=>r.transformProjFromView),new ML("transformWorldFromModelRS",r=>r.transformWorldFromModelRS),new yp("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new yp("transformWorldFromModelTL",r=>r.transformWorldFromModelTL)),i.code.add(V`vec3 positionWorldCameraRelative() { +vec3 rotatedModelPosition = transformWorldFromModelRS * positionModel(); +vec3 transform_CameraRelativeFromModel = dpAdd( +transformWorldFromModelTL, +transformWorldFromModelTH, +-transformWorldFromViewTL, +-transformWorldFromViewTH +); +return transform_CameraRelativeFromModel + rotatedModelPosition; +}`),i.code.add(V` + void forwardPosition(float fOffset) { + vPositionWorldCameraRelative = positionWorldCameraRelative(); + if (fOffset != 0.0) { + vPositionWorldCameraRelative += fOffset * ${e.spherical?V`normalize(transformWorldFromViewTL + vPositionWorldCameraRelative)`:V`vec3(0.0, 0.0, 1.0)`}; + } + + vPosition_view = transformViewFromCameraRelativeRS * vPositionWorldCameraRelative; + gl_Position = transformProjFromView * vec4(vPosition_view, 1.0); + } + `),t.fragment.uniforms.add(new Oi("transformWorldFromViewTL",r=>r.transformWorldFromViewTL)),i.code.add(V`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`),t.fragment.code.add(V`vec3 positionWorld() { +return transformWorldFromViewTL + vPositionWorldCameraRelative; +}`)}let Z$e=class extends _n{constructor(){super(...arguments),this.transformWorldFromViewTH=W(),this.transformWorldFromViewTL=W(),this.transformViewFromCameraRelativeRS=as(),this.transformProjFromView=Qe()}},J$e=class extends _n{constructor(){super(...arguments),this.transformWorldFromModelRS=as(),this.transformWorldFromModelTH=W(),this.transformWorldFromModelTL=W()}};function B2(t){t.varyings.add("linearDepth","float")}function XT(t){t.vertex.uniforms.add(new ln("nearFar",(e,i)=>i.camera.nearFar))}function Rj(t){t.vertex.code.add(V`float calculateLinearDepth(vec2 nearFar,float z) { +return (-z - nearFar[0]) / (nearFar[1] - nearFar[0]); +}`)}function wP(t,e){const{vertex:i}=t;switch(e.output){case ue.Color:if(e.receiveShadows)return B2(t),void i.code.add(V`void forwardLinearDepth() { linearDepth = gl_Position.w; }`);break;case ue.Depth:case ue.Shadow:case ue.ShadowHighlight:case ue.ShadowExcludeHighlight:return t.include(gO,e),B2(t),XT(t),Rj(t),void i.code.add(V`void forwardLinearDepth() { +linearDepth = calculateLinearDepth(nearFar, vPosition_view.z); +}`)}i.code.add(V`void forwardLinearDepth() {}`)}function Yu(t){Rj(t),t.vertex.code.add(V`vec4 transformPositionWithDepth(mat4 proj, mat4 view, vec3 pos, vec2 nearFar, out float depth) { +vec4 eye = view * vec4(pos, 1.0); +depth = calculateLinearDepth(nearFar,eye.z); +return proj * eye; +}`),t.vertex.code.add(V`vec4 transformPosition(mat4 proj, mat4 view, vec3 pos) { +return proj * (view * vec4(pos, 1.0)); +}`)}let Ij=class extends _n{constructor(){super(...arguments),this.texV=yt(),this.altitudeFade=0,this.innerScale=0,this.undergroundFadeAlpha=0,this.silhouette=new Iae}},Iae=class{constructor(){this.center=W(),this.v1=W(),this.v2=W()}};function K$e(t){const e=new Cr,{vertex:i,fragment:r}=e;if(B_(i),t.geometry===Zy.Underground)e.attributes.add(J.POSITION,"vec2"),e.varyings.add("color","vec4"),i.uniforms.add(new Oi("cameraPosition",(n,s)=>s.camera.eye),new ft("undergroundFadeAlpha",n=>n.undergroundFadeAlpha)),i.code.add(V`void main(void) { +float ndotl = dot(normalize(cameraPosition), mainLightDirection); +float lighting = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl)); +color = vec4(vec3(lighting), undergroundFadeAlpha); +gl_Position = vec4(position.xy, 1.0, 1.0); +}`),r.code.add(V`void main() { +fragColor = color; +}`);else{e.include(Yu,t),e.attributes.add(J.POSITION,"vec3"),e.varyings.add("vtc","vec2"),e.varyings.add("falloff","float");const n=t.geometry===Zy.Cylinder;i.uniforms.add(new _s("proj",(l,c)=>c.camera.projectionMatrix),new _s("view",(l,c)=>c.camera.viewMatrix)),n||(e.varyings.add("innerFactor","float"),i.uniforms.add(new Oi("silCircleCenter",l=>l.silhouette.center)),i.uniforms.add(new Oi("silCircleV1",l=>l.silhouette.v1)),i.uniforms.add(new Oi("silCircleV2",l=>l.silhouette.v2)),i.uniforms.add(new ln("texV",l=>l.texV)),i.uniforms.add(new ft("innerScale",l=>l.innerScale)));const s=6.2831853,o=1/128;i.code.add(V` + void main(void) { + ${n?V` + vec3 pos = position; + float ndotl = mainLightDirection.z; + vtc = vec2(0.0, position.z + 0.05);`:V` + innerFactor = clamp(-position.z, 0.0, 1.0); + float scale = position.y * (1.0 + innerFactor * innerScale); + float phi = position.x * ${V.float(s*o)} + 1.0; + vec3 pos = (silCircleCenter + sin(phi) * silCircleV1 + cos(phi) * silCircleV2) * scale; + float ndotl = dot(normalize(position.y > 0.0 ? pos: silCircleCenter), mainLightDirection); + vtc.x = position.x * ${V.float(o)}; + vtc.y = texV.x * (1.0 - position.z) + texV.y * position.z; + `} + falloff = max(0.0, smoothstep(-1.0, 0.8, 2.0 * ndotl)); + + gl_Position = transformPosition(proj, view, pos); + gl_Position.z = gl_Position.w; // project atmosphere onto the far plane + } + `),r.uniforms.add(new Zt("tex",l=>l.texture)),n||r.uniforms.add(new ft("altitudeFade",l=>l.altitudeFade)),r.code.add(V` + void main() { + vec4 atmosphereColor = texture(tex, vtc) * falloff; + ${n?V`fragColor = atmosphereColor;`:V` + vec4 innerColor = vec4(atmosphereColor.rgb, 1.0 - altitudeFade); + fragColor = mix(atmosphereColor, innerColor, smoothstep(0.0, 1.0, innerFactor)); + `} + }`)}return e}const L1t=Object.freeze(Object.defineProperty({__proto__:null,SilhouetteCircle:Iae,SimpleAtmospherePassParameters:Ij,build:K$e},Symbol.toStringTag,{value:"Module"}));let xU=class Q$e extends Hr{initializeProgram(e){return new Ir(e.rctx,Q$e.shader.get().build(this.configuration),Er)}initializePipeline(){return this.configuration.geometry===Zy.Cylinder?Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),culling:pae,depthTest:{func:Zr.LEQUAL},colorWrite:ji}):Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),depthTest:{func:Zr.LEQUAL},colorWrite:ji})}};xU.shader=new Rr(L1t,()=>we(()=>Promise.resolve().then(()=>vWt),void 0));const D1t=new Uint8ClampedArray([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,4,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,5,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,6,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,7,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,8,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,9,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,10,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,11,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,12,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,13,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,14,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,0,0,0,15,16,0,0,16,16,0,0,16,16,0,0,16,16,0,0,16,15,0,0,17,15,0,0,17,15,0,0,17,15,0,0,17,14,0,0,18,14,0,0,18,14,0,0,18,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,19,13,0,0,20,13,0,0,20,13,0,0,20,13,0,0,20,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,21,12,0,0,22,12,0,0,22,12,0,0,22,12,0,0,22,11,0,0,23,11,0,0,23,11,0,0,23,11,0,0,24,11,0,0,24,11,0,0,24,11,0,0,24,10,0,0,25,10,0,0,25,10,0,0,25,10,0,0,26,10,0,0,26,10,0,0,26,10,0,0,26,9,0,0,27,9,0,0,27,9,0,0,27,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,28,18,0,0,29,18,0,0,29,18,0,0,29,17,0,0,30,17,0,0,30,17,0,0,30,17,0,0,30,16,0,0,31,16,0,0,31,16,0,0,31,16,0,0,32,16,0,0,32,16,0,0,32,15,0,0,33,15,0,0,33,15,0,0,33,15,0,0,34,15,8,0,34,15,8,0,34,15,8,0,34,15,7,0,35,15,7,0,35,15,7,0,35,21,7,0,36,21,7,0,36,21,7,0,36,21,7,0,37,21,7,0,37,21,7,0,37,20,7,0,38,20,7,0,38,20,7,0,38,20,7,0,39,20,7,0,39,20,7,0,39,20,7,0,39,19,6,0,40,19,6,0,40,19,6,0,40,19,6,0,41,19,6,0,41,19,6,0,41,18,6,0,42,18,6,0,42,18,6,0,42,24,6,0,43,24,6,0,43,24,6,0,43,23,6,0,44,23,6,0,44,23,6,0,44,23,6,0,45,23,6,0,45,23,6,0,45,22,6,0,46,22,6,0,46,22,6,0,46,22,5,0,47,22,5,0,47,22,5,0,47,21,5,0,48,21,5,0,48,21,5,0,48,21,5,0,49,21,5,0,49,26,5,0,49,25,5,0,50,25,5,0,50,25,5,0,50,25,5,0,51,25,5,0,51,25,5,0,51,25,5,0,52,25,5,0,52,25,5,0,52,24,5,0,53,24,5,0,53,24,5,0,53,24,9,0,54,28,9,0,54,28,9,0,54,28,9,0,55,28,9,0,55,27,9,0,56,27,9,0,56,27,9,0,56,27,9,4,57,27,9,4,57,27,9,4,57,26,9,4,58,26,9,4,58,26,9,4,58,26,9,4,59,26,9,4,59,26,9,4,59,26,8,4,60,30,8,4,60,30,8,4,60,29,8,4,61,29,8,4,61,29,8,4,62,29,8,4,62,29,8,4,62,28,8,4,63,28,8,4,63,28,8,4,63,28,12,4,64,28,12,4,64,28,12,4,64,27,12,4,65,27,12,8,65,27,12,8,65,31,12,8,66,31,12,8,66,30,11,8,67,30,11,8,67,30,11,8,67,30,11,8,68,30,11,8,68,30,11,8,68,30,15,7,69,30,15,7,69,30,15,7,69,33,15,11,70,33,15,11,70,32,14,11,71,32,14,11,71,32,14,11,71,32,18,14,72,32,18,14,72,32,18,14,72,31,17,14,73,35,17,14,73,34,17,17,74,34,21,17,74,34,21,17,74,34,20,17,75,34,20,20,75,34,20,20,75,34,23,20,76,34,23,20,76,36,23,23,77,36,23,23,77,36,23,23,77,36,23,23,78,36,26,26,78,36,26,26,78,36,26,26,79,36,26,29,79,38,26,29,80,38,29,29,80,38,29,29,80,38,28,31,81,38,28,31,81,38,31,31,81,37,31,34,82,37,31,34,82,37,31,37,83,40,34,37,83,40,34,37,83,39,33,39,84,39,33,39,84,39,36,42,84,39,36,42,85,39,36,42,85,39,36,42,85,39,39,44,86,39,39,44,86,41,38,47,87,41,41,47,87,41,41,50,87,41,41,49,88,41,41,52,88,40,43,52,89,43,43,52,89,43,43,54,89,42,45,54,90,42,45,57,90,42,45,57,90,42,45,59,91,42,48,59,91,44,47,61,92,44,47,61,92,44,50,61,92,44,49,63,93,44,49,63,93,44,52,66,93,43,52,65,94,46,54,68,94,46,54,70,95,46,54,70,95,46,54,70,95,45,56,72,96,45,56,72,96,45,58,74,97,47,58,76,97,47,58,76,97,47,60,78,98,47,60,78,98,47,60,81,98,49,62,80,99,49,62,82,99,48,61,84,100,48,64,84,100,48,64,84,100,50,63,86,101,50,66,86,101,50,66,88,101,50,65,90,102,52,67,89,103,51,69,91,104,51,68,92,105,52,69,93,107,52,71,94,108,54,70,96,109,53,71,96,111,52,73,98,112,54,72,98,114,53,73,100,115,54,72,100,117,54,73,102,118,55,74,104,120,55,76,105,121,56,77,106,123,56,76,107,124,57,79,107,126,58,78,110,128,57,79,111,129,56,80,113,131,58,79,112,132,57,82,114,134,58,81,116,136,60,82,117,137,59,83,117,139,60,83,119,141,59,84,120,142,60,85,122,144,59,86,122,146,60,86,126,148,62,87,127,149,61,88,127,151,62,88,128,153,63,89,130,155,62,90,131,156,63,90,132,158,64,91,134,160,65,91,135,162,64,92,136,163,63,93,138,165,66,95,139,167,65,95,140,169,66,95,142,171,67,96,142,172,66,97,144,174,67,99,145,176,67,97,148,178,67,99,147,180,68,100,149,181,68,100,150,183,69,101,152,185,70,102,153,187,71,103,155,188,70,103,156,190,70,104,157,192,71,105,158,194,71,106,160,195,72,106,161,197,72,108,161,199,73,108,163,200,73,109,164,202,74,109,165,204,74,110,167,206,75,111,168,207,74,112,170,209,75,112,170,210,76,113,171,212,76,114,173,214,77,115,174,215,78,115,175,217,78,116,175,218,78,117,177,220,78,118,178,221,79,118,180,223,80,120,180,224,81,120,181,226,81,120,182,227,82,121,184,229,82,122,185,230,84,123,186,232,83,123,187,233,84,124,189,234,84,125,188,235,85,126,189,237,86,126,190,238,86,127,191,239,87,127,192,240,87,129,193,242,88,129,194,243,89,130,195,244,90,131,196,245,90,132,197,246,91,132,197,247,92,133,198,248,92,134,199,249,93,135,200,250,94,136,201,251,95,137,202,252,96,138,203,253,97,140,204,254,98,141,205,254,99,142,206,255,101,143,207,255,102,144,208,255,103,146,209,255,104,147,209,255,106,148,210,255,107,149,211,255,108,151,212,255,110,152,213,255,111,153,213,255,112,154,214,255,114,156,215,255,115,157,215,255,117,158,216,255,118,160,217,255,120,161,217,255,121,162,218,255,123,164,218,255,124,165,219,255,125,166,219,255,127,167,220,255,129,169,220,255,130,170,221,255,132,171,221,255,133,173,222,255,134,174,222,255,136,175,223,255,139,178,224,255,142,180,224,255,144,182,225,255,147,185,226,255,150,187,226,255,153,189,227,255,155,191,228,255,158,194,228,255,160,196,229,255,163,198,229,255,165,200,230,255,168,202,231,255,170,203,231,255,172,205,232,255,174,207,232,255,176,209,233,255,178,210,234,255,180,212,234,255,182,214,235,255,184,215,236,255,186,217,237,255,188,219,238,255,190,220,238,255,192,221,239,255,193,222,240,255,194,224,240,255,196,225,241,255,197,226,241,255,198,226,242,255,199,227,242,255,200,228,242,255,201,228,243,255,202,229,243,255,203,230,243,255,204,230,244,255,205,231,244,255,207,232,244,255,208,233,245,255,209,233,245,255,211,234,246,255,213,235,246,255,217,238,247,255,222,240,248,255,226,242,249,255,231,245,250,255,236,247,251,255,241,249,252,255,245,251,253,255,249,252,254,255,255,255,255,255]);function md(t,e=0){const i=t.stride;return Array.from(t.fields.keys()).map(r=>{const n=t.fields.get(r),s=n.constructor.ElementCount,o=N1t(n.constructor.ElementType),l=n.offset,c=!(!n.optional||!n.optional.glNormalized);return new Al(r,s,o,l,i,c,e)})}function N1t(t){const e=F1t[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const F1t={u8:Yt.UNSIGNED_BYTE,u16:Yt.UNSIGNED_SHORT,u32:Yt.UNSIGNED_INT,i8:Yt.BYTE,i16:Yt.SHORT,i32:Yt.INT,f32:Yt.FLOAT};let $ae=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=9;const o=this.TypedArrayConstructor;n===void 0&&(n=9*o.BYTES_PER_ELEMENT);const l=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,l):new o(i,l,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)i[n]=this.typedBuffer[r++];return i}setMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<9;n++)this.typedBuffer[r++]=i[n]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,l=r*i.typedBufferStride;for(let c=0;c<9;++c)n[o++]=s[l++]}get buffer(){return this.typedBuffer.buffer}};$ae.ElementCount=9;let Lae=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=16;const o=this.TypedArrayConstructor;n===void 0&&(n=16*o.BYTES_PER_ELEMENT);const l=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,l):new o(i,l,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)i[n]=this.typedBuffer[r++];return i}setMat(e,i){let r=e*this.typedBufferStride;for(let n=0;n<16;n++)this.typedBuffer[r++]=i[n]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,l=r*i.typedBufferStride;for(let c=0;c<16;++c)n[o++]=s[l++]}get buffer(){return this.typedBuffer.buffer}};Lae.ElementCount=16;let G_=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=1;const o=this.TypedArrayConstructor;n===void 0&&(n=o.BYTES_PER_ELEMENT);const l=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,l):new o(i,l,(s-r)/o.BYTES_PER_ELEMENT),this.stride=n,this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,i){this.typedBuffer[e*this.typedBufferStride]=i}get buffer(){return this.typedBuffer.buffer}};G_.ElementCount=1;let H_=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=2;const o=this.TypedArrayConstructor;n===void 0&&(n=2*o.BYTES_PER_ELEMENT);const l=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,l):new o(i,l,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,or(i,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e]=i[1]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e]=r}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,l=r*i.typedBufferStride;n[o++]=s[l++],n[o]=s[l]}get buffer(){return this.typedBuffer.buffer}};H_.ElementCount=2;let q_=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.elementCount=3;const o=this.TypedArrayConstructor;n===void 0&&(n=3*o.BYTES_PER_ELEMENT);const l=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,l):new o(i,l,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,Ie(i,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e++]=i[1],this.typedBuffer[e]=i[2]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r,n){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e++]=r,this.typedBuffer[e]=n}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,l=r*i.typedBufferStride;n[o++]=s[l++],n[o++]=s[l++],n[o]=s[l]}get buffer(){return this.typedBuffer.buffer}};q_.ElementCount=3;let W_=class{constructor(e,i,r=0,n,s){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const o=this.TypedArrayConstructor;n===void 0&&(n=4*o.BYTES_PER_ELEMENT);const l=i.byteLength===0?0:r;this.typedBuffer=s==null?new o(i,l):new o(i,l,(s-r)/o.BYTES_PER_ELEMENT),this.typedBufferStride=n/o.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,i,r=this.count-i){const n=this.typedBuffer.byteOffset+i*this.stride;return new e(this.buffer,n,this.stride,n+r*this.stride)}getVec(e,i){return e*=this.typedBufferStride,rs(i,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,i){e*=this.typedBufferStride,this.typedBuffer[e++]=i[0],this.typedBuffer[e++]=i[1],this.typedBuffer[e++]=i[2],this.typedBuffer[e]=i[3]}get(e,i){return this.typedBuffer[e*this.typedBufferStride+i]}set(e,i,r){this.typedBuffer[e*this.typedBufferStride+i]=r}setValues(e,i,r,n,s){e*=this.typedBufferStride,this.typedBuffer[e++]=i,this.typedBuffer[e++]=r,this.typedBuffer[e++]=n,this.typedBuffer[e]=s}copyFrom(e,i,r){const n=this.typedBuffer,s=i.typedBuffer;let o=e*this.typedBufferStride,l=r*i.typedBufferStride;n[o++]=s[l++],n[o++]=s[l++],n[o++]=s[l++],n[o]=s[l]}get buffer(){return this.typedBuffer.buffer}};W_.ElementCount=4;let $j=class eLe extends G_{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}static fromTypedArray(e,i){return new eLe(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};$j.ElementType="f32";let TE=class Wee extends H_{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(Wee,e,i)}static fromTypedArray(e,i){return new Wee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};TE.ElementType="f32";let Ea=class Yee extends q_{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(Yee,e,i)}static fromTypedArray(e,i){return new Yee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ea.ElementType="f32";let Fm=class Xee extends W_{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(Xee,e,i)}static fromTypedArray(e,i){return new Xee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Fm.ElementType="f32";let j2=class Zee extends $ae{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(Zee,e,i)}static fromTypedArray(e,i){return new Zee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};j2.ElementType="f32";let Dae=class Jee extends $ae{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(Jee,e,i)}static fromTypedArray(e,i){return new Jee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Dae.ElementType="f64";let Nae=class Kee extends Lae{constructor(e,i=0,r,n){super(Float32Array,e,i,r,n),this.elementType="f32"}slice(e,i){return this.sliceBuffer(Kee,e,i)}static fromTypedArray(e,i){return new Kee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Nae.ElementType="f32";let PL=class Qee extends Lae{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(Qee,e,i)}static fromTypedArray(e,i){return new Qee(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};PL.ElementType="f64";let Fae=class ete extends G_{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(ete,e,i)}static fromTypedArray(e,i){return new ete(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Fae.ElementType="f64";let kae=class tte extends H_{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(tte,e,i)}static fromTypedArray(e,i){return new tte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};kae.ElementType="f64";let e0=class ite extends q_{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(ite,e,i)}static fromTypedArray(e,i){return new ite(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};e0.ElementType="f64";let Lj=class rte extends W_{constructor(e,i=0,r,n){super(Float64Array,e,i,r,n),this.elementType="f64"}slice(e,i){return this.sliceBuffer(rte,e,i)}static fromTypedArray(e,i){return new rte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Lj.ElementType="f64";let T5=class nte extends G_{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(nte,e,i)}static fromTypedArray(e,i){return new nte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};T5.ElementType="u8";let Dj=class ste extends H_{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(ste,e,i)}static fromTypedArray(e,i){return new ste(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Dj.ElementType="u8";let Nj=class ote extends q_{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(ote,e,i)}static fromTypedArray(e,i){return new ote(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Nj.ElementType="u8";let Ac=class ate extends W_{constructor(e,i=0,r,n){super(Uint8Array,e,i,r,n),this.elementType="u8"}slice(e,i){return this.sliceBuffer(ate,e,i)}static fromTypedArray(e,i){return new ate(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Ac.ElementType="u8";let Fj=class lte extends G_{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(lte,e,i)}static fromTypedArray(e,i){return new lte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Fj.ElementType="u16";let zae=class cte extends H_{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(cte,e,i)}static fromTypedArray(e,i){return new cte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};zae.ElementType="u16";let kj=class ute extends q_{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(ute,e,i)}static fromTypedArray(e,i){return new ute(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};kj.ElementType="u16";let Y9=class hte extends W_{constructor(e,i=0,r,n){super(Uint16Array,e,i,r,n),this.elementType="u16"}slice(e,i){return this.sliceBuffer(hte,e,i)}static fromTypedArray(e,i){return new hte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Y9.ElementType="u16";let zj=class dte extends G_{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(dte,e,i)}static fromTypedArray(e,i){return new dte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};zj.ElementType="u32";let Uae=class pte extends H_{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(pte,e,i)}static fromTypedArray(e,i){return new pte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Uae.ElementType="u32";let tLe=class fte extends q_{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(fte,e,i)}static fromTypedArray(e,i){return new fte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};tLe.ElementType="u32";let iLe=class mte extends W_{constructor(e,i=0,r,n){super(Uint32Array,e,i,r,n),this.elementType="u32"}slice(e,i){return this.sliceBuffer(mte,e,i)}static fromTypedArray(e,i){return new mte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};iLe.ElementType="u32";let Vae=class gte extends G_{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(gte,e,i)}static fromTypedArray(e,i){return new gte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Vae.ElementType="i8";let Uj=class yte extends H_{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(yte,e,i)}static fromTypedArray(e,i){return new yte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};Uj.ElementType="i8";let rLe=class vte extends q_{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(vte,e,i)}static fromTypedArray(e,i){return new vte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};rLe.ElementType="i8";let nLe=class _te extends W_{constructor(e,i=0,r,n){super(Int8Array,e,i,r,n),this.elementType="i8"}slice(e,i){return this.sliceBuffer(_te,e,i)}static fromTypedArray(e,i){return new _te(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};nLe.ElementType="i8";let sLe=class bte extends G_{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(bte,e,i)}static fromTypedArray(e,i){return new bte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};sLe.ElementType="i16";let X9=class wte extends H_{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(wte,e,i)}static fromTypedArray(e,i){return new wte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};X9.ElementType="i16";let oLe=class xte extends q_{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(xte,e,i)}static fromTypedArray(e,i){return new xte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};oLe.ElementType="i16";let aLe=class Ste extends W_{constructor(e,i=0,r,n){super(Int16Array,e,i,r,n),this.elementType="i16"}slice(e,i){return this.sliceBuffer(Ste,e,i)}static fromTypedArray(e,i){return new Ste(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};aLe.ElementType="i16";let lLe=class Tte extends G_{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(Tte,e,i)}static fromTypedArray(e,i){return new Tte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};lLe.ElementType="i32";let cLe=class Ete extends H_{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(Ete,e,i)}static fromTypedArray(e,i){return new Ete(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};cLe.ElementType="i32";let uLe=class Cte extends q_{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(Cte,e,i)}static fromTypedArray(e,i){return new Cte(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};uLe.ElementType="i32";let hLe=class Ate extends W_{constructor(e,i=0,r,n){super(Int32Array,e,i,r,n),this.elementType="i32"}slice(e,i){return this.sliceBuffer(Ate,e,i)}static fromTypedArray(e,i){return new Ate(e.buffer,e.byteOffset,i,e.byteOffset+e.byteLength)}};hLe.ElementType="i32";function Wme(t){switch(t){case"u8":case"i8":return 1;case"u16":case"i16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}let Yme=class dLe{constructor(e,i){this.layout=e,this.buffer=typeof i=="number"?new ArrayBuffer(i*e.stride):i;for(const r of e.fields.keys()){const n=e.fields.get(r);this[r]=new n.constructor(this.buffer,n.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,i){const r=this[e];return r&&r.elementCount===i.ElementCount&&r.elementType===i.ElementType?r:null}slice(e,i){return new dLe(this.layout,this.buffer.slice(e*this.stride,i*this.stride))}copyFrom(e,i=0,r=0,n=e.count){const s=this.stride;if(s%4==0){const o=new Uint32Array(e.buffer,i*s,n*s/4);new Uint32Array(this.buffer,r*s,n*s/4).set(o)}else{const o=new Uint8Array(e.buffer,i*s,n*s);new Uint8Array(this.buffer,r*s,n*s).set(o)}return this}get usedMemory(){return this.byteLength}dispose(){}},pLe=class fLe{constructor(e=null){this._stride=0,this._lastAligned=0,this._fields=new Map,e&&(this._stride=e.stride,e.fields.forEach(i=>this._fields.set(i[0],{...i[1],constructor:U1t(i[1].constructor)})))}vec2f(e,i){return this._appendField(e,TE,i),this}vec2f64(e,i){return this._appendField(e,kae,i),this}vec3f(e,i){return this._appendField(e,Ea,i),this}vec3f64(e,i){return this._appendField(e,e0,i),this}vec4f(e,i){return this._appendField(e,Fm,i),this}vec4f64(e,i){return this._appendField(e,Lj,i),this}mat3f(e,i){return this._appendField(e,j2,i),this}mat3f64(e,i){return this._appendField(e,Dae,i),this}mat4f(e,i){return this._appendField(e,Nae,i),this}mat4f64(e,i){return this._appendField(e,PL,i),this}vec4u8(e,i){return this._appendField(e,Ac,i),this}f32(e,i){return this._appendField(e,$j,i),this}f64(e,i){return this._appendField(e,Fae,i),this}u8(e,i){return this._appendField(e,T5,i),this}u16(e,i){return this._appendField(e,Fj,i),this}i8(e,i){return this._appendField(e,Vae,i),this}vec2i8(e,i){return this._appendField(e,Uj,i),this}vec2i16(e,i){return this._appendField(e,X9,i),this}vec2u8(e,i){return this._appendField(e,Dj,i),this}vec4u16(e,i){return this._appendField(e,Y9,i),this}u32(e,i){return this._appendField(e,zj,i),this}_appendField(e,i,r){if(this._fields.has(e))return void Xt(!1,`${e} already added to vertex buffer layout`);const n=i.ElementCount*Wme(i.ElementType),s=this._stride;this._stride+=n,this._fields.set(e,{size:n,constructor:i,offset:s,optional:r})}createBuffer(e){return new Yme(this,e)}createView(e){return new Yme(this,e)}clone(){const e=new fLe;return e._stride=this._stride,e._fields=new Map,this._fields.forEach((i,r)=>e._fields.set(r,i)),e.BufferType=this.BufferType,e}get stride(){if(this._lastAligned!==this._fields.size){let e=1;this._fields.forEach(i=>e=Math.max(e,Wme(i.constructor.ElementType))),this._stride=Math.floor((this._stride+e-1)/e)*e,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}};function ls(){return new pLe}let k1t=class{constructor(e){this.fields=new Array,e.fields.forEach((i,r)=>{const n={...i,constructor:mLe(i.constructor)};this.fields.push([r,n])}),this.stride=e.stride}};const z1t=[$j,TE,Ea,Fm,j2,Nae,Fae,kae,e0,Lj,Dae,PL,T5,Dj,Nj,Ac,Fj,zae,kj,Y9,zj,Uae,tLe,iLe,Vae,Uj,rLe,nLe,sLe,X9,oLe,aLe,lLe,cLe,uLe,hLe];function mLe(t){return`${t.ElementType}_${t.ElementCount}`}function U1t(t){return gLe.get(t)}const gLe=new Map;z1t.forEach(t=>gLe.set(mLe(t),t));function Ja(t,e=!1){return t<=td?e?new Array(t).fill(0):new Array(t):new Float64Array(t)}function yLe(t){return(zf(t)?t.length:t.byteLength/8)<=td?Array.from(t):new Float64Array(t)}function Lf(t,e,i){return Array.isArray(t)?t.slice(e,e+i):t.subarray(e,e+i)}function V1t(t,e){for(let i=0;i(e=e&&r===0,i=i&&r===n,!e&&!i)),e?ux(t.length):i?EE(t.length):zf(t)||t.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?B1t(t):t}function B1t(t){let e=!0;for(const i of t){if(i>=65536)return zf(t)?new Uint32Array(t):t;i>=256&&(e=!1)}return e?new Uint8Array(t):new Uint16Array(t)}function TU(t){return t<=td?new Array(t):t<=65536?new Uint16Array(t):new Uint32Array(t)}function j1t(t){return t<=td?new Array(t):new Uint32Array(t)}let tC=(()=>{const t=new Uint32Array(131072);for(let e=0;e{const t=new Uint16Array(65536);for(let e=0;etC.length){const e=Math.max(2*tC.length,t);tC=new Uint32Array(e);for(let i=0;iYD.length){const e=Math.max(2*YD.length,t);YD=new Uint8Array(e)}return new Uint8Array(YD.buffer,0,t)}var Mte;(function(t){function e(o,l){const c=o[l],f=o[l+1],_=o[l+2];return Math.sqrt(c*c+f*f+_*_)}function i(o,l){const c=o[l],f=o[l+1],_=o[l+2],x=1/Math.sqrt(c*c+f*f+_*_);o[l]*=x,o[l+1]*=x,o[l+2]*=x}function r(o,l,c){o[l]*=c,o[l+1]*=c,o[l+2]*=c}function n(o,l,c,f,_,x=l){(_=_||o)[x]=o[l]+c[f],_[x+1]=o[l+1]+c[f+1],_[x+2]=o[l+2]+c[f+2]}function s(o,l,c,f,_,x=l){(_=_||o)[x]=o[l]-c[f],_[x+1]=o[l+1]-c[f+1],_[x+2]=o[l+2]-c[f+2]}t.length=e,t.normalize=i,t.scale=r,t.add=n,t.subtract=s})(Mte||(Mte={}));var Ws;(function(t){t[t.Layer=0]="Layer",t[t.Object=1]="Object",t[t.Mesh=2]="Mesh",t[t.Line=3]="Line",t[t.Point=4]="Point",t[t.Material=5]="Material",t[t.Texture=6]="Texture",t[t.COUNT=7]="COUNT"})(Ws||(Ws={}));function G1t(t){if(t.length=1),Xt(r.size===3||r.size===4);const{data:n,size:s,indices:o}=r;Xt(o.length%this._numIndexPerPrimitive==0),Xt(o.length>=e.length*this._numIndexPerPrimitive);const l=e.length;let c=s*o[this._numIndexPerPrimitive*e[0]];Sx.clear(),Sx.push(c);const f=nt(n[c],n[c+1],n[c+2]),_=Xr(f);for(let A=0;A0&&++c;if(c<2)return;const f=new Array(8);for(let _=0;_<8;++_)f[_]=n[_]>0?new Uint32Array(n[_]):void 0;for(let _=0;_<8;++_)n[_]=0;for(let _=0;_H1t());const bq=W(),Jme=W();function W1t(t,e){if(!t)return!1;const{size:i,data:r,indices:n}=t;Ie(e,0,0,0),Ie(cf,0,0,0);let s=0,o=0;for(let l=0;l1&&De(e,e,1/o),o>0}function X1t(t,e,i){if(!t)return!1;Ie(i,0,0,0),Ie(cf,0,0,0);let r=0,n=0;const{size:s,data:o,indices:l}=t,c=l.length-1,f=c+(e?2:0);for(let _=0;_0?(Be(i,i,De(Ba,Ba,M)),r+=M):r===0&&(Be(cf,cf,Ba),n++)}return r!==0?(De(i,i,1/r),!0):n!==0&&(De(i,cf,1/n),!0)}const Ba=W(),Fv=W(),XD=W(),cf=W();let EU=class{constructor(e){this.channel=e,this.id=hp()}};function Ote(t,e){return t==null&&(t=[]),t.push(e),t}function Pte(t,e){if(t==null)return null;const i=t.filter(r=>r!==e);return i.length===0?null:i}function Z1t(t,e,i,r,n){ZD[0]=t.get(e,0),ZD[1]=t.get(e,1),ZD[2]=t.get(e,2),Hee(ZD,Tx,3),i.set(n,0,Tx[0]),r.set(n,0,Tx[1]),i.set(n,1,Tx[2]),r.set(n,1,Tx[3]),i.set(n,2,Tx[4]),r.set(n,2,Tx[5])}const ZD=W(),Tx=new Float32Array(6);let Bo=class wLe extends Z9{constructor(e,i,r=null,n=Ws.Mesh,s=null,o=-1){super(),this.material=e,this.mapPositions=r,this.type=n,this.objectAndLayerIdColor=s,this.edgeIndicesLength=o,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[l,c]of i)this._attributes.set(l,{...c,indices:Py(c.indices)}),l===J.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(l).indices.length:this.edgeIndicesLength)}instantiate(e={}){const i=new wLe(e.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,n)=>{r.exclusive=!1,i._attributes.set(n,r)}),i._boundingInfo=this._boundingInfo,i.transformation=e.transformation||this.transformation,i}get attributes(){return this._attributes}getMutableAttribute(e){let i=this._attributes.get(e);return i&&!i.exclusive&&(i={...i,exclusive:!0,data:G1t(i.data)},this._attributes.set(e,i)),i}setAttributeData(e,i){const r=this._attributes.get(e);r&&this._attributes.set(e,{...r,exclusive:!0,data:i})}get indexCount(){const e=this._attributes.values().next().value.indices;return(e==null?void 0:e.length)??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return!!(this.type===Ws.Mesh?this._computeAttachmentOriginTriangles(e):this.type===Ws.Line?this._computeAttachmentOriginLines(e):this._computeAttachmentOriginPoints(e))&&(this._transformation!=null&&bt(e,e,this._transformation),!0)}_computeAttachmentOriginTriangles(e){const i=this.attributes.get(J.POSITION);return W1t(i,e)}_computeAttachmentOriginLines(e){const i=this.attributes.get(J.POSITION);return X1t(i,J1t(this.material.parameters,i),e)}_computeAttachmentOriginPoints(e){const i=this.attributes.get(J.POSITION);return Y1t(i,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.attributes.get(J.POSITION);if(!e||e.indices.length===0)return null;const i=this.type===Ws.Mesh?3:1;Xt(e.indices.length%i==0,"Indexing error: "+e.indices.length+" not divisible by "+i);const r=EE(e.indices.length/i);return new _Le(r,i,e)}get transformation(){return this._transformation??gs}set transformation(e){this._transformation=e&&e!==gs?o5(e):null}addHighlight(){const e=new EU(S_.Highlight);return this.highlights=Ote(this.highlights,e),e}removeHighlight(e){this.highlights=Pte(this.highlights,e)}};function J1t(t,e){return!(!("isClosed"in t)||!t.isClosed)&&e.indices.length>2}const iC=Mte,wq=[[-.5,-.5,.5],[.5,-.5,.5],[.5,.5,.5],[-.5,.5,.5],[-.5,-.5,-.5],[.5,-.5,-.5],[.5,.5,-.5],[-.5,.5,-.5]],K1t=[0,0,1,-1,0,0,1,0,0,0,-1,0,0,1,0,0,0,-1],Q1t=[0,0,1,0,1,1,0,1],evt=[0,1,2,2,3,0,4,0,3,3,7,4,1,5,6,6,2,1,1,0,4,4,5,1,3,2,6,6,7,3,5,4,7,7,6,5],xLe=new Array(36);for(let t=0;t<6;t++)for(let e=0;e<6;e++)xLe[6*t+e]=t;const X3=new Array(36);for(let t=0;t<6;t++)X3[6*t]=0,X3[6*t+1]=1,X3[6*t+2]=2,X3[6*t+3]=2,X3[6*t+4]=3,X3[6*t+5]=0;function tvt(t,e){Array.isArray(e)||(e=[e,e,e]);const i=new Array(24);for(let r=0;r<8;r++)i[3*r]=wq[r][0]*e[0],i[3*r+1]=wq[r][1]*e[1],i[3*r+2]=wq[r][2]*e[2];return new Bo(t,[[J.POSITION,new It(i,evt,3,!0)],[J.NORMAL,new It(K1t,xLe,3)],[J.UV0,new It(Q1t,X3,2)]])}const xq=[[-.5,0,-.5],[.5,0,-.5],[.5,0,.5],[-.5,0,.5],[0,-.5,0],[0,.5,0]],ivt=[0,1,-1,1,1,0,0,1,1,-1,1,0,0,-1,-1,1,-1,0,0,-1,1,-1,-1,0],rvt=[5,1,0,5,2,1,5,3,2,5,0,3,4,0,1,4,1,2,4,2,3,4,3,0],nvt=[0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7];function svt(t,e){Array.isArray(e)||(e=[e,e,e]);const i=new Array(18);for(let r=0;r<6;r++)i[3*r]=xq[r][0]*e[0],i[3*r+1]=xq[r][1]*e[1],i[3*r+2]=xq[r][2]*e[2];return new Bo(t,[[J.POSITION,new It(i,rvt,3,!0)],[J.NORMAL,new It(ivt,nvt,3)]])}const jF=pn(-.5,0,-.5),GF=pn(.5,0,-.5),HF=pn(0,0,.5),qF=pn(0,.5,0),rC=Bs(),nC=Bs(),yO=Bs(),vO=Bs(),_O=Bs();je(rC,jF,qF),je(nC,jF,GF),Wt(yO,rC,nC),Ye(yO,yO),je(rC,GF,qF),je(nC,GF,HF),Wt(vO,rC,nC),Ye(vO,vO),je(rC,HF,qF),je(nC,HF,jF),Wt(_O,rC,nC),Ye(_O,_O);const Sq=[jF,GF,HF,qF],ovt=[0,-1,0,yO[0],yO[1],yO[2],vO[0],vO[1],vO[2],_O[0],_O[1],_O[2]],avt=[0,1,2,3,1,0,3,2,1,3,0,2],lvt=[0,0,0,1,1,1,2,2,2,3,3,3];function cvt(t,e){Array.isArray(e)||(e=[e,e,e]);const i=new Array(12);for(let r=0;r<4;r++)i[3*r]=Sq[r][0]*e[0],i[3*r+1]=Sq[r][1]*e[1],i[3*r+2]=Sq[r][2]*e[2];return new Bo(t,[[J.POSITION,new It(i,avt,3,!0)],[J.NORMAL,new It(ovt,lvt,3)]])}function Rri(t,e,i,r,n={uv:!0}){const s=-Math.PI,o=2*Math.PI,l=-Math.PI/2,c=Math.PI,f=Math.max(3,Math.floor(i)),_=Math.max(2,Math.floor(r)),x=(f+1)*(_+1),T=Rs(3*x),A=Rs(3*x),M=Rs(2*x),I=[];let L=0;for(let k=0;k<=_;k++){const U=[],j=k/_,H=l+j*c,Y=Math.cos(H);for(let Q=0;Q<=f;Q++){const ne=Q/f,re=s+ne*o,he=Math.cos(re)*Y,ce=Math.sin(H),be=-Math.sin(re)*Y;T[3*L]=he*e,T[3*L+1]=ce*e,T[3*L+2]=be*e,A[3*L]=he,A[3*L+1]=ce,A[3*L+2]=be,M[2*L]=ne,M[2*L+1]=j,U.push(L),++L}I.push(U)}const F=new Array;for(let k=0;k<_;k++)for(let U=0;U_&&([f,_]=[_,f]);const x=f.toString()+"."+_.toString();if(o[x])return o[x];let T=n.length;return n.length+=3,iC.add(n,3*f,n,3*_,n,T),iC.scale(n,T,t/iC.length(n,T)),T/=3,o[x]=T,T}for(let f=0;f3?255*r[3]:255]:[255,255,255,255],T=n!=null&&n.length===2?n:[1,1],A=ux(1),M=[[J.POSITION,new It(f,A,3,!0)],[J.NORMAL,new It(_,A,3,!0)],[J.UV0,new It(o,A,o.length)],[J.COLOR,new It(x,A,4,!0)],[J.SIZE,new It(T,A,2)]];if(s!=null){const I=[s[0],s[1],s[2],s[3]];M.push([J.AUXPOS1,new It(I,A,4)])}if(l!=null){const I=[l[0],l[1],l[2],l[3]];M.push([J.FEATUREATTRIBUTE,new It(I,A,4)])}return new Bo(t,M,null,Ws.Point,c)}const hvt=[[-1,-1,0],[1,-1,0],[1,1,0],[-1,1,0]];function Iri(t,e=hvt){const i=new Array(12);for(let f=0;f<4;f++)for(let _=0;_<3;_++)i[3*f+_]=e[f][_];const r=[0,1,2,2,3,0],n=[0,0,1],s=[0,0,0,0,0,0],o=[0,0,1,0,1,1,0,1],l=[255,255,255,255],c=[[J.POSITION,new It(i,r,3,!0)],[J.NORMAL,new It(n,s,3,!0)],[J.UV0,new It(o,r,2,!0)],[J.COLOR,new It(l,s,4,!0)]];return new Bo(t,c)}function Kme(t,e,i,r,n,s=!0,o=!0){let l=0;const c=i,f=e;let _=pn(0,l,0),x=pn(0,l+f,0),T=pn(0,-1,0),A=pn(0,1,0);n&&(l=f,x=pn(0,0,0),_=pn(0,l,0),T=pn(0,1,0),A=pn(0,-1,0));const M=[x,_],I=[T,A],L=r+2,F=Math.sqrt(f*f+c*c);if(n)for(let Y=r-1;Y>=0;Y--){const Q=Y*(2*Math.PI/r),ne=pn(Math.cos(Q)*c,l,Math.sin(Q)*c);M.push(ne);const re=pn(f*Math.cos(Q)/F,-c/F,f*Math.sin(Q)/F);I.push(re)}else for(let Y=0;Y{k[re]=he,U[re]=ce};let H=0;const Y=Bs(),Q=Bs();for(let re=0;re1);const o=[[0,0,0]],l=[],c=[];for(let f=0;f0?n[le][0]:-n[le][0]-1+r.length),_.push(n[le][1]>0?n[le][1]:-n[le][1]-1+r.length),_.push(n[le][2]>0?n[le][2]:-n[le][2]-1+r.length),x.push(0),x.push(0),x.push(0);let ce=r.length;const be=r.length-1;for(let le=0;le0&&(Ne(M,I),le=0?ce+n[le][0]:-n[le][0]-1+Ee),_.push(n[le][2]>=0?ce+n[le][2]:-n[le][2]-1+Ee),_.push(n[le][1]>=0?ce+n[le][1]:-n[le][1]-1+Ee),x.push(pe),x.push(pe),x.push(pe);const te=[[J.POSITION,new It(c,_,3,!0)],[J.NORMAL,new It(f,x,3,!0)]];return new Bo(t,te)}function Lri(t,e,i,r){Xt(e.length>1,"createPolylineGeometry(): polyline needs at least 2 points"),Xt(e[0].length===3,"createPolylineGeometry(): malformed vertex"),Xt(i==null||i.length===e.length,"createPolylineGeometry: need same number of points and normals"),Xt(i==null||i[0].length===3,"createPolylineGeometry(): malformed normal");const n=Ja(3*e.length),s=new Array(2*(e.length-1));let o=0,l=0;for(let f=0;f0&&(s[l++]=f-1,s[l++]=f)}const c=[[J.POSITION,new It(n,s,3,!0)]];if(i){const f=Rs(3*i.length);let _=0;for(let x=0;xn)&&(Wt(i,t,e),Ye(i,i),Wt(r,i,t),Ye(r,r),!0)}function CU(t,e,i,r,n,s,o){return Tq(t,e,n,s,o)||Tq(t,i,n,s,o)||Tq(t,r,n,s,o)}const Qme=.99619469809,sC=Bs();let mvt=class{constructor(e,i){this.type=pc.Local,this._configuration=new Rae,this._passParameters=new Ij,this._configuration.geometry=Zy.Cylinder,this._technique=i.techniqueRepository.acquire(xU,this._configuration);const r=i.renderContext.rctx;this._vao=this._createVertexArrayObject(r),this._vaoCount=Kv(this._vao,"geometry");const n=new tn;n.wrapMode=Bi.CLAMP_TO_EDGE,n.flipped=!0,n.width=1,n.height=512,this._passParameters.texture=new Ai(r,n,D1t)}destroy(){this._passParameters.texture=Kt(this._passParameters.texture),this._vao.dispose(),this._technique.release()}render(e){const i=e.rctx,r=i.bindTechnique(this._technique,this._passParameters,e.bindParameters);gvt(ege,e.bindParameters.camera.viewMatrix),r.setUniformMatrix4fv("view",ege),i.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(sr.TRIANGLES,0,this._vaoCount)}renderHaze(){return!1}_createVertexArrayObject(e){const i=SLe(1,2,!1),{data:r,indices:n}=i[0][1],s=tge.createBuffer(n.length),o=s.position;for(let l=0;l1-511/512,_vt=hF([[50,.1015625],[500,.21875],[5e3,1-250/512],[5e4,.4140625]]);let bvt=class{constructor(e,i){this.view=e,this.type=pc.Mars,this._passParameters=new Ij,this._vaoCount=0,this._texV1=1;const r=Sr(e.spatialReference);this._planetRadius=r.radius,this._outerRimWidth=r.outerAtmosphereRimWidth,this._innerRimFactor=(this._planetRadius+ige)/this._planetRadius,this._middleRimFactor=(this._planetRadius+rge)/this._planetRadius,this._outerRimFactor=(this._planetRadius+this._outerRimWidth)/this._planetRadius,this._texV0=rge/this._outerRimWidth,this._texVScale=this._texV1-this._texV0,this._techniqueRepository=i.techniqueRepository;const n=i.renderContext.rctx;this._cameraChangeHandle=_e(()=>{var l;return(l=this.view.state)==null?void 0:l.camera},()=>i.requestRender(),kt),this._vao=this._createRibbon(n),this._vaoCount=Kv(this._vao,"geometry"),this._fadeVao=u1(n),this._fadeVaoCount=Kv(this._fadeVao,"geometry");const s=new tn;s.wrapMode=Bi.CLAMP_TO_EDGE,s.flipped=!0,s.width=1,s.height=512,this._passParameters.texture=new Ai(n,s,yvt);const o=new Rae;o.geometry=Zy.Cone,this._coneTechnique=this._techniqueRepository.acquire(xU,o),o.geometry=Zy.Underground,this._undergroundTechnique=this._techniqueRepository.acquire(xU,o)}destroy(){this._coneTechnique.release(),this._undergroundTechnique.release(),this._cameraChangeHandle.remove(),this._passParameters.texture=Kt(this._passParameters.texture),this._fadeVao.dispose(),this._vao.dispose()}render(e){const i=e.bindParameters.camera;this._update(i);const r=e.rctx;this._passParameters.undergroundFadeAlpha<1&&(r.bindTechnique(this._coneTechnique,this._passParameters,e.bindParameters),r.bindVAO(this._vao),r.drawArrays(sr.TRIANGLES,0,this._vaoCount)),this._passParameters.undergroundFadeAlpha>0&&(r.bindTechnique(this._undergroundTechnique,this._passParameters,e.bindParameters),r.bindVAO(this._fadeVao),r.drawArrays(sr.TRIANGLE_STRIP,0,this._fadeVaoCount))}renderHaze(){}_update(e){const i=W(),r=this._planetRadius,n=rt(e.eye),s=n-r;if(s<0){const A=Math.min(-s/5e3,1);this._passParameters.undergroundFadeAlpha=A}else this._passParameters.undergroundFadeAlpha=0;const o=Math.max(Eq,s),l=r+ige;this._passParameters.innerScale=wvt(r+o,r,l)-1,this._passParameters.altitudeFade=dae(s),De(i,e.eye,(r+Eq)/n),nge(i,e.center,e.up,r,this._passParameters.silhouette);const c=this._computeScreenRimWidth(e,i,e.up,this._passParameters.silhouette),f=vvt(),_=_vt(s);let x=this._texV0+f*this._texVScale,T=this._texV0+c*_*this._texVScale;if(s>Eq){nge(e.eye,e.center,e.up,r,this._passParameters.silhouette);const A=this._computeScreenRimWidth(e,e.eye,e.up,this._passParameters.silhouette),M=Je((A-1.5)/(c-1.5),0,1);x=this._texV0+M*f*this._texVScale,T=this._texV0+ui(this._texV1,c*_,M)*this._texVScale}or(this._passParameters.texV,x,T)}_createRibbon(e){const i=Rs(3+3*JD*3),r=new Uint32Array(3*JD*5);i[0]=0,i[1]=0,i[2]=-1;for(let o=0;or.camera.eye)),e.vertex.uniforms.add(new Oi("offset",(i,r)=>xvt(i,r))),e.vertex.uniforms.add(new ft("width",i=>i.width)),e.vertex.uniforms.add(new _s("proj",(i,r)=>r.camera.projectionMatrix)),e.vertex.uniforms.add(new _s("view",(i,r)=>r.camera.viewMatrix)),e.vertex.uniforms.add(new ft("time",i=>i.time)),e.varyings.add("vUv","vec2"),e.vertex.code.add(V` + vec3 hash31(float p){ + vec3 p3 = fract(vec3(p) * vec3(0.1031, 0.1030, 0.0973)); + p3 += dot(p3, p3.yzx + 33.33); + return fract((p3.xxy + p3.yzz) * p3.zyx); + } + + float hash11(float p){ + p = fract(p * 0.1031); + p *= p + 33.33; + p *= p + p; + return fract(p); + } + + //https://www.geeks3d.com/20141201/how-to-rotate-a-vertex-by-a-quaternion-in-glsl/ + vec3 rotateVectorByQuaternion(vec3 v, vec4 q){ + return 2.0 * cross(q.xyz, v * q.w + cross(q.xyz, v)) + v; + } + + void main(void) { + + vUv = position.xz; + + vec3 rand = hash31(instanceFeatureAttribute); + + // Set random position for all particles + // The hash function space is not high resolution so offset particles by an additional random value + // This creates grids of 1000 particles which are shifted by random hundreths of the tile width + // overlaying multiple identical but offset grids + vec3 randomPosition = 2.0 * (rand + (0.01 + 0.01 * rand) * floor(0.001 * instanceFeatureAttribute)) - 1.0; + + // Random orientation of rain drops + float angle = 3.1415 * hash11(instanceFeatureAttribute); + + vec3 up = vec3(0, 0, 1); + + // Gravity and wind direction + vec3 direction = normalize(cameraPosition); + + vec3 tangent = normalize(cross(direction, up)); + + // Gravity + vec3 animatedPos = randomPosition + direction * -time; + + // Rain particles fall straight down and are randomly oriented + // Snow particles have random sinusoid trajectories and are rotated to face the camera + ${t.type===T_.Rain?V` + // Random rotation for particle + vec3 rotationAxis = up; + vec4 quat = vec4(rotationAxis * sin(angle), cos(angle)); + vec3 transformedPos = rotateVectorByQuaternion(vec3(0.2, 0.2, 4.0) * (position - vec3(0.5, 0.0, 0.5)), quat); + + // Rotate particle to planetary position + rotationAxis = tangent; + angle = 0.5 * -acos(dot(direction, up)); + quat = vec4(rotationAxis * sin(angle), cos(angle)); + transformedPos = rotateVectorByQuaternion(transformedPos, quat); + + vec4 pos = mat4(mat3(view)) * vec4(transformedPos + (mod(width * animatedPos - offset, width) - 0.5 * width), 1.0); + gl_Position = proj * pos; + `:V` + vec3 rotationAxis = direction; + vec4 quat = vec4(rotationAxis * sin(angle), cos(angle)); + + tangent = rotateVectorByQuaternion(tangent, quat); + // Random sinusoid from friction + animatedPos += tangent * 0.25 * sin(dot(animatedPos, direction)); + vec4 pos = mat4(mat3(view)) * vec4((mod(width * animatedPos - offset, width) - 0.5 * width), 1.0); + gl_Position = proj * (0.5 * vec4(position.xzy, 0.0) + pos); + `} + } + `),e.fragment.uniforms.add(new ft("opacity",i=>i.opacity),new Oi("particleColor",(i,r)=>Svt(r,t))),e.fragment.code.add(V` + void main() { + + // Cut off corners of the triangle + if(vUv.x < 0.0 || vUv.y < 0.0){ + discard; + } + + float d = length(vUv - vec2(0.5)); + + ${t.type===T_.Rain?V`d = 0.35 * smoothstep(0.5, 0.0, d);`:V`d = smoothstep(0.5, 0.1, d);`} + fragColor = opacity * vec4(particleColor * d, d); + } + `),e}function xvt(t,e){const i=e.camera.eye,r=.5*t.width,n=1/t.width,s=pAe($te,Ie($te,(i[0]+r)*n,(i[1]+r)*n,(i[2]+r)*n));return xn(s,i,De(s,s,t.width))}function Svt(t,e){const i=e.type===T_.Rain?Evt:Tvt,r=De($te,i,Cvt),n=t.camera.eye;Ye(oge,n);const s=Math.max(0,Ve(oge,t.lighting.mainLight.direction));return Qr(r,r,i,s)}const $te=W(),oge=W(),Tvt=nt(1,1,1),Evt=nt(.85,.85,.85),Cvt=.7,Avt=Object.freeze(Object.defineProperty({__proto__:null,build:TLe},Symbol.toStringTag,{value:"Module"}));let Mvt=class extends _n{constructor(){super(...arguments),this.time=0,this.radius=1,this.width=500,this.opacity=1}},Lte=class ELe extends Hr{initializeProgram(e){return new Ir(e.rctx,ELe.shader.get().build(this.configuration),WF)}initializePipeline(){return Ti({blending:Ol(st.ONE,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),depthTest:{func:Zr.LEQUAL},colorWrite:ji})}};Lte.shader=new Rr(Avt,()=>we(()=>Promise.resolve().then(()=>_Wt),void 0));const WF=new Map([[J.POSITION,0],[J.INSTANCEFEATUREATTRIBUTE,1]]);let CLe=class{constructor(){this.enabled=!0,this._time=0}get time(){return this._time}advance({deltaTime:e,fixedTime:i}){return i!=null?this._time!==i&&(this._time=i,!0):(this._time=this._time+e,e!==0)}},Ovt=class{constructor(e,i){this.deltaTime=e,this.fixedTime=i}},Z3=class extends ze{constructor(e){super(e),this._numParticles=25e4,this._rainSpeed=.1,this._snowSpeed=.01,this._passParameters=new Mvt,this._animation=new CLe,this._updatingTracking=new Rf,this._passParameters.time=0,this._passParameters.radius=Sr(e.view.spatialReference).radius,this._techniqueRepository=e.context.techniqueRepository}destroy(){this._updatingTracking.destroy(),this._numParticles=0,this._snowTechniqueCached=ir(this._snowTechniqueCached),this._rainTechniqueCached=ir(this._rainTechniqueCached),this._vao=Kt(this._vao),this._instanceIdBuffer=Kt(this._instanceIdBuffer)}get updating(){return this._updatingTracking.updating}get _rainTechnique(){if(this._rainTechniqueCached==null){const e=new Ite;e.type=T_.Rain,this._rainTechniqueCached=this._techniqueRepository.acquire(Lte,e)}return this._rainTechniqueCached}get _snowTechnique(){if(this._snowTechniqueCached==null){const e=new Ite;e.type=T_.Snow,this._snowTechniqueCached=this._techniqueRepository.acquire(Lte,e)}return this._snowTechniqueCached}update(e){return this._animation.advance(e)}render(e,i,r){const n=r==="rainy"?this._rainTechnique:this._snowTechnique;if(!n.compiled)return void this.context.requestRender();const s=e.rctx;if(this._ensureResources(s),n==null||this._vao==null||this._instanceIdBuffer==null||(e.bindParameters.cloudsFade.data!=null&&(this._passParameters.opacity=e.bindParameters.cloudsFade.opacity),this._passParameters.opacity<=0))return;const o=.35;i=i<.5?ui(0,o,2*i):ui(o,1,2*(i-.5)),this._passParameters.time=(r==="rainy"?this._rainSpeed:this._snowSpeed)*Qre(this._animation.time)%1e5;const l=s.bindTechnique(n,this._passParameters,e.bindParameters);s.bindVAO(this._vao),l.assertCompatibleVertexAttributeLocations(this._vao),fae(s,WF,this._instanceIdBuffer,age,0),s.drawArraysInstanced(sr.TRIANGLES,0,3,this._numParticles*i),mae(s,WF,this._instanceIdBuffer,age)}_ensureResources(e){this._vao==null&&(this._vao=this._createVertexArrayObject(e)),this._instanceIdBuffer==null&&(this._instanceIdBuffer=this._createInstanceIndices(e))}_createInstanceIndices(e){const i=[];for(let r=0;rRvt(e,i)),new gr("viewport",(e,i)=>i.camera.fullViewport),new ft("pixelRatio",(e,i)=>i.camera.pixelRatio)),t.vertex.code.add(V`void main(void) { +gl_Position = transform * vec4(position, 0); +vcolor = color / 1.2; +vsize = size * 5.0 * pixelRatio; +gl_PointSize = vsize; +}`),t.fragment.code.add(V`void main() { +float cap = 0.7; +float scale = 1.0 / cap; +float helper = clamp(length(abs(gl_PointCoord - vec2(0.5))), 0.0, cap); +float alpha = clamp((cap - helper) * scale, 0.0, 1.0); +float intensity = alpha * alpha * alpha; +if (vsize < 3.0) { +intensity *= 0.5; +} +fragColor = vec4(vcolor.xyz, intensity); +}`),t}function Rvt(t,e){return Ao(pb,e.camera.projectionMatrix),pb[10]=24e-8-1,pb[11]=-1,pb[14]=(24e-8-2)*e.camera.near,nn(pb,pb,e.camera.viewMatrix),nn(pb,pb,t.modelMatrix)}const pb=Qe(),Ivt=Object.freeze(Object.defineProperty({__proto__:null,build:ALe},Symbol.toStringTag,{value:"Module"}));let $vt=class extends _n{constructor(){super(...arguments),this.modelMatrix=Qe()}},MLe=class OLe extends Hr{constructor(e){super(e,new nh,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,OLe.shader.get().build(),Er)}initializePipeline(){return Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),depthTest:{func:Zr.LEQUAL},colorWrite:ji})}};MLe.shader=new Rr(Ivt,()=>we(()=>Promise.resolve().then(()=>bWt),void 0));let hw=class extends ze{get updating(){return this._updatingTracking.updating||this.loading}get loading(){return this._loadDataTask!=null&&!this._loadDataTask.finished}constructor(e){super(e),this._loadDataTask=null,this._numPoints=0,this._renderParameter=new $vt,this._updatingTracking=new Rf}initialize(){this._loadDataTask=this._createLoadDataTask()}destroy(){this._loadDataTask=gn(this._loadDataTask),this._updatingTracking.destroy(),this._numPoints=0,this._technique=ir(this._technique),this._vao=Kt(this._vao),Ex=null}render(e){const{rctx:i}=e;if(this._ensureResources(i),this._technique==null||this._vao==null)return;if(!this._technique.compiled)return void this.requestRender();const r=i.bindTechnique(this._technique,this._renderParameter,e.bindParameters);i.bindVAO(this._vao),r.assertCompatibleVertexAttributeLocations(this._vao),i.drawArrays(sr.POINTS,0,this._numPoints)}_ensureResources(e){if(this._technique!=null||Ex==null)return;this._technique=new MLe({rctx:e,viewingMode:this.view.state.viewingMode}),this._numPoints=Ex.byteLength/lge;const i=new Float32Array(Ex,0,2*this._numPoints),r=new Uint8Array(Ex,2*this._numPoints*4,this._numPoints);this._vao=this._createVertexArrayObject(e,i,r,this._numPoints),this._updatingTracking.add(()=>this.view.environment.lighting.type!=="virtual"?this.view.environment.lighting.date:null,n=>this._update(n),ii)}_computeDayDuration(e){const i=e,r=new Date(e.getFullYear(),0,1,11,58,56);return(+i-+r)/(+new Date(e.getFullYear()+1,0,1,11,58,55)-+r)}_update(e){if(!e)return;const i=(e.getHours()/12+e.getMinutes()/60*(2/24)+e.getSeconds()/60*(2/1440)-.9972222)%2,r=2*this._computeDayDuration(e),n=Ao(this._renderParameter.modelMatrix,Nvt);YO(n,n,-r*Math.PI),nn(n,Dvt,n),YO(n,n,-i*Math.PI),this.requestRender()}_hexToRGB(e){return[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]}_unpackUint8Attributes(e){return e>=192?[2.9,e-192]:e>=160?[2.5,e-160]:e>=128?[2,e-128]:e>=96?[1.5,e-96]:e>=64?[1,e-64]:e>=32?[.7,e-32]:[.4,e]}_createVertexArrayObject(e,i,r,n){const s=cge.createBuffer(n),o=s.position,l=s.color,c=s.size;for(let f=0;f{const{data:r}=await yXe("esri/views/3d/environment/resources/stars.wsv",{responseType:"array-buffer",signal:i});this._verifyStarData(r),Ex=r});return e.promise.catch(i=>{sn(i)||Ce.getLogger(this).error(i)}).then(()=>{this.destroyed||(this.requestRender(),this.notifyChange("updating"))}),e}_verifyStarData(e){if(!e)throw new se("stars:no-data-received","Failed to create stars because star catalogue is missing");const i=e.byteLength/lge;if(i%1!=0||i>5e4||i<5e3)throw new se("stars:invalid-data","Failed to create stars because star catalogue data is invalid")}};y([w({constructOnly:!0})],hw.prototype,"view",void 0),y([w({constructOnly:!0})],hw.prototype,"requestRender",void 0),y([w({readOnly:!0})],hw.prototype,"updating",null),y([w()],hw.prototype,"_loadDataTask",void 0),y([w()],hw.prototype,"_updatingTracking",void 0),hw=y([Z("esri.views.3d.environment.Stars")],hw);const Lvt=["9bb2ff","9eb5ff","aabfff","bbccff","ccd8ff ","dae2ff","e4e9ff","eeefff","f8f6ff","fff9fb","fff5ef","fff1e5","ffeddb","ffe9d2","ffe6ca","ffe3c3","ffe0bb","ffddb4","ffdaad","ffd6a5","ffd29c","ffcc8f","ffc178","ffa94b","ff7b00"],Dvt=Ooe(1,0,0,0,0,.9174771405229186,.39778850739794974,0,0,-.39778850739794974,.9174771405229186,0,0,0,0,1),Nvt=Ooe(1,0,0,0,0,.9174771405229186,-.39778850739794974,0,0,.39778850739794974,.9174771405229186,0,0,0,0,1),lge=9,cge=ls().vec3f(J.POSITION).vec4u8(J.COLOR).f32(J.SIZE);let Ex=null;const Vj={required:[]},PLe={required:[ue.Depth]},RLe={required:[ue.CompositeColor]},ILe={required:[ue.Highlight]},Fvt={required:[ue.Depth,ue.Normal]};let Bj=class extends ze{consumes(){return Vj}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}},CE=class extends Bj{},$Le=class extends Bj{},kvt=class extends Bj{},zvt=class extends Bj{};var bO;(function(t){t[t.Immediate=0]="Immediate",t[t.Faded=1]="Faded"})(bO||(bO={}));var aI;let Fl=aI=class extends CE{constructor(t){super(t),this.produces=new Map([[ke.ENVIRONMENT_OPAQUE,()=>!(this._atmosphere===null&&this._stars===null)],[ke.ENVIRONMENT_TRANSPARENT,()=>this._atmosphere!==null]]),this._context=null,this._atmosphere=null,this._oldWeatherParameters=new Aq,this._newWeatherParameters=new Aq,this._fadedWeatherParameters=new Aq,this._weatherParameters=this._newWeatherParameters}initialize(){this.view._stage.addRenderPlugin(this)}destroy(){var t;this.removeHandles(),this.uninitializeRenderContext(),((t=this.view)==null?void 0:t._stage)!=null&&this.view._stage.removeRenderPlugin(this),this._set("view",null)}get atmosphere(){return this._atmosphere}get _atmosphereType(){return this.atmosphere!=null?this.atmosphere.type:pc.None}consumes(){return this._atmosphereType===pc.Realistic?PLe:Vj}updateAnimation(t){return this._precipitation!=null&&this._precipitation.update(t)}get updating(){return this._stars!=null&&this._stars.updating||this._clouds!=null&&this._clouds.running}get weatherVisible(){return rt(this.view.state.camera.eye)-Sr(this.view.spatialReference).radius<=Pv}get usedMemory(){var t;return((t=this._clouds)==null?void 0:t.usedMemory)??0}get _stars(){var r;const t=this.view,e=((r=t.environment)==null?void 0:r.starsEnabled)??!1,i=this._get("_stars");return e&&this._context!=null?i??new hw({view:t,requestRender:()=>this._setNeedsRender()}):(et(i),null)}get _precipitation(){const t=this._get("_precipitation");if(!this._precipitationEnabled||this._context==null)return et(t),null;const e=this.view,i=this._context;return t!=null&&t.context===i?t:(et(t),new Z3({context:i,view:e}))}get _clouds(){const t=this._get("_clouds");if(!this.weatherEnabled||this._context==null)return et(t),null;if(t!=null)return t;const e=this.view,i=this._context;return et(t),new Mu({context:i,view:e,requestRender:()=>this._setNeedsRender()})}get _cloudsComposition(){const t=this._get("_cloudsComposition");if(!this.weatherEnabled||this._context==null)return et(t),null;const e=this.view.state.viewingMode,i=this._context.renderContext.rctx,r=Sr(this.view.spatialReference).radius;return t!=null&&t.viewingMode===e&&t.planetRadius===r?t:(et(t),new W3({rctx:i,viewingMode:e,planetRadius:r,requestRender:()=>this._setNeedsRender()}))}get _fog(){const t=this._get("_fog");if(!this.weatherEnabled||this._context==null)return et(t),null;if(t!=null)return t;const e=this.view,i=this._context,r=this._context.renderContext.rctx,n=this.view.state.viewingMode;return new Y3({context:i,view:e,rctx:r,viewingMode:n})}get weatherEnabled(){var t,e;return!!((e=(t=this.view)==null?void 0:t.environmentManager)!=null&&e.weatherEnabled)}get _precipitationEnabled(){return this.weatherEnabled&&(this.view.environment.weather.type==="rainy"||this.view.environment.weather.type==="snowy")}initializeRenderContext(t=null){this._context=t;const e=()=>this._setNeedsRender();this.addHandles([_e(()=>({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled}),i=>this._updateAtmosphere(i),kt),_e(()=>this._stars,e),_e(()=>this._precipitation,e),_e(()=>this._clouds,()=>this._updateWeather(),ii),_e(()=>this._fog,()=>this._updateFogHaze(),ii),_e(()=>this.view.state.mode,()=>{this._setNeedsRender()},Li),_e(()=>this._weatherUpdateParameters,()=>{this._updateWeather(),this._updateFogHaze()},kt)])}uninitializeRenderContext(){this._context=null,this._atmosphere=et(this._atmosphere),this._set("_stars",et(this._stars)),this._set("_precipitation",et(this._precipitation)),this._set("_clouds",et(this._clouds)),this._set("_cloudsComposition",et(this._cloudsComposition)),this._set("_fog",et(this._fog))}prepareRender(t){var e;t.bindParameters.cloudsFade.data=Ayt(this._clouds)?this._clouds:null,this.view.viewingMode!=="local"&&((e=t.bindParameters.cloudsFade.data)==null?void 0:e.cubeMap)!=null&&(this._updateWeatherFading(t.bindParameters,t.time),t.bindParameters.cloudsFade.renderingStage===gy.FINISHED&&this._clouds!=null&&this._clouds.coverage===0&&this._clouds.running===!1&&(this._clouds.destroyFrameBufferCube(),t.bindParameters.cloudsFade.data=null))}renderNode(t){var e,i,r,n,s,o,l;switch(t.bindParameters.slot){case ke.ENVIRONMENT_OPAQUE:this._stars!=null&&this._stars.render(t),this.atmosphere!=null&&(this.atmosphere.render(t,(r=(i=(e=this.view)==null?void 0:e._stage)==null?void 0:i.renderer)==null?void 0:r.fullResolutionAtmosphere),this._cloudsComposition!=null&&t.bindParameters.cloudsFade.data!=null&&(this.weatherVisible&&this._clouds!=null&&this._clouds.updateWeatherTile(),this._cloudsComposition.render(t)),t.bindParameters.cloudsFade.isFading&&this._context!=null&&((n=t.bindParameters.cloudsFade.data)==null?void 0:n.cubeMap)!=null&&this._context.requestRender());break;case ke.ENVIRONMENT_TRANSPARENT:if(this.atmosphere!=null&&(this.atmosphere.renderHaze(t,this._weatherParameters.hazeAmount,(l=(o=(s=this.view)==null?void 0:s._stage)==null?void 0:o.renderer)==null?void 0:l.fullResolutionAtmosphere),this._weatherParameters.fog.amount>0&&this._fog!=null&&this._fog.render(t,this._weatherParameters.fog),this._precipitation!=null)){const c=this.view.environment.weather;c.type!=="rainy"&&c.type!=="snowy"||this._precipitation.render(t,c.precipitation,c.type)}}}updateLightSources(t,e,i,r){if(this._context!=null){const n=this._context.renderContext;n.bindParameters.oldLighting.copyFrom(n.bindParameters.lighting),n.bindParameters.newLighting.noonFactor=e,n.bindParameters.newLighting.globalFactor=i,n.bindParameters.newLighting.set(t),r===bO.Faded||n.bindParameters.weatherFading?n.bindParameters.fadeLighting(0):n.bindParameters.fadeLighting(1),this._context.requestRender()}}get _weatherUpdateParameters(){const t=this.weatherEnabled?this.view.environment.weather:null;return t==null?null:t.type==="rainy"||t.type==="snowy"?{type:t.type,weatherAdjustment:t.cloudCover,effect:t.precipitation}:{type:t.type,weatherAdjustment:t.type==="foggy"?t.fogStrength:t.cloudCover}}_updateWeatherFading(t,e){t.cloudsFade.updateFading(t.camera,this.view.state.mode,e,this.view.qualitySettings.fadeDuration),t.cloudsFade.updateParallax(t.camera),t.weatherFading&&(this._updateLighting(t),this._updateFogAtmoshpere(t))}_updateLighting(t){t.cloudsFade.fadeMode!==Vn.CROSS_FADE&&t.cloudsFade.fadeMode!==Vn.FADE_IN?t.fadeLighting(0):t.fadeLighting(t.cloudsFade.fadeFactor)}_updateFogAtmoshpere(t){t.cloudsFade.fadeMode!==Vn.CROSS_FADE&&t.cloudsFade.fadeMode!==Vn.FADE_IN?this._fadeWeather(0):this._fadeWeather(t.cloudsFade.fadeFactor)}_fadeWeather(t){const{_newWeatherParameters:e,_oldWeatherParameters:i}=this;t>=1?this._weatherParameters=e:(this._fadedWeatherParameters.lerp(i,e,t),this._weatherParameters=this._fadedWeatherParameters)}_updateWeather(){const t=this._weatherUpdateParameters;t!=null&&this._clouds!=null&&(this._clouds.applyPreset(cc[t.type],t.weatherAdjustment),this._setNeedsRender())}_setNeedsRender(){this._context!=null&&this._context.requestRender()}_updateFogHaze(){const t=this._weatherUpdateParameters;if(this._fog==null||t==null||this._context==null)return;const e=this._context.renderContext.bindParameters;switch(this._oldWeatherParameters.copyFrom(this._weatherParameters),t.type){case"foggy":this._newWeatherParameters.fog.strength=ui(3e-5,.005,t.weatherAdjustment**3),Ne(this._newWeatherParameters.fog.color,uge),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;case"rainy":this._newWeatherParameters.fog.strength=ui(4e-6,2e-4,(t.effect??0)**3),Ne(this._newWeatherParameters.fog.color,Uvt),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=0,this._setNeedsRender();break;case"snowy":this._newWeatherParameters.fog.strength=ui(4e-6,2e-4,(t.effect??0)**3),Ne(this._newWeatherParameters.fog.color,uge),this._newWeatherParameters.fog.amount=1,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender();break;default:this._newWeatherParameters.fog.strength=0,this._newWeatherParameters.fog.amount=0,this._newWeatherParameters.hazeAmount=1,this._setNeedsRender()}e.weatherFading?this._fadeWeather(0):this._fadeWeather(1)}_updateAtmosphere(t){const e=this._selectAtmosphereType(t);if(e!==pc.None&&this._context){if(!this._atmosphere||this._atmosphere.type!==e){this._atmosphere=et(this._atmosphere);const i=this._getAtmosphereClass(e);i&&(this._atmosphere=new i(this.view,this._context))}}else this._atmosphere=et(this._atmosphere);this._setNeedsRender()}_getAtmosphereClass(t){switch(t){case pc.Realistic:return Ime;case pc.Local:return mvt;case pc.Mars:return bvt;default:case pc.None:return null}}_selectAtmosphereType(t){const{enabled:e,viewingMode:i}=t;return!e||n1(this.view.spatialReference)?pc.None:i===_t.Local?pc.Local:this._context!=null&&Ime.isSupported(this._context)&&VO(this.view.spatialReference)?pc.Realistic:r1(this.view.spatialReference)?pc.Mars:pc.None}get test(){return{atmosphere:this._atmosphere,clouds:this._clouds,selectAtmosphereType:()=>this._selectAtmosphereType({viewingMode:this.view.state.viewingMode,enabled:this.view.environment.atmosphereEnabled}),stubGetAtmosphereClass:t=>{hge=aI.prototype._getAtmosphereClass,aI.prototype._getAtmosphereClass=t},restoreGetAtmosphereClass:()=>{aI.prototype._getAtmosphereClass=hge}}}};y([w({constructOnly:!0})],Fl.prototype,"view",void 0),y([w({readOnly:!0})],Fl.prototype,"atmosphere",null),y([w({readOnly:!0})],Fl.prototype,"_atmosphereType",null),y([w({type:Boolean,readOnly:!0})],Fl.prototype,"updating",null),y([w({readOnly:!0})],Fl.prototype,"weatherVisible",null),y([w()],Fl.prototype,"_context",void 0),y([w()],Fl.prototype,"_atmosphere",void 0),y([w({readOnly:!0})],Fl.prototype,"_stars",null),y([w({readOnly:!0})],Fl.prototype,"_precipitation",null),y([w({readOnly:!0})],Fl.prototype,"_clouds",null),y([w({readOnly:!0})],Fl.prototype,"_cloudsComposition",null),y([w({readOnly:!0})],Fl.prototype,"_fog",null),y([w({readOnly:!0})],Fl.prototype,"weatherEnabled",null),y([w({readOnly:!0})],Fl.prototype,"_precipitationEnabled",null),y([w({readOnly:!0})],Fl.prototype,"_weatherUpdateParameters",null),Fl=aI=y([Z("esri.views.3d.environment.EnvironmentRenderer")],Fl);let Aq=class{constructor(){this.fog=new R1t,this.hazeAmount=1}copyFrom(e){this.fog.amount=e.fog.amount,this.hazeAmount=e.hazeAmount,this.fog.strength=e.fog.strength,Ne(this.fog.color,e.fog.color)}lerp(e,i,r){this.fog.amount=ui(e.fog.amount,i.fog.amount,r),this.hazeAmount=ui(e.hazeAmount,i.hazeAmount,r),this.fog.strength=ui(e.fog.strength,i.fog.strength,r),Qr(this.fog.color,e.fog.color,i.fog.color,r)}};const Uvt=nt(.5,.5,.5),uge=nt(1.5,1.5,1.5);let hge;var dge,pge,fge,Dte={exports:{}};Dte.exports,dge=Dte,pge=function(){var t=Math.PI,e=Math.sin,i=Math.cos,r=Math.tan,n=Math.asin,s=Math.atan2,o=Math.acos,l=t/180,c=864e5,f=2440588,_=2451545,x={dec:0,ra:0};function T(te){return te.valueOf()/c-.5+f}function A(te){return new Date((te+.5-f)*c)}function M(te){return T(te)-_}var I=23.4397*l;function L(te,le){return s(e(te)*i(I)-r(le)*e(I),i(te))}function F(te,le){return n(e(le)*i(I)+i(le)*e(I)*e(te))}function z(te,le,de){return s(e(te),i(te)*e(le)-r(de)*i(le))}function k(te,le,de){return n(e(le)*e(de)+i(le)*i(de)*i(te))}function U(te,le){return l*(280.16+360.9856235*te)-le}function j(te){return l*(357.5291+.98560028*te)}function H(te){return l*(1.9148*e(te)+.02*e(2*te)+3e-4*e(3*te))}function Y(te,le){return te+le+102.9372*l+t}function Q(te,le){var de=j(te),ve=Y(de,H(de));return le||(le={dec:0,ra:0}),le.dec=F(ve,0),le.ra=L(ve,0),le}var ne={PolarException:{NORMAL:0,MIDNIGHT_SUN:1,POLAR_NIGHT:2},getPosition:function(te,le,de,ve){var Se=l*-de,Ae=l*le,Pe=M(te),Ge=Q(Pe,x),ut=U(Pe,Se)-Ge.ra;return ve||(ve={azimuth:0,altitude:0}),ve.azimuth=z(ut,Ae,Ge.dec),ve.altitude=k(ut,Ae,Ge.dec),ve}},re=[[-.83,"sunrise","sunset"]];ne.addTime=function(te,le,de){re.push([te,le,de])};var he=9e-4;function ce(te,le){return Math.round(te-he-le/(2*t))}function be(te,le,de){return he+(te+le)/(2*t)+de}function ye(te,le,de){return _+te+.0053*e(le)-.0069*e(2*de)}function pe(te,le,de){return o((e(te)-e(le)*e(de))/(i(le)*i(de)))}function Ee(te){var le=l*(134.963+13.064993*te),de=l*(93.272+13.22935*te),ve=l*(218.316+13.176396*te)+6.289*l*e(le),Se=5.128*l*e(de),Ae=385001-20905*i(le);return{ra:L(ve,Se),dec:F(ve,Se),dist:Ae}}return ne.getTimes=function(te,le,de){var ve=l*-de,Se=l*le,Ae=ce(M(te),ve),Pe=be(0,ve,Ae),Ge=j(Pe),ut=H(Ge),Ft=Y(Ge,ut),Qt=F(Ft,0),At=ye(Pe,Ge,Ft);function ri(Tt){return ye(be(pe(Tt,Se,Qt),ve,Ae),Ge,Ft)}function Rt(Tt){var ie=(e(Tt)-e(Se)*e(Qt))/(i(Se)*i(Qt));return ie<-1?ne.PolarException.MIDNIGHT_SUN:ie>1?ne.PolarException.POLAR_NIGHT:ne.PolarException.NORMAL}var dt,pt,oi,ht,Et,Dt={solarNoon:A(At),nadir:A(At-.5),polarException:ne.PolarException.NORMAL};for(dt=0,pt=re.length;dtI)Qo(L,Pq),Ne(F,Mq),Ne(z,Oq),k="night";else if(r0&&(mge(F,U),mge(z,U));const j=FLe(i);return{direct:{intensity:L[0]*j.direct,color:F},ambient:{intensity:L[1]*j.ambient,color:z},timeOfDay:k}}const Ege=new Date(0),Cge=Qe(),Rq=W(),Iq=W(),Xvt=W(),$q=.25,Zvt=.2;let N0=class extends Dn.EventedAccessor{constructor(){super(),this._referencePointUpdateDelay=200,this._referencePointUpdateInterval=3e3,this._referencePointUpdateDistThreshold=1e6,this._referencePosUpdateQuery=null,this._referencePosMapCoordsRequested=null,this._viewHandlesKey="viewHandles",this._preserveAbsoluteDateTime=!1,this._trackingEnabled=!1,this._referencePosResetPreserveAbsoluteTime=!1,this._referencePosUpdateTimer=null,this._referencePosMapCoords=null,this._mainLight=new wU,this._ambientLight=new Mae,this._moonLight=new z$e,this.disableQueries=!1,this._disableWeather=!1,this._renderer=null,this._referencePosWGS84Comparable=null,this._resetReferencePosition()}destroy(){this.disconnectView()}get _view(){var e;return(e=this._renderer)==null?void 0:e.view}get updating(){var e;return!((this.disableQueries||!this._referencePosUpdateQuery&&!this._referencePosMapCoordsRequested)&&!((e=this._renderer)!=null&&e.updating))}get weatherEnabled(){var e,i,r;return((e=this._view)==null?void 0:e.environment.atmosphereEnabled)&&!this._disableWeather&&((r=(i=this._view)==null?void 0:i.state)==null?void 0:r.viewingMode)===_t.Global&&VO(this._view.spatialReference)}get weatherVisible(){var e;return this.weatherEnabled&&((e=this._renderer)==null?void 0:e.weatherVisible)}get referencePositionWGS84Comparable(){return this._referencePosWGS84Comparable}connectView(e){if(this._renderer)return;this._renderer=new Fl({view:e});const i=()=>this._updateRenderParameters(),r=()=>this._cameraHandler();this.addHandles([_e(()=>e.environment.lighting,n=>this._updateLightingHandler(n),Li),_e(()=>e.environment.lighting.type!=="virtual"?e.environment.lighting.date:null,n=>this._lightingDateHandler(n),Li),_e(()=>e.stationary,()=>this._interactingStationaryHandler()),_e(()=>e.environment.lighting.directShadowsEnabled,i,Li),_e(()=>e.qualitySettings.ambientOcclusion,i,Li),_e(()=>e.qualitySettings.reflections,i,Li),_e(()=>e.spatialReference,()=>this._resetReferencePosition(!0),Li),_e(()=>e.environment.weather.type,()=>this._updateLighting(null,bO.Faded),Li),_e(()=>this.weatherEnabled,()=>this._updateLighting(null,bO.Faded),Li),_e(()=>e.viewingMode,()=>this._resetReferencePosition(!0),kt),_e(()=>e.environment.lighting.type!=="virtual"&&e.environment.lighting.cameraTrackingEnabled,n=>this._updateCameraTracking(n),kt),_e(()=>e.state.camera,r,kt),_e(()=>this.disableQueries,r)],this._viewHandlesKey),this._updateRenderParameters(),this._updateLighting(),this._cameraHandler(),this.notifyChange("updating")}disconnectView(){this.removeHandles(this._viewHandlesKey),this._resetReferencePosition(),this._renderer=et(this._renderer)}_updateLightingHandler(e){this._updateCameraTracking(e.type!=="virtual"&&e.cameraTrackingEnabled),this._lightingDateHandler(e.type!=="virtual"?e.date:null),this._updateRenderParameters()}_updateCameraTracking(e){if(this._trackingEnabled=e,e)this._cameraHandler();else{const i=this._view.environment.lighting;(i==null?void 0:i.type)!=="virtual"&&(i.positionTimezoneInfo.autoUpdated=!1)}}_lightingDateHandler(e){const i=this._view.environment.lighting;if((i==null?void 0:i.type)!=="virtual"){if(e){if(!i.positionTimezoneInfo.autoUpdated){this._preserveAbsoluteDateTime=!0;const r=this._view.spatialReference;if(!D2(r)){const n=this._view.camera.position;if(!this._referencePosMapCoords||!this._referencePosMapCoords.equals(n))return void this._requestReferencePositionUpdate(n)}if(this._preupdateTracking(e),this._referencePosWGS84Comparable!=null){const n=bee(this._referencePosWGS84Comparable,Age);n!=null&&(i.autoUpdate(null,n),this._trackingEnabled&&(i.positionTimezoneInfo.autoUpdated=!0))}}this._updateLighting(e)}}else this._updateLighting()}_preupdateTracking(e){!this._trackingEnabled&&this._view.environment.lighting.type!=="virtual"&&this._view.environment.lighting.cameraTrackingEnabled&&this._cameraHandler(e)}_cameraHandler(e=null){const i=this._view;if(!i.ready)return;const r=i.stateManager.camera;r&&(this._cameraHandlerClientSide(r,e)||this._cameraHandlerServerSide(r))}_cameraHandlerClientSide(e,i){const r=VO(this._view.spatialReference);if(r&&!D2(this._view.spatialReference))return this._view.environment.lighting.type==="virtual"&&this._updateLighting(),!1;const n=e.position;return this._referencePosWGS84Comparable==null&&(this._referencePosWGS84Comparable=W()),r?Fmt(n,this._referencePosWGS84Comparable):Ie(this._referencePosWGS84Comparable,n.longitude??0,n.latitude??0,n.z??0),this.notifyChange("referencePositionWGS84Comparable"),this._autoUpdateTimezone(this._referencePosWGS84Comparable,i)||this._updateLighting(i),!0}_cameraHandlerServerSide(e){const i=e.position;(!this._referencePosMapCoords||this._referencePosMapCoordsRequested||this._exceedsReferencePosDistThreshold(i))&&this._requestReferencePositionUpdate(i,!0),this._view.mapCoordsHelper&&this._referencePosWGS84Comparable&&(this._referencePosWGS84Comparable[2]=(i.z??0)*this._view.mapCoordsHelper.unitInMeters,this._referencePosChanged())}_interactingStationaryHandler(){this._view.stationary&&this._executePendingReferencePositionUpdate()}_updateLighting(e,i=bO.Immediate){const r=this._view;e=e||(r.environment.lighting.type==="virtual"?null:r.environment.lighting.date);const n=this._referencePosWGS84Comparable,s=n!=null?Jvt:Kvt,o=this.weatherVisible?r.environment.weather.type:"disabled";n!=null?Vvt(e,n,r.state.viewingMode,o,r.state.camera,s):r.environment.lighting.type==="virtual"&&LLe(r.state.camera,r.state.viewingMode,s.direct.directionToLightSource);const l=this._mainLight,c=s.direct;De(l.intensity,c.color,c.intensity*Math.PI),Ne(l.direction,c.directionToLightSource),l.specularStrength=s.specularStrength,l.environmentStrength=s.environmentStrength;const f=this._ambientLight;De(f.intensity,s.ambient.color,s.ambient.intensity);const _=this._moonLight;Qr(_.intensity,e_t,t_t,s.globalFactor);const x=(1-.5*s.globalFactor)*(1-.4*s.noonFactor*(1-s.globalFactor));De(_.intensity,_.intensity,x),Ne(_.direction,c.directionToLightSource),this._renderer.updateLightSources([l,f,_],s.noonFactor,s.globalFactor,i),this._updateRenderParameters()}_autoUpdateTimezone(e,i=null){if(this._view.environment.lighting.type==="virtual"||!this._view.environment.lighting.cameraTrackingEnabled||e==null)return!1;const r=Qvt;r.setTime((i||this._view.environment.lighting.date).getTime());const n=bee(e,Age);if(n==null)return!1;let s=this._view.environment.lighting.positionTimezoneInfo;if(s.autoUpdated){if(s.hours===n.hours&&s.minutes===n.minutes&&s.seconds===n.seconds)return!1}else s=n;const o=r.getUTCHours()-(n.hours-s.hours),l=r.getUTCMinutes()-(n.minutes-s.minutes),c=r.getUTCSeconds()-(n.seconds-s.seconds);return r.setUTCHours(o),r.setUTCMinutes(l),r.setUTCSeconds(c),!i&&this._view.environment.lighting.autoUpdate(r,n)}_updateRenderParameters(){const e=this._view._stage;if(!e)return;const i=this._referencePosWGS84Comparable==null||Bvt(this._referencePosWGS84Comparable[2],this._view.state.viewingMode);e.renderer.setParameters({shadowMap:this._view.environment.lighting.directShadowsEnabled&&i,environment:this._view.environment,weatherVisible:this._view.environmentManager.weatherVisible,qualitySettings:this._view.qualitySettings})}_resetReferencePosition(e=!1){this._cancelReferencePosUpdates(),this._referencePosMapCoords=null,this._referencePosMapCoordsRequested=null,this._referencePosResetPreserveAbsoluteTime=null,this._referencePosWGS84Comparable=null,this.notifyChange("updating"),e&&this._cameraHandler()}_requestReferencePositionUpdate(e,i=!1){if(!this.disableQueries&&(this._referencePosMapCoordsRequested?this._referencePosMapCoordsRequested.copy(e):this._referencePosMapCoordsRequested=e.clone(),this._referencePosResetPreserveAbsoluteTime=!!i,!this._referencePosUpdateQuery&&!this._referencePosUpdateTimer&&this._view.stationary)){const r=this._referencePosUpdateQuery=T2(this._referencePointUpdateDelay).then(()=>{if(this._referencePosUpdateQuery===r){const s=()=>this._referencePosUpdateQuery!==r;return this._doReferencePositionUpdateQuery(s)}}).catch(s=>{s.name==="mapcoordshelper:missing-geometry-service"&&(this.disableQueries=!0)}).then(()=>{this._referencePosUpdateQuery===r&&(this._referencePosUpdateQuery=null,this._referencePosUpdateTimer||this._executePendingReferencePositionUpdate(),this.notifyChange("updating"))}),n=this._referencePosUpdateTimer=T2(this._referencePointUpdateInterval).then(()=>{this._referencePosUpdateTimer===n&&(this._referencePosUpdateTimer=null,this._referencePosUpdateQuery||this._executePendingReferencePositionUpdate())});this.notifyChange("updating")}}async _doReferencePositionUpdateQuery(e){this._referencePosResetPreserveAbsoluteTime&&(this._preserveAbsoluteDateTime=!1),this._referencePosMapCoords?this._referencePosMapCoords.copy(this._referencePosMapCoordsRequested):this._referencePosMapCoords=this._referencePosMapCoordsRequested.clone(),this._referencePosResetPreserveAbsoluteTime=null,this._referencePosMapCoordsRequested=null;const i=await this._view.mapCoordsHelper.toGeographic(this._referencePosMapCoords);if(!e()&&!isNaN(i[0])&&!isNaN(i[1])){const r=(this._referencePosMapCoords.z??0)*this._view.mapCoordsHelper.unitInMeters;this._referencePosWGS84Comparable?(this._referencePosWGS84Comparable[0]=i[0],this._referencePosWGS84Comparable[1]=i[1],this._referencePosWGS84Comparable[2]=r):this._referencePosWGS84Comparable=[i[0],i[1],r],this._referencePosChanged()}}_executePendingReferencePositionUpdate(){const e=this._referencePosMapCoordsRequested;e&&this._requestReferencePositionUpdate(e,this._referencePosResetPreserveAbsoluteTime)}_referencePosChanged(){this._preserveAbsoluteDateTime?this._updateLighting():this._autoUpdateTimezone(this._referencePosWGS84Comparable)||this._updateLighting(),this.notifyChange("referencePositionWGS84Comparable")}_exceedsReferencePosDistThreshold(e){if(this._referencePosMapCoords){let i=this._referencePosMapCoords.distance(e);return this._view.mapCoordsHelper&&(i*=this._view.mapCoordsHelper.unitInMeters),i>this._referencePointUpdateDistThreshold}return!0}_cancelReferencePosUpdates(){const e=!!this._referencePosUpdateQuery;return this._referencePosUpdateQuery=null,this._referencePosUpdateTimer=null,e}get test(){const e=this;return{get renderer(){return e._renderer},set referencePointUpdateInterval(i){e._referencePointUpdateInterval=i},set referencePointUpdateDistThreshold(i){e._referencePointUpdateDistThreshold=i},set referencePosUpdateTimer(i){e._referencePosUpdateTimer=i},set referencePointUpdateDelay(i){e._referencePointUpdateDelay=i},set disableWeather(i){e._disableWeather=i}}}};y([w({type:Boolean,readOnly:!0})],N0.prototype,"updating",null),y([w()],N0.prototype,"disableQueries",void 0),y([w()],N0.prototype,"_disableWeather",void 0),y([w()],N0.prototype,"weatherEnabled",null),y([w()],N0.prototype,"weatherVisible",null),y([w()],N0.prototype,"referencePositionWGS84Comparable",null),y([w()],N0.prototype,"_renderer",void 0),y([w()],N0.prototype,"_referencePosWGS84Comparable",void 0),N0=y([Z("esri.views.3d.environment.SceneViewEnvironmentManager")],N0);const Jvt=new NLe,Kvt=new NLe,Qvt=new Date,Age={hours:0,minutes:0,seconds:0},e_t=nt(.22,.22,.33),t_t=nt(.22,.22,.22);var Yn;(function(t){t[t.NONE=0]="NONE",t[t.TILT=1]="TILT",t[t.ALTITUDE=2]="ALTITUDE",t[t.DISTANCE=4]="DISTANCE",t[t.COLLISION=8]="COLLISION",t[t.ALL=15]="ALL",t[t.ALL_EXCEPT_COLLISION=7]="ALL_EXCEPT_COLLISION"})(Yn||(Yn={}));var Ki;(function(t){t[t.NONE=0]="NONE",t[t.ZOOM=1]="ZOOM",t[t.TUMBLE=2]="TUMBLE",t[t.LOOK_AROUND=3]="LOOK_AROUND",t[t.PAN=4]="PAN",t[t.ASCEND=5]="ASCEND"})(Ki||(Ki={}));var il;(function(t){t[t.TUMBLE=0]="TUMBLE",t[t.LOOK_AROUND=1]="LOOK_AROUND"})(il||(il={}));function RL(t,e){return(t&e)!=0}function AU(t,e,i,r,n,s){t!==0&&(i?(s.min=Math.min(s.min,e),s.max=Math.max(s.max,e)):r!=null?(s.min-=Math.max(0,(e-s.min)*(1-r)),s.max+=Math.max(0,(e-s.max)*(1-r))):n&&(s.min-=Math.max(0,e-s.min-n),s.max+=Math.max(0,e-s.max-n)))}const H2={selection:Yn.NONE,interactionType:Ki.NONE,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:il.TUMBLE};function kLe(t,e,i,r){return e=e||t.viewForward,Ne(r,e),De(r,r,Math.sign(Ve(e,i))),r}function i_t(t,e,i,r){return a_t(t,e,i,s_t(r,e,i,!0))}function r_t(t,e,i,r){const n=Ve(i,je(t,r,e));return Be(t,e,De(t,i,n))}const n_t={dir:W(),len:0,clip:yt()};function s_t(t,e,i,r){const n=n_t;return t?(i&&r&&(n.len=Sn(e,i)),Ne(n.dir,t)):r?(n.len=Sn(e,i),je(n.dir,i,e),De(n.dir,n.dir,1/n.len)):(je(n.dir,i,e),Ye(n.dir,n.dir)),n}function o_t(t,e,i){const r=Ve(t,i.dir),n=-fn(t,e);if(n<0&&r>=0)return!1;if(r>-1e-6&&r<1e-6)return n>0;if((n<0||r<0)&&!(n<0&&r<0))return!0;const s=n/r;return r>0?si.clip[0]&&(i.clip[0]=s),i.clip[0]<=i.clip[1]}function a_t(t,e,i,r){r.clip[0]=0,r.clip[1]=i?r.len:Number.MAX_VALUE;for(let n=0;n=-1e-6?0:s}function y_t(t,e,i=H2){const r=jae(t,e,i);if(r===0)return!1;const n=t.pointsOfInterest.surfaceOrigin;if(!n.renderLocation)return!1;const s=Gae(t,e)+r,o=Ne(b_t,e.eye),l=kLe(e,i.interactionDirection,__t(e,n.renderLocation,S_t),x_t);if(!lx(Noe(n.renderLocation,s),Sp(e.eye,l),tN))return!1;e.eye=tN;const c=je(w_t,e.eye,o);e.center=Be(tN,e.center,c);const f=t.renderCoordsHelper.getAltitude(e.center),_=t.renderCoordsHelper.intersectInfiniteManifold(e.ray,f,tN);return _!=null&&(e.center=_),!0}function v_t(t,e,i){const r=e.interactionType;if(r===Ki.NONE)return;const{min:n,max:s}=i,{interactionStartCamera:o,interactionFactor:l}=e;if(!o)return;const c=r===Ki.ZOOM||r===Ki.PAN,f=jae(t,o),_=f===0?0:Gae(t,o);i.min=n,i.max=s,AU(f,_,c,l,.05*_,i)}function Gae(t,e){const i=t.pointsOfInterest.surfaceOrigin;return i.renderLocation?Sn(e.eye,i.renderLocation):0}function __t(t,e,i){return R_(i,t.eye,e)}const eN={min:0,max:0},b_t=W(),w_t=W(),x_t=W(),S_t=W(),tN=W();function xP(t,e,i=Cf.EYE){const r=t.state.constraints;if(!r.collision.enabled)return!1;const n=wj(t,e.eye),s=t.renderCoordsHelper.getAltitude(e.eye),o=n+r.collision.elevationMargin;if(s>=o)return!1;const l=rt(e.eye);if(je(iN,e.center,e.eye),e.eye=t.renderCoordsHelper.setAltitude(T_t,o,e.eye),i===Cf.EYE_AND_CENTER)e.center=Be(iN,e.eye,iN);else if(i===Cf.EYE_AND_CENTER_SCALE){const c=(l-s+o)/l;e.center=De(iN,e.center,c)}return!0}var Cf;(function(t){t[t.EYE=0]="EYE",t[t.EYE_AND_CENTER=1]="EYE_AND_CENTER",t[t.EYE_AND_CENTER_SCALE=2]="EYE_AND_CENTER_SCALE"})(Cf||(Cf={}));const iN=W(),T_t=W();function q2(t,e,i){t.worldUpAtPosition(e,Mge),je(Dq,i,e);const r=rt(Dq);return r===0?0:Ca(Ve(Dq,Mge)/r)}const Mge=W(),Dq=W();function zLe(t,e,i=H2,r=!0){aR.eyeCenterDistance=0,aR.requiresTwoSteps=!1;const n=Hae(t,e,i,void 0,aR);if(n===0)return!1;switch(xp(rN,-n,e.viewRight),i.tiltMode){case il.LOOK_AROUND:bt(fb,e.viewForward,rN),De(fb,fb,aR.eyeCenterDistance),e.center=Be(Hw,e.eye,fb);break;case il.TUMBLE:je(fb,e.center,e.eye),bt(fb,fb,rN),e.eye=je(Hw,e.center,fb);break;default:i.tiltMode}return e.up=bt(Hw,e.up,rN),!aR.requiresTwoSteps||!r||zLe(t,e,i,!1)}function Hae(t,e,i=H2,r=H2,n){if(!t.state.constraints.tilt)return 0;const s=e.distance,o=t.state.constraints.tilt(s,L_t);return $_t(t,i,o),r.interactionType===Ki.TUMBLE&&RL(r.selection,Yn.ALTITUDE)&&ULe(t,r.interactionStartCamera,o),i.tiltMode===il.LOOK_AROUND||r.tiltMode===il.LOOK_AROUND?C_t(t,e,o,n):E_t(t,e,o)}function E_t(t,e,i){const r=q2(t.renderCoordsHelper,e.center,e.eye),n=r-Je(r,i.min,i.max);return IL(n)?n:0}function C_t(t,e,i,r){switch(r&&(r.requiresTwoSteps=!1),t.viewingMode){case"global":return M_t(t,e,i,r);case"local":return A_t(t,e,i,r)}}function A_t(t,e,i,r){const n=q2(t.renderCoordsHelper,e.center,e.eye),s=Je(n,i.min,i.max),o=n-s;if(!IL(o))return 0;if(r){const l=t.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,c=t.renderCoordsHelper.getAltitude(e.eye)-l,f=Math.cos(s);Math.abs(f)>1e-4?r.eyeCenterDistance=c/f:r.eyeCenterDistance=e.distance}return o}function M_t(t,e,i,r){const n=O_t(t,e,D_t),s=Je(n.tiltAtCenter,i.min,i.max);if(!IL(n.tiltAtCenter-s))return 0;let o,l;return n.centerIsOnSurface?(o=P_t(n),l=R_t(n,o)):(o=n.constraints.clampTilt(n.eyeCenterDistance,n.tiltAtCenter),r&&o1e-9}function P_t(t){const{constraints:e,eyeCenterDistance:i,tiltAtCenter:r}=t;let n=r,s=e.clampTilt(i,r);const o=Bte(t,s);if(e.clampTilt(o,r)===s)return s;let l=0;for(;l<10&&IL(s-n);){const c=(n+s)/2,f=Bte(t,c);IL(e.clampTilt(f,c)-c)?n=c:s=c,l++}return s}function Bte(t,e){if(!t.centerIsOnSurface)return t.eyeCenterDistance;const i=Math.PI-Je(e,0,Math.PI),r=Gf(t.radius/t.eyeRadius*Math.sin(i)),n=Math.PI-i-r,s=Math.sin(n)/Math.sin(i);if(t.eyeRadius1){const o=Math.PI-r,l=Math.PI-i-o;return Math.sin(l)/Math.sin(i)*t.eyeRadius}return s*t.eyeRadius}function R_t(t,e){const i=Gf(t.radius/t.eyeRadius*Math.sin(t.tiltAtCenter)),r=Gf(t.radius/t.eyeRadius*Math.sin(e));return t.eyeRadius>t.radius?i-r:r-i}function I_t(t,e){return t.tiltAtCenter-Math.PI/2-(e-Math.PI/2)}function $_t(t,e,i){if(e.interactionType===Ki.NONE)return;const{interactionStartCamera:r,interactionFactor:n}=e;if(!r)return;const{min:s,max:o}=i,l=Hae(t,r,H2,e),c=l===0?0:q2(t.renderCoordsHelper,r.center,r.eye);i.min=s,i.max=o,e.interactionType===Ki.TUMBLE?(RL(e.selection,Yn.ALTITUDE)&&ULe(t,r,i),AU(l,c,!0,n,Oge,i)):AU(l,c,!1,n,Oge,i)}function ULe(t,e,i){const r=t.state.constraints;if(t.state.isLocal||!r.altitude||!e)return;const n=El(e.center),s=Math.sqrt(n),o=e.distance,l=Sr(t.spatialReference).radius,c=r.altitude.min+l,f=r.altitude.max+l,_=(c*c-o*o-n)/(-2*s*o),x=(f*f-o*o-n)/(-2*s*o);i.min=Math.max(i.min,Math.min(Math.PI-Ca(x),i.max)),i.max=Math.min(i.max,Math.PI-Ca(_))}const fb=W(),rN=Qe(),Hw=W(),Oge=Ei(5),L_t={min:0,max:0},D_t={constraints:null,radius:0,eyeRadius:0,centerIsOnSurface:!0,eyeCenterDistance:0,tiltAtCenter:0},aR={eyeCenterDistance:0,requiresTwoSteps:!1},N_t=t=>t,jj=t=>t*t,qae=t=>1-jj(1-t),F_t=t=>t<.5?jj(2*t)/2:(qae(2*(t-.5))+1)/2,Wae=t=>t*t*t,VLe=t=>1-Wae(1-t),BLe=t=>t<.5?Wae(2*t)/2:(VLe(2*(t-.5))+1)/2,Yae=t=>t*t*t*t,jLe=t=>1-Yae(1-t),k_t=t=>t<.5?Yae(2*t)/2:(jLe(2*(t-.5))+1)/2,Xae=t=>t*t*t*t*t,GLe=t=>1-Xae(1-t),z_t=t=>t<.5?Xae(2*t)/2:(GLe(2*(t-.5))+1)/2,Zae=t=>1-Math.cos(t*Math.PI/2),HLe=t=>1-Zae(1-t),U_t=t=>t<.5?Zae(2*t)/2:(HLe(2*(t-.5))+1)/2,Jae=t=>2**(10*(t-1)),J9=t=>1-Jae(1-t),V_t=t=>t<.5?Jae(2*t)/2:(J9(2*(t-.5))+1)/2,Kae=t=>-(Math.sqrt(1-t*t)-1),qLe=t=>1-Kae(1-t),B_t=t=>t<.5?Kae(2*t)/2:(qLe(2*(t-.5))+1)/2;function a0(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return r=>ri=Math.PI&&(r=2*Math.PI-r);const n=Math.abs(e.pitch-this.pitch);return i.rotate=Math.max(r,n),i.sourceZoom=this.distance,i.targetZoom=e.distance,i}interpolate(e,i,r){this.viewingMode===_t.Global?Out(e.center,i.center,r.pan,this.center):Qr(this.center,e.center,i.center,r.pan),this.distance=isFinite(i.distance)?ui(e.distance,i.distance,r.zoom):e.distance,this.pitch=ui(e.pitch,i.pitch,r.rotate);let n=e.yaw;const s=i.yaw;Math.abs(s-n)>=Math.PI&&(n+=2*(n0&&De(r,r,-1)):Ne(r,e),Wt(oh,r,bd.upward),Ye(oh,oh),uF(bd.sideway,oh,bd.upward)}};const MU={desiredScreenFlow:2,minDuration:500,maxDuration:8e3};let abt=class YLe{constructor(e){this._createCamera=e,this.compared={sourceZoom:0,targetZoom:0,pan:0,rotate:0},this.settings={desiredScreenFlow:MU.desiredScreenFlow},this.source=e(),this.target=e()}clone(){const e=new YLe(this._createCamera);return e.copyFrom(this),e}copyFrom(e){this.update(e.source,e.target,e.settings)}update(e,i,r){this.source!==e&&this.source.copyFrom(e),this.target!==i&&this.target.copyFrom(i),this.compared=this.source.compareTo(this.target,this.compared),this.settings.desiredScreenFlow=r.desiredScreenFlow!=null?r.desiredScreenFlow:MU.desiredScreenFlow,this.desiredPixelFlow=this.settings.desiredScreenFlow*this.target.size,this.halfWindowSize=this.target.size/2}halfWindowPanAtZoom(e){const i=this.target.pixelsPerPanAtZoom(e);return this.halfWindowSize/i}get hasZoom(){return Math.abs(this.compared.sourceZoom-this.compared.targetZoom)>1e-5}get hasPan(){return this.compared.pan>1e-9}get hasRotate(){return this.compared.rotate>1e-9}},lbt=class{constructor(){this.segments=[]}get time(){return this.segments.reduce((e,i)=>e+i.time,0)}interpolateComponentsAt(e,i){e=Math.min(Math.max(e,0),1),e*=this.time;let r=0,n=0;const s=this.definition;for(let o=0;on?1:-1,this._panPixelsAtSource=i.pan*e.source.pixelsPerPanAtZoom(r);const s=(e.source.pixelsPerRotateAtZoom(r)+e.target.pixelsPerRotateAtZoom(n))/2;this._rotatePixels=i.rotate*s}_updatePixelFlow(){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom,{hasZoom:r,hasPan:n,hasRotate:s}=this.definition;let o=0,l=0;r&&(n&&(o=(i/e-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(l=this._zoomSign*(Math.log(e/i)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const c=this.definition.desiredPixelFlow;if(r&&n&&s){const f=o+l+o*l;this._zoomPixelFlow=o*l/f*c,this._panPixelFlow=l/f*c,this._rotatePixelFlow=o/f*c}else if(r&&n){const f=1+o;this._zoomPixelFlow=o/f*c,this._panPixelFlow=1/f*c}else if(r&&s){const f=1+l;this._zoomPixelFlow=l/f*c,this._rotatePixelFlow=1/f*c}else if(n&&s){const f=this._panPixelsAtSource/this._rotatePixels,_=1+f;this._panPixelFlow=f/_*c,this._rotatePixelFlow=1/_*c}else n?this._panPixelFlow=c:r?this._zoomPixelFlow=c:s&&(this._rotatePixelFlow=c);this._time=s?this.rotateTime:r?this.zoomTime:n?this.panTime:0}get rotateTime(){return this.definition.hasRotate?this._rotatePixels/this._rotatePixelFlow:0}get zoomTime(){return this.definition.hasZoom?this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow:0}get panTime(){if(this.definition.hasPan){if(this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,i=e*this._panPixelsAtSource;return Math.log(i*(this._zoomPixelFlow/this._panPixelFlow)+1)/(e*this._zoomPixelFlow)}return this._panPixelsAtSource/this._panPixelFlow}return 0}_interpolateComponentsZoom(e){if(e===0||e===1)return e;if(this.definition.hasZoom){const i=this.definition.compared.sourceZoom,r=this.definition.compared.targetZoom;return(i*(i/r)**-e-i)/(r-i)}return e}_interpolateComponentsPan(e){if(e===0||e===1)return e;if(this.definition.hasPan&&this.definition.hasZoom){const i=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(i*e*this._time)-1))/(i*Math.LN2)}return e}_interpolateComponentsRotate(e){return e}interpolateComponentsAt(e,i){e=Math.min(Math.max(e,0),1);const r=this._interpolateComponentsZoom(e),n=this._interpolateComponentsPan(e),s=this._interpolateComponentsRotate(e);return i?(i.zoom=r,i.pan=n,i.rotate=s):i={zoom:r,pan:n,rotate:s},i}};function cbt(t,e,i){const r=e-t.compared.sourceZoom,n=t.halfWindowPanAtZoom(r);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+n)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*n)}function ubt(t,e,i){const r=1/e,n=Math.log(t.compared.sourceZoom*r),s=1/t.desiredPixelFlow,o=1/Math.LN2,l=e-t.compared.sourceZoom,c=1/l,f=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(l))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*r*s*o*c*f-t.halfWindowSize*n*s*o*c+t.halfWindowSize*n*s*o*f/(l*l)}function hbt(t,e,i){const r=e-t.compared.sourceZoom,n=1/r,s=1/e,o=Math.log(t.compared.sourceZoom*s),l=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(r))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*(-2*n*s*l+2*n*o+2*s-2*o*l/(r*r)-l/(e*e))/(t.desiredPixelFlow*Math.LN2)}function dbt(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function pbt(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function fbt(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mbt(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function gbt(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function ybt(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function vbt(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function _bt(t,e,i){const r=Math.log(e/t.compared.targetZoom),n=1/t.desiredPixelFlow,s=1/Math.LN2,o=-e+t.compared.targetZoom,l=1/o,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*r*n*s*l+t.halfWindowSize*r*n*s*c/(o*o)+t.halfWindowSize*n*s*l*c/e}function bbt(t,e,i){const r=e-t.compared.targetZoom,n=1/r,s=1/e,o=Math.log(e/t.compared.targetZoom),l=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*(-2*n*s*l-2*n*o+2*s+2*o*l/(r*r)-l/(e*e))/(t.desiredPixelFlow*Math.LN2)}function wbt(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function xbt(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function Sbt(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function Tbt(t){const e=Math.LN2*t.compared.pan,i=t.compared.sourceZoom-t.compared.targetZoom,r=t.halfWindowPanAtZoom(i),n=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*r);return t.compared.sourceZoom<=t.compared.targetZoom?n*(e-r):n*(e+r)}function Ebt(t,e){let i=Cbt(t,e);const r={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},n=r.ascensionFactor===0,s=r.descensionFactor===0,o=n?dbt:cbt,l=n?pbt:ubt,c=n?fbt:hbt,f=s?wbt:vbt,_=s?xbt:_bt,x=s?Sbt:bbt,T=U=>o(t,U,r)+mbt(t,U,r)+f(t,U,r),A=U=>l(t,U,r)+gbt(t,U,r)+_(t,U,r),M=U=>c(t,U,r)+ybt(t,U,r)+x(t,U,r);let I=T(i);const L=Tbt(t);let F;const z=e.maximumIterations||20,k=e.maximumDistance!=null?e.maximumDistance:1/0;for(F=0;F=k&&j<0){if(!isFinite(k))return null;i=k,I=T(i);break}if(i-=j,iL*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=e,n.definition.compared.targetZoom=e,n.definition.compared.pan=this.definition.compared.pan*c,n.definition.compared.rotate=this.definition.compared.rotate*c,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=e,s.definition.compared.pan=this.definition.compared.pan*l,s.definition.compared.rotate=this.definition.compared.rotate*l,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[e]=this._preallocSegments;e.update(this.definition),this.segments.push(e)}};const Mbt={zoom:0,pan:0,rotate:0};let Obt=class{get time(){return this._time}constructor(e){this._createCamera=e,this._time=0,this.definition=new abt(e),this.path=new Abt}update(e,i,r){this.definition.update(e,i,r),this.path.update(this.definition,r),this._time=this._applyTimeSettings(fSe(isFinite(this.path.time)?this.path.time:0),r),this._easing=r.easing??(this._time>=1e3?WLe:J9)}cameraAt(e,i){i=i||this._createCamera(),e=Math.min(Math.max(0,e),1),e=this._normalizedEasing(e);const r=this.path.interpolateComponentsAt(e,Mbt);return i.interpolate(this.definition.source,this.definition.target,r),i}_normalizedEasing(e){const i=this._easing(0,this._time),r=this._easing(1,this._time);return(this._easing(e,this._time)-i)/(r-i)}_applyTimeSettings(e,i){const r=i.speedFactor!=null?i.speedFactor:1;i.duration!=null?e=i.duration:i.speedFactor!=null&&(e=e/r);const n=i.minDuration!=null?i.minDuration:MU.minDuration/r,s=i.maxDuration!=null?i.maxDuration:MU.maxDuration/r;return Math.min(Math.max(n,e),s)}};const Pbt=W();let Rbt=class{get finished(){return this.currentTime>=this._animation.time}get time(){return this._animation.time}constructor(e){this.currentTime=0,this._animation=new Obt(()=>new Rge(e)),this._current=new Rge(e)}update(e,i,r){const n=this._animation.definition.source,s=this._animation.definition.target,o=je(Pbt,i.center,e.center),l=rt(o);l>=1e-5?(o[0]/=l,o[1]/=l,o[2]/=l):(o[0]=0,o[1]=1,o[0]=0),Ne(n.lookAtDirection,o),Ne(s.lookAtDirection,o),n.copyFromRenderCamera(e),s.copyFromRenderCamera(i),this._current.copyFrom(n),this._animation.update(n,s,r),this.currentTime=0,e.almostEquals(i)&&(this.currentTime=this._animation.time)}cameraAt(e,i){return this._animation.cameraAt(e,this._current),i=i||new ai,this._current.copyToRenderCamera(i),i}step(e,i){return this.finished||(this.currentTime=this.currentTime+fSe(e),this.currentTime>=this.time&&(this.currentTime=this.time)),this.cameraAt(this.currentTime/this.time,i)}};var Cs;(function(t){t.Ready="ready",t.Rejected="rejected",t.Running="running",t.Stopped="stopped",t.Finished="finished"})(Cs||(Cs={}));let Iv=class extends ze{constructor(e){super(e),this.state=Cs.Ready}get active(){return this.state===Cs.Running}get isInteractive(){return!1}get canStop(){return!1}stopController(){return!!this.canStop&&(this.state=Cs.Stopped,!0)}finishController(){this.state=Cs.Finished}get steppingFinished(){return!1}};y([w({constructOnly:!0})],Iv.prototype,"view",void 0),y([w({readOnly:!0})],Iv.prototype,"active",null),y([w()],Iv.prototype,"state",void 0),y([w({readOnly:!0})],Iv.prototype,"isInteractive",null),Iv=y([Z("esri.views.3d.state.controllers.CameraController")],Iv);let $L=class extends Iv{constructor(){super(...arguments),this._asyncResult=null}get canStop(){return!0}set asyncResult(e){this._asyncResult&&(this._asyncResult.reject(ur()),this._asyncResult=null),this.state===Cs.Finished||this.state===Cs.Stopped?(ky(e),this.state===Cs.Finished?e.resolve():e.reject(ur())):this._asyncResult=e}get asyncResult(){return this._asyncResult}onControllerStart(){this.state=Cs.Running,this.viewAnimation!=null&&this.viewAnimation.when(()=>this.updateStateFromViewAnimation(),()=>this.updateStateFromViewAnimation())}updateStateFromViewAnimation(){this.viewAnimation==null||this.state!==Cs.Ready&&this.state!==Cs.Running||(this.viewAnimation.state===b5.State.FINISHED?this.finish():this.viewAnimation.state===b5.State.STOPPED&&(this.state=Cs.Stopped))}onControllerEnd(){this.viewAnimation==null||this.viewAnimation.done||(this.state===Cs.Finished?this.viewAnimation.finish():this.state===Cs.Stopped&&this.viewAnimation.stop()),this._asyncResult&&(this.state===Cs.Finished?this._asyncResult.resolve():this._asyncResult.reject(ur()))}finish(){this.finishController()}};$L=y([Z("esri.views.3d.state.controllers.AnimationController")],$L);let Hv=class extends $L{get intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(e){super(e),this.mode="interaction",this._hasTarget=!1}initialize(){this.animation=new Rbt(this.view.state.viewingMode),this.viewAnimation=this.mode==="interaction"?null:new b5}get isInteractive(){return this.mode==="interaction"}begin(e,i){this._hasTarget=!0;const r=this.animationSettings(i);nN.copyFrom(this.view.state.camera);const n=Tp(this.view.state.viewingMode);this.intersectionHelper.intersectRay(nN.ray,n,Ige)&&(nN.center=Ige),this.animation.update(nN,e,r),this.animation.finished&&this.finish()}finish(){this.animation.currentTime=this.animation.time,super.finish()}get steppingFinished(){return this._hasTarget&&this.animation.finished}stepController(e,i){this._hasTarget&&this.animation.step(e,i)}onControllerEnd(e){this._hasTarget&&(this.animation.cameraAt(this.animation.currentTime/this.animation.time,e),this.animation.currentTime=this.animation.time),super.onControllerEnd(e)}animationSettings(e={}){return{apex:{maximumDistance:this.view.state.constraints.clampAltitude(1/0)/6,ascensionFactor:void 0,descensionFactor:void 0},...e,easing:typeof e.easing=="string"?ebt[e.easing]:e.easing}}};y([w({constructOnly:!0})],Hv.prototype,"mode",void 0),y([w({readOnly:!0})],Hv.prototype,"isInteractive",null),Hv=y([Z("esri.views.3d.state.controllers.PointToPointAnimationController")],Hv);const nN=new ai,Ige=W();function Gj(t=$bt){return[t[0],t[1],t[2],t[3]]}function LL(t,e){return Ibt(t[0],t[1],t[2],e,$oe.get())}function Ibt(t,e,i,r,n=Gj()){return n[0]=t,n[1]=e,n[2]=i,n[3]=r,n}function Qae(t,e,i){return Wt(i,t,e),Ye(i,i),i[3]=oj(t,e),i}const $bt=[0,0,1,0];function uni(t,e,i=Ko()){return ele(t,dm(e),i),Ye(i.direction,i.direction),i}function ele(t,e,i){return Lbt(t,t.screenToRender(e,xt.get()),i)}function Lbt(t,e,i){const r=Qo(xt.get(),e);if(r[2]=0,!t.unprojectFromRenderScreen(r,i.origin))return null;const n=Qo(xt.get(),e);n[2]=1;const s=t.unprojectFromRenderScreen(n,xt.get());return s==null?null:(je(i.direction,s,i.origin),i)}function SP(t,e,i){return tle(t,t.screenToRender(e,xt.get()),i)}function tle(t,e,i){Ne(i.origin,t.eye);const r=Ie(xt.get(),e[0],e[1],1),n=t.unprojectFromRenderScreen(r,xt.get());return n==null?null:(je(i.direction,n,i.origin),i)}function ile(t,e,i,r){const n=SP(e,i,Dbt);return lx(t,n,r)}const Dbt=Ko();var E5;(function(t){t[t.Ellipsoid=0]="Ellipsoid",t[t.Silhouette=1]="Silhouette"})(E5||(E5={}));const XLe=30,OU=[1,3e8],Hj=80,ZLe=8,JLe=200,KLe=1508e5,QLe=5,e9e=50,Nbt=5,Fbt=10,Fq=90,AE={exclude:new Set([Gw])};function vT(t,e,i){return i[0]=e[0]/(t.fullWidth/t.pixelRatio),i[1]=e[1]/(t.fullHeight/t.pixelRatio),i}function jte(t){for(;t>Math.PI;)t-=2*Math.PI;for(;t<-Math.PI;)t+=2*Math.PI;return t}function W2(t,e,i){const r=xp(Loe.get(),i[3],i);r==null||yse(r,gs)||(je(dn,t.eye,e),bt(dn,dn,r),t.eye=Be(dn,dn,e),je(dn,t.center,e),bt(dn,dn,r),t.center=Be(dn,dn,e),t.up=bt(dn,t.up,r))}function kbt(t,e,i,r){return bE(t,ele(e,i,sle),r)}function Gte(t,e,i,r){return bE(t,SP(e,i,sle),r)}function rle(t,e,i,r){const n=xt.get();let s=1-i;je(n,e,t.eye);const o=rt(n);let l=o*(1-s);s>=0&&lDge.Elevation?Xa.Horizontal:(SP(t,e,jge),-Math.sign(t.relativeElevation)*(.5*Math.PI+oj(t.eye,jge.direction))i?-(e-i)/(o*i):e<-i?Math.PI-(e+i)/(o*i):Ca(e/i),s=t>i?-(t-i)/(o*i):t<-i?Math.PI-(t+i)/(o*i):Ca(t/i),(s-n)*i}function zbt(t,e,i,r,n,s,o,l,c,f){const _=kge(t[2],e[2],s[3],l),x=c?kge(t[0],e[0],s[3],180):e[0]-t[0],T=Math.sin(o)*x-Math.cos(o)*_,A=Math.cos(o)*x+Math.sin(o)*_;Ye(dn,n);const M=c?T/Math.sqrt(Math.abs(s[3]**2-Ve(i,dn)**2)):T/s[3],I=A/Math.sqrt(Math.abs(s[3]**2-Ve(i,r)**2));or(f,M,I)}function o9e(t,e,i,r,n,s,o,l,c,f){Wt(IU,t,e),gee(s.up,s.eye,aN,lN,cN),gee([0,0,1],s.eye,Qv,_2,u9e),Ne(i,_2),Ne(r,Qv),Ye(i,i),De(i,i,rt(IU)),F0e(t,Ye(lN,lN),Ye(cN,cN),Ye(aN,aN),zge),F0e(e,lN,cN,aN,Uge),zbt(zge,Uge,t,Qv,_2,o,l,c,f,n)}function Ubt(t,e,i,r,n,s,o){xp(PU,n,r),xp(RU,o,s),nn(DM,PU,RU),je(e,t,i),bt(e,e,DM),Be(e,e,i)}function a9e(t,e,i,r,n,s){xp(PU,r,i),xp(RU,s,n),nn(DM,PU,RU),je(dn,t.eye,e),bt(dn,dn,DM),t.eye=Be(dn,dn,e),je(dn,t.center,e),bt(dn,dn,DM),t.center=Be(dn,dn,e),je(dn,t.up,e),bt(dn,dn,DM),t.up=Be(dn,dn,e)}function nle(t,e,i,r,n,s){return(Math.abs(r)>Math.PI-sN.Angle||Math.abs(r)i)&&s.aboveGround&&nc&&(f=Co(i,Ax),o9e(i,Ax,_2,Qv,lR,hN,t,n,s,o),a9e(hN,t,Qv,lR[1],_2,lR[0]),Ubt(Ax,Ax,t,Qv,lR[1],_2,lR[0]),_=Co(i,Ax),_0,o=!0),this._tmpCamera.copyFrom(r.camera),s?this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter):this.intersectionHelper.intersectRay(this._tmpCamera.ray,this._intersector,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:Ne(this._zoomLocation,this._tmpCamera.center),this._updateCamera(this._tmpCamera,e,this._zoomLocation,i,o),this.begin(this._tmpCamera)}animationSettings(){return{duration:600,easing:J9}}_updateCamera(e,i,r,n,s){const o=Sr(this.view.spatialReference),l=qj(e,n,o),c=Math.abs(this.view.camera.position.z);Ye(pN,e.eye),De(pN,pN,-1),SP(e,n,this._tmpRayDir),Ye(this._tmpRayDir.direction,this._tmpRayDir.direction);const f=Je(Math.min(ZLe,1/Math.abs(Ve(pN,this._tmpRayDir.direction)))*c,JLe,KLe);if(l===Xa.Horizontal){let _=Gge**i;this._sphere[3]=rt(r),je(this._tmpViewDir,e.center,e.eye);const x=Math.min(rt(this._tmpViewDir),f);let T=x*_;if(_<=1&&T1e-12&&ile(this._sphere,e,n,this._targetOnSphere)&&Vbt(this._sphere,e,r,this._targetOnSphere,this.view.camera.heading,this.view.camera.tilt,!0)}else{let _=Gge**Math.abs(i);const x=i>0?1:-1;je(this._tmpViewDir,r,e.eye);const T=rt(this._tmpViewDir),A=this.view._stage.renderView.getMinimalDepthForArea(null,n[0],n[1],this.view.state.camera,Hbt);let M=A??f;M=s&&i>0?Math.min(M,T):M,De(this._tmpRayDir.direction,this._tmpRayDir.direction,M),Be(r,this._tmpRayDir.origin,this._tmpRayDir.direction);let I=M*_;const L=Math.max(Uq,1.01*e.nearFar[0]);if(i>0&&Iimport("./VoxelWasmPerSceneView-YeZpknKe.js"),__vite__mapDeps([]))),ZF=await XF);const e=t.view;let i=wO.get(e);return i||(i=new ZF.default({view:e}),wO.set(e,i)),i.addVoxelLayer(t)}function NL(t){return wO.get(t)}function pni(t){const e=t.view,i=wO.get(e);i&&i.removeVoxelLayer(t)<1&&(wO.delete(e),wO.size===0&&(XF=null,ZF=null))}const qbt=.6,Wbt=4,Ybt=60;let LU=class extends Hv{constructor(){super(...arguments),this._zoomLocation=W(),this._tmpCamera=new ai,this._tmpRayDir=W(),this._tmpCenter=W(),this._constraintOptions={selection:Yn.ALL,interactionType:Ki.ZOOM,interactionFactor:null,interactionStartCamera:new ai,interactionDirection:null,tiltMode:il.TUMBLE}}zoomStep(e,i){if(!this.active)return;const r=this.view.state,{interactionStartCamera:n}=this._constraintOptions;n&&(this.animation.finished?n.copyFrom(r.camera):this.animation.cameraAt(1,n)),this._tmpCamera.copyFrom(r.camera);const s=Tp(this.view.state.viewingMode);let o=!1;e>0?(o=this.intersectionHelper.intersectScreenFreePointFallback(i,this._zoomLocation,this.view.map.ground.opacity===0?AE:{}),this.intersectionHelper.intersectRay(this._tmpCamera.ray,s,this._tmpCenter)&&(this._tmpCamera.center=this._tmpCenter)):this.intersectionHelper.intersectRay(this._tmpCamera.ray,s,this._zoomLocation)?this._tmpCamera.center=this._zoomLocation:Ne(this._zoomLocation,this._tmpCamera.center);const l=qbt**e;let c=this.view._stage.renderView.getMinimalDepthForArea(NL(this.view),i[0],i[1],this.view.state.camera,Ybt);je(fN,this._tmpCamera.eye,this._zoomLocation),Ye(fN,fN);const f=Je(Math.min(ZLe,1/Math.abs(Ve(Xbt,fN)))*Math.abs(this.view.camera.position.z),JLe,KLe);if(c=c??f,c){const _=W();je(_,this._zoomLocation,this._tmpCamera.eye),(cthis._handleDoubleClick(r))}_handleDoubleClick(e){const i=e.data;if(Zbt(i,"primary")){const r=this._view.state.isGlobal?new $U({view:this._view,mode:"animation"}):new LU({view:this._view,mode:"animation"});this._view.state.switchCameraController(r),r.zoomStep(Math.log(.5)/Math.log(.6),ss(i.x,i.y)),e.stopPropagation()}}};function Kbt(t,e,i){return t===_t.Global?new ewt(i):new Qbt(e,i)}let Qbt=class{constructor(e,i){this._elevationProvider=e,this._referenceEllipsoid=Sr(i),this._unitInMeters=ws(i,this._referenceEllipsoid.metersPerDegree)}compute(e,i,r,n,s){var k;s||(s={near:0,far:0});let o=e[2]*this._unitInMeters;const l=o,c=o-n,f=(k=this._elevationProvider)==null?void 0:k.visibleElevationBounds;f&&(o=c>=0?l-this._unitInMeters*f.min:this._unitInMeters*f.max-l);const _={x:(r=r??new Vi({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0})).xmax-r.xmin,y:r.ymax-r.ymin,z:4*Math.max(r.xmax-r.xmin,r.ymax-r.ymin)},x=Math.max(_.x,_.y,_.z);je(Mx,i,e),lC[0]=Mx[0]>0?r.xmax:r.xmin,lC[1]=Mx[1]>0?r.ymax:r.ymin,lC[2]=Mx[2]>0?x/2:-x/2,je(lC,lC,e),Ye(Mx,Mx);const T=1.1*Ve(lC,Mx)*this._unitInMeters,A=Math.sqrt(o*(o+2*this._referenceEllipsoid.radius)),M=Math.max(r.xmax-r.xmin,r.ymax-r.ymin),I=M*rwt*this._unitInMeters,L=M*nwt*this._unitInMeters,F=Je((o-L)/(I-L),0,1)**3,z=Math.min(ui(A,T,F),A)*Math.max(Math.log(Math.abs(c)),1);return h9e(Math.min(z,Math.max(34064e4,x))/this._unitInMeters,twt,this._unitInMeters,s)}},ewt=class{constructor(e){this._referenceEllipsoid=Sr(e)}compute(e,i,r,n,s){s||(s={near:0,far:0});const o=rt(e),l=o-this._referenceEllipsoid.radius,c=this._referenceEllipsoid.radius+Math.min(0,n),f=Math.abs(l-n),_=Math.max(f,Math.abs(l)),x=Math.sqrt(_*(_+2*c)),T=o+this._referenceEllipsoid.radius;return h9e(1.2*ui(x,T,dae(_)),Je(2e4-(Math.log(_)-7.983)/9.011*19e3,1e3,2e4),1,s)}};function h9e(t,e,i,r){const n=iwt/i;return t/e>n?(r.far=t,r.near=r.far/e):(r.near=n,r.far=r.near*e),r}const twt=2e4,iwt=2,rwt=.001,nwt=1e-4,lC=W(),Mx=W();let JF=class extends ze{constructor(e){super(e)}initialize(){this.addHandles(this.view.basemapTerrain.on("elevation-change",e=>this._handleElevationChangeEvent(e)))}_handleElevationChangeEvent(e){if(this.view.state.cameraController)return;const i=this.view.state.camera;e.spatialReference!=null&&I4e(this.view,i,e.extent,e.spatialReference)&&this._applyToCurrentCamera()}_applyToCurrentCamera(){this.view.state.updateCamera(e=>xP(this.view,e,Cf.EYE_AND_CENTER))}};y([w({constructOnly:!0})],JF.prototype,"view",void 0),JF=y([Z("esri.views.3d.state.ElevationCollisionConstraint")],JF);let lI=class extends ze{constructor(e){super(e),this.nearFarHeuristic=Kbt(e.view.state.viewingMode,e.view.basemapTerrain,e.view.renderCoordsHelper.spatialReference)}initialize(){this.addHandles([_e(()=>{var e,i,r,n;return[(i=(e=this.view.constraints)==null?void 0:e.clipDistance)==null?void 0:i.near,(n=(r=this.view.constraints)==null?void 0:r.clipDistance)==null?void 0:n.far]},()=>this._clipDistanceNearFarChanged()),_e(()=>{var e,i;return(i=(e=this.view.constraints)==null?void 0:e.clipDistance)==null?void 0:i.mode},()=>this._updateNearFar()),this.view.state.events.on("before-camera-change",e=>this._updateCameraNearFar(e)),_e(()=>this.view.renderDataExtent,()=>this._updateNearFar(),Li),_e(()=>{var e,i,r,n;return[(i=(e=this.view.constraints)==null?void 0:e.altitude)==null?void 0:i.min,(n=(r=this.view.constraints)==null?void 0:r.altitude)==null?void 0:n.max]},()=>this._updateAltitude(),Li),_e(()=>{var e,i;return(i=(e=this.view.constraints)==null?void 0:e.tilt)==null?void 0:i.max},()=>this._updateTiltMax(),Li),_e(()=>{var e,i;return(i=(e=this.view.constraints)==null?void 0:e.tilt)==null?void 0:i.mode},()=>this._updateTilt(),Li),_e(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},()=>this._updateTiltAutoMax(),Li),_e(()=>{var e,i,r,n,s,o;return[(r=(i=(e=this.view.map)==null?void 0:e.ground)==null?void 0:i.navigationConstraint)==null?void 0:r.type,(o=(s=(n=this.view.state)==null?void 0:n.constraints)==null?void 0:s.collision)==null?void 0:o.enabled]},()=>this._updateCollision(),Li)]),this.view.state.isLocal&&this.addHandles(_e(()=>this.view.renderDataExtent,e=>this._updateLocalSurfaceDistance(e),ii)),this._updateNearFar(),this.view.state.viewingMode!==_t.Local&&this._updateAltitude(),this._updateTilt(),this._updateCollision(),this._set("surfaceCollisionConstraint",new JF({view:this.view}))}destroy(){this.surfaceCollisionConstraint&&(this.surfaceCollisionConstraint.destroy(),this._set("surfaceCollisionConstraint",null))}_clipDistanceNearFarChanged(){var i;const e=(i=this.view.constraints)==null?void 0:i.clipDistance;e&&e.mode!=="auto"&&this.view.state.updateCamera(r=>this._updateCameraNearFarManual(r,e))}_updateNearFar(){this.view.state.updateCamera(e=>this._updateCameraNearFar(e))}_updateCameraNearFar(e){const i=this.view.constraints&&this.view.constraints.clipDistance;(i?i.mode:"auto")==="manual"?this._updateCameraNearFarManual(e,i):this._updateCameraNearFarAuto(e,i)}_updateCameraNearFarAuto(e,i){this.nearFarHeuristic.compute(e.eye,e.center,this.view.renderDataExtent,wj(this.view,e.eye),e),i&&i.autoUpdate(e.near,e.far)}_updateCameraNearFarManual(e,i){i&&(e.near=i.near,e.far=i.far)}_updateCollision(){var n,s,o;const e=(o=(s=(n=this.view.map)==null?void 0:n.ground)==null?void 0:s.navigationConstraint)==null?void 0:o.type,i=!e||e==="stay-above",r=this.view.state.constraints.collision;if(i!==r.enabled){r.enabled=i,i&&this._reapplyConstraints(Yn.COLLISION);const l=this.view.constraints&&this.view.constraints.tilt;l&&l.mode!=="auto"||this._updateTiltAuto()}}_updateAltitude(){const e=this.view.constraints&&this.view.constraints.altitude;e&&this.view.state.viewingMode!==_t.Local?this.view.state.constraints.altitude={min:e.min,max:e.max}:this.view.state.constraints.altitude=null,this._reapplyConstraints()}_updateTiltMax(){const e=this.view.constraints&&this.view.constraints.tilt;e&&e.mode!=="auto"&&(this._updateTiltManual(e),this._reapplyConstraints())}_updateTilt(){const e=this.view.constraints&&this.view.constraints.tilt;(e?e.mode:"auto")==="manual"?this._updateTiltManual(e):this._updateTiltAuto(),this._reapplyConstraints()}_updateTiltManual(e){const i=this.view.state.constraints;i.tilt=i.createConstantMaxTilt(Ei(e.max))}_updateTiltAuto(){const e=this.view.state.constraints;e.tilt=e.createDefaultTilt(),this._updateTiltAutoMax()}_updateTiltAutoMax(){const e=this.view.constraints&&this.view.constraints.tilt;if(!e||e.mode!=="auto")return;const i=this.view.state.constraints;if(i.tilt){const r=i.tilt(this.view.state.camera.distance).max;e.autoUpdate(pu(r))}}_updateLocalSurfaceDistance(e){if(e==null)return;let i=Math.max(e.width,e.height);if(i<=0)return;e.zmax!=null&&e.zmin!=null&&(i=Math.max(i,e.zmax-e.zmin));const r=this.view.state,n=3*i/Math.atan(r.camera.fov/2);n!==r.constraints.distance&&(r.constraints.distance=n)}_reapplyConstraints(e=Yn.ALL){this.view.state.updateCamera(i=>wo(this.view,i,{selection:e,interactionType:Ki.NONE,interactionFactor:null,interactionStartCamera:null,interactionDirection:null,tiltMode:il.TUMBLE}))}};y([w({constructOnly:!0})],lI.prototype,"view",void 0),y([w({readOnly:!0})],lI.prototype,"surfaceCollisionConstraint",void 0),lI=y([Z("esri.views.3d.state.ConstraintsManager")],lI);let qw=class{get planes(){return this.frustum}get points(){return this._points}get mutablePoints(){return this._points}get direction(){return this._direction}constructor(e){this.renderCoordsHelper=e,this.frustum=OL(),this._points=$$e(),this.lines=new Array(12),this._origin=W(),this._direction=W(),this._altitude=null;for(let i=0;i<12;i++)this.lines[i]={origin:null,direction:W(),endpoint:null}}update(e){L$e(e.viewMatrix,e.projectionMatrix,this.frustum,this._points),Ne(this._origin,e.eye),Ne(this._direction,e.viewForward),this._altitude=this.renderCoordsHelper.getAltitude(this._origin),this._updateLines()}updatePoints(e){for(let i=0;ithis._handleElevationChangeEvent(e))),this._applyCorrection()}onControllerEnd(){this.removeAllHandles()}stepController(){}_handleElevationChangeEvent(e){(e.spatialReference==null||I4e(this.view,this.desiredCamera,e.extent,e.spatialReference))&&this._applyCorrection()}_applyCorrection(){this.view.state.updateCamera(e=>{e.copyViewFrom(this.desiredCamera),xP(this.view,e,Cf.EYE_AND_CENTER)||this.constraintEnabled||(this.state=Cs.Stopped)})}};y([w({constructOnly:!0})],m$.prototype,"desiredCamera",null),m$=y([Z("esri.views.3d.state.controllers.SurfaceCollisionCorrectionController")],m$);const swt=.66;function d9e(t){return 360-d5.normalize(t)}function Wj(t){return d5.normalize(360-t)}function p9e(t,e,i){const r=e.camera;if(r!=null)return owt(r,V_(t));const{targetGeometry:n}=e;if(n==null)return null;const{camera:s,mode:o}=m9e(t,e.rotation,i);if(n.type==="point")return lwt(t,e,n,s,o);const l=n.extent;return l==null?null:PF(t,l,s.heading,s.tilt,o)}async function f9e(t,e,i,r){const n=e.camera;if(n!=null)return awt(n,V_(t),r);const{targetGeometry:s}=e;if(s==null)throw new Error("Viewpoint has no targetGeometry!");const{camera:o,mode:l}=m9e(t,e.rotation,i);if(s.type==="point")return cwt(t,e,s,o,l,r);const c=s.extent;if(c==null)throw new Error("Target geometry has no extent!");return oIe(t,c,o.heading,o.tilt,l,r)}function owt(t,e){const i=t.position;let r;try{r=rl(i,e)}catch{return null}const n=t.clone();return n.position=r.clone(),n}async function awt(t,e,i){const r=t.position,n=await qy(r,e,{signal:i});St(i);const s=t.clone();return s.position=n.clone(),s}function m9e(t,e,i){const r=_5(t,t.state.camera);let n=ql.ADJUST;return e!=null&&(r.heading=d9e(e),n=ql.LOCKED),i!=null&&(r.tilt=i),{camera:r,mode:n}}function lwt(t,e,i,r,n){const s=t.spatialReference;let o;try{o=rl(i.clone(),s)}catch{return null}const l=e.scale!=null?xj(t,e.scale,o.latitude):t.state.camera.distance;return L0t(t,o,l,r,n)}async function cwt(t,e,i,r,n,s){const o=t.spatialReference,l=await qy(i.clone(),o,{signal:s});St(s);const c=e.scale!=null?xj(t,e.scale,l.latitude):t.state.camera.distance;return X4e(t,l,c,r,n,s)}function g9e(t,e,i=null){return i==null&&(i=new ih),cle(t,null,e.clone(),i)}async function y9e(t,e,i){const r=_wt(t,e);if(!r)throw new se("viewpointutils-create:no-target","Missing target for creating viewpoint");const n=new cd({fov:t.camera.fov}),s=new ih({camera:n});if(r.target instanceof ih)return Ox(await dwt(t,r.target,r,i,s));if(r.target instanceof cd)return Ox(await _9e(t,r.target,i,s));const o=r.scale!=null||r.zoom!=null;if(r.target instanceof Vi){const f=r.target.xmin===r.target.xmax||r.target.ymin===r.target.ymax;return Ox(o||f?await Hte(t,r,r.target.center,n,i,s):await gwt(t,r,r.target,n,i,s))}const l={boundingBox:Bn(),hasZ:!1,screenSpaceObjects:[]},c=o?uwt(t,r):void 0;if(await v9e(t,r.target,c,l,i),isFinite(l.boundingBox[0])){let f;if(gm(l.boundingBox,ro),Zd.x=ro[0],Zd.y=ro[1],Zd.z=ro[2],Zd.spatialReference=t.spatialReference,isFinite(Zd.z)&&l.hasZ?f=Dse(l.boundingBox):(Zd.z=void 0,f=Cet(Lse(l.boundingBox,wwt))),o||f)return Ox(await Hte(t,r,Zd,n,i,s));const _=bwt(t,l.screenSpaceObjects);return Ox(await vwt(t,r,Zd,l.boundingBox,_,n,i,s))}return r.position?Ox(await fwt(t,r,n,s,i)):Ox(await mwt(t,r,n,i,s))}function ale(t,e){return e.scale==null&&e.zoom!=null?hIe(t,e.zoom):e.scale}function uwt(t,e){const i=ale(t,e);return i?Oht(i):void 0}function lle(t,e){let i=!1;return e.heading!=null?(t.heading=e.heading,i=!0):e.rotation!=null&&(t.heading=d9e(e.rotation),i=!0),e.tilt!=null&&(t.tilt=e.tilt,i=!0),e.fov!=null&&(t.fov=e.fov),i}function cle(t,e,i,r){const n=t.spatialReference||at.WGS84;return(e=e??Tv(t,i))==null||(r.targetGeometry=w_(e.center,t.renderSpatialReference,n),r.scale=dIe(t,e),r.rotation=Wj(i.heading),r.camera=i),r}async function DU(t,e,i,r){var x;const n=()=>new se("viewpointutils:invalid-geometry","The target is missing a valid geometry");if(!e)throw n();e.type==="mesh"&&(e=e.extent);const s=e.spatialReference,o=t.spatialReference,l=t.basemapTerrain.spatialReference;if(!e.hasZ&&t.basemapTerrain){let T;switch(e.type){case"point":T=e;break;case"multipoint":case"polyline":T=(x=e.extent)==null?void 0:x.center;break;case"extent":T=e.center;break;case"polygon":T=e.centroid}T!=null&&l!=null&&t.elevationProvider!=null?(T=await qy(T,l,{signal:r}),ro[2]=my(t.elevationProvider,T)??0):ro[2]=0}const c=xwt[e.type],f=new Array;if(c(e,e.hasZ?T=>{f.push([T[0],T[1],T[2]])}:T=>{f.push([T[0],T[1]])},ro),f.length===0)throw n();const _=await qy(new Cm({spatialReference:s,hasZ:e.hasZ,hasM:!1,points:f}),o,{signal:r});if(e.hasZ&&(i.hasZ=!0),e.hasZ)for(const[T,A,M]of _.points)ro[0]=T,ro[1]=A,ro[2]=M,qf(i.boundingBox,ro);else for(const[T,A]of _.points)ro[0]=T,ro[1]=A,qf(i.boundingBox,ro)}async function hwt(t,e,i,r,n){const s=await Ju(t.whenViewForGraphic(e));if(s.ok===!1||s.value==null||!("whenGraphicBounds"in s.value))return void await DU(t,e.geometry,r,n);const o=s.value,l=await Ju(o.whenGraphicBounds(e,{minDemResolution:i}));if(l.ok===!1||!l.value)return void await DU(t,e.geometry,r,n);const{screenSpaceObjects:c,boundingBox:f}=l.value;ZO(r.boundingBox,f),c&&c.forEach(_=>{r.screenSpaceObjects.push(_)}),isFinite(f[2])&&(r.hasZ=!0)}async function v9e(t,e,i,r,n){var s;if(Array.isArray(e)&&e.length===2){const o=e[0],l=e[1];if(typeof o=="number"&&typeof l=="number")return Zd.x=o,Zd.y=l,Zd.z=void 0,Zd.spatialReference=(s=t.spatialReference)!=null&&s.isGeographic?t.spatialReference:at.WGS84,void await DU(t,Zd,r,n)}e&&"map"in e&&typeof e.map=="function"?await Promise.allSettled(e.map(o=>v9e(t,o,i,r,n))):e instanceof ix?await DU(t,e,r,n):e instanceof Ml&&await hwt(t,e,i,r,n)}async function dwt(t,e,i,r,n){if(e.camera!=null)return _9e(t,e.camera,r,n);n.scale=e.scale,n.rotation=e.rotation,n.targetGeometry=e.targetGeometry!=null?e.targetGeometry.clone():null,n.camera=null,i.heading!=null?n.rotation=Wj(i.heading):i.rotation!=null&&(n.rotation=i.rotation);const s=ale(t,i);return s!=null&&(n.scale=s),n.camera=await f9e(t,n,i.tilt,r),n}async function _9e(t,e,i,r){const n=t.spatialReference,s=await qy(e.position,n,{signal:i});return(e=e.clone()).fov=t.camera.fov,e.position=s,cle(t,null,e,r)}async function pwt(t,e,i,r,n,s,o){const l=t.renderSpatialReference;return await dU(e,Bq,l,0,{signal:o}),await dU(i,gN,l,0,{signal:o}),s.targetGeometry=new mt(e),n.position=new mt(i),je(NU,Bq,gN),Sj(t,gN,NU,r.up,n),s.scale=qT(t,Sn(gN,Bq),s.targetGeometry.latitude),s.rotation=Wj(n.heading),s.camera=n,s}async function Hte(t,e,i,r,n,s){if(i==null)throw new se("createfromcenter","invalid point");s.targetGeometry=i.clone();const o=xE(t);if(e.position)return pwt(t,s.targetGeometry,e.position,o,r,s,n);if(e.zoomFactor){const c=o.distance/e.zoomFactor,f=De(ro,o.viewForward,-c);o.eye=Be(ro,o.center,f),s.scale=qT(t,c,i.latitude)}_5(t,o,r);const l=lle(r,e)?ql.LOCKED:ql.ADJUST;if(!e.zoomFactor){const c=ale(t,e);if(c==null){const{renderSpatialReference:f}=t;await dU(i,ro,f,0,{signal:n}),N$e(o.frustum,ro)?s.scale=qT(t,Sn(o.eye,ro),i.latitude):s.scale=dIe(t,o)}else s.scale=c;s.camera=await Y4e(t,s.targetGeometry,s.scale,r,l,n)}return s}async function fwt(t,e,i,r,n){const s=xE(t);Ne(NU,s.viewForward),Sj(t,s.eye,NU,s.up,jq);const o=t.spatialReference,{position:l}=e;if(l){const c=await qy(l,o,{signal:n});i.position=c}else i.position=new mt;return i.heading=e.heading!=null?e.heading:jq.heading,i.tilt=e.tilt!=null?e.tilt:jq.tilt,cle(t,null,i,r)}async function mwt(t,e,i,r,n){const s=xE(t),{spatialReference:o,renderSpatialReference:l}=t;return Hte(t,e,w_(s.center,l,o),i,r,n)}async function gwt(t,e,i,r,n,s){s.targetGeometry=i.clone();const o=xE(t);_5(t,o,r);const l=lle(r,e)?ql.LOCKED:ql.ADJUST;return s.camera=await oIe(t,i,r.heading,r.tilt,l,n),s}function ywt(t,e,i,r,n){let s=0;i.z!=null?s=i.z:t.basemapTerrain&&t.elevationProvider&&(s=my(t.elevationProvider,i)),Ie(ro,i.x,i.y,s),uu(t.spatialReference,ro,qge,t.renderSpatialReference),Yf(mN,qge),Xf(mN,mN),Bn(cR);const o=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];for(let M=0;M{this._resolveCallback=n,this._rejectCallback=s;const o=new AbortController;this.options.signal!=null&&Yl(this.options.signal,()=>{this.abort()}),this._abortController=o,this.waitForReady()})}resolve(e){if(this.state!=="finished")return this.state="finished",this._resolveCallback(e)}reject(e){if(this.state!=="finished")return this.state="finished",this._rejectCallback(e)}abort(e=!1){this._abortController.abort(),this.state==="wait-for-animation-finish"&&!e&&this._animationController!=null&&this.view.state.cameraController===this._animationController&&this._animationController.active&&this._animationController.stopController(),this.reject(ur())}async waitForReady(){if(this.state="wait-for-ready",!this.view.ready)try{await rd(()=>this.view.ready,this._abortController.signal)}catch(e){return this.reject(e)}this.createViewPoint()}async createViewPoint(){if(this.state!=="finished"){this.state="wait-for-viewpoint",this._animationController=this.options.animate?this._getAnimationController():null;try{const e=await y9e(this.view,this.target,this._abortController.signal);if(this.state==="finished")return;const i=e?this._getCameraFromViewpoint(e):null;if(i==null)return;if(this.options.animate){if(this._animationController==null)return;this.startAnimation(i,this._animationController)}else this.view.stateManager.setStateCamera(i.camera,{applyConstraints:!i.isFullySpecified,positionAndOrientationOnly:!0,doNotCancelGoToOperation:!0}),this.resolve()}catch(e){this.reject(e)}}}_getCameraFromViewpoint(e){var s;const i=!!(this.target instanceof ih&&this.target.camera||this.target instanceof cd),r=e.camera;if(r==null)return null;if(!this.view.stateManager.isCompatible(r)){const o=r.position,l=o&&o.spatialReference,c=l?l.wkid:"none",f=(s=this.view.spatialReference)==null?void 0:s.wkid;return this.reject(new se("GotoAnimation:incompatible-spatialreference",`Resulting camera has an incompatible spatial reference (camera: ${c}, view: ${f})`,{camera:r})),null}const n=Tv(this.view,r);return n==null?(this.reject(new se("GotoAnimation:invalid-camera","Resulting camera is invalid")),null):{viewpoint:e,camera:n,isFullySpecified:i}}startAnimation(e,i){this.state="wait-for-animation-finish";const r=i.viewAnimation;if(r==null)return void this.reject(new se("GotoAnimation:missing-animation","Unreachable code in view.stateManager"));if(r.update(e.viewpoint,"running"),!i.active||i.viewAnimation==null||i.viewAnimation.target!==e.viewpoint||this.view.state.cameraController!==i)return this.abort();let n;e.isFullySpecified?(n=new m$({view:this.view,desiredCamera:e.camera}),xP(this.view,e.camera,Cf.EYE_AND_CENTER)):wo(this.view,e.camera),i.begin(e.camera,this.options);const s=()=>{const l=this.view.state.cameraController;n&&(l&&l.active?l instanceof Hv&&l.viewAnimation!=null&&l.viewAnimation.target===e.viewpoint&&(this.view.state.cameraController=n):i.viewAnimation!=null&&i.viewAnimation.target===e.viewpoint&&i.state==="finished"&&(this.view.state.cameraController=n))},o=l=>{if(this.view.state!=null)switch(i.state){case Cs.Finished:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this.resolve()}break;case Cs.Ready:case Cs.Rejected:case Cs.Running:case Cs.Stopped:switch(this.state){case"pending":case"wait-for-ready":case"wait-for-viewpoint":case"wait-for-animation-finish":this.reject(l)}}};r.when(s,l=>o(l)),i.asyncResult={resolve:()=>o(),reject:l=>o(l)}}_getAnimationController(){let e=null,i=null;const r=this.view.state.cameraController;return r instanceof Hv&&(r.updateStateFromViewAnimation(),r.active&&(e=r,i=e.viewAnimation)),e!=null||(e=new Hv({view:this.view,mode:"animation"}),i=e.viewAnimation,this.view.state.switchCameraController(e))?e:(i!=null&&i.stop(),this.reject(new se("GotoAnimation:goto-cannot-interrupt","Cannot start an animation while interacting")),null)}},TP=class{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,i){var r;return(r=this._outer.get(e))==null?void 0:r.get(i)}set(e,i,r){const n=this._outer.get(e);n?n.set(i,r):this._outer.set(e,new Map([[i,r]]))}delete(e,i){const r=this._outer.get(e);r&&(r.delete(i),r.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((i,r)=>e(i,r))}};var Zo;function Gq(t=!Le("disable-feature:high-quality-idle"),e=null){const i=new TP;return t?(i.set(Vr.IDLE,Zo.Antialiasing,e!=="low"),i.set(Vr.IDLE,Zo.HighResolutionAtmosphere,e!=="low"),i.set(Vr.IDLE,Zo.HighQualityTransparency,!0),i.set(Vr.IDLE,Zo.SSAO,!0),i.set(Vr.IDLE,Zo.WaterReflection,!0),i.set(Vr.IDLE,Zo.PhysicalPixelRendering,!0)):(i.set(Vr.ANIMATING,Zo.HighResolutionShadows,!0),i.set(Vr.INTERACTING,Zo.HighResolutionShadows,!0)),i.set(Vr.IDLE,Zo.HighResolutionShadows,!0),i.set(Vr.IDLE,Zo.HighResolutionVoxel,!0),i}(function(t){t[t.Antialiasing=0]="Antialiasing",t[t.HighQualityTransparency=1]="HighQualityTransparency",t[t.HighResolutionVoxel=2]="HighResolutionVoxel",t[t.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",t[t.SSAO=4]="SSAO",t[t.WaterReflection=5]="WaterReflection",t[t.HighResolutionShadows=6]="HighResolutionShadows",t[t.PhysicalPixelRendering=7]="PhysicalPixelRendering"})(Zo||(Zo={}));let ra=class extends ze{get camera(){const e=this._get("camera");if(!this.ready)return e;const i=_5(this.view,this.view.state.camera,Hq);return i&&e&&i.equals(e)?e:i.clone()}set camera(e){var i,r;this._updatePropertyBeforeReady("camera",e)||((i=this.view.elevationProvider)==null||i.enableElevationCache(!0),this.setStateCamera(Tv(this.view,e),{applyConstraints:!1})||Ce.getLogger(this).error("#camera=","Invalid camera",e),(r=this.view.elevationProvider)==null||r.enableElevationCache(!1))}get contentCamera(){const e=this._get("contentCamera");if(!this.ready)return e;const i=_5(this.view,this.view.state.contentCamera,Hq);return i&&e&&i.equals(e)?e:i.clone()}set contentCamera(e){if(this._updatePropertyBeforeReady("contentCamera",e))return;const i=Tv(this.view,e);i!=null?(this._updateElevation(i),this.view.state.contentCamera=i):this.view.state.contentCamera=null}installContentCameraReset(e){if(this.removeHandles(qq),this.test.contentCameraResetState.clear(),!this.view.state.fixedContentCamera)return!1;const i=this.zoom,r=this.view.state.camera.distance**2,n=mc(this.view.state.camera.center),s=e.sticky?this.contentCamera.clone():null;return this.addHandles([_e(()=>this.contentCamera,()=>{e.sticky||(this.removeHandles(qq),this.test.contentCameraResetState.clear())}),_e(()=>this.zoom,o=>{o!==void 0&&i!==void 0&&(this.test.contentCameraResetState.set("view.zoom",Math.abs(o-i)/2),Math.abs(o-i)>2?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=s))}),_e(()=>this.view.state.camera,o=>{const l=Co(n,o.center);this.test.contentCameraResetState.set("camera.center",l/r),l>r?this.contentCamera=null:this.view.state.fixedContentCamera||(this.contentCamera=s)})],qq),!0}get center(){return this.ready?this.view.pointsOfInterest.centerOnContent.location:this._get("center")}set center(e){var i;this._updatePropertyBeforeReady("center",e)||(e?this.isCompatible(e)?this.setStateCamera(this._centerToCamera(e),{applyConstraints:!0})?this.view.pointsOfInterest.centerOnContent.runTask():Ce.getLogger(this).error("#center=","Invalid center",e):Ce.getLogger(this).error("#center=","Center has an incompatible spatial reference (center: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+((i=this.view.spatialReference)==null?void 0:i.wkid)+")",e):Ce.getLogger(this).error("#center=","Center may not be null or undefined"))}get extent(){if(!this.ready)return this._get("extent");const e=this.view,i=aIe(e,e.state.camera,e.pointsOfInterest.centerOnContent.renderLocation);return i??this._get("extent")}set extent(e){var i;this._updatePropertyBeforeReady("extent",e)||(e?this.isCompatible(e)?this.setStateCamera(this._extentToCamera(e),{applyConstraints:!0})||Ce.getLogger(this).error("#extent=","Invalid extent",e):Ce.getLogger(this).error("#extent=","Extent has an incompatible spatial reference (extent: "+(e.spatialReference?e.spatialReference.wkid:"none")+", view: "+((i=this.view.spatialReference)==null?void 0:i.wkid)+")",e):Ce.getLogger(this).error("#extent=","Extent may not be null or undefined"))}get frustum(){const e=this._propertiesPool.get("frustum");return e.renderCoordsHelper=this.view.renderCoordsHelper,e.update(this.view.state.camera),e}get _initialViewpoint(){var i;const e=this.view.map;return e&&"initialViewProperties"in e?(i=e.initialViewProperties)==null?void 0:i.viewpoint:void 0}get hasInitialView(){return!!this._initialViewpoint}get scale(){if(this.ready){const e=this.view.pointsOfInterest.centerOnContent;return qT(this.view,e.distance,e.location.latitude)}return this._get("scale")}set scale(e){this._updatePropertyBeforeReady("scale",e)||this.setStateCamera(this._scaleToCamera(e),{applyConstraints:!0})||Ce.getLogger(this).error("#scale=","Invalid scale",e)}get padding(){if(!this.ready)return this._get("padding");const e=this.view.state.camera,i=e.padding,r=e.pixelRatio,n=this._get("padding"),s=Math.round(i[er.TOP]/r),o=Math.round(i[er.RIGHT]/r),l=Math.round(i[er.BOTTOM]/r),c=Math.round(i[er.LEFT]/r);return n!=null&&n.top===s&&n.right===o&&n.bottom===l&&n.left===c?n:{top:s,right:o,bottom:l,left:c}}set padding(e){this._updatePropertyBeforeReady("padding",e)||(this._paddingToArray(e,this.view.state.camera.pixelRatio,yN),this.view.state.updateCamera(i=>i.padding=yN))}_paddingToArray(e,i,r){e?rs(r,e.top||0,e.right||0,e.bottom||0,e.left||0):rs(r,0,0,0,0);for(let n=0;n<4;n++)r[n]=Math.round(r[n]*i)}get screenCenter(){const e=this.padding;return Ku((this.view.width-(e.left+e.right))/2+e.left,(this.view.height-(e.top+e.bottom))/2+e.top)}get viewpoint(){return this.ready?g9e(this.view,this.camera):this._get("viewpoint")}set viewpoint(e){var i;if(!this._updatePropertyBeforeReady("viewpoint",e))if(e)if(this.isCompatible(e))this.setStateCamera(this._viewpointToCamera(e),{applyConstraints:!e.camera})||Ce.getLogger(this).error("#viewpoint=","Invalid viewpoint",e);else{const r=e.camera!=null?e.camera.position:e.targetGeometry,n=r!=null&&r.spatialReference;Ce.getLogger(this).error("#viewpoint=","Viewpoint has an incompatible spatial reference (viewpoint: "+(n?n.wkid:"none")+", view: "+((i=this.view.spatialReference)==null?void 0:i.wkid)+")",e)}else Ce.getLogger(this).error("#viewpoint=","Viewpoint may not be null or undefined")}get zoom(){return this.ready?B0t(this.view,this.scale):this._get("zoom")}set zoom(e){this._updatePropertyBeforeReady("zoom",e)||e===void 0||this.setStateCamera(this._zoomToCamera(e),{applyConstraints:!0})||Ce.getLogger(this).error("#zoom=","Invalid zoom",e)}_computeCanvasSize(){if(this._devicePixelRatioOverride)return this.view.state.contentPixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*this._devicePixelRatioOverride),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*this._devicePixelRatioOverride),this._tmpCanvasSize.pixelRatio=this._devicePixelRatioOverride,this._tmpCanvasSize;const e=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio),i=(this._usePhysicalPixelRendering?this._windowDevicePixelRatio:e)*this.view.resolutionScale;this._tmpCanvasSize.width=Math.round(this.view.surface.clientWidth*i),this._tmpCanvasSize.height=Math.round(this.view.surface.clientHeight*i);const r=this.view._stage.renderView.renderingContext.parameters.maxTextureSize;return KS(this._tmpCanvasSize,r),this._tmpCanvasSize.pixelRatio=this._tmpCanvasSize.width>0?this._tmpCanvasSize.width/this.view.surface.clientWidth*.5+this._tmpCanvasSize.height/this.view.surface.clientHeight*.5:i,this.view.state&&(this.view.state.contentPixelRatio=Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)),this._tmpCanvasSize}get _rasterPixelRatio(){return this._devicePixelRatioOverride!=null?this._devicePixelRatioOverride:this._usePhysicalPixelRenderingAny?this._windowDevicePixelRatio:Math.min(this._windowDevicePixelRatio,this.view.qualitySettings.maximumPixelRatio)}get _usePhysicalPixelRendering(){var e,i;return((i=(e=this.view)==null?void 0:e._stage)==null?void 0:i.renderer.isFeatureEnabled(Zo.PhysicalPixelRendering))??!1}get _usePhysicalPixelRenderingAny(){var i,r;const e=(r=(i=this.view)==null?void 0:i._stage)==null?void 0:r.renderer;return e&&(e.isFeatureEnabled(Zo.PhysicalPixelRendering,Vr.IDLE)||e.isFeatureEnabled(Zo.PhysicalPixelRendering,Vr.INTERACTING)||e.isFeatureEnabled(Zo.PhysicalPixelRendering,Vr.ANIMATING))}constructor(e){super(e),this.constraintsManager=null,this.ready=!1,this._windowDevicePixelRatio=1,this._devicePixelRatioOverride=null,this._idleTimeout=Wge,this.test={viewStateManager:this,contentCameraResetState:new Map,setDevicePixelRatio:i=>this._devicePixelRatioOverride=i,renderState:null,get maximumPixelRatio(){return this.viewStateManager.view.qualitySettings.maximumPixelRatio},get updatingIgnoreRenderState(){return this.renderState!=null},get idleTimeoutEnabled(){return this.viewStateManager._idleTimeout>0},set idleTimeoutEnabled(i){this.viewStateManager._idleTimeout=i?Wge:0}},this._propertiesPool=new x_({frustum:qw},this),this._cameraSetByUser=!1,this._gotoOperation=null,this._cameraChangeTime=0,this._tmpCanvasSize=new Ewt}initialize(){this._cameraChangeTime=performance.now(),this.addHandles([Jr(()=>this.view.state.events,"before-camera-change",e=>e&&this._updateElevation(e)),_e(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},(e,i)=>this._cameraChangedHandler(e,i),Li)]),Mo(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},e=>this._updateElevation(e),{once:!0,sync:!0}),this.addHandles([AT({prepare:()=>this._prepareFrame()}),_e(()=>this.view.state.cameraController,()=>{this._cameraSetByUser=!0,this.removeHandles(vN)}),Jr(()=>this.view.state.events,"camera-projection-changed",()=>this.notifyChange("scale"))])}destroy(){this.exit(),this._propertiesPool=et(this._propertiesPool)}init(){this.constraintsManager=new lI({view:this.view}),this._prepareFrame();const e=this._getInitialProperties();this._cameraSetByUser=!1,this._set("ready",!0);for(const i of e)this.set(i.name,i.value);if(!this._cameraSetByUser){const i=this._initialViewpoint||this.view.initialExtent;i&&this.isCompatible(i)?this._setInitialView(i):this.view.state.viewingMode===_t.Local&&this.addHandles(Mo(()=>this.view.basemapTerrain.ready,()=>{this.removeHandles(vN),this._setInitialView(this.view.dataExtent)},{once:!0,initial:!0}),vN)}}exit(){this._cancelGoToOperation(),this.ready&&(this._override("padding",this.padding),this._set("ready",!1),this._clearOverride("hasInitialView"),this._cameraSetByUser=!1,this.removeHandles(vN),this.constraintsManager=et(this.constraintsManager))}async goTo(e,i){const r={animate:!0,...i};return this._gotoOperation!=null&&this._gotoOperation.abort(r.animate),this._gotoOperation=new Twt(e,r,this.view),this.view.resourceController.scheduler.stopFrame(),this._gotoOperation.promise}debugSetCameraOnContent(){this.setStateCamera(xE(this.view),{applyConstraints:!1})}step(e){const i=this.view.state,r=i==null?void 0:i.cameraController;r&&(i.updateCamera(n=>r.stepController(e,n)),r.steppingFinished&&r.finishController())}_cancelGoToOperation(){this._gotoOperation!=null&&(this._gotoOperation.abort(),this._gotoOperation=null)}_getInitialProperties(){const e=new Set,i=[];for(const{propertyName:r,overrides:n}of Awt){const s=e.has(r),o=this._isOverridden(r);!s&&o&&i.push({name:r,value:this._get(r)}),this._clearOverride(r),(s||o)&&n.forEach(l=>e.add(l))}return i}_setInitialView(e){if(e==null||this._cameraSetByUser)return;if(e instanceof cd)return void this.setStateCamera(Tv(this.view,e),{applyConstraints:!1});if(e instanceof ih){if(e.targetGeometry instanceof Vi){const s=PF(this.view,e.targetGeometry,0,.5,ql.LOCKED);return void(s!=null&&this.setStateCamera(Tv(this.view,s),{applyConstraints:!0}))}const r={applyConstraints:!e.camera},n=this._viewpointToCamera(e);return void this.setStateCamera(n,r)}const i=PF(this.view,e,0,.5,ql.LOCKED);i!=null&&this.setStateCamera(Tv(this.view,i),{applyConstraints:!0})}_updatePropertyBeforeReady(e,i){return!this.ready&&(this._override(e,i),i&&Cwt.has(e)&&this._override("hasInitialView",!0),!0)}isCompatible(e){return e!=null&&(e instanceof ih?e.camera?this.isCompatible(e.camera):this.isCompatible(e.targetGeometry):e instanceof cd?this.isCompatible(e.position):e.spatialReference&&HI(e.spatialReference,this.view.spatialReference))}_getPreservingHeadingTilt(e=Mwt){return this._cameraSetByUser?(e.heading=this.camera.heading,e.tilt=this.camera.tilt):(e.heading=0,e.tilt=.5),e}_centerPointAtDistanceToCamera(e,i,r=gb){const{heading:n,tilt:s}=this._getPreservingHeadingTilt(),o=sae(this.view,n,s,e,i,ql.ADJUST);return o==null?null:(r.copyFrom(this.view.state.camera),r.eye=o.eye,r.center=o.center,r.up=o.up,r)}_centerToCamera(e){const i=this.view.pointsOfInterest.centerOnContent;i.runTask();const r=i.distance;return this._centerPointAtDistanceToCamera(e,r)}_extentToCamera(e){const{heading:i,tilt:r}=this._getPreservingHeadingTilt(),n=PF(this.view,e,i,r,ql.ADJUST,Hq);return n?Tv(this.view,n):null}_scaleToCamera(e){if(e==null)return null;const i=this.view.pointsOfInterest.centerOnContent;i.runTask();const r=i.renderLocation,n=i.location.latitude;if(n==null)return null;const s=xj(this.view,e,n);return this._centerPointAtDistanceToCamera(r,s)}_zoomToCamera(e){return this._scaleToCamera(hIe(this.view,e))}_viewpointToCamera(e){return Tv(this.view,p9e(this.view,e))}setStateCamera(e,i){return!(e==null||!this.view.state.stopActiveCameraController())&&(this._cameraSetByUser=!0,i.doNotCancelGoToOperation||this._cancelGoToOperation(),this.view.state.updateCamera(r=>{i.positionAndOrientationOnly?(r.eye=e.eye,r.center=e.center,r.up=e.up):r.copyFrom(e),i.applyConstraints&&wo(this.view,r)}),i.applyConstraints||(this.view.state.cameraController=new m$({view:this.view,desiredCamera:e})),!0)}_prepareFrame(){const{surface:e,canvas:i}=this.view;if(!e||!i)return;this._windowDevicePixelRatio=window.devicePixelRatio;const r=this._computeCanvasSize();if(r.width!==0&&r.height!==0&&(i.width===r.width&&i.height===r.height||(i.width=r.width,i.height=r.height),this.view.state)){const n=this.view.state.camera;n.fullWidth===r.width&&n.fullHeight===r.height&&n.pixelRatio===r.pixelRatio||(gb.copyFrom(n),gb.pixelRatio!==r.pixelRatio&&(this._paddingToArray(this.padding,r.pixelRatio,yN),gb.padding=yN),gb.fullWidth=r.width,gb.fullHeight=r.height,gb.pixelRatio=r.pixelRatio,this.view.state.camera=gb),this._updateViewState()}}_updateElevation(e){var s,o;const i=(s=this.view.basemapTerrain)==null?void 0:s.spatialReference,r=((o=this.view.renderCoordsHelper)==null?void 0:o.getAltitude(e.eye))??0,n=i?wj(this.view,e.eye):0;e.relativeElevation=r-n}_updateViewState(){this.test.renderState!=null?this.view.state.mode=this.test.renderState:this.view.animation?this.view.state.mode=Vr.ANIMATING:this.view.interacting?this.view.state.mode=Vr.INTERACTING:(this.view.state.mode===Vr.ANIMATING&&(this._cameraChangeTime=0),performance.now()-this._cameraChangeTimethis.notifyChange("isInteractive"),Yge),this.view.state.updateCamera(e=>this.stepController(0,e)),this.steppingFinished&&this.finishController()}};y([w({readOnly:!0})],yy.prototype,"isInteractive",null),y([w()],yy.prototype,"_lastInteraction",void 0),yy=y([Z("esri.views.3d.state.controllers.InteractiveController")],yy);var Dh;(function(t){t[t.CENTER=0]="CENTER",t[t.EYE=1]="EYE"})(Dh||(Dh={}));let g$=class extends yy{get _intersectionHelper(){return this.view.sceneIntersectionHelper}constructor(e){super(e),this.pivot=Dh.CENTER,this._rotScale=0,this._lastPoint=yt(),this._tmpWorldUp=W(),this._tmpViewDir=W(),this._tmpRotCurPoint=yt(),this._tmpTransf=Qe(),this._tmpAxis=W(),this._tmpPivotPoint=W(),this._pivotPos=W(),this._constraintOptions={selection:Yn.ALL,interactionType:Ki.TUMBLE,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:il.TUMBLE}}initialize(){this._rotScale=this.pivot===Dh.CENTER?3:1.5}begin(e){if(this.active){switch(this.pivot){case Dh.EYE:Ne(this._pivotPos,this.startCamera.eye),this._constraintOptions.interactionType=Ki.LOOK_AROUND,this._constraintOptions.tiltMode=il.LOOK_AROUND,this._constraintOptions.selection=Yn.NONE;break;case Dh.CENTER:{const i=this._intersectionHelper.intersectRayFreePointFallback(this.startCamera.ray,this._pivotPos,this.view.map.ground.opacity===0?AE:{});i||Ne(this._pivotPos,this.startCamera.center),this._constrainPivotPoint(e,i),this.startCamera.center=this._pivotPos,this._constraintOptions.interactionType=Ki.TUMBLE,this._constraintOptions.tiltMode=il.TUMBLE,this._constraintOptions.selection=Yn.ALL&~Yn.DISTANCE;break}}this._constraintOptions.interactionStartCamera=this.startCamera,vT(this.startCamera,e,this._lastPoint)}}_constrainPivotPoint(e,i){const r=this.startCamera,n=W();je(n,this._pivotPos,r.eye);const s=rt(n),o=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(r.eye,Xge);let l=Math.max(Math.min(Nbt,1/Math.abs(Ve(Xge,r.viewForward)))*o,Fbt);i&&(l=Math.min(s,l));const c=Sr(this.view.spatialReference),f=ss(r.width/r.pixelRatio*.5,r.height/r.pixelRatio*.5),_=qj(this.startCamera,f,c);let x=this.view._stage.renderView.getMinimalDepthForArea(NL(this.view),r.fullWidth/r.pixelRatio*.5,r.fullHeight/r.pixelRatio*.5,r,2.5*Fq,Fq),T=this.view._stage.renderView.getMinimalDepthForArea(NL(this.view),e[0],e[1],r,Fq);x==null&&T==null||(x=x??T??0,T=T==null||_===Xa.Horizontal?x:T,l=x>T?T:x,l=i?Math.min(l,s):l),Ye(n,n),Ne(this._pivotPos,Be(this._tmpPivotPoint,r.eye,De(this._tmpPivotPoint,n,l)))}update(e){if(this.active){switch(this.pivot){case Dh.EYE:this.currentCamera.center=this._applyRotation(this.currentCamera,e,this.currentCamera.center,this._pivotPos);break;case Dh.CENTER:this.currentCamera.center=this._pivotPos,this.currentCamera.eye=this._applyRotation(this.currentCamera,e,this.currentCamera.eye,this._pivotPos)}wo(this.view,this.currentCamera,this._constraintOptions),this.commitCamera()}}end(){this.active&&this.finishController()}_applyRotation(e,i,r,n){this.view.renderCoordsHelper.worldUpAtPosition(n,this._tmpWorldUp),vT(e,i,this._tmpRotCurPoint);let s=(this._lastPoint[1]-this._tmpRotCurPoint[1])*this._rotScale,o=(this._tmpRotCurPoint[0]-this._lastPoint[0])*this._rotScale;je(this._tmpViewDir,r,n);const l=rt(this._tmpViewDir),c=Ca(Ve(this._tmpViewDir,this._tmpWorldUp)/l);if(this.pivot===Dh.EYE){s*=-.5;const f=.5*Math.PI-c,_=.5*Math.PI*.99;s=f-Math.max(-_,Math.min(_,f+s))}return s=Je(s+c,Bl.min,Bl.max)-c,Wt(this._tmpAxis,e.up,this._tmpViewDir),this.pivot===Dh.CENTER&&(o=-o),xp(this._tmpTransf,o,this._tmpWorldUp),Wh(this._tmpTransf,this._tmpTransf,s,this._tmpAxis),bt(this._tmpViewDir,this._tmpViewDir,this._tmpTransf),e.up=bt(Wq,e.up,this._tmpTransf),Be(Wq,n,this._tmpViewDir),Qo(this._lastPoint,this._tmpRotCurPoint),Wq}};y([w()],g$.prototype,"pivot",void 0),g$=y([Z("esri.views.3d.state.controllers.RotateController")],g$);const Wq=W(),Xge=W();let Yq=class extends Rl{constructor(e,i,r,n){super(!0),this._view=e,this.pointerAction=i,this._pivot=r,this.registerIncoming("drag",n,s=>this._handleDrag(s))}_handleDrag(e){const i=e.data;if(i.pointers.size>1||!ole(e.data,this.pointerAction))return;const r=ss(i.center.x,i.center.y);switch(i.action){case"start":this._cameraController&&(this._cameraController.end(),this._cameraController=null),this._cameraController=new g$({view:this._view,pivot:this._pivot}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(r);break;case"update":this._cameraController&&this._cameraController.update(r);break;case"end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}e.stopPropagation()}},qte=class extends yy{constructor(){super(...arguments),this._pickPoint=W(),this._tmpP0=yt(),this._panAxisAngle=Gj(),this._tmpRayDir=W(),this._tmpRayDirPick=W(),this._targetOnSphere=W(),this._navMode=Xa.Horizontal,this._tmpRay={origin:W(),direction:W()},this.dragBeginPoint=ss(),this._normalizedAnchorPoint=yt(),this._constraintOptions={selection:Yn.ALL_EXCEPT_COLLISION,interactionType:Ki.ZOOM,interactionFactor:0,interactionStartCamera:null,interactionDirection:null,tiltMode:il.TUMBLE},this._sphere=co(),this._hasPickPoint=!1}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(e){if(!this.active)return;Qo(this.dragBeginPoint,e),vT(this.startCamera,e,this._normalizedAnchorPoint);const i=Sr(this.view.spatialReference),r=r9e(this._intersectionHelper,this.startCamera,e,i,E5.Ellipsoid,this.view.map.ground.opacity===0?AE:{});if(this._navMode=qj(this.startCamera,e,i),this._navMode===Xa.Horizontal)this._hasPickPoint=!!r.scenePickPoint,this._pickPoint=r.scenePickPoint??this._pickPoint,this._sphere=r.sphere;else{let n;SP(this.startCamera,e,this._tmpRay),Ye(this._tmpRay.direction,this._tmpRay.direction),r.scenePickPoint!=null&&(je(this._tmpRayDirPick,this.startCamera.eye,r.scenePickPoint),n=rt(this._tmpRayDirPick));const s=Math.abs(this.view.camera.position.z);this.view.renderCoordsHelper.worldUpAtPosition(this.startCamera.eye,Zge);let o=Je(Math.min(XLe,1/Math.abs(Ve(Zge,this._tmpRay.direction)))*s,OU[0],OU[1]);const l=this.view._stage.renderView.getMinimalDepthForArea(null,e[0],e[1],this.view.state.camera,Hj);o=l??o,o=n!=null?Math.min(o,n):o,this._hasPickPoint=!0,De(this._tmpRay.direction,this._tmpRay.direction,o),Be(this._pickPoint,this._tmpRay.origin,this._tmpRay.direction)}this._constraintOptions.interactionStartCamera=this.startCamera}update(e){if(this.active){if(this.currentCamera.eye=this.startCamera.eye,this.currentCamera.center=this.startCamera.center,this.currentCamera.up=this.startCamera.up,this._navMode===Xa.Horizontal){je(this._tmpRayDir,this.currentCamera.center,this.currentCamera.eye);const i=rt(this._tmpRayDir);vT(this.currentCamera,e,this._tmpP0);const r=12*(this._normalizedAnchorPoint[1]-this._tmpP0[1]);let n=i*2**r;const s=this.view.state.constraints.minimumPoiDistance;if(r<0&&n=0&&nthis.startCamera.center[2]?Px[2]=Math.max(this.startCamera.center[2],Px[2]):Px[2]=Math.min(this.startCamera.center[2],Px[2]),this.currentCamera.center=Px,this._constraintOptions.interactionFactor=um(Dm(this.dragBeginPoint,e)),wo(this.view,this.currentCamera,this._constraintOptions),this.commitCamera())}end(){this.active&&this.finishController()}};Wte=y([Z("esri.views.3d.state.controllers.local.ZoomController")],Wte);const Px=W(),Owt=nt(0,0,1);let Pwt=class extends Rl{constructor(e,i,r){super(!0),this._view=e,this.pointerAction=i,this.registerIncoming("drag",r,n=>this._handleDrag(n))}_handleDrag(e){const i=e.data;if(i.pointers.size>1||!ole(e.data,this.pointerAction))return;const r=ss(i.center.x,i.center.y);switch(i.action){case"start":this._cameraController&&(this._cameraController.end(),this._cameraController=null),this._view.state.isGlobal?this._cameraController=new qte({view:this._view}):this._cameraController=new Wte({view:this._view}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(r);break;case"update":this._cameraController&&this._cameraController.update(r);break;case"end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}e.stopPropagation()}};function f0(t){let e=t*t;return t<0&&(e*=-1),e}function Jge(t,e,i){const r=i,n=t.state,s=t.device,o=e.tiltDirection==="forward-down"?1:-1,l=1;return s.deviceType==="standard"?(r.translation[0]=f0(n.axes[0]),r.translation[1]=f0(n.axes[1]),r.translation[2]=f0(n.buttons[7])-f0(n.buttons[6]),r.heading=f0(n.axes[2]),r.tilt=f0(n.axes[3])):s.deviceType==="spacemouse"&&(r.translation[0]=1.2*f0(n.axes[0]),r.translation[1]=1.2*f0(n.axes[1]),r.translation[2]=2*-f0(n.axes[2]),r.heading=1.2*f0(n.axes[5]),r.tilt=1.2*f0(n.axes[3])),r.tilt*=o,De(r.translation,r.translation,l),r}function Kge(t,e){const i=e;return i.translation[0]=t[1]-t[0],i.translation[1]=t[3]-t[2],i.translation[2]=t[4]-t[5],i.heading=t[7]-t[6],i.tilt=t[8]-t[9],i.zoom=t[10]-t[11],i}function Xq(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let QS=class extends yy{constructor(e){super(e),this._filteredSurfaceElevation=0,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._keysButtonState=[0,0,0,0,0,0,0,0,0,0,0,0],this._tmpCamera=new ai,this._headingStart=0,this._constraintOptions={selection:Yn.ALL,interactionType:Ki.NONE,interactionStartCamera:new ai,interactionFactor:0,interactionDirection:null,tiltMode:il.LOOK_AROUND}}handleEventGamepad(e){const i=Jge(e,this.view.navigation.gamepad,this._transformation);(e.action==="end"||Xq(i))&&this.finishController()}activateDirection(e){this._keysButtonState[e]=1,Kge(this._keysButtonState,this._transformation)}deactivateDirection(e){this._keysButtonState[e]=0;const i=Kge(this._keysButtonState,this._transformation);Xq(i)&&this.finishController()}onControllerStart(e){this._filteredSurfaceElevation=this.view.pointsOfInterest.cameraOnSurface.location.z,this._headingStart=this.view.camera.heading,super.onControllerStart(e)}_updateFilteredSurfaceElevation(e){const i=this.view.pointsOfInterest.cameraOnSurface.location.z,r=1;this._filteredSurfaceElevation+=r*(i-this._filteredSurfaceElevation)*e}stepController(e,i){var r;this._updateStartHeading(),this._updateFilteredSurfaceElevation(e),this.currentCamera.copyViewFrom(i),this._updateCameraCenter(),(r=this._constraintOptions.interactionStartCamera)==null||r.copyFrom(this.currentCamera),this._calculateControlTransformation(e,this.currentCamera,Rx),this._applyDisabledMovementTypes(Rx),this._applyPan(Rx.pan),this._applyRotate(Rx.rotate),this._applyZoom(Rx.zoom),this._applyAscend(Rx.ascend),this._constraintOptions.interactionType=Ki.NONE,this._constraintOptions.selection=Yn.COLLISION,wo(this.view,this.currentCamera,this._constraintOptions),super.stepController(e,i)}_updateStartHeading(){this._transformation.heading!==0&&(this._headingStart=this.view.camera.heading)}_applyRotate(e){if(!e.enabled)return;const i=this.currentCamera;je(mu,i.center,i.eye),bt(mu,mu,e.matrix),i.center=Be(mu,mu,i.eye),i.up=bt(mu,i.up,e.matrix),this._constraintOptions.interactionType=Ki.LOOK_AROUND,this._constraintOptions.selection=Yn.ALL_EXCEPT_COLLISION,wo(this.view,i,this._constraintOptions)}_applyPan(e,i=this.currentCamera){e.enabled&&(i.eye=bt(mu,i.eye,e.matrix),i.center=bt(mu,i.center,e.matrix),this.view.state.isGlobal&&(i.up=bt(mu,i.up,e.matrix)),this._constraintOptions.interactionType=Ki.PAN,this._constraintOptions.selection=Yn.ALL,wo(this.view,i,this._constraintOptions))}_applyZoom(e){if(!e)return;const i=this.currentCamera.viewForward;this.currentCamera.eye=Be(mu,this.currentCamera.eye,De(xt.get(),i,e)),Ne(uR,i),Sc(uR,uR),this._constraintOptions.interactionDirection=uR,this._constraintOptions.interactionType=Ki.ZOOM,this._constraintOptions.selection=Yn.ALL_EXCEPT_COLLISION,wo(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_applyAscend(e){if(!e)return;const i=this.view.renderCoordsHelper.worldUpAtPosition(this.currentCamera.eye,xt.get());if(this._constraintOptions.interactionDirection=Ne(uR,i),this.view.state.isGlobal){const r=rt(this.currentCamera.eye),n=(r+e)/r;this.currentCamera.eye=De(mu,this.currentCamera.eye,n),this.currentCamera.center=De(mu,this.currentCamera.center,n)}else{const r=De(xt.get(),i,e);this.currentCamera.eye=Be(mu,this.currentCamera.eye,r),this.currentCamera.center=Be(mu,this.currentCamera.center,r)}this._updateCameraCenter(),this._constraintOptions.interactionType=Ki.ASCEND,this._constraintOptions.selection=Yn.COLLISION,wo(this.view,this.currentCamera,this._constraintOptions)&&this._updateCameraCenter(),this._constraintOptions.selection=Yn.ALL_EXCEPT_COLLISION,wo(this.view,this.currentCamera,this._constraintOptions),this._constraintOptions.interactionDirection=null}_calculateControlTransformation(e,i,r){Fwt(r);const n=this._computeVelocities(e);this.view.state.isLocal?this._calculateControlTransformationLocal(n,i,r):this._calculateControlTransformationGlobal(n,i,r)}_updateCameraCenter(){const e=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,i=this.view.renderCoordsHelper,r=this.currentCamera.ray;this.currentCamera.center=i.intersectManifoldClosestSilhouette(r,e,mu)}_calculateControlTransformationLocal(e,i,r){const{viewRight:n,viewForward:s}=i,o=this._transformation,l=this.view.navigation.gamepad,c=Ie(xt.get(),s[0],s[1],0);Ye(c,c);const f=o.translation[0]*e.pan;if(f!==0){const I=De(xt.get(),n,f);Qu(r.pan.matrix,r.pan.matrix,I),r.pan.enabled=!0}switch(l.mode){case"pan":{const I=-o.translation[1]*e.pan;if(I!==0){const L=De(xt.get(),c,I);Qu(r.pan.matrix,r.pan.matrix,L),r.pan.enabled=!0}r.zoom=o.zoom*e.zoom;break}case"zoom":r.zoom=(-o.translation[1]+o.zoom)*e.zoom;break;default:l.mode}const _=o.translation[2]*e.ascend;r.ascend=_;const x=-o.heading*e.rotate;x!==0&&(Wh(r.rotate.matrix,r.rotate.matrix,x,this.view.renderCoordsHelper.worldUpAtPosition(i.eye,xt.get())),r.rotate.enabled=!0);const T=o.tilt*e.rotate,A=q2(this.view.renderCoordsHelper,i.center,i.eye),M=Je(A+T,Bl.min,Bl.max)-A;M&&(Wh(r.rotate.matrix,r.rotate.matrix,M,n),r.rotate.enabled=!0)}_calculateControlTransformationGlobal(e,i,r){const{eye:n,viewRight:s}=i,o=this._transformation,l=this.view.navigation.gamepad,c=Wt(xt.get(),s,n);Ye(c,c),Sc(c,c),Gbt(this.startCamera,i,o,e,this.view.camera.heading,this._headingStart,this.view.camera.tilt,r,l),this._tmpCamera.copyFrom(this.currentCamera),this._applyPan(Rx.pan,this._tmpCamera);const f=this.view.pointsOfInterest.centerOnSurfaceFrequent.estimatedSurfaceAltitude,_=o.translation[2]*e.ascend;r.ascend=_;const x=-o.heading*e.rotate;x!==0&&(Wh(r.rotate.matrix,r.rotate.matrix,x,this._tmpCamera.eye),r.rotate.enabled=!0);const T=o.tilt*e.rotate,A=this._clampTiltDeltaGlobalToValidRange(T,i.ray,f);A!==0&&(Wh(r.rotate.matrix,r.rotate.matrix,A,this._tmpCamera.viewRight),r.rotate.enabled=!0),r.zoom+=o.zoom*e.zoom}_clampTiltDeltaGlobalToValidRange(e,i,r){const n=Sr(this.view.spatialReference),s=YF(Bl.min,i.origin,r,n);let o=0,l=0;const c=xt.get();if(this.view.renderCoordsHelper.intersectManifold(i,r,c)){const f=q2(this.view.renderCoordsHelper,c,i.origin);o=YF(f,i.origin,r,n),l=YF(Bl.max,i.origin,r,n)}else{gP(aj(cj,r+n.radius),i,c);const f=Math.PI+oj(i.direction,c);o=Lge(f,i.origin,r,n),l=Lge(Bl.max,i.origin,r,n)}return Je(o+e,s,l)-o}_getPointAbsoluteSurfaceElevation(e,i,r){const{renderCoordsHelper:n}=this.view,s=n.getAltitude(e),o=i+Math.abs(s-i);return n.setAltitude(r,o,e),o}_clampedDistanceToSurface(e,i){const{renderCoordsHelper:r}=this.view,{camera:n}=this.view.state,{direction:s}=$0t(this.view,i,0,b9e,Nwt),o=r.intersectManifoldClosestSilhouette(Sp(i,s),e,xt.get()),l=Sn(i,o),c=r.intersectManifoldClosestSilhouette(Sp(i,R_(xt.get(),i,n.center)),e,xt.get()),f=Sn(i,c);return Math.min(l,f)}_computeHeadingRotateRadius(e){const{renderCoordsHelper:i,state:r}=this.view,{camera:n,isGlobal:s}=r,o=i.intersectManifoldClosestSilhouette(n.ray,this._filteredSurfaceElevation,xt.get());if(s){const l=je(xt.get(),e,o),c=rt(l);De(l,l,1/c);const f=Ye(xt.get(),e),_=Ca(Ve(f,l));return c*Math.sin(Math.min(Iwt,_))}{const l=Ne(xt.get(),e);return i.setAltitude(l,this._filteredSurfaceElevation),Sn(o,l)}}_minimumAscendVelocity(){return this.view.state.constraints.collision.enabled?0:$wt}_computeVelocities(e){const i=this._filteredSurfaceElevation,r=i+Sr(this.view.spatialReference).radius,{camera:n,isGlobal:s}=this.view.state,o=xt.get(),l=this._getPointAbsoluteSurfaceElevation(n.eye,i,o),c=this._clampedDistanceToSurface(i,o),f=n.width/2,_=Qge*n.width,x=Qge*n.width,T=c*Math.tan(.5*n.fovX)/f,A=T/r,M=T/this._computeHeadingRotateRadius(o),I=l-i;return{pan:(s?A:T)*_*e,ascend:Math.max(this._minimumAscendVelocity()*e,2**(_*e/f)*I-I),zoom:2**(_*e/f)*c-c,rotate:Je(M*x,Lwt,Dwt)*e}}_applyDisabledMovementTypes(e){this.disableMovements==null||this.disableMovements.mode!==void 0&&this.view.state.viewingMode!==this.disableMovements.mode||(e.zoom=this.disableMovements.zoom?0:e.zoom,e.ascend=this.disableMovements.ascend?0:e.ascend,e.pan.enabled=!this.disableMovements.pan,this.disableMovements.pan&&Hf(e.pan.matrix),e.rotate.enabled=!this.disableMovements.rotate,this.disableMovements.rotate&&Hf(e.rotate.matrix))}static activatesFor(e,i){const r=Jge(i,e.navigation.gamepad,Rwt);return!(i.action==="end"||Xq(r))}};y([w({constructOnly:!0})],QS.prototype,"gamepadDevice",void 0),y([w({constructOnly:!0})],QS.prototype,"disableMovements",void 0),QS=y([Z("esri.views.3d.state.controllers.GamepadKeyboardController")],QS);const Rwt={translation:[0,0,0],heading:0,tilt:0,zoom:0},b9e=80,Iwt=Ei(b9e),Qge=.75,$wt=5,Lwt=Ei(30),Dwt=Ei(80),Rx={zoom:0,ascend:0,pan:{enabled:!1,matrix:Qe()},rotate:{enabled:!1,matrix:Qe()}},mu=W(),uR=W(),Nwt=rae();function Fwt(t){t.zoom=0,t.ascend=0,t.pan.enabled=!1,Hf(t.pan.matrix),t.rotate.enabled=!1,Hf(t.rotate.matrix)}let kwt=class extends Rl{constructor(e){super(!0),this._view=e,this._watchHandles=new O_,this._handle=this.registerIncoming("gamepad",i=>this._handleEventGamepad(i)),this._handle.pause()}onInstall(e){super.onInstall(e),this._watchHandles.add([_e(()=>this._view.navigation.gamepad.enabled,i=>{i?this._handle.resume():(this._handle.pause(),this._cameraControllerGamepad&&(this._cameraControllerGamepad.finishController(),this._cameraControllerGamepad=null))},ii),_e(()=>this._view.navigation.gamepad.device,i=>{this._cameraControllerGamepad&&i&&this._cameraControllerGamepad.gamepadDevice!==i&&(this._cameraControllerGamepad.finishController(),this._cameraControllerGamepad=null)})])}onUninstall(){this._watchHandles.removeAll(),super.onUninstall()}_handleEventGamepad(e){const i=this._view.navigation.gamepad.device;if(i&&e.data.device!==i)return;const r=this._cameraControllerGamepad&&this._cameraControllerGamepad.active;if(r||QS.activatesFor(this._view,e.data)){if(!r){const n=new QS({view:this._view,gamepadDevice:e.data.device});this._view.state.switchCameraController(n)&&(this._cameraControllerGamepad=n)}this._cameraControllerGamepad&&this._cameraControllerGamepad.active&&this._cameraControllerGamepad.gamepadDevice===e.data.device&&this._cameraControllerGamepad.handleEventGamepad(e.data)}}};function zwt(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),{remove:()=>document.addEventListener("visibilitychange",e)}}var Ch;(function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.FORWARD=2]="FORWARD",t[t.BACKWARD=3]="BACKWARD",t[t.UP=4]="UP",t[t.DOWN=5]="DOWN",t[t.HEADINGLEFT=6]="HEADINGLEFT",t[t.HEADINGRIGHT=7]="HEADINGRIGHT",t[t.TILTUP=8]="TILTUP",t[t.TILTDOWN=9]="TILTDOWN",t[t.ZOOMIN=10]="ZOOMIN",t[t.ZOOMOUT=11]="ZOOMOUT"})(Ch||(Ch={}));let Uwt=class extends Rl{constructor(e,i){super(!0),this._view=e,this._disableMovements={pan:!0,zoom:!1,ascend:!0,rotate:!1,mode:_t.Local},this._keyToNumber={[i.left]:Ch.LEFT,[i.right]:Ch.RIGHT,[i.forward]:Ch.FORWARD,[i.backward]:Ch.BACKWARD,[i.up]:Ch.UP,[i.down]:Ch.DOWN,[i.headingLeft]:Ch.HEADINGLEFT,[i.headingRight]:Ch.HEADINGRIGHT,[i.tiltUp]:Ch.TILTUP,[i.tiltDown]:Ch.TILTDOWN,[i.zoomIn]:Ch.ZOOMIN,[i.zoomOut]:Ch.ZOOMOUT},this.registerIncoming("key-down",null,r=>this._handleKeyDown(r)),this.registerIncoming("key-up",null,r=>this._handleKeyUp(r)),this.registerIncoming("blur",null,()=>this._handleStop()),this._visibilityHandle=zwt(r=>r?null:this._handleStop())}onUninstall(){var e;(e=this._visibilityHandle)==null||e.remove(),this._handleStop()}_handleKeyDown(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const i=this._keyToNumber[e.data.key];i!=null&&(this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active||(this._cameraControllerKeyboard=new QS({view:this._view,disableMovements:this._disableMovements}),this._view.state.switchCameraController(this._cameraControllerKeyboard)),this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.activateDirection(i),e.stopPropagation()))}_handleStop(){var e;(e=this._cameraControllerKeyboard)!=null&&e.active&&(this._cameraControllerKeyboard.finishController(),this._cameraControllerKeyboard=null)}_handleKeyUp(e){if(e.data.native.ctrlKey||e.data.native.metaKey)return;const i=this._keyToNumber[e.data.key];i!=null&&this._cameraControllerKeyboard&&this._cameraControllerKeyboard.active&&(this._cameraControllerKeyboard.deactivateDirection(i),e.stopPropagation())}},Vwt=class extends Rl{constructor(e,i){super(!0),this._view=e,this.registerIncoming("mouse-wheel",i,r=>this._handleMouseWheel(r))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled)return;const i=e.data;this._cameraController&&this._cameraController.active||(this._cameraController=this._view.state.isGlobal?new $U({view:this._view,mode:"interaction"}):new LU({view:this._view,mode:"interaction"}),this._view.state.switchCameraController(this._cameraController)),this._cameraController.zoomStep(-1/60*i.deltaY,ss(i.x,i.y)),e.preventDefault(),e.stopPropagation()}},FU=class{constructor(e){this._gain=e}reset(e){this._value=e}set gain(e){this._gain=e}get value(){return this._value===void 0?0:this._value}update(e){this._value===void 0?this._value=e:this._value=this._gain*e+(1-this._gain)*this._value}},ZT=class extends $L{constructor(){super(...arguments),this._beginCamera=new ai,this._elapsedTimeSec=0,this.constraintOptions={selection:Yn.ALL,interactionType:Ki.PAN,interactionFactor:0,interactionStartCamera:new ai,interactionDirection:null,tiltMode:il.TUMBLE}}initialize(){this.constraintOptions.interactionType=this.interactionType,this.viewAnimation=new b5}get steppingFinished(){return this.momentum.isFinished(this._elapsedTimeSec)}onControllerStart(e){this._beginCamera.copyFrom(e),this.constraintOptions.interactionStartCamera=this._beginCamera,super.onControllerStart(e)}stepController(e,i){i.copyViewFrom(this._beginCamera),this._elapsedTimeSec+=e,this.momentumStep(this._elapsedTimeSec,i),wo(this.view,i,this.constraintOptions)}};ZT=y([Z("esri.views.3d.state.controllers.momentum.MomentumController")],ZT);let y$=class extends ZT{constructor(e){super(e),this.interactionType=Ki.PAN,this._tmpPan=W()}momentumStep(e,i){const r=this.momentum.value(e);De(this._tmpPan,this.momentum.direction,r),i.eye=je(eye,i.eye,this._tmpPan),i.center=je(eye,i.center,this._tmpPan),this.constraintOptions.interactionDirection=this._tmpPan}};y([w({constructOnly:!0})],y$.prototype,"momentum",void 0),y$=y([Z("esri.views.3d.state.controllers.momentum.PanPlanarMomentumController")],y$);const eye=W(),Bwt=W(),bN=W();let KF=class extends ZT{constructor(e){super(e),this.interactionType=Ki.PAN}momentumStep(e,i){const r=this.momentum.value1(e),n=this.momentum.value2(e);Ne(bN,i.eye),Ye(bN,bN),Wt(this.momentum.axis2,bN,this.momentum.axis1),a9e(i,Bwt,this.momentum.axis1,r,this.momentum.axis2,n)}};y([w({constructOnly:!0})],KF.prototype,"momentum",void 0),KF=y([Z("esri.views.3d.state.controllers.momentum.PanSphericalMomentumController")],KF);let $S=class extends ZT{set center(e){this._set("center",Xr(e))}set axis(e){this._set("axis",Xr(e))}constructor(e){super(e),this.interactionType=Ki.TUMBLE}momentumStep(e,i){const r=this.momentum.value(e);W2(i,this.center,LL(this.axis,r))}};y([w({constructOnly:!0})],$S.prototype,"momentum",void 0),y([w({constructOnly:!0})],$S.prototype,"center",null),y([w({constructOnly:!0})],$S.prototype,"axis",null),$S=y([Z("esri.views.3d.state.controllers.momentum.MomentumController")],$S);let NM=class extends ZT{set zoomCenter(e){this._set("zoomCenter",Xr(e))}constructor(e){super(e),this.interactionType=Ki.ZOOM,this.constraintOptions.interactionDirection=W()}momentumStep(e,i){const{interactionDirection:r}=this.constraintOptions;if(!r)return;Ne(r,i.eye);const n=this.momentum.valueDelta(0,e);rle(i,this.zoomCenter,n,this.view.state.constraints.minimumPoiDistance),R_(r,i.eye,r)}};y([w({constructOnly:!0})],NM.prototype,"momentum",void 0),y([w({constructOnly:!0})],NM.prototype,"zoomCenter",null),NM=y([Z("esri.views.3d.state.controllers.momentum.ZoomPlanarMomentumController")],NM);let J3=class extends ZT{set screenCenter(e){this._set("screenCenter",ss(e[0],e[1]))}set sceneCenter(e){this._set("sceneCenter",Xr(e))}constructor(e){super(e),this.interactionType=Ki.ZOOM,this.radius=0,this._tmpSceneCenter=W(),this._tmpZoomAxisAngle=Gj(),this._sphere=co()}initialize(){this._sphere[3]=this.radius}momentumStep(e,i){const r=this.momentum.valueDelta(0,e);t9e(this._sphere,i,r),this.constraintOptions.interactionType=Ki.ZOOM,wo(this.view,i,this.constraintOptions),DL(this._sphere,i,this.screenCenter,this._tmpSceneCenter),Qae(this.sceneCenter,this._tmpSceneCenter,this._tmpZoomAxisAngle),W2(i,this._sphere,this._tmpZoomAxisAngle),this.constraintOptions.interactionType=Ki.PAN}};y([w({constructOnly:!0})],J3.prototype,"momentum",void 0),y([w({constructOnly:!0})],J3.prototype,"screenCenter",null),y([w({constructOnly:!0})],J3.prototype,"sceneCenter",null),y([w({constructOnly:!0})],J3.prototype,"radius",void 0),J3=y([Z("esri.views.3d.state.controllers.momentum.ZoomSphericalMomentumController")],J3);let hm=class{constructor(e){this._gain=e,this.lastValue=void 0,this.filteredDelta=void 0}update(e){if(this.hasLastValue()){const i=this.computeDelta(e);this._updateDelta(i)}this.lastValue=e}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(e){return this.lastValue===void 0?NaN:e-this.lastValue}_updateDelta(e){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*e:this.filteredDelta=e}},Yj=class{constructor(e,i,r){this._initialVelocity=e,this._stopVelocity=i,this._friction=r,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,i){const r=this.value(e);return this.value(e+i)-r}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const r=1-this.friction;return e*(r**i-1)/Math.log(r)}},jwt=class extends Yj{constructor(e,i,r,n,s){super(e,i,r),this._sceneVelocity=n,this.direction=s}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}},w9e=class{constructor(e=300,i=12,r=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=r,this.enabled=!0,this._time=new hm(.6),this._screen=[new hm(.4),new hm(.4)],this._scene=[new hm(.6),new hm(.6),new hm(.6)],this._tmpDirection=W()}add(e,i,r){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(r)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[2]),this._time.update(r)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,i=this._screen[1].filteredDelta,r=e==null||i==null?0:Math.sqrt(e*e+i*i),n=this._time.filteredDelta,s=n==null||r==null?0:r/n;return Math.abs(s)0&&De(this._tmpDirection,this._tmpDirection,1/n);const s=this._time.filteredDelta;return new jwt(e,i,r,s==null?0:n/s,this._tmpDirection)}},tye=class{constructor(e){this._gain=e}update(e){this.filteredValue!==void 0?this.filteredValue=(1-this._gain)*this.filteredValue+this._gain*e:this.filteredValue=e}reset(){this.filteredValue=void 0}get hasFilteredValue(){return this.filteredValue!==void 0}};const iye=1e-5;let Gwt=class extends Yj{constructor(e,i,r,n,s,o=0,l){super(e,i,r),this._angularVelocity1=n,this.axis1=s,this.angularVelocity2=o,this.axis2=l}value1(e){return super.valueFromInitialVelocity(this._angularVelocity1,e)}value2(e){return super.valueFromInitialVelocity(this.angularVelocity2,e)}},Hwt=class{constructor(e=300,i=12,r=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=r,this.enabled=!0,this._tmpAxis1=W(),this._tmpAxis2=W(),this._tmpAngles=yt(),this._time=new hm(.3),this._screen=[new hm(.4),new hm(.4)],this._angle1=new tye(.6),this._angle2=new tye(.6),this._axis1=W(),this._axis2=W(),this._lastScene=W()}addMomentumDirectRotation(e,i,r,n,s,o){if(this.enabled){if(this._time.hasLastValue()){if(this._time.computeDelta(r)<.01)return;let l=s9e(this._lastScene,i,this._tmpAxis2,n,s,o);this._angle2.update(0),El(this._tmpAxis2)Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;e=r+n}super.add(e,i)}},qwt=class extends Yj{constructor(e,i,r){super(e,i,r)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const r=super.value(e),n=super.value(e+i)-r;return Math.exp(n)}},T9e=class extends x9e{constructor(e=2.5,i=.01,r=.95,n=12){super(e,i,r,n)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,r){return new qwt(e,i,r)}},Yte=class extends yy{constructor(){super(...arguments),this._smoothRotation=new FU(.05),this._rotationAxis=W(),this._beginAngle=0,this._beginHeading=0,this._panningPlane=Fi(),this._beginRadius=0,this._smoothScaling=new FU(.05),this._zoomCenterScreen=ss(),this._zoomMomentumEstimator=new T9e,this._rotationMomentumEstimator=new S9e,this._panSphericalMomentumEstimator=new Hwt,this._panPlanarMomentumEstimator=new w9e,this._adjustedSphere=co(),this._tmp3d=W(),this._tmpScreenPointArray=ss(),this._beginScreenPoint=ss(),this._beginScenePoint=W(),this._screenPickPoint=ss(),this._scenePickPoint=W(),this._mode=Xa.Horizontal,this._sphere=co(),this._pointerCount=0,this._tmpInteractionDirection=W(),this._constraintOptions={selection:Yn.ALL,interactionType:Ki.NONE,interactionFactor:0,interactionStartCamera:new ai,interactionDirection:null,tiltMode:il.TUMBLE}}get _intersectionHelper(){return this.view.sceneIntersectionHelper}begin(e){var s;if(!this.active)return;const i=this.view.navigation.momentumEnabled;this._zoomMomentumEstimator.enabled=i,this._rotationMomentumEstimator.enabled=i,this._panPlanarMomentumEstimator.enabled=i,this._panSphericalMomentumEstimator.enabled=i,this._beginHeading=-k2.normalize(Ei(this.view.camera.heading)),this._beginRadius=e.radius,this._pointerCount=e.pointers.size,this._beginAngle=e.angle,this._smoothRotation.reset(),dm(e.center,this._screenPickPoint),Qo(this._beginScreenPoint,this._screenPickPoint);const r=Sr(this.view.spatialReference),n=r9e(this._intersectionHelper,this.startCamera,this._screenPickPoint,r,E5.Silhouette,this.view.map.ground.opacity===0?AE:{});n.scenePickPoint!=null&&(this._scenePickPoint=n.scenePickPoint,this._sphere=n.sphere,Ne(this._beginScenePoint,this._scenePickPoint),this._mode=qj(this.startCamera,this._screenPickPoint,r),this._mode===Xa.Vertical&&this._preparePlanarPanMode(e,n.hasGeometryIntersection),(s=this._constraintOptions.interactionStartCamera)==null||s.copyFrom(this.startCamera))}update(e){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=e.pointers.size>1;this._mode===Xa.Horizontal?(i&&this._zoomSpherical(e),this._panningSpherical(e),i&&this._rotateSpherical(e)):(i&&this._zoomPlanar(e),this._panningPlanar(e),i&&this._rotatePlanar(e)),this.commitCamera()}end(e){e.pointers.size===this._pointerCount&&this.update(e),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return this._mode===Xa.Horizontal?new J3({view:this.view,momentum:i,screenCenter:this._zoomCenterScreen,sceneCenter:this._beginScenePoint,radius:this._sphere[3]}):new NM({view:this.view,momentum:i,zoomCenter:this._beginScenePoint});const r=this._rotationMomentumEstimator.evaluateMomentum();if(r)return new $S({view:this.view,momentum:r,center:this._sphere,axis:this._rotationAxis});if(this._mode===Xa.Horizontal){const n=this._panSphericalMomentumEstimator.evaluateMomentum();if(n)return new KF({view:this.view,momentum:n})}else{const n=this._panPlanarMomentumEstimator.evaluateMomentum();if(n)return new y$({view:this.view,momentum:n})}return null}_preparePlanarPanMode(e,i){const r=Sc(this._tmp3d,this.startCamera.viewForward);z_(this._scenePickPoint,r,this._panningPlane);const n=ss(this._screenPickPoint[0],0),s=W(),o=rt(this.startCamera.eye);this._adjustedSphere[3]=o=Wwt.ANGLE_THRESHOLD?Xa.Horizontal:Xa.Vertical;const f=Math.min(QLe,1/Math.abs(Ve(o,this.startCamera.viewForward)))*Math.max(Math.abs(this.view.camera.position.z),e9e);xQ(this._planeHorizontal,this._planeHorizontal,r),this.startCamera.aboveGround||SQ(this._planeHorizontal,this._planeHorizontal);const _=W(),x=W(),T=W();je(_,r,this.currentCamera.eye);const A=rt(_);if(Ye(_,_),this._panMode===Xa.Vertical){De(o,o,l),je(this._planeVertical,s,o),Ye(this._planeVertical,this._planeVertical),xQ(this._planeVertical,this._planeVertical,r);const I=this.view._stage.renderView.getMinimalDepthForArea(NL(this.view),this._beginCenterScreen[0],this._beginCenterScreen[1],this.view.state.camera,Hj);let L=I??f;L=n?Math.min(L,A):L,Ne(T,Be(x,this.currentCamera.eye,De(x,_,L))),this._planeVertical[3]=-Ve(this._planeVertical,T),this._computePlanePoints(e.pointers,this._planeVertical,this.startCamera,this._tmpPoints),kq(this._tmpPoints,this._beginCenter)}else{const I=n?A:f;Ne(T,Be(x,this.currentCamera.eye,De(x,_,I))),this._planeHorizontal[3]=-Ve(this._planeHorizontal,T),this._computePlanePoints(e.pointers,this._planeHorizontal,this.startCamera,this._tmpPoints),kq(this._tmpPoints,this._beginCenter)}(M=this._constraintOptions.interactionStartCamera)==null||M.copyFrom(this.startCamera)}update(e){if(!this.active)return;this.currentCamera.copyFrom(this.startCamera);const i=e.pointers.size>1,r=this._panMode===Xa.Horizontal?this._planeHorizontal:this._planeVertical,n=this._beginCenter;if(i){const s=this._beginRadius/e.radius,o=.001875*Math.min(Math.max(e.radius,40),120);this._scalingValueSmooth.gain=o,this._scalingValueSmooth.update(s),rle(this.currentCamera,n,this._scalingValueSmooth.value,this.view.state.constraints.minimumPoiDistance),this._zoomMomentumEstimator.add(this._scalingValueSmooth.value,.001*e.timestamp),this._constraintOptions.interactionType=Ki.ZOOM,this._constraintOptions.interactionFactor=um(Math.abs(e.radius-this._beginRadius)),wo(this.view,this.currentCamera,this._constraintOptions)}if(this._computePlanePoints(e.pointers,r,this.currentCamera,this._tmpPoints),kq(this._tmpPoints,this._tmpCentroid3d),dm(e.center,this._tmpCentroid2d),n9e(this.currentCamera,n,this._tmpCentroid3d),this._panMomentumEstimator.add(this._tmpCentroid2d,this._tmpCentroid3d,.001*e.timestamp),this._constraintOptions.interactionType=Ki.PAN,this._constraintOptions.interactionFactor=um(Dm(this._beginCenterScreen,this._tmpCentroid2d)),wo(this.view,this.currentCamera,this._constraintOptions),i){const s=this._planeHorizontal,o=n,l=this._rotationValueSmooth.value,c=l+jte(e.angle-l),f=.00125*Math.min(Math.max(e.radius,40),120);this._rotationValueSmooth.gain=f,this._rotationValueSmooth.update(c);const _=this._rotationValueSmooth.value-this._beginAngle;this._rotationMomentumEstimator.add(_,.001*e.timestamp),W2(this.currentCamera,o,LL(s,_)),this._constraintOptions.interactionType=Ki.TUMBLE,this._constraintOptions.interactionFactor=um(Math.abs(e.radius*_)),wo(this.view,this.currentCamera,this._constraintOptions)}this.commitCamera()}end(e){e.pointers.size===this._pointerCount&&this.update(e),this.finishController();const i=this._zoomMomentumEstimator.evaluateMomentum();if(i)return new NM({view:this.view,momentum:i,zoomCenter:this._beginCenter});const r=this._rotationMomentumEstimator.evaluateMomentum();if(r)return new $S({view:this.view,momentum:r,center:this._beginCenter,axis:this._planeHorizontal});const n=this._panMomentumEstimator.evaluateMomentum();return n?new y$({view:this.view,momentum:n}):null}_computePlanePoints(e,i,r,n){n.length=e.size;const s=this._tmp2d;let o=0;return e.forEach(l=>{s[0]=l.x,s[1]=l.y,n[o]===void 0&&(n[o]=W()),Gte(i,r,s,n[o]),o+=1}),n}get _intersectionHelper(){return this.view.sceneIntersectionHelper}};Xte=y([Z("esri.views.3d.state.controllers.local.PinchAndPanController")],Xte);let nye=class extends Rl{constructor(e,i,r){super(!0),this._view=e,this.pointerAction=i,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming("drag",r,n=>this._handleDrag(n))}_handleDrag(e){if(e.data.pointerType==="mouse"&&!ole(e.data,this.pointerAction))return;const i=e.timestamp-this._lastEndTimestamp,r=40,n=this._momentum&&this._momentum.active&&i2&&(this._controller.update(e.data),this._lastTimestamp=e.timestamp):this._startController(e);break;case"end":case"removed":this._endController(e,!0);break;case"added":this._endController(e,!1),this._startController(e)}e.stopPropagation()}_endController(e,i){if(this._controller&&this._controller.active){this._lastEndTimestamp=e.timestamp;const r=this._controller.end(e.data);i&&r&&(this._momentum=r,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(e){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(e.data),this._lastTimestamp=e.timestamp}_createController(){return this._view.state.isGlobal?new Yte({view:this._view}):new Xte({view:this._view})}},Ywt=class extends Rl{constructor(e,i){super(!0),this.view=e,this.registerIncoming("pointer-down",i,()=>this.view.state.stopActiveCameraController())}},E9e=class extends Rl{constructor(e,i){super(!0),this.key=e,this.registerIncoming("key-down",i,r=>this._handleKeyDown(r))}_handleKeyDown(e){e.data.key===this.key&&(this.activate(),e.stopPropagation())}},Xwt=class extends E9e{constructor(e,i,r){super(i,r),this.view=e}activate(){this.view.goTo({heading:0}).catch(()=>{})}},Zwt=class extends E9e{constructor(e,i,r){super(i,r),this.view=e}activate(){this.view.goTo({tilt:0}).catch(()=>{})}},Jwt=class extends Rl{constructor(e,i=!1){super(!0),this._view=e,this._invert=i,this.registerIncoming("vertical-two-finger-drag",r=>this._handleTwoFinger(r))}_handleTwoFinger(e){var n,s,o;const i=this._invert?-1:1,r=ss(0,e.data.delta*i);switch(e.data.action){case"begin":(n=this._cameraController)==null||n.end(),this._cameraController=new g$({view:this._view,pivot:Dh.CENTER}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(r);break;case"update":(s=this._cameraController)==null||s.update(r);break;case"end":(o=this._cameraController)==null||o.end(),this._cameraController=null}}};function sye(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>e2t(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Kwt(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,l=o.index,c=this._inputDevices[l];c&&(this._emitGamepadEvent(o,sye(c),!1),this._inputDevices.splice(l,1),this._latestUpdate.splice(l,1),this._input.gamepad.devices.remove(c),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const r="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=r&&n,this.supported&&(this._forEachGamepad(s=>this._connectGamepad(s)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(e){this._hasEventListeners!==e&&(this._hasEventListeners=e,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(e){this._callback=e}_connectGamepad(e){const i=new cae(e);i.deviceType!=="unknown"&&(this._inputDevices[e.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=AT({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const e=document.hasFocus(),i=this._element.contains(document.activeElement),r=this._input.gamepad.enabledFocusMode==="document"&&!e||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],l=sye(s),c=r||Qwt(l);o&&(o.timestamp===n.timestamp||!o.active&&c||Kwt(o.state,l))||this._emitGamepadEvent(n,l,!c)})}_forEachGamepad(e){const i=window.navigator.getGamepads();for(let r=0;r{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new t2t(e,this._input),this._gamepadSource.onEvent=r=>this._callback("gamepad",r)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=et(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const r=this._active[i];this._element.removeEventListener(Zq[i],r),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&Zq[i]){const r=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(Zq[i],r),this._active[i]=r}}),this._gamepadSource.hasEventListeners=(e==null?void 0:e.has("gamepad"))??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?cC.touchNone:cC.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?cC.touchPan:cC.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(cC.touchNone),this._element.classList.remove(cC.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const r=xIe(this._element,e);return A9e.test.disableSubpixelCoordinates&&(r.x=Math.round(r.x),r.y=Math.round(r.y)),i.x=r.x,i.y=r.y,i}_handleKey(e,i){const r=rmt(i);r&&e==="key-up"&&this._keyDownState.delete(r);const n={native:i,key:r,repeat:!!r&&this._keyDownState.has(r)};r&&e==="key-down"&&this._keyDownState.add(n.key),this._callback(e,n)}_handlePointer(e,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,r)}_handlePointerPreventDefault(e,i){const r=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(e,r)}_handleMouseWheel(e,i){let r=i.deltaY;switch(i.deltaMode){case 0:oye&&(r=r/document.documentElement.clientHeight*600);break;case 1:r*=30;break;case 2:r*=900}oye?r*=.7:i2t||n2t?r*=.6:r2t&&(r*=1.375);const n=100,s=Math.abs(r);s>n&&(r=r/s*200/(1+Math.exp(-.02*(s-n))));const o=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:r});this._callback(e,o)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const r={native:i};i.preventDefault(),this._callback(e,r)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};C9e.test={disableSubpixelCoordinates:!1};const Zq={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};let s2t=class extends Rl{constructor(){super(!0),this.registerIncoming("context-menu",e=>{e.data.native.preventDefault()})}};const sp={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function Zte(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function o2t(t,e){const i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)}function a2t(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:Ku()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[k,U]=t,[j,H]=[U.x-k.x,U.y-k.y];return e.radius=Math.sqrt(j*j+H*H)/2,e.center.x=(k.x+U.x)/2,e.center.y=(k.y+U.y)/2,e}let i=0,r=0;for(let k=0;kk.x-i),s=t.map(k=>k.y-r);let o=0,l=0,c=0,f=0,_=0,x=0,T=0;for(let k=0;k{r.initialAngle=QF(r,i)-e,r.lastAngle=QF(r,i)-e})}_emitEvent(e,i,r){const n=wN(this._activePointerMap);this._drag.emit(this._createPayload(e,i,n,r),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(e){const i=e.data.native.pointerId,r=e.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(e.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",e.data,r),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",e.data,e.timestamp)))}_handlePointerDrag(e){const i=e.data,r=i.currentEvent,n=e.timestamp;switch(i.action){case"start":case"update":this._isDragging?this._activePointerMap.has(r.native.pointerId)?(this._updatePointer(r),!this._isCurrentDragSuppressed&&this._emitEvent("update",r,n)):(this._addPointer(r),this._emitEvent("added",r,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(r),this._pointerType=e.data.startEvent.pointerType,this._mouseButton=e.data.startEvent.button,this._startStateModifiers=e.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",r,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function M9e(t){const e=[];return t.forEach(i=>{e.push(Ku(i.event.x,i.event.y))}),a2t(e)}function wN(t){const e=M9e(t);let i=0;return t.forEach(r=>{let n=QF(r,e),s=n-r.lastAngle;for(;s>Math.PI;)s-=2*Math.PI;for(;s<-Math.PI;)s+=2*Math.PI;n=r.lastAngle+s,r.lastAngle=n;const o=n-r.initialAngle;i+=o}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function c2t(t){const e=new Map;return t.forEach((i,r)=>e.set(r,i.event)),e}function QF(t,e){const i=t.event,r=i.x-e.center.x,n=i.y-e.center.y;return Math.atan2(n,r)}var lye;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(lye||(lye={}));let u2t=class extends Rl{constructor(e=sp.maximumDoubleClickDelay,i=sp.maximumDoubleClickDistance,r=sp.maximumDoubleTouchDelay,n=sp.maximumDoubleTouchDistance,s=m9){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(e=>{e.immediateDoubleClick&&e.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(e){const i=e.data,r=v$(i);if(!this._pointerState.has(r)){const n={downButton:i.native.button,x:i.x,y:i.y,immediateDoubleClick:null};this._pointerState.set(r,n),this.startCapturingPointer(i.native)}}_handlePointerUp(e){const i=e.data,r=v$(i),n=this._pointerState.get(r);if(n&&n.downButton===i.native.button){const s=n.immediateDoubleClick,o=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),Zte(s,e.data)>o?this._startImmediateDoubleClick(e,n):(this._immediateDoubleClick.emit(e.data,void 0,s.modifiers),this._removeState(i))):Zte(n,e.data)>o?this._removeState(i):this._startImmediateDoubleClick(e,n)}}_startImmediateDoubleClick(e,i){const r=e.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:e.data.x,y:e.data.y,modifiers:e.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(e.data),r)}}_removeState(e){const i=v$(e);this._pointerState.delete(i),this.stopCapturingPointer(e.native),this.refreshHasPendingInputs()}},h2t=class extends Rl{constructor(e=sp.maximumClickDelay,i=sp.movementUntilMouseDrag,r=sp.movementUntilPenDrag,n=sp.movementUntilTouchDrag,s=sp.holdDelay,o=m9){super(!1),this._maximumClickDelay=e,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=r,this._movementUntilTouchDrag=n,this._holdDelay=s,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",l=>{this._handlePointerLoss(l,"pointer-up")}),this.registerIncoming("pointer-capture-lost",l=>{this._handlePointerLoss(l,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",l=>{this._handlePointerLoss(l,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(e=>{e.holdTimeout=en(e.holdTimeout)}),super.onUninstall()}_handlePointerDown(e){const i=e.data,r=i.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(r);if(o){if(!o.isDragging){const l=o.previousEvent;this._pointerHold.emit(l,void 0,e.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const s={startEvent:i,previousEvent:i,startTimestamp:e.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(r,s),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(e)}_createPointerDragData(e,i,r){return{action:e,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:r}}_handlePointerMove(e){const i=e.data,r=i.native.pointerId,n=this._pointerState.get(r);n&&(n.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",n,i),void 0,n.modifiers):o2t(i,n.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(e),n.previousEvent=i)}_getDragThreshold(e){switch(e){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(e){const i=e.data,r=i.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=e.modifiers,n.isDragging=!0,r===n.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",n,i)):this._pointerDrag.emit(this._createPointerDragData("start",n,n.previousEvent),e.timestamp))})}_handlePointerLoss(e,i){const r=e.data,n=r.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",s,i==="pointer-up"?r:s.previousEvent),void 0,s.modifiers):i==="pointer-up"&&s.downButton===r.native.button&&e.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(r),this._pointerState.delete(n),this.stopCapturingPointer(r.native),this._pointerState.size===0&&this._moveHandle.pause())}},d2t=class extends Rl{constructor(e=sp.maximumDoubleClickDelay,i=sp.maximumDoubleClickDistance,r=sp.maximumDoubleTouchDelay,n=sp.maximumDoubleTouchDistance,s=m9){super(!1),this._maximumDoubleClickDelay=e,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=r,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",this._handleImmediateClick.bind(this)),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this))}onUninstall(){this._pointerState.forEach(e=>e.doubleClickTimer=en(e.doubleClickTimer))}get hasPendingInputs(){return rp(this._pointerState,e=>e.doubleClickTimer!=null)}_clearDoubleClickTimer(e,i){const r=this._pointerState.get(e);r&&(r.doubleClickTimer=en(r.doubleClickTimer),i&&this._click.emit(r.event.data,void 0,r.event.modifiers),this._pointerState.delete(e),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(e){const i=this._pointerState.get(e);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(e),this.refreshHasPendingInputs()}_getPointerId(e){const{pointerId:i,pointerType:r,button:n}=e.native;return r==="mouse"?`${i}:${n}`:`${r}`}_handleImmediateClick(e){const i=e.data,{pointerType:r}=i.native,n=this._getPointerId(i);if(!this._pointerState.has(n))return void this._startClick(e);const s=this._pointerState.get(n),{data:o,modifiers:l}=s.event,c=r==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;Zte(o,i)>c?(this._clearDoubleClickTimer(n,!0),this._startClick(e)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,l))}_handlePointerDown(e){const i=v$(e.data),r=this._pointerState.get(i);r&&(r.pointerDownCount+=1)}_startClick(e){const{data:i}=e,{native:{pointerType:r}}=i,n=v$(i),s=r==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s),l=1;this._pointerState.set(n,{event:e,doubleClickTimer:o,pointerDownCount:l}),this.refreshHasPendingInputs()}},p2t=class{constructor(e){this._callbacks=e,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(e){const i=e.data,r=i.pointers.size;switch(i.action){case"start":this._currentCount=r,this._emitStart(e);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(e);break;case"update":this._emitUpdate(e);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=r,this._emitStart(e);break;case"end":this._emitEnd(e),this._currentCount=0}this._previousEvent=e}_emitStart(e){var i,r;this._startEvent=e,(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,e)&&this._callbacks.start(this._currentCount,e,this._startEvent)}_emitUpdate(e){var i,r;(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,e)&&this._callbacks.update(this._currentCount,e,this._startEvent)}_emitEnd(e){var i,r;(r=(i=this._callbacks).condition)!=null&&r.call(i,this._currentCount,e)&&this._callbacks.end(this._currentCount,e,this._startEvent),this._startEvent=null}},f2t=class extends Rl{constructor(e=20,i=40){super(!1),this._threshold=e,this._maxDelta=i,this._state="ready",this._emittedArtificalEnd2=!1,this._vertical=this.registerOutgoing("vertical-two-finger-drag"),this._artificalDrag=this.registerOutgoing("drag"),this._dragEventSeparator=new p2t({start:(r,n)=>this._observeStart(r,n),update:(r,n,s)=>this._observeUpdate(r,n,s),end:(r,n)=>this._observeEnd(n)}),this.registerIncoming("drag",r=>this._dragEventSeparator.handle(r))}get failed(){return this._state==="failed"}_observeStart(e,i){e===1&&this._emittedArtificalEnd2&&(this._emittedArtificalEnd2=!1,this._artificalDrag.emit({action:"start",button:i.data.button,buttons:i.data.buttons,pointerType:i.data.pointerType,timestamp:i.data.timestamp,pointers:i.data.pointers,pointer:i.data.pointer,angle:i.data.angle,radius:i.data.radius,center:i.data.center}),i.stopPropagation()),this._state=e===2?"ready":"failed"}_observeUpdate(e,i,r){if(this._state!=="failed"&&e===2)return this._state==="active"?(this._vertical.emit({delta:i.data.center.y-this._thresholdReachedCenter.y,action:"update"}),void i.stopPropagation()):void(this._checkMovementWithinLimits(i.data,r.data)?this._checkVerticalThresholdReached(i.data,r.data)&&(this._state="active",this._emittedArtificalEnd2=!0,this._thresholdReachedCenter=i.data.center,this._artificalDrag.emit({action:"end",button:i.data.button,buttons:i.data.buttons,pointerType:i.data.pointerType,timestamp:i.data.timestamp,pointers:i.data.pointers,pointer:i.data.pointer,angle:i.data.angle,radius:i.data.radius,center:i.data.center}),this._vertical.emit({delta:i.data.center.y-this._thresholdReachedCenter.y,action:"begin"}),i.stopPropagation()):this._state="failed")}_observeEnd(e){this._state==="active"&&(this._vertical.emit({delta:e.data.center.y-this._thresholdReachedCenter.y,action:"end"}),this._state="ready",e.stopPropagation())}_checkMovementWithinLimits(e,i){let r=-1/0,n=1/0,s=-1/0,o=1/0;for(const{x:I,y:L}of i.pointers.values())r=Math.max(r,I),n=Math.min(n,I),s=Math.max(s,L),o=Math.min(o,L);let l=-1/0,c=1/0,f=-1/0,_=1/0;for(const{x:I,y:L}of e.pointers.values())l=Math.max(l,I),c=Math.min(c,I),f=Math.max(f,L),_=Math.min(_,L);const x=r-n,T=s-o,A=l-c,M=f-_;return Math.abs(e.center.x-i.center.x){const o=i.pointers.get(s);r=Math.min(r,Math.abs(n.y-o.y))}),r>=this._threshold}},F0=class extends ze{destroy(){this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(e){e!=="pan"&&e!=="rotate"||e===this._get("primaryDragAction")||(this._set("primaryDragAction",e),this._updateMode())}get mode(){return this._get("mode")}set mode(e){e!=="default"&&e!=="pro"||e===this._get("mode")||(this._set("mode",e),this._updateMode())}get updating(){var e;return!!((e=this._inputManager)!=null&&e.updating)}get latestPointerType(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerType}get latestPointerLocation(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerLocation}get multiTouchActive(){var e;return((e=this._inputManager)==null?void 0:e.multiTouchActive)??!1}disconnect(){this.view.viewEvents.disconnect(),this._inputManager=et(this._inputManager)}connect(){const e=this.view;this._source=new C9e(this.view.surface,e.input);const i=[new u2t,new h2t,new d2t,new l2t(this.view.navigation),new f2t],r=new Wp({eventSource:this._source,recognizers:i});this._inputManager=r,r.installHandlers("prevent-context-menu",[new s2t],Es.INTERNAL),this._modeDragPan=new nye(e,"primary"),this._modeDragRotate=new Yq(e,"secondary",Dh.CENTER),this._modeDragZoom=new Pwt(e,"tertiary");const n={lookAround:"b",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:"u",down:"j",headingLeft:"a",headingRight:"d",tiltUp:"w",tiltDown:"s",zoomIn:"+",zoomOut:"-"},resetHeading:"n",resetTilt:"p"};r.installHandlers("navigation",[new Ywt(e),new Jbt(e),new kwt(e),new Uwt(e,n.pan),new Vwt(e),new Zwt(e,n.resetTilt),new Xwt(e,n.resetHeading),new Yq(e,"primary",Dh.EYE,[n.lookAround]),new Yq(e,"secondary",Dh.CENTER,[n.lookAround]),new nye(e,"tertiary",[n.lookAround]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,new Jwt(e)],Es.INTERNAL),this.view.viewEvents.connect(r),this._updateMode(),this.addHandles(_e(()=>{var s;return(s=this.view.navigation)==null?void 0:s.browserTouchPanEnabled},s=>{this._source.browserTouchPanningEnabled=!s},ii))}_updateMode(){var n;const e=this.mode,i=this.primaryDragAction,r=(n=Jte.get(e))==null?void 0:n.get(i);r&&(this._modeDragPan&&(this._modeDragPan.pointerAction=r.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=r.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=r.zoom))}get test(){return{inputManager:this._inputManager,modeDragPan:this._modeDragPan,modeDragRotate:this._modeDragRotate,modeDragZoom:this._modeDragZoom}}};y([w()],F0.prototype,"view",void 0),y([w({value:"pan"})],F0.prototype,"primaryDragAction",null),y([w({value:"default"})],F0.prototype,"mode",null),y([w({readOnly:!0})],F0.prototype,"updating",null),y([w()],F0.prototype,"latestPointerType",null),y([w()],F0.prototype,"latestPointerLocation",null),y([w()],F0.prototype,"multiTouchActive",null),y([w()],F0.prototype,"_inputManager",void 0),F0=y([Z("esri.views.3d.input.SceneInputManager")],F0);const Jte=new Map,Jq=new Map,Kq=new Map;Jq.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"}),Jq.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"}),Kq.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"}),Kq.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"}),Jte.set("default",Jq),Jte.set("pro",Kq);const m2t=F0;let mo=class extends ze{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1}};y([w()],mo.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),y([w()],mo.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),y([w()],mo.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),y([w()],mo.prototype,"DECONFLICTOR_SHOW_GRID",void 0),y([w()],mo.prototype,"LABELS_SHOW_BORDER",void 0),y([w()],mo.prototype,"TEXT_SHOW_BASELINE",void 0),y([w()],mo.prototype,"TEXT_SHOW_BORDER",void 0),y([w()],mo.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),y([w()],mo.prototype,"OVERLAY_SHOW_CENTER",void 0),y([w()],mo.prototype,"SHOW_POI",void 0),y([w()],mo.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),y([w()],mo.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),y([w()],mo.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),y([w()],mo.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),y([w()],mo.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),y([w()],mo.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),y([w()],mo.prototype,"I3S_TREE_SHOW_TILES",void 0),y([w()],mo.prototype,"I3S_SHOW_MODIFICATIONS",void 0),y([w()],mo.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),y([w()],mo.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),y([w()],mo.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),y([w()],mo.prototype,"LINE_WIREFRAMES",void 0),mo=y([Z("esri.views.3d.support.DebugFlags")],mo);const Tn=new mo;let Jd,xO,Kte=!1,Qte=!1,eie=!1,tie=!1,_$=null;function g2t(t,e){if(!Qte||!xO)return;O9e();const i=xO;let r=0;for(let n=0;nv2t(t):Jd&&(Jd.parentElement.removeChild(Jd),Jd=null)}function O9e(){_$&&(_$(),_$=null)}function v2t(t){Jd==null&&(Jd=document.createElement("canvas"),Jd.setAttribute("id","debugCanvas2d"),t.surface.parentElement.style.position="relative",t.surface.parentElement.appendChild(Jd));const{state:e}=t,{camera:i,pixelRatio:r}=e,{width:n,height:s}=i,o=n*r,l=s*r;Jd.setAttribute("width",`${o}px`),Jd.setAttribute("height",`${l}px`),Jd.setAttribute("style",`position:absolute;left:0px;top:0px;display:block;pointer-events:none;width:${n}px;height:${s}px`),xO=Jd.getContext("2d"),xO.clearRect(0,0,n,s),xO.font="12px Arial"}function P9e(t,e,i,r,n){O9e();const s=Jd.height,o=xO;o.beginPath(),o.lineWidth=1,o.strokeStyle=n,o.moveTo(t,s-i),o.lineTo(e,s-i),o.stroke(),o.lineTo(e,s-r),o.stroke(),o.lineTo(e,s-i),o.stroke(),o.lineTo(t,s-i),o.stroke(),o.lineTo(t,s-i),o.stroke(),o.closePath()}function _2t(t,e){Kte&&(e&&eie||!e&&tie)&&P9e(t.aabr[0],t.aabr[2],t.aabr[1],t.aabr[3],e?"green":"red")}var Hl,Ya;(function(t){t[t.USER=1]="USER",t[t.SCALE_RANGE=2]="SCALE_RANGE",t[t.FILTER=4]="FILTER",t[t.DECONFLICTION=8]="DECONFLICTION",t[t.ALL_GRAPHIC=15]="ALL_GRAPHIC",t[t.ALL_LABEL=255]="ALL_LABEL"})(Hl||(Hl={})),function(t){t[t.GRAPHIC=1]="GRAPHIC",t[t.LABEL=16]="LABEL"}(Ya||(Ya={}));function R9e(t,e){return new L9e(t,N9e,e)}function b2t(t,e){const{curvatureDependent:i,scaleStart:r,scaleFallOffRange:n}=N9e;return new L9e(t,{curvatureDependent:{min:{curvature:i.min.curvature,tiltAngle:i.min.tiltAngle,scaleFallOffFactor:Qq.curvatureDependent.min.scaleFallOffFactor},max:{curvature:i.max.curvature,tiltAngle:i.max.tiltAngle,scaleFallOffFactor:Qq.curvatureDependent.max.scaleFallOffFactor}},scaleStart:r,scaleFallOffRange:n,minPixelSize:Qq.minPixelSize},e)}function w2t(t){return Math.abs(t*t*t)}function I9e(t,e,i){const r=i.parameters;return eW.scale=Math.min(r.divisor/(e-r.offset),1),eW.factor=w2t(t),eW}function ule(t,e){return ui(t*Math.max(e.scale,e.minScaleFactor),t,e.factor)}function x2t(t,e,i){const r=I9e(t,e,i);return r.minScaleFactor=0,ule(1,r)}function cye(t,e,i,r){r.scale=x2t(t,e,i),r.factor=0,r.minScaleFactor=i.minScaleFactor}function $9e(t,e,i=[0,0]){const r=Math.min(Math.max(e.scale,e.minScaleFactor),1);return i[0]=t[0]*r,i[1]=t[1]*r,i}function S2t(t,e,i,r){return ule(t,I9e(e,i,r))}let L9e=class D9e{get minScaleFactor(){return this._fontHeight!=null?Math.min(this._description.minPixelSize/this._fontHeight,1):0}constructor(e,i,r,n=T2t(),s){this._viewingMode=e,this._description=i,this._ellipsoidRadius=r,this.parameters=n,this._fontHeight=s,this._viewingMode===_t.Local?(this._coverageCompensation=this._surfaceCoverageCompensationLocal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersLocal):(this._coverageCompensation=this._surfaceCoverageCompensationGlobal,this._calculateCurvatureDependentParameters=this._calculateCurvatureDependentParametersGlobal)}update(e){return(!this.parameters||this.parameters.camera.fovY!==e.fovY||this.parameters.camera.distance!==e.distance)&&(this._calculateParameters(e,this._ellipsoidRadius,this.parameters),!0)}overrideFontHeight(e){return e!==this._fontHeight?new D9e(this._viewingMode,this._description,this._ellipsoidRadius,this.parameters,e):this}_calculateParameters(e,i,r){const{scaleStart:n,scaleFallOffRange:s}=this._description,{fovY:o,distance:l}=e,c=this._calculateCurvatureDependentParameters(e,i),f=this._coverageCompensation(e,i,c),{tiltAngle:_,scaleFallOffFactor:x}=c,T=Math.sin(_)*l,A=.5*Math.PI-_-o*(.5-n*f),M=T/Math.cos(A),I=A+o*s*f,L=(M-x*(T/Math.cos(I)))/(1-x);return r.camera.fovY=e.fovY,r.camera.distance=e.distance,r.offset=L,r.divisor=M-L,r}_calculateCurvatureDependentParametersLocal(e,i,r=uye){return r.tiltAngle=this._description.curvatureDependent.min.tiltAngle,r.scaleFallOffFactor=this._description.curvatureDependent.min.scaleFallOffFactor,r}_calculateCurvatureDependentParametersGlobal(e,i,r=uye){const n=this._description.curvatureDependent,s=1+e.distance/i,o=Math.sqrt(s*s-1),[l,c]=[n.min.curvature,n.max.curvature],f=Je((o-l)/(c-l),0,1),[_,x]=[n.min,n.max];return r.tiltAngle=ui(_.tiltAngle,x.tiltAngle,f),r.scaleFallOffFactor=ui(_.scaleFallOffFactor,x.scaleFallOffFactor,f),r}_surfaceCoverageCompensationLocal(e,i,r){return(e.fovY-r.tiltAngle)/e.fovY}_surfaceCoverageCompensationGlobal(e,i,r){const n=i*i,s=r.tiltAngle+.5*Math.PI,{fovY:o,distance:l}=e,c=l*l+n-2*Math.cos(s)*l*i,f=Math.sqrt(c),_=Math.sqrt(c-n);return(Math.acos(_/f)-Math.asin(i/(f/Math.sin(s)))+.5*o)/o}};const N9e={curvatureDependent:{min:{curvature:Ei(10),tiltAngle:Ei(12),scaleFallOffFactor:.5},max:{curvature:Ei(70),tiltAngle:Ei(40),scaleFallOffFactor:.8}},scaleStart:.3,scaleFallOffRange:.65,minPixelSize:0},Qq={curvatureDependent:{min:{scaleFallOffFactor:.7},max:{scaleFallOffFactor:.95}},minPixelSize:14};function T2t(){return{camera:{distance:0,fovY:0},divisor:0,offset:0}}const eW={scale:0,factor:0,minScaleFactor:0},uye={tiltAngle:0,scaleFallOffFactor:0};function E2t(t){return t instanceof Float32Array&&t.length>=16}function C2t(t){return Array.isArray(t)&&t.length>=16}function A2t(t){return E2t(t)||C2t(t)}var vc,hye;(function(t){t[t.Undefined=0]="Undefined",t[t.DefinedSize=1]="DefinedSize",t[t.DefinedScale=2]="DefinedScale"})(vc||(vc={})),function(t){t[t.Undefined=0]="Undefined",t[t.DefinedAngle=1]="DefinedAngle"}(hye||(hye={}));let hle=class{constructor(e){this.field=e}},M2t=class extends hle{constructor(e){super(e),this.minSize=[0,0,0],this.maxSize=[0,0,0],this.offset=[0,0,0],this.factor=[0,0,0],this.type=[vc.Undefined,vc.Undefined,vc.Undefined]}},O2t=class extends hle{constructor(e){super(e),this.colors=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.values=[0,0,0,0,0,0,0,0]}},P2t=class extends hle{constructor(e){super(e),this.values=[0,0,0,0,0,0,0,0],this.opacityValues=[0,0,0,0,0,0,0,0]}},R2t=class{};function hR(t){return t!=null}function uC(t){return typeof t=="number"}function Xj(t){return typeof t=="string"}function I2t(t){return t==null||Xj(t)}function ha(t,e){t&&t.push(e)}function $2t(t,e,i,r=Qe()){const n=t||0,s=e||0,o=i||0;return n!==0&&YO(r,r,-n/180*Math.PI),s!==0&&WO(r,r,s/180*Math.PI),o!==0&&TB(r,r,o/180*Math.PI),r}function yb(t,e,i,r,n){var l;const s=t.minSize,o=t.maxSize;if(t.expression)return ha(n,"Could not convert size info: expression not supported"),!1;if(t.useSymbolValue){const c=r.symbolSize[i];return e.minSize[i]=c,e.maxSize[i]=c,e.offset[i]=e.minSize[i],e.factor[i]=0,e.type[i]=vc.DefinedSize,!0}if(hR(t.field))return hR(t.stops)?t.stops.length===2&&uC(t.stops[0].size)&&uC(t.stops[1].size)?(dye(t.stops[0].size,t.stops[1].size,t.stops[0].value,t.stops[1].value,e,i),e.type[i]=vc.DefinedSize,!0):(ha(n,"Could not convert size info: stops only supported with 2 elements"),!1):uC(s)&&uC(o)&&hR(t.minDataValue)&&hR(t.maxDataValue)?(dye(s,o,t.minDataValue,t.maxDataValue,e,i),e.type[i]=vc.DefinedSize,!0):t.valueUnit==="unknown"?(ha(n,"Could not convert size info: proportional size not supported"),!1):KO[t.valueUnit]!=null?(e.minSize[i]=-1/0,e.maxSize[i]=1/0,e.offset[i]=0,e.factor[i]=1/KO[t.valueUnit],e.type[i]=vc.DefinedSize,!0):(ha(n,"Could not convert size info: scale-dependent size not supported"),!1);if(!hR(t.field)){if((l=t.stops)!=null&&l[0]&&uC(t.stops[0].size))return e.minSize[i]=t.stops[0].size,e.maxSize[i]=t.stops[0].size,e.offset[i]=e.minSize[i],e.factor[i]=0,e.type[i]=vc.DefinedSize,!0;if(uC(s))return e.minSize[i]=s,e.maxSize[i]=s,e.offset[i]=s,e.factor[i]=0,e.type[i]=vc.DefinedSize,!0}return ha(n,"Could not convert size info: unsupported variant of sizeInfo"),!1}function dye(t,e,i,r,n,s){const o=Math.abs(r-i)>0?(e-t)/(r-i):0;n.minSize[s]=o>0?t:e,n.maxSize[s]=o>0?e:t,n.offset[s]=t-i*o,n.factor[s]=o}function L2t(t,e,i,r){if(t.normalizationField||t.valueRepresentation)return ha(r,"Could not convert size info: unsupported property"),null;if(!I2t(t.field))return ha(r,"Could not convert size info: field is not a string"),null;if(e.size){if(t.field)if(e.size.field){if(t.field!==e.size.field)return ha(r,"Could not convert size info: multiple fields in use"),null}else e.size.field=t.field}else e.size=new M2t(t.field);let n;switch(t.axis){case"width":return n=yb(t,e.size,0,i,r),n?e:null;case"height":return n=yb(t,e.size,2,i,r),n?e:null;case"depth":return n=yb(t,e.size,1,i,r),n?e:null;case"width-and-depth":return n=yb(t,e.size,0,i,r),n&&yb(t,e.size,1,i,r),n?e:null;case null:case void 0:case"all":return n=yb(t,e.size,0,i,r),n=n&&yb(t,e.size,1,i,r),n=n&&yb(t,e.size,2,i,r),n?e:null;default:return ha(r,`Could not convert size info: unknown axis "${t.axis}""`),null}}function D2t(t,e,i){for(let n=0;n<3;++n){let s=e.unitInMeters;t.type[n]===vc.DefinedSize&&(s*=e.modelSize[n],t.type[n]=vc.DefinedScale),t.minSize[n]=t.minSize[n]/s,t.maxSize[n]=t.maxSize[n]/s,t.offset[n]=t.offset[n]/s,t.factor[n]=t.factor[n]/s}let r;if(t.type[0]!==vc.Undefined)r=0;else if(t.type[1]!==vc.Undefined)r=1;else{if(t.type[2]===vc.Undefined)return ha(i,"No size axis contains a valid size or scale"),!1;r=2}for(let n=0;n<3;++n)t.type[n]===vc.Undefined&&(t.minSize[n]=t.minSize[r],t.maxSize[n]=t.maxSize[r],t.offset[n]=t.offset[r],t.factor[n]=t.factor[r],t.type[n]=t.type[r]);return!0}function pye(t,e,i){t[4*e]=i.r/255,t[4*e+1]=i.g/255,t[4*e+2]=i.b/255,t[4*e+3]=i.a}function N2t(t,e,i){if(t.normalizationField)return ha(i,"Could not convert color info: unsupported property"),null;if(Xj(t.field)){if(!t.stops)return ha(i,"Could not convert color info: missing stops or colors"),null;{if(t.stops.length>8)return ha(i,"Could not convert color info: too many color stops"),null;e.color=new O2t(t.field);const r=t.stops;for(let n=0;n<8;++n){const s=r[Math.min(n,r.length-1)];e.color.values[n]=s.value,pye(e.color.colors,n,s.color)}}}else{if(!(t.stops&&t.stops.length>=0))return ha(i,"Could not convert color info: no field and no colors/stops"),null;{const r=t.stops&&t.stops.length>=0&&t.stops[0].color;e.color={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};for(let n=0;n<8;n++)e.color.values[n]=1/0,pye(e.color.colors,n,r)}}return e}function F2t(t,e,i){if(t.normalizationField)return ha(i,"Could not convert opacity info: unsupported property"),null;if(Xj(t.field)){if(!t.stops)return ha(i,"Could not convert opacity info: missing stops or opacities"),null;{if(t.stops.length>8)return ha(i,"Could not convert opacity info: too many opacity stops"),null;e.opacity=new P2t(t.field);const r=t.stops;for(let n=0;n<8;++n){const s=r[Math.min(n,r.length-1)];e.opacity.values[n]=s.value,e.opacity.opacityValues[n]=s.opacity}}}else{if(!(t.stops&&t.stops.length>=0))return ha(i,"Could not convert opacity info: no field and no opacities/stops"),null;{const r=t.stops&&t.stops.length>=0?t.stops[0].opacity:0;e.opacity={field:null,values:[0,0,0,0,0,0,0,0],opacityValues:[0,0,0,0,0,0,0,0]};for(let n=0;n<8;n++)e.opacity.values[n]=1/0,e.opacity.opacityValues[n]=r}}return e}function tW(t,e,i){const r=i===2&&t.rotationType==="arithmetic";e.offset[i]=r?90:0,e.factor[i]=r?-1:1,e.type[i]=1}function k2t(t,e,i){if(!Xj(t.field))return ha(i,"Could not convert rotation info: field is not a string"),null;if(e.rotation){if(t.field)if(e.rotation.field){if(t.field!==e.rotation.field)return ha(i,"Could not convert rotation info: multiple fields in use"),null}else e.rotation.field=t.field}else e.rotation={field:t.field,offset:[0,0,0],factor:[1,1,1],type:[0,0,0]};switch(t.axis){case"tilt":return tW(t,e.rotation,0),e;case"roll":return tW(t,e.rotation,1),e;case null:case void 0:case"heading":return tW(t,e.rotation,2),e;default:return ha(i,`Could not convert rotation info: unknown axis "${t.axis}""`),null}}let K9=class{constructor(e,i=[1,1,1],r=[1,1,1],n=1,s=[0,0,0],o=[1,1,1],l=[0,0,0]){this.supports=e,this.modelSize=i,this.symbolSize=r,this.unitInMeters=n,this.anchor=s,this.scale=o,this.rotation=l}};function F9e(t,e,i){if(!t)return null;const r=t.reduce((n,s)=>{if(!n)return n;if(s.valueExpression)return ha(i,"Could not convert visual variables: arcade expressions not supported"),null;switch(s.type){case"size":return e.supports.size?L2t(s,n,e,i):n;case"color":return e.supports.color?N2t(s,n,i):n;case"opacity":return e.supports.opacity?F2t(s,n,i):null;case"rotation":return e.supports.rotation?k2t(s,n,i):n;default:return null}},new R2t);return!(t.length>0&&r)||r.size||r.color||r.opacity||r.rotation?r!=null&&r.size&&!D2t(r.size,e,i)?null:r:null}let z2t=class{constructor(e,i,r){this.visualVariables=e,this.materialParameters=i,this.requiresShaderTransformation=r}};function C5(t,e){if(!t||Tn.TESTS_DISABLE_FAST_UPDATES)return null;const i=F9e(t.visualVariables,e);return i?new z2t(i,z9e(i,e),!!i.size):null}function A5(t,e,i){if(!e||!t)return!1;const r=t.visualVariables,n=F9e(e.visualVariables,i);return!!n&&!!(xN(r.size,n.size,"size")&&xN(r.color,n.color,"color")&&xN(r.rotation,n.rotation,"rotation")&&xN(r.opacity,n.opacity,"opacity"))&&(t.visualVariables=n,t.materialParameters=z9e(n,i),t.requiresShaderTransformation=!!n.size,!0)}function xN(t,e,i){if(!!t!=!!e||t&&t.field!==(e==null?void 0:e.field))return!1;if(t&&i==="rotation"){const r=t,n=e;for(let s=0;s<3;s++)if(r.type[s]!==n.type[s]||r.offset[s]!==n.offset[s]||r.factor[s]!==n.factor[s])return!1}return!0}let k9e=class extends _n{constructor(e){super(),this.vvSize=(e==null?void 0:e.size)??null,this.vvColor=(e==null?void 0:e.color)??null,this.vvOpacity=(e==null?void 0:e.opacity)??null}};function z9e(t,e){const i=new k9e(t);return i.vvSize&&(i.vvSymbolAnchor=e.anchor,Hf(b$),$2t(e.rotation[2],e.rotation[0],e.rotation[1],b$),i.vvSymbolRotationMatrix=i.vvSymbolRotationMatrix||as(),Yf(i.vvSymbolRotationMatrix,b$)),i}function U2t(t,e,i){if(!t.vvSize)return i;Ao(vb,i);const r=t.vvSymbolRotationMatrix;s1(b$,r[0],r[1],r[2],0,r[3],r[4],r[5],0,r[6],r[7],r[8],0,0,0,0,1),nn(vb,vb,b$);for(let n=0;n<3;++n){const s=t.vvSize.offset[n]+e[0]*t.vvSize.factor[n];fye[n]=Je(s,t.vvSize.minSize[n],t.vvSize.maxSize[n])}return $9(vb,vb,fye),Qu(vb,vb,t.vvSymbolAnchor),vb}function dle(t,e,i){if(!e.vvSize)return Ie(t,1,1,1),t;for(let r=0;r<3;++r){const n=e.vvSize.offset[r]+i[0]*e.vvSize.factor[r];t[r]=Je(n,e.vvSize.minSize[r],e.vvSize.maxSize[r])}return t}function Om(t,e){const i=t==null?0:e.attributes[t];return typeof i=="number"&&isFinite(i)?i:0}const vb=Qe(),fye=W(),b$=Qe();function ple(t){t.vertex.code.add(V`float screenSizePerspectiveViewAngleDependentFactor(float absCosAngle) { +return absCosAngle * absCosAngle * absCosAngle; +}`),t.vertex.code.add(V`vec3 screenSizePerspectiveScaleFactor(float absCosAngle, float distanceToCamera, vec3 params) { +return vec3( +min(params.x / (distanceToCamera - params.y), 1.0), +screenSizePerspectiveViewAngleDependentFactor(absCosAngle), +params.z +); +}`),t.vertex.code.add(V`float applyScreenSizePerspectiveScaleFactorFloat(float size, vec3 factor) { +return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); +}`),t.vertex.code.add(V`float screenSizePerspectiveScaleFloat(float size, float absCosAngle, float distanceToCamera, vec3 params) { +return applyScreenSizePerspectiveScaleFactorFloat( +size, +screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params) +); +}`),t.vertex.code.add(V`vec2 applyScreenSizePerspectiveScaleFactorVec2(vec2 size, vec3 factor) { +return mix(size * clamp(factor.x, factor.z, 1.0), size, factor.y); +}`),t.vertex.code.add(V`vec2 screenSizePerspectiveScaleVec2(vec2 size, float absCosAngle, float distanceToCamera, vec3 params) { +return applyScreenSizePerspectiveScaleFactorVec2(size, screenSizePerspectiveScaleFactor(absCosAngle, distanceToCamera, params)); +}`)}function V2t(t){t.uniforms.add(new Oi("screenSizePerspective",e=>U9e(e.screenSizePerspective)))}function Zj(t){t.uniforms.add(new Oi("screenSizePerspectiveAlignment",e=>U9e(e.screenSizePerspectiveAlignment||e.screenSizePerspective)))}function U9e(t){return Ie(B2t,t.parameters.divisor,t.parameters.offset,t.minScaleFactor)}const B2t=W();function V9e(t,e){const i=t.vertex;e.hasVerticalOffset?(B9e(i),e.hasScreenSizePerspective&&(t.include(ple),Zj(i),Nm(t.vertex,e)),i.code.add(V` + vec3 calculateVerticalOffset(vec3 worldPos, vec3 localOrigin) { + float viewDistance = length((view * vec4(worldPos, 1.0)).xyz); + ${e.spherical?V`vec3 worldNormal = normalize(worldPos + localOrigin);`:V`vec3 worldNormal = vec3(0.0, 0.0, 1.0);`} + ${e.hasScreenSizePerspective?V` + float cosAngle = dot(worldNormal, normalize(worldPos - cameraPosition)); + float verticalOffsetScreenHeight = screenSizePerspectiveScaleFloat(verticalOffset.x, abs(cosAngle), viewDistance, screenSizePerspectiveAlignment);`:V` + float verticalOffsetScreenHeight = verticalOffset.x;`} + // Screen sized offset in world space, used for example for line callouts + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * viewDistance, verticalOffset.z, verticalOffset.w); + return worldNormal * worldOffset; + } + + vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { + return worldPos + calculateVerticalOffset(worldPos, localOrigin); + } + `)):i.code.add(V`vec3 addVerticalOffset(vec3 worldPos, vec3 localOrigin) { return worldPos; }`)}const j2t=Xi();function B9e(t){t.uniforms.add(new gr("verticalOffset",(e,i)=>{const{minWorldLength:r,maxWorldLength:n,screenLength:s}=e.verticalOffset,o=Math.tan(.5*i.camera.fovY)/(.5*i.camera.fullViewport[3]),l=i.camera.pixelRatio||1;return rs(j2t,s*l,o,r,n)}))}const j9e=.5;function G9e(t,e){t.include(ple),t.attributes.add(J.POSITION,"vec3"),t.attributes.add(J.NORMAL,"vec3"),t.attributes.add(J.AUXPOS1,"vec4");const i=t.vertex;Kh(i,e),Nm(i,e),i.uniforms.add(new gr("viewport",(r,n)=>n.camera.fullViewport),new ft("polygonOffset",r=>r.shaderPolygonOffset),new ft("cameraGroundRelative",(r,n)=>n.camera.aboveGround?1:-1)),e.hasVerticalOffset&&B9e(i),i.constants.add("smallOffsetAngle","float",.984807753012208),i.code.add(V`struct ProjectHUDAux { +vec3 posModel; +vec3 posView; +vec3 vnormal; +float distanceToCamera; +float absCosAngle; +};`),i.code.add(V` + float applyHUDViewDependentPolygonOffset(float pointGroundDistance, float absCosAngle, inout vec3 posView) { + float pointGroundSign = ${e.multipassEnabled?V.float(0):V`sign(pointGroundDistance)`}; + if (pointGroundSign == 0.0) { + pointGroundSign = cameraGroundRelative; + } + + // cameraGroundRelative is -1 if camera is below ground, 1 if above ground + // groundRelative is 1 if both camera and symbol are on the same side of the ground, -1 otherwise + float groundRelative = cameraGroundRelative * pointGroundSign; + + // view angle dependent part of polygon offset emulation: we take the absolute value because the sign that is + // dropped is instead introduced using the ground-relative position of the symbol and the camera + if (polygonOffset > .0) { + float cosAlpha = clamp(absCosAngle, 0.01, 1.0); + float tanAlpha = sqrt(1.0 - cosAlpha * cosAlpha) / cosAlpha; + float factor = (1.0 - tanAlpha / viewport[2]); + + // same side of the terrain + if (groundRelative > 0.0) { + posView *= factor; + } + // opposite sides of the terrain + else { + posView /= factor; + } + } + + return groundRelative; + } + `),e.draped&&!e.hasVerticalOffset||S5(i),e.draped||(i.uniforms.add(new ft("perDistancePixelRatio",(r,n)=>Math.tan(n.camera.fovY/2)/(n.camera.fullViewport[2]/2))),i.code.add(V` + void applyHUDVerticalGroundOffset(vec3 normalModel, inout vec3 posModel, inout vec3 posView) { + float distanceToCamera = length(posView); + + // Compute offset in world units for a half pixel shift + float pixelOffset = distanceToCamera * perDistancePixelRatio * ${V.float(j9e)}; + + // Apply offset along normal in the direction away from the ground surface + vec3 modelOffset = normalModel * cameraGroundRelative * pixelOffset; + + // Apply the same offset also on the view space position + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + + posModel += modelOffset; + posView += viewOffset; + } + `)),e.screenCenterOffsetUnitsEnabled&&bP(i),e.hasScreenSizePerspective&&Zj(i),i.code.add(V` + vec4 projectPositionHUD(out ProjectHUDAux aux) { + // centerOffset is in view space and is used to implement world size offset of labels with respect to objects. + // It also pulls the label towards the viewer so that the label is visible in front of the object. + vec3 centerOffset = auxpos1.xyz; + + // The pointGroundDistance is the distance of the geometry to the ground and is + // negative if the point is below the ground, or positive if the point is above + // ground. + float pointGroundDistance = auxpos1.w; + + aux.posModel = position; + aux.posView = (view * vec4(aux.posModel, 1.0)).xyz; + aux.vnormal = normal; + ${e.draped?"":"applyHUDVerticalGroundOffset(aux.vnormal, aux.posModel, aux.posView);"} + + // Screen sized offset in world space, used for example for line callouts + // Note: keep this implementation in sync with the CPU implementation, see + // - MaterialUtil.verticalOffsetAtDistance + // - HUDMaterial.applyVerticalOffsetTransformation + + aux.distanceToCamera = length(aux.posView); + + vec3 viewDirObjSpace = normalize(cameraPosition - aux.posModel); + float cosAngle = dot(aux.vnormal, viewDirObjSpace); + + aux.absCosAngle = abs(cosAngle); + + ${e.hasScreenSizePerspective&&(e.hasVerticalOffset||e.screenCenterOffsetUnitsEnabled)?"vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(aux.absCosAngle, aux.distanceToCamera, screenSizePerspectiveAlignment);":""} + + ${e.hasVerticalOffset?e.hasScreenSizePerspective?"float verticalOffsetScreenHeight = applyScreenSizePerspectiveScaleFactorFloat(verticalOffset.x, perspectiveFactor);":"float verticalOffsetScreenHeight = verticalOffset.x;":""} + + ${e.hasVerticalOffset?V` + float worldOffset = clamp(verticalOffsetScreenHeight * verticalOffset.y * aux.distanceToCamera, verticalOffset.z, verticalOffset.w); + vec3 modelOffset = aux.vnormal * worldOffset; + aux.posModel += modelOffset; + vec3 viewOffset = (viewNormal * vec4(modelOffset, 1.0)).xyz; + aux.posView += viewOffset; + // Since we elevate the object, we need to take that into account + // in the distance to ground + pointGroundDistance += worldOffset;`:""} + + float groundRelative = applyHUDViewDependentPolygonOffset(pointGroundDistance, aux.absCosAngle, aux.posView); + + ${e.screenCenterOffsetUnitsEnabled?"":V` + // Apply x/y in view space, but z in screen space (i.e. along posView direction) + aux.posView += vec3(centerOffset.x, centerOffset.y, 0.0); + + // Same material all have same z != 0.0 condition so should not lead to + // branch fragmentation and will save a normalization if it's not needed + if (centerOffset.z != 0.0) { + aux.posView -= normalize(aux.posView) * centerOffset.z; + } + `} + + vec4 posProj = proj * vec4(aux.posView, 1.0); + + ${e.screenCenterOffsetUnitsEnabled?e.hasScreenSizePerspective?"float centerOffsetY = applyScreenSizePerspectiveScaleFactorFloat(centerOffset.y, perspectiveFactor);":"float centerOffsetY = centerOffset.y;":""} + + ${e.screenCenterOffsetUnitsEnabled?"posProj.xy += vec2(centerOffset.x, centerOffsetY) * pixelRatio * 2.0 / viewport.zw * posProj.w;":""} + + // constant part of polygon offset emulation + posProj.z -= groundRelative * polygonOffset * posProj.w; + return posProj; + } + `)}const SN=ya();function H9e(t,e,i,r,n,s){if(t.visible)if(t.boundingInfo){Xt(t.type===Ws.Mesh);const o=e.tolerance;q9e(t.boundingInfo,i,r,o,n,s)}else{const o=t.attributes.get(J.POSITION),l=o.indices;Q9(i,r,0,l.length/3,l,o,void 0,n,s)}}const G2t=W();function q9e(t,e,i,r,n,s){if(t==null)return;const o=Y9e(e,i,G2t);if(HMe(SN,t.bbMin),qMe(SN,t.bbMax),n!=null&&n.applyToAabb(SN),mle(SN,e,o,r)){const{primitiveIndices:l,position:c}=t,f=l?l.length:c.indices.length/3;if(f>Y2t){const _=t.getChildren();if(_!==void 0){for(const x of _)q9e(x,e,i,r,n,s);return}}Q9(e,i,0,f,c.indices,c,l,n,s)}}const W9e=W();function Q9(t,e,i,r,n,s,o,l,c){if(o)return H2t(t,e,i,r,n,s,o,l,c);const{data:f,stride:_}=s,x=t[0],T=t[1],A=t[2],M=e[0]-x,I=e[1]-T,L=e[2]-A;for(let F=i,z=3*i;F0){if(Ft<0||Ft>Ae)continue}else if(Ft>0||Ft0){if(Rt<0||Ft+Rt>Ae)continue}else if(Rt>0||Ft+Rt=0&&c(dt,fle(be,ye,pe,Ee,te,le,W9e),F,!1)}}function H2t(t,e,i,r,n,s,o,l,c){const{data:f,stride:_}=s,x=t[0],T=t[1],A=t[2],M=e[0]-x,I=e[1]-T,L=e[2]-A;for(let F=i;F0){if(Qt<0||Qt>Pe)continue}else if(Qt>0||Qt0){if(dt<0||Qt+dt>Pe)continue}else if(dt>0||Qt+dt=0&&c(pt,fle(ye,pe,Ee,te,le,de,W9e),z,!1)}}const mye=W(),gye=W();function fle(t,e,i,r,n,s,o){return Ie(mye,t,e,i),Ie(gye,r,n,s),Wt(o,mye,gye),Ye(o,o),o}function Y9e(t,e,i){return Ie(i,1/(e[0]-t[0]),1/(e[1]-t[1]),1/(e[2]-t[2]))}function mle(t,e,i,r){return gle(t,e,i,r,1/0)}function gle(t,e,i,r,n){const s=(t[0]-r-e[0])*i[0],o=(t[3]+r-e[0])*i[0];let l=Math.min(s,o),c=Math.max(s,o);const f=(t[1]-r-e[1])*i[1],_=(t[4]+r-e[1])*i[1];if(c=Math.min(c,Math.max(f,_)),c<0||(l=Math.max(l,Math.min(f,_)),l>c))return!1;const x=(t[2]-r-e[2])*i[2],T=(t[5]+r-e[2])*i[2];return c=Math.min(c,Math.max(x,T)),!(c<0)&&(l=Math.max(l,Math.min(x,T)),!(l>c)&&le.push(i)),e}const J9e={multiply:1,ignore:2,replace:3,tint:4},Y2t=1e3;let hx=class extends Z9{constructor(e,i){super(),this.type=Ws.Material,this.supportsEdges=!1,this._visible=!0,this._renderPriority=0,this._vertexAttributeLocations=Er,this._pp0=nt(0,0,1),this._pp1=nt(0,0,0),this._parameters=Z9e(e,i),this.validateParameters(this._parameters)}get parameters(){return this._parameters}update(e){return!1}setParameters(e,i=!0){q2t(this._parameters,e)&&(this.validateParameters(this._parameters),i&&this.parametersChanged())}validateParameters(e){}get visible(){return this._visible}set visible(e){e!==this._visible&&(this._visible=e,this.parametersChanged())}shouldRender(e){return this.isVisible()&&this.isVisibleForOutput(e.output)&&(!this.parameters.isDecoration||e.bindParameters.decorations===Xh.ON)&&(this.parameters.renderOccluded&e.renderOccludedMask)!=0}isVisibleForOutput(e){return!0}get renderPriority(){return this._renderPriority}set renderPriority(e){e!==this._renderPriority&&(this._renderPriority=e,this.parametersChanged())}get vertexAttributeLocations(){return this._vertexAttributeLocations}isVisible(){return this._visible}parametersChanged(){var e;(e=this.repository)==null||e.materialChanged(this)}intersectDraped(e,i,r,n,s,o){return this._pp0[0]=this._pp1[0]=n[0],this._pp0[1]=this._pp1[1]=n[1],this.intersect(e,i,r,this._pp0,this._pp1,s)}},K9e=class extends Ovt{constructor(e,i,r){super(i,r),this.camera=e}};var Wn;(function(t){t[t.None=0]="None",t[t.Occlude=1]="Occlude",t[t.Transparent=2]="Transparent",t[t.OccludeAndTransparent=4]="OccludeAndTransparent",t[t.OccludeAndTransparentStencil=8]="OccludeAndTransparentStencil",t[t.Opaque=16]="Opaque"})(Wn||(Wn={}));let yle=class extends _n{constructor(){super(...arguments),this.renderOccluded=Wn.Occlude,this.isDecoration=!1}},Q9e=class{constructor(){this.factor=new yye,this.factorAlignment=new yye}},yye=class{constructor(){this.scale=0,this.factor=0,this.minScaleFactor=0}};function Rsi(t,e,i,r=1){const{data:n,indices:s}=t,o=e.typedBuffer,l=e.typedBufferStride,c=s.length;if(i*=l,r===1)for(let f=0;f{H=s[re]+k,Y=s[re+1]+U,Q=s[re+2]+j}:re=>{const he=s[re],ce=s[re+1],be=s[re+2];H=_*he+A*ce+L*be+k,Y=x*he+M*ce+F*be+U,Q=T*he+I*ce+z*be+j};if(n===1)for(let re=0;re{Y=s[he],Q=s[he+1],ne=s[he+2]}:he=>{const ce=s[he],be=s[he+1],ye=s[he+2];Y=x*ce+M*be+F*ye,Q=T*ce+I*be+z*ye,ne=A*ce+L*be+k*ye};if(n===1)if(U)for(let he=0;he<_;++he){re(3*o[he]);const ce=Y*Y+Q*Q+ne*ne;if(cej){const be=1/Math.sqrt(ce);c[r]=Y*be,c[r+1]=Q*be,c[r+2]=ne*be}else c[r]=Y,c[r+1]=Q,c[r+2]=ne;r+=f}else for(let he=0;he<_;++he)re(3*o[he]),c[r]=Y,c[r+1]=Q,c[r+2]=ne,r+=f;else for(let he=0;he<_;++he){if(re(3*o[he]),U){const ce=Y*Y+Q*Q+ne*ne;if(cej){const be=1/Math.sqrt(ce);Y*=be,Q*=be,ne*=be}}for(let ce=0;cej){const te=1/Math.sqrt(Ee);be*=te,ye*=te,pe*=te}}c[r]=be,c[r+1]=ye,c[r+2]=pe,c[r+3]=ce,r+=f}else for(let Y=0;Y<_;++Y){const Q=4*o[Y],ne=s[Q],re=s[Q+1],he=s[Q+2],ce=s[Q+3];let be=x*ne+M*re+F*he,ye=T*ne+I*re+z*he,pe=A*ne+L*re+k*he;if(U){const Ee=be*be+ye*ye+pe*pe;if(Eej){const te=1/Math.sqrt(Ee);be*=te,ye*=te,pe*=te}}for(let Ee=0;Eel6e(e,i,r)),new Oi("slicePlaneBasis1",(i,r)=>{var n;return kU(e,i,r,(n=r.slicePlane)==null?void 0:n.basis1)}),new Oi("slicePlaneBasis2",(i,r)=>{var n;return kU(e,i,r,(n=r.slicePlane)==null?void 0:n.basis2)}))}function oo(t,e){n6e(t,e,new yp("slicePlaneOrigin",(i,r)=>l6e(e,i,r)),new yp("slicePlaneBasis1",(i,r)=>{var n;return kU(e,i,r,(n=r.slicePlane)==null?void 0:n.basis1)}),new yp("slicePlaneBasis2",(i,r)=>{var n;return kU(e,i,r,(n=r.slicePlane)==null?void 0:n.basis2)}))}function n6e(t,e,...i){if(!e.hasSlicePlane){const o=V`#define rejectBySlice(_pos_) false +#define discardBySlice(_pos_) {} +#define highlightSlice(_color_, _pos_) (_color_)`;return e.hasSliceInVertexProgram&&t.vertex.code.add(o),void t.fragment.code.add(o)}e.hasSliceInVertexProgram&&t.vertex.uniforms.add(...i),t.fragment.uniforms.add(...i);const r=V`struct SliceFactors { +float front; +float side0; +float side1; +float side2; +float side3; +}; +SliceFactors calculateSliceFactors(vec3 pos) { +vec3 rel = pos - slicePlaneOrigin; +vec3 slicePlaneNormal = -cross(slicePlaneBasis1, slicePlaneBasis2); +float slicePlaneW = -dot(slicePlaneNormal, slicePlaneOrigin); +float basis1Len2 = dot(slicePlaneBasis1, slicePlaneBasis1); +float basis2Len2 = dot(slicePlaneBasis2, slicePlaneBasis2); +float basis1Dot = dot(slicePlaneBasis1, rel); +float basis2Dot = dot(slicePlaneBasis2, rel); +return SliceFactors( +dot(slicePlaneNormal, pos) + slicePlaneW, +-basis1Dot - basis1Len2, +basis1Dot - basis1Len2, +-basis2Dot - basis2Len2, +basis2Dot - basis2Len2 +); +} +bool sliceByFactors(SliceFactors factors) { +return factors.front < 0.0 +&& factors.side0 < 0.0 +&& factors.side1 < 0.0 +&& factors.side2 < 0.0 +&& factors.side3 < 0.0; +} +bool sliceEnabled() { +return dot(slicePlaneBasis1, slicePlaneBasis1) != 0.0; +} +bool sliceByPlane(vec3 pos) { +return sliceEnabled() && sliceByFactors(calculateSliceFactors(pos)); +} +#define rejectBySlice(_pos_) sliceByPlane(_pos_) +#define discardBySlice(_pos_) { if (sliceByPlane(_pos_)) discard; }`,n=V`vec4 applySliceHighlight(vec4 color, vec3 pos) { +SliceFactors factors = calculateSliceFactors(pos); +const float HIGHLIGHT_WIDTH = 1.0; +const vec4 HIGHLIGHT_COLOR = vec4(0.0, 0.0, 0.0, 0.3); +factors.front /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.front); +factors.side0 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side0); +factors.side1 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side1); +factors.side2 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side2); +factors.side3 /= (2.0 * HIGHLIGHT_WIDTH) * fwidth(factors.side3); +if (sliceByFactors(factors)) { +return color; +} +float highlightFactor = (1.0 - step(0.5, factors.front)) +* (1.0 - step(0.5, factors.side0)) +* (1.0 - step(0.5, factors.side1)) +* (1.0 - step(0.5, factors.side2)) +* (1.0 - step(0.5, factors.side3)); +return mix(color, vec4(HIGHLIGHT_COLOR.rgb, color.a), highlightFactor * HIGHLIGHT_COLOR.a); +}`,s=e.hasSliceHighlight?V` + ${n} + #define highlightSlice(_color_, _pos_) (sliceEnabled() ? applySliceHighlight(_color_, _pos_) : (_color_)) + `:V`#define highlightSlice(_color_, _pos_) (_color_)`;e.hasSliceInVertexProgram&&t.vertex.code.add(r),t.fragment.code.add(r),t.fragment.code.add(s)}function s6e(t,e,i){return t.instancedDoublePrecision?Ie(Q2t,i.camera.viewInverseTransposeMatrix[3],i.camera.viewInverseTransposeMatrix[7],i.camera.viewInverseTransposeMatrix[11]):e.slicePlaneLocalOrigin}function o6e(t,e){return t!=null?je(zU,e.origin,t):e.origin}function a6e(t,e,i){return t.hasSliceTranslatedView?e!=null?Qu(ext,i.camera.viewMatrix,e):i.camera.viewMatrix:null}function l6e(t,e,i){if(i.slicePlane==null)return Ka;const r=s6e(t,e,i),n=o6e(r,i.slicePlane),s=a6e(t,r,i);return s!=null?bt(zU,n,s):n}function kU(t,e,i,r){if(r==null||i.slicePlane==null)return Ka;const n=s6e(t,e,i),s=o6e(n,i.slicePlane),o=a6e(t,n,i);return o!=null?(Be(dR,r,s),bt(zU,s,o),bt(dR,dR,o),je(dR,dR,zU)):r}const Q2t=W(),zU=W(),dR=W(),ext=Qe();function e6(t,e){const i=e.output===ue.ObjectAndLayerIdColor,r=e.objectAndLayerIdColorInstanced;i&&(t.varyings.add("objectAndLayerIdColorVarying","vec4"),r?t.attributes.add(J.INSTANCEOBJECTANDLAYERIDCOLOR,"vec4"):t.attributes.add(J.OBJECTANDLAYERIDCOLOR,"vec4")),t.vertex.code.add(V` + void forwardObjectAndLayerIdColor() { + ${i?r?V`objectAndLayerIdColorVarying = instanceObjectAndLayerIdColor * 0.003921568627451;`:V`objectAndLayerIdColorVarying = objectAndLayerIdColor * 0.003921568627451;`:V``} }`),t.fragment.code.add(V` + void outputObjectAndLayerIdColor() { + ${i?V`fragColor = objectAndLayerIdColorVarying;`:V``} }`)}function Jj(t){t.uniforms.add(new Oy("alignPixelEnabled",(e,i)=>i.alignPixelEnabled)),t.code.add(V`vec4 alignToPixelCenter(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.500123) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = (floor(xy * widthHeight) + vec2(0.5)) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`),t.code.add(V`vec4 alignToPixelOrigin(vec4 clipCoord, vec2 widthHeight) { +if (!alignPixelEnabled) +return clipCoord; +vec2 xy = vec2(0.5) + 0.5 * clipCoord.xy / clipCoord.w; +vec2 pixelSz = vec2(1.0) / widthHeight; +vec2 ij = floor((xy + 0.5 * pixelSz) * widthHeight) * pixelSz; +vec2 result = (ij * 2.0 - vec2(1.0)) * clipCoord.w; +return vec4(result, clipCoord.zw); +}`)}function txt(t,e){const{vertex:i,fragment:r}=t;i.include(Jj),e.multipassEnabled&&(i.include(R$e),t.varyings.add("depth","float")),i.code.add(V` + void main(void) { + vec4 posProjCenter; + if (dot(position, position) > 0.0) { + // Render single point to center of the pixel to avoid subpixel filtering to affect the marker color + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + posProjCenter = alignToPixelCenter(posProj, viewport.zw); + + ${e.multipassEnabled?V` + // Don't draw vertices behind geometry + if(geometryDepthTest(.5 + .5 * posProjCenter.xy / posProjCenter.w, projectAux.posView.z)){ + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + }`:""} + + ${e.multipassEnabled?"depth = projectAux.posView.z;":""} + vec3 vpos = projectAux.posModel; + if (rejectBySlice(vpos)) { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + } else { + // Project out of clip space + posProjCenter = vec4(1e038, 1e038, 1e038, 1.0); + } + + gl_Position = posProjCenter; + gl_PointSize = 1.0; + } + `),t.include(dd,e),r.code.add(V` + void main() { + fragColor = vec4(1); + ${e.multipassEnabled?V` + if(terrainDepthTest(depth)) { + fragColor.g = 0.5; + }`:""} + } + `)}function c6e(t){t.vertex.uniforms.add(new ft("renderTransparentlyOccludedHUD",(e,i)=>i.hudRenderStyle===Ih.Occluded?1:i.hudRenderStyle===Ih.NotOccluded?0:.75),new gr("viewport",(e,i)=>i.camera.fullViewport),new Zt("hudVisibilityTexture",(e,i)=>{var r;return(r=i.hudVisibility)==null?void 0:r.colorTexture})),t.vertex.include(Jj),t.vertex.code.add(V`bool testHUDVisibility(vec4 posProj) { +vec4 posProjCenter = alignToPixelCenter(posProj, viewport.zw); +vec4 occlusionPixel = texture(hudVisibilityTexture, .5 + .5 * posProjCenter.xy / posProjCenter.w); +if (renderTransparentlyOccludedHUD > 0.5) { +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g * renderTransparentlyOccludedHUD < 1.0; +} +return occlusionPixel.r * occlusionPixel.g > 0.0 && occlusionPixel.g == 1.0; +}`)}const u6e=Mi(1,1,0,1),ble=Mi(1,0,1,1);function dx(t){t.fragment.uniforms.add(new Zt("depthTexture",(e,i)=>i.mainDepth)),t.fragment.constants.add("occludedHighlightFlag","vec4",u6e).add("unoccludedHighlightFlag","vec4",ble),t.fragment.code.add(V`void outputHighlight() { +float sceneDepth = float(texelFetch(depthTexture, ivec2(gl_FragCoord.xy), 0).x); +if (gl_FragCoord.z > sceneDepth + 5e-7) { +fragColor = occludedHighlightFlag; +} else { +fragColor = unoccludedHighlightFlag; +} +}`)}let h6e=class extends Ls{constructor(e,i,r){super(e,"vec4",Or.Pass,(n,s,o)=>n.setUniform4fv(e,i(s,o)),r)}},Hu=class extends Ls{constructor(e,i,r){super(e,"float",Or.Pass,(n,s,o)=>n.setUniform1fv(e,i(s,o)),r)}},t6=class extends k9e{constructor(){super(...arguments),this.renderOccluded=Wn.Occlude,this.isDecoration=!1}};const SO=8;function e_(t,e){const{vertex:i,attributes:r}=t;e.hasVvInstancing&&(e.vvSize||e.vvColor)&&r.add(J.INSTANCEFEATUREATTRIBUTE,"vec4"),e.vvSize?(i.uniforms.add(new Oi("vvSizeMinSize",n=>n.vvSize.minSize)),i.uniforms.add(new Oi("vvSizeMaxSize",n=>n.vvSize.maxSize)),i.uniforms.add(new Oi("vvSizeOffset",n=>n.vvSize.offset)),i.uniforms.add(new Oi("vvSizeFactor",n=>n.vvSize.factor)),i.uniforms.add(new Wm("vvSymbolRotationMatrix",n=>n.vvSymbolRotationMatrix)),i.uniforms.add(new Oi("vvSymbolAnchor",n=>n.vvSymbolAnchor)),i.code.add(V`vec3 vvScale(vec4 _featureAttribute) { +return clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize); +} +vec4 vvTransformPosition(vec3 position, vec4 _featureAttribute) { +return vec4(vvSymbolRotationMatrix * ( vvScale(_featureAttribute) * (position + vvSymbolAnchor)), 1.0); +}`),i.code.add(V` + const float eps = 1.192092896e-07; + vec4 vvTransformNormal(vec3 _normal, vec4 _featureAttribute) { + vec3 vvScale = clamp(vvSizeOffset + _featureAttribute.x * vvSizeFactor, vvSizeMinSize + eps, vvSizeMaxSize); + return vec4(vvSymbolRotationMatrix * _normal / vvScale, 1.0); + } + + ${e.hasVvInstancing?V` + vec4 vvLocalNormal(vec3 _normal) { + return vvTransformNormal(_normal, instanceFeatureAttribute); + } + + vec4 localPosition() { + return vvTransformPosition(position, instanceFeatureAttribute); + }`:""} + `)):i.code.add(V`vec4 localPosition() { return vec4(position, 1.0); } +vec4 vvLocalNormal(vec3 _normal) { return vec4(_normal, 1.0); }`),e.vvColor?(i.constants.add("vvColorNumber","int",SO),i.uniforms.add(new Hu("vvColorValues",n=>n.vvColor.values,SO),new h6e("vvColorColors",n=>n.vvColor.colors,SO)),i.code.add(V` + vec4 interpolateVVColor(float value) { + if (value <= vvColorValues[0]) { + return vvColorColors[0]; + } + + for (int i = 1; i < vvColorNumber; ++i) { + if (vvColorValues[i] >= value) { + float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); + return mix(vvColorColors[i-1], vvColorColors[i], f); + } + } + return vvColorColors[vvColorNumber - 1]; + } + + vec4 vvGetColor(vec4 featureAttribute) { + return interpolateVVColor(featureAttribute.y); + } + + ${e.hasVvInstancing?V` + vec4 vvColor() { + return vvGetColor(instanceFeatureAttribute); + }`:"vec4 vvColor() { return vec4(1.0); }"} + `)):i.code.add(V`vec4 vvColor() { return vec4(1.0); }`)}const UU=.1,Cl=.001;function d6e(t){const e=new Cr,i=t.signedDistanceFieldEnabled;if(e.include(G9e,t),e.include(oo,t),t.occlusionPass)return e.include(txt,t),e;const{vertex:r,fragment:n}=e;e.include(ple),n.include(o0),n.include(h1),e.include(e_,t),e.include(e6,t),e.include(c6e),e.varyings.add("vcolor","vec4"),e.varyings.add("vtc","vec2"),e.varyings.add("vsize","vec2"),e.varyings.add("voccluded","float"),r.uniforms.add(new gr("viewport",(f,_)=>_.camera.fullViewport),new ln("screenOffset",(f,_)=>or(p6e,2*f.screenOffset[0]*_.camera.pixelRatio,2*f.screenOffset[1]*_.camera.pixelRatio)),new ln("anchorPosition",f=>FL(f)),new gr("materialColor",f=>f.color)),bP(r),i&&(r.uniforms.add(new gr("outlineColor",f=>f.outlineColor)),n.uniforms.add(new gr("outlineColor",f=>bye(f)?f.outlineColor:gp),new ft("outlineSize",f=>bye(f)?f.outlineSize:0))),t.pixelSnappingEnabled&&r.include(Jj),t.hasScreenSizePerspective&&(V2t(r),Zj(r)),t.debugDrawLabelBorder&&e.varyings.add("debugBorderCoords","vec4"),e.attributes.add(J.UV0,"vec2"),e.attributes.add(J.COLOR,"vec4"),e.attributes.add(J.SIZE,"vec2"),e.attributes.add(J.FEATUREATTRIBUTE,"vec4"),r.code.add(V` + void main(void) { + ProjectHUDAux projectAux; + vec4 posProj = projectPositionHUD(projectAux); + forwardObjectAndLayerIdColor(); + + if (rejectBySlice(projectAux.posModel)) { + // Project outside of clip plane + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + return; + } + vec2 inputSize; + ${t.hasScreenSizePerspective?V` + inputSize = screenSizePerspectiveScaleVec2(size, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspective); + vec2 screenOffsetScaled = screenSizePerspectiveScaleVec2(screenOffset, projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment); + `:V` + inputSize = size; + vec2 screenOffsetScaled = screenOffset;`} + + ${t.vvSize?"inputSize *= vvScale(featureAttribute).xx;":""} + + vec2 combinedSize = inputSize * pixelRatio; + vec4 quadOffset = vec4(0.0); + bool visible = testHUDVisibility(posProj); + voccluded = visible ? 0.0 : 1.0; + `);const s=V`vec2 uv01 = floor(uv0); +vec2 uv = uv0 - uv01; +quadOffset.xy = ((uv01 - anchorPosition) * 2.0 * combinedSize + screenOffsetScaled) / viewport.zw * posProj.w;`,o=t.pixelSnappingEnabled?i?V`posProj = alignToPixelOrigin(posProj, viewport.zw) + quadOffset;`:V`posProj += quadOffset; +if (inputSize.x == size.x) { +posProj = alignToPixelOrigin(posProj, viewport.zw); +}`:V`posProj += quadOffset;`;r.code.add(V` + ${t.occlusionTestEnabled?"if (visible) {":""} + ${s} + ${t.vvColor?"vcolor = interpolateVVColor(featureAttribute.y) * materialColor;":"vcolor = color / 255.0 * materialColor;"} + + ${t.output===ue.ObjectAndLayerIdColor?V`vcolor.a = 1.0;`:""} + + bool alphaDiscard = vcolor.a < ${V.float(Cl)}; + ${i?`alphaDiscard = alphaDiscard && outlineColor.a < ${V.float(Cl)};`:""} + if (alphaDiscard) { + // "early discard" if both symbol color (= fill) and outline color (if applicable) are transparent + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } else { + ${o} + gl_Position = posProj; + } + + vtc = uv; + + ${t.debugDrawLabelBorder?"debugBorderCoords = vec4(uv01, 1.5 / combinedSize);":""} + vsize = inputSize; + ${t.occlusionTestEnabled?V`} else { vtc = vec2(0.0); + ${t.debugDrawLabelBorder?"debugBorderCoords = vec4(0.5, 0.5, 1.5 / combinedSize);}":"}"}`:""} + } + `),n.uniforms.add(new Zt("tex",f=>f.texture));const l=t.debugDrawLabelBorder?V`(isBorder > 0.0 ? 0.0 : ${V.float(UU)})`:V.float(UU),c=V` + ${t.debugDrawLabelBorder?V` + float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`:""} + + ${t.sampleSignedDistanceFieldTexelCenter?V` + // Attempt to sample texel centers to avoid that thin cross outlines + // disappear with large symbol sizes. + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/7058#issuecomment-603041 + float txSize = float(textureSize(tex, 0).x); + float texelSize = 1.0 / txSize; + + // Calculate how much we have to add/subtract to/from each texel to reach the size of an onscreen pixel + vec2 scaleFactor = (vsize - txSize) * texelSize; + vec2 samplePos = vtc + (vec2(1.0, -1.0) * texelSize) * scaleFactor; + `:V` + vec2 samplePos = vtc; + `} + + ${i?V` + vec4 fillPixelColor = vcolor; + + // Get distance and map it into [-0.5, 0.5] + float d = rgba2float(texture(tex, samplePos)) - 0.5; + + // Distance in output units (i.e. pixels) + float dist = d * vsize.x; + + // Create smooth transition from the icon into its outline + float fillAlphaFactor = clamp(0.5 - dist, 0.0, 1.0); + fillPixelColor.a *= fillAlphaFactor; + + if (outlineSize > 0.25) { + vec4 outlinePixelColor = outlineColor; + float clampedOutlineSize = min(outlineSize, 0.5*vsize.x); + + // Create smooth transition around outline + float outlineAlphaFactor = clamp(0.5 - (abs(dist) - 0.5*clampedOutlineSize), 0.0, 1.0); + outlinePixelColor.a *= outlineAlphaFactor; + + if ( + outlineAlphaFactor + fillAlphaFactor < ${l} || + fillPixelColor.a + outlinePixelColor.a < ${V.float(Cl)} + ) { + discard; + } + + // perform un-premultiplied over operator (see https://en.wikipedia.org/wiki/Alpha_compositing#Description) + float compositeAlpha = outlinePixelColor.a + fillPixelColor.a * (1.0 - outlinePixelColor.a); + vec3 compositeColor = vec3(outlinePixelColor) * outlinePixelColor.a + + vec3(fillPixelColor) * fillPixelColor.a * (1.0 - outlinePixelColor.a); + + fragColor = vec4(compositeColor, compositeAlpha); + } else { + if (fillAlphaFactor < ${l}) { + discard; + } + + fragColor = premultiplyAlpha(fillPixelColor); + } + + // visualize SDF: + // fragColor = vec4(clamp(-dist/vsize.x*2.0, 0.0, 1.0), clamp(dist/vsize.x*2.0, 0.0, 1.0), 0.0, 1.0); + `:V` + vec4 texColor = texture(tex, vtc, -0.5); + if (texColor.a < ${l}) { + discard; + } + fragColor = texColor * premultiplyAlpha(vcolor); + `} + + // Draw debug border with transparency, so that original texels along border are still partially visible + ${t.debugDrawLabelBorder?V`fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), isBorder * 0.5);`:""} + `;switch(t.output){case ue.Color:n.code.add(V` + void main() { + ${c} + ${t.transparencyPassType===Jt.FrontFace?"fragColor.rgb /= fragColor.a;":""} + }`);break;case ue.Alpha:n.code.add(V` + void main() { + ${c} + fragColor = vec4(fragColor.a); + }`);break;case ue.ObjectAndLayerIdColor:n.code.add(V` + void main() { + ${c} + outputObjectAndLayerIdColor(); + }`);break;case ue.Highlight:n.constants.add("occludedHighlightFlag","vec4",u6e).add("unoccludedHighlightFlag","vec4",ble),n.code.add(V` + void main() { + ${c} + if (voccluded == 1.0) { + fragColor = occludedHighlightFlag; + } else { + fragColor = unoccludedHighlightFlag; + } + }`)}return e}function bye(t){return t.outlineColor[3]>0&&t.outlineSize>0}function FL(t,e=p6e){return t.textureIsSignedDistanceField?ixt(t.anchorPosition,t.distanceFieldBoundingBox,e):Qo(e,t.anchorPosition),e}function ixt(t,e,i){e!=null?or(i,t[0]*(e[2]-e[0])+e[0],t[1]*(e[3]-e[1])+e[1]):or(i,0,0)}const p6e=yt(),rxt=Object.freeze(Object.defineProperty({__proto__:null,build:d6e,calculateAnchorPosForRendering:FL},Symbol.toStringTag,{value:"Module"})),vp=Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),nxt=hd(st.ONE,st.ONE),f6e=hd(st.ZERO,st.ONE_MINUS_SRC_ALPHA);function Y_(t){return t===Jt.FrontFace?null:t===Jt.Alpha?f6e:nxt}function Kj(t){return t===Jt.FrontFace?rh:null}const Qj=5e5,eG={factor:-1,units:-2};function tG(t){return t?eG:null}function px(t,e=Zr.LESS){return t===Jt.NONE||t===Jt.FrontFace?e:Zr.LEQUAL}let m6e=class g6e extends Hr{initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global}initializeProgram(e){return new Ir(e.rctx,g6e.shader.get().build(this.configuration),Er)}initializePipeline(){const e=this.configuration.transparencyPassType,i=this.configuration,r=e===Jt.NONE,n=e===Jt.FrontFace,s=this.configuration.hasPolygonOffset?sxt:null,o=(r||n)&&i.output!==ue.Highlight&&(i.depthEnabled||i.occlusionPass)?rh:null;return Ti({blending:i.output===ue.Color||i.output===ue.Alpha||i.output===ue.Highlight?r?oxt:Y_(e):null,depthTest:{func:Zr.LEQUAL},depthWrite:o,colorWrite:ji,polygonOffset:s})}get primitiveType(){return this.configuration.occlusionPass?sr.POINTS:sr.TRIANGLES}};m6e.shader=new Rr(rxt,()=>we(()=>Promise.resolve().then(()=>wWt),void 0));const sxt={factor:0,units:-4},oxt=hd(st.ONE,st.ONE_MINUS_SRC_ALPHA);let $o=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.transparencyPassType=Jt.NONE,this.screenCenterOffsetUnitsEnabled=!1,this.spherical=!1,this.occlusionTestEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.vvSize=!1,this.vvColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.debugDrawLabelBorder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.depthEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.occlusionPass=!1,this.objectAndLayerIdColorInstanced=!1}};y([fe({count:ue.COUNT})],$o.prototype,"output",void 0),y([fe({count:Jt.COUNT})],$o.prototype,"transparencyPassType",void 0),y([fe()],$o.prototype,"screenCenterOffsetUnitsEnabled",void 0),y([fe()],$o.prototype,"spherical",void 0),y([fe()],$o.prototype,"occlusionTestEnabled",void 0),y([fe()],$o.prototype,"signedDistanceFieldEnabled",void 0),y([fe()],$o.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),y([fe()],$o.prototype,"vvSize",void 0),y([fe()],$o.prototype,"vvColor",void 0),y([fe()],$o.prototype,"hasVerticalOffset",void 0),y([fe()],$o.prototype,"hasScreenSizePerspective",void 0),y([fe()],$o.prototype,"debugDrawLabelBorder",void 0),y([fe()],$o.prototype,"hasSlicePlane",void 0),y([fe()],$o.prototype,"hasPolygonOffset",void 0),y([fe()],$o.prototype,"depthEnabled",void 0),y([fe()],$o.prototype,"pixelSnappingEnabled",void 0),y([fe()],$o.prototype,"draped",void 0),y([fe()],$o.prototype,"multipassEnabled",void 0),y([fe()],$o.prototype,"cullAboveGround",void 0),y([fe()],$o.prototype,"occlusionPass",void 0),y([fe()],$o.prototype,"objectAndLayerIdColorInstanced",void 0),y([fe({constValue:!0})],$o.prototype,"hasSliceInVertexProgram",void 0),y([fe({constValue:!1})],$o.prototype,"hasVvInstancing",void 0);let O5=class extends hx{constructor(e){super(e,new vxt),this._configuration=new $o}getConfiguration(e,i){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVerticalOffset=!!this.parameters.verticalOffset,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen",this._configuration.hasPolygonOffset=this.parameters.polygonOffset,this._configuration.draped=this.parameters.isDraped,this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.pixelSnappingEnabled=this.parameters.pixelSnappingEnabled,this._configuration.signedDistanceFieldEnabled=this.parameters.textureIsSignedDistanceField,this._configuration.sampleSignedDistanceFieldTexelCenter=this.parameters.sampleSignedDistanceFieldTexelCenter,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.occlusionPass=i.slot===ke.OCCLUSION_PIXELS&&this.parameters.occlusionTest&&(e===ue.Color||e===ue.Alpha),e===ue.Color&&(this._configuration.debugDrawLabelBorder=!!Tn.LABELS_SHOW_BORDER),this._configuration.depthEnabled=this.parameters.depthEnabled,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.multipassEnabled=i.multipassEnabled,this._configuration.cullAboveGround=i.multipassTerrain.cullAboveGround,this._configuration}intersect(e,i,r,n,s,o){if(!(r.options.selectionMode&&r.options.hud&&e.visible&&r.point))return;const l=this.parameters,c=r.point,f=r.camera;let{scaleX:_,scaleY:x}=this._getScreenScale(e);_*=f.pixelRatio,x*=f.pixelRatio,Yf(rW,i),e.attributes.has(J.FEATUREATTRIBUTE)&&cxt(rW);const T=e.attributes.get(J.POSITION),A=e.attributes.get(J.SIZE),M=e.attributes.get(J.NORMAL),I=e.attributes.get(J.AUXPOS1);Xt(T.size>=3);const L=FL(l),F=this.parameters.centerOffsetUnits==="screen";for(let z=0;z-1){F&&(wd[0]||wd[1])&&(Fc[0]+=wd[0]*f.pixelRatio,wd[1]!==0&&(Fc[1]+=ule(wd[1],iW.factorAlignment)*f.pixelRatio),f.unapplyProjection(Fc,tc)),Fc[0]+=this.parameters.screenOffset[0]*f.pixelRatio,Fc[1]+=this.parameters.screenOffset[1]*f.pixelRatio,Fc[0]=Math.floor(Fc[0]),Fc[1]=Math.floor(Fc[1]),$9e(_b,iW.factor,_b);const Y=mxt*f.pixelRatio;let Q=0;if(l.textureIsSignedDistanceField&&(Q=l.outlineSize*f.pixelRatio/2),wye(c,Fc[0],Fc[1],_b,Y,Q,l,L)){const ne=r.ray;if(bt(xye,tc,Vo(dxt,f.viewMatrix)),Fc[0]=c[0],Fc[1]=c[1],f.unprojectFromRenderScreen(Fc,tc)){const re=W();Ne(re,ne.direction);const he=1/rt(re);De(re,re,he),o(Sn(ne.origin,tc)*he,re,-1,!0,1,xye)}}}}}intersectDraped(e,i,r,n,s,o){const l=e.attributes.get(J.POSITION),c=e.attributes.get(J.SIZE),f=this.parameters,_=FL(f);let{scaleX:x,scaleY:T}=this._getScreenScale(e);x*=e.screenToWorldRatio,T*=e.screenToWorldRatio;const A=gxt*e.screenToWorldRatio;for(let M=0;M0?_:1/_),s}_applyVerticalGroundOffsetView(e,i,r,n){const s=rt(e),o=r.aboveGround?1:-1,l=r.computeRenderPixelSizeAtDist(s)*j9e,c=De(tc,i.normal,o*l);return Be(n,e,c),n}_applyVerticalOffsetTransformationView(e,i,r,n){var f;const s=this.parameters;if(!((f=s.verticalOffset)!=null&&f.screenLength)){if(s.screenSizePerspective||s.screenSizePerspectiveAlignment){const _=rt(e);this._updateScaleInfo(n,_,i.cosAngle)}else n.factor.scale=1,n.factorAlignment.scale=1;return e}const o=rt(e),l=s.screenSizePerspectiveAlignment??s.screenSizePerspective,c=X9e(r,o,s.verticalOffset,i.cosAngle,l);return this._updateScaleInfo(n,o,i.cosAngle),De(i.normal,i.normal,c),Be(e,e,i.normal)}_applyCenterOffsetView(e,i,r){const n=this.parameters.centerOffsetUnits!=="screen";return r!==e&&Ne(r,e),n&&(r[0]+=i[0],r[1]+=i[1],i[2]&&(Ye(pR,r),Be(r,r,De(pR,pR,i[2])))),r}_applyCenterOffsetNDC(e,i,r,n){const s=this.parameters.centerOffsetUnits!=="screen";return n!==e&&Ne(n,e),s||(n[0]+=i[0]/r.fullWidth*2,n[1]+=i[1]/r.fullHeight*2),n}_applyPolygonOffsetNDC(e,i,r,n){const s=this.parameters.shaderPolygonOffset;if(e!==n&&Ne(n,e),s){const o=r.aboveGround?1:-1,l=o*Math.sign(i[3]);n[2]-=(l||o)*s}return n}produces(e,i){if(i===ue.Color||i===ue.Alpha||i===ue.Highlight||i===ue.ObjectAndLayerIdColor){if(e===ke.DRAPED_MATERIAL)return!0;const{drawInSecondSlot:r,occlusionTest:n}=this.parameters;return e===(r?ke.LABEL_MATERIAL:ke.HUD_MATERIAL)||n&&e===ke.OCCLUSION_PIXELS}return!1}createGLMaterial(e){return new axt(e)}calculateRelativeScreenBounds(e,i,r=Ni()){return lxt(this.parameters,e,i,r),r[2]=r[0]+e[0],r[3]=r[1]+e[1],r}_getScreenScale(e){const i=e.attributes.get(J.FEATUREATTRIBUTE);if(i==null)return{scaleX:1,scaleY:1};const r=YB(i.data,fxt),[n,s]=dle(pxt,this.parameters,r);return{scaleX:n,scaleY:s}}},axt=class extends wae{constructor(e){super({...e,...e.material.parameters})}selectProgram(e){return this.ensureTechnique(m6e,e)}beginSlot(e){return this.updateTexture(this._material.parameters.textureId),this._material.setParameters(this.textureBindParameters),this.selectProgram(e)}};function lxt(t,e,i,r=uxt){return Qo(r,t.anchorPosition),r[0]*=-e[0],r[1]*=-e[1],r[0]+=t.screenOffset[0]*i,r[1]+=t.screenOffset[1]*i,r}function cxt(t){const e=t[0],i=t[1],r=t[2],n=t[3],s=t[4],o=t[5],l=t[6],c=t[7],f=t[8],_=1/Math.sqrt(e*e+i*i+r*r),x=1/Math.sqrt(n*n+s*s+o*o),T=1/Math.sqrt(l*l+c*c+f*f);return t[0]=e*_,t[1]=i*_,t[2]=r*_,t[3]=n*x,t[4]=s*x,t[5]=o*x,t[6]=l*T,t[7]=c*T,t[8]=f*T,t}function wye(t,e,i,r,n,s,o,l){let c=e-n-(l[0]>0?r[0]*l[0]:0),f=c+r[0]+2*n,_=i-n-(l[1]>0?r[1]*l[1]:0),x=_+r[1]+2*n;const T=o.distanceFieldBoundingBox;return o.textureIsSignedDistanceField&&T!=null&&(c+=r[0]*T[0],_+=r[1]*T[1],f-=r[0]*(1-T[2]),x-=r[1]*(1-T[3]),c-=s,f+=s,_-=s,x+=s),t[0]>c&&t[0]_&&t[1]0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){return this._state!==Ph.Idle||this._dirty}get updatingProgress(){if(!this.updating)return 1;const t=this._state/Ph.NumStates;return this._dirty?.5*t:t}get running(){return this.view.ready&&this.view.state!=null&&this.updating}runTask(t){switch(this._state){case Ph.Idle:this._startUpdate(),t.madeProgress();case Ph.Process:if(this._state=Ph.Process,!this._processActiveGraphics(t))return;case Ph.Sort:if(this._state=Ph.Sort,!this._sortVisibleGraphics(t))return;case Ph.Deconflict:if(this._state=Ph.Deconflict,!this._deconflictVisibleGraphics(t))return;default:g2t(this,this._visible),this._state=Ph.Idle,this.notifyChange("updating")}}modifyGraphics(t,e){e?t.forEach(i=>this.addToActiveGraphics(i)):t.forEach(i=>this.removeFromActiveGraphics(i)),this.setDirty()}layerSupportsDeconfliction(t){if(t==null||t.type!=="object3d")return!1;const e=t.stageObject;if(((e==null?void 0:e.geometries.length)??0)!==1)return!1;const i=e==null?void 0:e.geometries[0];return(i==null?void 0:i.material)instanceof O5}_startUpdate(){y2t(this.view),this._dirty=!1,this._runningViewState.copyFrom(this.viewState);const{fullWidth:t,fullHeight:e}=this._runningViewState.camera;this._initBins(t,e),this._resetIterators()}addToActiveGraphics(t){t.info[this.visibilityGroup]=new Ext,this._active.set(t.graphics3DGraphic.graphic.uid,t),this.setDirty()}removeFromActiveGraphics(t){this._visible.delete(t.graphics3DGraphic.graphic.uid),Axt(t,this.visibilityGroup),delete t.info[this.visibilityGroup],this._active.delete(t.graphics3DGraphic.graphic.uid),this.setDirty()}_processActiveGraphics(t){const e=this._ensureActiveGraphicsIterator(),i=sP(wxt,this._runningViewState.camera.projectionMatrix),r=this.view.viewingMode==="global"&&this.view.map.ground.opacity===1&&this._runningViewState.camera.relativeElevation>0?xxt:null;let n=0;for(r!=null&&(bt(r,Ka,this._runningViewState.camera.viewMatrix),r[3]=Sr(this.view.spatialReference).radius,n=nRe(r,Ka));!t.done;){t.madeProgress();const s=e.next();if(s.done===!0)return this._resetActiveGraphicsIterator(),!0;const o=s.value,l=o==null?void 0:o.info[this.visibilityGroup];l&&(this._collectGraphics3DGraphics(o,i,r,n),l.culled?this._visible.delete(o.graphics3DGraphic.graphic.uid):this._visible.set(o.graphics3DGraphic.graphic.uid,o))}return!1}_sortVisibleGraphics(t){const e=this._ensureSortGraphicsIterator();for(;!t.done;){const i=e.next();if(t.madeProgress(),i.done===!0)return this._resetSortGraphicsIterator(),!0}return!1}_deconflictVisibleGraphics(t){const e=this._ensureVisibleGraphicsIterator(),i=this.visibilityGroup===Ya.LABEL;for(;!t.done;){t.madeProgress();const r=e.next();if(r.done===!0)return this._resetVisibleGraphicsIterator(),!0;const n=r.value,s=n.info[this.visibilityGroup];if(!s||s.culled){this._setGraphicVisibility(n,!1);continue}const o=n.graphics3DGraphic,l=!i||o.isVisible();s.visible=l&&!this._isConflicted(n),s.visible&&this._addToBins(n),this._setGraphicVisibility(n,s.visible),_2t(s,s.visible)}return!1}_resetIterators(){this._iterators.active=null,this._iterators.visible=null,this._iterators.sort=null}_ensureActiveGraphicsIterator(){return this._iterators.active||(this._iterators.active=Sye(this._active)),this._iterators.active}_resetActiveGraphicsIterator(){this._iterators.active=null}_ensureVisibleGraphicsIterator(){return this._iterators.visible||(this._iterators.visible=Sye(this._visible)),this._iterators.visible}_resetVisibleGraphicsIterator(){this._iterators.visible=null}_ensureSortGraphicsIterator(){return this._iterators.sort||(this._iterators.sort=Mxt(this._visible,this._iterators.sortArray,this.visibilityGroup)),this._iterators.sort}_resetSortGraphicsIterator(){this._iterators.sort=null}_collectGraphics3DGraphics(t,e,i,r){const n=t.graphics3DGraphic;if(n.destroyed)return;const s=t.info[this.visibilityGroup];if(!n.isVisible(Ya.GRAPHIC,Hl.DECONFLICTION))return void(s.culled=!0);const o=this.getGraphicsLayers(n);od(s.aabr);let l=null;for(const c of o){if(!this.layerSupportsDeconfliction(c))continue;const f=c.stageObject.geometries[0].material;if(l==null&&(l=$xt,this._getProjectionInfo(c,e,l),l.isOutsideScreen||this._isCulledBySlice(t,ig)||i!=null&&this._isCulledByHorizon(l,i,r)))return void(s.culled=!0);this._expandBoundingRect(s,c,f,l)}l==null?s.culled=!0:(s.distance=l.distance,s.culled=!1)}_getProjectionInfo(t,e,i){const r=this._runningViewState.camera,n=t.stageObject,s=n.geometries[0],o=s.material,l=n.boundingVolumeWorldSpace.bounds;bt(ig,l,r.viewMatrix);const c=s.attributes,f=c.get(J.NORMAL).data,_=c.get(J.AUXPOS1).data;o.applyShaderOffsetsView(ig,f,n.transformation,_,r,i.scaleInfo,ig),rs(hC,ig[0],ig[1],ig[2],1),lp(fR,hC,r.projectionMatrix),De(i.positionNDC,fR,1/fR[3]),o.applyShaderOffsetsNDC(i.positionNDC,_,r,i.positionNDC,sW),i.distanceWithoutPolygonOffset=r.depthNDCToWorld(sW[2]),i.distance=sW[2]===i.positionNDC[2]?i.distanceWithoutPolygonOffset:r.depthNDCToWorld(i.positionNDC[2]),rs(fR,i.positionNDC[0],i.positionNDC[1],i.positionNDC[2],1),lp(hC,fR,e),UT(hC,hC,1/hC[3]),Ie(i.positionView,ig[0],ig[1],ig[2])}_isCulledByHorizon(t,e,i){return Ne(oW.direction,t.positionView),Ie(oW.origin,0,0,0),!!lx(e,oW,Sxt)&&t.distanceWithoutPolygonOffset>i}_isCulledBySlice(t,e){return t.slicePlaneEnabled&&this._runningViewState.slicePlaneEnabled&&Koe(this._runningViewState.slicePlane,e)}_expandBoundingRect(t,e,i,{positionNDC:r,scaleInfo:n}){const s=this._runningViewState.camera,o=e.getScreenSize(Rxt);$9e(o,n.factor,o),o[0]*=s.pixelRatio,o[1]*=s.pixelRatio;const l=Fz(i.calculateRelativeScreenBounds(o,n.factorAlignment.scale,Txt),ui(0,s.fullWidth,.5+.5*r[0]),ui(0,s.fullHeight,.5+.5*r[1])),c=this.marginFactor;if(c!==0){const f=c*Math.min(_c(l),qu(l));l[0]-=f,l[1]-=f,l[2]+=f,l[3]+=f}g2(t.aabr,l,t.aabr)}_isConflicted(t){const e=t.graphics3DGraphic.graphic.uid,i=t.info[this.visibilityGroup];let r=!0;for(let n=Math.floor(i.aabr[0]/this._accBinsSizeX);n<=Math.floor(i.aabr[2]/this._accBinsSizeX);n++)if(!(n<0||n>=this._accBinsNumX))for(let s=Math.floor(i.aabr[1]/this._accBinsSizeY);s<=Math.floor(i.aabr[3]/this._accBinsSizeY);s++){if(s<0||s>=this._accBinsNumY)continue;r=!1;const o=this._accBins[n][s];for(let l=0;l=this._accBinsNumX))for(let l=n;l<=s;l++)l<0||l>=this._accBinsNumY||this._accBins[o][l].push(t)}_setGraphicVisibility(t,e){const i=t.graphics3DGraphic;i.destroyed||(i.setVisibilityFlag(this.visibilityGroup,Hl.DECONFLICTION,e),this.visibilityGroup===Ya.LABEL&&this.view.labeler.setLabelGraphicVisibility(i,e))}};function Axt(t,e){const i=t.graphics3DGraphic;i.destroyed||i.setVisibilityFlag(e,Hl.DECONFLICTION,!0)}function*Sye(t){if(Map.prototype.entries){const e=t.entries();for(let i=e.next();!i.done;i=e.next())yield i.value[1]}else yield*t.values()}function*Mxt(t,e,i){e.clear(),t.forEach((n,s)=>{var c;const o=e.pushNew();o.id=s,o.visible=n.graphics3DGraphic.getVisibilityFlag(i,Hl.DECONFLICTION);const l=(c=n.info)==null?void 0:c[i];o.prio=n.graphics3DGraphic.deconflictionPriority,o.distance=l?l.distance:Number.MAX_VALUE}),yield;const r=e.iterableSort((n,s)=>n.prio!==s.prio?s.prio-n.prio:n.distance!==s.distance?n.distance-s.distance:n.visible!==s.visible?n.visible?-1:1:n.id-s.id);for(let n=r.next();!n.done;n=r.next())yield;e.forAll(n=>{const s=t.get(n.id);s&&(t.delete(n.id),t.set(n.id,s))}),e.clear()}y([w({constructOnly:!0})],FM.prototype,"view",void 0),y([w({type:Boolean,readOnly:!0})],FM.prototype,"updating",null),FM=y([Z("esri.views.3d.layers.graphics.Deconflictor")],FM);class Oxt{constructor(){this.id=0,this.visible=!1,this.prio=0,this.distance=0}}class Pxt{constructor(e=null,i=null,r=null){this.active=e,this.visible=i,this.sort=r,this.sortArray=new Pi({allocator:n=>n||new Oxt})}}const Rxt=yt();class Ixt{constructor(){this.positionView=W(),this.positionNDC=W(),this.distance=0,this.distanceWithoutPolygonOffset=0,this.scaleInfo=new Q9e}get isOutsideScreen(){const e=this.positionNDC;return e[0]<-1||e[1]<-1||e[2]<-1||e[0]>=1||e[1]>=1}}const $xt=new Ixt,Lxt=2e3;let ek=class extends FM{constructor(e){super(e),this.visibilityGroup=Ya.LABEL,this.marginFactor=.05,this._lastDeconfliction=0}get viewState(){return this.parent.viewState}runTask(e){if(this.parent.running)return Xl.YIELD;const i=performance.now();if(e.state!==Vr.IDLE&&i-this._lastDeconfliction{var e,i;return(i=(e=this.view)==null?void 0:e.state)==null?void 0:i.camera},()=>{this._updateViewState(),this.setDirty()}),_e(()=>{var e,i,r;return(r=(i=(e=this.view)==null?void 0:e.map)==null?void 0:i.ground)==null?void 0:r.opacity},(e,i)=>{e!==1&&i!==1||this.setDirty()}),_e(()=>{var e;return(e=this.view)==null?void 0:e.slicePlane},()=>{this._updateSlicePlane(),this._slicePlaneChanged()},ii)]),this._frameTask=this.view.resourceController.scheduler.registerTask(ni.GRAPHICS_DECONFLICTOR,this),this._labels=new ek({view:this.view,parent:this})}destroy(){this._labels=et(this._labels),this._frameTask=en(this._frameTask)}get marginFactor(){return this._marginFactor}set marginFactor(e){this._marginFactor=e,this.setDirty()}setDirty(){this._contexts.size>0&&(super.setDirty(),this._labels.setDirty())}runTask(e){super.runTask(e),this.running||this._labels.setDirty()}setInitialIconVisibilityFlag(e,i){const r=!(this._graphicSupportsDeconfliction(i)&&aW(e));i.setVisibilityFlag(Ya.GRAPHIC,Hl.DECONFLICTION,r)}_updateViewState(){var e;(e=this.view)!=null&&e.state&&(this._viewState.camera.copyFrom(this.view.state.camera),this._updateSlicePlane())}_updateSlicePlane(){const e=this.view?this.view.slicePlane:null;e!=null&&w4e(e,this._viewState.camera.viewMatrix,this._viewState.slicePlane),this._viewState.slicePlaneEnabled=e!=null}_slicePlaneChanged(){rp(this._contexts,(e,i)=>i.symbolCreationContext.slicePlaneEnabled)&&this.setDirty()}addGraphicsOwner(e){const i=this._getGraphicsContext(e);return{addGraphic:r=>this._addGraphic(e,i,r),removeGraphic:r=>this._removeGraphic(i,r),labelingInfoChange:()=>this._labels.enabledChanged(e,i),featureReductionChange:()=>this.enabledChanged(e,i),slicePlaneEnabledChange:()=>this._slicePlaneEnabledChanged(e,i),clear:()=>i.forEach(r=>this._removeGraphic(i,r.graphics3DGraphic))}}removeGraphicsOwner(e){const i=this._contexts.get(e);i&&(i.forEach(r=>this._removeGraphic(i,r.graphics3DGraphic)),this._contexts.delete(e),this.setDirty())}_addGraphic(e,i,r){const n=r.graphic.uid,s=new Cxt(r,e.symbolCreationContext.slicePlaneEnabled);i.set(n,s),aW(e)&&this.addToActiveGraphics(s),e.labelsEnabled&&this._labels.addToActiveGraphics(s)}_removeGraphic(e,i){const r=i.graphic.uid,n=e.get(r);n&&(this.removeFromActiveGraphics(n),this._labels.removeFromActiveGraphics(n),e.delete(r),this.setDirty())}enabledChanged(e,i){const r=aW(e);r||Dxt(e),this.modifyGraphics(i,r)}_slicePlaneEnabledChanged(e,i){const r=e.symbolCreationContext.slicePlaneEnabled;i.forEach(n=>n.slicePlaneEnabled=r),this.setDirty()}getGraphicsLayers(e){return e.layers}_graphicSupportsDeconfliction(e){if(e.isDraped)return!1;const i=e.layers;if(!(i!=null&&i.length))return!1;for(const r of i)if(this.layerSupportsDeconfliction(r))return!0;return!1}_getGraphicsContext(e){const i=this._contexts.get(e);if(i)return i;const r=new Map;return this._contexts.set(e,r),this.setDirty(),r}};function aW(t){const e=t.layer;return!(!(e!=null&&e.featureReduction)||e.featureReduction.type!=="selection")}function Dxt(t){const e=t.graphics3DGraphics;e&&e.forEach(i=>i.setVisibilityFlag(Ya.GRAPHIC,Hl.DECONFLICTION,!0))}iie=y([Z("esri.views.3d.layers.graphics.GraphicsDeconflictor")],iie);function b6e(t){return"declaredClass"in t}function Tye(t){return"declaredClass"in t}function Nxt(t){return"declaredClass"in t}function Fxt(t,e){return t?Nxt(t)?t:new Ml({layer:e,sourceLayer:e,visible:t.visible,symbol:Re(t.symbol),attributes:Re(t.attributes),geometry:w6e(t.geometry)}):null}function w6e(t){return t==null?null:b6e(t)?t:O2(kxt(t))}function kxt(t){const{wkid:e,wkt:i,wkt2:r,latestWkid:n}=t.spatialReference,s={wkid:e,wkt:i,wkt2:r,latestWkid:n};switch(t.type){case"point":{const{x:o,y:l,z:c,m:f}=t;return{x:o,y:l,z:c,m:f,spatialReference:s}}case"polygon":{const{rings:o,hasZ:l,hasM:c}=t;return{rings:Eye(o),hasZ:l,hasM:c,spatialReference:s}}case"polyline":{const{paths:o,hasZ:l,hasM:c}=t;return{paths:Eye(o),hasZ:l,hasM:c,spatialReference:s}}case"extent":{const{xmin:o,xmax:l,ymin:c,ymax:f,zmin:_,zmax:x,mmin:T,mmax:A,hasZ:M,hasM:I}=t;return{xmin:o,xmax:l,ymin:c,ymax:f,zmin:_,zmax:x,mmin:T,mmax:A,hasZ:M,hasM:I,spatialReference:s}}case"multipoint":{const{points:o,hasZ:l,hasM:c}=t;return{points:S6e(o)?x6e(o):o,hasZ:l,hasM:c,spatialReference:s}}default:return}}function Eye(t){return zxt(t)?t.map(e=>x6e(e)):t}function x6e(t){return t.map(e=>Array.from(e))}function zxt(t){for(const e of t)if(e.length!==0)return S6e(e);return!1}function S6e(t){return t.length>0&&(q5(t[0])||W5(t[0]))}function Uxt(t,e){if(!t)return null;let i;if(Tye(t)){if(e==null)return t.clone();if(Tye(e))return e.copy(t)}return e!=null?(i=e,i.x=t.x,i.y=t.y,i.spatialReference=t.spatialReference,t.hasZ?(i.z=t.z,i.hasZ=t.hasZ):(i.z=void 0,i.hasZ=!1),t.hasM?(i.m=t.m,i.hasM=!0):(i.m=void 0,i.hasM=!1)):(i=Xu(t.x,t.y,t.z,t.spatialReference),t.hasM&&(i.m=t.m,i.hasM=!0)),i}function Gsi(t){const{wkid:e,wkt:i,wkt2:r,latestWkid:n}=t,s={wkid:e,wkt:i,wkt2:r,latestWkid:n};return at.fromJSON(s)}const lW=Ce.getLogger("esri.layers.support.labelFormatUtils"),cW={type:"simple",evaluate:()=>null},Vxt={getAttribute:(t,e)=>t.field(e)};async function T6e(t,e,i){if(!t||!t.symbol||!e)return cW;const r=t.where,n=QB(t);let s;if(n.type==="arcade"){const o=await iit(n.expression,i,e);if(o==null)return cW;s={type:"arcade",evaluate(l,c){try{const f="attributes"in l?o.repurposeFeature(l):l;f.contextTimeZone=c??null;const _=o.evaluate({$view:{timeZone:c},$feature:f},o.services);if(_!=null)return _.toString()}catch(f){lW.error(new se("arcade-expression-error","Encountered an error when evaluating label expression for feature",{error:f,feature:l,expression:n}))}return null},needsHydrationToEvaluate:()=>boe(n.expression)==null}}else s={type:"simple",evaluate:o=>n.expression.replaceAll(/{[^}]*}/g,l=>{const c=l.slice(1,-1),f=e.get(c);if(!f)return l;let _=null;return"attributes"in o?o&&o.attributes&&(_=o.attributes[f.name]):_=o.field(f.name),_==null?"":E6e(_,f)})};if(r){let o;try{o=await Tse(r,e)}catch(c){return lW.error(new se("bad-where-clause","Encountered an error when evaluating where clause, ignoring",{where:r,error:c})),cW}const l=s.evaluate;s.evaluate=(c,f)=>{const _="attributes"in c?void 0:Vxt;try{if(o.testFeature(c,_))return l(c,f)}catch(x){lW.error(new se("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:r,feature:c,error:x}))}return null}}return s}function E6e(t,e){if(t==null)return"";const i=e.domain;if(i){if(i.type==="codedValue"||i.type==="coded-value"){const n=t;for(const s of i.codedValues)if(s.code===n)return s.name}else if(i.type==="range"){const{max:n,min:s}=vMe(e),o=+t;if(s!=null&&n!=null&&s<=o&&o<=n)return i.name}}let r=t;return Ase(e)?r=js(r,oA("short-date")):Cse(e)&&(r=nd(+r)),r||""}const Hsi=Object.freeze(Object.defineProperty({__proto__:null,createLabelFunction:T6e,formatField:E6e},Symbol.toStringTag,{value:"Module"}));function wle(t,e){if(t.type==="point")return bb(t,e,!1);if(b6e(t))switch(t.type){case"extent":return bb(t.center,e,!1);case"polygon":return bb(t.centroid,e,!1);case"polyline":return bb(Cye(t),e,!0);case"mesh":return bb(t.origin,e,!1)}else switch(t.type){case"extent":return bb(Bxt(t),e,!0);case"polygon":return bb(jxt(t),e,!0);case"polyline":return bb(Cye(t),e,!0)}}function Cye(t){const e=t.paths[0];if(!e||e.length===0)return null;const i=iAe(e,tAe(e)/2);return Xu(i[0],i[1],i[2],t.spatialReference)}function Bxt(t){return Xu(.5*(t.xmax+t.xmin),.5*(t.ymax+t.ymin),t.zmin!=null&&t.zmax!=null&&isFinite(t.zmin)&&isFinite(t.zmax)?.5*(t.zmax+t.zmin):void 0,t.spatialReference)}function jxt(t){const e=t.rings[0];if(!e||e.length===0)return null;const i=nAe(t.rings,!!t.hasZ);return Xu(i[0],i[1],i[2],t.spatialReference)}function bb(t,e,i){const r=i?t:Uxt(t);return e&&t?N5e(t,r,e)?r:null:r}function qsi(t,e,i,r=0){if(t){e||(e=Ni());const n=t;let s=.5*n.width*(i-1),o=.5*n.height*(i-1);return n.width<1e-7*n.height?s+=o/20:n.height<1e-7*n.width&&(o+=s/20),rs(e,n.xmin-s-r,n.ymin-o-r,n.xmax+s+r,n.ymax+o+r),e}return null}function C6e(t,e){for(let i=0;i3&&(r[3]=t[3]),i&&(r[0]*=i,r[1]*=i,r[2]*=i,r[3]*=i),r}function Wsi(t,e,i,r,n,s=[0,0,0,0]){for(let o=0;o<3;++o)s[o]=(t==null?void 0:t[o])!=null?t[o]:(i==null?void 0:i[o])!=null?i[o]:n[o];return s[3]=e??r??n[3],s}function Aye(t=Bv,e,i,r=1){const n=new Array(3);if(e==null||i==null)n[0]=1,n[1]=1,n[2]=1;else{let s,o=0;for(let l=2;l>=0;l--){const c=t[l];let f;const _=c!=null,x=l===0&&!s&&!_,T=i[l];c==="symbol-value"||x?f=T!==0?e[l]/T:1:_&&c!=="proportional"&&isFinite(c)&&(f=T!==0?c/T:1),f!=null&&(n[l]=f,s=f,o=Math.max(o,Math.abs(f)))}for(let l=2;l>=0;l--)n[l]==null?n[l]=s:n[l]===0&&(n[l]=.001*o)}for(let s=2;s>=0;s--)n[s]/=r;return mc(n)}function Gxt(t){return t.isPrimitive!=null}function iG(t){return rie(Gxt(t)?[t.width,t.depth,t.height]:t)?null:"Symbol sizes may not be negative values"}function rie(t){const e=i=>i==null||i>=0;return Array.isArray(t)?t.every(e):e(t)}function Hxt(t,e,i,r=Qe()){return t&&YO(r,r,-t/180*Math.PI),e&&WO(r,r,e/180*Math.PI),i&&TB(r,r,i/180*Math.PI),r}function xle(t,e,i){if(i.minDemResolution!=null)return i.minDemResolution;const r=ws(e),n=dE(t)*r,s=pE(t)*r,o=sx(t)*(e.isGeographic?1:r);return n===0&&s===0&&o===0?i.minDemResolutionForPoints:.01*Math.max(n,s,o)}function A6e(t,e,i,r,n,s,o,l,c,f,_){const x=Qxt[_.mode];let T,A,M=0;if(vn(t,e,i,r,c.spatialReference,n,l))return x.requiresAlignment(_)?(M=x.applyElevationAlignmentBuffer(r,n,s,o,l,c,f,_),T=s,A=o):(T=r,A=n),vn(T,c.spatialReference,A,s,f.spatialReference,o,l)?M:void 0}function Y2(t,e,i,r,n){const s=(mU(t)?t.z:j4e(t)?t.array[t.offset+2]:t[2])||0;switch(i.mode){case"on-the-ground":{const o=my(e,t,"ground")??0;return n.verticalDistanceToGround=0,n.sampledElevation=o,void(n.z=o)}case"relative-to-ground":{const o=my(e,t,"ground")??0,l=i.geometryZWithOffset(s,r);return n.verticalDistanceToGround=l,n.sampledElevation=o,void(n.z=l+o)}case"relative-to-scene":{const o=my(e,t,"scene")??0,l=i.geometryZWithOffset(s,r);return n.verticalDistanceToGround=l,n.sampledElevation=o,void(n.z=l+o)}case"absolute-height":{const o=i.geometryZWithOffset(s,r),l=my(e,t,"ground")??0;return n.verticalDistanceToGround=o-l,n.sampledElevation=l,void(n.z=o)}default:return void(n.z=0)}}function qxt(t,e,i,r){return Y2(t,e,i,r,kM),kM.z}function i6(t,e,i){return e==null||i==null?t.definedChanged:e==="on-the-ground"&&i==="on-the-ground"?t.staysOnTheGround:e===i||e!=="on-the-ground"&&i!=="on-the-ground"?Ys.UPDATE:t.onTheGroundChanged}function t0(t){return t==="relative-to-ground"||t==="relative-to-scene"}function X2(t){return t!=="absolute-height"}function Wxt(t,e,i,r,n){Y2(e,i,n,r,kM),C6e(t,kM.verticalDistanceToGround);const s=kM.sampledElevation,o=Ao(e3t,t.transformation);return TN[0]=e.x,TN[1]=e.y,TN[2]=kM.z,uu(e.spatialReference,TN,o,r.spatialReference)?t.transformation=o:console.warn("Could not locate symbol object properly, it might be misplaced"),s}function Yxt(t,e,i,r,n,s){let o=0;const l=s.spatialReference;e*=3,r*=3;for(let c=0;c!0},"relative-to-ground":{applyElevationAlignmentBuffer:Xxt,requiresAlignment:()=>!0},"relative-to-scene":{applyElevationAlignmentBuffer:Zxt,requiresAlignment:()=>!0}},e3t=Qe(),kM=new r6,TN=W();function Sle(t){return t.mapPositions!=null}function M6e(t,e,i,r,n){const s=t.stageObject,o=s.geometries;let l=0;for(const c of o){if(!Sle(c))continue;const{update:f,averageGeometrySampledElevation:_}=P6e(c,e,i,r,n);l+=_,f&&s.geometryVertexAttributeUpdated(c,J.POSITION)}return l/o.length}function _T(t,e,i,r,n,s){const o=t.stageObject,l=e.centerPointInElevationSR;let c=0;o.usesVerticalDistanceToGround?(r(l,Vu),C6e(o,Vu.verticalDistanceToGround),c=Vu.sampledElevation):(r(l,Vu),e.mode!=="absolute-height"&&(c=Vu.sampledElevation));const f=Ao(t3t,s??o.transformation),_=Ie(O6e,f[12],f[13],f[14]);Tn.TESTS_DISABLE_OPTIMIZATIONS?(Uu[0]=l.x,Uu[1]=l.y,Uu[2]=Vu.z,uu(l.spatialReference,Uu,f,n.spatialReference)&&(s?Ao(s,f):o.transformation=f)):n.setAltitudeOfTransformation(Vu.z,f);const x=Tle/n.unitInMeters;return(Math.abs(f[12]-_[0])>=x||Math.abs(f[13]-_[1])>=x||Math.abs(f[14]-_[2])>=x)&&(s?Ao(s,f):o.transformation=f),c}const t3t=Qe();function i3t(t,e,i,r,n){const s=t.graphics3DSymbolLayer.lodRenderer;if(s==null)return 0;const o=e.centerPointInElevationSR;r(o,Vu);const l=e.mode!=="absolute-height"?Vu.sampledElevation:0,c=s.instanceData,f=t.instanceIndex,_=n3t;c.getGlobalTransform(f,_);const x=Ie(O6e,_[12],_[13],_[14]);Tn.TESTS_DISABLE_OPTIMIZATIONS?(Uu[0]=o.x,Uu[1]=o.y,Uu[2]=Vu.z,uu(o.spatialReference,Uu,_,n.spatialReference)&&c.setGlobalTransform(f,_)):n.setAltitudeOfTransformation(Vu.z,_);const T=Tle/n.unitInMeters;return(Tn.TESTS_DISABLE_OPTIMIZATIONS||Math.abs(_[12]-x[0])>=T||Math.abs(_[13]-x[1])>=T||Math.abs(_[14]-x[2])>=T)&&c.setGlobalTransform(f,_),l}function r3t(t,e,i,r,n){const s=t.stageObject,o=s.geometries;if(o.length===0)return 0;let l=0,c=null,f=0,_=!1;for(const x of o){if(!Sle(x))continue;const T=x.attributes.get(J.POSITION);if(T!==c){const{update:A,averageGeometrySampledElevation:M}=P6e(x,e,i,r,n);f=M,c=T,_=A}_&&s.geometryVertexAttributeUpdated(x,J.POSITION),l+=f}return l/o.length}const Tle=.01,Uu=W(),Lp=W(),dC=W(),n3t=Qe(),O6e=W(),Vu=new r6;function P6e(t,e,i,r,n){let s=!1;const o=t.transformation,l=e.requiresSampledElevationInfo;Lp[0]=o[12],Lp[1]=o[13],Lp[2]=o[14],t.invalidateBoundingInfo();const c=t.getMutableAttribute(J.POSITION),f=c.data,_=c.size,x=f.length/_,T=new nae(t.mapPositions,i);let A=0,M=0;for(let I=0;I=L||Math.abs(dC[1]-f[A+1])>=L||Math.abs(dC[2]-f[A+2])>=L)&&(s=!0)}A+=_,T.offset+=3}return M/=x,{update:s,averageGeometrySampledElevation:M}}const s3t=Ce.getLogger("esri.views.3d.layers.graphics.featureExpressionInfoUtils");function o3t(t){return{cachedResult:t.cachedResult,arcade:t.arcade?{func:t.arcade.func,context:t.arcade.modules.arcadeUtils.createExecContext(null,{sr:t.arcade.context.spatialReference}),modules:t.arcade.modules}:null}}function Xsi(t){const e=t==null?void 0:t.expression;if(typeof e=="string"){const i=$6e(e);if(i!=null)return{cachedResult:i}}return null}async function Zsi(t,e,i,r){const n=t==null?void 0:t.expression;if(typeof n!="string")return null;const s=$6e(n);if(s!=null)return{cachedResult:s};const o=await p_();St(i);const l=o.arcadeUtils,c=l.createSyntaxTree(n);return l.dependsOnView(c)?(r!=null&&r.error("Expressions containing '$view' are not supported on ElevationInfo"),{cachedResult:0}):{arcade:{func:l.createFunction(c),context:l.createExecContext(null,{sr:e}),modules:o}}}function R6e(t,e,i){return t.arcadeUtils.createFeature(e.attributes,e.geometry,i)}function rG(t,e){if(t!=null&&!I6e(t)){if(!e||!t.arcade)return void s3t.errorOncePerTick("Arcade support required but not provided");const i=e;i._geometry&&(i._geometry=w6e(i._geometry)),t.arcade.modules.arcadeUtils.updateExecContext(t.arcade.context,e)}}function a3t(t){if(t!=null){if(I6e(t))return t.cachedResult;const e=t.arcade;let i=e==null?void 0:e.modules.arcadeUtils.executeFunction(e.func,e.context);return typeof i!="number"&&(t.cachedResult=0,i=0),i}return 0}function Jsi(t,e=!1){let i=t==null?void 0:t.featureExpressionInfo;const r=i==null?void 0:i.expression;return e||r==="0"||(i=null),i??null}const l3t={cachedResult:0};function I6e(t){return t.cachedResult!=null}function $6e(t){return t==="0"?0:null}let VU=class L6e{constructor(){this._meterUnitOffset=0,this._renderUnitOffset=0,this._unit="meters",this._metersPerElevationInfoUnit=1,this._featureExpressionInfoContext=null,this.centerPointInElevationSR=null,this.mode=null}get featureExpressionInfoContext(){return this._featureExpressionInfoContext}get meterUnitOffset(){return this._meterUnitOffset}get unit(){return this._unit}set unit(e){this._unit=e,this._metersPerElevationInfoUnit=SOe(e)}get requiresSampledElevationInfo(){return this.mode!=="absolute-height"}reset(){this.mode=null,this._meterUnitOffset=0,this._renderUnitOffset=0,this._featureExpressionInfoContext=null,this.unit="meters"}set offsetMeters(e){this._meterUnitOffset=e,this._renderUnitOffset=0}set offsetElevationInfoUnits(e){this._meterUnitOffset=e*this._metersPerElevationInfoUnit,this._renderUnitOffset=0}addOffsetRenderUnits(e){this._renderUnitOffset+=e}geometryZWithOffset(e,i){const r=this.calculateOffsetRenderUnits(i);return this.featureExpressionInfoContext!=null?r:e+r}calculateOffsetRenderUnits(e){let i=this._meterUnitOffset;const r=this.featureExpressionInfoContext;return r!=null&&(i+=a3t(r)*this._metersPerElevationInfoUnit),i/e.unitInMeters+this._renderUnitOffset}setFromElevationInfo(e){this.mode=e.mode,this.unit=snt(e.unit)?e.unit:"meters",this.offsetElevationInfoUnits=e.offset??0}updateFeatureExpressionInfoContext(e,i,r){if(e==null)return void(this._featureExpressionInfoContext=null);const n=e==null?void 0:e.arcade;n&&i!=null&&r!=null?(this._featureExpressionInfoContext=o3t(e),rG(this._featureExpressionInfoContext,R6e(n.modules,i,r))):this._featureExpressionInfoContext=e}static fromElevationInfo(e){const i=new L6e;return e!=null&&i.setFromElevationInfo(e),i}},c3t=class{constructor(e,i,r){this.graphic=e,this.renderingInfo=i,this.layer=r}},u3t=class{constructor(e,i,r){this.baseMaterial=e,this.edgeMaterials=i,this.properties=r}},d1=class{get isElevationSource(){return!!this.stageObject.lastValidElevationBB}constructor(e,i,r,n,s,o,l,c=null){this.graphics3DSymbolLayer=e,this.stageObject=i,this._uniqueGeometries=r,this._uniqueMaterials=n,this._sharedResource=s,this.elevationAligner=o,this.elevationContext=l,this._edgeState=c,this.type="object3d",this._stageLayer=null,this._visible=!1,this._addedToStage=!1,this.alignedSampledElevation=0,this.needsElevationUpdates=!1,this.useObjectOriginAsAttachmentOrigin=!1}initialize(e){this._stageLayer=e;const i=e.stage;i.addMany(this._uniqueMaterials),i.addMany(this._uniqueGeometries),i.add(this.stageObject)}destroy(){var r;if(!this._stageLayer)return;const e=this._stageLayer.stage;e.removeMany(this._uniqueMaterials),e.removeMany(this._uniqueGeometries),e.remove(this.stageObject),this._addedToStage&&(this._stageLayer.remove(this.stageObject),this._addedToStage=!1);const i=e.renderer.edgeView;i!=null&&i.hasObject(this.stageObject)&&i.removeObject(this.stageObject),this.stageObject.dispose(),(r=this._sharedResource)==null||r.release(),this._visible=!1,this._stageLayer=null}layerOpacityChanged(e,i){if(this._edgeState==null)return;const r=Mye(this._edgeState.baseMaterial);let n=!1;for(const s of this._edgeState.edgeMaterials)s.objectTransparency!==r&&(s.objectTransparency=r,n=!0);n&&this.resetEdgeObject(i),this._stageLayer.stage.renderer.ensureEdgeView().updateAllComponentOpacities(this.stageObject,[e])}slicePlaneEnabledChanged(e,i){this._edgeState!=null&&(this._stageLayer.stage.renderer.ensureEdgeView().updateAllComponentMaterials(this.stageObject,this._edgeState.edgeMaterials,{hasSlicePlane:e},!i),this._edgeState.properties.hasSlicePlane=e)}setVisibility(e){if(this._stageLayer!=null&&this._visible!==e&&(this._visible=e,this.stageObject.visible=e,this._visible&&!this._addedToStage&&(this._stageLayer.add(this.stageObject),this._addedToStage=!0),this._edgeState)){const i=this._stageLayer.stage.renderer.ensureEdgeView();i.hasObject(this.stageObject)?i.updateObjectVisibility(this.stageObject,e):e&&this._addOrUpdateEdgeObject(i,!1)}}get visible(){return this._visible}alignWithElevation(e,i,r,n){if(this.elevationAligner==null)return;r!=null&&rG(this.elevationContext.featureExpressionInfoContext,r);const s=(o,l)=>Y2(o,e,this.elevationContext,i,l);this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,e.spatialReference,s,i),this.resetEdgeObject(n)}alignWithAbsoluteElevation(e,i,r){const n=(s,o)=>{o.sampledElevation=e,o.verticalDistanceToGround=0,o.z=e};this.alignedSampledElevation=this.elevationAligner(this,this.elevationContext,null,n,i),this.resetEdgeObject(r)}getCenterObjectSpace(e=W()){return Ne(e,this.stageObject.boundingVolumeObjectSpace.bounds)}getBoundingBoxObjectSpace(e=ya()){const i=this.stageObject.boundingVolumeObjectSpace;return HMe(e,i.min),qMe(e,i.max),e}computeAttachmentOrigin(e){const i=this.stageObject.effectiveTransformation;if(this.useObjectOriginAsAttachmentOrigin)e.render.origin[0]+=i[12],e.render.origin[1]+=i[13],e.render.origin[2]+=i[14],e.render.num++;else for(const r of this.stageObject.geometries)r.computeAttachmentOrigin(x1)&&(bt(x1,x1,i),Be(e.render.origin,e.render.origin,x1),e.render.num++)}async getProjectedBoundingBox(e,i,r,n,s){const o=this.getBoundingBoxObjectSpace(s),l=h3t,c=Dse(o)?1:l.length;for(let _=0;_{var s;return(s=this._stageLayer)==null?void 0:s.sync()})}};function Mye(t){return t.isVisible()?t.parameters.transparent?Wi.TRANSPARENT:Wi.OPAQUE:Wi.INVISIBLE}const Ix=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],wb=W(),x1=W(),h3t=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]];let D6e=class{constructor(e,i=null){this.labelText=i,this.elevationOffset=e??0}};const N6e=3,nie=3,F6e=10;let k6e=class{constructor(e,i=null){this.geometry=e,this.textures=i}},z6e=class{constructor(e,i,r){this.components=e,this.minScreenSpaceRadius=i,this.pivotOffset=r;const n=this.geometries;this.numVertices=n.reduce((s,o)=>s+o.attributes.get(J.POSITION).indices.length,0)}get geometries(){return c9(this.components.map(e=>e.geometry))}},U6e=class{constructor(e){this.levels=e,this.levels.sort((i,r)=>i.minScreenSpaceRadius===r.minScreenSpaceRadius?i.numVertices-r.numVertices:i.minScreenSpaceRadius-r.minScreenSpaceRadius)}};function EN(t){const e=[];return t.levels.forEach(i=>i.components.forEach(r=>e.push(r.geometry.material))),c9(e)}function Oye(t){const e=new Array;return t.levels.forEach(i=>i.components.forEach(r=>{r.textures!=null&&e.push(...r.textures)})),c9(e)}function Pye(t){const e=new Array;return t.levels.forEach(i=>i.components.forEach(r=>e.push(r.geometry))),c9(e)}function d3t(t){switch(t){case"sphere":case"cube":case"diamond":case"cylinder":case"cone":case"inverted-cone":case"tetrahedron":return!0}return!1}function V6e(t,e){const i=(r,n,s=!1)=>new U6e(r.map(o=>{const l=n(o.tesselation);return s&&fvt(l),new z6e([new k6e(l)],o.minScreenSpaceRadius)}));switch(t){case"sphere":return i([{tesselation:0,minScreenSpaceRadius:0},{tesselation:1,minScreenSpaceRadius:8},{tesselation:2,minScreenSpaceRadius:16},{tesselation:3,minScreenSpaceRadius:50},{tesselation:4,minScreenSpaceRadius:250}],r=>uvt(e,.5,r,!0));case"cube":return i([{tesselation:0,minScreenSpaceRadius:0}],()=>tvt(e,1));case"cone":return i(uW,r=>Kme(e,1,.5,r,!1),!0);case"inverted-cone":return i(uW,r=>Kme(e,1,.5,r,!0),!0);case"cylinder":return i(uW,r=>dvt(e,1,.5,r,[0,0,1],[0,0,.5]));case"tetrahedron":return i([{tesselation:0,minScreenSpaceRadius:0}],()=>cvt(e,1),!0);case"diamond":return i([{tesselation:0,minScreenSpaceRadius:0}],()=>svt(e,1),!0);default:return}}const uW=[{tesselation:6,minScreenSpaceRadius:0},{tesselation:18,minScreenSpaceRadius:7},{tesselation:64,minScreenSpaceRadius:65}];let ff=class{constructor(e){this.estimated=!1,this.verticesPerFeature=e.verticesPerFeature??0,this.verticesPerCoordinate=e.verticesPerCoordinate??0,this.drawCallsPerFeature=e.drawCallsPerFeature??0,this.memory=e.memory??new B6e}},Ele=class extends ff{constructor(e){super(e),this.estimated=!0}},p3t=class extends ff{constructor(e,i){super(i),this.numComplexities=e}},f3t=class extends Ele{constructor(e,i){super(i),this.numComplexities=e}},B6e=class{constructor(){this.bytesPerFeature=0,this.bytesPerFeatureLabel=0,this.resourceBytes=0,this.draped={bytesPerFeature:0,bytesPerFeatureLabel:0}}};function n6(t,e){switch(e.normalType){case Br.Compressed:t.attributes.add(J.NORMALCOMPRESSED,"vec2"),t.vertex.code.add(V`vec3 normalModel() { +float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y); +return vec3(normalCompressed + sign(normalCompressed) * min(z, 0.0), z); +}`);break;case Br.Attribute:t.attributes.add(J.NORMAL,"vec3"),t.vertex.code.add(V`vec3 normalModel() { +return normal; +}`);break;case Br.ScreenDerivative:t.fragment.code.add(V`vec3 screenDerivativeNormal(vec3 positionView) { +return normalize(cross(dFdx(positionView), dFdy(positionView))); +}`);break;default:e.normalType;case Br.COUNT:case Br.Ground:}}var Br;(function(t){t[t.Attribute=0]="Attribute",t[t.Compressed=1]="Compressed",t[t.Ground=2]="Ground",t[t.ScreenDerivative=3]="ScreenDerivative",t[t.COUNT=4]="COUNT"})(Br||(Br={}));function j6e(t,e){const i=t.fragment;switch(i.code.add(V`struct ShadingNormalParameters { +vec3 normalView; +vec3 viewDirection; +} shadingParams;`),e.doubleSidedMode){case Is.None:i.code.add(V`vec3 shadingNormal(ShadingNormalParameters params) { +return normalize(params.normalView); +}`);break;case Is.View:i.code.add(V`vec3 shadingNormal(ShadingNormalParameters params) { +return dot(params.normalView, params.viewDirection) > 0.0 ? normalize(-params.normalView) : normalize(params.normalView); +}`);break;case Is.WindingOrder:i.code.add(V`vec3 shadingNormal(ShadingNormalParameters params) { +return gl_FrontFacing ? normalize(params.normalView) : normalize(-params.normalView); +}`);break;default:e.doubleSidedMode;case Is.COUNT:}}var Is;(function(t){t[t.None=0]="None",t[t.View=1]="View",t[t.WindingOrder=2]="WindingOrder",t[t.COUNT=3]="COUNT"})(Is||(Is={}));let EP=class{constructor(e){this.vertexBufferLayout=e}elementCount(e){return e.attributes.get(J.POSITION).indices.length}write(e,i,r,n,s){J2t(r,this.vertexBufferLayout,e,i,n,s)}};function nG(t,e){switch(e.normalType){case Br.Attribute:case Br.Compressed:t.include(n6,e),t.varyings.add("vNormalWorld","vec3"),t.varyings.add("vNormalView","vec3"),t.vertex.uniforms.add(new ML("transformNormalGlobalFromModel",i=>i.transformNormalGlobalFromModel),new Wm("transformNormalViewFromGlobal",i=>i.transformNormalViewFromGlobal)),t.vertex.code.add(V`void forwardNormal() { +vNormalWorld = transformNormalGlobalFromModel * normalModel(); +vNormalView = transformNormalViewFromGlobal * vNormalWorld; +}`);break;case Br.Ground:t.include(gO,e),t.varyings.add("vNormalWorld","vec3"),t.vertex.code.add(V` + void forwardNormal() { + vNormalWorld = ${e.spherical?V`normalize(vPositionWorldCameraRelative);`:V`vec3(0.0, 0.0, 1.0);`} + } + `);break;case Br.ScreenDerivative:t.vertex.code.add(V`void forwardNormal() {}`);break;default:e.normalType;case Br.COUNT:}}let G6e=class extends Z$e{constructor(){super(...arguments),this.transformNormalViewFromGlobal=as()}},H6e=class extends J$e{constructor(){super(...arguments),this.transformNormalGlobalFromModel=as(),this.toMapSpace=Xi()}};const Cle={func:Zr.LESS},BU={func:Zr.ALWAYS},Jy={mask:255},q6e={mask:0},m3t=t=>({function:{func:Zr.NOTEQUAL,ref:t,mask:t},operation:{fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.KEEP}}),g3t=t=>({function:{func:Zr.ALWAYS,ref:t,mask:t},operation:{fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.REPLACE}}),fx={function:{func:Zr.ALWAYS,ref:Zu.OutlineVisualElementMask,mask:Zu.OutlineVisualElementMask},operation:{fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.ZERO}},Z2={function:{func:Zr.ALWAYS,ref:Zu.OutlineVisualElementMask,mask:Zu.OutlineVisualElementMask},operation:{fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.REPLACE}},W6e={function:{func:Zr.EQUAL,ref:Zu.OutlineVisualElementMask,mask:Zu.OutlineVisualElementMask},operation:{fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.KEEP}},Y6e={function:{func:Zr.NOTEQUAL,ref:Zu.OutlineVisualElementMask,mask:Zu.OutlineVisualElementMask},operation:{fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.KEEP}};function X6e({normalTexture:t,metallicRoughnessTexture:e,metallicFactor:i,roughnessFactor:r,emissiveTexture:n,emissiveFactor:s,occlusionTexture:o}){return t==null&&e==null&&n==null&&(s==null||jr(s,Ka))&&o==null&&(r==null||r===1)&&(i==null||i===1||i===0)}const sG=[1,1,.5],Ale=[0,.6,.2],y3t=[0,1,.2];function Z6e(t){t.vertex.code.add(V`vec4 offsetBackfacingClipPosition(vec4 posClip, vec3 posWorld, vec3 normalWorld, vec3 camPosWorld) { +vec3 camToVert = posWorld - camPosWorld; +bool isBackface = dot(camToVert, normalWorld) > 0.0; +if (isBackface) { +posClip.z += 0.0000003 * posClip.w; +} +return posClip; +}`)}function J6e(t){t.vertex.code.add(V` + vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { + float symbolAlpha = 0.0; + + const float maxTint = 85.0; + const float maxReplace = 170.0; + const float scaleAlpha = 3.0; + + if (symbolColor.a > maxReplace) { + colorMixMode = ${V.int(Uo.Multiply)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxReplace); + } else if (symbolColor.a > maxTint) { + colorMixMode = ${V.int(Uo.Replace)}; + symbolAlpha = scaleAlpha * (symbolColor.a - maxTint); + } else if (symbolColor.a > 0.0) { + colorMixMode = ${V.int(Uo.Tint)}; + symbolAlpha = scaleAlpha * symbolColor.a; + } else { + colorMixMode = ${V.int(Uo.Multiply)}; + symbolAlpha = 0.0; + } + + return vec4(symbolColor.r, symbolColor.g, symbolColor.b, symbolAlpha); + } + `)}let s6=class extends Ls{constructor(e,i){super(e,"int",Or.Pass,(r,n,s)=>r.setUniform1i(e,i(n,s)))}};function K6e(t,e){e.hasSymbolColors?(t.include(J6e),t.attributes.add(J.SYMBOLCOLOR,"vec4"),t.varyings.add("colorMixMode","mediump float"),t.vertex.code.add(V`int symbolColorMixMode; +vec4 getSymbolColor() { +return decodeSymbolColor(symbolColor, symbolColorMixMode) * 0.003921568627451; +} +void forwardColorMixMode() { +colorMixMode = float(symbolColorMixMode) + 0.5; +}`)):(t.fragment.uniforms.add(new s6("colorMixMode",i=>J9e[i.colorMixMode])),t.vertex.code.add(V`vec4 getSymbolColor() { return vec4(1.0); } +void forwardColorMixMode() {}`))}function ME(t,e){e.hasVertexColors?(t.attributes.add(J.COLOR,"vec4"),t.varyings.add("vColor","vec4"),t.vertex.code.add(V`void forwardVertexColor() { vColor = color; }`),t.vertex.code.add(V`void forwardNormalizedVertexColor() { vColor = color * 0.003921568627451; }`)):t.vertex.code.add(V`void forwardVertexColor() {} +void forwardNormalizedVertexColor() {}`)}function Q6e(t){t.code.add(V`const float MAX_RGBA4_FLOAT = +15.0 / 16.0 + +15.0 / 16.0 / 16.0 + +15.0 / 16.0 / 16.0 / 16.0 + +15.0 / 16.0 / 16.0 / 16.0 / 16.0; +const vec4 FIXED_POINT_FACTORS_RGBA4 = vec4(1.0, 16.0, 16.0 * 16.0, 16.0 * 16.0 * 16.0); +vec4 floatToRgba4(const float value) { +float valueInValidDomain = clamp(value, 0.0, MAX_RGBA4_FLOAT); +vec4 fixedPointU4 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS_RGBA4) * 16.0); +const float toU4AsFloat = 1.0 / 15.0; +return fixedPointU4 * toU4AsFloat; +} +const vec4 RGBA4_2_FLOAT_FACTORS = vec4( +15.0 / (16.0), +15.0 / (16.0 * 16.0), +15.0 / (16.0 * 16.0 * 16.0), +15.0 / (16.0 * 16.0 * 16.0 * 16.0) +); +float rgba4ToFloat(vec4 rgba) { +return dot(rgba, RGBA4_2_FLOAT_FACTORS); +}`)}function E_(t,e){switch(e.output){case ue.Shadow:case ue.ShadowHighlight:case ue.ShadowExcludeHighlight:t.fragment.include(Q6e),t.fragment.code.add(V`float _calculateFragDepth(const in float depth) { +const float SLOPE_SCALE = 2.0; +const float BIAS = 20.0 * .000015259; +float m = max(abs(dFdx(depth)), abs(dFdy(depth))); +return depth + SLOPE_SCALE * m + BIAS; +} +void outputDepth(float _linearDepth) { +fragColor = floatToRgba4(_calculateFragDepth(_linearDepth)); +}`);break;case ue.Depth:t.fragment.include(o0),t.fragment.code.add(V`void outputDepth(float _linearDepth) { +fragColor = float2rgba(_linearDepth); +}`)}}function v3t(t){t.fragment.code.add(V` + #define discardOrAdjustAlpha(color) { if (color.a < ${V.float(Cl)}) { discard; } } + `)}let bT=class extends Ls{constructor(e,i){super(e,"float",Or.Draw,(r,n,s)=>r.setUniform1f(e,i(n,s)))}};function wT(t,e){eDe(t,e,new ft("textureAlphaCutoff",i=>i.textureAlphaCutoff))}function _3t(t,e){eDe(t,e,new bT("textureAlphaCutoff",i=>i.textureAlphaCutoff))}function eDe(t,e,i){const r=t.fragment;switch(e.alphaDiscardMode!==mn.Mask&&e.alphaDiscardMode!==mn.MaskBlend||r.uniforms.add(i),e.alphaDiscardMode){case mn.Blend:return t.include(v3t);case mn.Opaque:r.code.add(V`void discardOrAdjustAlpha(inout vec4 color) { +color.a = 1.0; +}`);break;case mn.Mask:r.code.add(V`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } else { color.a = 1.0; } }`);break;case mn.MaskBlend:t.fragment.code.add(V`#define discardOrAdjustAlpha(color) { if (color.a < textureAlphaCutoff) { discard; } }`)}}function tDe(t,e){const{vertex:i,fragment:r}=t,n=e.hasColorTexture&&e.alphaDiscardMode!==mn.Opaque;switch(e.output){case ue.Depth:case ue.Shadow:case ue.ShadowHighlight:case ue.ShadowExcludeHighlight:case ue.ObjectAndLayerIdColor:Kh(i,e),t.include(Yu,e),t.include(My,e),t.include(e_,e),t.include(E_,e),t.include(oo,e),t.include(e6,e),XT(t),t.varyings.add("depth","float"),n&&r.uniforms.add(new Zt("tex",s=>s.texture)),i.code.add(V`void main(void) { +vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); +forwardTextureCoordinates(); +forwardObjectAndLayerIdColor(); +}`),t.include(wT,e),r.code.add(V` + void main(void) { + discardBySlice(vpos); + ${n?V` + vec4 texColor = texture(tex, ${e.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + discardOrAdjustAlpha(texColor);`:""} + ${e.output===ue.ObjectAndLayerIdColor?V`outputObjectAndLayerIdColor();`:V`outputDepth(depth);`} + } + `);break;case ue.Normal:{Kh(i,e),t.include(Yu,e),t.include(n6,e),t.include(nG,e),t.include(My,e),t.include(e_,e),n&&r.uniforms.add(new Zt("tex",o=>o.texture)),e.normalType===Br.ScreenDerivative&&t.varyings.add("vPositionView","vec3");const s=e.normalType===Br.Attribute||e.normalType===Br.Compressed;i.code.add(V` + void main(void) { + vpos = getVertexInLocalOriginSpace(); + + ${s?V`vNormalWorld = dpNormalView(vvLocalNormal(normalModel()));`:V` + // Get vertex position in camera space for screen-space derivative normals + vPositionView = (view * vec4(vpos, 1.0)).xyz; + `} + vpos = subtractOrigin(vpos); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + forwardTextureCoordinates(); + } + `),t.include(oo,e),t.include(wT,e),r.code.add(V` + void main() { + discardBySlice(vpos); + ${n?V` + vec4 texColor = texture(tex, ${e.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + discardOrAdjustAlpha(texColor);`:""} + + ${e.normalType===Br.ScreenDerivative?V`vec3 normal = screenDerivativeNormal(vPositionView);`:V` + vec3 normal = normalize(vNormalWorld); + if (gl_FrontFacing == false){ + normal = -normal; + }`} + fragColor = vec4(0.5 + 0.5 * normal, 1.0); + } + `);break}case ue.Highlight:Kh(i,e),t.include(Yu,e),t.include(My,e),t.include(e_,e),n&&r.uniforms.add(new Zt("tex",s=>s.texture)),i.code.add(V`void main(void) { +vpos = getVertexInLocalOriginSpace(); +vpos = subtractOrigin(vpos); +vpos = addVerticalOffset(vpos, localOrigin); +gl_Position = transformPosition(proj, view, vpos); +forwardTextureCoordinates(); +}`),t.include(oo,e),t.include(wT,e),t.include(dx,e),r.code.add(V` + void main() { + discardBySlice(vpos); + ${n?V` + vec4 texColor = texture(tex, ${e.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + discardOrAdjustAlpha(texColor);`:""} + outputHighlight(); + } + `)}}function iDe(t,e){const i=t.fragment;e.hasVertexTangents?(t.attributes.add(J.TANGENT,"vec4"),t.varyings.add("vTangent","vec4"),e.doubleSidedMode===Is.WindingOrder?i.code.add(V`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = gl_FrontFacing ? vTangent.w : -vTangent.w; +vec3 tangent = normalize(gl_FrontFacing ? vTangent.xyz : -vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`):i.code.add(V`mat3 computeTangentSpace(vec3 normal) { +float tangentHeadedness = vTangent.w; +vec3 tangent = normalize(vTangent.xyz); +vec3 bitangent = cross(normal, tangent) * tangentHeadedness; +return mat3(tangent, bitangent, normal); +}`)):i.code.add(V`mat3 computeTangentSpace(vec3 normal, vec3 pos, vec2 st) { +vec3 Q1 = dFdx(pos); +vec3 Q2 = dFdy(pos); +vec2 stx = dFdx(st); +vec2 sty = dFdy(st); +float det = stx.t * sty.s - sty.t * stx.s; +vec3 T = stx.t * Q2 - sty.t * Q1; +T = T - normal * dot(normal, T); +T *= inversesqrt(max(dot(T,T), 1.e-10)); +vec3 B = sign(det) * cross(normal, T); +return mat3(T, B, normal); +}`),e.textureCoordinateType!==So.None&&(t.include(bae,e),i.uniforms.add(e.pbrTextureBindType===Or.Pass?new Zt("normalTexture",r=>r.textureNormal):new $f("normalTexture",r=>r.textureNormal)),i.code.add(V`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) { +vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0; +return tangentSpace * rawNormal; +}`))}let rDe=class extends Ls{constructor(e,i){super(e,"vec2",Or.Draw,(r,n,s,o)=>r.setUniform2fv(e,i(n,s,o)))}};const hW=4;function nDe(){const t=new Cr,e=t.fragment;t.include(Pc);const i=(hW+1)/2,r=1/(2*i*i);return e.include(Kf),e.uniforms.add(new Zt("depthMap",n=>n.depthTexture),new $f("tex",n=>n.colorTexture),new rDe("blurSize",n=>n.blurSize),new ft("projScale",(n,s)=>{const o=Sn(s.camera.eye,s.camera.center);return o>5e4?Math.max(0,n.projScale-(o-5e4)):n.projScale}),new ln("nearFar",(n,s)=>s.camera.nearFar)),e.code.add(V` + void blurFunction(vec2 uv, float r, float center_d, float sharpness, inout float wTotal, inout float bTotal) { + float c = texture(tex, uv).r; + float d = linearDepthFromTexture(depthMap, uv, nearFar); + + float ddiff = d - center_d; + + float w = exp(-r * r * ${V.float(r)} - ddiff * ddiff * sharpness); + wTotal += w; + bTotal += w * c; + } + `),t.outputs.add("fragBlur","float"),e.code.add(V` + void main(void) { + float b = 0.0; + float w_total = 0.0; + + float center_d = linearDepthFromTexture(depthMap, uv, nearFar); + + float sharpness = -0.05 * projScale / center_d; + for (int r = -${V.int(hW)}; r <= ${V.int(hW)}; ++r) { + float rf = float(r); + vec2 uvOffset = uv + rf * blurSize; + blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); + } + + fragBlur = b / w_total; + } + `),t}const b3t=Object.freeze(Object.defineProperty({__proto__:null,build:nDe},Symbol.toStringTag,{value:"Module"}));let sDe=class oDe extends Hr{initializeProgram(e){return new Ir(e.rctx,oDe.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};sDe.shader=new Rr(b3t,()=>we(()=>Promise.resolve().then(()=>xWt),void 0));const w3t="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let x3t=class extends _n{constructor(){super(...arguments),this.projScale=1}},S3t=class extends x3t{constructor(){super(...arguments),this.intensity=1}},T3t=class extends _n{},E3t=class extends T3t{constructor(){super(...arguments),this.blurSize=yt()}};function oG(t){t.fragment.uniforms.add(new gr("projInfo",(e,i)=>C3t(i))),t.fragment.uniforms.add(new ln("zScale",(e,i)=>A3t(i))),t.fragment.code.add(V`vec3 reconstructPosition(vec2 fragCoord, float depth) { +return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); +}`)}function C3t(t){const e=t.camera.projectionMatrix;return e[11]===0?rs(Rye,2/(t.camera.fullWidth*e[0]),2/(t.camera.fullHeight*e[5]),(1+e[12])/e[0],(1+e[13])/e[5]):rs(Rye,-2/(t.camera.fullWidth*e[0]),-2/(t.camera.fullHeight*e[5]),(1-e[8])/e[0],(1-e[9])/e[5])}const Rye=Xi();function A3t(t){return t.camera.projectionMatrix[11]===0?or(Iye,0,1):or(Iye,1,0)}const Iye=yt(),$ye=16;function aDe(){const t=new Cr,e=t.fragment;return t.include(Pc),e.include(Kf),t.include(oG),e.uniforms.add(new ft("radius",(i,r)=>aG(r.camera))),e.code.add(V`vec3 sphere[16]; +void fillSphere() { +sphere[0] = vec3(0.186937, 0.0, 0.0); +sphere[1] = vec3(0.700542, 0.0, 0.0); +sphere[2] = vec3(-0.864858, -0.481795, -0.111713); +sphere[3] = vec3(-0.624773, 0.102853, -0.730153); +sphere[4] = vec3(-0.387172, 0.260319, 0.007229); +sphere[5] = vec3(-0.222367, -0.642631, -0.707697); +sphere[6] = vec3(-0.01336, -0.014956, 0.169662); +sphere[7] = vec3(0.122575, 0.1544, -0.456944); +sphere[8] = vec3(-0.177141, 0.85997, -0.42346); +sphere[9] = vec3(-0.131631, 0.814545, 0.524355); +sphere[10] = vec3(-0.779469, 0.007991, 0.624833); +sphere[11] = vec3(0.308092, 0.209288,0.35969); +sphere[12] = vec3(0.359331, -0.184533, -0.377458); +sphere[13] = vec3(0.192633, -0.482999, -0.065284); +sphere[14] = vec3(0.233538, 0.293706, -0.055139); +sphere[15] = vec3(0.417709, -0.386701, 0.442449); +} +float fallOffFunction(float vv, float vn, float bias) { +float f = max(radius * radius - vv, 0.0); +return f * f * f * max(vn - bias, 0.0); +}`),e.code.add(V`float aoValueFromPositionsAndNormal(vec3 C, vec3 n_C, vec3 Q) { +vec3 v = Q - C; +float vv = dot(v, v); +float vn = dot(normalize(v), n_C); +return fallOffFunction(vv, vn, 0.1); +}`),e.uniforms.add(new ln("nearFar",(i,r)=>r.camera.nearFar),new Zt("normalMap",i=>i.normalTexture),new Zt("depthMap",i=>i.depthTexture),new ft("projScale",i=>i.projScale),new Zt("rnm",i=>i.noiseTexture),new ln("rnmScale",(i,r)=>or(Lye,r.camera.fullWidth/i.noiseTexture.descriptor.width,r.camera.fullHeight/i.noiseTexture.descriptor.height)),new ft("intensity",i=>i.intensity),new ln("screenSize",(i,r)=>or(Lye,r.camera.fullWidth,r.camera.fullHeight))),t.outputs.add("fragOcclusion","float"),e.code.add(V` + void main(void) { + fillSphere(); + vec3 fres = normalize(2.0 * texture(rnm, uv * rnmScale).xyz - 1.0); + float currentPixelDepth = linearDepthFromTexture(depthMap, uv, nearFar); + + if (-currentPixelDepth > nearFar.y || -currentPixelDepth < nearFar.x) { + fragOcclusion = 0.0; + return; + } + + vec3 currentPixelPos = reconstructPosition(gl_FragCoord.xy, currentPixelDepth); + + // get the normal of current fragment + vec4 norm4 = texture(normalMap, uv); + vec3 norm = vec3(-1.0) + 2.0 * norm4.xyz; + bool isTerrain = norm4.w < 0.5; + + float sum = 0.0; + vec3 tapPixelPos; + + // note: the factor 2.0 should not be necessary, but makes ssao much nicer. + // bug or deviation from CE somewhere else? + float ps = projScale / (2.0 * currentPixelPos.z * zScale.x + zScale.y); + + for(int i = 0; i < ${V.int($ye)}; ++i) { + vec2 unitOffset = reflect(sphere[i], fres).xy; + vec2 offset = vec2(-unitOffset * radius * ps); + + //don't use current or very nearby samples + if( abs(offset.x) < 2.0 || abs(offset.y) < 2.0){ + continue; + } + + vec2 tc = vec2(gl_FragCoord.xy + offset); + if (tc.x < 0.0 || tc.y < 0.0 || tc.x > screenSize.x || tc.y > screenSize.y) continue; + vec2 tcTap = tc / screenSize; + float occluderFragmentDepth = linearDepthFromTexture(depthMap, tcTap, nearFar); + + if (isTerrain) { + if (texture(normalMap, tcTap).w < 0.5) { + continue; + } + } + + tapPixelPos = reconstructPosition(tc, occluderFragmentDepth); + + sum += aoValueFromPositionsAndNormal(currentPixelPos, norm, tapPixelPos); + } + + // output the result + float A = max(1.0 - sum * intensity / float(${V.int($ye)}), 0.0); + + // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 + A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2; + + fragOcclusion = A; + } + `),t}function aG(t){return Math.max(10,20*t.computeScreenPixelSizeAtDist(Math.abs(4*t.relativeElevation)))}const Lye=yt(),M3t=Object.freeze(Object.defineProperty({__proto__:null,build:aDe,getRadius:aG},Symbol.toStringTag,{value:"Module"}));let lDe=class cDe extends Hr{initializeProgram(e){return new Ir(e.rctx,cDe.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};lDe.shader=new Rr(M3t,()=>we(()=>Promise.resolve().then(()=>SWt),void 0));const cI=2;let uI=class extends CE{constructor(e){super(e),this._context=null,this._passParameters=new S3t,this._drawParameters=new E3t,this.produces=new Map([[ke.SSAO,()=>this._produces()]])}_produces(){return this._enableTime!=null&&this._context!=null}consumes(){return this._produces()?Fvt:Vj}initializeRenderContext(e){this._context=e,this.addHandles([_e(()=>{var i;return this.view.qualitySettings.ambientOcclusion||((i=this._context)==null?void 0:i.isFeatureEnabled(Zo.SSAO))},i=>i?this._enable():this._disable(),kt)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=Kt(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){var r;if(this._enableTime!=null||!this._context)return;const e=Uint8Array.from(atob(w3t),n=>n.charCodeAt(0)),i=new tn;i.wrapMode=Bi.CLAMP_TO_EDGE,i.pixelFormat=ci.RGB,i.wrapMode=Bi.REPEAT,i.hasMipmap=!0,i.width=32,i.height=32,this._passParameters.noiseTexture=new Ai(this._context.renderContext.rctx,i,e),this._ssaoTechnique==null&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(lDe)),this._blurTechnique==null&&(this._blurTechnique=this._context.techniqueRepository.acquire(sDe)),this._enableTime=0,(r=this._context)==null||r.requestRender()}renderNode(e,i,r){var U,j;const n=e.bindParameters,s=(U=n.linearDepth)==null?void 0:U.colorTexture,o=(j=r==null?void 0:r.normal)==null?void 0:j.colorTexture;if(this._enableTime==null||this._context==null||s==null||!o)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();this._enableTime===0&&(this._enableTime=e.time);const l=e.rctx,c=n.camera,f=this.view.qualitySettings.fadeDuration,_=f>0?Math.min(f,e.time-this._enableTime)/f:1;this._passParameters.normalTexture=o,this._passParameters.depthTexture=s,this._passParameters.projScale=1/c.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*O3t/aG(c)**6*_;const x=c.fullViewport[2],T=c.fullViewport[3],A=Math.round(x/cI),M=Math.round(T/cI),I=this._context.fbos,L=I.acquire(xr.RED,x,T);l.bindFramebuffer(L.fbo),l.setViewport(0,0,x,T),l.bindTechnique(this._ssaoTechnique,this._passParameters,n).bindDraw(this._drawParameters,n,this._passParameters),l.screen.draw();const F=l.bindTechnique(this._blurTechnique,this._passParameters,n);l.setViewport(0,0,A,M);const z=I.acquire(xr.RED,A,M);l.bindFramebuffer(z.fbo),this._drawParameters.colorTexture=L.colorTexture,or(this._drawParameters.blurSize,0,cI/T),F.bindDraw(this._drawParameters,n,this._passParameters),l.setViewport(0,0,A,M),l.screen.draw(),L.release();const k=I.acquire(xr.RED,A,M);return l.bindFramebuffer(k.fbo),l.setViewport(0,0,x,T),l.setClearColor(1,1,1,0),l.clear(In.COLOR_BUFFER_BIT),l.setViewport(0,0,A,M),this._drawParameters.colorTexture=z.colorTexture,or(this._drawParameters.blurSize,cI/x,0),F.bindDraw(this._drawParameters,n,this._passParameters),l.screen.draw(),l.setViewport4fv(c.fullViewport),z.release(),_<1&&this._context.requestRender(),k}};y([w({constructOnly:!0})],uI.prototype,"view",void 0),y([w()],uI.prototype,"_context",void 0),uI=y([Z("esri.views.3d.webgl-engine.effects.ssao.SSAO")],uI);const O3t=.5;function o6(t,e){const i=t.fragment;e.receiveAmbientOcclusion?(i.uniforms.add(new Zt("ssaoTex",(r,n)=>{var s;return(s=n.ssao)==null?void 0:s.colorTexture})),i.constants.add("blurSizePixelsInverse","float",1/cI),i.code.add(V`float evaluateAmbientOcclusionInverse() { +vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); +return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; +} +float evaluateAmbientOcclusion() { +return 1.0 - evaluateAmbientOcclusionInverse(); +}`)):i.code.add(V`float evaluateAmbientOcclusionInverse() { return 1.0; } +float evaluateAmbientOcclusion() { return 0.0; }`)}function P3t(t){const e=t.fragment.code;e.add(V`vec3 evaluateDiffuseIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float NdotNG) +{ +return ((1.0 - NdotNG) * ambientGround + (1.0 + NdotNG) * ambientSky) * 0.5; +}`),e.add(V`float integratedRadiance(float cosTheta2, float roughness) +{ +return (cosTheta2 - 1.0) / (cosTheta2 * (1.0 - roughness * roughness) - 1.0); +}`),e.add(V`vec3 evaluateSpecularIlluminationHemisphere(vec3 ambientGround, vec3 ambientSky, float RdotNG, float roughness) +{ +float cosTheta2 = 1.0 - RdotNG * RdotNG; +float intRadTheta = integratedRadiance(cosTheta2, roughness); +float ground = RdotNG < 0.0 ? 1.0 - intRadTheta : 1.0 + intRadTheta; +float sky = 2.0 - ground; +return (ground * ambientGround + sky * ambientSky) * 0.5; +}`)}function Mle(t,e){const i=t.fragment.code;t.include(q9),e.pbrMode!==ei.Normal&&e.pbrMode!==ei.Schematic&&e.pbrMode!==ei.Terrain&&e.pbrMode!==ei.TerrainWithWater||(i.add(V`float normalDistribution(float NdotH, float roughness) +{ +float a = NdotH * roughness; +float b = roughness / (1.0 - NdotH * NdotH + a * a); +return b * b * INV_PI; +}`),i.add(V`const vec4 c0 = vec4(-1.0, -0.0275, -0.572, 0.022); +const vec4 c1 = vec4( 1.0, 0.0425, 1.040, -0.040); +const vec2 c2 = vec2(-1.04, 1.04); +vec2 prefilteredDFGAnalytical(float roughness, float NdotV) { +vec4 r = roughness * c0 + c1; +float a004 = min(r.x * r.x, exp2(-9.28 * NdotV)) * r.x + r.y; +return c2 * a004 + r.zw; +}`)),e.pbrMode!==ei.Normal&&e.pbrMode!==ei.Schematic||(t.include(P3t),i.add(V`struct PBRShadingInfo +{ +float NdotL; +float NdotV; +float NdotH; +float VdotH; +float LdotH; +float NdotNG; +float RdotNG; +float NdotAmbDir; +float NdotH_Horizon; +vec3 skyRadianceToSurface; +vec3 groundRadianceToSurface; +vec3 skyIrradianceToSurface; +vec3 groundIrradianceToSurface; +float averageAmbientRadiance; +float ssao; +vec3 albedoLinear; +vec3 f0; +vec3 f90; +vec3 diffuseColor; +float metalness; +float roughness; +};`),i.add(V`vec3 evaluateEnvironmentIllumination(PBRShadingInfo inputs) { +vec3 indirectDiffuse = evaluateDiffuseIlluminationHemisphere(inputs.groundIrradianceToSurface, inputs.skyIrradianceToSurface, inputs.NdotNG); +vec3 indirectSpecular = evaluateSpecularIlluminationHemisphere(inputs.groundRadianceToSurface, inputs.skyRadianceToSurface, inputs.RdotNG, inputs.roughness); +vec3 diffuseComponent = inputs.diffuseColor * indirectDiffuse * INV_PI; +vec2 dfg = prefilteredDFGAnalytical(inputs.roughness, inputs.NdotV); +vec3 specularColor = inputs.f0 * dfg.x + inputs.f90 * dfg.y; +vec3 specularComponent = specularColor * indirectSpecular; +return (diffuseComponent + specularComponent); +}`),i.add(V`float gamutMapChanel(float x, vec2 p){ +return (x < p.x) ? mix(0.0, p.y, x/p.x) : mix(p.y, 1.0, (x - p.x) / (1.0 - p.x) ); +}`),i.add(V`vec3 blackLevelSoftCompression(vec3 inColor, PBRShadingInfo inputs){ +vec3 outColor; +vec2 p = vec2(0.02 * (inputs.averageAmbientRadiance), 0.0075 * (inputs.averageAmbientRadiance)); +outColor.x = gamutMapChanel(inColor.x, p) ; +outColor.y = gamutMapChanel(inColor.y, p) ; +outColor.z = gamutMapChanel(inColor.z, p) ; +return outColor; +}`))}function R3t(t,e){const i=t.fragment.code;t.include(q9),i.add(V` + struct PBRShadingWater + { + float NdotL; // cos angle between normal and light direction + float NdotV; // cos angle between normal and view direction + float NdotH; // cos angle between normal and half vector + float VdotH; // cos angle between view direction and half vector + float LdotH; // cos angle between light direction and half vector + float VdotN; // cos angle between view direction and normal vector + }; + + float dtrExponent = ${e.useCustomDTRExponentForWater?"2.2":"2.0"}; + `),i.add(V`vec3 fresnelReflection(float angle, vec3 f0, float f90) { +return f0 + (f90 - f0) * pow(1.0 - angle, 5.0); +}`),i.add(V`float normalDistributionWater(float NdotH, float roughness) +{ +float r2 = roughness * roughness; +float NdotH2 = NdotH * NdotH; +float denom = pow((NdotH2 * (r2 - 1.0) + 1.0), dtrExponent) * PI; +return r2 / denom; +}`),i.add(V`float geometricOcclusionKelemen(float LoH) +{ +return 0.25 / (LoH * LoH); +}`),i.add(V`vec3 brdfSpecularWater(in PBRShadingWater props, float roughness, vec3 F0, float F0Max) +{ +vec3 F = fresnelReflection(props.VdotH, F0, F0Max); +float dSun = normalDistributionWater(props.NdotH, roughness); +float V = geometricOcclusionKelemen(props.LdotH); +float diffusionSunHaze = mix(roughness + 0.045, roughness + 0.385, 1.0 - props.VdotH); +float strengthSunHaze = 1.2; +float dSunHaze = normalDistributionWater(props.NdotH, diffusionSunHaze)*strengthSunHaze; +return ((dSun + dSunHaze) * V) * F; +} +vec3 tonemapACES(const vec3 x) { +return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14); +}`)}function a6(t){t.constants.add("ambientBoostFactor","float",j$e)}function CP(t){t.uniforms.add(new ft("lightingGlobalFactor",(e,i)=>i.lighting.globalFactor))}function JT(t,e){const i=t.fragment;switch(t.include(o6,e),e.pbrMode!==ei.Disabled&&t.include(Mle,e),t.include(Sae,e),t.include(q9),i.code.add(V` + const float GAMMA_SRGB = 2.1; + const float INV_GAMMA_SRGB = 0.4761904; + ${e.pbrMode===ei.Disabled?"":"const vec3 GROUND_REFLECTANCE = vec3(0.2);"} + `),a6(i),CP(i),B_(i),i.code.add(V` + float additionalDirectedAmbientLight(vec3 vPosWorld) { + float vndl = dot(${e.spherical?V`normalize(vPosWorld)`:V`vec3(0.0, 0.0, 1.0)`}, mainLightDirection); + return smoothstep(0.0, 1.0, clamp(vndl * 2.5, 0.0, 1.0)); + } + `),a1(i),i.code.add(V`vec3 evaluateAdditionalLighting(float ambientOcclusion, vec3 vPosWorld) { +float additionalAmbientScale = additionalDirectedAmbientLight(vPosWorld); +return (1.0 - ambientOcclusion) * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor * mainLightIntensity; +}`),e.pbrMode){case ei.Disabled:case ei.WaterOnIntegratedMesh:case ei.Water:t.include(yU),i.code.add(V`vec3 evaluateSceneLighting(vec3 normalWorld, vec3 albedo, float shadow, float ssao, vec3 additionalLight) +{ +vec3 mainLighting = evaluateMainLighting(normalWorld, shadow); +vec3 ambientLighting = calculateAmbientIrradiance(normalWorld, ssao); +vec3 albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +vec3 totalLight = mainLighting + ambientLighting + additionalLight; +totalLight = min(totalLight, vec3(PI)); +vec3 outColor = vec3((albedoLinear / PI) * totalLight); +return pow(outColor, vec3(INV_GAMMA_SRGB)); +}`);break;case ei.Normal:case ei.Schematic:i.code.add(V`const float fillLightIntensity = 0.25; +const float horizonLightDiffusion = 0.4; +const float additionalAmbientIrradianceFactor = 0.02; +vec3 evaluateSceneLightingPBR(vec3 normal, vec3 albedo, float shadow, float ssao, vec3 additionalLight, vec3 viewDir, vec3 normalGround, vec3 mrr, vec3 _emission, float additionalAmbientIrradiance) +{ +vec3 viewDirection = -viewDir; +vec3 h = normalize(viewDirection + mainLightDirection); +PBRShadingInfo inputs; +inputs.NdotL = clamp(dot(normal, mainLightDirection), 0.001, 1.0); +inputs.NdotV = clamp(abs(dot(normal, viewDirection)), 0.001, 1.0); +inputs.NdotH = clamp(dot(normal, h), 0.0, 1.0); +inputs.VdotH = clamp(dot(viewDirection, h), 0.0, 1.0); +inputs.NdotNG = clamp(dot(normal, normalGround), -1.0, 1.0); +vec3 reflectedView = normalize(reflect(viewDirection, normal)); +inputs.RdotNG = clamp(dot(reflectedView, normalGround), -1.0, 1.0); +inputs.albedoLinear = pow(albedo, vec3(GAMMA_SRGB)); +inputs.ssao = ssao; +inputs.metalness = mrr[0]; +inputs.roughness = clamp(mrr[1] * mrr[1], 0.001, 0.99);`),i.code.add(V`inputs.f0 = (0.16 * mrr[2] * mrr[2]) * (1.0 - inputs.metalness) + inputs.albedoLinear * inputs.metalness; +inputs.f90 = vec3(clamp(dot(inputs.f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +inputs.diffuseColor = inputs.albedoLinear * (vec3(1.0) - inputs.f0) * (1.0 - inputs.metalness);`),e.useFillLights?i.uniforms.add(new Oy("hasFillLights",(r,n)=>n.enableFillLights)):i.constants.add("hasFillLights","bool",!1),i.code.add(V`vec3 ambientDir = vec3(5.0 * normalGround[1] - normalGround[0] * normalGround[2], - 5.0 * normalGround[0] - normalGround[2] * normalGround[1], normalGround[1] * normalGround[1] + normalGround[0] * normalGround[0]); +ambientDir = ambientDir != vec3(0.0) ? normalize(ambientDir) : normalize(vec3(5.0, -1.0, 0.0)); +inputs.NdotAmbDir = hasFillLights ? abs(dot(normal, ambientDir)) : 1.0; +vec3 mainLightIrradianceComponent = inputs.NdotL * (1.0 - shadow) * mainLightIntensity; +vec3 fillLightsIrradianceComponent = inputs.NdotAmbDir * mainLightIntensity * fillLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(normal, ssao) + additionalLight; +inputs.skyIrradianceToSurface = ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ; +inputs.groundIrradianceToSurface = GROUND_REFLECTANCE * ambientLightIrradianceComponent + mainLightIrradianceComponent + fillLightsIrradianceComponent ;`),i.uniforms.add(new ft("lightingSpecularStrength",(r,n)=>n.lighting.mainLight.specularStrength),new ft("lightingEnvironmentStrength",(r,n)=>n.lighting.mainLight.environmentStrength)),i.code.add(V`vec3 horizonRingDir = inputs.RdotNG * normalGround - reflectedView; +vec3 horizonRingH = normalize(viewDirection + horizonRingDir); +inputs.NdotH_Horizon = dot(normal, horizonRingH); +vec3 mainLightRadianceComponent = lightingSpecularStrength * normalDistribution(inputs.NdotH, inputs.roughness) * mainLightIntensity * (1.0 - shadow); +vec3 horizonLightRadianceComponent = lightingEnvironmentStrength * normalDistribution(inputs.NdotH_Horizon, min(inputs.roughness + horizonLightDiffusion, 1.0)) * mainLightIntensity * fillLightIntensity; +vec3 ambientLightRadianceComponent = lightingEnvironmentStrength * calculateAmbientRadiance(ssao) + additionalLight; +float normalDirectionModifier = mix(1., min(mix(0.1, 2.0, (inputs.NdotNG + 1.) * 0.5), 1.0), clamp(inputs.roughness * 5.0, 0.0 , 1.0)); +inputs.skyRadianceToSurface = (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; +inputs.groundRadianceToSurface = 0.5 * GROUND_REFLECTANCE * (ambientLightRadianceComponent + horizonLightRadianceComponent) * normalDirectionModifier + mainLightRadianceComponent; +inputs.averageAmbientRadiance = ambientLightIrradianceComponent[1] * (1.0 + GROUND_REFLECTANCE[1]);`),i.code.add(V` + vec3 reflectedColorComponent = evaluateEnvironmentIllumination(inputs); + vec3 additionalMaterialReflectanceComponent = inputs.albedoLinear * additionalAmbientIrradiance; + vec3 emissionComponent = _emission == vec3(0.0) ? _emission : pow(_emission, vec3(GAMMA_SRGB)); + vec3 outColorLinear = reflectedColorComponent + additionalMaterialReflectanceComponent + emissionComponent; + ${e.pbrMode!==ei.Schematic||e.hasColorTexture?V`vec3 outColor = pow(blackLevelSoftCompression(outColorLinear, inputs), vec3(INV_GAMMA_SRGB));`:V`vec3 outColor = pow(max(vec3(0.0), outColorLinear - 0.005 * inputs.averageAmbientRadiance), vec3(INV_GAMMA_SRGB));`} + return outColor; + } + `);break;case ei.Terrain:case ei.TerrainWithWater:t.include(yU),i.code.add(V`const float roughnessTerrain = 0.5; +const float specularityTerrain = 0.5; +const vec3 fresnelReflectionTerrain = vec3(0.04); +vec3 evaluateTerrainLighting(vec3 n, vec3 c, float shadow, float ssao, vec3 al, vec3 vd, vec3 nup) { +vec3 viewDirection = -vd; +vec3 h = normalize(viewDirection + mainLightDirection); +float NdotL = clamp(dot(n, mainLightDirection), 0.001, 1.0); +float NdotV = clamp(abs(dot(n, viewDirection)), 0.001, 1.0); +float NdotH = clamp(dot(n, h), 0.0, 1.0); +float NdotNG = clamp(dot(n, nup), -1.0, 1.0); +vec3 albedoLinear = pow(c, vec3(GAMMA_SRGB)); +float lightness = 0.3 * albedoLinear[0] + 0.5 * albedoLinear[1] + 0.2 * albedoLinear[2]; +vec3 f0 = (0.85 * lightness + 0.15) * fresnelReflectionTerrain; +vec3 f90 = vec3(clamp(dot(f0, vec3(50.0 * 0.33)), 0.0, 1.0)); +vec3 mainLightIrradianceComponent = (1. - shadow) * NdotL * mainLightIntensity; +vec3 ambientLightIrradianceComponent = calculateAmbientIrradiance(n, ssao) + al; +vec3 ambientSky = ambientLightIrradianceComponent + mainLightIrradianceComponent; +vec3 indirectDiffuse = ((1.0 - NdotNG) * mainLightIrradianceComponent + (1.0 + NdotNG ) * ambientSky) * 0.5; +vec3 outDiffColor = albedoLinear * (1.0 - f0) * indirectDiffuse / PI; +vec3 mainLightRadianceComponent = normalDistribution(NdotH, roughnessTerrain) * mainLightIntensity; +vec2 dfg = prefilteredDFGAnalytical(roughnessTerrain, NdotV); +vec3 specularColor = f0 * dfg.x + f90 * dfg.y; +vec3 specularComponent = specularityTerrain * specularColor * mainLightRadianceComponent; +vec3 outColorLinear = outDiffColor + specularComponent; +vec3 outColor = pow(outColorLinear, vec3(INV_GAMMA_SRGB)); +return outColor; +}`);break;default:e.pbrMode;case ei.COUNT:}}let I3t=class extends Ls{constructor(e,i,r){super(e,"mat4",Or.Draw,(n,s,o,l)=>n.setUniformMatrix4fv(e,i(s,o,l)),r)}},$3t=class extends Ls{constructor(e,i,r){super(e,"mat4",Or.Pass,(n,s,o)=>n.setUniformMatrix4fv(e,i(s,o)),r)}},L3t=class extends _n{constructor(){super(...arguments),this.origin=W()}},D3t=class extends L3t{},N3t=class extends _n{constructor(){super(...arguments),this.modelTransformation=gs}},Ole=class extends N3t{constructor(){super(...arguments),this.origin=W()}};function lG(t,e){e.receiveShadows&&(t.fragment.uniforms.add(new $3t("shadowMapMatrix",(i,r)=>r.shadowMap.getShadowMapMatrices(i.origin),4)),uDe(t))}function KT(t,e){e.receiveShadows&&(t.fragment.uniforms.add(new I3t("shadowMapMatrix",(i,r)=>r.shadowMap.getShadowMapMatrices(i.origin),4)),uDe(t))}function uDe(t){const e=t.fragment;e.include(Q6e),e.uniforms.add(new Zt("shadowMapTex",(i,r)=>r.shadowMap.depthTexture),new s6("numCascades",(i,r)=>r.shadowMap.numCascades),new gr("cascadeDistances",(i,r)=>r.shadowMap.cascadeDistances)),e.code.add(V`int chooseCascade(float depth, out mat4 mat) { +vec4 distance = cascadeDistances; +int i = depth < distance[1] ? 0 : depth < distance[2] ? 1 : depth < distance[3] ? 2 : 3; +mat = i == 0 ? shadowMapMatrix[0] : i == 1 ? shadowMapMatrix[1] : i == 2 ? shadowMapMatrix[2] : shadowMapMatrix[3]; +return i; +} +vec3 lightSpacePosition(vec3 _vpos, mat4 mat) { +vec4 lv = mat * vec4(_vpos, 1.0); +lv.xy /= lv.w; +return 0.5 * lv.xyz + vec3(0.5); +} +vec2 cascadeCoordinates(int i, ivec2 textureSize, vec3 lvpos) { +float xScale = float(textureSize.y) / float(textureSize.x); +return vec2((float(i) + lvpos.x) * xScale, lvpos.y); +} +float readShadowMapDepth(ivec2 uv, sampler2D _depthTex) { +return rgba4ToFloat(texelFetch(_depthTex, uv, 0)); +} +float posIsInShadow(ivec2 uv, vec3 lvpos, sampler2D _depthTex) { +return readShadowMapDepth(uv, _depthTex) < lvpos.z ? 1.0 : 0.0; +} +float filterShadow(vec2 uv, vec3 lvpos, ivec2 texSize, sampler2D _depthTex) { +vec2 st = fract(uv * vec2(texSize) + vec2(0.5)); +ivec2 base = ivec2(uv * vec2(texSize) - vec2(0.5)); +float s00 = posIsInShadow(ivec2(base.x, base.y), lvpos, _depthTex); +float s10 = posIsInShadow(ivec2(base.x + 1, base.y), lvpos, _depthTex); +float s11 = posIsInShadow(ivec2(base.x + 1, base.y + 1), lvpos, _depthTex); +float s01 = posIsInShadow(ivec2(base.x, base.y + 1), lvpos, _depthTex); +return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y); +} +float readShadowMap(const in vec3 _vpos, float _linearDepth) { +mat4 mat; +int i = chooseCascade(_linearDepth, mat); +if (i >= numCascades) { return 0.0; } +vec3 lvpos = lightSpacePosition(_vpos, mat); +if (lvpos.z >= 1.0) { return 0.0; } +if (lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { return 0.0; } +ivec2 size = textureSize(shadowMapTex, 0); +vec2 uv = cascadeCoordinates(i, size, lvpos); +return filterShadow(uv, lvpos, size, shadowMapTex); +}`)}function Tc(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function hDe(t){const e=new Float32Array(9);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}function tk(t,e,i,r,n,s,o,l,c){const f=new Float32Array(9);return f[0]=t,f[1]=e,f[2]=i,f[3]=r,f[4]=n,f[5]=s,f[6]=o,f[7]=l,f[8]=c,f}function F3t(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:hDe,create:Tc,createView:F3t,fromValues:tk},Symbol.toStringTag,{value:"Module"}));function k3t(t){t.vertex.uniforms.add(new Wm("colorTextureTransformMatrix",e=>e.colorTextureTransformMatrix!=null?e.colorTextureTransformMatrix:Tc())),t.varyings.add("colorUV","vec2"),t.vertex.code.add(V`void forwardColorUV(){ +colorUV = (colorTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function z3t(t){t.vertex.uniforms.add(new Wm("normalTextureTransformMatrix",e=>e.normalTextureTransformMatrix!=null?e.normalTextureTransformMatrix:Tc())),t.varyings.add("normalUV","vec2"),t.vertex.code.add(V`void forwardNormalUV(){ +normalUV = (normalTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function U3t(t){t.vertex.uniforms.add(new Wm("emissiveTextureTransformMatrix",e=>e.emissiveTextureTransformMatrix!=null?e.emissiveTextureTransformMatrix:Tc())),t.varyings.add("emissiveUV","vec2"),t.vertex.code.add(V`void forwardEmissiveUV(){ +emissiveUV = (emissiveTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function V3t(t){t.vertex.uniforms.add(new Wm("occlusionTextureTransformMatrix",e=>e.occlusionTextureTransformMatrix!=null?e.occlusionTextureTransformMatrix:Tc())),t.varyings.add("occlusionUV","vec2"),t.vertex.code.add(V`void forwardOcclusionUV(){ +occlusionUV = (occlusionTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function B3t(t){t.vertex.uniforms.add(new Wm("metallicRoughnessTextureTransformMatrix",e=>e.metallicRoughnessTextureTransformMatrix!=null?e.metallicRoughnessTextureTransformMatrix:Tc())),t.varyings.add("metallicRoughnessUV","vec2"),t.vertex.code.add(V`void forwardMetallicRoughnessUV(){ +metallicRoughnessUV = (metallicRoughnessTextureTransformMatrix * vec3(vuv0, 1.0)).xy; +}`)}function kL(t){t.include(h1),t.code.add(V` + vec3 mixExternalColor(vec3 internalColor, vec3 textureColor, vec3 externalColor, int mode) { + // workaround for artifacts in OSX using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + vec3 internalMixed = internalColor * textureColor; + vec3 allMixed = internalMixed * externalColor; + + if (mode == ${V.int(Uo.Multiply)}) { + return allMixed; + } + if (mode == ${V.int(Uo.Ignore)}) { + return internalMixed; + } + if (mode == ${V.int(Uo.Replace)}) { + return externalColor; + } + + // tint (or something invalid) + float vIn = rgb2v(internalMixed); + vec3 hsvTint = rgb2hsv(externalColor); + vec3 hsvOut = vec3(hsvTint.x, hsvTint.y, vIn * hsvTint.z); + return hsv2rgb(hsvOut); + } + + float mixExternalOpacity(float internalOpacity, float textureOpacity, float externalOpacity, int mode) { + // workaround for artifacts in OSX using Intel Iris Pro + // see: https://devtopia.esri.com/WebGIS/arcgis-js-api/issues/10475 + float internalMixed = internalOpacity * textureOpacity; + float allMixed = internalMixed * externalOpacity; + + if (mode == ${V.int(Uo.Ignore)}) { + return internalMixed; + } + if (mode == ${V.int(Uo.Replace)}) { + return externalOpacity; + } + + // multiply or tint (or something invalid) + return allMixed; + } + `)}function dDe(t){const e=new Cr,{vertex:i,fragment:r,varyings:n}=e;if(Kh(i,t),e.include(W9),n.add("vpos","vec3"),e.include(e_,t),e.include(X$e,t),e.include(V9e,t),t.hasColorTextureTransform&&e.include(k3t),t.output===ue.Color||t.output===ue.Alpha){t.hasNormalTextureTransform&&e.include(z3t),t.hasEmissionTextureTransform&&e.include(U3t),t.hasOcclusionTextureTransform&&e.include(V3t),t.hasMetallicRoughnessTextureTransform&&e.include(B3t),Nm(i,t),e.include(n6,t),e.include(Yu,t);const s=t.normalType===Br.Attribute||t.normalType===Br.Compressed;s&&t.offsetBackfaces&&e.include(Z6e),e.include(iDe,t),e.include(nG,t),t.instancedColor&&e.attributes.add(J.INSTANCECOLOR,"vec4"),n.add("vPositionLocal","vec3"),e.include(My,t),e.include(wP,t),e.include(K6e,t),e.include(ME,t),i.uniforms.add(new gr("externalColor",o=>o.externalColor)),n.add("vcolorExt","vec4"),t.multipassEnabled&&n.add("depth","float"),i.code.add(V` + void main(void) { + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${t.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${V.float(Cl)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = getVertexInLocalOriginSpace(); + vPositionLocal = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + ${s?V`vNormalWorld = dpNormal(vvLocalNormal(normalModel()));`:""} + vpos = addVerticalOffset(vpos, localOrigin); + ${t.hasVertexTangents?"vTangent = dpTransformVertexTangent(tangent);":""} + gl_Position = transformPosition(proj, view, vpos); + ${s&&t.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""} + } + + ${t.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""} + forwardLinearDepth(); + forwardTextureCoordinates(); + ${t.hasColorTextureTransform?V`forwardColorUV();`:""} + ${t.hasNormalTextureTransform?V`forwardNormalUV();`:""} + ${t.hasEmissionTextureTransform?V`forwardEmissiveUV();`:""} + ${t.hasOcclusionTextureTransform?V`forwardOcclusionUV();`:""} + ${t.hasMetallicRoughnessTextureTransform?V`forwardMetallicRoughnessUV();`:""} + } + `)}switch(t.output){case ue.Alpha:e.include(oo,t),e.include(wT,t),e.include(dd,t),r.uniforms.add(new ft("opacity",s=>s.opacity),new ft("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&r.uniforms.add(new Zt("tex",s=>s.texture)),r.include(kL),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + ${t.hasColorTexture?V` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:V`vec4 texColor = vec4(1.0);`} + ${t.hasVertexColors?V`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:V`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + fragColor = vec4(opacity_); + } + `);break;case ue.Color:e.include(oo,t),e.include(JT,t),e.include(o6,t),e.include(wT,t),e.include(t.instancedDoublePrecision?lG:KT,t),e.include(dd,t),Nm(r,t),r.uniforms.add(i.uniforms.get("localOrigin"),new Oi("ambient",s=>s.ambient),new Oi("diffuse",s=>s.diffuse),new ft("opacity",s=>s.opacity),new ft("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&r.uniforms.add(new Zt("tex",s=>s.texture)),e.include(xae,t),e.include(Mle,t),r.include(kL),e.include(j6e,t),a6(r),CP(r),a1(r),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + ${t.hasColorTexture?V` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:V`vec4 texColor = vec4(1.0);`} + shadingParams.viewDirection = normalize(vpos - cameraPosition); + ${t.normalType===Br.ScreenDerivative?V` + vec3 normal = screenDerivativeNormal(vPositionLocal);`:V` + shadingParams.normalView = vNormalWorld; + vec3 normal = shadingNormal(shadingParams);`} + ${t.pbrMode===ei.Normal?"applyPBRFactors();":""} + float ssao = evaluateAmbientOcclusionInverse(); + ssao *= getBakedOcclusion(); + + vec3 posWorld = vpos + localOrigin; + + float additionalAmbientScale = additionalDirectedAmbientLight(posWorld); + float shadow = ${t.receiveShadows?"readShadowMap(vpos, linearDepth)":t.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; + + vec3 matColor = max(ambient, diffuse); + ${t.hasVertexColors?V` + vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:V` + vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + ${t.hasNormalTexture?V` + mat3 tangentSpace = ${t.hasVertexTangents?"computeTangentSpace(normal);":"computeTangentSpace(normal, vpos, vuv0);"} + vec3 shadingNormal = computeTextureNormal(tangentSpace, ${t.hasNormalTextureTransform?V`normalUV`:"vuv0"});`:V`vec3 shadingNormal = normal;`} + vec3 normalGround = ${t.spherical?V`normalize(posWorld);`:V`vec3(0.0, 0.0, 1.0);`} + + ${t.snowCover?V` + float snow = smoothstep(0.5, 0.55, dot(normal, normalGround)); + albedo = mix(albedo, vec3(1), snow); + shadingNormal = mix(shadingNormal, normal, snow); + ssao = mix(ssao, 1.0, snow);`:""} + + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + + ${t.pbrMode===ei.Normal||t.pbrMode===ei.Schematic?V` + float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${t.snowCover?V` + mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow); + emission = mix(emission, vec3(0.0), snow);`:""} + + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:V`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); + ${t.transparencyPassType===Jt.Color?V`fragColor = premultiplyAlpha(fragColor);`:""} + } + `)}return e.include(tDe,t),e}const j3t=Object.freeze(Object.defineProperty({__proto__:null,build:dDe},Symbol.toStringTag,{value:"Module"}));let G3t=class extends G6e{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=mc(sG),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Ln.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=nt(0,0,0),this.instancedDoublePrecision=!1,this.normalType=Br.Attribute,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=nt(.2,.2,.2),this.diffuse=nt(.8,.8,.8),this.externalColor=Mi(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=W(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=WT.Less,this.textureAlphaMode=mn.Blend,this.textureAlphaCutoff=UU,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=Wn.Occlude,this.isDecoration=!1}},H3t=class extends H6e{constructor(){super(...arguments),this.origin=W(),this.slicePlaneLocalOrigin=this.origin}},Ple=class pDe extends Hr{initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global,i.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result,i.textureCoordinateType=i.hasColorTexture||i.hasMetallicRoughnessTexture||i.hasEmissionTexture||i.hasOcclusionTexture||i.hasNormalTexture?So.Default:So.None,i.objectAndLayerIdColorInstanced=i.instanced}initializeProgram(e){return this._initializeProgram(e,pDe.shader)}_initializeProgram(e,i){return new Ir(e.rctx,i.get().build(this.configuration),Er)}_convertDepthTestFunction(e){return e===WT.Lequal?Zr.LEQUAL:Zr.LESS}_makePipeline(e,i){const r=this.configuration,n=e===Jt.NONE,s=e===Jt.FrontFace;return Ti({blending:r.output!==ue.Color&&r.output!==ue.Alpha||!r.transparent?null:n?vp:Y_(e),culling:q3t(r)?Mj(r.cullFace):null,depthTest:{func:px(e,this._convertDepthTestFunction(r.customDepthTest))},depthWrite:(n||s)&&r.writeDepth?rh:null,colorWrite:ji,stencilWrite:r.hasOccludees?Jy:null,stencilTest:r.hasOccludees?i?Z2:fx:null,polygonOffset:n||s?null:tG(r.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function q3t(t){return t.cullFace!==Ln.None||!t.hasSlicePlane&&!t.transparent&&!t.doubleSidedMode}Ple.shader=new Rr(j3t,()=>we(()=>Promise.resolve().then(()=>TWt),void 0));let Ui=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.alphaDiscardMode=mn.Opaque,this.doubleSidedMode=Is.None,this.pbrMode=ei.Disabled,this.cullFace=Ln.None,this.transparencyPassType=Jt.NONE,this.normalType=Br.Attribute,this.textureCoordinateType=So.None,this.customDepthTest=WT.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}};y([fe({count:ue.COUNT})],Ui.prototype,"output",void 0),y([fe({count:mn.COUNT})],Ui.prototype,"alphaDiscardMode",void 0),y([fe({count:Is.COUNT})],Ui.prototype,"doubleSidedMode",void 0),y([fe({count:ei.COUNT})],Ui.prototype,"pbrMode",void 0),y([fe({count:Ln.COUNT})],Ui.prototype,"cullFace",void 0),y([fe({count:Jt.COUNT})],Ui.prototype,"transparencyPassType",void 0),y([fe({count:Br.COUNT})],Ui.prototype,"normalType",void 0),y([fe({count:So.COUNT})],Ui.prototype,"textureCoordinateType",void 0),y([fe({count:WT.COUNT})],Ui.prototype,"customDepthTest",void 0),y([fe()],Ui.prototype,"spherical",void 0),y([fe()],Ui.prototype,"hasVertexColors",void 0),y([fe()],Ui.prototype,"hasSymbolColors",void 0),y([fe()],Ui.prototype,"hasVerticalOffset",void 0),y([fe()],Ui.prototype,"hasSlicePlane",void 0),y([fe()],Ui.prototype,"hasSliceHighlight",void 0),y([fe()],Ui.prototype,"hasColorTexture",void 0),y([fe()],Ui.prototype,"hasMetallicRoughnessTexture",void 0),y([fe()],Ui.prototype,"hasEmissionTexture",void 0),y([fe()],Ui.prototype,"hasOcclusionTexture",void 0),y([fe()],Ui.prototype,"hasNormalTexture",void 0),y([fe()],Ui.prototype,"hasScreenSizePerspective",void 0),y([fe()],Ui.prototype,"hasVertexTangents",void 0),y([fe()],Ui.prototype,"hasOccludees",void 0),y([fe()],Ui.prototype,"multipassEnabled",void 0),y([fe()],Ui.prototype,"hasModelTransformation",void 0),y([fe()],Ui.prototype,"offsetBackfaces",void 0),y([fe()],Ui.prototype,"vvSize",void 0),y([fe()],Ui.prototype,"vvColor",void 0),y([fe()],Ui.prototype,"receiveShadows",void 0),y([fe()],Ui.prototype,"receiveAmbientOcclusion",void 0),y([fe()],Ui.prototype,"textureAlphaPremultiplied",void 0),y([fe()],Ui.prototype,"instanced",void 0),y([fe()],Ui.prototype,"instancedColor",void 0),y([fe()],Ui.prototype,"objectAndLayerIdColorInstanced",void 0),y([fe()],Ui.prototype,"instancedDoublePrecision",void 0),y([fe()],Ui.prototype,"doublePrecisionRequiresObfuscation",void 0),y([fe()],Ui.prototype,"writeDepth",void 0),y([fe()],Ui.prototype,"transparent",void 0),y([fe()],Ui.prototype,"enableOffset",void 0),y([fe()],Ui.prototype,"cullAboveGround",void 0),y([fe()],Ui.prototype,"snowCover",void 0),y([fe()],Ui.prototype,"hasColorTextureTransform",void 0),y([fe()],Ui.prototype,"hasEmissionTextureTransform",void 0),y([fe()],Ui.prototype,"hasNormalTextureTransform",void 0),y([fe()],Ui.prototype,"hasOcclusionTextureTransform",void 0),y([fe()],Ui.prototype,"hasMetallicRoughnessTextureTransform",void 0),y([fe({constValue:!1})],Ui.prototype,"occlusionPass",void 0),y([fe({constValue:!0})],Ui.prototype,"hasVvInstancing",void 0),y([fe({constValue:!1})],Ui.prototype,"useCustomDTRExponentForWater",void 0),y([fe({constValue:!1})],Ui.prototype,"supportsTextureAtlas",void 0),y([fe({constValue:!0})],Ui.prototype,"useFillLights",void 0);function fDe(t){const e=new Cr,{vertex:i,fragment:r,varyings:n}=e;return Kh(i,t),e.include(W9),n.add("vpos","vec3"),e.include(e_,t),e.include(X$e,t),e.include(V9e,t),t.output!==ue.Color&&t.output!==ue.Alpha||(Nm(e.vertex,t),e.include(n6,t),e.include(Yu,t),t.offsetBackfaces&&e.include(Z6e),t.instancedColor&&e.attributes.add(J.INSTANCECOLOR,"vec4"),n.add("vNormalWorld","vec3"),n.add("localvpos","vec3"),t.multipassEnabled&&n.add("depth","float"),e.include(My,t),e.include(wP,t),e.include(K6e,t),e.include(ME,t),i.uniforms.add(new gr("externalColor",s=>s.externalColor)),n.add("vcolorExt","vec4"),i.code.add(V` + void main(void) { + forwardNormalizedVertexColor(); + vcolorExt = externalColor; + ${t.instancedColor?"vcolorExt *= instanceColor * 0.003921568627451;":""} + vcolorExt *= vvColor(); + vcolorExt *= getSymbolColor(); + forwardColorMixMode(); + + if (vcolorExt.a < ${V.float(Cl)}) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + } else { + vpos = getVertexInLocalOriginSpace(); + localvpos = vpos - view[3].xyz; + vpos = subtractOrigin(vpos); + vNormalWorld = dpNormal(vvLocalNormal(normalModel())); + vpos = addVerticalOffset(vpos, localOrigin); + gl_Position = transformPosition(proj, view, vpos); + ${t.offsetBackfaces?"gl_Position = offsetBackfacingClipPosition(gl_Position, vpos, vNormalWorld, cameraPosition);":""} + } + ${t.multipassEnabled?V`depth = (view * vec4(vpos, 1.0)).z;`:""} + forwardLinearDepth(); + forwardTextureCoordinates(); + } + `)),t.output===ue.Alpha&&(e.include(oo,t),e.include(wT,t),e.include(dd,t),r.uniforms.add(new ft("opacity",s=>s.opacity),new ft("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&r.uniforms.add(new Zt("tex",s=>s.texture)),r.include(kL),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?V`terrainDepthTest(depth);`:""} + ${t.hasColorTexture?V` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:V`vec4 texColor = vec4(1.0);`} + ${t.hasVertexColors?V`float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:V`float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + + fragColor = vec4(opacity_); + } + `)),t.output===ue.Color&&(e.include(oo,t),e.include(JT,t),e.include(o6,t),e.include(wT,t),e.include(t.instancedDoublePrecision?lG:KT,t),e.include(dd,t),Nm(e.fragment,t),B_(r),a6(r),CP(r),r.uniforms.add(i.uniforms.get("localOrigin"),i.uniforms.get("view"),new Oi("ambient",s=>s.ambient),new Oi("diffuse",s=>s.diffuse),new ft("opacity",s=>s.opacity),new ft("layerOpacity",s=>s.layerOpacity)),t.hasColorTexture&&r.uniforms.add(new Zt("tex",s=>s.texture)),e.include(xae,t),e.include(Mle,t),r.include(kL),a1(r),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?V`terrainDepthTest(depth);`:""} + ${t.hasColorTexture?V` + vec4 texColor = texture(tex, ${t.hasColorTextureTransform?V`colorUV`:V`vuv0`}); + ${t.textureAlphaPremultiplied?"texColor.rgb /= texColor.a;":""} + discardOrAdjustAlpha(texColor);`:V`vec4 texColor = vec4(1.0);`} + vec3 viewDirection = normalize(vpos - cameraPosition); + ${t.pbrMode===ei.Normal?"applyPBRFactors();":""} + float ssao = evaluateAmbientOcclusionInverse(); + ssao *= getBakedOcclusion(); + + float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + ${t.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":t.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"} + vec3 matColor = max(ambient, diffuse); + ${t.hasVertexColors?V` + vec3 albedo = mixExternalColor(vColor.rgb * matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(vColor.a * opacity, texColor.a, vcolorExt.a, int(colorMixMode));`:V` + vec3 albedo = mixExternalColor(matColor, texColor.rgb, vcolorExt.rgb, int(colorMixMode)); + float opacity_ = layerOpacity * mixExternalOpacity(opacity, texColor.a, vcolorExt.a, int(colorMixMode));`} + ${t.snowCover?V`albedo = mix(albedo, vec3(1), 0.9);`:V``} + ${V` + vec3 shadingNormal = normalize(vNormalWorld); + albedo *= 1.2; + vec3 viewForward = vec3(view[0][2], view[1][2], view[2][2]); + float alignmentLightView = clamp(dot(viewForward, -mainLightDirection), 0.0, 1.0); + float transmittance = 1.0 - clamp(dot(viewForward, shadingNormal), 0.0, 1.0); + float treeRadialFalloff = vColor.r; + float backLightFactor = 0.5 * treeRadialFalloff * alignmentLightView * transmittance * (1.0 - shadow); + additionalLight += backLightFactor * mainLightIntensity;`} + ${t.pbrMode===ei.Normal||t.pbrMode===ei.Schematic?t.spherical?V`vec3 normalGround = normalize(vpos + localOrigin);`:V`vec3 normalGround = vec3(0.0, 0.0, 1.0);`:V``} + ${t.pbrMode===ei.Normal||t.pbrMode===ei.Schematic?V` + float additionalAmbientIrradiance = additionalAmbientIrradianceFactor * mainLightIntensity[2]; + ${t.snowCover?V` + mrr = vec3(0.0, 1.0, 0.04); + emission = vec3(0.0);`:""} + + vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:V`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} + fragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); + ${t.transparencyPassType===Jt.Color?V`fragColor = premultiplyAlpha(fragColor);`:V``} + } + `)),e.include(tDe,t),e}const W3t=Object.freeze(Object.defineProperty({__proto__:null,build:fDe},Symbol.toStringTag,{value:"Module"}));let mDe=class gDe extends Ple{initializeConfiguration(e,i){super.initializeConfiguration(e,i),i.hasMetallicRoughnessTexture=!1,i.hasEmissionTexture=!1,i.hasOcclusionTexture=!1,i.hasNormalTexture=!1,i.hasModelTransformation=!1,i.normalType=Br.Attribute,i.doubleSidedMode=Is.WindingOrder,i.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,gDe.shader)}};mDe.shader=new Rr(W3t,()=>we(()=>Promise.resolve().then(()=>EWt),void 0));let km=class extends hx{constructor(e){super(e,Z3t),this.supportsEdges=!0,this._configuration=new Ui,this._vertexBufferLayout=J3t(this.parameters)}isVisibleForOutput(e){return e!==ue.Shadow&&e!==ue.ShadowExcludeHighlight&&e!==ue.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||e.layerOpacity===0)return!1;const{hasInstancedColor:i,hasVertexColors:r,hasSymbolColors:n,vvColor:s}=e,o=e.colorMixMode==="replace",l=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0,f=i||s||n;return r&&f?o||l:r?o?c:l:f?o||l:o?c:l}getConfiguration(e,i){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=this.parameters.isInstanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.hasVerticalOffset=this.parameters.verticalOffset!=null,this._configuration.hasScreenSizePerspective=this.parameters.screenSizePerspective!=null,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normalType,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this.parameters.customDepthTest!=null&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?Ln.None:this.parameters.cullFace,this._configuration.multipassEnabled=i.multipassEnabled,this._configuration.cullAboveGround=i.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=this.parameters.modelTransformation!=null,e!==ue.Color&&e!==ue.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=Is.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&this.parameters.doubleSidedType==="normal"?Is.View:this.parameters.doubleSided&&this.parameters.doubleSidedType==="winding-order"?Is.WindingOrder:Is.None,this._configuration.instancedColor=this.parameters.hasInstancedColor,this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=i.ssao!=null,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?ei.Schematic:ei.Normal:ei.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.enableOffset=i.camera.relativeElevationvDe(t,e)))}function Rle(t){let e=0,i=0,r=0,n=!1,s=0;const o=new B6e;for(const l of t)l!=null&&(e+=l.verticesPerFeature,i+=l.verticesPerCoordinate,r+=l.drawCallsPerFeature,o.bytesPerFeature+=l.memory.bytesPerFeature,o.bytesPerFeatureLabel+=l.memory.bytesPerFeatureLabel,o.resourceBytes+=l.memory.resourceBytes,o.draped.bytesPerFeature+=l.memory.bytesPerFeature,o.draped.bytesPerFeatureLabel+=l.memory.bytesPerFeatureLabel,n=n||l.estimated,++s);return n?new f3t(s,{verticesPerFeature:e,verticesPerCoordinate:i,drawCallsPerFeature:r,memory:o}):new p3t(s,{verticesPerFeature:e,verticesPerCoordinate:i,drawCallsPerFeature:r,memory:o})}function Loi(t){const e=Rle(t);return e.numComplexities>0&&(e.verticesPerFeature/=e.numComplexities,e.verticesPerCoordinate/=e.numComplexities,e.drawCallsPerFeature/=e.numComplexities,e.memory.bytesPerFeature/=e.numComplexities,e.memory.bytesPerFeatureLabel/=e.numComplexities,e.memory.resourceBytes/=e.numComplexities,e.memory.draped.bytesPerFeature/=e.numComplexities,e.memory.draped.bytesPerFeatureLabel/=e.numComplexities),e}const fW={};function vDe(t,e){var n,s;const i=_De(t,e),r=rut(e)?2:0;switch(e.type){case"extrude":return new ff({verticesPerFeature:-12,verticesPerCoordinate:12,drawCallsPerFeature:r,memory:i});case"fill":if(t.type==="mesh-3d")return new ff({drawCallsPerFeature:r,memory:i});if(e.outline!=null&&e.outline.size>0)return new ff({verticesPerFeature:-12,verticesPerCoordinate:9,memory:i});case"water":return new ff({verticesPerFeature:-6,verticesPerCoordinate:3,memory:i});case"line":return new ff({verticesPerFeature:-6,verticesPerCoordinate:6,memory:i});case"object":return(n=e.resource)!=null&&n.href?new Ele({verticesPerFeature:100,memory:i}):{...iSt(((s=e.resource)==null?void 0:s.primitive)??Fse),memory:i};case"path":{let o=0,l=0;switch(e.profile){case"circle":o=F6e;break;case"quad":o=4;break;default:return void(e.profile,void 0)}switch(e.join??"simple"){case"round":l=N6e;break;case"miter":case"bevel":l=1;break;default:return}const c=2*o,f=o*l*2,_=f+c;let x=-2*f-c;switch(e.cap){case"none":break;case"butt":case"square":x+=2*(o-1);break;case"round":x+=2*(o*(nie-1)*2+o);break;default:return}return new ff({verticesPerFeature:x,verticesPerCoordinate:_,memory:i})}case"text":case"icon":return new ff({verticesPerFeature:6,memory:i});default:return}}function _De(t,e){const i=t.type==="point-3d";switch(e.type){case"extrude":return e.edges&&e.edges.size>0?gu.EXTRUDE_EDGES:gu.EXTRUDE;case"fill":return e.outline!=null&&e.outline.size>0?gu.FILL_OUTLINE:gu.FILL;case"water":return gu.FILL;case"line":return e.join==="round"?gu.LINE_ROUND:gu.LINE_MITER;case"path":switch(e.join){case"round":switch(e.profile){case"circle":return gu.PATH_ROUND_CIRCLE;case"quad":return gu.PATH_ROUND_QUAD;default:return void(e.profile,void 0)}case"miter":case"bevel":switch(e.profile){case"circle":return gu.PATH_MITER_CIRCLE;case"quad":return gu.PATH_MITER_QUAD;default:return void(e.profile,void 0)}default:return}case"object":return i?gu.OBJECT_POINT:gu.OBJECT_POLYGON;case"icon":case"text":return i?gu.ICON_POINT:gu.ICON_POLYGON;default:return}}function iSt(t){const e=fW[t];if(e)return e;const i=bDe(V6e(t,new km({})).levels);return fW[t]=new ff({verticesPerFeature:i}),fW[t]}function bDe(t){return t.reduce((e,i,r)=>e+i.numVertices*(1/10**r),0)/t.reduce((e,i,r)=>e+1/10**r,0)}const gu={ICON_POINT:{bytesPerFeature:2111.586639736967,bytesPerFeatureLabel:870.520855,resourceBytes:0,draped:{bytesPerFeature:1799.2619971817762,bytesPerFeatureLabel:857.4890149999999}},ICON_POLYGON:{bytesPerFeature:2829.8183316810564,bytesPerFeatureLabel:858.0951816666667,resourceBytes:0,draped:{bytesPerFeature:2521.242008227286,bytesPerFeatureLabel:869.6919750000001}},OBJECT_POINT:{bytesPerFeature:607.8007336777831,bytesPerFeatureLabel:715.7017950000001,resourceBytes:0,draped:{bytesPerFeature:607.8007336777831,bytesPerFeatureLabel:715.7017950000001}},OBJECT_POLYGON:{bytesPerFeature:1111.4123028075749,bytesPerFeatureLabel:684.5498416666667,resourceBytes:0,draped:{bytesPerFeature:1111.4123028075749,bytesPerFeatureLabel:684.5498416666667}},LINE_MITER:{bytesPerFeature:3053.034748007272,bytesPerFeatureLabel:804.5473016666666,resourceBytes:0,draped:{bytesPerFeature:2649.5661560225844,bytesPerFeatureLabel:843.3404083333334}},LINE_ROUND:{bytesPerFeature:3225.35183564197,bytesPerFeatureLabel:807.296835,resourceBytes:0,draped:{bytesPerFeature:2650.9229994933276,bytesPerFeatureLabel:861.108335}},PATH_MITER_CIRCLE:{bytesPerFeature:38664.832646351235,bytesPerFeatureLabel:862.95665,resourceBytes:0,draped:{bytesPerFeature:38664.832646351235,bytesPerFeatureLabel:862.95665}},PATH_ROUND_CIRCLE:{bytesPerFeature:42462.97022293504,bytesPerFeatureLabel:851.35885,resourceBytes:0,draped:{bytesPerFeature:42462.97022293504,bytesPerFeatureLabel:851.35885}},PATH_MITER_QUAD:{bytesPerFeature:25558.22153327986,bytesPerFeatureLabel:838.56885,resourceBytes:0,draped:{bytesPerFeature:25558.22153327986,bytesPerFeatureLabel:838.56885}},PATH_ROUND_QUAD:{bytesPerFeature:42274.86801764233,bytesPerFeatureLabel:867.5658500000001,resourceBytes:0,draped:{bytesPerFeature:42274.86801764233,bytesPerFeatureLabel:867.5658500000001}},FILL:{bytesPerFeature:3124.272297197038,bytesPerFeatureLabel:850.6966816666666,resourceBytes:0,draped:{bytesPerFeature:2630.99580851019,bytesPerFeatureLabel:845.464495}},FILL_OUTLINE:{bytesPerFeature:4501.643043274039,bytesPerFeatureLabel:866.3982816666668,resourceBytes:0,draped:{bytesPerFeature:3841.8870233416183,bytesPerFeatureLabel:854.9969683333334}},EXTRUDE:{bytesPerFeature:7545.975968446941,bytesPerFeatureLabel:859.7106016666668,resourceBytes:0,draped:{bytesPerFeature:7545.975968446941,bytesPerFeatureLabel:859.7106016666668}},EXTRUDE_EDGES:{bytesPerFeature:2872.306473115409,bytesPerFeatureLabel:604.556581666667,resourceBytes:0,draped:{bytesPerFeature:2872.306473115409,bytesPerFeatureLabel:604.556581666667}}};var To;(function(t){t[t.RecreateSymbol=0]="RecreateSymbol",t[t.RecreateGraphics=1]="RecreateGraphics",t[t.FastUpdate=2]="FastUpdate"})(To||(To={}));let Ile=class{constructor(e){this.schedule=e,this._abortController=null,this._loadStatus=ep.LOADING,this._loadError=null,this._loader=null,this.logger=null}destroy(){this.abortLoad()}get loadStatus(){return this._loadStatus}load(e,i){return this._loadStatus===ep.LOADED?(e&&e(),this._loader??Promise.resolve()):this._loadStatus===ep.FAILED?(i&&i(this._loadError),this._loader??Promise.resolve()):(this._loader==null&&(this._abortController=new AbortController,this._loader=this.doLoad(this._abortController.signal).then(()=>{this._abortController=null,this._loadStatus=ep.LOADED},r=>{throw this._loadError=r,this._abortController=null,this._loadStatus=ep.FAILED,!sn(r)&&this.logger&&r.message&&this.logger.warn(r.message),r})),this._loader.then(e,i).catch(()=>{}),this._loader)}abortLoad(){this._abortController!=null?this._abortController=gn(this._abortController):this._loadStatus===ep.LOADING&&(this._loadStatus=ep.FAILED),this._loader=null}};var ep;(function(t){t[t.LOADING=0]="LOADING",t[t.LOADED=1]="LOADED",t[t.FAILED=2]="FAILED"})(ep||(ep={}));const pC=Ce.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayer");let p1=class extends Ile{constructor(e,i,r,n){super(r.schedule),this.symbol=e,this.symbolLayer=i,this._context=r,this.ignoreDrivers=!1,this._drivenProperties={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1},this._materials=[],this.usedMemory=0,this.logger=pC,this._elevationOptions={supportsOffsetAdjustment:!1,supportsOnTheGround:!0},this.skipHighSymbolLodsChanged=!0,this._renderPriority=n.renderPriority,this._renderPriorityStep=n.renderPriorityStep,this._elevationContext=new VU,this.complexity=this.computeComplexity(),this.ignoreDrivers=n.ignoreDrivers,this.ignoreDrivers||(this._drivenProperties=Nye(this._context.renderer)),this._updateElevationContext()}getCachedSize(){return null}get extentPadding(){return 0}get materials(){return this._materials}_drivenPropertiesChanged(e){if(this.ignoreDrivers)return!1;const i=this._drivenProperties,r=Nye(e);return r.color!==i.color||r.opacity!==i.opacity||r.opacityAlwaysOpaque!==i.opacityAlwaysOpaque||r.size!==i.size}get needsDrivenTransparentPass(){return this._drivenProperties.opacity&&!this._drivenProperties.opacityAlwaysOpaque}_logGeometryCreationWarnings(e,i,r,n){const s=e.projectionSuccess,o="polygons"in e?e.polygons:null,l=`${n} geometry failed to be created`;let c=null;s?!this._logGeometryValidationWarnings(i,r,n)&&o&&o.length===0&&r==="rings"&&i.length>0&&i[0].length>2&&(c=`${l} (filled rings should use clockwise winding - try reversing the order of vertices)`):c=`${l} (failed to project geometry to view spatial reference)`,c&&pC.warnOncePerTick(c)}_logGeometryValidationWarnings(e,i,r){const n=`${r} geometry failed to be created`;return!e.length||e.length===1&&!e[0].length?(pC.warnOncePerTick(`${n} (no ${i} were defined)`),!0):(!Array.isArray(e)||!Array.isArray(e[0]))&&(pC.warnOncePerTick(`${n} (${i} should be defined as a 2D array)`),!0)}_validateGeometry(e,i=null,r=null){if(i!=null&&!i.includes(e.type))return this.logger.warn("unsupported geometry type for "+r+` symbol: ${e.type}`),!1;if(e.type==="point"){const n=e;if(!isFinite(n.x)||!isFinite(n.y))return pC.warn("point coordinate is not a valid number, graphic skipped"),!1}return!0}_defaultElevationInfoNoZ(){return rSt}_defaultElevationInfoZ(){return nSt}_updateElevationContext(){this._elevationInfoOverride!=null?(this._elevationContext.setFromElevationInfo(this._elevationInfoOverride),this._elevationContext.updateFeatureExpressionInfoContext(null)):this._context.layer.elevationInfo?(this._elevationContext.setFromElevationInfo(this._context.layer.elevationInfo),this._elevationContext.updateFeatureExpressionInfoContext(this._context.featureExpressionInfoContext)):this._elevationContext.reset()}getDefaultElevationInfo(e){return e.hasZ?this._defaultElevationInfoZ():this._defaultElevationInfoNoZ()}getGeometryElevationMode(e,i=this.getDefaultElevationInfo(e)){return this._elevationContext.mode||i.mode}setElevationInfoOverride(e){this._elevationInfoOverride=e,this._updateElevationContext()}setGraphicElevationContext(e,i=new VU){const r=e.geometry,n=this.getDefaultElevationInfo(r);i.unit=this._elevationContext.unit!=null?this._elevationContext.unit:n.unit,i.mode=this.getGeometryElevationMode(r,n),i.offsetMeters=this._elevationContext.meterUnitOffset??n.offset??0;const s=!this._elevationOptions.supportsOnTheGround&&i.mode==="on-the-ground";s&&(i.mode="relative-to-ground",i.offsetMeters=0);const o=s?l3t:this._elevationContext.featureExpressionInfoContext;return i.updateFeatureExpressionInfoContext(o,e,this._context.layer),i}prepareSymbolLayerPatch(e){}updateGeometry(e,i){return!1}updateTransform(e,i,r,n){return!1}onRemoveGraphic(e){}_getLayerOpacity(){return this._context.graphicsCoreOwner&&"fullOpacity"in this._context.graphicsCoreOwner?this._context.graphicsCoreOwner.fullOpacity??0:this._context.layer.opacity??1}_getCombinedOpacity(e,i=Fye){let r=1;return this.draped||(r*=this._getLayerOpacity()),this._drivenProperties.opacity||(e!=null?r*=e.a:i.hasIntrinsicColor||(r=0)),r}_getCombinedOpacityAndColor(e,i=Fye){const r=this._getCombinedOpacity(e,i);if(this._drivenProperties.color)return w$(null,r);const n=e!=null?qe.toUnitRGB(e):Bv;return w$(n,r)}_getVertexOpacityAndColor(e,i=null){const r=this._drivenProperties.color?e.color:null,n=this._drivenProperties.opacity?e.opacity:null,s=w$(r,n);return i&&(s[0]*=i,s[1]*=i,s[2]*=i,s[3]*=i),s}isFastUpdatesEnabled(){return this._fastUpdates!=null}computeComplexity(){return vDe(this.symbol,this.symbolLayer)}globalPropertyChanged(e,i,r){switch(e){case"opacity":return this.layerOpacityChanged(i,r),!0;case"elevationInfo":{const n=this._elevationContext.mode;return this._updateElevationContext(),this.layerElevationInfoChanged(i,r,n)!==Ys.RECREATE}case"slicePlaneEnabled":return this.slicePlaneEnabledChanged(i,r);case"physicalBasedRenderingEnabled":return this.physicalBasedRenderingChanged();case"pixelRatio":return this.pixelRatioChanged;case"skipHighSymbolLods":return this.skipHighSymbolLodsChanged;default:return!1}}get pixelRatioChanged(){return!0}updateGraphics3DGraphicElevationInfo(e,i,r){let n=Ys.UPDATE;return e.forEach(s=>{const o=i(s);if(o!=null){const l=s.graphic;this.setGraphicElevationContext(l,o.elevationContext),o.needsElevationUpdates=r(o.elevationContext.mode)}else n=Ys.RECREATE}),n}applyRendererDiff(e,i){return To.RecreateSymbol}getFastUpdateAttrValues(e){if(!this._fastUpdates)return null;const i=this._fastUpdates.visualVariables,r=i.size?Om(i.size.field,e):0,n=i.color?Om(i.color.field,e):0,s=i.opacity?Om(i.opacity.field,e):0;return Mi(r,n,s,0)}get draped(){return this._draped}ensureDrapedStatus(e){return this._draped==null?(this._draped=e,!0):(e!==this.draped&&pC.warnOnce("A symbol can only produce either draped or non-draped visualizations. Use two separate symbol instances for draped and non-draped graphics if necessary."),!1)}test(){const e=()=>{var i,r,n,s,o,l,c,f;return{size:((r=(i=this._fastUpdates)==null?void 0:i.visualVariables.size)==null?void 0:r.field)??null,color:((s=(n=this._fastUpdates)==null?void 0:n.visualVariables.color)==null?void 0:s.field)??null,opacity:((l=(o=this._fastUpdates)==null?void 0:o.visualVariables.opacity)==null?void 0:l.field)??null,rotation:((f=(c=this._fastUpdates)==null?void 0:c.visualVariables.rotation)==null?void 0:f.field)??null}};return{drivenProperties:this._drivenProperties,getVisVarFields:e}}};function Nye(t){const e={color:!1,opacity:!1,opacityAlwaysOpaque:!0,size:!1};return t&&"visualVariables"in t&&t.visualVariables&&t.visualVariables.forEach(i=>{switch(i.type){case"color":if(e.color=!0,i.stops)for(let r=0;r0;)this.removeGeometry(0)}geometryVertexAttributeUpdated(e,i,r=!1){this._emit("attributesChanged",{object:this,geometry:e,attribute:i,sync:r}),Bct(i)&&this._invalidateBoundingVolume()}get visible(){return this._visible}set visible(e){if(this._visible!==e){this._visible=e;for(const i of this._geometries)i.visible=this._visible;this._emit("visibilityChanged",this)}}maskOccludee(){const e=new EU(S_.MaskOccludee);for(const i of this._geometries)i.occludees=Ote(i.occludees,e);return this._emit("occlusionChanged",this),e}removeOcclude(e){for(const i of this._geometries)i.occludees=Pte(i.occludees,e);this._emit("occlusionChanged",this)}highlight(){const e=new EU(S_.Highlight);for(const i of this._geometries)i.highlights=Ote(i.highlights,e);return this._emit("highlightChanged",this),e}removeHighlight(e){for(const i of this._geometries)i.highlights=Pte(i.highlights,e);this._emit("highlightChanged",this)}getCombinedStaticTransformation(e,i){return nn(i,this.transformation,e.transformation)}getCombinedShaderTransformation(e,i=Qe()){return nn(i,this.effectiveTransformation,e.transformation)}get boundingVolumeWorldSpace(){return this._bvWorldSpace||(this._bvWorldSpace=this._bvWorldSpace||new kye,this._validateBoundingVolume(this._bvWorldSpace,x$.WorldSpace)),this._bvWorldSpace}get boundingVolumeObjectSpace(){return this._bvObjectSpace||(this._bvObjectSpace=this._bvObjectSpace||new kye,this._validateBoundingVolume(this._bvObjectSpace,x$.ObjectSpace)),this._bvObjectSpace}_validateBoundingVolume(e,i){const r=i===x$.ObjectSpace;for(const n of this._geometries){const s=n.boundingInfo;s&&sSt(s,e,r?n.transformation:this.getCombinedShaderTransformation(n))}Qr(e.bounds,e.min,e.max,.5);for(const n of this._geometries){const s=n.boundingInfo;if(s==null)continue;const o=r?n.transformation:this.getCombinedShaderTransformation(n),l=l5(o);bt(zye,s.center,o);const c=Sn(zye,e.bounds),f=s.radius*l;e.bounds[3]=Math.max(e.bounds[3],c+f)}}_invalidateBoundingVolume(){var i;const e=(i=this._bvWorldSpace)==null?void 0:i.bounds;this._bvObjectSpace=this._bvWorldSpace=void 0,this._parentLayer&&e&&this._parentLayer.notifyObjectBBChanged(this,e)}_emit(e,i){this._parentLayer&&this._parentLayer.events.emit(e,i)}get test(){const e=this;return{hasGeometry:i=>e._geometries.includes(i),getGeometryIndex:i=>e._geometries.indexOf(i)}}},wDe=class{constructor(){this.min=nt(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.max=nt(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE)}isEmpty(){return this.max[0]s.camera.fullViewport),new ft("lineSize",(n,s)=>n.size>0?Math.max(1,n.size)*s.camera.pixelRatio:0),new ln("pixelToNDC",(n,s)=>or(Vye,2/s.camera.fullViewport[2],2/s.camera.fullViewport[3])),new ft("borderSize",(n,s)=>n.borderColor!=null?s.camera.pixelRatio:0),new ln("screenOffset",(n,s)=>or(Vye,n.horizontalScreenOffset*s.camera.pixelRatio,0))),e.varyings.add("coverageSampling","vec4"),e.varyings.add("lineSizes","vec2"),t.multipassEnabled&&e.varyings.add("depth","float"),t.occlusionTestEnabled&&e.include(c6e),t.hasScreenSizePerspective&&Zj(i),i.code.add(V` + void main(void) { + ProjectHUDAux projectAux; + vec4 endPoint = projectPositionHUD(projectAux); + + vec3 vpos = projectAux.posModel; + if (rejectBySlice(vpos)) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + ${t.occlusionTestEnabled?V` + if (!testHUDVisibility(endPoint)) { + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + }`:""} + + ${t.hasScreenSizePerspective?V` + vec3 perspectiveFactor = screenSizePerspectiveScaleFactor(projectAux.absCosAngle, projectAux.distanceToCamera, screenSizePerspectiveAlignment); + vec2 screenOffsetScaled = applyScreenSizePerspectiveScaleFactorVec2(screenOffset, perspectiveFactor); + `:V`vec2 screenOffsetScaled = screenOffset;`} + // Add view dependent polygon offset to get exact same original starting point. This is mostly used to get the + // correct depth value + vec3 posView = (view * vec4(position, 1.0)).xyz; + ${t.multipassEnabled?"depth = posView.z;":""} + + applyHUDViewDependentPolygonOffset(auxpos1.w, projectAux.absCosAngle, posView); + vec4 startPoint = proj * vec4(posView, 1.0); + // Apply screen offset to both start and end point + vec2 screenOffsetNorm = screenOffsetScaled * 2.0 / viewport.zw; + startPoint.xy += screenOffsetNorm * startPoint.w; + endPoint.xy += screenOffsetNorm * endPoint.w; + // Align start and end to pixel origin + vec4 startAligned = alignToPixelOrigin(startPoint, viewport.zw); + vec4 endAligned = alignToPixelOrigin(endPoint, viewport.zw); + ${t.depthHudEnabled?t.depthHudAlignStartEnabled?V`endAligned = vec4(endAligned.xy / endAligned.w * startAligned.w, startAligned.zw);`:V`startAligned = vec4(startAligned.xy / startAligned.w * endAligned.w, endAligned.zw);`:""} + vec4 projectedPosition = mix(startAligned, endAligned, uv0.y); + // The direction of the line in screen space + vec2 screenSpaceDirection = normalize(endAligned.xy / endAligned.w - startAligned.xy / startAligned.w); + vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x); + ${t.hasScreenSizePerspective?V` + float lineSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(lineSize, perspectiveFactor); + float borderSizeScaled = applyScreenSizePerspectiveScaleFactorFloat(borderSize, perspectiveFactor); + `:V` + float lineSizeScaled = lineSize; + float borderSizeScaled = borderSize; + `} + float halfPixelSize = lineSizeScaled * 0.5; + + // Compute full ndc offset, adding 1px padding for doing anti-aliasing and the border size + float padding = 1.0 + borderSizeScaled; + vec2 ndcOffset = (-halfPixelSize - padding + uv0.x * (lineSizeScaled + padding + padding)) * pixelToNDC; + + // Offset x/y from the center of the line in screen space + projectedPosition.xy += perpendicularScreenSpaceDirection * ndcOffset * projectedPosition.w; + + // Compute a coverage varying which we can use in the fragment shader to determine + // how much a pixel is actually covered by the line (i.e. to anti alias the line). + // This works by computing two coordinates that can be linearly interpolated and then + // subtracted to find out how far away from the line edge we are. + float edgeDirection = (uv0.x * 2.0 - 1.0); + + float halfBorderSize = 0.5 * borderSizeScaled; + float halfPixelSizeAndBorder = halfPixelSize + halfBorderSize; + float outerEdgeCoverageSampler = edgeDirection * (halfPixelSizeAndBorder + halfBorderSize + 1.0); + + float isOneSided = float(lineSizeScaled < 2.0 && borderSize < 2.0); + + coverageSampling = vec4( + // Edge coordinate + outerEdgeCoverageSampler, + + // Border edge coordinate + outerEdgeCoverageSampler - halfPixelSizeAndBorder * isOneSided, + + // Line offset + halfPixelSize - 0.5, + + // Border offset + halfBorderSize - 0.5 + halfPixelSizeAndBorder * (1.0 - isOneSided) + ); + + lineSizes = vec2(lineSizeScaled, borderSizeScaled); + + gl_Position = projectedPosition; + } + `),r.uniforms.add(new gr("uColor",n=>Uye(n.color)),new gr("borderColor",n=>Uye(n.borderColor))),t.multipassEnabled&&(r.include(R$e,t),r.uniforms.add(new ln("inverseViewport",(n,s)=>s.inverseViewport))),r.code.add(V` + void main() { + ${t.multipassEnabled?"if( geometryDepthTest(gl_FragCoord.xy * inverseViewport, depth) ){ discard; }":""} + + // Mix between line and border coverage offsets depending on whether we need + // a border (based on the sidedness). + vec2 coverage = min(1.0 - clamp(abs(coverageSampling.xy) - coverageSampling.zw, 0.0, 1.0), lineSizes); + + // Mix between border and line color based on the line coverage (conceptually the line blends on top of the + // border background). + // + // Anti-alias by blending final result using the full (including optional border) coverage and the color alpha + float borderAlpha = uColor.a * borderColor.a * coverage.y; + float colorAlpha = uColor.a * coverage.x; + + float finalAlpha = mix(borderAlpha, 1.0, colorAlpha); + + ${t.depthHudEnabled?V` + if (finalAlpha < 0.01) { + discard; + } + `:V` + vec3 finalRgb = mix(borderColor.rgb * borderAlpha, uColor.rgb, colorAlpha); + fragColor = vec4(finalRgb, finalAlpha); + `} + } + `),e}function Uye(t){return t??gp}const Vye=yt(),hSt=Object.freeze(Object.defineProperty({__proto__:null,build:ODe},Symbol.toStringTag,{value:"Module"}));let PDe=class RDe extends Hr{initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global}initializeProgram(e){return new Ir(e.rctx,RDe.shader.get().build(this.configuration),Er)}setPipelineState(e){const i=e?Zr.ALWAYS:Zr.LESS;return this.configuration.depthHudEnabled?Ti({depthTest:{func:i},depthWrite:rh}):Ti({blending:Ol(st.ONE,st.SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),depthTest:{func:i},colorWrite:ji})}initializePipeline(){return this.setPipelineState(this.configuration.multipassEnabled)}};PDe.shader=new Rr(hSt,()=>we(()=>Promise.resolve().then(()=>CWt),void 0));let Xp=class extends hu{constructor(){super(...arguments),this.screenCenterOffsetUnitsEnabled=!1,this.spherical=!1,this.occlusionTestEnabled=!0,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.depthHudEnabled=!1,this.depthHudAlignStartEnabled=!1,this.hasSlicePlane=!1,this.multipassEnabled=!1}};y([fe()],Xp.prototype,"screenCenterOffsetUnitsEnabled",void 0),y([fe()],Xp.prototype,"spherical",void 0),y([fe()],Xp.prototype,"occlusionTestEnabled",void 0),y([fe()],Xp.prototype,"hasVerticalOffset",void 0),y([fe()],Xp.prototype,"hasScreenSizePerspective",void 0),y([fe()],Xp.prototype,"depthHudEnabled",void 0),y([fe()],Xp.prototype,"depthHudAlignStartEnabled",void 0),y([fe()],Xp.prototype,"hasSlicePlane",void 0),y([fe()],Xp.prototype,"multipassEnabled",void 0),y([fe({constValue:!0})],Xp.prototype,"hasSliceInVertexProgram",void 0),y([fe({constValue:!1})],Xp.prototype,"draped",void 0);let CN=class sie extends hx{get uniqueMaterialIdentifier(){return this._uniqueMaterialIdentifier}constructor(e){super(e,new IDe),this._configuration=new Xp,this._uniqueMaterialIdentifier=sie.uniqueMaterialIdentifier(this.parameters)}getPassParameters(){return this.parameters}getConfiguration(e,i){const r=(i==null?void 0:i.slot)!==ke.LINE_CALLOUTS;return this._configuration.occlusionTestEnabled=this.parameters.occlusionTest,this._configuration.hasVerticalOffset=this.parameters.verticalOffset!=null,this._configuration.hasScreenSizePerspective=this.parameters.screenSizePerspective!=null,this._configuration.depthHudEnabled=r,this._configuration.depthHudAlignStartEnabled=!!this.parameters.depthHUDAlignStart,this._configuration.screenCenterOffsetUnitsEnabled=this.parameters.centerOffsetUnits==="screen",this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.multipassEnabled=i.multipassEnabled,this._configuration}intersect(){}produces(e,i){if(i===ue.Color)switch(e){case ke.LINE_CALLOUTS:case ke.LINE_CALLOUTS_HUD_DEPTH:return!0}return!1}createGLMaterial(e){return new dSt(e)}createBufferWriter(){return new fSt}validateParameters(e){const i=sie.uniqueMaterialIdentifier(e);i!==this._uniqueMaterialIdentifier&&(this._uniqueMaterialIdentifier=i)}static uniqueMaterialIdentifier(e){return JSON.stringify({horizontalScreenOffset:e.horizontalScreenOffset??0,centerOffsetUnits:e.centerOffsetUnits||"world"})}},dSt=class extends cx{beginSlot(e){return this.ensureTechnique(PDe,e)}},IDe=class extends yle{constructor(){super(...arguments),this.horizontalScreenOffset=0,this.color=[0,0,0,1],this.size=1,this.occlusionTest=!1,this.shaderPolygonOffset=1e-5,this.depthHUDAlignStart=!1,this.centerOffsetUnits="world",this.hasSlicePlane=!1}};const pSt=ls().vec3f(J.POSITION).vec3f(J.NORMAL).vec2f(J.UV0).vec4f(J.AUXPOS1),Bye=[vf(0,0),vf(1,0),vf(0,1),vf(1,0),vf(1,1),vf(0,1)];let fSt=class{constructor(){this.vertexBufferLayout=pSt}elementCount(e){return 6*e.attributes.get(J.POSITION).indices.length}write(e,i,r,n,s){vle(r.attributes.get(J.POSITION),e,n.position,s,6),_le(r.attributes.get(J.NORMAL),i,n.normal,s,6),M5(r.attributes.get(J.AUXPOS1),n.auxpos1,s,6);for(let o=0;oc.type==="object"||c.type==="text"));if(s.type!=="label-3d"&&o||s.type==="point-3d"&&s.symbolLayers.every(c=>c.type==="text"&&!cOe(c)))return null;const l=wle(r.geometry);return l==null?null:this._createAs3DShape(l,n,i,r.uid)}layerOpacityChanged(){var e;(e=this._materials[0])==null||e.setParameters(this._materialParameters)}layerElevationInfoChanged(e,i,r){const n=this._elevationContext.mode,s=i6(LDe.elevationModeChangeTypes,r,n);return s!==Ys.UPDATE||e.forEach(o=>{const l=i(o);l!=null&&this.updateGraphicElevationContext(o.graphic,l)}),s}slicePlaneEnabledChanged(){var e;return(e=this._materials[0])==null||e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}setGraphicElevationContext(e,i,r=0){return super.setGraphicElevationContext(e,i),i.addOffsetRenderUnits(r),i}updateGraphicElevationContext(e,i){this.setGraphicElevationContext(e,i.elevationContext,i.metadata!=null?i.metadata.elevationOffset:0),i.needsElevationUpdates=t0(i.elevationContext.mode)}computeComplexity(){return new ff({verticesPerFeature:6})}_createVertexData(e){const{translation:i,centerOffset:r}=e,n=new It(i?[i[0],i[1],i[2]]:[0,0,0],mW,3,!0),s=new It(r?[r[0],r[1],r[2],r[3]]:[0,0,0,1],mW,4,!0);return[[J.POSITION,n],[J.NORMAL,new It([0,0,1],mW,3,!0)],[J.AUXPOS1,s]]}_getOrCreateMaterial(e){var n;const i=this._perInstanceMaterialParameters(e),r=CN.uniqueMaterialIdentifier(i);if(r===((n=this._materials[0])==null?void 0:n.uniqueMaterialIdentifier))return{material:this._materials[0],isUnique:!1};if(e.materialCollection!=null){let s=e.materialCollection.get(r);return s==null&&(s=new CN(i),e.materialCollection.add(r,s)),{material:s,isUnique:!1}}return{material:new CN(i),isUnique:!0}}_createAs3DShape(e,i,r,n){const s=this._context.layer.uid,o=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:n,layerUid:s}),l=this._getOrCreateMaterial(r),c=new Bo(l.material,this._createVertexData(r),null,Ws.Point,o),f=$le(this._context,e,c,i,n);if(f==null)return null;const _=new d1(this,f.object,[c],l.isUnique?[l.material]:null,null,_T,i);return _.metadata=new D6e(r.elevationOffset),_.alignedSampledElevation=f.sampledElevation,_.needsElevationUpdates=t0(i.mode),zL(_,e,this._context.elevationProvider),_}};$De.elevationModeChangeTypes={definedChanged:Ys.UPDATE,staysOnTheGround:Ys.UPDATE,onTheGroundChanged:Ys.RECREATE};const mW=[0],mSt={mode:"relative-to-ground",offset:0},gSt={ignoreDrivers:!0,renderPriority:0,renderPriorityStep:1};let ySt=class{constructor(e,i,r=W(),n=Xi(),s=0,o="world",l=0,c=null){this.renderer=e,this.symbol=i,this.translation=r,this.centerOffset=n,this.horizontalScreenOffset=s,this.centerOffsetUnits=o,this.elevationOffset=l,this.materialCollection=c}},vSt=class extends c3t{};const jye=Ce.getLogger("esri.views.3d.layers.graphics.Graphics3DCalloutSymbolLayerFactory");function _St(t,e){if(!Vse(t))return jye.error("Graphics3DCalloutSymbolLayerFactory#make",`symbol of type '${t.type}' does not support callouts`),null;if(!t.callout)return null;const i=bSt[t.callout.type];return i?new i(t,e):(jye.error("Graphics3DCalloutSymbolLayerFactory#make",`unknown or unsupported callout type ${t.callout.type}`),null)}const bSt={line:$De},Lle=(t,e,i)=>[e,i],P5=(t,e,i)=>[e,i,t[2]],Dle=(t,e,i)=>[e,i,t[2],t[3]];function qoi(t){return t?{originPosition:t.originPosition==="upper-left"?"upperLeft":t.originPosition==="lower-left"?"lowerLeft":t.originPosition,scale:t.tolerance?[t.tolerance,t.tolerance]:[1,1],translate:t.extent!=null?[t.extent.xmin,t.extent.ymax]:[0,0]}:null}function wSt({scale:t,translate:e},i){return Math.round((i-e[0])/t[0])}function xSt({scale:t,translate:e},i){return Math.round((e[1]-i)/t[1])}function DDe({scale:t,translate:e},i){return i*t[0]+e[0]}function NDe({scale:t,translate:e},i){return e[1]-i*t[1]}function FDe(t,e,i){const r=new Array(i.length);if(!i.length)return r;const[n,s]=t.scale;let o=DDe(t,i[0][0]),l=NDe(t,i[0][1]);r[0]=e(i[0],o,l);for(let c=1;c{const l=CSt(o,e,i,t.objectIdFieldName),c=l.geometry;if(c!=null&&r)switch(c.type){case"point":l.geometry=UDe(r,c,c,c.hasZ,c.hasM);break;case"multipoint":l.geometry=zDe(r,c,c,!!c.hasZ,!!c.hasM);break;case"polygon":l.geometry=VDe(r,c,c,!!c.hasZ,!!c.hasM);break;case"polyline":l.geometry=BDe(r,c,c,!!c.hasZ,!!c.hasM);break;case"extent":case"mesh":l.geometry=c}return l});return{geometryType:e,features:n,spatialReference:i,fields:((s=t.fields)==null?void 0:s.map(o=>moe.fromJSON(o)))??[],objectIdFieldName:t.objectIdFieldName,globalIdFieldName:t.globalIdFieldName,geohashFieldName:t.geohashFieldName,geometryProperties:t.geometryProperties,hasZ:t.hasZ,hasM:t.hasM,exceededTransferLimit:t.exceededTransferLimit,transform:null}}function CSt(t,e,i,r){return{uid:hp(),objectId:r&&t.attributes?t.attributes[r]:null,attributes:t.attributes,geometry:ASt(t.geometry,e,i),visible:!0}}function ASt(t,e,i){if(t==null)return null;switch(e){case"point":{const r=t;return{x:r.x,y:r.y,z:r.z,m:r.m,hasZ:r.z!=null,hasM:r.m!=null,type:"point",spatialReference:i}}case"polyline":{const r=t;return{paths:r.paths,hasZ:!!r.hasZ,hasM:!!r.hasM,type:"polyline",spatialReference:i}}case"polygon":{const r=t;return{rings:r.rings,hasZ:!!r.hasZ,hasM:!!r.hasM,type:"polygon",spatialReference:i}}case"multipoint":{const r=t;return{points:r.points,hasZ:!!r.hasZ,hasM:!!r.hasM,type:"multipoint",spatialReference:i}}}}function MSt(t){if(t==null)return 0;let e=32;switch(t.type){case"point":e+=42;break;case"polyline":case"polygon":{let i=0;const r=2+(t.hasZ?1:0)+(t.hasM?1:0),n=t.type==="polyline"?t.paths:t.rings;for(const s of n)i+=s.length;e+=8*i*r+64,e+=128*i,e+=34,e+=32*(n.length+1);break}case"multipoint":{const i=2+(t.hasZ?1:0)+(t.hasM?1:0),r=t.points.length;e+=8*r*i+64,e+=128*r,e+=34,e+=32;break}case"extent":e+=98,t.hasM&&(e+=32),t.hasZ&&(e+=32);break;case"mesh":e+=l_(t.vertexAttributes.position,t.vertexAttributes.normal,t.vertexAttributes.uv,t.vertexAttributes.tangent)}return e}function eai(t){let e=32;return e+=z3e(t.attributes),e+=3,e+=8+MSt(t.geometry),e}function tai(t){if(t==null)return 0;switch(t.type){case"point":return 1;case"polyline":{let e=0;for(const i of t.paths)e+=i.length;return e}case"polygon":{let e=0;for(const i of t.rings)e+=i.length;return e}case"multipoint":return t.points.length;case"extent":return 2;case"mesh":{const e=t.vertexAttributes&&t.vertexAttributes.position;return e?e.length/3:0}default:return}}function iai(t){if(t==null)return!1;switch(t.type){case"extent":case"point":return!0;case"polyline":for(const e of t.paths)if(e.length>0)return!0;return!1;case"polygon":for(const e of t.rings)if(e.length>0)return!0;return!1;case"multipoint":return t.points.length>0;case"mesh":return!t.loaded||t.vertexAttributes.position.length>0}}function rai(t,e){switch(Bn(e),t.type==="mesh"&&(t=t.extent),t.type){case"point":e[0]=e[3]=t.x,e[1]=e[4]=t.y,t.hasZ&&(e[2]=e[5]=t.z);break;case"polyline":for(let i=0;ie+i)}forEachVertex(e){let i=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;r{t[i]=n,t[i+1]=s},Gye=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+2]},ISt=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+3]},$St=(t,e,i,r,n,s)=>{t[i]=n,t[i+1]=s,t[i+2]=e[r+2],t[i+3]=e[r+3]};function Nle(t,e,i,r){if(t){if(i)return e&&r?$St:Gye;if(e&&r)return ISt}else if(e&&r)return Gye;return RSt}function gW({scale:t,translate:e},i){return Math.round((i-e[0])/t[0])}function yW({scale:t,translate:e},i){return Math.round((e[1]-i)/t[1])}function vW({scale:t,translate:e},i,r){return i*t[r]+e[r]}function lai(t,e,i){return t?e?i?zle(t):Fle(t):i?kle(t):cG(t):null}function cG(t){const e=t.coords;return{x:e[0],y:e[1]}}function qDe(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t}function Fle(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2]}}function LSt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t}function kle(t){const e=t.coords;return{x:e[0],y:e[1],m:e[2]}}function DSt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.m,t}function zle(t){const e=t.coords;return{x:e[0],y:e[1],z:e[2],m:e[3]}}function NSt(t,e){return t.coords[0]=e.x,t.coords[1]=e.y,t.coords[2]=e.z,t.coords[3]=e.m,t}function FSt(t,e,i,r){let n=cG;i&&r?n=zle:i?n=Fle:r&&(n=kle);for(const s of e){const{geometry:o,attributes:l}=s,c=o!=null?n(o):null;t.push({attributes:l,geometry:c})}return t}function Ule(t,e){return t&&e?NSt:t?LSt:e?DSt:qDe}function kSt(t,e,i,r,n){const s=Ule(i,r);for(const{geometry:o,attributes:l}of e){const c=o!=null?s(new J2,o):null;t.push(new QT(c,l,null,n?l[n]:void 0))}return t}function cai(t,e,i=Ule(e.z!=null,e.m!=null)){return i(t,e)}function zSt(t,e,i,r){for(const{geometry:n,attributes:s}of e)t.push({attributes:s,geometry:n!=null?WDe(n,i,r):null});return t}function WDe(t,e,i){if(t==null)return null;const r=Mc(e,i),n=[];for(let s=0;s=c&&(t.lengths.push(H),U=k)}return zm(t.coords,U),t.coords.length?t:null}function gai(t,e,i,r,n,s,o=i,l=r){if(t_(t),!(e!=null&&e.coords.length))return null;const c=HDe[n],{coords:f,lengths:_}=e,x=Mc(i,r),T=Mc(i&&o,r&&l),A=Nle(i,r,o,l);if(!_.length)return A(t.coords,f,0,0,f[0],f[1]),t_(t,x,0),t;let M=0;const I=s*s;for(const L of _){if(L=c?t.lengths.push(U):zm(t.coords,F*T),M+=L*x}return t.coords.length?t:null}function XSt(t,e,i,r){const n=t[e],s=t[e+1],o=t[i],l=t[i+1],c=t[r],f=t[r+1];let _=o,x=l,T=c-_,A=f-x;if(T!==0||A!==0){const M=((n-_)*T+(s-x)*A)/(T*T+A*A);M>1?(_=c,x=f):M>0&&(_+=T*M,x+=A*M)}return T=n-_,A=s-x,T*T+A*A}function oie(t,e,i,r,n,s,o){let l,c=r,f=0;for(let _=s+i;_c&&(f=_,c=l);c>r&&(f-s>i&&oie(t,e,i,r,n,s,f),n(t,e,t.length,f,e[f],e[f+1]),o-f>i&&oie(t,e,i,r,n,f,o))}function yai(t,e,i,r){var f;if(!((f=e==null?void 0:e.coords)!=null&&f.length))return null;const n=Mc(i,r);let s=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;if(e&&e.coords){const _=e.coords;for(let x=0;x<_.length;x+=n){const T=_[x],A=_[x+1];s=Math.min(s,T),l=Math.max(l,T),o=Math.min(o,A),c=Math.max(c,A)}}return $J(t)?Mrt(t,s,o,l,c):ose(s,o,l,c,t),t}function qye(t,e,i,r,n){const{coords:s,lengths:o}=e,l=Mc(i,r);if(!s.length)return t!==e&&t_(t),t;ky(n);const{originPosition:c,scale:f,translate:_}=n,x=JSt;x.originPosition=c;const T=x.scale;T[0]=f[0]??1,T[1]=-(f[1]??1),T[2]=f[2]??1,T[3]=f[3]??1;const A=x.translate;if(A[0]=_[0]??0,A[1]=_[1]??0,A[2]=_[2]??0,A[3]=_[3]??0,!o.length){for(let I=0;INB(t,WMe),null,10,5),KSt=Ni();let QSt=class{get labelLayers(){return this._labelLayers||Lje}get extent(){return this._extent}get isElevationSource(){return this.layers.some(e=>e==null?void 0:e.isElevationSource)}constructor(e,i,r,n,s){this.graphic=e,this.graphics3DSymbol=i,this.layers=r,this._visibleFlags=Hl.ALL_LABEL,this.deconflictionPriority=0,++i.referenced,this._featureExpressionFeature=s?R6e(s,e,n):null}initialize(e){this._layer=e,this._forEachSymbolLayerGraphic(i=>{i.initialize(e),i.setVisibility(this.isVisible())})}destroy(){this._forEachSymbolLayerGraphic(e=>e.destroy()),this._calloutLayer=null,--this.graphics3DSymbol.referenced,this.graphics3DSymbol=null}get destroyed(){return this.layers==null}clearLabelGraphics(){this._forEachLabelGraphic(e=>e.destroy()),this._labelLayers=null}addLabelGraphic(e,i){this._labelLayers||(this._labelLayers=new Array),this._labelLayers.push(e),e.initialize(i),e.setVisibility(this.isVisible(Ya.LABEL))}setCalloutGraphic(e){this._calloutLayer=e,this._layer&&(e.initialize(this._layer),e.setVisibility(this.isVisible()))}get calloutLayer(){return this._calloutLayer}get isDraped(){let e=!1;return this._forEachSymbolLayerGraphic(i=>{i.type==="draped"&&(e=!0)}),e}isVisible(e=Ya.GRAPHIC,i){const r=i?this._visibleFlags|i|Ya.LABEL*i:this._visibleFlags;return e===Ya.GRAPHIC?(r&Hl.ALL_GRAPHIC)===Hl.ALL_GRAPHIC:(r&Hl.ALL_LABEL)===Hl.ALL_LABEL}setVisibilityFlag(e,i,r){const n=this.isVisible(e);r?this._visibleFlags|=e*i:this._visibleFlags&=~(e*i);const s=this.isVisible(e);if(n===s)return!1;if(e===Ya.LABEL)this._forEachLabelGraphic(o=>o.setVisibility(s));else{this._forEachSymbolLayerGraphic(l=>l.setVisibility(s));const o=this.isVisible(Ya.LABEL);this._forEachLabelGraphic(l=>l.setVisibility(o))}return!0}getVisibilityFlag(e,i){return(this._visibleFlags&e*i)!=0}computeExtent(e){if(!this._extent){const i=this.graphic.geometry;if(i==null)return!1;this._extent=Ni(),OSt(i,this._extent);const r=i.spatialReference;if(!Zn(r,e)&&!mj(this._extent,r,this._extent,e))return this._extent=null,!1}return!0}getAsOptimizedGeometry(e,i){return this._optimizedGeometry||(this._optimizedGeometry=this._convertGraphicToOptimizedGeometry(this.graphic,e,i)),this._optimizedGeometry}_convertGraphicToOptimizedGeometry(e,i,r){let n=e.geometry;return n.type!=="mesh"&&n.type!=="extent"||(n=Qa.fromExtent(n.type==="mesh"?n.extent:n)),qSt(n,i,r)}get usedMemory(){let e=z3e(this.graphic.attributes);return this._forEachSymbolLayerGraphic(i=>e+=i.graphics3DSymbolLayer.usedMemory),e}computeAttachmentOrigin(){const e={render:{origin:W(),num:0},draped:{origin:yt(),num:0}};for(const i of this.layers)i!=null&&i.computeAttachmentOrigin(e);return e.render.num>1&&De(e.render.origin,e.render.origin,1/e.render.num),e.draped.num>1&&Gu(e.draped.origin,e.draped.origin,1/e.draped.num),e}async getProjectedBoundingBox(e,i,r,n,s){return s||(s={boundingBox:null,requiresDrapedElevation:!1,screenSpaceObjects:[]}),s.boundingBox?Bn(s.boundingBox):s.boundingBox=Bn(),s.requiresDrapedElevation=!1,await JV(this.layers,async o=>{if(o==null)return;const l=o.type==="draped"?i:e,c=Wye.acquire(),f=await o.getProjectedBoundingBox(l,r,s.screenSpaceObjects,n,c);isFinite(f[2])&&isFinite(f[5])||(s.requiresDrapedElevation=!0),f&&ZO(s.boundingBox,c),Wye.release(c)}),Crt(s.boundingBox)||qZ(Lse(s.boundingBox,KSt))?s:null}needsElevationUpdates(){var e;for(const i of this.layers)if(i!=null&&(i.type==="object3d"||i.type==="lod-instance")&&i.needsElevationUpdates)return!0;return((e=this._labelLayers)==null?void 0:e.some(i=>(i==null?void 0:i.needsElevationUpdates)??!1))??!1}alignWithElevation(e,i,r){this._forEachRenderedGraphic(n=>{n.type!=="object3d"&&n.type!=="lod-instance"||n.alignWithElevation(e,i,this._featureExpressionFeature,r)})}alignWithAbsoluteElevation(e,i,r){this._forEachRenderedGraphic(n=>{n.type==="object3d"&&n.alignWithAbsoluteElevation(e,i,r)})}addObjectStateSet(e,i){this._forEachSymbolLayerGraphic(r=>r.addObjectState(e,i))}removeObjectState(e){this._forEachSymbolLayerGraphic(i=>i.removeObjectState(e))}_forEachGraphicList(e,i){e==null||e.forEach(r=>r&&i(r))}_forEachSymbolLayerGraphic(e){this._forEachGraphicList(this.layers,e),this._calloutLayer&&e(this._calloutLayer)}_forEachLabelGraphic(e){this._forEachGraphicList(this._labelLayers,e)}_forEachRenderedGraphic(e){this._forEachSymbolLayerGraphic(e),this._forEachLabelGraphic(e)}get test(){const e=this;return{addLabelLayer:i=>{e._labelLayers||(e._labelLayers=new Array),e._labelLayers.push(i)}}}},wai=class{constructor(e,i){this.scheduler=e,this.schedule=i,this.sharedResources=null,this.streamDataRequester=null,this.elevationProvider=null,this.renderer=null,this.stage=null,this.clippingExtent=null,this.renderCoordsHelper=null,this.overlaySR=null,this.layer=null,this.drapeSourceRenderer=null,this.graphicsCoreOwner=null,this.localOriginFactory=null,this.featureExpressionInfoContext=null,this.screenSizePerspectiveEnabled=!0,this.slicePlaneEnabled=!1,this.physicalBasedRenderingEnabled=!1,this.skipHighSymbolLods=!1,this.isAsync=!1}},eTt=class{constructor(){this.renderPriority=0,this.renderPriorityStep=1,this.ignoreDrivers=!1}};var Yye,Xye,Zye,aie={exports:{}};aie.exports,Yye=aie,Xye=function(){function t(te,le,de){de=de||2;var ve,Se,Ae,Pe,Ge,ut,Ft,Qt=le&&le.length,At=Qt?le[0]*de:te.length,ri=e(te,0,At,de,!0),Rt=[];if(!ri||ri.next===ri.prev)return Rt;if(Qt&&(ri=c(te,le,ri,de)),te.length>80*de){ve=Ae=te[0],Se=Pe=te[1];for(var dt=de;dtAe&&(Ae=Ge),ut>Pe&&(Pe=ut);Ft=(Ft=Math.max(Ae-ve,Pe-Se))!==0?1/Ft:0}return r(ri,Rt,de,ve,Se,Ft),Rt}function e(te,le,de,ve,Se){var Ae,Pe;if(Se===Ee(te,le,de,ve)>0)for(Ae=le;Ae=le;Ae-=ve)Pe=be(Ae,te[Ae],te[Ae+1],Pe);if(Pe&&j(Pe,Pe.next)){var Ge=Pe.next;ye(Pe),Pe=Ge}return Pe}function i(te,le){if(!te)return te;le||(le=te);var de,ve=te;do if(de=!1,ve.steiner||!j(ve,ve.next)&&U(ve.prev,ve,ve.next)!==0)ve=ve.next;else{var Se=ve.prev;if(ye(ve),(ve=le=Se)===ve.next)break;de=!0}while(de||ve!==le);return le}function r(te,le,de,ve,Se,Ae,Pe){if(te){!Pe&&Ae&&M(te,ve,Se,Ae);for(var Ge,ut,Ft=te;te.prev!==te.next;)if(Ge=te.prev,ut=te.next,Ae?s(te,ve,Se,Ae):n(te))le.push(Ge.i/de),le.push(te.i/de),le.push(ut.i/de),ye(te),te=ut.next,Ft=ut.next;else if((te=ut)===Ft){Pe?Pe===1?r(te=o(i(te),le,de),le,de,ve,Se,Ae,2):Pe===2&&l(te,le,de,ve,Se,Ae):r(i(te),le,de,ve,Se,Ae,1);break}}}function n(te){var le=te.prev,de=te,ve=te.next;if(U(le,de,ve)>=0)return!1;for(var Se=te.next.next;Se!==te.prev;){if(z(le.x,le.y,de.x,de.y,ve.x,ve.y,Se.x,Se.y)&&U(Se.prev,Se,Se.next)>=0)return!1;Se=Se.next}return!0}function s(te,le,de,ve){var Se=te.prev,Ae=te,Pe=te.next;if(U(Se,Ae,Pe)>=0)return!1;for(var Ge=Se.xAe.x?Se.x>Pe.x?Se.x:Pe.x:Ae.x>Pe.x?Ae.x:Pe.x,Qt=Se.y>Ae.y?Se.y>Pe.y?Se.y:Pe.y:Ae.y>Pe.y?Ae.y:Pe.y,At=L(Ge,ut,le,de,ve),ri=L(Ft,Qt,le,de,ve),Rt=te.prevZ,dt=te.nextZ;Rt&&Rt.z>=At&&dt&&dt.z<=ri;){if(Rt!==te.prev&&Rt!==te.next&&z(Se.x,Se.y,Ae.x,Ae.y,Pe.x,Pe.y,Rt.x,Rt.y)&&U(Rt.prev,Rt,Rt.next)>=0||(Rt=Rt.prevZ,dt!==te.prev&&dt!==te.next&&z(Se.x,Se.y,Ae.x,Ae.y,Pe.x,Pe.y,dt.x,dt.y)&&U(dt.prev,dt,dt.next)>=0))return!1;dt=dt.nextZ}for(;Rt&&Rt.z>=At;){if(Rt!==te.prev&&Rt!==te.next&&z(Se.x,Se.y,Ae.x,Ae.y,Pe.x,Pe.y,Rt.x,Rt.y)&&U(Rt.prev,Rt,Rt.next)>=0)return!1;Rt=Rt.prevZ}for(;dt&&dt.z<=ri;){if(dt!==te.prev&&dt!==te.next&&z(Se.x,Se.y,Ae.x,Ae.y,Pe.x,Pe.y,dt.x,dt.y)&&U(dt.prev,dt,dt.next)>=0)return!1;dt=dt.nextZ}return!0}function o(te,le,de){var ve=te;do{var Se=ve.prev,Ae=ve.next.next;!j(Se,Ae)&&H(Se,ve,ve.next,Ae)&&re(Se,Ae)&&re(Ae,Se)&&(le.push(Se.i/de),le.push(ve.i/de),le.push(Ae.i/de),ye(ve),ye(ve.next),ve=te=Ae),ve=ve.next}while(ve!==te);return i(ve)}function l(te,le,de,ve,Se,Ae){var Pe=te;do{for(var Ge=Pe.next.next;Ge!==Pe.prev;){if(Pe.i!==Ge.i&&k(Pe,Ge)){var ut=ce(Pe,Ge);return Pe=i(Pe,Pe.next),ut=i(ut,ut.next),r(Pe,le,de,ve,Se,Ae),void r(ut,le,de,ve,Se,Ae)}Ge=Ge.next}Pe=Pe.next}while(Pe!==te)}function c(te,le,de,ve){var Se,Ae,Pe,Ge=[];for(Se=0,Ae=le.length;Se=ve.next.y&&ve.next.y!==ve.y){var Ge=ve.x+(Ae-ve.y)*(ve.next.x-ve.x)/(ve.next.y-ve.y);if(Ge<=Se&&Ge>Pe){if(Pe=Ge,Ge===Se){if(Ae===ve.y)return ve;if(Ae===ve.next.y)return ve.next}de=ve.x=ve.x&&ve.x>=Qt&&Se!==ve.x&&z(Aede.x||ve.x===de.x&&A(de,ve)))&&(de=ve,ri=ut)),ve=ve.next;while(ve!==Ft);return de}function A(te,le){return U(te.prev,te,le.prev)<0&&U(le.next,te,te.next)<0}function M(te,le,de,ve){var Se=te;do Se.z===null&&(Se.z=L(Se.x,Se.y,le,de,ve)),Se.prevZ=Se.prev,Se.nextZ=Se.next,Se=Se.next;while(Se!==te);Se.prevZ.nextZ=null,Se.prevZ=null,I(Se)}function I(te){var le,de,ve,Se,Ae,Pe,Ge,ut,Ft=1;do{for(de=te,te=null,Ae=null,Pe=0;de;){for(Pe++,ve=de,Ge=0,le=0;le0||ut>0&&ve;)Ge!==0&&(ut===0||!ve||de.z<=ve.z)?(Se=de,de=de.nextZ,Ge--):(Se=ve,ve=ve.nextZ,ut--),Ae?Ae.nextZ=Se:te=Se,Se.prevZ=Ae,Ae=Se;de=ve}Ae.nextZ=null,Ft*=2}while(Pe>1);return te}function L(te,le,de,ve,Se){return(te=1431655765&((te=858993459&((te=252645135&((te=16711935&((te=32767*(te-de)*Se)|te<<8))|te<<4))|te<<2))|te<<1))|(le=1431655765&((le=858993459&((le=252645135&((le=16711935&((le=32767*(le-ve)*Se)|le<<8))|le<<4))|le<<2))|le<<1))<<1}function F(te){var le=te,de=te;do(le.x=0&&(te-Pe)*(ve-Ge)-(de-Pe)*(le-Ge)>=0&&(de-Pe)*(Ae-Ge)-(Se-Pe)*(ve-Ge)>=0}function k(te,le){return te.next.i!==le.i&&te.prev.i!==le.i&&!ne(te,le)&&(re(te,le)&&re(le,te)&&he(te,le)&&(U(te.prev,te,le.prev)||U(te,le.prev,le))||j(te,le)&&U(te.prev,te,te.next)>0&&U(le.prev,le,le.next)>0)}function U(te,le,de){return(le.y-te.y)*(de.x-le.x)-(le.x-te.x)*(de.y-le.y)}function j(te,le){return te.x===le.x&&te.y===le.y}function H(te,le,de,ve){var Se=Q(U(te,le,de)),Ae=Q(U(te,le,ve)),Pe=Q(U(de,ve,te)),Ge=Q(U(de,ve,le));return Se!==Ae&&Pe!==Ge||!(Se!==0||!Y(te,de,le))||!(Ae!==0||!Y(te,ve,le))||!(Pe!==0||!Y(de,te,ve))||!(Ge!==0||!Y(de,le,ve))}function Y(te,le,de){return le.x<=Math.max(te.x,de.x)&&le.x>=Math.min(te.x,de.x)&&le.y<=Math.max(te.y,de.y)&&le.y>=Math.min(te.y,de.y)}function Q(te){return te>0?1:te<0?-1:0}function ne(te,le){var de=te;do{if(de.i!==te.i&&de.next.i!==te.i&&de.i!==le.i&&de.next.i!==le.i&&H(de,de.next,te,le))return!0;de=de.next}while(de!==te);return!1}function re(te,le){return U(te.prev,te,te.next)<0?U(te,le,te.next)>=0&&U(te,te.prev,le)>=0:U(te,le,te.prev)<0||U(te,te.next,le)<0}function he(te,le){var de=te,ve=!1,Se=(te.x+le.x)/2,Ae=(te.y+le.y)/2;do de.y>Ae!=de.next.y>Ae&&de.next.y!==de.y&&Se<(de.next.x-de.x)*(Ae-de.y)/(de.next.y-de.y)+de.x&&(ve=!ve),de=de.next;while(de!==te);return ve}function ce(te,le){var de=new pe(te.i,te.x,te.y),ve=new pe(le.i,le.x,le.y),Se=te.next,Ae=le.prev;return te.next=le,le.prev=te,de.next=Se,Se.prev=de,ve.next=de,de.prev=ve,Ae.next=ve,ve.prev=Ae,ve}function be(te,le,de,ve){var Se=new pe(te,le,de);return ve?(Se.next=ve.next,Se.prev=ve,ve.next.prev=Se,ve.next=Se):(Se.prev=Se,Se.next=Se),Se}function ye(te){te.next.prev=te.prev,te.prev.next=te.next,te.prevZ&&(te.prevZ.nextZ=te.nextZ),te.nextZ&&(te.nextZ.prevZ=te.prevZ)}function pe(te,le,de){this.i=te,this.x=le,this.y=de,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ee(te,le,de,ve){for(var Se=0,Ae=le,Pe=de-ve;Ae0&&(ve+=te[Se-1].length,de.holes.push(ve))}return de},t},(Zye=Xye())!==void 0&&(Yye.exports=Zye);const R5=oP(aie.exports),uG=Ce.getLogger("esri.views.3d.support.buffer.math");function tTt(t,e,i){Um(t.typedBuffer,e.typedBuffer,i,t.typedBufferStride,e.typedBufferStride)}function Um(t,e,i,r=3,n=r){if(t.length/r!==Math.ceil(e.length/n))return uG.error("source and destination buffers need to have the same number of elements"),t;const s=t.length/r,o=i[0],l=i[1],c=i[2],f=i[4],_=i[5],x=i[6],T=i[8],A=i[9],M=i[10],I=i[12],L=i[13],F=i[14];let z=0,k=0;for(let U=0;U0){const T=1/Math.sqrt(x);t[o]=T*c,t[o+1]=T*f,t[o+2]=T*_}s+=r,o+=i}}function nTt(t,e,i){const r=Math.min(t.count,e.count),n=t.typedBuffer,s=t.typedBufferStride,o=e.typedBuffer,l=e.typedBufferStride;let c=0,f=0;for(let _=0;_>i,n[f+1]=o[c+1]>>i,n[f+2]=o[c+2]>>i,c+=l,f+=s}Object.freeze(Object.defineProperty({__proto__:null,normalize:hG,normalizeView:rTt,scale:jU,scaleView:iTt,shiftRight:nTt,transformMat3:Vm,transformMat3View:tNe,transformMat4:Um,transformMat4View:tTt},Symbol.toStringTag,{value:"Module"}));function sTt(t,e,i){return{objectId:t,target:e,distance:i,type:"vertex"}}function Jye(t,e,i,r,n,s=!1){return{objectId:t,target:e,distance:i,type:"edge",start:r,end:n,draped:s}}function dG(t,e){if(!t||t.symbol)return null;const i=e==null?void 0:e.renderer;return t&&i!=null&&i.getObservationRenderer?i.getObservationRenderer(t):i}function oTt(t,e){if(t.symbol!=null)return t.symbol;const i=dG(t,e);return i!=null&&i.type!=="dot-density"?i.getSymbol(t,e):null}function Tai(t,e){const i=dG(t,e),r=oTt(t,e);if(r==null)return null;const n={renderer:i,symbol:r};if(i==null||!("visualVariables"in i)||!i.visualVariables)return n;const s=qse(i,t,e)??[],o=["proportional","proportional","proportional"];for(const{variable:l,value:c}of s)switch(l.type){case"color":n.color=c.toRgba();break;case"size":if(l.target==="outline")n.outlineSize=c;else{const f=l.axis,_=l.useSymbolValue?"symbol-value":c;switch(f){case"width":o[0]=_;break;case"depth":o[1]=_;break;case"height":o[2]=_;break;case"width-and-depth":o[0]=o[1]=_;break;default:o[0]=o[1]=o[2]=_}}break;case"opacity":n.opacity=c;break;case"rotation":switch(l.axis){case"tilt":n.tilt=c;break;case"roll":n.roll=c;break;default:n.heading=c}}return o[0]==="proportional"&&o[1]==="proportional"&&o[2]==="proportional"||(n.size=o),n}async function aTt(t,e){if(t.symbol!=null)return t.symbol;const i=dG(t,e);return i!=null?i.getSymbolAsync(t,e):null}async function Eai(t,e){const i=dG(t,e),r=await aTt(t,e);if(!r)return null;const n={renderer:i,symbol:r};if(!i||!("visualVariables"in i)||!i.visualVariables)return n;const s=qse(i,t,e)??[],o=["proportional","proportional","proportional"];for(const{variable:l,value:c}of s)if(l.type==="color")n.color=qe.toUnitRGBA(c);else if(l.type==="size")if(l.target==="outline")n.outlineSize=c;else{const f=l.axis,_=l.useSymbolValue?"symbol-value":c;f==="width"?o[0]=_:f==="depth"?o[1]=_:f==="height"?o[2]=_:o[0]=o[1]=f==="width-and-depth"?_:o[2]=_}else l.type==="opacity"?n.opacity=c:l.type==="rotation"&&l.axis==="tilt"?n.tilt=c:l.type==="rotation"&&l.axis==="roll"?n.roll=c:l.type==="rotation"&&(n.heading=c);return(isFinite(o[0])||isFinite(o[1])||isFinite(o[2]))&&(n.size=o),n}function lTt(t,e=0){const i=t[e];return typeof i=="number"&&isFinite(i)?i:null}function cTt(t){for(let e=0;e<3;e++){const i=t[e];if(typeof i=="number")return isFinite(i)?i:0}return 0}function uTt(t,e,i,r){const n=(o=>!Array.isArray(o[0]))(e)?(o,l)=>e[3*o+l]:(o,l)=>e[o][l],s=r?ws(r)/Bf(r):1;return koe(t,(o,l)=>Ie(o,n(l,0)*s,n(l,1)*s,n(l,2)),i)}function iNe(t,e,i){const r=uTt(Kye,t,e,i)?Kye:[0,0,1];return Math.abs(r[2])>Math.cos(Ei(80))?Ms.Z:Math.abs(r[1])>Math.abs(r[0])?Ms.Y:Ms.X}const Kye=Fi();function hTt(t,e,i){const r=iNe(t,(e.length>0?e[0]:t.length/3)-1,i);if(r!==Ms.Z){t=t.slice();for(let n=0;n_&&(_=Y)}else _=n;const x=Math.floor(1.1*_)+1;(rg==null||rg.length<2*x)&&(rg=new Uint32Array(SAe(2*x)));for(let H=0;H<2*x;H++)rg[H]=0;let T=0;const A=!!f&&!!l,M=A?c:n;let I=TU(n);const L=new Uint32Array(c),F=1.96;let z=o!==0?Math.ceil(4*F*F/(o*o)*o*(1-o)):M,k=1,U=f?f[1]:M;for(let H=0;H=x&&(re-=x)}he===T&&(rg[2*re]=ne,rg[2*re+1]=Y+1,T++),I[Y]=he}if(o!==0&&1-T/n>>2)|0;return r>>>0}let rg=null;function Aai(t){const e=c6(t.rings,t.hasZ,Ky.CCW_IS_HOLE,t.spatialReference),i=new Array;let r=0,n=0;for(const l of e.polygons){const c=l.count,f=l.index,_=Lf(e.position,3*f,3*c),x=l.holeIndices.map(A=>A-f),T=Py(R5(_,x,3));i.push({position:_,faces:T}),r+=_.length,n+=T.length}const s=mTt(i,r,n),o=Array.isArray(s.position)?lie(s.position,3,{originalIndices:s.faces}):lie(s.position.buffer,6,{originalIndices:s.faces});return s.position=yLe(new Float64Array(o.buffer)),s.faces=o.indices,s}function mTt(t,e,i){if(t.length===1)return t[0];const r=Ja(e),n=new Array(i);let s=0,o=0,l=0;for(const c of t){for(let f=0;f=0;M--){const I=t[M],L=i===Ky.CCW_IS_HOLE&&gTt(I,e,r);if(L&&n!==1)s[c++]=I;else{let F=I.length;for(let k=0;k0&&(l[_++]={index:A,count:I.length}),A=L?AN(I,I.length-1,-1,T,A,I.length,e):AN(I,0,1,T,A,I.length,e);for(let k=0;k0&&(l[_++]={index:A,count:U.length}),A=AN(U,0,1,T,A,U.length,e)}c=0,z.count>0&&(o[f++]=z)}}for(let M=0;M0&&(l[_++]={index:A,count:I.length}),A=AN(I,0,1,T,A,I.length,e)}return o.length=f,l.length=_,{position:T,polygons:o,outlines:l}}function AN(t,e,i,r,n,s,o){n*=3;for(let l=0;l=e.max){const r=this.canvasGeometries.extents[this.canvasGeometries.numViews++];Fz(this._extent,-e.range,0,r)}}setupGeometryViewsDirect(){this.canvasGeometries.numViews=1,d_(this.canvasGeometries.extents[0],this._extent)}hasSomeSizedView(){for(let e=0;ei.valid?e|=1<n.camera.nearFar)),i.uniforms.add(new Zt("depthMap",(r,n)=>{var s;return(s=n.linearDepth)==null?void 0:s.colorTexture})),i.uniforms.add(new _s("proj",(r,n)=>n.camera.projectionMatrix)),i.uniforms.add(new ft("invResolutionHeight",(r,n)=>1/n.camera.height)),i.uniforms.add(new _s("reprojectionMatrix",(r,n)=>n.ssr.reprojectionMatrix)),i.code.add(V` + vec2 reprojectionCoordinate(vec3 projectionCoordinate) + { + vec4 zw = proj * vec4(0.0, 0.0, -projectionCoordinate.z, 1.0); + vec4 reprojectedCoord = reprojectionMatrix * vec4(zw.w * (projectionCoordinate.xy * 2.0 - 1.0), zw.z, zw.w); + reprojectedCoord.xy /= reprojectedCoord.w; + return reprojectedCoord.xy * 0.5 + 0.5; + } + + const int maxSteps = ${e.highStepCount?"150":"75"}; + + vec4 applyProjectionMat(mat4 projectionMat, vec3 x) + { + vec4 projectedCoord = projectionMat * vec4(x, 1.0); + projectedCoord.xy /= projectedCoord.w; + projectedCoord.xy = projectedCoord.xy*0.5 + 0.5; + return projectedCoord; + } + + vec3 screenSpaceIntersection(vec3 dir, vec3 startPosition, vec3 viewDir, vec3 normal) + { + vec3 viewPos = startPosition; + vec3 viewPosEnd = startPosition; + + // Project the start position to the screen + vec4 projectedCoordStart = applyProjectionMat(proj, viewPos); + vec3 Q0 = viewPos / projectedCoordStart.w; // homogeneous camera space + float k0 = 1.0/ projectedCoordStart.w; + + // advance the position in the direction of the reflection + viewPos += dir; + + vec4 projectedCoordVanishingPoint = applyProjectionMat(proj, dir); + + // Project the advanced position to the screen + vec4 projectedCoordEnd = applyProjectionMat(proj, viewPos); + vec3 Q1 = viewPos / projectedCoordEnd.w; // homogeneous camera space + float k1 = 1.0/ projectedCoordEnd.w; + + // calculate the reflection direction in the screen space + vec2 projectedCoordDir = (projectedCoordEnd.xy - projectedCoordStart.xy); + vec2 projectedCoordDistVanishingPoint = (projectedCoordVanishingPoint.xy - projectedCoordStart.xy); + + float yMod = min(abs(projectedCoordDistVanishingPoint.y), 1.0); + + float projectedCoordDirLength = length(projectedCoordDir); + float maxSt = float(maxSteps); + + // normalize the projection direction depending on maximum steps + // this determines how blocky the reflection looks + vec2 dP = yMod * (projectedCoordDir)/(maxSt * projectedCoordDirLength); + + // Normalize the homogeneous camera space coordinates + vec3 dQ = yMod * (Q1 - Q0)/(maxSt * projectedCoordDirLength); + float dk = yMod * (k1 - k0)/(maxSt * projectedCoordDirLength); + + // initialize the variables for ray marching + vec2 P = projectedCoordStart.xy; + vec3 Q = Q0; + float k = k0; + float rayStartZ = -startPosition.z; // estimated ray start depth value + float rayEndZ = -startPosition.z; // estimated ray end depth value + float prevEstimateZ = -startPosition.z; + float rayDiffZ = 0.0; + float dDepth; + float depth; + float rayDiffZOld = 0.0; + + // early outs + if (dot(normal, dir) < 0.0 || dot(-viewDir, normal) < 0.0) + return vec3(P, 0.0); + + for(int i = 0; i < maxSteps-1; i++) + { + depth = -linearDepthFromTexture(depthMap, P, nearFar); // get linear depth from the depth buffer + + // estimate depth of the marching ray + rayStartZ = prevEstimateZ; + dDepth = -rayStartZ - depth; + rayEndZ = (dQ.z * 0.5 + Q.z)/ ((dk * 0.5 + k)); + rayDiffZ = rayEndZ- rayStartZ; + prevEstimateZ = rayEndZ; + + if(-rayEndZ > nearFar[1] || -rayEndZ < nearFar[0] || P.y < 0.0 || P.y > 1.0 ) + { + return vec3(P, 0.); + } + + // If we detect a hit - return the intersection point, two conditions: + // - dDepth > 0.0 - sampled point depth is in front of estimated depth + // - if difference between dDepth and rayDiffZOld is not too large + // - if difference between dDepth and 0.025/abs(k) is not too large + // - if the sampled depth is not behind far plane or in front of near plane + + if((dDepth) < 0.025/abs(k) + abs(rayDiffZ) && dDepth > 0.0 && depth > nearFar[0] && depth < nearFar[1] && abs(P.y - projectedCoordStart.y) > invResolutionHeight) + { + return vec3(P, depth); + } + + // continue with ray marching + P = clamp(P + dP, vec2(0.0), vec2(0.999)); + Q.z += dQ.z; + k += dk; + rayDiffZOld = rayDiffZ; + } + return vec3(P, 0.0); + } + `)}function rNe(t,e){t.include(R3t,e),t.include(Aj),t.include(ETt),e.hasCloudsReflections&&t.include(v$e,e),e.hasScreenSpaceReflections&&t.include(CTt,e);const i=t.fragment;i.constants.add("fresnelSky","vec3",[.02,1,15]).add("fresnelMaterial","vec2",[.02,.1]).add("roughness","float",.015).add("foamIntensityExternal","float",1.7).add("ssrIntensity","float",.65).add("ssrHeightFadeStart","float",3e5).add("ssrHeightFadeEnd","float",5e5).add("waterDiffusion","float",.92).add("waterSeaColorMod","float",.8).add("correctionViewingPowerFactor","float",.4).add("skyZenitColor","vec3",[.52,.68,.9]).add("skyColor","vec3",[.67,.79,.9]).add("cloudFresnelModifier","vec2",[1.2,.01]),i.code.add(V`PBRShadingWater shadingInfo; +vec3 getSkyGradientColor(in float cosTheta, in vec3 horizon, in vec3 zenit) { +float exponent = pow((1.0 - cosTheta), fresnelSky[2]); +return mix(zenit, horizon, exponent); +}`),i.uniforms.add(new ft("lightingSpecularStrength",(r,n)=>n.lighting.mainLight.specularStrength),new ft("lightingEnvironmentStrength",(r,n)=>n.lighting.mainLight.environmentStrength)),i.code.add(V`vec3 getSeaColor(in vec3 n, in vec3 v, in vec3 l, vec3 color, in vec3 lightIntensity, in vec3 localUp, in float shadow, float foamIntensity, vec3 viewPosition, vec3 position) { +float reflectionHit = 0.0; +float reflectionHitDiffused = 0.0; +vec3 seaWaterColor = linearizeGamma(color); +vec3 h = normalize(l + v); +shadingInfo.NdotL = clamp(dot(n, l), 0.0, 1.0); +shadingInfo.NdotV = clamp(dot(n, v), 0.001, 1.0); +shadingInfo.VdotN = clamp(dot(v, n), 0.001, 1.0); +shadingInfo.NdotH = clamp(dot(n, h), 0.0, 1.0); +shadingInfo.VdotH = clamp(dot(v, h), 0.0, 1.0); +shadingInfo.LdotH = clamp(dot(l, h), 0.0, 1.0); +float upDotV = max(dot(localUp,v), 0.0); +vec3 skyHorizon = linearizeGamma(skyColor); +vec3 skyZenit = linearizeGamma(skyZenitColor); +vec3 skyColor = getSkyGradientColor(upDotV, skyHorizon, skyZenit ); +float upDotL = max(dot(localUp,l),0.0); +float daytimeMod = 0.1 + upDotL * 0.9; +skyColor *= daytimeMod; +float shadowModifier = clamp(shadow, 0.8, 1.0); +vec3 fresnelModifier = fresnelReflection(shadingInfo.VdotN, vec3(fresnelSky[0]), fresnelSky[1]); +vec3 reflSky = lightingEnvironmentStrength * fresnelModifier * skyColor * shadowModifier; +vec3 reflSea = seaWaterColor * mix(skyColor, upDotL * lightIntensity * LIGHT_NORMALIZATION, 2.0 / 3.0) * shadowModifier; +vec3 specular = vec3(0.0); +if(upDotV > 0.0 && upDotL > 0.0) { +vec3 specularSun = brdfSpecularWater(shadingInfo, roughness, vec3(fresnelMaterial[0]), fresnelMaterial[1]); +vec3 incidentLight = lightIntensity * LIGHT_NORMALIZATION * shadow; +specular = lightingSpecularStrength * shadingInfo.NdotL * incidentLight * specularSun; +} +vec3 foam = vec3(0.0); +if(upDotV > 0.0) { +foam = foamIntensity2FoamColor(foamIntensityExternal, foamIntensity, skyZenitColor, daytimeMod); +} +float correctionViewingFactor = pow(max(dot(v, localUp), 0.0), correctionViewingPowerFactor); +vec3 normalCorrectedClouds = mix(localUp, n, correctionViewingFactor); +vec3 reflectedWorld = normalize(reflect(-v, normalCorrectedClouds));`),e.hasCloudsReflections&&i.code.add(V`vec4 cloudsColor = renderClouds(reflectedWorld, position); +cloudsColor.a = 1.0 - cloudsColor.a; +cloudsColor = pow(cloudsColor, vec4(GAMMA)); +cloudsColor *= clamp(fresnelModifier.y * cloudFresnelModifier[0] - cloudFresnelModifier[1], 0.0, 1.0) * clamp((1.0 - totalFadeInOut), 0.0, 1.0);`),e.hasScreenSpaceReflections?(i.uniforms.add(new _s("view",(r,n)=>n.camera.viewMatrix),new Zt("lastFrameColorTexture",(r,n)=>{var s;return(s=n.ssr.lastFrameColor)==null?void 0:s.colorTexture}),new ft("fadeFactorSSR",(r,n)=>n.ssr.fadeFactor)),i.code.add(V`vec3 viewDir = normalize(viewPosition); +vec4 viewNormalVectorCoordinate = view *vec4(n, 0.0); +vec3 viewNormal = normalize(viewNormalVectorCoordinate.xyz); +vec4 viewUp = view * vec4(localUp, 0.0); +vec3 viewNormalCorrectedSSR = mix(viewUp.xyz, viewNormal, correctionViewingFactor); +vec3 reflected = normalize(reflect(viewDir, viewNormalCorrectedSSR)); +vec3 hitCoordinate = screenSpaceIntersection(reflected, viewPosition, viewDir, viewUp.xyz); +vec3 reflectedColor = vec3(0.0); +if (hitCoordinate.z > 0.0) +{ +vec2 reprojectedCoordinate = reprojectionCoordinate(hitCoordinate); +vec2 dCoords = smoothstep(0.3, 0.6, abs(vec2(0.5, 0.5) - hitCoordinate.xy)); +float heightMod = smoothstep(ssrHeightFadeEnd, ssrHeightFadeStart, -viewPosition.z); +reflectionHit = clamp(1.0 - (1.3 * dCoords.y), 0.0, 1.0) * heightMod * fadeFactorSSR; +reflectionHitDiffused = waterDiffusion * reflectionHit; +reflectedColor = linearizeGamma(texture(lastFrameColorTexture, reprojectedCoordinate).xyz) * +reflectionHitDiffused * fresnelModifier.y * ssrIntensity; +} +float seaColorMod = mix(waterSeaColorMod, waterSeaColorMod * 0.5, reflectionHitDiffused); +vec3 waterRenderedColor = tonemapACES((1.0 - reflectionHitDiffused) * reflSky + reflectedColor + +reflSea * seaColorMod + specular + foam);`)):i.code.add(V`vec3 waterRenderedColor = tonemapACES(reflSky + reflSea * waterSeaColorMod + specular + foam);`),e.hasCloudsReflections?e.hasScreenSpaceReflections?i.code.add(V`return waterRenderedColor * (1.0 - (1.0 - reflectionHit) * cloudsColor.a) + (1.0 - reflectionHit) * cloudsColor.xyz; +}`):i.code.add(V`return waterRenderedColor * (1.0 - cloudsColor.a) + cloudsColor.xyz; +}`):i.code.add(V`return waterRenderedColor; +}`)}let qU=class extends Ls{constructor(e,i){super(e,"vec4",Or.Draw,(r,n,s)=>r.setUniform4fv(e,i(n,s)))}};var vy;function ATt(t,e){const{vertex:i,fragment:r}=t;i.uniforms.add(new qU("overlayTexOffset",(n,s)=>MTt(n,s)),new qU("overlayTexScale",(n,s)=>OTt(n,s))),r.constants.add("overlayOpacity","float",1),r.uniforms.add(new Zt("ovColorTex",(n,s)=>uie(n,s))),nNe(t,e)}function mR(t,e){const{vertex:i,fragment:r}=t;i.uniforms.add(new i1e("overlayTexOffset"),new i1e("overlayTexScale")),r.uniforms.add(new ft("overlayOpacity",n=>n.overlayOpacity),new Zt("ovColorTex",(n,s)=>{var o;return(o=s.overlay)==null?void 0:o.getTexture(n.overlayContent)})),nNe(t,e)}(function(t){t[t.Disabled=0]="Disabled",t[t.Enabled=1]="Enabled",t[t.EnabledWithWater=2]="EnabledWithWater",t[t.COUNT=3]="COUNT"})(vy||(vy={}));let i1e=class extends Ls{constructor(e){super(e,"vec4")}};function nNe(t,e){e.pbrMode!==ei.Water&&e.pbrMode!==ei.WaterOnIntegratedMesh&&e.pbrMode!==ei.TerrainWithWater||t.include(rNe,e);const{vertex:i,fragment:r}=t;t.varyings.add("vtcOverlay","vec4"),i.code.add(V`void setOverlayVTC(in vec2 uv) { +vtcOverlay = vec4(uv, uv) * overlayTexScale + overlayTexOffset; +}`),r.code.add(V`bool isValid(vec2 uv, vec2 dxdy) { +return (uv.x >= 0.0 + dxdy.x) && (uv.x <= 1.0 - dxdy.x) && (uv.y >= 0.0 + dxdy.y) && (uv.y <= 1.0 - dxdy.y); +} +vec4 getOverlayColor(sampler2D ov0Tex, vec4 texCoords) { +vec4 color0 = texture(ov0Tex, vec2(texCoords.x * 0.5, texCoords.y)); +vec4 color1 = texture(ov0Tex, vec2(texCoords.z * 0.5 + 0.5, texCoords.w)); +bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy)); +bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0)); +return mix(color1 * float(isValid1), color0, float(isValid0)); +}`),r.code.add(V`vec4 getCombinedOverlayColor() { +return overlayOpacity * getOverlayColor(ovColorTex, vtcOverlay); +}`),r.code.add(V`vec4 getOverlayColorTexel(vec4 texCoords) { +vec2 texDim = vec2(textureSize(ovColorTex, 0)); +vec4 color0 = texelFetch(ovColorTex, ivec2(vec2(texCoords.x * 0.5, texCoords.y) * texDim), 0); +vec4 color1 = texelFetch(ovColorTex, ivec2(vec2(texCoords.z * 0.5 + 0.5, texCoords.w) * texDim), 0); +bool isValid0 = isValid(texCoords.xy, fwidth(texCoords.xy)); +bool isValid1 = isValid(texCoords.zw, vec2(0.0, 0.0)); +return mix(color1 * float(isValid1), color0, float(isValid0)); +}`),e.pbrMode!==ei.Water&&e.pbrMode!==ei.WaterOnIntegratedMesh&&e.pbrMode!==ei.TerrainWithWater||(B_(r),a1(r),r.code.add(V`vec4 getOverlayWaterColor(vec4 maskInput, vec4 colorInput, vec3 vposEyeDir, +float shadow, vec3 localUp, mat3 tbn, vec3 position, vec3 positionWorld) { +vec3 n = normalize(tbn * (2.0 * maskInput.rgb - vec3(1.0))); +vec3 v = vposEyeDir; +vec3 final = getSeaColor(n, v, mainLightDirection, colorInput.rgb, mainLightIntensity, localUp, 1.0 - shadow, maskInput.w, position, positionWorld); +return vec4(final, colorInput.w); +}`))}function uie(t,e){var i,r,n;return t.identifier===Hh.Material&&t.output===ue.Color?(i=e.overlay)==null?void 0:i.getTexture(ns.ColorNoRasterImage):t.identifier===Hh.Material&&t.output===ue.ObjectAndLayerIdColor?(r=e.overlay)==null?void 0:r.getTexture(ns.ObjectAndLayerIdColor):t.identifier===Hh.Highlight?(n=e.overlay)==null?void 0:n.getTexture(ns.Highlight):null}function MTt(t,e){var n,s,o,l;const i=(s=(n=e.overlay)==null?void 0:n.overlays[ko.INNER])==null?void 0:s.extent;Dz(i)&&(uy[0]=t.toMapSpace[0]/_c(i)-i[0]/_c(i),uy[1]=t.toMapSpace[1]/qu(i)-i[1]/qu(i));const r=(l=(o=e.overlay)==null?void 0:o.overlays[ko.OUTER])==null?void 0:l.extent;return Dz(r)&&(uy[2]=t.toMapSpace[0]/_c(r)-r[0]/_c(r),uy[3]=t.toMapSpace[1]/qu(r)-r[1]/qu(r)),uy}function OTt(t,e){var n,s,o,l;const i=(s=(n=e.overlay)==null?void 0:n.overlays[ko.INNER])==null?void 0:s.extent;Dz(i)&&(uy[0]=t.toMapSpace[2]/_c(i),uy[1]=t.toMapSpace[3]/qu(i));const r=(l=(o=e.overlay)==null?void 0:o.overlays[ko.OUTER])==null?void 0:l.extent;return Dz(r)&&(uy[2]=t.toMapSpace[2]/_c(r),uy[3]=t.toMapSpace[3]/qu(r)),uy}const uy=Xi();let Ble=class extends _n{constructor(){super(...arguments),this.color=Mi(1,1,1,1)}};function sNe(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("tex",e=>e.texture),new gr("uColor",e=>e.color)),t.fragment.code.add(V`void main() { +vec4 texColor = texture(tex, uv); +fragColor = texColor * uColor; +}`),t}const PTt=Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:Ble,build:sNe},Symbol.toStringTag,{value:"Module"}));let oNe=class{constructor(e){this._context=e,this._perConstructorInstances=new TP,this._frameCounter=0,this._keepAliveFrameCount=r1e}get viewingMode(){return this._context.viewingMode}get constructionContext(){return this._context}destroy(){this._perConstructorInstances.forEach(e=>e.forEach(i=>i.technique.destroy())),this._perConstructorInstances.clear()}acquire(e,i=ITt){const r=i.key;let n=this._perConstructorInstances.get(e,r);if(n==null){const s=new e(this._context,i,()=>this.release(s));n=new RTt(s),this._perConstructorInstances.set(e,r,n)}return++n.refCount,n.technique}releaseAndAcquire(e,i,r){if(r!=null){if(i.key===r.key)return r;this.release(r)}return this.acquire(e,i)}release(e){if(e==null||this._perConstructorInstances.empty)return;const i=this._perConstructorInstances.get(e.constructor,e.key);i!=null&&(--i.refCount,i.refCount===0&&(i.refZeroFrame=this._frameCounter))}frameUpdate(){this._frameCounter++,this._keepAliveFrameCount!==r1e&&this._perConstructorInstances.forEach((e,i)=>{e.forEach((r,n)=>{r.refCount===0&&r.refZeroFrame+this._keepAliveFrameCount{const n=async(s,o)=>{const l=o.shader;l&&(await l.reload(),s.forEach(c=>c.technique.reload(this._context)))};e.push(n(i,r))}),await Promise.all(e)}},RTt=class{constructor(e){this.technique=e,this.refCount=0,this.refZeroFrame=0}};const r1e=-1,ITt=new nh;let aNe=class{constructor(e,i,r,n){this._textureRepository=e,this._techniqueRepository=i,this.materialChanged=r,this.requestRender=n,this._id2glMaterialRef=new TP}dispose(){this._textureRepository.destroy()}acquire(e,i,r){if(this._ownMaterial(e),!e.produces(i,r))return null;let n=this._id2glMaterialRef.get(r,e.id);if(n==null){const s=e.createGLMaterial({material:e,techniqueRep:this._techniqueRepository,textureRepository:this._textureRepository,output:r});n=new $Tt(s),this._id2glMaterialRef.set(r,e.id,n)}return n.ref(),n.glMaterial}release(e,i){const r=this._id2glMaterialRef.get(i,e.id);r!=null&&(r.unref(),r.referenced||(Kt(r.glMaterial),this._id2glMaterialRef.delete(i,e.id)))}_ownMaterial(e){e.repository&&e.repository!==this&&Ce.getLogger("esri.views.3d.webgl-engine.lib.GLMaterialRepository").error("Material is already owned by a different material repository"),e.repository=this}},$Tt=class{constructor(e){this.glMaterial=e,this._refCnt=0}ref(){++this._refCnt}unref(){--this._refCnt,Xt(this._refCnt>=0)}get referenced(){return this._refCnt>0}};const LTt=["layerObjectAdded","layerObjectRemoved","layerObjectsAdded","layerObjectsRemoved","transformationChanged","shaderTransformationChanged","visibilityChanged","occlusionChanged","highlightChanged","geometryAdded","geometryRemoved","attributesChanged"];let hie=class rk{get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}constructor(e,i){this.objectToBoundingSphere=e,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new za,this._objectCount=0,i&&(i.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=i.maximumObjectsPerNode),i.maximumDepth!==void 0&&(this._maximumDepth=i.maximumDepth))}destroy(){this._degenerateObjects.clear(),za.clearPool(),die[0]=null,$x.prune(),K3.prune()}add(e,i=e.length){this._objectCount+=i,this._grow(e,i);const r=za.acquire();for(let n=0;n{if(!this._intersectsNode(n,s))return!1;const o=s.node;return o.terminals.forAll(l=>{this._intersectsObject(n,l)&&r(l)}),o.residents!==null&&o.residents.forAll(l=>{this._intersectsObject(n,l)&&r(l)}),!0})}forEachAlongRayWithVerticalOffset(e,i,r,n){const s=Sp(e,i);this._forEachNode(this._root,o=>{if(!this._intersectsNodeWithOffset(s,o,n))return!1;const l=o.node;return l.terminals.forAll(c=>{this._intersectsObjectWithOffset(s,c,n)&&r(c)}),l.residents!==null&&l.residents.forAll(c=>{this._intersectsObjectWithOffset(s,c,n)&&r(c)}),!0})}forEach(e){this._forEachNode(this._root,i=>{const r=i.node;return r.terminals.forAll(e),r.residents!==null&&r.residents.forAll(e),!0}),this._degenerateObjects.forEach(e)}forEachDegenerateObject(e){this._degenerateObjects.forEach(e)}findClosest(e,i,r,n=()=>!0,s=1/0){let o=1/0,l=1/0,c=null;const f=_W(e,i),_=x=>{if(--s,!n(x))return;const T=this.objectToBoundingSphere(x);if(!c2(r,T))return;const A=Fw(e,i,T),M=A-T[3],I=A+T[3];M{if(s<=0||!c2(r,x.bounds)||(De(Dp,f,x.halfSize),Be(Dp,Dp,x.bounds),Fw(e,i,Dp)>l))return!1;const T=x.node;return T.terminals.forAll(A=>_(A)),T.residents!==null&&T.residents.forAll(A=>_(A)),!0},e,i),c}forEachInDepthRange(e,i,r,n,s,o,l){let c=-1/0,f=1/0;const _={setRange:I=>{r===rk.DepthOrder.FRONT_TO_BACK?(c=Math.max(c,I.near),f=Math.min(f,I.far)):(c=Math.max(c,-I.far),f=Math.min(f,-I.near))}};_.setRange(n);const x=Fw(i,r,e),T=_W(i,r),A=_W(i,-r),M=I=>{if(!l(I))return;const L=this.objectToBoundingSphere(I),F=L,z=Fw(i,r,F)-x,k=z-L[3],U=z+L[3];k>f||U{if(!c2(o,I.bounds)||(De(Dp,T,I.halfSize),Be(Dp,Dp,I.bounds),Fw(i,r,Dp)-x>f)||(De(Dp,A,I.halfSize),Be(Dp,Dp,I.bounds),Fw(i,r,Dp)-xM(F)),L.residents!==null&&L.residents.forAll(F=>M(F)),!0},i,r)}forEachNode(e){this._forEachNode(this._root,i=>e(i.node,i.bounds,i.halfSize,i.depth))}forEachNeighbor(e,i){const r=Zv(i),n=i,s=c=>{const f=this.objectToBoundingSphere(c),_=Zv(f),x=r+_;return!(Co(f,n)-x*x<=0)||e(c)};let o=!0;const l=c=>{o&&(o=s(c))};this._forEachNode(this._root,c=>{const f=Zv(c.bounds),_=r+f;if(Co(c.bounds,n)-_*_>0)return!1;const x=c.node;return x.terminals.forAll(l),o&&x.residents!==null&&x.residents.forAll(l),o}),o&&this.forEachDegenerateObject(l)}_intersectsNode(e,i){return MN(i.bounds,2*-i.halfSize,Kd),MN(i.bounds,2*i.halfSize,Qd),mme(e.origin,e.direction,Kd,Qd)}_intersectsNodeWithOffset(e,i,r){return MN(i.bounds,2*-i.halfSize,Kd),MN(i.bounds,2*i.halfSize,Qd),r.applyToMinMax(Kd,Qd),mme(e.origin,e.direction,Kd,Qd)}_intersectsObject(e,i){const r=this.objectToBoundingSphere(i);return!(r[3]>0)||bQ(r,e)}_intersectsObjectWithOffset(e,i,r){const n=this.objectToBoundingSphere(i);return!(n[3]>0)||bQ(r.applyToBoundingSphere(n),e)}_forEachNode(e,i){let r=za.acquire().init(e);const n=[r];for(;n.length!==0;){if(r=n.pop(),i(r)&&!r.isLeaf())for(let s=0;s=0;--l){const c=o1e[l];s.node.children[c]&&o.push(za.acquire().init(s).advance(c))}za.release(s)}}_remove(e,i,r){$x.clear();const n=r.advanceTo(i,(s,o)=>{$x.push(s.node),$x.push(o)})?r.node.terminals:r.node.residents;if(n.removeUnordered(e),n.length===0)for(let s=$x.length-2;s>=0;s-=2){const o=$x.data[s],l=$x.data[s+1];if(!this._purge(o,l))break}}_nodeIsEmpty(e){if(e.terminals.length!==0)return!1;if(e.residents!==null)return e.residents.length===0;for(let i=0;i=0&&(e.children[i]=null),!!this._nodeIsEmpty(e)&&(e.residents===null&&(e.residents=new Pi({shrink:!0})),!0)}_add(e,i){i.advanceTo(this.objectToBoundingSphere(e))?i.node.terminals.push(e):(i.node.residents.push(e),i.node.residents.length>this._maximumObjectsPerNode&&i.depththis.objectToBoundingSphere(r),S1),hI(S1[3])&&!this._fitsInsideTree(S1)))if(this._nodeIsEmpty(this._root.node))a5(S1,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const r=this._rootBoundsForRootAsSubNode(S1);this._placingRootViolatesMaxDepth(r)?this._rebuildTree(S1,r):this._growRootAsSubNode(r),za.release(r)}}_rebuildTree(e,i){Ne(wW,i.bounds),wW[3]=i.halfSize,n1e([e,wW],2,n=>n,xW);const r=za.acquire().init(this._root);this._root.initFrom(null,xW,xW[3]),this._root.increaseHalfSize(1.25),this._forEachNode(r,n=>(this.add(n.node.terminals.data,n.node.terminals.length),n.node.residents!==null&&this.add(n.node.residents.data,n.node.residents.length),!0)),za.release(r)}_placingRootViolatesMaxDepth(e){const i=Math.log(e.halfSize/this._root.halfSize)*Math.LOG2E;let r=0;return this._forEachNode(this._root,n=>(r=Math.max(r,n.depth),r+i<=this._maximumDepth)),r+i>this._maximumDepth}_rootBoundsForRootAsSubNode(e){const i=e[3],r=e;let n=-1/0;const s=this._root.bounds,o=this._root.halfSize;for(let c=0;c<3;c++){const f=s[c]-o-(r[c]-i),_=r[c]+i-(s[c]+o),x=Math.max(0,Math.ceil(f/(2*o))),T=Math.max(0,Math.ceil(_/(2*o)))+1,A=2**Math.ceil(Math.log(x+T)*Math.LOG2E);n=Math.max(n,A),ON[c].min=x,ON[c].max=T}for(let c=0;c<3;c++){let f=ON[c].min,_=ON[c].max;const x=(n-(f+_))/2;f+=Math.ceil(x),_+=Math.floor(x);const T=s[c]-o-f*o*2;bW[c]=T+(_+f)*o}const l=n*o;return bW[3]=l*cNe,za.acquire().initFrom(null,bW,l,0)}_growRootAsSubNode(e){const i=this._root.node;Ne(S1,this._root.bounds),S1[3]=this._root.halfSize,this._root.init(e),e.advanceTo(S1,null,!0),e.node.children=i.children,e.node.residents=i.residents,e.node.terminals=i.terminals}_shrink(){for(;;){const e=this._findShrinkIndex();if(e===-1)break;this._root.advance(e),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let e=null;const i=this._root.node.children;let r=0,n=0;for(;n=i[0]-r&&e[0]<=i[0]+r&&e[1]>=i[1]-r&&e[1]<=i[1]+r&&e[2]>=i[2]-r&&e[2]<=i[2]+r}toJSON(){const{maximumDepth:e,maximumObjectsPerNode:i,_objectCount:r}=this,n=this._nodeToJSON(this._root.node);return{maximumDepth:e,maximumObjectsPerNode:i,objectCount:r,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:n}}}_nodeToJSON(e){var s,o;const i=e.children.map(l=>l?this._nodeToJSON(l):null),r=(s=e.residents)==null?void 0:s.map(l=>this.objectToBoundingSphere(l)),n=(o=e.terminals)==null?void 0:o.map(l=>this.objectToBoundingSphere(l));return{children:i,residents:r,terminals:n}}static fromJSON(e){const i=new rk(r=>r,{maximumDepth:e.maximumDepth,maximumObjectsPerNode:e.maximumObjectsPerNode});return i._objectCount=e.objectCount,i._root.initFrom(e.root.node,e.root.bounds,e.root.halfSize,e.root.depth),i}},za=class jA{constructor(){this.bounds=co(),this.halfSize=0,this.initFrom(null,null,0,0)}init(e){return this.initFrom(e.node,e.bounds,e.halfSize,e.depth)}initFrom(e,i,r,n=this.depth){return this.node=e??jA.createEmptyNode(),i!=null&&a5(i,this.bounds),this.halfSize=r,this.depth=n,this}increaseHalfSize(e){this.halfSize*=e,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*cNe}advance(e){let i=this.node.children[e];i||(i=jA.createEmptyNode(),this.node.children[e]=i),this.node=i,this.halfSize/=2,this.depth++;const r=lNe[e];return this.bounds[0]+=r[0]*this.halfSize,this.bounds[1]+=r[1]*this.halfSize,this.bounds[2]+=r[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),this}advanceTo(e,i,r=!1){for(;;){if(this.isTerminalFor(e))return i&&i(this,-1),!0;if(this.isLeaf()){if(!r)return i&&i(this,-1),!1;this.node.residents=null}const n=this._childIndex(e);i&&i(this,n),this.advance(n)}}isLeaf(){return this.node.residents!=null}isTerminalFor(e){return e[3]>this.halfSize/2}_childIndex(e){const i=this.bounds;return(i[0]r.distance-n.distance);for(let r=0;r<8;++r)i[r]=K3.data[r].index}function _W(t,e){let i,r=1/0;for(let n=0;n<8;++n){const s=Fw(t,e,s1e[n]);s0}za._pool=new Ec(za),function(t){var e;(e=t.DepthOrder||(t.DepthOrder={}))[e.FRONT_TO_BACK=1]="FRONT_TO_BACK",e[e.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(hie||(hie={}));const lNe=[nt(-1,-1,-1),nt(1,-1,-1),nt(-1,1,-1),nt(1,1,-1),nt(-1,-1,1),nt(1,-1,1),nt(-1,1,1),nt(1,1,1)],s1e=[nt(-1,-1,-1),nt(-1,-1,1),nt(-1,1,-1),nt(-1,1,1),nt(1,-1,-1),nt(1,-1,1),nt(1,1,-1),nt(1,1,1)],cNe=Math.sqrt(3),die=[null];function kTt(t){return die[0]=t,die}const bW=co(),Dp=W(),Kd=W(),Qd=W(),$x=new Pi,zTt=co(),S1=co(),wW=co(),xW=co(),ON=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],K3=new Pi,o1e=[0,0,0,0,0,0,0,0],_m=hie;var b2;(function(t){t[t.ASYNC=0]="ASYNC",t[t.SYNC=1]="SYNC"})(b2||(b2={}));let uNe=class extends Z9{get objects(){return this._objects}constructor(e,i,r=""){super(),this.stage=e,this.apiLayerUid=r,this.type=Ws.Layer,this.events=new Dn,this.visible=!0,this.pickable=!0,this.sliceable=!1,this._objects=new Pi,this._objectsAdded=new Pi,this._handles=new O_,this.apiLayerUid=r,this.visible=(i==null?void 0:i.visible)??!0,this.pickable=(i==null?void 0:i.pickable)??!0,this.updatePolicy=(i==null?void 0:i.updatePolicy)??b2.ASYNC,this._disableOctree=(i==null?void 0:i.disableOctree)??!1,e.add(this);for(const n of LTt)this._handles.add(this.events.on(n,s=>e.handleEvent(n,s)))}destroy(){this._handles.size&&(this._handles.destroy(),this.stage.remove(this),this.invalidateSpatialQueryAccelerator())}add(e){this._objects.push(e),e.parentLayer=this,this.events.emit("layerObjectAdded",{layer:this,object:e}),this._octree!=null&&this._objectsAdded.push(e)}remove(e){this._objects.removeUnordered(e)&&(e.parentLayer=null,this.events.emit("layerObjectRemoved",{layer:this,object:e}),this._octree!=null&&(this._objectsAdded.removeUnordered(e)||this._octree.remove([e])))}addMany(e){this._objects.pushArray(e);for(const i of e)i.parentLayer=this;this.events.emit("layerObjectsAdded",{layer:this,objects:e}),this._octree!=null&&this._objectsAdded.pushArray(e)}removeMany(e){const i=new Array;if(this._objects.removeUnorderedMany(e,e.length,i),i.length!==0){for(const r of i)r.parentLayer=null;if(this.events.emit("layerObjectsRemoved",{layer:this,objects:i}),this._octree!=null){for(let r=0;r50&&!this._disableOctree?(this._octree=new _m(e=>e.boundingVolumeWorldSpace.bounds),this._octree.add(this._objects.data,this._objects.length)):this._octree!=null&&this._objectsAdded.length>0&&(this._octree.add(this._objectsAdded.data,this._objectsAdded.length),this._objectsAdded.clear()),this._octree}invalidateSpatialQueryAccelerator(){this._octree=et(this._octree),this._objectsAdded.clear()}};function WU(t){return t!=null&&t.type===Ws.Layer}var _p,eE;(function(t){t[t.Draped=0]="Draped",t[t.Screen=1]="Screen",t[t.World=2]="World",t[t.COUNT=3]="COUNT"})(_p||(_p={})),function(t){t[t.Center=0]="Center",t[t.Tip=1]="Tip",t[t.COUNT=2]="COUNT"}(eE||(eE={}));let Na=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.transparencyPassType=Jt.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.writeDepth=!1,this.space=_p.Screen,this.hideOnShortSegments=!1,this.hasCap=!1,this.anchor=eE.Center,this.hasTip=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1}get draped(){return this.space===_p.Draped}};y([fe({count:ue.COUNT})],Na.prototype,"output",void 0),y([fe({count:Jt.COUNT})],Na.prototype,"transparencyPassType",void 0),y([fe()],Na.prototype,"occluder",void 0),y([fe()],Na.prototype,"hasSlicePlane",void 0),y([fe()],Na.prototype,"writeDepth",void 0),y([fe({count:_p.COUNT})],Na.prototype,"space",void 0),y([fe()],Na.prototype,"hideOnShortSegments",void 0),y([fe()],Na.prototype,"hasCap",void 0),y([fe({count:eE.COUNT})],Na.prototype,"anchor",void 0),y([fe()],Na.prototype,"hasTip",void 0),y([fe()],Na.prototype,"vvSize",void 0),y([fe()],Na.prototype,"vvColor",void 0),y([fe()],Na.prototype,"vvOpacity",void 0),y([fe()],Na.prototype,"hasOccludees",void 0),y([fe()],Na.prototype,"multipassEnabled",void 0),y([fe()],Na.prototype,"cullAboveGround",void 0),y([fe({constValue:!1})],Na.prototype,"occlusionPass",void 0),y([fe({constValue:!0})],Na.prototype,"hasVvInstancing",void 0),y([fe({constValue:!0})],Na.prototype,"hasSliceTranslatedView",void 0);const a1e=8;function hNe(t,e){const i=t.vertex;i.uniforms.add(new ft("intrinsicWidth",r=>r.width)),e.vvSize?(t.attributes.add(J.SIZEFEATUREATTRIBUTE,"float"),i.uniforms.add(new Oi("vvSizeMinSize",r=>r.vvSize.minSize),new Oi("vvSizeMaxSize",r=>r.vvSize.maxSize),new Oi("vvSizeOffset",r=>r.vvSize.offset),new Oi("vvSizeFactor",r=>r.vvSize.factor)),i.code.add(V`float getSize() { +return intrinsicWidth * clamp(vvSizeOffset + sizeFeatureAttribute * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).x; +}`)):(t.attributes.add(J.SIZE,"float"),i.code.add(V`float getSize(){ +return intrinsicWidth * size; +}`)),e.vvOpacity?(t.attributes.add(J.OPACITYFEATUREATTRIBUTE,"float"),i.constants.add("vvOpacityNumber","int",8),i.uniforms.add(new Hu("vvOpacityValues",r=>r.vvOpacity.values,a1e),new Hu("vvOpacityOpacities",r=>r.vvOpacity.opacityValues,a1e)),i.code.add(V`float interpolateOpacity( float value ){ +if (value <= vvOpacityValues[0]) { +return vvOpacityOpacities[0]; +} +for (int i = 1; i < vvOpacityNumber; ++i) { +if (vvOpacityValues[i] >= value) { +float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]); +return mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f); +} +} +return vvOpacityOpacities[vvOpacityNumber - 1]; +} +vec4 applyOpacity( vec4 color ){ +return vec4(color.xyz, interpolateOpacity(opacityFeatureAttribute)); +}`)):i.code.add(V`vec4 applyOpacity( vec4 color ){ +return color; +}`),e.vvColor?(t.include(e_,e),t.attributes.add(J.COLORFEATUREATTRIBUTE,"float"),i.code.add(V`vec4 getColor(){ +return applyOpacity(interpolateVVColor(colorFeatureAttribute)); +}`)):(t.attributes.add(J.COLOR,"vec4"),i.code.add(V`vec4 getColor(){ +return applyOpacity(color); +}`))}function BL(t,e,i=0){const r=Je(t,0,BTt);for(let n=0;n<4;n++)e[i+n]=Math.floor(256*jTt(r*UTt[n]))}function jle(t,e=0){let i=0;for(let r=0;r<4;r++)i+=t[e+r]*VTt[r];return i}const UTt=[1,256,65536,16777216],VTt=[1/256,1/65536,1/16777216,1/4294967296],BTt=jle(new Uint8ClampedArray([255,255,255,255]));function jTt(t){return t-Math.floor(t)}let dNe=class{constructor(e,i,r){this._createTexture=e,this._parametersKey=i,this._repository=new Map,this._orphanCache=r.newCache(`procedural-texture-repository:${hp()}`,n=>n.dispose())}destroy(){for(const[e,{texture:i}]of this._repository)i.dispose();this._repository.clear(),this._orphanCache.destroy()}swap(e,i=null){const r=this._acquire(e);return this.release(i),r}release(e){if(e==null)return;const i=this._parametersKey(e),r=this._repository.get(i);if(r&&(r.refCount--,r.refCount===0)){this._repository.delete(i);const{texture:n}=r,s=n.gpuMemoryUsage;this._orphanCache.put(i,n,s)}}_acquire(e){if(e==null)return null;const i=this._parametersKey(e),r=this._repository.get(i);if(r)return r.refCount++,r.texture;const n=this._orphanCache.pop(i)??this._createTexture(e),s=new GTt(n);return this._repository.set(i,s),n}},GTt=class{constructor(e){this.texture=e,this.refCount=1}};function HTt(t,e){return new dNe(i=>{const{encodedData:r,textureSize:n}=qTt(i),s=new tn;return s.internalFormat=ci.RGBA,s.width=n,s.height=1,s.wrapMode=Bi.REPEAT,new Ai(t,s,r)},i=>`${i.pattern.join(",")}-r${i.pixelRatio}`,e)}function qTt(t){const e=Gle(t),i=1/t.pixelRatio,r=pNe(t),n=fNe(t),s=(Math.floor(.5*(n-1))+.5)*i,o=[];let l=1;for(const T of e){for(let A=0;AMath.round(e*t.pixelRatio))}function pNe(t){if(t==null)return 1;const e=Gle(t);return Math.floor(e.reduce((i,r)=>i+r))}function fNe(t){return Gle(t).reduce((e,i)=>Math.max(e,i))}function WTt(t){return t==null?gp:t.length===4?t:rs(YTt,t[0],t[1],t[2],1)}const YTt=Xi();function XTt(t,e){t.constants.add("stippleAlphaColorDiscard","float",.001),t.constants.add("stippleAlphaHighlightDiscard","float",.5),e.stippleEnabled?ZTt(t,e):JTt(t)}function ZTt(t,e){const i=!(e.draped&&e.stipplePreferContinuous),{vertex:r,fragment:n}=t;n.include(o0),e.draped||(Nm(r,e),r.uniforms.add(new ft("worldToScreenPerDistanceRatio",(s,o)=>1/o.camera.perScreenPixelRatio)),r.code.add(V`float computeWorldToScreenRatio(vec3 segmentCenter) { +float segmentDistanceToCamera = length(segmentCenter - cameraPosition); +return worldToScreenPerDistanceRatio / segmentDistanceToCamera; +}`)),t.varyings.add("vStippleDistance","float"),t.varyings.add("vStippleDistanceLimits","vec2"),t.varyings.add("vStipplePatternStretch","float"),r.code.add(V` + float discretizeWorldToScreenRatio(float worldToScreenRatio) { + float step = ${QTt}; + + float discreteWorldToScreenRatio = log(worldToScreenRatio); + discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step; + discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio); + return discreteWorldToScreenRatio; + } + `),r.code.add(V`vec2 computeStippleDistanceLimits(float startPseudoScreen, float segmentLengthPseudoScreen, float segmentLengthScreen, float patternLength) {`),r.code.add(V` + if (segmentLengthPseudoScreen >= ${i?"patternLength":"1e4"}) { + `),bP(r),r.code.add(V`float repetitions = segmentLengthScreen / (patternLength * pixelRatio); +float flooredRepetitions = max(1.0, floor(repetitions + 0.5)); +float segmentLengthScreenRounded = flooredRepetitions * patternLength; +float stretch = repetitions / flooredRepetitions; +vStipplePatternStretch = max(0.75, stretch); +return vec2(0.0, segmentLengthScreenRounded); +} +return vec2(startPseudoScreen, startPseudoScreen + segmentLengthPseudoScreen); +}`),n.uniforms.add(new Zt("stipplePatternTexture",s=>s.stippleTexture),new ft("stipplePatternSDFNormalizer",s=>KTt(s.stipplePattern)),new ft("stipplePatternPixelSizeInv",s=>1/mNe(s))),n.code.add(V`float getStippleSDF(out bool isClamped) { +float stippleDistanceClamped = clamp(vStippleDistance, vStippleDistanceLimits.x, vStippleDistanceLimits.y); +vec2 aaCorrectedLimits = vStippleDistanceLimits + vec2(1.0, -1.0) / gl_FragCoord.w; +isClamped = vStippleDistance < aaCorrectedLimits.x || vStippleDistance > aaCorrectedLimits.y; +float u = stippleDistanceClamped * gl_FragCoord.w * stipplePatternPixelSizeInv * vLineSizeInv; +u = fract(u); +float encodedSDF = rgba2float(texture(stipplePatternTexture, vec2(u, 0.5))); +float sdf = (encodedSDF * 2.0 - 1.0) * stipplePatternSDFNormalizer; +return (sdf - 0.5) * vStipplePatternStretch + 0.5; +} +float getStippleSDF() { +bool ignored; +return getStippleSDF(ignored); +} +float getStippleAlpha() { +bool isClamped; +float stippleSDF = getStippleSDF(isClamped); +float antiAliasedResult = clamp(stippleSDF * vLineWidth + 0.5, 0.0, 1.0); +return isClamped ? floor(antiAliasedResult + 0.5) : antiAliasedResult; +}`),e.stippleOffColorEnabled?(n.uniforms.add(new gr("stippleOffColor",s=>WTt(s.stippleOffColor))),n.code.add(V`#define discardByStippleAlpha(stippleAlpha, threshold) {} +#define blendStipple(color, stippleAlpha) mix(color, stippleOffColor, stippleAlpha)`)):n.code.add(V`#define discardByStippleAlpha(stippleAlpha, threshold) if (stippleAlpha < threshold) { discard; } +#define blendStipple(color, stippleAlpha) vec4(color.rgb, color.a * stippleAlpha)`)}function JTt(t){t.fragment.code.add(V`float getStippleAlpha() { return 1.0; } +#define discardByStippleAlpha(_stippleAlpha_, _threshold_) {} +#define blendStipple(color, _stippleAlpha_) color`)}function KTt(t){return t?(Math.floor(.5*(fNe(t)-1))+.5)/t.pixelRatio:1}function mNe(t){const e=t.stipplePattern;return e?pNe(t.stipplePattern)/e.pixelRatio:1}const QTt=V.float(.4);async function C_(t,e){const{data:i}=await bi(t,{responseType:"image",...e});return i}function eEt(){if(SW==null){const t=e=>Wr(`esri/libs/basisu/${e}`);SW=we(()=>import("./basis_transcoder-FsrOzl2Q.js"),__vite__mapDeps([])).then(e=>e.b).then(({default:e})=>e({locateFile:t}).then(i=>(i.initializeBasis(),delete i.then,i)))}return SW}let SW;var LS;(function(t){t[t.ETC1_RGB=0]="ETC1_RGB",t[t.ETC2_RGBA=1]="ETC2_RGBA",t[t.BC1_RGB=2]="BC1_RGB",t[t.BC3_RGBA=3]="BC3_RGBA",t[t.BC4_R=4]="BC4_R",t[t.BC5_RG=5]="BC5_RG",t[t.BC7_M6_RGB=6]="BC7_M6_RGB",t[t.BC7_M5_RGBA=7]="BC7_M5_RGBA",t[t.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",t[t.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",t[t.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",t[t.ATC_RGB=11]="ATC_RGB",t[t.ATC_RGBA=12]="ATC_RGBA",t[t.FXT1_RGB=17]="FXT1_RGB",t[t.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",t[t.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",t[t.ETC2_EAC_R11=20]="ETC2_EAC_R11",t[t.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",t[t.RGBA32=13]="RGBA32",t[t.RGB565=14]="RGB565",t[t.BGR565=15]="BGR565",t[t.RGBA4444=16]="RGBA4444"})(LS||(LS={}));let Pm=null,PN=null;async function gNe(){return PN==null&&(PN=eEt(),Pm=await PN),PN}function tEt(t,e){if(Pm==null)return t.byteLength;const i=new Pm.BasisFile(new Uint8Array(t)),r=vNe(i)?yNe(i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),e):0;return i.close(),i.delete(),r}function iEt(t,e){if(Pm==null)return t.byteLength;const i=new Pm.KTX2File(new Uint8Array(t)),r=_Ne(i)?yNe(i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),e):0;return i.close(),i.delete(),r}function yNe(t,e,i,r,n){const s=gae(e?eo.COMPRESSED_RGBA8_ETC2_EAC:eo.COMPRESSED_RGB8_ETC2),o=n&&t>1?(4**t-1)/(3*4**(t-1)):1;return Math.ceil(i*r*s*o)}function vNe(t){return t.getNumImages()>=1&&!t.isUASTC()}function _Ne(t){return t.getFaces()>=1&&t.isETC1S()}async function rEt(t,e,i){Pm==null&&(Pm=await gNe());const r=new Pm.BasisFile(new Uint8Array(i));if(!vNe(r))return null;r.startTranscoding();const n=bNe(t,e,r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),(s,o)=>r.getImageTranscodedSizeInBytes(0,s,o),(s,o,l)=>r.transcodeImage(l,0,s,o,0,0));return r.close(),r.delete(),n}async function nEt(t,e,i){Pm==null&&(Pm=await gNe());const r=new Pm.KTX2File(new Uint8Array(i));if(!_Ne(r))return null;r.startTranscoding();const n=bNe(t,e,r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),(s,o)=>r.getImageTranscodedSizeInBytes(s,0,0,o),(s,o,l)=>r.transcodeImage(l,s,0,0,o,0,-1,-1));return r.close(),r.delete(),n}function bNe(t,e,i,r,n,s,o,l){const{compressedTextureETC:c,compressedTextureS3TC:f}=t.capabilities,[_,x]=c?r?[LS.ETC2_RGBA,eo.COMPRESSED_RGBA8_ETC2_EAC]:[LS.ETC1_RGB,eo.COMPRESSED_RGB8_ETC2]:f?r?[LS.BC3_RGBA,eo.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[LS.BC1_RGB,eo.COMPRESSED_RGB_S3TC_DXT1_EXT]:[LS.RGBA32,ci.RGBA],T=e.hasMipmap?i:Math.min(1,i),A=[];for(let M=0;M1,e.samplingMode=e.hasMipmap?ki.LINEAR_MIPMAP_LINEAR:ki.LINEAR,e.width=n,e.height=s,new Ai(t,e,{type:"compressed",levels:A})}const RN=Ce.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),sEt=542327876,oEt=131072,aEt=4;function Hle(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}function lEt(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)}const cEt=Hle("DXT1"),uEt=Hle("DXT3"),hEt=Hle("DXT5"),dEt=31,pEt=0,fEt=1,mEt=2,gEt=3,yEt=4,vEt=7,_Et=20,bEt=21;function wEt(t,e,i){const r=xEt(i,e.hasMipmap??!1);if(r==null)throw new Error("DDS texture data is null");const{textureData:n,internalFormat:s,width:o,height:l}=r;return e.samplingMode=n.levels.length>1?ki.LINEAR_MIPMAP_LINEAR:ki.LINEAR,e.hasMipmap=n.levels.length>1,e.internalFormat=s,e.width=o,e.height=l,new Ai(t,e,n)}function xEt(t,e){const i=new Int32Array(t,0,dEt);if(i[pEt]!==sEt)return RN.error("Invalid magic number in DDS header"),null;if(!(i[_Et]&aEt))return RN.error("Unsupported format, must contain a FourCC code"),null;const r=i[bEt];let n,s;switch(r){case cEt:n=8,s=eo.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case uEt:n=16,s=eo.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case hEt:n=16,s=eo.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return RN.error("Unsupported FourCC code:",lEt(r)),null}let o=1,l=i[yEt],c=i[gEt];!(3&l)&&!(3&c)||(RN.warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const f=l,_=c;let x,T;i[mEt]&oEt&&e!==!1&&(o=Math.max(1,i[vEt]));let A=i[fEt]+4;const M=[];for(let I=0;I>2)*(c+3>>2)*n,x=new Uint8Array(t,A,T),M.push(x),A+=T,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:M},internalFormat:s,width:f,height:_}}let OE=class extends Z9{get parameters(){return this._parameters}constructor(e,i){super(),this._data=e,this.type=Ws.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new Dn,this._parameters={...TEt,...i},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=i=>this._frameUpdate(e,i),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(E2(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const i=!e.paused;if(e.src=e.src,i&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){i1(e.src)||E2(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const i=new tn;return i.wrapMode=this._parameters.wrap??Bi.REPEAT,i.flipped=!this._parameters.noUnpackFlip,i.samplingMode=this._parameters.mipmap?ki.LINEAR_MIPMAP_LINEAR:ki.LINEAR,i.hasMipmap=!!this._parameters.mipmap,i.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,i.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),i}get glTexture(){return this._glTexture}get memoryEstimate(){var e;return((e=this._glTexture)==null?void 0:e.gpuMemoryUsage)||SEt(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const i=this._data;return i==null?(this._glTexture=new Ai(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof i=="string"?this._loadFromURL(e,i):i instanceof Image?this._loadFromImageElement(e,i):i instanceof HTMLVideoElement?this._loadFromVideoElement(e,i):i instanceof ImageData||i instanceof HTMLCanvasElement?this._loadFromImage(e,i):(XR(i)||Zw(i))&&this._parameters.encoding===Jv.DDS_ENCODING?this._loadFromDDSData(e,i):(XR(i)||Zw(i))&&this._parameters.encoding===Jv.KTX2_ENCODING?this._loadFromKTX2(e,i):(XR(i)||Zw(i))&&this._parameters.encoding===Jv.BASIS_ENCODING?this._loadFromBasis(e,i):Zw(i)?this._loadFromPixelData(e,i):XR(i)?this._loadFromPixelData(e,new Uint8Array(i)):null)}_frameUpdate(e,i){return this._glTexture==null||e.readyStatenEt(e,this._createDescriptor(e),i).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,i){return this._loadAsync(()=>rEt(e,this._createDescriptor(e),i).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,i){Xt(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?ci.LUMINANCE:this._parameters.components===3?ci.RGB:ci.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new Ai(e,r,i),this._glTexture}_loadFromURL(e,i){return this._loadAsync(async r=>{const n=await C_(i,{signal:r});return St(r),this._loadFromImage(e,n)})}_loadFromImageElement(e,i){return i.complete?this._loadFromImage(e,i):this._loadAsync(async r=>{const n=await xEe(i,i.src,!1,r);return St(r),this._loadFromImage(e,n)})}_loadFromVideoElement(e,i){return i.readyState>=C$.HAVE_CURRENT_DATA?this._loadFromImage(e,i):this._loadFromVideoElementAsync(e,i)}_loadFromVideoElementAsync(e,i){return this._loadAsync(r=>new Promise((n,s)=>{const o=()=>{i.removeEventListener("loadeddata",l),i.removeEventListener("error",c),en(f)},l=()=>{i.readyState>=C$.HAVE_CURRENT_DATA&&(o(),n(this._loadFromImage(e,i)))},c=_=>{o(),s(_||new se("Failed to load video"))};i.addEventListener("loadeddata",l),i.addEventListener("error",c);const f=Yl(r,()=>c(ur()))}))}_loadFromImage(e,i){let r=i;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:o}=e.parameters;r=this._parameters.downsampleUncompressed?Tyt(r,o):Eyt(r,o)}const n=wNe(r);this._parameters.width=n.width,this._parameters.height=n.height;const s=this._createDescriptor(e);return s.pixelFormat=this._parameters.components===3?ci.RGB:ci.RGBA,s.width=n.width,s.height=n.height,this._glTexture=new Ai(e,s,r),this._glTexture}_loadAsync(e){const i=new AbortController;this._loadingController=i;const r=e(i.signal);this._loadingPromise=r;const n=()=>{this._loadingController===i&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(n,n),r}unload(){if(this._glTexture=Kt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function SEt(t,e){if(t==null)return 0;if(XR(t)||Zw(t))return e.encoding===Jv.KTX2_ENCODING?iEt(t,!!e.mipmap):e.encoding===Jv.BASIS_ENCODING?tEt(t,!!e.mipmap):t.byteLength;const{width:i,height:r}=t instanceof Image||t instanceof ImageData||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement?wNe(t):e;return(e.mipmap?4/3:1)*i*r*(e.components||4)||0}function wNe(t){return t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t}var C$;(function(t){t[t.HAVE_NOTHING=0]="HAVE_NOTHING",t[t.HAVE_METADATA=1]="HAVE_METADATA",t[t.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",t[t.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",t[t.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(C$||(C$={}));const TEt={wrap:{s:Bi.REPEAT,t:Bi.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1},YU=128,qle=.5;function EEt(t){return t==="cross"||t==="x"}function CEt(t,e=YU,i=e*qle,r=0){const n=xNe(t,e,i,r);return new OE(n,{mipmap:!1,wrap:{s:Bi.CLAMP_TO_EDGE,t:Bi.CLAMP_TO_EDGE},width:e,height:e,components:4,noUnpackFlip:!0,reloadable:!0})}function xNe(t,e=YU,i=e*qle,r=0){switch(t){case"circle":default:return AEt(e,i);case"square":return MEt(e,i);case"cross":return PEt(e,i,r);case"x":return REt(e,i,r);case"kite":return OEt(e,i);case"triangle":return IEt(e,i);case"arrow":return $Et(e,i)}}function AEt(t,e){const i=t/2-.5;return u6(t,ENe(i,i,e/2))}function MEt(t,e){return SNe(t,e,!1)}function OEt(t,e){return SNe(t,e,!0)}function PEt(t,e,i=0){return TNe(t,e,!1,i)}function REt(t,e,i=0){return TNe(t,e,!0,i)}function IEt(t,e){return u6(t,CNe(t/2,e,e/2))}function $Et(t,e){const i=e,r=e/2,n=t/2,s=.8*i,o=ENe(n,(t-e)/2-s,Math.sqrt(s*s+r*r)),l=CNe(n,i,r);return u6(t,(c,f)=>Math.max(l(c,f),-o(c,f)))}function SNe(t,e,i){return i&&(e/=Math.SQRT2),u6(t,(r,n)=>{let s=r-.5*t+.25,o=.5*t-n-.75;if(i){const l=(s+o)/Math.SQRT2;o=(o-s)/Math.SQRT2,s=l}return Math.max(Math.abs(s),Math.abs(o))-.5*e})}function TNe(t,e,i,r=0){e-=r,i&&(e*=Math.SQRT2);const n=.5*e;return u6(t,(s,o)=>{let l,c=s-.5*t,f=.5*t-o-1;if(i){const _=(c+f)/Math.SQRT2;f=(f-c)/Math.SQRT2,c=_}return c=Math.abs(c),f=Math.abs(f),l=c>f?c>n?Math.sqrt((c-n)*(c-n)+f*f):f:f>n?Math.sqrt(c*c+(f-n)*(f-n)):c,l-=r/2,l})}function ENe(t,e,i){return(r,n)=>{const s=r-t,o=n-e;return Math.sqrt(s*s+o*o)-i}}function CNe(t,e,i){const r=Math.sqrt(e*e+i*i);return(n,s)=>{const o=Math.abs(n-t)-i,l=s-t+e/2+.75,c=(e*o+i*l)/r,f=-l;return Math.max(c,f)}}function u6(t,e){const i=new Uint8Array(4*t*t);for(let r=0;rs.camera.perRenderPixelRatio)),i.code.add(V`bool areWorldMarkersHidden(vec4 pos, vec4 other) { +vec3 midPoint = mix(pos.xyz, other.xyz, 0.5); +float distanceToCamera = length(midPoint); +float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5; +float worldMarkerSize = getScreenMarkerSize() * screenToWorldRatio; +float segmentLen = length(pos.xyz - other.xyz); +return worldMarkerSize > maxSegmentLengthFraction * segmentLen; +} +float getWorldMarkerSize(vec4 pos) { +float distanceToCamera = length(pos.xyz); +float screenToWorldRatio = perRenderPixelRatio * distanceToCamera * 0.5; +return getScreenMarkerSize() * screenToWorldRatio; +}`))}var Df;(function(t){t[t.BUTT=0]="BUTT",t[t.SQUARE=1]="SQUARE",t[t.ROUND=2]="ROUND",t[t.COUNT=3]="COUNT"})(Df||(Df={}));let Ns=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.capType=Df.BUTT,this.transparencyPassType=Jt.NONE,this.occluder=!1,this.hasSlicePlane=!1,this.hasPolygonOffset=!1,this.writeDepth=!1,this.draped=!1,this.stippleEnabled=!1,this.stippleOffColorEnabled=!1,this.stipplePreferContinuous=!0,this.roundJoins=!1,this.applyMarkerOffset=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.falloffEnabled=!1,this.innerColorEnabled=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.wireframe=!1,this.objectAndLayerIdColorInstanced=!1}};y([fe({count:ue.COUNT})],Ns.prototype,"output",void 0),y([fe({count:Df.COUNT})],Ns.prototype,"capType",void 0),y([fe({count:Jt.COUNT})],Ns.prototype,"transparencyPassType",void 0),y([fe()],Ns.prototype,"occluder",void 0),y([fe()],Ns.prototype,"hasSlicePlane",void 0),y([fe()],Ns.prototype,"hasPolygonOffset",void 0),y([fe()],Ns.prototype,"writeDepth",void 0),y([fe()],Ns.prototype,"draped",void 0),y([fe()],Ns.prototype,"stippleEnabled",void 0),y([fe()],Ns.prototype,"stippleOffColorEnabled",void 0),y([fe()],Ns.prototype,"stipplePreferContinuous",void 0),y([fe()],Ns.prototype,"roundJoins",void 0),y([fe()],Ns.prototype,"applyMarkerOffset",void 0),y([fe()],Ns.prototype,"vvSize",void 0),y([fe()],Ns.prototype,"vvColor",void 0),y([fe()],Ns.prototype,"vvOpacity",void 0),y([fe()],Ns.prototype,"falloffEnabled",void 0),y([fe()],Ns.prototype,"innerColorEnabled",void 0),y([fe()],Ns.prototype,"hasOccludees",void 0),y([fe()],Ns.prototype,"multipassEnabled",void 0),y([fe()],Ns.prototype,"cullAboveGround",void 0),y([fe()],Ns.prototype,"wireframe",void 0),y([fe()],Ns.prototype,"objectAndLayerIdColorInstanced",void 0),y([fe({constValue:!1})],Ns.prototype,"occlusionPass",void 0),y([fe({constValue:!0})],Ns.prototype,"hasVvInstancing",void 0),y([fe({constValue:!0})],Ns.prototype,"hasSliceTranslatedView",void 0);const jL=1;function ONe(t){const e=new Cr,{vertex:i,fragment:r}=e,n=t.multipassEnabled&&(t.output===ue.Color||t.output===ue.Alpha);e.include(q9),e.include(hNe,t),e.include(XTt,t);const s=t.applyMarkerOffset&&!t.draped;s&&(i.uniforms.add(new ft("markerScale",A=>A.markerScale)),e.include(MNe,{space:_p.World,draped:!1})),t.output===ue.Depth&&e.include(E_,t),e.include(e6,t),Kh(i,t),i.uniforms.add(new _s("inverseProjectionMatrix",(A,M)=>M.camera.inverseProjectionMatrix),new ln("nearFar",(A,M)=>M.camera.nearFar),new ft("miterLimit",A=>A.join!=="miter"?0:A.miterLimit),new gr("viewport",(A,M)=>M.camera.fullViewport)),i.constants.add("LARGE_HALF_FLOAT","float",65500),e.attributes.add(J.POSITION,"vec3"),e.attributes.add(J.SUBDIVISIONFACTOR,"float"),e.attributes.add(J.UV0,"vec2"),e.attributes.add(J.AUXPOS1,"vec3"),e.attributes.add(J.AUXPOS2,"vec3"),e.varyings.add("vColor","vec4"),e.varyings.add("vpos","vec3"),B2(e),n&&e.varyings.add("depth","float");const o=t.stippleEnabled;o&&e.varyings.add("vLineSizeInv","float");const l=t.capType===Df.ROUND,c=o||l;c&&e.varyings.add("vLineWidth","float");const f=t.innerColorEnabled||l;f&&e.varyings.add("vLineDistance","float");const _=t.stippleEnabled&&l,x=t.falloffEnabled||_;x&&e.varyings.add("vLineDistanceNorm","float"),l&&(e.varyings.add("vSegmentSDF","float"),e.varyings.add("vReverseSegmentSDF","float")),i.code.add(V`#define PERPENDICULAR(v) vec2(v.y, -v.x); +float interp(float ncp, vec4 a, vec4 b) { +return (-ncp - a.z) / (b.z - a.z); +} +vec2 rotate(vec2 v, float a) { +float s = sin(a); +float c = cos(a); +mat2 m = mat2(c, -s, s, c); +return m * v; +}`),i.code.add(V`vec4 projectAndScale(vec4 pos) { +vec4 posNdc = proj * pos; +posNdc.xy *= viewport.zw / posNdc.w; +return posNdc; +}`),Rj(e),i.code.add(V` + void clipAndTransform(inout vec4 pos, inout vec4 prev, inout vec4 next, in bool isStartVertex) { + float vnp = nearFar[0] * 0.99; + + if(pos.z > -nearFar[0]) { + //current pos behind ncp --> we need to clip + if (!isStartVertex) { + if(prev.z < -nearFar[0]) { + //previous in front of ncp + pos = mix(prev, pos, interp(vnp, prev, pos)); + next = pos; + } else { + pos = vec4(0.0, 0.0, 0.0, 1.0); + } + } else { + if(next.z < -nearFar[0]) { + //next in front of ncp + pos = mix(pos, next, interp(vnp, pos, next)); + prev = pos; + } else { + pos = vec4(0.0, 0.0, 0.0, 1.0); + } + } + } else { + //current position visible + if (prev.z > -nearFar[0]) { + //previous behind ncp + prev = mix(pos, prev, interp(vnp, pos, prev)); + } + if (next.z > -nearFar[0]) { + //next behind ncp + next = mix(next, pos, interp(vnp, next, pos)); + } + } + + ${n?"depth = pos.z;":""} + linearDepth = calculateLinearDepth(nearFar,pos.z); + + pos = projectAndScale(pos); + next = projectAndScale(next); + prev = projectAndScale(prev); + } + `),bP(i),i.code.add(V` + void main(void) { + // unpack values from uv0.y + bool isStartVertex = abs(abs(uv0.y)-3.0) == 1.0; + + float coverage = 1.0; + + // Check for special value of uv0.y which is used by the Renderer when graphics + // are removed before the VBO is recompacted. If this is the case, then we just + // project outside of clip space. + if (uv0.y == 0.0) { + // Project out of clip space + gl_Position = vec4(1e038, 1e038, 1e038, 1.0); + } + else { + bool isJoin = abs(uv0.y) < 3.0; + + float lineSize = getSize(); + float lineWidth = lineSize * pixelRatio; + + ${c?V`vLineWidth = lineWidth;`:""} + ${o?V`vLineSizeInv = 1.0 / lineSize;`:""} + + // convert sub-pixel coverage to alpha + if (lineWidth < 1.0) { + coverage = lineWidth; + lineWidth = 1.0; + }else{ + // Ribbon lines cannot properly render non-integer sizes. Round width to integer size if + // larger than one for better quality. Note that we do render < 1 pixels more or less correctly + // so we only really care to round anything larger than 1. + lineWidth = floor(lineWidth + 0.5); + } + + vec4 pos = view * vec4(position.xyz, 1.0); + vec4 prev = view * vec4(auxpos1.xyz, 1.0); + vec4 next = view * vec4(auxpos2.xyz, 1.0); + `),s&&i.code.add(V`vec4 other = isStartVertex ? next : prev; +bool markersHidden = areWorldMarkersHidden(pos, other); +if(!isJoin && !markersHidden) { +pos.xyz += normalize(other.xyz - pos.xyz) * getWorldMarkerSize(pos) * 0.5; +}`),i.code.add(V`clipAndTransform(pos, prev, next, isStartVertex); +vec2 left = (pos.xy - prev.xy); +vec2 right = (next.xy - pos.xy); +float leftLen = length(left); +float rightLen = length(right);`),(t.stippleEnabled||l)&&i.code.add(V` + float isEndVertex = float(!isStartVertex); + vec2 segmentOrigin = mix(pos.xy, prev.xy, isEndVertex); + vec2 segment = mix(right, left, isEndVertex); + ${l?V`vec2 segmentEnd = mix(next.xy, pos.xy, isEndVertex);`:""} + `),i.code.add(V`left = (leftLen > 0.001) ? left/leftLen : vec2(0.0, 0.0); +right = (rightLen > 0.001) ? right/rightLen : vec2(0.0, 0.0); +vec2 capDisplacementDir = vec2(0, 0); +vec2 joinDisplacementDir = vec2(0, 0); +float displacementLen = lineWidth; +if (isJoin) { +bool isOutside = (left.x * right.y - left.y * right.x) * uv0.y > 0.0; +joinDisplacementDir = normalize(left + right); +joinDisplacementDir = PERPENDICULAR(joinDisplacementDir); +if (leftLen > 0.001 && rightLen > 0.001) { +float nDotSeg = dot(joinDisplacementDir, left); +displacementLen /= length(nDotSeg * left - joinDisplacementDir); +if (!isOutside) { +displacementLen = min(displacementLen, min(leftLen, rightLen)/abs(nDotSeg)); +} +} +if (isOutside && (displacementLen > miterLimit * lineWidth)) {`),t.roundJoins?i.code.add(V` + vec2 startDir = leftLen < 0.001 ? right : left; + startDir = PERPENDICULAR(startDir); + + vec2 endDir = rightLen < 0.001 ? left : right; + endDir = PERPENDICULAR(endDir); + + float factor = ${t.stippleEnabled?V`min(1.0, subdivisionFactor * ${V.float((jL+2)/(jL+1))})`:V`subdivisionFactor`}; + + float rotationAngle = acos(clamp(dot(startDir, endDir), -1.0, 1.0)); + joinDisplacementDir = rotate(startDir, -sign(uv0.y) * factor * rotationAngle); + `):i.code.add(V`if (leftLen < 0.001) { +joinDisplacementDir = right; +} +else if (rightLen < 0.001) { +joinDisplacementDir = left; +} +else { +joinDisplacementDir = (isStartVertex || subdivisionFactor > 0.0) ? right : left; +} +joinDisplacementDir = PERPENDICULAR(joinDisplacementDir);`);const T=t.capType!==Df.BUTT;return i.code.add(V` + displacementLen = lineWidth; + } + } else { + // CAP handling --------------------------------------------------- + joinDisplacementDir = isStartVertex ? right : left; + joinDisplacementDir = PERPENDICULAR(joinDisplacementDir); + + ${T?V`capDisplacementDir = isStartVertex ? -right : left;`:""} + } + `),i.code.add(V` + // Displacement (in pixels) caused by join/or cap + vec2 dpos = joinDisplacementDir * sign(uv0.y) * displacementLen + capDisplacementDir * displacementLen; + + ${x||f?V`float lineDistNorm = sign(uv0.y) * pos.w;`:""} + + ${f?V`vLineDistance = lineWidth * lineDistNorm;`:""} + ${x?V`vLineDistanceNorm = lineDistNorm;`:""} + + pos.xy += dpos; + `),l&&i.code.add(V`vec2 segmentDir = normalize(segment); +vSegmentSDF = (isJoin && isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentOrigin, segmentDir) * pos.w) ; +vReverseSegmentSDF = (isJoin && !isStartVertex) ? LARGE_HALF_FLOAT : (dot(pos.xy - segmentEnd, -segmentDir) * pos.w);`),t.stippleEnabled&&(t.draped?i.uniforms.add(new ft("worldToScreenRatio",(A,M)=>1/M.screenToPCSRatio)):i.code.add(V`vec3 segmentCenter = mix((auxpos2 + position) * 0.5, (position + auxpos1) * 0.5, isEndVertex); +float worldToScreenRatio = computeWorldToScreenRatio(segmentCenter);`),i.code.add(V`float segmentLengthScreenDouble = length(segment); +float segmentLengthScreen = segmentLengthScreenDouble * 0.5; +float discreteWorldToScreenRatio = discretizeWorldToScreenRatio(worldToScreenRatio); +float segmentLengthRender = length(mix(auxpos2 - position, position - auxpos1, isEndVertex)); +vStipplePatternStretch = worldToScreenRatio / discreteWorldToScreenRatio;`),t.draped?i.code.add(V`float segmentLengthPseudoScreen = segmentLengthScreen / pixelRatio * discreteWorldToScreenRatio / worldToScreenRatio; +float startPseudoScreen = uv0.x * discreteWorldToScreenRatio - mix(0.0, segmentLengthPseudoScreen, isEndVertex);`):i.code.add(V`float startPseudoScreen = mix(uv0.x, uv0.x - segmentLengthRender, isEndVertex) * discreteWorldToScreenRatio; +float segmentLengthPseudoScreen = segmentLengthRender * discreteWorldToScreenRatio;`),i.uniforms.add(new ft("stipplePatternPixelSize",A=>mNe(A))),i.code.add(V`float patternLength = lineSize * stipplePatternPixelSize; +vStippleDistanceLimits = computeStippleDistanceLimits(startPseudoScreen, segmentLengthPseudoScreen, segmentLengthScreen, patternLength); +vStippleDistance = mix(vStippleDistanceLimits.x, vStippleDistanceLimits.y, isEndVertex); +if (segmentLengthScreenDouble >= 0.001) { +vec2 stippleDisplacement = pos.xy - segmentOrigin; +float stippleDisplacementFactor = dot(segment, stippleDisplacement) / (segmentLengthScreenDouble * segmentLengthScreenDouble); +vStippleDistance += (stippleDisplacementFactor - isEndVertex) * (vStippleDistanceLimits.y - vStippleDistanceLimits.x); +} +vStippleDistanceLimits *= pos.w; +vStippleDistance *= pos.w; +vStippleDistanceLimits = isJoin ? +vStippleDistanceLimits : +isStartVertex ? +vec2(-1e34, vStippleDistanceLimits.y) : +vec2(vStippleDistanceLimits.x, 1e34);`)),i.code.add(V` + // Convert back into NDC + pos.xy = (pos.xy / viewport.zw) * pos.w; + + vColor = getColor(); + vColor.a *= coverage; + + ${t.wireframe&&!t.draped?"pos.z -= 0.001 * pos.w;":""} + + // transform final position to camera space for slicing + vpos = (inverseProjectionMatrix * pos).xyz; + gl_Position = pos; + forwardObjectAndLayerIdColor(); + } + } + `),n&&e.include(dd,t),e.include(oo,t),r.include(h1),r.code.add(V` + void main() { + discardBySlice(vpos); + ${n?"terrainDepthTest(depth);":""} + `),t.wireframe?r.code.add(V`vec4 finalColor = vec4(1.0, 0.0, 1.0, 1.0);`):(l&&r.code.add(V` + float sdf = min(vSegmentSDF, vReverseSegmentSDF); + vec2 fragmentPosition = vec2( + min(sdf, 0.0), + vLineDistance + ) * gl_FragCoord.w; + + float fragmentRadius = length(fragmentPosition); + float fragmentCapSDF = (fragmentRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale + float capCoverage = clamp(0.5 - fragmentCapSDF, 0.0, 1.0); + + if (capCoverage < ${V.float(Cl)}) { + discard; + } + `),_?r.code.add(V` + vec2 stipplePosition = vec2( + min(getStippleSDF() * 2.0 - 1.0, 0.0), + vLineDistanceNorm * gl_FragCoord.w + ); + float stippleRadius = length(stipplePosition * vLineWidth); + float stippleCapSDF = (stippleRadius - vLineWidth) * 0.5; // Divide by 2 to transform from double pixel scale + float stippleCoverage = clamp(0.5 - stippleCapSDF, 0.0, 1.0); + float stippleAlpha = step(${V.float(Cl)}, stippleCoverage); + `):r.code.add(V`float stippleAlpha = getStippleAlpha();`),t.output!==ue.ObjectAndLayerIdColor&&r.code.add(V`discardByStippleAlpha(stippleAlpha, stippleAlphaColorDiscard);`),r.uniforms.add(new gr("intrinsicColor",A=>A.color)),r.code.add(V`vec4 color = intrinsicColor * vColor;`),t.innerColorEnabled&&(r.uniforms.add(new gr("innerColor",A=>A.innerColor??A.color),new ft("innerWidth",(A,M)=>A.innerWidth*M.camera.pixelRatio)),r.code.add(V`float distToInner = abs(vLineDistance * gl_FragCoord.w) - innerWidth; +float innerAA = clamp(0.5 - distToInner, 0.0, 1.0); +float innerAlpha = innerColor.a + color.a * (1.0 - innerColor.a); +color = mix(color, vec4(innerColor.rgb, innerAlpha), innerAA);`)),r.code.add(V`vec4 finalColor = blendStipple(color, stippleAlpha);`),t.falloffEnabled&&(r.uniforms.add(new ft("falloff",A=>A.falloff)),r.code.add(V`finalColor.a *= pow(max(0.0, 1.0 - abs(vLineDistanceNorm * gl_FragCoord.w)), falloff);`))),r.code.add(V` + ${t.output===ue.ObjectAndLayerIdColor?V`finalColor.a = 1.0;`:""} + + if (finalColor.a < ${V.float(Cl)}) { + discard; + } + + ${t.output===ue.Alpha?V`fragColor = vec4(finalColor.a);`:""} + ${t.output===ue.Color?V`fragColor = highlightSlice(finalColor, vpos);`:""} + ${t.output===ue.Color&&t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + ${t.output===ue.Highlight?V`fragColor = vec4(1.0);`:""} + ${t.output===ue.Depth?V`outputDepth(linearDepth);`:""} + ${t.output===ue.ObjectAndLayerIdColor?V`outputObjectAndLayerIdColor();`:""} + } + `),e}const FEt=Object.freeze(Object.defineProperty({__proto__:null,build:ONe,ribbonlineNumRoundJoinSubdivisions:jL},Symbol.toStringTag,{value:"Module"})),PNe=new Map([[J.POSITION,0],[J.SUBDIVISIONFACTOR,1],[J.UV0,2],[J.AUXPOS1,3],[J.AUXPOS2,4],[J.COLOR,5],[J.COLORFEATUREATTRIBUTE,5],[J.SIZE,6],[J.SIZEFEATUREATTRIBUTE,6],[J.OPACITYFEATUREATTRIBUTE,7],[J.OBJECTANDLAYERIDCOLOR,8]]);let RNe=class INe extends Hr{initializeProgram(e){return new Ir(e.rctx,INe.shader.get().build(this.configuration),PNe)}_makePipelineState(e,i){const r=this.configuration,n=e===Jt.NONE,s=e===Jt.FrontFace;return Ti({blending:r.output===ue.Color||r.output===ue.Alpha?n?vp:Y_(e):null,depthTest:{func:px(e)},depthWrite:n?r.writeDepth?rh:null:Kj(e),colorWrite:ji,stencilWrite:r.hasOccludees?Jy:null,stencilTest:r.hasOccludees?i?Z2:fx:null,polygonOffset:n||s?r.hasPolygonOffset?l1e:null:eG})}initializePipeline(){const e=this.configuration;if(e.occluder){const i=e.hasPolygonOffset?l1e:null;this._occluderPipelineTransparent=Ti({blending:vp,polygonOffset:i,depthTest:BU,depthWrite:null,colorWrite:ji,stencilWrite:null,stencilTest:Y6e}),this._occluderPipelineOpaque=Ti({blending:vp,polygonOffset:i,depthTest:BU,depthWrite:null,colorWrite:ji,stencilWrite:q6e,stencilTest:W6e}),this._occluderPipelineMaskWrite=Ti({blending:null,polygonOffset:i,depthTest:Cle,depthWrite:null,colorWrite:null,stencilWrite:Jy,stencilTest:Z2})}return this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)}get primitiveType(){return this.configuration.wireframe?sr.LINES:sr.TRIANGLE_STRIP}getPipeline(e,i,r){return e?this._occludeePipelineState:this.configuration.occluder?r?this._occluderPipelineTransparent:i?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipeline()}};RNe.shader=new Rr(FEt,()=>we(()=>Promise.resolve().then(()=>AWt),void 0));const l1e={factor:0,units:-4};var Ah;(function(t){t[t.LEFT_JOIN_START=-2]="LEFT_JOIN_START",t[t.LEFT_JOIN_END=-1]="LEFT_JOIN_END",t[t.LEFT_CAP_START=-4]="LEFT_CAP_START",t[t.LEFT_CAP_END=-5]="LEFT_CAP_END",t[t.RIGHT_JOIN_START=2]="RIGHT_JOIN_START",t[t.RIGHT_JOIN_END=1]="RIGHT_JOIN_END",t[t.RIGHT_CAP_START=4]="RIGHT_CAP_START",t[t.RIGHT_CAP_END=5]="RIGHT_CAP_END"})(Ah||(Ah={}));let zM=class extends hx{constructor(e){super(e,new zEt),this._configuration=new Ns,this._vertexAttributeLocations=PNe}getConfiguration(e,i){this._configuration.output=e,this._configuration.draped=i.slot===ke.DRAPED_MATERIAL;const r=this.parameters.stipplePattern!=null&&e!==ue.Highlight;return this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&this.parameters.stippleOffColor!=null,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.roundJoins=this.parameters.join==="round",this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=this.parameters.markerParameters!=null&&VEt(this.parameters.markerParameters),this._configuration.hasPolygonOffset=this.parameters.hasPolygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&this.parameters.innerColor!=null,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.occluder=this.parameters.renderOccluded===Wn.OccludeAndTransparentStencil,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.multipassEnabled=i.multipassEnabled,this._configuration.cullAboveGround=i.multipassTerrain.cullAboveGround,this._configuration.wireframe=this.parameters.wireframe,this._configuration}intersectDraped(e,i,r,n,s,o){if(!r.options.selectionMode)return;const l=e.attributes.get(J.POSITION).data,c=e.attributes.get(J.SIZE);let f=this.parameters.width;if(this.parameters.vvSize){const I=e.attributes.get(J.SIZEFEATUREATTRIBUTE).data[0];f*=Je(this.parameters.vvSize.offset[0]+I*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else c&&(f*=c.data[0]);const _=n[0],x=n[1],T=(f/2+4)*e.screenToWorldRatio;let A=Number.MAX_VALUE,M=0;for(let I=0;I0){je(ng,yu,vu);const j=_.frustum,H=-fn(j[Rn.NEAR],yu)/Ve(ng,j[Rn.NEAR]);De(ng,ng,H),Be(yu,yu,ng),_.projectToRenderScreen(yu,Dx)}else if(Dx[2]>0&&Nx[2]<0){je(ng,vu,yu);const j=_.frustum,H=-fn(j[Rn.NEAR],vu)/Ve(ng,j[Rn.NEAR]);De(ng,ng,H),Be(vu,vu,ng),_.projectToRenderScreen(vu,Nx)}else if(Dx[2]<0&&Nx[2]<0)continue;Dx[2]=0,Nx[2]=0;const U=Yoe(gT(Dx,Nx,h1e),x);Uhe=T[Se]:(de,ve,Se)=>he+=Sn(de,ve),be=Le("enable-feature:objectAndLayerId-rendering"),ye=(de,ve,Se,Ae,Pe,Ge,ut)=>{if(H[ne++]=ve[0],H[ne++]=ve[1],H[ne++]=ve[2],H[ne++]=Ae,H[ne++]=ut,H[ne++]=Pe,H[ne++]=de[0],H[ne++]=de[1],H[ne++]=de[2],H[ne++]=Se[0],H[ne++]=Se[1],H[ne++]=Se[2],H[ne++]=I?M:A,z)H[ne++]=F;else{const Ft=Math.min(4*Ge,L.length-4);H[ne++]=L[Ft],H[ne++]=L[Ft+1],H[ne++]=L[Ft+2],H[ne++]=L[Ft+3]}j&&(H[ne++]=U),be&&(k!=null&&(Y[4*ne]=k[0],Y[4*ne+1]=k[1],Y[4*ne+2]=k[2],Y[4*ne+3]=k[3]),ne++)};ne+=Q,Ie(l,f.data[0],f.data[1],f.data[2]),e&&bt(l,l,e);const pe=this._isClosed(r);if(pe){const de=f.data.length-3;Ie(o,f.data[de],f.data[de+1],f.data[de+2]),e&&bt(o,o,e)}else Ie(c,f.data[3],f.data[4],f.data[5]),e&&bt(c,c,e),ye(l,l,c,1,Ah.LEFT_CAP_START,0,0),ye(l,l,c,1,Ah.RIGHT_CAP_START,0,0),Ne(o,l),Ne(l,c);const Ee=pe?0:1,te=pe?x:x-1;for(let de=Ee;del=TW(o,f,s,l,n);for(let f=0;f2:!1}function VEt(t){return t.anchor===eE.Tip&&t.hideOnShortSegments&&t.placement==="begin-end"&&t.worldSpace}const yu=W(),vu=W(),ng=W(),Lx=W(),BEt=W(),Dx=Za(),Nx=Za(),c1e=W(),u1e=W(),h1e=jm(),jEt=jm(),GEt=W(),HEt=W(),qEt=W(),gR=[Za(),Za(),Za(),Za()],T1=[W(),W(),W(),W()],EW=Fi(),CW=Fi(),AW=Fi(),MW=Fi();let Yle=class{constructor(e){this._originSR=e,this._rootOriginId="root/"+hp(),this._origins=new Map,this._objects=new Map,this._gridSize=5e5}getOrigin(e){const i=this._origins.get(this._rootOriginId);if(i==null){const _=HU(e[0]+Math.random()-.5,e[1]+Math.random()-.5,e[2]+Math.random()-.5,this._rootOriginId);return this._origins.set(this._rootOriginId,_),_}const r=this._gridSize,n=Math.round(e[0]/r),s=Math.round(e[1]/r),o=Math.round(e[2]/r),l=`${n}/${s}/${o}`;let c=this._origins.get(l);const f=.5*r;if(je(al,e,i.vec3),al[0]=Math.abs(al[0]),al[1]=Math.abs(al[1]),al[2]=Math.abs(al[2]),al[0]0&&_.push(A-1,A);vn(f,this._originSR,0,f,r.renderSpatialReference,0,c);const T=new Bo(this._material,[[J.POSITION,new It(f,_,3,!0)]],null,Ws.Line);n.add(T),o.addGeometry(T)}get test(){const e=this;return{set gridSize(i){e._gridSize=i}}}};const al=W();let LNe=class{constructor(e,i,r=null){this.rctx=e,this.sliceHelper=r,this.lastFrameCamera=new ai,this.output=ue.Color,this.renderOccludedMask=d1e,this.bindParameters=new Pj(i,r!=null?r.plane:null),this.bindParameters.alignPixelEnabled=!0}resetRenderOccludedMask(){this.renderOccludedMask=d1e}},WEt=class extends LNe{constructor(e,i,r,n){super(e,r,n),this.offscreenRenderingHelper=i,this.sliceHelper=n,this.time=0}};const d1e=Wn.Occlude|Wn.OccludeAndTransparent|Wn.OccludeAndTransparentStencil;let dI=class extends ai{constructor(){super(...arguments),this._projectionMatrix=Qe()}get projectionMatrix(){return this._projectionMatrix}};y([w()],dI.prototype,"_projectionMatrix",void 0),y([w({readOnly:!0})],dI.prototype,"projectionMatrix",null),dI=y([Z("esri.views.3d.webgl-engine.lib.CascadeCamera")],dI);var I5;(function(t){t[t.Highlight=0]="Highlight",t[t.Default=1]="Default"})(I5||(I5={}));let IN=class{constructor(){this.camera=new dI,this.lightMat=Qe()}},YEt=class{constructor(){this.maxNumCascadesHighQuality=4,this.maxNumCascadesLowQuality=4,this.textureSizeModHighQuality=1.3,this.textureSizeModLowQuality=.9,this.splitSchemeLambda=0}},Xle=class{get depthTexture(){var e;return(e=this._handle)==null?void 0:e.colorTexture}get _textureWidth(){return this._textureHeight*this._numCascades}get numCascades(){return this._numCascades}get cascadeDistances(){return rs(this._usedCascadeDistances,this._cascadeDistances[0],this._numCascades>1?this._cascadeDistances[1]:1/0,this._numCascades>2?this._cascadeDistances[2]:1/0,this._numCascades>3?this._cascadeDistances[3]:1/0)}constructor(e,i){this._fbos=e,this._viewingMode=i,this._enabled=!1,this._snapshots=new Array,this._textureHeight=0,this._numCascades=1,this.settings=new YEt,this._projectionView=Qe(),this._projectionViewInverse=Qe(),this._modelViewLight=Qe(),this._cascadeDistances=[0,0,0,0,0],this._usedCascadeDistances=Xi(),this._cascades=[new IN,new IN,new IN,new IN],this._lastOrigin=null,this._maxTextureWidth=Math.min(Le("esri-mobile")?4096:16384,e.rctx.parameters.maxTextureSize)}dispose(){this.enabled=!1,this.disposeOffscreenBuffers()}disposeOffscreenBuffers(){this._handle=ir(this._handle),this._discardSnapshots()}set maxCascades(e){this.settings.maxNumCascadesHighQuality=Je(Math.floor(e),1,4)}get maxCascades(){return this.settings.maxNumCascadesHighQuality}set enabled(e){this._enabled=e,e||this.disposeOffscreenBuffers()}get enabled(){return this._enabled}get ready(){return this._enabled&&this.depthTexture!=null}get cascades(){for(let e=0;e=r&&(i=2,r=4),{near:i,far:r}}_computeCascadeDistances(e,i,r){const n=r?this.settings.maxNumCascadesHighQuality:this.settings.maxNumCascadesLowQuality;this._numCascades=Math.min(1+Math.floor(wgt(i/e,4)),n);const s=(i-e)/this._numCascades,o=(i/e)**(1/this._numCascades);let l=e,c=e;for(let f=0;fT&&(T=H)}Qo(r,Sd),Gu(xb,va,x-e),df(r,r,xb);let A=-1,M=1,I=0,L=0;for(let j=0;j<8;++j){Ps(yR,t[j],r),w5(yR,yR);const H=va[0]*yR[1]-va[1]*yR[0];H>0?H>A&&(A=H,I=j):H0,"leftArea"),JE(M<0,"rightArea"),Gu(gC,va,x),df(gC,gC,Sd),Gu(yC,va,T),df(yC,yC,Sd),$N[0]=-va[1],$N[1]=va[0];const F=BD(r,t[L],yC,df(xb,yC,$N),1,n),z=BD(r,t[I],yC,xb,1,s),k=BD(r,t[I],gC,df(xb,gC,$N),1,o),U=BD(r,t[L],gC,xb,1,l);JE(F,"rayRay"),JE(z,"rayRay"),JE(k,"rayRay"),JE(U,"rayRay")}function br(t,e){return 3*e+t}const b1e=yt();function ah(t,e){return or(b1e,t[e],t[e+3]),b1e}const _u=yt(),jt=as();function KEt(t,e,i,r,n){Ps(_u,i,r),Gu(_u,_u,.5),jt[0]=_u[0],jt[1]=_u[1],jt[2]=0,jt[3]=_u[1],jt[4]=-_u[0],jt[5]=0,jt[6]=_u[0]*_u[0]+_u[1]*_u[1],jt[7]=_u[0]*_u[1]-_u[1]*_u[0],jt[8]=1,jt[br(0,2)]=-fs(ah(jt,0),t),jt[br(1,2)]=-fs(ah(jt,1),t);let s=fs(ah(jt,0),i)+jt[br(0,2)],o=fs(ah(jt,1),i)+jt[br(1,2)],l=fs(ah(jt,0),r)+jt[br(0,2)],c=fs(ah(jt,1),r)+jt[br(1,2)];s=-(s+l)/(o+c),jt[br(0,0)]+=jt[br(1,0)]*s,jt[br(0,1)]+=jt[br(1,1)]*s,jt[br(0,2)]+=jt[br(1,2)]*s,s=1/(fs(ah(jt,0),i)+jt[br(0,2)]),o=1/(fs(ah(jt,1),i)+jt[br(1,2)]),jt[br(0,0)]*=s,jt[br(0,1)]*=s,jt[br(0,2)]*=s,jt[br(1,0)]*=o,jt[br(1,1)]*=o,jt[br(1,2)]*=o,jt[br(2,0)]=jt[br(1,0)],jt[br(2,1)]=jt[br(1,1)],jt[br(2,2)]=jt[br(1,2)],jt[br(1,2)]+=1,s=fs(ah(jt,1),e)+jt[br(1,2)],o=fs(ah(jt,2),e)+jt[br(2,2)],l=fs(ah(jt,1),i)+jt[br(1,2)],c=fs(ah(jt,2),i)+jt[br(2,2)],s=-.5*(s/o+l/c),jt[br(1,0)]+=jt[br(2,0)]*s,jt[br(1,1)]+=jt[br(2,1)]*s,jt[br(1,2)]+=jt[br(2,2)]*s,s=fs(ah(jt,1),e)+jt[br(1,2)],o=fs(ah(jt,2),e)+jt[br(2,2)],l=-o/s,jt[br(1,0)]*=l,jt[br(1,1)]*=l,jt[br(1,2)]*=l,n[0]=jt[0],n[1]=jt[1],n[2]=0,n[3]=jt[2],n[4]=jt[3],n[5]=jt[4],n[6]=0,n[7]=jt[5],n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=jt[6],n[13]=jt[7],n[14]=0,n[15]=jt[8]}function QEt(t,e,i,r,n){const s=1/uf[0][3],o=1/uf[4][3];Xt(se||new iCt,deallocator:e=>(e.renderGeometry=null,e)})}clear(){this.adds.clear(),this.removes.clear(),this.updates.clear()}prune(){this.adds.prune(),this.removes.prune(),this.updates.prune()}get empty(){return this.adds.length===0&&this.removes.length===0&&this.updates.length===0}},iCt=class{},rCt=class{constructor(){this.adds=new Array,this.removes=new Array,this.updates=new Array}};var ds,ca;(function(t){t[t.ADD=0]="ADD",t[t.UPDATE=1]="UPDATE",t[t.REMOVE=2]="REMOVE"})(ds||(ds={})),function(t){t[t.NONE=0]="NONE",t[t.VISIBILITY=1]="VISIBILITY",t[t.GEOMETRY=2]="GEOMETRY",t[t.TRANSFORMATION=4]="TRANSFORMATION",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.OCCLUDEE=16]="OCCLUDEE"}(ca||(ca={}));function NNe(t){const e=new Map,i=r=>{let n=e.get(r);return n||(n=new rCt,e.set(r,n)),n};return t.removes.forAll(r=>{IW(r)&&i(r.material).removes.push(r)}),t.adds.forAll(r=>{IW(r)&&i(r.material).adds.push(r)}),t.updates.forAll(r=>{IW(r.renderGeometry)&&i(r.renderGeometry.material).updates.push(r)}),e}function IW(t){return t.geometry.indexCount>=1}let FNe=class{constructor(e,i){this._material=e,this._repository=i,this._map=new Map}dispose(){this._map.forEach((e,i)=>{e!=null&&this._repository.release(this._material,i)})}load(e,i,r){if(!this._material.produces(i,r))return null;this._map.has(r)||this._map.set(r,this._repository.acquire(this._material,i,r));const n=this._map.get(r);if(n!=null){if(n.ensureResources(e)===U2.LOADED)return n;this._repository.requestRender()}return null}},fie=class extends H6e{constructor(e=W()){super(),this.origin=e,this.slicePlaneLocalOrigin=this.origin}};const nCt=ls().vec3f(J.POSITION),sCt=ls().vec3f(J.POSITION).vec2f(J.UV0),oCt=ls().vec3f(J.POSITION).vec4u8(J.COLOR);ls().vec3f(J.POSITION).vec4u8(J.OBJECTANDLAYERIDCOLOR);const aCt=ls().vec3f(J.POSITION).vec2f(J.UV0).vec4u8(J.OBJECTANDLAYERIDCOLOR);ls().vec3f(J.POSITION).vec4u8(J.COLOR).vec4u8(J.OBJECTANDLAYERIDCOLOR);let Zle=class extends hx{intersect(e,i,r,n,s,o){return H9e(e,r,n,s,void 0,o)}};function w1e(t){t.fragment.uniforms.add(new Zt("texWaveNormal",e=>e.waveNormal),new Zt("texWavePerturbation",e=>e.wavePerturbation),new gr("waveParams",e=>rs(lCt,e.waveStrength,e.waveTextureRepeat,e.flowStrength,e.flowOffset)),new ln("waveDirection",e=>or(cCt,e.waveDirection[0]*e.waveVelocity,e.waveDirection[1]*e.waveVelocity))),t.include(TTt),t.fragment.code.add(V`const vec2 FLOW_JUMP = vec2(6.0/25.0, 5.0/24.0); +vec2 textureDenormalized2D(sampler2D _tex, vec2 _uv) { +return 2.0 * texture(_tex, _uv).rg - 1.0; +} +float sampleNoiseTexture(vec2 _uv) { +return texture(texWavePerturbation, _uv).b; +} +vec3 textureDenormalized3D(sampler2D _tex, vec2 _uv) { +return 2.0 * texture(_tex, _uv).rgb - 1.0; +} +float computeProgress(vec2 uv, float time) { +return fract(time); +} +float computeWeight(vec2 uv, float time) { +float progress = computeProgress(uv, time); +return 1.0 - abs(1.0 - 2.0 * progress); +} +vec3 computeUVPerturbedWeigth(sampler2D texFlow, vec2 uv, float time, float phaseOffset) { +float flowStrength = waveParams[2]; +float flowOffset = waveParams[3]; +vec2 flowVector = textureDenormalized2D(texFlow, uv) * flowStrength; +float progress = computeProgress(uv, time + phaseOffset); +float weight = computeWeight(uv, time + phaseOffset); +vec2 result = uv; +result -= flowVector * (progress + flowOffset); +result += phaseOffset; +result += (time - progress) * FLOW_JUMP; +return vec3(result, weight); +} +const float TIME_NOISE_TEXTURE_REPEAT = 0.3737; +const float TIME_NOISE_STRENGTH = 7.77; +vec3 getWaveLayer(sampler2D _texNormal, sampler2D _dudv, vec2 _uv, vec2 _waveDir, float time) { +float waveStrength = waveParams[0]; +vec2 waveMovement = time * -_waveDir; +float timeNoise = sampleNoiseTexture(_uv * TIME_NOISE_TEXTURE_REPEAT) * TIME_NOISE_STRENGTH; +vec3 uv_A = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.0); +vec3 uv_B = computeUVPerturbedWeigth(_dudv, _uv + waveMovement, time + timeNoise, 0.5); +vec3 normal_A = textureDenormalized3D(_texNormal, uv_A.xy) * uv_A.z; +vec3 normal_B = textureDenormalized3D(_texNormal, uv_B.xy) * uv_B.z; +vec3 mixNormal = normalize(normal_A + normal_B); +mixNormal.xy *= waveStrength; +mixNormal.z = sqrt(1.0 - dot(mixNormal.xy, mixNormal.xy)); +return mixNormal; +} +vec4 getSurfaceNormalAndFoam(vec2 _uv, float _time) { +float waveTextureRepeat = waveParams[1]; +vec3 normal = getWaveLayer(texWaveNormal, texWavePerturbation, _uv * waveTextureRepeat, waveDirection, _time); +float foam = normals2FoamIntensity(normal, waveParams[0]); +return vec4(normal, foam); +}`)}const lCt=Xi(),cCt=yt();function GL(t,e){e.spherical?t.vertex.code.add(V`vec3 getLocalUp(in vec3 pos, in vec3 origin) { +return normalize(pos + origin); +}`):t.vertex.code.add(V`vec3 getLocalUp(in vec3 pos, in vec3 origin) { +return vec3(0.0, 0.0, 1.0); +}`),e.spherical?t.vertex.code.add(V`mat3 getTBNMatrix(in vec3 n) { +vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n)); +vec3 b = normalize(cross(n, t)); +return mat3(t, b, n); +}`):t.vertex.code.add(V`mat3 getTBNMatrix(in vec3 n) { +vec3 t = vec3(1.0, 0.0, 0.0); +vec3 b = normalize(cross(n, t)); +return mat3(t, b, n); +}`)}function kNe(t){const e=new Cr,{vertex:i,fragment:r}=e;Kh(i,t),e.include(Yu,t),e.attributes.add(J.POSITION,"vec3"),e.attributes.add(J.UV0,"vec2");const n=new gr("waterColor",s=>s.color);if(t.output===ue.Color&&t.isDraped)return e.varyings.add("vpos","vec3"),i.uniforms.add(n),i.code.add(V` + void main(void) { + if (waterColor.a < ${V.float(Cl)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vpos = position; + gl_Position = transformPosition(proj, view, vpos); + } + `),r.uniforms.add(n),r.code.add(V`void main() { +fragColor = waterColor; +}`),e;switch(t.output!==ue.Color&&t.output!==ue.Alpha||(e.include(GL,t),e.include(wP,t),e.varyings.add("vuv","vec2"),e.varyings.add("vpos","vec3"),e.varyings.add("vnormal","vec3"),e.varyings.add("vtbnMatrix","mat3"),t.multipassEnabled&&e.varyings.add("depth","float"),i.uniforms.add(n),i.code.add(V` + void main(void) { + if (waterColor.a < ${V.float(Cl)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vuv = uv0; + vpos = position; + + vnormal = getLocalUp(vpos, localOrigin); + vtbnMatrix = getTBNMatrix(vnormal); + + ${t.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""} + + gl_Position = transformPosition(proj, view, vpos); + ${t.output===ue.Color?"forwardLinearDepth();":""} + } + `)),e.include(dd,t),t.output){case ue.Alpha:e.include(oo,t),r.uniforms.add(n),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + + fragColor = vec4(waterColor.a); + } + `);break;case ue.Color:e.include(yU),e.include(Sae,{pbrMode:ei.Disabled,lightingSphericalHarmonicsOrder:2}),e.include(w1e),e.include(oo,t),e.include(KT,t),e.include(rNe,t),r.uniforms.add(n,new ft("timeElapsed",s=>s.timeElapsed),i.uniforms.get("view"),i.uniforms.get("localOrigin")),Nm(r,t),r.include(h1),B_(r),a1(r),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + vec3 localUp = vnormal; + // the created normal is in tangent space + vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed); + + // we rotate the normal according to the tangent-bitangent-normal-Matrix + vec3 n = normalize(vtbnMatrix * tangentNormalFoam.xyz); + vec3 v = -normalize(vpos - cameraPosition); + float shadow = ${t.receiveShadows?V`1.0 - readShadowMap(vpos, linearDepth)`:"1.0"}; + vec4 vPosView = view * vec4(vpos, 1.0); + vec4 final = vec4(getSeaColor(n, v, mainLightDirection, waterColor.rgb, mainLightIntensity, localUp, shadow, tangentNormalFoam.w, vPosView.xyz, vpos + localOrigin), waterColor.w); + + // gamma correction + fragColor = delinearizeGamma(final); + fragColor = highlightSlice(fragColor, vpos); + ${t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `);break;case ue.Normal:e.include(GL,t),e.include(w1e,t),e.include(oo,t),e.varyings.add("vpos","vec3"),e.varyings.add("vuv","vec2"),i.uniforms.add(n),i.code.add(V` + void main(void) { + if (waterColor.a < ${V.float(Cl)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vuv = uv0; + vpos = position; + + gl_Position = transformPosition(proj, view, vpos); + } + `),r.uniforms.add(new ft("timeElapsed",s=>s.timeElapsed)),r.code.add(V`void main() { +discardBySlice(vpos); +vec4 tangentNormalFoam = getSurfaceNormalAndFoam(vuv, timeElapsed); +tangentNormalFoam.xyz = normalize(tangentNormalFoam.xyz); +fragColor = vec4((tangentNormalFoam.xyz + vec3(1.0)) * 0.5, tangentNormalFoam.w); +}`);break;case ue.Highlight:e.include(dx,t),e.varyings.add("vpos","vec3"),i.uniforms.add(n),i.code.add(V` + void main(void) { + if (waterColor.a < ${V.float(Cl)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vpos = position; + gl_Position = transformPosition(proj, view, vpos); + } + `),e.include(oo,t),r.code.add(V`void main() { +discardBySlice(vpos); +outputHighlight(); +}`);break;case ue.ObjectAndLayerIdColor:e.include(e6,t),e.varyings.add("vpos","vec3"),i.uniforms.add(n),i.code.add(V` + void main(void) { + if (waterColor.a < ${V.float(Cl)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + vpos = position; + gl_Position = transformPosition(proj, view, vpos); + forwardObjectAndLayerIdColor(); + } + `),e.include(oo,t),r.code.add(V`void main() { +discardBySlice(vpos); +outputObjectAndLayerIdColor(); +}`)}return e}const uCt=Object.freeze(Object.defineProperty({__proto__:null,build:kNe},Symbol.toStringTag,{value:"Module"}));let zNe=class UNe extends Hr{initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global,i.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new Ir(e.rctx,UNe.shader.get().build(this.configuration),Er)}_setPipelineState(e){const i=this.configuration,r=e===Jt.NONE,n=e===Jt.FrontFace;return Ti({blending:i.output!==ue.Normal&&i.output!==ue.Highlight&&i.output!==ue.ObjectAndLayerIdColor&&i.transparent?r?vp:Y_(e):null,depthTest:{func:px(e)},depthWrite:r?i.writeDepth?rh:null:Kj(e),colorWrite:ji,polygonOffset:r||n?null:tG(i.enableOffset)})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}};zNe.shader=new Rr(uCt,()=>we(()=>Promise.resolve().then(()=>MWt),void 0));let _a=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.transparencyPassType=Jt.NONE,this.spherical=!1,this.receiveShadows=!1,this.hasSlicePlane=!1,this.transparent=!1,this.enableOffset=!0,this.writeDepth=!1,this.hasScreenSpaceReflections=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasCloudsReflections=!1,this.objectAndLayerIdColorInstanced=!1,this.isDraped=!1,this.multipassEnabled=!1,this.cullAboveGround=!1}};y([fe({count:ue.COUNT})],_a.prototype,"output",void 0),y([fe({count:Jt.COUNT})],_a.prototype,"transparencyPassType",void 0),y([fe()],_a.prototype,"spherical",void 0),y([fe()],_a.prototype,"receiveShadows",void 0),y([fe()],_a.prototype,"hasSlicePlane",void 0),y([fe()],_a.prototype,"transparent",void 0),y([fe()],_a.prototype,"enableOffset",void 0),y([fe()],_a.prototype,"writeDepth",void 0),y([fe()],_a.prototype,"hasScreenSpaceReflections",void 0),y([fe()],_a.prototype,"doublePrecisionRequiresObfuscation",void 0),y([fe()],_a.prototype,"hasCloudsReflections",void 0),y([fe()],_a.prototype,"objectAndLayerIdColorInstanced",void 0),y([fe()],_a.prototype,"isDraped",void 0),y([fe()],_a.prototype,"multipassEnabled",void 0),y([fe()],_a.prototype,"cullAboveGround",void 0),y([fe({constValue:!1})],_a.prototype,"occlusionPass",void 0),y([fe({constValue:ei.Water})],_a.prototype,"pbrMode",void 0),y([fe({constValue:!0})],_a.prototype,"useCustomDTRExponentForWater",void 0),y([fe({constValue:!0})],_a.prototype,"highStepCount",void 0),y([fe({constValue:!1})],_a.prototype,"useFillLights",void 0);let hCt=class extends cx{_updateShadowState(e){e.shadowMap.enabled!==this._material.parameters.receiveShadows&&this._material.setParameters({receiveShadows:e.shadowMap.enabled})}_updateSSRState(e){const i=e.ssr.lastFrameColor!=null;i!==this._material.parameters.hasScreenSpaceReflections&&this._material.setParameters({hasScreenSpaceReflections:i})}_updateCloudsReflectionState(e){const i=e.cloudsFade.data!=null;i!==this._material.parameters.hasCloudsReflections&&this._material.setParameters({hasCloudsReflections:i})}ensureResources(e){return this._techniqueRepository.constructionContext.waterTextureRepository.ensureResources(e)}beginSlot(e){return this._output===ue.Color&&(this._updateShadowState(e),this._updateSSRState(e),this._updateCloudsReflectionState(e)),this._material.setParameters(this._techniqueRepository.constructionContext.waterTextureRepository.passParameters),this.ensureTechnique(zNe,e)}},VNe=class extends Zle{constructor(e){super(e,new BNe),this._configuration=new _a,this._animation=new CLe}getConfiguration(e,i){return this._configuration.output=e,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasScreenSpaceReflections=this.parameters.hasScreenSpaceReflections,this._configuration.hasCloudsReflections=this.parameters.hasCloudsReflections,this._configuration.isDraped=this.parameters.isDraped,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.enableOffset=i.camera.relativeElevatione.set(r.from,r));let i=!0;for(;i;)i=!1,t.forEach(r=>{const n=e.get(r.to);n&&(r.to=n.to,e.delete(n.from),t.removeUnordered(n),i=!0)})}let S1e=class extends Jle{constructor(e,i,r){super(i,r),this.geometry=e}get isVisible(){return this.geometry.visible}get hasHighlights(){return this.geometry.highlights!=null&&this.isVisible}get hasOccludees(){return this.geometry.occludees!=null}},pCt=class{constructor(){this.first=0,this.count=0}},fCt=class{constructor(){this._numElements=0,this._instances=new Map,this.holes=new Pi({allocator:e=>e||new Jle,deallocator:null}),this.hasHiddenInstances=!1,this.hasHighlights=!1,this.hasOccludees=!1,this.drawCommandsDirty=!0,this.drawCommandsDefault=LN(),this.drawCommandsHighlight=LN(),this.drawCommandsOccludees=LN(),this.drawCommandsShadowHighlightRest=LN()}get numElements(){return this._numElements}get instances(){return this._instances}addInstance(e,i){this.deleteInstance(e),this._instances.set(e,i),this._numElements+=i.numElements}deleteInstance(e){const i=this._instances.get(e);i&&(this._numElements-=i.numElements,this._instances.delete(e))}updateInstance(e,i,r){const n=this._instances.get(e);n&&(this._numElements-=n.numElements,n.from=i,n.to=r,this._numElements+=n.numElements)}updateDrawState(e){e.isVisible?(e.hasHighlights&&(this.hasHighlights=!0),e.hasOccludees&&(this.hasOccludees=!0)):this.hasHiddenInstances=!0}updateDrawCommands(e){if(this.drawCommandsDefault.clear(),this.drawCommandsHighlight.clear(),this.drawCommandsOccludees.clear(),this.drawCommandsShadowHighlightRest.clear(),this.drawCommandsDirty=!1,this._instances.size===0)return;if(!this.needsMultipleCommands()){const r=this.drawCommandsDefault.pushNew(),n=this.holes.front();return this.vao!=null&&this.holes.length===1&&n.to===Math.floor(this.vao.byteSize/e)?(r.first=0,void(r.count=n.from)):(r.first=1/0,r.count=0,this._instances.forEach(s=>{r.first=Math.min(r.first,s.from),r.count=Math.max(r.count,s.to)}),void(r.count-=r.first))}const i=Array.from(this._instances.values()).sort((r,n)=>r.from===n.from?r.to-n.to:r.from-n.from);for(const r of i)r.isVisible&&(T1e(r.hasOccludees?this.drawCommandsOccludees:this.drawCommandsDefault,r),T1e(r.hasHighlights?this.drawCommandsHighlight:this.drawCommandsShadowHighlightRest,r))}needsMultipleCommands(){return this.hasOccludees||this.hasHighlights||this.hasHiddenInstances}};function mCt(t){return t.vao!=null}function LN(){return new Pi({allocator:t=>t||new pCt,deallocator:t=>t})}function T1e(t,e){const i=t.back();if(i==null){const r=t.pushNew();return r.first=e.from,void(r.count=e.numElements)}if(gCt(i,e)){const r=e.from-i.first+e.numElements;i.count=r}else{const r=t.pushNew();r.first=e.from,r.count=e.numElements}}function gCt(t,e){return t.first+t.count>=e.from}let yCt=class{constructor(e){this.origin=e,this.buffers=new Array}dispose(){this.buffers.forEach(e=>e.vao.dispose()),this.buffers.length=0}findBuffer(e){return this.buffers.find(i=>i.instances.has(e))}};const vCt=t$+1;let _Ct=class{constructor(e,i,r){this._rctx=e,this._locations=i,this._layout=r,this._cache=new G9(e.newCache,"VAOCache")}dispose(){this._cache.destroy()}newVao(e){const i=e.toString();let r=this._cache.pop(i);return r||(r=new qm(this._rctx,this._locations,{geometry:this._layout},{geometry:Yr.createVertex(this._rctx,Pr.STATIC_DRAW)}),r.vertexBuffers.geometry.setSize(e),r)}deleteVao(e){if(e==null)return;const i=e.byteSize.toString();this._cache.put(i,e,vCt)}},A$=class extends $Le{constructor(e){super(e),this._vaoCache=null,this._glMaterials=null,this._bufferWriter=null,this._dataByOrigin=new Map,this._hasHighlights=!1,this._hasOccludees=!1,this.priority=0,this.produces=new Map}dispose(){this._glMaterials=Kt(this._glMaterials),this._dataByOrigin.forEach(e=>e.dispose()),this._dataByOrigin.clear(),this._vaoCache=Kt(this._vaoCache)}initializeRenderContext(e,i){const{rctx:r}=e.renderContext;this._glMaterials=new FNe(this.material,i??e.materialRepository),this._bufferWriter=this.material.createBufferWriter(),this._vaoCache=new _Ct(r,this.material.vertexAttributeLocations,md(this._bufferWriter.vertexBufferLayout))}uninitializeRenderContext(){}get isEmpty(){return this._dataByOrigin.size===0}get hasHighlights(){return this._hasHighlights}get hasOccludees(){return this._hasOccludees}get hasWater(){return!this.isEmpty&&this.material instanceof VNe}get isDecoration(){return this.material.parameters.isDecoration}get rendersOccluded(){return!this.isEmpty&&this.material.parameters.renderOccluded!==Wn.Occlude}get numGeometries(){let e=0;return this._dataByOrigin.forEach(i=>e+=i.buffers.reduce((r,n)=>r+n.instances.size,0)),e}get usedMemory(){let e=0;return this._dataByOrigin.forEach(i=>e+=i.buffers.reduce((r,n)=>r+n.vao.usedMemory,0)),e}forEachGeometry(e){this._dataByOrigin.forEach(i=>i.buffers.forEach(r=>r.instances.forEach(n=>e(n.geometry))))}modify(e){this._updateGeometries(e.updates),this._addAndRemoveGeometries(e.adds,e.removes),this._updateDrawCommands()}_updateGeometries(e){const i=this._bufferWriter;if(i===null)return;const r=i.vertexBufferLayout.stride/4;for(const n of e){const s=n.renderGeometry,o=this._dataByOrigin.get(s.localOrigin.id),l=o==null?void 0:o.findBuffer(s.id);if(l==null)return;const c=l.instances.get(s.id);if(n.updateType&(ca.GEOMETRY|ca.TRANSFORMATION)){const f=FN(i.elementCount(c.geometry.geometry)*r),_=i.vertexBufferLayout.createView(f.buffer);this._writeGeometry(s,_,0),l.vao.vertexBuffers.geometry.setSubData(f,c.from*r,0,c.numElements*r)}n.updateType&(ca.HIGHLIGHT|ca.OCCLUDEE|ca.VISIBILITY)&&(l.drawCommandsDirty=!0)}}_computeDeltas(e,i){const r=new TP;for(const n of e){const s=n.localOrigin;if(s==null)continue;let o=r.get(s.id,null);o==null&&(o=new E1e(s.vec3),r.set(s.id,null,o)),o.changes.push(n)}for(const n of i){const s=n.localOrigin;if(s==null)continue;const o=this._dataByOrigin.get(s.id),l=o==null?void 0:o.findBuffer(n.id);if(l==null)continue;let c=r.get(s.id,l);c==null&&(c=new E1e(s.vec3),r.set(s.id,l,c)),c.changes.push(n)}return r}_addAndRemoveGeometries(e,i){if(this._bufferWriter===null||this._vaoCache===null)return;const{_bufferWriter:r,_dataByOrigin:n}=this,s=r.vertexBufferLayout.stride/4,o=this._computeDeltas(e,i);o.forEach((l,c)=>{const f=l.get(null),_=f!=null?f.changes:[];o.delete(c,null);let x=n.get(c);if(l.forEach((T,A)=>{if(o.delete(c,A),A==null)return void Xt(!1,"No VAO for removed geometries");if(A.instances.size===T.changes.length)return this._vaoCache.deleteVao(A.vao),Q$(x.buffers,A),void(x.buffers.length===0&&_.length===0&&n.delete(c));const M=A.numElements,I=A.vao.byteSize/4,L=_.reduce((U,j)=>U+r.elementCount(j.geometry),0),F=T.changes.reduce((U,j)=>U+r.elementCount(j.geometry),0),z=Math.min((M+L-F)*s,NN),k=z>I;z>XU&&zA.deleteInstance(U)),A.instances.forEach(({geometry:U})=>_.push(U)),this._vaoCache.deleteVao(A.vao),Q$(x.buffers,A)):k?this._applyAndRebuild(A,_,T):this._applyRemoves(A,T)}),_.length>0)for(x==null&&(x=new yCt(f.origin),n.set(c,x)),x.buffers.forEach(T=>this._applyAdds(T,_));_.length>0;)x.buffers.push(this._applyAndRebuild(new fCt,_,null))})}_updateDrawCommands(){this._hasHighlights=!1,this._hasOccludees=!1,this._dataByOrigin.forEach(e=>{e.buffers.forEach(i=>{i.drawCommandsDirty&&(i.hasHiddenInstances=!1,i.hasHighlights=!1,i.hasOccludees=!1,rp(i.instances,r=>(i.updateDrawState(r),i.hasHiddenInstances&&i.hasHighlights&&i.hasOccludees)),i.updateDrawCommands(this._bufferWriter.vertexBufferLayout.stride)),this._hasHighlights=this._hasHighlights||i.hasHighlights,this._hasOccludees=this._hasOccludees||i.hasOccludees})})}_applyAndRebuild(e,i,r){if(r!=null)for(const M of r.changes)e.deleteInstance(M.id);const n=this._bufferWriter,s=n.vertexBufferLayout.stride,o=s/4,l=Math.floor(NN/o);let c=e.numElements;for(;i.length>0;){const M=i.pop(),I=n.elementCount(M.geometry);if(c+I>l&&c>0){i.push(M);break}c+=I;const L=new S1e(M,0,0);Xt(e.instances.get(M.id)==null),e.addInstance(M.id,L)}const f=c*o,_=FN(f),x=n.vertexBufferLayout.createView(_.buffer);let T=0;e.hasHiddenInstances=!1,e.hasHighlights=!1,e.hasOccludees=!1,e.instances.forEach((M,I)=>{this._writeGeometry(M.geometry,x,T);const L=T;T+=n.elementCount(M.geometry.geometry),e.updateInstance(I,L,T),e.updateDrawState(M)}),this._vaoCache.deleteVao(e.vao),e.vao=this._vaoCache.newVao(M1e(f)),e.vao.vertexBuffers.geometry.setSubData(_,0,0,T*o),e.holes.clear();const A=e.holes.pushNew();return A.from=T,A.to=Math.floor(e.vao.byteSize/s),e.updateDrawCommands(s),e}_applyRemoves(e,i){if(i.changes.length===0||this._bufferWriter===null)return;for(const l of i.changes){const c=l.id,f=e.instances.get(c);if(!f)continue;e.deleteInstance(c);const _=sg.back();if(_){if(_.to===f.from){_.to=f.to;continue}if(_.from===f.to){_.from=f.from;continue}}const x=sg.pushNew();x.from=f.from,x.to=f.to}x1e(sg);const r=this._bufferWriter.vertexBufferLayout.stride/4,n=sg.reduce((l,c)=>Math.max(l,c.numElements),0)*r,s=FN(n);s.fill(0,0,n);const o=e.vao.vertexBuffers.geometry;sg.forAll(l=>o.setSubData(s,l.from*r,0,l.numElements*r)),e.holes.pushArray(sg.data,sg.length),sg.forAll((l,c)=>sg.data[c]=null),sg.clear(),e.drawCommandsDirty=!0}_applyAdds(e,i){if(i.length===0||this._bufferWriter===null)return;if(!mCt(e))return void this._applyAndRebuild(e,i,null);const r=this._bufferWriter,n=r.vertexBufferLayout.stride/4,s=e.numElements,o=i.reduce((F,z)=>F+r.elementCount(z.geometry),0),l=Math.min((s+o)*n,NN),c=4*l;if(e.vao.byteSizee.vao.byteSize)return void this._applyAndRebuild(e,i,null);x1e(e.holes);const f=new Array;for(const F of i){const z=r.elementCount(F.geometry),k=bCt(e.holes,z);f.push(k)}const _=e.vao.vertexBuffers.geometry;let x=0,T=0,A=0;const M=FN(l),I=r.vertexBufferLayout.createView(M.buffer);i.forEach((F,z)=>{const k=f[z];if(k==null)return;if(A!==k){const H=A-T;H>0&&_.setSubData(M,T*n,0,H*n),T=k,x=0}const U=r.elementCount(F.geometry);this._writeGeometry(F,I,x),x+=U,A=k+U;const j=new S1e(F,k,k+U);Xt(e.instances.get(F.id)==null),e.addInstance(F.id,j),e.drawCommandsDirty=!0});const L=A-T;L>0&&_.setSubData(M,T*n,0,L*n),Ije(i,(F,z)=>f[z]==null)}_writeGeometry(e,i,r){if(this._bufferWriter===null)return;const n=e.localOrigin.vec3;xgt(C1e,-n[0],-n[1],-n[2]);const s=nn(wCt,C1e,e.transformation);Vo(DN,s),ld(DN,DN),this._bufferWriter.write(s,DN,e.geometry,i,r)}updateAnimation(e){return this.material.update(e)}prepareTechnique(e){if(!this.material.shouldRender(e))return null;const{output:i,bindParameters:r}=e;if(!this.material.produces(r.slot,i))return null;const n=i===ue.Highlight||i===ue.ShadowHighlight;if(n&&!this._hasHighlights)return null;const s=i===ue.ShadowExcludeHighlight,o=!(n||s);for(const l of this._dataByOrigin.values())for(const c of l.buffers){if(n&&!c.hasHighlights)continue;const f=(n?c.drawCommandsHighlight:s&&c.needsMultipleCommands()?c.drawCommandsShadowHighlightRest:c.drawCommandsDefault)||null,_=o&&c.drawCommandsOccludees||null;if(f!=null&&f.length||_!=null&&_.length){const x=this._glMaterials.load(e.rctx,r.slot,i),T=x!=null?x.beginSlot(r):null;if(T!=null)return T}}return null}renderNode(e,i){const{output:r,bindParameters:n}=e,s=r===ue.Highlight||r===ue.ShadowHighlight,o=r===ue.ShadowExcludeHighlight,l=!(s||o),c=e.rctx,f=e.bindParameters.slot===ke.OCCLUDER_MATERIAL,_=e.bindParameters.slot===ke.TRANSPARENT_OCCLUDER_MATERIAL;c.runAppleAmdDriverHelper(),c.bindTechnique(i,this.material.parameters,n);for(const x of this._dataByOrigin.values())for(const T of x.buffers){if(s&&!T.hasHighlights)continue;const A=(s?T.drawCommandsHighlight:o&&T.needsMultipleCommands()?T.drawCommandsShadowHighlightRest:T.drawCommandsDefault)||null,M=l&&T.drawCommandsOccludees||null;(A!=null&&A.length||M!=null&&M.length)&&(i.program.bindDraw(new fie(x.origin),n,this.material.parameters),i.ensureAttributeLocations(T.vao),c.bindVAO(T.vao),A!=null&&A.length&&(c.setPipelineState(i.getPipeline(!1,f,_)),A.forAll(I=>c.drawArrays(i.primitiveType,I.first,I.count))),M!=null&&M.length&&(c.setPipelineState(i.getPipeline(!0,f,_)),M.forAll(I=>c.drawArrays(i.primitiveType,I.first,I.count))))}}get test(){return{material:this.material,glMaterials:this._glMaterials,dataByOrigin:this._dataByOrigin}}};y([w({constructOnly:!0})],A$.prototype,"material",void 0),A$=y([Z("esri.views.3d.webgl-engine.materials.renderers.MergedRenderer")],A$);let E1e=class{constructor(e){this.origin=e,this.changes=new Array}};function bCt(t,e){let i;if(!t.some(n=>!(n.numElements=i.to&&t.removeUnordered(i),r}const C1e=Qe(),wCt=Qe(),DN=Qe(),sg=new Pi({allocator:t=>t||new Jle,deallocator:null}),XU=65536,$W=4*XU,A1e=1024,jNe=16777216,NN=jNe/4;let LW=new Float32Array(XU);function FN(t){return LW.lengthe.dispose()),this._materialRenderers.clear(),this._sortedMaterialRenderers.clear(),this._geometries.clear(),this._pending.clear()}get updating(){return!this._pending.empty||this._changes.updates.length>0}get rctx(){return this.rendererContext.rctx}get _materialRepository(){return this.rendererContext.materialRepository}get _localOriginFactory(){return this.rendererContext.localOriginFactory}get hasHighlights(){return this._hasHighlights}get hasWater(){return this._hasWater}get rendersOccluded(){return this._materialRenderers.some(e=>e.rendersOccluded)}get isEmpty(){return!this.updating&&this._materialRenderers.length===0&&this._geometries.size===0}getMemoryForMaterial(e){if(e==null)return 0;const i=this._materialRenderers.find(r=>r.material===e);return(i==null?void 0:i.usedMemory)??0}commitChanges(){if(!this.updating)return!1;this._processAddsRemoves();const e=NNe(this._changes);let i=!1,r=!1,n=!1;return e.forEach((s,o)=>{let l=this._materialRenderers.find(_=>_.material===o);if(!l&&s.adds.length>0){const _=new A$({material:o});_.initializeRenderContext(this.rendererContext.pluginContext,this._materialRepository),l=_,this._materialRenderers.push(l),i=!0,r=!0,n=!0}if(!l)return;const c=r||l.hasHighlights,f=n||l.hasWater;l.modify(s),r=r||c!==l.hasHighlights,n=n||f!==l.hasWater,l.isEmpty&&(this._materialRenderers.removeUnordered(l),l.dispose(),i=!0)}),this._changes.clear(),i&&this._updateSortedMaterialRenderers(),r&&(this._hasHighlights=this._materialRenderers.some(s=>s.hasHighlights)),n&&(this._hasWater=this._materialRenderers.some(s=>s.hasWater)),this.notifyChange("updating"),!0}addGeometries(e,i){if(e.length===0)return;const r=this._validateRenderGeometries(e);for(const s of r)this._geometries.set(s.id,s);const n=this._pending.empty;for(const s of r)this._pending.adds.add(s);n&&this.notifyChange("updating"),i===ds.UPDATE&&this._notifyGraphicGeometryChanged(e)}removeGeometries(e,i){const r=this._pending.empty,n=this._pending.adds;for(const s of e)n.has(s)?(this._pending.removed.add(s),n.delete(s)):this._pending.removed.has(s)||this._pending.removes.add(s),this._geometries.delete(s.id);r&&!this._pending.empty&&this.notifyChange("updating"),i===ds.UPDATE&&this._notifyGraphicGeometryChanged(e)}modifyGeometries(e,i){const r=this._changes.updates.length===0;for(const n of e){const s=this._changes.updates.pushNew();s.renderGeometry=this._validateRenderGeometry(n),s.updateType=i}switch(r&&this._changes.updates.length>0&&this.notifyChange("updating"),i){case ca.TRANSFORMATION:case ca.GEOMETRY:return this._notifyGraphicGeometryChanged(e);case ca.VISIBILITY:return this._notifyGraphicVisibilityChanged(e)}}updateAnimation(e){let i=!1;return this._sortedMaterialRenderers.forAll(r=>i=r.updateAnimation(e)||i),i}shouldRender(e){return this._sortedMaterialRenderers.some(i=>i.prepareTechnique(e))}render(e){this._sortedMaterialRenderers.forAll(i=>{const r=i.prepareTechnique(e);r!=null&&i.renderNode(e,r)})}intersect(e,i,r,n,s){return this._geometries.forEach(o=>{if(n&&!n(o))return;this._intersectRenderGeometry(o,r,i,0,e,s);const l=this.rendererContext.longitudeCyclical;l&&(o.boundingSphere[0]-o.boundingSphere[3]l.max&&this._intersectRenderGeometry(o,r,i,-l.range,e,s)),s++}),s}_updateSortedMaterialRenderers(){this._sortedMaterialRenderers.clear(),this._materialRenderers.forAll((e,i)=>{e.priority=i,this._sortedMaterialRenderers.push(e)}),this._sortedMaterialRenderers.sort((e,i)=>i.material.renderPriority===e.material.renderPriority?e.priority-i.priority:i.material.renderPriority-e.material.renderPriority)}_processAddsRemoves(){this._changes.adds.clear(),this._changes.removes.clear(),this._changes.adds.pushArray(Array.from(this._pending.adds)),this._changes.removes.pushArray(Array.from(this._pending.removes));for(let e=0;e{SCt(i,_,e.material.renderPriority,o,s,e.layerUid,e.graphicUid)},i)}_notifyGraphicGeometryChanged(e){if(this.drapeSource.notifyGraphicGeometryChanged==null)return;let i;for(const r of e){const n=r.graphicUid;n!=null&&n!==i&&(this.drapeSource.notifyGraphicGeometryChanged(n),i=n)}}_notifyGraphicVisibilityChanged(e){if(this.drapeSource.notifyGraphicVisibilityChanged==null)return;let i;for(const r of e){const n=r.graphicUid;n!=null&&n!==i&&(this.drapeSource.notifyGraphicVisibilityChanged(n),i=n)}}_validateRenderGeometries(e){for(const i of e)this._validateRenderGeometry(i);return e}_validateRenderGeometry(e){return e.localOrigin==null&&(e.localOrigin=this._localOriginFactory.getOrigin(e.boundingSphere)),e}get test(){return{sortedMaterialRenderers:this._sortedMaterialRenderers}}};y([w()],Bd.prototype,"drapeSource",void 0),y([w()],Bd.prototype,"updating",null),y([w()],Bd.prototype,"rctx",null),y([w({constructOnly:!0})],Bd.prototype,"rendererContext",void 0),y([w()],Bd.prototype,"_materialRepository",null),y([w()],Bd.prototype,"_localOriginFactory",null),y([w({readOnly:!0})],Bd.prototype,"isEmpty",null),y([w()],Bd.prototype,"_materialRenderers",void 0),y([w()],Bd.prototype,"_geometries",void 0),Bd=y([Z("esri.views.3d.webgl-engine.lib.SortedRenderGeometryRenderer")],Bd);let xCt=class{constructor(){this.adds=new Set,this.removes=new Set,this.removed=new Set}get empty(){return this.adds.size===0&&this.removes.size===0&&this.removed.size===0}has(e){return this.adds.has(e)||this.removes.has(e)||this.removed.has(e)}clear(){this.adds.clear(),this.removes.clear(),this.removed.clear()}};function SCt(t,e,i,r,n,s,o){const l=new tCt(s,o,e),c=f=>{f.set(ms.OVERLAY,l,t.dist,t.normal,t.transformation,i,r)};if((n.results.min.drapedLayerOrder==null||i>=n.results.min.drapedLayerOrder)&&(n.results.min.dist==null||n.results.ground.dist<=n.results.min.dist)&&c(n.results.min),n.options.store!==tl.MIN&&(n.results.max.drapedLayerOrder==null||in.results.max.dist)&&c(n.results.max),n.options.store===tl.ALL){const f=iae(n.ray);c(f),n.results.all.push(f)}}const DW=yt();let Kle=class GNe extends Hr{initializeProgram(e){return new Ir(e.rctx,GNe.shader.get().build(),Er)}initializePipeline(){return this.configuration.hasAlpha?Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji}):Ti({colorWrite:ji})}};Kle.shader=new Rr(PTt,()=>we(()=>Promise.resolve().then(()=>OWt),void 0));let Qle=class extends nh{constructor(){super(...arguments),this.hasAlpha=!1}};y([fe()],Qle.prototype,"hasAlpha",void 0);let ece=class extends _n{constructor(){super(...arguments),this.overlayIndex=ko.INNER,this.opacity=1}};function HNe(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("tex",e=>e.texture)),t.fragment.uniforms.add(new s6("overlayIdx",e=>e.overlayIndex)),t.fragment.uniforms.add(new ft("opacity",e=>e.opacity)),t.fragment.code.add(V`void main() { +vec2 overlayUV = overlayIdx == 0 ? vec2(uv.x * 0.5, uv.y) : vec2(uv.x * 0.5 + 0.5, uv.y); +fragColor = texture(tex, overlayUV) * opacity; +}`),t}const TCt=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:ece,build:HNe},Symbol.toStringTag,{value:"Module"}));let qNe=class WNe extends Hr{initializeProgram(e){return new Ir(e.rctx,WNe.shader.get().build(),Er)}initializePipeline(){return Ti({blending:hd(st.ONE,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji})}};qNe.shader=new Rr(TCt,()=>we(()=>Promise.resolve().then(()=>PWt),void 0));let k0=class extends CE{get _bindParameters(){return this._renderContext.bindParameters}get _rctx(){return this.view._stage.renderView.renderingContext}get rctx(){return this._rctx}get materialRepository(){return this._materialRepository}get screenToWorldRatio(){return this._screenToWorldRatio}get localOriginFactory(){return this._localOriginFactory}constructor(e){super(e),this._overlays=null,this._renderTargets=null,this._overlayParameters=new ece,this.hasHighlights=!1,this._rendersOccluded=!1,this._hasWater=!1,this._renderers=new Map,this._sortedDrapeSourceRenderersDirty=!1,this._sortedRenderers=new Pi,this._passParameters=new Ble,this._materialRepository=null,this._screenToWorldRatio=1,this._localOriginFactory=null,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._camera=new ai,this.worldToPCSRatio=1,this.events=new Dn,this.longitudeCyclical=null,this.produces=new Map([[ke.DRAPED_MATERIAL,i=>i!==ue.Highlight||this.hasHighlights],[ke.DRAPED_WATER,()=>!0]]),this._hasTargetWithoutRasterImage=!1,this._hasDrapedFeatureSource=!1,this._hasDrapedRasterSource=!1}initialize(){const e=this.view._stage.renderer.fboCache,i=this.view._stage.renderView,{waterTextureRepository:r,stippleTextureRepository:n,markerTextureRepository:s}=i;this._shaderTechniqueRepository=new oNe({rctx:this._rctx,viewingMode:_t.Local,stippleTextureRepository:n,markerTextureRepository:s,waterTextureRepository:r}),this._renderContext=new LNe(this._rctx,new Xle(e,this.view.state.viewingMode),null),this.addHandles([_e(()=>r.updating,()=>this.events.emit("content-changed"),kt),_e(()=>this.spatialReference,o=>this._localOriginFactory=new Yle(o),kt),Jr(()=>this.view.allLayerViews,"after-changes",()=>this._sortedDrapeSourceRenderersDirty=!0)]),this._materialRepository=new aNe(i.textureRepository,this._shaderTechniqueRepository,o=>{(o.parameters.renderOccluded&ZU)>0!==this._rendersOccluded&&this._updateRendersOccluded(),this.events.emit("content-changed"),this.notifyChange("updating"),this.notifyChange("isEmpty")},()=>this.events.emit("content-changed")),this._bindParameters.slot=ke.DRAPED_MATERIAL,this._bindParameters.mainDepth=Syt(this._rctx),this._camera.near=1,this._camera.far=1e4,this._camera.relativeElevation=null,this._bindParameters.camera=this._camera,this._bindParameters.transparencyPassType=Jt.NONE,this._bindParameters.newLighting.noonFactor=0,this._bindParameters.newLighting.globalFactor=0,this._bindParameters.newLighting.set([new Mae(nt(1,1,1))]),this.addHandles(this.view.resourceController.scheduler.registerTask(ni.STAGE,this))}destroy(){this._renderers.forEach(e=>e.destroy()),this._renderers.clear(),this._debugTextureTechnique=ir(this._debugTextureTechnique),this._passParameters.texture=Kt(this._passParameters.texture),this._bindParameters.mainDepth=Kt(this._bindParameters.mainDepth),this._shaderTechniqueRepository=et(this._shaderTechniqueRepository),this.disposeOverlays()}initializeRenderContext(e){this.pluginContext=e}uninitializeRenderContext(){}renderNode(){}get updating(){return this._sortedDrapeSourceRenderersDirty||rp(this._renderers,e=>e.updating)}get hasOverlays(){return this._overlays!=null&&this._renderTargets!=null}getMemoryForMaterial(e){return Array.from(this._renderers.values()).reduce((i,r)=>i+r.getMemoryForMaterial(e),0)}createGeometryDrapeSourceRenderer(e){return this.createDrapeSourceRenderer(e,Bd)}createDrapeSourceRenderer(e,i,r){const n=this._renderers.get(e);n!=null&&n.destroy();const s=new i({...r,rendererContext:this,drapeSource:e});return this._renderers.set(e,s),this._sortedDrapeSourceRenderersDirty=!0,"fullOpacity"in e&&this.addHandles(_e(()=>e.fullOpacity,()=>this.events.emit("content-changed")),e),s}removeDrapeSourceRenderer(e){if(e==null)return;const i=this._renderers.get(e);i!=null&&(this._sortedDrapeSourceRenderersDirty=!0,this._renderers.delete(e),this.removeHandles(e),i.destroy())}computeValidity(){var e;return((e=this._renderTargets)==null?void 0:e.computeValidity())??0}releaseRenderTargets(){var e;(e=this._renderTargets)==null||e.dispose()}get overlays(){return this._overlays??[]}ensureDrapeTargets(e){this._hasTargetWithoutRasterImage=!!this._overlays&&d7(e,i=>i.drapeTargetType===cie.WithoutRasterImage)}ensureDrapeSources(e){this._overlays?(this._hasDrapedFeatureSource=d7(e,i=>i.drapeSourceType===T$.Features),this._hasDrapedRasterSource=d7(e,i=>i.drapeSourceType===T$.RasterImage)):this._hasDrapedFeatureSource=this._hasDrapedRasterSource=!1}get _needsColorWithoutRasterImage(){return this._hasDrapedRasterSource&&this._hasDrapedFeatureSource&&this._hasTargetWithoutRasterImage}ensureOverlays(e,i,r=this._bindParameters.overlayStretch){this._overlays==null&&(this._renderTargets=new bTt(this.view._stage.renderer.fboCache),this._overlays=[new t1e,new t1e]),this.ensureDrapeTargets(e),this.ensureDrapeSources(i),this._bindParameters.overlayStretch=r}disposeOverlays(){this._overlays=null,this._renderTargets=Kt(this._renderTargets),this.events.emit("textures-disposed")}getTexture(e){var i,r;if(e!=null)return e===ns.ColorNoRasterImage&&!this._needsColorWithoutRasterImage&&this._hasDrapedFeatureSource?(i=this._renderTargets)==null?void 0:i.getTexture(ns.Color):(r=this._renderTargets)==null?void 0:r.getTexture(e)}get running(){return this.updating}runTask(e){this._processDrapeSources(e,()=>!0)}_processDrapeSources(e,i){let r=!1;for(const[n,s]of this._renderers){if(e.done)break;(n.destroyed||i(n))&&s.commitChanges()&&(r=!0,e.madeProgress())}this._sortedDrapeSourceRenderersDirty&&(this._sortedDrapeSourceRenderersDirty=!1,r=!0,this._updateSortedDrapeSourceRenderers()),r&&(this._overlays!=null&&this._renderers.size===0&&this.disposeOverlays(),this.notifyChange("updating"),this.notifyChange("isEmpty"),this.events.emit("content-changed"),this.hasHighlights=rp(this._renderers,n=>n.hasHighlights),this._updateRendersOccluded(),this._updateHasWater())}processSyncDrapeSources(){this._processDrapeSources(ou,e=>e.updatePolicy===b2.SYNC)}get isEmpty(){return!Tn.OVERLAY_DRAW_DEBUG_TEXTURE&&!rp(this._renderers,e=>!e.isEmpty)}get hasWater(){return this._hasWater}get rendersOccluded(){return this._rendersOccluded}get mode(){var e,i;return this.isEmpty?vy.Disabled:(e=this._renderTargets)!=null&&e.getTexture(ns.WaterNormal)?vy.EnabledWithWater:(i=this._renderTargets)!=null&&i.getTexture(ns.Color)?vy.Enabled:vy.Disabled}updateAnimation(e){let i=!1;return this._renderers.forEach(r=>i=r.updateAnimation(e)||i),i}updateDrapeSourceOrder(){this._sortedDrapeSourceRenderersDirty=!0}drawOverlays(e){if(this._overlays&&this._renderTargets){for(const i of this._overlays)this.longitudeCyclical?i.setupGeometryViewsCyclical(this.longitudeCyclical):i.setupGeometryViewsDirect();for(const i of this._renderTargets.targets)(i.content!==ns.ColorNoRasterImage||this._needsColorWithoutRasterImage)&&(this._drawTarget(ko.INNER,i,e),this._drawTarget(ko.OUTER,i,e))}}_drawTarget(e,i,r){const n=this._overlays[e],s=n.canvasGeometries;if(s.numViews===0)return;const{alignPixelEnabled:o,contentPixelRatio:l}=r;this._screenToWorldRatio=l*n.mapUnitsPerPixel/this._bindParameters.overlayStretch;const c=i.output;if(this.isEmpty||c===ue.Highlight&&!this.hasHighlights||c===ue.Normal&&!this.hasWater||!n.hasSomeSizedView())return;const f=this._rctx;this._camera.pixelRatio=n.pixelRatio*l,this._renderContext.output=c,this._bindParameters.alignPixelEnabled=o,this._bindParameters.screenToWorldRatio=this._screenToWorldRatio,this._bindParameters.screenToPCSRatio=this._screenToWorldRatio*this.worldToPCSRatio,this._bindParameters.slot=c===ue.Normal?ke.DRAPED_WATER:ke.DRAPED_MATERIAL;const _=Tn.OVERLAY_DRAW_DEBUG_TEXTURE&&i.content!==ns.Occluded;if(!_&&!this._sortedRenderers.some(({renderer:I})=>I.shouldRender(this._renderContext)))return;const x=n.resolution;this._rctx.setViewport(e===ko.INNER?0:x,0,x,x);const T=2*n.resolution,A=n.resolution,M=i.fbo;if(M.bind(f,T,A),e===ko.INNER&&(f.setClearColor(0,0,0,0),f.clearSafe(In.COLOR_BUFFER_BIT)),i.content===ns.Occluded&&(this._renderContext.renderOccludedMask=ZU),_)for(let I=0;I{if(i.content===ns.ColorNoRasterImage&&I.drapeSourceType===T$.RasterImage)return;const{fullOpacity:F}=I,z=F!=null&&F<1&&c===ue.Color?this.bindTemporaryFramebuffer(T,A):null;for(let k=0;k{const n=e.indexOf(r.layer),s=n>=0,o=this._renderers.size*(r.renderGroup??(s?GU.MapLayer:GU.ViewLayer))+(s?n:0);this._sortedRenderers.push(new ECt(r,i,o))}),this._sortedRenderers.sort((i,r)=>i.index-r.index)}_setViewParameters(e,i){const r=this._camera;r.viewport=[0,0,i.resolution,i.resolution],KAe(r.projectionMatrix,0,e[2]-e[0],0,e[3]-e[1],r.near,r.far),L9(r.viewMatrix,[-e[0],-e[1],0])}_updateHasWater(){const e=rp(this._renderers,i=>i.hasWater);e!==this._hasWater&&(this._hasWater=e,this.events.emit("has-water",e))}_updateRendersOccluded(){const e=rp(this._renderers,i=>i.rendersOccluded);e!==this._rendersOccluded&&(this._rendersOccluded=e,this.events.emit("renders-occluded",e))}_ensureDebugPatternResources(e,i){if(Ie(this._passParameters.color,i[0],i[1],i[2]),this._passParameters.texture)return;const r=new Uint8Array(e*e*4);let n=0;for(let l=0;le-20||10*_>e-20?(r[n++]=255,r[n++]=255,r[n++]=255,r[n++]=255):(r[n++]=255,r[n++]=255,r[n++]=255,r[n++]=1&f&&1&_?1&c^1&l?0:255:1&f^1&_?0:128)}const s=new tn(e);s.samplingMode=ki.NEAREST,this._passParameters.texture=new Ai(this._rctx,s,r);const o=new Qle;o.hasAlpha=!0,this._debugTextureTechnique=this._shaderTechniqueRepository.acquire(Kle,o)}get test(){return{drapedRenderers:Array.from(this._renderers.values()),getDrapeSourceRenderer:e=>this._renderers.get(e)}}};y([w()],k0.prototype,"hasHighlights",void 0),y([w()],k0.prototype,"_sortedDrapeSourceRenderersDirty",void 0),y([w({autoDestroy:!0})],k0.prototype,"_shaderTechniqueRepository",void 0),y([w({constructOnly:!0})],k0.prototype,"view",void 0),y([w()],k0.prototype,"worldToPCSRatio",void 0),y([w()],k0.prototype,"spatialReference",void 0),y([w({type:Boolean,readOnly:!0})],k0.prototype,"updating",null),y([w()],k0.prototype,"isEmpty",null),k0=y([Z("esri.views.3d.terrain.OverlayRenderer")],k0);let ECt=class{constructor(e,i,r){this.drapeSource=e,this.renderer=i,this.index=r}};const CCt=[[1,.5,.5],[.5,.5,1]],tce=-2,ZU=Wn.OccludeAndTransparent;function ice(t,e,i,r){const n=c6(t.rings,!!t.hasZ,Ky.CCW_IS_HOLE,t.spatialReference),s=Ja(n.position.length),o=A6e(n.position,t.spatialReference,0,s,0,n.position,0,n.position.length/3,e,i,r),l=o!=null;return new OCt(n.position,s,ZNe(n.polygons,n.position,s),XNe(n.outlines,n.position,s),l,o)}function YNe(t,e){const i=c6(t.rings,!1,Ky.CCW_IS_HOLE),r=vn(i.position,t.spatialReference,0,i.position,e,0,i.position.length/3);for(let n=2;nr>1).map(({index:r,count:n})=>{const s=3*r,o=3*n;return i!=null?new JNe(r,n,Lf(e,s,o),Lf(i,s,o)):new rce(r,n,Lf(e,s,o))})}function ZNe(t,e,i=null){const r=new Array;for(const{index:n,count:s,holeIndices:o,pathLengths:l}of t){if(s<=1)continue;const c=3*n,f=3*s,_=o.map(T=>T-n),x=i!=null?new ACt(n,s,Lf(e,3*n,3*s),Lf(i,c,f),_,l):new MCt(n,s,Lf(e,3*n,3*s),_,l);r.push(x)}return r}let rce=class{constructor(e,i,r){this.index=e,this.count=i,this.position=r}},JNe=class extends rce{constructor(e,i,r,n){super(e,i,r),this.mapPositions=n}},ACt=class extends JNe{constructor(e,i,r,n,s,o){super(e,i,r,n),this.holeIndices=s,this.pathLengths=o}},MCt=class extends rce{constructor(e,i,r,n,s){super(e,i,r),this.holeIndices=n,this.pathLengths=s}},OCt=class{constructor(e,i,r,n,s,o){this.position=e,this.mapPositions=i,this.polygons=r,this.outlines=n,this.projectionSuccess=s,this.sampledElevation=o}};function tE(t,e,i,r,n,s=2){const o=1/(Math.abs(i)+Math.abs(r)+Math.abs(n)),l=i*o,c=r*o,f=n<=0?(l>=0?1:-1)*(1-Math.abs(c)):l,_=n<=0?(c>=0?1:-1)*(1-Math.abs(l)):c,x=e*s;t[x]=O1e(f),t[x+1]=O1e(_)}function PCt(t){const e=t.length/3,i=new Int16Array(2*e);let r=0;for(let n=0;n=0?1:-1)*(1-Math.abs(o)),t[1]=(o>=0?1:-1)*(1-Math.abs(s))):(t[0]=s,t[1]=o),Ye(t,t)}function O1e(t){return Je(Math.round(32767*t),-32767,32767)}function P1e(t){return Je(t/32767,-1,1)}const ICt=["polygon","extent"];let $Ct=class extends p1{constructor(e,i,r,n){super(e,i,r,n),this.ensureDrapedStatus(!1)}async doLoad(){var l,c;if(!this._drivenProperties.size){const f=iG(this._getSymbolSize());if(f)throw new se("graphics3dextrudesymbollayer:invalid-size",f)}const e=(c=(l=this.symbolLayer)==null?void 0:l.material)==null?void 0:c.color,i=this._getCombinedOpacityAndColor(e),r=mc(i),n=i[3],s=n<1||this.needsDrivenTransparentPass,o={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,diffuse:r,ambient:r,opacity:n,transparent:s,cullFace:s?Ln.None:Ln.Back,hasVertexColors:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!0,normalType:Br.Compressed};this._materials[jd.Main]=new km(o),this._materials[jd.Bottom]=new km({...o,cullFace:Ln.Back}),this._context.stage.addMany(this._materials)}destroy(){super.destroy(),this._context.stage.removeMany(this._materials),this._materials.length=0}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry,ICt,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(e.renderingInfo,255),n=this.setGraphicElevationContext(i);return this._createAs3DShape(i,e.renderingInfo,r,n,i.uid)}layerOpacityChanged(e,i){var l,c,f,_;const r=(c=(l=this.symbolLayer)==null?void 0:l.material)==null?void 0:c.color,n=this._getCombinedOpacity(r),s=n<1||this.needsDrivenTransparentPass;(f=this._materials[jd.Main])==null||f.setParameters({opacity:n,transparent:s}),(_=this._materials[jd.Bottom])==null||_.setParameters({opacity:n,transparent:s});const o=this._getLayerOpacity();e.forEach(x=>{const T=i(x);T!=null&&T.layerOpacityChanged(o,this._context.isAsync)})}layerElevationInfoChanged(e,i){return this.updateGraphics3DGraphicElevationInfo(e,i,X2)}slicePlaneEnabledChanged(e,i){var r,n;return(r=this._materials[jd.Main])==null||r.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),(n=this._materials[jd.Bottom])==null||n.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),e.forEach(s=>{const o=i(s);o!=null&&o.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){var i,r;const e={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0};return(i=this._materials[jd.Main])==null||i.setParameters(e),(r=this._materials[jd.Bottom])==null||r.setParameters(e),!0}_getExtrusionSize(e){let i;return i=e.size&&this._drivenProperties.size?lTt(e.size,2)??0:this._getSymbolSize(),i/=this._context.renderCoordsHelper.unitInMeters,i}applyRendererDiff(e,i){return this._drivenPropertiesChanged(i)?To.RecreateSymbol:To.RecreateGraphics}async queryForSnapping(e,i,r,n){const s=this._getExtrusionSize(r)*this._context.renderCoordsHelper.unitInMeters/Bf(i),{objectId:o,target:l}=e,c=Re(l);switch(c.z=(c.z??0)+s,e.type){case"edge":{const{start:f,end:_}=e,x=Re(f),T=Re(_);return x.z=(x.z??0)+s,T.z=(T.z??0)+s,[Jye(o,c,1/0,x,T)]}case"vertex":return[sTt(o,c,1/0),Jye(o,l,1/0,l,c)];default:return[]}}_getSymbolSize(){return this.symbolLayer.size??1}_createAs3DShape(e,i,r,n,s){const o=VL(e.geometry);if(o==null)return null;if(o.rings.length===0||!o.rings.some(Q=>Q.length>0))return this._logGeometryValidationWarnings(o.rings,"rings","ExtrudeSymbol3DLayer"),null;const l=ice(o,this._context.elevationProvider,this._context.renderCoordsHelper,n);this._logGeometryCreationWarnings(l,o.rings,"rings","ExtrudeSymbol3DLayer");const c=wle(o);if(c==null)return null;const f=new Array,_=new Array,x=ya(),T=Qe(),A=W(),M=this._context.renderCoordsHelper.viewingMode===_t.Global;M||this._context.renderCoordsHelper.worldUpAtPosition(null,A),uu(o.spatialReference,[c.x,c.y,0],T,this._context.renderCoordsHelper.spatialReference);const I=Qe();Vo(I,T);const L=as();v_(L,I);const{polygons:F,mapPositions:z,position:k}=l;for(const Q of F){const ne=Q.count;if(this._context.clippingExtent&&(Bn(x),cp(x,Q.mapPositions),!ym(x,this._context.clippingExtent)))continue;const re=R5(Q.mapPositions,Q.holeIndices,3);if(re.length===0)continue;const he=re.length,ce=6*ne,be=TU(ce+he),ye=TU(he),pe=Ja(3*ce),Ee=Ja(3*ce),te=Ja(3*ce),le=Ja(ce);LCt(k,z,re,Q,pe,te,Ee,le,be,ye,this._getExtrusionSize(i),A,M),Um(pe,pe,I);const de=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:s,layerUid:this._context.layer.uid}),ve=new zCt(pe,te,PCt(Ee),le);f.push(R1e(this._materials[jd.Main],be,be.length-ye.length,ve,r,de),R1e(this._materials[jd.Bottom],ye,0,ve,r,de)),_.push(ve.heights)}if(f.length===0)return null;const U=new X_({geometries:f,layerUid:this._context.layer.uid,graphicUid:s,isElevationSource:!0});U.transformation=T;const j=zPe(this.symbolLayer,{opacity:this._getLayerOpacity()}),H=j!=null?{baseMaterial:this._materials[jd.Main],edgeMaterials:[j],properties:{mergeGeometries:!0,hasSlicePlane:this._context.slicePlaneEnabled}}:null,Y=new d1(this,U,f,null,null,(Q,ne,re,he,ce)=>FCt(Q,ne,re,he,ce,_),n,H);return Y.alignedSampledElevation=l.sampledElevation,Y.needsElevationUpdates=X2(n.mode),Y}};function R1e(t,e,i,r,n,s){const o=ux(e.length),l=[[J.POSITION,new It(r.positions,e,3,!0)],[J.NORMALCOMPRESSED,new It(r.normals,e,2,!0)],[J.COLOR,new It(n,o,4,!0)]];return new Bo(t,l,r.elevation,Ws.Mesh,s,i)}function LCt(t,e,i,r,n,s,o,l,c,f,_,x,T){const A=i.length/3;let M=0,I=2*r.count;DCt(t,e,r.index,r.count,i,0,A,n,s,o,l,c,f,I,_,x,T);let L=2*r.count;I=0,I1e(n,s,l,o,M,r.pathLengths[0],r.count,L,c,I,_),L+=4*r.pathLengths[0],I+=2*r.pathLengths[0],M+=r.pathLengths[0];for(let F=1;F0?1:-1;let z=3*i,k=0,U=3*k,j=r,H=3*j;for(let ne=0;ne0?(T=n,M=n+o):(T=n,x=n+o)),NCt(t,x,T,A,vR),kN(t,e,r,i,vR,I,x),kN(t,e,r,i,vR,L,T),kN(t,e,r,i,vR,F,A),kN(t,e,r,i,vR,z,M),c[f++]=I,c[f++]=F,c[f++]=z,c[f++]=I,c[f++]=z,c[f++]=L,x++,T++,A++,M++,I+=2,L+=2,F+=2,z+=2}const NW=W(),$1e=W(),L1e=W(),D1e=W(),N1e=W();function NCt(t,e,i,r,n){e*=3,i*=3,r*=3,Ie(NW,t[e++],t[e++],t[e++]),Ie($1e,t[i++],t[i++],t[i++]),Ie(L1e,t[r++],t[r++],t[r++]),je(D1e,$1e,NW),je(N1e,L1e,NW),Wt(n,N1e,D1e),Ye(n,n)}const vC=W();function FCt(t,e,i,r,n,s){const o=t.stageObject,l=o.geometries,c=l.length,f=e.mode!=="absolute-height";let _=0;const x=o.transformation,T=sP(Qe(),x);for(let A=0;A=Y||Math.abs(vC[1]-I[k+1])>=Y||Math.abs(vC[2]-I[k+2])>=Y)&&(U=!0),F.offset+=3,k+=3}U&&(M.invalidateBoundingInfo(),o.geometryVertexAttributeUpdated(l[A],J.POSITION),l[A+1].invalidateBoundingInfo(),o.geometryVertexAttributeUpdated(l[A+1],J.POSITION)),_+=j/z}return _/c}const lh=W(),bu=W(),zN=new r6,F1e=[0,2,1],k1e=[0,1,2],kCt=.01;var jd;(function(t){t[t.Main=0]="Main",t[t.Bottom=1]="Bottom"})(jd||(jd={}));let zCt=class{constructor(e,i,r,n){this.positions=e,this.elevation=i,this.normals=r,this.heights=n}};function UCt(t){return typeof t=="function"}function Uli(t,e,i,r){return UCt(t)?t(e,i,r):t}function Vli(t){return[t.r,t.g,t.b,t.a]}const VCt=` /-, +`;function z1e(t){let e=t.length;for(;e--;)if(!VCt.includes(t.charAt(e)))return!1;return!0}function BCt(t,e){const i=[];let r=0,n=-1;do if(n=t.indexOf("[",r),n>=r){if(n>r){const s=t.substr(r,n-r);i.push([s,null,z1e(s)])}if(r=n+1,n=t.indexOf("]",r),n>=r){if(n>r){const s=e[t.substr(r,n-r)];s&&i.push([null,s,!1])}r=n+1}}while(n!==-1);if(rjCt(n,r,i)}function GCt(t,e){switch(typeof t!="string"&&(t=String(t)),e){case"LowerCase":return t.toLowerCase();case"Allcaps":return t.toUpperCase();default:return t}}function jli(t,e,i,r,n,s,o=!0){const l=e/n,c=i/s,f=Math.ceil(l/2),_=Math.ceil(c/2);for(let x=0;x=-1&&ce<=1&&(M=2*ce*ce*ce-3*ce*ce+1,M>0&&(he=4*(re+H*e),U+=M*t[he+3],L+=M,t[he+3]<255&&(M=M*t[he+3]/250),F+=M*t[he],z+=M*t[he+1],k+=M*t[he+2],I+=M))}}r[A]=F/I,r[A+1]=z/I,r[A+2]=k/I,r[A+3]=U/L}}function KNe(t){return t?{r:t[0],g:t[1],b:t[2],a:t[3]/255}:{r:0,g:0,b:0,a:0}}function QNe(t){var e;return((e=t.data)==null?void 0:e.symbol)??null}function mie(t){return t.type==="CIMVectorMarker"||t.type==="CIMPictureMarker"||t.type==="CIMBarChartMarker"||t.type==="CIMCharacterMarker"||t.type==="CIMPieChartMarker"||t.type==="CIMStackedBarChartMarker"}function gie(t){return t.type==="CIMGradientStroke"||t.type==="CIMPictureStroke"||t.type==="CIMSolidStroke"}function HCt(t){return t!=null&&(t.type==="CIMGradientFill"||t.type==="CIMHatchFill"||t.type==="CIMPictureFill"||t.type==="CIMSolidFill"||t.type==="CIMWaterFill")}function JU(t){return t!=null&&(t.type==="CIMMarkerPlacementAlongLineRandomSize"||t.type==="CIMMarkerPlacementAlongLineSameSize"||t.type==="CIMMarkerPlacementAlongLineVariableSize"||t.type==="CIMMarkerPlacementAtExtremities"||t.type==="CIMMarkerPlacementAtMeasuredUnits"||t.type==="CIMMarkerPlacementAtRatioPositions"||t.type==="CIMMarkerPlacementOnLine"||t.type==="CIMMarkerPlacementOnVertices")}const Gli=(t,e=0)=>t==null||isNaN(t)?e:t,Hli=t=>t.tintColor?KNe(t.tintColor):{r:255,g:255,b:255,a:1},qli=t=>{if(!t)return!1;for(const e of t)switch(e.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":case"CIMGeometricEffectDonut":return!0}return!1};function Wli(){return we(()=>import("./geometryEngineJSON-FxYgI0L3.js").then(t=>t.g),__vite__mapDeps([131,93]))}function Yli(t){if(!t)return"normal";switch(t.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function Xli(t){if(!t)return"normal";switch(t.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function Zli(t){let e="normal",i="normal";if(t){const r=t.toLowerCase();r.includes("italic")?e="italic":r.includes("oblique")&&(e="oblique"),r.includes("bold")?i="bold":r.includes("light")&&(i="lighter")}return{style:e,weight:i}}function Jli(t){return t.underline?"underline":t.strikethrough?"line-through":"none"}function U1e(t){if(!t)return null;switch(t.type){case"CIMPolygonSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const i=U1e(e);if(i!=null)return i}break;case"CIMTextSymbol":return U1e(t.symbol);case"CIMSolidFill":return t.color}}function V1e(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":{const e=t.symbolLayers;if(e)for(const i of e){const r=V1e(i);if(r!=null)return r}break}case"CIMTextSymbol":return V1e(t.symbol);case"CIMSolidStroke":return t.color}}function B1e(t){if(t)switch(t.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(t.symbolLayers)for(const e of t.symbolLayers){const i=B1e(e);if(i!==void 0)return i}break;case"CIMTextSymbol":return B1e(t.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return t.width}}function Kli(t){switch(t){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function Qli(t){switch(t){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function eci(t){return(t?Object.keys(t):[]).map(e=>({name:e,alias:e,type:typeof t[e]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const tci=t=>t.includes("data:image/svg+xml");function ici(t){if(!t)return null;switch(t.type){case"CIMPointSymbol":case"CIMTextSymbol":return"esriGeometryPoint";case"CIMLineSymbol":return"esriGeometryPolyline";case"CIMPolygonSymbol":return"esriGeometryPolygon";default:return null}}function e8e(t,e,i,r){if(t)if(t.type!=="CIMTextSymbol"){if(i&&t.effects)for(const n of t.effects)YCt(n,e);if(t.symbolLayers)for(const n of t.symbolLayers)switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":qCt(n,e,r);break;case"CIMPictureStroke":case"CIMSolidStroke":!(r!=null&&r.preserveOutlineWidth)&&n.width&&(n.width*=e);break;case"CIMPictureFill":n.height&&(n.height*=e),n.offsetX&&(n.offsetX*=e),n.offsetY&&(n.offsetY*=e);break;case"CIMHatchFill":e8e(n.lineSymbol,e,!0,{...r,preserveOutlineWidth:!1}),n.offsetX&&(n.offsetX*=e),n.offsetY&&(n.offsetY*=e),n.separation&&(n.separation*=e)}}else t.height!=null&&(t.height*=e)}function qCt(t,e,i){if(t&&(t.markerPlacement&&WCt(t.markerPlacement,e),t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e),t.anchorPoint&&t.anchorPointUnits==="Absolute"&&(t.anchorPoint={x:t.anchorPoint.x*e,y:t.anchorPoint.y*e}),t.size=t.size!=null?t.size*e:0,t.type==="CIMVectorMarker"&&t.markerGraphics))for(const r of t.markerGraphics)t.scaleSymbolsProportionally||e8e(r.symbol,e,!0,i)}function WCt(t,e){switch(JU(t)&&t.offset&&(t.offset*=e),t.type){case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineSameSize":if(t.customEndingOffset&&(t.customEndingOffset*=e),t.offsetAlongLine&&(t.offsetAlongLine*=e),t.placementTemplate&&t.placementTemplate.length){const i=t.placementTemplate.map(r=>r*e);t.placementTemplate=i}break;case"CIMMarkerPlacementAlongLineVariableSize":if(t.maxRandomOffset&&(t.maxRandomOffset*=e),t.placementTemplate&&t.placementTemplate.length){const i=t.placementTemplate.map(r=>r*e);t.placementTemplate=i}break;case"CIMMarkerPlacementOnLine":t.startPointOffset&&(t.startPointOffset*=e);break;case"CIMMarkerPlacementAtExtremities":t.offsetAlongLine&&(t.offsetAlongLine*=e);break;case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementOnVertices":break;case"CIMMarkerPlacementAtRatioPositions":t.beginPosition&&(t.beginPosition*=e),t.endPosition&&(t.endPosition*=e);break;case"CIMMarkerPlacementPolygonCenter":t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e);break;case"CIMMarkerPlacementInsidePolygon":t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e),t.stepX&&(t.stepX*=e),t.stepY&&(t.stepY*=e)}}function YCt(t,e){switch(t.type){case"CIMGeometricEffectArrow":case"CIMGeometricEffectDonut":t.width&&(t.width*=e);break;case"CIMGeometricEffectBuffer":t.size&&(t.size*=e);break;case"CIMGeometricEffectCut":t.beginCut&&(t.beginCut*=e),t.endCut&&(t.endCut*=e),t.middleCut&&(t.middleCut*=e);break;case"CIMGeometricEffectDashes":if(t.customEndingOffset&&(t.customEndingOffset*=e),t.offsetAlongLine&&(t.offsetAlongLine*=e),t.dashTemplate&&t.dashTemplate.length){const i=t.dashTemplate.map(r=>r*e);t.dashTemplate=i}break;case"CIMGeometricEffectExtension":case"CIMGeometricEffectJog":case"CIMGeometricEffectRadial":t.length&&(t.length*=e);break;case"CIMGeometricEffectMove":t.offsetX&&(t.offsetX*=e),t.offsetY&&(t.offsetY*=e);break;case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":t.offset&&(t.offset*=e);break;case"CIMGeometricEffectRegularPolygon":t.radius&&(t.radius*=e);break;case"CIMGeometricEffectTaperedPolygon":t.fromWidth&&(t.fromWidth*=e),t.length&&(t.length*=e),t.toWidth&&(t.toWidth*=e);break;case"CIMGeometricEffectWave":t.amplitude&&(t.amplitude*=e),t.period&&(t.period*=e)}}function t8e(t){const e=[];return yie(QNe(t),e),e.length?new qe(KNe(e[0])):null}function yie(t,e){var n;if(!t)return;let i;i=t.type==="CIMTextSymbol"?t.symbol:t;const r=t.type==="CIMPolygonSymbol";if(i!=null&&i.symbolLayers){for(const s of i.symbolLayers)if(!(s.colorLocked||r&&(gie(s)||mie(s)&&s.markerPlacement&&JU(s.markerPlacement))))switch(s.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":s.tintColor&&j1e(e,s.tintColor);break;case"CIMVectorMarker":(n=s.markerGraphics)==null||n.forEach(o=>{yie(o.symbol,e)});break;case"CIMSolidStroke":case"CIMSolidFill":j1e(e,s.color);break;case"CIMHatchFill":yie(s.lineSymbol,e)}}}function j1e(t,e){for(const i of t)if(i.join(".")===e.join("."))return;t.push(e)}function i8e(t,e,i){e instanceof qe||(e=new qe(e));const r=QNe(t);r&&vie(r,e,i)}function vie(t,e,i){var s;if(!t)return;let r;r=t.type==="CIMTextSymbol"?t.symbol:t;const n=(r==null?void 0:r.type)==="CIMPolygonSymbol";if(r!=null&&r.symbolLayers)for(const o of r.symbolLayers){if(o.colorLocked)continue;if(n){if(i){const{layersToColor:c}=i;if((gie(o)||mie(o)&&o.markerPlacement&&JU(o.markerPlacement))&&c==="fill"||HCt(o)&&c==="outline")continue}else if(gie(o)||mie(o)&&o.markerPlacement&&JU(o.markerPlacement))continue}const l=e.toArray();switch(o.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":o.tintColor=l;break;case"CIMVectorMarker":(s=o.markerGraphics)==null||s.forEach(c=>{vie(c.symbol,e,i)});break;case"CIMSolidStroke":case"CIMSolidFill":o.color=l;break;case"CIMHatchFill":vie(o.lineSymbol,e,i)}}}const r8e="picture-fill",n8e="simple-fill",XCt="simple-line",s8e="simple-marker",ZCt="text",JCt="cim",FW=new qB(1e3);function KCt(t){const e=t.style;let i=null;if(t)switch(t.type){case s8e:e!=="cross"&&e!=="x"&&(i=t.color);break;case n8e:e==="solid"?i=t.color:e!=="none"&&(i={type:"pattern",x:0,y:0,src:Wr(`esri/symbols/patterns/${e}.png`),width:5,height:5});break;case r8e:i={type:"pattern",src:t.url,width:Tr(t.width)*t.xscale,height:Tr(t.height)*t.yscale,x:Tr(t.xoffset),y:Tr(t.yoffset)};break;case ZCt:i=t.color;break;case JCt:i=t8e(t)}return i}function QCt(t,e){const i=t+"-"+e;return FW.get(i)!==void 0?Promise.resolve(FW.get(i)):bi(t,{responseType:"image"}).then(r=>{const n=r.data,s=n.naturalWidth,o=n.naturalHeight,l=document.createElement("canvas");l.width=s,l.height=o;const c=l.getContext("2d");c.fillStyle=e,c.fillRect(0,0,s,o),c.globalCompositeOperation="destination-in",c.drawImage(n,0,0);const f=l.toDataURL();return FW.put(i,f),f})}function HL(t){if(!t)return null;let e=null;switch(t.type){case n8e:case r8e:case s8e:e=HL(t.outline);break;case XCt:{const i=Tr(t.width);t.style!=null&&t.style!=="none"&&i!==0&&(e={color:t.color,style:nce(t.style),width:i,cap:t.cap,join:t.join==="miter"?Tr(t.miterLimit):t.join});break}default:e=null}return e}const nce=(()=>{const t={};return e=>{if(t[e])return t[e];const i=e.replaceAll("-","");return t[e]=i,i}})(),eAt=new qe([128,128,128]),tAt=new qe("white");function iAt(t){var i,r;const e=(i=t.symbolLayers)==null?void 0:i.at(-1);if(e&&"outline"in e)return(r=e==null?void 0:e.outline)==null?void 0:r.size}function rAt(t){var e;if(!t)return 0;if(Hy(t)){const i=iAt(t);return i??0}return ad((e=HL(t))==null?void 0:e.width)}function fG(t){if(t==null||!("symbolLayers"in t)||t.symbolLayers==null)return!1;switch(t.type){case"point-3d":return t.symbolLayers.some(e=>e.type==="object");case"line-3d":return t.symbolLayers.some(e=>e.type==="path");case"polygon-3d":return t.symbolLayers.some(e=>e.type==="object"||e.type==="extrude");default:return!1}}function o8e(t){var e;return((e=t.resource)==null?void 0:e.href)??""}function _C(t,e){if(!t)return null;let i=null;return Hy(t)?i=nAt(t):VB(t)&&(i=t.type==="cim"?t8e(t):t.color?new qe(t.color):null),i?qL(i,e):null}function nAt(t){const e=t.symbolLayers;if(!e)return null;let i=null;return e.forEach(r=>{var n;r.type==="object"&&((n=r.resource)!=null&&n.href)||(i=r.type==="water"?r.color:r.material?r.material.color:null)}),i?new qe(i):null}function qL(t,e){if(e==null||t==null)return t;const i=t.toRgba();return i[3]=i[3]*e,new qe(i)}function sAt(t,e,i){const r=t.symbolLayers;if(!r)return;const n=s=>qL(e=e??s??(i!=null?tAt:null),i);r.forEach(s=>{var o,l;if(s.type!=="object"||!((o=s.resource)!=null&&o.href)||e)if(s.type==="water")s.color=n(s.color);else{const c=s.material!=null?s.material.color:null,f=n(c);s.material==null?s.material=new mp({color:f}):s.material.color=f,i!=null&&"outline"in s&&((l=s.outline)==null?void 0:l.color)!=null&&(s.outline.color=qL(s.outline.color,i))}})}function oAt(t,e,i){var r;(e=e??t.color)&&(t.color=qL(e,i)),i!=null&&"outline"in t&&((r=t.outline)!=null&&r.color)&&(t.outline.color=qL(t.outline.color,i))}function kW(t,e,i){t&&(e||i!=null)&&(e&&(e=new qe(e)),Hy(t)?sAt(t,e,i):VB(t)&&oAt(t,e,i))}async function aAt(t,e){const i=t.symbolLayers;i&&await JV(i,async r=>lAt(r,e))}async function lAt(t,e){switch(t.type){case"extrude":uAt(t,e);break;case"icon":case"line":case"text":cAt(t,e);break;case"path":dAt(t,e);break;case"object":await hAt(t,e)}}function cAt(t,e){const i=a8e(e);i!=null&&(t.size=i)}function a8e(t){for(const e of t)if(typeof e=="number")return e;return null}function uAt(t,e){t.size=typeof e[2]=="number"?e[2]:0}async function hAt(t,e){const{resourceSize:i,symbolSize:r}=await pAt(t),n=l8e(e,i,r);t.width=M$(e[0],r[0],i[0],n),t.depth=M$(e[1],r[1],i[1],n),t.height=M$(e[2],r[2],i[2],n)}function dAt(t,e){const i=l8e(e,Bv,[t.width,void 0,t.height]);t.width=M$(e[0],t.width,1,i),t.height=M$(e[2],t.height,1,i)}function l8e(t,e,i){for(let r=0;r<3;r++){const n=t[r];switch(n){case"symbol-value":{const s=i[r];return s!=null?s/e[r]:1}case"proportional":break;default:if(n&&e[r])return n/e[r]}}return 1}async function pAt(t){const{computeObjectLayerResourceSize:e}=await we(()=>import("./symbolLayerUtils-VVngrYnW.js"),__vite__mapDeps([])),i=await e(t,10),{width:r,height:n,depth:s}=t,o=[r,s,n];let l=1;for(let c=0;c<3;c++){const f=o[c];if(f!=null){l=f/i[c];break}}for(let c=0;c<3;c++)o[c]==null&&(o[c]=i[c]*l);return{resourceSize:i,symbolSize:o}}function M$(t,e,i,r){switch(t){case"proportional":return i*r;case"symbol-value":return e??i;default:return t}}function fAt(t,e){const i=a8e(e);if(i!=null)switch(t.type){case"simple-marker":t.size=i;break;case"picture-marker":{const r=t.width/t.height;r>1?(t.width=i,t.height=i*r):(t.width=i*r,t.height=i);break}case"simple-line":t.width=i;break;case"text":t.font.size=i}}async function mAt(t,e){if(t&&e)return Hy(t)?aAt(t,e):void(VB(t)&&fAt(t,e))}function gAt(t,e,i){if(t&&e!=null)if(Hy(t)){const r=t.symbolLayers;r&&r.forEach(n=>{if(n&&n.type==="object")switch(i){case"tilt":n.tilt=e;break;case"roll":n.roll=e;break;default:n.heading=e}})}else VB(t)&&(t.type!=="simple-marker"&&t.type!=="picture-marker"&&t.type!=="text"||(t.angle=e))}function WL(t){if(!t)return null;const e=t.effects.filter(i=>i.type!=="bloom").map(i=>i.toJSON());return Uz(e)}function rci(t){return t!=null&&t.type==="polygon-3d"&&t.symbolLayers.some(e=>e.type==="extrude")}async function yAt(t,e){return await t.fetchSymbol(e)||t.fetchCIMSymbol(e)}function vAt(t,e,i,r,n){if(t==null)return null;const s=t.referencesGeometry()&&n?_At(e,r,n):e,o=t.repurposeFeature(s);try{return t.evaluate({...i,$feature:o},t.services)}catch(l){return Ce.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",l),null}}const zW=new Map;function _At(t,e,i){const{transform:r,hasZ:n,hasM:s}=i;zW.has(e)||zW.set(e,bAt(e));const o=zW.get(e)(t.geometry,r,n,s);return{...t,geometry:o}}function bAt(t){const e={};switch(t){case"esriGeometryPoint":return(i,r,n,s)=>UDe(r,e,i,n,s);case"esriGeometryPolygon":return(i,r,n,s)=>VDe(r,e,i,n,s);case"esriGeometryPolyline":return(i,r,n,s)=>BDe(r,e,i,n,s);case"esriGeometryMultipoint":return(i,r,n,s)=>zDe(r,e,i,n,s);default:return Ce.getLogger("esri.views.2d.support.arcadeOnDemand").error(new se("mapview-arcade",`Unable to handle geometryType: ${t}`)),i=>i}}const nci=1.2,wAt=gp,xAt=4;let mG=class{constructor(e,i,r,n){this.graphics3DSymbolLayer=e,this.renderGeometries=i,this.boundingBox=r,this._drapeSourceRenderer=n,this.type="draped",this.stage=null,this._visible=!1,this._addedToStage=!1,this.isElevationSource=!1}initialize(e){this.stage=e.stage}setVisibility(e){if(this.stage!=null&&this._visible!==e){if(this._visible=e,e&&!this._addedToStage)return this._addedToStage=!0,void this._drapeSourceRenderer.addGeometries(this.renderGeometries,ds.ADD);if(e||this._addedToStage){for(const i of this.renderGeometries)i.visible=this._visible;this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,ca.VISIBILITY)}}}destroy(){this.stage&&this._addedToStage&&this._drapeSourceRenderer.removeGeometries(this.renderGeometries,ds.REMOVE),this._addedToStage=!1,this._visible=!1,this.stage=null}getCenterObjectSpace(e=W()){return Ie(e,0,0,0)}getBoundingBoxObjectSpace(e=ya()){return Bn(e)}addObjectState(e,i){e===S_.Highlight&&(this.renderGeometries.forEach(r=>{const n=r.geometry.addHighlight();i.addRenderGeometry(r,n,this)}),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,ca.HIGHLIGHT))}removeObjectState(e){this.renderGeometries.forEach(i=>{e.removeRenderGeometry(i)})}removeRenderGeometryObjectState(e,i){e.geometry.removeHighlight(i),this._addedToStage&&this._drapeSourceRenderer.modifyGeometries(this.renderGeometries,ca.HIGHLIGHT)}computeAttachmentOrigin(e){for(const i of this.renderGeometries)i.geometry.computeAttachmentOrigin(bC)&&(e.draped.origin[0]+=bC[0],e.draped.origin[1]+=bC[1],e.draped.num++)}async getProjectedBoundingBox(e,i,r,n,s){Bn(s);for(let o=0;o{let t="";for(let e=32;e<127;e++)t+=String.fromCharCode(e);return t})(),QU=1;let u8e=class{constructor(e,i,r,n){this.text=e,this._alignment=i,this._parameters=r,this._maxSize=n,this._textWidths=[],this._lineWidths=[],this._renderPixelRatio=null,this._metricsCached=null,this.key=`TextRenderer-${this._parameters.key}-${this._alignment}--${e}`,this._lines=e.replaceAll(" "," ").split(/\r?\n/)}get displayWidth(){return Math.ceil(this._displayWidth+2*this._horizontalPadding)}get displayHeight(){let e=this._metrics.firstLineAscent;for(let i=0;i{const M=e.measureText(T),I=M.width,L=I+i;this._textWidths.push(I),this._lineWidths.push(L),o=Math.max(o,L),l=Math.max(l,M.actualBoundingBoxAscent),c=Math.max(c,M.actualBoundingBoxDescent),A===0&&(n=M),A===this._lines.length-1&&(s=M)});const f=c8e(this._parameters);l=Math.max(l,f.maxAscent),c=Math.max(c,f.maxDescent);const _=n.actualBoundingBoxAscent,x=this._parameters.definition.font.decoration==="underline"?c:s.actualBoundingBoxDescent;this._metricsCached=new AAt(_,x,l,c,o)}return this._metricsCached}get _lineSpacing(){return(this._midLineHeight+this._linePadding)*this._parameters.definition.lineSpacingFactor}get _midLineHeight(){return this._metrics.midLineHeight}get _linePadding(){return this._midLineHeight*CAt}get _midLineAscent(){return this._metrics.maxLineAscent}get _renderedFontSize(){return this._toRenderUnit(this._fontSize)}get _fontSize(){return this._parameters.definition.size}get _renderedHaloSize(){return this._toRenderUnit(this._haloSize)}get _haloSize(){return this._parameters.haloSize}get _horizontalPadding(){return this._hasBackground?this._parameters.definition.background.padding[0]:0}get _verticalPadding(){return Math.max(this._hasBackground?this._parameters.definition.background.padding[1]:0,QU)}get _hasBackground(){return!!this._parameters.backgroundStyle}get renderPixelRatio(){if(this._renderPixelRatio==null){const e=this._parameters.definition.pixelRatio;this._renderPixelRatio=Math.min(e,Math.min(this._maxSize[0]/this.displayWidth,this._maxSize[1]/this.displayHeight))}return this._renderPixelRatio}_getLineXOffset(e){switch(this._alignment){case w2.Left:return this._horizontalPadding;case w2.Center:return(this.displayWidth-this._lineWidths[e])/2;case w2.Right:return this.displayWidth-this._horizontalPadding-this._lineWidths[e]}}render(e,i,r){e.save();const n=i/=this.renderPixelRatio,s=r/=this.renderPixelRatio,o=this._haloSize,l=this._firstLineYOffset+this._metrics.firstLineAscent;i+=o,r+=l;const c=this._haloSize>0;c&&this._renderHalo(e,n,s,o,l),this._parameters.setFontProperties(e,this._renderedFontSize);for(let f=0;fCEt(i));this._textureHandle=s,e.textureId=s.texture.id}e.textureIsSignedDistanceField=!0,e.sampleSignedDistanceFieldTexelCenter=EEt(i),e.distanceFieldBoundingBox=DAt;const n=this._getIconSize();this._size=[n,n],this._symbolTextureRatio=1/eT,this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesHref(e,i,r){this._outlineSize=this._getOutlineSize(),e.color=this._getFillColor(),e.outlineColor=this._getOutlineColor(),e.outlineSize=this._outlineSize,e.textureIsSignedDistanceField=!1;const n=this._getIconSize(),s=n*this._context.graphicsCoreOwner.view.state.rasterPixelRatio;if(this._context.sharedResources.textures!=null){const o=await Ju(this._context.sharedResources.textures.fromUrl(i,s,{signal:r}));if(o.ok===!1)throw zo(o.error),new se("graphics3diconsymbollayer:request-failed",`Failed to load (Request for icon resource failed: ${i})`);this._textureHandle=o.value;const l=o.value.texture,c=l.parameters.width/l.parameters.height;this._size=c>1?[n,Math.round(n/c)]:[Math.round(n*c),n],e.textureId=l.id}this._createMaterialAndAddToStage(e,this._context.stage)}async _prepareResourcesCIM(e,i,r){const n=new nx({data:i});if(!this._context.sharedResources.cimSymbolRasterizer){const _=(await we(()=>import("./CIMSymbolRasterizer-o8gx_uXl.js"),__vite__mapDeps([230,231,142,121,122,145,155,206]))).CIMSymbolRasterizer;St(r),this._context.sharedResources.cimSymbolRasterizer||(this._context.sharedResources.cimSymbolRasterizer=new _(this._context.renderCoordsHelper.spatialReference,!0))}const s=this._context.layer.fields?this._context.layer.fields.map(_=>_.toJSON()):null;let o,l;if(this._cimLayers=await this._context.sharedResources.cimSymbolRasterizer.analyzeCIMSymbol3D(n,s,this._context.renderer&&this._context.renderer.type==="dictionary"?this._context.renderer.fieldMap:null,"esriGeometryPoint",{signal:r}),this._context.renderer&&this._context.renderer.type==="dictionary"&&this._context.renderer.scaleExpression){const _=this._context.renderer;if(isNaN(_.scaleExpression)){const x=_.scaleExpression,T=await rit(x,this._context.layer.spatialReference,s);l=(A,M,I)=>{const L=vAt(T,A,{$view:I},"esriGeometryPoint",M);return L!==null?L:1}}else o=Number(_.scaleExpression)}this._cimScaleFactorOrFunction=o||l||1;const c=this._context.renderer?await this._context.renderer.getRequiredFields(this._context.layer.fieldsIndex):[];St(r);const f=this._context.layer.fieldsIndex;this._cimRequiredFields=c.map(_=>f.get(_).name),this._cimMaterialParametersInfo=e,this._cimMaterialParametersInfo.color=this._getFillColor(),this._cimMaterialParametersInfo.outlineColor=[0,0,0,0],this._cimMaterialParametersInfo.outlineSize=0,this._cimMaterialParametersInfo.textureIsSignedDistanceField=!1}_getPrimitive(){return this.symbolLayer.resource&&this.symbolLayer.resource.href?null:this.symbolLayer.resource&&this.symbolLayer.resource.primitive||iOe}_getOutlineSize(){var r;let e=0;const i=this.symbolLayer;return((r=i.outline)==null?void 0:r.size)!=null?Math.max(Tr(i.outline.size),0):(e=UW(this._getPrimitive())?LAt:0,Math.max(e,0))}_getOutlineColor(){var n;const e=this._getLayerOpacity(),i=this.symbolLayer,r=(n=i==null?void 0:i.outline)==null?void 0:n.color;if(r!=null){const s=qe.toUnitRGB(r),o=r.a*e;return[s[0],s[1],s[2],o]}return[0,0,0,0]}_getFillColor(){var r,n;if(UW(this._getPrimitive()))return wAt;const e=this._getPrimitive()==null,i=(n=(r=this.symbolLayer)==null?void 0:r.material)==null?void 0:n.color;return this._getCombinedOpacityAndColor(i,{hasIntrinsicColor:e})}_getAnchorPos(e,i){return e==="relative"?Ji((i.x||0)+.5,.5-(i.y||0)):e in nk?nk[e]:nk.center}_createMaterialAndAddToStage(e,i){if(this._cimLayers){this._fastUpdates=null;let r=e.textureId?this._cimSymbolMaterials.get(e.textureId):null;return r||(r=new O5(e),this._cimSymbolMaterials.set(e.textureId??0,r),i.add(r)),r}return this._fastUpdates=C5(this._context.renderer,this._fastVisualVariableConvertOptions()),this._fastUpdates&&(e={...e,...this._fastUpdates.materialParameters}),this._materials[0]=new O5(e),i.add(this._materials[0]),this._materials[0]}_setDrapingDependentMaterialParameters(){this.draped&&(this._forEachMaterial(e=>{e.setParameters({verticalOffset:null,screenSizePerspective:null,occlusionTest:!1,hasSlicePlane:!1,shaderPolygonOffset:0,isDraped:this.draped})}),this.layerOpacityChanged())}destroy(){super.destroy(),this._forEachMaterial(e=>this._context.stage.remove(e)),this._materials.length=0,this._cimSymbolMaterials.clear(),this._cimSymbolTextures.forEach(e=>this._context.stage.remove(e)),this._cimSymbolTextures.clear(),this._textureHandle=ir(this._textureHandle)}_getScaleFactor(e,i){if(this._drivenProperties.size&&e.size){for(let r=0;r<3;r++){const n=e.size[r];n&&n!=="symbol-value"&&n!=="proportional"&&(e.size[r]=Tr(n))}if(e.size[0]==="symbol-value")return 1;if(isFinite(+e.size[0]))return+e.size[0]/i;if(isFinite(+e.size[2]))return+e.size[2]/i}return 1}createGraphics3DGraphic(e){var x;const i=e.graphic;if(!this._validateGeometry(i.geometry))return null;let r,n=[0,0];if(this._cimLayers){if(!this._cimLayers.length)return null;const T=this._generateTextureCIM(i),A={textureId:T.id,...this._cimMaterialParametersInfo};r=this._createMaterialAndAddToStage(A,this._context.stage),n=[T.parameters.width,T.parameters.height]}else n=this._size,r=this._materials[0];const s=UL(i.geometry);if(s==null)return this.logger.warn(`unsupported geometry type for icon symbol: ${i.geometry.type}`),null;const o=e.renderingInfo,l=this._getVertexOpacityAndColor(o);let c=1;if(!((x=this._fastUpdates)!=null&&x.visualVariables.size)){const T=n[0]>n[1]?n[0]:n[1];c=this._getScaleFactor(o,T)}c*=this._symbolTextureRatio;const f=Ji(n[0]*c,n[1]*c),_=this.setGraphicElevationContext(i);return this.ensureDrapedStatus(_.mode==="on-the-ground")&&this._setDrapingDependentMaterialParameters(),this.draped?this._createAsOverlay(i,s,r,l,f,e.layer.uid):this._createAs3DShape(i,s,r,l,f,_,i.uid)}layerOpacityChanged(){const e=this._getFillColor(),i=this._getOutlineColor();this._forEachMaterial(r=>{r.setParameters({color:e}),r.setParameters({outlineColor:i})})}layerElevationInfoChanged(e,i,r){const n=this._elevationContext.mode,s=i6(p8e.elevationModeChangeTypes,r,n);if(s!==Ys.UPDATE)return s;const o=t0(n)||n==="absolute-height";return this.updateGraphics3DGraphicElevationInfo(e,i,()=>o)}slicePlaneEnabledChanged(){return this.draped||this._forEachMaterial(e=>{e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return this._getPrimitive()!=null}applyRendererDiff(e,i){var r;for(const n in e.diff){if(n!=="visualVariables"||!A5(this._fastUpdates,i,this._fastVisualVariableConvertOptions()))return To.RecreateSymbol;(r=this._materials[0])==null||r.setParameters(this._fastUpdates.materialParameters)}return To.FastUpdate}_defaultElevationInfoNoZ(){return kAt}_createAs3DShape(e,i,r,n,s,o,l){const c=this.getFastUpdateAttrValues(e),f=this._context.layer.uid,_=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:l,layerUid:f}),x=Rte(r,X1e,null,n,s,zAt,null,c,_),T=$le(this._context,i,x,o,l);if(T==null)return null;const A=new d1(this,T.object,[x],null,null,_T,o);return A.alignedSampledElevation=T.sampledElevation,A.needsElevationUpdates=t0(o.mode)||o.mode==="absolute-height",A.getScreenSize=this._createScreenSizeGetter(s,c),A.calculateRelativeScreenBounds=M=>r.calculateRelativeScreenBounds(A.getScreenSize(),1,M),zL(A,i,this._context.elevationProvider),A}_createAsOverlay(e,i,r,n,s,o){r.renderPriority=this._renderPriority;const l=Xi();ud(i,l,this._context.overlaySR),l[2]=tce;const c=this._context.clippingExtent;if(c!=null&&!$se(c,l))return null;const f=this.getFastUpdateAttrValues(e),_=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:e.uid,layerUid:this._context.layer.uid}),x=Rte(r,X1e,l,n,s,null,null,f,_),T=new $5(x,{layerUid:o,graphicUid:e.uid}),A=new mG(this,[T],null,this._context.drapeSourceRenderer);return A.getScreenSize=this._createScreenSizeGetter(s,f),A.calculateRelativeScreenBounds=M=>r.calculateRelativeScreenBounds(A.getScreenSize(),1,M),A}_createScreenSizeGetter(e,i){const r=this._outlineSize+2;if(this._fastUpdates&&i){const o=e[0]/this._symbolTextureRatio,l=e[1]/this._symbolTextureRatio;return(c=yt())=>{const[f,_]=dle(UAt,this._fastUpdates.materialParameters,i);return c[0]=f*o+r,c[1]=_*l+r,c}}const n=e[0]/this._symbolTextureRatio+r,s=e[1]/this._symbolTextureRatio+r;return(o=yt())=>(o[0]=n,o[1]=s,o)}_fastVisualVariableConvertOptions(){const e=Math.max(this._size[0],this._size[1]),i=nt(e,e,e),r=ad(1),n=e*r,s=nt(n,n,n);return new K9({size:!0,color:!0,rotation:!0,opacity:!1},i,s,r)}_getGraphicHash(e){let i="";for(const r of this._cimRequiredFields)i+=r+e.attributes[r];return i}_forEachMaterial(e){this._materials.forEach(e),this._cimSymbolMaterials.forEach(e)}test(){return{...super.test(),material:this._materials[0]}}};function FAt(t){return t&&t.type==="point-3d"&&t.hasVisibleVerticalOffset()}function UW(t){return t!=null&&(t==="cross"||t==="x")}_ie.PRIMITIVE_SIZE=NAt,_ie.elevationModeChangeTypes={definedChanged:Ys.UPDATE,staysOnTheGround:Ys.NONE,onTheGroundChanged:Ys.RECREATE};const kAt={mode:"relative-to-ground",offset:0},zAt=Mi(0,0,0,1),UAt=W();function bie(t){switch(t){case"butt":return Df.BUTT;case"square":return Df.SQUARE;case"round":return Df.ROUND;default:return null}}function Z1e(t){return t==="diamond"?"kite":t}function wie(t,e,i=null){const r=[],n=e.mapPositions;VAt(e,r);const s=r[0][1].data,o=r[0][1].indices.length,l=ux(o);return BAt(e,r,l),HAt(e,r,l),jAt(e,r,l),GAt(e,r,l),qAt(e,r,l),WAt(e,r,l),YAt(e,r,s),new Bo(t,r,n,Ws.Line,i)}function VAt(t,e){const{attributeData:{position:i},removeDuplicateStartEnd:r}=t,n=XAt(i)&&r,s=i.length/3-(n?1:0),o=new Array(2*(s-1)),l=n?i.slice(0,-3):i;let c=0;for(let f=0;f{const n=r.length,s=Ja(3*n);r.forEach((l,c)=>{s[3*c]=l[0],s[3*c+1]=l[1],s[3*c+2]=l[2]});const o={attributeData:{position:s,normal:e},removeDuplicateStartEnd:!1};i.push(o)}),i}function KAt(t,e,i,r){const n=t.type==="polygon"?Ky.CCW_IS_HOLE:Ky.NONE,s=t.type==="polygon"?t.rings:t.paths,{position:o,outlines:l}=c6(s,!!t.hasZ,n,t.spatialReference),c=Ja(o.length),f=A6e(o,t.spatialReference,0,c,0,o,0,o.length/3,e,i,r),_=f!=null;return{lines:_?f8e(l,o,c):[],projectionSuccess:_,sampledElevation:f}}function QAt(t,e){const i=t.type==="polygon"?Ky.CCW_IS_HOLE:Ky.NONE,r=t.type==="polygon"?t.rings:t.paths,{position:n,outlines:s}=c6(r,!1,i),o=vn(n,t.spatialReference,0,n,e,0,n.length/3);for(let l=2;ll.camera.nearFar),new gr("viewport",(o,l)=>l.camera.fullViewport)),n.code.add(V`vec4 projectAndScale(vec4 pos) { +vec4 posNdc = proj * pos; +posNdc.xy *= viewport.zw / posNdc.w; +return posNdc; +}`),n.code.add(V`void clip(vec4 pos, inout vec4 prev) { +float vnp = nearFar[0] * 0.99; +if (prev.z > -nearFar[0]) { +float interpolation = (-vnp - pos.z) / (prev.z - pos.z); +prev = mix(pos, prev, interpolation); +} +}`),r?(e.attributes.add(J.NORMAL,"vec3"),S5(n),n.constants.add("tiltThreshold","float",.7),n.code.add(V`vec3 perpendicular(vec3 v) { +vec3 n = (viewNormal * vec4(normal.xyz, 1.0)).xyz; +vec3 n2 = cross(v, n); +vec3 forward = vec3(0.0, 0.0, 1.0); +float tiltDot = dot(forward, n); +return abs(tiltDot) < tiltThreshold ? n : n2; +}`)):n.code.add(V`vec2 perpendicular(vec2 v) { +return vec2(v.y, -v.x); +}`),n.code.add(V` + #define vecN ${r?"vec3":"vec2"} + + vecN normalizedSegment(vecN pos, vecN prev) { + vecN segment = pos - prev; + float segmentLen = length(segment); + + // normalize or zero if too short + return (segmentLen > 0.001) ? segment / segmentLen : ${r?"vec3(0.0, 0.0, 0.0)":"vec2(0.0, 0.0)"}; + } + + vecN displace(vecN pos, vecN prev, float displacementLen) { + vecN segment = normalizedSegment(pos, prev); + + vecN displacementDirU = perpendicular(segment); + vecN displacementDirV = segment; + + ${t.anchor===eE.Tip?"pos -= 0.5 * displacementLen * displacementDirV;":""} + + return pos + displacementLen * (uv0.x * displacementDirU + uv0.y * displacementDirV); + } + `),t.space===_p.Screen&&(n.uniforms.add(new _s("inverseProjectionMatrix",(o,l)=>l.camera.inverseProjectionMatrix)),n.code.add(V`vec3 inverseProject(vec4 posScreen) { +posScreen.xy = (posScreen.xy / viewport.zw) * posScreen.w; +return (inverseProjectionMatrix * posScreen).xyz; +}`),n.code.add(V`bool rayIntersectPlane(vec3 rayDir, vec3 planeOrigin, vec3 planeNormal, out vec3 intersection) { +float cos = dot(rayDir, planeNormal); +float t = dot(planeOrigin, planeNormal) / cos; +intersection = t * rayDir; +return abs(cos) > 0.001 && t > 0.0; +}`),n.uniforms.add(new ft("perScreenPixelRatio",(o,l)=>l.camera.perScreenPixelRatio)),n.code.add(V` + vec4 toFront(vec4 displacedPosScreen, vec3 posLeft, vec3 posRight, vec3 prev, float lineWidth) { + // Project displaced position back to camera space + vec3 displacedPos = inverseProject(displacedPosScreen); + + // Calculate the plane that we want the marker to lie in. Note that this will always be an approximation since ribbon lines are generally + // not planar and we do not know the actual position of the displaced prev vertices (they are offset in screen space, too). + vec3 planeNormal = normalize(cross(posLeft - posRight, posLeft - prev)); + vec3 planeOrigin = posLeft; + + ${t.hasCap?` + if(prev.z > posLeft.z) { + vec2 diff = posLeft.xy - posRight.xy; + planeOrigin.xy += perpendicular(diff) / 2.0; + } + `:""}; + + // Move the plane towards the camera by a margin dependent on the line width (approximated in world space). This tolerance corrects for the + // non-planarity in most cases, but sharp joins can place the prev vertices at arbitrary positions so markers can still clip. + float offset = lineWidth * perScreenPixelRatio; + planeOrigin *= (1.0 - offset); + + // Intersect camera ray with the plane and make sure it is within clip space + vec3 rayDir = normalize(displacedPos); + vec3 intersection; + if (rayIntersectPlane(rayDir, planeOrigin, planeNormal, intersection) && intersection.z < -nearFar[0] && intersection.z > -nearFar[1]) { + return vec4(intersection.xyz, 1.0); + } + + // Fallback: use depth of pos or prev, whichever is closer to the camera + float minDepth = planeOrigin.z > prev.z ? length(planeOrigin) : length(prev); + displacedPos *= minDepth / length(displacedPos); + return vec4(displacedPos.xyz, 1.0); + } + `)),bP(n),Rj(e),n.code.add(V`void main(void) { +if (uv0.y == 0.0) { +gl_Position = vec4(1e038, 1e038, 1e038, 1.0); +} +else { +float lineWidth = getLineWidth(); +float screenMarkerSize = getScreenMarkerSize(); +vec4 pos = view * vec4(position.xyz, 1.0); +vec4 prev = view * vec4(auxpos1.xyz, 1.0); +clip(pos, prev);`),r?(t.hideOnShortSegments&&n.code.add(V`if (areWorldMarkersHidden(pos, prev)) { +gl_Position = vec4(1e038, 1e038, 1e038, 1.0); +return; +}`),n.code.add(V`pos.xyz = displace(pos.xyz, prev.xyz, getWorldMarkerSize(pos)); +vec4 displacedPosScreen = projectAndScale(pos);`)):(n.code.add(V`vec4 posScreen = projectAndScale(pos); +vec4 prevScreen = projectAndScale(prev); +vec4 displacedPosScreen = posScreen; +displacedPosScreen.xy = displace(posScreen.xy, prevScreen.xy, screenMarkerSize);`),t.space===_p.Screen&&n.code.add(V`vec2 displacementDirU = perpendicular(normalizedSegment(posScreen.xy, prevScreen.xy)); +vec3 lineRight = inverseProject(posScreen + lineWidth * vec4(displacementDirU.xy, 0.0, 0.0)); +vec3 lineLeft = pos.xyz + (pos.xyz - lineRight); +pos = toFront(displacedPosScreen, lineLeft, lineRight, prev.xyz, lineWidth); +displacedPosScreen = projectAndScale(pos);`)),n.code.add(V` + ${i?"depth = pos.z;":""} + linearDepth = calculateLinearDepth(nearFar,pos.z); + + // Convert back into NDC + displacedPosScreen.xy = (displacedPosScreen.xy / viewport.zw) * displacedPosScreen.w; + + // Convert texture coordinate into [0,1] + vUV = (uv0 + 1.0) / 2.0; + + ${r?"":"vUV *= displacedPosScreen.w;"} + + ${t.hasTip?"vLineWidth = lineWidth;":""} + + vSize = screenMarkerSize; + vColor = getColor(); + + // Use camera space for slicing + vpos = pos.xyz; + + gl_Position = displacedPosScreen; + } + } + `),i&&e.include(dd,t),e.include(oo,t),s.uniforms.add(new gr("intrinsicColor",o=>o.color),new Zt("tex",o=>o.markerTexture)),s.include(h1),e.constants.add("texelSize","float",1/xT),s.code.add(V`float markerAlpha(vec2 samplePos) { +samplePos += vec2(0.5, -0.5) * texelSize; +float sdf = rgba2float(texture(tex, samplePos)) - 0.5; +float distance = sdf * vSize; +distance -= 0.5; +return clamp(0.5 - distance, 0.0, 1.0); +}`),t.hasTip&&(e.constants.add("relativeMarkerSize","float",Wle/xT),e.constants.add("relativeTipLineWidth","float",DEt),s.code.add(V` + float tipAlpha(vec2 samplePos) { + // Convert coordinates s.t. they are in pixels and relative to the tip of an arrow marker + samplePos -= vec2(0.5, 0.5 + 0.5 * relativeMarkerSize); + samplePos *= vSize; + + float halfMarkerSize = 0.5 * relativeMarkerSize * vSize; + float halfTipLineWidth = 0.5 * max(1.0, relativeTipLineWidth * vLineWidth); + + ${r?"halfTipLineWidth *= fwidth(samplePos.y);":""} + + float distance = max(abs(samplePos.x) - halfMarkerSize, abs(samplePos.y) - halfTipLineWidth); + return clamp(0.5 - distance, 0.0, 1.0); + } + `)),e.constants.add("symbolAlphaCutoff","float",Cl),s.code.add(V` + void main() { + discardBySlice(vpos); + ${i?"terrainDepthTest(depth);":""} + + vec4 finalColor = intrinsicColor * vColor; + + ${r?"vec2 samplePos = vUV;":"vec2 samplePos = vUV * gl_FragCoord.w;"} + + ${t.hasTip?"finalColor.a *= max(markerAlpha(samplePos), tipAlpha(samplePos));":"finalColor.a *= markerAlpha(samplePos);"} + + ${t.output===ue.ObjectAndLayerIdColor?V`finalColor.a = 1.0;`:""} + + if (finalColor.a < symbolAlphaCutoff) { + discard; + } + + ${t.output===ue.Alpha?V`fragColor = vec4(finalColor.a);`:""} + ${t.output===ue.Color?V`fragColor = highlightSlice(finalColor, vpos);`:""} + ${t.output===ue.Color&&t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + ${t.output===ue.Highlight?V`fragColor = vec4(1.0);`:""} + ${t.output===ue.Depth?V`outputDepth(linearDepth);`:""} + } + `),e}const eMt=Object.freeze(Object.defineProperty({__proto__:null,build:m8e},Symbol.toStringTag,{value:"Module"})),g8e=new Map([[J.POSITION,0],[J.UV0,1],[J.AUXPOS1,2],[J.NORMAL,3],[J.COLOR,4],[J.COLORFEATUREATTRIBUTE,4],[J.SIZE,5],[J.SIZEFEATUREATTRIBUTE,5],[J.OPACITYFEATUREATTRIBUTE,6]]);let y8e=class v8e extends Hr{initializeProgram(e){return new Ir(e.rctx,v8e.shader.get().build(this.configuration),g8e)}_makePipelineState(e,i){const r=this.configuration,n=e===Jt.NONE;return Ti({blending:r.output===ue.Color||r.output===ue.Alpha?n?vp:Y_(e):null,depthTest:{func:px(e)},depthWrite:n?r.writeDepth?rh:null:Kj(e),colorWrite:ji,stencilWrite:r.hasOccludees?Jy:null,stencilTest:r.hasOccludees?i?Z2:fx:null,polygonOffset:{factor:0,units:-10}})}initializePipeline(){return this.configuration.occluder&&(this._occluderPipelineTransparent=Ti({blending:vp,depthTest:BU,depthWrite:null,colorWrite:ji,stencilWrite:null,stencilTest:Y6e}),this._occluderPipelineOpaque=Ti({blending:vp,depthTest:BU,depthWrite:null,colorWrite:ji,stencilWrite:q6e,stencilTest:W6e}),this._occluderPipelineMaskWrite=Ti({blending:null,depthTest:Cle,depthWrite:null,colorWrite:null,stencilWrite:Jy,stencilTest:Z2})),this._occludeePipelineState=this._makePipelineState(this.configuration.transparencyPassType,!0),this._makePipelineState(this.configuration.transparencyPassType,!1)}getPipeline(e,i,r){return e?this._occludeePipelineState:this.configuration.occluder?r?this._occluderPipelineTransparent:i?this._occluderPipelineOpaque:this._occluderPipelineMaskWrite:super.getPipeline()}};y8e.shader=new Rr(eMt,()=>we(()=>Promise.resolve().then(()=>RWt),void 0));let tMt=class extends hx{constructor(e){super(e,new rMt),this._vertexAttributeLocations=g8e,this._configuration=new Na,this._layout=this.createLayout()}getConfiguration(e,i){return this._configuration.output=e,this._configuration.space=i.slot===ke.DRAPED_MATERIAL?_p.Draped:this.parameters.worldSpace?_p.World:_p.Screen,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=this.parameters.cap!==Df.BUTT,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.occluder=this.parameters.renderOccluded===Wn.OccludeAndTransparentStencil,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.multipassEnabled=i.multipassEnabled,this._configuration.cullAboveGround=i.multipassTerrain.cullAboveGround,this._configuration}intersect(){}createLayout(){const e=ls().vec3f(J.POSITION).vec2f(J.UV0).vec3f(J.AUXPOS1);return this.parameters.worldSpace&&e.vec3f(J.NORMAL),this.parameters.vvSize?e.f32(J.SIZEFEATUREATTRIBUTE):e.f32(J.SIZE),this.parameters.vvColor?e.f32(J.COLORFEATUREATTRIBUTE):e.vec4f(J.COLOR),this.parameters.vvOpacity&&e.f32(J.OPACITYFEATUREATTRIBUTE),e}createBufferWriter(){return new nMt(this._layout,this.parameters)}produces(e,i){return i===ue.Color||i===ue.Alpha||i===ue.Highlight||i===ue.Depth?e===ke.DRAPED_MATERIAL?!0:this.parameters.renderOccluded===Wn.OccludeAndTransparentStencil?e===ke.OPAQUE_MATERIAL||e===ke.OCCLUDER_MATERIAL||e===ke.TRANSPARENT_OCCLUDER_MATERIAL:i===ue.Color||i===ue.Alpha?e===(this.parameters.writeDepth?ke.TRANSPARENT_MATERIAL:ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL):e===ke.OPAQUE_MATERIAL:!1}createGLMaterial(e){return new iMt(e)}},iMt=class extends wae{constructor(){super(...arguments),this._markerPrimitive=null}dispose(){super.dispose(),this._markerTextureRepository.release(this._markerPrimitive),this._markerPrimitive=null}_updateParameters(e){const i=this._material.parameters.markerPrimitive;return i!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextureRepository.swap(i,this._markerPrimitive)}),this._markerPrimitive=i),this._material.setParameters(this.textureBindParameters),this.ensureTechnique(y8e,e)}_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}beginSlot(e){return this._output!==ue.Color&&this._output!==ue.Alpha||this._updateOccludeeState(e),this._updateParameters(e)}},rMt=class extends t6{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=Df.BUTT,this.anchor=eE.Center,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.hasOccludees=!1,this.markerTexture=null}},nMt=class{constructor(e,i){this.vertexBufferLayout=e,this._parameters=i}elementCount(){return this._parameters.placement==="begin-end"?12:6}write(e,i,r,n,s){const o=r.attributes.get(J.POSITION).data,l=o.length/3;let c=[1,0,0];const f=r.attributes.get(J.NORMAL);this._parameters.worldSpace&&f!=null&&(c=f.data);let _=1,x=0;this._parameters.vvSize?x=r.attributes.get(J.SIZEFEATUREATTRIBUTE).data[0]:r.attributes.has(J.SIZE)&&(_=r.attributes.get(J.SIZE).data[0]);let T=[1,1,1,1],A=0;this._parameters.vvColor?A=r.attributes.get(J.COLORFEATUREATTRIBUTE).data[0]:r.attributes.has(J.COLOR)&&(T=r.attributes.get(J.COLOR).data);let M=0;this._parameters.vvOpacity&&(M=r.attributes.get(J.OPACITYFEATUREATTRIBUTE).data[0]);const I=new Float32Array(n.buffer);let L=s*(this.vertexBufferLayout.stride/4);const F=(j,H,Y,Q)=>{if(I[L++]=j[0],I[L++]=j[1],I[L++]=j[2],I[L++]=Y[0],I[L++]=Y[1],I[L++]=H[0],I[L++]=H[1],I[L++]=H[2],this._parameters.worldSpace&&(I[L++]=c[0],I[L++]=c[1],I[L++]=c[2]),this._parameters.vvSize?I[L++]=x:I[L++]=_,this._parameters.vvColor)I[L++]=A;else{const ne=Math.min(4*Q,T.length-4);I[L++]=T[ne],I[L++]=T[ne+1],I[L++]=T[ne+2],I[L++]=T[ne+3]}this._parameters.vvOpacity&&(I[L++]=M)};let z;(function(j){j[j.ASCENDING=1]="ASCENDING",j[j.DESCENDING=-1]="DESCENDING"})(z||(z={}));const k=(j,H)=>{const Y=Ie(sMt,o[3*j],o[3*j+1],o[3*j+2]),Q=oMt;let ne=j+H;do Ie(Q,o[3*ne],o[3*ne+1],o[3*ne+2]),ne+=H;while(M2(Y,Q)&&ne>=0&&nethis._context.stage.remove(e)),this._materials.length=0}_getDrivenSize(e){return this._drivenProperties.size&&e.size?Tr(cTt(e.size)):1}_getDrivenColor(e){const i=Mi(1,1,1,1);return this._drivenProperties.color&&e.color&&(i[0]=e.color[0],i[1]=e.color[1],i[2]=e.color[2],e.color.length>0&&(i[3]=e.color[3])),this._drivenProperties.opacity&&e.opacity&&(i[3]=e.opacity),i}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry,hMt,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(i);return this.ensureDrapedStatus(r.mode==="on-the-ground"),this.draped?this._createAsOverlay(e,this._context.layer.uid):this._createAs3DShape(e,r,i.uid)}applyRendererDiff(e,i){for(const r in e.diff){if(r!=="visualVariables")return To.RecreateSymbol;{const n=this._fastUpdates;if(!A5(n,i,J1e))return To.RecreateSymbol;this._forEachMaterial(s=>s==null?void 0:s.setParameters(n.materialParameters))}}return To.FastUpdate}prepareSymbolLayerPatch(e){var s,o;if(e.diff.type!=="partial")return;const i=e.diff.diff,r={};((s=i.size)==null?void 0:s.type)==="complete"&&(r.width=this._computeMaterialWidth(i.size.newValue),delete i.size),((o=i.cap)==null?void 0:o.type)==="complete"&&(r.cap=bie(i.cap.newValue??"butt"),delete i.cap);const n=this._prepareMarkerPatch(e,i);this._prepareMaterialPatch(e,i,n),e.symbolLayerStatePatches.push(()=>this._forEachMaterial(l=>l==null?void 0:l.setParameters(r)))}layerOpacityChanged(){this._forEachMaterial((e,i)=>this._updateMaterialLayerOpacity(e,i===Ks.Marker))}_forEachMaterial(e){this._materials.forEach(e)}_updateMaterialLayerOpacity(e,i=!1){var l,c;if(e==null)return;const r=e.parameters.color,n=(c=(l=this.symbolLayer)==null?void 0:l.material)==null?void 0:c.color,s=this._patternHidesLine&&!i?0:this._getCombinedOpacity(n),o=Mi(r[0],r[1],r[2],s);e.setParameters({color:o})}layerElevationInfoChanged(e,i,r){const n=this._elevationContext.mode,s=i6(w8e.elevationModeChangeTypes,r,n);if(s!==Ys.UPDATE)return s;const o=t0(n);return this.updateGraphics3DGraphicElevationInfo(e,i,()=>o)}slicePlaneEnabledChanged(){const e={hasSlicePlane:this._context.slicePlaneEnabled};return this._forEachMaterial(i=>i==null?void 0:i.setParameters(e)),!0}physicalBasedRenderingChanged(){return!0}_getGeometryAsPolygonOrPolyline(e){switch(e.type){case"extent":if(e instanceof Vi)return Qa.fromExtent(e);break;case"polygon":case"polyline":return e}return null}_createAs3DShape(e,i,r){const n=e.graphic,s=this._getGeometryAsPolygonOrPolyline(n.geometry),o=s.type==="polygon"?s.rings:s.paths,l=new Array,c=ya(),f=KAt(s,this._context.elevationProvider,this._context.renderCoordsHelper,i),_=s.type==="polygon"?"rings":"paths";this._logGeometryCreationWarnings(f,o,_,"LineSymbol3DLayer");for(let A=0;A{const F=this._createGeometry(L,e,M.position,void 0,n.type,O$.DRAPED,r.uid),z=new $5(F,{layerUid:i,graphicUid:r.uid});f.push(z)};if(c!=null){I(c);const L=this.symbolLayer.marker.placement;L!=="begin"&&L!=="begin-end"||cp(_,M.position,0,1),L!=="end"&&L!=="begin-end"||cp(_,M.position,M.position.length-3,1)}I(o),Tn.LINE_WIREFRAMES&&I(l)}return new mG(this,f,x,this._context.drapeSourceRenderer)}get _patternHidesLine(){const e=this.symbolLayer.pattern;return e!=null&&e.type==="style"&&e.style==="none"}_computeMaterialWidth(e){var i;return e=e??ad(1),this._drivenProperties.size?(i=this._fastUpdates)!=null&&i.visualVariables.size?Tr(1):1:Tr(e)}_prepareMaterialPatch(e,i,r){var l,c;const n=i.material;if(n==null)return void(r.changed&&r.useMaterialColor&&this._patchMaterialColor(this._getCombinedOpacityAndColor(this._materialColor),this._materials[Ks.Marker],e));if(n.type==="collection")return;const s=n.type==="complete"?(l=n.newValue)==null?void 0:l.color:((c=n.diff.color)==null?void 0:c.type)==="complete"?n.diff.color.newValue:null,o=this._getCombinedOpacityAndColor(s);r.useMaterialColor&&this._patchMaterialColor(U9(o),this._materials[Ks.Marker],e),this._patternHidesLine&&(o[3]=0),this._patchMaterialColor(o,this._materials[Ks.Line],e),delete i.material}_prepareMarkerPatch(e,i){var _;const r=i.marker,n=this._markerMaterial;if(r==null||r.type!=="partial"||r.diff==null||r.diff.placement!=null||r.diff.style!=null&&r.diff.style.type!=="complete"||r.diff.color!=null&&r.diff.color.type!=="complete"||n==null)return{changed:!1,useMaterialColor:this._markerColor==null};const s=r.diff.color,o=s!=null,l=o?s.newValue:null,c=l==null&&this._markerColor==null;l&&this._patchMaterialColor(this._getCombinedOpacityAndColor(l),n,e);const f=(_=r.diff.style)==null?void 0:_.newValue;return f&&e.symbolLayerStatePatches.push(()=>n.setParameters({markerPrimitive:Z1e(f)})),delete i.marker,{changed:o,useMaterialColor:c}}_patchMaterialColor(e,i,r){i!=null&&r.symbolLayerStatePatches.push(()=>i.setParameters({color:e}))}};var O$,Ks;b8e.elevationModeChangeTypes={definedChanged:Ys.RECREATE,staysOnTheGround:Ys.NONE,onTheGroundChanged:Ys.RECREATE},function(t){t[t.DRAPED=0]="DRAPED",t[t.ELEVATED=1]="ELEVATED"}(O$||(O$={})),function(t){t[t.Line=0]="Line",t[t.Ring=1]="Ring",t[t.LineWireframe=2]="LineWireframe",t[t.RingWireframe=3]="RingWireframe",t[t.Marker=4]="Marker"}(Ks||(Ks={}));function x8e(t,e,i){return vn(t,e,0,VN,i.spatialReference,0,1)?(i.x=VN[0],i.y=VN[1],i.z=VN[2],i):null}const VN=W();let _R=null,eV=!0;function VW(t,e,i){if(!t||!e)throw new Error("Cannot construct image data without dimensions");if(eV)try{return new ImageData(t,e)}catch{eV=!1}return S8e(t,e,i)}function dMt(t,e,i,r){if(!e||!i)throw new Error("Cannot construct image data without dimensions");if(eV)try{return new ImageData(t,e,i)}catch{eV=!1}const n=S8e(e,i,r);return n.data.set(t,0),n}function pMt(){return _R||(_R=document.createElement("canvas"),_R.width=1,_R.height=1),_R}function S8e(t,e,i){return i||(i=pMt()),i.getContext("2d").createImageData(t,e)}async function fMt(t,e){const i=window.URL.createObjectURL(t);try{const{data:r}=await bi(i,{...e,responseType:"image"});return r}catch(r){throw sn(r)?r:new se("invalid-image",`Could not fetch requested image at ${i}`)}finally{window.URL.revokeObjectURL(i)}}async function gci(t,e){const{arrayBuffer:i,mediaType:r}=await mMt(t,e),n=r==="image/png";if(r==="image/gif"){const{isAnimatedGIF:s,parseGif:o}=await we(()=>import("./gif--X7Hb6fX.js"),__vite__mapDeps([]));if(s(i))return o(i,e)}if(n){const{isAnimatedPNG:s,parseApng:o}=await we(()=>import("./apng-yUSt3z2o.js"),__vite__mapDeps([]));if(s(i))return o(i,e)}return fMt(new Blob([i],{type:r}),e)}async function mMt(t,e){const i=C2(t);if(i!=null&&i.isBase64)return{arrayBuffer:lEe(i.data),mediaType:i.mediaType};const r=await bi(t,{responseType:"array-buffer",...e});return{arrayBuffer:r.data,mediaType:r.getHeader("Content-Type")}}var GA;const BW=new WeakMap;let gMt=0,Ig=GA=class extends Ue{constructor(t){super(t),this.wrap="repeat"}get url(){return this._get("url")||null}set url(t){this._set("url",t),t&&this._set("data",null)}get data(){return this._get("data")||null}set data(t){this._set("data",t),t&&this._set("url",null)}writeData(t,e,i,r){if(t instanceof HTMLImageElement){const n={type:"image-element",src:m_(t.src,r),crossOrigin:t.crossOrigin};e[i]=n}else if(t instanceof HTMLCanvasElement){const n=t.getContext("2d").getImageData(0,0,t.width,t.height),s={type:"canvas-element",imageData:this._encodeImageData(n)};e[i]=s}else if(t instanceof HTMLVideoElement){const n={type:"video-element",src:m_(t.src,r),autoplay:t.autoplay,loop:t.loop,muted:t.muted,crossOrigin:t.crossOrigin,preload:t.preload};e[i]=n}else if(t instanceof ImageData){const n={type:"image-data",imageData:this._encodeImageData(t)};e[i]=n}}readData(t){switch(t.type){case"image-element":{const e=new Image;return e.src=t.src,e.crossOrigin=t.crossOrigin,e}case"canvas-element":{const e=this._decodeImageData(t.imageData),i=document.createElement("canvas");return i.width=e.width,i.height=e.height,i.getContext("2d").putImageData(e,0,0),i}case"image-data":return this._decodeImageData(t.imageData);case"video-element":{const e=document.createElement("video");return e.src=t.src,e.crossOrigin=t.crossOrigin,e.autoplay=t.autoplay,e.loop=t.loop,e.muted=t.muted,e.preload=t.preload,e}default:return}}get transparent(){const t=this.data,e=this.url;if(t instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(t.getContext("2d").getImageData(0,0,t.width,t.height));if(t instanceof ImageData)return this._imageDataContainsTransparent(t);if(e){const i=e.substr(e.length-4,4).toLowerCase(),r=e.substr(0,15).toLocaleLowerCase();if(i===".png"||r==="data:image/png;")return!0}return!1}set transparent(t){this._overrideIfSome("transparent",t)}get contentHash(){const t=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",e=(i="")=>`d:${i},t:${this.transparent},w:${t}`;return this.url!=null?e(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?e(this.data.src):(BW.has(this.data)||BW.set(this.data,++gMt),e(BW.get(this.data))):e()}get memoryUsage(){let t=0;if(t+=this.url!=null?this.url.length:0,this.data!=null){const e=this.data;"data"in e?t+=e.data.byteLength:e instanceof HTMLImageElement?t+=e.naturalWidth*e.naturalHeight*3:e instanceof HTMLCanvasElement&&(t+=e.width*e.height*3)}return t}clone(){const t={url:this.url,data:this.data,wrap:this._cloneWrap()};return new GA(t)}cloneWithDeduplication(t){const e=t.get(this);if(e)return e;const i=this.clone();return t.set(this,i),i}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(t){let e="";for(let i=0;i{const l=()=>{f(),s(n)},c=_=>{f(),o(_)},f=()=>{URL.revokeObjectURL(r),n.removeEventListener("load",l),n.removeEventListener("error",c)};n.addEventListener("load",l),n.addEventListener("error",c),n.src=r});try{n.src=r,await n.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(r),n}function hy(t){if(t==null)return null;const e=t.offset!=null?t.offset:ADe,i=t.rotation!=null?t.rotation:0,r=t.scale!=null?t.scale:MDe,n=tk(1,0,0,0,1,0,e[0],e[1],1),s=tk(Math.cos(i),-Math.sin(i),0,Math.sin(i),Math.cos(i),0,0,0,1),o=tk(r[0],0,0,0,r[1],0,0,0,1),l=Tc();return s5(l,s,o),s5(l,n,l),l}let jMt=class extends d1{constructor(){super(...arguments),this._originalGeometries=[],this._fastTransformUpdatesEnabled=!1}get fastTransformUpdatesEnabled(){return this._fastTransformUpdatesEnabled}enableFastTransformUpdates(e,i){if(this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!0;const{stageObject:r}=this,n=r.geometries.slice();r.removeAllGeometries();const s=zz(GW,r.transformation),o=i.getOrigin(s);for(const l of n){const c=e(l.material),f=l.instantiate({material:c});f.localOrigin=o,r.addGeometry(f)}this._originalGeometries=n}disableFastTransformUpdates(e){if(!this._fastTransformUpdatesEnabled)return;this._fastTransformUpdatesEnabled=!1;const{stageObject:i}=this,r=i.geometries.map(n=>e(n.material));i.removeAllGeometries();for(let n=0;n{f.transformation=c,f.localOrigin=l})}updateTransform(e,i,r){const{stageObject:n}=this,s=(i==null?void 0:i.localMatrix)??gs;if(!this._fastTransformUpdatesEnabled)return n.shaderTransformation=null,n.transformation=e,n.geometries.forEach(A=>{A.transformation=s}),void(this._fastUpdateEdgeTransform()||this.resetEdgeObject(r));const o=n.transformation,l=n.geometries[0].transformation,c=e,f=s,_=nn(Q1e,o,l),x=nn(eve,c,f),T=nn(tve,x,Vo(tve,l));n.shaderTransformation=T,this._setFastMaterialTransformation({matA:_,matB:x}),this._fastUpdateEdgeTransform()||this.resetEdgeObject(r)}alignWithElevation(e,i,r,n){if(!this._fastTransformUpdatesEnabled)return void super.alignWithElevation(e,i,r,n);r!=null&&rG(this.elevationContext.featureExpressionInfoContext,r);const s=(M,I)=>Y2(M,e,this.elevationContext,i,I),{stageObject:o}=this;if(!o.geometries[0].material.parameters.modelTransformation)return;const l=o.transformation,c=o.geometries[0].transformation,f=nn(Q1e,l,c),_=o.effectiveTransformation,x=Ao(GMt,_);this.alignedSampledElevation=_T(this,this.elevationContext,e.spatialReference,s,i,x),o.shaderTransformation=x;const T=o.geometries[0].transformation,A=nn(eve,x,T);this._setFastMaterialTransformation({matA:f,matB:A}),this._fastUpdateEdgeTransform()||this.resetEdgeObject(n)}_setFastMaterialTransformation({matA:e,matB:i}){const{stageObject:r}=this;if(r.geometries.length===0)return;const n=r.geometries[0].localOrigin,s=L9(HMt,De(GW,n.vec3,-1)),o=nn(ive,s,e),l=nn(rve,s,i),c=Vo(ive,o),f=nn(rve,l,c);for(const _ of r.geometries)_.material.setParameters({modelTransformation:f})}_fastUpdateEdgeTransform(){return this._stageLayer.stage.renderer.ensureEdgeView().fastUpdateObject3DEdgesTransform(this.stageObject)}};const GW=W(),Q1e=Qe(),eve=Qe(),GMt=Qe(),tve=Qe(),ive=Qe(),rve=Qe(),HMt=Qe();let qMt=class{constructor(){this._fastTransformOriginalMaterials=new Map,this._fastTransformClonedMaterials=new Map,this._graphicReferenceCount=0}enable(e,i,r){e.enableFastTransformUpdates(n=>{if(this._graphicReferenceCount<=1){if(this._fastTransformOriginalMaterials.has(n))return n;const o=i.byMaterial(n);return this._fastTransformOriginalMaterials.set(n,o),i.delete(n),n}const s=new km(n.parameters);return r.stage.add(s),this._fastTransformClonedMaterials.set(s,n),s},r.localOriginFactory)}disable(e,i,r){const n=new Set,s=new Set;e.disableFastTransformUpdates(o=>{if(!this._fastTransformClonedMaterials.has(o)){const f=o,_=this._fastTransformOriginalMaterials.get(f);return i.has(_.uid)?(n.add(f),i.byUid(_.uid).material):(s.add(f),_.material)}const l=o,c=this._fastTransformClonedMaterials.get(l);return this._fastTransformClonedMaterials.delete(l),r.stage.remove(l),c});for(const o of n)this._fastTransformOriginalMaterials.delete(o),r.stage.remove(o);for(const o of s){const l=this._fastTransformOriginalMaterials.get(o);this._fastTransformOriginalMaterials.delete(o),i.set(l.uid,l)}}onAddGraphic(){this._graphicReferenceCount++}onRemoveGraphic(e,i,r){this._graphicReferenceCount--,this.disable(e,i,r)}forEachMaterialInfo(e){this._fastTransformOriginalMaterials.forEach(e)}forEachClonedMaterial(e){this._fastTransformClonedMaterials.forEach(e)}destroy(e){e.removeMany(Array.from(this._fastTransformClonedMaterials.keys())),e.removeMany(Array.from(this._fastTransformOriginalMaterials.values(),({material:i})=>i)),this._fastTransformClonedMaterials.clear(),this._fastTransformOriginalMaterials.clear()}},WMt=class{constructor(){this._byUid=new Map,this._byMaterial=new Map}get materials(){return Array.from(this._byUid.values(),e=>e.material)}byUid(e){return this._byUid.get(e)}byMaterial(e){return this._byMaterial.get(e)}set(e,i){this._byUid.set(e,i),this._byMaterial.set(i.material,i)}delete(e){var r;const i=(r=this._byMaterial.get(e))==null?void 0:r.uid;i&&(this._byUid.delete(i),this._byMaterial.delete(e))}has(e){return this._byUid.has(e)}forEachMaterialInfo(e){this._byUid.forEach(e)}clear(){this._byUid.clear(),this._byMaterial.clear()}};function U8e(t){const e=new Cr,{vertex:i,fragment:r}=e;return e.include(Yu,t),e.include(ME,t),Kh(i,t),e.attributes.add(J.POSITION,"vec3"),e.varyings.add("vpos","vec3"),i.code.add(V`void main(void) { +vpos = position; +forwardNormalizedVertexColor(); +gl_Position = transformPosition(proj, view, vpos); +}`),t.output===ue.Highlight&&e.include(dx,t),e.include(oo,t),r.uniforms.add(new ft("alphaCoverage",(n,s)=>Math.min(1,n.width*s.camera.pixelRatio))),t.hasVertexColors||r.uniforms.add(new gr("constantColor",n=>n.color)),r.code.add(V` + void main() { + discardBySlice(vpos); + + vec4 color = ${t.hasVertexColors?"vColor":"constantColor"}; + + ${t.output===ue.ObjectAndLayerIdColor?V`color.a = 1.0;`:""} + + if (color.a < ${V.float(Cl)}) { + discard; + } + + ${t.output===ue.Color?V`fragColor = highlightSlice(color, vpos);`:""} + ${t.output===ue.Highlight?V`outputHighlight();`:""} + } + `),e}const YMt=Object.freeze(Object.defineProperty({__proto__:null,build:U8e},Symbol.toStringTag,{value:"Module"}));let V8e=class B8e extends Hr{initializeProgram(e){return new Ir(e.rctx,B8e.shader.get().build(this.configuration),Er)}initializePipeline(){const e=this.configuration,i=Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),r=(n,s=null,o=null)=>Ti({blending:s,depthTest:Cle,depthWrite:o,colorWrite:ji,stencilWrite:e.hasOccludees?Jy:null,stencilTest:e.hasOccludees?n?Z2:fx:null});return e.output===ue.Color?(this._occludeePipelineState=r(!0,e.transparent?i:null,rh),r(!1,e.transparent?i:null,rh)):r(!1)}get primitiveType(){return sr.LINES}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};V8e.shader=new Rr(YMt,()=>we(()=>Promise.resolve().then(()=>IWt),void 0));let WA=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.hasOccludees=!1}};y([fe({count:ue.COUNT})],WA.prototype,"output",void 0),y([fe()],WA.prototype,"hasSlicePlane",void 0),y([fe()],WA.prototype,"hasVertexColors",void 0),y([fe()],WA.prototype,"transparent",void 0),y([fe()],WA.prototype,"hasOccludees",void 0);let nve=class extends hx{constructor(e){super(e,new ZMt),this._configuration=new WA}getConfiguration(e){return this._configuration.output=e,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration}intersect(e,i,r,n,s,o){if(!r.options.selectionMode||!e.visible)return;if(!BIe(i))return void Ce.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const l=e.attributes.get(J.POSITION).data,c=r.camera,f=KMt;Qo(f,r.point);const _=2;Ie(wR[0],f[0]-_,f[1]+_,0),Ie(wR[1],f[0]+_,f[1]+_,0),Ie(wR[2],f[0]+_,f[1]-_,0),Ie(wR[3],f[0]-_,f[1]-_,0);for(let I=0;I<4;I++)if(!c.unprojectFromRenderScreen(wR[I],E1[I]))return;jl(c.eye,E1[0],E1[1],HW),jl(c.eye,E1[1],E1[2],qW),jl(c.eye,E1[2],E1[3],WW),jl(c.eye,E1[3],E1[0],YW);let x=Number.MAX_VALUE,T=0;for(let I=0;I0){je(lg,wu,xu);const F=c.frustum,z=-fn(F[Rn.NEAR],wu)/Ve(lg,F[Rn.NEAR]);De(lg,lg,z),Be(wu,wu,lg),c.projectToRenderScreen(wu,zx)}else if(zx[2]>0&&Ux[2]<0){je(lg,xu,wu);const F=c.frustum,z=-fn(F[Rn.NEAR],xu)/Ve(lg,F[Rn.NEAR]);De(lg,lg,z),Be(xu,xu,lg),c.projectToRenderScreen(xu,Ux)}else if(zx[2]<0&&Ux[2]<0)continue;zx[2]=0,Ux[2]=0;const L=Yoe(gT(zx,Ux,ave),f);Le.unload()),this._context.stage.removeMany(this._materialInfoCache.materials),this._context.stage.removeMany(Array.from(this._textures.values())),this._materialInfoCache.clear(),this._textures.clear(),this._fastUpdateProcessor.destroy(this._context.stage)}get materials(){return this._materialInfoCache.materials}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry,QMt,"fill on mesh-3d"))return null;const r=this.setGraphicElevationContext(i),n=e.renderingInfo;return this._createAs3DShape(i,n,r,i.uid)}onRemoveGraphic(e){this._fastUpdateProcessor.onRemoveGraphic(e,this._materialInfoCache,this._context)}layerOpacityChanged(e,i){const r=this._getLayerOpacity();this._updateMaterialParameters(n=>{n.material.setParameters({layerOpacity:r});const s=n.material.parameters;this._setMaterialTransparentParameter(s,n),n.material.setParameters({transparent:s.transparent})}),e.forEach(n=>{var s;return(s=i(n))==null?void 0:s.layerOpacityChanged(r,this._context.isAsync)})}layerElevationInfoChanged(e,i){return this.updateGraphics3DGraphicElevationInfo(e,i,X2)}slicePlaneEnabledChanged(e,i){return this._updateMaterialParameters(({material:r})=>{r.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),e.forEach(r=>{var n;return(n=i(r))==null?void 0:n.slicePlaneEnabledChanged(this._context.slicePlaneEnabled,this._context.isAsync)}),!0}physicalBasedRenderingChanged(){const e=this._usePBR();return this._updateMaterialParameters(({material:i})=>i.setParameters({usePBR:e})),!0}updateTransform(e,i,r,n){const s=this._context.renderCoordsHelper.spatialReference,o=tOt,{origin:l,transform:c}=r;switch(uu(i,Ie(Ma,l.x,l.y,l.z??0),o,s),n){case R$.EnableFastUpdates:this._fastUpdateProcessor.enable(e,this._materialInfoCache,this._context);break;case R$.DisableFastUpdates:this._fastUpdateProcessor.disable(e,this._materialInfoCache,this._context);break;case R$.UpdateFastLocalOrigin:e.updateFastLocalOrigin(o,c,this._context.localOriginFactory)}const{elevationContext:f}=e;f.centerPointInElevationSR=this._getCenterPointInElevationSR(o);const{elevationProvider:_,renderCoordsHelper:x}=this._context,T=(A,M)=>Y2(A,_,f,x,M);return e.alignedSampledElevation=_T(e,f,_.spatialReference,T,x,o),e.updateTransform(o,c,this._context.isAsync),!0}_requiresSymbolVertexColors(){return this._drivenProperties.color||this._drivenProperties.opacity}_colorOrTextureUid(e){return e==null?"-":e instanceof qe?e.toHex():e.contentHash}_materialPropertiesDefault(e,i){const r=this._requiresSymbolVertexColors(),n=!!e.vertexAttributes.color,s=!!e.vertexAttributes.tangent;return{hasSymbolVertexColors:r,hasVertexColors:n,hasVertexTangents:s,uid:`vc:${n},vt:${s},vct${i},svc:${r}`}}_textureTransformUid(e){const{offset:i,scale:r,rotation:n}=e??rOt;return`${i[0]},${i[1]},${n},${r[0]},${r[1]}`}_materialProperties(e,i,r){const n=this._materialPropertiesDefault(e,r);if(!i.material)return n;const{color:s,colorTexture:o,colorTextureTransform:l,normalTexture:c,normalTextureTransform:f,doubleSided:_,alphaCutoff:x,alphaMode:T}=i.material,A=this._colorOrTextureUid(s),M=this._colorOrTextureUid(o),I=this._textureTransformUid(l),L=this._colorOrTextureUid(c),F=this._textureTransformUid(f);if(n.color=s,n.colorTexture=o,n.normalTexture=c,n.uid=`${n.uid},cmuid:${A},ctmuid:${M},cttuid:${I},ntmuid:${L},nttuid:${F},ds:${_},ac:${x},am:${T}`,i.material instanceof T8e){const{metallic:z,roughness:k,metallicRoughnessTexture:U,metallicRoughnessTextureTransform:j,emissiveColor:H,emissiveTexture:Y,emissiveTextureTransform:Q,occlusionTexture:ne,occlusionTextureTransform:re}=i.material,he=this._colorOrTextureUid(U),ce=this._textureTransformUid(j),be=this._colorOrTextureUid(H),ye=this._colorOrTextureUid(Y),pe=this._textureTransformUid(Q),Ee=this._colorOrTextureUid(ne),te=this._textureTransformUid(re);n.metallic=z,n.roughness=k,n.metallicRoughnessTexture=U,n.emissiveColor=H,n.emissiveTexture=Y,n.occlusionTexture=ne,n.colorTextureTransform=this._convertTextureTransform(l),n.normalTextureTransform=this._convertTextureTransform(f),n.emissiveTextureTransform=this._convertTextureTransform(Q),n.occlusionTextureTransform=this._convertTextureTransform(re),n.metallicRoughnessTextureTransform=this._convertTextureTransform(j),n.uid=`${n.uid},mrm:${z},mrr:${k},mrt:${he},mrtt:${ce},emuid:${be},etmuid:${ye},ett:${pe},otmuid:${Ee},ott:${te}`}return n}_convertTextureTransform(e){if(!e)return null;const{scale:i,offset:r,rotation:n}=e;return{scale:i,offset:r,rotation:Ei(n)}}_setInternalColorValueParameters(e,i){i.diffuse=qe.toUnitRGB(e),i.opacity=e.a}_getLoadableTextureResource(e){return e.data??e.url}_getInternalTextureId(e){const i=this._getInternalTexture(e,mn.Opaque);return i==null?void 0:i.id}_getInternalTexture(e,i){const r=this._getLoadableTextureResource(e);if(!r)return null;const n=`${e.contentHash}/${i}`;let s=this._textures.get(n);if(!s){let o=null;const l=this._context.stage.renderView.renderingContext.parameters.maxMaxAnisotropy,c={wrap:this._castTextureWrap(e.wrap),noUnpackFlip:!0,maxAnisotropy:l,mipmap:l>1};I$(r)?(o=r.data,c.preMultiplyAlpha=!1,c.encoding=r.encoding):(o=r,c.preMultiplyAlpha=i!==mn.Opaque,c.downsampleUncompressed=this._context.graphicsCoreOwner.view.qualitySettings.graphics3D.uncompressedTextureDownsamplingEnabled),s=new OE(o,c),this._textures.set(n,s),s.load(this._context.stage.renderView.renderingContext),this._context.stage.add(s)}return s}_castTextureWrap(e="repeat"){if(typeof e=="string"){const i=this._castTextureWrapIndividual(e);return{s:i,t:i}}return{s:this._castTextureWrapIndividual(e.horizontal),t:this._castTextureWrapIndividual(e.vertical)}}_castTextureWrapIndividual(e){switch(e){case"clamp":return Bi.CLAMP_TO_EDGE;case"mirror":return Bi.MIRRORED_REPEAT;default:return Bi.REPEAT}}_setInternalMaterialParameters(e,i){if(e.color!=null&&this._setInternalColorValueParameters(e.color,i),e.colorTexture!=null){const r=this._getInternalTexture(e.colorTexture,i.textureAlphaMode);r?(i.textureId=r.id,i.textureAlphaPremultiplied=!!r.parameters.preMultiplyAlpha):i.textureId=void 0}e.normalTexture&&(i.normalTextureId=this._getInternalTextureId(e.normalTexture)),e.emissiveColor&&(i.emissiveFactor=qe.toUnitRGB(e.emissiveColor)),e.emissiveTexture&&(i.emissiveTextureId=this._getInternalTextureId(e.emissiveTexture)),e.occlusionTexture&&(i.occlusionTextureId=this._getInternalTextureId(e.occlusionTexture)),e.metallicRoughnessTexture&&(i.metallicRoughnessTextureId=this._getInternalTextureId(e.metallicRoughnessTexture)),i.colorTextureTransformMatrix=hy(e.colorTextureTransform),i.normalTextureTransformMatrix=hy(e.normalTextureTransform),i.occlusionTextureTransformMatrix=hy(e.occlusionTextureTransform),i.emissiveTextureTransformMatrix=hy(e.emissiveTextureTransform),i.metallicRoughnessTextureTransformMatrix=hy(e.metallicRoughnessTextureTransform)}_setExternalMaterialParameters(e){var n,s;const i=this._drivenProperties.color;let r=((n=this.symbolLayer.material)==null?void 0:n.colorMixMode)??null;if(i)e.externalColor=xf;else{const o=((s=this.symbolLayer.material)==null?void 0:s.color)??null;o?e.externalColor=qe.toUnitRGBA(o):(r=null,e.externalColor=xf)}r&&(e.colorMixMode=r),e.castShadows=!!this.symbolLayer.castShadows}_hasTransparentVertexColors(e){const i=e.vertexAttributes.color;if(i==null)return!1;for(let r=3;rY2(L,A,r,M,F);return T.alignedSampledElevation=_T(T,r,A.spatialReference,I,M),T}_getCenterPointInElevationSR(e){const i=Xu(0,0,0,this._context.elevationProvider.spatialReference!=null?this._context.elevationProvider.spatialReference:null);return x8e([e[12],e[13],e[14]],this._context.renderCoordsHelper.spatialReference,i),i}_createComponentNormals(e,i,r,n){switch(r.shading||"flat"){default:case"source":return this._createComponentNormalsSource(e,i,r,n);case"flat":return this._createComponentNormalsFlat(e,n);case"smooth":return this._createComponentNormalsSmooth(e,n)}}_createComponentNormalsSource(e,i,r,n){if(i==null)return this._createComponentNormalsFlat(e,n);let s=!1;if(!r.trustSourceNormals)for(let o=0;os&&(s=l)}if(r<=s)return this.logger.warn(`Vertex index ${s} is out of bounds of the mesh position buffer`),!1}else if(r%3!=0)return this.logger.warn("Mesh position buffer length must be a multiple of 9 if no component faces are defined (3 values per vertex * 3 vertices per triangle)"),!1;return!0}_getOrCreateFaces(e,i){return i.faces??EE(e.vertexAttributes.position.length/3)}_isOutsideClippingArea(e){var o;if(!this._context.clippingExtent)return!1;const i=(o=e.vertexAttributes)==null?void 0:o.position;if(!i)return!1;const r=this._context.elevationProvider.spatialReference,n=D8e({positions:i,transform:e.transform,vertexSpace:e.vertexSpace,inSpatialReference:e.spatialReference,outSpatialReference:r??e.spatialReference,localMode:this._context.stage.viewingMode===_t.Local}),s=n.length/3;return Bn(ZW),cp(ZW,n,0,s),!ym(ZW,this._context.clippingExtent)}_createGeometryInfo(e,i,r){if(!th(e.spatialReference,this._context.graphicsCoreOwner.view.spatialReference))return this.logger.warn("Geometry spatial reference is not compatible with the view"),null;if(this._isOutsideClippingArea(e))return null;const n=this._createBuffers(e,i);if(n==null)return null;const{positionBuffer:s,uvBuffer:o,colorBuffer:l,symbolColorBuffer:c,normalBuffer:f,tangentBuffer:_,objectTransformation:x,geometryTransformation:T}=n,A=this._getOrCreateComponents(e),M=new Array;let I=!1;const L=zz(Ma,x),F=this._context.localOriginFactory.getOrigin(L);for(const z of A){if(!this._validateFaces(e,z))return null;const k=this._getOrCreateFaces(e,z);if(k.length===0)continue;const U=this._createComponentNormals(s,f,z,k);U.didFlipNormals&&(I=!0);const j=[[J.POSITION,new It(s,k,3,!0)],[J.NORMAL,new It(U.normals,U.indices,3,!0)]];l&&j.push([J.COLOR,new It(l,k,4,!0)]),c&&j.push([J.SYMBOLCOLOR,new It(c,ux(k.length),4,!0)]),o&&j.push([J.UV0,new It(o,k,2,!0)]),_&&j.push([J.TANGENT,new It(_,k,4,!0)]);const H=this._context.stage.renderView.getObjectAndLayerIdColor({graphicUid:r,layerUid:this._context.layer.uid}),Y=this._getOrCreateMaterial(e,z),Q=new Bo(Y,j,null,Ws.Mesh,H);Q.transformation=T,Q.localOrigin=F,M.push(Q)}return I&&this.logger.warn("Normals have been automatically flipped to be consistent with the counter clock wise face winding order. It is better to generate mesh geometries that have consistent normals."),{geometries:M,objectTransformation:x}}_updateMaterialParameters(e){this._materialInfoCache.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachMaterialInfo(e),this._fastUpdateProcessor.forEachClonedMaterial((i,r)=>{r.setParameters(i.parameters)})}test(){return{...super.test(),materials:this._materialInfoCache.materials}}},XW=class{constructor(e,i,r){this.normals=e,this.indices=i,this.didFlipNormals=r}};const GN=W(),Ma=W(),xC=W(),SC=W(),TC=W(),lve=Qe(),xR=as(),tOt=Qe(),ZW=ya(),iOt=[new _Mt],rOt=new EO;var Mh;(function(t){t[t.NONE=0]="NONE",t[t.ECEF=1]="ECEF"})(Mh||(Mh={}));let nOt=class{constructor(e,i,r,n){this.graphics3DSymbolLayer=e,this.instanceIndex=i,this.elevationAligner=r,this.elevationContext=n,this.type="lod-instance",this._highlights=new Set,this.alignedSampledElevation=0,this.isElevationSource=!1,this.needsElevationUpdates=!1}initialize(){}setVisibility(e){const i=this._lodRenderer.instanceData;e!==i.getVisible(this.instanceIndex)&&i.setVisible(this.instanceIndex,e)}destroy(){this.instanceIndex!=null&&(this._lodRenderer.instanceData.removeInstance(this.instanceIndex),this.graphics3DSymbolLayer.notifyDestroyGraphicLayer(this))}alignWithElevation(e,i,r){if(this.elevationAligner){rG(this.elevationContext.featureExpressionInfoContext,r);const n=(o,l)=>Y2(o,e,this.elevationContext,i,l),s=this.elevationAligner(this,this.elevationContext,e.spatialReference,n,i);s!=null&&(this.alignedSampledElevation=s)}}getCenterObjectSpace(e=W()){return this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,cg),bt(e,this._lodRenderer.baseBoundingSphere.center,cg)}getBoundingBoxObjectSpace(e=ya()){this._lodRenderer.instanceData.getCombinedLocalTransform(this.instanceIndex,cg);const i=this._lodRenderer.baseBoundingBox;Bn(e);for(let r=0;r<8;++r)Ie(Fp,1&r?i[3]:i[0],2&r?i[4]:i[1],4&r?i[5]:i[2]),bt(Fp,Fp,cg),qf(e,Fp);return e}computeAttachmentOrigin(e){this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,cg),e.render.origin[0]+=cg[12],e.render.origin[1]+=cg[13],e.render.origin[2]+=cg[14],e.render.num++}async getProjectedBoundingBox(e,i,r,n,s){const o=this.getBoundingBoxObjectSpace(s),l=sOt,c=Dse(o)?1:l.length;this._lodRenderer.instanceData.getGlobalTransform(this.instanceIndex,cg);for(let _=0;_{this._removeHighlightId(n)},r)}}removeObjectState(e){this._highlights.forEach(i=>e.remove(i))}_addHighlightId(e){this._highlights.add(e),this._lodRenderer.instanceData.setHighlight(this.instanceIndex,!0)}_removeHighlightId(e){this._highlights.delete(e),this._lodRenderer.instanceData.setHighlight(this.instanceIndex,this._highlights.size>0)}get _lodRenderer(){return this.graphics3DSymbolLayer.lodRenderer}};const Vx=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],Fp=W(),JW=W(),sOt=[[0,1,2],[3,1,2],[0,4,2],[3,4,2],[0,1,5],[3,1,5],[0,4,5],[3,4,5]],cg=Qe();function oOt(t,e){const i=t.stageResources.geometries.map(n=>new k6e(n,t.stageResources.textures)),r=t.lodThreshold==null||t.lodThreshold===0&&e>0?lOt(i):t.lodThreshold;return new z6e(i,r,t.pivotOffset)}function aOt(t){return new U6e(t.map((e,i)=>oOt(e,i)))}function lOt(t){const e=t.reduce((i,{geometry:r})=>i+r.indexCount/3,0);return Math.sqrt(e*cOt/Math.PI)}const cOt=20;function uOt(t){return t=t||globalThis.location.hostname,hOt.some(e=>(t==null?void 0:t.match(e))!=null)}function Cie(t,e){return t&&(e=e||globalThis.location.hostname)?e.match(j8e)!=null||e.match(H8e)!=null?t.replace("static.arcgis.com","staticdev.arcgis.com"):e.match(G8e)!=null||e.match(q8e)!=null?t.replace("static.arcgis.com","staticqa.arcgis.com"):t:t}const j8e=/^devext.arcgis.com$/,G8e=/^qaext.arcgis.com$/,H8e=/^[\w-]*\.mapsdevext.arcgis.com$/,q8e=/^[\w-]*\.mapsqa.arcgis.com$/,hOt=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local.esri.com$/,j8e,G8e,/^jsapps.esri.com$/,H8e,q8e];function dOt(t,e,i){if(t.count!==e.count)return void uG.error("source and destination buffers need to have the same number of elements");const r=t.count,n=i[0],s=i[1],o=i[2],l=i[3],c=i[4],f=i[5],_=i[6],x=i[7],T=i[8],A=i[9],M=i[10],I=i[11],L=i[12],F=i[13],z=i[14],k=i[15],U=t.typedBuffer,j=t.typedBufferStride,H=e.typedBuffer,Y=e.typedBufferStride;for(let Q=0;Q0){const M=1/Math.sqrt(A);r[c]=M*_,r[c+1]=M*x,r[c+2]=M*T}}}function mOt(t,e,i){tV(t.typedBuffer,e,i,t.typedBufferStride)}function tV(t,e,i,r=4){const n=Math.min(t.length/r,e.count),s=e.typedBuffer,o=e.typedBufferStride;let l=0,c=0;for(let f=0;f{const e={...Y8e,...t.pbrMetallicRoughness},i=AOt({...COt,...t.extras});return{...EOt,...t,pbrMetallicRoughness:e,extras:i}};function AOt(t){switch(t.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:t.ESRI_externalColorMixMode,t.ESRI_externalColorMixMode="tint"}return t}const MOt={magFilter:ki.LINEAR,minFilter:ki.LINEAR_MIPMAP_LINEAR,wrapS:Bi.REPEAT,wrapT:Bi.REPEAT},OOt=t=>({...MOt,...t});function POt(t){let e,i;return t.replace(/^(.*\/)?([^/]*)$/,(r,n,s)=>(e=n||"",i=s||"","")),{dirPart:e,filePart:i}}const HN={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};let ROt=class dw{constructor(e,i,r,n){if(this._context=e,this.uri=i,this.json=r,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu"],this._baseUri=POt(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),r.scenes==null)throw new se("gltf-loader-unsupported-feature","Scenes must be defined.");if(r.meshes==null)throw new se("gltf-loader-unsupported-feature","Meshes must be defined");if(r.nodes==null)throw new se("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,i,r){if(i1(i)){const o=C2(i);if(o&&o.mediaType!=="model/gltf-binary")try{const c=JSON.parse(o.isBase64?atob(o.data):o.data);return new dw(e,i,c)}catch{}const l=Cne(i);if(dw._isGLBData(l))return this._fromGLBData(e,i,l)}if(FOt.test(i)||(r==null?void 0:r.expectedType)==="gltf"){const o=await e.loadJSON(i,r);return new dw(e,i,o)}const n=await e.loadBinary(i,r);if(dw._isGLBData(n))return this._fromGLBData(e,i,n);if(kOt.test(i)||(r==null?void 0:r.expectedType)==="glb")throw new se("gltf-loader-invalid-glb","This is not a valid glb file.");const s=await e.loadJSON(i,r);return new dw(e,i,s)}static _isGLBData(e){if(e==null)return!1;const i=new cve(e);return i.remainingBytes()>=4&&i.readUint32()===HN.MAGIC}static async _fromGLBData(e,i,r){const n=await dw._parseGLBData(r);return new dw(e,i,n.json,n.binaryData)}static async _parseGLBData(e){const i=new cve(e);if(i.remainingBytes()<12)throw new se("gltf-loader-error","glb binary data is insufficiently large.");const r=i.readUint32(),n=i.readUint32(),s=i.readUint32();if(r!==HN.MAGIC)throw new se("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const f=i.readUint32(),_=i.readUint32();if(c===0){if(_!==HN.CHUNK_TYPE_JSON)throw new se("gltf-loader-error","First glb chunk must be JSON.");if(f<0)throw new se("gltf-loader-error","No JSON data found.");o=await VMt(i.readUint8Array(f))}else if(c===1){if(_!==HN.CHUNK_TYPE_BIN)throw new se("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");l=i.readUint8Array(f)}else Ce.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");c+=1}if(!o)throw new se("gltf-loader-error","No glb JSON chunk detected.");return{json:o,binaryData:l}}async getBuffer(e,i){const r=this.json.buffers[e];if(r.uri==null){if(this._glbBuffer==null)throw new se("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,i);if(n.byteLength!==r.byteLength)throw new se("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,i){const r=this._bufferLoaders.get(e);if(r)return r;const n=this.json.buffers[e].uri,s=this._context.loadBinary(this._resolveUri(n),i).then(o=>new Uint8Array(o));return this._bufferLoaders.set(e,s),s}async getAccessor(e,i){if(!this.json.accessors)throw new se("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[e];if((r==null?void 0:r.bufferView)==null)throw new se("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(r.type in[$$.MAT2,$$.MAT3,$$.MAT4])throw new se("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);const n=this.json.bufferViews[r.bufferView],s=await this.getBuffer(n.buffer,i),o=LOt[r.type],l=DOt[r.componentType],c=o*l,f=n.byteStride||c;return{raw:s.buffer,byteStride:f,byteOffset:s.byteOffset+(n.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:f===c,componentCount:o,componentByteSize:l,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,i){if(e.indices==null)return;const r=await this.getAccessor(e.indices,i);if(r.isDenselyPacked)switch(r.componentType){case Yt.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case Yt.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case Yt.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case Yt.UNSIGNED_BYTE:return ak(this._wrapAccessor(T5,r));case Yt.UNSIGNED_SHORT:return ak(this._wrapAccessor(Fj,r));case Yt.UNSIGNED_INT:return ak(this._wrapAccessor(zj,r))}}async getPositionData(e,i){if(e.attributes.POSITION==null)throw new se("gltf-loader-unsupported-feature","No POSITION vertex data found.");const r=await this.getAccessor(e.attributes.POSITION,i);if(r.componentType!==Yt.FLOAT)throw new se("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+Yt[r.componentType]);if(r.componentCount!==3)throw new se("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+r.componentCount.toFixed());return this._wrapAccessor(Ea,r)}async getNormalData(e,i){if(e.attributes.NORMAL==null)throw new se("gltf-loader-error","No NORMAL vertex data found.");const r=await this.getAccessor(e.attributes.NORMAL,i);if(r.componentType!==Yt.FLOAT)throw new se("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+Yt[r.componentType]);if(r.componentCount!==3)throw new se("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+r.componentCount.toFixed());return this._wrapAccessor(Ea,r)}async getTangentData(e,i){if(e.attributes.TANGENT==null)throw new se("gltf-loader-error","No TANGENT vertex data found.");const r=await this.getAccessor(e.attributes.TANGENT,i);if(r.componentType!==Yt.FLOAT)throw new se("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+Yt[r.componentType]);if(r.componentCount!==4)throw new se("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+r.componentCount.toFixed());return new Fm(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*r.entryCount)}async getTextureCoordinates(e,i){if(e.attributes.TEXCOORD_0==null)throw new se("gltf-loader-error","No TEXCOORD_0 vertex data found.");const r=await this.getAccessor(e.attributes.TEXCOORD_0,i);if(r.componentCount!==2)throw new se("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+r.componentCount.toFixed());if(r.componentType===Yt.FLOAT)return this._wrapAccessor(TE,r);if(!r.normalized)throw new se("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return NOt(r)}async getVertexColors(e,i){if(e.attributes.COLOR_0==null)throw new se("gltf-loader-error","No COLOR_0 vertex data found.");const r=await this.getAccessor(e.attributes.COLOR_0,i);if(r.componentCount!==4&&r.componentCount!==3)throw new se("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+r.componentCount.toFixed());if(r.componentCount===4){if(r.componentType===Yt.FLOAT)return this._wrapAccessor(Fm,r);if(r.componentType===Yt.UNSIGNED_BYTE)return this._wrapAccessor(Ac,r);if(r.componentType===Yt.UNSIGNED_SHORT)return this._wrapAccessor(Y9,r)}else if(r.componentCount===3){if(r.componentType===Yt.FLOAT)return this._wrapAccessor(Ea,r);if(r.componentType===Yt.UNSIGNED_BYTE)return this._wrapAccessor(Nj,r);if(r.componentType===Yt.UNSIGNED_SHORT)return this._wrapAccessor(kj,r)}throw new se("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+Yt[r.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,i,r){var s,o,l,c,f,_,x,T,A,M;let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const I=e.material!=null?hve(this.json.materials[e.material]):hve(),L=I.pbrMetallicRoughness,F=this.hasVertexColors(e),z=this.getTexture(L.baseColorTexture,i),k=this.getTexture(I.normalTexture,i),U=r?this.getTexture(I.occlusionTexture,i):void 0,j=r?this.getTexture(I.emissiveTexture,i):void 0,H=r?this.getTexture(L.metallicRoughnessTexture,i):void 0,Y=e.material!=null?e.material:-1;n={alphaMode:I.alphaMode,alphaCutoff:I.alphaCutoff,color:L.baseColorFactor,doubleSided:!!I.doubleSided,colorTexture:await z,normalTexture:await k,name:I.name,id:Y,occlusionTexture:await U,emissiveTexture:await j,emissiveFactor:I.emissiveFactor,metallicFactor:L.metallicFactor,roughnessFactor:L.roughnessFactor,metallicRoughnessTexture:await H,hasVertexColors:F,ESRI_externalColorMixMode:I.extras.ESRI_externalColorMixMode,colorTextureTransform:(o=(s=L==null?void 0:L.baseColorTexture)==null?void 0:s.extensions)==null?void 0:o.KHR_texture_transform,normalTextureTransform:(c=(l=I.normalTexture)==null?void 0:l.extensions)==null?void 0:c.KHR_texture_transform,occlusionTextureTransform:(_=(f=I.occlusionTexture)==null?void 0:f.extensions)==null?void 0:_.KHR_texture_transform,emissiveTextureTransform:(T=(x=I.emissiveTexture)==null?void 0:x.extensions)==null?void 0:T.KHR_texture_transform,metallicRoughnessTextureTransform:(M=(A=L==null?void 0:L.metallicRoughnessTexture)==null?void 0:A.extensions)==null?void 0:M.KHR_texture_transform}}return n}async getTexture(e,i){if(!e)return;if((e.texCoord||0)!==0)throw new se("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const r=e.index,n=this.json.textures[r],s=OOt(n.sampler!=null?this.json.samplers[n.sampler]:{}),o=this._getTextureSourceId(n),l=this.json.images[o],c=await this._loadTextureImageData(r,n,i);return XV(this._textureCache,r,()=>{const f=x=>x===33071||x===33648||x===10497,_=x=>{throw new se("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${x}`)};return{data:c,wrapS:f(s.wrapS)?s.wrapS:_(s.wrapS),wrapT:f(s.wrapT)?s.wrapT:_(s.wrapT),minFilter:s.minFilter,name:l.name,id:r}})}getNodeTransform(e){if(e===void 0)return IOt;let i=this._nodeTransformCache.get(e);if(!i){const r=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?i=nn(Qe(),r,n.matrix):n.translation||n.rotation||n.scale?(i=o5(r),n.translation&&Qu(i,i,n.translation),n.rotation&&(qN[3]=Poe(qN,n.rotation),Wh(i,i,qN[3],qN)),n.scale&&$9(i,i,n.scale)):i=o5(r),this._nodeTransformCache.set(e,i)}return i}_wrapAccessor(e,i){return new e(i.raw,i.byteOffset,i.byteStride,i.byteOffset+i.byteStride*(i.entryCount-1)+i.componentByteSize*i.componentCount)}_resolveUri(e){return Gh(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=$2.parse(this.json.asset.version,"glTF");$Ot.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(i=>this._supportedExtensions.includes(i)))throw new se("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,i)=>{e.children&&e.children.forEach(r=>{this._nodeParentMap.set(r,i)})})}async _loadTextureImageData(e,i,r){const n=this._textureLoaders.get(e);if(n)return n;const s=this._createTextureLoader(i,r);return this._textureLoaders.set(e,s),s}_getTextureSourceId(e){if(e.extensions!==void 0&&e.extensions.KHR_texture_basisu!==null)return e.extensions.KHR_texture_basisu.source;if(e.source!==null)return e.source;throw new se("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}async _createTextureLoader(e,i){const r=this._getTextureSourceId(e),n=this.json.images[r];if(n.uri){if(n.uri.endsWith(".ktx2")){const c=await this._context.loadBinary(this._resolveUri(n.uri),i);return new z8e(new Uint8Array(c))}return this._context.loadImage(this._resolveUri(n.uri),i)}if(n.bufferView==null)throw new se("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(n.mimeType==null)throw new se("gltf-loader-unsupported-feature","Image mimeType must be defined.");const s=this.json.bufferViews[n.bufferView],o=await this.getBuffer(s.buffer,i);if(s.byteStride!=null)throw new se("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const l=o.byteOffset+(s.byteOffset||0);return BMt(new Uint8Array(o.buffer,l,s.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await ZX(Array.from(this._bufferLoaders.values())),i=await ZX(Array.from(this._textureLoaders.values()));return e.reduce((r,n)=>r+((n==null?void 0:n.byteLength)??0),0)+i.reduce((r,n)=>r+(n?I$(n)?n.data.byteLength:n.width*n.height*4:0),0)}};const IOt=qAe(Qe(),Math.PI/2),$Ot=new $2(2,0,"glTF"),qN=Cp(),LOt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},DOt={[Yt.BYTE]:1,[Yt.UNSIGNED_BYTE]:1,[Yt.SHORT]:2,[Yt.UNSIGNED_SHORT]:2,[Yt.FLOAT]:4,[Yt.INT]:4,[Yt.UNSIGNED_INT]:4};function NOt(t){switch(t.componentType){case Yt.BYTE:return new Uj(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Yt.UNSIGNED_BYTE:return new Dj(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Yt.SHORT:return new X9(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Yt.UNSIGNED_SHORT:return new zae(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Yt.UNSIGNED_INT:return new Uae(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount);case Yt.FLOAT:return new TE(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*t.entryCount)}}const FOt=/\.gltf$/i,kOt=/\.glb$/i;let zOt=0;async function X8e(t,e,i={},r=!0){const n=await ROt.load(t,e,i),s="gltf_"+zOt++,o={lods:[],materials:new Map,textures:new Map,meta:UOt(n)},l=!(!n.json.asset.extras||n.json.asset.extras.ESRI_type!=="symbolResource"),c=new Map;await VOt(n,async(_,x,T,A)=>{var re;const M=c.get(T)??0;c.set(T,M+1);const I=_.mode!==void 0?_.mode:sr.TRIANGLES,L=I===sr.TRIANGLES||I===sr.TRIANGLE_STRIP||I===sr.TRIANGLE_FAN?I:null;if(L==null)return void Ce.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+sr[I]+"). Skipping primitive.");if(!n.hasPositions(_))return void Ce.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const F=n.getPositionData(_,i),z=n.getMaterial(_,i,r),k=n.hasNormals(_)?n.getNormalData(_,i):null,U=n.hasTangents(_)?n.getTangentData(_,i):null,j=n.hasTextureCoordinates(_)?n.getTextureCoordinates(_,i):null,H=n.hasVertexColors(_)?n.getVertexColors(_,i):null,Y=n.getIndexData(_,i),Q={name:A,transform:o5(x),attributes:{position:await F,normal:k?await k:null,texCoord0:j?await j:null,color:H?await H:null,tangent:U?await U:null},indices:await Y,primitiveType:L,material:jOt(o,await z,s)};let ne=null;((re=o.meta)==null?void 0:re.ESRI_lod)!=null&&o.meta.ESRI_lod.metric==="screenSpaceRadius"&&(ne=o.meta.ESRI_lod.thresholds[T]),o.lods[T]=o.lods[T]||{parts:[],name:A,lodThreshold:ne},o.lods[T].parts[M]=Q});for(const _ of o.lods)_.parts=_.parts.filter(x=>!!x);const f=await n.getLoadedBuffersSize();return{model:o,meta:{isEsriSymbolResource:l,uri:n.uri},customMeta:{},size:f}}function UOt(t){const e=t.json;let i=null;return e.nodes.forEach(r=>{const n=r.extras;n!=null&&(n.ESRI_proxyEllipsoid||n.ESRI_lod)&&(i=n)}),i}async function VOt(t,e){const i=t.json,r=i.scenes[i.scene||0].nodes,n=r.length>1,s=[];for(const l of r){const c=i.nodes[l];s.push(o(l,0)),BOt(c)&&!n&&c.extensions.MSFT_lod.ids.forEach((f,_)=>o(f,_+1))}async function o(l,c){const f=i.nodes[l],_=t.getNodeTransform(l);if(f.weights!=null&&Ce.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),f.mesh!=null){const x=i.meshes[f.mesh];for(const T of x.primitives)s.push(e(T,_,c,x.name))}for(const x of f.children||[])s.push(o(x,c))}await Promise.all(s)}function BOt(t){var e;return((e=t.extensions)==null?void 0:e.MSFT_lod)&&Array.isArray(t.extensions.MSFT_lod.ids)}function jOt(t,e,i){const r=s=>{const o=`${i}_tex_${s&&s.id}${s!=null&&s.name?"_"+s.name:""}`;if(s&&!t.textures.has(o)){const l=TOt(s.data,{wrap:{s:s.wrapS,t:s.wrapT},mipmap:GOt.has(s.minFilter),noUnpackFlip:!0});t.textures.set(o,l)}return o},n=`${i}_mat_${e.id}_${e.name}`;if(!t.materials.has(n)){const s=SOt({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?r(e.colorTexture):void 0,textureNormal:e.normalTexture?r(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?r(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?r(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?r(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor});t.materials.set(n,s)}return n}const GOt=new Set([ki.LINEAR_MIPMAP_LINEAR,ki.LINEAR_MIPMAP_NEAREST]);function HOt(t,e){switch(e){case sr.TRIANGLES:return qOt(t);case sr.TRIANGLE_STRIP:return WOt(t);case sr.TRIANGLE_FAN:return YOt(t)}}function qOt(t){return typeof t=="number"?EE(t):Zw(t)?new Uint16Array(t):t}function WOt(t){const e=typeof t=="number"?t:t.length;if(e<3)return[];const i=e-2,r=TU(3*i);if(typeof t=="number"){let n=0;for(let s=0;s{if(F.params.topology==="PerAttributeArray")return null;const Ee=F.params.faces;for(const te in Ee)if(te===pe)return Ee[te].values;return null},H=k[J.POSITION],Y=H.values.length/H.valuesPerElement;for(const pe in k){const Ee=k[pe],te=Ee.values,le=j(pe)??EE(Y);U.push([pe,new It(te,le,Ee.valuesPerElement,!0)])}const Q=z.texture,ne=x&&x[Q];if(ne&&!A.has(Q)){const{image:pe,parameters:Ee}=ne,te=new OE(pe,Ee);r.push(te),A.set(Q,te)}const re=A.get(Q),he=re?re.id:void 0,ce=z.material;let be=s.get(ce,Q);if(be==null){const pe=_[ce.substring(ce.lastIndexOf("/")+1)].params;pe.transparency===1&&(pe.transparency=0);const Ee=ne&&ne.alphaChannelUsage,te=pe.transparency>0||Ee==="transparency"||Ee==="maskAndTransparency",le=ne?K8e(ne.alphaChannelUsage):void 0,de={ambient:mc(pe.diffuse),diffuse:mc(pe.diffuse),opacity:1-(pe.transparency||0),transparent:te,textureAlphaMode:le,textureAlphaCutoff:.33,textureId:he,initTextureTransparent:!0,doubleSided:!0,cullFace:Ln.None,colorMixMode:pe.externalColorMixMode||"tint",textureAlphaPremultiplied:(ne==null?void 0:ne.parameters.preMultiplyAlpha)??!1};e!=null&&e.materialParameters&&Object.assign(de,e.materialParameters),be=new km(de),s.set(ce,Q,be)}n.push(be);const ye=new Bo(be,U);T+=((I=(M=U.find(pe=>pe[0]===J.POSITION))==null?void 0:M[1])==null?void 0:I.indices.length)??0,i.push(ye)}return{engineResources:[{name:c,stageResources:{textures:r,materials:n,geometries:i},pivotOffset:o.model.pivotOffset,numberOfVertices:T,lodThreshold:null}],referenceBoundingBox:t5t(i)}}function t5t(t){const e=Bn();return t.forEach(i=>{const r=i.boundingInfo;r!=null&&(qf(e,r.bbMin),qf(e,r.bbMax))}),e}async function i5t(t,e){const i=new Array;for(const s in t){const o=t[s],l=o.images[0].data;if(!l){tv.warn("Externally referenced texture data is not yet supported");continue}const c=o.encoding+";base64,"+l,f="/textureDefinitions/"+s,_=o.channels==="rgba"?o.alphaChannelUsage||"transparency":"none",x={noUnpackFlip:!0,wrap:{s:Bi.REPEAT,t:Bi.REPEAT},preMultiplyAlpha:K8e(_)!==mn.Opaque},T=e!=null&&e.disableTextures?Promise.resolve(null):C_(c,e);i.push(T.then(A=>({refId:f,image:A,parameters:x,alphaChannelUsage:_})))}const r=await Promise.all(i),n={};for(const s of r)n[s.refId]=s;return n}function K8e(t){switch(t){case"mask":return mn.Mask;case"maskAndTransparency":return mn.MaskBlend;case"none":return mn.Opaque;default:return mn.Blend}}function r5t(t){const e=t.params;return{id:1,material:e.material,texture:e.texture,region:e.texture}}const n5t=new $2(1,2,"wosr"),EC=2.1;async function Q8e(t,e){var x;const i=e7e(Cie(t));if(i.fileType==="wosr"){const T=await(e.cache?e.cache.loadWOSR(i.url,e):Z8e(i.url,e)),{engineResources:A,referenceBoundingBox:M}=e5t(T,e);return{lods:A,referenceBoundingBox:M,isEsriSymbolResource:!1,isWosr:!0}}const r=await(e.cache?e.cache.loadGLTF(i.url,e,!!e.usePBR):X8e(new W8e(e.streamDataRequester),i.url,e,e.usePBR)),n=(x=r.model.meta)==null?void 0:x.ESRI_proxyEllipsoid,s=r.meta.isEsriSymbolResource&&n!=null&&r.meta.uri.includes("/RealisticTrees/");s&&!r.customMeta.esriTreeRendering&&(r.customMeta.esriTreeRendering=!0,l5t(r,n));const o=!!e.usePBR,l=r.meta.isEsriSymbolResource?{usePBR:o,isSchematic:!1,treeRendering:s,mrrFactors:[...y3t]}:{usePBR:o,isSchematic:!1,treeRendering:!1,mrrFactors:[...sG]},c={...e.materialParameters,treeRendering:s},{engineResources:f,referenceBoundingBox:_}=t7e(r,l,c,e.skipHighLods&&i.specifiedLodIndex==null?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:i.specifiedLodIndex});return{lods:f,referenceBoundingBox:_,isEsriSymbolResource:r.meta.isEsriSymbolResource,isWosr:!1}}function e7e(t){const e=t.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return e?{fileType:"gltf",url:e[1],specifiedLodIndex:e[4]!=null?Number(e[4]):null}:t.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:t,specifiedLodIndex:null}:{fileType:"unknown",url:t,specifiedLodIndex:null}}function t7e(t,e,i,r){const n=t.model,s=new Array,o=new Map,l=new Map,c=n.lods.length,f=Bn();return n.lods.forEach((_,x)=>{const T=r.skipHighLods===!0&&(c>1&&x===0||c>3&&x===1)||r.skipHighLods===!1&&r.singleLodIndex!=null&&x!==r.singleLodIndex;if(T&&x!==0)return;const A=new ZOt(_.name,_.lodThreshold,[0,0,0]);_.parts.forEach(M=>{const I=T?new km({}):s5t(n,M,A,e,i,o,l),{geometry:L,vertexCount:F}=o5t(M,I??new km({})),z=L.boundingInfo;z!=null&&x===0&&(qf(f,z.bbMin),qf(f,z.bbMax)),I!=null&&(A.stageResources.geometries.push(L),A.numberOfVertices+=F)}),T||s.push(A)}),{engineResources:s,referenceBoundingBox:f}}function s5t(t,e,i,r,n,s,o){const l=e.material+(e.attributes.normal?"_normal":"")+(e.attributes.color?"_color":"")+(e.attributes.texCoord0?"_texCoord0":"")+(e.attributes.tangent?"_tangent":""),c=t.materials.get(e.material),f=e.attributes.texCoord0!=null,_=e.attributes.normal!=null;if(c==null)return null;const x=a5t(c.alphaMode);if(!s.has(l)){if(f){const j=(H,Y=!1)=>{if(H!=null&&!o.has(H)){const Q=t.textures.get(H);if(Q!=null){const ne=Q.data;o.set(H,new OE(I$(ne)?ne.data:ne,{...Q.parameters,preMultiplyAlpha:!I$(ne)&&Y,encoding:I$(ne)&&ne.encoding!=null?ne.encoding:void 0}))}}};j(c.textureColor,x!==mn.Opaque),j(c.textureNormal),j(c.textureOcclusion),j(c.textureEmissive),j(c.textureMetallicRoughness)}const A=c.color[0]**(1/EC),M=c.color[1]**(1/EC),I=c.color[2]**(1/EC),L=c.emissiveFactor[0]**(1/EC),F=c.emissiveFactor[1]**(1/EC),z=c.emissiveFactor[2]**(1/EC),k=c.textureColor!=null&&f?o.get(c.textureColor):null,U=X6e({normalTexture:c.textureNormal,metallicRoughnessTexture:c.textureMetallicRoughness,metallicFactor:c.metallicFactor,roughnessFactor:c.roughnessFactor,emissiveTexture:c.textureEmissive,emissiveFactor:c.emissiveFactor,occlusionTexture:c.textureOcclusion});s.set(l,new km({...r,transparent:x===mn.Blend,customDepthTest:WT.Lequal,textureAlphaMode:x,textureAlphaCutoff:c.alphaCutoff,diffuse:[A,M,I],ambient:[A,M,I],opacity:c.opacity,doubleSided:c.doubleSided,doubleSidedType:"winding-order",cullFace:c.doubleSided?Ln.None:Ln.Back,hasVertexColors:!!e.attributes.color,hasVertexTangents:!!e.attributes.tangent,normalType:_?Br.Attribute:Br.ScreenDerivative,castShadows:!0,textureId:k!=null?k.id:void 0,colorMixMode:c.colorMixMode,normalTextureId:c.textureNormal!=null&&f?o.get(c.textureNormal).id:void 0,textureAlphaPremultiplied:k!=null&&!!k.parameters.preMultiplyAlpha,occlusionTextureId:c.textureOcclusion!=null&&f?o.get(c.textureOcclusion).id:void 0,emissiveTextureId:c.textureEmissive!=null&&f?o.get(c.textureEmissive).id:void 0,metallicRoughnessTextureId:c.textureMetallicRoughness!=null&&f?o.get(c.textureMetallicRoughness).id:void 0,emissiveFactor:[L,F,z],mrrFactors:U?[...Ale]:[c.metallicFactor,c.roughnessFactor,r.mrrFactors[2]],isSchematic:U,colorTextureTransformMatrix:hy(c.colorTextureTransform),normalTextureTransformMatrix:hy(c.normalTextureTransform),occlusionTextureTransformMatrix:hy(c.occlusionTextureTransform),emissiveTextureTransformMatrix:hy(c.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:hy(c.metallicRoughnessTextureTransform),...n}))}const T=s.get(l);if(i.stageResources.materials.push(T),f){const A=M=>{M!=null&&i.stageResources.textures.push(o.get(M))};A(c.textureColor),A(c.textureNormal),A(c.textureOcclusion),A(c.textureEmissive),A(c.textureMetallicRoughness)}return T}function o5t(t,e){const i=t.attributes.position.count,r=HOt(t.indices||i,t.primitiveType),n=Rs(3*i),{typedBuffer:s,typedBufferStride:o}=t.attributes.position;Um(n,s,t.transform,3,o);const l=[[J.POSITION,new It(n,r,3,!0)]];if(t.attributes.normal!=null){const c=Rs(3*i),{typedBuffer:f,typedBufferStride:_}=t.attributes.normal;v_(WN,t.transform),Vm(c,f,WN,3,_),l.push([J.NORMAL,new It(c,r,3,!0)])}if(t.attributes.tangent!=null){const c=Rs(4*i),{typedBuffer:f,typedBufferStride:_}=t.attributes.tangent;v_(WN,t.transform),lce(c,f,WN,4,_),l.push([J.TANGENT,new It(c,r,4,!0)])}if(t.attributes.texCoord0!=null){const c=Rs(2*i),{typedBuffer:f,typedBufferStride:_}=t.attributes.texCoord0;cce(c,f,2,_),l.push([J.UV0,new It(c,r,2,!0)])}if(t.attributes.color!=null){const c=new Uint8Array(4*i);t.attributes.color.elementCount===4?t.attributes.color instanceof Fm?tV(c,t.attributes.color,255):t.attributes.color instanceof Ac?uce(c,t.attributes.color):t.attributes.color instanceof Y9&&tV(c,t.attributes.color,1/256):(c.fill(255),t.attributes.color instanceof Ea?jU(c,t.attributes.color,255,4):t.attributes.color instanceof Nj?h6(c,t.attributes.color.typedBuffer,4,t.attributes.color.typedBufferStride):t.attributes.color instanceof kj&&jU(c,t.attributes.color,1/256,4)),l.push([J.COLOR,new It(c,r,4,!0)])}return{geometry:new Bo(e,l),vertexCount:i}}const WN=as();function a5t(t){switch(t){case"BLEND":return mn.Blend;case"MASK":return mn.Mask;case"OPAQUE":case null:case void 0:return mn.Opaque}}function l5t(t,e){for(let i=0;i1&&Qr(_,_,c,F>-1?.2:Math.min(-4*F-3.8,1)),T[M]=_[0],T[M+1]=_[1],T[M+2]=_[2],M+=3,x[I]=255*k,x[I+1]=255*k,x[I+2]=255*k,x[I+3]=255,I+=4}n.attributes.normal=new Ea(T),n.attributes.color=new Ac(x)}}}const kci=Object.freeze(Object.defineProperty({__proto__:null,fetch:Q8e,gltfToEngineResources:t7e,parseUrl:e7e},Symbol.toStringTag,{value:"Module"}));function i7e(t,e,i,r){const n=t.name;return n==null?Promise.reject(new se("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference")):t.styleName&&t.styleName==="Esri2DPointSymbolsStyle"?c5t(n,e,r):eoe(t,e,r).then(s=>dce(s,n,e,i,l5e,r))}function hce(t,e){return e.items.find(i=>i.name===t)}function dce(t,e,i,r,n,s){var A,M;const o=(i==null?void 0:i.portal)!=null?i.portal:os.getDefault(),l={portal:o,url:qs(t.baseUrl),origin:"portal-item"},c=hce(e,t.data);if(!c){const I=`The symbol name '${e}' could not be found`;return Promise.reject(new se("symbolstyleutils:symbol-name-not-found",I,{symbolName:e}))}let f=f_(n(c,r),l),_=((A=c.thumbnail)==null?void 0:A.href)??null;const x=(M=c.thumbnail)==null?void 0:M.imageData;uOt()&&(f=Cie(f)??"",_=Cie(_));const T={portal:o,url:qs(One(f)),origin:"portal-item"};return toe(f,s).then(I=>{const L=r==="cimRef"?a5e(I.data):I.data,F=BOe(L,T);if(F&&Hy(F)){if(_){const z=f_(_,l);F.thumbnail=new hT({url:z})}else x&&(F.thumbnail=new hT({url:`data:image/png;base64,${x}`}));t.styleUrl?F.styleOrigin=new yL({portal:i.portal,styleUrl:t.styleUrl,name:e}):t.styleName&&(F.styleOrigin=new yL({portal:i.portal,styleName:t.styleName,name:e}))}return F})}function c5t(t,e,i){const r=Mst.replaceAll(/\{SymbolName\}/gi,t),n=e.portal!=null?e.portal:os.getDefault();return toe(r,i).then(s=>{const o=a5e(s.data);return BOe(o,{portal:n,url:qs(One(r)),origin:"portal-item"})})}const u5t=Object.freeze(Object.defineProperty({__proto__:null,fetchSymbolFromStyle:dce,getStyleItemFromStyle:hce,resolveWebStyleSymbol:i7e},Symbol.toStringTag,{value:"Module"}));async function h5t(t){var l;if(t===null||t.styleName==null&&t.styleUrl==null)return null;const e=t.name;if(e==null)throw new se("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference");const i={portal:t.portal},r=await eoe(t,i).catch(()=>null);if(r===null)return null;const n=hce(e,r.data);if(n&&!((l=n.formatInfos)!=null&&l.some(c=>c.type==="gltf_basisu")))return null;const s=await dce(r,e,i,"webRef",(c,f)=>l5e(c,f,["gltf_basisu","gltf"])).catch(()=>null);if(s===null||s.type!=="point-3d")return null;const o=s.symbolLayers.items[0];return o.type==="object"?o.resource:null}let d5t=class{constructor(e,i,r){this._elementSize=i,this._buffer=Yr.createVertex(e,Pr.STATIC_DRAW),this.resize(r)}destroy(){this._buffer.dispose()}get elementSize(){return this._elementSize}get capacity(){return this._capacity}get array(){return this._array}get buffer(){return this._buffer}get usedMemory(){return this._array.byteLength+this._buffer.byteLength}copyRange(e,i,r,n=0){const s=new Uint8Array(this.array,e*this.elementSize,(i-e)*this.elementSize);new Uint8Array(r.array,n*this.elementSize).set(s)}transferAll(){this._buffer.setData(this._array)}transferRange(e,i){const r=e*this._elementSize,n=i*this._elementSize;this._buffer.setSubData(new Uint8Array(this._array),r,r,n)}resize(e){const i=e*this._elementSize,r=new ArrayBuffer(i);this._array&&(e>=this._capacity?new Uint8Array(r).set(new Uint8Array(this._array)):new Uint8Array(r).set(new Uint8Array(this._array).subarray(0,e*this._elementSize))),this._array=r,this._buffer.setSize(i),this._capacity=e}},p5t=class{constructor(e){this.modelOriginHi=e.getField(J.INSTANCEMODELORIGINHI,Ea),this.modelOriginLo=e.getField(J.INSTANCEMODELORIGINLO,Ea),this.model=e.getField(J.INSTANCEMODEL,j2),this.modelNormal=e.getField(J.INSTANCEMODELNORMAL,j2),this.featureAttribute=e.getField(J.INSTANCEFEATUREATTRIBUTE,Fm),this.color=e.getField(J.INSTANCECOLOR,Ac),this.objectAndLayerIdColor=e.getField(J.INSTANCEOBJECTANDLAYERIDCOLOR,Ac)}},dve=class{constructor(e,i){this._headIndex=0,this._tailIndex=0,this._firstIndex=null,this._captureFirstIndex=!0,this._updating=!1,this._prevHeadIndex=0,this._resized=!1,this._rctx=e,this._instanceBufferLayout=i,this._elementSize=i.stride,this._capacity=1}destroy(){this._buffer&&this._buffer.destroy()}get buffer(){return this._buffer.buffer}get view(){return this._view}get capacity(){return this._capacity}get size(){const e=this._headIndex,i=this._tailIndex;return e>=i?e-i:e+this._capacity-i}get isEmpty(){return this._headIndex===this._tailIndex}get isFull(){return this._tailIndex===(this._headIndex+1)%this._capacity}get headIndex(){return this._headIndex}get tailIndex(){return this._tailIndex}get firstIndex(){return this._firstIndex}get usedMemory(){var e;return((e=this._buffer)==null?void 0:e.usedMemory)??0}reset(){this._headIndex=0,this._tailIndex=0,this._firstIndex=null}startUpdateCycle(){this._captureFirstIndex=!0}beginUpdate(){Xt(!this._updating,"already updating"),this._updating=!0,this._prevHeadIndex=this._headIndex}endUpdate(){Xt(this._updating,"not updating"),this.size0,"invalid size");const e=this._tailIndex===this._firstIndex;this._incrementTail(),e&&(this._firstIndex=this._tailIndex)}_grow(){const e=Math.max(iV,Math.floor(this._capacity*VV));this._resize(e)}_shrink(){const e=Math.max(iV,Math.floor(this._capacity*wje));this._resize(e)}_resize(e){if(Xt(this._updating,"not updating"),e===this._capacity)return;const i=new d5t(this._rctx,this._elementSize,e);if(this._buffer){this._firstIndex&&(this._firstIndex=(this._firstIndex+this._capacity-this._tailIndex)%this._capacity);const r=this.size,n=this._compactInstances(i);Xt(n===r,"invalid compaction"),this._buffer.destroy(),this._tailIndex=0,this._headIndex=n,this._prevHeadIndex=0}this._resized=!0,this._capacity=e,this._buffer=i,this._view=new p5t(this._instanceBufferLayout.createView(this._buffer.array))}_compactInstances(e){const i=this._headIndex,r=this._tailIndex;return ri?(this._buffer.copyRange(r,this._capacity,e),i>0&&this._buffer.copyRange(0,i,e,this._capacity-r),i+(this._capacity-r)):0}_incrementHead(e=1){this._headIndex=(this._headIndex+e)%this._capacity}_incrementTail(e=1){this._tailIndex=(this._tailIndex+e)%this._capacity}_transferRange(e,i){ei&&(i>0&&this._buffer.transferRange(0,i),this._buffer.transferRange(e,this._capacity))}};const iV=64;var es;function f5t(t){let e=ls().mat4f64(J.LOCALTRANSFORM).mat4f64(J.GLOBALTRANSFORM).vec4f64(J.BOUNDINGSPHERE).vec3f64(J.MODELORIGIN).mat3f(J.INSTANCEMODEL).mat3f(J.INSTANCEMODELNORMAL).vec2f(J.MODELSCALEFACTORS);return t.includes(J.FEATUREATTRIBUTE)&&(e=e.vec4f(J.FEATUREATTRIBUTE)),t.includes(J.COLOR)&&(e=e.vec4u8(J.COLOR)),t.includes(J.OBJECTANDLAYERIDCOLOR)&&(e=e.vec4u8(J.OBJECTANDLAYERIDCOLOR)),e=e.u8(J.STATE).u8(J.LODLEVEL),e}(function(t){t[t.ALLOCATED=1]="ALLOCATED",t[t.DEFAULT_ACTIVE=2]="DEFAULT_ACTIVE",t[t.VISIBLE=4]="VISIBLE",t[t.HIGHLIGHT=8]="HIGHLIGHT",t[t.HIGHLIGHT_ACTIVE=16]="HIGHLIGHT_ACTIVE",t[t.REMOVE=32]="REMOVE",t[t.TRANSFORM_CHANGED=64]="TRANSFORM_CHANGED",t[t.ACTIVE=18]="ACTIVE"})(es||(es={}));let pve=class{constructor(e){this.localTransform=e.getField(J.LOCALTRANSFORM,PL),this.globalTransform=e.getField(J.GLOBALTRANSFORM,PL),this.modelOrigin=e.getField(J.MODELORIGIN,e0),this.model=e.getField(J.INSTANCEMODEL,j2),this.modelNormal=e.getField(J.INSTANCEMODELNORMAL,j2),this.modelScaleFactors=e.getField(J.MODELSCALEFACTORS,TE),this.boundingSphere=e.getField(J.BOUNDINGSPHERE,Lj),this.featureAttribute=e.getField(J.FEATUREATTRIBUTE,Fm),this.color=e.getField(J.COLOR,Ac),this.objectAndLayerIdColor=e.getField(J.OBJECTANDLAYERIDCOLOR,Ac),this.state=e.getField(J.STATE,T5),this.lodLevel=e.getField(J.LODLEVEL,T5)}},YA=class extends ze{constructor(e,i){super(e),this.events=new Dn,this._capacity=0,this._size=0,this._next=0,this._layout=f5t(i),this._capacity=iV,this._buffer=this._layout.createBuffer(this._capacity),this._view=new pve(this._buffer)}get capacity(){return this._capacity}get size(){return this._size}get view(){return this._view}addInstance(){this._size+1>this._capacity&&this._grow();const e=this._findSlot();return this._view.state.set(e,es.ALLOCATED),this._size++,this.events.emit("instances-changed"),e}removeInstance(e){const i=this._view.state;Xt(e>=0&&e=0&&ethis._instanceData.view.boundingSphere.getVec(r,this._tmpSphere),{maximumDepth:25}),this._instanceData=e,this._boundingSphere=i,this._tmpSphere=co(),this._tmpMat4=Qe()}addInstance(e){const i=this._instanceData.view.boundingSphere,r=this._instanceData.getCombinedModelTransform(e,this._tmpMat4);bt(this._tmpSphere,this._boundingSphere.center,r),this._tmpSphere[3]=this._boundingSphere.radius*l5(r),i.setVec(e,this._tmpSphere),this.add([e])}removeInstance(e){this.remove([e])}},y5t=class{constructor(e,i){this._worldSpaceRadius=e,this._minScreenSpaceRadii=i}selectLevel(e,i,r){const n=r.computeScreenPixelSizeAt(e),s=this._worldSpaceRadius*i/n;let o=0;for(let l=1;l=this._minScreenSpaceRadii[l]&&(o=l);return o}},v5t=class extends vj{constructor(e,i,r,n,s,o){super(e,i),this.layerUid=e,this.graphicUid=i,this.geometryId=r,this.triangleNr=n,this.baseBoundingSphere=s,this.numLodLevels=o}};function pce(t){return Gm(t)&&t.intersector===ms.LOD&&!!t.target}let _5t=class{constructor(e,i){const r=e.renderContext.rctx,n=i.geometry;this._materialRepository=e.materialRepository,n.material.setParameters({instancedDoublePrecision:!0});const s=n.material.createBufferWriter(),o=s.vertexBufferLayout,l=s.elementCount(n),c=o.createBuffer(l);s.write(null,null,n,c,0),this.geometry=n,this.material=n.material,this.glMaterials=new FNe(n.material,this._materialRepository),this.vertexBufferLayout=o,this.vbo=Yr.createVertex(r,Pr.STATIC_DRAW,c.buffer),this.vao=new qm(r,Er,{geometry:md(o)},{geometry:this.vbo}),this.vertexCount=l}destroy(){this.glMaterials.dispose(),this.vbo.dispose(),this.vao.dispose()}get boundingInfo(){return this.geometry.boundingInfo}get triangleCount(){return this.vertexCount/3}intersect(e,i,r,n,s,o,l,c){const f=this.geometry.id;this.material.intersect(this.geometry,e.transform.transform,e,r,n,(_,x,T,A,M)=>{if(_>=0){if(i!=null&&!i(e.rayBegin,e.rayEnd,_))return;const I=new v5t(o.layerUid,o.graphicUid(s),f,T,l,c);if((e.results.min.drapedLayerOrder==null||M>=e.results.min.drapedLayerOrder)&&(e.results.min.dist==null||_=e.results.max.drapedLayerOrder)&&(e.results.max.dist==null||_>e.results.max.dist)&&e.results.max.set(ms.LOD,I,_,x,e.transform.transform,M),e.options.store===tl.ALL){const L=iae(e.results.min.ray);L.set(ms.LOD,I,_,x,e.transform.transform,M),e.results.all.push(L)}}})}},b5t=class r7e{static async create(e,i,r){const n=await Promise.allSettled(i.components.map(o=>e.controller.schedule(()=>new _5t(e,o),r))),s=n.map(o=>o.status==="fulfilled"?o.value:null).filter(ys);if(xo(r)||s.length!==n.length){s.forEach(o=>o.destroy()),St(r);for(const o of n)if(o.status==="rejected")throw o.reason}return new r7e(i.minScreenSpaceRadius,s)}constructor(e,i){this.minScreenSpaceRadius=e,this.components=i}destroy(){this.components.forEach(e=>e.destroy())}intersect(e,i,r,n,s,o,l){this.components.forEach(c=>c.intersect(e,i,r,n,s,o,this.boundingSphere,l))}get boundingBox(){if(this._boundingBox==null){const e=Bn();this.components.forEach(i=>{i.boundingInfo!=null&&(qf(e,i.boundingInfo.bbMin),qf(e,i.boundingInfo.bbMax))}),this._boundingBox=e}return this._boundingBox}get boundingSphere(){if(this._boundingSphere==null){const e=this.boundingBox,i=W();gm(e,i),this._boundingSphere={center:i,radius:.5*jMe(e)}}return this._boundingSphere}get triangleCount(){return this.components.reduce((e,i)=>e+i.triangleCount,0)}};const w5t=t=>{const e=t.baseBoundingSphere.radius,i=t.levels.map(r=>r.minScreenSpaceRadius);return new y5t(e,i)};let Jp=class extends zvt{constructor(e,i){super(e),this.type=ms.LOD,this.isGround=!1,this._levels=[],this._defaultRenderInstanceData=[new Array],this._highlightRenderInstanceData=[new Array],this._allRenderInstanceData=[this._defaultRenderInstanceData[0],this._highlightRenderInstanceData[0]],this._instanceIndex=0,this._cycleStartIndex=0,this._slicePlane=!1,this._camera=new ai,this._updateCyclesWithStaticCamera=-1,this._needFullCycle=!1,this.produces=new Map([[ke.OPAQUE_MATERIAL,r=>this._produces(r)],[ke.TRANSPARENT_MATERIAL,r=>!!this._hasTransparentLevels()&&this._produces(r)]]),this._instanceData=new YA({shaderTransformation:e.shaderTransformation},e.optionalFields),this.addHandles(i.registerTask(ni.LOD_RENDERER,this))}initialize(){this._instanceBufferLayout=S5t(this.optionalFields),this._glInstanceBufferLayout=md(this._instanceBufferLayout,1),this.addHandles([this._instanceData.events.on("instances-changed",()=>this._requestUpdateCycle()),this._instanceData.events.on("instance-transform-changed",({index:e})=>{this._requestUpdateCycle(),this.metadata.notifyGraphicGeometryChanged(e)}),this._instanceData.events.on("instance-visibility-changed",({index:e})=>{this._requestUpdateCycle(!0),this.metadata.notifyGraphicVisibilityChanged(e)}),this._instanceData.events.on("instance-highlight-changed",()=>this._requestUpdateCycle(!0))])}get _enableLevelSelection(){return this.symbol.levels.length>1}get levels(){return this._levels}get baseBoundingBox(){return this._levels[this._levels.length-1].boundingBox}get baseBoundingSphere(){return this._levels[this._levels.length-1].boundingSphere}get baseMaterial(){return this._levels[this._levels.length-1].components[0].material}get slicePlaneEnabled(){return this._slicePlane}set slicePlaneEnabled(e){this._slicePlane=e}get layerUid(){return this.metadata.layerUid}get instanceData(){return this._instanceData}get usedMemory(){return this._allRenderInstanceData.reduce((e,i)=>i.reduce((r,n)=>r+n.usedMemory,e),0)}get renderStats(){const e=this._instanceData.size,i=[];return this._levels.forEach((r,n)=>{const s=this._allRenderInstanceData[0][n].size+this._allRenderInstanceData[1][n].size,o=r.triangleCount;i.push({renderedInstances:s,renderedTriangles:s*o,trianglesPerInstance:o})}),{totalInstances:e,renderedInstances:i.reduce((r,n)=>r+n.renderedInstances,0),renderedTriangles:i.reduce((r,n)=>r+n.renderedTriangles,0),levels:i}}async initializeRenderContext(e,i){this._context=e;const r=e.renderContext.rctx,n=await Promise.allSettled(this.symbol.levels.map(o=>(this._defaultRenderInstanceData[0].push(new dve(r,this._instanceBufferLayout)),this._highlightRenderInstanceData[0].push(new dve(r,this._instanceBufferLayout)),b5t.create(e,o,i)))),s=n.map(o=>o.status==="fulfilled"?o.value:null).filter(ys);if(xo(i)||s.length!==n.length){s.forEach(o=>o.destroy()),St(i);for(const o of n)if(o.status==="rejected")throw o.reason}this._levels=s,this._levelSelector=w5t(this)}uninitializeRenderContext(){this._invalidateOctree(),this._levels.forEach(e=>e.destroy()),this._defaultRenderInstanceData[0].forEach(e=>e.destroy()),this._highlightRenderInstanceData[0].forEach(e=>e.destroy())}_hasTransparentLevels(){return this._levels.some(e=>e.components.some(i=>i.material.produces(ke.TRANSPARENT_MATERIAL,ue.Color)))}hasHighlights(){return this._highlightRenderInstanceData[0].some(e=>e.size>0)}_produces(e){return e!==ue.Highlight&&e!==ue.ShadowHighlight||this.hasHighlights()}prepareRender(e){if(!Tn.LOD_INSTANCE_RENDERER_DISABLE_UPDATES){if(this._enableLevelSelection){const i=e.bindParameters.contentCamera.equals(this._camera);this._camera.copyFrom(e.bindParameters.contentCamera),i||this._requestUpdateCycle()}this._needFullCycle&&(this.runTask(ou),this._needFullCycle=!1)}}prepareTechniques(e){if(!this.baseMaterial.isVisible()||!this.baseMaterial.isVisibleForOutput(e.output))return null;const i=this._getInstanceDatas(e.output);if(!i)return null;const r=new Array;return i.forEach(n=>this.levels.forEach((s,o)=>{s.components.forEach(l=>r.push(this._beginComponent(e,n[o],l)))})),r}renderNode(e,i){const r=this._getInstanceDatas(e.output);if(!r||i==null)return;let n=0;e.rctx.bindVAO(),r.forEach(s=>this.levels.forEach((o,l)=>{o.components.forEach(c=>this._renderComponent(e,i[n++],s[l],c,l))}))}_getInstanceDatas(e){const i=e!==ue.Highlight&&e!==ue.ShadowHighlight,r=e!==ue.ShadowExcludeHighlight;return i&&r?this._allRenderInstanceData:i?this._defaultRenderInstanceData:r?this._highlightRenderInstanceData:null}intersect(e,i,r,n){if(!this.baseMaterial.isVisible()||this._octree==null)return;const s=W();je(s,n,r);const o=l=>{this._instanceData.getCombinedModelTransform(l,yve),e.transform.set(yve),bt(vve,r,e.transform.inverse),bt(_ve,n,e.transform.inverse);const c=this._instanceData.getState(l),f=this._instanceData.getLodLevel(l),_=this._levels.length;Xt((c&es.ACTIVE)!=0,"invalid instance state"),Xt(f>=0&&f<_,"invaid lod level"),this._levels[f].intersect(e,i,vve,_ve,l,this.metadata,_)};this.baseMaterial.parameters.verticalOffset?this._octree.forEach(o):this._octree.forEachAlongRay(r,s,o)}notifyShaderTransformationChanged(){this._invalidateOctree(),this._requestUpdateCycle()}get _octree(){var e;if(this._octreeCached==null){const i=this._instanceData,r=(e=i.view)==null?void 0:e.state;if(!r)return null;this._octreeCached=new g5t(i,this.baseBoundingSphere);for(let n=0;ne.forEach(i=>i.startUpdateCycle()))}get running(){return this._instanceData.size>0&&this._updateCyclesWithStaticCamera<1}runTask(e){const{_enableLevelSelection:i,_camera:r,_levelSelector:n}=this;this._allRenderInstanceData.forEach(x=>x.forEach(T=>T.beginUpdate()));const s=this._instanceData,o=s.view;let l=s.size;const c=s.capacity;let f=this._instanceIndex;const _=Math.ceil(c/500);for(let x=0;x=0&&(T&es.HIGHLIGHT?(mve(this._highlightRenderInstanceData[0][I],o,f),A|=es.HIGHLIGHT_ACTIVE):(mve(this._defaultRenderInstanceData[0][I],o,f),A|=es.DEFAULT_ACTIVE)),o.state.set(f,A),o.lodLevel.set(f,I)}else A=T&~(es.ACTIVE|es.TRANSFORM_CHANGED),o.state.set(f,A);if(this._octreeCached!=null){const I=!!(T&es.ACTIVE),L=!!(A&es.ACTIVE);!I&&L?this._octreeCached.addInstance(f):I&&!L?this._octreeCached.removeInstance(f):I&&L&&T&es.TRANSFORM_CHANGED&&(this._octreeCached.removeInstance(f),this._octreeCached.addInstance(f))}f=f+1===c?0:f+1,f%_==0&&e.madeProgress()}this._instanceIndex=f,this._allRenderInstanceData.forEach(x=>x.forEach(T=>T.endUpdate())),this._context.requestRender()}_beginComponent(e,i,r){if(i.size===0)return null;const n=r.glMaterials.load(e.rctx,e.bindParameters.slot,e.output);return n!=null?n.beginSlot(e.bindParameters):null}_renderComponent(e,i,r,n,s){if(!i)return;const{bindParameters:o,rctx:l}=e;l.runAppleAmdDriverHelper();const c=l.bindTechnique(i,n.material.parameters,o);l.bindVAO(n.vao),i.ensureAttributeLocations(n.vao),c.bindDraw(T5t,o,n.material.parameters),Tn.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL&&e.output===ue.Color&&(c.setUniform4fv("externalColor",bve[Math.min(s,bve.length-1)]),c.setUniform1i("colorMixMode",J9e.replace));const f=r.capacity,_=r.headIndex,x=r.tailIndex,T=r.firstIndex,A=this._glInstanceBufferLayout,M=(I,L)=>{fae(l,Er,r.buffer,A,I),l.drawArraysInstanced(i.primitiveType,0,n.vertexCount,L-I),mae(l,Er,r.buffer,A)};n.material.parameters.transparent&&T!=null?_>x?(Xt(T>=x&&T<=_,"invalid firstIndex"),M(T,_),M(x,T)):_=0&&T<=_,"invalid firstIndex"),M(T,_),M(x,f),M(0,T)):(Xt(T>=x&&T<=f,"invalid firstIndex"),M(T,f),M(0,_),M(x,T))):_>x?M(x,_):_(n=(r=>(r=this.symbolLayer)==null?void 0:r.material)())==null?void 0:n.color)()){const s=this._getCombinedOpacity(i),o=s<1||this.needsDrivenTransparentPass;return e.transparent=o,e.opacity=s,e.cullFace=o?Ln.None:Ln.Back,e}async _createResourcesForPrimitive(e,i){const r=this.symbolLayer,n=ya(Lrt(e)),s=mc(Y6(n)),o=mc(TH(s,r)),l=rt(o),c=!1,f=!1,_={usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0,mrrFactors:[...Ale],ambient:Bv,diffuse:Bv,hasSlicePlane:this._context.slicePlaneEnabled,hasSliceHighlight:!1,castShadows:this.symbolLayer.castShadows,offsetTransparentBackfaces:!this.symbolLayer.isPrimitive},x=!!_.usePBR;this._setMaterialTransparencyParameters(_);const T=this.symbol;if(T.type==="point-3d"&&T.verticalOffset){const{screenLength:z,minWorldLength:k,maxWorldLength:U}=T.verticalOffset;_.verticalOffset={screenLength:Tr(z),minWorldLength:k||0,maxWorldLength:U??1/0},_.castShadows=!1}if(this._context.screenSizePerspectiveEnabled&&(_.screenSizePerspective=this._context.sharedResources.screenSizePerspectiveSettings),this._drivenProperties.color)_.externalColor=xf;else{const z=r.material!=null?r.material.color:null,k=z!=null?qe.toUnitRGBA(z):xf;_.externalColor=k}this._fastUpdates=C5(this._context.renderer,this._fastVisualVariableConvertOptions(n,o,s,null)),_.isInstanced=!0,this._fastUpdates?(Object.assign(_,this._fastUpdates.materialParameters),this._optionalFields.push(J.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(_.hasInstancedColor=!0,this._optionalFields.push(J.COLOR)),Le("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(J.OBJECTANDLAYERIDCOLOR);const A=new km(_),M=V6e(e,A);if(!M)throw new Error(`Unknown object symbol primitive: ${e}`);const I=EN(M).map(z=>({opacity:1,transparent:z.parameters.transparent})),L=await this._createStageResources(M,x,i),F=await this._createLodRenderer(M,i);return new wve(M,F,L,I,s,c,f,n,o,l,x,null)}async _createResourcesForUrl(e,i){var re,he;const r={materialParameters:{isInstanced:!0,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows},streamDataRequester:this._context.streamDataRequester,cache:this._context.sharedResources.objectResourceCache};this._fastUpdates=C5(this._context.renderer,this._fastVisualVariableConvertOptions(null,null,null,null)),this._fastUpdates?(Object.assign(r.materialParameters,this._fastUpdates.materialParameters),this._optionalFields.push(J.FEATUREATTRIBUTE)):this._hasPerInstanceColor()&&(r.materialParameters.hasInstancedColor=!0,this._optionalFields.push(J.COLOR)),Le("enable-feature:objectAndLayerId-rendering")&&this._optionalFields.push(J.OBJECTANDLAYERIDCOLOR);const n=this.symbol;if(n.type==="point-3d"&&n.verticalOffset){const{screenLength:ce,minWorldLength:be,maxWorldLength:ye}=n.verticalOffset;r.materialParameters.verticalOffset={screenLength:Tr(ce),minWorldLength:be||0,maxWorldLength:ye??1/0},r.materialParameters.castShadows=!1}const s=this._context.physicalBasedRenderingEnabled;r.signal=i,r.usePBR=s,r.skipHighLods=this._context.skipHighSymbolLods;const o=await Q8e(e,r),l=o.isEsriSymbolResource,c=o.isWosr,f=aOt(o.lods),_=this._context,x=this.symbolLayer.material,T=this._getExternalColorParameters(x),A=(he=(re=this.symbolLayer)==null?void 0:re.material)==null?void 0:he.color,M=this._getCombinedOpacity(A,{hasIntrinsicColor:!0}),I=this.needsDrivenTransparentPass,L=EN(f),F=EN(f).map(ce=>({opacity:ce.parameters.opacity||1,transparent:ce.parameters.transparent}));L.forEach(ce=>{const be=ce.parameters;ce.setParameters(T);const ye=be.opacity*M,pe=ye<1||I||be.transparent;ce.setParameters({opacity:ye,transparent:pe}),_.screenSizePerspectiveEnabled&&ce.setParameters({screenSizePerspective:_.sharedResources.screenSizePerspectiveSettings})});const z=o.referenceBoundingBox,k=mc(Y6(z)),U=mc(f.levels[0].pivotOffset),j=mc(TH(k,this.symbolLayer)),H=rt(j),Y=this._fastUpdates;A5(Y,this._context.renderer,this._fastVisualVariableConvertOptions(z,j,k,U))&&L.forEach(ce=>ce.setParameters(Y.materialParameters));const Q=await this._createStageResources(f,s,i),ne=await this._createLodRenderer(f,i);return new wve(f,ne,Q,F,k,l,c,z,j,H,s,U)}_addDisposeResource(e){this._disposeResourceHandles.push(e)}async _createStageResources(e,i,r){const n=this._context.stage,s=EN(e);i!==this._context.physicalBasedRenderingEnabled&&this.physicalBasedRenderingChanged(),n.addMany(s),this._addDisposeResource(()=>n.removeMany(s));const o=Oye(e);n.addMany(o),this._addDisposeResource(()=>{o.forEach(c=>c.unload()),n.removeMany(o)}),await Promise.all(o.map(c=>this._context.stage.schedule(()=>c.load(n.renderView.renderingContext),r))),St(r);const l=Pye(e);return n.addMany(l),this._addDisposeResource(()=>n.removeMany(l)),{materials:s,textures:o,geometries:l}}async _createLodRenderer(e,i){const r=this._context.stage,n={layerUid:this._context.layer.uid,graphicUid:c=>this._instanceIndexToGraphicUid.get(c),notifyGraphicGeometryChanged:c=>this._context.notifyGraphicGeometryChanged(this._instanceIndexToGraphicUid.get(c)),notifyGraphicVisibilityChanged:c=>this._context.notifyGraphicVisibilityChanged(this._instanceIndexToGraphicUid.get(c))},s=this._fastUpdates,o=s?{applyTransform:(c,f,_)=>{c.getFeatureAttribute(f,YN),Ao(_,U2t(s.materialParameters,YN,_))},scaleFactor:(c,f,_)=>{f.getFeatureAttribute(_,YN),dle(c,s.materialParameters,YN)}}:null,l=new Jp({symbol:e,optionalFields:this._optionalFields,metadata:n,shaderTransformation:o},this._context.scheduler);return l.slicePlaneEnabled=this._context.slicePlaneEnabled,this._addDisposeResource(()=>{r.removeRenderPlugin(l),l.destroy()}),await r.addRenderPlugin(l,i),l}_getExternalColorParameters(e){const i={};return this._drivenProperties.color?i.externalColor=xf:(e==null?void 0:e.color)!=null?i.externalColor=qe.toUnitRGBA(e.color):(i.externalColor=xf,i.colorMixMode="ignore"),i}destroy(){super.destroy(),this._cleanupResources()}_cleanupResources(){this._disposeResourceHandles.forEach(e=>e()),this._disposeResourceHandles.length=0,this._resources=null}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry))return null;const r=UL(i.geometry);if(r==null)return this.logger.warn(`unsupported geometry type for icon symbol: ${i.geometry.type}`),null;const n=this.setGraphicElevationContext(i),s=e.renderingInfo;return this._createAs3DShape(i,r,s,n,i.uid,e.layer.uid)}notifyDestroyGraphicLayer(e){this._instanceIndexToGraphicUid.delete(e.instanceIndex)}graphicLayerToGraphicId(){return 0}layerOpacityChanged(){var s,o;if(this._resources==null)return;const e=this._drivenProperties.opacity,i=!this._isPrimitive,r=this._resources.stageResources.materials,n=this._resources.originalMaterialParameters;for(let l=0;lArray.from(l.attributes.values()).reduce((c,f)=>c+l_(f.data,f.indices),0),n=Pye(e).reduce((l,c)=>l+r(c),0),s=Oye(e).reduce((l,c)=>l+c.memoryEstimate,0)+n,o={..._De(this.symbol,this.symbolLayer),resourceBytes:s};return new ff({verticesPerFeature:i,memory:o})}_hasLodRenderer(){return this._resources!=null}_createAs3DShape(e,i,r,n,s,o){if(!this._hasLodRenderer()||this._resources==null)return null;const l=this.getFastUpdateAttrValues(e),c=this._context.clippingExtent;if(ud(i,CC,this._context.elevationProvider.spatialReference),c!=null&&!$se(c,CC))return null;const f=this._requiresTerrainElevation(n),_=this._computeGlobalTransform(i,n,QW,XN),x=this._computeLocalTransform(this._resources,this.symbolLayer,r,xve),T=this._resources.lodRenderer.instanceData,A=T.addInstance();this._instanceIndexToGraphicUid.set(A,s),T.setLocalTransform(A,x,!1),T.setGlobalTransform(A,_),l&&T.setFeatureAttribute(A,l),this._fastUpdates==null&&this._hasPerInstanceColor()&&T.setColor(A,w$(r.color,r.opacity,255)),this._context.stage.renderView.objectAndLayerIdRenderHelper!=null&&T.setObjectAndLayerIdColor(A,this._context.stage.renderView.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor({graphicUid:s,layerUid:o}));const M=new nOt(this,A,i3t,n);return f&&(M.alignedSampledElevation=XN.sampledElevation),M.needsElevationUpdates=X2(n.mode),zL(M,i,this._context.elevationProvider),M}_computeGlobalTransform(e,i,r,n){return Y2(e,this._context.elevationProvider,i,this._context.renderCoordsHelper,n),CC[0]=e.x,CC[1]=e.y,CC[2]=n.z,uu(e.spatialReference,CC,r,this._context.renderCoordsHelper.spatialReference),r}_computeLocalTransform(e,i,r,n){return Hf(n),this._applyObjectRotation(r,!1,n),this._applyObjectRotation(i,!0,n),this._applyObjectScale(e,r,n),this._applyAnchor(e,i,n),n}_applyObjectScale(e,i,r){var o;if((o=this._fastUpdates)!=null&&o.requiresShaderTransformation)return;const n=this._drivenProperties.size&&i.size?i.size:e.symbolSize,s=Aye(n,e.symbolSize,e.resourceSize,this._context.renderCoordsHelper.unitInMeters);s[0]===1&&s[1]===1&&s[2]===1||$9(r,r,s)}prepareSymbolLayerPatch(e){if(e.diff.type!=="partial")return;const i=e.diff.diff;this._preparePatchTransform(e,i),this._preparePatchColor(e,i)}updateGeometry(e,i){if(this._resources==null)return!0;const r=i&&UL(i);if(r==null)return!1;const n=this.getGeometryElevationMode(i);return e.elevationContext.mode===n&&(this._computeGlobalTransform(r,e.elevationContext,QW,XN),this._requiresTerrainElevation(e.elevationContext)&&(e.alignedSampledElevation=XN.sampledElevation),this._resources.lodRenderer.instanceData.setGlobalTransform(e.instanceIndex,QW,!0),zL(e,r,this._context.elevationProvider),!0)}_preparePatchTransform(e,i){if(!(i.heading||i.tilt||i.roll||i.width||i.height||i.depth||i.anchor||i.anchorPosition)||this._resources==null)return;const r=(M,I,L)=>(M!=null&&M.type==="complete"?M.newValue:I)??L,n=r(i.heading,this.symbolLayer.heading,0),s=r(i.tilt,this.symbolLayer.tilt,0),o=r(i.roll,this.symbolLayer.roll,0),l=r(i.width,this.symbolLayer.width,void 0),c=r(i.height,this.symbolLayer.height,void 0),f=r(i.depth,this.symbolLayer.depth,void 0),_=r(i.anchor,this.symbolLayer.anchor,void 0),x=r(i.anchorPosition,this.symbolLayer.anchorPosition,void 0);delete i.heading,delete i.tilt,delete i.roll,delete i.width,delete i.height,delete i.depth,delete i.anchor,delete i.anchorPosition;const T={heading:n,tilt:s,roll:o,anchor:_,anchorPosition:x},A=this._resources;this.loadStatus===ep.LOADED&&e.symbolLayerStatePatches.push(()=>{A.symbolSize=mc(TH(A.resourceSize,{width:l,height:c,depth:f,isPrimitive:this.symbolLayer.isPrimitive}))}),e.graphics3DGraphicPatches.push((M,I)=>{const L=this._computeLocalTransform(A,T,I,xve),F=M.instanceIndex;A.lodRenderer.instanceData.setLocalTransform(F,L,!0)})}_preparePatchColor(e,i){if(!i.material||i.material.type!=="partial")return;const r=i.material.diff;if(!r.color||r.color.type!=="complete"||r.color.newValue==null||r.color.oldValue==null)return;const n=r.color.newValue,s=n!=null?qe.toUnitRGBA(n):xf;delete r.color;const o=this._resources;o!=null&&e.graphics3DGraphicPatches.push(l=>{let c;this._hasPerInstanceColor()?(o.lodRenderer.instanceData.setColor(l.instanceIndex,s),c=this._setMaterialTransparencyParameters({},n)):c=this._setMaterialTransparencyParameters({externalColor:s},n);for(const f of o.stageResources.materials)f.setParameters(c)})}_requiresTerrainElevation(e){return e.mode!=="absolute-height"}_applyObjectRotation(e,i,r){var n;if(!((n=this._fastUpdates)!=null&&n.requiresShaderTransformation)||!i)return Hxt(e.heading,e.tilt,e.roll,r)}_computeAnchor(e,i,r){const n=W();switch(r.anchor){case"center":Ne(n,gm(e)),Sc(n,n);break;case"top":{const s=gm(e);Ie(n,-s[0],-s[1],-e[5]);break}case"bottom":{const s=gm(e);Ie(n,-s[0],-s[1],-e[2]);break}case"relative":{const s=gm(e),o=Y6(e),l=r.anchorPosition,c=l?nt(l.x,l.y,l.z):Ka;gB(n,o,c),Be(n,n,s),Sc(n,n);break}default:i!=null?Sc(n,i):Ne(n,Ka)}return n}_applyAnchor(e,i,r){var s;if((s=this._fastUpdates)!=null&&s.requiresShaderTransformation)return;const n=this._computeAnchor(e.resourceBoundingBox,e.pivotOffset,i);n&&Qu(r,r,n)}_hasPerInstanceColor(){return this._drivenProperties.color||this._drivenProperties.opacity}_fastVisualVariableConvertOptions(e,i,r,n){const s=e!=null?mc(Y6(e)):Bv,o=e!=null?this._computeAnchor(e,n,this.symbolLayer):Ka,l=this._context.renderCoordsHelper.unitInMeters,c=Aye(i??void 0,i,r,l),f=nt(this.symbolLayer.tilt||0,this.symbolLayer.roll||0,this.symbolLayer.heading||0);return new K9({size:!0,color:!0,rotation:!0,opacity:!1},s,i??Bv,l,o,c,f)}};const CC=W(),xve=Qe(),QW=Qe(),YN=Xi(),XN=new r6;let C5t=class{constructor(e,i,r,n){this.vertices=e,this.positionsES=i,this.offset=n;const s=e.length,o=Math.floor(s/2),l=this.offset+3*o,c=r[l],f=r[l+1],_=r[l+2];this.origin=nt(c,f,_),this.positions=Rs(3*s);const x=this.offset+3*s;for(let T=this.offset;Tthis.emitCapVertex(n,l,c,f,_,x),o=(l,c,f,_)=>this.emitVertex(n,l,c,f,_);for(this.startCap.rebuildConnectingProfileGeometry(r[n],this.profile,s),n=1;n{s.push(f),s.push(_),s.push(x),o.push(f),o.push(_),o.push(x),l.push(this.pathVertexData[f]),l.push(this.pathVertexData[_]),l.push(this.pathVertexData[x])};for(let f=0;f=this.cutoffAngle){const c=e.rotationFrameUp;for(let f=0;f=0?r(n,i.vertices[_],i.normals[_],!1):r(l,e.applyMiterStretch(Eve,i.vertices[_]),i.normals[_],!0)}}else for(let c=0;c=0;r(l,e.applyMiterStretch(Eve,i.vertices[f]),i.normals[f],!_)}}},s7e=class{constructor(){this.up=W(),this.right=W()}};function P5t(t,e,i){bt(t.up,e.up,i),bt(t.right,e.right,i)}const Eve=yt(),Cve=Qe(),R5t=new s7e;let I5t=class extends Bo{constructor(e,i,r,n,s,o){super(e,i,null,Ws.Mesh,o),this.path=r,this.geometrySR=n,this.stencilWidth=s}};var Ry;function o7e(t){return"path"in t}(function(t){t[t.World=0]="World",t[t.Path=1]="Path"})(Ry||(Ry={}));let a7e=class{constructor(e){this.builder=e}onPathChanged(e){this.builder.onPathChanged()}},l7e=class extends a7e{constructor(e){super(e),this.vertexAttributeColor=Mi(255,255,255,255),this.size=new Array,this.vertexAttributePosition=Rs(3*this.builder.numVerticesTotal),this.vertexAttributeNormal=new Int16Array(2*this.builder.numVerticesTotal)}bakeVertexColors(e){this.vertexAttributeColor[0]=255*e[0],this.vertexAttributeColor[1]=255*e[1],this.vertexAttributeColor[2]=255*e[2],this.vertexAttributeColor[3]=255*(e.length>3?e[3]:1)}bake(e){this.size=e;const{numVerticesTotal:i,pathVertexData:r,path:n,positions:s,profileRightAxes:o,profileUpAxes:l,profileVertexAndNormals:c}=this.builder;for(let f=0;fQ){or(Y,-H[1],H[0]);const re=fs(z,Y);Gu(H,H,Q*Math.sign(ne)),Gu(Y,Y,re),df(z,H,Y)}Ie(T,0,0,0)}const k=Ie(N5t,L[0]*z[0]+F[0]*z[1],L[1]*z[0]+F[1]*z[1],L[2]*z[0]+F[2]*z[1]),U=3*f;this.vertexAttributePosition[U]=s[_]+k[0]+T[0]*A,this.vertexAttributePosition[U+1]=s[_+1]+k[1]+T[1]*A,this.vertexAttributePosition[U+2]=s[_+2]+k[2]+T[2]*A;const j=or(Ave,c[I+2],c[I+3]);tE(this.vertexAttributeNormal,f,L[0]*j[0]+F[0]*j[1]+T[0]*M,L[1]*j[0]+F[1]*j[1]+T[1]*M,L[2]*j[0]+F[2]*j[1]+T[2]*M)}}createGeometryData(){const e=this.builder.vertexIndices.length,{normalIndices:i,vertexIndices:r}=this.builder;return[[J.POSITION,new It(this.vertexAttributePosition,r,3,!0)],[J.NORMALCOMPRESSED,new It(this.vertexAttributeNormal,i,2,!0)],[J.COLOR,new It(this.vertexAttributeColor,ux(e),4)]]}onPathChanged(e){super.onPathChanged(e),this.bake(this.size)}intersect(e,i,r){const n=this.builder.vertexIndices,s=new yP(this.vertexAttributePosition,3),o=n.length/3;Q9(e,i,0,o,n,s,void 0,void 0,r)}},$5t=class extends a7e{constructor(e,i,r,n){super(e),this.sizeAttributeValue=i,this.colorAttributeValue=r,this.opacityAttributeValue=n,this.vvData=null,this.baked=new l7e(e),this.vvData=Rs(4*this.builder.path.vertices.length);for(let s=0;s0?(L=1/Math.sqrt(L),f[0]=f[0]*L,f[1]=f[1]*L,f[2]=f[2]*L):(f[0]=T.vRight[0],f[1]=T.vRight[1],f[2]=T.vRight[2]),_[0]=A[M]+i.frame.up[0],_[1]=A[M+1]+i.frame.up[1],_[2]=A[M+2]+i.frame.up[2],M+=3;const F=Ie(V5t,A[M],A[M+1],A[M+2]);z_(F,f,x),bE(x,Sp(_,T.vLeft),c)?(c[0]-=A[M],c[1]-=A[M+1],c[2]-=A[M+2],Ye(o,c),Wt(l,f,o),Ye(l,l)):CU(f,i.frame.up,i.frame.right,s,l,o,n),Ne(T.frame.up,o),Ne(T.frame.right,l),i=T}}const V5t=W();let c7e=class{constructor(){this.vertices=new Array,this.normals=new Array,this.indices=new Array,this.poles=new Array,this.poleIndices=new Array}addVertex(e,i){return this.vertices.push(AM(e)),this.normals.push(AM(i)),this.vertices.length-1}addPole(e,i=null){return this.poles.push({position:AM(e),normal:i?AM(i):null}),this.poles.length-1}addSegment(e,i=null){this.indices.push(e.v0),this.indices.push(e.v1),i&&(this.poleIndices.push(i.v0),this.poleIndices.push(i.v1))}get numSegments(){return this.indices.length/2}translate(e,i){for(const r of this.vertices)r[0]+=e,r[1]+=i;for(const r of this.poles)r.position[0]+=e,r.position[1]+=i}get usedMemory(){return this.vertices.length*l_(this.vertices[0])*2+l_(this.indices)}};const u7e={top:[0,-.5],bottom:[0,.5]};function tY(t){const i=F6e,r=new c7e,n={v0:0,v1:0};r.addPole(Ji(0,0));for(let o=0;on.size)),e.vvSize?(r.uniforms.add(new Oi("vvSizeMinSize",n=>n.vvSize.minSize),new Oi("vvSizeMaxSize",n=>n.vvSize.maxSize),new Oi("vvSizeOffset",n=>n.vvSize.offset),new Oi("vvSizeFactor",n=>n.vvSize.factor)),r.code.add(V` + vec2 getSize() { + return size * clamp(vvSizeOffset + ${i}.x * vvSizeFactor, vvSizeMinSize, vvSizeMaxSize).xz; + } + `)):r.code.add(V`vec2 getSize(){ +return size; +}`),e.vvOpacity?(r.constants.add("vvOpacityNumber","int",rY),r.uniforms.add(new Hu("vvOpacityValues",n=>n.vvOpacity.values,rY),new Hu("vvOpacityOpacities",n=>n.vvOpacity.opacityValues,rY)),r.code.add(V` + vec4 applyOpacity(vec4 color) { + float value = ${i}.z; + if (value <= vvOpacityValues[0]) { + return vec4( color.xyz, vvOpacityOpacities[0]); + } + + for (int i = 1; i < vvOpacityNumber; ++i) { + if (vvOpacityValues[i] >= value) { + float f = (value - vvOpacityValues[i-1]) / (vvOpacityValues[i] - vvOpacityValues[i-1]); + return vec4( color.xyz, mix(vvOpacityOpacities[i-1], vvOpacityOpacities[i], f)); + } + } + + return vec4( color.xyz, vvOpacityOpacities[vvOpacityNumber - 1]); + } + `)):r.code.add(V`vec4 applyOpacity(vec4 color){ +return color; +}`),e.vvColor?(r.constants.add("vvColorNumber","int",SO),r.uniforms.add(new Hu("vvColorValues",n=>n.vvColor.values,SO),new h6e("vvColorColors",n=>n.vvColor.colors,SO)),r.code.add(V` + vec4 getColor() { + float value = ${i}.y; + if (value <= vvColorValues[0]) { + return applyOpacity(vvColorColors[0]); + } + + for (int i = 1; i < vvColorNumber; ++i) { + if (vvColorValues[i] >= value) { + float f = (value - vvColorValues[i-1]) / (vvColorValues[i] - vvColorValues[i-1]); + return applyOpacity(mix(vvColorColors[i-1], vvColorColors[i], f)); + } + } + + return applyOpacity(vvColorColors[vvColorNumber - 1]); + } + `)):r.code.add(V`vec4 getColor(){ +return applyOpacity(vec4(1, 1, 1, 1)); +}`),t.include(W9),t.attributes.add(J.PROFILERIGHT,"vec4"),t.attributes.add(J.PROFILEUP,"vec4"),t.attributes.add(J.PROFILEVERTEXANDNORMAL,"vec4"),r.code.add(V`vec3 calculateVPos() { +vec2 size = getSize(); +vec3 origin = position; +vec3 right = profileRight.xyz; +vec3 up = profileUp.xyz; +vec3 forward = cross(up, right); +vec2 profileVertex = profileVertexAndNormal.xy * size; +vec2 profileNormal = profileVertexAndNormal.zw; +float positionOffsetAlongProfilePlaneNormal = 0.0; +float normalOffsetAlongProfilePlaneNormal = 0.0;`),r.code.add(V`if(!isCapVertex()) { +vec2 rotationRight = vec2(profileRight.w, profileUp.w); +float maxDistance = length(rotationRight);`),r.code.add(V`rotationRight = maxDistance > 0.0 ? normalize(rotationRight) : vec2(0, 0); +float rx = dot(profileVertex, rotationRight); +if (abs(rx) > maxDistance) { +vec2 rotationUp = vec2(-rotationRight.y, rotationRight.x); +float ry = dot(profileVertex, rotationUp); +profileVertex = rotationRight * maxDistance * sign(rx) + rotationUp * ry; +} +}else{ +positionOffsetAlongProfilePlaneNormal = profileRight.w * size[0]; +normalOffsetAlongProfilePlaneNormal = profileUp.w; +} +vec3 offset = right * profileVertex.x + up * profileVertex.y + forward * positionOffsetAlongProfilePlaneNormal; +return origin + offset; +}`),r.code.add(V`vec3 localNormal() { +vec3 right = profileRight.xyz; +vec3 up = profileUp.xyz; +vec3 forward = cross(up, right); +vec2 profileNormal = profileVertexAndNormal.zw; +vec3 normal = right * profileNormal.x + up * profileNormal.y; +if(isCapVertex()) { +normal += forward * profileUp.w; +} +return normal; +}`)}let _Pt=class extends t6{constructor(){super(...arguments),this.size=Ji(1,1)}};function g7e(t){const e=new Cr,{vertex:i,fragment:r}=e;switch(Kh(i,t),e.varyings.add("vpos","vec3"),e.include(vPt,t),t.output!==ue.Color&&t.output!==ue.Alpha||(e.include(Yu,t),e.include(KT,t),e.include(wP,t),e.varyings.add("vnormal","vec3"),e.varyings.add("vcolor","vec4"),t.multipassEnabled&&e.varyings.add("depth","float"),i.code.add(V` + void main() { + vpos = calculateVPos(); + vnormal = normalize(localNormal()); + + ${t.multipassEnabled?"depth = (view * vec4(vpos, 1.0)).z;":""} + gl_Position = transformPosition(proj, view, vpos); + + ${t.output===ue.Color?"forwardLinearDepth();":""} + + vcolor = getColor(); + } + `)),e.include(dd,t),t.output){case ue.Alpha:e.include(oo,t),r.uniforms.add(new ft("opacity",n=>n.opacity)),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + float combinedOpacity = vcolor.a * opacity; + fragColor = vec4(combinedOpacity); + } + `);break;case ue.Color:e.include(oo,t),e.include(JT,t),e.include(o6,t),e.include(KT,t),e.include(j6e,t),Nm(r,t),a6(r),CP(r),r.uniforms.add(i.uniforms.get("localOrigin"),new Oi("ambient",n=>n.ambient),new Oi("diffuse",n=>n.diffuse),new Oi("specular",n=>n.specular),new ft("opacity",n=>n.opacity)),r.include(h1),a1(r),r.code.add(V` + void main() { + discardBySlice(vpos); + ${t.multipassEnabled?"terrainDepthTest(depth);":""} + + shadingParams.viewDirection = normalize(vpos - cameraPosition); + shadingParams.normalView = vnormal; + vec3 normal = shadingNormal(shadingParams); + float ssao = evaluateAmbientOcclusionInverse(); + + float additionalAmbientScale = additionalDirectedAmbientLight(vpos + localOrigin); + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + ${t.receiveShadows?"float shadow = readShadowMap(vpos, linearDepth);":t.spherical?"float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);":"float shadow = 0.0;"} + vec3 albedo = vcolor.rgb * max(ambient, diffuse); // combine the old material parameters into a single one + float combinedOpacity = vcolor.a * opacity; + albedo += 0.25 * specular; // don't completely ignore specular for now + + vec3 shadedColor = evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight); + fragColor = vec4(shadedColor, combinedOpacity); + fragColor = highlightSlice(fragColor, vpos); + ${t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `);break;case ue.Depth:case ue.Shadow:case ue.ShadowHighlight:case ue.ShadowExcludeHighlight:e.include(Yu,t),XT(e),e.varyings.add("depth","float"),i.code.add(V`void main() { +vpos = calculateVPos(); +gl_Position = transformPositionWithDepth(proj, view, vpos, nearFar, depth); +}`),e.include(oo,t),e.include(E_,t),r.code.add(V`void main() { +discardBySlice(vpos); +outputDepth(depth); +}`);break;case ue.Normal:e.include(Yu,t),e.include(GL,t),S5(i),e.varyings.add("vnormal","vec3"),i.code.add(V`void main(void) { +vpos = calculateVPos(); +vnormal = normalize((viewNormal * vec4(localNormal(), 1.0)).xyz); +gl_Position = transformPosition(proj, view, vpos); +}`),e.include(oo,t),r.code.add(V`void main() { +discardBySlice(vpos); +vec3 normal = normalize(vnormal); +if (gl_FrontFacing == false) normal = -normal; +fragColor = vec4(vec3(0.5) + 0.5 * normal, 1.0); +}`);break;case ue.Highlight:e.include(Yu,t),e.include(GL,t),e.varyings.add("vnormal","vec3"),i.code.add(V`void main(void) { +vpos = calculateVPos(); +gl_Position = transformPosition(proj, view, vpos); +}`),e.include(oo,t),e.include(dx,t),r.code.add(V`void main() { +discardBySlice(vpos); +outputHighlight(); +}`)}return e}const bPt=Object.freeze(Object.defineProperty({__proto__:null,build:g7e},Symbol.toStringTag,{value:"Module"})),y7e=new Map([[J.POSITION,0],[J.PROFILERIGHT,1],[J.PROFILEUP,2],[J.PROFILEVERTEXANDNORMAL,3],[J.FEATUREVALUE,4]]);let wPt=class extends _Pt{constructor(){super(...arguments),this.ambient=nt(.2,.2,.2),this.diffuse=nt(.8,.8,.8),this.specular=nt(0,0,0),this.opacity=1,this.origin=W(),this.modelTransformation=null}},v7e=class _7e extends Hr{initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global,i.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new Ir(e.rctx,_7e.shader.get().build(this.configuration),y7e)}initializePipeline(){const e=this.configuration.transparencyPassType,i=this.configuration,r=e===Jt.NONE,n=e===Jt.FrontFace;return Ti({blending:i.output!==ue.Color&&i.output!==ue.Alpha||!i.transparent?null:r?vp:Y_(e),culling:i.hasSlicePlane&&!i.transparent&&i.doubleSidedMode!==Is.None?YIe:null,depthTest:{func:px(e)},depthWrite:r||n?rh:null,colorWrite:ji,stencilWrite:i.hasOccludees?Jy:null,stencilTest:i.hasOccludees?fx:null,polygonOffset:r||n?null:eG})}};v7e.shader=new Rr(bPt,()=>we(()=>Promise.resolve().then(()=>$Wt),void 0));let na=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.doubleSidedMode=Is.None,this.transparencyPassType=Jt.NONE,this.spherical=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.vvSize=!1,this.vvColor=!1,this.vvOpacity=!1,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.doublePrecisionRequiresObfuscation=!1}};y([fe({count:ue.COUNT})],na.prototype,"output",void 0),y([fe({count:Is.COUNT})],na.prototype,"doubleSidedMode",void 0),y([fe({count:Jt.COUNT})],na.prototype,"transparencyPassType",void 0),y([fe()],na.prototype,"spherical",void 0),y([fe()],na.prototype,"receiveShadows",void 0),y([fe()],na.prototype,"receiveAmbientOcclusion",void 0),y([fe()],na.prototype,"vvSize",void 0),y([fe()],na.prototype,"vvColor",void 0),y([fe()],na.prototype,"vvOpacity",void 0),y([fe()],na.prototype,"hasSlicePlane",void 0),y([fe()],na.prototype,"transparent",void 0),y([fe()],na.prototype,"hasOccludees",void 0),y([fe()],na.prototype,"multipassEnabled",void 0),y([fe()],na.prototype,"cullAboveGround",void 0),y([fe()],na.prototype,"doublePrecisionRequiresObfuscation",void 0),y([fe({constValue:!1})],na.prototype,"occlusionPass",void 0),y([fe({constValue:ei.Disabled})],na.prototype,"pbrMode",void 0),y([fe({constValue:!0})],na.prototype,"hasVvInstancing",void 0),y([fe({constValue:!1})],na.prototype,"useCustomDTRExponentForWater",void 0),y([fe({constValue:!1})],na.prototype,"useFillLights",void 0),y([fe({constValue:!1})],na.prototype,"hasColorTexture",void 0);let xPt=class b7e extends hx{constructor(e){super(e,new TPt),this.supportsEdges=!0,this._vertexAttributeLocations=y7e,this._configuration=new na,this._vertexBufferLayout=b7e.getVertexBufferLayout()}getConfiguration(e,i){return this._configuration.output=e,this._configuration.vvSize=!!this.parameters.vvSize,this._configuration.vvColor=!!this.parameters.vvColor,this._configuration.vvOpacity=!!this.parameters.vvOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.hasOccludees=this.parameters.hasOccludees,e!==ue.Color&&e!==ue.Alpha||(this._configuration.doubleSidedMode=this.parameters.doubleSided&&this.parameters.doubleSidedType==="normal"?Is.View:this.parameters.doubleSided&&this.parameters.doubleSidedType==="winding-order"?Is.WindingOrder:Is.None,this._configuration.receiveShadows=this.parameters.receiveShadows,this._configuration.receiveAmbientOcclusion=i.ssao!=null),this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.multipassEnabled=i.multipassEnabled,this._configuration.cullAboveGround=i.multipassTerrain.cullAboveGround,this._configuration}isVisibleForOutput(e){return e!==ue.Shadow&&e!==ue.ShadowExcludeHighlight&&e!==ue.ShadowHighlight||this.parameters.castShadows}isVisible(){return super.isVisible()&&this.parameters.opacity>0}intersect(e,i,r,n,s,o){const l=e;if(!o7e(l))return;const c=l.path,f=[this.parameters.size[0],this.parameters.size[1]];if(this.parameters.vvSize){const{offset:L,factor:F,minSize:z,maxSize:k}=this.parameters.vvSize,U=c.sizeAttributeValue;f[0]*=Je(L[0]+U*F[0],z[0],k[0]),f[1]*=Je(L[2]+U*F[2],z[2],k[2])}const _=Math.max(f[0],f[1]),x=e.boundingInfo;if(x==null)return void this._intersectTriangles(c,f,n,s,o);const T=P2(x.bbMin[0]-_,x.bbMin[1]-_,x.bbMin[2]-_,x.bbMax[0]+_,x.bbMax[1]+_,x.bbMax[2]+_),A=[s[0]-n[0],s[1]-n[1],s[2]-n[2]],M=Math.sqrt(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]),I=[M/A[0],M/A[1],M/A[2]];mle(T,n,I,r.tolerance)&&this._intersectTriangles(c,f,n,s,o)}_intersectTriangles(e,i,r,n,s){e.baked.size&&e.baked.size[0]===i[0]&&e.baked.size[1]===i[1]||e.baked.bake(i),e.baked.intersect(r,n,s)}createBufferWriter(){return new EP(this._vertexBufferLayout)}produces(e,i){switch(i){case ue.Shadow:case ue.ShadowHighlight:case ue.ShadowExcludeHighlight:if(!this.parameters.castShadows)return!1;case ue.Color:case ue.Alpha:case ue.Depth:case ue.Normal:case ue.Highlight:case ue.ObjectAndLayerIdColor:return e===(this.parameters.transparent?ke.TRANSPARENT_MATERIAL:ke.OPAQUE_MATERIAL)||e===ke.DRAPED_MATERIAL;default:return!1}}createGLMaterial(e){return new SPt(e)}static getVertexBufferLayout(){return ls().vec3f(J.POSITION).vec4f(J.PROFILERIGHT).vec4f(J.PROFILEUP).vec4f(J.PROFILEVERTEXANDNORMAL).vec4f(J.FEATUREVALUE)}},SPt=class extends cx{_updateOccludeeState(e){e.hasOccludees!==this._material.parameters.hasOccludees&&this._material.setParameters({hasOccludees:e.hasOccludees})}_updateShadowState(e){this.technique!=null&&e.shadowMap.enabled===this.technique.configuration.receiveShadows||this._material.setParameters({receiveShadows:e.shadowMap.enabled})}beginSlot(e){return this._output!==ue.Color&&this._output!==ue.Alpha||(this._updateShadowState(e),this._updateOccludeeState(e)),this.ensureTechnique(v7e,e)}},TPt=class extends wPt{constructor(){super(...arguments),this.doubleSided=!1,this.doubleSidedType="normal",this.receiveShadows=!1,this.castShadows=!0,this.hasSlicePlane=!1,this.transparent=!1,this.hasOccludees=!1}};const EPt=["polyline"];let CPt=class extends p1{constructor(e,i,r,n){super(e,i,r,n),this._intrinsicSize=Ji(1,1),this._upVectorAlignment=Ry.Path,this._stencilWidth=.1,this.usedMemory=0,this.ensureDrapedStatus(!1)}async doLoad(){var T,A,M,I,L;const e=this.symbolLayer.width!=null?this.symbolLayer.width:this.symbolLayer.height,i=this.symbolLayer.height!=null?this.symbolLayer.height:e;this._vvConvertOptions=new K9({size:!0,color:!0,rotation:!1,opacity:!0},[1,1,1],[e,1,i],this._context.renderCoordsHelper.unitInMeters),this._fastUpdates=((A=(T=this._context.renderer)==null?void 0:T.visualVariables)==null?void 0:A.length)>0?C5(this._context.renderer,this._vvConvertOptions):null;const r=this.symbolLayer.anchor||"center";this._upVectorAlignment=this.symbolLayer.profileRotation==="heading"?Ry.World:Ry.Path;const n=this.symbolLayer.profile||"circle";switch(n){default:case"circle":this._profile=B5t[r];break;case"quad":this._profile=j5t[r]}switch(this.symbolLayer.join){case"round":this._extruder=new eY(0,N6e);break;case"bevel":this._extruder=new eY(0,1);break;case"miter":this._extruder=new eY(.8*Math.PI,1);break;default:this._extruder=new O5t}const s=this.symbolLayer.cap||"butt";switch(s){case"none":this._startCap=new Sve,this._endCap=new Sve;break;case"butt":default:this._startCap=new ZN(this._profile,0),this._endCap=new ZN(this._profile,0,!0);break;case"square":this._startCap=new ZN(this._profile,-.5),this._endCap=new ZN(this._profile,.5,!0);break;case"round":{const F=n==="quad";this._startCap=new Tve({profile:this._profile,flip:!1,breakNormals:F,subdivisions:nie}),this._endCap=new Tve({profile:this._profile,flip:!0,breakNormals:F,subdivisions:nie});break}}const o=(I=(M=this.symbolLayer)==null?void 0:M.material)==null?void 0:I.color,l=this._getCombinedOpacityAndColor(o),c=mc(l),f=l[3],_=f<1||this.needsDrivenTransparentPass,x={diffuse:c,ambient:c,opacity:f,transparent:_,hasVertexColors:!1,hasSlicePlane:this._context.slicePlaneEnabled,castShadows:this.symbolLayer.castShadows,cullFace:_||s==="none"?Ln.None:Ln.Back,offsetTransparentBackfaces:!0};if(!this._drivenProperties.size&&(or(this._intrinsicSize,e,i),!rie(this._intrinsicSize[0])||!rie(this._intrinsicSize[1])))throw new se("graphics3dpathsymbollayer:invalid-size","Symbol sizes may not be negative values");if((L=this._fastUpdates)!=null&&L.visualVariables.size||Gu(this._intrinsicSize,this._intrinsicSize,1/this._context.renderCoordsHelper.unitInMeters),this._fastUpdates){const F={...x,...this._fastUpdates.materialParameters,size:GPe(this._intrinsicSize)};this._materials[0]=new xPt(F)}else x.hasVertexColors=this._drivenProperties.color||this._drivenProperties.opacity,x.normalType=Br.Compressed,this._materials[0]=new km(x);this._materials[0].setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),this._context.stage.add(this._materials[0])}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials[0]=null,this._materials.length=0}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry,EPt,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(i),n=e.renderingInfo;return this._createAs3DShape(i,n,r,i.uid)}layerOpacityChanged(){var n,s,o;const e=(s=(n=this.symbolLayer)==null?void 0:n.material)==null?void 0:s.color,i=this._getCombinedOpacity(e),r=i<1||this.needsDrivenTransparentPass;(o=this._materials[0])==null||o.setParameters({opacity:i,transparent:r})}layerElevationInfoChanged(e,i){return this.updateGraphics3DGraphicElevationInfo(e,i,X2)}slicePlaneEnabledChanged(){var e;return(e=this._materials[0])==null||e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){var e;return(e=this._materials[0])==null||e.setParameters({usePBR:this._context.physicalBasedRenderingEnabled,isSchematic:!0}),!0}applyRendererDiff(e,i){var r;for(const n in e.diff){if(n!=="visualVariables"||!A5(this._fastUpdates,i,this._vvConvertOptions))return To.RecreateSymbol;(r=this._materials[0])==null||r.setParameters(this._fastUpdates.materialParameters)}return To.FastUpdate}_getVertexData(e){let i=0;const r=e.paths,n=[],s=e.spatialReference,o=this._context.elevationProvider.spatialReference,l=this._context.renderCoordsHelper.spatialReference;for(const x of r)i+=x.length;const c=Ja(3*i);let f,_=0;for(const x of r){n.push({offset:_,numVertices:x.length});for(const T of x)c[_++]=T[0],c[_++]=T[1],c[_++]=e.hasZ?T[2]:0}return o==null||s.equals(o)||vn(c,s,0,c,o,0,i)?(o==null||o.equals(l)?f=yLe(c):(f=Ja(3*i),vn(c,o,0,f,l,0,i)),{pathVertexDataInfos:n,vertexDataES:c,vertexDataRS:f}):null}_createAs3DShape(e,i,r,n){var M,I,L;this.usedMemory=0;const s=e.geometry,o=this._getVertexData(s);if(o==null)return this.logger.warn("PathSymbol3DLayer geometry failed to be created (failed to project geometry to view spatial reference)"),null;if(o.pathVertexDataInfos.length===0)return s.paths.length!==0&&s.paths.some(F=>F.length>0)||this.logger.warn("PathSymbol3DLayer geometry failed to be created (no paths were defined)"),null;const l=new Array,c=s.spatialReference,f=ya(),_=this._context.renderCoordsHelper,x=new nae(o.vertexDataES);for(const F of o.pathVertexDataInfos){const z=F.numVertices;if(z<2)continue;const k=F.offset;if(this._context.clippingExtent!=null&&(Bn(f),cp(f,o.vertexDataES,k,z),!ym(f,this._context.clippingExtent)))continue;const U=new Array,j=k+3*z;for(let ce=k;ceMPt(F,z,U,j,this._upVectorAlignment),r);return A.alignedSampledElevation=0,A.needsElevationUpdates=X2(r.mode),A}};function w7e(t,e,i){const{origin:r,positions:n}=t;let s=t.offset;switch(e){default:case Ry.World:for(const o of t.vertices)io[0]=n[s++]+r[0],io[1]=n[s++]+r[1],io[2]=n[s++]+r[2],i.worldUpAtPosition(io,io),o.setFrameFromUpVector(io);break;case Ry.Path:io[0]=n[s]+r[0],io[1]=n[s+1]+r[1],io[2]=n[s+2]+r[2],i.worldUpAtPosition(io,io),U5t(t,io)}}function Rve(t,e,i){switch(t){case"symbol-value":return i;case"proportional":return e;default:return t}}function APt(t,e,i,r){let n=0;const{origin:s,vertices:o,positions:l,positionsES:c}=t,f=t.offset+3*o.length;for(let _=t.offset;_Math.abs(c)?(ao(e,KN,o,-c),Ye(e,e),Wt(i,e,o),Ye(i,i),De(i,i,-1)):(ao(i,QN,o,-l),Ye(i,i),Wt(e,i,o),Ye(e,e))}const hg=Qe(),KN=W(),QN=W(),oY=W();function RPt(t,e){Ie(ER,0,0,0);for(let i=0;if.color));const l=t.output===ue.Depth;l&&(e.include(E_,t),XT(e),B2(e)),i.code.add(V` + void main(void) { + vpos = position; + forwardNormalizedVertexColor(); + forwardObjectAndLayerIdColor(); + + ${t.hasVertexColors?"vColor *= eColor;":t.vvColor?"vColor = eColor * interpolateVVColor(colorFeatureAttribute);":"vColor = eColor;"} + ${o?"depth = (view * vec4(vpos, 1.0)).z;":""} + gl_Position = ${l?V`transformPositionWithDepth(proj, view, vpos, nearFar, linearDepth);`:V`transformPosition(proj, view, vpos);`} + } + `),e.include(oo,t),o&&e.include(dd,t),r.include(h1);const c=t.output===ue.Highlight;return c&&e.include(dx,t),r.code.add(V` + void main() { + discardBySlice(vpos); + ${o?"terrainDepthTest(depth);":""} + vec4 fColor = vColor; + + ${t.output===ue.ObjectAndLayerIdColor?V`fColor.a = 1.0;`:""} + + if (fColor.a < ${V.float(Cl)}) { + discard; + } + + ${t.output===ue.Alpha?V`fragColor = vec4(fColor.a);`:""} + + ${t.output===ue.Color?V`fragColor = highlightSlice(fColor, vpos); ${t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""}`:""} + ${c?V`outputHighlight();`:""}; + ${t.output===ue.Depth?V`outputDepth(linearDepth);`:""}; + ${t.output===ue.ObjectAndLayerIdColor?V`outputObjectAndLayerIdColor();`:""} + } + `),e}const IPt=Object.freeze(Object.defineProperty({__proto__:null,build:S7e},Symbol.toStringTag,{value:"Module"}));let T7e=class E7e extends Hr{initializeProgram(e){return new Ir(e.rctx,E7e.shader.get().build(this.configuration),Er)}_createPipeline(e,i){const r=this.configuration,n=e===Jt.NONE,s=e===Jt.FrontFace;return Ti({blending:r.output!==ue.Color&&r.output!==ue.Alpha||!r.transparent?null:n?vp:Y_(e),culling:Mj(r.cullFace),depthTest:{func:px(e)},depthWrite:(n||s)&&r.writeDepth?rh:null,colorWrite:ji,stencilWrite:r.hasOccludees?Jy:null,stencilTest:r.hasOccludees?i?Z2:fx:null,polygonOffset:n||s?r.polygonOffset?$Pt:null:tG(r.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._createPipeline(this.configuration.transparencyPassType,!0),this._createPipeline(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};T7e.shader=new Rr(IPt,()=>we(()=>Promise.resolve().then(()=>LWt),void 0));const $Pt={factor:1,units:1};let fl=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.cullFace=Ln.None,this.transparencyPassType=Jt.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.transparent=!1,this.polygonOffset=!1,this.enableOffset=!0,this.writeDepth=!0,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.objectAndLayerIdColorInstanced=!1,this.vvColor=!1}};y([fe({count:ue.COUNT})],fl.prototype,"output",void 0),y([fe({count:Ln.COUNT})],fl.prototype,"cullFace",void 0),y([fe({count:Jt.COUNT})],fl.prototype,"transparencyPassType",void 0),y([fe()],fl.prototype,"hasSlicePlane",void 0),y([fe()],fl.prototype,"hasVertexColors",void 0),y([fe()],fl.prototype,"transparent",void 0),y([fe()],fl.prototype,"polygonOffset",void 0),y([fe()],fl.prototype,"enableOffset",void 0),y([fe()],fl.prototype,"writeDepth",void 0),y([fe()],fl.prototype,"hasOccludees",void 0),y([fe()],fl.prototype,"multipassEnabled",void 0),y([fe()],fl.prototype,"cullAboveGround",void 0),y([fe()],fl.prototype,"objectAndLayerIdColorInstanced",void 0),y([fe()],fl.prototype,"vvColor",void 0),y([fe({constValue:!1})],fl.prototype,"occlusionPass",void 0),y([fe({constValue:!0})],fl.prototype,"hasVvInstancing",void 0),y([fe({constValue:!1})],fl.prototype,"vvSize",void 0),y([fe({constValue:!1})],fl.prototype,"vvOpacity",void 0);let $ve=class extends Zle{constructor(e){super(e,new DPt),this.supportsEdges=!0,this._configuration=new fl}getConfiguration(e,i){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this._isTransparent,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.enableOffset=i.camera.relativeElevation1/_.screenToPCSRatio)):s.add(J.BOUNDINGRECT,"mat3"),s.add(J.POSITION,"vec3"),s.add(J.UVMAPSPACE,"vec4"),t.vvColor&&s.add(J.COLORFEATUREATTRIBUTE,"float"),o.add("vColor","vec4"),o.add("vpos","vec3"),o.add("vuv","vec2"),i&&o.add("depth","float"),r.uniforms.add(new gr("uColor",f=>f.color));const l=t.style===Tl.ForwardDiagonal||t.style===Tl.BackwardDiagonal||t.style===Tl.DiagonalCross;l&&r.code.add(V` + const mat2 rotate45 = mat2(${V.float(Aie)}, ${V.float(-Lve)}, + ${V.float(Lve)}, ${V.float(Aie)}); + `),t.draped||(Nm(r,t),r.uniforms.add(new ft("worldToScreenPerDistanceRatio",(f,_)=>1/_.camera.perScreenPixelRatio)),r.code.add(V`vec3 projectPointToLineSegment(vec3 center, vec3 halfVector, vec3 point) { +float projectedLength = dot(halfVector, point - center) / dot(halfVector, halfVector); +return center + halfVector * clamp(projectedLength, -1.0, 1.0); +}`),r.code.add(V`vec3 intersectRayPlane(vec3 rayDir, vec3 rayOrigin, vec3 planeNormal, vec3 planePoint) { +float d = dot(planeNormal, planePoint); +float t = (d - dot(planeNormal, rayOrigin)) / dot(planeNormal, rayDir); +return rayOrigin + t * rayDir; +}`),r.code.add(V` + float boundingRectDistanceToCamera() { + vec3 center = vec3(boundingRect[0][0], boundingRect[0][1], boundingRect[0][2]); + vec3 halfU = vec3(boundingRect[1][0], boundingRect[1][1], boundingRect[1][2]); + vec3 halfV = vec3(boundingRect[2][0], boundingRect[2][1], boundingRect[2][2]); + vec3 n = normalize(cross(halfU, halfV)); + + vec3 viewDir = - vec3(view[0][2], view[1][2], view[2][2]); + + float viewAngle = dot(viewDir, n); + float minViewAngle = ${V.float(NPt)}; + + if (abs(viewAngle) < minViewAngle) { + // view direction is (almost) parallel to plane -> clamp it to min angle + float normalComponent = sign(viewAngle) * minViewAngle - viewAngle; + viewDir = normalize(viewDir + normalComponent * n); + } + + // intersect view direction with infinite plane that contains bounding rect + vec3 planeProjected = intersectRayPlane(viewDir, cameraPosition, n, center); + + // clip to bounds by projecting to u and v line segments individually + vec3 uProjected = projectPointToLineSegment(center, halfU, planeProjected); + vec3 vProjected = projectPointToLineSegment(center, halfV, planeProjected); + + // use to calculate the closest point to camera on bounding rect + vec3 closestPoint = uProjected + vProjected - center; + + return length(closestPoint - cameraPosition); + } + `)),r.code.add(V` + vec2 scaledUV() { + vec2 uv = uvMapSpace.xy ${l?" * rotate45":""}; + vec2 uvCellOrigin = uvMapSpace.zw ${l?" * rotate45":""}; + + ${t.draped?"":V` + float distanceToCamera = boundingRectDistanceToCamera(); + float worldToScreenRatio = worldToScreenPerDistanceRatio / distanceToCamera; + `} + + // Logarithmically discretize ratio to avoid jittering + float step = 0.1; + float discreteWorldToScreenRatio = log(worldToScreenRatio); + discreteWorldToScreenRatio = ceil(discreteWorldToScreenRatio / step) * step; + discreteWorldToScreenRatio = exp(discreteWorldToScreenRatio); + + vec2 uvOffset = mod(uvCellOrigin * discreteWorldToScreenRatio, ${V.float(t.patternSpacing)}); + return uvOffset + (uv * discreteWorldToScreenRatio); + } + `);const c=t.output===ue.Depth;return c&&(e.include(E_,t),XT(e),B2(e)),r.code.add(V` + void main(void) { + vuv = scaledUV(); + vpos = position; + ${i?"depth = (view * vec4(vpos, 1.0)).z;":""} + forwardNormalizedVertexColor(); + ${t.hasVertexColors?"vColor *= uColor;":t.vvColor?"vColor = uColor * interpolateVVColor(colorFeatureAttribute);":"vColor = uColor;"} + gl_Position = ${c?V`transformPositionWithDepth(proj, view, vpos, nearFar, linearDepth);`:V`transformPosition(proj, view, vpos);`} + } + `),e.include(oo,t),n.include(h1),t.draped&&n.uniforms.add(new ft("texelSize",(f,_)=>1/_.camera.pixelRatio)),t.output===ue.Highlight&&e.include(dx,t),i&&e.include(dd,t),t.output!==ue.Highlight&&(n.code.add(V` + const float lineWidth = ${V.float(t.lineWidth)}; + const float spacing = ${V.float(t.patternSpacing)}; + const float spacingINV = ${V.float(1/t.patternSpacing)}; + + float coverage(float p, float txlSize) { + p = mod(p, spacing); + + float halfTxlSize = txlSize / 2.0; + + float start = p - halfTxlSize; + float end = p + halfTxlSize; + + float coverage = (ceil(end * spacingINV) - floor(start * spacingINV)) * lineWidth; + coverage -= min(lineWidth, mod(start, spacing)); + coverage -= max(lineWidth - mod(end, spacing), 0.0); + + return coverage / txlSize; + } + `),t.draped||n.code.add(V`const int maxSamples = 5; +float sampleAA(float p) { +vec2 dxdy = abs(vec2(dFdx(p), dFdy(p))); +float fwidth = dxdy.x + dxdy.y; +ivec2 samples = 1 + ivec2(clamp(dxdy, 0.0, float(maxSamples - 1))); +vec2 invSamples = 1.0 / vec2(samples); +float accumulator = 0.0; +for (int j = 0; j < maxSamples; j++) { +if(j >= samples.y) { +break; +} +for (int i = 0; i < maxSamples; i++) { +if(i >= samples.x) { +break; +} +vec2 step = vec2(i,j) * invSamples - 0.5; +accumulator += coverage(p + step.x * dxdy.x + step.y * dxdy.y, fwidth); +} +} +accumulator /= float(samples.x * samples.y); +return accumulator; +}`)),n.code.add(V` + void main() { + discardBySlice(vpos); + ${i?"terrainDepthTest(depth);":""} + vec4 color = vColor; + color = highlightSlice(color, vpos); + + ${t.output!==ue.Highlight?V`color.a *= ${FPt(t)};`:""} + + ${t.output===ue.ObjectAndLayerIdColor?V`color.a = 1.0;`:""} + + if (color.a < ${V.float(Cl)}) { + discard; + } + + ${t.output===ue.Alpha?V`fragColor = vec4(color.a);`:""} + + ${t.output===ue.Color?V`fragColor = color; ${t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""}`:""} + ${t.output===ue.Highlight?V`outputHighlight();`:""} + ${t.output===ue.Depth?V`outputDepth(linearDepth);`:""}; + } + `),e}function FPt(t){function e(i){return t.draped?V`coverage(vuv.${i}, texelSize)`:V`sampleAA(vuv.${i})`}switch(t.style){case Tl.ForwardDiagonal:case Tl.Horizontal:return e("y");case Tl.BackwardDiagonal:case Tl.Vertical:return e("x");case Tl.DiagonalCross:case Tl.Cross:return V` + 1.0 - (1.0 - ${e("x")}) * (1.0 - ${e("y")}) + `;default:return"0.0"}}const kPt=Object.freeze(Object.defineProperty({__proto__:null,build:C7e},Symbol.toStringTag,{value:"Module"}));let A7e=class M7e extends Hr{initializeProgram(e){return new Ir(e.rctx,M7e.shader.get().build(this.configuration),O7e)}_setPipelineState(e,i){const r=this.configuration,n=e===Jt.NONE,s=e===Jt.FrontFace;return Ti({blending:r.output===ue.Color||r.output===ue.Alpha?n?vp:Y_(e):null,culling:Mj(r.cullFace),depthTest:{func:px(e)},depthWrite:n?r.writeDepth?rh:null:Kj(e),colorWrite:ji,stencilWrite:r.hasOccludees?Jy:null,stencilTest:r.hasOccludees?i?Z2:fx:null,polygonOffset:n||s?r.polygonOffset?zPt:null:tG(r.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._setPipelineState(this.configuration.transparencyPassType,!0),this._setPipelineState(this.configuration.transparencyPassType,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};A7e.shader=new Rr(kPt,()=>we(()=>Promise.resolve().then(()=>DWt),void 0));const zPt={factor:1,units:1};let ba=class extends hu{constructor(){super(...arguments),this.output=ue.Color,this.cullFace=Ln.None,this.transparencyPassType=Jt.NONE,this.hasSlicePlane=!1,this.hasVertexColors=!1,this.polygonOffset=!1,this.writeDepth=!0,this.hasOccludees=!1,this.enableOffset=!0,this.multipassEnabled=!1,this.cullAboveGround=!1,this.vvColor=!1}};y([fe({count:ue.COUNT})],ba.prototype,"output",void 0),y([fe({count:Ln.COUNT})],ba.prototype,"cullFace",void 0),y([fe({count:Tl.COUNT})],ba.prototype,"style",void 0),y([fe({count:Jt.COUNT})],ba.prototype,"transparencyPassType",void 0),y([fe()],ba.prototype,"hasSlicePlane",void 0),y([fe()],ba.prototype,"hasVertexColors",void 0),y([fe()],ba.prototype,"polygonOffset",void 0),y([fe()],ba.prototype,"writeDepth",void 0),y([fe()],ba.prototype,"hasOccludees",void 0),y([fe()],ba.prototype,"patternSpacing",void 0),y([fe()],ba.prototype,"lineWidth",void 0),y([fe()],ba.prototype,"enableOffset",void 0),y([fe()],ba.prototype,"draped",void 0),y([fe()],ba.prototype,"multipassEnabled",void 0),y([fe()],ba.prototype,"cullAboveGround",void 0),y([fe()],ba.prototype,"vvColor",void 0),y([fe({constValue:!1})],ba.prototype,"occlusionPass",void 0),y([fe({constValue:!1})],ba.prototype,"hasVvInstancing",void 0),y([fe({constValue:!1})],ba.prototype,"vvSize",void 0),y([fe({constValue:!1})],ba.prototype,"vvOpacity",void 0);const O7e=new Map([[J.POSITION,0],[J.COLOR,3],[J.UVMAPSPACE,4],[J.COLORFEATUREATTRIBUTE,5],[J.BOUNDINGRECT,6]]);let mce=class extends Zle{constructor(e){super(e,new BPt),this.supportsEdges=!0,this._vertexAttributeLocations=O7e,this._configuration=new ba}getConfiguration(e,i){return this._configuration.output=e,this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasVertexColors=this.parameters.hasVertexColors&&!this.parameters.vvColor,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.style=this.parameters.style,this._configuration.patternSpacing=this.parameters.patternSpacing,this._configuration.lineWidth=this.parameters.lineWidth,this._configuration.draped=this.parameters.draped,this._configuration.transparencyPassType=i.transparencyPassType,this._configuration.enableOffset=i.camera.relativeElevation0)return;const e=(s=(n=this.symbolLayer)==null?void 0:n.material)==null?void 0:s.color,i=this._getCombinedOpacityAndColor(e);this._materials[Qs.Fill]=jPt(this.symbolLayer,{color:i,forceTransparentMode:this.needsDrivenTransparentPass,polygonOffset:!1,hasVertexColors:!0,writeLinearDepth:!0,draped:this.draped,hasSlicePlane:this._context.slicePlaneEnabled,...(o=this._fastUpdates)==null?void 0:o.materialParameters}),this._needsUV=this._materials[Qs.Fill]instanceof mce;const r=this.symbolLayer.outline;if(this._isValidOutline(r)){const l=_8e(r.pattern);this._materials[Qs.Outline]=new zM({width:Tr(r.size),color:this._getOutlineColor(),hasPolygonOffset:!0,hasSlicePlane:this._context.slicePlaneEnabled,isClosed:!0,stipplePattern:l,cap:bie(r.patternCap||"butt")})}this._context.stage.addMany(this._materials)}_isValidOutline(e){return(e==null?void 0:e.size)!=null&&e.size>0&&e.color!=null&&(e.pattern==null||e.pattern.type!=="style"||e.pattern.style!=="none")}destroy(){super.destroy(),this._context.stage.removeMany(this._materials),this._materials.length=0}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry,YPt,this.symbolLayer.type))return null;const r=this._getVertexOpacityAndColor(e.renderingInfo,255),n=this.setGraphicElevationContext(i);return this.ensureDrapedStatus(n.mode==="on-the-ground"),this._createMaterials(),this.draped?this._createAsOverlay(i,r):this._createAs3DShape(i,r,n)}applyRendererDiff(e,i){var r;for(const n in e.diff){if(n!=="visualVariables"||!A5(this._fastUpdates,i,Dve))return To.RecreateSymbol;(r=this._materials[Qs.Fill])==null||r.setParameters(this._fastUpdates.materialParameters)}return To.FastUpdate}layerOpacityChanged(){var e,i;if(this._materials[Qs.Fill]!=null){const r=this._materials[Qs.Fill].parameters.color,n=(i=(e=this.symbolLayer)==null?void 0:e.material)==null?void 0:i.color,s=this._getCombinedOpacity(n);this._materials[Qs.Fill].setParameters({color:[r[0],r[1],r[2],s],forceTransparentMode:this.needsDrivenTransparentPass})}if(this._materials[Qs.Outline]!=null){const r=this._materials[Qs.Outline].parameters.color;this._materials[Qs.Outline].setParameters({color:[r[0],r[1],r[2],this._getOutlineOpacity()]})}}layerElevationInfoChanged(e,i,r){const n=this._elevationContext.mode,s=i6(R7e.elevationModeChangeTypes,r,n);if(s!==Ys.UPDATE)return s;const o=t0(n);return this.updateGraphics3DGraphicElevationInfo(e,i,()=>o)}slicePlaneEnabledChanged(){var e;if((e=this._materials[Qs.Fill])==null||e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),this._materials[Qs.Outline]){const i={hasSlicePlane:this._context.slicePlaneEnabled};this._materials[Qs.Outline].setParameters(i)}return!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,i,r){var _;const n=VL(e.geometry);if(!n)return null;const s=ice(n,this._context.elevationProvider,this._context.renderCoordsHelper,r),o=new XPt(s,i,this._context.layer.uid,e.uid),l=o.renderData.position.length/3;if(this._needsUV&&(o.uvMapSpace=Rs(4*l,!0),o.boundingRect=Ja(9*l,!0),x7e(o.uvMapSpace,o.boundingRect,o.renderData.position,this._context.renderCoordsHelper)),o.objectAndLayerIdColor=(_=this._context.stage.renderView)==null?void 0:_.getObjectAndLayerIdColor(o),this._createAs3DShapeFill(e,o),this._materials[Qs.Outline]&&this._createAs3DShapeOutline(o),this._logGeometryCreationWarnings(o.renderData,n.rings,"rings","FillSymbol3DLayer"),o.outGeometries.length===0)return null;const c=new X_({geometries:o.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:e.uid}),f=new d1(this,c,o.outGeometries,null,null,WPt,r);return f.alignedSampledElevation=o.renderData.sampledElevation,f.needsElevationUpdates=t0(r.mode),f}_createAs3DShapeFill(e,i){var n;const r=i.renderData.polygons;for(const{position:s,mapPositions:o,holeIndices:l,index:c,count:f}of r){if(this._context.clippingExtent!=null&&(Bn(y0),cp(y0,o),!ym(y0,this._context.clippingExtent)))continue;const _=hTt(o,l,this._context.elevationProvider.spatialReference);if(_.length===0)continue;const x=(n=this._fastUpdates)==null?void 0:n.visualVariables.color,T=Qye({material:this._materials[Qs.Fill],indices:_,mapPositions:o,attributeData:{position:s,color:x?null:i.color,colorFeature:x?Om(x.field,e):null,uvMapSpace:this._needsUV?SU(i.uvMapSpace,4*c,4*f):null,boundingRect:this._needsUV?Lf(i.boundingRect,9*c,9*f):null,objectAndLayerIdColor:i.objectAndLayerIdColor}});i.outGeometries.push(T)}}_createAs3DShapeOutline(e){if(this._materials[Qs.Outline]==null)return;const i=e.renderData.outlines;for(const{mapPositions:r,position:n}of i){if(this._context.clippingExtent!=null&&(Bn(y0),cp(y0,r),!ym(y0,this._context.clippingExtent)))continue;const s=wie(this._materials[Qs.Outline],{overlayInfo:null,removeDuplicateStartEnd:!0,mapPositions:r,attributeData:{position:n}},e.objectAndLayerIdColor);e.outGeometries.push(s)}}_createAsOverlay(e,i){var l;const r=VL(e.geometry);if(r==null)return null;this._materials[Qs.Fill].renderPriority=this._renderPriority+this._renderPriorityStep/2,this._materials[Qs.Outline]!=null&&(this._materials[Qs.Outline].renderPriority=this._renderPriority);const n=YNe(r,this._context.overlaySR),s=new ZPt(n,i,this._context.layer.uid,e.uid),o=s.renderData.position.length/3;return this._needsUV&&(s.uvMapSpace=Rs(4*o,!0),OPt(s.uvMapSpace,s.renderData.position,this._context.overlaySR,this._context.graphicsCoreOwner.view.state.viewingMode)),s.outBoundingBox=Bn(),s.objectAndLayerIdColor=(l=this._context.stage.renderView)==null?void 0:l.getObjectAndLayerIdColor(s),this._createAsOverlayFill(e,s),this._materials[Qs.Outline]&&this._createAsOverlayOutline(s),this._logGeometryCreationWarnings(s.renderData,r.rings,"rings","FillSymbol3DLayer"),s.outGeometries.length===0?null:new mG(this,s.outGeometries,s.outBoundingBox,this._context.drapeSourceRenderer)}_createAsOverlayFill(e,i){var n;const r=i.renderData.polygons;for(const{position:s,holeIndices:o,index:l,count:c}of r){const f=Bn(y0);if(cp(f,s),!ym(f,this._context.clippingExtent))continue;const _=R5(s,o,3);if(_.length===0)continue;ZO(i.outBoundingBox,f);const x=(n=this._fastUpdates)==null?void 0:n.visualVariables.color,T=Qye({material:this._materials[Qs.Fill],indices:_,attributeData:{position:s,color:x?null:i.color,colorFeature:x?Om(x.field,e):null,uvMapSpace:this._needsUV?SU(i.uvMapSpace,4*l,4*c):null,objectAndLayerIdColor:i.objectAndLayerIdColor}});i.outGeometries.push(new $5(T,i))}}_createAsOverlayOutline(e){if(this._materials[Qs.Outline]==null)return;const i=e.renderData.outlines;for(let r=0;rthis._createAsOverlay(e,i),createAs3DShape:(e,i,r)=>this._createAs3DShape(e,i,r)}}};P7e.elevationModeChangeTypes={definedChanged:Ys.RECREATE,staysOnTheGround:Ys.NONE,onTheGroundChanged:Ys.RECREATE};const y0=ya();let XPt=class extends pG{constructor(e,i,r,n){super(e,r,n),this.color=i}},ZPt=class extends pG{constructor(e,i,r,n){super(e,r,n),this.color=i}};var Qs;(function(t){t[t.Fill=0]="Fill",t[t.Outline=1]="Outline"})(Qs||(Qs={}));let I7e=class{constructor(e,i="center",r=!1,n=yt(),s=Mi(0,0,0,-1),o="world",l=W(),c=0){this.verticalOffset=e,this.anchor=i,this.hasLabelVerticalOffset=r,this.screenOffset=n,this.centerOffset=s,this.centerOffsetUnits=o,this.translation=l,this.elevationOffset=c}},$7e=class{constructor(e,i="center",r="center",n=null,s=yt()){this.placement=e,this.horizontalPlacement=i,this.verticalPlacement=r,this.text=n,this.displaySize=s}};const JPt="arial-unicode-ms",Nve="woff2",Fve=new Map,L7e=new Set;let KPt=class{constructor(e,i){this.fontFace=e,this.promise=i}};async function QPt(t){const e=iRt(t),i=Fve.get(e);if(i)return i.promise;const r=new FontFace(t.family,`url('${Ar.fontsUrl}/woff2/${e}.${Nve}') format('${Nve}')`,{style:t.style,weight:t.weight}),n=document.fonts;if(n.has(r)&&r.status==="loading")return r.loaded;const s=r.load().then(()=>(n.add(r),r));return Fve.set(e,new KPt(r,s)),L7e.add(r),s}function eRt(t){return L7e.has(t)}function tRt(t){if(!t)return JPt;const e=t.toLowerCase().split(" ").join("-");switch(e){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return e}}function iRt(t){const e=rRt(t)+nRt(t);return tRt(t.family)+(e.length>0?e:"-regular")}function rRt(t){if(!t.weight)return"";switch(t.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function nRt(t){if(!t.style)return"";switch(t.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let D7e=class N7e{constructor(e){this.definition=e,this.key=JSON.stringify(e),this.haloSize=Math.round(e.halo.size),this.textStyle=this._colorToRGBA(e.color),this.haloStyle=this._colorToRGB(e.halo.color),this.backgroundStyle=e.background.color[3]!==0?this._colorToRGBA(e.background.color):null}fontString(e){const i=this.definition.font,r="sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji";return`${i.style} ${i.weight} ${e}px ${i.family}, ${r}`}setFontProperties(e,i){e.font=this.fontString(i),e.textAlign="left",e.textBaseline="alphabetic"}_colorToRGB(e){return`rgb(${e.slice(0,3).map(i=>Math.floor(255*i)).toString()})`}_colorToRGBA(e){return`rgba(${e.slice(0,3).map(i=>Math.floor(255*i)).toString()},${e[3]})`}static async fromSymbol(e,i){var T,A,M,I,L;const r=(T=e==null?void 0:e.material)==null?void 0:T.color,n=qe.toUnitRGBA(r)??gp,s=e.size!=null?Tr(e.size):12,o=e.lineHeight,l=e.background!=null?qe.toUnitRGBA(e.background.color):gp,c={family:((A=e.font)==null?void 0:A.family)??"sans-serif",decoration:((M=e.font)==null?void 0:M.decoration)??"none",weight:((I=e.font)==null?void 0:I.weight)??"normal",style:((L=e.font)==null?void 0:L.style)??"normal"},f=e.halo,_=(f==null?void 0:f.color)!=null&&f.size>0?{size:Tr(f.size),color:qe.toUnitRGBA(f.color)}:{size:0,color:gp},x=new N7e({color:n,size:s,background:{color:l,padding:e.background!=null?[.65*s,.5*s]:[0,0],borderRadius:e.background!=null?s*(6/16):0},lineSpacingFactor:o,font:c,halo:_,pixelRatio:i});if(e.font){let F=!1;const z=x.fontString(s);try{F=(await document.fonts.load(z)).some(k=>!eRt(k))}catch{Ce.getLogger("esri.views.3d.webgl-engine.lib.TextRenderParameters").warnOnce(`Failed to preload font '${z}'. Some text symbology may be rendered using the default browser font.`)}if(!F&&!sRt.has(e.font.family))try{await QPt(e.font)}catch{}}return x}};const sRt=new Set(["Arial","Times New Roman","Courier New","serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]),Eb=4096;let iT=class extends ze{constructor(e){super(e),this.type=Ws.Texture,this.id=hp(),this.events=new Dn,this._glTexture=null,this._atlas=new lRt(256,256),this._needsRepack=!1,this._canRepack=!0,this._elementsToRender=new Map,this._elements=new Map,this._stageObjects=new Map,this.updating=!1}initialize(){this._canvas=document.createElement("canvas"),this._canvas.setAttribute("id","textAtlasCanvas"),this._canvas.setAttribute("style","display:none"),this._ctx=this._canvas.getContext("2d"),this._stage=this.view._stage,this._stage.add(this),this._updateCanvasElementSize(this._atlas),this._reset()}unload(){this._glTexture=Kt(this._glTexture),this.updating=!1,this.events.emit("unloaded")}get glTexture(){return this._glTexture}static get maxSize(){return L$=0,[Eb-Cb-L$,Eb-Cb-L$-kve]}load(e){if(this._glTexture)return this._glTexture;const i=new tn;return i.wrapMode=Bi.CLAMP_TO_EDGE,i.samplingMode=ki.LINEAR_MIPMAP_LINEAR,i.hasMipmap=!0,i.preMultiplyAlpha=!0,i.maxAnisotropy=e.parameters.maxMaxAnisotropy,this._glTexture=new Ai(e,i,this._canvas),this._frameWorker=this.view.resourceController.scheduler.registerTask(ni.TEXT_TEXTURE_ATLAS,this),this.setDirty(),this._glTexture}dispose(){this._elements.clear(),this._elementsToRender.clear(),this._frameWorker=en(this._frameWorker),this._glTexture&&(this._stage.remove(this),this._glTexture=Kt(this._glTexture)),this._canvas.width=0,this._canvas.height=0,this._canvas=null,this._ctx=null}_updateCanvasElementSize(e){this._canvas.setAttribute("width",e.width.toString()),this._canvas.setAttribute("height",e.height.toString())}_resizeAtlas(e,i){var s,o;const{width:r,height:n}=this._atlas;r===e&&n===i||(this._atlas.width=e,this._atlas.height=i,(s=this._glTexture)==null||s.resize(e,i),(o=this._glTexture)==null||o.updateData(0,0,0,r,n,this._canvas),this._updateCanvasElementSize(this._atlas),this._elements.forEach(l=>{const c=this._stageObjects.get(l.textRenderer.key);c==null||c.forEach(f=>lY(f,l))}),this._reset())}_reset(){this._elementsToRender.clear(),this._atlas.reset(),this._needsRepack=!0,this.setDirty()}_addAtlasElement(e,i,r,n){const s=this._atlas;if(s.widths.width>=c.x+r);if(l==null){if(s.heightr.height)this._resizeAtlas(r.width,f);else if(r.widthlY(n,e))}get running(){return this.updating}runTask(e){if(this._glTexture==null)return Xl.YIELD;for(;this._needsRepack&&(this._canRepack||this._atlas.heightthis._processAddition(r)),e.madeProgress()}if(this._elementsToRender.size>0){for(const[i,r]of this._elementsToRender){if(e.done)break;this._renderElement(r),this._elementsToRender.delete(i),e.madeProgress()}this._glTexture.setData(this._canvas)}this.updating=this._elementsToRender.size>0}addTextTexture(e,i){const r=e.key;this._addStageObject(r,i);let n=this._elements.get(r);n==null&&(n=new aRt(this._atlas,e),this._processAddition(n),this.setDirty()),oRt(i,n),lY(i,n)}removeTextTexture(e,i){const r=e.key;if(!this._elements.get(r))return;this._removeStageObject(r,i);const n=this._stageObjects.get(r);n&&n.size!==0||this._elements.delete(r),(n==null?void 0:n.size)===0&&this._stageObjects.delete(r),this._canRepack=!0}setDirty(){this._glTexture&&(this.updating=!0)}get test(){const{_elements:e,_stageObjects:i,_atlas:r}=this,n=this;return{elements:e,stageObjects:i,atlas:r,resizeAtlas:(s,o)=>n._resizeAtlas(s,o),run:s=>n.runTask(s)}}};function oRt(t,e){t.geometries[0].setAttributeData(J.SIZE,[e.textRenderer.displayWidth,e.textRenderer.displayHeight]),t.geometryVertexAttributeUpdated(t.geometries[0],J.SIZE)}function lY(t,e){t.geometries[0].setAttributeData(J.UV0,e.uv),t.geometryVertexAttributeUpdated(t.geometries[0],J.UV0,!0)}y([w({constructOnly:!0})],iT.prototype,"view",void 0),y([w({type:Boolean})],iT.prototype,"updating",void 0),iT=y([Z("esri.views.3d.webgl-engine.lib.TextTextureAtlas")],iT);const Cb=2,kve=2;let aRt=class{constructor(e,i){this._atlas=e,this.textRenderer=i,this._uv=Xi(),this._newPosition=[0,0]}get uv(){if(this._xOffset==null||this._yOffset==null)return gp;const{renderedWidth:e,renderedHeight:i}=this.textRenderer;return rs(this._uv,this._xOffset/this._atlas.width,(this._yOffset+i)/this._atlas.height,(this._xOffset+e)/this._atlas.width,this._yOffset/this._atlas.height)}setNewPosition(e){this._newPosition[0]=e.x,this._newPosition[1]=e.y}commitNewPosition(){return this._xOffset=this._newPosition[0],this._yOffset=this._newPosition[1],this._newPosition}get xOffset(){return this._xOffset}get yOffset(){return this._yOffset}},lRt=class{constructor(e,i){this.width=e,this.height=i,this.cursors=new Map,this.nextY=0}reset(){this.cursors.clear(),this.nextY=L$}},zve=class{constructor(e){this.y=e,this.x=L$}},L$=0,cRt=class{constructor(e,i,r){this._renderer=new u8e(e,i,r,iT.maxSize)}get key(){return this._renderer.key}get baselineAnchorY(){return 1-this._renderer.firstRenderedBaselinePosition/this._renderer.renderedHeight}get displayWidth(){return this._renderer.displayWidth}get displayHeight(){return this._renderer.displayHeight}create(){const e=KU(uRt,this._renderer.renderedWidth,this._renderer.renderedHeight),i=e.getContext("2d");return i.save(),this._renderer.render(i,0,0),i.restore(),new OE(e,{wrap:{s:Bi.CLAMP_TO_EDGE,t:Bi.CLAMP_TO_EDGE},noUnpackFlip:!1,mipmap:!0,preMultiplyAlpha:!0})}};const uRt={canvas:null},hRt=[0,0,1];let dRt=class extends p1{constructor(e,i,r,n){super(e,i,r,n),this._elevationOptions={supportsOffsetAdjustment:!0,supportsOnTheGround:!1},this.ensureDrapedStatus(!1)}async doLoad(){if(!this._drivenProperties.size){const e=iG(this.symbolLayer.size);if(e)throw new se("graphics3dtextsymbollayer:invalid-size",e)}await this._createTextRenderParameters()}async _createTextRenderParameters(){const e=this._context.graphicsCoreOwner.view.state.rasterPixelRatio;this._textRenderParameters=await D7e.fromSymbol(this.symbolLayer,e)}destroy(){super.destroy()}createGraphics3DGraphic(e){const i=e.graphic,r=UL(i.geometry);if(r==null)return this.logger.warn(`unsupported geometry type for text symbol: ${i.geometry.type}`),null;const n=this.symbolLayer.text;if(n==null||n==="")return null;const s=Vse(this.symbol)&&this.symbol.hasVisibleVerticalOffset()?this.symbol.verticalOffset:null;if(s!=null&&!cOe(this.symbolLayer))return this.logger.errorOncePerTick(`Callouts and vertical offset on text symbols are currently only supported with 'center' horizontal alignment (not with '${this.symbolLayer.horizontalAlignment}' alignment)`),null;const{verticalAlignment:o}=this.symbolLayer,l=new I7e(s);IAt(o,l.screenOffset);const c=new $7e(l,this.symbolLayer.horizontalAlignment,RAt(o));return this._createAs3DShape(i,r,n,c)}createLabel(e,i,r,n,s){const o=e.graphic,l=UL(o.geometry);if(l==null)return this.logger.warn(`unsupported geometry type for label: ${o.geometry.type}`),null;const c=i.text;return!c||/^\s+$/.test(c)?null:this._createAs3DShape(o,l,c,i,r,n,s)}setGraphicElevationContext(e,i,r=0){return super.setGraphicElevationContext(e,i),i.addOffsetRenderUnits(r),i}layerOpacityChanged(){return this.logger.warn("layer opacity change not yet implemented in Graphics3DTextSymbolLayer"),!1}layerElevationInfoChanged(e,i){return Uve(e,i,(r,n)=>{this.updateGraphicElevationContext(n,r)}),Ys.UPDATE}slicePlaneEnabledChanged(e,i){return Uve(e,i,r=>{for(const n of r.stageObject.geometries)n.material.setParameters({hasSlicePlane:this._context.slicePlaneEnabled})}),!0}physicalBasedRenderingChanged(){return!0}get pixelRatioChanged(){return!1}updateGraphicElevationContext(e,i){const r=i.elevationContext;this.setGraphicElevationContext(e,r,i.metadata!=null?i.metadata.elevationOffset:0),i.needsElevationUpdates=t0(r.mode)||r.mode==="absolute-height"}_defaultElevationInfoNoZ(){return fRt}_createAs3DShape(e,i,r,n,s=null,o=null,l=()=>n.placement.elevationOffset){var ne;const c=this.setGraphicElevationContext(e,new VU,n.placement.elevationOffset),f=((ne=e.geometry)==null?void 0:ne.type)==="polyline",_=e.uid;let x=null,T=null;if(o==null){const re=d8e(n.horizontalPlacement);x=new cRt(r,re,this._textRenderParameters);let he=null;if(this._context.sharedResources.textures!=null){T=this._context.sharedResources.textures.fromData(x.key,()=>x.create()),T.texture.events.on("unloaded",()=>he==null?void 0:he.release());const ce=this._context.stage.renderView.textureRepository.acquire(T.texture.id);if(ce==null||pd(ce))return T.release(),null;he=ce}}const A=pRt(x,n),M={occlusionTest:!0,screenOffset:n.placement.screenOffset,anchorPosition:A,polygonOffset:!0,color:[1,1,1,1],centerOffsetUnits:n.placement.centerOffsetUnits,drawInSecondSlot:!0};if(o?M.textureId=o.id:T&&(M.textureId=T.texture.id),n.placement.verticalOffset!=null){const{screenLength:re,minWorldLength:he,maxWorldLength:ce}=n.placement.verticalOffset;M.verticalOffset={screenLength:Tr(re),minWorldLength:he||0,maxWorldLength:ce??1/0}}if(this._context.screenSizePerspectiveEnabled){const{screenSizePerspectiveSettings:re,screenSizePerspectiveSettingsLabels:he}=this._context.sharedResources,ce=c8e(this._textRenderParameters);M.screenSizePerspective=he.overrideFontHeight(ce.maxHeight),M.screenSizePerspectiveAlignment=re}f&&(M.shaderPolygonOffset=1e-4),M.hasSlicePlane=this._context.slicePlaneEnabled;const I=(re,he)=>{const ce=JSON.stringify(he);let be=re.get(ce);return be==null&&(be=new O5(he),re.add(ce,be)),be},L=s?I(s,M):new O5(M),F=n.placement.translation,z=x?Ji(x.displayWidth,x.displayHeight):Wy,k=n.placement.centerOffset,U=Rte(L,hRt,F,null,z,k,[0,0],null),j=$le(this._context,i,U,c,_);if(j==null)return null;const H=(re,he,ce,be,ye,pe)=>{const Ee=l()||n.placement.elevationOffset,te=this.setGraphicElevationContext(e,he,Ee);return _T(re,te,ce,be,ye,pe)},Y=new d1(this,j.object,[U],s==null?[L]:null,T,H,c);Y.alignedSampledElevation=j.sampledElevation,Y.needsElevationUpdates=t0(c.mode)||c.mode==="absolute-height",Y.getScreenSize=(re=yt())=>(re[0]=x?x.displayWidth:n.displaySize[0],re[1]=x?x.displayHeight:n.displaySize[1],re);const Q=new D6e(n.placement.elevationOffset,r);return Y.metadata=Q,zL(Y,i,this._context.elevationProvider),Y}};function Uve(t,e,i){t&&t.forEach(r=>{const n=e(r);n!=null&&i(n,r.graphic)})}function pRt(t,e){if(e.verticalPlacement==="baseline"){const r=MAt[e.horizontalPlacement],n=t!=null?t.baselineAnchorY:0;return Ji(r,n)}const i=PAt(e.horizontalPlacement,e.verticalPlacement);return nk[i]}const fRt={mode:"relative-to-ground",offset:0},mRt={"calm-small":{waveStrength:.005,perturbationStrength:.02,textureRepeat:12,waveVelocity:.01},"rippled-small":{waveStrength:.02,perturbationStrength:.09,textureRepeat:32,waveVelocity:.07},"slight-small":{waveStrength:.05,perturbationStrength:.07,textureRepeat:28,waveVelocity:.1},"moderate-small":{waveStrength:.075,perturbationStrength:.07,textureRepeat:24,waveVelocity:.1},"calm-medium":{waveStrength:.003125,perturbationStrength:.01,textureRepeat:8,waveVelocity:.02},"rippled-medium":{waveStrength:.035,perturbationStrength:.015,textureRepeat:12,waveVelocity:.07},"slight-medium":{waveStrength:.06,perturbationStrength:.015,textureRepeat:8,waveVelocity:.12},"moderate-medium":{waveStrength:.09,perturbationStrength:.03,textureRepeat:4,waveVelocity:.12},"calm-large":{waveStrength:.01,perturbationStrength:0,textureRepeat:4,waveVelocity:.05},"rippled-large":{waveStrength:.025,perturbationStrength:.01,textureRepeat:8,waveVelocity:.11},"slight-large":{waveStrength:.06,perturbationStrength:.02,textureRepeat:3,waveVelocity:.13},"moderate-large":{waveStrength:.14,perturbationStrength:.03,textureRepeat:2,waveVelocity:.15}},gRt=["polyline","polygon","extent"];let Mie=class Q3 extends p1{constructor(e,i,r,n){super(e,i,r,n)}async doLoad(){}destroy(){super.destroy(),this._context.stage.remove(this._materials[0]),this._materials.length=0}createGraphics3DGraphic(e){const i=e.graphic;if(!this._validateGeometry(i.geometry,gRt,this.symbolLayer.type))return null;const r=this.setGraphicElevationContext(i);return this.ensureDrapedStatus(r.mode==="on-the-ground"),this.ensureMaterial(),this.draped?this._createAsOverlay(i):this._createAs3DShape(i,r,i.uid)}ensureMaterial(){if(this._materials[0])return;const e=new BNe,i=this.symbolLayer.color;i!=null&&(e.color=qe.toUnitRGBA(i));const r=this._getCombinedOpacity(i,{hasIntrinsicColor:!0});e.color=[e.color[0],e.color[1],e.color[2],r],e.transparent=r<1||this.needsDrivenTransparentPass,e.waveDirection=this.symbolLayer.waveDirection!=null?Q3.headingVectorFromAngle(this.symbolLayer.waveDirection):Ji(0,0);const n=this.symbolLayer.waveStrength+"-"+this.symbolLayer.waterbodySize,s=mRt[n];e.waveStrength=s.waveStrength,e.waveTextureRepeat=s.textureRepeat,e.waveVelocity=s.waveVelocity,e.flowStrength=s.perturbationStrength,e.hasSlicePlane=this._context.slicePlaneEnabled,e.isDraped=this.draped,this._materials[0]=new VNe(e),this._context.stage.add(this._materials[0])}layerOpacityChanged(){if(this._materials[0]==null)return;const e=this._materials[0].parameters.color,i=this._getCombinedOpacity(this.symbolLayer.color,{hasIntrinsicColor:!0}),r=i<1||this.needsDrivenTransparentPass;this._materials[0].setParameters({color:[e[0],e[1],e[2],i],transparent:r})}layerElevationInfoChanged(e,i,r){const n=this._elevationContext.mode,s=i6(Q3.elevationModeChangeTypes,r,n);if(s!==Ys.UPDATE)return s;const o=t0(n);return this.updateGraphics3DGraphicElevationInfo(e,i,()=>o)}slicePlaneEnabledChanged(){var e;return(e=this._materials[0])==null||e.setParameters({hasSlicePlane:this._context.slicePlaneEnabled}),!0}physicalBasedRenderingChanged(){return!0}_createAs3DShape(e,i,r){var x;const n=VL(e.geometry);if(n==null)return null;const s=ice(n,this._context.elevationProvider,this._context.renderCoordsHelper,i),o=s.position.length/3,l=Ja(2*o);this._createUVCoordsFromVertices(l,s.mapPositions,o,this._context.elevationProvider.spatialReference);const c=new yRt(s,l,this._context.layer.uid,e.uid);if(c.objectAndLayerIdColor=(x=this._context.stage.renderView)==null?void 0:x.getObjectAndLayerIdColor(c),this._create3DShapeGeometries(c),this._logGeometryCreationWarnings(c.renderData,n.rings,"rings","WaterSymbol3DLayer"),c.outGeometries.length===0)return null;const f=new X_({geometries:c.outGeometries,castShadow:!1,layerUid:this._context.layer.uid,graphicUid:r}),_=new d1(this,f,c.outGeometries,null,null,M6e,i);return _.alignedSampledElevation=c.renderData.sampledElevation,_.needsElevationUpdates=t0(i.mode),_}_createUVCoordsFromVertices(e,i,r,n){const s=ws(n);od(Ab);for(let c=0;cthis._createAs3DShape(e.graphic,e.elevationContext,e.graphicUid),ensureMaterial:()=>this.ensureMaterial()}}};Mie.unitSizeOfTexture=100,Mie.elevationModeChangeTypes={definedChanged:Ys.RECREATE,staysOnTheGround:Ys.NONE,onTheGroundChanged:Ys.RECREATE};const e8=yt(),Ab=Ni(),Vve=yt(),Wx=ya();let yRt=class extends pG{constructor(e,i,r,n){super(e,r,n),this.uvCoords=i}},vRt=class extends pG{constructor(e,i,r,n){super(e,r,n),this.uvCoords=i}};function _Rt(t,e,i,r){var s;const n=((s=wRt[t.type])==null?void 0:s[e.type])||bRt[e.type];return n?new n(t,e,i,r):(Ce.getLogger("esri.views.3d.layers.graphics.Graphics3DSymbolLayerFactory").error("GraphicsLayerFactory#make",`unknown symbol type ${e.type}`),null)}const bRt={icon:_ie,object:E5t,line:b8e,path:CPt,fill:P7e,extrude:$Ct,text:dRt,water:Mie},wRt={"mesh-3d":{fill:eOt}};let xRt=class extends Ile{set symbol(e){this._symbol=e,e.symbolLayers.forEach((i,r)=>{const n=this.symbolLayers[r];n!=null&&(n.symbol=e,n.symbolLayer=i)})}get symbol(){return this._symbol}constructor(e,i,r){super(i.schedule),this._symbol=e,this._context=i,this._backgroundLayers=r,this._destroyed=!1,this.symbolLayers=new Array,this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));const r=i.length;for(;this.symbolLayers.length{this.symbolLayers[s]=null,l.destroy()});c&&n.push(c),this.symbolLayers[s]=l}if(await JV(this.symbolLayers,async(s,o)=>{if(s!=null)try{await s.load(),this._extentPadding+=Math.max(this._extentPadding,s.extentPadding)}catch{this.symbolLayers[o]=null}}),n.forEach(s=>s.remove()),St(e),this.symbolLayers.length&&!this.symbolLayers.some(s=>!!s))throw new Error}getSymbolLayerSize(e){const i=this.symbolLayers[e];return i!=null?i.getCachedSize():null}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e==null?void 0:e.queryForSnapping)}createGraphics3DGraphic(e,i){var o,l;const r=e.graphic,n=this.symbolLayers.map(c=>(c==null?void 0:c.createGraphics3DGraphic(e))??null),s=this._context.arcade||((l=(o=this._context.featureExpressionInfoContext)==null?void 0:o.arcade)==null?void 0:l.modules)||null;return new QSt(r,i||this,n,e.layer,s)}get complexity(){return Rle(this.symbolLayers.map(e=>e!=null?e.complexity:null))}globalPropertyChanged(e,i){const r=this.symbolLayers.length;for(let n=0;n{const c=l.layers[n];return c instanceof d1?c:null};if(s!=null&&!s.globalPropertyChanged(e,i,o))return!1}return!0}applyRendererDiff(e,i){return this.loadStatus!==ep.LOADED?To.RecreateSymbol:this.symbolLayers.reduce((r,n)=>r!==To.RecreateSymbol&&n!=null?Math.min(r,n.applyRendererDiff(e,i)):r,To.FastUpdate)}prepareSymbolPatch(e){if(this.loadStatus===ep.FAILED||e.diff.type!=="partial")return;const i=e.diff.diff;if(!i.symbolLayers||i.symbolLayers.type!=="partial")return;const r=i.symbolLayers.diff;this.symbolLayers.forEach((n,s)=>{if(n==null)return;const o=r[s];if(o){const l={diff:o,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};n.prepareSymbolLayerPatch(l),e.symbolStatePatches.push(...l.symbolLayerStatePatches),l.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((c,f)=>{const _=c.layers[s];_!=null&&l.graphics3DGraphicPatches.forEach(x=>x(_,f))})}})}updateGeometry(e,i){return this._updateGeometryOrTransform(e,(r,n)=>r.updateGeometry(n,i))}updateTransform(e,i,r,n){return this._updateGeometryOrTransform(e,(s,o)=>s.updateTransform(o,i,r,n))}_updateGeometryOrTransform(e,i){for(let r=0;r{n!=null&&(n.loadStatus===ep.LOADING?e++:n.isFastUpdatesEnabled()?r++:i++)}),{loading:e,slow:i,fast:r}}async queryForSnapping(e,i,r,n){const s=this.symbolLayers.filter(ys).filter(l=>l.queryForSnapping!=null).map(l=>l.queryForSnapping(e,i,r,n)),o=await Promise.all(s);return St(n),o.flat()}destroy(){if(this.destroyed)console.error("Graphics3DSymbol.destroy called when already destroyed!");else{super.destroy();for(const e of this.symbolLayers)e!=null&&e.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}};const t8=new eTt;let SRt=class extends Ile{constructor(e,i,r){super(i),this.symbol=e,this._convert=r,this.symbologySnappingSupported=!1,this.graphics3DSymbol=null,this.referenced=0}getSymbolLayerSize(e){return this.graphics3DSymbol!=null?this.graphics3DSymbol.getSymbolLayerSize(e):null}get symbolLayers(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.symbolLayers:[]}get extentPadding(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.extentPadding:0}async doLoad(e){const i=await this.symbol.fetchSymbol({signal:e});i.id=this.symbol.id,this.graphics3DSymbol=this._convert(i),this.graphics3DSymbol!=null&&await this.graphics3DSymbol.load()}createGraphics3DGraphic(e){return this.graphics3DSymbol!=null?this.graphics3DSymbol.createGraphics3DGraphic(e,this):null}get complexity(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.complexity:yDe}globalPropertyChanged(e,i){return this.graphics3DSymbol!=null&&this.graphics3DSymbol.globalPropertyChanged(e,i)}applyRendererDiff(e,i){return this.graphics3DSymbol!=null?this.graphics3DSymbol.applyRendererDiff(e,i):To.RecreateSymbol}prepareSymbolPatch(e){this.graphics3DSymbol!=null&&this.graphics3DSymbol.prepareSymbolPatch(e)}updateGeometry(e,i){return this.graphics3DSymbol!=null&&this.graphics3DSymbol.updateGeometry(e,i)}updateTransform(e,i,r,n){var s;return((s=this.graphics3DSymbol)==null?void 0:s.updateTransform(e,i,r,n))??!1}onRemoveGraphic(){}getFastUpdateStatus(){return this.graphics3DSymbol!=null?this.graphics3DSymbol.getFastUpdateStatus():{loading:1,fast:0,slow:0}}destroy(){this.graphics3DSymbol!=null&&this.graphics3DSymbol.destroy(),this.graphics3DSymbol=void 0,super.destroy()}get destroyed(){return this.graphics3DSymbol===void 0}};function gce(t){return t instanceof SRt?t.graphics3DSymbol:t instanceof xRt?t:null}const YL=Ce.getLogger("esri.views.3d.layers.graphics.labelPlacement");let TRt=class{constructor(e,i,r,n=null){this.graphics3DGraphic=e,this.labelSymbol=i,this.labelClass=r,this.disablePlacement=n}};function Bve(t){const e=$Rt(t);if(e==null)return null;const i=ERt(t,e);if(i==null)return null;const r=i.anchor,n=!!e.hasLabelVerticalOffset,s=e.verticalOffset;return ARt(new I7e(s,r,n),i,t)}function ERt(t,e){if(e.anchor)return e;const i=t.labelClass.labelPlacement,r=bm[i],n=r||nV(t);return i&&!r&&YL.warnOncePerTick(`the requested label placement '${i}' is currently unsupported in SceneView.`),CRt(n,t)}function yce(t){const e=t.graphics3DGraphic.graphics3DSymbol,i=gce(e);return i!=null?i.symbol.symbolLayers.at(0):null}function CRt(t,e){const i=e.graphics3DGraphic.graphic.geometry;if(i==null)return null;if(e.disablePlacement!=null)return e.labelClass.labelPlacement?(YL.warnOncePerTick(jve(t==null?void 0:t.placement,e.disablePlacement.logEntityDescription)),nV(e)):t;const r=i.type;switch(r){case"polyline":case"polygon":case"extent":case"multipoint":if(e.labelClass.labelPlacement)return YL.warnOncePerTick(jve(t==null?void 0:t.placement,`'${r}' geometries`)),nV(e);break;case"point":case"mesh":return t}return t}function jve(t,e){return`the requested label placement '${t}' is currently unsupported for ${e} in SceneView.`}function nV(t){const e=t.graphics3DGraphic.graphic.geometry;if(e==null)return null;switch(e.type){case"polyline":case"extent":case"multipoint":return{placement:"center-center",normalizedOffset:Ka,anchor:"center"};case"polygon":{const i=yce(t);return i!=null&&i.type==="extrude"?bm["above-center"]:{placement:"center-center",normalizedOffset:Ka,anchor:"center"}}case"point":case"mesh":return bm["above-center"];default:return}}function ARt(t,e,i){const r=i.graphics3DGraphic.graphic.geometry;if(r==null)return null;switch(r.type){case"point":ORt(t,e,i);break;case"polygon":MRt(t,e,i);break;case"mesh":vce(t,e,i.graphics3DGraphic.layers[0])}const n=xAt-QU;return t.screenOffset[0]+=n*e.normalizedOffset[0],t.screenOffset[1]+=n*e.normalizedOffset[1],t}function MRt(t,e,i){const r=yce(i);if(r!=null)switch(r.type){case"extrude":{const n=i.graphics3DGraphic.layers[0];n!=null?(n.getBoundingBoxObjectSpace(D$),gm(D$,t.translation),t.translation[2]=sx(D$)/2):Ie(t.translation,0,0,0),vce(t,e,n);break}}}function ORt(t,e,i){const r=yce(i);if(r==null)return;const n=i.graphics3DGraphic.layers[0];switch(n!=null?n.getCenterObjectSpace(t.translation):Ie(t.translation,0,0,0),r.type){case"icon":case"text":PRt(t,e,i,n);break;case"object":vce(t,e,n)}}function PRt(t,e,i,r){const{graphics3DGraphic:n}=i,s=r!=null?r.getScreenSize():null;if(n.isDraped||s==null)t.hasLabelVerticalOffset||t.anchor==="center"||(bm[i.labelClass.labelPlacement]&&YL.warnOncePerTick(`the requested placement '${e.placement}' is currently unsupported for draped graphics`),t.anchor="center");else{const o=RRt(i);t.screenOffset[0]=s[0]/2*(e.normalizedOffset[0]-o[0]);const l=s[1]/2*(e.normalizedOffset[1]-o[1]);t.hasLabelVerticalOffset?(t.centerOffset[1]=l,t.centerOffsetUnits="screen"):t.screenOffset[1]=l}}function RRt(t,e=LRt){const{graphics3DGraphic:i}=t,r=i.layers[0],n=(r==null?void 0:r.stageObject.geometries[0].material)??null;if(n&&n instanceof O5){const s=n.parameters.anchorPosition;e[0]=2*(s[0]-.5),e[1]=2*(s[1]-.5)}else e[0]=0,e[1]=0;return e}function vce(t,e,i){const r=i!=null?i.getBoundingBoxObjectSpace(D$):D$,n=nt(r[3]-r[0],r[4]-r[1],r[5]-r[2]),s=Math.sqrt(n[0]*n[0]+n[1]*n[1]);t.centerOffset[0]=s/2*e.normalizedOffset[0];const o=t.translation[2],l=n[2]/2*e.normalizedOffset[1];t.translation[2]=0,t.elevationOffset=o+l;const c=rt(n);t.centerOffset[2]=c/2*e.normalizedOffset[2]}function IRt(t){return t==="above-center"}function $Rt(t){const e=t.labelClass.labelPlacement,{labelSymbol:i,graphics3DGraphic:r}=t,n=gce(r.graphics3DSymbol),s=(n==null?void 0:n.symbol.type)==="point-3d"?n.symbol:null,o=bm[e]||nV(t);return s!=null&&s.supportsCallout()&&s.hasVisibleVerticalOffset()&&!r.isDraped?{placement:null,hasLabelVerticalOffset:!1,verticalOffset:Gve(s.verticalOffset),anchor:null,normalizedOffset:null}:!i||!i.hasVisibleVerticalOffset()||s!=null&&s.supportsCallout()&&s.verticalOffset&&!r.isDraped?{placement:null,verticalOffset:null,anchor:null,normalizedOffset:null,hasLabelVerticalOffset:!1}:o&&IRt(o.placement)?{placement:"above-center",verticalOffset:Gve(i.verticalOffset),anchor:"bottom",normalizedOffset:[0,o.normalizedOffset[1],0],hasLabelVerticalOffset:!0}:(YL.errorOncePerTick("Callouts and vertical offset on labels are currently only supported with 'above-center' label placement (not with "+e+" placement)"),null)}function Gve(t){const{screenLength:e,minWorldLength:i,maxWorldLength:r}=t;return{screenLength:e,minWorldLength:i,maxWorldLength:r}}const bm={"above-center":{placement:"above-center",normalizedOffset:[0,1,0],anchor:"bottom"},"above-left":{placement:"above-left",normalizedOffset:[-1,1,0],anchor:"bottom-right"},"above-right":{placement:"above-right",normalizedOffset:[1,1,0],anchor:"bottom-left"},"below-center":{placement:"below-center",normalizedOffset:[0,-1,2],anchor:"top"},"below-left":{placement:"below-left",normalizedOffset:[-1,-1,0],anchor:"top-right"},"below-right":{placement:"below-right",normalizedOffset:[1,-1,0],anchor:"top-left"},"center-center":{placement:"center-center",normalizedOffset:[0,0,1],anchor:"center"},"center-left":{placement:"center-left",normalizedOffset:[-1,0,0],anchor:"right"},"center-right":{placement:"center-right",normalizedOffset:[1,0,0],anchor:"left"}},Hve={"above-center":["default","esriServerPointLabelPlacementAboveCenter"],"above-left":["esriServerPointLabelPlacementAboveLeft"],"above-right":["esriServerPointLabelPlacementAboveRight"],"below-center":["esriServerPointLabelPlacementBelowCenter"],"below-left":["esriServerPointLabelPlacementBelowLeft"],"below-right":["esriServerPointLabelPlacementBelowRight"],"center-center":["esriServerPointLabelPlacementCenterCenter"],"center-left":["esriServerPointLabelPlacementCenterLeft"],"center-right":["esriServerPointLabelPlacementCenterRight"]};for(const t in Hve){const e=Hve[t],i=bm[t];e.forEach(r=>{bm[r]=i})}Object.freeze&&(Object.freeze(bm),Object.keys(bm).forEach(t=>{var e;Object.freeze(bm[t]),Object.freeze((e=bm[t])==null?void 0:e.normalizedOffset)}));const LRt=[0,0],D$=ya();let qve=class{constructor(e){this._stage=e,this._materials=new Map}get(e){return this._materials.get(e)}add(e,i){this._materials.set(e,i),this._stage.add(i)}dispose(){this._stage.removeMany(Array.from(this._materials.values())),this._materials.clear()}},Wve=class{constructor(e,i){this.labelingContext=e,this.graphics3DGraphic=i,this.hasGraphics3DResources=!1,this.visible=!1,this.addedToTextureAtlas=!1,this.textInitialized=!1,this.textRenderers=new Array,this.textLabelPlacements=new Array}},DRt=class{constructor(e,i,r,n,s){this.labelClass=e,this.graphics3DSymbol=i,this.graphics3DCalloutSymbolLayer=r,this.textRenderParameters=n,this.labelFunction=s,this.calloutSymbolLayerIndex=0}},NRt=class{constructor(e,i,r,n,s,o,l,c){this.layer=i,this.graphics3DCore=r,this.scaleVisibility=n,this.emptySymbolLabelSupported=s,this.elevationInfoOverride=o,this.disablePlacement=l,this.active=c,this.labelClassAbortController=new AbortController,this.labelClassContexts=new Array,this.graphics=new Map,this.labelsToInitialize=new Map,this.stageLayer=new uNe(e,{pickable:!0,disableOctree:!0},i.uid)}destroy(){this.stageLayer.destroy()}},eS=class extends ze{constructor(e){super(e),this._dirty=!1,this._labels=new Map,this._labelingContexts=new Array}setup(){this.dispose(),this.addHandles([_e(()=>{var e;return(e=this.view.state)==null?void 0:e.camera},()=>this.setDirty()),_e(()=>{var e;return(e=this.view.state)==null?void 0:e.rasterPixelRatio},()=>this._resetAllLabels()),this.view.resourceController.scheduler.registerTask(ni.LABELER,this)]),this._textTextureAtlas=new iT({view:this.view}),this._hudMaterialCollection=new qve(this.view._stage),this._calloutMaterialCollection=new qve(this.view._stage)}dispose(){this.removeAllHandles(),this._textTextureAtlas=Kt(this._textTextureAtlas),this._hudMaterialCollection=Kt(this._hudMaterialCollection),this._calloutMaterialCollection=Kt(this._calloutMaterialCollection),this._labelingContexts.length=0,this._labels.clear()}destroy(){this.dispose(),v0.graphic=null,v0.renderingInfo=null,v0.layer=null}_activateLabelingContext(e){e.graphics.forEach((i,r)=>{const n=new Wve(e,i);this._labels.set(r,n),e.labelsToInitialize.set(r,n),i.setVisibilityFlag(Ya.LABEL,Hl.USER,!0)}),e.active=!0}_deactivateLabelingContext(e){e.graphics.forEach((i,r)=>{i.setVisibilityFlag(Ya.LABEL,Hl.USER,!1),this.setLabelGraphicVisibility(i,!1),this._labels.delete(r)}),e.active=!1}_addLabelTextureToAtlas(e){for(const i of e.graphics3DGraphic.labelLayers){if(!i._labelClass)continue;const r=e.textRenderers[i._labelIndex];r&&(this._textTextureAtlas.addTextTexture(r,i.stageObject),e.addedToTextureAtlas=!0)}}_removeLabelTextureFromAtlas(e){for(const i of e.graphics3DGraphic.labelLayers){if(!i._labelClass)continue;const r=e.textRenderers[i._labelIndex];r!=null&&(this._textTextureAtlas.removeTextTexture(r,i.stageObject),e.addedToTextureAtlas=!1)}}get running(){return this.view.ready&&(this._dirty||this.deconflictor.running)}runTask(e){return this._updateLabels(e),!this._dirty&&this.deconflictor.running&&this.deconflictor.runTask(e),Xl.YIELD}_updateLabels(e){if(this._dirty){this._dirty=!1;for(const i of this._labelingContexts)if(i.active)if(cY(i))this._dirty=!0;else if(uY(i.labelClassContexts)){if(i.labelClassContexts===null){this._deactivateLabelingContext(i);continue}this._createLabelClassContext(i),this._dirty=!0}else rp(i.labelsToInitialize,(r,n)=>(this._ensureGraphics3DResources(r)&&(this._labels.set(n,r),this.deconflictor.setDirty(),e.madeProgress()),(r.visible&&r.textInitialized||!r.visible&&r.hasGraphics3DResources)&&(i.labelsToInitialize.delete(n),e.madeProgress()),e.done))&&(this._dirty=!0);this._dirty||this.notifyChange("updating")}}async _createLabelClassContextAsync(e){var o,l;const i=(o=e.labelClassAbortController)==null?void 0:o.signal;e.layer.when&&await e.layer.when(),St(i),e.scaleVisibility&&e.scaleVisibility.updateScaleRangeActive();const r=e.graphics3DCore,n=r.layer,s=(l=n.labelingInfo)==null?void 0:l.filter(c=>!!c.symbol);!s||s.length===0||(await JV(s,async(c,f)=>{const _=c.symbol,x=gce(r.getOrCreateGraphics3DSymbol(_));if(x==null)return void Ce.getLogger(this).error("Failed to create Graphics3DSymbol for label");await x.load(),St(i);let T=null;Vse(_)&&_.hasVisibleCallout()&&(T=_St(_,r.symbolCreationContext),await T.load(),St(i));const A=await Ju(T6e(c,e.layer.fieldsIndex,this.view.spatialReference));if(St(i),A.ok===!0){const M=await this._createTextRenderParameters(x.symbol);St(i),e.labelClassContexts[f]=new DRt(c,x,T,M,A.value)}else Ce.getLogger(this).error(`Label expression failed to evaluate: ${A.error}`)}),St(i))}async _createLabelClassContext(e){return e.labelClassPromise==null&&(e.labelClassPromise=this._createLabelClassContextAsync(e).catch(i=>{if(sn(i))throw i;e.labelClassContexts.length=0}).then(()=>{e.labelClassAbortController=null,this.notifyChange("updating")}).catch(()=>{}),this.notifyChange("updating")),e.labelClassPromise}async _createTextRenderParameters(e){const i=e.symbolLayers.at(0);return(i==null?void 0:i.type)!=="text"?null:D7e.fromSymbol(i,this.view.state.rasterPixelRatio)}_destroyLabelClassContext(e){for(const r of e.labelClassContexts)--r.graphics3DSymbol.referenced;const i=e.labelClassAbortController;e.labelClassAbortController=new AbortController,gn(i),e.labelClassContexts.length=0,e.labelClassPromise=null,this.notifyChange("updating")}_createTextSymbolGraphic(e,i,r,n,s,o){const l=new $7e(r,Y1e(r.anchor),OAt(r.anchor),e.text,Ji(e.displayWidth,e.displayHeight));return v0.graphic=i,v0.renderingInfo=null,v0.layer=n,s.createLabel(v0,l,this._hudMaterialCollection,this._textTextureAtlas,()=>{const c=Bve(o);return c?c.elevationOffset:null})}_createLineCalloutGraphic(e,i,r,n,s){v0.graphic=e,v0.layer=s;const o=n.screenOffset[0];return v0.renderingInfo=new ySt(null,i,n.translation,n.centerOffset,o,n.centerOffsetUnits,n.elevationOffset,this._calloutMaterialCollection),r.createGraphics3DGraphic(v0)}_ensureGraphics3DResources(e){var f;if(e.hasGraphics3DResources)return!1;const i=e.graphics3DGraphic;if(i.destroyed)return!1;this._ensureTextTextureResources(e);const r=e.labelingContext,n=r.labelClassContexts;if(uY(n)||!r.emptySymbolLabelSupported&&i.layers.length===0)return!1;let s=!1;const o=i.graphic,l=r.layer,c=i8(r.layer);for(let _=0;_n.set(o.graphic.uid,o));const s=o=>o.labelLayers[0];if(r.graphics3DSymbol.symbolLayers[0].globalPropertyChanged(e,n,s),r.graphics3DCalloutSymbolLayer){const o=l=>l.labelLayers[r.calloutSymbolLayerIndex];r.graphics3DCalloutSymbolLayer.globalPropertyChanged(e,n,o)}}}_visibilityInfoChange(e){const i=i8(e.layer);i&&!e.active&&this._activateLabelingContext(e),!i&&e.active&&this._deactivateLabelingContext(e),this.setDirty()}_resetAllLabels(){for(const e of this._labelingContexts)this._resetLabels(e)}_resetLabels(e){e.graphics.forEach((i,r)=>{const n=this._labels.get(r);n&&(this._destroyGraphic(n,r),n.visible=!1,e.labelsToInitialize.set(r,n))}),this._destroyLabelClassContext(e),this.setDirty(),this.deconflictor.setDirty()}_findLabelingContext(e){for(const i of this._labelingContexts)if(i.graphics3DCore===e)return i;return null}addGraphicsOwner(e,i,r){const n=r&&r.emptySymbolLabelSupported||!1,s=(r==null?void 0:r.elevationInfoOverride)||null,o=(r==null?void 0:r.disablePlacement)||null;if(this._findLabelingContext(e))return;const l=e.layer,c=new NRt(this.view._stage,l,e,i,n,s,o,i8(l));return this._labelingContexts.push(c),this.setDirty(),{addGraphic:f=>this._addGraphic(c,f),removeGraphic:f=>this._removeGraphic(c,f),featureReductionChange:()=>{},layerLabelsEnabled:()=>i8(c.layer),labelingInfoChange:f=>this._labelingInfoChange(c,f),elevationInfoChange:()=>this._globalPropertyChanged("elevationInfo",c),slicePlaneEnabledChange:()=>this._globalPropertyChanged("slicePlaneEnabled",c),visibilityInfoChange:()=>this._visibilityInfoChange(c),reset:()=>this._resetLabels(c),clear:()=>{}}}removeGraphicsOwner(e){const i=this._findLabelingContext(e);if(!i)return;const r=this._labelingContexts.indexOf(i);this._labelingContexts.splice(r,1),i.graphics.forEach(n=>this._removeGraphic(i,n)),i.destroy(),this.setDirty()}setLabelGraphicVisibility(e,i){const r=e.graphic.uid,n=this._labels.get(r);n&&n.visible!==i&&(i&&!n.addedToTextureAtlas?(this._addLabelTextureToAtlas(n),n.textInitialized||n.labelingContext.labelsToInitialize.set(r,n)):!i&&n.addedToTextureAtlas&&this._removeLabelTextureFromAtlas(n),n.visible=i,this.setDirty())}setDirty(){!this._dirty&&this._labelingContexts.length>0&&(this._dirty=!0,this.notifyChange("updating"))}get updating(){var e;return this._dirty||((e=this._textTextureAtlas)==null?void 0:e.updating)||this.deconflictor.updating||this._labelingContexts.some(i=>cY(i))}get updatingProgress(){if(!this.updating||!this._textTextureAtlas)return 1;const e=this._labelingContexts.length>0?this._labelingContexts.reduce((i,r)=>i+(cY(r)?0:1),0)/this._labelingContexts.length:1;return(this._dirty?0:.3)+(this._textTextureAtlas.updating?0:.1)+.1*e+.5*this.deconflictor.updatingProgress}get test(){return{textTextureAtlas:this._textTextureAtlas,resetAllLabels:()=>this._resetAllLabels()}}};function cY(t){return!!t.labelClassPromise&&!!t.labelClassAbortController}function uY(t){return!t||t.length===0}function i8(t){var e;return t.labelsVisible===!0&&!!((e=t.labelingInfo)!=null&&e.some(i=>!!i.symbol))}y([w({constructOnly:!0})],eS.prototype,"view",void 0),y([w({constructOnly:!0})],eS.prototype,"deconflictor",void 0),y([w()],eS.prototype,"_textTextureAtlas",void 0),y([w({type:Boolean,readOnly:!0})],eS.prototype,"updating",null),eS=y([Z("esri.views.3d.layers.graphics.Labeler")],eS);const v0=new vSt(null,null,null);let gI=class XA{constructor(e,i,r,n=null){this.lij=[0,0,0],this.extent=Ni(),this.resolution=0,this.loadPriority=0,this.measures={visibility:fc.VISIBLE_ON_SURFACE,screenRect:Ni(),distance:0,shouldSplit:!1},this.used=!1,n&&this.acquire(e,i,r,n)}acquire(e,i,r,n){this.tilingScheme=n,this.id=XA.id(e,i,r),this.lij[0]=e,this.lij[1]=i,this.lij[2]=r,n.getExtent(e,i,r,this.extent),this.resolution=n.resolutionAtLevel(e)}release(){this.tilingScheme=null}getChildren(e){const i=this.lij[0]+1,r=2*this.lij[1],n=2*this.lij[2];return e?(e[0].acquire(i,r,n,this.tilingScheme),e[1].acquire(i,r+1,n,this.tilingScheme),e[2].acquire(i,r,n+1,this.tilingScheme),e[3].acquire(i,r+1,n+1,this.tilingScheme),e):[new XA(i,r,n,this.tilingScheme),new XA(i,r+1,n,this.tilingScheme),new XA(i,r,n+1,this.tilingScheme),new XA(i,r+1,n+1,this.tilingScheme)]}copyMeasurementsFrom(e){this.measures.visibility=e.measures.visibility,this.measures.shouldSplit=e.measures.shouldSplit,this.measures.distance=e.measures.distance,d_(e.measures.screenRect,this.measures.screenRect)}static id(e,i,r){return`${e}/${i}/${r}`}};var fc;(function(t){t[t.INVISIBLE=0]="INVISIBLE",t[t.VISIBLE_WHEN_EXTENDED=1]="VISIBLE_WHEN_EXTENDED",t[t.VISIBLE_ON_SURFACE=2]="VISIBLE_ON_SURFACE"})(fc||(fc={}));const F7e=.5*Math.PI,FRt=F7e/Math.PI*180;let kRt=class{constructor(e){this._renderCoordsHelper=e.renderCoordsHelper,this._extent=new Array(4),this._planes=new Array(6),this._maxSpan=0,this._center={origin:W(),direction:W()};for(let i=0;i<4;i++)this._extent[i]={origin:W(),direction:W(),cap:{next:null,direction:W()}},this._planes[i]=Fi();this._planes[Rn.NEAR]=Fi(),this._planes[Rn.FAR]=Fi(),this._planesWithoutFar=this._planes.slice(0,5)}update(e,i,r,n=!0){const s=this._extent;this._toRenderBoundingExtent(e,i,r),Be(this._center.origin,s[0].origin,s[2].origin),De(this._center.origin,this._center.origin,.5),this._renderCoordsHelper.worldUpAtPosition(this._center.origin,this._center.direction),n||De(this._center.direction,this._center.direction,-1);for(let o=0;o<4;o++){const l=s[o];this._renderCoordsHelper.worldUpAtPosition(l.origin,l.direction);const c=s[o===3?0:o+1];l.cap.next=c.origin,R_(l.cap.direction,l.origin,c.origin),xL(l.direction,l.cap.direction,l.origin,this._planes[o]),n||De(l.direction,l.direction,-1)}xL(s[0].cap.direction,s[1].cap.direction,s[0].origin,this._planes[Rn.NEAR]),n?SQ(this._planes[Rn.NEAR],this._planes[Rn.FAR]):(uj(this._planes[Rn.FAR],this._planes[Rn.NEAR]),SQ(this._planes[Rn.NEAR],this._planes[Rn.NEAR])),this._maxSpan=Math.max(Math.abs(e[0]-e[2]),Math.abs(e[1]-e[3])),this._maxSpanSpatialReference=i,this._minGlobalAltitude=.9*Sr(this._maxSpanSpatialReference).radius}isVisibleInFrustum(e,i,r=!1){if(e==null)return!1;if(this._renderCoordsHelper.viewingMode===_t.Global){const s=this._maxSpanSpatialReference.isGeographic?FRt:F7e*i;if(this._maxSpan>s)return!0;if(e.altitude!=null&&e.altitude>=this._minGlobalAltitude)return this._isVisibleInFrustumGlobal(e)}if(this._maxSpan===0){const s=this._extent[0];return!(r||!e.intersectsRay(Sp(s.origin,s.direction)))}for(let s=0;si,this._frustum.update(e),this._shortenFrustumFarPlane(this._frustum),this._updateExtendedFrustum(e)}end(){this._cache.clear()}calculate(e){if(this._allTilesInvisible)return fc.INVISIBLE;const i=this._renderCoordsHelper.viewingMode===_t.Global&&e.lij[0]>=BRt&&e.lij[0](Math.PI+e.fovY)/2,this._allTilesInvisible||(this._hasExtendedFrustum=r>e.fovY/2,!this._hasExtendedFrustum))return;const n=this._extendedFrustumParameters(),s=this._extendedFrustum.mutablePoints;for(let o=0;o<4;o++){const l=n.pointIndices[o],c=s[l],f=this._renderCoordsHelper.getAltitude(c);if(n.needsAltitudeAdjustment(f)){switch(this._renderCoordsHelper.worldUpAtPosition(c,Td),l){case Gt.FAR_BOTTOM_LEFT:case Gt.FAR_TOP_LEFT:case Gt.NEAR_BOTTOM_LEFT:case Gt.NEAR_TOP_LEFT:TQ(this._extendedFrustum.planes[Rn.LEFT],Td,Td);break;case Gt.FAR_BOTTOM_RIGHT:case Gt.FAR_TOP_RIGHT:case Gt.NEAR_BOTTOM_RIGHT:case Gt.NEAR_TOP_RIGHT:TQ(this._extendedFrustum.planes[Rn.RIGHT],Td,Td)}De(Td,Td,n.direction),this._renderCoordsHelper.intersectInfiniteManifold(Sp(c,Td),n.zWithMargin,c)}}if(this._extendedFrustum.updatePoints(s),jl(s[Gt.NEAR_BOTTOM_LEFT],s[Gt.NEAR_BOTTOM_RIGHT],s[Gt.NEAR_TOP_RIGHT],Zve),jl(s[Gt.NEAR_BOTTOM_RIGHT],s[Gt.NEAR_TOP_RIGHT],s[Gt.NEAR_TOP_LEFT],Jve),Ve(Zve,Jve)<0){const o=this._extendedFrustum.mutablePoints;this._aboveGround?[o[Gt.NEAR_BOTTOM_LEFT],o[Gt.NEAR_BOTTOM_RIGHT]]=[o[Gt.NEAR_BOTTOM_RIGHT],o[Gt.NEAR_BOTTOM_LEFT]]:[o[Gt.NEAR_TOP_LEFT],o[Gt.NEAR_TOP_RIGHT]]=[o[Gt.NEAR_TOP_RIGHT],o[Gt.NEAR_TOP_LEFT]],this._extendedFrustum.updatePoints(o)}}_extendedFrustumParameters(){return this._aboveGround?this._extendedFrustumParametersAboveSurface():this._extendedFrustumParametersBelowSurface()}_extendedFrustumParametersAboveSurface(){const e=this._surfaceElevation-Xve;return{zWithMargin:e,pointIndices:qw.planePointIndices.bottom,direction:-1,needsAltitudeAdjustment:i=>i>e}}_extendedFrustumParametersBelowSurface(){const e=this._surfaceElevation+Xve;return{zWithMargin:e,pointIndices:qw.planePointIndices.top,direction:1,needsAltitudeAdjustment:i=>i{t.length!==4&&(t[0]=new gI,t[1]=new gI,t[2]=new gI,t[3]=new gI)},t=>{t[0].release(),t[1].release(),t[2].release(),t[3].release()});let qRt=class{constructor(e){this._camera=new ai,this._focusOnMap=[0,0],this._screenRect=Ni(),this._tileSize=e.tileSize,this._renderCoordsHelper=e.renderCoordsHelper,this._tilingScheme=e.tilingScheme,this._visibility=new VRt(e.renderCoordsHelper)}begin(e,i,r){this._camera.copyFrom(e),this._surfaceElevation=r,this._focusOnMap[0]=i.x,this._focusOnMap[1]=i.y,ose(0,0,e.fullWidth,e.fullHeight,this._screenRect),this._visibility.begin(this._camera,r)}end(){this._visibility.end()}updateTile(e){e.measures.visibility=this._visibility.calculate(e),e.measures.distance=Eet(e.extent,this._focusOnMap),e.measures.visibility!==fc.INVISIBLE&&this._updateScreenMeasure(e)}_updateScreenMeasure(e){const i=WRt,r=1<_)return void(e.measures.shouldSplit=!0);e.measures.shouldSplit=!1}_tileSizeWithBias(e){return e.measures.visibility===fc.VISIBLE_WHEN_EXTENDED?this._tileSize*YRt:this._tileSize}_computeScreenArea(e,i,r,n,s){const o=e.measures.visibility===fc.VISIBLE_WHEN_EXTENDED;this._projectToScreen(i,r,n,o,Mb),od(dY);for(let l=0;l<4;l++)nO(dY,Mb[l]);return g2(s,dY,s),Zme(Mb[0],Mb[1],Mb[2])+Zme(Mb[0],Mb[2],Mb[3])}_projectToScreen(e,i,r,n,s){this._tilingScheme.ensureMaxLod(e),this._tilingScheme.getExtent(e,i,r,CR),this._toRenderCoords(CR,0,3,Ob[0]),this._toRenderCoords(CR,2,3,Ob[1]),this._toRenderCoords(CR,2,1,Ob[2]),this._toRenderCoords(CR,0,1,Ob[3]),n&&(this._projectToPlane(Ob,this._camera.frustum[Rn.NEAR]),this._projectToPlane(Ob,this._camera.frustum[Rn.TOP]),this._projectToPlane(Ob,this._camera.frustum[Rn.BOTTOM]));for(let o=0;o<4;o++)this._camera.projectToRenderScreen(Ob[o],Qve),this._camera.renderToScreen(Qve,s[o])}_projectToPlane(e,i){for(let n=0;n<4;n++)MR[n]=fn(i,e[n]);const r=Math.max(MR[0],MR[1],MR[2],MR[3]);if(r>0){const n=De(AR,i,-r);for(let s=0;s<4;s++)Be(e[s],e[s],n)}}_toRenderCoords(e,i,r,n){return AR[0]=e[i],AR[1]=e[r],AR[2]=this._surfaceElevation,this._renderCoordsHelper.toRenderCoords(AR,this._tilingScheme.spatialReference,n),n}};const dY=Ni(),WRt=2,YRt=5,Mb=[ss(),ss(),ss(),ss()],CR=Ni(),AR=W(),Ob=[W(),W(),W(),W()],MR=[0,0,0,0],Qve=Za();function Qui(t,e,i){if(t==null||i==null)return!1;let r=!0;return oa[0]=t.xmin!=null?t.xmin:0,oa[1]=t.ymin!=null?t.ymin:0,oa[2]=t.zmin!=null?t.zmin:0,r=r&&vn(oa,t.spatialReference,0,e,i,0,1),oa[0]=t.xmax!=null?t.xmax:0,oa[1]=t.ymax!=null?t.ymax:0,oa[2]=t.zmax!=null?t.zmax:0,r=r&&vn(oa,t.spatialReference,0,e,i,3,1),t.xmin==null&&(e[0]=-1/0),t.ymin==null&&(e[1]=-1/0),t.zmin==null&&(e[2]=-1/0),t.xmax==null&&(e[3]=1/0),t.ymax==null&&(e[4]=1/0),t.zmax==null&&(e[5]=1/0),r}function k7e(t,e,i){if(t==null||i==null)return!1;let r=!0;return oa[0]=t.xmin!=null?t.xmin:0,oa[1]=t.ymin!=null?t.ymin:0,oa[2]=t.zmin!=null?t.zmin:0,r=r&&vn(oa,t.spatialReference,0,oa,i,0,1),e[0]=oa[0],e[1]=oa[1],oa[0]=t.xmax!=null?t.xmax:0,oa[1]=t.ymax!=null?t.ymax:0,oa[2]=t.zmax!=null?t.zmax:0,r=r&&vn(oa,t.spatialReference,0,oa,i,0,1),e[2]=oa[0],e[3]=oa[1],t.xmin==null&&(e[0]=-1/0),t.ymin==null&&(e[1]=-1/0),t.xmax==null&&(e[2]=1/0),t.ymax==null&&(e[3]=1/0),r}const oa=W();let _l=class extends ze{get tilingScheme(){const e=this.tilingSchemeOwner.tilingScheme;return e?e.clone():null}set filterExtent(e){if(e!=null&&!e.spatialReference.equals(this.viewState.spatialReference))return void Ce.getLogger(this).error("#extent","extent spatial reference needs to be in the same spatial reference as the view");const i=this._get("filterExtent");if(i===e||i!=null&&e&&i.equals(e))return;const r=e!=null?e.clone():null;this._set("filterExtent",r),this._setDirty()}get _filterExtentRect(){if(this.filterExtent==null)return null;const e=Ni();return k7e(this.filterExtent,e,this.tilingScheme.spatialReference),e}get _rootTileIds(){const{tilingScheme:e}=this;return this._filterExtentRect&&e?e.rootTilesInExtent(this._filterExtentRect):[[0,0,0]]}set suspended(e){e!==this._get("suspended")&&(this._set("suspended",e),this._setDirty())}get updating(){return this._dirty||!!this._pendingTiles}constructor(e){super(e),this.tiles=new it,this.tileSize=512,this._idToTile=new Map,this._clients=new Set,this._dirty=!1,this._pendingTiles=null,this._newTiles=new Pi}initialize(){this.addHandles([_e(()=>[this.tilingScheme,this.tileSize],()=>this._reset(),Li),_e(()=>{var e,i,r;return[this.tileSize,(e=this.cameraOnSurface)==null?void 0:e.location,this.tilingScheme,(i=this.viewState)==null?void 0:i.contentCamera,(r=this.focus)==null?void 0:r.location]},()=>this._setDirty(),kt)]),this.scheduler&&(this._frameWorker=this.scheduler.registerTask(ni.FEATURE_TILE_TREE,this))}destroy(){this._frameWorker=en(this._frameWorker)}addClient(){const e=hp();return this._clients.add(e),this._clients.size===1&&this._setDirty(),rr(()=>this._removeClient(e))}_removeClient(e){this._clients.delete(e),this._hasClients||this._clear()}get _hasClients(){return this._clients.size>0}_setDirty(){!this._hasClients||this.suspended||this._dirty||(this._frameWorker?(this._dirty=!0,this.notifyChange("updating")):this.runTask(ou))}_clear(){this.tiles.removeAll(),this._idToTile.clear(),this._reset(),this._dirty=!1,this.notifyChange("updating")}get running(){return this.updating}runTask(e){this._dirty=!1,this._pendingTiles||(this._startUpdate(),this._frameWorker!=null&&(this._frameWorker.priority=ni.FEATURE_TILE_TREE_ACTIVE)),this._subdivideTilesForView(e),this._pendingTiles||this._frameWorker==null||(this._frameWorker.priority=ni.FEATURE_TILE_TREE),this.notifyChange("updating")}_startUpdate(){if(this.suspended)return;if(!this.tilingScheme)return void this._clear();this._tileMeasurements||(this._tileMeasurements=new qRt({renderCoordsHelper:this.renderCoordsHelper,tilingScheme:this.tilingScheme,tileSize:this.tileSize}));const e=this.viewState.contentCamera;this._tileMeasurements.begin(e,this.focus.location,this.cameraOnSurface.location.z??0),this._pendingTiles=this._getRootTiles()}_reset(){this._newTiles.clear(),this._tileMeasurements=null,this._pendingTiles=null,this._setDirty()}_getRootTiles(){const{tilingScheme:e}=this;return this._rootTileIds.map(i=>new gI(i[0],i[1],i[2],e))}_purgeHorizonTiles(e){e.sort((i,r)=>{const n=i.measures.screenRect,s=r.measures.screenRect;return n[1]+n[3]-(s[1]+s[3])}),od(r8);for(let i=0;iXRt)return e.data.slice(i,e.length);return[]}_subdivideTilesForView(e){if(!this._pendingTiles)return;const{tilingScheme:i}=this;for(;this._pendingTiles.length>0&&!e.done;){const r=this._pendingTiles.pop();e.madeProgress(),this._filterExtentRect&&!P9(this._filterExtentRect,r.extent)||(this._tileMeasurements.updateTile(r),r.measures.visibility!==fc.INVISIBLE&&(r.measures.shouldSplit?(i.ensureMaxLod(r.lij[0]+1),this._pendingTiles.push(...r.getChildren())):this._newTiles.push(r)))}this._pendingTiles.length===0&&(this._updateTiles(this._purgeHorizonTiles(this._newTiles)),this._newTiles.clear(),this._tileMeasurements.end(),this._pendingTiles=null)}_updateTiles(e){for(const n of this.tiles.items)n.used=!1;const i=e.filter(n=>{const s=this._idToTile.get(n.id);return s?(s.copyMeasurementsFrom(n),s.used=!0):this._idToTile.set(n.id,n),!s}),r=this.tiles.items.filter(n=>!n.used&&(this._idToTile.delete(n.id),!0));this.tiles.removeMany(r),this.tiles.addMany(i),this._sortTiles()}_sortTiles(){this.viewState.fixedContentCamera||this.tiles.sort((e,i)=>e.measures.visibility!==i.measures.visibility?e.measures.visibility===fc.VISIBLE_ON_SURFACE?-1:1:e.measures.distance-i.measures.distance),this.tiles.forEach((e,i)=>e.loadPriority=i)}};y([w({constructOnly:!0})],_l.prototype,"scheduler",void 0),y([w({constructOnly:!0})],_l.prototype,"renderCoordsHelper",void 0),y([w({constructOnly:!0})],_l.prototype,"tilingSchemeOwner",void 0),y([w({constructOnly:!0})],_l.prototype,"cameraOnSurface",void 0),y([w({constructOnly:!0})],_l.prototype,"focus",void 0),y([w({constructOnly:!0})],_l.prototype,"viewState",void 0),y([w({constructOnly:!0})],_l.prototype,"terrain",void 0),y([w()],_l.prototype,"tiles",void 0),y([w()],_l.prototype,"tileSize",void 0),y([w({readOnly:!0})],_l.prototype,"tilingScheme",null),y([w()],_l.prototype,"filterExtent",null),y([w({readOnly:!0})],_l.prototype,"_filterExtentRect",null),y([w({readOnly:!0})],_l.prototype,"_rootTileIds",null),y([w({value:!1})],_l.prototype,"suspended",null),y([w({readOnly:!0})],_l.prototype,"updating",null),_l=y([Z("esri.views.3d.layers.support.FeatureTileTree3D")],_l);const r8=Ni(),XRt=10;let Fs=class extends ze{constructor(){super(...arguments),this._propertiesPool=new x_({camera:ai},this),this._lastSeenCameraProjectionValues=new ai,this.mode=Vr.ANIMATING,this._cssCamera=new ai,this._camera=new ai,this.rasterPixelRatio=1,this.contentPixelRatio=1,this.events=new Dn,this.viewingMode=_t.Global,this._cameraChanged=!1,this._updateQueue=new Array,this._processingUpdates=!1}init(e,i){this._set("viewingMode",e),this._set("spatialReference",i),this._set("constraints",new ev({mode:this.viewingMode}))}exit(){this.cameraController=null,this._propertiesPool.destroy(),this._propertiesPool=new x_({camera:ai},this)}destroy(){var e;this.cameraController=null,(e=this._propertiesPool)==null||e.destroy(),this._propertiesPool=null}createInitialCamera(){if(this.viewingMode===_t.Global){const e=Sr(this.spatialReference).radius;this.camera=new ai({eye:nt(4*e,0,0),center:nt(e,0,0),up:nt(0,0,1)})}else this.camera=new ai({eye:nt(0,0,100),center:nt(0,0,0),up:nt(0,1,0)})}get animation(){return this.cameraController instanceof $L&&this.cameraController.viewAnimation!=null?this.cameraController.viewAnimation:null}get camera(){return this._camera}get cssCamera(){const e=this._cssCamera.copyFrom(this.camera),{height:i,width:r,pixelRatio:n}=this.camera;return e.pixelRatio=1,e.height=Math.round(i/n),e.width=Math.round(r/n),e}set camera(e){e!==kp&&kp.copyFrom(e),kp.computeUp(this.viewingMode),this.events.emit("before-camera-change",kp);const i=this._camera;if(this._cameraProjectionChanged(this._lastSeenCameraProjectionValues,kp)&&(this._lastSeenCameraProjectionValues.copyFrom(kp),this.events.emit("camera-projection-changed",this._lastSeenCameraProjectionValues)),!i.equals(kp)&&(this._camera=this._propertiesPool.get("camera").copyFrom(kp),this._cameraChanged=!i.almostEquals(kp),this._cameraChanged)){const r=TSe(()=>{this._cameraChanged=!1,r.remove()})}}get pixelRatio(){return this.camera.pixelRatio}get alignPixelEnabled(){return this.pixelRatio===this.rasterPixelRatio&&this.mode===Vr.IDLE}get updating(){return this.mode!==Vr.IDLE}get contentCamera(){return this._contentCamera??this.camera}set contentCamera(e){this._contentCamera=e!=null?e.clone():null}get fixedContentCamera(){return this._contentCamera!=null}get isGlobal(){return this.viewingMode===_t.Global}get isLocal(){return this.viewingMode===_t.Local}get navigating(){return!(!this.cameraController||!this.cameraController.isInteractive)}get stationary(){return!this._cameraChanged&&!this.navigating}get cameraController(){return this._get("cameraController")}set cameraController(e){var i;this.stopActiveCameraController()?((i=this.cameraController)==null||i.destroy(),e&&(this.removeHandles(e_e),this.addHandles(Mo(()=>e.state===Cs.Finished||e.state===Cs.Stopped,()=>{this._set("cameraController",null),this.updateCamera(r=>e.onControllerEnd(r))},{sync:!0,once:!0}),e_e),e.onControllerStart(this.camera)),this._set("cameraController",e)):e&&(e.state=Cs.Rejected)}switchCameraController(e){return this.cameraController=e,e.state!==Cs.Rejected}stopActiveCameraController(){return!(this.cameraController&&!this.cameraController.stopController())}updateCamera(e){this._updateQueue.push(e),this._processUpdateQueue()}_processUpdateQueue(){if(this._updateQueue.length===0||this._processingUpdates)return;this._processingUpdates=!0;const e=this._updateQueue.shift();kp.copyFrom(this._get("camera")),e(kp),this.camera=kp,this._processingUpdates=!1,this._processUpdateQueue()}_cameraProjectionChanged(e,i){return e.fov!==i.fov||e.fullViewport[0]!==i.fullViewport[0]||e.fullViewport[1]!==i.fullViewport[1]||e.fullViewport[2]!==i.fullViewport[2]||e.fullViewport[3]!==i.fullViewport[3]||e.padding[er.TOP]!==i.padding[er.TOP]||e.padding[er.RIGHT]!==i.padding[er.RIGHT]||e.padding[er.BOTTOM]!==i.padding[er.BOTTOM]||e.padding[er.LEFT]!==i.padding[er.LEFT]}};y([w()],Fs.prototype,"mode",void 0),y([w({readOnly:!0,type:b5})],Fs.prototype,"animation",null),y([w({type:ai})],Fs.prototype,"camera",null),y([w({type:ai})],Fs.prototype,"cssCamera",null),y([w()],Fs.prototype,"_cssCamera",void 0),y([w()],Fs.prototype,"_camera",void 0),y([w({readOnly:!0})],Fs.prototype,"pixelRatio",null),y([w()],Fs.prototype,"rasterPixelRatio",void 0),y([w()],Fs.prototype,"contentPixelRatio",void 0),y([w({readOnly:!0})],Fs.prototype,"alignPixelEnabled",null),y([w({readOnly:!0})],Fs.prototype,"updating",null),y([w({})],Fs.prototype,"_contentCamera",void 0),y([w({type:ai})],Fs.prototype,"contentCamera",null),y([w({readOnly:!0})],Fs.prototype,"fixedContentCamera",null),y([w({readOnly:!0})],Fs.prototype,"constraints",void 0),y([w({readOnly:!0})],Fs.prototype,"events",void 0),y([w({readOnly:!0})],Fs.prototype,"isGlobal",null),y([w({readOnly:!0})],Fs.prototype,"isLocal",null),y([w({readOnly:!0})],Fs.prototype,"viewingMode",void 0),y([w({readOnly:!0})],Fs.prototype,"spatialReference",void 0),y([w()],Fs.prototype,"navigating",null),y([w()],Fs.prototype,"stationary",null),y([w()],Fs.prototype,"_cameraChanged",void 0),y([w()],Fs.prototype,"cameraController",null),Fs=y([Z("esri.views.3d.state.ViewState")],Fs);const ZRt=Fs,kp=new ai,e_e="ViewStateHandles";let JRt=class{constructor(e,i,r){this.viewingMode=e,this._forEachLayer=i,this._view=r,this._externalIntersectionHandlers=new Pi,this._tolerance=v5,this._tmpRay=Ko(),this._tmpRegion=Ni(),this._validateHUDIntersector=Tp(this.viewingMode),this._validateHUDIntersector.options.hud=!1}intersectScreen(e,i,r){return this.intersectRay(this._getPickRay(e,this._tmpRay),t_e(this.viewingMode),i,r)}intersectScreenFreePointFallback(e,i,r){return this.intersectRayFreePointFallback(this._getPickRay(e,this._tmpRay),i,r)}intersectRayFreePointFallback(e,i,r){return this.intersectRay(e,t_e(this.viewingMode),i,r)||this._intersectRayFreePointLocal(e,i)}intersectRay(e,i,r,n){return i.options.selectionMode=!1,i.options.store=tl.MIN,this.computeIntersection(e,i,n),!!i.results.min&&i.results.min.getIntersectionPoint(r)}getCenterRayWithSubpixelOffset(e,i,r=.5,n=.5){return e.getRenderCenter(o8,r,n),o8[0]+=.0466,o8[1]-=.0123,tle(e,o8,i)}intersectIntersectorScreen(e,i,r){this.computeIntersection(this._getPickRay(e,this._tmpRay),i,r)}intersectToolIntersectorScreen(e,i,r){const n=this._getPickRay(e,this._tmpRay);this.intersectToolIntersectorRay(n,i,r)}intersectToolIntersectorRay(e,i,r){i.options.selectionMode=!0,this.computeIntersection(e,i,r);const n=i.results.min;this._view.basemapTerrain&&this._view.basemapTerrain.opaque||Gm(n)&&n.intersector!==ms.TERRAIN||(i.options.selectionMode=!1,this.computeIntersection(e,i,r))}setTolerance(e=v5){this._tolerance=e}addIntersectionHandler(e){this._externalIntersectionHandlers.push(e),this._externalIntersectionHandlers.sort((i,r)=>i.type===ms.TERRAIN?1:r.type===ms.TERRAIN?-1:0)}removeIntersectionHandler(e){this._externalIntersectionHandlers.removeUnordered(e)!=null&&this._externalIntersectionHandlers.sort((i,r)=>i.type===ms.TERRAIN?1:r.type===ms.TERRAIN?-1:0)}_getPickRay(e,i){const r=this._view.state.camera;return ele(r,e,i)}_intersectRayFreePointLocal(e,i){return this.viewingMode!==_t.Local||e==null||Be(i,e.origin,Ye(xt.get(),e.direction)),!1}intersectElevationFromScreen(e,i,r=0,n=null){return this._intersectElevation(this._getPickRay(e,this._tmpRay),i,r,n)}_intersectElevation(e,i,r=0,n=null){if(e==null)return null;const s=i!=null?i.mode:"absolute-height",o=(i==null?void 0:i.offset)??0,l=s!=="on-the-ground"?o+r:0,c=l/this._view.renderCoordsHelper.unitInMeters;if(s==="absolute-height"){if(this._view.renderCoordsHelper.intersectInfiniteManifold(e,l,s8)){const z=this._view.computeMapPointFromVec3d(s8);return z.z??(z.z=0),z.z-=o,z}return null}const f=this._view.state.camera,_=xt.get();f.projectToRenderScreen(e.origin,_);const x=new i_e(null,this._forEachLayer),T=this._view.slicePlane,A=T!=null?U0e(T):null,M=Tp(this.viewingMode);M.options.store=tl.MIN,M.options.verticalOffset=c;const I=e.origin,L=Be(xt.get(),I,e.direction);M.reset(I,L,f),M.point=_;const F=n?"type"in n&&n.type==="graphics"?z=>z.layerUid!==n.uid:z=>z.graphicUid!==n.uid:null;switch(s){case"relative-to-scene":{const z=k=>(!F||F(k))&&!!k.lastValidElevationBB;M.intersect(x.layers,_,this._tolerance,null,z),this._externalIntersectionHandlers.forAll(k=>{if(k.type===ms.I3S||k.type===ms.TERRAIN){const U=k.slicePlaneEnabled?A:null;k.intersect(M,U,M.rayBegin,M.rayEnd,_)}});break}case"on-the-ground":case"relative-to-ground":this._externalIntersectionHandlers.forAll(z=>{if(z.isGround){const k=z.slicePlaneEnabled?A:null;z.intersect(M,k,M.rayBegin,M.rayEnd,_)}})}if(M.results.min.getIntersectionPoint(s8)){const z=this._view.computeMapPointFromVec3d(s8);return z.z=r,z}return null}computeIntersection(e,i,r){var M;if(e==null)return;const n=this._view.state.camera,s=xt.get();n.projectToRenderScreen(e.origin,s);const o=new i_e(r,this._forEachLayer);i.options.selectOpaqueTerrainOnly=!r||!("include"in r||"exclude"in r);const l=e.origin,c=Be(xt.get(),e.origin,e.direction);i.reset(l,c,n),i.intersect(o.layers,s,this._tolerance);const f=this._view.slicePlane,_=f!=null?U0e(f):null;i.intersect(o.sliceableLayers,s,this._tolerance,_);const x=r&&(r.requiresGroundFeedback||r.enableDraped);this._externalIntersectionHandlers.forAll(I=>{const L=I.layerUid,F=Array.isArray(L),z=F?L:[L];F&&(i.options.filteredLayerUids=[]);let k=!1;for(const U of z)o.filterLayerUid(U)?k=!0:F&&i.options.filteredLayerUids.push(U);if(i.options.isFiltered=!k,I.isGround&&x||!i.options.isFiltered){const U=I.slicePlaneEnabled?_:null;I.intersect(i,U,l,c,s)}});const T=xt.get(),A=this._view.basemapTerrain;if(r&&r.enableDraped&&A.spatialReference!=null&&i.results.ground.getIntersectionPoint(T)){const I=A.overlayManager.renderer,L=this._view.renderCoordsHelper.spatialReference,F=xt.get();this._view.renderCoordsHelper.fromRenderCoords(T,F,A.spatialReference),F[2]=((M=this._view.elevationProvider)==null?void 0:M.getElevation(T[0],T[1],T[2],L,"ground"))??0,I.intersect(i,F,i.results.ground,z=>o.filterRenderGeometry(z))}i.sortResults(),this._processHUDResults(i)}_processHUDResults(e){const i=e.results.hud;d_(this._tmpRegion,XZ);const r=this._view.state.camera,n=[],s=this._tmpRegion,o=F=>{const z=new QRt(F);r.projectToRenderScreen(F.target.center,z.screenPoint),z.screenPoint[0]=Math.floor(z.screenPoint[0]),z.screenPoint[1]=Math.floor(z.screenPoint[1]),n.push(z),nO(s,z.screenPoint)};e.sortResults(i.all),i.min.dist!=null&&o(i.min);for(const F of i.all)i.min.target.object!==F.target.object&&i.max.target.object!==F.target.object&&o(F);if(i.max.dist!=null&&i.max.target.object!==i.min.target.object&&o(i.max),!n.length)return;s[0]===s[2]&&(s[2]+=1),s[1]===s[3]&&(s[3]+=1);const l=r.fullWidth,c=r.fullHeight,f=Math.max(0,s[0]-yI),_=Math.max(0,s[1]-yI),x=Math.min(_c(s)+2*yI,l-f),T=Math.min(qu(s)+2*yI,c-_),A=new Uint8Array(x*T*4);this._view._stage.renderer.readHUDVisibility(f,_,x,T,A);let M=!0;const I=e.results.max.dist==null;let L=0;for(const F of n)for(const z of KRt)if(A[4*(Math.min(F.screenPoint[0]+z[0],l)-s[0]+(Math.min(F.screenPoint[1]+z[1],c)-s[1])*x)]){M&&(e.results.min.copy(F.result),M=!1),I&&e.results.max.copy(F.result),e.options.store===tl.ALL&&e.results.all.splice(L++,0,F.result);break}}};const yI=1,KRt=(()=>{const t=[],e=yI;for(let i=-e;i<=e;i++)for(let r=-e;r<=e;r++)t.push([r+e,i+e]);return t})();let QRt=class{constructor(e){this.result=e,this.screenPoint=Za()}},n8;function t_e(t){return n8&&n8.viewingMode===t||(n8=Tp(t)),n8}let i_e=class{constructor(e,i){this.layers=new Array,this.sliceableLayers=new Array,this.include=e==null?void 0:e.include,this.exclude=e==null?void 0:e.exclude,i(r=>{r.pickable&&this.filterLayerUid(r.apiLayerUid)&&(r.sliceable?this.sliceableLayers:this.layers).push(r)})}filterLayerUid(e){const{include:i,exclude:r}=this;return e==null?i==null&&r==null:(i==null||i.has(e))&&(r==null||!r.has(e))}filterRenderGeometry(e){return this.filterLayerUid(e.layerUid)}};function r_e(t){return typeof t=="object"&&"intersect"in t}const s8=W(),o8=Za();let shi=class{constructor(e,i){this.spatialReference=e,this._view=i}getElevation(e,i,r){return this._view.elevationProvider.getElevation(e,i,0,this.spatialReference,r)}async queryElevation(e,i,r,n,s){return this._view.elevationProvider.queryElevation(e,i,0,this.spatialReference,s,r,n)}},e4t=class{constructor(e,i,r,n){this.spatialReference=i,this._getElevationQueryProvider=r,this._queries=new Array,this._queryOptions={...n,ignoreInvisibleLayers:!0},this._frameTask=e.registerTask(ni.ELEVATION_QUERY,this)}destroy({completeTasks:e}={completeTasks:!1}){if(this._frameTask.remove(),this.running)if(e)this.runTask(ou);else for(const i of this._queries)i.result.reject(ur())}queryElevation(e,i,r,n=0){const s=Jl(),o={x:e,y:i,minDemResolution:n,result:s,signal:r};return this._queries.push(o),Yl(r,()=>{Gre(this._queries,o),s.reject(ur())}),s.promise}get running(){return this._queries.length>0}runTask(e){const i=this._queries;this._queries=[];const r=this._getElevationQueryProvider();if(!r)return i.forEach(_=>_.result.reject()),void e.madeProgress();const n=i.map(_=>[_.x,_.y]),s=i.reduce((_,x)=>Math.min(_,x.minDemResolution),1/0),o=new Cm({points:n,spatialReference:this.spatialReference}),l=i.length>1&&i.some(_=>!!_.signal)?new AbortController:null,c=l!=null?l.signal:i[0].signal;if(l!=null){let _=0;i.forEach(x=>Yl(x.signal,()=>{_++,x.result.reject(ur()),_===i.length&&l.abort()}))}const f={...this._queryOptions,minDemResolution:s,signal:c};r.queryElevation(o,f).then(_=>{i.forEach((x,T)=>{x.signal!=null&&x.signal.aborted?x.result.reject(ur()):x.result.resolve(_.geometry.points[T][2])})}).catch(_=>{i.forEach(x=>x.result.reject(_))}),e.madeProgress()}get test(){const e=this;return{update:()=>e._queries.length>0&&e.runTask(ou)}}},vI=class extends Dn.EventedMixin(ze){get spatialReference(){var e,i;return(i=(e=this.view)==null?void 0:e.basemapTerrain)==null?void 0:i.spatialReference}constructor(e){super(e),this._im=new Array,this._ground=new Array,this._scene=new Array,this.lastElevationQuery=null,this.elevationCacheEnabled=!1}destroy(){this._elevationQueryCached=et(this._elevationQueryCached)}enableElevationCache(e){e||(this.lastElevationQuery=null),this.elevationCacheEnabled=e}getElevation(e,i,r,n,s){if(this.elevationCacheEnabled&&this.lastElevationQuery!=null){const l=this.lastElevationQuery;if(e===l.x&&i===l.y&&r===l.z&&Zn(n,l.spatialReference)&&s===l.queryContext)return l.result}let o=null;return o=a8(o,this._im,e,i,r,n,s),o==null&&(o=a8(o,this._ground,e,i,r,n,s)),s==="scene"&&(o=a8(o,this._scene,e,i,r,n,s)),this.elevationCacheEnabled&&(this.lastElevationQuery={x:e,y:i,z:r,spatialReference:n,queryContext:s,result:o}),o}getSphereElevationBounds(e,i){let r=1/0,n=-1/0;for(const s of[this._im,this._ground,this._scene])s.forEach(o=>{if(o.getSphereElevationBounds){const l=o.getSphereElevationBounds(e,i);l!=null&&(r=Math.min(r,l.min),n=Math.max(n,l.max))}});return{min:r,max:n}}getRootElevationBounds(){let e=1/0,i=-1/0;for(const r of[this._im,this._ground,this._scene])r.forEach(n=>{if(n.getRootElevationBounds){const s=n.getRootElevationBounds();s!=null&&(e=Math.min(e,s.min),i=Math.max(i,s.max))}});return{min:e,max:i}}async queryElevation(e,i,r,n,s,o=null,l=0){const c=this._getElevationQuery(n);try{const f=await c.queryElevation(e,i,o,l);return s==="scene"?a8(f,this._scene,e,i,r,n,s):f}catch(f){return zo(f),this.getElevation(e,i,r,n,s)}}register(e,i){this.addHandles(i.on("elevation-change",r=>this.emit("elevation-change",r)),i),this._providersFromContext(e).push(i)}unregister(e){this.removeHandles(e);for(const i of[this._im,this._ground,this._scene]){const r=i.indexOf(e);r>-1&&i.splice(r,1)}}_providersFromContext(e){switch(e){case"ground":return this._ground;case"im":return this._im;case"scene":return this._scene}}_getElevationQuery(e=this.view.spatialReference){const i=this._elevationQueryCached;if(i!=null&&Zn(e,i.spatialReference))return i;i==null||i.destroy({completeTasks:!0});const{wkid:r,wkt:n,wkt2:s,latestWkid:o}=e,l=new e4t(this.view.resourceController.scheduler,new at({wkid:r,wkt:n,wkt2:s,latestWkid:o}),()=>{var c;return(c=this.view.map)==null?void 0:c.ground},{maximumAutoTileRequests:4});return this._elevationQueryCached=l,l}};function a8(t,e,i,r,n,s,o){for(const l of e){const c=l.getElevation(i,r,n,s,o);c!=null&&(t=t!=null?Math.max(c,t):c)}return t}y([w({constructOnly:!0})],vI.prototype,"view",void 0),y([w()],vI.prototype,"spatialReference",null),vI=y([Z("esri.views.3d.support.CombinedElevationProvider")],vI);let XL=class Oie{static isValidProfile(e){return e in Oie.profiles}static getDefaultProfile(){return Le("esri-iPhone")?"low":"medium"}static apply(e,i){const r=Oie.profiles[e];i.graphics3D.maxTotalNumberOfFeatures=r.graphics3D.maxTotalNumberOfFeatures,i.graphics3D.maxNumberOfDrawCalls=r.graphics3D.maxNumberOfDrawCalls,i.graphics3D.maxTotalNumberOfVertices=r.graphics3D.maxTotalNumberOfVertices,i.graphics3D.polygonLodFactor=r.graphics3D.polygonLodFactor,i.graphics3D.polylineLodFactor=r.graphics3D.polylineLodFactor,i.graphics3D.snapshotAvailable=r.graphics3D.snapshotAvailable,i.graphics3D.skipHighSymbolLods=r.graphics3D.skipHighSymbolLods,i.graphics3D.uncompressedTextureDownsamplingEnabled=r.graphics3D.uncompressedTextureDownsamplingEnabled;const n=i.sceneService.object,s=r.sceneService.object;n.lodFactor=s.lodFactor,n.lodCrossfadeinDuration=s.lodCrossfadeinDuration,n.lodCrossfadeoutDuration=s.lodCrossfadeoutDuration,n.lodCrossfadeUncoveredDuration=s.lodCrossfadeUncoveredDuration,i.sceneService.point.lodFactor=r.sceneService.point.lodFactor,i.sceneService.integratedMesh.lodFactor=r.sceneService.integratedMesh.lodFactor,i.sceneService.pointCloud.lodFactor=r.sceneService.pointCloud.lodFactor,i.sceneService.uncompressedTextureDownsamplingEnabled=r.sceneService.uncompressedTextureDownsamplingEnabled,i.tiledSurface.lodBias=r.tiledSurface.lodBias,i.tiledSurface.angledSplitBias=r.tiledSurface.angledSplitBias,i.tiledSurface.vtlContentZoom=r.tiledSurface.vtlContentZoom,i.tiledSurface.reduceTileLevelDifferences=r.tiledSurface.reduceTileLevelDifferences,i.tiledSurface.textureFadeDuration=r.tiledSurface.textureFadeDuration,i.heatmap.pixelRatio=r.heatmap.pixelRatio,i.heatmap.maxTotalNumberOfFeatures=r.heatmap.maxTotalNumberOfFeatures,i.fadeDuration=r.fadeDuration,i.antialiasingEnabled=r.antialiasingEnabled,i.physicallyBasedRenderingEnabled=r.physicalBasedRenderingEnabled,i.highQualityTransparency=r.highQualityTransparency,i.highResolutionAtmosphere=r.highResolutionAtmosphere,i.reflections=r.reflections,i.ambientOcclusion=r.ambientOcclusion,i.memoryLimit=r.memoryLimit,i.additionalCacheMemory=r.additionalCacheMemory,i.frameRate=r.frameRate,i.maximumPixelRatio=r.maximumPixelRatio}};XL.test={reset(){const t=z7e();for(const e of Object.keys(t))XL.profiles[e]=t[e]}};const OR={IPhone12Pro:120,GalaxyS20:200,FullHD:240,SurfacePro7:300,FullHDRetina:430};function z7e(){const t=!!Le("esri-mobile"),e=!!Le("ios"),i=400;return{low:{graphics3D:{maxTotalNumberOfFeatures:25e3,maxNumberOfDrawCalls:8e3,maxTotalNumberOfVertices:255e4,polygonLodFactor:.5,polylineLodFactor:1,snapshotAvailable:!1,skipHighSymbolLods:!0,uncompressedTextureDownsamplingEnabled:!0},heatmap:{pixelRatio:.125,maxTotalNumberOfFeatures:25e3},sceneService:{object:{lodFactor:.2,lodCrossfadeinDuration:0,lodCrossfadeoutDuration:0,lodCrossfadeUncoveredDuration:0},point:{lodFactor:1},integratedMesh:{lodFactor:.6},pointCloud:{lodFactor:.5},uncompressedTextureDownsamplingEnabled:!0},tiledSurface:{lodBias:-1,angledSplitBias:.5,vtlContentZoom:.75,reduceTileLevelDifferences:!0,textureFadeDuration:0},fadeDuration:0,antialiasingEnabled:!1,physicalBasedRenderingEnabled:!1,highQualityTransparency:!1,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:200+OR.IPhone12Pro,additionalCacheMemory:0,frameRate:0,maximumPixelRatio:1},medium:{graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:625e4,polygonLodFactor:t?.8:1,polylineLodFactor:t?1.2:1.5,snapshotAvailable:!e,skipHighSymbolLods:!1,uncompressedTextureDownsamplingEnabled:t},heatmap:{pixelRatio:.25,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:0,lodCrossfadeoutDuration:0,lodCrossfadeUncoveredDuration:i},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:t},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,reduceTileLevelDifferences:!Le("disable-feature:reduce-map-tile-levels"),textureFadeDuration:i},fadeDuration:i,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!1,reflections:!1,ambientOcclusion:!1,memoryLimit:t?600+OR.GalaxyS20:750+OR.FullHD,additionalCacheMemory:t?-100:150,frameRate:0,maximumPixelRatio:1},high:{graphics3D:{maxTotalNumberOfFeatures:1e5,maxNumberOfDrawCalls:17e3,maxTotalNumberOfVertices:125e5,polygonLodFactor:t?1.2:2,polylineLodFactor:t?1.2:2,snapshotAvailable:!e,skipHighSymbolLods:!1,uncompressedTextureDownsamplingEnabled:!1},heatmap:{pixelRatio:.5,maxTotalNumberOfFeatures:5e4},sceneService:{object:{lodFactor:1,lodCrossfadeinDuration:0,lodCrossfadeoutDuration:0,lodCrossfadeUncoveredDuration:i},point:{lodFactor:1},integratedMesh:{lodFactor:1},pointCloud:{lodFactor:1},uncompressedTextureDownsamplingEnabled:!1},tiledSurface:{lodBias:0,angledSplitBias:1,vtlContentZoom:1.5,reduceTileLevelDifferences:!Le("disable-feature:reduce-map-tile-levels"),textureFadeDuration:i},fadeDuration:i,antialiasingEnabled:!0,physicalBasedRenderingEnabled:!0,highQualityTransparency:!0,highResolutionAtmosphere:!0,reflections:!0,ambientOcclusion:!0,memoryLimit:t?900+OR.SurfacePro7:1500+OR.FullHDRetina,additionalCacheMemory:t?-150:0,frameRate:0,maximumPixelRatio:t?1:1/0}}}(function(t){t.profiles=z7e()})(XL||(XL={}));const lk=XL,U7e=new qe([0,255,255]),V7e=1,B7e=.25,j7e=new qe([0,0,0]),G7e=.4,H7e=.2;let Dg=class extends ze{constructor(){super(...arguments),this.color=U7e.clone(),this.haloColor=null,this.haloOpacity=V7e,this.fillOpacity=B7e,this.shadowOpacity=G7e,this.shadowColor=j7e.clone(),this.shadowDifference=H7e}};y([w({type:qe})],Dg.prototype,"color",void 0),y([w({type:qe})],Dg.prototype,"haloColor",void 0),y([w()],Dg.prototype,"haloOpacity",void 0),y([w()],Dg.prototype,"fillOpacity",void 0),y([w()],Dg.prototype,"shadowOpacity",void 0),y([w({type:qe})],Dg.prototype,"shadowColor",void 0),y([w()],Dg.prototype,"shadowDifference",void 0),Dg=y([Z("esri.views.3d.support.HighlightOptions")],Dg);const q7e=Dg;function _G(t,e){return e?{...e,query:{...t??{},...e.query}}:{query:t}}function d6(t){return typeof t=="string"?qs(t):Re(t)}function bG(t,e,i){const r={};for(const n in t){if(n==="declaredClass")continue;const s=t[n];if(s!=null&&typeof s!="function")if(Array.isArray(s)){r[n]=[];for(let o=0;oe.toJSON())}}function W7e(t,e,i){const r=ket(e);return t.map(n=>{const s=r.fromJSON(n);return s.spatialReference=i,s})}let tS=class extends Ue{constructor(e){super(e),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const e=this.geometries.map(n=>n.toJSON()),i=this.geometries[0],r={};return r.outSR=Cz(this.outSpatialReference),r.inSR=Cz(i.spatialReference),r.geometries=JSON.stringify({geometryType:R9(i),geometries:e}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};y([w()],tS.prototype,"geometries",void 0),y([w({json:{read:{source:"outSR"}}})],tS.prototype,"outSpatialReference",void 0),y([w()],tS.prototype,"transformation",void 0),y([w()],tS.prototype,"transformForward",void 0),tS=y([Z("esri.rest.support.ProjectParameters")],tS);const wG=tS,i4t=$s(wG);async function _ce(t,e,i){e=i4t(e);const r=d6(t),n={...r.query,f:"json",...e.toJSON()},s=e.outSpatialReference,o=R9(e.geometries[0]),l=_G(n,i);return bi(r.path+"/project",l).then(({data:{geometries:c}})=>W7e(c,o,s))}async function bce(t=null,e){var n,s;if(Ar.geometryServiceUrl)return Ar.geometryServiceUrl;if(!t)throw new se("internal:geometry-service-url-not-configured");let i;i="portal"in t?t.portal||os.getDefault():t,await i.load({signal:e});const r=(s=(n=i.helperServices)==null?void 0:n.geometry)==null?void 0:s.url;if(!r)throw new se("internal:geometry-service-url-not-configured");return r}async function r4t(t,e,i=null,r){const n=await bce(i,r),s=new wG;s.geometries=[t],s.outSpatialReference=e;const o=await _ce(n,s,{signal:r});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new se("internal:geometry-service-projection-failed")}const n4t=Object.freeze(Object.defineProperty({__proto__:null,getGeometryServiceURL:bce,projectGeometry:r4t},Symbol.toStringTag,{value:"Module"}));let s4t=class{constructor(e,i){this.spatialReference=i,this.unitInMeters=ws(this.spatialReference,Sr(this.spatialReference).metersPerDegree);const r=e&&"portalItem"in e?e.portalItem:void 0;this._geometryServiceURLPromise=bce(r).catch(()=>{throw new se("mapcoordshelper:missing-geometry-service","Must specify geometryService in esri/config")})}async toGeographic(e){const i=await this._geometryServiceURLPromise;let r,n=!0;Array.isArray(e[0])&&typeof e[0]!="number"?r=e:(r=[e],n=!1);const s=r.map(c=>c instanceof mt?c:new mt(c,this.spatialReference)),o=new wG({geometries:s,outSpatialReference:at.WGS84}),l=(await _ce(i,o)).map(c=>c.type==="point"?[c.x,c.y]:void 0).filter(c=>!!c);return n?l:l[0]}},Gd=class extends ze{constructor(){super(...arguments),this.minTotalNumberOfFeatures=2e3,this.maxTotalNumberOfFeatures=5e4,this.maxNumberOfDrawCalls=17e3,this.maxTotalNumberOfVertices=17e5,this.snapshotAvailable=!0,this.polygonLodFactor=1,this.polylineLodFactor=1,this.skipHighSymbolLods=!1,this.uncompressedTextureDownsamplingEnabled=!1}};y([w()],Gd.prototype,"minTotalNumberOfFeatures",void 0),y([w()],Gd.prototype,"maxTotalNumberOfFeatures",void 0),y([w()],Gd.prototype,"maxNumberOfDrawCalls",void 0),y([w()],Gd.prototype,"maxTotalNumberOfVertices",void 0),y([w()],Gd.prototype,"snapshotAvailable",void 0),y([w()],Gd.prototype,"polygonLodFactor",void 0),y([w()],Gd.prototype,"polylineLodFactor",void 0),y([w()],Gd.prototype,"skipHighSymbolLods",void 0),y([w()],Gd.prototype,"uncompressedTextureDownsamplingEnabled",void 0),Gd=y([Z("esri.views.3d.support.QualitySettings.Graphics3DSettings")],Gd);let Iy=class extends ze{constructor(){super(...arguments),this.lodFactor=1}};y([w()],Iy.prototype,"lodFactor",void 0),Iy=y([Z("esri.views.3d.support.QualitySettings.LoDFactorSettings")],Iy);let sV=class extends Iy{constructor(){super(...arguments),this.lodCrossfadeinDuration=0,this.lodCrossfadeoutDuration=0,this.lodCrossfadeUncoveredDuration=0}};sV=y([Z("esri.views.3d.support.QualitySettings.LoDFactor3DObjectSettings")],sV);let Cv=class extends ze{constructor(){super(...arguments),this.object=new sV,this.point=new Iy,this.integratedMesh=new Iy,this.pointCloud=new Iy,this.uncompressedTextureDownsamplingEnabled=!1}};y([w({type:sV})],Cv.prototype,"object",void 0),y([w({type:Iy})],Cv.prototype,"point",void 0),y([w({type:Iy})],Cv.prototype,"integratedMesh",void 0),y([w({type:Iy})],Cv.prototype,"pointCloud",void 0),y([w()],Cv.prototype,"uncompressedTextureDownsamplingEnabled",void 0),Cv=y([Z("esri.views.3d.support.QualitySettings.SceneServiceSettings")],Cv);let Av=class extends ze{constructor(){super(...arguments),this.lodBias=0,this.angledSplitBias=1,this.vtlContentZoom=1,this.reduceTileLevelDifferences=!0,this.textureFadeDuration=400}};y([w()],Av.prototype,"lodBias",void 0),y([w()],Av.prototype,"angledSplitBias",void 0),y([w()],Av.prototype,"vtlContentZoom",void 0),y([w()],Av.prototype,"reduceTileLevelDifferences",void 0),y([w()],Av.prototype,"textureFadeDuration",void 0),Av=y([Z("esri.views.3d.support.QualitySettings.TiledSurfaceSettings")],Av);let UM=class extends ze{constructor(){super(...arguments),this.pixelRatio=1,this.maxTotalNumberOfFeatures=5e4}};y([w()],UM.prototype,"pixelRatio",void 0),y([w()],UM.prototype,"maxTotalNumberOfFeatures",void 0),UM=y([Z("esri.views.3d.support.QualitySettings.HeatmapSettings")],UM);let kl=class extends ze{constructor(){super(...arguments),this.graphics3D=new Gd,this.sceneService=new Cv,this.tiledSurface=new Av,this.heatmap=new UM,this.fadeDuration=400,this.antialiasingEnabled=!0,this.physicallyBasedRenderingEnabled=!1,this.highQualityTransparency=!0,this.highResolutionAtmosphere=!1,this.reflections=!1,this.ambientOcclusion=!1,this.memoryLimit=750,this.additionalCacheMemory=0,this.frameRate=void 0,this.maximumPixelRatio=1/0}};y([w({type:Gd})],kl.prototype,"graphics3D",void 0),y([w({type:Cv})],kl.prototype,"sceneService",void 0),y([w({type:Av})],kl.prototype,"tiledSurface",void 0),y([w({type:UM})],kl.prototype,"heatmap",void 0),y([w()],kl.prototype,"fadeDuration",void 0),y([w()],kl.prototype,"antialiasingEnabled",void 0),y([w()],kl.prototype,"physicallyBasedRenderingEnabled",void 0),y([w()],kl.prototype,"highQualityTransparency",void 0),y([w()],kl.prototype,"highResolutionAtmosphere",void 0),y([w()],kl.prototype,"reflections",void 0),y([w()],kl.prototype,"ambientOcclusion",void 0),y([w()],kl.prototype,"memoryLimit",void 0),y([w()],kl.prototype,"additionalCacheMemory",void 0),y([w()],kl.prototype,"frameRate",void 0),y([w()],kl.prototype,"maximumPixelRatio",void 0),kl=y([Z("esri.views.3d.support.QualitySettings.QualitySettings")],kl);const n_e=kl;function o4t(t){return q5(t)&&t.length>=3}function a4t(t){return(W5(t)||Array.isArray(t))&&t.length>=3}function l4t(t){return o4t(t)||a4t(t)}let c4t=class Pie{constructor(e,i,r,n){this.viewingMode=e,this.spatialReference=i,this.unitInMeters=r,this._coordinateSystem=n,this._tmpCoordinateSystem=Ift(n)}set extent(e){e&&$ft(this._coordinateSystem,e,this._coordinateSystem)}getAltitude(e){return Vft(this._coordinateSystem,e)}setAltitude(e,i,r=e){return C4e(this._coordinateSystem,r,i,e)}setAltitudeOfTransformation(e,i){Bft(this._coordinateSystem,i,e,i)}worldUpAtPosition(e,i){return Fft(this._coordinateSystem,e,i)}worldBasisAtPosition(e,i,r){return kft(this._coordinateSystem,e,i,r)}basisMatrixAtPosition(e,i){const r=this.worldBasisAtPosition(e,Ms.X,xt.get()),n=this.worldBasisAtPosition(e,Ms.Y,xt.get()),s=this.worldBasisAtPosition(e,Ms.Z,xt.get());return s1(i,r[0],r[1],r[2],0,n[0],n[1],n[2],0,s[0],s[1],s[2],0,0,0,0,1),i}headingAtPosition(e,i){const r=this.worldUpAtPosition(e,xt.get()),n=this.worldBasisAtPosition(e,Ms.Y,xt.get()),s=KPe(i,n,r);return pu(s)}intersectManifoldClosestSilhouette(e,i,r){return KH(this._coordinateSystem,i,this._tmpCoordinateSystem),Uft(this._tmpCoordinateSystem,e,r),r}intersectManifold(e,i,r){KH(this._coordinateSystem,i,this._tmpCoordinateSystem);const n=xt.get();return zft(this._tmpCoordinateSystem,e,n)?Ne(r,n):null}intersectInfiniteManifold(e,i,r){if(this.viewingMode===_t.Global)return this.intersectManifold(e,i,r);KH(this._coordinateSystem,i,this._tmpCoordinateSystem);const n=this._tmpCoordinateSystem.value,s=xt.get();return bE(n.plane,e,s)?Ne(r,s):null}toRenderCoords(e,i,r){return mU(e)?ud(e,i,this.spatialReference):el(e,i,r,this.spatialReference)}fromRenderCoords(e,i,r=null){return mU(i)?(r!=null&&(i.spatialReference=r),x8e(e,this.spatialReference,i)):l4t(i)?el(e,this.spatialReference,i,r)?i:null:w_(e,this.spatialReference,i)}static create(e,i){switch(e){case _t.Local:return new Pie(_t.Local,i,ws(i),Nft());case _t.Global:return new Pie(_t.Global,i,1,Dft(i))}}static renderUnitScaleFactor(e,i){return DZ(e)/DZ(i)}};var dy;(function(t){t[t.ELEVATION=0]="ELEVATION",t[t.BASEMAP=1]="BASEMAP",t[t.I3S_INDEX=2]="I3S_INDEX",t[t.I3S_DATA=3]="I3S_DATA",t[t.SYMBOLOGY=4]="SYMBOLOGY"})(dy||(dy={}));const u4t=(()=>{const t=new Array;return t[dy.ELEVATION]=10,t[dy.BASEMAP]=10,t[dy.I3S_INDEX]=10,t[dy.I3S_DATA]=10,t[dy.SYMBOLOGY]=5,t})(),h4t=30;function Y7e(t){return"usedMemory"in t&&"unloadedMemory"in t&&"ignoresMemoryFactor"in t}function d4t(t){return new Wc({view:t})}const s_e=.1,l8=1,pY=1,p4t=.75,f4t=.6,o_e=1.3;let Wc=class extends ze{constructor(e){super(e),this._quality=1,this._usedMemory=0,this._updating=!1,this._stableQuality=0,this._downscaleMemoryUsed=0,this._canFastRecover=!1,this._memoryPredicted=0,this._cacheStorage=new qOe,this._warnMemoryUsage=null,this._numQualityChanges=0,this._maxMemory=750,this._additionalCacheMemory=0,this.addHandles(AT({prepare:()=>this._updateMemory()}))}destroy(){this._cacheStorage.destroy()}get maxMemory(){return this._maxMemory}set maxMemory(e){e==null||e<=0||(this._stableQuality=0,this._canFastRecover=!1,this._maxMemory1.1*pY||this._usedMemory>pY)&&(this._stableQuality>0?(this._downscaleMemoryUsed=0,this._updateQuality(this._stableQuality)):this._quality>s_e&&this._downscaleMemoryUsedpY)this._stableQuality=0,this._canFastRecover=!1,e=this._updateQuality(this._quality/o_e),this._downscaleMemoryUsed=this._memoryPredicted;else if(this._stableQuality!==this._quality)if(this._usedMemory!!e.updating)}_updateMemory(){var o,l,c,f,_;if(!this.view)return;(l=(o=this.view._stage)==null?void 0:o.renderer)==null||l.tick();let e=(((c=this.view.basemapTerrain)==null?void 0:c.usedMemory)??0)+(((_=(f=this.view._stage)==null?void 0:f.renderer)==null?void 0:_.usedMemory)??0),i=0;this.view.allLayerViews&&this.view.allLayerViews.forEach(x=>{if(Y7e(x)){const T=x.ignoresMemoryFactor?this._quality:1;e+=x.usedMemory*T,i+=x.unloadedMemory*T}});const r=this._warnMemoryUsage==null||Math.round(10*e)!==Math.round(10*this._warnMemoryUsage),n=1048576*this.maxMemory;if(e>n&&r){this._warnMemoryUsage=e;const x=A=>(A/1048576).toLocaleString(void 0,{maximumFractionDigits:1})+" MB",T=Math.round(100*this._quality);Ce.getLogger(this).warn(`Memory Limit exceeded! Limit: ${x(n)} Current: ${x(e)} Projected: ${x(e+i)} Quality: ${T}%`)}this._usedMemory=e/n,this._memoryPredicted=(e+i)/n;const s=n-e;this._cacheStorage.maxSize=Math.max(0,s+1048576*this.additionalCacheMemory)}get test(){const e=this;return{cacheStorage:this._cacheStorage,resetQualityChanges:()=>{const i=e._numQualityChanges;return e._numQualityChanges=0,i}}}};y([w({constructOnly:!0})],Wc.prototype,"view",void 0),y([w()],Wc.prototype,"maxMemory",null),y([w()],Wc.prototype,"additionalCacheMemory",null),y([w({readOnly:!0})],Wc.prototype,"memoryFactor",null),y([w({readOnly:!0})],Wc.prototype,"updating",null),y([w({readOnly:!0})],Wc.prototype,"usedMemory",null),y([w({readOnly:!0})],Wc.prototype,"usedCacheMemory",null),y([w()],Wc.prototype,"_quality",void 0),y([w()],Wc.prototype,"_usedMemory",void 0),y([w()],Wc.prototype,"_updating",void 0),y([w()],Wc.prototype,"_stableQuality",void 0),y([w()],Wc.prototype,"_maxMemory",void 0),y([w()],Wc.prototype,"_additionalCacheMemory",void 0),Wc=y([Z("esri.views.3d.support.MemoryController")],Wc);let m4t=class{constructor(e){this.client=e,this._cancelled=!1,this.size=0,this.duration=0}},g4t=class{constructor(e){this.typeWorkerQuota=e,this.tasks=new Array,this.numWorkers=0,this.statistics=new y4t}},y4t=class{constructor(){this.requests=0,this.size=0,this.duration=0,this.speed=0}},v4t=class{constructor(e,i,r,n){this._workerFunc=e,this._callbackFunc=i,this._maxTotalNumWorkers=r,this._totalNumWorkers=0,this._clients=n.map(s=>new g4t(s))}destroy(){this._clients.length=0}hasQuota(e){const i=this._clients[e];return!!i&&(this._totalNumWorkersthis._taskCallback(r,n))):i.tasks.push(e))}cancel(e){this._taskFinished(e),e._cancelled=!0}_taskFinished(e){const i=this._clients[e.client];this._totalNumWorkers--,i&&(i.numWorkers--,i.statistics.requests++,i.statistics.size+=e.size||0,i.statistics.duration+=e.duration||0,i.statistics.speed=i.statistics.duration>0?i.statistics.size/i.statistics.duration:0,Xt(i.numWorkers>=0)),this._next()}_next(){for(const e of this._clients)if(e&&e.numWorkers0;)if(this._workerFunc(e.tasks.shift(),(i,r)=>this._taskCallback(i,r)))return e.numWorkers++,this._totalNumWorkers++,!0;return!1}_taskCallback(e,i){e._cancelled||(this._callbackFunc(e,i),this._taskFinished(e))}getStatsForType(e){const i=this._clients[e];return i?{quota:i.typeWorkerQuota,workers:i.numWorkers,queueSize:i.tasks.length,requestStats:i.statistics}:null}get test(){const e=this;return{set workerFunc(i){e._workerFunc=i}}}},ck=class extends ze{constructor(){super(...arguments),this._tasks=new Map,this._onLoadQueue=new Array,this._doneQueue=new Array,this.updating=!1}setup(e,i,r){this._loadQueue=new v4t((n,s)=>this._startLoading(n,s),(n,s)=>this._doneLoadingCB(n,s),e,i),r&&(this._frameTask=r.registerTask(ni.STREAM_DATA_LOADER,this))}destroy(){this._frameTask=en(this._frameTask),this._tasks.forEach(e=>gn(e.abortController)),this._loadQueue=et(this._loadQueue),this._onLoadQueue=null,this._doneQueue=null,this._tasks=null}hasDownloadSlots(e){return this._loadQueue.hasQuota(e)}request(e,i,r,n={}){const s=Jl();s.__signal=n!=null?n.signal:null;const o=this._createOrUpdateTask(e,i,r,n,s);return Yl(n,()=>this._cancelRequest(o,s)),s.promise}_createTask(e,i,r,n,s,o){const l=new x4t(e,i,r,n,s);return this._updateTask(l,o),this._tasks.set(s,l),this._tasks.size===1&&this._set("updating",!0),this._loadQueue.push(l),l}_cancelRequest(e,i){var r;Q$(e.resolvers,i),i.reject(ur()),e.resolvers.length===0&&(e.status===of.DOWNLOADING&&(e.status=of.CANCELLED,this._loadQueue.cancel(e),(r=e.abortController)==null||r.abort(),e.request=null,e.abortController=null),e.status=of.CANCELLED,this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1))}_updateTask(e,i){e.resolvers.push(i)}_createOrUpdateTask(e,i,r,n,s){const o=S4t((n==null?void 0:n.uid)||e,i,r),l=this._tasks.get(o);return l?(this._updateTask(l,s),l):this._createTask(e,n,i,r,o,s)}_doneLoadingCB(e,i){this._loadQueue&&(Xt(e.status===of.DOWNLOADING),e.status=of.DOWNLOADED,this._frameTask?this._doneQueue.push({task:e,err:i}):this._doneLoading(e,i))}get running(){return this._doneQueue.length>0||this._onLoadQueue.length>0}runTask(e){for(;!e.done&&this._onLoadQueue.length>0;){const i=this._onLoadQueue.shift();St(i.task.abortController),i.task.abortController=null,i.callback(i.task),e.madeProgress()}for(;!e.done&&this._doneQueue.length>0;){const i=this._doneQueue.shift();i.task.status!==of.DOWNLOADED&&(i.err=i.err||ur()),this._doneLoading(i.task,i.err),e.madeProgress()}}_doneLoading(e,i){if(i&&!sn(i)&&e.numRetries>0)return--e.numRetries,void this._loadQueue.push(e);let r=e.result instanceof HTMLImageElement?0:e.resolvers.length;for(const n of e.resolvers)if(i)sn(i)?n.reject(i):n.reject(new se("stream-data-loader:request-error",`Failed to request resource at '${e.url}'. ${i}`,{url:e.url,error:i}));else{--r;const s=r>0?Re(e.result):e.result;n.resolve(s)}this._tasks.delete(e.key),this._tasks.size===0&&this._set("updating",!1)}_startLoading(e,i){if(e.status===of.CANCELLED)return!1;let r,n;switch(e.startTime=performance.now(),e.status=of.DOWNLOADING,e.docType){case"binary":n="array-buffer",r=0;break;case"image":n="image";break;case"image+type":n="array-buffer";break;default:n="json"}e.abortController=new AbortController;const s=e.abortController.signal;e.request=bi(e.url,{...e.options,responseType:n,timeout:r,signal:s});let o=()=>{};const l=f=>{e.duration=performance.now()-e.startTime,e.size=f instanceof ArrayBuffer?f.byteLength:e.size||0,e.result=f,this._frameTask?this._onLoadQueue.push({callback:i,task:e}):(e.abortController=null,i(e))},c=f=>{e.status===of.DOWNLOADING&&i(e,f),o()};return e.docType!=="image+type"?(e.request.then(f=>l(f.data),c),!0):(e.request.then(f=>{const _=f.data,x=b4t(_);if(n="image",e.size=_.byteLength,x==="unknown")return e.request=bi(e.url,{responseType:n,timeout:r,signal:s}),void e.request.then(M=>l(M.data),c);const T=new Blob([_],{type:x}),A=window.URL.createObjectURL(T);o=()=>window.URL.revokeObjectURL(A),e.request=bi(A,{responseType:n,timeout:r,signal:s}),e.request.then(M=>l(new wce(M.data,x,o)),c)},c),!0)}get test(){return{loadQueue:this._loadQueue}}};y([w({readOnly:!0})],ck.prototype,"updating",void 0),ck=y([Z("esri.views.3d.support.StreamDataLoader")],ck);const _4t={numRetries:0};function b4t(t){if(t.byteLength<2)return"unknown";const e=new Uint8Array(t,0,t.byteLength);return e[0]===137&&e[1]===80?"image/png":e[0]===71&&e[1]===73?"image/gif":e[0]===66&&e[1]===77?"image/bmp":e[0]===255&&e[1]===216?"image/jpeg":"unknown"}let wce=class{constructor(e,i,r){this.image=e,this.type=i,this.release=r}get isOpaque(){return this.type==="image/jpeg"}};function w4t(t){return"image"in t&&"type"in t}let x4t=class extends m4t{constructor(e,i,r,n,s){super(n),this.url=e,this.options=i,this.docType=r,this.key=s,this.result=null,this.status=of.QUEUED,this.request=null,this.abortController=null,this.resolvers=new Array,this.startTime=0,this.numRetries=_4t.numRetries}};function S4t(t,e,i){return`${t}:${e}:${i}`}var of;(function(t){t[t.QUEUED=1]="QUEUED",t[t.DOWNLOADING=2]="DOWNLOADING",t[t.DOWNLOADED=3]="DOWNLOADED",t[t.CANCELLED=4]="CANCELLED"})(of||(of={}));let uk=class extends ze{constructor(){super(...arguments),this.updating=!1}};function T4t(t){return new U0({view:t})}y([w({readOnly:!0})],uk.prototype,"updating",void 0),uk=y([Z("esri.views.3d.support.ResourceControllerMain")],uk);let U0=class extends uk{constructor(){super(...arguments),this._immediateTask=g5,this._normalTask=g5,this._updatingObjects=m5([]),this._frameTask=null}get immediate(){return this._immediateTask}get normal(){return this._normalTask}initialize(){this._scheduler=Rpt(),this._memoryController=d4t(this.view),this._streamDataLoader=new ck,this._streamDataLoader.setup(h4t,u4t,this._scheduler),this.addHandles([_e(()=>{var e;return(e=this.view.state)==null?void 0:e.mode},e=>{e!=null&&(this._scheduler.state=e)},Li),_e(()=>this.view.stationary,()=>this._stationaryChangedHandler())]),this._frameTask=AT({update:e=>this._frame(e)}),this._immediateTask=this._scheduler.registerTask(ni.RESOURCE_CONTROLLER_IMMEDIATE),this._normalTask=this._scheduler.registerTask(ni.RESOURCE_CONTROLLER)}destroy(){this._immediateTask.remove(),this._normalTask.remove(),this._frameTask=en(this._frameTask),this._streamDataLoader=et(this._streamDataLoader),this._memoryController=et(this._memoryController),this._scheduler=et(this._scheduler),this.view=null}get updating(){var e,i,r,n;return!!((e=this._memoryController)!=null&&e.updating||(i=this._streamDataLoader)!=null&&i.updating||(r=this._immediateTask)!=null&&r.updating)||((n=this._updatingObjects)==null?void 0:n.value.some(s=>s.updating))}get scheduler(){return this._scheduler}get memoryController(){return this._memoryController}createStreamDataRequester(e){const i=this._streamDataLoader;return{request:(r,n,s)=>i.request(r,n,e,s),get busy(){return!i.hasDownloadSlots(e)}}}addUpdatingObject(e){const i=this._updatingObjects;return i.value=[...i.value,e],rr(()=>{i.value=i.value.filter(r=>r!==e)})}_frame(e){this.view.suspended||this.view.stateManager&&(this.view.stateManager.step(Qre(e.deltaTime)),!this._scheduler)||(this._memoryController.update(),this._scheduler.updateBudget(e)&&this._scheduler.frame())}_stationaryChangedHandler(){this.memoryController.resetStableQuality()}get test(){return{getQueueStats:e=>this._streamDataLoader.test.loadQueue.getStatsForType(e)}}};y([w()],U0.prototype,"view",void 0),y([w()],U0.prototype,"_scheduler",void 0),y([w()],U0.prototype,"_memoryController",void 0),y([w()],U0.prototype,"_streamDataLoader",void 0),y([w()],U0.prototype,"_immediateTask",void 0),y([w()],U0.prototype,"_normalTask",void 0),y([w()],U0.prototype,"_updatingObjects",void 0),y([w({readOnly:!0})],U0.prototype,"updating",null),U0=y([Z("esri.views.3d.support.ResourceControllerImpl")],U0);function E4t(t){return Y7e(t)}function C4t(t){return"performanceInfo"in t}var gc,ti;(function(t){t[t.INSIDE=0]="INSIDE",t[t.INTERSECTS=1]="INTERSECTS",t[t.OUTSIDE=2]="OUTSIDE"})(gc||(gc={})),function(t){t[t.NORTH=0]="NORTH",t[t.NORTH_EAST=1]="NORTH_EAST",t[t.EAST=2]="EAST",t[t.SOUTH_EAST=3]="SOUTH_EAST",t[t.SOUTH=4]="SOUTH",t[t.SOUTH_WEST=5]="SOUTH_WEST",t[t.WEST=6]="WEST",t[t.NORTH_WEST=7]="NORTH_WEST"}(ti||(ti={}));const RC=W(),A4t=W(),A1=W(),M1=W();function M4t(t,e,i=0){const r=t.extent;if(r==null)return!1;if(i===0)return CAe(r,e);const n=Math.min(r[2]-r[0],r[3]-r[1]);return Tet(r,e,i*n)}function c8(t,e,i,r){Ne(RC,i),RC[r]=e[r];const n=je(RC,RC,e),s=je(A4t,t,e),o=Ve(s,n),l=Ve(n,n);let c;c=o<=0?e:l<=o?i:Be(RC,e,De(n,n,o/l));const f=je(RC,t,c);return Math.PI/2-Math.atan(f[2]/Math.sqrt(f[0]*f[0]+f[1]*f[1]))}function O4t(t,e,i){const r=t.extent;if(r==null)return 0;A1[0]=r[0],A1[1]=r[1],A1[2]=i,M1[0]=r[2],M1[1]=r[3],M1[2]=i;let n=1/0,s=1/0;return e[0]M1[0]&&(n=c8(e,M1,A1,0)),e[1]M1[1]&&(s=c8(e,M1,A1,1)),Math.min(n,s)}function P4t(t,e,i){if(t==null)return lae();if(t.spatialReference.isGeographic&&!D2(t.spatialReference))return new se("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");const r=Bu.checkUnsupported(t);if(r!=null)return r;if(i==null)return new se("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");const n=R4t(t,i);if(n)return n;const s=t.spatialReference;return e==null||s.equals(e)||e.isWGS84&&s.isWebMercator?null:new se("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene")}function R4t(t,e){const i=t.lods,r=i[0].resolution*2**i[0].level,n=[r*t.size[0],r*t.size[1]],s=[t.origin.x,t.origin.y],o=ase(e),l=Ni();Bu.computeRowColExtent(o,n,s,l);const c=(l[2]-l[0])*(l[3]-l[1]);if(c>PM){const f=i[0].scale*2**i[0].level;let _=Math.max((o[3]-o[1])/t.size[1],(o[2]-o[0])/t.size[0])*f/r;const x=Math.floor(Math.log(_)/Math.log(10));return _=Math.ceil(_/10**x)*10**x,new se("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(f).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+_.toLocaleString()+".",{level0Scale:f,suggestedLevel0Scale:_,requiredNumRootTiles:c,allowedNumRootTiles:PM})}return null}const I4t=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:P4t,isInsideExtent:M4t,tiltToExtentEdge:O4t},Symbol.toStringTag,{value:"Module"}));function $4t(){return!0}function L4t(){return 0}function D4t(t,e){if(t==null)return lae();const i=t.lods.length-1,r=t.spatialReference,n=D2(r)||r1(r)||n1(r);if(r.isWebMercator){if(!Bu.makeWebMercatorAuxiliarySphere(i).compatibleWith(t))return new se("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else{if(!n)return new se("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(!Bu.makeGCSWithTileSize(t.spatialReference,t.size[0],i).compatibleWith(t))return t.spatialReference.isWGS84?new se("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new se("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}return e==null||t.spatialReference.equals(e)?void 0:new se("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}const N4t=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:D4t,isInsideExtent:$4t,tiltToExtentEdge:L4t},Symbol.toStringTag,{value:"Module"})),F4t={[_t.Global]:N4t,[_t.Local]:I4t};function ry(t,e){t||console.warn("Terrain: "+e)}let pa=!1,oV=!1;function k4t(t){oV=t,pa=pa||t}function z4t(t){pa=t}function ot(t,e){var i;if(pa&&!t){const r=(i=new Error().stack)==null?void 0:i.slice(5);throw console.warn("Terrain internal: "+(e??"")+" at "+r),new Error("Assertion failed"+(e?": "+e:""))}}function Rie(t){return xG(t)?{fullExtent:t.fullExtent,minScale:t.layer.minScale,maxScale:t.layer.maxScale,tilemapCache:null}:t.layer}function aV(t){return(t==null?void 0:t.type)==="imagery-tile"||(t==null?void 0:t.type)==="wcs"}function xG(t){return(t==null?void 0:t.type)==="imagery-tile-3d"}function xce(t){return(t==null?void 0:t.type)==="tile-3d"}function L5(t){return(t==null?void 0:t.type)==="vector-tile-3d"}function X7e(t){return(t==null?void 0:t.type)==="wmts-3d"}function Iie(t){return(t==null?void 0:t.type)==="elevation-3d"}function PR(t){return(t==null?void 0:t.type)==="group"}function ZL(t){return t&&(xce(t)||X7e(t)||xG(t)||L5(t))}function $ie(t){return t&&(xce(t)||xG(t)||L5(t)||X7e(t))}function JL(t){return $ie(t)||Iie(t)}function U4t(t){var i;const e=(i=t==null?void 0:t.sourceLayerInfo)==null?void 0:i.data;return e!=null&&"type"in e&&e.type==="raster-tile"}function V4t(t){return Z7e(t==null?void 0:t.sourceLayerInfo)||!!(t!=null&&t.isVTLBackground)}function B4t(t){var i;const e=(i=t==null?void 0:t.sourceLayerInfo)==null?void 0:i.data;return e!=null&&"type"in e&&e.type==="tile-texture"}function j4t(t){var i;const e=(i=t==null?void 0:t.sourceLayerInfo)==null?void 0:i.data;return e instanceof HTMLImageElement||e instanceof wce||e instanceof HTMLCanvasElement||e instanceof ImageData}function Z7e(t){return(t==null?void 0:t.data)!=null&&"type"in t.data&&t.data.type==="vector-tile"}function CO(t){return t!=null&&"release"in t&&t.release(),null}function a_e(t){return t.fetchTile&&t.hasOverriddenFetchTile!==!1}function KL(t,e,i,r){return F4t[r].checkIfTileInfoSupportedForViewSR(t,i,e)}function SG(t,e,i){let r=null,n=null;if((t==null?void 0:t.type)==="wmts"){const s=J7e(t,e,i);r=s.tileInfo,n=s.fullExtent}else{n=aV(t)?t.getCompatibleFullExtent(e):t.fullExtent;const s=i===_t.Local;if(aV(t))r=t.getCompatibleTileInfo(e,n,s);else if((t==null?void 0:t.type)==="vector-tile"){const o=s&&!G4t(e)||H4t.force512VTL,l=t.tileInfo.spatialReference.isGeographic;r=o?t.tileInfo:t.tileInfo.getOrCreateCompatible(256,l?1:2)}else r=t.tileInfo}return r!=null&&n!=null&&KL(r,n,e,i)==null?{tileInfo:r,fullExtent:n}:null}function J7e(t,e,i){const r=Unt(t);if(r!=null){if(!it.isCollection(r))return{tileInfo:r.tileInfo,fullExtent:r.fullExtent};{const n=r.find(s=>KL(s.tileInfo,s.fullExtent,e,i)==null);if(n)return{tileInfo:n.tileInfo,fullExtent:n.fullExtent}}}return{tileInfo:null,fullExtent:null}}function G4t(t){return t.isWGS84||t.isWebMercator||DCe(t)||!VO(t)}const H4t={force512VTL:!1};function l_e(t){return"["+t[0]+","+t[1]+","+t[2]+"]"}function O1(t){return"("+t[0]+","+t[1]+","+t[2]+")"}function bf(t,e,i=Y4t){return Math.abs(t-e){(E4t(f)||JL(f))&&this.layerPerformanceInfos.push(new X4t(f,e))}),this.layerPerformanceInfos.sort((f,_)=>_.memory-f.memory)}},J4t=class{constructor(e){this._gltfLoading=new Map,this._wosrLoading=new Map,this._gltfMemCache=e("gltf-resources",()=>{}),this._wosrMemCache=e("wosr-resources",()=>{})}destroy(){this._gltfLoading.forEach(e=>e.abortController.abort()),this._wosrLoading.forEach(e=>e.abortController.abort()),this._gltfMemCache.destroy(),this._wosrMemCache.destroy()}loadGLTF(e,i,r){const n=r?`gltfPBR:${e}`:`gltf:${e}`,s=this._gltfMemCache.get(n);return s!=null?Promise.resolve(s):this._loadOnce(this._gltfLoading,this._gltfMemCache,n,o=>X8e(new W8e(o.streamDataRequester),e,o,r),i)}loadWOSR(e,i){const r=`wosr:${e}:${i.disableTextures}`,n=this._wosrMemCache.get(r);return n!=null?Promise.resolve(n):this._loadOnce(this._wosrLoading,this._wosrMemCache,r,s=>Z8e(e,s),i)}async _loadOnce(e,i,r,n,s){St(s);const o=Yl(s,()=>this._abortLoad(e,r));let l=e.get(r);if(l)l.refCount++;else{const c=new AbortController;l={refCount:1,abortController:c,promise:n({...s,signal:c.signal})},e.set(r,l)}try{const c=await l.promise;return i.put(r,c,c.size),e.delete(r),St(s),c}finally{en(o)}}_abortLoad(e,i){const r=e.get(i);r!=null&&--r.refCount>0||(e.delete(i),r!=null&&r.abortController.abort())}},VM=class extends ze{constructor(e,i){super({}),this._stage=e,this._textureRequests=new Map,this._frameTask=(i==null?void 0:i.registerTask(ni.TEXTURE_UNLOAD))??g5}normalizeCtorArgs(){return{}}destroy(){var e,i,r;super.destroy(),(e=this._frameTask)==null||e.remove(),(i=this._textureRequests)==null||i.forEach(n=>this._releaseTextureRequest(n)),(r=this._textureRequests)==null||r.clear()}get updating(){return this._frameTask.updating}fromData(e,i){const r=this.makeUid(e);let n=this._textureRequests.get(r);if(!n){const s=new K7e;s.texture=i(),this._stage&&(s.texture.load(this._stage.renderView.renderingContext),this._stage.add(s.texture)),this._textureRequests.set(r,s),n=s}return n.referenceCount++,{uid:r,texture:n.texture,release:()=>this._release(r)}}_release(e){const i=this._textureRequests.get(e);i?(i.referenceCount<1&&console.warn("TextureCollection: reference count is < 1 for "+e),i.referenceCount--,i.referenceCount<1&&this._frameTask.schedule(()=>this._releaseNow(e))):console.warn(`TextureCollection: texture doesn't exist: '${e}'`)}get test(){return{textureRequests:this._textureRequests}}_releaseNow(e){var r;if(!this._textureRequests)return;const i=this._textureRequests.get(e);!i||i.referenceCount>0||((r=i.texture)==null||r.unload(),this._releaseTextureRequest(i),this._textureRequests.delete(e))}_releaseTextureRequest(e){var i;e.texture?(i=this._stage)==null||i.remove(e.texture):e.abortController&&(e.abortController.abort(),e.abortController=null)}makeUid(e,i=null){return i!=null?`${e}.${i}px`:e}};y([w()],VM.prototype,"_frameTask",void 0),y([w()],VM.prototype,"updating",null),VM=y([Z("esri.views.3d.support.TextureCollection")],VM);let K7e=class{constructor(){this.referenceCount=0}},K4t=class extends VM{constructor(e,i,r){super(i,r),this._streamDataRequester=e}async fromUrl(e,i,r){St(r);const n=r!=null?r.signal:null,s=this.makeUid(e,i);let o=this._textureRequests.get(s);if(!o){const l=new AbortController,c=this._streamDataRequester.request(e,"image",{uid:s,signal:l.signal});o=new K7e,o.abortController=l;const f=o;this._textureRequests.set(s,o),o.textureAsync=c.then(async _=>{const x=this._createTexture(e,_,i);return f.texture=x,f.abortController=null,await x.load(this._stage.renderView.renderingContext),this._stage.add(x),{uid:s,texture:x,release:()=>this._release(s)}},_=>{throw f.abortController=null,_})}o.referenceCount++;try{return await oT(o.textureAsync,n)}catch(l){throw this._release(s),l}}_createTexture(e,i,r){var s;const n={width:i.width,height:i.height,wrap:{s:Bi.CLAMP_TO_EDGE,t:Bi.CLAMP_TO_EDGE},preMultiplyAlpha:!0,reloadable:!0};if(gEe(e)){if(r||i.width===0&&i.height===0){const o=i.width?i.height/i.width:1;r=r||64,o>1?(i.width=Math.round(r/o),i.height=r):(i.width=r,i.height=Math.round(r*o))}(s=this._stage.renderView)!=null&&s.renderingContext.driverTest.svgPremultipliesAlpha.result&&(n.preMultiplyAlpha=!1)}return new OE(i,n)}},Q4t=class{constructor(e){this.streamDataRequester=null,this._graphicsOwners=[],this._screenSizePerspectiveHandles=null,this.cimSymbolRasterizer=null,this._viewState=e.viewState,this._view=e.view,this._pointsOfInterest=e.pointsOfInterest,this.streamDataRequester=e.resourceController.createStreamDataRequester(dy.SYMBOLOGY),this.objectResourceCache=new J4t((r,n)=>e.resourceController.memoryController.newCache(r,n)),this.textures=new K4t(this.streamDataRequester,e.view._stage,e.resourceController.scheduler);const i=Sr(this._view.spatialReference).radius;this.screenSizePerspectiveSettings=R9e(e.viewingMode,i),this.screenSizePerspectiveSettingsLabels=b2t(e.viewingMode,i)}destroy(){this.textures.destroy(),this.streamDataRequester=null}addGraphicsOwner(e){if(!e)return rr();this._graphicsOwners.push(e);const i=_e(()=>{var r;return(r=e.layer)==null?void 0:r.screenSizePerspectiveEnabled},()=>this._updateScreenSizePerspectiveEnabled());return this._updateScreenSizePerspectiveEnabled(),rr(()=>{i.remove(),Q$(this._graphicsOwners,e),this._updateScreenSizePerspectiveEnabled()})}_updateScreenSizePerspectiveEnabled(){const e=this._graphicsOwners.some(i=>{var r;return((r=i.layer)==null?void 0:r.screenSizePerspectiveEnabled)===!0});if(e&&!this._screenSizePerspectiveHandles){this._screenSizePerspectiveHandles=new O_;const i=()=>this._updateScreenSizePerspectiveSettings();this._screenSizePerspectiveHandles.add([_e(()=>this._pointsOfInterest.centerOnSurfaceInfrequent.distance,i,Li),this._viewState.events.on("camera-projection-changed",i)]),this._updateScreenSizePerspectiveSettings()}else e||(this._screenSizePerspectiveHandles=et(this._screenSizePerspectiveHandles))}_updateScreenSizePerspectiveSettings(){const e=this._pointsOfInterest;u8.distance=e.centerOnSurfaceInfrequent.distance,u8.fovY=this._viewState.camera.fovY,this.screenSizePerspectiveSettings.update(u8),this.screenSizePerspectiveSettingsLabels.update(u8),this._view._stage.renderView.requestRender()}get test(){return{screenSizePerspectiveHandles:this._screenSizePerspectiveHandles}}};const u8={distance:0,fovY:0};let ZA=class{constructor(e,i,r=""){this.graphics=e,this._symbol=new t2({symbolLayers:new it([new e2({material:{color:i},outline:{color:[255,255,255],size:1},resource:{primitive:"circle"}}),new fE({text:r,halo:{color:"white",size:1/.75},material:{color:i},size:12})])})}show(e,i){if(i==null)return;this.hide();const r=new mt({x:e[0],y:e[1],z:e[2],spatialReference:i});this._graphic=new Ml({geometry:r,symbol:this._symbol}),this.graphics.add(this._graphic)}hide(){this._graphic!=null&&(this.graphics.remove(this._graphic),this._graphic=null)}},Ww=class extends ze{constructor(e){super(e)}};y([w({constructOnly:!0})],Ww.prototype,"renderCoordsHelper",void 0),y([w({constructOnly:!0})],Ww.prototype,"surface",void 0),y([w({constructOnly:!0})],Ww.prototype,"state",void 0),Ww=y([Z("esri.views.3d.support.PointOfInterest")],Ww);const eIt=Array;let V0=class extends Ww{constructor(e){super(e),this._dirty=!1,this._propertiesPool=new x_({location:mt,renderLocation:eIt},this),this._estimatedSurfaceAltitude=0,this._pendingElevationQueryController=null,this.renderLocation=W(),this._tmpPoint=new mt}initialize(){if(this.scheduler&&this.addHandles(this.scheduler.registerTask(this.task,this)),this.runTask(),this.map){const e=()=>this._setDirty();this.addHandles(Jr(()=>{var i,r;return(r=(i=this.map)==null?void 0:i.ground)==null?void 0:r.layers},"change",e,{onListenerAdd:e,onListenerRemove:e}))}this._updateRenderLocation()}destroy(){this._cancelPendingRequest(),this._propertiesPool=et(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}get scale(){const e=this._camera,i=Sn(e.eye,this.renderLocation),r={renderCoordsHelper:this.renderCoordsHelper,state:{camera:e}};return qT(r,i,0)}get updating(){return this._dirty||this._pendingElevationQueryController!=null}updateRenderLocation(){this._setDirty(),this._updateRenderLocation()}_setDirty(){this._dirty||(this._dirty=!0,this.notifyChange("updating"))}_cancelPendingRequest(){const e=this._pendingElevationQueryController;e&&(this._pendingElevationQueryController=null,e.abort(),this.notifyChange("updating"))}get running(){return!this._pendingElevationQueryController&&this._dirty}runTask(){var n;if(this._cancelPendingRequest(),this._dirty=!1,this.notifyChange("updating"),!((n=this.map)!=null&&n.ground))return this._updateSurfaceAltitude(0),Xl.YIELD;const e=this.state.spatialReference;this.renderCoordsHelper.fromRenderCoords(this._camera.eye,this._tmpPoint,e);const i=(this._tmpPoint.z??0)>tIt&&this.renderCoordsHelper.viewingMode===_t.Global&&(e.isWGS84||e.isWebMercator);let r=new AbortController;return this.map.ground.queryElevation(this._tmpPoint,{signal:r.signal,cache:this.cache,minDemResolution:i?iIt:0}).then(s=>this._updateSurfaceAltitude(s.geometry.z??0)).catch(s=>{sn(s)||this._updateSurfaceAltitude(0)}).catch(()=>{}).then(()=>{this._pendingElevationQueryController===r&&(this._pendingElevationQueryController=null,this.notifyChange("updating")),r=null}),this._pendingElevationQueryController=r,Xl.YIELD}_updateSurfaceAltitude(e){this._estimatedSurfaceAltitude!==e&&(this._estimatedSurfaceAltitude=e,this._updateRenderLocation())}_updateRenderLocation(){this.renderCoordsHelper.setAltitude(fY,this._estimatedSurfaceAltitude,this._camera.eye),jr(this._get("renderLocation"),fY)||(this._set("renderLocation",Ne(this._propertiesPool.get("renderLocation"),fY)),this.notifyChange("renderLocation"))}};y([w({constructOnly:!0})],V0.prototype,"scheduler",void 0),y([w({constructOnly:!0})],V0.prototype,"cache",void 0),y([w({constructOnly:!0})],V0.prototype,"task",void 0),y([w({readOnly:!0})],V0.prototype,"location",null),y([w({constructOnly:!0})],V0.prototype,"map",void 0),y([w({readOnly:!0})],V0.prototype,"renderLocation",void 0),y([w({readOnly:!0})],V0.prototype,"scale",null),y([w({readOnly:!0})],V0.prototype,"updating",null),V0=y([Z("esri.views.3d.support.CameraOnSurface")],V0);const fY=W(),tIt=1e5,iIt=1e6,rIt=Array;let af=class extends Ww{constructor(e){super(e),this._propertiesPool=new x_({location:mt,renderLocation:rIt},this),this._currentSurfaceAltitude=0,this._latestSurfaceAltitude=0,this.distance=0,this.renderLocation=W(),this.updating=!1}initialize(){this._frameWorker=this.scheduler.registerTask(this.task,this),this.runTask()}destroy(){this._frameWorker=en(this._frameWorker),this._propertiesPool=et(this._propertiesPool)}get _camera(){return this.state.contentCamera}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}updateRenderLocation(){this.updating=!0,this._updateRenderLocation()}get estimatedSurfaceAltitude(){return this._latestSurfaceAltitude}get running(){return this.updating}runTask(){return this._latestSurfaceAltitude=this.estimateSurfaceAltitudeAtCenter(),this._updateRenderLocation(),this.updating=!1,Xl.YIELD}_updateRenderLocation(){const e=sIt;let i=this._calculateSurfaceIntersection(this._currentSurfaceAltitude,e);const r=this._currentSurfaceAltitude!==this._latestSurfaceAltitude;!i&&r&&(i=this._calculateSurfaceIntersection(this._latestSurfaceAltitude,e),i&&(this._currentSurfaceAltitude=this._latestSurfaceAltitude));const n=oIt;i&&this._latestSurfaceAltitudeChangesDistanceSignificantly(e,n)&&(Ne(e,n),this._currentSurfaceAltitude=this._latestSurfaceAltitude),i?this.distance=Sn(this._camera.eye,e):(De(e,this._camera.viewForward,this._get("distance")),Be(e,e,this._camera.eye)),jr(this._get("renderLocation"),e)||this._set("renderLocation",Ne(this._propertiesPool.get("renderLocation"),e))}_calculateSurfaceIntersection(e,i){var n,s;const r=this._camera;if(!this.renderCoordsHelper.intersectInfiniteManifold(r.ray,e,i))return!1;if(this.state.isGlobal){const o=Sr(this.renderCoordsHelper.spatialReference).radius,l=o+e,c=El(r.eye),f=co/4){const x=l-Math.sqrt(c);return De(i,r.viewForward,x),Be(i,i,r.eye),!0}}else{const o=(n=this.surface)!=null&&n.ready?this.surface.extent:null;o!=null&&mj(o,(s=this.surface)==null?void 0:s.spatialReference,RR,this.renderCoordsHelper.spatialReference)&&(i[0]=Je(i[0],RR[0],RR[2]),i[1]=Je(i[1],RR[1],RR[3]))}return!0}_latestSurfaceAltitudeChangesDistanceSignificantly(e,i){if(this._latestSurfaceAltitude===this._currentSurfaceAltitude||e==null)return!1;if(this._calculateSurfaceIntersection(this._latestSurfaceAltitude,i)){if(Tn.TESTS_DISABLE_OPTIMIZATIONS)return!0;const r=this._camera.eye,n=Sn(r,e),s=Sn(r,i);if(Math.abs(s-n)/n>nIt)return!0}return!1}};y([w({constructOnly:!0})],af.prototype,"scheduler",void 0),y([w({constructOnly:!0})],af.prototype,"task",void 0),y([w()],af.prototype,"distance",void 0),y([w({constructOnly:!0})],af.prototype,"estimateSurfaceAltitudeAtCenter",void 0),y([w({readOnly:!0})],af.prototype,"location",null),y([w({readOnly:!0})],af.prototype,"renderLocation",void 0),y([w()],af.prototype,"updating",void 0),af=y([Z("esri.views.3d.support.CenterOnSurface")],af);const nIt=.05,sIt=W(),oIt=W(),RR=Ni();let aIt=class{constructor(e){this._handles=new O_,this.events=new Dn,this._contentLayerViews=e.contentLayerViews,this._handles.add(this._contentLayerViews.on("change",i=>this._layerViewsChanged(i))),this._layerViewsChanged({added:this._contentLayerViews.toArray(),removed:[],moved:[],target:this._contentLayerViews})}destroy(){this._handles=et(this._handles),this._contentLayerViews.destroy()}_layerViewsChanged(e){e.added.forEach(i=>{i.declaredClass==="esri.views.3d.layers.SceneLayerView3D"&&this._handles.add(i.on("visible-geometry-changed",()=>this._contentChanged()),i.uid)}),e.removed.forEach(i=>this._handles.remove(i.uid))}_contentChanged(){this.events.emit("request-update",lIt)}};const lIt={},cIt=Array;let Ng=class extends Ww{constructor(e){super(e),this._propertiesPool=new x_({location:mt,renderLocation:cIt},this),this._dirty=!0,this.renderLocation=this._propertiesPool.get("renderLocation")}initialize(){this.addHandles([_e(()=>this.centerOnSurface.renderLocation,()=>this.updateRenderLocation()),_e(()=>this.state.contentCamera,()=>this.updateRenderLocation())]),this.scheduler&&this.addHandles(this.scheduler.registerTask(ni.POINT_OF_INTEREST_FREQUENT,this))}destroy(){this._propertiesPool=et(this._propertiesPool)}get updating(){return this._dirty||this.centerOnSurface.updating}get location(){const e=this._propertiesPool.get("location");return this.renderCoordsHelper.fromRenderCoords(this.renderLocation,e,this.state.spatialReference),e}get running(){return this._dirty}runTask(){const e=this._get("renderLocation"),i=this.centerOnSurface.renderLocation,r=this.renderCoordsHelper,n=this.state.contentCamera;this._dirty=!1,r.worldUpAtPosition(i,p_e);const s=Math.max(0,(Math.acos(Ve(p_e,n.viewForward))-.5*Math.PI)*(n.aboveGround?1:-1));if(Number.isNaN(s)){if(!e||!M2(e,i)){const f=this._propertiesPool.get("renderLocation");Ne(f,i),this._set("renderLocation",f)}return Xl.YIELD}const o=1-Je(s/(.5*Math.PI),0,1),l=o*o*o;this._calculateScreenHorizontalEdgeOnSurface(f_e);const c=this._propertiesPool.get("renderLocation");return Qr(c,i,f_e,l),e&&M2(e,c)||this._set("renderLocation",c),Xl.YIELD}_calculateScreenHorizontalEdgeOnSurface(e){const i=this.state.contentCamera,r=i.getRenderCenter(Za());if(r[1]=i.aboveGround?i.padding[er.BOTTOM]:i.fullHeight-i.padding[er.TOP],this.estimateSurfaceIntersectionAtRenderPoint(r,e))return e;const n=this.renderCoordsHelper.getAltitude(this.centerOnSurface.renderLocation);if(i.unprojectFromRenderScreen(r,IR)){je(IR,IR,i.eye);const s=Ye(IR,IR);if(this.renderCoordsHelper.intersectInfiniteManifold(Sp(i.eye,s),n,e))return e}return this.renderCoordsHelper.setAltitude(e,n,i.eye)}updateRenderLocation(){this._dirty=!0}};y([w()],Ng.prototype,"_dirty",void 0),y([w({constructOnly:!0})],Ng.prototype,"scheduler",void 0),y([w({constructOnly:!0})],Ng.prototype,"centerOnSurface",void 0),y([w({constructOnly:!0})],Ng.prototype,"estimateSurfaceIntersectionAtRenderPoint",void 0),y([w({readOnly:!0})],Ng.prototype,"updating",null),y([w({readOnly:!0})],Ng.prototype,"location",null),y([w({readOnly:!0})],Ng.prototype,"renderLocation",void 0),Ng=y([Z("esri.views.3d.support.pointsOfInterest.Focus")],Ng);const p_e=W(),IR=W(),f_e=W();let iv=class extends ze{get surface(){var e;return(e=this.view.map)==null?void 0:e.ground}get surfaceView(){return this.view.basemapTerrain}get renderLocation(){if(!this.location)return null;const e=W();return this.view.renderCoordsHelper.toRenderCoords(this.location,e),e}constructor(e){super(e),this.location=null,this._updateController=null}initialize(){this.view.state.isLocal&&(this.addHandles([_e(()=>{var e,i;return[(e=this.surfaceView)==null?void 0:e.spatialReference,(i=this.surfaceView)==null?void 0:i.extent]},()=>this._update()),Jr(()=>{var e;return(e=this.surface)==null?void 0:e.layers},"change",()=>this._update())]),this._update())}_update(){var r;if(this._updateController&&(this._updateController.abort(),this._updateController=null),((r=this.surfaceView)==null?void 0:r.extent)==null||this.surfaceView.spatialReference==null)return void this._set("location",null);const e=lse(this.surfaceView.extent),i=new mt({x:e[0],y:e[1],z:0,spatialReference:this.surfaceView.spatialReference});this.surface&&this.surface.layers.length>0?(this._set("location",null),this._updateController=new AbortController,this.surface.queryElevation(i,{noDataValue:0,signal:this._updateController.signal,cache:this.cache}).then(n=>{this._updateController=null,this._set("location",n.geometry)}).catch(n=>{sn(n)||n&&n.name==="elevation-query:invalid-layer"||console.error("StableSurfaceCenter failed to update: ",n)})):this._set("location",i)}};y([w({constructOnly:!0})],iv.prototype,"view",void 0),y([w({constructOnly:!0})],iv.prototype,"cache",void 0),y([w()],iv.prototype,"surface",null),y([w()],iv.prototype,"surfaceView",null),y([w({readOnly:!0})],iv.prototype,"location",void 0),y([w({readOnly:!0})],iv.prototype,"renderLocation",null),iv=y([Z("esri.views.3d.terrain.StableSurfaceCenter")],iv);let rv=class extends ze{constructor(e){super(e),this._tileGeometryUpdateExtent=od(),this._tileGeometryUpdateSpatialReference=null,this.events=new Dn,this.updating=!1}initialize(){this.addHandles([this.surface.on("elevation-change",e=>this._tileGeometryChanged(e)),this.scheduler.registerTask(ni.SURFACE_GEOMETRY_UPDATES,this)])}get running(){return this.updating}runTask(){return this.updating&&(this._tileGeometryUpdateSpatialReference&&this._centerIntersectsExtent(this._tileGeometryUpdateExtent,this._tileGeometryUpdateSpatialReference)&&this.events.emit("request-update",uIt),od(this._tileGeometryUpdateExtent),this._set("updating",!1)),Xl.YIELD}_tileGeometryChanged(e){this._tileGeometryUpdateSpatialReference=e.spatialReference,g2(this._tileGeometryUpdateExtent,e.extent,this._tileGeometryUpdateExtent),this._set("updating",!0)}_furthestCenterOnSurface(){let e=this.centerOnSurfaces[0];for(let i=1;ie.distance&&(e=r)}return e}_centerIntersectsExtent(e,i){const r=this.state.contentCamera.eye,n=hIt,s=this._furthestCenterOnSurface();return this.renderCoordsHelper.fromRenderCoords(r,Yx,i),this.renderCoordsHelper.fromRenderCoords(s.renderLocation,Xx,i),Yx[0]this._estimateSurfaceAltitudeAtCenter(),o=this.view.resourceController.scheduler,l=(_=this.view.basemapTerrain)==null?void 0:_.elevationQueryCache,c={state:e,scheduler:o,surface:i,renderCoordsHelper:r};this._set("centerOnSurfaceInfrequent",new af({...c,task:ni.POINT_OF_INTEREST_INFREQUENT,estimateSurfaceAltitudeAtCenter:s})),this._set("centerOnSurfaceFrequent",new af({...c,task:ni.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:s})),this._set("centerOnContent",new af({...c,task:ni.POINT_OF_INTEREST_FREQUENT,estimateSurfaceAltitudeAtCenter:()=>this._estimateContentAltitudeAtCenter()})),this._set("cameraOnSurface",new V0({...c,cache:l,task:ni.POINT_OF_INTEREST_INFREQUENT,map:n})),this._set("surfaceGeometryUpdates",new rv({...c,centerOnSurfaces:[this.centerOnSurfaceFrequent,this.centerOnContent,this.centerOnSurfaceInfrequent]})),this._set("contentGeometryUpdates",new aIt({contentLayerViews:this.view.allLayerViews,renderCoordsHelper:r})),this._set("surfaceOrigin",new iv({cache:l,view:this.view})),this._set("focus",new Ng({state:e,scheduler:o,surface:i,renderCoordsHelper:r,centerOnSurface:this.centerOnSurfaceFrequent,estimateSurfaceIntersectionAtRenderPoint:(x,T)=>this._estimateSurfaceIntersectionAtRenderPoint(x,this.view.state.contentCamera,T)})),this._pois.push(this.centerOnContent,this.centerOnSurfaceFrequent,this.centerOnSurfaceInfrequent,this.cameraOnSurface,this.focus);const f=this.view.graphics;this._debugCenters.set(this.centerOnContent,new ZA(f,"red","CenterOnContent")),this._debugCenters.set(this.centerOnSurfaceFrequent,new ZA(f,"red","CenterOnSurface")),this._debugCenters.set(this.centerOnSurfaceInfrequent,new ZA(f,"red","CenterOnSurface")),this._debugCenters.set(this.cameraOnSurface,new ZA(f,"blue","CameraOnSurface")),this._debugCenters.set(this.focus,new ZA(f,"green","Focus")),this._handles.add([_e(()=>e.contentCamera,x=>this._cameraChanged(x),Li),_e(()=>i.extent,()=>this._updateCenterPointsOfInterest()),Mo(()=>!i.updating,()=>this._updateCenterPointsOfInterest(),Li),Jr(()=>this.surfaceGeometryUpdates.events,"request-update",()=>this._updateCenterPointsOfInterest()),Jr(()=>this.contentGeometryUpdates.events,"request-update",()=>this._updateCenterOnContent()),Mo(()=>Tn.SHOW_POI,x=>this._setDebug(x),ii)]),this._cameraChanged(this.view.state.contentCamera);for(const x of this._pois)x.runTask()}destroy(){this._setDebug(!1),this._handles.destroy(),this._propertiesPool.destroy();for(const e of this._pois)e.destroy();this.surfaceOrigin.destroy()}get updating(){var e;return!(!((e=this.surfaceGeometryUpdates)!=null&&e.updating)&&!this._pois.some(i=>i.updating))}get _centerRay(){return this._centerRayDirty&&(this._centerRayCached=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(this.view.state.contentCamera,this._tmpRay),this._centerRayDirty=!1),this._centerRayCached}_estimateContentAltitudeAtCenter(){if(!this._contentAltitudeAtCenterDirty)return this._contentAltitudeAtCenter;this._contentAltitudeAtCenterDirty=!1;const e=this._centerRay;return e==null||(this.view.sceneIntersectionHelper.intersectRay(e,this._contentIntersector,IC,fIt)?this._contentAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(IC):this._contentAltitudeAtCenter=this._estimateSurfaceAltitudeAtCenter()),this._contentAltitudeAtCenter}_estimateSurfaceAltitudeAtCenter(){if(!this.view.basemapTerrain)return 0;if(!this._surfaceAltitudeAtCenterDirty)return this._surfaceAltitudeAtCenter;this._surfaceAltitudeAtCenterDirty=!1;const e=this._centerRay;if(e==null)return this._surfaceAltitudeAtCenter;const i=e.origin,r=Be(IC,e.origin,e.direction);return this._surfaceIntersector.resetWithRay(e,this.view.state.contentCamera),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,i,r),this._surfaceIntersector.results.min.getIntersectionPoint(IC)&&(this._surfaceAltitudeAtCenter=this.view.renderCoordsHelper.getAltitude(IC)),this._surfaceAltitudeAtCenter}_estimateSurfaceIntersectionAtRenderPoint(e,i,r){const n=tle(i,e,pIt);if(n==null)return null;const s=n.origin,o=Be(IC,n.origin,n.direction);return this._surfaceIntersector.resetWithRay(n,i),this.view.basemapTerrain.intersect(this._surfaceIntersector,null,s,o),this._surfaceIntersector.results.min.getIntersectionPoint(r)?r:null}_cameraChanged(e){this._updateCenterPointsOfInterest();const i=e.eye;jr(this.renderPointOfView,i)||this._set("renderPointOfView",Ne(this._propertiesPool.get("renderPointOfView"),i))}_updateCenterPointsOfInterest(){this._centerRayDirty=!0,this._surfaceAltitudeAtCenterDirty=!0,this._contentAltitudeAtCenterDirty=!0;for(const e of this._pois)e.updateRenderLocation()}_updateCenterOnContent(){this._contentAltitudeAtCenterDirty=!0,this.centerOnContent.updateRenderLocation()}_setDebug(e){if(!e)return this._debugCenters.forEach(i=>i.hide()),void this._handles.remove("debug");for(const i of this._pois)this._handles.add(_e(()=>i.renderLocation,r=>{var n;return(n=this._debugCenters.get(i))==null?void 0:n.show(r,i.renderCoordsHelper.spatialReference)},ii),"debug")}get test(){return{update:()=>{this.surfaceGeometryUpdates.runTask();for(const e of this._pois)e.runTask()},surfaceGeometryUpdates:this.surfaceGeometryUpdates}}};y([w({readOnly:!0})],Nu.prototype,"centerOnContent",void 0),y([w({readOnly:!0})],Nu.prototype,"centerOnSurfaceFrequent",void 0),y([w({readOnly:!0})],Nu.prototype,"centerOnSurfaceInfrequent",void 0),y([w({readOnly:!0})],Nu.prototype,"cameraOnSurface",void 0),y([w({readOnly:!0})],Nu.prototype,"focus",void 0),y([w({readOnly:!0})],Nu.prototype,"renderPointOfView",void 0),y([w({readOnly:!0})],Nu.prototype,"surfaceOrigin",void 0),y([w({readOnly:!0})],Nu.prototype,"contentGeometryUpdates",void 0),y([w({readOnly:!0})],Nu.prototype,"surfaceGeometryUpdates",void 0),y([w({constructOnly:!0})],Nu.prototype,"view",void 0),y([w({readOnly:!0})],Nu.prototype,"updating",null),Nu=y([Z("esri.views.3d.support.PointsOfInterest")],Nu);const dIt=Array,IC=W(),pIt=Ko(),fIt={exclude:new Set([Gw])};let Q7e=class{constructor(e){this._store=e}destroy(){this._store.destroy()}get(e){return this._store.get(e)}put(e,i){this._store.put(e,i,i.values.byteLength+256)}},eFe=class{constructor(e,i,r,n){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=i,this.height=r,this.noDataValue=n)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:i}=this;let r=1/0,n=-1/0,s=!0;for(const o of i)o===e?this._hasNoDataValues=!0:(r=on?o:n,s=!1);s?(this._minValue=0,this._maxValue=0):(this._minValue=r,this._maxValue=n>-3e38?n:0)}},tFe=class{constructor(e,i,r,n,s={}){this._mainMethod=i,this._transferLists=r,this._listeners=[],this._promise=pft(e,{...s,schedule:n}).then(o=>{if(this._thread===void 0){this._thread=o,this._promise=null,s.hasInitialize&&this.broadcast({},"initialize");for(const l of this._listeners)this._connectListener(l)}else o.close()}),this._promise.catch(o=>Ce.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${o}`))}on(e,i){const r={removed:!1,eventName:e,callback:i,threadHandle:null};return this._listeners.push(r),this._connectListener(r),rr(()=>{r.removed=!0,Gre(this._listeners,r),this._thread&&r.threadHandle!=null&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,i){return this.invokeMethod(this._mainMethod,e,i)}invokeMethod(e,i,r){if(this._thread){const n=this._transferLists[e],s=n?n(i):[];return this._thread.invoke(e,i,{transferList:s,signal:r})}return this._promise?this._promise.then(()=>(St(r),this.invokeMethod(e,i,r))):Promise.reject(null)}broadcast(e,i){return this._thread?Promise.all(this._thread.broadcast(i,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,i)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(i=>{e.removed||(e.threadHandle=i)})}},m_e=class extends tFe{constructor(e=null){super("LercWorker","_decode",{_decode:i=>[i.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,i,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:i},r):Promise.resolve(null)}release(){--this.ref<=0&&(N$.forEach((e,i)=>{e===this&&N$.delete(i)}),this.destroy())}};const N$=new Map;function iFe(t=null){let e=N$.get(t);return e||(t!=null?(e=new m_e(i=>t.immediate.schedule(i)),N$.set(t,e)):(e=new m_e,N$.set(null,e))),++e.ref,e}var zh,g_e,y_e;(function(t){t[t.FILL=1]="FILL",t[t.LINE=2]="LINE",t[t.SYMBOL=3]="SYMBOL",t[t.CIRCLE=4]="CIRCLE"})(zh||(zh={})),function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.FILL=1]="FILL",t[t.OUTLINE=2]="OUTLINE",t[t.LINE=3]="LINE",t[t.ICON=4]="ICON",t[t.CIRCLE=5]="CIRCLE",t[t.TEXT=6]="TEXT",t[t.TILEINFO=7]="TILEINFO"}(g_e||(g_e={})),function(t){t[t.PAINTER_CHANGED=0]="PAINTER_CHANGED",t[t.LAYOUT_CHANGED=1]="LAYOUT_CHANGED",t[t.LAYER_CHANGED=2]="LAYER_CHANGED",t[t.LAYER_REMOVED=3]="LAYER_REMOVED",t[t.SPRITES_CHANGED=4]="SPRITES_CHANGED"}(y_e||(y_e={}));let mIt=class{constructor(e){this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}},Zhi=class{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}};function Khi(t,e,i,r,n,s){const o=i-n;if(o>=0)return(e>>o)+(r-(s<>o);const l=-o;return e-(s-(r<>l)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=Kt(this.vao)}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++],l=Yr.createVertex(e,Pr.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const c=n[r++],f=Yr.createIndex(e,Pr.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c));r+=c;const _=this.layer.lineMaterial;this.vao=new Qf(e,_.getAttributeLocations(),_.getLayoutInfo(),{geometry:l},f)}},_It=class extends TG{constructor(e,i){super(e,i),this.type=zh.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const r=new Uint32Array(e);let n=this.bufferDataOffset;this.fillIndexStart=r[n++],this.fillIndexCount=r[n++],this.outlineIndexStart=r[n++],this.outlineIndexCount=r[n++];const s=r[n++];if(s>0){this.patternMap=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=Kt(this.fillVAO),this.outlineVAO=Kt(this.outlineVAO)}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++],l=Yr.createVertex(e,Pr.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const c=n[r++],f=Yr.createIndex(e,Pr.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c));r+=c;const _=n[r++],x=Yr.createVertex(e,Pr.STATIC_DRAW,new Int32Array(s.buffer,4*r,_));r+=_;const T=n[r++],A=Yr.createIndex(e,Pr.STATIC_DRAW,new Uint32Array(n.buffer,4*r,T));r+=T;const M=this.layer,I=M.fillMaterial,L=M.outlineMaterial;this.fillVAO=new Qf(e,I.getAttributeLocations(),I.getLayoutInfo(),{geometry:l},f),this.outlineVAO=new Qf(e,L.getAttributeLocations(),L.getLayoutInfo(),{geometry:x},A)}},bIt=class extends TG{constructor(e,i,r){super(e,i),this.type=zh.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const n=new Uint32Array(e),s=new Int32Array(e),o=new Float32Array(e);let l=this.bufferDataOffset;this.isIconSDF=!!n[l++];const c=n[l++];for(let T=0;T0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[i,r]of this.iconPerPageElementsMap)e+=r[1];for(const[i,r]of this.glyphPerPageElementsMap)e+=r[1];return e/3}doDestroy(){this.iconVAO=Kt(this.iconVAO),this.textVAO=Kt(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=this.iconOpacity,i=this.iconVAO.vertexBuffers.opacity;e.length>0&&e.byteLength===i.byteLength&&i.setSubData(e,0,0,e.length);const r=this.textOpacity,n=this.textVAO.vertexBuffers.opacity;r.length>0&&r.byteLength===n.byteLength&&n.setSubData(r,0,0,r.length)}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++],l=Yr.createVertex(e,Pr.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const c=n[r++],f=Yr.createIndex(e,Pr.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c));r+=c;const _=n[r++],x=Yr.createVertex(e,Pr.STATIC_DRAW,new Int32Array(s.buffer,4*r,_));r+=_;const T=n[r++],A=Yr.createIndex(e,Pr.STATIC_DRAW,new Uint32Array(n.buffer,4*r,T));r+=T;const M=Yr.createVertex(e,Pr.STATIC_DRAW,this.iconOpacity.buffer),I=Yr.createVertex(e,Pr.STATIC_DRAW,this.textOpacity.buffer),L=this.layer,F=L.iconMaterial,z=L.textMaterial;this.iconVAO=new Qf(e,F.getAttributeLocations(),F.getLayoutInfo(),{geometry:l,opacity:M},f),this.textVAO=new Qf(e,z.getAttributeLocations(),z.getLayoutInfo(),{geometry:x,opacity:I},A)}},wIt=class extends TG{constructor(e,i){super(e,i),this.type=zh.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const r=new Uint32Array(e);let n=this.bufferDataOffset;this.circleIndexStart=r[n++],this.circleIndexCount=r[n++],this.bufferDataOffset=n}get memoryUsed(){var e,i;return(((e=this.data)==null?void 0:e.byteLength)??0)+(((i=this.vao)==null?void 0:i.usedMemory)??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=Kt(this.vao)}doPrepareForRendering(e,i,r){const n=new Uint32Array(i),s=new Int32Array(n.buffer),o=n[r++],l=Yr.createVertex(e,Pr.STATIC_DRAW,new Int32Array(s.buffer,4*r,o));r+=o;const c=n[r++],f=Yr.createIndex(e,Pr.STATIC_DRAW,new Uint32Array(n.buffer,4*r,c));r+=c;const _=this.layer.circleMaterial;this.vao=new Qf(e,_.getAttributeLocations(),_.getLayoutInfo(),{geometry:l},f)}};const adi=!0,ldi=32,v_e=200,xIt=1/Le("mapview-transitions-duration");let SIt=class extends Dn{constructor(){super(...arguments),this._fadeOutResolver=null,this._fadeInResolver=null,this._clips=null,this.computedVisible=!0,this.computedOpacity=1,this.fadeTransitionEnabled=!1,this.inFadeTransition=!1,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this.requestRender())}get stage(){return this._stage}set stage(e){var r;if(this._stage===e)return;const i=this._stage;this._stage=e,e?(r=this._stage)!=null&&r.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i==null||i.trashDisplayObject(this)}get transforms(){return this._getTransforms()}_getTransforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}fadeIn(){return this._fadeInResolver||(this._fadeOutResolver&&(this._fadeOutResolver(),this._fadeOutResolver=null),this.opacity=1,this.computedOpacity=0,this.fadeTransitionEnabled=!0,this._fadeInResolver=Jl(),this.requestRender()),this._fadeInResolver.promise}fadeOut(){return this._fadeOutResolver||(this.opacity=0,this._fadeInResolver&&(this._fadeInResolver(),this._fadeInResolver=null),this.fadeTransitionEnabled=!0,this._fadeOutResolver=Jl(),this.requestRender()),this._fadeOutResolver.promise}endTransitions(){var e,i;(e=this._fadeInResolver)==null||e.call(this),this._fadeInResolver=null,(i=this._fadeOutResolver)==null||i.call(this),this._fadeOutResolver=null,this.computedOpacity=this.visible?this.opacity:0,this.requestRender()}beforeRender(e){this.updateTransitionProperties(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this._fadeInResolver&&this.computedOpacity===this.opacity?(this._fadeInResolver(),this._fadeInResolver=null):this._fadeOutResolver&&this.computedOpacity===0&&(this._fadeOutResolver(),this._fadeOutResolver=null)}remove(){var e;(e=this.parent)==null||e.removeChild(this)}setTransform(e){}processRender(e){this.stage&&this.computedVisible&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this._fadeInResolver&&(this._fadeInResolver(),this._fadeInResolver=null),this._fadeOutResolver&&(this._fadeOutResolver(),this._fadeOutResolver=null),this.onDetach(),this.emit("detach")}updateTransitionProperties(e,i){if(this.fadeTransitionEnabled){const r=this._fadeOutResolver||!this.visible?0:this.opacity,n=this.computedOpacity;if(n===r)this.computedVisible=this.visible;else{const s=e*xIt;this.computedOpacity=n>r?Math.max(r,n-s):Math.min(r,n+s),this.computedVisible=this.computedOpacity>0;const o=r===this.computedOpacity;this.inFadeTransition=!o,o||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}},iE=class iS{static getId(e,i,r,n){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${i}/${r}/${n}`}constructor(e,i,r,n){this.set(e,i,r,n)}get key(){return this}get id(){return this.toString()}set id(e){this.set(e)}get hash(){const e=4095&this.row,i=4095&this.col,r=63&this.level;return(3&this.world)<<30|i<<22|e<<8|r}acquire(e,i,r,n){this.set(e,i,r,n)}contains(e){const i=e.level-this.level;return i>=0&&this.row===e.row>>i&&this.col===e.col>>i&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new iS(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,i,r,n){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[s,o,l,c]=e.split("/");this.level=parseFloat(s),this.row=parseFloat(o),this.col=parseFloat(l),this.world=parseFloat(c)}else this.level=+e,this.row=+i,this.col=+r,this.world=+n||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new iS(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const e=this.level+1,i=this.row<<1,r=this.col<<1,n=this.world;return[new iS(e,i,r,n),new iS(e,i,r+1,n),new iS(e,i+1,r,n),new iS(e,i+1,r+1,n)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};iE.pool=new Ec(iE,null,null,25,50);let rFe=class extends SIt{constructor(e,i,r,n,s,o,l=s,c=o){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new iE(e),this.resolution=i,this.x=r,this.y=n,this.width=s,this.height=o,this.rangeX=l,this.rangeY=c}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(e){const i=this.resolution/(e.resolution*e.pixelRatio),r=this.transforms.tileMat3,[n,s]=e.toScreenNoRotation([0,0],[this.x,this.y]),o=this.width/this.rangeX*i,l=this.height/this.rangeY*i;Toe(r,o,0,0,0,l,0,n,s,1),s5(this.transforms.dvs,e.displayViewMat3,r)}},mY=class nFe extends rFe{constructor(e,i,r,n,s,o,l,c=null){super(e,i,r,n,s,o,4096,4096),this.styleRepository=l,this._memCache=c,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(sFe.delete(this),nFe._destroyRenderBuckets(this.layerData),this.layerData=null,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get memoryUsed(){return this._memoryUsedByLayerData+256}changeDataImpl(e){var r;let i=!1;if(e){const{bucketsWithData:n,emptyBuckets:s}=e,o=this._createRenderBuckets(n);if(s&&s.byteLength>0){const l=new Uint32Array(s);for(const c of l)this._deleteLayerData(c)}for(const[l,c]of o)this._deleteLayerData(l),c.type===zh.SYMBOL&&(this.symbols.set(l,c.symbols),i=!0),this._memoryUsedByLayerData+=c.memoryUsed,this.layerData.set(l,c);(r=this._memCache)==null||r.updateSize(this.key.id,this,this.memoryUsed)}this._hasSymbolBuckets=!1;for(const[n,s]of this.layerData)s.type===zh.SYMBOL&&(this._hasSymbolBuckets=!0);i&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(i){i.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const i=this.resolution/(e.resolution*e.pixelRatio),r=this.width/this.rangeX*i,n=this.height/this.rangeY*i,s=[0,0];e.toScreen(s,[this.x,this.y]);const o=this.transforms.tileUnitsToPixels;Eoe(o),eU(o,o,s),Coe(o,o,Math.PI*e.rotation/180),Aoe(o,o,[r,n,1])}_createTransforms(){return{dvs:Tc(),tileMat3:Tc(),tileUnitsToPixels:Tc()}}static _destroyRenderBuckets(e){if(!e)return;const i=new Set;for(const r of e.values())i.has(r)||(r.destroy(),i.add(r));e.clear()}_createRenderBuckets(e){const i=new Map,r=new Map;for(const n of e){const s=this._deserializeBucket(n,r);for(const o of s.layerUIDs)i.set(o,s)}return i}_deserializeBucket(e,i){let r=i.get(e);if(r)return r;switch(new Uint32Array(e)[0]){case zh.FILL:r=new _It(e,this.styleRepository);break;case zh.LINE:r=new vIt(e,this.styleRepository);break;case zh.SYMBOL:r=new bIt(e,this.styleRepository,this);break;case zh.CIRCLE:r=new wIt(e,this.styleRepository)}return i.set(e,r),r}_deleteLayerData(e){if(!this.layerData.has(e))return;const i=this.layerData.get(e);this._memoryUsedByLayerData-=i.memoryUsed,i.destroy(),this.layerData.delete(e)}};const sFe=new Map;function TIt(){sFe.forEach((t,e)=>{console.log(` +${e.key}:`),t[0].forEach(i=>console.log(i)),console.log("========"),t[1].forEach(i=>console.log(i))})}const hdi={value:.5,readOnly:!0},EIt={readOnly:!0,value:.5,get(){return this.updating?this.updatingProgressValue:1}};let BM=class{constructor(e=0,i=0){this.min=e,this.max=i,this.level=0,this.hasNoDataValues=!1}copyFrom(e){this.min=e.min,this.max=e.max,this.level=e.level,this.hasNoDataValues=e.hasNoDataValues}},oFe=class{constructor(e,i){this.data=e,this.safeWidth=.99999999*(e.width-1),this.dx=(e.width-1)/(i[2]-i[0]),this.dy=(e.width-1)/(i[3]-i[1]),this.x0=i[0],this.y1=i[3]}},CIt=class{constructor(e,i,r){this.type="elevation",this.level=e[0],this.i=e[1],this.j=e[2],this.extent=i,this.samplerData=new oFe(r,i)}computeMinMaxValue(e,i,r,n){n.min=1/0,n.max=-1/0,n.hasNoDataValues=!1;const s=e-this.level;if(s<=0)return n;const o=2**s;if(!(Math.floor(i/o)===this.i&&Math.floor(r/o)===this.j))return n;let l=1/0,c=-1/0;const f=this.samplerData.data.width,_=this.samplerData.data.values,x=.5*EL;let T=(f-1)/o,A=(r-this.j*o)*T,M=(i-this.i*o)*T;if(T<1){const I=Math.floor(A),L=Math.floor(M),F=I+L*f,z=_[F],k=_[F+1],U=_[F+f],j=_[F+f+1];if(z+k+U+jthis.notifyChange("stencilEnabledExtents"))])}destroy(){}get layerViewsExtent(){return this._computeLayerViewsExtent()}get tiledLayersExtent(){return this._computeTiledLayersExtent()}get stencilEnabledExtents(){return this._computeStencilEnabledExtents()}_computeStencilEnabledExtents(){const e=[];return this.layerViews.forEach(i=>{const r=i.layer;if(r.operationalLayerType==="IntegratedMeshLayer"&&this.viewSpatialReference!=null){const n=aFe(r.fullExtent,this.viewSpatialReference);n!=null&&e.push(ase(n))}}),e}};function MIt(t,e){return t===_t.Global?new Lie(e):new Die(e)}y([w({readOnly:!0})],nf.prototype,"layerViewsExtent",null),y([w({readOnly:!0})],nf.prototype,"tiledLayersExtent",null),y([w({readOnly:!0})],nf.prototype,"stencilEnabledExtents",null),y([w()],nf.prototype,"viewSpatialReference",void 0),y([w()],nf.prototype,"tilingScheme",void 0),y([w()],nf.prototype,"defaultTiledLayersExtent",void 0),y([w({constructOnly:!0})],nf.prototype,"layers",void 0),y([w({constructOnly:!0})],nf.prototype,"layerViews",void 0),nf=y([Z("esri.views.3d.terrain.ExtentHelper")],nf);let Lie=class extends nf{_computeLayerViewsExtent(){return this._globalExtent}_computeTiledLayersExtent(){return this._globalExtent}get _globalExtent(){return this.viewSpatialReference.isWebMercator?yIe:X0t}};Lie=y([Z("esri.views.3d.terrain.ExtentHelperGlobal")],Lie);let Die=class extends nf{_computeLayerViewsExtent(){const e=od(),i=this.viewSpatialReference;this.layerViews.forEach(s=>{const o=s.layer;if(s.isResolved()&&(o.type!=="graphics"||!o.internal)){const l=aFe("fullExtentInLocalViewSpatialReference"in s&&s.fullExtentInLocalViewSpatialReference||s.layer.fullExtent,i);g2(e,l,e)}});const r=qZ(e)?e:null,n=this._get("layerViewsExtent");return uT(r,n)?n:r}_computeTiledLayersExtent(){const e=this.tilingScheme;if(!e)return null;const i=this.viewSpatialReference,r=od();this.layers.forEach(o=>{if(o.loaded&&oO(o)){const l=SG(o,i,_t.Local);if(l==null)return;const{tileInfo:c,fullExtent:f}=l;c!=null&&f!=null&&(aV(o)||e.compatibleWith(c)&&f.spatialReference.equals(e.spatialReference))&&g2(r,f,r)}}),g2(r,this.defaultTiledLayersExtent,r);const n=qZ(r)?r:null,s=this._get("tiledLayersExtent");return uT(n,s)?s:n}};function aFe(t,e){return t==null||t.spatialReference.equals(e)?t:o$(t,t.spatialReference,e)}Die=y([Z("esri.views.3d.terrain.ExtentHelperLocal")],Die);var Yi;(function(t){t[t.ELEVATION=0]="ELEVATION",t[t.MAP=1]="MAP"})(Yi||(Yi={}));const rS=[Yi.ELEVATION,Yi.MAP];function lFe(){var e;const t=(e=globalThis.require)==null?void 0:e.modules;if(t){const i=Object.keys(t);for(const r of i)r.includes(".glsl")&&delete t[r]}}const cFe=1.3,OIt=[[-.1,-2,3.9,2],[-.1,-3.9,3.9,.1],[-2,-3.9,2,.1],[-3.9,-3.9,.1,.1],[-3.9,-2,.1,2],[-3.9,-.1,.1,3.9],[-2,-.1,2,3.9],[-.1,-.1,3.9,3.9]];let Pb,Ou=class extends ze{get running(){return this._placementDirty&&(this._drapeSources.size>0||this.view.graphics.length>0||Tn.OVERLAY_DRAW_DEBUG_TEXTURE)&&!!this._spatialReference&&!this.suspended&&this.surface.ready}get _isSpherical(){return this.view.state.isGlobal}get _worldToPCSRatio(){return this._spatialReference!=null&&this._spatialReference.isGeographic&&!this.view.state.isLocal?Sr(this._spatialReference).metersPerDegree:1}get _overlayStretch(){return cFe/this.view.resolutionScale}get suspended(){return this.surface.suspended}get updating(){return this.running||this.renderer.updating||this._contentUpdated}get rendersOccluded(){return this.renderer.rendersOccluded}constructor(e){super(e),this._spatialReference=null,this._renderSR=null,this._overlaySREqualsRenderSR=!0,this._drapeSources=new Set,this._drapeTargets=new Set,this._placementDirty=!1,this._contentUpdated=!1,this._drawTexturesDirty=!1,this._drawTexturesAnimateDirty=!1,this._longitudeCyclical=null,this._latestOriginId=0,this._maxResolution=Le("esri-mobile")?2048:4096,this._animationTimeLast=0}initialize(){const e=this.view;this.renderer=new k0({view:e,worldToPCSRatio:this._worldToPCSRatio,spatialReference:this._spatialReference}),e._stage.renderer.renderPlugins.add(this.renderer);const i=()=>this.setDrawTexturesDirty();this._groundIntersector=Tp(this.view.state.viewingMode),this._groundIntersector.options.backfacesTerrain=!0,this._groundIntersector.options.invisibleTerrain=!0,this._groundIntersector.options.hud=!1,this.addHandles([_e(()=>this.renderer.hasHighlights,i),this.renderer.events.on("has-water",r=>{var n;return(n=e._stage)==null?void 0:n.renderer.setParameters({hasOverlayWater:r})}),this.renderer.events.on("renders-occluded",()=>{i(),this.notifyChange("rendersOccluded")}),this.renderer.events.on("content-changed",i),_e(()=>e.state.camera.pixelRatio,i),_e(()=>e.state.alignPixelEnabled,i),this.renderer.events.on("textures-disposed",()=>this.surface.requestRender()),_e(()=>{var r,n,s;return[(r=e.pointsOfInterest)==null?void 0:r.renderPointOfView,(s=(n=e.pointsOfInterest)==null?void 0:n.centerOnSurfaceFrequent)==null?void 0:s.location]},()=>this.setPlacementDirty()),_e(()=>{var r,n;return[(r=e.state)==null?void 0:r.pixelRatio,(n=e.state)==null?void 0:n.contentPixelRatio]},()=>this.setPlacementDirty(),Li),this.surface.on("elevation-change",()=>this.setPlacementDirty()),e.on("resize",()=>this.setPlacementDirty()),e.resourceController.scheduler.registerTask(ni.OVERLAY,this),e._stage.renderView.events.on("force-camera-for-screenshot",r=>{this._updateOverlays(ou,r.camera,no.BACKGROUND),this.renderer.hasOverlays&&this._drawOverlays(no.BACKGROUND,r)})]),e._stage.renderer.renderOverlay=r=>this._renderOverlay(r)}_renderOverlay(e){if(this._contentUpdated=!1,this.renderer.processSyncDrapeSources(),this.renderer.hasOverlays)return this._dispatchAnimationUpdate(e),this._drawOverlays(no.UPDATE,this.view.state)}destroy(){var e;(e=this.view)!=null&&e._stage&&(this.view._stage.renderer.renderPlugins.remove(this.renderer),this.view._stage.renderer.renderOverlay=()=>{}),Pb&&(Pb.hide(),Pb=null)}get hasOverlays(){return this.renderer.hasOverlays}setSpatialReference(e){this._spatialReference=e,this.renderer.spatialReference=e,this._longitudeCyclical=null;const i=this.view.renderSpatialReference;e!=null&&i!=null?(this._renderSR=i,this._overlaySREqualsRenderSR=e.equals(this._renderSR),this._isSpherical&&(this._longitudeCyclical=e.isWebMercator?new F2(-20037508342787e-6,20037508342787e-6):new F2(-180,180),this.renderer.longitudeCyclical=this._longitudeCyclical),this.renderer&&(this.renderer.worldToPCSRatio=this._worldToPCSRatio)):this.renderer.disposeOverlays()}registerDrapeSource(e,i,r){this._drapeSources.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources);const n=this.renderer.createDrapeSourceRenderer(e,i,r);return this._updateDrapeSourceExtent(e),this._setContentDirty(),this.notifyChange("running"),n}registerGeometryDrapeSource(e){return this.registerDrapeSource(e,Bd)}_updateDrapeSourceExtent(e){this.renderer.overlays.length===2&&e.setDrapingExtent!=null&&this._spatialReference!=null&&e.setDrapingExtent(this.renderer.overlays,this._spatialReference)}unregisterDrapeSource(e){this._drapeSources.has(e)&&(this._drapeSources.delete(e),this.renderer.removeDrapeSourceRenderer(e),this.renderer.ensureDrapeSources(this._drapeSources),this._setContentDirty(),this.notifyChange("running"))}registerDrapeTarget(e){this._drapeTargets.add(e),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources)}unregisterDrapeTarget(e){this._drapeTargets.delete(e),this.renderer.ensureDrapeTargets(this._drapeTargets)}_setContentDirty(){this.setPlacementDirty(),this.setDrawTexturesDirty()}setPlacementDirty(){this._placementDirty=!0}runTask(e){return this._updateOverlays(e,this.view.state.contentCamera,no.UPDATE)}_updateOverlays(e,i,r){if(!this._spatialReference)return Xl.YIELD;const n=this._computeOverlayResolution(i);this._computeOverlayExtents(i,n,dg),this.renderer.ensureOverlays(this._drapeTargets,this._drapeSources,dg.stretch);const s=this._updateOverlay(ko.INNER,dg.inner,n,1*dg.pixelRatioAdjustment,dg.mapUnitsPerPixel),o=_c(dg.inner)/_c(dg.outer),l=this._updateOverlay(ko.OUTER,dg.outer,n,o*dg.pixelRatioAdjustment,dg.mapUnitsPerPixel);s!==Zg.EXTENT&&l!==Zg.EXTENT||(this._drapeSources.forEach(c=>this._updateDrapeSourceExtent(c)),this.surface.updateTileOverlayParams(r)),s===Zg.NONE&&l===Zg.NONE||this.setDrawTexturesDirty(),this._placementDirty=!1,e.madeProgress()}_computeOverlayResolution(e){const i=this.view.state.contentPixelRatio*this.view.resolutionScale,r=e.fullWidth/e.pixelRatio*i,n=e.fullHeight/e.pixelRatio*i,s=Math.ceil(1.5*Math.max(r,n));return Math.min(yT(s),this._maxResolution)}_updateOverlay(e,i,r,n,s){if(this.renderer.overlays.length===0)return Zg.NONE;const o=this.renderer.overlays[e],l=o.mapUnitsPerPixel;if(o.mapUnitsPerPixel=s,o.pixelRatio=n,PIt(i,o.extent)&&r===o.resolution)return l===s?Zg.NONE:Zg.RERENDER_ONLY;d_(o.extent,i),o.resolution=r;const c=lse(o.extent);return o.renderLocalOrigin=HU(c[0],c[1],0,"OV_"+this._latestOriginId++),Zg.EXTENT}setTileParameters(e){const i=e.renderData.overlay;if(this.renderer.overlays.length>0){const r=this.renderer.overlays[ko.INNER],n=this.renderer.overlays[ko.OUTER],s=e.extent;this._rectInsideRect(r.extent,s)||this._rectanglesOverlap(s,r.extent)||this._rectanglesOverlap(s,n.extent)?(this._setTileOverlayData(s,ko.INNER,i),this._setTileOverlayData(s,ko.OUTER,i)):(this._clearTileOverlayData(ko.INNER,i),this._clearTileOverlayData(ko.OUTER,i))}else this._clearTileOverlayData(ko.INNER,i),this._clearTileOverlayData(ko.OUTER,i)}overlayPixelSizeInMapUnits(e,i){if(this.renderer.overlays.length===0)return i();const r=this.renderer.overlays[ko.INNER],n=this.renderer.overlays[ko.OUTER],s=this._pointIsInExtent(e,r.extent)?r:n;return(s.extent[2]-s.extent[0])/s.resolution}_setTileOverlayData(e,i,r){if(this.renderer.overlays.length===0)return;const n=this.renderer.overlays[i].extent,s=_c(n),o=qu(n);let l=e[0];if(this._longitudeCyclical){l=this._longitudeCyclical.minimalMonotonic(n[0],l);const c=this._longitudeCyclical.minimalMonotonic(n[0],e[2]);l>c&&(l=c-(e[2]-e[0]))}r.setScale(i,_c(e)/s,qu(e)/o),r.setOffset(i,(l-n[0])/s,(e[1]-n[1])/o)}_clearTileOverlayData(e,i){i.setScale(e,-1,-1),i.setOffset(e,-1,-1)}async reloadShaders(){lFe(),await this.renderer.reloadShaders(),this.setDrawTexturesDirty(),this.runTask(ou)}_dispatchAnimationUpdate(e){const i=e-this._animationTimeLast;if(i>=this.surface.view._stage.renderer.animationTimestep||this.view.state.forcedAnimationTime!=null||this._drawTexturesDirty||this._drawTexturesAnimateDirty){const r=i/this.surface.view._stage.renderer.animationTimeDilation,n=new K9e(this.view.state.camera,r,this.view.state.forcedAnimationTime);this.renderer.updateAnimation(n)&&(this._drawTexturesAnimateDirty=!0),this._animationTimeLast=e}}setDrawTexturesDirty(){this.renderer.hasOverlays?(this._contentUpdated=!0,this._drawTexturesDirty=!0,this.view._stage.renderView.requestRender()):this.setPlacementDirty()}_intersectGroundFromView(e,i,r,n){const s=this.view.sceneIntersectionHelper.getCenterRayWithSubpixelOffset(e,LIt,i,r);if(s==null)return!1;const o=s.origin,l=Be(h8,s.origin,s.direction);return this._groundIntersector.reset(o,l,e),this._groundIntersector.intersect([]),this.view.basemapTerrain.intersect(this._groundIntersector,null,o,l),this._groundIntersector.results.min.getIntersectionPoint(n)}_findHorizonBasedPointOfInterest(e,i){let r=.5;const n=.55,s=this.view.renderCoordsHelper.getAltitude(e.eye),o=this.view.pointsOfInterest.centerOnSurfaceFrequent,l=1e-5,c=Je(o.estimatedSurfaceAltitude,e.aboveGround?-1/0:s+l,e.aboveGround?s-l:1/0),f=e.aboveGround;if(this.view.viewingMode==="global"){const _=h8;gP(aj(cj,Sr(this.view.spatialReference).radius+c),Sp(e.eye,e.viewForward),_),je(_,_,e.eye);const x=k2.normalize(KPe(e.viewForward,_,e.viewRight))/e.fovY+.5,T=x<=0||x>=1?.5:n;r=f?T*x:x+T*(1-x)}else{const _=.5*Math.PI-Math.acos(-e.viewForward[2]),x=Math.tan(_),T=Mi(0,x,1,0),A=lp(T,T,e.projectionMatrix)[1],M=Je(.5+.5*A,0,1);r=M===1||M===0?.5:f?M*n:1-(1-M)*n}return!!this._intersectGroundFromView(e,.5,r,i)&&vB(i,e.eye)=I&&(A=I,s[1]=0,this._spatialReference.isWebMercator&&(s[0]=0)));let L=1;M&&(L=1/Math.max(.2,Math.cos(Math.abs(Ei(s[1])))),A*L>180&&(L=180/A),r.mapUnitsPerPixel*=L);const F=Math.log(2)/12;A=Math.exp(Math.round(Math.log(A)/F)*F);const z=A*L,k=32,U=.5*i/(k*z),j=.5*i/(k*A);s[0]=Math.round(s[0]*U)/U,s[1]=Math.round(s[1]*j)/j;const H=r.inner;H[0]=s[0]-z,H[1]=s[1]-A,H[2]=s[0]+z,H[3]=s[1]+A,this._isSpherical&&this._shiftExtentToFitBounds(H,1/0,I);const Y=r.outer;if(6*z>_c(c))d_(Y,c);else if(Math.PI/2-Math.abs(l-Math.PI/2)<=.25*Math.PI)Y[0]=H[0]-z,Y[1]=H[1]-A,Y[2]=H[2]+z,Y[3]=H[3]+A;else{el(e.eye,this._renderSR,h8,this._spatialReference),Ps(Zx,s,h8);let ne=-Math.atan2(Zx[1],Zx[0])+.125*Math.PI;ne<0&&(ne+=2*Math.PI);const re=Math.floor(ne/(.25*Math.PI));UT(Zx,OIt[re],2*A),Zx[0]*=L,Zx[2]*=L,rse(Y,H,Zx)}if(this._isSpherical)Y[0]=this._longitudeCyclical.clamp(Y[0]),Y[2]=this._longitudeCyclical.clamp(Y[2]),Y[1]=Math.max(Y[1],-I),Y[3]=Math.min(Y[3],I);else{const ne=WZ(H,c,IIt),re=WZ(Y,c,$It);Nz(ne,re)&&(Y[2]=Y[0],Y[3]=Y[1])}const Q=Math.abs(H[2]-H[0])/i;r.mapUnitsPerPixel=Math.max(r.mapUnitsPerPixel,Q),r.pixelRatioAdjustment=r.mapUnitsPerPixel/Q}_drawOverlays(e,i){if(!this.renderer.hasOverlays)return;if(!this._drawTexturesDirty&&!this._drawTexturesAnimateDirty)return this.renderer;const r=this._drawTexturesDirty;this._drawTexturesDirty=this._drawTexturesAnimateDirty=!1;const n=this.renderer.computeValidity();return this.renderer.releaseRenderTargets(),this.renderer.drawOverlays(i),n!==this.renderer.computeValidity()&&this.surface.updateTileOverlayParams(no.UPDATE),r?(this.surface.requestRender(e),e===no.UPDATE&&this.surface.requestUpdate()):this.surface.requestRender(no.BACKGROUND),this.renderer}_rectanglesOverlap(e,i){return e!=null&&(this._longitudeCyclical?(this._longitudeCyclical.contains(i[0],i[2],e[0])||this._longitudeCyclical.contains(i[0],i[2],e[2])||this._longitudeCyclical.contains(e[0],e[2],i[0]))&&!(e[1]>i[3]||e[3]e[1]&&i[3]=i[1]&&e.y<=i[3];const r=e.x,n=e.y;return r>i[0]&&ri[1]&&ni&&(n=i-e[2]),e[1]<-r?s=e[1]+r:e[3]>r&&(s=r-e[3]),Fz(e,n,s)}get test(){return{renderer:this.renderer,update:()=>this.runTask(ou)}}};function PIt(t,e){const r=Tn.TESTS_DISABLE_OPTIMIZATIONS?0:1e-5*Math.max(t[2]-t[0],t[3]-t[1],e[2]-e[0],e[3]-e[1]);return Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r}y([w()],Ou.prototype,"_spatialReference",void 0),y([w({readOnly:!0})],Ou.prototype,"running",null),y([w()],Ou.prototype,"_placementDirty",void 0),y([w()],Ou.prototype,"_contentUpdated",void 0),y([w()],Ou.prototype,"_isSpherical",null),y([w()],Ou.prototype,"_worldToPCSRatio",null),y([w({autoDestroy:!0})],Ou.prototype,"renderer",void 0),y([w({constructOnly:!0})],Ou.prototype,"view",void 0),y([w({constructOnly:!0})],Ou.prototype,"surface",void 0),y([w()],Ou.prototype,"suspended",null),y([w()],Ou.prototype,"updating",null),y([w({type:Boolean})],Ou.prototype,"rendersOccluded",null),Ou=y([Z("esri.views.3d.terrain.OverlayManager")],Ou);let RIt=class{constructor(){this.inner=Ni(),this.outer=Ni(),this.mapUnitsPerPixel=0,this.pixelRatioAdjustment=1,this.stretch=cFe}};const Zx=Xi(),h8=W(),dg=new RIt,IIt=Ni(),$It=Ni(),LIt=Ko();var Zg;(function(t){t[t.NONE=0]="NONE",t[t.EXTENT=1]="EXTENT",t[t.RERENDER_ONLY=2]="RERENDER_ONLY"})(Zg||(Zg={}));let DIt=class{constructor(){this.indices=null,this.vertexAttributes=null,this.boundingBox=Bn(),this.indexCount=0,this.numVerticesPerSide=0,this.uvRange=[0,0,1,1],this.outerEdges=[null,null,null,null],this.innerEdges=[null,null,null,null]}release(){this.vertexAttributes=ir(this.vertexAttributes),this.indices=null}},__e=class{constructor(e,i,r,n,s){this.attributes=e,this.localOrigin=i,this.index0=r,this.stride=n,this.count=s}getVertexIndex(e){return this.getAttributeIndex(e)}getAttributeIndex(e){return ot(0<=e&&er[3]&&(r[3]=t),er[4]&&(r[4]=e),ir[5]&&(r[5]=i)}let NIt=class{constructor(){this.sinLonLUT=new Array(X4+1),this.cosLonLUT=new Array(X4+1),this.sinLatLUT=new Array(X4+1),this.cosLatLUT=new Array(X4+1)}update(e,i,r){const n=i[0],s=i[2];for(let o=0;o<=e;o++){const l=o/e,c=n*(1-l)+s*l;this.sinLonLUT[o]=Math.sin(c),this.cosLonLUT[o]=Math.cos(c);const f=r(l);this.sinLatLUT[o]=Math.sin(f),this.cosLatLUT[o]=Math.cos(f)}}},d8=class{constructor(){this.cornerTiles=[null,null,null,null],this.cornerTileSamplerVersions=[-1,-1,-1,-1]}},FIt=class{constructor(){this.cornerNeighborData=[new d8,new d8,new d8,new d8],this.edgeResolutions=[-1,-1,-1,-1],this.edgePeerNeighbors=[null,null,null,null],this.edgePeerNeighborSamplerVersions=[-1,-1,-1,-1],this.cornerPeerNeighbors=[null,null,null,null]}},kIt=class{constructor(){this.numVerticesPerSide=0,this.samplerData=null,this.clippingArea=null,this.wireframe=!1,this.samplerDataVersion=0,this.neighborData=new FIt}},uFe=class hk{constructor(e){this._getFadeDuration=e,this._fadeStart=0,this._delayedTime=0}clear(){this._current=et(this._current),this._next=et(this._next),this._waiting=et(this._waiting),this._delayed=et(this._delayed)}get current(){if(this._current==null)return null;if(!this._isFadingEnabled){const i=this._delayed||this._waiting||this._next||this._current;i!==this._current&&(this._current=null,this.clear(),this._current=i)}let e=hk.test.fadeMoment;if(this._delayed!=null&&(e=e||performance.now(),e>=this._delayedTime&&(this._push(this._delayed,r_.Immediate),this._delayed=null)),this._next!=null){e=e||performance.now();const i=this._fadeDuration,r=this._current!=null&&this._next.texture===this._current.texture,n=this._next.type!==ua.FADING,s=e-this._fadeStart>=i;(r||n||s)&&(et(this._current),this._current=this._next,this._next=this._waiting,this._waiting=null,this._fadeStart=this._alignFadeStart(e))}return this._current}get next(){return this._next}get fadeFactor(){if(this._next==null)return 1;const e=hk.test.fadeMoment||performance.now(),i=Math.max(0,e-this._fadeStart),r=this._fadeDuration;return i>r?0:1-i/r}get isFading(){return this._next!=null||this._delayed!=null}push(e,i=r_.Immediate){this._delayed=et(this._delayed),this._push(e,i)}_push(e,i){if(this._isFadingEnabled||this.clear(),this._current==null)return void(this._current=e);const r=hk.test.fadeMoment||performance.now();return i!==r_.Immediate?(this._delayed=e,void(this._delayedTime=r+i)):this._next==null?(this._next=e,void(this._fadeStart=this._alignFadeStart(r))):void(e!=null&&(et(this._waiting),this._waiting=e))}get _fadeDuration(){return this._waiting==null?this._getFadeDuration():.5*this._getFadeDuration()}_alignFadeStart(e){const i=this._getFadeDuration();return e+i-e%i}get _isFadingEnabled(){return this._getFadeDuration()>0}};var r_;uFe.test={fadeMoment:0},function(t){t[t.Immediate=0]="Immediate",t[t.Delayed=5e3]="Delayed"}(r_||(r_={}));var D5;(function(t){t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT",t[t.NONE=0]="NONE",t[t.FRONT_TO_BACK=1]="FRONT_TO_BACK"})(D5||(D5={}));let hFe=class{constructor(){this._queue=new Pi,this.remove=()=>{}}get done(){return this._queue.length===0&&(!this._last||this._last.isLeaf)}resetOne(e){this._queue.clear(),this._queue.push(e),this._last=void 0}reset(e=null){this._queue.clear(),e!=null&&this._queue.pushArray(e),this._last=void 0}skipSubtree(){this._last=void 0}next(){var i;const e=(i=this._last)==null?void 0:i.children;return e!=null&&e[0]&&this._queue.pushArray(e),this._last=this._queue.pop(),this._last}},zIt=class{constructor(){this._q=new Pi}get done(){return this._q.length===0}reset(e){if(this._q.clear(),e!=null){this._q.pushArray(e);for(let i=0;ir.xmax||n[3]>r.ymax)return!1}else if(r.xmin>n[2]||r.ymin>n[3]||r.xmax0&&s>1.00000001*o)return!1;const l=e.maxScale;return!(l>0&&s<.99999999*l)}function n_(t,e){const i=t.lij,r=e.lij;return i[0]-r[0]||i[1]-r[1]||i[2]-r[2]}function dFe(t,e,i=null){i==null||i.length===0?t===D5.BACK_TO_FRONT?e.sort(UIt):e.sort(VIt):e.sort((r,n)=>BIt(r,n,t,i))}function UIt(t,e){const i=e.screenDepth-t.screenDepth;if(i!==0)return i;const r=t.lij,n=e.lij;return r[0]-n[0]||r[1]-n[1]||r[2]-n[2]}function VIt(t,e){const i=t.screenDepth-e.screenDepth;if(i!==0)return i;const r=t.lij,n=e.lij;return r[0]-n[0]||r[1]-n[1]||r[2]-n[2]}function pFe(t,e,i){const r=t.screenDepth,n=e.screenDepth;return rn?i:n_(t,e)}function BIt(t,e,i,r){return w_e(t,r)===w_e(e,r)?pFe(t,e,i):t?i:-i}function w_e(t,e){for(const i of e)if(t.intersectsExtent(i))return!0;return!1}function jIt(t,e){const i=t.distanceToPOI-e.distanceToPOI;if(i!==0)return i;const r=t.lij,n=e.lij;return r[0]-n[0]||r[1]-n[1]||r[2]-n[2]}function GIt(t,e){const i=t.length;for(let r=0;r!0;let _=this.tile;const x=_.level;let T;const A=this._tileLayerInfo.upsampleInfo,M=A!=null?A.tile.level:-1,I=A!=null&&M-x>=l,L=n==null?void 0:n.tilemapCache,F=r.type==="vector-tile-3d"?r.schemaHelper:null;for(;_&&f(_,n,!1)&&_.level>=s;){const z=_.level,k=x-z,U=_.layerInfo[i][e];if(U.data&&k>=l){(!I||z>M)&&this._setUpsampleTile(_),U.dataInvalidated&&(T=_);break}const j=(F==null?void 0:F.getLevelRowColumn(_.lij))??_.lij;if((L==null?void 0:L.getAvailability(j[0],j[1],_.lij[2]))!=="unavailable"&&z<=o&&!U.data&&!U.dataMissing&&((!T||_.level===s||z%gIe==0||x-T.level=c))break;_=_.parent}if(T!=null&&x-T.level=i)return n;r=n}return r}_setUpsampleTile(e,i){this._tileLayerInfo.setUpsampleInfo(this.tile,e),this.tile.updateRenderData(this._layerClass,ua.FADING,i)}get test(){return{findNextDownload:()=>this._findNextDownload(),tileLayerInfo:this._tileLayerInfo}}},WIt=class extends Tce{get _desiredMinLevelDelta(){throw x_e}get _progressiveLevelModulo(){throw x_e}dispose(){}};const x_e=new Error("Abstract method called on TileAgent"),hh=new WIt;let fFe=class extends Tce{constructor(){super(...arguments),this._scaleRangeEnabled=!1}get _desiredMinLevelDelta(){return See(this.tile.level)-(this.tile.elevationLevel-this.tile.level)}get _progressiveLevelModulo(){return 0}},mFe=class extends Tce{constructor(){super(),this._scaleRangeEnabled=!0}get _desiredMinLevelDelta(){return 0}get _progressiveLevelModulo(){return gIe}};var ST,rE;(function(t){t[t.Stretch=0]="Stretch",t[t.Lut=1]="Lut",t[t.Hillshade=2]="Hillshade",t[t.COUNT=3]="COUNT"})(ST||(ST={})),function(t){t[t.Noop=0]="Noop",t[t.PerBand=1]="PerBand",t[t.COUNT=2]="COUNT"}(rE||(rE={}));function YIt(t){t.fragment.uniforms.add(new Zt("u_colormap",e=>e.u_colormap),new ft("u_colormapOffset",e=>e.colormap.u_colormapOffset),new ft("u_colormapMaxIndex",e=>e.colormap.u_colormapMaxIndex),new ft("u_opacity",e=>e.common.u_opacity)),t.fragment.code.add(V`vec4 colormap(vec4 currentPixel, bool isFloat) { +float colorIndex = isFloat ? currentPixel.r - u_colormapOffset : currentPixel.r * 255.0 - u_colormapOffset; +vec4 result; +if (currentPixel.a == 0.0 || colorIndex > u_colormapMaxIndex) { +result = vec4(0.0, 0.0, 0.0, 0.0); +} else { +vec2 texelCoordinates = vec2((colorIndex + 0.5), 0.5); +result = texelFetch(u_colormap, ivec2(texelCoordinates), 0); +} +return result; +}`)}function XIt(t){t.fragment.uniforms.add(new Zt("u_transformGrid",e=>e.u_transformGrid),new ln("u_transformSpacing",e=>e.common.u_transformSpacing),new ln("u_targetImageSize",e=>e.common.u_targetImageSize)),t.fragment.code.add(V`vec2 projectPixelLocation(vec2 coords) { +vec2 index_image = floor(coords * u_targetImageSize); +vec2 oneTransformPixel = vec2(4.0, 1.0); +vec2 index_transform = floor(index_image / u_transformSpacing) * oneTransformPixel; +vec2 pos = fract((index_image + 0.5) / u_transformSpacing); +vec2 transform_location = index_transform + 0.5; +vec2 srcLocation; +if (pos.s <= pos.t) { +vec3 ll_abc = texelFetch(u_transformGrid, ivec2(transform_location), 0).rgb; +vec3 ll_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 1.0, transform_location.t), 0).rgb; +srcLocation.s = dot(ll_abc, vec3(pos, 1.0)); +srcLocation.t = dot(ll_def, vec3(pos, 1.0)); +} else { +vec3 ur_abc = texelFetch(u_transformGrid, ivec2(transform_location.s + 2.0, transform_location.t), 0).rgb; +vec3 ur_def = texelFetch(u_transformGrid, ivec2(transform_location.s + 3.0, transform_location.t), 0).rgb; +srcLocation.s = dot(ur_abc, vec3(pos, 1.0)); +srcLocation.t = dot(ur_def, vec3(pos, 1.0)); +} +return srcLocation; +}`)}let gFe=class extends _n{constructor(){super(...arguments),this.scale=1,this.offset=Wy}};function yFe(t){t.attributes.add(J.POSITION,"vec2"),t.attributes.add(J.UV0,"vec2"),t.vertex.uniforms.add(new ft("scale",e=>e.scale)),t.vertex.uniforms.add(new ln("offset",e=>e.offset)),t.varyings.add("uv","vec2"),t.varyings.add("vuv","vec2"),t.vertex.code.add(V`void main(void) { +gl_Position = vec4(position, 0.0, 1.0); +uv = uv0 * scale + offset; +vuv = uv0; +}`)}let ZIt=class extends gFe{constructor(e,i,r){super(),this.common=e,this.u_image=i,this.u_transformGrid=r}};function JIt(t,e){t.include(XIt),t.fragment.uniforms.add(new Zt("u_image",r=>r.u_image),new Oy("u_flipY",r=>r.common.u_flipY),new Oy("u_applyTransform",r=>r.common.u_applyTransform));const{requireBilinearWithNN:i}=e;i&&t.fragment.uniforms.add(new ln("u_srcImageSize",r=>r.common.u_srcImageSize)),t.fragment.code.add(V`vec2 getPixelLocation(vec2 coords) { +vec2 targetLocation = u_flipY ? vec2(coords.s, 1.0 - coords.t) : coords; +if (!u_applyTransform) { +return targetLocation; +} +return projectPixelLocation(targetLocation); +} +bool isOutside(vec2 coords){ +if (coords.t>1.00001 ||coords.t<-0.00001 || coords.s>1.00001 ||coords.s<-0.00001) { +return true; +} else { +return false; +} +}`),i?t.fragment.code.add(V`vec4 sampleBilinear(sampler2D sampler, vec2 coords, vec2 texSize) { +vec2 texelStart = floor(coords * texSize); +vec2 coord0 = texelStart / texSize; +vec2 coord1 = (texelStart + vec2(1.0, 0.0)) / texSize; +vec2 coord2 = (texelStart + vec2(0.0, 1.0)) / texSize; +vec2 coord3 = (texelStart + vec2(1.0, 1.0)) / texSize; +vec4 color0 = texture(sampler, coord0); +vec4 color1 = texture(sampler, coord1); +vec4 color2 = texture(sampler, coord2); +vec4 color3 = texture(sampler, coord3); +vec2 blend = fract(coords * texSize); +vec4 color01 = mix(color0, color1, blend.x); +vec4 color23 = mix(color2, color3, blend.x); +vec4 color = mix(color01, color23, blend.y); +float alpha = floor(color0.a * color1.a * color2.a * color3.a + 0.5); +color = color * alpha + (1.0 - alpha) * texture(sampler, coords); +return color; +} +vec4 getPixel(vec2 pixelLocation) { +return sampleBilinear(u_image, pixelLocation, u_srcImageSize); +}`):t.fragment.code.add(V`vec4 getPixel(vec2 pixelLocation) { +return texture(u_image, pixelLocation); +}`)}var gt;(function(t){t[t.Normal=0]="Normal",t[t.Average=1]="Average",t[t.Lighten=2]="Lighten",t[t.Lighter=3]="Lighter",t[t.Plus=4]="Plus",t[t.Screen=5]="Screen",t[t.ColorDodge=6]="ColorDodge",t[t.Darken=7]="Darken",t[t.Multiply=8]="Multiply",t[t.ColorBurn=9]="ColorBurn",t[t.Overlay=10]="Overlay",t[t.SoftLight=11]="SoftLight",t[t.HardLight=12]="HardLight",t[t.VividLight=13]="VividLight",t[t.Hue=14]="Hue",t[t.Saturation=15]="Saturation",t[t.Luminosity=16]="Luminosity",t[t.Color=17]="Color",t[t.DestinationOver=18]="DestinationOver",t[t.DestinationAtop=19]="DestinationAtop",t[t.DestinationIn=20]="DestinationIn",t[t.DestinationOut=21]="DestinationOut",t[t.SourceAtop=22]="SourceAtop",t[t.SourceIn=23]="SourceIn",t[t.SourceOut=24]="SourceOut",t[t.Xor=25]="Xor",t[t.Difference=26]="Difference",t[t.Exclusion=27]="Exclusion",t[t.Minus=28]="Minus",t[t.Invert=29]="Invert",t[t.Reflect=30]="Reflect",t[t.COUNT=31]="COUNT"})(gt||(gt={}));const Nie={normal:gt.Normal,average:gt.Average,lighten:gt.Lighten,lighter:gt.Lighter,screen:gt.Screen,plus:gt.Plus,"color-dodge":gt.ColorDodge,darken:gt.Darken,multiply:gt.Multiply,"color-burn":gt.ColorBurn,overlay:gt.Overlay,"soft-light":gt.SoftLight,"hard-light":gt.HardLight,"vivid-light":gt.VividLight,hue:gt.Hue,saturation:gt.Saturation,luminosity:gt.Luminosity,color:gt.Color,difference:gt.Difference,exclusion:gt.Exclusion,minus:gt.Minus,invert:gt.Invert,reflect:gt.Reflect,"destination-over":gt.DestinationOver,"destination-atop":gt.DestinationAtop,"destination-in":gt.DestinationIn,"destination-out":gt.DestinationOut,"source-atop":gt.SourceAtop,"source-in":gt.SourceIn,"source-out":gt.SourceOut,xor:gt.Xor};function KIt(t){return t===gt.DestinationOver||t===gt.DestinationAtop||t===gt.DestinationIn||t===gt.DestinationOut||t===gt.SourceAtop||t===gt.SourceIn||t===gt.SourceOut||t===gt.Xor}function Ece(t){t.code.add(V` + float lineFactorAtPosition(float value) { + float pos = value * ${V.float(257)}; + if(pos < 0.5 || pos > ${V.float(257-.5)}) { + return 1.0; + } + + pos = pos + 0.5; + float modulo = mod(pos, 16.0); + return modulo <= 2.0 ? 1.0 - abs(modulo - 1.0) : 0.0; + } + + float lineFactorAtUV(vec2 uv) { + return max(lineFactorAtPosition(uv.x), lineFactorAtPosition(uv.y)); + } + + float lineFactor(vec2 uv) { + vec2 offset = fwidth(uv) * 0.25; + return (lineFactorAtUV(vec2(uv.x + offset.x, uv.y + offset.y)) + + lineFactorAtUV(vec2(uv.x - offset.x, uv.y + offset.y)) + + lineFactorAtUV(vec2(uv.x + offset.x, uv.y - offset.y)) + + lineFactorAtUV(vec2(uv.x - offset.x, uv.y - offset.y))) / 4.0; + } + + vec3 gridColor(vec2 uv) { + float line = lineFactor(uv) * 0.1 + 0.9; + return vec3(1.0, 0.972, 0.918) * line; + }`)}function QIt(t,e){const i=e.blendMode;i!==gt.Normal&&(i===gt.Reflect&&t.code.add(V`float reflectBlend(in float cb, in float cl) { +return (cl == 1.0) ? cl : min(cb * cb / (1.0 - cl), 1.0); +}`),i!==gt.ColorDodge&&i!==gt.VividLight||t.code.add(V`float colorDodge(in float cb, in float cl) { +return (cb == 0.0) ? 0.0 : (cl == 1.0) ? 1.0 : min(1.0, cb / (1.0 - cl)); +}`),i!==gt.ColorBurn&&i!==gt.VividLight||t.code.add(V`float colorBurn(in float cb, in float cl) { +return (cb == 1.0) ? 1.0 : (cl == 0.0) ? 0.0 : 1.0 - min(1.0, (1.0 - cb) / cl); +}`),i===gt.Overlay&&t.code.add(V`float overlay(in float cb, in float cl) { +return (1.0 - step(0.5, cl)) * (1.0 - 2.0 * (1.0 - cl ) * (1.0 - cb)) + step(0.5, cl) * (2.0 * cl * cb); +}`),i===gt.HardLight&&t.code.add(V`float hardLight(in float cb, in float cl) { +return (1.0 - step(0.5, cl)) * (2.0 * cl * cb) + step(0.5, cl) * (1.0 - 2.0 * (1.0 - cl) * (1.0 - cb)); +}`),i===gt.SoftLight&&t.code.add(V`float softLight(in float cb, in float cl) { +if (cl <= 0.5) { +return cb - (1.0 - 2.0 * cl) * cb * (1.0 - cb); +} +if (cb <= 0.25) { +return cb + (2.0 * cl - 1.0) * cb * ((16.0 * cb - 12.0) * cb + 3.0); +} +return cb + (2.0 * cl - 1.0) * (sqrt(cb) - cb); +}`),i===gt.VividLight&&t.code.add(V`float vividLight(in float cb, in float cl) { +return (1.0 - step(0.5, cl)) * colorBurn(cb, 2.0 * cl) + step(0.5, cl) * colorDodge(cb, (2.0 * (cl - 0.5))); +}`),i!==gt.Hue&&i!==gt.Saturation&&i!==gt.Color&&i!==gt.Luminosity||(t.code.add(V`float minv3(in vec3 c) { +return min(min(c.r, c.g), c.b); +} +float maxv3(in vec3 c) { +return max(max(c.r, c.g), c.b); +} +float lumv3(in vec3 c) { +return dot(c, vec3(0.3, 0.59, 0.11)); +} +vec3 clipColor(vec3 color) { +float lum = lumv3(color); +float mincol = minv3(color); +float maxcol = maxv3(color); +if (mincol < 0.0) { +color = lum + ((color - lum) * lum) / (lum - mincol); +} +if (maxcol > 1.0) { +color = lum + ((color - lum) * (1.0 - lum)) / (maxcol - lum); +} +return color; +} +vec3 setLum(vec3 cbase, vec3 clum) { +return clipColor(cbase + vec3(lumv3(clum) - lumv3(cbase))); +}`),i!==gt.Hue&&i!==gt.Saturation||t.code.add(V`float satv3(vec3 c) { +return maxv3(c) - minv3(c); +} +vec3 setLumSat(vec3 cbase, vec3 csat, vec3 clum) +{ +float minbase = minv3(cbase); +float sbase = satv3(cbase); +float ssat = satv3(csat); +return setLum(sbase > 0.0 ? (cbase - minbase) * ssat / sbase : vec3(0.0), clum); +}`)),t.code.add(V` + vec4 applyBlendMode(vec3 cl, float ol, vec3 cb, float ob) { + ${i===gt.Multiply?V`return vec4(cl * ol * cb * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Average?V`return vec4((cb + cl) * 0.5 * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Lighten?V`return vec4(max(cb, cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Darken?V`return vec4(min(cl, cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Lighter?V`return vec4(cl * ol + cb * ob, ol + ob);`:i===gt.Plus?V`return clamp(vec4(cl.rgb + cb.rgb, ol + ob), 0.0, 1.0);`:i===gt.Minus?V`return vec4(clamp(vec3(cb.rgb - cl.rgb), 0.0, 1.0), ob * ol);`:i===gt.Screen?V`return vec4((cl + cb - cl * cb) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Difference?V`return vec4(abs(cb - cl) * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Invert?V`return vec4((1.0 - cb) * ol * ob + cb * ob * (1.0 - ol), ob);`:i===gt.DestinationOver?V`return vec4(cl * ol * (1.0 - ob) + cb * ob, ol + ob - ol * ob);`:i===gt.DestinationAtop?V`return vec4(cl * ol * (1.0 - ob) + cb * ob * ol, ol);`:i===gt.DestinationOut?V`return vec4(cb * ob * (1.0 - ol), ob * (1.0 - ol));`:i===gt.SourceAtop?V`return vec4(cl * ol * ob + cb * ob * (1.0 - ol), ob);`:i===gt.SourceOut?V`return vec4(cl * ol * (1.0 - ob), ol * (1.0 - ob));`:i===gt.Xor?V`return vec4(cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), ol * (1.0 - ob) + ob * (1.0 - ol));`:i===gt.DestinationIn?V`return vec4(cb * ob * ol, ol * ob);`:i===gt.SourceIn?V`return vec4(cl * ol * ob, ol * ob);`:i===gt.Hue?V` + vec3 f = setLumSat(cl, cb, cb); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Saturation?V` + vec3 f = setLumSat(cb, cl, cb); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Color?V` + vec3 f = setLum(cl, cb); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Luminosity?V` + vec3 f = setLum(cb, cl); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Exclusion?V` + vec3 f = cl + cb - 2.0 * cl * cb; + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Reflect?V` + vec3 f = vec3(reflectBlend(cb.r, cl.r), reflectBlend(cb.g, cl.g), reflectBlend(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.ColorDodge?V` + vec3 f = vec3(colorDodge(cb.r, cl.r), colorDodge(cb.g, cl.g), colorDodge(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.ColorBurn?V` + vec3 f = vec3(colorBurn(cb.r, cl.r), colorBurn(cb.g, cl.g), colorBurn(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.Overlay?V` + vec3 f = vec3(overlay(cb.r, cl.r), overlay(cb.g, cl.g), overlay(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.SoftLight?V` + vec3 f = vec3(softLight(cb.r, cl.r), softLight(cb.g, cl.g), softLight(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.HardLight?V` + vec3 f = vec3(hardLight(cb.r, cl.r), hardLight(cb.g, cl.g), hardLight(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:i===gt.VividLight?V` + vec3 f = vec3(vividLight(cb.r, cl.r), vividLight(cb.g, cl.g), vividLight(cb.b, cl.b)); + return vec4(f * ol * ob + cl * ol * (1.0 - ob) + cb * ob * (1.0 - ol), mix(ob, 1.0, ol));`:V``} + } + `))}var Jo,up,am;(function(t){t[t.Composite=0]="Composite",t[t.ColorComposite=1]="ColorComposite",t[t.GridComposite=2]="GridComposite",t[t.GroupBackgroundComposite=3]="GroupBackgroundComposite",t[t.COUNT=4]="COUNT"})(Jo||(Jo={})),function(t){t[t.NotRequired=0]="NotRequired",t[t.Required=1]="Required",t[t.COUNT=2]="COUNT"}(up||(up={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On",t[t.COUNT=2]="COUNT"}(am||(am={}));function vFe(t,e){const i=e.output===Jo.GridComposite,r=e.output===Jo.ColorComposite,n=e.output===Jo.GroupBackgroundComposite,s=e.output===Jo.Composite;i&&t.fragment.include(Ece),r&&t.fragment.uniforms.add(new Oi("backgroundColor",f=>f.backgroundColor));const o=e.baseOpacityMode===up.Required;o&&t.fragment.uniforms.add(new ft("baseOpacity",f=>f.baseOpacity)),s&&t.fragment.uniforms.add(new Zt("fboColor",f=>f.fboTexture));const l=e.blendMode!==gt.Normal,c=e.premultipliedSource===am.On;t.fragment.include(QIt,e),t.fragment.code.add(V` + vec4 getBackground(vec2 uv) { + return ${o?V`baseOpacity *`:""} ${n?V`vec4(0.0, 0.0, 0.0, 0.0)`:r?V`vec4(backgroundColor, 1.0)`:i?V`vec4(gridColor(uv), 1.0)`:V`texelFetch(fboColor, ivec2(gl_FragCoord.xy), 0)`}; + } + + vec4 blendLayers(vec4 bgColor, vec4 colorLayer, float opacity) { + ${l?V` + vec3 cl = colorLayer.a == 0.0 ? colorLayer.rgb : colorLayer.rgb / colorLayer.a; + vec3 cb = bgColor.a == 0.0 ? bgColor.rgb : bgColor.rgb / bgColor.a; + return applyBlendMode(clamp(cl, vec3(0.0), vec3(1.0)), colorLayer.a * opacity, cb, bgColor.a);`:V` + float composeAlpha = colorLayer.a * opacity; + return ${!c&&(s&&!o||n)?V`colorLayer * opacity;`:V`bgColor * (1.0 - composeAlpha) + colorLayer * opacity;`}`} + }`)}let p6=class extends ZIt{constructor(e,i,r,n,s,o){super(e,n,s),this.colormap=i,this.symbolizer=r,this.u_colormap=o,this.backgroundColor=Ka,this.fboTexture=null,this.baseOpacity=1}},_Fe=class extends p6{},bFe=class extends p6{};function wFe(t){const e=new Cr;return e.include(yFe),e.include(JIt,t),e.include(YIt,t),e.include(vFe,t),e.fragment.code.add(V`vec4 applyBackgroundBlend(vec4 layerColor) { +vec4 bgColor = getBackground(vuv); +return blendLayers(bgColor, layerColor, u_opacity); +}`),t.colorizerType===ST.Stretch?t$t(e,t):t.colorizerType===ST.Lut?e$t(e):t.colorizerType===ST.Hillshade&&i$t(e,t),e}function e$t(t){t.fragment.code.add(V`void main() { +vec2 pixelLocation = getPixelLocation(uv); +if (isOutside(pixelLocation)) { +fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); +return; +} +vec4 currentPixel = getPixel(pixelLocation); +fragColor = applyBackgroundBlend(colormap(currentPixel, true)); +}`)}function t$t(t,e){t.fragment.uniforms.add(new s6("u_bandCount",r=>r.symbolizer.u_bandCount),new Hu("u_minCutOff",r=>r.symbolizer.u_minCutOff,3),new Hu("u_maxCutOff",r=>r.symbolizer.u_maxCutOff,3),new Hu("u_factor",r=>r.symbolizer.u_factor,3),new ft("u_minOutput",r=>r.symbolizer.u_minOutput),new ft("u_maxOutput",r=>r.symbolizer.u_maxOutput),new Oy("u_useGamma",r=>r.symbolizer.u_useGamma),new Hu("u_gamma",r=>r.symbolizer.u_gamma,3),new Hu("u_gammaCorrection",r=>r.symbolizer.u_gammaCorrection,3),new ft("u_opacity",r=>r.common.u_opacity)),t.fragment.code.add(V`float stretchOneValue(float val, float minCutOff, float maxCutOff, float minOutput, float maxOutput, float factor, bool useGamma, float gamma, float gammaCorrection) { +if (val >= maxCutOff) { +return maxOutput; +} else if (val <= minCutOff) { +return minOutput; +} +float stretchedVal; +if (useGamma) { +float tempf = 1.0; +float outRange = maxOutput - minOutput; +float relativeVal = (val - minCutOff) / (maxCutOff - minCutOff); +if (gamma > 1.0) { +tempf -= pow(1.0 / outRange, relativeVal * gammaCorrection); +} +stretchedVal = (tempf * outRange * pow(relativeVal, 1.0 / gamma) + minOutput) / 255.0; +} else { +stretchedVal = minOutput + (val - minCutOff) * factor; +} +return stretchedVal; +}`);const i=e.applyColormap?V`fragColor = applyBackgroundBlend(colormap(vec4(grayVal, grayVal, grayVal, currentPixel.a), !u_useGamma));`:V`fragColor = applyBackgroundBlend(vec4(grayVal, grayVal, grayVal, currentPixel.a));`;t.fragment.code.add(V` + void main() { + vec2 pixelLocation = getPixelLocation(uv); + if (isOutside(pixelLocation)) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + + vec4 currentPixel = getPixel(pixelLocation); + ${e.stretchType===rE.Noop?V` + fragColor = applyBackgroundBlend(currentPixel);`:V` + if (currentPixel.a == 0.0) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + if (u_bandCount == 1) { + float grayVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); + ${i} + } else { + float redVal = stretchOneValue(currentPixel.r, u_minCutOff[0], u_maxCutOff[0], u_minOutput, u_maxOutput, u_factor[0], u_useGamma, u_gamma[0], u_gammaCorrection[0]); + float greenVal = stretchOneValue(currentPixel.g, u_minCutOff[1], u_maxCutOff[1], u_minOutput, u_maxOutput, u_factor[1], u_useGamma, u_gamma[1], u_gammaCorrection[1]); + float blueVal = stretchOneValue(currentPixel.b, u_minCutOff[2], u_maxCutOff[2], u_minOutput, u_maxOutput, u_factor[2], u_useGamma, u_gamma[2], u_gammaCorrection[2]); + fragColor = applyBackgroundBlend(vec4(redVal, greenVal, blueVal, currentPixel.a)); + }`} + }`)}function i$t(t,e){const i=t.fragment;i.uniforms.add(new Zt("u_image",n=>n.u_image),new s6("u_hillshadeType",n=>n.symbolizer.u_hillshadeType),new Hu("u_sinZcosAs",n=>n.symbolizer.u_sinZcosAs,6),new Hu("u_sinZsinAs",n=>n.symbolizer.u_sinZsinAs,6),new Hu("u_cosZs",n=>n.symbolizer.u_cosZs,6),new Hu("u_weights",n=>n.symbolizer.u_weights,6),new ln("u_factor",n=>n.symbolizer.u_factor),new ft("u_minValue",n=>n.symbolizer.u_minValue),new ft("u_maxValue",n=>n.symbolizer.u_maxValue),new ln("u_srcImageSize",n=>n.common.u_srcImageSize)),i.include(h1),i.code.add(V`vec4 overlay(float val, float minValue, float maxValue, float hillshade, float alpha) { +val = clamp((val - minValue) / (maxValue - minValue), 0.0, 1.0); +vec4 color = colormap(vec4(val, val, val, 1.0), false); +vec3 hsv = rgb2hsv(color.rgb); +hsv.z = hillshade; +return vec4(hsv2rgb(hsv), 1.0) * alpha * color.a; +}`),i.code.add(V`float getNeighborHoodAlpha(float a, float b, float c, float d, float e, float f, float g, float h, float i){ +if (a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0 || a == 0.0 || a == 0.0 || a==0.0) { +return 0.0; +} else { +return e; +} +}`);const r=e.applyColormap?V`fragColor = applyBackgroundBlend(overlay(ve.r, u_minValue, u_maxValue, hillshade, alpha));`:V`hillshade *= alpha; +fragColor = applyBackgroundBlend(vec4(hillshade, hillshade, hillshade, alpha));`;i.code.add(V` + void main() { + vec2 pixelLocation = getPixelLocation(uv); + if (isOutside(pixelLocation)) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + + vec4 currentPixel = getPixel(pixelLocation); + if (currentPixel.a == 0.0) { + fragColor = applyBackgroundBlend(vec4(0.0, 0.0, 0.0, 0.0)); + return; + } + + //mirror edge pixels + vec2 axy = vec2(-1.0, -1.0); + vec2 bxy = vec2(0.0, -1.0); + vec2 cxy = vec2(1.0, -1.0); + vec2 dxy = vec2(-1.0, 0.0); + vec2 fxy = vec2(1.0, 0.0); + vec2 gxy = vec2(-1.0, 1.0); + vec2 hxy = vec2(0.0, 1.0); + vec2 ixy = vec2(1.0, 1.0); + vec2 onePixel = 1.0 / u_srcImageSize; + if (pixelLocation.s < onePixel.s) { + axy[0] = 1.0; + dxy[0] = 1.0; + gxy[0] = 1.0; + } + if (pixelLocation.t < onePixel.t) { + axy[1] = 1.0; + bxy[1] = 1.0; + cxy[1] = 1.0; + } + if (pixelLocation.s > 1.0 - onePixel.s) { + cxy[0] = -1.0; + fxy[0] = -1.0; + ixy[0] = -1.0; + } + if (pixelLocation.t > 1.0 - onePixel.t) { + gxy[1] = -1.0; + hxy[1] = -1.0; + ixy[1] = -1.0; + } + + // calculate hillshade + vec4 va = texture(u_image, pixelLocation + onePixel * axy); + vec4 vb = texture(u_image, pixelLocation + onePixel * bxy); + vec4 vc = texture(u_image, pixelLocation + onePixel * cxy); + vec4 vd = texture(u_image, pixelLocation + onePixel * dxy); + vec4 ve = texture(u_image, pixelLocation); + vec4 vf = texture(u_image, pixelLocation + onePixel * fxy); + vec4 vg = texture(u_image, pixelLocation + onePixel * gxy); + vec4 vh = texture(u_image, pixelLocation + onePixel * hxy); + vec4 vi = texture(u_image, pixelLocation + onePixel * ixy); + + // calculate the rate of z change along the x, y, and diagonal direction + float dzx = (vc + 2.0 * vf + vi - va - 2.0 * vd - vg).r * u_factor.s; + float dzy = (vg + 2.0 * vh + vi - va - 2.0 * vb - vc).r * u_factor.t; + float dzd = sqrt(1.0 + dzx * dzx + dzy * dzy); + float hillshade = 0.0; + + // traditional single light source + if (u_hillshadeType == 0){ + float cosDelta = u_sinZsinAs[0] * dzy - u_sinZcosAs[0] * dzx; + float z = (u_cosZs[0] + cosDelta) / dzd; + if (z < 0.0) z = 0.0; + hillshade = z; + } else { + // multi-directional with 6 light sources + for (int k = 0; k < 6; k++) { + float cosDelta = u_sinZsinAs[k] * dzy - u_sinZcosAs[k] * dzx; + float z = (u_cosZs[k] + cosDelta) / dzd; + if (z < 0.0) z = 0.0; + hillshade = hillshade + z * u_weights[k]; + if (k == 5) break; + } + } + + // set color + float alpha = getNeighborHoodAlpha(va.a, vb.a, vc.a, vd.a, ve.a, vf.a, vg.a, vh.a, vi.a); + alpha *= u_opacity; + ${r} + } + `)}const r$t=Object.freeze(Object.defineProperty({__proto__:null,ColorizerHillshadeUniforms:bFe,ColorizerStretchUniforms:_Fe,ColorizerUniforms:p6,build:wFe},Symbol.toStringTag,{value:"Module"}));function n$t(t,e,i="nearest",r=!1){var f;const n=!(r&&e.pixelType==="u8"),s=n?ga.FLOAT:ga.UNSIGNED_BYTE,o=e.pixels==null||e.pixels.length===0?null:n?e.getAsRGBAFloat():e.getAsRGBA(),l=(f=t.capabilities.textureFloat)==null?void 0:f.textureFloatLinear,c=new tn;return c.width=e.width,c.height=e.height,c.internalFormat=t.type===cr.WEBGL2&&n?zt.RGBA32F:ci.RGBA,c.samplingMode=!l||i!=="bilinear"&&i!=="cubic"?ki.NEAREST:ki.LINEAR,c.dataType=s,c.wrapMode=Bi.CLAMP_TO_EDGE,new Ai(t,c,o)}function s$t(t,e){const{spacing:i,offsets:r,coefficients:n,size:[s,o]}=e,l=i[0]>1,c=new tn;c.width=l?4*s:s,c.height=o,c.internalFormat=t.type===cr.WEBGL2?zt.RGBA32F:ci.RGBA,c.dataType=ga.FLOAT,c.samplingMode=ki.NEAREST,c.wrapMode=Bi.CLAMP_TO_EDGE;const f=new Float32Array(l?s*o*16:2*r.length);if(l&&n!=null)for(let _=0,x=0;_0?this._bandIds&&e.every((i,r)=>{var n;return!!((n=this._bandIds)!=null&&n[r])&&i===this._bandIds[r]})||(this._bandIds=e,this._dirty=!0):this._bandIds=null}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){if(this._interpolation=e,this._rasterTexture!=null){const i=this._getRasterTextureInterpolation(e);this._rasterTexture.setSamplingMode(i==="bilinear"?ki.LINEAR:ki.NEAREST)}}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture=Kt(this._transformGridTexture),this._memoryUsed=null}bind(e){return!!(this.source&&this.source.pixels&&this.source.pixels.length>0)&&((this._rasterTexture==null||this._dirty)&&this._updateRasterTexture(e,this.bandIds),this._rasterTexture!=null&&(this._updateColormapTexture(e),this.transformGrid&&this._transformGridTexture==null&&(this._transformGridTexture=s$t(e,this.transformGrid))),!0)}getUniforms(){const{symbolizerParameters:e,transformGrid:i,width:r,height:n,opacity:s}=this,o=o$t(i,[r,n],[this.source.width,this.source.height],s),l=a$t(e.colormap,e.colormapOffset),c=this.symbolizerParameters.type==="stretch"?l$t(this.symbolizerParameters):null,f=this.symbolizerParameters.type==="hillshade"?c$t(this.symbolizerParameters):null;return new p6(o,l,c||f,this._rasterTexture,this._transformGridTexture,this._colormapTexture)}get isBilinearWithStretchColorRamp(){const{symbolizerParameters:e}=this;return this.interpolation==="bilinear"&&e.colormap!=null&&e.type==="stretch"}get memoryUsage(){if(this._memoryUsed==null){const e=[this._rasterTexture,this._transformGridTexture,this._colormapTexture];this._memoryUsed=e.map(i=>i!=null?i.descriptor.width*i.descriptor.height*4:0).reduce((i,r)=>i+r,0)}return this._memoryUsed}release(){return this._rasterTexture=Kt(this._rasterTexture),this._transformGridTexture=Kt(this._transformGridTexture),this._colormapTexture=Kt(this._colormapTexture),this.source=null,this.transformGrid=null,this.rawPixelData=null,!0}_updateRasterTexture(e,i){const r=this.source?this.source.extractBands(i):null;if(!(r&&r.pixels&&r.pixels.length>0))return void(this._rasterTexture=Kt(this._rasterTexture));const n=i==null&&this.bandIds==null||i!=null&&this.bandIds!=null&&i.join("")===this.bandIds.join("");if(this._rasterTexture!=null&&n)return;this._rasterTexture=Kt(this._rasterTexture);const s=this._getRasterTextureInterpolation(this.interpolation);this._rasterTexture=n$t(e,r,s,this.isRendereredSource||this.hasStretchTypeNone())}hasStretchTypeNone(){return"stretchType"in this.symbolizerParameters&&this.symbolizerParameters.stretchType==="none"&&!this.symbolizerParameters.useGamma&&this.source.pixelType==="u8"}_getRasterTextureInterpolation(e){return this.symbolizerParameters.type==="lut"||e==="nearest"||e==="majority"||this.isBilinearWithStretchColorRamp?"nearest":"bilinear"}_updateColormapTexture(e){const i=this._colormap,r=this.symbolizerParameters.colormap;return r?i?r.length!==i.length||r.some((n,s)=>n!==i[s])?(this._colormapTexture=Kt(this._colormapTexture),this._colormapTexture=S_e(e,r),void(this._colormap=r)):void 0:(this._colormapTexture=S_e(e,r),void(this._colormap=r)):(this._colormapTexture=Kt(this._colormapTexture),void(this._colormap=null))}},dk=class{constructor(){this.waitingAgents=new Pi,this._upsampleInfo=null,this.loadingAgent=null,this.requestPromise=null,this.requestAbort=null,this.pendingUpdates=0}static acquire(e){const i=gY.acquire();return i._init(e),i}release(){this.dispose(),pk.delete(this),gY.release(this)}dispose(){this.loadingAgent=Kt(this.loadingAgent),this.abortRequest(),this._unsetUpsampleInfo(),this.pendingUpdates=0,this._data=CO(this._data)}static prune(){gY.prune(0)}_init(e){this.waitingAgents.clear(),this._data=CO(this._data),this.dataMissing=!1,this.dataInvalidated=!1,this._unsetUpsampleInfo(),this.abortRequest(),this.loadingAgent=null,this.pendingUpdates=0,this._pool=e,this.elevationBounds=null}invalidateSourceData(){this.dataInvalidated=!0,this.dataMissing=!1,this._unsetUpsampleInfo()}abortRequest(){this.requestAbort=gn(this.requestAbort),this.requestPromise=null}get upsampleInfo(){return this._upsampleInfo}_unsetUpsampleInfo(){this._upsampleInfo!=null&&(this._upsampleInfo.tile.unrefMapData(),this._pool.release(this._upsampleInfo),this._upsampleInfo=null)}setUpsampleInfo(e,i){if(e!==i&&i!=null){if(this._upsampleInfo==null)this._upsampleInfo=this._pool.acquire();else{if(this._upsampleInfo.tile===i)return;this._upsampleInfo.tile.unrefMapData()}i.refMapData(),HIt(e,i,this._upsampleInfo)}else this._unsetUpsampleInfo()}get data(){return this._data}set data(e){CO(this._data),this._data=e}};const gY=new Ec(dk,null,()=>{}),pk=new Map;function h$t(){pk.size>0&&(console.log(`${pk.size} live TilePerLayerInfo allocations:`),pk.forEach(t=>console.log(t,` +`)))}let _I=class{constructor(e,i){this._texture=e,this._cache=i,this.type="tile-texture",this._refCount=1}retain(){++this._refCount}release(){if(--this._refCount,this._refCount===0)if(this._cache){const e=`${this._texture.descriptor.width} ${this._texture.descriptor.pixelFormat}`;this._cache.put(e,this)}else this.dispose()}dispose(){this._texture.dispose()}get texture(){return this._texture}generateMipmap(){this._texture.generateMipmap()}get descriptor(){return this._texture.descriptor}get usedMemory(){return this._texture.gpuMemoryUsage}};var hi;(function(t){t[t.NONE=0]="NONE",t[t.SPLIT=1]="SPLIT",t[t.ELEVATION=2]="ELEVATION",t[t.MERGE=4]="MERGE",t[t.RENDERDATA=8]="RENDERDATA",t[t.GEOMETRY=16]="GEOMETRY",t[t.TEXTURE_NOFADING=32]="TEXTURE_NOFADING",t[t.TEXTURE_FADING=64]="TEXTURE_FADING"})(hi||(hi={}));const d$t=.1;let Cce=class{constructor(){this.lij=[0,0,0],this._children=[null,null,null,null],this._pendingUpdates=0,this.renderData=null,this._dirty=!0,this._previouslyRendered=!1,this.extent=Ni(),this._elevationBounds=yt(),this.layerInfo=[[],[]],this.extentInRadians=Ni(),this.centerAtSeaLevel=W(),this._center=[W(),co(),W()],this.up=tse(),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._maxTesselation=0,this._usedMemory=null,this._mapTileMemoryInternal=0,this._mapDataRefCount=0,this.screenDepth=0,this.renderOrder=0,this._edgeLen=0,this._edgeLen2=0,this._curvatureHeight=0,this.extentMidX=0,this.extentMidY=0,this.distanceToPOI=-1,this._lastPOI=W()}static prune(){Ace.prune(0),Mce.prune(0),dk.prune()}get _isCached(){return!this.shouldLoad&&this._mapDataRefCount<=0}get maxTesselation(){return this._maxTesselation}get isWithinClippingArea(){return this._isWithinClippingArea}get intersectsClippingArea(){return this._intersectsClippingArea}get clippingArea(){return this._clippingArea}get parent(){return this._parent}get children(){return this._children}get surface(){return this._surface}get elevationBounds(){return this._elevationBounds}get level(){return this.lij[0]}get key(){return`${this.lij[0]}/${this.lij[1]}/${this.lij[2]}`}get edgeLen(){return this._edgeLen}get radius(){return this._center[Fo.MIDDLE][3]}get visible(){return this._dirty&&this.computeVisibility(),this._visible}get frustumVisibility(){return this._dirty&&this.computeVisibility(),this._frustumVisibility}computeVisibility(){this._dirty=!1;const e=this.parent,i=(e==null?void 0:e.frustumVisibility)??gc.INTERSECTS;this._frustumVisibility=i===gc.INSIDE?gc.INSIDE:i===gc.OUTSIDE?gc.OUTSIDE:this._calculateFrustumVisibilityStatus(this.surface.frustum);const r=this._frustumVisibility!==gc.OUTSIDE&&this._intersectsClippingArea;r!==this._visible&&(this._visible=r,this._surface.emit("tiles-visibility-changed"),this._surface.renderer.setDirty(),this.updateAgentSuspension())}get loadable(){return this.visible||this._surface.view.state.fixedContentCamera}get rendered(){const e=!!this.renderData;return e!==this._previouslyRendered&&(this._surface.emit("tiles-visibility-changed"),this._previouslyRendered=e,this._surface.renderer.setDirty()),e}get shouldLoad(){return this.isLeaf}init(e,i,r,n,s){this.lij[0]=e,this.lij[1]=i,this.lij[2]=r,this.ellipsoid=Sr(s.tilingScheme.spatialReference),s.tilingScheme.getExtent(e,i,r,this.extent),s.tilingScheme.convertExtentToRadians(this.extent,this.extentInRadians),this.extentMidX=.5*(this.extent[0]+this.extent[2]),this.extentMidY=.5*(this.extent[1]+this.extent[3]),this._isWithinClippingArea=!0,this._intersectsClippingArea=!0,this._clippingArea=null,this._mapDataRefCount=0,s.upsampleMapCache.pop(this.key),this._edgeLen=0,this._edgeLen2=0,this._center[Fo.MIDDLE][3]=0,this.elevationLevel=e,n&&n.elevationBounds?Qo(this._elevationBounds,n.elevationBounds):or(this._elevationBounds,0,0),this._pendingUpdates=0,this.renderData=null,this.screenDepth=0,this._visible=!1,this._previouslyRendered=!1,this._parent=n,this.unsetChildren(),this._surface=s,this.updateVisibility();for(const o of rS){const l=s.numLayers(o),c=this.layerInfo[o];for(const f of c)f.release();c.length=l;for(let f=0;f0&&this._surface.upsampleMapCache.put(this.key,this,e)}}setMemoryDirty(){this._usedMemory=null}get usedMemory(){return this._ensureUsedMemory()+(this._isCached?0:this._mapTileMemoryInternal)}get _cachedMemory(){return this._isCached?this._mapTileMemory:0}get _mapTileMemory(){return this._ensureUsedMemory(),this.layerInfo[Yi.MAP].reduce((e,i)=>e+(i instanceof mY?i.memoryUsed/i.referenced:0),this._mapTileMemoryInternal)}get _cpuImageMemorySize(){const i=this._surface.tilingScheme.pixelSize;return i*i*4}_ensureUsedMemory(){var r;if(this._usedMemory!=null)return this._usedMemory;this._usedMemory=this._baseUsedMemory,this._mapTileMemoryInternal=0;let e=0;for(const{data:n}of this.layerInfo[Yi.MAP])n instanceof mY?e+=this._getTerrainDataMemory(n):this._mapTileMemoryInternal+=this._getTerrainDataMemory(n);const i=this._cpuImageMemorySize;for(const n of this.layerInfo[Yi.ELEVATION])this._usedMemory+=n.data?i:0;return this.renderData&&(this._usedMemory+=this.renderData.estimatedGeometryMemoryUsage,this._mapTileMemoryInternal+=((r=this.renderData.texture)==null?void 0:r.usedMemory)??0),this._isCached&&this._surface.upsampleMapCache.updateSize(this.key,this,this._mapTileMemoryInternal+e),this._usedMemory}getUsedMemoryForLayer(e,i){const r=this.layerInfo[e][i];return r!=null&&r.data?e===Yi.MAP?this._isCached?0:this._getTerrainDataMemory(r.data):e===Yi.ELEVATION?this._cpuImageMemorySize:0:0}_getTerrainDataMemory(e){return e instanceof _I?e.texture.gpuMemoryUsage:e instanceof HTMLImageElement||e instanceof wce?this._cpuImageMemorySize:e instanceof u$t?e.memoryUsage:e instanceof mY?e.memoryUsed/e.referenced:0}updateScreenDepth(e){const i=this._center[Fo.MIDDLE],r=e,n=i[0],s=i[1],o=i[2],l=r[2]*n+r[6]*s+r[10]*o+r[14];this.screenDepth=l<0?0:l/(r[3]*n+r[7]*s+r[11]*o+r[15])}shouldSplit(e,i,r){if(!this.visible||e.frustum&&(!this._intersectsClippingArea||this._calculateFrustumVisibilityStatus(e.frustum)===gc.OUTSIDE))return hi.NONE;const n=this.level;je(f8,this._center[Fo.MIDDLE],i);let s=El(f8),o=f8,l=Fo.MIDDLE;je(yY,this._center[Fo.TOP],i);const c=El(yY);cs&&n{if(n0&&F<.001&&I/x-Math.sin(this._curvatureHeight/(this.edgeLen*Math.SQRT1_2)*Math.PI)-F>0)return hi.NONE;const z=r!=null?3-Math.min(_,2):1;if(A*z=e.maxLod)return M();if(n<7)return hi.SPLIT;De(ll,this.up,I),je(ll,ll,o);const k=El(ll);if(k<=this.radius*this.radius)return hi.SPLIT;De(ll,ll,this.radius/Math.sqrt(k)),Be(ll,ll,this._center[l]),je(ll,i,ll);const U=Math.min(1,(Math.abs(Ve(ll,this.up))+.5*L+this._curvatureHeight)/rt(ll)),j=d$t/e.angledSplitBias,H=e.fovY*x*2;return U*(this._edgeLen/H*z){n.requestPromise===s&&(n.requestPromise=null,n.requestAbort=null)};return n.requestPromise=s,s.then(o,o),!0}get isLeaf(){return this._children[0]==null}hasLij(e){return this.lij[0]===e[0]&&this.lij[1]===e[1]&&this.lij[2]===e[2]}findByLij(e){if(this.hasLij(e))return this;const i=this._children;return i[0]?i[0].findByLij(e)||i[1].findByLij(e)||i[2].findByLij(e)||i[3].findByLij(e):null}distanceToSquared(e){return El(je(ll,this._center[Fo.MIDDLE],e))}containsPoint(e){const i=this.extent;return e[0]>=i[0]&&e[1]>=i[1]&&e[0]<=i[2]&&e[1]<=i[3]}containsPointXY(e,i){const r=this.extent;return e>=r[0]&&i>=r[1]&&e<=r[2]&&i<=r[3]}unrequestLayerData(e,i,r){const n=this.layerInfo[i][e],s=n.waitingAgents,o=s.removeUnordered(r)!=null;ry(o,"agent has not requested this piece of map data"),s.length<1&&(n.abortRequest(),this.setMemoryDirty())}dataArrived(e,i,r){const n=r!=null&&"type"in r&&r.type==="vector-tile",s=this.layerInfo[i][e];s.data=r,s.dataInvalidated=!1,s.waitingAgents.forAll(o=>o.dataArrived(this,n)),s.waitingAgents.clear(),this.setMemoryDirty()}dataMissing(e,i,r){r.notInTilemap||console.error(`Tile ${this.lij.toString()} layer ${i}/${e} error ${r}`);const n=this.layerInfo[i][e];n.dataMissing=!0,n.waitingAgents.forAll(s=>s.dataMissing()),n.waitingAgents.clear(),this.setMemoryDirty()}updateRenderData(e,i,r){switch(r&&this.forEachLoadedNeighbor(n=>n.updateRenderData(e,i)),e){case Yi.MAP:return this._updateTexture(i);case Yi.ELEVATION:return this._updateGeometry()}}_updateTexture(e){this.renderData&&(this.resetPendingUpdate(e===ua.FADING?hi.TEXTURE_NOFADING:hi.TEXTURE_FADING),this.setPendingUpdate(e===ua.FADING?hi.TEXTURE_FADING:hi.TEXTURE_NOFADING))}_updateGeometry(){this.setPendingUpdate(hi.GEOMETRY);for(const e of this.layerInfo[Yi.ELEVATION])e.pendingUpdates|=hi.GEOMETRY}invalidateLayerData(e,i){this.layerInfo[i][e].invalidateSourceData(),this.restartAgents(i)}computeElevationBounds(){const e=this._elevationBounds,i=e[0],r=e[1];or(e,1/0,-1/0);const n=this.layerInfo[Yi.ELEVATION];let s=!0;for(const o of n)o.elevationBounds!=null&&(e[0]=Math.min(e[0],o.elevationBounds.min),e[1]=Math.max(e[1],o.elevationBounds.max),o.elevationBounds.hasNoDataValues||(s=!1));s&&(e[0]=Math.min(e[0],0),e[1]=Math.max(e[1],0)),i===e[0]&&r===e[1]||(this.updateRadiusAndCenter(),this._surface.setTileTreeDirty())}_updateCenter(){const e=this._elevationBounds,i=.5*(e[0]+e[1]),r=this._center;De(ll,this.up,i),Be(r[Fo.MIDDLE],this.centerAtSeaLevel,ll),De(ll,this.up,e[0]),Be(r[Fo.TOP],this.centerAtSeaLevel,ll),De(ll,this.up,e[1]),Be(r[Fo.BOTTOM],this.centerAtSeaLevel,ll)}findElevationBoundsForLayer(e,i){const r=this.layerInfo[Yi.ELEVATION][e],n=See(this.level),s=Math.max(this.elevationLevel-n,0),o=r.elevationBounds;if(o!=null&&o.level>=i&&o.level<=s)return;const l=this._surface.layerViewByIndex(e,Yi.ELEVATION),c=Rie(l);if(!F$(this,c,!1))return;const f=f$t;let _=!1;const x=r.data;if(x&&x.level<=s){const T=r.data;f.min=T.samplerData.data.minValue,f.max=T.samplerData.data.maxValue,f.hasNoDataValues=T.samplerData.data.hasNoDataValues,f.level=this.level,_=!0}else{let T,A,M=0;for(let I=this._parent;I&&(!A||M-1?s[c]:dk.acquire(this._surface.upsampleInfoPool)}this.setMemoryDirty()}restartAgents(e){this.renderData&&(this._createOrUpdateAgents(0,e),this.updateRenderData(e,ua.FADING))}updateAgents(e){if(this.renderData){const i=this.layerInfo[e];for(const r of i)r.loadingAgent===hh&&(r.loadingAgent=null);this._createOrUpdateAgents(0,e)}}updateAgentSuspension(){for(const e of rS){const i=this._isSuspended(e);for(const r of this.layerInfo[e])r.loadingAgent&&r.loadingAgent!==hh&&(r.loadingAgent.setSuspension(i),r.loadingAgent===hh&&this.updateRenderData(e,ua.FADING))}}removeLayerAgent(e,i){const r=this.layerInfo[i][e];r.loadingAgent&&r.loadingAgent!==hh&&r.loadingAgent.dispose(),r.loadingAgent=null}agentDone(e,i){const r=this.layerInfo[i][e];r.loadingAgent=hh,r.data||r.upsampleInfo!=null||this._createOrUpdateAgents(e+1,i)}_hasBlendableAncestor(e){return e.blendMode!=="normal"||QO(e.parent)&&this._hasBlendableAncestor(e.parent)}_hasBlendModes(e,i,r){var n,s,o;for(let l=e;l=e[0]&&e[2]>=i[2]&&i[1]>=e[1]&&e[3]>=i[3]}intersectsExtent(e){const i=this.extent;return i[2]>=e[0]&&e[2]>=i[0]&&i[3]>=e[1]&&e[3]>=i[1]}getElevationVerticesPerSide(e){const i=this.elevationLevel-this.level,r=Math.max(this.level-e,See(this.level)-i),n=Je(1+(this.maxTesselation>>r),2,this.maxTesselation+1),s=this.getDefaultVerticesPerSide();return Math.max(n,s)}get test(){return{cachedMemory:this._cachedMemory}}_findLIJ(e,i){if(!e)return null;const r=this.surface.rootTiles;if(r!=null){for(const n of r)if(m$t(n,e)){let s=n,o=e[0]-s.level-1;for(;o>=0&&!s.isLeaf&&!i(s);){const l=e[1]>>o&1,c=e[2]>>o&1;s=s.children[2*l+c],o--}return i(s)?s:null}}return null}findNeighborTile(e,i){const r=this.lij,n=this.getNeighborLIJ(r,e);return n?g$t(r,n)?i(this)?this:null:this._findLIJ(n,i):null}findCorner(e,i){const r=e===ti.NORTH_EAST?1:e===ti.NORTH_WEST?0:e===ti.SOUTH_WEST?2:3;let n=this;for(;n.children[0]&&(!i||!i(n));)n=n.children[r];return n}findNeighborCornerTileExact(e,i){var r;return((r=this.findNeighborTile(e,n=>i(n)||n.level===this.level))==null?void 0:r.findCorner(lV(e),i))||null}forAllSubtreeOnSide(e,i){const r=e===ti.NORTH?[0,1]:e===ti.NORTH_EAST?[1]:e===ti.EAST?[1,3]:e===ti.SOUTH_EAST?[3]:e===ti.SOUTH?[2,3]:e===ti.SOUTH_WEST?[2]:e===ti.WEST?[0,2]:[0],n=s=>{const o=s.children;!i(s)&&o[0]&&r.forEach(l=>n(o[l]))};n(this)}getNeighborEdgeStartVertexIndex(e,i){if(!i)return 0;const r=this.level-i.level;if(ot(!pa||r>=0),r===0)return 0;const n=2**r,s=(1&e)==1,o=s?0:1,l=i.lij[o+1]*n,c=this.lij[o+1],f=c-l,_=s?n-1-f:f;return pa&&(ot(l<=c&&cn.level===i||n.isLoaded;qv.forEach(n=>{const s=this.findNeighborTile(n,r);s!=null&&s!==this&&s.forAllSubtreeOnSide(Sce(n),o=>!!o.isLoaded&&(e(o,n),!0))}),cV.forEach(n=>{var o;const s=(o=this.findNeighborTile(n,r))==null?void 0:o.findCorner(lV(n),l=>l.isLoaded);ot(!s||Fie(this,s,n)),s!=null&&s.isLoaded&&e(s,n)})}getNeighborLIJ(e,i){const r=d_e(i)?-1:h_e(i)?1:0,n=c_e(i)?-1:u_e(i)?1:0,s=[e[0],e[1]+r,e[2]+n];return s[1]<0?null:this.surface.isGlobal?this.wrapLIJ(s):s[2]<0?null:s}wrapLIJ(e){return!e||e[1]<0||e[1]>=2**e[0]?null:this.surface.wrapEastWest(e)}get westNeighborWestExtent(){return this.extent[0]*(this.isWestEnd?-1:1)}get eastNeighborEastExtent(){return this.extent[2]*(this.isEastEnd?-1:1)}get isEastEnd(){return this.lij[2]===this.surface.lijEastEnd(this.level)-1}get isWestEnd(){return this.lij[2]===0}get isNorthEnd(){return this.lij[1]===0}get isSouthEnd(){const e=this.surface.extent,i=(e==null?void 0:e[1])??null;return i!=null&&this.extent[1]+sl()>=i}checkGeometryWaterproofness(){var e;oV&&(ot(this.isLoaded),(e=this.renderData)==null||e.checkGeometryWaterproofness())}shouldHaveNeighbor(e){const i=this.extent,r=this.surface.rootTilesExtent,n=.25*(i[2]-i[0]);if(d_e(e)&&i[3]+n>=r[3]||h_e(e)&&i[1]-n<=r[1])return!1;const s=this.surface.isGlobal;return!(!s&&c_e(e)&&i[0]-n<=r[0])&&!(!s&&u_e(e)&&i[2]+n>=r[2])}updateDistanceToPOI(e){const i=this._lastPOI;if(this.distanceToPOI>=0&&i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2])return;Ne(this._lastPOI,e);const r=this._center[Fo.MIDDLE],n=e[0]-r[0],s=e[1]-r[1],o=e[2]-r[2];this.distanceToPOI=n*n+s*s+o*o}};function p$t(t,e,i,r){const n=i===Yi.ELEVATION?Mce.acquire():Ace.acquire();return n.init(t,e,i,r),n}function p8(t){t.dispose(),t instanceof fFe?Mce.release(t):t instanceof mFe&&Ace.release(t)}const Ace=new Ec(mFe),Mce=new Ec(fFe),f$t=new BM;var Fo;function m$t(t,e){const i=t.level,r=e[0];if(i>r)return!1;const n=r-i,s=Math.floor(e[1]/2**n),o=Math.floor(e[2]/2**n);return s===t.lij[1]&&o===t.lij[2]}function g$t(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function y$t(t,e,i){if(t==null||e==null)return!1;if(t.level===0&&e.level===0&&(t.isEastEnd&&e.isWestEnd&&i===ti.EAST||t.isWestEnd&&e.isEastEnd&&i===ti.WEST))return!0;const r=Math.max(1e-6*(t.extent[2]-t.extent[0]),1);switch(i){case ti.NORTH:return bf(t.extent[3],e.extent[1],r);case ti.SOUTH:return bf(t.extent[1],e.extent[3],r);case ti.EAST:return bf(t.extent[2],e.extent[0],r)||bf(t.extent[2],-e.extent[0],r);case ti.WEST:return bf(t.extent[0],e.extent[2],r)||bf(t.extent[0],-e.extent[2],r)}}function Fie(t,e,i){return t!=null&&e!=null&&e!==t&&(t.level>=e.level?E_e(t,e,i):E_e(e,t,lV(i)))}function E_e(t,e,i){ot(t.level>=e.level);const r=q4t(i),n=W4t(i),s=t.extent,o=e.extent,l=[r?s[0]:s[2],n?s[3]:s[1]],c=[r?o[2]:o[0],n?o[1]:o[3]],f=1e-5*(s[2]-s[0]),_=bf(l[0],c[0],f)||t.surface.isGlobal&&bf(l[0],-c[0],f),x=bf(l[1],c[1],f);if(_&&x)return!0;if(t.level===e.level||!_&&!x)return ot(!1),!1;const T=_?C_e(o[1],o[3],s[1],s[3],f):C_e(o[0],o[2],s[0],s[2],f);return ot(T),T}function C_e(t,e,i,r,n){return t-n<=i&&i<=r&&r<=e+n}(function(t){t[t.TOP=0]="TOP",t[t.MIDDLE=1]="MIDDLE",t[t.BOTTOM=2]="BOTTOM"})(Fo||(Fo={}));const f8=W(),yY=W(),vY=W(),ll=W();let v$t=class{constructor(){this._scales=Mi(-1,-1,-1,-1),this._offsets=Mi(-1,-1,-1,-1)}clear(){this._scales[0]=this._scales[1]=this._scales[2]=this._scales[3]=-1,this._offsets[0]=this._offsets[1]=this._offsets[2]=this._offsets[3]=-1}setScale(e,i,r){this._scales[2*e]=i,this._scales[2*e+1]=r}setOffset(e,i,r){this._offsets[2*e]=i,this._offsets[2*e+1]=r}get scales(){return this._scales}get offsets(){return this._offsets}};function _$t(t,e){t.varyings.add("tbnTangent","vec3"),t.varyings.add("tbnBiTangent","vec3"),e.spherical?t.vertex.code.add(V`void forwardVertexTangent(vec3 n) { +tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), n)); +tbnBiTangent = normalize(cross(n, tbnTangent)); +}`):t.vertex.code.add(V`void forwardVertexTangent(vec3 n) { +tbnTangent = vec3(1.0, 0.0, 0.0); +tbnBiTangent = normalize(cross(n, tbnTangent)); +}`),t.fragment.code.add(V`mat3 getTBNMatrix(vec3 n) { +return mat3(tbnTangent, tbnBiTangent, n); +}`)}var _y;(function(t){t[t.LayerOnly=0]="LayerOnly",t[t.ColorComposite=1]="ColorComposite",t[t.GridComposite=2]="GridComposite",t[t.COUNT=3]="COUNT"})(_y||(_y={}));let b$t=class extends Ole{constructor(){super(...arguments),this.overlayOpacity=1}};function w$t(t,e){const{vertex:i,fragment:r,varyings:n}=t;n.add("vtc","vec2"),i.uniforms.add(new A_e("texOffsetAndScale")),r.uniforms.add(new M_e("tex")),r.uniforms.add(new _Y("textureOpacities"));const s=e.textureFadingEnabled&&!e.renderOccluded;s&&(i.uniforms.add(new A_e("nextTexOffsetAndScale")),n.add("nvtc","vec2"),r.uniforms.add(new M_e("texNext")),r.uniforms.add(new _Y("nextTexOpacities")),r.uniforms.add(new x$t("fadeFactor")));const o=e.tileBlendInput===_y.ColorComposite,l=e.tileBlendInput===_y.GridComposite;l&&r.include(Ece),o&&r.uniforms.add(new _Y("backgroundColor")),i.code.add(V` + void forwardTextureCoordinatesWithTransform(in vec2 uv) { + vtc = uv * texOffsetAndScale.zw + texOffsetAndScale.xy; + ${s?V`nvtc = uv * nextTexOffsetAndScale.zw + nextTexOffsetAndScale.xy;`:V``} + }`),r.code.add(V` + vec4 getColor(vec4 color, vec2 uv, vec3 opacities) { + ${l||o?V` + if (opacities.y <= 0.0) { + return color * opacities.z * opacities.x; + } + vec4 bg = vec4(${o?V`backgroundColor`:V`gridColor(uv)`} * opacities.y, opacities.y); + vec4 layer = color * opacities.z; + return (bg * (1.0 - layer.a) + layer) * opacities.x;`:V`return color;`} + }`),s?r.code.add(V`vec4 getTileColor() { +vec4 color = getColor(texture(tex, vtc), vtc, textureOpacities); +if (fadeFactor >= 1.0) { +return color; +} +vec4 nextColor = getColor(texture(texNext, nvtc), nvtc, nextTexOpacities); +return mix(nextColor, color, fadeFactor); +}`):r.code.add(V`vec4 getTileColor() { +return getColor(texture(tex, vtc), vtc, textureOpacities); +}`)}let x$t=class extends Ls{constructor(e){super(e,"float")}},_Y=class extends Ls{constructor(e){super(e,"vec3")}},A_e=class extends Ls{constructor(e){super(e,"vec4")}},M_e=class extends Ls{constructor(e){super(e,"sampler2D")}},Oce=class extends b$t{};function xFe(t){const e=new Cr,{vertex:i,fragment:r,varyings:n}=e;e.include(W9),e.include(n6,t),e.include(My,t);const s=()=>{e.include(GL,t),i.code.add(V`vec3 getNormal() { +float z = 1.0 - abs(normalCompressed.x) - abs(normalCompressed.y); +vec3 n = vec3(normalCompressed + vec2(normalCompressed.x >= 0.0 ? 1.0 : -1.0, +normalCompressed.y >= 0.0 ? 1.0 : -1.0) * min(z, 0.0), z); +return normalize(n); +}`)};Kh(i,t),e.include(Yu,t);const o=t.overlayMode!==vy.Disabled,l=o&&t.invisible;switch(t.output){case ue.Color:{e.include(w$t,t),e.include(JT,t),o&&e.include(mR,{...t,pbrMode:t.pbrMode===ei.Terrain?ei.TerrainWithWater:ei.Water});const c=t.overlayMode===vy.EnabledWithWater;c&&e.include(_$t,t),n.add("vnormal","vec3"),n.add("vpos","vec3"),n.add("vup","vec3"),s(),t.screenSizePerspective&&S5(i);const f=t.receiveShadows&&!t.renderOccluded;f&&e.include(wP,t),t.screenSizePerspective&&(n.add("screenSizeDistanceToCamera","float"),n.add("screenSizeCosAngle","float")),i.code.add(V` + void main(void) { + //Position + vpos = position; + vec3 positionWorld = position + localOrigin; + gl_Position = transformPosition(proj, view, vpos); + + //Normal + vnormal = getNormal(); + + //Up + vup = getLocalUp(position, localOrigin); + + ${c?V`forwardVertexTangent(vnormal);`:V``} + + //Texture UV + vec2 uv = getUV0(); + forwardTextureCoordinatesWithTransform(uv); + ${o?V`setOverlayVTC(uv);`:""} + ${t.tileBorders?V`forwardTextureCoordinates();`:""} + + ${t.screenSizePerspective?V` + vec3 viewPos = (view * vec4(vpos, 1.0)).xyz; + screenSizeDistanceToCamera = length(viewPos); + vec3 viewSpaceNormal = (viewNormal * vec4(normalize(positionWorld), 1.0)).xyz; + screenSizeCosAngle = abs(viewSpaceNormal.z);`:""} + + ${f?V`forwardLinearDepth();`:""} + + } + `),e.include(oo,t),e.include(JT,t),e.include(o6,t),e.include(KT,t),Nm(r,t),a6(r),CP(r),r.uniforms.add(i.uniforms.get("localOrigin"),new Oi("viewDirection",(_,x)=>Ye(O_e,Ie(O_e,x.camera.viewMatrix[12],x.camera.viewMatrix[13],x.camera.viewMatrix[14])))),c&&r.uniforms.add(new Zt("ovWaterTex",(_,x)=>{var T;return(T=x.overlay)==null?void 0:T.getTexture(ns.WaterNormal)}),new W$e("view",(_,x)=>Qu(S$t,x.camera.viewMatrix,_.origin))),r.code.add(V`const float sliceOpacity = 0.2; +float lum(vec3 c) { +return (min(min(c.r, c.g), c.b) + max(max(c.r, c.g), c.b)) * 0.5; +}`),B_(r),a1(r),r.code.add(V` + void main() { + vec3 normal = normalize(vnormal); + float vndl = dot(normal, mainLightDirection); + + float additionalAmbientScale = smoothstep(0.0, 1.0, clamp(vndl*2.5, 0.0, 1.0)); + float shadow = ${t.receiveShadows&&!t.renderOccluded?"readShadowMap(vpos, linearDepth)":t.spherical?"lightingGlobalFactor * (1.0 - additionalAmbientScale)":"0.0"}; + + float ssao = evaluateAmbientOcclusionInverse(); + vec4 tileColor = getTileColor(); + + ${o?V` + vec4 overlayColorOpaque = getOverlayColor(ovColorTex, vtcOverlay); + vec4 overlayColor = overlayOpacity * overlayColorOpaque; + ${t.invisible?V`if (overlayColor.a == 0.0) { discard; }`:""} + vec4 groundColor = tileColor; + tileColor = tileColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + // If combined alpha is 0 we can discard pixel. The performance impact by having a discard here + // is neglectable because terrain typically renders first into the framebuffer. + if(tileColor.a <= 0.0) { + discard; + } + + bool sliced = rejectBySlice(vpos); + if (sliced) { + tileColor *= sliceOpacity; + } + + vec3 albedo = tileColor.rgb; + + // heuristic shading function used in the old terrain, now used to add ambient lighting + + vec3 additionalLight = ssao * mainLightIntensity * additionalAmbientScale * ambientBoostFactor * lightingGlobalFactor; + + ${t.pbrMode===ei.Terrain||t.pbrMode===ei.TerrainWithWater?V`fragColor = vec4(evaluateTerrainLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight, normalize(vpos - cameraPosition), vup), tileColor.a);`:V`fragColor = vec4(evaluateSceneLighting(normal, albedo, shadow, 1.0 - ssao, additionalLight), tileColor.a);`} + ${c?V` + vec4 overlayWaterMask = getOverlayColor(ovWaterTex, vtcOverlay); + float waterNormalLength = length(overlayWaterMask); + if (waterNormalLength > 0.95) { + mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, vnormal); + vec4 waterOverlayColor = vec4(overlayColor.w > 0.0 ? overlayColorOpaque.xyz/overlayColor.w : vec3(1.0), overlayColor.w); + vec4 viewPosition = view*vec4(vpos, 1.0); + vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, waterOverlayColor, -normalize(vpos - cameraPosition), shadow, vnormal, tbnMatrix, viewPosition.xyz, vpos + localOrigin); + vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0)); + float opacity = sliced ? sliceOpacity : 1.0; + // un-gamma the ground color to mix in linear space + fragColor = mix(groundColor, waterColorNonLinear, waterColorLinear.w) * opacity; + }`:""} + ${t.screenSizePerspective?V` + float perspectiveScale = screenSizePerspectiveScaleFloat(1.0, screenSizeCosAngle, screenSizeDistanceToCamera, vec4(0.0, 0.0, 0.0, 0.0)); + if (perspectiveScale <= 0.25) { + fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), perspectiveScale * 4.0); + } + else if (perspectiveScale <= 0.5) { + fragColor = mix(fragColor, vec4(0.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.25) * 4.0); + } + else if (perspectiveScale >= 0.99) { + fragColor = mix(fragColor, vec4(0.0, 1.0, 0.0, 1.0), 0.2); + } + else { + fragColor = mix(fragColor, vec4(1.0, 0.0, 1.0, 1.0), (perspectiveScale - 0.5) * 2.0); + }`:""} + ${t.visualizeNormals?t.spherical?V` + vec3 localUp = normalize(vpos + localOrigin); + vec3 right = normalize(cross(vec3(0.0, 0.0, 1.0), localUp)); + vec3 forward = normalize(cross(localUp, right)); + mat3 tbn = mat3(right, forward, localUp); + vec3 tNormal = normalize(normal * tbn); + fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0); + `:V` + vec3 tNormal = normalize(normal); + fragColor = vec4(vec3(0.5) + 0.5 * tNormal, 0.0); + `:""} + ${t.tileBorders?V` + vec2 dVuv = fwidth(vuv0); + vec2 edgeFactors = smoothstep(vec2(0.0), 1.5 * dVuv, min(vuv0, 1.0 - vuv0)); + float edgeFactor = 1.0 - min(edgeFactors.x, edgeFactors.y); + fragColor = mix(fragColor, vec4(1.0, 0.0, 0.0, 1.0), edgeFactor);`:""} + fragColor = highlightSlice(fragColor, vpos); + } + `)}break;case ue.Depth:l&&e.include(mR,t),e.include(E_,t),B2(e),XT(e),i.code.add(V` + void main(void) { + ${l?V`setOverlayVTC(getUV0());`:""} + gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth); + } + `),r.code.add(V` + void main() { + ${l?V`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} + outputDepth(linearDepth); + } + `);break;case ue.Shadow:case ue.ShadowHighlight:case ue.ShadowExcludeHighlight:e.include(E_,t),B2(e),XT(e),i.code.add(V`void main(void) { +gl_Position = transformPositionWithDepth(proj, view, position, nearFar, linearDepth); +}`),r.code.add(V`void main() { +outputDepth(linearDepth); +}`);break;case ue.Normal:l&&e.include(mR,t),n.add("vnormal","vec3"),S5(i),s(),i.code.add(V` + void main(void) { + ${l?V`setOverlayVTC(getUV0());`:""} + gl_Position = transformPosition(proj, view, position); + vnormal = normalize((viewNormal * vec4(getNormal(), 1.0)).xyz); + } + `),r.code.add(V` + void main() { + ${l?V`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} + vec3 normal = normalize(vnormal); + if (gl_FrontFacing == false) { + normal = -normal; + } + fragColor = vec4(vec3(0.5) + 0.5 * normal, 0.0); + } + `);break;case ue.Highlight:o&&e.include(mR,t),i.code.add(V` + void main() { + ${o?V`setOverlayVTC(getUV0());`:""} + gl_Position = transformPosition(proj, view, position); + } + `),e.include(dx,t),r.code.add(V` + void main() { + ${o?V`if (getCombinedOverlayColor().a == 0.0) { discard; }`:""} + outputHighlight(); + } + `)}return t.output===ue.ObjectAndLayerIdColor&&(o?(e.include(mR,{...t,pbrMode:ei.Disabled}),i.code.add(V`void main(void) { +gl_Position = transformPosition(proj, view, position); +setOverlayVTC(getUV0()); +}`),r.code.add(V`void main() { +fragColor = getOverlayColorTexel(vtcOverlay); +}`)):(i.code.add(V`void main(void) {}`),r.code.add(V`void main() { +fragColor = vec4(0.0); +}`))),e}const S$t=Qe(),O_e=W(),T$t=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:Oce,build:xFe},Symbol.toStringTag,{value:"Module"}));let SFe=class TFe extends Hr{constructor(){super(...arguments),this.useStencil=!1}initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global}initializeProgram(e){return new Ir(e.rctx,TFe.shader.get().build(this.configuration),EFe)}initializePipeline(){return this._stencilPipelineState=this._createPipeline(!0),this._createPipeline(!1)}_createPipeline(e){const i=this.configuration,r=i.backfaceCullingEnabled&&!i.renderOccluded;return Ti({blending:i.renderOccluded?hd(st.ONE,st.ONE_MINUS_SRC_ALPHA):null,culling:r?pae:null,depthTest:i.renderOccluded?null:{func:Zr.LESS},depthWrite:i.renderOccluded?null:rh,colorWrite:ji,stencilTest:e?m3t(Zu.IntegratedMeshMaskExcluded):null})}getPipeline(){return this.useStencil?this._stencilPipelineState:super.getPipeline()}};SFe.shader=new Rr(T$t,()=>we(()=>Promise.resolve().then(()=>NWt),void 0));const EFe=new Map([[J.POSITION,0],[J.UV0,1],[J.NORMALCOMPRESSED,2]]);let E$t=class{constructor(){this.geometry=new DIt,this.intersectionData=null,this.geometryState=null,this._textureRef=new uFe(()=>this.tile.surface.textureFadeDuration),this.overlay=new v$t,this._geometryStateChangedSinceLastUpdate=!0,this._hasGeometry=!1,this._numVerticesPerSideChanged=!1,this._samplerDataChanged=!1,this._clippingAreaChanged=!1,this._wireframeChanged=!1,this._dirtyEdgeResolutions=15,this._dirtyEdges=15,this._dirtyCorners=15}get tile(){return this._tile}init(e){this.clear(),this._tile=e;const i=this.geometry;i.indices=null,i.vertexAttributes=null,Bn(i.boundingBox),i.indexCount=0,i.numVerticesPerSide=0,this.intersectionData=null,this.geometryState=new kIt,this.localOrigin=null,this.overlay.clear()}clear(){this.releaseGeometry(),this.releaseTexture(),this._textureRef.clear(),this._tile=null,this.intersectionData=null,this.geometryState=null}updateGeometryIfNeeded(e){if((!this._vao||this._geometryStateChangedSinceLastUpdate||this._wireframeChanged||this._clippingAreaChanged||this._samplerDataChanged||this._numVerticesPerSideChanged||this._dirtyCorners||this._dirtyEdgeResolutions||this._dirtyEdges)&&(this._updateGeometry(e),this._geometryStateChangedSinceLastUpdate=!1),pa&&this.tile.intersectsClippingArea)for(let i=0;i<4;++i)ot(this.geometry.outerEdges[i].count===this.geometryState.neighborData.edgeResolutions[i]+1)}_calculateEdgeResolution(e,i){var c;const r=this.tile,n=this.geometryState.numVerticesPerSide-1;if(!r.surface.isGlobal){const f=r.surface.extent;if(f!=null&&(e===0&&r.extent[3]>f[3]||e===1&&r.extent[2]>f[2]||e===2&&r.extent[1]=0),x===0){const M=_.numVerticesPerSide-1;return Math.max(M,n)}const T=2**x,A=_.neighborData.edgeResolutions[(e+2)%4]/T;return Math.max(1,A)}ot(!i.isLeaf);let l=n;return i.forAllSubtreeOnSide(Sce(o),f=>f===r||(f.isLoaded?(l=Math.max(l,2**(f.level-s)),!0):(ot(!f.isLeaf),!1))),l}updateNeighborData(){var l;const e=this.tile;if(!e.intersectsClippingArea)return;const i=e.renderData.geometryState.neighborData,r=c=>(c.isLoaded||c.level===e.level)&&(c==null?void 0:c.intersectsClippingArea),n=i.edgePeerNeighbors,s=i.edgePeerNeighborSamplerVersions;for(let c=0;c<4;++c){const f=e.findNeighborTile(qv[c],r),_=DS(e,f),x=((l=_==null?void 0:_.renderData)==null?void 0:l.geometryState.samplerDataVersion)??-1,T=n[c],A=_!==DS(e,T),M=s[c]!==x;n[c]=f,(A||M)&&(s[c]=x,this._markEdgeDirty(c));const I=i.edgeResolutions[c],L=this._calculateEdgeResolution(c,f);ot(BT(L)),ot(L>=1),i.edgeResolutions[c]=L,I!==L&&this._markEdgeResolutionDirty(c)}const o=i.cornerPeerNeighbors;for(let c=0;c<4;++c){const f=e.findNeighborTile(cV[c],r);o[c]=f;const _=DS(e,n[c]),x=DS(e,n[(c+1)%4]),T=DS(e,f);b0[c]=T,b0[(c+1)%4]=x,b0[(c+2)%4]=e,b0[(c+3)%4]=_,ot(b0.some(L=>(L==null?void 0:L.isLoaded)||L===e));const A=b0.reduce((L,F)=>Math.min(L,(F==null?void 0:F.level)??1/0),1/0);b0.forEach((L,F)=>{L&&(L==null?void 0:L.level)>A&&(b0[F]=null)}),ot(b0.some(L=>(L==null?void 0:L.isLoaded)||L===e));const M=i.cornerNeighborData[c].cornerTiles,I=i.cornerNeighborData[c].cornerTileSamplerVersions;for(let L=0;L<4;++L){const F=b0[L],z=(F==null?void 0:F.renderData.geometryState.samplerDataVersion)??-1,k=M[L]!==F,U=!k&&I[L]!==z;(k||U)&&(M[L]=F,I[L]=z,this._markCornerDirty(c))}ot(M.some(L=>(L==null?void 0:L.isLoaded)||L===e))}pa&&ot(this.geometryState.neighborData.edgeResolutions.every(c=>c>0));for(let c=0;c<4;++c)b0[c]=null}_updateGeometry(e){if(!this.tile.intersectsClippingArea)return;pa&&ot(!this.tile.intersectsClippingArea||this.geometryState.neighborData.edgeResolutions.every(c=>c>0)),this.intersectionData=null;const i=this.tile,r=this._vao,n=this.geometry.vertexAttributes,s=!r||!n||this._wireframeChanged||this._numVerticesPerSideChanged||this._samplerDataChanged||this._clippingAreaChanged||this._dirtyEdgeResolutions,o=!s&&(this._dirtyEdges!==0||this._dirtyEdgeResolutions!==0),l=!o&&this._dirtyCorners!==0;s?(this.releaseGeometry(),this._createGeometry(e)):o||l?i.updateEdgeElevations():l?i.updateCornerElevations():console.warn("Update for no reason?"),this._numVerticesPerSideChanged=!1,this._samplerDataChanged=!1,this._dirtyEdgeResolutions=0,this._dirtyEdges=0,this._dirtyCorners=0,this._clippingAreaChanged=!1,this._wireframeChanged=!1}get hasGeometry(){return this._hasGeometry}releaseGeometry(){return this._hasGeometry=!1,this.intersectionData=null,!!this._vao&&(this._vao=Kt(this._vao),this.geometry.release(),!0)}ensureTexture(e,i,r){const n=i?ci.RGBA:ci.RGB;return this._texture==null||this._texture.descriptor.width===e&&this._texture.descriptor.pixelFormat===n||this.releaseTexture(),this._texture==null&&(this._texture=r(),this.tile.setMemoryDirty()),this._texture}releaseTexture(){this._texture!=null&&(this._texture.release(),this._texture=null,this.tile.setMemoryDirty())}_markCornerDirty(e){const i=1<0,f=c?n:null;return c&&(n.length=s),{changed:l,samplerData:f,maxTileLevel:o}}get estimatedGeometryMemoryUsage(){var i,r,n;const e=((i=this.intersectionData)==null?void 0:i.estimatedMemoryUsage)??0;return(((r=this.geometry.indices)==null?void 0:r.byteLength)??0)+(((n=this.geometry.vertexAttributes)==null?void 0:n.byteLength)??0)+e}get texture(){return this._texture}get test(){return{hasTexture:this._texture!=null}}checkGeometryWaterproofness(){if(!pa)return;const e=this.tile;if(!e.isLoaded||!e.intersectsClippingArea||e.level===0)return void ot(e==null?void 0:e.isLoaded);const i=e.surface.extent;if(i!=null&&!e.intersectsExtent(i))return;const r=qv.map((l,c)=>i!=null&&(c<2?-1:1)*(e.extent[3-c]-i[3-c])<0),n=e.level;ot(this._dirtyCorners===0),ot(this._dirtyEdges===0),ot(this._dirtyEdgeResolutions===0),ot(!this._numVerticesPerSideChanged),ot(!this._samplerDataChanged),ot(!this._clippingAreaChanged),ot(!this._wireframeChanged);const s=cV.map(l=>e.findNeighborCornerTileExact(l,c=>!c.intersectsClippingArea||c.isLoaded||c.level===e.level)??null).map(l=>l!=null&&l.intersectsClippingArea?l:null),o=this.geometryState.neighborData;for(let l=0;l<4;++l){const c=o.cornerPeerNeighbors[l],f=s[l];ot(f===c,`Tile[${e.lij}].corner[${l}] out of date: cur=[${c==null?void 0:c.lij}] exp=[${f==null?void 0:f.lij}]`)}qv.forEach((l,c)=>{if(r[c])return;const f=e.findNeighborTile(l,de=>(de.level===n||(de==null?void 0:de.isLoaded))&&(de==null?void 0:de.intersectsClippingArea));if(!f){const de=!e.surface.updatingRootTiles&&e.surface.rootTiles!=null&&e.surface.rootTiles.length>0&&e.shouldHaveNeighbor(l);return void ot(!de)}ot(f.isLoaded||f.level===e.level),ot(f===this.geometryState.neighborData.edgePeerNeighbors[c]);const _=n-f.level;if(!f.isLoaded)return ot(!f.isLeaf),void ot(_===0);const x=f.renderData;ot(y$t(e,f,l)),ot(_>=0);const T=2**_;if(_<0)return void ot(!1);const A=e.renderData,M=A.geometry,I=M.outerEdges[c],L=M.numVerticesPerSide-1,F=x.geometry;if(!F)return void ot(!1);const z=this.geometryState.neighborData.edgePeerNeighbors[c];if(z!=null&&z.isLoaded){const de=z.renderData;ot(z==z),ot(A.geometryState.neighborData.edgePeerNeighborSamplerVersions[c]===de.geometryState.samplerDataVersion),ot(this.geometryState.neighborData.edgePeerNeighborSamplerVersions[c]===de.geometryState.samplerDataVersion)}const k=(c+2)%4,U=F.outerEdges[k],j=I.count-1,H=U.count-1;ot(j*T===H,`Tile[${e.lij}]:e${c},res=${j} edgeRes mismatch with Neighbor[${f.lij}]:e${k},res=${H} (expected:${j*T})`);const Y=e.extent,Q=l===ti.NORTH||l===ti.SOUTH,ne=U.count-1,re=ne/2**_,he=I.count-1;if(re<1)return void ot(he===1);ot(re===he),ot(BT(re));const ce=F.numVerticesPerSide-1;ot(_>0||re===Math.max(ce,L));const be=e.getNeighborEdgeStartVertexIndex(c,f);ot(0<=be&&be0&&console.warn(` localOrigins: ${A.localOrigin} vs ${x.localOrigin} d=${$h(Rt)} [${Rt}]`),(()=>{const dt=Xr(pg),pt=Xr(fg);e.updateEdgeElevations(),f.updateEdgeElevations(),I.getVertexPos(pg,pe),U.getVertexPos(fg,Ee);const oi=W();xn(oi,pg,dt),$h(oi)>0&&console.warn(` XXX Tile[${e.lij}] edge out of date: ${dt} vs ${pg} d=${$h(oi)} [${oi}]`),xn(oi,fg,pt),$h(oi)>0&&console.warn(` XXX Neighbor[${f.lij}] edge out of date: ${pt} vs ${fg} d=${$h(oi)} [${oi}]`)})(),ot(Qt,`Mismatch in tile [${e.lij}].edge[${c}][${pe}/${I.count}] vs neighbor [${f.lij}].edge[${k}][${Ee}/${U.count}] ${O1(pg)} vs ${O1(fg)} dist=${Ge} h(t|n|d)=${ut}|${Ft}|${Ft-ut}`)}I.getNormal($C,pe),U.getNormal(LC,Ee),Ye(P_e,$C),Ye(R_e,LC);const At=Ve(P_e,R_e),ri=1-At<.01||!1||e===f;if(!ri){const Rt=W();xn(Rt,$C,LC);const dt=()=>`Mismatch in tile edge normal ${l_e(e.lij)} (${pe}/${I.count-1}) edge ${c} vs neighbor ${l_e(f.lij)} (${Ee}/${U.count-1}) nedge ${k} :${O1($C)} vs ${O1(LC)} dot = ${At} : ${O1(Rt)}`;console.warn("Mismatch in tile edge normal: ",dt());{e.updateEdgeElevations(),f.updateEdgeElevations();const pt=W(),oi=W();I.getNormal(pt,pe),U.getNormal(oi,Ee),M2($C,pt)||console.warn("Missing update in tile normal: ",O1($C)," => ",O1(pt)),M2(LC,oi)||console.warn("Missing update in neighbor normal: ",O1(LC)," => ",O1(oi))}ot(ri,dt())}}pe+=1,Ee+=1}})}};const pg=W(),fg=W(),$C=W(),LC=W(),P_e=W(),R_e=W(),C$t=1,b0=[null,null,null,null];function DS(t,e){return e!=null&&e.isLoaded||e===t?e:null}const A$t=65536;function M$t(t,e){const i=t.tile,{extent:r,extentInRadians:n,surface:s}=i,o=t.localOrigin,l=t.geometryState,c=s.isWebMercator,f=l.numVerticesPerSide,_=f-1,x=(f-2)**2,T=c&&(e===_f.HAS_SOUTH_POLE||e===_f.HAS_BOTH_POLES),A=c&&(e===_f.HAS_NORTH_POLE||e===_f.HAS_BOTH_POLES),M=6,I=((T?1:0)+(A?1:0))*M*(_+1),L=l.neighborData,F=L.edgeResolutions.reduce((Q,ne)=>Q+ne+1,0),z=x+I+F,k=s.renderer.tileGeometryCache.acquire(z),U=t.geometry;U.numVerticesPerSide=l.numVerticesPerSide,U.vertexAttributes=k;const j=U.boundingBox;Bn(j);const H=Pce(t);wl.update(_,n,H),O$t(t),DFe(t,x),CFe(t);const Y=[];if((()=>{let Q=x+F;const ne=o[0],re=o[1],he=o[2],ce=i.ellipsoid.radius,be=r[1],ye=r[3],pe=(Ee,te)=>{const le=te*f;Nf(-ne,-re,Ee*ce-he,j),Y.push({connectedRowOffset:le,connectedOuterEdgeOffset:Ee===1?0:2,rowOffset:Q,latitudeResolution:M});const de=OFe(Ee===-1?be:ye,ce),ve=Ee*Math.PI/2-de,Se=.99*(Ee===1?1:-1),Ae=ce+0,{position:Pe,uv0:Ge}=k,{typedBuffer:ut,typedBufferStride:Ft}=k.normalCompressed;for(let Qt=1;Qt<=M;++Qt){const At=de+ve*(Qt/M),ri=Math.cos(At),Rt=Math.sin(At);for(let dt=0;dt<=_;dt++){const pt=dt/_,oi=wl.sinLonLUT[dt],ht=wl.cosLonLUT[dt]*ri,Et=oi*ri,Dt=Rt,Tt=ht*Ae-ne,ie=Et*Ae-re,Ht=Dt*Ae-he;Nf(Tt,ie,Ht,j),Pe.setValues(Q,Tt,ie,Ht),Rm(Ge,Q,pt,Se),tE(ut,Q,ht,Et,Dt,Ft),++Q}}};T&&pe(-1,0),A&&pe(1,_)})(),LFe(U,l.numVerticesPerSide,Y,[0,f-1],[0,f-1],l.wireframe),t.intersectionData=null,pa)for(let Q=0;Q<4;++Q)ot(U.outerEdges[Q].count===L.edgeResolutions[Q]+1)}function O$t(t){const e=t.tile;if(!e.intersectsClippingArea)return;const i=t.geometryState,r=i.numVerticesPerSide,n=r-2,s=r-1,o=t.geometry,l=o.vertexAttributes,c=l.position,f=l.uv0,{typedBuffer:_,typedBufferStride:x}=l.normalCompressed,T=e.extent,A=T[0],M=T[2],I=T[1],L=T[3],F=e.ellipsoid.radius,z=i.samplerData,k=t.localOrigin,U=k[0],j=k[1],H=k[2],Y=c.typedBuffer,Q=c.typedBufferStride,ne=1/s,re=o.boundingBox;let he=0;if(1<=n){const ce=ne,be=I*(1-ce)+L*ce,ye=wl.sinLatLUT[1],pe=wl.cosLatLUT[1];for(let Ee=1;Ee<=n;Ee++){const te=Ee*ne,le=A*(1-te)+M*te,de=wl.sinLonLUT[Ee],ve=wl.cosLonLUT[Ee],Se=F+Os(le,be,z),Ae=Se*ve*pe-U,Pe=Se*de*pe-j,Ge=Se*ye-H;Nf(Ae,Pe,Ge,re);const ut=(Ee-1)*Q;Y[ut]=Ae,Y[ut+1]=Pe,Y[ut+2]=Ge,Rm(f,Ee-1,te,ce)}}for(let ce=1;ce<=n;ce++){const be=ce*ne,ye=I*(1-be)+L*be,pe=wl.sinLatLUT[ce],Ee=wl.cosLatLUT[ce],te=ce+1,le=te*ne,de=I*(1-le)+L*le,ve=wl.sinLatLUT[te],Se=wl.cosLatLUT[te],Ae=wl.sinLonLUT[0],Pe=wl.cosLonLUT[0],Ge=F+Os(A,ye,z);let ut=Pe*Ee*Ge-U,Ft=Ae*Ee*Ge-j,Qt=pe*Ge-H;const At=he*Q;let ri=Y[At],Rt=Y[At+1],dt=Y[At+2];for(let pt=1;pt<=n;pt++){const oi=pt*ne,ht=A*(1-oi)+M*oi,Et=wl.sinLonLUT[pt],Dt=wl.cosLonLUT[pt];let Tt=0,ie=0,Ht=0;if(pt1){const g=(he-n)*Q;li=Y[g],mi=Y[g+1],Lr=Y[g+2]}else{const g=wl.sinLatLUT[0],v=wl.cosLatLUT[0],b=F+Os(ht,I,z);li=Dt*v*b-U,mi=Et*v*b-j,Lr=g*b-H}const Dr=F+Os(ht,de,z),Ze=Dt*Se*Dr-U,xi=Et*Se*Dr-j,m=ve*Dr-H;if(celi.isLoaded||li.isLeaf||li.level===s.level);qt?qt.intersectsClippingArea&&(ot(!qt.isLoaded),ot(!qt.isLeaf),ot(qt.level===o)):ot((vt==null?void 0:vt.rootTiles)==null||!s.shouldHaveNeighbor(Bt))}}const Ae=ye===1?l[2]:l[0],Pe=le==null?void 0:le.extent,Ge=Pe&&pe?ye===1?Pe[0]:Pe[2]:Ae,ut=ye===0?l[3]:l[1],Ft=ye===1?1:0,Qt=ye===0?1:0,At=ye===1?x:_,ri=ye===0?A:T,Rt=Math.sin(At),dt=Math.cos(At),pt=Math.sin(ri),oi=Math.cos(ri),ht=Se==null?void 0:Se.samplerData,Et=de?(vt,Bt,qt)=>.5*(Os(vt,Bt,M)+Os(qt,Bt,ht)):(vt,Bt,qt)=>Os(vt,Bt,M),Dt=r.outerEdges[ye],Tt=e&&te>3?te-3:1,ie=M!=null&&M.some(vt=>vt!=null),Ht=ht!=null&&ht.some(vt=>vt!=null),hr=ie||Ht,Ke=1/Ee,Lt=Dt.index0;ot(!Pe||bf(Pe[2]-Pe[0],l[2]-l[0])),(()=>{const vt=ye===1?-1:ye===3?1:0,Bt=ye===0?-1:ye===2?1:0,qt=(l[2]-l[0])*Ke,li=vt*qt,mi=Bt*qt,Lr=pe?vt*((x-_)*Ke):0,Dr=pe?0:Bt*Ke,Ze=Qt,xi=pe?At+Lr:At,m=pe?Math.sin(xi):Rt,D=pe?Math.cos(xi):dt,E=pe?At-Lr:At,p=pe?Math.sin(E):Rt,h=pe?Math.cos(E):dt,a=pe?ri:k(Ze+Dr),u=pe?pt:Math.sin(a),d=pe?oi:Math.cos(a),g=pe?ri:k(Ze-Dr),v=pe?pt:Math.sin(g),b=pe?oi:Math.cos(g);let S=0,C=0,O=0;{const B=0*Ke,G=pe?Ae:I*(1-B)+L*B,K=pe?Ge:G,ee=pe?F*(1-B)+z*B:ut,q=pe?At:_*(1-B)+x*B,oe=pe?Rt:Math.sin(q),ge=pe?dt:Math.cos(q),me=pe?k(B):ri,Me=pe?Math.sin(me):pt,Te=pe?Math.cos(me):oi,Fe=c+Et(G,ee,K);S=ge*Te*Fe,C=oe*Te*Fe,O=Me*Fe}let R=0,$=0,N=0;{const B=1*Ke,G=pe?Ae:I*(1-B)+L*B,K=pe?Ge:G,ee=pe?F*(1-B)+z*B:ut,q=pe?At:_*(1-B)+x*B,oe=pe?Rt:Math.sin(q),ge=pe?dt:Math.cos(q),me=pe?k(B):ri,Me=pe?Math.sin(me):pt,Te=pe?Math.cos(me):oi,Fe=c+Et(G,ee,K);R=ge*Te*Fe,$=oe*Te*Fe,N=Me*Fe}for(let B=1;BI$t(r[1],r[3],n,s)}const i=e.extentInRadians;return r=>$$t(i[1],i[3],r)}function L$t(t,e){const i=t.tile,{extent:r,surface:n}=i,s=t.geometryState,o=r[0],l=r[1],c=r[2]-o,f=r[3]-l,_=s.clippingArea,x=_!=null?Math.max(0,(_[0]-o)/c):0,T=_!=null?Math.max(0,(_[1]-l)/f):0,A=_!=null?Math.min(1,(_[2]-o)/c):1,M=_!=null?Math.min(1,(_[3]-l)/f):1,I=s.numVerticesPerSide,L=(I-2)**2,F=L+s.neighborData.edgeResolutions.reduce((j,H)=>j+H+1,0),z=n.renderer.tileGeometryCache.acquire(F),k=t.geometry,U=k.boundingBox;Bn(U),k.numVerticesPerSide=s.numVerticesPerSide,k.vertexAttributes=z,rs(k.uvRange,x,T,A,M),D$t(t),DFe(t,L),PFe(t),LFe(k,s.numVerticesPerSide,[],[0,I-1],[0,I-1],s.wireframe),t.intersectionData=null}function D$t(t){const e=t.tile;if(!e.intersectsClippingArea)return;const i=e.surface,r=t.geometryState,n=r.samplerData,s=t.localOrigin,o=i.isWebMercatorOnPlateeCarree,l=r.clippingArea,c=l??Rce,f=e.extent,_=f[0],x=f[1],T=f[2],A=f[3],M=Math.max(_,c[0]),I=Math.min(T,c[2]),L=Math.max(x,c[1]),F=Math.min(A,c[3]),z=e.ellipsoid.radius,k=e.horizontalScale,U=r.numVerticesPerSide,j=U-1,H=U-2,Y=t.geometry,Q=Y.vertexAttributes,ne=Q.position,re=Q.uv0,{typedBuffer:he,typedBufferStride:ce}=Q.normalCompressed,be=Y.uvRange,ye=be[0],pe=be[1],Ee=be[2],te=be[3],le=Y.boundingBox,de=s[0],ve=s[1],Se=s[2],Ae=ne.typedBuffer,Pe=ne.typedBufferStride;let Ge=0;const ut=Je(x,L,F),Ft=o?(Math.PI/2-2*Math.atan(Math.exp(-ut/z)))*z:ut*k,Qt=1/j,At=Je(x*(1-Qt)+A*Qt,L,F);let ri=Ft,Rt=o?(Math.PI/2-2*Math.atan(Math.exp(-At/z)))*z:At*k;for(let dt=1;dt<=H;dt++){const pt=dt/j,oi=Je(x*(1-pt)+A*pt,L,F),ht=Je(pt,pe,te),Et=Rt,Dt=(dt-1)/j,Tt=Je(x*(1-Dt)+A*Dt,L,F),ie=ri,Ht=(dt+1)/j,hr=Je(x*(1-Ht)+A*Ht,L,F),Ke=o?(Math.PI/2-2*Math.atan(Math.exp(-hr/z)))*z:hr*k,Lt=Je(Ht,pe,te);ri=Rt,Rt=Ke;const vt=Je(_,M,I);let Bt=vt*k,qt=Os(vt,oi,n);const li=1/j,mi=Je(li,ye,Ee),Lr=Je(_*(1-mi)+T*mi,M,I);let Dr=mi,Ze=Lr,xi=Lr*k,m=Os(Lr,oi,n);if(dt===1){const D=xi-de,E=ri-ve,p=m-Se,h=0*Pe;Ae[h]=D,Ae[h+1]=E,Ae[h+2]=p,Nf(D,E,p,le);const a=Je(li,ye,Ee);Rm(re,Ge,a,ht)}for(let D=1;D<=H;D++){const E=xi,p=m,h=(D+1)/j,a=Je(h,ye,Ee),u=Je(_*(1-h)+T*h,M,I),d=Ze;Ze=u;{const $=Ge+1,N=$*Pe;if(dt===1||D===H){const B=u*k,G=Os(u,oi,n);if(dt===1&&Dc[3],_>c[2],xqt.isLoaded||qt.isLeaf||qt.level===n.level);s.updatingRootTiles||(Bt?Bt.intersectsClippingArea&&(ot(!Bt.isLoaded),ot(!Bt.isLeaf),ot(Bt.level===n.level)):ot((s==null?void 0:s.rootTiles)==null||!n.shouldHaveNeighbor(vt)))}const Ge=Je(pe===1?_:f,H,Y),ut=Je(pe===0?T:x,Q,ne),Ft=Pe==null?void 0:Pe.samplerData,Qt=M.outerEdges[pe],At=e&&le>3?le-3:1,ri=Je(pe===1?1:0,z,U),Rt=Je(pe===0?1:0,k,j),dt=Se?(vt,Bt)=>.5*(Os(vt,Bt,Ft)+Os(vt,Bt,ye)):(vt,Bt)=>Os(vt,Bt,ye),pt=(_-f)/te,oi=Ee?pe===1?pt:-pt:0,ht=Ee?0:pe===0?pt:-pt,Et=-oi,Dt=-ht;let Tt=0,ie=0,Ht=0;{const vt=0/te,Bt=Ee?Ge:Je(f*(1-vt)+_*vt,H,Y),qt=Ee?Je(x*(1-vt)+T*vt,Q,ne):ut,li=dt(Bt,qt);Tt=Bt*I,ie=L(qt),Ht=li}let hr=0,Ke=0,Lt=0;{const vt=1/te,Bt=Ee?Ge:Je(f*(1-vt)+_*vt,H,Y),qt=Ee?Je(x*(1-vt)+T*vt,Q,ne):ut,li=dt(Bt,qt);hr=Bt*I,Ke=L(qt),Lt=li}for(let vt=1;vtk$t(r,e):r=>z$t(r,i)}function LFe(t,e,i,r,n,s){const o=e-1,l=t.vertexAttributes.count,c=2*(Math.min(e-2,r[1])-Math.max(1,r[0]))*(Math.min(e-2,n[1])-Math.max(1,n[0])),f=qv.map((k,U)=>U===0&&n[1]1||U===3&&r[0]>1),_=t.outerEdges.reduce((k,U,j)=>k+(f[j]?0:o-2+U.count-1),0),x=i.reduce((k,U)=>k+o*(2*(U.latitudeResolution-1)+1),0),T=s?2:1,A=3*(c+_+x)*T,M=l>=A$t?new Uint32Array(A):new Uint16Array(A);let I=0;const L=e-2,F=o-2;ot(F>=0);const z=(k,U,j,H,Y,Q)=>{const ne=k*Y,re=Q[ne],he=Q[ne+1],ce=Q[ne+2],be=U*Y,ye=Q[be],pe=Q[be+1],Ee=Q[be+2],te=j*Y,le=Q[te],de=Q[te+1],ve=Q[te+2],Se=H*Y,Ae=Q[Se],Pe=Q[Se+1],Ge=Q[Se+2];return(ye-Ae)*(ye-Ae)+(pe-Pe)*(pe-Pe)+(Ee-Ge)*(Ee-Ge)>(re-le)*(re-le)+(he-de)*(he-de)+(ce-ve)*(ce-ve)};if(s){const k=(j,H,Y)=>{M[I++]=j,M[I++]=H,M[I++]=H,M[I++]=Y,M[I++]=Y,M[I++]=j,pa&&(ot(j{for(let j=Math.max(n[0],1)-1;j{for(let j=0;j<4;++j){const H=I;if(f[j])continue;const Y=t.outerEdges[j],Q=t.innerEdges[j];let ne=0,re=0;const he=Y.count,ce=Q.count;ot(ce===o-1);let be=0;const ye=j===1||j===2?(pe,Ee,te)=>k(pe,Ee,te):(pe,Ee,te)=>k(pe,te,Ee);for(;ne{const H=t.outerEdges[j.connectedOuterEdgeOffset];let Y=H.getVertexIndex(0),Q=H.stride;for(let ne=0;ne{const U=Math.max(n[0],1)-1,j=Math.min(n[1],e-2)-1,H=Math.max(r[0],1)-1,Y=Math.min(r[1],e-2)-1;for(let Q=U;Q{for(let U=0;U<4;++U){if(f[U])continue;const j=t.outerEdges[U],H=t.innerEdges[U];let Y=0,Q=0;const ne=j.count,re=H.count;ot(re===o-1);const he=U===1||U===2,ce=he?1:2,be=he?2:1,ye=j.index0,pe=j.stride,Ee=H.index0,te=H.stride;for(;Y{const j=t.outerEdges[U.connectedOuterEdgeOffset];let H=j.getVertexIndex(0),Y=j.stride;for(let Q=0;Q{const Et=x[oi===0?1:3],Dt=x[pt===0?0:2],Tt=Math.cos(Et),ie=Math.sin(Et),Ht=Math.sin(Dt),hr=Math.cos(Dt),Ke=_+ht;A=hr*Tt*Ke,M=Ht*Tt*Ke,I=ie*Ke},F=f?(()=>{const pt=t.geometryState.clippingArea,oi=c.extent,ht=pt!=null&&(oi[3]>pt[3]||oi[2]>pt[2]||oi[1]{const Ht=Dt===0?be[0]:be[2],hr=Tt===0?be[1]:be[3],Ke=ht?Je(Ht,pt[0],pt[2]):Ht,Lt=ht?Je(hr,pt[1],pt[3]):hr,vt=ie;A=Ke*T,M=Et(Lt),I=vt}})():L;let z=0,k=0,U=0,j=0,H=0,Y=0,Q=0,ne=0,re=0;const he=f&&t.tile.surface.isWebMercatorOnPlateeCarree,ce=(pt,oi,ht,Et,Dt)=>{let Tt=0,ie=0,Ht=0;if(f){const hr=oi*T,Ke=he?(Math.PI/2-2*Math.atan(Math.exp(-ht/_)))*_:ht*T;Tt=hr-A,ie=Ke-M,Ht=Et-I}else{const hr=Pce(pt),Ke=pt.tile,Lt=Ke.extent,vt=Ke.extentInRadians,Bt=(oi-Lt[0])/(Lt[2]-Lt[0]),qt=(ht-Lt[1])/(Lt[3]-Lt[1]),li=vt[0]*(1-Bt)+vt[2]*Bt,mi=hr(qt),Lr=Math.cos(mi),Dr=Math.sin(mi),Ze=Math.sin(li),xi=Math.cos(li),m=_+Et;Tt=xi*Lr*m-A,ie=Ze*Lr*m-M,Ht=Dr*m-I}switch(Dt){case 0:Q+=Tt,ne+=ie,re+=Ht;break;case 1:j-=Tt,H-=ie,Y-=Ht;break;case 2:Q-=Tt,ne-=ie,re-=Ht;break;case 3:j+=Tt,H+=ie,Y+=Ht}},be=c.extent,ye=e.clippingArea??Rce,pe=be[0],Ee=be[2],te=be[1],le=be[3],de=[le>ye[3],Ee>ye[2],teMath.max(ye[0],Math.min(ye[2],pt)),ut=pt=>Math.max(ye[1],Math.min(ye[3],pt)),Ft=s.uvRange[0],Qt=s.uvRange[1],At=s.uvRange[2],ri=s.uvRange[3],Rt=pt=>{var hr;const oi=n[pt].cornerTiles;z=0,k=0,U=1,j=0,H=0,Y=0,Q=0,ne=0,re=0;let ht=1/0;for(let Ke=0;Ke<4;++Ke)ht=Math.min(ht,((hr=oi[Ke])==null?void 0:hr.level)??1/0);for(let Ke=0;Ke<4;++Ke){const Lt=oi[Ke];$R[Ke]=(Lt==null?void 0:Lt.level)===ht?Lt:null}let Et=1,Dt=0;for(let Ke=0;Ke<4;++Ke){const Lt=$R[Ke];Lt&&(Et=Math.max(Et,Lt==null?void 0:Lt.renderData.geometryState.numVerticesPerSide),Dt=Lt.extent[2]-Lt.extent[0])}const Tt=Dt,ie=Et;ot(ie>1);const Ht=Tt/ie;for(let Ke=0;Ke<4;++Ke){const Lt=$R[(Ke+3)%4],vt=$R[Ke%4];if(!Lt&&!vt)continue;const Bt=Ke===0?1:Ke===1?2:Ke===2?3:0,qt=Ke===0?2:Ke===1?3:Ke===2?0:1;if(Lt&&vt){const li=bY[Ke][0]*Ht,mi=bY[Ke][1]*Ht,Lr=Lt.extent,Dr=Ge(Lr[Bt===0||Bt===1?2:0]+li),Ze=ut(Lr[Bt===0||Bt===3?3:1]+mi),xi=vt.extent,m=Ge(xi[qt===0||qt===1?2:0]+li),D=ut(xi[qt===0||qt===3?3:1]+mi),E=Lt.renderData,p=vt.renderData,h=Os(Dr,Ze,E.geometryState.samplerData),a=Os(m,D,p.geometryState.samplerData);ce(E,Dr,Ze,.5*(h+a),Ke)}else{const li=Lt??vt,mi=Lt?Bt:qt,Lr=li.extent,Dr=bY[Ke],Ze=Ge(Lr[mi===0||mi===1?2:0]+Dr[0]*Ht),xi=ut(Lr[mi===0||mi===3?3:1]+Dr[1]*Ht),m=li.renderData,D=Os(Ze,xi,m.geometryState.samplerData);ce(m,Ze,xi,D,Ke)}}if(!f){const Ke=Math.sqrt(A*A+M*M+I*I);z=A/Ke,k=M/Ke,U=I/Ke}if(f||U*U<.999){const Ke=Math.sqrt(j*j+H*H+Y*Y);j/=Ke,H/=Ke,Y/=Ke;const Lt=Math.sqrt(Q*Q+ne*ne+re*re);Q/=Lt,ne/=Lt,re/=Lt,z=Y*ne-H*re,k=j*re-Y*Q,U=H*Q-j*ne;const vt=1/Math.sqrt(z*z+k*k+U*U);z*=vt,k*=vt,U*=vt}};for(let pt=0;pt<4;++pt){const oi=pt,ht=(pt+1)%4,Et=pt===0||pt===1?1:0,Dt=pt===0||pt===3?1:0,Tt=Je(Et,Ft,At),ie=Je(Dt,Qt,ri),Ht=o[oi],hr=pt===0||pt===3?Ht.count-1:0,Ke=o[ht],Lt=pt===0||pt===1?Ke.count-1:0,vt=n[pt].cornerTiles;let Bt=-1;for(let mi=0;mi<4;++mi){const Lr=vt[mi];Lr&&(Bt===-1||n_(vt[Bt],Lr)>0)&&(Bt=mi)}const qt=Bt,li=vt[qt];if(li!==c){const mi=c.level-li.level,Lr=2**mi,Dr=[li.lij[0]+mi,li.lij[1]*Lr,li.lij[2]*Lr],Ze=[Dr[1]+Lr===c.lij[1],pt===0&&(qt===1||qt===0&&li!==vt[3])||pt===1&&(qt===0||qt===1&&li!==vt[2]),Dr[1]===c.lij[1]+1,pt===2&&(qt===3||qt===2&&li!==vt[1])||pt===3&&(qt===2||qt===3&&li!==vt[0])],xi=Ze.reduce((h,a)=>h+(a?1:0),0);ot(xi===1||xi===2);let m=-1,D=-1;const E=li.renderData;if(xi===1){const h=Ze.findIndex(u=>u);ot(0<=h&&h<=3),m=(h+2)%4;const a=t.geometryState.neighborData.edgeResolutions[h];D=c.getNeighborEdgeStartVertexIndex(h,li)*a+a*(h===0&&pt===0||h===1&&pt===0||h===2&&pt===1||h===3&&pt===3?1:0)}else{ot(Ze[1]||Ze[3]),m=Ze[1]?3:1;const h=E.geometryState.neighborData.edgeResolutions[m];D=pt===0||pt===3?0:h}const p=E.geometry.outerEdges[m];{const h=Ht.index0+hr*Ht.stride,a=Ke.index0+Lt*Ke.stride,u=p.index0+D*p.stride;{const d=p.attributes.position,g=d.typedBuffer,v=u*d.typedBufferStride,b=t.localOrigin,S=p.localOrigin,C=g[v]+S[0]-b[0],O=g[v+1]+S[1]-b[1],R=g[v+2]+S[2]-b[2];Nf(C,O,R,l);{const $=Ht.attributes.position,N=$.typedBuffer,B=h*$.typedBufferStride;N[B]=C,N[B+1]=O,N[B+2]=R}{const $=Ke.attributes.position,N=$.typedBuffer,B=a*$.typedBufferStride;N[B]=C,N[B+1]=O,N[B+2]=R}}Rm(Ht.attributes.uv0,h,Tt,ie),Rm(Ke.attributes.uv0,a,Tt,ie);{const d=p.attributes.normalCompressed.typedBuffer,g=u*p.attributes.normalCompressed.typedBufferStride;{const v=Ht.attributes.normalCompressed,b=v.typedBuffer,S=h*v.typedBufferStride;b[S]=d[g],b[S+1]=d[g+1]}{const v=Ke.attributes.normalCompressed,b=v.typedBuffer,S=a*v.typedBufferStride;b[S]=d[g],b[S+1]=d[g+1]}}}}else{const mi=de[oi],Lr=de[ht];let Dr;if(mi||Lr){const D=Je(pe*(1-Et)+Ee*Et,ve,Se),E=Je(te*(1-Dt)+le*Dt,Ae,Pe),p=e.samplerData;Dr=Os(D,E,p)}else Dr=U$t(vt);F(Et,Dt,Dr),Rt(pt);const Ze=A-r[0],xi=M-r[1],m=I-r[2];Nf(Ze,xi,m,l),Ht.setVertexFromValuesRawPositionUVNormal(hr,Ze,xi,m,Tt,ie,z,k,U),Ke.setVertexFromValuesRawPositionUVNormal(Lt,Ze,xi,m,Tt,ie,z,k,U)}}for(let pt=0;pt<4;++pt)$R[pt]=null}function U$t(t){var s,o;const e=t.reduce((l,c)=>Math.min(l,(c==null?void 0:c.level)??1/0),1/0);pa&&(ot(!t[0]||!t[2]||Fie(t[0],t[2],ti.SOUTH_WEST)),ot(!t[1]||!t[3]||Fie(t[1],t[3],ti.NORTH_WEST)));let i=0,r=0;for(let l=0;l<4;++l){const c=t[l];if(c&&c.level===e){const f=l===0||l===1,_=l===0||l===3,x=c.extent,T=x[f?0:2],A=x[_?1:3],M=(o=(s=c.renderData)==null?void 0:s.geometryState)==null?void 0:o.samplerData;r+=Os(T,A,M),i++}}const n=i?r/i:0;return ot(n!=null),n}function EG(t){const e=t.vao,i=t.geometry.vertexAttributes.position.typedBuffer;e.vertexBuffers.geometry.setSubData(i,0,0,i.length)}const bY=[[0,1],[1,0],[0,-1],[-1,0]],wl=new NIt,Rce=ose(-1/0,-1/0,1/0,1/0),$R=[null,null,null,null];function kFe(t,e,i){if(!e)return!1;const r=n_(t,e);return r>0||r===0&&i>=2}let V$t=class extends Cce{constructor(e,i,r,n,s){super(),this._horizontalScaleFactor=1,this._extentInRenderSR=Ni(),this._baseUsedMemory=900,this.init(e,i,r,n,s)}init(e,i,r,n,s){super.init(e,i,r,n,s);const o=s.view.renderSpatialReference,l=s.spatialReference,c=o!=null&&uL(o)&&l!=null&&l.isGeographic?this.ellipsoid.radius*Math.PI/180:1;this._horizontalScaleFactor=c;const f=this.surface.isWebMercatorOnPlateeCarree,_=this._extentInRenderSR,x=this.extent;if(f){const T=nt(x[0],x[1],0);el(T,at.WebMercator,T,at.PlateCarree);const A=nt(x[2],x[3],0);el(A,at.WebMercator,A,at.PlateCarree),_[0]=T[0],_[1]=T[1],_[2]=A[0],_[3]=A[1]}else for(let T=0;T<4;++T)_[T]=x[T]*c;this.centerAtSeaLevel[0]=.5*(_[0]+_[2]),this.centerAtSeaLevel[1]=.5*(_[1]+_[3]),this.centerAtSeaLevel[2]=0,this._edgeLen=Math.max(_[2]-_[0],_[3]-_[1]),this._edgeLen2=this._edgeLen*this._edgeLen,this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateCenter();const e=this._extentInRenderSR,i=.5*(e[2]-e[0]),r=.5*(e[3]-e[1]),n=Math.sqrt(i*i+r*r),s=.5*(this.elevationBounds[0]-this.elevationBounds[1]),o=Math.max(n,s);this._center[Fo.MIDDLE][3]=o}_calculateFrustumVisibilityStatus(e){const i=this._aabb(),r=i[0],n=i[1],s=i[2],o=i[3],l=i[4],c=i[5];let f=!0;for(let _=0;_<6;_++){const x=e[_],T=x[0],A=x[1],M=x[2],I=x[3];if(T*(T>0?r:o)+A*(A>0?n:l)+M*(M>0?s:c)+I>=0)return gc.OUTSIDE;f=f&&T*(T<0?r:o)+A*(A<0?n:l)+M*(M<0?s:c)+I<=0}return f?gc.INSIDE:gc.INTERSECTS}_aabb(){const e=this._extentInRenderSR;return Ort(e[0],e[1],this.elevationBounds[0],e[2],e[3],this.elevationBounds[1])}intersectsRay(e,i,r,n){return m8[0]=1/i[0],m8[1]=1/i[1],m8[2]=1/i[2],gle(this._aabb(),e,m8,r,n)}createGeometry(){L$t(this.renderData,this._horizontalScaleFactor),this.setMemoryDirty()}getDefaultVerticesPerSide(){return this.level<9?3:2}updateCornerElevations(){N$t(this.renderData,this._horizontalScaleFactor)}updateEdgeElevations(){F$t(this.renderData,this._horizontalScaleFactor)}get horizontalScale(){return this._horizontalScaleFactor}};const m8=W();let B$t=class{constructor(){this.extent=Xi(),this.minLevel=0,this.maxLevel=0,this.callback=null}},fk=class extends ze{constructor(){super(...arguments),this._queries=new Pi({initialSize:10}),this._queriesInvPtr=0,this._queryQueue=new Pi({initialSize:30}),this._queryPool=new Ec(B$t)}queryVisibleLevelRange(e,i,r,n){const s=this._queryPool.acquire();mm(s.extent,e),s.minLevel=i??-Number.MAX_VALUE,s.maxLevel=r??Number.MAX_VALUE,s.callback=n,this._queryQueue.push(s),this.notifyChange("updating")}get updating(){return this._queryQueue.length!==0}prepare(){for(;this._queries.length0;){const e=this._queryQueue.pop();this._queries.push(e)}this._queriesInvPtr=this._queries.length}process(){for(let e=0;e=this._queriesInvPtr),i.callback=null}this._queries.clear(),this.notifyChange("updating")}queriesForTile(e){const i=e.level;let r=0;for(;r=n.minLevel&&i<=n.maxLevel&&s[0]<=e.extent[2]&&s[2]>=e.extent[0]&&s[1]<=e.extent[3]&&s[3]>=e.extent[1]?(this._queries.swapElements(r,this._queriesInvPtr-1),this._queriesInvPtr--):r++}}};y([w()],fk.prototype,"updating",null),fk=y([Z("esri.views.3d.terrain.ScaleRangeQueries")],fk);function j$t(t,e,i,r){const n=Math.cos(i);t[0]=Math.cos(e)*n*r,t[1]=Math.sin(e)*n*r,t[2]=Math.sin(i)*r}let G$t=class extends Cce{constructor(e,i,r,n,s){super(),this._convexHull=new Array(24),this._boundingSphere=co(),this._baseUsedMemory=1816,this.init(e,i,r,n,s)}init(e,i,r,n,s){super.init(e,i,r,n,s);const o=this.ellipsoid.radius,l=this.extentInRadians[0],c=this.extentInRadians[1],f=this.extentInRadians[2],_=this.extentInRadians[3],x=ui(c,_,.5),T=ui(l,f,.5),A=e===0?0:Math.min(Math.abs(c),Math.abs(_));this._edgeLen=(f-l)*Math.cos(A)*o,this._edgeLen2=this._edgeLen*this._edgeLen,this._curvatureHeight=o-Math.sqrt(o*o-this._edgeLen2/4),j$t(this.centerAtSeaLevel,T,x,this.ellipsoid.radius),Ye(this.up,this.centerAtSeaLevel),this.updateRadiusAndCenter()}updateRadiusAndCenter(){this._updateBoundingVolumes();const e=this._center;if(this.lij[0]===0)Ie(e[Fo.MIDDLE],0,0,0),Ie(e[Fo.TOP],0,0,0),Ie(e[Fo.BOTTOM],0,0,0),e[Fo.MIDDLE][3]=this.ellipsoid.radius+this.elevationBounds[1];else{this._updateCenter();const i=e[Fo.MIDDLE],r=this.convexHull;let n=0;for(let s=0;s<8;++s)n=Math.max(n,H$t(i,r,3*s));e[Fo.MIDDLE][3]=Math.sqrt(n)}}_calculateFrustumVisibilityStatus(e){if(!c2(e,this._boundingSphere))return gc.OUTSIDE;if(this.lij[0]<10)return gc.INTERSECTS;const i=this.convexHull,r=this.surface.view.state.camera.near;let n=!0;for(let s=0;s<_P;s++){const o=s===Rn.NEAR,l=e[s],c=l[0],f=l[1],_=l[2],x=l[3]-(o?r:0);let T=!1;for(let A=0;A<8;++A){const M=3*A;if(c*i[M]+f*i[M+1]+_*i[M+2]+x<0){if(T=!0,!n)break}else n=!1}if(!T)return gc.OUTSIDE}return n?gc.INSIDE:gc.INTERSECTS}computeElevationBounds(){super.computeElevationBounds(),this._updateBoundingVolumes()}createGeometry(){M$t(this.renderData,this._getPatchType()),this._updateBoundingVolumes(),this.setMemoryDirty()}_updateBoundingVolumes(){this._updateConvexHull(),this._updateBoundingSphere(),pa&&this._checkBVs()}_updateBoundingSphere(){const e=this._boundingSphere,i=e,r=this.elevationBounds,n=this.ellipsoid.radius,s=r[1];if(this.level===0)Ie(i,0,0,0),e[3]=n+s;else{const o=this.extentInRadians,l=.5*(o[0]+o[2]),c=o[1],f=o[3];Jx(L_e,l,c,n),Jx(D_e,l,f,n),Be(i,L_e,D_e);const _=.5*(r[0]+r[1]);De(i,i,(n+_)/$h(i));const x=this.convexHull;let T=0;const A=(I,L)=>{const F=I[0]-x[3*L],z=I[1]-x[3*L+1],k=I[2]-x[3*L+2];return Math.sqrt(F*F+z*z+k*k)};for(let I=0;I<8;++I){const L=A(i,I);T=Math.max(T,L)}const M=T;e[3]=M+2}}_updateConvexHull(){const e=this.extentInRadians,i=this.ellipsoid.radius;if(this.level===0)return;const r=this.elevationBounds,n=this._getPatchType(),s=this.surface.isWebMercator,o=s&&n===_f.HAS_NORTH_POLE,l=s&&n===_f.HAS_SOUTH_POLE,c=l||o,f=Math.PI/2,_=e[0],x=e[2],T=l?-f:e[1],A=o?f:e[3],M=.5*(_+x),I=r[0],L=i+(c?Math.min(0,I-1):I),F=(Ee,te,le)=>Jx(Ee,te,le,L),z=W(),k=W(),U=W(),j=W();F(z,_,T),F(k,_,A),F(U,x,A),F(j,x,T);const H=(Ee,te)=>{for(let le=0;le<3;++le)this._convexHull[3*te+le]=Ee[le]};H(z,0),H(k,1),H(U,2),H(j,3);const Y=r[1],Q=i+(c?Math.max(0,Y+1):Y),ne=W(),re=W(),he=W();Jx(re,M,A,L),Jx(he,M,T,L),Be(ne,re,he),Ye(ne,ne);const ce=W(),be=W(),ye=(Ee,te)=>{xn(be,Ee,te),Ye(be,be);const le=-Ve(Ee,ce)/Ve(be,ce);ot(le>=0),De(be,be,le),Be(Ee,Ee,be)};if(2**this.lij[0]>2*this.lij[1]){const Ee=he,te=W();Wt(te,$_e,Ee),Ye(te,te),Wt(ce,Ee,te),Ye(ce,ce),ot(bf(Ve(ce,Ee)/$h(Ee),0)),ye(z,k),ye(j,U),H(z,0),H(j,3)}else if(2**this.lij[0]!==2*this.lij[1]){const Ee=re,te=W();Wt(te,$_e,Ee),Ye(te,te),Wt(ce,te,Ee),Ye(ce,ce),ye(k,z),ye(U,j),H(k,1),H(U,2)}const pe=(Ee,te)=>{const le=Q/Ve(te,ne);for(let de=0;de<3;++de)this._convexHull[3*Ee+de]=te[de]*le};pe(4,z),pe(5,k),pe(6,U),pe(7,j)}_getPatchType(){const e=this.lij[1],i=e===0,r=e===(1<{for(let Dt=0;Dt<3;++Dt)ht[Dt]=x[3*Et+Dt]};{const ht=W(),Et=W(),Dt=W(),Tt=W(),ie=W(),Ht=(hr,Ke,Lt,vt)=>{T(Et,hr),T(Dt,Ke),T(Tt,Lt),xn(Et,Et,Dt),xn(Tt,Tt,Dt),Wt(ht,Et,Tt),Ye(ht,ht);const Bt=Ve(ht,Dt);T(ie,vt);const qt=Ve(ht,ie),li=Math.abs(qt-Bt);ot(bf(li,0),`Non coplanar ${hr},${Ke},${Lt},${vt} diff = ${li}`)};Ht(0,1,2,3),Ht(4,5,6,7),Ht(0,1,4,5),Ht(1,2,5,6),Ht(2,3,6,7),Ht(3,0,7,4)}const A=Ja(24),M=(ht,Et,Dt)=>{const Tt=4*ht;for(let ie=0;ie<3;++ie)A[Tt+ie]=Et[ie];A[Tt+3]=Dt},I=W(),L=W(),F=W(),z=W(),k=(ht,Et,Dt,Tt)=>{T(I,Et),T(L,Dt),T(F,Tt),xn(I,I,L),Ye(I,I),xn(F,F,L),Ye(F,F),Wt(z,I,F),Ye(z,z);const ie=Ve(z,L);M(ht,z,ie)};k(0,0,1,2),k(1,1,0,4),k(2,1,5,2),k(3,3,2,6),k(4,4,0,3),k(5,4,6,5);const U=1,j=(ht,Et,Dt,Tt)=>{const ie=4*ht;return A[ie]*Et+A[ie+1]*Dt+A[ie+2]*Tt-A[ie+3]},H=(ht,Et,Dt,Tt)=>j(ht,Et,Dt,Tt)>=-U,Y=(ht,Et)=>H(ht,Et[0],Et[1],Et[2]),Q=2**this.lij[0]>2*this.lij[1],ne=(ht,Et,Dt)=>Math.sqrt(zFe(ht,Et,Dt,r[0],r[1],r[2]))ne(ht[0],ht[1],ht[2]),he=(ht,Et)=>ne(ht[Et],ht[Et+1],ht[Et+2]),ce=this.extentInRadians,be=.5*(ce[0]+ce[2]),ye=ce[1],pe=ce[3],Ee=W(),te=W();Jx(Ee,be,pe,l),Jx(te,be,ye,l);const le=Q?"Upper":"Lower";let de=!0;for(let ht=0;ht<6;++ht){for(let Et=0;Et<8;++Et){const Dt=3*Et,Tt=H(ht,x[Dt],x[Dt+1],x[Dt+2]);de&&(de=Tt),ot(Tt,`Tile[${this.lij}] Convex hull point ${Et} outside of plane ${ht}`)}ot(Y(ht,te),`Tile[${this.lij}] (${le}) bottom mid outside of plane ${ht}`),ot(Y(ht,Ee),`Tile[${this.lij}] (${le}) top mid outside of plane ${ht}`)}ot(de,"Not all convex hull points are inside convex hull polyhedron"),ot(re(te),`Tile[${this.lij}] (${le}) bottom mid outside of bounding sphere`),ot(re(Ee),`Tile[${this.lij}] (${le}) top mid outside of bounding sphere`);for(let ht=0;ht<8;++ht){const Et=he(x,3*ht);ot(Et,`Tile[${this.lij}] Convex hull point ${ht} outside of bounding sphere`)}for(let ht=0;ht<6;++ht)for(let Et=0;Et<8;++Et){const Dt=3*Et;H(ht,x[Dt],x[Dt+1],x[Dt+2])||console.error(`Tile[${this.lij}] Convex hull point ${Et} outside of plane ${ht}`)}const ve=this.extentInRadians,Se=Math.max(ve[2]-ve[0],ve[3]-ve[1]),Ae=Math.round(Se*s),Pe=this.renderData;if(!Pe)return;const{geometry:Ge,localOrigin:ut}=Pe,Ft=(oi=Ge.vertexAttributes)==null?void 0:oi.position;if(!Ft)return;const Qt=Ft.count,At=W(),ri=Ge.numVerticesPerSide-2,Rt=ri*ri,dt=Pe.geometryState.neighborData,pt=dt.edgeResolutions.reduce((ht,Et)=>ht+Et+1,0);for(let ht=0;ht0;Ft.getVec(ht,n),Be(At,n,ut);const Ke=$h(At)-s;let Lt=0,vt=!1;const Bt=o[0]-Ke,qt=Ke-o[1],li=Bt>c,mi=qt>c,Lr=li||mi,Dr=()=>{const xi=Et?"internal":Dt&&!Tt?"edge":Tt?"corner":"pole";return`Tile[${this.lij}].vertex[${ht}]:${xi}`+(li?"(below)":mi?"(above)":"")+(hr?"(Neighbor)":"")},Ze=O9(At,r);if(Ze>=i+f){const xi=Ze-i;Lr||(console.error(`${Dr()} is out of the bounding sphere by ${xi.toFixed(0)} / ${i.toFixed(0)}[tol=${f}] h=${Ke.toFixed(0)} / [${o[0].toFixed(0)}..${o[1].toFixed(0)}] (${(xi/i).toFixed(0)})`),vt=!0)}for(let xi=0;xi<6;++xi)if(!H(xi,At[0],At[1],At[2])){const m=j(xi,At[0],At[1],At[2]),D=ht%ri,E=(ht-D)/ri;xi===0&&Bt||xi===5&&qt||(console.error(`${Dr()} (${D},${E})|${ri}] is out of the bounding trapezoid plane ${xi} h=${Math.round(Ke)} / [${Math.round(o[0])}..${Math.round(o[1])}] dist=${Math.round(m)} radii = ${Math.round(i)}/${Math.round(_)}} : maxL = ${Ae}`),++Lt)}if(vt||Lt>0)break}}get convexHull(){return this._convexHull}};const I_e=[128,64,64,32,16,8,8,4];function H$t(t,e,i){return zFe(t[0],t[1],t[2],e[i],e[i+1],e[i+2])}function zFe(t,e,i,r,n,s){const o=r-t,l=n-e,c=s-i;return o*o+l*l+c*c}const Jx=(t,e,i,r)=>{const n=Math.cos(e),s=Math.sin(e),o=Math.cos(i),l=Math.sin(i);t[0]=r*o*n,t[1]=r*o*s,t[2]=r*l},$_e=[0,0,1],L_e=W(),D_e=W();let B0=class extends ze{constructor(){super(...arguments),this.fovX=0,this.fovY=0,this.relativeWidthLimit=0,this.relativeHeightLimit=0,this.maxLod=0,this.angledSplitBias=0,this.aboveGround=!0}};y([w()],B0.prototype,"fovX",void 0),y([w()],B0.prototype,"fovY",void 0),y([w()],B0.prototype,"relativeWidthLimit",void 0),y([w()],B0.prototype,"relativeHeightLimit",void 0),y([w()],B0.prototype,"maxLod",void 0),y([w()],B0.prototype,"angledSplitBias",void 0),y([w()],B0.prototype,"aboveGround",void 0),y([w()],B0.prototype,"frustum",void 0),B0=y([Z("esri.views.3d.terrain.SplitLimits")],B0);const q$t=ls().vec3f(J.POSITION).vec2i16(J.UV0).vec2i16(J.NORMALCOMPRESSED,{glNormalized:!0});let W$t=class{constructor(e){this._storage=new G9((i,r)=>e.newCache(i,r),"TileGeometry")}acquire(e){const r=Math.ceil(e/4)*4,n=this._storage.pop(N_e(r));if(n)return n;const s=q$t.createBuffer(r);return s.release=()=>this._release(s),s}_release(e){const i=e.count;this._storage.put(N_e(i),e)}clear(){this._storage.clear()}destroy(){this._storage.destroy()}};function N_e(t){return t.toString()}let UFe=class extends nh{constructor(){super(...arguments),this.blendMode=gt.Normal}};y([fe({count:gt.COUNT})],UFe.prototype,"blendMode",void 0);let k$=class extends UFe{constructor(){super(...arguments),this.output=Jo.Composite,this.baseOpacityMode=up.NotRequired,this.premultipliedSource=am.Off}};y([fe({count:Jo.COUNT})],k$.prototype,"output",void 0),y([fe({count:up.COUNT})],k$.prototype,"baseOpacityMode",void 0),y([fe()],k$.prototype,"premultipliedSource",void 0);var K2;function VFe(t){const e=new Cr;if(e.include(yFe),t.background===K2.Only){const i=t.output===Jo.ColorComposite;return i?e.fragment.uniforms.add(new Oi("backgroundColor",r=>r.backgroundColor)):e.fragment.include(Ece),e.fragment.code.add(V` + void main() { + fragColor = vec4(${i?V`backgroundColor`:V`gridColor(uv)`}, 1.0); + } + `),e}return e.include(vFe,t),e.fragment.uniforms.add(new Zt("tex",i=>i.texture)),e.fragment.uniforms.add(new ft("opacity",i=>i.opacity)),e.fragment.code.add(V`void main() { +vec4 bgColor = getBackground(uv); +fragColor = blendLayers(bgColor, texture(tex, uv), opacity); +}`),e}(function(t){t[t.BelowLayer=0]="BelowLayer",t[t.Only=1]="Only",t[t.COUNT=2]="COUNT"})(K2||(K2={}));const Y$t=Object.freeze(Object.defineProperty({__proto__:null,get BackgroundMode(){return K2},build:VFe},Symbol.toStringTag,{value:"Module"}));let X$t=class extends gFe{constructor(){super(...arguments),this.opacity=1,this.baseOpacity=1,this.texture=null,this.fboTexture=null,this.backgroundColor=Ka}},BFe=class jFe extends Hr{initializeProgram(e){return new Ir(e.rctx,jFe.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:hd(st.ONE,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji})}};BFe.shader=new Rr(Y$t,()=>we(()=>Promise.resolve().then(()=>FWt),void 0));let GFe=class extends k${constructor(){super(...arguments),this.background=K2.BelowLayer}};y([fe()],GFe.prototype,"background",void 0);let wY=class{constructor(e,i,r,n,s,o){this.texture=e,this.type=i,e.retain(),this.offsetAndScale=Mi(r.offset[0],r.offset[1],r.scale,r.scale),this.opacities=nt(n,s,o)}destroy(){this.texture.release()}};function Rb(t,e){return[t,e]}function Kx(t,e,i){return t[0]=e,t[1]=i,t}function Z$t(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}const w0=new iE("0/0/0/0");let J$t=class HFe{static create(e,i,r=null){const n=pp(e.spatialReference),s=i.origin||Rb(e.origin.x,e.origin.y),o=Rb(e.size[0]*i.resolution,e.size[1]*i.resolution),l=Rb(-1/0,-1/0),c=Rb(1/0,1/0),f=Rb(1/0,1/0);r!=null&&(Kx(l,Math.max(0,Math.floor((r.xmin-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymax)/o[1]))),Kx(c,Math.max(0,Math.floor((r.xmax-s[0])/o[0])),Math.max(0,Math.floor((s[1]-r.ymin)/o[1]))),Kx(f,c[0]-l[0]+1,c[1]-l[1]+1));const{cols:_,rows:x}=i;let T,A,M,I;return!r&&_&&x&&(Kx(l,_[0],x[0]),Kx(c,_[1],x[1]),Kx(f,_[1]-_[0]+1,x[1]-x[0]+1)),e.isWrappable?(T=Rb(Math.ceil(Math.round((n.valid[1]-n.valid[0])/i.resolution)/e.size[0]),f[1]),A=Rb(Math.floor((n.origin[0]-s[0])/o[0]),l[1]),M=Rb(T[0]+A[0]-1,c[1]),I=!0):(A=l,M=c,T=f,I=!1),new HFe(i.level,i.resolution,i.scale,s,l,c,f,o,A,M,T,I)}constructor(e,i,r,n,s,o,l,c,f,_,x,T){this.level=e,this.resolution=i,this.scale=r,this.origin=n,this.first=s,this.last=o,this.size=l,this.norm=c,this.worldStart=f,this.worldEnd=_,this.worldSize=x,this.wrap=T}normalizeCol(e){if(!this.wrap)return e;const i=this.worldSize[0];return e<0?i-1-Math.abs((e+1)%i):e%i}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){return this.origin[0]+e*this.norm[0]}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,r=!1){w0.set(i);const n=r?w0.col:this.denormalizeCol(w0.col,w0.world),s=w0.row;return Z$t(e,this.getXForColumn(n),this.getYForRow(s+1),this.getXForColumn(n+1),this.getYForRow(s)),e}getTileCoords(e,i,r=!1){w0.set(i);const n=r?w0.col:this.denormalizeCol(w0.col,w0.world);return Array.isArray(e)?Kx(e,this.getXForColumn(n),this.getYForRow(w0.row)):(e.x=this.getXForColumn(n),e.y=this.getYForRow(w0.row)),e}},kie=class{constructor(){this.spans=[]}acquire(e){this.lodInfo=e}release(){this.lodInfo=null,this.spans.length=0}forEach(e,i){const{spans:r,lodInfo:n}=this,{level:s}=n;if(r.length!==0)for(const{row:o,colFrom:l,colTo:c}of r)for(let f=l;f<=c;f++)e.call(i,s,o,n.normalizeCol(f),n.getWorldForColumn(f))}};kie.pool=new Ec(kie);let xY=class{constructor(e,i,r){this.row=e,this.colFrom=i,this.colTo=r}};const uo=new iE("0/0/0/0");let K$t=class qFe{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[r,n]=e,[s,o]=i,l=s-r,c=o-n,f=c!==0?l/c:0,_=(Math.ceil(n)-n)*f,x=(Math.floor(n)-n)*f;return new qFe(r,Math.floor(n),Math.ceil(o),f,l<0?_:x,l<0?x:_,l<0?s:r,l<0?r:s)}constructor(e,i,r,n,s,o,l,c){this.x=e,this.ymin=i,this.ymax=r,this.invM=n,this.leftAdjust=s,this.rightAdjust=o,this.leftBound=l,this.rightBound=c}incrRow(){this.x+=this.invM}getLeftCol(){return Math.max(this.x+this.leftAdjust,this.leftBound)}getRightCol(){return Math.min(this.x+this.rightAdjust,this.rightBound)}};const Ed=[[0,0],[0,0],[0,0],[0,0]],Q$t=1e-6;let cpi=class{constructor(e,i=null,r=e.lods[0].level,n=e.lods[e.lods.length-1].level){this.tileInfo=e,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const s=e.lods.filter(l=>l.level>=r&&l.level<=n);this.minScale=s[0].scale,this.maxScale=s[s.length-1].scale;const o=this._lodInfos=s.map(l=>J$t.create(e,l,i));s.forEach((l,c)=>{this._infoByLevel[l.level]=o[c],this._infoByScale[l.scale]=o[c],this.scales[c]=l.scale},this),this._wrap=e.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(e){return this._infoByLevel[typeof e=="number"?e:e.level]}getTileBounds(e,i,r=!1){uo.set(i);const n=this._infoByLevel[uo.level];return n?n.getTileBounds(e,uo,r):e}getTileCoords(e,i,r=!1){uo.set(i);const n=this._infoByLevel[uo.level];return n?n.getTileCoords(e,uo,r):e}getTileCoverage(e,i=192,r=!0,n="closest"){if(!r&&(e.scale>this.minScale||e.scale100)return null;let L=[];for(c=x;c=0;F--){const z=L[F];f=Math.min(f,z.getLeftCol()),_=Math.max(_,z.getRightCol())}if(f=Math.floor(f),_=Math.floor(_),c>=s.first[1]&&c<=s.last[1])if(l)if(s.size[0]s.last[0]||_=0;F--){const z=L[F];z.ymax>=c?z.incrRow():L.splice(F,1)}}return o}getTileParentId(e){uo.set(e);const i=this._infoByLevel[uo.level],r=this._lodInfos.indexOf(i)-1;return r<0?null:(this._getTileIdAtLOD(uo,this._lodInfos[r],uo),uo.id)}getTileResolution(e){const i=this._infoByLevel[typeof e=="object"?e.level:e];return i?i.resolution:-1}getTileScale(e){const i=this._infoByLevel[e.level];return i?i.scale:-1}intersects(e,i){uo.set(i);const r=this._infoByLevel[uo.level],n=e.lodInfo;if(n.resolution>r.resolution){this._getTileIdAtLOD(uo,n,uo);const o=n.denormalizeCol(uo.col,uo.world);for(const l of e.spans)if(l.row===uo.row&&l.colFrom<=o&&l.colTo>=o)return!0}if(n.resolution(I[0]=Math.min(I[0],L.row),I[1]=Math.max(I[1],L.row),I[2]=Math.min(I[2],L.colFrom),I[3]=Math.max(I[3],L.colTo),I),[1/0,-1/0,1/0,-1/0]),_=r.denormalizeCol(uo.col,uo.world),x=n.getColumnForX(r.getXForColumn(_)),T=n.getRowForY(r.getYForRow(uo.row)),A=n.getColumnForX(r.getXForColumn(_+1))-1,M=n.getRowForY(r.getYForRow(uo.row+1))-1;return!(x>f||Al||Mo.row===uo.row&&o.colFrom<=s&&o.colTo>=s)}normalizeBounds(e,i,r){if(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],this._wrap){const n=pp(this.tileInfo.spatialReference),s=-r*(n.valid[1]-n.valid[0]);e[0]+=s,e[2]+=s}return e}getSmallestInfoForScale(e){const i=this.scales;if(this._infoByScale[e])return this._infoByScale[e];if(e>i[0])return this._infoByScale[i[0]];for(let r=1;ri[r]+Q$t)return this._infoByScale[i[r-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(e){const i=this.scales;return this._infoByScale[e]||(e=i.reduce((r,n)=>Math.abs(n-e)=0;r--)if(e0&&(this._map.clear(),this._observable.notify())}delete(e){const i=this._map.delete(e);return i&&this._observable.notify(),i}entries(){return wi(this._observable),this._map.entries()}forEach(e,i){wi(this._observable),this._map.forEach((r,n)=>e.call(i,r,n,this),i)}get(e){return wi(this._observable),this._map.get(e)}has(e){return wi(this._observable),this._map.has(e)}keys(){return wi(this._observable),this._map.keys()}set(e,i){return this._map.set(e,i),this._observable.notify(),this}values(){return wi(this._observable),this._map.values()}[Symbol.iterator](){return wi(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}},eLt=class{constructor(e,i){this.item=e,this.controller=i,this.promise=null}},WFe=class{constructor(e){this._schedule=null,this._task=null,this._deferreds=new SY,this._controllers=new SY,this._processingItems=new SY,this._pausedSignal=m5(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new cU(e.peeker),this.process=e.process;const i=e.scheduler;e.priority&&i&&(this._task=i.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=en(this._schedule),this._task=en(this._task)}get updating(){var e;return!!((e=this._task)!=null&&e.updating)||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const i=this._controllers.get(e);i&&i.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(i=>e.push(i)),this._controllers.clear(),e.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((i,r)=>e(r))}get(e){const i=this._deferreds.get(e);return i?i.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,i){const r=this.get(e);if(r)return r;const n=new AbortController;let s=null;i&&(s=Yl(i,()=>n.abort()));const o=()=>{const _=this._processingItems.get(e);_&&_.controller.abort(),l(),f.reject(ur())},l=()=>{c.remove(),s!=null&&s.remove(),this._deferreds.delete(e),this._controllers.delete(e),this._queue.remove(e),this._processingItems.delete(e),this._scheduleNext()},c=g9(n.signal,o),f=Jl();return this._deferreds.set(e,f),this._controllers.set(e,n),f.promise.then(l,l),this._queue.push(e),this._scheduleNext(),f.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const e=[];this._processingItems.forEach(i=>e.push(i)),this._processingItems.clear();for(const i of e)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(n,s),s=>this._processError(n,s))):this._processResult(n,i)}get test(){return{update:e=>this.runTask(e)}}};function tLt(t,e){return t.length=0,e.forEach(i=>t.push(i)),t}const TY=new Set,g8=[],DC=new Map,F_e=[0,0];let Qx=class extends ze{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:i,strategy:r}=this;this._queue=new WFe({concurrency:e,process:(n,s)=>{const o=this._keyToItem.get(n);return i(o,{signal:s})},peeker:r==="scale-first"?n=>this._peekByScaleFirst(n):n=>this._peekByCenterFirst(n)})}destroy(){this.clear(),this._queue=et(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}abort(e){const i=typeof e=="string"?e:e.id;this._queue.abort(i)}clear(){this._queue.clear(),this._keyToItem.clear()}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const i=typeof e=="string"?e:e.id;return this.has(i)&&this._queue.isOngoing(i)}pause(){this._queue.pause()}push(e){const i=e.key.id;if(this._queue.has(i))return this._queue.get(i);const r=this._queue.push(i),n=()=>{this._keyToItem.delete(i)};return this._keyToItem.set(i,e),r.then(n,n),r}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView;let r=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY;e.forEach(_=>{const x=this._keyToItem.get(_),T=this.tileInfoView.getTileScale(x.key);DC.has(T)||(DC.set(T,[]),r=Math.max(T,r),n=Math.min(T,n)),DC.get(T).push(x.key),TY.add(T)});let s=this.state.scale;DC.has(s)||(tLt(g8,TY),g8.sort((_,x)=>_-x),s=g8.reduce((_,x)=>Math.abs(x-s){const T=l.denormalizeCol(_.col,_.world),A=l.denormalizeCol(x.col,x.world);return Math.sqrt((c-T)*(c-T)+(f-_.row)*(f-_.row))-Math.sqrt((c-A)*(c-A)+(f-x.row)*(f-x.row))}),TY.clear(),DC.clear(),o[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const i=this.tileInfoView,r=this.state.center;let n,s=Number.POSITIVE_INFINITY;return e.forEach(o=>{const l=this._keyToItem.get(o);i.getTileCoords(F_e,l.key);const c=Dm(F_e,r);c=2}function TLt(t){return Array.isArray(t)&&t.length>=2}function y8(t){return SLt(t)||TLt(t)}const v8={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new xc({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:at.WebMercator}),minus180Line:new xc({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:at.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new xc({paths:[[[180,-180],[180,180]]],spatialReference:at.WGS84}),minus180Line:new xc({paths:[[[-180,-180],[-180,180]]],spatialReference:at.WGS84})}};function rT(t,e){return Math.ceil((t-e)/(2*e))}function JFe(t,e){const i=z$(t);for(const r of i)for(const n of r)n[0]+=e;return t}function z$(t){return xB(t)?t.rings:t.paths}async function ELt(t,e,i,r){const n=d6(t),s=e[0].spatialReference,o={...r,responseType:"json",query:{...n.query,f:"json",sr:Cz(s),target:JSON.stringify({geometryType:R9(e[0]),geometries:e}),cutter:JSON.stringify(i)}},l=await bi(n.path+"/cut",o),{cutIndexes:c,geometries:f=[]}=l.data;return{cutIndexes:c,geometries:f.map(_=>{const x=O2(_);return x.spatialReference=s,x})}}async function CLt(t,e,i){const r=typeof t=="string"?qs(t):t,n=e[0].spatialReference,s=R9(e[0]),o={...i,query:{...r.query,f:"json",sr:Cz(n),geometries:JSON.stringify(t4t(e))}},{data:l}=await bi(r.path+"/simplify",o);return W7e(l.geometries,s,n)}const KFe=Ce.getLogger("esri.geometry.support.normalizeUtils");function ALt(t){return t.type==="polygon"}function MLt(t){return t[0].type==="polygon"}function OLt(t){return t[0].type==="polyline"}function PLt(t,e){if(!(t instanceof xc||t instanceof Qa)){const n="straightLineDensify: the input geometry is neither polyline nor polygon";throw KFe.error(n),new se(n)}const i=z$(t),r=[];for(const n of i){const s=[];r.push(s),s.push([n[0][0],n[0][1]]);for(let o=0;o1){for(let z=1;z<=M-1;z++){const k=z*e,U=A*k+l,j=T*k+c;s.push([U,j])}const I=(x+Math.floor(M-1)*e)/2,L=A*I+l,F=T*I+c;s.push([L,F])}s.push([f,_])}}return ALt(t)?new Qa({rings:r,spatialReference:t.spatialReference}):new xc({paths:r,spatialReference:t.spatialReference})}function k_e(t,e,i){if(e){const r=PLt(t,1e6);t=HS(r,!0)}return i&&(t=JFe(t,i)),t}function z_e(t,e,i){if(Array.isArray(t)){const r=t[0];if(r>e){const n=rT(r,e);t[0]=r+n*(-2*e)}else if(re){const n=rT(r,e);t=t.clone().offset(n*(-2*e),0)}else if(r{if(f[0]<180)return!0;{let _=0;for(let T=0;T_?A:_}_=Number(_.toFixed(9));const x=-360*rT(_,180);for(let T=0;Tz_e(H,l,c)),M.push(j)}else if(U.type==="extent"){const j=U.clone()._normalize(!1,!1,s);M.push(j.rings?new Qa(j):j)}else if(U.extent){const j=U.extent,H=rT(j.xmin,c)*(2*l);let Y=H===0?U.clone():JFe(U.clone(),H);j.offset(H,0),j.intersects(_)&&j.xmax!==l?(T=j.xmax>T?j.xmax:T,Y=k_e(Y,o),A.push(Y),M.push("cut")):j.intersects(x)&&j.xmin!==c?(T=j.xmax*(2*l)>T?j.xmax*(2*l):T,Y=k_e(Y,o,360),A.push(Y),M.push("cut")):M.push(Y)}else M.push(U.clone());else M.push(U);else M.push(U);let I=rT(T,l),L=-90;const F=I,z=new xc;for(;I>0;){const U=360*I-180;z.addPath([[U,L],[U,-1*L]]),L*=-1,I--}if(A.length>0&&F>0){const U=RLt(A,await ELt(r,A,z,i)),j=[],H=[];for(let ne=0;ne1&&he.rings.length>=ce.rings.length?(j.push(he),H.push("simplify")):H.push(o?Ty(he):he)}}if(!j.length)return H;const Y=await CLt(r,j,i),Q=[];for(let ne=0;nes?l=Math.ceil(Math.abs(e-s)/o):es?c=Math.ceil(Math.abs(t-s)/o):ts?f-=o:_s.xmax)&&(kc[0]=$Lt(r,n[0],o)),uw(t,kc,l)}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size");return Dce(t,i,n,e,0,r),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:r}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size"),o=new ih({targetGeometry:new mt(t[0],t[1],e),scale:i,rotation:r});if(this._set("viewpoint",o),!s||!e||!i)return;this.resolution=OG(o),this.rotation=r,this.scale=i,this.spatialReference=e,Qo(this.center,t);const l=s[0]!==0?2/s[0]:0,c=s[1]!==0?-2/s[1]:0;Toe(this.displayMat3,l,0,0,0,c,0,-1,1,1);const f=Eoe(this.viewMat3),_=vf(s[0]/2,s[1]/2),x=vf(-s[0]/2,-s[1]/2),T=mB(r);eU(f,f,_),Coe(f,f,T),eU(f,f,x),s5(this.displayViewMat3,this.displayMat3,f);const A=$ce(this.viewMat2d,_);return AG(A,A,T),MG(A,A,x),kLt(this.extent,o,s),VLt(this.transform,o,s,n),YFe(this.inverseTransform,this.transform),BLt(this.transformNoRotation,o,s,n),this.worldScreenWidth=GLt(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};y([w({readOnly:!0})],pw.prototype,"id",void 0),y([w({value:1,json:{write:!0}})],pw.prototype,"pixelRatio",null),y([w({json:{write:!0}})],pw.prototype,"size",null),y([w()],pw.prototype,"spatialReference",void 0),y([w({type:ih,json:{write:!0}})],pw.prototype,"viewpoint",null),pw=zie=y([Z("esri.views.2d.ViewState")],pw);const HLt=pw;var Uie,Vie,U_e,V_e,B_e,j_e,G_e,H_e,q_e,W_e,Y_e,X_e,Z_e,J_e,K_e,Q_e,ebe,tbe,ibe,rbe,nbe,sbe,obe,abe,lbe,cbe,ube,hbe,dbe,pbe,fbe,mbe,gbe,ybe,vbe,_be,bbe,wbe,xbe,Sbe,Tbe,Ebe,Cbe,Abe,Mbe,Obe,Pbe,Rbe,Ibe,$be,Lbe,Dbe,Nbe,Fbe,kbe,zbe,Ube,Vbe,Bbe,jbe,Gbe;(function(t){t[t.BUTT=0]="BUTT",t[t.ROUND=1]="ROUND",t[t.SQUARE=2]="SQUARE",t[t.UNKNOWN=4]="UNKNOWN"})(Uie||(Uie={})),function(t){t[t.BEVEL=0]="BEVEL",t[t.ROUND=1]="ROUND",t[t.MITER=2]="MITER",t[t.UNKNOWN=4]="UNKNOWN"}(Vie||(Vie={})),function(t){t[t.SCREEN=0]="SCREEN",t[t.MAP=1]="MAP"}(U_e||(U_e={})),function(t){t[t.Tint=0]="Tint",t[t.Ignore=1]="Ignore",t[t.Multiply=99]="Multiply"}(V_e||(V_e={})),function(t){t.Both="Both",t.JustBegin="JustBegin",t.JustEnd="JustEnd",t.None="None"}(B_e||(B_e={})),function(t){t[t.Mosaic=0]="Mosaic",t[t.Centered=1]="Centered"}(j_e||(j_e={})),function(t){t[t.Normal=0]="Normal",t[t.Superscript=1]="Superscript",t[t.Subscript=2]="Subscript"}(G_e||(G_e={})),function(t){t[t.MSSymbol=0]="MSSymbol",t[t.Unicode=1]="Unicode"}(H_e||(H_e={})),function(t){t[t.Unspecified=0]="Unspecified",t[t.TrueType=1]="TrueType",t[t.PSOpenType=2]="PSOpenType",t[t.TTOpenType=3]="TTOpenType",t[t.Type1=4]="Type1"}(q_e||(q_e={})),function(t){t[t.Display=0]="Display",t[t.Map=1]="Map"}(W_e||(W_e={})),function(t){t.None="None",t.Loop="Loop",t.Oscillate="Oscillate"}(Y_e||(Y_e={})),function(t){t[t.Z=0]="Z",t[t.X=1]="X",t[t.Y=2]="Y"}(X_e||(X_e={})),function(t){t[t.XYZ=0]="XYZ",t[t.ZXY=1]="ZXY",t[t.YXZ=2]="YXZ"}(Z_e||(Z_e={})),function(t){t[t.Rectangle=0]="Rectangle",t[t.RoundedRectangle=1]="RoundedRectangle",t[t.Oval=2]="Oval"}(J_e||(J_e={})),function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.Screen=2]="Screen",t[t.Multiply=3]="Multiply",t[t.Add=4]="Add"}(K_e||(K_e={})),function(t){t[t.TTB=0]="TTB",t[t.RTL=1]="RTL",t[t.BTT=2]="BTT"}(Q_e||(Q_e={})),function(t){t[t.None=0]="None",t[t.SignPost=1]="SignPost",t[t.FaceNearPlane=2]="FaceNearPlane"}(ebe||(ebe={})),function(t){t[t.Float=0]="Float",t[t.String=1]="String",t[t.Boolean=2]="Boolean"}(tbe||(tbe={})),function(t){t[t.Intersect=0]="Intersect",t[t.Subtract=1]="Subtract"}(ibe||(ibe={})),function(t){t.OpenEnded="OpenEnded",t.Block="Block",t.Crossed="Crossed"}(rbe||(rbe={})),function(t){t.FullGeometry="FullGeometry",t.PerpendicularFromFirstSegment="PerpendicularFromFirstSegment",t.ReversedFirstSegment="ReversedFirstSegment",t.PerpendicularToSecondSegment="PerpendicularToSecondSegment",t.SecondSegmentWithTicks="SecondSegmentWithTicks",t.DoublePerpendicular="DoublePerpendicular",t.OppositeToFirstSegment="OppositeToFirstSegment",t.TriplePerpendicular="TriplePerpendicular",t.HalfCircleFirstSegment="HalfCircleFirstSegment",t.HalfCircleSecondSegment="HalfCircleSecondSegment",t.HalfCircleExtended="HalfCircleExtended",t.OpenCircle="OpenCircle",t.CoverageEdgesWithTicks="CoverageEdgesWithTicks",t.GapExtentWithDoubleTicks="GapExtentWithDoubleTicks",t.GapExtentMidline="GapExtentMidline",t.Chevron="Chevron",t.PerpendicularWithArc="PerpendicularWithArc",t.ClosedHalfCircle="ClosedHalfCircle",t.TripleParallelExtended="TripleParallelExtended",t.ParallelWithTicks="ParallelWithTicks",t.Parallel="Parallel",t.PerpendicularToFirstSegment="PerpendicularToFirstSegment",t.ParallelOffset="ParallelOffset",t.OffsetOpposite="OffsetOpposite",t.OffsetSame="OffsetSame",t.CircleWithArc="CircleWithArc",t.DoubleJog="DoubleJog",t.PerpendicularOffset="PerpendicularOffset",t.LineExcludingLastSegment="LineExcludingLastSegment",t.MultivertexArrow="MultivertexArrow",t.CrossedArrow="CrossedArrow",t.ChevronArrow="ChevronArrow",t.ChevronArrowOffset="ChevronArrowOffset",t.PartialFirstSegment="PartialFirstSegment",t.Arch="Arch",t.CurvedParallelTicks="CurvedParallelTicks",t.Arc90Degrees="Arc90Degrees"}(nbe||(nbe={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square",t.TrueBuffer="TrueBuffer"}(sbe||(sbe={})),function(t){t.ClosePath="ClosePath",t.ConvexHull="ConvexHull",t.RectangularBox="RectangularBox"}(obe||(obe={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(abe||(abe={})),function(t){t.Mitered="Mitered",t.Bevelled="Bevelled",t.Rounded="Rounded",t.Square="Square"}(lbe||(lbe={})),function(t){t.Fast="Fast",t.Accurate="Accurate"}(cbe||(cbe={})),function(t){t.BeginningOfLine="BeginningOfLine",t.EndOfLine="EndOfLine"}(ube||(ube={})),function(t){t.Sinus="Sinus",t.Square="Square",t.Triangle="Triangle",t.Random="Random"}(hbe||(hbe={})),function(t){t[t.None=0]="None",t[t.Default=1]="Default",t[t.Force=2]="Force"}(dbe||(dbe={})),function(t){t[t.Buffered=0]="Buffered",t[t.Left=1]="Left",t[t.Right=2]="Right",t[t.AlongLine=3]="AlongLine"}(pbe||(pbe={})),function(t){t[t.Linear=0]="Linear",t[t.Rectangular=1]="Rectangular",t[t.Circular=2]="Circular",t[t.Buffered=3]="Buffered"}(fbe||(fbe={})),function(t){t[t.Discrete=0]="Discrete",t[t.Continuous=1]="Continuous"}(mbe||(mbe={})),function(t){t[t.AcrossLine=0]="AcrossLine",t[t.AloneLine=1]="AloneLine"}(gbe||(gbe={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center",t[t.Justify=3]="Justify"}(ybe||(ybe={})),function(t){t[t.Base=0]="Base",t[t.MidPoint=1]="MidPoint",t[t.ThreePoint=2]="ThreePoint",t[t.FourPoint=3]="FourPoint",t[t.Underline=4]="Underline",t[t.CircularCW=5]="CircularCW",t[t.CircularCCW=6]="CircularCCW"}(vbe||(vbe={})),function(t){t.Butt="Butt",t.Round="Round",t.Square="Square"}(_be||(_be={})),function(t){t.NoConstraint="NoConstraint",t.HalfPattern="HalfPattern",t.HalfGap="HalfGap",t.FullPattern="FullPattern",t.FullGap="FullGap",t.Custom="Custom"}(bbe||(bbe={})),function(t){t[t.None=-1]="None",t[t.Custom=0]="Custom",t[t.Circle=1]="Circle",t[t.OpenArrow=2]="OpenArrow",t[t.ClosedArrow=3]="ClosedArrow",t[t.Diamond=4]="Diamond"}(wbe||(wbe={})),function(t){t[t.ExtraLeading=0]="ExtraLeading",t[t.Multiple=1]="Multiple",t[t.Exact=2]="Exact"}(xbe||(xbe={})),function(t){t.Bevel="Bevel",t.Round="Round",t.Miter="Miter"}(Sbe||(Sbe={})),function(t){t[t.Default=0]="Default",t[t.String=1]="String",t[t.Numeric=2]="Numeric"}(Tbe||(Tbe={})),function(t){t[t.InsidePolygon=0]="InsidePolygon",t[t.PolygonCenter=1]="PolygonCenter",t[t.RandomlyInsidePolygon=2]="RandomlyInsidePolygon"}(Ebe||(Ebe={})),function(t){t[t.Tint=0]="Tint",t[t.Replace=1]="Replace",t[t.Multiply=2]="Multiply"}(Cbe||(Cbe={})),function(t){t[t.ClipAtBoundary=0]="ClipAtBoundary",t[t.RemoveIfCenterOutsideBoundary=1]="RemoveIfCenterOutsideBoundary",t[t.DoNotTouchBoundary=2]="DoNotTouchBoundary",t[t.DoNotClip=3]="DoNotClip"}(Abe||(Abe={})),function(t){t.NoConstraint="NoConstraint",t.WithMarkers="WithMarkers",t.WithFullGap="WithFullGap",t.WithHalfGap="WithHalfGap",t.Custom="Custom"}(Mbe||(Mbe={})),function(t){t.Fixed="Fixed",t.Random="Random",t.RandomFixedQuantity="RandomFixedQuantity"}(Obe||(Obe={})),function(t){t.LineMiddle="LineMiddle",t.LineBeginning="LineBeginning",t.LineEnd="LineEnd",t.SegmentMidpoint="SegmentMidpoint"}(Pbe||(Pbe={})),function(t){t.OnPolygon="OnPolygon",t.CenterOfMass="CenterOfMass",t.BoundingBoxCenter="BoundingBoxCenter"}(Rbe||(Rbe={})),function(t){t[t.Low=0]="Low",t[t.Medium=1]="Medium",t[t.High=2]="High"}(Ibe||(Ibe={})),function(t){t[t.MarkerCenter=0]="MarkerCenter",t[t.MarkerBounds=1]="MarkerBounds"}($be||($be={})),function(t){t[t.None=0]="None",t[t.PropUniform=1]="PropUniform",t[t.PropNonuniform=2]="PropNonuniform",t[t.DifUniform=3]="DifUniform",t[t.DifNonuniform=4]="DifNonuniform"}(Lbe||(Lbe={})),function(t){t.Tube="Tube",t.Strip="Strip",t.Wall="Wall"}(Dbe||(Dbe={})),function(t){t[t.Random=0]="Random",t[t.Increasing=1]="Increasing",t[t.Decreasing=2]="Decreasing",t[t.IncreasingThenDecreasing=3]="IncreasingThenDecreasing"}(Nbe||(Nbe={})),function(t){t[t.Relative=0]="Relative",t[t.Absolute=1]="Absolute"}(Fbe||(Fbe={})),function(t){t[t.Normal=0]="Normal",t[t.LowerCase=1]="LowerCase",t[t.Allcaps=2]="Allcaps"}(kbe||(kbe={})),function(t){t[t.LTR=0]="LTR",t[t.RTL=1]="RTL"}(zbe||(zbe={})),function(t){t.Draft="Draft",t.Picture="Picture",t.Text="Text"}(Ube||(Ube={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Baseline=2]="Baseline",t[t.Bottom=3]="Bottom"}(Vbe||(Vbe={})),function(t){t[t.Right=0]="Right",t[t.Upright=1]="Upright"}(Bbe||(Bbe={})),function(t){t[t.Small=0]="Small",t[t.Medium=1]="Medium",t[t.Large=2]="Large"}(jbe||(jbe={})),function(t){t[t.Calm=0]="Calm",t[t.Rippled=1]="Rippled",t[t.Slight=2]="Slight",t[t.Moderate=3]="Moderate"}(Gbe||(Gbe={}));var Bie,FS,jie,hV,Gie,dV,Hie,kS,qie;(function(t){t[t.BACKGROUND=0]="BACKGROUND",t[t.FILL=1]="FILL",t[t.LINE=2]="LINE",t[t.SYMBOL=3]="SYMBOL",t[t.CIRCLE=4]="CIRCLE"})(Bie||(Bie={})),function(t){t[t.VISIBLE=0]="VISIBLE",t[t.NONE=1]="NONE"}(FS||(FS={})),function(t){t[t.POINT=0]="POINT",t[t.LINE=1]="LINE",t[t.LINE_CENTER=2]="LINE_CENTER"}(jie||(jie={})),function(t){t[t.MAP=0]="MAP",t[t.VIEWPORT=1]="VIEWPORT",t[t.AUTO=2]="AUTO"}(hV||(hV={})),function(t){t[t.AUTO=0]="AUTO",t[t.LEFT=1]="LEFT",t[t.CENTER=2]="CENTER",t[t.RIGHT=3]="RIGHT"}(Gie||(Gie={})),function(t){t[t.CENTER=0]="CENTER",t[t.LEFT=1]="LEFT",t[t.RIGHT=2]="RIGHT",t[t.TOP=3]="TOP",t[t.BOTTOM=4]="BOTTOM",t[t.TOP_LEFT=5]="TOP_LEFT",t[t.TOP_RIGHT=6]="TOP_RIGHT",t[t.BOTTOM_LEFT=7]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=8]="BOTTOM_RIGHT"}(dV||(dV={})),function(t){t[t.NONE=0]="NONE",t[t.UPPERCASE=1]="UPPERCASE",t[t.LOWERCASE=2]="LOWERCASE"}(Hie||(Hie={})),function(t){t[t.MAP=0]="MAP",t[t.VIEWPORT=1]="VIEWPORT"}(kS||(kS={})),function(t){t[t.HORIZONTAL=0]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(qie||(qie={}));let x0=class{};x0.backgroundLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:FS.VISIBLE}},x0.fillLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:FS.VISIBLE}},x0.lineLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:FS.VISIBLE},"line-cap":{type:"enum",values:["butt","round","square"],default:Uie.BUTT},"line-join":{type:"enum",values:["bevel","round","miter"],default:Vie.MITER},"line-miter-limit":{type:"number",default:2},"line-round-limit":{type:"number",default:1.05}},x0.symbolLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:FS.VISIBLE},"symbol-avoid-edges":{type:"boolean",default:!1},"symbol-placement":{type:"enum",values:["point","line","line-center"],default:jie.POINT},"symbol-sort-key":{type:"number",default:-1},"symbol-spacing":{type:"number",minimum:1,default:250},"icon-allow-overlap":{type:"boolean",default:!1},"icon-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:dV.CENTER},"icon-ignore-placement":{type:"boolean",default:!1},"icon-image":{type:"string"},"icon-keep-upright":{type:"boolean",default:!1},"icon-offset":{type:"array",value:"number",length:2,default:[0,0]},"icon-optional":{type:"boolean",default:!1},"icon-padding":{type:"number",minimum:0,default:2},"icon-rotate":{type:"number",default:0},"icon-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:hV.AUTO},"icon-size":{type:"number",minimum:0,default:1},"text-allow-overlap":{type:"boolean",default:!1},"text-anchor":{type:"enum",values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:dV.CENTER},"text-field":{type:"string"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"]},"text-ignore-placement":{type:"boolean",default:!1},"text-justify":{type:"enum",values:["auto","left","center","right"],default:Gie.CENTER},"text-keep-upright":{type:"boolean",default:!0},"text-letter-spacing":{type:"number",default:0},"text-line-height":{type:"number",default:1.2},"text-max-angle":{type:"number",minimum:0,default:45},"text-max-width":{type:"number",minimum:0,default:10},"text-offset":{type:"array",value:"number",length:2,default:[0,0]},"text-optional":{type:"boolean",default:!1},"text-padding":{type:"number",minimum:0,default:2},"text-rotate":{type:"number",default:0},"text-rotation-alignment":{type:"enum",values:["map","viewport","auto"],default:hV.AUTO},"text-size":{type:"number",minimum:0,default:16},"text-transform":{type:"enum",values:["none","uppercase","lowercase"],default:Hie.NONE},"text-writing-mode":{type:"array",value:"enum",values:["horizontal","vertical"],default:[qie.HORIZONTAL]}},x0.circleLayoutDefinition={visibility:{type:"enum",values:["visible","none"],default:FS.VISIBLE}},x0.backgroundPaintDefinition={"background-color":{type:"color",default:[0,0,0,1]},"background-opacity":{type:"number",minimum:0,maximum:1,default:1},"background-pattern":{type:"string"}},x0.fillPaintDefinition={"fill-antialias":{type:"boolean",default:!0},"fill-color":{type:"color",default:[0,0,0,1]},"fill-opacity":{type:"number",minimum:0,maximum:1,default:1},"fill-outline-color":{type:"color",default:[0,0,0,0]},"fill-pattern":{type:"string"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0]},"fill-translate-anchor":{type:"enum",values:["map","viewport"],default:kS.MAP}},x0.linePaintDefinition={"line-blur":{type:"number",minimum:0,default:0},"line-color":{type:"color",default:[0,0,0,1]},"line-dasharray":{type:"array",value:"number",default:[]},"line-gap-width":{type:"number",minimum:0,default:0},"line-offset":{type:"number",default:0},"line-opacity":{type:"number",minimum:0,maximum:1,default:1},"line-pattern":{type:"string"},"line-translate":{type:"array",value:"number",length:2,default:[0,0]},"line-translate-anchor":{type:"enum",values:["map","viewport"],default:kS.MAP},"line-width":{type:"number",minimum:0,default:1}},x0.symbolPaintDefinition={"icon-color":{type:"color",default:[0,0,0,1]},"icon-halo-blur":{type:"number",minimum:0,default:0},"icon-halo-color":{type:"color",default:[0,0,0,0]},"icon-halo-width":{type:"number",minimum:0,default:0},"icon-opacity":{type:"number",minimum:0,maximum:1,default:1},"icon-translate":{type:"array",value:"number",length:2,default:[0,0]},"icon-translate-anchor":{type:"enum",values:["map","viewport"],default:kS.MAP},"text-color":{type:"color",default:[0,0,0,1]},"text-halo-blur":{type:"number",minimum:0,default:0},"text-halo-color":{type:"color",default:[0,0,0,0]},"text-halo-width":{type:"number",minimum:0,default:0},"text-opacity":{type:"number",minimum:0,maximum:1,default:1},"text-translate":{type:"array",value:"number",length:2,default:[0,0]},"text-translate-anchor":{type:"enum",values:["map","viewport"],default:kS.MAP}},x0.rasterPaintDefinition={"raster-opacity":{type:"number",minimum:0,maximum:1,default:1},"raster-hue-rotate":{type:"number",default:0},"raster-brightness-min":{type:"number",minimum:0,maximum:1,default:0},"raster-brightness-max":{type:"number",minimum:0,maximum:1,default:1},"raster-saturation":{type:"number",minimum:-1,maximum:1,default:0},"raster-contrast":{type:"number",minimum:-1,maximum:1,default:0},"raster-fade-duration":{type:"number",minimum:0,default:300}},x0.circlePaintDefinition={"circle-blur":{type:"number",minimum:0,default:0},"circle-color":{type:"color",default:[0,0,0,1]},"circle-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-radius":{type:"number",minimum:0,default:5},"circle-stroke-color":{type:"color",default:[0,0,0,1]},"circle-stroke-opacity":{type:"number",minimum:0,maximum:1,default:1},"circle-stroke-width":{type:"number",minimum:0,default:0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0]},"circle-translate-anchor":{type:"enum",values:["map","viewport"],default:kS.MAP}};let qLt=class extends rFe{_createTransforms(){return{dvs:Tc(),tileMat3:Tc()}}};const WLt=.125;let YLt=class{constructor(){this._renderParams={context:null,drawPhase:1,state:new HLt({viewpoint:new ih({targetGeometry:new mt(0,0),scale:1,rotation:0}),size:[256,256]}),stationary:!0,pixelRatio:1,displayLevel:-1,requiredLevel:-1,globalOpacity:1,renderPass:"background",styleLayer:null,styleLayerUID:-1,painter:null,glyphMosaic:null,spriteMosaic:null,profiler:null,renderingOptions:null,requestRender:null,allowDelayedRender:!1,deltaTime:-1,timeline:null,time:0,hasClipping:!1,blendMode:null,dataUploadCounter:0,effects:null,inFadeTransition:!1,requireFBO:!1,highlightGradient:null,stencilSymbols:!0,is3D:!0,backgroundColor:null},this._backgroundTile=new qLt(new iE(0,0,0,0),0,0,0,512,512,4096,4096)}dispose(){this._renderParams=null}renderBackground(e,i,r,n,s,o,l,c,f,_){const x=this._backgroundTile;this._updateRenderParams(e,i,x,r,s,o,l,c,f,_),this._renderParams.stencilSymbols=!1,r.drawBackground(this._renderParams,x,n)}renderContent(e,i,r,n,s,o,l,c,f,_,x,T){this._stencilSymbols(e,i,r,n,s,o,l,Math.round(1/c),f,_,x,T);let A=1;r.stencilRef=A++,e.setStencilFunction(Zr.EQUAL,r.stencilRef,255),this._render(e,i,r,s,o,l,c,f,_,x,T),n.forAll(M=>{M.sourceLayerInfo.data.stencilRef=A++,this._renderSymbols(e,M.sourceLod,M.sourceLayerInfo.data,s,o,l,Math.round(1/c),M.offset,_,x,T)})}_stencilSymbols(e,i,r,n,s,o,l,c,f,_,x,T){let A=1;r.stencilRef=A++,e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setColorMask(!1,!1,!1,!1),e.setStencilOp(bs.KEEP,bs.KEEP,bs.REPLACE),e.setStencilWriteMask(255),e.setStencilFunction(Zr.ALWAYS,r.stencilRef,255),this._stencilTileSymbols(e,i,r,s,o,l,c,f,_,x,T);for(const M of n.toArray()){const{sourceLod:I,offset:L,sourceLayerInfo:F}=M;F.data.stencilRef=A++,e.setStencilFunction(Zr.ALWAYS,F.data.stencilRef,255),this._stencilTileSymbols(e,I,F.data,s,o,l,c,L,_,x,T)}e.setStencilWriteMask(0),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!0),e.setColorMask(!0,!0,!0,!0)}_renderSymbols(e,i,r,n,s,o,l,c,f,_,x){e.setStencilFunction(Zr.EQUAL,r.stencilRef,255),this._render(e,i,r,n,s,o,l,c,f,_,x,Bie.SYMBOL)}_render(e,i,r,n,s,o,l,c,f,_,x,T){this._updateRenderParams(e,i,r,n,o,l,c,f,_,x),this._renderParams.stencilSymbols=!1,n.drawTile(this._renderParams,r,s,T)}_stencilTileSymbols(e,i,r,n,s,o,l,c,f,_,x){this._updateRenderParams(e,i,r,n,o,l,c,f,_,x),this._renderParams.stencilSymbols=!0,r.triangleCount=0,n.drawSymbols(this._renderParams,r,s)}_updateRenderParams(e,i,r,n,s,o,l,c,f,_){"type"in r&&r.type==="vector-tile"&&!r.stage&&r.attachWithContext(e);const x=i[0]-s.getLevelShift(i[0]),T=this._renderParams;T.context=e,T.painter=n,T.glyphMosaic=n.glyphMosaic,T.spriteMosaic=n.spriteMosaic,T.pixelRatio=f*_,T.displayLevel=x,T.requiredLevel=x;const A=s.getScale(i[0]),[M,I]=s.getOffset(i,o*A),L=WLt*o*A/c,F=r.transforms.dvs;F[0]=L,F[4]=-L,F[6]=-1-M-l[0]*o*2,F[7]=1+I+(1-l[1])*o*2-2,T.state.size[0]=c/_,T.state.size[1]=c/_,T.state.pixelRatio=_}},QFe=class eke extends Hr{initializeProgram(e){return new Ir(e.rctx,eke.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:hd(st.ONE,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji})}};QFe.shader=new Rr(r$t,()=>we(()=>Promise.resolve().then(()=>kWt),void 0));let bI=class extends k${constructor(){super(...arguments),this.colorizerType=ST.Stretch,this.stretchType=rE.Noop,this.applyColormap=!0,this.requireBilinearWithNN=!1}};y([fe({count:ST.COUNT})],bI.prototype,"colorizerType",void 0),y([fe({count:rE.COUNT})],bI.prototype,"stretchType",void 0),y([fe()],bI.prototype,"applyColormap",void 0),y([fe()],bI.prototype,"requireBilinearWithNN",void 0);let Hbe=class{constructor(e){this._rctx=e,this._fbos=new Map}get(e){return this._getPool(e)}dispose(){this._fbos.forEach(e=>e.dispose()),this._fbos.clear()}_getPool(e){const i=this._fbos.get(e);if(i)return i;const r=new Hm(this._rctx,new tn(e),new $F(Wa.DEPTH24_STENCIL8,e));return this._fbos.set(e,r),r}};const XLt=Ce.getLogger("esri.views.3d.terrain");let ZLt=class{constructor(e,i){this._rctx=e,this._techniqueRepository=i,this._fbos=[],this._vectorTileHelper=new YLt,this._bindParameters=new Pj(null,null),this._blendLayersTechniqueConfig=new GFe,this._current=0,this._lastUsedIds=new Array,this._lastCreatedBufferId=0,this._onHoldIds=new Array,this._vaoQuad=u1(this._rctx,H9)}dispose(){this._fbos.forEach(Kt),this._fbos=null,this._vtFBO=Kt(this._vtFBO),this._vaoQuad=Kt(this._vaoQuad),this._vectorTileHelper=Kt(this._vectorTileHelper),this._backgroundTechnique=ir(this._backgroundTechnique),this._applyOpacityTechnique=ir(this._applyOpacityTechnique),this._blendLayersTechnique=ir(this._blendLayersTechnique)}_getBlendLayersTechnique(e,i,r,n=am.Off,s=K2.BelowLayer){return this._blendLayersTechniqueConfig.output=i,this._blendLayersTechniqueConfig.blendMode=e,this._blendLayersTechniqueConfig.baseOpacityMode=r,this._blendLayersTechniqueConfig.premultipliedSource=n,this._blendLayersTechniqueConfig.background=s,this._blendLayersTechnique=this._techniqueRepository.releaseAndAcquire(BFe,this._blendLayersTechniqueConfig,this._blendLayersTechnique),this._blendLayersTechnique}drawBackground(e,i){const r=this._getBlendLayersTechnique(gt.Normal,i?Jo.ColorComposite:Jo.GridComposite,up.NotRequired,am.Off,K2.Only),n=this._rctx.bindTechnique(r,e,this._bindParameters);this._render(n)}_render(e){this._rctx.bindVAO(this._vaoQuad),e.assertCompatibleVertexAttributeLocations(this._vaoQuad),this._rctx.drawArrays(sr.TRIANGLE_STRIP,0,Kv(this._vaoQuad,"geometry"))}drawGroup(e,i,r,n,s,o=am.On){i===Jo.Composite&&(e.fboTexture=this._fbos[this.getLastOnHoldId()].get(r).colorTexture),e.texture=this.currentFBO(r).colorTexture,this.closeGroup(r);const l=this._getBlendLayersTechnique(n,i,s,o),c=this._rctx.bindTechnique(l,e,this._bindParameters);this._render(c)}drawRasterData(e,i,r,n,s,o=am.Off){if(e.texture==null)return;e.fboTexture=i===Jo.GroupBackgroundComposite||n===gt.Normal&&s===up.NotRequired&&o===am.Off?null:this.switch(r).colorTexture;const l=this._getBlendLayersTechnique(n,i,s,o),c=this._rctx.bindTechnique(l,e,this._bindParameters);this._render(c)}drawImageryTileData(e,i,r,n,s,o){const l=o.sourceLayerInfo.data;if(!l.source||(o.tile.surface.layerViewByIndex(o.layerIndex,Yi.MAP).ensureSymbolizerParameters(l),!l.bind(this._rctx)))return;e.fboTexture=n===gt.Normal&&s===up.NotRequired?null:this.switch(r).colorTexture;const c=this._getRasterColorizerTechnique(l,i,n,s);l.opacity=e.opacity;const f=l.getUniforms();f.scale=o.scale,f.offset=o.offset,f.backgroundColor=e.backgroundColor,f.fboTexture=e.fboTexture,f.baseOpacity=e.baseOpacity;const _=this._rctx.bindTechnique(c,f,null);this._render(_)}_getRasterColorizerTechnique(e,i,r,n){const s=e.symbolizerParameters,o=["stretch","lut","hillshade"].indexOf(s.type);return this._rasterColorizerConfig==null&&(this._rasterColorizerConfig=new bI,this._rctx.gl.getExtension("WEBGL_color_buffer_float"),this._rctx.gl.getExtension("OES_texture_float")),this._rasterColorizerConfig.output=i,this._rasterColorizerConfig.blendMode=r,this._rasterColorizerConfig.baseOpacityMode=n,this._rasterColorizerConfig.colorizerType=o,this._rasterColorizerConfig.applyColormap=!!s.colormap,this._rasterColorizerConfig.requireBilinearWithNN=e.isBilinearWithStretchColorRamp,this._rasterColorizerConfig.stretchType=e.hasStretchTypeNone()?rE.Noop:rE.PerBand,this._rasterColorizerTechnique=this._techniqueRepository.releaseAndAcquire(QFe,this._rasterColorizerConfig,this._rasterColorizerTechnique),this._rasterColorizerTechnique}drawVectorData(e,i,r,n,s,o,l,c,f){const _=this._rctx,x=o.sourceLayerInfo.data,T=o.tile.surface.layerViewByIndex(o.layerIndex,Yi.MAP),A=s===up.Required||e.opacity<1||n!==gt.Normal||i!==Jo.Composite,M=A?am.On:am.Off,I=this._getBlendLayersTechnique(n,i,s,M);_.setPipelineState(I.getPipeline());let L=null,F=null;A?(F=this.currentFBO(r),this._vtFBO==null&&(this._vtFBO=new Hbe(this._rctx)),L=this._vtFBO.get(r),_.bindFramebuffer(L),this._clearCurrentFBO()):f&&_.clearSafe(In.DEPTH_BUFFER_BIT);try{this._vectorTileHelper.renderBackground(_,o.sourceLod,T.painter,T.layer.styleRepository,T.schemaHelper,Math.round(1/o.scale),o.offset,c,l,T.contentZoom),x&&this._vectorTileHelper.renderContent(_,o.sourceLod,x,o.vtlNeighborInfos,T.painter,T.layer.styleRepository,T.schemaHelper,Math.round(1/o.scale),o.offset,c,l,T.contentZoom)}catch(z){XLt.warnOnce("A render call containing vector tiles did not resolve correctly.",z)}return L==null||(_.bindFramebuffer(F),e.texture=L.colorTexture,e.offset=Wy,e.scale=1,this.drawRasterData(e,i,r,n,s,M),f)}copyFBOToTexture(e){const i=this._rctx,r=i.bindTexture(e.texture,Ai.TEXTURE_UNIT_FOR_UPDATES),n=e.descriptor;i.gl.copyTexImage2D(Hs.TEXTURE_2D,0,n.pixelFormat,0,0,n.width,n.height,0),e.generateMipmap(),i.bindTexture(r,Ai.TEXTURE_UNIT_FOR_UPDATES)}_clearCurrentFBO(){this._rctx.setStencilWriteMask(255),this._rctx.setClearColor(0,0,0,0),this._rctx.setClearDepth(1),this._rctx.setClearStencil(0),this._rctx.clearSafe(In.COLOR_BUFFER_BIT|In.DEPTH_BUFFER_BIT|In.STENCIL_BUFFER_BIT)}_initFBO(e,i,r){this._rctx.bindFramebuffer(e),r&&(this._rctx.setViewport(0,0,i,i),this._clearCurrentFBO())}ensureBuffer(e){this._lastUsedIds.length=0,this._lastUsedIds.push(1),this._lastCreatedBufferId=1,this._onHoldIds.length=0,this.bind(e)}bind(e,i=0,r=!0){if(this._current=i,i>=this._fbos.length)for(let n=this._fbos.length;n<=i;n++)this._fbos.push(new Hbe(this._rctx));this._initFBO(this._fbos[i].get(e),e,r)}_bindNextFreeBuffer(e){this._lastUsedIds.length>0?this.bind(e,this._lastUsedIds.pop()):(this._lastCreatedBufferId++,this.bind(e,this._lastCreatedBufferId))}openGroup(e){this._onHoldIds.push(this._current),this._bindNextFreeBuffer(e)}switch(e){const i=this.currentFBO(e),r=this._current;return this._bindNextFreeBuffer(e),this._lastUsedIds.push(r),i}getLastOnHoldId(){return this._onHoldIds[this._onHoldIds.length-1]}closeGroup(e){const i=this._current;this._bindNextFreeBuffer(e),this._lastUsedIds.push(i),this._lastUsedIds.push(this._onHoldIds.pop())}unbind(){this._rctx.bindFramebuffer(null)}currentFBO(e){return this._fbos[this._current].get(e)}},JLt=class{constructor(){this.sourceLod=[0,0,0],this.offset=[0,0],this.scale=1,this.layerIndex=0,this.isVTLBackground=!1,this.vtlNeighborInfos=new Pi({allocator:e=>e||new KLt})}},KLt=class{constructor(){this.sourceLayerInfo=null,this.sourceLod=[0,0,0],this.offset=[-1,0]}},QLt=class{constructor(e,i,r,n,s,o){this.start=e,this.end=i,this.blendMode=r,this.opacity=n,this.output=s,this.baseOpacity=o}},e9t=class{constructor(e,i,r,n){this._rctx=e,this.tileSize=i,this._techniques=r,this._cache=n,this._passParameters=new X$t,this._backgroundTexture=null,this._backgroundColor=null,this._backgroundDirty=!1,this._maxAnisotropy=this._rctx.parameters.maxMaxAnisotropy,this._composition=new ZLt(this._rctx,this._techniques),this._ensureBackgroundTexture(this.tileSize)}dispose(){this._composition=Kt(this._composition),this._backgroundTexture=ir(this._backgroundTexture)}get backgroundIsGrid(){return this._backgroundColor==null}get backgroundColor(){return this._backgroundColor}updateTileTexture(e,i){if(!e.renderData)return;const r=e.surface,n=r.baseOpacity;let s=0,o=0,l=this.tileSize,c=!1,f=!1;const _=r.view.state.contentPixelRatio;let x=!1;pV.clear(),NC.length=0;const T=e.layerInfo[Yi.MAP];let A=0,M=null;for(;A0)&&(n=r_.Delayed);const s=e.renderData;s.textureReference==null&&(n=r_.Immediate),s.setTextureReference(new wY(r,ua.FADING,qbe,e.surface.baseOpacity,0,1),n)}_useLayerTexture(e,i){const r=e.surface.layerViewByIndex(i,Yi.MAP),n=Y7(r.layer),s=n?e.surface.baseOpacity:1,o=n?1:e.surface.baseOpacity,l=r.fullOpacity,c=EY(e,i,!1);return!!this._dataToTexture(c)&&(e.renderData.setTextureReference(new wY(c.sourceLayerInfo.data,ua.FADING,c,s,o,l)),!0)}_composeMapLayers(e,i,r,n,s,o,l,c,f){this._composition.ensureBuffer(s);const _=e.surface.baseOpacity;let x=!1,T=ki.LINEAR_MIPMAP_LINEAR,A=!1,M=0;for(let z=r;z>=0;z--){const k=e.surface.layerViewByIndex(z,Yi.MAP),U=L5(k),j=EY(e,z,U),H=k.layer.opacity;if(!j||H===0&&!f)continue;const Y=!Y7(k.layer)&&!x;Y&&(x=!0);let Q=!1;c.forEach(be=>{be.start===z&&(be.output=n?Jo.Composite:l&&Y?this.backgroundIsGrid?Jo.GridComposite:Jo.ColorComposite:Jo.Composite,be.baseOpacity=Y?_:1,NC.push(be),this._composition.openGroup(s),Q=!0)}),this._passParameters.baseOpacity=Y&&!Q&&_<1?_:1;const ne=this._passParameters.baseOpacity<1?up.Required:up.NotRequired,re=M===0,he=Q?Jo.GroupBackgroundComposite:l&&re?this.backgroundIsGrid?Jo.GridComposite:Jo.ColorComposite:Jo.Composite,ce=Nie[ZL(k)?k.layer.blendMode:"normal"];for(this._passParameters.opacity=H,V4t(j)?A=this._composition.drawVectorData(this._passParameters,he,s,ce,ne,j,o,this.tileSize,A):U4t(j)?(this._composition.drawImageryTileData(this._passParameters,he,s,ce,ne,j),this._hasNearestInterpolation(j)&&(T=ki.NEAREST)):this._dataToTexture(j)&&(this._passParameters.texture=j.sourceLayerInfo.data.texture,this._passParameters.offset=j.offset,this._passParameters.scale=j.scale,this._composition.drawRasterData(this._passParameters,he,s,ce,ne));NC.length>0&&NC[NC.length-1].end===z;){const be=NC.pop();this._passParameters.baseOpacity=be.baseOpacity;const ye=this._passParameters.baseOpacity<1?up.Required:up.NotRequired;this._passParameters.opacity=be.opacity,this._passParameters.offset=Wy,this._passParameters.scale=1,this._composition.drawGroup(this._passParameters,be.output,s,Nie[be.blendMode],ye)}M++}const I=e.renderData,L=f||x&&_<1,F=I.ensureTexture(s,L,()=>this._buildTexture(s,L,T));this._composition.copyFBOToTexture(F),this._composition.unbind(),I.setTextureReference(new wY(F,i,qbe,x?1:_,0,1))}_hasNearestInterpolation(e){const i=e.sourceLayerInfo.data;return!!i.source&&i.interpolation==="nearest"}_dataToTexture(e){if(j4t(e)){const i=e.sourceLayerInfo;i.data=this._buildTexture(i.data,!0),e.tile.setMemoryDirty()}return B4t(e)}setBackground(e){this._backgroundColor!==e&&(this._backgroundColor=e,this._backgroundDirty=!0)}_buildTexture(e,i,r=ki.LINEAR_MIPMAP_LINEAR){if(e==null)return null;const n=new tn;n.wrapMode=Bi.CLAMP_TO_EDGE,n.samplingMode=r,n.maxAnisotropy=this._maxAnisotropy,n.preMultiplyAlpha=!0,n.flipped=!0,n.hasMipmap=!0,i||(n.pixelFormat=ci.RGB);const s=this._rctx;let o;if(typeof e=="number"){n.width=n.height=e;const c=`${e} ${n.pixelFormat}`;o=this._cache.pop(c),o?o.retain():o=new _I(new Ai(s,n),this._cache)}else if(w4t(e)){n.isOpaque=e.isOpaque,n.isOpaque&&(n.pixelFormat=ci.RGB);const c=`${e} ${n.pixelFormat}`;o=this._cache.pop(c),o?(o.retain(),o.texture.setData(e.image)):o=new _I(new Ai(s,n,e.image),this._cache),e.release()}else try{n.width=e.width,n.height=e.height,o=new _I(new Ai(s,n,e))}catch{o=new _I(u$e(s)),console.warn("TileRenderer: failed to execute 'texImage2D', cross-origin image may not be loaded.")}const l=s.bindTexture(o.texture,Ai.TEXTURE_UNIT_FOR_UPDATES);return o.generateMipmap(),s.bindTexture(l,Ai.TEXTURE_UNIT_FOR_UPDATES),o}get test(){return{backgroundTexture:this._backgroundTexture}}};function EY(t,e,i){rc.layerIndex=e,rc.vtlNeighborInfos.clear();const r=t.layerInfo[Yi.MAP][e];if(or(rc.offset,0,0),rc.tile=t,rc.scale=1,rc.sourceLod=t.lij,rc.sourceLayerInfo=r,rc.isVTLBackground=i,r.data)return i&&t.forEachLoadedNeighbor((s,o)=>{if(s.level!==t.level)return;const l=s.layerInfo[Yi.MAP][e];if(!Z7e(l)||r.data===l.data)return;const c=rc.vtlNeighborInfos.pushNew();c.offset=nv[o],c.sourceLod=s.lij,c.sourceLayerInfo=l}),rc;const n=r.upsampleInfo;if(n){const s=n.tile.layerInfo[Yi.MAP][e];return rc.tile=n.tile,Qo(rc.offset,n.offset),rc.scale=n.scale,rc.sourceLod=n.tile.lij,rc.sourceLayerInfo=s,rc}return i?rc:null}function Wie(t){return t.uid}function tke(t){let e=t.blendMode!=="normal";return QO(t.parent)&&(e=tke(t.parent)||e),e}function ike(t,e){QO(t.parent)&&ike(t.parent,e);const i=Wie(t);if(i!=null&&i!==""){const r=pV.get(i);r?r.start=e:pV.set(i,new QLt(e,e,t.blendMode,t.opacity,Jo.Composite,1))}}const pV=new Map,NC=new Array,rc=new JLt,qbe={offset:[0,0],scale:1},nv=new Array;nv[ti.NORTH]=[0,-1],nv[ti.NORTH_EAST]=[-1,-1],nv[ti.EAST]=[-1,0],nv[ti.SOUTH_EAST]=[-1,1],nv[ti.SOUTH]=[0,1],nv[ti.SOUTH_WEST]=[1,1],nv[ti.WEST]=[1,0],nv[ti.NORTH_WEST]=[1,-1];const rke=200,CY=40,t9t=.8,i9t=10,wI=1e-6;function r9t(t,e,i){const r=e,n=i;let s=0,o=1/0;for(let l=0;l<3;++l){{const c=t[l];if(r[l]o)return!1}{const c=t[l+3];if(r[l]>c){if(n[l]>=-wI)return!1;const f=(c-r[l])/n[l];s=Math.max(s,f)}else if(n[l]>=wI){const f=(c-r[l])/n[l];o=Math.min(o,f)}if(s>o)return!1}}return!0}let Wbe=class{constructor(e,i,r,n,s){this.aabb=e,this.axis=i,this.d=r,this.midStartIndex=n,this.rightStartIndex=s}},Nce=class Yie{constructor(e,i,r,n){this.globalTriangleVertexIndices=e,this.firstTriangleIndex=i,this.positions=n,this._rayDirection=W(),this.bspNodeTree=new Array;const s=r-i,o=s<=nke?new Uint16Array(s):new Uint32Array(s);this.indices=o;for(let l=0;l{const A=o9t(o,l,_,x),M=x-_;if(M<=CY){const U=new Wbe(A,void 0,0,_,x);return this.bspNodeTree.push(U),U}const{axis:I,midValue:L}=a9t(A),F=s9t(o,l,_,x,I,L),z=(U,j)=>{if(T>c)return;const H=j-U;return H=t9t*M?void 0:f(U,j,T+1)},k=new Wbe(A,I,L,F.next,F.mid);return this.bspNodeTree.push(k),k.leftNode=z(_,F.next),k.rightNode=z(F.mid,x),k};f(0,s,0),this.triangleVertexIndices=c9t(o,e,i,r)}}intersectRayTriangleRange(e,i){{if(e>=i)return;const r=this.triangleVertexIndices,n=this.positions.data,s=this.positions.stride,o=this._rayOrigin,l=o[0],c=o[1],f=o[2],_=this._rayDirection,x=_[0],T=_[1],A=_[2];for(let M=e,I=3*e;M0){if(ve<0||ve>Ee)continue}else if(ve>0||ve0){if(Ge<0||ve+Ge>Ee)continue}else if(Ge>0||ve+Ge=0){const Ft=this.indices[M]+this.firstTriangleIndex,Qt=fle(Y,Q,ne,re,he,ce,n9t);this._callback(ut,Qt,Ft,!1)}}}Yie.numFacesTested+=i-e}intersectRay(e,i){Yie.numFacesTested=0;const r=nt(e.r0[0],e.r0[1],e.r0[2]),n=nt(e.r1[0],e.r1[1],e.r1[2]),s=n[0]-r[0],o=n[1]-r[1],l=n[2]-r[2];if(s*s+o*o+l*ll||s[o]>0){const c=e.rightStartIndex,f=r;if(c=s?--l:(t[l-1]=t[c],t[c]=f,++c)}return{next:o,mid:c}}function o9t(t,e,i,r){if(r<=i)return P2(NaN,NaN,NaN,NaN,NaN,NaN);{const n=6*t[i];for(let s=0;s<3;++s)FC[s]=e[n+0+s],kC[s]=e[n+3+s]}for(let n=i+1;ni?e>r?0:i>r?1:2:i>r?1:r>e?2:0;return{axis:n,midValue:(t[n]+t[n+3])/2}}function l9t(t,e,i,r,n){const s=i-e,o=new Float32Array(6*s);for(let l=0;lthis._produces()],[ke.TRANSPARENT_TERRAIN,()=>this._produces()],[ke.OCCLUDED_TERRAIN,()=>this._produces()]]),this._tileTextureCache=new G9((o,l)=>s.newCache(o,l),"TileTexture"),this.tileGeometryCache=new W$t(s)}normalizeCtorArgs(){return{}}initialize(){this._stage.addRenderPlugin(this)}destroy(){this._stage.removeRenderPlugin(this),this._tileTextureCache.destroy(),this.tileGeometryCache.destroy()}_produces(){return this.visible&&!!this._rootTiles&&!this.renderingDisabled}consumes(){return this._overlayRenderer.hasWater?PLe:Vj}set renderingDisabled(e){this._set("renderingDisabled",!!e),this.setDirty()}set visible(e){this._set("visible",!!e),this.setDirty()}set transparency(e){this._transparencyState!==e&&(this._techniqueConfiguration.invisible=e===ru.TransparentWithDraped||e===ru.Empty,this._transparencyState=e,this.setNeedsRender())}get transparency(){return this._transparencyState}get renderPatchBorders(){return!!this._techniqueConfiguration.tileBorders}set renderPatchBorders(e){this._techniqueConfiguration.tileBorders!==e&&(this._techniqueConfiguration.tileBorders=e,this.setNeedsRender(),this.notifyChange("renderPatchBorders"))}get visualizeNormals(){return!!this._techniqueConfiguration.visualizeNormals}set visualizeNormals(e){this._techniqueConfiguration.visualizeNormals!==e&&(this._techniqueConfiguration.visualizeNormals=e,this.setNeedsRender(),this.notifyChange("visualizeNormals"))}get cullBackFaces(){return this._techniqueConfiguration.backfaceCullingEnabled}set cullBackFaces(e){this._techniqueConfiguration.backfaceCullingEnabled!==e&&(this._techniqueConfiguration.backfaceCullingEnabled=e,this.notifyChange("cullBackFaces"),this.setNeedsRender())}set renderOrder(e){this._set("renderOrder",e),this._setSortingDirty()}get layerUid(){return Gw}get slicePlaneEnabled(){return this._techniqueConfiguration.hasSlicePlane}set slicePlaneEnabled(e){this._techniqueConfiguration.hasSlicePlane!==e&&(this._techniqueConfiguration.hasSlicePlane=e,this.setNeedsRender())}set textureFadingEnabled(e){this._techniqueConfiguration.textureFadingEnabled!==e&&(this._techniqueConfiguration.textureFadingEnabled=e,this.setNeedsRender())}set pbrMode(e){this._techniqueConfiguration.pbrMode!==e&&(this._techniqueConfiguration.pbrMode=e,this.setNeedsRender())}setDebugScreenSizePerspective(e){this._techniqueConfiguration.screenSizePerspective!==e&&(this._techniqueConfiguration.screenSizePerspective=e,this.setNeedsRender())}setRootTiles(e){this._rootTiles=e,this.setDirty()}setRenderOccludedOverlay(e){this.renderOccludedFlags=e?ZU:Wn.Occlude,this.setNeedsRender()}setStencilEnabledLayerExtents(e){this._stencilEnabledLayerExtents=e,this._setSortingDirty()}setTileSize(e){this._tileSize=e,this._tileRenderer!=null&&(this._tileRenderer.tileSize=e),this.setDirty()}_prepareTileForLoading(e){e.renderData||(e.renderData=this._renderDataPool.acquire(),e.renderData.init(e),e.renderData.localOrigin=this._getLocalOriginOfTile(e))}loadTile(e){this._prepareTileForLoading(e),this.updateTileGeometryState(e),this.updateTileTexture(e,hi.TEXTURE_FADING)}updateTileTexture(e,i){this._tileRenderer!=null&&(this._tileRenderer.updateTileTexture(e,i===hi.TEXTURE_FADING?ua.FADING:ua.UNFADED),this.setNeedsRender(),e.resetPendingUpdate(i))}updateTileGeometryState(e){for(const r of e.layerInfo[Yi.ELEVATION])r.pendingUpdates&=~hi.GEOMETRY;e.resetPendingUpdate(hi.GEOMETRY);const i=e.renderData.updateGeometryState();return i&&this.setDirty(),i}updateGeometryIfNeeded(e){e.isLoaded&&e.renderData.updateGeometryIfNeeded(this._rctx)}unloadTile(e){const i=e.renderData;i&&(i.releaseGeometry(),this._renderDataPool.release(i),i.clear(),e.renderData=null,e.setMemoryDirty(),this.setDirty())}_getLocalOriginOfTile(e){const i=u9t-AY,r=Math.max(0,Math.floor((e.level-i)/AY)*AY);if(this._isGlobal&&r===0)return Ka;for(;e.parent&&e.level>r;)e=e.parent;return e.centerAtSeaLevel}getStats(){return{numTilesRendered:this._numTilesRendered,numTilesCulled:this._numTilesCulled,numOriginsRendered:this._numOriginsRendered}}set wireframe(e){this._get("wireframe")!==e&&(this._set("wireframe",e),this.setNeedsRender())}setDirty(e=no.UPDATE){this._patchesByOriginDirty=!0,this._context.requestRender(e)}_setSortingDirty(e=no.UPDATE){this._patchSortingDirty=!0,this._context.requestRender(e)}setNeedsRender(e=no.UPDATE){this._context.requestRender(e)}initializeRenderContext(e){this._context=e,this._tileRenderer=new e9t(this._rctx,this._tileSize,this._techniques,this._tileTextureCache),this.updateTileBackground(),this._emptyTex=u$e(this._rctx)}uninitializeRenderContext(){this._emptyTex=Kt(this._emptyTex),this._tileRenderer=Kt(this._tileRenderer)}intersect(e,i,r,n){if(!this._rootTiles||e.options.selectOpaqueTerrainOnly&&e.options.selectionMode&&this.transparency!==ru.Opaque)return;const s=h9t,o=d9t;je(s,n,r),Ie(o,1/s[0],1/s[1],1/s[2]);const l=e.results.min,c=e.results.max,f=e.results.ground,_=e.options.store===tl.MIN,x=!!e.results.ground.target,T=o0t(e.verticalOffset),A=e.tolerance;let M,I=_&&l.dist!=null?l.dist:1/0;const L=z=>{const k=z.renderData;if(!(k!=null&&k.vao))return;const U=k.geometry;NB(MY,U.boundingBox);const j=k.localOrigin;T!=null&&(T.localOrigin=j,T.applyToAabb(MY));const H=MY;if(zC[0]=r[0]-j[0],zC[1]=r[1]-j[1],zC[2]=r[2]-j[2],!gle(H,zC,o,A,I))return;const Y=(pe,Ee,te)=>{pe.set(this.type,z,Ee,te,gs),I=_&&l.dist!=null?l.dist:1/0},Q=(pe,Ee)=>{if(Ee!=null&&pe>=0&&(e.options.backfacesTerrain||Ve(Ee,s)<0)&&(e.options.invisibleTerrain||!e.options.selectionMode||i==null||i(r,n,pe))){if((f.dist==null||pec.dist)&&Y(c,pe,Ee)}},ne=p9t;je(ne,n,j);const re=U.indices,he=U.vertexAttributes,ce=he.getField(J.POSITION,Ea),be=new yP(ce.typedBuffer,3,he.stride/4),ye=U.indexCount/3;if(!T&&ye>rke){const pe=z.renderData;pe.intersectionData==null&&(pe.intersectionData=new Nce(re,0,ye,be)),pe.intersectionData.intersectRay({r0:zC,r1:ne},Q)}else Q9(zC,ne,0,ye,re,be,null,T,Q)},F=this._rootTiles;F!=null&&(()=>{const z=this._tileIterator;z.reset(F);const k=e.options.invisibleTerrain;for(let U=z.next();U;U=z.next())!(U.visible||k&&U.intersectsClippingArea)||T==null&&!U.intersectsRay(r,s,A,I)||x&&this._useStencilForTile(U)?z.skipSubtree():L(U)})()}processScaleRangeQueries(e,i){var r;if(!i.done)for(this._updatePatchGroups();e.updating&&!i.done;){e.prepare();for(const n of this._visiblePatchesByOrigin.values())for(const s of n)((r=s.renderData)==null?void 0:r.textureReference)!=null&&e.queriesForTile(s);e.process(),i.madeProgress()}}prepareTechnique(e){const i=Le("enable-feature:terrain-shadows")&&e.bindParameters.shadowMap.enabled;if(i!==this._castShadows&&(this._castShadows=i,this._patchesByOriginDirty=!0),e.bindParameters.slot===ke.OCCLUDED_TERRAIN){if(!(e.renderOccludedMask&ZU))return null}else{const r=this.transparency===ru.Opaque?ke.OPAQUE_TERRAIN:ke.TRANSPARENT_TERRAIN;if(e.bindParameters.slot!==r)return null}if(this.transparency===ru.Empty)return null;switch(e.output){case ue.Color:return this._techniqueConfiguration.hasScreenSpaceReflections=e.bindParameters.ssr.lastFrameColor!=null,this._techniqueConfiguration.hasCloudsReflections=e.bindParameters.cloudsFade.data!=null,this._techniqueConfiguration.receiveShadows=e.bindParameters.shadowMap.ready,this._techniqueConfiguration.receiveAmbientOcclusion=e.bindParameters.ssao!=null,this._techniqueConfiguration.overlayMode=this._overlayRenderer.mode,this._updateTechnique(ue.Color,e.bindParameters.slot===ke.OCCLUDED_TERRAIN);case ue.Shadow:case ue.ShadowExcludeHighlight:return this._castShadows?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(ue.Shadow,!1)):null;case ue.Depth:return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(ue.Depth,!1);case ue.Normal:return this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(ue.Normal,!1);case ue.ObjectAndLayerIdColor:return this._updateTechnique(ue.ObjectAndLayerIdColor,!1);case ue.Highlight:return this._overlayRenderer.hasHighlights?(this._techniqueConfiguration.receiveShadows=this._techniqueConfiguration.receiveAmbientOcclusion=!1,this._updateTechnique(ue.Highlight,!1)):null}return null}renderNode(e,i){switch(this._updatePatchGroups(),i.useStencil=!1,e.output){case ue.Color:{const r=e.bindParameters.slot===ke.OCCLUDED_TERRAIN?ns.Occluded:ns.Color;this._renderMaterialPass(e,i,r);break}case ue.Depth:case ue.Normal:this._renderAuxiliaryPass(e,i,ns.Color,this._visiblePatchesByOrigin);break;case ue.Highlight:this._renderAuxiliaryPass(e,i,ns.Highlight,this._visiblePatchesByOrigin);break;case ue.Shadow:case ue.ShadowExcludeHighlight:this._renderAuxiliaryPass(e,i,null,this._allPatchesByOrigin);break;case ue.ObjectAndLayerIdColor:this._renderAuxiliaryPass(e,i,ns.ObjectAndLayerIdColor,this._visiblePatchesByOrigin)}}updateTileBackground(e){if(this._tileRenderer==null)return;const i=this._tileRenderer;let r;if(e!=null){const n=qe.toUnitRGBA(e);r=nt(n[0]||0,n[1]||0,n[2]||0)}i.setBackground(r),this._allTiles.forAll(n=>i.updateTileTexture(n,ua.FADING)),this._techniqueConfiguration.tileBlendInput=i.backgroundIsGrid?_y.GridComposite:i.backgroundColor!=null?_y.ColorComposite:_y.LayerOnly,this.setNeedsRender()}_updatePatchGroups(){if(this._patchesByOriginDirty&&(this._rebuildPatchGroups(),this._patchesByOriginDirty=!1,this._patchSortingDirty=!0),this._patchSortingDirty&&this.renderOrder!==D5.NONE){const e=Array.from(this._visiblePatchesByOrigin.values()),i=this._stencilEnabledLayerExtents;for(const r of e)dFe(this.renderOrder,r,i);e.sort((r,n)=>pFe(r[0],n[0],this.renderOrder)),this._visiblePatchesByOrigin=new Map(e.map(r=>[r[0].renderData.localOrigin,r])),this._patchSortingDirty=!1}}_rebuildPatchGroups(){var i;const e=this._rootTiles;if(e!=null){(i=e[0])==null||i.surface.checkAllTilesWaterproofness(),this._visiblePatchesByOrigin.clear(),this._allPatchesByOrigin.clear();for(const r of e)this._rebuildPatchGroupsForRootTile(r)}}_rebuildPatchGroupsForRootTile(e){const i=this._tileIterator;for(i.resetOne(e);!i.done;){const r=i.next(),n=r.renderData;if(!n){this._numTilesCulled++;continue}const s=n.localOrigin;if(this._castShadows){let l=this._allPatchesByOrigin.get(s);l||(l=new Array,this._allPatchesByOrigin.set(s,l)),l.push(r)}if(!r.visible){this._numTilesCulled++,i.skipSubtree();continue}let o=this._visiblePatchesByOrigin.get(s);o||(o=new Array,this._visiblePatchesByOrigin.set(s,o)),o.push(r),i.skipSubtree()}}_useStencilForTile(e){for(const i of this._stencilEnabledLayerExtents)if(e.intersectsExtent(i))return!0;return!1}_renderAuxiliaryPass(e,i,r,n){const s=e.rctx;this._passParameters.overlayContent=r,s.bindTechnique(i,this._passParameters,e.bindParameters);const o=this._stencilEnabledLayerExtents.length>0;n.forEach(l=>{const c=l[0].renderData.localOrigin;i.program.bindDraw(new fie(c),e.bindParameters,this._passParameters);for(let f=0;f0,c=r===ns.Occluded;c&&(o.bindTexture("tex",this._emptyTex),o.setUniform3fv("textureOpacities",Ka),o.setUniform4fv("texOffsetAndScale",gp));const f=((T=this._tileRenderer)==null?void 0:T.backgroundColor)!=null?this._tileRenderer.backgroundColor:Ka;this._techniqueConfiguration.tileBlendInput===_y.ColorComposite&&o.setUniform3fv("backgroundColor",f);const _=this.wireframe?sr.LINES:sr.TRIANGLES;this._techniqueConfiguration.textureFadingEnabled&&o.bindTexture("texNext",this._emptyTex);const x=this._visiblePatchesByOrigin;for(const A of x.values()){const M=A[0].renderData.localOrigin;i.program.bindDraw(new fie(M),e.bindParameters,this._passParameters),this._numOriginsRendered++;for(const I of A){const L=I.renderData,F=L.textureReference;if(F!=null){if(!c){o.setUniform4fv("texOffsetAndScale",F.offsetAndScale),o.bindTexture("tex",F.texture.texture);const z=L.textureFadeFactor,k=z<1?L.nextTextureReference:null;this._techniqueConfiguration.textureFadingEnabled&&k!=null&&z<1?(o.setUniform1f("fadeFactor",z),o.setUniform4fv("nextTexOffsetAndScale",k.offsetAndScale),o.setUniform3fv("nextTexOpacities",k.opacities),o.bindTexture("texNext",k.texture.texture)):o.setUniform1f("fadeFactor",1),L.textureIsFading&&this.setNeedsRender(),o.setUniform3fv("textureOpacities",F.opacities)}this._renderPatch(e,i,I,_,l,r),I.renderOrder=this._numTilesRendered,this._numTilesRendered++}}}e.rctx.bindVAO(null)}_renderPatch(e,i,r,n,s,o){const l=r.renderData,c=l.vao,f=c==null?void 0:c.indexBuffer;if(f==null)return void(pa&&console.error("Rendered tile with no indices: ",r.lij," : ",l));const _=i.program;o==null||this._overlayRenderer.isEmpty||this._bindOverlayPatchData(_,l.overlay),s&&(i.useStencil=this._useStencilForTile(r),e.rctx.setPipelineState(i.getPipeline()));const x=l.geometry.indexCount;e.rctx.bindVAO(c),_.assertCompatibleVertexAttributeLocations(c),e.rctx.drawElements(n,x,f.indexType,0)}_bindOverlayPatchData(e,i){e.setUniform4fv("overlayTexOffset",i.offsets),e.setUniform4fv("overlayTexScale",i.scales)}_updateTechnique(e,i){return this._techniqueConfiguration.output=e,this._techniqueConfiguration.renderOccluded=i,this._shaderTechnique=this._techniques.releaseAndAcquire(SFe,this._techniqueConfiguration,this._shaderTechnique),this._shaderTechnique}get test(){return{tileRenderer:this._tileRenderer}}};y([w({readOnly:!0})],j0.prototype,"_isGlobal",null),y([w({value:!1})],j0.prototype,"renderingDisabled",null),y([w({value:!0})],j0.prototype,"visible",null),y([w()],j0.prototype,"renderPatchBorders",null),y([w()],j0.prototype,"visualizeNormals",null),y([w()],j0.prototype,"cullBackFaces",null),y([w({value:D5.FRONT_TO_BACK})],j0.prototype,"renderOrder",null),y([w()],j0.prototype,"wireframe",null),j0=y([Z("esri.views.3d.terrain.TerrainRenderer")],j0);const h9t=W(),d9t=W(),zC=W(),p9t=W();let f9t=class{constructor(){this.numNodes=0,this.numLeaves=0,this.numVisible=0,this.numRendered=0,this.numSplit=0,this.numMerged=0,this.numRenderedPerLevel=new Array,this.numLoadedPerLevel=new Array}},Fg=class extends ze{constructor(e){super(e)}initialize(){this.addHandles([this.layers.on("change",()=>this._update()),_e(()=>this.extentHelper.layerViewsExtent,()=>this._setAdHocTilingScheme())]),this._update(),this.tilingSchemeLocked||this._setAdHocTilingScheme()}destroy(){this._waitTask=null,this.layers.destroy()}_update(){if(this._waitTask=null,this.tilingSchemeLocked)return;let e;if(this.layers.some(i=>!(!oO(i)||i.isRejected())&&!(i.isFulfilled()&&!m9t(i,this.viewSpatialReference,this.viewingMode))&&(e=i,!((i==null?void 0:i.type)==="vector-tile"||aV(i)))),e)if(e.isResolved()){const i=SG(e,this.viewSpatialReference,this.viewingMode);if(i!=null){const r=new Bu(i.tileInfo);this._lockTilingScheme(r)}}else this._updateWhen(e)}_updateWhen(e){const i=e.when().catch(()=>{}).then(()=>{i!==this._waitTask||this.destroyed||this._update()});this._waitTask=i}_lockTilingScheme(e){if(this.viewingMode===_t.Global){const i=e.levels.length-1;e.spatialReference.isWebMercator?e=Bu.makeWebMercatorAuxiliarySphere(i):D2(e.spatialReference)&&(e=Bu.makeGCSWithTileSize(e.spatialReference,e.pixelSize,i))}this.tilingSchemeLocked=!0,this.tilingScheme=e,this.extentHelper.tilingScheme=this.tilingScheme,this._updateTiledLayerExtent(),this.removeAllHandles(),this.addHandles(_e(()=>this.extentHelper.tiledLayersExtent,()=>this._updateTiledLayerExtent()))}_updateTiledLayerExtent(){this._set("extent",this.extentHelper.tiledLayersExtent)}_setAdHocTilingScheme(){if(this.viewingMode===_t.Global){const e=this.extentHelper.viewSpatialReference,i=D2(e)||r1(e)||n1(e);e.isWebMercator?this.tilingScheme=Bu.WebMercatorAuxiliarySphere:i&&(this.tilingScheme=Bu.makeGCSWithTileSize(e,256)),this._set("extent",this.extentHelper.layerViewsExtent)}else{const e=this.extentHelper.layerViewsExtent;e==null||uT(e,this.extent)||(this.tilingScheme=Bu.fromExtent(e,this.extentHelper.viewSpatialReference),this._set("extent",e))}}get test(){return{lockTilingScheme:e=>this._lockTilingScheme(e),done:!this._waitTask}}};function m9t(t,e,i){return SG(t,e,i)!=null}y([w()],Fg.prototype,"tilingScheme",void 0),y([w({readOnly:!0})],Fg.prototype,"extent",void 0),y([w({value:!1})],Fg.prototype,"tilingSchemeLocked",void 0),y([w({constructOnly:!0})],Fg.prototype,"viewSpatialReference",void 0),y([w({constructOnly:!0})],Fg.prototype,"layers",void 0),y([w({constructOnly:!0})],Fg.prototype,"extentHelper",void 0),y([w({constructOnly:!0})],Fg.prototype,"viewingMode",void 0),Fg=y([Z("esri.views.3d.terrain.TilingSchemeLogic")],Fg);let g9t=class{constructor(){this.offset=yt(),this.scale=0,this.tile=null}init(e,i,r,n){this.tile=e,this.offset[0]=i,this.offset[1]=r,this.scale=n}dispose(){this.tile=null,this.offset[0]=0,this.offset[1]=0,this.scale=0}};var gk;let Hi=gk=class extends Dn.EventedMixin(ze){constructor(t){var e,i;super(t),this._scaleRangeQueries=new fk,this._iteratorPool=new Ec(hFe,r=>r.remove=()=>this._iteratorPool.release(r)),this._postorderIterator=new zIt,this._hasPendingUpdates=!1,this._pendingUpdates=0,this._asyncWorkItems=0,this._allTilesDirty=!0,this._allTilesSorted=!0,this._usedMemory=null,this._performanceInfo=new f9t,this._viewChanged=!1,this._inFrameTask=!1,this._viewChangeUpdateDirty=!1,this._eyePosRenderSR=W(),this._eyePosSurfaceSR=W(),this._splitLimits=new B0,this._frustum=OL(),this._viewProjectionMatrix=Qe(),this._layerViews=[new Array,new Array],this._layerIndexByUid=[new Map,new Map],this._basemapLayerViewHandles=new Map,this._watchUpdatingTracking=new Rf,this._frameTask=g5,this._allTiles=new Pi,this._upsampleInfoPool=new Ec(g9t),this._shouldEmitChangeEvent=!1,this._rootTilesExtent=Ni(),this.updatingProgress=.5,this._maxNumUpdating=1,this.maxTextureScale=1.2,this._spatialReference=at.WebMercator,this.visibleElevationBounds=new BM(1/0,-1/0),this.rootTileElevationBounds=new BM(1/0,-1/0),this._updatingRootTiles=!1,this._pendingTilesForElevationUpdateEvent=new Set,this._pendingTilesToUpdate=new Set,this.totalGeometryUpdates=0,this.totalTileUpdates=0,this._oneBatchPerFrameTask=!0,this._layerViewsDirty=!1,this.unloadedMemory=0,this.ignoresMemoryFactor=!1,this._isWebMercator=!1,this._isWebMercatorOnPlateeCarree=!1,this.overlayManager=new Ou({...t,surface:this}),this._isGlobal=!((i=(e=t.view)==null?void 0:e.state)!=null&&i.isLocal),this._tileConstructor=this._isGlobal?G$t:V$t}initialize(){const t=this.view,e=t.resourceController;this._lercDecoder=iFe(e);const i=e.memoryController;this._tileCache=new G9((c,f)=>i.newCache(c,f),"terrain-tile"),this._upsampleMapCache=i.newCache("terrain-upsample",c=>c.unloadMapData()),this._elevationQueryCache=new Q7e(i.newCache("elevation-query"));const r=this.overlayManager;this._renderer=new j0(r.renderer,t._stage,this._allTiles,Sr(t.spatialReference).radius,i),this.addHandles([_e(()=>r.rendersOccluded,c=>this._renderer.setRenderOccludedOverlay(c)),_e(()=>r.renderer.isEmpty,()=>this._evaluateTransparency()),_e(()=>this.renderer.visible,c=>this.suspended=!c)],"overlayManager"),this.addHandles([_e(()=>this.baseOpacity,()=>{this._handleLayerViewChanges(),this._updateTileTextures(this._evaluateTransparency()?ua.UNFADED:ua.IMMEDIATE)},kt),_e(()=>this.hasCompositeBlendMode,()=>this._updateTileTextures(this._evaluateTransparency()?ua.UNFADED:ua.IMMEDIATE),kt),_e(()=>this.backgroundColor,(c,f)=>{c!=null&&c.equals(f)||(this._handleLayerViewChanges(),this._renderer.updateTileBackground(c))},Li),_e(()=>this.snapLevel,()=>this._viewChanged=!0,Li),_e(()=>this.view.pointsOfInterest,c=>{this._renderer.pointsOfInterest=c,this._watchUpdatingTracking.removeAll(),c&&this._watchUpdatingTracking.add(()=>c.focus.renderLocation,()=>this._allTilesSorted=!1)}),_e(()=>Tn.TERRAIN_TILE_TREE_SHOW_TILES,c=>{c&&!this._treeDebugger?we(()=>import("./TerrainTileTree3DDebugger-Or7WvqAU.js"),__vite__mapDeps([232,233])).then(({TerrainTileTree3DDebugger:f})=>{!this._treeDebugger&&Tn.TERRAIN_TILE_TREE_SHOW_TILES&&(this._treeDebugger=new f({view:t}))}):c||(this._treeDebugger=et(this._treeDebugger))},ii)]);const{spatialReference:n}=t;this._extentHelper=MIt(this.viewingMode,{layers:t.map.allLayers,layerViews:t.allLayerViews,viewSpatialReference:n});const s=new GT({getCollections:()=>{var c,f;return(f=(c=t.defaultsFromMap)==null?void 0:c.mapCollections)==null?void 0:f.map(({layers:_})=>_)},getChildrenFunction:c=>c&&"layers"in c?c.layers:null}),o=new Fg({layers:s,extentHelper:this._extentHelper,viewingMode:this.viewingMode,viewSpatialReference:n});this._set("tilingSchemeLogic",o),this._updateTilingScheme(),this._elevationDataRequester=e.createStreamDataRequester(dy.ELEVATION),this._mapDataRequester=e.createStreamDataRequester(dy.BASEMAP);const l=e.scheduler;this._frameTask=l.registerTask(ni.TERRAIN_SURFACE,this),this.addHandles([_e(()=>this._extentHelper.stencilEnabledExtents,c=>this._renderer.setStencilEnabledLayerExtents(c),ii),_e(()=>this.tilingSchemeLogic.tilingScheme,()=>this._updateTilingScheme(),Li),_e(()=>this.extent,()=>this._updateRootTiles(),ii),t.on("resize",()=>this._viewChangeUpdate()),_e(()=>{const c=t.state;return[this._lodBias,this.lodSnapping,t.quality,c.camera,c.contentCamera,c.fixedContentCamera]},()=>this._viewChangeUpdate(),kt),_e(()=>{var c,f;return(f=(c=t.qualitySettings)==null?void 0:c.tiledSurface)==null?void 0:f.textureFadeDuration},c=>this._renderer.textureFadingEnabled=c>0,ii),_e(()=>{var c;return(c=t.qualitySettings)==null?void 0:c.physicallyBasedRenderingEnabled},c=>this._renderer.pbrMode=c?ei.Terrain:ei.Disabled,ii),_e(()=>this._userClippingExtent,()=>this._updateClippingExtent(),Li)]),this.addHandles(t.allLayerViews.on("after-changes",()=>this._layerViewsDirty=!0)),this._layerViewsDirty=!0,this._handleLayerViewChanges(),this._renderer.updateTileBackground(this.backgroundColor)}destroy(){this._frameTask.remove(),this._watchUpdatingTracking.destroy(),this._lercDecoder=ir(this._lercDecoder),this._removeAllTiles(),this._set("tilingSchemeLogic",et(this.tilingSchemeLogic)),this._basemapLayerViewHandles.forEach((t,e)=>this._unregisterTiledLayerView(e)),this._elevationDataRequester=null,this._mapDataRequester=null,this._set("overlayManager",et(this.overlayManager)),this._tileCache=et(this._tileCache),Cce.prune(),this._treeDebugger=et(this._treeDebugger),this._renderer=et(this._renderer),this._iteratorPool=et(this._iteratorPool),this._upsampleMapCache=et(this._upsampleMapCache),this._elevationQueryCache=et(this._elevationQueryCache),this._set("view",null),this._extentHelper=et(this._extentHelper),this._upsampleInfoPool=et(this._upsampleInfoPool),TIt(),h$t()}get renderer(){return this._renderer}get frustum(){return this._frustum}get snapLevel(){var t,e;if(this.lodSnapping===E$.ON){const i=this.view,r=this.tilingScheme,n=(e=(t=i.pointsOfInterest)==null?void 0:t.cameraOnSurface)==null?void 0:e.scale;if(r&&n){const s=i.state.contentCamera;let o=Sj(i,s.eye,s.viewForward,s.up).tilt;o>90&&(o=180-o);const l=2*(o/90)**2,c=r.levelAtScale(n)-l,f=Math.min(c+i.qualitySettings.tiledSurface.lodBias,this._splitLimits.maxLod||1/0);return f<=0?null:f}}return null}get lodSnapping(){return this.view.qualitySettings.tiledSurface.reduceTileLevelDifferences?E$.ON:E$.OFF}get upsampleInfoPool(){return this._upsampleInfoPool}get upsampleMapCache(){return this._upsampleMapCache}get elevationQueryCache(){return this._elevationQueryCache}get mapTileRequester(){return this._mapDataRequester}get _userClippingExtent(){const{spatialReference:t}=this,{clippingArea:e}=this.view;if(e==null||t==null)return null;const i=Ni(),r=k7e(e,i,t)?i:null,n=this._get("extent");return uT(r,n)?n:r}get rootTilesExtent(){return this._rootTilesExtent}get extent(){const t=WZ(this.groundExtent,this._userClippingExtent,Ni()),e=this._get("extent");return uT(t,e)?e:t}get groundExtent(){return this._tilingSchemeExtent!=null?this._tilingSchemeExtent:this._rootTilesExtent}get _tilingSchemeExtent(){var t;return(t=this.tilingSchemeLogic)==null?void 0:t.extent}get updating(){var t,e;return this._hasPendingUpdates||(this._maxNumUpdating=1),!!((this.running||(t=this._watchUpdatingTracking)!=null&&t.updating||this._asyncWorkItems>0)&&this.ready&&!this.suspended||(e=this.overlayManager)!=null&&e.updating)}get running(){return(this._hasPendingUpdates||this._viewChanged||this._allTilesDirty||!this._allTilesSorted||this._layerViewsDirty||this._scaleRangeQueries.updating||this._frameTask.updating)&&this.ready&&!this.suspended}get updatingProgressValue(){return this._maxNumUpdating=Math.max(this._pendingUpdates,this._maxNumUpdating),1-this._pendingUpdates/this._maxNumUpdating}get baseOpacity(){var t,e,i;return((i=(e=(t=this.view)==null?void 0:t.map)==null?void 0:e.ground)==null?void 0:i.opacity)??1}set baseOpacity(t){this.view.map.ground.opacity=t}get viewingMode(){return this.view.state.viewingMode}get ready(){return this._rootTiles!=null}set renderOrder(t){this._renderer.renderOrder=t,this._set("renderOrder",t)}get rootTiles(){return this._rootTiles}get spatialReference(){var t;return((t=this.tilingScheme)==null?void 0:t.spatialReference)??null}get backgroundColor(){var t,e,i;return(i=(e=(t=this.view)==null?void 0:t.map)==null?void 0:e.ground)==null?void 0:i.surfaceColor}set backgroundColor(t){this.view.map.ground.surfaceColor=t}set slicePlaneEnabled(t){this._renderer.slicePlaneEnabled=t,this._set("slicePlaneEnabled",t),this._evaluateTransparency()}get tilingSchemeLocked(){var t;return((t=this.tilingSchemeLogic)==null?void 0:t.tilingSchemeLocked)??!1}get wireframe(){var t;return(t=this._renderer)==null?void 0:t.wireframe}set wireframe(t){t!==this._renderer.wireframe&&(this._renderer.wireframe=t,this._updateAllTileGeometries())}get opaque(){return this._renderer.transparency===ru.Opaque}set suspended(t){this._set("suspended",t),this._viewChangeUpdate()}get textureFadeDuration(){return this.view.qualitySettings.tiledSurface.textureFadeDuration??0}intersect(t,e,i,r){this._renderer.intersect(t,e,i,r)}getElevation(t,e,i,r){const n=this._rootTiles;if(!(n!=null&&n.length)||n[0].layerInfo[Yi.ELEVATION].length===0)return null;const s=Su;return s[0]=t,s[1]=e,s[2]=i,el(s,r,s,this._spatialReference)?Xbe(n,s[0],s[1]):(Ce.getLogger(this).error("TerrainSurface.getElevation(): could not project given point to tiling scheme coordinate system"),null)}getElevations(t,e,i){const r=this._rootTiles,n=r?r[0].layerInfo[Yi.ELEVATION].length:0;if(r!=null&&r.length&&n!==0)for(let s=0;sn[2]&&(s+=1),Su[1]{if(l&&epe(l.extent,Su))if(l.isLeaf||l.rendered)i=Math.min(i,l.elevationBounds[0]),r=Math.max(r,l.elevationBounds[1]);else for(const c of l.children)n(c)},s=this._rootTiles;if(s!=null)for(const l of s)n(l);return{min:i,max:r}}getRootElevationBounds(){return{min:this.rootTileElevationBounds.min,max:this.rootTileElevationBounds.max}}getSphereScale(t,e){if(!this.tilingScheme)return null;if(!ud(t,Su,this.spatialReference))return Ce.getLogger(this).error("TerrainSurface.getSphereScale(): could not project given point to tiling scheme coordinate system"),null;Su[3]=e;let i=null;const r=s=>{if(s&&epe(s.extent,Su)){const o=s.children;if(o[0]&&!s.rendered)for(const l of o)r(l);else{const l=this._getLodBiasCorrectedScale(s.level);i=i==null?l:Math.min(i,l)}}},n=this._rootTiles;if(n!=null)for(const s of n)r(s);return i}queryVisibleScaleRange(t,e,i,r){const n=e?this.tilingScheme.levelAtScale(e):0,s=i?this.tilingScheme.levelAtScale(i):1/0,o=this._lodBias;this._scaleRangeQueries.queryVisibleLevelRange(t,n+o,s+o,r)}_evaluateTransparency(){var s,o;const t=this.baseOpacity,e=this.overlayManager.renderer.isEmpty,i=this._renderer.transparency,r=this._allSurfaceLayersTransparent()?e?ru.Empty:ru.TransparentWithDraped:t>=1&&!this.hasCompositeBlendMode&&!this._renderer.slicePlaneEnabled?ru.Opaque:ru.Semitransparent,n=i!==r;return n&&(this._renderer.transparency=r,(o=(s=this.view)==null?void 0:s._stage)==null||o.renderer.setParameters({terrainTransparency:this._renderer.transparency})),n}_updateTilingScheme(){var i,r,n;const t=this.tilingSchemeLogic.tilingScheme;if(t===this.tilingScheme)return;ry(!!t,"tiling scheme cannot be reset to undefined"),this._isGlobal=!((r=(i=this.view)==null?void 0:i.state)!=null&&r.isLocal),this.tilingScheme&&this._removeAllTiles();const e=(t==null?void 0:t.spatialReference)??at.WebMercator;this._spatialReference=e,this._isWebMercator=!!(e!=null&&e.isWebMercator),this._isWebMercatorOnPlateeCarree=this._isWebMercator&&uL((n=this.view)==null?void 0:n.renderSpatialReference),this._set("tilingScheme",t),this._updateClippingExtent(),t&&(this._updateTiledLayers(),this._renderer.setTileSize(t.pixelSize),this.overlayManager.setSpatialReference(t.spatialReference),this._updateRootTiles())}_acquireTile(t,e,i,r){const n=this._tileCache.pop(gk._tileMemcacheKey);return n?(n.init(t,e,i,r,this),n):new this._tileConstructor(t,e,i,r,this)}get updatingRootTiles(){return this._updatingRootTiles}_updateRootTiles(){const{extent:t,tilingScheme:e}=this;if(!e)return;const i=_9t;let r=e.rootTilesInExtent(t,i,5*PM);if(this._rootTiles!=null){if(r.length>PM)return void Ce.getLogger(this).warn(Z0t);const n=this._rootTiles.map(o=>o.lij),s=Eje(n,r,Ybe);if(this._updatingRootTiles=!0,s.removed.length>0||s.added.length>0){const o=this._rootTiles.filter(l=>!(s.removed.findIndex(c=>Ybe(c,l.lij))>-1)||(this._purgeTile(l),!1));s.added.forEach(l=>o.push(this._newRootTile(l))),this._setRootTiles(o)}}else this._updatingRootTiles=!0,r.length>PM&&(Ce.getLogger(this).warn(J0t),r=e.rootTilesInExtent(t,i,PM)),this._setRootTiles(r.map(n=>this._newRootTile(n)));uT(i,this._rootTilesExtent)||(this._rootTilesExtent=Ni(i)),this.renderer.visible=!0,this._viewChangeUpdate(),this.overlayManager.setPlacementDirty(),this.notifyChange("ready"),this._updateAllTileGeometries(),this._updatingRootTiles=!1,this.checkAllTilesWaterproofness()}_updateAllTileGeometries(){const t=this._allTiles.filter(e=>e.isLoaded&&e.intersectsClippingArea);t.forEach(e=>this._renderer.updateTileGeometryState(e)),t.forEach(e=>e.renderData.updateNeighborData()),this._updateTilesGeometries(t),this._pendingTilesToUpdate.clear()}_updateTilesGeometries(t){if(t.length===0)return;t.sort(n_);const e=this.renderer;t.forEach(i=>e.updateGeometryIfNeeded(i)),t.forEach(i=>this._pendingTilesForElevationUpdateEvent.add(i))}_shouldSplit(t){return t.shouldSplit(this._splitLimits,this._eyePosRenderSR,this.snapLevel)===hi.SPLIT}_newRootTile(t){const e=this._acquireTile(0,t[1],t[2],null);return this._shouldSplit(e)&&e.setPendingUpdate(hi.SPLIT),this._loadTile(e),this._markTileToUpdate(e),this._updateRootTileElevationBounds(),e}_setRootTiles(t){if(this._rootTiles=t,this._allTiles.clear(),t!=null){const e=this._iteratorPool.acquire();for(e.reset(t);!e.done;)this._allTiles.push(e.next());e.remove()}this._renderer.setRootTiles(this._rootTiles),this._updateTilesVisibility(t)}_runViewChangeUpdateIfDirty(){this._viewChangeUpdateDirty&&(this._viewChangeUpdateDirty=!1,this._viewChangeUpdate())}_viewChangeUpdate(){this.view&&!this.suspended&&this.tilingScheme&&this.renderer.visible&&(this._inFrameTask?this._viewChangeUpdateDirty=!0:(this._viewChangeUpdateDirty=!1,this._updateViewDependentParameters(),this._updateTilesVisibility(this._rootTiles)))}_updateClippingStatus(t){t.updateClippingStatus(this.extent)&&t.resetPendingUpdate(hi.GEOMETRY)&&this._updateTileGeometryState(t)}_updateTilesVisibility(t){if(t==null)return;const e=qIt(t),i=this.visibleElevationBounds;let r=e?i.min:1/0,n=e?i.max:-1/0;const s=this.extent,o=this._viewProjectionMatrix;this.setTileTreeDirty();const l=this._iteratorPool.acquire();for(l.reset(t);!l.done;){const c=l.next();c.updateClippingStatus(s)&&c.resetPendingUpdate(hi.GEOMETRY)&&this._updateTileGeometryState(c),c.setPendingUpdate(hi.RENDERDATA),c.computeVisibility(),c.updateScreenDepth(o),c.renderData&&(r=Math.min(c.elevationBounds[0],r),n=Math.max(c.elevationBounds[1],n))}l.remove(),this._viewChanged=!0,this._allTilesDirty=!0,this._updatePendingTileGeometries(),isFinite(r)&&isFinite(n)&&(i.min!==r||i.max!==n)&&(this.visibleElevationBounds=new BM(r,n))}_updateRootTileElevationBounds(){let t=1/0,e=-1/0;const i=this._rootTiles;i!=null&&i.forEach(({elevationBounds:n})=>{t=Math.min(t,n[0]),e=Math.max(e,n[1])});const r=this.rootTileElevationBounds;r.min===t&&r.max===e||(this.rootTileElevationBounds=new BM(t,e))}_updateViewDependentParameters(){const{camera:t,contentCamera:e}=this.view.state,i=Math.tan(.5*e.fovX),r=Math.tan(.5*e.fovY),n=this.tilingScheme.pixelSize,s=2**-this._lodBias*t.pixelRatio;this._splitLimits.aboveGround=t.aboveGround,this._splitLimits.fovX=i,this._splitLimits.fovY=r,this._splitLimits.relativeWidthLimit=n/t.width*this.maxTextureScale*s,this._splitLimits.relativeHeightLimit=n/t.height*this.maxTextureScale*s,this._splitLimits.maxLod=this.tilingScheme.getMaxLod(),this._splitLimits.angledSplitBias=this.view.qualitySettings.tiledSurface.angledSplitBias,this.view.state.fixedContentCamera?this._splitLimits.frustum=bU(this._splitLimits.frustum??OL(),e.frustum):this._splitLimits.frustum=null,bU(this._frustum,t.frustum),nn(this._viewProjectionMatrix,e.projectionMatrix,e.viewMatrix),Ne(this._eyePosRenderSR,e.eye),el(t.eye,this.view.renderSpatialReference,this._eyePosSurfaceSR,this.spatialReference)}_updateRenderData(t){t.rendered&&!t.shouldLoad&&(ske(t)?this._loadChildren(t):v9t(t)&&this._loadParent(t))}_updateTileGeometryState(t){t.updateVisibility(),this._renderer.updateTileGeometryState(t)&&this._markTileToUpdate(t),this._usedMemory=null}_markAllTileNeighborsForGeometryUpdate(t){t.forEachLoadedNeighbor(e=>this._pendingTilesToUpdate.add(e))}_updateTileTexture(t,e){const i=t.resetPendingUpdate(hi.TEXTURE_FADING)?hi.TEXTURE_FADING:!!t.resetPendingUpdate(hi.TEXTURE_NOFADING)&&hi.TEXTURE_NOFADING;i&&(this._renderer.updateTileTexture(t,i),this._usedMemory=null,e.madeProgress())}_emitElevationUpdateEventForTiles(){if(!this._shouldEmitChangeEvent)return;const t=PY.extent;od(t),this._pendingTilesForElevationUpdateEvent.forEach(e=>g2(t,e.extent,t)),this._pendingTilesForElevationUpdateEvent.clear(),PY.spatialReference=this.spatialReference,this.emit("elevation-change",PY),this._shouldEmitChangeEvent=!1}runTask(t){this._handleLayerViewChanges(t),this._frameTask.processQueue(t),this.renderer.processScaleRangeQueries(this._scaleRangeQueries,t),this._inFrameTask=!0,this._pendingUpdates=0,this._hasPendingUpdates=!1,this._updateAllTilesStatus(t),this._sortTiles(t);const e=!this.view.state.fixedContentCamera;this._mergeAndSplit(t,e),this._updateElevation(t),this._updateTextures(t),e||this._mergeAndSplit(t,!0),this._inFrameTask=!1,this._runViewChangeUpdateIfDirty(),this._updatePendingTileGeometries(),this._emitElevationUpdateEventForTiles(),t.done&&t.hasProgressed&&this.requestUpdate(),this.notifyChange("updatingProgressValue")}_updateAllTilesStatus(t){if(!this._viewChanged||!this._rootTiles||t.done)return;this._viewChanged=!1;const e=this._iteratorPool.acquire();e.reset(this._rootTiles);const i=this.snapLevel,r=this._splitLimits,n=this._eyePosRenderSR;for(;!e.done;){const s=e.next(),o=s.shouldSplit(r,n,i);if(o!==hi.SPLIT){if(s.resetPendingUpdate(hi.SPLIT)&&s.updateAgentSuspension(),o===hi.ELEVATION&&s.updateAgents(Yi.ELEVATION),e.skipSubtree(),!s.isLeaf){s.setPendingUpdate(hi.MERGE),s.resetPendingUpdate(hi.SPLIT);const l=this._iteratorPool.acquire();l.resetOne(s);const c=this._viewProjectionMatrix;for(let f=l.next();!l.done;f=l.next())this._updateClippingStatus(f),f.updateVisibility(),f.updateScreenDepth(c);l.remove()}}else s.resetPendingUpdate(hi.MERGE),s.isLeaf&&(s.setPendingUpdate(hi.SPLIT),e.skipSubtree()),s.rendered&&s.setPendingUpdate(hi.RENDERDATA)}e.remove(),this.requestUpdate(),(this._shortBatches||!this._oneBatchPerFrameTask)&&this._updatePendingTileGeometries(),t.madeProgress()}_sortTiles(t){t.done||this._allTilesSorted||(GIt(this._allTiles,this.view.pointsOfInterest.focus.renderLocation),this._allTilesSorted=!0,this._treeDebugger&&this._treeDebugger.update(),t.madeProgress())}_markTileToUpdate(t){ot(t.isLoaded),t.intersectsClippingArea&&(this._pendingTilesToUpdate.add(t),this._markAllTileNeighborsForGeometryUpdate(t))}_updatePendingTileGeometries(){const t=this._pendingTilesToUpdate,e=Array.from(t.keys()).filter(n=>n.isLoaded&&n.intersectsClippingArea);if(e.length===0)return void t.clear();const i=(n,s)=>{!(s!=null&&s.isLoaded)||!s.intersectsClippingArea||s.level{var T;const x=cV[_];i(s,(T=c[_])==null?void 0:T.findCorner(lV(x),A=>A.isLoaded))};for(let _=0;_<4;++_)if(l&1<<_){const x=o.geometryState.neighborData.edgePeerNeighbors[_];x&&(x==null?void 0:x.level)>=s.level&&x.forAllSubtreeOnSide(Sce(qv[_]),T=>!(!T.isLoaded||!T.intersectsClippingArea)&&(ot(t.has(T)||n_(s,T)<0),i(s,T),!0)),f((_+1)%4),f(_)}}t.clear(),this._updateTilesGeometries(e),this._shouldEmitChangeEvent=!0,pa&&oV&&this.checkAllTilesWaterproofness()}_mergeAndSplit(t,e){if(this.suspended||t.done||!this._allTilesDirty)return;this._allTilesDirty=!1,this.requestUpdate();let i=!1;const r=this.view.state.fixedContentCamera;let n=!1;for(;!t.done;){n=!0;let s=!1;const o=!this._allTiles.some(l=>{var f;if(!i&&!r&&!l.visible)return t.done;let c=l;if(l.resetPendingUpdate(hi.MERGE)){if(!e)return l.setPendingUpdate(hi.MERGE),t.done;for(;(f=c.parent)!=null&&f.resetPendingUpdate(hi.MERGE);)c=c.parent;this._mergeTile(c),s=!0,t.madeProgress()}else l.resetPendingUpdate(hi.SPLIT)&&(this._splitTile(l),s=!0,t.madeProgress());return!t.done&&c===l&&l.resetPendingUpdate(hi.RENDERDATA)&&(this._updateRenderData(l),t.madeProgress()),t.done});if(s&&(this._allTilesSorted=!1,this._allTilesDirty=!0),o){if(!i){i=!0;continue}if(!s)break}else this._allTilesDirty=!0}n?t.madeProgress():this._allTilesDirty=!0,!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries(),this._sortTiles(t)}_updateElevation(t){t.done||(this._allTiles.some(e=>(e.resetPendingUpdate(hi.GEOMETRY)&&(this._updateTileGeometryState(e),this._updateTileTexture(e,t),this._shortBatches&&this._updatePendingTileGeometries(),t.madeProgress()),t.done)),!this._oneBatchPerFrameTask&&this._updatePendingTileGeometries())}_updateTextures(t){t.done||this._allTiles.some(e=>(this._updateTileTexture(e,t),t.done))}_updateClippingExtent(){this.spatialReference&&(this.updateTileOverlayParams(no.UPDATE),this.overlayManager.setPlacementDirty(),this._updateRootTiles())}get _lodBias(){const t=this.view.quality;return this.view.qualitySettings.tiledSurface.lodBias-(1-t)*Y0t}_getLodBiasCorrectedScale(t){const e=this.tilingScheme.levels,i=Je(t-this._lodBias,0,e.length-1),r=i-Math.floor(i);return e[Math.floor(i)].scale*(1-r)+e[Math.ceil(i)].scale*r}_removeAllTiles(){this._rootTiles!=null&&(this._rootTiles.forEach(t=>this._purgeTile(t)),this._setRootTiles(null),this.notifyChange("ready")),this._allTiles.clear(),this.renderer.visible=!1}_purgeDescendantTiles(t){if(!t.children[0])return!1;let e=!1;for(let i=0;i<4;++i)e=this._purgeTile(t.children[i])||e;return t.unsetChildren(),e}_purgeTile(t){const e=this._purgeDescendantTiles(t)||t.rendered;return this._allTiles.removeUnordered(t),this._unloadTile(t),this._tileCache.put(gk._tileMemcacheKey,t),e}_unloadTile(t){this._pendingTilesToUpdate.delete(t),this._pendingTilesForElevationUpdateEvent.delete(t),t.unload(this._renderer)}_splitTile(t){ry(t.isLeaf,"tile that is already split should not be split again!");const e=t.level+1,i=2*t.lij[1],r=2*t.lij[2];t.setChildren(this._createTile(e,i,r,t),this._createTile(e,i,r+1,t),this._createTile(e,i+1,r,t),this._createTile(e,i+1,r+1,t)),t.setPendingUpdate(hi.RENDERDATA),t.updateAgentSuspension(),this._allTiles.pushArray(t.children),this._allTilesDirty=!0,++this._performanceInfo.numSplit}_emitTileScaleChange(t,e=t.level){_8.spatialReference=this.spatialReference,_8.extent=t.extent,_8.scale=this._getLodBiasCorrectedScale(e),this.emit("scale-change",_8)}_createTile(t,e,i,r){ry(!!r,"_createTile sanity check");const n=this._acquireTile(t,e,i,r);return n.updateClippingStatus(this.extent),n.updateScreenDepth(this._viewProjectionMatrix),this._shouldSplit(n)&&n.setPendingUpdate(hi.SPLIT),n}get _shortBatches(){return this.view.state.mode!==Vr.IDLE}_mergeTile(t){ry(!t.hasPendingUpdate(hi.SPLIT),"_mergeTile sanity check"),this._purgeDescendantTiles(t)&&(ry(!t.renderData,"_mergeTile sanity check"),this._loadTile(t),this._markTileToUpdate(t),this._emitTileScaleChange(t),this._shortBatches&&this._updatePendingTileGeometries()),this._allTilesDirty=!0,++this._performanceInfo.numMerged}_loadChildren(t){ry(t.rendered,"parent should be rendered"),this._unloadTile(t);const e=t.children;e.forEach(i=>this._loadTile(i)),e.forEach(i=>this._pendingTilesToUpdate.add(i)),this._markAllTileNeighborsForGeometryUpdate(t),this._emitTileScaleChange(t,t.level+1),this._shortBatches&&this._updatePendingTileGeometries()}_loadParent(t){const e=t.parent;this._unloadChildren(e),this._loadTile(e),this._markTileToUpdate(e),this._emitTileScaleChange(e,e.level),this._shortBatches&&this._updatePendingTileGeometries()}_unloadChildren(t){const e=t.children;if(e[0])for(let i=0;i<4;++i){const r=e[i];this._unloadChildren(r),this._unloadTile(r)}}_loadTile(t){t.load(),t.setPendingUpdate(hi.RENDERDATA),this.requestUpdate(),this._allTilesDirty=!0,this.overlayManager&&this.overlayManager.hasOverlays&&this.overlayManager.setTileParameters(t)}_elevationDataArrived(t,e,i){const r=new CIt(t.lij,t.extent,i);t.dataArrived(e,Yi.ELEVATION,r);const n=[t],s=t.level,o=this._iteratorPool.acquire();for(o.reset(n);!o.done;){const l=o.next();l.findElevationBoundsForLayer(e,s),l.computeElevationBounds()}s===0&&this._updateRootTileElevationBounds(),o.remove(),this._updateTilesVisibility(n)}_handleLayerViewChanges(t=ou){if(!this._layerViewsDirty)return;this._layerViewsDirty=!1;let e=!1;const i=new Set;let r=-1;for(const n of this.view.allLayerViews.items)if(i.add(n.uid),JL(n)||PR(n))if(this._basemapLayerViewHandles.has(n.uid)&&!PR(n)){const s=this._layerClassFromLayerView(n),o=this._getLayerIdxByUID(s,n.uid);o!=null&&((o{i.has(s)||(this._unregisterTiledLayerView(s),e=!0)}),e&&this._updateTiledLayers(),this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._evaluateTransparency(),t.madeProgress()}_allSurfaceLayersTransparent(){var e,i;let t=((i=(e=this.view.map)==null?void 0:e.ground)==null?void 0:i.opacity)===0;for(const r of this.view.allLayerViews.items)if($ie(r)&&!Y7(r.layer)&&r.fullOpacity!==0)return t=!1,t;return t}_hasCompositeBlendMode(){for(const t of this.view.allLayerViews.items)if((ZL(t)||PR(t))&&KIt(Nie[t.layer.blendMode]))return!0;return!1}_layerClassFromLayerView(t){return Iie(t)?Yi.ELEVATION:Yi.MAP}_registerTiledLayerView(t){const e=[];if((ZL(t)||PR(t))&&e.push(_e(()=>t.layer.blendMode,()=>{this.hasCompositeBlendMode=this._hasCompositeBlendMode(),this._updateTileTextures(ua.UNFADED)})),!PR(t)){const i=this._layerClassFromLayerView(t);e.push(_e(()=>t.suspended,()=>this._updateTiledLayers())),e.push(_e(()=>t.fullOpacity,()=>this._updateTileTextures(ua.UNFADED))),e.push(_e(()=>"effectiveScaleRange"in t.layer?t.layer.effectiveScaleRange:null,()=>this._restartAllAgents(i))),e.push(t.on("data-changed",()=>{const r=this._getLayerIdxByUID(i,t.uid);r!=null&&this._invalidateLayerData(r,i)}))}this._unregisterTiledLayerView(t.uid),this._basemapLayerViewHandles.set(t.uid,e)}_unregisterTiledLayerView(t){const e=this._basemapLayerViewHandles.get(t);if(e){for(const i of e)i.remove();this._basemapLayerViewHandles.delete(t)}}_updateTiledLayers(){if(!this.tilingScheme||this.view.suspended)return;const t=this.view.allLayerViews,e=[[],[]];let i=null;t.forEach(r=>{if(!r.layer||r.suspended||!JL(r)||!r.fullExtent)return;const n=this._layerClassFromLayerView(r);if(n===Yi.MAP){const s=r.displayLevelRange.maxLevel;s!==1/0&&(i===null||s>i)&&(i=s)}e[n].push(r)});for(const r of rS){const n=this._layerViews[r],s=e[r];s.reverse();const o=s.length;let l=n.length!==o;const c=new Array(o),f=new Array(n.length);this._layerIndexByUid[r].clear();for(let _=0;_-1&&(f[T]=_)}if(l){const _=this._postorderIterator;for(_.reset(this._rootTiles);!_.done;)_.next().modifyLayers(f,c,r);this._layerViews[r]=s,this._restartAllAgents(r),this._updateTilesVisibility(this._rootTiles)}}this.tilingScheme.ensureMaxLod(i)&&this._viewChangeUpdate()}_restartAllAgents(t){const e=this._postorderIterator;for(e.reset(this._rootTiles);!e.done;){const i=e.next();i.restartAgents(t),t===Yi.ELEVATION&&i.computeElevationBounds()}this._updateRootTileElevationBounds()}layerViewByIndex(t,e){return this._layerViews[e][t]}numLayers(t){return this._layerViews[t].length}_updateTileTextures(t){this._allTiles.forAll(e=>{e.updateAgents(Yi.MAP),t===ua.IMMEDIATE?this.renderer.updateTileTexture(e,hi.TEXTURE_NOFADING):e.updateRenderData(Yi.MAP,t)}),this._evaluateTransparency()}_invalidateLayerData(t,e){this._allTiles.forAll(i=>i.removeLayerAgent(t,e)),this._allTiles.forAll(i=>i.invalidateLayerData(t,e))}setTileTreeDirty(){this._allTilesDirty=!0}requestRender(t=no.UPDATE){this.renderer.setNeedsRender(t)}requestUpdate(){++this._pendingUpdates==1&&(this._hasPendingUpdates=!0)}requestTileData(t,e,i,r){const n=this.layerViewByIndex(e,i),s=n.layer;return!s.tilemapCache||L5(n)?this._requestTileData(t,i,n,r):(++this._asyncWorkItems,s.tilemapCache.fetchAvailability(t.lij[0],t.lij[1],t.lij[2],{...r,timeout:6e3}).then(()=>--this._asyncWorkItems).catch(o=>{throw--this._asyncWorkItems,St(r),sn(o)||this._dataMissing(t,i,n,{notInTilemap:!0}),o}).then(()=>this._frameTask.schedule(()=>this._requestTileData(t,i,n,r),r.signal)))}_requestTileData(t,e,i,r){return e===Yi.ELEVATION?Iie(i)?this._requestElevationTileData(t,i,r):Promise.reject():$ie(i)?this._requestMapTileData(t,i,r):Promise.reject()}_requestElevationTileData(t,e,i){++this._asyncWorkItems;const r=o=>{if(xo(i))return;const l=this._layerIndexByUid[Yi.ELEVATION].get(e.uid);l!=null?(this._usedMemory=null,this.requestUpdate(),this._elevationDataArrived(t,l,o)):Ce.getLogger(this).warn("TerrainSurface: received data from unknown layer %d %s",Yi.ELEVATION,t.lij.toString())},n=o=>{sn(o)||(this._dataMissing(t,Yi.ELEVATION,e,o),this.requestUpdate())};if(a_e(e.layer))return e.layer.fetchTile(t.lij[0],t.lij[1],t.lij[2],{noDataValue:EL,signal:i.signal}).then(o=>{if(!xo(i))return this._frameTask.schedule(()=>r(o),i.signal,n);Ce.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true.")},n).finally(()=>{--this._asyncWorkItems});const s=e.getTileUrl(t.lij[0],t.lij[1],t.lij[2]);return this._elevationDataRequester.request(s,"binary",i).then(o=>this._lercDecoder.decode(o,{noDataValue:EL},i.signal)).then(o=>{o?r(new eFe(o)):n(new Error("LERC decoding failed"))},n).finally(()=>{--this._asyncWorkItems})}_requestMapTileData(t,e,i){++this._asyncWorkItems;const r=(f,_)=>{--this._asyncWorkItems,CO(_),xo(i)||(this._dataMissing(t,Yi.MAP,e,f),this.requestUpdate())},n=f=>_=>r(_,f),s=f=>this._frameTask.schedule(()=>{--this._asyncWorkItems,this.requestUpdate(),xo(i)?CO(f):this._mapTileDataArrived(t,e,f)},i.signal,n(f)).catch(n(f)),o=(f,_=null)=>this._frameTask.schedule(()=>r(f,_));if(L5(e)){const f=e.schemaHelper.getLevelRowColumn(t.lij);return e.fetchTile(f[0],f[1],f[2],i).then(s,o)}if(xG(e))return e.fetchTile(t.lij[0],t.lij[1],t.lij[2],i).then(s,o);if(xce(e)&&a_e(e.layer))return e.layer.fetchTile(t.lij[0],t.lij[1],t.lij[2],i).then(f=>{if(xo(i))return Ce.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."),void o(ur());s(f)},o);let l=e.getTileUrl(t.lij[0],t.lij[1],t.lij[2]);kht(e.layer)&&e.layer.refreshTimestamp&&(l+=`${l.includes("?")?"&":"?"}_ts=${e.layer.refreshTimestamp}`);const c=e.hasMixedImageFormats?"image+type":"image";return this._mapDataRequester.request(l,c,i).then(s,o)}_mapTileDataArrived(t,e,i){const r=this._getLayerIdxByUID(Yi.MAP,e.uid);r!=null?t.dataArrived(r,Yi.MAP,i):(CO(i),Ce.getLogger(this).warn("TerrainSurface: received data from unknown layer"))}_getLayerIdxByUID(t,e){return this._layerIndexByUid[t].get(e)}_dataMissing(t,e,i,r){const n=this._getLayerIdxByUID(e,i.uid);n!=null?t.dataMissing(n,e,r):Ce.getLogger(this).warn("TerrainSurface: received data from unknown layer")}updateTileOverlayParams(t){this._rootTiles&&this.overlayManager&&(this._allTiles.forAll(e=>{e.renderData&&this.overlayManager.setTileParameters(e)}),this._renderer.setNeedsRender(t))}get performanceInfo(){const t=this._performanceInfo;return t.numNodes=this._allTiles.length,t.numLeaves=t.numVisible=t.numRendered=t.numLoadedPerLevel.length=t.numRenderedPerLevel.length=0,this._allTiles.forAll(e=>{e.isLeaf&&t.numLeaves++;const i=e.level;e.renderData&&(t.numLoadedPerLevel[i]=(t.numLoadedPerLevel[i]||0)+1),e.visible&&(t.numVisible++,e.rendered&&(t.numRenderedPerLevel[i]=(t.numRenderedPerLevel[i]||0)+1,t.numRendered++))}),t}get usedMemory(){return this.tilingScheme?(this._usedMemory==null&&(this._usedMemory=this._recalculateUsedMemory()),this._usedMemory??0):0}_recalculateUsedMemory(){return this.tilingScheme?Math.round(this._allTiles.reduce((t,e)=>t+e.usedMemory,0)):null}getUsedMemoryForLayerView(t){let e=0;const i=this._layerClassFromLayerView(t),r=this._getLayerIdxByUID(i,t.uid);return r!=null&&this._allTiles.forAll(n=>e+=n.getUsedMemoryForLayer(i,r)),e}getTile(t){if(t==null||this._rootTiles==null)return null;const e=t.split("/").map(o=>+o);if(e[0]===0)return this._rootTiles.find(o=>o.lij[1]===e[1]&&o.lij[2]===e[2]);const i=2**e[0],r=Math.floor(e[1]/i),n=Math.floor(e[2]/i);let s;if(this._rootTiles.some(o=>o.lij[1]===r&&o.lij[2]===n&&(s=o,!0)),s){let o=1<0&&l++,!s.children[l])return null;s=s.children[l],o>>=1}return ry(s.lij[0]===e[0]&&s.lij[1]===e[1]&&s.lij[2]===e[2],"not the right tile?"),s}return null}get renderPatchBorders(){return this._renderer.renderPatchBorders}set renderPatchBorders(t){this._renderer.renderPatchBorders=t}get visualizeNormals(){return this._renderer.visualizeNormals}set visualizeNormals(t){this._renderer.visualizeNormals=t}get renderingDisabled(){return this._renderer.renderingDisabled}set renderingDisabled(t){this._renderer.renderingDisabled=t}get test(){const t=this;return{renderer:t._renderer,lercDecoder:t._lercDecoder,forceReload:()=>{t._rootTiles!=null&&t._rootTiles.length>0&&(t._mergeTile(t._rootTiles[0]),t._viewChangeUpdate())},getTiles:()=>t._allTiles.toArray(),getRenderedTiles(){OY.clear(),t._allTiles.forAll(i=>{i.visible&&i.rendered&&OY.push(i)});const e=OY.toArray();return dFe(t.renderOrder,e),e},lockTilingScheme(e,i){t._extentHelper.defaultTiledLayersExtent=i,t.tilingSchemeLogic.test.lockTilingScheme(e)}}}checkAllTilesWaterproofness(){if(!oV)return;const t=this._rootTiles;if(t==null)return;const e=s=>{var o,l,c;return((c=(l=(o=s==null?void 0:s.renderData)==null?void 0:o.geometry)==null?void 0:l.indices)==null?void 0:c.length)>0},i=(s,o)=>{e(s)&&console.error("Tile[",s.lij,"] has geometry although parent[",o.lij,"] has geom")},r=s=>{var o,l;if(s.intersectsClippingArea)if(s.renderData&&!s.renderData.geometryState&&console.error("Tile[",s.lij,"] has renderData but not geometryState"),s.renderData&&!s.renderData.geometry&&console.error("Tile[",s.lij,"] has renderData but not geometryInfo"),!((o=s.renderData)!=null&&o.geometry)||(((l=s.renderData.geometry.indices)==null?void 0:l.length)??0)>0||console.error("Tile[",s.lij,"] has renderData but no indices - geometryInfo: ",s.renderData.geometry),e(s)){s.checkGeometryWaterproofness();for(const c of s.children)i(c,s)}else if(s.isLeaf)console.error("Tile[",s.lij,"] has no geometry and no children, from root to leaf");else for(const c of s.children)r(c)},n=s=>{var f;const o=((f=s.parent)==null?void 0:f.visible)??!0,l=s.visible;s.computeVisibility();const c=s.visible;if(l!==c&&o&&console.error(" Tile[",s.lij,"] has out of date visibility: ",l," instead of ",c),!s.isLeaf)for(const _ of s.children)n(_)};for(const s of t)r(s),n(s)}get isGlobal(){return this._isGlobal}get isWebMercator(){return this._isWebMercator}get isWebMercatorOnPlateeCarree(){return this._isWebMercatorOnPlateeCarree}isEastEndWrap(t){return this.isGlobal&&t[2]===this.lijEastEnd(t[0])-1}isWestEndWrap(t){return this.isGlobal&&t[2]===0}lijEastEnd(t){return 2**(t+(this.spatialReference!=null&&this.spatialReference.isGeographic?1:0))}wrapEastWest(t){const e=this.lijEastEnd(t[0]),i=t[2];if(0<=i&&is.extentMidX?1:0)+(i{const o=this._ensureGeomRecord(e,s);n.forEach(({geometry:l,operation:c,states:f},_)=>{let x=!1;if(c===ds.UPDATE){const T=o.get(_);if(T){if(f&ca.TRANSFORMATION){const A=this.model.getObject(s);this.model.updateRenderGeometryTransformation(A,l,T)&&(x=!0)}x||i.updates.push({renderGeometry:T,updateType:f})}else Xt(!1,"ModelDirtySet.commitLayer: invalid update")}if(c===ds.REMOVE||x){const T=o.get(_);T?(i.removes.push(T),o.delete(_)):c===ds.REMOVE&&Xt(!1,"ModelDirtySet.commitLayer: invalid remove")}if(c===ds.ADD||x){const T=this.model.getObject(s);if(T!=null){const A=this.model.getRenderGeometry(T,l);i.adds.push(A),o.set(_,A)}}}),o.size===0&&this._residentGeomRecords.get(e).delete(s)}),this._residentGeomRecords.get(e).size===0&&this._residentGeomRecords.delete(e),this._dirtyGeomRecords.delete(e),this.dirty=this._hasDirtyGeometryRecords)}commitSyncUpdates(e,i){const r=this._dirtyGeomRecords.get(e);r&&r.forEach((n,s)=>{const o=this._ensureGeomRecord(e,s);n.forEach(({geometry:l,operation:c,states:f,sync:_},x)=>{let T=!1;if(c===ds.UPDATE&&_){const A=o.get(x);if(A){if(f&ca.TRANSFORMATION){const M=this.model.getObject(s);this.model.updateRenderGeometryTransformation(M,l,A)&&(T=!0)}T||i.updates.push({renderGeometry:A,updateType:f})}else Xt(!1,"ModelDirtySet.commitSyncUpdates: invalid update")}})})}getResidentRenderGeometries(e,i){const r=this._residentGeomRecords.get(e);r&&r.forEach(n=>n.forEach(s=>i.push(s)))}_objectStateChanged(e,i){for(const r of i.geometries)this._updateOrCreateDirtyRecord(i,r,null,ds.UPDATE,e)}visibilityChanged(e){this._objectStateChanged(ca.VISIBILITY,e)}highlightChanged(e){this._objectStateChanged(ca.HIGHLIGHT,e)}occlusionChanged(e){this._objectStateChanged(ca.OCCLUDEE,e)}attributesChanged({object:e,geometry:i,sync:r}){this._updateOrCreateDirtyRecord(e,i,null,ds.UPDATE,ca.GEOMETRY,r)}layerAdded(e){e.objects.forAll(i=>this._layerObjectAdded(e,i))}layerRemoved(e){e.objects.forAll(i=>this._layerObjectRemoved(e,i))}layerObjectAdded(e){this._layerObjectAdded(e.layer,e.object)}_layerObjectAdded(e,i){const r=e.id;for(const n of i.geometries)this._geometryAdded(i,n,r)}layerObjectRemoved(e){this._layerObjectRemoved(e.layer,e.object)}layerObjectsAdded(e){for(const i of e.objects)this._layerObjectAdded(e.layer,i)}layerObjectsRemoved(e){for(const i of e.objects)this._layerObjectRemoved(e.layer,i)}_layerObjectRemoved(e,i){const r=e.id;for(const n of i.geometries)this._geometryRemoved(i,n,r)}transformationChanged(e){const i=this._getParentLayerId(e),r=e.id;this._ensureGeomRecord(i,r).forEach(n=>{this._updateOrCreateDirtyRecord(e,n.geometry,i,ds.UPDATE,ca.TRANSFORMATION)})}shaderTransformationChanged(e){const i=this._getParentLayerId(e),r=e.id;this._ensureGeomRecord(i,r).forEach(n=>{n.objectShaderTransformationChanged(e.shaderTransformation)})}geometryAdded(e){this._geometryAdded(e.object,e.geometry)}_geometryAdded(e,i,r=null){this._updateOrCreateDirtyRecord(e,i,r,ds.ADD)}geometryRemoved(e){this._geometryRemoved(e.object,e.geometry)}_geometryRemoved(e,i,r=null){this._updateOrCreateDirtyRecord(e,i,r,ds.REMOVE)}_updateOrCreateDirtyRecord(e,i,r,n,s=ca.NONE,o=!1){r=r??this._getParentLayerId(e);const l=e.id,c=i.id,f=this._ensureDirtyRecord(r,l),_=f.get(c);if(_){const x=_.operation;x===ds.REMOVE&&n===ds.ADD&&_.states!==ca.NONE?_.operation=ds.UPDATE:x===ds.REMOVE&&n===ds.ADD||x===ds.ADD&&n===ds.REMOVE?f.delete(c):x!==ds.UPDATE||n!==ds.REMOVE&&n!==ds.UPDATE?(Xt((x===ds.REMOVE||x===ds.ADD)&&n===ds.UPDATE,"ModelDirtySet.objectGeometryAdded: inconsistent state"),_.states|=s):(_.operation=n,_.states|=s),_.sync=_.sync||o}else f.set(c,new b9t(n,i,s,o));this.dirty=this._hasDirtyGeometryRecords}_ensureGeomRecord(e,i){let r=this._residentGeomRecords.get(e);r||(r=new Map,this._residentGeomRecords.set(e,r));let n=r.get(i);return n||(n=new Map,r.set(i,n)),n}get _hasDirtyGeometryRecords(){return rp(this._dirtyGeomRecords,e=>rp(e,i=>i&&i.size>0))}_ensureDirtyRecord(e,i){let r=this._dirtyGeomRecords.get(e);r||(r=new Map,this._dirtyGeomRecords.set(e,r));let n=r.get(i);return n||(n=new Map,r.set(i,n)),n}_getParentLayerId(e){return e.parentLayer?e.parentLayer.id:LGe}formatDebugInfo(){const e=["ADD","UPD",void 0,"REM"];let i="";return this._dirtyGeomRecords.forEach((r,n)=>{r.forEach((s,o)=>{i.length>0&&(i+=` +`),i+=n+"."+o;const l=[];s.forEach(c=>{const f=c.operation;l[f]||(l[f]=[]),l[f].push(c.geometry.id)});for(let c=0;ci+r.size,0)},commit:i=>e._dirtyGeomRecords.forEach((r,n)=>e.commitLayer(n,i))}}};y([w({constructOnly:!0})],xI.prototype,"model",void 0),y([w()],xI.prototype,"dirty",void 0),xI=y([Z("esri.views.3d.webgl-engine.lib.ModelDirtySet")],xI);const w9t=xI;let yk=class extends ze{constructor(){super(...arguments),this.dirtySet=new w9t({model:this}),this._content=new Map,this._originFactory=new Yle(null)}getObject(e){return this._content.get(e)}add(e){const i=e.id;Xt(!this._content.has(i),"Model/Stage already contains object to be added"),this._content.set(i,e),WU(e)&&this.dirtySet.layerAdded(e)}remove(e){return!!this._content.has(e.id)&&(this._content.delete(e.id),WU(e)&&this.dirtySet.layerRemoved(e),!0)}addMany(e){for(const i of e)i&&(Xt(!this._content.has(i.id),"Model/Stage already contains object to be added"),this._content.set(i.id,i))}removeMany(e){for(const i of e)i&&(Xt(this._content.has(i.id),"Model/Stage doesn't contain object to be removed"),this._content.delete(i.id))}has(e){return this._content.has(e.id)}forEachOfType(e,i){this._content.forEach(r=>{r.type===e&&i(r)})}getRenderGeometry(e,i){const r=new $5(i,{castShadow:e.castShadow,objectShaderTransformation:e.shaderTransformation});r.transformation=e.getCombinedStaticTransformation(i,Zbe);const{localOrigin:n}=i;return r.localOrigin=n??this._originFactory.getOrigin(r.boundingSphere),r}updateRenderGeometryTransformation(e,i,r){if(e==null)return!1;r.transformation=e.getCombinedStaticTransformation(i,Zbe);const n=this._originFactory.getOrigin(r.boundingSphere);return r.localOrigin!==n}getStats(){const e={},i=Array.from(this._content.values());for(let r=0;rn.type===r).length;return{contentTypes:e,dirtySet:this.dirtySet.formatDebugInfo()}}get test(){return{content:Array.from(this._content.values())}}};y([w({constructOnly:!0})],yk.prototype,"dirtySet",void 0),yk=y([Z("esri.views.3d.webgl-engine.parts.Model")],yk);const Zbe=Qe();let x9t=class{constructor(e){this._totalCount=e,this._indexRanges=[0,e]}allVisible(){return this.componentCount()===this._totalCount}allInvisible(){return this._indexRanges.length===0}componentCount(){const e=this._indexRanges;let i=0;for(let r=0;r(t[l]>0?(s!==l-1&&(r.length&&r.push(i[s+1]-r[r.length-1]),r.push(i[l])),s=l):(o!==l-1&&(n.length&&n.push(i[o+1]-n[n.length-1]),n.push(i[l])),o=l),!0)),r.length&&r.push(i[s+1]-r[r.length-1]),n.length&&n.push(i[o+1]-n[n.length-1]),{highlightRanges:r,defaultRanges:n}}let SI=class extends ze{constructor(){super(...arguments),this.visible=AO.Hidden}destroy(){this.intersectionGeometry=et(this.intersectionGeometry)}};var AO;y([w({autoDestroy:!0})],SI.prototype,"renderable",void 0),y([w({autoDestroy:!0})],SI.prototype,"components",void 0),SI=y([Z("esri.views.3d.webgl-engine.collections.Component.ComponentObject")],SI),function(t){t[t.Hidden=0]="Hidden",t[t.Visible=1]="Visible"}(AO||(AO={}));function C9t(t,e,i,r){if(i>=e)return t;t==null&&(t=A9t());const n=t.isVisibleBit;let s=t.data;const o=ake(s),l=i/o|0,c=i-o*l,f=(e-1)/o|0,_=s,x=r===n;if(!(i<_.length*o)&&x){const T=l+1,A=Math.ceil(_.length*VV),M=f+1;let I=Math.max(T,A);I=Math.min(I,M),s=new Uint32Array(I),s.set(_)}return l{if(!oke(this._components.pickability,M))return!0;const I=this.getComponentAabb(M,$9t);if(o!=null){const k=o[M];s!=null?s.componentOffset=k:(e[2]=T-k,i[2]=A-k)}if(s!=null&&s.applyToAabb(I),!mle(I,e,x,r))return!0;const L=_[M]/3,F=_[M+1]/3,z=(k,U,j)=>l(M,k,qh(U,U,n),j);return s==null&&F-L>rke?(this._componentIntersectionData[M]==null&&(this._componentIntersectionData[M]=new Nce(this._indices,L,F,c)),this._componentIntersectionData[M].intersectRay({r0:e,r1:i},z)):Q9(e,i,L,F,f,c,void 0,s,z),!0})}_computePerComponentAabbs(){const e=this._components.count,i=Rs(6*e),r=this._indices,n=this._positions,s=this._components.offsets;let o=0;for(let l=0;l{const l=o.offsetObb!=null?o.offsetObb:o.obb,c=Ve(xn($d,l.center,r),s),f=pj(l,s);if(b8(i,c-f)&&b8(i,c+f))return;const _=B9t(l,n);if(_===-1)return;if(_===0)return P1.far=c+f,P1.near=c-f,void N5(i,P1);const x=w8.pushNew();x.near=c-f,x.far=c+f,x.mask=_,x.object=o});for(let o=0;o{let _=z9t;for(let x=0;x0;x++){if(!(l.mask&1<t||{near:1/0,far:-1/0,mask:0,object:null},deallocator:t=>(t.object=null,t)}),P1=f6(),Fu=W(),e3=W(),k9t=new Pi({deallocator:null}),z9t=new Pi({deallocator:null});function U9t(t,e,i){i.length=0;const r=e.length-3;RY(Fu,e,r);const n=fn(t,Fu);n<=0&&(i.push(Fu[0]),i.push(Fu[1]),i.push(Fu[2]));let s=0,o=n;for(;st.halfSize[0]?1:0)+3*($d[1]<-t.halfSize[1]?-1:$d[1]>t.halfSize[1]?1:0)+9*($d[2]<-t.halfSize[2]?-1:$d[2]>t.halfSize[2]?1:0)+13),s=Jbe[n];if(s===0)return s;rj(x8,t.quaternion),Aoe(x8,x8,t.halfSize);const o=(l,c)=>{const f=Jbe[n+c+1];return Ie(l,((1&f)<<1)-1,(2&f)-1,((4&f)>>1)-1),qh(l,l,x8),Be(l,t.center,l)};return i.length=0,ku(i,o(IY,0)),ku(i,o(Qbe,1)),ku(i,o($d,2)),ku(i,o(ewe,3)),r(i),s===1||(i.length=0,ku(i,IY),ku(i,ewe),ku(i,o($d,4)),ku(i,o(twe,5)),r(i),s===2||(i.length=0,ku(i,IY),ku(i,twe),ku(i,o($d,6)),ku(i,Qbe),r(i))),s}const Jbe=(()=>{const t=new Array(216);let e=0;const i=r=>{for(let n=0;n0)return-1;n===0&&(i|=1<r.renderable.material.submit(e,i,r))}queryShadowCasterDepthRange(e){return this._objects.visibleObjects.length?F9t(e,this._objects.visibleObjects):null}};function G9t(t){const e=ls().vec3f(J.POSITION);return t.normals&&e.vec2i16(J.NORMALCOMPRESSED,{glNormalized:!0}),t.textureCoordinates===So.Default?e.vec2f(J.UV0):t.textureCoordinates===So.Atlas&&(e.vec2f(J.UV0),e.vec4u16(J.UVREGION,{glNormalized:!0})),t.colors&&e.vec4u8(J.COLOR,{glNormalized:!0}),e}let H9t=class{constructor(){this.externalColor=Xi(),this.externalColorMixMode=Uo.Multiply,this.castShadows=!0,this.pickable=!0,this.elevationOffset=0}},q9t=class extends Ls{constructor(e,i){super(e,"int",Or.Draw,(r,n,s)=>r.setUniform1i(e,i(n,s)))}};var $y;(function(t){t[t.Uniform=0]="Uniform",t[t.Varying=1]="Varying",t[t.COUNT=2]="COUNT"})($y||($y={}));const kce=429496.7296;function cke(t,e){BL(t/kce*.5+.5,e)}function W9t(t,e){switch(e.componentData){case $y.Varying:return Y9t(t,e);case $y.Uniform:return X9t(t);case $y.COUNT:return;default:e.componentData}}function Y9t(t,e){const{vertex:i,fragment:r}=t;i.include(o0),i.uniforms.add(new $f("componentColorTex",s=>s.componentParameters.texture.texture)),t.attributes.add(J.COMPONENTINDEX,"float"),t.varyings.add("vExternalColorMixMode","mediump float"),t.varyings.add("vExternalColor","vec4");const n=e.output===ue.ObjectAndLayerIdColor;n&&t.varyings.add("vObjectAndLayerIdColor","vec4"),t.include(J6e),i.constants.add("elevationScale","float",2*kce),i.constants.add("stride","float",Le("enable-feature:objectAndLayerId-rendering")?3:2),i.code.add(V`vec2 getComponentTextureCoordinates(float componentIndex, float typeOffset) { +float index = componentIndex * stride + typeOffset; +float texSize = float(textureSize(componentColorTex, 0).x); +float coordX = mod(index, texSize); +float coordY = floor(index / texSize); +return vec2(coordX, coordY) + 0.5; +}`),i.code.add(V` + vec4 _readComponentColor() { + vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 0.0); + + return texelFetch(componentColorTex, ivec2(textureCoordinates), 0); + } + + float readElevationOffset() { + vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 1.0); + + vec4 encodedElevation = texelFetch(componentColorTex, ivec2(textureCoordinates), 0); + return (rgba2float(encodedElevation) - 0.5) * elevationScale; + } + + ${n?V` + void forwardObjectAndLayerIdColor() { + vec2 textureCoordinates = getComponentTextureCoordinates(componentIndex, 2.0); + + vObjectAndLayerIdColor = texelFetch(componentColorTex, ivec2(textureCoordinates), 0); + }`:V`void forwardObjectAndLayerIdColor() {}`} + + vec4 forwardExternalColor(out bool castShadows) { + vec4 componentColor = _readComponentColor() * 255.0; + + float shadowFlag = mod(componentColor.b * 255.0, 2.0); + componentColor.b -= shadowFlag; + castShadows = shadowFlag >= 1.0; + + int decodedColorMixMode; + vExternalColor = decodeSymbolColor(componentColor, decodedColorMixMode) * 0.003921568627451; // = 1/255; + vExternalColorMixMode = float(decodedColorMixMode) + 0.5; // add 0.5 to avoid interpolation artifacts + + return vExternalColor; + } +`),r.code.add(V` + void readExternalColor(out vec4 externalColor, out int externalColorMixMode) { + externalColor = vExternalColor; + externalColorMixMode = int(vExternalColorMixMode); + } + + void outputObjectAndLayerIdColor() { + ${n?V`fragColor = vObjectAndLayerIdColor;`:""} + } +`)}function X9t(t){const{vertex:e,fragment:i}=t;e.uniforms.add(new qU("externalColor",r=>r.componentParameters.externalColor)),i.uniforms.add(new q9t("externalColorMixMode",r=>r.componentParameters.externalColorMixMode)),t.varyings.add("vExternalColor","vec4"),e.code.add(V`float readElevationOffset() { +return 0.0; +} +vec4 forwardExternalColor(out bool castShadows) { +vExternalColor = externalColor; +castShadows = true; +return externalColor; +}`),i.code.add(V`void readExternalColor(out vec4 color, out int colorMixMode) { +color = vExternalColor; +colorMixMode = externalColorMixMode; +}`)}var op;function Z9t(t,e){const i=t.vertex;switch(i.code.add(V`#define VERTEX_DISCARD_CUTOFF (1.0 - 1.0 / 255.0)`),e.vertexDiscardMode){case op.None:i.code.add(V`#define vertexDiscardByOpacity(_opacity_) {}`);break;case op.Opaque:i.code.add(V`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ > VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`);break;case op.Transparent:i.code.add(V`#define vertexDiscardByOpacity(_opacity_) { if (_opacity_ <= VERTEX_DISCARD_CUTOFF) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`);break;case op.COUNT:break;default:e.vertexDiscardMode}}(function(t){t[t.None=0]="None",t[t.Transparent=1]="Transparent",t[t.Opaque=2]="Opaque",t[t.COUNT=3]="COUNT"})(op||(op={}));var Ly;function Gpi(t){return t&&r1(t)?Ly.Mars:t&&n1(t)?Ly.Moon:Ly.Earth}(function(t){t[t.Earth=1]="Earth",t[t.Mars=2]="Mars",t[t.Moon=3]="Moon",t[t.COUNT=4]="COUNT"})(Ly||(Ly={}));var ip;(function(t){t[t.None=0]="None",t[t.NoOverlay=1]="NoOverlay",t[t.ColorOverlay=2]="ColorOverlay",t[t.ColorOverlayWithWater=3]="ColorOverlayWithWater",t[t.COUNT=4]="COUNT"})(ip||(ip={}));let lr=class extends nh{constructor(){super(...arguments),this.output=ue.Color,this.textureCoordinateType=So.None,this.componentData=$y.Uniform,this.cullFace=Ln.Back,this.vertexDiscardMode=op.None,this.doubleSidedMode=Is.WindingOrder,this.alphaDiscardMode=mn.Opaque,this.integratedMeshMode=ip.None,this.transparencyPassType=Jt.NONE,this.ellipsoidMode=Ly.Earth,this.pbrMode=ei.Disabled,this.normalType=Br.Attribute,this.spherical=!1,this.doublePrecisionRequiresObfuscation=!1,this.hasVertexColors=!1,this.hasNormals=!1,this.hasSlicePlane=!1,this.hasColorTexture=!1,this.receiveAmbientOcclusion=!0,this.receiveShadows=!0,this.blendingEnabled=!0,this.hasScreenSpaceReflections=!1,this.hasPolygonOffset=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasOccludees=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.hasCloudsReflections=!0,this.snowCover=!1,this.objectAndLayerIdColor=!1}};y([fe({count:ue.COUNT})],lr.prototype,"output",void 0),y([fe({count:So.COUNT})],lr.prototype,"textureCoordinateType",void 0),y([fe({count:$y.COUNT})],lr.prototype,"componentData",void 0),y([fe({count:Ln.COUNT})],lr.prototype,"cullFace",void 0),y([fe({count:op.COUNT})],lr.prototype,"vertexDiscardMode",void 0),y([fe({count:Is.COUNT})],lr.prototype,"doubleSidedMode",void 0),y([fe({count:mn.COUNT})],lr.prototype,"alphaDiscardMode",void 0),y([fe({count:ip.COUNT})],lr.prototype,"integratedMeshMode",void 0),y([fe({count:Jt.COUNT})],lr.prototype,"transparencyPassType",void 0),y([fe({count:Ly.COUNT})],lr.prototype,"ellipsoidMode",void 0),y([fe({count:ei.COUNT})],lr.prototype,"pbrMode",void 0),y([fe({count:Br.COUNT})],lr.prototype,"normalType",void 0),y([fe()],lr.prototype,"spherical",void 0),y([fe()],lr.prototype,"doublePrecisionRequiresObfuscation",void 0),y([fe()],lr.prototype,"hasVertexColors",void 0),y([fe()],lr.prototype,"hasNormals",void 0),y([fe()],lr.prototype,"hasSlicePlane",void 0),y([fe()],lr.prototype,"hasColorTexture",void 0),y([fe()],lr.prototype,"receiveAmbientOcclusion",void 0),y([fe()],lr.prototype,"receiveShadows",void 0),y([fe()],lr.prototype,"blendingEnabled",void 0),y([fe()],lr.prototype,"hasScreenSpaceReflections",void 0),y([fe()],lr.prototype,"hasPolygonOffset",void 0),y([fe()],lr.prototype,"hasMetallicRoughnessTexture",void 0),y([fe()],lr.prototype,"hasEmissionTexture",void 0),y([fe()],lr.prototype,"hasOcclusionTexture",void 0),y([fe()],lr.prototype,"hasNormalTexture",void 0),y([fe()],lr.prototype,"hasOccludees",void 0),y([fe()],lr.prototype,"multipassEnabled",void 0),y([fe()],lr.prototype,"cullAboveGround",void 0),y([fe()],lr.prototype,"hasCloudsReflections",void 0),y([fe()],lr.prototype,"snowCover",void 0),y([fe()],lr.prototype,"objectAndLayerIdColor",void 0),y([fe({constValue:!1})],lr.prototype,"occlusionPass",void 0),y([fe({constValue:Or.Draw})],lr.prototype,"pbrTextureBindType",void 0),y([fe({constValue:!0})],lr.prototype,"hasSliceHighlight",void 0),y([fe({constValue:!1})],lr.prototype,"hasSliceInVertexProgram",void 0),y([fe({constValue:!1})],lr.prototype,"useCustomDTRExponentForWater",void 0),y([fe({constValue:!1})],lr.prototype,"hasVertexTangents",void 0),y([fe({constValue:!0})],lr.prototype,"supportsTextureAtlas",void 0),y([fe({constValue:!1})],lr.prototype,"highStepCount",void 0),y([fe({constValue:!1})],lr.prototype,"instancedDoublePrecision",void 0),y([fe({constValue:!1})],lr.prototype,"hasModelTransformation",void 0),y([fe({constValue:!0})],lr.prototype,"useFillLights",void 0),y([fe({constValue:!1})],lr.prototype,"objectAndLayerIdColorInstanced",void 0);function iwe(t,e){t.include(ME,e),t.fragment.include(kL);const i=t.fragment;i.uniforms.add(new qU("baseColor",r=>r.baseColor)),i.uniforms.add(new bT("objectOpacity",r=>r.objectOpacity)),e.hasVertexColors?i.code.add(V`vec3 _baseColor() { +return baseColor.rgb * vColor.rgb; +} +float _baseOpacity() { +return baseColor.a * vColor.a; +}`):i.code.add(V`vec3 _baseColor() { +return baseColor.rgb; +} +float _baseOpacity() { +return baseColor.a; +}`),i.code.add(V`vec4 computeMaterialColor(vec4 textureColor, vec4 externalColor, int externalColorMixMode) { +vec3 baseColor = _baseColor(); +float baseOpacity = _baseOpacity(); +vec3 color = mixExternalColor( +baseColor, +textureColor.rgb, +externalColor.rgb, +externalColorMixMode +); +float opacity = objectOpacity * mixExternalOpacity( +baseOpacity, +textureColor.a, +externalColor.a, +externalColorMixMode +); +return vec4(color, opacity); +}`)}function rwe(t,e){const i=t.fragment;switch(e.doubleSidedMode){case Is.None:i.code.add(V`vec3 _adjustDoublesided(vec3 normal) { +return normal; +}`);break;case Is.View:t.include(gO,e),i.code.add(V`vec3 _adjustDoublesided(vec3 normal) { +return dot(normal, vPositionWorldCameraRelative) > 0.0 ? -normal : normal; +}`);break;case Is.WindingOrder:i.code.add(V`vec3 _adjustDoublesided(vec3 normal) { +return gl_FrontFacing ? normal : -normal; +}`);break;default:e.doubleSidedMode;case Is.COUNT:}switch(e.normalType){case Br.Attribute:case Br.Compressed:t.include(nG,e),i.code.add(V`vec3 shadingNormalWorld() { +return _adjustDoublesided(normalize(vNormalWorld)); +} +vec3 shadingNormal_view() { +vec3 normal = normalize(vNormalView); +return gl_FrontFacing ? normal : -normal; +}`);break;case Br.ScreenDerivative:t.include(gO,e),i.code.add(V`vec3 shadingNormalWorld() { +return normalize(cross( +dFdx(vPositionWorldCameraRelative), +dFdy(vPositionWorldCameraRelative) +)); +} +vec3 shadingNormal_view() { +return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))); +}`);break;case Br.Ground:e.spherical?(t.include(gO,e),i.code.add(V`vec3 shadingNormalWorld() { +return normalize(positionWorld()); +}`)):i.code.add(V`vec3 shadingNormalWorld() { +return vec3(0.0, 0.0, 1.0); +}`),i.code.add(V`vec3 shadingNormal_view() { +return normalize(cross(dFdx(vPosition_view),dFdy(vPosition_view))).xyz; +}`);break;default:e.normalType;case Br.COUNT:}}function J9t(t,e){const i=t.fragment;if(e.hasColorTexture&&(e.output===ue.Color||e.alphaDiscardMode!==mn.Opaque)){t.include(bae,e);const r=e.textureCoordinateType===So.Atlas;i.uniforms.add(new $f("baseColorTexture",n=>n.texture)),r?(t.include(m$e),i.code.add(V`vec4 readBaseColorTexture() { +return textureAtlasLookup(baseColorTexture, vuv0, vuvRegion); +}`)):i.code.add(V`vec4 readBaseColorTexture() { +return texture(baseColorTexture, vuv0); +}`)}else i.code.add(V`vec4 readBaseColorTexture() { return vec4(1.0); }`)}function uke(t){const e=new Cr;e.include(gO,t),e.include(nG,t),e.include(ME,t),e.include(My,t),e.include(wP,t),e.include(W9t,t),e.include(_3t,t),e.include(K2t,t),e.include(J9t,t),e.include(Z9t,t);const{vertex:i,fragment:r}=e;t.pbrMode!==ei.Normal&&t.pbrMode!==ei.Schematic||(e.include(xae,t),t.hasNormalTexture&&e.include(iDe,t));const n=t.output===ue.Shadow||t.output===ue.ShadowHighlight||t.output===ue.ShadowExcludeHighlight;n&&t.componentData===$y.Varying?i.code.add(V`#define discardShadows(castShadows) { if(!castShadows) { gl_Position = vec4(1e38, 1e38, 1e38, 1.0); return; } }`):i.code.add(V`#define discardShadows(castShadows) {}`);const s=t.integratedMeshMode===ip.ColorOverlay||t.integratedMeshMode===ip.ColorOverlayWithWater,o=s&&t.output===ue.Color&&t.pbrMode===ei.WaterOnIntegratedMesh;return s&&(e.include(JT,t),e.include(ATt,t),t.spherical?i.code.add(V` + const float invEllipsoidRadius = ${V.float(1/(t.ellipsoidMode===Ly.Earth?Mr.radius:t.ellipsoidMode===Ly.Mars?Sy.radius:u_.radius))}; + vec2 projectOverlay(vec3 pos) { + return pos.xy / (1.0 + invEllipsoidRadius * pos.z); + } + `):i.code.add(V`vec2 projectOverlay(vec3 pos) { return pos.xy; }`)),o&&(e.varyings.add("tbnTangent","vec3"),e.varyings.add("tbnBiTangent","vec3"),e.varyings.add("groundNormal","vec3")),i.code.add(V` + void main() { + bool castShadows; + vec4 externalColor = forwardExternalColor(castShadows); + discardShadows(castShadows); + + vertexDiscardByOpacity(externalColor.a); + + ${t.output===ue.ObjectAndLayerIdColor?V`externalColor.a = 1.0;`:""} + + if (externalColor.a < ${V.float(Cl)}) { + // Discard this vertex + gl_Position = vec4(1e38, 1e38, 1e38, 1.0); + return; + } + + forwardPosition(readElevationOffset()); + forwardNormal(); + forwardTextureCoordinates(); + forwardVertexColor(); + forwardLinearDepth(); + ${t.output===ue.ObjectAndLayerIdColor?V`forwardObjectAndLayerIdColor();`:""} + ${o?t.spherical?V` + groundNormal = normalize(positionWorld()); + tbnTangent = normalize(cross(vec3(0.0, 0.0, 1.0), groundNormal)); + tbnBiTangent = normalize(cross(groundNormal, tbnTangent));`:V` + groundNormal = vec3(0.0, 0.0, 1.0); + tbnTangent = vec3(1.0, 0.0, 0.0); + tbnBiTangent = vec3(0.0, 1.0, 0.0);`:""} + ${s?V`setOverlayVTC(projectOverlay(position));`:""} + } + `),t.output===ue.Alpha&&(r.include(Kf),e.include(dd,t),e.include(iwe,t),s&&r.uniforms.add(new Zt("ovColorTex",(l,c)=>uie(l,c))),r.code.add(V` + void main() { + discardBySlice(vPositionWorldCameraRelative); + ${t.multipassEnabled?V`terrainDepthTest(vPosition_view.z);`:""} + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + vec4 externalColor; + int externalColorMixMode; + readExternalColor(externalColor, externalColorMixMode); + + vec4 materialColor = computeMaterialColor( + textureColor, + externalColor, + externalColorMixMode + ); + ${s?V` + vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay); + materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + fragColor = vec4(materialColor.a); + } + `)),t.output===ue.Color&&(r.include(Kf),e.include(dd,t),e.include(iwe,t),e.include(rwe,t),e.include(JT,t),t.receiveShadows?(e.include(lG,t),r.code.add(V`float evaluateShadow() { +return readShadowMap(vPositionWorldCameraRelative, linearDepth); +}`)):r.code.add(V`float evaluateShadow() { return 0.0; }`),s&&r.uniforms.add(new Zt("ovColorTex",(l,c)=>uie(l,c))),r.code.add(V` + void main() { + discardBySlice(vPositionWorldCameraRelative); + ${t.multipassEnabled?V`terrainDepthTest(vPosition_view.z);`:""} + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + vec4 externalColor; + int externalColorMixMode; + readExternalColor(externalColor, externalColorMixMode); + + vec4 materialColor = computeMaterialColor( + textureColor, + externalColor, + externalColorMixMode + ); + ${s?V`vec4 overlayColor = getOverlayColor(ovColorTex, vtcOverlay);`:""} + `),t.pbrMode===ei.Normal||t.pbrMode===ei.Schematic?(a1(r),r.code.add(V` + ${t.pbrMode===ei.Normal?V` + applyPBRFactors(); + if (int(externalColorMixMode) == 3) { + mrr = vec3(0.0, 0.6, 0.2); + }`:""} + vec3 normalVertex = shadingNormalWorld(); + float additionalIrradiance = 0.02 * mainLightIntensity[2]; + `),t.hasNormalTexture?r.code.add(V`mat3 tangentSpace = computeTangentSpace(normalVertex, vPositionWorldCameraRelative, vuv0); +vec3 shadingNormal = computeTextureNormal(tangentSpace, vuv0);`):r.code.add(V`vec3 shadingNormal = normalVertex;`),r.code.add(V`${t.spherical?V`vec3 normalGround = normalize(positionWorld());`:V`vec3 normalGround = vec3(0.0, 0.0, 1.0);`} + `),r.code.add(V` + vec3 viewDir = normalize(vPositionWorldCameraRelative); + float ssao = 1.0 - occlusion * evaluateAmbientOcclusionInverse(); + + ${t.snowCover?V` + vec3 surfaceNormal = normalize(shadingNormalWorld()); + float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld()))); + materialColor.rgb = mix(materialColor.rgb, vec3(1), snow); + + shadingNormal = mix(shadingNormal, surfaceNormal, snow); + ssao = mix(ssao, 0.0, snow); + mrr = mix(mrr, vec3(0.0, 1.0, 0.04), snow); + emission = mix(emission, vec3(0.0), snow);`:""} + + ${s?V` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + vec3 additionalLight = evaluateAdditionalLighting(ssao, positionWorld()); + vec4 shadedColor = vec4(evaluateSceneLightingPBR(shadingNormal, materialColor.rgb, evaluateShadow(), ssao, additionalLight, viewDir, normalGround, mrr, emission, additionalIrradiance), materialColor.a); + `)):(t.receiveShadows?r.code.add(V`float shadow = evaluateShadow();`):t.spherical?(CP(r),r.code.add(V`float additionalAmbientScale = additionalDirectedAmbientLight(positionWorld()); +float shadow = lightingGlobalFactor * (1.0 - additionalAmbientScale);`)):r.code.add(V`float shadow = 0.0;`),o&&r.uniforms.add(new Zt("ovNormalTex",(l,c)=>{var f;return(f=c.overlay)==null?void 0:f.getTexture(ns.WaterNormal)})),t.snowCover&&r.code.add(V`vec3 surfaceNormal = normalize(cross(dFdx(vPositionWorldCameraRelative), dFdy(vPositionWorldCameraRelative))); +float snow = smoothstep(0.5, 0.55, dot(surfaceNormal, normalize(positionWorld()))); +materialColor.rgb = mix(materialColor.rgb, vec3(1), snow);`),r.code.add(V` + float ambientOcclusion = evaluateAmbientOcclusion(); + vec3 additionalLight = evaluateAdditionalLighting(ambientOcclusion, positionWorld()); + + ${s?V` materialColor = materialColor * (1.0 - overlayColor.a) + overlayColor;`:""} + + vec4 shadedColor = vec4(evaluateSceneLighting(shadingNormalWorld(), materialColor.rgb, shadow, ambientOcclusion, additionalLight), materialColor.a); + ${o?V` + vec4 overlayWaterMask = getOverlayColor(ovNormalTex, vtcOverlay); + float waterNormalLength = length(overlayWaterMask); + if (waterNormalLength > 0.95) { + mat3 tbnMatrix = mat3(tbnTangent, tbnBiTangent, groundNormal); + vec4 waterColorLinear = getOverlayWaterColor(overlayWaterMask, overlayColor, -normalize(vPositionWorldCameraRelative), shadow, groundNormal, tbnMatrix, vPosition_view, positionWorld()); + vec4 waterColorNonLinear = delinearizeGamma(vec4(waterColorLinear.xyz, 1.0)); + // un-gamma the ground color to mix in linear space + shadedColor = mix(shadedColor, waterColorNonLinear, waterColorLinear.w); + }`:""} + `)),r.code.add(V` + fragColor = highlightSlice(shadedColor, vPositionWorldCameraRelative); + ${t.transparencyPassType===Jt.Color?"fragColor = premultiplyAlpha(fragColor);":""} + } + `)),(t.output===ue.Depth||n)&&(e.include(E_,t),r.code.add(V`void main() { +discardBySlice(vPositionWorldCameraRelative); +vec4 textureColor = readBaseColorTexture(); +discardOrAdjustAlpha(textureColor); +outputDepth(linearDepth); +}`)),t.output===ue.Normal&&(e.include(rwe,t),r.code.add(V` + void main() { + discardBySlice(vPositionWorldCameraRelative); + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + // note: the alpha component needs to be 1.0 in order for this material to influence ambient occlusion, + // see the ssao fragment shader + float alpha = ${t.normalType===Br.Ground?"0.0":"1.0"}; + fragColor = vec4(vec3(.5) + .5 * shadingNormal_view(), alpha); + } + `)),t.output===ue.ObjectAndLayerIdColor&&e.fragment.code.add(V` + void main() { + discardBySlice(vPositionWorldCameraRelative); + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + ${s?V`fragColor = getOverlayColorTexel(vtcOverlay);`:"outputObjectAndLayerIdColor();"} + } + `),t.output===ue.Highlight&&(e.include(dx),r.code.add(V` + void main() { + discardBySlice(vPositionWorldCameraRelative); + + vec4 textureColor = readBaseColorTexture(); + discardOrAdjustAlpha(textureColor); + + ${s?V` + vec4 overlayColor = getCombinedOverlayColor(); + if (overlayColor.a == 0.0) { + fragColor = vec4(0.0); + return; + }`:""} + + outputHighlight(); + } + `)),e}const K9t=Object.freeze(Object.defineProperty({__proto__:null,build:uke},Symbol.toStringTag,{value:"Module"}));let hke=class dke extends Hr{initializeConfiguration(e,i){i.spherical=e.viewingMode===_t.Global,i.doublePrecisionRequiresObfuscation=e.rctx.driverTest.doublePrecisionRequiresObfuscation.result}initializeProgram(e){return new Ir(e.rctx,dke.shader.get().build(this.configuration),pke)}_setPipelineState(e){const i=this.configuration,r=i.integratedMeshMode!==ip.None,n=e===Jt.NONE,s=e===Jt.FrontFace;return Ti({blending:i.output!==ue.Color&&i.output!==ue.Alpha||!i.blendingEnabled?null:n?vp:Y_(e),culling:Mj(i.cullFace),depthTest:{func:px(e)},depthWrite:n||s?rh:null,colorWrite:ji,stencilWrite:r||i.hasOccludees?Jy:null,stencilTest:r?g3t(Zu.IntegratedMeshMaskExcluded):i.hasOccludees?fx:null,polygonOffset:n||s?i.hasPolygonOffset?{factor:2,units:2}:null:eG})}initializePipeline(){return this._setPipelineState(this.configuration.transparencyPassType)}};hke.shader=new Rr(K9t,()=>we(()=>Promise.resolve().then(()=>zWt),void 0));const pke=new Map([[J.POSITION,0],[J.NORMAL,1],[J.NORMALCOMPRESSED,1],[J.COLOR,2],[J.UV0,3],[J.UVREGION,4],[J.COMPONENTINDEX,5]]);let Q9t=class extends _n{constructor(){super(...arguments),this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){if(this._dirty=!1,this._parameterBlocks!=null)for(const e of this._parameterBlocks)this[e]._setClean()}get dirty(){return this._dirty||this._checkParameterBlocksDirty()}_checkParameterBlocksDirty(){if(this._parameterBlocks==null)return!1;for(const e of this._parameterBlocks)if(this[e].dirty)return!0;return!1}},zce=class{constructor(){this._dirty=!0}_setDirty(){this._dirty=!0}_setClean(){this._dirty=!1}get dirty(){return this._dirty}};function Vs(t={}){return(e,i)=>{const r=e._parameterCount??0;if(e._parameterCount=r+1,t.vectorOps){const n=t.vectorOps;Object.defineProperty(e,i,{get(){return this[r]},set(s){const o=this[r];if(o==null)this[r]=s;else{if(n.equals(o,s))return;n.copy(o,s)}this._setDirty()}})}else Object.defineProperty(e,i,{get(){return this[r]},set(n){this[r]!==n&&(t.dispose&&this[r]&&this[r].dispose(),this[r]=n,this._setDirty())}})}}function nwe(){return(t,e)=>{const i=t._parameterCount??0;t._parameterCount=i+1,t._parameterBlocks=t._parameterBlocks||[],t._parameterBlocks.push(i),Object.defineProperty(t,e,{get(){return this[i]},set(r){this[i]!==r&&(this[i]=r,this._setDirty())}})}}let PG=class{constructor(e){this._low=W(),this._high=W(),e&&this.set(e)}get low(){return this._low}get high(){return this._high}set(e){Ne(this._low,Ne(swe,e));const i=xn(swe,e,this._low);Ne(this._high,i)}get(e){return Be(e,this._low,this._high)}getLowScaled(e){return De(e,this._low,1)}};const swe=Bs();let Fa=class extends Q9t{constructor(e,i){super(),this.toMapSpace=i,this.baseColor=Mi(1,1,1,1),this.usePBR=!1,this.hasParametersFromSource=!1,this.mrrFactors=mc(sG),this.emissiveFactor=nt(0,0,0),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null,this.objectOpacity=1,this.commonMaterialParameters=new vk,this.componentParameters=new U$,this.textureAlphaCutoff=UU,this.alphaDiscardMode=mn.Opaque,this.isIntegratedMesh=!1,this.polygonOffsetEnabled=!1,this.ellipsoidMode=Ly.Earth,this.hasOccludees=!1,this._techniqueConfiguration=new lr;const r=new PG(e.position),n=hDe(e.rotationScale);_E(n,n),this.transformNormalGlobalFromModel=EPe(Xf(n,n)),this.transformWorldFromModelTL=r.low,this.transformWorldFromModelTH=r.high,this.transformWorldFromModelRS=e.rotationScale}dispose(){this._technique=ir(this._technique),this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.emissionTexture=null,this.occlusionTexture=null,this.normalTexture=null}get texture(){return this.baseColorTexture!=null?this.baseColorTexture.glTexture:null}get textureMetallicRoughness(){return this.metallicRoughnessTexture!=null?this.metallicRoughnessTexture.glTexture:null}get textureEmissive(){return this.emissionTexture!=null?this.emissionTexture.glTexture:null}get textureOcclusion(){return this.occlusionTexture!=null?this.occlusionTexture.glTexture:null}get textureNormal(){return this.normalTexture!=null?this.normalTexture.glTexture:null}prepareTechnique(e,i,r,n){const s=this._techniqueConfiguration;s.hasVertexColors=n.colors,s.hasNormals=n.normals,s.textureCoordinateType=n.textureCoordinates,s.hasMetallicRoughnessTexture=this.metallicRoughnessTexture!=null,s.hasEmissionTexture=this.emissionTexture!=null,s.hasOcclusionTexture=this.occlusionTexture!=null,s.hasNormalTexture=this.normalTexture!=null,s.transparencyPassType=i.identifier===Hh.Material&&r.transparencyPassType!=null?r.transparencyPassType:Jt.NONE,s.multipassEnabled=i.identifier===Hh.Material&&r.multipassEnabled,s.cullAboveGround=i.identifier===Hh.Material&&r.multipassTerrain.cullAboveGround,s.ellipsoidMode=this.ellipsoidMode,s.componentData=this.componentParameters.type,s.cullFace=this.commonMaterialParameters.cullFace,s.doubleSidedMode=this.commonMaterialParameters.doubleSided?Is.View:Is.None,s.hasColorTexture=this.baseColorTexture!=null;const o=this._computeWhichMaterialPass();if(s.blendingEnabled=o===Jc.Transparent||o===Jc.OpaqueAndTransparent,s.alphaDiscardMode=this.alphaDiscardMode,s.integratedMeshMode=this.isIntegratedMesh?i6t(r)?t6t(r)?ip.ColorOverlayWithWater:ip.ColorOverlay:ip.NoOverlay:ip.None,s.hasPolygonOffset=this.polygonOffsetEnabled,s.pbrMode=s.integratedMeshMode===ip.ColorOverlayWithWater?ei.WaterOnIntegratedMesh:this.usePBR?this.hasParametersFromSource?ei.Schematic:ei.Normal:ei.Disabled,s.normalType=s.integratedMeshMode===ip.None?s.hasNormals?Br.Compressed:Br.ScreenDerivative:Br.Ground,s.hasSlicePlane=r.slicePlane!=null&&this.commonMaterialParameters.hasSlicePlane,i.identifier===Hh.ShadowMap)s.output=ue.Shadow,s.vertexDiscardMode=op.None;else if(i.identifier===Hh.Highlight)s.output=ue.Highlight,s.vertexDiscardMode=op.None;else{switch(o===Jc.OpaqueAndTransparent?s.vertexDiscardMode=i.transparent?op.Opaque:op.Transparent:s.vertexDiscardMode=op.None,s.output=i.output,s.receiveAmbientOcclusion=!1,s.receiveShadows=!1,i.output){case ue.Color:s.receiveAmbientOcclusion=r.ssao!=null,s.hasOccludees=r.hasOccludees,s.receiveShadows=r.shadowMap.ready,s.hasScreenSpaceReflections=r.ssr.lastFrameColor!=null,s.hasCloudsReflections=r.cloudsFade.data!=null;break;case ue.Alpha:s.hasOccludees=r.hasOccludees;break;case ue.ObjectAndLayerIdColor:s.objectAndLayerIdColor=!0}s.snowCover=this.hasSnowCover(r)}return this._technique=e.releaseAndAcquire(hke,s,this._technique),this._setClean(),this._technique}hasSnowCover(e){return e.weather!=null&&e.weatherVisible&&e.weather.type==="snowy"&&e.weather.snowCover==="enabled"}submit(e,i,r){if(this.objectOpacity===0)return;const n=r.renderable.geometry,s=r.components,o=r.renderable.meta.cameraDepthSquared,l=s.geometryRanges,c=s.highlightRanges,f=s.defaultShadowMapRanges;switch(this._computeWhichMaterialPass()){case Jc.Opaque:e.materialOpaque.submitDraw(this,n,l,o);break;case Jc.Transparent:e.materialTransparent.submitDraw(this,n,l,o);break;case Jc.OpaqueAndTransparent:e.materialOpaque.submitDraw(this,n,l,o),e.materialTransparent.submitDraw(this,n,l,o);break;case Jc.IntegratedMesh:e.materialIntegratedMesh.submitDraw(this,n,l,o),e6t(i)&&e.highlightIntegratedMesh.submitDraw(this,n,l,o)}const _=this.componentParameters.castShadows!==Ta.None;_&&e.shadowMap.submitDraw(this,n,l,o),c!=null&&(e.highlight.submitDraw(this,n,c,o),_&&e.highlightShadowMap.submitDraw(this,n,c,o)),_&&f!=null&&e.defaultShadowMap.submitDraw(this,n,f,o)}_computeWhichMaterialPass(){return this.isIntegratedMesh?Jc.IntegratedMesh:this.objectOpacity<1?Jc.Transparent:this.componentParameters.opaqueOverride===Ta.All?Jc.Opaque:this.baseColor[3]<1||this.alphaDiscardMode===mn.Blend||this.alphaDiscardMode===mn.MaskBlend?Jc.Transparent:this.componentParameters.transparent===Ta.None?Jc.Opaque:this.componentParameters.transparent===Ta.All?Jc.Transparent:Jc.OpaqueAndTransparent}};var Jc,Ta;y([Vs({vectorOps:xAe})],Fa.prototype,"baseColor",void 0),y([Vs()],Fa.prototype,"usePBR",void 0),y([Vs()],Fa.prototype,"hasParametersFromSource",void 0),y([Vs({vectorOps:Jde})],Fa.prototype,"mrrFactors",void 0),y([Vs({vectorOps:Jde})],Fa.prototype,"emissiveFactor",void 0),y([Vs({dispose:!0})],Fa.prototype,"baseColorTexture",void 0),y([Vs({dispose:!0})],Fa.prototype,"metallicRoughnessTexture",void 0),y([Vs({dispose:!0})],Fa.prototype,"emissionTexture",void 0),y([Vs({dispose:!0})],Fa.prototype,"occlusionTexture",void 0),y([Vs({dispose:!0})],Fa.prototype,"normalTexture",void 0),y([Vs()],Fa.prototype,"objectOpacity",void 0),y([nwe()],Fa.prototype,"commonMaterialParameters",void 0),y([nwe()],Fa.prototype,"componentParameters",void 0),y([Vs()],Fa.prototype,"textureAlphaCutoff",void 0),y([Vs()],Fa.prototype,"alphaDiscardMode",void 0),y([Vs()],Fa.prototype,"isIntegratedMesh",void 0),y([Vs()],Fa.prototype,"polygonOffsetEnabled",void 0),y([Vs()],Fa.prototype,"ellipsoidMode",void 0),y([Vs()],Fa.prototype,"hasOccludees",void 0),function(t){t[t.Opaque=0]="Opaque",t[t.Transparent=1]="Transparent",t[t.OpaqueAndTransparent=2]="OpaqueAndTransparent",t[t.IntegratedMesh=3]="IntegratedMesh"}(Jc||(Jc={}));let vk=class extends zce{constructor(){super(...arguments),this.doubleSided=!1,this.cullFace=Ln.Back,this.hasSlicePlane=!0}};y([Vs()],vk.prototype,"doubleSided",void 0),y([Vs()],vk.prototype,"cullFace",void 0),y([Vs()],vk.prototype,"hasSlicePlane",void 0);let U$=class extends zce{constructor(){super(...arguments),this.externalColor=Mi(1,1,1,1),this.externalColorMixMode=Uo.Multiply,this.castShadows=Ta.All}get transparent(){return this.externalColor[3]<1?Ta.All:Ta.None}get opaqueOverride(){return this.externalColorMixMode===Uo.Replace&&this.externalColor[3]===1?Ta.All:Ta.None}get visible(){return this.externalColor[3]>0?Ta.All:Ta.None}get type(){return $y.Uniform}};y([Vs({vectorOps:xAe})],U$.prototype,"externalColor",void 0),y([Vs()],U$.prototype,"externalColorMixMode",void 0),y([Vs()],U$.prototype,"castShadows",void 0),function(t){t[t.All=0]="All",t[t.Some=1]="Some",t[t.None=2]="None"}(Ta||(Ta={}));let TI=class extends zce{constructor(){super(...arguments),this.texture=null,this.transparent=Ta.None,this.opaqueOverride=Ta.None,this.castShadows=Ta.None}get type(){return $y.Varying}};function e6t(t){var e;return((e=t.overlay)==null?void 0:e.getTexture(ns.Highlight))!=null}function t6t(t){var e;return((e=t.overlay)==null?void 0:e.getTexture(ns.WaterNormal))!=null}function i6t(t){var e;return((e=t.overlay)==null?void 0:e.getTexture(ns.ColorNoRasterImage))!=null}y([Vs()],TI.prototype,"texture",void 0),y([Vs()],TI.prototype,"transparent",void 0),y([Vs()],TI.prototype,"opaqueOverride",void 0),y([Vs()],TI.prototype,"castShadows",void 0);const fV=ls().vec3f(J.POSITION).u16(J.COMPONENTINDEX),fke=ls().vec2u8(J.SIDENESS),r6t=md(fke),Zie=ls().vec3f(J.POSITION0).vec3f(J.POSITION1).vec3f(J.NORMAL).u16(J.COMPONENTINDEX).u8(J.VARIANTOFFSET,{glNormalized:!0}).u8(J.VARIANTSTROKE).u8(J.VARIANTEXTENSION,{glNormalized:!0}),Jie=ls().vec3f(J.POSITION0).vec3f(J.POSITION1).vec3f(J.NORMALA).vec3f(J.NORMALB).u16(J.COMPONENTINDEX).u8(J.VARIANTOFFSET,{glNormalized:!0}).u8(J.VARIANTSTROKE).u8(J.VARIANTEXTENSION,{glNormalized:!0}),mke=new Map([[J.POSITION0,0],[J.POSITION1,1],[J.COMPONENTINDEX,2],[J.VARIANTOFFSET,3],[J.VARIANTSTROKE,4],[J.VARIANTEXTENSION,5],[J.NORMAL,6],[J.NORMALA,6],[J.NORMALB,7],[J.SIDENESS,8]]);function owe(t,e,i){const r=e/3,n=new Uint32Array(i+1),s=new Uint32Array(i+1),o=(F,z)=>{F{if(F{const k=2*F,U=z-F;for(let j=1;j=0&&f[k+2*Q]>H;Q--)f[k+2*Q+2]=f[k+2*Q],f[k+2*Q+3]=f[k+2*Q+1];f[k+2*Q+2]=H,f[k+2*Q+3]=Y}};for(let F=0;FF===t[3*z]?0:F===t[3*z+1]?1:F===t[3*z+2]?2:-1,I=(F,z)=>{const k=M(F,z);A[3*z+k]=-1},L=(F,z,k,U)=>{const j=M(F,z);A[3*z+j]=U;const H=M(k,U);A[3*U+H]=z};for(let F=0;F{n.getVec(L[4*Ee],x),n.getVec(L[4*Ee+1],T),te[Ee]=Sn(x,T)}),ne.sort((pe,Ee)=>re[Ee]-re[pe]);const he=new Array,ce=new Array;for(let pe=0;pee}function u6t(t,e){const i=Ca(t.cosAngle),r=Kie.fwd,n=Kie.ortho;return R_(r,t.position1,t.position0),i*(Ve(Wt(n,t.faceNormal0,t.faceNormal1),r)>0?-1:1)>e}function h6t(t){const e=t.faces.length/3,i=t.faces,r=t.neighbors;let n=0;for(let l=0;l0?this._recycledIndices.pop():this.availableCount?this._nextIndex++:void 0}release(e){this._recycledIndices.push(e)}},_6t=class{constructor(e,i=1){this._rctx=e,this._fieldCount=i,this.textureWidth=4096,this._dirty=!0;const r=new tn(this.textureWidth,1);r.samplingMode=ki.NEAREST,r.wrapMode=Bi.CLAMP_TO_EDGE,this._texture=new Ai(this._rctx,r),this._data=new Ac(new ArrayBuffer(4*this.textureWidth))}dispose(){this._texture.dispose(),this._texture=void 0,this._data=void 0}setData(e,i,r,n,s,o){const l=e*this._fieldCount+i;this._dirty=!0,this._data.set(l,0,r),this._data.set(l,1,n),this._data.set(l,2,s),this._data.set(l,3,o)}setDataElement(e,i,r,n){const s=e*this._fieldCount+i;this._dirty=!0,this._data.set(s,r,n)}getDataElement(e,i,r){const n=e*this._fieldCount+i;return this._dirty=!0,this._data.get(n,r)}resizeToFit(e){const i=(e+1)*this._fieldCount;if(i>this._data.count){const r=Math.ceil(i/this.textureWidth)*this.textureWidth,n=new Ac(new ArrayBuffer(4*r));n.typedBuffer.set(this._data.typedBuffer),this._data=n}}updateTexture(){if(!this._dirty)return;const e=this._texture.descriptor.width,i=this._texture.descriptor.height;this._data.count>e*i&&this._texture.resize(e,this._data.count/e),this._texture.setData(this._data.typedBuffer),this._dirty=!1}get texture(){return this._texture}};const yke=65536;let b6t=class{constructor(e,i=1){this.textureBuffer=new _6t(e,i),this._indexManager=new v6t(yke)}dispose(){this.textureBuffer.dispose(),this.textureBuffer=void 0}get availableCount(){return this._indexManager.availableCount}get activeCount(){return this._indexManager.activeCount}acquireIndex(){const e=this._indexManager.acquire();return this.textureBuffer.resizeToFit(e),e}releaseIndex(e){this._indexManager.release(e)}},vke=class{constructor(e,i=1){this._rctx=e,this._fieldCount=i,this._buffers=[]}garbageCollect(){this._buffers=this._buffers.filter(e=>e.activeCount!==0||(e.dispose(),!1))}destroy(){this._buffers.forEach(e=>e.dispose()),this._buffers=[]}getBuffer(e){for(const r of this._buffers)if(r.availableCount>=e)return r;if(e>yke)return null;const i=new b6t(this._rctx,this._fieldCount);return this._buffers.push(i),i}updateTextures(){for(const e of this._buffers)e.textureBuffer.updateTexture()}};const uwe=Ce.getLogger("esri.views.3d.webgl-engine.collections.Component.ComponentObjectCollection");let w6t=class{constructor(e,i){this._renderManager=e,this._viewingMode=i,this._objects=[new Pi,new Pi],this._renderSubmit=new j9t(this),this._renderManager.register(this._renderSubmit),this._hasObjectAndLayerId=Le("enable-feature:objectAndLayerId-rendering"),this._componentBufferManager=new vke(e.rctx,2+(this._hasObjectAndLayerId?1:0))}destroy(){Xt(this._objects[AO.Hidden].length===0&&this._objects[AO.Visible].length===0,"ObjectCollection should be empty upon disposal"),this._componentBufferManager.destroy();const e=this._objects.flatMap(i=>i.toArray());for(const i of e)i==null||i.destroy()}createObject(e){const i=new SI;return i.toMapSpace=e.toMapSpace,i.transform=e.transform,i.obb=$fe(e.obb),i.components=new T9t(this._componentBufferManager,Py(e.geometry.componentOffsets)),i.renderable=this._createRenderable(e,i.components),i.intersectionGeometry=new R9t(e.geometry.positionData,i.components),this._objects[i.visible].push(i),i}destroyObject(e){const i=e;this._objects[i.visible].removeUnordered(i),i.destroy(),this._notifyDirty()}setObjectVisibility(e,i){const r=e;i!==r.visible&&(this._objects[r.visible].removeUnordered(r),this._objects[i].push(r),r.visible=i,this._notifyDirty())}preSubmit(e){const i=e.camera.eye;this.visibleObjects.forAll(r=>r.renderable.meta.cameraDepthSquared=Co(i,r.obb.center))}getMaterial(e){return e.renderable.material}updateMaterial(e,i){const r=e.renderable.material;i(r),r.dirty&&this._notifyDirty()}setAllComponentVisibilities(e,i){const r=e;r.components.visibility.reset(i),r.components.visibilityDirty(),this._notifyDirty()}forEachVisibleComponent(e,i){return e.components.visibility.forEachComponent(i)}getComponentCount(e){const i=e,r=i.components.visibility.componentCount();return{visible:r,invisible:i.components.count-r}}setComponentData(e,i){const r=e,n=r.renderable.material,s=r.components,o=s.materialDataBuffer,l=s.materialDataIndices,c=new H9t,f=o.textureBuffer,_=new Uint8Array(4),x=new Uint32Array(_.buffer);let T=0,A=0,M=0,I=s.verticalOffsets,L=1/0,F=-1/0,z=!1,k=!1,U=0;for(let j=0;j0&&U!==x[0]),U=x[0],k||(k=c.elevationOffset!==0),k&&I==null&&(I=new Array(j).fill(0)),I!=null&&(I[j]=c.elevationOffset),L=Math.min(L,c.elevationOffset),F=Math.max(F,c.elevationOffset),cke(c.elevationOffset,_),f.setData(l[j],1,_[0],_[1],_[2],_[3]);const H=c.objectAndLayerIdColor;H!=null&&f.setData(l[j],2,H[0],H[1],H[2],H[3]),c.pickable!==oke(s.pickability,j)&&(s.pickability=C9t(s.pickability,s.count,j,c.pickable))}s.verticalOffsets=k?I:null,r.offsetObb=k?yRe(r.obb,L,F,this._viewingMode,r.offsetObb!=null?r.offsetObb:$fe(r.obb)):null,z||k||this._hasObjectAndLayerId?(n.componentParameters=new TI,n.componentParameters.castShadows=LY(M,s.count),n.componentParameters.transparent=LY(T,s.count),n.componentParameters.opaqueOverride=LY(A,s.count),n.componentParameters.texture=f,f.updateTexture()):(n.componentParameters=new U$,n.componentParameters.castShadows=c.castShadows?Ta.All:Ta.None,n.componentParameters.externalColor=c.externalColor,n.componentParameters.externalColorMixMode=c.externalColorMixMode),this._notifyDirty()}getComponentAabb(e,i,r,n=!1){e.intersectionGeometry.getComponentAabb(i,r);const s=e,o=s.components.verticalOffsets;if(n||o==null)return r;const l=o[i];if(this._viewingMode===_t.Local||l===0)return r[2]+=l,r[5]+=l,r;const c=s0t(l);return c.localOrigin=s.transform.position,c.applyToAabb(r)}getComponentObb(e){return e.obb}getObjectTransform(e){return e.transform}getComponentPositions(e,i,r){return e.intersectionGeometry.getComponentPositions(i,r)}intersect(e,i,r,n,s,o){const l=e;s!=null&&(s.localOrigin=l.transform.position);const c=_E(hwe,l.transform.rotationScale);xn(E8,i,l.transform.position),xn(C8,r,l.transform.position),qh(E8,E8,c),qh(C8,C8,c);const f=Xf(hwe,c);return l.intersectionGeometry.intersect(E8,C8,n,f,s,l.components.verticalOffsets,o)}addEdges(e,i,r,n){const s=e,{indices:o,positions:l}=s.intersectionGeometry,c=s.components.offsets;return i.addComponentObject(e,s.transform,{center:s.obb.center,radius:eht(s.obb)},l,o,c,r,n)}async extractEdgeInformation(e,i,r){const n=e,s=n.components.visibility;if(s.allInvisible())return{buffer:y6t.createBuffer(0),origin:[0,0,0]};const{indices:o,positions:l}=n.intersectionGeometry,c=n.components.offsets,f=fV.createBuffer(l.length/3);h6(f.position.typedBuffer,l,f.position.typedBufferStride,3),tNe(f.position,f.position,n.transform.rotationScale),this._setComponentIndices(f.componentIndex,o,c);const _=f.count,x=this._computeVisibilityIndices(o,s,c,_);return{origin:Xr(n.transform.position),buffer:await i.extractComponentsEdgeLocations({indices:x,indicesLength:x.length,skipDeduplicate:!0,data:f,writerSettings:{reducedPrecision:!1,variants:0}},r)}}_setComponentIndices(e,i,r){let n=0;for(let s=0;s(s+=r[f]-r[c],!0));const o=zf(e)?new Array(s):(e==null?void 0:e.BYTES_PER_ELEMENT)===2||n<=65536?new Uint16Array(s):new Uint32Array(s);let l=0;return i.forEachComponentRange((c,f)=>{const _=r[c],x=r[f];for(let T=_;T1)return r.highlightCounts[i]=n-1,void(r.highlightCounts[r.count]=s-1);r.highlightCounts[i]=0,r.highlightsDirty(),this._notifyDirty(),s===1?r.highlightCounts=null:r.highlightCounts[r.count]=s-1}else uwe.warn("Removing non-existing highlight.")}clearHighlights(e){const i=e.components;i.highlightCounts!=null&&(i.highlightCounts=null,i.highlightsDirty(),this._notifyDirty())}getObjectGPUMemoryUsage(e){return e.renderable.meta.gpuMemoryEstimate}get visibleObjects(){return this._objects[AO.Visible]}_createRenderable(e,i){const r=this._renderManager.rctx,n=e.geometry,s=n.vertices.layoutParameters,o=Yr.createVertex(r,Pr.STATIC_DRAW,n.vertices.data),l=n.indices?Yr.createIndex(r,Pr.STATIC_DRAW,n.indices):null,c=md(G9t(s)),f=new Uint16Array(n.vertices.count);for(let I=0;Ii.texture)),t.hasOpacityFactor&&e.fragment.uniforms.add(new ft("opacity",i=>i.opacity)),e.fragment.code.add(V` + void main() { + fragColor = texture(tex, uv) ${t.hasOpacityFactor?"* opacity":""}; + }`),e}const S6t=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:RG,build:_ke},Symbol.toStringTag,{value:"Module"}));var yc;(function(t){t[t.None=0]="None",t[t.Alpha=1]="Alpha",t[t.PremultipliedAlpha=2]="PremultipliedAlpha",t[t.COUNT=3]="COUNT"})(yc||(yc={}));let _V=class extends nh{constructor(){super(...arguments),this.alphaMode=yc.None,this.hasOpacityFactor=!1}};y([fe({count:yc.COUNT})],_V.prototype,"alphaMode",void 0),y([fe()],_V.prototype,"hasOpacityFactor",void 0);let Vce=class bke extends Hr{initializeProgram(e){return new Ir(e.rctx,bke.shader.get().build(this.configuration),Er)}initializePipeline(){switch(this.configuration.alphaMode){case yc.None:return Ti({colorWrite:ji});case yc.Alpha:return Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji});case yc.PremultipliedAlpha:case yc.COUNT:return Ti({blending:hd(st.ONE,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji})}}};Vce.shader=new Rr(S6t,()=>we(()=>Promise.resolve().then(()=>UWt),void 0));let Bce=class extends _n{};function wke(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("tex",e=>e.texture)),t.fragment.code.add(V`void main() { +fragColor = vec4(1.0 - texture(tex, uv).a); +}`),t}const T6t=Object.freeze(Object.defineProperty({__proto__:null,HUDCompositingPassParameters:Bce,build:wke},Symbol.toStringTag,{value:"Module"}));let xke=class Ske extends Hr{initializeProgram(e){return new Ir(e.rctx,Ske.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:{r:!1,g:!0,b:!1,a:!1}})}};xke.shader=new Rr(T6t,()=>we(()=>Promise.resolve().then(()=>VWt),void 0));let jce=class extends _n{};function Tke(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("colorTexture",e=>e.colorTexture),new Zt("alphaTexture",e=>e.alphaTexture),new Zt("frontFaceTexture",e=>e.frontFaceTexture)),t.fragment.code.add(V`void main() { +vec4 srcColor = texture(colorTexture, uv); +if(srcColor.a <= 1e-5){ +discard; +} +float srcAlpha = texture(alphaTexture, uv).r; +vec4 frontFace = texture(frontFaceTexture, uv); +fragColor = vec4(mix(srcColor.rgb/srcColor.a, frontFace.rgb, frontFace.a), 1.0 - srcAlpha); +}`),t}const E6t=Object.freeze(Object.defineProperty({__proto__:null,OITCompositingPassParameters:jce,build:Tke},Symbol.toStringTag,{value:"Module"}));let Eke=class Cke extends Hr{initializeProgram(e){return new Ir(e.rctx,Cke.shader.get().build(),Er)}initializePipeline(){return Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji})}};Eke.shader=new Rr(E6t,()=>we(()=>Promise.resolve().then(()=>BWt),void 0));let C6t=class{constructor(e,i){this._rctx=e,this._techniqueRepository=i,this._configuration=new _V,this._passParameters=new RG,this._oitParameters=new jce,this._hudParameters=new Bce}compositeOIT(e,i,r,n){this._oitParameters.colorTexture=i,this._oitParameters.alphaTexture=r,this._oitParameters.frontFaceTexture=n;const s=this._techniqueRepository.acquire(Eke);this._rctx.bindTechnique(s,this._oitParameters,e),this._rctx.screen.draw(),s.release()}compositeHUD(e,i){this._hudParameters.texture=i;const r=this._techniqueRepository.acquire(xke);this._rctx.bindTechnique(r,this._hudParameters,e),this._rctx.screen.draw(),r.release()}composite(e,i,r=yc.None,n=1){this._configuration.alphaMode=r,this._configuration.hasOpacityFactor=n!==1,this._passParameters.texture=i,this._passParameters.opacity=n;const s=this._techniqueRepository.acquire(Vce,this._configuration);this._rctx.bindTechnique(s,this._passParameters,e),this._rctx.screen.draw(),s.release()}};const A6t=1e4,Qie=100,M6t=500,O6t=500,P6t=.1;function R6t(t,e,i){return jle(e,t)*(i[1]-i[0])+i[0]}function I6t(t,e,i){let r=0;if(!e.some(s=>(r+=s.numGeometries,r>=A6t)))return U6t.compute(t,e);const n=f6();return i.forAll(s=>N5(n,$6t(t,s))),n}function $6t(t,e){if(!e.visible)return;const i=f6(),r=e.getSpatialQueryAccelerator();return r?L6t(i,t,r):D6t(i,t,e.objects),i}function L6t(t,e,i){const r=e.eye,n=e.viewForward,s=e.frustum,o=c=>c.visible,l=i.objectCount;if(l{ere(t,e,c),hf.far=t.near,f.setRange(hf)},s,o),QL(hf,Math.max(t.far,e.near),e.far),i.forEachInDepthRange(r,n,_m.DepthOrder.BACK_TO_FRONT,hf,(c,f)=>{ere(t,e,c),hf.near=t.far,f.setRange(hf)},s,o);else{const c=Math.max(Math.min(l,O6t),Math.ceil(l*P6t)),f=i.findClosest(n,_m.DepthOrder.FRONT_TO_BACK,s,o,c),_=i.findClosest(n,_m.DepthOrder.BACK_TO_FRONT,s,o,c);f&&_&&(dwe(t,e,f.boundingVolumeWorldSpace.bounds),dwe(t,e,_.boundingVolumeWorldSpace.bounds))}}function D6t(t,e,i){VC.clear(),i.forAll(r=>{r.visible&&r.geometries.length!==0&&VC.add(r)}),VC.empty||(VC.sort(e),QL(hf,e.near,Math.min(t.near,e.far)),VC.forEachInDepthRange(hf,_m.DepthOrder.FRONT_TO_BACK,(r,n)=>{n{t.far=Math.max(t.far,s)}))}function ere(t,e,i){if(!i.visible||!c2(e.frustum,i.boundingVolumeWorldSpace.bounds))return;const r=i.transformation,n=z6t;i.geometries.forEach(s=>{nn(n,r,s.transformation);const o=l5(n);Ake(t,e,s.boundingInfo,n,o)})}function Ake(t,e,i,r,n){if(i==null)return;bt(tu,i.center,r);const{eye:s,viewForward:o}=e,l=o[0]*(tu[0]-s[0])+o[1]*(tu[1]-s[1])+o[2]*(tu[2]-s[2]);if(tu[3]=i.radius*n,!(l-tu[3]>t.near&&l+tu[3]Qie&&i.getChildren())for(const c of i.getChildren())Ake(t,e,c,r,n);else tre.unionDepthRangeWithAABB(t,e.viewProjectionMatrix,r,i.bbMin,i.bbMax)}function dwe(t,e,i){const r=e.eye,n=e.viewForward,s=(i[0]-r[0])*n[0]+(i[1]-r[1])*n[1]+(i[2]-r[2])*n[2];t.near=Math.min(t.near,s-i[3]),t.far=Math.max(t.far,s+i[3])}let N6t=class{constructor(){this._items=new Pi({allocator:e=>e||{object:null,distance:0,near:0,far:0},deallocator:e=>(e.object=null,e.distance=0,e.near=0,e.far=0,e)})}get length(){return this._items.length}get empty(){return this._items.length===0}clear(){this._items.clear()}add(e){this._items.pushNew().object=e}sort(e){const i=e.eye,r=e.viewForward;this._items.forAll(n=>{const s=n.object.boundingVolumeWorldSpace.bounds,o=(s[0]-i[0])*r[0]+(s[1]-i[1])*r[1]+(s[2]-i[2])*r[2];n.distance=o,n.near=o-s[3],n.far=o+s[3]}),this._items.sort((n,s)=>n.distance-s.distance)}forEachInDepthRange(e,i,r){if(i===_m.DepthOrder.FRONT_TO_BACK)for(let n=0;ne.far||r(s.object,s.near,s.far)}else for(let n=this._items.length-1;n>=0;--n){const s=this._items.data[n];s.fare.far||r(s.object,s.near,s.far)}}},F6t=class{constructor(){this._view=Qe(),this._viewProj=Qe(),this._frustum=OL(),this._geometries=new Array,this._near=[],this._far=[],this._nearCandidates=[],this._farCandidates=[],this._looseRange={near:0,far:0}}compute(e,i){this._reset(),Ao(this._view,e.viewMatrix),nn(this._viewProj,e.projectionMatrix,this._view),bU(this._frustum,e.frustum);const r=this._view,n=r[2],s=r[6],o=r[10],l=r[14];i.forAll(T=>T.forEachGeometry(A=>{if(!A.visible||!A.castShadow)return;const M=A.boundingSphere,I=n*M[0]+s*M[1]+o*M[2]+l,L=I-M[3],F=I+M[3];this._geometries.push(A),this._near.push(-F),this._far.push(-L)}));const c=new Fce;if(this._geometries.length===0)return c;for(let T=0;Tc.far&&(c.far=this._near[T]),this._near[T]>2&&this._far[T]=f.near?c.near=this._near[T]:this._nearCandidates[_++]=T),this._far[T]>c.far&&(this._far[T]<=f.far?c.far=this._far[T]:this._farCandidates[x++]=T);if(this._nearCandidates.length===0&&this._farCandidates.length===0)return c;this._nearCandidates.sort((T,A)=>this._near[T]this._near[A]?1:0),this._farCandidates.sort((T,A)=>this._far[T]this._far[A]?-1:0);for(let T=0;Tc.far){const M=this._geometries[A],I=M.boundingInfo;this._includeFarBoundingInfoRec(I,M.shaderTransformation,c)}}return this._reset(),c}_reset(){this._geometries.length=0,this._near.length=0,this._far.length=0,this._nearCandidates.length=0,this._farCandidates.length=0}_includeNearBoundingInfoRec(e,i,r){if(e==null)return;const n=e.center;bt(tu,n,i);const s=l5(i),o=tu[0],l=tu[1],c=tu[2],f=e.radius*s,_=this._frustum;if(_[0][0]*o+_[0][1]*l+_[0][2]*c+_[0][3]>f||_[1][0]*o+_[1][1]*l+_[1][2]*c+_[1][3]>f||_[2][0]*o+_[2][1]*l+_[2][2]*c+_[2][3]>f||_[3][0]*o+_[3][1]*l+_[3][2]*c+_[3][3]>f)return;const x=this._view[2]*o+this._view[6]*l+this._view[10]*c+this._view[14],T=x+f;if(!(-(x-f)<2||-T>=r.near))if(-T>this._looseRange.near)r.near=-T;else{if(f>Qie){const A=e.getChildren();if(A!==void 0){for(const M of A)this._includeNearBoundingInfoRec(M,i,r);return}}tre.unionDepthRangeWithAABB(r,this._viewProj,i,e.bbMin,e.bbMax)}}_includeFarBoundingInfoRec(e,i,r){if(e==null)return;let n=e.radius;const s=e.center;bt(tu,s,i);const o=l5(i),l=tu[0],c=tu[1],f=tu[2];n*=o;const _=this._frustum;if(_[0][0]*l+_[0][1]*c+_[0][2]*f+_[0][3]>n||_[1][0]*l+_[1][1]*c+_[1][2]*f+_[1][3]>n||_[2][0]*l+_[2][1]*c+_[2][2]*f+_[2][3]>n||_[3][0]*l+_[3][1]*c+_[3][2]*f+_[3][3]>n)return;const x=this._view[2]*l+this._view[6]*c+this._view[10]*f+this._view[14]-n;if(!(-x<=r.far))if(-xQie){const T=e.getChildren();if(T!==void 0){for(const A of T)this._includeFarBoundingInfoRec(A,i,r);return}}tre.unionDepthRangeWithAABB(r,this._viewProj,i,e.bbMin,e.bbMax)}}},k6t=class{constructor(){this._modelViewProj=Qe(),this._clipPosition=[Xi(),Xi(),Xi(),Xi(),Xi(),Xi(),Xi(),Xi()]}unionDepthRangeWithAABB(e,i,r,n,s){const o=this._modelViewProj;nn(o,i,r);let l=!1;for(let c=0;c<8;++c){const f=this._clipPosition[c],_=c===0||c===3||c===4||c===7?n[0]:s[0],x=c===0||c===1||c===4||c===5?n[1]:s[1],T=c<4?n[2]:s[2];f[0]=o[0]*_+o[4]*x+o[8]*T+o[12],f[1]=o[1]*_+o[5]*x+o[9]*T+o[13],f[2]=o[2]*_+o[6]*x+o[10]*T+o[14],f[3]=o[3]*_+o[7]*x+o[11]*T+o[15]}for(let c=0;c<12;++c){const f=this._clipPosition[DY[c][0]],_=this._clipPosition[DY[c][1]],x=this._clipPosition[DY[c][2]],T=this._clipTriangle(f,_,x);let A=!0;for(let M=0;M=2){A=!1;break}if(!A){l=!0;for(let M=0;M=-e[3]:i===1?e[1]>=-e[3]:i===2?e[0]<=e[3]:i===3?e[1]<=e[3]:void Xt(!1)}_intersect(e,i,r){let n=0;return r===0?n=(-e[3]-e[0])/(i[0]-e[0]+i[3]-e[3]):r===1?n=(-e[3]-e[1])/(i[1]-e[1]+i[3]-e[3]):r===2?n=(e[3]-e[0])/(i[0]-e[0]-i[3]+e[3]):r===3&&(n=(e[3]-e[1])/(i[1]-e[1]-i[3]+e[3])),_B(Xi(),e,i,n)}_clipTriangle(e,i,r){let n=[e,i,r];for(let s=0;s<4;++s){const o=n;n=[];for(let l=0;lG6t(e,i))),t.varyings.add("vUV","vec2"),t.vertex.code.add(V`void main(void) { +vUV = position; +gl_Position = vec4(drawPosition.xy + vec2(position - 0.5) * drawPosition.zw, 0.0, 1.0); +}`),t.fragment.uniforms.add(new Zt("textureInput",e=>e.textures.input)),t.fragment.uniforms.add(new Zt("textureMask",e=>e.textures.mask)),t.fragment.uniforms.add(new Zt("textureOverlay",e=>e.textures.overlay)),t.fragment.uniforms.add(new Oy("maskEnabled",e=>e.magnifier.maskEnabled)),t.fragment.uniforms.add(new Oy("overlayEnabled",e=>e.magnifier.overlayEnabled)),t.fragment.code.add(V`const float barrelFactor = 1.1; +vec2 barrel(vec2 uv) { +vec2 uvn = uv * 2.0 - 1.0; +if (uvn.x == 0.0 && uvn.y == 0.0) { +return vec2(0.5, 0.5); +} +float theta = atan(uvn.y, uvn.x); +float r = pow(length(uvn), barrelFactor); +return r * vec2(cos(theta), sin(theta)) * 0.5 + 0.5; +} +void main() { +float mask = maskEnabled ? texture(textureMask, vUV).a : 1.0; +vec4 inputColor = texture(textureInput, barrel(vUV)) * mask; +vec4 overlayColor = overlayEnabled ? texture(textureOverlay, vUV) : vec4(0); +fragColor = overlayColor + (1.0 - overlayColor.a) * inputColor; +}`),t}function G6t(t,e){const i=e.camera.pixelRatio,r=t.magnifier.offset.x*i,n=t.magnifier.offset.y*i;dm(t.magnifier.position,pwe);const s=e.camera.screenToRender(pwe,H6t),o=Math.ceil(i*t.magnifier.size),l=e.camera.fullWidth,c=e.camera.fullHeight;return rs(q6t,(s[0]+r)/l*2-1,(s[1]-n)/c*2-1,o/l*2,o/c*2)}const pwe=ss(),H6t=gse(),q6t=Xi();async function W6t(t){const e=we(()=>import("./mask-svg-t31ntHky.js"),__vite__mapDeps([])),i=we(()=>import("./overlay-svg-nrczOnQN.js"),__vite__mapDeps([])),r=C_((await e).default,{signal:t}),n=C_((await i).default,{signal:t}),s={mask:await r,overlay:await n};return St(t),s}let JA=class extends ze{constructor(){super(...arguments),this._magnifier=null,this._imageSources=null,this._imageLoadTask=null,this._resources=null,this._passParameters=new B6t,this.events=new Dn,this.attributeLocations=new Map([[J.POSITION,0]]),this._tmpScreenPoint=ss(),this._tmpRenderPoint=gse()}get updating(){return this._imageSources==null&&this._imageLoadTask!=null&&!this._imageLoadTask.task.finished}get magnifier(){return this._magnifier}set magnifier(e){if(e===this._magnifier)return;this.removeAllHandles(),this._magnifier=e;const i=()=>{this._updateResourceLoading(),this.events.emit("request-render")};this._magnifier!=null&&this.addHandles(_e(()=>{var r;return(r=this._magnifier)==null?void 0:r.version},i)),i()}get enabled(){return this._validMagnifier!=null}get _validMagnifier(){return this._magnifier!=null&&this._magnifier.visible&&this._magnifier.position!=null&&this._magnifier.size>0?this._magnifier:null}get _factor(){return this._magnifier!=null&&this._magnifier.factor||1}destroy(){this._magnifier=null,this._imageLoadTask!=null&&(this._imageLoadTask.task.abort(),this._imageLoadTask=null),this._disposeResources()}render(e,i){const r=this._validMagnifier;if(r==null)return;const n=i.camera.pixelRatio,s=Math.ceil(n*r.size);if(this._updateResources(e,s),this._resources==null)return;const o=this._passParameters.textures,l=Math.ceil(1/this._factor*s);o.input.resize(l,l),dm(r.position,this._tmpScreenPoint);const c=i.camera.screenToRender(this._tmpScreenPoint,this._tmpRenderPoint),f=i.camera.fullWidth,_=i.camera.fullHeight,x=.5*l,T=.5*l;c[0]=Je(c[0],x,f-x-1),c[1]=Je(c[1],T,_-T-1);const A=Math.floor(c[0]-x),M=Math.floor(c[1]-T),I=this._resources.program;I.bindTexture("textureInput",o.input),e.gl.copyTexImage2D(o.input.descriptor.target,0,o.input.descriptor.pixelFormat,A,M,l,l,0),this._passParameters.magnifier=r,e.useProgram(I),I.bindPass(this._passParameters,i),e.bindVAO(this._resources.vao),e.setPipelineState(this._resources.pipelineState),e.drawArrays(sr.TRIANGLE_STRIP,0,4)}_updateResourceLoading(){const e=this._validMagnifier;if(e==null)return;const i=e.maskUrl,r=e.overlayUrl;this._imageLoadTask==null||this._imageLoadTask.maskUrl===i&&this._imageLoadTask.overlayUrl===r||(this._imageLoadTask.task.abort(),this._imageLoadTask=null,this._imageSources=null),this._imageSources==null&&this._imageLoadTask==null&&(this._imageLoadTask={maskUrl:i,overlayUrl:r,task:Cc(async n=>{const s=i==null||r==null?W6t(n):null,o=i!=null?C_(i,{signal:n}):s.then(c=>c.mask),l=r!=null?C_(r,{signal:n}):s.then(c=>c.overlay);this._imageSources={mask:await o,overlay:await l},this._disposeResources(),this.events.emit("request-render")})},this._imageLoadTask.task.promise.then(()=>this.notifyChange("updating"),()=>this.notifyChange("updating")))}_updateResources(e,i){if(!this.enabled)return void this._disposeResources();if(this._resources!=null){if(this._passParameters.textures.size!==i){const n=this._createTextureResources(e,i);if(n==null)return void this._disposeResources();this._disposeTextureResources(this._passParameters.textures),this._passParameters.textures=n}return}const r=this._createTextureResources(e,i);r!=null&&(this._resources={program:this._createProgram(e),vao:u1(e,yae,this.attributeLocations,0,1),pipelineState:Ti({blending:hd(st.ONE,st.ONE_MINUS_SRC_ALPHA),depthTest:null,depthWrite:null,colorWrite:ji})},this._passParameters.textures=r)}_disposeResources(){this._resources!=null&&(this._disposeTextureResources(this._passParameters.textures),this._resources.program.dispose(),this._resources.vao.dispose(),this._resources=null)}_disposeTextureResources(e){e.mask.dispose(),e.overlay.dispose(),e.input.dispose()}_createTextureResources(e,i){if(this._imageSources==null)return null;this._imageSources.overlay.width=i,this._imageSources.overlay.height=i,this._imageSources.mask.width=i,this._imageSources.mask.height=i;const r=new tn;r.internalFormat=ci.RGBA,r.wrapMode=Bi.CLAMP_TO_EDGE,r.flipped=!0,r.preMultiplyAlpha=!gEe(this._imageSources.overlay.src)||!e.driverTest.svgPremultipliesAlpha.result;const n=new Ai(e,r,this._imageSources.overlay);r.pixelFormat=r.internalFormat=ci.ALPHA,r.preMultiplyAlpha=!1;const s=new Ai(e,r,this._imageSources.mask);return r.pixelFormat=r.internalFormat=ci.RGBA,r.flipped=!1,{input:new Ai(e,r),mask:s,overlay:n,size:i}}_createProgram(e){return new Ir(e,j6t(),this.attributeLocations)}};y([w()],JA.prototype,"_imageSources",void 0),y([w()],JA.prototype,"_imageLoadTask",void 0),y([w({readOnly:!0})],JA.prototype,"updating",null),JA=y([Z("esri/views/3d/webgl-engine/lib/MagnifierHelper")],JA);let Y6t=class{constructor(){this.declaredClass="esri.views.3d.webgl-engine.lib.ObjectAndLayerIdRenderHelper",this.colorZero=new Ac(new ArrayBuffer(4)),this._uidToRenderColor=new Map,this._colorToUID=new Map,this._layerUidToGraphicsUidToObjectId=new Map,this._layerUidToId=new Map,this._layerUidToPopupEnabled=new Map}setUidToObjectAndLayerId(e,i,r,n,s,o=null,l=null,c=null){if(!(e&&i&&r&&n)||(this._layerUidToId.set(n,r),this._layerUidToPopupEnabled.set(n,s),!s))return;let f=this._layerUidToGraphicsUidToObjectId.get(n);f||(f=new Map,this._layerUidToGraphicsUidToObjectId.set(n,f)),f.set(i,{objectId:e,attributeNodeId:o,attributeIndex:l,subLayerId:c})}getObjectAndLayerIdColor(e){const i=this.getObjectAndLayerIdColorArray(e);return Mi(i.get(0,1),i.get(0,2),i.get(0,3),255)}getObjectAndLayerIdColorArray(e){if(!e.layerUid||!e.graphicUid)return this.colorZero;const i=this._layerUidToPopupEnabled.get(e.layerUid);if(i===void 0)return Ce.getLogger(this).warn("popupEnabled is undefined for layerUid "+e.layerUid),this.colorZero;if(i===!1)return this.colorZero;let r=this._uidToRenderColor.get(e.layerUid);r||(r=new Map,this._uidToRenderColor.set(e.layerUid,r));let n=r.get(e.graphicUid);if(!n){for(;!n;){const o=Math.floor(16777214*Math.random())+1;this._colorToUID.has(o)||(n=o)}if(n>16777215)throw new Error("Object ID Overflow");r.set(e.graphicUid,n),this._colorToUID.set(n,e)}const s=new ArrayBuffer(4);return new DataView(s).setUint32(0,n,!1),new Ac(s)}getColorToObjectAndLayerIdMapping(){const e=new Map;for(const[i,r]of this._colorToUID.entries()){const n=this._layerUidToGraphicsUidToObjectId.get(r.layerUid);let s=null;n?(s=n.get(r.graphicUid),s||Ce.getLogger(this).warn("getColorMapping: no entry found for graphicsId "+r.graphicUid)):Ce.getLogger(this).warn("getColorMapping: no entry found for layerUid "+r.layerUid);const o=this._layerUidToId.get(r.layerUid);o||Ce.getLogger(this).warn("no layerId found for uid "+r.layerUid),s&&o&&e.set(i,s.attributeNodeId?{type:"object-and-layer-and-i3s-id",oid:s.objectId,lid:o,attrId:s.attributeNodeId,attrIdx:s.attributeIndex,subLayerId:s.subLayerId}:{type:"object-and-layer-id",oid:s.objectId,lid:o})}return e}};var e9;(function(t){t[t.FrontToBack=0]="FrontToBack",t[t.BackToFront=1]="BackToFront"})(e9||(e9={}));let Ib=class{constructor(e,i,r=e9.FrontToBack){this._rctx=e,this._techniqueRepository=i,this._sorting=r,this._draws=new Pi({initialSize:32,allocator:n=>n||{material:null,geometry:null,geometryRanges:null,bindDrawParams:null,depthSquaredHint:0,indexType:0}}),this._previouslyBoundDraw=new Map}submitDraw(e,i,r,n){const s=this._draws.pushNew();s.geometry=i,s.geometryRanges=r,s.material=e,s.depthSquaredHint=n,s.indexType=(i.indexed?i.vao.indexBuffer.indexType:null)??0}prepare(e,i){return this._draws.map(r=>r.material.prepareTechnique(this._techniqueRepository,e,i,r.geometry.parameters))}dispatch(e,i,r){const n=this._rctx;this._previouslyBoundDraw.clear();let s=null;const o=this._draws.length;for(let l=0;l{const n=e*(i.depthSquaredHint-r.depthSquaredHint);return n!==0?n:i.geometry.vao.byteSize-r.geometry.vao.byteSize})}get count(){return this._draws.length}};const _k=new Map;_k.set(Yt.UNSIGNED_BYTE,1),_k.set(Yt.UNSIGNED_SHORT,2),_k.set(Yt.UNSIGNED_INT,4);let ire=class extends kvt{constructor(){super({}),this._passes=null,this.produces=new Map([[ke.OPAQUE_MATERIAL,e=>this._produces(e)],[ke.TRANSPARENT_MATERIAL,e=>!!(this._passes&&this._passes.materialTransparent.count>0)&&this._produces(e)],[ke.INTEGRATED_MESH,e=>this._produces(e)]]),this._materialPassParameters=new wTt,this._shadowPassParameters=new xTt,this._highlightPassParameters=new STt,this._systems=new Set}initializeRenderContext(e){this._context=e;const i=e.renderContext.rctx,r=e.techniqueRepository;this._passes={materialOpaque:new Ib(i,r),materialTransparent:new Ib(i,r,e9.BackToFront),materialIntegratedMesh:new Ib(i,r),shadowMap:new Ib(i,r),highlight:new Ib(i,r),highlightIntegratedMesh:new Ib(i,r),highlightShadowMap:new Ib(i,r),defaultShadowMap:new Ib(i,r)}}get rctx(){return this._context.renderContext.rctx}uninitializeRenderContext(){}dispose(){this._context=null,this._systems.clear()}register(e){this._systems.add(e)}_produces(e){return this._systems.size!==0&&this._passes!==null&&(e===ue.Highlight?this._passes.highlight.count>0||this._passes.highlightIntegratedMesh.count>0:e!==ue.ShadowHighlight||this._passes.highlight.count>0)}prepareRender(e){if(this._systems.size!==0&&this._passes!==null){for(const i of Object.values(this._passes))i.prepareSubmit();this._systems.forEach(i=>i.submit(this._passes,e.bindParameters));for(const i of Object.values(this._passes))i.finishSubmit();this._context.techniqueRepository.frameUpdate()}}prepareTechniques(e){if(this._systems.size===0)return null;const i=e.output===ue.Shadow||e.output===ue.ShadowHighlight||e.output===ue.ShadowExcludeHighlight?this._shadowPassParameters:e.output===ue.Highlight?this._highlightPassParameters:this._materialPassParameters,r=e.bindParameters;return this._updateParameters(r.camera,i,r.slot===ke.TRANSPARENT_MATERIAL),this._materialPassParameters.output=e.output,this._invoke(e,(n,s)=>n.prepare(s,e.bindParameters))}renderNode(e,i){this._invoke(e,(r,n)=>r.dispatch(n,e.bindParameters,i))}_invoke(e,i){if(this._passes===null)return null;switch(e.bindParameters.slot){case ke.OPAQUE_MATERIAL:switch(e.output){case ue.Color:case ue.Depth:case ue.Normal:case ue.ObjectAndLayerIdColor:return i(this._passes.materialOpaque,this._materialPassParameters);case ue.Highlight:return i(this._passes.highlight,this._highlightPassParameters);case ue.Shadow:return i(this._passes.shadowMap,this._shadowPassParameters);case ue.ShadowHighlight:return i(this._passes.highlightShadowMap,this._shadowPassParameters);case ue.ShadowExcludeHighlight:return i(this._passes.defaultShadowMap,this._shadowPassParameters)}break;case ke.TRANSPARENT_MATERIAL:switch(e.output){case ue.Color:case ue.Alpha:case ue.Depth:case ue.Normal:case ue.ObjectAndLayerIdColor:return i(this._passes.materialTransparent,this._materialPassParameters)}break;case ke.INTEGRATED_MESH:switch(e.output){case ue.Color:case ue.Depth:case ue.Normal:case ue.ObjectAndLayerIdColor:return i(this._passes.materialIntegratedMesh,this._materialPassParameters);case ue.Highlight:return i(this._passes.highlightIntegratedMesh,this._highlightPassParameters)}}return null}notifyDirty(){this._context.requestRender()}queryDepthRange(e){const i=new Fce;return this._systems.forEach(r=>N5(i,r.queryShadowCasterDepthRange(e))),i}_updateParameters(e,i,r){const n=e.viewInverseTransposeMatrix;Ie(NY,n[3],n[7],n[11]),FY.set(NY),Ne(i.transformWorldFromViewTH,FY.high),Ne(i.transformWorldFromViewTL,FY.low),Ne(i.slicePlaneLocalOrigin,NY),Yf(i.transformViewFromCameraRelativeRS,e.viewMatrix),Ao(i.transformProjFromView,e.projectionMatrix),i.identifier===Hh.Material&&(this._materialPassParameters.transparent=r,Xf(fwe,i.transformViewFromCameraRelativeRS),_E(i.transformNormalViewFromGlobal,fwe))}};ire=y([Z("esri.views.3d.webgl-engine.core.renderPasses.RenderPassManager")],ire);const NY=W(),fwe=as(),FY=new PG;let X6t=class{constructor(e=null,i=null,r=null){this.composite=e,this.normal=i,this.highlight=r}},bk=class extends ze{constructor(e){super({}),this._context=e,this._renderPlugins=new Pi,this._slots=new Array;for(let i=0;i{if(i!=null&&i.aborted)throw e.uninitializeRenderContext(),ur();this._renderPlugins.push(e),e.produces.forEach((s,o)=>{this._slots[o].push(e)}),this._context.requestRender(),this.notifyChange("updating")},n=e.initializeRenderContext(this._context,i);if(pd(n))return n.then(r);r()}remove(e){if(this._renderPlugins.removeUnordered(e)!=null){for(let i=0;ir!==e);e.uninitializeRenderContext(),this._context.requestRender(),this.notifyChange("updating")}}prepareRender(){this._renderPlugins.forAll(e=>{e.prepareRender&&e.prepareRender(this._context.renderContext)})}updateAnimation(e){let i=!1;return this._renderPlugins.forAll(r=>{r.updateAnimation&&(i=r.updateAnimation(e)||i)}),i}renderFeatureChanged(){this._renderPlugins.forAll(e=>{e.renderFeatureChanged&&e.renderFeatureChanged()})}prepare(e){this._context.renderContext.bindParameters.slot=e,this._slots[e].forEach(i=>{const r=i.produces.get(e);r&&r(ue.Color)&&(mwe(i)&&i.prepareTechnique(this._context.renderContext),gwe(i)&&i.prepareTechniques(this._context.renderContext))})}_getRenderables(e){this._context.renderContext.bindParameters.slot=e;const i=new Map;return this._slots[e].forEach(r=>{const n=r.produces.get(e);if(n&&n(ue.Color)&&(!r.isDecoration||this._context.renderContext.bindParameters.decorations!==Xh.OFF))if(mwe(r)){const s=r.prepareTechnique(this._context.renderContext);s!=null&&i.set(r,s)}else if(gwe(r)){const s=r.prepareTechniques(this._context.renderContext);s!=null&&i.set(r,s)}else i.set(r,null)}),i}render(e,i=null,r=null){return this._getRenderables(e).forEach((n,s)=>r=s.renderNode(this._context.renderContext,n,i,r)),r}renderComposition(e,i){const r=this._getRenderables(e);let n=null;return r.forEach((s,o)=>{const l=o.renderNode(this._context.renderContext,s,i,null);n==null||n.release(),n=l,i.composite=n}),n}queryDepthRange(e){const i=new Fce;return this._renderPlugins.forAll(r=>{var s;const n=(s=r.queryDepthRange)==null?void 0:s.call(r,e);N5(i,n)}),i}get updating(){return this._renderPlugins.some(e=>e.running)}produces(e,i=ue.Color){return this._slots[e].some(r=>{const n=r.produces.get(e);return!!n&&n(i)})}consumes(e){return this._renderPlugins.some(i=>i.consumes().required.includes(e))}get hasDecorations(){return this._renderPlugins.some(e=>e.isDecoration)}get renderOccludedFlags(){return this._renderPlugins.reduce((e,i)=>e|i.renderOccludedFlags,Wn.None)}get usedMemory(){return this._renderPlugins.reduce((e,i)=>e+(i.usedMemory??0),0)}};function mwe(t){return"prepareTechnique"in t}function gwe(t){return"prepareTechniques"in t}y([w({readOnly:!0})],bk.prototype,"updating",null),bk=y([Z("esri.views.3d.webgl-engine.lib.RenderPluginManager")],bk);let KA=class extends CE{constructor(e){super(e),this._context=null,this.opacity=1,this.alphaMode=yc.None,this._blitConfiguration=new _V,this._blitParameters=new RG,this.produces=new Map([[ke.BLIT,()=>this._context!=null]])}consumes(){return RLe}initializeRenderContext(e){this._context=e}uninitializeRenderContext(){this._context=null}destroy(){}renderNode(e,i,r,n){var l;const s=(l=r==null?void 0:r.composite)==null?void 0:l.colorTexture;if(!this._context||!s)return n;const o=this._context.techniqueRepository.acquire(Vce,this._blitConfiguration);return o!=null&&o.compiled?(e.rctx.bindFramebuffer(n==null?void 0:n.fbo),this._blitParameters.texture=s,this._blitParameters.opacity=this.opacity,e.rctx.bindTechnique(o,this._blitParameters,e.bindParameters),e.rctx.screen.draw(),o.release(),n):(this._context.requestRender(),n)}};y([w()],KA.prototype,"_context",void 0),y([w()],KA.prototype,"opacity",void 0),y([w()],KA.prototype,"alphaMode",void 0),KA=y([Z("esri.views.3d.webgl-engine.effects.blit.Blit")],KA);let Gce=class extends _n{};function Mke(){const t=new Cr,{outputs:e,fragment:i}=t;return t.include(Pc),i.uniforms.add(new $f("textureInput",r=>r.input)),i.constants.add("outlineSize","int",Math.ceil(IG/2)),e.add("fragGrid","vec2"),i.code.add(V` + void main() { + float red = 0.0; + float green = 1.0; + int cellSize = ${V.int(tm)}; + vec2 texelSize = 1.0 / vec2(textureSize(textureInput, 0)); + vec2 offset = floor(gl_FragCoord.xy) * vec2(float(cellSize)); + + for(int x = -outlineSize; x < cellSize + outlineSize; x += 2) { + for(int y = -outlineSize; y < cellSize + outlineSize; y += 2) { + vec2 coord = (offset + vec2(float(x), float(y))) * texelSize; + vec4 value = texture(textureInput, coord); + float mx = floor(max(value.g, value.b)); + + red = max(red, ceil(value.r)); + green = min(green, mx); + if(red == 1.0 && green == 0.0) { + fragGrid = vec2(red, green); + return; + } + } + } + fragGrid = vec2(red, green); + }`),t}const tm=32,IG=9,Hce=.4,Z6t=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:Gce,blurSize:Hce,build:Mke,gridCellPixelSize:tm,outlineSize:IG},Symbol.toStringTag,{value:"Module"}));function Oke(){const t=new Cr,{vertex:e,fragment:i}=t,r=e.code,n=i.code;return t.attributes.add(J.POSITION,"vec2"),t.varyings.add("uv","vec2"),t.attributes.add(J.UV0,"vec2"),e.uniforms.add(new Zt("coverageTex",s=>s.coverageTexture),new ln("coverageRounding",s=>s.coverageRounding)),r.add(V`void main() { +vec4 cov = texture(coverageTex, uv0 * coverageRounding); +if (cov.r == 0.0) { +gl_Position = vec4(0.0); +return; +} +gl_Position = vec4(position, 0.0, 1.0); +uv = position.xy * 0.5 + vec2(0.5); +}`),i.uniforms.add(new Zt("tex",s=>s.blurTexture),new Zt("highlightTexture",s=>s.highlightTexture),new gr("uColor",s=>s.color),new gr("haloColor",s=>s.haloColor),new gr("opacities",s=>rs(J6t,s.haloOpacity,s.haloOpacityOccluded,s.fillOpacity,s.fillOpacityOccluded))),i.constants.add("outlineSize","float",IG),i.constants.add("blurSize","float",Hce),n.add(V`void main() { +vec4 blurredHighlightValue = texture(tex, uv); +float highlightIntensity = blurredHighlightValue.a; +if (highlightIntensity == 0.0) { +discard; +} +vec4 origin_color = texture(highlightTexture, uv); +float outlineIntensity; +float fillIntensity; +if (blurredHighlightValue.g > blurredHighlightValue.b) { +outlineIntensity = haloColor.w * opacities[1]; +fillIntensity = uColor.w * opacities[3]; +} +else { +outlineIntensity = haloColor.w * opacities[0]; +fillIntensity = uColor.w * opacities[2]; +} +float inner = 1.0 - (outlineSize - blurSize) / outlineSize; +float outlineFactor = smoothstep(0.0, inner, highlightIntensity); +float fillFactor = any(notEqual(origin_color, vec4(0.0, 0.0, 0.0, 0.0))) ? 1.0 : 0.0; +float intensity = outlineIntensity * outlineFactor * (1.0 - fillFactor) + fillIntensity * fillFactor; +fragColor = vec4(mix(haloColor.rgb, uColor.rgb, fillFactor), intensity); +}`),t}const J6t=Xi(),K6t=Object.freeze(Object.defineProperty({__proto__:null,build:Oke},Symbol.toStringTag,{value:"Module"}));let Pke=class Rke extends Hr{initializeProgram(e){return new Ir(e.rctx,Rke.shader.get().build(),Er)}initializePipeline(){return Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji})}};Pke.shader=new Rr(K6t,()=>we(()=>Promise.resolve().then(()=>jWt),void 0));let qce=class extends _n{constructor(){super(...arguments),this.blurSize=yt()}};function Ike(){const t=new Cr,{attributes:e,varyings:i,vertex:r,fragment:n}=t;return e.add(J.POSITION,"vec2"),e.add(J.UV0,"vec2"),i.add("blurCoordinate","vec3"),r.uniforms.add(new Zt("coverageTex",s=>s.coverageTexture),new ln("coverageRounding",s=>s.coverageRounding)),r.code.add(V`void main() { +gl_Position = vec4(position, 0.0, 1.0); +vec4 cov = texture(coverageTex, uv0 * coverageRounding); +if (cov.r == 0.0) { +gl_Position = vec4(0.0); +} +blurCoordinate = vec3(gl_Position.xy * 0.5 + vec2(0.5), cov.g); +}`),n.uniforms.add(new rDe("blurSize",s=>s.blurSize),new $f("tex",s=>s.blurInputTexture)),n.code.add(V`void main() { +vec2 uv = blurCoordinate.xy; +vec4 center = texture(tex, uv); +if (blurCoordinate.z == 1.0) { +fragColor = center; +} else { +vec4 sum = center * 0.204164; +sum += texture(tex, uv + blurSize * 1.407333) * 0.304005; +sum += texture(tex, uv - blurSize * 1.407333) * 0.304005; +sum += texture(tex, uv + blurSize * 3.294215) * 0.093913; +sum += texture(tex, uv - blurSize * 3.294215) * 0.093913; +fragColor = sum; +} +}`),t}const Q6t=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:qce,build:Ike},Symbol.toStringTag,{value:"Module"}));let $ke=class Lke extends Hr{initializeProgram(e){return new Ir(e.rctx,Lke.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};$ke.shader=new Rr(Q6t,()=>we(()=>Promise.resolve().then(()=>GWt),void 0));let Dke=class Nke extends Hr{initializeProgram(e){return new Ir(e.rctx,Nke.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};Dke.shader=new Rr(Z6t,()=>we(()=>Promise.resolve().then(()=>HWt),void 0));let eDt=class extends _n{constructor(){super(...arguments),this.color=Mi(1,0,1,1),this.haloColor=Mi(1,0,1,1),this.haloOpacity=1,this.haloOpacityOccluded=.25,this.fillOpacity=.2,this.fillOpacityOccluded=.05,this.coverageRounding=Ji(1,1)}},EI=class extends CE{constructor(e){super(e),this._context=null,this._passParameters=new eDt,this._downsampleDrawParameters=new Gce,this._blurDrawParameters=new qce,this._blurColorFormat=Le("mac")?xr.RGBA:xr.RGBA4,this._grid={coverage:null,vao:null,verticalCellCount:0,horizontalCellCount:0,viewportWidth:0,viewportHeight:0},this.produces=new Map([[ke.HIGHLIGHT,()=>!0]])}consumes(){return ILe}initializeRenderContext(e){this._context=e,this._blurTechnique==null&&(this._blurTechnique=this._context.techniqueRepository.acquire($ke)),this._downsampleTechnique==null&&(this._downsampleTechnique=this._context.techniqueRepository.acquire(Dke)),this._applyTechnique==null&&(this._applyTechnique=this._context.techniqueRepository.acquire(Pke)),this.addHandles([_e(()=>this.view.highlightOptions.color,i=>{this._passParameters.color=AL(i??U7e),this.view.highlightOptions.haloColor||(this._passParameters.haloColor=this._passParameters.color),this._context.requestRender()},kt),_e(()=>this.view.highlightOptions.haloColor,i=>{this._passParameters.haloColor=i!=null?AL(i):this._passParameters.color,this._context.requestRender()},kt),_e(()=>this.view.highlightOptions.haloOpacity,i=>{this._passParameters.haloOpacity=i??V7e,this._passParameters.haloOpacityOccluded=.25*this._passParameters.haloOpacity,this._context.requestRender()},kt),_e(()=>this.view.highlightOptions.fillOpacity,i=>{this._passParameters.fillOpacity=i??B7e,this._passParameters.fillOpacityOccluded=.25*this._passParameters.fillOpacity,this._context.requestRender()},kt)])}uninitializeRenderContext(){this._context=null}dispose(){this._blurTechnique=ir(this._blurTechnique),this._downsampleTechnique=ir(this._downsampleTechnique),this._applyTechnique=ir(this._applyTechnique),this._grid.coverage=ir(this._grid.coverage),this._grid.vao=Kt(this._grid.vao)}renderNode(e,i,r,n){var U,j;const s=(U=r==null?void 0:r.highlight)==null?void 0:U.colorTexture;if(!this._context||!s)return;if(!(this._blurTechnique.compiled&&this._downsampleTechnique.compiled&&this._applyTechnique.compiled))return void this._context.requestRender();const o=e.bindParameters.camera,l=o.fullWidth,c=o.fullHeight,f=o.pixelRatio,_=Math.ceil(l/f),x=Math.ceil(c/f),T=this._context.fbos,A=T.rctx;this._gridUpdateResources(s),this._gridComputeCoverage(s,e.bindParameters),this._passParameters.highlightTexture=s,this._passParameters.coverageTexture=(j=this._grid.coverage)==null?void 0:j.colorTexture;const{width:M,height:I}=s.descriptor;or(this._passParameters.coverageRounding,M/(Math.ceil(M/tm)*tm),I/(Math.ceil(I/tm)*tm));const L=A.bindTechnique(this._blurTechnique,this._passParameters,e.bindParameters),F=this._grid.vao;A.bindVAO(F);const z=T.acquire(this._blurColorFormat,_,x);A.bindFramebuffer(z.fbo),A.setViewport(0,0,_,x),A.clear(In.COLOR_BUFFER_BIT),this._blurDrawParameters.blurInputTexture=s,or(this._blurDrawParameters.blurSize,1/_,0),L.bindDraw(this._blurDrawParameters,e.bindParameters,this._passParameters),A.drawArrays(this._blurTechnique.primitiveType,0,Kv(F,"geometry"));const k=T.acquire(this._blurColorFormat,_,x);A.bindFramebuffer(k.fbo),A.clear(In.COLOR_BUFFER_BIT),this._blurDrawParameters.blurInputTexture=z.colorTexture,or(this._blurDrawParameters.blurSize,0,1/x),L.bindDraw(this._blurDrawParameters,e.bindParameters,this._passParameters),A.drawArrays(this._blurTechnique.primitiveType,0,Kv(F,"geometry")),A.bindFramebuffer(n==null?void 0:n.fbo),A.setViewport4fv(o.fullViewport),this._passParameters.blurTexture=k.colorTexture,A.bindTechnique(this._applyTechnique,this._passParameters,e.bindParameters),A.drawArrays(this._applyTechnique.primitiveType,0,Kv(F,"geometry")),k.release(),z.release()}_gridUpdateResources(e){var T;if(!this._context)return;const i=this._context.fbos.rctx,r=this._grid,n=Math.ceil(e.descriptor.height/tm),s=Math.ceil(e.descriptor.width/tm);if(r.vao&&r.verticalCellCount===n&&r.horizontalCellCount===s)return;r.verticalCellCount=n,r.horizontalCellCount=s;const o=n+1,l=s+1,c=1/n,f=1/s,_=new Float32Array(6*4*o*l);let x=0;for(let A=0;An.shadowMap.getSnapshot(I5.Default)),new Zt("highlightDepthTex",(r,n)=>n.shadowMap.getSnapshot(I5.Highlight)),new Zt("depthMap",(r,n)=>{var s;return(s=n.linearDepth)==null?void 0:s.colorTexture}),new Zt("highlightTexture",r=>r.highlight),new gr("uColor",r=>r.shadowColor),new ln("nearFar",(r,n)=>n.camera.nearFar),new ft("opacity",r=>r.shadowOpacity),new ft("occludedOpacity",r=>r.occludedShadowOpacity),new ft("terminationFactor",r=>r.opacityElevation*r.dayNightTerminator),new Oi("lightingMainDirectionView",(r,n)=>Ye(vwe,bt(vwe,n.lighting.mainLight.direction,n.camera.viewInverseTransposeMatrix))),new _s("inverseViewMatrix",(r,n)=>Vo(ywe,Qu(ywe,n.camera.viewMatrix,n.camera.center)))),i.constants.add("unoccludedHighlightFlag","vec4",ble),i.code.add(V` + vec3 normalFromDepth(vec3 pixelPos, vec2 fragCoord, ivec2 iuv) { + float leftPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(-1, 0), 0), nearFar); + float rightPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(1, 0), 0), nearFar); + float bottomPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(0, -1), 0), nearFar); + float topPixelDepth = linearDepthFromRGBA(texelFetch(depthMap, iuv + ivec2(0, 1), 0), nearFar); + + bool pickLeft = abs(pixelPos.z - leftPixelDepth) < abs(pixelPos.z - rightPixelDepth); + bool pickBottom = abs(pixelPos.z - bottomPixelDepth) < abs(pixelPos.z - topPixelDepth); + + vec3 fragCoordHorizontal = pickLeft + ? vec3(fragCoord + vec2(-1.0, 0.0), leftPixelDepth) + : vec3(fragCoord + vec2(1.0, 0.0), rightPixelDepth); + vec3 fragCoordVertical = pickBottom + ? vec3(fragCoord + vec2(0.0, -1.0), bottomPixelDepth) + : vec3(fragCoord + vec2(0.0, 1.0), topPixelDepth); + + vec3 verticalPixelPos = reconstructPosition(fragCoordHorizontal.xy, fragCoordHorizontal.z); + vec3 horizontalPixelPos = reconstructPosition(fragCoordVertical.xy, fragCoordVertical.z); + + vec3 normal = normalize(cross(verticalPixelPos - pixelPos, horizontalPixelPos - pixelPos)); + // Flip normal depending on triangle winding order for consistency + return pickLeft == pickBottom ? normal : -normal; + } + + void main(void) { + vec4 highlightInfo = texture(highlightTexture, uv); + float visiblyHighlighted = (1.0 - clamp(distance(unoccludedHighlightFlag, highlightInfo), 0.0, 1.0)) * highlightInfo.a; + if (visiblyHighlighted > ${V.float(tDt)}) { + discard; + } + + ivec2 iuv = ivec2(uv * vec2(textureSize(depthMap, 0))); + float depth = rgba2float(texelFetch(depthMap, iuv, 0)); + // 0.0 is the clear value of depthMap, which means nothing has been drawn there and we should discard + if (depth == 0.0) { + discard; + } + + float currentPixelDepth = linearDepthFromFloat(depth, nearFar); + + if (-currentPixelDepth>nearFar.y || -currentPixelDepth= numCascades) { + discard; + } + + vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix); + + // vertex completely outside? -> no shadow + if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { + discard; + } + + ivec2 texSize = textureSize(highlightDepthTex, 0); + ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize)); + + float depthHighlight = readShadowMapDepth(uvShadow, highlightDepthTex); + bool shadowHighlight = depthHighlight < lvpos.z; + + if (!shadowHighlight) { + discard; + } + + float depthDefault = readShadowMapDepth(uvShadow, defaultDepthTex); + bool shadowDefault = depthDefault < lvpos.z; + + vec3 normal = normalFromDepth(currentPixelPos.xyz, gl_FragCoord.xy, iuv); + bool shaded = dot(normal, lightingMainDirectionView) < ${V.float(iDt)}; + + float fragOpacity = (shadowDefault || shaded) ? occludedOpacity : opacity; + fragColor = vec4(uColor.rgb, uColor.a * fragOpacity * terminationFactor); + } + `),e}const ywe=Qe(),vwe=W(),rDt=Object.freeze(Object.defineProperty({__proto__:null,build:Fke},Symbol.toStringTag,{value:"Module"}));let nDt=class extends Ole{constructor(){super(...arguments),this.shadowColor=Mi(1,0,1,1),this.shadowOpacity=.2,this.occludedShadowOpacity=.1,this.opacityElevation=1,this.dayNightTerminator=1}},kke=class zke extends Hr{constructor(e){super(e,new Wce,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,zke.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:Ol(st.SRC_ALPHA,st.ONE,st.ONE_MINUS_SRC_ALPHA,st.ONE_MINUS_SRC_ALPHA),colorWrite:ji,depthTest:null,depthWrite:null})}get primitiveType(){return sr.TRIANGLE_STRIP}};kke.shader=new Rr(rDt,()=>we(()=>Promise.resolve().then(()=>qWt),void 0));const sDt=.001953125,oDt=4e4,aDt=5e4;let QA=class extends CE{constructor(e){super(e),this._maxOpacity=1,this._passParameters=new nDt,this._drawParameters=new D3t,this._shadowDifference=.2,this._context=null,this.produces=new Map([[ke.SHADOW_HIGHLIGHT,()=>this._isVisible]])}consumes(){return ILe}initializeRenderContext(e){this._context=e,this.addHandles([_e(()=>this.view.highlightOptions.shadowOpacity,i=>{this._passParameters.shadowOpacity=i??G7e,this._updateOccludedShadowOpacity(),this._updateMaxOpacity()},kt),_e(()=>this.view.highlightOptions.shadowDifference,i=>{this._shadowDifference=i??H7e,this._updateOccludedShadowOpacity(),this._updateMaxOpacity()},kt),_e(()=>this.view.highlightOptions.shadowColor,i=>{this._passParameters.shadowColor=AL(i??j7e),this._updateMaxOpacity()},kt)])}_updateOccludedShadowOpacity(){this._passParameters.occludedShadowOpacity=this._passParameters.shadowOpacity*(1-this._shadowDifference)}_updateMaxOpacity(){const e=Math.max(this._passParameters.shadowOpacity,this._passParameters.occludedShadowOpacity);this._maxOpacity=e*this._passParameters.shadowColor[3]}uninitializeRenderContext(){this._context=null}enable(){this._context&&this._technique==null&&(this._technique=this._context.techniqueRepository.acquire(kke))}renderNode(e,i,r,n){var f,_;const s=(f=r==null?void 0:r.highlight)==null?void 0:f.colorTexture;if(!(this._context&&r&&s&&this._isVisible))return;if(!((_=this._technique)!=null&&_.compiled))return void this._context.requestRender();const o=e.bindParameters;if(!o.shadowMap.enabled||!o.linearDepth)return;const l=e.rctx,c=this._technique;this._passParameters.highlight=s,this._drawParameters.origin=o.camera.center,l.bindFramebuffer(n==null?void 0:n.fbo),l.bindTechnique(c,this._passParameters,o).bindDraw(this._drawParameters,o,this._passParameters),l.screen.draw()}updateParameters(e,i){this._passParameters.opacityElevation=1-pL(oDt,aDt,e.relativeElevation);const r=this.viewingMode===_t.Global?Ye(_we,e.center):Ie(_we,0,0,1),n=Ve(r,i);this._passParameters.dayNightTerminator=pL(0,1,Je(30*n,0,1)),this._isVisible&&this.enable()}get _isVisible(){const{opacityElevation:e,dayNightTerminator:i}=this._passParameters;return this._maxOpacity*e*i>=sDt}};y([w()],QA.prototype,"_context",void 0),y([w()],QA.prototype,"view",void 0),y([w()],QA.prototype,"viewingMode",void 0),QA=y([Z("esri.views.3d.webgl-engine.effects.highlight.ShadowHighlight")],QA);const _we=W(),BC={maxSearchSteps:8,maxDistanceAreaTex:16};function Uke(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("edgesTexture",e=>e.inputTexture)),t.fragment.uniforms.add(new Zt("areaTexture",e=>e.areaTexture)),t.fragment.uniforms.add(new Zt("searchTexture",e=>e.searchTexture)),t.fragment.code.add(V` + #define SMAA_AREATEX_PIXEL_SIZE ( 1.0 / vec2( 160.0, 560.0 ) ) + #define SMAA_AREATEX_SUBTEX_SIZE ( 1.0 / 7.0 ) + + vec4 sampleLevelZeroOffset(sampler2D tex, vec2 coord, vec2 offset, vec2 resolution) { + return texture(tex, coord + offset.x * resolution, 0.0); + } + + float searchLength(sampler2D searchTex, vec2 e, float bias, float scale) { + e.r = bias + e.r * scale; + return 255.0 * texture( searchTex, e, 0.0 ).r; + } + + float searchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { + vec2 e = vec2( 0.0, 1.0 ); + for ( int i = 0; i < ${V.int(BC.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord -= vec2( 2.0, 0.0 ) * resolution; + if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break; + } + texcoord.x += 0.25 * resolution.x; + texcoord.x += resolution.x; + texcoord.x += 2.0 * resolution.x; + texcoord.x -= resolution.x * searchLength(searchTex, e, 0.0, 0.5); + return texcoord.x; + } + + float searchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { + vec2 e = vec2( 0.0, 1.0 ); + for ( int i = 0; i < ${V.int(BC.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord += vec2( 2.0, 0.0 ) * resolution; + if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break; + } + texcoord.x -= 0.25 * resolution.x; + texcoord.x -= resolution.x; + texcoord.x -= 2.0 * resolution.x; + texcoord.x += resolution.x * searchLength( searchTex, e, 0.5, 0.5 ); + return texcoord.x; + } + + float searchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { + vec2 e = vec2( 1.0, 0.0 ); + for ( int i = 0; i < ${V.int(BC.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord += vec2( 0.0, 2.0 ) * resolution; + if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break; + } + texcoord.y -= 0.25 * resolution.y; + texcoord.y -= resolution.y; + texcoord.y -= 2.0 * resolution.y; + texcoord.y += resolution.y * searchLength( searchTex, e.gr, 0.0, 0.5 ); + return texcoord.y; + } + + float searchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end, vec2 resolution ) { + vec2 e = vec2( 1.0, 0.0 ); + for ( int i = 0; i < ${V.int(BC.maxSearchSteps)}; i ++ ) { + e = texture( edgesTex, texcoord, 0.0 ).rg; + texcoord -= vec2( 0.0, 2.0 ) * resolution; + if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break; + } + texcoord.y += 0.25 * resolution.y; + texcoord.y += resolution.y; + texcoord.y += 2.0 * resolution.y; + texcoord.y -= resolution.y * searchLength( searchTex, e.gr, 0.5, 0.5 ); + return texcoord.y; + } + + vec2 getArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) { + vec2 texcoord = float( ${V.int(BC.maxDistanceAreaTex)} ) * round( 4.0 * vec2( e1, e2 ) ) + dist; + texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE ); + texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset; + return texture( areaTex, texcoord, 0.0 ).rg; + } + + void main() { + vec2 size = vec2(textureSize(edgesTexture, 0)); + vec2 resolution = 1.0 / size; + vec2 pixelCoord = uv * size; + vec4 offsets[2]; + offsets[0] = uv.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 ); + offsets[1] = uv.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 ); + vec4 maxOffset = vec4( offsets[0].xz, offsets[1].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( ${V.int(BC.maxSearchSteps)} ); + + ivec4 subsampleIndices = ivec4(0.0); + vec4 weights = vec4(0.0); + vec2 e = texture( edgesTexture, uv ).rg; + if ( e.g > 0.0 ) { + vec2 d; + vec2 coords; + coords.x = searchXLeft( edgesTexture, searchTexture, offsets[0].xy, maxOffset.x, resolution ); + coords.y = offsets[1].y; + d.x = coords.x; + float e1 = texture( edgesTexture, coords, 0.0 ).r; + coords.x = searchXRight( edgesTexture, searchTexture, offsets[0].zw, maxOffset.y, resolution ); + d.y = coords.x; + d = d * size.x - pixelCoord.x; + vec2 sqrt_d = sqrt( abs(d) ); + coords.y -= 1.0 * resolution.y; + float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2( 1.0, 0.0 ), resolution).r; + weights.rg = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.y ) ); + } + + if ( e.r > 0.0 ) { + vec2 d; + vec2 coords; + coords.y = searchYUp( edgesTexture, searchTexture, offsets[1].xy, maxOffset.z, resolution ); + coords.x = offsets[0].x; + d.x = coords.y; + float e1 = texture( edgesTexture, coords, 0.0 ).g; + coords.y = searchYDown( edgesTexture, searchTexture, offsets[1].zw, maxOffset.w, resolution ); + d.y = coords.y; + d = d * size.y - pixelCoord.y; + vec2 sqrt_d = sqrt(abs(d)); + coords.y -= 1.0 * resolution.y; + float e2 = sampleLevelZeroOffset( edgesTexture, coords, vec2(0.0, 1.0), resolution).g; + weights.ba = getArea( areaTexture, sqrt_d, e1, e2, float( subsampleIndices.x ) ); + + // for some reason the following lines are necessary to prevent + // texture lookup precision issues on some Intel integrated graphics chips + vec4 dbg = (offsets[0] + offsets[1] + maxOffset + coords.xyyx); + weights.r += 0.00000001 * dot(vec4(0, 1, 0, 1), dbg); + } + fragColor = weights; + } + `),t}const lDt=Object.freeze(Object.defineProperty({__proto__:null,build:Uke},Symbol.toStringTag,{value:"Module"}));let Vke=class Bke extends Hr{initializeProgram(e){return new Ir(e.rctx,Bke.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};Vke.shader=new Rr(lDt,()=>we(()=>Promise.resolve().then(()=>WWt),void 0));function jke(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("blendWeightsTexture",e=>e.inputTexture),new Zt("colorTexture",e=>e.color)),t.fragment.code.add(V`void main() { +vec2 resolution = 1.0 / vec2(textureSize(colorTexture, 0)); +vec4 offsets = vec4(uv.x + resolution.x, uv.y, uv.x, uv.y - resolution.y); +vec4 a; +a.rb = texture(blendWeightsTexture, uv).rb; +a.g = texture(blendWeightsTexture, offsets.zw).g; +a.a = texture(blendWeightsTexture, offsets.xy).a; +if ( dot(a, vec4(1.0)) < 1e-5 ) { +fragColor = texture( colorTexture, uv, 0.0 ); +} else { +vec2 offset; +offset.x = a.a > a.b ? a.a : -a.b; +offset.y = a.g > a.r ? -a.g : a.r; +if ( abs( offset.x ) > abs( offset.y )) { +offset.y = 0.0; +} else { +offset.x = 0.0; +} +vec4 C = texture( colorTexture, uv, 0.0 ); +vec4 Cop = texture( colorTexture, uv + sign( offset ) * resolution.xy, 0.0 ); +float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y ); +fragColor = mix(C, Cop, s); +} +}`),t}const cDt=Object.freeze(Object.defineProperty({__proto__:null,build:jke},Symbol.toStringTag,{value:"Module"}));let Gke=class Hke extends Hr{initializeProgram(e){return new Ir(e.rctx,Hke.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};Gke.shader=new Rr(cDt,()=>we(()=>Promise.resolve().then(()=>YWt),void 0));const bwe={threshold:.05,localConstrastAdaption:2};function qke(){const t=new Cr;return t.include(Pc),t.fragment.uniforms.add(new Zt("colorTexture",e=>e.color)),t.outputs.add("fragEdges","vec2"),t.fragment.code.add(V` + float absMax3(vec3 v) { + vec3 t = abs(v); + return max(max(t.r, t.g), t.b); + } + + void main() { + vec2 resolution = 1.0 / vec2(textureSize(colorTexture, 0)); + vec4 offsets[3]; + offsets[0] = vec4(uv.x - resolution.x, uv.y, uv.x, uv.y + resolution.y); + offsets[1] = vec4(uv.x + resolution.x, uv.y, uv.x, uv.y - resolution.y); + offsets[2] = vec4(uv.x - 2.0 * resolution.x, uv.y, uv.x, uv.y + 2.0 * resolution.y); + + // Calculate color deltas: + vec4 delta; + vec3 C = texture(colorTexture, uv).rgb; + + vec3 Cleft = texture(colorTexture, offsets[0].xy).rgb; + delta.x = absMax3(C - Cleft); + + vec3 Ctop = texture(colorTexture, offsets[0].zw).rgb; + delta.y = absMax3(C - Ctop); + + vec2 edges = step(vec2(${V.float(bwe.threshold)}), delta.xy); + + // discard if there is no edge: + if (dot(edges, vec2(1.0)) == 0.0) { + discard; + } + + // Calculate right and bottom deltas: + vec3 Cright = texture(colorTexture, offsets[1].xy).rgb; + delta.z = absMax3(C - Cright); + + vec3 Cbottom = texture(colorTexture, offsets[1].zw).rgb; + delta.w = absMax3(C - Cbottom); + + // Calculate the maximum delta in the direct neighborhood: + float maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w); + + // Calculate left-left and top-top deltas: + vec3 Cleftleft = texture(colorTexture, offsets[2].xy).rgb; + delta.z = absMax3(C - Cleftleft); + + vec3 Ctoptop = texture(colorTexture, offsets[2].zw).rgb; + delta.w = absMax3(C - Ctoptop); + + // Calculate the final maximum delta: + maxDelta = max(max(maxDelta, delta.z), delta.w); + + // Local contrast adaptation in action: + edges *= step(maxDelta, float(${V.float(bwe.localConstrastAdaption)}) * delta.xy); + + fragEdges = edges; + } + `),t}const uDt=Object.freeze(Object.defineProperty({__proto__:null,build:qke},Symbol.toStringTag,{value:"Module"}));let Wke=class Yke extends Hr{initializeProgram(e){return new Ir(e.rctx,Yke.shader.get().build(),Er)}initializePipeline(){return Ti({colorWrite:ji})}};Wke.shader=new Rr(uDt,()=>we(()=>Promise.resolve().then(()=>XWt),void 0));let hDt=class extends _n{},sS=class extends CE{constructor(e){super(e),this._context=null,this._areaTexture=null,this._searchTexture=null,this._isEnabled=!1,this._smaaParameters=new hDt,this.produces=new Map([[ke.ANTIALIASING,()=>this._isEnabled&&this._context!=null]])}consumes(){return RLe}get updating(){return this._abortController!=null}initializeRenderContext(e){this._context=e,this.addHandles([_e(()=>this.view.qualitySettings.antialiasingEnabled,i=>{var r;return i||(r=this._context)!=null&&r.isFeatureEnabled(Zo.Antialiasing)?this.enable():this.disable()},kt)])}renderFeatureChanged(){var e;this.view.qualitySettings.antialiasingEnabled||(e=this._context)!=null&&e.isFeatureEnabled(Zo.Antialiasing)?this.enable():this.disable()}uninitializeRenderContext(){this.disable(),this._context=null}enable(){if(this._isEnabled||!this._context||this._abortController)return;if(this._edgeTechnique==null&&(this._edgeTechnique=this._context.techniqueRepository.acquire(Wke)),this._blendTechnique==null&&(this._blendTechnique=this._context.techniqueRepository.acquire(Vke)),this._blurTechnique==null&&(this._blurTechnique=this._context.techniqueRepository.acquire(Gke)),this._areaTexture&&this._searchTexture)return void(this._isEnabled=!0);this._abortController=new AbortController;const e=this._abortController.signal;we(()=>import("./SMAAData-j7UWeZ7Z.js"),__vite__mapDeps([])).then(i=>this._loadTextures(this._context,i,e)).then(()=>{var i;(i=this._context)==null||i.requestRender(),this._abortController=null}).catch(i=>{sn(i)||this._disposeTextures()})}_loadTextures(e,i,r){return St(r),e?Promise.all([C_(i.areaTexture).then(n=>wwe(e.fbos.rctx,ki.LINEAR,ci.RGB,n)),C_(i.searchTexure).then(n=>wwe(e.fbos.rctx,ki.NEAREST,ci.LUMINANCE,n))]).then(([n,s])=>{xo(r)?(n.dispose(),s.dispose(),St(r)):(this._areaTexture=n,this._searchTexture=s,this._isEnabled=!0)}):Promise.reject()}_disposeTextures(){this._areaTexture=Kt(this._areaTexture),this._searchTexture=Kt(this._searchTexture)}disable(){this._abortController=gn(this._abortController),this._isEnabled=!1}destroy(){this.disable(),this._disposeTextures()}renderNode(e,i,r,n){var T,A,M,I;const s=(T=r==null?void 0:r.composite)==null?void 0:T.colorTexture;if(!(this._isEnabled&&this._context&&r&&s))return n;if(!((A=this._edgeTechnique)!=null&&A.compiled&&((M=this._blendTechnique)!=null&&M.compiled)&&((I=this._blurTechnique)!=null&&I.compiled)))return this._context.requestRender(),n;const o=s.descriptor.width,l=s.descriptor.height,c=this._context.fbos,f=e.rctx;f.setViewport(0,0,o,l);const _=c.acquire(xr.RG,o,l);f.bindFramebuffer(_.fbo),f.setClearColor(0,0,0,1),f.clear(In.COLOR_BUFFER_BIT),this._smaaParameters.color=s,f.bindTechnique(this._edgeTechnique,this._smaaParameters),f.screen.draw();const x=c.acquire(xr.RGBA,o,l);return f.bindFramebuffer(x.fbo),f.setClearColor(0,0,1,1),f.clear(In.COLOR_BUFFER_BIT),this._smaaParameters.inputTexture=_.colorTexture,this._smaaParameters.areaTexture=this._areaTexture,this._smaaParameters.searchTexture=this._searchTexture,f.bindTechnique(this._blendTechnique,this._smaaParameters),f.screen.draw(),f.bindFramebuffer(n==null?void 0:n.fbo),_.release(),f.setClearColor(0,1,0,1),f.clear(In.COLOR_BUFFER_BIT),this._smaaParameters.inputTexture=x.colorTexture,f.bindTechnique(this._blurTechnique,this._smaaParameters),f.screen.draw(),x.release(),n}};function wwe(t,e,i,r){const n=new tn;return n.pixelFormat=i,n.wrapMode=Bi.CLAMP_TO_EDGE,n.width=r.width,n.height=r.height,n.samplingMode=e,new Ai(t,n,r)}y([w()],sS.prototype,"view",void 0),y([w()],sS.prototype,"_context",void 0),y([w()],sS.prototype,"_abortController",void 0),y([w({readOnly:!0})],sS.prototype,"updating",null),sS=y([Z("esri.views.3d.webgl-engine.effects.smaa.SMAA")],sS);let dDt=class{constructor(){this._step=Twe,this._dilation=1,this._firstIdleTime=0}frame(e,i){if(i?this._firstIdleTime===0&&(this._firstIdleTime=performance.now()):this._firstIdleTime=0,Le("disable-feature:high-quality-idle"))this._dilation=1;else{const n=i?performance.now()-this._firstIdleTime:0;if(n>=xwe+fDt)return this._step=1/0,void(this._dilation=1);this._dilation=n>=xwe?mDt:1}const r=Je(e/pDt,Twe,yDt);this._step===1/0?this._step=r:this._step=this._step*Swe+r*(1-Swe)}get value(){return this._step}get timeDilation(){return this._dilation}clear(){this._step=this._firstIdleTime=0}};const pDt=.5,xwe=12e4,fDt=1e4,mDt=10,Swe=.9,gDt=30,Twe=1e3/1,yDt=1e3/gDt;let vDt=class{constructor(e,i){this._fbos=e,this.compositingHelper=i,this._width=4,this._height=4}dispose(){this._color=ir(this._color),this.releaseBuffers()}get framebuffer(){return this.color.detachDepth(),this.color.attachDepth(this.depth),this.color.fbo}get colorTexture(){return this.color.colorTexture}get depthTexture(){return this.depth.attachment}initializeFrame(e,i,r){this._fbos.interactive=!r;const n=this._fbos.rctx;this._width=e.fullWidth,this._height=e.fullHeight,KS(this,n.parameters.maxTextureSize);const s=this._color;return this._color=null,this.releaseBuffers(),this.bindFbo(),n.setClearStencil(0),n.setClearColor(i[0],i[1],i[2],i[3]),n.clearSafe(In.COLOR_BUFFER_BIT|In.DEPTH_BUFFER_BIT|In.STENCIL_BUFFER_BIT),s}releaseBuffers(){var e;(e=this._color)==null||e.detachDepth(),this._depth=ir(this._depth)}renderHUDVisibility(e,i,r){return(e==null?void 0:e.fbo.width)===this._width&&(e==null?void 0:e.fbo.height)===this._height||(e==null||e.release(),e=this._fbos.acquire(xr.RGBA4,this._width,this._height)),e.attachDepth(r||this.depth),this._fbos.rctx.bindFramebuffer(e.fbo),this.renderToFBO(i,_Dt),e.detachDepth(),e}compositeToHUDVisibility(e,i){var r;this._fbos.rctx.bindFramebuffer((r=e.hudVisibility)==null?void 0:r.fbo),this.compositingHelper.compositeHUD(e,i)}renderOITPass(e,i,r){let n,s;switch(i){case Jt.Color:n=this._fbos.acquire(xr.RGBA16F,this._width,this._height),s=[0,0,0,0];break;case Jt.Alpha:n=this._fbos.acquire(xr.R16F,this._width,this._height),s=[1,1,1,1];break;case Jt.FrontFace:n=this._fbos.acquire(xr.RGBA,this._width,this._height),s=[0,0,0,0]}return r?(n.acquireDepth(la.DEPTH16_BUFFER),this._fbos.rctx.bindFramebuffer(n.fbo),this.renderToFBO(e,s,!0,!0),n.releaseDepth()):(n.attachDepth(this.depth),this._fbos.rctx.bindFramebuffer(n.fbo),this.renderToFBO(e,s),n.detachDepth()),n}compositeToFramebuffer(e,i,r,n){this.bindFbo(),this.compositingHelper.composite(e,i,r,n)}compositeTransparentOntoOpaque(e,i,r,n,s){s?(this._fbos.rctx.bindFramebuffer(s.fbo),this._fbos.rctx.setClearColor(0,0,0,1e-13),this._fbos.rctx.clearSafe(In.COLOR_BUFFER_BIT)):this.bindFbo(),this.compositingHelper.compositeOIT(e,i.colorTexture,r.colorTexture,n.colorTexture)}renderDepthDetached(e){this._bindTarget(this.color),e(),this._bindTarget(this.color,this.depth)}renderToCachedFBO(e,i,r,n=xr.RGBA,s=la.DEPTH16_BUFFER,o=this._width,l=this._height,c=null){return(e==null?void 0:e.fbo.width)===o&&(e==null?void 0:e.fbo.height)===l||(e=ir(e)),e=e??this._fbos.acquire(n,o,l),s!=null&&e.acquireDepth(s),c==null||c.forEach(f=>{e.acquireColor(f.format,f.attachment)}),this._fbos.rctx.bindFramebuffer(e.fbo),this.renderToFBO(i,r,!0,!0),e}renderToFBO(e,i,r=!1,n=!1){const s=this._fbos.rctx;let o=0;if(i){const c=Math.max(1e-13,i[3]);s.setClearColor(i[0],i[1],i[2],c),o|=In.COLOR_BUFFER_BIT}r&&(o|=In.DEPTH_BUFFER_BIT),n===!1?n=0:(n===!0&&(n=255),o|=In.STENCIL_BUFFER_BIT),o&&s.clearSafe(o,n),e(),s.gl.flush()}renderToTargets(e,i,r,n,s=!1,o=!1){this._bindTarget(i,r),this.renderToFBO(e,n,s,o),i.detachDepth()}bindFbo(){this._bindTarget(this.color,this.depth)}_bindTarget(e,i){e.detachDepth(),e.attachDepth(i),this._fbos.rctx.bindFramebuffer(e.fbo)}get width(){return this._width}get height(){return this._height}get color(){return this._color||(this._color=this._fbos.acquire(xr.RGBA,this._width,this._height)),this._color}get depth(){return this._depth||(this._depth=this._fbos.acquireDepth(la.DEPTH_STENCIL_TEXTURE,this._width,this._height)),this._depth}};const _Dt=[0,1,0,1],m6=255,bDt=1/m6;function Xke(t){const e=new Cr,i=e.fragment;return i.include(o0),i.include(Kf),e.include(oG),e.include(Pc),e.include(lG,t),i.uniforms.add(new Zt("depthMap",(r,n)=>{var s;return(s=n.linearDepth)==null?void 0:s.colorTexture}),new _s("inverseViewMatrix",(r,n)=>Vo(Ewe,Qu(Ewe,n.camera.viewMatrix,n.camera.center))),new ln("nearFar",(r,n)=>n.camera.nearFar)),i.constants.add("sampleValue","float",bDt),e.outputs.add("sampleCount","float"),i.code.add(V`void main(void) { +float depth = rgba2float(texture(depthMap, uv)); +if (depth == 0.0) { +discard; +} +float currentPixelDepth = linearDepthFromFloat(depth, nearFar); +if (-currentPixelDepth > nearFar.y || -currentPixelDepth < nearFar.x) { +discard; +} +vec4 currentPixelPos = vec4(reconstructPosition(gl_FragCoord.xy, currentPixelDepth), 1.0); +vec4 worldSpacePos = inverseViewMatrix * currentPixelPos; +mat4 shadowMatrix; +float linearDepth = -currentPixelDepth; +int i = chooseCascade(linearDepth, shadowMatrix); +if (i >= numCascades) { +discard; +} +vec3 lvpos = lightSpacePosition(worldSpacePos.xyz, shadowMatrix); +if (lvpos.z >= 1.0 || lvpos.x < 0.0 || lvpos.x > 1.0 || lvpos.y < 0.0 || lvpos.y > 1.0) { +discard; +} +ivec2 texSize = textureSize(shadowMapTex, 0); +ivec2 uvShadow = ivec2(cascadeCoordinates(i, texSize, lvpos) * vec2(texSize)); +float depthShadow = readShadowMapDepth(uvShadow, shadowMapTex); +bool shadow = depthShadow < lvpos.z; +if (!shadow) { +discard; +} +sampleCount = sampleValue; +}`),e}const Ewe=Qe(),wDt=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:m6,build:Xke},Symbol.toStringTag,{value:"Module"}));var s_;(function(t){t[t.Gradient=0]="Gradient",t[t.Threshold=1]="Threshold",t[t.COUNT=2]="COUNT"})(s_||(s_={}));let rre=class extends nh{constructor(){super(...arguments),this.visualization=s_.Gradient,this.bandsEnabled=!1}};y([fe({count:s_.COUNT})],rre.prototype,"visualization",void 0),y([fe()],rre.prototype,"bandsEnabled",void 0);let Yce=class extends _n{constructor(e){super(),this._data=e,this.sampleScale=0,this.opacityFromElevation=1,this.color=U9(xDt),this.bandSize=.1,this.threshold=.5}get shadowCastMap(){return this._data.shadowCastTexture}};const xDt=Mi(.01,0,.25,1);function Zke(t){const e=new Cr,i=e.fragment;i.include(o0),i.include(Kf),e.include(oG),e.include(Pc);const{visualization:r,bandsEnabled:n}=t;i.constants.add("inverseSampleValue","float",m6),i.uniforms.add(new Zt("shadowCastMap",l=>l.shadowCastMap),new ft("sampleScale",l=>l.sampleScale),new ft("opacityFromElevation",l=>l.opacityFromElevation),new gr("uColor",l=>l.color));const s=r===s_.Gradient,o=r===s_.Threshold;return s&&n?i.uniforms.add(new ft("bandSize",l=>l.bandSize)):o&&i.uniforms.add(new ft("threshold",l=>l.threshold)),i.code.add(V` + void main(void) { + float record = texture(shadowCastMap, uv).r; + float pixelSamples = record * inverseSampleValue; + if (pixelSamples < 1.0) { + discard; + } + + float strength = pixelSamples * sampleScale; + + ${o?V` + if (strength <= threshold) { + discard; + }`:""} + + ${s&&n?V`strength = ceil(strength / bandSize) * bandSize;`:""} + + fragColor = vec4(uColor.xyz, uColor.a * opacityFromElevation ${s?V`* strength`:""}); + } + `),e}const SDt=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:Yce,build:Zke},Symbol.toStringTag,{value:"Module"}));let Jke=class Kke extends Hr{constructor(e,i){super(e,i,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,Kke.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:vp,colorWrite:ji,depthTest:null,depthWrite:null})}get primitiveType(){return sr.TRIANGLE_STRIP}};Jke.shader=new Rr(SDt,()=>we(()=>Promise.resolve().then(()=>ZWt),void 0));const TDt=4e4,EDt=5e4,Qke=1/512;let wk=class extends ze{constructor(e,i,r,n){super({}),this._techniqueRepository=e,this._rctx=i,this._data=r,this._requestRender=n,this._passParameters=new Yce(this._data),this._techniqueConfig=new rre,this._enabled=!1,this._vao=u1(i)}normalizeCtorArgs(){return{}}dispose(){this._stop(),this._vao=Kt(this._vao),this._techniqueRepository.release(this._technique),this._technique=null}get _visualizeShadowCastTechnique(){return this._technique=this._techniqueRepository.releaseAndAcquire(Jke,this._techniqueConfig,this._technique),this._technique}render(e){if(!this._showVisualization)return;this._passParameters.sampleScale=1/this._data.computedSamples;const i=this._visualizeShadowCastTechnique;this._rctx.bindVAO(this._vao),this._rctx.bindTechnique(i,this._passParameters,e),this._rctx.drawArrays(i.primitiveType,0,Kv(this._vao,"geometry"))}setOptions(e){e.enabled!==void 0&&this._setEnabled(e.enabled),e.color!==void 0&&this._setColor(e.color),e.threshold!==void 0&&(this._threshold=e.threshold),e.visualization!==void 0&&(this._visualization=e.visualization),e.bandSize!==void 0&&(this._bandSize=e.bandSize),e.bandsEnabled!==void 0&&(this._bandsEnabled=e.bandsEnabled)}get opacityFromElevation(){return this._passParameters.opacityFromElevation}set opacityFromElevation(e){this._passParameters.opacityFromElevation!==e&&(this._passParameters.opacityFromElevation=e,this.notifyChange("opacityFromElevation"))}get _showVisualization(){return this._enabled&&this._data.computedSamples>0&&this.opacityFromElevation>Qke}get _threshold(){return this._passParameters.threshold}set _threshold(e){this._threshold!==e&&(this._passParameters.threshold=e,this._requestRenderIfRunning())}get _visualization(){return this._techniqueConfig.visualization}set _visualization(e){e!==this._visualization&&(this._techniqueConfig.visualization=e,this._techniqueRepository.release(this._technique),this._technique=null,this._requestRenderIfRunning())}get _bandSize(){return this._passParameters.bandSize}set _bandSize(e){e!==this._bandSize&&(this._passParameters.bandSize=e,this._requestRenderIfRunning())}get _bandsEnabled(){return this._techniqueConfig.bandsEnabled}set _bandsEnabled(e){e!==this._bandsEnabled&&(this._techniqueConfig.bandsEnabled=e,this._techniqueRepository.release(this._technique),this._technique=null,this._requestRenderIfRunning())}_setColor(e){const i=this._passParameters.color;rO(e,i)||(mm(this._passParameters.color,e),this._requestRenderIfRunning())}_setEnabled(e){e!==this._enabled&&(e?this._start():this._stop())}_requestRenderIfRunning(){this._enabled&&this._requestRender()}_start(){this._enabled=!0,this._requestRender()}_stop(){this._enabled=!1,this._requestRender()}};y([w()],wk.prototype,"opacityFromElevation",null),wk=y([Z("esri.views.3d.webgl-engine.lib.ShadowCastRenderer")],wk);let eze=class tze extends Hr{constructor(e){super(e,new Wce,()=>this.destroy())}initializeProgram(e){return new Ir(e.rctx,tze.shader.get().build(this.configuration),Er)}initializePipeline(){return Ti({blending:Ol(st.ONE,st.ONE,st.ONE,st.ONE),colorWrite:ji,depthTest:null,depthWrite:null})}get primitiveType(){return sr.TRIANGLE_STRIP}};eze.shader=new Rr(wDt,()=>we(()=>Promise.resolve().then(()=>JWt),void 0));let Pu=class extends ze{constructor(e,i,r,n,s,o){super({}),this.fbos=e,this._stage=r,this._prepareForShadowMapPass=n,this._renderToShadowMap=s,this._requestRender=o,this._progress=0,this._sampleCount=0,this._passParameters=new Ole,this._cachedLightDirections=[],this._depthRange=Xie,this._previewing=!1,this._cameraForcedForScreenshot=!1,this._shadowAccumulatorKey="shadowAccumulator",this._rctx=e.rctx,this._bindParameters=new Pj(new Xle(e,r.viewingMode),null),this._bindParameters.shadowMap.enabled=!0,this._vao=u1(this._rctx),this._accumulationRenderer=new wk(i,this._rctx,this,o);const l=this._stage.view.resourceController.scheduler;this.addHandles([l.registerTask(ni.SHADOW_ACCUMULATOR,this),_e(()=>r.renderView,c=>{this.removeHandles(Cwe),c!=null&&this.addHandles(c.events.on("force-camera-for-screenshot",()=>this._cameraForcedForScreenshot=!0),Cwe)},kt),_e(()=>this._previewing,()=>this._requestRenderIfEnabled(),Li)],this._shadowAccumulatorKey)}normalizeCtorArgs(){return{}}dispose(){this._disable(),this.removeHandles(this._shadowAccumulatorKey),this._accumulationRenderer=Kt(this._accumulationRenderer),this._bindParameters.shadowMap.dispose(),this._fbo=Kt(this._fbo),this._vao=Kt(this._vao),this._accumulationTechniqueCached=ir(this._accumulationTechniqueCached),this._cachedLightDirections.length=0,this._sampleCount=0}get computedSamples(){return this._progress}get shadowCastTexture(){var e;return(e=this._fbo)==null?void 0:e.colorTexture}get isAccumulating(){return this._isPreviewing||this._isRefining}get _accumulationTechnique(){if(this._accumulationTechniqueCached==null){const e={rctx:this._rctx,viewingMode:this._stage.viewingMode};this._accumulationTechniqueCached=new eze(e)}return this._accumulationTechniqueCached}get _isRefining(){return this._isActive&&!this._isDoneAccumulating&&!this._previewing}get _isPreviewing(){return this._isActive&&this._previewing}get _isActive(){return this._fbo!=null&&this._sampleCount>0}get canAccumulate(){var e;return((e=this._bindParameters.linearDepth)==null?void 0:e.colorTexture)!==null&&this._depthRange!==Xie&&this._opacityFromElevation>Qke}get _isDoneAccumulating(){return this._progress>=this._sampleCount}get _lightDirections(){return this._cachedLightDirections}set _lightDirections(e){const i=this._cachedLightDirections;if(Fy(i,e,M2))return;const r=Math.min(m6,e.length);i.length=r,this._sampleCount=r;for(let n=0;n0}runTask(e){for(this._prepareForShadowMapPass(this._bindParameters);!e.done&&!this._isDoneAccumulating;)this._accumulateShadow(),e.madeProgress();this._requestRender()}renderAccumulation(e,i,r,n){if(this._depthRange=i,this._updateCamera(r),this._bindParameters.contentCamera=n,this._bindParameters.linearDepth=e,this._passParameters.origin=this._bindParameters.camera.center,this.notifyChange("canAccumulate"),!this.isAccumulating||!this.canAccumulate)return;(this._previewing||this._progress===0||this._cameraForcedForScreenshot)&&this._clear();const s=this._cameraForcedForScreenshot?this._sampleCount:Math.min(CDt,this._sampleCount-this._progress);for(let o=0;o=this._fbo.width||i<0||i>=this._fbo.height?0:(this._fbo.readPixels(e,i,1,1,ci.RED,ga.UNSIGNED_BYTE,Awe),Awe[0]/this._progress)}_enable(){this._progress=0;const e=new tn;e.pixelFormat=ci.RED,e.internalFormat=zt.R8,e.wrapMode=Bi.CLAMP_TO_EDGE,this._fbo=new Hm(this._rctx,e)}_disable(){this._fbo=Kt(this._fbo)}_invalidate(){this._progress=0,this._requestRenderIfEnabled()}_clear(){this._rctx.bindFramebuffer(this._fbo),this._rctx.setClearColor(0,0,0,0),this._rctx.clearSafe(In.COLOR_BUFFER_BIT),this._progress=0}_accumulateShadow(){this._renderToShadowMap(this._bindParameters,this._lightDirections[this._progress++],this._depthRange);const e=this._accumulationTechnique;this._rctx.bindFramebuffer(this._fbo),this._rctx.bindTechnique(e,this._passParameters,this._bindParameters),this._rctx.bindVAO(this._vao),this._rctx.drawArrays(e.primitiveType,0,Kv(this._vao,"geometry"))}_updateCamera(e){!e.equals(this._bindParameters.camera)&&this._fbo&&(this._bindParameters.camera.copyFrom(e),this._fbo.resize(e.fullWidth,e.fullHeight),this._opacityFromElevation=1-pL(TDt,EDt,e.relativeElevation))}_requestRenderIfEnabled(){this._fbo&&this._requestRender()}get test(){const e=this;return{lightDirections:this._lightDirections,get isDone(){return e._isDoneAccumulating},get isActive(){return e._isActive}}}};y([w()],Pu.prototype,"_progress",void 0),y([w()],Pu.prototype,"_sampleCount",void 0),y([w()],Pu.prototype,"_fbo",void 0),y([w()],Pu.prototype,"_depthRange",void 0),y([w()],Pu.prototype,"_previewing",void 0),y([w()],Pu.prototype,"_accumulationRenderer",void 0),y([w()],Pu.prototype,"_isRefining",null),y([w()],Pu.prototype,"_isActive",null),y([w()],Pu.prototype,"canAccumulate",null),y([w()],Pu.prototype,"_isDoneAccumulating",null),y([w()],Pu.prototype,"_opacityFromElevation",null),y([w()],Pu.prototype,"running",null),Pu=y([Z("esri.views.3d.webgl-engine.lib.ShadowAccumulator")],Pu);const CDt=6,Cwe="renderView",Awe=new Uint8Array(1),Mwe=U_();let ADt=class{constructor(){this._plane=U_()}get isEnabled(){return!b4e(this.plane,Mwe)}get plane(){return this._plane}set plane(e){wE(e||Mwe,this._plane)}};function MDt(t,e){const i=-t[0],r=-t[1],n=-t[2],s=e[3],o=e[7],l=e[11],c=e[15];e[0]+=s*i,e[1]+=s*r,e[2]+=s*n,e[4]+=o*i,e[5]+=o*r,e[6]+=o*n,e[8]+=l*i,e[9]+=l*r,e[10]+=l*n,e[12]+=c*i,e[13]+=c*r,e[14]+=c*n}function ODt(t,e){const i=t[0],r=t[1],n=t[2];e[12]+=i*e[0]+r*e[4]+n*e[8],e[13]+=i*e[1]+r*e[5]+n*e[9],e[14]+=i*e[2]+r*e[6]+n*e[10],e[14]+=i*e[3]+r*e[7]+n*e[11]}let PDt=class{constructor(e){this._factory=e,this._originData=new Map}acquire(e){return this.register(this._factory.getOrigin(e))}register(e){const i=this._originData.get(e.id)||new RDt(e);return i.refCount++,this._originData.has(i.origin.id)||this._originData.set(i.origin.id,i),i}release(e){e.refCount--,e.refCount===0&&this._originData.delete(e.origin.id)}updateViewMatrices(e){this._originData.forEach(i=>{Ao(i.viewMatrix,e),ODt(i.origin.vec3,i.viewMatrix)})}},RDt=class{constructor(e){this.origin=e,this.refCount=0,this.viewMatrix=Qe()}},IDt=class extends Z$e{constructor(e,i){super(),this.distanceFalloffFactor=e,this.transparency=i,this.transformNormalViewFromGlobal=as()}},$Dt=class extends J$e{constructor(){super(...arguments),this.transformNormalViewFromGlobal=as(),this.slicePlaneLocalOrigin=W(),this.transformNormalGlobalFromModel=as()}};function LDt(t){const e=V`bool isNaN( float val ) +{ +return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true; +}`;t.code.add(e)}const DDt=Ji(.5,-4e-4);function NDt(t,e){const i=t.vertex;i.include(LDt),i.constants.add("depthBias","vec2",DDt),i.uniforms.add(new ln("inverseViewport",(r,n)=>n.inverseViewport)),e.legacy?(i.uniforms.add(new _s("proj",(r,n)=>n.camera.projectionMatrix)),i.code.add(V`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) { +float offsetXY = depthBias.x; +vec4 projNormal = proj * localView * vec4(globalNormal, 0.0); +return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy; +}`)):(i.uniforms.add(new Wm("transformNormalViewFromGlobal",r=>r.transformNormalViewFromGlobal),new _s("transformProjFromView",r=>r.transformProjFromView)),i.code.add(V`vec2 calculateProjectedBiasXY(vec4 projPos, vec3 globalNormal) { +float offsetXY = depthBias.x; +vec4 projNormal = transformProjFromView * vec4(transformNormalViewFromGlobal * globalNormal, 0.0); +return offsetXY * projPos.w * 2.0 * inverseViewport * normalize(projNormal.xyz).xy; +}`)),i.code.add(V`float _calculateProjectedBiasZ(vec4 projPos) { +float offsetZ = depthBias.y; +return sqrt(max(projPos.z,0.0)) * offsetZ; +} +vec4 adjustProjectedPosition(vec4 projPos, vec3 worldNormal, float lineWidth) { +vec2 offsetXY = calculateProjectedBiasXY(projPos, worldNormal); +if (!isNaN(offsetXY.x) && !isNaN(offsetXY.y)) { +projPos.xy += offsetXY; +} +projPos.z += _calculateProjectedBiasZ(projPos); +return projPos; +}`)}function FDt(t,e){const i=t.fragment;i.constants.add("coverageTestThreshold","float",.01),e.antialiasing?i.code.add(V`#define discardByCoverage(radius, coverage) { if (coverage < coverageTestThreshold) discard; }`):i.code.add(V`#define discardByCoverage(radius, coverage) { float coverageLimit = radius <= 0.5 ? coverageTestThreshold : 0.75; if (coverage < coverageLimit) discard; }`)}function kDt(t,e){const i=t.vertex;e.silhouette?(i.code.add(V`bool isSilhouetteEdge(vec3 viewDir, vec3 normalA, vec3 normalB) { +float faceAVisible = dot(viewDir, normalA); +float faceBVisible = dot(viewDir, normalB); +return faceAVisible * faceBVisible < 0.0; +}`),e.legacy?i.code.add(V`bool discardNonSilhouetteEdges(vec3 viewPos, vec3 worldPos) { +vec3 viewNormalA = _modelToViewNormal(normalA); +vec3 viewNormalB = _modelToViewNormal(normalB); +vec3 viewDir = -viewPos; +if (isSilhouetteEdge(viewDir, viewNormalA, viewNormalB)) { +return false; +} +gl_Position = vec4(10.0, 10.0, 10.0, 1.0); +return true; +}`):i.code.add(V`bool discardNonSilhouetteEdges(vec3 viewPos, vec3 worldPos) { +vec3 worldNormalA = _modelToWorldNormal(normalA); +vec3 worldNormalB = _modelToWorldNormal(normalB); +vec3 viewDir = -worldPos; +if (isSilhouetteEdge(viewDir, worldNormalA, worldNormalB)) { +return false; +} +gl_Position = vec4(10.0, 10.0, 10.0, 1.0); +return true; +}`)):i.code.add(V`bool discardNonSilhouetteEdges(vec3 viewPos, vec3 worldPos) { +return false; +}`)}function zDt(t,e){const i=t.vertex;i.include(o0),i.uniforms.add(new ft("distanceFalloffFactor",r=>r.distanceFalloffFactor)),i.code.add(V`float distanceBasedPerspectiveFactor(float distance) { +return clamp(sqrt(distanceFalloffFactor / distance), 0.0, 1.0); +}`),i.uniforms.add(new $f("componentDataTex",r=>r.componentDataTexture)),t.attributes.add(J.COMPONENTINDEX,"float"),i.constants.add("componentColorFieldOffset","float",0),i.constants.add("componentOtherFieldOffset","float",1),i.constants.add("componentVerticalOffsetFieldOffset","float",2),i.constants.add("componentFieldCount","float",3),i.constants.add("lineWidthFractionFactor","float",8),i.constants.add("extensionLengthOffset","float",128),i.constants.add("verticalOffsetScale","float",2*kce),i.code.add(V`vec2 _componentTextureCoords(float componentIndex, float fieldOffset) { +float fieldIndex = componentFieldCount * componentIndex + fieldOffset; +float texSize = float(textureSize(componentDataTex, 0).x); +float colIndex = mod(fieldIndex, texSize); +float rowIndex = floor(fieldIndex / texSize); +return vec2(colIndex, rowIndex) + 0.5; +} +struct ComponentData { +vec4 color; +float lineWidth; +float extensionLength; +float type; +float verticalOffset; +}; +ComponentData readComponentData() { +vec2 colorIndex = _componentTextureCoords(componentIndex, componentColorFieldOffset); +vec2 otherIndex = _componentTextureCoords(componentIndex, componentOtherFieldOffset); +vec2 verticalOffsetIndex = _componentTextureCoords(componentIndex, componentVerticalOffsetFieldOffset); +vec4 colorValue = texelFetch(componentDataTex, ivec2(colorIndex), 0); +vec4 otherValue = texelFetch(componentDataTex, ivec2(otherIndex), 0); +float verticalOffset = (rgba2float(texelFetch(componentDataTex, ivec2(verticalOffsetIndex), 0)) - 0.5) * verticalOffsetScale; +return ComponentData( +vec4(colorValue.rgb, colorValue.a * otherValue.w), +otherValue.x * (255.0 / lineWidthFractionFactor), +otherValue.y * 255.0 - extensionLengthOffset, +-(otherValue.z * 255.0) + 0.5, +verticalOffset +); +}`),e.legacy?i.code.add(V`vec3 _modelToWorldNormal(vec3 normal) { +return (model * vec4(normal, 0.0)).xyz; +} +vec3 _modelToViewNormal(vec3 normal) { +return (localView * model * vec4(normal, 0.0)).xyz; +}`):(i.uniforms.add(new ML("transformNormalGlobalFromModel",r=>r.transformNormalGlobalFromModel)),i.code.add(V`vec3 _modelToWorldNormal(vec3 normal) { +return transformNormalGlobalFromModel * normal; +}`)),e.silhouette?(t.attributes.add(J.NORMALA,"vec3"),t.attributes.add(J.NORMALB,"vec3"),i.code.add(V`vec3 worldNormal() { +return _modelToWorldNormal(normalize(normalA + normalB)); +}`)):(t.attributes.add(J.NORMAL,"vec3"),i.code.add(V`vec3 worldNormal() { +return _modelToWorldNormal(normal); +}`)),e.legacy?i.code.add(V`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) { +worldPos = (model * vec4(modelPos, 1.0)).xyz; +viewPos = (localView * vec4(worldPos, 1.0)).xyz; +}`):(i.include(Pae,e),i.uniforms.add(new Wm("transformViewFromCameraRelativeRS",r=>r.transformViewFromCameraRelativeRS),new ML("transformWorldFromModelRS",r=>r.transformWorldFromModelRS),new yp("transformWorldFromModelTL",r=>r.transformWorldFromModelTL),new yp("transformWorldFromModelTH",r=>r.transformWorldFromModelTH),new Oi("transformWorldFromViewTL",r=>r.transformWorldFromViewTL),new Oi("transformWorldFromViewTH",r=>r.transformWorldFromViewTH)),i.code.add(V` + void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) { + vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos; + + vec3 transformCameraRelativeFromModel = dpAdd( + transformWorldFromModelTL, + transformWorldFromModelTH, + -transformWorldFromViewTL, + -transformWorldFromViewTH + ); + + worldPos = transformCameraRelativeFromModel + rotatedModelPosition; + + if (verticalOffset != 0.0) { + vec3 vUp = ${e.spherical?V`normalize(transformWorldFromModelTL + rotatedModelPosition);`:V`vec3(0.0, 0.0, 1.0);`} + worldPos += verticalOffset * vUp; + } + + viewPos = transformViewFromCameraRelativeRS * worldPos; + } + `)),i.uniforms.add(new _s("transformProjFromView",(r,n)=>n.camera.projectionMatrix)),i.code.add(V`vec4 projFromViewPosition(vec3 position) { +return transformProjFromView * vec4(position, 1.0); +}`),i.code.add(V`float calculateExtensionLength(float extensionLength, float lineLength) { +return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0); +}`)}function UDt(t){return t.mode===da.SKETCH||t.mode===da.MIXED}var da,zS;(function(t){t[t.SOLID=0]="SOLID",t[t.SKETCH=1]="SKETCH",t[t.MIXED=2]="MIXED",t[t.COUNT=3]="COUNT"})(da||(da={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.SILHOUETTE=1]="SILHOUETTE"}(zS||(zS={}));function Xce(t,e){const i=t.vertex;switch(t.attributes.add(J.SIDENESS,"vec2"),e.mode===da.MIXED?i.code.add(V`struct UnpackedAttributes { +vec2 sideness; +vec2 sidenessNorm; +float lineWidthPixels; +float extensionLengthPixels; +float type; +};`):i.code.add(V`struct UnpackedAttributes { +vec2 sideness; +vec2 sidenessNorm; +float lineWidthPixels; +float extensionLengthPixels; +};`),e.mode){case da.MIXED:i.code.add(V`UnpackedAttributes unpackAttributes(ComponentData component) { +vec2 sidenessNorm = sideness; +vec2 sideness = sidenessNorm * 2.0 - 1.0; +float fType = component.type; +float extensionLengthPixels = component.extensionLength; +float lineWidth = component.lineWidth; +if (fType <= 0.0) { +extensionLengthPixels *= variantExtension * 2.0 - 1.0; +} +return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels, fType); +}`);break;case da.SKETCH:i.code.add(V`UnpackedAttributes unpackAttributes(ComponentData component) { +vec2 sidenessNorm = sideness; +vec2 sideness = sidenessNorm * 2.0 - 1.0; +float extensionLengthPixels = component.extensionLength; +extensionLengthPixels *= variantExtension * 2.0 - 1.0; +float lineWidth = component.lineWidth; +return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels); +}`);break;case da.SOLID:i.code.add(V`UnpackedAttributes unpackAttributes(ComponentData component) { +vec2 sidenessNorm = sideness; +vec2 sideness = sidenessNorm * 2.0 - 1.0; +float extensionLengthPixels = component.extensionLength; +float lineWidth = component.lineWidth; +return UnpackedAttributes(sideness, sidenessNorm, lineWidth, extensionLengthPixels); +}`);break;case da.COUNT:break;default:e.mode}}function VDt(t,e){const i=t.vertex;switch(t.include(Xce,e),e.mode){case da.SOLID:i.code.add(V`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) { +return 0.0; +}`);break;case da.SKETCH:i.uniforms.add(new bT("strokesAmplitude",r=>r.strokesTexture.amplitude)),i.code.add(V`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) { +return strokesAmplitude; +}`);break;case da.MIXED:i.uniforms.add(new bT("strokesAmplitude",r=>r.strokesTexture.amplitude)),i.code.add(V`float calculateLineAmplitude(UnpackedAttributes unpackedAttributes) { +float type = unpackedAttributes.type; +if (type <= 0.0) { +return strokesAmplitude; +} +else { +return 0.0; +} +}`)}}function BDt(t,e){t.include(Xce,e);const{vertex:i,fragment:r}=t;switch(UDt(e)&&(i.uniforms.add(new $f("strokesTexture",n=>n.strokesTexture.texture)),i.uniforms.add(new bT("strokesLog2Resolution",n=>Math.log2(n.strokesTexture.resolution)),new bT("strokeVariants",n=>n.strokesTexture.variants)),t.varyings.add("vStrokeUV","vec2"),r.uniforms.add(new $f("strokesTexture",n=>n.strokesTexture.texture),new bT("strokesNormalizationScale",n=>n.strokesTexture.normalizationScale)),i.code.add(V`void calculateStyleOutputsSketch(float lineLength, UnpackedAttributes unpackedAttributes) { +vec2 sidenessNorm = unpackedAttributes.sidenessNorm; +float lineIndex = clamp(ceil(log2(lineLength)), 0.0, strokesLog2Resolution); +vStrokeUV = vec2(exp2(lineIndex) * sidenessNorm.y, lineIndex * strokeVariants + variantStroke + 0.5) / vec2(textureSize(strokesTexture, 0)); +vStrokeUV.x += variantOffset; +}`),t.fragment.include(o0),r.code.add(V`float calculateLineOffsetSketch() { +float offsetNorm = rgba2float(texture(strokesTexture, vStrokeUV)); +return (offsetNorm - 0.5) * strokesNormalizationScale; +} +float calculateLinePressureSketch() { +return rgba2float(texture(strokesTexture, vStrokeUV + vec2(0.0, 0.5))); +}`)),e.mode){case da.SOLID:i.code.add(V`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) {}`),r.code.add(V`float calculateLineOffset() { +return 0.0; +} +float calculateLinePressure() { +return 1.0; +}`);break;case da.SKETCH:i.code.add(V`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) +{ +calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes); +}`),r.code.add(V`float calculateLineOffset() { +return calculateLineOffsetSketch(); +} +float calculateLinePressure() { +return calculateLinePressureSketch(); +}`);break;case da.MIXED:t.varyings.add("vType","float"),i.code.add(V`void calculateStyleOutputs(UnpackedAttributes unpackedAttributes) +{ +vType = unpackedAttributes.type; +if (unpackedAttributes.type <= 0.0) { +calculateStyleOutputsSketch(vLineLengthPixels, unpackedAttributes); +} +}`),r.code.add(V`float calculateLineOffset() { +if (vType <= 0.0) { +return calculateLineOffsetSketch(); +} +else { +return 0.0; +} +} +float calculateLinePressure() { +if (vType <= 0.0) { +return calculateLinePressureSketch(); +} +else { +return 1.0; +} +}`)}}function ize(t){const e=new Cr,{vertex:i,fragment:r}=e;return t.legacy&&i.uniforms.add(new Owe("model"),new Owe("localView")),e.include(NDt,t),e.include(zDt,t),e.include(VDt,t),e.include(Xce,t),e.include(BDt,t),e.include(oo,t),e.include(kDt,t),e.include(FDt,t),e.include(dd,t),e.varyings.add("vColor","vec4"),e.varyings.add("vRadius","float"),e.varyings.add("vPosition","vec3"),e.varyings.add("vWorldPosition","vec3"),t.multipassEnabled&&e.varyings.add("vViewPos","vec3"),e.varyings.add("vLineLengthPixels","float"),e.varyings.add("vSizeFalloffFactor","float"),i.uniforms.add(new ln("pixelToNDC",(n,s)=>or(jDt,2/s.camera.fullViewport[2],2/s.camera.fullViewport[3])),new gr("viewport",(n,s)=>s.camera.fullViewport),new ft("pixelRatio",(n,s)=>s.camera.pixelRatio)),e.attributes.add(J.POSITION0,"vec3"),e.attributes.add(J.POSITION1,"vec3"),e.attributes.add(J.VARIANTOFFSET,"float"),e.attributes.add(J.VARIANTSTROKE,"float"),e.attributes.add(J.VARIANTEXTENSION,"float"),i.code.add(V` + const float opaqueCutoff = 1.0 / 255.0; + + void calculateGeometricOutputs(vec3 viewPosV0, vec3 viewPosV1, vec3 worldPosV0, vec3 worldPosV1, vec3 worldNormal, UnpackedAttributes unpackedAttributes) { + vec2 sideness = unpackedAttributes.sideness; + vec2 sidenessNorm = unpackedAttributes.sidenessNorm; + + vWorldPosition = mix(worldPosV0, worldPosV1, sidenessNorm.y).xyz; + + vec3 viewPos = mix(viewPosV0, viewPosV1, sidenessNorm.y); + ${t.multipassEnabled?"vViewPos = viewPos;":""} + + vec4 projPosV0 = projFromViewPosition(viewPosV0); + vec4 projPosV1 = projFromViewPosition(viewPosV1); + vec4 projPos = projFromViewPosition(viewPos); + + vec3 screenSpaceLineNDC = (projPosV1.xyz / projPosV1.w - projPosV0.xyz / projPosV0.w); + vec2 ndcToPixel = viewport.zw * 0.5; + vec2 screenSpaceLinePixels = screenSpaceLineNDC.xy * ndcToPixel; + float lineLengthPixels = length(screenSpaceLinePixels); + + float dzPerPixel = screenSpaceLineNDC.z / lineLengthPixels; + vec2 screenSpaceDirection = screenSpaceLinePixels / lineLengthPixels; + vec2 perpendicularScreenSpaceDirection = vec2(screenSpaceDirection.y, -screenSpaceDirection.x) * sideness.x; + + float falloffFactor = distanceBasedPerspectiveFactor(-viewPos.z) * pixelRatio; + float lineWidthPixels = unpackedAttributes.lineWidthPixels * falloffFactor; + + float extensionLengthPixels = calculateExtensionLength(unpackedAttributes.extensionLengthPixels, lineLengthPixels) * falloffFactor; + float lineAmplitudePixels = calculateLineAmplitude(unpackedAttributes) * pixelRatio; + + vSizeFalloffFactor = falloffFactor; + + float lineWidthAndAmplitudePixels = lineWidthPixels + lineAmplitudePixels + lineAmplitudePixels; + float extendedLineLengthPixels = lineLengthPixels + extensionLengthPixels + extensionLengthPixels; + + ${t.antialiasing?V` + const float aaPaddingPixels = 1.0; + + // Line size with padding + float halfAAPaddedLineWidthAndAmplitudePixels = lineWidthAndAmplitudePixels * 0.5 + aaPaddingPixels; + float aaPaddedRoundedCapSizePixels = lineWidthPixels * 0.5 + aaPaddingPixels;`:V` + float halfAAPaddedLineWidthAndAmplitudePixels = max(lineWidthAndAmplitudePixels, 1.0) * 0.5; + float aaPaddedRoundedCapSizePixels = max(lineWidthPixels, 1.0) * 0.5;`} + + // Half line width in NDC including padding for anti aliasing + vec2 halfAAPaddedLineWidthAndAmplitudeNDC = halfAAPaddedLineWidthAndAmplitudePixels * pixelToNDC; + vec2 aaPaddedRoundedCapSizeNDC = aaPaddedRoundedCapSizePixels * pixelToNDC; + vec2 extensionLengthNDC = extensionLengthPixels * pixelToNDC; + + // Compute screen space position of vertex, offsetting for line size and end caps + vec2 ndcOffset = ( + screenSpaceDirection * sideness.y * (aaPaddedRoundedCapSizeNDC + extensionLengthNDC) + + perpendicularScreenSpaceDirection * halfAAPaddedLineWidthAndAmplitudeNDC + ); + + projPos.xy += ndcOffset * projPos.w; + projPos.z += (dzPerPixel * (aaPaddedRoundedCapSizePixels + extensionLengthPixels)) * sideness.y * projPos.w; + + projPos = adjustProjectedPosition(projPos, worldNormal, 1.0 + max((lineWidthAndAmplitudePixels - 1.0) * 0.5, 0.0)); + + // Line length with end caps + float aaPaddedLineWithCapsLengthPixels = extendedLineLengthPixels + aaPaddedRoundedCapSizePixels + aaPaddedRoundedCapSizePixels; + + float pixelPositionAlongLine = aaPaddedLineWithCapsLengthPixels * sidenessNorm.y - aaPaddedRoundedCapSizePixels; + + // Position in pixels with origin at first vertex of line segment + vPosition = vec3( + halfAAPaddedLineWidthAndAmplitudePixels * sideness.x, + pixelPositionAlongLine, + pixelPositionAlongLine / extendedLineLengthPixels + ); + + // The line width radius in pixels + vRadius = lineWidthPixels * 0.5; + vLineLengthPixels = extendedLineLengthPixels; + + // discard short edges below a certain length threshold + ${t.mode===da.SKETCH?V` + if (lineLengthPixels <= 3.0) { + gl_Position = vec4(10.0, 10.0, 10.0, 1.0); + return; + }`:t.mode===da.MIXED?V` + if (lineLengthPixels <= 3.0 && unpackedAttributes.type <= 0.0) { + gl_Position = vec4(10.0, 10.0, 10.0, 1.0); + return; + }`:""} + gl_Position = projPos; + } + + void main() { + ComponentData component = readComponentData(); + UnpackedAttributes unpackedAttributes = unpackAttributes(component); + + vec3 worldPosV0, worldPosV1, viewPosV0, viewPosV1; + worldAndViewFromModelPosition(position0, component.verticalOffset, worldPosV0, viewPosV0); + worldAndViewFromModelPosition(position1, component.verticalOffset, worldPosV1, viewPosV1); + + // Component color + vColor = component.color; + + // Discard fully transparent edges + if (vColor.a < opaqueCutoff) { + gl_Position = vec4(10.0, 10.0, 10.0, 1.0); + return; + } + + if (discardNonSilhouetteEdges(viewPosV0, worldPosV0)) { + return; + } + + // General geometric computation for all types of edges + calculateGeometricOutputs(viewPosV0, viewPosV1, worldPosV0, worldPosV1, worldNormal(), unpackedAttributes); + + // Specific computation for different edge styles + calculateStyleOutputs(unpackedAttributes); + } + `),r.code.add(V` + vec2 lineWithCapsDistance(float radius, vec2 position, float lineLength) { + float positionX = position.x - calculateLineOffset(); + + if (radius < 1.0) { + float coverageX = clamp(min(radius, positionX + 0.5) - max(-radius, positionX - 0.5), 0.0, 1.0); + float coverageY = clamp(min(lineLength, position.y + 0.5) - max(0.0, position.y - 0.5), 0.0, 1.0); + return vec2(0.5 - min(coverageX, coverageY), 0.0); + } + else { + // Between -radius -> 0 for start cap, 0 for line, 0 -> radius + float positionOnCap = position.y - clamp(position.y, 0.0, lineLength); + + vec2 lineToPosition = vec2(positionX, positionOnCap); + return vec2(length(lineToPosition) - radius, positionOnCap / radius); + } + } + + void main() { + ${t.multipassEnabled?"terrainDepthTest(vViewPos.z);":""} + float radius = vRadius * calculateLinePressure(); + + vec2 distance = lineWithCapsDistance(radius, vPosition.xy, vLineLengthPixels); + float coverage = clamp(0.5 - distance.x, 0.0, 1.0); + + discardByCoverage(radius, coverage); + discardBySlice(vWorldPosition); + + fragColor = vec4(vColor.rgb, vColor.a * coverage); + } + `),e}const jDt=yt();let Owe=class extends Ls{constructor(e){super(e,"mat4")}};const GDt=Object.freeze(Object.defineProperty({__proto__:null,build:ize},Symbol.toStringTag,{value:"Module"}));let rze=class nze extends Hr{initializeProgram(e){return new Ir(e.rctx,nze.shader.get().build(this.configuration),mke)}initializePipeline(e){return e.blendMinMax?Ti({blending:Ol(st.ONE,st.ONE,st.ZERO,st.ONE,Xy.ADD,e.blendMinMax.MAX),depthTest:{func:Zr.LEQUAL},colorWrite:ji}):Ti({depthTest:{func:Zr.LEQUAL},depthWrite:rh,colorWrite:ji})}};rze.shader=new Rr(GDt,()=>we(()=>Promise.resolve().then(()=>KWt),void 0));let G0=class extends hu{constructor(){super(...arguments),this.mode=da.SOLID,this.hasSlicePlane=!1,this.silhouette=!1,this.legacy=!1,this.antialiasing=!1,this.doublePrecisionRequiresObfuscation=!1,this.multipassEnabled=!1,this.cullAboveGround=!1,this.spherical=!1}};y([fe({count:da.COUNT})],G0.prototype,"mode",void 0),y([fe()],G0.prototype,"hasSlicePlane",void 0),y([fe()],G0.prototype,"silhouette",void 0),y([fe()],G0.prototype,"legacy",void 0),y([fe()],G0.prototype,"antialiasing",void 0),y([fe()],G0.prototype,"doublePrecisionRequiresObfuscation",void 0),y([fe()],G0.prototype,"multipassEnabled",void 0),y([fe()],G0.prototype,"cullAboveGround",void 0),y([fe()],G0.prototype,"spherical",void 0),y([fe({constValue:!1})],G0.prototype,"occlusionPass",void 0);const HDt=8,kY=128,qDt={type:"uber",hasSlicePlane:!1,strokesTexture:null,legacy:!0,spherical:!0},WDt={solid:da.SOLID,sketch:da.SKETCH,uber:da.MIXED};let zY=class sze{constructor(e,i,r){this._rctx=e,this._shaderTechniqueRepository=i,this._configuration=new G0,this.refCount=0,this._renderables=new Set,this._sortedRenderables={[Wi.TRANSPARENT]:{[Wi.TRANSPARENT]:new Pi,[Wi.OPAQUE]:new Pi},[Wi.OPAQUE]:{[Wi.TRANSPARENT]:new Pi,[Wi.OPAQUE]:new Pi}},this._renderablesDirty=!1,this._drawParameters=new $Dt,this._settings={...qDt,...r},this.key=sze.getKey(this._settings.type,this._settings.hasSlicePlane,this._settings.legacy);const n=this._settings.strokesTexture.variants;this.writerSettings={variants:n,reducedPrecision:Tn.TESTS_DISABLE_OPTIMIZATIONS},this._configuration.legacy=this._settings.legacy,this._configuration.mode=WDt[this._settings.type],this._configuration.silhouette=!1,this._configuration.antialiasing=!!this._rctx.capabilities.blendMinMax,this._configuration.hasSlicePlane=this._settings.hasSlicePlane,this._configuration.doublePrecisionRequiresObfuscation=e.driverTest.doublePrecisionRequiresObfuscation.result,this._configuration.spherical=r.spherical}dispose(){this._technique=ir(this._technique)}addRenderable(e){this._renderables.add(e),this._renderablesDirty=!0}removeRenderable(e){this._renderables.delete(e),this._renderablesDirty=!0}setRenderablesDirty(){this._renderablesDirty=!0}forEachRenderable(e,i){this._renderablesDirty&&this._sortRenderables();const r=this._sortedRenderables[i];r[Wi.TRANSPARENT].forAll(e),r[Wi.OPAQUE].forAll(e)}updateTechnique(e,i){return this._configuration.multipassEnabled=!!e.multipassEnabled,this._configuration.cullAboveGround=!!e.multipassTerrain.cullAboveGround,this._configuration.silhouette=i,this._technique=this._shaderTechniqueRepository.releaseAndAcquire(rze,this._configuration,this._technique),this._technique}bindRegularEdges(e,i){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(i,!1),e,i)}bindSilhouetteEdges(e,i){return this._lastOriginId=null,this._rctx.bindTechnique(this.updateTechnique(i,!0),e,i)}renderRegularEdges(e,i,r,n,s){this._render(e,i,i.regular.vao,r,n,s)}renderSilhouetteEdges(e,i,r,n,s){this._render(e,i,i.silhouette.vao,r,n,s)}_render(e,i,r,n,s,o){o>0&&(this._bindDraw(e,i,n,s),this._rctx.bindVAO(r),this._rctx.drawArraysInstanced(sr.TRIANGLE_FAN,0,4,o))}_bindDraw(e,i,r,n){if(this._drawParameters.componentDataTexture=i.components.buffer.textureBuffer.texture,this._drawParameters.strokesTexture=this._settings.strokesTexture,"origin"in i.transform)this._lastOriginId!==i.transform.origin.origin.id&&(e.setUniformMatrix4fv("localView",i.transform.origin.viewMatrix),this._lastOriginId=i.transform.origin.origin.id),e.setUniformMatrix4fv("model",i.transform.modelMatrix),this._drawParameters.slicePlaneLocalOrigin=i.transform.origin.origin.vec3;else{const s=new PG(i.transform.position),o=Xf(Pwe,_E(Pwe,i.transform.rotationScale));this._drawParameters.transformWorldFromModelTL=s.low,this._drawParameters.transformWorldFromModelTH=s.high,this._drawParameters.transformWorldFromModelRS=i.transform.rotationScale,this._drawParameters.transformNormalGlobalFromModel=o;const l=n.camera.viewInverseTransposeMatrix;Ie(this._drawParameters.slicePlaneLocalOrigin,l[3],l[7],l[11])}e.bindDraw(this._drawParameters,n,r)}_sortRenderables(){this._renderablesDirty=!1,this._sortedRenderables[Wi.TRANSPARENT][Wi.TRANSPARENT].clear(),this._sortedRenderables[Wi.TRANSPARENT][Wi.OPAQUE].clear(),this._sortedRenderables[Wi.OPAQUE][Wi.TRANSPARENT].clear(),this._sortedRenderables[Wi.OPAQUE][Wi.OPAQUE].clear(),this._renderables.forEach(i=>{i.objectTransparency!==Wi.INVISIBLE&&i.edgeTransparency!==Wi.INVISIBLE&&this._sortedRenderables[i.objectTransparency][i.edgeTransparency].push(i)});const e=(i,r)=>"origin"in i.transform?"origin"in r.transform?i.transform.origin.origin.idr.transform.origin.origin.id?1:0:1:0;this._sortedRenderables[Wi.TRANSPARENT][Wi.TRANSPARENT].sort(e),this._sortedRenderables[Wi.TRANSPARENT][Wi.OPAQUE].sort(e),this._sortedRenderables[Wi.OPAQUE][Wi.TRANSPARENT].sort(e),this._sortedRenderables[Wi.OPAQUE][Wi.OPAQUE].sort(e)}static getKey(e,i,r){return`edges-t:${e}:${i}:${r}`}};const Pwe=Tc();function Yfi(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new k1t(t.layout)}}function A8(t){return new pLe(t.layout).createView(t.buffer)}let YDt=class extends tFe{constructor(e){super("EdgeProcessingWorker","extract",{extract:i=>[i.dataBuffer],extractComponentsEdgeLocations:i=>[i.dataBuffer],extractEdgeLocations:i=>[i.dataBuffer]},e)}async process(e,i,r){if(r)return f6t(e);const n=await this.invoke(new UY(e),i);return this._unpackOutput(n)}async extractEdgeLocations(e,i){const r=await this.invokeMethod("extractEdgeLocations",new UY(e),i);return A8(r)}async extractComponentsEdgeLocations(e,i){const r=await this.invokeMethod("extractComponentsEdgeLocations",new UY(e),i);return A8(r)}_unpackOutput(e){return{regular:{instancesData:A8(e.regular.instancesData),lodInfo:{lengths:new Float32Array(e.regular.lodInfo.lengths)}},silhouette:{instancesData:A8(e.silhouette.instancesData),lodInfo:{lengths:new Float32Array(e.silhouette.lodInfo.lengths)}},averageEdgeLength:e.averageEdgeLength}}},UY=class{constructor(e){this.dataBuffer=e.data.buffer,this.writerSettings=e.writerSettings,this.skipDeduplicate=e.skipDeduplicate,this.indices=zf(e.indices)?e.indices:e.indices.buffer,this.indicesType=zf(e.indices)?"Array":HV(e.indices)?"Uint32Array":"Uint16Array",this.indicesLength=e.indicesLength}};function XDt(t){const i=LR.resolution,r=i/2,n=new Uint8Array(4*i*i),s=4*i*r,o=LR.amplitude,l=2*o,c=4*i,f=Math.log2(i)+1,_=LR.strokes.length;let x=(f-1)*_*c;for(const{distance:A,pressure:M}of LR.strokes){let I=A,L=M,F=x;for(let z=0;z0}function KDt(t){return t.size*t.color[3]>0}function Nwe(t,e,i,r){for(let n=0;nthis._discardObjectEntry(e)),this._perObjectData.clear(),this._strokesTexture=Kt(this._strokesTexture),this._componentColorManager=et(this._componentColorManager),this._workerAbort.abort(),this._worker.destroy(),this._verticesBufferObject=Kt(this._verticesBufferObject),this._renderers.clear(),this._updatingHandles.destroy(),this._set("schedule",rNt))}get updating(){return this._updatingHandles.updating}get usedMemory(){return this._gpuMemoryUsage}shouldRender(){return this._renderers.size>0}async addComponentObject(e,i,r,n,s,o,l,c){if(this.hasObject(e))return this.getObjectMemoryUsage(e);let f;const _=new kwe(new Promise(T=>f=T),r.center,r.radius);this._perObjectData.set(e,_);const x=await this._updatingHandles.addPromise(this._addComponentGeometry(i,_,n,s,o,l,c));return this.setNeedsRender(),f(),x}async addOrUpdateObject3D(e,i,r,n){if(this.destroyed)return void Ce.getLogger(this).warn("Attempt to add an object to a destroyed instance");const s=this._perObjectData.get(e);let o;(s==null?void 0:s.renderables.length)>0&&this._perObjectDataEvictionCache.add(s);const l=e.boundingVolumeWorldSpace.bounds,c=new kwe(new Promise(_=>o=_),l,Zv(l));this._perObjectData.set(e,c);const f=new Array;if(r.mergeGeometries&&e.geometries.length>1&&QDt(e))f.push(this._addObjectMergedGeometries(e,c,i,r,n));else for(let _=0;_1)return!1;const[s]=n,o=s.transform;if(!(o instanceof VY))return!1;const[l]=r;if(l.localOrigin!==o.origin.origin)return!1;const c=Qe(),f=this._computeModelTransformWithLocalOrigin(e,l,c);return s.transform=new VY(c,f),this.setNeedsRender(),!0}_discardObjectEntry(e){e&&(e.renderables.length&&(e.renderables.forEach(i=>this._removeRenderable(i)),this.setNeedsRender()),e.loaded=null)}hasObject(e){return this._perObjectData.has(e)}async updateAllComponentOpacities(e,i){const r=await this._updatingHandles.addPromise(this._getObjectEntry(e));if(r==null)return;const n=i instanceof Array?s=>i[s]:()=>i;r.renderables.forEach(s=>{const o=s.components.meta.length;for(let l=0;lr+n.statistics.gpuMemoryUsage,0):0}async updateAllComponentMaterials(e,i,r,n){const s=e instanceof X_,o=!!r.hasSlicePlane,l=$we(i),c=zY.getKey(l,o,s),f=await this._updatingHandles.addPromise(this._getObjectEntry(e));f!=null&&(f.renderables.forEach(_=>{if(c!==_.rendererKey){const x=this._renderers.get(_.rendererKey),T=this._acquireRenderer(l,o,s);x.removeRenderable(_),--x.refCount,_.rendererKey=c,T.addRenderable(_)}for(let x=0;x{const s=n.components.meta;for(let o=0;on.visible=i),this.setNeedsRender())}removeObject(e){const i=this._perObjectData.get(e);i&&(this._perObjectData.delete(e),this._discardObjectEntry(i))}async _getObjectEntry(e){const i=this._perObjectData.get(e);if(!i)throw new Error("no object");return await i.loaded,i.loaded==null?null:i}render(e,i){if(this._componentColorManager==null)return;this._localOrigins.updateViewMatrices(e.camera.viewMatrix);const r=e.camera.viewInverseTransposeMatrix,n=W(),s=new PG;let o=0,l=0;if(this._renderers.forEach(f=>{if(f.refCount===0)return this._renderers.delete(f.key),void f.dispose();let _=!0,x=!0;f.forEachRenderable(T=>{T.visible&&(o+=T.statistics.averageEdgeLength,l++,_&&T.regular&&(f.updateTechnique(e,!1),_=!1),x&&T.silhouette&&(f.updateTechnique(e,!0),x=!1))},i)}),this._componentColorManager.garbageCollect(),this._componentColorManager.updateTextures(),l===0)return;const c=new IDt(40*o/l,i);Ie(n,r[3],r[7],r[11]),s.set(n),Ne(c.transformWorldFromViewTH,s.high),Ne(c.transformWorldFromViewTL,s.low),Yf(c.transformViewFromCameraRelativeRS,e.camera.viewMatrix),Xf(Bwe,c.transformViewFromCameraRelativeRS),_E(c.transformNormalViewFromGlobal,Bwe),c.transformProjFromView=e.camera.projectionMatrix,this._updateObjectCameraDistances(e),this._renderers.forEach(f=>{this._renderRegularEdges(f,e,c),this._renderSilhouetteEdges(f,e,c)})}_updateTransparency(e){const i=Lwe(e.components.meta),r=Dwe(e.components.meta);i===e.edgeTransparency&&r===e.objectTransparency||(e.edgeTransparency=i,e.objectTransparency=r,this._renderers.get(e.rendererKey).setRenderablesDirty())}_computeModelTransformWithLocalOrigin(e,i,r){e.getCombinedShaderTransformation(i,r);const n=i.localOrigin!=null?this._localOrigins.register(i.localOrigin):this._localOrigins.acquire(Ie(this._tmpModelPosition,r[12],r[13],r[14]));return i.localOrigin=n.origin,MDt(n.origin.vec3,r),n}_updateComponentBuffer(e){const{meta:i,buffer:r}=e,n=new Uint8Array(4);for(let s=0;sthis._verticesBufferObject!=null?new tNt(new qm(this.rctx,mke,{vertices:r6t,instances:_===zS.REGULAR?gV.glLayout:yV.glLayout},{vertices:this._verticesBufferObject,instances:Yr.createVertex(this.rctx,Pr.STATIC_DRAW,_===zS.REGULAR?e.regular.instancesData.buffer:e.silhouette.instancesData.buffer)}),_===zS.REGULAR?e.regular.lodInfo:e.silhouette.lodInfo):null,l=e.regular.lodInfo.lengths.length>0?o(zS.REGULAR):null,c=e.silhouette.lodInfo.lengths.length>0?o(zS.SILHOUETTE):null,f=((l==null?void 0:l.vao.usedMemory)??0)+((c==null?void 0:c.vao.usedMemory)??0);return new iNt(l,c,{gpuMemoryUsage:f,externalMemoryUsage:s,averageEdgeLength:e.averageEdgeLength},r,Lwe(i.meta),Dwe(i.meta),i,n)}async _addGeometry(e,i,r,n,s,o){if(r.edgeIndicesLength<=0)return;const l=r.attributes.get(J.POSITION),c=Qe(),f=this._computeModelTransformWithLocalOrigin(e,r,c),_=new Vwe(l,c,f);return this._addPositionData(i,_,r.edgeIndicesLength,n,s,o)}async _addPositionData(e,i,r,n,s,o=!1){if(e.loaded==null)return;const l=this._createComponentBuffers([n]);if(l==null)return;const c=this._acquireRenderer(n.type,!!s.hasSlicePlane,!0),{modelTransform:f,origin:_}=i,x=i.position.indices,T=i.position,A=T.data.length/T.size,M=fV.createBuffer(A);for(let F=0;F{if(k.edgeIndicesLength<=0||!k.material.supportsEdges)return!1;!c&&k.localOrigin&&(c=k);const U=k.attributes.get(J.POSITION);return f+=U.data.length/U.size,l+=k.edgeIndicesLength,!0});if(_.length===0)return;const x=f>=65536?Uint32Array:Uint16Array,T=l?new x(l):null,A=[];let M=0;_.forEach(k=>{const U=k.attributes.get(J.POSITION),j=U.indices;let H=o.get(U.data);if(H==null){H=A.length/3;for(let Y=0;Y{xn(n,o.center,i);const l=Ve(n,r),c=o.radius,f=l<-c?1/0:l_.distanceToCamera=f)};this._perObjectData.forEach(s),this._perObjectDataEvictionCache.forEach(s)}_renderRegularEdges(e,i,r){const n=e.bindRegularEdges(r,i),s=r.transparency,o=i.camera.perScreenPixelRatio;e.forEachRenderable(l=>{if(!zwe(l)||!l.visible)return;const c=M8(l.regular.lod.lengths,l.distanceToCamera,o);e.renderRegularEdges(n,l,r,i,c)},s)}_renderSilhouetteEdges(e,i,r){const n=e.bindSilhouetteEdges(r,i),s=r.transparency,o=i.camera.perScreenPixelRatio;e.forEachRenderable(l=>{if(!Uwe(l)||!l.visible)return;const c=M8(l.silhouette.lod.lengths,l.distanceToCamera,o);e.renderSilhouetteEdges(n,l,r,i,c)},s)}get test(){return{hasRenderedPrimitives:e=>{let i=!1;const r=e.perScreenPixelRatio,n=(s,o)=>s.forEachRenderable(l=>{l.visible&&!i&&(zwe(l)&&(i=M8(l.regular.lod.lengths,l.distanceToCamera,r)>0),!i&&Uwe(l)&&(i=M8(l.silhouette.lod.lengths,l.distanceToCamera,r)>0))},o);return this._renderers.forEach(s=>{i||(n(s,Wi.OPAQUE),n(s,Wi.TRANSPARENT))}),i},getObjectData:e=>this._perObjectData.get(e)}}};function Fwe(t){t!=null&&(t.vao.vertexBuffers.instances.dispose(),t.vao.disposeVAOOnly(),t.vao=null)}function QDt(t){let e=null,i=null;for(let r=0;r{this.loaded!=null&&(this.loaded=!0)})}},eNt=class{constructor(e,i){this.buffer=e,this.meta=i}},tNt=class{constructor(e,i){this.vao=e,this.lod=i}},VY=class{constructor(e,i){this.modelMatrix=e,this.origin=i}};class iNt{constructor(e,i,r,n,s,o,l,c){this.regular=e,this.silhouette=i,this.statistics=r,this.transform=n,this.edgeTransparency=s,this.objectTransparency=o,this.components=l,this.rendererKey=c,this.distanceToCamera=0,this.visible=!0}}function zwe(t){return t.regular!=null}function Uwe(t){return t.silhouette!=null}function M8(t,e,i){const r=e*i,n=D3e(t,r,!0);return n===-1?rPromise.reject();function Ym(t){return window.WebGL2RenderingContext&&t instanceof window.WebGL2RenderingContext}let jwe=class{constructor(e,i,r,n,s,o,l,c,f){this.createQuery=e,this.deleteQuery=i,this.resultAvailable=r,this.getResult=n,this.disjoint=s,this.beginTimeElapsed=o,this.endTimeElapsed=l,this.createTimestamp=c,this.timestampBits=f}},sv=!1;function nNt(t,e){if(e.disjointTimerQuery)return null;let i=t.getExtension("EXT_disjoint_timer_query_webgl2");return i&&Ym(t)?new jwe(()=>t.createQuery(),r=>{t.deleteQuery(r),sv=!1},r=>t.getQueryParameter(r,t.QUERY_RESULT_AVAILABLE),r=>t.getQueryParameter(r,t.QUERY_RESULT),()=>t.getParameter(i.GPU_DISJOINT_EXT),r=>{sv||(sv=!0,t.beginQuery(i.TIME_ELAPSED_EXT,r))},()=>{t.endQuery(i.TIME_ELAPSED_EXT),sv=!1},r=>i.queryCounterEXT(r,i.TIMESTAMP_EXT),()=>t.getQuery(i.TIMESTAMP_EXT,i.QUERY_COUNTER_BITS_EXT)):(i=t.getExtension("EXT_disjoint_timer_query"),i?new jwe(()=>i.createQueryEXT(),r=>{i.deleteQueryEXT(r),sv=!1},r=>i.getQueryObjectEXT(r,i.QUERY_RESULT_AVAILABLE_EXT),r=>i.getQueryObjectEXT(r,i.QUERY_RESULT_EXT),()=>t.getParameter(i.GPU_DISJOINT_EXT),r=>{sv||(sv=!0,i.beginQueryEXT(i.TIME_ELAPSED_EXT,r))},()=>{i.endQueryEXT(i.TIME_ELAPSED_EXT),sv=!1},r=>i.queryCounterEXT(r,i.TIMESTAMP_EXT),()=>i.getQueryEXT(i.TIMESTAMP_EXT,i.QUERY_COUNTER_BITS_EXT)):null)}function sNt(t,e){const i=t.capabilities.disjointTimerQuery;return i==null?null:new oNt(i,e)}let oNt=class{constructor(e,i){this._timer=e,this._queryPool=new Array,this._queryResults=new Map,this._currentQuery=null,i.forEach(r=>{const n=this._timer.createQuery(),s=this._timer.createQuery();this._queryPool.push(n,s),this._queryResults.set(r,null)})}start(){sv||(this._currentQuery=this._queryPool.pop(),this._currentQuery!=null&&(this._timer.disjoint(),this._timer.beginTimeElapsed(this._currentQuery)))}stop(e){if(this._timer.disjoint()||this._currentQuery==null||!this._queryResults.has(e))return this.abort(),null;this._timer.endTimeElapsed();const i=this._queryResults.get(e);if(i==null)return this._queryResults.set(e,this._currentQuery),this._currentQuery=null,null;if(!this._timer.resultAvailable(i))return this._queryPool.unshift(this._currentQuery),this._currentQuery=null,null;const r=this._timer.getResult(i)/1e6;return this._queryPool.unshift(i),this._queryResults.set(e,this._currentQuery),this._currentQuery=null,r}abort(){this._currentQuery!=null&&(this._timer.deleteQuery(this._currentQuery),this._queryPool.unshift(this._timer.createQuery()),this._currentQuery=null)}dispose(){this._currentQuery!=null&&this._timer.deleteQuery(this._currentQuery),this._queryPool.forEach(e=>{this._timer.deleteQuery(e)}),this._queryResults.forEach(e=>{e!=null&&this._timer.deleteQuery(e)})}};var Gn;(function(t){t.OVERLAY="overlay",t.PREPARE="prepare",t.SHADOW_MAP="shadow map",t.LINEAR_DEPTH="linear depth",t.ACCUMULATED_SHADOWS="accumulated shadows",t.OBJECT_AND_LAYER_ID_COLOR="object/layer id color",t.SSAO="SSAO",t.OPAQUE="opaque",t.OPAQUE_EDGES="opaque edges",t.VOXEL="voxel",t.TRANSPARENT="transparent",t.TRANSPARENT_EDGES="transparent edges",t.HUD_VISIBILITY="HUD visibility",t.TRANSPARENT_TERRAIN="transparent terrain",t.ENVIRONMENT="environment",t.LASER_LINES="laser lines",t.OCCLUDED="occluded",t.ANTIALIASING="antialiasing",t.HIGHLIGHTS="highlights",t.HUD="HUD",t.HUD_OCCLUDED="HUD occluded",t.FINISH="finish"})(Gn||(Gn={}));const Gwe="Total";let aNt=class{constructor(e){this._rctx=e,this._startTimeStampCPU=0,this._lastTimeStampCPU=0,this._totalCPUTime=new zv(Gwe),this._cpuTimeSamplers=new Map(Object.values(Gn).map(i=>[i,new zv(i)])),this._enableGPUTimer=0,this._totalGPUTime=new zv("GPU"),this._gpuTimeSamplers=new Map(Object.values(Gn).map(i=>[i,new zv(i)])),this._totalTime=0,this._totalFrameCount=0}get totalCPUTimeSampler(){return this._totalCPUTime}get cpuTimeSamplers(){return Array.from(this._cpuTimeSamplers.values())}get totalGPUTimeSampler(){return this._totalGPUTime}get gpuTimeSamplers(){return Array.from(this._gpuTimeSamplers.values())}get gpuSamplingEnabled(){return this._gpuTimerPool!=null}get totalTime(){return this._totalTime}get totalFrameCount(){return this._totalFrameCount}get elapsedTime(){return performance.now()-this._startTimeStampCPU}enableGPUPerformanceInfo(){if(this._gpuTimerPool==null){const i=[...Object.values(Gn),Gwe];this._gpuTimerPool=sNt(this._rctx,i)}if(this._gpuTimerPool==null)return{hasGPUTimerSupport:!1,remove:()=>{}};++this._enableGPUTimer;let e=!1;return{hasGPUTimerSupport:!0,remove:()=>{e||(e=!0,--this._enableGPUTimer,this._enableGPUTimer===0&&(this._gpuTimerPool=Kt(this._gpuTimerPool)))}}}startFrame(){this._startTimeStampCPU=this._lastTimeStampCPU=performance.now(),this._gpuTimerPool&&this._gpuTimerPool.start()}advance(e){const i=performance.now();if(this._cpuTimeSamplers.get(e).record(i-this._lastTimeStampCPU),this._lastTimeStampCPU=i,this._gpuTimerPool){const r=this._gpuTimerPool.stop(e);this._gpuTimeSamplers.get(e).record(r),this._gpuTimerPool.start()}}finishFrame(){if(this._gpuTimerPool){const i=this._gpuTimerPool.stop(Gn.FINISH);this._gpuTimeSamplers.get(Gn.FINISH).record(i),this._rctx.gl.flush()}const e=performance.now()-this._startTimeStampCPU;this._totalTime=this._totalTime+e,this._totalCPUTime.record(e),this._gpuTimerPool&&this._totalGPUTime.record(this.gpuTimeSamplers.reduce((i,r)=>i+(r.last||0),0)),++this._totalFrameCount}},Ld=class extends ze{get _bindParameters(){return this._renderContext.bindParameters}updateRenderFeatures(e=null,i=!Le("disable-feature:high-quality-idle")){this._renderStateFeatures=Gq(i,e),this.notifyChange("_renderStateFeatures"),this._renderPlugins.renderFeatureChanged(),this._requestRender()}isFeatureEnabled(e,i=this._state){return this._renderStateFeatures.get(i,e)??!1}setFeatureEnabled(e,i,r){this._renderStateFeatures.set(i,e,r),this.notifyChange("_renderStateFeatures"),this._requestRender()}get _highQualityTransparency(){return this._highQualityTransparencyEnabled||this.isFeatureEnabled(Zo.HighQualityTransparency)}get hasReflections(){return this.hasWater&&(this._ssrEnabled||this.isFeatureEnabled(Zo.WaterReflection))}get hasDecorations(){return this._materialRenderersHas.decorations||this._renderPlugins.hasDecorations}get hasHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.produces(ke.OPAQUE_MATERIAL,ue.Highlight)||this._renderPlugins.produces(ke.DRAPED_MATERIAL,ue.Highlight)}get hasShadowHighlights(){return this._materialRenderersHas.highlights||this._renderPlugins.produces(ke.OPAQUE_MATERIAL,ue.ShadowHighlight)}get _magnifierEnabled(){return this._bindParameters.decorations===Xh.ON&&this._magnifierHelper.enabled}get fullResolutionAtmosphere(){return this._stage.view.qualitySettings.highResolutionAtmosphere||this.isFeatureEnabled(Zo.HighResolutionAtmosphere)}get hasWater(){return this._materialRenderersHas.water||this._hasOverlayWater}constructor(e,i,r,n,s,o,l,c){super({}),this._stage=e,this._techniqueRepository=n,this._rctx=s,this._compositingHelper=o,this._magnifierHelper=l,this._requestRender=c,this._materialRenderers=new Pi,this._needsTransparentPass=!1,this._materialRenderersHas={hudElements:!1,highlights:!1,water:!1,decorations:!1,occludees:!1},this._hasOverlayWater=!1,this.renderOverlay=f=>{},this._isRendering=!1,this._backgroundColor=Mi(0,0,0,1),this._sliceHelper=new ADt,this._state=Vr.IDLE,this._highQualityTransparencyEnabled=!0,this._terrainTransparency=ru.Opaque,this._ssrEnabled=!1,this._hasAnimations=!1,this._animationTimestep=new dDt,this._renderHiddenTransparentEdges=()=>{},this._pluginInput=new X6t,this._releaseGeometryLinearDepth=f=>f==null?void 0:f.release(),this._geometryLinearDepthFormat=la.DEPTH16_BUFFER,this.fboCache=new vyt(s),this._renderStateFeatures=Gq(!Le("disable-feature:high-quality-idle"),e.view.qualityProfile),this._offscreen=new vDt(this.fboCache,this._compositingHelper),this.performanceInfo=new aNt(this._rctx),this._shadowMap=new Xle(this.fboCache,e.viewingMode),this._highlight=new EI({view:e.view}),this._shadowHighlight=new QA({view:e.view,viewingMode:e.viewingMode}),this._shadowAccumulator=new Pu(this.fboCache,n,e,f=>{const _=this.shadowsEnabled;this._shadowMap.enabled=!0,this._prepare(f.camera,f.contentCamera),this._renderPlugins.prepareRender(),this._shadowMap.enabled=_},(f,_,x)=>{f.shadowMap.start(f.camera,_,x,!0,this._stage.view.qualitySettings.maximumPixelRatio),this._renderShadowCascades(ue.Shadow,f.shadowMap),f.shadowMap.finish(),f.camera.setGLViewport(this._rctx),this._prepare(f.camera,f.contentCamera)},c),this._ssao=new uI({view:this._stage.view}),this._renderContext=new WEt(this._rctx,this._offscreen,this._shadowMap,this._sliceHelper),this._renderPlugins=new bk({renderContext:this._renderContext,techniqueRepository:n,textureRepository:r,materialRepository:i,requestRender:c,controller:e,fbos:this.fboCache,isFeatureEnabled:f=>this.isFeatureEnabled(f)}),this.renderPassManager=new ire,this._renderPlugins.add(this.renderPassManager),this._smaa=new sS({view:this._stage.view}),this._renderPlugins.add(this._smaa),this._blit=new KA({opacity:1,alphaMode:yc.None}),this._renderPlugins.add(this._blit),this._renderPlugins.add(this._ssao),this._renderPlugins.add(this._highlight),this._renderPlugins.add(this._shadowHighlight),this.addHandles([_e(()=>this._stage.view.state.camera,()=>c(),kt),_e(()=>Tn.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES,f=>{this._renderHiddenTransparentEdges=f?()=>this._renderEdges(Wi.TRANSPARENT):()=>{},c()},ii),_e(()=>{var f;return(f=this._stage.view.environment.background)==null?void 0:f.color},f=>{const _=f?AL(f):gp;rs(this._backgroundColor,_[0]*_[3],_[1]*_[3],_[2]*_[3],_[3]),c()},kt)])}normalizeCtorArgs(){return{}}destroy(){this._smaa.destroy(),this._blit.destroy(),this._gpuTimerHandle=en(this._gpuTimerHandle),this._materialRenderers.forAll(e=>e.dispose()),this._materialRenderers.clear(),this._offscreen.dispose(),this._shadowMap.dispose(),this._ssao.destroy(),this._highlight.dispose(),this._shadowHighlight.destroy(),this._shadowAccumulator.dispose(),this._edgeView=et(this._edgeView),this.renderPassManager.dispose(),this._releaseFBOs(),this._disposeOffscreenBuffers(),this.fboCache.destroy(),_Le.prune()}_releaseFBOs(){this._bindParameters.ssr.lastFrameColor=ir(this._bindParameters.ssr.lastFrameColor),this._bindParameters.multipassTerrain.linearDepth=ir(this._bindParameters.multipassTerrain.linearDepth),this._bindParameters.multipassGeometry.linearDepth=ir(this._bindParameters.multipassGeometry.linearDepth)}_disposeOffscreenBuffers(){this._offscreen.dispose(),this._disposeBindBuffers()}_disposeBindBuffers(){this._shadowMap.disposeOffscreenBuffers(),this._bindParameters.linearDepth=ir(this._bindParameters.linearDepth),this._bindParameters.hudVisibility=ir(this._bindParameters.hudVisibility)}get updating(){return this._smaa.updating||this._edgeView!=null&&this._edgeView.updating||this._shadowAccumulator.running||this._renderPlugins.updating||!this.isCameraFinal}ensureEdgeView(){if(this._edgeView==null){const e=this._stage.view.resourceController;this._edgeView=new H0({rctx:this._rctx,renderSR:this._stage.view.renderSpatialReference,viewingMode:this._stage.viewingMode,techniqueRepository:this._techniqueRepository,setNeedsRender:()=>this._requestRender(),schedule:lNt(e)}),this.addHandles(_e(()=>{var i;return(i=this._edgeView)==null?void 0:i.updating},()=>this._requestRender(),Li)),this._requestRender()}return this._edgeView}get edgeView(){return this._edgeView}get isCameraFinal(){return CB(this._bindParameters.ssr.reprojectionMatrix,gs)}set _reprojectionMatrix(e){jre(this._bindParameters.ssr.reprojectionMatrix,e)&&this.notifyChange("isCameraFinal")}get shadowsEnabled(){var e;return!!((e=this._shadowMap)!=null&&e.enabled)}setParameters(e){var n;const{_shadowMap:i,_bindParameters:r}=this;if(((n=e.qualitySettings)==null?void 0:n.reflections)!==void 0&&this._ssrEnabled!==e.qualitySettings.reflections&&(this._ssrEnabled=e.qualitySettings.reflections,this._requestRender()),e.shadowMap!==void 0&&this._shadowMap.enabled!==e.shadowMap&&(this._shadowMap.enabled=e.shadowMap,this._requestRender()),e.shadowMapMaxCascades!==void 0&&i.maxCascades!==e.shadowMapMaxCascades&&(i.maxCascades=e.shadowMapMaxCascades,this._requestRender()),e.environment!=null){e.environment.weather!=null&&(this._bindParameters.weather=e.environment.weather,this._bindParameters.weatherVisible=!!e.weatherVisible);const s=e.environment.lighting.type!=="virtual";r.enableFillLights!==s&&(r.enableFillLights=s,this._requestRender())}e.highQualityTransparency!==void 0&&this._highQualityTransparencyEnabled!==e.highQualityTransparency&&(this._highQualityTransparencyEnabled=e.highQualityTransparency,this._requestRender()),e.hasOverlayWater!==void 0&&this._hasOverlayWater!==e.hasOverlayWater&&(this._hasOverlayWater=e.hasOverlayWater,this._requestRender()),e.slicePlane!==void 0&&this._sliceHelper.plane!==e.slicePlane&&(this._sliceHelper.plane=e.slicePlane,this._requestRender()),e.terrainTransparency!==void 0&&this._terrainTransparency!==e.terrainTransparency&&(this._terrainTransparency=e.terrainTransparency,this._requestRender()),e.shadowCastOptions!==void 0&&this._shadowAccumulator.setOptions(e.shadowCastOptions)}get hasSlicePlane(){return!!this._sliceHelper.plane}get renderPlugins(){return this._renderPlugins}get _hasOITSupport(){return this._rctx.driverTest.floatBufferBlend.result}get _oitEnabled(){return this._highQualityTransparency&&this._hasOITSupport}modify(e,i){this._isRendering&&console.warn("Renderer.modify called while rendering");const{adds:r,removes:n,updates:s}=e;if(r.length===0&&n.length===0&&s.length===0)return;const o=NNe(e);let l=!1;o.forEach((c,f)=>{if(i.done)return;let _=this._materialRenderers.find(x=>x.material===f);if(_==null&&c.adds.length>0){const x=new A$({material:f});x.initializeRenderContext(this._renderPlugins._context),_=x,this._materialRenderers.push(_)}_&&(_.modify(c),_.isEmpty&&(l=!0)),c.removes.forEach(x=>e.removes.removeUnordered(x)),c.adds.forEach(x=>e.adds.removeUnordered(x)),c.updates.forEach(x=>e.updates.removeUnordered(x)),i.madeProgress()}),l&&this._materialRenderers.filterInPlace(c=>!c.isEmpty||(c.dispose(),!1)),this._updateHasFlags(),this._requestRender()}_updateHasFlags(){const e=this._materialRenderersHas;e.decorations=!1,e.highlights=!1,e.hudElements=!1,e.water=!1,e.occludees=!1,this._materialRenderers.forAll(i=>{e.highlights||(e.highlights=i.hasHighlights),e.occludees||(e.occludees=i.hasOccludees),e.water||(e.water=i.hasWater),e.decorations||(e.decorations=i.isDecoration),e.hudElements||(e.hudElements=i.material.produces(ke.LINE_CALLOUTS_HUD_DEPTH,ue.Color)||i.material.produces(ke.HUD_MATERIAL,ue.Color)||i.material.produces(ke.LABEL_MATERIAL,ue.Color))}),this._bindParameters.hasOccludees=e.occludees}updateAnimation(e){const i=this._hasAnimations;return this._hasAnimations=!1,this._materialRenderers.forAll(r=>this._hasAnimations=r.updateAnimation(e)||this._hasAnimations),this._hasAnimations=this._renderPlugins.updateAnimation(e)||this._hasAnimations,this._hasAnimations!==i&&(this._gpuTimerHandle=i?en(this._gpuTimerHandle):this.performanceInfo.enableGPUPerformanceInfo()),this._hasAnimations}get animationTimestep(){return this._animationTimestep.value}get animationTimeDilation(){return this._animationTimestep.timeDilation}resetAnimation(){this._animationTimestep.clear()}tick(){this.fboCache.clean()}render(e,i,r,n,s){const o=e!=null;this._isRendering=!0,this.performanceInfo.startFrame(),this.fboCache.frame(),this._disposeBindBuffers();const l=this._offscreen,{camera:c,contentCamera:f,mode:_,alignPixelEnabled:x}=r;this._state=_,this._bindParameters.overlay=this.renderOverlay(s),this.performanceInfo.advance(Gn.OVERLAY),this._renderContext.time=s,this._bindParameters.transparencyPassType=Jt.NONE,this._bindParameters.alignPixelEnabled=x,this._bindParameters.decorations=n;const T=U_(this._sliceHelper.plane);n===Xh.OFF&&(this._sliceHelper.plane=null),c.setGLViewport(this._rctx);const A=l.initializeFrame(c,this._backgroundColor,o);this.hasReflections?this._bindParameters.ssr.lastFrameColor=A:A==null||A.release(),this._prepare(c,f),this._renderPlugins.prepareRender(),this.performanceInfo.advance(Gn.PREPARE);const M=this._computeDepthRange(c);this._renderShadowMap(c,this._bindParameters.lighting.mainLight.direction,M),this.performanceInfo.advance(Gn.SHADOW_MAP),this._ensureBindParameters(c,f);const I=this._renderPlugins.produces(ke.OPAQUE_TERRAIN)&&(this._terrainTransparency===ru.Semitransparent||this._terrainTransparency===ru.TransparentWithDraped),L=this._highQualityTransparency&&I,F=this._needsTransparentPass||this._renderPlugins.produces(ke.TRANSPARENT_MATERIAL);this._prepareShaders(L,F),this._renderLinearDepth(),this.performanceInfo.advance(Gn.LINEAR_DEPTH),this._renderShadowAccumulation(M,c,f),this.performanceInfo.advance(Gn.ACCUMULATED_SHADOWS),this._ensureBindParametersSSR(s),this._renderSSAO(),this.performanceInfo.advance(Gn.SSAO),this._renderContext.output=ue.Color,l.bindFbo(),this._renderOpaqueGeometry(),this._renderPlugins.render(ke.ENVIRONMENT_OPAQUE),this.performanceInfo.advance(Gn.OPAQUE),this._renderTerrainLinearDepth(L),this._setMultipassTerrain(L),this._renderEdges(Wi.OPAQUE),this.performanceInfo.advance(Gn.OPAQUE_EDGES),l.bindFbo(),this._renderPlugins.render(ke.VOXEL),this.performanceInfo.advance(Gn.VOXEL),this._renderHiddenTransparentEdges(),F&&(this._oitEnabled?this._renderOITPass(jM.Geometry):this._renderTransparentMaterial()),this.performanceInfo.advance(Gn.TRANSPARENT);const z=this._renderGeometryLinearDepth(L);this._renderHUDVisibility(z),L||this._renderInternalSlot(ke.LINE_CALLOUTS),this.performanceInfo.advance(Gn.HUD_VISIBILITY),this._renderObjectAndLayerIdColor(i),this.performanceInfo.advance(Gn.OBJECT_AND_LAYER_ID_COLOR),this._renderEdges(Wi.TRANSPARENT,z),this._releaseGeometryLinearDepth(z),this.performanceInfo.advance(Gn.TRANSPARENT_EDGES);const k=I?this._renderTransparentTerrain():null;k&&this._bindParameters.hudVisibility&&(L?this._renderLineCallouts(Ih.Occluded):l.compositeToHUDVisibility(this._bindParameters,k.colorTexture),this._renderHUD(Ih.Occluded,l.color),this.performanceInfo.advance(Gn.HUD_OCCLUDED)),this.performanceInfo.advance(Gn.TRANSPARENT_TERRAIN),this._setTerrainCulling(!1),k&&(l.compositeToFramebuffer(this._bindParameters,k.colorTexture,yc.PremultipliedAlpha,1),k.release(),L&&(this._renderEdges(Wi.OPAQUE),this.performanceInfo.advance(Gn.OPAQUE_EDGES),F&&(this._oitEnabled?this._renderOITPass(jM.Geometry):this._renderTransparentMaterial()),this.performanceInfo.advance(Gn.TRANSPARENT),this._renderEdges(Wi.TRANSPARENT),this.performanceInfo.advance(Gn.TRANSPARENT_EDGES))),this._bindParameters.ssao=ir(this._bindParameters.ssao),L&&this._renderLineCallouts(Ih.NotOccluded),this._setMultipassEnabled(!1),this._shadowAccumulator.render(this._bindParameters),l.bindFbo(),this._renderInternalSlot(ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderPlugins.render(ke.ENVIRONMENT_TRANSPARENT),this.performanceInfo.advance(Gn.ENVIRONMENT),this._renderLaserlines(),this.performanceInfo.advance(Gn.LASER_LINES),this._renderOccluded(),this.performanceInfo.advance(Gn.OCCLUDED);const U=this._magnifierEnabled&&e==null?this.fboCache.acquire(xr.RGBA,this._offscreen.width,this._offscreen.height):null,j=this._renderComposite(U??e,this._offscreen.color)??e;this.performanceInfo.advance(Gn.ANTIALIASING),this._renderHUD(Ih.NotOccluded,j),this.performanceInfo.advance(Gn.HUD),this._renderHighlights(j,this._bindParameters),this.performanceInfo.advance(Gn.HIGHLIGHTS),this._magnifierEnabled&&this._magnifierHelper.render(this._rctx,this._bindParameters),j!==e&&(this._rctx.bindFramebuffer(e==null?void 0:e.fbo),this._compositingHelper.composite(this._bindParameters,U==null?void 0:U.colorTexture,yc.None)),U!==e&&(U==null||U.release()),this.onPostRender&&this.onPostRender(),this._releaseFBOs(),this._offscreen.releaseBuffers(),this._renderContext.lastFrameCamera.copyFrom(this._bindParameters.camera),this._sliceHelper.plane=T,this._isRendering=!1,this.performanceInfo.finishFrame(),o&&(this._releaseFBOs(),this._disposeOffscreenBuffers())}_prepareShaders(e,i){this._renderContext.output=ue.Color,this._prepareOpaqueGeometrySlots(),this._setMultipassTerrain(e),this._renderPlugins.prepare(ke.TRANSPARENT_TERRAIN),this._setMultipassTerrain(!1),e||this._prepareInternalSlots(this._materialRenderers,ke.LINE_CALLOUTS),i&&this._prepareTransparencySlots(),this._prepareInternalSlots(this._materialRenderers,ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),this._renderPlugins.prepare(ke.ENVIRONMENT_TRANSPARENT),this._renderPlugins.prepare(ke.LASERLINES),this._rctx.gl.flush()}_renderObjectAndLayerIdColor(e){if(e==null||!Le("enable-feature:objectAndLayerId-rendering"))return;const i=this._renderContext.output;this._rctx.bindFramebuffer(e.fbo),this._offscreen.renderToFBO(()=>this._renderAllGeometry(ue.ObjectAndLayerIdColor),[0,0,0,0],!0,!0),this._rctx.bindFramebuffer(e.fbo),this._offscreen.renderToFBO(()=>{this._bindParameters.hudRenderStyle=Ih.NotOccluded,this._renderInternalSlot(ke.HUD_MATERIAL)},void 0,!0,!0),this._renderContext.output=i}finish(e){this._hasAnimations||this._animationTimestep.clear();const i=this.performanceInfo.gpuSamplingEnabled,r=e===no.BACKGROUND;if(r||i){const n=r?this.performanceInfo.elapsedTime:0,s=i?this.performanceInfo.totalGPUTimeSampler.last:this._rctx.gl.getError(),o=Math.max(n,s);this._animationTimestep.frame(o,r)}}readDepthPixels(e,i,r){var l;const n=(l=this._bindParameters.linearDepth)==null?void 0:l.fbo;if(n!=null&&n.colorTexture)return void n.readPixels(i[0],i[1],i[2],i[3],ci.RGBA,ga.UNSIGNED_BYTE,r);const s=this.fboCache.acquire(xr.RGBA,this._offscreen.width,this._offscreen.height).acquireDepth(la.DEPTH16_BUFFER);this._rctx.bindFramebuffer(s.fbo),this._ensureBindParameters(e,e),this._bindParameters.camera.setGLViewport(this._rctx),this._rctx.setClearColor(0,0,0,0);const o=In.COLOR_BUFFER_BIT|In.DEPTH_BUFFER_BIT|In.STENCIL_BUFFER_BIT;this._rctx.clearSafe(o),this._renderAllGeometry(ue.Depth),s.fbo.readPixels(i[0],i[1],i[2],i[3],ci.RGBA,ga.UNSIGNED_BYTE,r),s.release()}readHUDVisibility(e,i,r,n,s){var o;(o=this._bindParameters.hudVisibility)==null||o.fbo.readPixels(e,i,r,n,ci.RGBA,ga.UNSIGNED_BYTE,s)}readAccumulatedShadow(e){return this._shadowAccumulator.readAccumulatedShadow(e[0],e[1])}_setMultipassTerrain(e){this._setMultipassEnabled(e),this._setTerrainCulling(e)}_setMultipassEnabled(e){this._bindParameters.multipassEnabled=e}_setTerrainCulling(e){this._bindParameters.multipassTerrain.cullAboveGround=e}_renderEdges(e,i){const r=this._edgeView;if(r!=null&&r.shouldRender()){const{width:n,height:s,depth:o}=this._offscreen,l=this.fboCache.acquire(xr.RGBA,n,s),c=()=>r.render(this._bindParameters,e);this._offscreen.renderToTargets(c,l,i??o,Hwe),this._offscreen.compositeToFramebuffer(this._bindParameters,l.colorTexture,yc.Alpha,1),l.release()}}_renderShadowMap(e,i,r){const n=this._shadowMap;n.enabled&&(n.start(e,i,r,this.isFeatureEnabled(Zo.HighResolutionShadows),this._stage.view.qualitySettings.maximumPixelRatio),this._shadowHighlight.updateParameters(e,i),this._needsShadowHighlight?(this._renderShadowCascades(ue.ShadowHighlight,this._shadowMap),n.moveSnapshot(I5.Highlight),n.clear(),this._renderShadowCascades(ue.ShadowExcludeHighlight,this._shadowMap),n.copySnapshot(I5.Default),this._renderShadowCascades(ue.ShadowHighlight,this._shadowMap)):this._renderShadowCascades(ue.Shadow),n.finish(),e.setGLViewport(this._rctx))}_renderShadowCascades(e,i=this._shadowMap){for(const r of i.cascades)r.camera.setGLViewport(this._rctx),this._prepare(r.camera,r.camera),this._renderAllGeometry(e)}get _needsLinearDepth(){return this._renderPlugins.consumes(ue.Depth)||this.hasReflections||this._needsShadowHighlight||this._needsShadowCast}_renderLinearDepth(){this._needsLinearDepth?(this._bindParameters.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.linearDepth,()=>this._renderAllGeometry(ue.Depth),[0,0,0,0],xr.RGBA,la.DEPTH_STENCIL_BUFFER),this._bindParameters.linearDepth.releaseDepth(),this._offscreen.bindFbo()):this._bindParameters.linearDepth=ir(this._bindParameters.linearDepth)}_renderTerrainLinearDepth(e){if(e){const i=this._renderContext.output;this._renderContext.output=ue.Depth,this._bindParameters.multipassTerrain.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassTerrain.linearDepth,()=>this._renderTransparentTerrain(),[-1e10,-1e10,-1e10,1]),this._bindParameters.multipassTerrain.linearDepth.releaseDepth(),this._renderContext.output=i}else this._bindParameters.multipassTerrain.linearDepth=ir(this._bindParameters.multipassTerrain.linearDepth)}_renderGeometryLinearDepth(e){if(!e)return void(this._bindParameters.multipassGeometry.linearDepth=ir(this._bindParameters.multipassGeometry.linearDepth));const i=this._renderContext.output;return this._bindParameters.multipassGeometry.linearDepth=this._offscreen.renderToCachedFBO(this._bindParameters.multipassGeometry.linearDepth,()=>this._renderOpaqueGeometryAndTransparentMaterial(ue.Depth),[1,1,1,1],xr.RGBA,this._geometryLinearDepthFormat),this._renderContext.output=i,this._bindParameters.multipassGeometry.linearDepth.detachDepth()}get _needsDepthRange(){return this._shadowMap.enabled||this._needsShadowCast}_computeDepthRange(e){if(!this._needsDepthRange)return Xie;const i=I6t(e,this._materialRenderers,this._stage.layers);return N5(i,this._renderPlugins.queryDepthRange(e)),i.near=Math.max(e.near,i.near),i.far=Math.min(e.far,i.far),i}_renderAllGeometry(e){this._renderContext.output=e,this._renderPlugins.prepare(ke.TRANSPARENT_TERRAIN),this._renderOpaqueGeometryAndTransparentMaterial(e),this._renderTransparentTerrain()}_renderOpaqueGeometryAndTransparentMaterial(e){this._renderContext.output=e,this._renderPlugins.prepare(ke.TRANSPARENT_MATERIAL),this._renderOpaqueGeometry(),this._renderTransparentMaterial()}_renderSSAO(){if(!this._renderPlugins.produces(ke.SSAO))return;const e=this._offscreen.renderToCachedFBO(null,()=>this._renderAllGeometry(ue.Normal),[0,0,0,0],xr.RGBA4,la.DEPTH24_BUFFER);e.releaseDepth(),this._offscreen.bindFbo(),this._pluginInput.normal=e,this._bindParameters.ssao=this._renderPlugins.render(ke.SSAO,this._pluginInput),e.release()}_prepareOpaqueGeometrySlots(){this._renderPlugins.prepare(ke.INTEGRATED_MESH),this._renderPlugins.prepare(ke.OPAQUE_TERRAIN),this._renderPlugins.prepare(ke.OPAQUE_MATERIAL),this._renderPlugins.prepare(ke.ENVIRONMENT_OPAQUE),this._prepareInternalSlots(this._materialRenderers,ke.OPAQUE_MATERIAL)}_renderOpaqueGeometry(){this._renderPlugins.render(ke.INTEGRATED_MESH),this._renderPlugins.render(ke.OPAQUE_TERRAIN),this._renderInternalSlot(ke.OPAQUE_MATERIAL),this._renderPlugins.render(ke.OPAQUE_MATERIAL)}_renderTransparentMaterial(){this._renderInternalSlot(ke.TRANSPARENT_MATERIAL),this._renderPlugins.render(ke.TRANSPARENT_MATERIAL)}_renderTransparentTerrain(){if(!this._renderPlugins.produces(ke.TRANSPARENT_TERRAIN))return;const e=()=>this._renderPlugins.render(ke.TRANSPARENT_TERRAIN,null);if(this._renderContext.output!==ue.Color)return void e();const{width:i,height:r,depth:n}=this._offscreen,s=this.fboCache.acquire(xr.RGBA,i,r);return this._offscreen.renderToTargets(e,s,n,[0,0,0,0]),s}_renderHUDVisibility(e){this._shouldRenderInternalSlot(this._materialRenderers,ke.OCCLUSION_PIXELS)?(this._bindParameters.hudVisibility=this._offscreen.renderHUDVisibility(this._bindParameters.hudVisibility,()=>this._renderInternalSlot(ke.OCCLUSION_PIXELS),e),this._offscreen.bindFbo()):this._bindParameters.hudVisibility=ir(this._bindParameters.hudVisibility)}_renderLineCallouts(e){if(this._bindParameters.hudRenderStyle=e,e===Ih.Occluded){const i=()=>this._renderInternalSlot(ke.LINE_CALLOUTS),{width:r,height:n,color:s}=this._offscreen,o=this.fboCache.acquireDepth(la.DEPTH16_BUFFER,r,n);this._offscreen.renderToTargets(i,s,o,void 0,!0,!0),o.release()}else this._renderInternalSlot(ke.LINE_CALLOUTS)}_renderLaserlines(){if(this._renderPlugins.render(ke.LASERLINES),this._renderPlugins.produces(ke.LASERLINES_CONTRAST_CONTROL)){const e=this._offscreen,{width:i,height:r,depth:n}=e,s=this.fboCache.acquire(xr.RGBA,i,r),o=()=>this._renderPlugins.render(ke.LASERLINES_CONTRAST_CONTROL);e.renderToTargets(o,s,n,Hwe),e.compositeToFramebuffer(this._bindParameters,s.colorTexture,yc.PremultipliedAlpha,1),s.release()}}_renderHUD(e,i){if(this._materialRenderersHas.hudElements)if(this._oitEnabled){const r=this._renderOITPass(jM.HUD,e);this._rctx.bindFramebuffer(i==null?void 0:i.fbo),this._compositingHelper.composite(this._bindParameters,r.colorTexture,yc.PremultipliedAlpha),r.release()}else if(e===Ih.Occluded){const r=()=>this._renderHUDElements(e),{width:n,height:s,color:o}=this._offscreen,l=this.fboCache.acquireDepth(la.DEPTH16_BUFFER,n,s);this._offscreen.renderToTargets(r,o,l,void 0,!0,!0),l.release()}else this._rctx.bindFramebuffer(null),i==null||i.acquireDepth(la.DEPTH16_BUFFER),this._rctx.bindFramebuffer(i==null?void 0:i.fbo),this._renderHUDElements(e),i==null||i.releaseDepth()}_renderHUDElements(e){this._bindParameters.hudRenderStyle=e,this._prepareInternalSlots(this._materialRenderers,ke.LINE_CALLOUTS_HUD_DEPTH,ke.HUD_MATERIAL,ke.LABEL_MATERIAL),this._renderInternalSlot(ke.LINE_CALLOUTS_HUD_DEPTH),this._renderInternalSlot(ke.HUD_MATERIAL),this._renderInternalSlot(ke.LABEL_MATERIAL)}get _needsShadowHighlight(){return this._shadowMap.enabled&&this._renderPlugins.produces(ke.SHADOW_HIGHLIGHT)&&this.hasShadowHighlights}_renderHighlights(e,i){if(!this.hasHighlights||i.decorations===Xh.OFF)return;const r=()=>{this._renderAllGeometry(ue.Highlight),this._rctx.clearSafe(In.DEPTH_BUFFER_BIT),this._renderHUDElements(Ih.Both)},n=this._offscreen.renderToCachedFBO(null,r,[0,0,0,0],xr.RGBA4,la.DEPTH_STENCIL_BUFFER);n.releaseDepth(),this._needsShadowHighlight&&(this._pluginInput.highlight=n,this._renderPlugins.render(ke.SHADOW_HIGHLIGHT,this._pluginInput,e)),this._renderPlugins.produces(ke.HIGHLIGHT)&&(this._pluginInput.composite=null,this._pluginInput.normal=null,this._pluginInput.highlight=n,this._renderPlugins.render(ke.HIGHLIGHT,this._pluginInput,e)),n.release()}get _needsShadowCast(){return this._shadowAccumulator.isAccumulating}_renderShadowAccumulation(e,i,r){var n;this._needsShadowCast&&((n=this._bindParameters.linearDepth)!=null&&n.colorTexture)&&this._shadowAccumulator.renderAccumulation(this._bindParameters.linearDepth,e,i,r)}_prepareTransparencySlots(){this._renderContext.output=ue.Alpha,this._bindParameters.transparencyPassType=Jt.Alpha,this._prepareInternalSlots(this._materialRenderers,ke.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(ke.TRANSPARENT_MATERIAL),this._renderContext.output=ue.Color,this._bindParameters.transparencyPassType=Jt.Color,this._prepareInternalSlots(this._materialRenderers,ke.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(ke.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=Jt.FrontFace,this._prepareInternalSlots(this._materialRenderers,ke.TRANSPARENT_MATERIAL),this._renderPlugins.prepare(ke.TRANSPARENT_MATERIAL),this._bindParameters.transparencyPassType=Jt.NONE}_renderOITPass(e,i=Ih.Both){const r=e===jM.HUD,n=r?this.fboCache.acquire(xr.RGBA,this._offscreen.width,this._offscreen.height):null,s=r?()=>this._renderHUDElements(i):()=>this._renderTransparentMaterial(),o=this._renderContext.output;this._renderContext.output=ue.Alpha,this._bindParameters.transparencyPassType=Jt.Alpha;const l=this._offscreen.renderOITPass(s,Jt.Alpha,r);this._renderContext.output=ue.Color,this._bindParameters.transparencyPassType=Jt.Color;const c=this._offscreen.renderOITPass(s,Jt.Color,r);this._bindParameters.transparencyPassType=Jt.FrontFace;const f=this._offscreen.renderOITPass(s,Jt.FrontFace,r);return this._offscreen.compositeTransparentOntoOpaque(this._bindParameters,c,l,f,n),n==null||n.releaseDepth(),f.release(),c.release(),l.release(),this._bindParameters.transparencyPassType=Jt.NONE,this._renderContext.output=o,n}_renderOccluded(){let e=0;Cd.clear(),this._materialRenderers.forAll(o=>{o.material&&o.material.isVisible()&&o.material.parameters.renderOccluded===Wn.OccludeAndTransparentStencil&&(e|=o.material.parameters.renderOccluded,Cd.push(o))});const i=this._offscreen,r=(o,l,c,f,_)=>{if(!(e&l))return;const{width:x,height:T,depth:A}=i,M=this.fboCache.acquire(xr.RGBA,x,T);i.renderToTargets(c,M,A,[0,0,0,0],f,_),i.compositeToFramebuffer(this._bindParameters,M.colorTexture,yc.PremultipliedAlpha,o),M.release()};Cd.length!==0&&(this._prepareInternalSlots(Cd,ke.OCCLUDER_MATERIAL,ke.TRANSPARENT_OCCLUDER_MATERIAL),this._renderInternalSlot(ke.OCCLUDER_MATERIAL,Cd),r(.5,Wn.OccludeAndTransparentStencil,()=>this._renderInternalSlot(ke.TRANSPARENT_OCCLUDER_MATERIAL,Cd),!1,!1)),Cd.clear(),this._materialRenderers.forAll(o=>{o.material&&o.material.isVisible()&&(o.material.parameters.renderOccluded===Wn.OccludeAndTransparent||o.material.parameters.renderOccluded===Wn.Transparent||o.material.parameters.renderOccluded===Wn.Opaque)&&(e|=o.material.parameters.renderOccluded,Cd.push(o))});const n=this._renderPlugins.renderOccludedFlags;if(e|=n,!e)return;const s=o=>{this._renderContext.renderOccludedMask=o,this._prepareInternalSlots(Cd,ke.OPAQUE_MATERIAL,ke.TRANSPARENT_MATERIAL,ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL),n>Wn.Occlude&&this._renderPlugins.render(ke.OCCLUDED_TERRAIN),this._renderInternalSlot(ke.OPAQUE_MATERIAL,Cd),this._renderInternalSlot(ke.TRANSPARENT_MATERIAL,Cd),this._renderInternalSlot(ke.TRANSPARENT_DEPTH_WRITE_DISABLED_MATERIAL,Cd),this._renderContext.resetRenderOccludedMask()};this._renderContext.output=ue.Color,r(.5,Wn.OccludeAndTransparent,()=>s(Wn.OccludeAndTransparent),!0,Zu.OutlineVisualElementMask),r(.5,Wn.Transparent,()=>s(Wn.Transparent),!0,Zu.OutlineVisualElementMask),r(1,Wn.Opaque,()=>s(Wn.Opaque),!0,Zu.OutlineVisualElementMask),Cd.clear()}_renderComposite(e,i){this._renderPlugins.consumes(ue.CompositeColor)&&(this._pluginInput.composite=i);let r=null;const n=this._renderPlugins.produces(ke.COMPOSITE);n&&(r=this._renderPlugins.renderComposition(ke.COMPOSITE,this._pluginInput),this._pluginInput.composite=r);const s=this._renderPlugins.produces(ke.ANTIALIASING),o=this._renderPlugins.render(s?ke.ANTIALIASING:ke.BLIT,this._pluginInput,e);return n&&(r==null||r.release()),o}_prepare(e,i){this._needsTransparentPass=this._materialRenderers.some(r=>r.material.produces(ke.TRANSPARENT_MATERIAL,ue.Color)),this._bindParameters.camera=e,this._bindParameters.contentCamera=i}_ensureBindParameters(e,i){this._bindParameters.camera=e,this._bindParameters.contentCamera=i;const r=this._renderContext.offscreenRenderingHelper;this._bindParameters.mainColor=r.colorTexture,this._bindParameters.mainDepth=r.depthTexture}_ensureBindParametersSSR(e){if(this._bindParameters.ssr.lastFrameColor){this._ssrEnableTime==null&&(this._ssrEnableTime=e),this._renderContext.lastFrameCamera.equals(this._bindParameters.camera)?this._reprojectionMatrix=gs:(Vo(Wwe,this._bindParameters.camera.viewMatrix),Vo(qwe,this._bindParameters.camera.projectionMatrix),nn(jC,Wwe,qwe),nn(jC,this._renderContext.lastFrameCamera.viewMatrix,jC),nn(jC,this._renderContext.lastFrameCamera.projectionMatrix,jC),this._reprojectionMatrix=jC);const i=this._stage.view.qualitySettings.fadeDuration;this._bindParameters.ssr.fadeFactor=i>0?Math.min(i,e-this._ssrEnableTime)/i:1,this._bindParameters.ssr.fadeFactor<1&&this._requestRender()}else this._reprojectionMatrix=gs,this._ssrEnableTime=null}_shouldRenderInternalSlot(e,i){return this._bindParameters.slot=i,e.some(r=>r.prepareTechnique(this._renderContext)!=null)}_prepareInternalSlots(e,...i){for(const r of i)this._bindParameters.slot=r,e.forAll(n=>n.prepareTechnique(this._renderContext)!=null)}_renderInternalSlot(e,i=this._materialRenderers){this._bindParameters.slot=e,i.forAll(r=>{const n=r.prepareTechnique(this._renderContext);n&&r.renderNode(this._renderContext,n)})}get memoryInfo(){return{fbos:this.fboCache.usedMemory,vaos:this._materialRenderers.reduce((e,i)=>e+i.usedMemory,0),plugins:this._renderPlugins.usedMemory}}getMemoryForMaterial(e){if(e==null)return 0;const i=this._materialRenderers.find(r=>r.material===e);return(i==null?void 0:i.usedMemory)??0}get usedMemory(){var e;return this.fboCache.usedMemory+(((e=this.edgeView)==null?void 0:e.usedMemory)??0)+this._renderPlugins.usedMemory}get test(){const e=this;return{offscreen:this._offscreen,shadowMap:this._shadowMap,highlight:this._highlight,lighting:this._bindParameters.lighting,materialRenderers:this._materialRenderers,shadowAccumulator:this._shadowAccumulator,weatherIsFading:this._bindParameters.cloudsFade.isFading,resetRenderStateFeatures:()=>{e._renderStateFeatures=Gq(),this._renderPlugins.renderFeatureChanged(),this._requestRender()},releaseGeometryLinearDepth(i){e._releaseGeometryLinearDepth=i??(r=>r==null?void 0:r.release()),e._geometryLinearDepthFormat=i?la.DEPTH_STENCIL_TEXTURE:la.DEPTH16_BUFFER},getFramebufferTexture:i=>{var r,n;switch(i){case GM.Color:return e._offscreen.colorTexture;case GM.LinearDepth:return(r=e._bindParameters.linearDepth)==null?void 0:r.colorTexture;case GM.ShadowMap:return e._shadowMap.depthTexture;case GM.HudVisibility:return(n=e._bindParameters.hudVisibility)==null?void 0:n.colorTexture}}}}};var jM,GM;y([w()],Ld.prototype,"_renderPlugins",void 0),y([w()],Ld.prototype,"_shadowAccumulator",void 0),y([w()],Ld.prototype,"_state",void 0),y([w()],Ld.prototype,"_renderStateFeatures",void 0),y([w({readOnly:!0})],Ld.prototype,"fullResolutionAtmosphere",null),y([w()],Ld.prototype,"_smaa",void 0),y([w()],Ld.prototype,"_blit",void 0),y([w({autoDestroy:!0})],Ld.prototype,"_edgeView",void 0),y([w()],Ld.prototype,"updating",null),y([w()],Ld.prototype,"isCameraFinal",null),Ld=y([Z("esri.views.3d.webgl-engine.lib.Renderer")],Ld),function(t){t[t.Geometry=0]="Geometry",t[t.HUD=1]="HUD"}(jM||(jM={})),function(t){t[t.Color=0]="Color",t[t.LinearDepth=1]="LinearDepth",t[t.ShadowMap=2]="ShadowMap",t[t.HudVisibility=3]="HudVisibility"}(GM||(GM={}));const Hwe=[0,0,0,0],Cd=new Pi,qwe=Qe(),Wwe=Qe(),jC=Qe();function lNt(t){return e=>t.immediate.schedule(e)}let cNt=class{constructor(e){this._rctx=e,this._vao=wyt(e)}destroy(){this._vao=Kt(this._vao)}draw(){this._vao!=null&&(this._rctx.bindVAO(this._vao),this._rctx.drawArrays(sr.TRIANGLES,0,3))}get test(){var e,i,r,n;return{cachedWebGLObjects:BY((e=this._vao)==null?void 0:e.glName)+BY((r=(i=this._vao)==null?void 0:i.indexBuffer)==null?void 0:r.glName)+BY((n=this._vao)==null?void 0:n.vertexBuffers.geometry)}}};function BY(t){return t!=null?1:0}let aze=class lze{constructor(e){this._rctx=e,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es + precision highp float; + + void main(void) { + gl_Position = vec4(0.0, 0.0, float(gl_VertexID)-2.0, 1.0); + }`,fragment:`#version 300 es + precision highp float; + + out vec4 fragColor; + + void main(void) { + fragColor = vec4(0.0, 0.0, 0.0, 1.0); + }`}}_createHelperProgram(){const e=lze.getShaderSources();return this._rctx.programCache.acquire(e.vertex,e.fragment,new Map([]))}_createIndexbuffer(){return Yr.createIndex(this._rctx,Pr.STATIC_DRAW,new Uint32Array([0]))}run(){this._program.compiled&&this._indexBuffer&&(this._rctx.bindVAO(null),this._rctx.useProgram(this._program),this._rctx.bindBuffer(this._indexBuffer,fi.ELEMENT_ARRAY_BUFFER),this._rctx.drawElements(sr.POINTS,1,Yt.UNSIGNED_INT,0))}dispose(){this._program.dispose(),this._indexBuffer.dispose()}get test(){var e;return{cachedWebGLObjects:(e=this._indexBuffer)!=null&&e.glName?1:0}}},Ywe=class{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:st.ONE,dstRGB:st.ZERO,srcAlpha:st.ONE,dstAlpha:st.ZERO},this.blendEquation={mode:Xy.ADD,modeAlpha:Xy.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=vm.BACK,this.frontFace=x5.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=Zr.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:vm.FRONT_AND_BACK,func:Zr.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:vm.FRONT_AND_BACK,fail:bs.KEEP,zFail:bs.KEEP,zPass:bs.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}},uNt=class{constructor(e){this._allocations=new Map,e?Error.stackTraceLimit=1/0:(this.add=()=>{},this.remove=()=>{})}add(e){this._allocations.set(e,new Error().stack)}remove(e){this._allocations.delete(e)}get information(){let e="";if(this._allocations.size>0){e+=`${this._allocations.size} live object allocations: +`;const i=new Map;this._allocations.forEach(r=>{i.set(r,(i.get(r)??0)+1)}),i.forEach((r,n)=>{const s=n.split(` +`);s.shift(),s.shift(),e+=`${r}: ${s.shift()} +`,s.forEach(o=>e+=` ${o} +`)})}return e}};const hNt={RECORD_ALLOCATIONS:!1};let dNt=class{constructor(){for(this._current=new Array,this._allocations=new uNt(hNt.RECORD_ALLOCATIONS);this._current.length<_o.COUNT;)this._current.push(0)}increment(e,i,r=1){this._current[e]+=r,this._allocations.add(i)}decrement(e,i,r=1){this._current[e]-=r,this._allocations.remove(i)}get current(){return this._current}get total(){return this.current.reduce((e,i,r)=>e+(r<_o.UNCOUNTED?i:0),0)}get resourceInformation(){let e="";if(this.total>0){e+=`Live objects: +`;for(let i=0;i<_o.COUNT;++i){const r=this._current[i];r>0&&(e+=`${_o[i]}: ${r} +`)}}return e+=this._allocations.information,e}},pNt=class{constructor(e,i,r){const n=i.textureFilterAnisotropic,s=r.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=n?Math.min(e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY),s):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),Ym(e)?(this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES)):(this.maxUniformBufferBindings=0,this.maxVertexUniformBlocks=0,this.maxFragmentUniformBlocks=0,this.maxUniformBlockSize=0,this.uniformBufferOffsetAlignment=1,this.maxArrayTextureLayers=1,this.maxSamples=1)}};const fNt=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var Xwe,cze={exports:{}};(Xwe=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(cze.exports=Xwe);const mNt=oP(cze.exports);var Zwe,nre={exports:{}};nre.exports,Zwe=nre,function(t){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(Zwe.exports=e)}();const Jwe=oP(nre.exports);var uze={exports:{}};(function(t){(function(e){var i=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();i!==void 0&&(t.exports=i)})()})(uze);const gNt=oP(uze.exports);var S0=999,Kwe=9999,jY=0,GY=1,Qwe=2,e2e=3,t2e=4,O8=5,yNt=6,vNt=7,_Nt=8,i2e=9,bNt=10,r2e=11,wNt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function xNt(){var t,e,i,r=0,n=0,s=S0,o=[],l=[],c=1,f=0,_=0,x=!1,T=!1,A="";return function(ce){return l=[],ce!==null?I(ce.replace?ce.replace(/\r\n/g,` +`):ce):L()};function M(ce){ce.length&&l.push({type:wNt[s],data:ce,position:_,line:c,column:f})}function I(ce){var be;for(r=0,i=(A+=ce).length;t=A[r],r0)continue;ye=ce.slice(0,1).join("")}return M(ye),_+=ye.length,(o=o.slice(ye.length)).length}}function Q(){return/[^a-fA-F0-9]/.test(t)?(M(o.join("")),s=S0,r):(o.push(t),e=t,r+1)}function ne(){return t==="."||/[eE]/.test(t)?(o.push(t),s=O8,e=t,r+1):t==="x"&&o.length===1&&o[0]==="0"?(s=r2e,o.push(t),e=t,r+1):/[^\d]/.test(t)?(M(o.join("")),s=S0,r):(o.push(t),e=t,r+1)}function re(){return t==="f"&&(o.push(t),e=t,r+=1),/[eE]/.test(t)||t==="-"&&/[eE]/.test(e)?(o.push(t),e=t,r+1):/[^\d]/.test(t)?(M(o.join("")),s=S0,r):(o.push(t),e=t,r+1)}function he(){if(/[^\d\w_]/.test(t)){var ce=o.join("");return s=mNt.indexOf(ce)>-1?_Nt:gNt.indexOf(ce)>-1?vNt:yNt,M(o.join("")),s=S0,r}return o.push(t),e=t,r+1}}function SNt(t){var e=xNt(),i=[];return i=(i=i.concat(e(t))).concat(e(null))}function TNt(t){return SNt(t)}function ENt(t){return t.map(e=>e.type!=="eof"?e.data:"").join("")}const HY=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function CNt(t,e="100",i="300 es"){const r=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of t)if(n.type==="preprocessor"){const s=r.exec(n.data);if(s){const o=s[1].replaceAll(/\s\s+/g," ");if(o===i)return o;if(o===e)return n.data="#version "+i,e;throw new Error("unknown glsl version: "+o)}}return t.splice(0,0,{type:"preprocessor",data:"#version "+i},{type:"whitespace",data:` +`}),null}function ANt(t,e){for(let i=e-1;i>=0;i--){const r=t[i];if(r.type!=="whitespace"&&r.type!=="block-comment"){if(r.type!=="keyword")break;if(r.data==="attribute"||r.data==="in")return!0}}return!1}function CI(t,e,i,r){r=r||i;for(const n of t)if(n.type==="ident"&&n.data===i)return r in e?e[r]++:e[r]=0,CI(t,e,r+"_"+e[r],r);return i}function hze(t,e,i="afterVersion"){function r(c,f){for(let _=f;_c=0;--l){const c=i[l];if(c.type==="preprocessor"){const f=c.data.match(/\#extension\s+(.*)\:/);if(f&&f[1]&&HY.has(f[1].trim())){const T=i[l+1];i.splice(l,T&&T.type==="whitespace"?2:1)}const _=c.data.match(/\#ifdef\s+(.*)/);_&&_[1]&&HY.has(_[1].trim())&&(c.data="#if 1");const x=c.data.match(/\#ifndef\s+(.*)/);x&&x[1]&&HY.has(x[1].trim())&&(c.data="#if 0")}}return RNt(t,ENt(i))}function RNt(t,e){return e}const INt=4294967295;let $Nt=class{constructor(e,i,r,n,s=new Map){this._context=e,this._locations=n,this._uniformBlockBindings=s,this._refCount=1,this._compiled=!1,this._linesOfCode=0,this._nameToUniformLocation=new Map,this._nameToUniform1=new Map,this._nameToUniform1v=new Map,this._nameToUniform2=new Map,this._nameToUniform3=new Map,this._nameToUniform4=new Map,this._nameToUniformMatrix3=new Map,this._nameToUniformMatrix4=new Map,e||console.error("RenderingContext isn't initialized!"),i.length===0&&console.error("Shaders source should not be empty!"),this._context.type===cr.WEBGL2&&(i=n2e(i,tp.VERTEX_SHADER),r=n2e(r,tp.FRAGMENT_SHADER)),this._vShader=s2e(this._context,tp.VERTEX_SHADER,i),this._fShader=s2e(this._context,tp.FRAGMENT_SHADER,r),this._vShader&&this._fShader||console.error("Error loading shaders!"),this._context.instanceCounter.increment(_o.Shader,this),Fee()&&(this.vertexShader=i,this.fragmentShader=r);const o=this._context.gl,l=o.createProgram();if(o.attachShader(l,this._vShader),o.attachShader(l,this._fShader),this._locations.forEach((c,f)=>o.bindAttribLocation(l,c,f)),o.linkProgram(l),Fee()&&!o.getProgramParameter(l,o.LINK_STATUS)&&console.error(`Could not link shader +validated: ${o.getProgramParameter(l,o.VALIDATE_STATUS)}, gl error ${o.getError()}, vertex: ${o.getShaderParameter(this._vShader,o.COMPILE_STATUS)}, fragment: ${o.getShaderParameter(this._fShader,o.COMPILE_STATUS)}, info log: ${o.getProgramInfoLog(l)}, vertex source: ${this.vertexShader}, fragment source: ${this.fragmentShader}`),this._context.type===cr.WEBGL2){const c=o;for(const[f,_]of this._uniformBlockBindings){const x=c.getUniformBlockIndex(l,f);x0)return;const e=this._context.gl,i=this._context.instanceCounter;this._nameToUniformLocation.forEach(r=>r&&i.decrement(_o.Uniform,r)),this._nameToUniformLocation.clear(),this._vShader&&(this._linesOfCode>0&&(i.decrement(_o.LinesOfCode,this._vShader,this._linesOfCode),this._linesOfCode=0),e.deleteShader(this._vShader),this._vShader=null,i.decrement(_o.Shader,this)),this._fShader&&(e.deleteShader(this._fShader),this._fShader=null),this._glName&&(e.deleteProgram(this._glName),this._glName=null,i.decrement(_o.Program,this))}ref(){++this._refCount}_getUniformLocation(e){const i=this._nameToUniformLocation.get(e);if(i!==void 0)return i;if(this.glName){const r=this._context.gl.getUniformLocation(this.glName,e);return this._nameToUniformLocation.set(e,r),r&&this._context.instanceCounter.increment(_o.Uniform,r),r}return null}hasUniform(e){return this._getUniformLocation(e)!=null}setUniform1i(e,i){const r=this._nameToUniform1.get(e);r!==void 0&&i===r||(this._context.gl.uniform1i(this._getUniformLocation(e),i),this._nameToUniform1.set(e,i))}setUniform1iv(e,i){mg(this._nameToUniform1v,e,i)&&this._context.gl.uniform1iv(this._getUniformLocation(e),i)}setUniform2iv(e,i){mg(this._nameToUniform2,e,i)&&this._context.gl.uniform2iv(this._getUniformLocation(e),i)}setUniform3iv(e,i){mg(this._nameToUniform3,e,i)&&this._context.gl.uniform3iv(this._getUniformLocation(e),i)}setUniform4iv(e,i){mg(this._nameToUniform4,e,i)&&this._context.gl.uniform4iv(this._getUniformLocation(e),i)}setUniform1f(e,i){const r=this._nameToUniform1.get(e);r!==void 0&&i===r||(this._context.gl.uniform1f(this._getUniformLocation(e),i),this._nameToUniform1.set(e,i))}setUniform1fv(e,i){mg(this._nameToUniform1v,e,i)&&this._context.gl.uniform1fv(this._getUniformLocation(e),i)}setUniform2f(e,i,r){const n=this._nameToUniform2.get(e);n===void 0?(this._context.gl.uniform2f(this._getUniformLocation(e),i,r),this._nameToUniform2.set(e,[i,r])):i===n[0]&&r===n[1]||(this._context.gl.uniform2f(this._getUniformLocation(e),i,r),n[0]=i,n[1]=r)}setUniform2fv(e,i){mg(this._nameToUniform2,e,i)&&this._context.gl.uniform2fv(this._getUniformLocation(e),i)}setUniform3f(e,i,r,n){const s=this._nameToUniform3.get(e);s===void 0?(this._context.gl.uniform3f(this._getUniformLocation(e),i,r,n),this._nameToUniform3.set(e,[i,r,n])):i===s[0]&&r===s[1]&&n===s[2]||(this._context.gl.uniform3f(this._getUniformLocation(e),i,r,n),s[0]=i,s[1]=r,s[2]=n)}setUniform3fv(e,i){mg(this._nameToUniform3,e,i)&&this._context.gl.uniform3fv(this._getUniformLocation(e),i)}setUniform4f(e,i,r,n,s){const o=this._nameToUniform4.get(e);o===void 0?(this._context.gl.uniform4f(this._getUniformLocation(e),i,r,n,s),this._nameToUniform4.set(e,[i,r,n,s])):o!==void 0&&i===o[0]&&r===o[1]&&n===o[2]&&s===o[3]||(this._context.gl.uniform4f(this._getUniformLocation(e),i,r,n,s),o[0]=i,o[1]=r,o[2]=n,o[3]=s)}setUniform4fv(e,i){mg(this._nameToUniform4,e,i)&&this._context.gl.uniform4fv(this._getUniformLocation(e),i)}setUniformMatrix3fv(e,i,r=!1){mg(this._nameToUniformMatrix3,e,i)&&this._context.gl.uniformMatrix3fv(this._getUniformLocation(e),r,i)}setUniformMatrix4fv(e,i,r=!1){mg(this._nameToUniformMatrix4,e,i)&&this._context.gl.uniformMatrix4fv(this._getUniformLocation(e),r,i)}stop(){}};function s2e(t,e,i){const r=t.gl,n=r.createShader(e);return r.shaderSource(n,i),r.compileShader(n),Fee()&&!r.getShaderParameter(n,r.COMPILE_STATUS)&&(console.error("Compile error in ".concat(e===tp.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(r.getShaderInfoLog(n)),console.error(LNt(i))),n}function LNt(t){let e=2;return t.replaceAll(` +`,()=>` +`+DNt(e++)+":")}function DNt(t){return t>=1e3?t.toString():(" "+t).slice(-3)}function mg(t,e,i){const r=t.get(e);return r?jre(r,i):(t.set(e,Array.from(i)),!0)}let NNt=class{constructor(e){this._rctx=e,this._store=new TP}dispose(){this._store.forEach(e=>e.forEach(i=>i.dispose())),this._store.clear()}acquire(e,i,r,n){const s=this._store.get(e,i);if(s!=null)return s.ref(),s;const o=new $Nt(this._rctx,e,i,r,n);return o.ref(),this._store.set(e,i,o),o}get test(){let e=0;return this._store.forEach(i=>i.forEach(r=>e+=r.hasGLName?2:1)),{cachedWebGLProgramObjects:e}}},g6=class{constructor(){this._result=!1}dispose(){this._program=Kt(this._program)}get result(){return this._program!=null&&(this._result=this._test(this._program),this.dispose()),this._result}},FNt=class extends g6{constructor(e){super(),this._rctx=e,this._helperProgram=null,this._rctx.type===cr.WEBGL2&&Le("mac")&&Le("chrome")&&(this._program=this._prepareProgram(),this._helperProgram=this._prepareHelperProgram())}dispose(){var e;super.dispose(),(e=this._helperProgram)==null||e.dispose(),this._helperProgram=null}_test(e){const i=this._rctx,r=i.getBoundFramebufferObject(),{x:n,y:s,width:o,height:l}=i.getViewport();i.resetState();const c=new tn(1);c.wrapMode=Bi.CLAMP_TO_EDGE,c.samplingMode=ki.NEAREST;const f=new Hm(i,c),_=Yr.createIndex(this._rctx,Pr.STATIC_DRAW,new Uint8Array([0]));i.bindFramebuffer(f),i.setViewport(0,0,1,1),i.useProgram(this._helperProgram),i.bindBuffer(_,fi.ELEMENT_ARRAY_BUFFER),i.drawElements(sr.POINTS,1,Yt.UNSIGNED_BYTE,0),i.useProgram(e),i.bindVAO(null),i.drawArrays(sr.TRIANGLES,0,258);const x=new Uint8Array(4);return f.readPixels(0,0,1,1,ci.RGBA,ga.UNSIGNED_BYTE,x),i.setViewport(n,s,o,l),i.bindFramebuffer(r),f.dispose(),_.dispose(),x[0]===255}_prepareProgram(){const i=`#version 300 es + precision highp float; + + out float triangleId; + + const vec3 triangleVertices[3] = vec3[3](vec3(-0.5, -0.5, 0.0), vec3(0.5, -0.5, 0.0), vec3(0.0, 0.5, 0.0)); + + void main(void) { + triangleId = floor(float(gl_VertexID)/3.0); + + vec3 position = triangleVertices[gl_VertexID % 3]; + float offset = triangleId / ${V.float(85)}; + position.z = 0.5 - offset; + + gl_Position = vec4(position, 1.0); + } + `,r=`#version 300 es + precision highp float; + + in float triangleId; + + out vec4 fragColor; + + void main(void) { + fragColor = triangleId == ${V.float(85)} ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); + } + `;return this._rctx.programCache.acquire(i,r,new Map([]))}_prepareHelperProgram(){const e=aze.getShaderSources();return this._rctx.programCache.acquire(e.vertex,e.fragment,new Map([]))}},kNt=class extends g6{constructor(e){super(),this._rctx=e,this._program=o2e(this._rctx,!1),this._obfuscated=o2e(this._rctx,!0)}dispose(){super.dispose(),this._obfuscated=Kt(this._obfuscated)}_test(e){if(Le("force-double-precision-obfuscation"))return!0;if(this._obfuscated==null)return!1;const i=this._runProgram(e),r=this._runProgram(this._obfuscated);return i!==0&&(r===0||i/r>5)}_runProgram(e){const i=this._rctx;i.resetState();const r=new tn(1);r.wrapMode=Bi.CLAMP_TO_EDGE,r.samplingMode=ki.NEAREST;const n=new Hm(i,r),s=Yr.createVertex(i,Pr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new Qf(i,new Map([["position",0]]),{geometry:[new Al("position",2,Yt.UNSIGNED_SHORT,0,4)]},{geometry:s}),l=nt(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),c=nt(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),f=new Float32Array(6);Hee(l,f,3);const _=new Float32Array(6);Hee(c,_,3),i.useProgram(e),e.setUniform3f("u_highA",f[0],f[2],f[4]),e.setUniform3f("u_lowA",f[1],f[3],f[5]),e.setUniform3f("u_highB",_[0],_[2],_[4]),e.setUniform3f("u_lowB",_[1],_[3],_[5]),i.bindFramebuffer(n),i.setViewport(0,0,1,1),i.bindVAO(o),i.drawArrays(sr.TRIANGLE_STRIP,0,4);const x=new Uint8Array(4);n.readPixels(0,0,1,1,ci.RGBA,ga.UNSIGNED_BYTE,x),o.dispose(),n.dispose();const T=(l[2]-c[2])/25,A=jle(x);return Math.abs(T-A)}};function o2e(t,e){const i=` + + precision highp float; + + attribute vec2 position; + + uniform vec3 u_highA; + uniform vec3 u_lowA; + uniform vec3 u_highB; + uniform vec3 u_lowB; + + varying vec4 v_color; + + ${e?"#define DOUBLE_PRECISION_REQUIRES_OBFUSCATION":""} + + #ifdef DOUBLE_PRECISION_REQUIRES_OBFUSCATION + + vec3 dpPlusFrc(vec3 a, vec3 b) { + return mix(a, a + b, vec3(notEqual(b, vec3(0)))); + } + + vec3 dpMinusFrc(vec3 a, vec3 b) { + return mix(vec3(0), a - b, vec3(notEqual(a, b))); + } + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = dpPlusFrc(hiA, hiB); + vec3 e = dpMinusFrc(t1, hiA); + vec3 t2 = dpMinusFrc(hiB, e) + dpMinusFrc(hiA, dpMinusFrc(t1, e)) + loA + loB; + return t1 + t2; + } + + #else + + vec3 dpAdd(vec3 hiA, vec3 loA, vec3 hiB, vec3 loB) { + vec3 t1 = hiA + hiB; + vec3 e = t1 - hiA; + vec3 t2 = ((hiB - e) + (hiA - (t1 - e))) + loA + loB; + return t1 + t2; + } + + #endif + + const float MAX_RGBA_FLOAT = + 255.0 / 256.0 + + 255.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 + + 255.0 / 256.0 / 256.0 / 256.0 / 256.0; + + const vec4 FIXED_POINT_FACTORS = vec4(1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0); + + vec4 float2rgba(const float value) { + // Make sure value is in the domain we can represent + float valueInValidDomain = clamp(value, 0.0, MAX_RGBA_FLOAT); + + // Decompose value in 32bit fixed point parts represented as + // uint8 rgba components. Decomposition uses the fractional part after multiplying + // by a power of 256 (this removes the bits that are represented in the previous + // component) and then converts the fractional part to 8bits. + vec4 fixedPointU8 = floor(fract(valueInValidDomain * FIXED_POINT_FACTORS) * 256.0); + + // Convert uint8 values (from 0 to 255) to floating point representation for + // the shader + const float toU8AsFloat = 1.0 / 255.0; + + return fixedPointU8 * toU8AsFloat; + } + + void main() { + vec3 val = dpAdd(u_highA, u_lowA, -u_highB, -u_lowB); + + v_color = float2rgba(val.z / 25.0); + + gl_Position = vec4(position * 2.0 - 1.0, 0.0, 1.0); + } + `,r=` + precision highp float; + + varying vec4 v_color; + + void main() { + gl_FragColor = v_color; + } + `;return t.programCache.acquire(i,r,new Map([["position",0]]))}let zNt=class extends g6{constructor(e){var n,s,o,l,c;if(super(),this._rctx=e,!e.gl)return;if(e.type===cr.WEBGL1)return void(this._result=!(!((n=e.capabilities.textureFloat)!=null&&n.textureFloat)||!((s=e.capabilities.colorBufferFloat)!=null&&s.textureFloat)));if(!((o=e.capabilities.textureFloat)!=null&&o.textureFloat&&((l=e.capabilities.colorBufferFloat)!=null&&l.textureFloat)&&((c=e.capabilities.colorBufferFloat)!=null&&c.floatBlend)))return;const i=` + precision highp float; + attribute vec2 a_pos; + + void main() { + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,r=` + precision highp float; + + void main() { + gl_FragColor = vec4(0.5, 0.5, 0.5, 0.5); + } + `;this._program=e.programCache.acquire(i,r,new Map([["a_pos",0]]))}_test(e){const i=this._rctx,r=new tn(1);r.wrapMode=Bi.CLAMP_TO_EDGE,r.dataType=ga.FLOAT,r.internalFormat=zt.RGBA32F,r.samplingMode=ki.NEAREST;const n=new Hm(i,r),s=Yr.createVertex(i,Pr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new Qf(i,new Map([["a_pos",0]]),{geometry:[new Al("a_pos",2,Yt.UNSIGNED_SHORT,0,4)]},{geometry:s});i.useProgram(e);const l=i.getBoundFramebufferObject(),{x:c,y:f,width:_,height:x}=i.getViewport();i.bindFramebuffer(n),i.setViewport(0,0,1,1),i.bindVAO(o),i.drawArrays(sr.TRIANGLE_STRIP,0,4);const T=Ti({blending:f6e});i.setPipelineState(T),i.drawArrays(sr.TRIANGLE_STRIP,0,4);const A=i.gl.getError();return i.setViewport(c,f,_,x),i.bindFramebuffer(l),o.dispose(),n.dispose(),A!==1282||(console.warn("Device claims support for WebGL extension EXT_float_blend but does not support it. Using fall back."),!1)}},UNt=class extends g6{constructor(e){super(),this._rctx=e;const i=` + precision highp float; + attribute vec2 a_pos; + uniform highp sampler2D u_texture; + varying vec4 v_color; + + float getBit(in float bitset, in int bitIndex) { + float offset = pow(2.0, float(bitIndex)); + return mod(floor(bitset / offset), 2.0); + } + + void main() { + vec4 value = texture2D(u_texture, vec2(0.0)); + float bit = getBit(value.x * 255.0, 1); + + v_color = bit * vec4(1.0); + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,r=` + precision highp float; + varying vec4 v_color; + + void main() { + gl_FragColor = v_color; + } + `;this._program=e.programCache.acquire(i,r,new Map([["a_pos",0]]))}_test(e){const i=this._rctx,r=new tn(1);r.wrapMode=Bi.CLAMP_TO_EDGE,r.samplingMode=ki.NEAREST;const n=new Hm(i,r),s=new Uint8Array(4),o=Yr.createVertex(i,Pr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),l=new Qf(i,new Map([["a_position",0]]),{geometry:[new Al("a_position",2,Yt.SHORT,0,4)]},{geometry:o});i.useProgram(e);const c=new Ai(i,r,new Uint8Array([2,255,0,0]));e.setUniform1i("u_texture",0),i.bindTexture(c,0);const f=i.getBoundFramebufferObject();i.bindFramebuffer(n),i.useProgram(e);const{x:_,y:x,width:T,height:A}=i.getViewport();i.setViewport(0,0,1,1),i.bindVAO(l),i.drawArrays(sr.TRIANGLE_STRIP,0,4),i.setViewport(_,x,T,A),n.readPixels(0,0,1,1,ci.RGBA,ga.UNSIGNED_BYTE,s),l.dispose(),n.dispose();const M=s[0]!==255||s[1]!==255||s[2]!==255||s[3]!==255;return M&&Ce.getLogger("esri.views.webgl.testSamplerPrecision").warn(`A problem was detected with your graphics driver. Your driver does not appear to honor sampler precision specifiers, which may result in rendering issues due to numerical instability. We recommend ensuring that your drivers have been updated to the latest version. Applying lowp sampler workaround. [${s[0]}.${s[1]}.${s[2]}.${s[3]}]`),i.bindFramebuffer(f),M}};new Al("a_pos",2,Yt.BYTE,0,2);new Al("a_pos",2,Yt.BYTE,0,4),new Al("a_tex",2,Yt.BYTE,2,4);const VNt={geometry:[new Al("a_pos",2,Yt.UNSIGNED_SHORT,0,4)]};let BNt=class extends g6{constructor(e){super(),this._rctx=e;const i=` + precision highp float; + + attribute vec2 a_pos; + varying vec2 v_uv; + + void main() { + v_uv = a_pos; + gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0); + } + `,r=` + precision highp float; + + varying vec2 v_uv; + + uniform sampler2D u_texture; + + void main() { + gl_FragColor = texture2D(u_texture, v_uv); + } + `;this._program=e.programCache.acquire(i,r,new Map([["a_pos",0]]))}dispose(){super.dispose()}_test(e){const i=this._rctx;if(!i.gl)return e.dispose(),!0;const r=new tn(1);r.wrapMode=Bi.CLAMP_TO_EDGE,r.samplingMode=ki.NEAREST;const n=new Hm(i,r),s=Yr.createVertex(i,Pr.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),o=new Qf(i,new Map([["a_pos",0]]),VNt,{geometry:s}),l=new tn;l.samplingMode=ki.LINEAR,l.wrapMode=Bi.CLAMP_TO_EDGE;const c=new Ai(i,l,AI);i.useProgram(e),i.bindTexture(c,0),e.setUniform1i("u_texture",0);const f=i.getBoundFramebufferObject(),{x:_,y:x,width:T,height:A}=i.getViewport();i.bindFramebuffer(n),i.setViewport(0,0,1,1),i.setClearColor(0,0,0,0),i.setBlendingEnabled(!1),i.clearSafe(In.COLOR_BUFFER_BIT),i.bindVAO(o),i.drawArrays(sr.TRIANGLE_STRIP,0,4);const M=new Uint8Array(4);return n.readPixels(0,0,1,1,ci.RGBA,ga.UNSIGNED_BYTE,M),o.dispose(),n.dispose(),c.dispose(),i.setViewport(_,x,T,A),i.bindFramebuffer(f),M[0]!==255}};const AI=new Image;AI.src="data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='5' height='5' version='1.1' viewBox='0 0 5 5' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='5' height='5' fill='%23f00' fill-opacity='.5'/%3E%3C/svg%3E%0A",AI.width=5,AI.height=5,AI.decode();let jNt=class{constructor(e){this.rctx=e,this.floatBufferBlend=new zNt(e),this.svgPremultipliesAlpha=new BNt(e),this.doublePrecisionRequiresObfuscation=new kNt(e),this.ignoresSamplerPrecision=new UNt(e),this.drawArraysRequiresIndicesTypeReset=new FNt(e)}dispose(){this.ignoresSamplerPrecision.dispose(),this.doublePrecisionRequiresObfuscation.dispose(),this.svgPremultipliesAlpha.dispose(),this.floatBufferBlend.dispose(),this.drawArraysRequiresIndicesTypeReset.dispose()}};function GNt(t,e){if(e.disjointTimerQuery)return null;if(Ym(t))return{drawBuffers:t.drawBuffers.bind(t),MAX_DRAW_BUFFERS:t.MAX_DRAW_BUFFERS,MAX_COLOR_ATTACHMENTS:t.MAX_COLOR_ATTACHMENTS};if(e.drawBuffers)return null;const i=t.getExtension("WEBGL_draw_buffers");return i?{drawBuffers:i.drawBuffersWEBGL.bind(i),MAX_DRAW_BUFFERS:i.MAX_DRAW_BUFFERS_WEBGL,MAX_COLOR_ATTACHMENTS:i.MAX_COLOR_ATTACHMENTS_WEBGL}:null}function HNt(t,e){if(e.compressedTextureETC)return null;const i=t.getExtension("WEBGL_compressed_texture_etc");return i?{COMPRESSED_R11_EAC:i.COMPRESSED_R11_EAC,COMPRESSED_SIGNED_R11_EAC:i.COMPRESSED_SIGNED_R11_EAC,COMPRESSED_RG11_EAC:i.COMPRESSED_RG11_EAC,COMPRESSED_SIGNED_RG11_EAC:i.COMPRESSED_SIGNED_RG11_EAC,COMPRESSED_RGB8_ETC2:i.COMPRESSED_RGB8_ETC2,COMPRESSED_SRGB8_ETC2:i.COMPRESSED_SRGB8_ETC2,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,COMPRESSED_RGBA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}:null}function qNt(t,e){if(e.compressedTextureS3TC)return null;const i=t.getExtension("WEBGL_compressed_texture_s3tc");return i?{COMPRESSED_RGB_S3TC_DXT1:i.COMPRESSED_RGB_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT1:i.COMPRESSED_RGBA_S3TC_DXT1_EXT,COMPRESSED_RGBA_S3TC_DXT3:i.COMPRESSED_RGBA_S3TC_DXT3_EXT,COMPRESSED_RGBA_S3TC_DXT5:i.COMPRESSED_RGBA_S3TC_DXT5_EXT}:null}function WNt(t,e){if(Ym(t))return{MIN:t.MIN,MAX:t.MAX};if(e.blendMinMax)return null;{const i=t.getExtension("EXT_blend_minmax");return i?{MIN:i.MIN_EXT,MAX:i.MAX_EXT}:null}}function YNt(t,e){if(e.textureFilterAnisotropic)return null;const i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");return i?{MAX_TEXTURE_MAX_ANISOTROPY:i.MAX_TEXTURE_MAX_ANISOTROPY_EXT,TEXTURE_MAX_ANISOTROPY:i.TEXTURE_MAX_ANISOTROPY_EXT}:null}function XNt(t,e){if(Ym(t))return{textureFloat:!0,textureFloatLinear:!e.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!0,textureHalfFloatLinear:!0,HALF_FLOAT:t.HALF_FLOAT,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F};if(t instanceof WebGLRenderingContext){const i=!e.textureHalfFloat&&t.getExtension("OES_texture_half_float");return{textureFloat:!e.textureFloat&&!!t.getExtension("OES_texture_float"),textureFloatLinear:!e.textureFloatLinear&&!!t.getExtension("OES_texture_float_linear"),textureHalfFloat:!!i,textureHalfFloatLinear:!e.textureHalfFloatLinear&&!!t.getExtension("OES_texture_half_float_linear"),HALF_FLOAT:i?i.HALF_FLOAT_OES:void 0}}return null}function ZNt(t,e){if(Ym(t)){const i=!e.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float")||!e.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),r=!e.colorBufferFloat&&t.getExtension("EXT_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&t.getExtension("EXT_float_blend");return i||r||n?{textureFloat:!!r,textureHalfFloat:!!i,floatBlend:!!n,R16F:t.R16F,RG16F:t.RG16F,RGBA16F:t.RGBA16F,R32F:t.R32F,RG32F:t.RG32F,RGBA32F:t.RGBA32F,R11F_G11F_B10F:t.R11F_G11F_B10F,RGB16F:t.RGB16F}:null}if(t instanceof WebGLRenderingContext){const i=!e.colorBufferHalfFloat&&t.getExtension("EXT_color_buffer_half_float"),r=!e.colorBufferFloat&&t.getExtension("WEBGL_color_buffer_float"),n=!e.floatBlend&&!e.colorBufferFloat&&t.getExtension("EXT_float_blend");return i||r||n?{textureFloat:!!r,textureHalfFloat:!!i,floatBlend:!!n,RGBA16F:i?i.RGBA16F_EXT:void 0,RGB16F:i?i.RGB16F_EXT:void 0,RGBA32F:r?r.RGBA32F_EXT:void 0}:null}return null}function a2e(t,e,i,r,n){if(r&&Ym(t))return!0;if(e[i])return!1;for(const s of n)if(t.getExtension(s))return!0;return!1}function JNt(t,e){if(!Ym(t)||e.textureNorm16)return null;const i=t.getExtension("EXT_texture_norm16");return i?{R16:i.R16_EXT,RG16:i.RG16_EXT,RGB16:i.RGB16_EXT,RGBA16:i.RGBA16_EXT,R16_SNORM:i.R16_SNORM_EXT,RG16_SNORM:i.RG16_SNORM_EXT,RGB16_SNORM:i.RGB16_SNORM_EXT,RGBA16_SNORM:i.RGBA16_SNORM_EXT}:null}function KNt(t,e){const i=e.loseContext&&t.getExtension("WEBGL_lose_context");return i?{loseRenderingContext:()=>i.loseContext()}:null}function QNt(t,e){if(Ym(t))return{createVertexArray:t.createVertexArray.bind(t),deleteVertexArray:t.deleteVertexArray.bind(t),bindVertexArray:t.bindVertexArray.bind(t)};if(e.vao)return null;const i=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object");return i?{createVertexArray:i.createVertexArrayOES.bind(i),deleteVertexArray:i.deleteVertexArrayOES.bind(i),bindVertexArray:i.bindVertexArrayOES.bind(i)}:null}let e8t=class{constructor(e,i){this._gl=e,this._vertexArrayObject=null,this._compressedTextureETC=null,this._compressedTextureS3TC=null,this._textureFilterAnisotropic=null,this._textureFloat=null,this._colorBufferFloat=null,this._minMaxBlending=null,this._loseContext=null,this._drawBuffers=null,this._textureNorm16=null,this._depthTexture=null,this._textureFloatLinear=null,this._disabledExtensions=i.disabledExtensions||{},this._debugWebGLExtensions=i.debugWebGLExtensions||{}}get drawBuffers(){return this._drawBuffers||(this._drawBuffers=GNt(this._gl,this._disabledExtensions)),this._drawBuffers}get vao(){return this._vertexArrayObject||(this._vertexArrayObject=QNt(this._gl,this._disabledExtensions)),this._vertexArrayObject}get compressedTextureETC(){return this._compressedTextureETC||(this._compressedTextureETC=HNt(this._gl,this._disabledExtensions)),this._compressedTextureETC}get compressedTextureS3TC(){return this._compressedTextureS3TC||(this._compressedTextureS3TC=qNt(this._gl,this._disabledExtensions)),this._compressedTextureS3TC}get textureFilterAnisotropic(){return this._textureFilterAnisotropic||(this._textureFilterAnisotropic=YNt(this._gl,this._disabledExtensions)),this._textureFilterAnisotropic}get disjointTimerQuery(){return this._disjointTimerQuery||(this._disjointTimerQuery=nNt(this._gl,this._disabledExtensions)),this._disjointTimerQuery}get textureFloat(){return this._textureFloat||(this._textureFloat=XNt(this._gl,this._disabledExtensions)),this._textureFloat}get colorBufferFloat(){return this._colorBufferFloat||(this._colorBufferFloat=ZNt(this._gl,this._disabledExtensions)),this._colorBufferFloat}get blendMinMax(){return this._minMaxBlending||(this._minMaxBlending=WNt(this._gl,this._disabledExtensions)),this._minMaxBlending}get depthTexture(){return this._depthTexture===null&&(this._depthTexture=a2e(this._gl,this._disabledExtensions,"depthTexture",!0,["WEBGL_depth_texture","MOZ_WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"])),this._depthTexture}get loseContext(){return this._loseContext||(this._loseContext=KNt(this._gl,this._debugWebGLExtensions)),this._loseContext}get textureNorm16(){return this._textureNorm16||(this._textureNorm16=JNt(this._gl,this._disabledExtensions)),this._textureNorm16}get textureFloatLinear(){return this._textureFloatLinear===null&&(this._textureFloatLinear=a2e(this._gl,this._disabledExtensions,"textureFloatLinear",!1,["OES_texture_float_linear"])),this._textureFloatLinear}enable(e){return this[e]}},t8t=class{constructor(e,i){this.gl=e,this.instanceCounter=new dNt,this.programCache=new NNt(this),this._state=new Ywe,this._numOfDrawCalls=0,this._numOfTriangles=0,this.type=Ym(e)?cr.WEBGL2:cr.WEBGL1,this._loadExtensions(),this.configure(i)}get gl2(){return this.type===cr.WEBGL1?null:this.gl}configure(e){this._capabilities=new e8t(this.gl,e),this._parameters=new pNt(this.gl,this._capabilities,e),Ai.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const i=this.gl.getParameter(this.gl.VIEWPORT);this._state=new Ywe,this._state.viewport={x:i[0],y:i[1],width:i[2],height:i[3]},this._stateTracker=new tyt({setBlending:r=>{if(r){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(r.opRgb,r.opAlpha),this.setBlendFunctionSeparate(r.srcRgb,r.dstRgb,r.srcAlpha,r.dstAlpha);const n=r.color;this.setBlendColor(n.r,n.g,n.b,n.a)}else this.setBlendingEnabled(!1)},setCulling:r=>{r?(this.setFaceCullingEnabled(!0),this.setCullFace(r.face),this.setFrontFace(r.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:r=>{r?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(r.factor,r.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:r=>{r?(this.setDepthTestEnabled(!0),this.setDepthFunction(r.func)):this.setDepthTestEnabled(!1)},setStencilTest:r=>{if(r){this.setStencilTestEnabled(!0);const n=r.function;this.setStencilFunction(n.func,n.ref,n.mask);const s=r.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:r=>{r?(this.setDepthWriteEnabled(!0),this.setDepthRange(r.zNear,r.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:r=>{r?this.setColorMask(r.r,r.g,r.b,r.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:r=>{r?this.setStencilWriteMask(r.mask):this.setStencilWriteMask(0)},setDrawBuffers:r=>{const{drawBuffers:n}=this._capabilities;if(r)n==null||n.drawBuffers(r.buffers);else{const{drawFramebuffer:s}=this._state;s===null||s.colorAttachments.length===0?n==null||n.drawBuffers([Dee.BACK]):n==null||n.drawBuffers([zu.COLOR_ATTACHMENT0])}}}),this.enforceState(),Kt(this._driverTest),this._driverTest=new jNt(this)}dispose(){Kt(this._driverTest),this.programCache.dispose(),this.bindVAO(null),this.unbindBuffer(fi.ARRAY_BUFFER),this.unbindBuffer(fi.ELEMENT_ARRAY_BUFFER),this.type===cr.WEBGL2&&(this.unbindBuffer(fi.UNIFORM_BUFFER),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(fi.PIXEL_PACK_BUFFER),this.unbindBuffer(fi.PIXEL_UNPACK_BUFFER),this.unbindBuffer(fi.COPY_READ_BUFFER),this.unbindBuffer(fi.COPY_WRITE_BUFFER)),this._state.textureUnitMap.length=0,om()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}setPipelineState(e){this._stateTracker.setPipeline(e)}setBlendingEnabled(e){this._state.blend!==e&&(e===!0?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=e,this._stateTracker.invalidateBlending())}externalProgramUpdate(){var e;(e=this._state.program)==null||e.stop(),this._state.program=null}externalTextureUnitUpdate(e,i){for(let r=0;r=0&&(this._state.activeTexture=i)}externalVertexArrayObjectUpdate(){const e=this.capabilities.vao;e&&(e.bindVertexArray(null),this._state.vertexArrayObject=null),this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(e,i,r,n){e===this._state.blendColor.r&&i===this._state.blendColor.g&&r===this._state.blendColor.b&&n===this._state.blendColor.a||(this.gl.blendColor(e,i,r,n),this._state.blendColor.r=e,this._state.blendColor.g=i,this._state.blendColor.b=r,this._state.blendColor.a=n,this._stateTracker.invalidateBlending())}setBlendFunction(e,i){e===this._state.blendFunction.srcRGB&&i===this._state.blendFunction.dstRGB||(this.gl.blendFunc(e,i),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=e,this._state.blendFunction.dstRGB=i,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(e,i,r,n){this._state.blendFunction.srcRGB===e&&this._state.blendFunction.srcAlpha===r&&this._state.blendFunction.dstRGB===i&&this._state.blendFunction.dstAlpha===n||(this.gl.blendFuncSeparate(e,i,r,n),this._state.blendFunction.srcRGB=e,this._state.blendFunction.srcAlpha=r,this._state.blendFunction.dstRGB=i,this._state.blendFunction.dstAlpha=n,this._stateTracker.invalidateBlending())}setBlendEquation(e){this._state.blendEquation.mode!==e&&(this.gl.blendEquation(e),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(e,i){this._state.blendEquation.mode===e&&this._state.blendEquation.modeAlpha===i||(this.gl.blendEquationSeparate(e,i),this._state.blendEquation.mode=e,this._state.blendEquation.modeAlpha=i,this._stateTracker.invalidateBlending())}setColorMask(e,i,r,n){this._state.colorMask.r===e&&this._state.colorMask.g===i&&this._state.colorMask.b===r&&this._state.colorMask.a===n||(this.gl.colorMask(e,i,r,n),this._state.colorMask.r=e,this._state.colorMask.g=i,this._state.colorMask.b=r,this._state.colorMask.a=n,this._stateTracker.invalidateColorWrite())}setClearColor(e,i,r,n){this._state.clearColor.r===e&&this._state.clearColor.g===i&&this._state.clearColor.b===r&&this._state.clearColor.a===n||(this.gl.clearColor(e,i,r,n),this._state.clearColor.r=e,this._state.clearColor.g=i,this._state.clearColor.b=r,this._state.clearColor.a=n)}setFaceCullingEnabled(e){this._state.faceCulling!==e&&(e===!0?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=e,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(e){this._state.polygonOffsetFill!==e&&(e===!0?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=e,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(e,i){this._state.polygonOffset[0]===e&&this._state.polygonOffset[1]===i||(this._state.polygonOffset[0]=e,this._state.polygonOffset[1]=i,this.gl.polygonOffset(e,i),this._stateTracker.invalidatePolygonOffset())}setCullFace(e){this._state.cullFace!==e&&(this.gl.cullFace(e),this._state.cullFace=e,this._stateTracker.invalidateCulling())}setFrontFace(e){this._state.frontFace!==e&&(this.gl.frontFace(e),this._state.frontFace=e,this._stateTracker.invalidateCulling())}setScissorTestEnabled(e){this._state.scissorTest!==e&&(e===!0?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=e)}setScissorRect(e,i,r,n){this._state.scissorRect.x===e&&this._state.scissorRect.y===i&&this._state.scissorRect.width===r&&this._state.scissorRect.height===n||(this.gl.scissor(e,i,r,n),this._state.scissorRect.x=e,this._state.scissorRect.y=i,this._state.scissorRect.width=r,this._state.scissorRect.height=n)}setDepthTestEnabled(e){this._state.depthTest!==e&&(e===!0?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=e,this._stateTracker.invalidateDepthTest())}setClearDepth(e){this._state.clearDepth!==e&&(this.gl.clearDepth(e),this._state.clearDepth=e)}setDepthFunction(e){this._state.depthFunction!==e&&(this.gl.depthFunc(e),this._state.depthFunction=e,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(e){this._state.depthWrite!==e&&(this.gl.depthMask(e),this._state.depthWrite=e,this._stateTracker.invalidateDepthWrite())}setDepthRange(e,i){this._state.depthRange.zNear===e&&this._state.depthRange.zFar===i||(this.gl.depthRange(e,i),this._state.depthRange.zNear=e,this._state.depthRange.zFar=i,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(e){this._state.stencilTest!==e&&(e===!0?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=e,this._stateTracker.invalidateStencilTest())}setClearStencil(e){e!==this._state.clearStencil&&(this.gl.clearStencil(e),this._state.clearStencil=e)}setStencilFunction(e,i,r){this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===i&&this._state.stencilFunction.mask===r||(this.gl.stencilFunc(e,i,r),this._state.stencilFunction.face=vm.FRONT_AND_BACK,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=i,this._state.stencilFunction.mask=r,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(e,i,r,n){this._state.stencilFunction.face===e&&this._state.stencilFunction.func===i&&this._state.stencilFunction.ref===r&&this._state.stencilFunction.mask===n||(this.gl.stencilFuncSeparate(e,i,r,n),this._state.stencilFunction.face=e,this._state.stencilFunction.func=i,this._state.stencilFunction.ref=r,this._state.stencilFunction.mask=n,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(e){this._state.stencilWriteMask!==e&&(this.gl.stencilMask(e),this._state.stencilWriteMask=e,this._stateTracker.invalidateStencilWrite())}setStencilOp(e,i,r){this._state.stencilOperation.face===vm.FRONT_AND_BACK&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===i&&this._state.stencilOperation.zPass===r||(this.gl.stencilOp(e,i,r),this._state.stencilOperation.face=vm.FRONT_AND_BACK,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=i,this._state.stencilOperation.zPass=r,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(e,i,r,n){this._state.stencilOperation.face===e&&this._state.stencilOperation.fail===i&&this._state.stencilOperation.zFail===r&&this._state.stencilOperation.zPass===n||(this.gl.stencilOpSeparate(e,i,r,n),this._state.stencilOperation.face=e,this._state.stencilOperation.fail=i,this._state.stencilOperation.zFail=r,this._state.stencilOperation.zPass=n,this._stateTracker.invalidateStencilTest())}setActiveTexture(e,i=!1){const r=this._state.activeTexture;return e>=0&&(i||e!==this._state.activeTexture)&&(this.gl.activeTexture(cq+e),this._state.activeTexture=e),r}clear(e){e&&this.gl.clear(e)}clearSafe(e,i=255){e&&(e&In.COLOR_BUFFER_BIT&&this.setColorMask(!0,!0,!0,!0),e&In.DEPTH_BUFFER_BIT&&this.setDepthWriteEnabled(!0),e&In.STENCIL_BUFFER_BIT&&this.setStencilWriteMask(i),this.gl.clear(e))}drawArrays(e,i,r){om()&&(this._numOfDrawCalls++,this._numOfTriangles+=l2e(e,r)),this.gl.drawArrays(e,i,r),cy(this.gl)}drawArraysInstanced(e,i,r,n){var s;(s=this.gl2)==null||s.drawArraysInstanced(e,i,r,n),cy(this.gl)}drawElements(e,i,r,n){if(om()&&(this._numOfDrawCalls++,this._numOfTriangles+=l2e(e,i)),this.gl.drawElements(e,i,r,n),om()){const s=syt(this);if(s){const o=this.getBoundVAO(),l=o==null?void 0:o.indexBuffer,c=o==null?void 0:o.vertexBuffers,f={indexBuffer:l,vertexBuffers:c},_={mode:e,count:i,type:r,offset:n},x=(l==null?void 0:l.size)??0,T=n+i,A=x=this.parameters.maxTextureImageUnits||i<0)&&console.error("Input texture unit is out of range of available units!");const n=this._state.textureUnitMap[i];return(e==null?void 0:e.glName)==null?(n!=null&&(this.setActiveTexture(i,r),this.gl.bindTexture(n.descriptor.target,null)),this._state.textureUnitMap[i]=null,n):r||n!==e?(this.setActiveTexture(i,r),this.gl.bindTexture(e.descriptor.target,e.glName),e.applyChanges(),this._state.textureUnitMap[i]=e,n):(e.isDirty&&(this.setActiveTexture(i,r),e.applyChanges()),n)}unbindTexture(e){if(e!=null)for(let i=0;i=this.parameters.maxUniformBufferBindings||i<0)return console.error("Uniform buffer binding point is out of range!"),null;const r=this._state.uniformBufferBindingPoints;let n=r[i];return n==null&&(n={buffer:null,offset:0,size:0},r[i]=n),n}bindBufferBase(e,i,r){const n=this._getBufferBinding(e,i);n!=null&&(n.buffer===r&&n.offset===0&&n.size===0||(this.gl.bindBufferBase(e,i,r?r.glName:null),n.buffer=r,n.offset=0,n.size=0))}bindBufferRange(e,i,r,n,s){const o=this._getBufferBinding(e,i);if(o!=null&&!(o.buffer===r&&o.offset===n&&o.size===s)){if(n%this._parameters.uniformBufferOffsetAlignment!=0)return void console.error("Uniform buffer binding offset is not a multiple of the context offset alignment");this.gl.bindBufferRange(e,i,r.glName,n,s),o.buffer=r,o.offset=n,o.size=s}}bindUBO(e,i,r,n){i!=null?(om()&&(n??i.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),i.initialize(),r!==void 0&&n!==void 0?this.bindBufferRange(fi.UNIFORM_BUFFER,e,i.buffer,r,n):this.bindBufferBase(fi.UNIFORM_BUFFER,e,i.buffer)):this.bindBufferBase(fi.UNIFORM_BUFFER,e,null)}unbindUBO(e){for(let i=0,r=this._state.uniformBufferBindingPoints.length;i0||this.dispose()}ref(){++this._refCount}dispose(){var e;super.dispose(),(e=this._appleAmdDriverHelper)==null||e.dispose(),this.screen.destroy()}bindTechnique(e,i,r,n){return this.useProgram(e.program),this.setPipelineState(e.getPipeline(!!n)),e.program.bindPass(i,r),e.program}runAppleAmdDriverHelper(){this.driverTest.drawArraysRequiresIndicesTypeReset.result&&(this._appleAmdDriverHelper??(this._appleAmdDriverHelper=new aze(this)),this._appleAmdDriverHelper.run())}get test(){var e;return{cachedWebGLObjects:this.programCache.test.cachedWebGLProgramObjects+this.screen.test.cachedWebGLObjects+(((e=this._appleAmdDriverHelper)==null?void 0:e.test.cachedWebGLObjects)??0)}}};function c2e(t){return!!t.frameUpdate}let eM=class extends ze{constructor(e,i,r){super({}),this._stage=e,this._techniqueRepository=i,this._rctx=r,this._textures=new Map,this._loadingCount=0,this._frameUpdates=new Map,this.events=new Dn,this._frameTask=e.view.resourceController.scheduler.registerTask(ni.TEXTURE_UNLOAD)}normalizeCtorArgs(){return{}}destroy(){this._frameTask.remove(),this._stage.forEachOfType(Ws.Texture,e=>e.unload())}get updating(){return this._loadingCount>0||this._frameTask.updating}get textureTechnique(){return this._textureTechnique==null&&(this._textureTechnique=this._techniqueRepository.acquire(Kle,new Qle)),this._textureTechnique}acquire(e){const i=this._textures.get(e);return i?(i.ref(),i.loadingPromise??i):this._createNewRef(e)}update(){let e=!1;this._frameUpdates.forEach(i=>{const r=i.texture.frameUpdate(i.previousToken);r>=0&&r!==i.previousToken&&(i.previousToken=r,e=!0)}),e&&this.events.emit("changed",no.BACKGROUND)}_createNewRef(e){const i=this._stage.getObject(e);if(i==null)return Xt(i!==void 0),null;const r=i.events.on("unloaded",()=>{r.remove(),this._onTextureUnloaded(e)}),n=new r8t(e,()=>{this._frameTask.schedule(()=>{n.isUnreferenced&&i.unload()})});return this._textures.set(e,n),n.ref(),i.glTexture?(this._updateGLTexture(n,i.glTexture),c2e(i)&&this._frameUpdates.set(e,{texture:i,previousToken:-1}),n):(this._loadingCount++,n.loadingPromise=this._stage.schedule(()=>{const s=i.load(this._rctx),o=c=>(this._loadingCount--,n.loadingPromise=null,this._updateGLTexture(n,c),c2e(i)&&this._frameUpdates.set(e,{texture:i,previousToken:-1}),n),l=c=>(this._loadingCount--,n.loadingPromise=null,sn(c)||Ce.getLogger(this).error(c),null);return pd(s)?s.then(o,l):o(s)}),n.loadingPromise)}_updateGLTexture(e,i){e.glTexture=i,this.events.emit("changed",no.UPDATE)}_onTextureUnloaded(e){this._textures.delete(e),this._frameUpdates.delete(e)}};y([w()],eM.prototype,"_loadingCount",void 0),y([w()],eM.prototype,"_frameTask",void 0),y([w()],eM.prototype,"updating",null),eM=y([Z("esri.views.3d.webgl-engine.lib.TextureRepository")],eM);let r8t=class{constructor(e,i){this.id=e,this._release=i,this._refCount=0}get isUnreferenced(){return this._refCount===0}ref(){++this._refCount}release(){--this._refCount,this._refCount>0||(this._refCount!==0?(Ce.getLogger("esri.views.3d.webgl-engine.lib.TextureRepository.RefCountedTextureImpl").error("Cannot dereference texture that has no references!"),this._refCount=0):this._release())}};function n8t(t,e){return new dNe(i=>NEt(i,t),i=>i,e)}let MI=class extends ze{constructor(){super(...arguments),this._passParameters=new s8t,this._resourcesTask=null}get passParameters(){return this._passParameters}destroy(){this._resourcesTask=gn(this._resourcesTask),this._passParameters.waveNormal=Kt(this._passParameters.waveNormal),this._passParameters.wavePerturbation=Kt(this._passParameters.wavePerturbation)}get updating(){return!!this._resourcesTask&&!this._resourcesTask.finished}ensureResources(e){return this._resourcesTask||(this._resourcesTask=Cc(async i=>{await Promise.allSettled([this._loadImageResource(e,Wr("esri/images/materials/water/normals.jpg"),r=>this._passParameters.waveNormal=r,i),this._loadImageResource(e,Wr("esri/images/materials/water/perturbation.jpg"),r=>this._passParameters.wavePerturbation=r,i)])})),this._resourcesTask.finished?U2.LOADED:U2.LOADING}async _loadImageResource(e,i,r,n){try{const s=await C_(i,{signal:n});St(n);const o=new tn(s.width,s.height);o.pixelFormat=ci.RGB,o.samplingMode=ki.LINEAR_MIPMAP_LINEAR,o.hasMipmap=!0,o.maxAnisotropy=8,r(new Ai(e,o,s))}catch(s){Ce.getLogger(this).error("Failed to load water material normal texture.",s)}}};y([w()],MI.prototype,"_resourcesTask",void 0),y([w({type:Boolean,readOnly:!0})],MI.prototype,"updating",null),MI=y([Z("esri.views.3d.webgl-engine.materials.internal.WaterTextureRepository")],MI);let s8t=class extends _n{};const u2e=2048,o8t=1.5,a8t=8;function l8t(t,e){const{format:i,quality:r,rotation:n,disableDecorations:s}=t||{},o=Zce(t,e.padding),l=m8t(t,{width:e.width-o.left-o.right,height:e.height-o.top-o.bottom}),{width:c,height:f}=f8t(t,l),_=v8t(i),x=S8t[_];return{format:_,quality:Je(r??x,0,100),area:l,width:c,height:f,rotation:n,disableDecorations:!!s,ignoreBackground:!!(t!=null&&t.ignoreBackground),ignorePadding:!!(t!=null&&t.ignorePadding)}}function c8t(t,e){const i=l8t(t,e),r=i.area,n=i.width/r.width,s=Zce(i,e.padding),o=s.left+s.right,l=s.top+s.bottom,c=e.width-o,f=e.height-l,_=Math.floor(c*n+o),x=Math.floor(f*n+l),T=(t==null?void 0:t.layers)??[],A=i.ignoreBackground,M=i.ignorePadding;return{framebufferWidth:_,framebufferHeight:x,region:{x:Math.floor(r.x*n)+s.left,y:Math.floor(r.y*n)+s.top,width:i.width,height:i.height},format:i.format,quality:i.quality,rotation:i.rotation,pixelRatio:n,layers:T,disableDecorations:i.disableDecorations,ignoreBackground:A,ignorePadding:M,objectAndLayerIdColor:!1}}function qY(t,e,i){const{ctx:r,canvas:n}=dze(t,i),s=r.getImageData(0,0,t.width,t.height),o=h8t(n,e);return pze(n),{dataUrl:o,data:s}}function WY(t,e){const{ctx:i,canvas:r}=dze(t,e),n=i.getImageData(0,0,t.width,t.height);return pze(r),n}function dze(t,e){const i=u8t();e.premultipliedAlpha&&b8t(t),i.width=t.width,i.height=t.height;const r=i.getContext("2d",{willReadFrequently:!0});return r.putImageData(t,0,0),e.flipY&&_8t(r),{ctx:r,canvas:i}}function pze(t){t.width=0,t.height=0}function u8t(){return YY==null&&(YY=document.createElement("canvas")),YY}let YY=null;function h8t(t,e){const i=w8t[e.format],r=e.quality/100;return t.toDataURL(i,r)}function d8t(t,e,i,r=0,n=0,s=t.width-r,o=t.height-n,l=!1){const{data:c}=t,{width:f,height:_,data:x}=e,T=s/f,A=o/_,M=Math.ceil(T/2),I=Math.ceil(A/2),L=t.width;for(let F=0;F<_;F++)for(let z=0;z=1)continue;let le=2*te*te*te-3*te*te+1;const de=4*(r+pe+(n+he)*L);ne+=le*c[de+3],j+=le,!i&&c[de+3]<255&&(le=le*c[de+3]/255),H+=le*c[de],Y+=le*c[de+1],Q+=le*c[de+2],U+=le}}x[k]=H/U,x[k+1]=Y/U,x[k+2]=Q/U,x[k+3]=ne/j}return e}function p8t(t,e,i){if(!e)return t;const{framebufferWidth:r,framebufferHeight:n,pixelRatio:s,region:o}=t,l=Zce(t,i),c=l.left+l.right,f=l.top+l.bottom,_=r-c,x=n-f,T=Math.min(a8t,Math.min((u2e-c)/_,(u2e-f)/x));return Ts){const f=Math.floor(n.width/o),_=n.height-f;return{x:n.x,y:Math.floor(n.y+_/2),width:n.width,height:f}}const l=Math.floor(n.height*o),c=n.width-l;return{x:Math.floor(n.x+c/2),y:n.y,width:l,height:n.height}}function y8t(t,e){if((e==null?void 0:e.width)==null||e.height==null)return t;const i=e.width/e.height,r=t.width/t.height;if(r===i)return t;if(r0){const s=255/n;e[r]=e[r]*s,e[r+1]=e[r+1]*s,e[r+2]=e[r+2]*s}}}const w8t={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},h2e=98,x8t="png",S8t={png:100,jpg:h2e,jpeg:h2e},T8t={top:0,right:0,bottom:0,left:0};let E8t=class{constructor(e,i,r){this.parameters=e,this.frameHasDecorations=i,this.fbos=r}},C8t=class{constructor(e,i,r){this._rctx=e,this._renderFunctions=i,this._forceCameraHook=r,this.supersample=!0,this._screenshotQueue=new Array}destroy(){this._rctx=null}async takeScreenshot(e){await this._renderFunctions.prepareOverlay(),this._renderFunctions.requestRenderScene(no.BACKGROUND);const i=Jl();return this._screenshotQueue.push({settings:e,resolver:i}),i.promise}update(e,i){for(const r of this._screenshotQueue){if(this._rctx==null){r.resolver.reject();continue}const n={...r.settings,pixelRatio:r.settings.pixelRatio*e.parameters.camera.pixelRatio},s=this._renderScreenshot(e,n,i);r.resolver(s)}this._screenshotQueue.length=0}_renderScreenshotOverlay(e,i,r){e.width=i.width,e.height=i.height;const n=e.getContext("2d"),s=r.pixelRatio;return n.save(),n.translate(0,i.height),n.scale(1,-1),r.region&&n.translate(-r.region.x,-r.region.y),n.scale(s,s),i=this._renderFunctions.renderOverlay(e,r.disableDecorations?Xh.OFF:Xh.ON,i),n.restore(),i}_readbackScreenshot(e,i){return e.resample?this._readbackScreenshotResampled({...e,resample:e.resample},i):this._readbackScreenshotImmediate(e,i)}_readbackScreenshotResampled(e,i){const{framebufferWidth:r,framebufferHeight:n,region:s,resample:o}=e,l=this._ensureScreenshotEncodeCanvas();let c=VW(r,n,l);this._rctx.gl.readPixels(0,0,r,n,ci.RGBA,Yt.UNSIGNED_BYTE,new Uint8Array(c.data.buffer)),i(),c=this._renderScreenshotOverlay(l,c,{...e,region:void 0});const f=VW(s.width,s.height,l);return d8t(c,f,!0,o.region.x,n-(o.region.y+o.region.height),o.region.width,o.region.height)}_readbackScreenshotImmediate(e,i){const{framebufferHeight:r,region:n}=e,s=this._ensureScreenshotEncodeCanvas(),o=VW(n.width,n.height,s);return this._rctx.gl.readPixels(n.x,r-(n.y+n.height),n.width,n.height,ci.RGBA,Yt.UNSIGNED_BYTE,new Uint8Array(o.data.buffer)),i(),this._renderScreenshotOverlay(s,o,e)}_renderScreenshot(e,i,r){const n=e.parameters.camera,s={width:i.framebufferWidth,height:i.framebufferHeight};KS(s,Math.min(this._rctx.parameters.maxTextureSize,this._rctx.parameters.maxRenderbufferSize));let o=!1;const l=i.disableDecorations&&e.frameHasDecorations,c=s.width!==n.fullWidth||s.height!==n.fullHeight,f=i.ignorePadding&&n.pixelRatio!==i.pixelRatio,_=c||l||f||i.objectAndLayerIdColor;let x=null;i.objectAndLayerIdColor&&(x=e.fbos.acquire(xr.RGBA,s.width,s.height),x.acquireDepth(la.DEPTH_STENCIL_BUFFER));let T=null;if(_){const L=n.clone();if(i.ignorePadding){const j=U9(L.padding);for(let H=0;H<4;H++)j[H]=Math.round(j[H]/L.pixelRatio*i.pixelRatio);L.padding=j}L.fullWidth=s.width,L.fullHeight=s.height,L.pixelRatio=i.pixelRatio;const F=n.fovX-L.fovX,z=n.fovY-L.fovY;F<0&&F{this._rctx.bindFramebuffer(null),T==null||T.release()};this._rctx.bindFramebuffer(T==null?void 0:T.fbo);const M=this._readbackScreenshot(i,A);let I=null;if(i.objectAndLayerIdColor){const L=()=>{this._rctx.bindFramebuffer(null),x==null||x.release()};this._rctx.bindFramebuffer(x==null?void 0:x.fbo),I=this._readbackScreenshot(i,L),this._rctx.bindFramebuffer(null)}if(_&&!this._rctx.contextAttributes.alpha)for(let L=3;L{var n;return(n=this.waterTextureRepository)==null?void 0:n.updating},()=>this.requestRender(),ii),_e(()=>e.view.qualityProfile,n=>{var s;return(s=this.renderer)==null?void 0:s.updateRenderFeatures(n)},kt),this._magnifierHelper.events.on("request-render",()=>this.requestRender())]);const{memoryController:i}=e.view.resourceController;this.stippleTextureRepository=HTt(this._rctx,i),this.markerTextureRepository=n8t(this._rctx,i),this._shaderTechniqueRepository=new oNe({rctx:this._rctx,viewingMode:e.viewingMode,stippleTextureRepository:this.stippleTextureRepository,waterTextureRepository:this.waterTextureRepository,markerTextureRepository:this.markerTextureRepository}),this._textureRepository=new eM(e,this._shaderTechniqueRepository,this._rctx),this.addHandles(this._textureRepository.events.on("changed",n=>this.requestRender(n))),this._materialRepository=new aNe(this._textureRepository,this._shaderTechniqueRepository,()=>this.requestRender(),()=>this.requestRender()),this._compositingHelper=new C6t(this._rctx,this._shaderTechniqueRepository),this.renderer=new Ld(e,this._materialRepository,this._textureRepository,this._shaderTechniqueRepository,this._rctx,this._compositingHelper,this._magnifierHelper,n=>this.requestRender(n));const r={renderScene:(n,s,o,l,c)=>this.renderer.render(n,s,o,l,c),requestRenderScene:n=>this.requestRender(n),prepareOverlay:()=>e.options.screenshot.prepareOverlay(),renderOverlay:(n,s,o)=>e.options.screenshot.renderOverlay(n,s,o)};this._screenshotManager=new C8t(this._rctx,r,n=>this.events.emit("force-camera-for-screenshot",n)),this._registerFrameTask(e)}normalizeCtorArgs(){return{}}destroy(){this._container.contains(this._canvas)&&this._container.removeChild(this._canvas),this._frameTask=en(this._frameTask),this._shaderTechniqueRepository=et(this._shaderTechniqueRepository)}requestRender(e=no.UPDATE){this._needsRender=!0,e===no.UPDATE&&(this._needsUpdate=!0)}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this._textureRepository.updating||this.waterTextureRepository.updating||this._magnifierHelper.updating}get textureRepository(){return this._textureRepository}get compositingHelper(){return this._compositingHelper}set magnifier(e){this._magnifierHelper.magnifier=e}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(e).then(i=>i[0])}takeScreenshotWithOID(e){return e.objectAndLayerIdColor=!0,this._screenshotManager.takeScreenshot(e)}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,i,r,n,s,o=s){const l=n.constrainWindowSize(i,r,s*n.pixelRatio,o*n.pixelRatio),c=this._ensureDepthBuffer(l);this.renderer.readDepthPixels(n,l,c);let f=Number.MAX_VALUE;for(let _=0;_x&&x!==n.nearFar[0]&&x!==n.nearFar[1]&&(f=x)}if(e){const _=e.pickDepth(i*n.pixelRatio,r*n.pixelRatio,n);_!=null&&f>_&&_!==n.nearFar[0]&&_!==n.nearFar[1]&&(f=_)}return f===Number.MAX_VALUE?void 0:f}_ensureDepthBuffer(e){const i=4*e[2]*e[3];return(this._tmpDepthBuffer==null||this._tmpDepthBuffer.byteLength{r=this.updating,n=this._needsUpdate?no.UPDATE:no.BACKGROUND,e.commitSyncLayers();const c=l-this._lastAnimationUpdate;if(c>this.renderer.animationTimestep||i.forcedAnimationTime!=null||r||this._needsRender){const f=c/this.renderer.animationTimeDilation,_=new K9e(i.camera,f,i.forcedAnimationTime);this.renderer.updateAnimation(_)&&this.requestRender(no.BACKGROUND),this._lastAnimationUpdate=l}},render:({time:l})=>{if((this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&i.camera.fullWidth>0&&i.camera.fullHeight>0){const c=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(null,null,i,Xh.ON,l),s=!0,c&&this.renderer.hasReflections&&(this.requestRender(no.BACKGROUND),this._needsWaterReflectionUpdate=!0)}},update:({time:l})=>{const c=this.renderer.hasSlicePlane||this._magnifierHelper.enabled||this.renderer.hasDecorations||this.renderer.hasHighlights,f=new E8t(i,c,this.renderer.fboCache);this._textureRepository.update(),this._screenshotManager.update(f,l)},finish:()=>{s&&(this.renderer.finish(i.mode===Vr.IDLE?n:no.UPDATE),s=!1)}};this._frameTask=AT(o)}_initializeContext(e){const i=e.options;this._canvas=i.canvas,this._canvas||(this._canvas=document.createElement("canvas")),this._canvas.setAttribute("style","width: 100%; height:100%; display:block;");const r={alpha:i.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:i.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:i.preserveDrawingBuffer??!1},n=ryt("3d",this._canvas,r);n!=null&&Ym(n)?(this._rctx=this._newRenderingContext(n,e),this._loadShaderOnlyExtensions(),!i.alpha&&this._rctx.contextAttributes.alpha&&Ce.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested"),!this._rctx.contextAttributes.alpha&&Le("safari")>=11&&(this._container.style.backgroundColor="black"),this._container.appendChild(this._canvas)):Ce.getLogger(this).error("A WebGL2 context could not be created.")}_newRenderingContext(e,i){const r={disabledExtensions:i.options.deactivatedWebGLExtensions||{},debugWebGLExtensions:i.options.debugWebGLExtensions||{},maxAnisotropy:8},n=(s,o)=>i.view.resourceController.memoryController.newCache(s,o);return new i8t(e,r,n)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloat")}getObjectAndLayerIdColor(e){return this.objectAndLayerIdRenderHelper!=null?this.objectAndLayerIdRenderHelper.getObjectAndLayerIdColor(e):null}get componentObjectCollection(){return this._componentObjectCollection==null&&(this._componentObjectCollection=new w6t(this.renderer.renderPassManager,this._viewingMode)),this._componentObjectCollection}set componentObjectCollection(e){this._componentObjectCollection=e}};y([w({type:Boolean,readOnly:!0})],ml.prototype,"updating",null),y([w({autoDestroy:!0})],ml.prototype,"_rctx",void 0),y([w({autoDestroy:!0})],ml.prototype,"_container",void 0),y([w({autoDestroy:!0})],ml.prototype,"_canvas",void 0),y([w({autoDestroy:!0})],ml.prototype,"stippleTextureRepository",void 0),y([w({autoDestroy:!0})],ml.prototype,"markerTextureRepository",void 0),y([w({autoDestroy:!0})],ml.prototype,"waterTextureRepository",void 0),y([w({autoDestroy:!0})],ml.prototype,"_magnifierHelper",void 0),y([w({readOnly:!0})],ml.prototype,"objectAndLayerIdRenderHelper",void 0),y([w({autoDestroy:!0})],ml.prototype,"_textureRepository",void 0),y([w({autoDestroy:!0,readOnly:!0})],ml.prototype,"renderer",void 0),y([w({autoDestroy:!0})],ml.prototype,"_screenshotManager",void 0),y([w()],ml.prototype,"componentObjectCollection",null),y([w({autoDestroy:!0})],ml.prototype,"_componentObjectCollection",void 0),y([w()],ml.prototype,"_needsUpdate",void 0),y([w()],ml.prototype,"_needsWaterReflectionUpdate",void 0),ml=y([Z("esri.views.3d.webgl-engine.parts.RenderView")],ml);let Dd=class extends ze{constructor(e){super(e),this._model=new yk,this._layers=new Pi,this._asyncChangeSet=new pie,this._syncChangeSet=new pie,this._layerSyncSet=new Set}initialize(){this._set("renderView",new ml(this)),this._frameTask=this.view.resourceController.scheduler.registerTask(ni.STAGE,this),this.addHandles(this._frameTask)}get viewingMode(){return this.view.state.viewingMode}get updating(){return this.running||this.renderView.updating||this._frameTask.updating}get renderer(){var e;return(e=this.renderView)==null?void 0:e.renderer}add(e){this._model.add(e),WU(e)&&this._addLayer(e),this.renderView.requestRender()}remove(e){e!=null&&!this.destroyed&&this._model.remove(e)&&(WU(e)&&this._removeLayer(e),this.renderView.requestRender())}addMany(e){e!=null&&(this._model.addMany(e),this.renderView.requestRender())}removeMany(e){var i,r;e!=null&&((i=this._model)==null||i.removeMany(e),(r=this.renderView)==null||r.requestRender())}forEachOfType(e,i){this._model.forEachOfType(e,i)}handleEvent(e,i){this.destroyed||(this._model.dirtySet[e](i),this.renderView.requestRender())}get running(){return this._model.dirtySet.dirty||!this._asyncChangeSet.empty}runTask(e){this._frameTask.processQueue(e),this._commit(e)}_commit(e){const i=this._model.dirtySet;this._asyncChangeSet.empty||e.done||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll(r=>{if(e.done)return;const n=this._layerSyncSet.has(r.id)||r.updatePolicy===b2.SYNC,s=n?this._syncChangeSet:this._asyncChangeSet;i.commitLayer(r.id,s),this._layerSyncSet.delete(r.id),s.empty||(this.renderer.modify(s,n?ou:e),this.renderView.requestRender(),e.madeProgress())}),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,ou),this.renderView.requestRender(),e.madeProgress()),this._layers.forAll(r=>{e.done||this._layerSyncSet.has(r.id)||r.updatePolicy!==b2.ASYNC||(i.commitLayer(r.id,this._asyncChangeSet),this._asyncChangeSet.empty||(this.renderer.modify(this._asyncChangeSet,e),this.renderView.requestRender(),e.madeProgress()))}),this._layerSyncSet.clear(),this.notifyChange("running")}commitSyncLayers(){const e=this._model.dirtySet;this._layers.forAll(i=>{this._layerSyncSet.has(i.id)||i.updatePolicy===b2.SYNC?(e.commitLayer(i.id,this._syncChangeSet),this._layerSyncSet.delete(i.id)):e.commitSyncUpdates(i.id,this._syncChangeSet)});for(const i of this._layerSyncSet)e.commitLayer(i,this._syncChangeSet);this._layerSyncSet.clear(),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,ou),this.renderView.requestRender())}_commitLayer(e){this._model.dirtySet.commitLayer(e.id,this._syncChangeSet),this._layerSyncSet.delete(e.id),this._syncChangeSet.empty||(this.renderer.modify(this._syncChangeSet,ou),this.renderView.requestRender())}schedule(e,i){return this._frameTask.schedule(e,i)}reschedule(e,i){return this._frameTask.reschedule(e,i)}syncLayer(e){this._layerSyncSet.add(e),this.renderView.requestRender()}getObject(e){return this._model.getObject(e)}get layers(){return this._layers}_addLayer(e){this._layers.includes(e)||this._layers.push(e)}_removeLayer(e){this._commitLayer(e),this._layers.removeUnordered(e)!=null&&(this._model.dirtySet.getResidentRenderGeometries(e.id,this._syncChangeSet.removes),this.renderer.modify(this._syncChangeSet,ou))}addRenderPlugin(e,i){const r=this.renderer.renderPlugins.add(e,i),n=()=>{r_e(e)&&this.view.sceneIntersectionHelper.addIntersectionHandler(e)};if(pd(r))return r.then(n);n()}removeRenderPlugin(e){this.destroyed||(r_e(e)&&this.view.sceneIntersectionHelper.removeIntersectionHandler(e),this.renderer.renderPlugins.remove(e))}get performanceInfo(){return this._model.getStats()}get test(){const e=this;return{getCount:i=>e._model.test.content.filter(r=>r.type===i).length,model:e._model}}};Dd.DebugSettings={endFrameContentValidation:!1},y([w({constructOnly:!0})],Dd.prototype,"view",void 0),y([w({constructOnly:!0})],Dd.prototype,"options",void 0),y([w({readOnly:!0})],Dd.prototype,"viewingMode",null),y([w({constructOnly:!0})],Dd.prototype,"container",void 0),y([w({readOnly:!0})],Dd.prototype,"updating",null),y([w({constructOnly:!0})],Dd.prototype,"_model",void 0),y([w({autoDestroy:!0})],Dd.prototype,"renderView",void 0),y([w({readOnly:!0})],Dd.prototype,"renderer",null),y([w({readOnly:!0})],Dd.prototype,"running",null),Dd=y([Z("esri.views.3d.webgl-engine.Stage")],Dd);let $0i=class extends vj{constructor(e,i,r,n){super(i,r),this.point=e,this.createGraphic=n}};function fze(t){return Gm(t)&&t.intersector===ms.PCL&&!!t.target}let D0i=class extends M4e{constructor(e,i,r,n,s){super(e),this.layerUid=e,this.sublayerUid=i,this.nodeIndex=r,this.componentIndex=n,this.triangleNr=s}},F0i=class extends vj{constructor(e,i,r){super(i,null),this.point=e,this.createVoxelGraphic=r}};function $G(t){return Gm(t)&&t.intersector===ms.I3S&&!!t.target}function mze(t){return Gm(t)&&t.intersector===ms.VOXEL&&!!t.target}function d2e(t,e){var i,r;return _j(t)||bj(t)?i9((i=t.target)==null?void 0:i.object,e):eCt(t)?(r=e.map)==null?void 0:r.ground:fze(t)||$G(t)||DNe(t)||mze(t)?i9(t.target,e):null}function A8t(t,e){const i=sre(t,e);return i!=null&&i.type==="graphic"?i.graphic:null}function sre(t,e){var i;if(t==null)return null;if(_j(t)||bj(t))return p2e((i=t.target)==null?void 0:i.object,e);if(fze(t)){const r=t.target.createGraphic();return{type:"graphic",graphic:r,layer:r.layer}}if(mze(t)){const r=t.target.createVoxelGraphic();return{type:"graphic",graphic:r,layer:r.layer}}return DNe(t)||pce(t)?p2e(t.target,e):$G(t)?M8t(t.target,e):null}function p2e(t,e){if((t==null?void 0:t.graphicUid)==null)return null;const i=i9(t,e);if(i==null)return null;if(i===e.graphics)return e.graphicsView==null||typeof t.graphicUid!="number"?null:e.graphicsView.getHit(t.graphicUid);const r=e.allLayerViews.find(n=>n.layer===i);return!r||r.suspended||t.graphicUid==null?null:"getHit"in r?r.getHit(t.graphicUid):null}function M8t(t,e){const i=i9(t,e);if(i==null)return null;const r=e.allLayerViews.find(n=>n.layer===i);return r&&!r.suspended&&"getGraphicFromIntersectorTarget"in r?P8t(r.getGraphicFromIntersectorTarget(t)):null}function O8t(t,e){const i=i9(t,e);if(i==null)return null;const r=e.allLayerViews.find(n=>n.layer===i);return r&&!r.suspended&&"getAABBFromIntersectorTarget"in r?r.getAABBFromIntersectorTarget(t):null}function P8t(t){return t!=null?{type:"graphic",graphic:t,layer:t.layer}:null}function i9(t,e){return(t==null?void 0:t.layerUid)==null?null:e.graphicsView!=null&&t.layerUid===e.graphicsView.processor.layer.id?e.graphics:e.map.findLayerByUid(t.layerUid)}function z0i(t,e){if(_j(t)||bj(t))return Zv(t.target.object.boundingVolumeWorldSpace.bounds);if(pce(t)){XAe(P8,t.transformation);const i=Math.max(P8[0],P8[1],P8[2]);return t.target.baseBoundingSphere.radius*i}if($G(t)){const i=O8t(t.target,e);return i?.5*jMe(i):null}return null}function U0i(t){return!_j(t)&&!bj(t)&&(pce(t)?t.target.numLodLevels>1:!!$G(t))}const P8=W();async function R8t(t,e){if(t.type==="2d")return t.hitTest(e);const i=await t.hitTest(e);if(i.results.length===0)return i;const r=(i.results[0].distance??0)*(1+I8t),n=i.results.findIndex(s=>(s.distance??0)>r);return n!==-1&&(i.results=i.results.slice(0,n)),i}const I8t=.05;function $8t(t){return(t==null?void 0:t.type)==="graphic"}function L8t(t){return t.find($8t)??null}function D8t(t){return t&&typeof t.highlight=="function"}function N8t(t){return t&&typeof t.maskOccludee=="function"}function V0i(t,e,i){return t==null||t>i&&(e===0||t0||e!=null&&e>0}function j0i(t){const e=t.effectiveScaleRange;return{minScale:(e==null?void 0:e.minScale)??0,maxScale:(e==null?void 0:e.maxScale)??0}}let XY,ZY;function F8t(t){const e=s$e(t);for(;e.length>1;){const i=f2e(e.shift());if(i.available)return i}return f2e(e.shift())}function f2e(t){switch(t){case cr.WEBGL1:return k8t();case cr.WEBGL2:return z8t()}}function k8t(){return XY||(XY=B8t()),XY}function z8t(){return ZY||(ZY=j8t()),ZY}let gze=class{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}},U8t=class extends gze{constructor(){super(...arguments),this.type=cr.WEBGL1}},V8t=class extends gze{constructor(){super(...arguments),this.type=cr.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}};function yze(t,e){if(t===cr.WEBGL1&&typeof WebGLRenderingContext>"u"||t===cr.WEBGL2&&typeof WebGL2RenderingContext>"u")return null;const i=document.createElement("canvas");if(!i)return null;let r=kee(i,t,{failIfMajorPerformanceCaveat:!0});if(r==null&&(r=kee(i,t),r!=null&&(e.majorPerformanceCaveat=!0)),r==null)return r;if(t===cr.WEBGL1){const s=r.getParameter(r.VERSION),o=s==null?void 0:s.match(/^WebGL\s+([\d.]*)/);if(o){const l=parseFloat(o[1]);e.available=l>=.94}}else e.available=!0;e.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),e.supportsVertexShaderSamplers=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const n=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT);return n&&(e.supportsHighPrecisionFragment=n.precision>0),r}function B8t(){const t=new U8t,e=yze(cr.WEBGL1,t);return e==null||(t.supportsElementIndexUint=e.getExtension("OES_element_index_uint")!==null,t.supportsStandardDerivatives=e.getExtension("OES_standard_derivatives")!==null,t.supportsInstancedArrays=e.getExtension("ANGLE_instanced_arrays")!==null,t.supportsTextureFloat=e.getExtension("OES_texture_float")!==null,t.supportsTextureHalfFloat=e.getExtension("OES_texture_half_float")!==null,t.supportsColorBufferFloat=e.getExtension("WEBGL_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=e.getExtension("EXT_color_buffer_half_float")!==null),t}function j8t(){const t=new V8t,e=yze(cr.WEBGL2,t);return e==null||(t.supportsColorBufferFloat=e.getExtension("EXT_color_buffer_float")!==null,t.supportsColorBufferFloatBlend=e.getExtension("EXT_float_blend")!==null,t.supportsColorBufferHalfFloat=t.supportsColorBufferFloat||e.getExtension("EXT_color_buffer_half_float")!==null),t}function G8t(t){const e=F8t(t);if(!e.available)return new se("webgl:required",t==="3d"?"WebGL2 is required but not supported.":"WebGL is required but not supported.",new Error().stack);if(t==="3d"&&e.majorPerformanceCaveat)return new se("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist.");if(!e.supportsHighPrecisionFragment)return new se("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported.");if(!e.supportsVertexShaderSamplers)return new se("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported.");if(e.type===cr.WEBGL1){if(!e.supportsElementIndexUint)return new se("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.");if(!e.supportsStandardDerivatives)return new se("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported.");if(!e.supportsInstancedArrays)return new se("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported.")}return null}function H8t(t){return t&&"nodeType"in t}function q8t(t){return t&&typeof t.render=="function"}const m2e={component:"esri-component"};let oS=class extends ze{constructor(){super(...arguments),this.widget=null}destroy(){var e;this.node=null,(e=this.widget)==null||e.destroy()}get id(){var e,i;return this._get("id")??((e=this.widget)==null?void 0:e.id)??((i=this.node)==null?void 0:i.id)}set id(e){this._set("id",e)}set node(e){const i=this._get("node");e!==i&&(e&&e.classList.add(m2e.component),i&&i.classList.remove(m2e.component),this._set("node",e))}castNode(e){var i;return(i=this.widget)==null||i.destroy(),e?typeof e=="string"||H8t(e)?(this._set("widget",null),x9(e)):(q8t(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};y([w()],oS.prototype,"id",null),y([w()],oS.prototype,"node",null),y([Ci("node")],oS.prototype,"castNode",null),y([w({readOnly:!0})],oS.prototype,"widget",void 0),oS=y([Z("esri.views.ui.Component")],oS);const xk=oS,vze="calcite-mode-";function W8t(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-mode-name").replaceAll(/\s|'|"/g,"")}function _ze(){return W8t().startsWith("dark")}function Y8t(){return`${vze}${_ze()?"dark":"light"}`}function X8t(t){Z8t(t),t.classList.add(Y8t())}function Z8t(t){Array.from(t.classList).forEach(e=>{e.startsWith(vze)&&t.classList.remove(e)})}const J8t={left:0,top:0,bottom:0,right:0},bze={bottom:30,top:15,right:15,left:15},R1="esri-ui",ph={ui:R1,corner:`${R1}-corner`,innerContainer:`${R1}-inner-container`,manualContainer:`${R1}-manual-container`,cornerContainer:`${R1}-corner-container`,topLeft:`${R1}-top-left`,topRight:`${R1}-top-right`,bottomLeft:`${R1}-bottom-left`,bottomRight:`${R1}-bottom-right`};function K8t(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function R8(t){return t===0?"0":`${t}px`}function JY(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function KY(t,{top:e,bottom:i,left:r,right:n}){t.style.top=e,t.style.bottom=i,t.style.left=r,t.style.right=n}let kg=class extends Dn.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._locale=fa(),this.view=null,this._applyViewPadding=()=>{const i=this.container;i&&KY(i,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const i=this._innerContainer;i&&KY(i,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([_e(()=>{var e;return[(e=this.view)==null?void 0:e.padding,this.container]},this._applyViewPadding,ii),_e(()=>this.padding,this._applyUIPadding,ii),_e(()=>[this.container,this._locale],([e,i])=>{e&&e.setAttribute("lang",i)},ii),oE(e=>{this._locale=e})])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._componentMap.clear()}set container(e){const i=this._get("container");e!==i&&(e&&(e.classList.add(ph.ui),X8t(e),this._attachContainers(e)),i&&(i.classList.remove(ph.ui),KY(i,{top:"",bottom:"",left:"",right:""}),CEe(i)),this._set("container",e))}get height(){var s;const e=((s=this.view)==null?void 0:s.height)??0;if(e===0)return e;const i=this._getViewPadding(),{top:r,bottom:n}=i;return Math.max(e-r-n,0)}get padding(){return this._get("padding")}set padding(e){this._overrideIfSome("padding",e)}castPadding(e){return typeof e=="number"?{bottom:e,top:e,right:e,left:e}:{...bze,...e}}get width(){var s;const e=((s=this.view)==null?void 0:s.width)??0;if(e===0)return e;const i=this._getViewPadding(),{left:r,right:n}=i;return Math.max(e-r-n,0)}add(e,i){let r,n,s;if(Array.isArray(e))return void e.forEach(l=>this.add(l,i));const o=JY(e);o&&({index:r,position:i,component:e,key:n}=o),i&&typeof i=="object"&&({index:r,key:n,position:i,internal:s}=i),!e||i&&!this._isValidPosition(i)||this._add(e,i,r,n,s)}remove(e,i){var n;if(!e)return;if(Array.isArray(e))return e.map(s=>this.remove(s,i));const r=this._find(e);if(r){if(this._componentMap.has(r)&&((n=this._componentMap.get(r))==null?void 0:n.key)!==i)return;const s=this._components.indexOf(r),o=r.node.parentNode;return o==null||o.removeChild(r.node),this._componentMap.delete(r),this._components.splice(s,1)[0]}}empty(e,i={removeInternal:!1}){if(Array.isArray(e)){for(const s of e)this.empty(s,i);return}const r=this._positionNameToContainerLookup[e??"manual"],n=Array.prototype.slice.call(r.children).map(s=>this._findByNode(s)).filter(s=>{var o;return s==null?!1:!(((o=this._componentMap.get(s))==null?void 0:o.internal)??!1)||i.removeInternal});for(const s of n)this.remove(s)}move(e,i){if(Array.isArray(e)&&e.forEach(o=>this.move(o,i)),!e)return;let r;const n=JY(e)||JY(i);if(n&&(r=n.index,i=n.position,e=n.component||e),i&&!this._isValidPosition(i))return;const s=this.remove(e);s&&this.add(s,{position:i,index:r})}find(e){if(!e)return null;const i=this._findById(e);return i&&(i.widget||i.node)}getComponents(e,i={includeInternal:!1}){return e?Array.isArray(e)?e.flatMap(r=>this._getComponentsAtPosition(r,i)):this._getComponentsAtPosition(e,i):this._components.filter(r=>{var n;return i.includeInternal||!((n=this._componentMap.get(r))!=null&&n.internal)}).map(({widget:r,node:n})=>r??n)}getPosition(e){for(const i in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[i].contains(e))return i;return null}_add(e,i,r,n,s){e instanceof xk||(e=new xk({node:e})),this._place({component:e,position:i,index:r}),this._components.push(e),this._componentMap.set(e,{key:n,internal:s})}_find(e){return e?e instanceof xk?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){var e;return((e=this.view)==null?void 0:e.padding)??J8t}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(ph.innerContainer,ph.cornerContainer);const i=document.createElement("div");i.classList.add(ph.innerContainer,ph.manualContainer);const r=document.createElement("div");r.classList.add(ph.topLeft,ph.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(ph.topRight,ph.corner),e.appendChild(n);const s=document.createElement("div");s.classList.add(ph.bottomLeft,ph.corner),e.appendChild(s);const o=document.createElement("div");o.classList.add(ph.bottomRight,ph.corner),e.appendChild(o),this._innerContainer=e,this._manualContainer=i;const l=RT();this._cornerNameToContainerLookup={"top-left":r,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":l?n:r,"top-trailing":l?r:n,"bottom-leading":l?o:s,"bottom-trailing":l?s:o},this._positionNameToContainerLookup={manual:i,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const i=e.position??"manual",{component:r,index:n}=e,s=this._positionNameToContainerLookup[i],o=n!=null&&n>-1;if(K8t(r.widget)&&r.widget.startup(),!o)return void s.appendChild(r.node);const l=Array.from(s.children);if(n===0)return void(s.firstChild?hde(r.node,s.firstChild):s.appendChild(r.node));n>=l.length?s.appendChild(r.node):hde(r.node,l[n])}_toPixelPosition(e){return{top:R8(e.top),left:R8(e.left),right:R8(e.right),bottom:R8(e.bottom)}}_findByComponent(e){return this._components.find(i=>i===e)??null}_findById(e){return this._components.find(({id:i})=>i===e)??null}_findByNode(e){return this._components.find(({node:i})=>i===e)??null}_getComponentsAtPosition(e,i){const r=this._positionNameToContainerLookup[e];return Array.prototype.slice.call(r.children).map(n=>this._findByNode(n)).filter(ys).filter(n=>{var s;return i.includeInternal||!((s=this._componentMap.get(n))!=null&&s.internal)}).map(({widget:n,node:s})=>n??s)}};y([w()],kg.prototype,"_locale",void 0),y([w()],kg.prototype,"container",null),y([w()],kg.prototype,"height",null),y([w({value:bze})],kg.prototype,"padding",null),y([Ci("padding")],kg.prototype,"castPadding",null),y([w()],kg.prototype,"view",void 0),y([w()],kg.prototype,"width",null),kg=y([Z("esri.views.ui.UI")],kg);const Q8t=kg;function g2e(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function e7t(t,e){return t.length!==e.length||t.some((i,r)=>i.text!==e[r].text)}function I8(t,e,i){!i||!e||t.find(r=>r.layerView===e&&r.text===i)||t.push({text:i,layerView:e})}function t7t(t){return t.type==="bing-maps"}const $b=[];let tM=class extends ze{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new it,this.view=null,this._allLayerViewsChange=i=>{var n;this.removeHandles("suspension");const r=(n=this.view)==null?void 0:n.allLayerViews;r&&this.addHandles(r.map(s=>_e(()=>{var o;return[s.suspended,(o=s.layer)==null?void 0:o.attributionVisible]},()=>this._updateAttributionItems())).toArray(),"suspension"),i!=null&&i.removed&&i.removed.forEach(s=>{this._pendingAttributions.delete(s),this._fetchedAttributionData.delete(s)}),this._updateAttributionItems()},this.addHandles([Jr(()=>{var i;return(i=this.view)==null?void 0:i.allLayerViews},"change",i=>this._allLayerViewsChange(i),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Mo(()=>{var i;return((i=this.view)==null?void 0:i.stationary)===!0},()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){var e;return(e=this.view)!=null&&e.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.view,i=e==null?void 0:e.allLayerViews;$b.length=0,e&&i?(i.forEach(r=>{var o,l;if(r.suspended||!((o=r.layer)!=null&&o.attributionVisible))return;const n=r.layer;if(g2e(n,"user"))return void I8($b,r,n.copyright);if(n.hasAttributionData){if(this._fetchedAttributionData.has(r)){const c=this._fetchedAttributionData.get(r);return void(c?I8($b,r,this._getDynamicAttribution(c,e,n)):g2e(n)&&I8($b,r,n.copyright))}return void this._fetchAttributionData(r)}const s="portalItem"in n?(l=n.portalItem)==null?void 0:l.accessInformation:void 0;I8($b,r,s||n.copyright)}),e7t(this.items,$b)&&(this.items.removeAll(),this.items.addMany($b)),$b.length=0,this.notifyChange("state")):this._clear()}async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const i=await Ju(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const r=i.ok?this._createContributionIndex(i.value,t7t(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,r)}this._updateAttributionItems()}_createContributionIndex(e,i){const r=e.contributors,n={};if(!r)return n;for(let s=0;s{const T=x.id,A=!f.has(T)&&c&&x.extent&&Qne(x.extent,c);return A&&f.add(T),A}).sort((x,T)=>T.score-x.score||x.objectId-T.objectId).map(x=>x.attribution).join(", "):""}};y([w({readOnly:!0,type:it})],tM.prototype,"items",void 0),y([w({readOnly:!0})],tM.prototype,"state",null),y([w()],tM.prototype,"view",void 0),tM=y([Z("esri.widgets.Attribution.AttributionViewModel")],tM);const wze=tM,tt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",disabledElement:"esri-disabled-element",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",noBookmarksIcon:"esri-widget__no-bookmark-icon",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function bo(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:r7t(t[e])}}}function i7t(t){const e=t==null?void 0:t.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function r7t(t){return function(e,...i){i7t(e)?bM(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const GC="esri-attribution",t3={base:GC,poweredBy:`${GC}__powered-by`,sources:`${GC}__sources`,open:`${GC}--open`,sourcesOpen:`${GC}__sources--open`,link:`${GC}__link`,widgetIcon:si.description};let Yc=class extends cn{constructor(e,i){super(e,i),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(r=>r.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.iconClass=t3.widgetIcon,this.icon=null,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new wze}initialize(){this.addHandles(Jr(()=>{var e;return(e=this.viewModel)==null?void 0:e.items},"change",()=>this.scheduleRender()))}destroy(){var e;(e=this._resizeObserver)==null||e.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,i)=>(e.includes(i.text)||e.push(i.text),e),[]).join(this.itemDelimiter)}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[t3.open]:this._isOpen};return X("div",{bind:this,class:this.classes(t3.base,tt.widget,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return X("div",{class:t3.poweredBy},"Powered by"," ",X("a",{class:t3.link,href:"http://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const e=this._isOpen,i=this._isInteractive,r=i?0:void 0,{attributionText:n}=this,s={[t3.sourcesOpen]:e,[tt.interactive]:i};return X("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(t3.sources,s),innerHTML:n,tabIndex:r})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let i=!1;const{clientHeight:r,clientWidth:n,scrollWidth:s}=e,o=s>n,l=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,l&&(i=!0),this._isOpen){const c=r{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:r}=this;return ky(r),this.goToOverride?this.goToOverride(r,i):r.goTo(i.target,i.options)}};return y([w()],e.prototype,"goToOverride",void 0),y([w()],e.prototype,"view",void 0),e=y([Z("esri.widgets.support.GoTo")],e),e},o7t="esri.widgets.CompassViewModel";let aS=class extends LG(ze){constructor(e){super(e),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(_e(()=>this.view,this._updateRotationWatcher,ii))}destroy(){this.view=null}get canShowNorth(){return s7t(this.view)}get state(){var e;return!((e=this.view)!=null&&e.ready)||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){var i,r;if(!((i=this.view)!=null&&i.ready))return;const e={};((r=this.view)==null?void 0:r.type)==="2d"?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){e!=null&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const i=-e.heading;this.orientation={x:0,y:0,z:i}}_updateRotationWatcher(e){this.removeAllHandles(),e&&this.addHandles(e.type==="2d"?_e(()=>e==null?void 0:e.rotation,this._updateForRotation,ii):_e(()=>e==null?void 0:e.camera,this._updateForCamera,ii))}};y([w({readOnly:!0})],aS.prototype,"canShowNorth",null),y([w()],aS.prototype,"orientation",void 0),y([w({readOnly:!0})],aS.prototype,"state",null),y([w()],aS.prototype,"view",void 0),aS=y([Z(o7t)],aS);const xze=aS,y2e="esri-compass",QY={base:y2e,widgetIcon:si.locateCircled,iconContainer:`${y2e}__icon-container`};let zg=class extends cn{constructor(e,i){super(e,i),this.iconClass=QY.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new xze,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=r=>({transform:`rotateZ(${r.z}deg)`})}loadDependencies(){return Pl({button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),icon:()=>we(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([248,245,242]))})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:i}=this.viewModel,r=i==="rotation"?"arrow-up":"compass-needle",{messages:n}=this;return X("div",{class:this.classes(QY.base,tt.widget)},X("calcite-button",{"aria-label":n.reset,class:tt.widgetButton,disabled:i==="disabled",kind:"neutral",onclick:this._reset,round:!0,scale:"s",title:n.reset},X("div",{"aria-hidden":"true",class:QY.iconContainer,title:n.reset},X("calcite-icon",{icon:r,scale:"m",styles:this._toRotationTransform(e)}))))}};y([w()],zg.prototype,"goToOverride",null),y([w()],zg.prototype,"iconClass",void 0),y([w()],zg.prototype,"icon",void 0),y([w()],zg.prototype,"label",null),y([w(),Gr("esri/widgets/Compass/t9n/Compass")],zg.prototype,"messages",void 0),y([w()],zg.prototype,"view",null),y([w({type:xze})],zg.prototype,"viewModel",void 0),zg=y([Z("esri.widgets.Compass")],zg);const a7t=zg,HC="esri-navigation-toggle",I1={base:HC,widgetIcon:si.pan2,button:`${HC}__button`,activeButton:`${HC}__button--active`,panButton:`${HC}__button--pan`,rotateButton:`${HC}__button--rotate`,isLayoutHorizontal:`${HC}--horizontal`};let iM=class extends ze{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.addHandles(Mo(()=>{var e;return(e=this.view)==null?void 0:e.inputManager},()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){var e,i;return(e=this.view)!=null&&e.ready&&((i=this.view)==null?void 0:i.type)==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){var i;const e=(i=this.view)==null?void 0:i.inputManager;e&&(e.primaryDragAction=this.navigationMode==="pan"?"pan":"rotate")}};y([w({readOnly:!0})],iM.prototype,"state",null),y([w()],iM.prototype,"navigationMode",void 0),y([w()],iM.prototype,"view",void 0),iM=y([Z("esri.widgets.NavigationToggleViewModel")],iM);const Sze=iM;let q0=class extends cn{constructor(e,i){super(e,i),this.iconClass=I1.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new Sze}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}toggle(){return this.viewModel.toggle()}render(){var c,f;const e=((c=this.viewModel)==null?void 0:c.state)==="disabled",i=((f=this.viewModel)==null?void 0:f.navigationMode)==="pan",r={[tt.disabled]:e,[I1.isLayoutHorizontal]:this.layout==="horizontal"},n={[I1.activeButton]:i},s={[I1.activeButton]:!i},o=e?-1:0,l=this.messages.toggle;return X("div",{"aria-label":l,bind:this,class:this.classes(I1.base,tt.widget,r),onclick:this._toggle,onkeydown:this._toggle,tabIndex:o,title:l},X("div",{class:this.classes(I1.button,tt.widgetButton,I1.panButton,n)},X("span",{class:si.pan})),X("div",{class:this.classes(I1.button,tt.widgetButton,I1.rotateButton,s)},X("span",{class:si.rotate})))}_toggle(){this.toggle()}};y([w()],q0.prototype,"iconClass",void 0),y([w()],q0.prototype,"icon",void 0),y([w()],q0.prototype,"label",null),y([w({value:"vertical"})],q0.prototype,"layout",null),y([w(),Gr("esri/widgets/NavigationToggle/t9n/NavigationToggle")],q0.prototype,"messages",void 0),y([w()],q0.prototype,"view",null),y([w({type:Sze})],q0.prototype,"viewModel",void 0),y([bo()],q0.prototype,"_toggle",null),q0=y([Z("esri.widgets.NavigationToggle")],q0);const l7t=q0,$l="esri-feature",c7t={base:$l,container:`${$l}__size-container`,title:`${$l}__title`,main:`${$l}__main-container`,btn:`${$l}__button`,icon:`${$l}__icon`,content:`${$l}__content`,contentNode:`${$l}__content-node`,contentNodeText:`${$l}__content-node--text`,contentElement:`${$l}__content-element`,text:`${$l}__text`,lastEditedInfo:`${$l}__last-edited-info`,fields:`${$l}__fields`,fieldHeader:`${$l}__field-header`,fieldData:`${$l}__field-data`,fieldDataDate:`${$l}__field-data--date`,loadingSpinnerContainer:`${$l}__loading-container`,spinner:`${$l}__loading-spinner`};let ov=class extends cn{constructor(){super(...arguments),this.enabled=!0,this.iconClass=null,this.icon=null,this.title=""}render(){const e=this.enabled?0:-1,i={[tt.disabled]:!this.enabled,[tt.interactive]:this.enabled};return X("div",{bind:this,class:this.classes(tt.widgetButton,tt.widget,i),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},X("span",{"aria-hidden":"true",class:this.classes(c7t.icon,this.iconClass??""),role:"presentation"}),X("span",{class:si.fontFallbackText},this.title))}_triggerAction(){this.action.call(this)}};y([w()],ov.prototype,"action",void 0),y([w()],ov.prototype,"enabled",void 0),y([w()],ov.prototype,"iconClass",void 0),y([w()],ov.prototype,"icon",void 0),y([w()],ov.prototype,"title",void 0),y([bo()],ov.prototype,"_triggerAction",null),ov=y([Z("esri.widgets.IconButton")],ov);const v2e=ov;let lS=class extends ze{get canZoomIn(){var r,n,s;if(!((r=this.view)==null?void 0:r.ready))return!1;const i=(s=(n=this.view)==null?void 0:n.constraints)==null?void 0:s.effectiveMaxScale;return i===0||this._scale>i}get canZoomOut(){var n;const{view:e}=this;if(!(e==null?void 0:e.ready))return!1;const r=(n=e.constraints)==null?void 0:n.effectiveMinScale;return r===0||this._scale{this.components.forEach(r=>{const n=this._find(r),s=n==null?void 0:n.widget;p7t(s)&&(s.view=i)})},this._componentsWatcher=(i,r)=>{this._removeComponents(r),this._addComponents(i),this._adjustPadding(i)}}initialize(){this.addHandles([_e(()=>this.components,this._componentsWatcher,ii),_e(()=>this.view,this._updateViewAwareWidgets,ii)])}_add(e,i,r,n,s){let o=e;if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;o=this._createComponent(e)}super._add(o,i,r,n,s)}_removeComponents(e){e.forEach(i=>{const r=this._find(i);r&&(this.remove(r),r.destroy())})}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:i}=this.padding;this.padding=i}}_addComponents(e){this.constructed&&e.forEach(i=>this.add(this._createComponent(i),this._defaultPositionLookup[i]))}_createComponent(e){const i=this._createWidget(e);return new xk({id:e,node:i})}_createWidget(e){const{view:i}=this;switch(e){case"attribution":return new n7t({view:i});case"compass":return new a7t({view:i});case"navigation-toggle":return new l7t({view:i});case"zoom":return new d7t({view:i})}}};y([w()],Sk.prototype,"components",void 0),Sk=y([Z("esri.views.ui.DefaultUI")],Sk);const Eze=Sk;let Tk=class extends Eze{constructor(e){super(e),this.components=["attribution","zoom","navigation-toggle","compass"]}};y([w()],Tk.prototype,"components",void 0),Tk=y([Z("esri.views.ui.3d.DefaultUI3D")],Tk);const Cze=Tk;let Nt=class extends qft(pmt(Jft(Pmt))){constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._defaults={},this._externallySet={environment:!1},this._createGraphicsViewController=null,this._resolveWhenReady=[],this._propertiesPool=new x_({slicePlane:p4e},this),this._resourceController=T4t(this),this._defaultToMapOptions={include:new Set},this._defaultHitTestOptions={exclude:new Set},this.deconflictor=new iie({view:this}),this.labeler=new eS({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new y5,this.basemapTerrain=null,this.elevationProvider=null,this.canvas=null,this.constraints=new IS,this.environmentManager=new N0,this.floors=new it,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new $mt({view:this}),this.groundView=null,this.map=null,this.screenSizePerspectiveEnabled=!0,this.state=new ZRt,this.spatialReference=null,this.alphaCompositingEnabled=!1,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new Cze,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this.highlightOptions=new q7e,dft(),e!=null&&e.environment||(this._defaults.environment=new UA,this.environment=this._defaults.environment);const i=(r=null)=>{r!=null&&r.type===wn.MOVE||(this._updatingChanged(),this.map&&this.map.allLayers.forEach(async n=>{try{await n.when()}catch{}this._updatingChanged()}))};this.addHandles([Jr(()=>{var r;return(r=this.map)==null?void 0:r.allLayers},"after-changes",r=>i(r),{onListenerAdd:()=>i(),onListenerRemove:()=>i(),sync:!0}),this.allLayerViews.on("after-changes",r=>this._updateUpdatingMonitors(r)),_e(()=>this.map,r=>{r&&"load"in r&&r.load&&r.load().catch(()=>{})})]),this.inputManager=new m2t({view:this}),this.stateManager=new ra({view:this})}initialize(){this.groundView=new tmt({view:this}),this._updateUpdatingMonitors();const e=()=>this._updateDefaultToMapOptions();this.addHandles(Jr(()=>{var i;return(i=this.map)==null?void 0:i.allLayers},"after-changes",e,{onListenerAdd:e,onListenerRemove:e})),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,i=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=i)},ii),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,i=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=i)},ii),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,i=>AGe(i>0?1e3/Math.ceil(i):0),ii),this.updatingHandles.add(()=>{var i;return(i=this.map)==null?void 0:i.ground},e,kt),this.updatingHandles.add(()=>{var i,r;return(r=(i=this.map)==null?void 0:i.ground)==null?void 0:r.opacity},()=>this._updateDefaultHitTestOptions(),kt),this.addHandles(_e(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),Li))}destroy(){var e;this.destroyed||(this.updatingHandles.removeAll(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._exitSurface(),this._disposeGraphicsView(),this.sharedSymbolResources=et(this.sharedSymbolResources),this._set("labeler",et(this.labeler)),this._set("deconflictor",et(this.deconflictor)),this._resourceController=et(this._resourceController),this._set("stateManager",et(this.stateManager)),this._set("inputManager",et(this.inputManager)),this.state.destroy(),this._propertiesPool.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",et(this.environmentManager)),this._set("environment",et(this.environment)),this.groundView=et(this.groundView),this._exitBasemapTerrain(),(e=this._stage)==null||e.destroy())}get renderSpatialReference(){return this.renderCoordsHelper&&this.renderCoordsHelper.spatialReference}get basemapSpatialReference(){var e;return(e=this.basemapTerrain)==null?void 0:e.spatialReference}get animation(){var e;return(e=this.state)==null?void 0:e.animation}get camera(){var e;return(e=this.stateManager)==null?void 0:e.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){var e;return(e=this.stateManager)==null?void 0:e.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get center(){var e;return(e=this.stateManager)==null?void 0:e.center}set center(e){this.stateManager&&(this.stateManager.center=e)}get clippingArea(){if(this.viewingMode==="global")return null;const e=this.map;let i=this._userClippingArea||ihe(e,"clippingArea");return!this._userClippingArea&&!ihe(e,"clippingEnabled")||i==null?(this._clippingArea=null,null):i instanceof Vi?this.spatialReference&&(i=$8(i,this.spatialReference),i==null)?(Ce.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(i=i.clone(),i.intersection(this._groundAndLayersExtent)==null&&(i.xmin=i.xmax,i.ymin=i.ymax),i.zmin=void 0,i.zmax=void 0,i.equals(this._clippingArea)||(this._clippingArea=i),this._clippingArea):(Ce.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&this.viewingMode==="global"&&e!=null?Ce.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(this.state.viewingMode===_t.Global)return null;const e=this.renderSpatialReference,i=this.dataExtent;return i==null||e==null||i.spatialReference.equals(e)?i:$8(i,e)}get dataExtent(){let e=this._groundAndLayersExtent;const i=this.spatialReference||at.WGS84,r=$8(this.clippingArea,i);r!=null&&(e=e!=null?e.intersection(r):r);const n=this._get("dataExtent");return e!=null&&e.equals(n)?n:e}get _groundAndLayersExtent(){const e=this.spatialReference||at.WGS84;let i;const r=o=>{const l=$8(o,e);l!=null&&(i!=null?i.union(l):i=l.clone())},n=this.basemapTerrain;if(n!=null&&n.spatialReference){const o=n.groundExtent;r(new Vi({xmin:o[0],ymin:o[1],zmin:0,xmax:o[2],ymax:o[3],zmax:0,spatialReference:n.spatialReference}))}if(this.map){const o=l=>{l.fullExtent==null||l.type==="graphics"&&l.internal||r(l.fullExtent)};this.map.allLayers.forEach(l=>o(l))}if(i==null)return null;i.hasZ?(i.zmin=Math.min(0,i.zmin??0),i.zmax=Math.max(0,i.zmax??0)):(i.zmin=0,i.zmax=0);const s=this._get("_groundAndLayersExtent");return i.equals(s)?s:i}set environment(e){e!==this._defaults.environment&&(this._externallySet.environment=!0),this._set("environment",e)}castEnvironment(e){return e?e instanceof UA?e:e instanceof f5?this.environment!=null?this.environment.cloneWithWebsceneEnvironment(e):UA.fromWebsceneEnvironment(e):$s(UA,e):new UA}get extent(){var e;return(e=this.stateManager)==null?void 0:e.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){var e;return(e=this.stateManager)==null?void 0:e.screenCenter}get frustum(){var e;return(e=this.stateManager)==null?void 0:e.frustum}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get _defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){var e;return this.navigating||(((e=this.toolViewManager)==null?void 0:e.interacting)??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state==null||this.state.stationary)}get navigating(){var e;return((e=this.state)==null?void 0:e.navigating)??!1}get padding(){var e;return(e=this.stateManager)==null?void 0:e.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}set qualityProfile(e){lk.isValidProfile(e)&&(lk.apply(e,this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||lk.getDefaultProfile()}set slicePlane(e){if(this._stage!=null&&this._stage.renderer.setParameters({slicePlane:e}),e==null)return void this._set("slicePlane",null);const i=this._propertiesPool.get("slicePlane");wE(e,i),this._set("slicePlane",i)}get typeSpecificPreconditionsReady(){return!!this.viewingMode}get resolution(){return this.spatialReference!=null?TRe(this.scale,this.spatialReference):0}get scale(){var e;return(e=this.stateManager)==null?void 0:e.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return e!=null?N_.deriveUnitFromSR(e,this.spatialReference):null}get updating(){var s,o,l,c;if(this.destroyed)return!1;let e=0,i=this.layerViewManager.updating,r=i?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(f=>{if(f.isFulfilled()){if(f.updating){if(i=!0,f.suspended||JL(f))return;++r,e+=f.updatingProgress}}else++r});for(const f of this._updatingObjects)f!=null&&f.updating&&(r+=.1,e+=.5*.1);for(const f of this._updatingObjectsWithProgress)f!=null&&f.updating&&(++r,e+=f.updatingProgress);const n=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(i=!!(i||r>0||this.updatingHandles.updating||!this.ready||!this.stationary||n||this._createGraphicsViewController||(s=this.inputManager)!=null&&s.updating||(l=(o=this.map)==null?void 0:o.allLayers)!=null&&l.some(f=>!f.isFulfilled())||(c=this.textures)!=null&&c.updating),i?(this._numUpdating=Math.max(r,this._numUpdating),e+=this._numUpdating-r):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=i?0:1,this._get("updatingProgress")!==e){const f=performance.now();if(e<1){const _=Math.min((f-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-_)+e*_}this._set("updatingProgress",e),this._lastUpdateTime=i&&e<1?f:0}return i}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this._stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){var r;const e=this._predeterminedViewingMode;if(e!=null)return u$(e);const i=this.spatialReference;return i?((r=this.defaultsFromMap)==null?void 0:r.viewingMode)!=null&&i.equals(this.defaultsFromMap.spatialReference)?u$(this.defaultsFromMap.viewingMode):p5(i,_t.Global)?"global":"local":"global"}set viewingMode(e){this.ready?Ce.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){var e;return(e=this.stateManager)==null?void 0:e.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get resourceController(){return this._resourceController}get quality(){var e,i;return((i=(e=this._resourceController)==null?void 0:e.memoryController)==null?void 0:i.memoryFactor)??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new Z4t(this)}on(e,i,r,n){return this.viewEvents.on(e,i,r,n)||super.on(e,i)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,i){if(!this.ready)return Ce.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const r=i?this.externalToInternalIntersectOptions(i):this._defaultToMapOptions,n=r.graphics!=null&&(r.graphics.include!=null||r.graphics.exclude!=null),s=nme(e)?rme(this,e):e,o=dm(s);r.enableDraped=r.include&&!r.include.has(Gw)||r.exclude&&r.exclude.has(Gw);const l=this.sceneIntersectionHelper,c=Tp(this.state.viewingMode);if(c.options.selectionMode=!0,c.options.store=n?tl.ALL:tl.MIN,l.intersectIntersectorScreen(o,c,r),n){for(const f of c.results.all){const _=sre(f,this);if(_==null)return this._intersectResultToMapPoint(f);if(_.type!=="graphic"||this._testGraphicUidFilter(r.graphics,_.graphic))return this._intersectResultToMapPoint(f)}return null}return this._intersectResultToMapPoint(c.results.min)}toScreen(e){if(!this.ready)return Ce.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;const i=(e.z==null?my(this.elevationProvider,e):null)??0;return ud(e,qC,this.renderSpatialReference,i),this.state.camera.projectToScreen(qC,tX),Ku(tX[0],tX[1])}pixelSizeAt(e){return this.ready?e?(ud(e,qC,this.renderSpatialReference),this.state.camera.computeScreenPixelSizeAt(qC)):0:(Ce.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null)}overlayPixelSizeInMapUnits(e){const i=this.basemapTerrain.overlayManager;return i?i.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e)):1}hitTest(e,i){if(!this.ready)return Ce.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const r=nme(e)?rme(this,e):e,n=ss(r.x,r.y),s=i?this.externalToInternalIntersectOptions(i):this._defaultHitTestOptions;s.requiresGroundFeedback=!0,s.enableDraped=!0;const o=Tp(this.state.viewingMode);o.options.selectionMode=!0,o.options.store=tl.ALL,this.sceneIntersectionHelper.intersectIntersectorScreen(n,o,s);const l=this._intersectResultsToHits(o.results.all,s.graphics),c=o.results.ground,f=d2e(c,this),_=f!=null&&"type"in f&&f.type==="integrated-mesh"?f:null,x={screenPoint:r,results:l,ground:{mapPoint:this._intersectResultToMapPoint(c),distance:Gm(c)?c.distanceInRenderSpace:0,layer:_}};return Tn.SCENEVIEW_HITTEST_RETURN_INTERSECTOR&&(x.intersector=o),Promise.resolve(x)}async popupHitTest(e){const{results:i,ground:r}=await R8t(this,e);let n=null;return!(i.length===0||Math.abs((i[0].distance??0)-r.distance)<1e-5)||r.layer&&r.layer.type==="integrated-mesh"||(n=r.mapPoint),{results:i,screenPoint:e,mapPoint:n}}goTo(e,i){return this.updatingHandles.addPromise(this.stateManager.goTo(e,i))}async whenAnalysisView(e){if(e.parent==null)throw new se("view:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const i=this._completeSettings(e);await this.whenReady();const r=await this._stage.renderView.takeScreenshot(i);return qY(r,i,this._pixelFormat())}async _takeScreenshot(e){const i=this._completeSettings(e);await this.whenReady();const r=await this._stage.renderView.takeScreenshot(i);return WY(r,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const i=this._completeSettings(e);await this.whenReady();const r=await this._stage.renderView.takeScreenshotWithOID(i);return[WY(r[0],this._pixelFormat()),WY(r[1],this._pixelFormat())]}_completeSettings(e){const i=c8t(e,this);return i.pixelRatio/=this.state.pixelRatio,p8t(i,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this._stage.renderView.getAlpha()}}get test(){return{takeScreenshot:e=>this._takeScreenshot(e),takeScreenshotWithObjectAndLayerId:e=>this._takeScreenshotWithObjectAndLayerId(e)}}async takeScreenshotWithObjectAndLayerId(e){if(!Le("enable-feature:objectAndLayerId-rendering"))throw new Error("has enable-feature:objectAndLayerId-rendering must be true");const i=this._completeSettings(e);await this.whenReady();const r=await this._stage.renderView.takeScreenshotWithOID(i),n=qY(r[0],i,this._pixelFormat()),s=this._completeSettings(e);return s.format="png",[n,qY(r[1],s,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){if(this._stage.renderView.objectAndLayerIdRenderHelper==null)throw new Error("has enable-feature:objectAndLayerId-rendering must be true");return this._stage.renderView.objectAndLayerIdRenderHelper.getColorToObjectAndLayerIdMapping()}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}importLayerView(e){return hme.importLayerView(e)}hasLayerViewModule(e){return hme.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){var e,i,r;return this.map&&"initialViewProperties"in this.map&&((e=this.map.initialViewProperties)==null?void 0:e.spatialReference)||((i=this.defaultsFromMap)==null?void 0:i.spatialReference)||((r=this.defaultsFromMap)==null?void 0:r.ready)&&this._initialDefaultSpatialReference||null}async validate(){let e=G8t(this.type);const i=Le("safari");if(i&&i<9&&(e=new se("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:i})),e!=null)throw Ce.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){var i;const e=this._isOverridden("viewingMode")?this._get("viewingMode"):(this.map&&"initialViewProperties"in this.map?(i=this.map.initialViewProperties)==null?void 0:i.viewingMode:null)??null;return e!=null?Afe(e):null}getSpatialReferenceSupport({spatialReference:e,layer:i}){const r=this._predeterminedViewingMode;if(r!=null)return this._validateSpatialReferenceForViewingMode(e,i,r)?{constraints:this._makeSpatialReferenceConstraints(e,i,r)}:null;const n=this._validateSpatialReferenceForViewingMode(e,i,_t.Local),s=this._validateSpatialReferenceForViewingMode(e,i,_t.Global);return n||s?n&&s?{constraints:this._makeSpatialReferenceConstraints(e,i,null)}:n?{constraints:this._makeSpatialReferenceConstraints(e,i,_t.Local)}:{constraints:this._makeSpatialReferenceConstraints(e,i,_t.Global)}:null}_validateSpatialReferenceForViewingMode(e,i,r){return!!p5(e,r)&&(i==null||!!Ipe(i)||(!oO(i)||SG(i,e,r)!=null)&&(!Rpe(i)||r!==_t.Global))}_makeSpatialReferenceConstraints(e,i,r){if(i==null)return[{spatialReference:e,viewingMode:r}];const n=e.isWebMercator,s=e.isWGS84;return Ipe(i)&&(n||s)?!s||r===_t.Local||KL(i.tileInfo,i.fullExtent,e,_t.Global)===null?[{spatialReference:e,viewingMode:r},{spatialReference:at.WebMercator,viewingMode:r}]:[{spatialReference:n?at.WGS84:at.WebMercator,viewingMode:r}]:oO(i)||Rpe(i)||!n&&!s?oO(i)&&n&&r!==_t.Global?[{spatialReference:e,viewingMode:r},{spatialReference:at.WGS84,viewingMode:_t.Local}]:[{spatialReference:e,viewingMode:r}]:[{spatialReference:e,viewingMode:r},{spatialReference:n?at.WGS84:at.WebMercator,viewingMode:r}]}_validateSpatialReference(e){const i=this.getSpatialReferenceSupport({spatialReference:e})!=null,r=this._predeterminedViewingMode;return i||(r!=null?Ce.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${u$(r)} viewing mode.`):e.isGeographic&&Ce.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),i}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}computeMapPointFromVec3d(e,i){let r=this.spatialReference||at.WGS84;return el(e,this.renderSpatialReference,e,r)||(r=at.WGS84,el(e,this.renderSpatialReference,e,r)),i?(i.x=e[0],i.y=e[1],i.z=e[2],i.spatialReference=r):i=new mt(e,r),i}trackGraphicState(e){if(!e.graphic)return Ce.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const i=this.getViewForGraphic(e.graphic);let r=null,n=!1;const s=o=>{var l;!n&&o!=null&&"processor"in o&&((l=o.processor)==null?void 0:l.type)==="graphics-3d"&&o.processor.graphicsCore&&(r=o.processor.graphicsCore.trackGraphicState(e))};return i!=null?s(i):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(o=>s(o),()=>{}).catch(()=>{}),rr(()=>{n=!0,r!=null&&(r.remove(),r=null)})}highlight(e){if(Array.isArray(e))return id(e.map(r=>this.highlight(r)));if(it.isCollection(e))return id(e.toArray().map(r=>this.highlight(r)));const i=this.getViewForGraphic(e);return i&&"highlight"in i?i.highlight(e):rr()}maskOccludee(e){if(!e)return Ce.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const i=this.getViewForGraphic(e);let r=null,n=!1;const s=o=>{!n&&o!=null&&N8t(o)&&(r=o.maskOccludee(e))};return i!=null?s(i):this.whenViewForGraphic(e,{waitForLayer:!0}).then(o=>s(o),()=>{}).catch(()=>{}),rr(()=>{n=!0,r!=null&&(r.remove(),r=null)})}getViewForGraphic(e){return e.layer===this.graphics?this.graphicsView:e.layer?this.allLayerViews.find(i=>i.layer===e.layer):null}graphicChanged(e){this.graphicsView!=null&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,i){if(e.layer===this)return await rd(()=>this.graphicsView),this.graphicsView;if(!e.layer||!this.map)throw new se("no-view-for-graphic");return i&&i.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((r,n)=>{const s=this.map.allLayers.on("change",o=>{o.added.includes(e.layer)&&(s.remove(),this.whenLayerView(e.layer).then(r,n))})}):this.whenLayerView(e.layer)}externalToInternalIntersectOptions(e){const i=this._externalToInternalRenderItems(e.include,V$.INCLUDE),r=this._externalToInternalRenderItems(e.exclude,V$.EXCLUDE);return{include:i.layerUids,exclude:r.layerUids,graphics:{include:i.graphicUids,exclude:r.graphicUids}}}_intersectResultToMapPoint(e,i){return e.getIntersectionPoint(qC)?(i=this.computeMapPointFromVec3d(qC,i),e.intersector===ms.TERRAIN&&this.basemapTerrain&&(i.z=my(this.basemapTerrain,i)??0),i):null}_intersectResultsToHits(e,i){const r=new Array;let n=null;for(let s=0;s{var r;const i=(r=this.basemapTerrain)==null?void 0:r.extent;if(this.clippingArea||i)if(i&&this.basemapTerrain.spatialReference){const n=this.basemapTerrain.extent!=null&&this.basemapTerrain.spatialReference!=null?rl(bB(this.basemapTerrain.extent,this.basemapTerrain.spatialReference),this.spatialReference):null;this.clippingArea!=null?this.featureTiles.filterExtent=this.clippingArea.intersection(n):this.featureTiles.filterExtent=n}else this.featureTiles.filterExtent=this.clippingArea;else this.featureTiles.filterExtent=null};this.addHandles([this.updatingHandles.add(()=>Tn.FEATURE_TILE_TREE_SHOW_TILES,i=>{i&&this.featureTiles&&!this._featureTreeDebugger?this.updatingHandles.addPromise(we(()=>import("./FeatureTileTree3DDebugger-ZBfyCqfy.js"),__vite__mapDeps([249,233]))).then(({FeatureTileTree3DDebugger:r})=>{!this._featureTreeDebugger&&Tn.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new r({view:this}))}):i||!this._featureTreeDebugger||Tn.FEATURE_TILE_TREE_SHOW_TILES||(this._featureTreeDebugger.destroy(),this._featureTreeDebugger=null)},kt),this.updatingHandles.add(()=>this.clippingArea,e,kt),this.updatingHandles.add(()=>this.basemapTerrain.extent,e,kt)],"feature-tiles"),this.stateManager.init()}_exitGlobe(){this.state&&(this.stateManager.exit(),this.removeHandles("render-coords-helper"),this.removeHandles("feature-tiles"),this.featureTiles.destroy(),this._set("featureTiles",null),this.pointsOfInterest.destroy(),this._set("pointsOfInterest",null),this._exitBasemapTerrain(),this.state.exit(),this._exitCoordinateSystem())}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference;this.mapCoordsHelper&&this.mapCoordsHelper.spatialReference.equals(e)||this._set("mapCoordsHelper",new s4t(this.map,e));const i=this.state.isGlobal,r=jft(i,e);r!==this.renderSpatialReference&&(this._set("renderCoordsHelper",c4t.create(this.state.viewingMode,r)),i||this.addHandles(_e(()=>{var n;return(n=this.basemapTerrain)==null?void 0:n.extent},n=>{const s=this.renderCoordsHelper.spatialReference;n==null||n[0]===0&&n[1]===0&&n[2]===0&&n[3]===0||!mj(n,this.basemapTerrain.spatialReference,_2e,s)||(this.renderCoordsHelper.extent=_2e)},Li),"render-coords-helper"),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(v5/this.renderCoordsHelper.unitInMeters))}else this._set("mapCoordsHelper",null),this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.mapCoordsHelper&&(this.removeHandles("render-coords-helper"),this._set("renderCoordsHelper",null),this._set("mapCoordsHelper",null))}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){e!=null&&e.type===wn.MOVE||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(i=>{i.destroyed||(this.addHandles(_e(()=>[i.updating,i.updatingProgress],()=>this._updatingChanged(),Li),"updatingMonitors"),i.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,i,r){if(!this.overlay||!this.overlay.hasVisibleItems)return r;const n=e.getContext("2d");return n.putImageData(r,0,0),this.overlay.renderCanvas(e,{disableDecorations:i===Xh.OFF}),n.getImageData(0,0,r.width,r.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(n,s,o)=>this._renderScreenshotOverlay(n,s,o)}},i=new JRt(this.state.viewingMode,n=>this._stage.layers.forAll(n),this);this._set("sceneIntersectionHelper",i);const r=x9(this.surface);this._stage=new Dd({view:this,options:e,container:r}),this._stage.renderer.setParameters({slicePlane:this.slicePlane}),this.addHandles([this.updatingHandles.add(()=>this.qualitySettings.highQualityTransparency,n=>this._stage.renderer.setParameters({highQualityTransparency:n}),ii),_e(()=>this.magnifier,n=>this._stage.renderView.magnifier=n,kt),this.on("pointer-move",()=>{var n;return(n=this._stage)==null?void 0:n.renderer.resetAnimation()}),Y5(this._stage.renderView.canvas,"webglcontextlost",n=>this.fatalError=new se("webgl-context-lost",n.statusMessage))],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(v5/this.renderCoordsHelper.unitInMeters),this._set("canvas",this._stage.renderView.canvas)}_exitStage(){this._set("sceneIntersectionHelper",null),this._stage=et(this._stage),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(e){this._exitSurface(),this.state.init(e,this.spatialReference),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Q4t({view:this,viewingMode:e,resourceController:this._resourceController,pointsOfInterest:this.pointsOfInterest,viewState:this.state})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitGlobe(),this._exitStage())}_createGraphicsViewIfNeeded(){if(this.graphicsView||this._createGraphicsViewController||this.graphics.length===0)return;this.removeHandles("graphics-view"),this._createGraphicsViewController=new AbortController;const e=()=>{this._createGraphicsViewController=null,this._updatingChanged()};this._createGraphicsViewAsync(this._createGraphicsViewController.signal).then(e,e),this._updatingChanged()}async _createGraphicsViewAsync(e){const i=(await we(()=>import("./GraphicsView3D-6FUUKif_.js"),__vite__mapDeps([250,188,180,95,90,91]))).default;St(e),await rd(()=>{var r;return(r=this.basemapTerrain)==null?void 0:r.ready},e),this._set("graphicsView",new i({view:this}))}_disposeGraphicsView(){this._createGraphicsViewController&&(this._createGraphicsViewController.abort(),this._createGraphicsViewController=null),this.removeHandles("graphics-view"),this.graphicsView!=null&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_startup(){var r;const e=Afe(this.viewingMode);if(e===_t.Global&&(this._clippingArea=null),this._initSurface(e),this._set("ready",!0),this.addHandles(Jr(()=>this.graphics,"after-changes",()=>this._createGraphicsViewIfNeeded()),"graphics-view"),this._createGraphicsViewIfNeeded(),!this._externallySet.environment){const{map:n}=this,s=n&&"initialViewProperties"in n?(r=n.initialViewProperties)==null?void 0:r.environment:void 0;s&&(this.environment=s)}this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect(),this._set("textures",new VM(this._stage,this.resourceController.scheduler));const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(n=>n(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this.labeler.dispose(),this._disposeGraphicsView(),this.removeHandles("graphics-view"),this._set("textures",et(this.textures)),this._exitSurface(),this._set("ready",!1)}_updateDefaultToMapOptions(){if(this._defaultToMapOptions.include.clear(),this.map){this.map.ground&&this._defaultToMapOptions.include.add(Gw);for(const e of this.map.allLayers.items)e.type==="integrated-mesh"&&this._defaultToMapOptions.include.add(e.uid)}}_updateDefaultHitTestOptions(){if(this._defaultHitTestOptions.exclude.clear(),this.map){this.map.ground&&this.map.ground.opacity<1&&this._defaultHitTestOptions.exclude.add(Gw);for(const e of this.map.allLayers.items)e.type==="integrated-mesh"&&e.opacity<1&&this._defaultHitTestOptions.exclude.add(e.uid)}}};function DR(t,e){t.layerUids||(t.layerUids=new Set),t.layerUids.add(e)}function f7t(t,e){t.graphicUids||(t.graphicUids=new Set),t.graphicUids.add(e)}function $8(t,e){return t!=null&&th(t.spatialReference,e)?rl(t,e):null}var V$;Nt.type="3d",y([w()],Nt.prototype,"_userClippingArea",void 0),y([w()],Nt.prototype,"_resourceController",void 0),y([w()],Nt.prototype,"_stage",void 0),y([w({readOnly:!0})],Nt.prototype,"deconflictor",void 0),y([w({readOnly:!0})],Nt.prototype,"labeler",void 0),y([w(Pz(y5,"analyses"))],Nt.prototype,"analyses",void 0),y([w({type:b5,readOnly:!0})],Nt.prototype,"animation",null),y([w({readOnly:!0})],Nt.prototype,"basemapTerrain",void 0),y([w({readOnly:!0})],Nt.prototype,"elevationProvider",void 0),y([w()],Nt.prototype,"camera",null),y([w({type:cd})],Nt.prototype,"contentCamera",null),y([w({readOnly:!0})],Nt.prototype,"canvas",void 0),y([w({type:mt})],Nt.prototype,"center",null),y([w({type:Vi})],Nt.prototype,"clippingArea",null),y([w({type:IS})],Nt.prototype,"constraints",void 0),y([w({type:Vi,readOnly:!0})],Nt.prototype,"renderDataExtent",null),y([w({type:Vi,readOnly:!0})],Nt.prototype,"dataExtent",null),y([w({type:Vi,readOnly:!0})],Nt.prototype,"_groundAndLayersExtent",null),y([w({value:null,type:UA})],Nt.prototype,"environment",null),y([Ci("environment")],Nt.prototype,"castEnvironment",null),y([w({readOnly:!0})],Nt.prototype,"environmentManager",void 0),y([w({type:Vi})],Nt.prototype,"extent",null),y([w()],Nt.prototype,"floors",void 0),y([w()],Nt.prototype,"screenCenter",null),y([w()],Nt.prototype,"frustum",null),y([w({type:Number,readOnly:!0})],Nt.prototype,"fullOpacity",void 0),y([w({readOnly:!0})],Nt.prototype,"graphicsView",void 0),y([w({readOnly:!0})],Nt.prototype,"analysisViewManager",void 0),y([w()],Nt.prototype,"groundView",void 0),y([w({type:Boolean})],Nt.prototype,"initialExtentRequired",null),y([w()],Nt.prototype,"_defaultsFromMapSettings",null),y([w()],Nt.prototype,"interacting",null),y([w()],Nt.prototype,"stationary",null),y([w()],Nt.prototype,"navigating",null),y([w()],Nt.prototype,"map",void 0),y([w({readOnly:!0})],Nt.prototype,"mapCoordsHelper",void 0),y([w()],Nt.prototype,"padding",null),y([w({type:Nu,readOnly:!0})],Nt.prototype,"pointsOfInterest",void 0),y([w({type:_l,readOnly:!0})],Nt.prototype,"featureTiles",void 0),y([w()],Nt.prototype,"_featureTreeDebugger",void 0),y([w({type:Boolean})],Nt.prototype,"screenSizePerspectiveEnabled",void 0),y([w({constructOnly:!0})],Nt.prototype,"deactivatedWebGLExtensions",void 0),y([w({constructOnly:!0})],Nt.prototype,"debugWebGLExtensions",void 0),y([w({constructOnly:!0})],Nt.prototype,"renderCanvas",void 0),y([w({constructOnly:!0})],Nt.prototype,"state",void 0),y([w({readOnly:!0})],Nt.prototype,"inputManager",void 0),y([w({readOnly:!0})],Nt.prototype,"stateManager",void 0),y([w({type:["low","medium","high"]})],Nt.prototype,"qualityProfile",null),y([w({type:n_e,get(){let t=this._get("qualitySettings");return t||(t=new n_e,lk.apply(this.qualityProfile,t)),t}})],Nt.prototype,"qualitySettings",void 0),y([w()],Nt.prototype,"slicePlane",null),y([w({readOnly:!0})],Nt.prototype,"typeSpecificPreconditionsReady",null),y([w({readOnly:!0})],Nt.prototype,"renderCoordsHelper",void 0),y([w({readOnly:!0})],Nt.prototype,"sceneIntersectionHelper",void 0),y([w({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],Nt.prototype,"resolution",null),y([w({type:Number})],Nt.prototype,"scale",null),y([w()],Nt.prototype,"heightModelInfo",null),y([w()],Nt.prototype,"spatialReference",void 0),y([w({type:Boolean,constructOnly:!0})],Nt.prototype,"alphaCompositingEnabled",void 0),y([w({constructOnly:!0})],Nt.prototype,"preserveDrawingBufferEnabled",void 0),y([w({type:Boolean})],Nt.prototype,"supersampleScreenshotsEnabled",void 0),y([w({readOnly:!0})],Nt.prototype,"type",void 0),y([w(),Ci(t=>t instanceof Eze?t:MT(Cze,t))],Nt.prototype,"ui",void 0),y([w({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","_stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],Nt.prototype,"updating",null),y([w()],Nt.prototype,"_updatingObjects",null),y([w()],Nt.prototype,"_updatingObjectsWithProgress",null),y([w({type:Number,readOnly:!0,dependsOn:["updating"]})],Nt.prototype,"updatingProgress",void 0),y([w({type:["global","local"]})],Nt.prototype,"viewingMode",null),y([w({type:ih})],Nt.prototype,"viewpoint",null),y([w({type:Number})],Nt.prototype,"zoom",null),y([w({type:q7e})],Nt.prototype,"highlightOptions",void 0),y([w({readOnly:!0})],Nt.prototype,"quality",null),y([w({readOnly:!0})],Nt.prototype,"resolutionScale",null),y([w()],Nt.prototype,"textures",void 0),Nt=y([Z("esri.views.SceneView")],Nt),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE"}(V$||(V$={}));const qC=W(),tX=ss(),_2e=Ni(),Aze=Nt,Mze=(t,...e)=>new Bpt({portalItem:{id:t},layers:[...e]}),Oze=t=>new Aze({map:t,container:"viewDiv",qualityProfile:"high"});var ore;let mw=ore=class extends lP{constructor(t){super(t),this.displayValueEnabled=!1,this.max=1,this.min=0,this.step=.1,this.type="slider",this.value=null}clone(){return new ore({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,displayValueEnabled:this.displayValueEnabled,max:this.max,min:this.min,step:this.step,value:this.value})}};y([w()],mw.prototype,"displayValueEnabled",void 0),y([w()],mw.prototype,"max",void 0),y([w()],mw.prototype,"min",void 0),y([w()],mw.prototype,"step",void 0),y([w()],mw.prototype,"value",void 0),mw=ore=y([Z("esri.support.Action.ActionSlider")],mw);const m7t=mw,Pze={hide:"hide",hideChildren:"hide-children"};function bV(t){if(t)return t.listMode!=null?t.listMode:void 0}function g7t(t){return t!=null&&"minScale"in t&&t.minScale!=null?t.minScale:void 0}function y7t(t){return t!=null&&"maxScale"in t&&t.maxScale!=null?t.maxScale:void 0}function v7t(t){if(!t)return"inherited";const e=T7t(Jce(t)?t.layer:t);return e!=null?e?"independent":"inherited":"visibilityMode"in t&&t.visibilityMode!=null?t.visibilityMode:"independent"}function Rze(t){if(t&&(!("type"in t)||t.type!=="wmts")&&t.listMode!==Pze.hideChildren)return"sublayers"in t?"sublayers":"layers"in t?"layers":void 0}function _7t(t){const e=(t!=null&&t.layer&&Jce(t.layer)?t.layer.layer:void 0)??(t==null?void 0:t.layer);return!!e&&(E7t(e)??!0)}function b7t(t){return bV(t)!==Pze.hide}function w7t(t,e){if(!t||e==null||isNaN(e))return!1;const i=g7t(t),r=y7t(t),n=i!=null&&!isNaN(i)&&i>0&&e>i,s=r!=null&&!isNaN(r)&&r>0&&e{const n="uid"in i?e.indexOf(i.uid):-1,s="uid"in r?e.indexOf(r.uid):-1;return n>s?-1:n{var s;return((s=n.layer)==null?void 0:s.uid)===i}):null}function S7t(t){const e=Jce(t)?t:null,i=t==null?void 0:t.parent,r=i!=null&&"type"in i&&i.type==="map-image"?e==null?void 0:e.source:null,n="";return r&&i?{layer:i,title:n,sublayerIds:[r.mapLayerId]}:{layer:t,title:n}}function Jce(t){return t!=null&&"layer"in t&&t.layer!=null}function T7t(t){const e=$ze(t);return e!=null&&"supportsSublayerVisibility"in e?e.supportsSublayerVisibility:void 0}function E7t(t){const e=$ze(t);return e!=null&&"supportsDynamicLayers"in e?e.supportsDynamicLayers:void 0}function $ze(t){return t&&"capabilities"in t&&t.capabilities!=null&&"exportMap"in t.capabilities?t.capabilities.exportMap:void 0}function Kce(t){return e=>{e.hasOwnProperty("_delegatedEventNames")||(e._delegatedEventNames=e._delegatedEventNames?e._delegatedEventNames.slice():[]);const i=e._delegatedEventNames,r=Array.isArray(t)?t:C7t(t);i.push(...r)}}function C7t(t){return t.split(",").map(e=>e.trim())}function B$(t){return t&&typeof t.render=="function"}function A7t(t){return t&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}const Lze="esri-layer-list-panel",NR=`${Lze}__content`,$1={base:Lze,content:NR,contentLegend:`${NR}--legend`,contentString:`${NR}--string`,contentElement:`${NR}--html-element`,contentWidget:`${NR}--widget`},M7t="legends";let Kp=class extends I_(cn){constructor(e,i){super(e,i),this._legend=null,this.content=null,this.image=null,this.listItem=null,this.open=!1,this.visible=!0}initialize(){this.addHandles(_e(()=>this.content,e=>this._createLegend(e),ii))}destroy(){this._legend=et(this._legend)}get className(){const{image:e}=this,i=this._getFirstWidget();return this._get("className")||(!e&&i?i.iconClass??"":"")}set className(e){this._override("className",e)}get disabled(){var n;const{listItem:e,_legend:i,content:r}=this;return!e||!(Array.isArray(r)&&r.length>1)&&!!i&&(!((n=i.activeLayerInfos)!=null&&n.length)||!e.visibleAtCurrentScale||!e.visible)}set disabled(e){this._overrideIfSome("disabled",e)}get title(){const e=this._getFirstWidget();return this._get("title")||((e==null?void 0:e.label)??"")}set title(e){this._override("title",e)}render(){return X("div",{class:$1.base},this._renderContents())}_renderContent(e){const{_legend:i,disabled:r}=this;return!e||r?null:e==="legend"&&i?X("div",{class:this.classes($1.content,$1.contentLegend),key:i},i.render()):typeof e=="string"?X("div",{class:this.classes($1.content,$1.contentString),innerHTML:e,key:e}):B$(e)?X("div",{class:this.classes($1.content,$1.contentWidget),key:e},e.render()):e instanceof HTMLElement?X("div",{afterCreate:this._attachToNode,bind:e,class:this.classes($1.content,$1.contentElement),key:e}):null}_renderContents(){const{content:e}=this;return Array.isArray(e)?e.map(i=>this._renderContent(i)):this._renderContent(e)}_getLegendOptions(){const{listItem:e}=this;if(!e)return{};const{layer:i,view:r}=e;return i&&r?{view:r,layerInfos:[S7t(i)]}:{}}async _createLegend(e){if(!this._hasLegend(e)||this._legend)return;const{default:i}=await we(()=>Promise.resolve().then(()=>Vzt),void 0),{listItem:r}=this,n=new i(this._getLegendOptions());this._legend=n,this.notifyChange("className"),this.notifyChange("title");const s=_e(()=>{var o,l;return[r==null?void 0:r.view,r==null?void 0:r.layer,(o=r==null?void 0:r.layer)==null?void 0:o.source,(l=r==null?void 0:r.layer)==null?void 0:l.parent]},()=>this._updateLegend(n),ii);this.addHandles(s,M7t),this.scheduleRender()}_hasLegend(e){const i="legend";return e===i||e!=null&&!!Array.isArray(e)&&e.includes(i)}_attachToNode(e){e.appendChild(this)}_updateLegend(e){e.set(this._getLegendOptions()),this.scheduleRender()}_getWidget(e){return e==="legend"?this._legend:B$(e)?e:null}_getFirstWidget(){const{content:e}=this;if(Array.isArray(e)){let i=null;return e.some(r=>{const n=this._getWidget(r);return n&&(i=n),!!n}),i}return this._getWidget(e)}};y([w()],Kp.prototype,"_legend",void 0),y([w()],Kp.prototype,"className",null),y([w()],Kp.prototype,"content",void 0),y([w()],Kp.prototype,"disabled",null),y([w()],Kp.prototype,"image",void 0),y([w()],Kp.prototype,"listItem",void 0),y([w()],Kp.prototype,"title",null),y([w()],Kp.prototype,"open",void 0),y([w()],Kp.prototype,"visible",void 0),Kp=y([Z("esri.widgets.LayerList.ListItemPanel")],Kp);const Dze=Kp;var OI;const O7t=it.ofType({key:"type",defaultKeyValue:"button",base:lP,typeMap:{button:cP,toggle:LB,slider:m7t}}),Nze=it.ofType(O7t),L8="layer",rX="child-list-mode",P7t="hide",R7t="esri.widgets.LayerList.ListItem";let ks=OI=class extends I_(ze){constructor(t){super(t),this.actionsSections=new Nze,this.actionsOpen=!1,this.checkPublishStatusEnabled=!1,this.children=new(it.ofType(OI)),this.childrenSortable=!0,this.hidden=!1,this.layer=null,this.layerView=null,this.listItemCreatedFunction=null,this.open=!1,this.panel=null,this.parent=null,this.sortable=!0,this.view=null}initialize(){if(this.addHandles([_e(()=>this.layer,t=>this._watchLayerProperties(t),ii),_e(()=>this.checkPublishStatusEnabled,t=>this._updateChildrenPublishing(t),ii),_e(()=>this.view,t=>this._updateChildrenView(t),ii),_e(()=>this.panel,t=>this._setListItemOnPanel(t),ii),_e(()=>[this.layer,this.view],()=>this._getLayerView(),ii)]),typeof this.listItemCreatedFunction=="function"){const t={item:this};this.listItemCreatedFunction.call(null,t)}}destroy(){this.view=null}get connectionStatus(){const{layerView:t,publishing:e}=this;if(!e&&t&&"connectionStatus"in t)return t.connectionStatus}get error(){var t;return(t=this.layer)==null?void 0:t.loadError}get incompatible(){const{layerView:t}=this;return!(!t||!("spatialReferenceSupported"in t))&&!t.spatialReferenceSupported}castPanel(t){var e;return(e=this.panel)!=null&&e.open&&!t.hasOwnProperty("open")&&(t.open=!0),t?new Dze(t):null}get title(){const t=au(this,"layer.layer");return(!t||t&&au(this,"layer.layer.loaded"))&&au(this,"layer.title")||au(this,"layer.attributes.title")||""}set title(t){this._override("title",t)}get publishing(){var i;const{layer:t,checkPublishStatusEnabled:e}=this;return e&&t&&"publishingInfo"in t&&((i=t.publishingInfo)==null?void 0:i.status)==="publishing"}get updating(){const{layerView:t,connectionStatus:e,layer:i,publishing:r}=this;return!r&&!e&&(t?t.updating:(i==null?void 0:i.loadStatus)==="loading"||!1)}get visible(){var t;return(t=this.layer)==null?void 0:t.visible}set visible(t){const e=this.layer;e&&(e.visible=t)}get visibleAtCurrentScale(){var t;return!w7t(this.layer,(t=this.view)==null?void 0:t.scale)}get visibilityMode(){return v7t(this.layer)}clone(){return new OI({actionsSections:this.actionsSections.clone(),actionsOpen:this.actionsOpen,checkPublishStatusEnabled:this.checkPublishStatusEnabled,children:this.children.clone(),layer:this.layer,listItemCreatedFunction:this.listItemCreatedFunction,open:this.open,panel:this.panel,title:this.title,view:this.view,visible:this.visible})}_setListItemOnPanel(t){t&&(t.listItem=this)}_updateChildrenPublishing(t){const e=this.children;e&&e.forEach(i=>i.checkPublishStatusEnabled=t)}_updateChildrenView(t){const e=this.children;e&&e.forEach(i=>i.view=t)}_addChildren(t){if(this.removeHandles(rX),this.children.removeAll(),!t)return;t.forEach(i=>{this.addHandles(_e(()=>i.listMode,()=>this._addChildren(t)),rX)});const e=t.filter(i=>bV(i)!==P7t);this.children.addMany(this._makeChildren(e))}_watchSublayerChanges(t){t&&this.addHandles(t.on("change",()=>{this._addChildren(t)}),L8)}_initializeChildLayers(t){this._addChildren(t),this._watchSublayerChanges(t)}_makeChildren(t){return t.map(e=>b7t(e)?new OI({layer:e,checkPublishStatusEnabled:this.checkPublishStatusEnabled,listItemCreatedFunction:this.listItemCreatedFunction,parent:this,view:this.view}):null).filter(ys).reverse()}_watchLayerProperties(t){if(this.removeHandles(L8),this.removeHandles(rX),!t)return;if(this.addHandles(_e(()=>t.listMode,()=>this._watchLayerProperties(t)),L8),bV(t)==="hide-children")return void this.children.removeAll();const e=Rze(t);e&&this.addHandles(_e(()=>t[e],i=>{t.hasOwnProperty(e)&&this._initializeChildLayers(i)},ii),L8)}async _getLayerView(){const{layer:t,view:e}=this;if(t&&e)try{const i=await e.whenLayerView(t);if(i.layer!==this.layer)return;this._set("layerView",i)}catch{}}};y([w({type:Nze})],ks.prototype,"actionsSections",void 0),y([w()],ks.prototype,"actionsOpen",void 0),y([w()],ks.prototype,"checkPublishStatusEnabled",void 0),y([w({type:it})],ks.prototype,"children",void 0),y([w()],ks.prototype,"childrenSortable",void 0),y([w({readOnly:!0})],ks.prototype,"connectionStatus",null),y([w({readOnly:!0})],ks.prototype,"error",null),y([w()],ks.prototype,"hidden",void 0),y([w({readOnly:!0})],ks.prototype,"incompatible",null),y([w()],ks.prototype,"layer",void 0),y([w({readOnly:!0})],ks.prototype,"layerView",void 0),y([w()],ks.prototype,"listItemCreatedFunction",void 0),y([w()],ks.prototype,"open",void 0),y([w({type:Dze})],ks.prototype,"panel",void 0),y([Ci("panel")],ks.prototype,"castPanel",null),y([w()],ks.prototype,"parent",void 0),y([w()],ks.prototype,"sortable",void 0),y([w()],ks.prototype,"title",null),y([w({readOnly:!0})],ks.prototype,"publishing",null),y([w({readOnly:!0})],ks.prototype,"updating",null),y([w()],ks.prototype,"view",void 0),y([w()],ks.prototype,"visible",null),y([w({readOnly:!0})],ks.prototype,"visibleAtCurrentScale",null),y([w({readOnly:!0})],ks.prototype,"visibilityMode",null),ks=OI=y([Z(R7t)],ks);const Qce=ks,T0={view:"view",viewLayers:"view-layers",mapLayers:"map-layers",layerViews:"layer-views",layerListMode:"layer-list-mode"},I7t="hide",Fze=it.ofType(Qce);let gw=class extends Dn.EventedAccessor{constructor(e){super(e),this.checkPublishStatusEnabled=!1,this.listItemCreatedFunction=null,this.operationalItems=new Fze,this.view=null}initialize(){this.addHandles([_e(()=>{var e;return[this.view,(e=this.view)==null?void 0:e.ready]},()=>this._viewHandles(),ii),_e(()=>[this.listItemCreatedFunction,this.checkPublishStatusEnabled],()=>this._recompileList())],T0.view)}destroy(){this.view=null,this.operationalItems.removeAll()}get state(){const{view:e}=this;return e!=null&&e.ready?"ready":e?"loading":"disabled"}triggerAction(e,i){e&&!e.disabled&&this.emit("trigger-action",{action:e,item:i})}moveListItem(e,i,r,n){var A,M;const s=e==null?void 0:e.layer;if(!s)return;const o=(M=(A=this.view)==null?void 0:A.map)==null?void 0:M.layers,l=i?b2e(i):o,c=r?b2e(r):o;if(!l||!c)return;const{operationalItems:f}=this,_=(i==null?void 0:i.children)||f,x=(r==null?void 0:r.children)||f,T=c.length-n;e.parent=r||null,_.includes(e)&&_.remove(e),l.includes(s)&&l.remove(s),x.includes(e)||x.add(e,T),c.includes(s)||c.add(s,T)}_createLayerViewHandles(e){this.removeHandles(T0.layerViews),this._compileList(),e&&this.addHandles(e.on("change",()=>this._compileList()),T0.layerViews)}_createMapLayerHandles(e){this.removeHandles(T0.mapLayers),this._compileList(),e&&this.addHandles(e.on("change",()=>this._compileList()),T0.mapLayers)}_createListItem(e){const{view:i,listItemCreatedFunction:r,checkPublishStatusEnabled:n}=this;return new Qce({checkPublishStatusEnabled:n,layer:e,listItemCreatedFunction:r,view:i})}_removeAllItems(){this.operationalItems.removeAll()}_getViewableLayers(e){if(e)return e.filter(i=>bV(i)!==I7t)}_watchLayersListMode(e){this.removeHandles(T0.layerListMode),e&&e.forEach(i=>{"listMode"in i&&this.addHandles(_e(()=>i.listMode,()=>this._compileList()),T0.layerListMode)})}_compileList(){var r,n;const e=(n=(r=this.view)==null?void 0:r.map)==null?void 0:n.layers;this._watchLayersListMode(e);const i=this._getViewableLayers(e);i!=null&&i.length?(this._createNewItems(i),this._removeItems(i),this._sortItems(i)):this._removeAllItems()}_createNewItems(e){const{operationalItems:i}=this;e.forEach(r=>{i.find(n=>n.layer===r)||i.add(this._createListItem(r))})}_removeItems(e){const{operationalItems:i}=this,r=[];i.forEach(n=>{n&&e&&e.includes(n.layer)||r.push(n)}),i.removeMany(r)}_sortItems(e){const{operationalItems:i}=this;i.sort((r,n)=>{const s=e.indexOf(r.layer),o=e.indexOf(n.layer);return s>o?-1:s{var i,r;return(r=(i=this.view)==null?void 0:i.map)==null?void 0:r.allLayers},i=>this._createMapLayerHandles(i),ii),_e(()=>{var i;return(i=this.view)==null?void 0:i.allLayerViews},i=>this._createLayerViewHandles(i),ii)],T0.viewLayers)}};y([w()],gw.prototype,"checkPublishStatusEnabled",void 0),y([w()],gw.prototype,"listItemCreatedFunction",void 0),y([w({type:Fze})],gw.prototype,"operationalItems",void 0),y([w({readOnly:!0})],gw.prototype,"state",null),y([w()],gw.prototype,"view",void 0),gw=y([Z("esri.widgets.LayerList.LayerListViewModel")],gw);const kze=gw;/**! + * Sortable 1.15.1 + * @author RubaXa + * @author owenm + * @license MIT + */function w2e(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function Qy(t){for(var e=1;e=0)&&(i[n]=t[n]);return i}function D7t(t,e){if(t==null)return{};var i=L7t(t,e),r,n;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}var N7t="1.15.1";function o_(t){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(t)}var Z_=o_(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),y6=o_(/Edge/i),x2e=o_(/firefox/i),j$=o_(/safari/i)&&!o_(/chrome/i)&&!o_(/android/i),zze=o_(/iP(ad|od|hone)/i),Uze=o_(/chrome/i)&&o_(/android/i),Vze={capture:!1,passive:!1};function Hn(t,e,i){t.addEventListener(e,i,!Z_&&Vze)}function On(t,e,i){t.removeEventListener(e,i,!Z_&&Vze)}function wV(t,e){if(e){if(e[0]===">"&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch{return!1}return!1}}function F7t(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function ny(t,e,i,r){if(t){i=i||document;do{if(e!=null&&(e[0]===">"?t.parentNode===i&&wV(t,e):wV(t,e))||r&&t===i)return t;if(t===i)break}while(t=F7t(t))}return null}var S2e=/\s+/g;function Nd(t,e,i){if(t&&e)if(t.classList)t.classList[i?"add":"remove"](e);else{var r=(" "+t.className+" ").replace(S2e," ").replace(" "+e+" "," ");t.className=(r+(i?" "+e:"")).replace(S2e," ")}}function Ii(t,e,i){var r=t&&t.style;if(r){if(i===void 0)return document.defaultView&&document.defaultView.getComputedStyle?i=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(i=t.currentStyle),e===void 0?i:i[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=i+(typeof i=="string"?"":"px")}}function MO(t,e){var i="";if(typeof t=="string")i=t;else do{var r=Ii(t,"transform");r&&r!=="none"&&(i=r+" "+i)}while(!e&&(t=t.parentNode));var n=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return n&&new n(i)}function Bze(t,e,i){if(t){var r=t.getElementsByTagName(e),n=0,s=r.length;if(i)for(;n=s:o=n<=s,!o)return r;if(r===Dy())break;r=d2(r,!1)}return!1}function F5(t,e,i,r){for(var n=0,s=0,o=t.children;s2&&arguments[2]!==void 0?arguments[2]:{},n=r.evt,s=D7t(r,H7t);v6.pluginEvent.bind(tr)(e,i,Qy({dragEl:Ot,parentEl:sa,ghostEl:wr,rootEl:Lo,nextEl:cS,lastDownEl:Ck,cloneEl:Yo,cloneHidden:Yw,dragStarted:PI,putSortable:uc,activeSortable:tr.active,originalEvent:n,oldIndex:HM,oldDraggableIndex:H$,newIndex:Hd,newDraggableIndex:kw,hideGhostForTarget:Zze,unhideGhostForTarget:Jze,cloneNowHidden:function(){Yw=!0},cloneNowShown:function(){Yw=!1},dispatchSortableEvent:function(l){Ru({sortable:i,name:l,originalEvent:n})}},s))};function Ru(t){G7t(Qy({putSortable:uc,cloneEl:Yo,targetEl:Ot,rootEl:Lo,oldIndex:HM,oldDraggableIndex:H$,newIndex:Hd,newDraggableIndex:kw},t))}var Ot,sa,wr,Lo,cS,Ck,Yo,Yw,HM,Hd,H$,kw,D8,uc,nM=!1,xV=!1,SV=[],i3,E0,oX,aX,C2e,A2e,PI,YC,q$,W$=!1,N8=!1,Ak,zc,lX=[],are=!1,TV=[],DG=typeof document<"u",F8=zze,M2e=y6||Z_?"cssFloat":"float",q7t=DG&&!Uze&&!zze&&"draggable"in document.createElement("div"),Wze=function(){if(DG){if(Z_)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto",t.style.pointerEvents==="auto"}}(),Yze=function(e,i){var r=Ii(e),n=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),s=F5(e,0,i),o=F5(e,1,i),l=s&&Ii(s),c=o&&Ii(o),f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ha(s).width,_=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+Ha(o).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(s&&l.float&&l.float!=="none"){var x=l.float==="left"?"left":"right";return o&&(c.clear==="both"||c.clear===x)?"vertical":"horizontal"}return s&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||f>=n&&r[M2e]==="none"||o&&r[M2e]==="none"&&f+_>n)?"vertical":"horizontal"},W7t=function(e,i,r){var n=r?e.left:e.top,s=r?e.right:e.bottom,o=r?e.width:e.height,l=r?i.left:i.top,c=r?i.right:i.bottom,f=r?i.width:i.height;return n===l||s===c||n+o/2===l+f/2},Y7t=function(e,i){var r;return SV.some(function(n){var s=n[ap].options.emptyInsertThreshold;if(!(!s||eue(n))){var o=Ha(n),l=e>=o.left-s&&e<=o.right+s,c=i>=o.top-s&&i<=o.bottom+s;if(l&&c)return r=n}}),r},Xze=function(e){function i(s,o){return function(l,c,f,_){var x=l.options.group.name&&c.options.group.name&&l.options.group.name===c.options.group.name;if(s==null&&(o||x))return!0;if(s==null||s===!1)return!1;if(o&&s==="clone")return s;if(typeof s=="function")return i(s(l,c,f,_),o)(l,c,f,_);var T=(o?l:c).options.group.name;return s===!0||typeof s=="string"&&s===T||s.join&&s.indexOf(T)>-1}}var r={},n=e.group;(!n||Ek(n)!="object")&&(n={name:n}),r.name=n.name,r.checkPull=i(n.pull,!0),r.checkPut=i(n.put),r.revertClone=n.revertClone,e.group=r},Zze=function(){!Wze&&wr&&Ii(wr,"display","none")},Jze=function(){!Wze&&wr&&Ii(wr,"display","")};DG&&!Uze&&document.addEventListener("click",function(t){if(xV)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),xV=!1,!1},!0);var r3=function(e){if(Ot){e=e.touches?e.touches[0]:e;var i=Y7t(e.clientX,e.clientY);if(i){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);r.target=r.rootEl=i,r.preventDefault=void 0,r.stopPropagation=void 0,i[ap]._onDragOver(r)}}},X7t=function(e){Ot&&Ot.parentNode[ap]._isOutsideThisEl(e.target)};function tr(t,e){if(!(t&&t.nodeType&&t.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=A_({},e),t[ap]=this;var i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Yze(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,l){o.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:tr.supportPointer!==!1&&"PointerEvent"in window&&!j$,emptyInsertThreshold:5};v6.initializePlugins(this,t,i);for(var r in i)!(r in e)&&(e[r]=i[r]);Xze(e);for(var n in this)n.charAt(0)==="_"&&typeof this[n]=="function"&&(this[n]=this[n].bind(this));this.nativeDraggable=e.forceFallback?!1:q7t,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Hn(t,"pointerdown",this._onTapStart):(Hn(t,"mousedown",this._onTapStart),Hn(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(Hn(t,"dragover",this),Hn(t,"dragenter",this)),SV.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),A_(this,V7t())}tr.prototype={constructor:tr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(YC=null)},_getDirection:function(e,i){return typeof this.options.direction=="function"?this.options.direction.call(this,e,i,Ot):this.options.direction},_onTapStart:function(e){if(e.cancelable){var i=this,r=this.el,n=this.options,s=n.preventOnFilter,o=e.type,l=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,c=(l||e).target,f=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||c,_=n.filter;if(rFt(r),!Ot&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||n.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&j$&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=ny(c,n.draggable,r,!1),!(c&&c.animated)&&Ck!==c)){if(HM=lf(c),H$=lf(c,n.draggable),typeof _=="function"){if(_.call(this,e,c,this)){Ru({sortable:i,rootEl:f,name:"filter",targetEl:c,toEl:r,fromEl:r}),fh("filter",i,{evt:e}),s&&e.cancelable&&e.preventDefault();return}}else if(_&&(_=_.split(",").some(function(x){if(x=ny(f,x.trim(),r,!1),x)return Ru({sortable:i,rootEl:x,name:"filter",targetEl:c,fromEl:r,toEl:r}),fh("filter",i,{evt:e}),!0}),_)){s&&e.cancelable&&e.preventDefault();return}n.handle&&!ny(f,n.handle,r,!1)||this._prepareDragStart(e,l,c)}}},_prepareDragStart:function(e,i,r){var n=this,s=n.el,o=n.options,l=s.ownerDocument,c;if(r&&!Ot&&r.parentNode===s){var f=Ha(r);if(Lo=s,Ot=r,sa=Ot.parentNode,cS=Ot.nextSibling,Ck=r,D8=o.group,tr.dragged=Ot,i3={target:Ot,clientX:(i||e).clientX,clientY:(i||e).clientY},C2e=i3.clientX-f.left,A2e=i3.clientY-f.top,this._lastX=(i||e).clientX,this._lastY=(i||e).clientY,Ot.style["will-change"]="all",c=function(){if(fh("delayEnded",n,{evt:e}),tr.eventCanceled){n._onDrop();return}n._disableDelayedDragEvents(),!x2e&&n.nativeDraggable&&(Ot.draggable=!0),n._triggerDragStart(e,i),Ru({sortable:n,name:"choose",originalEvent:e}),Nd(Ot,o.chosenClass,!0)},o.ignore.split(",").forEach(function(_){Bze(Ot,_.trim(),cX)}),Hn(l,"dragover",r3),Hn(l,"mousemove",r3),Hn(l,"touchmove",r3),Hn(l,"mouseup",n._onDrop),Hn(l,"touchend",n._onDrop),Hn(l,"touchcancel",n._onDrop),x2e&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ot.draggable=!0),fh("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||i)&&(!this.nativeDraggable||!(y6||Z_))){if(tr.eventCanceled){this._onDrop();return}Hn(l,"mouseup",n._disableDelayedDrag),Hn(l,"touchend",n._disableDelayedDrag),Hn(l,"touchcancel",n._disableDelayedDrag),Hn(l,"mousemove",n._delayedDragTouchMoveHandler),Hn(l,"touchmove",n._delayedDragTouchMoveHandler),o.supportPointer&&Hn(l,"pointermove",n._delayedDragTouchMoveHandler),n._dragStartTimer=setTimeout(c,o.delay)}else c()}},_delayedDragTouchMoveHandler:function(e){var i=e.touches?e.touches[0]:e;Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ot&&cX(Ot),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;On(e,"mouseup",this._disableDelayedDrag),On(e,"touchend",this._disableDelayedDrag),On(e,"touchcancel",this._disableDelayedDrag),On(e,"mousemove",this._delayedDragTouchMoveHandler),On(e,"touchmove",this._delayedDragTouchMoveHandler),On(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,i){i=i||e.pointerType=="touch"&&e,!this.nativeDraggable||i?this.options.supportPointer?Hn(document,"pointermove",this._onTouchMove):i?Hn(document,"touchmove",this._onTouchMove):Hn(document,"mousemove",this._onTouchMove):(Hn(Ot,"dragend",this),Hn(Lo,"dragstart",this._onDragStart));try{document.selection?Mk(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,i){if(nM=!1,Lo&&Ot){fh("dragStarted",this,{evt:i}),this.nativeDraggable&&Hn(document,"dragover",X7t);var r=this.options;!e&&Nd(Ot,r.dragClass,!1),Nd(Ot,r.ghostClass,!0),tr.active=this,e&&this._appendGhost(),Ru({sortable:this,name:"start",originalEvent:i})}else this._nulling()},_emulateDragOver:function(){if(E0){this._lastX=E0.clientX,this._lastY=E0.clientY,Zze();for(var e=document.elementFromPoint(E0.clientX,E0.clientY),i=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(E0.clientX,E0.clientY),e!==i);)i=e;if(Ot.parentNode[ap]._isOutsideThisEl(e),i)do{if(i[ap]){var r=void 0;if(r=i[ap]._onDragOver({clientX:E0.clientX,clientY:E0.clientY,target:e,rootEl:i}),r&&!this.options.dragoverBubble)break}e=i}while(i=i.parentNode);Jze()}},_onTouchMove:function(e){if(i3){var i=this.options,r=i.fallbackTolerance,n=i.fallbackOffset,s=e.touches?e.touches[0]:e,o=wr&&MO(wr,!0),l=wr&&o&&o.a,c=wr&&o&&o.d,f=F8&&zc&&E2e(zc),_=(s.clientX-i3.clientX+n.x)/(l||1)+(f?f[0]-lX[0]:0)/(l||1),x=(s.clientY-i3.clientY+n.y)/(c||1)+(f?f[1]-lX[1]:0)/(c||1);if(!tr.active&&!nM){if(r&&Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))=0&&(Ru({rootEl:sa,name:"add",toEl:sa,fromEl:Lo,originalEvent:e}),Ru({sortable:this,name:"remove",toEl:sa,originalEvent:e}),Ru({rootEl:sa,name:"sort",toEl:sa,fromEl:Lo,originalEvent:e}),Ru({sortable:this,name:"sort",toEl:sa,originalEvent:e})),uc&&uc.save()):Hd!==HM&&Hd>=0&&(Ru({sortable:this,name:"update",toEl:sa,originalEvent:e}),Ru({sortable:this,name:"sort",toEl:sa,originalEvent:e})),tr.active&&((Hd==null||Hd===-1)&&(Hd=HM,kw=H$),Ru({sortable:this,name:"end",toEl:sa,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){fh("nulling",this),Lo=Ot=sa=wr=cS=Yo=Ck=Yw=i3=E0=PI=Hd=kw=HM=H$=YC=q$=uc=D8=tr.dragged=tr.ghost=tr.clone=tr.active=null,TV.forEach(function(e){e.checked=!0}),TV.length=oX=aX=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Ot&&(this._onDragOver(e),Z7t(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],i,r=this.el.children,n=0,s=r.length,o=this.options;nn.right+s||t.clientY>r.bottom&&t.clientX>r.left:t.clientY>n.bottom+s||t.clientX>r.right&&t.clientY>r.top}function eFt(t,e,i,r,n,s,o,l){var c=r?t.clientY:t.clientX,f=r?i.height:i.width,_=r?i.top:i.left,x=r?i.bottom:i.right,T=!1;if(!o){if(l&&Ak_+f*s/2:cx-Ak)return-q$}else if(c>_+f*(1-n)/2&&cx-f*s/2)?c>_+f/2?1:-1:0}function tFt(t){return lf(Ot)Qze(r))}const pX="root",$2e={statusIndicators:!0,errors:!1};let zs=class extends cn{constructor(e,i){super(e,i),this._sortableNodes=new Map,this._sortableMap=new Map,this._focusSortUid=null,this._tooltipReferenceMap=new Map,this.visibleItems=null,this.iconClass=vi.widgetIcon,this.icon=null,this.listItemCanGiveFunction=null,this.listItemCanReceiveFunction=null,this.messages=null,this.messagesCommon=null,this.multipleSelectionEnabled=!1,this.selectionEnabled=!1,this.selectedItems=new sFt,this.style="classic",this.viewModel=new kze,this.visibleElements={...$2e},this._onSortableSort=({to:r,from:n,item:s,newIndex:o})=>{n&&r&&(n===r?this._sortLayers(this._sortableMap.get(n.dataset.group)):this._moveLayerFromChildList({to:r,from:n,item:s,newIndex:o}))},this._sortableCanSort=(r,n)=>!(!r.el.dataset.group||!n.el.dataset.group),this._sortableCanPull=(r,n,s)=>{const{listItemCanGiveFunction:o}=this,l={selected:Ll(s),from:Ll(n.el),to:Ll(r.el)};return!this._sortableCanSort(r,n)||typeof o!="function"||o.call(null,l)},this._sortableCanPut=(r,n,s)=>{const{listItemCanReceiveFunction:o}=this,l={selected:Ll(s),from:Ll(n.el),to:Ll(r.el)};return!this._sortableCanSort(r,n)||typeof o!="function"||o.call(null,l)},this._onSortableEnd=({oldIndex:r,from:n,to:s,item:o})=>{n!==s&&n.insertBefore(o,n.children[r])}}initialize(){const e=this.operationalItems;this._setVisibleItems(e),this.addHandles([Jr(()=>this.operationalItems,"change",()=>this._itemsChanged(e)),_e(()=>this.visibleElements,()=>this._itemsChanged(e)),_e(()=>this.selectionEnabled,()=>this._toggleAllSorting(),ii)])}loadDependencies(){return Pl({icon:()=>we(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([248,245,242])),tooltip:()=>we(()=>import("./calcite-tooltip-DucKIjb_.js"),__vite__mapDeps([251,252,253,247,254,255]))})}destroy(){this._destroySortables(),this._tooltipReferenceMap.clear()}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get listItemCreatedFunction(){return this.viewModel.listItemCreatedFunction}set listItemCreatedFunction(e){this.viewModel.listItemCreatedFunction=e}get operationalItems(){return this.viewModel.operationalItems}set operationalItems(e){this.viewModel.operationalItems=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...$2e,...e}}triggerAction(e,i){return this.viewModel.triggerAction(e,i)}render(){var l;const{visibleItems:e,style:i}=this,r=(l=this.viewModel)==null?void 0:l.state,n={[vi.newUI]:i==="modern",[tt.hidden]:r==="loading",[tt.disabled]:r==="disabled"},s=this._renderItemTooltips(),o=this._renderItems();return X("div",{class:this.classes(vi.base,tt.widget,tt.panel,n)},e.length?[s,o]:this._renderNoItems())}_renderItemTooltip(e){const{_tooltipReferenceMap:i,messages:r}=this;return e?X("calcite-tooltip",{referenceElement:i.get(e.uid)},r.layerIncompatibleTooltip):null}_renderItemTooltipNodes(e){const{incompatible:i,children:r}=e;return[i?this._renderItemTooltip(e):null,...!i&&r?r.toArray().map(n=>this._renderItemTooltipNodes(n)):[]]}_renderItemTooltips(){return this.visibleItems.toArray().map(e=>this._renderItemTooltipNodes(e))??[]}_renderNoItems(){return X("div",{class:vi.noItems},this.messages.noItemsToDisplay)}_renderItems(){const{visibleItems:e,selectionEnabled:i,messages:r}=this;return X("ul",{afterCreate:this._sortNodeCreated,afterRemoved:this._sortNodeRemoved,afterUpdate:this._sortNodeCreated,"aria-label":r.widgetLabel,bind:this,class:this.classes(vi.list,vi.listRoot,vi.listIndependent),"data-group":pX,role:i?"listbox":void 0},e.map(n=>this._renderItem(n,null)).toArray())}_renderActionsMenuIcon(e,i){const{messagesCommon:r}=this,n={[vi.actionsMenuItemActive]:e.actionsOpen};return X("div",{"aria-controls":i,"aria-label":r.options,bind:this,class:this.classes(vi.actionsMenuItem,n),"data-item":e,key:"actions-menu-toggle",onclick:this._toggleActionsOpen,onkeydown:this._toggleActionsOpen,role:"button",tabIndex:0,title:r.options},X("span",{"aria-hidden":"true",class:si.handleHorizontal}))}_renderActionsMenu(e,i,r,n){const{panel:s}=e,o=s&&s.visible?this._renderPanelButton(s):null,l=r===1&&this._getSingleActionButton(i),c=l?this._renderAction({item:e,action:l,singleAction:!0}):null,f=!l&&r?this._renderActionsMenuIcon(e,n):null;return f||o||l?X("div",{class:vi.actionsMenu,key:"actions-menu"},o,c,f):null}_renderChildList(e,i){var T;const{selectionEnabled:r}=this,{visibilityMode:n,children:s}=e,o=this._hasChildren(e),l=!o&&r&&((T=e.layer)==null?void 0:T.type)==="group",{exclusive:c,inherited:f}=FR,_={[vi.listEmpty]:!o,[vi.listExclusive]:n===c,[vi.listInherited]:n===f,[vi.listIndependent]:n!==f&&n!==c},x={[vi.listEmptyState]:!0,[vi.listEmptyStateDragEnabled]:r};return o||l?o?X("ul",{afterCreate:this._sortNodeCreated,afterRemoved:this._sortNodeRemoved,afterUpdate:this._sortNodeCreated,"aria-expanded":e.open?"true":"false",bind:this,class:this.classes(vi.list,_),"data-group":e.uid,"data-item":e,hidden:!e.open&&!l||null,id:i,key:"list-items",role:r?"listbox":n===c?"radiogroup":"group"},s==null?void 0:s.map(A=>this._renderItem(A,e)).toArray()):X("div",{afterCreate:this._sortNodeCreated,afterRemoved:this._sortNodeRemoved,afterUpdate:this._sortNodeCreated,bind:this,class:this.classes(x),"data-group":e.uid,"data-item":e,id:i,key:"list-items"},this.messages.noItemsToDisplay):null}_renderChildrenToggle(e,i){const{messagesCommon:r}=this,n=this._hasChildren(e),s={[vi.childToggleOpen]:e.open},o=e.open?r.collapse:r.expand;return n?X("span",{"aria-controls":i,"aria-label":o,class:this.classes(vi.childToggle,s),"data-item":e,key:"toggle-children",onclick:this._toggleChildrenClick,onkeydown:this._toggleChildrenClick,role:"button",tabIndex:0,title:o},X("span",{"aria-hidden":"true",class:this.classes(vi.childClosed,si.rightTriangleArrow)}),X("span",{"aria-hidden":"true",class:this.classes(vi.childOpened,si.downArrow)}),X("span",{"aria-hidden":"true",class:this.classes(vi.childClosed_RTL,si.leftTriangleArrow)})):null}_renderItemMessage(e){return e.error?X("div",{class:vi.message,key:"esri-layer-list__error",role:"alert"},X("span",{"aria-hidden":"true",class:si.noticeTriangle}),this.messages.layerError):e.incompatible?X("div",{class:vi.message,key:"esri-layer-list__incompatible",role:"alert"},X("span",{afterCreate:i=>this._setTooltipReference(i,e),"aria-hidden":"true",bind:this,class:si.noticeTriangle,tabIndex:0}),this.messages.layerIncompatible):null}_renderItemContent(e,i,r){const{id:n}=this,s=`${n}_${e.uid}`,o=`${s}_actions`,l=`${s}__list`,{panel:c}=e,f=this._filterActions(e.actionsSections),_=this._countActions(f);return[X("div",{class:vi.itemContainer,key:"list-item-container"},this._renderChildrenToggle(e,l),this._renderLabel(e,i,r),this._renderActionsMenu(e,f,_,o)),this._renderItemMessage(e),_?this._renderActionsSections(e,f,o):null,c&&c.open&&!c.disabled?c.render():null,this._renderChildList(e,l)]}_renderItem(e,i){var x;const{style:r,id:n,selectionEnabled:s,selectedItems:o}=this,l=`${`${n}_${e.uid}`}__title`,c=this._hasMessage(e),f=this._hasChildren(e),_={[vi.itemChildren]:f,[vi.itemMessage]:!!c,[vi.itemInvisible]:r==="modern"&&!e.visible,[vi.itemInvisibleAtScale]:!e.visibleAtCurrentScale,[vi.itemSelectable]:s};if(s){const T={[I2e]:(x=e.layer)==null?void 0:x.uid,[R2e]:(!e.sortable).toString()};return X("li",{afterCreate:this._focusListItem,afterUpdate:this._focusListItem,"aria-labelledby":l,"aria-selected":iX(e,o)?"true":"false",bind:this,class:this.classes(vi.item,_),"data-group":i?i.uid:pX,"data-item":e,key:`item-with-selection-${e.uid}`,onclick:this._toggleSelection,onkeydown:this._selectionKeydown,role:"option",tabIndex:0,...T},this._renderItemContent(e,i,l))}return X("li",{afterCreate:this._focusListItem,afterUpdate:this._focusListItem,"aria-labelledby":l,bind:this,class:this.classes(vi.item,_),key:`item-no-selection-${e.uid}`},this._renderItemContent(e,i,l))}_renderConnectionIcon(e){const{connectionStatus:i}=e;return i!=null?X("calcite-icon",{icon:i==="connected"?"beacon":"offline",scale:"s"}):null}_renderItemStatus(e,i){const{visibleElements:r}=this;if(!r.statusIndicators)return null;const{connectionStatus:n,publishing:s,updating:o}=e,l=o&&!i,c=!!n;return X("span",{class:this.classes({[vi.statusIndicator]:!0,[vi.publishing]:s,[vi.updating]:l,[vi.connectionStatus]:c,[vi.connectionStatusConnected]:c&&n==="connected"}),key:"layer-item-status"},this._renderConnectionIcon(e))}_renderItemTitle(e,i){const{messages:r}=this;if(!e)return null;const n=e.title||r.untitledLayer,s=e.visibleAtCurrentScale?n:`${n} (${r.layerInvisibleAtScale})`;return X("span",{"aria-label":s,class:vi.title,id:i,key:"layer-title-container",title:s},n)}_renderItemToggleIcon({visible:e},i){const{style:r}=this,{exclusive:n}=FR,s=i==null?void 0:i.visibilityMode,o=r==="modern",l=s===n,c={[vi.toggleVisibleIcon]:o,[vi.toggleIcon]:o&&!l,[vi.radioIcon]:o&&l,[si.radioChecked]:l&&e,[si.radioUnchecked]:l&&!e,[si.visible]:!l&&e,[si.nonVisible]:!l&&!e};return X("span",{"aria-hidden":"true",class:this.classes(c),key:"item-toggle-icon"})}_renderItemToggle(e,i,r){const{selectionEnabled:n,messages:s}=this,{exclusive:o}=FR,l=i==null?void 0:i.visibilityMode,c=l===o?"radio":"switch";return X("span",n?{"aria-checked":e.visible?"true":"false","aria-labelledby":r,bind:this,class:vi.toggleVisible,"data-item":e,"data-parent-visibility":l,key:"item-toggle-selection-enabled",onclick:this._toggleVisibility,onkeydown:this._toggleVisibility,role:c,tabIndex:0,title:s.layerVisibility}:{class:vi.toggleVisible,key:"item-toggle"},this._renderItemToggleIcon(e,i))}_renderLabel(e,i,r){const{selectionEnabled:n,style:s,messages:o}=this,{inherited:l,exclusive:c}=FR,f=i==null?void 0:i.visibilityMode,_=f===c?"radio":"switch",x=this._renderItemTitle(e,r),T=this._renderItemStatus(e,i),A=this._renderItemToggle(e,i,r),M=s==="modern"?[x,T,A]:[A,x,T],I=X("div",n?{class:vi.label,key:`item-label-no-selection-${e.uid}`}:{"aria-checked":e.visible?"true":"false","aria-labelledby":r,bind:this,class:vi.label,"data-item":e,"data-parent-visibility":f,key:`item-label-with-selection-${e.uid}`,onclick:this._toggleVisibility,onkeydown:this._toggleVisibility,role:_,tabIndex:0,title:o.layerVisibility},M);return f===l||e.error?X("div",{class:vi.label,key:`item-label-container-${e.uid}`},this._renderItemTitle(e,r),this._renderItemStatus(e,i)):I}_renderPanelButton(e){const{className:i,open:r,title:n,image:s,disabled:o}=e,l=s||i?i:si.defaultAction,c=this._getIconImageStyles(e),f={[vi.actionsMenuItemActive]:r&&!o},_={[vi.actionImage]:!!c["background-image"],[tt.disabledElement]:e.disabled};return l&&(_[l]=!!l),X("div",{"aria-disabled":e.disabled.toString(),"aria-label":n,bind:this,class:this.classes(vi.actionsMenuItem,f),"data-panel":e,key:`panel-${e.uid}`,onclick:this._triggerPanel,onkeydown:this._triggerPanel,role:"button",tabIndex:e.disabled?void 0:0,title:n},X("span",{class:this.classes(_),styles:c}))}_renderActionsSections(e,i,r){const n=i.toArray().map((s,o)=>X("ul",{class:vi.actionsList,key:`${e}-action-section-${o}`},this._renderActionSection(e,s)));return X("div",{"aria-expanded":e.actionsOpen?"true":"false",class:vi.actions,hidden:!e.actionsOpen||null,id:r,key:"actions-section",role:"group"},n)}_renderActionSection(e,i){return(i&&i.toArray()).map(r=>this._renderAction({item:e,action:r}))}_renderActionIcon(e){const{active:i,className:r}=e,n=this._getIconImageStyles(e),s=e.type!=="button"||e.image||r?r:si.defaultAction,o={[vi.actionImage]:!i&&!!n["background-image"],[si.loadingIndicator]:i,[tt.rotating]:i};return s&&!i&&(o[s]=!0),X("span",{"aria-hidden":"true",class:this.classes(vi.actionIcon,o),key:"action-icon",styles:n})}_renderActionTitle(e,i){return i?null:X("span",{class:vi.actionTitle,key:"action-title"},e)}_renderAction(e){const{item:i,action:r,singleAction:n}=e,{active:s,disabled:o,title:l}=r,c={[vi.actionsMenuItem]:n&&r.type==="button",[vi.action]:s||!n&&r.type!=="toggle",[vi.actionToggle]:!s&&r.type==="toggle",[vi.actionToggleOn]:!s&&r.type==="toggle"&&r.value,[tt.disabledElement]:o},f=[this._renderActionIcon(r),this._renderActionTitle(l,n)];return n?X("div",{"aria-label":l??void 0,bind:this,classes:c,"data-action":r,"data-item":i,key:`single-action-${r.uid}`,onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:0,title:l??void 0},f):X("li",{"aria-label":l??void 0,bind:this,classes:c,"data-action":r,"data-item":i,key:`action-${r.uid}`,onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:0,title:l??void 0},f)}_setTooltipReference(e,i){this._tooltipReferenceMap.set(i.uid,e),this.scheduleRender()}_hasMessage(e){return!!e.error||e.incompatible}_hasChildren(e){return!!e.children.length&&!this._hasMessage(e)}_sortNodeRemoved(e){const{_sortableMap:i}=this,r=e.dataset.group,n=i.get(r);n&&n.destroy(),i.delete(r)}_destroySortables(){const{_sortableMap:e,_sortableNodes:i}=this;e.forEach(r=>r&&r.destroy()),e.clear(),i.clear()}_moveLayerFromChildList({to:e,from:i,item:r,newIndex:n}){const s=Ll(r),o=Ll(e),l=Ll(i);this.viewModel.moveListItem(s,l,o,n)}_sortLayers(e){var n,s;if(!e)return;const i=Ll(e.el),r=e.toArray();i?x7t(i,r):Ize((s=(n=this.view)==null?void 0:n.map)==null?void 0:s.layers,r)}_toggleSorting(e,i){const{_sortableMap:r,selectionEnabled:n}=this,s=r.get(i),o=Ll(e),l=(i===pX||(o==null?void 0:o.childrenSortable)&&_7t(o))&&n;if(s)s.option("disabled",!l);else if(l){const c=tr.create(e,{dataIdAttr:I2e,group:{name:i,pull:this._sortableCanPull,put:this._sortableCanPut},filter:`[${R2e}="true"]`,fallbackTolerance:4,onSort:this._onSortableSort,onEnd:this._onSortableEnd,disabled:!l,chosenClass:vi.sortableChosen});r.set(i,c)}}_toggleAllSorting(){this._sortableNodes.forEach((e,i)=>this._toggleSorting(e,i))}_sortNodeCreated(e){const i=e.dataset.group;i&&(this._sortableNodes.set(i,e),this._toggleSorting(e,i))}_setVisibleItems(e){this.visibleItems=e.filter(i=>!i.hidden&&(this.visibleElements.errors||!i.error))}_getSingleActionButton(e){return e.reduce(i=>i).filter(i=>i&&i.type==="button").at(0)}_focusListItem(e){var n;const{_focusSortUid:i}=this;if(!e||!i)return;const r=Ll(e);((n=r==null?void 0:r.layer)==null?void 0:n.uid)===i&&(e.focus(),this._focusSortUid=null)}_watchActionSectionChanges(e){this.addHandles(e.on("change",this.scheduleRender.bind(this)),Lb.actionSection),e.forEach(i=>this._renderOnActionChanges(i))}_renderOnActionChanges(e){e.type!=="toggle"?e.type!=="slider"?this.addHandles(_e(()=>[e==null?void 0:e.className,e==null?void 0:e.image,e==null?void 0:e.id,e==null?void 0:e.title,e==null?void 0:e.visible],()=>this.scheduleRender(),ii),Lb.actions):this.addHandles(_e(()=>[e==null?void 0:e.className,e==null?void 0:e.id,e==null?void 0:e.title,e==null?void 0:e.visible,e==null?void 0:e.value,e==null?void 0:e.displayValueEnabled,e==null?void 0:e.max,e==null?void 0:e.min,e==null?void 0:e.step],()=>this.scheduleRender(),ii),Lb.actions):this.addHandles(_e(()=>[e==null?void 0:e.className,e==null?void 0:e.image,e==null?void 0:e.id,e==null?void 0:e.title,e==null?void 0:e.visible,e==null?void 0:e.value],()=>this.scheduleRender(),ii),Lb.actions)}_renderOnItemChanges(e){this.addHandles([_e(()=>{var i,r,n;return[e==null?void 0:e.actionsOpen,e==null?void 0:e.visible,e==null?void 0:e.open,e==null?void 0:e.updating,e==null?void 0:e.connectionStatus,e==null?void 0:e.publishing,e==null?void 0:e.title,e==null?void 0:e.visibleAtCurrentScale,e==null?void 0:e.error,e==null?void 0:e.visibilityMode,e==null?void 0:e.panel,(i=e==null?void 0:e.panel)==null?void 0:i.title,(r=e==null?void 0:e.panel)==null?void 0:r.content,(n=e==null?void 0:e.panel)==null?void 0:n.className,e==null?void 0:e.sortable,e==null?void 0:e.childrenSortable]},()=>this.scheduleRender(),kt),_e(()=>[e==null?void 0:e.hidden,e==null?void 0:e.error],()=>this._setVisibleItems(this.operationalItems)),e.actionsSections.on("change",()=>this.scheduleRender()),e.children.on("change",()=>this.scheduleRender())],Lb.items),e.children.forEach(i=>this._renderOnItemChanges(i)),e.actionsSections.forEach(i=>this._watchActionSectionChanges(i))}_itemsChanged(e){this.removeHandles(Lb.items),this.removeHandles(Lb.actions),this.removeHandles(Lb.actionSection),e.forEach(i=>this._renderOnItemChanges(i)),this._tooltipReferenceMap.clear(),this._setVisibleItems(e),this.scheduleRender()}_filterActions(e){return e.map(i=>i.filter(r=>r.visible))}_countActions(e){return e.reduce((i,r)=>i+r.length,0)}_getIconImageStyles(e){const i=e.declaredClass==="esri.widgets.LayerList.ListItemPanel"||e.declaredClass==="esri.support.Action.ActionButton"||e.declaredClass==="esri.support.Action.ActionToggle"?e.image:null;return{"background-image":i?`url("${i}")`:void 0}}_selectionKeydown(e){var M,I,L,F;const i=["ArrowDown","ArrowUp"],r=Sf(e);if(!i.includes(r))return void this._toggleSelection(e);e.stopPropagation();const n=e.currentTarget,s=Ll(n),{_sortableMap:o,selectedItems:l}=this,c=n.dataset.group,f=o.get(c);if(!f||!s)return;const _=iX(s,l),x=f.toArray(),T=e.target,A=x.indexOf(T.dataset[oFt]);if(A!==-1){if(r==="ArrowDown"){const z=A+1;if(z>=x.length)return;_?(P2e(x,A,z),f.sort(x),this._sortLayers(f),this._focusSortUid=(M=s.layer)==null?void 0:M.uid):(this._focusSortUid=(I=s.layer)==null?void 0:I.uid,this.scheduleRender())}if(r==="ArrowUp"){const z=A-1;if(z<=-1)return;_?(P2e(x,A,z),f.sort(x),this._sortLayers(f),this._focusSortUid=(L=s.layer)==null?void 0:L.uid):(this._focusSortUid=(F=s.layer)==null?void 0:F.uid,this.scheduleRender())}}}_toggleActionsOpen(e){const i=Ll(e.currentTarget);if(!i)return;const{actionsOpen:r}=i,n=!r;n&&this.operationalItems.forEach(s=>Qze(s)),i.actionsOpen=n,e.stopPropagation()}_triggerPanel(e){const i=aFt(e.currentTarget);e.stopPropagation(),i&&!i.disabled&&(i.open=!i.open)}_triggerAction(e){const i=e.currentTarget,r=lFt(i),n=Ll(i);r&&n&&(r.type==="toggle"&&(r.value=!r.value),this.triggerAction(r,n),e.stopPropagation())}_toggleVisibility(e){const i=e.currentTarget,r=i.getAttribute("data-parent-visibility"),n=Ll(i);n&&(r===FR.exclusive&&n.visible||(n.visible=!n.visible),e.stopPropagation())}_toggleChildrenClick(e){const i=Ll(e.currentTarget);i&&(i.open=!i.open,e.stopPropagation())}_toggleSelection(e){var l,c;e.stopPropagation();const{multipleSelectionEnabled:i,selectedItems:r}=this,n=Ll(e.currentTarget);if(!n)return;const s=iX(n,r),{length:o}=r;if(!i)return o&&!(s&&o===1)?(r.removeAll(),void r.add(n)):void(s?(l=r.remove)==null?void 0:l.call(r,s):r.add(n));s?(c=r.remove)==null||c.call(r,s):r.add(n)}get test(){return{visibleItems:this.visibleItems}}};function Ll(t){return t==null?void 0:t["data-item"]}function aFt(t){return t==null?void 0:t["data-panel"]}function lFt(t){return t==null?void 0:t["data-action"]}y([w()],zs.prototype,"visibleItems",void 0),y([w()],zs.prototype,"iconClass",void 0),y([w()],zs.prototype,"icon",void 0),y([w()],zs.prototype,"label",null),y([w()],zs.prototype,"listItemCanGiveFunction",void 0),y([w()],zs.prototype,"listItemCanReceiveFunction",void 0),y([w()],zs.prototype,"listItemCreatedFunction",null),y([w(),Gr("esri/widgets/LayerList/t9n/LayerList")],zs.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],zs.prototype,"messagesCommon",void 0),y([w()],zs.prototype,"multipleSelectionEnabled",void 0),y([w()],zs.prototype,"operationalItems",null),y([w()],zs.prototype,"selectionEnabled",void 0),y([w()],zs.prototype,"selectedItems",void 0),y([w()],zs.prototype,"style",void 0),y([w()],zs.prototype,"view",null),y([Kce("trigger-action"),w({type:kze})],zs.prototype,"viewModel",void 0),y([w()],zs.prototype,"visibleElements",void 0),y([Ci("visibleElements")],zs.prototype,"castVisibleElements",null),y([bo()],zs.prototype,"_toggleActionsOpen",null),y([bo()],zs.prototype,"_triggerPanel",null),y([bo()],zs.prototype,"_triggerAction",null),y([bo()],zs.prototype,"_toggleVisibility",null),y([bo()],zs.prototype,"_toggleChildrenClick",null),y([bo()],zs.prototype,"_toggleSelection",null),zs=y([Z("esri.widgets.LayerList")],zs);const eUe=zs;let yw=class extends ze{constructor(e){super(e),this._viewpointHandle=null,this.group=null}initialize(){this.addHandles(Jr(()=>{var e;return(e=this.view)==null?void 0:e.ui},"expand",e=>{const{target:i}=e;i&&i!==this&&i.expanded&&i.group&&i.group===this.group&&this._collapse()}))}destroy(){this._viewpointHandle=null,this.view=null}set autoCollapse(e){this._set("autoCollapse",e),this._watchViewpoint()}set expanded(e){var n;const i=!!e;this._set("expanded",i);const r=(n=this.view)==null?void 0:n.ui;r&&r.emit("expand",{target:this}),this._viewpointHandleChange(i)}get state(){var e;return(e=this.view)!=null&&e.ready?"ready":"disabled"}set view(e){this._get("view")!==e&&(this._set("view",e),e&&Mo(()=>e.ready,()=>{this.view===e&&this._watchViewpoint()},{once:!0,initial:!0}))}_viewpointHandleChange(e){this._viewpointHandle&&(e?Mo(()=>{var i;return(i=this.view)==null?void 0:i.stationary},()=>{var i;return(i=this._viewpointHandle)==null?void 0:i.resume()},{once:!0,initial:!0}):this._viewpointHandle.pause())}_watchViewpoint(){const e="viewpoint";this.removeHandles(e),this._viewpointHandle=null;const{autoCollapse:i,view:r}=this;if(!r||!i)return;const n=LHe(()=>r.type==="3d"?r.camera:r.viewpoint,()=>this._collapse());this.addHandles(n,e),this._viewpointHandle=n}_collapse(){this.expanded=!1}};y([w({value:!1})],yw.prototype,"autoCollapse",null),y([w({value:!1})],yw.prototype,"expanded",null),y([w()],yw.prototype,"group",void 0),y([w({readOnly:!0})],yw.prototype,"state",null),y([w({value:null})],yw.prototype,"view",null),yw=y([Z("esri.widgets.Expand.ExpandViewModel")],yw);const tUe=yw,mh="esri-expand",Uc={base:mh,modeAuto:`${mh}--auto`,modeDrawer:`${mh}--drawer`,modeFloating:`${mh}--floating`,container:`${mh}__container`,containerExpanded:`${mh}__container--expanded`,panel:`${mh}__panel`,icon:"esri-collapse__icon",iconExpanded:`${mh}__icon--expanded`,iconNumber:`${mh}__icon-number`,iconNumberExpanded:`${mh}__icon-number--expanded`,content:`${mh}__content`,contentExpanded:`${mh}__content--expanded`,expandMask:`${mh}__mask`,expandMaskExpanded:`${mh}__mask--expanded`};let ho=class extends cn{constructor(e,i){super(e,i),this.closeOnEsc=!0,this.collapseIcon=null,this.collapseTooltip="",this.content="",this.expandTooltip="",this.iconClass=null,this.icon=null,this.iconNumber=0,this.messages=null,this.messagesCommon=null,this.mode="auto",this.viewModel=new tUe,this._handleKeyDown=r=>{const{closeOnEsc:n,_toggleButtonEl:s,expanded:o}=this;!o||!n||r.target===s||r.key!=="Escape"||(typeof n=="function"?n(r):n)&&(this.expanded=!1,s==null||s.focus())}}loadDependencies(){return Pl({icon:()=>we(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([248,245,242]))})}get contentId(){return`${this.id}_controls_content`}get expandTitle(){const{expanded:e,messagesCommon:i,collapseTooltip:r,expandTooltip:n}=this;return(e?r||(i==null?void 0:i.collapse):n||(i==null?void 0:i.expand))??""}get autoCollapse(){return this.viewModel.autoCollapse}set autoCollapse(e){this.viewModel.autoCollapse=e}get collapseIconClass(){return si.collapse}set collapseIconClass(e){this._overrideIfSome("collapseIconClass",e)}get expanded(){return this.viewModel.expanded}set expanded(e){this.viewModel.expanded=e}get expandIconClass(){return B$(this.content)?this.content.iconClass:si.expand}set expandIconClass(e){this._overrideIfSome("expandIconClass",e)}get expandIcon(){return B$(this.content)?this.content.icon:void 0}set expandIcon(e){this._overrideIfSome("expandIcon",e)}get group(){return this.viewModel.group}set group(e){this.viewModel.group=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}expand(){this.viewModel.expanded=!0}collapse(){this.viewModel.expanded=!1}toggle(){this.viewModel.expanded=!this.viewModel.expanded}render(){const{mode:e}=this,i={[Uc.modeAuto]:e==="auto",[Uc.modeDrawer]:e==="drawer",[Uc.modeFloating]:e==="floating"};return X("div",{class:this.classes(Uc.base,tt.widget,i),onkeydown:this._handleKeyDown},this._renderMask(),this._renderContainer())}_renderContainer(){const{expanded:e}=this,i={[Uc.containerExpanded]:e};return X("div",{class:this.classes(Uc.container,i)},this._renderPanel(),this._renderContent())}_renderMask(){const{expanded:e}=this,i={[Uc.expandMaskExpanded]:e};return X("div",{bind:this,class:this.classes(Uc.expandMask,i),onclick:this._toggle})}_renderBadgeNumber(){const{expanded:e,iconNumber:i}=this;return i&&!e?X("span",{class:Uc.iconNumber,key:"expand__icon-number"},i):null}_renderPanelNumber(){const{iconNumber:e,expanded:i}=this;return e&&i?X("span",{class:this.classes(Uc.iconNumber,Uc.iconNumberExpanded),key:"expand__expand-icon-number"},e):null}_renderIcon(){const e=(this.expanded?this.collapseIcon:this.expandIcon)??"";return X("calcite-icon",{icon:e,key:"icon",scale:"s"})}_renderLegacyIcon(){const{collapseIconClass:e,expandIconClass:i,expanded:r}=this,n={[Uc.iconExpanded]:r};return i!=null&&(n[i]=!r),e!=null&&(n[e]=e===i||r),X("span",{"aria-hidden":"true",class:this.classes(Uc.icon,n),key:"legacy-icon"})}_renderTitle(){return X("span",{class:si.fontFallbackText},this.expandTitle)}_renderExpandButton(){const{expanded:e,expandTitle:i,expandIcon:r,collapseIcon:n,contentId:s}=this;return X("div",{afterCreate:this._storeToggleButtonEl,"aria-controls":s,"aria-expanded":e?"true":"false",bind:this,class:tt.widgetButton,onclick:this._toggle,onkeydown:this._toggle,role:"button",tabIndex:0,title:i},this._renderBadgeNumber(),!e&&r!=null||e&&n!=null?this._renderIcon():this._renderLegacyIcon(),this._renderTitle())}_renderPanel(){return X("div",{class:Uc.panel},this._renderExpandButton(),this._renderPanelNumber())}_renderContent(){const{expanded:e,contentId:i,content:r}=this,n={[Uc.contentExpanded]:e},s={id:i,role:"region",class:this.classes(Uc.content,n)};return typeof r=="string"?X("div",{innerHTML:r,key:"content__string",...s}):B$(r)?X("div",{key:"content__widget",...s},r.render()):r instanceof HTMLElement?X("div",{afterCreate:this._attachToNode,bind:r,key:"content__html-element",...s}):A7t(r)?X("div",{afterCreate:this._attachToNode,bind:r.domNode,key:"content__node",...s}):null}_toggle(){this.toggle()}_attachToNode(e){const i=this;e.appendChild(i)}_storeToggleButtonEl(e){this._toggleButtonEl=e}};y([w({readOnly:!0})],ho.prototype,"contentId",null),y([w({readOnly:!0})],ho.prototype,"expandTitle",null),y([w()],ho.prototype,"autoCollapse",null),y([w()],ho.prototype,"closeOnEsc",void 0),y([w()],ho.prototype,"collapseIconClass",null),y([w()],ho.prototype,"collapseIcon",void 0),y([w()],ho.prototype,"collapseTooltip",void 0),y([w()],ho.prototype,"content",void 0),y([w()],ho.prototype,"expanded",null),y([w()],ho.prototype,"expandIconClass",null),y([w()],ho.prototype,"expandIcon",null),y([w()],ho.prototype,"expandTooltip",void 0),y([w()],ho.prototype,"group",null),y([w()],ho.prototype,"iconClass",void 0),y([w()],ho.prototype,"icon",void 0),y([w()],ho.prototype,"iconNumber",void 0),y([w()],ho.prototype,"label",null),y([w(),Gr("esri/widgets/Expand/t9n/Expand")],ho.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],ho.prototype,"messagesCommon",void 0),y([w()],ho.prototype,"mode",void 0),y([w()],ho.prototype,"view",null),y([w({type:tUe})],ho.prototype,"viewModel",void 0),y([bo()],ho.prototype,"_toggle",null),ho=y([Z("esri.widgets.Expand")],ho);async function cFt(t,e={}){const{basemap:i,view:r}=t;await i.load(e),hFt(i),await pFt(i,r,e),St(e)}async function uFt(t,e={}){var o;const{basemap:i,view:r}=t;if(St(e),!r||"spatialReferenceLocked"in r&&!r.spatialReferenceLocked||(await i.load(e),St(e),i.baseLayers.length===0))return;const n=i.baseLayers.at(0);if(!oO(n))return;if(i.spatialReference){if(r.spatialReference.equals(i.spatialReference))return;L2e()}await n.load(e),St(e);const s=(("supportedSpatialReferences"in n?n.supportedSpatialReferences:null)||["tileInfo"in n?(o=n.tileInfo)==null?void 0:o.spatialReference:null]).filter(ys);s.length!==0&&s.every(l=>!r.spatialReference.equals(l))&&L2e()}function L2e(){throw new se("basemap-compatibility:incompatible-spatial-reference","Basemap spatial reference is not compatible with the view")}function hFt(t){if(t.baseLayers.length===0&&t.referenceLayers.length===0)return;const e=t.baseLayers.concat(t.referenceLayers).toArray().filter(i=>!Fnt(i)).map(i=>dFt(i));if(e.length)throw e[0]}function dFt(t){return new se("basemap-compatibility:unsupported-basemap-layer-type","Unsupported basemap layer type ${operationalLayerType}",{layer:t,operationalLayerType:t.operationalLayerType||"unknown"})}async function pFt(t,e,i){if(t.baseLayers.length===0)return;const r=t.baseLayers.at(0);if(kOe(r)){try{await r.load(i)}catch(n){const s="basemap-compatibility:unknown-error",o="Unknown basemap compatibility error",{name:l=s,message:c=o,details:f}=n;throw new se(l,c,f)}fFt(r,e)}}function fFt(t,e){var c;const i=e.state.viewingMode;if(!i)return;let r,n;if((t==null?void 0:t.type)==="wmts"){const f=J7e(t,e.spatialReference,i);if(f.tileInfo==null)throw new se("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view");r=f.tileInfo,n=f.fullExtent}else r=t.tileInfo,n=t.fullExtent;if(r==null)return;if(!p5(r.spatialReference,i))throw new se(`basemapgalleryitem:spatial-reference-unsupported-${u$(i)}`,`Basemap spatial reference is unsupported in ${u$(i)} mode`);const s=r.spatialReference.isGeographic,o=(t==null?void 0:t.type)==="vector-tile"?r.getOrCreateCompatible(256,s?1:2):null;if(i===_t.Global){let f=KL(r,n,null,i);if(f&&(t==null?void 0:t.type)==="vector-tile"&&n!=null&&o&&!KL(o,n,null,i)&&(f=null),f){const _=r.spatialReference.isWebMercator?"web-mercator":"wgs84";throw new se(`basemapgalleryitem:tiling-scheme-unsupported-${_}-global`,"Basemap tiling scheme is unsupported in global mode",{error:f})}}else if(Bu.checkUnsupported(r))throw new se("basemapgalleryitem:tiling-scheme-unsupported-local","Basemap tiling scheme is unsupported in local mode");const l=(c=e.basemapTerrain)==null?void 0:c.tilingScheme;if(l&&!l.compatibleWith(r)&&((t==null?void 0:t.type)!=="vector-tile"||!o||!l.compatibleWith(o)))throw new se("basemapgalleryitem:tiling-scheme-incompatible","Basemap tiling scheme is incompatible with the view")}let Vg=class extends I_(ze){constructor(e){super(e),this.compatibilityFunction=null,this.error=null,this.state="loading",this.view=null}initialize(){const e=()=>this.refresh();this.addHandles([_e(()=>{var i;return(i=this.basemap)==null?void 0:i.loadStatus},e),_e(()=>this.compatibilityFunction,e),_e(()=>{var i;return this.view&&"basemapTerrain"in this.view&&((i=this.view.basemapTerrain)==null?void 0:i.tilingScheme)},e),_e(()=>{var i;return(i=this.view)==null?void 0:i.ready},e),_e(()=>{var i;return(i=this.view)==null?void 0:i.spatialReference},e)]),this.refresh()}destroy(){this._cancelRefresh(),this.basemap=null,this.compatibilityFunction=null,this.view=null}get _spatialReferenceTask(){return Bdt(this.view,this.basemap)}set basemap(e){e&&e.load().catch(()=>{}),this._set("basemap",e)}get spatialReference(){return this._spatialReferenceTask.spatialReference}refresh(){var n;this._cancelRefresh(),this._set("state","loading");const e=(n=this.basemap)==null?void 0:n.loadStatus;if(e!=="loaded"&&e!=="failed")return;if(!this.compatibilityFunction)return void(e==="loaded"?(this._set("state","ready"),this._set("error",null)):(this._set("state","error"),this._set("error",this.basemap.loadError)));const i=new AbortController,{signal:r}=i;this.compatibilityFunction(this,{signal:r}).then(()=>rd(()=>!this._spatialReferenceTask.updating,r)).then(()=>{this._set("state","ready"),this._set("error",null)}).catch(s=>{sn(s)||(this._set("state","error"),this._set("error",s))}),this._refreshController=i}_cancelRefresh(){this._refreshController&&(this._refreshController.abort(),this._refreshController=null)}};y([w({readOnly:!0})],Vg.prototype,"_spatialReferenceTask",null),y([w()],Vg.prototype,"basemap",null),y([w()],Vg.prototype,"compatibilityFunction",void 0),y([w({readOnly:!0})],Vg.prototype,"error",void 0),y([w({readOnly:!0})],Vg.prototype,"spatialReference",null),y([w({readOnly:!0})],Vg.prototype,"state",void 0),y([w()],Vg.prototype,"view",void 0),Vg=y([Z("esri.widgets.BasemapGallery.support.BasemapGalleryItem")],Vg);const iUe=Vg,rUe=it.ofType(Ay);let $I=class extends ze{constructor(e){super(e),this.basemaps=new rUe}destroy(){this.basemaps.forEach(e=>e.destroy())}get state(){return"ready"}refresh(){}};y([w({type:rUe})],$I.prototype,"basemaps",void 0),y([w({readOnly:!0})],$I.prototype,"state",null),$I=y([Z("esri.widgets.BasemapGallery.support.LocalBasemapsSource")],$I);const nUe=$I,sUe=it.ofType(Ay);let Bg=class extends jf.LoadableMixin(S9(nUe)){constructor(e){super(e),this._lastPortalBasemapFetchController=null,this.basemaps=new sUe,this.filterFunction=null,this.portal=os.getDefault(),this.query=null,this.updateBasemapsCallback=null,this.viewType=null}initialize(){this.addHandles([_e(()=>{var e,i,r;return[this.filterFunction,this.loadStatus,(e=this.portal)==null?void 0:e.basemapGalleryGroupQuery,(i=this.portal)==null?void 0:i.basemapGalleryGroupQuery3D,(r=this.portal)==null?void 0:r.user,this.query,this.updateBasemapsCallback]},()=>this.refresh(),ii)])}destroy(){this.filterFunction=null,this.portal=null,this.basemaps.forEach(e=>e.destroy())}get state(){return this.loadStatus==="not-loaded"?"not-loaded":this.loadStatus==="loading"||this._lastPortalBasemapFetchController?"loading":"ready"}load(e){return this.addResolvingPromise(this.portal.load(e)),Promise.resolve(this)}async refresh(){if(this.loadStatus!=="loaded")return;this._lastPortalBasemapFetchController&&(this._lastPortalBasemapFetchController.abort(),this._lastPortalBasemapFetchController=null);const e=this.portal,i=new AbortController;this._lastPortalBasemapFetchController=i,this.notifyChange("state");try{const r=await e.fetchBasemaps(this._toQueryString(this.query),{signal:i.signal,include3d:this.viewType==="3d"||void 0});await this._updateBasemaps(r)}catch(r){if(sn(r))throw r;Ce.getLogger(this).warn(new se("basemap-source:fetch-basemaps-error","Could not fetch basemaps from portal.",{error:r})),await this._updateBasemaps()}this._lastPortalBasemapFetchController=null,this.notifyChange("state")}_toQueryString(e){return e&&typeof e!="string"?Object.keys(e).map(i=>`${i}:${e[i]}`).join(" AND "):e}async _updateBasemaps(e=[]){let i=await this._filterBasemaps(e);i=this.updateBasemapsCallback?this.updateBasemapsCallback(i):i,this.basemaps.removeAll(),this.basemaps.addMany(i)}async _filterBasemaps(e){if(!this.filterFunction)return e;const i=e.map(this.filterFunction),r=await Promise.all(i);return e.filter((n,s)=>r[s])}};y([w({readOnly:!0,type:sUe})],Bg.prototype,"basemaps",void 0),y([w()],Bg.prototype,"filterFunction",void 0),y([w({type:os})],Bg.prototype,"portal",void 0),y([w()],Bg.prototype,"query",void 0),y([w({readOnly:!0})],Bg.prototype,"state",null),y([w()],Bg.prototype,"updateBasemapsCallback",void 0),y([w()],Bg.prototype,"viewType",void 0),Bg=y([Z("esri.widgets.BasemapGallery.support.PortalBasemapsSource")],Bg);const LI=Bg,oUe=it.ofType(iUe);function mFt(t){return t&&t.declaredClass==="esri.portal.Portal"}function gFt(t){return t&&!(t instanceof LI)&&(!!t.portal||!!t.query)}function yFt(t){return t&&"basemaps"in t&&"state"in t&&"refresh"in t}let Iu=class extends jf{constructor(e){super(e),this._loadingProjectionEngine=!1,this._originalActiveBasemap=null,this.includeCurrentBasemap=!1,this.items=new oUe,this.source=new LI,this.view=null}initialize(){const e=()=>this._recreateItems();this.addHandles([_e(()=>{var i;return[this.view,(i=this.view)==null?void 0:i.ready]},()=>{var i;(i=this.view)!=null&&i.ready&&(this._originalActiveBasemap=this.activeBasemap)},{initial:!0}),_e(()=>this.state==="ready"?this.compatibilityFunction:null,()=>this._updateItems()),_e(()=>[this._effectiveIncludeCurrentBasemap,this._originalActiveBasemap],e),Jr(()=>{var i;return(i=this.source)==null?void 0:i.basemaps},"change",e,{onListenerAdd:e}),Mo(()=>this.view,()=>{var i;this.source instanceof LI&&(this.source.viewType=(i=this.view)==null?void 0:i.type)},{once:!0})])}destroy(){var i;const e=this.source.basemaps.find(r=>r===this.activeBasemap);e&&this.source.basemaps.remove(e),(i=this.source)==null||i.destroy()}get _effectiveIncludeCurrentBasemap(){var e;return this.includeCurrentBasemap&&((e=this.source)==null?void 0:e.basemaps.every(i=>i.loadStatus!=="loading"))}get activeBasemap(){var e,i;return((i=(e=this.view)==null?void 0:e.map)==null?void 0:i.basemap)??null}set activeBasemap(e){var s,o;const i=this.view;if(!(i!=null&&i.map))return;const r=typeof e=="string"?Ay.fromId(e):e;if(!r||!i.ready)return i.map.basemap=r,void this._clearOverride("activeBasemap");const n=r.spatialReference||((o=(s=this.items)==null?void 0:s.find(l=>this.basemapEquals(r,l.basemap)))==null?void 0:o.spatialReference);if(n&&"spatialReferenceLocked"in i&&!i.spatialReferenceLocked){const l=i.spatialReference;if(n!=null&&!Zn(l,n)&&!th(i.spatialReference,n)&&!ox())return this._override("activeBasemap",r),this._loadingProjectionEngine=!0,void g_().then(()=>{this._get("activeBasemap")===e&&(i.map.basemap=e,i.spatialReference=n,this._clearOverride("activeBasemap"))},()=>{}).then(()=>{this._loadingProjectionEngine=!1});i.map.basemap=r,this._clearOverride("activeBasemap"),n==null||Zn(i.spatialReference,n)||(i.spatialReference=n)}else i.map.basemap=r,this._clearOverride("activeBasemap")}get activeBasemapIndex(){const{state:e,activeBasemap:i}=this;return e!=="ready"?-1:this._findBasemapIndex(i)}get compatibilityFunction(){var e;return((e=this.view)==null?void 0:e.type)==="3d"?cFt:uFt}set compatibilityFunction(e){this._overrideIfSome("compatibilityFunction",e)}castSource(e){return Array.isArray(e)||it.isCollection(e)?new nUe({basemaps:e}):mFt(e)?new LI({portal:e}):gFt(e)?new LI(e):yFt(e)?e:null}get state(){var e;return(e=this.view)!=null&&e.ready&&this.source?this._loadingProjectionEngine?"loading":"ready":"disabled"}basemapEquals(e,i){return Udt(e,i)}refresh(){this._recreateItems()}load(e){return this.addResolvingPromise(jf.isLoadable(this.source)?this.source.load(e):null),Promise.resolve(this)}_findBasemapIndex(e){const{items:i}=this,r=i.findIndex(n=>n.basemap===e);return r===-1?i.findIndex(n=>this.basemapEquals(n.basemap,e)):r}_recreateItems(){var l;const e=(l=this.source)==null?void 0:l.basemaps,{view:i,compatibilityFunction:r}=this,n=new Map(this.items.map(c=>[c.basemap,c]));function s(c){const f=n.get(c);return f?(n.delete(c),f):new iUe({basemap:c,compatibilityFunction:r,view:i})}this.items.removeAll(),e&&this.items.addMany(e.map(s));const o=this._findBasemapIndex(this._originalActiveBasemap)!==-1;this._effectiveIncludeCurrentBasemap&&!o&&this._originalActiveBasemap!=null&&this.items.unshift(s(this._originalActiveBasemap)),n.forEach(c=>c.destroy())}_updateItems(){for(const e of this.items)e.compatibilityFunction=this.compatibilityFunction,e.view=this.view}};y([w()],Iu.prototype,"_effectiveIncludeCurrentBasemap",null),y([w()],Iu.prototype,"_loadingProjectionEngine",void 0),y([w()],Iu.prototype,"_originalActiveBasemap",void 0),y([w()],Iu.prototype,"activeBasemap",null),y([w({readOnly:!0})],Iu.prototype,"activeBasemapIndex",null),y([w()],Iu.prototype,"compatibilityFunction",null),y([w()],Iu.prototype,"includeCurrentBasemap",void 0),y([w({readOnly:!0,type:oUe})],Iu.prototype,"items",void 0),y([w()],Iu.prototype,"source",void 0),y([Ci("source")],Iu.prototype,"castSource",null),y([w({readOnly:!0})],Iu.prototype,"state",null),y([w()],Iu.prototype,"view",void 0),Iu=y([Z("esri.widgets.BasemapGallery.BasemapGalleryViewModel")],Iu);const vFt=Iu,Ad="esri-basemap-gallery",gh={base:Ad,widgetIcon:si.basemap,sourceLoading:`${Ad}--source-loading`,layoutGrid:`${Ad}--grid`,narrowItems:`${Ad}--narrow-items`,loader:`${Ad}__loader`,item:`${Ad}__item`,itemContainer:`${Ad}__item-container`,itemContent:`${Ad}__item-content`,itemTitle:`${Ad}__item-title`,itemTagsContainer:`${Ad}__item-tags-container`,itemThumbnail:`${Ad}__item-thumbnail`,selectedItem:`${Ad}__item--selected`,itemError:`${Ad}__item--error`};function Im({level:t,class:e,...i},r){const n=aUe(t);return X(`h${n}`,{...i,"aria-level":String(n),class:GS(tt.heading,e),role:"heading"},r)}function aUe(t){return Je(Math.ceil(t),1,6)}function _Ft(t,e=1){return aUe(t+e)}const fX={small:200,default:280,wide:420};let oc=class extends cn{constructor(e,i){super(e,i),this.disabled=!1,this.headingLevel=2,this.iconClass=gh.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new vFt,this._focusBasemapItemEnabled=!1,this._container=null,this._width=0,this._onContainerCreated=r=>{this._container=r}}initialize(){this.addHandles([aB(()=>this._container,({contentRect:e})=>{this._width=e.width}),Mo(()=>this.source,()=>this.viewModel.load(),{sync:!0,initial:!0,once:!0})])}loadDependencies(){return Pl({scrim:()=>we(()=>import("./calcite-scrim-iUD6Tmec.js"),__vite__mapDeps([256,257,240,241,242,244,246,247])),chip:()=>we(()=>import("./calcite-chip-MkTbFpRn.js"),__vite__mapDeps([258,259,242,239,244,240,241,237,243,245]))})}get activeBasemap(){return this.viewModel.activeBasemap}set activeBasemap(e){this.viewModel.activeBasemap=e}get includeCurrentBasemap(){return this.viewModel.includeCurrentBasemap}set includeCurrentBasemap(e){this.viewModel.includeCurrentBasemap=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get source(){return this.viewModel.source}set source(e){this.viewModel.source=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e=this.source.state==="loading",i=this.disabled||this.viewModel.state==="disabled",r=this.viewModel.items,n={[gh.sourceLoading]:e,[tt.disabled]:i},s=this._width;s<=fX.small||s>=fX.wide?n[gh.layoutGrid]=!0:s0?X("ul",{"aria-disabled":this.disabled,"aria-label":this.label,bind:this,class:gh.itemContainer,key:"item-container",onkeydown:this._handleKeyDown,role:"radiogroup"},r.map((c,f)=>this._renderBasemapGalleryItem(c,f)).toArray()):X("div",{class:tt.empty,key:"empty-message"},X(Im,{level:this.headingLevel},this.messages.noBasemaps));return X("div",{afterCreate:this._onContainerCreated,class:this.classes(gh.base,tt.widget,tt.panelHeightOnly,n),key:"container"},this._width===0?null:[o,l])}_getRoundRobinIndex(e,i){return(e+i)%i}_handleKeyDown(e){const{key:i}=e;if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(i))return;e.preventDefault();const{items:r,activeBasemapIndex:n}=this.viewModel,s=i==="ArrowUp"||i==="ArrowLeft"?this._getRoundRobinIndex(Math.max(n-1,-1),r.length):this._getRoundRobinIndex(n+1,r.length),o=r.at(s);(o==null?void 0:o.state)==="ready"&&(this.viewModel.activeBasemap=o.basemap),this._focusBasemapItemEnabled=!0}_focusBasemapItem(e){this._focusBasemapItemEnabled&&e.tabIndex===0&&(e.focus(),this._focusBasemapItemEnabled=!1)}_handleClick(e){const i=e.currentTarget["data-item"];i.state==="ready"&&(this.viewModel.activeBasemap=i.basemap)}_renderBasemapGalleryItem(e,i){var I,L;const r=Hdt(e.basemap)||Wr("esri/themes/base/images/basemap-toggle-64.svg"),n=e.basemap.title,s=(I=e.basemap.portalItem)==null?void 0:I.snippet,o=((L=e.error)==null?void 0:L.message)||s||n,{viewModel:{state:l,activeBasemapIndex:c}}=this,f=this.disabled||l==="disabled",_=c===i,x=_||c===-1&&i===0?0:-1,T=l==="loading",A={[gh.selectedItem]:_,[gh.itemError]:e.state==="error"},M=`basemapgallery-item-${e.uid}`;return X("li",{afterUpdate:this._focusBasemapItem,"aria-checked":_.toString(),"aria-disabled":f.toString(),"aria-labelledby":M,bind:this,class:this.classes(gh.item,A),"data-item":e,key:e.uid,onclick:this._handleClick,onkeydown:this._handleClick,role:"radio",tabIndex:x,title:o},X("img",{alt:"",class:gh.itemThumbnail,src:r}),X("div",{class:gh.itemContent,key:"content"},X("div",{class:gh.itemTitle,key:"title"},X("span",{id:M},n)),Ndt(e.basemap)?this._renderTags(e.basemap):null),e.state==="loading"||_&&T?X("calcite-scrim",null,X("span",{"aria-hidden":"true",class:tt.loaderAnimation,key:"loader",role:"presentation"})):null)}_renderTags(e){return X("div",{class:gh.itemTagsContainer,key:"tag"},this._render3DTag(),Fdt(e)?this._renderBetaTag():null)}_render3DTag(){const{messages:e}=this;return X("calcite-chip",{key:"tag-3d",scale:"s",value:e.tag3D},this.messages.tag3D)}_renderBetaTag(){const{messages:e}=this;return X("calcite-chip",{appearance:"outline-fill",key:"tag-beta",scale:"s",value:e.tagBeta},this.messages.tagBeta)}};y([w()],oc.prototype,"activeBasemap",null),y([w()],oc.prototype,"disabled",void 0),y([w()],oc.prototype,"headingLevel",void 0),y([w()],oc.prototype,"iconClass",void 0),y([w()],oc.prototype,"icon",void 0),y([w()],oc.prototype,"label",null),y([w(),Gr("esri/widgets/BasemapGallery/t9n/BasemapGallery")],oc.prototype,"messages",void 0),y([w()],oc.prototype,"source",null),y([w()],oc.prototype,"view",null),y([w()],oc.prototype,"viewModel",void 0),y([w()],oc.prototype,"_focusBasemapItemEnabled",void 0),y([w()],oc.prototype,"_container",void 0),y([w()],oc.prototype,"_width",void 0),y([bo()],oc.prototype,"_handleClick",null),oc=y([Z("esri.widgets.BasemapGallery")],oc);const bFt=oc,kn="esri-slider",Nr={base:kn,widgetIcon:si.edit,reversed:`${kn}--reversed`,horizontalLayout:`${kn}--horizontal`,verticalLayout:`${kn}--vertical`,contentElement:`${kn}__content`,extraContentElement:`${kn}__extra-content`,trackElement:`${kn}__track`,ticksContainerElement:`${kn}__ticks`,tickElement:`${kn}__tick`,tickLabelElement:`${kn}__tick-label`,maxElement:`${kn}__max`,minElement:`${kn}__min`,maxElementInteractive:`${kn}__max--interactive`,minElementInteractive:`${kn}__min--interactive`,rangeElementActive:`${kn}__range--active`,rangeInput:`${kn}__range-input`,anchorElement:`${kn}__anchor`,movingAnchorElement:`${kn}__anchor--moving`,lastMovedAnchorElement:`${kn}__anchor--moved`,anchorElementActive:`${kn}__anchor--active`,anchorElementIndexPrefix:`${kn}__anchor-`,segmentElement:`${kn}__segment`,segmentElementIndexPrefix:`${kn}__segment-`,segmentElementInteractive:`${kn}__segment--interactive`,segmentElementActive:`${kn}__segment--active`,effectiveSegmentElement:`${kn}__effective-segment`,effectiveMaxSegmentElement:`${kn}__effective-max-segment`,effectiveMinSegmentElement:`${kn}__effective-min-segment`,thumbElement:`${kn}__thumb`,labelElement:`${kn}__label`,labelElementInteractive:`${kn}__label--interactive`,labelInput:`${kn}__label-input`};let $u=class extends ze{constructor(e){super(e),this.precision=4,this.thumbsConstrained=!0}set effectiveMax(e){this.setEffectiveMax(e)}set effectiveMin(e){this.setEffectiveMin(e)}set labelFormatFunction(e){this._set("labelFormatFunction",e)}set inputFormatFunction(e){this._set("inputFormatFunction",e)}set inputParseFunction(e){this._set("inputParseFunction",e)}get labels(){const{max:e,min:i,values:r}=this,n=r!=null&&r.length?r.map((s,o)=>this.getLabelForValue(s,"value",o)):[];return{max:this.getLabelForValue(e,"max"),min:this.getLabelForValue(i,"min"),values:n}}set max(e){this.setMax(e)}set min(e){this.setMin(e)}get state(){const{max:e,min:i}=this;return e!=null&&i!=null&&e>i?"ready":"disabled"}set values(e){const{max:i,min:r}=this,n=this.values;n&&e&&n.length===e.length&&n.every((s,o)=>s===e[o])||(this._set("values",null),e!=null&&e.length&&(r!=null&&e.some(s=>ss>i)&&(this.max=Math.max(...e))),this._set("values",e))}toPrecision(e){return parseFloat(e.toFixed(this.precision))}defaultLabelFormatFunction(e){const{max:i,min:r,precision:n}=this,s=i!=null&&r!=null&&i-r>10?2:n;return parseFloat(e.toFixed(s)).toString()}defaultInputFormatFunction(e){return e.toString()}defaultInputParseFunction(e){return parseFloat(e)}getBounds(){const{effectiveMax:e,effectiveMin:i,max:r,min:n}=this;return{min:i!=null&&n!=null?Math.max(n,i):n,max:e!=null&&r!=null?Math.min(r,e):r}}getBoundsForValueAtIndex(e){const{thumbsConstrained:i,values:r}=this,{min:n,max:s}=this.getBounds();if(i&&r){const o=e-1,l=e+1;return{min:r[o]!=null?r[o]:n,max:r[l]!=null?r[l]:s}}return{min:n,max:s}}getLabelForValue(e,i,r){return e==null?null:this.labelFormatFunction?this.labelFormatFunction(e,i,r):this.defaultLabelFormatFunction(e)}setMax(e){const{max:i,values:r}=this;if(e==null)return void this._set("max",null);if(isNaN(e))return void this._logError("slider:invalid-value","Supplied value for property 'max' is NaN.");const n=this.toPrecision(e);if(i!==n&&(this._set("max",n),r==null?void 0:r.length))for(let s=0;sr[s]&&this.setValue(s,n)}setEffectiveMax(e){if(e==null)return void this._set("effectiveMax",null);if(isNaN(e))return void this._logError("slider:invalid-value","Supplied value for property 'effectiveMax' is NaN.");const i=this.toPrecision(e);this.effectiveMax!==i&&this._set("effectiveMax",this._applyBoundsToValue(i))}setEffectiveMin(e){if(e==null)return void this._set("effectiveMin",null);if(isNaN(e))return void this._logError("slider:invalid-value","Supplied value for property 'effectiveMin' is NaN.");const i=this.toPrecision(e);this.effectiveMin!==i&&this._set("effectiveMin",this._applyBoundsToValue(i))}setValue(e,i){if(isNaN(i))return void this._logError("slider:invalid-value","Supplied value for member of property 'values' is NaN.");const{values:r}=this;if(r==null)return void this._logError("slider:invalid-value","Supplied value for member of property 'values' is null.");const n=r[e],s=this.toPrecision(i);if(n===s)return;const o=[...r];o[e]=s,this._set("values",o),this.notifyChange("labels")}_applyBoundsToValue(e){const{max:i,min:r}=this;return r!=null&&ei?i:e}_logError(e,i,r){Ce.getLogger(this).error(new se(e,i,r))}};y([w()],$u.prototype,"effectiveMax",null),y([w()],$u.prototype,"effectiveMin",null),y([w()],$u.prototype,"labelFormatFunction",null),y([w()],$u.prototype,"inputFormatFunction",null),y([w()],$u.prototype,"inputParseFunction",null),y([w({readOnly:!0})],$u.prototype,"labels",null),y([w()],$u.prototype,"max",null),y([w()],$u.prototype,"min",null),y([w()],$u.prototype,"precision",void 0),y([w({readOnly:!0})],$u.prototype,"state",null),y([w()],$u.prototype,"thumbsConstrained",void 0),y([w()],$u.prototype,"values",null),$u=y([Z("esri.widgets.Slider.SliderViewModel")],$u);const lUe=$u,yh={showInput:"Enter",hideInput1:"Enter",hideInput2:"Escape",hideInput3:"Tab",moveAnchorUp:"ArrowUp",moveAnchorDown:"ArrowDown",moveAnchorLeft:"ArrowLeft",moveAnchorRight:"ArrowRight",moveAnchorToMax:"End",moveAnchorToMin:"Home"},D2e={labels:!1,rangeLabels:!1};let kr=class extends cn{constructor(e,i){super(e,i),this._activeLabelInputIndex=null,this._anchorElements=[],this._dragged=!1,this._dragStartInfo=null,this._focusedAnchorIndex=null,this._isMinInputActive=!1,this._isMaxInputActive=!1,this._lastMovedHandleIndex=null,this._positionPrecision=5,this._segmentDragStartInfo=null,this._trackHeight=null,this._trackWidth=null,this._zIndices=[],this._zIndexOffset=3,this.disabled=!1,this.draggableSegmentsEnabled=!0,this.effectiveSegmentElements=new it,this.extraNodes=[],this.inputCreatedFunction=null,this.labelElements=new it,this.labelInputsEnabled=!1,this.maxLabelElement=null,this.messages=null,this.minLabelElement=null,this.rangeLabelInputsEnabled=!1,this.segmentElements=new it,this.snapOnClickEnabled=!0,this.steps=null,this.syncedSegmentsEnabled=!1,this.thumbCreatedFunction=null,this.thumbElements=new it,this.tickElements=new it,this.trackElement=null,this.viewModel=new lUe,this.visibleElements={...D2e},this._onAnchorPointerDown=this._onAnchorPointerDown.bind(this),this._onAnchorPointerMove=this._onAnchorPointerMove.bind(this),this._onAnchorPointerUp=this._onAnchorPointerUp.bind(this),this._onLabelPointerDown=this._onLabelPointerDown.bind(this),this._onLabelPointerUp=this._onLabelPointerUp.bind(this),this._onSegmentPointerDown=this._onSegmentPointerDown.bind(this),this._onSegmentPointerMove=this._onSegmentPointerMove.bind(this),this._onSegmentPointerUp=this._onSegmentPointerUp.bind(this),this._onTrackPointerDown=this._onTrackPointerDown.bind(this),this._onTrackPointerMove=this._onTrackPointerMove.bind(this),this._onTrackPointerUp=this._onTrackPointerUp.bind(this)}destroy(){document.removeEventListener("pointerup",this._onLabelPointerUp),document.removeEventListener("pointermove",this._onLabelPointerMove),document.removeEventListener("pointerup",this._onAnchorPointerUp),document.removeEventListener("pointermove",this._onAnchorPointerMove),this.labelElements.removeAll(),this.labelElements.destroy(),this.segmentElements.removeAll(),this.segmentElements.destroy(),this.effectiveSegmentElements.removeAll(),this.effectiveSegmentElements.destroy(),this.thumbElements.removeAll(),this.thumbElements.destroy(),this.tickElements.removeAll(),this.tickElements.destroy()}get effectiveMax(){return this.viewModel.effectiveMax}set effectiveMax(e){this.viewModel.effectiveMax=e}get effectiveMin(){return this.viewModel.effectiveMin}set effectiveMin(e){this.viewModel.effectiveMin=e}get inputFormatFunction(){return this.viewModel.inputFormatFunction}set inputFormatFunction(e){this.viewModel.inputFormatFunction=e}get inputParseFunction(){return this.viewModel.inputParseFunction}set inputParseFunction(e){this.viewModel.inputParseFunction=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get labelFormatFunction(){return this.viewModel.labelFormatFunction}set labelFormatFunction(e){this.viewModel.labelFormatFunction=e}get labels(){return this.viewModel.labels}set layout(e){["vertical","vertical-reversed","horizontal","horizontal-reversed"].includes(e)||(e="horizontal"),this._set("layout",e)}get max(){return this.viewModel.max}set max(e){this.viewModel.max=e}get min(){return this.viewModel.min}set min(e){this.viewModel.min=e}get precision(){return this.viewModel.precision}set precision(e){this.viewModel.precision=e}get state(){const{_activeLabelInputIndex:e,_isMaxInputActive:i,_isMinInputActive:r,_dragStartInfo:n,_segmentDragStartInfo:s,disabled:o,viewModel:l}=this;return o?"disabled":e===null&&!i&&!r?n!=null||s!=null?"dragging":l.state:"editing"}get thumbsConstrained(){return this.viewModel.thumbsConstrained}set thumbsConstrained(e){this.viewModel.thumbsConstrained=e}set tickConfigs(e){this._set("tickConfigs",e),this.scheduleRender()}get values(){return this.viewModel.values}set values(e){this.viewModel.values=e}castVisibleElements(e){return{...D2e,...e}}render(){const{label:e}=this,i=this.classes(Nr.base,tt.widget,this._isHorizontalLayout()?Nr.horizontalLayout:Nr.verticalLayout,this._isReversedLayout()?Nr.reversed:null,this._isDisabled()?tt.disabled:null);return this._storeTrackDimensions(),X("div",{afterCreate:this._afterContainerCreate,"aria-label":e,bind:this,class:i,"touch-action":"none"},this._renderContent())}toNextStep(e){this._toStep(e,1)}toPreviousStep(e){this._toStep(e,-1)}getCurrentPosition(){var e;return this._positionFromValue(((e=this.values)==null?void 0:e[0])??0)}_renderContent(){const{max:e,min:i}=this;if(!(i==null||e==null||i>=e))return[this._renderMin(),this._renderSliderContainer(),this._renderMax()]}_renderSliderContainer(){return X("div",{bind:this,class:Nr.contentElement,key:"slider-container"},this._renderTrackElement(),this._renderTicksContainer(),this._renderExtraContentElements())}_renderTrackElement(){return X("div",{afterCreate:this._afterTrackCreate,afterRemoved:this._afterTrackRemoved,bind:this,class:Nr.trackElement,"touch-action":"none"},this._renderEffectiveSegmentElements(),this._renderSegmentElements(),this._renderAnchorElements())}_renderEffectiveSegmentElements(){var c;if(!this.trackElement||!((c=this.values)!=null&&c.length))return;const e=this.effectiveMax!=null,i=this.effectiveMin!=null;if(!e&&!i)return;const{max:r,min:n,viewModel:s}=this,o=s.getBounds(),l=[];return i&&l.push(this._renderEffectiveSegmentElement(n,o.min,!0)),e&&l.push(this._renderEffectiveSegmentElement(o.max,r,!1)),l}_renderSegmentElements(){var r;if(!this.trackElement||!((r=this.values)!=null&&r.length))return;const e=this.values.length,i=[];for(let n=0;n<=e;n++)i.push(this._renderSegmentElement(n));return i}_renderSegmentElement(e){const{_trackHeight:i,_trackWidth:r,draggableSegmentsEnabled:n,id:s,state:o}=this,l=this.values,c=this._isHorizontalLayout(),f=c?r:i,_=this.viewModel.getBounds(),x=this._positionFromValue(_.max),T=this._positionFromValue(_.min),A=e===(l==null?void 0:l.length)?null:e,M=e===0?null:e-1,I=A!=null,L=M!=null;let F,z;const k=[...l].sort((Q,ne)=>Q-ne);this._isReversedLayout()?(F=L?this._positionFromValue(k[M]):T,z=I?this._positionFromValue(k[A]):x):(F=I?this._positionFromValue(k[A]):x,z=L?this._positionFromValue(k[M]):T);const U=this._applyPrecisionToPosition(100*z/f),j=(F-z)/f,H=c?`transform: translate(${U}%, 0px) scale(${j}, 1);`:`transform: translate(0px, ${U}%) scale(1, ${j});`,Y=this.classes(Nr.segmentElement,Nr.segmentElementIndexPrefix+e,n&&I&&L&&o!=="disabled"?Nr.segmentElementInteractive:null);return X("div",{afterCreate:this._afterSegmentCreate,afterRemoved:this._afterSegmentRemoved,bind:this,class:Y,"data-max-thumb-index":A,"data-min-thumb-index":M,"data-segment-index":e,key:`${s}-segment-${e}`,style:H,"touch-action":"none"})}_renderEffectiveSegmentElement(e,i,r){const{_trackHeight:n,_trackWidth:s,layout:o}=this,l=this._positionFromValue(e),c=this._positionFromValue(i),f=this._isHorizontalLayout(),_=f?s:n,x=this._applyPrecisionToPosition(100*l/_);let T=null;if(o==="horizontal"){const I=r?_-c:c,L=l===_?0:x;T=`clip-path: inset(0% ${c===_?0:this._applyPrecisionToPosition(I/_*100)}% 0% ${L}%);`}else{const I=(c-l)/_;T=f?`transform: translate(${x}%, 0px) scale(${I}, 1);`:`transform: translate(0px, ${x}%) scale(1, ${I});`}const A=r?Nr.effectiveMinSegmentElement:Nr.effectiveMaxSegmentElement,M=this.classes(Nr.segmentElement,Nr.effectiveSegmentElement,A);return X("div",{afterCreate:this._afterEffectiveSegmentCreate,afterRemoved:this._afterEffectiveSegmentRemoved,bind:this,class:M,style:T,"touch-action":"none"})}_renderAnchorElements(){const{trackElement:e,values:i}=this;if(i!=null&&i.length)return this._zIndices=i.map((r,n)=>{const s=this._positionFromValue(r),o=this._positionToPercent(s),l=(this._isHorizontalLayout()?o>50:o<50)?-1:1;return this._zIndexOffset+(i.length+l*n)}),e&&i&&i.length?i.map((r,n)=>this._renderAnchorElement(r,n)):null}_renderAnchorElement(e,i){const r=this._positionFromValue(e),n=this._valueFromPosition(r);if(n==null||isNaN(n))return;const{_dragStartInfo:s,_lastMovedHandleIndex:o,id:l,layout:c,visibleElements:{labels:f}}=this,_=this.values,x=s&&s.index===i,T=o===i,A=this.classes(Nr.anchorElement,Nr.anchorElementIndexPrefix+i,x?Nr.movingAnchorElement:null,T?Nr.lastMovedAnchorElement:null),M=this.labels.values[i],I=this._getStyleForAnchor(e,i,x||T),{min:L,max:F}=this.viewModel.getBoundsForValueAtIndex(i),{disabled:z,messages:k}=this,U=_.length===2?By(i===0?k.rangeMinimum:k.rangeMaximum,{value:e}):M,j=_.length===1?null:i===0?`${l}-handle-${i+1}`:i===_.length-1?`${l}-handle-${i-1}`:`${l}-handle-${i-1} ${l}-handle-${i+1}`;return X("div",{afterCreate:this._afterAnchorCreate,afterRemoved:this._afterAnchorRemoved,afterUpdate:this._afterAnchorUpdate,"aria-controls":j,"aria-label":k.sliderValue,"aria-labelledby":f?`${l}-label-${i}`:null,"aria-orientation":c,"aria-valuemax":F==null?void 0:F.toString(),"aria-valuemin":L==null?void 0:L.toString(),"aria-valuenow":e.toString(),"aria-valuetext":U,bind:this,class:A,"data-thumb-index":i,"data-value":e,id:`${l}-handle-${i}`,key:`${l}-handle-${i}`,onkeydown:this._onAnchorKeyDown,role:"slider",style:I,tabIndex:z?-1:0,"touch-action":"none"},X("span",{afterCreate:this._afterThumbCreate,afterRemoved:this._afterThumbRemoved,bind:this,class:Nr.thumbElement,"data-thumb-index":i,"touch-action":"none"}),this.renderThumbLabel(i))}renderThumbLabel(e){const{id:i,labels:r,labelInputsEnabled:n,state:s}=this,o=this.visibleElements.labels,l=r.values[e],c=this.classes(Nr.labelElement,o?null:tt.hidden,n&&s!=="disabled"?Nr.labelElementInteractive:null);return X("span",{afterCreate:this._afterLabelCreate,afterRemoved:this._afterLabelRemoved,"aria-hidden":(!o).toString(),bind:this,class:c,"data-thumb-index":e,id:`${i}-label-${e}`,key:`${i}-label-${e}`,role:n?"button":null,"touch-action":"none"},this._activeLabelInputIndex===e?this._renderValueInput(e):l)}_renderValueInput(e){const{disabled:i,values:r}=this;if(r==null)return;const n=r[e];return X("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.sliderValue,bind:this,class:Nr.labelInput,"data-input-index":e,"data-input-type":"thumb",key:`value-input-${e}`,onblur:this._onLabelInputBlur,onkeydown:this._onInputKeyDown,required:!0,tabIndex:i?-1:0,type:"text",value:this._formatInputValue(n,"value",e)})}_renderMax(){const{_isMaxInputActive:e,labels:i,rangeLabelInputsEnabled:r,state:n}=this,s=this.visibleElements.rangeLabels,o=this.classes(Nr.maxElement,{[tt.hidden]:!s,[Nr.maxElementInteractive]:r&&n!=="disabled",[Nr.rangeElementActive]:e});return X("div",{afterCreate:this._afterMaxLabelCreate,"aria-hidden":(!s).toString(),bind:this,class:o,onclick:this._onMaxLabelClick,onkeydown:this._onMaxLabelKeyDown,role:r?"button":null,tabIndex:!this.disabled&&r?0:-1},e?this._renderMaxInput():i.max)}_renderMin(){const{_isMinInputActive:e,labels:i,rangeLabelInputsEnabled:r,state:n}=this,s=this.visibleElements.rangeLabels,o=this.classes(Nr.minElement,{[tt.hidden]:!s,[Nr.minElementInteractive]:r&&n!=="disabled",[Nr.rangeElementActive]:e});return X("div",{afterCreate:this._afterMinLabelCreate,"aria-hidden":(!s).toString(),bind:this,class:o,onclick:this._onMinLabelClick,onkeydown:this._onMinLabelKeyDown,role:r?"button":null,tabIndex:!this.disabled&&r?0:-1},e?this._renderMinInput():i.min)}_renderMaxInput(){return X("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.maximumValue,bind:this,class:Nr.rangeInput,"data-input-type":"max",onblur:this._onMaxInputBlur,onkeydown:this._onInputKeyDown,required:!0,tabIndex:this.disabled?-1:0,type:"text",value:this._formatInputValue(this.max,"max")})}_renderMinInput(){return X("input",{afterCreate:this._afterInputCreate,"aria-label":this.messages.minimumValue,bind:this,class:Nr.rangeInput,"data-input-type":"min",onblur:this._onMinInputBlur,onkeydown:this._onInputKeyDown,required:!0,tabIndex:this.disabled?-1:0,type:"text",value:this._formatInputValue(this.min,"min")})}_renderExtraContentElements(){return X("div",{bind:this,class:Nr.extraContentElement},this.extraNodes)}_renderTicksContainer(){if(this.tickConfigs&&this.trackElement&&(this._trackHeight!==0||this._trackWidth!==0))return this.tickConfigs.map((e,i)=>X("div",{class:this.classes(Nr.ticksContainerElement),key:"ticks-container"},this._renderTicks(e,i)))}_renderTicks(e,i){const{mode:r,values:n}=e;if(this.tickElements.at(i)||this.tickElements.add(new it,i),r==="position"){const l=Array.isArray(n)?n:[n];return this._calculateTickPositions(l).map((c,f)=>this._renderTickGroup(e,f,i,c))}if(r==="percent"&&Array.isArray(n)){const l=this.min??0,c=(this.max??0)-l,f=n.map(_=>this._applyPrecisionToPosition(_/100*c+l));return this._calculateTickPositions(f).map((_,x)=>this._renderTickGroup(e,x,i,_))}const s=Array.isArray(n)&&n.length?n[0]:isNaN(n)?null:n,o=this._getTickCounts(s,e);return this._calculateEquidistantTickPositions(o).map((l,c)=>this._renderTickGroup(e,c,i,l))}_renderTickGroup(e,i,r,n){const s=e.mode==="position"?Array.isArray(e.values)?e.values[i]:e.values:this._valueFromPosition(n);if(s!=null&&!isNaN(s))return X("div",{afterCreate:this._afterTickGroupCreate,afterRemoved:this._afterTickGroupRemoved,bind:this,"data-config":e,"data-position":n,"data-tick-config-index":r,"data-tick-group-index":i,"data-value":s,key:`tick-group-${i}`,onclick:this._onTickGroupClick},this._renderTickLine(e,i,r,s),e.labelsVisible?this._renderTickLabel(e,i,r,s):null)}_renderTickLine(e,i,r,n){return X("div",{afterCreate:this._afterTickLineCreate,"aria-valuenow":n.toString(),bind:this,class:Nr.tickElement,"data-config":e,"data-tick-config-index":r,"data-tick-group-index":i,"data-value":n,key:`tick-label-${i}`,style:this._getPositionStyleForElement(n)})}_renderTickLabel(e,i,r,n){const s=e.labelFormatFunction?e.labelFormatFunction(n,"tick",i):this.viewModel.getLabelForValue(n,"tick",i);return X("div",{afterCreate:this._afterTickLabelCreate,"aria-label":s,"aria-valuenow":n.toString(),"aria-valuetext":s,bind:this,class:Nr.tickLabelElement,"data-config":e,"data-tick-config-index":r,"data-tick-group-index":i,"data-value":n,key:`tick-label-${i}`,style:`transform: translate(-50%); ${this._getPositionStyleForElement(n)}`},s)}_afterContainerCreate(e){this.addHandles(aB(e,()=>this.scheduleRender()))}_afterTrackCreate(e){this._set("trackElement",e),e.addEventListener("pointerdown",this._onTrackPointerDown),this.scheduleRender()}_afterTrackRemoved(e){e.removeEventListener("pointerdown",this._onTrackPointerDown),document.removeEventListener("pointermove",this._onTrackPointerMove),document.removeEventListener("pointerup",this._onTrackPointerUp)}_afterSegmentCreate(e){this.segmentElements.add(e),e.addEventListener("pointerdown",this._onSegmentPointerDown)}_afterSegmentRemoved(e){this.segmentElements.remove(e),e.removeEventListener("pointerdown",this._onSegmentPointerDown)}_afterEffectiveSegmentCreate(e){this.effectiveSegmentElements.add(e)}_afterEffectiveSegmentRemoved(e){this.effectiveSegmentElements.remove(e)}_afterAnchorCreate(e){if(this._anchorElements.push(e),e.addEventListener("pointerdown",this._onAnchorPointerDown),this.thumbCreatedFunction){const i=kR(e),r=mX(e),n=this.thumbElements.at(i),s=this.labelElements.at(i)||null;this.thumbCreatedFunction(i,r,n,s)}}_afterAnchorUpdate(e){this._focusedAnchorIndex!=null&&kR(e)===this._focusedAnchorIndex&&(e.focus(),this._focusedAnchorIndex=null)}_afterAnchorRemoved(e){const i=this._anchorElements.indexOf(e,0);i>-1&&this._anchorElements.splice(i,1),e.removeEventListener("pointerdown",this._onAnchorPointerDown)}_afterThumbCreate(e){this.thumbElements.add(e)}_afterThumbRemoved(e){this.thumbElements.remove(e)}_afterLabelCreate(e){this.labelElements.add(e),e.addEventListener("pointerdown",this._onLabelPointerDown),e.addEventListener("pointerup",this._onLabelPointerUp)}_afterLabelRemoved(e){this.labelElements.remove(e),e.removeEventListener("pointerdown",this._onLabelPointerDown),e.removeEventListener("pointerup",this._onLabelPointerUp)}_afterInputCreate(e){if(e.focus(),e.select(),this.inputCreatedFunction){const i=e.getAttribute("data-input-type"),r=i==="thumb"?wFt(e):null;this.inputCreatedFunction(e,i,r)}}_afterTickLineCreate(e){const i=zR(e),r=z8(e),n=this.tickElements.at(i),s=n.at(r);s?s.tickElement=e:n.add({groupElement:null,tickElement:e,labelElement:null},r)}_afterTickLabelCreate(e){const i=zR(e),r=z8(e),n=this.tickElements.at(i),s=n.at(r);s?s.labelElement=e:n.add({groupElement:null,labelElement:e,tickElement:null},r)}_afterTickGroupRemoved(e){const i=zR(e),r=this.tickElements.items[i],n=r==null?void 0:r.find(s=>s.groupElement===e);n&&r.remove(n)}_afterTickGroupCreate(e){var r,n;const i=N2e(e);if(i!=null&&i.tickCreatedFunction){const s=zR(e),o=z8(e),l=mX(e),c=(n=(r=this.tickElements)==null?void 0:r.at(s))==null?void 0:n.at(o);if(c){c.groupElement=e;const f=c.tickElement||null,_=c.labelElement||null;i.tickCreatedFunction(l,f,_)}}}_afterMaxLabelCreate(e){this._set("maxLabelElement",e)}_afterMinLabelCreate(e){this._set("minLabelElement",e)}_onAnchorKeyDown(e){if(this._isDisabled()||this.state==="editing")return;const{target:i}=e,r=Sf(e),n=this.values,s=kR(i),o=this._anchorElements[s],l=n[s],c=[yh.moveAnchorUp,yh.moveAnchorDown,yh.moveAnchorLeft,yh.moveAnchorRight];if(r===yh.showInput&&this.labelInputsEnabled)this._activeLabelInputIndex=s,this.notifyChange("state");else if(c.includes(r)){e.preventDefault();const{steps:f}=this,_=r===yh.moveAnchorUp||r===yh.moveAnchorRight?1:-1;if(f!=null)this._toStep(s,this._isReversedLayout()?-1*_:_);else{const{precision:T}=this,A=this._getPositionOfElement(o),M=this._valueFromPosition(A),I=this._isHorizontalLayout()?_:-1*_;let L;L=T===0?this._positionFromValue(M+I):T===1?this._positionFromValue(M+.1*I):A+I,this._toPosition(s,L)}const x=this.values[s];l!==x&&this._emitThumbChangeEvent({index:s,oldValue:l,value:x})}else if(r===yh.moveAnchorToMax||r===yh.moveAnchorToMin){e.preventDefault();const{min:f,max:_}=this._getAnchorBoundsInPixels(s),x=this._isPositionInverted()?r===yh.moveAnchorToMax?f:_:r===yh.moveAnchorToMin?f:_;this._toPosition(s,x);const T=this.values[s];l!==T&&this._emitThumbChangeEvent({index:s,oldValue:l,value:T})}}_onAnchorPointerDown(e){if(this._isDisabled())return;const{target:i,clientX:r,clientY:n}=e,s=kR(i);s!=null&&(e.preventDefault(),this._anchorElements[s]&&this._anchorElements[s].focus(),this._storeTrackDimensions(),this._dragStartInfo={clientX:r,clientY:n,index:s,position:this._getPositionOfElement(this._anchorElements[s])},this.notifyChange("state"),document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove))}_onAnchorPointerMove(e){if(this.state==="editing"||!this._dragStartInfo)return;e.preventDefault();const{values:i,_anchorElements:r,_dragged:n,_dragStartInfo:s,_dragStartInfo:{index:o,position:l}}=this,{clientX:c,clientY:f}=e,_=n?"drag":"start",x=r[o],T=this._getPositionOfElement(x),A=this._applyPrecisionToPosition(this._isHorizontalLayout()?l+c-s.clientX:l+f-s.clientY);if(T===A)return;const M=i[o];this._dragged=!0,this._toPosition(o,A);const I=this.values[o];n?M!==I&&this._emitThumbDragEvent({index:o,state:_,value:I}):this._emitThumbDragEvent({index:o,state:_,value:M})}_onAnchorPointerUp(e){if(document.removeEventListener("pointerup",this._onAnchorPointerUp),document.removeEventListener("pointermove",this._onAnchorPointerMove),!this._dragStartInfo)return;e.preventDefault();const{index:i}=this._dragStartInfo,r=this._dragged,n=this.values[i];this._dragged=!1,this._dragStartInfo=null,this._lastMovedHandleIndex=i,this.notifyChange("state"),r?this._emitThumbDragEvent({index:i,state:"stop",value:n}):(this.scheduleRender(),this.state!=="editing"&&this._emitThumbClickEvent({index:i,value:n}))}_onTrackPointerDown(e){const{_dragStartInfo:i,snapOnClickEnabled:r,state:n,values:s}=this;if(this._isDisabled()||n==="editing"||i||(document.addEventListener("pointermove",this._onTrackPointerMove),document.addEventListener("pointerup",this._onTrackPointerUp),!r||!(s!=null&&s.length)))return;const{steps:o}=this,{clientX:l,clientY:c}=e,f=this._getCursorPositionFromEvent(e),_=this._valueFromPosition(f),x=this._getIndexOfNearestValue(_),T=s[x],A=s.some((F,z)=>F===T&&z!==x)&&_>T?s.lastIndexOf(T):x;if(A==null)return;const M=s[A],I=o!=null?this._calculateNearestStepPosition(f):f;this._toPosition(A,I),this._dragged=!0,this._dragStartInfo={clientX:l,clientY:c,index:A,position:I},this._focusedAnchorIndex=A,this.notifyChange("state"),this._emitThumbDragEvent({index:A,state:"start",value:M});const L=this.values[A];M!==L&&this._emitThumbDragEvent({index:A,state:"drag",value:L}),document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove)}_onTrackPointerMove(e){e.preventDefault(),this._dragged=!0}_onTrackPointerUp(e){if(e.preventDefault(),document.removeEventListener("pointermove",this._onTrackPointerMove),document.removeEventListener("pointerup",this._onTrackPointerUp),this.snapOnClickEnabled||(this._dragged=!1),!this._dragged){const i=this._getCursorPositionFromEvent(e),r=this._valueFromPosition(i);this._emitTrackClickEvent({value:r})}}_onSegmentPointerDown(e){var c,f;e.preventDefault();const i=e.target,r=xFt(i),n=SFt(i),s=TFt(i);if(this._isDisabled()||n==null||s==null)return;e.stopPropagation(),this._storeTrackDimensions(),document.addEventListener("pointerup",this._onSegmentPointerUp);const o=this._getAnchorDetails(n),l=this._getAnchorDetails(s);this.syncedSegmentsEnabled?(this.segmentElements.forEach(_=>_.classList.add(Nr.segmentElementActive)),this._anchorElements.forEach(_=>_.classList.add(Nr.anchorElementActive))):(this.segmentElements.at(r).classList.add(Nr.segmentElementActive),(c=this._anchorElements[o.index])==null||c.classList.add(Nr.anchorElementActive),(f=this._anchorElements[l.index])==null||f.classList.add(Nr.anchorElementActive)),this._segmentDragStartInfo={cursorPosition:this._getCursorPositionFromEvent(e),index:r,details:this._normalizeSegmentDetails({min:o,max:l})},this.draggableSegmentsEnabled&&(document.addEventListener("pointermove",this._onSegmentPointerMove),this.notifyChange("state"),this._emitSegmentDragEvent({index:r,state:"start",thumbIndices:[n,s]}))}_onSegmentPointerMove(e){if(!this._segmentDragStartInfo)return;e.preventDefault();const{_trackHeight:i,_trackWidth:r,_segmentDragStartInfo:{index:n,cursorPosition:s,details:{min:o,max:l}}}=this,{index:c,position:f,value:_}=o,{index:x,position:T,value:A}=l;this._dragged=!0;const M=this._getCursorPositionFromEvent(e);if(M===s)return;const I=this._positionToPercent(s),L=this._positionToPercent(M)-I,F=this._positionToPercent(f)+L,z=this._positionToPercent(T)+L,{min:k}=this._getAnchorBoundsAsPercents(c),{max:U}=this._getAnchorBoundsAsPercents(x);let j=!1,H=!1;if(FU&&(H=!0),j){const{min:ye,max:pe}=this.viewModel.getBoundsForValueAtIndex(c),Ee=this._isPositionInverted()?pe:ye,te=Ee,le=A+(Ee-_),de=le-this.values[x];return void(this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(de):this._updateAnchorValues([c,x],[te,le]))}if(H){const{min:ye,max:pe}=this.viewModel.getBoundsForValueAtIndex(x),Ee=this._isPositionInverted()?ye:pe,te=Ee,le=_+(Ee-A),de=le-this.values[c];return void(this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(de):this._updateAnchorValues([c,x],[le,te]))}const Y=this._isHorizontalLayout()?r:i,Q=z/100*Y,ne=F/100*Y,re=this.values,he=[re[c],re[x]],ce=this._getValueForAnchorAtPosition(c,ne),be=this._getValueForAnchorAtPosition(x,Q);this.syncedSegmentsEnabled?this._updateAnchorValuesByDifference(ce-he[0]):this._updateAnchorValues([c,x],[ce,be]),[this.values[c],this.values[x]].every((ye,pe)=>ye===he[pe])||this._emitSegmentDragEvent({index:n,state:"drag",thumbIndices:[c,x]})}_onSegmentPointerUp(e){if(e.preventDefault(),document.removeEventListener("pointerup",this._onSegmentPointerUp),document.removeEventListener("pointermove",this._onSegmentPointerMove),!this._segmentDragStartInfo)return;const{_dragged:i}=this,r=this.min,n=this.max,s=this.values,{index:o,details:{min:{index:l},max:{index:c}}}=this._segmentDragStartInfo;if(this.segmentElements.forEach(f=>f.classList.remove(Nr.segmentElementActive)),this._anchorElements.forEach(f=>f.classList.remove(Nr.anchorElementActive)),this.draggableSegmentsEnabled){const f=n-r,_=s[l],x=s[c];this._lastMovedHandleIndex=_===x?_>f/2?l:c:null,this._dragged=!1,this._segmentDragStartInfo=null,this.notifyChange("state"),this._emitSegmentDragEvent({index:o,state:"stop",thumbIndices:[l,c]})}if(!i){const f=this._getCursorPositionFromEvent(e),_=this._valueFromPosition(f);this._emitSegmentClickEvent({index:o,value:_,thumbIndices:[l,c]})}}_onTickGroupClick(e){const i=e.target;if(N2e(i)){const r=zR(i),n=z8(i),s=mX(i);this._emitTickClickEvent({configIndex:r,groupIndex:n,value:s})}}_storeTrackDimensions(){if(this.trackElement){const e=this._getDimensions(this.trackElement);this._trackHeight=e.height,this._trackWidth=e.width}}_onLabelPointerDown(){this._isDisabled()||(this._dragged=!1,document.addEventListener("pointerup",this._onAnchorPointerUp),document.addEventListener("pointermove",this._onAnchorPointerMove))}_onLabelPointerMove(){this._isDisabled()||(this._dragged=!0)}_onLabelPointerUp(e){if(this._isDisabled())return;const i=kR(e.target);this.labelInputsEnabled&&!this._dragged&&i!=null&&(this._activeLabelInputIndex=i),this._dragged=!1,this.notifyChange("state"),document.removeEventListener("pointerup",this._onLabelPointerUp),document.removeEventListener("pointermove",this._onLabelPointerMove)}_onLabelInputBlur(e){const{_activeLabelInputIndex:i,values:r,viewModel:n}=this,s=e.target.value;if(this._activeLabelInputIndex=null,this.notifyChange("state"),!s||i==null||r==null)return;const o=this._parseInputValue(s,"value",i),l=r[i],{min:c,max:f}=this.viewModel.getBoundsForValueAtIndex(i);if(of)return;n.setValue(i,o);const _=this.values[i];l!==_&&this._emitThumbChangeEvent({index:i,oldValue:l,value:_})}_onInputKeyDown(e){var _;if(this._isDisabled())return;const{target:i}=e,r=Sf(e),{hideInput1:n,hideInput2:s,hideInput3:o}=yh,{_activeLabelInputIndex:l,_anchorElements:c}=this,f=i;if(r===n||r===s||r===o){e.stopPropagation();const x=l;f.blur(),x!=null?c[x].focus():(_=f.parentElement)==null||_.focus()}}_onMaxLabelClick(){this._isDisabled()||(this._emitRangeLabelClickEvent({type:"max-click",value:this.max}),this.rangeLabelInputsEnabled&&(this._isMaxInputActive=!0,this.notifyChange("state")))}_onMaxLabelKeyDown(e){this._isDisabled()||Sf(e)!==yh.showInput||(this._isMaxInputActive=!0,this.notifyChange("state"))}_onMaxInputBlur(e){const i=e.target.value;if(this._isMaxInputActive=!1,this.notifyChange("state"),!i)return;const r=this.max,n=this._parseInputValue(i,"max");n<=this.min||(this.viewModel.set("max",n),this.max!==r&&this._emitMaxChangeEvent({oldValue:r,value:this.max}))}_onMinLabelClick(){this._isDisabled()||(this._emitRangeLabelClickEvent({type:"min-click",value:this.min}),this.rangeLabelInputsEnabled&&(this._isMinInputActive=!0,this.notifyChange("state")))}_onMinLabelKeyDown(e){this._isDisabled()||Sf(e)!==yh.showInput||(this._isMinInputActive=!0,this.notifyChange("state"))}_onMinInputBlur(e){const i=e.target.value;if(this._isMinInputActive=!1,this.notifyChange("state"),!i)return;const r=this.min,n=this._parseInputValue(i,"min");n>=this.max||(this.viewModel.set("min",n),this.min!==r&&this._emitMinChangeEvent({oldValue:r,value:this.min}))}_isDisabled(){return this.disabled||this.state==="disabled"}_positionFromValue(e){const{_trackHeight:i,_trackWidth:r}=this,n=this.min??0,s=this.max??0,o=s-n;if(o===0||e==null)return 0;const l=this._isHorizontalLayout();let c=parseFloat(l?(r*(e-n)/o).toFixed(2):(i*(s-e)/o).toFixed(2));return this._isReversedLayout()&&(c=l?r-c:i-c),c}_valueFromPosition(e){const{_trackHeight:i,_trackWidth:r,precision:n}=this,s=this.min??0,o=this.max??0,l=o-s;let c=this._isHorizontalLayout()?e*l/r+s:l*(1e3-e/i*1e3)/1e3+s;return this._isReversedLayout()&&(c=o+s-c),parseFloat(c.toFixed(n))}_positionToPercent(e){const{_trackHeight:i,_trackWidth:r}=this,n=100*e/(this._isHorizontalLayout()?r:i);return this._applyPrecisionToPosition(n)}_applyPrecisionToPosition(e){return parseFloat(e.toFixed(this._positionPrecision))}_isPositionInverted(){const{layout:e}=this;return e==="horizontal-reversed"||e==="vertical"}_isHorizontalLayout(){return this.layout.includes("horizontal")}_isReversedLayout(){return this.layout.includes("reversed")}_normalizeSegmentDetails(e){if(this._isPositionInverted()){const{min:i,max:r}=e;return{min:r,max:i}}return e}_parseInputValue(e,i,r){return this.inputParseFunction?this.inputParseFunction(e,i,r):this.viewModel.defaultInputParseFunction(e)}_formatInputValue(e,i,r){return this.inputFormatFunction?this.inputFormatFunction(e,i,r):this.viewModel.defaultInputFormatFunction(e)}_getAnchorDetails(e){const i=this.values,r=[...i].sort((s,o)=>s-o)[e],n=i.indexOf(r);return{index:n,position:this._getPositionOfElement(this._anchorElements[n]),value:r}}_updateAnchorStyle(e,i){const r=this._anchorElements[e];r&&(this._isHorizontalLayout()?r.style.left=`${i}`:r.style.top=`${i}`)}_getStyleForAnchor(e,i,r){var o;const n=this._getPositionStyleForElement(e);if(((o=this.values)==null?void 0:o.length)===1)return`${n}`;const s=this._zIndices[i];return`${n}; z-index: ${r?this._zIndexOffset+s:s}`}_getPositionStyleForElement(e){const i=this._positionFromValue(e),r=this._positionToPercent(i);return`${this._isHorizontalLayout()?"left":"top"}: ${r}%`}_getPositionOfElement(e){const i=this._getDimensions(e.offsetParent),r=this._getDimensions(e);return this._isHorizontalLayout()?this._applyPrecisionToPosition(r.left-i.left):this._applyPrecisionToPosition(r.top-i.top)}_updateAnchorValues(e,i){e.forEach((r,n)=>this._toValue(r,i[n]))}_updateAnchorValuesByDifference(e){const{min:i,max:r,values:n}=this;n==null||n.forEach((s,o)=>this._toValue(o,Math.max(Math.min(s+e,r),i)))}_toValue(e,i){this.steps!=null&&(i=this._getStepValues()[this._getIndexOfNearestStepValue(i)]),this._updateAnchorStyle(e,this._getPositionStyleForElement(i)),this.viewModel.setValue(e,i)}_toPosition(e,i){const r=this.steps!=null?this._getStepValueForAnchorAtPosition(e,i):this._getValueForAnchorAtPosition(e,i);this._updateAnchorStyle(e,this._getPositionStyleForElement(r)),this.viewModel.setValue(e,r)}_getValueForAnchorAtPosition(e,i){const{min:r,max:n}=this._getAnchorBoundsInPixels(e),{min:s,max:o}=this.viewModel.getBoundsForValueAtIndex(e);let l,c,f=null;return this._isPositionInverted()?(l=s,c=o):(l=o,c=s),f=i>n?l:io?f=o:fMath.abs(n-e)i?i:l)}return s}_toStep(e,i){const r=this.values[e],n=this._getStepValues(),s=n.indexOf(r);let o=null;if(s>-1){let l=n[s+i];isNaN(l)&&(l=n[s]);const c=this._positionFromValue(l);o=this._getStepValueForAnchorAtPosition(e,c)}else o=n[this._getIndexOfNearestStepValue(r)+i];this.viewModel.setValue(e,o)}_getIndexOfNearestStepValue(e){const{steps:i}=this;if(i==null)return null;const r=this._getStepValues(),n=r.reduce((s,o)=>Math.abs(o-e)this._positionFromValue(i))}_calculateEquidistantTickPositions(e){const{_trackWidth:i,_trackHeight:r}=this,n=this._isHorizontalLayout()?i:r,s=n/(e-1),o=[];if(e===1)return[n/2];for(let l=0;l{const t=document.createElement("div"),e=document.createElement("calcite-slider");return e.min=0,e.max=100,e.step=1,e.value=100,e.labelHandles=!0,[t,e]},r9=-1;let jg=class extends ze{constructor(e){super(e),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=Le("mapview-transitions-duration"),this.effects=[]}set effect(e){if(this._get("effect")!==(e=e||"")){this._set("effect",e);try{this._transitionTo(F2e(e))}catch(i){this._transitionTo([]),Ce.getLogger(this).warn("Invalid Effect",{effect:e,error:i})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(e){this._updateForScale(e)}get transitioning(){return this._to!==null}canTransitionTo(e){try{return this.scale>0&&k2e(this._current,F2e(e),this.scale)}catch{return!1}}transitionStep(e,i){this._applyTimeTransition(e),this._updateForScale(i)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(e){this.scale>0&&k2e(this._current,e,this.scale)?(this._final=e,this._to=Re(e),EFt(this._current,this._to,this.scale),this._from=Re(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=e),this._set("effects",this._current[0]?Re(this._current[0].effects):[])}_applyTimeTransition(e){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=e;const i=Math.min(1,this._time/this.duration);for(let r=0;r=i[0].scale)s=n=i[0].effects;else if(e<=i[r].scale)s=n=i[r].effects;else for(let l=0;l=e&&f.scale<=e){o=(e-c.scale)/(f.scale-c.scale),n=c.effects,s=f.effects;break}}for(let l=0;l1||e.length>1)&&i<=0)&&dMe(t[0].effects,e[0].effects)}function EFt(t,e,i){const r=t.length>e.length?t:e,n=t.length>e.length?e:t,s=n[n.length-1],o=(s==null?void 0:s.scale)??i,l=(s==null?void 0:s.effects)??[];for(let c=n.length;cr!=="").map(r=>`'${r}'`);return i.push("''"),`${e} IN (${i.join(",")}) OR ${e} IS NULL`}function xmi(t,e,i){return e.flatten(({sublayers:n})=>n).length!==t.length?!0:!!t.some(n=>n.originIdOf("minScale")>i||n.originIdOf("maxScale")>i||n.originIdOf("renderer")>i||n.originIdOf("labelingInfo")>i||n.originIdOf("opacity")>i||n.originIdOf("labelsVisible")>i||n.originIdOf("source")>i)||!hUe(t,e)}function OFt(t,e,i){return!!t.some(r=>{const n=r.source;return!(!n||n.type==="map-layer"&&n.mapLayerId===r.id&&(n.gdbVersion==null||n.gdbVersion===i))||r.originIdOf("renderer")>Di.SERVICE||r.originIdOf("labelingInfo")>Di.SERVICE||r.originIdOf("opacity")>Di.SERVICE||r.originIdOf("labelsVisible")>Di.SERVICE})||!hUe(t,e)}function hUe(t,e){if(!(t!=null&&t.length)||e==null)return!0;const i=e.slice().reverse().flatten(({sublayers:s})=>s&&s.toArray().reverse()).map(s=>s.id).toArray();if(t.length>i.length)return!1;let r=0;const n=i.length;for(const{id:s}of t){for(;r=n)return!1}return!0}function Smi(t){return!!t&&t.some(e=>{var i;return e.minScale!=null||((i=e.layerDefinition)==null?void 0:i.minScale)!=null})}const PFt={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let Fd=class extends ze{constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(i=>{const r=z2e(this.floors,i);return i.toExportImageJSON(r)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&OFt(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",i=>this.notifyChange(PFt[i.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(i=>i.id).join(","):"show:-1":null}get layerDefs(){var r;const e=!!((r=this.floors)!=null&&r.length),i=this.visibleSublayers.filter(n=>n.definitionExpression!=null||e&&n.floorInfo!=null);return i.length?JSON.stringify(i.reduce((n,s)=>{const o=z2e(this.floors,s),l=PB(o,s.definitionExpression);return l!=null&&(n[s.id]=l),n},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const i=this.layer.sublayers,r=this.scale,n=o=>{o.visible&&(r===0||Rht(r,o.minScale,o.maxScale))&&(o.sublayers?o.sublayers.forEach(n):e.unshift(o))};i&&i.forEach(n);const s=this._get("visibleSublayers");return!s||s.length!==e.length||s.some((o,l)=>e[l]!==o)?e:s}toJSON(){const e=this.layer;let i={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?i.dynamicLayers=this.dynamicLayers:i={...i,layers:this.layers,layerDefs:this.layerDefs},i}};y([w({readOnly:!0})],Fd.prototype,"dynamicLayers",null),y([w()],Fd.prototype,"floors",void 0),y([w({readOnly:!0})],Fd.prototype,"hasDynamicLayers",null),y([w()],Fd.prototype,"layer",null),y([w({readOnly:!0})],Fd.prototype,"layers",null),y([w({readOnly:!0})],Fd.prototype,"layerDefs",null),y([w({type:Number})],Fd.prototype,"scale",void 0),y([w(vot)],Fd.prototype,"timeExtent",void 0),y([w({readOnly:!0})],Fd.prototype,"version",null),y([w({readOnly:!0})],Fd.prototype,"visibleSublayers",null),Fd=y([Z("esri.layers.mixins.ExportImageParameters")],Fd);const RFt=9999999e31,IFt=2e-7,$Ft={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function hre(t){return $Ft[t]??[-34028234663852886e22,34028234663852886e22]}function Emi(t,e,i){var T,A;if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:n,pixelType:s}=t,o=r[0].length,l=t.bandMasks??[],c=t.mask??new Uint8Array(o).fill(255),f=s==="f32"||s==="f64",_=hre(s);let x=!1;for(let M=0;MI+Number.EPSILON||F=RFt?IFt*Math.abs(I):s==="f32"?2**-23:Number.EPSILON);for(let H=0;H1?l:null,t.mask=c),x&&"updateStatistics"in t&&t.updateStatistics()}function dUe(t){return t==null||t.type==="simple"||t.type==="unique-value"||t.type==="class-breaks"||t.type==="dictionary"||t.type==="heatmap"}function Cmi(t,e){if(t==null)return null;if(!dUe(t))return new se("renderer-conversion-3d:unsupported-renderer",`Unsupported renderer of type '${t.type||t.declaredClass}'`,{renderer:t});switch(t.type){case"simple":return LFt(t);case"unique-value":return DFt(t,e);case"class-breaks":return NFt(t);case"dictionary":case"heatmap":return null}return null}function rue(t,e){if(!e)return null;let i;if(i=Array.isArray(e)?e:[e],i.length>0){const r=i.map(s=>s.details.symbol.type||s.details.symbol.declaredClass).filter(s=>!!s);r.sort();const n=[];return r.forEach((s,o)=>{o!==0&&s===r[o-1]||n.push(s)}),new se("renderer-conversion-3d:unsupported-symbols",`Renderer contains symbols (${n.join(", ")}) which are not supported in 3D`,{renderer:t,symbolErrors:i})}return null}function LFt(t){return rue(t,e5(t.symbol).error)}function DFt(t,e){var s;const i={..._A,...e},r=(s=t.uniqueValueInfos)==null?void 0:s.map(o=>e5(o.symbol,i).error).filter(ys),n=e5(t.defaultSymbol,i);return n.error&&(r==null||r.unshift(n.error)),rue(t,r)}function NFt(t){const e=t.classBreakInfos.map(r=>e5(r.symbol).error).filter(ys),i=e5(t.defaultSymbol);return i.error&&e.unshift(i.error),rue(t,e)}function FFt(t){return Ase(t)||zit(t)||Uit(t)}function kFt(t,e){const{format:i,timeZoneOptions:r,fieldType:n}=e??{};let s,o;if(r&&({timeZone:s,timeZoneName:o}=qWe(r.layerTimeZone,r.datesInUnknownTimezone,r.viewTimeZone,oA(i||"short-date-short-time"),n)),typeof t=="string"&&isNaN(Date.parse(n==="time-only"?`1970-01-01T${t}Z`:t)))return t;switch(n){case"date-only":{const l=oA(i||"short-date");return typeof t=="string"?ZWe(t,{...l}):js(t,{...l,timeZone:Vy})}case"time-only":{const l=oA(i||"short-time");return typeof t=="string"?JWe(t,l):js(t,{...l,timeZone:Vy})}case"timestamp-offset":{if(!s&&typeof t=="string"&&new Date(t).toISOString()!==t)return t;const l=i||r?oA(i||"short-date-short-time"):void 0,c=l?{...l,timeZone:s,timeZoneName:o}:void 0;return typeof t=="string"?KWe(t,c):js(t,c)}default:{const l=i||r?oA(i||"short-date-short-time"):void 0;return js(typeof t=="string"?new Date(t):t,l?{...l,timeZone:s,timeZoneName:o}:void 0)}}}var nl;(function(t){t[t.size=22]="size",t[t.lineWidth=50]="lineWidth",t[t.maxSize=120]="maxSize",t[t.maxOutlineSize=80]="maxOutlineSize",t[t.tallSymbolWidth=20]="tallSymbolWidth"})(nl||(nl={}));const Y$={fill:[{type:"path",path:"M -10,-10 L 10,0 L 10,10 L -10,10 L -10,-10 Z"}],squareFill:[{type:"path",path:"M -10,-10 L 10,-10 L 10,10 L -10,10 L -10,-10 Z"}],meshSymbol3DFill:[{type:"path",path:"M -10,-8 L 6,0 L 6,6 L -10,6 L -10,-8 Z"},{type:"path",path:"M -10,-8 L -7,-10 L 9,-2 L 6,0 L -10,-8 Z"},{type:"path",path:"M 6,0 L 9,-2 L 9,4 L 6,6 L 6,0 Z"}],pathSymbol3DLayer:[{type:"path",path:"M 3,12 L 12,0 L 11,-2 L -4,5 L -1,5 L 1,7 L 3,10 L 3,12 Z"},{type:"circle",cx:-2,cy:10,r:5}],extrudeSymbol3DLayer:[{type:"path",path:"M -7,-5 L -2,0 L -2,7 L -7,3 L -7,-5 Z"},{type:"path",path:"M -2,0 L -2,7 L 10,-3 L 10,-10 L -2,0 Z"},{type:"path",path:"M -7,-5 L -2,0 L 10,-10 L -2,-10 L -7,-5 Z"}],cone:[{type:"path",path:"M 0,-10 L -8,5 L -4,6.5 L 0,7 L 4,6.5 L 8,5 Z"}],tallCone:[{type:"path",path:"M 0,-9 L -3.5,7 L -1.5,7.8 L 0,8 L 1.5,7.8 L 3.5,7 L 0,-9 Z"}],invertedCone:[{type:"path",path:"M 0,7 L -8,-8 L 8,-8 Z"},{type:"path",path:"M -8,-8 L -4,-9.5 L 0,-10 L 4,-9.5 L 8,-8 L 4,-6.5 L 0,-6 L -4,-6.5 Z"}],cube:[{type:"path",path:"M -10,-7 L 0,-12 L 10,-7 L 0,-2 L -10,-7 Z"},{type:"path",path:"M -10,-7 L 0,-2 L 0,12 L -10,7 L -10,-7 Z"},{type:"path",path:"M 0,-2 L 10,-7 L 10,7 L 0,12 L 0,-2 Z"}],tallCube:[{type:"path",path:"M -3.5,-8.5 L 0,-9.5 L 3.5,-8.5 L 0,-7.5 L -3.5,-8.5 Z"},{type:"path",path:"M -3.5,-8.5 L 0,-7.5 L 0,9 L -3.5,8 L -3.5,-8.5 Z"},{type:"path",path:"M 0,-7.5 L 3.5,-8.5 L 3.5,8 L 0,9 L 0,-7.5 Z"}],cylinder:[{type:"path",path:"M -8,-9 L -8,7 L -4,8.5 L 0,9 L 4,8.5 L 8,7 L 8,-9 Z"},{type:"ellipse",cx:0,cy:-9,rx:8,ry:2}],tallCylinder:[{type:"path",path:"M -3.5,-9 L -3.5,7 L -1.5,7.8 L 0,8 L 1.5,7.8 L 3.5,7 L 3.5,-9 Z"},{type:"ellipse",cx:0,cy:-9,rx:3.5,ry:1}],diamond:[{type:"path",path:"M 0,-10 L 10,-1 L -1,1 L 0,-10 Z"},{type:"path",path:"M 0,-10 L -1,1 L -8,-1 L 0,-10 Z"},{type:"path",path:"M -1,1 L 0,10 L -8,-1 L -1,1 Z"},{type:"path",path:"M -1,0 L 0,10 L 10,-1 L -1,1 Z"}],tetrahedron:[{type:"path",path:"M 0,-10 L 10,7 L 0,0 L 0,-10 Z"},{type:"path",path:"M 0,-10 L 0,0 L -8,7 L 0,-10 Z"},{type:"path",path:"M 10,7 L 0,0 L -8,7 L 10,7 Z"}]};function zFt(t,e,i){const r=nl.size;let n=r,s=r;t<1?n*=.75:t>1&&(s*=1.25);const o=0,l=0;let c=r,f=r;return e&&i&&(n=s=c=f=0),[{type:"path",path:[{command:"M",values:[c,o]},{command:"L",values:[i?c:.875*c,o]},{command:"L",values:[i?n-.5*c:l,s-.5*f]},{command:"L",values:[n-.5*c,s-.5*f]},{command:"Z",values:[]}]},{type:"path",path:[{command:"M",values:[c,o]},{command:"L",values:[c,e?o:.125*f]},{command:"L",values:[n-.5*c,e?s-.5*f:f]},{command:"L",values:[n-.5*c,s-.5*f]},{command:"Z",values:[]}]},{type:"path",path:[{command:"M",values:[n-.5*c,s-.5*f]},{command:"L",values:[i?n-.5*c:l,s-.5*f]},{command:"L",values:[i?n-.5*c:l,e?s-.5*f:f]},{command:"L",values:[n-.5*c,e?s-.5*f:f]},{command:"Z",values:[]}]}]}function UFt(t){const e=nl.size,i=.5*t,r=0,n=0;return[{type:"path",path:[{command:"M",values:[n,.7*e*.5]},{command:"L",values:[.3*e,.7*e]},{command:"L",values:[.3*e,.7*e+i]},{command:"L",values:[n,.7*e+i-.7*e*.5]},{command:"Z",values:[]}]},{type:"path",path:[{command:"M",values:[.3*e,.7*e]},{command:"L",values:[.3*e,.7*e+i]},{command:"L",values:[e,i]},{command:"L",values:[e,r]},{command:"Z",values:[]}]},{type:"path",path:[{command:"M",values:[.3*e,r]},{command:"L",values:[e,r]},{command:"L",values:[.3*e,.7*e]},{command:"L",values:[n,.7*e*.5]},{command:"Z",values:[]}]}]}function VFt(){return[{type:"path",path:"M80,80.2v-27c-1.5,0.7-2.8,1.6-3.9,2.8c-1.8,2.1-4.4,3.3-7.1,3.5c-2.7-0.1-5.3-1.4-7.1-3.4c-2.2-2.3-4.7-3.6-7.4-3.6s-5.1,1.3-7.3,3.6c-1.8,2.1-4.4,3.3-7.2,3.4c-2.7-0.1-5.3-1.4-7.1-3.4c-2.2-2.3-4.7-3.6-7.4-3.6s-5.1,1.3-7.4,3.6c-1.8,2.1-4.4,3.3-7.2,3.4C8.3,59.3,5.7,58,3.9,56c-1.1-1.2-2.4-2.1-3.9-2.8v27"},{type:"path",path:"M11,59.4c2.7-0.1,5.3-1.4,7.1-3.4c2.2-2.3,4.7-3.6,7.4-3.6s5.1,1.3,7.4,3.6c1.8,2,4.4,3.3,7.2,3.4c2.7-0.1,5.3-1.4,7.1-3.4c2.2-2.3,4.7-3.6,7.3-3.6s5.1,1.3,7.4,3.6c1.8,2.1,4.4,3.3,7.2,3.4c2.7-0.1,5.3-1.4,7.1-3.4c1.1-1.2,2.4-2.1,3.9-2.8v-24c-1.5,0.7-2.8,1.6-3.9,2.8c-1.8,2.1-4.4,3.3-7.1,3.5c-2.7-0.1-5.3-1.4-7.1-3.4c-2.2-2.3-4.7-3.6-7.4-3.6s-5.1,1.3-7.3,3.6c-1.8,2.1-4.4,3.3-7.2,3.4c-2.7-0.1-5.3-1.4-7.1-3.4c-2.2-2.3-4.7-3.6-7.4-3.6s-5.1,1.3-7.4,3.6c-1.8,2.1-4.4,3.3-7.2,3.4c-2.7-0.1-5.3-1.4-7.1-3.4c-1.1-1.2-2.4-2.1-3.9-2.8v24c1.5,0.7,2.8,1.6,3.9,2.8C5.7,58,8.3,59.3,11,59.4z"},{type:"path",path:"M11,35.4c2.7-0.1,5.3-1.4,7.1-3.4c2.2-2.3,4.7-3.6,7.4-3.6s5.1,1.3,7.4,3.6c1.8,2,4.4,3.3,7.2,3.4c2.7-0.1,5.3-1.4,7.1-3.4c2.2-2.3,4.7-3.6,7.3-3.6s5.1,1.3,7.4,3.6c1.8,2.1,4.4,3.3,7.2,3.4c2.7-0.1,5.3-1.4,7.1-3.4c1.1-1.2,2.4-2.1,3.9-2.8V3.6c-1.5,0.7-2.8,1.6-3.9,2.8c-2.2,2.1-4.6,3.4-7.1,3.4s-5-1.3-7.1-3.4s-4.7-3.6-7.4-3.6s-5.1,1.3-7.3,3.6S42.5,9.9,40,9.9s-5-1.3-7.1-3.4s-4.7-3.6-7.4-3.6s-5.1,1.3-7.3,3.6c-1.8,2.1-4.4,3.3-7.2,3.4c-2.5,0-5-1.3-7.1-3.4C2.8,5.3,1.4,4.3,0,3.6v25.6c1.5,0.7,2.8,1.6,3.9,2.8C5.7,34.1,8.3,35.3,11,35.4z"}]}function BFt(t,e){let i=e?nl.tallSymbolWidth:t;const r=t,n=e?4:6;i<=nl.size?i-=.5*n:i-=n;const s=0,o=0,l=e?.35*i:.5*i;return[{type:"path",path:[{command:"M",values:[.5*i,s]},{command:"L",values:[i,.5*l]},{command:"L",values:[.5*i,l]},{command:"L",values:[o,.5*l]},{command:"Z",values:[]}]},{type:"path",path:[{command:"M",values:[s,.5*l]},{command:"L",values:[.5*i,l]},{command:"L",values:[.5*i,r]},{command:"L",values:[o,r-.5*l]},{command:"Z",values:[]}]},{type:"path",path:[{command:"M",values:[.5*i,l]},{command:"L",values:[.5*i,r]},{command:"L",values:[i,r-.5*l]},{command:"L",values:[i,.5*l]},{command:"Z",values:[]}]}]}function jFt(t,e){let i=e?nl.tallSymbolWidth:t;const r=t,n=e?4:6;i<=nl.size?i-=.5*n:i-=n;const s=.5*i,o=.15*i,l=0,c=r-o;return[{type:"ellipse",cx:.5*i,cy:c,rx:s,ry:o},{type:"path",path:[{command:"M",values:[l,o]},{command:"L",values:[l,c]},{command:"L",values:[i,c]},{command:"L",values:[i,o]},{command:"Z",values:[]}]},{type:"ellipse",cx:.5*i,cy:o,rx:s,ry:o}]}function GFt(t,e){let i=e?nl.tallSymbolWidth:t;const r=t,n=e?4:6;i<=nl.size?i-=.5*n:i-=n;const s=.15*i,o=r-s;return[{type:"ellipse",cx:.5*i,cy:o,rx:.5*i,ry:s},{type:"path",path:[{command:"M",values:[.5*i,0]},{command:"L",values:[i,o]},{command:"L",values:[0,o]},{command:"Z",values:[]}]}]}function HFt(t){let e=t;const i=t,r=6;e=4?"auto":"optimizeLegibility",KFt={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,z:0},QFt=/([A-DF-Za-df-z])|([-+]?\d*[.]?\d+(?:[eE][-+]?\d+)?)/g;let No={},zn={};const V2e={solid:"none",shortdash:[4,1],shortdot:[1,1],shortdashdot:[4,1,1,1],shortdashdotdot:[4,1,1,1,1,1],dot:[1,3],dash:[4,3],longdash:[8,3],dashdot:[4,3,1,3],longdashdot:[8,3,1,3],longdashdotdot:[8,3,1,3,1,3]},ekt=Math.PI;let tkt=1;function qM(t,e){const i=t*(ekt/180);return Math.abs(e*Math.sin(i))+Math.abs(e*Math.cos(i))}function pUe(t){return t.map(e=>`${e.command} ${e.values.join(" ")}`).join(" ").trim()}function nue(t,e,i,r){if(t){if(t.type==="circle")return X("circle",{cx:t.cx,cy:t.cy,fill:e,"fill-rule":"evenodd",r:t.r,stroke:i.color,"stroke-dasharray":i.dashArray,"stroke-dashoffset":i.dashOffset,"stroke-linecap":i.cap,"stroke-linejoin":i.join,"stroke-miterlimit":"4","stroke-width":i.width});if(t.type==="ellipse")return X("ellipse",{cx:t.cx,cy:t.cy,fill:e,"fill-rule":"evenodd",rx:t.rx,ry:t.ry,stroke:i.color,"stroke-dasharray":i.dashArray,"stroke-linecap":i.cap,"stroke-linejoin":i.join,"stroke-miterlimit":"4","stroke-width":i.width});if(t.type==="rect")return X("rect",{fill:e,"fill-rule":"evenodd",height:t.height,stroke:i.color,"stroke-dasharray":i.dashArray,"stroke-linecap":i.cap,"stroke-linejoin":i.join,"stroke-miterlimit":"4","stroke-width":i.width,width:t.width,x:t.x,y:t.y});if(t.type==="image")return X("image",{height:t.height,href:t.src,preserveAspectRatio:"none",width:t.width,x:t.x,y:t.y});if(t.type==="path"){const n=typeof t.path!="string"?pUe(t.path):t.path;return X("path",{d:n,fill:e,"fill-rule":"evenodd",stroke:i.color,"stroke-dasharray":i.dashArray,"stroke-linecap":i.cap,"stroke-linejoin":i.join,"stroke-miterlimit":"4","stroke-width":i.width})}if(t.type==="text")return ky(r),X("text",{"dominant-baseline":r.dominantBaseline,fill:e,"fill-rule":"evenodd","font-family":r.font.family,"font-size":r.font.size,"font-style":r.font.style,"font-variant":r.font.variant,"font-weight":r.font.weight,kerning:r.kerning,rotate:r.rotate,stroke:i.color,"stroke-dasharray":i.dashArray,"stroke-linecap":i.cap,"stroke-linejoin":i.join,"stroke-miterlimit":"4","stroke-width":i.width,"text-anchor":r.align,"text-decoration":r.decoration,"text-rendering":JFt,x:t.x,y:t.y},t.text)}return null}function sue(t){const e={fill:"none",pattern:null,linearGradient:null};if(t){if("type"in t&&t.type==="pattern"){const i="patternId-"+ ++XFt;e.fill=`url(#${i})`,e.pattern={id:i,x:t.x,y:t.y,width:t.width,height:t.height,image:{x:0,y:0,width:t.width,height:t.height,href:t.src}}}else if("type"in t&&t.type==="linear"){const i="linearGradientId-"+ ++ZFt;e.fill=`url(#${i})`,e.linearGradient={id:i,x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,stops:t.colors.map(r=>({offset:r.offset,color:r.color&&new qe(r.color).toString()}))}}else if(t){const i=new qe(t);e.fill=i.toString()}}return e}function oue(t){const e={color:"none",width:1,cap:"butt",join:"4",dashArray:"none",dashOffset:"0"};if(t&&(t.width!=null&&(e.width=t.width),t.cap&&(e.cap=t.cap),t.join&&(e.join=t.join.toString()),t.color&&(e.color=new qe(t.color).toString()),t.dashArray&&(e.dashArray=t.dashArray),t.dashArray&&(e.dashOffset=t.dashoffset),t.style)){let i=null;if(t.style in V2e&&(i=V2e[t.style]),Array.isArray(i)){i=i.slice(0);const r=t.width??0;for(let n=0;nX("stop",{key:`${s}-stop`,offset:n.offset,"stop-color":n.color}));return X("linearGradient",{gradientUnits:"userSpaceOnUse",id:i.id,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2},r)}return null}function ikt(t,e){if(!t||t.length===0)return null;const i=[];for(const r of t){const{shape:n,fill:s,stroke:o,font:l}=r,c=sue(s),f=oue(o),_=n.type==="text"?fUe(n,l):null,x=nue(n,c.fill,f,_);x&&i.push(x)}return X("mask",{id:e,maskUnits:"userSpaceOnUse"},X("g",null,i))}function B2e(t,e,i){return MG(t,CG(t),[e,i])}function j2e(t,e,i,r,n){return Ice(t,CG(t),[e,i]),t[4]=t[4]*e-r*e+r,t[5]=t[5]*i-n*i+n,t}function rkt(t,e,i,r){const n=e%360*Math.PI/180;AG(t,CG(t),n);const s=Math.cos(n),o=Math.sin(n),l=t[4],c=t[5];return t[4]=l*s-c*o+r*o-i*s+i,t[5]=c*s+l*o-i*o-r*s+r,t}function Tu(t,e){No&&"left"in No?(No.left!=null&&No.left>t&&(No.left=t),(No.right==null||No.righte)&&(No.top=e),(No.bottom==null||No.bottom=r&&(n={action:t,args:e.slice(0,e.length-e.length%r)},i.push(n),G2e(n)):(n={action:t,args:[]},i.push(n),G2e(n)))}function nkt(t){const e=(typeof t.path!="string"?pUe(t.path):t.path).match(QFt),i=[];if(No={},zn={},!e)return null;let r="",n=[];const s=e.length;for(let l=0;li?e:i;let U=1,j=1;isNaN(k)||(z>1?(U=k/x,j=k/z/T):(j=k/T,U=k*z/x)),NS(M,M,j2e(A,U,j,f,_)),I=!0}const L=t.x+(x-r)/2,F=t.y+(T-r)/2;if(NS(M,M,B2e(A,f-L,_-F)),!I&&(x>e||T>i)){const z=x/e>T/i,k=(z?e:i)/(z?x:T);NS(M,M,j2e(A,k,k,L,F))}return s&&NS(M,M,rkt(A,s,L,F)),l&&NS(M,M,B2e(A,l[0],l[1])),`matrix(${M[0]},${M[1]},${M[2]},${M[3]},${M[4]},${M[5]})`}function skt(t,e,i){const r=t==null?void 0:t.effects.find(f=>f.type==="bloom");if(!r)return null;const{strength:n,radius:s}=r,o=n>0?s:0,l=(n+o)*e,c=4*n+1;return X("filter",{filterUnits:"userSpaceOnUse",height:"300%",id:`bloom${i}`,width:"300%",x:"-100%",y:"-100%"},X("feMorphology",{in:"SourceGraphic",operator:"dilate",radius:(n+.5*o)*(5**(e/100)*(.4+e/100)),result:"dilate"}),X("feGaussianBlur",{in:"dilate",result:"blur",stdDeviation:l/25}),X("feGaussianBlur",{in:"blur",result:"intensityBlur",stdDeviation:l/50}),X("feComponentTransfer",{in:"SourceGraphic",result:"intensityBrightness"},X("feFuncR",{slope:c,type:"linear"}),X("feFuncG",{slope:c,type:"linear"}),X("feFuncB",{slope:c,type:"linear"})),X("feMerge",null,X("feMergeNode",{in:"intensityBlur"}),X("feMergeNode",{in:"intensityBrightness"}),X("feGaussianBlur",{stdDeviation:n/10})))}function vUe(t,e,i,r={}){var _;const n=[],s=[],o=++tkt,l=skt(r.effectView,e,o);let c=null;if(l){const x=(_=r.effectView)==null?void 0:_.effects.find(I=>I.type==="bloom"),T=(x.strength?x.strength+x.radius/2:0)/3,A=e+e*T,M=i+i*T;c=[Math.max(A,10),Math.max(M,10)]}for(let x=0;x!!o.length))return null;const s=(i==null?void 0:i.node)||document.createElement("div");return i.opacity!=null&&(s.style.opacity=i.opacity.toString()),i.effectView!=null&&(s.style.filter=WL(i.effectView)),okt(s,()=>vUe(t,r,n,i)),s}function akt(t,e){t=Math.ceil(t),e=Math.ceil(e);const i=document.createElement("canvas");i.width=t,i.height=e,i.style.width=t+"px",i.style.height=e+"px";const r=i.getContext("2d");return r.clearRect(0,0,t,e),r}function lkt(t,e,i){return t?bi(t,{responseType:"image"}).then(r=>{const n=r.data,s=n.width,o=n.height,l=s/o;let c=e;if(i){const f=Math.max(s,o);c=Math.min(c,f)}return{image:n,width:l<=1?Math.ceil(c*l):c,height:l<=1?c:Math.ceil(c/l)}}):Promise.reject(new se("renderUtils: imageDataSize","href not provided."))}function ckt(t,e){return!(!t||e==="ignore")&&(e!=="multiply"||t.r!==255||t.g!==255||t.b!==255||t.a!==1)}function ukt(t,e,i,r,n){switch(n){case"multiply":t[e]*=i[0],t[e+1]*=i[1],t[e+2]*=i[2],t[e+3]*=i[3];break;default:{const s=Cj({r:t[e],g:t[e+1],b:t[e+2]});s.h=r.h,s.s=r.s,s.v=s.v/100*r.v;const o=SE(s);t[e]=o.r,t[e+1]=o.g,t[e+2]=o.b,t[e+3]*=i[3];break}}}function hkt(t,e,i,r,n){return lkt(t,e,n).then(s=>{const o=s.width??e,l=s.height??e;if(s.image&&ckt(i,r)){let c=s.image.width,f=s.image.height;Le("edge")&&/\.svg$/i.test(t)&&(c-=1,f-=1);const _=akt(o,l);_.drawImage(s.image,0,0,c,f,0,0,o,l);const x=_.getImageData(0,0,o,l),T=[i.r/255,i.g/255,i.b/255,i.a],A=Cj(i);for(let M=0;M({url:t,width:e,height:e}))}const _Ue="esri-relationship-ramp",XC=`${_Ue}--diamond`,Db=`${_Ue}--square`,dkt="http://www.w3.org/2000/svg",Ts={diamondContainer:`${XC}__container`,diamondLeftCol:`${XC}__left-column`,diamondRightCol:`${XC}__right-column`,diamondMidCol:`${XC}__middle-column`,diamondMidColLabel:`${XC}__middle-column--label`,diamondMidColRamp:`${XC}__middle-column--ramp`,squareTable:`${Db}__table`,squareTableRow:`${Db}__table-row`,squareTableCell:`${Db}__table-cell`,squareTableLabel:`${Db}__table-label`,squareTableLabelLeftBottom:`${Db}__table-label--left-bottom`,squareTableLabelRightBottom:`${Db}__table-label--right-bottom`,squareTableLabelLeftTop:`${Db}__table-label--left-top`,squareTableLabelRightTop:`${Db}__table-label--right-top`};function bUe(t,e,i={}){const{focus:r,labels:n}=t,s=!!r,o=pkt(t,e,i),l={justifyContent:"center"},c=RT();return s?X("div",{class:Ts.diamondContainer,styles:l},X("div",{class:Ts.diamondLeftCol},c?n.right:n.left),X("div",{class:Ts.diamondMidCol},X("div",{class:Ts.diamondMidColLabel},n.top),o,X("div",{class:Ts.diamondMidColLabel},n.bottom)),X("div",{class:Ts.diamondRightCol},c?n.left:n.right)):X("div",{class:Ts.squareTable},X("div",{class:Ts.squareTableRow},X("div",{class:GS(Ts.squareTableCell,Ts.squareTableLabel,Ts.squareTableLabelRightBottom)},c?n.top:n.left),X("div",{class:Ts.squareTableCell}),X("div",{class:GS(Ts.squareTableCell,Ts.squareTableLabel,Ts.squareTableLabelLeftBottom)},c?n.left:n.top)),X("div",{class:Ts.squareTableRow},X("div",{class:Ts.squareTableCell}),o,X("div",{class:Ts.squareTableCell})),X("div",{class:Ts.squareTableRow},X("div",{class:GS(Ts.squareTableCell,Ts.squareTableLabel,Ts.squareTableLabelRightTop)},c?n.right:n.bottom),X("div",{class:Ts.squareTableCell}),X("div",{class:GS(Ts.squareTableCell,Ts.squareTableLabel,Ts.squareTableLabelLeftTop)},c?n.bottom:n.right)))}function W2e(t,e,i){const r=`${i}_arrowStart`,n=`${i}_arrowEnd`,s=t==="left",o={markerStart:null,markerEnd:null};switch(e){case"HL":s?o.markerStart=`url(#${n})`:o.markerEnd=`url(#${r})`;break;case"LL":o.markerStart=`url(#${n})`;break;case"LH":s?o.markerEnd=`url(#${r})`:o.markerStart=`url(#${n})`;break;default:o.markerEnd=`url(#${r})`}return o}function pkt(t,e,i={}){const{focus:r,numClasses:n,colors:s,rotation:o}=t,{opacity:l,effectList:c,ariaLabel:f}=i,_=i.size??60,x=!!r,T=Math.sqrt(_**2+_**2)+(x?0:5),A=[],M=[],I=[],L=(_||75)/n;for(let ce=0;cenull);if(o&&"thumbnail"in o&&((s=o.thumbnail)!=null&&s.url))return o.thumbnail.url}return i}function gX(t,e=1){const i=t.a,r=Cj(t),n=r.h,s=r.s/e,o=100-(100-r.v)/e,{r:l,g:c,b:f}=SE({h:n,s,v:o});return[l,c,f,i]}function CV(t){var e;return t.type==="water"?t.color==null?null:t.color:((e=t.material)==null?void 0:e.color)==null?null:t.material.color}function Pn(t,e=0){const i=CV(t);if(!i){if(t.type==="fill")return null;const n=eAt.r,s=x2(n,e);return[s,s,s,100]}const r=i.toRgba();for(let n=0;n<3;n++)r[n]=x2(r[n],e);return r}async function wUe(t,e){const i=t.style;return i==="none"?null:{type:"pattern",x:0,y:0,src:await QCt(Wr(`esri/symbols/patterns/${i}.png`),e.toCss(!0)),width:5,height:5}}function X2e(t){return t.outline?WM(t):{color:"rgba(0, 0, 0, 1)",width:1.5}}function lue(t,e){const i=CV(t);if(!i)return null;let r="rgba(";return r+=x2(i.r,e)+",",r+=x2(i.g,e)+",",r+=x2(i.b,e)+",",r+i.a+");"}function fre(t,e){const i=lue(t,e);return i?"pattern"in t&&t.pattern!=null&&t.pattern.type==="style"&&t.pattern.style==="none"?null:{color:i,width:Math.min(t.size?Tr(t.size):.75,aue),style:"pattern"in t&&t.pattern!=null&&t.pattern.type==="style"?nce(t.pattern.style):null,cap:"cap"in t?t.cap:null,join:"join"in t?t.join==="miter"?Tr(2):t.join:null}:{}}function U8(t,e,i){const r=i!=null?.75*i:0;return{type:"linear",x1:r?.25*r:0,y1:r?.5*r:0,x2:r||4,y2:r?.5*r:4,colors:[{color:t,offset:0},{color:e,offset:1}]}}function mkt(t){const e=t.depth,i=t.height,r=t.width;return r!==0&&e!==0&&i!==0&&r===e&&r!=null&&i!=null&&r{var L,F;if(A.type!=="icon"&&A.type!=="object")return;const M=A.type==="icon"?A.size&&Tr(A.size):0,I=i||M?Math.ceil(Math.min(i||M,r||Pk)):US;if((L=A==null?void 0:A.resource)!=null&&L.href){const z=fkt(t,A).then(k=>{var H;const U=(H=A==null?void 0:A.material)==null?void 0:H.color,j=ykt(A);return hkt(k,I,U,j,n)}).then(k=>{const U=k.width,j=k.height;return l=Math.max(l,U),c=Math.max(c,j),[{shape:{type:"image",x:0,y:0,width:U,height:j,src:k.url},fill:null,stroke:null}]});o.push(z)}else{let z=I;A.type==="icon"&&_&&i&&(z=I*(M/_));const k=(e==null?void 0:e.symbolConfig)==="tall"||((F=e==null?void 0:e.symbolConfig)==null?void 0:F.isTall)||A.type==="object"&&mkt(A);l=Math.max(l,k?pre:z),c=Math.max(c,z),o.push(Promise.resolve(gkt(A,z,k)))}});const x=await Promise.allSettled(o),T=[];return x.forEach(A=>{A.status==="fulfilled"?T.push(A.value):A.reason&&Ce.getLogger("esri.symbols.support.previewSymbol3D").warn("error while building swatchInfo!",A.reason)}),_6(T,[l,c],{node:e==null?void 0:e.node,scale:!1,opacity:e==null?void 0:e.opacity,ariaLabel:e==null?void 0:e.ariaLabel})}function _kt(t,e){const i=t.symbolLayers,r=[],n=fG(t),s=FG(e),o=(e!=null&&e.maxSize?Tr(e.maxSize):null)||aue;let l,c=0,f=0;return i.forEach((_,x)=>{if(!_||_.type!=="line"&&_.type!=="path")return;const T=[];switch(_.type){case"line":{const A=fre(_,0);if(A==null)break;const M=(A==null?void 0:A.width)||0;x===0&&(l=M);const I=Math.min(s||M,o),L=x===0?I:s?I*(M/l):I,F=L>Y2e/2?2*L:Y2e;f=Math.max(f,L),c=Math.max(c,F),A.width=L,T.push({shape:{type:"path",path:[{command:"M",values:[0,.5*f]},{command:"L",values:[c,.5*f]}]},stroke:A});break}case"path":{const A=Math.min(s||US,o),M=Pn(_,0),I=Pn(_,-.2),L=lue(_,-.4),F=L?{color:L,width:1}:{};if(_.profile==="quad"){const z=_.width,k=_.height,U=zFt(z&&k?z/k:1,k===0,z===0),j={...F,join:"bevel"};T.push({shape:U[0],fill:I,stroke:j},{shape:U[1],fill:I,stroke:j},{shape:U[2],fill:M,stroke:j})}else T.push({shape:Y$.pathSymbol3DLayer[0],fill:I,stroke:F},{shape:Y$.pathSymbol3DLayer[1],fill:M,stroke:F});f=Math.max(f,A),c=f}}r.push(T)}),Promise.resolve(_6(r,[c,f],{node:e==null?void 0:e.node,scale:n,opacity:e==null?void 0:e.opacity,ariaLabel:e==null?void 0:e.ariaLabel}))}async function bkt(t,e){const i=t.type==="mesh-3d",r=t.symbolLayers,n=FG(e),s=e!=null&&e.maxSize?Tr(e.maxSize):null,o=n||US,l=[];let c=0,f=0,_=!1;for(let x=0;x{s[l.value]={label:l.label,fill:Tkt(l.symbol)}});const o=[];for(let l=0;lM+I,0)===100,_=[0];for(let M=0;Mz.addColorStop(H*U,j.toString())),M.fillStyle=z,M.fillRect(0,0,x,T)}else{const z=n?x/t.length:x,k=n?T:T/t.length;let U=0,j=0;for(const H of t)M.fillStyle=H.toString(),M.fillRect(U,j,z,k),U=n?U+z:0,j=n?0:j+k}const F=document.createElement("div");return F.style.width=`${l}px`,F.style.height=`${c}px`,Okt(F,e==null?void 0:e.effectList),F.appendChild(A),F}function Okt(t,e){if(!e)return;t.style.filter=WL(e);const i=e.effects;if(i){for(const r of i)if((r==null?void 0:r.type)==="drop-shadow"){r.offsetX<0?t.style.marginLeft=`${Math.abs(r.offsetX)}px`:t.style.marginRight=`${r.offsetX}px`;break}}}async function SUe(t,e){switch(t.type){case"web-style":{const{previewWebStyleSymbol:i}=await we(()=>import("./previewWebStyleSymbol--GeGTS2s.js"),__vite__mapDeps([]));return i(t,SUe,e)}case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":{const{previewSymbol3D:i}=await we(()=>Promise.resolve().then(()=>xkt),void 0);return i(t,e)}case"simple-marker":case"simple-line":case"simple-fill":case"picture-marker":case"picture-fill":case"text":{const{previewSymbol2D:i}=await we(()=>import("./previewSymbol2D-V05bql6S.js"),__vite__mapDeps([]));return i(t,e)}case"cim":{const{previewCIMSymbol:i}=await we(()=>import("./previewCIMSymbol-ZetpgWRs.js"),__vite__mapDeps([260,231,142,121,122,145,155,230,206]));return i(t,e)}default:return}}function TUe(t){return t&&"opacity"in t?t.opacity*TUe(t.parent):1}async function Mmi(t,e){var k;if(!t)return;const i=t.sourceLayer,r=(e!=null&&e.useSourceLayer?i:t.layer)??i,n=TUe(r);if(t.symbol!=null&&(e==null||e.ignoreGraphicSymbol!==!0)){const U=t.symbol.type==="web-style"?await yAt(t.symbol,{...e,cache:e!=null?e.webStyleCache:null}):t.symbol.clone();return kW(U,null,n),U}const s=(e!=null?e.renderer:null)??(r&&"renderer"in r?r.renderer:null);let o=s&&"getSymbolAsync"in s?await s.getSymbolAsync(t,e):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...e,cache:e!=null?e.webStyleCache:null}):o.clone(),!s||!("visualVariables"in s)||!((k=s.visualVariables)!=null&&k.length))return kW(o,null,n),o;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&(e==null?void 0:e.arcade)==null){const U={...e};U.arcade=await p_(),e=U}const{getColor:l,getOpacity:c,getAllSizes:f,getRotationAngle:_}=await we(()=>Promise.resolve().then(()=>yE),void 0),x=[],T=[],A=[],M=[];for(const U of s.visualVariables)switch(U.type){case"color":x.push(U);break;case"opacity":T.push(U);break;case"rotation":M.push(U);break;case"size":U.target||A.push(U)}const I=!!x.length&&x[x.length-1],L=I?l(I,t,e):null,F=!!T.length&&T[T.length-1];let z=F?c(F,t,e):null;if(n!=null&&(z=z!=null?z*n:n),kW(o,L,z),A.length){const U=f(A,t,e);await mAt(o,U)}for(const U of M)gAt(o,_(U,t,e),U.axis);return o}const Pkt=(t,e)=>{const i=t.featuresTilingScheme.getClosestInfoForScale(t.scale).level;return e!=null&&e.levels?e.levels[i]:null};function Rkt(t,e){if(!t||!("visualVariables"in t)||!t.visualVariables)return null;const i=t.visualVariables.find(n=>n.type==="size"),r=Pkt(e,i);return r?new Yse({field:i.field,minSize:r[2].size,minDataValue:r[2].value,maxSize:r[3].size,maxDataValue:r[3].value}):null}const Ikt=/^-?(\d+)(\.(\d+))?$/i;function $kt(t,e){return t-e}function Lkt(t,e){let i,r;return i=Number(t.toFixed(e)),i0;c||(l=Math.abs(l));const f=AV(o);return c?(f.integer+=l,l>f.fractional?f.fractional=0:f.fractional-=l):(f.fractional+=l,l>f.integer?f.integer=1:f.integer-=l),f}}return{integer:0,fractional:0}}function Rk(t,e,i,r){const n={previous:null,next:null};if(i!=null){const s=t-i,o=e-i-s;n.previous=Math.floor(Math.abs(100*o/s))}if(r!=null){const s=r-t,o=r-e-s;n.next=Math.floor(Math.abs(100*o/s))}return n}function MV(t,e={}){const i=t.slice(0),{tolerance:r=2,strictBounds:n=!1,indexes:s=i.map((o,l)=>l)}=e;s.sort($kt);for(let o=0;oo.type==="color");if(!e)return null;let i=null,r=null;if(e.stops){if(e.stops.length===1)return e.stops[0].color;i=e.stops[0].value,r=e.stops[e.stops.length-1].value}const n=i!=null&&r!=null?i+(r-i)/2:0,{getColor:s}=await we(()=>Promise.resolve().then(()=>yE),void 0);return s(e,n)??null}async function MUe(t,e){const i=t.trailCap,r=t.trailWidth||1,n=e||await mre(t)||t.color;return new Oc({cap:i,color:n,width:r})}function Q2e(t){return t!=null&&typeof t=="object"&&"min"in t&&"max"in t}const zkt=new qe([64,64,64]);function OUe(t,e){const i=[],r=t.length-1;return t.length===5?i.push(0,2,4):i.push(0,r),t.map((n,s)=>i.includes(s)?AUe(n,s,r,e):null)}async function gre(t,e,i){let r=!1,n=[],s=[];if(t.stops){const f=t.stops;n=f.map(_=>_.value),r=f.some(_=>!!_.label),r&&(s=f.map(_=>_.label))}const o=n[0],l=n[n.length-1];if(o==null&&l==null)return null;const c=r?null:OUe(n,i);return(await Promise.all(n.map(async(f,_)=>({value:f,color:t.type==="opacity"?await Ukt(f,t,e):(await we(()=>Promise.resolve().then(()=>yE),void 0)).getColor(t,f),label:r?s[_]:(c==null?void 0:c[_])??""})))).reverse()}async function Ukt(t,e,i){const r=new qe(i??zkt),n=(await we(()=>Promise.resolve().then(()=>yE),void 0)).getOpacity(e,t);return n!=null&&(r.a=n),r}function Vkt(t){let e=!1,i=[],r=[];i=t.map(l=>l.value),e=t.some(l=>!!l.label),e&&(r=t.map(l=>l.label??""));const n=i[0],s=i[i.length-1];if(n==null&&s==null)return null;const o=e?null:OUe(i);return i.map((l,c)=>({value:l,color:PUe(l,t),label:e?r[c]:(o==null?void 0:o[c])??""})).reverse()}function PUe(t,e){const{startIndex:i,endIndex:r,weight:n}=Bkt(t,e);if(i===r)return e[i].color;const s=qe.blendColors(e[i].color,e[r].color,n);return new qe(s)}function Bkt(t,e){let i=0,r=e.length-1;return e.some((n,s)=>t{n===0?i.push({value:e.max,color:new qe(r.toColor),label:"high"}):i.push({value:null,color:new qe(r.toColor),label:""}),n===t.colorRamps.length-1?i.push({value:e.min,color:new qe(r.fromColor),label:"low"}):i.push({value:null,color:new qe(r.fromColor),label:""})});else{let r,n;t&&t.type==="algorithmic"?(r=t.fromColor,n=t.toColor):(r=[0,0,0,1],n=[255,255,255,1]),i=[{value:e.max,color:new qe(n),label:"high"},{value:e.min,color:new qe(r),label:"low"}]}return i}function RUe(t){if(!t.colorStops)return[];const e=[...t.colorStops].filter(r=>{var n;return((n=r.color)==null?void 0:n.a)>0});let i=e.length-1;if(e&&e[0]){const r=e[i];r&&r.ratio!==1&&(e.push(new i$({ratio:1,color:r.color})),i++)}return e.map((r,n)=>{var o,l;let s="";return n===0?s=((o=t.legendOptions)==null?void 0:o.minLabel)||"low":n===i&&(s=((l=t.legendOptions)==null?void 0:l.maxLabel)||"high"),{color:r.color,label:s,ratio:r.ratio}}).reverse()}const yre=30,vre=12,IUe=[255,255,255],$Ue=[200,200,200],YM=[128,128,128],Gkt=20,Hkt=5;function qkt(t){return t.declaredClass==="esri.symbols.SimpleMarkerSymbol"}function Wkt(t){return t.declaredClass==="esri.symbols.PictureMarkerSymbol"}function Ykt(t){return t.declaredClass==="esri.symbols.SimpleLineSymbol"}function Xkt(t){return t.declaredClass==="esri.symbols.TextSymbol"}function Zkt(t,e){const i=t.length-1;return t.map((r,n)=>AUe(r,n,i,e))}async function Jkt(t,e,i,r,n,s,o){const l=e.legendOptions,c=l==null?void 0:l.customValues,f=o||await ezt(t,i),_=e.stops,x=!!f,T=!!c,A=e.minSize!=null&&e.maxSize!=null,M=_&&_.length>1,I=!!e.target;if(!x||!T&&!(A||M&&!I))return;const L=fG(f);let F=!1,z=null,k=null;z=L&&!M?MV([e.minDataValue,e.maxDataValue]):c??await izt(e,f,r,n==null?void 0:n.type);const U=t==null?void 0:t.authoringInfo,j=(U==null?void 0:U.type)==="univariate-color-size",H=j&&(U==null?void 0:U.univariateTheme)==="above-and-below";if(!z&&M&&(z=_.map(re=>re.value),F=_.some(re=>!!re.label),t.type==="flow"&&(z=MV(z)),F&&(k=_.map(re=>re.label))),L&&z!=null&&(z==null?void 0:z.length)>2&&!H&&(z=[z[0],z[z.length-1]]),!z)return null;j&&(z==null?void 0:z.length)!==5&&(z=NUe({minSize:z[0],maxSize:z[z.length-1]}));const Y=L?Kkt(t,z):null,Q=rAt(f),ne=F?null:Zkt(z,s);return(await Promise.all(z.map(async(re,he)=>{const ce=L?Y[he]:await sM(e,f,re,r,n==null?void 0:n.type);return{value:re,symbol:szt(H&&t.type==="class-breaks"?Qkt(t,he):f,ce),label:F?k[he]:ne[he],size:ce,outlineSize:Q}}))).reverse()}function Kkt(t,e){const i=t==null?void 0:t.authoringInfo,r=(i==null?void 0:i.type)==="univariate-color-size";let n=[vre,yre];if(r){const s=e[0],o=e[e.length-1],l=vre,c=yre;n=e.map(f=>l+(f-s)/(o-s)*(c-l))}return r&&(i==null?void 0:i.univariateTheme)==="below"&&n.reverse(),n}function Qkt(t,e){const i=t.classBreakInfos,r=i.length,n=r<2||!(e>=2)?i[0].symbol.clone():i[r-1].symbol.clone();return t.visualVariables.some(s=>s.type==="color")&&(n.type.includes("3d")?LUe(n):DUe(n)),n}async function ezt(t,e){var n,s;if(t.type==="flow")return MUe(t,e);if(t.type==="pie-chart")return new cu({color:null,outline:(n=t.outline)!=null&&n.width?t.outline:new Oc});let i=null,r=null;if(t.type==="simple")i=t.symbol;else if(t.type==="class-breaks"){const o=t.classBreakInfos;i=o&&o[0]&&o[0].symbol,r=o.length>1}else if(t.type==="unique-value"){const o=t.uniqueValueInfos;i=(s=o==null?void 0:o[0])==null?void 0:s.symbol,r=o!=null&&o.length>1}return!i||tzt(i)?null:(i=i.clone(),(e||r)&&(i.type.includes("3d")?LUe(i):DUe(i)),i)}function tzt(t){return t?Hy(t)?!!t.symbolLayers&&t.symbolLayers.some(e=>e&&e.type==="fill"):t.type.includes("fill"):!1}function LUe(t){t.type==="line-3d"?t.symbolLayers.forEach(e=>{e.material={color:YM}}):t.symbolLayers.forEach(e=>{var i;e.type!=="icon"||(i=e.resource)!=null&&i.href?e.material={color:$Ue}:(e.material={color:IUe},e.outline={color:YM,size:1.5})})}function DUe(t){var i,r;const e=_ze();t.type==="cim"?i8e(t,new qe($Ue)):t.type.includes("line")?t.color=YM:(t.color=e?YM:IUe,t.type==="simple-marker"&&(t.outline?((r=(i=t.outline)==null?void 0:i.color)==null?void 0:r.toHex())==="#ffffff"&&(t.outline.color=YM):t.outline={color:YM,width:1.5}))}async function izt(t,e,i,r){const n=(await we(()=>Promise.resolve().then(()=>yE),void 0)).getSizeRangeAtScale(t,i,r),s=n&&NUe(n);if(!n||!s)return;let o=s.map(l=>rzt(l,t,n));o=MV(o);for(let l=1;l=n?l=o:l=(t-r)/(n-r)*(o-s)+s,l}async function nzt(t,e,i,r,n,s){const o=await sM(t,e,i,n,s),l=await sM(t,e,r,n,s),c=AV(i),f=c.fractional,_=Gkt;let x=c.integer,T=null,A=null;i>0&&i<1&&(T=10**f,x=AV(i*=T).integer);for(let M=x-1;M>=0;M--){const I=10**M;let L=Math.floor(i/I)*I,F=Math.ceil(i/I)*I;T!=null&&(L/=T,F/=T);let z=(L+F)/2;[,z]=MV([L,z,F],{indexes:[1]});const k=await sM(t,e,L,n,s),U=await sM(t,e,F,n,s),j=await sM(t,e,z,n,s),H=Rk(o,k,l,null),Y=Rk(o,U,l,null),Q=Rk(o,j,l,null);let ne=H.previous<=_,re=Y.previous<=_;if(ne&&re&&(H.previous<=Y.previous?(ne=!0,re=!1):(re=!0,ne=!1)),ne?A=[L,k]:re?A=[F,U]:Q.previous<=_&&(A=[z,j]),A)break}return A}async function sM(t,e,i,r,n){const{getSize:s}=await we(()=>Promise.resolve().then(()=>yE),void 0);return s(t,i,{scale:r,view:n,shape:e.type==="simple-marker"?e.style:null})}function szt(t,e){const i=t.clone();if(Hy(i))fG(i)||i.symbolLayers.forEach(r=>{r.type!=="fill"&&(r.size=e)});else if(qkt(i))i.size=e;else if(Wkt(i)){const r=i.width,n=i.height;i.height=e,i.width=e*(r/n)}else Ykt(i)?i.width=e:Xkt(i)&&i.font&&(i.font.size=e);return i}Ce.getLogger("esri.renderers.support.utils");async function Md(t,e,i){XV(t,e,()=>[]).push(...i)}async function Omi(t){var i,r;const e=new Map;if(!t)return e;if("visualVariables"in t&&t.visualVariables){const n=t.visualVariables.filter(s=>s.type==="color");for(const s of n){const o=(await gre(s)??[]).map(l=>l.color);await Md(e,s.field||s.valueExpression,o)}}if(t.type==="heatmap"){const n=RUe(t).map(s=>s.color);await Md(e,t.field||t.valueExpression,n)}else if(t.type==="pie-chart"){for(const n of t.attributes)await Md(e,n.field||n.valueExpression,[n.color]);await Md(e,"default",[(i=t==null?void 0:t.othersCategory)==null?void 0:i.color,_C(t.backgroundFillSymbol,null)])}else if(t.type==="dot-density"){for(const n of t.attributes)await Md(e,n.field||n.valueExpression,[n.color]);await Md(e,"default",[t.backgroundColor])}else if(t.type==="unique-value")if(((r=t.authoringInfo)==null?void 0:r.type)==="predominance")for(const n of t.uniqueValueInfos??[])await Md(e,n.value.toString(),[_C(n.symbol,null)]);else{const n=(t.uniqueValueInfos??[]).map(f=>_C(f.symbol,null)),{field:s,field2:o,field3:l,valueExpression:c}=t;(s||c)&&await Md(e,s||c,n),o&&await Md(e,o,n),l&&await Md(e,l,n)}else if(t.type==="class-breaks"){const n=t.classBreakInfos.map(l=>_C(l.symbol,null)),{field:s,valueExpression:o}=t;await Md(e,s??o,n)}else t.type==="simple"&&await Md(e,"default",[_C(t.symbol,null)]);return"defaultSymbol"in t&&t.defaultSymbol&&await Md(e,"default",[_C(t.defaultSymbol,null)]),e.forEach((n,s)=>{const o=c9(n.filter(Boolean),(l,c)=>JSON.stringify(l)===JSON.stringify(c));e.set(s,o)}),e}function ozt(t){const i=Math.floor(Math.log10(Math.abs(t)))+1,r=i<4||i>6?4:i,n=1e6,s=Math.abs(t)>=n?"compact":"standard";return nd(t,{notation:s,minimumSignificantDigits:2,maximumSignificantDigits:r})}const azt="https://utility.arcgis.com/sharing/tools/legend",lzt="esri.layers.ImageryLayer",czt="esri.layers.ImageryTileLayer",uzt="esri.layers.WCSLayer",V8=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i,hzt=new yn({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),B8=new cu({size:6,outline:{color:[128,128,128,.5],width:.5}}),dzt=new Bm({style:"solid"});function _re(t){return t.type==="flow"}function FUe(t){return t.type==="vector-field"}function kUe(t){return t.type==="raster-colormap"}function zUe(t){return t.type==="raster-stretch"}function UUe(t){return t.type==="raster-shaded-relief"}function oM(t){return t.declaredClass==="esri.renderers.SimpleRenderer"}function aM(t){return t.declaredClass==="esri.renderers.ClassBreaksRenderer"}function Ik(t){return t.declaredClass==="esri.renderers.UniqueValueRenderer"}function VUe(t){return t.declaredClass==="esri.renderers.HeatmapRenderer"}function pzt(t){return cue(t)||uue(t)||hue(t)||fzt(t)}function fzt(t){return t.declaredClass==="esri.renderers.PointCloudRGBRenderer"}function cue(t){return t.declaredClass==="esri.renderers.PointCloudClassBreaksRenderer"}function uue(t){return t.declaredClass==="esri.renderers.PointCloudStretchRenderer"}function hue(t){return t.declaredClass==="esri.renderers.PointCloudUniqueValueRenderer"}function BUe(t){return t.declaredClass==="esri.renderers.DotDensityRenderer"}function jUe(t){return t.declaredClass==="esri.renderers.PieChartRenderer"}function mzt(t,e){return oM(t)||aM(t)||Ik(t)||VUe(t)||BUe(t)||jUe(t)?e.type==="2d"||dUe(t):zUe(t)||kUe(t)||UUe(t)||cue(t)||uue(t)||hue(t)||FUe(t)||_re(t)}function gzt(t){return t.declaredClass==="esri.layers.BuildingSceneLayer"}function yX(t){return t.declaredClass==="esri.layers.SubtypeGroupLayer"}function yzt(t){return t.declaredClass==="esri.layers.VoxelLayer"}function vzt(t){return t.declaredClass==="esri.layers.WMSLayer"}function _zt(t){return t.declaredClass==="esri.layers.WMTSLayer"}function vX(t){return t.declaredClass==="esri.layers.MapImageLayer"}function exe(t){return t.declaredClass==="esri.layers.TileLayer"}function JC(t){return t.declaredClass===lzt}function j8(t){return t.declaredClass===czt}function bzt(t){return t.declaredClass===uzt}function wzt(t){return t.type==="stretch-ramp"}function xzt(t){const e="authoringInfo"in t?t==null?void 0:t.authoringInfo:null;return(e==null?void 0:e.type)==="univariate-color-size"}function Szt(t){const e="authoringInfo"in t?t==null?void 0:t.authoringInfo:null;return(e==null?void 0:e.type)==="univariate-color-size"&&(e==null?void 0:e.univariateTheme)==="above-and-below"}function txe(t){return"sublayers"in t}async function L1(t,e){const i=await lE("esri/widgets/Legend/t9n/Legend");return t!=="previewTemplateAriaLabel"||e||(t="previewAriaLabel"),By(i[t],{label:e})}const Tzt=new cu({style:"path",path:"M10,5 L5,0 0,5 M5,0 L5,15",size:15,outline:{width:1,color:[85,85,85,1]}});let KC={},ka=class extends ze{constructor(t){super(t),this._hasColorRamp=!1,this._hasOpacityRamp=!1,this._hasSizeRamp=!1,this._webStyleSymbolCache=new Map,this._dotDensityUrlCache=new Map,this._scaleDrivenSizeVariable=null,this._hasClusterSizeVariable=!1,this.children=new it,this.layerView=null,this.layer=null,this.legendElements=[],this.parent=null,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerVisibility=!0,this.sublayerIds=[],this.title=null,this.view=null}initialize(){const t=()=>this.notifyChange("ready");this.addHandles([Jr(()=>this.children,"change",e=>{const{added:i,removed:r}=e;i.forEach(n=>{const s=`activeLayerInfo-ready-watcher-${n.layer.uid}`;this.addHandles(_e(()=>n.ready,t,ii),s)}),r.forEach(n=>this.removeHandles(n.layer.uid)),t()})]),this.keepCacheOnDestroy||(KC={})}destroy(){this._webStyleSymbolCache=null,this._dotDensityUrlCache=null,this._scaleDrivenSizeVariable=null,this.keepCacheOnDestroy||(KC=null)}get effectList(){const t=this.layer;let e=null;return"effect"in t&&t.effect&&(e=new jg,e.effect=t.effect,e.endTransitions(),e.scale=this.scale),e}get opacity(){var n;const t=this.layer.opacity,e=(n=this.parent)==null?void 0:n.opacity,i=this.layer.parent,r=i&&"uid"in i?this._getParentLayerOpacity(i):null;return e!=null?e*t:r!=null?r*t:t}get ready(){return this.layer===null||(this.children.length>0?this._isGroupActive():this.legendElements.length>0)}get scale(){var t;return((t=this.view)==null?void 0:t.scale)??0}get isScaleDriven(){const t=this.layer;if(t===null)return!1;if("effect"in t&&t.effect&&Array.isArray(t.effect))return!0;if("featureReduction"in t&&t.featureReduction){if(t.featureReduction.type==="cluster")return!0;if(t.featureReduction.type==="binning"&&"renderer"in t.featureReduction&&t.featureReduction.renderer)return this._isRendererScaleDriven(t.featureReduction.renderer)}return"renderer"in t&&t.renderer?this._isRendererScaleDriven(t.renderer):this._isLayerScaleDriven(this.layer)}get version(){return this._get("version")+1}async buildLegendElementsForFeatureCollections(t){if(!(!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView()))return this.legendElements=[],void this.notifyChange("ready");const e=Array.from(t,i=>{var r;if(W7(i))return this._getRendererLegendElements(i.renderer,{title:i.title});if((r=i.featureSet)!=null&&r.features.length){const n=i.layerDefinition,s=n==null?void 0:n.drawingInfo,o=s&&kst(s.renderer),l=hzt.read(n.geometryType);return o?this._getRendererLegendElements(o,{title:i.name,geometryType:l}):(Ce.getLogger(this).warn("drawingInfo not available!"),null)}return null});try{const i=[],r=await Promise.allSettled(e);for(const n of r)if(n.status==="fulfilled")for(const s of n.value??[])i.push(s);this.legendElements=i,this.notifyChange("ready")}catch(i){Ce.getLogger(this).warn("error while building legend for layer!",i)}}async buildLegendElementsForRenderer(t){try{const e=!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView();this.legendElements=e?await this._getRendererLegendElements(t):[],this.notifyChange("ready")}catch(e){Ce.getLogger(this).warn("error while building legend for layer!",e)}}async buildLegendElementsForFeatureReduction(t){try{const e=!this.hideLayersNotInCurrentView||await this._isLayerInCurrentView();this.legendElements=e?await this._getLegendElementsForFeatureReduction(t):[],this.notifyChange("ready")}catch(e){Ce.getLogger(this).warn("error while building legend for layer!",e)}}async buildLegendElementsForTools(){var e,i;const t=this.layer;if(yzt(t))this._constructLegendElementsForVoxellayer();else if(_zt(t))this._constructLegendElementsForWMTSlayer();else if(vzt(t))await this._constructLegendElementsForWMSSublayers();else if(gzt(t))await this._constructLegendElementsForBuildingSceneLayer();else if(vX(t)||exe(t)||yX(t))await this._constructLegendElementsForSublayers();else{this.removeHandles("imageryLayers-watcher");let r="default";if(JC(t)){const n=t;r=(((e=n==null?void 0:n.rasterFunction)==null?void 0:e.functionName)||"default")+"_"+((i=t.bandIds)!=null&&i.length?t.bandIds.join(""):"###")}await this._getLegendLayers(`${t.uid}-${r}`).then(async n=>{this.legendElements=[],this.notifyChange("ready");const s=n.map(async o=>{if(JC(t)||j8(t)){const c=_e(()=>["renderingRule"in t&&t.rasterFunction,t.bandIds],()=>X5(async()=>{KC.default=null,t.renderer?await this.buildLegendElementsForRenderer(t.renderer):await this.buildLegendElementsForTools()})());this.addHandles(c,"imageryLayers-watcher")}const l=this._generateSymbolTableElementForLegendLayer(o);l&&l.infos.length&&(JC(t)&&(l.title=t.title),this.legendElements.push(l)),this.notifyChange("ready")});await Promise.allSettled(s)}).catch(n=>{Ce.getLogger(this).warn("Request to server for legend has failed!",n)})}}async _isLayerInCurrentView(){const t=this.layer,e=this.layerView,i=e&&"createQuery"in e&&"queryFeatureCount"in e;if(!i&&!(e&&"createQuery"in t&&"queryFeatureCount"in t))return!0;await rd(()=>!e.updating);const r=i?"createQuery"in e&&e.createQuery():"createQuery"in t&&t.createQuery();return r?(r.geometry=this.view.extent,(i?"queryFeatureCount"in e&&await e.queryFeatureCount(r):"queryFeatureCount"in t&&await t.queryFeatureCount(r))!==0):!0}_getParentLayerOpacity(t){let e=1;const i=t.parent;return i&&"uid"in i&&(e=this._getParentLayerOpacity(i)),t.opacity*e}_isGroupActive(){const t=this.children;return!!t.length&&t.some(e=>e.ready)}_isRendererScaleDriven(t){if(t.type==="dot-density")return!0;const e="valueExpression"in t?t.valueExpression:null;if(V8.test(e))return!0;const i="visualVariables"in t?t.visualVariables:null;return!!(i!=null&&i.some(r=>this._isScaleDrivenSizeVariable(r)))||this._hasScaleDrivenSymbols(t)}_hasScaleDrivenSymbols(t){var e;switch(t.type){case"simple":return this._isScaleDrivenSymbol(t.symbol);case"class-breaks":return this._isScaleDrivenSymbol(t.defaultSymbol)||t.classBreakInfos.some(i=>this._isScaleDrivenSymbol(i.symbol));case"unique-value":return this._isScaleDrivenSymbol(t.defaultSymbol)||!!((e=t.uniqueValueInfos)!=null&&e.some(i=>this._isScaleDrivenSymbol(i.symbol)))}return!1}_isScaleDrivenSymbol(t){if((t==null?void 0:t.type)==="cim"){const{primitiveOverrides:e,minScale:i,maxScale:r}=t.data,n=(e==null?void 0:e.some(s=>{var o;return/\$view\.scale/.test(((o=s.valueExpressionInfo)==null?void 0:o.expression)||"")}))??!1;return i!=null||r!=null||n}return!1}_isScaleDrivenSizeVariable(t){if(t&&t.type!=="size")return!1;const e=t,i=e.minSize,r=e.maxSize;return!(typeof i!="object"||!i||!this._isScaleDrivenSizeVariable(i))||!(typeof r!="object"||!r||!this._isScaleDrivenSizeVariable(r))||!!e.expression||V8.test(e.valueExpression)}_isLayerScaleDriven(t){if("minScale"in t&&t.minScale>0||"maxScale"in t&&t.maxScale>0)return!0;if("sublayers"in t&&t.sublayers)return t.sublayers.some(i=>this._isLayerScaleDriven(i));const e=t.parent;if(t.loaded===!1&&e&&vX(e)&&"source"in t&&t.source&&t.source.type==="map-layer"){for(const i of e.sourceJSON.layers??[])if(i.id===t.source.mapLayerId&&(i.minScale>0||i.maxScale>0))return!0}return!1}async _constructLegendElementsForVoxellayer(){var s;this.legendElements=[],this.removeHandles("voxel-style-watcher"),this.removeHandles("voxel-current-variable");const t=this.layer;this.addHandles(_e(()=>t.currentVariableId,()=>this._constructLegendElementsForVoxellayer()),"voxel-current-variable"),this.addHandles(_e(()=>t.getVariableStyles(),()=>this._constructLegendElementsForVoxellayer()),"voxel-style-watcher");const e=t.getVariableStyle(null),i=[];if(e){if((s=e.uniqueValues)!=null&&s.length){const o=[];e.uniqueValues.forEach(l=>{l.enabled&&o.push({label:l.label||`${l.value}`,value:l.value,symbol:new Bm({color:l.color,outline:null})})}),o.length&&i.push({type:"symbol-table",title:e.label,infos:o})}else if(e.transferFunction){const{colorStops:o,stretchRange:l}=e.transferFunction,c=o.toArray().reverse(),f=l.map((x,T)=>`${T===0?EUe:CUe} ${ozt(x)}`).reverse(),_=c.map(x=>({color:x.color,value:null,label:null}));_[0].label=f[0],_[_.length-1].label=f[1],i.push({type:"color-ramp",title:e.label,infos:_,preview:uS(c.map(x=>x.color),{ariaLabel:await L1("previewColorRampAriaLabel")})})}}const r=t.opacity,n=i.reduce((o,l)=>[...o,...this._getAllInfos(l)],[]).filter(o=>!!(o!=null&&o.symbol)).map(o=>this._getSymbolPreview(o,r));await Promise.allSettled(n),this.legendElements=i,this.notifyChange("ready")}_constructLegendElementsForWMTSlayer(){this.legendElements=[],this.removeHandles("wmts-activeLayer-watcher");const t=this.layer.activeLayer;if(this.addHandles(_e(()=>{const{layer:e}=this;return e&&"activeLayer"in e&&e.activeLayer},()=>this._constructLegendElementsForWMTSlayer()),"wmts-activeLayer-watcher"),t.styleId&&t.styles){let e=null;t.styles.some(i=>t.styleId===i.id&&(e=i.legendUrl,!0)),e&&(this.legendElements=[{type:"symbol-table",title:t.title,infos:[{src:e,opacity:this.opacity}]}])}this.notifyChange("ready")}async _constructLegendElementsForWMSSublayers(){this.legendElements=[],this.removeHandles("wms-sublayers-watcher");const t=this.layer;let e=null;(t.customParameters||t.customLayerParameters)&&(e={...t.customParameters,...t.customLayerParameters}),this.addHandles(_e(()=>{const{layer:i}=this;return i&&"sublayers"in i&&i.sublayers},()=>this._constructLegendElementsForWMSSublayers()),"wms-sublayers-watcher"),this.legendElements=await this._generateLegendElementsForWMSSublayers(t.sublayers,e),this.notifyChange("ready")}async _generateLegendElementsForWMSSublayers(t,e){const i=[];this.addHandles(t.on("change",()=>this._constructLegendElementsForWMSSublayers()),"wms-sublayers-watcher");const r=t.toArray();for(const n of r){const s=_e(()=>[n.title,n.visible,n.legendEnabled],()=>this._constructLegendElementsForWMSSublayers());if(this.addHandles(s,"wms-sublayers-watcher"),!this.respectLayerVisibility||n.visible&&n.legendEnabled){const o=await this._generateSymbolTableElementForWMSSublayer(n,e);o!=null&&o.infos.length&&i.unshift(o)}}return i}async _generateSymbolTableElementForWMSSublayer(t,e){if(!t.legendUrl&&t.sublayers){const i=(await this._generateLegendElementsForWMSSublayers(t.sublayers,e)).filter(r=>r);return{type:"symbol-table",title:t.title,infos:i}}return this._generateSymbolTableElementForLegendUrl(t,e)}async _generateSymbolTableElementForLegendUrl(t,e){var o;let i=t.legendUrl;if(!i)return;const r={type:"symbol-table",title:t.title||t.name||String(t.id??""),infos:[]};e&&(i=tO(i,e));let n=null;const s=(o=t.layer)==null?void 0:o.opacity;try{n=(await bi(i,{responseType:"image"})).data,n&&(n.style.opacity=s)}catch{}return r.infos.push({src:i,preview:n,opacity:s}),r}_getLegendLayers(t,e){const i=KC&&KC[t];return i?Promise.resolve(i):this._legendRequest(e).then(r=>{const n=r.layers;return KC[t]=n,n})}_legendRequest(t){var n;const e=this.layer;let i={f:"json",dynamicLayers:t};if(JC(e)){const s=e.exportImageServiceParameters.rasterFunction;if(s&&(i.renderingRule=JSON.stringify(((n=s.functionDefinition)==null?void 0:n.toJSON())||s.toJSON())),e.bandIds&&(i.bandIds=e.bandIds.join()),e.raster||e.viewId||e.customParameters){const{raster:o,viewId:l,customParameters:c}=e;i={raster:o,viewId:l,...i,...c}}}let r=e.url.replace(/(\/)+$/,"");if("version"in e&&+e.version>=10.01){const s=r.indexOf("?");s>-1?r=r.substring(0,s)+"/legend"+r.substring(s):r+="/legend"}else{const s=r.toLowerCase().indexOf("/rest/"),o=r.substring(0,s)+r.substring(s+5,r.length);r=azt+"?soapUrl="+encodeURI(o)+"&returnbytes=true"}return bi(r,{query:i}).then(s=>s.data)}async _constructLegendElementsForBuildingSceneLayer(){this.legendElements=[],this.removeHandles("sublayers-watcher");const t=this.layer;this.addHandles(_e(()=>t.sublayers,()=>this._constructLegendElementsForBuildingSceneLayer()),"sublayers-watcher");try{this.legendElements=await this._generateLegendElementsForBuildingSublayers(t.sublayers,this.opacity),this.notifyChange("ready")}catch(e){Ce.getLogger(this).warn("Request to server for legend has failed!",e)}}async _generateLegendElementsForBuildingSublayers(t,e){let i=[];this.addHandles(t.on("change",()=>this._constructLegendElementsForBuildingSceneLayer()),"sublayers-watcher");const r=t.toArray();for(const n of r){const s=_e(()=>["renderer"in n&&n.renderer,n.opacity,n.title,n.visible],()=>this._constructLegendElementsForBuildingSceneLayer());if(this.addHandles(s,"sublayers-watcher"),!this.respectLayerVisibility||n.visible){const o=(n==null?void 0:n.opacity)!=null?n.opacity:null,l=o!=null?o*e:e;if(n.type==="building-group"){const c={type:"symbol-table",title:n.title,infos:[]},f=await this._generateLegendElementsForBuildingSublayers(n.sublayers,l);c.infos.push(...f),i=[c,...i]}else n.renderer&&(i=[...await this._getRendererLegendElements(n.renderer,{title:n.title,opacity:l,sublayer:n}),...i])}}return i.filter(n=>!!n&&(!("infos"in n)||!n.infos||n.infos.length>0))}async _constructLegendElementsForSublayers(){this.legendElements=[],this.removeHandles("sublayers-watcher");const t=this.layer;if(vX(t)||exe(t)||yX(t)){this.addHandles(_e(()=>t.sublayers,()=>this._constructLegendElementsForSublayers),"sublayers-watcher");try{this.legendElements=await this._generateLegendElementsForSublayers(t.sublayers,this.opacity),this.notifyChange("ready")}catch(e){Ce.getLogger(this).warn("Request to server for legend has failed!",e)}}}async _generateLegendElementsForSublayers(t,e,i){const r=this.layer;let n=[];this.addHandles(t.on("change",()=>this._constructLegendElementsForSublayers()),"sublayers-watcher");let s=t.toArray();!i&&this.sublayerIds&&this.sublayerIds.length&&(s=yX(r)?this.sublayerIds.map(o=>r.findSublayerForSubtypeCode(o)).filter(ys):this.sublayerIds.map(o=>r.findSublayerById(o)).filter(ys));for(const o of s){const l=_e(()=>[o.renderer,o.opacity,o.title,o.visible,o.legendEnabled],()=>this._constructLegendElementsForSublayers());if(this.addHandles(l,"sublayers-watcher"),!this.respectLayerVisibility||o.visible&&o.legendEnabled&&this._isSublayerInScale(o)){const c=(o==null?void 0:o.opacity)!=null?o.opacity:null,f=c!=null?c*e:e,_=!txe(o)||o.originIdOf("renderer")>Di.SERVICE&&!o.sublayers;if(o.renderer&&_)await o.load(),n=[...await this._getRendererLegendElements(o.renderer,{title:o.title,opacity:f,sublayer:o}),...n];else if(txe(o)){const x=await this._generateSymbolTableElementForSublayer(o,f,i);x&&n.unshift(x)}}}return n.filter(o=>!!o&&(!("infos"in o)||!o.infos||o.infos.length>0))}async _generateSymbolTableElementForSublayer(t,e,i){if(!i){i=new Map;const n=this.layer,s=t.source;let o=null;if(!(!s||s.type==="map-layer"&&s.mapLayerId===t.id&&(!s.gdbVersion||s.gdbVersion===("gdbVersion"in n&&n.gdbVersion)))||t.originIdOf("renderer")>Di.SERVICE||t.originIdOf("labelingInfo")>Di.SERVICE||t.originIdOf("labelsVisible")>Di.SERVICE){const c=new Fd({layer:this.layer});o=c.hasDynamicLayers?c.dynamicLayers:null,c.destroy()}const l=o||`${n.uid}-default`;(await this._getLegendLayers(l,o)).forEach(c=>i.set(c.layerId,c))}const r=i.get(t.id);if((!r||r!=null&&r.subLayerIds&&r.defaultVisibility)&&t.sublayers){const n=await this._generateLegendElementsForSublayers(t.sublayers,e,i);return{type:"symbol-table",title:t.title,infos:n}}return this._generateSymbolTableElementForLegendLayer(r,t,e)}_generateSymbolTableElementForLegendLayer(t,e,i){if(!(t!=null&&t.legend)||this.respectLayerVisibility&&!this._isLegendLayerInScale(t,e))return null;const r=e==null?void 0:e.renderer;let n=(e==null?void 0:e.title)||t.layerName;if(r&&(!e||(e==null?void 0:e.originIdOf("renderer"))>Di.SERVICE)){const l=(e==null?void 0:e.title)||this._getRendererTitle(r,e);l&&(n&&typeof l!="string"&&"title"in l&&(l.title=n),n=l)}const s={type:"symbol-table",title:n,legendType:t.legendType||null,infos:[]},o=e?this._sanitizeLegendForSublayer(t.legend.slice(),e):t.legend;return t.legendGroups&&t.legendGroups.length>0?t.legendGroups.forEach(l=>{var f;const c={type:"symbol-table",title:l.heading,legendType:t.legendType||null,infos:this._generateSymbolTableElementInfosForLegendLayer(o.filter(_=>_.groupId===l.id),t.layerId,i)};((f=c.infos)==null?void 0:f.length)>0&&s.infos.push(c)}):s.infos=this._generateSymbolTableElementInfosForLegendLayer(o,t.layerId,i),s.infos.length>0?s:null}_generateSymbolTableElementInfosForLegendLayer(t,e,i){return t.map(r=>{let n=r.url;if(r.imageData&&r.imageData.length>0)n=`data:image/png;base64,${r.imageData}`;else{if(n.indexOf("http")===0)return null;n=ZYe(`${this.layer.url}/${e}/images/${n}`)}return{label:r.label,src:n,opacity:i??this.opacity,width:r.width,height:r.height}}).filter(ys)}_isSublayerInScale(t){const e=t.minScale||0,i=t.maxScale||0;return!(e>0&&ethis.scale)}_isLegendLayerInScale(t,e){const i=e||this.layer;let r=null,n=null,s=!0;return!i.minScale&&i.minScale!==0||!i.maxScale&&i.maxScale!==0?(t.minScale===0&&i.tileInfo&&(r=i.tileInfo.lods[0].scale),t.maxScale===0&&i.tileInfo&&(n=i.tileInfo.lods[i.tileInfo.lods.length-1].scale)):(r=Math.min(i.minScale,t.minScale)||i.minScale||t.minScale,n=Math.max(i.maxScale,t.maxScale)),(r>0&&rthis.scale)&&(s=!1),s}_sanitizeLegendForSublayer(t,e){if("version"in this.layer&&+this.layer.version<10.1||t.length===0)return t;const i=e.renderer,r=t.some(o=>o.values);let n=0,s=null;return r&&t.some((o,l)=>(o.values||(n=l,s=o,s.label||(s.label="others")),s!=null)),i?i.type==="unique-value"?s&&(t.splice(n,1),t.push(s)):i.type==="class-breaks"&&(s&&t.splice(n,1),t.reverse(),s&&t.push(s)):s&&(t.splice(n,1),t.push(s)),t}async _getRendererLegendElements(t,e={}){if(!mzt(t,this.view))return Ce.getLogger(this).warn(`Renderer of type '${t.type}' not supported!`),[];if(pzt(t))return this._constructPointCloudRendererLegendElements(t,e);if(BUe(t))return this._constructDotDensityRendererLegendElements(t);const i=await this._loadRenderer(t);return jUe(i)?this._constructPieChartRendererLegendElements(i):this._constructRendererLegendElements(i,e)}async _getLegendElementsForFeatureReduction(t){let e=null;return t.type==="binning"?e=t.renderer:t.type==="cluster"&&(e=this._getClusterRenderer(t)),e?this._getRendererLegendElements(e):[]}_getPointCloudRendererTitle(t){var e;return(((e=t.legendOptions)==null?void 0:e.title)||t.field)??""}async _constructPointCloudRendererLegendElements(t,e={}){var l;const i=e.title,r=[];let n=null,s=null;if(cue(t))n={type:"symbol-table",title:i||this._getPointCloudRendererTitle(t),infos:[]},t.colorClassBreakInfos.forEach(c=>{n.infos.unshift({label:c.label||c.minValue+" - "+c.maxValue,value:[c.minValue,c.maxValue],symbol:this._getAppliedCloneSymbol(B8,c.color)})});else if(uue(t)){const c=t.stops;let f=null;if(c!=null&&c.length&&(c.length===1&&(f=c[0].color),!f)){const x=c[0].value,T=c[c.length-1].value;x!=null&&T!=null&&(f=PUe(x+(T-x)/2,c))}n={type:"symbol-table",title:null,infos:[{label:null,value:null,symbol:this._getAppliedCloneSymbol(B8,f||B8.color)}]};const _=Vkt(t.stops??[])??[];s={type:"color-ramp",title:i||this._getPointCloudRendererTitle(t),infos:_,preview:uS(_.map(x=>x.color),{ariaLabel:await L1("previewColorRampAriaLabel")})}}else hue(t)&&(n={type:"symbol-table",title:i||this._getPointCloudRendererTitle(t),infos:[]},(l=t.colorUniqueValueInfos)==null||l.forEach(c=>{n.infos.push({label:c.label||c.values.join(", "),value:c.values.join(", "),symbol:this._getAppliedCloneSymbol(B8,c.color)})}));n&&n.infos.length&&r.push(n),s&&s.infos.length&&r.push(s);const o=r.reduce((c,f)=>[...c,...f.infos??[]],[]).filter(c=>!!c.symbol).map(c=>this._getSymbolPreview(c,this.opacity,{symbolConfig:{applyColorModulation:!!t.colorModulation}}));return await Promise.allSettled(o),r}async _getElementInfoForDotDensity(t,e){const{color:i,label:r,valueExpressionTitle:n}=e,{backgroundColor:s,outline:o,dotSize:l}=t,c=this.effectList,f=c==null?void 0:c.effects.map(F=>F.toJSON()),_=Uz(f),x=await L1("previewTemplateAriaLabel",r||n),T=l+"-"+i+"-"+s+"-"+(o&&JSON.stringify(o.toJSON()))+"-"+_,A=this._dotDensityUrlCache,M=A.has(T)?A.get(T):Akt(t,i,{ariaLabel:x});A.set(T,M);const I={shape:{type:"image",x:0,y:0,width:M.width,height:M.height,src:M.src},fill:null,stroke:null,offset:[0,0]},L=_6([[I]],[M.width,M.height],{effectView:this.effectList,ariaLabel:x});return{opacity:1,src:M.src,preview:L,width:M.width,height:M.height}}async _constructDotDensityRendererLegendElements(t){var n;const e=t.calculateDotValue(this.view.scale),i=(n=t.legendOptions)==null?void 0:n.unit,r={type:"symbol-table",title:{value:e&&Math.round(e),unit:i||""},infos:[]};for(const s of t.attributes){const o=await this._getElementInfoForDotDensity(t,s);o.label=s.label||s.valueExpressionTitle||s.field,r.infos.push(o)}return[r]}async _constructPieChartRendererLegendElements(t){var c,f,_,x;const e=this.layer.opacity,i=[];let r=null;const n=t.outline;t.attributes.forEach(T=>{const A=new cu({color:T.color,outline:n}),M=T.label||T.valueExpressionTitle||T.field;i.push({label:M,symbol:A})});const s=i.length?[...i]:[];if((c=t.othersCategory)!=null&&c.color&&((f=t.othersCategory)==null?void 0:f.threshold)!==0){const T=new cu({color:t.othersCategory.color,outline:n});r=t.othersCategory.label||"Other",i.push({label:r,symbol:T})}if((_=t.defaultColor)!=null&&_.a){const T=new cu({color:t.defaultColor,outline:n});i.push({label:t.defaultLabel,symbol:T})}const o=await this._getVisualVariableLegendElements(t,this.layer)||[];if(i.length){o.unshift({type:"symbol-table",title:null,infos:i});const T=s.filter(M=>M.label!==r).map(M=>M.symbol.color).filter(Boolean),A=Mkt(T,{holePercentage:t.holePercentage,backgroundColor:(x=t.backgroundFillSymbol)==null?void 0:x.color,effectList:this.effectList,outline:n,ariaLabel:await L1("previewPieChartAriaLabel")});o.unshift({type:"pie-chart-ramp",title:this._getRendererTitle(t,this.layer),infos:i,preview:A})}const l=o.reduce((T,A)=>[...T,...this._getAllInfos(A)],[]).filter(T=>!!(T!=null&&T.symbol)&&!(T!=null&&T.preview)).map(T=>this._getSymbolPreview(T,e,{effectList:this.effectList}));return await Promise.allSettled(l),o}async _constructRendererLegendElements(t,e={}){var I,L,F,z,k;const{title:i,sublayer:r}=e,n=r||this.layer;this._hasColorRamp=!1,this._hasOpacityRamp=!1,this._hasSizeRamp=!1,this._scaleDrivenSizeVariable=null;const s=await this._getVisualVariableLegendElements(t,n)||[],o={type:"symbol-table",title:i||this._getRendererTitle(t,n),infos:[]};let l=null,c=!1;const f=new Set;if(_re(t)&&!this._hasSizeRamp){const U=await MUe(t);o.infos.push({label:null,symbol:U})}else if(xzt(t)){let U=i;const j=Szt(t)?"univariate-above-and-below-ramp":"univariate-color-size-ramp",H=s.findIndex(he=>he.type==="color-ramp"),Y=H!==-1?s.splice(H,1)[0]:null,Q=s.findIndex(he=>he.type==="size-ramp"),ne=Q!==-1?s.splice(Q,1)[0]:null,re=[];Y&&(U=Y.title,re.push(Y)),ne&&(U=ne.title,re.push(ne)),re.length>0&&s.push({type:j,title:U,infos:re})}else if(VUe(t)){const U=RUe(t);s.push({type:"heatmap-ramp",title:i||this._getRendererTitle(t,n),infos:U,preview:uS(U.map(j=>j.color),{effectList:this.effectList,ariaLabel:await L1("previewColorRampAriaLabel")})})}else if(Ik(t)){const U=t&&t.authoringInfo;if(U&&U.type==="relationship"){const{numClasses:j,field1:H,field2:Y}=U,Q=U.focus;if(j&&H&&Y){const ne=[H,Y];let re=xUe(Q)||0;for(const ce of ne){const{field:be,normalizationField:ye,label:pe}=ce,Ee=pe||{field:this._getFieldAlias(be,n),normField:ye&&this._getFieldAlias(ye,n)},te=Tzt.clone();te.angle=re,o.infos.push({label:Ee,symbol:te}),f.add(te),re+=90}const he=Ckt({focus:Q,numClasses:j,infos:t.uniqueValueInfos??[]});s.unshift(he)}}else if(JC(this.layer)||j8(this.layer))(I=t.uniqueValueInfos)==null||I.forEach(j=>{j.symbol&&o.infos.push({label:j.label||j.value,value:j.value,symbol:j.symbol})});else{const{field:j,field2:H,field3:Y,fieldDelimiter:Q,valueExpression:ne,defaultSymbol:re}=t,he=!(!j&&!ne||!H&&!Y),ce=[];if((L=t.uniqueValueGroups)==null||L.forEach(be=>{var pe;const ye={type:"symbol-table",title:be.heading,infos:[]};(pe=be.classes)==null||pe.forEach(Ee=>{const{symbol:te,values:le}=Ee;if(te){const de=[],ve=[];for(const Pe of le??[]){const{value:Ge,value2:ut,value3:Ft}=Pe,Qt=[],At=[];(j||ne)&&(Qt.push(Ge),At.push(this._getDomainName(j,Ge,n))),H&&(Qt.push(ut),At.push(this._getDomainName(H,ut,n))),Y&&(Qt.push(Ft),At.push(this._getDomainName(Y,Ft,n))),de.push(he?Qt.join(Q||""):Qt[0]),ve.push(At.join(" - "))}const Se=de.join(", ");let Ae=Ee.label;if(!Ae){const Pe=ve.filter(Boolean);Ae=Pe.length?Pe.join(", "):Se}ye.infos.push({label:Ae,value:Se,symbol:te})}}),ye.infos.length&&ce.push(ye)}),ce.length){const be=ce[0];ce.length===1&&"title"in be&&!be.title?o.infos.push(...be.infos??[]):(re&&(ce.push({type:"symbol-table",infos:[{label:t.defaultLabel||"others",symbol:re}]}),c=!0),o.infos.push(...ce)),i||(F=t.legendOptions)!=null&&F.title||t.valueExpressionTitle||(o.title=null)}}t.defaultSymbol&&!c&&(o.infos.push({label:t.defaultLabel||"others",symbol:t.defaultSymbol}),c=!0)}else if(aM(t))l=this._isUnclassedRenderer(t),(!l||!this._hasSizeRamp)&&(t.classBreakInfos.forEach(U=>{U.symbol&&o.infos.unshift({label:U.label||(l?null:U.minValue+" - "+U.maxValue),value:[U.minValue,U.maxValue],symbol:U.symbol})}),l&&(o.title=null),this._updateInfosforClassedSizeRenderer(t,o.infos)),t.defaultSymbol&&!l&&(o.infos.push({label:t.defaultLabel||"others",symbol:t.defaultSymbol}),c=!0);else if(zUe(t))if(j8(this.layer)||bzt(this.layer)){const U=await this._constructTileImageryStretchRendererElements(t);wzt(U)?s.push(U):o.infos=U}else{const U=this.layer;let j,H;if((z=t.statistics)!=null&&z.length){const re=t.statistics[0];Q2e(re)?(j=re.min,H=re.max):[j,H]=re}let Y=[],Q=U.serviceRasterInfo;if(U.rasterFunction)try{Q=await U.generateRasterInfo(U.rasterFunction)}catch{}const ne=hre(Q.pixelType);if(Q.bandCount===1){const re=((k=U.bandIds)==null?void 0:k[0])||0;j=j??(Q.statistics?Q.statistics[re].min:ne[0]),H=H??(Q.statistics?Q.statistics[re].max:ne[1]),j||H?s.push(await this._getStretchLegendElements(t,{min:j,max:H})):this._getServerSideLegend()}else if(U.bandIds&&U.bandIds.length===1)j=j??(Q.statistics?Q.statistics[U.bandIds[0]].min:ne[0]),H=H??(Q.statistics?Q.statistics[U.bandIds[0]].max:ne[1]),j||H?s.push(await this._getStretchLegendElements(t,{min:j,max:H})):this._getServerSideLegend();else if(Q.bandCount>=3){const{bandInfos:re}=Q,{bandIds:he}=U;re.length>=Q.bandCount?(he==null?void 0:he.length)===3?(Y=he.map(ce=>re[ce].name),o.infos=this._createSymbolTableElementMultiBand(Y)):U.format==="lerc"?(Y=[0,1,2].map(ce=>re[ce].name),o.infos=this._createSymbolTableElementMultiBand(Y)):this._getServerSideLegend():U.format==="lerc"?(Y=["band1","band2","band3"],o.infos=this._createSymbolTableElementMultiBand(Y)):this._getServerSideLegend()}else this._getServerSideLegend()}else if(kUe(t))t.colormapInfos.forEach(U=>{o.infos.push({label:U.label,value:U.value,symbol:this._getAppliedCloneSymbol(dzt,U.color)})});else if(oM(t)){let U=t.symbol;switch(e.geometryType){case"point":U="pointSymbol"in n?n.pointSymbol:null;break;case"polyline":U="lineSymbol"in n?n.lineSymbol:null;break;case"polygon":U="polygonSymbol"in n?n.polygonSymbol:null}const j=this._hasClusterSizeVariable&&this._getClusterSymbol()||!this._hasSizeRamp;t.symbol&&j&&o.infos.push({label:t.label,symbol:U})}else if(FUe(t)){t.outputUnit&&(this.title="("+t.toJSON().outputUnit+")"),o.title=t.attributeField;const U=t.getClassBreakInfos();U!=null&&U.length?U.forEach(j=>{o.infos.push({label:j.minValue+" - "+j.maxValue,symbol:j.symbol})}):o.infos.push({label:t.attributeField,symbol:t.getDefaultSymbol()})}else UUe(t)&&s.push(await this._getStretchLegendElements(t,{min:0,max:255}));const _=t.defaultSymbol;!_||c||oM(t)||l&&!this._hasColorRamp&&!this._hasSizeRamp&&!this._hasOpacityRamp||s.push({type:"symbol-table",infos:[{label:t.defaultLabel||"others",symbol:_}]}),o.infos.length&&s.unshift(o);const x=e.opacity==null?this.opacity:e.opacity,T=this._isTallSymbol("visualVariables"in t?t.visualVariables:null),A=JC(this.layer)||j8(this.layer),M=s.reduce((U,j)=>[...U,...this._getAllInfos(j)],[]).filter(U=>!!(U!=null&&U.symbol)).filter(U=>{if(U.symbol.type==="cim"){const{minScale:j,maxScale:H}=U.symbol.data;if(j&&jthis.scale)return!1}return!0}).map(U=>this._getSymbolPreview(U,x,{isDefault:U.symbol===_,applyScaleDrivenSize:!f.has(U.symbol),symbolConfig:{isTall:T,isSquareFill:A},effectList:f.has(U.symbol)?null:this.effectList}));return t=null,await Promise.allSettled(M),s}_getServerSideLegend(){setTimeout(()=>this.buildLegendElementsForTools(),0)}_getAllInfos(t){const e=t==null?void 0:t.infos;return e?e.reduce((i,r)=>i.concat(this._getAllInfos(r)),[]):[t]}async _constructTileImageryStretchRendererElements(t){var l,c,f;const e=this.layer,i=e.symbolizer.rasterInfo??e.raster.rasterInfo;let r,n;const s=(l=t==null?void 0:t.statistics)!=null&&l.length?t.statistics:i==null?void 0:i.statistics;if(s){const _=s[0];Q2e(_)?(r=_.min,n=_.max):[r,n]=_}else{const _=hre(i.pixelType);r=_[0],n=_[1]}if(e.hasStandardTime()&&(r=e.getStandardTimeValue(r),n=e.getStandardTimeValue(n)),i.bandCount===1||((c=e.bandIds)==null?void 0:c.length)===1)return this._getStretchLegendElements(t,{min:r,max:n});const o=((f=e==null?void 0:e.bandIds)!=null&&f.length?e.bandIds:Array.from(Array(Math.min(i.bandCount,3)).keys())).map(_=>i.bandInfos[_].name);return o.length<3?o.push(o[1]):o.length>3&&o.splice(3),this._createSymbolTableElementMultiBand(o)}async _getStretchLegendElements(t,e){const i=t.colorRamp,r=jkt(i,e);return{type:"stretch-ramp",title:"",infos:r,preview:uS(r.map(n=>n.color),{ariaLabel:await L1("previewColorRampAriaLabel")})}}_getClusterSymbol(){var r;const t=this.layer,e="featureReduction"in t&&t.featureReduction,i=e&&"symbol"in e&&e.renderer;return i&&((r=i==null?void 0:i.authoringInfo)==null?void 0:r.isAutoGenerated)!==!0?null:e&&"symbol"in e?e.symbol:null}async _getSizeLegendElement(t,e,i,r){return{type:"size-ramp",title:this._hasClusterSizeVariable?this._getClusterTitle(e):t,infos:await Jkt(i,e,await mre(i),this.scale,this.view,r,this._hasClusterSizeVariable?this._getClusterSymbol():null)}}_createSymbolTableElementMultiBand(t){const e=[],i=["red","green","blue"];return t.forEach((r,n)=>{e.push({label:{colorName:i[n],bandName:r},src:kkt[n],opacity:this.opacity??1})}),e}_updateInfosforClassedSizeRenderer(t,e){const i=t.authoringInfo&&t.authoringInfo.type==="class-breaks-size",r=t.classBreakInfos.some(n=>fG(n.symbol));if(i&&r){const n=yre,s=vre,o=t.classBreakInfos.length,l=(n-s)/(o>1?o-1:o);e.forEach((c,f)=>{c.size=n-l*f})}}_isTallSymbol(t){let e=!1,i=!1;if(t)for(let r=0;rPromise.resolve().then(()=>yE),void 0);r=c(this._scaleDrivenSizeVariable,null,{view:this.view.type,scale:this.scale,shape:t.symbol.type==="simple-marker"?t.symbol.style:null})}const n=!(i!=null&&i.isDefault)&&this._hasSizeRamp||!(!this._scaleDrivenSizeVariable||!(i!=null&&i.applyScaleDrivenSize));return SUe(t.symbol,{size:r,opacity:e,scale:!1,symbolConfig:i==null?void 0:i.symbolConfig,effectView:i==null?void 0:i.effectList,style:"legend",cimOptions:{allowScalingUp:n,viewParams:this.isScaleDriven?{viewingMode:((s=this.view)==null?void 0:s.type)==="2d"?"map":(o=this.view)==null?void 0:o.viewingMode,scale:(l=this.view)==null?void 0:l.scale}:null},ariaLabel:t.label&&typeof t.label!="string"?null:await L1("previewTemplateAriaLabel",t.label)}).then(c=>(t.preview=c,t)).catch(()=>(t.preview=null,t))}_getClusterRenderer(t){var n,s;this._hasClusterSizeVariable=!1;const e="renderer"in this.layer?this.layer.renderer:null,i=((n=t.renderer)==null?void 0:n.clone())||(e==null?void 0:e.clone()),r=Rkt(this.layerView._effectiveRenderer,this.view);if(r&&i!=null&&"visualVariables"in i&&!((s=i.visualVariables)==null?void 0:s.some(l=>l.type==="size"&&l.target!=="outline"&&!V8.test(l.valueExpression)))){if("clusterMinSize"in t&&"clusterMaxSize"in t){const{clusterMinSize:c,clusterMaxSize:f}=t;r.legendOptions=new POe({showLegend:c!==f})}const l=i.visualVariables||[];i.visualVariables=l.concat([r]),this._hasClusterSizeVariable=!0}return i}async _loadRenderer(t){const e=[],i=t.clone(),r=await mre(i);if(aM(i)||Ik(i)){const n=(i.classBreakInfos||i.uniqueValueInfos).map(s=>this._fetchSymbol(s.symbol,r).then(o=>{s.symbol=o}).catch(()=>{s.symbol=null}));Array.prototype.push.apply(e,n)}return e.push(this._fetchSymbol(i.symbol||i.defaultSymbol,i.defaultSymbol?null:r).then(n=>{this._applySymbolToRenderer(i,n,oM(i))}).catch(()=>{this._applySymbolToRenderer(i,null,oM(i))})),await Promise.allSettled(e),i}_applySymbolToRenderer(t,e,i){i?t.symbol=e:t.defaultSymbol=e}async _fetchSymbol(t,e){if(!t)throw new Error;if(t.type==="web-style"){const i=this._webStyleSymbolCache;try{const r=await(this.view.type==="2d"?t.fetchCIMSymbol({cache:i}):t.fetchSymbol({cache:i}));return this._getAppliedCloneSymbol(r,e)}catch{throw Ce.getLogger(this).warn("Fetching web-style failed!"),new Error}}return this._getAppliedCloneSymbol(t,e)}_getAppliedCloneSymbol(t,e){if(!t||!e)return t;const i=t.clone(),r=e&&e.toRgba();return i.type.includes("3d")?this._applyColorTo3dSymbol(i,r):i.type==="cim"?i8e(i,e):i.color&&(i.color=new qe(r||i.color)),i}_applyColorTo3dSymbol(t,e){e&&t.symbolLayers.forEach(i=>{i&&(i.material||(i.material={}),i.material.color=new qe(e))})}async _getVisualVariableLegendElements(t,e){var _;if(!("visualVariables"in t)||!t.visualVariables||t.type==="vector-field")return null;const i=t.visualVariables,r=[],n=[],s=[];for(const x of i)x.type==="color"?r.push(x):x.type==="size"?n.push(x):x.type==="opacity"&&s.push(x);const o=[...r,...n,...s];let l,c;if(r.length===0&&aM(t)&&t.classBreakInfos&&t.classBreakInfos.length===1){const x=t.classBreakInfos[0];l=x&&x.symbol}if(r.length===0&&oM(t)&&(l=t.symbol),l)if(l.type.includes("3d")){const x=l.symbolLayers.at(0);x.type==="water"?x.color!=null&&(c=x.color):((_=x.material)==null?void 0:_.color)!=null&&(c=x.material.color)}else l.url||(c=l.color);const f=this.effectList;return(await Promise.all(o.map(async x=>{if(!x.legendOptions||x.legendOptions.showLegend!==!1){const T=_re(t)?x.field:this._getRampTitle(x,e);let A=null;const M=this._getDateFormatOptions(e,x);if(x.type==="color"){const I=await gre(x,null,M)??[];A={type:"color-ramp",title:T,infos:I,preview:uS(I.map(L=>L.color),{effectList:f,ariaLabel:await L1("previewColorRampAriaLabel")})},this._hasColorRamp||(this._hasColorRamp=I.length>0)}else if(x.type==="size"&&x.target!=="outline")V8.test(x.valueExpression)?this._hasClusterSizeVariable||(this._scaleDrivenSizeVariable=x):(A=await this._getSizeLegendElement(T,x,t,M),this._hasSizeRamp||(this._hasSizeRamp=!(A.infos==null||!A.infos.length)));else if(x.type==="opacity"){const I=await gre(x,c,M)??[];A={type:"opacity-ramp",title:T,infos:I,preview:uS(I.map(L=>L.color),{effectList:f,ariaLabel:await L1("previewColorRampAriaLabel")})},this._hasOpacityRamp||(this._hasOpacityRamp=I.length>0)}return A&&A.infos?A:null}}))).filter(ys)}_getFieldInfo(t,e){var i,r;if(!e.field)return null;if("featureReduction"in t)switch((i=t.featureReduction)==null?void 0:i.type){case"cluster":case"binning":{const n=t.featureReduction.fields.find(({name:s})=>s.toLowerCase()===e.field.toLowerCase());return n&&"getField"in t?t.getField(n.onStatisticField):null}}return"getField"in t?(r=t.getField)==null?void 0:r.call(t,e.field):null}_getDateFormat(t,e){var r,n,s;const i="popupTemplate"in t?(r=t.popupTemplate)==null?void 0:r.fieldInfos:null;if(i!=null&&i.length&&e)return(s=(n=i.find(o=>{var l;return((l=o.fieldName)==null?void 0:l.toLowerCase())===e.toLowerCase()}))==null?void 0:n.format)==null?void 0:s.dateFormat}_getDateFormatOptions(t,e){var n,s,o,l;const i=this._getFieldInfo(t,e);if(!i||!FFt(i)&&!CMe(i))return null;let r=this._getDateFormat(t,i.name);if(!r&&i.type==="date"){let c=0,f=0;e.stops?(c=((s=(n=e.stops)==null?void 0:n.at(0))==null?void 0:s.value)??c,f=((l=(o=e.stops)==null?void 0:o.at(-1))==null?void 0:l.value)??f):"minDataValue"in e&&"maxDataValue"in e&&(c=e.minDataValue??c,f=e.maxDataValue??f),r=f-c>2*FK.days?"short-date":"short-date-short-time"}return{fieldType:i.type,format:r,timeZoneOptions:{layerTimeZone:"preferredTimeZone"in t?t.preferredTimeZone:null,viewTimeZone:this.view.timeZone,datesInUnknownTimezone:"datesInUnknownTimezone"in t&&t.datesInUnknownTimezone}}}_getDomainName(t,e,i){var r;if(t&&typeof t!="function"){const n="getField"in i&&((r=i.getField)==null?void 0:r.call(i,t)),s=n&&"getFieldDomain"in i&&i.getFieldDomain?i.getFieldDomain(n.name):null;return(s==null?void 0:s.type)==="coded-value"?s.getName(e):null}return null}_getClusterTitle(t){const e=this.layer,i=t.field;if("featureReduction"in e&&e.featureReduction&&e.featureReduction.type==="cluster"){const r=e.featureReduction,n="popupTemplate"in r&&r.popupTemplate,s=n&&n.fieldInfos;if(s){for(const o of s)if(o.fieldName===i)return i==="cluster_count"?o.label||{showCount:!0}:o.label}}return{showCount:!0}}_getRampTitle(t,e){var f,_;let i=t.field,r=t.normalizationField,n=!1,s=!1,o=!1,l=null;i=typeof i=="function"?null:i,r=typeof r=="function"?null:r;const c=(f=t.legendOptions)==null?void 0:f.title;if(c!=null)l=c;else if(t.valueExpressionTitle)l=t.valueExpressionTitle;else{if("renderer"in e&&e.renderer&&"authoringInfo"in e.renderer&&((_=e.renderer.authoringInfo)!=null&&_.visualVariables)){const x=e.renderer.authoringInfo.visualVariables;for(let T=0;T${_}<${this._getFieldAlias(c,e)}>`,f&&(x=`${x}${_}<${this._getFieldAlias(f,e)}>`)),x}let o=null;return(r||n)&&(o={field:r&&this._getFieldAlias(r,e),normField:n&&this._getFieldAlias(n,e),normByPct:s}),o}_getFieldAlias(t,e){var _;const i="popupTemplate"in e?e.popupTemplate:null,r=i==null?void 0:i.fieldInfos;let n;r&&r.some(x=>t===x.fieldName&&(n=x,!0));let s=null;"getField"in e&&e.getField?s=e.getField(t):"fieldsIndex"in e&&e.fieldsIndex&&(s=e.fieldsIndex.get(t));let o=null;const l="featureReduction"in e&&e.featureReduction;l&&(!n&&"popupTemplate"in l&&((_=l.popupTemplate)!=null&&_.fieldInfos)&&l.popupTemplate.fieldInfos.some(x=>{var T;return(t==null?void 0:t.toLowerCase())===((T=x.fieldName)==null?void 0:T.toLowerCase())&&(n=x,!0)}),"fields"in l&&l.fields&&(o=l.fields.find(x=>{var T;return((T=x.name)==null?void 0:T.toLowerCase())===(t==null?void 0:t.toLowerCase())})));const c=n||s||o;let f=null;return c&&(f=(n==null?void 0:n.label)||(s==null?void 0:s.alias)||(o==null?void 0:o.alias)||"name"in c&&c.name||"fieldName"in c&&c.fieldName||null),f}_isUnclassedRenderer(t){const e=t.visualVariables;let i=!1;return aM(t)&&t.classBreakInfos&&t.classBreakInfos.length===1&&e&&(i=t.field?e.some(r=>!(!r||t.field!==r.field||(t.normalizationField||r.normalizationField)&&t.normalizationField!==r.normalizationField)):!!e.length),i}};y([w()],ka.prototype,"children",void 0),y([w({readOnly:!0})],ka.prototype,"effectList",null),y([w()],ka.prototype,"layerView",void 0),y([w()],ka.prototype,"layer",void 0),y([w()],ka.prototype,"legendElements",void 0),y([w({readOnly:!0})],ka.prototype,"opacity",null),y([w()],ka.prototype,"parent",void 0),y([w({readOnly:!0,dependsOn:[]})],ka.prototype,"ready",null),y([w()],ka.prototype,"hideLayersNotInCurrentView",void 0),y([w()],ka.prototype,"keepCacheOnDestroy",void 0),y([w()],ka.prototype,"respectLayerVisibility",void 0),y([w({readOnly:!0})],ka.prototype,"scale",null),y([w()],ka.prototype,"sublayerIds",void 0),y([w({readOnly:!0})],ka.prototype,"isScaleDriven",null),y([w()],ka.prototype,"title",void 0),y([w({readOnly:!0,dependsOn:["ready"],value:0})],ka.prototype,"version",null),y([w()],ka.prototype,"view",void 0),ka=y([Z("esri.widgets.Legend.support.ActiveLayerInfo")],ka);const GUe=ka,n3={state:"state",view:"view",allLayerViews:"all-layer-views",legendProperties:"legend-properties"},HUe=it.ofType(GUe),Ezt=new Set(["esri.layers.BuildingSceneLayer","esri.layers.CSVLayer","esri.layers.FeatureLayer","esri.layers.GeoJSONLayer","esri.layers.GeoRSSLayer","esri.layers.GroupLayer","esri.layers.HeatmapLayer","esri.layers.ImageryLayer","esri.layers.ImageryTileLayer","esri.layers.MapImageLayer","esri.layers.OGCFeatureLayer","esri.layers.PointCloudLayer","esri.layers.StreamLayer","esri.layers.SceneLayer","esri.layers.SubtypeGroupLayer","esri.layers.TileLayer","esri.layers.VoxelLayer","esri.layers.WFSLayer","esri.layers.WMSLayer","esri.layers.WMTSLayer","esri.layers.WCSLayer","esri.layers.LinkChartLayer","esri.layers.knowledgeGraph.KnowledgeGraphSublayer"]),qUe="view.basemapView.baseLayerViews",WUe="view.groundView.layerViews",YUe="view.basemapView.referenceLayerViews",Czt=[qUe,WUe,"view.layerViews",YUe];let Qp=class extends ze{constructor(e){super(e),this._layerViewByLayerId={},this._layerInfosByLayerViewId={},this._activeLayerInfosByLayerViewId={},this._activeLayerInfosWithNoParent=new it,this.activeLayerInfos=new HUe,this.basemapLegendVisible=!1,this.groundLegendVisible=!1,this.hideLayersNotInCurrentView=!1,this.keepCacheOnDestroy=!1,this.respectLayerVisibility=!0,this.layerInfos=[],this.view=null}initialize(){this.addHandles(_e(()=>this.view,()=>this._viewHandles(),ii),n3.view),this.addHandles(oE(()=>this._refresh()))}destroy(){this._destroyViewActiveLayerInfos(),this.view=null}get state(){var e;return(e=this.view)!=null&&e.ready?"ready":"disabled"}_viewHandles(){this.removeHandles(n3.state),this.view&&this.addHandles(_e(()=>this.state,()=>this._stateHandles(),ii),n3.state)}_stateHandles(){this._resetAll(),this.state==="ready"&&this._watchPropertiesAndAllLayerViews()}_resetAll(){this.removeHandles([n3.allLayerViews,n3.legendProperties]),this._destroyViewActiveLayerInfos(),this.activeLayerInfos.removeAll()}_destroyViewActiveLayerInfos(){Object.keys(this._activeLayerInfosByLayerViewId).forEach(this._destroyViewActiveLayerInfo,this)}_destroyViewActiveLayerInfo(e){this.removeHandles(e);const i=this._activeLayerInfosByLayerViewId[e];delete this._activeLayerInfosByLayerViewId[e],i!=null&&i.parent&&i.parent.children.remove(i)}_watchPropertiesAndAllLayerViews(){const{view:e}=this;if(!e)return;const{allLayerViews:i}=e;i.length&&this._refresh(),this.addHandles(i.on("change",r=>this._allLayerViewsChangeHandle(r)),n3.allLayerViews),this.addHandles(_e(()=>[this.layerInfos,this.basemapLegendVisible,this.groundLegendVisible],()=>this._propertiesChangeHandle()),n3.legendProperties)}_allLayerViewsChangeHandle(e){e.removed.forEach(i=>this._destroyViewActiveLayerInfo(i.uid)),this._refresh()}_propertiesChangeHandle(){this._destroyViewActiveLayerInfos(),this._refresh()}_refresh(){this._layerInfosByLayerViewId={},this.activeLayerInfos.removeAll(),this._generateLayerViews().filter(this._filterLayerViewsByLayerInfos,this).filter(this._isLayerViewSupported,this).forEach(this._generateActiveLayerInfo,this),this._sortActiveLayerInfos(this.activeLayerInfos)}_sortActiveLayerInfos(e){const i=this.view;if(e.length<2||!i)return;const r=[];e.forEach(s=>{if(!s.parent){const o=s.layer.parent,l=o&&"uid"in o&&this._layerViewByLayerId[o.uid],c=l&&this._activeLayerInfosByLayerViewId[l.uid];c&&e.includes(c)&&(r.push(s),s.parent=c,c.children.add(s),this._sortActiveLayerInfos(c.children))}}),e.removeMany(r);const n={};i.allLayerViews.forEach((s,o)=>n[s.layer.uid]=o),e.sort((s,o)=>{const l=n[s.layer.uid]||0;return(n[o.layer.uid]||0)-l})}_generateLayerViews(){const e=[];return Czt.filter(this._filterLayerViews,this).map(i=>au(this,i)).filter(i=>i!=null).forEach(this._collectLayerViews("layerViews",e)),e}_filterLayerViews(e){const i=!this.basemapLegendVisible&&(e===qUe||e===YUe),r=!this.groundLegendVisible&&e===WUe;return!i&&!r}_collectLayerViews(e,i){const r=n=>(n&&n.forEach(s=>{i.push(s),r(s[e])}),i);return r}_filterLayerViewsByLayerInfos(e){const i=this.layerInfos;return!i||!i.length||i.some(r=>this._hasLayerInfo(r,e))}_hasLayerInfo(e,i){const r=this._isLayerUIDMatching(e.layer,i.layer.uid);return r&&(this._layerInfosByLayerViewId[i.uid]=e),r}_isLayerUIDMatching(e,i){return e&&(e.uid===i||this._hasLayerUID(e.layers,i))}_hasLayerUID(e,i){return e&&e.some(r=>this._isLayerUIDMatching(r,i))}_isLayerViewSupported(e){return!!Ezt.has(e.layer.declaredClass)&&(this._layerViewByLayerId[e.layer.uid]=e,!0)}_generateActiveLayerInfo(e){this._isLayerActive(e)?this._buildActiveLayerInfo(e):(this.removeHandles(e.uid),this.addHandles(_e(()=>{var i;return[e.legendEnabled,(i=e.layer)==null?void 0:i.legendEnabled]},()=>this._layerActiveHandle(e)),e.uid))}_layerActiveHandle(e){this._isLayerActive(e)&&(this.removeHandles(e.uid),this._buildActiveLayerInfo(e))}_isLayerActive(e){var i;return!this.respectLayerVisibility||e.legendEnabled&&((i=e.layer)==null?void 0:i.legendEnabled)}_buildActiveLayerInfo(e){var l;const i=e.layer,r=e.uid,n=this._layerInfosByLayerViewId[r];let s=this._activeLayerInfosByLayerViewId[r];if(!s){const c=(n==null?void 0:n.title)!==void 0&&n.layer.uid===i.uid;s=new GUe({layer:i,layerView:e,title:c?n.title:i.title,view:this.view,respectLayerVisibility:this.respectLayerVisibility,hideLayersNotInCurrentView:this.hideLayersNotInCurrentView,keepCacheOnDestroy:this.keepCacheOnDestroy,sublayerIds:(n==null?void 0:n.sublayerIds)||[]}),this._activeLayerInfosByLayerViewId[r]=s}const o=i.parent&&"uid"in i.parent?this._layerViewByLayerId[(l=i.parent)==null?void 0:l.uid]:null;if(s.parent=this._activeLayerInfosByLayerViewId[o==null?void 0:o.uid],!this.hasHandles(r)){const c=[_e(()=>i.title,f=>this._titleHandle(f,s)),_e(()=>[i.opacity,"renderer"in i&&i.renderer,"pointSymbol"in i&&i.pointSymbol,"lineSymbol"in i&&i.lineSymbol,"polygonSymbol"in i&&i.polygonSymbol],()=>this._constructLegendElements(s)),Mo(()=>{var f;return((f=this.view)==null?void 0:f.stationary)===!0},()=>this._scaleHandle(s),ii),_e(()=>e._effectiveRenderer,()=>this._constructLegendElements(s)),_e(()=>"effect"in i&&i.effect,()=>this._constructLegendElements(s)),Mo(()=>{var f;return(f=this.view)==null?void 0:f.timeZone},()=>this._constructLegendElements(s),ii)];if(this.respectLayerVisibility){const f=_e(()=>e.legendEnabled,x=>this._legendEnabledHandle(x,s)),_=_e(()=>i.legendEnabled,x=>this._legendEnabledHandle(x,s));c.push(f,_)}this.addHandles(c,r)}s.isScaleDriven||this._constructLegendElements(s),this._addActiveLayerInfo(s)}_titleHandle(e,i){i.title=e,this._constructLegendElements(i)}_legendEnabledHandle(e,i){e?this._addActiveLayerInfo(i):this._removeActiveLayerInfo(i)}_scaleHandle(e){(e.isScaleDriven||e.hideLayersNotInCurrentView)&&this._constructLegendElements(e)}_addActiveLayerInfo(e){var n;const{layerView:i,layer:r}=e;if(this._isLayerActive(i)&&!this.activeLayerInfos.includes(e)){const s=e.parent;if(s)s.children.includes(e)||s.children.push(e),this._sortActiveLayerInfos(s.children);else{const o=(n=this.layerInfos)==null?void 0:n.some(l=>l.layer.uid===r.uid);r.parent&&"uid"in r.parent&&!o?this._activeLayerInfosWithNoParent.add(e):(this.activeLayerInfos.add(e),this._sortActiveLayerInfos(this.activeLayerInfos))}if(this._activeLayerInfosWithNoParent.length){const o=[];this._activeLayerInfosWithNoParent.forEach(l=>{const c=l.layer.parent,f=c&&"uid"in c?this._layerViewByLayerId[c==null?void 0:c.uid]:null,_=this._activeLayerInfosByLayerViewId[f==null?void 0:f.uid];_&&(o.push(l),l.parent=_)}),o.length&&(this._activeLayerInfosWithNoParent.removeMany(o),o.forEach(l=>this._addActiveLayerInfo(l)))}}}_removeActiveLayerInfo(e){const i=e.parent;i?i.children.remove(e):this.activeLayerInfos.remove(e)}_constructLegendElements(e){const i=e.layer;"featureCollections"in i&&i.featureCollections?e.buildLegendElementsForFeatureCollections(i.featureCollections):"featureReduction"in i&&i.featureReduction&&"renderer"in i.featureReduction&&(i.featureReduction.type==="binning"||i.featureReduction.type==="cluster")?e.buildLegendElementsForFeatureReduction(i.featureReduction):"renderer"in i&&i.renderer&&!("sublayers"in i)?e.buildLegendElementsForRenderer(i.renderer):"url"in i&&i.url?e.buildLegendElementsForTools():e.children.forEach(r=>this._constructLegendElements(r))}};y([w({type:HUe})],Qp.prototype,"activeLayerInfos",void 0),y([w()],Qp.prototype,"basemapLegendVisible",void 0),y([w()],Qp.prototype,"groundLegendVisible",void 0),y([w()],Qp.prototype,"hideLayersNotInCurrentView",void 0),y([w()],Qp.prototype,"keepCacheOnDestroy",void 0),y([w()],Qp.prototype,"respectLayerVisibility",void 0),y([w()],Qp.prototype,"layerInfos",void 0),y([w({readOnly:!0})],Qp.prototype,"state",null),y([w()],Qp.prototype,"view",void 0),Qp=y([Z("esri.widgets.Legend.LegendViewModel")],Qp);const Azt=Qp,Cn="esri-legend--card",QC="esri-legend",pi={activated:`${Cn}__carousel-indicator--activated`,base:Cn,stacked:`${QC}--stacked`,carouselTitle:`${Cn}__carousel-title`,indicator:`${Cn}__carousel-indicator`,intervalSeparator:`${Cn}__interval-separator`,imageryLayerStretchedImage:`${Cn}__imagery-layer-image--stretched`,imageLabel:`${Cn}__image-label`,layerCaption:`${Cn}__layer-caption`,labelElement:`${Cn}__label-element`,layerRow:`${Cn}__layer-row`,labelCell:`${Cn}__label-cell`,message:`${Cn}__message`,rampLabel:`${Cn}__ramp-label`,section:`${Cn}__section`,relationshipSection:`${Cn}__relationship-section`,serviceCaptionText:`${Cn}__service-caption-text`,serviceContent:`${Cn}__service-content`,service:`${Cn}__service`,groupLayer:`${Cn}__group-layer`,groupLayerChild:`${Cn}__group-layer-child`,symbol:`${Cn}__symbol`,sizeRampRow:`${Cn}__size-ramp-row`,symbolRow:`${Cn}__symbol-row`,symbolCell:`${Cn}__symbol-cell`,indicatorContainer:`${Cn}__carousel-indicator-container`,intervalSeparatorsContainer:`${Cn}__interval-separators-container`,relationshipLabelContainer:`${Cn}__relationship-label-container`,labelContainer:`${Cn}__label-container`,serviceCaptionContainer:`${Cn}__service-caption-container`,symbolContainer:`${Cn}__symbol-container`,sizeRampContainer:`${Cn}__size-ramp-container`,sizeRampPreview:`${Cn}__size-ramp-preview`,pieChartRampPreview:`${Cn}__pie-chart-ramp-preview`,rampContainer:`${QC}__ramps`,sizeRampHorizontal:`${QC}__size-ramp--horizontal`,rampLabelsContainer:`${QC}__ramp-labels`,layerInfo:`${QC}__layer-cell ${QC}__layer-cell--info`,univariateAboveAndBelowColorRamp:"esri-univariate-above-and-below-ramp__color--card"},Mzt=pz(),XUe=10,due=20,kG=10,pue=20,fue={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function Ozt(t="vertical"){const e="stroke:rgb(200, 200, 200);stroke-width:1";return t==="vertical"?X("svg",{height:"4",width:"10"},X("line",{style:e,x1:"0",x2:"10",y1:"2",y2:"2"})):X("svg",{height:"10",width:"10"},X("line",{style:e,x1:"5",x2:"5",y1:"0",y2:"10"}))}function Pzt(t,e="vertical"){const i=document.createElement("div");return i.style.height=`${due}px`,i.className=fue.univariateAboveAndBelowSymbol,t!=null&&(i.style.opacity=t.toString()),Mzt.append(i,Ozt.bind(null,e)),i}function ZUe(t,e,i="vertical",r){t.infos.forEach((n,s)=>{if(r&&s===2)n.preview=Pzt(e,i);else{const o=Tr(n.size)+(i==="horizontal"?pue:kG),l=n.preview,c=(l==null?void 0:l.tagName.toLowerCase())==="div",f=c?l:document.createElement("div");f.className=fue.univariateAboveAndBelowSymbol,i==="horizontal"?f.style.width=`${o}px`:f.style.height=`${o}px`,!c&&l&&f.appendChild(l),n.preview=f}})}function OV(t,e="classic"){const i=t.infos;return e==="classic"?(Tr(i[0].size)+kG)/2:(Tr(i[0].size)-Tr(i[i.length-1].size))/2}function OO(t,e){if(!t)return null;const i=t.infos.map(n=>n.color),r=uS(e.type==="full"?i:e.type==="above"?i.slice(0,3):i.slice(2,5),{width:e.width,height:e.height,align:e.rampAlignment,effectList:e.effectList,ariaLabel:e.ariaLabel});return r.className=fue.colorRamp,e.opacity!=null&&(r.style.opacity=e.opacity.toString()),r}function bre(t,e,i,r="vertical"){let n=0;const s=t.infos,o=Math.floor(s.length/2),l=e==="full"||e==="above"?0:o,c=e==="full"||e==="below"?s.length-1:o;for(let f=l;f<=c;f++)i&&f===o?n+=r==="horizontal"?XUe:due:n+=Tr(s[f].size)+(r==="horizontal"?pue:kG);return Math.round(n)}function PO(t,e,i,r="vertical"){const n=bre(t,e,i,r),s=t.infos,o=Math.floor(s.length/2),l=e==="full"||e==="above"?0:o,c=e==="full"||e==="below"?s.length-1:o,f=e==="full"?s[l].size+s[c].size:e==="above"?s[l].size:s[c].size,_=i?r==="vertical"?due:XUe:0,x=r==="vertical"?kG*(e==="full"?2:1):pue*(e==="full"?2:1);return Math.round(n-(Tr(f)/2+_/2+x/2))}function JUe(t,e,i="vertical"){const r=t.infos;let n=r.find(({type:o})=>o==="size-ramp"),s=r.find(({type:o})=>o==="color-ramp");return n&&(n={...n},n.infos=[...n.infos],ZUe(n,e,i,!0)),s&&(s={...s},s.infos=[...s.infos]),i==="horizontal"&&(n==null||n.infos.reverse(),s==null||s.infos.reverse()),{sizeRampElement:n,colorRampElement:s}}function KUe(t,e="vertical"){const i=t.infos;let r=i.find(({type:s})=>s==="size-ramp"),n=i.find(({type:s})=>s==="color-ramp");return r&&(r={...r},r.infos=[...r.infos],ZUe(r,null,e,!1)),n&&(n={...n},n.infos=[...n.infos]),e==="horizontal"&&(r==null||r.infos.reverse(),n==null||n.infos.reverse()),{sizeRampElement:r,colorRampElement:n}}function Rzt(t,e){return e}function xl(t){const e=this;t.appendChild(e)}function p2(t,e,i){if(!e)return;if(typeof e=="number")return e;if(typeof e=="string")return Gje(e);if("value"in e||"unit"in e)return By(t.dotValue,e);if("colorName"in e&&"bandName"in e)return t[e.colorName]+": "+(t[e.bandName]||e.bandName);if("showCount"in e)return e.showCount?t.clusterCountTitle:void 0;let r=null;return Rzt(e,i)?r=e.ratioPercentTotal?"showRatioPercentTotal":e.ratioPercent?"showRatioPercent":e.ratio?"showRatio":e.normField?"showNormField":e.field?"showField":null:QUe(e,i)&&(r=e.normField?"showNormField":e.normByPct?"showNormPct":e.field?"showField":null),r?By(r==="showField"?"{field}":t[r],{field:e.field,normField:e.normField}):void 0}function QUe(t,e){return!e}function eVe(t,e){return!!(e&&e==="Stretched"&&t.version>=10.3&&t.declaredClass==="esri.layers.ImageryLayer")}function tVe(t,e){var i;return t.label?e[t.label]+": "+(typeof t.value=="string"?t.value:nd(t.value??0,{style:"decimal",notation:(i=t.value)!=null&&i.toString().toLowerCase().includes("e")?"scientific":"standard"})):""}const Izt=25,$zt=25,Lzt=768,Dzt=100;var X$;(function(t){t.Auto="auto",t.Stack="stack",t.SideBySide="side-by-side"})(X$||(X$={}));const Nzt="#ddd",eA=window.devicePixelRatio;function Fzt(t){var e,i;if(t){if(t.type.includes("3d")){const r=(e=t.symbolLayers)==null?void 0:e.length;if(!r)return;const n=t.symbolLayers.at(r-1),s=(i=n.resource)==null?void 0:i.primitive;return s==="circle"||s==="cross"||s==="kite"||s==="sphere"||s==="cube"||s==="diamond"}{const r=t.style;return r==="circle"||r==="diamond"||r==="cross"}}}function kzt(t){var e;if(t){if(t.type.includes("3d")){const i=(e=t.symbolLayers)==null?void 0:e.length;if(!i)return;const r=t.symbolLayers.at(i-1).get("resource.primitive");return r==="triangle"||r==="cone"||r==="tetrahedron"}return t.style==="triangle"}}let W0=class extends cn{constructor(e,i){super(e,i),this._hasIndicators=!1,this._selectedSectionName=null,this._sectionNames=[],this._sectionMap=new Map,this.activeLayerInfos=null,this.headingLevel=3,this.layout=X$.Stack,this.messages=null,this.messagesCommon=null,this.type="card",this.view=null}initialize(){this.addHandles(_e(()=>this.activeLayerInfos,e=>{this.removeAllHandles(),this._watchForSectionChanges(e)}))}render(){const{view:e}=this;this._hasIndicators=this.layout===X$.Auto&&e&&e.container.clientWidth<=Lzt||this.layout===X$.Stack;const i=this.activeLayerInfos,r=i&&i.toArray().map(f=>this._renderLegendForLayer(f)).filter(f=>!!f);this._hasIndicators?this._selectedSectionName&&this._sectionNames.includes(this._selectedSectionName)||(this._selectedSectionName=this._sectionNames&&this._sectionNames[0]):this._selectedSectionName=null;const n=this._sectionNames.length,s=this._sectionNames.map((f,_)=>{const x=By(this.messagesCommon.pagination.pageText,{index:_+1,total:n});return X("div",{"aria-controls":`${f}-panel`,"aria-label":x,"aria-selected":(this._selectedSectionName===f).toString(),bind:this,class:this.classes(pi.indicator,{[pi.activated]:this._selectedSectionName===f}),"data-section-name":f,id:f,key:f,onclick:this._selectSection,onkeydown:this._focusSection,role:"tab",tabIndex:this._selectedSectionName===f?0:-1,title:x})}),o=this._hasIndicators&&n>1?X("div",{class:pi.indicatorContainer,key:"carousel-navigation",role:"tablist"},s):null,l=this._hasIndicators?this._sectionMap.get(this._selectedSectionName):r&&r.length?r:null,c={[pi.stacked]:this._hasIndicators};return X("div",{class:this.classes(pi.base,c)},l||X("div",{class:pi.message},this.messages.noLegend),o)}_selectSection(e){const i=e.target.getAttribute("data-section-name");i&&(this._selectedSectionName=i)}_focusSection(e){switch(e.key){case"ArrowLeft":case"ArrowRight":this._switchSectionOnArrowPress(e);break;case"Enter":case" ":this._selectSection(e)}}_switchSectionOnArrowPress(e){const i=e.key,r=i==="ArrowLeft"?-1:1,n=e.target.getAttribute("data-section-name"),s=this._sectionNames.indexOf(n),o=this._sectionNames;let l=null;s!==-1&&(o[s+r]?l=document.getElementById(o[s+r]):i==="ArrowLeft"?l=document.getElementById(o[o.length-1]):i==="ArrowRight"&&(l=document.getElementById(o[0])),l==null||l.focus())}_watchForSectionChanges(e){if(this._generateSectionNames(),e){e.forEach(r=>{const n=`activeLayerInfo-${r.layer.uid}-version-change`;this.removeHandles(n),this._watchForSectionChanges(r.children),this.addHandles(_e(()=>r.version,()=>this._generateSectionNames()),n)});const i="activeLayerInfos-collection-change";this.removeHandles(i),this.addHandles(e.on("change",()=>this._watchForSectionChanges(e)),i)}}_generateSectionNames(){this._sectionNames.length=0,this._selectedSectionName=null,this.activeLayerInfos&&this.activeLayerInfos.forEach(this._generateSectionNamesForActiveLayerInfo,this)}_getSectionName(e,i,r){return`${this.id}${e.uid}-type-${i.type}-${r}`}_generateSectionNamesForActiveLayerInfo(e){e.children.forEach(this._generateSectionNamesForActiveLayerInfo,this),e.legendElements&&e.legendElements.forEach((i,r)=>{this._sectionNames.push(this._getSectionName(e.layer,i,r))})}_renderLegendForLayer(e){if(!e.ready)return null;if(e.children.length){const i=e.children.map(r=>this._renderLegendForLayer(r)).toArray();return X("div",{class:this.classes(pi.service,pi.groupLayer),key:e.layer.uid},X("div",{class:pi.serviceCaptionContainer},e.title),i)}{const i=e.legendElements;if(i&&!i.length)return null;const r=i.some(o=>o.type==="relationship-ramp"),n=i.map((o,l)=>this._renderLegendForElement(o,e,l,r)).filter(o=>!!o);if(!n.length)return null;const s={[pi.groupLayerChild]:!!e.parent};return X("div",{class:this.classes(pi.service,s),key:e.layer.uid},X("div",{class:pi.serviceCaptionContainer},X("div",{class:pi.serviceCaptionText},e.title)),X("div",{class:pi.serviceContent},n))}}_renderLegendForElement(e,i,r,n=!1,s=!1){var I;const o=e.type==="color-ramp",l=e.type==="opacity-ramp",c=i.layer;let f=null;if(typeof e.title=="string")f=e.title;else if(e.title){const L=e.title,F=p2(this.messages,L,o||l);f=L.title?`${L.title} (${F})`:F}const _=this._getSectionName(c,e,r),x=this._hasIndicators&&!s?X("div",null,X(Im,{class:pi.carouselTitle,level:this.headingLevel},i.title),X(Im,{class:pi.layerCaption,level:_Ft(this.headingLevel)},f)):f?X(Im,{class:pi.layerCaption,level:this.headingLevel},f):null,T=i.effectList;let A=null;switch(e.type){case"symbol-table":{const L=e.infos.map((F,z)=>this._renderLegendForElementInfo(F,i,e.legendType,z)).filter(F=>!!F);if(L.length){const F=(I=L[0].properties.classes)==null?void 0:I[pi.symbolRow],z={[pi.labelContainer]:!F&&!n,[pi.relationshipLabelContainer]:n};A=X("div",{class:this.classes(z)},L)}break}case"color-ramp":case"opacity-ramp":case"heatmap-ramp":case"stretch-ramp":A=this._renderLegendForRamp(e,c.opacity,T);break;case"size-ramp":A=this._renderSizeRamp(e,c.opacity);break;case"pie-chart-ramp":A=this._renderPieChartRamp(e);break;case"relationship-ramp":A=bUe(e,this.id,{opacity:c.opacity,effectList:T,ariaLabel:this.messages.previewRelationshipRampAriaLabel});break;case"univariate-above-and-below-ramp":A=this._renderUnivariateAboveAndBelowRamp(e,c.opacity,T);break;case"univariate-color-size-ramp":A=this._renderUnivariateColorSizeRamp(e,c.opacity,T)}if(!A)return null;const M=X("div",{"aria-labelledby":_,class:pi.section,id:`${_}-panel`,key:_,role:"tabpanel",tabIndex:0},[x,A]);return s||this._sectionMap.set(_,M),M}_renderPieChartRamp(e){return X("div",{afterCreate:xl,bind:e.preview,class:pi.pieChartRampPreview})}_renderUnivariateAboveAndBelowRamp(e,i,r){var j;const{sizeRampElement:n,colorRampElement:s}=JUe(e,i,"horizontal");if(!n)return null;const o=bre(n,"full",!0,"horizontal"),l=PO(n,"above",!0,"horizontal"),c=PO(n,"below",!0,"horizontal"),f=12,_=(j=this.messages)==null?void 0:j.previewColorRampAriaLabel,x=OO(s,{width:l,height:f,rampAlignment:"horizontal",opacity:i,type:"above",effectList:r,ariaLabel:_}),T=OO(s,{width:c,height:f,rampAlignment:"horizontal",opacity:i,type:"below",effectList:r,ariaLabel:_}),A=OV(n,"card"),M=n.infos.map(H=>H.label),I=M.length-1,L=M.map((H,Y)=>Y===0||Y===I?X("div",{key:Y},H):null),F={display:"flex",flexDirection:"column"},z={display:"flex",flexDirection:"row"},k={marginTop:"3px",display:"flex"};RT(this.container)?k.marginRight=`${A}px`:k.marginLeft=`${A}px`;const U={width:`${o}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return X("div",{class:pi.layerRow,key:"size-ramp-preview",styles:F},X("div",{class:this.classes(pi.symbolContainer,pi.sizeRampHorizontal),styles:z},n.infos.map((H,Y)=>X("div",{afterCreate:xl,bind:H.preview,class:pi.symbol,key:Y}))),x?X("div",{class:pi.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:k},X("div",{afterCreate:xl,bind:x}),X("div",{afterCreate:xl,bind:T})):null,X("div",{class:pi.layerInfo},X("div",{class:pi.rampLabelsContainer,styles:U},L)))}_renderUnivariateColorSizeRamp(e,i,r){var L;const{sizeRampElement:n,colorRampElement:s}=KUe(e,"horizontal");if(!n)return null;const o=bre(n,"full",!1,"horizontal"),l=PO(n,"full",!1,"horizontal"),c=OO(s,{width:l,height:12,rampAlignment:"horizontal",opacity:i,type:"full",effectList:r,ariaLabel:(L=this.messages)==null?void 0:L.previewColorRampAriaLabel}),f=OV(n,"card"),_=n.infos.length-1,x=n.infos.map((F,z)=>z===0||z===_?X("div",{key:z},F.label):null),T={display:"flex",flexDirection:"column"},A={display:"flex",flexDirection:"row"},M={marginTop:"3px",display:"flex"};RT(this.container)?M.marginRight=`${f}px`:M.marginLeft=`${f}px`;const I={width:`${o}px`,display:"flex",flexDirection:"row",justifyContent:"space-between"};return X("div",{class:pi.layerRow,key:"size-ramp-preview",styles:T},X("div",{class:this.classes(pi.symbolContainer,pi.sizeRampHorizontal),styles:A},n.infos.map((F,z)=>X("div",{afterCreate:xl,bind:F.preview,class:pi.symbol,key:z}))),X("div",{class:pi.univariateAboveAndBelowColorRamp,key:"color-ramp-preview",styles:M},X("div",{afterCreate:xl,bind:c})),X("div",{class:pi.layerInfo},X("div",{class:pi.rampLabelsContainer,styles:I},x)))}_renderLegendForElementInfo(e,i,r,n){var c,f,_,x,T;const s=i.layer;if(e.type)return this._renderLegendForElement(e,i,n,!1,!0);const o=eVe(s,r),l=p2(this.messages,e.label,!1)??"";if(e.preview){if(!((c=e.symbol)!=null&&c.type.includes("simple-fill"))){if(!e.label)return X("div",{afterCreate:xl,bind:e.preview,key:n});const re={[pi.symbolCell]:this._hasIndicators};return X("div",{class:this.classes(pi.layerRow,{[pi.symbolRow]:this._hasIndicators}),key:n},X("div",{afterCreate:xl,bind:e.preview,class:this.classes(re)}),X("div",{class:this.classes(pi.imageLabel,{[pi.labelCell]:this._hasIndicators})},l))}let A=255,M=255,I=255,L=0,F=255,z=255,k=255,U=0;const j=(f=e.symbol.color)==null?void 0:f.a,H=(x=(_=e.symbol.outline)==null?void 0:_.color)==null?void 0:x.a;j&&(A=e.symbol.color.r,M=e.symbol.color.g,I=e.symbol.color.b,L=e.symbol.color.a*s.opacity),H&&(F=e.symbol.outline.color.r,z=e.symbol.outline.color.g,k=e.symbol.outline.color.b,U=e.symbol.outline.color.a*s.opacity);const Y=((T=e.symbol.color)==null?void 0:T.isBright)??!0,Q=Y?"rgba(255, 255, 255, .6)":"rgba(0, 0, 0, .6)",ne={background:j?`rgba(${A}, ${M}, ${I}, ${L})`:"none",color:Y?"black":"white",textShadow:`-1px -1px 0 ${Q}, + 1px -1px 0 ${Q}, + -1px 1px 0 ${Q}, + 1px 1px 0 ${Q}`,border:H?`1px solid rgba(${F}, ${z}, ${k}, ${U})`:"none",filter:WL(i.effectList)??void 0};return X("div",{class:pi.layerRow,key:n},X("div",{class:pi.labelElement,styles:ne},l))}if(e.src){const A=this._renderImage(e,s,o);return X("div",{class:pi.layerRow,key:n},A,X("div",{class:pi.imageLabel},l))}}_renderImage(e,i,r){const{label:n,src:s,opacity:o}=e,l={[pi.imageryLayerStretchedImage]:r,[pi.symbol]:!r},c={opacity:`${o??i.opacity}`};return X("img",{alt:p2(this.messages,n,!1),"aria-label":p2(this.messages,n,!1),border:0,class:this.classes(l),height:e.height,src:s,styles:c,width:e.width})}_renderSizeRampLines(e){const i=e.infos,r=i[0],n=i[i.length-1],s=r.symbol,o=this._hasIndicators,l=Tr(r.size+r.outlineSize)*eA,c=Tr(n.size+n.outlineSize)*eA,f=o?l:l+50*eA,_=o?l/2+50*eA:l,x=kzt(s),T=Fzt(s),A=document.createElement("canvas");A.width=f,A.height=_,A.style.width=A.width/eA+"px",A.style.height=A.height/eA+"px";const M=A.getContext("2d");if(o){M.beginPath();const I=0,L=0,F=f/2-c/2,z=_;M.moveTo(I,L),M.lineTo(F,z);const k=f,U=0,j=f/2+c/2,H=_;M.moveTo(k,U),M.lineTo(j,H)}else{M.beginPath();const I=0,L=_/2-c/2,F=f,z=0;M.moveTo(I,L),M.lineTo(F,z);const k=0,U=_/2+c/2,j=f,H=_;M.moveTo(k,U),M.lineTo(j,H)}return M.strokeStyle=Nzt,M.stroke(),X("div",{afterCreate:xl,bind:A,styles:o?{display:"flex",marginTop:`-${x?0:T?l/2:0}px`,marginBottom:`-${x?c:T?c/2:0}px`}:{display:"flex",marginRight:`-${x?0:T?l/2:0}px`,marginLeft:`-${x?0:T?c/2:0}px`}})}_renderSizeRamp(e,i){const r=e.infos,n=r[0].label,s=r[r.length-1].label;let o=r[0].preview,l=r[r.length-1].preview;const c=this._hasIndicators,f={"flex-direction":c?"column":"row-reverse"};o&&(o=o.cloneNode(!0),o.style.display="flex"),l&&(l=l.cloneNode(!0),l.style.display="flex");const _={opacity:i!=null?`${i}`:""};return X("div",{class:this.classes(pi.layerRow,{[pi.sizeRampRow]:c})},X("div",{class:pi.rampLabel},c?n:s),X("div",{class:pi.sizeRampContainer,styles:f},X("div",{afterCreate:xl,bind:o,class:pi.sizeRampPreview,styles:_}),this._renderSizeRampLines(e),X("div",{afterCreate:xl,bind:l,class:pi.sizeRampContainer,styles:_})),X("div",{class:pi.rampLabel},c?s:n))}_getRampStopLabel(e,i){switch(i){case"heatmap-ramp":return this.messages[e.label];case"stretch-ramp":return tVe(e,this.messages);default:return e.label}}_renderLegendForRamp(e,i,r){const n=e.infos,s=e.type,o=s==="heatmap-ramp",l=n.length-1,c=$zt,f=l>2&&!o?Izt*l:Dzt,_=f+20,x=10,T=n.slice(0).reverse(),A=T.length-1,M=T.length%2!=0?T[T.length/2|0]:null,I=M&&X("div",{class:pi.intervalSeparatorsContainer},X("div",{class:pi.intervalSeparator},"|"),X("div",{class:pi.rampLabel},this._getRampStopLabel(M,s))),L=[[{shape:{type:"path",path:`M0 ${c/2} L${x} 0 L${x} ${c} Z`},fill:T[0].color,stroke:{width:0}},{shape:{type:"rect",x,y:0,width:f,height:c},fill:{type:"linear",x1:x,y1:0,x2:f+x,y2:0,colors:T.map((U,j)=>({color:U.color,offset:o&&"ratio"in U?U.ratio:j/l}))},stroke:{width:0}},{shape:{type:"path",path:`M${f+x} 0 L${_} ${c/2} L${f+x} ${c} Z`},fill:T[A].color,stroke:{width:0}}]],F=vUe(L,_,c),z={filter:WL(r)??void 0,opacity:i==null?void 0:`${i}`},k={justifyContent:"center"};return X("div",{class:pi.layerRow,styles:k},X("div",{class:pi.rampLabel},this._getRampStopLabel(T[0],s)),X("div",{class:pi.symbolContainer},X("div",{styles:z},F),I),X("div",{class:pi.rampLabel},this._getRampStopLabel(T[A],s)))}};y([w()],W0.prototype,"activeLayerInfos",void 0),y([w()],W0.prototype,"headingLevel",void 0),y([w()],W0.prototype,"layout",void 0),y([w(),Gr("esri/widgets/Legend/t9n/Legend")],W0.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],W0.prototype,"messagesCommon",void 0),y([w({readOnly:!0})],W0.prototype,"type",void 0),y([w()],W0.prototype,"view",void 0),y([bo()],W0.prototype,"_selectSection",null),W0=y([Z("esri.widgets.Legend.styles.Card")],W0);const _X=W0,Un="esri-legend",qi={service:`${Un}__service`,label:`${Un}__service-label`,layer:`${Un}__layer`,groupLayer:`${Un}__group-layer`,groupLayerChild:`${Un}__group-layer-child`,layerTable:`${Un}__layer-table`,layerTableSizeRamp:`${Un}__layer-table--size-ramp`,layerChildTable:`${Un}__layer-child-table`,layerCaption:`${Un}__layer-caption`,layerBody:`${Un}__layer-body`,layerRow:`${Un}__layer-row`,layerCell:`${Un}__layer-cell`,layerInfo:`${Un}__layer-cell ${Un}__layer-cell--info`,imageryLayerStretchedImage:`${Un}__imagery-layer-image--stretched`,imageryLayerCellStretched:`${Un}__imagery-layer-cell--stretched`,imageryLayerInfoStretched:`${Un}__imagery-layer-info--stretched`,symbolContainer:`${Un}__layer-cell ${Un}__layer-cell--symbols`,symbol:`${Un}__symbol`,rampContainer:`${Un}__ramps`,sizeRamp:`${Un}__size-ramp`,colorRamp:`${Un}__color-ramp`,opacityRamp:`${Un}__opacity-ramp`,borderlessRamp:`${Un}__borderless-ramp`,rampTick:`${Un}__ramp-tick`,rampFirstTick:`${Un}__ramp-tick-first`,rampLastTick:`${Un}__ramp-tick-last`,rampLabelsContainer:`${Un}__ramp-labels`,rampLabel:`${Un}__ramp-label`,message:`${Un}__message`,univariateAboveAndBelowLabel:"esri-univariate-above-and-below-ramp__label"},zzt=`${Un}__`,Uzt=24,ixe={display:"flex",alignItems:"flex-start"},bX={marginLeft:"3px"},tA={display:"table-cell",verticalAlign:"middle"};let hS=class extends cn{constructor(e,i){super(e,i),this.activeLayerInfos=null,this.headingLevel=3,this.messages=null,this.type="classic"}render(){const e=this.activeLayerInfos,i=e&&e.toArray().map(r=>this._renderLegendForLayer(r)).filter(r=>!!r);return X("div",null,i&&i.length?i:X("div",{class:qi.message},this.messages.noLegend))}_renderLegendForLayer(e){if(!e.ready)return null;const i=!!e.children.length,r=`${zzt}${e.layer.uid}-version-${e.version}`,n=e.title?Im({level:this.headingLevel,class:this.classes(tt.heading,qi.label)},e.title):null;if(i){const s=e.children.map(o=>this._renderLegendForLayer(o)).toArray();return X("div",{class:this.classes(qi.service,qi.groupLayer),key:r},n,s)}{const s=e.legendElements;if(s&&!s.length)return null;const o=s.map(c=>this._renderLegendForElement(c,e.layer,e.effectList)).filter(c=>!!c);if(!o.length)return null;const l={[qi.groupLayerChild]:!!e.parent};return X("div",{class:this.classes(qi.service,l),key:r},n,X("div",{class:qi.layer},o))}}_renderLegendForElement(e,i,r,n){const s=e.type==="color-ramp",o=e.type==="opacity-ramp",l=e.type==="size-ramp";let c=null;if(e.type==="symbol-table"||l){const M=e.infos.map(I=>this._renderLegendForElementInfo(I,i,r,l,e.legendType)).filter(I=>!!I);M.length&&(c=X("div",{class:qi.layerBody},M))}else e.type==="color-ramp"||e.type==="opacity-ramp"||e.type==="heatmap-ramp"||e.type==="stretch-ramp"?c=this._renderLegendForRamp(e,i.opacity):e.type==="relationship-ramp"?c=bUe(e,this.id,{opacity:i.opacity,effectList:r,ariaLabel:this.messages.previewRelationshipRampAriaLabel}):e.type==="pie-chart-ramp"?c=this._renderPieChartRamp(e):e.type==="univariate-above-and-below-ramp"?c=this._renderUnivariateAboveAndBelowRamp(e,i.opacity,r):e.type==="univariate-color-size-ramp"&&(c=this._renderUnivariateColorSizeRamp(e,i.opacity,r));if(!c)return null;const f=e.title;let _=null;if(typeof f=="string")_=f;else if(f){const M=p2(this.messages,f,s||o);_=QUe(f,s||o)&&f.title?`${f.title} (${M})`:M}const x=n?qi.layerChildTable:qi.layerTable,T=_?X("div",{class:qi.layerCaption},_):null,A={[qi.layerTableSizeRamp]:l||!n};return X("div",{class:this.classes(x,A)},T,c)}_renderPieChartRamp(e){return X("div",{afterCreate:xl,bind:e.preview})}_renderUnivariateAboveAndBelowRamp(e,i,r){var H;const{sizeRampElement:n,colorRampElement:s}=JUe(e,i);if(!n)return null;const o=(H=this.messages)==null?void 0:H.previewColorRampAriaLabel,l=PO(n,"above",!0),c=PO(n,"below",!0),f=12,_=OO(s,{width:f,height:l,rampAlignment:"vertical",opacity:i,type:"above",effectList:r,ariaLabel:o}),x=OO(s,{width:f,height:c,rampAlignment:"vertical",opacity:i,type:"below",effectList:r,ariaLabel:o}),T=OV(n),A=n.infos.map(Y=>Y.label),M=A.map((Y,Q)=>Q===0?X("div",{class:Y?_?qi.univariateAboveAndBelowLabel:qi.rampLabel:void 0,key:Q},Y):Q===2?X("div",null):null),I=A.length-1,L=Math.floor(A.length/2),F=A.map((Y,Q)=>Q===L||Q===I?X("div",{class:Y?_?qi.univariateAboveAndBelowLabel:qi.rampLabel:void 0,key:Q},Y):null),z={display:"table-cell",verticalAlign:"middle"},k={marginTop:`${T}px`},U={height:`${l}px`},j={height:`${c}px`};return X("div",{key:"univariate-above-and-below-ramp-preview",styles:ixe},X("div",{class:qi.layerBody},n.infos.map((Y,Q)=>X("div",{class:this.classes(qi.layerRow,qi.sizeRamp)},X("div",{afterCreate:xl,bind:Y.preview,class:qi.symbol,styles:z}),_||Q%2!=0?null:X("div",{class:qi.layerInfo},A[Q])))),_?X("div",{key:"color-ramp-preview",styles:k},X("div",{styles:bX},X("div",{styles:tA},X("div",{afterCreate:xl,bind:_,class:qi.rampContainer})),X("div",{styles:tA},X("div",{class:qi.rampLabelsContainer,styles:U},M))),X("div",{styles:bX},X("div",{styles:tA},X("div",{afterCreate:xl,bind:x,class:qi.rampContainer})),X("div",{styles:tA},X("div",{class:qi.rampLabelsContainer,styles:j},F)))):null)}_renderUnivariateColorSizeRamp(e,i,r){var I;const{sizeRampElement:n,colorRampElement:s}=KUe(e);if(!n)return null;const o=OV(n),l=12,c=PO(n,"full",!1),f=OO(s,{width:l,height:c,rampAlignment:"vertical",opacity:i,type:"full",effectList:r,ariaLabel:(I=this.messages)==null?void 0:I.previewColorRampAriaLabel}),_=n.infos.length-1,x=n.infos.map((L,F)=>F===0||F===_?X("div",{class:L.label?s?qi.univariateAboveAndBelowLabel:qi.rampLabel:void 0,key:F},L.label):null),T={display:"table-cell",verticalAlign:"middle"},A={marginTop:`${o}px`},M={height:`${c}px`};return X("div",{key:"univariate-above-and-below-ramp-preview",styles:ixe},X("div",{class:qi.layerBody},n.infos.map(L=>X("div",{class:this.classes(qi.layerRow,qi.sizeRamp)},X("div",{afterCreate:xl,bind:L.preview,class:qi.symbol,styles:T})))),X("div",{key:"color-ramp-preview",styles:A},X("div",{styles:bX},X("div",{styles:tA},X("div",{afterCreate:xl,bind:f,class:qi.rampContainer})),X("div",{styles:tA},X("div",{class:qi.rampLabelsContainer,styles:M},x)))))}_renderLegendForRamp(e,i){const r=e.infos,n=e.type==="opacity-ramp",s=e.type==="heatmap-ramp",o=e.type==="stretch-ramp",l=e.preview,c=n?qi.opacityRamp:"";l.className=`${qi.colorRamp} ${c}`,i!=null&&(l.style.opacity=i.toString());const f=r.map(T=>X("div",{class:T.label?qi.rampLabel:void 0},s?this.messages[T.label]||T.label:o?tVe(T,this.messages):T.label)),_={width:`${Uzt}px`},x={height:l.style.height};return X("div",{class:qi.layerRow},X("div",{class:qi.symbolContainer,styles:_},X("div",{afterCreate:xl,bind:l,class:qi.rampContainer})),X("div",{class:qi.layerInfo},X("div",{class:qi.rampLabelsContainer,styles:x},f)))}_renderLegendForElementInfo(e,i,r,n,s){if(e.type)return this._renderLegendForElement(e,i,r,!0);let o=null;const l=eVe(i,s);if(e.preview?o=X("div",{afterCreate:xl,bind:e.preview,class:qi.symbol}):e.src&&(o=this._renderImage(e,i,l)),!o)return null;const c={[qi.imageryLayerInfoStretched]:l},f={[qi.imageryLayerInfoStretched]:l,[qi.sizeRamp]:!l&&n};return X("div",{class:qi.layerRow},X("div",{class:this.classes(qi.symbolContainer,f)},o),X("div",{class:this.classes(qi.layerInfo,c)},p2(this.messages,e.label,!1)||""))}_renderImage(e,i,r){const{label:n,src:s,opacity:o}=e,l={[qi.imageryLayerStretchedImage]:r,[qi.symbol]:!r},c={opacity:`${o??i.opacity}`};return X("img",{alt:p2(this.messages,n,!1),"aria-label":p2(this.messages,n,!1),border:0,class:this.classes(l),height:e.height,src:s,styles:c,width:e.width})}};y([w()],hS.prototype,"activeLayerInfos",void 0),y([w()],hS.prototype,"headingLevel",void 0),y([w(),Gr("esri/widgets/Legend/t9n/Legend")],hS.prototype,"messages",void 0),y([w({readOnly:!0})],hS.prototype,"type",void 0),hS=y([Z("esri.widgets.Legend.styles.Classic")],hS);const iA=hS,rxe={base:"esri-legend",widgetIcon:si.layerList};let gl=class extends cn{constructor(e,i){super(e,i),this.headingLevel=3,this.iconClass=rxe.widgetIcon,this.icon=null,this.messages=null,this.style=new iA,this.viewModel=new Azt}initialize(){this.addHandles([Jr(()=>this.view,"resize",()=>this.scheduleRender()),Jr(()=>this.activeLayerInfos,"change",()=>this._refreshActiveLayerInfos(this.activeLayerInfos)),_e(()=>this.headingLevel,e=>{const{style:i}=this;i&&(i.headingLevel=e)}),_e(()=>this.style,(e,i)=>{i&&e!==i&&i.destroy(),e&&(e.activeLayerInfos=this.activeLayerInfos,e.type==="card"&&(e.view=this.view),e.headingLevel=this.headingLevel)},ii)])}get activeLayerInfos(){return this.viewModel.activeLayerInfos}set activeLayerInfos(e){this.viewModel.activeLayerInfos=e}get basemapLegendVisible(){return this.viewModel.basemapLegendVisible}set basemapLegendVisible(e){this.viewModel.basemapLegendVisible=e}get groundLegendVisible(){return this.viewModel.groundLegendVisible}set groundLegendVisible(e){this.viewModel.groundLegendVisible=e}get hideLayersNotInCurrentView(){return this.viewModel.hideLayersNotInCurrentView}set hideLayersNotInCurrentView(e){this.viewModel.hideLayersNotInCurrentView=e}get keepCacheOnDestroy(){return this.viewModel.keepCacheOnDestroy}set keepCacheOnDestroy(e){this.viewModel.keepCacheOnDestroy=e}get respectLayerVisibility(){return this.viewModel.respectLayerVisibility}set respectLayerVisibility(e){this.viewModel.respectLayerVisibility=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get layerInfos(){return this.viewModel.layerInfos}set layerInfos(e){this.viewModel.layerInfos=e}castStyle(e){if(e instanceof _X||e instanceof iA)return e;if(typeof e=="string")return e==="card"?new _X:new iA;if(e&&typeof e.type=="string"){const i={...e};return delete i.type,new(e.type==="card"?_X:iA)(i)}return new iA}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){return X("div",{class:this.classes(rxe.base,tt.widget,this.style instanceof iA?tt.panel:null)},this.style.render())}_refreshActiveLayerInfos(e){e.forEach(i=>{this.removeHandles(`version_${i.layer.uid}`),this._renderOnActiveLayerInfoChange(i)}),this.scheduleRender()}_renderOnActiveLayerInfoChange(e){const i=_e(()=>e.version,()=>this.scheduleRender());this.addHandles(i,`version_${e.layer.uid}`);const r=Jr(()=>e.children,"change",()=>e.children.forEach(n=>this._renderOnActiveLayerInfoChange(n)),ii);this.addHandles(r,`version_${e.layer.uid}`),e.children.forEach(n=>this._renderOnActiveLayerInfoChange(n))}};y([w()],gl.prototype,"activeLayerInfos",null),y([w()],gl.prototype,"basemapLegendVisible",null),y([w()],gl.prototype,"groundLegendVisible",null),y([w()],gl.prototype,"headingLevel",void 0),y([w()],gl.prototype,"hideLayersNotInCurrentView",null),y([w()],gl.prototype,"keepCacheOnDestroy",null),y([w()],gl.prototype,"respectLayerVisibility",null),y([w()],gl.prototype,"iconClass",void 0),y([w()],gl.prototype,"icon",void 0),y([w()],gl.prototype,"label",null),y([w()],gl.prototype,"layerInfos",null),y([w(),Gr("esri/widgets/Legend/t9n/Legend")],gl.prototype,"messages",void 0),y([w()],gl.prototype,"style",void 0),y([Ci("style")],gl.prototype,"castStyle",null),y([w()],gl.prototype,"view",null),y([w()],gl.prototype,"viewModel",void 0),gl=y([Z("esri.widgets.Legend")],gl);const iVe=gl,Vzt=Object.freeze(Object.defineProperty({__proto__:null,default:iVe},Symbol.toStringTag,{value:"Module"})),rVe=(t,e,i)=>new iVe({view:t,layerInfos:[{layer:e}],container:i}),nVe=()=>{const t=document.createElement("div");return t.classList.add("esri-widget"),t},Bzt=["be99602fc02d448eb859a0b426c0d5b6","b6517d264b8f467fa5b14c382dfdf87a","c5773442e91c48c392f28af6600169d0","1bc7e98137fe44129dd6653bef1920d0","287be80ff31d4c8babc48b2f959214f5","4ee7ecad357844bba5b95001de39f1e3","e5c6a086a5ae4d1991d4ca35733fe0ed"],jzt=t=>new eUe({view:t,container:"layers-container",listItemCreatedFunction:async e=>{const i=e.item;await i.layer.when();const[r,n]=cUe(),s=nVe();rVe(t,i.layer,s),r.append(n,s),(i.title==="Kataster"||i.title==="Kitsendused"||i.title==="Kitsendusi põhjustavad objektid"||i.title==="Geoloogia WMS")&&(i.hidden=!0),(i.layer.type!=="group"||i.title==="Taimkate analüütiline"||i.title==="Taimkate realistlik")&&(i.panel={content:r,className:"esri-icon-legend",open:!1,title:"Legend and layer opacity"}),n.addEventListener("calciteSliderInput",()=>{const l=n.value/100;i.layer.opacity=l}),i.layer.type!=="group"&&(i.actionsSections=[[{title:"Layer information",className:"esri-icon-description",id:"information"}]]),["Nõmme","Pärnu","Tallinn","Tartu","Kuressaare","Kohtuhoone tekstuuriga (Tallinn)"].includes(i.title)&&i.actionsSections.items[0].push({title:"Zoom to extent",className:"esri-icon-zoom-out-fixed",id:"zoomTo"})}}),Gzt=t=>new eUe({view:t,container:"wms-layers-container",listItemCreatedFunction:async e=>{const i=e.item;await i.layer.when();const[r,n]=cUe(),s=nVe();rVe(t,i.layer,s),r.append(n,s),i.title!=="Kataster"&&i.title!=="Kitsendused"&&i.title!=="Kitsendusi põhjustavad objektid"&&i.title!=="Geoloogia WMS"&&(i.hidden=!0),i.layer.type!=="group"&&(i.panel={content:r,className:"esri-icon-legend",open:!1,title:"Legend and layer opacity"}),n.addEventListener("calciteSliderInput",()=>{const o=n.value/100;i.layer.opacity=o}),i.title!=="Geoloogia WMS"&&(i.actionsSections=[[{title:"Layer information",className:"esri-icon-description",id:"information"}]])}}),Hzt=t=>new bFt({view:t,container:"basemaps-container",icon:"layer-basemap",source:Bzt.map(e=>new Ay({portalItem:{id:e}}))}),qzt=(t,e)=>{t.watch("activeBasemap",()=>{const i=t.activeBasemap.title==="Ortofoto";e.watch("zoom",()=>{e.map.layers.forEach(r=>{r.title==="Ortofoto WMS"&&(r.visible=i&&e.zoom>=12.5)})})})},nxe=(t,e)=>{t.on("trigger-action",i=>{const r=i.item.layer,n=i.action.id;n==="information"&&window.open(r.url),n==="zoomTo"&&e.goTo(r.fullExtent.extent)})};function Wzt(t,e){const i=sVe(e);return[t[0].toFixed(i),t[1].toFixed(i)]}function sVe(t){return t>=500?6:t<500&&t>=50?7:t<50&&t>=5?8:9}function Yzt(t,e){const i=t.includes(",")?",":" ",[r,n,s]=t.split(i).map(l=>{const c=l.trim();return c?Number(c):null});if(!PV(r)||!PV(n))return null;const o=new mt({x:r,y:n,spatialReference:e||at.WGS84});return s&&(o.z=s,o.hasZ=!0),o}function PV(t){return typeof t=="number"&&isFinite(t)}function wre(t){return!!t&&PV(t.x)&&PV(t.y)}function sxe(t,e){if(t.spatialReference.isGeographic&&e){const[i,r]=Wzt([t.x,t.y],e);return`${i}, ${r}`}return`${t.x.toFixed(3)}, ${t.y.toFixed(3)}`}const Xzt=["dd","dms","ddm","mgrs","usng","utm"];function Zzt(t){return Xzt.includes(t)}const wX={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function zG(t=fa()){let e=(t=t.toLowerCase())in wX;if(!e){const s=t.split("-");s.length>1&&s[0]in wX&&(t=s[0],e=!0),e||(t="en")}const[i,r,n="#,##0.###"]=wX[t];return{decimal:i,group:r,pattern:n}}function Jzt(t,e){const i=zG((e={...e}).locale);e.customs=i;const r=e.pattern||i.pattern;return isNaN(t)||Math.abs(t)===1/0?null:Kzt(t,r,e)}const oVe=/[#0,]*[#0](?:\.0*#*)?/;function Kzt(t,e,i){const r=(i=i||{}).customs.group,n=i.customs.decimal,s=e.split(";"),o=s[0];if((e=s[t<0?1:0]||"-"+o).includes("%"))t*=100;else if(e.includes("‰"))t*=1e3;else{if(e.includes("¤"))throw new Error("currency notation not supported");if(e.includes("E"))throw new Error("exponential notation not supported")}const l=oVe,c=o.match(l);if(!c)throw new Error("unable to find a number expression in pattern: "+e);return i.fractional===!1&&(i.places=0),e.replace(l,Qzt(t,c[0],{decimal:n,group:r,places:i.places,round:i.round}))}function Qzt(t,e,i){(i=i||{}).places===!0&&(i.places=0),i.places===1/0&&(i.places=6);const r=e.split("."),n=typeof i.places=="string"&&i.places.indexOf(",");let s=i.places;n?s=i.places.substring(n+1):+s>=0||(s=(r[1]||[]).length),i.round<0||(t=Number(t.toFixed(Number(s))));const o=String(Math.abs(t)).split("."),l=o[1]||"";if(r[1]||i.places){n&&(i.places=i.places.substring(0,n));const M=i.places!==void 0?i.places:r[1]&&r[1].lastIndexOf("0")+1;+M>l.length&&(o[1]=l.padEnd(Number(M),"0")),+so[0].length&&(o[0]=o[0].padStart(f,"0")),c.includes("#")||(o[0]=o[0].substr(o[0].length-f)));let _,x,T=r[0].lastIndexOf(",");if(T!==-1){_=r[0].length-T-1;const M=r[0].substr(0,T);T=M.lastIndexOf(","),T!==-1&&(x=M.length-T-1)}const A=[];for(let M=o[0];M;){const I=M.length-_;A.push(I>0?M.substr(I):M),M=I>0?M.slice(0,I):"",x&&(_=x,x=void 0)}return o[0]=A.reverse().join(i.group||","),o.join(i.decimal||".")}function eUt(t){const e=zG((t=t||{}).locale),i=t.pattern||e.pattern,r=e.group,n=e.decimal;let s=1;if(i.includes("%"))s/=100;else if(i.includes("‰"))s/=1e3;else if(i.includes("¤"))throw new Error("currency notation not supported");const o=i.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:n9(o,c=>(c="(?:"+Xre(c,".")+")").replace(oVe,f=>{const _={signed:!1,separator:t.strict?r:[r,""],fractional:t.fractional,decimal:n,exponent:!1},x=f.split(".");let T=t.places;x.length===1&&s!==1&&(x[1]="###"),x.length===1||T===0?_.fractional=!1:(T===void 0&&(T=t.pattern?x[1].lastIndexOf("0")+1:1/0),T&&t.fractional==null&&(_.fractional=!0),!t.places&&+T1&&(_.groupSize=A.pop().length,A.length>1&&(_.groupSize2=A.pop().length)),"("+iUt(_)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:n,factor:s}}function tUt(t,e){const i=eUt(e),r=new RegExp("^"+i.regexp+"$").exec(t);if(!r)return NaN;let n=r[1];if(!r[1]){if(!r[2])return NaN;n=r[2],i.factor*=-1}return n=n.replaceAll(new RegExp("["+i.group+"\\s\\xa0]","g"),"").replace(i.decimal,"."),Number(n)*i.factor}function iUt(t){"places"in(t=t||{})||(t.places=1/0),typeof t.decimal!="string"&&(t.decimal="."),"fractional"in t&&!String(t.places).startsWith("0")||(t.fractional=[!0,!1]),"exponent"in t||(t.exponent=[!0,!1]),"eSigned"in t||(t.eSigned=[!0,!1]);const e=oxe(t),i=n9(t.fractional,n=>{let s="";return n&&t.places!==0&&(s="\\"+t.decimal,t.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+t.places+"}"),s},!0);let r=e+i;return i&&(r="(?:(?:"+r+")|(?:"+i+"))"),r+n9(t.exponent,n=>n?"([eE]"+oxe({signed:t.eSigned})+")":"")}function oxe(t){return"signed"in(t=t||{})||(t.signed=[!0,!1]),"separator"in t?"groupSize"in t||(t.groupSize=3):t.separator="",n9(t.signed,e=>e?"[-+]":"",!0)+n9(t.separator,e=>{if(!e)return"(?:\\d+)";(e=Xre(e))===" "?e="\\s":e===" "&&(e="\\s\\xa0");const i=t.groupSize,r=t.groupSize2;if(r){const n="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+e+"]\\d{"+r+"})*["+e+"]\\d{"+i+"})";return i-r>0?"(?:"+n+"|(?:0|[1-9]\\d{0,"+(i-1)+"}))":n}return"(?:0|[1-9]\\d{0,"+(i-1)+"}(?:["+e+"]\\d{"+i+"})*)"},!0)}const n9=(t,e,i)=>{if(!(t instanceof Array))return e(t);const r=[];for(let n=0;n"("+(e?"?:":"")+t+")";function nUt(t,e){const i=[];t=(t=(t=t.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const r=mx(e);return lT.dmsToGeog(r,1,[t],i)?new mt(i[0][0],i[0][1],e||at.WGS84):null}function sUt(t,e,i){const r=[],n=aVe(i);if(n===-1)return console.warn(`invalid conversionMode: ${i}`),null;const s=mx(e);return Nh.mgrsToGeogExtended(s,1,[t],n,r)?new mt(r[0][0],r[0][1],e||at.WGS84):null}function oUt(t,e){const i=[];!e&&/\(.+27/.test(t)&&(e=at.GCS_NAD_1927);const r=mx(e);return lL.usngToGeog(r,1,[t],i)?new mt(i[0][0],i[0][1],e||at.WGS84):null}function aUt(t,e,i){const r=[],n=lVe(i);if(n===-1)return console.warn(`invalid conversionMode: ${i}`),null;const s=mx(e);return h_.utmToGeog(s,1,[t],n,r)?new mt(r[0][0],r[0][1],e||at.WGS84):null}function lUt(t,e,i=0){const r=[[t.x,t.y]],n=[],s=mx(t.spatialReference);let o=0;switch(e){case"dd":o=lT.geogToDd(s,1,r,i,n);break;case"ddm":o=lT.geogToDdm(s,1,r,i,n);break;case"dms":o=lT.geogToDms(s,1,r,i,n);break;default:return console.warn(`invalid format: ${e}`),null}return o?n[0]:null}function cUt(t,e,i=0,r=!1){const n=[[t.x,t.y]],s=[],o=mx(t.spatialReference);let l=aVe(e);return l===-1?(console.warn(`invalid conversionMode: ${e}`),null):(r&&(l|=Nh.PE_MGRS_ADD_SPACES),Nh.geogToMgrsExtended(o,1,n,i,!1,l,s)?s[0]:null)}function uUt(t,e=0,i=!1){const r=[[t.x,t.y]],n=[],s=mx(t.spatialReference);return lL.geogToUsng(s,1,r,e,!1,i,n)?n[0]:null}function hUt(t,e,i=!1){const r=[[t.x,t.y]],n=[],s=mx(t.spatialReference);let o=lVe(e);return o===-1?(console.warn(`invalid conversionMode: ${e}`),null):(i&&(o|=h_.PE_UTM_OPTS_ADD_SPACES),h_.geogToUtm(s,1,r,o,n)?n[0]:null)}function mx(t){let e=null;if(t||(t=at.WGS84),t.wkid){if(e=aL.geogcs(t.wkid),!e)throw new se("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!t.wkt2&&!t.wkt)throw new se("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(e=aL.fromString(to.PE_TYPE_GEOGCS,t.wkt2||t.wkt),!e)throw new se("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return e}function aVe(t){let e=-1;switch(t){case"automatic":e=Nh.PE_MGRS_STYLE_AUTO;break;case"new-180-in-zone-01":e=Nh.PE_MGRS_STYLE_NEW|Nh.PE_MGRS_180_ZONE_1_PLUS;break;case"new-180-in-zone-60":e=Nh.PE_MGRS_STYLE_NEW;break;case"old-180-in-zone-01":e=Nh.PE_MGRS_STYLE_OLD|Nh.PE_MGRS_180_ZONE_1_PLUS;break;case"old-180-in-zone-60":e=Nh.PE_MGRS_STYLE_OLD}return e}function lVe(t){let e=-1;switch(t){case"latitude-band-indicators":e=h_.PE_UTM_OPTS_NONE;break;case"north-south-indicators":e=h_.PE_UTM_OPTS_NS}return e}let Lu=class extends ze{constructor(e){super(e),this.conversionInfo=null,this.coordinateSegments=null,this._currentPattern=void 0,this.defaultPattern=null,this.name=null,this.viewModel=null}get currentPattern(){return(this._currentPattern||this.defaultPattern)??""}set currentPattern(e){this._currentPattern=e}get label(){return this.name??""}set label(e){this._overrideIfSome("label",e)}get hasDisplayProperties(){return!(!this.defaultPattern||!this.coordinateSegments)}get spatialReference(){var e;return this.name==="basemap"?this._viewSpatialReference:((e=this.conversionInfo)==null?void 0:e.spatialReference)??at.WGS84}set spatialReference(e){this._overrideIfSome("spatialReference",e)}get _viewSpatialReference(){var e,i;return((i=(e=this.viewModel)==null?void 0:e.view)==null?void 0:i.spatialReference)??at.WGS84}get _additionalCharactersPattern(){const e=this.coordinateSegments;if(!e)return null;const i=e.map(n=>n.alias),r=this.currentPattern.replaceAll(new RegExp(`["nsew${i.join()}]`,"gi"),"").replaceAll(" ","");return new RegExp(`[${r}]`,"g")}get test(){return{additionalCharactersPattern:this._additionalCharactersPattern}}async convert(e){var n;if(!wre(e))throw new se("format:invalid-point","Could not convert invalid point.",{point:e});const i=(n=this.conversionInfo)==null?void 0:n.convert;if(i)return Promise.resolve().then(()=>i(e));const r=await this._project(e,this.spatialReference);return{location:r,coordinate:await this._getCoordinate(r)}}getConversionStrategy(){var i,r;const e=this._viewSpatialReference;return(i=this.conversionInfo)!=null&&i.convert||(r=this.viewModel)!=null&&r.formatterAvailable||this.name==="xy"&&(e.isWebMercator||e.isWGS84)||this.name==="basemap"?"client":"server"}getDisplayCoordinate(e){if(!e)return null;if(!this.coordinateSegments||!this.currentPattern)return e;let i=this.currentPattern;const r=this._getSegmentMatches(e,!1);for(let n=this.coordinateSegments.length-1;n>=0;n--){const s=this.coordinateSegments[n];i=i.replace(s.alias,r[n])}return i}parseUserInput(e){const{defaultPattern:i,_additionalCharactersPattern:r,coordinateSegments:n}=this;if(!i||!r)return"";let s=i.replace(r,"");e=e.replace(r,"");const o=this._getSegmentMatches(e,!0);if(n)for(let l=n.length-1;l>=0;l--){const c=n[l];s=s.replace(c.alias,o[l])}return s}_getSegmentMatches(e,i){const r=new Array,{coordinateSegments:n}=this;if(!n)return r;for(let s=0;sF!=null&&Object.keys(T).includes(F),I=new RegExp(`\\d{1,2}[\\.|\\${l}]?\\d*`,"i"),L=new RegExp(`\\d{1,3}[\\.|\\${l}]?\\d*`,"i");e.forEach(F=>{const{name:z}=F;if(z==="dd"?F.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:t.abbreviatedDirections.north,description:"north/south indicator",searchPattern:_,substitution:{input:k=>c[k],output:k=>t.abbreviatedDirections[rA[k]]}},{alias:"X",description:"degrees longitude",searchPattern:L,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:t.abbreviatedDirections.east,description:"east/west indicator",searchPattern:x,substitution:{input:k=>c[k],output:k=>t.abbreviatedDirections[rA[k]]}}]:z==="ddm"?F.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"A",description:"minutes latitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:t.abbreviatedDirections.north,description:"north/south indicator",searchPattern:_,substitution:{input:k=>c[k],output:k=>t.abbreviatedDirections[rA[k]]}},{alias:"X",description:"degrees longitude",searchPattern:L,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"B",description:"minutes longitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:t.abbreviatedDirections.east,description:"east/west indicator",searchPattern:x,substitution:{input:k=>c[k],output:k=>t.abbreviatedDirections[rA[k]]}}]:z==="dms"?F.coordinateSegments=[{alias:"Y",description:"degrees latitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"A",description:"minutes latitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"B",description:"seconds latitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:t.abbreviatedDirections.north,description:"north/south indicator",searchPattern:_,substitution:{input:k=>c[k],output:k=>t.abbreviatedDirections[rA[k]]}},{alias:"X",description:"degrees longitude",searchPattern:L,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"C",description:"minutes longitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"D",description:"seconds longitude",searchPattern:I,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:t.abbreviatedDirections.east,description:"east/west indicator",searchPattern:x,substitution:{input:k=>c[k],output:k=>t.abbreviatedDirections[rA[k]]}}]:(F.name==="xy"||F.name==="basemap")&&(F.coordinateSegments=[{alias:"X",description:"easting",searchPattern:f,substitution:{input:k=>is(k),output:k=>ts(k)}},{alias:"Y",description:"northing",searchPattern:f,substitution:{input:k=>is(k),output:k=>ts(k)}}]),M(z)){const k=i?A[z]:T[z];F.defaultPattern=k,F.currentPattern=k}})}function pUt(){const t=new RegExp("N|S","i"),e=new RegExp("E|W","i");return[new av({name:"basemap",coordinateSegments:[{alias:"X",description:"easting",searchPattern:G8,substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"Y",description:"northing",searchPattern:G8,substitution:{input:i=>is(i),output:i=>ts(i)}}],defaultPattern:"X, Y",viewModel:null}),new av({name:"dd",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${dS}]?\\d*(?=\\D*?[N|S])`,"i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp(`\\d{1,3}[\\.|\\${dS}]?\\d*(?=\\D*?[E|W|])`,"i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${Do}N, X${Do}E`,viewModel:null}),new av({name:"ddm",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?\\s+.*?[N|S])","i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"A",description:"minutes latitude",searchPattern:new RegExp(`\\d{1,2}[\\.\\${dS}]?\\d*(?=.*?[N|S])`,"i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp("\\d{1,3}(?=\\D*?\\s+.*?[E|W])","i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"B",description:"minutes longitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\|${dS}]?\\d*(?=.*?[E|W])`,"i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${Do} A'N, X${Do} B'E`,viewModel:null}),new av({name:"dms",coordinateSegments:[{alias:"Y",description:"degrees latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?\\s+.*?[N|S])","i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"A",description:"minutes latitude",searchPattern:new RegExp("\\d{1,2}(?=.*?[N|S])","i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"B",description:"seconds latitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${dS}]?\\d*(?=.*?[N|S])`,"i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"N",description:"north/south indicator",searchPattern:t},{alias:"X",description:"degrees longitude",searchPattern:new RegExp("\\d{1,3}(?=.*?\\s+.*?[E|W])","i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"C",description:"minutes longitude",searchPattern:new RegExp("\\d{1,2}(?=.*?[E|W])","i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"D",description:"seconds longitude",searchPattern:new RegExp(`\\d{1,2}[\\.|\\${dS}]?\\d*(?=.*?[E|W])`,"i"),substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"E",description:"east/west indicator",searchPattern:e}],defaultPattern:`Y${Do} A' B"N, X${Do} C' D"E`,viewModel:null}),new av({name:"xy",coordinateSegments:[{alias:"X",description:"longitude",searchPattern:G8,substitution:{input:i=>is(i),output:i=>ts(i)}},{alias:"Y",description:"latitude",searchPattern:G8,substitution:{input:i=>is(i),output:i=>ts(i)}}],defaultPattern:`X${Do}, Y${Do}`,viewModel:null}),new av({name:"mgrs",coordinateSegments:[{alias:"Z",description:"grid zone",searchPattern:/\d{1,2}\w|[abyz]/i},{alias:"S",description:"grid square",searchPattern:/\w{2}/},{alias:"X",description:"easting",searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:"Y",description:"northing",searchPattern:/^\d{1,5}/}],defaultPattern:"Z S X Y",viewModel:null}),new av({name:"usng",coordinateSegments:[{alias:"Z",description:"grid zone",searchPattern:/\d{1,2}\w|[abyz]/i},{alias:"S",description:"grid square",searchPattern:/\w{2}/},{alias:"X",description:"easting",searchPattern:/^\d{5}(?=.?\d{5}$)|^\d{4}(?=.?\d{4}$)|^\d{3}(?=.?\d{3}$)|^\d{2}(?=.?\d{2}$)|^\d(?=.?\d$)/},{alias:"Y",description:"northing",searchPattern:/^\d{1,5}/}],defaultPattern:"Z S X Y",viewModel:null}),new av({name:"utm",coordinateSegments:[{alias:"Z",description:"zone number",searchPattern:/\d{1,2}|[abyz]/i},{alias:"B",description:"latitude band",searchPattern:/^\D/},{alias:"X",description:"easting",searchPattern:/\d{1,7}(?=\s*\d{7}$)/},{alias:"Y",description:"northing",searchPattern:/\d{1,7}/}],defaultPattern:"ZB X Y",viewModel:null})]}function ts(t){const e=t.match(dUt),i=e?e[0]:"",r=t.includes(".")?t.split(".")[1].length:0;return i+Jzt(Number(t),{pattern:"###0.###",places:r,round:-1})}function is(t){return tUt(t)}const H8={default:"default",crosshair:"crosshair"},fUt=new mt([0,0,500]),mUt="xy",gUt=["mgrs","utm","usng","dd","dms","ddm"],lxe="esri__coordinateConversionWidgetState",gg={conversions:"conversions",formats:"formats",view:"view",viewChange:"view-change"},yUt="esri/images/search/search-symbol-32.png";let ac=class extends LG(Dn.EventedAccessor){constructor(e){super(e),this._conversionPromise=null,this._locationGraphic=null,this._pointerCount=0,this.conversions=new it,this.formats=new it,this.formatterAvailable=!1,this.messages=null,this.filteredFormats=new it,this.locationSymbol=new dP({url:Wr(yUt),width:24,height:24}),this.storageEnabled=!0,this.storageType="session",this.view=null,this._saveWidgetState=this._saveWidgetState.bind(this),this._handleFormatChange=this._handleFormatChange.bind(this),this._handleConversionChange=this._handleConversionChange.bind(this),this._handleViewChange=this._handleViewChange.bind(this),this._onClick=this._onClick.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerUp=this._onPointerUp.bind(this)}initialize(){const e=async()=>this.messages=await lE("esri/widgets/CoordinateConversion/t9n/CoordinateConversion");this.formats.addMany(pUt()),e().then(()=>{if(!this.destroyed&&(axe(this.messages,this.formats),this.storageEnabled&&this._loadWidgetState(),this.formats.forEach(i=>{i.viewModel=this,this.addHandles(_e(()=>i.currentPattern,this._saveWidgetState),i.name??"unnamed-format")}),this.addHandles(this.conversions.on("change",this._handleConversionChange),gg.conversions),this.addHandles(this.formats.on("change",this._handleFormatChange),gg.formats),this.addHandles(oE(()=>{e().then(()=>{axe(this.messages,this.formats)})})),g_().then(()=>{this.formatterAvailable=!0}).catch(i=>{Ce.getLogger(this).error(new se("coordinate-conversion:projection-load-failed","Failed to load the projection module.",{error:i})),this.formatterAvailable=!1,this._filterFormatsAndConversions()}).then(()=>this.addHandles(_e(()=>this.view,this._handleViewChange,ii),gg.viewChange)),this.conversions.length===0)){const i=this.formats.find(r=>r.name===mUt)||this.formats.at(0);this.conversions.add(new BS({format:i}))}})}destroy(){this.removeHandles(),this._cleanUpView(this.view),this.view=null}castConversions(e){return this._castToConversions(e)}set currentLocation(e){this._set("currentLocation",e),this._updateConversions()}get currentLocation(){return this._get("currentLocation")||null}set mode(e){switch(e){case"capture":this.currentLocation=null,this._startCaptureMode(),this._set("mode",e);break;case"live":this._startLiveMode(),this._set("mode",e)}}get mode(){return this._get("mode")||"live"}get state(){const{messages:e,view:i}=this,r=i==null?void 0:i.ready;return e?r?"ready":i?"loading":"disabled":"disabled"}get storage(){const{storageType:e}=this;return e==="session"?sessionStorage:localStorage}get waitingForConversions(){return this._conversionPromise!=null}setLocation(e){var r,n;if(this._locationGraphic&&((r=this.view)==null||r.graphics.remove(this._locationGraphic)),!e)return;const i=e.clone();i.hasZ&&(i.z=void 0),this._locationGraphic=new Ml({geometry:i,symbol:this.locationSymbol}),(n=this.view)==null||n.graphics.add(this._locationGraphic)}async convert(e,i){if(!wre(i))throw new se("coordinate-conversion:invalid-point","Invalid point cannot be converted.",{point:i});return Promise.resolve().then(()=>e.convert(i))}async goToLocation(e){var s,o,l;const{view:i}=this;if(!i)throw new se("coordinate-conversion:go-to-failed","no view");const r=i.type==="3d"?i.clippingArea:null,n=(o=(s=i.map)==null?void 0:s.basemap)==null?void 0:o.baseLayers;if(r||(n==null?void 0:n.length)>0){const c=r??((l=n.at(0))==null?void 0:l.fullExtent);if(c!=null&&!c.contains(e))throw new se("coordinate-conversion:go-to-failed","Point outside basemap extent.",{point:e})}return this.callGoTo({target:e})}pause(){this.currentLocation=null,this.removeHandles(gg.view),this.view&&(this.view.cursor=H8.default,this._locationGraphic&&this.view.graphics.remove(this._locationGraphic))}async previewConversion(e,i=this.currentLocation||fUt){return(await cxe(e,i)).displayCoordinate}resume(){this.mode==="capture"?this._startCaptureMode():this._startLiveMode()}reverseConvert(e,i){return i.reverseConvert(e)}async updateConversions(e,i){if((i==null?void 0:i.type)!=="point")throw this._clearConversions(this.conversions),new se("coordinate-conversion:invalid-input-point","Point is invalid, conversions cannot be updated.",{point:i});return this._convertMany(e,i)}_castToConversions(e){const i=new it;return e.forEach(r=>{let n=null;if(r instanceof BS)n=r;else if(typeof r=="string"){const s=this.formats.find(o=>o.name===r);s&&(n=new BS({format:s}))}n&&i.add(n)}),i}_cleanUpView(e){e&&(this._locationGraphic&&e.graphics.remove(this._locationGraphic),this.removeHandles(gg.view),e.cursor=H8.default)}_clearConversions(e){e.forEach(i=>{i.position={location:null,coordinate:null}})}async _convertMany(e,i){return Promise.all(e.map(r=>cxe(r,i)))}_handleConversionChange(e){for(const i of e.added){const{format:r}=i;r&&(r.viewModel=this,this.currentLocation&&(this._set("waitingForConversions",!0),this.convert(r,this.currentLocation).then(n=>{i.position=n,this._set("waitingForConversions",!1)})))}this._saveWidgetState()}_handleFormatChange(e){e.added.forEach(i=>{this.addHandles(_e(()=>i.currentPattern,this._saveWidgetState),i.name??"unnamed-format"),i.viewModel=this}),e.removed.forEach(i=>{i.viewModel=null;const r=this.conversions.filter(n=>n.format===i);this.conversions.removeMany(r),i.name&&this.removeHandles(i.name)})}_loadWidgetState(){try{const e=JSON.parse(this.storage.getItem(lxe));e&&this._setWidgetState(e)}catch(e){Ce.getLogger(this).error(new se("coordinate-conversion:invalid-session-storage-json","Could not read from storage.",{error:e}))}}_startCaptureMode(){this.removeHandles(gg.view),this.view&&(this.view.cursor=H8.crosshair,this.currentLocation&&this.setLocation(this.currentLocation),this.addHandles(this.view.on("click",this._onClick),gg.view))}_startLiveMode(){this._pointerCount=0,this.removeHandles(gg.view),this.view&&(this.view.cursor=H8.default,this._locationGraphic&&this.view.graphics.remove(this._locationGraphic),this.addHandles([this.view.on("pointer-down",this._onPointerDown),this.view.on("pointer-up",this._onPointerUp),this.view.on("pointer-move",this._onPointerMove)],gg.view))}_handleViewChange(e,i){i&&i!==e&&this._cleanUpView(i),e&&(this.mode==="capture"?this._startCaptureMode():this._startLiveMode(),i&&this._filterFormatsAndConversions())}_onClick(e){var i;if(e.button===0){const r=(i=this.view)==null?void 0:i.toMap(e),n=r==null?void 0:r.normalize();this.setLocation(n),this.currentLocation=n}}_onPointerDown(e){var r;const{pointerType:i}=e;if(this._pointerCount++,(i==="touch"||i==="pen")&&this._pointerCount===1){const n=(r=this.view)==null?void 0:r.toMap(e);this.currentLocation=n==null?void 0:n.normalize()}}_onPointerMove(e){var r;const{pointerType:i}=e;if(i==="mouse"||this._pointerCount===1){const n=(r=this.view)==null?void 0:r.toMap(e);this.currentLocation=n==null?void 0:n.normalize()}}_onPointerUp(){this._pointerCount--}_setWidgetState(e){try{e.formats.forEach(i=>{const r=this.formats.find(n=>n.name===i.name);r&&e.locale===fa()&&i.currentPattern&&(r.currentPattern=i.currentPattern),r&&i.index>=0&&this.conversions.add(new BS({format:r}))})}catch(i){Ce.getLogger(this).warn(new se("coordinate-conversion:session-storage-read-error","Could not get widget state from stored JSON.",{error:i}))}}_saveWidgetState(){if(!this.storageEnabled)return;const e=this._toJSON();try{this.storage.setItem(lxe,JSON.stringify({formats:e,locale:fa()}))}catch(i){Ce.getLogger(this).error(new se("coordinate-conversion:local-storage-write-error","Could not write to localStorage.",{error:i}))}}async _updateConversions(){try{await this.updateConversions(this.conversions.toArray(),this.currentLocation)}catch{}}_toJSON(){return this.formats.filter(e=>{const i=e.name;return i==="xy"||i==="basemap"||Zzt(i)}).map(e=>({name:e.name,currentPattern:e.currentPattern,defaultPattern:e.defaultPattern,index:this.conversions.findIndex(i=>i.format===e)})).sort((e,i)=>e.index-i.index).toArray()}_filterFormatsAndConversions(){const{formatterAvailable:e,conversions:i,formats:r}=this;e||this.addHandles(Mo(()=>{var n;return(n=this.view)==null?void 0:n.spatialReference},n=>{const s=n.isWebMercator||n.isWGS84,o=r.filter(f=>{const{name:_}=f;return!!vUt(_)||_==="xy"&&!s}),l=this.filteredFormats.filter(f=>f.name==="xy"&&s&&!this.formats.includes(f)),c=i.filter(f=>o.includes(f.format));r.removeMany(o),i.removeMany(c),this.filteredFormats.addMany(o.filter(f=>!this.filteredFormats.includes(f))),r.addMany(l)},{once:!0,initial:!0}),gg.view)}};async function cxe(t,e){var i;try{t.position=await((i=t.format)==null?void 0:i.convert(e))}catch{t.position=null}return t}function vUt(t){return gUt.includes(t)}y([w()],ac.prototype,"conversions",void 0),y([Ci("conversions")],ac.prototype,"castConversions",null),y([w({type:mt})],ac.prototype,"currentLocation",null),y([w()],ac.prototype,"formats",void 0),y([w()],ac.prototype,"messages",void 0),y([w()],ac.prototype,"mode",null),y([w()],ac.prototype,"filteredFormats",void 0),y([w({readOnly:!0})],ac.prototype,"state",null),y([w()],ac.prototype,"locationSymbol",void 0),y([w({readOnly:!0,dependsOn:["storageType"]})],ac.prototype,"storage",null),y([w()],ac.prototype,"storageEnabled",void 0),y([w()],ac.prototype,"storageType",void 0),y([w({readOnly:!0})],ac.prototype,"waitingForConversions",null),y([w()],ac.prototype,"view",void 0),ac=y([Z("esri.widgets.CoordinateConversion.CoordinateConversionViewModel")],ac);const cVe=ac,Jn="esri-coordinate-conversion",Zi={base:Jn,captureMode:`${Jn}--capture-mode`,noBasemap:`${Jn}--no-basemap`,popup:`${Jn}__popup`,clipboardPopup:`${Jn}__clipboard-popup`,conversionList:`${Jn}__conversion-list`,conversionRow:`${Jn}__row`,coordDisplay:`${Jn}__display`,expanded:`${Jn}__conversions-view--expanded`,expandDown:`${Jn}__conversions-view--expand-down`,expandUp:`${Jn}__conversions-view--expand-up`,conversionsView:`${Jn}__conversions-view`,primarySelect:`${Jn}__select-primary`,rowSelect:`${Jn}__select-row`,toolDisplay:`${Jn}__tools`,modeToggle:`${Jn}__mode-toggle`,rowButton:`${Jn}__row-button`,backButton:`${Jn}__back-button`,convertButton:`${Jn}__button`,convertButtonSpan:`${Jn}__convert-button-span`,coordinateInput:`${Jn}__input-coordinate`,inputForm:`${Jn}__input-form`,inputFormGroup:`${Jn}__input-group`,rejectInput:`${Jn}__input-coordinate--rejected`,sectionHeading:`${Jn}__heading`,patternInput:`${Jn}__pattern-input`,settings:`${Jn}__settings`,settingsFormGroup:`${Jn}__settings-group`,settingsFormGroupHorizontal:`${Jn}__settings-group-horizontal`,previewCoordinate:`${Jn}__preview-coordinate`},uxe={settingsButton:!0,inputButton:!0,captureButton:!0,expandButton:!0},_Ut=750,bUt=2500;let xs=class extends cn{constructor(e,i){super(e,i),this._popupMessage=null,this._popupTimeoutId=void 0,this._clipboardPopupTimeoutId=void 0,this._coordinateInput=null,this._badInput=!1,this._goToEnabled=!1,this._conversionFormat=null,this._settingsFormat=null,this._previewConversion=null,this._expanded=!1,this._clipboardPopupVisible=!1,this._popupVisible=!1,this._settingsVisible=!1,this._inputVisible=!1,this.headingLevel=4,this.messages=null,this.messagesCommon=null,this.orientation="auto",this.viewModel=new cVe,this.visibleElements={...uxe}}get conversions(){return this.viewModel.conversions}set conversions(e){this.viewModel.conversions=e}get currentLocation(){return this.viewModel.currentLocation}set currentLocation(e){this.viewModel.currentLocation=e}get formats(){return this.viewModel.formats}set formats(e){this.viewModel.formats=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get mode(){return this.viewModel.mode}set mode(e){this.viewModel.mode=e}set multipleConversions(e){e===!1&&(this._expanded=!1,this.conversions.splice(1,this.conversions.length-1)),this._set("multipleConversions",e)}get multipleConversions(){const e=this._get("multipleConversions");return typeof e!="boolean"||e}get locationSymbol(){return this.viewModel.locationSymbol}set locationSymbol(e){this.viewModel.locationSymbol=e}get storageEnabled(){return this.viewModel.storageEnabled}set storageEnabled(e){this.viewModel.storageEnabled=e}get storageType(){return this.viewModel.storageType}set storageType(e){this.viewModel.storageType=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...uxe,...e}}reverseConvert(e,i){return this.viewModel.reverseConvert(e,i)}render(){var c,f;const e=(c=this.viewModel)==null?void 0:c.state,i=e==="disabled"?X("div",{key:"esri-coordinate__no-basemap"},(f=this.messages)==null?void 0:f.noBasemap):null,r=!i&&this._inputVisible?this._renderInputForm():null,n=!i&&this._settingsVisible?this._renderSettings():null,s=i||r||n?null:this._renderConversionsView(),o=this._popupVisible?this._renderPopup():null,l={[Zi.captureMode]:this.mode==="capture",[tt.disabled]:e==="loading",[Zi.noBasemap]:e==="disabled"};return X("div",{class:this.classes(Zi.base,tt.widget,l)},o,i,s,n,r)}_addConversion(e){const i=e.target,r=q8(i.options[i.options.selectedIndex]),n=hxe(i);if(r==null||n==null)return;const s=new BS({format:r});i.options.selectedIndex=0,n>=0?(this.conversions.removeAt(n),this.conversions.add(s,n)):this.conversions.add(s)}_findSettingsFormat(){return this._settingsFormat||this.conversions.reduceRight((e,i)=>{const r=i.format;return r!=null&&r.hasDisplayProperties?r:e},null)||this.formats.find(e=>e.hasDisplayProperties)}_hidePopup(){this._popupTimeoutId&&(clearTimeout(this._popupTimeoutId),this._popupTimeoutId=void 0),this._popupVisible=!1,this._popupMessage=null,this.scheduleRender()}_hideClipboardPopup(){this._clipboardPopupTimeoutId&&(clearTimeout(this._clipboardPopupTimeoutId),this._clipboardPopupTimeoutId=void 0),this._clipboardPopupVisible=!1,this.scheduleRender()}_onConvertComplete(){this._inputVisible=!1,this._coordinateInput.value=""}_onCopy(e){var r,n;const i=(r=wUt(e.currentTarget))==null?void 0:r.displayCoordinate;i!=null&&((n=e.clipboardData)==null||n.setData("text/plain",i),this._showClipboardPopup(),e.preventDefault())}_processUserInput(e){const i=Sf(e),r=this.viewModel;if(i!=="Enter"&&i)this._badInput&&(this._badInput=!1);else{const n=q8(this._coordinateInput);if(!n)return;const s=this._coordinateInput.value;this._reverseConvert(s,n).then(o=>{this.mode==="capture"?r.resume():this.mode="capture",this.currentLocation=o,r.setLocation(o),this._onConvertComplete()}).catch(o=>{var l;Ce.getLogger(this).error(o),this._showPopup((l=this.messages)==null?void 0:l.invalidCoordinate),this._badInput=!0})}}async _reverseConvert(e,i){const r=this.viewModel,n=await i.reverseConvert(e);return this._goToEnabled&&n&&r.goToLocation(n).catch(s=>{var o;Ce.getLogger(this).warn(s),this._showPopup((o=this.messages)==null?void 0:o.locationOffBasemap)}),n}_setInputFormat(e){const i=e.target,r=q8(i[i.options.selectedIndex]);r!=null&&(this._conversionFormat=r)}_setPreviewConversion(){var r,n;const e=this._findSettingsFormat(),i=this.viewModel;if(e){const s=this.conversions.find(o=>o.format===e);this._previewConversion=new BS({format:e,position:{location:this.currentLocation,coordinate:(r=s==null?void 0:s.position)==null?void 0:r.coordinate}}),(n=this._previewConversion.position)!=null&&n.coordinate||i.previewConversion(this._previewConversion)}}_setSettingsFormat(e){const i=e.target,r=q8(i[i.options.selectedIndex]);r!=null&&(this._settingsFormat=r,this._setPreviewConversion())}_showClipboardPopup(){this._clipboardPopupVisible?clearTimeout(this._clipboardPopupTimeoutId):this._clipboardPopupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hideClipboardPopup()},_Ut)}_showPopup(e,i=bUt){this._popupMessage=e,this._popupVisible?clearTimeout(this._popupTimeoutId):this._popupVisible=!0,this.scheduleRender(),this._popupTimeoutId=setTimeout(()=>{this._popupTimeoutId=void 0,this._hidePopup()},i)}_toggleGoTo(){this._goToEnabled=!this._goToEnabled}_updateCurrentPattern(e){e.stopPropagation();const i=e.target,r=this._findSettingsFormat();r&&(r.currentPattern=i.value)}_renderConversion(e,i){const{messages:r}=this;if(!r)return X("li",null);const{format:n}=e,s=(n==null?void 0:n.label)??"",o=`${this.id}__list-item-${i}`,l=`${s} ${r.conversionOutputSuffix}`,c=i===0,f=c||this._expanded,_=c?this._renderFirstConversion(e):this._renderTools(i,e,o),x=c&&!e.displayCoordinate?r.noLocation:e.displayCoordinate,T=X("div",{"aria-label":x,class:Zi.coordDisplay,"data-conversion":e,role:"listitem",tabIndex:0,title:x??""},x),A=this._renderOptions(this.formats.filter(M=>M!==n));return f?X("li",{"aria-label":l,class:Zi.conversionRow,id:o,key:e,role:"group",tabIndex:0,title:l},X("select",{"aria-controls":o,"aria-label":r.selectFormat,bind:this,class:this.classes(tt.select,Zi.rowSelect),"data-index":i,onchange:this._addConversion,title:r.selectFormat},X("option",{"aria-label":s,selected:!0,title:s},s.toUpperCase()),A),T,_):null}_renderCopyButton(e){const i=this._clipboardPopupVisible&&this._renderClipboardPopup(),{messagesCommon:r}=this;return r?X("li",{"aria-label":r.copy,bind:this,class:this.classes(tt.widgetButton,Zi.rowButton),"data-conversion":e,onclick:this._copyCoordinateOutput,oncopy:this._onCopy,onkeydown:this._copyCoordinateOutput,role:"button",tabIndex:0,title:r.copy},i,X("span",{"aria-hidden":"true",class:si.duplicate})):X("li",null)}_renderFirstConversion(e){const i=this.id,r={[si.down]:!this._expanded,[si.up]:this._expanded},{messages:n,messagesCommon:s,multipleConversions:o,visibleElements:l}=this;if(!s||!n)return X("ul",null);const c=this.mode==="live"?n.captureMode:n.liveMode,f=this._expanded?s.collapse:s.expand,_=e.displayCoordinate&&this.mode==="capture"?this._renderCopyButton(e):null,x=o&&l.expandButton&&X("li",{"aria-controls":`${i}__${Zi.conversionList}`,"aria-label":f,bind:this,class:tt.widgetButton,key:"esri-coordinate-conversion__expand-button",onclick:this._toggleExpand,onkeydown:this._toggleExpand,role:"button",tabIndex:0,title:f},X("span",{"aria-hidden":"true",class:this.classes(r)})),T=!o&&l.captureButton&&X("li",{"aria-label":c,bind:this,class:this.classes(tt.widgetButton,Zi.modeToggle),key:"esri-coordinate-conversion__mode-toggle",onclick:this._toggleMode,onkeydown:this._toggleMode,role:"button",tabIndex:0,title:c},X("span",{"aria-hidden":"true",class:si.mapPin}));return X("ul",{class:Zi.toolDisplay},_,x,T)}_renderInputForm(){const e=this._conversionFormat||this.conversions.at(0).format,i=this.formats.findIndex(x=>x.name===(e==null?void 0:e.name)),r=this.id,n=`${r}__${Zi.coordinateInput}`,s=`${r}__${Zi.coordinateInput}__header`,o=this._renderOptions(this.formats,!0,i),l={[Zi.rejectInput]:this._badInput},{messages:c,messagesCommon:f,headingLevel:_}=this;return f&&c?X("div",{"aria-labelledby":s,class:Zi.inputForm,key:"esri-coordinate-conversion__input-form",role:"search"},X("div",{class:Zi.sectionHeading},X("div",{"aria-label":f.back,bind:this,class:this.classes(tt.widgetButton,Zi.backButton),onclick:this._toggleInputVisibility,onkeydown:this._toggleInputVisibility,role:"button",tabIndex:0,title:f.back},this._renderBackIcon()),X(Im,{class:tt.heading,id:s,level:_},c.inputCoordTitle)),X("div",{class:Zi.inputFormGroup},X("select",{"aria-controls":n,"aria-label":c.selectFormat,bind:this,class:this.classes(tt.select,Zi.rowSelect),onchange:this._setInputFormat,title:c.selectFormat},o),X("input",{afterCreate:Vv,"aria-labelledby":s,"aria-required":"true",bind:this,class:this.classes(Zi.coordinateInput,tt.input,l),"data-format":e,"data-node-ref":"_coordinateInput",id:n,onkeydown:this._processUserInput,placeholder:c.inputCoordTitle,role:"textbox",spellcheck:!1,title:c.inputCoordTitle,type:"text"})),X("div",{class:Zi.inputFormGroup},X("label",{"aria-label":c.goTo},X("input",{bind:this,checked:this._goToEnabled,onclick:this._toggleGoTo,title:c.goTo,type:"checkbox"}),c.goTo),X("button",{"aria-label":c.convert,bind:this,class:this.classes(Zi.convertButton,tt.button),onclick:this._processUserInput,title:c.convert,type:"button"},X("span",{class:Zi.convertButtonSpan},c.convert)))):X("div",null)}_renderConversionsView(){const{messages:e}=this;if(!e)return X("div",null);const i=`${this.id}__${Zi.conversionList}`,r=this._renderPrimaryTools(),n=this._renderOptions(this.formats),s=this.conversions.map((c,f)=>this._renderConversion(c,f)).toArray(),o=this._expanded?X("div",{class:Zi.conversionRow},X("select",{"aria-controls":i,"aria-label":e.addConversion,bind:this,class:this.classes(tt.select,Zi.primarySelect),"data-index":-1,onchange:this._addConversion,title:e.addConversion},X("option",{disabled:!0,selected:!0,value:""},e.addConversion),n),r):null,l={[Zi.expanded]:this._expanded,[Zi.expandUp]:this.orientation==="expand-up",[Zi.expandDown]:this.orientation==="expand-down"};return X("div",{class:this.classes(Zi.conversionsView,l),key:"esri-coordinate-conversion__main-view"},X("ul",{"aria-expanded":this._expanded?"true":"false",class:Zi.conversionList,id:i},s),o)}_renderOptions(e,i,r){var o;const n=this.conversions.at(0),s=(o=n.format)==null?void 0:o.name;return e.map((l,c)=>{const f=!(i||!n)&&(s===l.name||this.conversions.map(_=>{var x;return(x=_.format)==null?void 0:x.name}).includes(l.name));return X("option",{"aria-label":l.label,"data-format":l,disabled:f,key:l.name??"unnamed-format",selected:c===r,value:l.label},l.label.toUpperCase())}).toArray()}_renderPopup(){return X("div",{class:Zi.popup,role:"alert"},this._popupMessage)}_renderClipboardPopup(){const{messages:e}=this;return e?X("div",{class:this.classes(Zi.popup,Zi.clipboardPopup),role:"alert"},e.copySuccessMessage):X("div",null)}_renderPrimaryTools(){const{messages:e,visibleElements:i}=this;if(!e)return X("ul",null);const r=this.mode==="live"?e.captureMode:e.liveMode,n=i.inputButton&&X("li",{bind:this,class:tt.widgetButton,onclick:this._toggleInputVisibility,onkeydown:this._toggleInputVisibility,role:"button",tabIndex:0,title:e.inputCoordTitle},X("span",{"aria-hidden":"true",class:si.edit})),s=i.captureButton&&X("li",{bind:this,class:this.classes(tt.widgetButton,Zi.modeToggle),onclick:this._toggleMode,onkeydown:this._toggleMode,role:"button",tabIndex:0,title:r},X("span",{"aria-hidden":"true",class:si.mapPin})),o=i.settingsButton&&X("li",{bind:this,class:tt.widgetButton,onclick:this._toggleSettingsVisibility,onkeydown:this._toggleSettingsVisibility,role:"button",tabIndex:0,title:e.settingsTitle},X("span",{"aria-hidden":"true",class:si.settings2}));return X("ul",{class:Zi.toolDisplay},n,s,o)}_renderSettings(){var A;const e=this.id,i=`${e}__${Zi.patternInput}`,r=`${e}__${Zi.patternInput}__header`,n=`${e}__${Zi.previewCoordinate}`,s=this.formats.filter(M=>M.hasDisplayProperties),o=this._findSettingsFormat(),l=o?s.indexOf(o):-1,c=this._renderOptions(s,!0,l),f=o==null?void 0:o.currentPattern,{messages:_,messagesCommon:x,headingLevel:T}=this;return x&&_?X("div",{"aria-labelledby":r,class:Zi.settings,key:Zi.settings},X("div",{class:Zi.sectionHeading},X("div",{bind:this,class:this.classes(tt.widgetButton,Zi.backButton),onclick:this._toggleSettingsVisibility,onkeydown:this._toggleSettingsVisibility,role:"button",tabIndex:0,title:x.back},this._renderBackIcon()),X(Im,{class:tt.heading,id:r,level:T},_.settingsTitle)),X("div",{class:Zi.settingsFormGroup},X("label",{for:i},_.changeCoordinateDisplay),X("select",{"aria-label":_.selectFormat,bind:this,class:tt.select,onchange:this._setSettingsFormat,title:_.selectFormat},c),X("div",{class:Zi.settingsFormGroupHorizontal},X("input",{"aria-controls":n,bind:this,class:this.classes(Zi.patternInput,tt.input),id:i,oninput:this._updateCurrentPattern,spellcheck:!1,title:_.changeCoordinateDisplay,type:"text",value:f}),X("div",{"aria-controls":i,bind:this,class:tt.widgetButton,onclick:this._setDefaultPattern,onkeydown:this._setDefaultPattern,role:"button",tabIndex:0,title:_.defaultPattern},X("span",{"aria-hidden":"true",class:si.refresh})))),X("div",{class:Zi.settingsFormGroup},X("label",null,x.preview,X("div",{class:Zi.previewCoordinate,id:n,tabIndex:0},(A=this._previewConversion)==null?void 0:A.displayCoordinate)))):X("div",null)}_renderBackIcon(){return X("span",{"aria-hidden":"true",class:RT(this.container)?si.rightArrow:si.leftArrows})}_renderTools(e,i,r){const n=i.displayCoordinate&&this.mode==="capture"?this._renderCopyButton(i):null,{messages:s}=this;return s?X("ul",{class:Zi.toolDisplay,role:"listitem"},n,X("li",{"aria-controls":r,"aria-label":s.removeConversion,bind:this,class:this.classes(tt.widgetButton,Zi.rowButton),"data-index":e,key:`${r}__${tt.widgetButton}`,onclick:this._removeConversion,onkeydown:this._removeConversion,role:"button",tabIndex:0,title:s.removeConversion},X("span",{"aria-hidden":"true",class:si.close}))):X("ul",null)}_copyCoordinateOutput(e){const i=e.target;if(!("createTextRange"in document.body)){const r=window.getSelection(),n=document.createRange();n.selectNodeContents(i),r==null||r.removeAllRanges(),r==null||r.addRange(n)}document.execCommand("copy")}_removeConversion(e){const i=hxe(e.currentTarget);i!=null&&this.conversions.removeAt(i)}_setDefaultPattern(e){e.stopPropagation();const i=this._findSettingsFormat();i&&(i.currentPattern=i.defaultPattern)}_toggleExpand(){this._expanded=!this._expanded}_toggleInputVisibility(){this._inputVisible=!this._inputVisible,this._popupVisible&&this._hidePopup(),this._inputVisible?this.viewModel.pause():this.viewModel.resume()}_toggleMode(){this.mode=this.mode==="live"?"capture":"live"}_toggleSettingsVisibility(){this._settingsVisible=!this._settingsVisible,this._popupVisible&&this._hidePopup(),this._settingsVisible?(this._setPreviewConversion(),this.viewModel.pause()):this.viewModel.resume()}};function hxe(t){return t["data-index"]}function q8(t){return t["data-format"]}function wUt(t){return t["data-conversion"]}y([w()],xs.prototype,"conversions",null),y([w()],xs.prototype,"currentLocation",null),y([w()],xs.prototype,"formats",null),y([w()],xs.prototype,"goToOverride",null),y([w()],xs.prototype,"headingLevel",void 0),y([w()],xs.prototype,"label",null),y([w(),Gr("esri/widgets/CoordinateConversion/t9n/CoordinateConversion")],xs.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],xs.prototype,"messagesCommon",void 0),y([w()],xs.prototype,"mode",null),y([w()],xs.prototype,"orientation",void 0),y([w()],xs.prototype,"multipleConversions",null),y([w()],xs.prototype,"locationSymbol",null),y([w()],xs.prototype,"storageEnabled",null),y([w()],xs.prototype,"storageType",null),y([w()],xs.prototype,"view",null),y([w({type:cVe})],xs.prototype,"viewModel",void 0),y([w()],xs.prototype,"visibleElements",void 0),y([Ci("visibleElements")],xs.prototype,"castVisibleElements",null),y([bo()],xs.prototype,"_copyCoordinateOutput",null),y([bo()],xs.prototype,"_removeConversion",null),y([bo()],xs.prototype,"_setDefaultPattern",null),y([bo()],xs.prototype,"_toggleExpand",null),y([bo()],xs.prototype,"_toggleInputVisibility",null),y([bo()],xs.prototype,"_toggleMode",null),y([bo()],xs.prototype,"_toggleSettingsVisibility",null),xs=y([Z("esri.widgets.CoordinateConversion")],xs);const xUt=xs,xX=/-?\d+[\.]?\d*/,SUt=t=>new xUt({view:t}),TUt=()=>new av({name:"XYZ",conversionInfo:{convert:function(t){const e=t,i=e.x.toFixed(2),r=e.y.toFixed(2),n=e.z.toFixed(2);return{location:e,coordinate:`${i}, ${r}, ${n}`}},reverseConvert:function(t){const e=t.split(",");return new mt({x:parseFloat(e[0]),y:parseFloat(e[1]),z:parseFloat(e[2]),spatialReference:{wkid:3301}})}},coordinateSegments:[{alias:"X",description:"Longitude",searchPattern:xX},{alias:"Y",description:"Latitude",searchPattern:xX},{alias:"Z",description:"Elevation",searchPattern:xX}],defaultPattern:"X, Y, Z"});let EUt=0,lv=class extends P_(Xs(I_(ze))){constructor(e){super(e),this.id=`${Date.now().toString(16)}-analysis-${EUt++}`,this.title=null}get parent(){return this._get("parent")}set parent(e){const i=this.parent;if(i!=null)switch(i.type){case"line-of-sight":case"dimension":i.releaseAnalysis(this);break;case"2d":case"3d":i.analyses.includes(this)&&i.analyses.remove(this)}this._set("parent",e)}get isEditable(){return this.requiredPropertiesForEditing.every(ys)}};y([w({type:String,constructOnly:!0,clonable:!1})],lv.prototype,"id",void 0),y([w({type:String})],lv.prototype,"title",void 0),y([w({constructOnly:!0})],lv.prototype,"type",void 0),y([w({clonable:!1,value:null})],lv.prototype,"parent",null),y([w({readOnly:!0})],lv.prototype,"isEditable",null),y([w({readOnly:!0})],lv.prototype,"requiredPropertiesForEditing",void 0),lv=y([Z("esri.analysis.Analysis")],lv);const uVe=lv;function hVe(t,e){return dxe(t)===dxe(e)}function dxe(t){if(t==null)return null;const e=t.layer!=null?t.layer.id:"";let i=null;return i=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,i==null?null:`o-${e}-${i}`}const dVe={json:{write:{writer:CUt,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:AUt}}}};function CUt(t,e){var i;((i=t==null?void 0:t.layer)==null?void 0:i.objectIdField)!=null&&t.attributes!=null&&(e.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function AUt(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}let lM=class extends P_(Xs(ze)){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return FO(this.position,e.position)&&FO(this.elevationInfo,e.elevationInfo)&&hVe(this.feature,e.feature)}};y([w({type:mt,json:{write:{isRequired:!0}}})],lM.prototype,"position",void 0),y([w({type:BB}),Dv()],lM.prototype,"elevationInfo",void 0),y([w(dVe)],lM.prototype,"feature",void 0),lM=y([Z("esri.analysis.LineOfSightAnalysisObserver")],lM);const pVe=lM;let cM=class extends P_(QZ){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return FO(this.position,e.position)&&FO(this.elevationInfo,e.elevationInfo)&&hVe(this.feature,e.feature)}};y([w({type:mt}),Dv()],cM.prototype,"position",void 0),y([w({type:BB}),Dv()],cM.prototype,"elevationInfo",void 0),y([w(dVe)],cM.prototype,"feature",void 0),cM=y([Z("esri.analysis.LineOfSightAnalysisTarget")],cM);const fVe=cM,xre=it.ofType(fVe);let cv=class extends uVe{constructor(e){super(e),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles(_e(()=>this._computeExtent(),e=>{(e==null?void 0:e.pending)==null&&this._set("extent",e!=null?e.extent:null)},kt))}get targets(){return this._get("targets")||new xre}set targets(e){this._set("targets",sd(e,this.targets,xre))}get spatialReference(){var e;return((e=this.observer)==null?void 0:e.position)!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){var e;return[(e=this.observer)==null?void 0:e.position]}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){var o;const e=this.spatialReference;if(((o=this.observer)==null?void 0:o.position)==null||e==null)return null;const i=l=>xoe(l.position,l.elevationInfo)==="absolute-height",r=this.observer.position,n=P2(r.x,r.y,r.z,r.x,r.y,r.z);for(const l of this.targets)if(l.position!=null){const c=$5e(l.position,e);if(c.pending!=null)return{pending:c.pending,extent:null};if(c.geometry!=null){const{x:f,y:_,z:x}=c.geometry;qf(n,[f,_,x])}}const s=Trt(n,e);return i(this.observer)&&this.targets.every(i)||(s.zmin=void 0,s.zmax=void 0),{pending:null,extent:s}}clear(){this.observer=null,this.targets.removeAll()}};y([w({type:["line-of-sight"]})],cv.prototype,"type",void 0),y([w({type:pVe,json:{read:!0,write:!0}})],cv.prototype,"observer",void 0),y([w({cast:nP,type:xre,nonNullable:!0,json:{read:!0,write:!0}})],cv.prototype,"targets",null),y([w({value:null,readOnly:!0})],cv.prototype,"extent",void 0),y([w({readOnly:!0})],cv.prototype,"spatialReference",null),y([w({readOnly:!0})],cv.prototype,"requiredPropertiesForEditing",null),cv=y([Z("esri.analysis.LineOfSightAnalysis")],cv);const mVe=cv;let pS=class extends ze{constructor(e){super(e),this.location=null,this.intersectedLocation=null,this.intersectedGraphic=null,this.visible=void 0}};y([w({type:mt})],pS.prototype,"location",void 0),y([w({type:mt})],pS.prototype,"intersectedLocation",void 0),y([w({type:Ml})],pS.prototype,"intersectedGraphic",void 0),y([w({type:Boolean})],pS.prototype,"visible",void 0),pS=y([Z("esri.widgets.lineOfSight.LineOfSightTarget")],pS);const gVe=pS;var RO;(function(t){t[t.PENDING=0]="PENDING",t[t.WAIT_FOR_VIEW_READY=1]="WAIT_FOR_VIEW_READY",t[t.RUNNING=2]="RUNNING"})(RO||(RO={}));let hc=class extends ze{constructor(e={}){super(e),this.view=null,this.analysisView=null,this._reconnectViewTask=null,this._forceInteractiveHandle=null,this._parentChangeFromReconnect=!1,this._startUserOperation=null,this.logger=Ce.getLogger(this);const i=e==null?void 0:e.analysis;i!=null?this.analysis=i:(this._set("analysis",this.constructAnalysis()),this._set("isAnalysisOwner",!0)),(e==null?void 0:e.visible)!=null&&(this.visible=e.visible)}normalizeCtorArgs(e){const{analysis:i,...r}=e;return r}initialize(){this.addHandles([_e(()=>({readyAndNotSupported:this.view!=null&&this.view.ready&&!this.supported}),({readyAndNotSupported:e})=>{e&&this.logger.errorOnce(this.unsupportedErrorMessage)},kt),_e(()=>{var e;return(e=this.analysis)==null?void 0:e.parent},e=>{this._parentChangeFromReconnect||e===this.view||this._set("isAnalysisOwner",!1);const i=!this._parentChangeFromReconnect;this._parentChangeFromReconnect=!1,i&&this._scheduleViewReconnect()},Li),_e(()=>({view:this.view,ready:this.view!=null&&this.view.ready,supported:this.supported}),({view:e},i)=>{const r=i==null?void 0:i.view;e!==r&&(this._startUserOperation=gn(this._startUserOperation),this._disconnectFromView(r)),this._scheduleViewReconnect()},kt)])}destroy(){this._reconnectViewTask=gn(this._reconnectViewTask),this._startUserOperation=gn(this._startUserOperation),this.analysisView!=null&&(this.analysisView.visible=void 0),this._disconnectFromView(this.view),this._set("view",null),this.analysis!=null&&this.isAnalysisOwner&&(this.analysis.destroy(),this._set("analysis",null))}get supported(){return this.view==null||this.view.type===this.supportedViewType}set visible(e){this._set("visible",e),this.analysisView!=null&&(this.analysisView.visible=e)}get active(){return this.tool!=null&&this.tool.active}get disabled(){return this.view==null||!this.view.ready||!this.supported}set analysis(e){e!==this._get("analysis")&&(this._startUserOperation=gn(this._startUserOperation),this._disconnectFromView(this.view),this._setExternalAnalysis(e),this._scheduleViewReconnect())}get ready(){return this.analysisView!=null&&!this.connectingToView}get connectingToView(){return this._reconnectViewTask!=null}get isAnalysisOwner(){return this._get("isAnalysisOwner")}get tool(){return this.analysisView!=null?this.analysisView.tool:null}clear(){this._startUserOperation=gn(this._startUserOperation),this._resetInteractiveCreationState(),this.tool!=null&&this.view!=null&&this.view.activeTool===this.tool&&(this.view.activeTool=null)}async start(){this.clear();const e={task:null,abort:null,state:RO.PENDING},i=Cc(async r=>{if(e.state=RO.WAIT_FOR_VIEW_READY,await rd(()=>this.ready,r),e.state=RO.RUNNING,this.analysisView==null||this.view==null)return;const n=this.analysisView.tool;n!=null&&(this.view.activeTool=n,Mo(()=>n.created,()=>{n.active&&this.view!=null&&(this.view.activeTool=null)},{initial:!0,once:!0}))});return e.task=i,e.abort=()=>i.abort(),this._startUserOperation=e,i.promise}onConnectToAnalysisView(e){}onDisconnectFromAnalysisView(){}_scheduleViewReconnect(){this._reconnectViewTask=gn(this._reconnectViewTask);const e=Cc(async i=>{try{await this._reconnectView(i)}catch(r){if(St(i),!sn(r))return void this.logger.warn("Failed to use analysis in view model",r);throw r}finally{e===this._reconnectViewTask&&(this._reconnectViewTask=null)}});this._reconnectViewTask=e}async _reconnectView(e){const{view:i}=this,r=i!=null&&i.ready&&this.supported,n=this.analysis;if(this._startUserOperation=pxe(this._startUserOperation),this._disconnectFromView(i),r&&i!=null&&n!=null){if(this.isAnalysisOwner){if(n.parent!=null)return void this.logger.errorOnce("expected owned analysis to have null parent when connecting to view");this._parentChangeFromReconnect=!0,i.analyses.add(n)}this.analysisView=await i.whenAnalysisView(n),xo(e)?this._startUserOperation=pxe(this._startUserOperation):(this.analysisView.visible=this.visible,this._forceInteractiveHandle=this.analysisView.forceInteractiveForViewModel(),this.addHandles(this._forceInteractiveHandle),this.onConnectToAnalysisView(this.analysisView))}}_disconnectFromView(e){e!=null&&this.isAnalysisOwner&&e.analyses.includes(this.analysis)&&(this._parentChangeFromReconnect=!0,this.analysis.clear(),e.analyses.remove(this.analysis)),this.onDisconnectFromAnalysisView(),this._forceInteractiveHandle=en(this._forceInteractiveHandle),this.analysisView=null}_setExternalAnalysis(e){this.analysisView==null||this.isAnalysisOwner||(this.analysisView.visible=void 0,this._forceInteractiveHandle=en(this._forceInteractiveHandle)),this.analysisView=null,this._set("isAnalysisOwner",!1),this._set("analysis",e),this._parentChangeFromReconnect=!1}_resetInteractiveCreationState(){this.analysis.clear(),this.tool!=null&&this.tool.resetCreated()}get testInfo(){return{analysisView:this.analysisView}}};function pxe(t){return t!=null&&t.state>=RO.RUNNING?(t.abort(),null):t}y([w()],hc.prototype,"supported",null),y([w()],hc.prototype,"view",void 0),y([w({type:Boolean,value:!0})],hc.prototype,"visible",null),y([w()],hc.prototype,"active",null),y([w()],hc.prototype,"disabled",null),y([w({nonNullable:!0})],hc.prototype,"analysis",null),y([w()],hc.prototype,"analysisView",void 0),y([w()],hc.prototype,"ready",null),y([w()],hc.prototype,"connectingToView",null),y([w({readOnly:!0})],hc.prototype,"isAnalysisOwner",null),y([w()],hc.prototype,"_reconnectViewTask",void 0),y([w()],hc.prototype,"_forceInteractiveHandle",void 0),y([w()],hc.prototype,"tool",null),hc=y([Z("esri.widgets.support.AnalysisViewModel")],hc);const Sre=it.ofType(gVe);let fS=class extends hc{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="LineOfSightViewModel is only supported in 3D views.",this._vmTargetsToConnection=new Map,this._analysisTargetsToConnection=new Map}initialize(){this.addHandles([this.targets.on("after-add",e=>this._onViewModelTargetAdded(e.item)),this.targets.on("after-remove",e=>this._onViewModelTargetRemoved(e.item)),_e(()=>this.analysis,e=>this._onAnalysisChange(e),kt)])}destroy(){this._analysisTargetsToConnection.forEach(e=>e.remove())}get state(){return this.disabled||!this.ready?"disabled":this.tool==null?"ready":this.tool.state}get observer(){const{observer:e}=this.analysis;return(e==null?void 0:e.position)==null?null:this._convertAnalysisPointToAbsoluteHeight(e.position,e.elevationInfo)}set observer(e){let i=null;e&&(i=e.clone(),i.hasZ||(i.z=0)),this.analysis.observer=new pVe({position:i})}get targets(){return this._get("targets")||new Sre}set targets(e){this._set("targets",sd(e,this.targets,Sre))}continue(){this.tool!=null&&this.tool.continue()}stop(){this.tool!=null&&this.tool.stop()}get testInfo(){return{analysisView:this.analysisView,getAnalysisTargetFromViewModelTarget:e=>{var i;return(i=this._vmTargetsToConnection.get(e))==null?void 0:i.analysisTarget}}}constructAnalysis(){return new mVe}async onConnectToAnalysisView(e){this.addHandles([e.on("result-changed",i=>{const r=this._analysisTargetsToConnection.get(i.target);r&&(i.result!=null?(r.viewModelTarget.intersectedGraphic=i.result.intersectedGraphic,r.viewModelTarget.intersectedLocation=i.result.intersectedLocation,r.viewModelTarget.visible=i.result.visible):(r.viewModelTarget.intersectedGraphic=null,r.viewModelTarget.intersectedLocation=null,r.viewModelTarget.visible=void 0))})],"view")}onDisconnectFromAnalysisView(){this.removeHandles("view")}_onViewModelTargetAdded(e){if(this._vmTargetsToConnection.get(e))return;const i=new fVe({position:e.location});this._connectViewModelWithAnalysisTarget(e,i),this.analysis.targets.add(i)}_onViewModelTargetRemoved(e){const i=this._vmTargetsToConnection.get(e);i&&(i.remove(),this.analysis.targets.remove(i.analysisTarget))}_onAnalysisTargetAdded(e){if(this._analysisTargetsToConnection.get(e))return;const{position:i}=e,r=new gVe({location:i?this._convertAnalysisPointToAbsoluteHeight(i,e.elevationInfo):null});this._connectViewModelWithAnalysisTarget(r,e),this.targets.add(r)}_onAnalysisTargetRemoved(e){const i=this._analysisTargetsToConnection.get(e);i&&(i.remove(),this.targets.remove(i.viewModelTarget))}_connectViewModelWithAnalysisTarget(e,i){let r=!1;const n=id([_e(()=>({position:i.position,elevationInfo:i.elevationInfo}),({position:o,elevationInfo:l})=>{r||(r=!0,e.location=o?this._convertAnalysisPointToAbsoluteHeight(o,l):null,r=!1)},Li),_e(()=>e.location,o=>{if(!r){r=!0;let l=null;o&&(l=o.clone(),l.hasZ||(l.z=0)),i.position=l,i.elevationInfo=null,r=!1}},Li)]),s={analysisTarget:i,viewModelTarget:e,remove:()=>{n.remove(),this._vmTargetsToConnection.delete(e),this._analysisTargetsToConnection.delete(i)}};this._vmTargetsToConnection.set(e,s),this._analysisTargetsToConnection.set(i,s)}_onAnalysisChange(e){const i="analysis";this.removeHandles(i),this.addHandles([this.analysis.targets.on("after-add",r=>this._onAnalysisTargetAdded(r.item)),this.analysis.targets.on("after-remove",r=>this._onAnalysisTargetRemoved(r.item))],i),this.targets.removeAll(),e.targets.forEach(r=>{this._onAnalysisTargetAdded(r)})}_convertAnalysisPointToAbsoluteHeight(e,i){const r=e.clone();if(this.view!=null){const n=vPe(e.hasZ,i);r.z=bPe(this.view,e,n,ma)}return r}};y([w({type:mVe})],fS.prototype,"analysis",void 0),y([w({readOnly:!0})],fS.prototype,"state",null),y([w()],fS.prototype,"observer",null),y([w({type:Sre,cast:nP,nonNullable:!0})],fS.prototype,"targets",null),fS=y([Z("esri.widgets.lineOfSight.LineOfSightViewModel")],fS);const yVe=fS,sy="esri-line-of-sight",Nb={base:sy,actions:`${sy}__actions`,container:`${sy}__container`,error:`${sy}__error`,hint:`${sy}__hint`,hintText:`${sy}__hint-text`,newAnalysisButton:`${sy}__new-analysis-button`,widgetIcon:si.lineOfSight},W8={newAnalysisButton:`${sy}__new-button`,continueButton:`${sy}__continue-button`,doneButton:`${sy}__done-button`};let ef=class extends cn{constructor(e,i){super(e,i),this.iconClass=Nb.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new yVe,this._onNewAnalysis=()=>{$m(this.viewModel.start())},this._onDone=()=>{this.viewModel.stop()},this._onContinue=()=>{this.viewModel.continue()}}loadDependencies(){return Pl({button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247]))})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){return X("div",{class:this.classes(Nb.base,tt.widget,tt.panel),role:"presentation"},this._renderContainerNode())}_renderContainerNode(){if(!this.visible)return null;if(!this.viewModel.supported)return this._renderUnsupportedMessage();let e=null;const i=[this._renderNewAnalysisButton()];return this.viewModel.state==="creating"?(e=this._renderHint(),i.unshift(this._renderDoneButton())):this.viewModel.state==="created"&&this.viewModel.targets.length>0&&i.unshift(this._renderContinueButton()),X("div",{class:Nb.container},e,X("div",{class:Nb.actions},i))}_renderUnsupportedMessage(){return X("div",{class:Nb.error,key:"esri-line-of-sight__unsupported"},X("p",null,this.messages.unsupported))}_renderHint(){return X("div",{class:Nb.hint,key:"esri-line-of-sight__hint"},X("p",{class:Nb.hintText},this.messages.hint))}_renderNewAnalysisButton(){return this._renderButton({className:Nb.newAnalysisButton,id:W8.newAnalysisButton,label:this.messages.newAnalysis,onClick:this._onNewAnalysis,primary:!0})}_renderDoneButton(){return this._renderButton({id:W8.doneButton,label:this.messages.done,onClick:this._onDone,primary:!1})}_renderContinueButton(){return this._renderButton({id:W8.newAnalysisButton,label:this.messages.continueAnalysis,onClick:this._onContinue,primary:!1})}_renderButton({className:e,id:i,label:r,onClick:n,primary:s}){const o=this.viewModel.state==="disabled";return X("calcite-button",{appearance:s?"solid":"outline-fill",class:e,"data-id":i,disabled:o,key:i,onclick:n},r)}get test(){return{IDS:W8}}};y([w()],ef.prototype,"active",null),y([w({constructOnly:!0,nonNullable:!0})],ef.prototype,"analysis",null),y([w()],ef.prototype,"iconClass",void 0),y([w()],ef.prototype,"icon",void 0),y([w()],ef.prototype,"label",null),y([w(),Gr("esri/widgets/LineOfSight/t9n/LineOfSight")],ef.prototype,"messages",void 0),y([w()],ef.prototype,"view",null),y([w({type:yVe})],ef.prototype,"viewModel",void 0),y([w()],ef.prototype,"visible",null),ef=y([Z("esri.widgets.LineOfSight")],ef);const MUt=ef,OUt=t=>new MUt({view:t,container:"line-of-sight-container"}),PUt=t=>{document.getElementById("LoSstartBtn").addEventListener("click",i=>{const r=document.getElementById("xLOSstart").value,n=document.getElementById("yLOSstart").value,s=document.getElementById("zLoSstart").value;console.log("X-coordinate:",r),console.log("Y-coordinate:",n),console.log("Z-coordinate:",s)})},Ds="esri-search",Kn={base:Ds,widgetIcon:si.search,hasMultipleSources:`${Ds}--multiple-sources`,isLoading:`${Ds}--loading`,isSearching:`${Ds}--searching`,showSuggestions:`${Ds}--show-suggestions`,showSources:`${Ds}--sources`,showWarning:`${Ds}--warning`,container:`${Ds}__container`,input:`${Ds}__input`,inputContainer:`${Ds}__input-container`,form:`${Ds}__form`,submitButton:`${Ds}__submit-button`,sourcesButton:`${Ds}__sources-button`,sourcesButtonDown:`${Ds}__sources-button--down`,sourcesButtonUp:`${Ds}__sources-button--up`,clearButton:`${Ds}__clear-button`,sourceName:`${Ds}__source-name`,suggestionsMenu:`${Ds}__suggestions-menu`,suggestionList:`${Ds}__suggestions-list`,suggestionListCurrentLocation:`${Ds}__suggestions-list--current-location`,sourcesMenu:`${Ds}__sources-menu`,source:`${Ds}__source`,warningMenu:`${Ds}__warning-menu`,warningMenuBody:`${Ds}__warning-body`,warningMenuHeader:`${Ds}__warning-header`,warningMenuText:`${Ds}__warning-text`,noValueText:`${Ds}__no-value-text`},s3="esri-search-result-renderer",o3={base:s3,showMoreResults:`${s3}__more-results--show-more-results`,moreResults:`${s3}__more-results`,moreResultsList:`${s3}__more-results-list`,moreResultsHeader:`${s3}__more-results-header`,moreResultsItem:`${s3}__more-results-item`,moreResultsListHeader:`${s3}__more-results-list-header`};let wa=class extends I_(Ue){constructor(e){super(e),this.autoNavigate=null,this.filter=null,this.getResults=null,this.getSuggestions=null,this.maxResults=null,this.maxSuggestions=null,this.minSuggestCharacters=null,this.outFields=null,this.placeholder="",this.popupEnabled=null,this.popupTemplate=null,this.prefix="",this.resultGraphicEnabled=null,this.resultSymbol=null,this.suggestionsEnabled=null,this.suffix="",this.withinViewEnabled=!1,this.zoomScale=null}};y([w()],wa.prototype,"autoNavigate",void 0),y([w()],wa.prototype,"filter",void 0),y([w()],wa.prototype,"getResults",void 0),y([w()],wa.prototype,"getSuggestions",void 0),y([w()],wa.prototype,"maxResults",void 0),y([w()],wa.prototype,"maxSuggestions",void 0),y([w()],wa.prototype,"minSuggestCharacters",void 0),y([w()],wa.prototype,"outFields",void 0),y([w()],wa.prototype,"placeholder",void 0),y([w()],wa.prototype,"popupEnabled",void 0),y([w()],wa.prototype,"popupTemplate",void 0),y([w()],wa.prototype,"prefix",void 0),y([w()],wa.prototype,"resultGraphicEnabled",void 0),y([w()],wa.prototype,"resultSymbol",void 0),y([w()],wa.prototype,"suggestionsEnabled",void 0),y([w()],wa.prototype,"suffix",void 0),y([w()],wa.prototype,"withinViewEnabled",void 0),y([w()],wa.prototype,"zoomScale",void 0),wa=y([Z("esri.widgets.Search.SearchSource")],wa);const UG=wa,fxe=Ce.getLogger("esri.widgets.Search.support.geometryUtils");function RUt(t,e){var r,n;if(!e)return fxe.error("missing-parameter: view is missing."),Promise.reject(new se("searchgeometryutils:missing-parameter","view is missing."));if(!t)return fxe.error("missing-parameter: point is missing."),Promise.reject(new se("searchgeometryutils:missing-parameter","point is missing."));if(t.hasZ||e.type==="2d")return Promise.resolve(t);const i=(r=e==null?void 0:e.map)==null?void 0:r.ground;return i!=null&&i.layers.length?i.queryElevation(t,{cache:(n=e.basemapTerrain)==null?void 0:n.elevationQueryCache}).then(s=>s.geometry):Promise.resolve(t)}function mxe(t){if(t==null)return null;switch(t.type){case"point":return t;case"extent":return t.center;case"polygon":return t.centroid;case"multipoint":return t.getPoint(0);case"polyline":return t.getPoint(0,0)}return null}function mue(t,e,i){return t==null?null:t.type==="extent"?t:t.type==="multipoint"||t.type==="polygon"||t.type==="polyline"?t.extent:t.type==="point"?vVe(t,e,i):void 0}function Tre(t,e,i){return t==null||e==null?null:vVe(t.center,e,i)}function vVe(t,e,i){const r=t.hasZ?t.z:void 0;return e!=null&&e.map?(i!=null?Pht(e,i):e.extent).clone().centerAt(t).set({zmax:r,zmin:r}):new Vi({xmin:t.x-.25,ymin:t.y-.25,xmax:t.x+.25,ymax:t.y+.25,spatialReference:t.spatialReference,zmin:r,zmax:r})}const IUt=/https?:\/\/services.*\.arcgis\.com/i,$Ut=/(?:\{([^}]+)\})/g,IO=Ce.getLogger("esri.widgets.Search.support.layerSearchUtils");function LUt(t,e){const{exactMatch:i=!1,location:r,maxResults:n,spatialReference:s,source:o,sourceIndex:l,suggestResult:c,view:f}=t,{layer:_,filter:x,zoomScale:T}=o,A=f==null?void 0:f.scale,M=_Ve(o,f),I=e==null?void 0:e.signal;return wVe(_).then(()=>{const L=_.popupTemplate;return L?L.getRequiredFields(_.fieldsIndex):null}).then(L=>{var he,ce,be,ye;const{objectIdField:F,returnZ:z}=_,k=AVe(o);if(!gue(_,k))throw IO.error("invalid-field: displayField is invalid."),new se("getResults():invalid-field","displayField is invalid.");const U=L&&L.length?L:[k],j=o.outFields||U,H=bVe(j);if(j.includes(F)||H||j.push(F),(he=_.floorInfo)!=null&&he.floorField&&j.push(_.floorInfo.floorField),!(H||RV(_,j)))throw IO.error("invalid-field: outField is invalid."),new se("getResults():invalid-field","outField is invalid.");const Y=_.createQuery(),{orderByFields:Q}=o;if(Q&&(Y.orderByFields=Q),s){Y.outSpatialReference=s;const pe=1/ws(s);pe&&(Y.maxAllowableOffset=pe)}const ne=_.geometryType==="mesh"||_.geometryType==="multipatch",re=((be=(ce=_.capabilities)==null?void 0:ce.data)==null?void 0:be.supportsZ)&&!ne;if(Y.returnZ=re&&z!==!1,Y.returnGeometry=!0,Y.multipatchOption=ne?"xyFootprint":null,j&&(Y.outFields=j),r)Y.geometry=r;else if(c.key)Y.objectIds=[c.key];else{const pe=o.searchFields||[k];if(!RV(_,pe))throw IO.error("invalid-field: search field is invalid."),new se("getResults():invalid-field","search field is invalid.");if(CVe(_)&&(Y.num=n),M&&(Y.geometry=M),!((ye=c.text)==null?void 0:ye.trim()))return[];const te=c.text,{prefix:le="",suffix:de=""}=o,ve=MVe(`${le}${te}${de}`);EVe(_)&&SVe(_,pe)&&!i&&te&&(Y.fullText=TVe({text:te,searchFields:pe}));const Se=OVe({searchTerm:ve,layer:_,searchFields:pe,filter:x,exactMatch:i,query:Y,type:"search"});if(Y.where=Se,!xVe(Y))return[]}return _.queryFeatures(Y,{signal:I}).then(pe=>WUt(pe,f,o,l,k,A,T))})}function DUt(t,e){const{source:i,spatialReference:r,view:n,suggestTerm:s,maxSuggestions:o,sourceIndex:l,exactMatch:c}=t,{layer:f,filter:_}=i,x=e==null?void 0:e.signal,T=_Ve(i,n);return wVe(f).then(()=>{if(!CVe(f))return[];const A=AVe(i),M=i.searchFields||[A],I=[];i.suggestionTemplate?i.suggestionTemplate.replaceAll($Ut,(re,he)=>(I.push(he),re)):I.push(A);const L=bVe(I);I.includes(f.objectIdField)||L||I.push(f.objectIdField);const F=gue(f,A),z=L||RV(f,I),k=RV(f,M);if(!F)throw IO.error("invalid-field: displayField is invalid."),new se("getSuggestions():invalid-field","displayField is invalid.");if(!z)throw IO.error("invalid-field: outField is invalid."),new se("getSuggestions():invalid-field","outField is invalid.");if(!k)throw IO.error("invalid-field: search field is invalid."),new se("getSuggestions():invalid-field","search field is invalid.");const U=f.createQuery(),{orderByFields:j}=i;if(j&&(U.orderByFields=j),U.outSpatialReference=r,U.returnGeometry=!1,U.num=o,U.outFields=I,T&&(U.geometry=T),!s.trim())return[];const{prefix:H="",suffix:Y=""}=i,Q=MVe(`${H}${s}${Y}`);EVe(f)&&SVe(f,M)&&!c&&s&&(U.fullText=TVe({text:s,searchFields:M}));const ne=OVe({searchTerm:Q,layer:f,searchFields:M,filter:_,exactMatch:c,query:U,type:"suggest"});return U.where=ne,xVe(U)?f.queryFeatures(U,{signal:x}).then(re=>GUt(re,i,l,A)):[]})}function _Ve(t,e){const{filter:i,withinViewEnabled:r}=t,n=e==null?void 0:e.extent;return(i==null?void 0:i.geometry)??(r&&n?n:void 0)}function bVe(t){return t&&t.includes("*")}async function wVe(t){t&&await t.load()}function xVe(t){return!(!t.fullText&&!t.where)}function SVe(t,e){const i=t==null?void 0:t.indexes;return!i||!(e!=null&&e.length)?!1:i.filter(r=>r.indexType==="FullText").some(r=>{var s;const n=((s=r.fields)==null?void 0:s.split(",").map(o=>o.trim().toLowerCase()))||[];return e.every(o=>n.includes(o.toLowerCase()))})}function TVe({text:t,searchFields:e}){return t.trim().split(" ").filter(i=>!!i.trim()).map(i=>new nPe({onFields:e,searchTerm:i,searchType:"prefix"}))}function EVe(t){var e,i;return((i=(e=t==null?void 0:t.capabilities)==null?void 0:e.query)==null?void 0:i.supportsFullTextSearch)??!1}function CVe(t){var e,i;return((i=(e=t==null?void 0:t.capabilities)==null?void 0:e.query)==null?void 0:i.supportsPagination)??!1}function NUt(t){var e,i,r;return((r=(i=(e=t==null?void 0:t.fieldsIndex)==null?void 0:e.fields)==null?void 0:i.find(n=>n.type==="string"))==null?void 0:r.name)??""}function AVe(t){return t.displayField||t.layer.displayField||NUt(t.layer)}function RV(t,e){return!(!t||!(e!=null&&e.length))&&e.every(i=>gue(t,i))}function gue(t,e){return!!t.getField(e)}function FUt(t){for(let e=0;e255)return!0;return!1}function kUt(t,e,i){let r=null;const{codedValues:n}=t;return n&&n.some(s=>{const o=s.name,l=i?o:o.toLowerCase();return(i?e:e.toLowerCase())===l&&(r=s.code.toString(),!0)}),r}function MVe(t){return t.replaceAll("'","''")}function UR(t,e){const i=e==null?void 0:e.where;return i?`(${t}) AND (${i})`:t}function zUt({currentTerm:t,field:e,filter:i,exactMatch:r,url:n,type:s}){const o=e==null?void 0:e.type,l=e==null?void 0:e.name;if(o==="string"||o==="date"||o==="global-id"){const c=IUt.test(n??""),f=c&&FUt(t)?"N":"";return UR(r&&s==="search"?`${l} = ${f}'${t}'`:c?`${l} LIKE ${f}${`'${t}%'`}`:`${`LOWER(${l})`} LIKE ${f}${`'${t.toLowerCase()}%'`}`,i)}if(o==="oid"||o==="small-integer"||o==="integer"||o==="single"||o==="double"){const c=Number(t);return isNaN(c)?null:UR(`${l} = ${c}`,i)}return UR(`${l} = ${t}`,i)}function UUt(t,e){return t?` OR (${e})`:`(${e})`}function OVe({searchTerm:t,layer:e,searchFields:i,filter:r,exactMatch:n,query:s,type:o}){const{definitionExpression:l,url:c}=e;let f="";return!s.fullText&&t&&i&&i.forEach(_=>{const x=e.getField(_),T=typeof e.getFieldDomain=="function"&&e.getFieldDomain(_),A=(T&&T.type==="coded-value"?kUt(T,t,n):null)||t||null;if(A!==null){const M=zUt({currentTerm:A,field:x,filter:r,exactMatch:n,url:c,type:o});M&&(f+=UUt(f,M))}}),l&&f?`(${l}) AND (${f})`:l||f}function VUt(t,e){let i=null;const{codedValues:r}=t;return r&&r.length&&r.some(n=>n.code===e&&(i=n.name,!0)),i}function BUt(t,e){return t[Object.keys(t).find(i=>i.toLowerCase()===e.toLowerCase())]}function PVe(t,e,i){const r=t.sourceLayer,{attributes:n}=t,s=typeof r.getFieldDomain=="function"&&r.getFieldDomain(i);if(e)return By(e,n);if(i&&n){const o=r.getField(i),l=BUt(n,i);return l==null?"":s&&s.type==="coded-value"?VUt(s,l)??"":(o==null?void 0:o.type)==="date"?js(new Date(l)):typeof l=="number"?l.toString():typeof l!="string"?"":l.trim()}return""}function jUt(t,e,i,r){const n=t.sourceLayer,{attributes:s}=t,{objectIdField:o}=n,l=o?s[o]:null;return{text:PVe(t,e.suggestionTemplate,r),key:l,sourceIndex:i}}function GUt(t,e,i,r){return t.features.map(n=>jUt(n,e,i,r))}function HUt(t){return t!=null&&t.minScale!=null&&t.maxScale!=null}function qUt(t,e,i,r,n,s,o){const l=t.clone(),c=t.sourceLayer,f=c==null?void 0:c.objectIdField,_=f?t.attributes[f]:null,x=PVe(t,i.searchTemplate,n);s!=null&&HUt(c)&&(c.minScale&&c.minScales&&(s=c.maxScale));const T=mue(l.geometry,e,s),A=typeof o=="number"?Tre(Re(T),e,o):T,M=t.clone();return A!=null&&(M.geometry=Qa.fromExtent(A)),{extent:A,target:M,feature:l,key:_,name:x,sourceIndex:r}}function WUt(t,e,i,r,n,s,o){return t.features.map(l=>qUt(l,e,i,r,n,s,o))}var Ere;let Y0=Ere=class extends UG{constructor(t){super(t),this.displayField=null,this.exactMatch=null,this.orderByFields=null,this.searchFields=null,this.searchTemplate=null,this.suggestionTemplate=null,this.getResults=(e,i)=>LUt({source:this,...e},i),this.getSuggestions=(e,i)=>DUt({source:this,...e},i)}set layer(t){this._set("layer",t),t&&t.load().catch(()=>{})}get name(){return this._getLayerTitle()??""}set name(t){this._overrideIfSome("name",t)}clone(){return new Ere({autoNavigate:this.autoNavigate,filter:this.filter,maxResults:this.maxResults,maxSuggestions:this.maxSuggestions,minSuggestCharacters:this.minSuggestCharacters,outFields:this.outFields?Re(this.outFields):null,placeholder:this.placeholder,popupEnabled:this.popupEnabled,prefix:this.prefix,resultGraphicEnabled:this.resultGraphicEnabled,resultSymbol:this.resultSymbol?this.resultSymbol.clone():null,suggestionsEnabled:this.suggestionsEnabled,suffix:this.suffix,withinViewEnabled:this.withinViewEnabled,displayField:this.displayField,exactMatch:this.exactMatch,layer:this.layer,searchFields:this.searchFields?Re(this.searchFields):null,suggestionTemplate:this.suggestionTemplate,zoomScale:this.zoomScale})}_getFirstStringField(){var t,e;return((e=(t=this.layer.fieldsIndex)==null?void 0:t.fields.find(i=>i.type==="string"))==null?void 0:e.name)??""}_getDisplayField(){return this.displayField||this.layer.displayField||this._getFirstStringField()}_getSearchFieldsString(){const{layer:t,searchFields:e}=this;return t.loaded?`: ${(e||[this._getDisplayField()]).map(i=>{const r=t.getField(i);return(r==null?void 0:r.alias)||i}).join(", ")}`:""}_getLayerTitle(){const{layer:t}=this;if(!t)return;const{title:e}=t;return e?`${e}${this._getSearchFieldsString()}`:void 0}};y([w({json:{read:{source:"field.name"},write:{target:"field.name"}}})],Y0.prototype,"displayField",void 0),y([w({json:{read:{source:"field.exactMatch"},write:{target:"field.exactMatch"}}})],Y0.prototype,"exactMatch",void 0),y([w({value:null})],Y0.prototype,"layer",null),y([w()],Y0.prototype,"name",null),y([w({type:[String],json:{write:!0}})],Y0.prototype,"orderByFields",void 0),y([w()],Y0.prototype,"searchFields",void 0),y([w()],Y0.prototype,"searchTemplate",void 0),y([w()],Y0.prototype,"suggestionTemplate",void 0),Y0=Ere=y([Z("esri.widgets.Search.LayerSearchSource")],Y0);const uM=Y0;function YUt(t){return!!t&&typeof t.x=="number"&&typeof t.y=="number"}function XUt(t){return t&&typeof t.xmin=="number"&&typeof t.ymin=="number"&&typeof t.xmax=="number"&&typeof t.ymax=="number"}let vw=class extends Ue{constructor(e){super(e),this.address=null,this.attributes=null,this.extent=null,this.location=null,this.score=null}};y([w({type:String,json:{write:!0}})],vw.prototype,"address",void 0),y([w({type:Object,json:{write:!0}})],vw.prototype,"attributes",void 0),y([w({type:Vi,json:{write:!0}})],vw.prototype,"extent",void 0),y([w({type:mt,json:{write:!0}})],vw.prototype,"location",void 0),y([w({type:Number,json:{write:!0}})],vw.prototype,"score",void 0),vw=y([Z("esri.rest.support.AddressCandidate")],vw);const RVe=vw,yue={type:String,json:{read:{source:"token"},write:{target:"token"}}};let lc=class extends Ue{constructor(e){super(e),this.address=null,this.apiKey=null,this.categories=null,this.countryCode=null,this.forStorage=null,this.location=null,this.locationType=null,this.magicKey=null,this.maxLocations=null,this.outFields=null,this.outSpatialReference=null,this.searchExtent=null}};y([w({type:Object,json:{write:!0}})],lc.prototype,"address",void 0),y([w(yue)],lc.prototype,"apiKey",void 0),y([w({type:[String],json:{read:{source:"category",reader:t=>t?t.split(","):null},write:{target:"category",writer:(t,e)=>{e.category=t?t.join(","):null}}}})],lc.prototype,"categories",void 0),y([w({type:String,json:{write:!0}})],lc.prototype,"countryCode",void 0),y([w({type:Boolean,json:{write:!0}})],lc.prototype,"forStorage",void 0),y([w({type:mt,json:{write:{writer:(t,e)=>{e.location=t?t.clone().normalize():null}}}})],lc.prototype,"location",void 0),y([w({type:String,json:{write:!0}})],lc.prototype,"locationType",void 0),y([w({type:String,json:{write:!0}})],lc.prototype,"magicKey",void 0),y([w({type:Number,json:{write:!0}})],lc.prototype,"maxLocations",void 0),y([w({type:[String],json:{write:{writer:(t,e)=>{e.outFields=t?t.join(","):null}}}})],lc.prototype,"outFields",void 0),y([w({type:at,json:{read:{source:"outSR"},write:{target:"outSR"}}})],lc.prototype,"outSpatialReference",void 0),y([w({type:Vi,json:{write:{writer:(t,e)=>{const i=t?t.shiftCentralMeridian():null;e.searchExtent=i}}}})],lc.prototype,"searchExtent",void 0),lc=y([Z("esri.rest.support.AddressToLocationsParameters")],lc),lc.from=$s(lc);const IVe=lc;async function ZUt(t,e,i){e=IVe.from(e);const r=d6(t),{address:n,...s}=e.toJSON(),o={...n,...s,f:"json"},l=bG({...r.query,...o}),c=_G(l,i),f=`${r.path}/findAddressCandidates`;return bi(f,c).then(JUt)}function JUt({data:t}){if(!t)return[];const{candidates:e,spatialReference:i}=t;return e?e.map(r=>{if(!r)return;const{extent:n,location:s}=r,o=!n||XUt(n);return YUt(s)&&o?(n&&(n.spatialReference=i),s&&(s.spatialReference=i),RVe.fromJSON(r)):void 0}):[]}let uv=class extends Ue{constructor(e){super(e),this.apiKey=null,this.location=null,this.locationType=null,this.outSpatialReference=null}};y([w(yue)],uv.prototype,"apiKey",void 0),y([w({type:mt,json:{write:{writer:(t,e)=>{const i=t?t.clone().normalize():null,r=i!==void 0;e.location=r?i:null}}}})],uv.prototype,"location",void 0),y([w({type:String,json:{write:!0}})],uv.prototype,"locationType",void 0),y([w({type:at,json:{read:{source:"outSR"},write:{target:"outSR"}}})],uv.prototype,"outSpatialReference",void 0),uv=y([Z("esri.rest.support.LocationToAddressParameters")],uv),uv.from=$s(uv);const $Ve=uv;async function KUt(t,e,i){e=$Ve.from(e);const r=d6(t),n={...e.toJSON(),f:"json"},s=bG({...r.query,...n}),o=_G(s,i),l=`${r.path}/reverseGeocode`;return bi(l,o).then(QUt)}function QUt({data:t}){if(!t)return;const{address:e,location:i}=t,r=(e==null?void 0:e.Match_addr)||"";return RVe.fromJSON({address:r,attributes:e||{},location:i,score:100})}let hM=class extends Ue{constructor(e){super(e),this.isCollection=null,this.magicKey=null,this.text=null}};y([w({type:Boolean,json:{write:!0}})],hM.prototype,"isCollection",void 0),y([w({type:String,json:{write:!0}})],hM.prototype,"magicKey",void 0),y([w({type:String,json:{write:!0}})],hM.prototype,"text",void 0),hM=y([Z("esri.rest.support.SuggestionCandidate")],hM);const eVt=hM;let kd=class extends Ue{constructor(e){super(e),this.apiKey=null,this.categories=null,this.countryCode=null,this.location=null,this.maxSuggestions=null,this.outSpatialReference=null,this.searchExtent=null,this.text=null}};y([w(yue)],kd.prototype,"apiKey",void 0),y([w({type:[String],json:{read:{source:"category",reader:t=>t?t.split(","):null},write:{target:"category",writer:(t,e)=>{e.category=t?t.join(","):null}}}})],kd.prototype,"categories",void 0),y([w({type:String,json:{write:!0}})],kd.prototype,"countryCode",void 0),y([w({type:mt,json:{write:{writer:(t,e)=>{e.location=t?t.clone().normalize():null}}}})],kd.prototype,"location",void 0),y([w({type:Number,json:{write:!0}})],kd.prototype,"maxSuggestions",void 0),y([w({type:at,json:{read:{source:"outSR"},write:{target:"outSR"}}})],kd.prototype,"outSpatialReference",void 0),y([w({type:Vi,json:{write:{writer:(t,e)=>{const i=t?t.shiftCentralMeridian():null;e.searchExtent=JSON.stringify(i)}}}})],kd.prototype,"searchExtent",void 0),y([w({type:String,json:{write:!0}})],kd.prototype,"text",void 0),kd=y([Z("esri.rest.support.SuggestLocationsParameters")],kd),kd.from=$s(kd);const LVe=kd;async function tVt(t,e,i){const r=d6(t),n={...(e=LVe.from(e)).toJSON(),f:"json"},s=bG({...r.query,...n}),o=_G(s,i),l=`${r.path}/suggest`;return bi(l,o).then(iVt)}function iVt(t){const{data:e}=t;if(!e)return[];const{suggestions:i}=e;return i?i.map(r=>new eVt(r)):[]}const rVt="Single Line Input",nVt=3e5;function sVt(t,e){return t.location?uVt(t,e):hVt(t,e)}function DVe(t,e){var r;if(e.localSearchDisabled)return null;const i=t==null?void 0:t.scale;return typeof i=="number"&&i<=nVt?(r=t==null?void 0:t.extent)==null?void 0:r.center:null}async function oVt(t,e){const{source:i,spatialReference:r,view:n,suggestTerm:s,maxSuggestions:o,sourceIndex:l}=t,c=new LVe,{apiKey:f,url:_}=i,x=NVe(i,n),T=e==null?void 0:e.signal;if(!_)return null;f&&(c.apiKey=f),i.categories&&(c.categories=i.categories),r&&(c.outSpatialReference=r);const A=DVe(n,i);if(A&&(c.location=A),!s.trim())return null;const{prefix:M="",suffix:I=""}=i,L=`${M}${s}${I}`;return c.text=L,x&&(c.searchExtent=x),c.maxSuggestions=o,i.countryCode&&(c.countryCode=i.countryCode),tVt(_,c,{signal:T}).then(F=>pVt(F,l))}function aVt(t){return!!t&&/(?:geocode\-api\.arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/i.test(t)}function lVt(t){return!!t&&/(?:\/servers\/[\da-z\.-]+\/rest\/services\/world\/geocodeserver).*/i.test(t)}function gxe(t){return!!t&&/(?:arcgis\.com\/arcgis\/rest\/services\/world\/geocodeserver).*/i.test(t)}const cVt="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer";async function uVt(t,e){const{source:i,spatialReference:r,location:n,sourceIndex:s,view:o}=t,{apiKey:l,url:c,zoomScale:f,defaultZoomScale:_}=i;if(c==null)return[];const x=o==null?void 0:o.scale,T=e==null?void 0:e.signal,A=new $Ve;A.location=n,l&&(A.apiKey=l),r&&(A.outSpatialReference=r);try{return FVe([await KUt(c,A,{signal:T})],{sourceIndex:s,scale:x,view:o,zoomScale:f,defaultZoomScale:_})}catch{return[]}}function NVe(t,e){const{filter:i,withinViewEnabled:r}=t,n=e==null?void 0:e.scale,s=e==null?void 0:e.extent,o=i==null?void 0:i.geometry;return mue(o,e,n)||(r&&s?s:void 0)}async function hVt(t,e){var Y;const{source:i,suggestResult:r,spatialReference:n,view:s,maxResults:o,sourceIndex:l}=t,c=i==null?void 0:i.zoomScale,f=i==null?void 0:i.defaultZoomScale;if(!((Y=r.text)==null?void 0:Y.trim()))return null;const x=!r.key&&i.prefix?i.prefix:"",T=!r.key&&i.suffix?i.suffix:"",A=`${x}${r.text}${T}`,M=new IVe,{apiKey:I,url:L}=i,F=s==null?void 0:s.scale,z=NVe(i,s),k=e==null?void 0:e.signal;if(I&&(M.apiKey=I),!L)return null;i.categories&&(M.categories=i.categories),i.locationType&&(M.locationType=i.locationType),n&&(M.outSpatialReference=n);const U=DVe(s,i);U&&(M.location=U),M.maxLocations=o,z&&(M.searchExtent=z),i.countryCode&&(M.countryCode=i.countryCode);const{key:j}=r,H=`${j}`;return j&&(M.magicKey=H),M.address={},M.address[i.singleLineFieldName||rVt]=A,i.outFields&&(M.outFields=i.outFields),ZUt(L,M,{signal:k}).then(Q=>FVe(Q,{key:H,scale:F,sourceIndex:l,view:s,zoomScale:c,defaultZoomScale:f}))}function dVt(t,e){return{text:t.text,key:t.magicKey,sourceIndex:e}}function pVt(t,e){return t.map(i=>dVt(i,e))}function fVt(t,e){const{key:i,scale:r,sourceIndex:n,view:s,zoomScale:o,defaultZoomScale:l}=e,{attributes:c,extent:f,location:_,address:x}=t,T=new Ml({geometry:_,attributes:c}),A=f||_,M=mue(A,s,r),I=typeof o=="number"?Tre(M,s,o):typeof l=="number"&&(A==null?void 0:A.type)==="point"?Tre(M,s,l):M,L=_?`${_.x},${_.y}`:"",F=x||L,z=T.clone();return I!=null&&(z.geometry=Qa.fromExtent(I)),{extent:I,feature:T,target:z,key:i,name:F,sourceIndex:n}}function FVe(t,e){return t.filter(Boolean).map(i=>fVt(i,e))}var Cre;const mVt="esri.widgets.Search.LocatorSearchSource";let Xc=Cre=class extends UG{constructor(t){super(t),this.apiKey=null,this.categories=null,this.countryCode=null,this.defaultZoomScale=null,this.localSearchDisabled=!1,this.locationType=null,this.name="",this.placeholder="",this.searchTemplate="",this.singleLineFieldName=null,this.suggestionsEnabled=null,this.url=null,this.zoomScale=null,this.getResults=(e,i)=>sVt({source:this,...e},i),this.getSuggestions=(e,i)=>oVt({source:this,...e},i)}clone(){return new Cre({apiKey:this.apiKey,autoNavigate:this.autoNavigate,filter:this.filter,maxResults:this.maxResults,maxSuggestions:this.maxSuggestions,minSuggestCharacters:this.minSuggestCharacters,outFields:this.outFields?Re(this.outFields):null,placeholder:this.placeholder,popupEnabled:this.popupEnabled,prefix:this.prefix,resultGraphicEnabled:this.resultGraphicEnabled,resultSymbol:this.resultSymbol?this.resultSymbol.clone():null,suggestionsEnabled:this.suggestionsEnabled,suffix:this.suffix,withinViewEnabled:this.withinViewEnabled,categories:this.categories?Re(this.categories):null,countryCode:this.countryCode,locationType:this.locationType,searchTemplate:this.searchTemplate,singleLineFieldName:this.singleLineFieldName,zoomScale:this.zoomScale})}};y([w()],Xc.prototype,"apiKey",void 0),y([w()],Xc.prototype,"categories",void 0),y([w()],Xc.prototype,"countryCode",void 0),y([w({json:{write:!0}})],Xc.prototype,"defaultZoomScale",void 0),y([w()],Xc.prototype,"localSearchDisabled",void 0),y([w()],Xc.prototype,"locationType",void 0),y([w({json:{write:!0}})],Xc.prototype,"name",void 0),y([w({json:{write:!0}})],Xc.prototype,"placeholder",void 0),y([w()],Xc.prototype,"searchTemplate",void 0),y([w({json:{write:!0}})],Xc.prototype,"singleLineFieldName",void 0),y([w({json:{read:{source:"suggest"},write:{target:"suggest"}}})],Xc.prototype,"suggestionsEnabled",void 0),y([w({json:{write:!0}})],Xc.prototype,"url",void 0),y([w({json:{write:!0}})],Xc.prototype,"zoomScale",void 0),Xc=Cre=y([Z(mVt)],Xc);const kVe=Xc,zVe=Ce.getLogger("esri.widgets.support.geolocationUtils"),gVt={maximumAge:0,timeout:15e3,enableHighAccuracy:!0};function yVt(){const t=Le("esri-geolocation");return t||zVe.warn("geolocation-unsupported","Geolocation unsupported."),t}function vVt(){const t=window.isSecureContext;return t||zVe.warn("insecure-context","Geolocation requires a secure origin."),t}function Are(){return yVt()&&vVt()}function UVe(t){return t||(t=gVt),new Promise((i,r)=>{setTimeout(()=>r(new se("geolocation:timeout","getting the current geolocation position timed out")),15e3),navigator.geolocation.getCurrentPosition(i,r,t??void 0)})}function VVe(t,e){const{position:i,view:r}=t,n=_Vt(i),s=n==null?void 0:n.coords;if(!s)throw new se("geometry-service:no-coords","Geolocation has no coordinates");return wVt(bVt(s),r,e)}function _Vt(t){const e=t&&t.coords||{},i={accuracy:e.accuracy,altitude:e.altitude,altitudeAccuracy:e.altitudeAccuracy,heading:e.heading,latitude:e.latitude,longitude:e.longitude,speed:e.speed};return t&&{coords:i,timestamp:t.timestamp}}function bVt({longitude:t,latitude:e,altitude:i}){return new mt({longitude:t,latitude:e,z:i||void 0,spatialReference:{wkid:4326}})}function wVt(t,e,i){if(!e)return Promise.resolve(t);const r=e.spatialReference;return r.isWGS84?Promise.resolve(t):r.isWebMercator?Promise.resolve(Ty(t)):xVt(i).then(n=>{if(!n)throw new se("geometry-service:missing-url","Geometry service URL is missing");const s=new wG({geometries:[t],outSpatialReference:r});return _ce(n,s,i).then(o=>o[0])})}function xVt(t){if(Ar.geometryServiceUrl)return Promise.resolve(Ar.geometryServiceUrl);const e=os.getDefault();return e.load(t).catch(()=>{}).then(()=>{var i,r;return(r=(i=e.helperServices)==null?void 0:i.geometry)==null?void 0:r.url})}function Vc(t,e){return t.hasOwnProperty(e)&&t[e]!=null&&t[e]!==""}const SVt=()=>lE("esri/widgets/Search/t9n/Search"),BVe="esri.widgets.Search.SearchViewModel",D1=Ce.getLogger(BVe),yxe="highlight",$k=it.ofType({key:t=>t.layer?"layer":"locator",base:UG,typeMap:{layer:uM,locator:kVe}}),vxe=at.WGS84,TVt="esri/images/search/search-symbol-32.png",EVt=/<[\s\S]*?>/g,dM=-1;let vr=class extends LG(Dn.EventedMixin(ze)){constructor(e){super(e),this._gotoController=null,this._searching=null,this._updatingPromise=null,this._createdFeatureLayers=[],this.autoNavigate=!0,this.autoSelect=!0,this.defaultPopupTemplate=null,this.defaultSources=new $k,this.defaultSymbols={point:new dP({url:Wr(TVt),size:24,width:24,height:24}),polyline:new Oc({color:[130,130,130,1],width:2}),polygon:new Bm({color:[235,235,235,.4],outline:{color:[130,130,130,1],width:2}})},this.includeDefaultSources=!0,this.maxInputLength=128,this.maxResults=6,this.maxSuggestions=6,this.messages=null,this.minSuggestCharacters=3,this.popupEnabled=!0,this.popupTemplate=null,this.portal=os.getDefault(),this.resultCount=null,this.resultGraphicEnabled=!0,this.resultGraphic=null,this.results=null,this.selectedSuggestion=null,this.searchAllEnabled=!0,this.selectedResult=null,this.sources=new $k,this.suggestionDelay=350,this.suggestionCount=null,this.suggestions=null,this.suggestionsEnabled=!0,this.view=null}initialize(){const e=async()=>{const i=await SVt();this.messages=i,this.defaultPopupTemplate=new hE({title:i.searchResult,content:"{Match_addr}"})};e(),this.addHandles([_e(()=>[this.includeDefaultSources,this.view,this.portal],()=>this._update(),ii),oE(e)])}destroy(){this._destroyFeatureLayers(),this._abortGoTo(),this.clearGraphics()}get activeSource(){return this.allSources.at(this.activeSourceIndex)??null}get activeSourceIndex(){return this.allSources.length===1||!this.searchAllEnabled?0:dM}set activeSourceIndex(e){this._overrideIfSome("activeSourceIndex",e)}get allPlaceholder(){var e;return(e=this.messages)==null?void 0:e.allPlaceholder}set allPlaceholder(e){this._overrideIfSome("allPlaceholder",e)}get allSources(){const{sources:e,defaultSources:i,includeDefaultSources:r}=this,n=typeof r=="function"?r.call(null,{sources:e,defaultSources:i}):r?i.concat(e):e,s=this._get("allSources")||new $k;return s.removeAll(),s.addMany(n.filter(Boolean)),s}get locationEnabled(){return this._get("locationEnabled")||Are()}set locationEnabled(e){if(e===void 0)return void this._clearOverride("locationEnabled");const i=Are();if(e&&!i){const r=new se("locationEnabled:geolocation-unsupported","Geolocation API is unsupported.",{geolocation:navigator.geolocation});D1.error(r)}this._override("locationEnabled",!!e&&i)}get placeholder(){const{allSources:e,activeSourceIndex:i,allPlaceholder:r}=this;if(i===dM)return r??"";const n=e.at(i);return(n==null?void 0:n.placeholder)??""}set searchTerm(e){this._set("searchTerm",e||""),this.clearGraphics(),this.selectedSuggestion&&this.selectedSuggestion.text!==e&&this._set("selectedSuggestion",null),e===""&&this._clear()}get searchTerm(){return this._get("searchTerm")||""}get state(){return this._searching?"searching":this.updating?"loading":this.allSources.length===0?"disabled":"ready"}get updating(){return this._updatingPromise!=null}clear(){this.searchTerm=""}clearGraphics(){this._removeHighlight(),this._closePopup();const{view:e,resultGraphic:i}=this;e&&i&&e.graphics.remove(i),this._set("resultGraphic",null)}search(e,i){this.emit("search-start"),this.clearGraphics();const r=this._createSuggestionForSearch(e),n=(async()=>{var s;try{await this.when();const o=await this._getResultsFromSources(r,i);if((s=i==null?void 0:i.signal)!=null&&s.aborted)return null;const l={activeSourceIndex:this.activeSourceIndex,searchTerm:r.text??"",numResults:0,numErrors:0,errors:[],results:[]};this._formatResponse(l,o,r);const c=this._getFirstResult(l.results),f=r.location&&c?c.name:r.text,_=f==null?void 0:f.replace(EVt,"");return this._set("searchTerm",_),(r.key&&typeof r.sourceIndex=="number"||r.location)&&this._set("selectedSuggestion",r),this._set("results",l.results),this._set("resultCount",l.results.reduce((x,T)=>{var A;return x+(((A=T.results)==null?void 0:A.length)??0)},0)),this.emit("search-complete",l),await this._selectFirstResult(c),l}finally{this._clearSearching()}})();return this._searching=n,n}async searchNearby(e){if(!this.locationEnabled){const r=new se("searchNearby:geolocation-unsupported","Geolocation API is unsupported.",{geolocation:navigator.geolocation});throw D1.error(r),r}const i=(async()=>{try{const r=await UVe(),n=await VVe({position:r,view:this.view},e);return await this.search(n,e)}finally{this._clearSearching()}})();return this._searching=i,i}async select(e){if(this.clearGraphics(),!e){const ne=new se("select:missing-parameter","Cannot select without a searchResult.",{searchResult:e});throw D1.error(ne),ne}const{view:i}=this,r=Vc(e,"sourceIndex")?e.sourceIndex:this._getSourceIndexOfResult(e),n=r!=null?this.allSources.at(r):null;if(!n){const ne=new se("select:missing-source","Cannot select without a source.",{source:n});throw D1.error(ne),ne}const s=n instanceof uM?this._getLayerSourcePopupTemplate(n):n.popupTemplate,o=n.resultSymbol||this._getDefaultSymbol(e),l=Vc(n,"resultGraphicEnabled")?n.resultGraphicEnabled:this.resultGraphicEnabled,c=Vc(n,"autoNavigate")?n.autoNavigate:this.autoNavigate,f=(Vc(n,"popupEnabled")?n.popupEnabled:this.popupEnabled)?s||this.popupTemplate||this.defaultPopupTemplate:null,{feature:_}=e;if(!_){const ne=new se("select:missing-feature","Cannot select without a feature.",{feature:_});throw D1.error(ne),ne}const{attributes:x,geometry:T,layer:A,sourceLayer:M}=_,I=mxe(T),L={layerViewQuery:this._getLayerView(_),elevationQuery:i&&I!=null?RUt(I,i).catch(()=>I):Promise.resolve(I)},F=await Uv(L),z=F.layerViewQuery.value,k=F.elevationQuery.value;o instanceof mE&&(o.text=e.name);const U=i&&c?e.target||e.extent:null;await(U!=null?this._goToSearchResult(U):Promise.resolve());const H=z?_:new Ml({geometry:T,symbol:o,attributes:x,layer:A,sourceLayer:M,popupTemplate:f}),Y=i==null?void 0:i.popup,Q=Y&&H.getEffectivePopupTemplate(Y.defaultPopupTemplateEnabled);return Q&&await i.openPopup({features:[H],location:k}),z&&D8t(z)&&!Q&&this._highlightFeature({graphic:H,layerView:z}),!z&&l&&i&&i.graphics.push(H),this._setResultFloor(e),this._set("selectedResult",e),this._set("resultGraphic",H),this.emit("select-result",{result:e,source:n,sourceIndex:r}),e}async suggest(e,i,r){const n=e||this.searchTerm;this.emit("suggest-start",{searchTerm:n}),await this._suggestTimer(i,r);const s=await this._suggestImmediate(n,r);return this._set("suggestions",s==null?void 0:s.results),this._set("suggestionCount",(s==null?void 0:s.results.reduce((o,l)=>{var c;return o+(((c=l.results)==null?void 0:c.length)??0)},0))??null),this.emit("suggest-complete",s),s}async when(){await rd(()=>!this.updating)}async _update(){const{portal:e,view:i}=this;if(this.includeDefaultSources){const r=this._updatingPromise=Uv([e==null?void 0:e.load(),i==null?void 0:i.when()]);if(this.destroyed||(await r,r!==this._updatingPromise))return}await rd(()=>this.messages),this.destroyed||this._updateDefaultSources(),this._updatingPromise=null}_clearSearching(){this._searching=null}_convertHelperServices(){var i,r;const e=(r=(i=this.portal)==null?void 0:i.helperServices)==null?void 0:r.geocode;return e?e.map(n=>{var c;if(n.placefinding===!1)return;const s=Ar.apiKey&&gxe(n.url)?{url:cVt}:null,o=kVe.fromJSON({...n,...s}),l=o.url;if(gxe(l)||lVt(l)||aVt(l)){const f=o.outFields??["Addr_type","Match_addr","StAddr","City"],_=(o.placeholder||((c=this.messages)==null?void 0:c.placeholder))??"",x=typeof o.defaultZoomScale=="number"?o.defaultZoomScale:2500;o.singleLineFieldName="SingleLine",o.outFields=f,o.placeholder=_,o.defaultZoomScale=x}return o.singleLineFieldName?o:void 0}).filter(ys):[]}_destroyFeatureLayers(){this._createdFeatureLayers.forEach(e=>e==null?void 0:e.destroy()),this._createdFeatureLayers=[]}_getLayerSources(e,i){var n;const r=(n=this.view)==null?void 0:n.map;return e.map(s=>{const o=r.findLayerById(s.id);if(!o)return;const l=this._getLayerJSON(s),c=uM.fromJSON(l);return c.placeholder=i,this._getLayer(o,l).then(f=>{c.layer=f}),c}).filter(ys).toArray()}_getTableSources(e,i){var n;const r=(n=this.view)==null?void 0:n.map;return e.map(s=>{if(!s.id)return;const o=r.findTableById(s.id);if(!o)return;const l=this._getLayerJSON(s),c=uM.fromJSON(l);return c.placeholder=i,this._getLayer(o,l).then(f=>{c.layer=f}),c}).filter(ys).toArray()}_convertApplicationProperties(){var l,c,f;const e=(l=this.view)==null?void 0:l.map,i=(f=(c=e==null?void 0:e.applicationProperties)==null?void 0:c.viewing)==null?void 0:f.search;if(!i)return[];const{enabled:r,hintText:n,layers:s,tables:o}=i;return r?[...this._getLayerSources(s,n),...this._getTableSources(o,n)]:[]}async _getSubLayer(e,i){var s;if(await e.load(),!e.allSublayers)throw new Error;const r=e.allSublayers.find(o=>o.id===i.subLayer);if(!r)throw new Error;const n=await((s=r.createFeatureLayer)==null?void 0:s.call(r));if(!n)throw new Error;return this._createdFeatureLayers.push(n),n}async _getBuildingSubLayer(e,i){await e.load();const r=e.allSublayers.find(n=>n.id===i.subLayer);if((r==null?void 0:r.type)!=="building-component")throw new Error;if(await r.load(),r.associatedLayer==null)throw new Error;return await r.associatedLayer.load(),r}async _getLayer(e,i){if(e.type==="feature"||e.type==="scene"||e.type==="csv"||e.type==="geojson"||e.type==="ogc-feature")return e;if(e.type==="map-image")try{return await this._getSubLayer(e,i)}catch{const n=new se("search:create-featurelayer","Could not create a FeatureLayer from the MapImageLayer",{layer:e});return D1.error(n),null}return e.type==="building-scene"?this._getBuildingSubLayer(e,i):null}_getLayerJSON(e){return typeof e.toJSON=="function"?e.toJSON():e}_updateDefaultSources(){const{defaultSources:e,includeDefaultSources:i}=this;this._destroyFeatureLayers(),e.removeAll(),i&&e.addMany([...this._convertApplicationProperties(),...this._convertHelperServices()])}_abortGoTo(){this._gotoController&&this._gotoController.abort(),this._gotoController=null}_clear(){this._abortGoTo(),this._set("resultCount",null),this._set("results",null),this._set("suggestions",null),this._set("suggestionCount",null),this._set("selectedResult",null),this._set("selectedSuggestion",null),this.emit("search-clear")}_closePopup(){var s;const e=(s=this.view)==null?void 0:s.popup,{resultGraphic:i}=this;if(!e||!i)return;const r="selectedFeature"in e,n=r?e.selectedFeature:null;r&&n&&n===i&&e.close()}_suggestTimer(e,i){const r=e??this.suggestionDelay;return T2(r,null,i==null?void 0:i.signal)}_createLocationForSearch(e){return e instanceof Ml?mxe(e.geometry):e instanceof mt?e:Array.isArray(e)&&e.length===2?new mt({longitude:e[0],latitude:e[1]}):null}_createSuggestionForSearch(e){if(e&&Vc(e,"key")&&Vc(e,"text")&&Vc(e,"sourceIndex"))return e;const i=this._createLocationForSearch(e),r=typeof e=="string"?e:this.searchTerm,{selectedSuggestion:n,selectedResult:s}=this,o=!e&&n&&s,l=o&&n.key===s.key&&n.sourceIndex===s.sourceIndex,c=o&&n.location;return l||c?n:{location:i,text:i?"":r,sourceIndex:null,key:null}}_getFirstResult(e){let i=null;return e&&e.some(r=>{const{results:n}=r,s=n==null?void 0:n[0],o=!!s;return o&&(i=s),o}),i}async _selectFirstResult(e){return this.autoSelect&&e?this.select(e):null}async _suggestImmediate(e,i){var s;await this.when();const r=await this._getSuggestionsFromSources(e,i);if((s=i==null?void 0:i.signal)!=null&&s.aborted)return null;const n={activeSourceIndex:this.activeSourceIndex,searchTerm:e??"",numResults:0,numErrors:0,errors:[],results:[]};return this._formatResponse(n,r),n}_formatSourceResponse(e,i,r){const n=(i==null?void 0:i.value)||[],s=i==null?void 0:i.error,o=this.allSources.at(r);if(s){const l={sourceIndex:r,source:o,error:s};e.errors.push(l),D1.error(s),e.numErrors++}else{const l={sourceIndex:r,source:o,results:n};e.results.push(l),e.numResults+=n.length}}_formatResponse(e,i,r){if(i)if(e.activeSourceIndex===dM){const n=r&&Vc(r,"sourceIndex")&&r.sourceIndex!==-1?r.sourceIndex:void 0;i.forEach((s,o)=>{const l=n!==void 0?n:o;this._formatSourceResponse(e,s,l)})}else this._formatSourceResponse(e,i[0],e.activeSourceIndex)}async _getResultsFromSources(e,i){const{allSources:r}=this,n=!e.location&&Vc(e,"sourceIndex")?e.sourceIndex:this.activeSourceIndex,s=[];if(!r.length){const o=new se("search:no-sources-defined","At least one source is required.",{allSources:r});throw D1.error(o),o}return n===dM?r.forEach((o,l)=>{s.push(this._getResultsFromSource(e,l,i))}):s.push(this._getResultsFromSource(e,n,i)),Uv(s)}async _getSuggestionsFromSources(e,i){const{allSources:r,activeSourceIndex:n}=this,s=[];if(!r.length){const o=new se("suggest:no-sources-defined","At least one source is required.",{allSources:r});throw D1.error(o),o}return n===dM?r.forEach((o,l)=>{s.push(this._getSuggestionsFromSource(e,l,i))}):s.push(this._getSuggestionsFromSource(e,n,i)),Uv(s)}async _getResultsFromSource(e,i,r){var _,x;const n=i!=null?this.allSources.at(i):null;if(!n)return null;const{location:s=null}=e,o=((_=this.view)==null?void 0:_.spatialReference)||vxe,l=Vc(n,"maxResults")?n.maxResults:this.maxResults,c=!!(n instanceof uM&&Vc(n,"exactMatch"))&&n.exactMatch,{view:f}=this;return(x=n.getResults)==null?void 0:x.call(n,{view:f,sourceIndex:i,location:s,suggestResult:e,spatialReference:o,exactMatch:c,maxResults:l},r)}async _getSuggestionsFromSource(e,i,r){var c,f;const n=this.allSources.at(i);if(!n)return null;e??(e="");const s=Vc(n,"suggestionsEnabled")?n.suggestionsEnabled:this.suggestionsEnabled,o=e==null?void 0:e.length,l=Vc(n,"minSuggestCharacters")?n.minSuggestCharacters:this.minSuggestCharacters;if(s&&e.trim()&&o>=l){const _=((c=this.view)==null?void 0:c.spatialReference)||vxe,x=Vc(n,"maxSuggestions")?n.maxSuggestions:this.maxSuggestions,{view:T}=this,A=!!(n instanceof uM&&Vc(n,"exactMatch"))&&n.exactMatch;return(f=n.getSuggestions)==null?void 0:f.call(n,{view:T,sourceIndex:i,suggestTerm:e,spatialReference:_,maxSuggestions:x,exactMatch:A},r)}return null}_getLayerSourcePopupTemplate(e){const{layer:i}=e;if(i)return Vc(e,"popupTemplate")?e.popupTemplate:i.popupTemplate}_getSourceIndexOfResult(e){const i=this.results;if(!i)return null;let r=null;return i.some(n=>n.results.some(s=>s===e&&(r=n.sourceIndex,!0))),r}async _goToSearchResult(e){this._abortGoTo();const i=new AbortController;this._gotoController=i;const r={target:{target:e},options:{signal:i.signal}};e||(r.options.animate=!1),await this.callGoTo(r),this._gotoController=null}_getDefaultSymbol(e){var n;const{defaultSymbols:i}=this,r=(n=e.feature)==null?void 0:n.geometry;if(r==null)return null;switch(r.type){case"point":case"multipoint":return i.point;case"polyline":return i.polyline;case"extent":case"polygon":return i.polygon;default:return null}}_removeHighlight(){this.removeHandles(yxe)}async _getLayerView(e){var n,s;const{view:i}=this;if(!e||!i||((n=e.layer)==null?void 0:n.type)==="building-component"||((s=e.layer)==null?void 0:s.type)==="subtype-sublayer")return null;const{layer:r}=e;return r?(await i.when(),i.whenLayerView(r)):null}_highlightFeature(e){const{graphic:i,layerView:r}=e,{attributes:n,layer:s}=i,{objectIdField:o}=s,l=(o&&(n==null?void 0:n[o]))??null,c=r.highlight(l??i);this.addHandles(c,yxe)}_setResultFloor(e){var s,o,l;const{view:i}=this,r=(s=e.feature)==null?void 0:s.attributes,n=(o=e.feature)==null?void 0:o.sourceLayer;if(n&&"floorInfo"in n&&((l=n==null?void 0:n.floorInfo)!=null&&l.floorField)&&r){const c=r[n.floorInfo.floorField];i==null||i.emit("select-result-floor",c)}}};vr.ALL_INDEX=dM,y([w()],vr.prototype,"_searching",void 0),y([w()],vr.prototype,"_updatingPromise",void 0),y([w({readOnly:!0,value:null})],vr.prototype,"activeSource",null),y([w()],vr.prototype,"activeSourceIndex",null),y([w()],vr.prototype,"allPlaceholder",null),y([w({readOnly:!0})],vr.prototype,"allSources",null),y([w()],vr.prototype,"autoNavigate",void 0),y([w()],vr.prototype,"autoSelect",void 0),y([w()],vr.prototype,"defaultPopupTemplate",void 0),y([w({readOnly:!0})],vr.prototype,"defaultSources",void 0),y([w()],vr.prototype,"defaultSymbols",void 0),y([w()],vr.prototype,"includeDefaultSources",void 0),y([w()],vr.prototype,"locationEnabled",null),y([w()],vr.prototype,"maxInputLength",void 0),y([w()],vr.prototype,"maxResults",void 0),y([w()],vr.prototype,"maxSuggestions",void 0),y([w()],vr.prototype,"messages",void 0),y([w()],vr.prototype,"minSuggestCharacters",void 0),y([w({readOnly:!0})],vr.prototype,"placeholder",null),y([w()],vr.prototype,"popupEnabled",void 0),y([w({type:hE})],vr.prototype,"popupTemplate",void 0),y([w({type:os})],vr.prototype,"portal",void 0),y([w()],vr.prototype,"resultCount",void 0),y([w()],vr.prototype,"resultGraphicEnabled",void 0),y([w({readOnly:!0})],vr.prototype,"resultGraphic",void 0),y([w({readOnly:!0})],vr.prototype,"results",void 0),y([w({readOnly:!0})],vr.prototype,"selectedSuggestion",void 0),y([w()],vr.prototype,"searchAllEnabled",void 0),y([w({readOnly:!0})],vr.prototype,"selectedResult",void 0),y([w()],vr.prototype,"searchTerm",null),y([w({type:$k})],vr.prototype,"sources",void 0),y([w({readOnly:!0})],vr.prototype,"state",null),y([w()],vr.prototype,"suggestionDelay",void 0),y([w()],vr.prototype,"suggestionCount",void 0),y([w({readOnly:!0})],vr.prototype,"suggestions",void 0),y([w()],vr.prototype,"suggestionsEnabled",void 0),y([w({readOnly:!0})],vr.prototype,"updating",null),y([w()],vr.prototype,"view",void 0),y([w()],vr.prototype,"clear",null),vr=y([Z(BVe)],vr);const XM=vr;let _w=class extends cn{constructor(e,i){super(e,i),this.messages=null,this.showMoreResultsOpen=!1,this.viewModel=null}destroy(){this.viewModel=null}render(){const e={[o3.showMoreResults]:this.showMoreResultsOpen};return X("div",{class:this.classes(o3.base,tt.widget)},X("div",{class:this.classes(o3.moreResults,e),key:"esri-search-renderer__container"},this._renderSearchResultName(),this._renderMoreResults()))}_renderMoreResults(){return X("div",{key:"esri-search-renderer__more-results"},this._renderMoreResultsButton(),this._renderMoreResultsLists())}_renderSearchResultName(){var r;const e=(r=this.viewModel)==null?void 0:r.selectedResult,i=(e==null?void 0:e.name)||"";return X("div",{class:o3.moreResultsItem,key:"esri-search-renderer__result-name"},i)}_renderMoreResultsLists(){const{viewModel:e}=this;if(!e)return[];const i=e.results;if((e.resultCount??0)<2)return null;const r=i==null?void 0:i.map(n=>this._renderMoreResultsList(n));return X("div",{class:o3.moreResultsList,key:"esri-search-renderer__more-results-container"},r)}_renderMoreResultsButton(){const{messages:e,viewModel:i}=this;return i?(i.resultCount??0)<2?null:X("div",{class:o3.moreResultsItem,key:"esri-search-renderer__more-results-button"},X("a",{bind:this,class:tt.anchor,href:"#",onclick:this._showMoreResultsClick,onkeydown:this._showMoreResultsClick},this.showMoreResultsOpen?e.hideMoreResults:e.showMoreResults)):null}_renderMoreResultsHeader(e,i){return X("div",{class:o3.moreResultsListHeader,key:`esri-search-result-renderer__header-${i}`},e)}_renderMoreResultsList(e){var x,T,A;const{results:i}=e,r=(i==null?void 0:i.length)??0,n=r>0,s=(x=this.viewModel)==null?void 0:x.selectedResult,o=r===1&&i[0]===s,l=this._getSourceName(e.source,e.sourceIndex),c=(((A=(T=this.viewModel)==null?void 0:T.results)==null?void 0:A.length)??0)>1&&!o?this._renderMoreResultsHeader(l,e.sourceIndex):null,f=n&&i.map((M,I)=>this._renderMoreResultsListItem(M,I)),_=n&&!o?X("ul",{key:`esri-search-result-renderer__list-${e.sourceIndex}`},f):null;return n?X("div",{key:`esri-search-result-renderer__results-${e.sourceIndex}`},c,_):null}_renderMoreResultsListItem(e,i){var n;const r=(n=this.viewModel)==null?void 0:n.selectedResult;return e!==r?X("li",{key:`esri-search-result-renderer__list-item-${i}`},X("a",{bind:this,class:tt.anchor,"data-result":e,href:"#",onclick:this._selectResultClick,onkeydown:this._selectResultClick,tabIndex:0},e.name)):null}_showMoreResultsClick(e){var r,n;e.preventDefault(),this.showMoreResultsOpen=!this.showMoreResultsOpen;const i=(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.popup;i&&"reposition"in i&&i.reposition()}_selectResultClick(e){var r;e.preventDefault();const i=e.currentTarget["data-result"];(r=this.viewModel)==null||r.select(i)}_getSourceName(e,i){return i===XM.ALL_INDEX?this.messages.all:e.name}};y([w(),Gr("esri/widgets/Search/t9n/Search")],_w.prototype,"messages",void 0),y([w()],_w.prototype,"showMoreResultsOpen",void 0),y([w()],_w.prototype,"viewModel",void 0),y([bo()],_w.prototype,"_showMoreResultsClick",null),y([bo()],_w.prototype,"_selectResultClick",null),_w=y([Z("esri.widgets.Search.SearchResultRenderer")],_w);const CVt=_w,AVt=/<[a-z/][\s\S]*>/i,MVt=(t,e)=>{const i=Xre(e).split(/\s/),r=new RegExp(`(${i.join("|")})`,"gi");return t.replace(r,n=>`${n}`)};let _r=class extends cn{constructor(e,i){super(e,i),this._activeMenuItemIndex=-1,this._inputNode=null,this._menuItemCount=0,this._sourceMenuButtonNode=null,this._sourceListNode=null,this._suggestionListNode=null,this._searchResultRenderer=new CVt,this._suggestController=null,this._searchController=null,this._locateFailed=!1,this._container=null,this.activeMenu="none",this.disabled=!1,this.iconClass=Kn.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.viewModel=new XM,this._clearActiveMenu=()=>{this.activeMenu="none"},this._removeActiveMenu=r=>{var s;const n=r.relatedTarget;n&&((s=this._container)!=null&&s.contains(n))||this._clearActiveMenu()},this.addHandles([_e(()=>this.searchTerm,r=>{var n,s;(r&&this.activeMenu==="warning"||!r&&!((s=(n=this.viewModel)==null?void 0:n.selectedSuggestion)!=null&&s.location))&&this._clearActiveMenu()}),Jr(()=>{var r;return(r=this.viewModel)==null?void 0:r.allSources},"change",()=>this._watchSourceChanges()),_e(()=>this.activeMenu,()=>this._resetActiveMenuItemIndex(),ii),_e(()=>{var r;return(r=this.viewModel)==null?void 0:r.defaultPopupTemplate},r=>{r&&(r.content=this._renderSearchResultsContent.bind(this))},ii)])}destroy(){this._cancelSuggest(),this._cancelSearch(),this._searchResultRenderer=et(this._searchResultRenderer)}get displayedSearchTerm(){return`${this.viewModel.searchTerm}`.trim()}get inputId(){return this._buildId("input")}get suggestionsMenuId(){return this._buildId("suggest-menu")}get sourceMenuId(){return this._buildId("source-menu")}get sourceMenuButtonId(){return this._buildId("source-menu-button")}get activeSource(){var e;return(e=this.viewModel)==null?void 0:e.activeSource}get activeSourceIndex(){return this.viewModel.activeSourceIndex}set activeSourceIndex(e){this.viewModel.activeSourceIndex=e}get allPlaceholder(){return this.viewModel.allPlaceholder}set allPlaceholder(e){this.viewModel.allPlaceholder=e}get allSources(){return this.viewModel.allSources}get autoNavigate(){return this.viewModel.autoNavigate}set autoNavigate(e){this.viewModel.autoNavigate=e}get autoSelect(){return this.viewModel.autoSelect}set autoSelect(e){this.viewModel.autoSelect=e}get defaultSources(){return this.viewModel.defaultSources}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get includeDefaultSources(){return this.viewModel.includeDefaultSources}set includeDefaultSources(e){this.viewModel.includeDefaultSources=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get locationEnabled(){return this.viewModel.locationEnabled}set locationEnabled(e){this.viewModel.locationEnabled=e}get maxResults(){return this.viewModel.maxResults}set maxResults(e){this.viewModel.maxResults=e}get maxSuggestions(){return this.viewModel.maxSuggestions}set maxSuggestions(e){this.viewModel.maxSuggestions=e}get minSuggestCharacters(){return this.viewModel.minSuggestCharacters}set minSuggestCharacters(e){this.viewModel.minSuggestCharacters=e}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(e){this.viewModel.popupEnabled=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get portal(){var e;return(e=this.viewModel)==null?void 0:e.portal}set portal(e){this.viewModel&&(this.viewModel.portal=e)}get resultGraphic(){return this.viewModel.resultGraphic}set resultGraphic(e){this.viewModel.resultGraphic=e}get resultGraphicEnabled(){return this.viewModel.resultGraphicEnabled}set resultGraphicEnabled(e){this.viewModel.resultGraphicEnabled=e}get results(){return this.viewModel.results}get searchAllEnabled(){return this.viewModel.searchAllEnabled}set searchAllEnabled(e){this.viewModel.searchAllEnabled=e}get searchTerm(){return this.viewModel.searchTerm}set searchTerm(e){this.viewModel.searchTerm=e}get selectedResult(){return this.viewModel.selectedResult}get sources(){return this.viewModel.sources}set sources(e){this.viewModel.sources=e}get suggestions(){return this.viewModel.suggestions}get suggestionsEnabled(){return this.viewModel.suggestionsEnabled}set suggestionsEnabled(e){this.viewModel.suggestionsEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}clear(){this.viewModel.clear()}focus(){var e;(e=this._inputNode)==null||e.focus(),this.emit("search-focus")}blur(){var e;(e=this._inputNode)==null||e.blur(),this.emit("search-blur")}async search(e){this._clearActiveMenu(),this._cancelSuggest(),this._cancelSearch();const i=new AbortController,{signal:r}=i;this._searchController=i;try{const n=await this.viewModel.search(e,{signal:r});return this._searchController!==i?void 0:(this.activeMenu=n!=null&&n.numResults?"none":"warning",this._searchController=null,n)}catch{return this._searchController!==i?void 0:(this._clearActiveMenu(),void(this._searchController=null))}}async suggest(e){this._cancelSuggest();const i=new AbortController,{signal:r}=i;this._suggestController=i;try{const n=await this.viewModel.suggest(e,null,{signal:r});return this._suggestController!==i?void 0:(this._suggestController=null,n!=null&&n.numResults&&this._openSuggestionMenu(),this._scrollToTopSuggestion(),n)}catch{return this._suggestController!==i||(this._suggestController=null),null}}render(){const{state:e}=this.viewModel,i={[tt.disabled]:e==="disabled",[tt.widgetDisabled]:this.disabled};return X("div",{class:this.classes(Kn.base,tt.widget,i)},e==="loading"?this._renderLoader():this._renderContainer())}_renderSubmitButton(){const{messages:e,disabled:i}=this;return X("button",{"aria-label":e.searchButtonTitle,bind:this,class:this.classes(Kn.submitButton,tt.widgetButton),disabled:i,key:"esri-search__submit-button",onclick:this._handleSearchButtonClick,title:e.searchButtonTitle,type:"button"},X("span",{"aria-hidden":"true",class:si.search}))}_renderWarningMenu(){return X("div",{class:this.classes(tt.menu,Kn.warningMenu),key:"esri-search__error-menu"},X("div",{class:Kn.warningMenuBody},this._renderWarning()))}_renderSourceMenuButton(){const{messages:e,activeMenu:i,sourceMenuId:r,sourceMenuButtonId:n,disabled:s}=this,{activeSourceIndex:o,allSources:l}=this.viewModel;return l.length>1?X("button",{afterCreate:Vv,"aria-controls":r,"aria-expanded":(i==="source").toString(),"aria-haspopup":"true","aria-label":e.searchIn,bind:this,class:this.classes(Kn.sourcesButton,tt.widgetButton),"data-node-ref":"_sourceMenuButtonNode",disabled:s,id:n,key:"esri-search__source-menu-button",onclick:this._handleSourcesMenuToggleClick,onfocus:this._handleSourcesMenuToggleFocus,title:e.searchIn,type:"button"},X("span",{"aria-hidden":"true",class:this.classes(si.downArrow,Kn.sourcesButtonDown)}),X("span",{"aria-hidden":"true",class:this.classes(si.upArrow,Kn.sourcesButtonUp)}),X("span",{class:Kn.sourceName},this._getSourceName(o))):null}_renderSourcesList(){const{allSources:e,searchAllEnabled:i}=this.viewModel,{_activeMenuItemIndex:r,activeMenu:n,sourceMenuId:s,sourceMenuButtonId:o}=this,l=n==="source"&&r>-1?this._buildId("source-item",r):null;return e.length>1?X("ul",{afterCreate:Vv,"aria-activedescendant":l,"aria-labelledby":o,bind:this,class:tt.menuList,"data-node-ref":"_sourceListNode",id:s,onkeydown:this._handleSourceMenuKeydown,onkeyup:this._handleSourceMenuKeyup,role:"menu",tabIndex:-1},i?this._renderSource(XM.ALL_INDEX):null,e.map((c,f)=>this._renderSource(f)).toArray()):null}_renderSourcesMenu(){const{allSources:e}=this.viewModel;return e.length>1?X("div",{class:this.classes(tt.menu,Kn.sourcesMenu),key:"esri-search__source-menu"},this._renderSourcesList()):null}_renderLoader(){const{messages:e,messagesCommon:i,disabled:r}=this;return X("div",{class:tt.loader,key:"base-loader",tabIndex:r?-1:void 0},X("span",{"aria-hidden":"true",class:tt.loaderAnimation}),X("span",{class:si.fontFallbackText},e.searchButtonTitle),X("span",{class:tt.loaderText},i.loading))}_renderContainer(){const{allSources:e,state:i}=this.viewModel,{activeMenu:r}=this,n={[Kn.hasMultipleSources]:e.length>1,[Kn.isLoading]:i==="loading",[Kn.isSearching]:i==="searching",[Kn.showWarning]:r==="warning",[Kn.showSources]:r==="source",[Kn.showSuggestions]:r==="suggestion"};return X("div",{afterCreate:s=>{this._container=s,s.addEventListener("focusout",this._removeActiveMenu)},afterRemoved:s=>{s.removeEventListener("focusout",this._removeActiveMenu)},class:this.classes(n,Kn.container),key:"base-container",tabIndex:-1},this._renderSourceMenuButton(),this._renderSourcesMenu(),this._renderInputContainer(),this._renderSubmitButton(),this._renderWarningMenu())}_renderClearButton(){return this.searchTerm?X("button",{bind:this,class:this.classes(Kn.clearButton,tt.widgetButton),disabled:this.disabled,key:"esri-search__clear-button",onclick:this._handleClearButtonClick,onfocus:this._clearActiveMenu,title:this.messages.clearButtonTitle,type:"button"},X("span",{"aria-hidden":"true",class:si.close})):null}_renderLocationGroup(){const{messages:e,locationEnabled:i,displayedSearchTerm:r}=this,n=i&&!r,s=this.activeMenu==="suggestion"&&this._activeMenuItemIndex===0;return n?X("ul",{class:this.classes(tt.menuList,Kn.suggestionList,Kn.suggestionListCurrentLocation),key:"esri-search__suggestion-list-current-location",role:"group"},X("li",{"aria-selected":(this.activeMenu==="suggestion"&&this._activeMenuItemIndex===0).toString(),bind:this,class:this.classes(tt.menuItem,s?tt.menuItemFocus:null),"data-current-location-item":!0,id:this._buildId("suggestion-item",0),onclick:this._handleUseCurrentLocationClick,role:"option"},X("span",{"aria-hidden":"true",class:si.locateCircled})," ",e.useCurrentLocation)):null}_renderInput(){const{activeMenu:e,locationEnabled:i,displayedSearchTerm:r,messages:n,suggestionsMenuId:s,inputId:o,_activeMenuItemIndex:l,disabled:c}=this,{maxInputLength:f,placeholder:_,searchTerm:x,suggestionCount:T}=this.viewModel,A=!(!(i&&!r)&&!T),M=e==="suggestion"&&l>-1?this._buildId("suggestion-item",l):null;return X("input",{afterCreate:Vv,"aria-activedescendant":M,"aria-autocomplete":"list","aria-controls":A?s:null,"aria-expanded":(A&&e==="suggestion").toString(),"aria-haspopup":"listbox","aria-label":n.searchButtonTitle,autocomplete:"off",bind:this,class:this.classes(tt.input,Kn.input),"data-node-ref":"_inputNode",disabled:c,id:o,maxlength:f,onblur:this.blur,onclick:this._openSuggestionMenu,onfocus:this.focus,oninput:this._handleInputPaste,onkeyup:this._handleInputKeyup,onpaste:this._handleInputPaste,placeholder:_,role:"combobox",title:x?"":_,type:"text",value:x})}_renderForm(){return X("form",{bind:this,class:Kn.form,disabled:this.disabled,key:"esri-search__form",onsubmit:this._formSubmit,role:"search"},this._renderInput())}_renderSuggestList(e){const{sourceIndex:i}=e,{results:r}=e;return(r==null?void 0:r.length)?X("ul",{class:this.classes(tt.menuList,Kn.suggestionList),key:`esri-search__suggestion-list-${i}`,role:"group"},r==null?void 0:r.map(s=>this._renderSuggestion(s,this._menuItemCount++))):null}_renderSuggestionsGroup(){const{suggestions:e}=this.viewModel;return e?e.map(i=>[this._renderSuggestionHeader(i),this._renderSuggestList(i)]):[]}_renderSuggestionsMenu(){const{displayedSearchTerm:e,locationEnabled:i,suggestionsMenuId:r,inputId:n}=this,{suggestionCount:s}=this.viewModel,o=i&&!e||s;return this._menuItemCount=0,o?X("div",{afterCreate:Vv,"aria-labelledby":n,bind:this,class:this.classes(tt.menu,Kn.suggestionsMenu),"data-node-ref":"_suggestionListNode",id:r,key:"esri-search__suggestions-menu",role:"listbox"},this._renderLocationGroup(),this._renderSuggestionsGroup()):null}_renderInputContainer(){return X("div",{class:Kn.inputContainer,key:"esri-search__input-container"},this._renderForm(),this._renderSuggestionsMenu(),this._renderClearButton())}_renderSuggestionHeader(e){var l;const{allSources:i,activeSourceIndex:r}=this.viewModel,{sourceIndex:n}=e,s=(l=e.results)==null?void 0:l.length,o=i.length>1&&r===XM.ALL_INDEX;return s&&o?X("div",{class:tt.menuHeader,key:`esri-search__suggestion-header-${n}`},this._getSourceName(n)):null}_renderSuggestion(e,i){const{_activeMenuItemIndex:r,viewModel:{searchTerm:n}}=this;if(!n)return;const s=this.activeMenu==="suggestion"&&r===i;return X("li",{"aria-selected":(this.activeMenu==="suggestion"&&this._activeMenuItemIndex===i).toString(),bind:this,class:this.classes(tt.menuItem,s?tt.menuItemFocus:null),"data-suggestion":e,id:this._buildId("suggestion-item",i),innerHTML:this._getSuggestResultHTML(e.text,n),key:`esri-search__suggestion_${i}`,onclick:this._handleSuggestionClick,role:"option"})}_renderSource(e){const{activeSourceIndex:i,searchAllEnabled:r}=this.viewModel,n={[tt.menuItemActive]:e===i,[tt.menuItemFocus]:this.activeMenu==="source"&&e===(r?this._activeMenuItemIndex-1:this._activeMenuItemIndex)},s=r?e+1:e;return X("li",{"aria-checked":(e===i).toString(),bind:this,class:this.classes(Kn.source,tt.menuItem,n),"data-source-index":e,id:this._buildId("source-item",s),key:`esri-search__source-${e}`,onclick:this._handleSourceClick,role:"menuitemradio"},this._getSourceName(e))}_renderNoResultsWarning(e){const{messages:i}=this,r=e?By(i.noResultsFoundForValue,{value:`"${e}"`}):i.noResultsFound;return X("div",{key:"esri-search__no_results"},X("div",{class:Kn.warningMenuHeader},i.noResults),X("div",{class:Kn.warningMenuText},r))}_renderEmptySearchWarning(){const{messages:e}=this;return X("div",{key:"esri-search__empty-search"},X("span",{"aria-hidden":"true",class:si.noticeTriangle}),X("span",{class:Kn.noValueText},e.emptyValue))}_renderLocateWarning(){const{messages:e}=this;return X("div",{key:"esri-search__locate-error"},X("span",{"aria-hidden":"true",class:si.noticeTriangle}),X("span",{class:Kn.noValueText},e.locateError))}_renderWarning(){var n;const{displayedSearchTerm:e,_locateFailed:i}=this,{viewModel:r}=this;return i?this._renderLocateWarning():(n=r.selectedSuggestion)!=null&&n.location||e?this._renderNoResultsWarning(e):this._renderEmptySearchWarning()}_resetActiveMenuItemIndex(){this._activeMenuItemIndex=-1}_buildId(e,i){return`${this.id}-${e}${i===void 0?"":`-${i}`}`}_watchSourceChanges(){const{viewModel:{allSources:e}}=this,i="sources";this.removeHandles(i),e.forEach(r=>this.addHandles(_e(()=>r.name,()=>this.scheduleRender()),i))}_handleSourcesMenuToggleFocus(){this.activeMenu!=="source"&&this._clearActiveMenu()}_handleSourcesMenuToggleClick(){var i;const e=this.activeMenu==="source";this.activeMenu=e?"none":"source",this.renderNow(),this.activeMenu==="source"&&((i=this._sourceListNode)==null||i.focus())}_handleClearButtonClick(){this.viewModel.clear(),this._focus()}_handleSearchButtonClick(){this.search()}_handleSuggestionClick(e){const i=_xe(e.currentTarget);i&&(this._focus(),this.search(i))}_handleUseCurrentLocationClick(){this._useCurrentLocation()}_useCurrentLocation(){this._focus("none"),this._cancelSuggest(),this._cancelSearch();const e=new AbortController,{signal:i}=e;this._searchController=e,(async()=>{try{const r=await this.viewModel.searchNearby({signal:i});this.activeMenu=r!=null&&r.numResults?"none":"warning"}catch{this._locateFailed=!0,this.activeMenu="warning"}finally{this._searchController=null}})()}_handleSourceClick(e){this._setSourceFromMenuItem(e.currentTarget)}_setSourceFromMenuItem(e){var r;if(!e)return;const i=OVt(e);i!=null&&(this.viewModel.activeSourceIndex=i,this._clearActiveMenu(),(r=this._sourceMenuButtonNode)==null||r.focus())}_cancelSuggest(){this._suggestController=gn(this._suggestController)}_cancelSearch(){this._searchController=gn(this._searchController),this._locateFailed=!1}_handleInputKeyup(e){var s;const i=Sf(e);if(e.ctrlKey||e.metaKey||i==="Copy"||i==="ArrowLeft"||i==="ArrowRight"||i==="Shift")return;if(i==="Tab"||i==="Escape"||e.shiftKey&&i==="Tab")return this._cancelSuggest(),void(i==="Escape"&&this._clearActiveMenu());const r=i==="Home"||i==="End"||i==="ArrowUp"||i==="ArrowDown";if(i==="Enter"&&this._activeMenuItemIndex<0)return void this._cancelSuggest();const n=(s=this._suggestionListNode)==null?void 0:s.getElementsByTagName("li");if(n!=null&&n.length){if(this.activeMenu!=="suggestion"&&this._openSuggestionMenu(),r)return e.preventDefault(),this._cancelSuggest(),void this._handleItemNavigation(i,n,this._suggestionListNode);const o=n[this._activeMenuItemIndex];if(i==="Enter"&&o){const l=_xe(o);return void(l?(this._focus(),this.search(l)):PVt(o)&&this._useCurrentLocation())}}this.viewModel.searchTerm&&this.suggest()}_handleItemNavigation(e,i,r){const n=this._activeMenuItemIndex;e==="Home"&&(this._activeMenuItemIndex=0),e==="End"&&(this._activeMenuItemIndex=i.length-1),e==="ArrowUp"&&(this._activeMenuItemIndex=this._activeMenuItemIndex<=0?i.length-1:this._activeMenuItemIndex-1),e==="ArrowDown"&&(this._activeMenuItemIndex=this._activeMenuItemIndex===i.length-1?0:this._activeMenuItemIndex+1),n!==this._activeMenuItemIndex&&r&&EZe(i[this._activeMenuItemIndex],r)}_scrollToTopSuggestion(){this._suggestionListNode&&(this._suggestionListNode.scrollTop=0)}_openSuggestionMenu(){this.activeMenu="suggestion"}_handleInputPaste(e){const i=e.target;this.viewModel.searchTerm!==i.value&&(this.viewModel.searchTerm=i.value),this.viewModel.searchTerm&&this.suggest()}_handleSourceMenuKeydown(e){var r;const i=Sf(e);if(bM(i)){e.preventDefault();const n=(r=this._sourceListNode)==null?void 0:r.getElementsByTagName("li"),s=n==null?void 0:n[this._activeMenuItemIndex];this._setSourceFromMenuItem(s)}else i!=="ArrowUp"&&i!=="ArrowDown"&&i!=="End"&&i!=="Home"||e.preventDefault()}_handleSourceMenuKeyup(e){var s,o,l;const i=Sf(e),r=i==="ArrowUp"||i==="ArrowDown"||i==="End"||i==="Home";if(r&&e.preventDefault(),i==="Escape")return this._clearActiveMenu(),void((s=this._sourceMenuButtonNode)==null?void 0:s.focus());const n=(o=this._sourceListNode)==null?void 0:o.getElementsByTagName("li");return n&&n.length!==0&&r?(this.activeMenu!=="source"&&(this.activeMenu="source"),void this._handleItemNavigation(i,n,(l=this._sourceListNode)==null?void 0:l.parentElement)):void 0}_focus(e){this.focus(),e&&(this.activeMenu=e)}_formSubmit(e){e.preventDefault(),this._activeMenuItemIndex===-1&&this.search()}_getSourceName(e){const{messages:i}=this,r=this.viewModel,{allSources:n}=r,s=n.at(e);return e===XM.ALL_INDEX?i.all:s&&s.name||i.untitledSource}_getSuggestResultHTML(e,i){return e?AVt.test(e)?e:MVt(e,i):this.messages.untitledResult}_renderSearchResultsContent(){return this._searchResultRenderer.showMoreResultsOpen=!1,this._searchResultRenderer.viewModel=this.viewModel,this._searchResultRenderer}};function _xe(t){return t==null?void 0:t["data-suggestion"]}function OVt(t){return t==null?void 0:t["data-source-index"]}function PVt(t){return!!(t!=null&&t["data-current-location-item"])}y([w()],_r.prototype,"_activeMenuItemIndex",void 0),y([w()],_r.prototype,"displayedSearchTerm",null),y([w({readOnly:!0})],_r.prototype,"inputId",null),y([w({readOnly:!0})],_r.prototype,"suggestionsMenuId",null),y([w({readOnly:!0})],_r.prototype,"sourceMenuId",null),y([w({readOnly:!0})],_r.prototype,"sourceMenuButtonId",null),y([w()],_r.prototype,"activeMenu",void 0),y([w({readOnly:!0})],_r.prototype,"activeSource",null),y([w()],_r.prototype,"activeSourceIndex",null),y([w()],_r.prototype,"allPlaceholder",null),y([w({readOnly:!0})],_r.prototype,"allSources",null),y([w()],_r.prototype,"autoNavigate",null),y([w()],_r.prototype,"autoSelect",null),y([w({readOnly:!0})],_r.prototype,"defaultSources",null),y([w()],_r.prototype,"disabled",void 0),y([w()],_r.prototype,"goToOverride",null),y([w()],_r.prototype,"iconClass",void 0),y([w()],_r.prototype,"icon",void 0),y([w()],_r.prototype,"includeDefaultSources",null),y([w()],_r.prototype,"label",null),y([w()],_r.prototype,"locationEnabled",null),y([w()],_r.prototype,"maxResults",null),y([w()],_r.prototype,"maxSuggestions",null),y([w(),Gr("esri/widgets/Search/t9n/Search")],_r.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],_r.prototype,"messagesCommon",void 0),y([w()],_r.prototype,"minSuggestCharacters",null),y([w()],_r.prototype,"popupEnabled",null),y([w()],_r.prototype,"popupTemplate",null),y([w()],_r.prototype,"portal",null),y([w()],_r.prototype,"resultGraphic",null),y([w()],_r.prototype,"resultGraphicEnabled",null),y([w({readOnly:!0})],_r.prototype,"results",null),y([w()],_r.prototype,"searchAllEnabled",null),y([w()],_r.prototype,"searchTerm",null),y([w({readOnly:!0})],_r.prototype,"selectedResult",null),y([w()],_r.prototype,"sources",null),y([w({readOnly:!0})],_r.prototype,"suggestions",null),y([w()],_r.prototype,"suggestionsEnabled",null),y([w()],_r.prototype,"view",null),y([Kce(["search-complete","search-clear","search-start","select-result","suggest-start","suggest-complete"]),w({type:XM})],_r.prototype,"viewModel",void 0),_r=y([Z("esri.widgets.Search")],_r);const RVt=_r;function IVt(t,e){for(var i=0;ir[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var jVe={exports:{}};(function(t,e){function i(){function n(m){if(typeof m=="number")return ie.Tc.Zg(m);if(m==null)return null;if(mi[m]!=null)return ie.Tc.Zg(mi[m]);throw Error("Unrecognised Unit Type")}function s(m){if(typeof m=="number")return ie.Tc.Zg(m);if(m==null)return null;if(Lr[m]!=null)return ie.Tc.Zg(Lr[m]);throw Error("Unrecognised Unit Type")}function o(m){if(m)switch(m){case"loxodrome":return 1;case"great-elliptic":return 2;case"normal-section":return 3;case"shape-preserving":return 4}return 0}function l(m,D,E,p){if(E==null||E.B())return null;switch(E.getType()){case ie.qn.Point:return m.exportPoint(D,E,p);case ie.qn.Polygon:return m.exportPolygon(D,E,p);case ie.qn.Polyline:return m.exportPolyline(D,E,p);case ie.qn.MultiPoint:return m.exportMultipoint(D,E,p);case ie.qn.Envelope:return m.exportExtent(D,E,p)}return null}function c(m,D,E,p){if(E.getType()!==ie.qn.Point)throw Error("Geometry not Point");return m.exportPoint(D,E,p)}function f(m,D,E){return m.convertToGEGeometry(D,E)}function _(m){var D=m.wkid;m=m.wkt2||m.wkt;var E=Dr.get(D||m);return E==null&&(D!==-1&&D!=null?(E=ie.Eg.create(D),Dr.set(D,E)):m&&(E=ie.Eg.qP(m),Dr.set(m,E)),xi.has(D||m)&&E.VW(xi.get(D||m))),E}function x(m){var D,E,p;if(m==null)return null;var h=_(m);return m=h.Hd(),h=h.Kn(),(D={}).tolerance=h,D.unitType=m==null?-1:m.od,D.unitID=m==null?-1:m.Ec(),D.unitBaseFactor=m==null?0:m.ai,D.unitSquareDerivative=m==null?0:(p=(E=ie.Tc.aG(m))===null||E===void 0?void 0:E.Ec())!==null&&p!==void 0?p:0,D}function T(m,D,E,p){return E==null?null:(E=ie.$b.clip(f(m,Ze,E),f(m,Ze,p),_(D)),l(m,Ze,E,D))}function A(m,D,E,p){E=ie.$b.dl(f(m,Ze,E),f(m,Ze,p),_(D)),p=[];for(var h=0;h>6)>>1},p.Rn=function(h){return(32&h)!=0},p.US=function(h){return(128&h)!=0},p.yd=function(h){return(256&h)!=0},p.xj=function(h){return(512&h)!=0},p.Hc=function(h){return(1024&h)!=0},p.prototype.Of=function(){var h=this.Ia();return this.copyTo(h),h},p.prototype.mg=function(){return null},p.jg=function(h){var a=h.Ia();return h.copyTo(a),a},p.prototype.vc=function(){0<=this.VA&&(this.VA+=2147483649)},p.Ax=function(h){var a=h.getType();if(p.xj(a))return h.I();if(h.B())return 0;if(a==197)return 4;if(a==33)return 1;if(p.yd(a))return 2;throw m.i.fa("missing type")},p}();m.aa=E})(ie||(ie={})),Ht=ie||(ie={}),hr=function(){function m(){this.y=this.x=0}return m.construct=function(D,E){var p=new m;return p.x=D,p.y=E,p},m.al=function(D){var E=new m;return E.x=D.x,E.y=D.y,E},m.prototype.ma=function(D,E){this.x=D,this.y=E},m.prototype.L=function(D){this.x=D.x,this.y=D.y},m.prototype.fq=function(D,E){return this.x===D&&this.y===E},m.prototype.Rz=function(D){return 2220446049250313e-31>=Math.abs(this.x-D.x)&&2220446049250313e-31>=Math.abs(this.y-D.y)},m.prototype.qb=function(D){return this.x===D.x&&this.y===D.y},m.prototype.Nb=function(D){return D==this||D instanceof m&&this.x==D.x&&this.y==D.y},m.prototype.sub=function(D){this.x-=D.x,this.y-=D.y},m.prototype.uc=function(D,E){this.x=D.x-E.x,this.y=D.y-E.y},m.prototype.add=function(D,E){E!==void 0?(this.x=D.x+E.x,this.y=D.y+E.y):(this.x+=D.x,this.y+=D.y)},m.prototype.Sq=function(){this.x=-this.x,this.y=-this.y},m.prototype.mt=function(D){this.x=-D.x,this.y=-D.y},m.prototype.NS=function(D,E,p){this.x=D.x*(1-p)+E.x*p,this.y=D.y*(1-p)+E.y*p},m.prototype.Ct=function(D,E){this.x=this.x*D+E.x,this.y=this.y*D+E.y},m.prototype.HW=function(D,E,p){this.x=E.x*D+p.x,this.y=E.y*D+p.y},m.prototype.scale=function(D){this.x*=D,this.y*=D},m.prototype.compare=function(D){return this.yD.y?1:this.xD.x?1:0},m.prototype.normalize=function(){var D=this.length();D==0&&(this.x=1,this.y=0),this.x/=D,this.y/=D},m.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},m.prototype.Sk=function(){return this.x*this.x+this.y*this.y},m.tb=function(D,E){return Math.sqrt(this.yc(D,E))},m.Oy=function(D,E,p,h){return D-=p,E-=h,Math.sqrt(D*D+E*E)},m.prototype.Qh=function(D){return this.x*D.x+this.y*D.y},m.prototype.fD=function(D){return Math.abs(this.x*D.x)+Math.abs(this.y*D.y)},m.prototype.wi=function(D){return this.x*D.y-this.y*D.x},m.prototype.Bt=function(D,E){var p=-this.x*E+this.y*D;this.x=this.x*D+this.y*E,this.y=p},m.prototype.Hv=function(){var D=this.x;this.x=-this.y,this.y=D},m.prototype.MG=function(D){this.x=-D.y,this.y=D.x},m.prototype.ar=function(){var D=this.x;this.x=this.y,this.y=-D},m.prototype.qu=function(){return 0(D=D.wi(E))?1:0(p=h.value())?-1:0p?-1:0=a?p+(h-p)*a:h-(h-p)*(1-a)},E.OG=function(p,h,a,u){.5>=a?(u.x=p.x+(h.x-p.x)*a,u.y=p.y+(h.y-p.y)*a):(u.x=h.x-(h.x-p.x)*(1-a),u.y=h.y-(h.y-p.y)*(1-a))},E.lT=function(p,h,a,u,d,g){.5>=d?(g.x=p+(a-p)*d,g.y=h+(u-h)*d):(g.x=a-(a-p)*(1-d),g.y=u-(u-h)*(1-d))},E}()}(ie||(ie={})),function(m){var D=function(E){function p(){var h=E.call(this)||this;return h.sa=0,h.na=0,h.pa=0,h.la=0,h.ka=null,h}return Ke(p,E),p.prototype.ac=function(){return m.h.construct(this.sa,this.na)},p.prototype.Yp=function(h){h.x=this.sa,h.y=this.na},p.prototype.Dc=function(h){this.em(0,h)},p.prototype.ZB=function(h,a){this.em(0,m.h.construct(h,a))},p.prototype.To=function(h){this.hD(0,h)},p.prototype.setStart=function(h){this.uD(0,h)},p.prototype.wv=function(h,a){return this.Od(0,h,a)},p.prototype.YB=function(h,a,u){this.tn(0,h,a,u)},p.prototype.wc=function(){return m.h.construct(this.pa,this.la)},p.prototype.Tr=function(h){h.x=this.pa,h.y=this.la},p.prototype.Qc=function(h){this.em(1,h)},p.prototype.Ql=function(h,a){this.em(1,m.h.construct(h,a))},p.prototype.Po=function(h){this.hD(1,h)},p.prototype.setEnd=function(h){this.uD(1,h)},p.prototype.gv=function(h,a){return this.Od(1,h,a)},p.prototype.OB=function(h,a,u){this.tn(1,h,a,u)},p.prototype.Db=function(){return 1},p.prototype.B=function(){return this.Ac()},p.prototype.Oa=function(){},p.prototype.Ke=function(){return 0},p.prototype.Ea=function(h,a,u,d,g){return this.KM(h,a,u,d,g)},p.prototype.isIntersecting=function(h,a){return this.zr(h,a,!1)!=0},p.prototype.qs=function(h,a){return this.ru(h,a,!1)},p.prototype.ru=function(){return null},p.prototype.Ac=function(){return!1},p.prototype.ay=function(h){if(this.vc(),this.ka==null&&0=m.ra.Va(a))throw m.i.ce();var d=this.description.Pf(a);return 0<=d?(this.ka!=null&&this.ay(this.description.Ae.length-2),this.ka[p.Gg(this.description,h)+this.description.$j(d)-2+u]):m.ra.se(a)},p.prototype.tn=function(h,a,u,d){if(this.vc(),u>=m.ra.Va(a))throw m.i.ce();var g=this.description.Pf(a);0>g&&(this.re(a),g=this.description.Pf(a)),a==0?h!=0?u!=0?this.la=d:this.pa=d:u!=0?this.na=d:this.sa=d:(this.ka==null&&this.ay(this.description.Ae.length-2),this.ka[p.Gg(this.description,h)+this.description.$j(g)-2+u]=d)},p.prototype.copyTo=function(h){if(h.getType()!=this.getType())throw m.i.N();h.description=this.description,h.ay(this.description.Ae.length-2),p.gM(this.ka,h.ka,2*(this.description.Ae.length-2)),h.sa=this.sa,h.na=this.na,h.pa=this.pa,h.la=this.la,h.vc(),this.op(h)},p.prototype.Tg=function(h,a){var u=new m.Nc;return this.Ac()?(u.Oa(),u):(u.oa=this.Od(0,h,a),u.va=u.oa,u.Lk(this.Od(1,h,a)),u)},p.prototype.ZI=function(h){this.Ac()?h.Oa():(h.oa=this.Od(0,0,0),h.va=h.oa,h.Lk(this.Od(1,0,0)))},p.prototype.Tw=function(h,a){a.Nf(this.description),a.Cb(this.hc(h));for(var u=1,d=this.description.Aa;ua||a>=this.wa)throw m.i.fa("index out of bounds");this.mc(),u.Nf(this.description),u.B()&&u.un();for(var d=0;da||a>=this.I())throw m.i.ce();this.mc(),this.za[0].tc(2*a,u)},h.prototype.Na=function(a){var u=new m.h;return this.D(a,u),u},h.prototype.Gc=function(a,u){this.za[0].tc(2*a,u)},h.prototype.Cb=function(a,u,d){if(0>a||a>=this.wa)throw m.i.ce();this.mc();var g=this.za[0];d!==void 0?(g.write(2*a,u),g.write(2*a+1,d)):g.Tt(2*a,u),this.Pc(1993)},h.prototype.Cz=function(){if(void 0>=this.I())throw m.i.ce();this.mc();var a=this.za[0],u=new m.Nd;return u.x=a.read(NaN),u.y=a.read(NaN),u.z=this.hasAttribute(1)?this.za[1].eg():m.ra.se(1),u},h.prototype.dC=function(a){if(0>a||a>=this.I())throw m.i.ce();this.re(1),this.mc(),this.Pc(1993);var u=this.za[0];u.write(2*a,(void 0).x),u.write(2*a+1,(void 0).y),this.za[1].pr(a,(void 0).z)},h.prototype.Uc=function(a,u,d){if(0>u||u>=this.wa)throw m.i.ce();var g=m.ra.Va(a);if(d>=g)throw m.i.ce();this.mc();var v=this.description.Pf(a);return 0<=v?this.za[v].eg(u*g+d):m.ra.se(a)},h.prototype.yF=function(a,u){return this.Uc(a,u)},h.prototype.setAttribute=function(a,u,d,g){if(0>u||u>=this.wa)throw m.i.ce();var v=m.ra.Va(a);if(d>=v)throw m.i.ce();this.re(a),this.mc(),a=this.description.Pf(a),this.Pc(1993),this.za[a].pr(u*v+d,g)},h.prototype.ub=function(a){return this.wx(),this.re(a),this.mc(),this.za[this.description.Pf(a)]},h.prototype.hn=function(a,u){if(u!=null&&m.ra.Tp(a)!=u.Tp())throw m.i.N();this.re(a),a=this.description.Pf(a),this.za==null&&(this.za=m.Yc.qI(this.description.Aa)),this.za[a]=u,this.Pc(16777215)},h.prototype.sn=function(a){var u=null;if(this.za!=null){var d=m.ee.Iw(a,this.description);u=[];for(var g=0,v=a.Aa;gthis.wa+5?(5*this.wa+3)/4:this.wa),this.za[a].resize(g*d,m.ra.se(u))),ga)throw m.i.N();a!=this.wa&&(this.wa=a,this.Pc(65535))},h.prototype.om=function(a){if(!this.ak(1)){if(!this.ak(2))return 0;if(this.QT>=a)return this.ak(8)?1:2}return-1},h.prototype.Ch=function(a,u){if(this.QT=u,a==-1)this.Lf(1,!0),this.Lf(8,!0);else if(this.Lf(1,!1),this.Lf(8,!0),a==0)this.Lf(2,!1),this.Lf(4,!1);else if(a==1)this.Lf(2,!0),this.Lf(4,!1);else{if(a!=2)throw m.i.fa("internal error.");this.Lf(2,!0),this.Lf(4,!0)}},h.prototype.lM=function(){this.Bb!=null&&(this.Bb=null)},h.prototype.kD=function(a,u,d,g){if(0>a||a>=this.wa||0>u||u>=this.wa)throw m.i.fa("index out of bounds");this.mc(),g.Nf(this.description),g.B()&&g.un();for(var v=0;va||a>=this.wa)throw m.i.ce();this.mc();var u=new m.Sa;u.Nf(this.description),u.B()&&u.un();for(var d=0;da||a>=this.wa)throw m.i.ce();if(u.B())throw m.i.N();this.mc();for(var d=u.description,g=0;gm.O.bB(this.Tm)>>1:h!=-1)?p=h:u=v,h=!0;;){if(0>u){if((v=g[7*p])==-1){u=p,a=this.ob.Ll([-1,-1,p,a,this.gl(),-1,-1]),(g=this.ob.o)[7*p]=a;break}p=v}else{if((v=g[7*p+1])==-1){u=g[7*p+6],a=this.ob.Ll([-1,-1,p,a,this.gl(),-1,-1]),(g=this.ob.o)[7*p+1]=a;break}p=v}h&&(u*=-1,h=!1)}return this.oy(a,g),g[7*a+2]===-1&&(g[7*d]=a),this.vp(u,a,d,g),a},E.prototype.FF=function(){return this.iR(this.Qe)},E.prototype.vd=function(p,h){h=h==-1?this.Qe:h,this.Rv?this.LP(p,h):this.iY(p,h)},E.prototype.search=function(p,h){for(h=this.sv(h);h!=-1;){var a=this.Zn.compare(this,p,h);if(a==0)return h;h=0>a?this.ll(h):this.Xp(h)}return-1},E.prototype.IW=function(p){for(var h=this.sv(-1),a=-1;h!=-1;){var u=p.compare(this,h);if(u==0)return h;0>u?h=this.ll(h):(a=h,h=this.Xp(h))}return a},E.prototype.uJ=function(p){for(var h=this.sv(-1),a=-1;h!=-1;){var u=p.compare(this,h);if(u==0)return h;0>u?(a=h,h=this.ll(h)):h=this.Xp(h)}return a},E.prototype.ja=function(p){return this.ob.T(p,3)},E.prototype.ll=function(p){return this.ob.T(p,0)},E.prototype.Xp=function(p){return this.ob.T(p,1)},E.prototype.getParent=function(p){return this.ob.T(p,2)},E.prototype.lb=function(p){return this.ob.T(p,6)},E.prototype.we=function(p){return this.ob.T(p,5)},E.prototype.rc=function(p){return p==-1?this.kl(this.Qe):this.kl(p)},E.prototype.Fc=function(p){return p==-1?this.Zr(this.Qe):this.Zr(p)},E.prototype.ZR=function(p){return p==-1?this.bG(this.Qe):this.bG(p)},E.prototype.Sj=function(p,h){this.NB(p,h)},E.prototype.sv=function(p){return p==-1?this.YF(this.Qe):this.YF(p)},E.prototype.clear=function(){this.ob.mj(!1),this.Qe=-1},E.prototype.size=function(p){return p==-1?this.$F(this.Qe):this.$F(p)},E.prototype.KN=function(p,h){for(var a=h[7*p],u=h[7*p+1],d=h[7*p+4];a!=-1||u!=-1;){var g=a!=-1?h[7*a+4]:2147483647;if(u=u!=-1?h[7*u+4]:2147483647,d<=Math.min(g,u))break;g<=u?this.sJ(a,h):this.rJ(p,h),a=h[7*p],u=h[7*p+1]}},E.prototype.oy=function(p,h){if(this.Rv)for(var a=h[7*p+4],u=h[7*p+2];u!=-1&&h[7*u+4]>a;)h[7*u]==p?this.sJ(p,h):this.rJ(u,h),u=h[7*p+2]},E.prototype.rJ=function(p,h){var a=h[7*p+1];h[7*a+2]=h[7*p+2],h[7*p+2]=a;var u=h[7*a];h[7*p+1]=u,u!=-1&&(h[7*u+2]=p),h[7*a]=p,(u=h[7*a+2])!=-1&&(h[7*u]==p?h[7*u]=a:h[7*u+1]=a)},E.prototype.sJ=function(p,h){var a=h[7*p+2];h[7*p+2]=h[7*a+2],h[7*a+2]=p;var u=h[7*p+1];h[7*a]=u,u!=-1&&(h[7*u+2]=a),h[7*p+1]=a,(u=h[7*p+2])!=-1&&(h[7*u]===a?h[7*u]=p:h[7*u+1]=p)},E.prototype.Pk=function(p,h){this.ob.S(p,2,h)},E.prototype.TB=function(p,h){this.ob.S(p,0,h)},E.prototype.XB=function(p,h){this.ob.S(p,1,h)},E.prototype.WB=function(p,h){this.ob.S(p,5,h)},E.prototype.ex=function(p,h){this.ob.S(p,6,h)},E.prototype.XJ=function(p,h){this.ob.S(h,0,p)},E.prototype.rX=function(p){this.ob.S(p,4,0)},E.prototype.uX=function(p,h){this.ob.S(h,5,p)},E.prototype.YF=function(p){return p==-1?-1:this.ob.T(p,0)},E.prototype.kl=function(p){return p==-1?-1:this.ob.T(p,1)},E.prototype.Zr=function(p){return p==-1?-1:this.ob.T(p,2)},E.prototype.iR=function(p){return p==-1?-1:this.ob.T(p,3)},E.prototype.$F=function(p){return p==-1?0:this.ob.T(p,4)},E.prototype.bG=function(p){return this.ob.T(p,5)},E.prototype.Pw=function(){return this.ob.Ll([-1,-1,-1,void 0,this.gl(),-1,-1])},E.prototype.fl=function(p){p!=-1&&this.ob.jd(p)},E.prototype.gl=function(){return this.Tm=m.O.bB(this.Tm),1073741823&this.Tm},E.prototype.FD=function(p,h,a){var u=this.ob.o;if(a==-1||u[7*a]==-1)return p=this.ob.Ll([-1,-1,-1,p,this.gl(),-1,-1]),(u=this.ob.o)[7*a]=p,this.vp(-1,p,a,u),p;for(var d=a==-1?-1:u[7*a];;){var g=h==-1?1:this.Zn.compare(this,p,d);if(0>g){if((g=this.ll(d))==-1){h=d,p=this.ob.Ll([-1,-1,d,p,this.gl(),-1,-1]),(u=this.ob.o)[7*d]=p;break}d=g}else{if(h==1&&g==0)return u[7*a+3]=d,-1;if((g=u[7*d+1])==-1){h=u[7*d+6],p=this.ob.Ll([-1,-1,d,p,this.gl(),-1,-1]),(u=this.ob.o)[7*d+1]=p;break}d=g}}return this.oy(p,u),u[7*p+2]===-1&&(u[7*a]=p),this.vp(h,p,a,u),p},E.prototype.vp=function(p,h,a,u){if(p!=-1){var d=u[7*p+5];u[7*p+5]=h}else d=a==-1?-1:u[7*a+2];u[7*h+5]=d,d!=-1&&(u[7*d+6]=h),u[7*h+6]=p,p==(a==-1?-1:u[7*a+1])&&(u[7*a+1]=h),p==-1&&(u[7*a+2]=h),u[7*a+4]=(a==-1?0:u[7*a+4])+1},E.prototype.AB=function(p,h){var a=this.ob.o,u=a[7*p+5];p=a[7*p+6],u!=-1?a[7*u+6]=p:a[7*h+1]=p,p!=-1?a[7*p+5]=u:a[7*h+2]=u,a[7*h+4]=h===-1?-1:a[7*h+4]-1},E.prototype.iY=function(p,h){this.AB(p,h);var a=this.ll(p),u=this.Xp(p),d=this.getParent(p),g=p;if(a!=-1&&u!=-1){this.Tm=m.O.bB(this.Tm);var v=1073741823=p.oa:p.va>=this.oa},E.prototype.move=function(p){this.B()||(this.oa+=p,this.va+=p)},E.prototype.normalize=function(){if(!isNaN(this.oa)){if(this.oa>this.va){var p=this.oa;this.oa=this.va,this.va=p}isNaN(this.va)&&this.Oa()}},E.prototype.Oa=function(){this.va=this.oa=NaN},E.prototype.B=function(){return isNaN(this.oa)},E.prototype.Zb=function(p){typeof p=="number"?this.B()?this.va=this.oa=p:this.Lk(p):p.B()||(this.B()?(this.oa=p.oa,this.va=p.va):(this.oa>p.oa&&(this.oa=p.oa),this.vathis.va&&this.Oa()))},E.prototype.Lk=function(p){pthis.va&&(this.va=p)},E.prototype.contains=function(p){return typeof p=="number"?p>=this.oa&&p<=this.va:p.oa>=this.oa&&p.va<=this.va},E.prototype.Ea=function(p){this.B()||p.B()?this.Oa():(this.oap.va&&(this.va=p.va),this.oa>this.va&&this.Oa())},E.prototype.W=function(p){this.B()||(this.oa-=p,this.va+=p,this.vah?(this.oa=h,this.va=p):(this.oa=p,this.va=h)},E.prototype.It=function(p){return m.O.Rk(p,this.oa,this.va)},E.prototype.R=function(){return this.va-this.oa},E.prototype.sf=function(){return .5*(this.oa+this.va)},E.prototype.Nb=function(p){return p==this||p instanceof E&&(!(!this.B()||!p.B())||this.oa==p.oa&&this.va==p.va)},E.prototype.cc=function(){return m.O.uj(m.O.uj())},E}();m.Nc=D}(ie||(ie={})),function(m){var D=new m.Nc,E=new m.Nc,p=function(){this.ne=null,this.pb=-1,this.sb=new m.yb,this.qA=55555555,this.Tv=this.Vv=!1,this.Uf=new m.Nc,this.Uf.KB(0,0)};m.IY=p;var h=function(){function a(u,d,g){this.g=u,this.Hk=NaN,this.NH=this.Kq=0,this.OH=NaN,this.qa=d,this.Nq=10*d,this.PH=this.QH=NaN,this.rg=!1,this.Dm=this.gt=this.Lo=this.Xs=this.Ws=-1,this.gA=g,this.TA=new p,this.YH=new p,m.O.truncate(3*u.fd/2)}return a.prototype.mG=function(u,d,g,v){u.ne=v===null?null:v[g[5*d]],u.Tv=u.ne!=null,u.Tv||((v=g[5*d+2])!==-1&&this.g.mW(g[5*d],g[5*v],u.sb),u.ne=u.sb,u.Uf.KB(u.sb.sa,u.sb.pa),u.Uf.va+=this.qa,u.sb.rI(),u.Vv=u.sb.la==u.sb.na,u.Vv||(u.qA=(u.sb.pa-u.sb.sa)/(u.sb.la-u.sb.na)))},a.prototype.OO=function(u,d){var g=u.zr(d,this.qa,!0);return g!=0?g==2?this.Qy():this.xi():(u.Yp(vt),u.Tr(Bt),d.Yp(qt),d.Tr(li),Lt.ma(this.Kq,this.Hk),vt.qb(qt)&&this.Hk==vt.y?0>Bt.compare(li)?Lt.L(Bt):Lt.L(li):vt.qb(li)&&this.Hk==vt.y?0>Bt.compare(qt)?Lt.L(Bt):Lt.L(qt):qt.qb(Bt)&&this.Hk==qt.y?0>vt.compare(li)?Lt.L(vt):Lt.L(li):Bt.qb(li)&&this.Hk==Bt.y&&(0>vt.compare(qt)?Lt.L(vt):Lt.L(qt)),u.Pe(Lt.y,Lt.x)g&&0>u?-1:0d.pa){if(d.pa>d.sa&&d.la-d.na<2*this.qa&&u.vi(d.pa,d.la,this.qa))return this.xi()}else if((d.la-d.na)/(d.pa-d.sa)*(u.pa-u.sa)d.sa&&d.la-d.na<2*this.qa&&u.vi(d.pa,d.la,this.qa))return this.xi()}else if((d.la-d.na)/(d.pa-d.sa)*(u.sa-u.pa)v&&0>g?-1:0d+S?g:v.vi(u.sa,u.na,this.qa)?this.xi():bd+S?g:v.vi(u.pa,u.la,this.qa)?this.xi():bb?1:0)},a.prototype.Kr=function(){this.rg=!1},a.prototype.rm=function(){return this.Ni},a.prototype.$J=function(u,d){this.Hk=u,this.Kq=d,this.gt=this.Lo=this.Xs=this.Ws=-1},a.prototype.compare=function(u,d,g){return this.rg?-1:(u=u.ja(g),this.Dm=g,this.RE(d,d,u,u))},a.prototype.RE=function(u,d,g,v){if(this.Lo==d)var b=this.TA;else this.Lo=d,b=this.TA,this.TA.pb=u,this.mG(b,d,this.g.td.o,this.g.We);if(S==null){this.gt=v;var S=this.YH;this.YH.pb=g,this.mG(S,v,this.g.td.o,this.g.We)}return b.Tv||S.Tv?this.NO(d,v,b,S):b.Uf.vathis.Uf.va)return 1;if(this.ie.na==this.ie.la)return this.Dm=p,this.rg=!0,0;this.ie.rI(),a=this.ie.ac(),(h=new m.h).uc(this.ie.wc(),a),h.ar();var u=new m.h;return u.uc(this.Gq,a),a=h.Qh(u),(a/=h.length())<10*-this.qa?-1:a>10*this.qa?1:this.ie.qs(this.Gq,this.qa)&&((h=Math.abs(a))a?-1:1},E}();m.aM=D}(ie||(ie={})),function(m){function D(p,h,a,u){a=new Float64Array(p.subarray(a,u)),p.set(a,h)}var E=function(){function p(h){this.Pb=this.pk=!1,this.o=null;var a=h;2>a&&(a=2),this.o=new Float64Array(a),this.size=h}return p.prototype.rotate=function(h,a,u){if(this.Pb)throw m.i.fa("invalid_call");if(au||h>u)throw m.i.N();h!=a&&u!=a&&(this.ni(h,a-h,1),this.ni(a,u-a,1),this.ni(h,u-h,1))},p.qf=function(h,a){var u=new p(h),d=u.o;if(2>h&&(h=2),a!==0)for(var g=0;ga&&(u.size=a),2>(a=u.size)&&(a=2),u.o=new Float64Array(a),u.o.set(h.o.length<=a?h.o:h.o.subarray(0,a),0),u},p.prototype.Jb=function(h){0>=h||(this.o==null?this.o=new Float64Array(h):h<=this.o.length||(0this.o.length&&(u=m.O.truncate(64>h?Math.max(2*h,4):5*h/4),(u=new Float64Array(u)).set(this.o),this.o=u),u=this.o;for(var d=this.size;dthis.o.length)&&this.resize(h),this.pk)throw m.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=h},p.prototype.pr=function(h,a){this.write(h,a)},p.prototype.An=function(h,a,u){for(var d=this.size;ad||u>g&&d!=g)return!1;for(u>d&&(u=d);ag||u%g!=0))throw m.i.N();var v=this.size;if(this.resize(v+u),d)this.o.set(h.o.subarray(a,a+u),v);else{d=u;for(var b=0;bv||d%v!=0))throw m.i.N();var S=this.size-b;if(Sv&&(v=this.size),this.size+2*d>this.o.length?this.resize(this.size+2*d):this.size+=2*d,D(this.o,h+2*d,h,h+(v-h)),g)for(g=0;gh||0>a||0>d||!g&&(0>=v||a%v!=0)||u.sizethis.size)throw m.i.Hb();0u||a%u!=0)throw m.i.Hb();for(var d=a>>1,g=0;ga||0>u||0>a||u+a>this.size)throw m.i.N();for(var d=a;dh||0>a||0>d)throw m.i.N();if(a!=0)for(this.size<(a<<1)+h&&this.resize((a<<1)+h),g||(h+=a-1<<1),g=g?2:-2,a+=d;dh||0>a)throw m.i.N();if(a!=0){this.size<(a<<1)+h&&this.resize((a<<1)+h),a+=0;for(var d=0;dh||0>a||0>d||this.sizeh||0>a||this.size<(a>>1)+h)throw m.i.N();if(a!=0){a=0+a;for(var d=0;da&&(a=2),this.o=new Int32Array(a),this.size=h}return p.prototype.rotate=function(h,a,u){if(this.Pb)throw m.i.fa("invalid_call");if(au||h>u)throw m.i.N();h!=a&&u!=a&&(this.ni(h,a-h,1),this.ni(a,u-a,1),this.ni(h,u-h,1))},p.qf=function(h,a){var u=new p(h),d=u.o;if(2>h&&(h=2),a!==0)for(var g=0;ga&&(u.size=a),2>(a=u.size)&&(a=2),u.o=new Int32Array(a),u.o.set(h.o.length<=a?h.o:h.o.subarray(0,a),0),u},p.prototype.Jb=function(h){0>=h||(this.o==null?this.o=new Int32Array(h):h<=this.o.length||(0this.o.length&&(u=m.O.truncate(64>h?Math.max(2*h,4):5*h/4),(u=new Int32Array(u)).set(this.o),this.o=u),u=this.o;for(var d=this.size;dthis.o.length)&&this.resize(h),this.pk)throw m.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=h},p.prototype.pr=function(h,a){this.write(h,a)},p.prototype.An=function(h,a,u){for(var d=this.size;ad||u>g&&d!=g)return!1;for(u>d&&(u=d);ag||u%g!=0))throw m.i.N();var v=this.size;if(this.resize(v+u),d)this.o.set(h.o.subarray(a,a+u),v);else{d=u;for(var b=0;bv||d%v!=0))throw m.i.N();if(D(this.o,h+d,h,h+(b-h)),this.o==a.o&&hv&&(v=this.size),this.size+2*d>this.o.length?this.resize(this.size+2*d):this.size+=2*d,D(this.o,h+2*d,h,h+(v-h)),g)for(g=0;gh||0>a||0>d||!g&&(0>=v||a%v!=0)||u.sizethis.size)throw m.i.Hb();0u||a%u!=0)throw m.i.Hb();for(var d=a>>1,g=0;ga||0>u||0>a||u+a>this.size)throw m.i.N();for(var d=a;dh||0>a||0>d)throw m.i.N();if(a!=0)for(this.size<(a<<1)+h&&this.resize((a<<1)+h),g||(h+=a-1<<1),g=g?2:-2,a+=d;dh||0>a||0>d||this.sizea-h?p.rG(this.o,h,a,u):p.qB(this.o,h,a-1,u)},p.prototype.Tp=function(){return 2},p.prototype.Fc=function(){return this.o[this.size-1]},p.prototype.If=function(){this.resize(this.size-1)},p.prototype.bX=function(h){this.o[this.size-1]=h},p.prototype.SV=function(h){h=a&&0=u))for(;;){if(9>u-a){p.rG(h,a,u+1,d);break}var g=h[a];p.tx(h,a,u);for(var v=a,b=a;b=d(h[b],g)&&(p.tx(h,v,b),v+=1);p.tx(h,v,u),v-aa&&(a=2),this.o=new Int8Array(a),this.size=h}return p.prototype.rotate=function(h,a,u){if(this.Pb)throw m.i.fa("invalid_call");if(au||h>u)throw m.i.N();h!=a&&u!=a&&(this.ni(h,a-h,1),this.ni(a,u-a,1),this.ni(h,u-h,1))},p.qf=function(h,a){var u=new p(h),d=u.o;if(2>h&&(h=2),a!==0)for(var g=0;ga&&(u.size=a),2>(a=u.size)&&(a=2),u.o=new Int8Array(a),u.o.set(h.o.length<=a?h.o:h.o.subarray(0,a),0),u},p.prototype.Jb=function(h){0>=h||(this.o==null?this.o=new Int8Array(h):h<=this.o.length||(0this.o.length&&(u=m.O.truncate(64>h?Math.max(2*h,4):5*h/4),(u=new Int8Array(u)).set(this.o),this.o=u),u=this.o;for(var d=this.size;dthis.o.length)&&this.resize(h),this.pk)throw m.i.fa("invalid call. Attribute Stream is locked and cannot be resized.");this.size=h},p.prototype.pr=function(h,a){this.write(h,a)},p.prototype.An=function(h,a,u){for(var d=this.size;ad||u>g&&d!=g)return!1;for(u>d&&(u=d);ag||u%g!=0))throw m.i.N();var v=this.size;if(this.resize(v+u),d)this.o.set(h.o.subarray(a,a+u),v);else{d=u;for(var b=0;bv||d%v!=0))throw m.i.N();if(D(this.o,h+d,h,h+(b-h)),this.o==a.o&&hv&&(v=this.size),this.size+2*d>this.o.length?this.resize(this.size+2*d):this.size+=2*d,D(this.o,h+2*d,h,h+(v-h)),g)for(g=0;gh||0>a||0>d||!g&&(0>=v||a%v!=0)||u.sizethis.size)throw m.i.Hb();0u||a%u!=0)throw m.i.Hb();for(var d=a>>1,g=0;ga||0>u||0>a||u+a>this.size)throw m.i.N();for(var d=a;dh||0>a||0>d)throw m.i.N();if(a!=0)for(this.size<(a<<1)+h&&this.resize((a<<1)+h),g||(h+=a-1<<1),g=g?2:-2,a+=d;dh||0>a||0>d||this.sizep?-p:p},E.ti=function(p){return 3552713678800501e-30>p},E.KC=function(p,h,a){return E.P(p-h)<=a*(1+(E.P(p)+E.P(h))/2)},E.Y=function(p,h){return E.KC(p,h,3552713678800501e-30)},E.FL=function(p){return 3552713678800501e-30>=E.P(p)},E.Cd=function(p){return E.FL(p)},E}();m.s=D,m.F=function(){function E(){}return E.gp=function(p,h){var a=0;return(p=D.P(p))+(h=D.P(h))!=0&&(p>h?(a=h/p,a=p*Math.sqrt(1+a*a)):(a=p/h,a=h*Math.sqrt(1+a*a))),a},E.Wq=function(p,h,a,u,d){for(var g=[0,0,0],v=[0,0,0],b=0;2>=b;b++)h[b]-=p[b],a[b]-=h[b];a=g[1]*v[2]-g[2]*v[1],h=g[2]*v[0]-g[0]*v[2],g=g[0]*v[1]-g[1]*v[0],p=-1*(a*p[0]+h*p[1]+g*p[2]),u[0]=a,u[1]=h,u[2]=g,u[3]=p,v=E.on(u),u[0]/=v,u[1]/=v,u[2]/=v,u[3]/=v,d!=0&&(v=D.Cd(g)?D.Cd(p)?D.Mb(1,h):-D.Mb(1,p):D.Mb(1,g),v*=D.Mb(1,d),u[0]*=v,u[1]*=v,u[2]*=v,u[3]*=v)},E.zx=function(p,h,a){a[0]=p[1]*h[2]-h[1]*p[2],a[1]=p[2]*h[0]-h[2]*p[0],a[2]=p[0]*h[1]-h[0]*p[1]},E.St=function(p,h){return p[0]*h[0]+p[1]*h[1]+p[2]*h[2]},E.on=function(p){return E.gp(E.gp(p[0],p[1]),p[2])},E.cl=function(p,h,a,u,d,g,v,b){p=E.n(p,h,a);var S=Math.cos(a);g.u=(p+d)*S*Math.cos(u),v.u=(p+d)*S*Math.sin(u),b.u=(p*(1-h)+d)*Math.sin(a)},E.jO=function(p,h,a,u,d,g,v){var b=E.gp(h,a),S=1*Math.sqrt(1-p),C=S/1;if(D.Y(b,0))g.u=0,d.u=D.Mb(1.570796326794897,u),v.u=D.P(u)-S;else{g.u=Math.atan2(a,h),a=Math.atan2(1*u,S*b),g=Math.cos(a);var O=Math.sin(a);h=S*p/(1-p),p*=1,a=Math.atan2(u+h*O*O*O,b-p*g*g*g),3.141592653589793p){var a=Math.sqrt(1-p),u=(1-a)/(1+a),d=u*u,g=u*d,v=u*g,b=u*v,S=u*b,C=u*S,O=1.572916666666667*g-3.2578125*b+4.295068359375*C;p=2.142578125*v-6.071484375*S,a=3.129296875*b-11.249837239583334*C;var R=4.775276692708333*S,$=7.958636765252976*C,N=Math.cos(2*h);return h+Math.sin(2*h)*(1.5*u-.84375*g+.525390625*b-.2688395182291667*C-O+a-$+N*(2*(1.3125*d-1.71875*v+1.650146484375*S)-4*p+6*R+N*(4*O-12*a+24*$+N*(8*p-32*R+N*(16*a-80*$+N*(32*R+64*N*$))))))}for(a=1-p,u=p/2,g=(d=D.P(h))*E.Zu(p)/(1.570796326794897*a),v=9999,S=d,d=0;1e-16d;d++)C=E.w(p,S),b=S-(O=(b=(E.kG(S,p)-u*Math.sin(2*S)/C)/a-g)/(C=1/(C*C*C))),v=D.P(O),S=b;return 0<=h?S:-S},E.qW=function(p,h){return D.ti(h)?p:p*E.Zu(h)/1.570796326794897},E.ba=function(p){return 0>(p=E.pF(p,6.283185307179586))?p+6.283185307179586:3.141592653589793>D.P(p)||D.Y(D.P(p),3.141592653589793)?p:p-6.283185307179586},E.pF=function(p,h){return p-Math.floor(p/h)*h},E.Ah=function(p,h){if(.006884661117170036>h){var a=(h=(1-(h=Math.sqrt(1-h)))/(1+h))*h,u=a*a;return p/(1+h)*(1+.25*a+.015625*u+.00390625*a*u)*1.570796326794897}return p*E.Zu(h)},E.Vq=function(p,h){var a=D.Mb(1,Math.sin(h));return h=1.570796326794897>=(h=D.P(E.pF(h,3.141592653589793)))?h:3.141592653589793-h,(D.Y(h,1.570796326794897)?h:Math.atan(Math.sqrt(1-p)*Math.tan(h)))*a},E.q=function(p,h,a){if(.006884661117170036>h){var u=(h=(1-(h=Math.sqrt(1-h)))/(1+h))*h,d=h*u,g=h*d,v=h*g,b=h*v,S=h*b,C=-.7291666666666666*d+.2278645833333333*v+.03987630208333334*S,O=.615234375*g-.21533203125*b,R=-.54140625*v+.20302734375*S,$=.48876953125*b,N=-.4488699776785715*S,B=Math.cos(2*a);return p/(1+h)*((1+.25*u+.015625*g+.00390625*b)*a+Math.sin(2*a)*(-1.5*h+.1875*d+.0234375*v+.00732421875*S-C+R-N+B*(2*(.9375*u-.234375*g-.03662109375*b)-4*O+6*$+B*(4*C-12*R+24*N+B*(8*O-32*$+B*(16*R-80*N+B*(32*$+64*B*N)))))))}return p*(E.kG(a,h)-.5*h*Math.sin(2*a)/E.w(h,a))},E.w=function(p,h){return h=Math.sin(h),Math.sqrt(1-p*h*h)},E.Zu=function(p){return D.KC(p,1,2220446049250313e-31)?1:1>p?E.Xw(0,1-p)-p/3*E.Uw(0,1-p):NaN},E.kG=function(p,h){var a=D.Mb(1,p);p=D.P(p);var u=Math.floor(p/1.570796326794897);if(1D.P(u)&&1e-4>D.P(d)&&1e-4>D.P(g));)g=Math.sqrt(b),h+=p/((a=Math.sqrt(S))*(S+(g=Math.sqrt(v)*(g+a)+g*a))),p*=.25,v=.25*(v+g),b=.25*(b+g),S=.25*(S+g);return b=(v=u*d)-(S=g*g),3*h+p*(1+(S=v-6*S)*(.10227272727272728*S-.2142857142857143-.1730769230769231*g*(u=S+b+b))+g*(.1666666666666667*u+g*(-.4090909090909091*b+.1153846153846154*g*v)))/(a*Math.sqrt(a))},E.Xw=function(p,h){for(var a,u,d,g,v=1;u=2-((a=(p+h+v)/3)+p)/a,d=2-(a+h)/a,g=2-(a+v)/a,!(1e-4>D.P(u)&&1e-4>D.P(d)&&1e-4>D.P(g));v=.25*(v+a))a=Math.sqrt(h),u=Math.sqrt(v),p=.25*(p+(a=Math.sqrt(p)*(a+u)+a*u)),h=.25*(h+a);return(1+(.04166666666666666*(p=u*d-g*g)-.1-.06818181818181818*(h=u*d*g))*p+.07142857142857142*h)/Math.sqrt(a)},E.Qw=function(p,h){if(D.ti(p)||h==0||D.Y(D.P(h),1.570796326794897))return h;if(.006884661117170036>p){var a=p*p,u=p*a,d=p*u,g=p*d,v=p*g,b=p*v,S=-(.02708333333333333*u+.03430059523809524*d+.03149181547619048*g+.02634359154541446*v+.02156896735835538*b),C=.007669890873015873*d+.01299603174603175*g+.0148051353064374*v+.01454454953803912*b,O=-(.002275545634920635*g+.004830845032667949*v+.006558395368616723*b),R=.0006957236677288761*v+.001775193002406544*b,$=-.000217324089394402*b,N=Math.cos(2*h);return h+Math.sin(2*h)*(-(.5*p+.2083333333333333*a+.09375*u+.04878472222222222*d+.02916666666666667*g+.01938905423280423*v+.01388255931712963*b)-S+O-$+N*(2*(.1041666666666667*a+.0875*u+.06050347222222222*d+.04151785714285714*g+.02958958540013228*v+.02203667534722222*b)-4*C+6*R+N*(4*S-12*O+24*$+N*(8*C-32*R+N*(16*O-80*$+N*(32*R+64*N*$))))))}return h==0||D.Y(D.P(h),1.570796326794897)?a=h:(d=(u=Math.sqrt(p))*Math.sin(h),a=Math.tan(.7853981633974483+h/2)*Math.pow((1-d)/(1+d),u/2),a=2*Math.atan(a)-1.570796326794897),a},E.yO=function(p,h){if(D.ti(p)||h==0||D.Y(D.P(h),1.570796326794897))return h;if(.006884661117170036>p){var a=p*(R=p*(O=p*(N=p*p))),u=p*($=p*a),d=.05833333333333333*O+.07232142857142858*R+.05634300595238095*a+.0355325796406526*$+.020235546186067*u,g=.02653149801587302*R+.04379960317460317*a+.0429211791776896*$+.03255384637546096*u,v=.01294022817460318*a+.02668104344536636*$+.03155651254609588*u,b=.00659454790965208*$+.0163075268674227*u,S=.003463473736911237*u,C=Math.cos(2*h);return h+Math.sin(2*h)*(.5*p+.2083333333333333*N+.08333333333333333*O+.03611111111111111*R+.01875*a+.01195601851851852*$+.008863673941798942*u-d+v-S+C*(2*(.1458333333333333*N+.1208333333333333*O+.07039930555555556*R+.03616071428571429*a+.01839451058201058*$+.01017113095238095*u)-4*g+6*b+C*(4*d-12*v+24*S+C*(8*g-32*b+C*(16*v-80*S+C*(32*b+64*C*S))))))}var O=Math.sqrt(p),R=O/2,$=Math.tan(.7853981633974483+h/2);p=0,d=1;for(var N=h;d!=0;N=u)a=O*Math.sin(N),u=$*Math.pow((1+a)/(1-a),R),u=2*Math.atan(u)-1.570796326794897,p++,(D.Y(u,N)||3e4this.Kk&&(this.Kk=0);var a=this.Ue.getType();if(this.jH=a==m.Sc.PE_TYPE_PROJCS?2:1,a==m.Sc.PE_TYPE_PROJCS&&!p.loadConstants())throw m.i.N("PeProjcs.loadConstants failed");h=a==m.Sc.PE_TYPE_GEOGCS?this.Ue:this.Ue.getGeogcs(),a!=m.Sc.PE_TYPE_GEOGCS&&m.pf.getCode(h),this.Eo=p.getUnit(),this.RH=h.getPrimem().getLongitude(),this.wH=p=h.getUnit().getUnitFactor(),p=Math.PI/(180*p),1e-10>Math.abs(p-1)&&(p=1),this.GA=p,a&m.Sc.PE_TYPE_PROJCS?(h=this.Ue,this.HA=1/h.getUnit().getUnitFactor(),this.sw=.001/this.Ue.getUnit().getUnitFactor(),this.tw=m.Cg.generate(h,m.Cg.PE_PCSINFO_OPTION_NONE),this.zl=this.tw.isPannableRectangle(),this.bA=m.zb.qN(this.tw.getCentralMeridian(),this.GA)):(this.KA=this.zl=!0,this.HA=0,a=1/h.getUnit().getUnitFactor(),this.sw=.001/h.getDatum().getSpheroid().getAxis()*a,this.bA=0),this.zl&&(this.xx(),this.DK(),this.nY(),this.CK(),this.lY(),this.mY())}return E.prototype.$r=function(){return this.Kk},E.prototype.kk=function(){return this.tw},E.Py=function(p,h){return p==h||p!=null&&h!=null&&p.Kk==0&&h.Kk==0&&p.As===h.As},E.prototype.Wc=function(){return this.zl},E.prototype.gh=function(p){p.K(this.so)},E.prototype.pv=function(){return this.so.v},E.prototype.ov=function(){return this.so.C},E.prototype.GR=function(p){p.K(this.uw)},E.prototype.lY=function(){var p=this.Ue.getType();if(p==m.Sc.PE_TYPE_PROJCS){p=this.Ue;var h=this.kk().getCentralMeridian(),a=p.getGeogcs();if(a==null)throw m.i.fa("internal error");h=[[h+(a=1/a.getUnit().getUnitFactor()*Math.PI),0]],m.ej.geogToProj(p,1,h),h=h[0][0],a=p.getParameters()[m.Sc.PE_PARM_X0].getValue();var u=this.ml();p=new m.l,u.A(p),h=(u=Math.abs(h-a))+a,a=-1*u+a,u=p.H,p=p.G;var d=new m.l;d.K(a,p,h,u),this.so==null&&(this.so=d)}else{if(p!=m.Sc.PE_TYPE_GEOGCS)throw m.i.fa("internal error");a=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(p=new m.l).K(-a,-a/2,a,a/2),this.so==null&&(this.so=p)}},E.prototype.mY=function(){var p=this.Ue.getType();if(p==m.Sc.PE_TYPE_PROJCS){var h=this.Ue;if(p=this.kk().getCentralMeridian(),(h=h.getGeogcs())==null)throw m.i.fa("internal error");h=1/h.getUnit().getUnitFactor()*Math.PI;var a=this.Vr(),u=new m.l;a.A(u),(a=new m.l).K(p-h,u.G,p+h,u.H),this.uw==null&&(this.uw=a)}else{if(p!=m.Sc.PE_TYPE_GEOGCS)throw m.i.fa("internal error");h=1/this.Ue.getUnit().getUnitFactor()*Math.PI,(p=new m.l).K(-h,-h/2,h,h/2),this.uw==null&&(this.uw=p)}},E.prototype.bf=function(){return this.GA},E.prototype.pm=function(){return this.HA},E.prototype.Vr=function(){if(this.zl)return this.ul;var p=this.ul;return p??(this.xx(),this.ul)},E.prototype.Wr=function(){return this.zl?null:(this.ul!=null||this.xx(),this.YG)},E.prototype.xx=function(){if(this.Ue.getType()==m.Sc.PE_TYPE_PROJCS){var p=this.Ue,h=p.getGeogcs(),a=p.horizonGcsGenerate();if(a!=null){var u=a[0].getNump(),d=a[0].getKind();p=0S&&(a=-400*g,O.K(a,O.G,a+5*b,O.H)),a=new m.Fh(O),this.ul==null&&(this.ul=a,this.Iv=p);else{if(S=new m.Da,b=this.kk().isGcsHorizonMultiOverlap(),O=m.gu.bF(h,m.hu.Integer64),b){for(S=new m.gL,C=m.Gh.local().V(S,O,null),$=0;$this.ss&&(this.ss=0),this.Eo=h=this.KT.getUnit(),this.IH=1/h.getUnitFactor(),m.pf.getCode(p)}return E.Py=function(p,h){return p==h||p!=null&&h!=null&&p.ss==0&&h.ss==0&&p.As===h.As},E.prototype.$r=function(){return this.ss},E}();m.PL=D}(ie||(ie={})),function(m){m.Yg=function(){function D(){}return D.tb=function(E,p,h,a,u,d,g,v){if(d!=null||g!=null||v!=null){a=m.F.ba(a),p=m.F.ba(p),h=m.F.ba(h),u=m.F.ba(u),1.570796326794897h?a:m.F.ba(3.141592653589793-a):Math.atan2(O*N,S*R-C*O*$)),v!=null&&(m.s.Y(m.s.P(u),1.570796326794897)?v.u=0>u?p:m.F.ba(3.141592653589793-p):(v.u=Math.atan2(S*N,R*S*$-O*C),v.u=m.F.ba(v.u+3.141592653589793)))}}},D.rf=function(E,p,h,a,u,d,g){if(d!=null||g!=null){p=m.F.ba(p),h=m.F.ba(h),1.570796326794897R?u:m.F.ba(3.141592653589793-u):p:m.s.Y(m.s.P(h),1.570796326794897)&&m.s.Y(E,3.141592653589793)?0>h?u:m.F.ba(3.141592653589793-u):m.F.ba(p+Math.atan2(O*b,S*a-C*O*v)))}},D}()}(ie||(ie={})),function(m){m.Wk=function(){function D(){}return D.tb=function(E,p,h,a,u,d,g,v,b){var S=new m.ga(0),C=new m.ga(0),O=[0,0,0],R=[0,0,0],$=[0,0,0],N=new m.ga(0),B=new m.ga(0),G=new m.ga(0),K=new m.ga(0),ee=new m.ga(0);if(g!=null||v!=null||b!=null)if(m.s.ti(p))m.Yg.tb(E,h,a,u,d,g,v,b);else{u=m.F.ba(u),h=m.F.ba(h);var q=m.F.ba(u-h);if(m.s.Y(a,d)&&(m.s.Y(h,u)||m.s.Y(m.s.P(a),1.570796326794897)))g!=null&&(g.u=0),v!=null&&(v.u=0),b!=null&&(b.u=0);else{if(m.s.Y(a,-d)){if(m.s.Y(m.s.P(a),1.570796326794897))return g!=null&&(g.u=2*m.F.Ah(E,p)),v!=null&&(v.u=0q){oe=1;var ge=h;h=u,u=ge,ge=a,a=d,d=ge}q=m.F.ot(p,a);var me=m.F.ot(p,d);v==null&&b==null||(m.Yg.tb(E,h,q,u,me,null,S,C),S=Math.atan2(Math.sin(S.u)*Math.cos(a-q),Math.cos(S.u)),C=Math.atan2(Math.sin(C.u)*Math.cos(d-me),Math.cos(C.u)),oe!=0&&(ge=S,S=C,C=ge),v!=null&&(v.u=S),b!=null&&(b.u=C)),g!=null&&(m.F.cl(1,p,a,h,0,G,K,ee),O[0]=G.u,O[1]=K.u,O[2]=ee.u,m.F.cl(1,p,d,u,0,G,K,ee),R[0]=G.u,R[1]=K.u,R[2]=ee.u,$[0]=O[1]*R[2]-R[1]*O[2],$[1]=-(O[0]*R[2]-R[0]*O[2]),$[2]=O[0]*R[1]-R[0]*O[1],p=1-m.F.w(p,m.F.Vq(p,m.F.Qj(p,Math.acos($[2]/Math.sqrt($[0]*$[0]+$[1]*$[1]+$[2]*$[2]))))),p*=2-p,v=Math.atan2(-$[1],-$[0]),$=m.F.ba(v-1.570796326794897),v=m.F.ba(v+1.570796326794897),$=m.s.P(m.F.ba(h-$))<=m.s.P(m.F.ba(h-v))?$:v,m.Yg.tb(1,$,0,h,q,N,null,null),m.Yg.tb(1,$,0,u,me,B,null,null),3.141592653589793u&&(u=m.s.P(u),d=m.F.ba(d+3.141592653589793)),h=m.F.ba(h),a=m.F.ba(a),1.570796326794897=m.s.P(d)?1:-1);d=m.F.ba(h+Math.atan(Math.tan(d)*-Math.sin(G))),m.Yg.tb(E,d,0,h,G,null,C,null),G=m.s.P(1.570796326794897-m.s.P(C.u)),G=m.F.Qj(p,G),G=1-m.F.w(p,m.F.Vq(p,G)),G*=2-G,m.F.cl(1,p,0,d,0,$,N,B),O[0]=$.u,O[1]=N.u,O[2]=B.u,m.F.cl(1,p,a,h,0,$,N,B),R[0]=$.u,R[1]=N.u,R[2]=B.u,a=Math.acos((O[0]*R[0]+O[1]*R[1]+O[2]*R[2])/Math.sqrt(R[0]*R[0]+R[1]*R[1]+R[2]*R[2])),a=m.F.Qj(G,a),u=0<(a=m.F.q(E,G,a)+u*K)?C.u:m.F.ba(C.u+3.141592653589793),E=m.s.P(a)/m.F.Ah(E,G)*1.570796326794897,E=m.F.Rq(G,E),E=m.F.ot(G,E),m.Yg.rf(1,d,0,E,u,g,S),v!=null&&(b=S.u),v!=null&&(v.u=m.F.Qj(p,b))}},D}()}(ie||(ie={})),function(m){m.cu=function(){function D(){}return D.tb=function(E,p,h,a,u,d,g,v,b){var S=0,C=0,O=0;if(g!=null||v!=null||b!=null)if(m.s.ti(p))m.Yg.tb(E,h,a,u,d,g,v,b);else{var R=m.F.ba(u-h);if(m.s.Y(a,d)&&(m.s.Cd(R)||m.s.Y(m.s.P(a),1.570796326794897)))g!=null&&(g.u=0),v!=null&&(v.u=0),b!=null&&(b.u=0);else{if(m.s.Y(a,-d)){if(m.s.Y(m.s.P(a),1.570796326794897))return g!=null&&(g.u=2*m.F.Ah(E,p)),v!=null&&(v.u=0=Te&&!m.s.Y(Fe,oe));if(Me!=0)$=(N*=S)*(256+N*(N*(74-47*N)-128))/1024,g!=null&&(g.u=B*(1+N*(4096+N*(N*(320-175*N)-768))/16384)*(Mt-$*Xe*(C+$/4*(We*(2*O-1)-$/6*C*(4*Xe*Xe-3)*(4*O-3))))),v!=null&&(v.u=m.s.Y(m.s.P(a),1.570796326794897)?0>a?u:m.F.ba(3.141592653589793-u):Math.atan2(ee*me,p*q-K*ee*ge)),b!=null&&(m.s.Y(m.s.P(d),1.570796326794897)?b.u=0>d?h:m.F.ba(3.141592653589793-h):(b.u=Math.atan2(p*me,p*q*ge-K*ee),b.u=m.F.ba(b.u+3.141592653589793)));else{oe=m.s.Mb(3.141592653589793,R),We=K*q-p*ee,Mt=Math.acos(We),Xe=Math.sin(Mt),S=1,Te=lt=0;do O=lt,ge=1-.25*(lt=$*(S*=S)*(1+$+$*$))+.1875*(C=$*$*(ge=S*S)*(1+2.25*$))-.1953125*(Me=$*$*$*ge*S),lt=.25*lt-.25*C+.29296875*Me,me=.03125*C-.05859375*Me,Me*=.00651041666666667,C=We-2*K*q/S,1=Te&&!m.s.Y(O,lt));g!=null&&(ge=1+(N*=S*=S)*(4096+N*(N*(320-175*N)-768))/16384,m.s.Y(a,-d)?g.u=3.141592653589793*B*ge:(C=We-2*K*q/S,S=Math.acos(C),We=Math.cos(2*S),Fe=Math.cos(3*S),g.u=B*(ge*Mt+N*(N*(128+N*(35*N-60))-512)/2048*Xe*C+N*(5*N-4)/6144*N*N*Math.sin(2*Mt)*We+Me*Math.sin(3*Mt)*Fe+-762939453125e-16*N*N*N*N*Math.sin(4*Mt)*Math.cos(4*S)))),v!=null&&(m.s.Cd(a)&&m.s.Cd(d)?(S=Math.sqrt(1-lt*lt),v.u=Math.acos(S),0>R&&(v.u*=-1)):m.s.Y(m.s.P(a),1.570796326794897)?v.u=0>a?u:m.F.ba(3.141592653589793-u):(g=lt/p,B=Math.sqrt(1-g*g),0>p*q-K*ee*Math.cos(oe)&&(B*=-1),v.u=Math.atan2(g,B),m.s.Y(a,-d)&&m.s.P(m.F.ba(h-u))>3.141592653589793*(1-$*Math.cos(a))&&(0m.s.P(v.u)||0>a&&1.570796326794897d?h:m.F.ba(3.141592653589793-h):(R=lt/ee,g=Math.sqrt(1-R*R),B=Math.sin(oe/2),0>Math.sin(G-E)-2*p*q*B*B&&(g*=-1),b.u=Math.atan2(R,g),b.u=m.F.ba(b.u+3.141592653589793),m.s.Y(a,-d)&&!m.s.Cd(a)&&!m.s.Y(m.s.P(a),1.570796326794897)&&m.s.P(m.F.ba(h-u))>3.141592653589793*(1-$*Math.cos(a))&&(v!=null?B=v.u:(g=lt/p,B=Math.sqrt(1-g*g),0>p*q-K*ee*Math.cos(oe)&&(B*=-1),B=Math.atan2(g,B),m.s.Y(a,-d)&&m.s.P(m.F.ba(h-u))>3.141592653589793*(1-$*Math.cos(a))&&(0m.s.P(B)||0>a&&1.570796326794897=m.s.P(B)&&1.570796326794897m.s.P(b.u))&&(b.u=-1*m.F.ba(b.u+3.141592653589793))))}}}},D.rf=function(E,p,h,a,u,d,g,v){if(g!=null||v!=null)if(m.s.ti(p))m.Yg.rf(E,h,a,u,d,g,v);else if(d=m.F.ba(d),m.s.Y(m.s.P(a),1.570796326794897)||m.s.Cd(d)||m.s.Y(m.s.P(d),3.141592653589793))m.Wk.rf(E,p,h,a,u,d,g,v);else{var b=m.s.P(d)==1.570796326794897?0:Math.cos(d),S=m.s.P(d)==3.141592653589793?0:Math.sin(d);m.s.Y(m.s.P(a),1.570796326794897)&&(h=0),d=1-Math.sqrt(1-p);var C=m.F.Vq(p,a);a=m.s.P(C)==1.570796326794897?0:Math.cos(C);var O=Math.sin(C);C=Math.atan2(Math.tan(C),b);var R=a*S,$=R*R,N=1-$,B=p/(1-p)*N,G=(p=B*(256+B*(B*(74-47*B)-128))/1024)/4,K=p/6,ee=u/(E*(1-d)*(1+B*(4096+B*(B*(320-175*B)-768))/16384)),q=ee;do{var oe=q;u=m.s.P(q)==1.570796326794897?0:Math.cos(q);var ge=(B=m.s.P(q)==3.141592653589793?0:Math.sin(q))*B;q=p*B*((E=Math.cos(2*C+q))+G*(u*(2*(q=E*E)-1)-K*E*(4*ge-3)*(4*q-3)))+ee}while(!m.s.Y(oe,q));u=m.s.P(q)==1.570796326794897?0:Math.cos(q),B=m.s.P(q)==3.141592653589793?0:Math.sin(q),g!=null&&(S=Math.atan2(B*S,a*u-O*B*b),N=d/16*N*(4+d*(4-3*N)),E=Math.cos(2*C+q),g.u=m.F.ba(h+(S-(1-N)*d*R*(q+N*B*(E+N*u*(2*E*E-1)))))),v!=null&&(N=O*B-a*u*b,N=(1-d)*Math.sqrt($+N*N),v.u=Math.atan2(O*u+a*B*b,N))}},D}()}(ie||(ie={})),function(m){m.PC=function(){function D(){}return D.tb=function(E,p,h,a,u,d,g,v,b){var S=m.F.ba(u-h),C=m.s.Y(m.s.P(a),1.570796326794897),O=m.s.Y(m.s.P(d),1.570796326794897);if(m.s.Y(a,d)&&(m.s.Cd(S)||C))g!=null&&(g.u=0),v!=null&&(v.u=0),b!=null&&(b.u=0);else{if(m.s.ti(p)){var R=Math.sin(a),$=Math.sin(d);R=Math.sqrt((1+R)/(1-R)),$=Math.sqrt((1+$)/(1-$)),R=Math.log($)-Math.log(R),R=Math.atan2(S,R),g!=null&&(g.u=m.s.Y(a,d)?m.s.P(E*Math.cos(a)*S):m.s.P((E*d-E*a)/Math.cos(R)))}else $=m.F.Qw(p,d),R=Math.sin(m.F.Qw(p,a)),$=Math.sin($),R=Math.sqrt((1+R)/(1-R)),$=Math.sqrt((1+$)/(1-$)),R=Math.log($)-Math.log(R),R=Math.atan2(S,R),g!=null&&(m.s.Y(a,d)?g.u=m.s.P(E*S*Math.cos(a)/m.F.w(p,a)):(S=m.F.q(E,p,a),E=m.F.q(E,p,d),g.u=m.s.P((E-S)/Math.cos(R))));v==null&&b==null||(g=m.F.ba(R+3.141592653589793),C&&O||!C&&!O||(C?R=0>a?u:m.F.ba(3.141592653589793-u):O&&(g=0>d?h:m.F.ba(3.141592653589793-h))),v!=null&&(v.u=R),b!=null&&(b.u=g))}},D.rf=function(E,p,h,a,u,d,g,v){d=m.F.ba(d),0>u&&(u=m.s.P(u),d=m.F.ba(d+3.141592653589793)),m.s.ti(p)?m.s.Y(m.s.P(a),1.570796326794897)?(h=0>a?d:m.F.ba(3.141592653589793-d),3.141592653589793>=(d=u/E%6.283185307179586)?E=a-m.s.Mb(d,a):(h=m.F.ba(h+3.141592653589793),E=-a+m.s.Mb(d-3.141592653589793,a))):m.s.Y(m.s.P(d),1.570796326794897)?(h=m.F.ba(h+m.s.Mb(u,d)/(E*Math.cos(a))),E=a):(E=a+u*Math.cos(d)/E,1.570796326794897a?d:m.F.ba(3.141592653589793-d),d=u/m.F.qW(E,p),3.141592653589793>=(d%=6.283185307179586)?E=a-m.s.Mb(d,a):(h=m.F.ba(h+3.141592653589793),E=-a+m.s.Mb(d-3.141592653589793,a)),E=m.F.Rq(p,E)):m.s.Y(m.s.P(d),1.570796326794897)?(h=m.F.ba(h+m.s.Mb(u,d)*m.F.w(p,a)/(E*Math.cos(a))),E=a):(E=1.570796326794897*(u*Math.cos(d)+m.F.q(E,p,a))/m.F.Ah(E,p),1.570796326794897Math.PI||Math.abs(a.y)>.5*Math.PI||Math.abs(u.y)>.5*Math.PI||(Math.abs(a.y)==.5*Math.PI||Math.abs(u.y)==.5*Math.PI)&&a.x!=u.x)return NaN;if(d=p.cB(d,Math.min(a.x,u.x),Math.max(a.x,u.x)),!new m.Nc(a.x,u.x).contains(d))return NaN;var g=D.construct(a);if(u=D.construct(u),g=p.Yu(h,g),u=p.Yu(h,u),(u=g.cF(u)).z.qg())return a.y;var v=new m.Wb;v.set(u.x),v.jm(u.z),v.No(-1);var b=new m.Wb;b.set(u.y),b.jm(u.z),b.No(-1);var S=new m.Wb;return S.set(b),S.Ag(b),(g=new m.Wb).set(v),g.Ag(v),g.add(S),g.sqrt(),g.qg()||v.qg()&&b.qg()?a.y:(a=Math.atan2(b.value(),v.value()),a=Math.atan2(g.value()*Math.cos(a-d),1-h),d=p.DP(h,m.h.construct(d,a)),h=new m.Nd(d.x,d.y,-d.z),d=u.value().Qh(d),h=u.value().Qh(h),Math.abs(h)Math.PI||Math.abs(a.y)>.5*Math.PI||Math.abs(u.y)>.5*Math.PI||(Math.abs(a.y)==.5*Math.PI||Math.abs(u.y)==.5*Math.PI)&&a.x!=u.x||Math.abs(d)>=.5*Math.PI||0d&&u.y>d||0>a.y&&0>u.y&&a.yMath.abs(g[1]-a.x)&&(a=g[0],g[0]=g[1],g[1]=a)),d))},p.cB=function(h,a,u){return h>u?h-=2*(a=Math.ceil((h-u)/(2*Math.PI)))*Math.PI:hu.x?(u.x-=u.x%360,-180>u.x&&(u.x+=360)):180u.y&&(u.y=-90);for(var d=-180,g=180,v=(E=5*h)-1,b=(p=(E+31)/32)-1;0<=b;b--)for(var S=v-32*b,C=Math.min(32,E-32*b),O=1;O=R?(a[b]|=1<=R?(a[b]|=1<>d&31;if(31<(d+=5)){var b=37-d;v&=(1<p)for(g=0;g=p[0]?p:'"'+p.trim()+'"'}var E=[];m.XC=function(){function p(){}return p.EQ=function(h){try{for(var a=0;ah||h>this.Aa)throw m.i.N();return this.bg[h]},p.prototype.Pf=function(h){return this.uh[h]},p.lz=function(h){return p.JM[h]},p.Tp=function(h){return p.SM[h]},p.Va=function(h){return p.rM[h]},p.prototype.hasAttribute=function(h){return 0<=this.uh[h]},p.prototype.iG=function(){return this.hasAttribute(1)},p.se=function(h){return p.eD[h]},p.prototype.LR=function(h){return this.Vs[h]},p.DG=function(h,a){return p.eD[h]===a},p.prototype.Nb=function(h){return this===h},p.prototype.An=function(){for(var h=m.O.Th(this.bg[0]),a=1;a++v&&E(g,S,d.eu),C[0]?b?S=v:(C=g.c,S=g.e+S+1):++S;C.lengthg.Bd&&C[0]?"-":"")+(1S?"e":"e+")+S:g.toString()}function E(g,v,b,S){var C=g.c,O=g.e+v+1;if(b===1?S=5<=C[O]:b===2?S=5O||C[O+1]!==void 0||1&C[O-1]):b===3?S=S||C[O]!==void 0||0>O:(S=!1,b!==0&&p("!Big.RM!")),1>O||!C[0])S?(g.e=-v,g.c=[1]):g.c=[g.e=0];else{if(C.length=O--,S)for(;9<++C[O];)C[O]=0,O--||(++g.e,C.unshift(1));for(O=C.length;!C[--O];C.pop());}return g}function p(g){throw(g=Error(g)).name="BigError",g}var h=-7,a=21,u=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d=function(){function g(v){if(v instanceof g)this.Bd=v.Bd,this.e=v.e,this.c=v.c.slice();else{var b,S,C;for(v===0&&0>1/v?v="-0":u.test(v+="")||p(NaN),this.Bd=v.charAt(0)=="-"?(v=v.slice(1),-1):1,-1<(b=v.indexOf("."))&&(v=v.replace(".","")),0<(S=v.search(/e/i))?(0>b&&(b=S),b+=+v.slice(S+1),v=v.substring(0,S)):0>b&&(b=v.length),S=0;v.charAt(S)=="0";S++);if(S==(C=v.length))this.c=[this.e=0];else{for(;v.charAt(--C)=="0";);for(this.e=b-S-1,this.c=[],b=0;S<=C;this.c[b++]=+v.charAt(S++));}}}return g.prototype.abs=function(){var v=new g(this);return v.Bd=1,v},g.prototype.cmp=function(v){var b=this.c,S=(v=new g(v)).c,C=this.Bd,O=v.Bd,R=this.e,$=v.e;if(!b[0]||!S[0])return b[0]?C:S[0]?-O:0;if(C!=O)return C;if(v=0>C,R!=$)return R>($^v)?1:-1;for(C=-1,O=(R=b.length)<($=S.length)?R:$;++C(S[C]^v)?1:-1;return R==$?0:R>($^v)?1:-1},g.prototype.jm=function(v){var b=this.c,S=(v=new g(v)).c,C=this.Bd==v.Bd?1:-1,O=g.rr;if((O!==~~O||0>O||1e6me?0:me,N.unshift(0);ee++$;$++){if(R!=(ee=K.length))var Me=R>ee?1:-1;else{var Te=-1;for(Me=0;++TeK[Te]?1:-1;break}}if(!(0>Me))break;for(v=ee==R?S:N;ee;){if(K[--ee]me&&E(q,O,g.eu,K[0]!==void 0),q},g.prototype.fS=function(){return 0this.cmp(0)},g.prototype.jt=function(v){var b,S=this.Bd,C=(v=new g(v)).Bd;if(S!=C)return v.Bd=-C,this.tI(v);var O=this.c.slice(),R=this.e,$=v.c,N=v.e;if(!O[0]||!$[0])return $[0]?(v.Bd=-C,v):new g(O[0]?this:0);if(S=R-N){for((b=0>S)?(S=-S,R=O):(N=R,R=$),R.reverse(),C=S;C--;R.push(0));R.reverse()}else for(R=((b=O.length<$.length)?O:$).length,S=C=0;CS;){if(O[--R]<$[R]){for(b=R;b&&!O[--b];O[b]=9);--O[b],O[R]+=10}O[R]-=$[R]}for(;O[--C]==0;O.pop());for(;O[0]==0;)O.shift(),--N;return O[0]||(v.Bd=1,O=[N=0]),v.c=O,v.e=N,v},g.prototype.tI=function(v){var b=this.Bd,S=(v=new g(v)).Bd;if(b!=S)return v.Bd=-S,this.jt(v);S=this.e;var C=this.c,O=v.e,R=v.c;if(!C[0]||!R[0])return R[0]?v:new g(C[0]?this:0*b);if(C=C.slice(),b=S-O){for(0C.length-R.length&&(S=R,R=C,C=S),b=R.length,S=0;b;)S=(C[--b]=C[b]+R[b]+S)/10|0,C[b]%=10;for(S&&(C.unshift(S),++O),b=C.length;C[--b]==0;C.pop());return v.c=C,v.e=O,v},g.prototype.pow=function(v){var b=this,S=new g(1),C=S,O=0>v;for((v!==~~v||-1e6>v||1e6>=1;)b=b.lr(b);return O?S.jm(C):C},g.prototype.round=function(v,b){var S=this;return v==null?v=0:(v!==~~v||0>v||1e6b&&p(NaN),(b=Math.sqrt(this.toString()))==0||b==1/0?((b=v.join("")).length+S&1||(b+="0"),(v=new g(Math.sqrt(b).toString())).e=((S+1)/2|0)-(0>S||1&S)):v=new g(b.toString()),b=v.e+(g.rr+=4);do S=v,v=C.lr(S.tI(this.jm(S)));while(S.c.slice(0,b).join("")!==v.c.slice(0,b).join(""));return E(v,g.rr-=4,g.eu),v},g.prototype.lr=function(v){var b=this.c,S=(v=new g(v)).c,C=b.length,O=S.length,R=this.e,$=v.e;if(v.Bd=this.Bd==v.Bd?1:-1,!b[0]||!S[0])return new g(0*v.Bd);if(v.e=R+$,CR;)O=N[$]+S[R]*b[$-R-1]+O,N[$--]=O%10,O=O/10|0;N[$]=(N[$]+O)%10}for(O&&++v.e,N[0]||N.shift(),R=N.length;!N[--R];N.pop());return v.c=N,v},g.prototype.toString=function(){var v=this.e,b=this.c.join(""),S=b.length;if(v<=h||v>=a)b=b.charAt(0)+(1v?"e":"e+")+v;else if(0>v){for(;++v;b="0"+b);b="0."+b}else if(0S)for(v-=S;v--;b+="0");else vthis.Bd&&this.c[0]?"-"+b:b},g.prototype.toExponential=function(v){return v==null?v=this.c.length-1:(v!==~~v||0>v||1e6=v&&(C=D(this,this.e+v),0>this.Bd&&this.c[0]&&0>C.indexOf("-")&&(C="-"+C));return h=b,a=S,C||p("!toFix!"),C},g.prototype.toPrecision=function(v){return v==null?this.toString():((v!==~~v||1>v||1e6d.get(R)?(d.set(b,2147483647),b=R):d.set(R,2147483647),S++;else{if(!(1&S))d.set(b,2147483647);else if(h)return a!=null&&(a[0]=!0),null;v.L(O),b=R,S=1}if(!(1&S))d.set(b,2147483647);else if(h)return a!=null&&(a[0]=!0),null;if(!h)for(d.Vd(0,d.size,function(N,B){return N-B}),R=0,$=d.size;R<$&&d.get(R)!=2147483647;R++)p.ve(d.get(R),C),u.add(C)}}return h?null:u},E}()}(ie||(ie={})),function(m){var D=function(){function E(){this.yf=new m.ia(0),this.ys=new m.ia(0),this.EH=1,this.Es=NaN}return E.prototype.sort=function(p,h,a,u){if(32>a-h)u.nr(h,a,p);else{var d=!0;try{for(var g=1/0,v=-1/0,b=h;bv&&(v=S)}if(this.reset(a-h,g,v,a-h)){for(b=h;bd&&u.nr(h+d,h+a,p);100p||a==h)&&(p=Math.min(E.hL,p),this.yf.Jb(p),this.yf.resize(p),this.yf.Wj(0,0,this.yf.size),this.EH=h,this.ys.resize(u),this.Es=(a-h)/(p-1),!0)},E.prototype.zF=function(p){return m.O.truncate((p-this.EH)/this.Es)},E.hL=65536,E}();m.Xt=D}(ie||(ie={})),function(m){var D,E;(E=D||(D={}))[E.enum_line=1]="enum_line",E[E.enum_arc=2]="enum_arc",E[E.enum_dummy=4]="enum_dummy",E[E.enum_concave_dip=8]="enum_concave_dip",E[E.enum_connection=3]="enum_connection";var p=function(){function g(){}return g.Qu=function(v,b,S,C,O,R){var $=new g;return $.Im=new m.h,$.Vm=new m.h,$.aw=new m.h,$.Im.L(v),$.Vm.L(b),$.aw.L(S),$.Co=C,$.qh=O,$.sh=R,$},g.construct=function(v,b,S,C){var O=new g;return O.Im=new m.h,O.Vm=new m.h,O.aw=new m.h,O.Im.L(v),O.Vm.L(b),O.aw.Rc(),O.Co=4,O.qh=S,O.sh=C,O},g}(),h=function(){function g(v,b,S,C,O,R){this.Yv=null,this.ya=0,this.EA=v,this.bI=this.$H=0,this.Ka=b,this.Mj=S,this.vk=C,this.Dq=O,this.Ub=R}return g.prototype.next=function(){for(var v=new m.Sa;;){if(this.ya==this.EA.I())return null;if(this.EA.ve(this.ya,v),this.ya++,!v.B())break}var b=!1;if(this.Yv==null&&(this.$H=v.Lg(),this.bI=v.ih(),this.Yv=d.buffer(v,this.Ka,this.Mj,this.vk,this.Dq,this.Ub),b=!0),this.yaC)throw m.i.N();if(v.B())return new m.Da(v.description);var $=new m.l;return v.xc($),0=O&&(O=96),R.rb=Math.abs(R.Ka),R.Kv=R.rb!=0?1/R.rb:0,isNaN(C)||C==0?C=1e-5*R.rb:C>.5*R.rb&&(C=.5*R.rb),12>O&&(O=12),(v=Math.abs(b)*(1-Math.cos(Math.PI/O)))>C?C=v:(v=Math.PI/Math.acos(1-C/Math.abs(b)))(O=m.O.truncate(v))&&(O=12,C=Math.abs(b)*(1-Math.cos(Math.PI/O))),R.vk=C,R.Dq=O,R.tA=Math.min(R.ct,.25*C),R.lE()},g.prototype.cv=function(){if(this.Id==null)this.Id=[];else if(this.Id.length!==0)return;var v=this.qE();v=m.O.truncate((v+3)/4);var b=.5*Math.PI/v;this.oA=b;for(var S=0;S<4*v;S++)this.Id.push(null);var C=Math.cos(b);b=Math.sin(b);var O=m.h.construct(0,1);for(S=0;S=this.Ka&&(v=new m.l,this.X.A(v),v.R()<=2*-this.Ka||v.ca()<=2*this.Ka))return new m.Da(this.X.description)}switch(this.X.getType()){case 33:return this.PN();case 550:return this.ON();case 1607:return this.RN();case 1736:return this.QN();case 197:return this.LN();default:throw m.i.Qa()}},g.prototype.RN=function(){if(this.EG(this.X)){var v=new m.Sa;this.X.ve(0,v);var b=new m.l;return this.X.A(b),v.Cb(b.sf()),this.Gu(v)}return this.X=this.WV(this.X),v=new a(this,this.oq),m.Gh.local().V(v,this.Mj,this.Ub).next()},g.prototype.QN=function(){if(this.Ka==0)return this.X;var v=m.Yl.local();if(this.cv(),this.X=v.V(this.X,null,!1,this.Ub),0>this.Ka){var b=this.X;return b=this.py(b,0,b.da()),v.V(b,this.Mj,!1,this.Ub)}return this.EG(this.X)?(v=new m.Sa,this.X.ve(0,v),b=new m.l,this.X.A(b),v.Cb(b.sf()),this.Gu(v)):(v=new u(this),m.Gh.local().V(v,this.Mj,this.Ub).next())},g.prototype.py=function(v,b,S){for(var C=new m.Da(v.description);bv.Ja(b))){var O=v.Ir(b),R=new m.l;if(v.Rj(b,R),0=this.Ka){if(this.Ka==0)v.ad(this.X,!1);else{var b=new m.Fh;this.X.bn(b),b.W(this.Ka,this.Ka),v.ad(b,!1)}return v}return v.ad(this.X,!1),this.X=v,this.jE(v,0)},g.prototype.jE=function(v,b){this.cv();var S=new m.Da(v.description),C=new m.h,O=new m.h,R=new m.h,$=new m.h,N=new m.h,B=new m.h,G=new m.h,K=new m.h,ee=v.Ja(b),q=v.Ba(b),oe=0;for(b=v.Ja(b);oev.Ja(b))return null;if(this.FG(v,b)&&0(v=-1>v?4:2*Math.PI/Math.acos(v)+.5)?v=4:v>this.Dq&&(v=this.Dq),m.O.truncate(v)},g.prototype.GD=function(v,b,S,C,O){this.cv();var R=new m.h;R.uc(S,b),R.scale(this.Kv);var $=new m.h;$.uc(C,b),$.scale(this.Kv),0>(R=Math.atan2(R.y,R.x)/this.oA)&&(R=this.Id.length+R),R=this.Id.length-R,0>($=Math.atan2($.y,$.x)/this.oA)&&($=this.Id.length+$),($=this.Id.length-$)R.I($))return 0>O||(O=v,R=new m.Sa,O.ve(O.Ba(b),R),this.yu(S,R)),1;var N=R.Na(R.Xa(R.Ob($))),B=new m.Dd;if(B.gg(-N.x,-N.y),R.Oc(B),C&&(this.tQ(R,$,O),2>R.I($)))return 0>O||(O=v,R=new m.Sa,O.ve(O.Ba(b),R),this.yu(S,R)),1;this.Zd.length=0;var G=R.Ob($);b=R.Xa(G);var K=O==1?R.Ma(b):R.U(b);v=O==1?R.U(b):R.Ma(b);var ee=!0;C=new m.h,$=new m.h;var q=new m.h,oe=new m.h,ge=new m.h,me=new m.h,Me=new m.h,Te=new m.h,Fe=new m.h,Xe=new m.h,We=this.rb;G=R.Ja(G);for(var Mt=0;MtK||0>ee&&K==0?this.Zd.push(p.Qu(oe,ge,C,2,this.Zd.length+1,this.Zd.length-1)):oe.qb(ge)||(this.Zd.push(p.construct(oe,C,this.Zd.length+1,this.Zd.length-1,"dummy")),this.Zd.push(p.construct(C,ge,this.Zd.length+1,this.Zd.length-1,"dummy"))),me.add($,Fe),this.Zd.push(p.Qu(ge,me,C,1,this.Zd.length+1,this.Zd.length-1)),oe.L(me),Xe.L(Fe),q.L(C),C.L($),Te.L(Me),K=b,b=v,ee=!1,v=O==1?R.U(b):R.Ma(b);return this.Zd[this.Zd.length-1].qh=0,this.Zd[0].sh=this.Zd.length-1,this.YV(S),B.gg(N.x,N.y),S.YD(B,S.da()-1),1},g.prototype.YV=function(v){for(var b=this.zO(),S=!0,C=b+1,O=b;C!=b;O=C){var R=this.Zd[O];C=R.qh!=-1?R.qh:(O+1)%this.Zd.length,R.Co!=0&&(S&&v.Lt(R.Im),R.Co==2?this.GD(v,R.aw,R.Im,R.Vm,!0):v.Ci(R.Vm),S=!1)}},g.prototype.zO=function(){this.Ks==null&&(this.Ks=[null,null,null,null,null,null,null,null,null]);for(var v=0,b=0,S=this.Zd.length;b=this.rb)return!0}return!1},g.prototype.tQ=function(v,b,S){for(var C=0;1>C;C++){var O=!1,R=v.Ob(b),$=v.Ja(R);if($==0)break;var N=$;if(3>$)break;!v.dc(R)&&(N=$-1),R=v.Xa(R),$=0di||0>Ct&&di==0||!this.Fv(oe,ee,q)||(Me.L(q),rn=!1,++lt,O=!0),rn){if(0.5*this.vk?(me.add(oe,ee),me.scale(.5),Xe.normalize(),Xe.ar(),We.L(Xe),We.scale(Mt-lt),me.add(We),v.mf($,me)):v.pd($,!0),lt=0}oe.L(ee),G=R}ee.L(q),$=R,R=B,B=0b?(this.oq=!1,v):(this.oq=!0,m.Fg.Mk(v,this.ct,!1,!0,this.Ub))},g.prototype.yu=function(v,b){if(b=b.D(),this.Id!=null&&this.Id.length!==0){var S=new m.h;S.L(this.Id[0]),S.Ct(this.rb,b),v.Lt(S);for(var C=1,O=this.Id.length;C=a?1:-1;case 1:if(p.G=a?1:-1;case 2:if(p.v>=a&&p.C>a)break;return p.C<=a?1:-1;case 3:if(!(p.G>=a&&p.H>a))return p.H<=a?1:-1}return 0},E.prototype.Ay=function(p,h){return p.getType()==1736?this.Cy(p,h):this.Dy(p)},E.prototype.Cy=function(p,h){if(this.Ca.R()==0||this.Ca.ca()==0)return p.Ia();var a=new m.l;p.xc(a),this.X=this.g.Ib(p);var u=new m.l,d=new m.l,g=new m.h,v=new m.h,b=[0,0,0,0,0,0,0,0,0],S=[0,0,0,0,0,0,0,0,0];new m.ig;var C=new m.yb,O=new m.ia(0);O.Jb(Math.min(100,p.I()));for(var R=!1,$=0;!R&&4>$;$++){var N=!1,B=(1&$)!=0,G=0;switch($){case 0:G=this.Ca.v,N=a.v<=G&&a.C>=G;break;case 1:G=this.Ca.G,N=a.G<=G&&a.H>=G;break;case 2:G=this.Ca.C,N=a.v<=G&&a.C>=G;break;case 3:G=this.Ca.H,N=a.G<=G&&a.H>=G}if(N)for(R=!0,N=this.g.Ob(this.X);N!=-1;){var K=-1,ee=-1,q=this.g.Xa(N),oe=q;do{var ge=this.g.bc(oe);ge==null&&(ge=C,this.g.D(oe,g),ge.Dc(g),this.g.D(this.g.U(oe),v),ge.Qc(v)),ge.A(u);var me=this.Lh(u,$,G),Me=0,Te=-1;if(me==-1){Me=0<(ge=ge.cq(B,G,b,S))?this.g.Ul(oe,S,ge):0,Me+=1;var Fe=oe,Xe=this.g.U(Fe);for(ge=0;gethis.g.Ja(N)?this.g.Zq(N):this.g.Rb(N)}}return R?p.Ia():(this.FB(),0S;S++){var C=!1,O=(1&S)!=0,R=0;switch(S){case 0:R=this.Ca.v,C=b.v<=R&&b.C>=R;break;case 1:R=this.Ca.G,C=b.G<=R&&b.H>=R;break;case 2:R=this.Ca.C,C=b.v<=R&&b.C>=R;break;case 3:R=this.Ca.H,C=b.G<=R&&b.H>=R}if(C){C=v,v=p.Ia(),(C=C.Ga()).Zi();for(var $,N=new m.h;C.$a();)for(var B,G=!0;C.Ha();){var K=C.ha();K.A(h);var ee=this.Lh(h,S,R);if(ee==-1){if(0<(ee=K.cq(O,R,u,d))){var q=0;$=K.ac();for(var oe=0;oe<=ee;oe++)if(q!=(B=oe=(S=m.O.truncate(Math.min(Math.ceil(S/p),2048)))))){for(var C=1;Cd.size)){var O=this;d.Vd(0,d.size,function(me,Me){return O.Mh(me,Me)}),a=new m.h,g=new m.h,v=new m.h,g.Rc();var R=-1;b=new m.ia(0),S=new m.ia(0),C=this.g.Gd();for(var $=this.g.Gd(),N=0,B=d.size;Nthis.Mh(R,ee)&&(this.g.D(ee,a),p?a.y==h:a.x==h)&&(b.add(R),q=!0,this.g.Ra(R,$,1)),0>this.Mh(R,G)&&(this.g.D(G,a),p?a.y==h:a.x==h)&&(q||b.add(R),this.g.Ra(R,C,1))}for(K=0,q=b.size;Kthis.Mh(B,K)&&(this.g.D(K,b),p?b.y==h:b.x==h)&&(G=K),K=-1;var ee=this.g.Ma(B);if(0>this.Mh(B,ee)&&(this.g.D(ee,b),p?b.y==h:b.x==h)&&(K=ee),G!=-1&&K!=-1)this.Kh(B,u,d),this.g.pd(B,!1),this.Kh(G,u,d),this.g.pd(G,!1),O=!0;else if(G!=-1||K!=-1){for(ee=N+1;eethis.Mh(q,oe)&&(this.g.D(oe,b),p?b.y==h:b.x==h)&&(ge=oe),oe=this.g.Ma(q);var me=-1;if(0>this.Mh(q,oe)&&(this.g.D(oe,b),p?b.y==h:b.x==h)&&(me=oe),ge!=-1&&me!=-1){this.Kh(q,u,d),this.g.pd(q,!1),this.Kh(ge,u,d),this.g.pd(ge,!1),O=!0;break}if(G!=-1&&me!=-1){this.zt(u,B,G,q,me,d),O=!0;break}if(K!=-1&&ge!=-1){this.zt(u,q,ge,B,K,d),O=!0;break}}}if(O)break}}}if(!O)break}R=g,S.L(a)}}this.g.Td(d)},E.prototype.Kh=function(p,h,a){a=this.g.Pa(p,a),h.set(a,-1),a=this.g.Pa(p,this.ji),this.dd.set(a,-1),(h=this.g.bd(p))!=-1&&this.g.Xa(h)==p&&(this.g.Jf(h,-1),this.g.Wg(h,-1))},E.prototype.zt=function(p,h,a,u,d,g){this.g.Bc(h,u),this.g.Cc(u,h),this.g.Cc(a,d),this.g.Bc(d,a),this.Kh(u,p,g),this.g.mi(u,!1),this.Kh(d,p,g),this.g.mi(d,!0)},E.prototype.Ty=function(){for(var p=0,h=this.dd.size;p=b?(a=this.g.Pa(v,this.ji),this.dd.set(a,-1),v=this.g.pd(v,!1),b==2&&(a=this.g.Pa(v,this.ji),this.dd.set(a,-1),this.g.pd(v,!1)),b=g,g=this.g.Rb(g),this.g.Jf(b,-1),this.g.$q(b)):(this.g.cp(g,!1),this.g.Wg(g,this.g.Ma(v)),this.g.Vj(g,b),d+=b,u++,g=this.g.Rb(g))}}for(p=0,h=this.dd.size;p=b?(a=this.g.Pa(v,this.ji),this.dd.set(a,-1),v=this.g.pd(v,!1),b==2&&(0<=(a=this.g.Pa(v,this.ji))&&this.dd.set(a,-1),this.g.pd(v,!1)),b=g,this.g.Jf(b,-1),this.g.$q(b)):(this.g.kn(g,!0),this.g.Vj(g,b),this.g.Jf(g,v),this.g.Wg(g,this.g.Ma(v)),this.g.cp(g,!1),d+=b,u++)}for(this.g.Rl(this.X,u),this.g.Tj(this.X,d),p=0,h=this.g.ld;h!=-1;h=this.g.ue(h))p+=this.g.I(h);this.g.bC(p)},E.By=function(p,h,a){return new E(h).Ay(p,a)},E.clip=function(p,h,a,u){if(p.B())return p;if(h.B())return p.Ia();if((a=p.getType())==33)return u=p.D(),h.contains(u)?p:p.Ia();if(a==197)return u=new m.l,p.A(u),u.Ea(h)?(h=new m.Fh,p.copyTo(h),h.Xo(u),h):p.Ia();var d=new m.l;if(p.xc(d),h.contains(d))return p;if(!h.isIntersecting(d))return p.Ia();if((d=p.Bb)!=null&&(d=d.Fk)!=null){if((d=d.Ro(h))==1){if(a!=1736)throw m.i.Qa();return(p=new m.Da(p.description)).tp(h),p}if(d==0)return p.Ia()}switch(a){case 550:a=null,d=p.I();for(var g=p.ub(0),v=0,b=0;b=a?1:-1;case 1:if(p.G=a?1:-1;case 2:if(p.v>=a&&p.C>a)break;return p.C<=a?1:-1;case 3:if(!(p.G>=a&&p.H>a))return p.H<=a?1:-1}return 0},E.prototype.Ay=function(p,h){return p.getType()==1736?this.Cy(p,h):this.Dy(p)},E.prototype.Cy=function(p,h){if(this.Ca.R()==0||this.Ca.ca()==0)return p.Ia();var a=new m.l;p.xc(a),this.X=this.g.Ib(p);var u=new m.l,d=new m.l,g=new m.h,v=new m.h,b=[0,0,0,0,0,0,0,0,0],S=[0,0,0,0,0,0,0,0,0],C=new m.yb,O=new m.ia(0);O.Jb(256);for(var R=!1,$=0;!R&&4>$;$++){var N=!1,B=(1&$)!=0,G=0;switch($){case 0:G=this.Ca.v,N=a.v<=G&&a.C>=G;break;case 1:G=this.Ca.G,N=a.G<=G&&a.H>=G;break;case 2:G=this.Ca.C,N=a.v<=G&&a.C>=G;break;case 3:G=this.Ca.H,N=a.G<=G&&a.H>=G}if(N)for(R=!0,N=this.g.Ob(this.X);N!=-1;){var K=!0,ee=-1,q=-1,oe=this.g.Xa(N),ge=oe;do{var me=this.g.bc(ge);me==null&&(me=C,this.g.D(ge,g),me.Dc(g),this.g.D(this.g.U(ge),v),me.Qc(v)),me.A(u);var Me=this.Lh(u,$,G),Te=0,Fe=-1;if(Me==-1){Te=0<(me=me.cq(B,G,b,S))?this.g.LX(ge,S,me):0,Te+=1;var Xe=ge,We=this.g.U(Xe);for(me=0;me$;$++){var N=!1,B=(1&$)!=0,G=0;switch($){case 0:G=this.Ca.v,N=b.v<=G&&b.C>=G;break;case 1:G=this.Ca.G,N=b.G<=G&&b.H>=G;break;case 2:G=this.Ca.C,N=b.v<=G&&b.C>=G;break;case 3:G=this.Ca.H,N=b.G<=G&&b.H>=G}if(N)for(N=v,v=p.Ia(),(N=N.Ga()).Zi();N.$a();)for(var K,ee=!0;N.Ha();){var q=N.ha();q.A(h);var oe=this.Lh(h,$,G);if(oe==-1){if(0<(oe=q.cq(B,G,u,d))){var ge=0;q.Yp(S);for(var me=0;me<=oe;me++)if(ge!=(K=meu.x&&(u.x+=p)}else R=h.y-this.Ca.G,d.y=m.lc.sign(a.y-h.y),u.y=p*m.lc.Cn(Math.floor(Math.abs(R/p)),R)+this.Ca.G,0>u.y&&(u.y+=p);R=O!=0?a.y-h.y:a.x-h.x;var $=Math.abs(R);if(65536<$/p)throw m.i.fa("internal error");if(0<$){$=m.O.truncate($/p)+2,g.length<$&&(g=m.O.lg($));for(var N=$=0;;N++){var B=new m.h;if(B.x=u.x+d.x*N*p,B.y=u.y+d.y*N*p,1<=(B=(O!=0?B.y-h.y:B.x-h.x)/R))break;0>=B||(g[$]=B,$++)}$!=0&&this.g.Ul(S,g,$)}}S=C}while(S!=b)}},E.prototype.Vl=function(p,h){for(var a=-1,u=new m.h,d=null,g=this.g.Ob(this.X);g!=-1;g=this.g.Rb(g))for(var v=this.g.Xa(g),b=0,S=this.g.Ja(g);bd.size)){var O=this;d.Vd(0,d.size,function(me,Me){return O.Mh(me,Me)}),a=new m.h,g=new m.h,v=new m.h,g.Rc();var R=-1;b=new m.ia(0),S=new m.ia(0),C=null;for(var $=this.g.Gd(),N=this.g.Gd(),B=0,G=d.size;Bg.compare(a)&&(p?a.y==h:a.x==h)&&(b.add(R),oe=!0,this.g.Ra(R,N,1)),this.g.D(K,a),0>g.compare(a)&&(p?a.y==h:a.x==h)&&(oe||b.add(R),this.g.Ra(R,$,1))}for(ee=0,oe=b.size;eeS.compare(b)&&(p?b.y==h:b.x==h)&&(G=K),K=-1;var ee=this.g.Ma(B);if(this.g.D(ee,b),0>S.compare(b)&&(p?b.y==h:b.x==h)&&(K=ee),G!=-1&&K!=-1)this.Kh(B,u,d),this.g.pd(B,!1),this.Kh(G,u,d),this.g.pd(G,!1),O=!0;else if(G!=-1||K!=-1){for(ee=N+1;eeS.compare(b)&&(p?b.y==h:b.x==h)&&(ge=oe),oe=this.g.Ma(q);var me=-1;if(this.g.D(oe,b),0>S.compare(b)&&(p?b.y==h:b.x==h)&&(me=oe),ge!=-1&&me!=-1){this.Kh(q,u,d),this.g.pd(q,!1),this.Kh(ge,u,d),this.g.pd(ge,!1),O=!0;break}if(G!=-1&&me!=-1){this.zt(u,B,G,q,me,d),O=!0;break}if(K!=-1&&ge!=-1){this.zt(u,q,ge,B,K,d),O=!0;break}}}if(O)break}}}if(!O)break}R=g,S.L(a)}this.g.Td(d)}},E.prototype.Kh=function(p,h,a){a=this.g.Pa(p,a),h.set(a,-1),a=this.g.Pa(p,this.ji),this.dd.set(a,-1),(h=this.g.bd(p))!=-1&&this.g.Xa(h)==p&&(this.g.Jf(h,-1),this.g.Wg(h,-1))},E.prototype.zt=function(p,h,a,u,d,g){this.g.Bc(h,u),this.g.Cc(u,h),this.g.Cc(a,d),this.g.Bc(d,a),this.Kh(u,p,g),this.g.mi(u,!1),this.Kh(d,p,g),this.g.mi(d,!0)},E.prototype.Ty=function(){for(var p=0,h=this.dd.size;p=b?(a=this.g.Pa(v,this.ji),this.dd.set(a,-1),v=this.g.pd(v,!1),b==2&&(0<=(a=this.g.Pa(v,this.ji))&&this.dd.set(a,-1),this.g.pd(v,!1)),b=g,this.g.Jf(b,-1),this.g.$q(b)):(this.g.kn(g,!0),this.g.Vj(g,b),this.g.Jf(g,v),this.g.Wg(g,this.g.Ma(v)),this.g.cp(g,!1),d+=b,u++)}for(this.g.Rl(this.X,u),this.g.Tj(this.X,d),p=0,h=this.g.ld;h!=-1;h=this.g.ue(h))p+=this.g.I(h);this.g.bC(p)},E.By=function(p,h,a,u){return new E(h,u).Ay(p,a)},E.clip=function(p,h,a,u,d){return E.Nu(p,h,null,a,u,d)},E.Nu=function(p,h,a,u,d,g){var v=p.getType();if(v==33)return d=p.D(),h.contains(d)?p:p.Ia();if(v==197)return d=new m.l,p.A(d),d.Ea(h)?(h=new m.Fh,p.copyTo(h),h.Xo(d),h):p.Ia();if(p.B())return p;if(h.B())return p.Ia();var b=new m.l;if(p.xc(b),h.contains(b))return p;if(!h.isIntersecting(b))return p.Ia();if((a!=null||isNaN(u))&&m.ta.ty(a,h,!1),!m.aa.xj(v))throw m.i.N();if((a=p.Bb)!=null&&(a=a.Fk)!=null){if((a=a.Ro(h))==1){if(v!=1736)throw m.i.fa("internal error");return(p=new m.Da(p.description)).tp(h),p}if(a==0)return p.Ia()}switch(v){case 550:for(g=null,v=p.I(),a=p.ub(0),u=0,d=new m.h,b=0;b=b;b+=1)for(var S=0;1>=S;S+=1){var C=h.jG(g+b,v+S),O=this.xl.rR(C);O!=-1&&(this.pq[d]=O,this.xs[d]=C,d++)}for(g=d-1;1<=g;g--)for(O=this.pq[g],v=g-1;0<=v;v--)if(O==this.pq[v]){this.xs[v]=-1,g!=--d&&(this.xs[g]=this.xs[d],this.pq[g]=this.pq[d]);break}for(v=0;vv.Db())throw m.i.N();return b==0||v.B()?v:((R=new g(R)).ko=v,R.Ka=b,R.qa=O,R.Ki=S,R.CA=C,R.Rx())},g.prototype.eM=function(){var v=this.ko,b=v.ac(),S=v.wc(),C=new m.h;return C.uc(S,b),C.normalize(),C.Hv(),C.scale(this.Ka),b.add(C),S.add(C),C=v.Ia(),v.Dc(b),v.Qc(S),C},g.prototype.dM=function(){var v=this.ko;if(0R&&(0this.Ka?-E:E,-1B&&(.017453292519943295>(G=2*Math.acos(B))&&(G=.017453292519943295),1<($=m.O.truncate(E/G+1.5))&&(N/=$)),G=q+h,q=a.Pd(R,this.Ka,G),v==0&&(q.type|=1024),this.fc(q,v),B=this.Ka/Math.cos(N/2),G+=N/2,(q=a.Pd(R,B,G)).type|=1024,this.fc(q);0<--$;)G+=N,(q=a.Pd(R,B,G)).type|=1024,this.fc(q);(q=a.Pd(R,this.Ka,oe-h)).type|=1024,this.fc(q)}else if(this.Ki==1)q=a.Pd(R,this.Ka,q+h),this.fc(q,v),q=a.Pd(R,this.Ka,oe-h),this.fc(q);else if(this.Ki==0)for(B=1-S/Math.abs(this.Ka),$=1,N=oe-h-(q+h),-1B&&(.017453292519943295>(G=2*Math.acos(B))&&(G=.017453292519943295),1<($=m.O.truncate(Math.abs(N)/G+1.5))&&(N/=$)),B=this.Ka/Math.cos(.5*N),G=q+h+.5*N,q=a.Pd(R,B,G),this.fc(q,v);0<--$;)G+=N,q=a.Pd(R,B,G),this.fc(q);else this.Ki==2?(B=$.x-R.x,G=$.y-R.y,.99999999<($=(B*(K=N.x-R.x)+G*(ee=N.y-R.y))/Math.sqrt(B*B+G*G)/Math.sqrt(K*K+ee*ee))?(q=a.Pd(R,1.4142135623730951*this.Ka,oe-.25*E),this.fc(q,v),q=a.Pd(R,1.4142135623730951*this.Ka,oe+.25*E),this.fc(q)):($=Math.abs(this.Ka/Math.sin(.5*Math.acos($))))>(N=Math.abs(this.CA*this.Ka))?(B=.5*(oe-q),B=this.Ka/Math.abs(Math.sin(B)),q=a.Pd(R,B,.5*(q+oe)),oe=m.h.construct(q.x,q.y),q=m.h.construct(R.x,R.y),(R=new m.h).uc(oe,q),(oe=new m.h).HW(N/R.length(),R,q),q=($-N)*Math.abs(this.Ka)/Math.sqrt($*$-this.Ka*this.Ka),0q&&(oe-=p),$=q-oe(B=1.4142135623730951*this.Ka)?q+.25*E:q+.75*E,q=a.Pd(R,B,G),this.fc(q,v),G=0>B?oe-.25*E:oe-.75*E,q=a.Pd(R,B,G),this.fc(q)):(B=.5*(oe-q),B=this.Ka/Math.abs(Math.sin(B)),oeb))for(var S=0;S=C+1;b--)(S=a.al(v.Na(b))).type|=1024,this.wg.push(S);if(this.mE())if(2<=this.Yb.length){for(v=-1,(O=(1024&this.Yb[this.gf-1].type)!=0)||(v=0),b=1;b=Math.min(S.x,C.x)&&Math.max(S.x,C.x)>=Math.min(v.x,b.x)&&Math.max(v.y,b.y)>=Math.min(S.y,C.y)&&Math.max(S.y,C.y)>=Math.min(v.y,b.y)},g.prototype.xQ=function(v,b,S,C,O){O.bE=!1;var R=(b.y-v.y)*(C.x-S.x)-(b.x-v.x)*(C.y-S.y),$=(S.y-v.y)*(b.x-v.x)-(S.x-v.x)*(b.y-v.y);if(0<=(R=R==0?2:$/R)&&1>=R){var N=R;if(R=(C.y-S.y)*(b.x-v.x)-(C.x-S.x)*(b.y-v.y),$=(v.y-S.y)*(C.x-S.x)-(v.x-S.x)*(C.y-S.y),0<=(R=R==0?2:$/R)&&1>=R)return O.an=a.TO(v.x+R*(b.x-v.x),v.y+R*(b.y-v.y)),O.an.Uh=S.Uh+N*(C.Uh-S.Uh),N!=0&&N!=1||R!=0&&R!=1||(O.bE=!0),O.VY=R,O.WY=N,!((N==0||N==1)&&0R||(R==0||R==1)&&0N)}return!1},g.prototype.QO=function(v){for(;this.Yb[v].shv-(g*=2))return!0;d=new m.h;var b=new m.h,S=new m.h;u.tc(g,d),u.tc(g+2,b),u.tc(g+4,S);var C=a.Wu(b,S,d);if(C.ps()||!a.um(C.value()))return!1;var O=m.h.construct(b.x,b.y),R=new m.h;for(g+=6;gv;v++){u.mB(v,g);var b=this.Cr(g);if(b!=-1){u.Hf(v,d);var S=this.g.fc(this.Ss,d);this.Fa.Sj(b,S)}}},a.prototype.oN=function(u){var d=new m.Sa,g=u.ac();if((g=this.Cr(g))!=-1){u.To(d);var v=this.g.fc(this.Ss,d);this.Fa.Sj(g,v)}g=u.wc(),(g=this.Cr(g))!=-1&&(u.Po(d),u=this.g.fc(this.Ss,d),this.Fa.Sj(g,u))},a.prototype.nN=function(u){var d=u.D();(d=this.Cr(d))!=-1&&(u=this.g.fc(this.Ss,u),this.Fa.Sj(d,u))},a.prototype.Cr=function(u){var d=-1;if(this.Fa.size(-1)==0)return this.Fa.addElement(-4,-1);if(this.Fa.size(-1)==1){var g=this.g.Na(this.Fa.ja(this.Fa.rc(-1)));return u.Rz(g)||(d=this.Fa.xn(-5)),d}return this.pC(u)},a.prototype.pC=function(u){var d=-1;do{var g=this.Fa.rc(-1),v=this.Fa.Fc(-1),b=this.Fa.ja(g),S=this.Fa.ja(v),C=new m.h,O=new m.h;if(this.Xh.D(b,C),this.Xh.D(S,O),b=m.h.Uq(O,u,C),a.um(b))d=this.Fa.xn(-1),(C=this.nC(u,v,g))!=g&&this.oC(u,g,this.Fa.we(C));else if(a.CG(b)){O=this.Fa.sv(-1);var R=this.Fa.rc(-1),$=this.Fa.Fc(-1);for(b=new m.h,S=new m.h;R!=this.Fa.we($);){var N=this.Fa.ja(O);this.Xh.D(N,b),N=m.h.Uq(b,u,C),a.CG(N)?($=O,O=this.Fa.ll(O)):(R=O,O=this.Fa.Xp(O))}if(O=$,C=R,N=this.Fa.ja(O),R=this.Fa.ja(C),this.Xh.D(N,b),this.Xh.D(R,S),C!=g&&(b=m.h.Uq(S,u,b),!a.um(b)))continue;d=this.Fa.zu(C,O,-2,!1),this.oC(u,O,v),this.nC(u,C,g)}else this.sb==null&&(this.sb=new m.yb),this.sb.Dc(O),this.sb.Qc(C),0>(C=this.sb.fe(u,!0))?(C=this.Fa.we(v),this.Fa.vd(v,-1),d=this.Fa.xn(-3),this.nC(u,C,g)):1u},a.CG=function(u){return 0d)throw m.i.fa("Internal Error: max number of iterations exceeded");var b=this.nM(h);if(u=u||b,this.tH&&(b=this.g.Gp(h,!0,!1)!=0,u=u||b),b=!1,(g==0||v||m.$t.kI(!0,this.g,p,null,this.nd))&&(b=this.sM(a),u=u||b),!b)break;m.mp.zp(this.nd)}return u},E}();m.Tk=D}(ie||(ie={})),function(m){var D=function(){function p(h){this.$d=this.Mc=null,this.Ys=0,this.Ub=h,this.cA=!0}return p.prototype.uv=function(h,a){var u=this.g.bc(h);if(u==null){if(!this.g.ed(h,a))return null;u=a}return u},p.prototype.Xq=function(){var h;h===void 0&&(h=!1),this.Ys++,(h||!(4095&this.Ys))&&(this.Ys=0,m.mp.zp(this.Ub))},p.prototype.nP=function(){var h=this.g.Yq(!1),a=!1,u=new m.yb,d=new m.yb,g=new m.l;g.Oa();var v=new m.l;v.Oa();for(var b=new m.Sa,S=new m.TC,C=h.next();C!=-1;C=h.next()){m.mp.zp(this.Ub);var O=null,R=!1;if(!m.aa.Rn(this.g.ic(h.ck))){if((O=this.uv(C,u))==null)continue;if(O.A(g),g.W(this.qa,this.qa),O.Bi(this.qa)){if(!O.Bi(0))continue;R=!0,O=null}}var $=this.g.Yq(h),N=$.next();for(N!=-1&&(N=$.next());N!=-1;N=$.next()){var B=null,G=!1;if(!m.aa.Rn(this.g.ic($.ck))){if((B=this.uv(N,d))==null)continue;if(B.A(v),B.Bi(this.qa)){if(!B.Bi(0))continue;G=!0,B=null}}var K=0,ee=0;if(O!=null&&B!=null)g.HG(v)&&(S.Oo(O),S.Oo(B),S.Ea(this.qa,!1),0<(K=S.ol(0))+(ee=S.ol(1))&&(this.g.jr(C,S,0,!0),this.g.jr(N,S,1,!0)),S.clear());else if(O!=null){var q=new m.h;if(this.g.D(N,q),g.contains(q)){if(S.Oo(O),this.g.Vi(N,b),S.Kz(this.qa,b,!1),0<(K=S.ol(0)))if(this.g.jr(C,S,0,!0),G){for(G=-1,q=this.g.U(N);q!=-1&&q!=N&&(G=q,(B=this.uv(q,d))!=null&&B.Bi(0));q=this.g.U(q));for(q=N;q!=-1&&(this.g.Dh(q,S.Bf),q!=G);q=this.g.U(q));}else this.g.Dh(N,S.Bf);S.clear()}}else{if(B==null)continue;if(q=new m.h,this.g.D(C,q),v.W(this.qa,this.qa),v.contains(q)){if(S.Oo(B),this.g.Vi(C,b),S.Kz(this.qa,b,!1),0<(ee=S.ol(0)))if(this.g.jr(N,S,0,!0),R){for(G=-1,q=this.g.U(C);q!=-1&&q!=C&&(G=q,(B=this.uv(q,d))!=null&&B.Bi(0));q=this.g.U(q));for(q=C;q!=-1&&(this.g.Dh(q,S.Bf),q!=G);q=this.g.U(q));}else this.g.Dh(C,S.Bf);S.clear()}}if(K+ee!=0){if(K!=0){if((O=this.g.bc(C))==null){if(!this.g.ed(C,u))continue;O=u,u.A(g)}else O.A(g);if(O.Bi(this.qa))break}a=!0}}}return a},p.prototype.oP=function(){return this.QU()},p.prototype.QU=function(){return new m.RC().PX(this.g,this.qa)},p.prototype.lI=function(){var h=!1;this.Mc==null&&(this.Mc=new m.Yj);var a=new m.ia(0);a.Jb(this.g.fd+1);for(var u=this.g.Yq(),d=u.next();d!=-1;d=u.next())a.add(d);this.g.nx(a,a.size),a.add(-1),u=this.g.Gd(),d=this.g.Gd(),this.$d=new m.UC(this.g,this.qa,!this.cA),this.Mc.Vo(this.$d);var g=new m.ia(0),v=new m.ia(0),b=0;new m.h;var S=this.g.td;this.g.vb.mc();for(var C,O,R=this.g.vb.za[0].o,$=a.get(b++);$!=-1;){var N=C=R[2*(O=S.T($,0))],B=O=R[2*O+1];do{var G=S.T($,2),K=S.T($,1);if(G!=-1){var ee=S.T(G,0),q=R[2*ee];0>(B<(ee=R[2*ee+1])?-1:B>ee?1:Nq?1:0)&&(v.add($),v.add(G))}K!=-1&&(q=R[2*(ee=S.T(K,0))],0>(B<(ee=R[2*ee+1])?-1:B>ee?1:Nq?1:0)&&(v.add(K),v.add(K))),(q=this.g.Pa($,u))!=-1&&(g.add(q),this.g.Ra($,u,-1)),(q=this.g.Pa($,d))!=-1&&(g.add(q),this.g.Ra($,d,-1)),($=a.get(b++))!==-1&&(N=R[2*(B=S.T($,0))],B=R[2*B+1])}while($!=-1&&N===C&&B===O);for(N=g.size==1&&v.size==2,q=B=-1,G=0,K=g.size;Gh.fd?h=a.nP():a.oP())},p.V=function(h,a,u){return p.fQ(h,h.IF(),a,u)},p.kI=function(h,a,u,d,g){if(!p.yE(a))return!1;var v=new p(g);if(v.g=a,v.qa=u,v.cA=h,v.lI())return d!=null&&d.Wt(v.Ni),!0;var b=new m.Dd;return b.$B(),a.Oc(b),(v=new p(g)).g=a,v.qa=u,v.cA=h,h=v.lI(),b.$B(),a.Oc(b),!!h&&(d!=null&&d.Wt(v.Ni),!0)},p.Ml=function(h,a){return!(16>(h=h.I()))&&2*h+Math.log(h)*Math.LOG10E/Math.log(2)*a<1*h*a},p.lP=function(h,a,u,d){var g=a.getType();if(m.aa.Hc(g))return new p(d).mP(h,a,u);throw m.i.fa("crack_A_with_B")},p.prototype.mP=function(h,a,u){var d=new m.l;h.xc(d);var g=new m.l;if(a.xc(g),g.W(u,u),!g.isIntersecting(d))return h;var v=h.Bb,b=null;v!=null&&(b=v.Fb),p.Ml(h,h.I())&&(b=m.ta.jj(h,g));var S=b!=null?b.getIterator():null,C=a.Ga();a=h.Ga();var O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(g=[];C.$a();)for(;C.Ha();){var R=C.ha();if(b!=null){for(S.Uo(R,u),v=S.next();v!=-1;v=S.next())if(this.Xq(),a.Vb(b.ja(v),-1),a.Ha()){var $=(v=a.ha()).Ea(R,null,O,null,u);for(v=0;v<$;++v){var N=O[v];if(N!=0&&N!=1){var B=a.wb(),G=new E;G.t=N,G.index=B,g.push(G)}}}}else{var K=new m.l;if(R.xc(K),K.W(u,u),d.isIntersecting(K)){for(a.Zi();a.$a();)for(;a.Ha();)if(this.Xq(),v=a.ha(),N=new m.l,v.xc(N),N.isIntersecting(K))for($=v.Ea(R,null,O,null,u),v=0;v<$;++v)(N=O[v])!=0&&N!=1&&(B=a.wb(),(G=new E).t=N,G.index=B,g.push(G))}}}if(g.length==0)return h;for(g=g.sort(E.Ey),h=h.Ia(),a.Zi();a.$a()&&!a.Ha(););for(u=a.ha(),d=new m.ig,b=-1,v=0,S=g.length;va.t?1:h.ta.index?1:-1},p}()}(ie||(ie={})),function(m){var D;(D=m.KK||(m.KK={}))[D.Left=0]="Left",D[D.Right=1]="Right",D[D.Coincident=2]="Coincident",D[D.Undefined=3]="Undefined",D[D.Uncut=4]="Uncut";var E=function(a,u,d,g,v,b,S,C,O,R,$){this.X=a,this.bt=u,this.Ns=d,this.tg=g,this.Lm=R,this.Al=$};m.uY=E;var p=function(){function a(u,d){this.JH=u,this.Hi=d}return a.prototype.qM=function(u,d){var g=new m.h;this.Hi.D(u,g);var v=new m.h;return this.Hi.D(d,v),(g=g.compare(v))!=0?g:(u=this.Hi.Pa(u,this.JH))<(d=this.Hi.Pa(d,this.JH))?-1:u==d?0:1},a}(),h=function(a,u,d,g,v,b,S,C,O){this.tg=a,this.Ns=u,this.OA=d,this.UH=g,this.Ei=v,this.Al=b,this.Lm=S,this.VH=C,this.OT=O};m.tY=h,m.LK=function(){function a(){}return a.JK=function(u,d,g,v,b,S){if(d.B())u=new E(d,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),b.push(u);else if(g.B())u=new E(d,4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),b.push(u);else{var C=new m.gd;if(C.Ib(d),C.Ib(g),m.Tk.V(C,v,S,!0),C.fd==0)u=new E(d.Ia(),4,-1,-1,NaN,4,-1,-1,NaN,-1,-1),b.push(u);else{for(d=0,g=C.Gd(),v=C.ld;v!=-1;v=C.ue(v))for(S=C.Ob(v);S!=-1;S=C.Rb(S))for(var O=C.Xa(S),R=0,$=C.Ja(S);R<$;O=C.U(O),R++)C.Ra(O,g,d++);d=a.HM(g,C),a.cM(u,d,C,b)}}},a.HM=function(u,d){for(var g=d.fd,v=new m.ia(0),b=d.ld;b!=-1;b=d.ue(b))for(var S=d.Ob(b);S!=-1;S=d.Rb(S))for(var C=d.Xa(S),O=0,R=d.Ja(S);O(B=B.Ea(O,null,$,N,0))&&(v=new h(b,v,$[0],NaN,B,C,S,N[0],NaN),g.push(v),0>(v=d.Pa(b,u))&&d.Ra(b,u,g.length-1)),!0},a.wM=function(u,d,g,v,b,S,C){var O=new m.yb,R=new m.yb,$=[0,0],N=[0,0],B=d.bc(b);return B==null&&(d.ed(b,O),B=O),(O=d.bc(C))==null&&(d.ed(C,R),O=R),2>(B=B.Ea(O,null,$,N,0))&&(v=new h(b,v,$[0],NaN,B,C,S,N[0],NaN),g.push(v),0>(v=d.Pa(b,u))&&d.Ra(b,u,g.length-1),!0)},a.xM=function(u,d,g,v,b,S,C,O){var R=new m.yb,$=new m.yb,N=[0,0],B=[0,0],G=d.bc(b);return G==null&&(d.ed(b,R),G=R),(R=d.bc(C))==null&&(d.ed(C,$),R=$),(G=G.Ea(R,null,N,B,0))==2?(v=new h(b,v,N[0],N[1],G,C,S,B[0],B[1]),g.push(v),0>(v=d.Pa(b,u))&&d.Ra(b,u,g.length-1),!0):($=!1,b==O&&(v=new h(b,v,N[0],NaN,G,C,S,B[0],NaN),g.push(v),0>(v=d.Pa(b,u))&&d.Ra(b,u,g.length-1),$=!0),$)},a.yM=function(u,d,g,v,b,S,C,O){var R=new m.yb,$=new m.yb,N=[0,0],B=[0,0],G=d.bc(b);return G==null&&(d.ed(b,R),G=R),(R=d.bc(C))==null&&(d.ed(C,$),R=$),(G=G.Ea(R,null,N,B,0))==2?(v=new h(b,v,N[0],N[1],G,C,S,B[0],B[1]),g.push(v),0>(v=d.Pa(b,u))&&d.Ra(b,u,g.length-1),!0):($=!1,b==O&&(v=new h(b,v,N[0],NaN,G,C,S,B[0],NaN),g.push(v),0>(v=d.Pa(b,u))&&d.Ra(b,u,g.length-1),$=!0),$)},a.cM=function(u,d,g,v){var b=[];b[0]=new m.h,b[1]=new m.h,b[2]=new m.h,b[3]=new m.h;var S=new m.h,C=new m.h,O=new m.h,R=new m.h,$=null;v!=null&&($=new m.ig).Or();var N=0,B=null,G=new m.yb;new m.yb;for(var K=g.Ob(g.ld);K!=-1;K=g.Rb(K)){for(var ee=4,q=-1,oe=-1,ge=-1,me=-1,Me=NaN,Te=!0,Fe=!1,Xe=!0,We=!0,Mt=!0,lt=0,yi=K,di=0,Ct=g.Xa(K),rn=g.Ja(K),cs=0;cs=d.length-2||d[N+2].Ns!=q)&&(ee=0):ee=1):((zi!=Gi||Kr&&Gi==0)&&(v!=null?(dr=new E(B,3,q,nr,zi,ee,yi,oe,di,pr,Ri),v.push(dr)):null.add(lt)),ee=1):ee!=0?((zi!=Gi||Kr&&Gi==0)&&(v!=null?(dr=new E(B,0,q,nr,zi,ee,yi,oe,di,pr,Ri),v.push(dr)):null.add(lt)),jo?(N>=d.length-2||d[N+2].Ns!=q)&&(ee=1):ee=0):((zi!=Gi||Kr&&Gi==0)&&(v!=null?(dr=new E(B,3,q,nr,zi,ee,yi,oe,di,pr,Ri),v.push(dr)):null.add(lt)),ee=0),(zi!=Gi||Kr&&Gi==0)&&(Gi=zi,yi=q,oe=nr,di=zi,ge=pr,me=Ri,Me=Aa,Te=Xe=!1,We=Mt=!0))}}N++}Gi!=1&&(Mt&&(v!=null?B=new m.Ta:lt=0),v!=null?(on.ah(Gi,1,$),B.oc($.get(),We)):lt++,We=Mt=!1,Xe=!0)}Xe&&(zi=1,nr=g.rj(K),nr=g.Ma(nr),Ri=pr=-1,Aa=NaN,Te?v!=null?(dr=new E(B,4,q,nr,zi,ee,yi,oe,di,pr,Ri),v.push(dr)):null.add(lt):(Te=ee==1?0:ee==0?1:3,v!=null?(dr=new E(B,Te,q,nr,zi,ee,yi,oe,di,pr,Ri),v.push(dr)):null.add(lt)))}},a.CM=function(u,d,g,v,b,S){var C=g[v].VH;if(C==1)return a.AM(u,d,g,v,b,S);if(C==0)return a.BM(u,d,g,v,b,S);throw m.i.Qa()},a.AM=function(u,d,g,v,b,S){var C=new m.yb,O=g[v].tg,R=g[v].Lm,$=g[v].Al,N=-1,B=-1,G=-1,K=-1;if(!u&&0.01*h&&(u*=1+(1+(p=p.xb/h))*p),this.pb=a,this.xb=u+2220446049250313e-31*Math.abs(a)},E.prototype.sqrt=function(){if(0<=this.pb){var p=Math.sqrt(this.pb),h=this.pb>10*this.xb?.5*this.xb/p:this.pb>this.xb?p-Math.sqrt(this.pb-this.xb):Math.max(p,Math.sqrt(this.pb+this.xb)-p);h+=2220446049250313e-31*Math.abs(p)}else this.pb<-1*this.xb?h=p=NaN:(p=0,h=Math.sqrt(this.xb));this.pb=p,this.xb=h},E.prototype.sin=function(p){var h=Math.sin(p.pb),a=Math.cos(p.pb);this.pb=h,h=Math.abs(h),this.xb=(Math.abs(a)+.5*h*p.xb)*p.xb+2220446049250313e-31*h},E.prototype.cos=function(p){var h=Math.sin(p.pb),a=Math.cos(p.pb);this.pb=a,a=Math.abs(a),this.xb=(Math.abs(h)+.5*a*p.xb)*p.xb+2220446049250313e-31*a},E.prototype.qg=function(){return Math.abs(this.pb)<=this.xb},E.prototype.ps=function(){return this.qg()&&this.xb!=0},E}();m.Wb=D}(ie||(ie={}));var Lt=new ie.h,vt=new ie.h,Bt=new ie.h,qt=new ie.h,li=new ie.h;(function(m){var D,E;(E=D||(D={}))[E.closedPath=1]="closedPath",E[E.exteriorPath=2]="exteriorPath",E[E.ringAreaValid=4]="ringAreaValid";var p=function(){function h(a,u,d,g,v,b,S){u!==void 0?(this.ib=a,this.ck=u,this.bl=d,this.ii=g,this.ya=b,this.hA=S,this.ew=v):(this.ib=a.ib,this.ck=a.ck,this.bl=a.bl,this.ii=a.ii,this.ya=a.ya,this.hA=a.hA,this.ew=a.ew),this.bH=!0}return h.prototype.next=function(){return this.bH?(this.bH=!1,this.ii):this.ii!=-1?(this.ii=this.ib.U(this.ii),this.ya++,this.ii!=-1&&this.ii!=this.ew?this.ii:this.$T()):-1},h.prototype.$T=function(){for(this.bl=this.ib.Rb(this.bl),this.ya=0;this.ck!=-1;){for(;this.bl!=-1;this.bl=this.ib.Rb(this.bl))if(this.ew=this.ii=this.ib.Xa(this.bl),this.ii!=-1)return this.ii;if(this.ck=this.ib.ue(this.ck),this.ck==-1)break;this.hA&&!m.aa.Hc(this.ib.ic(this.ck))||(this.bl=this.ib.Ob(this.ck))}return-1},h.AP=function(a,u,d,g,v,b,S){return new h(a,u,d,g,v,b,S)},h}();m.zY=p,D=function(){function h(){this.jo=this.Am=this.wk=this.cd=this.Ck=this.vo=this.Oi=this.md=this.bi=this.Sg=this.We=this.Il=null,this.qw=this.ld=-1,this.fd=0,this.fA=!1,this.ht=this.it=this.vb=null}return h.prototype.Sh=function(a){return this.We!=null?this.We[a]:null},h.prototype.Xg=function(a,u){if(this.We==null){if(u==null)return;this.We=[];for(var d=0,g=this.vb.I();d=this.Oi.size&&(a=16>u?16:m.O.truncate(3*u/2),this.Oi.resize(a),this.vo.resize(a)),this.Oi.set(u,0),this.vo.set(u,0),u},h.prototype.sF=function(a){this.md.jd(a)},h.prototype.Vy=function(a){this.td.jd(a),this.fd--},h.prototype.oI=function(a){this.md==null&&(this.md=new m.$c(8),this.td=new m.$c(5),this.Oi=new m.be(0),this.vo=new m.be(0));var u=this.td.Ce(),d=0<=a?a:u;if(this.td.S(u,0,d),0>a){if(d>=this.vb.I()){if(a=16>d?16:m.O.truncate(3*d/2),this.vb.resize(a),this.We!=null)for(var g=0;gu.Ja(g))){var b=this.vf(a,-1);this.kn(b,u.dc(g));for(var S=u.Ba(g),C=u.Vc(g);Sa.Ja(u))return d;this.Il.Fd(a,a.Ba(u),a.Vc(u)),this.it=this.vb.ub(0);var g=this.vf(d,-1);this.kn(g,a.dc(u)||!0);var v=this.We!=null&&a.Ve!=null,b=a.Ba(u);for(u=a.Vc(u);b=u.size&&u.resize(Math.max(m.O.truncate(1.25*a),16),-1),u.write(a,d)},h.prototype.KF=function(a,u){return(a=this.JF(a))<(u=this.wk[u]).size?u.read(a):-1},h.prototype.aF=function(){this.wk==null&&(this.wk=[]);for(var a=0;aO:2>O)?(S=this.Zq(S),g=0$){var N=$;C!=null&&(N=0N){var B=N;if(C!=null&&(B=0g||v>this.fd-1)throw m.i.N("invalid call");if(g>v&&!this.dc(a))throw m.i.N("cannot iterate across an open path");for(a=0;u!=d;u=this.U(u))g=this.Ua(u),(v=this.Sh(g))!=null?a+=v.Qb():(v=this.Ua(this.U(u)),a+=this.vb.yr(g,v));return a},h.prototype.Dh=function(a,u){var d=this.Ua(a);this.vb.Ht(d,u),(d=this.Sh(d))!=null&&d.setStart(u),(a=this.Ma(a))!=-1&&(a=this.Ua(a),this.Sh(a)!=null&&d.setEnd(u))},h.prototype.Vi=function(a,u){a=this.Ua(a),this.vb.ve(a,u)},h.prototype.mf=function(a,u){this.Cb(a,u.x,u.y)},h.prototype.Cb=function(a,u,d){var g=this.Ua(a);this.vb.Cb(g,u,d),(g=this.Sh(g))!=null&&g.ZB(u,d),(a=this.Ma(a))!=-1&&(a=this.Ua(a),this.Sh(a)!=null&&g.Ql(u,d))},h.prototype.D=function(a,u){this.vb.D(this.td.T(a,0),u)},h.prototype.Gc=function(a,u){this.vb.za[0].tc(2*this.td.T(a,0),u)},h.prototype.Na=function(a){var u=new m.h;return this.vb.D(this.td.T(a,0),u),u},h.prototype.dG=function(a,u){this.it.tc(2*a,u)},h.prototype.Uc=function(a,u,d){return this.vb.Uc(a,this.Ua(u),d)},h.prototype.setAttribute=function(a,u,d,g){this.vb.setAttribute(a,this.Ua(u),d,g)},h.prototype.Ua=function(a){return this.td.T(a,0)},h.prototype.ih=function(){var a=new m.h;return this.D(void 0,a),a.y},h.prototype.fq=function(a,u){a=this.Ua(a),u=this.Ua(u);var d=this.vb.za[0].o;return d[2*a]===d[2*u]&&d[2*a+1]===d[2*u+1]},h.prototype.Dv=function(a,u){a=this.Ua(a);var d=this.vb.za[0].o;return d[2*a]===u.x&&d[2*a+1]===u.y},h.prototype.vX=function(a,u){if(1>u&&(u=1),this.Sg==null){if(u==1)return;this.Sg=m.Yc.Dn(this.vb.I(),1)}(a=this.Ua(a))>=this.Sg.size&&this.Sg.resize(a+1,1),this.Sg.write(a,u)},h.prototype.cG=function(a){return a=this.Ua(a),this.Sg==null||a>=this.Sg.size?1:this.Sg.read(a)},h.prototype.Ra=function(a,u,d){u=this.bi[u],a=this.Ua(a),u.sizev?1:bC?1:0})},h.prototype.jS=function(){for(var a=this.ld;a!=-1;a=this.ue(a))if(!m.aa.Hc(this.ic(a)))return!0;return!1},h.prototype.hC=function(a,u){for(var d=this.Ob(a),g=this.Ob(u),v=this.kv(a),b=this.kv(u),S=this.Ob(a);S!=-1;S=this.Rb(S))this.gx(S,u);for(S=this.Ob(u);S!=-1;S=this.Rb(S))this.gx(S,a);this.Zo(a,g),this.Zo(u,d),this.$o(a,b),this.$o(u,v),d=this.I(a),g=this.da(a),v=this.da(u),this.Tj(a,this.I(u)),this.Tj(u,d),this.Rl(a,v),this.Rl(u,g),d=this.cd.T(a,2),this.cd.S(a,2,this.cd.T(u,2)),this.cd.S(u,2,d)},h}(),m.gd=D})(ie||(ie={})),function(m){var D=function(E){function p(h,a,u,d){var g=E.call(this)||this;return g.$=new m.l,h===void 0?g.UE():typeof h=="number"?g.VO(h,a,u,d):h instanceof m.Sa?a!==void 0?g.Qu(h,a,u):g.WO(h):h instanceof m.ra?a!==void 0?g.YO(h,a):g.XO(h):h instanceof m.l?g.UO(h):g.UE(),g}return Ke(p,E),p.prototype.Qu=function(h,a,u){this.description=m.ee.og(),this.$.Oa(),h.B()||this.tu(h,a,u)},p.prototype.UO=function(h){this.description=m.ee.og(),this.$.K(h),this.$.normalize()},p.prototype.XO=function(h){if(h==null)throw m.i.N();this.description=h,this.$.Oa()},p.prototype.YO=function(h,a){if(h==null)throw m.i.N();this.description=h,this.$.K(a),this.$.normalize()},p.prototype.UE=function(){this.description=m.ee.og(),this.$.Oa()},p.prototype.WO=function(h){this.description=m.ee.og(),this.$.Oa(),h.B()||this.tu(h)},p.prototype.VO=function(h,a,u,d){this.description=m.ee.og(),this.K(h,a,u,d)},p.prototype.K=function(h,a,u,d){if(this.vc(),typeof h=="number")this.$.K(h,a,u,d);else for(this.Oa(),a=0,u=h.length;a=m.ra.Va(a))throw m.i.N();var d=this.description.Pf(a);return this.ou(),0<=d?this.ka[this.kR(this.description,h)+this.description.LR(d)-2+u]:m.ra.se(a)},p.prototype.ou=function(){if(this.vc(),this.ka==null&&2=m.ra.Va(a))throw m.i.ce();var d=this.description.Pf(a);return 0<=d?(this.ou(),this.ka[p.Gg(this.description,h)+this.description.$j(d)-2+u]):m.ra.se(a)},p.prototype.vD=function(h,a,u,d){if(this.vc(),a==0)h!=0?u!=0?this.$.H=d:this.$.C=d:u!=0?this.$.G=d:this.$.v=d;else{if(u>=m.ra.Va(a))throw m.i.ce();if(!this.hasAttribute(a)){if(m.ra.DG(a,d))return;this.re(a)}a=this.description.Pf(a),this.ou(),this.ka[p.Gg(this.description,h)+this.description.$j(a)-2+u]=d}},p.Gg=function(h,a){return a*(h.Ae.length-2)},p.prototype.Ea=function(h){this.vc();var a=new m.l;return h.A(a),this.$.Ea(a)},p.prototype.isIntersecting=function(h){return h instanceof m.l?this.$.isIntersecting(h):this.$.isIntersecting(h.$)},p.prototype.Ju=function(h,a){this.vc(),h.B()?this.Oa():a!==void 0?this.tu(h,a):this.$.Ju(h.Lg(),h.ih())},p.prototype.offset=function(h,a){this.vc(),this.$.offset(h,a)},p.prototype.normalize=function(){this.vc(),this.$.normalize()},p.prototype.sf=function(h){if(h===void 0){if(h=new m.Sa(this.description),this.B())return h;for(a=this.description.Aa,u=1;uthis.C&&(this.C=u.x),u.ythis.H&&(this.H=u.y)}}else if(p==null||p.length==0)this.Oa();else for(u=p[0],this.K(u.x,u.y),a=1;ap?this.v=p:this.Ch?this.G=h:this.Hp?this.v=p:this.Ch?this.G=h:this.Hthis.C||this.G>this.H)&&this.Oa())},E.prototype.scale=function(p){0>p&&this.Oa(),this.B()||(this.v*=p,this.C*=p,this.G*=p,this.H*=p)},E.prototype.zoom=function(p,h){this.B()||this.K(this.sf(),p*this.R(),h*this.ca())},E.prototype.isIntersecting=function(p){return!this.B()&&!p.B()&&(this.v<=p.v?this.C>=p.v:p.C>=this.v)&&(this.G<=p.G?this.H>=p.G:p.H>=this.G)},E.prototype.HG=function(p){return(this.v<=p.v?this.C>=p.v:p.C>=this.v)&&(this.G<=p.G?this.H>=p.G:p.H>=this.G)},E.prototype.Ea=function(p){return!this.B()&&!p.B()&&(p.v>this.v&&(this.v=p.v),p.Cthis.G&&(this.G=p.G),p.Hp.length)throw m.i.N();p[0]!=null?p[0].ma(this.v,this.G):p[0]=m.h.construct(this.v,this.G),p[1]!=null?p[1].ma(this.v,this.H):p[1]=m.h.construct(this.v,this.H),p[2]!=null?p[2].ma(this.C,this.H):p[2]=m.h.construct(this.C,this.H),p[3]!=null?p[3].ma(this.C,this.G):p[3]=m.h.construct(this.C,this.G)},E.prototype.wF=function(){return this.B()?0:this.R()*this.ca()},E.prototype.yR=function(){return this.B()?0:2*(this.R()+this.ca())},E.prototype.gk=function(){return(this.C+this.v)/2},E.prototype.Jp=function(){return(this.H+this.G)/2},E.prototype.R=function(){return this.C-this.v},E.prototype.ca=function(){return this.H-this.G},E.prototype.move=function(p,h){this.B()||(this.v+=p,this.G+=h,this.C+=p,this.H+=h)},E.prototype.Ju=function(p,h){if(h!==void 0)this.move(p-this.gk(),h-this.Jp());else if(p instanceof m.h)this.Ju(p.x,p.y);else{if(!(p instanceof m.Sa))throw m.i.N();h=(this.C-this.v)/2;var a=(this.H-this.G)/2;this.v=p.Lg()-h,this.C=p.Lg()+h,this.G=p.ih()-a,this.H=p.ih()+a}},E.prototype.offset=function(p,h){this.v+=p,this.C+=p,this.G+=h,this.H+=h},E.prototype.normalize=function(){if(!this.B()){var p=Math.min(this.v,this.C),h=Math.max(this.v,this.C);this.v=p,this.C=h,p=Math.min(this.G,this.H),h=Math.max(this.G,this.H),this.G=p,this.H=h}},E.prototype.dn=function(p){p.ma(this.v,this.G)},E.prototype.$I=function(p){p.ma(this.C,this.G)},E.prototype.cJ=function(p){p.ma(this.v,this.H)},E.prototype.en=function(p){p.ma(this.C,this.H)},E.prototype.fT=function(){return this.B()||this.v<=this.C&&this.G<=this.H},E.prototype.sf=function(){return m.h.construct((this.C+this.v)/2,(this.H+this.G)/2)},E.prototype.mz=function(){return m.h.construct(this.v,this.G)},E.prototype.contains=function(p,h){if(h!==void 0)return p>=this.v&&p<=this.C&&h>=this.G&&h<=this.H;if(p instanceof m.Sa)return this.contains(p.Lg(),p.ih());if(p instanceof m.h)return this.contains(p.x,p.y);if(p instanceof E)return p.v>=this.v&&p.C<=this.C&&p.G>=this.G&&p.H<=this.H;throw m.i.N()},E.prototype.hm=function(p,h){if(h!==void 0)return p>this.v&&pthis.G&&hthis.v&&p.Cthis.G&&p.H>>32);var h=m.O.Th(p);return p=this.C,p=m.O.truncate(p^p>>>32),h=m.O.Th(p,h),p=this.G,p=m.O.truncate(p^p>>>32),h=m.O.Th(p,h),p=this.H,p=m.O.truncate(p^p>>>32),m.O.Th(p,h)},E.prototype.xr=function(){return this.B()?2220446049250313e-29:2220446049250313e-29*(Math.abs(this.v)+Math.abs(this.C)+Math.abs(this.G)+Math.abs(this.H)+1)},E.prototype.zy=function(p,h){var a=this.Zj(p),u=this.Zj(h);if(a&u)return 0;if(!(a|u))return 4;var d=(a!=0?1:0)|(u!=0?2:0);do{var g=h.x-p.x,v=h.y-p.y;if(g>v?a&E.YC?(a&E.ju?(p.y+=v*(this.v-p.x)/g,p.x=this.v):(p.y+=v*(this.C-p.x)/g,p.x=this.C),a=this.Zj(p)):u&E.YC?(u&E.ju?(h.y+=v*(this.v-h.x)/g,h.x=this.v):(h.y+=v*(this.C-h.x)/g,h.x=this.C),u=this.Zj(h)):a!=0?(a&E.ku?(p.x+=g*(this.G-p.y)/v,p.y=this.G):(p.x+=g*(this.H-p.y)/v,p.y=this.H),a=this.Zj(p)):(u&E.ku?(h.x+=g*(this.G-h.y)/v,h.y=this.G):(h.x+=g*(this.H-h.y)/v,h.y=this.H),u=this.Zj(h)):a&E.ZC?(a&E.ku?(p.x+=g*(this.G-p.y)/v,p.y=this.G):(p.x+=g*(this.H-p.y)/v,p.y=this.H),a=this.Zj(p)):u&E.ZC?(u&E.ku?(h.x+=g*(this.G-h.y)/v,h.y=this.G):(h.x+=g*(this.H-h.y)/v,h.y=this.H),u=this.Zj(h)):a!=0?(a&E.ju?(p.y+=v*(this.v-p.x)/g,p.x=this.v):(p.y+=v*(this.C-p.x)/g,p.x=this.C),a=this.Zj(p)):(u&E.ju?(h.y+=v*(this.v-h.x)/g,h.x=this.v):(h.y+=v*(this.C-h.x)/g,h.x=this.C),u=this.Zj(h)),(a&u)!=0)return 0}while(a|u);return d},E.prototype.Zj=function(p){return(p.xthis.C?1:0)<<1|(p.ythis.H?1:0)<<3},E.prototype.Bi=function(p){return!this.B()&&(this.R()<=p||this.ca()<=p)},E.prototype.tb=function(p){return p instanceof m.h?Math.sqrt(this.iK(p)):Math.sqrt(this.px(p))},E.prototype.px=function(p){var h=0,a=0,u=this.v-p.C;return u>h&&(h=u),(u=this.G-p.H)>a&&(a=u),(u=p.v-this.C)>h&&(h=u),(u=p.G-this.H)>a&&(a=u),h*h+a*a},E.prototype.iK=function(p){var h=0,a=0,u=this.v-p.x;return u>h&&(h=u),(u=this.G-p.y)>a&&(a=u),(u=p.x-this.C)>h&&(h=u),(u=p.y-this.H)>a&&(a=u),h*h+a*a},E.prototype.cn=function(p){this.B()?p.Oa():p.K(this.v,this.C)},E.ju=1,E.ku=4,E.YC=3,E.ZC=12,E}();m.l=D}(ie||(ie={})),function(m){var D,E;(E=D||(D={}))[E.initialize=0]="initialize",E[E.initializeRed=1]="initializeRed",E[E.initializeBlue=2]="initializeBlue",E[E.initializeRedBlue=3]="initializeRedBlue",E[E.sweep=4]="sweep",E[E.sweepBruteForce=5]="sweepBruteForce",E[E.sweepRedBlueBruteForce=6]="sweepRedBlueBruteForce",E[E.sweepRedBlue=7]="sweepRedBlue",E[E.sweepRed=8]="sweepRed",E[E.sweepBlue=9]="sweepBlue",E[E.iterate=10]="iterate",E[E.iterateRed=11]="iterateRed",E[E.iterateBlue=12]="iterateBlue",E[E.iterateBruteForce=13]="iterateBruteForce",E[E.iterateRedBlueBruteForce=14]="iterateRedBlueBruteForce",E[E.resetRed=15]="resetRed",E[E.resetBlue=16]="resetBlue";var p=function(){function h(a,u){this.ci=a,this.dH=u}return h.prototype.nr=function(a,u,d){this.ci.JX(d,a,u,this.dH)},h.prototype.$p=function(a){return this.ci.Rr(a,this.dH)},h}();D=function(){function h(){this.ow=this.oo=this.ff=this.rd=null,this.wq=new m.l,this.Am=this.Hj=this.Ij=this.Ad=this.Ef=this.Ld=this.cw=this.fo=this.qd=this.Eb=null,this.Xb=-1,this.qa=0,this.Nk()}return h.prototype.kr=function(){this.Nk(),this.Pv=!0,this.Eb==null?(this.fo=new m.ia(0),this.Eb=[]):(this.fo.Bh(0),this.Eb.length=0)},h.prototype.ad=function(a,u){if(!this.Pv)throw m.i.Hb();var d=new m.l;d.K(u),this.fo.add(a),this.Eb.push(d)},h.prototype.Fp=function(){if(!this.Pv)throw m.i.Hb();this.Pv=!1,this.Eb!=null&&0this.Eb.length)return this.pe=this.Eb.length,this.Xb=5,!0;this.rd==null&&(this.rd=new m.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new m.ia(0)),this.rd.kr();for(var a=0;athis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new m.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new m.ia(0)),this.rd.kr();for(var a=0;athis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.ff==null&&(this.ff=new m.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new m.ia(0)),this.ff.kr();for(var a=0;athis.Eb.length||10>this.qd.length)return this.pe=this.Eb.length,this.Xb=6,!0;this.rd==null&&(this.rd=new m.sr(!0),this.oo=this.rd.getIterator(),this.Ld=new m.ia(0)),this.ff==null&&(this.ff=new m.sr(!0),this.ow=this.ff.getIterator(),this.Ef=new m.ia(0)),this.rd.kr();for(var a=0;a>1;return h.eq(a)?(this.rd.remove(u),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1)):(this.oo.EB(this.Eb[u].v,this.Eb[u].C,this.qa),this.Vf=u,this.Xb=10,!0)},h.prototype.QX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Rg=this.Vf=this.pe,this.Xb=13,!0)},h.prototype.RX=function(){return--this.pe==-1?(this.Af=this.Vf=-1,this.Ic=!0,!1):(this.Vf=this.pe,this.Rg=this.qd.length,this.Xb=14,!0)},h.prototype.SX=function(){var a=this.Ld.get(this.pe-1),u=this.Ef.get(this.Rg-1),d=this.Rr(a,!0),g=this.Rr(u,!1);return d>g?this.ux():d>1;if(h.eq(a))return this.Df!=-1&&this.Ij.get(u)!=-1?(this.Ad.jd(this.Df,this.Ij.get(u)),this.Ij.set(u,-1)):this.rd.remove(u),this.pe!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Cf!=-1&&0>1;if(h.eq(a))return this.Cf!=-1&&this.Hj.get(u)!=-1?(this.Ad.jd(this.Cf,this.Hj.get(u)),this.Hj.set(u,-1)):this.ff.remove(u),this.Rg!=0||(this.Af=this.Vf=-1,this.Ic=!0,!1);if(this.Df!=-1&&0>1;return this.rd.vj(a),this.Xb=4,!0},h.prototype.jT=function(){if(this.Vf=this.oo.next(),this.Vf!=-1)return!1;this.Af=this.Vf=-1;var a=this.Ef.get(this.Rg)>>1;return this.ff.vj(a),this.Xb=7,!0},h.prototype.gT=function(){if(this.Af=this.ow.next(),this.Af!=-1)return!1;var a=this.Ld.get(this.pe)>>1;return this.rd.vj(a),this.Xb=7,!0},h.prototype.hT=function(){if(--this.Rg==-1)return this.Xb=5,!0;this.wq.K(this.Eb[this.pe]);var a=this.Eb[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(a)||(this.Af=this.Rg,!1)},h.prototype.iT=function(){if(--this.Rg==-1)return this.Xb=6,!0;this.wq.K(this.Eb[this.pe]);var a=this.qd[this.Rg];return this.wq.W(this.qa,this.qa),!this.wq.isIntersecting(a)||(this.Af=this.Rg,!1)},h.prototype.kJ=function(){return this.rd==null?(this.Ic=!0,!1):(this.pe=this.Ld.size,0>1],h.eq(a)?u.G-d:u.H+d):(u=this.qd[a>>1],h.eq(a)?u.G-d:u.H+d)},h}(),m.xC=D}(ie||(ie={})),function(m){var D=function(){function E(){}return E.construct=function(p,h,a,u,d,g){var v=new E;return v.v=p,v.G=h,v.Ye=a,v.C=u,v.H=d,v.Bg=g,v},E.prototype.Oa=function(){this.Ye=this.v=NaN},E.prototype.B=function(){return isNaN(this.v)},E.prototype.XS=function(){return isNaN(this.Ye)},E.prototype.K=function(p,h,a,u,d,g){u!==void 0?typeof p=="number"?(this.v=p,this.G=h,this.Ye=a,this.C=u,this.H=d,this.Bg=g):(this.v=p.x-.5*h,this.C=this.v+h,this.G=p.y-.5*a,this.H=this.G+a,this.Ye=p.z-.5*u,this.Bg=this.Ye+u):(this.v=p,this.G=h,this.Ye=a,this.C=p,this.H=h,this.Bg=a)},E.prototype.move=function(p){this.v+=p.x,this.G+=p.y,this.Ye+=p.z,this.C+=p.x,this.H+=p.y,this.Bg+=p.z},E.prototype.copyTo=function(p){p.v=this.v,p.G=this.G,p.C=this.C,p.H=this.H},E.prototype.Lk=function(p,h,a){this.v>p?this.v=p:this.Ch?this.G=h:this.Ha?this.Ye=a:this.Bgp.length)throw m.i.N();p[0]=new m.Nd(this.v,this.G,this.Ye),p[1]=new m.Nd(this.v,this.H,this.Ye),p[2]=new m.Nd(this.C,this.H,this.Ye),p[3]=new m.Nd(this.C,this.G,this.Ye),p[4]=new m.Nd(this.v,this.G,this.Bg),p[5]=new m.Nd(this.v,this.H,this.Bg),p[6]=new m.Nd(this.C,this.H,this.Bg),p[7]=new m.Nd(this.C,this.G,this.Bg)},E.prototype.Zw=function(p){if(p==null||p.length==0)this.Oa();else{var h=p[0];for(this.K(h.x,h.y,h.z),h=1;hthis.FA;){var b=this.sd.ha();if(d.L(b.ac()),g.L(b.wc()),d.scale(this.Wa.ec),g.scale(this.Wa.ec),m.cj.Mu(d,g)?d.x=g.x:m.cj.Ku(d,g)&&(g.x=d.x),this.uk.length=0,m.cj.tF(this.Wa.Tb,this.Wa.kc,this.Wa.ze,d,g,this.Wa.QA,this.Wa.Zs,v,this.Nj,this.Gs,this.uk,this.bw),this.co!=null&&(b=this.uk.slice(0),this.co.qG(this.co.da()-1,b,b.length-1)),m.cj.Lu(d,g)?(this.qq.Oa(),this.Wa.sy(d,this.sl,this.qq),this.Xn=!0):(this.qq.Oa(),this.Xn=this.xy(v[0],this.qq)),this.Xn){if(this.sd.li(),this.sd.Ez()){this.sd.li(),this.sd.ha();break}this.sd.DW();break}a==null&&(a=new m.Da).Yk(null,0),this.OD(a),u++}if(this.bw[0]=0,0=this.Nj[0]){var v=this.di+1.570796326794897;d=v+3.141592653589793-(this.di-this.Nj[0])}else d=(v=this.di+1.570796326794897)+3.141592653589793-(6.283185307179586-(this.Nj[0]-this.di));var b=!(this.di>=this.Nj[0]&&3.141592653589793>=this.di-this.Nj[0])&&!(this.div;)C-=6.283185307179586;Cu.x-this.sk[0]?this.sk[0]-=6.283185307179586:3.141592653589793v?S.xX():S.$n=v,d=a.getType(),m.aa.yd(d)?((d=new m.Ta(a.description)).oc(a,!0),a=d,d=1607):d==197&&(d=new m.l,a.A(d),d.R()<=S.qa||d.ca()<=S.qa?((d=new m.Ta(a.description)).ad(a,!1),a=d,d=1607):((d=new m.Da(a.description)).ad(a,!1),a=d,d=1736)),S.yX(),m.aa.Rn(d)||S.zX(),S.rb<=.5*S.$n)return d!=1736?new m.Da(a.description):S.Wv?a:m.cj.Qr(a,S.Qg,S.ze,S.QA,-1,b);if(0>S.Ka&&d!=1736)return new m.Da(a.description);if(S.Wv&&m.aa.Hc(d)?(u=m.cj.Qr(a,u,4,NaN,S.$n,b),a=m.cb.zh(u,S.Qg,S.Jc)):a=m.cb.zh(a,S.Qg,S.Jc),(a=m.Hh.lj(a,S.Jc)).B())return new m.Da(a.description);switch(!S.Wv&&m.aa.Hc(d)&&(a=m.cj.pI(S.ec,a)),a=h.KX(a,S.Jc),d){case 1736:u=S.UN(a);break;case 1607:u=S.VN(a);break;case 550:u=S.SN(a);break;case 33:u=S.TN(a);break;default:throw m.i.fa("corrupted_geometry")}return(S=m.cb.zh(u,S.Jc,S.Qg)).Jl(a.description),S},h.prototype.UN=function(a){var u=new m.Da;a=new E(this,a,u),a=m.Gh.local().V(a,this.Jc,this.Ub).next(),a=m.ip.nj(a,this.Jc,2);var d=new m.Dd;return d.scale(1/this.ec,1/this.ec),u.Oc(d),u=m.ip.nj(u,this.Jc,2),0<=this.Ka?m.Gh.local().V(u,a,this.Jc,this.Ub):m.kp.local().V(u,a,this.Jc,this.Ub)},h.prototype.VN=function(a){return a=new E(this,a,null),a=m.Gh.local().V(a,this.Jc,this.Ub).next(),m.ip.nj(a,this.Jc,2)},h.prototype.SN=function(a){return a=new D(this,a),a=m.Gh.local().V(a,this.Jc,this.Ub).next(),m.ip.nj(a,this.Jc,2)},h.prototype.TN=function(a){(a=a.D()).scale(this.ec);var u=new m.Da;return this.sy(a,!1,u),m.ip.nj(u,this.Jc,2)},h.prototype.xy=function(a,u,d,g,v,b){var S=a[0],C=a[a.length-1],O=S.y>C.y?S.y:C.y,R=m.F.q(this.Tb,this.kc,S.ya.Ke()&&(this.UV(a),!0)},h.prototype.OI=function(a,u,d){var g=d.I(),v=0b.x?(b=this.zq,g.gg(-this.Js,0)):(b=-this.zq,g.gg(this.Js,0)),u.add(a,!1),a.Oa(),d.add(u,!1),d.Oc(g),v=new m.l,d.A(v),v.W((this.Js-v.R())/2,0),v.G=-this.zq,v.H=this.zq;for(var C=0;C=S));)m.kb.yi(a,u,v.x,v.y,g,me,G,K),O?q.ma(G.u,K.u):(ee.ma(G.u,K.u),h.gJ(v.x,ee.x,oe.x,R),q.ma(R[0]+ee.x,ee.y),oe.L(q)),q.scale(d),$.wf(0,-1,q),b=me,me=ge++*C}},h.dJ=function(a,u,d,g,v,b,S,C,O,R){var $=new m.h,N=new m.h,B=new m.ga(0),G=new m.ga(0);for(m.kb.yi(a,u,g.x,g.y,d,v,B,G),$.ma(B.u,G.u),m.kb.yi(a,u,g.x,g.y,d,b,B,G),N.ma(B.u,G.u),d=new m.ga(0),m.kb.Xy(a,u,S.x,S.y,$.x,$.y,d),O[0]=d.u,m.kb.Xy(a,u,S.x,S.y,N.x,N.y,d),R[0]=d.u;O[0]<=R[0];)O[0]+=6.283185307179586;for(;O[0]>R[0];)O[0]-=6.283185307179586;for(;O[0]>=C;)O[0]-=6.283185307179586,R[0]-=6.283185307179586;for(;O[0]b[$]?1:0}),u=a.Ia(),C=0;Cthis.rb/a&&(a=this.rb/500),.01>a&&(a=.01),this.$n=a},h}();m.VK=p}(ie||(ie={})),function(m){var D=function(){function E(){}return E.Mf=function(p,h){var a=new m.h;a.L(h),p.push(a)},E.up=function(p,h){p.add(h.x),p.add(h.y)},E.hB=function(p){p.Bh(p.size-2)},E.oB=function(p,h){h.ma(p.get(p.size-2),p.get(p.size-1))},E.Qr=function(p,h,a,u,d,g){if(p==null)throw m.i.N();var v=p.getType();if(p.B()||m.aa.Rn(v))return p;var b=new E;b.Qg=h,b.Jc=m.cb.sc(h);var S=m.cb.vv(b.Jc);if(b.Ub=g,b.Tb=m.cb.ev(b.Jc),b.kc=S*(2-S),b.ec=b.Jc.Hd().ai,b.Aq=b.Jc.Kn(),b.Zs=b.Aq*b.ec,b.AA=u,b.zA=d,b.ze=a,v==197?(a=new m.Da(p.description)).ad(p,!1):m.aa.yd(v)?(a=new m.Ta(p.description)).oc(p,!0):a=p,b.ze!=4){if((h=b.Qg.Nb(b.Jc)==0?m.cb.zh(a,b.Qg,b.Jc):m.Hh.lj(a,b.Jc)).B())return h;h=E.pI(b.ec,h),h=b.Zy(h),h=m.ip.nj(h,b.Jc,b.ze),b=m.cb.zh(h,b.Jc,b.Qg)}else{if(m.Eg.Sb(h)==2?(p=m.cb.ml(),(h=m.Xj.local().V(a,p,h,g))==p&&(h=new m.Da,p.copyTo(h))):h=m.Hh.lj(a,b.Jc),h.B())return h;b=b.CX(h)}return b},E.pI=function(p,h){var a=new m.l;if(h.xc(a),3.141592653589793>a.R()*p)return h;var u=!1;a=h.Ga();for(var d=new m.h,g=new m.h;a.$a();)for(;a.Ha();){var v=a.ha();if(d.L(v.ac()),g.L(v.wc()),d.scale(p),g.scale(p),3.141592653589793g.x-d.x)for(;-6.283185307179586>g.x-d.x;)g.x+=6.283185307179586;E.Wi(g.x,NaN,G),R.L(g)}else C.L(g),E.AU(C),E.Wi(C.x,B,G),R.ma(G[0]+C.x,C.y);.5>Math.abs(R.x-g.x)&&R.L(g),S?(v.Tw(0,N),$.L(O),$.scale(1/p),N.Cb($),(b=a.vm())?u.nf(N):u.lineTo(N),a.Qn()&&!h.dc(a.gb)&&(v.Tw(1,N),$.L(R),$.scale(1/p),N.Cb($),u.lineTo(N))):((b=a.vm())&&u.Hz(null,0),v=u.da()-1,$.L(O),$.scale(1/p),u.wf(v,-1,$),a.Qn()&&!h.dc(a.gb)&&($.L(R),$.scale(1/p),u.wf(v,-1,$)))}return u},E.tF=function(p,h,a,u,d,g,v,b,S,C,O,R){var $=new m.h,N=new m.h,B=0ee&&(ee+=6.283185307179586),0>(G=G.u)&&(G+=6.283185307179586),S!=null&&(S[0]=K),C!=null&&(C[0]=ee),O!=null&&(O[0]=G),C=S=NaN,R!=null&&(S=((C=m.F.Ah(p,h))-(O=m.F.q(p,h,u.y)))/K,C=(C+O)/K),O=E.Mu(u,d),G=E.Ku(u,d),ee=O||G;var q=E.FE(u,d,b),oe=new m.ga(0),ge=new m.ga(0),me=new m.h,Me=new m.h,Te=new m.h;E.Wi(u.x,NaN,N);var Fe=[N[0]];if(K<=g)E.Mf($,u),E.Wi(d.x,NaN,N),R!=null&&R.add(0),ee?(O&&E.kB(u,d,R,$),G&&E.iB(u,d,R,$)):q?E.jB(u,d,B,S,C,R,$):0Te.x&&(N[0]+=6.283185307179586,Te.ma(N[0]+me.x,me.y)):We.xv.x?v.x+=6.283185307179586:3.141592653589793yi;yi++)if(We=Xe[yi]*C+(1-Xe[yi])*S,m.kb.oj(p,h,u.x,u.y,We*d,g,K,ee,a),me.ma(K.u,ee.u),yi==0&&(lt=We,Me.L(me)),E.WW(oe,me,ge,Fe),Fe.hc(Fe.fe(me,!0),Te),m.kb.wd(p,h,me.x,me.y,Te.x,Te.y,q,null,null,2),q.u>O){Mt=!0;break}Mt?(ge.L(Me),C=lt,E.up(v,ge),b.add(C)):(E.hB(v),b.En(b.size-1,1,b.size-1),0=v&&on.u<=g&&3.141592653589793>Math.abs(B.x-G.x)||u.Ux(Mt,lt)<=d));Fe++){var Kr=rn[Fe]*lt+(1-rn[Fe])*Mt;if(u.hc(Kr,R),Te?K.ma(R.x*a,R.y*a):(Me[0][0]=R.x,Me[0][1]=R.y,m.cb.vt(),K.x=Me[0][0]*a,K.y=Me[0][1]*a),Fe==0&&(jo=Kr,N.L(R),q.L(K),0g||3.141592653589793<=Math.abs(B.x-G.x)))){dr=!0;break}if(yi&&0g||3.141592653589793<=Math.abs(B.x-K.x)){dr=!0;break}}else if(0v){dr=!0;break}if(yi){if(m.kb.wd(p,h,me.x,me.y,ee.x,ee.y,Ri,null,null,2),Ri.u>v){dr=!0;break}if(m.kb.wd(p,h,ee.x,ee.y,K.x,K.y,Aa,null,null,2),Aa.u>v){dr=!0;break}}}}dr?(O.L(N),G.L(q),lt=jo,E.up(Xe,O),E.up(di,G),Ct.add(lt)):(E.hB(Xe),E.hB(di),Ct.En(Ct.size-1,1,Ct.size-1),E.Mf(S,O),We+=on.u,b!=null&&b.add(We),0Math.abs(h.x-p.x)?(u.Dc(p),3.141592653589793<=a.x-p.x?u.Ql(a.x-6.283185307179586,a.y):3.141592653589793<=p.x-a.x?u.Ql(a.x+6.283185307179586,a.y):u.Ql(a.x,a.y)):(u.Dc(a),3.141592653589793<=p.x-a.x?u.Ql(p.x-6.283185307179586,p.y):3.141592653589793<=a.x-p.x?u.Ql(p.x+6.283185307179586,p.y):u.Ql(p.x,p.y))},E.YJ=function(p,h){for(var a=0;ap.x)for(;-3.141592653589793>p.x;)p.x+=6.283185307179586;if(3.141592653589793E.v+u&&gE?-E:E},D.Mb=function(E,p){return 0<=p?D.P(E):-D.P(E)},D.Y=function(E,p){return E==p||D.P(E-p)<=D.JC*(1+(D.P(E)+D.P(p))/2)},D.Cd=function(E){return E==0||D.P(E)<=D.JC},D.Ah=function(E,p){var h=(p=(1-(p=Math.sqrt(1-p)))/(1+p))*p;return E/(1+p)*(1+h*(.25+h*(.015625+1/256*h)))*D.EL},D.EL=1.5707963267948966,D.JC=3552713678800501e-30,D}()}(ie||(ie={})),function(m){var D=function(p){this.Wf=p,this.Kk=this.Wf.getCode(),0>this.Kk&&(this.Kk=0)};m.DY=D;var E=function(){function p(h){h===void 0&&(h=null),this.Cj=null,this.Un=!1,h!==null&&(this.Cj=new D(h))}return p.prototype.Ec=function(){return this.Cj!=null?this.Cj.Kk:0},p.prototype.Of=function(){var h=new p;return this.copyTo(h),h},p.prototype.copyTo=function(h){h.Cj=this.Cj,h.Un=this.Un},p.prototype.Qz=function(){this.Un=!this.Un},p.prototype.qm=function(){return this.Cj!=null?this.Cj.Wf:null},p.prototype.LJ=function(h){if(0>=h)throw m.i.N();if(h!=this.Ec()){if((h=m.pf.geogtran(h))==null)throw m.i.N("Geogtran not found.");this.Cj=new D(h)}},p.prototype.Bz=function(){return this.Cj==null?null:this.Cj.Wf.toString()},p.prototype.tX=function(h){if(h==null)throw m.i.N();var a=null;try{a=m.pf.fromString(m.Sc.PE_TYPE_GEOGTRAN,h)}catch{throw m.i.N()}this.Cj=new D(a)},p.prototype.Nb=function(h){return h==this||!(!(h instanceof p)||(0>=this.Ec()||this.Ec()!=h.Ec())&&!this.qm().isEqual(h.qm()))&&this.Un==h.Un},p.prototype.toString=function(){var h="GeographicTransformation: "+this.Bz();return 200p.I())},E.BE=function(p){return!(p.B()||p.getType()!=1607&&p.getType()!=1736||20>p.I())},E}();m.Uk=D}(ie||(ie={})),function(m){m.$b=function(){function D(){}return D.TT=function(E){var p=new m.Da;return p.sx(E.es(),E.gs()),p.yj(E.es(),E.fs()),p.yj(E.ds(),E.fs()),p.yj(E.ds(),E.gs()),p},D.zh=function(E,p){return E===null?null:m.Hx.local().V(E,p,null)},D.jY=function(E,p){var h=m.Gh.local();return E=new m.Zc(E),h.V(E,p,null).next()},D.im=function(E,p,h){return m.kp.local().V(E,p,h,null)},D.ep=function(E,p,h){return m.Kx.local().V(E,p,h,null)},D.VX=function(E,p,h){var a=m.Kx.local();for(E=new m.Zc(E),p=new m.Zc(p),h=a.V(E,p,h,null),a=[];(p=h.next())!=null;)a.push(p);return a},D.Nb=function(E,p,h){return m.dj.local().V(3,E,p,h,null)},D.TP=function(E,p,h){return m.dj.local().V(4,E,p,h,null)},D.RS=function(E,p,h){var a=m.Xj.local();for(E=new m.Zc(E),p=new m.Zc(p),h=a.V(E,p,h,null),a=[];(p=h.next())!=null;)a.push(p);return a},D.QP=function(E,p,h){var a=m.kp.local();for(E=new m.Zc(E),p=new m.Zc(p),h=a.V(E,p,h,null),a=[];(p=h.next())!=null;)a.push(p);return a},D.Ea=function(E,p,h){return m.Xj.local().V(E,p,h,null)},D.QS=function(E,p,h){if((E=m.Xj.local().V(E,p,h,null,1))===null)return[];if(E.getType()===550){for(p=[],h=0;hE.Db())return 0;var a=null;if(p!=null){if(a=p.Hd(),h!=null&&a.Ec()!=h.Ec()&&a.od!=h.od)throw m.i.Xk()}else if(h!=null)throw m.i.N();E.getType()==1736||E.getType()==197?p=E.mg():m.aa.yd(E.getType())?(p=new m.Ta(E.description)).oc(E,!0):p=E,E=0,p=p.Ga();for(var u=new m.h,d=new m.h;p.$a();)for(;p.Ha();){var g=p.ha();g.Yp(u),g.Tr(d),E+=m.h.tb(u,d)}return a!==null&&h!==null&&(E=m.Tc.Nh(E,a,h)),E},D.fP=function(E){return E.points!==void 0?D.mS(E,E.hasZ!==void 0&&E.hasZ,E.hasM!==void 0&&E.hasM):E.rings!==void 0?D.lG(E.rings,E.hasZ!==void 0&&E.hasZ,E.hasM!==void 0&&E.hasM,"P"):E.paths!==void 0?D.lG(E.paths,E.hasZ!==void 0&&E.hasZ,E.hasM!==void 0&&E.hasM,"L"):E.x!==void 0?D.nS(E):E.xmin!==void 0?D.lS(E):null},D.nS=function(E){if(E.x==null||E.x=="NaN")return new m.Sa;var p=new m.Sa(E.x,E.y);return E.z!==void 0&&E.z!==null&&p.wX(E.z),E.m!==void 0&&E.m!==null&&p.hX(E.m),p},D.lS=function(E){if(E.xmin==null||E.xmin=="NaN")return new m.Fh;var p=new m.Fh(E.xmin,E.ymin,E.xmax,E.ymax);return E.zmin!==void 0&&E.zmin!==null&&p.setInterval(1,0,E.zmin,E.zmax),E.mmin!==void 0&&E.mmin!==null&&p.setInterval(2,0,E.mmin,E.mmax),p},D.mS=function(E,p,h){var a=0,u=new m.de,d=3*E.points.length;d%2!=0&&d++,2>d&&(d=2);var g=m.O.truncate(3*E.points.length/2);4>g?g=4:16>g&&(g=16),d=m.Yc.Dn(d,0);var v=m.Yc.Dn(g);g=m.Yc.Dn(g);for(var b=0;b=d?(R[$]=!1,C+=1,v.add(S),b.add(u),S+=N):R[$]=!0}for((a=3*S)%2!=0&&a++,2>a&&(a=2),4>($=m.O.truncate(3*S/2))?$=4:16>$&&($=16),a=m.Yc.Dn(a,0),u=m.Yc.Dn($),d=m.Yc.Dn($),$=N=0;$v)throw m.i.N();this.Qi.oa=g-b,this.Qi.va=v+b,this.hi.resize(0),this.he=0,this.sg[0]=0},d.prototype.Uo=function(g,v){this.Qi.oa=g-v,this.Qi.va=g+v,this.hi.resize(0),this.he=0,this.sg[0]=0},d.prototype.next=function(){if(!this.Ya.lq)throw m.i.Hb();if(0>this.he)return-1;for(var g=!0;g;)switch(this.sg[this.he]){case 1:g=this.FU();break;case 2:g=this.GU();break;case 3:g=this.HU();break;case 4:g=this.IU();break;case 5:g=this.GW();break;case 6:g=this.kT();break;case 7:g=this.tN();break;case 0:g=this.Gz();break;default:throw m.i.Qa()}return this.Og!=-1?this.Mp()>>1:-1},d.construct=function(g){var v=new d;return v.Ya=g,v.hi.Jb(20),v.he=-1,v},d.prototype.Gz=function(){return this.Og=this.vH=this.Mi=this.Lc=-1,this.Ya.me!=null&&0=this.Qi.oa?(this.ei=this.QR(),!1):(this.he--,!0)},d.prototype.tN=function(){return this.Og=this.ei,this.Og!=-1&&u.gq(this.Mp())?(this.ei=this.SF(),!1):(this.he--,!0)},d.prototype.SF=function(){return this.Ya.Sf?this.Ya.$f.lb(this.Og):this.Ya.Ti.lb(this.Og)},d.prototype.QR=function(){return this.Ya.Sf?this.Ya.$f.we(this.Og):this.Ya.Ti.we(this.Og)},d.prototype.Mp=function(){return this.Ya.Sf?this.Ya.$f.ja(this.Og):this.Ya.Ti.getData(this.Og)},d}();m.EY=a;var u=function(){function d(g){this.Am=this.$h=this.$f=this.Ti=this.Km=this.Ej=this.me=this.Fj=null,this.Sf=g,this.lq=this.Sv=!1}return d.prototype.kr=function(){this.Nk(!0)},d.prototype.Br=function(g,v){if(!this.Sv)throw m.i.Hb();this.Fj.push(new m.Nc(g,v))},d.prototype.Fp=function(){if(!this.Sv)throw m.i.fa("invalid call");this.Sv=!1,this.lq=!0,this.Sf||(this.vS(),this.Zv=this.Fj.length)},d.prototype.vj=function(g){if(!this.Sf||!this.lq)throw m.i.N("invalid call");if(this.kf==-1){var v=this.Fj.length;if(this.iA){var b=new m.ia(0);b.Jb(2*v),this.bJ(b),this.$h.Jb(2*v),this.$h.resize(0),this.aJ(b),this.Km.resize(v,-1),this.Km.Wj(-1,0,v),this.iA=!1}else this.Km.Wj(-1,0,v);this.kf=this.Tu()}v=this.pG(g<<1,this.kf),b=this.$f.addElement(1+(g<<1),this.xz(v)),this.VJ(v,b),this.Km.set(g,v),this.Zv++},d.prototype.remove=function(g){if(!this.Sf||!this.lq)throw m.i.fa("invalid call");var v=this.Km.get(g);if(v==-1)throw m.i.N("the interval does not exist in the interval tree");this.Km.set(g,-1),this.Zv--;var b=this.xz(v),S=this.$f.ZR(b);this.$f.vd(this.wR(v),b),this.$f.vd(this.TR(v),b),(g=this.$f.size(b))==0&&(this.$f.MP(b),this.ZJ(S,-1)),this.Ej.jd(v),b=this.UF(S);var C=this.qj(S),O=this.lk(S);for(v=0;!(0>1);C!=-1?this.VJ(C,this.Ti.addElement(this.xz(C),S)):(C=this.pG(S,this.kf),b.set(S>>1,C))}},d.prototype.pG=function(g,v){var b=v,S=v,C=-1,O=0,R=this.$h.size-1,$=0,N=g>>1,B=NaN,G=NaN,K=!0,ee=this.DR(N);for(N=this.AR(N);K;){Oq&&(qq)v!=-1&&(v==b?(S=b,B=q,G=(v=this.lk(b))!=-1?this.Np(v):NaN):G>1];return d.gq(g)?v.oa:v.va},d}();m.sr=u}(ie||(ie={})),function(m){var D=function(){function E(p){if(p==null)throw m.i.fa("Invalid arguement");this.hf=p;var h=p.nR();h.hS()?p.ef.IG()?this.lo=m.si.PannableFold:this.lo=m.si.Clip:this.lo=m.si.DontClip,h.iS()?p.Yf.IG()?this.Qm=m.si.PannableFold:this.Qm=m.si.Clip:this.Qm=m.si.DontClip,this.Bm=h.Jr,this.mH=h.Vu,p=this.hf.sH,this.aH=p.hs(2147483648),this.Uv=p.hs(1073741824)}return E.zh=function(p,h,a){return h.ww.zh(p,a)},E.Rt=function(p,h,a,u){return p.ww.Rt(h,a,u)},E.Qt=function(p,h,a,u){if(a=0>a?h.length:a,(p=p.ww.Rt(h,a,u))==a)return p;for(var d=h=0;dd.H){var N=m.l.construct(b.v-1,d.G,b.C+1,d.H);if(($=m.ri.Nu($,N,a,NaN,0,h)).B())return $}b.R()>2*d.R()&&($=m.zb.Hp($,-2*d.R(),2*d.R(),a,!0,0,!0,h))}b=this.mH,(d=!isNaN(b))&&($=m.Xl.local().V($,b,h)),N=C?u.kk():null;var B=NaN;S&&(B=a.zi());var G=u.Wr()!=null;if(this.aH)S&&(m.zb.ur(a,B,$,v),d&&(S=a.hh(),b*=(B=a.sc().hh())/S)),m.zb.tr(this.hf,$,R,v),d&&(S=a.sc().hh(),b*=(B=u.sc().hh())/S),a=$;else{var K=new m.Ta($.description);K.DD($),S&&(m.zb.ur(a,B,K,v),d&&(S=a.hh(),b*=(B=a.sc().hh())/S)),m.zb.tr(this.hf,K,R,v),d&&(S=a.sc().pm(),b*=(B=u.sc().pm())/S),R=NaN,C?(N=u.kk(),R=u.zi()):isNaN(this.Bm)||(R=this.Bm),S=E.tv(a)|E.tv(u),B=10*O.Xd(0),this.Uv&&(S=3,B=0),a=m.zb.UQ($,a,K,O,R,h,S,B)}return G&&(a=m.zb.XD(a,u,h)),C&&(g||(C=O.Oe().R(),a.Tg(0,0).R()>=C-O.Xd(0)&&(O=N.getNorthPoleLocation(),C=N.getSouthPoleLocation(),$=N.getNorthPoleGeometry(),N=N.getSouthPoleGeometry(),R=0,$==m.Cg.PE_POLE_POINT&&O!=m.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(R=1),N==m.Cg.PE_POLE_POINT&&C!=m.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(R|=2),R!==0&&(g=!0))),a=m.zb.Mz(a,u,this.Qm,h),d&&(a=m.Xl.local().V(a,b,h)),m.zb.Lx(u,a,v)),a.B()||(g&&(a=m.Yl.local().V(a,u,!1,h)),p!=null&&(a=p.Zk(a,!1),this.wp(p,m.bm.reverse,a),a=p.$k(a,!1))),a},E.tv=function(p){if(p.Sb()!=2)return 0;var h=0,a=p.kk();p=a.getNorthPoleLocation();var u=a.getSouthPoleLocation(),d=a.getNorthPoleGeometry();return a=a.getSouthPoleGeometry(),d==m.Cg.PE_POLE_POINT&&p!=m.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(h=1),a==m.Cg.PE_POLE_POINT&&u!=m.Cg.PE_POLE_OUTSIDE_BOUNDARY&&(h|=2),h},E.prototype.hW=function(p,h){var a=this.hf.ef,u=this.hf.Yf,d=a.Sb(),g=u.Sb(),v=m.O.Fu(Math.min(p.I(),64)),b=m.Ta.jg(p);d==3&&(d=(a=(p=a.Ji).fk()).Sb(),b=p.$k(b,!0),this.wp(p,m.bm.forward,b),b=p.Zk(b,!0)),p=null,g==3&&(g=(u=(p=u.Ji).fk()).Sb());var S=d==2;d=(g=g==2)?u.sc():u;var C=!g&&!this.Uv;if(S){if((b=m.zb.UI(b,a,this.lo,h)).B())return b}else{var O=new m.l;b.xc(O);var R=a.Oe();if((O.GR.H)&&(O=m.l.construct(O.v-1,R.G,O.C+1,R.H),(b=m.ri.Nu(b,O,a,NaN,0,h)).B()))return b}var $=NaN;S&&($=a.zi()),O=u.Wr()!=null,R=this.mH;var N=!isNaN(R);if(N&&(b=m.Xl.local().V(b,R,h)),this.aH)S&&m.zb.ur(a,$,b,v),N&&(S=a.hh(),R*=($=a.sc().hh())/S),m.zb.tr(this.hf,b,C,v),N&&(S=a.sc().hh(),R*=($=u.sc().hh())/S),a=b;else{var B=new m.Ta(b.description);B.DD(b),S&&(m.zb.ur(a,$,B,v),N&&(S=a.hh(),R*=($=a.sc().hh())/S)),m.zb.tr(this.hf,B,C,v),N&&(S=a.sc().hh(),R*=($=u.sc().hh())/S),C=NaN,g?C=u.zi():isNaN(this.Bm)||(C=this.Bm),S=E.tv(a)|E.tv(u),$=10*d.Xd(0),this.Uv&&(S=3,$=0),a=m.zb.VQ(b,a,B,d,C,h,S,$)}return O&&(a=m.zb.XD(a,u,h)),g&&(a=m.zb.Mz(a,u,this.Qm,h),N&&(a=m.Xl.local().V(a,R,h)),m.zb.Lx(u,a,v)),a.B()||p!=null&&(a=p.Zk(a,!1),this.wp(p,m.bm.reverse,a),a=p.$k(a,!1)),a},E.prototype.eW=function(p,h){var a=(p.ca()+p.R())/400;return a!=0?(a=m.Xl.local().V(p,a,h),a=this.VI(a,h),h=p.Ia(),a.bn(h)):(h=new m.Sa(p.Ip()),a=this.XI(h),h=p.Ia(),a.B()?h.Oa():(p.copyTo(h),p=a.D(),h.K(p.x,p.y,p.x,p.y))),h},E.prototype.fW=function(p,h){p=m.aa.jg(p);var a=this.hf.ef,u=this.hf.Yf,d=a.Sb(),g=u.Sb(),v=m.O.Fu(Math.min(p.I(),64));if(d==3){var b=a.Ji;d=(a=b.fk()).Sb(),p=b.Zk(p,!0),this.wp(b,m.bm.forward,p),p=b.$k(p,!0)}if(d==2){if(this.lo==m.si.Clip?p=m.Xj.local().V(p,a.ml(),a,h):a.Wc()&&(d=new m.l,p.xc(d),a.Oe().contains(d)||(this.lo==m.si.PannableFold&&(p=m.zb.lj(p,a)),m.zb.Jt(p,a.Oe(),a.Xd(0),!0),p=m.zb.Fn(p,a,0,!0,0,h))),p.B())return p;m.zb.ur(a,0,p,v)}else m.zb.Jt(p,a.Oe(),a.Xd(0),!0);return m.zb.tr(this.hf,p,!1,v),a=0,d=!1,b=null,g==3&&(d=!0,g=(u=(b=u.Ji).fk()).Sb()),(g=g==2)?a=u.zi():isNaN(this.Bm)||(a=this.Bm),g&&this.Qm!=m.si.Clip||(p=m.zb.Fn(p,u.sc(),a,!1,0,h)),g&&(p=m.zb.Mz(p,u,this.Qm,h),m.zb.Lx(u,p,v),p.B())||d&&(p=b.Zk(p,!0),this.wp(b,m.bm.reverse,p),p=b.$k(p,!0)),p},E.prototype.wp=function(p,h,a){var u=a.I();if(u!=0){for(var d=a.ub(0),g=m.O.lg(200,0),v=[],b=0;bd.v+g&&bh?this.wv(a,u):this.gv(a,u);case 1:var d=this.wv(a,u);return a=this.gv(a,u),m.lc.hq(d,a,h);case 2:throw m.i.fa("not implemented")}throw m.i.Qa()},p.prototype.fe=function(h,a){var u=this.pa-this.sa,d=this.la-this.na,g=u*u+d*d;return g==0?.5:(h=((h.x-this.sa)*u+(h.y-this.na)*d)/g,a||(0>h?h=0:1(a=(a-this.na)/h)||1(a=(a-this.sa)/h)||1(a=8881784197001252e-31*(Math.abs(u.x*a.y)+Math.abs(u.y*a.x)))?-1:h<-a?1:0},p.prototype.rp=function(h,a,u,d){var g=this.sa,v=this.na,b=h-g,S=a-v;if((b=Math.sqrt(b*b+S*S))<=Math.max(u,6661338147750939e-31*b))return d&&b==0?NaN:0;if(b=h-this.pa,S=a-this.la,(b=Math.sqrt(b*b+S*S))<=Math.max(u,6661338147750939e-31*b))return d&&b==0?NaN:1;if(b=this.pa-this.sa,S=this.la-this.na,0<(d=Math.sqrt(b*b+S*S))){var C=1/d,O=h-g,R=a-v,$=O*(b*=C)+R*(S*=C),N=17763568394002505e-31*(Math.abs(O*b)+Math.abs(R*S)),B=b;if(b=-S,S=B,$<-(N=Math.max(u,N))||$>d+N)return NaN;if(Math.abs(O*b+R*S)<=Math.max(u,17763568394002505e-31*(Math.abs(O*b)+Math.abs(R*S)))&&(.5>=(b=m.O.Rk($*C,0,1))?(S=this.sa+(this.pa-this.sa)*b,d=this.na+(this.la-this.na)*b):(S=this.pa-(this.pa-this.sa)*(1-b),d=this.la-(this.la-this.na)*(1-b)),m.h.Oy(S,d,h,a)<=u)){if(.5>b){if(m.h.Oy(S,d,g,v)<=u)return 0}else if(m.h.Oy(S,d,this.pa,this.la)<=u)return 1;return b}}return NaN},p.prototype.Nb=function(h){return h!=null&&(h==this||h.constructor===this.constructor&&this.FM(h))},p.prototype.rD=function(h,a,u){var d=u?this.sa:this.pa;u=u?this.na:this.la;var g=new m.h;return g.x=h.pa-d,g.y=h.la-u,!(a.Qh(g)>6661338147750939e-31*a.fD(g))||(g.x=h.sa-d,g.y=h.na-u,a.Qh(g)<=6661338147750939e-31*a.fD(g))},p.prototype.qD=function(h){var a=new m.h;return a.x=this.pa-this.sa,a.y=this.la-this.na,!!this.rD(h,a,!1)&&(a.Sq(),!!this.rD(h,a,!0))},p.NM=function(h,a){var u=h.uu(a.sa,a.na),d=h.uu(a.pa,a.la);return!(0>u&&0>d||0u&&0>d||0(d=a.Qb())?h.qD(a):a.qD(h)))},p.LM=function(h,a,u){var d=m.h.construct(NaN,NaN),g=h.pa-h.sa,v=h.la-h.na,b=a.pa-a.sa,S=a.la-a.na,C=b*v-g*S;if(C==0)return d;var O=8881784197001252e-31*(Math.abs(b*v)+Math.abs(g*S)),R=a.sa-h.sa,$=a.na-h.na,N=b*$-R*S,B=N/C,G=Math.abs(C);return B<-(b=(8881784197001252e-31*(Math.abs(b*$)+Math.abs(R*S))*G+O*Math.abs(N))/(C*C)+2220446049250313e-31*Math.abs(B))||B>1+b||(b=(S=g*$-R*v)/C)<-(g=(8881784197001252e-31*(Math.abs(g*$)+Math.abs(R*v))*G+O*Math.abs(S))/(C*C)+2220446049250313e-31*Math.abs(b))||b>1+g||(B=m.O.Rk(B,0,1),g=m.O.Rk(b,0,1),v=h.hc(B),C=a.hc(g),(O=new m.h).uc(v,C),O.length()>u&&(O.add(v,C),O.scale(.5),B=h.fe(O,!1),g=a.fe(O,!1),h=h.hc(B),a=a.hc(g),h.sub(a),h.length()>u)||d.ma(B,g)),d},p.OM=function(h,a,u,d){var g=0;if((h.sa==a.sa&&h.na==a.na||h.sa==a.pa&&h.na==a.la)&&(g++,!d))return 1;if(h.pa==a.sa&&h.la==a.na||h.pa==a.pa&&h.la==a.la){if(++g==2)return 2;if(!d)return 1}return a.vi(h.sa,h.na,u)||a.vi(h.pa,h.la,u)||h.vi(a.sa,a.na,u)||h.vi(a.pa,a.la,u)?1:d&&g!=0||p.NM(h,a)==0?0:1},p.Zx=function(h,a,u,d,g,v){var b=0,S=h.rp(a.sa,a.na,v,!1),C=h.rp(a.pa,a.la,v,!1),O=a.rp(h.sa,h.na,v,!1),R=a.rp(h.pa,h.la,v,!1);return isNaN(S)||(d!=null&&(d[b]=S),g!=null&&(g[b]=0),u!=null&&(u[b]=m.h.construct(a.sa,a.na)),b++),isNaN(C)||(d!=null&&(d[b]=C),g!=null&&(g[b]=1),u!=null&&(u[b]=m.h.construct(a.pa,a.la)),b++),b==2||isNaN(O)||S==0&&O==0||C==0&&O==1||(d!=null&&(d[b]=0),g!=null&&(g[b]=O),u!=null&&(u[b]=m.h.construct(h.sa,h.na)),b++),b==2||isNaN(R)||S==1&&R==0||C==1&&R==1||(d!=null&&(d[b]=1),g!=null&&(g[b]=R),u!=null&&(u[b]=m.h.construct(a.pa,a.la)),b++),0d[1]&&(h=d[0],d[0]=d[1],d[1]=h,g!=null&&(d=g[0],g[0]=g[1],g[1]=d),u!=null&&(g=m.h.construct(u[0].x,u[0].y),u[0]=u[1],u[1]=g)),b):(b=p.LM(h,a,v),isNaN(b.x)?0:(u!=null&&(u[0]=h.hc(b.x)),d!=null&&(d[0]=b.x),g!=null&&(g[0]=b.y),1))},p.prototype.eG=function(){return 0},p.prototype.op=function(){},p.prototype.toString=function(){return"Line: ["+this.sa.toString()+", "+this.na.toString()+", "+this.pa.toString()+", "+this.la.toString()+"]"},p}(m.SC);m.yb=D}(ie||(ie={})),function(m){var D=function(){function E(){this.Jm=[],this.ya=-1}return E.prototype.La=function(){return this.ya},E.prototype.next=function(){if(this.Jm!=null&&this.Jm.length!=0){this.ya++;var p=this.Jm[0];return this.Jm=1>=this.Jm.length?[]:this.Jm.slice(1),p}return this.Jm=null},E.prototype.ZX=function(p){this.Jm.push(p)},E.prototype.qe=function(){},E}();m.gL=D}(ie||(ie={})),function(m){var D;(D=m.SL||(m.SL={}))[D.enumFillRuleOddEven=0]="enumFillRuleOddEven",D[D.enumFillRuleWinding=1]="enumFillRuleWinding";var E=function(p){function h(a,u){var d=p.call(this)||this;if(d.xf=!1,d.Eq=null,d.sq=0,d.rq=0,d.Aj=null,d.Mg=!1,d.nb=null,d.mb=null,d.Ve=null,d.Lj=null,d.Sd=null,d.tq=0,d.gb=0,d.xq=0,u===void 0)d.xf=a,d.Mg=!1,d.tq=0,d.sq=0,d.rq=0,d.wa=0,d.description=m.ee.og();else{if(u==null)throw m.i.N();d.xf=a,d.Mg=!1,d.tq=0,d.sq=0,d.rq=0,d.wa=0,d.description=u}return d.Aj=null,d.gb=0,d}return Ke(h,p),h.prototype.tm=function(){return 0u)throw m.i.Qa();if(this.dc(a)){if(this.mb==null)throw m.i.Qa();var d=this.wa,g=this.Ba(a),v=this.Vc(a);this.dm(this.wa+1),this.mc();for(var b=0,S=this.description.Aa;ba;u--)d=this.nb.read(u),this.nb.write(u,d+1);this.mb.KE(a,1)}},h.prototype.Ap=function(){if(this.wx(),a===void 0){this.Mg=!1;var a=this.da()-1}var u=this.mb.read(a);this.mb.write(a,1|u),this.Ve!=null&&(a=this.Vc(a)-1,this.Ve.write(a,1),this.Lj.write(a,-1))},h.prototype.dc=function(a){return(1&this.mb.read(a))!=0},h.prototype.Nn=function(a){if(this.dc(a))return!0;var u=this.Ba(a);return!(u>(a=this.Vc(a)-1))&&(u=this.Na(u),a=this.Na(a),u.qb(a))},h.prototype.yv=function(a){return(2&this.mb.read(a))!=0},h.prototype.oc=function(a,u){if(this.Jl(a.description),a.getType()!=322)throw m.i.Qa();var d=new m.Sa;(u||this.B())&&(a.To(d),this.nf(d)),a.Po(d),this.lineTo(d)},h.prototype.tp=function(a){var u=this.wa==0;this.sx(a.v,a.G),this.yj(a.v,a.H),this.yj(a.C,a.H),this.yj(a.C,a.G),this.Ap(),this.Mg=!1,u&&this.Lf(256,!1)},h.prototype.ad=function(a,u){if(!a.B()){for(var d=this.wa==0,g=new m.Sa(this.description),v=0;4>v;v++)a.Hf(u?4-v-1:v,g),v==0?this.nf(g):this.lineTo(g);this.Ap(),this.Mg=!1,d&&!u&&this.Lf(256,!1)}},h.prototype.add=function(a,u){for(var d=0;du&&(u=a.da()-1),u>=a.da()||0>d||0>g||g>a.rv(u))throw m.i.fa("index out of bounds");if(g!=0){var b=a.dc(u)&&d+g==a.rv(u);if(!b||g!=1){if(this.Mg=!1,this.Jl(a.description),d=a.Ba(u)+d+1,v&&(g++,d--),b&&g--,b=this.wa,this.dm(this.wa+g),this.mc(),v){if(g==0)return;this.nb.add(this.wa),v=a.mb.read(u),v&=-5,this.xf&&(v|=1),this.mb.write(this.mb.size-1,v),this.mb.add(0)}else this.nb.write(this.mb.size-1,this.wa);v=0;for(var S=this.description.Aa;vR||a.za[R]==null?this.za[v].Ln(O*b,m.ra.se(C),g*O,O*b):this.za[v].Mn(O*b,a.za[R],O*d,g*O,!0,O,O*b)}if(this.tm()||a.yv(u))throw m.i.Qa();this.Pc(1993)}}},h.prototype.oJ=function(){for(var a=0,u=this.da();a=this.da())throw m.i.N();var u=this.Ba(a),d=this.Ja(a);a=this.dc(a)?1:0;for(var g=0,v=this.description.Aa;ga&&(a=u-1),a>=u)throw m.i.N();for(var d=this.Ba(a),g=this.Ja(a),v=0,b=this.description.Aa;v=u.da())throw m.i.N();var v=this.da();if(a>v)throw m.i.N();0>a&&(a=v),0>d&&(d=u.da()-1),this.Mg=!1,this.Jl(u.description),u.mc();var b=u.Ba(d),S=u.Ja(d),C=this.wa,O=u.dc(d)&&!g?1:0;this.dm(this.wa+S),this.mc();for(var R=a=a+1;g--)b=this.nb.read(g-1),this.nb.write(g,b+S);for(u.yv(d),this.mb.add(0),g=v-1;g>=a+1;g--)v=this.mb.read(g),v&=-5,this.mb.write(g+1,v);v=u.JR().read(d),v&=-5,this.xf&&(v|=1),this.mb.write(a,v)},h.prototype.Hz=function(a,u){var d=-1,g=this.da();if(d>g)throw m.i.N();0>d&&(d=g),this.Mg=!1;var v=this.wa;this.dm(this.wa+u),this.mc();var b=d=d+1;v--)b=this.nb.read(v-1),this.nb.write(v,b+u);for(this.mb.add(0),v=g-1;v>=d+1;v--)u=this.mb.read(v),u&=-5,this.mb.write(v+1,u);this.xf&&this.mb.write(d,1)},h.prototype.qG=function(a,u,d){var g=-1;if(0>a&&(a=this.da()),a>this.da()||g>this.Ja(a)||d>u.length)throw m.i.fa("index out of bounds");if(d!=0){a==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>g&&(g=this.Ja(a)),this.mc();var v=this.wa;this.dm(this.wa+d),this.mc();for(var b=0,S=this.description.Aa;ba&&(a=this.da()),a>=g||u>this.Ja(a))throw m.i.fa("index out of bounds");a==this.da()&&(this.nb.add(this.wa),this.xf?this.mb.add(1):this.mb.add(0)),0>u&&(u=this.Ja(a));var v=this.wa;this.dm(this.wa+1),this.mc();var b=this.Ba(a);this.za[0].vj(2*(b+u),d,2*v),d=1;for(var S=this.description.Aa;da&&(a=d-1),a>=d||u>=this.Ja(a))throw m.i.fa("index out of bounds");this.mc();var g=this.Ba(a);0>u&&(u=this.Ja(a)-1),u=g+u,g=0;for(var v=this.description.Aa;g=a+1;d--)u=this.nb.read(d),this.nb.write(d,u-1);this.wa--,this.Pg--,this.Pc(1993)},h.prototype.uE=function(a,u,d){var g=this.Ba(a)+u;if((d=this.Ba(d)+void 0)g||d>this.I()-1)throw m.i.N();u=0,(a=this.Ga()).Vb(g);do{for(;a.Ha()&&(g=a.ha(),a.wb()!=d);)u+=g=g.Qb();if(a.wb()==d)break}while(a.$a());return u},h.prototype.fO=function(a,u,d){if(u=this.Ba(a)+u,d=this.Ba(a)+d,0>u||d>this.I()-1)throw m.i.N();var g=this.Ga();if(u>d){if(!this.dc(a))throw m.i.N("cannot iterate across an open path");g.JB()}var v=a=0;g.Vb(u);do v+=a,a=g.ha().Qb();while(g.wb()!=d);return v},h.prototype.mg=function(){return m.pi.gm(this,null)},h.prototype.KS=function(a,u,d){for(var g=a;gu){var b=this.tm(),S=0;u=this.wa}else b=this.yv(u),S=this.Ba(u),u=this.Vc(u);for(;S=this.Ba(u))return u;u--}else u++;if(0<=u&&u=this.Ba(u)&&ad){for(u=0;uu;){var g=u+(d-u>>1);if(a=(u=this.Vc(g))))return this.gb=g;u=g+1}}return this.gb=u},h.prototype.yz=function(){var a=this.I();if(!this.xf){a-=this.da();for(var u=0,d=this.da();ud.RR()))return!0;this.Bb.yD(null)}return d=m.Nx.create(this,a,u),this.Bb.yD(d),!0},h.prototype.cc=function(){var a=p.prototype.cc.call(this);if(!this.Ac()){var u=this.da();this.nb!=null&&this.nb.An(a,0,u+1),this.mb!=null&&this.mb.An(a,0,u)}return a},h.prototype.ZF=function(a){return this.Ve!=null?this.Ve.read(a):1},h.prototype.bc=function(a,u,d){var g=this.sz(a);if(a==this.Vc(g)-1&&!this.dc(g))throw m.i.fa("index out of bounds");this.mc();var v=this.Ve,b=1;if(v!=null&&(b=7&v.read(a)),b!==1)throw m.i.Qa();if(u.Or(),u=u.get(),d?u.Nf(m.ee.og()):u.Nf(this.description),g=a==this.Vc(g)-1&&this.dc(g)?this.Ba(g):a+1,v=new m.h,this.D(a,v),u.Dc(v),this.D(g,v),u.Qc(v),!d)for(d=1,v=this.description.Aa;d=this.da())throw m.i.N();if(this.B())u.Oa();else{if(this.yv(a))throw m.i.fa("not implemented");var d=this.ub(0),g=new m.h,v=new m.l;v.Oa();var b=this.Ba(a);for(a=this.Vc(a);bthis.I())&&(a=m.ta.nE(this),this.Bb.WM(a),!0)},h.prototype.hM=function(){if(this.Bb==null&&(this.Bb=new m.Uk),this.Bb.zo==null){this.Bb.xD(null);var a=m.ta.YN(this);this.Bb.xD(a)}},h.prototype.Yo=function(a){this.xq=a},h.prototype.In=function(){return this.xq},h.prototype.DD=function(a){if(this==a)throw m.i.fa("MultiPathImpl.add");for(var u=this.da(),d=0;d=(u=this.Vc(u))||au?h.I():u,0>a||a>h.I()||ua?u:a,0>u||0>a)throw m.i.N();if(a!=0){u=a-0,a=this.wa,this.resize(this.wa+u);for(var d=0;dh||h>=this.I())throw m.i.fa("index out of bounds");this.mc();for(var a=0,u=this.description.Aa;aa||a>=this.wa||uh?h:E},D.Th=function(E,p){var h=5381;return((h=((h=((h=p!==void 0?(p<<5)+p+(255&E):(h<<5)+h+(255&E))<<5)+h+(E>>8&255))<<5)+h+(E>>16&255))<<5)+h+(E>>24&255)&2147483647},D.uj=function(){throw Error("Not Implemented")},D.bB=function(E){return D.aU(E)+12345&2147483647},D.XG=function(E){var p=32,h=E%D.Qx|0,a=E/D.Qx|0;return(p&=63)==0?E:(32>p?(E=h>>>p|a<<32-p,p=a>>p):(E=a>>p-32,p=0<=a?0:-1),p*D.Qx+(E>>>0))},D.aU=function(E){var p=1103515245,h=65535&p;return((p-h)*(E|=0)|0)+(h*E|0)|0},D.truncate=function(E){return 0>E?-1*Math.floor(Math.abs(E)):Math.floor(E)},D.MAX_SAFE_INTEGER=Math.pow(2,53)-1,D.MIN_SAFE_INTEGER=-D.MAX_SAFE_INTEGER,D.VC=65536,D.Qx=D.VC*D.VC,D}()}(ie||(ie={})),function(m){var D;(D=m.CL||(m.CL={}))[D.Project=0]="Project",D[D.Union=1]="Union",D[D.Difference=2]="Difference",D[D.Proximity2D=3]="Proximity2D",D[D.Relate=4]="Relate",D[D.Equals=5]="Equals",D[D.Disjoint=6]="Disjoint",D[D.Intersects=7]="Intersects",D[D.Within=8]="Within",D[D.Contains=9]="Contains",D[D.Crosses=10]="Crosses",D[D.Touches=11]="Touches",D[D.Overlaps=12]="Overlaps",D[D.Buffer=13]="Buffer",D[D.Distance=14]="Distance",D[D.Intersection=15]="Intersection",D[D.Clip=16]="Clip",D[D.Cut=17]="Cut",D[D.DensifyByLength=18]="DensifyByLength",D[D.DensifyByAngle=19]="DensifyByAngle",D[D.LabelPoint=20]="LabelPoint",D[D.GeodesicBuffer=21]="GeodesicBuffer",D[D.GeodeticDensifyByLength=22]="GeodeticDensifyByLength",D[D.ShapePreservingDensify=23]="ShapePreservingDensify",D[D.GeodeticLength=24]="GeodeticLength",D[D.GeodeticArea=25]="GeodeticArea",D[D.Simplify=26]="Simplify",D[D.SimplifyOGC=27]="SimplifyOGC",D[D.Offset=28]="Offset",D[D.Generalize=29]="Generalize",D[D.SymmetricDifference=30]="SymmetricDifference",D[D.ConvexHull=31]="ConvexHull",D[D.Boundary=32]="Boundary",D[D.SimpleRelation=33]="SimpleRelation";var E=function(){function p(){}return p.prototype.getType=function(){return null},p.prototype.wn=function(){},p.prototype.Iu=function(){return!1},p}();m.Je=E}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 13},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.prototype.V=function(h,a,u,d,g){return h instanceof m.aa?(g=new m.Zc(h),this.V(g,a,[u],!1,d).next()):d===!0?(u=new m.BC(h,a,u,!1,g),m.Gh.local().V(u,a,g)):new m.BC(h,a,u,!1,g)},p.instance=null,p}(m.Je);m.AC=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a,u,d){this.ya=-1,this.Rd=p,this.$z=h,this.Cs=a,this.tT=new m.l,this.tT.Oa(),this.eo=-1,this.Ub=d}return E.prototype.next=function(){for(var p;(p=this.Rd.next())!=null;)return this.ya=this.Rd.La(),this.eo+1=p.I():p.da()==1&&(2>=p.I()||m.Zt.JG(p,0)))},E}();m.DC=D}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 17},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.prototype.V=function(h,a,u,d,g){return new m.nL(h,a,u,d,g)},p.instance=null,p}(m.Je);m.mL=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a,u,d){if(this.Tf=null,h==null||a==null)throw m.i.fa("invalid argument");this.qT=p,this.nA=h,this.lH=a,p=m.ta.mv(h,a),this.qa=m.ta.Wd(u,p,!0),this.kH=-1,this.nd=d}return E.prototype.La=function(){return 0},E.prototype.next=function(){return this.RQ(),++this.kHthis.Tf.length&&(this.Tf.length=0)},E.prototype.SQ=function(){var p=new m.ia(0),h=new m.gd,a=h.aF(),u=h.Ib(this.nA),d=h.Ib(this.lH),g=new m.Fg;try{g.Ft(h,this.qa,this.nd),g.dl(a,u,d,p);var v=h.Ne(u),b=new m.Da,S=new m.Da;for(this.Tf.length=0,this.Tf.push(b),this.Tf.push(S),u=0;u=a)throw m.i.N();return new m.oL(h,a,u)},p.instance=null,p}(m.Je);m.Xl=D}(ie||(ie={})),function(m){var D=function(){function E(p,h){this.ya=-1,this.Rd=p,this.Ps=h}return E.prototype.La=function(){return this.ya},E.prototype.next=function(){var p;return(p=this.Rd.next())!=null?(this.ya=this.Rd.La(),this.NP(p)):null},E.prototype.NP=function(p){if(p.B()||1>p.Db())return p;var h=p.getType();if(h==1736||h==1607)return this.Ny(p);if(m.aa.yd(h))return this.PP(p);if(h==197)return this.OP(p);throw m.i.Qa()},E.prototype.PP=function(p){if(p.Qb()<=this.Ps)return p;var h=new m.Ta(p.description);return h.oc(p,!0),this.Ny(h)},E.prototype.OP=function(p){var h=new m.Da(p.description);h.ad(p,!1);var a=new m.l;return p.A(a),p=a.ca(),a.R()<=this.Ps&&p<=this.Ps?h:this.Ny(h)},E.prototype.Ny=function(p){for(var h=p.Ia(),a=p.Ga();a.$a();)for(var u=!0;a.Ha();){var d=a.ha();if(d.getType()!=322)throw m.i.fa("not implemented");var g=a.On(),v=d.Qb();if(v>this.Ps){var b=Math.ceil(v/this.Ps);v=new m.Sa(p.description),u&&(d.To(v),h.nf(v));var S=u=1/b,C=0;for(--b;Cv)return h;var b=h.getType(),S=a.getType(),C=new m.l,O=new m.l,R=new m.l;h.A(C),a.A(O),R.K(C),R.Zb(O);var $=(R=m.ta.Wd(u,R,!0))*Math.sqrt(2)*1.00001,N=new m.l;if(N.K(C),N.W($,$),!N.isIntersecting(O))return h;if(g==1&&v==2)return p.KV(h,a,S,u,d);if(b==33)switch(m.Vk.yd(S)?(u=new m.Ta(a.description),u.oc(a,!0)):u=a,S){case 1736:return p.XU(h,u,R);case 1607:return p.YU(h,u,R);case 550:return p.VU(h,u,R);case 197:return p.UU(h,u,R);case 33:return p.WU(h,u,R);default:throw m.i.N()}else if(b==550)switch(S){case 1736:return p.nU(h,a,R);case 197:return p.lU(h,a,R);case 33:return p.mU(h,a,R)}return m.Fg.im(h,a,u,d)},p.XU=function(h,a,u){return m.hd.KG(a,h,u)==0?h:h.Ia()},p.YU=function(h,a,u){var d=h.D();a=a.Ga();for(var g=u*Math.sqrt(2)*1.00001,v=g*g,b=new m.l;a.$a();)for(;a.Ha();){var S=a.ha();if(S.A(b),b.W(g,g),b.contains(d)){if(S.qs(d,u))return h.Ia();var C=S.ac();if(m.h.yc(d,C)<=v||(C=S.wc(),m.h.yc(d,C)<=v))return h.Ia()}}return h},p.VU=function(h,a,u){var d=a.ub(0);a=a.I();var g=h.D(),v=new m.h;u=u*Math.sqrt(2)*1.00001,u*=u;for(var b=0;ba.I()?this.gE(h,a,u):(this.Nt(),h=this.gE(a,h,u),this.Nt(),h):h.getType()==550&&m.aa.Hc(a.getType())?(h=this.hE(a,h,u),this.Nt(),h):a.getType()==550&&m.aa.Hc(h.getType())?this.hE(h,a,u):h.getType()==550&&a.getType()==550?h.I()>a.I()?this.iE(h,a):(this.Nt(),h=this.iE(a,h),this.Nt(),h):0},p.prototype.gE=function(h,a,u){var d=h.Ga(),g=a.Ga(),v=new m.l,b=new m.l,S=17976931348623157e292;if(!u&&this.pY(h,a,d,g))return 0;for(;d.$a();)for(;d.Ha();)if((h=d.ha()).A(v),!(v.px(this.oh)>S)){for(;g.$a();)for(;g.Ha();)if((a=g.ha()).A(b),v.px(b)v)){for(var O=0;Od)){for(var O=0;Op.Ja(h))){var d=p.Ba(h),g=p.Vc(h)-1,v=p.ub(0),b=p.dc(h),S=new m.ia(0);S.Jb(p.Ja(h)+1);var C=new m.ia(0);for(C.Jb(p.Ja(h)+1),S.add(b?d:g),S.add(d),d=new m.h;1this.DH&&b>g&&(d=u,g=b)}return d},E.prototype.qe=function(){},E}();m.sL=D}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 29},p.prototype.V=function(h,a,u,d){return h instanceof m.aa?(h=new m.Zc(h),this.V(h,a,u,d).next()):new m.sL(h,a,u,d)},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.instance=null,p}(m.Je);m.EC=D}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 21},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.prototype.V=function(h,a,u,d,g,v,b,S){return h instanceof m.aa?(S=new m.Zc(h),this.V(S,a,u,[d],g,v,!1,b).next()):b===!0?(u=new m.GC(h,a,u,d,g,!1,!1,S),m.Gh.local().V(u,a,S)):new m.GC(h,a,u,d,g,!1,!1,S)},p.instance=null,p}(m.Je);m.FC=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a,u,d,g,v,b){if(g)throw m.i.Ie();if(h==null)throw m.i.N();this.ya=-1,this.Ms=p,this.vg=h,this.ze=a,this.Cs=u,this.$n=d,this.eo=-1,this.Ub=b,this.uT=new m.l,this.uT.Oa()}return E.prototype.next=function(){for(var p;(p=this.Ms.next())!=null;)return this.ya=this.Ms.La(),this.eo+1h.Db())return 0;if(u==4)throw m.i.Ie();var d=m.cb.sc(a),g=m.cb.vv(d),v=m.cb.ev(d);g*=2-g;var b=d.Hd().ai,S=h.getType();if(S==1736||S==197)var C=h.mg();else m.aa.yd(S)?(C=new m.Ta(h.description)).oc(h,!0):C=h;if(d.Nb(a)==0){if(m.cb.Wc(a)){C=m.Hh.lj(C,a),S==1607&&C==h&&(C=m.aa.jg(h)),h=new m.Nc,m.cb.gh(a).cn(h),S=0;for(var O=C.I();S=this.Fi||7d||a==0&&h==550&&this.Dj==33?this.nJ():E.HB(p,u);if((this.Fi==-1||this.Fi==4)&&h==197&&this.Dj==197)return a=this.Se,h=new m.l,p.A(h),u=new m.l,a.A(u),h.Ea(u),a=new m.Fh,p.copyTo(a),a.Xo(h),a;if(h==197&&m.aa.tf(this.Dj)==0||this.Dj==197&&m.aa.tf(h)==0)return u=h==197?p:this.Se,p=h==197?this.Se:p,h=new m.l,u.A(h),m.Ud.clip(p,h,a,0);if(m.aa.tf(h)==0&&0b&&(b=a.yz()),g=a.I()+u.I(),b*u.I()>Math.log(g)*g*4)return null;g=null,b=u.Ga(),S!=null&&S.Fb!=null&&(g=S.Fb),g==null&&20q){if(g!=null)for(u==null?u=g.vR(oe,d):u.Uo(oe,d),q=u.next();q!=-1;q=u.next()){b.Vb(g.ja(q)),q=b.ha();var ge=oe.Ea(q,null,C,null,d);for(q=0;qee?($=S.wb()-a.Ba(K),N=1,ee=ee==0?3:2):N++:(p.oc(me,ee==0),ee=1);break;case 0:ee=0,$=-1,N=0;break;default:return null}me=Te}}}else{if(0>(q=this.QD(h,oe.ac(),d)))return null;q==1?(2>ee&&($=S.wb()-a.Ba(K),ee=ee==0?3:2),N++):($=-1,N=0)}O.clear(!1)}else q!=0&&q==1&&(ee==0?(ee=3,$=S.wb()-a.Ba(K)):ee==1?(ee=2,$=S.wb()-a.Ba(K)):N++)}2<=ee&&(p.Dr(a,K,$,N,ee==3),$=-1)}return p},E.prototype.QD=function(p,h,a){return m.Dg.wm(p,h,a)},E.prototype.RD=function(p,h,a){var u=h.ac();h=h.wc();var d=m.Dg.wm(p,u,a),g=m.Dg.wm(p,h,a);return d==1&&g==0||d==0&&g==1?-1:d==0||g==0?0:d==1||g==1?1:((d=new m.h).add(u,h),d.scale(.5),(p=m.Dg.wm(p,d,a))==0?0:p==1?1:-1)},E.HB=function(p,h){return h?p:p.Ia()},E.prototype.nJ=function(){return this.yH==null&&(this.yH=this.Se.Ia()),this.yH},E.prototype.qe=function(){},E}();m.HC=D}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 28},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.prototype.V=function(h,a,u,d,g,v,b){return h instanceof m.aa?(h=new m.Zc(h),this.V(h,a,u,d,g,v,b).next()):new m.xL(h,a,u,d,g,v,b)},p.instance=null,p}(m.Je);m.IC=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a,u,d,g,v){this.ya=-1,this.Rd=p,this.Mj=h,this.Ka=a,this.Ki=u,this.CA=d,this.uH=g,this.nd=v}return E.prototype.next=function(){var p=this.Rd.next();return p!=null?(this.ya=this.Rd.La(),this.jL(p)):null},E.prototype.La=function(){return this.ya},E.prototype.jL=function(p){var h=0>=this.uH?m.ta.kj(this.Mj,p,!1):this.uH;return m.IK.V(p,this.Ka,this.Ki,this.CA,h,this.nd)},E.prototype.qe=function(){},E}();m.xL=D}(ie||(ie={})),function(m){var D;(D=m.NK||(m.NK={}))[D.clipToDomainOnly=1]="clipToDomainOnly",D[D.clipWithHorizon=2]="clipWithHorizon",D[D.foldAndClipWithHorizon=3]="foldAndClipWithHorizon";var E=function(p){function h(){return p!==null&&p.apply(this,arguments)||this}return Ke(h,p),h.prototype.getType=function(){return 0},h.local=function(){return h.instance===null&&(h.instance=new h),h.instance},h.prototype.V=function(a,u,d){return a instanceof m.aa?(a=new m.Zc(a),this.V(a,u,d).next()):new m.yL(a,u,d)},h.prototype.transform=function(a,u,d,g){return m.bu.transform(a,u,d,g,!0)},h.prototype.Qt=function(a,u,d,g){return m.bu.Qt(a,u,d,g)},h.instance=null,h}(m.Je);m.Hx=E}(ie||(ie={})),function(m){var D=function(){function E(p,h,a){this.ya=-1,this.Rd=p,this.MT=h,this.nd=a}return E.prototype.next=function(){var p=this.Rd.next();return p!=null?(this.ya=this.Rd.La(),m.bu.zh(p,this.MT,this.nd)):null},E.prototype.La=function(){return this.ya},E.prototype.qe=function(){},E}();m.yL=D}(ie||(ie={})),function(m){var D=function(){function p(){}return p.prototype.reset=function(){this.ph=this.xk=-1,this.us=this.kq=!1},p.prototype.AQ=function(h,a,u){for(h.Vb(a,u);h.Ha();){var d=h.ha();if((d=d.Qb())!=0)return h.wb()}for(h.Vb(a,u);h.Ez();)if((d=(d=h.li()).Qb())!=0)return h.wb();return-1},p.prototype.BQ=function(h,a){for(h.Vb(a,-1);h.Ez();)if(h.li().Qb()!=0)return h.wb();return-1},p.prototype.zQ=function(h,a){for(h.Vb(a,-1),h.ha();h.Ha();)if(h.ha().Qb()!=0)return h.wb();return-1},p.prototype.yQ=function(h,a,u,d){if(this.xk=this.AQ(a,u,d),this.xk!=-1){a.Vb(this.xk,-1);var g=a.ha(),v=g.hc(g.fe(h,!1));if(u=m.h.yc(v,h),(d=new m.h).L(v),d.sub(g.ac()),(v=new m.h).L(h),v.sub(g.ac()),this.kq=0>d.wi(v),this.ph=this.zQ(a,this.xk),this.ph!=-1){a.Vb(this.ph,-1);var b=(g=a.ha()).fe(h,!1);b=g.hc(b);var S=m.h.yc(b,h);S>u?this.ph=-1:(d.L(b),d.sub(g.ac()),v.L(h),v.sub(g.ac()),this.us=0>d.wi(v))}this.ph==-1&&(this.ph=this.BQ(a,this.xk),this.ph!=-1&&(a.Vb(this.ph,-1),b=(g=a.ha()).fe(h,!1),b=g.hc(b),(S=m.h.yc(b,h))>u?this.ph=-1:(d.L(b),d.sub(g.ac()),v.L(h),v.sub(g.ac()),this.us=0>d.wi(v),h=this.xk,this.xk=this.ph,this.ph=h,h=this.kq,this.kq=this.us,this.us=h)))}},p.prototype.cO=function(h,a,u,d,g){return u=u.Ga(),this.yQ(h,u,d,g),this.xk!=-1&&this.ph==-1?this.kq:this.xk!=-1&&this.ph!=-1?this.kq==this.us?this.kq:(u.Vb(this.xk,-1),h=u.ha().kg(),u.Vb(this.ph,-1),a=u.ha().kg(),0<=h.wi(a)):a},p}(),E=function(p){function h(){return p!==null&&p.apply(this,arguments)||this}return Ke(h,p),h.local=function(){return h.instance===null&&(h.instance=new h),h.instance},h.prototype.getType=function(){return 3},h.prototype.nz=function(a,u,d){var g;if(g===void 0&&(g=!1),a.B())return new m.$l;u=u.D();var v=a,b=a.getType();switch(b==197&&((v=new m.Da).ad(a,!1),b=1736),b){case 33:return this.xI(v,u);case 550:return this.jI(v,u);case 1607:case 1736:return this.bU(v,u,d,g);default:throw m.i.fa("not implemented")}},h.prototype.oz=function(a,u){if(a.B())return new m.$l;u=u.D();var d=a,g=a.getType();switch(g==197&&((d=new m.Da).ad(a,!1),g=1736),g){case 33:return this.xI(d,u);case 550:case 1607:case 1736:return this.jI(d,u);default:throw m.i.fa("not implemented")}},h.prototype.pz=function(a,u,d,g){if(0>g)throw m.i.N();if(a.B())return[];u=u.D();var v=a,b=a.getType();switch(b==197&&((v=new m.Da).ad(a,!1),b=1736),b){case 33:return this.TU(v,u,d,g);case 550:case 1607:case 1736:return this.tU(v,u,d,g);default:throw m.i.fa("not implemented")}},h.prototype.bU=function(a,u,d,g){if(a.getType()==1736&&d&&(d=new m.l,a.A(d),d=m.ta.Wd(null,d,!1),(g?m.hd.Yd(a,u,0):m.hd.Yd(a,u,d))!=0)){var v=new m.$l(u,0,0);return g&&v.WJ(!0),v}var b=a.Ga();v=new m.h;for(var S=d=-1,C=17976931348623157e292,O=0;b.$a();)for(;b.Ha();){var R=b.ha();R=R.hc(R.fe(u,!1));var $=m.h.yc(R,u);$m.h.Uq(u,R.ac(),R.wc()),1=u||(a.length=g),a.slice(0)},h.instance=null,h}(m.Je);m.Ix=E}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 4},p.prototype.V=function(h,a,u,d,g){return m.am.yB(h,a,u,d,g)},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.prototype.Iu=function(h){return m.Vt.wy(h)},p.prototype.wn=function(h,a,u){m.Vt.CD(h,a,u)},p.instance=null,p}(m.Je);m.zL=D}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 33},p.prototype.V=function(h,a,u,d,g){return h===1073741824?!m.ud.zB(a,u,d,4,g):m.ud.zB(a,u,d,h,g)},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.prototype.Iu=function(h){return m.Vt.wy(h)},p.prototype.wn=function(h,a,u){m.Vt.CD(h,a,u)},p.instance=null,p}(m.Je);m.dj=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a,u){if(this.nd=u,this.rT=a,this.ya=-1,p==null)throw m.i.N();this.yk=p,this.Mj=h}return E.prototype.next=function(){var p;if((p=this.yk.next())!=null){if(this.ya=this.yk.La(),this.nd!=null&&!this.nd.progress(-1,-1))throw m.i.fu("user_canceled");return this.eC(p)}return null},E.prototype.La=function(){return this.ya},E.prototype.eC=function(p){if(p==null)throw m.i.N();return m.Jx.cK(p,this.Mj,this.rT,this.nd)},E.prototype.qe=function(){},E}();m.AL=D}(ie||(ie={})),function(m){var D=function(E){function p(){return E!==null&&E.apply(this,arguments)||this}return Ke(p,E),p.prototype.getType=function(){return 26},p.prototype.V=function(h,a,u,d){return h instanceof m.aa?(h=new m.Zc(h),this.V(h,a,u,d).next()):new m.AL(h,a,u,d)},p.prototype.rs=function(h,a,u,d,g){return 0<(d!==void 0?m.Jx.rs(h,a,u,d,g):m.Jx.rs(h,a,!1,null,u))},p.local=function(){return p.instance===null&&(p.instance=new p),p.instance},p.instance=null,p}(m.Je);m.Yl=D}(ie||(ie={})),function(m){var D=function(){function g(){this.yq=0}return g.prototype.nX=function(v){this.yq&=-2,this.yq|=v?1:0},g.prototype.Wp=function(){return(1&this.yq)!=0},g.prototype.XF=function(){return this.Wp()?0:1},g}();m.xY=D;var E=function(){},p=function(g,v,b,S){this.x=g,this.y=v,this.Ai=b,this.xm=S},h=function(){function g(v){this.Be=v}return g.prototype.compare=function(v,b,S){return v=v.ja(S),b=this.Be.lf.read(2*b),0>(b-=v=this.Be.lf.read(2*v))?-1:0R?1:0},g}(),u=function(){function g(v,b){this.YI=new m.h,this.parent=v,this.dS=b}return g.prototype.nr=function(v,b,S){var C=this.parent,O=this.dS;S.Vd(v,b,function(R,$){return C.Mh(R,$,O)})},g.prototype.$p=function(v){return v=this.parent.gi.get(v),this.parent.lf.tc(2*(v>>1),this.YI),this.YI.y+(1&v?this.parent.Oj:-this.parent.Oj)},g}(),d=function(){function g(v,b,S,C,O){this.nH=v.description,this.X=v,this.Qg=b,this.Oj=m.ta.kj(this.Qg,v,!1),this.Bo=m.ta.kj(this.Qg,v,!0),this.xA=S,this.oT=this.nH.Aa,this.hb=[],this.po=[],this.mh=new m.jp,this.fb=new m.Yj,this.ke=new m.Md,this.ZG=this.ql=O}return g.prototype.eT=function(){return this.ZG=!0,(!m.aa.Hc(this.X.getType())||this.GE()&&this.DE(!1))&&this.mO()?m.aa.Hc(this.X.getType())?this.pO()?this.X.getType()==1607?this.rO()?2:0:this.sO()?this.tO():0:0:2:0},g.prototype.kC=function(v,b){var S=this.lf.read(2*v);v=this.lf.read(2*v+1);var C=this.lf.read(2*b);b=this.lf.read(2*b+1);var O=!m.Yt.Cv(S,v,C,b,this.Oj*this.Oj);return O||this.X.Db()!=0&&S==C&&v==b},g.prototype.GE=function(){for(var v=this.X,b=v.xf?3:2,S=0,C=v.da();Sthis.Oj)){if(v&&C){var R=O.wv(1,0);if(O=O.wv(1,0),Math.abs(O-R)>b)continue}return this.ke=new m.Md(2,S.wb(),-1),!1}}return!0},g.prototype.mO=function(){var v=this.X,b=null;m.aa.Hc(this.X.getType())&&(b=this.X);var S=(this.ZG||this.ql)&&b!=null,C=v.I();this.lf=v.ub(0),this.gi=new m.ia(0),this.gi.Jb(2*C),this.fi=new m.ia(0),this.fi.Jb(2*C),S&&(this.Fl==null&&(this.Fl=new m.ia(0)),this.Fl.Jb(C));for(var O=v=0;O=b.Vc(v);)v++;this.Fl.add(v)}for(new m.Xt().sort(this.fi,0,2*C,new u(this,S)),this.fb.clear(),this.fb.Vo(new h(this)),this.fb.De(C),b=0,C*=2;b>1,(1&v)==0){if(v=this.fb.addElement(S,-1),(O=this.fb.we(v))!=-1&&!this.kC(this.fb.ja(O),S))return this.ke=new m.Md(3,S,this.fb.ja(O)),!1;var R=this.fb.lb(v);if(R!=-1&&!this.kC(this.fb.ja(R),S))return this.ke=new m.Md(3,S,this.fb.ja(R)),!1}else if(v=this.fb.search(S,-1),O=this.fb.we(v),R=this.fb.lb(v),this.fb.vd(v,-1),O!=-1&&R!=-1&&!this.kC(this.fb.ja(O),this.fb.ja(R)))return this.ke=new m.Md(3,this.fb.ja(O),this.fb.ja(R)),!1;return!0},g.prototype.pO=function(){return 10>this.X.I()?this.nO():this.oO()},g.prototype.oO=function(){var v=new m.gd;v.Ib(this.X);var b=new m.Md;return!m.$t.kI(!1,v,this.Oj,b,this.nd)||(b.Jo=v.Ua(b.Jo),b.Ko=v.Ua(b.Ko),this.ke.Wt(b),!1)},g.prototype.nO=function(){var v=this.X,b=v.Ga();for(v=v.Ga();b.$a();)for(;b.Ha();){var S=b.ha();if(!b.Qn()||!b.$S()){v.BW(b);do for(;v.Ha();){var C=v.ha();if((C=S.zr(C,this.Oj,!0))!=0)return this.ke=new m.Md(C==2?5:4,b.wb(),v.wb()),!1}while(v.$a())}}return!0},g.prototype.sO=function(){var v=this.X;this.hb.length=0,this.po.length=0,this.Zf=v.Ga(),this.Zf.JB();var b=new m.ia(0);b.Jb(10);var S=NaN,C=0,O=0;for(v=2*v.I();O>=1;var $=this.lf.read(2*R),N=this.lf.read(2*R+1);if(b.size!=0&&($!=S||N!=C)){if(!this.RI(b))return!1;b!=null&&b.clear(!1)}b.add(R),S=$,C=N}}return!!this.RI(b)},g.prototype.rO=function(){for(var v=this.X,b=Array(v.da()),S=0,C=v.da();S>1;this.lf.tc(2*R,O);var $=b[S=this.Fl.get(R)],N=v.Ba(S),B=v.Vc(S)-1;C.el=R==N||R==B,C.ny=this.ql?!$&&C.el:C.el,C.Ai=S,C.x=O.x,C.y=O.y,C.xm=R;for(var G=new E,K=1,ee=this.fi.size;K>1,this.lf.tc(2*R,O),(S=this.Fl.get(R))!=C.Ai&&($=b[S],N=v.Ba(S),B=v.Vc(S)-1);var q=R==N||R==B,oe=this.ql?!$&&C.el:C.el;if(G.x=O.x,G.y=O.y,G.Ai=S,G.xm=R,G.ny=oe,G.el=q,G.x==C.x&&G.y==C.y){if(this.ql){if(!(G.ny&&C.ny||G.Ai==C.Ai&&(G.el||C.el)))return this.ke=new m.Md(8,G.xm,C.xm),!1}else if(!G.el||!C.el)return this.ke=new m.Md(5,G.xm,C.xm),!1}S=C,C=G,G=S}return!0},g.prototype.JE=function(){for(var v=this.X,b=[],S=-1,C=!1,O=0,R=v.da();O>1;this.lf.tc(2*$,C),O=this.Fl.get($),S=new p(C.x,C.y,O,$,b[O]),v=[];var N=1;for(R=this.fi.size;N>1,this.lf.tc(2*$,C),O=this.Fl.get($),(O=new p(C.x,C.y,O,$,b[O])).x==S.x&&O.y==S.y){if(O.Ai==S.Ai)return this.ke=new m.Md(9,O.xm,S.xm),!1;0<=b[O.Ai]&&b[O.Ai]==b[S.Ai]&&(v.length!=0&&v[v.length-1]==S||v.push(S),v.push(O))}S=O}if(v.length==0)return!0;for(O=new m.jp(!0),m.O.$u(b,-1),C=-1,(N=new m.h).Rc(),S=0,R=v.length;S=v.Ke())return this.ke=new m.Md(6,v.da()==1?1:-1,-1),0;if(v.da()==1)return this.ql&&!this.JE()?0:2;this.to=m.ia.qf(v.da(),0),this.JA=m.ia.qf(v.da(),-1);for(var b=-1,S=0,C=0,O=v.da();CR?0:256),0b||S>=1,(C=this.lf.read(2*S+1))!=this.Mo&&v.size!=0){if(!this.ut(v))return 0;v!=null&&v.clear(!1)}v.add(S),this.Mo=C}return 0O.la){var $=this.Zf.wb(),N=this.Su(O,C,this.Zf.gb,!0);0v.Ja(b.gb))){S.EW();for(var G,K,ee=!0;b.Ha();){var q=b.ha(),oe=S.li();if(b.wb()>S.wb())break;ee&&(N.add(b.wb()),B.add(S.ik()),ee=!1),K=N.Fc();var ge=b.ik();if(1this.Bo?N.add(b.ik()):R&&(G=v.Uc(1,N.Fc(),0),q=q.gv(1,0),Math.abs(q-G)>$&&N.add(b.ik())),K>this.Bo?B.add(S.wb()):R&&(G=v.Uc(1,B.Fc(),0),q=oe.gv(1,0),Math.abs(q-G)>$&&B.add(S.wb()))}if(N.Fc()B.size?N.If():B.If():(N.Fc()!=B.Fc()&&B.If(),B.If()),2<=B.size+N.size){for(ee=new m.Sa,oe=0,q=N.size;oe>1;var O=C>>1,R=new m.h,$=new m.h;return this.lf.tc(2*b,R),R.y+=1&v?this.Oj:-this.Oj,this.lf.tc(2*O,$),$.y+=1&C?this.Oj:-this.Oj,(v=R.compare($))==0&&S?0>(S=this.Fl.get(b)-this.Fl.get(O))?-1:0O.x)return 1;if(C.yO.y)return 1;for(C=1;CB)return 1}}return 0},g.prototype.PO=function(v,b){var S=this.Ou(v,b);return S==0?vb?1:0v?h:a;if(h.B())return a;if(a.B())return h;var b=new m.l,S=new m.l,C=new m.l;return h.A(b),a.A(S),C.K(b),C.Zb(S),b=m.ta.Wd(u,C,!0),S=h.getType(),C=a.getType(),S==33&&C==33?p.aV(h,a,b):S!=C?0v?h:a:S==550?p.iI(h,a,b):p.iI(a,h,b):m.Fg.ep(h,a,u,d)},p.aV=function(h,a,u){u=u*Math.sqrt(2)*1.00001,u*=u;var d=h.D(),g=a.D(),v=new m.de(h.description);return m.h.yc(d,g)>u&&(v.add(h),v.add(a)),v},p.iI=function(h,a,u){var d=h.ub(0),g=h.I(),v=a.D(),b=h.Ia();u=u*Math.sqrt(2)*1.00001;var S=new m.l;if(h.A(S),S.W(u,u),S.contains(v)){u*=u,S=!1;for(var C=[],O=0;Othis.zk||0>this.bo)throw m.i.Qa();if(this.AH[this.bo])break}return this.ya++,this.fG(this.bo)}return this.ya=0,this.bo=this.zk,this.fG(this.zk)},h.prototype.La=function(){return this.ya},h.prototype.qK=function(){if(this.Ic)return!0;var a=null;if(this.Rd!=null&&(a=this.Rd.next())==null&&(this.Ic=!0,this.Rd=null),m.mp.zp(this.Ub),a!=null){var u=a.Db();this.AH[u]=!0,u>=this.zk&&!this.jA&&(this.ND(u,!1,a),u>this.zk&&!this.jA&&this.zW(u))}if(0this.Do.length)for(var v=0,b=Math.max(2,a+1);vu?m.F.Wq(O,C,S,R,0):m.F.Wq(O,S,C,R,0),N=[0,0,0],B=[0,0,0];var ee=[0,0,0];S=[0,0,0],$=[0,0,0];var q=Math.acos(R[2]/1),oe=1-p,ge=Math.tan(q),me=1+ge*ge/oe,Me=2*O[2]*ge/oe;for(oe=(-Me+(ge=Math.sqrt(Me*Me-4*me*(O[2]*O[2]/oe-1))))/(me*=2),Me=(-Me-ge)/me,ge=Math.tan(q),q=(oe+Me)/2,O=((me=ge*oe+O[2])+(ge*Me+O[2]))/2,ge=m.F.gp(oe-q,me-O),oe=O/K*1.570796326794897,Me=0;100>Me&&(me=(me=m.F.w(p,oe))*me/Math.cos(oe)*(Math.sin(oe)-O*me/(1-p)),!m.s.Cd(me));Me++)oe-=me;O=m.F.n(1,p,oe)*Math.cos(oe),ge=1-ge/(O=Math.sqrt((O-q)*(O+q))),ge*=2-ge,me=m.F.on(N),q=m.F.on(B),oe=m.F.on(ee);var Te=m.F.St(ee,N);Me=m.F.St(ee,B),m.F.zx(ee,N,S),m.F.zx(ee,B,$),N=Math.acos(Te/(oe*me)),B=Math.acos(Me/(oe*q)),B*=m.s.Mb(1,m.F.St(S,$)),(1.570796326794897<=m.s.P(N)&&1.570796326794897<=m.s.P(B)||3.141592653589793$&&0>u)&&(u=m.F.ba(u+3.141592653589793)),g!=null&&(g.u=S),v!=null&&(v.u=$),b!=null&&(b.u=u)}}},D.rf=function(E,p,h,a,u,d,g,v){var b=[0,0,0],S=[0,0,0],C=[0,0,0],O=[0,0,0],R=[0,0,0],$=[0,0,0],N=[0,0,0],B=[0,0,0,0],G=new m.ga(0),K=new m.ga(0),ee=new m.ga(0),q=new m.ga(0),oe=new m.ga(0),ge=new m.ga(0);if(g!=null&&v!=null)if(m.s.ti(p))m.Yg.rf(E,h,a,u,d,g,v);else if(m.s.Cd(u))g!=null&&(g.u=h),v!=null&&(v.u=a);else if(d=m.F.ba(d),0>u&&(u=m.s.P(u),d=m.F.ba(d+3.141592653589793)),h=m.F.ba(h),a=m.F.ba(a),1.570796326794897d?m.F.Wq(N,R,b,B,0):m.F.Wq(N,b,R,B,0),b=Math.acos(B[2]/1),B=Math.atan2(-B[1],-B[0]),a=1-p,oe=1+(R=Math.tan(b))*R/a,a=(-(q=2*N[2]*R/a)+(R=Math.sqrt(q*q-4*oe*(N[2]*N[2]/a-1))))/(oe*=2),q=(-q-R)/oe,R=Math.tan(b),b=(a+q)/2,N=((oe=R*a+N[2])+(R*q+N[2]))/2,R=m.F.gp(a-b,oe-N),me=N/me*1.570796326794897,a=0;100>a&&(q=(q=m.F.w(p,me))*q/Math.cos(me)*(Math.sin(me)-N*q/(1-p)),!m.s.Cd(q));a++)me-=q;me=m.F.n(1,p,me)*Math.cos(me),N=1-R/(me=Math.sqrt((me-b)*(me+b))),N*=2-N,$=Math.acos(m.F.St($,S)/(m.F.on($)*m.F.on(S))),$*=m.s.Mb(1,S[0]),d=(m.F.q(me,N,m.F.Qj(N,$))+E*m.s.Mb(1,d))/m.F.Ah(me,N),d=m.F.ba(1.570796326794897*d),d=m.F.Rq(N,d),m.F.n(me,N,d),R=m.F.ba(B+h),h=Math.cos(R),d=Math.sin(R),C[0]=O[0]*h+O[1]*-d,C[1]=O[0]*d+O[1]*h,C[2]=O[2],m.F.jO(p,C[0],C[1],C[2],ee,K,G),g!=null&&(g.u=K.u),v!=null&&(v.u=ee.u)}},D}()}(ie||(ie={})),function(m){var D=function(){function u(d){this.Ya=null,this.wt=new m.h,this.xt=new m.h,this.g=d}return u.prototype.compare=function(d,g,v){return this.g.Gc(g,this.wt),this.g.Gc(d.ja(v),this.xt),this.wt.compare(this.xt)},u}(),E=function(){function u(d){this.Bf=new m.h,this.Dk=new m.h,this.g=d}return u.prototype.Dh=function(d){this.Bf.L(d)},u.prototype.compare=function(d,g){return this.g.Gc(d.ja(g),this.Dk),this.Bf.compare(this.Dk)},u}(),p=function(u){function d(g){var v=u.call(this,g.g,g.qa,!1)||this;return v.ib=g,v}return Ke(d,u),d.prototype.compare=function(g,v,b){if(this.rg)return-1;var S=this.ib.Qd.Jn(this.ib.Rh(v));g=g.ja(b);var C=this.ib.Qd.Jn(this.ib.Rh(g));return this.Dm=b,this.RE(v,S,g,C)},d}(m.UC),h=function(u){function d(g){var v=u.call(this,g.g,g.qa)||this;return v.ib=g,v}return Ke(d,u),d.prototype.compare=function(g,v){return this.rg?-1:(g=this.ib.Qd.Jn(this.ib.Rh(g.ja(v))),this.Dm=v,this.SE(v,g))},d}(m.aM),a=function(){function u(){this.Mc=this.df=this.jo=this.Qd=this.lh=this.zd=this.hb=this.g=null,this.Ng=!1,this.vh=this.Nm=this.ie=this.Gk=this.nh=this.Ak=this.Ff=this.$d=null,this.xh=this.Jq=this.UA=this.qa=0,this.Xv=this.Wn=!1,this.yo=new m.h,this.Pi=new m.h,this.hb=new m.$c(8),this.zd=new m.$c(5),this.lh=new m.au,this.Qd=new m.au,this.Ng=!1,this.vh=new m.h,this.vh.ma(0,0),this.qa=0,this.xh=-1,this.Wn=!1,this.g=null,this.df=new m.Yj,this.Mc=new m.Yj,this.nh=new m.ia(0),this.Gk=new m.TC,this.Ff=new m.ia(0),this.Ak=new m.ia(0),this.jo=new m.Sa}return u.prototype.PX=function(d,g){var v=new m.Dd;return v.$B(),d.Oc(v),this.er(d),this.Wn=!1,this.qa=g,this.UA=g*g,g=this.jC(),d.Oc(v),g||(this.qQ(),g||this.jC()),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null,this.Wn},u.prototype.TX=function(d,g){this.er(d),this.Wn=!1,this.qa=g,this.UA=g*g,this.Ng=!1,this.jC(),this.Ng||(this.Ng=d.Gp(g,!0,!1)==1),this.xh!=-1&&(this.g.Td(this.xh),this.xh=-1),this.g=null},u.prototype.pg=function(d,g){return this.hb.T(d,0+g)},u.prototype.LB=function(d,g,v){this.hb.S(d,0+g,v)},u.prototype.Rh=function(d){return this.hb.T(d,2)},u.prototype.ZW=function(d,g){this.hb.S(d,2,g)},u.prototype.RF=function(d,g){return this.hb.T(d,3+g)},u.prototype.Pp=function(d){return this.hb.T(d,7)},u.prototype.Pl=function(d,g){this.hb.S(d,7,g)},u.prototype.Rp=function(d,g){return this.hb.T(d,3+this.Op(d,g))},u.prototype.fr=function(d,g,v){this.hb.S(d,3+this.Op(d,g),v)},u.prototype.NR=function(d,g){return this.hb.T(d,5+this.Op(d,g))},u.prototype.hr=function(d,g,v){this.hb.S(d,5+this.Op(d,g),v)},u.prototype.Sr=function(d){return this.zd.T(d,0)},u.prototype.UW=function(d,g){this.zd.S(d,0,g)},u.prototype.ez=function(d){return this.zd.T(d,4)},u.prototype.cr=function(d,g){this.zd.S(d,4,g)},u.prototype.il=function(d){return this.zd.T(d,1)},u.prototype.ln=function(d,g){this.zd.S(d,1,g)},u.prototype.dz=function(d){return this.zd.T(d,3)},u.prototype.Et=function(d,g){this.zd.S(d,3,g)},u.prototype.Ym=function(d){var g=this.zd.Ce(),v=this.lh.Ph();return this.UW(g,v),d!=-1?(this.lh.addElement(v,d),this.g.Ra(d,this.xh,g),this.cr(g,this.g.Ua(d))):this.cr(g,-1),g},u.prototype.HP=function(d){this.zd.jd(d)},u.prototype.LD=function(d,g){this.lh.addElement(this.Sr(d),g),this.g.Ra(g,this.xh,d)},u.prototype.nt=function(d){var g=this.hb.Ce(),v=this.Qd.Ph();return this.ZW(g,v),d!=-1&&this.Qd.addElement(v,d),g},u.prototype.MD=function(d,g){this.Qd.addElement(this.Rh(d),g)},u.prototype.Uu=function(d){this.hb.jd(d),0<=(d=this.nh.lF(d))&&this.nh.SV(d)},u.prototype.hj=function(d,g){if(this.pg(d,0)==-1)this.LB(d,0,g);else{if(this.pg(d,1)!=-1)throw m.i.Qa();this.LB(d,1,g)}this.ky(d,g)},u.prototype.ky=function(d,g){var v=this.il(g);if(v!=-1){var b=this.Rp(v,g);this.hr(b,g,d),this.fr(d,g,b),this.fr(v,g,d),this.hr(d,g,v)}else this.hr(d,g,d),this.fr(d,g,d),this.ln(g,d)},u.prototype.Op=function(d,g){return this.pg(d,0)==g?0:1},u.prototype.Xm=function(d,g){var v,b=this.dz(g);if(b!=-1&&(this.df.vd(b,-1),this.Et(g,-1)),(b=this.il(g))!=-1){var S=v=b;do{var C=!1,O=this.Op(v,g),R=this.RF(v,O);if(this.pg(v,O+1&1)==d){if(this.Xu(v),this.Qd.bh(this.Rh(v)),this.Uu(v),v==R){b=-1;break}b==v&&(b=this.il(g),S=R,C=!0)}v=R}while(v!=S||C);if(b!=-1){do O=this.Op(v,g),R=this.RF(v,O),this.LB(v,O,d),v=R;while(v!=S);(v=this.il(d))!=-1?(S=this.Rp(v,d),C=this.Rp(b,d),S==v?(this.ln(d,b),this.ky(v,d),this.ln(d,v)):C==b&&this.ky(b,d),this.fr(b,d,S),this.hr(S,d,b),this.fr(v,d,C),this.hr(C,d,v)):this.ln(d,b)}}for(b=this.Sr(d),v=this.Sr(g),S=this.lh.rc(v);S!=-1;S=this.lh.lb(S))this.g.Ra(this.lh.ja(S),this.xh,d);this.lh.Hy(b,v),this.HP(g)},u.prototype.UT=function(d,g){var v=this.pg(d,0),b=this.pg(d,1),S=this.pg(g,0),C=this.pg(g,1);this.Qd.Hy(this.Rh(d),this.Rh(g)),g==this.il(v)&&this.ln(v,d),g==this.il(b)&&this.ln(b,d),this.Xu(g),this.Uu(g),v==S&&b==C||b==S&&v==C||(this.Hn(v,this.yo),this.Hn(S,this.Pi),this.yo.qb(this.Pi)?(v!=S&&this.Xm(v,S),b!=C&&this.Xm(b,C)):(b!=S&&this.Xm(b,S),v!=C&&this.Xm(v,C)))},u.prototype.Xu=function(d){var g=this.pg(d,1);this.dF(d,this.pg(d,0)),this.dF(d,g)},u.prototype.dF=function(d,g){var v=this.Rp(d,g),b=this.NR(d,g),S=this.il(g);v!=d?(this.fr(b,g,v),this.hr(v,g,b),S==d&&this.ln(g,v)):this.ln(g,-1)},u.prototype.WD=function(d,g,v){var b=this.Qd.rc(d),S=this.Qd.ja(b);d=this.Le(S);var C=this.Le(this.g.U(S));for(this.g.jr(S,g,v,!0),b=this.Qd.lb(b);b!=-1;b=this.Qd.lb(b)){S=this.Qd.ja(b);var O=this.Le(S)==d;this.g.jr(S,g,v,O)}b=g.Vp(v,0).ac(),g=g.Vp(v,g.ol(v)-1).wc(),this.BK(d,b),this.BK(C,g)},u.prototype.ZE=function(d,g,v){var b=this.Rh(d),S=this.pg(d,0),C=this.pg(d,1),O=this.nt(-1);for(this.nh.add(O),this.Pl(O,-3),this.Ff.add(O),this.hj(O,S),d=1,g=g.ol(v);dthis.ez(O)&&this.cr(O,this.g.Ua(C))),O=this.Ff.get(d),d-=2,this.MD(O,C),C=this.g.U(C);while(0<=d)}this.Ff.clear(!1)},u.prototype.Le=function(d){return this.g.Pa(d,this.xh)},u.prototype.TI=function(d,g,v){var b=this.pg(g,0),S=new m.h;this.Hn(b,S);var C=new m.h,O=this.pg(g,1);this.Hn(O,C);var R=v.ol(d),$=v.Vp(d,0),N=new m.h;if($.Yp(N),!S.qb(N)){if(!this.Ng){var B=S.compare(this.vh);0>B*(N=N.compare(this.vh))&&(this.Ng=!0)}this.vF(b,this.Ff),this.Ak.add(b)}for(!this.Ng&&1$.compare(this.vh))&&(this.Ng=!0)),d=($=v.Vp(d,R-1)).wc(),C.qb(d)||(this.Ng||0>(B=C.compare(this.vh))*(N=d.compare(this.vh))&&(this.Ng=!0),this.vF(O,this.Ff),this.Ak.add(O)),this.Ff.add(g),C=0,O=this.Ff.size;CMath.max(100,this.g.fd)){this.nh.clear(!1),this.Ng=!0;break}var d=this.nh.Fc();this.nh.If(),this.Pl(d,-1),this.WS(d)!=-1&&this.wS(d),this.Vn=!1}},u.prototype.wS=function(d){if(this.Vn){var g=this.Mc.zu(this.MH,this.GH,d,!0);this.Vn=!1}else g=this.Mc.KD(d);g==-1?this.UT(this.Mc.ja(this.Mc.FF()),d):(this.Pl(d,g),this.$d.rg&&(this.$d.Kr(),this.oF(this.$d.Dm,g)))},u.prototype.WS=function(d){var g=this.pg(d,0);if(d=this.pg(d,1),this.Hn(g,this.yo),this.Hn(d,this.Pi),m.h.yc(this.yo,this.Pi)<=this.UA)return this.Ng=!0,-1;var v=this.yo.compare(this.vh),b=this.Pi.compare(this.vh);return 0>=v&&0=b&&0d&&(this.re(h),d=this.description.Pf(h)),this.ka==null&&this.un(),this.ka[this.description.$j(d)+a]=u},p.prototype.getType=function(){return 33},p.prototype.Db=function(){return 0},p.prototype.Oa=function(){this.vc(),this.ka!=null&&(this.ka[0]=NaN,this.ka[1]=NaN)},p.prototype.sn=function(h){if(this.ka!=null){for(var a=m.ee.Iw(h,this.description),u=[],d=0,g=0,v=h.Aa;g>>32),h=m.O.Th(d,h)}return h},p.prototype.mg=function(){return null},p}(m.aa);m.Sa=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a){p!==void 0&&(this.x=p,this.y=h,this.z=a)}return E.construct=function(p,h,a){var u=new E;return u.x=p,u.y=h,u.z=a,u},E.prototype.K=function(p,h,a){this.x=p,this.y=h,this.z=a},E.prototype.lx=function(){this.z=this.y=this.x=0},E.prototype.normalize=function(){var p=this.length();p==0&&(this.x/=p,this.y/=p,this.z/=p)},E.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},E.prototype.sub=function(p){return new E(this.x-p.x,this.y-p.y,this.z-p.z)},E.prototype.Ag=function(p){new E(this.x*p,this.y*p,this.z*p)},E.prototype.Qh=function(p){return this.x*p.x+this.y*p.y+this.z*p.z},E}();m.Nd=D}(ie||(ie={})),function(m){var D=function(){function E(p,h,a){this.Gw=this.DA=null,this.Xf=h,this.FT=h.y-a,this.ET=h.y+a,this.Ew=0,this.dA=p,this.qa=a,this.RT=a*a,this.eA=a!=0,this.Lv=!1}return E.prototype.result=function(){return this.Ew!=0?1:0},E.prototype.ZM=function(p){return p=p.hc(p.fe(this.Xf,!1)),m.h.yc(p,this.Xf)<=this.RT},E.prototype.fF=function(p){if(!this.eA&&(this.dA&&this.Xf.qb(p.ac())||this.Xf.qb(p.wc())))this.Lv=!0;else if(p.na==this.Xf.y&&p.na==p.la){if(this.dA&&!this.eA){var h=Math.max(p.sa,p.pa);this.Xf.x>Math.min(p.sa,p.pa)&&this.Xf.xh?a=!0:this.Xf.x>=Math.min(p.sa,p.pa)&&(a=0p.wc().y?1:-1)}}},E.prototype.SI=function(p){var h=p.Tg(0,1);if(h.oa>this.ET||h.vathis.Xf.y||h.va(p=p.I()))&&2*p+Math.log(p)/Math.log(2)*h<1*p*h},E}();m.Dg=D}(ie||(ie={})),function(m){var D=function(E){function p(h){return E.call(this,!0,h)||this}return Ke(p,E),p.prototype.Ia=function(){return new p(this.description)},p.prototype.Db=function(){return 2},p.prototype.getType=function(){return 1736},p.prototype.xG=function(h,a,u){this.JS(h,a,u)},p.prototype.qR=function(){this.FR()},p}(m.Vk);m.Da=D}(ie||(ie={})),function(m){(function(D){D[D.PiPOutside=0]="PiPOutside",D[D.PiPInside=1]="PiPInside",D[D.PiPBoundary=2]="PiPBoundary"})(m.RL||(m.RL={})),m.hd=function(){function D(){}return D.KG=function(E,p,h){return(E=m.Dg.bT(E,p,h))==0?0:E==1?1:2},D.Yd=function(E,p,h){return(E=m.Dg.wm(E,p,h))==0?0:E==1?1:2},D.WX=function(E,p,h,a,u){if(p.lengthp?(0>p?p+=360:360<=p&&(p-=360),p):(0>(p=m.lc.RK(p))&&(p+=360),p)},E.gP=function(p){return 180<(p=E.hP(p))&&(p-=360),p},E.oW=57.29577951308232,E}();m.qr=D,m.Hh=function(){function E(){}return E.lj=function(p,h){var a=new m.l;p.A(a);var u=m.cb.gh(h),d=new m.l;return d.K(u),d.v=a.v,d.C=a.C,d.W(.01*d.ca(),0),h=m.ta.Wd(h,a,!1),d.contains(a)?p:m.Ud.clip(p,d,h,0)},E.ks=function(p,h,a,u,d){if(!m.cb.Wc(h))throw m.i.N();var g=m.ta.kj(h,p,!1),v=m.cb.gh(h),b=m.cb.sc(h),S=b.Hd().ai,C=m.cb.vv(b);b=m.cb.ev(b),C*=2-C;var O=new m.Nc;v.cn(O);var R=[[0,0],[0,0]];if(m.Eg.Sb(h)==2?u?(R[0][0]=E.Zm(d,O),R[0][1]=v.Jp(),m.cb.vt(),v=R[0][0]*S):(R[0][0]=v.gk(),R[0][1]=d,m.cb.vt(),v=R[0][1]*S):v=d*S,!u&&v!=0)throw m.i.N();var $=new m.ga,N=new m.gd;p=N.Ib(p);for(var B=[0],G=new m.h,K=new m.h,ee=new m.h,q=new m.h,oe=new m.h,ge=new m.h,me=N.Ob(p);me!=-1;me=N.Rb(me)){var Me=N.Xa(me);N.D(Me,ee);for(var Te=!1,Fe=Me=N.U(Me);Fe!=-1;Fe=N.U(Fe)){if(Fe==Me){if(Te)break;Te=!0}if(N.D(Fe,q),u&&gg||gg||!u&&g<-ee.y&&q.y>g||g<-q.y&&ee.y>g)do if(!(Math.abs(ee.x-q.x)>=.5*O.R())){if(m.Eg.Sb(h)==2?(R[0][0]=E.Zm(ee.x,O),R[0][1]=ee.y,R[1][0]=E.Zm(q.x,O),R[1][1]=q.y,m.cb.dW(),oe.x=R[0][0]*S,oe.y=R[0][1]*S,ge.x=R[1][0]*S,ge.y=R[1][1]*S):(oe.x=ee.x*S,oe.y=ee.y*S,ge.x=q.x*S,ge.y=q.y*S),ge.x=6.283185307179586*(q.x-ee.x)/O.R()+oe.x,u){if(K.x=v,K.y=E.Nz(b,C,oe,ge,v,a),isNaN(K.y))break}else{if(K.x=E.Lz(b,C,oe,ge,a),isNaN(K.x))break;K.y=0}m.kb.wd(b,C,oe.x,oe.y,ge.x,ge.y,$,null,null,a);var Xe=$.u;m.kb.wd(b,C,oe.x,oe.y,K.x,K.y,$,null,null,a);var We=$.u;m.Eg.Sb(h)==2?(R[0][0]=K.x/S,R[0][1]=K.y/S,m.cb.bR(),u?(G.y=R[0][1],G.x=d):(G.x=E.os(R[0][0],ee.x,q.x,O),G.y=d)):u?(G.x=d,G.y=K.y/S):(G.x=E.os(K.x/S,ee.x,q.x,O),G.y=d),B[0]=0u.x)var v=u;else v=a,a=u;u=new m.ga(0);var b=new m.ga(0),S=new m.ga(0);m.kb.wd(p,h,v.x,v.y,a.x,a.y,b,u,null,g);var C=b.u,O=0,R=1,$=new m.h;for($.L(v);C*(R-O)>1e-12*p;){var N=.5*(O+R);if(m.kb.oj(p,h,v.x,v.y,C*N,u.u,b,S,g),$.x=b.u,$.y=S.u,$.x==d)break;if(E.Sn(v.x,$.x,d))R=N;else{if(!E.Sn(a.x,$.x,d))return NaN;O=N}}return $.y},E.Sn=function(p,h,a){return p=D.Cp(p),h=D.mx(p,D.Cp(h)),(a=D.mx(p,D.Cp(a)))==0||0h&&0>a&&a>=h},E.Zm=function(p,h){var a=h.va-h.oa;return h.It(p-Math.floor((p-h.oa)/a)*a)},E.os=function(p,h,a,u){var d=new m.Nc;for(d.K(h,a),a=u.R(),p=Math.floor((p-h)/a)*a+p,d=d.sf();Math.abs(p-d)>Math.abs(p+a-d);)p+=a;return p},E.Lz=function(p,h,a,u,d){if(a.y>u.y)var g=u;else g=a,a=u;if((u=new m.Nc).K(g.y,a.y),!u.contains(0)||3.141592653589793<=Math.abs(g.x-a.x))return NaN;if(g.x==a.x)return g.x;var v=new m.ga(0),b=new m.ga(0),S=new m.ga(0);m.kb.wd(p,h,g.x,g.y,a.x,a.y,b,v,null,d);var C=b.u,O=0,R=1,$=new m.h;for($.L(g);C*(R-O)>1e-12*p;){var N=.5*(O+R);if(m.kb.oj(p,h,g.x,g.y,C*N,v.u,b,S,d),$.x=b.u,$.y=S.u,u.K(g.y,$.y),$.y==0)break;if(u.contains(0))R=N;else{if(u.K(a.y,$.y),!u.contains(0))return NaN;O=N}}return $.x},E.Hp=function(p,h,a,u,d,g,v){var b=new m.l;if(p.A(b),b.B())return p;var S=new m.Nc;b.cn(S);var C=new m.Nc;if(C.K(h,h+a),C.contains(S)&&C.va!=S.va)return p;var O=new m.l;O.K(b);var R=p.getType();if(R==33)return((b=(O=d?p:p.Of()).Lg())=C.va||v&&b==C.va)&&(b+=Math.ceil((C.oa-b)/a)*a,b=C.It(b),O.cC(b)),O;if(R==550){for(u=(O=d?p:p.Of()).ub(0),R=2*O.I(),p=!1,d=0;d=C.va||v&&b==C.va)&&(p=!0,b+=Math.ceil((C.oa-b)/a)*a,b=C.It(b),u.write(d,b));return p&&O.Pc(1993),O}if(C.contains(S))return p;if(R==197)return a=d?p:p.Of(),b.Ea(O),a.Xo(b),a;var $=.1*Math.max(b.ca(),b.R());for(O.W(0,$),v=p,C=u.Xd(0),p=m.Gh.local(),d=new m.Dd;;){var N=Math.floor((S.oa-h)/a),B=Math.ceil((S.va-h)/a);if(!(3O.v;)($=m.Ud.clip(v,O,C,0)).A(S),(R==1607?!$.B()&&(S.R()>C||S.ca()>C):!$.B()&&(R!=1736||S.R()>C))&&($.Oc(d),$.A(S),h.A(g),g.W(C,C),g.isIntersecting(S)&&R==1736?h=p.V(h,$,u,null):h.add($,!1)),O.move(a,0),d.shift(-a,0);return h},E.WI=function(p,h,a,u){var d=new m.de(a.description);d.Fd(a,0,-1),d=m.cb.zh(d,p,h);var g=a.I();if(u.Oa(),!m.cb.Wc(p)||g!=d.I())return!1;var v=new m.l;a.A(v);var b=new m.l;if(d.A(b),v=v.R(),b=b.R(),v!=0&&b!=0){if(b/=v,p=m.cb.gh(h).R()/m.cb.gh(p).R(),1e-10=a[d]?u[d]=a[d].toUpperCase():a[d];return u.join()}return a.toString(m.Sc.PE_STR_AUTH_TOP)},h.ur=function(a,u,d,g){var v=g.length,b=d.I();if(b!=0){var S=d.ub(0),C=Math.min(b,v),O=0,R=a.eh();isNaN(u)&&(u=0);for(var $=a.Wc(),N=179*(a=$?a.sc().Oe().R():0)/360;0K*m.lc.sign(ee)&&Math.abs(G)>N&&(g[B][0]+=-K*a)}S.uC(O<<1,C,g),O+=C,b-=C,C=Math.min(b,v)}d.Pc(1993)}},h.IL=function(a,u,d,g){var v=0,b=a.eh();isNaN(v)&&(v=0);var S=a.Wc(),C=a.bf();a=360*C,C*=179;for(var O=g.length,R=0;Ree*m.lc.sign(G)&&Math.abs(K)>C&&(g[$][0]-=ee*a)}m.ta.Iy(u,R,g,N),R+=N}}},h.Lx=function(a,u,d){var g=d.length,v=u.I();if(!(1>v)){var b=u.ub(0),S=Math.min(v,g),C=0,O=a.eh(),R=a.Wc(),$=R?a.Oe().R():0,N=179*$/360,B=0;for(R&&(B=a.zi());0K*m.lc.sign(ee)&&Math.abs(G)>N&&(d[a][0]+=-K*$)}b.uC(C<<1,S,d),C+=S,v-=S,S=Math.min(v,g)}u.Pc(1993)}},h.HL=function(a,u,d,g){if(d!=0){var v=a.eh(),b=a.Wc(),S=b?a.Oe().R():0,C=179*S/360,O=0;for(b&&(O=a.zi()),a=0;aG*m.lc.sign(u[N].x-O)&&Math.abs(B)>C&&(g[R][0]-=G*S)}m.ta.Iy(u,a,g,$),a+=$}}}},h.tr=function(a,u,d,g){var v=u.I();if(v!=0){var b=u.ub(0),S=a.ef,C=a.Yf,O=S.sc().Qp(),R=C.sc().Qp(),$=S.bf(),N=C.bf();if((a=a.Wf)==null||a.count()==0){for(d=O/R,g=(S.Up()-C.Up())*N,R=-90*$,a=90*$,O=!1,N=1,S=2*v;Nq?g[N][1]=q:g[N][1]<-q&&(g[N][1]=-q));for($=0;$N){if(me){var Ri=Fe+(on+11*$&&(me=!1)}me||(zi=nr+(Mt-=m.lc.Cn(R,zi-lt)),++yi,cs=Mt!=0,Gi.x=zi)}else di||m.ta.AG(rn,Ct,Gi,Te)&&(di=!0);cs&&Xe.write(2*on,zi),lt=zi,rn.L(Ct),Ct.L(Gi)}0a?S=1:0>=C&&0.99*C&&(S=-1)):S=-1),S!=0&&((u=new m.Da(v.description)).tp(O),(u=m.Xl.local().V(u,d,b)).add(v,!1),q=!0,v=u),q&&(v=m.Yl.local().V(v,g,!1,b)),v},h.vQ=function(a,u,d,g,v){var b=d.I(),S=d.Na(0),C=d.Na(b-1);v=(g=h.dv(g,v)).R(),S=m.lc.sign(C.x-S.x);var O=new m.l;d.xc(O);var R=g.gk();if(C=R-v,R+=v,0<=S){var $=Math.ceil((C-O.v)/v);for($*=v;C>O.v+$;)$+=v;for(;CO.v+$;)$+=v;N=$,720C;)1024<=ee&&(ee=0),B.move($,0),G.Gb=$,d.Oc(G),K+=$,g.v<=K&&g.C>=K&&(v=O.I()-1),d.Cb(0,N),N=d.Na(b-1),O.Dr(d,0,0,b-1,!1);return d=new m.Da(O.description),b=0S?b:!b)?(S=m.h.construct(C.x,g.H),d.Ci(S),S=m.h.construct(g.gk(),g.H),d.Ci(S),g=m.h.construct(a.x,g.H)):(S=m.h.construct(C.x,g.G),d.Ci(S),S=m.h.construct(g.gk(),g.G),d.Ci(S),g=m.h.construct(a.x,g.G)),d.Ci(g),d.xG(0,u,0),d.kO(v),d},h.uQ=function(a,u,d,g,v){var b=new m.Da(a.description);b.add(a,!1),b.DB(0,b.I()-1);var S=new m.l;b.xc(S);var C=(d=h.dv(u,d)).R(),O=Math.ceil((d.v-S.v)/C);for(O*=C;d.v>S.v+O;)O+=C;for(;d.vS.C)return v&&(v=b.Ke(),u=(b=m.Yl.local().V(b,u,!0,g)).Ke(),(u=m.lc.sign(v)!=m.lc.sign(u))&&b.oJ()),b;for((a=new m.Da(a.description)).add(b,!1),v=v||S.R()>C-u.Xd(0);S.v=d){C=!0;break}if(2&v&&R.y<=-d){C=!0;break}}if(!C)return!1;b=!1,a&&(b=u.Nn(0)),S=(a=new m.gd).Ib(u),C=a.Ob(S);var $=-1,N=!0,B=new m.h;B.Rc(),O=new m.Sa;for(var G=-1,K=a.Xa(C);K!=-1;K=a.U(K)){R=a.Na(K);var ee=1&v&&90<=R.y?1:0;if(ee|=2&v&&R.y<=-d?2:0,0<$&&$!=ee){if(B.x!=R.x){B.x=R.x,a.Vi(a.Ma(K),O);var q=a.wj(C,K,O);a.mf(q,B)}if(b)for(G=G!=-1?a.U(G):a.Xa(C),q=a.Ma(K);G!=q;)G=a.pd(G,!1);G=-1}0C){if(new m.l().K(B.v-S,-C,B.C+S,C),(v=m.ri.Nu(v,u,a,NaN,0,g)).B())return v;v.A(B)}if(K&&(u.HB.H))return v.Ia();if(B.R()>R&&(v=h.Hp(v,$-O,R,a,!0,0,!0,g)).A(B),(C=h.eO(B.v,B.C,u.v,u.C,R))!=0&&B.move(C,0),B.C>u.C||B.vu.C)for(;B.v>=u.C;)B.move(-R,0),C-=R;for(;B.vC;C++){if(ee?S=m.aa.Hc(b)?m.ri.clip(v,u,d,N,g):m.ri.clip(v,u,d,0,g):(S=m.Xj.local().V(v,G,a,g))==G&&(S=m.aa.jg(S)),u.v<=B.v&&u.C>=B.C||u.v>=B.v&&u.C<=B.C)return S;K[C]=S,C==0&&(B.move(-R,0),(S=new m.Dd).gg(-R,0),v.Oc(S))}if(b==550)K[0].Fd(K[1],0,-1);else if(m.aa.Hc(b))K[0].add(K[1],!1);else{if(b!=33)throw m.i.fa("intersect_with_GCS_horizon: unexpected geometry type");K[0].B()&&(K[0]=K[1])}return K[0]}if(u.HB.H)return v;for(b=0;!v.B()&&B.C>u.v;)b!=0&&((S=new m.Dd).gg(b,0),v.Oc(S)),m.dj.local().V(4,v,G,a,g)||G==(v=m.kp.local().V(v,G,a,g))&&(v=m.aa.jg(v)),b!=0&&((N=new m.Dd).gg(-b,0),v.Oc(N)),b-=R,B.move(-R,0);return v},h.yG=function(a,u,d,g){if(u!=0&&g!=D.DontClip)if(g==D.PannableFold){g=d.HR();for(var v=u,b=0;bg.H||a[b].yS||a[b].y<-S)&&(a[b].Rc(),v--);if(v!=0){(v=new m.l).Zw(a,u),S=d.Vr();var O=d.hv();b=S.getType()==197;var R=new m.l;if(S.A(R),!O||!(R.Hv.H))if(O)if(h.av(a,u,R.gk()-C,g),v=u,b)for(b=0;b=R||S&&$==R)&&($+=Math.ceil((u-$)/d)*d,$=m.O.Rk($,u,R),g.cC($)),g}if(a.B()||($=new m.l,a.A($),$.B()))return a;var N=new m.Nc;$.cn(N);var B=new m.Nc;if(B.K(u,R),B.contains(N))return a;if((R=new m.l).K($),O===550){for(C=(g=v?a:a.Of()).ub(0),O=2*g.I(),R=!1,u=0;u=B.va||S&&$==B.va)&&(R=!0,$+=Math.ceil((B.oa-$)/d)*d,$=B.It($),C.write(u,$));return R&&g.Pc(1993),g}if(O==197)return d=v?a:a.Of(),$.Ea(R),d.Xo($),d;var G=.1*Math.max($.ca(),$.R());for(R.W(0,G),S=a,B=g.Xd(0),a=m.Gh.local(),v=new m.Dd;;){var K=Math.floor((N.oa-u)/d),ee=Math.ceil((N.va-u)/d);if(!(3R.v;)(G=m.ri.clip(S,R,B,0,C)).A(N),(O==1607?!G.B()&&(N.R()>B||N.ca()>B):!G.B()&&(O!=1736||N.R()>B))&&(G.Oc(v),G.A(N),u.A(b),b.W(B,B),b.isIntersecting(N)&&O==1736?u=a.V(u,G,g,null):u.add(G,!1)),R.move(d,0),v.shift(-d,0);return u},h.av=function(a,u,d,g){for(var v=d+g,b=0;bv||S==v)||(S+=Math.ceil((d-S)/g)*g,S=m.O.Rk(S,d,v),a[b].x=S)}},h.Fn=function(a,u,d,g,v,b){if(!u.Wc())throw m.i.fa("fold_into_360_degree_range");if(a.B())return a;if(u.Sb()==2){d=u.pv();var S=u.ov()-d}else{var C=u.bf();S=360*C,d-=180*C}return h.Hp(a,d,S,u,g,v,!0,b)},h.qF=function(a,u,d,g){if(d.Sb()==2)g=d.pv(),d=d.ov()-g;else{var v=d.bf();d=360*v,g-=180*v}h.av(a,u,g,d)},h.lj=function(a,u){var d=u.Oe();if(a.getType()==33){var g=a.ih();return d.G<=g&&g<=d.H?a:a.Ia()}g=new m.l,a.A(g);var v=new m.l;return v.K(d),v.v=g.v,v.C=g.C,v.W(.01*v.ca(),0),d=m.ta.uy(u,g),v.contains(g)?a:m.ri.clip(a,v,d,0,null)},h.ir=function(a,u,d){return a>u.C&&a-u.Cd.H?a[v].Rc():a[v].x=h.ir(a[v].x,d,g)},h.Jt=function(a,u,d,g){if(!a.B()){var v=a.getType();if(!g||v!=1736)if(m.aa.xj(v)){g=a.ub(0),v=0;for(var b=a.I();vg||gg)||!b&&(S!=0||g<-Me.y&&Te.y>g||g<-Te.y&&Me.y>g))do if(!(Math.abs(Me.x-Te.x)>=.5*N.R())){if(d.Sb()==2?(G[0][0]=h.Zm(Me.x,N),G[0][1]=Me.y,G[1][0]=h.Zm(Te.x,N),G[1][1]=Te.y,m.ej.projToGeogCenter(B,2,G,0),Fe.x=G[0][0]*O,Fe.y=G[0][1]*O,Xe.y=G[1][1]*O):(Fe.x=Me.x*O,Fe.y=Me.y*O,Xe.y=Te.y*O),Xe.x=2*(Te.x-Me.x)*Math.PI/N.R()+Fe.x,b){if(oe.x=C,oe.y=h.Nz(R,$,Fe,Xe,C,v),isNaN(oe.y))break;me[0]=oe;var yi=1}else if(v==p.GreatElliptic){var di=[0,0];if((yi=m.Ox.Oz($,Fe,Xe,C,di))==0)break;oe.x=di[0],oe.y=C,me[0]=oe,yi==2&&(ge.x=di[1],ge.y=C,me[1]=ge)}else{if(oe.x=h.Lz(R,$,Fe,Xe,v),isNaN(oe.x))break;oe.y=0,me[0]=oe,yi=1}var Ct=-1;for(di=0;diee[0]||(Ct=a.Ma(lt),a.Ul(Ct,ee,1),a.Cb(a.U(Ct),q.x,q.y),Ct=ee[0])}}while(!1);Me.L(Te)}}},h.Zm=function(a,u){var d=u.va-u.oa;return u.It(a-Math.floor((a-u.oa)/d)*d)},h.os=function(a,u,d,g){var v=new m.Nc;for(v.K(u,d),d=g.R(),a=Math.floor((a-u)/d)*d+a,v=v.sf();Math.abs(a-v)>Math.abs(a+d-v);)a+=d;return a},h.Sn=function(a,u,d){return a=m.qr.Cp(a),u=m.qr.mx(a,m.qr.Cp(u)),(d=m.qr.mx(a,m.qr.Cp(d)))==0||0u&&0>d&&d>=u},h.Nz=function(a,u,d,g,v,b){if(b==p.GreatElliptic)return m.Ox.SS(u,d,g,v);if(Math.abs(d.x-g.x)>=Math.PI||!h.Sn(d.x,g.x,v))return NaN;if(d.x>g.x)var S=g;else S=d,d=g;g=new m.ga;var C=new m.ga,O=new m.ga;m.kb.wd(a,u,S.x,S.y,d.x,d.y,C,g,null,b);var R=C.u,$=0,N=1,B=new m.h;for(B.L(S);R*(N-$)>1e-12*a;){var G=.5*($+N);if(m.kb.oj(a,u,S.x,S.y,R*G,g.u,C,O,b),B.x=C.u,B.y=O.u,B.x==v)break;if(h.Sn(S.x,B.x,v))N=G;else{if(!h.Sn(d.x,B.x,v))return NaN;$=G}}return B.y},h.Lz=function(a,u,d,g,v){if(v==p.GreatElliptic)return a=[0,0],m.Ox.Oz(u,d,g,0,a),a[0];if(d.y>g.y)var b=g;else b=d,d=g;if((g=new m.Nc).K(b.y,d.y),!g.contains(0)||Math.abs(b.x-d.x)>=Math.PI)return NaN;if(b.x==d.x)return b.x;var S=new m.ga,C=new m.ga,O=new m.ga;m.kb.wd(a,u,b.x,b.y,d.x,d.y,C,S,null,v);var R=C.u,$=0,N=1,B=new m.h;for(B.L(b);R*(N-$)>1e-12*a;){var G=.5*($+N);if(m.kb.oj(a,u,b.x,b.y,R*G,S.u,C,O,v),B.x=C.u,B.y=O.u,g.K(b.y,B.y),B.y==0)break;if(g.contains(0))N=G;else{if(g.K(d.y,B.y),!g.contains(0))return NaN;$=G}}return B.x},h.WI=function(a,u,d,g){if(!a.ef.Wc())return!1;var v=new m.de(u.description);if(v.Fd(u,0,-1),g=m.Hx.local().V(v,a,g),v=u.I(),d.Oa(),v!=g.I())return!1;var b=new m.l;u.A(b);var S=new m.l;if(g.A(S),b=b.R(),S=S.R(),b!=0&&S!=0){if(S/=b,a=a.Yf.gh().R()/a.ef.gh().R(),1e-10=180*u&&(a-=360*u),a},h.UI=function(a,u,d,g){if(d==D.Clip){var v=u.ml();v.getType()==197?(d=new m.l,v.A(d),v=m.ta.uy(u,d),a=m.ri.clip(a,d,v,5e4*u.pm(),g)):m.dj.local().V(1,v,a,u,g)||(a=m.Xj.local().V(a,v,u,g))==v&&(a=m.Vk.jg(a))}else u.Wc()&&(g=new m.l,a.xc(g),u.Oe().contains(g)||(h.Jt(a,u.Oe(),u.Xd(0),!0),d==D.PannableFold&&(a=h.lj(a,u)),a=h.Fn(a,u,0,!0,1e5*u.pm(),null)));return a},h.XD=function(a,u,d){var g=u.Wr();if(g==null)return a;var v=(u=u.sc()).Oe().R(),b=new m.l;a.xc(b);var S=new m.Nc;b.cn(S),b=g.Ga(),g=null;for(var C=new m.Dd;b.$a();)for(;b.Ha();){var O=b.ha(),R=O.Tg(0,0),$=new m.Nc;for($.K(R.oa,R.va),R=0;$.va>S.oa;)$.move(-v),--R;for(;$.oa<=S.va;){if($.isIntersecting(S)){g==null&&(g=new m.Ta);var N=m.yb.cP(O.ac(),O.wc());R!=0&&(C.gg(R*v,0),N.Oc(C)),g.oc(N,!0)}$.move(v),++R}}return g!=null?(u=m.ta.gO(u,g),u=m.ta.Er(u),m.$t.lP(a,g,u,d)):a},h.eO=function(a,u,d,g,v){return a>=d&&u<=g?0:h.tE(.5*(u+a),d,g,v)},h.tE=function(a,u,d,g){return m.lc.round((.5*(d+u)-a)/g)*g},h.VQ=function(a,u,d,g,v,b,S,C){var O=h.dv(g,v),R=O.R(),$=R/360,N=h.pE*$,B=a.ub(0),G=u.Wc(),K=G?R/u.Oe().R():0;u=a.Ia();for(var ee=0,q=d.da();eeN){if(oe){var pr=Me+cs-1,Ri=Me;(!Te||cs+11*$&&(G=!1)}oe||(nr=Gi+(Xe-=m.lc.Cn(R,nr-We)),++Mt,rn=Xe!=0,on.x=nr)}else yi||m.ta.AG(di,Ct,on,lt)&&(yi=!0);rn&&Fe.write(2*cs,nr),We=nr,di.L(Ct),Ct.L(on)}Mt!=0&&ge.Pc(1993),oe=ge.Na(0),me=ge.Na(me-1),m.h.tb(oe,me),ge=h.wQ(ge,g,isNaN(v)?0:v,b),u.add(ge,!1)}return a=g.Xd(0),d=O.R()/180,h.Jt(u,O,.1*a,!1),m.ri.clip(u,O,a,d,b)},h.wQ=function(a,u,d,g){return h.Fn(a,u,d,!0,0,g)},h.OS=function(a,u,d,g){var v=a.getType();if(v==1736)for(u=u!=null?u.Xd(0):0,v=0;vd)for(var v=new m.Sa,b=0;bd)for(var v=new m.Sa,b=0;bthis.Io},p.prototype.fz=function(){if(this.B())throw m.i.fa("invalid call");return new m.Sa(this.Bs.x,this.Bs.y)},p.prototype.Ua=function(){if(this.B())throw m.i.fa("invalid call");return this.Io},p.prototype.hz=function(){if(this.B())throw m.i.fa("invalid call");return this.Ka},p.prototype.Sz=function(){return(1&this.nw)!=0},p.prototype.ey=function(h,a,u,d){this.Bs.x=h,this.Bs.y=a,this.Io=u,this.Ka=d},p}();m.$l=E}(ie||(ie={})),function(m){var D=function(){function p(){}return p.prototype.Uo=function(h,a){if(this.th.resize(0),this.Ii.length=0,this.tk=-1,h.xc(this.Ek),this.Ek.W(a,a),this.Ek.isIntersecting(this.Fb.Ca)){var u=h.getType();(this.vs=m.aa.yd(u))?(this.TH=h.ac(),this.SH=h.wc(),this.qa=a):this.qa=NaN,this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf)}else this.Qs=-1},p.prototype.Xi=function(h,a){this.th.resize(0),this.Ii.length=0,this.tk=-1,this.Ek.K(h),this.Ek.W(a,a),this.qa=NaN,this.Ek.isIntersecting(this.Fb.Ca)?(this.th.add(this.Fb.kf),this.Ii.push(this.Fb.Ca),this.Qs=this.Fb.Ur(this.Fb.kf),this.vs=!1):this.Qs=-1},p.prototype.next=function(){if(this.th.size==0)return-1;this.tk=this.Qs;var h=null,a=null,u=null,d=null;this.vs&&(h=new m.h,a=new m.h,u=new m.l);for(var g=!1;!g;){for(;this.tk!=-1;){var v=this.Fb.bz(this.Fb.fv(this.tk));if(v.isIntersecting(this.Ek)){if(!this.vs){g=!0;break}if(h.L(this.TH),a.L(this.SH),u.K(v),u.W(this.qa,this.qa),0b;b++){var S=this.Fb.Lp(v,b);if(S!=-1&&0>d);g==0?(a.v=.5*(a.v+a.C),a.G=.5*(a.G+a.H)):g==1?(a.C=.5*(a.v+a.C),a.G=.5*(a.G+a.H)):(g==2?a.C=.5*(a.v+a.C):a.v=.5*(a.v+a.C),a.H=.5*(a.G+a.H))}return a},p.prototype.WR=function(h){return this.Az(h)},p.prototype.vR=function(h,a){return D.bP(this,h,a)},p.prototype.MF=function(h,a){return D.aP(this,h,a)},p.prototype.getIterator=function(){return D.$O(this)},p.prototype.Nk=function(h,a){if(0>a||32<2*a)throw m.i.N("invalid height");this.BT=a,this.Ca.K(h),this.kf=this.jf.Ce(),this.jx(this.kf,0),this.ax(this.kf,0),this.NJ(this.kf,0),this.KJ(this.kf,0)},p.prototype.zv=function(h,a,u,d,g,v,b){if(!d.contains(a))return u==0?-1:this.zv(h,a,0,this.Ca,this.kf,v,b);if(!v)for(var S=g;S!=-1;S=this.IR(S))this.jx(S,this.Az(S)+1);(S=new m.l).K(d),d=g;var C=[];for(C[0]=new m.l,C[1]=new m.l,C[2]=new m.l,C[3]=new m.l;uR;R++)if(C[R].contains(a)){O=!0;var $=this.Lp(d,R);$==-1&&($=this.rP(d,R)),this.jx($,this.Az($)+1),d=$,S.K(C[R]);break}if(!O)break}return this.sS(h,a,u,S,d,v,g,b)},p.prototype.sS=function(h,a,u,d,g,v,b,S){var C=this.NF(g);if(v){if(g==b)return S;this.SP(S),v=S}else v=this.tP(),this.NB(v,h),this.KW(this.fv(v),a);return this.mX(v,g),C!=-1?(this.hx(v,C),this.bx(C,v)):this.GJ(g,v),this.SB(g,v),this.ax(g,this.lv(g)+1),this.hO(g)&&this.MQ(u,d,g),v},p.prototype.SP=function(h){var a=this.WF(h),u=this.NF(a),d=this.OR(h),g=this.nv(h);this.Ur(a)==h?(g!=-1?this.hx(g,-1):this.SB(a,-1),this.GJ(a,g)):u==h?(this.bx(d,-1),this.SB(a,d)):(this.hx(g,d),this.bx(d,g)),this.hx(h,-1),this.bx(h,-1),this.ax(a,this.lv(a)-1)},p.EJ=function(h,a){var u=.5*(h.v+h.C),d=.5*(h.G+h.H);a[0].K(u,d,h.C,h.H),a[1].K(h.v,d,u,h.H),a[2].K(h.v,h.G,u,d),a[3].K(u,h.G,h.C,d)},p.prototype.hO=function(h){return this.lv(h)==8&&!this.gG(h)},p.prototype.MQ=function(h,a,u){var d=this.Ur(u);do{var g=this.fv(d),v=this.Zh.T(d,0);g=this.bz(g),this.zv(v,g,h,a,u,!0,d),d=v=this.nv(d)}while(d!=-1)},p.prototype.iO=function(h){return 8<=this.lv(h)||this.gG(h)},p.prototype.gG=function(h){return this.Lp(h,0)!=-1||this.Lp(h,1)!=-1||this.Lp(h,2)!=-1||this.Lp(h,3)!=-1},p.prototype.rP=function(h,a){var u=this.jf.Ce();return this.OW(h,a,u),this.jx(u,0),this.ax(u,0),this.Pk(u,h),this.KJ(u,this.jv(h)+1),this.NJ(u,a<<2*this.jv(h)|this.QF(h)),u},p.prototype.tP=function(){var h=this.Zh.Ce();if(0>4)]|=this.iH<<2*(15&g)},h}();m.HY=E;var p=function(){function h(a,u,d){this.Vh=null,this.SA=this.Ik=this.cI=this.aI=this.Es=this.qH=this.Gf=this.Um=0,this.Ri=this.Jk=this.vl=null,this.Fz(a,u,d)}return h.create=function(a,u,d){if(!h.zE(a))throw m.i.N();return h.wP(a,u,d)},h.pW=function(a){switch(a){case 0:a=1024;break;case 1:a=16384;break;case 2:a=262144;break;default:throw m.i.fa("Internal Error")}return a},h.zE=function(a){return!(a.B()||a.getType()!=1607&&a.getType()!=1736)},h.prototype.rQ=function(a,u){u=u.Ga();for(var d=new m.h,g=new m.h;u.$a();)for(;u.Ha();){var v=u.ha();if(v.getType()!=322)throw m.i.fa("Internal Error");a.Eh(v.ac(),d),a.Eh(v.wc(),g),this.Ri.jy(d.x,d.y,g.x,g.y)}this.Ri.iJ(m.Px.Cx)},h.prototype.sQ=function(){throw m.i.fa("Internal Error")},h.prototype.Ry=function(a,u){for(var d=1;4>d;d++)a.jy(u[d-1].x,u[d-1].y,u[d].x,u[d].y);a.jy(u[3].x,u[3].y,u[0].x,u[0].y),this.Ri.iJ(m.Px.Cx)},h.prototype.rK=function(a,u,d){for(var g=[null,null,null,null],v=0;v(G=v.length());G==0?v.ma(1,0):(K||$.L(O),v.scale(d/G),b.ma(-v.y,v.x),S.ma(v.y,-v.x),C.sub(v),O.add(v),g[0].add(C,b),g[1].add(C,S),g[2].add(O,S),g[3].add(O,b),K?N=!0:this.Ry(a,g))}else N&&(this.Ry(a,g),N=!1),B=!0}N&&this.Ry(a,g)}},h.prototype.sC=function(a){return m.O.truncate(a*this.qH+this.aI)},h.prototype.tC=function(a){return m.O.truncate(a*this.Es+this.cI)},h.wP=function(a,u,d){return new h(a,u,d)},h.prototype.Fz=function(a,u,d){this.Gf=Math.max(m.O.truncate(2*Math.sqrt(d)+.5),64),this.Um=m.O.truncate((2*this.Gf+31)/32),this.vl=new m.l,this.Ik=u,d=0;for(var g=this.Gf,v=this.Um;8<=g;)d+=g*v,g=m.O.truncate(g/2),v=m.O.truncate((2*g+31)/32);this.Vh=m.O.lg(d,0),this.Ri=new m.Px,d=new E(this.Vh,this.Um,this),this.Ri.AX(this.Gf,this.Gf,d),a.A(this.vl),this.vl.W(u,u),g=new m.l;var b=u*(v=m.l.construct(1,1,this.Gf-2,this.Gf-2)).R();switch(u*=v.ca(),g.K(this.vl.sf(),Math.max(b,this.vl.R()),Math.max(u,this.vl.ca())),this.SA=this.Ik,this.Jk=new m.Dd,this.Jk.pS(g,v),new m.Dd,a.getType()){case 550:d.setColor(this.Ri,2),this.sQ();break;case 1607:d.setColor(this.Ri,2),this.rK(this.Ri,a,this.SA);break;case 1736:d.setColor(this.Ri,1),this.rQ(this.Jk,a),d.setColor(this.Ri,2),this.rK(this.Ri,a,this.SA)}this.qH=this.Jk.bb,this.Es=this.Jk.ab,this.aI=this.Jk.Gb,this.cI=this.Jk.Lb,this.XN()},h.prototype.XN=function(){this.Ri.flush();for(var a=0,u=this.Gf*this.Um,d=this.Gf,g=m.O.truncate(this.Gf/2),v=this.Um,b=m.O.truncate((2*g+31)/32);8>4;R=2*(15&R);var B=$>>4;$=2*(15&$);var G=this.Vh[a+v*S+N]>>R&3;G|=this.Vh[a+v*S+B]>>$&3,G|=this.Vh[a+v*C+N]>>R&3,G|=this.Vh[a+v*C+B]>>$&3,this.Vh[u+b*d+(O>>4)]|=G<<2*(15&O)}d=g,v=b,a=u,g=m.O.truncate(d/2),b=m.O.truncate((2*g+31)/32),u=a+v*d}},h.prototype.So=function(a,u){return this.vl.contains(a,u)?(a=this.sC(a),u=this.tC(u),0>a||a>=this.Gf||0>u||u>=this.Gf||(u=this.Vh[this.Um*u+(a>>4)]>>2*(15&a)&3)==0?0:u==1?1:2):0},h.prototype.Ro=function(a){if(!a.Ea(this.vl))return 0;var u=this.sC(a.v),d=this.sC(a.C),g=this.tC(a.G);if(a=this.tC(a.H),0>u&&(u=0),0>g&&(g=0),d>=this.Gf&&(d=this.Gf-1),a>=this.Gf&&(a=this.Gf-1),u>d||g>a)return 0;for(var v=Math.max(d-u,1)*Math.max(a-g,1),b=0,S=this.Um,C=this.Gf,O=0;;){if(32>v||16>C){for(v=g;v<=a;v++)for(var R=u;R<=d;R++)if(1<(O=this.Vh[b+S*v+(R>>4)]>>2*(15&R)&3))return 2;if(O==0)return 0;if(O==1)return 1}b+=S*C,C=m.O.truncate(C/2),S=m.O.truncate((2*C+31)/32),u=m.O.truncate(u/2),g=m.O.truncate(g/2),d=m.O.truncate(d/2),a=m.O.truncate(a/2),v=Math.max(d-u,1)*Math.max(a-g,1)}},h.prototype.RR=function(){return this.Gf*this.Um},h}();m.Nx=p}(ie||(ie={})),function(m){var D;(D=m.VL||(m.VL={}))[D.contains=1]="contains",D[D.within=2]="within",D[D.equals=3]="equals",D[D.disjoint=4]="disjoint",D[D.touches=8]="touches",D[D.crosses=16]="crosses",D[D.overlaps=32]="overlaps",D[D.unknown=0]="unknown",D[D.intersects=1073741824]="intersects";var E=function(){function h(){}return h.construct=function(a,u,d,g,v,b,S,C){var O=new h;return O.pw=a,O.Mm=u,O.Kj=d,O.Si=g,O.BH=v,O.SY=b,O.TY=S,O.UY=C,O},h}();m.Vt=function(){function h(){}return h.CD=function(a,u,d){if(h.wy(a)){var g=m.ta.kj(u,a,!1);u=!1,m.Uk.CE(a)&&(u=u||a.lu(g,d)),(g=a.getType())!=1736&&g!=1607||!m.Uk.AE(a)||d==0||(u=u||a.fj(d)),g!=1736&&g!=1607||!m.Uk.BE(a)||d==0||u||a.hM()}},h.wy=function(a){return m.Uk.CE(a)||m.Uk.AE(a)||m.Uk.BE(a)},h}();var p=function(){function h(){this.rh=[]}return h.zB=function(a,u,d,g,v){var b=a.getType(),S=u.getType();if(b==197){if(S==197)return h.tW(a,u,d,g);if(S==33)return g==2?g=1:g==1&&(g=2),h.hJ(u,a,d,g)}else if(b==33){if(S==197)return h.hJ(a,u,d,g);if(S==33)return h.vW(a,u,d,g)}if(a.B()||u.B())return g==4;var C=new m.l;a.A(C);var O=new m.l;u.A(O);var R=new m.l;if(R.K(C),R.Zb(O),d=m.ta.Wd(d,R,!1),h.dk(C,O,d))return g==4;switch(C=!1,m.Vk.yd(b)&&((b=new m.Ta(a.description)).oc(a,!0),a=b,b=1607),m.Vk.yd(S)&&((S=new m.Ta(u.description)).oc(u,!0),u=S,S=1607),b!=197&&S!=197?(a.Db()4*Math.max(a.I(),u.I())*d)&&h.Wz(a,u,d,!0)))},h.kV=function(a,u,d){var g=h.qc(a,u,!0);return g==4||g!=1&&g!=2&&g!=1073741824&&h.EI(a,u,d)},h.vV=function(a,u,d){var g=h.qc(a,u,!1);return g!=4&&g!=1&&g!=2&&h.II(a,u,d,null)},h.qV=function(a,u,d,g){var v=h.qc(a,u,!1);return v!=4&&v!=1&&v!=2&&h.FI(a,u,d,g)},h.Sw=function(a,u,d,g){var v=new m.l,b=new m.l;return a.A(v),u.A(b),!!h.zc(v,b,d)&&(v=h.qc(a,u,!1))!=4&&v!=2&&(v==1||h.BI(a,u,d,g))},h.lV=function(a,u,d){var g=h.qc(a,u,!0);return g==4||g!=1&&g!=1073741824&&h.EI(a,u,d)},h.wV=function(a,u,d,g){var v=h.qc(a,u,!1);return v!=4&&v!=1&&h.JI(a,u,d,g)},h.gV=function(a,u,d){var g=h.qc(a,u,!1);return g!=4&&g!=1&&h.DI(a,u,d,null)},h.fB=function(a,u,d,g){var v=new m.l,b=new m.l;return a.A(v),u.A(b),!!h.zc(v,b,d)&&(v=h.qc(a,u,!1))!=4&&(v==1||h.CI(a,u,d,g))},h.jV=function(a,u,d){return m.hd.KG(a,u,d)==0},h.uV=function(a,u,d){return u=u.D(),h.HI(a,u,d)},h.dV=function(a,u,d){return u=u.D(),h.AI(a,u,d)},h.iV=function(a,u,d){var g=h.qc(a,u,!1);if(g==4)return!0;if(g==1)return!1;g=new m.l,a.A(g),g.W(d,d);for(var v=new m.h,b=0;bd&&b.R()>d||b.ca()<=d&&b.R()<=d)&&(v=new m.Ta,b=new m.Sa,u.Hf(0,b),v.nf(b),u.Hf(2,b),v.lineTo(b),h.DI(a,v,d,g))},h.IV=function(a,u,d){var g=new m.l,v=new m.l;return a.A(g),u.A(v),!(!h.ek(g,v,d)||h.qc(a,u,!1)==4)&&(!!h.dI(a,u,d)||h.Wz(a,u,d,!1))},h.GV=function(a,u,d){return this.qc(a,u,!1)==4||!!new m.Zl(a,u,d,!0).next()&&!this.UG(a,u,d)},h.NI=function(a,u,d){if(h.qc(a,u,!1)==4)return!1;var g=new m.be(0);if(h.Xz(a,u,d,g)!=0)return!1;for(var v=new m.de,b=0;bd&&v.R()>d)&&h.ek(g,v,d)},h.DV=function(a,u,d){var g=new m.l,v=new m.l;return a.A(g),u.A(v),!h.zc(v,g,d)&&!h.TG(a,v,d)},h.OV=function(a,u,d){var g=new m.l,v=new m.l;if(a.A(g),u.A(v),v.ca()<=d&&v.R()<=d)return v=u.Ip(),h.Zz(a,v,d);if(v.ca()<=d||v.R()<=d)return v=new m.Ta,g=new m.Sa,u.Hf(0,g),v.nf(g),u.Hf(2,g),v.lineTo(g),h.NI(a,v,d);a=a.Ga(),u=new m.l,g=new m.l,u.K(v),g.K(v),u.W(-d,-d),g.W(d,d),v=!1;for(var b=new m.l,S=new m.l;a.$a();)for(;a.Ha();){if(a.ha().A(b),S.K(u),S.Ea(b),!S.B()&&(S.ca()>d||S.R()>d))return!1;S.K(g),S.Ea(b),S.B()||(v=!0)}return v},h.LV=function(a,u,d){var g=new m.l,v=new m.l;return a.A(g),u.A(v),!(h.zc(g,v,d)||h.zc(v,g,d)||h.zc(v,g,d)||v.ca()>d&&v.R()>d||v.ca()<=d&&v.R()<=d)&&(g=new m.Ta,v=new m.Sa,u.Hf(0,v),g.nf(v),u.Hf(2,v),g.lineTo(v),h.WG(a,g,d))},h.RV=function(a,u,d){var g=new m.l,v=new m.l;if(a.A(g),u.A(v),!h.zc(v,g,d)||v.ca()<=d&&v.R()<=d)return!1;if(v.ca()<=d||v.R()<=d)return h.zc(v,g,d);a=a.Ga(),(u=new m.l).K(v),u.W(-d,-d),v=!1,g=new m.l;for(var b=new m.l;a.$a();)for(;a.Ha();)a.ha().A(g),u.hm(g)?v=!0:(b.K(u),b.Ea(g),!b.B()&&(b.ca()>d||b.R()>d)&&(v=!0));return v},h.yV=function(a,u,d){var g=new m.l,v=new m.l;return u.A(v),a.A(g),!(!h.zc(g,v,d)||v.ca()>d&&v.R()>d)&&(v.ca()<=d&&v.R()<=d?(u=u.Ip(),h.SG(a,u,d)):(g=new m.Ta,v=new m.Sa,u.Hf(0,v),g.nf(v),u.Hf(2,v),g.lineTo(v),h.ym(g,a,d,!1)))},h.BV=function(a,u,d){var g=new m.l,v=new m.l;if(a.A(g),u.A(v),h.zc(v,g,d)||v.ca()<=d&&v.R()<=d)return!1;if(v.ca()<=d||v.R()<=d)return g=new m.Ta,v=new m.Sa,u.Hf(0,v),g.nf(v),u.Hf(2,v),g.lineTo(v),h.LI(a,g,d);a=a.Ga(),u=new m.l,(g=new m.l).K(v),u.K(v),g.W(-d,-d),u.W(d,d);for(var b=v=!1,S=new m.l,C=new m.l;a.$a();)for(;a.Ha();)if(a.ha().A(S),b||u.contains(S)||(b=!0),v||(C.K(g),C.Ea(S),!C.B()&&(C.ca()>d||C.R()>d)&&(v=!0)),v&&b)return!0;return!1},h.iU=function(a,u,d){var g=new m.l,v=new m.l;return a.A(g),u.A(v),!!h.ek(g,v,d)&&(!!h.jU(a,u,d)||h.YA(a,u,d,!1,!0,!1))},h.gU=function(a,u,d){return!h.gI(a,u,d)},h.oU=function(a,u,d){return h.YA(a,u,d,!1,!1,!0)},h.eI=function(a,u,d){var g=new m.l,v=new m.l;return a.A(g),u.A(v),!!h.zc(g,v,d)&&h.YA(u,a,d,!0,!1,!1)},h.Mw=function(a,u,d){d*=d;for(var g=new m.h,v=new m.h,b=0;bd||v.R()>d)&&h.ek(g,v,d)},h.fU=function(a,u,d){var g=new m.l,v=new m.l;if(a.A(g),u.A(v),h.zc(v,g,d))return!1;for((u=new m.l).K(v),u.W(d,d),d=new m.h,v=0;vd?b.W(0,-d):b.W(-d,0);for(var C=0;Cd){if(u.y>b.G&&u.yb.v&&u.xd?g.W(0,-d):g.W(-d,0),b.W(d,d);for(var S=new m.h,C=0;Cd?S.y>g.G&&S.yg.v&&S.xd||v.R()>d)&&(u=u.Ip(),!h.kt(a,u,d))},h.eU=function(a,u,d){var g=new m.l,v=new m.l;if(a.A(g),u.A(v),h.zc(v,g,d)||v.ca()<=d&&v.R()<=d)return!1;if(v.ca()<=d||v.R()<=d){u=new m.l,g=new m.l,u.K(v),v.ca()>d?u.W(0,-d):u.W(-d,0),g.K(v),g.W(d,d);for(var b=new m.h,S=!1,C=!1,O=0;Od?b.y>u.G&&b.yu.v&&b.xd*d},h.uI=function(a,u,d){return h.wI(a,u,d)},h.vI=function(a,u,d){var g=new m.l;return g.K(a),h.ek(g,u,d)},h.Rw=function(a,u,d){var g=new m.l;return g.K(u),g.W(d,d),!g.contains(a)},h.dB=function(a,u,d){if(u.ca()<=d&&u.R()<=d)return!1;var g=new m.l,v=new m.l;if(g.K(u),g.W(d,d),!g.contains(a))return!1;if(u.ca()<=d||u.R()<=d){if(v.K(u),u.ca()>d?v.W(0,-d):v.W(-d,0),u.ca()>d){if(a.y>v.G&&a.yv.v&&a.xd?g.W(0,-d):g.W(-d,0);var v=!1;return u.ca()>d?a.y>g.G&&a.yg.v&&a.xd&&a.R()>d&&(u.ca()<=d||u.R()<=d)?g=u:(g=a,a=u),g.ca()<=d||g.R()<=d){if(a.ca()<=d||a.R()<=d){u=new m.yb;var v=new m.yb,b=[0,0],S=[0,0],C=new m.h;return g.dn(C),u.Dc(C),g.en(C),u.Qc(C),a.dn(C),v.Dc(C),a.en(C),v.Qc(C),u.Ea(v,null,b,S,d),u.Ea(v,null,null,null,d)==1&&(b[0]==0||b[1]==1||S[0]==0||S[1]==1)}return u=new m.l,v=new m.l,u.K(a),u.W(-d,-d),v.K(u),v.Ea(g),!(!v.B()&&(v.ca()>d||v.R()>d))}return a.W(d,d),(v=new m.l).K(g),v.Ea(a),!(v.B()||!v.B()&&v.ca()>d&&v.R()>d)},h.bQ=function(a,u,d){if(h.zc(a,u,d)||h.zc(u,a,d)||a.ca()<=d&&a.R()<=d||u.ca()<=d&&u.R()<=d)return!1;if(a.ca()<=d||a.R()<=d){if(u.ca()>d&&u.R()>d)return!1;var g=new m.yb,v=new m.yb,b=[0,0],S=[0,0],C=new m.h;return a.dn(C),g.Dc(C),a.en(C),g.Qc(C),u.dn(C),v.Dc(C),u.en(C),v.Qc(C),g.Ea(v,null,b,S,d),g.Ea(v,null,null,null,d)==2&&(0b[1])&&(0S[1])}return!(u.ca()<=d||u.R()<=d)&&((g=new m.l).K(a),g.Ea(u),!(g.B()||g.ca()<=d||g.R()<=d))},h.jF=function(a,u,d){if(!h.zc(a,u,d))return!1;if(a.ca()<=d&&a.R()<=d)return a=a.sf(),h.eB(a,u,d);if(u.ca()<=d&&u.R()<=d)return u=u.sf(),h.eB(u,a,d);if(a.ca()<=d||a.R()<=d)return h.zc(a,u,d);if(u.ca()<=d||u.R()<=d){var g=new m.l;return g.K(a),g.W(-d,-d),g.hm(u)?!0:((a=new m.l).K(g),a.Ea(u),!(a.B()||a.ca()<=d&&a.R()<=d))}return h.zc(a,u,d)},h.aQ=function(a,u,d){if(h.zc(a,u,d)||h.zc(u,a,d)||a.ca()<=d&&a.R()<=d||u.ca()<=d&&u.R()<=d||u.ca()>d&&u.R()>d&&a.ca()>d&&a.R()>d)return!1;if(a.ca()>d&&a.R()>d)var g=u;else g=a,a=u;if(a.ca()>d&&a.R()>d){u=new m.l;var v=new m.l;return v.K(a),v.W(-d,-d),u.K(v),u.Ea(g),!(u.B()||u.ca()<=d&&u.R()<=d)}u=new m.yb,v=new m.yb;var b=[0,0],S=[0,0],C=new m.h;return g.dn(C),u.Dc(C),g.en(C),u.Qc(C),a.dn(C),v.Dc(C),a.en(C),v.Qc(C),u.Ea(v,null,b,S,d),u.Ea(v,null,null,null,d)==1&&0b[1]&&0S[1]},h.EI=function(a,u,d){var g=new m.l,v=new m.l,b=new m.Zl(a,u,d,!0);if(!b.next())return!0;if(this.UG(a,u,d))return!1;var S=a,C=null;u.getType()==1736&&(C=u);var O=!1,R=!1;do{var $=b.nl(),N=b.hl();if(N=u.Na(u.Ba(N)),g.K(b.uz()),g.W(d,d),g.contains(N)&&(N=m.hd.Yd(S,N,0))!=0||u.getType()==1736&&($=a.Na(a.Ba($)),v.K(b.az()),v.W(d,d),v.contains($)&&(N=m.hd.Yd(C,$,0))!=0))return!1;O||(!m.Dg.Ml(a,u.da()-1)||a.Bb!=null&&a.Bb.Fb!=null?S=a:(S=new m.Da,a.copyTo(S),S.fj(1)),O=!0),u.getType()!=1736||R||(R=u,!m.Dg.Ml(R,a.da()-1)||u.Bb!=null&&u.Bb.Fb!=null?C=u:(C=new m.Da,R.copyTo(C),C.fj(1)),R=!0)}while(b.next());return!0},h.zc=function(a,u,d){var g=new m.l;return g.K(a),g.W(d,d),g.contains(u)},h.ls=function(a,u,d){var g=new m.l;return g.K(u),g.W(d,d),u=new m.h,a.dn(u),!g.contains(u)||(a.$I(u),!g.contains(u)||(a.cJ(u),!g.contains(u)||(a.en(u),!g.contains(u))))},h.dI=function(a,u,d){if(a.da()!=u.da()||a.I()!=u.I())return!1;var g=new m.h,v=new m.h,b=!0;d*=d;for(var S=0;Sd){b=!1;break}if(!b)break}return!!b},h.jU=function(a,u,d){if(a.I()!=u.I())return!1;var g=new m.h,v=new m.h,b=!0;d*=d;for(var S=0;Sd){b=!1;break}return!!b},h.YA=function(a,u,d,g,v,b){var S=!1;if(a.I()>u.I()){g&&(g=!1,S=!0);var C=u}else C=a,a=u;if(u=null,v||b||S){u=new m.pn(a.I());for(var O=0;Ou.I())var g=u;else g=a,a=u;u=new m.l;var v=new m.l,b=new m.l;g.A(u),a.A(v),u.W(d,d),v.W(d,d),b.K(u),b.Ea(v),v=new m.h;for(var S=new m.h,C=d*d,O=m.ta.oE(a,b),R=O.getIterator(),$=0;$d)return!1;if(q*(1-(ge=b.Si))<=d||ge==1)break}if(q*(1-ge)>d)return!1;R=0,$.resize(0),N.rh.length=0}}return S},h.WG=function(a,u,d){if(1>h.Xz(a,u,d,null))return!1;var g=new m.l,v=new m.l;a.A(g),u.A(v);var b=h.ls(g,v,d);return g=h.ls(v,g,d),!(!b||!g)||(b&&!g?!h.ym(u,a,d,!1):g&&!b?!h.ym(a,u,d,!1):!h.ym(a,u,d,!1)&&!h.ym(u,a,d,!1))},h.Xz=function(a,u,d,g){function v(Ct,rn){return B.QE(Ct,rn)}if(a.yz()>u.yz())var b=u,S=a;else b=a,S=u;a=b.Ga(),u=S.Ga();var C=[0,0],O=[0,0],R=-1,$=0,N=new m.ia(0),B=new h,G=new m.l,K=new m.l,ee=new m.l;b.A(G),S.A(K),G.W(d,d),K.W(d,d),ee.K(G),ee.Ea(K),b=null,g!=null&&(b=new m.h);var q=K=K=null,oe=S.Bb;for(oe!=null?(K=oe.Fb,q=oe.zo,K==null&&(K=m.ta.jj(S,ee))):K=m.ta.jj(S,ee),S=K.getIterator(),oe=null,q!=null&&(oe=q.getIterator());a.$a();)for(q=0;a.Ha();){var ge=a.ha();if(ge.A(G),G.isIntersecting(ee)){if(oe!=null&&(oe.Xi(G,d),oe.next()==-1))continue;var me=ge.Qb();S.Uo(ge,d);for(var Me=S.next();Me!=-1;Me=S.next()){var Te=K.ja(Me);u.Vb(Te);var Fe=u.ha(),Xe=Fe.Qb(),We=ge.Ea(Fe,null,C,O,d);if(0d)return 1;var yi=me*(Mt-Me);if(u.Ha()){if(Fe=u.ha(),(We=ge.Ea(Fe,null,C,null,d))==2){We=C[0];var di=C[1];if(yi+(We=me*(di-We))>d)return 1}u.Vb(Te),u.ha()}if(!u.vm()){if(u.li(),Fe=u.li(),(We=ge.Ea(Fe,null,C,null,d))==2&&(We=C[0],yi+(We=me*((di=C[1])-We))>d))return 1;u.Vb(Te),u.ha()}if(a.Ha()){if(Te=a.wb(),(We=(ge=a.ha()).Ea(Fe,null,C,null,d))==2&&(We=C[0],yi+(We=me*((di=C[1])-We))>d))return 1;a.Vb(Te),a.ha()}if(!a.vm()){if(Te=a.wb(),a.li(),(We=(ge=a.li()).Ea(Fe,null,C,null,d))==2&&(We=C[0],yi+(We=Xe*((di=C[1])-We))>d))return 1;a.Vb(Te),a.ha()}Fe=E.construct(a.wb(),a.gb,Me,Mt,u.wb(),u.gb,R,lt),B.rh.push(Fe),N.add(N.size)}R=0,g!=null&&(ge.hc(Me,b),g.add(b.x),g.add(b.y))}}if($d)q=me*(Fe.Si-Fe.Kj),ge=Fe.Si,Me=Fe.Mm;else{if(Fe.Mm!=Me?(q=me*(Fe.Si-Fe.Kj),Me=Fe.Mm):q+=me*(Fe.Si-Fe.Kj),q>d)return 1;if((ge=Fe.Si)==1)break}me*(1-ge)>d&&(q=0),$=0,N.resize(0),B.rh.length=0}}}return R},h.UG=function(a,u,d){var g=a.Ga(),v=u.Ga();for(a=new m.Zl(a,u,d,!1);a.next();){u=a.nl();var b=a.hl();if(g.Vb(u),v.Vb(b),u=g.ha(),0d)return!1;$=!0}else if(B!=0){if($=C[0],N=O[0],0<$&&1>$&&0N)return!1;$=!0}}return!!$&&(b=new m.l,S=new m.l,v=new m.l,a.A(b),u.A(S),b.W(1e3*d,1e3*d),S.W(1e3*d,1e3*d),v.K(b),v.Ea(S),!(10d&&(O=!0,R&&$))return!0}else if(q!=0&&(q=G[0],oe=K[0],0q&&0oe))return!0}if(v=new m.l,N=new m.l,v.K(b),v.W(1e3*d,1e3*d),N.K(S),N.W(1e3*d,1e3*d),C.K(v),C.Ea(N),b="",b=O?b+"**":b+"T*",R){if(10$&&0N)))return g[0]=!0,!1}if(!R){for(g[0]=!0,S=new m.l,a.A(S),S.W(d,d),O=a,R=!1,C=new m.l,g=0,v=u.da();gR&&0<$&&1>$)return!1;R=!0}}return!!R&&(b=new m.l,S=new m.l,v=new m.l,a.A(b),u.A(S),b.W(1e3*d,1e3*d),S.W(1e3*d,1e3*d),v.K(b),v.Ea(S),!(10R&&0<$&&1>$)return!0;R=!0}}return!!R&&(b=new m.l,S=new m.l,C=new m.l,O=new m.l,v=new m.l,a.A(b),u.A(S),h.ls(S,b,d)?(C.K(b),C.W(1e3*d,1e3*d),O.K(S),O.W(1e3*d,1e3*d),v.K(C),v.Ea(O),!(10b;b++){var S=g.charAt(b);if(S!="*"&&S!="T"&&S!="F"&&S!="0"&&S!="1"&&S!="2")throw m.i.fa("relation string")}if((b=this.MR(g,a.Db(),u.Db()))!=0)return m.ud.zB(a,u,d,b,v);b=new m.l,a.A(b),S=new m.l,u.A(S);var C=new m.l;if(C.K(b),C.Zb(S),d=m.ta.Wd(d,C,!1),a=this.WE(a,d),u=this.WE(u,d),a.B()||u.B())return this.uW(a,u,g);switch(b=a.getType(),S=u.getType(),C=!1,b){case 1736:switch(S){case 1736:C=this.rt(a,u,d,g,v);break;case 1607:C=this.$m(a,u,d,g,v);break;case 33:C=this.qt(a,u,d,g);break;case 550:C=this.pt(a,u,d,g,v)}break;case 1607:switch(S){case 1736:C=this.$m(u,a,d,this.Zp(g),v);break;case 1607:C=this.gB(a,u,d,g,v);break;case 33:C=this.tt(a,u,d,g,v);break;case 550:C=this.st(a,u,d,g,v)}break;case 33:switch(S){case 1736:C=this.qt(u,a,d,this.Zp(g));break;case 1607:C=this.tt(u,a,d,this.Zp(g),v);break;case 33:C=this.$U(a,u,d,g);break;case 550:C=this.lt(u,a,d,this.Zp(g))}break;case 550:switch(S){case 1736:C=this.pt(u,a,d,this.Zp(g),v);break;case 1607:C=this.st(u,a,d,this.Zp(g),v);break;case 550:C=this.ZA(a,u,d,g,v);break;case 33:C=this.lt(a,u,d,g)}break;default:C=!1}return C},h.rt=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.xJ();var S=new m.l,C=new m.l;return a.A(S),u.A(C),g=!1,m.ud.dk(S,C,d)&&(b.Cu(a,u),g=!0),g||((S=m.ud.qc(a,u,!1))==4?(b.Cu(a,u),g=!0):S==1?(b.ly(u),g=!0):S==2&&(b.ZD(a),g=!0)),g||(a=(g=new m.gd).Ib(a),u=g.Ib(u),b.Wo(g,d,v),b.Bp(a,u),b.j.Ug()),h.fg(b.J,b.Xc)},h.Sw=function(a,u,d,g){var v=new h;v.Yi(),v.bj("T*****F**"),v.xJ();var b=new m.l,S=new m.l;a.A(b),u.A(S);var C=!1;return m.ud.dk(b,S,d)&&(v.Cu(a,u),C=!0),C||((b=m.ud.qc(a,u,!1))==4?(v.Cu(a,u),C=!0):b==1?(v.ly(u),C=!0):b==2&&(v.ZD(a),C=!0)),C?this.fg(v.J,v.Xc):(a=(C=new m.gd).Ib(a),b=C.Ib(u),m.Tk.V(C,d,g,!1),d=C.Ne(b).mg(),C.Gp(0,!0,!0),m.rn.V(C,a,-1,!1,g),C.I(a)!=0&&(m.rn.V(C,b,-1,!1,g),v.er(C,g),(u=C.I(b)==0)||(v.Bp(a,b),v.j.Ug(),b=this.fg(v.J,v.Xc))?(a=C.Ne(a),a=(C=new m.gd).Ib(a),b=C.Ib(d),v.er(C,g),v.le=0,v.Yi(),v.bj(u?"T*****F**":"******F**"),v.IB(),v.Bp(a,b),v.j.Ug(),this.fg(v.J,v.Xc)):b))},h.$m=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.IB();var S=new m.l,C=new m.l;return a.A(S),u.A(C),g=!1,m.ud.dk(S,C,d)&&(b.Du(a,u),g=!0),g||((S=m.ud.qc(a,u,!1))==4?(b.Du(a,u),g=!0):S==1&&(b.$D(u),g=!0)),g||(a=(g=new m.gd).Ib(a),u=g.Ib(u),b.Wo(g,d,v),b.kh=b.j.Dp(),h.Jw(u,b.j,b.kh),b.Bp(a,u),b.j.Ep(b.kh),b.j.Ug()),h.fg(b.J,b.Xc)},h.fB=function(a,u,d,g){var v=new h;v.Yi(),v.bj("T*****F**"),v.IB();var b=new m.l,S=new m.l;a.A(b),u.A(S);var C=!1;return m.ud.dk(b,S,d)&&(v.Du(a,u),C=!0),C||((b=m.ud.qc(a,u,!1))==4?(v.Du(a,u),C=!0):b==1&&(v.$D(u),C=!0)),C?this.fg(v.J,v.Xc):(a=(C=new m.gd).Ib(a),u=C.Ib(u),v.Wo(C,d,g),C.I(a)!=0&&(v.Bp(a,u),v.j.Ug(),this.fg(v.J,v.Xc)))},h.pt=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.yJ();var S=new m.l,C=new m.l;return a.A(S),u.A(C),g=!1,m.ud.dk(S,C,d)&&(b.Eu(a),g=!0),g||((S=m.ud.qc(a,u,!1))==4?(b.Eu(a),g=!0):S==1&&(b.zN(),g=!0)),g||(a=(g=new m.gd).Ib(a),u=g.Ib(u),b.Wo(g,d,v),b.Gy(a,u),b.j.Ug()),h.fg(b.J,b.Xc)},h.gB=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.eX(),g=new m.l;var S=new m.l;a.A(g),u.A(S);var C=!1;return m.ud.dk(g,S,d)&&(b.PG(a,u),C=!0),C||m.ud.qc(a,u,!1)!=4||(b.PG(a,u),C=!0),C||(a=(g=new m.gd).Ib(a),u=g.Ib(u),b.Wo(g,d,v),b.Yh=b.j.Dp(),b.kh=b.j.Dp(),h.Jw(a,b.j,b.Yh),h.Jw(u,b.j,b.kh),b.Bp(a,u),b.j.Ep(b.Yh),b.j.Ep(b.kh),b.j.Ug()),h.fg(b.J,b.Xc)},h.st=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.MJ(),g=new m.l;var S=new m.l;a.A(g),u.A(S);var C=!1;return m.ud.dk(g,S,d)&&(b.Vz(a),C=!0),C||m.ud.qc(a,u,!1)!=4||(b.Vz(a),C=!0),C||(a=(g=new m.gd).Ib(a),u=g.Ib(u),b.Wo(g,d,v),b.Yh=b.j.Dp(),h.Jw(a,b.j,b.Yh),b.Gy(a,u),b.j.Ep(b.Yh),b.j.Ug()),h.fg(b.J,b.Xc)},h.ZA=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.RJ(),g=new m.l;var S=new m.l;a.A(g),u.A(S);var C=!1;return m.ud.dk(g,S,d)&&(b.yI(),C=!0),C||(a=(g=new m.gd).Ib(a),u=g.Ib(u),b.Wo(g,d,v),b.Gy(a,u),b.j.Ug()),h.fg(b.J,b.Xc)},h.qt=function(a,u,d,g){var v=new h;v.Yi(),v.bj(g),v.yJ();var b=new m.l;a.A(b),u=u.D();var S=!1;return m.ud.Rw(u,b,d)&&(v.Eu(a),S=!0),S||((d=m.hd.Yd(a,u,d))==1?(v.J[0]=0,v.J[2]=2,v.J[3]=-1,v.J[5]=1,v.J[6]=-1):d==2?(v.J[6]=-1,a.Ke()!=0?(v.J[0]=-1,v.J[3]=0,v.J[2]=2,v.J[5]=1):(v.J[0]=0,v.J[3]=-1,v.J[5]=-1,d=new m.l,a.A(d),v.J[2]=d.ca()==0&&d.R()==0?-1:1)):v.Eu(a)),this.fg(v.J,g)},h.tt=function(a,u,d,g,v){var b=new h;b.Yi(),b.bj(g),b.MJ();var S=new m.l;a.A(S),g=u.D();var C=!1;if(m.ud.Rw(g,S,d)&&(b.Vz(a),C=!0),!C){S=null;var O=C=!1;(b.ea[0]||b.ea[6])&&(m.ud.Yz(a,g,d)?(b.ea[0]&&(S=m.pi.gm(a,v),O=!m.ud.kt(S,g,d),C=!0,b.J[0]=O?-1:0),b.J[6]=-1):(b.J[0]=-1,b.J[6]=0)),b.ea[3]&&(S!=null&&S.B()?b.J[3]=-1:(C||(S==null&&(S=m.pi.gm(a,v)),O=!m.ud.kt(S,g,d),C=!0),b.J[3]=O?0:-1)),b.ea[5]&&(S!=null&&S.B()?b.J[5]=-1:C&&!O?b.J[5]=0:(S==null&&(S=m.pi.gm(a,v)),v=m.ud.Nw(S,u,d),b.J[5]=v?-1:0)),b.ea[2]&&(a.Qb()!=0?b.J[2]=1:((v=new m.de(a.description)).Fd(a,0,a.I()),a=m.ud.Nw(v,u,d),b.J[2]=a?-1:0))}return this.fg(b.J,b.Xc)},h.lt=function(a,u,d,g){var v=new h;v.Yi(),v.bj(g),v.RJ();var b=new m.l;a.A(b),u=u.D();var S=!1;if(m.ud.Rw(u,b,d)&&(v.yI(),S=!0),!S){b=!1,S=!0,d*=d;for(var C=0;Cb;b++)v[b]=-1;return m.h.yc(a,u)<=d*d?v[0]=0:(v[2]=0,v[6]=0),v[8]=2,h.fg(v,g)},h.fg=function(a,u){for(var d=0;9>d;d++)switch(u.charAt(d)){case"T":if(a[d]==-1)return!1;break;case"F":if(a[d]!=-1)return!1;break;case"0":if(a[d]!=0)return!1;break;case"1":if(a[d]!=1)return!1;break;case"2":if(a[d]!=2)return!1}return!0},h.uW=function(a,u,d){var g=[-1,-1,-1,-1,-1,-1,-1,-1,-1];if(a.B()&&u.B()){for(var v=0;9>v;v++)g[v]=-1;return this.fg(g,d)}return v=!1,a.B()&&(a=u,v=!0),g[0]=-1,g[1]=-1,g[3]=-1,g[4]=-1,g[6]=-1,g[7]=-1,g[8]=2,u=a.getType(),m.aa.Hc(u)?u==1736?a.Ke()!=0?(g[2]=2,g[5]=1):(g[5]=-1,u=new m.l,a.A(u),g[2]=u.ca()==0&&u.R()==0?0:1):(u=a.Qb()!=0,g[2]=u?1:0,g[5]=m.pi.aq(a)?0:-1):(g[2]=0,g[5]=-1),v&&this.vK(g),this.fg(g,d)},h.MR=function(a,u,d){return h.dQ(a)?3:h.UP(a)?4:h.cY(a,u,d)?8:h.CP(a,u,d)?16:h.eP(a)?1:h.EU(a,u,d)?32:0},h.dQ=function(a){return a.charAt(0)=="T"&&a.charAt(1)=="*"&&a.charAt(2)=="F"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="F"&&a.charAt(6)=="F"&&a.charAt(7)=="F"&&a.charAt(8)=="*"},h.UP=function(a){return a.charAt(0)=="F"&&a.charAt(1)=="F"&&a.charAt(2)=="*"&&a.charAt(3)=="F"&&a.charAt(4)=="F"&&a.charAt(5)=="*"&&a.charAt(6)=="*"&&a.charAt(7)=="*"&&a.charAt(8)=="*"},h.cY=function(a,u,d){return(u!=0||d!=0)&&((u!=2||d!=2)&&(a.charAt(0)=="F"&&a.charAt(1)=="*"&&a.charAt(2)=="*"&&a.charAt(3)=="T"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="*"&&a.charAt(7)=="*"&&a.charAt(8)=="*"||u==1&&d==1&&a.charAt(0)=="F"&&a.charAt(1)=="T"&&a.charAt(2)=="*"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="*"&&a.charAt(7)=="*"&&a.charAt(8)=="*")||d!=0&&a.charAt(0)=="F"&&a.charAt(1)=="*"&&a.charAt(2)=="*"&&a.charAt(3)=="*"&&a.charAt(4)=="T"&&a.charAt(5)=="*"&&a.charAt(6)=="*"&&a.charAt(7)=="*"&&a.charAt(8)=="*")},h.CP=function(a,u,d){return u>d?a.charAt(0)=="T"&&a.charAt(1)=="*"&&a.charAt(2)=="*"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="T"&&a.charAt(7)=="*"&&a.charAt(8)=="*":u==1&&d==1&&a.charAt(0)=="0"&&a.charAt(1)=="*"&&a.charAt(2)=="*"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="*"&&a.charAt(7)=="*"&&a.charAt(8)=="*"},h.eP=function(a){return a.charAt(0)=="T"&&a.charAt(1)=="*"&&a.charAt(2)=="*"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="F"&&a.charAt(7)=="F"&&a.charAt(8)=="*"},h.EU=function(a,u,d){if(u==d){if(u!=1)return a.charAt(0)=="T"&&a.charAt(1)=="*"&&a.charAt(2)=="T"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="T"&&a.charAt(7)=="*"&&a.charAt(8)=="*";if(a.charAt(0)=="1"&&a.charAt(1)=="*"&&a.charAt(2)=="T"&&a.charAt(3)=="*"&&a.charAt(4)=="*"&&a.charAt(5)=="*"&&a.charAt(6)=="T"&&a.charAt(7)=="*"&&a.charAt(8)=="*")return!0}return!1},h.Jw=function(a,u,d){a=u.La(a);for(var g=u.Re;g!=-1;g=u.Rf(g))if(u.xd(g)&a){var v=u.Me(g);if(v==-1)u.nn(g,d,0);else{var b=v,S=0;do u.dh(b)&a&&S++,b=u.jc(u.xa(b));while(b!=v);u.nn(g,d,S)}}},h.Zp=function(a){var u=""+a.charAt(0);return u+=a.charAt(3),u+=a.charAt(6),u+=a.charAt(1),u+=a.charAt(4),u+=a.charAt(7),u+=a.charAt(2),(u+=a.charAt(5))+a.charAt(8)},h.prototype.Yi=function(){for(var a=0;9>a;a++)this.J[a]=-2,this.Za[a]=-2},h.vK=function(a){var u=a[1],d=a[2],g=a[5];a[1]=a[3],a[2]=a[6],a[5]=a[7],a[3]=u,a[6]=d,a[7]=g},h.prototype.bj=function(a){for(this.Xc=a,a=0;9>a;a++)this.Xc.charAt(a)!="*"?(this.ea[a]=!0,this.le++):this.ea[a]=!1},h.prototype.UJ=function(){for(var a=0;9>a;a++)this.ea[a]&&this.J[a]==-2&&(this.J[a]=-1,this.ea[a]=!1)},h.prototype.pc=function(a){return this.J[a]!=-2&&(this.J[a]==-1?(this.ea[a]=!1,this.le--,!0):this.Xc.charAt(a)!="T"&&this.Xc.charAt(a)!="F"?!(this.J[a]b?1:0},h.prototype.reset=function(){this.yA=-1},h}(),p=function(){function h(){this.Wm=this.Gl=null,this.fb=new m.Yj,this.fb.RP(),this.$d=new E(this),this.fb.Vo(this.$d)}return h.prototype.HQ=function(){var a=!1;if(this.fw&&(a=this.IQ()),this.g.da(this.X)==1){var u=this.g.Ob(this.X);return a=this.g.wz(u),this.g.PB(u,!0),0>a&&(a=this.g.Xa(u),this.g.pJ(a),this.g.Wg(u,this.g.Ma(a)),!0)}for(this.El=this.g.Ky(),this.wo=this.g.Ky(),u=this.g.Ob(this.X);u!=-1;u=this.g.Rb(u))this.g.gr(u,this.El,0),this.g.gr(u,this.wo,-1);u=new m.ia(0),this.yh=NaN;var d=new m.h;this.et=this.g.da(this.X),this.ro=this.g.Gd(),this.Rs=this.g.Gd();for(var g=this.Gl.rc(this.Gl.je);g!=-1;g=this.Gl.lb(g)){var v=this.Gl.getData(g);if(this.g.Gc(v,d),d.y!=this.yh&&u.size!=0&&(a=this.ut(u)||a,this.$d.reset(),u.clear(!1)),u.add(v),this.yh=d.y,this.et==0)break}for(0=this.MA.length&&this.MA.push(new m.ig);var h=this.MA[this.Cw];return this.Cw++,h},p.prototype.clear=function(){this.wB(this.mo),this.wB(this.$s),this.wB(this.yw),this.Cw=0},p.prototype.Oo=function(h){this.mo.push(this.Ow(h))},p.prototype.ol=function(h){return h==0?this.$s.length:this.yw.length},p.prototype.Vp=function(h,a){return this.SR(h,a).$i},p.prototype.Ea=function(h,a){if(this.mo.length!=2)throw m.i.Qa();this.qa=h;var u=m.lc.ox(.01*h),d=!1,g=this.mo[0],v=this.mo[1];if(a||5&g.$i.zr(v.$i,h,!0)){if(g.$i.getType()==322){var b=g.$i;if(v.$i.getType()==322){a=v.$i;var S=m.yb.Zx(b,a,null,this.Fq,this.Bk,h);if(S==0)throw m.yb.Zx(b,a,null,this.Fq,this.Bk,h),m.i.Qa();h=Array(9),m.O.$u(h,null);for(var C=0;Cu&&(d=!0)):$>B?(b.hc(O,K),O=new m.h,a.hc(R,O),m.h.yc(K,O)>u&&(d=!0)):(a.hc(R,K),$=new m.h,b.hc(O,$),m.h.yc(K,$)>u&&(d=!0)),h[C]=K}for(g=0,v=-1,C=0;C<=S;C++)(G=Cthis.Bk[1]&&(G=this.Bk[0],this.Bk[0]=this.Bk[1],this.Bk[1]=G,C=b[0],b[0]=b[1],b[1]=C),g=0,v=-1,C=0;C<=S;C++)(G=C=v;v++){if((a=1>v?this.Fq[v]:1)!=u){var b=this.aB();h.ah(u,a,b),g!=-1&&b.get().Dc(d),v!=1&&b.get().Qc(d),u=a,this.$s.push(this.Ow(b.get()))}g=v}this.Bf.Cb(d)}},p}();m.TC=E}(ie||(ie={})),function(m){var D=function(){function E(p){this.Ds=this.rk=this.sb=null,this.ag=0,this.zm=!1,this.zf=-1,this.Cl=this.Jd=0,this.gb=-1,this.ib=p,this.ag=this.Wx(this.Cl),this.zm=!1,this.rk=null,this.Ds=new m.h}return E.prototype.BW=function(p){if(this.ib!=p.ib)throw m.i.Hb();this.zf=p.zf,this.Jd=p.Jd,this.gb=p.gb,this.Cl=p.Cl,this.ag=p.ag,this.zm=p.zm,this.rk=null},E.prototype.ha=function(){if(this.zf!=this.Jd&&this.BD(),this.zm)this.Jd=(this.Jd+1)%this.ag;else{if(this.Jd==this.ag)throw m.i.ce();this.Jd++}return this.rk},E.prototype.li=function(){if(this.zm)this.Jd=(this.ag+this.Jd-1)%this.ag;else{if(this.Jd==0)throw m.i.ce();this.Jd--}return this.Jd!=this.zf&&this.BD(),this.rk},E.prototype.DW=function(){this.zf=-1,this.Jd=0},E.prototype.EW=function(){this.Jd=this.ag,this.zf=-1},E.prototype.Vb=function(p,h){if(h===void 0&&(h=-1),0<=this.gb&&this.gb=a&&p=this.ib.Ba(h)&&p=this.ib.da())&&(this.zf=-1,this.Jd=0,this.ag=this.Wx(this.gb),this.ib.Ba(this.gb),this.ib.dc(this.gb),this.Cl++,!0)},E.prototype.Zi=function(){this.ag=this.Jd=this.zf=-1,this.Cl=0,this.gb=-1},E.prototype.Wx=function(p){if(this.ib.Ac())return 0;var h=1;return this.ib.dc(p)&&(h=0),this.ib.Ja(p)-h},E.prototype.On=function(){return this.zf==this.ag-1&&this.ib.dc(this.gb)},E.prototype.JB=function(){this.zm=!0},E.prototype.wb=function(){return this.ib.nb.o[this.gb]+this.zf},E.prototype.IM=function(){return this.ib.Ba(this.gb)},E.prototype.ik=function(){return this.On()?this.ib.Ba(this.gb):this.wb()+1},E.prototype.vm=function(){return this.zf==0},E.prototype.Qn=function(){return this.zf==this.ag-1},E.prototype.Ha=function(){return this.Jdthis.Jd||this.Jd>=this.ag)throw m.i.ce();this.zf=this.Jd;var p=this.wb();this.ib.mc();var h=this.ib.Ve,a=1;switch(h!=null&&(a=7&h.read(p)),h=this.ib.description,a){case 1:this.sb==null&&(this.sb=new m.yb),this.rk=this.sb;break;case 2:throw m.i.fa("internal error");default:throw m.i.Qa()}this.rk.Nf(h),a=this.ik(),this.ib.Gc(p,this.Ds),this.rk.Dc(this.Ds),this.ib.Gc(a,this.Ds),this.rk.Qc(this.Ds);for(var u=1,d=h.Aa;ud&&(g=h,h=u,u=g,g=a,a=d,d=g,g=-1),!(0>d||a>=this.pl)){0>h&&0>u?u=h=-1:h>=this.oi&&u>=this.oi&&(u=h=this.oi);var v=(u-h)/(d-a);d>this.pl&&(u=v*((d=this.pl)-a)+h),0>a&&(h=v*(0-a)+h,a=0);var b=Math.max(this.oi+1,8388607);-8388607>h?(a=(0-h)/v+a,h=0):h>b&&(a=(this.oi-h)/v+a,h=this.oi),-8388607>u?d=(0-h)/v+a:u>b&&(d=(this.oi-h)/v+a),(a=m.O.truncate(a))!=(d=m.O.truncate(d))&&((u=new D).x=m.O.truncate(4294967296*h),u.y=a,u.H=d,u.WP=m.O.truncate(4294967296*v),u.dir=g,this.Wl==null&&(this.Wl=m.O.lg(this.pl,null)),u.next=this.Wl[u.y],this.Wl[u.y]=u,u.ythis.Kw&&(this.Kw=u.H),this.Tq++)}}},p.prototype.sN=function(){if(this.Jh!=null){for(var h=!1,a=null,u=this.Jh;u!=null;)if(u.y++,u.y==u.H){var d=u;u=u.next,a!=null?a.next=u:this.Jh=u,d.next=null}else u.x+=u.WP,a!=null&&a.x>u.x&&(h=!0),a=u,u=u.next;h&&(this.Jh=this.fK(this.Jh))}},p.prototype.lN=function(h){if(!(h>=this.pl)){var a=this.Wl[h];if(a!=null){this.Wl[h]=null,a=this.fK(a),this.Tq-=this.gK,h=this.Jh;for(var u=!0,d=a,g=null;h!=null&&d!=null;)h.x>d.x?(u&&(this.Jh=d),u=d.next,d.next=h,g!=null&&(g.next=d),g=d,d=u):(u=h.next,h.next=d,g!=null&&(g.next=h),g=h,h=u),u=!1;this.Jh==null&&(this.Jh=a)}}},p.eK=function(h,a){return 0>h?0:h>a?a:h},p.prototype.ZP=function(){if(this.Jh!=null){for(var h=0,a=this.Jh,u=m.O.truncate(m.O.XG(a.x)),d=a.next;d!=null;d=d.next)if(h=this.kF?1^h:h+d.dir,d.x>a.x){var g=m.O.truncate(m.O.XG(d.x));h!=0&&(a=p.eK(u,this.oi),(u=p.eK(g,this.oi))>a&&athis.Kf[1].x&&(h=this.Kf[0],this.Kf[0]=this.Kf[1],this.Kf[1]=h):p.AN(this.Kf,a,function(g,v){return g==v?0:g.xv.x?1:0}),h=this.Kf[0],this.Kf[0]=null,u=h,d=1;dthis.Wh.size)break;var S=this;for(this.xe.Vd(0,this.xe.size,function(C,O){return S.pM(C,O)}),a=0,u=this.xe.size;aG?1:Kee?1:0)==0&&(K=($=S[C*$+3])<(N=S[C*N+3])?-1:$==N?0:1),K}),this.Pq=this.g.Gd(),this.oe=new m.jp,this.RA=this.oe.Ph(0),this.oe.fn(a),d=0;dS;S++){for(C=$[S],O=a[S],R=S-1;0<=R&&$[R]>C;)$[R+1]=$[R],a[R+1]=a[R],R--;$[R+1]=C,a[R+1]=O}return $=0,a[0]!=0&&($|=1),a[1]!=0&&($|=2),a[2]!=0&&($|=4),a[3]!=0&&($|=8),($==5||$==10)&&(p==h?p?(this.g.Bc(b,u),this.g.Cc(u,b),this.g.Bc(d,v),this.g.Cc(v,d)):(this.g.Cc(b,u),this.g.Bc(u,b),this.g.Cc(d,v),this.g.Bc(v,d)):p?(this.g.Cc(u,g),this.g.Bc(g,u),this.g.Cc(v,d),this.g.Bc(d,v)):(this.g.Bc(u,g),this.g.Cc(g,u),this.g.Bc(v,d),this.g.Cc(d,v)),!0)},E.prototype.tD=function(p,h,a,u,d,g){this.MY?this.VM():this.UM(p,h,a,u,d,g)},E.prototype.VM=function(){throw m.i.fa("not implemented.")},E.prototype.UM=function(p,h,a,u,d,g){if(p!=h)p?(this.g.Bc(a,d),this.g.Cc(d,a),this.g.Bc(g,u),this.g.Cc(u,g),this.vn(d,a),this.ui(d,!0),this.g.mi(d,!0),this.bk(a),this.vn(g,u),this.ui(g,!0),this.g.mi(g,!1)):(this.g.Bc(d,a),this.g.Cc(a,d),this.g.Bc(u,g),this.g.Cc(g,u),this.vn(d,a),this.ui(d,!0),this.g.mi(d,!1),this.bk(a),this.vn(g,u),this.ui(g,!0),this.g.mi(g,!0)),this.bk(u);else{var v=p?a:u,b=h?d:g;for(p=p?u:a,h=h?g:d,d=!1,this.g.Bc(v,b),this.g.Bc(b,v),this.g.Cc(p,h),this.g.Cc(h,p),g=h;g!=b;)a=this.g.Ma(g),u=this.g.U(g),this.g.Cc(g,u),this.g.Bc(g,a),d=d||g==v,g=u;d||(a=this.g.Ma(b),u=this.g.U(b),this.g.Cc(b,u),this.g.Bc(b,a)),this.vn(b,v),this.ui(b,!0),this.g.mi(b,!1),this.bk(v),this.vn(h,p),this.ui(h,!0),this.g.mi(h,!1),this.bk(p)}},E.prototype.cD=function(){for(var p=!1,h=this.g.Ob(this.X);h!=-1;){for(var a=this.g.Xa(h),u=0,d=this.g.Ja(h);uthis.g.Ja(h)){for(p=this.g.Xa(h),u=0,d=this.g.Ja(h);u=h)throw m.i.N("Invalid or unsupported wkid: "+h);var a=new p;return a.dg=h,a},p.qP=function(h){if(h==null||h.length==0)throw m.i.N("Cannot create SpatialReference from null or empty text.");var a=new p;return a.wh=h,a},p.prototype.Nb=function(h){return this==h||h!=null&&this.constructor==h.constructor&&this.dg==h.dg&&(this.dg!=0||this.wh===h.wh)},p.prototype.toString=function(){return"[ tol: "+this.Kn()+"; wkid: "+this.Ec()+"; wkt: "+this.Bz()+"]"},p.prototype.cc=function(){if(this.pp!=="")return this.pp;var h=this.toString();if(Array.prototype.reduce)return this.pp="S"+h.split("").reduce(function(d,g){return(d=(d<<5)-d+g.charCodeAt(0))&d},0);var a=0;if(h.length===0)return"";for(var u=0;u=h.length)throw m.i.N();var a=null;try{a=m.NC.fromString(h)}catch{a=null}return a==null?null:p.bD(a,!0)},p.prototype.by=function(h){this.Kd=h,this.Eo=this.Kd.Hd()},p.prototype.gy=function(h){this.KH=h,this.ST=this.KH!=null?this.KH.Eo:null},p.prototype.Wc=function(){return this.Sb()!=0&&this.Sb()!=3&&this.Kd.Wc()},p.prototype.IG=function(){return this.Sb()!=0&&(this.Sb()==3?this.Ji.fk().Wc():this.Kd.Wc())},p.prototype.eh=function(){return this.Kd!=null?this.Kd.Ue:null},p.prototype.pm=function(){return this.Kd.pm()},p.prototype.bf=function(){return this.Kd.bf()},p.prototype.hh=function(){return this.Kd!=null?this.Kd.sw:NaN},p.prototype.Up=function(){return this.Kd.Up()},p.prototype.Wr=function(){return this.Kd.Wr()},p.prototype.kk=function(){return this.Kd.kk()},p.prototype.kS=function(h){return m.OC.Py(this.Kd,h.Kd)},p.prototype.ml=function(){return this.Kd.ml()},p.prototype.Vr=function(){return this.Kd.Vr()},p.prototype.zi=function(){return this.Sb()==3?this.Ji.fk().zi():this.Kd.zi()},p.prototype.gh=function(){if(!this.Wc())throw m.i.N("!isPannable()");var h=new m.l;return this.Kd.gh(h),h},p.prototype.Oe=function(){if(!this.Wc())throw m.i.N("!isPannable()");return this.Kd.so},p.prototype.HR=function(){if(!this.Wc())throw m.i.N("!isPannable()");var h=new m.l;return this.Kd.GR(h),h},p.prototype.pv=function(){if(!this.Wc())throw m.i.N("!isPannable()");return this.Kd.pv()},p.prototype.ov=function(){if(!this.Wc())throw m.i.N("!isPannable()");return this.Kd.ov()},p.prototype.Xr=function(){return this.Ji!=null?this.Ji.fk().Xr():this.Kd.Xr()},p.prototype.PQ=function(){return this.Kd.hv()},p.prototype.Qp=function(){return this.Eo.getUnitFactor()},p.prototype.vz=function(h){return this.Hq.vz(h)},p.prototype.sc=function(){var h=this.Sb();if(h==1)return this;if(h==3)return this.Ji.fk().sc();if(h==0||h===4)throw m.i.fa("invalid call");if(this.jw!==null)return this.jw;if((h=this.eh().getGeogcs())==null)throw m.i.Qa();return this.jw=p.bF(h,this.Hq.VF())},p.bF=function(h,a){if(h==null)throw m.i.N("null pointer.");var u=new p;return h=p.mu(h,!0),u.Hq.Xx(h,null,a),u.by(h),u.gy(null),u.dg=h.$r(),u},p.prototype.Sb=function(){var h=this.eh();if(h!=null)switch(h.getType()){case m.Sc.PE_TYPE_GEOGCS:return 1;case m.Sc.PE_TYPE_PROJCS:return 2}return 4},p.prototype.hv=function(){return this.Kd.hv()},p.mu=function(h,a){var u=h.getCode();if(0>=u&&0<(u=m.pf.getCode(h))){if((h=m.pf.coordsys(u))==null)throw m.i.N("Text to wkid mapping had failed: "+u);return p.mu(h,a)}if(a&&0=u?h:m.pf.coordsys(u),h=new m.OC(h),p.lK[a]=h,0=h)throw m.i.N("Invalid or unsupported wkid: "+h);var a=p.qx[h];if(a!=null)return a;if((a=m.pf.coordsys(h))==null)throw m.i.N("Invalid or unsupported wkid: "+h);return(a=p.mu(a,!1)).$r()!=h&&(p.qx[h]=a),a},p.kM=function(h){if(h==null||h===void 0||h.length==0)throw m.i.N("Cannot create SpatialReference from null or empty text.");var a=null;try{a=m.pf.fromString(m.Sc.PE_TYPE_COORDSYS,h)}catch(u){throw m.i.N("Cannot create SpatialReference from text. "+u.message)}if(a===null)throw m.i.N("Cannot create SpatialReference from text. ");return p.mu(a,!0)},p.bD=function(h,a){var u,d=h.getCode();if(0>=d&&0<(d=m.pf.getCode(h))){if((d=m.pf.vertcs(d))===null)throw m.i.N();return p.bD(d,a)}if(a&&0=d||(u=m.pf.vertcs(d)),u===null)throw m.i.N();return u=new m.PL(u),p.mK[h]=u,0a&&(this.Pj=a/(d-this.Fm)),u=this.Gm+u,(g=m.O.truncate((u-this.Gm)*this.Pj))>a&&(this.Pj=a/(u-this.Gm))}},h.prototype.aC=function(a){switch(a){case 0:this.Ik=void 0;case 1:this.Mq=void 0;case 2:this.Lq=void 0}},h.prototype.Kn=function(a){switch(a){case 0:return this.Ik;case 1:return this.Mq;case 2:return this.Lq}return 0},h.prototype.vz=function(a){if(this.Rm==D.FloatingPoint)return 0;switch(a){case 0:return 1/this.Pj;case 1:case 2:return 1/this.Fo;default:return 0}},h.prototype.toString=function(){var a="SRPD [m_toleranceXY: "+this.Ik.toString();return(a=(a=(a=(a=(a=(a=(a=(a=(a=a+";m_falseX: "+this.Fm.toString())+";m_falseY: "+this.Gm.toString())+";m_unitsXY: "+this.Pj.toString())+";m_falseZ: "+this.sA.toString())+";m_unitsZ: "+this.Fo.toString())+";m_falseM: "+this.rA.toString())+";m_toleranceZ: "+this.Mq.toString())+";m_toleranceM: "+this.Lq.toString())+";m_precision: "+this.Rm.toString())+"] "},h}();m.ZL=p}(ie||(ie={})),function(m){function D(d,g){return 89.99999g&&(g=-89.99999),g*=.017453292519943,[111319.49079327169*d,31890685e-1*Math.log((1+Math.sin(g))/(1-Math.sin(g)))]}function E(d,g,v){return d=d/6378137*57.29577951308232,v?[d,57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*g/6378137)))]:[d-360*Math.floor((d+180)/360),57.29577951308232*(1.5707963267948966-2*Math.atan(Math.exp(-1*g/6378137)))]}function p(d,g,v){var b=d.Of();if(d.getType()===33)g=g(b.Lg(),b.ih()),b.Cb(g[0],g[1]);else if(d.getType()===197){var S=g(d.es(),d.gs(),v);g=g(d.ds(),d.fs(),v),b.K(S[0],S[1],g[0],g[1])}else for(S=new m.h,d=0;dv&&(v=637.100877141506);for(var b,S=[],C=0;Cthis.Hg&&this.Dz(p)},E.prototype.tx=function(p,h){p*=this.stride,h*=this.stride;for(var a=0;athis.ns.va)return 1;g=d.na==d.la;var v=u.na==u.la;if(g||v){if(g&&v)return 0;if(d.na==u.na&&d.sa==u.sa)return g?1:-1;if(d.la==u.la&&d.pa==u.pa)return g?-1:1}return(g=d.Pe(this.yh,this.ms.oa))==(v=u.Pe(this.yh,this.ns.oa))&&((v=.5*((g=Math.min(d.la,u.la))+this.yh))==this.yh&&(v=g),g=d.Pe(v,this.ms.oa),v=u.Pe(v,this.ns.oa)),gv?1:0},a.prototype.aK=function(u){this.yh=u},a}(),h=function(){function a(u){this.ib=u,this.WH=new m.ig,this.Bf=new m.h,this.wA=new m.Nc}return a.prototype.kX=function(u){this.Bf.L(u)},a.prototype.compare=function(u,d){return this.ib.pB(u.ja(d),this.WH),u=this.WH.get(),this.wA.K(u.sa,u.pa),this.Bf.xthis.wA.va?1:(u=u.Pe(this.Bf.y,this.Bf.x),this.Bf.xu?1:0)},a}();D=function(){function a(){this.hH=this.Di=this.Gi=this.kA=this.Yn=this.ye=this.Kc=this.jh=this.ge=null,this.Go=this.xg=-1,this.gH=!0,this.pA=!1,this.lA=NaN,this.Ni=new m.Md,this.bO=2147483647,this.aO=m.O.truncate(-2147483648),this.cg=this.ae=this.Hl=this.Cq=this.Cm=this.Bq=this.Os=this.Re=-1,this.wa=0}return a.prototype.yy=function(u){this.lA=u},a.prototype.Ym=function(){this.ge==null&&(this.ge=new m.$c(8));var u=this.ge.Ce();return this.ge.S(u,1,0),u},a.prototype.vU=function(){this.Kc==null&&(this.Kc=new m.$c(8));var u=this.Kc.Ce();this.Kc.S(u,2,0),this.Kc.S(u,3,0);var d=this.Kc.Ce();return this.Kc.S(d,2,0),this.Kc.S(d,3,0),this.JJ(u,d),this.JJ(d,u),u},a.prototype.mI=function(){this.ye==null&&(this.ye=new m.$c(8));var u=this.ye.Ce();return this.ye.S(u,2,0),u},a.prototype.TW=function(u,d){this.ge.S(u,7,d)},a.prototype.mn=function(u,d){this.ge.S(u,2,d)},a.prototype.SW=function(u,d){this.ge.S(u,1,d)},a.prototype.lX=function(u,d){this.ge.S(u,3,d)},a.prototype.iX=function(u,d){this.ge.S(u,4,d)},a.prototype.cr=function(u,d){this.ge.S(u,5,d)},a.prototype.eR=function(u){return this.ge.T(u,5)},a.prototype.RW=function(u,d){this.ge.S(u,6,d)},a.prototype.cN=function(u,d){this.RW(d,u)},a.prototype.IJ=function(u,d){this.Kc.S(u,1,d)},a.prototype.JJ=function(u,d){this.Kc.S(u,4,d)},a.prototype.Tl=function(u,d){this.Kc.S(u,5,d)},a.prototype.Sl=function(u,d){this.Kc.S(u,6,d)},a.prototype.$W=function(u,d){this.Kc.S(u,2,d)},a.prototype.$w=function(u,d){this.Kc.S(u,3,d)},a.prototype.LF=function(u){return this.Kc.T(u,3)},a.prototype.Gt=function(u,d){this.Kc.S(u,7,d)},a.prototype.EK=function(u,d){if(this.mm(u)!=-1)for(d=d?-1:u,u=this.mm(u);u!=-1;u=this.js(u))this.g.Ra(this.tj(u),this.Cq,d)},a.prototype.yx=function(u,d){u!=-1&&(this.EK(u,d),this.EK(this.xa(u),d))},a.prototype.Dt=function(u,d){this.ye.S(u,1,d)},a.prototype.Vg=function(u,d){this.ye.S(u,2,d)},a.prototype.jn=function(u,d){this.ye.S(u,3,d),this.NW(u,this.dR(d)),this.MW(d,u)},a.prototype.MW=function(u,d){this.ye.S(u,4,d)},a.prototype.NW=function(u,d){this.ye.S(u,5,d)},a.prototype.DJ=function(u,d){this.ye.S(u,6,d)},a.prototype.BJ=function(u,d){this.ye.S(u,7,d)},a.prototype.AJ=function(u,d){this.Yn.write(u,d)},a.prototype.CJ=function(u,d){this.kA.write(u,d)},a.prototype.kY=function(u){var d=0,g=0,v=this.AF(u),b=new m.h,S=new m.h,C=new m.h;this.Yr(v,b),S.L(b);var O=v;do this.lm(O,C),g+=m.h.tb(S,C),this.$e(this.xa(O))!=u&&(d+=(C.x-b.x-(S.x-b.x))*(C.y-b.y+(S.y-b.y))*.5),S.L(C),O=this.jc(O);while(O!=v);this.Yn.write(u,d),this.kA.write(u,g)},a.prototype.PU=function(u,d){var g=new p(this),v=new m.Yj;v.De(m.O.truncate(this.wa/2)),v.Vo(g);for(var b=new m.ia(0),S=this.$g(),C=null,O=0,R=new m.h,$=this.Re;$!=-1;$=this.Rf($)){if(!(255&++O)&&d!=null&&!d.progress(-1,-1))throw m.i.WC();var N=this.Me($);if(N!=-1){if(b.Bh(0),!this.gY(v,S,b,N)){this.D($,R),g.aK(R.y);var B=N;do{var G=this.Ab(B,S);G!=-1&&(v.vd(G,-1),this.Kb(B,S,-2)),B=this.jc(this.xa(B))}while(N!=B);B=N;do(G=this.Ab(B,S))==-1&&(G=v.addElement(B,-1),b.add(G)),B=this.jc(this.xa(B));while(N!=B)}for(N=b.size-1;0<=N;N--)G=b.get(N),B=v.ja(G),this.Kb(this.xa(B),S,G),this.OU(v,G,u)}else this.cz($)==-1&&(C==null&&(C=new h(this)),this.D($,R),C.kX(R),B=v.IW(C),N=this.Hl,B!=-1&&(G=v.ja(B),this.$e(G)==this.$e(this.xa(G))&&(G=this.OF(v,B)),G!=-1&&(N=this.$e(G))),this.cN(N,$))}this.Jg(S)},a.prototype.OU=function(u,d,g){var v=u.ja(d),b=this.$e(v);if(this.Gn(b)==-1){var S=this.OF(u,d),C=this.xa(v),O=this.$e(C);this.Kp(b),this.Kp(O);var R=this.Gn(b),$=this.Gn(O);if(S==-1&&R==-1&&(O==b?(this.jn(O,this.Hl),R=$=this.Hl):($==-1&&(this.jn(O,this.Hl),$=this.Hl),this.jn(b,O),R=O)),S!=-1){var N=this.$e(S);$==-1&&(0>=this.Kp(N)?($=this.Gn(N),this.jn(O,$)):(this.jn(O,N),$=N),O==b&&(R=$))}R==-1&&this.hY(b,O),g==0?this.jW(u,d,v,S,b,O):g==5?this.kW(u,d,v,C,b,O):g==4&&this.iW(v,S,b,O)}},a.prototype.jW=function(u,d,g,v,b,S){var C=this.hk(b);if(v!=-1){var O=this.hk(S),R=this.hk(this.$e(v));v=C&O&R,R^=R&this.dh(g),(R|=v)!=0&&(this.Vg(S,O|R),this.Vg(b,R|C),C=C||R)}for(d=u.lb(d);d!=-1&&(v=u.ja(d),g=this.$e(this.xa(v)),b=this.hk(g),S=this.dh(v),O=this.$e(v),v=b&(R=this.hk(O))&C,C^=C&S,(C|=v)!=0);d=u.lb(d))this.Vg(g,b|C),this.Vg(O,R|C)},a.prototype.kW=function(u,d,g,v,b,S){if(b!=S){g=this.Ab(g,this.cg),g+=this.Ab(v,this.cg),v=0;var C=new m.ia(0),O=new m.ia(0);O.add(0);for(var R=u.rc(-1);R!=d;R=u.lb(R)){var $=u.ja(R),N=this.xa($),B=this.$e($),G=this.$e(N);if(B!=G){if($=this.Ab($,this.cg),v+=$+=this.Ab(N,this.cg),N=!1,C.size!=0&&C.Fc()==G&&(O.If(),C.If(),N=!0),this.Gn(G)==-1)throw m.i.Qa();N&&this.Gn(G)==B||(O.add(v),C.add(B))}}v+=g,C.size!=0&&C.Fc()==S&&(O.If(),C.If()),v!=0?O.Fc()==0&&(u=this.g.ld,u=this.La(u),this.Vg(b,u)):O.Fc()!=0&&(u=this.g.ld,u=this.La(u),this.Vg(b,u))}},a.prototype.iW=function(u,d,g,v){var b=this.La(this.g.ld);if(d==-1)this.Vg(v,this.Go),1&(u=this.Ab(u,this.xg))?this.Vg(g,b):this.Vg(g,this.Go);else{var S=this.hk(v);S==0?(S=this.hk(this.$e(d)),this.Vg(v,S),1&(u=this.Ab(u,this.xg))?this.Vg(g,S==b?this.Go:b):this.Vg(g,S)):1&(u=this.Ab(u,this.xg))?this.Vg(g,S==b?this.Go:b):this.Vg(g,S)}},a.prototype.gY=function(u,d,g,v){var b=v,S=-1,C=-1,O=0;do{if(O==2)return!1;var R=this.Ab(b,d);if(R!=-1){if(S!=-1)return!1;S=R}else{if(C!=-1)return!1;C=b}O++,b=this.jc(this.xa(b))}while(v!=b);return C!=-1&&S!=-1&&(this.Kb(u.ja(S),d,-2),u.Sj(S,C),g.add(S),!0)},a.prototype.hY=function(u,d){var g=this.Kp(u);if(g!=0){var v=this.Kp(d);0v||0>g&&0$.compare(b)?R=1:S=-1,this.Kb(B,this.ae,0),this.Kb(N,this.ae,0),this.Kb(N,this.cg,R),this.Kb(B,this.cg,S)):u==7?(this.Kb(B,this.ae,this.Go),this.Kb(N,this.ae,O==1736?C:0)):u==4&&(this.Kb(B,this.ae,0),this.Kb(N,this.ae,0),this.Kb(N,this.xg,1),this.Kb(B,this.xg,1)),O=O==1736?this.aO:0,this.$w(N,C|O),this.$w(B,C|O)}}}}},a.prototype.VT=function(u,d){var g=this.mm(d);if(g!=-1){var v=this.mm(u);this.jh.S(g,1,v),this.Gt(u,g),this.Gt(d,-1)}u=this.xa(u),d=this.xa(d),(g=this.mm(d))!=-1&&(v=this.mm(u),this.jh.S(g,1,v),this.Gt(u,g),this.Gt(d,-1))},a.prototype.IX=function(u){function d(ge,me){return v.HO(ge,me)}var g=new m.ia(0);g.Jb(10);for(var v=this,b=this.Re;b!=-1;b=this.Rf(b)){g.clear(!1);var S=this.Me(b);if(S!=-1){var C=S;do g.add(C),C=this.jc(this.xa(C));while(C!=S);if(1h.Db())return E.ki(E.Xe(h.Ia()),p,"&")}return g=new E,v=(d=new m.gd).Ib(E.Xe(p)),h=d.Ib(E.Xe(h)),g.Ft(d,a,u),u=g.Av(v,h),p=E.ki(d.Ne(u),p,"&"),m.aa.Hc(p.getType())&&(p.Ch(2,a),p.getType()==1736&&p.fm()),p},E.bW=function(p,h,a){if(p.B()||h.B())return p.Ia();var u=[null],d=[0],g=h.Db()==2;if(h.Db()!=1&&h.Db()!=2)throw m.i.Qa();return u[0]=p.D(),g?m.hd.sK(h,u,1,a,d):m.hd.tK(h,u,1,a,d),d[0]==0?p.Ia():p},E.prototype.LU=function(p,h,a,u,d){if(p.B())return p;var g=new m.gd;return p=g.Ib(p),this.Mk(g,p,h,a,u,d)},E.prototype.NU=function(p,h,a,u,d,g){if(d&&p.ic(h)!=550){var v=new m.RC;v.TX(p,a),v.Ng?(m.Tk.V(p,a,g,!0),d=!1):this.j.yy(a)}else m.Tk.V(p,a,g,!0),d=!1;if(u&&p.ic(h)!=550?this.j.wJ(p,h,g):this.j.vJ(p,h,g),this.j.pA)return this.j.Ug(),this.j=null,this.Mk(p,h,a,u,!1,g);if(this.j.yy(NaN),g=this.j.La(h),this.bq(g+1),this.Gj[g]=!0,p.ic(h)==1736||u&&p.ic(h)!=550)return p.Yo(h,0),h=this.Ot(h,-1,-1),(p=p.Ne(h)).Yo(0),d?p.Ch(1,0):(p.Ch(2,a),p.fm()),p;if(p.ic(h)==1607)return h=this.Pt(-1),p=p.Ne(h),d||p.Ch(2,a),p;if(p.ic(h)==550)return h=this.mr(),p=p.Ne(h),d||p.Ch(2,a),p;throw m.i.Qa()},E.prototype.Mk=function(p,h,a,u,d,g){this.j=new m.iu;try{return this.NU(p,h,a,u,d,g)}finally{this.j.Ug()}},E.Mk=function(p,h,a,u,d){return new E().LU(p,h,a,u,d)},E.prototype.MU=function(p,h,a,u){this.Mv=p,this.j=new m.iu,p=h.In(a);var d=h.ic(a);if(p!=1||d==550?this.j.vJ(h,a,u):this.j.wJ(h,a,u),!this.j.pA)if(this.j.yy(NaN),u=this.j.La(a),this.bq(u+1),this.Gj[u]=!0,h.ic(a)==1736||p==1&&h.ic(a)!=550)h.Yo(a,0),u=this.Ot(a,-1,-1),h.hC(u,a),h.BB(u);else if(h.ic(a)==1607)u=this.Pt(-1),h.hC(u,a),h.BB(u);else{if(h.ic(a)!=550)throw m.i.fa("internal error");u=this.mr(),h.hC(u,a),h.BB(u)}},E.prototype.im=function(p,h){var a=m.aa.tf(this.j.g.ic(p)),u=m.aa.tf(this.j.g.ic(h));if(a>u)return p;var d=this.j.La(p),g=this.j.La(h);if(this.bq(1+(d|g)),this.Gj[this.j.La(p)]=!0,a==2&&u==2)return this.Ot(p,h,-1);if(a==1&&u==2||a==1&&u==1)return this.Pt(-1);if(a==0)return this.mr();throw m.i.Qa()},E.prototype.Av=function(p,h){var a=m.aa.tf(this.j.g.ic(p)),u=m.aa.tf(this.j.g.ic(h)),d=this.j.La(p),g=this.j.La(h);if(this.bq(1+(d|g)),this.Gj[this.j.La(p)|this.j.La(h)]=!0,d=-1,1h.Db())return E.ki(E.Xe(p),p,"-");var d=new m.l;p.A(d);var g=new m.l;if(h.A(g),!d.isIntersecting(g))return E.ki(E.Xe(p),p,"-");var v=new m.l;return v.K(d),v.Zb(g),a=m.ta.Wd(a,v,!0),g=new E,v=(d=new m.gd).Ib(E.Xe(p)),h=d.Ib(E.Xe(h)),g.Ft(d,a,u),u=g.im(v,h),u=d.Ne(u),p=E.ki(u,p,"-"),m.aa.Hc(p.getType())&&(p.Ch(2,a),p.getType()==1736&&p.fm()),p},E.VP=function(p,h,a){if(2>p.length)throw m.i.N("not enough geometries to dissolve");for(var u=0,d=0,g=p.length;dC?E.Xe(p[O]):(p=u==2,h=m.ta.Wd(u==0?h:null,v,!0),new E().Mk(b,S,h,p,!0,a))},E.Pz=function(p,h,a,u){var d=[null,null,null],g=new m.l;p.A(g);var v=new m.l;h.A(v);var b=new m.l;if(b.K(g),b.Zb(v),a=m.ta.Wd(a,b,!0),(b=new m.l).K(v),v=m.ta.Er(a),b.W(v,v),!g.isIntersecting(b)){if(p.Db()<=h.Db())return d[(p=E.ki(E.Xe(p.Ia()),p,"&")).Db()]=p,d;if(p.Db()>h.Db())return d[(p=E.ki(E.Xe(h.Ia()),p,"&")).Db()]=p,d}for(v=new E,b=(g=new m.gd).Ib(E.Xe(p)),h=g.Ib(E.Xe(h)),v.Ft(g,a,u),u=v.Pz(b,h),h=0;hh.Db())return E.ki(E.Xe(p),p,"^");if(p.Db()a;a++)h[a]=new m.h;p.nB(h),this.fY(h,h),p.Zw(h,4)}},E.prototype.fY=function(p,h){for(var a=0;a(h=.5*h.Sk())?Math.sqrt(u):Math.sqrt(h))},E.prototype.RB=function(){this.bb=1,this.jb=this.Gb=this.eb=0,this.ab=1,this.Lb=0},E.prototype.isIdentity=function(p){if(p!==void 0){var h=m.h.construct(0,1);return this.Eh(h,h),h.sub(m.h.construct(0,1)),h.Sk()>p*p?!1:(h.ma(0,0),this.Eh(h,h),!(h.Sk()>p*p)&&(h.ma(1,0),this.Eh(h,h),h.sub(m.h.construct(1,0)),h.Sk()<=p*p))}return this.bb==1&&this.ab==1&&this.eb==0&&this.Gb==0&&this.jb==0&&this.Lb==0},E.prototype.Bi=function(p){return Math.abs(this.bb*this.ab-this.jb*this.eb)<=2*p*(Math.abs(this.bb*this.ab)+Math.abs(this.jb*this.eb))},E.prototype.gg=function(p,h){this.bb=1,this.eb=0,this.Gb=p,this.jb=0,this.ab=1,this.Lb=h},E.prototype.setScale=function(p,h){h!==void 0?(this.bb=p,this.jb=this.Gb=this.eb=0,this.ab=h,this.Lb=0):this.setScale(p,p)},E.prototype.$B=function(){this.bb=0,this.eb=1,this.Gb=0,this.jb=1,this.Lb=this.ab=0},E.prototype.setRotate=function(p){this.pX(Math.cos(p),Math.sin(p))},E.prototype.pX=function(p,h){this.bb=p,this.eb=-h,this.Gb=0,this.jb=h,this.ab=p,this.Lb=0},E.prototype.shift=function(p,h){this.Gb+=p,this.Lb+=h},E.prototype.scale=function(p,h){this.bb*=p,this.eb*=p,this.Gb*=p,this.jb*=h,this.ab*=h,this.Lb*=h},E.prototype.flipX=function(p,h){this.bb=-this.bb,this.eb=-this.eb,this.Gb=p+h-this.Gb},E.prototype.flipY=function(p,h){this.jb=-this.jb,this.ab=-this.ab,this.Lb=p+h-this.Lb},E.prototype.rotate=function(p){var h=new E;h.setRotate(p),this.multiply(h)},E.prototype.inverse=function(p){if(p!==void 0){var h=this.bb*this.ab-this.eb*this.jb;h==0?p.lx():(h=1/h,p.Gb=(this.eb*this.Lb-this.Gb*this.ab)*h,p.Lb=(this.Gb*this.jb-this.bb*this.Lb)*h,p.bb=this.ab*h,p.eb=-this.eb*h,p.jb=-this.jb*h,p.ab=this.bb*h)}else this.inverse(this)},E}();m.Dd=D}(ie||(ie={})),function(m){var D=function(){function E(){}return E.prototype.lx=function(){this.hg=this.Lb=this.Gb=this.He=this.Fe=this.Ee=this.Ge=this.ab=this.eb=this.Ze=this.jb=this.bb=0},E.prototype.setScale=function(p,h,a){this.bb=p,this.eb=this.Ze=this.jb=0,this.ab=h,this.Fe=this.Ee=this.Ge=0,this.He=a,this.hg=this.Lb=this.Gb=0},E.prototype.setTranslate=function(p,h,a){this.bb=1,this.eb=this.Ze=this.jb=0,this.ab=1,this.Fe=this.Ee=this.Ge=0,this.He=1,this.Gb=p,this.Lb=h,this.hg=a},E.prototype.translate=function(p,h,a){this.Gb+=p,this.Lb+=h,this.hg+=a},E.prototype.mC=function(p){if(!p.B()){for(var h=new m.Nd[8],a=0;8>a;a++)h[a]=new m.Nd;p.nB(h),this.transform(h,8,h),p.Zw(h)}},E.prototype.transform=function(p,h,a){for(var u=0;uu;u++)a.uh[u]=-1;a.uh[a.bg[0]]=0}return a.jq=!0,a}return Ke(h,p),h.prototype.re=function(a){this.hasAttribute(a)||(this.uh[a]=0,this.jD())},h.prototype.removeAttribute=function(a){if(a==0)throw m.i.N("Position attribue cannot be removed");this.hasAttribute(a)&&(this.uh[a]=-1,this.jD())},h.prototype.reset=function(){this.bg[0]=0,this.Aa=1;for(var a=0;aa;a++)0<=this.uh[a]&&(this.bg[u]=a,this.uh[a]=u,u++,this.Aa++);this.jq=!0},h.prototype.cc=function(){return this.jq&&(this.wl=this.An(),this.jq=!1),this.wl},h.prototype.Nb=function(a){if(a==null)return!1;if(a==this)return!0;if(!(a instanceof h)||a.Aa!=this.Aa)return!1;for(var u=0;ug;g++)!a.hasAttribute(g)&&u.hasAttribute(g)&&(d==null&&(d=new h(a)),d.re(g));return d!=null?d.EF():a},h}(m.ra);m.ee=D;var E=function(){function p(){this.map=[];var h=new D;this.add(h),(h=new D).re(1),this.add(h)}return p.kz=function(){return p.bL},p.prototype.$R=function(){return p.ft},p.prototype.add=function(h){var a=h.cc();if(p.ft!=null&&p.ft.cc()==a&&h.GG(p.ft))return p.ft;if(p.Dw!=null&&p.Dw.cc()==a&&h.GG(p.Dw))return p.Dw;var u=null;return this.map[a]!==void 0&&(u=this.map[a]),u==null&&((u=h.tM()).Aa==1?p.ft=u:u.Aa==2&&u.kd(1)==1?p.Dw=u:this.map[a]=u),u},p.bL=new p,p}()}(ie||(ie={}));var mi={feet:9002,kilometers:9036,meters:9001,miles:9093,"nautical-miles":9030,yards:9096},Lr={acres:109402,ares:109463,hectares:109401,"square-feet":109405,"square-kilometers":109414,"square-meters":109404,"square-miles":109439,"square-yards":109442},Dr=new(function(){function m(){this.RM=50,this.np=new Map,this.gj=[]}return m.prototype.clear=function(){this.gj.length=0,this.np.clear()},m.prototype.delete=function(D){return!!this.np.delete(D)&&(this.gj.splice(this.gj.indexOf(D),1),!0)},m.prototype.get=function(D){var E=this.np.get(D);if(E!==void 0)return this.gj[0]!==D&&(this.gj.splice(this.gj.indexOf(D),1),this.gj.unshift(D)),E},m.prototype.has=function(D){return this.np.has(D)},m.prototype.set=function(D,E){return this.get(D)!==void 0&&this.delete(D),this.gj.unshift(D),this.np.set(D,E),this.oM(),this},m.prototype.oM=function(){for(;this.gj.length&&this.gj.length>this.RM;){var D=this.gj.pop();this.np.delete(D)}},m}()),Ze=((Tt={}).convertJSONToGeometry=function(m){return ie.$b.fP(m)},Tt.hasM=function(m){return m.hasAttribute(ie.Ih.M)},Tt.hasZ=function(m){return m.hasAttribute(ie.Ih.Z)},Tt.getPointX=function(m){return m.Lg()},Tt.getPointY=function(m){return m.ih()},Tt.getPointZ=function(m){return m.bS()},Tt.getPointM=function(m){return m.zR()},Tt.getXMin=function(m){return m.es()},Tt.getYMin=function(m){return m.gs()},Tt.getXMax=function(m){return m.ds()},Tt.getYMax=function(m){return m.fs()},Tt.getZExtent=function(m){return m.Tg(ie.Ih.Z,0)},Tt.getMExtent=function(m){return m.Tg(ie.Ih.M,0)},Tt.exportPaths=function(m){var D=[],E=m.da(),p=null,h=null,a=m.hasAttribute(ie.Ih.Z),u=m.hasAttribute(ie.Ih.M);a&&(p=m.ub(ie.Ih.Z)),u&&(h=m.ub(ie.Ih.M));for(var d=new ie.h,g=0;gnew UG({placeholder:"Search address",getSuggestions:async t=>{const e=t.suggestTerm,i=`${bxe}?address=${encodeURIComponent(e)}`;return(await bi(i,{responseType:"json"})).data.addresses.map(n=>({text:n.pikkaadress,magicKey:n.unik}))},getResults:async t=>{const e=t.suggestResult.text,i=`${bxe}?address=${encodeURIComponent(e)}`;return(await bi(i,{responseType:"json"})).data.addresses.map(s=>{const o=new Ml({geometry:new mt({x:s.viitepunkt_l,y:s.viitepunkt_b})});return{extent:HVe(o.geometry,30,"meters").extent,feature:o,name:`${s.pikkaadress}`}})}}),ABt=(t,e)=>new RVt({view:t,sources:[e],includeDefaultSources:!1,container:"in-ads-container"});function SX(t){switch(t){case Xn.SUPPORTED:break;case Xn.GRAPHICS_LAYER_MISSING:return"not owned by a graphics layer";case Xn.GEOMETRY_MISSING:return"no geometry";case Xn.GEOMETRY_TYPE_UNSUPPORTED:return"the geometry type is not supported";case Xn.ELEVATION_MODE_UNSUPPORTED:return"the elevation mode is not supported";case Xn.SYMBOL_TYPE_UNSUPPORTED:return"the symbol type is not supported"}return""}var Xn;(function(t){t[t.SUPPORTED=0]="SUPPORTED",t[t.GRAPHICS_LAYER_MISSING=1]="GRAPHICS_LAYER_MISSING",t[t.GEOMETRY_MISSING=2]="GEOMETRY_MISSING",t[t.GEOMETRY_TYPE_UNSUPPORTED=3]="GEOMETRY_TYPE_UNSUPPORTED",t[t.ELEVATION_MODE_UNSUPPORTED=4]="ELEVATION_MODE_UNSUPPORTED",t[t.SYMBOL_TYPE_UNSUPPORTED=5]="SYMBOL_TYPE_UNSUPPORTED"})(Xn||(Xn={}));function MBt(t){var e;if(((e=t.layer)==null?void 0:e.type)!=="graphics")return Xn.GRAPHICS_LAYER_MISSING;if(t.geometry==null)return Xn.GEOMETRY_MISSING;switch(t.geometry.type){case"polygon":case"point":case"polyline":case"mesh":break;default:return Xn.GEOMETRY_TYPE_UNSUPPORTED}return tj(t)!=="on-the-ground"&&ij(t)?Xn.ELEVATION_MODE_UNSUPPORTED:Xn.SUPPORTED}function qVe(t){if(!t)return null;if(uB(t)&&t.wkid){const i=Cot[t.wkid];if(i)return i}const e=t.wkt2||t.wkt;if(e){const i=OBt(e);if(i)return i}return null}function OBt(t){const e=Tot.exec(t);if(!e||e.length!==2)return null;const i=e[1].split(",");if(!i||i.length<3)return null;const r=parseFloat(i[1]),n=parseFloat(i[2]);return isNaN(r)||isNaN(n)?null:{a:r,f:n===0?0:1/n}}function VG(t){const e=qVe(t??at.WGS84);if(PBt(e))return e;const i=e.a*(1-e.f);return Object.assign(e,{b:i,eSq:1-(i/e.a)**2,radius:(2*e.a+i)/3,densificationRatio:1e4/((2*e.a+i)/3)})}function PBt(t){return t!=null&&"b"in t&&"eSq"in t&&"radius"in t}function Y8(t,e,i){const{a:r,eSq:n}=VG(i),s=Math.sqrt(n),o=Math.sin(e[1]*kh),l=r*e[0]*kh;let c;return n>0?c=r*((1-n)*(o/(1-n*(o*o))-1/(2*s)*Math.log((1-s*o)/(1+s*o))))*.5:c=r*o,t[0]=l,t[1]=c,t}function BG(t){return qVe(t)!==null}function igi(t,e="square-meters"){if(t.some(o=>!BG(o.spatialReference)))throw new se("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const i=[];for(let o=0;o!BG(r.spatialReference)))throw new se("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const i=[];for(let r=0;r1){for(let z=1;z<=F-1;z++)$O(s,M,I,z*e,i),c.push(s.slice(0));$O(s,M,I,(L+Math.floor(F-1)*e)/2,i),c.push(s.slice(0))}$O(s,M,I,L,i),c.push(s.slice(0)),x=s[0],T=s[1]}}return t.type==="polyline"?new xc({paths:n,spatialReference:i}):new Qa({rings:n,spatialReference:i})}let WVe=class{constructor(e=0,i=void 0,r=void 0){this.distance=e,this.azimuth=i,this.reverseAzimuth=r}};function $O(t,e,i,r,n){const s=e[0],o=e[1],l=s*kh,c=o*kh,f=(i??0)*kh,{a:_,b:x,f:T}=VG(n),A=Math.sin(f),M=Math.cos(f),I=(1-T)*Math.tan(c),L=1/Math.sqrt(1+I*I),F=I*L,z=Math.atan2(I,M),k=L*A,U=k*k,j=1-U,H=j*(_*_-x*x)/(x*x),Y=1+H/16384*(4096+H*(H*(320-175*H)-768)),Q=H/1024*(256+H*(H*(74-47*H)-128));let ne,re,he,ce,be=r/(x*Y),ye=2*Math.PI;for(;Math.abs(be-ye)>1e-12;)he=Math.cos(2*z+be),ne=Math.sin(be),re=Math.cos(be),ce=Q*ne*(he+Q/4*(re*(2*he*he-1)-Q/6*he*(4*ne*ne-3)*(4*he*he-3))),ye=be,be=r/(x*Y)+ce;const pe=F*ne-L*re*M,Ee=Math.atan2(F*re+L*ne*M,(1-T)*Math.sqrt(U+pe*pe)),te=Math.atan2(ne*A,L*re-F*ne*M),le=T/16*j*(4+T*(4-3*j)),de=Ee/kh,ve=(l+(te-(1-le)*T*k*(be+le*ne*(he+le*re*(2*he*he-1)))))/kh;return t[0]=ve,t[1]=de,t}function _ue(t,e,i,r){const n=e[0]*kh,s=e[1]*kh,o=i[0]*kh,l=i[1]*kh,{a:c,b:f,f:_,radius:x}=VG(r),T=o-n,A=Math.atan((1-_)*Math.tan(s)),M=Math.atan((1-_)*Math.tan(l)),I=Math.sin(A),L=Math.cos(A),F=Math.sin(M),z=Math.cos(M);let k,U,j,H,Y,Q,ne,re,he,ce,be=1e3,ye=T;do{if(ne=Math.sin(ye),re=Math.cos(ye),j=Math.sqrt(z*ne*(z*ne)+(L*F-I*z*re)*(L*F-I*z*re)),j===0)return t.distance=0,t.azimuth=void 0,t.reverseAzimuth=void 0,t;Y=I*F+L*z*re,Q=Math.atan2(j,Y),he=L*z*ne/j,U=1-he*he,H=Y-2*I*F/U,isNaN(H)&&(H=0),ce=_/16*U*(4+_*(4-3*U)),k=ye,ye=T+(1-ce)*_*he*(Q+ce*j*(H+ce*Y*(2*H*H-1)))}while(Math.abs(ye-k)>1e-12&&--be>0);if(be===0){const ve=x,Se=Math.acos(Math.sin(s)*Math.sin(l)+Math.cos(s)*Math.cos(l)*Math.cos(o-n))*ve,Ae=o-n,Pe=Math.sin(Ae)*Math.cos(l),Ge=Math.cos(s)*Math.sin(l)-Math.sin(s)*Math.cos(l)*Math.cos(Ae),ut=Math.atan2(Pe,Ge);return t.azimuth=ut/kh,t.distance=Se,t.reverseAzimuth=void 0,t}const pe=U*(c*c-f*f)/(f*f),Ee=pe/1024*(256+pe*(pe*(74-47*pe)-128)),te=f*(1+pe/16384*(4096+pe*(pe*(320-175*pe)-768)))*(Q-Ee*j*(H+Ee/4*(Y*(2*H*H-1)-Ee/6*H*(4*j*j-3)*(4*H*H-3)))),le=Math.atan2(z*Math.sin(ye),L*F-I*z*Math.cos(ye)),de=Math.atan2(L*Math.sin(ye),L*F*Math.cos(ye)-I*z);return t.azimuth=le/kh,t.distance=te,t.reverseAzimuth=de/kh,t}var Mre;let bw=Mre=class extends Qa{constructor(...t){super(...t),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}normalizeCtorArgs(t,e){let i;if(t!=null&&t.center)i=t;else{if(t!=null&&t.rings)return super.normalizeCtorArgs(t,e);i={center:t}}return{...super.normalizeCtorArgs(),...i,...e}}initialize(){const t=this.center,e=this.numberOfPoints;if(this.hasZ=(t==null?void 0:t.hasZ)??!1,this.rings.length!==0||!t)return;const i=Ur(this.radius,this.radiusUnit,"meters"),r=t.spatialReference;let n,s="geographic";if(r.isWebMercator?s="webMercator":((r.wkid&&ae[r.wkid])!=null||(r.wkt2||r.wkt)&&Kne(r.wkt2||r.wkt))&&(s="projected"),this.geodesic){let o;switch(s){case"webMercator":o=HS(t);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":o=t}n=this._createGeodesicCircle(o,i,e),s==="webMercator"&&(n=Ty(n))}else{let o;s==="webMercator"||s==="projected"?o=i/jCe(t.spatialReference):s==="geographic"&&(o=UCe(i,"meters",Sr(t.spatialReference).radius)),n=this._createPlanarCircle(t,o,e)}this.spatialReference=n.spatialReference,this.addRing(n.rings[0])}clone(){const{center:t,numberOfPoints:e,radius:i,radiusUnit:r,geodesic:n}=this;return new Mre({center:t==null?void 0:t.clone(),numberOfPoints:e,radius:i,radiusUnit:r,geodesic:n})}_createGeodesicCircle(t,e,i){let r=0;const n=[];for(;r<360;){const s=[0,0],o=[t.x,t.y];$O(s,o,r,e),this.hasZ&&s.push(t.z),n.push(s),r+=360/i}return n.push(n[0]),new Qa(n)}_createPlanarCircle(t,e,i){const r=[],n=2*Math.PI/i;for(let s=0;sr.type==="object")?Xn.SYMBOL_TYPE_UNSUPPORTED:tj(t)!=="on-the-ground"&&ij(t)?Xn.ELEVATION_MODE_UNSUPPORTED:Xn.SUPPORTED}function wxe(t,e,i){if(!e||!(t!=null&&t.map))return;const{map:r}=t,n=r.layers.find(s=>s===e);n||r.add(e,i),n&&i!=null&&r.layers.reorder(n,i)}function sgi(t,e){const i=(e==null?void 0:e.type)==="subtype-sublayer"?e.parent:e;return t.allLayerViews.find(r=>{const n=r.layer;return n===i||"sublayers"in n&&n.sublayers!=null&&n.sublayers.includes(i)})}const Oa={redo:"r",undo:"z",center:"Alt",constraint:"Shift",cancel:"Escape",delete:["Backspace","Delete"],complete:"Enter",vertexAdd:"f",pan:" "},xxe={toggle:"Control"},ogi={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"};let Lk=class extends ze{constructor(e){super(e),this.enabled=!1}};y([w({type:Boolean,nonNullable:!0})],Lk.prototype,"enabled",void 0),Lk=y([Z("esri.views.interactive.sketch.SketchLabelOptions")],Lk);const XVe=Lk;let Z$=class extends ze{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};y([w({type:String,nonNullable:!0})],Z$.prototype,"mode",void 0),Z$=y([Z("esri.widgets.Sketch.SketchTooltipOptions.ElevationOptions")],Z$);let Oh=class extends ze{constructor(e){super(e),this.area=!0,this.distance=!0,this.elevation=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}toJSON(){return{area:this.area,distance:this.distance,elevation:this.elevation,helpMessage:this.helpMessage,orientation:this.orientation,radius:this.radius,rotation:this.rotation,scale:this.scale,size:this.size,totalLength:this.totalLength}}};y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"area",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"distance",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"elevation",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"helpMessage",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"orientation",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"radius",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"rotation",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"scale",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"size",void 0),y([w({type:Boolean,nonNullable:!0})],Oh.prototype,"totalLength",void 0),Oh=y([Z("esri.widgets.Sketch.SketchTooltipOptions.VisibleElements")],Oh);let ww=class extends ze{constructor(e){super(e),this.enabled=!1,this.inputEnabled=!1,this.elevation=new Z$,this.visibleElements=new Oh,this.visualVariables=null}toJSON(){return{enabled:this.enabled,elevation:this.elevation,visibleElements:this.visibleElements}}};y([w({type:Boolean,nonNullable:!0})],ww.prototype,"enabled",void 0),y([w({type:Boolean,nonNullable:!0})],ww.prototype,"inputEnabled",void 0),y([w({type:Z$,nonNullable:!0})],ww.prototype,"elevation",void 0),y([w({type:Oh,nonNullable:!0})],ww.prototype,"visibleElements",void 0),y([w()],ww.prototype,"visualVariables",void 0),ww=y([Z("esri.widgets.Sketch.SketchTooltipOptions")],ww);const ZVe=ww;function hgi(t,e,i){return nt(t,e,i)}function dgi(t){return t}function Q2(t,e,i){return nt(t,e,i)}function z5(t){return Xr(t)}function so(t,e,{coordinateHelper:i,elevationInfo:r}){return t?DI(i.vectorToDehydratedPoint(t,DBt),e,r):null}function DI(t,e,i){if(t==null)return null;if(e==null)return nt(t.x,t.y,t.z??0);if(e.type==="2d")return nt(t.x,t.y,0);const r=bPe(e,t,i,ma)??0;return nt(t.x,t.y,r)}function pgi(t,e){return Xu(t[0],t[1],t[2],e)}const DBt=Xu(0,0,0,null);let wm=class extends Ue{constructor(){super(...arguments),this.enabled=!0}};y([w({type:Boolean})],wm.prototype,"enabled",void 0),wm=y([Z("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],wm);let Js=class extends Ue{constructor(e){super(e),this.lineSnapper=new wm,this.parallelLineSnapper=new wm,this.rightAngleSnapper=new wm,this.rightAngleTriangleSnapper=new wm,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThreshold=.1,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new qe([255,127,0]),this.orangeTransparent=new qe([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};y([w({type:wm,constructOnly:!0,nonNullable:!0,json:{write:!0}})],Js.prototype,"lineSnapper",void 0),y([w({type:wm,constructOnly:!0,nonNullable:!0,json:{write:!0}})],Js.prototype,"parallelLineSnapper",void 0),y([w({type:wm,constructOnly:!0,nonNullable:!0,json:{write:!0}})],Js.prototype,"rightAngleSnapper",void 0),y([w({type:wm,constructOnly:!0,nonNullable:!0,json:{write:!0}})],Js.prototype,"rightAngleTriangleSnapper",void 0),y([w({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],Js.prototype,"shortLineThreshold",void 0),y([w({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],Js.prototype,"distance",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],Js.prototype,"pointThreshold",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],Js.prototype,"intersectionParallelLineThreshold",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],Js.prototype,"parallelLineThreshold",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Js.prototype,"verticalLineThreshold",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],Js.prototype,"touchSensitivityMultiplier",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],Js.prototype,"pointOnLineThreshold",void 0),y([w({type:qe,nonNullable:!0})],Js.prototype,"orange",void 0),y([w({type:qe,nonNullable:!0})],Js.prototype,"orangeTransparent",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],Js.prototype,"lineHintWidthReference",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],Js.prototype,"lineHintWidthTarget",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],Js.prototype,"lineHintFadedExtensions",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],Js.prototype,"parallelLineHintWidth",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],Js.prototype,"parallelLineHintLength",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],Js.prototype,"parallelLineHintOffset",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],Js.prototype,"rightAngleHintSize",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],Js.prototype,"rightAngleHintOutlineSize",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],Js.prototype,"satisfiesConstraintScreenThreshold",void 0),Js=y([Z("esri.views.interactive.snapping.Settings.Defaults")],Js);const a_=new Js;var Wl;(function(t){t[t.FEATURE=1]="FEATURE",t[t.SELF=2]="SELF",t[t.ALL=3]="ALL"})(Wl||(Wl={}));function TX(t,e){return t[0]*e[1]-t[1]*e[0]}function NBt(t,e,i){const r=fs(i,e)/Yy(i);return Gu(t,i,r)}function EX(t,e,i,r,n=i){return Ps(TT,r,i),Ps(IV,e,n),NBt(U5,IV,TT),df(t,n,U5)}function FBt(t,e,i,r){Ps(TT,e,i);const n=r/j9(TT);return If(t,i,TT,n)}function ggi(t,e){const i=t.start,r=t.end,n=e.start,s=e.end,o=Ps(TT,r,i),l=Ps(JVe,s,n),c=TX(o,l);if(Math.abs(c)<=zBt)return[];const f=Ps(IV,i,n),_=TX(l,f)/c,x=TX(o,f)/c;if(_>=0){if(x>=0||e.type===lo.LINE)return[If(U5,i,o,_)]}else if(t.type===lo.LINE&&(x>=0||e.type===lo.LINE))return[If(U5,i,o,_)];return[]}function kBt(t,e,i){const r=[],n=Ps(TT,t.end,t.start),s=Ps(JVe,t.start,e),o=Yy(n),l=2*fs(n,s),c=l*l-4*o*(Yy(s)-i*i);if(c===0){const f=-l/(2*o);(t.type===lo.LINE||f>=0)&&r.push(If(U5,t.start,n,f))}else if(c>0){const f=Math.sqrt(c),_=(-l+f)/(2*o);(t.type===lo.LINE||_>=0)&&r.push(If(U5,t.start,n,_));const x=(-l-f)/(2*o);(t.type===lo.LINE||x>=0)&&r.push(If(IV,t.start,n,x))}return r}var lo;(function(t){t[t.RAY=0]="RAY",t[t.LINE=1]="LINE"})(lo||(lo={}));const zBt=1e-6,TT=yt(),JVe=yt(),IV=yt(),U5=yt();function bue({start:t,end:e,type:i},r,n){const s=[],o=Ps(PE,e,t),l=Ps(AP,t,r),c=Yy(o),f=2*fs(o,l),_=f*f-4*c*(Yy(l)-n*n);if(_===0){const x=-f/(2*c);(i===bp.PLANE||x>=0)&&s.push(If(yt(),t,o,x))}else if(_>0){const x=Math.sqrt(_),T=(-f+x)/(2*c);(i===bp.PLANE||T>=0)&&s.push(If(yt(),t,o,T));const A=(-f-x)/(2*c);(i===bp.PLANE||A>=0)&&s.push(If(yt(),t,o,A))}return s}function KVe(t,e){const i=t.start,r=t.end,n=Ps(PE,r,i),s=Ie(AP,-n[1],n[0],0),o=e.start,l=e.end,c=xn(Sue,l,o),f=Ve(c,s),_=Ie(aBe,i[0],i[1],0),x=xn(lBe,_,o),T=Ve(x,s);if(Math.abs(f){const t=W(),e=W(),i=W();return({start:r,end:n},{center:s,radius:o,normal:l,slicePlane:c})=>{const f=W(),_=z_(s,l,HBt);if(Eo(EQ(_,r),0)&&Eo(EQ(_,n),0)){lRe(l,t,e);const x=(M,I)=>(je(i,I,s),or(M,Ve(i,t),Ve(i,e)),M),T=kBt({start:x(oBe,r),end:x(GBt,n),type:lo.LINE},Wy,o),A=[];for(const[M,I]of T){const L=Ne(W(),s);ao(L,L,t,M),ao(L,L,e,I),c&&!S2(c,L)||A.push(L)}return A}return uRe(_,r,n,f)?!Eo(Sn(f,s),o)||c&&!S2(c,f)?[]:[f]:[]}})();function rBe({start:t,end:e,type:i},r,n){const s=[],o=je(PE,e,t),l=Ps(AP,t,r),c=Yy(o),f=2*fs(o,l),_=f*f-4*c*(Yy(l)-n*n);if(_===0){const x=-f/(2*c);(i===lo.LINE||x>=0)&&s.push(ao(W(),t,o,x))}else if(_>0){const x=Math.sqrt(_),T=(-f+x)/(2*c);(i===lo.LINE||T>=0)&&s.push(ao(W(),t,o,T));const A=(-f-x)/(2*c);(i===lo.LINE||A>=0)&&s.push(ao(W(),t,o,A))}return s}function nBe(t,e){const i=t.start,r=t.end,n=e.start,s=e.end,o=xn(PE,r,i),l=xn(AP,s,n),c=xn(Sue,n,i),f=Wt(aBe,o,l),_=Ve(c,f);if(!Ey(_,0,by))return[];const x=HO(f);if(Ey(x,0,by))return[];const T=Wt(lBe,c,l),A=Ve(T,f)/x,M=ao(cBe,i,o,A);if(t.type===lo.RAY){const I=xn(LV,M,i);if(Ve(o,I)<-by)return[]}if(e.type===lo.RAY){const I=xn(LV,M,n);if(Ve(l,I)<-by)return[]}return[Xr(M)]}function VBt({start:t,end:e,type:i},r){const n=xn(PE,r,t),s=xn(AP,e,t),o=Wt(Sue,s,n);if(HO(o)/HO(s)e+r)return[];if(xS2(t,i))}function S2(t,e){return zoe(t,e)}var bp;(function(t){t[t.PLANE=0]="PLANE",t[t.HALF_PLANE=1]="HALF_PLANE"})(bp||(bp={}));const jBt={[bp.PLANE]:lo.LINE,[bp.HALF_PLANE]:lo.RAY},by=1e-6,oBe=yt(),GBt=yt(),PE=W(),AP=W(),Sue=W(),aBe=W(),lBe=W(),cBe=W(),LV=W(),HBt=Fi(),Tue={start:W(),end:W(),type:lo.LINE},qBt={start:W(),end:W(),type:lo.LINE};class f1{intersect(e){return hv(this,e)}closestPoints(e){return[this.closestTo(e)]}}class MP extends f1{constructor(e){super(),this.point=e}equals(e){return this===e||Jg(e)&&jr(this.point,e.point)}closestTo(){return z5(this.point)}}class Eue extends f1{constructor(e,i,r){super(),this.start=e,this.end=i,this.lineLike={start:e,end:i,type:r}}equals(e){return this===e||Kg(e)&&this.lineLike.type===e.lineLike.type&&jr(this.start,e.start)&&jr(this.end,e.end)}closestTo(e){const i=wue(e,this.lineLike);return i}}let Cue=class extends Eue{constructor(e,i){super(e,i,lo.LINE)}},WBt=class extends Eue{constructor(e,i){super(e,i,lo.RAY)}};class uBe extends f1{constructor(e){super(),this.constraints=e}equals(e){return this===e||Ore(e)&&Fy(this.constraints,e.constraints,(i,r)=>i.equals(r))}closestTo(e){let i,r=1/0;for(const n of this.constraints){const s=n.closestTo(e),o=Co(e,s);oi===this?[]:i.closestPoints(e))}}class hBe extends f1{constructor(e,i){super(),this.center=e,this.radius=i}equals(e){return this===e||ey(e)&&this.center[0]===e.center[0]&&this.center[1]===e.center[1]&&this.radius===e.radius}closestTo(e){const i=tBe(e,this.center,this.radius);return i}}let Aue=class extends f1{constructor(e,i){super(),this.center=e,this.radius=i}equals(e){return this===e||pv(e)&&jr(this.center,e.center)&&this.radius===e.radius}closestTo(e){const i=tBe(e,this.center,this.radius);return i[2]=this.center[2],i}asCircle(){return new Mue(z5(this.center),this.radius,Q2(0,0,1))}};class Mue extends f1{constructor(e,i,r,n=void 0){super(),this.center=e,this.radius=i,this.normal=r,this.slicePlane=n}equals(e){return this===e||xw(e)&&jr(this.center,e.center)&&jr(this.normal,e.normal)&&this.radius===e.radius}closestTo(e){const{center:i,radius:r}=this;Uoe(this.getPlane(YBt),e,CX);const n=xn(CX,CX,i),s=El(n);if(Eo(s,0))return z5(e);const o=r/Math.sqrt(s),l=ao(W(),i,n,o),{slicePlane:c}=this;if(c&&!S2(c,l)){const f=Pue(c,this);return(f==null?void 0:f.closestTo(e))??z5(e)}return l}getPlane(e=Fi()){return z_(this.center,this.normal,e)}}const CX=W(),YBt=Fi();class XBt extends f1{constructor(e){super(),this.z=e}equals(e){return this===e||dv(e)&&this.z===e.z}closestTo(e){return nt(e[0],e[1],this.z)}getPlane(e=Fi()){return Ie(Sxe,0,0,this.z),z_(Sxe,fB,e)}}const Sxe=W();class Oue extends f1{constructor(e,i,r){super(),this.start=e,this.end=i,this.planeLike={start:e,end:i,type:r}}equals(e){return this===e||Qg(e)&&this.planeLike.type===e.planeLike.type&&jr(this.start,e.start)&&jr(this.end,e.end)}closestTo(e){return eBe(e,this.planeLike)}closestEndTo(e){const{start:i,end:r}=this;return Math.sign(fs(Ps(ZBt,r,i),Ps(JBt,e,i)))>0?r:i}getPlane(e=Fi()){const i=Ne(Txe,this.end);return i[2]+=1,jl(this.start,this.end,i,e)}getSlicePlane(e=Fi()){const{start:i,end:r,type:n}=this.planeLike;if(n===bp.PLANE)return;const s=Ie(Txe,i[0],i[1],0),o=Ie(Exe,r[0],r[1],0),l=je(Exe,o,s);return z_(s,l,e),e}}const ZBt=yt(),JBt=yt(),Txe=W(),Exe=W();class dBe extends Oue{constructor(e,i){super(e,i,bp.HALF_PLANE)}}class pBe extends Oue{constructor(e,i){super(e,i,bp.PLANE)}}class KBt extends f1{constructor(e,i){super(),this.sphere=Noe(e,i)}equals(e){return this===e||fv(e)&&eRe(this.sphere,e.sphere)}closestTo(e){const i=lj(this.sphere,e,W());return i}get center(){return this.sphere}get radius(){return this.sphere[3]}}class fBe extends f1{constructor(e,i,r){super(),this.start=e,this.end=i,this.getZ=r,this.planeLike={start:e,end:i,type:bp.PLANE}}equals(e){return this===e||DV(e)&&jr(this.start,e.start)&&jr(this.end,e.end)&&this.getZ===e.getZ}closestTo(e){return QBt(this,e)}addIfOnTheGround(e,i){for(const r of i){const n=this.getZ(r[0],r[1])??0;Eo(r[2],n)&&(r[2]=n,e.push(r))}}}function QBt(t,e){const i=eBe(e,t.planeLike);return i[2]=t.getZ(i[0],i[1])??gBe,i}function hv(t,e){if(Ore(t)){const i=[];for(const r of t.constraints){const n=r.intersect(e);n&&i.push(n)}return Rue(i)}if(Ore(e))return hv(e,t);if(DV(t))return Cxe(t,e);if(DV(e))return Cxe(e,t);if(Jg(t)){const{point:i}=t,r=e.closestTo(i);return M2(r,i)?t:void 0}if(Kg(t)){if(Jg(e))return hv(e,t);if(Kg(e))return xm(nBe(t.lineLike,e.lineLike));if(dv(e))return ejt(t,e);if(Qg(e))return xm(KVe(e.planeLike,t.lineLike));if(ey(e))return xm(rBe(t.lineLike,e.center,e.radius));if(xw(e))return xm(iBe(t.lineLike,e));if(pv(e))return tjt(t,e);if(fv(e))return ijt(t,e)}else if(dv(t)){if(Jg(e)||Kg(e))return hv(e,t);if(dv(e))return rjt(t,e);if(Qg(e))return njt(t,e);if(ey(e))return sjt(t,e);if(xw(e))return ajt(t,e);if(pv(e))return ojt(t,e);if(fv(e))return ljt(t,e)}else if(Qg(t)){if(Jg(e)||Kg(e)||dv(e))return hv(e,t);if(Qg(e))return AX(QVe(t.planeLike,e.planeLike));if(ey(e))return AX(bue(t.planeLike,e.center,e.radius));if(xw(e))return ujt(t,e);if(pv(e))return cjt(t,e);if(fv(e))return hjt(t,e)}else if(ey(t)){if(Jg(e)||Kg(e)||dv(e)||Qg(e))return hv(e,t);if(ey(e))return AX(xue(t.center,t.radius,e.center,e.radius));if(xw(e))return void 0;if(pv(e))return djt(t,e);if(fv(e))return void 0}else if(xw(t)){if(Jg(e)||Kg(e)||dv(e)||Qg(e)||ey(e))return hv(e,t);if(xw(e))return void 0;if(pv(e))return e.asCircle(),void 0;if(fv(e))return void 0}else if(pv(t)){if(Jg(e)||Kg(e)||dv(e)||Qg(e)||ey(e)||xw(e))return hv(e,t);if(pv(e))return pjt(e,t);if(fv(e))return void 0}else if(fv(t)){if(Jg(e)||Kg(e)||dv(e)||Qg(e)||ey(e)||pv(e))return hv(e,t);if(fv(e))return void 0}}const ejt=(()=>{const t=Fi();return(e,i)=>{const{start:r,end:n}=e;if(sBe(r,n)&&Eo(r[2],i.z))return e;const s=W();return uRe(i.getPlane(t),r,n,s)?new MP(s):void 0}})();function tjt({lineLike:t},{center:e,radius:i}){const r=e[2];return xm(rBe(t,e,i).filter(n=>Eo(n[2],r)))}function ijt({lineLike:t},{sphere:e}){return xm(iRe(e,t.start,t.end))}const Pue=(()=>{const t=Ko(),e=Fi(),i={start:W(),end:W(),type:lo.LINE};return(r,n,s)=>{const{normal:o,center:l,radius:c}=n,f=Ve(o,r),_=Eo(EQ(r,l),0);if(Eo(f,1))return _?n:void 0;if(n.getPlane(e),_&&Eo(f,0)&&Cfe(r)&&Cfe(e)){if(Eo(c,0))return!s||S2(s,l)?new MP(z5(l)):void 0;const T=Xr(l);T[2]+=c;const A=Xr(l);A[2]-=c;const M=[];return s&&!S2(s,T)||M.push(T),s&&!S2(s,A)||M.push(A),xm(M)}if(!Nut(r,e,t))return;Ne(i.start,t.origin),Be(i.end,t.origin,t.direction);const x=iBe(i,n);return xm(s?BBt(s,x):x)}})();function rjt(t,e){return Eo(t.z,e.z)?t:void 0}function njt({z:t},{planeLike:e}){const[i,r]=e.start,[n,s]=e.end,o=Q2(i,r,t),l=Q2(n,s,t);return e.type===bp.PLANE?new Cue(o,l):new WBt(o,l)}function sjt(t,e){const[i,r]=e.center;return new Aue(Q2(i,r,t.z),e.radius)}function ojt(t,e){return Eo(e.center[2],t.z)?e:void 0}const ajt=(()=>{const t=Fi();return(e,i)=>Pue(e.getPlane(t),i)})();function ljt(t,{center:e,radius:i}){const r=Math.abs(e[2]-t.z);if(r>i&&!Eo(r,i))return;const n=Q2(e[0],e[1],t.z),s=Math.sqrt(i**2-r**2);return Eo(s,0)?void 0:new Aue(n,s)}const cjt=(()=>{const t=Fi();return(e,{center:i,radius:r})=>{const n=bue(e.planeLike,i,r),s=i[2];e.getSlicePlane(t);const o=[];for(const[l,c]of n){const f=[l,c,s];S2(t,f)&&o.push(f)}return xm(o)}})(),ujt=(()=>{const t=Fi(),e=Fi();return(i,r)=>Pue(i.getPlane(t),r,i.getSlicePlane(e))})(),hjt=(()=>{const t=Fi();return(e,{center:i,radius:r})=>{const n=e.getPlane(t),s=fn(n,i),o=Math.abs(s);if(o>r&&!Eo(o,r))return;const l=Xr(n),c=ao(W(),i,l,s),f=Math.sqrt(r**2-s**2);return Eo(f,0)?new MP(Uoe(n,i,W())):new Mue(c,f,l,e.getSlicePlane())}})();function djt(t,e){const i=Jf(t.center,e.center);return Eo(i,0)&&Eo(t.radius,e.radius)?e:mBe(xue(t.center,t.radius,e.center,e.radius),e.center[2])}function pjt(t,e){if(!sBe(t.center,e.center))return;const i=Jf(t.center,e.center);return Eo(i,0)&&Eo(t.radius,e.radius)?t:mBe(xue(t.center,t.radius,e.center,e.radius),t.center[2])}function Cxe(t,e){const{planeLike:i,getZ:r}=t,n=[];if(Jg(e))t.addIfOnTheGround(n,UBt(i,e.point));else if(Kg(e))t.addIfOnTheGround(n,KVe(i,e.lineLike));else if(ey(e))for(const[s,o]of bue(i,e.center,e.radius)){const l=r(s,o);l!=null&&n.push(nt(s,o,l))}else if(Qg(e)||DV(e))for(const[s,o]of QVe(i,e.planeLike)){const l=r(s,o)??gBe;n.push(nt(s,o,l))}return xm(n)}function AX(t){return Rue(t.map(([e,i])=>{const r=Q2(e,i,0),n=Q2(e,i,1);return new Cue(r,n)}))}function xm(t){return Rue(t.map(e=>e?new MP(e):void 0))}function mBe(t,e){return xm(t.map(([i,r])=>[i,r,e]))}function Rue(t){if(t.length!==0)return t.length===1?t[0]??void 0:new uBe(t.filter(ys))}function Ore(t){return t instanceof uBe}function Jg(t){return t instanceof MP}function Kg(t){return t instanceof Eue}function dv(t){return t instanceof XBt}function Qg(t){return t instanceof Oue}function ey(t){return t instanceof hBe}function pv(t){return t instanceof Aue}function xw(t){return t instanceof Mue}function fv(t){return t instanceof KBt}function DV(t){return t instanceof fBe}const gBe=0;var Pre;const MX=new yn({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),OX=new yn({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let Gg=Pre=class extends Ue{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:e,geometry:i,spatialRelationship:r,timeExtent:n,objectIds:s,units:o,distance:l}=this;return new F_({geometry:Re(i),objectIds:Re(s),spatialRelationship:r,timeExtent:Re(n),where:e,units:o,distance:l,...t})}clone(){const{where:t,geometry:e,spatialRelationship:i,timeExtent:r,objectIds:n,units:s,distance:o}=this;return new Pre({geometry:Re(e),objectIds:Re(n),spatialRelationship:i,timeExtent:Re(r),where:t,units:s,distance:o})}};y([w({type:String,json:{write:!0}})],Gg.prototype,"where",void 0),y([w({types:I9,json:{write:!0}})],Gg.prototype,"geometry",void 0),y([w({type:MX.apiValues,json:{name:"spatialRel",read:{reader:MX.read},write:{allowNull:!1,writer:MX.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],Gg.prototype,"spatialRelationship",void 0),y([w({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],Gg.prototype,"distance",void 0),y([w({type:[Number],json:{write:!0}})],Gg.prototype,"objectIds",void 0),y([w({type:OX.apiValues,json:{read:OX.read,write:{writer:OX.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],Gg.prototype,"units",void 0),y([w({type:D_,json:{write:!0}})],Gg.prototype,"timeExtent",void 0),Gg=Pre=y([Z("esri.layers.support.FeatureFilter")],Gg);const Dk=Gg;function RE(t,e){const i=t.x-e.x,r=t.y-e.y;return i*i+r*r}function fjt(t,e){return Math.sqrt(RE(t,e))}function Iue(t,e){e.sort((i,r)=>Co(i.targetPoint,t)-Co(r.targetPoint,t))}var i0;function bgi({point:t,distance:e,returnEdge:i,vertexMode:r,coordinateHelper:{spatialReference:n},filter:s},o,l){return l=l!=null?l.clone():new F_({where:"1=1"}),s&&(l.geometry=s.geometry,l.distance=s.distance,l.spatialRelationship=s.spatialRelationship,l.where=PB(l.where,s.where),l.timeExtent=uot(l.timeExtent,s.timeExtent),l.objectIds=mjt(l.objectIds,s.objectIds)),{point:Xu(t[0],t[1],t[2],n.toJSON()),mode:o,distance:e,returnEdge:i,vertexMode:r,query:l.toJSON()}}function mjt(t,e){return t||e?e?t?Array.from(IGe(new Set(t),new Set(e))):e:t:null}function NV(t,e,i){return{left:so(t.leftVertex.pos,e,i),right:so(t.rightVertex.pos,e,i)}}function wgi(t){return t.createQuery()}function gjt(t,e=()=>{}){const i=_e(()=>({view:t.view,snappingOptions:t.snappingOptions}),({view:r,snappingOptions:n})=>{const s="snapping-toggle",o=Es.TOOL;if(t.removeHandles(s),r&&n!=null){const l=[r.on("key-down",c=>{c.key!==xxe.toggle||c.repeat||(n.enabledToggled=!0,e())},o),r.on("key-up",c=>{c.key===xxe.toggle&&(n.enabledToggled=!1,e())},o),r.on("pointer-move",c=>{const f=c.native.ctrlKey;n.enabledToggled!==f&&(n.enabledToggled=f,e())},o)];t.addHandles(l,s)}},kt);t.addHandles(i)}function yjt(t){var e;return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"&&"utilityNetworks"in t&&!!((e=t==null?void 0:t.utilityNetworks)!=null&&e.length)}(function(t){t[t.TARGET=0]="TARGET",t[t.REFERENCE=1]="REFERENCE",t[t.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(i0||(i0={}));let tf=class extends ze{get layerView(){var e,i;return(i=(e=this.view)==null?void 0:e.allLayerViews)==null?void 0:i.find(r=>r.layer===this.layer)}get valid(){return this._valid}get subtypeFilter(){var n,s;const{layer:e}=this;if(!znt(e)||!((n=e.subtypes)!=null&&n.length))return{mode:"not-in-use",filter:null};const i=((s=e.fieldsIndex.get(e.subtypeField))==null?void 0:s.name)??e.subtypeField,r=e.sublayers.filter(o=>o.visible).map(o=>o.subtypeCode);return r.length?r.length===e.subtypes.length?{mode:"all-visible",filter:null}:r.length===1?{mode:"in-use",filter:`${i} = ${r.getItemAt(0)}`}:{mode:"in-use",filter:`${i} IN (${r.join(", ")})`}:{mode:"none-visible",filter:null}}get floorFilter(){const{view:e,layer:i}=this;return e&&i?MFt({view:e,layer:i}):null}constructor(e){super(e),this.rulesTable=null,this._valid=!1}initialize(){if(!this.snappingSource||!this.layer)return;const{layer:e,snappingSource:i}=this;if("refresh"in e){const r=e;this.addHandles(r.on("refresh",()=>i.refresh()))}this.loadRules(),this.addHandles([_e(()=>i.updating,r=>i.layerSource.updating=r,kt),_e(()=>i.availability,r=>i.layerSource.availability=r,kt)])}getFetchCandidatesParameters(e,i,r){var _,x;if(!this.valid)return[];const{layer:n,layerView:s,floorFilter:o,rulesTable:l,subtypeFilter:c}=this,f={distance:r,mode:((_=this.view)==null?void 0:_.type)??"2d",point:e,coordinateHelper:i.coordinateHelper,...this._types,filter:s&&"filter"in s?s.filter:null};if(o&&(f.filter=PX(f.filter,o)),c.mode!=="not-in-use"&&c.mode!=="all-visible"){if(c.mode==="none-visible")return[];f.filter?f.filter.where=PB(f.filter.where,c.mode):f.filter=new Dk({where:c.filter})}if(l){const T=i.feature,A=T==null?void 0:T.sourceLayer;if(!(T&&W7(n)&&n.layerId&&W7(A)&&l.loadStatus==="loaded"))return[];const M=[],I=n.layerId,L=(x=l.getFeatureSQL(A,T))==null?void 0:x[I];if(!L)return[];const F=L.anyVertex;let z=L.endVertex;return z&&F&&z===F&&(z=""),z&&M.push({...f,returnEdge:!1,vertexMode:"ends",filter:PX(f.filter,z)}),F&&M.push({...f,returnEdge:!1,vertexMode:"all",filter:PX(f.filter,F)}),M}return[f]}async loadRules(){var r,n;const{layer:e,view:i}=this;if(e&&i&&yjt(i==null?void 0:i.map)&&W7(e)){const s=(r=i.map.utilityNetworks)==null?void 0:r.find(o=>o.isUtilityLayer(e));if(s)try{this.rulesTable=await s.getRulesTable(),await((n=this.rulesTable)==null?void 0:n.load()),this._valid=!0}catch{return void Ce.getLogger("esri.views.interactive.snapping.FeatureSnappingSourceInfo").error("Failed to load rules table for snapping source",e.title)}}else this._valid=!0}get _types(){return{returnEdge:!0,vertexMode:"all"}}remove(){this.destroy()}destroy(){var e;(e=this.snappingSource)==null||e.destroy()}};function PX(t,e){return t==null?new Dk({where:e}):t.where?new Dk({where:PB(t.where,e)}):new Dk({where:e})}y([w({constructOnly:!0})],tf.prototype,"layer",void 0),y([w({constructOnly:!0})],tf.prototype,"snappingSource",void 0),y([w({constructOnly:!0})],tf.prototype,"view",void 0),y([w()],tf.prototype,"layerView",null),y([w()],tf.prototype,"rulesTable",void 0),y([w()],tf.prototype,"valid",null),y([w()],tf.prototype,"subtypeFilter",null),y([w()],tf.prototype,"floorFilter",null),y([w()],tf.prototype,"_valid",void 0),tf=y([Z("esri.views.interactive.snapping.FeatureSnappingSourceInfo")],tf);let OP=class{constructor(e,i,r,n){this.targetPoint=e,this.constraint=i,this.isDraped=r,this.domain=n}},$ue=class extends OP{constructor({targetPoint:e,objectId:i,constraint:r,isDraped:n}){super(e,r,n,Wl.FEATURE),this.objectId=i}},jG=class{constructor(e,i){this.isDraped=e,this.domain=i}},e1=class yBe extends jG{constructor(e,i,r,n,s=Wl.ALL,o=!0,l=!0){super(n,s),this.type=e,this.lineStart=i,this.lineEnd=r,this.fadeLeft=o,this.fadeRight=l}equals(e){return e instanceof yBe&&this.type===e.type&&jr(this.lineStart,e.lineStart)&&jr(this.lineEnd,e.lineEnd)&&this.fadeLeft===e.fadeLeft&&this.fadeRight===e.fadeRight}get length(){return Sn(this.lineStart,this.lineEnd)}},vjt=class extends $ue{constructor(e){super({...e,isDraped:!0,constraint:new fBe(e.edgeStart,e.edgeEnd,e.getGroundElevation)})}get hints(){return[new e1(i0.REFERENCE,this.constraint.start,this.constraint.end,this.isDraped,this.domain)]}},_jt=class extends $ue{constructor(e){super({...e,constraint:new Cue(e.edgeStart,e.edgeEnd)})}get hints(){return[new e1(i0.REFERENCE,this.constraint.start,this.constraint.end,this.isDraped,this.domain)]}},vBe=class _Be extends jG{constructor(e,i,r,n,s=Wl.ALL){super(n,s),this.previousVertex=e,this.centerVertex=i,this.nextVertex=r}equals(e){return e instanceof _Be&&jr(this.previousVertex,e.previousVertex)&&jr(this.centerVertex,e.centerVertex)&&jr(this.nextVertex,e.nextVertex)}},bBe=class extends OP{constructor({targetPoint:e,constraint:i,previousVertex:r,otherVertex:n,otherVertexType:s,objectId:o,isDraped:l}){super(e,i,l,Wl.SELF),this.previousVertex=r,this.otherVertex=n,this.otherVertexType=s,this.objectId=o}get hints(){const e=this.previousVertex,i=this.otherVertexType===V5.CENTER?this.otherVertex:this.targetPoint,r=this.otherVertexType===V5.CENTER?this.targetPoint:this.otherVertex;return[new e1(i0.TARGET,i,r,this.isDraped,this.domain),new e1(i0.REFERENCE,e,i,this.isDraped,this.domain),new vBe(this.previousVertex,i,r,this.isDraped,this.domain)]}};var V5;(function(t){t[t.NEXT=0]="NEXT",t[t.CENTER=1]="CENTER"})(V5||(V5={}));function Ogi(t,e,i,r){i.projectToRenderScreen(t,Axe),i.projectToRenderScreen(e,Mxe),Ps(r,Mxe,Axe),w5(r,r)}function bjt(t,e,i,r,n=W()){const s=Ne(Rre,t);return s[2]=wPe(r,s,e,i)||0,r.renderCoordsHelper.toRenderCoords(s,e,n),n}function du(t,e,i,r){return r.type==="2d"?(Z8.x=t[0],Z8.y=t[1],Z8.spatialReference=e,r.toScreen(Z8)):(bjt(t,e,i,r,Rre),r.state.camera.projectToScreen(Rre,RX),Ku(RX[0],RX[1]))}const Z8=Xu(0,0,0,null),Rre=W(),Axe=Za(),Mxe=Za(),RX=ss();let Sw=class extends ze{get updating(){return this._snappingSources.some(e=>e==null||e.valid&&e.snappingSource.updating)||this._updatingHandles.updating}constructor(e){super(e),this.options=null,this._domain=Wl.FEATURE,this._updatingHandles=new Rf,this._sourceModules={featureService:{module:null,loader:null},featureCollection:{module:null,loader:null},graphics:{module:null,loader:null},notes:{module:null,loader:null},scene:{module:null,loader:null}}}initialize(){const e=NHe(()=>{var i;return(i=this.options)==null?void 0:i.featureSources},(i,r)=>this._createSourceInfo(i,r));this._snappingSources=e,this.addHandles(Jre(e))}destroy(){this._set("options",null),this._updatingHandles.destroy()}async fetchCandidates(e,i,r,n){var c;if(!(i&this._domain&&this.options!=null&&this.options.effectiveFeatureEnabled))return[];const s=[],o=this._computeScreenSizeDistanceParameters(e,r);for(const f of this._snappingSources){if(f==null||!f.valid||!f.snappingSource.layerSource.enabled||(c=f.layerView)!=null&&c.suspended)continue;const _=f.getFetchCandidatesParameters(e,r,o);for(const x of _)s.push(f.snappingSource.fetchCandidates(x,n).then(T=>T.filter(A=>!this._candidateIsExcluded(f.snappingSource,A,r.excludeFeature))))}const l=(await ZX(s)).flat();return this._addRightAngleCandidates(l,e,o,r),St(n),Iue(e,l),l}_addRightAngleCandidates(e,i,r,n){var x,T,A,M,I,L,F,z;const s=n.vertexHandle!=null?(T=(x=n.vertexHandle.rightEdge)==null?void 0:x.rightVertex)==null?void 0:T.pos:n.editGeometryOperations!=null&&n.editGeometryOperations.data.type==="polygon"?(M=(A=n.editGeometryOperations.data.components[0])==null?void 0:A.getFirstVertex())==null?void 0:M.pos:null,o=n.vertexHandle!=null?(L=(I=n.vertexHandle.leftEdge)==null?void 0:I.leftVertex)==null?void 0:L.pos:n.editGeometryOperations!=null?(z=(F=n.editGeometryOperations.data.components[0])==null?void 0:F.getLastVertex())==null?void 0:z.pos:null,{view:l}=this,c=so(s,l,n),f=so(o,l,n),_=e.length;for(let k=0;k<_;k++)this._addRightAngleCandidate(e[k],f,i,r,e),this._addRightAngleCandidate(e[k],c,i,r,e)}_addRightAngleCandidate(e,i,r,n,s){if(i==null||!wjt(e))return;const o=e.constraint.closestTo(i),l=(o[0]-r[0])/n.x,c=(o[1]-r[1])/n.y,{start:f,end:_}=e.constraint;if(l*l+c*c<=1){const x=new bBe({targetPoint:o,otherVertex:i,otherVertexType:V5.NEXT,previousVertex:Jf(o,f)>Jf(o,_)?f:_,constraint:new dBe(i,o),objectId:e.objectId,isDraped:e.isDraped});s.push(x)}}_computeScreenSizeDistanceParameters(e,i){let r=this.options!=null?this.options.distance*(i.pointer==="touch"?this.options.touchSensitivityMultiplier:1):0;return this.view==null?{x:r,y:r,z:r,distance:r}:this.view.type==="2d"?(r*=this.view.resolution,{x:r,y:r,z:r,distance:r}):this._computeScreenSizeDistanceParameters3D(e,r,this.view,i)}_computeScreenSizeDistanceParameters3D(e,i,r,n){const{spatialReference:s}=n;r.renderCoordsHelper.toRenderCoords(e,s,Oxe);const o=r.state.camera.computeScreenPixelSizeAt(Oxe),l=o*r.renderCoordsHelper.unitInMeters,c=l/ws(s),f=l/Bf(s),_=i*c,x=i*f,T=du(e,s,ma,r),A=T?IX(T,e,c,0,0,r,n):0,M=T?IX(T,e,0,c,0,r,n):0,I=T?IX(T,e,0,0,f,r,n):0;return{x:A===0?0:_/A,y:M===0?0:_/M,z:I===0?0:x/I,distance:o*i}}_candidateIsExcluded(e,i,r){if(r==null)return!1;const n=this._getCandidateObjectId(i);if(n==null)return!1;const s=e.layerSource.layer;return s.type==="graphics"?r.uid===n:r.sourceLayer===s&&!(!r.attributes||!("objectIdField"in s))&&r.attributes[s.objectIdField]===n}_getCandidateObjectId(e){return e instanceof $ue?e.objectId:null}async _createSourceInfo(e,i){const r=e.layer;r.loaded||(await r.load(),St(i));const{view:n}=this,s=await this._createFeatureSnappingSourceType(e);return St(i),new tf(s==null?{}:{snappingSource:s,view:n,layer:r})}async _createFeatureSnappingSourceType(e){switch(e.layer.type){case"feature":case"geojson":case"csv":case"oriented-imagery":case"subtype-group":case"wfs":return this._createFeatureSnappingSourceFeatureLayer(e);case"graphics":return this._createFeatureSnappingSourceGraphicsLayer(e);case"map-notes":return this._createFeatureSnappingSourceMapNotesLayer(e);case"scene":case"building-scene":return this._createFeatureSnappingSourceSceneLayer(e)}return null}async _createFeatureSnappingSourceSceneLayer(e){const{view:i}=this;return i==null||i.type!=="3d"?null:new(await this._getSourceModule("scene")).SceneLayerSnappingSource({layerSource:e,view:i})}async _createFeatureSnappingSourceFeatureLayer(e){var i;switch((i=e.layer.source)==null?void 0:i.type){case"feature-layer":case"oriented-imagery":return new(await this._getSourceModule("featureService")).FeatureServiceSnappingSource({spatialReference:this.spatialReference,view:this.view,layerSource:e});case"memory":case"csv":case"geojson":case"wfs":return e.layer.geometryType==="mesh"?null:new(await this._getSourceModule("featureCollection")).FeatureCollectionSnappingSource({layerSource:e,view:this.view})}return null}async _createFeatureSnappingSourceGraphicsLayer(e){return new(await this._getSourceModule("graphics")).GraphicsSnappingSource({getGraphicsLayers:()=>[e.layer],spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _createFeatureSnappingSourceMapNotesLayer(e){return new(await this._getSourceModule("notes")).GraphicsSnappingSource({getGraphicsLayers:()=>{var i;return((i=e.layer.sublayers)==null?void 0:i.toArray())??[]},spatialReference:this.spatialReference,view:this.view,layerSource:e})}async _getSourceModule(e){const i=this._sourceModules[e];if(i.loader==null){const r=this._loadSourceModule(e),n={module:null,loader:r};this._sourceModules[e]=n;const s=await r,o={module:s,loader:r};return this._sourceModules[e]=o,s}return i.module==null?i.loader:i.module}_loadSourceModule(e){const i=this._updatingHandles;switch(e){case"featureService":return i.addPromise(we(()=>import("./FeatureServiceSnappingSource-El1DZ1LB.js"),__vite__mapDeps([261,262,263,4,233])));case"featureCollection":return i.addPromise(we(()=>import("./FeatureCollectionSnappingSource-AwpfuxVk.js"),__vite__mapDeps([264,262,263,4,135])));case"graphics":case"notes":return i.addPromise(we(()=>import("./GraphicsSnappingSource-FqTOI9A3.js"),__vite__mapDeps([265,104,88,89,90,91,92,39,40,93,66,94,73,95,262,263,4,135])));case"scene":return i.addPromise(we(()=>import("./SceneLayerSnappingSource-u6yw_bMd.js"),__vite__mapDeps([266,263,4])))}}get test(){return{snappingSources:this._snappingSources}}};function wjt(t){return(t instanceof _jt||t instanceof vjt)&&!xjt(t)}function xjt({constraint:{start:t,end:e}}){const i=Co(t,e),r=Jf(t,e);return ithis.squaredShortLineThreshold}isVertical(e,i){return Jf(e,i)new e1(i0.REFERENCE,e.edge.left,e.edge.right,this.isDraped,this.domain,e.fadeLeft,e.fadeRight))]}addReferenceLine(e){const i={edge:e,fadeLeft:!0,fadeRight:!0};this._referenceLines.forEach(r=>{jr(e.right,r.edge.left)&&(r.fadeLeft=!1,i.fadeRight=!1),jr(e.right,r.edge.right)&&(r.fadeRight=!1,i.fadeRight=!1),jr(e.left,r.edge.right)&&(r.fadeRight=!1,i.fadeLeft=!1),jr(e.left,r.edge.left)&&(r.fadeLeft=!1,i.fadeLeft=!1)}),this._referenceLines.push(i)}},Ojt=class extends GG{snapNewVertex(e,i){const r=i.editGeometryOperations.data.components[0],n=r.edges.length,s=r.vertices.length,o=[];if(n<2)return o;const{view:l}=this,c=du(e,i.spatialReference,ma,l),f=so(r.vertices[s-1].pos,l,i),_=so(r.vertices[0].pos,l,i),x=r.edges[n-1];let T=x;do{if(this.edgeExceedsShortLineThreshold(T,i)){const A=NV(T,l,i);this._checkEdgeForParallelLines(A,f,e,c,i,o),this._checkEdgeForParallelLines(A,_,e,c,i,o)}T=T.leftVertex.leftEdge}while(T&&T!==x);return o}snapExistingVertex(e,i){const r=[],n=i.vertexHandle,s=n.component;if(s.edges.length<3)return r;const{view:o}=this,l=du(e,i.spatialReference,ma,o),c=n.leftEdge,f=n.rightEdge,_=s.vertices[0],x=so(_.pos,o,i),T=s.vertices.length,A=s.vertices[T-1],M=so(A.pos,o,i),I=s.edges[0];let L=I;do{if(L!==c&&L!==f&&this.edgeExceedsShortLineThreshold(L,i)){const F=NV(L,o,i);c&&this._checkEdgeForParallelLines(F,so(c.leftVertex.pos,o,i),e,l,i,r),f&&this._checkEdgeForParallelLines(F,so(f.rightVertex.pos,o,i),e,l,i,r),n===_?this._checkEdgeForParallelLines(F,M,e,l,i,r):n===A&&this._checkEdgeForParallelLines(F,x,e,l,i,r)}L=L.rightVertex.rightEdge}while(L&&L!==I);return r}_checkEdgeForParallelLines(e,i,r,n,s,o){var T;const l=e.left,c=e.right;if(EX(a3,i,l,c),Jf(a3,i){const{effectiveFeatureEnabled:e,effectiveSelfEnabled:i,touchSensitivityMultiplier:r,distance:n}=this.options;return{effectiveFeatureEnabled:e,effectiveSelfEnabled:i,touchSensitivityMultiplier:r,distance:n}},()=>{this.doneSnapping(),this.emit("changed")},Li),_e(()=>this.options,e=>{for(const i of this._engines)i.options=e},Li),_e(()=>({viewReady:this.view.ready,viewSpatialReference:this.view.spatialReference,snappingEnginesFactory:this.snappingEnginesFactory}),({viewReady:e,snappingEnginesFactory:i})=>this._recreateEngines(e,i),kt)])}destroy(){this._destroyEngines()}get updating(){return this._engines.some(e=>e.updating)}_recreateEngines(e,i){if(this._destroyEngines(),!e)return;const{view:r,options:n}=this;this._engines=i(r,n)}_destroyEngines(){for(const e of this._engines)e.destroy();this._engines=[]}get _squaredMouseProximityTreshold(){return this.options.distance*this.options.distance}get _squaredTouchProximityThreshold(){const{distance:e,touchSensitivityMultiplier:i}=this.options,r=e*i;return r*r}get _squaredSatisfiesConstraintThreshold(){return a_.satisfiesConstraintScreenThreshold*a_.satisfiesConstraintScreenThreshold}snap(e){return kjt(e)?this._snapMultiPoint(e):this._snapSinglePoint(e)}update(e){const{point:i,context:r}=e;this._removeVisualization();const n=this._currentMainCandidate;if(n==null)return i;const s=this._selectUpdateInput(e);if(s==null)return i;const{spatialReference:o}=r,l=rl(s,o);if(l==null)return i;const{view:c}=this,{elevationInfo:f,visualizer:_}=r,x=[],T=DI(l,c,f),A=n.constraint.closestTo(T);if(!this._arePointsWithinScreenThreshold(T,A,r))return this._resetSnappingState(),i;n.targetPoint=A,x.push(...n.hints);for(const M of this._currentOtherActiveCandidates)M.targetPoint=A,x.push(...M.hints);return _!=null&&this.addHandles(_.draw(x,{spatialReference:o,elevationInfo:zjt(r),view:c,selfSnappingZ:r.selfSnappingZ}),Q8),Pxe(A,c,{z:i.z,m:i.m,spatialReference:i.spatialReference,elevationInfo:f})}doneSnapping(){this._removeVisualization(),this._resetSnappingState()}_selectUpdateInput({point:e,scenePoint:i}){switch(this._currentSnappedType){case Mv.MAIN:return e;case Mv.SCENE:return i}}_resetSnappingState(){this._currentMainCandidate=null,this._currentOtherActiveCandidates=[],this._currentSnappedType=Mv.MAIN}_removeVisualization(){this.removeHandles(Q8)}async _snapSinglePoint({point:e,context:i,signal:r}){const{view:n}=this,{elevationInfo:s}=i,o=DI(e,n,s),l=await this._fetchCandidates(o,Wl.ALL,i,r);return this._createSnapResult(o,Mv.MAIN,l,n,i,{z:e.z,m:e.m,spatialReference:e.spatialReference,elevationInfo:s},r)}async _snapMultiPoint({point:e,scenePoint:i,context:r,signal:n}){const{view:s}=this,{coordinateHelper:o,elevationInfo:l,spatialReference:c}=r;await y_(i.spatialReference,c);const f=rl(i,c),_=DI(f,s,l),x=await this._fetchCandidates(_,Wl.FEATURE,r,n);if(x.length>0){const M=await this._fetchCandidates(_,Wl.SELF,r,n);return this._createSnapResult(_,Mv.SCENE,[...x,...M],s,r,{z:f.z,m:f.m,spatialReference:f.spatialReference,elevationInfo:l},n)}const T=DI(e,s,l),A=await this._fetchCandidates(T,Wl.SELF,r,n);return this._createSnapResult(T,Mv.MAIN,A,s,r,{z:o.hasZ()&&e.hasZ?e.z??0:void 0,m:o.hasM()&&e.hasM?e.m??0:void 0,spatialReference:e.spatialReference,elevationInfo:l},n)}async _fetchCandidates(e,i,r,n){return(await Promise.all(this._engines.map(s=>s.fetchCandidates(e,i,r,n)))).flat()}_createSnapResult(e,i,r,n,s,o,l){return{get valid(){return!xo(l)},apply:()=>{const{spatialReference:c}=s,{snappedPoint:f,hints:_}=this._processCandidates(e,i,r,s);return this._removeVisualization(),s.visualizer!=null&&this.addHandles(s.visualizer.draw(_,{spatialReference:c,elevationInfo:ma,view:n,selfSnappingZ:s.selfSnappingZ}),Q8),Pxe(f,n,o)}}}_processCandidates(e,i,r,n){if(r.length<1)return this.doneSnapping(),{snappedPoint:e,hints:[]};this._currentSnappedType!==i&&this._resetSnappingState(),Iue(e,r);const s=this._currentMainCandidate;if(s!=null){const o=this._findOldConstraintInNewCandidates(s,r);if(o>=0){if(!(r[o]instanceof K8))return this._intersectWithOtherCandidates(o,r,e,i,n);if(this._arePointsWithinScreenThreshold(e,s.targetPoint,n))return this._updateSnappingCandidate(s,i,r,n)}}return this._intersectWithOtherCandidates(0,r,e,i,n)}_findOldConstraintInNewCandidates(e,i){return e instanceof K8?this._findOldCandidateIndex(i,e.first)>=0&&this._findOldCandidateIndex(i,e.second)>=0?0:-1:this._findOldCandidateIndex(i,e)}_intersectWithOtherCandidates(e,i,r,n,s){const{coordinateHelper:o}=s,l=i[e],c=[];for(let f=0;f0&&(c.sort((f,_)=>f[1]-_[1]),c[0][1]0}canRedo(){return this.history.redo.length>0}complete(){this._reset(),this.onEnd(),this.emit("complete")}cancel(){this.cancelled=!0,this.complete()}_reset(){var e;(e=this.activeComponent)==null||e.reset()}refreshComponent(){const e=this.activeComponent;e&&(e.type!=="box"&&e.type!=="reshape"&&e.type!=="graphic-mover"||e.refresh())}set undo(e){this._set("undo",()=>{this.canUndo()&&e()})}set redo(e){this._set("redo",()=>{this.canRedo()&&e()})}};y([w()],dc.prototype,"activeComponent",void 0),y([w()],dc.prototype,"cancelled",void 0),y([w()],dc.prototype,"history",void 0),y([w()],dc.prototype,"tool",null),y([w()],dc.prototype,"type",void 0),y([w()],dc.prototype,"canUndo",null),y([w()],dc.prototype,"canRedo",null),y([w()],dc.prototype,"onEnd",void 0),y([w()],dc.prototype,"undo",null),y([w()],dc.prototype,"redo",null),y([w()],dc.prototype,"toggleTool",void 0),y([w()],dc.prototype,"addToSelection",void 0),y([w()],dc.prototype,"removeFromSelection",void 0),dc=y([Z("esri.widgets.Sketch.support.OperationHandle")],dc);let Nk=class extends dc{};y([w()],Nk.prototype,"activeComponent",void 0),Nk=y([Z("esri.widgets.Sketch.support.CreateOperationHandle")],Nk);let $v=class extends dc{};y([w()],$v.prototype,"activeComponent",void 0),$v=y([Z("esri.widgets.Sketch.support.UpdateOperationHandle")],$v);const Rxe={defaultZ:0},VR={reshapeOptions:{edgeOperation:"split",shapeOperation:"move",vertexOperation:"move"},enableMoveAllGraphics:!0,enableRotation:!0,enableScaling:!0,multipleSelectionEnabled:!0,preserveAspectRatio:!1,toggleToolOnClick:!0,enableZ:!0,highlightOptions:{enabled:!0},tool:"transform"};let Us=class extends Dn.EventedAccessor{constructor(e){super(e),this._numUpdating=0,this._internalGraphicsLayer=new jse({listMode:"hide",internal:!0,title:"SVM Internal"}),this._operationHandle=null,this._viewHandlesKey="viewHandles",this.activeFillSymbol=null,this.activeLineSymbol=null,this.activeVertexSymbol=null,this.allowDeleteKey=!0,this.labelOptions=new XVe,this.layer=null,this.pointSymbol=new cu({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this.polygonSymbol=new Bm({color:[150,150,150,.2],outline:{color:[50,50,50],width:2}}),this.polylineSymbol=new Oc({color:[130,130,130,1],width:2}),this.meshSymbol=new F9({symbolLayers:new it([new uP])}),this._snappingManager=null,this.tooltipOptions=new ZVe,this.updateGraphics=new it,this.updateOnGraphicClick=!0,this.vertexSymbol=new cu({style:"circle",size:6,color:[255,255,255],outline:{color:[50,50,50],width:1}}),this._moduleLoaderAbortController=null,this._viewReadyAbortController=null,this._originalPopupEnabled=null,this.defaultCreateOptions=Rxe,this.defaultUpdateOptions=VR,this.snappingOptions=new Lue}initialize(){this.addHandles([Jr(()=>{var e,i;return(i=(e=this.view)==null?void 0:e.map)==null?void 0:i.layers},"change",e=>{e.removed.includes(this.layer)&&this.cancel()}),Jr(()=>{var e;return(e=this.layer)==null?void 0:e.graphics},"change",e=>{if(this._operationHandle!=null)for(const i of e.removed)this.updateGraphics.includes(i)&&(this.updateGraphics.length>1?this._operationHandle.removeFromSelection(i):this._operationHandle.cancel())}),_e(()=>{var e;return((e=this.layer)==null?void 0:e.elevationInfo)??null},e=>{e!==this._internalGraphicsLayer.elevationInfo&&(this.cancel(),this._internalGraphicsLayer.elevationInfo=e)},kt),_e(()=>this.view,e=>{et(this._snappingManager),e&&(this._snappingManager=new X0({view:e,options:this.snappingOptions}),e.type==="2d"?we(()=>import("./editingTools-1yHclJT1.js"),__vite__mapDeps([267,2,3,4,268,7,8,5,9,10,11,6,215,269,221,217,270,214,12,13])):e.type==="3d"&&(we(()=>import("./editingTools-eh7FxppI.js"),__vite__mapDeps([271,217,219,269,221,215,17,18,19,20,21,22,23,24,25,3,4,272,223,27,268,7,8,5,9,10,11,6,270,214,227,26,12,13,273,229,170,216,222,274])),we(()=>import("./GraphicsLayerView3D-TqJxY2EU.js"),__vite__mapDeps([187,161,179,188,180,95,90,91,169,163]))))},kt),_e(()=>{var e;return(e=this.view)==null?void 0:e.spatialReference},(e,i)=>{e&&i&&!e.equals(i)&&this.cancel()})]),gjt(this)}destroy(){this.cancel(),this._removeDefaultLayer(),this._snappingManager=et(this._snappingManager),this._set("view",null),this.emit("destroy")}get _defaultUpdateTool(){var e;return((e=this.view)==null?void 0:e.type)==="3d"?"move":"transform"}get updating(){return this._numUpdating>0||this._snappingManager!=null&&this._snappingManager.updating}get activeTool(){var e;return((e=this._operationHandle)==null?void 0:e.tool)??null}get activeComponent(){var e;return((e=this._operationHandle)==null?void 0:e.activeComponent)??null}get createGraphic(){return this.activeComponent==null||this.activeComponent.type!=="draw-3d"&&this.activeComponent.type!=="draw-2d"?this._get("createGraphic"):this.activeComponent.graphic}get defaultCreateOptions(){return this._get("defaultCreateOptions")}set defaultCreateOptions(e){this._set("defaultCreateOptions",{...Rxe,...e})}get defaultUpdateOptions(){return this._get("defaultUpdateOptions")}set defaultUpdateOptions(e){this._set("defaultUpdateOptions",{...VR,...e,reshapeOptions:{...VR.reshapeOptions,...e==null?void 0:e.reshapeOptions},highlightOptions:{...VR.highlightOptions,...e==null?void 0:e.highlightOptions}})}set snappingOptions(e){this._snappingManager!=null&&(this._snappingManager.options=e),this._set("snappingOptions",e)}get state(){var r;const e=!(!((r=this.view)!=null&&r.ready)||!this.layer),i=this._operationHandle;return e&&i?"active":e?"ready":"disabled"}get view(){return this._get("view")}set view(e){const i=this._get("view");if(i){const{container:n,map:s}=i;n&&(i.cursor=null),s==null||s.remove(this._internalGraphicsLayer),this.removeHandles(this._viewHandlesKey),this.cancel()}const r="view-ready";this.removeHandles(r),e&&this.addHandles(Mo(()=>e.ready,n=>{this.removeHandles(this._viewHandlesKey),n&&this.addHandles(this._generateViewHandles(e),this._viewHandlesKey)},kt),r),this._set("view",e)}cancel(){this._moduleLoaderAbortController=gn(this._moduleLoaderAbortController),this._viewReadyAbortController=gn(this._viewReadyAbortController),this._operationHandle&&this._operationHandle.cancel()}complete(){this._operationHandle&&this._operationHandle.complete()}delete(){const{state:e,updateGraphics:i}=this;if(e==="active"&&i.length){const{activeTool:r,layer:n}=this,s=i.toArray();n.removeMany(s),this.cancel(),this._emitDeleteEvent({graphics:s,tool:r})}}duplicate(){if(this.state==="active"&&this.updateGraphics.length){const e=this.updateGraphics.map(i=>i.clone()).toArray();return this.layer.addMany(e),this.emit("duplicate",{graphics:e,type:"duplicate"}),e}return[]}async create(e,i){this.cancel(),await this._waitViewReady();const{view:r,layer:n}=this;if(!r||this.state==="disabled")throw n||this._logMissingLayer(),ur();if(r.activeTool!=null&&(r.activeTool=null),!e)return void this._logError("sketch:missing-parameter","Missing parameter 'tool'.");wxe(r,this._internalGraphicsLayer);const s=await this._setupCreateOperation(e,i);if(s==null||this.destroyed)return void r.map.remove(this._internalGraphicsLayer);const o=()=>{var l;if(s===this._operationHandle){const c=this.createGraphic,f=this._operationHandle.cancelled;this._operationHandle.destroy(),this._operationHandle=null,this._set("createGraphic",null),(l=this.view)!=null&&l.map&&this.view.map.remove(this._internalGraphicsLayer),s.cancelled||c==null||n.add(c),this.emit("create",{graphic:c,state:f?"cancel":"complete",tool:e,toolEventInfo:null,type:"create"})}};s.on("complete",o),this._operationHandle=s,r.ready&&r.focus()}async update(e,i){this.cancel(),await this._waitViewReady();const{layer:r,view:n,state:s}=this;if(!n||s==="disabled")throw r||this._logMissingLayer(),ur();n.activeTool!=null&&(n.activeTool=null);const o=Array.isArray(e)?e:[e];if(e==null||!(o!=null&&o.length))return void this._logError("sketch:missing-parameter","Missing parameter 'graphics'.");if(o.some(c=>c.layer!==r?(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics missing from the supplied GraphicsLayer."),!0):c.geometry==null&&(this._logError("sketch:invalid-parameter","Parameter 'graphics' contains one or more graphics with an unsupported geometry."),!0)))return;const l=await this._setupUpdateOperation(o,i);this.destroyed||l==null||Pa(l)||(wxe(n,this._internalGraphicsLayer),this._setUpdateOperationHandle(l,i),this.emit("update",{graphics:o,state:"start",aborted:!1,tool:l.tool,toolEventInfo:null,type:"update"}))}async _updateSpatialReference(e){const i=this.view;if(i){this._beginAsyncOperation(),e=Array.isArray(e)?e:[e];for(const r of e)r.geometry==null||r.geometry.type==="mesh"||Zn(r.geometry.spatialReference,i.spatialReference)||(th(r.geometry.spatialReference,i.spatialReference)||ox()||await g_(),r.geometry=rl(r.geometry,i.spatialReference));this._endAsyncOperation()}else this._logMissingView()}undo(){var e;this.canUndo()&&((e=this._operationHandle)==null||e.undo())}redo(){var e;this.canRedo()&&((e=this._operationHandle)==null||e.redo())}canUndo(){return!(!this._operationHandle||!this._operationHandle.canUndo())}canRedo(){return!(!this._operationHandle||!this._operationHandle.canRedo())}toggleUpdateTool(){this._operationHandle&&this._operationHandle.toggleTool&&this._operationHandle.toggleTool()}async _getFirstHit(e){const i=this.view;if(!i)return this._logMissingView(),null;if(i.type==="2d"){const s=[];i.map.allLayers.forEach(l=>{l.type!=="vector-tile"&&l.type!=="imagery"||s.push(l)});const o=await i.hitTest(e,{exclude:s});return L8t(o.results)}const r=[i.map.ground];i.map.allLayers.forEach(s=>{s.type==="integrated-mesh"&&r.push(s)});const n=await i.hitTest(e,{exclude:r});if(n.results.length>0){const s=n.results[0];if(s!=null&&s.type==="graphic"&&s.graphic&&(!n.ground.mapPoint||i.map.ground.opacity<1||n.ground.distance-(s.distance??0)>-Math.min(3*n.ground.distance,i.viewingMode==="global"?Sr(i.renderCoordsHelper.spatialReference).radius/i.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY)))return s}return null}_generateViewHandles(e){return[e.on("immediate-click",async i=>{var o;const r=this.state==="active"&&((o=this._operationHandle)==null?void 0:o.type)==="create";if(this.state==="disabled"||r||!this.updateOnGraphicClick)return;this._beginAsyncOperation();const n=await i.async(()=>this._getFirstHit(sf(i)));let s=null;if(n!=null){const l=n.graphic;this.updateGraphics.includes(l)||l.layer===this.layer?(i.stopPropagation(),s=l):e.type!=="2d"||this._isComponentGraphic(l)||this.state!=="active"||this.cancel()}else this.state==="active"&&this.cancel();s==null||this.updateGraphics.includes(s)||await this.update([s],{...this.defaultUpdateOptions,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions}}),this._endAsyncOperation()},Es.WIDGET)]}async _setupCreateOperation(e,i){const r=this.view;if(!r)return this._logMissingView(),null;const n={hasZ:r.type==="3d",...this.defaultCreateOptions,...i},s=await this._setupDrawGraphicTool(e,r,n);return s==null?null:(r.tools.add(s),r.activeTool=s,this._setupCreateOperationHandle(s))}async _setupDrawGraphicTool(e,i,r){if(e==="multipoint"&&i.type==="3d")return this._logError("sketch:create","Multipoint geometries are not supported in SceneView."),null;if(!i)return this._logMissingView(),null;const n=e!=="rectangle",s=e!=="rectangle",o={view:i,mode:e==="rectangle"||e==="circle"?"hybrid":"click",...r,snapToScene:!1,geometryType:e,graphicSymbol:this._getGraphicSymbolFromTool(e),snappingManager:this._snappingManager,forceUniformSize:s,centered:n};return i.type==="2d"?this._makeDrawGraphicTool2D(o):this._makeDrawGraphicTool3D(o)}async _makeDrawGraphicTool2D(e){const i=await this._requireModule(we(()=>import("./editingTools-1yHclJT1.js"),__vite__mapDeps([267,2,3,4,268,7,8,5,9,10,11,6,215,269,221,217,270,214,12,13])));return Pa(i)||this.destroyed?null:new i.module.DrawGraphicTool2D({...e,activeVertexSymbol:this.activeVertexSymbol,regularVerticesSymbol:this.vertexSymbol,activeLineSymbol:this.activeLineSymbol,activeFillSymbol:Vjt(e.geometryType)?this.activeFillSymbol:null,tooltipOptions:this.tooltipOptions})}async _makeDrawGraphicTool3D(e){const i=await this._requireModule(we(()=>import("./editingTools-eh7FxppI.js"),__vite__mapDeps([271,217,219,269,221,215,17,18,19,20,21,22,23,24,25,3,4,272,223,27,268,7,8,5,9,10,11,6,270,214,227,26,12,13,273,229,170,216,222,274])));if(Pa(i)||this.destroyed)return null;const{elevationInfo:r}=this.layer;return new i.module.DrawGraphicTool3D({...e,elevationInfo:r,snapToScene:r==null||r.mode==="absolute-height",labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions})}_setupCreateOperationHandle(e){const i=this.view;if(!i)return this._logMissingView(),null;let r=null;const n=e.forceUniformSize,s=e.centered,o=[i.on("key-down",c=>{if(c.key===Oa.pan)c.stopPropagation(),c.repeat||(e.enabled=!1);else if(c.key===Oa.complete)c.stopPropagation(),e.completeCreateOperation();else if(c.key!==Oa.vertexAdd||c.repeat)c.key===Oa.undo?(c.stopPropagation(),l.undo()):c.key===Oa.redo?(c.stopPropagation(),l.redo()):c.key!==Oa.constraint||e.geometryType!=="rectangle"&&e.geometryType!=="circle"||c.repeat?c.key===Oa.center&&(c.repeat||(e.centered=!s,c.stopPropagation())):(e.forceUniformSize=!n,c.stopPropagation());else{const f=e.drawOperation.geometryType;f!=="polyline"&&f!=="polygon"&&f!=="multipoint"||(c.stopPropagation(),e.drawOperation.commitStagedVertex())}},Es.WIDGET),i.on("key-up",c=>{c.key===Oa.pan?e.enabled=!0:c.key!==Oa.constraint||e.geometryType!=="rectangle"&&e.geometryType!=="circle"?c.key===Oa.center&&(e.centered=s,c.stopPropagation()):(e.forceUniformSize=n,c.stopPropagation())},Es.WIDGET),e.on("vertex-add",c=>{switch(r=r==null?"start":"active",c.operation){case"apply":this.emit("create",{graphic:e.graphic,state:r,tool:this.activeTool,toolEventInfo:c,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("cursor-update",c=>{e.drawOperation.numCommittedVertices>0&&this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:{coordinates:c.vertices[0].coordinates,type:"cursor-update"},type:"create"})}),e.on("vertex-remove",c=>{switch(c.operation){case"apply":this.emit("create",{graphic:e.graphic,state:"active",tool:this.activeTool,toolEventInfo:c,type:"create"});break;case"undo":this._emitUndoEvent({graphics:[e.graphic],tool:e.geometryType});break;case"redo":this._emitRedoEvent({graphics:[e.graphic],tool:e.geometryType})}}),e.on("complete",c=>{this._set("createGraphic",c.graphic),r="complete",c.aborted?l&&l.cancel():l&&l.complete()}),_e(()=>this._getGraphicSymbolFromTool(e.geometryType),c=>{e.graphicSymbol=c})],l=new Nk({activeComponent:e,tool:e.geometryType,type:"create",onEnd:()=>{var c;o.forEach(f=>f.remove()),o.length=0,(c=i.tools)==null||c.remove(e)},undo:()=>{e.canUndo&&e.undo()},redo:()=>{e.canRedo&&e.redo()},canUndo:()=>e.canUndo,canRedo:()=>e.canRedo});return l}_getGraphicSymbolFromTool(e){switch(e){case"point":case"multipoint":return this.pointSymbol;case"polyline":return this.polylineSymbol;case"circle":case"rectangle":case"polygon":return this.polygonSymbol;case"mesh":return this.meshSymbol}}async _setupUpdateOperation(e,i){var l;const{layer:r,view:n}=this;if(!n)return this._logMissingView(),null;const s={tool:this._defaultUpdateTool,...this.defaultUpdateOptions,...i,reshapeOptions:{...this.defaultUpdateOptions.reshapeOptions,...i==null?void 0:i.reshapeOptions},highlightOptions:{...this.defaultUpdateOptions.highlightOptions,...i==null?void 0:i.highlightOptions}};let o=s.tool;for(const c of e)r.remove(c),r.add(c);if(n.type==="3d"){if(e.length===0)return null;switch(o){case"move":return this._setupMove3DOperation(e,s,n,o);case"reshape":{if(e.length>1)return this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null;const c=X8(e[0]);return c===Xn.SUPPORTED?this._setupReshape3DOperation(e[0],s,n):(this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${SX(c)}).`),null)}case"transform":return this._setupGraphicTransform3DOperation(e,s,n)}}switch(o){case"move":return this._setupMove2DOperation(e,s,n);case"reshape":{if(e.length>1)return this._logError("sketch:reshape-multiple","Reshape operation does not support multiple graphics."),null;const c=X8(e[0]);return c===Xn.SUPPORTED?this._setupTransformOrReshape2DOperation(e,o,s,n):(this._logError("sketch:reshape",`Reshape operation not supported for provided graphic(s) (${SX(c)}).`),null)}case"transform":if(e.length===1){const c=(l=e[0].geometry)==null?void 0:l.type;c!=="point"&&c!=="multipoint"||(o="reshape")}return this._setupTransformOrReshape2DOperation(e,o,s,n)}}async _setupMove3DOperation(e,i,r,n,s=!1){for(const _ of e){const x=MBt(_);if(x!==Xn.SUPPORTED)return this._logError("sketch:move",`Move operation not supported for provided graphic(s) (${SX(x)}).`),null}const o=await this._requireModule(we(()=>import("./editingTools-eh7FxppI.js"),__vite__mapDeps([271,217,219,269,221,215,17,18,19,20,21,22,23,24,25,3,4,272,223,27,268,7,8,5,9,10,11,6,270,214,227,26,12,13,273,229,170,216,222,274])));if(Pa(o))return o;const l=new o.module.GraphicMoveTool({view:r,enableZ:i.enableZ,snappingManager:this._snappingManager,tooltipOptions:this.tooltipOptions});r.tools.add(l),l.graphics.addMany(e),s||this.updateGraphics.addMany(e);const c=[],f=new $v({activeComponent:l,tool:n,type:"update",onEnd:()=>{var _;c.forEach(x=>x.remove()),c.length=0,(_=r.tools)==null||_.remove(l),l.destroyed||l.destroy()},undo:()=>{e7(f,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:n})},redo:()=>{t7(f,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:n})},addToSelection:_=>{this.updateGraphics.push(_),l.graphics.push(_),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[_],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:_=>{const x=this.updateGraphics.indexOf(_);f.history.undo.forEach(T=>T.updates.splice(x,1)),f.history.redo.forEach(T=>T.updates.splice(x,1)),this.updateGraphics.remove(_),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[_],type:"selection-change"},type:"update"}),this.updateGraphics.length!==0?l.graphics.remove(_):f.complete()},toggleTool:async()=>{if(this.updateGraphics.length!==1||i.toggleToolOnClick===!1||n!=="transform")return;const _=this.updateGraphics.at(0);if(X8(_)!==Xn.SUPPORTED)return;f.onEnd(),f.destroy();const x=await this._setupReshape3DOperation(_,i,r,!0);Pa(x)||this._setUpdateOperationHandle(x,i)}});return c.push(...this._getHandlesForComponent(f,i),r.on("immediate-click",_=>this._getCommonUpdateOperationClickHandlers(f,_,i),Es.WIDGET),r.on("key-down",_=>{this._getCommonUpdateOperationKeyDownHandlers(f,_)},Es.WIDGET)),f}_setupGraphicTransform3DOperation(e,i,r,n=!1){if(e.length===1&&LBt(e[0])===Xn.SUPPORTED){const s=e[0],o=s.geometry;if(o!=null&&(o.type==="point"||o.type==="mesh"))return this._setupPointTransform3DOperation(s,i,r);if(o!=null&&(o.type==="polygon"||o.type==="polyline"))return this._setupPolyTransform3DOperation(s,i,r,n)}return this._setupMove3DOperation(e,i,r,"transform",n)}async _setupPointTransform3DOperation(e,i,r){const n="transform",{enableRotation:s,enableScaling:o,enableZ:l}=i,c=await this._requireModule(we(()=>import("./editingTools-eh7FxppI.js"),__vite__mapDeps([271,217,219,269,221,215,17,18,19,20,21,22,23,24,25,3,4,272,223,27,268,7,8,5,9,10,11,6,270,214,227,26,12,13,273,229,170,216,222,274])));if(Pa(c))return c;const f=new c.module.GraphicTransformTool({graphic:e,view:r,enableRotation:s,enableScaling:o,enableZ:l,snappingManager:this._snappingManager,tooltipOptions:this.tooltipOptions});r.tools.add(f),this.updateGraphics.add(e);const _=[],x=new $v({activeComponent:f,tool:n,type:"update",onEnd:()=>{var T;_.forEach(A=>A.remove()),_.length=0,(T=r.tools)==null||T.remove(f),f.destroyed||f.destroy()},undo:()=>{e7(x,this.updateGraphics.toArray()),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:n})},redo:()=>{t7(x,this.updateGraphics.toArray()),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:n})},addToSelection:async T=>{this.updateGraphics.add(T),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[T],removed:[],type:"selection-change"},type:"update"}),x.onEnd(),x.destroy();const A=await this._setupMove3DOperation(this.updateGraphics.toArray(),i,r,"transform",!0);Pa(A)||this._setUpdateOperationHandle(A,i)},removeFromSelection:T=>{this.updateGraphics.remove(T),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[T],type:"selection-change"},type:"update"}),x.complete()},toggleTool:()=>{}});return _.push(...this._getHandlesForComponent(x,i),r.on("immediate-click",T=>this._getCommonUpdateOperationClickHandlers(x,T,i),Es.WIDGET),r.on("key-down",T=>{this._getCommonUpdateOperationKeyDownHandlers(x,T)},Es.WIDGET)),x}async _setupPolyTransform3DOperation(e,i,r,n=!1){const s="transform",{enableRotation:o,enableScaling:l,enableZ:c,preserveAspectRatio:f}=i,_=await this._requireModule(we(()=>import("./editingTools-eh7FxppI.js"),__vite__mapDeps([271,217,219,269,221,215,17,18,19,20,21,22,23,24,25,3,4,272,223,27,268,7,8,5,9,10,11,6,270,214,227,26,12,13,273,229,170,216,222,274])));if(Pa(_))return _;const x=new _.module.ExtentTransformTool({graphic:e,view:r,enableRotation:o,enableScaling:l,enableZ:c,preserveAspectRatio:f,tooltipOptions:this.tooltipOptions});r.tools.add(x),n||this.updateGraphics.add(e);const T=[],A=new $v({activeComponent:x,tool:s,type:"update",onEnd:()=>{var M;T.forEach(I=>I.remove()),T.length=0,(M=r.tools)==null||M.remove(x),x.destroyed||x.destroy()},canUndo:()=>x.canUndo,undo:()=>{x.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s})},canRedo:()=>x.canRedo,redo:()=>{x.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s})},addToSelection:async M=>{this.updateGraphics.add(M),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[M],removed:[],type:"selection-change"},type:"update"}),A.onEnd(),A.destroy();const I=await this._setupMove3DOperation(this.updateGraphics.toArray(),i,r,"transform",!0);Pa(I)||this._setUpdateOperationHandle(I,i)},removeFromSelection:M=>{this.updateGraphics.remove(M),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[M],type:"selection-change"},type:"update"}),A.complete()},toggleTool:async()=>{if(this.updateGraphics.length!==1||i.toggleToolOnClick===!1)return;const M=this.updateGraphics.at(0);if(X8(M)!==Xn.SUPPORTED)return;A.onEnd(),A.destroy();const I=await this._setupReshape3DOperation(M,i,r,!0);Pa(I)||this._setUpdateOperationHandle(I,i)}});return T.push(...this._getHandlesForComponent(A,i),r.on("immediate-click",M=>this._getCommonUpdateOperationClickHandlers(A,M,i),Es.WIDGET),r.on("key-down",M=>this._getCommonUpdateOperationKeyDownHandlers(A,M),Es.WIDGET),r.on("key-down",M=>{M.key!==Oa.constraint||M.repeat||(x.preserveAspectRatio=!x.preserveAspectRatio,M.stopPropagation())},Es.WIDGET),r.on("key-up",M=>{M.key===Oa.constraint&&(x.preserveAspectRatio=!x.preserveAspectRatio,M.stopPropagation())},Es.WIDGET)),A}async _setupMove2DOperation(e,i,r){const n="move";this.updateGraphics.addMany(e),await this._updateSpatialReference(e);const s=await this._getGraphicMover(e,i,r);if(Pa(s))return s;const o=new $v({activeComponent:s,tool:n,type:"update",onEnd:()=>{var _;this._displayDefaultCursor(),f.forEach(x=>x.remove()),c.forEach(x=>x.remove()),f=[],c=[],s.destroy(),(_=this._internalGraphicsLayer)==null||_.removeMany([...this.updateGraphics.toArray()])},undo:()=>{const _=this.updateGraphics.toArray();e7(o,_),o.refreshComponent(),this._emitUndoEvent({graphics:_,tool:n})},redo:()=>{const _=this.updateGraphics.toArray();t7(o,_),o.refreshComponent(),this._emitRedoEvent({graphics:_,tool:n})},addToSelection:async _=>{await this._updateSpatialReference(_),this.updateGraphics.push(_),s.graphics=this.updateGraphics.toArray(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[_],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:_=>{const x=this.updateGraphics.indexOf(_);o.history.undo.forEach(A=>A.updates.splice(x,1)),o.history.redo.forEach(A=>A.updates.splice(x,1)),this.updateGraphics.remove(_);const T=this.updateGraphics.toArray();this.emit("update",{graphics:T,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[_],type:"selection-change"},type:"update"}),this.updateGraphics.length!==0?s.graphics=T:o.complete()}});let l=!1,c=[r.on("immediate-click",_=>this._getCommonUpdateOperationClickHandlers(o,_,i),Es.WIDGET),r.on("key-down",_=>{this._getCommonUpdateOperationKeyDownHandlers(o,_),_.key!==Oa.constraint||_.repeat||(l=!0,s.enableMoveAllGraphics=!s.enableMoveAllGraphics)},Es.WIDGET),r.on("key-up",_=>{_.key===Oa.constraint&&l&&(l=!1,s.enableMoveAllGraphics=!s.enableMoveAllGraphics)},Es.WIDGET)],f=this._getHandlesForComponent(o,i);return o}async _setupReshape3DOperation(e,i,r,n=!1){const s="reshape",o=await this._requireModule(we(()=>import("./editingTools-eh7FxppI.js"),__vite__mapDeps([271,217,219,269,221,215,17,18,19,20,21,22,23,24,25,3,4,272,223,27,268,7,8,5,9,10,11,6,270,214,227,26,12,13,273,229,170,216,222,274])));if(Pa(o))return o;const l=i.reshapeOptions,c=new o.module.GraphicReshapeTool({view:r,graphic:e,enableZVertex:i.enableZ&&(l==null?void 0:l.vertexOperation)==="move",enableZShape:i.enableZ&&(l==null?void 0:l.shapeOperation)==="move",enableMoveGraphic:(l==null?void 0:l.shapeOperation)==="move"||(l==null?void 0:l.shapeOperation)==="move-xy",enableMidpoints:(l==null?void 0:l.edgeOperation)==="split",enableEdgeOffset:(l==null?void 0:l.edgeOperation)==="offset",snappingManager:this._snappingManager,labelOptions:this.labelOptions,tooltipOptions:this.tooltipOptions});r.tools.add(c),n||this.updateGraphics.add(e);const f=[],_=new $v({activeComponent:c,tool:s,type:"update",onEnd:()=>{var x;f.forEach(T=>T.remove()),f.length=0,(x=r.tools)==null||x.remove(c),c.destroyed||c.destroy()},canUndo:()=>c.canUndo,undo:()=>{c.undo(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:s})},canRedo:()=>c.canRedo,redo:()=>{c.redo(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:s})},addToSelection:async x=>{this.updateGraphics.add(x),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[x],removed:[],type:"selection-change"},type:"update"}),_.onEnd(),_.destroy();const T=await this._setupMove3DOperation(this.updateGraphics.toArray(),i,r,"transform",!0);Pa(T)||this._setUpdateOperationHandle(T,i)},removeFromSelection:x=>{this.updateGraphics.remove(x),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[x],type:"selection-change"},type:"update"}),_.complete()},toggleTool:async()=>{if(i.toggleToolOnClick===!1)return;_.onEnd(),_.destroy();const x=await this._setupGraphicTransform3DOperation(this.updateGraphics.toArray(),i,r,!0);Pa(x)||this._setUpdateOperationHandle(x,i)}});return f.push(...this._getHandlesForComponent(_,i),r.on("immediate-click",x=>this._getCommonUpdateOperationClickHandlers(_,x,i),Es.WIDGET),r.on("key-down",x=>{this._getCommonUpdateOperationKeyDownHandlers(_,x)},Es.WIDGET)),_}async _setupTransformOrReshape2DOperation(e,i,r,n){this.updateGraphics.addMany(e),await this._updateSpatialReference(e);const s=i==="transform"?await this._getBox(e,r,n):await this._getReshape(e,r,n);if(Pa(s))return s;const o=new $v({activeComponent:s,type:"update",onEnd:()=>{c.forEach(f=>f.remove()),l.forEach(f=>f.remove()),c=[],l=[],o.activeComponent&&!o.activeComponent.destroyed&&o.activeComponent.destroy(),this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray())},undo:()=>{e7(o,this.updateGraphics.toArray()),o.refreshComponent(),this._emitUndoEvent({graphics:this.updateGraphics.toArray(),tool:o.tool})},redo:()=>{t7(o,this.updateGraphics.toArray()),o.refreshComponent(),this._emitRedoEvent({graphics:this.updateGraphics.toArray(),tool:o.tool})},addToSelection:async f=>{let _=o.activeComponent;if((_==null?void 0:_.type)==="reshape"){const x=[...this.updateGraphics,f];this.updateGraphics.removeAll(),o.onEnd(),o.destroy();const T=await this._setupMove2DOperation(x,r,n);if(Pa(T))return;this._setUpdateOperationHandle(T,r)}else this.updateGraphics.add(f),_.graphics=this.updateGraphics.toArray(),_.refresh(),o.resetHistory();this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[f],removed:[],type:"selection-change"},type:"update"})},removeFromSelection:async f=>{const _=this.updateGraphics.indexOf(f);o.history.undo.forEach(T=>T.updates.splice(_,1)),o.history.redo.forEach(T=>T.updates.splice(_,1)),this.updateGraphics.remove(f);const x=this.updateGraphics.toArray();if(x.length===0)o.complete();else{const T=x[0].geometry;x.length!==1||T==null||T.type!=="point"&&T.type!=="multipoint"?o.activeComponent.graphics=x:o.toggleTool()}this.emit("update",{graphics:x,state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:[],removed:[f],type:"selection-change"},type:"update"})},toggleTool:async()=>{var T;if(this.updateGraphics.length>1)return;const f=this.updateGraphics.at(0),_=f.geometry;if(_!=null&&(o.tool==="reshape"&&(_.type==="point"||_.type==="multipoint")||o.tool==="transform"&&_.type==="extent"))return;let x=null;o.tool==="transform"?x=await this._getReshape([f],r,n):o.tool==="reshape"&&(x=await this._getBox([f],r,n)),Pa(x)||((T=o.activeComponent)==null||T.destroy(),o.activeComponent=x,o.activeComponent&&(c.forEach(A=>A.remove()),c=this._getHandlesForComponent(o,r)))}});let l=[n.on("immediate-click",f=>this._getCommonUpdateOperationClickHandlers(o,f,r),Es.WIDGET),n.on("key-down",f=>{if(this._getCommonUpdateOperationKeyDownHandlers(o,f),f.key===Oa.constraint&&!f.repeat&&o){const _=o.activeComponent;_&&_.type==="box"&&(_.preserveAspectRatio=!_.preserveAspectRatio)}},Es.WIDGET),n.on("key-up",f=>{if(f.key===Oa.constraint&&o){const _=o.activeComponent;_&&_.type==="box"&&(_.preserveAspectRatio=!_.preserveAspectRatio)}},Es.WIDGET)],c=this._getHandlesForComponent(o,r);return o}async _getGraphicMover(e,i,r){const{enableMoveAllGraphics:n,highlightOptions:s}=i,o=await this._requireModule(we(()=>import("./GraphicMover-DhG5Ib7v.js").then(l=>l.G),__vite__mapDeps([275,10,157,12,13])));return Pa(o)?o:new o.module.default({enableMoveAllGraphics:n,highlightsEnabled:!!(s!=null&&s.enabled),indicatorsEnabled:!1,graphics:e,view:r,callbacks:{onGraphicMoveStart:({dx:l,dy:c,graphic:f})=>{this._displayGrabbingCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:l,dy:c,mover:f,type:"move-start"},type:"update"})},onGraphicMove:({dx:l,dy:c,graphic:f})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:l,dy:c,mover:f,type:"move"},type:"update"}),onGraphicMoveStop:({dx:l,dy:c,graphic:f})=>{this._displayPointerCursor(),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:l,dy:c,mover:f,type:"move-stop"},type:"update"})},onGraphicPointerOver:()=>this._displayPointerCursor(),onGraphicPointerOut:()=>this._displayDefaultCursor()}})}async _getBox(e,i,r){const{enableRotation:n,enableScaling:s,highlightOptions:o,preserveAspectRatio:l}=i,c=await this._requireModule(we(()=>import("./Box-gJ8-sOXE.js"),__vite__mapDeps([276,10,275,157,12,13,277,274,269,221,215,217,273])));return Pa(c)?c:new c.module.default({graphics:e,enableRotation:n,enableScaling:s,highlightsEnabled:!!(o!=null&&o.enabled),preserveAspectRatio:l,layer:this._internalGraphicsLayer,view:r,tooltipOptions:this.tooltipOptions,callbacks:{onMoveStart:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onMove:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onMoveStop:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onScaleStart:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onScale:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onScaleStop:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onRotateStart:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onRotate:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"}),onRotateStop:f=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...f},type:"update"})}})}async _getReshape(e,i,r){var c,f,_;const n=((c=i.reshapeOptions)==null?void 0:c.edgeOperation)==="split",s=((f=i.reshapeOptions)==null?void 0:f.shapeOperation)==="move",o=!!((_=i.highlightOptions)!=null&&_.enabled),l=await this._requireModule(we(()=>import("./Reshape-J0NI6bzM.js"),__vite__mapDeps([278,2,3,4,10,275,157,12,13,277,5,269,221,215,217,273,270,214])));return Pa(l)?l:new l.module.default({enableMidpoints:n,enableMovement:s,graphic:e[0],highlightsEnabled:o,layer:this._internalGraphicsLayer,snappingManager:this._snappingManager,tooltipOptions:this.tooltipOptions,view:r,callbacks:{onReshapeStart:x=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...x},type:"update"}),onReshape:x=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{...x},type:"update"}),onReshapeStop:({mover:x,type:T})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:x,type:T},type:"update"}),onMoveStart:({dx:x,dy:T,mover:A,type:M})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:x,dy:T,mover:A,type:M},type:"update"}),onMove:({dx:x,dy:T,mover:A,type:M})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:x,dy:T,mover:A,type:M},type:"update"}),onMoveStop:({dx:x,dy:T,mover:A,type:M})=>this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:x,dy:T,mover:A,type:M},type:"update"}),onVertexAdd:({added:x,type:T,vertices:A})=>{const M=x.map(I=>Zde(I.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{added:M,vertices:A,type:T},type:"update"})},onVertexRemove:({removed:x,type:T,vertices:A})=>{const M=x.map(I=>Zde(I.geometry));this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{removed:M,vertices:A,type:T},type:"update"})}}})}_getHandlesForComponent(e,i){const r=e.activeComponent;if(!r)return[];switch(r.type){case"graphic-mover":return[r.on("graphic-click",({graphic:n,viewEvent:s})=>{var o;(o=s.native)!=null&&o.shiftKey&&(s.stopPropagation(),e.removeFromSelection(n))}),r.on("graphic-move-start",n=>e.addToHistory(N1(n.allGraphics)))];case"box":return[r.on("graphic-click",n=>this._onTransformOrReshape2DGraphicClick(e,i,n)),r.on("move-start",n=>e.addToHistory(N1(n.graphics))),r.on("rotate-start",n=>e.addToHistory(N1(n.graphics))),r.on("scale-start",n=>e.addToHistory(N1(n.graphics)))];case"reshape":return[r.on("graphic-click",n=>this._onTransformOrReshape2DGraphicClick(e,i,n)),r.on("move-start",n=>e.addToHistory(N1([n.mover]))),r.on("reshape-start",n=>e.addToHistory(N1([n.graphic]))),r.on("vertex-add",n=>e.addToHistory(N1([n.oldGraphic]))),r.on("vertex-remove",n=>e.addToHistory(N1([n.oldGraphic])))];case"move-3d":return[r.on("graphic-move-start",n=>{e.addToHistory(N1(n.allGraphics)),this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:n.allGraphics.length>0?n.allGraphics[0]:null,type:"move-start"},type:"update"})}),r.on("graphic-move",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:n.dx,dy:n.dy,mover:n.allGraphics.length>0?n.allGraphics[0]:null,type:"move"},type:"update"})}),r.on("graphic-move-stop",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{dx:0,dy:0,mover:n.allGraphics.length>0?n.allGraphics[0]:null,type:"move-stop"},type:"update"})}),r.on("immediate-click",n=>{n.shiftKey?this._toggleSelection([n.graphic],e,i):e.toggleTool()})];case"transform-3d":return[r.on("record-undo",({record:n})=>{e.addToHistory({updates:[n]})}),r.on("graphic-translate-start",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,dx:n.dxScreen,dy:n.dyScreen,type:"move-start"},type:"update"})}),r.on("graphic-translate-stop",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,dx:n.dxScreen,dy:n.dyScreen,type:"move-stop"},type:"update"})}),r.on("graphic-rotate-start",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,angle:n.angle,type:"rotate-start"},type:"update"})}),r.on("graphic-rotate-stop",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,angle:n.angle,type:"rotate-stop"},type:"update"})}),r.on("graphic-scale-start",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,xScale:n.xScale,yScale:n.yScale,type:"scale-start"},type:"update"})}),r.on("graphic-scale-stop",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,xScale:n.xScale,yScale:n.yScale,type:"scale-stop"},type:"update"})}),r.on("graphic-translate",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,dx:n.dxScreen,dy:n.dyScreen,type:"move"},type:"update"})}),r.on("graphic-rotate",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,angle:n.angle,type:"rotate"},type:"update"})}),r.on("graphic-scale",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:{mover:n.graphic,xScale:n.xScale,yScale:n.yScale,type:"scale"},type:"update"})}),r.on("immediate-click",n=>{n.shiftKey?this._toggleSelection([n.graphic],e,i):e.toggleTool()})];case"reshape-3d":return[r.on("reshape",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:n,type:"update"})}),r.on("move",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:n,type:"update"})}),r.on("vertex-add",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:n,type:"update"})}),r.on("vertex-remove",n=>{this.emit("update",{graphics:this.updateGraphics.toArray(),state:"active",aborted:!1,tool:this.activeTool,toolEventInfo:n,type:"update"})}),r.on("immediate-click",n=>{n.shiftKey?this._toggleSelection([n.graphic],e,i):e.toggleTool()})]}}_onTransformOrReshape2DGraphicClick(e,i,r){var o;const{graphic:n,viewEvent:s}=r;return(o=s.native)!=null&&o.shiftKey&&n.layer===this.layer?(s.stopPropagation(),e.removeFromSelection(n)):i.toggleToolOnClick?(s.stopPropagation(),e.toggleTool()):void 0}_setUpdateOperationHandle(e,i){var s;this._operationHandle=e;const r=(s=this.view)==null?void 0:s.map;this._disablePopup(i);const n=()=>{if(e===this._operationHandle){const o=this.updateGraphics.toArray(),l=this._operationHandle.tool;this._operationHandle.destroy(),this._operationHandle=null,this._internalGraphicsLayer.removeMany(this.updateGraphics.toArray()),this.updateGraphics.removeAll(),r&&r.remove(this._internalGraphicsLayer),this._restorePopup(i),this.emit("update",{graphics:o,state:"complete",aborted:e.cancelled,tool:l,toolEventInfo:null,type:"update"})}};e.on("complete",n)}async _getCommonUpdateOperationClickHandlers(e,i,r){const n=sf(i),s=await i.async(()=>this._getFirstHit(n));if(s==null)return void e.complete();if(i.native.shiftKey&&this._toggleSelection([s.graphic],e,r))return void i.stopPropagation();this.updateGraphics.includes(s.graphic)?i.stopPropagation():e.complete()}_toggleSelection(e,i,r){const n=!!r.multipleSelectionEnabled;return e.some(s=>s!=null&&!(!n||s.layer!==this.layer)&&(this.updateGraphics.includes(s)?i.removeFromSelection(s):i.addToSelection(s),!0))}_getCommonUpdateOperationKeyDownHandlers(e,i){if(!e)return;const r=i.key;r===Oa.undo&&e.canUndo()?(i.stopPropagation(),e.undo()):r===Oa.redo&&e.canRedo()?(i.stopPropagation(),e.redo()):r===Oa.cancel?(i.stopPropagation(),e.cancel()):this.allowDeleteKey&&Oa.delete.includes(r)&&this._onDeleteKey(i)}_onDeleteKey(e){var n;if(!this._operationHandle||this._operationHandle.type!=="update")return;const i=this.activeComponent,r=this.updateGraphics.toArray();i!=null&&i.type!=="reshape-3d"&&(i.type!=="reshape"||r.length===1&&((n=r[0].geometry)==null?void 0:n.type)==="point")&&(e.stopPropagation(),this.delete())}_removeDefaultLayer(){var e,i;this._internalGraphicsLayer&&((i=(e=this.view)==null?void 0:e.map)==null||i.remove(this._internalGraphicsLayer),this._internalGraphicsLayer=et(this._internalGraphicsLayer))}_isComponentGraphic(e){var r;const{activeComponent:i}=this;return!(!e||i==null)&&(((r=e.attributes)==null?void 0:r.esriSketchTool)||i.type==="draw-2d"&&i.graphic===e||(i.type==="box"||i.type==="reshape")&&i.isUIGraphic(e))}_displayPointerCursor(){var e;(e=this.view)!=null&&e.container&&this.view.cursor!=="pointer"&&(this.view.cursor="pointer")}_displayGrabbingCursor(){var e;(e=this.view)!=null&&e.container&&this.view.cursor!=="grabbing"&&(this.view.cursor="grabbing")}_displayDefaultCursor(){var e;(e=this.view)!=null&&e.container&&this.view.cursor!==null&&(this.view.cursor=null)}_logError(e,i,r){Ce.getLogger(this).error(new se(e,i,r))}async _requireModule(e){const i=new AbortController;this._moduleLoaderAbortController=i;const r=await e;return this._moduleLoaderAbortController!==i||i.signal.aborted?{requireError:"aborted"}:{module:r}}_emitUndoEvent(e){this.emit("undo",{...e,type:"undo"})}_emitRedoEvent(e){this.emit("redo",{...e,type:"redo"})}_emitDeleteEvent(e){this.emit("delete",{...e,type:"delete"})}get test(){return{operationHandle:this._operationHandle,snappingManager:this._snappingManager,defaultUpdateOptions:VR}}wait(){return rd(()=>!this.updating)}_beginAsyncOperation(){this._numUpdating+=1,this.notifyChange("updating")}_endAsyncOperation(){this._numUpdating-=1,this.notifyChange("updating")}_disablePopupEnabled(e){var i;return((i=this.view)==null?void 0:i.type)!=="3d"||this.updateOnGraphicClick||((e==null?void 0:e.toggleToolOnClick)??!1)}_disablePopup(e){this._disablePopupEnabled(e)&&this.view&&this._originalPopupEnabled==null&&(this._originalPopupEnabled=this.view.popupEnabled,this.view.popupEnabled=!1)}_restorePopup(e){this._disablePopupEnabled(e)&&this.view&&this._originalPopupEnabled!=null&&(this.view.popupEnabled=this._originalPopupEnabled,this._originalPopupEnabled=null)}async _waitViewReady(){const e=this.view;e?(gn(this._viewReadyAbortController),this._viewReadyAbortController=new AbortController,await oT(rd(()=>e==null?void 0:e.ready),this._viewReadyAbortController.signal)):this._logMissingView()}_logMissingView(){this._logError("sketch:missing-property",Ixe("view"))}_logMissingLayer(){this._logError(Ujt,Ixe("layer"))}};y([w()],Us.prototype,"updating",null),y([w()],Us.prototype,"_operationHandle",void 0),y([w({readOnly:!0})],Us.prototype,"activeTool",null),y([w()],Us.prototype,"activeFillSymbol",void 0),y([w()],Us.prototype,"activeLineSymbol",void 0),y([w()],Us.prototype,"activeVertexSymbol",void 0),y([w()],Us.prototype,"allowDeleteKey",void 0),y([w({readOnly:!0})],Us.prototype,"createGraphic",null),y([w()],Us.prototype,"defaultCreateOptions",null),y([w()],Us.prototype,"defaultUpdateOptions",null),y([w({type:XVe,nonNullable:!0})],Us.prototype,"labelOptions",void 0),y([w()],Us.prototype,"layer",void 0),y([w({types:py})],Us.prototype,"pointSymbol",void 0),y([w({types:py})],Us.prototype,"polygonSymbol",void 0),y([w({types:py})],Us.prototype,"polylineSymbol",void 0),y([w()],Us.prototype,"meshSymbol",void 0),y([w({type:Lue,nonNullable:!0})],Us.prototype,"snappingOptions",null),y([w()],Us.prototype,"_snappingManager",void 0),y([w({readOnly:!0})],Us.prototype,"state",null),y([w({type:ZVe,nonNullable:!0})],Us.prototype,"tooltipOptions",void 0),y([w({readOnly:!0})],Us.prototype,"updateGraphics",void 0),y([w()],Us.prototype,"updateOnGraphicClick",void 0),y([w({types:py})],Us.prototype,"vertexSymbol",void 0),y([w({value:null})],Us.prototype,"view",null),Us=y([Z("esri.widgets.Sketch.SketchViewModel")],Us);const Ujt="sketch:missing-property",Ixe=t=>`Property '${t}' is missing on SketchViewModel.`;function Vjt(t){return t==="polygon"||t==="rectangle"||t==="circle"}function e7(t,e){SBe("undo",t.history.undo,t.history.redo,e)}function t7(t,e){SBe("redo",t.history.redo,t.history.undo,e)}function SBe(t,e,i,r){const n=e.pop();if(!n)return;const s=n.updates,o=[];r.forEach((l,c)=>{const f=s[c];f!=null&&("geometry"in f&&f.geometry!=null&&(o.push({geometry:l.geometry}),l.geometry=f.geometry),"symbol"in f&&f.symbol!=null&&(o.push({symbol:l.symbol}),l.symbol=f.symbol),"undo"in f&&(o.push(f),f[t](l)))}),i.push({updates:o})}function N1(t){return{updates:t.map(e=>({geometry:e.geometry}))}}function Pa(t){return"requireError"in t&&t.requireError==="aborted"}const TBe=Us,Due=[82,82,122,.9],Nue=[255,255,255,.8],Bjt={type:"polygon-3d",symbolLayers:[{type:"extrude",size:10,material:{color:Nue},edges:{type:"solid",size:"3px",color:Due}}]},jjt={type:"line-3d",symbolLayers:[{type:"line",size:"10px",material:{color:Nue}},{type:"line",size:"3px",material:{color:Due}}]},Gjt={type:"point-3d",symbolLayers:[{type:"icon",size:"30px",resource:{primitive:"kite"},outline:{color:Due,size:"3px"},material:{color:Nue}}]},Hjt=(t,e)=>{const i=document.getElementById("startbuttons"),r=document.getElementById("actionbuttons"),n=document.getElementById("edgeoperationbuttons"),s=document.getElementById("extrudeSliderContainer"),o=new NG({container:"extrudeSlider",precision:1,min:0,max:500,steps:1,values:[10],visibleElements:{rangeLabels:!0}}),l=new TBe({layer:e,view:t,pointSymbol:Gjt,polygonSymbol:Bjt,polylineSymbol:jjt,defaultCreateOptions:{hasZ:!0},snappingOptions:{enabled:!0,featureSources:[{layer:e}]},tooltipOptions:{enabled:!0},labelOptions:{enabled:!0},defaultUpdateOptions:{tool:"transform",enableScaling:!0,enableZ:!0}});l.on("create",H=>{H.state==="complete"&&(i.style.display="inline",r.style.display="none",l.update(H.graphic)),H.state==="cancel"&&(i.style.display="inline",r.style.display="none")}),l.on("update",H=>{H.state==="start"&&(i.style.display="none",r.style.display="inline",(H.graphics[0].geometry.type==="polygon"||H.graphics[0].geometry.type==="polyline")&&(n.style.display="inline"),H.graphics[0].geometry.type==="polyline"&&(s.style.display="none")),H.state==="complete"&&(i.style.display="inline",r.style.display="none",n.style.display="none")});const c=Array.prototype.slice.call(document.getElementsByClassName("starttool")),f=document.getElementById("cancel"),_=document.getElementById("done");c.forEach(H=>{H.addEventListener("click",Y=>{l.create(Y.target.getAttribute("data-type")),i.style.display="none",r.style.display="inline"})}),f.addEventListener("click",H=>{l.cancel()}),_.addEventListener("click",H=>{l.updateGraphics.length!==0?l.complete():l.cancel()}),o.on(["thumb-change","thumb-drag"],x);function x(H){const Y=H.value;document.getElementById("extrude").innerHTML=Y;const Q=l.layer.graphics.getItemAt(l.layer.graphics.length-1),ne=Q.symbol.clone();ne.symbolLayers.items[0].size=Y,Q.symbol=ne}let T="split",A="move";const M=document.getElementById("none-edge-button"),I=document.getElementById("split-edge-button"),L=document.getElementById("offset-edge-button");M.onclick=F,I.onclick=F,L.onclick=F;function F(H){T=H.target.value;const Y=document.getElementsByClassName("edge-button");for(const Q of Y)Q.classList.remove("edge-button-selected");this.classList.add("edge-button-selected"),j({reshapeOptions:{edgeOperation:T,shapeOperation:A}})}const z=document.getElementById("none-shape-button"),k=document.getElementById("move-shape-button");z.onclick=U,k.onclick=U;function U(H){A=H.target.value;const Y=document.getElementsByClassName("shape-button");for(const Q of Y)Q.classList.remove("shape-button-selected");this.classList.add("shape-button-selected"),j({reshapeOptions:{edgeOperation:T,shapeOperation:A}})}function j(H){l.defaultUpdateOptions={...l.defaultUpdateOptions,...H},l.activeTool&&(l.activeTool==="transform"||l.activeTool==="move"||l.activeTool==="reshape")&&(H.tool=l.activeTool,l.update(l.updateGraphics.toArray(),H))}},mv="esri-daylight",$X=`${mv}__container`,nA="esri-slider",Bc={base:mv,widgetIcon:si.environmentSettings,datePickerCalendarToggle:"esri-date-picker__calendar-toggle",dayContainer:`${$X} ${mv}__day-container`,dateContainer:`${$X} ${mv}__date-container`,containerDisabled:`${$X}--disabled`,slider:nA,sliderShadowOff:`${nA}--shadow-off`,sliderShadowOn:`${nA}--shadow-on`,sliderAmPmOn:`${nA}--ampm-on`,sliderDateOff:`${nA}--date-off`,sliderDateOn:`${nA}--date-on`,playPauseButton:`${mv}__play-pause-button`,seasonPicker:`${mv}__season-picker`,panelError:`${mv}__panel--error`,sunLightingCheckbox:`${mv}__sun-lighting-checkbox`,shadowsCheckbox:`${mv}__shadows-checkbox`};var wy;(function(t){t[t.NORTHERN=0]="NORTHERN",t[t.SOUTHERN=1]="SOUTHERN"})(wy||(wy={}));const qjt={spring:{dayOfMonth:20,month:2},summer:{dayOfMonth:21,month:5},fall:{dayOfMonth:23,month:8},winter:{dayOfMonth:21,month:11}},Ire=["spring","summer","fall","winter"];function NI(t,e,i){const r=Fue(e,i),{dayOfMonth:n,month:s}=qjt[r],o=new Date(t.getTime());return o.setMonth(s,n),o}function Wjt(t,e){return Fue(Yjt(t),e)}function Yjt(t){const e=t.getTime(),i=NI(t,"spring",wy.NORTHERN).getTime(),r=NI(t,"summer",wy.NORTHERN).getTime(),n=NI(t,"fall",wy.NORTHERN).getTime(),s=NI(t,"winter",wy.NORTHERN).getTime();return e>=i&&e=r&&e=n&&e=x&&c<=T?I=c-x<=12e5?18e5-(c-x)/12e5*16e5:T-c<=12e5/2?3e5-(T-c)/12e5*2*1e5:2e5:c>=A&&c<=M?I=c-A<=12e5/2?3e5-(c-A)/12e5*2*1e5:M-c<=12e5?18e5-(M-c)/12e5*16e5:2e5:(c_)&&(I=18e5),I}let nT=class extends lUe{constructor(){super(...arguments),this.utcOffset=null,this.timezonePickerOpen=!1}};y([w()],nT.prototype,"utcOffset",void 0),y([w()],nT.prototype,"timezonePickerOpen",void 0),nT=y([Z("esri.widgets.Daylight.support.SliderWithDropdownViewModel")],nT);let FI=class extends ze{constructor(){super(...arguments),this.state="ready",this.value=new Date}};y([w()],FI.prototype,"state",void 0),y([w()],FI.prototype,"value",void 0),FI=y([Z("esri.widgets.support.DateTimeElementViewModel")],FI);const Qjt=FI;let $re=class extends Qjt{constructor(e){super(e)}};$re=y([Z("esri.widgets.support.DatePickerViewModel")],$re);const HG=$re,eGt={hour:"2-digit",minute:"2-digit",timeZone:"UTC"},tGt={hour:"numeric",timeZone:"UTC"};function Lre(t,e){let i;if(e==="tick"){const n=Math.round(Gs(t,"minutes","hours"));i=new Date(Gs(n,"hours","milliseconds"))}else i=new Date(6e4*t);let r=js(i,eGt);return t!==0&&r==="00:00"&&(r="24:00"),e==="tick"&&r.includes(" ")&&(r=js(i,tGt),r=r.replace(":00","")),r}function iGt(t,e,i,r){if(e==null||i==null)return null;const n=G2.getTimes(t,e,i),s=n.sunrise,o=n.sunset,l=Pf(t,r,"hours"),c=Pf(s,r,"hours"),f=Pf(o,r,"hours");if(l.getUTCDate()!==c.getUTCDate()||l.getUTCDate()!==f.getUTCDate()){const _=l.getTime()-c.getTime()>0?1:-1;s.setUTCDate(s.getUTCDate()+_),o.setUTCDate(o.getUTCDate()+_)}return{sunrise:s,sunset:o}}function rGt(t){return[{utcOffset:-12,short:"UTC-12",long:t.timezoneDateline},{utcOffset:-11,short:"UTC-11",long:t.timezoneSamoa},{utcOffset:-10,short:t.timezoneHAST,long:t.timezoneHawaii},{utcOffset:-9,short:t.timezoneAKST,long:t.timezoneAlaska},{utcOffset:-8,short:t.timezonePST,long:t.timezoneBaja},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneMountain},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneLaPaz},{utcOffset:-7,short:t.timezoneMST,long:t.timezoneArizona},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneSaskatchewan},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneCentralAmerica},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneCentralTime},{utcOffset:-6,short:t.timezoneCST,long:t.timezoneMexico},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneEasternUS},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneLima},{utcOffset:-5,short:t.timezoneEST,long:t.timezoneIndiana},{utcOffset:-4,short:null,long:t.timezoneAtlantic},{utcOffset:-4,short:null,long:t.timezoneCuiaba},{utcOffset:-4,short:null,long:t.timezoneSantiago},{utcOffset:-4,short:null,long:t.timezoneManaus},{utcOffset:-4,short:null,long:t.timezoneAsuncion},{utcOffset:-3,short:null,long:t.timezoneBrasilia},{utcOffset:-3,short:null,long:t.timezoneGreenland},{utcOffset:-3,short:null,long:t.timezoneMontevideo},{utcOffset:-3,short:null,long:t.timezoneCayenne},{utcOffset:-3,short:null,long:t.timezoneBuenosAires},{utcOffset:-2,short:null,long:t.timezoneMidAtlantic},{utcOffset:-1,short:null,long:t.timezoneAzores},{utcOffset:-1,short:null,long:t.timezoneCaboVerde},{utcOffset:0,short:null,long:t.timezoneDublin},{utcOffset:0,short:null,long:t.timezoneReykjavik},{utcOffset:0,short:null,long:t.timezoneCasablanca},{utcOffset:1,short:t.timezoneCET,long:t.timezoneBelgrade},{utcOffset:1,short:t.timezoneCET,long:t.timezoneSarajevo},{utcOffset:1,short:t.timezoneCET,long:t.timezoneBrussels},{utcOffset:1,short:t.timezoneCET,long:t.timezoneWCAfrica},{utcOffset:1,short:t.timezoneCET,long:t.timezoneAmsterdam},{utcOffset:1,short:t.timezoneCET,long:t.timezoneWindhoek},{utcOffset:2,short:t.timezoneEET,long:t.timezoneMinsk},{utcOffset:2,short:t.timezoneEET,long:t.timezoneCairo},{utcOffset:2,short:t.timezoneEET,long:t.timezoneHelsinki},{utcOffset:2,short:t.timezoneEET,long:t.timezoneAthens},{utcOffset:2,short:t.timezoneEET,long:t.timezoneJerusalem},{utcOffset:2,short:t.timezoneEET,long:t.timezoneAmman},{utcOffset:2,short:t.timezoneEET,long:t.timezoneBeirut},{utcOffset:2,short:t.timezoneEET,long:t.timezoneHarare},{utcOffset:2,short:t.timezoneEET,long:t.timezoneDamascus},{utcOffset:2,short:t.timezoneEET,long:t.timezoneIstanbul},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneKuwait},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneBaghdad},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneNairobi},{utcOffset:3,short:t.timezoneMSK,long:t.timezoneKaliningrad},{utcOffset:4,short:t.timezoneGST,long:t.timezoneMoscow},{utcOffset:4,short:t.timezoneGST,long:t.timezoneMuscat},{utcOffset:4,short:t.timezoneGST,long:t.timezoneBaku},{utcOffset:4,short:t.timezoneGST,long:t.timezoneYerevan},{utcOffset:4,short:t.timezoneGST,long:t.timezoneTbilisi},{utcOffset:4,short:t.timezoneGST,long:t.timezonePortLouis},{utcOffset:5,short:null,long:t.timezoneTashkent},{utcOffset:5,short:null,long:t.timezoneIslamabad},{utcOffset:6,short:null,long:t.timezoneEkaterinburg},{utcOffset:6,short:null,long:t.timezoneAstana},{utcOffset:6,short:null,long:t.timezoneDhaka},{utcOffset:7,short:t.timezoneICT,long:t.timezoneNovosibirsk},{utcOffset:7,short:t.timezoneICT,long:t.timezoneBangkok},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneKrasnoyarsk},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneBeijing},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneSingapore},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneTaipei},{utcOffset:8,short:t.timezoneCCT,long:t.timezonePerth},{utcOffset:8,short:t.timezoneCCT,long:t.timezoneUlaanbaatar},{utcOffset:9,short:t.timezoneJST,long:t.timezoneIrkutsk},{utcOffset:9,short:t.timezoneJST,long:t.timezoneSeoul},{utcOffset:9,short:t.timezoneJST,long:t.timezoneOsaka},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneYakutsk},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneCanberra},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneBrisbane},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneHobart},{utcOffset:10,short:t.timezoneAEST,long:t.timezoneGuam},{utcOffset:11,short:null,long:t.timezoneVladivostok},{utcOffset:11,short:null,long:t.timezoneSolomon},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneMagadan},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneFiji},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneAuckland},{utcOffset:12,short:t.timezoneNZST,long:t.timezoneNukualofa}].map(({utcOffset:e,short:i,long:r})=>{const n=e>0?`UTC+${e}`:e<0?`UTC${e}`:"GMT";return i?{utcOffset:e,short:i,shortWithUTC:`${n} (${i})`,long:r}:{utcOffset:e,short:n,shortWithUTC:n,long:r}})}const EBe="esri.widgets.Daylight.DaylightViewModel";let hs=class extends ze{constructor(e){super(e),this.view=null,this.datePickerViewModel=new HG,this.timeSliderViewModel=new nT({min:0,max:1439,values:[0],labelFormatFunction:Lre,inputFormatFunction:Lre}),this.lightingUpdateInterval=200,this._oldLighting=null,this.playSpeedMultiplier=1,this._lastTime=null,this._sunrise=null,this._sunset=null,this._cachedLightingDateUTC=new Date(0),this._cachedDisplayUTCOffset=0,this._firstInteraction=!0,this._lastLightingUpdate=0,this._lightingUpdateHandle=null}initialize(){this.addHandles([Mo(()=>this.view,e=>e.when(()=>this._updateLighting()),ii),_e(()=>{const e=this._lighting;return(e==null?void 0:e.type)==="sun"?i7(e):null},e=>this._scheduleLightingUpdate(e)),Jr(()=>this._lighting,"timezone-will-change",e=>this._timezoneWillChange(e),{onListenerAdd:()=>this._timezoneWillChange(null)}),_e(()=>{var e;return((e=this.view)==null?void 0:e.stationary)===!0},()=>{(this.dayPlaying||this.yearPlaying)&&this._updateSunriseAndSunset()},ii),_e(()=>{const e=this.timeSliderViewModel;return{vm:e,state:e.state,sliderPosition:this.timeSliderPosition}},({vm:e,state:i,sliderPosition:r})=>{i==="ready"&&e.setValue(0,r)}),_e(()=>{var e;return(e=this.timeSliderViewModel)==null?void 0:e.utcOffset},e=>{e!=null&&(this.utcOffset=e)}),_e(()=>({utcOffset:this.utcOffset,sliderViewModel:this.timeSliderViewModel}),({utcOffset:e,sliderViewModel:i})=>{i&&(i.utcOffset=e)},kt),_e(()=>this.timeSliderViewModel.timezonePickerOpen,()=>this.stopPlaying()),_e(()=>this.timeSliderViewModel.values,e=>this._setTimeSliderPosition((e==null?void 0:e[0])??0,{forceLightingUpdate:!1})),_e(()=>this.datePickerViewModel.value,e=>{this.dayPlaying=!1,this.localDate=e}),_e(()=>this.localDate,e=>{this.datePickerViewModel.value.valueOf()!==e.getTime()&&this.datePickerViewModel.set("value",e)})])}destroy(){this._cancelLightingUpdate(),this.view=null}get isSupported(){return this.view==null||this.view.type==="3d"}get utcOffset(){return this._cachedDisplayUTCOffset}set utcOffset(e){e!==this.utcOffset&&this._lighting!=null&&this._lighting.type!=="virtual"&&(this._lighting.displayUTCOffset=e,this._updateLighting())}get localDate(){return cot(this._lightingDateDisplay)}set localDate(e){tF(e)&&e.getTime()!==this.localDate.getTime()&&(this._lightingDateDisplay=lot(this._lightingDateDisplay,e))}get timeSliderPosition(){return Jjt(this._lightingDateDisplay)}set timeSliderPosition(e){this._setTimeSliderPosition(e,{forceLightingUpdate:!0})}_setTimeSliderPosition(e,i){Math.abs(e-this.timeSliderPosition)<=1/60||(this.stopPlaying(),this._enableDirectShadowsIfFirstInteraction(),i.forceLightingUpdate&&(this._cancelLightingUpdate(),this._updateLighting()),this._lightingDateDisplay=Zjt(this._lightingDateDisplay,e))}_timezoneFromCamera(e,i){if(i==null||!e.cameraTrackingEnabled)return 0;const r=bee([i.longitude,i.latitude]);return r==null?0:Math.round(r.hours+r.minutes/60+r.seconds/3600)}get directShadowsEnabled(){var e;return((e=this._lighting)==null?void 0:e.directShadowsEnabled)??!1}set directShadowsEnabled(e){const i=this._lighting;i&&(i.directShadowsEnabled=e)}get sunLightingEnabled(){return this._lightingType==="sun"}set sunLightingEnabled(e){const i=this._environment;if(e===this._get("sunLightingEnabled")||i==null)return;const r=i.lighting,n=this._oldLighting;this._oldLighting=r;const s={directShadowsEnabled:r.directShadowsEnabled,cameraTrackingEnabled:r.cameraTrackingEnabled},o=e?"sun":"virtual";let l;l=n!=null&&n.type===o?n:e?new Rv:new $M,l.set(s),i.lighting=l,e||(this.stopPlaying(),this.timeSliderViewModel.timezonePickerOpen=!1)}set playingState(e){this.playingState!==e&&(this._set("playingState",e),e!=="none"&&this.sunLightingEnabled&&(this._updateSunriseAndSunset(),this._lastTime=Date.now(),this._play(),this._enableDirectShadowsIfFirstInteraction()))}get dayPlaying(){return this.playingState==="day"}set dayPlaying(e){e?this.playingState="day":this.dayPlaying&&(this.playingState="none")}get yearPlaying(){return this.playingState==="year"}set yearPlaying(e){e?this.playingState="year":this.yearPlaying&&(this.playingState="none")}get currentSeason(){return Wjt(this.localDate,this._currentHemisphere)}set currentSeason(e){this.stopPlaying();const i=Fue(e,this._currentHemisphere);this.localDate=NI(this.localDate,i,wy.NORTHERN)}get _currentHemisphere(){var i,r,n;const e=(n=(r=(i=this.view)==null?void 0:i.camera)==null?void 0:r.position)==null?void 0:n.latitude;return e==null||e>=0?wy.NORTHERN:wy.SOUTHERN}get _environment(){var e;return(e=this.view)==null?void 0:e.environment}get _lighting(){var e;return(e=this._environment)==null?void 0:e.lighting}get _lightingType(){var e;return(e=this._lighting)==null?void 0:e.type}get _lightingDateDisplay(){return Pf(this._cachedLightingDateUTC,this._cachedDisplayUTCOffset,"hours")}set _lightingDateDisplay(e){const i=this._lighting;if(i==null||!this.sunLightingEnabled||i.type==="virtual"||!tF(e))return;const r=i7(i),n=Pf(e,-this._cachedDisplayUTCOffset,"hours");n.getTime()!==r.getTime()&&(i.date=n,this._updateLighting())}stopPlaying(){this.playingState="none"}toggleDayPlaying(){this.dayPlaying=!this.dayPlaying}toggleYearPlaying(){this.yearPlaying=!this.yearPlaying}toggleSunLightingEnabled(){this.stopPlaying(),this.sunLightingEnabled=!this.sunLightingEnabled}toggleDirectShadowsEnabled(){this.stopPlaying(),this.directShadowsEnabled=!this.directShadowsEnabled}_enableDirectShadowsIfFirstInteraction(){this._firstInteraction&&(this._firstInteraction=!1,this.directShadowsEnabled=!0)}_updateLighting(e){var l;const i=Date.now();this._lastLightingUpdate=i;const{view:r}=this,n=this._lighting;if(r==null||n==null||n.type==="virtual")return;e??(e=i7(n));const s=n.displayUTCOffset,o=s!==null?s:this._timezoneFromCamera(n,(l=r.camera)==null?void 0:l.position);this._cachedLightingDateUTC.getTime()!==e.getTime()&&(this._cachedLightingDateUTC=new Date(e.getTime())),this._cachedDisplayUTCOffset!==o&&(this._cachedDisplayUTCOffset=o)}_timezoneWillChange(e){const i=this._lighting;if(i==null||i.type==="virtual"||!i.cameraTrackingEnabled)return;let r;if(e)r=e.timezoneOffset;else{if(i.displayUTCOffset!=null)return;r=Rv.calculateTimezoneOffset(i.positionTimezoneInfo)}i.displayUTCOffset=r,this._scheduleLightingUpdate()}_scheduleLightingUpdate(e){if(e&&(this._lightingUpdateHandle=en(this._lightingUpdateHandle),!tF(e))||this._lightingUpdateHandle)return;const i=Date.now()-this._lastLightingUpdate,r=this.lightingUpdateInterval-i;let n=null;const s=()=>{this._updateLighting(e),this._lightingUpdateHandle===n&&(this._lightingUpdateHandle=null)};if(r<=0)this._lightingUpdateHandle=n=tx(s);else{const o=setTimeout(s,r);this._lightingUpdateHandle=n=rr(()=>clearTimeout(o))}}_cancelLightingUpdate(){this._lightingUpdateHandle=en(this._lightingUpdateHandle)}_play(){const e=this._lighting;if(e==null||!this.sunLightingEnabled||e.type==="virtual")return;const i=i7(e);if(this.dayPlaying||this.yearPlaying){const r=Date.now()-(this._lastTime??0);if(this.dayPlaying){this._lastTime=Date.now();const n=Kjt(this._sunrise,this._sunset,i)*this.playSpeedMultiplier/100*r;if(n>0){let s=new Date(i.getTime()+n);const o=e.displayUTCOffset??0;((s.getUTCHours()+o)%24+24)%24<((i.getUTCHours()+o)%24+24)%24&&(s=new Date(i.getTime()+n-864e5)),e.date=s}}else if(r>1e3){this._lastTime=Date.now();const n=(i.getUTCMonth()+1)%12,s=new Date(i.getTime());s.setUTCMonth(n),e.date=s}requestAnimationFrame(()=>this._play())}}_updateSunriseAndSunset(){var c,f;const e=this._lighting;if(e==null||e.type==="virtual"||!this.sunLightingEnabled)return;const i=(f=(c=this.view)==null?void 0:c.camera)==null?void 0:f.position;if(i==null)return;const{latitude:r,longitude:n}=i,{date:s,displayUTCOffset:o}=e,l=iGt(s,r,n,o??0);l&&(this._sunrise=new Date(l.sunrise),this._sunset=new Date(l.sunset))}};function i7(t){return tF(t.date)||(Ce.getLogger(EBe).warn("Invalid date. Reverting to the current date/time."),t.date=new Date),t.date}y([w({type:Aze})],hs.prototype,"view",void 0),y([w({type:HG,nonNullable:!0})],hs.prototype,"datePickerViewModel",void 0),y([w({type:nT,nonNullable:!0})],hs.prototype,"timeSliderViewModel",void 0),y([w()],hs.prototype,"isSupported",null),y([w()],hs.prototype,"lightingUpdateInterval",void 0),y([w()],hs.prototype,"utcOffset",null),y([w()],hs.prototype,"localDate",null),y([w()],hs.prototype,"timeSliderPosition",null),y([w()],hs.prototype,"directShadowsEnabled",null),y([w()],hs.prototype,"sunLightingEnabled",null),y([w({type:["none","day","year"],value:"none"})],hs.prototype,"playingState",null),y([w()],hs.prototype,"dayPlaying",null),y([w()],hs.prototype,"yearPlaying",null),y([w()],hs.prototype,"playSpeedMultiplier",void 0),y([w()],hs.prototype,"currentSeason",null),y([w()],hs.prototype,"_lastTime",void 0),y([w()],hs.prototype,"_sunrise",void 0),y([w()],hs.prototype,"_sunset",void 0),y([w()],hs.prototype,"_cachedLightingDateUTC",void 0),y([w()],hs.prototype,"_cachedDisplayUTCOffset",void 0),y([w()],hs.prototype,"_firstInteraction",void 0),y([w()],hs.prototype,"_currentHemisphere",null),y([w()],hs.prototype,"_environment",null),y([w()],hs.prototype,"_lighting",null),y([w()],hs.prototype,"_lightingType",null),y([w()],hs.prototype,"_lightingDateDisplay",null),hs=y([Z(EBe)],hs);const CBe=hs;let gv=class extends ze{constructor(e){super(e),this.header=!0,this.playButtons=!0,this.datePicker=!0,this.timezone=!0,this.sunLightingToggle=!0,this.shadowsToggle=!0}};y([w({type:Boolean,nonNullable:!0})],gv.prototype,"header",void 0),y([w({type:Boolean,nonNullable:!0})],gv.prototype,"playButtons",void 0),y([w({type:Boolean,nonNullable:!0})],gv.prototype,"datePicker",void 0),y([w({type:Boolean,nonNullable:!0})],gv.prototype,"timezone",void 0),y([w({type:Boolean,nonNullable:!0})],gv.prototype,"sunLightingToggle",void 0),y([w({type:Boolean,nonNullable:!0})],gv.prototype,"shadowsToggle",void 0),gv=y([Z("esri.widgets.Daylight.VisibleElements")],gv);const ABe=gv,r7="esri-timezone-picker",BR={base:r7,trigger:`${r7}__trigger`,itemTitle:`${r7}__item-title`,itemDescription:`${r7}__item_description`};let qd=class extends cn{constructor(e,i){super(e,i),this.value=null,this.onChange=null,this.open=!1,this.onOpen=null,this.onClose=null,this._selectedId=null,this._onOpen=()=>{var r;this.open=!0,(r=this.onOpen)==null||r.call(this)},this._onClose=()=>{var r;this.open=!1,(r=this.onClose)==null||r.call(this)},this._killEvent=r=>(r.stopPropagation(),!0),this._onChange=r=>{var l,c,f;const n=r.target,s=(l=n.selectedItems)==null?void 0:l[0].getAttribute("data-id"),o=(c=$xe(this._gmtOffsets,s))==null?void 0:c.utcOffset;o&&(this._selectedId=s,(f=this.onChange)==null||f.call(this,o))}}loadDependencies(){return Pl({button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),dropdown:()=>we(()=>import("./calcite-dropdown-caxGPYrb.js"),__vite__mapDeps([279,252,253,247,237,241,239,242,254])),"dropdown-group":()=>we(()=>import("./calcite-dropdown-group-bJt5U1w-.js"),__vite__mapDeps([280,242,281])),"dropdown-item":()=>we(()=>import("./calcite-dropdown-item-HvBJs5CH.js"),__vite__mapDeps([282,281,239,243,245,242]))})}render(){const e=this._messages;if(!e)return X("div",{class:BR.base,key:"empty"});const i=this._selectedItem,r=Dre(i);return X("div",{class:BR.base,key:"container",onpointerdown:this._killEvent},X("calcite-dropdown",{open:this.open,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",onCalciteDropdownClose:this._onClose,onCalciteDropdownOpen:this._onOpen,onCalciteDropdownSelect:this._onChange},X("calcite-button",{appearance:"transparent",class:BR.trigger,key:"trigger",kind:"neutral",scale:"s",slot:"trigger",tabIndex:0,title:e.chooseTimezone},(i==null?void 0:i.short)??""),X("calcite-dropdown-group",{selectionMode:"single"},this._gmtOffsets.map(n=>{const s=Dre(n);return X("calcite-dropdown-item",{"data-id":s,key:s,selected:r===s},X("div",{class:BR.itemTitle,key:"title"},n.shortWithUTC),X("div",{class:BR.itemDescription,key:"description"},n.long))}))))}get _gmtOffsets(){const e=this._messages;return e?rGt(e):[]}get _selectedItem(){const e=this._gmtOffsets,i=this.value,r=$xe(e,this._selectedId);return(r==null?void 0:r.utcOffset)===i?r:nGt(e,i)}};function $xe(t,e){return t.find(i=>Dre(i)===e)}function nGt(t,e){return t.find(i=>i.utcOffset===e)}function Dre(t){return t?`${t.utcOffset}-${t.long}`:void 0}y([w()],qd.prototype,"value",void 0),y([w()],qd.prototype,"onChange",void 0),y([w()],qd.prototype,"open",void 0),y([w()],qd.prototype,"onOpen",void 0),y([w()],qd.prototype,"onClose",void 0),y([w(),Gr("esri/widgets/support/t9n/timezone")],qd.prototype,"_messages",void 0),y([w()],qd.prototype,"_gmtOffsets",null),y([w()],qd.prototype,"_selectedItem",null),y([w()],qd.prototype,"_selectedId",void 0),qd=y([Z("esri.widgets.support.TimezonePicker")],qd);const LX="esri-slider-with-dropdown",n7={label:"esri-slider__label",box:`${LX}__box`,boxDropDownOn:`${LX}__box--drop-down-on`,boxDropDownOff:`${LX}__box--drop-down-off`};let fM=class extends NG{constructor(e,i){super(e,i),this.viewModel=new nT,this.showDropDown=!0,this._labelWidth=0,this._onLabelAfterCreate=r=>{const n="label-size-observer";this.removeHandles(n),this.addHandles(aB(r,({contentRect:s})=>{this._labelWidth=s.width}),n)},this._getLabelStyles=()=>{if(!this.trackElement)return;const r=this._trackWidth,n=this._labelWidth/2,s=this.getCurrentPosition(),o=s-n,l=s+n;let c=-n;return o<0?c+=-o:l>r&&(c+=r-l),{left:`${c}px`}},this._onTimezoneChange=r=>{this.viewModel.utcOffset=r},this._onTimezonePickerOpen=()=>{this.viewModel.timezonePickerOpen=!0},this._onTimezonePickerClose=()=>{this.viewModel.timezonePickerOpen=!1}}renderThumbLabel(e){const{showDropDown:i,viewModel:r}=this;return X("div",{afterCreate:this._onLabelAfterCreate,class:this.classes({[n7.box]:!0,[n7.label]:!0,[n7.boxDropDownOn]:i,[n7.boxDropDownOff]:!i}),key:"thumb-label",styles:this._getLabelStyles()},super.renderThumbLabel(e),i?X(qd,{open:r.timezonePickerOpen,value:r.utcOffset,onChange:this._onTimezoneChange,onClose:this._onTimezonePickerClose,onOpen:this._onTimezonePickerOpen}):null)}};y([w()],fM.prototype,"viewModel",void 0),y([w()],fM.prototype,"showDropDown",void 0),y([w()],fM.prototype,"_labelWidth",void 0),fM=y([Z("esri.widgets.Daylight.support.SliderWithDropdown")],fM);const sGt=fM;function oGt(t,e){const i=ZTe(e),r=Date.now(),n=i.formatToParts(r),s=new Set;n.filter(({type:f})=>f==="literal").forEach(({value:f})=>s.add(f));let o=0;const l={};for(;n.length>0;){const{type:f,value:_}=n.shift();for(let x=0;x<_.length;x++,o++){const T=t.charAt(o);if(s.has(T)){o++;break}if(f==="literal")break;l[f]||(l[f]=[]),l[f].push(T)}}const c={};try{c.day=DX(l.day.join("")),c.month=DX(l.month.join("")),c.year=DX((l.year||l.relatedYear).join(""))}catch{throw Lxe(e)}if(isNaN(c.day)||isNaN(c.month)||isNaN(c.year))throw Lxe(e);return c}function DX(t){const e=[/٠/g,/١/g,/٢/g,/٣/g,/٤/g,/٥/g,/٦/g,/٧/g,/٨/g,/٩/g];for(let i=0;i<10;i++)t=t.replace(e[i],i.toString());return Number(t)}function Lxe(t){return new se(`could not parse date input, expecting the following format: ${js(Date.now(),t)}`)}const jR={ar:6,"ar-dz":6,"ar-kw":6,"ar-ly":6,"ar-ma":1,"ar-sa":7,"ar-tn":1,bg:1,bs:1,ca:1,cs:1,da:1,de:1,"de-at":1,"de-ch":1,el:1,"en-au":1,"en-ca":7,"en-gb":1,"en-ie":1,"en-il":7,"en-in":7,"en-nz":1,"en-sg":7,es:1,"es-do":7,"es-mx":7,"es-us":7,et:1,fi:1,fr:1,"fr-ca":7,"fr-ch":1,he:7,hr:1,hu:1,id:7,it:1,"it-ch":1,ja:7,ko:7,lt:1,lv:1,nb:1,nl:1,"nl-be":1,pl:1,pt:7,"pt-br":7,ro:1,ru:1,sk:1,sl:1,sr:1,"sr-cyrl":1,sv:1,th:7,tr:1,uk:1,vi:1,"zh-cn":1,"zh-hk":7,"zh-mo":7,"zh-tw":7},aGt="Locale"in Intl&&"weekInfo"in Intl.Locale.prototype;function MBe(t){if(t=t.toLowerCase(),jR[t])return jR[t];if(aGt)try{const i=new Intl.Locale(t).weekInfo.firstDay;return jR[t]=i,i}catch{}const e=lne(t);return jR[e]?jR[e]:7}function lGt(t,e){return(e+7-MBe(t))%7}var Qh="top",r0="bottom",n0="right",ed="left",kue="auto",b6=[Qh,r0,n0,ed],B5="start",s9="end",cGt="clippingParents",OBe="viewport",GR="popper",uGt="reference",Dxe=b6.reduce(function(t,e){return t.concat([e+"-"+B5,e+"-"+s9])},[]),PBe=[].concat(b6,[kue]).reduce(function(t,e){return t.concat([e,e+"-"+B5,e+"-"+s9])},[]),hGt="beforeRead",dGt="read",pGt="afterRead",fGt="beforeMain",mGt="main",gGt="afterMain",yGt="beforeWrite",vGt="write",_Gt="afterWrite",bGt=[hGt,dGt,pGt,fGt,mGt,gGt,yGt,vGt,_Gt];function t1(t){return t?(t.nodeName||"").toLowerCase():null}function Ep(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function nE(t){var e=Ep(t).Element;return t instanceof e||t instanceof Element}function Ff(t){var e=Ep(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function zue(t){if(typeof ShadowRoot>"u")return!1;var e=Ep(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function wGt(t){var e=t.state;Object.keys(e.elements).forEach(function(i){var r=e.styles[i]||{},n=e.attributes[i]||{},s=e.elements[i];!Ff(s)||!t1(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var l=n[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function xGt(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach(function(r){var n=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:i[r]),l=o.reduce(function(c,f){return c[f]="",c},{});!Ff(n)||!t1(n)||(Object.assign(n.style,l),Object.keys(s).forEach(function(c){n.removeAttribute(c)}))})}}const SGt={name:"applyStyles",enabled:!0,phase:"write",fn:wGt,effect:xGt,requires:["computeStyles"]};function Ny(t){return t.split("-")[0]}var ET=Math.max,FV=Math.min,j5=Math.round;function Nre(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function RBe(){return!/^((?!chrome|android).)*safari/i.test(Nre())}function G5(t,e,i){e===void 0&&(e=!1),i===void 0&&(i=!1);var r=t.getBoundingClientRect(),n=1,s=1;e&&Ff(t)&&(n=t.offsetWidth>0&&j5(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&j5(r.height)/t.offsetHeight||1);var o=nE(t)?Ep(t):window,l=o.visualViewport,c=!RBe()&&i,f=(r.left+(c&&l?l.offsetLeft:0))/n,_=(r.top+(c&&l?l.offsetTop:0))/s,x=r.width/n,T=r.height/s;return{width:x,height:T,top:_,right:f+x,bottom:_+T,left:f,x:f,y:_}}function Uue(t){var e=G5(t),i=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:r}}function IBe(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&zue(i)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M_(t){return Ep(t).getComputedStyle(t)}function TGt(t){return["table","td","th"].indexOf(t1(t))>=0}function gx(t){return((nE(t)?t.ownerDocument:t.document)||window.document).documentElement}function qG(t){return t1(t)==="html"?t:t.assignedSlot||t.parentNode||(zue(t)?t.host:null)||gx(t)}function Nxe(t){return!Ff(t)||M_(t).position==="fixed"?null:t.offsetParent}function EGt(t){var e=/firefox/i.test(Nre()),i=/Trident/i.test(Nre());if(i&&Ff(t)){var r=M_(t);if(r.position==="fixed")return null}var n=qG(t);for(zue(n)&&(n=n.host);Ff(n)&&["html","body"].indexOf(t1(n))<0;){var s=M_(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function w6(t){for(var e=Ep(t),i=Nxe(t);i&&TGt(i)&&M_(i).position==="static";)i=Nxe(i);return i&&(t1(i)==="html"||t1(i)==="body"&&M_(i).position==="static")?e:i||EGt(t)||e}function Vue(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function J$(t,e,i){return ET(t,FV(e,i))}function CGt(t,e,i){var r=J$(t,e,i);return r>i?i:r}function $Be(){return{top:0,right:0,bottom:0,left:0}}function LBe(t){return Object.assign({},$Be(),t)}function DBe(t,e){return e.reduce(function(i,r){return i[r]=t,i},{})}var AGt=function(e,i){return e=typeof e=="function"?e(Object.assign({},i.rects,{placement:i.placement})):e,LBe(typeof e!="number"?e:DBe(e,b6))};function MGt(t){var e,i=t.state,r=t.name,n=t.options,s=i.elements.arrow,o=i.modifiersData.popperOffsets,l=Ny(i.placement),c=Vue(l),f=[ed,n0].indexOf(l)>=0,_=f?"height":"width";if(!(!s||!o)){var x=AGt(n.padding,i),T=Uue(s),A=c==="y"?Qh:ed,M=c==="y"?r0:n0,I=i.rects.reference[_]+i.rects.reference[c]-o[c]-i.rects.popper[_],L=o[c]-i.rects.reference[c],F=w6(s),z=F?c==="y"?F.clientHeight||0:F.clientWidth||0:0,k=I/2-L/2,U=x[A],j=z-T[_]-x[M],H=z/2-T[_]/2+k,Y=J$(U,H,j),Q=c;i.modifiersData[r]=(e={},e[Q]=Y,e.centerOffset=Y-H,e)}}function OGt(t){var e=t.state,i=t.options,r=i.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||IBe(e.elements.popper,n)&&(e.elements.arrow=n))}const PGt={name:"arrow",enabled:!0,phase:"main",fn:MGt,effect:OGt,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function H5(t){return t.split("-")[1]}var RGt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function IGt(t,e){var i=t.x,r=t.y,n=e.devicePixelRatio||1;return{x:j5(i*n)/n||0,y:j5(r*n)/n||0}}function Fxe(t){var e,i=t.popper,r=t.popperRect,n=t.placement,s=t.variation,o=t.offsets,l=t.position,c=t.gpuAcceleration,f=t.adaptive,_=t.roundOffsets,x=t.isFixed,T=o.x,A=T===void 0?0:T,M=o.y,I=M===void 0?0:M,L=typeof _=="function"?_({x:A,y:I}):{x:A,y:I};A=L.x,I=L.y;var F=o.hasOwnProperty("x"),z=o.hasOwnProperty("y"),k=ed,U=Qh,j=window;if(f){var H=w6(i),Y="clientHeight",Q="clientWidth";if(H===Ep(i)&&(H=gx(i),M_(H).position!=="static"&&l==="absolute"&&(Y="scrollHeight",Q="scrollWidth")),H=H,n===Qh||(n===ed||n===n0)&&s===s9){U=r0;var ne=x&&H===j&&j.visualViewport?j.visualViewport.height:H[Y];I-=ne-r.height,I*=c?1:-1}if(n===ed||(n===Qh||n===r0)&&s===s9){k=n0;var re=x&&H===j&&j.visualViewport?j.visualViewport.width:H[Q];A-=re-r.width,A*=c?1:-1}}var he=Object.assign({position:l},f&&RGt),ce=_===!0?IGt({x:A,y:I},Ep(i)):{x:A,y:I};if(A=ce.x,I=ce.y,c){var be;return Object.assign({},he,(be={},be[U]=z?"0":"",be[k]=F?"0":"",be.transform=(j.devicePixelRatio||1)<=1?"translate("+A+"px, "+I+"px)":"translate3d("+A+"px, "+I+"px, 0)",be))}return Object.assign({},he,(e={},e[U]=z?I+"px":"",e[k]=F?A+"px":"",e.transform="",e))}function $Gt(t){var e=t.state,i=t.options,r=i.gpuAcceleration,n=r===void 0?!0:r,s=i.adaptive,o=s===void 0?!0:s,l=i.roundOffsets,c=l===void 0?!0:l,f={placement:Ny(e.placement),variation:H5(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Fxe(Object.assign({},f,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Fxe(Object.assign({},f,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const LGt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:$Gt,data:{}};var s7={passive:!0};function DGt(t){var e=t.state,i=t.instance,r=t.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,l=o===void 0?!0:o,c=Ep(e.elements.popper),f=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&f.forEach(function(_){_.addEventListener("scroll",i.update,s7)}),l&&c.addEventListener("resize",i.update,s7),function(){s&&f.forEach(function(_){_.removeEventListener("scroll",i.update,s7)}),l&&c.removeEventListener("resize",i.update,s7)}}const NGt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:DGt,data:{}};var FGt={left:"right",right:"left",bottom:"top",top:"bottom"};function Fk(t){return t.replace(/left|right|bottom|top/g,function(e){return FGt[e]})}var kGt={start:"end",end:"start"};function kxe(t){return t.replace(/start|end/g,function(e){return kGt[e]})}function Bue(t){var e=Ep(t),i=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:i,scrollTop:r}}function jue(t){return G5(gx(t)).left+Bue(t).scrollLeft}function zGt(t,e){var i=Ep(t),r=gx(t),n=i.visualViewport,s=r.clientWidth,o=r.clientHeight,l=0,c=0;if(n){s=n.width,o=n.height;var f=RBe();(f||!f&&e==="fixed")&&(l=n.offsetLeft,c=n.offsetTop)}return{width:s,height:o,x:l+jue(t),y:c}}function UGt(t){var e,i=gx(t),r=Bue(t),n=(e=t.ownerDocument)==null?void 0:e.body,s=ET(i.scrollWidth,i.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=ET(i.scrollHeight,i.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),l=-r.scrollLeft+jue(t),c=-r.scrollTop;return M_(n||i).direction==="rtl"&&(l+=ET(i.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:l,y:c}}function Gue(t){var e=M_(t),i=e.overflow,r=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+n+r)}function NBe(t){return["html","body","#document"].indexOf(t1(t))>=0?t.ownerDocument.body:Ff(t)&&Gue(t)?t:NBe(qG(t))}function K$(t,e){var i;e===void 0&&(e=[]);var r=NBe(t),n=r===((i=t.ownerDocument)==null?void 0:i.body),s=Ep(r),o=n?[s].concat(s.visualViewport||[],Gue(r)?r:[]):r,l=e.concat(o);return n?l:l.concat(K$(qG(o)))}function Fre(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function VGt(t,e){var i=G5(t,!1,e==="fixed");return i.top=i.top+t.clientTop,i.left=i.left+t.clientLeft,i.bottom=i.top+t.clientHeight,i.right=i.left+t.clientWidth,i.width=t.clientWidth,i.height=t.clientHeight,i.x=i.left,i.y=i.top,i}function zxe(t,e,i){return e===OBe?Fre(zGt(t,i)):nE(e)?VGt(e,i):Fre(UGt(gx(t)))}function BGt(t){var e=K$(qG(t)),i=["absolute","fixed"].indexOf(M_(t).position)>=0,r=i&&Ff(t)?w6(t):t;return nE(r)?e.filter(function(n){return nE(n)&&IBe(n,r)&&t1(n)!=="body"}):[]}function jGt(t,e,i,r){var n=e==="clippingParents"?BGt(t):[].concat(e),s=[].concat(n,[i]),o=s[0],l=s.reduce(function(c,f){var _=zxe(t,f,r);return c.top=ET(_.top,c.top),c.right=FV(_.right,c.right),c.bottom=FV(_.bottom,c.bottom),c.left=ET(_.left,c.left),c},zxe(t,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function FBe(t){var e=t.reference,i=t.element,r=t.placement,n=r?Ny(r):null,s=r?H5(r):null,o=e.x+e.width/2-i.width/2,l=e.y+e.height/2-i.height/2,c;switch(n){case Qh:c={x:o,y:e.y-i.height};break;case r0:c={x:o,y:e.y+e.height};break;case n0:c={x:e.x+e.width,y:l};break;case ed:c={x:e.x-i.width,y:l};break;default:c={x:e.x,y:e.y}}var f=n?Vue(n):null;if(f!=null){var _=f==="y"?"height":"width";switch(s){case B5:c[f]=c[f]-(e[_]/2-i[_]/2);break;case s9:c[f]=c[f]+(e[_]/2-i[_]/2);break}}return c}function o9(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=r===void 0?t.placement:r,s=i.strategy,o=s===void 0?t.strategy:s,l=i.boundary,c=l===void 0?cGt:l,f=i.rootBoundary,_=f===void 0?OBe:f,x=i.elementContext,T=x===void 0?GR:x,A=i.altBoundary,M=A===void 0?!1:A,I=i.padding,L=I===void 0?0:I,F=LBe(typeof L!="number"?L:DBe(L,b6)),z=T===GR?uGt:GR,k=t.rects.popper,U=t.elements[M?z:T],j=jGt(nE(U)?U:U.contextElement||gx(t.elements.popper),c,_,o),H=G5(t.elements.reference),Y=FBe({reference:H,element:k,strategy:"absolute",placement:n}),Q=Fre(Object.assign({},k,Y)),ne=T===GR?Q:H,re={top:j.top-ne.top+F.top,bottom:ne.bottom-j.bottom+F.bottom,left:j.left-ne.left+F.left,right:ne.right-j.right+F.right},he=t.modifiersData.offset;if(T===GR&&he){var ce=he[n];Object.keys(re).forEach(function(be){var ye=[n0,r0].indexOf(be)>=0?1:-1,pe=[Qh,r0].indexOf(be)>=0?"y":"x";re[be]+=ce[pe]*ye})}return re}function GGt(t,e){e===void 0&&(e={});var i=e,r=i.placement,n=i.boundary,s=i.rootBoundary,o=i.padding,l=i.flipVariations,c=i.allowedAutoPlacements,f=c===void 0?PBe:c,_=H5(r),x=_?l?Dxe:Dxe.filter(function(M){return H5(M)===_}):b6,T=x.filter(function(M){return f.indexOf(M)>=0});T.length===0&&(T=x);var A=T.reduce(function(M,I){return M[I]=o9(t,{placement:I,boundary:n,rootBoundary:s,padding:o})[Ny(I)],M},{});return Object.keys(A).sort(function(M,I){return A[M]-A[I]})}function HGt(t){if(Ny(t)===kue)return[];var e=Fk(t);return[kxe(t),e,kxe(e)]}function qGt(t){var e=t.state,i=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,l=o===void 0?!0:o,c=i.fallbackPlacements,f=i.padding,_=i.boundary,x=i.rootBoundary,T=i.altBoundary,A=i.flipVariations,M=A===void 0?!0:A,I=i.allowedAutoPlacements,L=e.options.placement,F=Ny(L),z=F===L,k=c||(z||!M?[Fk(L)]:HGt(L)),U=[L].concat(k).reduce(function(Ge,ut){return Ge.concat(Ny(ut)===kue?GGt(e,{placement:ut,boundary:_,rootBoundary:x,padding:f,flipVariations:M,allowedAutoPlacements:I}):ut)},[]),j=e.rects.reference,H=e.rects.popper,Y=new Map,Q=!0,ne=U[0],re=0;re=0,pe=ye?"width":"height",Ee=o9(e,{placement:he,boundary:_,rootBoundary:x,altBoundary:T,padding:f}),te=ye?be?n0:ed:be?r0:Qh;j[pe]>H[pe]&&(te=Fk(te));var le=Fk(te),de=[];if(s&&de.push(Ee[ce]<=0),l&&de.push(Ee[te]<=0,Ee[le]<=0),de.every(function(Ge){return Ge})){ne=he,Q=!1;break}Y.set(he,de)}if(Q)for(var ve=M?3:1,Se=function(ut){var Ft=U.find(function(Qt){var At=Y.get(Qt);if(At)return At.slice(0,ut).every(function(ri){return ri})});if(Ft)return ne=Ft,"break"},Ae=ve;Ae>0;Ae--){var Pe=Se(Ae);if(Pe==="break")break}e.placement!==ne&&(e.modifiersData[r]._skip=!0,e.placement=ne,e.reset=!0)}}const WGt={name:"flip",enabled:!0,phase:"main",fn:qGt,requiresIfExists:["offset"],data:{_skip:!1}};function Uxe(t,e,i){return i===void 0&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Vxe(t){return[Qh,n0,r0,ed].some(function(e){return t[e]>=0})}function YGt(t){var e=t.state,i=t.name,r=e.rects.reference,n=e.rects.popper,s=e.modifiersData.preventOverflow,o=o9(e,{elementContext:"reference"}),l=o9(e,{altBoundary:!0}),c=Uxe(o,r),f=Uxe(l,n,s),_=Vxe(c),x=Vxe(f);e.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:f,isReferenceHidden:_,hasPopperEscaped:x},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":_,"data-popper-escaped":x})}const XGt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:YGt};function ZGt(t,e,i){var r=Ny(t),n=[ed,Qh].indexOf(r)>=0?-1:1,s=typeof i=="function"?i(Object.assign({},e,{placement:t})):i,o=s[0],l=s[1];return o=o||0,l=(l||0)*n,[ed,n0].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function JGt(t){var e=t.state,i=t.options,r=t.name,n=i.offset,s=n===void 0?[0,0]:n,o=PBe.reduce(function(_,x){return _[x]=ZGt(x,e.rects,s),_},{}),l=o[e.placement],c=l.x,f=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=f),e.modifiersData[r]=o}const KGt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:JGt};function QGt(t){var e=t.state,i=t.name;e.modifiersData[i]=FBe({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const eHt={name:"popperOffsets",enabled:!0,phase:"read",fn:QGt,data:{}};function tHt(t){return t==="x"?"y":"x"}function iHt(t){var e=t.state,i=t.options,r=t.name,n=i.mainAxis,s=n===void 0?!0:n,o=i.altAxis,l=o===void 0?!1:o,c=i.boundary,f=i.rootBoundary,_=i.altBoundary,x=i.padding,T=i.tether,A=T===void 0?!0:T,M=i.tetherOffset,I=M===void 0?0:M,L=o9(e,{boundary:c,rootBoundary:f,padding:x,altBoundary:_}),F=Ny(e.placement),z=H5(e.placement),k=!z,U=Vue(F),j=tHt(U),H=e.modifiersData.popperOffsets,Y=e.rects.reference,Q=e.rects.popper,ne=typeof I=="function"?I(Object.assign({},e.rects,{placement:e.placement})):I,re=typeof ne=="number"?{mainAxis:ne,altAxis:ne}:Object.assign({mainAxis:0,altAxis:0},ne),he=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,ce={x:0,y:0};if(H){if(s){var be,ye=U==="y"?Qh:ed,pe=U==="y"?r0:n0,Ee=U==="y"?"height":"width",te=H[U],le=te+L[ye],de=te-L[pe],ve=A?-Q[Ee]/2:0,Se=z===B5?Y[Ee]:Q[Ee],Ae=z===B5?-Q[Ee]:-Y[Ee],Pe=e.elements.arrow,Ge=A&&Pe?Uue(Pe):{width:0,height:0},ut=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:$Be(),Ft=ut[ye],Qt=ut[pe],At=J$(0,Y[Ee],Ge[Ee]),ri=k?Y[Ee]/2-ve-At-Ft-re.mainAxis:Se-At-Ft-re.mainAxis,Rt=k?-Y[Ee]/2+ve+At+Qt+re.mainAxis:Ae+At+Qt+re.mainAxis,dt=e.elements.arrow&&w6(e.elements.arrow),pt=dt?U==="y"?dt.clientTop||0:dt.clientLeft||0:0,oi=(be=he==null?void 0:he[U])!=null?be:0,ht=te+ri-oi-pt,Et=te+Rt-oi,Dt=J$(A?FV(le,ht):le,te,A?ET(de,Et):de);H[U]=Dt,ce[U]=Dt-te}if(l){var Tt,ie=U==="x"?Qh:ed,Ht=U==="x"?r0:n0,hr=H[j],Ke=j==="y"?"height":"width",Lt=hr+L[ie],vt=hr-L[Ht],Bt=[Qh,ed].indexOf(F)!==-1,qt=(Tt=he==null?void 0:he[j])!=null?Tt:0,li=Bt?Lt:hr-Y[Ke]-Q[Ke]-qt+re.altAxis,mi=Bt?hr+Y[Ke]+Q[Ke]-qt-re.altAxis:vt,Lr=A&&Bt?CGt(li,hr,mi):J$(A?li:Lt,hr,A?mi:vt);H[j]=Lr,ce[j]=Lr-hr}e.modifiersData[r]=ce}}const rHt={name:"preventOverflow",enabled:!0,phase:"main",fn:iHt,requiresIfExists:["offset"]};function nHt(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function sHt(t){return t===Ep(t)||!Ff(t)?Bue(t):nHt(t)}function oHt(t){var e=t.getBoundingClientRect(),i=j5(e.width)/t.offsetWidth||1,r=j5(e.height)/t.offsetHeight||1;return i!==1||r!==1}function aHt(t,e,i){i===void 0&&(i=!1);var r=Ff(e),n=Ff(e)&&oHt(e),s=gx(e),o=G5(t,n,i),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!i)&&((t1(e)!=="body"||Gue(s))&&(l=sHt(e)),Ff(e)?(c=G5(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):s&&(c.x=jue(s))),{x:o.left+l.scrollLeft-c.x,y:o.top+l.scrollTop-c.y,width:o.width,height:o.height}}function lHt(t){var e=new Map,i=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function n(s){i.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!i.has(l)){var c=e.get(l);c&&n(c)}}),r.push(s)}return t.forEach(function(s){i.has(s.name)||n(s)}),r}function cHt(t){var e=lHt(t);return bGt.reduce(function(i,r){return i.concat(e.filter(function(n){return n.phase===r}))},[])}function uHt(t){var e;return function(){return e||(e=new Promise(function(i){Promise.resolve().then(function(){e=void 0,i(t())})})),e}}function hHt(t){var e=t.reduce(function(i,r){var n=i[r.name];return i[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,i},{});return Object.keys(e).map(function(i){return e[i]})}var Bxe={placement:"bottom",modifiers:[],strategy:"absolute"};function jxe(){for(var t=arguments.length,e=new Array(t),i=0;i{this._rootNode=r},this._afterContentCreate=r=>{this._contentNode=r},this._updatePosition=()=>{this._popper!=null&&this._popper.update()}}initialize(){this.when(()=>{this.destroyed||(this._projector.append(document.body,this.render),this._renderAttached=!0)}),this.addHandles([_e(()=>[this.open,this.anchorElement],()=>this._buildPopper(),ii),_e(()=>[this.placement,this.offset],()=>this._setPopperOptions(),ii)])}destroy(){this.owner=null,this.anchorElement=null,this.renderContentFunction=null,this._renderAttached&&(this._projector.detach(this.render),this._renderAttached=!1),this._rootNode!=null&&(vXe(this._rootNode),this._rootNode=null),this._contentNode=null,this._popper!=null&&(this._popper.destroy(),this._popper=null)}set container(e){}set owner(e){this._set("owner",e)}get placement(){return"top"}set placement(e){mHt.has(e)?this._override("placement",e):this._clearOverride("placement")}get test(){return{rootNode:this._rootNode}}render(){var n;const{open:e,owner:i,renderContentFunction:r}=this;return X("div",{afterCreate:this._afterRootCreate,class:this.classes(Hxe.base,e?Hxe.open:null),lang:fa(),styles:gHt},X("div",{afterCreate:this._afterContentCreate,afterUpdate:this._updatePosition,dir:wZe((n=this.owner)==null?void 0:n.container)},e?r==null?void 0:r.call(i):null))}_buildPopper(){this._popper!=null&&(this._popper.destroy(),this._popper=null);const e=this._contentNode;if(e==null||!this.open||!this.renderContentFunction)return;const i=this._getAnchor();i&&(this._popper=fHt(i,e),this._setPopperOptions())}_setPopperOptions(){const{placement:e,offset:i,_popper:r}=this;r!=null&&(r.setOptions({placement:e,modifiers:[{name:"offset",options:{offset:i}}]}),r.forceUpdate())}_getAnchor(){const{anchorElement:e}=this;return x9(typeof e=="function"?e():e)}};y([w()],Hg.prototype,"anchorElement",void 0),y([w()],Hg.prototype,"container",null),y([w()],Hg.prototype,"offset",void 0),y([w()],Hg.prototype,"open",void 0),y([w()],Hg.prototype,"owner",null),y([w()],Hg.prototype,"placement",null),y([w()],Hg.prototype,"renderContentFunction",void 0),Hg=y([Z("esri.widgets.support.Popover")],Hg);const kBe=Hg,Ra="esri-date-picker",Po={base:Ra,datePicker:`${Ra}__calendar`,monthPicker:`${Ra}__month-picker`,dayPicker:`${Ra}__day-picker`,week:`${Ra}__week-item`,nearbyMonth:`${Ra}__day-item--nearby-month`,activeDay:`${Ra}__day-item--active`,today:`${Ra}__day-item--today`,selectedDay:`${Ra}__day-item--selected`,day:`${Ra}__day-item`,dayHeader:`${Ra}__day-item--header`,yearPicker:`${Ra}__year-picker`,selectedYear:`${Ra}__year-picker-item--selected`,year:`${Ra}__year-picker-item`,monthDropdown:`${Ra}__month-dropdown`,date:`${Ra}__date`,datePickerToggle:`${Ra}__calendar-toggle`,dateInput:`${Ra}__input`,dateTextInput:`${Ra}__text-input`,leadingIcon:`${Ra}__icon--leading`},yHt=new Set([" ","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Enter","Home","PageDown","PageUp"]);let yl=class extends cn{constructor(e,i){super(e,i),this._calendarNode=null,this._inputOrButtonNode=null,this._rootNode=null,this._requestDayPickerFocusOnCreate=!1,this._activeDate=null,this._calendarPopover=new kBe({owner:this,placement:"bottom-start",anchorElement:()=>this._rootNode,renderContentFunction:this._renderCalendar}),this._isOpen=!1,this.dateInputEnabled=!1,this.messages=null,this.commitOnMonthChange=!1,this.viewModel=new HG,this.disabled=!1,this.timeZone=void 0,this.toggle=this.toggle.bind(this)}initialize(){this.addHandles(_e(()=>{var e;return{viewModel:this.viewModel,value:(e=this.viewModel)==null?void 0:e.value}},({viewModel:e,value:i})=>{!this.destroyed&&e&&this.onChange!=null&&this.onChange(i)},Li))}destroy(){this._calendarPopover.destroy()}get _dateTimeFormatOptions(){return{year:"numeric",month:"2-digit",day:"2-digit",timeZone:this.timeZone||void 0}}get value(){return this.viewModel.value}set value(e){this.viewModel.value=e}get isOpen(){return this._isOpen}render(){return X("div",{afterCreate:Vv,bind:this,class:this.classes(Po.base,tt.widget),"data-node-ref":"_rootNode"},this.dateInputEnabled?this._renderInputAndButtonMode():this._renderButtonOnlyMode())}toggle(){this._isOpen?this.close():this.open()}open(e=!0){this._activeDate=$i.fromJSDate(this.viewModel.value),this._isOpen=!0,this._calendarPopover.open=!0,this._requestDayPickerFocusOnCreate=e}close(e=!0){var i;this._activeDate=null,this._isOpen=!1,this._calendarPopover.open=!1,e&&((i=this._inputOrButtonNode)==null||i.focus())}_renderButtonOnlyMode(){const e=js(this.viewModel.value,this._dateTimeFormatOptions),{disabled:i,_isOpen:r,messages:n}=this;return X("div",{afterCreate:Vv,"aria-controls":r?this._getCalendarId():null,"aria-expanded":r.toString(),"aria-haspopup":"true","aria-label":n.setDate,"aria-pressed":r.toString(),bind:this,class:this.classes(tt.widgetButton,tt.select,Po.datePickerToggle),"data-node-ref":"_inputOrButtonNode",key:`date-button-${i}`,onclick:this.toggle,onkeydown:this._handleDateButtonKeyDown,role:"button",tabIndex:i?void 0:0},X("span",{class:Po.date},e))}_renderInputAndButtonMode(){const e=js(this.viewModel.value,this._dateTimeFormatOptions),{_isOpen:i,messages:r}=this;return X("div",{class:this.classes(Po.dateInput)},X("input",{afterCreate:Vv,"aria-controls":i?this._getCalendarId():null,"aria-haspopup":"true","aria-label":r.setDate,bind:this,class:this.classes(Po.dateTextInput,tt.input),"data-node-ref":"_inputOrButtonNode",key:"date-input",onblur:this._handleDateInputBlur,onclick:this._handleDateInputClick,onkeydown:this._handleDateInputKeyDown,type:"text",value:e}),X("span",{"aria-hidden":"true",class:this.classes(Po.leadingIcon,si.calendar)}))}_handleDateInputClick(){this.open(!1)}_handleDateInputKeyDown(e){const{key:i}=e;this._isOpen?i==="Enter"?this._handleDateText(e):i==="Escape"&&this.close():i==="ArrowDown"&&(this.open(),e.preventDefault())}_handleDateButtonKeyDown(e){const{key:i,shiftKey:r}=e;this._isOpen&&i==="Tab"&&r?this.close():bM(i)&&this.toggle()}_handleDateInputBlur(e){this._isOpen||this._handleDateText(e)}_handleDateText(e){const i=e.currentTarget;let r;try{r=oGt(i.value,this._dateTimeFormatOptions)}catch(s){return Ce.getLogger(this).warn(s),void(i.value=js(this.viewModel.value,this._dateTimeFormatOptions))}const n=$i.fromObject(r);n.isValid?(this.viewModel.value=n.toJSDate(),this._activeDate=n):i.value=js(this.viewModel.value,this._dateTimeFormatOptions)}_handleDatePickerKeydown(e){Sf(e)==="Escape"&&(this.close(),e.preventDefault(),e.stopPropagation())}_renderCalendar(){const e=this._activeDate;if(!e)return null;const i=$i.fromJSDate(this.viewModel.value);return X("div",{afterCreate:Vv,bind:this,class:this.classes(Po.datePicker,tt.widget),"data-node-ref":"_calendarNode",id:this._getCalendarId(),key:"esri-date-picker__calendar",onfocusout:this._onCalendarFocusOut,onkeydown:this._handleDatePickerKeydown,tabIndex:-1},this._renderMonthPicker(e),this._renderDayPicker(e,i),this._renderYearPicker(e))}_getCalendarId(){return`date-picker__calendar--${this.id}`}_onCalendarFocusOut(e){var r,n;const i=e.relatedTarget;i&&i instanceof Node&&((r=this._calendarNode)!=null&&r.contains(i)||(n=this._rootNode)!=null&&n.contains(i))||this.close(!1)}_renderMonthPicker(e){const i=RT(this.container),r=i?si.right:si.left,n=i?si.left:si.right,s=KR.months("long",{locale:fa()}).map((c,f)=>{const _=e.month-1===f;return X("option",{selected:_,value:f.toString()},c)}),{disabled:o,messages:l}=this;return X("div",{class:Po.monthPicker},X("div",{"aria-label":l.goToPreviousMonth,bind:this,class:tt.button,key:`previous-month-${o}`,onclick:this._setPreviousMonth,onkeydown:this._handlePreviousMonthKeyDown,role:"button",tabIndex:o?void 0:0,title:l.goToPreviousMonth},X("span",{"aria-hidden":"true",class:r})),X("select",{"aria-label":l.selectMonth,"aria-live":"assertive",bind:this,class:this.classes(Po.monthDropdown,tt.select),disabled:o,id:`${this.id}__month-picker`,onchange:this._setMonth,onkeydown:this._setMonth,title:l.selectMonth},s),X("div",{"aria-label":l.goToNextMonth,bind:this,class:tt.button,key:`next-month-${o}`,onclick:this._setNextMonth,onkeydown:this._setNextMonth,role:"button",tabIndex:o?void 0:0,title:l.goToNextMonth},X("span",{"aria-hidden":"true",class:n})))}_renderDayPicker(e,i){const r=this._getWeekLabels(),n=this._getDayId(e),s=this._renderMonth(e,i),{id:o,disabled:l}=this;return X("div",{afterCreate:this._handleDayPickerCreate,"aria-activedescendant":n,"aria-labelledby":`${o}__month-picker ${o}__selected-year`,bind:this,class:Po.dayPicker,id:`${o}__day-picker`,key:`day-picker-${l}`,onkeydown:this._handleDayPickerKeydown,role:"grid",tabIndex:l?void 0:0},X("div",{class:Po.week,role:"row"},r.map(c=>X("div",{"aria-label":c.name,class:this.classes(Po.day,Po.dayHeader),role:"columnheader",title:c.name},c.abbr))),s)}_getDayId(e){return`${this.id}__${js(e.valueOf(),this._dateTimeFormatOptions)}`}_handleDayPickerCreate(e){this._requestDayPickerFocusOnCreate&&(this._requestDayPickerFocusOnCreate=!1,e.focus())}_getWeekLabels(){const e=[],i={weekday:"long"},r={weekday:"narrow"};let n=$i.now().set({weekday:MBe(fa())});for(let s=0;s<7;s++)e.push({name:js(n.valueOf(),i),abbr:js(n.valueOf(),r)}),n=n.plus({day:1});return e}_handleDayPickerKeydown(e){const{ctrlKey:i,shiftKey:r}=e,n=Sf(e);if(!yHt.has(n))return;let s=this._activeDate;if(s){if(n==="ArrowLeft")s=s.minus({day:1});else if(n==="ArrowRight")s=s.plus({day:1});else if(n==="ArrowUp")s=s.minus({week:1});else if(n==="ArrowDown")s=s.plus({week:1});else if(n==="PageUp"){const o=r?"year":"month";s=s.minus({[o]:1})}else if(n==="PageDown"){const o=r?"year":"month";s=s.plus({[o]:1})}else if(n==="Home"){const o=i?"year":"month";s=s.startOf(o)}else if(n==="End"){const o=i?"year":"month";s=s.endOf(o)}else bM(n)&&(this.viewModel.value=s.toJSDate(),this.close());this._activeDate=s,e.preventDefault(),e.stopPropagation()}}_renderMonth(e,i){const r=$i.now(),n=e.startOf("month"),s=e.endOf("month"),o=6,l=7;let c=n.minus({day:lGt(fa(),n.weekday)});const f=[];for(let _=0;_{this.viewModel.toggleDayPlaying()},this._onYearPlayClick=()=>{this.viewModel.toggleYearPlaying()},this._onSeasonChange=r=>{this.viewModel.currentSeason=r.target.value},this._onSunLightingCheckboxChange=()=>{this.viewModel.toggleSunLightingEnabled()},this._onShadowCheckboxChange=()=>{this.viewModel.toggleDirectShadowsEnabled()}}get label(){var e;return((e=this.messages)==null?void 0:e.title)??""}set label(e){this._overrideIfSome("label",e)}get playSpeedMultiplier(){return this.viewModel.playSpeedMultiplier}set playSpeedMultiplier(e){this.viewModel.playSpeedMultiplier=e}get timeSliderSteps(){var e;return((e=this._timeSlider)==null?void 0:e.steps)??5}set timeSliderSteps(e){this._timeSlider.steps=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get test(){return{datePicker:this._datePicker}}get _useAmPm(){const e=this._timeSlider.viewModel.getLabelForValue(0,"tick");return e!=null&&qxe.test(e)}postInitialize(){this.viewModel.isSupported&&this.addHandles([_e(()=>this.viewModel.datePickerViewModel,e=>this._datePicker.viewModel=e,kt),_e(()=>this.viewModel.timeSliderViewModel,e=>this._timeSlider.viewModel=e,kt),_e(()=>{var e;return(e=this.visibleElements)==null?void 0:e.timezone},e=>this._timeSlider.showDropDown=e,kt),_e(()=>!this.viewModel.sunLightingEnabled,e=>{this._datePicker.disabled=e,this._timeSlider.disabled=e},kt),Mo(()=>!this.visible,()=>{var e;return(e=this._datePicker)==null?void 0:e.close(!1)},Li)])}destroy(){this._datePicker.destroy(),this._timeSlider.destroy()}render(){const{messages:e,viewModel:i,visibleElements:r}=this,n=i.isSupported;return X("div",{class:this.classes(Bc.base,tt.widget)},n?X(WI,null,r.header?X(Im,{level:this.headingLevel},e.title):null,this._renderTimeOptions(),r.datePicker?this._renderDateOrSeason():null,r.sunLightingToggle?this._renderSunLightingToggle():null,r.shadowsToggle?this._renderShadowsToggle():null):X("div",{class:Bc.panelError,key:"unsupported"},X("p",null,e.unsupported)))}loadDependencies(){return Pl({button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),checkbox:()=>we(()=>import("./calcite-checkbox-OaFCWd7i.js"),__vite__mapDeps([283,236,247,237,241,238,239])),label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238])),option:()=>we(()=>import("./calcite-option-LMeeGK3H.js"),__vite__mapDeps([285,242])),select:()=>we(()=>import("./calcite-select-0Yw6DsYN.js"),__vite__mapDeps([286,236,237,238,239,242,243,245]))})}_renderTimeOptions(){const{viewModel:e,visibleElements:i,messages:r}=this,{directShadowsEnabled:n,dayPlaying:s}=e,o=!e.sunLightingEnabled;return X("div",{class:this.classes(Bc.dayContainer,{[Bc.sliderShadowOn]:n,[Bc.sliderShadowOff]:!n,[Bc.sliderDateOn]:i.datePicker,[Bc.sliderDateOff]:!i.datePicker,[Bc.sliderAmPmOn]:this._useAmPm,[Bc.containerDisabled]:o}),key:"daylight-time-options"},this._timeSlider.render(),i.playButtons?this._renderPlayPauseButton({playing:s,disabled:o,label:r.playDay,onClick:this._onPlayDayClick}):null)}_renderDateOptions(){const{viewModel:e,visibleElements:i,messages:r}=this,{yearPlaying:n}=e,s=!e.sunLightingEnabled;return X("div",{class:this.classes(Bc.dateContainer,s&&Bc.containerDisabled),key:"daylight-date"},this._datePicker.render(),i.playButtons?this._renderPlayPauseButton({playing:n,disabled:s,label:r.playYear,onClick:this._onYearPlayClick}):null)}_renderPlayPauseButton({playing:e,disabled:i,label:r,onClick:n}){return X("calcite-button",{appearance:"solid",class:Bc.playPauseButton,disabled:i,iconStart:e?"pause-f":"play-f",label:r,onclick:n,round:!0,title:r,type:"button"})}_renderSeasonSelect(){const{messages:e,viewModel:i}=this,r=!i.sunLightingEnabled;return X("calcite-select",{class:this.classes(Bc.seasonPicker),disabled:r,label:e.season,onCalciteSelectChange:this._onSeasonChange},Ire.map(n=>X("calcite-option",{selected:i.currentSeason===n,value:n},e[n])))}_renderDateOrSeason(){return this.dateOrSeason==="date"?this._renderDateOptions():this._renderSeasonSelect()}_renderSunLightingToggle(){var i;const e=(i=this.messages)==null?void 0:i.sunLightingToggle;return X("calcite-label",{key:"date-time-toggle",layout:"inline",scale:"s",title:e==null?void 0:e.tooltip},X("calcite-checkbox",{checked:this.viewModel.sunLightingEnabled,class:Bc.sunLightingCheckbox,onCalciteCheckboxChange:this._onSunLightingCheckboxChange}),e==null?void 0:e.label)}_renderShadowsToggle(){const e=this.messages.shadowsToggle;return X("calcite-label",{key:"shadow-toggle",layout:"inline",scale:"s",title:e==null?void 0:e.tooltip},X("calcite-checkbox",{checked:this.viewModel.directShadowsEnabled,class:Bc.shadowsCheckbox,onCalciteCheckboxChange:this._onShadowCheckboxChange}),e.label)}_onPrimaryTickCreated(e,i,r){i.classList.add(...NX,tt.primaryTick),r.classList.add(...NX,tt.primaryTickLabel),r.onclick=i.onclick=this._makeGoToTime(e);const n=r.textContent,s=n!=null&&qxe.exec(n);s&&(r.innerHTML=`${s[1]}
${s[2]}
`)}_onSecondaryTickCreated(e,i){i.classList.add(...NX,tt.secondaryTick),i.onclick=this._makeGoToTime(e)}_makeGoToTime(e){return()=>{this.viewModel.timeSliderPosition=e}}};y([w(),Gr("esri/widgets/Daylight/t9n/Daylight")],zl.prototype,"messages",void 0),y([w(),Gr("esri/widgets/support/t9n/timezone")],zl.prototype,"timezoneMessages",void 0),y([w()],zl.prototype,"headingLevel",void 0),y([w()],zl.prototype,"iconClass",void 0),y([w()],zl.prototype,"icon",void 0),y([w()],zl.prototype,"label",null),y([w()],zl.prototype,"playSpeedMultiplier",null),y([w()],zl.prototype,"timeSliderSteps",null),y([w()],zl.prototype,"view",null),y([w({type:CBe})],zl.prototype,"viewModel",void 0),y([w({type:ABe,nonNullable:!0})],zl.prototype,"visibleElements",void 0),y([w({cast:t=>t==="season"||t==="date"?t:(Ce.getLogger(Wxe).warn(`"${t}" is not a valid option. Acceptable values are only "date" or "season". Defaulting to "${kre}".`),kre)})],zl.prototype,"dateOrSeason",void 0),y([w()],zl.prototype,"_timeSlider",void 0),y([w()],zl.prototype,"_useAmPm",null),y([w()],zl.prototype,"_datePicker",void 0),zl=y([Z(Wxe)],zl);const NX=["esri-interactive","esri-widget__anchor"],vHt=zl,_Ht=t=>new vHt({view:t,visible:!0,container:"daylight-container"});function Sm(t){let e,i,r=[],n=!1;function s(...o){return n&&e===this&&bHt(o,r)||(i=t.apply(this,o),e=this,r=o,n=!0),i}return s}function bHt(t,e){if(t.length!==e.length)return!1;for(let i=0;i{l=0,t.apply(r,o)},f=(..._)=>{n&&n.apply(r,_),o=_,s?l||(l=setTimeout(c,s)):c()};return f.remove=()=>{l&&(clearTimeout(l),l=0)},f.forceUpdate=()=>{l&&(clearTimeout(l),c())},f.hasPendingUpdates=()=>!!l,f}var jh,Ga;(function(t){t.Disabled="disabled",t.Ready="ready",t.Creating="creating",t.Created="created",t.Selecting="selecting",t.Selected="selected"})(jh||(jh={})),function(t){t.NoValidInput="no-valid-input",t.NoVisibleProfiles="no-visible-profiles",t.InvalidGeometry="invalid-geometry",t.TooComplex="too-complex",t.InvalidElevationInfo="invalid-elevation-info",t.UnknownError="unknown-error",t.RefinedButNoChartData="refined-but-no-chart-data",t.None="none"}(Ga||(Ga={}));let UBe={noDataValue:-5e5,defaultQueryOptions:()=>({noDataValue:UBe.noDataValue,demResolution:"auto",maximumAutoTileRequests:150,ignoreInvisibleLayers:!0}),updateThrottleMillis:100,delayAfterPreviewMillis:500,defaultDemResolution:Ur(10,"centimeters","meters"),densificationMaxSamples:3e3,largeChartSamples:1e4,maxTotalSamples:1e5,maxChartRatio:300,minSlopeSampleDistance:10,formatPrecision:1,portraitModePixelBreakpoint:400,profileLinesStyle3D:{width:3,outlineSize:0,falloff:0,outlineColor:YB([1,1,1,0]),renderOccluded:Wn.Opaque},hoveredPointsStyle:{size:14,borderStyle:"solid",borderWidth:3,borderColor:"#ffffff",boxShadow:"0px 0px 0px 5px rgba(255,255,255,0.2)"}};function kf(){return UBe}const xHt=" ― ",SHt={progress:1,hasZ:!1,samples:[],statistics:null,spatialReference:null},VBe="ProfileGenerationError";var Af;(function(t){t.TooComplex="too-complex",t.InvalidGeometry="invalid-geometry",t.InvalidElevationInfo="invalid-elevation-info",t.ElevationQueryError="elevation-query-error"})(Af||(Af={}));let LO=class extends Error{constructor(e){super("profile could not be generated",{cause:e}),this.type=VBe}};function THt(t){return t.type===VBe}async function EHt(t,e,i,r,n,s,o){let l,c,f;const _=t.spatialReference,x=_.isGeographic||_.isWebMercator;let T=0;if(!x){const{planarLength:M}=await we(()=>import("./geometryEngineAsync-QjQc0riy.js"),__vite__mapDeps([]));St(o),T=await M(t,"meters"),St(o)}const A=1/ws(r);if(x||T>=n.geodesicDistanceThreshold){await y_([{source:_,dest:r},{source:_,dest:at.WGS84}],o);const M=NHt(t);l=RBt([M],"meters")[0];const I=Yxe(l,n);if(Jxe(t,l,I)>s)throw new LO(Af.TooComplex);const L=Xxe(M,e,i);({densifiedPath:c,distances:f}=OHt(L,I,A)),c=rl(c,r)}else{await y_([{source:_,dest:r}],o),l=T;const M=Yxe(l,n);if(Jxe(t,l,M)>s)throw new LO(Af.TooComplex);const I=Xxe(t,e,i);({densifiedPath:c,distances:f}=MHt(I,M,A)),St(o),c=rl(c,r)}return{densifiedPath:c,pathLength:l*A,distances:f}}function Yxe(t,e){const i=t/e.densificationMaxSamples;return Math.max(e.samplingDistance,i)}function Xxe(t,e,i){if(e==null)return Zxe(t);const r=t.spatialReference,n=e.mode,s=e.offset??0;let o=null;switch(i.type){case"2d":o=CHt(t,n,s);break;case"3d":o=AHt(t,n,s,i)}return o==null?Zxe(t):new xc({hasZ:!0,hasM:!1,spatialReference:r,paths:BBe(t.paths,o)})}function CHt({hasZ:t},e,i){return e==="absolute-height"?t?([r,n,s])=>[r,n,s+i]:([r,n])=>[r,n,i]:null}function AHt({spatialReference:t,hasZ:e},i,r,{elevationProvider:n}){const s=(o,l,c,f)=>(n==null?void 0:n.getElevation(o,l,c,t,f))??0;switch(i){case"on-the-ground":return([o,l])=>[o,l,s(o,l,0,"ground")];case"absolute-height":return e?([o,l,c])=>[o,l,c+r]:([o,l])=>[o,l,r];case"relative-to-ground":return e?([o,l,c])=>[o,l,c+s(o,l,c,"ground")+r]:([o,l])=>[o,l,s(o,l,0,"ground")+r];case"relative-to-scene":return e?([o,l,c])=>[o,l,c+s(o,l,c,"scene")+r]:([o,l])=>[o,l,s(o,l,0,"scene")+r];default:return null}}function Zxe(t){return t.hasZ?new xc({hasZ:!1,hasM:!1,spatialReference:t.spatialReference,paths:BBe(t.paths,([e,i])=>[e,i])}):t}function BBe(t,e){const i=t.length,r=new Array(i);for(let n=0;n0&&t.paths.every(e=>e.length>=2)}function x6(t){return t!=null&&t.type==="polyline"}function jBe(t,e,i,r,n){const{spatialReference:s,hasZ:o}=t,l={from:null,to:null,distance:0,azimuth:0,reverseAzimuth:0,spatialReference:s,metersPerSR:ws(s)},c=[],f=[];let _=0;for(let x=0;xe+i.length,0)}function Jxe(t,e,i){return GBe(t)+Math.floor(e/i)+Math.max(0,t.paths.reduce(r=>1+r,0)-1)}function FHt(t,e){const i=t.length;if(i===0)return null;const r=t[0],n=r.sampledZ;let s=n,o=n,l=0,c=0,f=null,_=null,x=n??0,T=0,A=0,M=n!=null?1:0,I=0,L=0;const F=ws(e),z=Bf(e),k=kf().minSlopeSampleDistance/F,U=2*k,j=new Kxe,H=new Kxe,Y=()=>{ne(),j.copy(H),H.reset()},Q=(re,he)=>{Y(),re>0&&re-j.start<=U&&(re=j.start+k),H.restart(re,he)},ne=()=>{if(j.isHole||H.isHole)return;const re=H.avgElevation-j.avgElevation,he=H.start-j.start,ce=re*z,be=he*F,ye=Ur(Math.atan2(ce,be),"radians","degrees");ye>0?(T+=ye,f=Wv(f,ye),I++):ye<0&&(A-=ye,_=Wv(_,-ye),L++)};r.sampledZ!=null&&Q(r.distance,r.sampledZ);for(let re=1;re=k?Q(ce.distance,be):H.insert(be);const ye=he.sampledZ;if(ye!=null){const pe=be-ye;pe>0?l+=pe:pe<0&&(c-=pe)}}return Y(),M===0?null:{maxDistance:t[i-1].distance,minElevation:s,maxElevation:o,avgElevation:M===0?null:x/M,elevationGain:l,elevationLoss:c,maxPositiveSlope:f,maxNegativeSlope:_,avgPositiveSlope:I===0?null:T/I,avgNegativeSlope:L===0?null:A/L}}function kHt(t){const e=t.filter(ys),i=e.length;if(i===0)return null;const r=e[0];if(i===1)return r;let n=r.maxDistance,s=r.minElevation,o=r.maxElevation,l=r.maxPositiveSlope,c=r.maxNegativeSlope;for(let f=1;f=e||(i.push(t),e-t<2))return i;const r=e-1;i.push(r);const n=zre(t+1,r);for(;;){const s=n.next();if(s.done)break;i.push(s.value)}return i}function*zre(t,e){if(t>=e)return;const i=t+Math.floor((e-t)/2);yield i;const r=zre(t,i),n=zre(i+1,e);for(;;){const s=r.next(),o=n.next();if(s.done&&o.done)break;s.done||(yield s.value),o.done||(yield o.value)}}async function*UHt(t,e){const{view:i,geometry:r,elevationInfo:n,providers:s,options:o}=t,l=i.spatialReference;if(!l||r==null||!Hue(r))throw new LO(Af.InvalidGeometry);const c=s.length;if(c===0)return null;const f=Math.round(o.maxTotalSamples/c);if(GBe(r)>f)throw new LO(Af.TooComplex);const _=await EHt(r,n,i,l,o,f,e);let x=0;const T=new Array(c),A=new Array(c);for(let L=0;Lo.maxTotalSamples)throw new LO(Af.TooComplex);const M=await Promise.all(A.map(L=>{const F=L.next();return F.done===!0?Promise.resolve(null):F.value}));St(e);for(let L=0;L{var F;return(F=L.return)==null?void 0:F.call(L)})}for(const{resultPromise:L,index:F}of I)T[F]=await L,St(e),yield T;for(const L of T)L!=null&&(L.progress=1);yield T}function*VHt(t,e){const{densificationResult:i}=t,r={...t,abortOptions:e,densificationResult:i},n=HBe(0,r.result.samples.length),s=n.slice(0,r.provider.numSamplesForPreview);yield Qxe(r,s,!0);const o=L3e(n,r.provider.numSamplesPerChunk);for(const l of o)yield Qxe(r,l,!1)}async function Qxe({densificationResult:t,result:e,provider:i,queue:r,abortOptions:n,cache:s},o,l){const{densifiedPath:c,pathLength:f}=t,_=e.spatialReference,{samples:x}=e,T=[];for(let A=0;A{St(e.queryOptions);try{await jHt(e)}catch(i){XX(i)}}})}async function jHt({geometry:t,provider:e,indices:i,preview:r,result:n,queryOptions:s}){if(i.length===0)return;const o=(await XHt(e,t,s)).geometry,{hasZ:l,points:c}=o,f=s.noDataValue,{samples:_}=n;for(let x=0;x({stationary:i,visibleProfiles:r,generationParameters:n})),this._getGenerationParametersMemoized=Sm((i,r,n,s,o,l,c)=>x6(r)&&Hue(r)&&s!=null?{view:i,geometry:r,elevationInfo:n,options:l,queue:s,cache:o,slicePlane:c}:null),this._getElevationInfoMemoized=Sm((i,r)=>({mode:i,offset:r})),this._getOptionsMemoized=Sm((i,r,n)=>{const{densificationMaxSamples:s,maxTotalSamples:o}=kf();return{geodesicDistanceThreshold:i,samplingDistance:r,densificationMaxSamples:Math.round(s/n),maxTotalSamples:o}}),this._updateThrottled=kV(i=>$m(this._update(i)),kf().updateThrottleMillis)}initialize(){const e=this.viewModel;this.addHandles([_e(()=>e.profiles.toArray(),i=>{this._abortUpdate(),this._paramsPerProfile.clear(),this.removeHandles(t3e),this.addHandles(i.map(r=>id([r.attach(this.viewModel),r.on("change",()=>{this._invalidateProfile(r)})])),t3e)},kt),this._updateThrottled,_e(()=>this._updateParameters,this._updateThrottled,kt)])}destroy(){this._paramsPerProfile.clear()}get _updateParameters(){const{viewModel:e}=this,i=e.view;return this._getUpdateParametersMemoized(i==null||i.stationary,this.viewModel.visibleProfiles,this._generationParameters)}get _generationParameters(){const{view:e,input:i,queue:r,tileCache:n}=this.viewModel;return e!=null&&e.ready?this._getGenerationParametersMemoized(e,i==null?void 0:i.geometry,this._elevationInfo,r,n,this._options,e.type==="3d"?e.slicePlane:null):null}get _elevationInfo(){const e=this.viewModel.input,i=e?ij(e)?null:_Pe(e):null;return i!=null?this._getElevationInfoMemoized(i.mode,i.offset):null}get _options(){const e=this.viewModel,i=e.visibleProfiles.length;let r=e.minDemResolution??kf().defaultDemResolution;return r=parseFloat(r.toFixed(2)),this._getOptionsMemoized(e.geodesicDistanceThreshold,r,i)}async _update({stationary:e,visibleProfiles:i,generationParameters:r}){this._abortUpdate(),e&&(r!=null?this._updateTask=Cc(async n=>{this.viewModel.error=null;const s=i.filter(l=>!this._isProfileValid(l,r)),o=UHt({...r,providers:s},{signal:n});try{for await(const l of o){St(n),this._clearInvalidResults(r);for(let c=0;c{c.result=null})}}):this._clearResults())}_abortUpdate(){this._updateTask=gn(this._updateTask)}_isProfileValid(e,i){return this._paramsPerProfile.has(e)&&this._paramsPerProfile.get(e)===i}_invalidateProfile(e){this._paramsPerProfile.delete(e),this._updateThrottled(this._updateParameters)}_clearInvalidResults(e){for(const i of this.viewModel.profiles.items)this._isProfileValid(i,e)||(i.result=null,this._paramsPerProfile.delete(i))}_clearResults(){for(const e of this.viewModel.profiles.items)e.result=null,this._paramsPerProfile.delete(e)}};y([w({nonNullable:!0})],Tw.prototype,"viewModel",void 0),y([w()],Tw.prototype,"_updateParameters",null),y([w()],Tw.prototype,"_generationParameters",null),y([w()],Tw.prototype,"_elevationInfo",null),y([w()],Tw.prototype,"_options",null),Tw=y([Z("esri.widgets.ElevationProfile.ElevationProfileController")],Tw);function ZHt(t,e){if(t==null||e==null)return null;const{samples:i,spatialReference:r}=t,{distance:n,elevation:s}=e,o=ws(r),l=Bf(r),c=i.length,f=new Array(c);for(let _=0;_ZHt(i,r)),this._getStatisticsMemoized=Sm((i,r)=>JHt(i,r)),this.viewVisualizationEnabled=!0,this.result=null,this.effectiveUnits=null,this.numSamplesForPreview=30,this.numSamplesPerChunk=200,this.chartFillEnabled=!0,this.chartStrokeWidth=1.5,this.chartStrokeOffsetY=0,this._viewModel=null}get progress(){return this.result!=null&&this.visible?this.result.progress:0}get samples(){return this._getSamplesMemoized(this.result,this.effectiveUnits)}get statistics(){return this._getStatisticsMemoized(this.result,this.effectiveUnits)}get hoveredPoint(){var i;const e=(i=this._viewModel)==null?void 0:i.hoveredChartPosition;return e!=null?this._getPoint(e):null}get available(){return!0}get hasZ(){const e=this.result;return e!=null&&e.hasZ}get minDemResolution(){return kf().defaultDemResolution}queryElevation(){throw new Error("not implemented")}attach(e){return this._viewModel=e,id([_e(()=>e.effectiveUnits,i=>{this.effectiveUnits=i},kt),_e(()=>[e.input],()=>this._onChange(),Li)])}toggleVisibility(e){this.visible=e===void 0?!this.visible:e}_onChange(){this.emit("change")}_getPoint(e){const{samples:i,result:r}=this;if(i==null||r==null)return null;const n=i.length;if(n===0)return null;const s=i[n-1].distance,o=Pje(i,e*s,_=>_.distance);if(o==null)return null;const{x:l,y:c,z:f}=o;return f==null?null:new mt({x:l,y:c,z:f,spatialReference:r.spatialReference})}};y([w({nonNullable:!0})],Wo.prototype,"id",void 0),y([w({nonNullable:!0})],Wo.prototype,"title",void 0),y([w({type:qe,nonNullable:!0})],Wo.prototype,"color",void 0),y([w({nonNullable:!0})],Wo.prototype,"visible",void 0),y([w({readOnly:!0})],Wo.prototype,"progress",null),y([w({readOnly:!0})],Wo.prototype,"samples",null),y([w({readOnly:!0})],Wo.prototype,"statistics",null),y([w()],Wo.prototype,"hoveredPoint",null),y([w()],Wo.prototype,"viewVisualizationEnabled",void 0),y([w()],Wo.prototype,"available",null),y([w()],Wo.prototype,"result",void 0),y([w()],Wo.prototype,"effectiveUnits",void 0),y([w()],Wo.prototype,"numSamplesForPreview",void 0),y([w()],Wo.prototype,"numSamplesPerChunk",void 0),y([w()],Wo.prototype,"chartFillEnabled",void 0),y([w()],Wo.prototype,"chartStrokeWidth",void 0),y([w()],Wo.prototype,"chartStrokeOffsetY",void 0),y([w({readOnly:!0})],Wo.prototype,"hasZ",null),y([w({readOnly:!0})],Wo.prototype,"minDemResolution",null),y([w()],Wo.prototype,"_viewModel",void 0),Wo=y([Z("esri.widgets.ElevationProfile.ElevationProfileLine")],Wo);const S6=Wo;function WBe(t){if(t==null)return null;if(t instanceof h5)return YBe(t);const e=t.tileInfo;if(e==null)return null;const i=Sje(e.lods);return i==null?null:i.resolution*ws(e.spatialReference)}function YBe(t){if(t==null)return null;const e=t.layers.items.map(KHt).filter(ys);return $3e(e)??null}function KHt(t){return t&&"tileInfo"in t?WBe(t):null}let qg=class extends S6{constructor(e){super(e),this.type="ground",this.color=new qe("#ff7f00"),this.viewVisualizationEnabled=!0,this.numSamplesForPreview=50,this.numSamplesPerChunk=1e3,this._getQueryElevationDependencies=Sm((i,r)=>({ground:i,groundLayers:r}))}get available(){const e=this._ground;return e!=null&&e.layers.some(i=>i.visible)}get minDemResolution(){return YBe(this._ground)}get _queryElevationDependencies(){return this._getQueryElevationDependencies(this._ground,this._groundLayers)}get _ground(){var e,i,r;return(r=(i=(e=this._viewModel)==null?void 0:e.view)==null?void 0:i.map)==null?void 0:r.ground}get _groundLayers(){var e,i;return((i=(e=this._ground)==null?void 0:e.layers)==null?void 0:i.toArray())??[]}async queryElevation(e,i){const r=this._queryElevationDependencies;if(r==null)throw new Error("ElevationProfileLineGround: no dependencies");const{ground:n}=r;if(n==null)throw new Error("No ground configured in the view");const s=await n.queryElevation(e,i),o=Bf(e.spatialReference),l=Bf(n.layers.at(0).spatialReference);if(o!==l){const c=s.geometry;c.points=c.points.map(([f,_,x])=>[f,_,x===i.noDataValue?x:x*l/o])}return s}attach(e){return id([super.attach(e),_e(()=>this._queryElevationDependencies,()=>this._onChange())])}};y([w({type:qe,nonNullable:!0})],qg.prototype,"color",void 0),y([w()],qg.prototype,"viewVisualizationEnabled",void 0),y([w()],qg.prototype,"available",null),y([w({readOnly:!0})],qg.prototype,"minDemResolution",null),y([w()],qg.prototype,"_queryElevationDependencies",null),y([w()],qg.prototype,"_ground",null),y([w()],qg.prototype,"_groundLayers",null),qg=y([Z("esri.widgets.ElevationProfile.ElevationProfileLineGround")],qg);const XBe=qg;let i3e=class{constructor(e,i=null){if(this.tile=e,i!=null&&e!=null){const r=e.extent;this._samplerData=new oFe(i,r)}}get zmin(){return this._samplerData!=null?this._samplerData.data.minValue:0}get zmax(){return this._samplerData!=null?this._samplerData.data.maxValue:0}sample(e,i){if(this._samplerData==null)return;const{safeWidth:r,data:n,dx:s,dy:o,y1:l,x0:c}=this._samplerData,{width:f,values:_,noDataValue:x}=n,T=r3e(o*(l-i),0,r),A=r3e(s*(e-c),0,r),M=Math.floor(T),I=Math.floor(A),L=M*f+I,F=L+f,z=_[L],k=_[F],U=_[L+1],j=_[F+1];if(z!==x&&k!==x&&U!==x&&j!==x){const H=A-I,Y=z+(U-z)*H;return Y+(k+(j-k)*H-Y)*(T-M)}}};function r3e(t,e,i){return ti?i:t}let QHt=class{async queryAll(e,i,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(f=>f.visible):e.slice()).length)throw new se("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const n=sT.fromGeometry(i);let s=!1;r&&r.returnSampleInfo||(s=!0);const o={...l7,...r,returnSampleInfo:!0},l=await this.query(e[e.length-1],n,o),c=await this._queryAllContinue(e,l,o);return c.geometry=c.geometry.export(),s&&delete c.sampleInfo,c}async query(e,i,r){if(!e)throw new se("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!i||!(i instanceof sT)&&i.type!=="point"&&i.type!=="multipoint"&&i.type!=="polyline")throw new se("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const n={...l7,...r},s=new eqt(e,i.spatialReference,n),o=n.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(s,i,o),await this._selectTiles(s,o),await this._populateElevationTiles(s,o),this._sampleGeometryWithElevation(s),this._createQueryResult(s,o)}async createSampler(e,i,r){if(!e)throw new se("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!i||i.type!=="extent")throw new se("elevation-query:invalid-extent","Invalid or undefined extent");const n={...l7,...r};return this._createSampler(e,i,n)}async createSamplerAll(e,i,r){if(!(e=r&&r.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new se("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!i||i.type!=="extent")throw new se("elevation-query:invalid-extent","Invalid or undefined extent");const n={...l7,...r,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],i,n);return this._createSamplerAllContinue(e,i,s,n)}async _createSampler(e,i,r,n){const s=r.signal;await e.load({signal:s});const o=i.spatialReference,l=e.tileInfo.spatialReference;o.equals(l)||(await y_([{source:o,dest:l}],{signal:s}),i=rl(i,l));const c=new tqt(e,i,r,n);return await this._selectTiles(c,s),await this._populateElevationTiles(c,s),new Z0e(c.elevationTiles,c.layer.tileInfo,c.options.noDataValue)}async _createSamplerAllContinue(e,i,r,n){if(e.pop(),!e.length)return r;const s=r.samplers.map(f=>ase(f.extent)),o=await this._createSampler(e[e.length-1],i,n,s);if(o.samplers.length===0)return r;const l=r.samplers.concat(o.samplers),c=new Z0e(l,n.noDataValue);return this._createSamplerAllContinue(e,i,c,n)}async _queryAllContinue(e,i,r){const n=e.pop(),s=i.geometry.coordinates,o=i.sampleInfo;ky(o);const l=[],c=[];for(let T=0;T=0?A.source||(A.source=n):e.length&&(l.push(s[T]),c.push(T))}if(!e.length||l.length===0)return i;const f=i.geometry.clone(l),_=await this.query(e[e.length-1],f,r),x=_.sampleInfo;if(!x)throw new Error("no sampleInfo");return c.forEach((T,A)=>{s[T].z=_.geometry.coordinates[A].z,o[T].demResolution=x[A].demResolution}),this._queryAllContinue(e,i,r)}async _createQueryResult(e,i){const r=await e.geometry.project(e.outSpatialReference,i);ky(r);const n={geometry:r.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(n.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(s=>{s.tile=null,s.elevationTile=null}),n}async _createGeometryDescriptor(e,i,r){let n;const s=e.layer.tileInfo.spatialReference;if(i instanceof sT?n=await i.project(s,r):(await y_([{source:i.spatialReference,dest:s}],{signal:r}),n=rl(i,s)),!n)throw new se("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${i.spatialReference.wkid}' on an elevation service in '${s.wkid}'`);e.geometry=sT.fromGeometry(n)}async _selectTiles(e,i){e.type==="geometry"&&this._preselectOutsideLayerExtent(e);const r=e.options.demResolution;if(typeof r=="number")this._selectTilesClosestResolution(e,r);else if(r==="finest-contiguous")await this._selectTilesFinestContiguous(e,i);else{if(r!=="auto")throw new se("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${r}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,i)}}_preselectOutsideLayerExtent(e){if(e.layer.fullExtent==null)return;const i=new i3e(null);i.sample=()=>e.options.noDataValue,e.outsideExtentTile=i;const r=e.layer.fullExtent;e.geometry.coordinates.forEach(n=>{const s=n.x,o=n.y;(sr.xmax||or.ymax)&&(n.elevationTile=i)})}_selectTilesClosestResolution(e,i){const r=this._findNearestDemResolutionLODIndex(e,i);e.selectTilesAtLOD(r)}_findNearestDemResolutionLODIndex(e,i){const{tileInfo:r,tilemapCache:n}=e.layer,s=i/ws(r.spatialReference),o=a9(r,n);let l=o[0],c=0;for(let f=1;fs.fetchAvailability(l.level,l.row,l.col,{signal:r}))),r);else if(await this._populateElevationTiles(e,r),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new se("elevation-query:has-unavailable-tiles")}catch(l){zo(l),await this._selectTilesFinestContiguousAt(e,i-1,r)}}async _populateElevationTiles(e,i){const r=e.getTilesToFetch(),n={},s=e.options.cache,o=e.options.noDataValue,l=r.map(async c=>{if(c.id==null)return;const f=`${e.layer.uid}:${c.id}:${o}`,_=s!=null?s.get(f):null,x=_??await e.layer.fetchTile(c.level,c.row,c.col,{noDataValue:o,signal:i});s!=null&&s.put(f,x),n[c.id]=new i3e(c,x)});await oT(Promise.allSettled(l),i),e.populateElevationTiles(n)}async _selectTilesAuto(e,i){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const r=e.layer.tilemapCache;if(!r||Vre(r))return this._selectTilesAutoPrefetchUpsample(e,i);const n=e.getTilesToFetch(),s={},o=n.map(async l=>{const c=new Tj(null,0,0,0,Ni()),f=await Ju(r.fetchAvailabilityUpsample(l.level,l.row,l.col,c,{signal:i}));f.ok!==!1?l.id!=null&&(s[l.id]=c):zo(f.error)});await oT(Promise.all(o),i),e.remapTiles(s)}_reduceTilesForMaximumRequests(e){const i=e.layer.tileInfo;let r=0;const n={},s=c=>{c.id!=null&&(c.id in n?n[c.id]++:(n[c.id]=1,r++))},o=c=>{if(c.id==null)return;const f=n[c.id];f===1?(delete n[c.id],r--):n[c.id]=f-1};e.forEachTileToFetch(s,o);let l=!0;for(;l&&(l=!1,e.forEachTileToFetch(c=>{r<=e.options.maximumAutoTileRequests||(o(c),i.upsampleTile(c)&&(l=!0),s(c))},o),l););}_selectTilesAutoFinest(e){const{tileInfo:i,tilemapCache:r}=e.layer,n=Ure(i,r,e.options.minDemResolution);e.selectTilesAtLOD(n,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,i){const r=e.layer.tileInfo;await this._populateElevationTiles(e,i);let n=!1;e.forEachTileToFetch((s,o)=>{r.upsampleTile(s)?n=!0:o()}),n&&await this._selectTilesAutoPrefetchUpsample(e,i)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(i=>{const r=i.elevationTile;let n=e.options.noDataValue;if(r){const s=r.sample(i.x,i.y);s!=null?n=s:i.elevationTile=null}i.z=n})}_extractSampleInfo(e){const i=e.layer.tileInfo,r=ws(i.spatialReference);return e.geometry.coordinates.map(n=>{let s=-1;return n.elevationTile&&n.elevationTile!==e.outsideExtentTile&&(s=i.lodAt(n.elevationTile.tile.level).resolution*r),{demResolution:s}})}},sT=class kk{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const i=new kk;return i.geometry=this.geometry,i.spatialReference=this.spatialReference,i.coordinates=e||this.coordinates.map(r=>r.clone()),i._exporter=this._exporter,i}async project(e,i){if(this.spatialReference.equals(e))return this.clone();await y_([{source:this.spatialReference,dest:e}],{signal:i});const r=new Cm({spatialReference:this.spatialReference,points:this.coordinates.map(l=>[l.x,l.y])}),n=rl(r,e);if(!n)return null;const s=this.coordinates.map((l,c)=>{const f=l.clone(),_=n.points[c];return f.x=_[0],f.y=_[1],f}),o=this.clone(s);return o.spatialReference=e,o}static fromGeometry(e){const i=new kk;if(i.geometry=e,i.spatialReference=e.spatialReference,e instanceof kk)i.coordinates=e.coordinates.map(r=>r.clone()),i._exporter=(r,n)=>{const s=e.clone(r);return s.spatialReference=n,s};else switch(e.type){case"point":{const r=e,{hasZ:n,hasM:s}=r;i.coordinates=n&&s?[new zp(r.x,r.y,r.z,r.m)]:n?[new zp(r.x,r.y,r.z)]:s?[new zp(r.x,r.y,null,r.m)]:[new zp(r.x,r.y)],i._exporter=(o,l)=>e.hasM?new mt(o[0].x,o[0].y,o[0].z,o[0].m,l):new mt(o[0].x,o[0].y,o[0].z,l);break}case"multipoint":{const r=e,{hasZ:n,hasM:s}=r;i.coordinates=n&&s?r.points.map(o=>new zp(o[0],o[1],o[2],o[3])):n?r.points.map(o=>new zp(o[0],o[1],o[2])):s?r.points.map(o=>new zp(o[0],o[1],null,o[2])):r.points.map(o=>new zp(o[0],o[1])),i._exporter=(o,l)=>e.hasM?new Cm({points:o.map(c=>[c.x,c.y,c.z,c.m]),hasZ:!0,hasM:!0,spatiaReference:l}):new Cm(o.map(c=>[c.x,c.y,c.z]),l);break}case"polyline":{const r=e,n=[],s=[],{hasZ:o,hasM:l}=e;let c=0;for(const f of r.paths)if(s.push([c,c+f.length]),c+=f.length,o&&l)for(const _ of f)n.push(new zp(_[0],_[1],_[2],_[3]));else if(o)for(const _ of f)n.push(new zp(_[0],_[1],_[2]));else if(l)for(const _ of f)n.push(new zp(_[0],_[1],null,_[2]));else for(const _ of f)n.push(new zp(_[0],_[1]));i.coordinates=n,i._exporter=(f,_)=>{const x=e.hasM?f.map(A=>[A.x,A.y,A.z,A.m]):f.map(A=>[A.x,A.y,A.z]),T=s.map(A=>x.slice(A[0],A[1]));return new xc({paths:T,hasM:e.hasM,hasZ:!0,spatialReference:_})};break}}return i}},zp=class ZBe{constructor(e,i,r=null,n=null,s=null,o=null){this.x=e,this.y=i,this.z=r,this.m=n,this.tile=s,this.elevationTile=o}clone(){return new ZBe(this.x,this.y,this.z,this.m)}},JBe=class{constructor(e,i){this.layer=e,this.options=i}},eqt=class extends JBe{constructor(e,i,r){super(e,r),this.outSpatialReference=i,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(i=>i.tile=null);else{const{tileInfo:i,tilemapCache:r}=this.layer,n=a9(i,r)[e].level;this.geometry.coordinates.forEach(s=>s.tile=i.tileAt(n,s.x,s.y))}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){var i;for(const r of this.geometry.coordinates)!r.elevationTile&&((i=r.tile)!=null&&i.id)&&(r.elevationTile=e[r.tile.id])}remapTiles(e){var i;for(const r of this.geometry.coordinates){const n=(i=r.tile)==null?void 0:i.id;r.tile=n?e[n]:null}}getTilesToFetch(){var r;const e={},i=[];for(const n of this.geometry.coordinates){const s=n.tile;if(!s)continue;const o=(r=n.tile)==null?void 0:r.id;n.elevationTile||!o||e[o]||(e[o]=s,i.push(s))}return i}forEachTileToFetch(e){for(const i of this.geometry.coordinates)i.tile&&!i.elevationTile&&e(i.tile,()=>{i.tile=null})}},tqt=class extends JBe{constructor(e,i,r,n){super(e,r),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=i.intersection(e.fullExtent),this.maskExtents=n}selectTilesAtLOD(e,i){const r=this._maximumLodForRequests(i),n=Math.min(r,e);n<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(n)}_maximumLodForRequests(e){const{tileInfo:i,tilemapCache:r}=this.layer,n=a9(i,r);if(!e)return n.length-1;const s=this.extent;if(s==null)return-1;for(let o=n.length-1;o>=0;o--){const l=n[o],c=l.resolution*i.size[0],f=l.resolution*i.size[1];if(Math.ceil(s.width/c)*Math.ceil(s.height/f)<=e)return o}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const i of this._candidateTiles){const r=i.id&&e[i.id];r&&(this._fetchedCandidates.add(i),this.elevationTiles.push(r))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(i=>e[i.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,i){const r=this._candidateTiles;this._candidateTiles=[],r.forEach(n=>{if(this._fetchedCandidates.has(n))return void(i&&i(n));let s=!1;e(n,()=>s=!0),s?i&&i(n):this._candidateTiles.push(n)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,i)}_uniqueNonOverlappingTiles(e,i){const r={},n=[];for(const o of e){const l=o.id;l&&!r[l]?(r[l]=o,n.push(o)):i&&i(o)}const s=n.sort((o,l)=>o.level-l.level);return s.filter((o,l)=>{for(let c=0;ce.extent&&Nz(i,e.extent))}};function Ure(t,e,i=0){const r=a9(t,e);let n=r.length-1;if(i>0){const s=i/ws(t.spatialReference),o=r.findIndex(l=>l.resolution0&&(n=o-1)}return n}const l7={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};function a9(t,e){const i=t.lods;if(Vre(e)){const{effectiveMinLOD:r,effectiveMaxLOD:n}=e;return i.filter(s=>s.level>=r&&s.level<=n)}return i}function Vre(t){return(t==null?void 0:t.tileInfo)!=null}const zV=Object.freeze(Object.defineProperty({__proto__:null,ElevationQuery:QHt,GeometryDescriptor:sT,getFinestLodIndex:Ure},Symbol.toStringTag,{value:"Module"}));let yv=class extends S6{constructor(e){super(e),this.type="input",this.color=new qe("#00c8c8"),this.viewVisualizationEnabled=!1,this.numSamplesForPreview=50,this.numSamplesPerChunk=500,this.chartFillEnabled=!1,this.chartStrokeOffsetY=-1,this._getQueryElevationDependencies=Sm((i,r,n,s,o)=>i?{elevationInfo:i,visibleLayers:r,view:n,stationary:s,spatialReference:o}:null)}get queryElevationDependencies(){var i;const e=(i=this._viewModel)==null?void 0:i.view;return e==null?null:this._getQueryElevationDependencies(this._elevationInfo,this._visibleLayers,e,e.stationary,e.spatialReference)}get available(){var e;return!((e=this._viewModel)!=null&&e.inputIsSketched)}get _elevationInfo(){var i;const e=(i=this._viewModel)==null?void 0:i.input;return e?_Pe(e):null}get _visibleLayers(){var e,i,r,n;return((n=(r=(i=(e=this._viewModel)==null?void 0:e.view)==null?void 0:i.map)==null?void 0:r.allLayers)==null?void 0:n.filter(s=>s.visible).toArray())??[]}async queryElevation(e,{noDataValue:i,signal:r}){const n=this.queryElevationDependencies;if(n==null)throw new Error("ElevationProfileLineInput: no dependencies");const{view:s,elevationInfo:o,spatialReference:l}=n;if(o.mode==="on-the-ground"&&s.type==="3d"&&l){const c=await sT.fromGeometry(e).project(l,r);if(!c)return{geometry:e,noDataValue:i};const f=s.elevationProvider;return c.coordinates.forEach(_=>{_.z=f.getElevation(_.x,_.y,0,l,"ground")??0}),{geometry:c.export(),noDataValue:i}}return{geometry:e,noDataValue:i}}attach(e){const i=()=>this._onChange();return id([super.attach(e),_e(()=>this.queryElevationDependencies,i),Jr(()=>e.elevationProvider,"elevation-change",i,{onListenerAdd:i,onListenerRemove:i})])}};y([w({type:qe,nonNullable:!0})],yv.prototype,"color",void 0),y([w()],yv.prototype,"viewVisualizationEnabled",void 0),y([w()],yv.prototype,"queryElevationDependencies",null),y([w()],yv.prototype,"available",null),y([w()],yv.prototype,"_elevationInfo",null),y([w()],yv.prototype,"_visibleLayers",null),yv=y([Z("esri.widgets.ElevationProfile.ElevationProfileLineInput")],yv);const iqt=yv;let Ew=class extends S6{constructor(e){super(e),this.type="query",this.color=new qe("#db334a"),this.viewVisualizationEnabled=!0,this.source=null,this.numSamplesForPreview=50,this.numSamplesPerChunk=500}get minDemResolution(){return WBe(this.source)}get available(){const e=this.source;return!!e&&(e.visible==null||e.visible)&&(e.layers==null||e.layers.some(i=>i.visible))}queryElevation(e,i){if(!this.source)throw new Error("No source configured for the elevation profile line");return this.source.queryElevation(e,i)}attach(e){return id([super.attach(e),_e(()=>this.source,()=>this._onChange(),Li)])}};y([w({type:qe,nonNullable:!0})],Ew.prototype,"color",void 0),y([w()],Ew.prototype,"viewVisualizationEnabled",void 0),y([w()],Ew.prototype,"source",void 0),y([w({readOnly:!0})],Ew.prototype,"minDemResolution",null),y([w()],Ew.prototype,"available",null),Ew=y([Z("esri.widgets.ElevationProfile.ElevationProfileLineQuery")],Ew);const rqt=Ew,nqt=2e5;let Du=class extends S6{constructor(e){super(e),this.type="view",this.color=new qe("#cf4ccf"),this.viewVisualizationEnabled=!0,this.include=null,this.exclude=null,this.numSamplesForPreview=50,this.numSamplesPerChunk=25,this._getQueryElevationDependencies=Sm((i,r,n,s,o,l,c)=>({inputGraphicUid:i!=null?KBe(i):null,visibleLayers:r,maxIntersectionDistance:n,intersectOptions:s,view:o,stationary:l,spatialReference:c})),this._vecA=Xi(),this._vecB=Xi(),this._ray=Ko()}get minDemResolution(){var r,n,s;const e=(r=this._viewModel)==null?void 0:r.view;if(e==null||e.type!=="3d")return null;const i=(s=(n=e.pointsOfInterest)==null?void 0:n.focus)==null?void 0:s.renderLocation;return i?e.state.camera.computeRenderPixelSizeAt(i)*Bf(e.spatialReference):null}get queryElevationDependencies(){var i;const e=this._view;return e?this._getQueryElevationDependencies((i=this._viewModel)==null?void 0:i.input,this._visibleLayers,this._maxIntersectionDistance,this._intersectOptions,e,e.stationary,e.spatialReference):null}get _visibleLayers(){var e,i,r;return((r=(i=(e=this._view)==null?void 0:e.map)==null?void 0:i.allLayers)==null?void 0:r.filter(n=>n.visible).toArray())??[]}get _intersectOptions(){const e=this._view;if(e==null||e.destroyed)return{};const i=e.externalToInternalIntersectOptions({include:this.include,exclude:this.exclude}),r=e.externalToInternalIntersectOptions({exclude:this._pointCloudLayers});return i.exclude=vSe(i.exclude,r.exclude),i}get _pointCloudLayers(){const e=this._view;return e==null?[]:e.allLayerViews.toArray().filter(i=>{var r;return((r=i.layer)==null?void 0:r.type)==="point-cloud"}).map(i=>i.layer)}get _view(){var i;const e=(i=this._viewModel)==null?void 0:i.view;return e!=null&&e.type==="3d"?e:null}get _maxIntersectionDistance(){const e=this._view;return e!=null&&e.renderCoordsHelper?Sr(e.spatialReference).radius/e.renderCoordsHelper.unitInMeters:Number.POSITIVE_INFINITY}get _intersector(){const e=this._view;if(e==null)return null;const i=Tp(e.state.viewingMode),r=i.options;return r.hud=!1,r.invisibleTerrain=!1,r.backfacesTerrain=!1,r.selectionMode=!1,r.store=tl.ALL,i}async queryElevation(e,{noDataValue:i,signal:r}){const n=this.queryElevationDependencies;if(n==null)throw new Error("ElevationProfileLineInput: no dependencies");const s=this._intersector;if(s==null)throw new Error("ElevationProfileLineInput: no view");const{intersectOptions:o,view:l,spatialReference:c}=n,f=l.renderCoordsHelper,_=l.sceneIntersectionHelper,x=this._vecA,T=this._vecA,A=this._vecB,M=this._ray;if(!c)return{geometry:e,noDataValue:i};const I=await sT.fromGeometry(e).project(c,r);if(!I)return{geometry:e,noDataValue:i};const L=I.coordinates,F=L.length;for(let z=0;zthis._onChange();return id([super.attach(e),_e(()=>this.queryElevationDependencies,i),Jr(()=>e.elevationProvider,"elevation-change",i,{onListenerAdd:i,onListenerRemove:i})])}};function sqt({view:t,inputGraphicUid:e,maxIntersectionDistance:i},r){for(const n of r){if(n.distanceInRenderSpace!=null&&n.distanceInRenderSpace>i)continue;const s=A8t(n,t);if(s==null||KBe(s)!==e)return n}return null}function KBe(t){if(t.layer&&"objectIdField"in t.layer){const e=t.attributes[t.layer.objectIdField];if(e)return`o-${t.layer.id}-${e}`}return`u-${t.uid}`}y([w({type:qe,nonNullable:!0})],Du.prototype,"color",void 0),y([w()],Du.prototype,"viewVisualizationEnabled",void 0),y([w()],Du.prototype,"include",void 0),y([w()],Du.prototype,"exclude",void 0),y([w({readOnly:!0})],Du.prototype,"minDemResolution",null),y([w()],Du.prototype,"queryElevationDependencies",null),y([w()],Du.prototype,"_visibleLayers",null),y([w()],Du.prototype,"_intersectOptions",null),y([w()],Du.prototype,"_pointCloudLayers",null),y([w()],Du.prototype,"_view",null),y([w()],Du.prototype,"_maxIntersectionDistance",null),y([w()],Du.prototype,"_intersector",null),Du=y([Z("esri.widgets.ElevationProfile.ElevationProfileLineView")],Du);const oqt=Du,aqt={base:S6,key:"type",typeMap:{ground:XBe,input:iqt,query:rqt,view:oqt},errorContext:"elevation-profile-line"},lqt=it.ofType(aqt);var ps,Wd;function cqt(t){return t==="2d"?new nx({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[5,4],lineDashEnding:"FullGap",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5,color:[0,0,0,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",width:1.5,color:[255,255,255,255]}]}}}):new Oc({color:[0,0,0,0]})}(function(t){t.Ready="ready",t.Creating="creating",t.Reshaping="reshaping",t.ReshapingDisabled="rehsaping-disabled",t.Selecting="selecting",t.Selected="selected"})(ps||(ps={})),function(t){t.View="view",t.Main="main",t.Interaction="interaction"}(Wd||(Wd={}));let Ud=class extends ze{constructor(e){super(e),this.state=ps.Ready,this._pendingStartOptions=null,this._previousInputInfo=null,this._shouldRemoveLastPoint=!1,this._sketchedGraphics=new WeakSet,this._creationToolPromise=null,this._updateToolPromise=null,this._updateDisabled=!1}initialize(){this.addHandles(_e(()=>({view:this.tool.viewModel.view,visible:this.tool.visible}),({view:e,visible:i})=>{e!=null&&i?this._attach(e):this._detach()},kt),Wd.View)}destroy(){this._detach()}get canStopCreating(){const e=this._geometry,i=this._shouldRemoveLastPoint?3:2;return x6(e)&&e.paths.length>0&&e.paths[0].length>=i}get _input(){return this.tool.viewModel.input}set _input(e){this.tool.viewModel.input=e}get _geometry(){var e;return(e=this._input)==null?void 0:e.geometry}get _visibleAndEditable(){return this.tool.visible&&this.tool.editable}get _view(){return this.tool.viewModel.view}get test(){return{sketchVM:this._sketchVM,toolPromise:Promise.all([this._creationToolPromise??Promise.resolve(),this._updateToolPromise??Promise.resolve()])}}start(e={mode:"sketch"}){if(!this.tool.editable)return;const i=this._view;if(i!=null&&i.ready)switch(this._pendingStartOptions=null,this._stopInteraction(),this._previousInputInfo==null&&this._storePreviousInput(this._input),this._setSketchedGraphic(null),e.mode){case"sketch":this._set("state",ps.Creating),this._startCreationInteraction();break;case"select":this._set("state",ps.Selecting),this._startSelectionInteraction()}else this._pendingStartOptions=e}stop(){this._pendingStartOptions=null,this._stopInteractionAndUpdate(),this._clearPreviousInput()}cancel(){this._pendingStartOptions=null,this._stopInteractionAndUpdate(),this._restorePreviousInput()}clear(){this._stopInteractionAndUpdate(),this._set("state",ps.Ready),this._clearPreviousInput(),this._input=null,this._pendingStartOptions=null}isSketchedGraphic(e){return e!=null&&this._sketchedGraphics.has(e)}_attach(e){this._detach();const i={mode:e.type==="3d"?"relative-to-ground":"on-the-ground",offset:null};this._graphicsLayer=new jse({listMode:"hide",internal:!0,elevationInfo:i});const r=cqt(e.type);this._sketchVM=new TBe({layer:this._graphicsLayer,view:e,defaultCreateOptions:{mode:"click",hasZ:!1},updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{shapeOperation:"none"},enableRotation:!1,enableScaling:!1,enableMoveAllGraphics:!1,enableZ:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"reshape"},polylineSymbol:r,activeLineSymbol:r}),this.addHandles([Mo(()=>e.ready,()=>{const n=this._pendingStartOptions;n&&this.start(n)},kt),_e(()=>[this._input,this._visibleAndEditable],()=>this._update(),kt),_e(()=>({map:e.map,graphicsLayer:this._graphicsLayer}),({map:n,graphicsLayer:s})=>{n!=null&&s!=null&&n.add(s),this._update()},kt)],Wd.Main)}_detach(){var r;this.removeHandles(Wd.Main),this._sketchVM=et(this._sketchVM),this._creationToolPromise=null,this._updateToolPromise=null;const e=(r=this._view)==null?void 0:r.map,i=this._graphicsLayer;e!=null&&i!=null&&e.remove(i),this._graphicsLayer=et(this._graphicsLayer),this._shouldRemoveLastPoint=!1,this._set("state",ps.Ready)}_startCreationInteraction(){this._stopInteractionAndUpdate();const e=this._view,i=this._sketchVM;if(e==null||i==null)return;this._shouldRemoveLastPoint=!1;const r=i.on("create",s=>{var l;const o=s.graphic;switch(s.state){case"complete":this._shouldRemoveLastPoint=!1,this._setSketchedGraphic(o),this._stopInteractionAndUpdate(),this._clearPreviousInput();break;case"cancel":this.cancel();break;case"active":this._setSketchedGraphic(o),((l=s.toolEventInfo)==null?void 0:l.type)==="cursor-update"&&(this._shouldRemoveLastPoint=!0);break;case"start":this._setSketchedGraphic(o)}}),n=()=>{var l;r.remove();const s=this.canStopCreating,o=(l=this._geometry)==null?void 0:l.clone();i.cancel(),this._creationToolPromise=null,o!=null&&s?this._shouldRemoveLastPoint&&this._setSketchedGraphic(new Ml({geometry:uqt(o)})):this._input=null};this.removeHandles(Wd.Interaction),this.addHandles(rr(n),Wd.Interaction),this._creationToolPromise=$m(i.create("polyline"))}_startReshapeInteraction(){this._stopInteraction();const e=this._view,i=this._sketchVM;if(e==null||i==null)return;const r=i.on("update",o=>{const l=o.graphics[0];switch(o.state){case"complete":this._setSketchedGraphic(l),this._stopInteractionAndUpdate(),this._clearPreviousInput();break;case"active":case"start":this._setSketchedGraphic(l)}}),n=()=>{r.remove(),i.cancel(),this._updateToolPromise=null};this.removeHandles(Wd.Interaction),this.addHandles(rr(n),Wd.Interaction);const s=this._input;s&&(s.visible=!0,this._updateToolPromise=$m(i.update(s,{tool:"reshape"})))}_startSelectionInteraction(){this._stopInteraction();const e=this._view;if(e==null)return;const i=e.cursor,r=rr(()=>e.cursor=i);e.cursor="crosshair",e.closePopup();let n=null;const s=rr(()=>gn(n)),o=e.on("immediate-click",c=>{c.preventDefault(),c.stopPropagation(),gn(n),n=Cc(async f=>{const{results:_}=await e.hitTest(c);St(f);const x=_.filter(T=>T.type==="graphic"&&T.graphic!=null).map(T=>T.graphic).find(T=>T.geometry!=null&&T.geometry.type==="polyline");x&&(this._input=x,this._clearPreviousInput(),this._stopInteractionAndUpdate())})}),l=e.on("key-down",c=>{c.key==="Escape"&&this.cancel()});this.removeHandles(Wd.Interaction),this.addHandles([o,l,s,r],Wd.Interaction),e.ready&&e.focus()}_stopInteraction(){this.removeHandles(Wd.Interaction)}_stopInteractionAndUpdate(){this.hasHandles(Wd.Interaction)&&(this._updateDisabled=!0,this._stopInteraction(),this._updateDisabled=!1,this._triggerUpdate())}_triggerUpdate(){this._set("state",ps.Ready),this._update()}_update(){if(this._updateDisabled)return;const e=this.state;if(e!==ps.Selecting){if(this._visibleAndEditable){if(e===ps.Creating||e===ps.Reshaping&&this.isSketchedGraphic(this._input))return}else this.cancel();this._set("state",this._getNextState()),this._updateVisuals()}else this.stop()}_getNextState(){return this._input==null?ps.Ready:this.isSketchedGraphic(this._input)?this.state===ps.Creating?ps.Creating:this._visibleAndEditable?ps.Reshaping:ps.ReshapingDisabled:ps.Selected}_updateVisuals(){switch(this.state){case ps.Creating:break;case ps.Reshaping:this._startReshapeInteraction();break;case ps.ReshapingDisabled:{this._stopInteractionAndUpdate();const e=this._input;e!=null&&this.isSketchedGraphic(e)&&(e.visible=!1);break}case ps.Ready:case ps.Selected:this._stopInteractionAndUpdate();case ps.Selecting:}this._updateSketchedGraphic()}_storePreviousInput(e){this._previousInputInfo={graphic:e}}_restorePreviousInput(){const e=this._previousInputInfo;e!=null&&(this._clearPreviousInput(),this._input=e.graphic,this._triggerUpdate())}_clearPreviousInput(){this._previousInputInfo=null}_updateSketchedGraphic(){const e=this._graphicsLayer;if(e==null)return;const i=e.graphics,r=this._input;if(r==null||!this.isSketchedGraphic(r))return void i.removeAll();if(i.indexOf(r)===-1)i.removeAll(),i.add(r);else if(i.length!==1){const n=i.filter(s=>s!==r);i.removeMany(n)}}_setSketchedGraphic(e){e!=null&&this._sketchedGraphics.add(e),this._input=e,this._updateSketchedGraphic()}};function uqt(t){if(x6(t)){const e=t.clone();return e.paths=[e.paths[0].slice(0,-1)],e}return t}y([w({nonNullable:!0})],Ud.prototype,"state",void 0),y([w({nonNullable:!0})],Ud.prototype,"tool",void 0),y([w()],Ud.prototype,"canStopCreating",null),y([w()],Ud.prototype,"_graphicsLayer",void 0),y([w()],Ud.prototype,"_sketchVM",void 0),y([w()],Ud.prototype,"_input",null),y([w()],Ud.prototype,"_geometry",null),y([w()],Ud.prototype,"_visibleAndEditable",null),y([w()],Ud.prototype,"_view",null),y([w()],Ud.prototype,"_shouldRemoveLastPoint",void 0),Ud=y([Z("esri.widgets.ElevationProfile.ElevationProfileInteraction")],Ud);let zk=class extends ze{constructor(e){super(e),this._implementation=null,this._loadingTask=null}initialize(){this.addHandles(_e(()=>{var e;return{tool:this.tool,view:this.tool.viewModel.view,visible:this.tool.visible&&!!((e=this.tool.viewModel.view)!=null&&e.ready)}},({tool:e,view:i,visible:r})=>{i!=null&&r?this._show(i,e):this._hide()},kt))}destroy(){this._hide()}_show(e,i){this._loadingTask=gn(this._loadingTask),this._loadingTask=Cc(async r=>{if(e.type==="2d"){const n=we(()=>import("./ElevationProfileView2D-KdZmS2un.js"),__vite__mapDeps([287,288,158])),s=(await oT(n,r)).ElevationProfileView2D;this._implementation=new s(e,i)}else if(e.type==="3d"){const n=we(()=>import("./ElevationProfileView3D-bd56oGje.js"),__vite__mapDeps([289,288,158,272,18,19,20,21,22])),s=(await oT(n,r)).ElevationProfileView3D;this._implementation=new s(e,i)}})}_hide(){this._loadingTask=gn(this._loadingTask),this._implementation=et(this._implementation)}};y([w()],zk.prototype,"tool",void 0),zk=y([Z("esri.widgets.ElevationProfile.support.ElevationProfileView")],zk);let vv=class extends ze{constructor(e){super(e),this.editable=!0,this.visible=!0,this.highlightEnabled=!0}initialize(){this.view=new zk({tool:this}),this.interaction=new Ud({tool:this})}destroy(){this.interaction.destroy(),this.view.destroy()}get state(){var i;switch((i=this.interaction)==null?void 0:i.state){case ps.Ready:return jh.Ready;case ps.Creating:return jh.Creating;case ps.Selecting:return jh.Selecting;case ps.Selected:return jh.Selected;case ps.Reshaping:case ps.ReshapingDisabled:return jh.Created}}};y([w({nonNullable:!0})],vv.prototype,"viewModel",void 0),y([w()],vv.prototype,"view",void 0),y([w()],vv.prototype,"interaction",void 0),y([w()],vv.prototype,"editable",void 0),y([w()],vv.prototype,"visible",void 0),y([w()],vv.prototype,"highlightEnabled",void 0),vv=y([Z("esri.widgets.ElevationProfile.ElevationProfileTool")],vv);let un=class extends ze{constructor(e){super(e),this.view=null,this.input=null,this._getEffectiveUnitsMemoized=Sm((i,r)=>({distance:i,elevation:r})),this.geodesicDistanceThreshold=1e5,this.hoveredChartPosition=null,this.uniformChartScaling=!1,this.defaultUnit=null,this.queue=null,this._currentTileCache=null,this.error=null,this._defaultProfileLineGround=new XBe,this._userUnitOptions=null,this._userUnit=null,e!=null&&e.profiles||(this.profiles=new it([this._defaultProfileLineGround]))}initialize(){this.addHandles(_e(()=>this.view,e=>{var n;if(e==null)return void Ce.getLogger(this).warnOnce("no view. Widget will be disabled until a view is provided.");this.removeHandles(n3e);const i=e.type==="3d"?e.resourceController:void 0;(n=this.queue)==null||n.destroy(),this.queue=BHt(i==null?void 0:i.scheduler);const r=i==null?void 0:i.addUpdatingObject(this);r&&this.addHandles(r,n3e)},kt)),this.tool=new vv({viewModel:this}),this._controller=new Tw({viewModel:this})}destroy(){this._defaultProfileLineGround=et(this._defaultProfileLineGround),this._controller=et(this._controller),this._currentTileCache=et(this._currentTileCache),this.tool=et(this.tool),this.queue=et(this.queue)}get profiles(){return this._get("profiles")}set profiles(e){const i=this._get("profiles"),r=e??new it;this._set("profiles",sd(r,i))}get state(){const e=this.view;return e!=null&&e.ready?this.tool.state:jh.Disabled}get progress(){let e=0,i=0;for(const r of this.visibleProfiles)e++,i+=r.progress;return e>0?i/e:0}set unitOptions(e){this._userUnitOptions=e,this._set("unitOptions",this._filteredOrAllUnits(this._userUnitOptions))}get unitOptions(){return this._filteredOrAllUnits(this._userUnitOptions)}set unit(e){this._userUnit=e?this._findSelectableUnit(e,this._userUnit):null,this.notifyChange("unit")}get unit(){return this._userUnit?(this._userUnit=this._findSelectableUnit(this._userUnit,this.defaultUnit),this._userUnit):this._findSelectableUnit(this.defaultUnit)}get effectiveUnits(){const e=zHt(this.visibleProfiles.map(n=>n.result)),i=DKe(e.maxDistance,"meters",this.unit),r=NKe(e.maxElevation,"meters",this.unit);return this._getEffectiveUnitsMemoized(i,r)}get highlightEnabled(){return this.tool.highlightEnabled}set highlightEnabled(e){this.tool.highlightEnabled=e}get hasVertices(){var i;const e=(i=this.input)==null?void 0:i.geometry;return x6(e)&&e.paths.reduce((r,n)=>r+n.length,0)>0}get hoveredPoints(){return this.input!=null&&this.visible&&this.tool.editable?this.visibleProfiles.map(e=>{const i=e.hoveredPoint;return i!=null?{hoveredPoint:i,color:e.color}:null}).filter(ys):[]}get statistics(){return kHt(this.visibleProfiles.map(e=>e.statistics))}get chartData(){if(this.input==null)return null;const{effectiveUnits:e,progress:i,statistics:r,visibleProfiles:n,uniformChartScaling:s}=this,o=n.filter(l=>l.hasZ).map(l=>({id:l.id,type:l.type,title:l.title,color:l.color,samples:l.samples,progress:l.progress,chartFillEnabled:l.chartFillEnabled,chartStrokeWidth:l.chartStrokeWidth,chartStrokeOffsetY:l.chartStrokeOffsetY,viewVisualizationEnabled:l.viewVisualizationEnabled}));return o.length===0?null:{lines:o,effectiveUnits:e,statistics:r,refined:i===1,dynamicElevationRange:n.some(l=>l.type==="view"),uniformScaling:s}}get visibleProfiles(){return this.profiles.toArray().filter(e=>e.available&&e.visible)}get minDemResolutions(){const e=[];for(const{minDemResolution:i}of this.visibleProfiles)i!=null&&e.push(i);return e}get minDemResolution(){return $3e(this.minDemResolutions)}get errorState(){var i;const e=(i=this.input)==null?void 0:i.geometry;if(!Hue(e))return Ga.NoValidInput;if(this.error!=null){if(THt(this.error))switch(this.error.cause){case Af.TooComplex:return Ga.TooComplex;case Af.InvalidGeometry:return Ga.InvalidGeometry;case Af.InvalidElevationInfo:return Ga.InvalidElevationInfo;case Af.ElevationQueryError:return Ga.NoValidInput}return Ga.UnknownError}return this.visibleProfiles.length===0?Ga.NoVisibleProfiles:this.chartData==null&&this.progress===1?Ga.RefinedButNoChartData:Ga.None}get tileCache(){var i;this._currentTileCache=et(this._currentTileCache);const e=this.view;if(e!=null&&(e==null?void 0:e.type)==="3d"){const r=(i=e.basemapTerrain)==null?void 0:i.elevationQueryCache;if(r!=null)return r}return this._currentTileCache==null&&(this._currentTileCache=new Q7e(new qB(20*N2.MEGABYTES))),this._currentTileCache}get visible(){return this.tool.visible}set visible(e){this.tool.visible=e}get inputIsSketched(){return this.tool.interaction.isSketchedGraphic(this.input)}get elevationProvider(){const e=this.view;return e!=null&&e.type==="3d"?e.elevationProvider:null}get updating(){var r;const{progress:e}=this,i=!!((r=this.queue)!=null&&r.updating);return e>0&&e<1||i}start(e){this.tool.interaction.start(e)}stop(){this.tool.interaction.stop()}cancel(){this.tool.interaction.cancel()}clear(){this.tool.interaction.clear()}_findSelectableUnit(e,i){const r=this.unitOptions;return e!=null&&r.includes(e)?e:i?this._findSelectableUnit(i):r[0]}_filteredOrAllUnits(e){const i=(e??[]).filter(r=>dL.includes(r));return i.length===0?dL.slice():i}};y([w()],un.prototype,"view",void 0),y([w({type:Ml})],un.prototype,"input",void 0),y([w({type:lqt,nonNullable:!0})],un.prototype,"profiles",null),y([w({readOnly:!0})],un.prototype,"state",null),y([w({readOnly:!0})],un.prototype,"progress",null),y([w()],un.prototype,"unitOptions",null),y([w()],un.prototype,"unit",null),y([w({readOnly:!0})],un.prototype,"effectiveUnits",null),y([w({type:Number})],un.prototype,"geodesicDistanceThreshold",void 0),y([w()],un.prototype,"hoveredChartPosition",void 0),y([w()],un.prototype,"uniformChartScaling",void 0),y([w()],un.prototype,"highlightEnabled",null),y([w({readOnly:!0})],un.prototype,"hoveredPoints",null),y([w({readOnly:!0})],un.prototype,"statistics",null),y([w()],un.prototype,"chartData",null),y([w()],un.prototype,"visibleProfiles",null),y([w()],un.prototype,"minDemResolutions",null),y([w({readOnly:!0})],un.prototype,"minDemResolution",null),y([w({readOnly:!0})],un.prototype,"errorState",null),y([w(ZCe)],un.prototype,"defaultUnit",void 0),y([w()],un.prototype,"queue",void 0),y([w()],un.prototype,"tileCache",null),y([w()],un.prototype,"tool",void 0),y([w()],un.prototype,"visible",null),y([w()],un.prototype,"error",void 0),y([w()],un.prototype,"inputIsSketched",null),y([w()],un.prototype,"elevationProvider",null),y([w()],un.prototype,"updating",null),y([w()],un.prototype,"_defaultProfileLineGround",void 0),y([w()],un.prototype,"_userUnitOptions",void 0),y([w()],un.prototype,"_controller",void 0),y([w()],un.prototype,"_userUnit",void 0),un=y([Z("esri.widgets.ElevationProfile.ElevationProfileViewModel")],un);const n3e=Symbol("updating-object"),QBe=un;let Z0=class extends ze{constructor(){super(...arguments),this.legend=!0,this.chart=!0,this.clearButton=!0,this.settingsButton=!0,this.sketchButton=!0,this.selectButton=!0,this.unitSelector=!0,this.uniformChartScalingToggle=!0}};y([w()],Z0.prototype,"legend",void 0),y([w()],Z0.prototype,"chart",void 0),y([w()],Z0.prototype,"clearButton",void 0),y([w()],Z0.prototype,"settingsButton",void 0),y([w()],Z0.prototype,"sketchButton",void 0),y([w()],Z0.prototype,"selectButton",void 0),y([w()],Z0.prototype,"unitSelector",void 0),y([w()],Z0.prototype,"uniformChartScalingToggle",void 0),Z0=y([Z("esri.widgets.ElevationProfile.ElevationProfileVisibleElements")],Z0);const eje=Z0;function hqt(t,e){return{type:DT(e),value:t,unit:e}}function dqt(t,e){return{type:DT(e),value:t,unit:e}}function pqt(t,e){return{type:DT(e),value:t,unit:e}}function Wue(t,e,i="arithmetic"){return{type:DT(e),value:t,unit:e,rotationType:i}}function xyi(t,e){const i=fqt(t,e);return t.type==="angle"?Wue(i,e,t.rotationType):hqt(i,e)}function fqt(t,e){return Ur(t.value,t.unit,e)}function Syi(t,e){return t==null?e:e==null||t.value>Ur(e.value,e.unit,t.unit)?t:e}function Tyi(t,e){return t==null?null:{...t,value:t.value*e}}function mqt(t,e,i){if(e===i)return t;switch(i){case"arithmetic":case"geographic":return 90-t}}const Eyi=dqt(0,"meters"),Cyi=pqt(0,"square-meters");Wue(0,"radians");const Ayi=Wue(0,"degrees");function tje(t,e,i){return t.units[e][i]}function ex(t,e,i,r=2,n="abbr"){return`${nd(e,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:e>0?"never":"exceptZero"})} ${tje(t,i,n)}`}function WG(t,e,i,r=2,n="abbr"){return`${nd(e,{minimumFractionDigits:r,maximumFractionDigits:r,signDisplay:"exceptZero"})} ${tje(t,i,n)}`}function Myi(t,e,i,r=2,n="abbr"){const s=Yne(e,i);return ex(t,Ur(e,i,s),s,r,n)}function Oyi(t,e,i,r=2,n="abbr"){const s=Yne(e,i);return WG(t,Ur(e,i,s),s,r,n)}function Pyi(t,e,i,r=2,n="abbr"){const s=Xne(e,i);return ex(t,Ur(e,i,s),s,r,n)}function Ryi(t,e,i,r=2,n="abbr"){const s=Xne(e,i);return WG(t,Ur(e,i,s),s,r,n)}function Iyi(t,e,i,r=2,n="abbr"){const s=Zne(e,i);return ex(t,Ur(e,i,s),s,r,n)}function $yi(t,e,i,r=2,n="abbr"){const s=Zne(e,i);return WG(t,Ur(e,i,s),s,r,n)}function Lyi(t,e,i,r=2,n="abbr"){const s=Jne(e,i);return ex(t,Ur(e,i,s),s,r,n)}function Dyi(t,e,i,r=2,n="abbr"){const s=Jne(e,i);return WG(t,Ur(e,i,s),s,r,n)}function Nyi(t,e,i,r=2,n="abbr"){const s=FKe(e,i);return ex(t,Ur(e,i,s),s,r,n)}function Fyi(t,e,i,r=2,n="abbr"){const s=kKe(e,i);return ex(t,Ur(e,i,s),s,r,n)}function s3e(t,e,i,r,n){n=n??2;let s=d5.normalize(mqt(Ur(t,e,"degrees"),i,r),0,!0);const o={style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:n,minimumFractionDigits:n,signDisplay:s>0?"never":"exceptZero"};return s=ije(s,o),nd(s,o)}function kyi(t,e,i,r,n){i!==r&&(t=-t);const s={style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:n=n??2,minimumFractionDigits:n,signDisplay:"exceptZero"};let o=Ur(t,e,"degrees")%360;return o=ije(o,s),nd(o,s)}const o3e=new Map;function ije(t,e){const i=JSON.stringify(e);let r=o3e.get(i);return r||(r=new Intl.NumberFormat("en-US",e),o3e.set(i,r)),/\-?\+?360/.test(r.format(t))?0:t}const a3e=["B","kB","MB","GB","TB"];function zyi(t,e){let i=(e=Math.round(e))===0?0:Math.floor(Math.log(e)/Math.log(N2.KILOBYTES));i=Je(i,0,a3e.length-1);const r=nd(e/N2.KILOBYTES**i,{maximumFractionDigits:2});return h9(t.units.bytes[a3e[i]],{fileSize:r})}const gqt=100;let gS=class extends cn{constructor(e,i){super(e,i),this._updateLayout=r=>{const n=r.parentElement,s=r.style.display;n==null||n.removeChild(r),document.body.appendChild(r),r.style.display="block";let o=80;for(const l of r.childNodes)l instanceof HTMLElement&&(o=Math.max(o,l.offsetWidth));document.body.removeChild(r),n==null||n.appendChild(r),r.style.display=s,r.style.setProperty("--max-width",`${o}px`)},this._updateLayoutThrottled=kV(this._updateLayout,gqt)}loadDependencies(){return Pl({icon:()=>we(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([248,245,242]))})}initialize(){this.addHandles(this._updateLayoutThrottled)}render(){return X("div",{afterCreate:this._updateLayout,afterUpdate:this._updateLayoutThrottled,bind:this,class:qR.base},this._renderStatistics())}_renderStatistics(){var i;const e=(i=this._messages)==null?void 0:i.statistics;return e?[this._renderDistanceStatistic("maxDistance",e.maxDistance),this._renderElevationStatistic("elevationGain",e.gain),this._renderElevationStatistic("elevationLoss",e.loss),this._renderElevationStatistic("minElevation",e.minElevation),this._renderElevationStatistic("maxElevation",e.maxElevation),this._renderElevationStatistic("avgElevation",e.avgElevation),this._renderSlopeStatistic("maxPositiveSlope","maxNegativeSlope",e.maxSlope),this._renderSlopeStatistic("avgPositiveSlope","avgNegativeSlope",e.avgSlope)]:[]}_renderDistanceStatistic(e,i){const r=kf().formatPrecision,n=this._renderValue(e,s=>{const o=this.effectiveUnits.distance;return ex(this._messagesUnits,s,o,r)});return this._renderStatistic(i,n)}_renderElevationStatistic(e,i){const r=kf().formatPrecision,n=this._renderValue(e,s=>{const o=this.effectiveUnits.elevation;return ex(this._messagesUnits,s,o,r)});return this._renderStatistic(i,n)}_renderSlopeStatistic(e,i,r){const n=kf().formatPrecision,s=X("div",{class:qR.slopeValue,key:"slope-up"},X("calcite-icon",{icon:"arrow-up",scale:"s"}),this._renderValue(e,o=>s3e(o,"degrees","geographic","geographic",n)),X("calcite-icon",{icon:"arrow-down",scale:"s"}),this._renderValue(i,o=>s3e(o,"degrees","geographic","geographic",n)));return this._renderStatistic(r,s)}_renderStatistic(e,i){return X("div",{class:qR.statistic},X("label",{class:qR.statisticLabel},e),X("div",{class:qR.statisticValue},i))}_renderValue(e,i){const r=this.line,n=r.progress===1?r.statistics:null,s=n==null?void 0:n[e];return s!=null?i(s):xHt}};y([w()],gS.prototype,"effectiveUnits",void 0),y([w()],gS.prototype,"line",void 0),y([w(),Gr("esri/widgets/ElevationProfile/t9n/ElevationProfile")],gS.prototype,"_messages",void 0),y([w(),Gr("esri/core/t9n/Units")],gS.prototype,"_messagesUnits",void 0),gS=y([Z("esri.widgets.ElevationProfile.Statistics")],gS);function l3e(t,{profiles:e}){const i=t.title;if(i!=null)return i;switch(t.type){case"ground":return e.ground;case"input":return e.input;case"query":return e.query;case"view":return e.view;default:return""}}let J0=class extends cn{constructor(e,i){super(e,i),this.checkboxVisible=!0,this.expanded=!1}loadDependencies(){return Pl({action:()=>we(()=>import("./calcite-action-mEzyoc-Z.js"),__vite__mapDeps([290,291,247,237,239,240,241,242,243,244,245,246])),checkbox:()=>we(()=>import("./calcite-checkbox-OaFCWd7i.js"),__vite__mapDeps([283,236,247,237,241,238,239])),label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238])),tooltip:()=>we(()=>import("./calcite-tooltip-DucKIjb_.js"),__vite__mapDeps([251,252,253,247,254,255]))})}initialize(){this._statistics=new gS(this._statisticsProps),this.addHandles(_e(()=>this._statisticsProps,e=>this._statistics.set(e)))}destroy(){this._statistics=et(this._statistics)}render(){const e=this.expanded;return X("div",{class:this.classes(k1.base,{[k1.disabled]:this.disabled,[k1.expanded]:e}),key:this},this._renderColorIndicator(),X("div",{class:k1.header,key:"header"},this._renderLabelWithCheckbox(),this._renderCollapseToggleButton()),e?X("div",{class:k1.content,key:"content"},this._statistics.render()):null)}get disabled(){return!this.line.available}get _statisticsProps(){return{line:this.line,effectiveUnits:this.effectiveUnits}}_renderColorIndicator(){return X("div",{class:k1.colorIndicator,key:"color-indicator",styles:{backgroundColor:this.line.color.toCss()}})}_renderCollapseToggleButton(){const{expanded:e,messages:i}=this,r=e?i.hideDetails:i.showDetails;return X("calcite-action",{appearance:"transparent",bind:this,class:k1.collapseToggle,"data-testid":"legend-toggle",icon:e?"chevron-up":"chevron-down",key:"collapse-toggle",onclick:this._onCollapseToggleClick,scale:"s",text:r})}_onCollapseToggleClick(){this.onExpandedToggle()}_renderLabelWithCheckbox(){const{line:e,checkboxVisible:i,disabled:r,messages:n}=this,s=`label-${e.id}`;return X("calcite-label",{class:k1.label,disabled:r,key:s,layout:"inline"},i?this._renderCheckbox(e.id):null,l3e(e,n))}_renderCheckbox(e){const{disabled:i,line:r,messages:n}=this,s=r.visible,o=`${e}-checkbox`,l=s?n.hideProfile:n.showProfile,c=By(l,{name:l3e(r,n)});return X(WI,null,X("calcite-checkbox",{checked:s,class:k1.checkbox,disabled:i,id:o,key:"checkbox",onCalciteCheckboxChange:()=>r.toggleVisibility()}),X("calcite-tooltip",{overlayPositioning:"fixed",placement:"top",referenceElement:o},c))}};y([w()],J0.prototype,"checkboxVisible",void 0),y([w()],J0.prototype,"disabled",null),y([w({nonNullable:!0})],J0.prototype,"effectiveUnits",void 0),y([w()],J0.prototype,"expanded",void 0),y([w({nonNullable:!0})],J0.prototype,"line",void 0),y([w()],J0.prototype,"messages",void 0),y([w()],J0.prototype,"onExpandedToggle",void 0),y([w()],J0.prototype,"_statistics",void 0),J0=y([Z("esri.widgets.ElevationProfile.LegendItem")],J0);let yS=class extends cn{constructor(){super(...arguments),this._expandedLine=null}render(){const{profiles:e,messages:i,effectiveUnits:r,_expandedLine:n}=this;return X("div",{class:wHt.base},e.map(s=>X(J0,{checkboxVisible:e.length>1,effectiveUnits:r,expanded:s===n,line:s,messages:i,onExpandedToggle:()=>this._onExpandedToggle(s)})))}_onExpandedToggle(e){this._expandedLine=e===this._expandedLine?null:e}};y([w()],yS.prototype,"effectiveUnits",void 0),y([w()],yS.prototype,"messages",void 0),y([w()],yS.prototype,"profiles",void 0),y([w()],yS.prototype,"_expandedLine",void 0),yS=y([Z("esri.widgets.ElevationProfile.components.Legend")],yS);const kX="esri-unit-select",zX={base:kX,label:`${kX}__label`,select:`${kX}__select`};let Cw=class extends cn{constructor(e,i){super(e,i),this._onSelectChange=r=>{this.onChange(r.target.value)}}loadDependencies(){return Pl({label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238])),option:()=>we(()=>import("./calcite-option-LMeeGK3H.js"),__vite__mapDeps([285,242])),select:()=>we(()=>import("./calcite-select-0Yw6DsYN.js"),__vite__mapDeps([286,236,237,238,239,242,243,245]))})}render(){const{messages:e,options:i,selectLabel:r,value:n,_onSelectChange:s}=this;return X("div",{class:zX.base,key:"units"},X("calcite-label",{class:zX.label},r,X("calcite-select",{class:zX.select,label:r,onCalciteSelectChange:s},i.map(o=>{var l;return X("calcite-option",{key:o,selected:o===n,value:o},$Ke(o)?e.systems[o]:(l=e.units[o])==null?void 0:l.pluralCapitalized)}))))}};y([w()],Cw.prototype,"options",void 0),y([w()],Cw.prototype,"onChange",void 0),y([w()],Cw.prototype,"selectLabel",void 0),y([w()],Cw.prototype,"value",void 0),y([w(),Gr("esri/core/t9n/Units")],Cw.prototype,"messages",void 0),Cw=y([Z("esri.widgets.support.UnitSelect")],Cw);let rf=class extends cn{constructor(){super(...arguments),this.messages=null,this._popover=null,this._popoverIsOpen=!1,this._onPopoverAfterCreate=e=>{this._popover=e},this._onUniformChartScalingChange=e=>{this.onUniformChartScalingChange(e.target.checked)}}loadDependencies(){return Pl({action:()=>we(()=>import("./calcite-action-mEzyoc-Z.js"),__vite__mapDeps([290,291,247,237,239,240,241,242,243,244,245,246])),checkbox:()=>we(()=>import("./calcite-checkbox-OaFCWd7i.js"),__vite__mapDeps([283,236,247,237,241,238,239])),label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238])),popover:()=>we(()=>import("./calcite-popover-PeZ1jQob.js"),__vite__mapDeps([292,293,252,253,247,254,240,241,242,244,239,255,243,291,237,245,246])),tooltip:()=>we(()=>import("./calcite-tooltip-DucKIjb_.js"),__vite__mapDeps([251,252,253,247,254,255]))})}initialize(){const e=()=>this._popover;this.addHandles([Jr(e,"calcitePopoverOpen",()=>this._popoverIsOpen=!0),Jr(e,"calcitePopoverClose",()=>this._popoverIsOpen=!1)])}render(){const{id:e,messages:i,visibleElements:r}=this,{unitSelector:n,uniformChartScalingToggle:s}=r;if(!i||!n&&!s)return X("div",{key:`${e}-empty`});const o=`${e}__action`,l=this._popoverIsOpen?i.hideSettings:i.showSettings;return X("div",{class:a7.base,key:this},X("calcite-popover",{afterCreate:this._onPopoverAfterCreate,autoClose:!0,label:l,overlayPositioning:"fixed",placement:"bottom-end",referenceElement:o},this._renderPopoverContent()),X("calcite-action",{appearance:"transparent","data-testid":"settings-button",icon:"gear",id:o,label:l,scale:"s",text:l}))}_renderPopoverContent(){const{unitSelector:e,uniformChartScalingToggle:i}=this.visibleElements;return X("div",{class:a7.popoverContent},e?this._renderUnitSelector():null,i?this._renderUniformChartScalingToggle():null)}_renderUnitSelector(){const{messages:e}=this;return X(Cw,{key:"unit-selector-label",options:this.unitOptions,selectLabel:(e==null?void 0:e.unitSelectLabel)??"",value:this.unit,onChange:this.onUnitChange})}_renderUniformChartScalingToggle(){const{messages:e}=this,i=this.uniformChartScaling,r=`${this.id}__uniform-chart-scaling-toggle`,n=(e==null?void 0:e[i?"uniformChartScalingDisable":"uniformChartScalingEnable"])??"";return X("calcite-label",{class:a7.uniformChartScalingLabel,key:"uniform-chart-scaling-label",layout:"inline"},X("calcite-checkbox",{checked:i,class:a7.uniformChartScalingCheckbox,id:r,onCalciteCheckboxChange:this._onUniformChartScalingChange}),X("calcite-tooltip",{overlayPositioning:"fixed",referenceElement:r},n),e==null?void 0:e.uniformChartScalingLabel)}};y([w()],rf.prototype,"messages",void 0),y([w()],rf.prototype,"onUniformChartScalingChange",void 0),y([w()],rf.prototype,"onUnitChange",void 0),y([w()],rf.prototype,"uniformChartScaling",void 0),y([w()],rf.prototype,"unit",void 0),y([w()],rf.prototype,"unitOptions",void 0),y([w()],rf.prototype,"visibleElements",void 0),y([w()],rf.prototype,"_popover",void 0),y([w()],rf.prototype,"_popoverIsOpen",void 0),rf=y([Z("esri.widgets.ElevationProfile.components.SettingsButton")],rf);var Rh;(function(t){t.Sketch="sketch",t.SketchCancel="sketch-cancel",t.SketchDone="sketch-done",t.Select="select",t.SelectCancel="select-cancel"})(Rh||(Rh={}));const WR=[{type:Rh.Select},{type:Rh.Sketch}],yqt={[Ga.None]:null,[Ga.NoValidInput]:"noProfile",[Ga.NoVisibleProfiles]:"noProfile",[Ga.RefinedButNoChartData]:"noProfile",[Ga.TooComplex]:"tooComplex",[Ga.UnknownError]:"unknown",[Ga.InvalidGeometry]:"invalidGeometry",[Ga.InvalidElevationInfo]:"invalidElevationInfo"},c3e=Symbol("resize-observer-handle");let Ss=class extends cn{constructor(t,e){super(t,e),this.viewModel=null,this.visibleElements=new eje,this.iconClass=Ho.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this._chartContainer=null,this._chart=null,this._chartInitTask=null,this._chartIsRefined=!1,this._width=0,this._zoomOutButtonVisible=!1,this._getChartUpdateParamsMemoized=Sm((i,r,n,s)=>({chart:i,data:r,stationary:n,messages:s})),this._onZoomOutButtonClick=()=>{var i;(i=this._chart)==null||i.zoomOut()},this._onClearButtonClick=()=>{this.viewModel.clear()},t!=null&&t.viewModel||(this._defaultViewModel=new QBe({view:t==null?void 0:t.view}),this.viewModel=this._defaultViewModel)}loadDependencies(){return Pl({action:()=>we(()=>import("./calcite-action-mEzyoc-Z.js"),__vite__mapDeps([290,291,247,237,239,240,241,242,243,244,245,246])),button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),loader:()=>we(()=>import("./calcite-loader-Z65agR8e.js"),__vite__mapDeps([294,246,247]))})}postInitialize(){this.addHandles([_e(()=>({container:this._chartContainer,width:this._width}),({container:t,width:e})=>{this._destroyChart(),t!=null&&e>0&&this._initializeChart(t)},ii),_e(()=>this._chartUpdateParams,()=>this._updateChart(this._chartUpdateParams),ii)])}destroy(){this._destroyChart(),this._defaultViewModel!=null&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}get input(){return this.viewModel.input}set input(t){this.viewModel.input=t}get profiles(){return this.viewModel.profiles}set profiles(t){this.viewModel.profiles=t}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(t){this.viewModel.unitOptions=t}get unit(){return this.viewModel.unit}set unit(t){this.viewModel.unit=t}get geodesicDistanceThreshold(){return this.viewModel.geodesicDistanceThreshold}set geodesicDistanceThreshold(t){this.viewModel.geodesicDistanceThreshold=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get visible(){return this.viewModel.visible}set visible(t){this.viewModel.visible=t}get _portrait(){return this._widthi.uniformChartScaling=n,onUnitChange:n=>i.unit=n}):null),X("div",{class:Ho.mainContainer,key:"main-container"},e),this.visibleElements.legend?X(yS,{effectiveUnits:i.effectiveUnits,messages:this.messages,profiles:this._profilesArray}):null,this._renderActions(t))}_renderZoomOutButton(){return X("calcite-action",{appearance:"transparent",class:Ho.zoomOutButton,"data-testid":"zoom-out-button",icon:"magnifying-glass-minus",key:"zoom-out",onclick:this._onZoomOutButtonClick,scale:"s",text:this.messages.zoomOut})}_renderClearButton(){return X("calcite-action",{appearance:"transparent",class:Ho.clearButton,"data-testid":"clear-button",icon:"trash",key:"clear-profile",onclick:this._onClearButtonClick,scale:"s",text:this.messages.clearProfile})}_renderPrompt(t){return[X("div",{bind:this,class:Ho.promptContainer,key:"prompt-container"},X("p",null,t))]}_renderChart(){if(!this.visibleElements.chart)return X("div",{class:Ho.chartContainer,key:"empty-chart-container"});const t=this._chartIsRefined||this._canRenderChart();if(!t)return X(WI,null,this._renderSpinner({size:"large"}),X("div",{class:Ho.chartContainer,key:"chart-container-empty"}));const{chartData:e,progress:i}=this.viewModel;return X(WI,null,e!=null&&i>0&&i<1?this._renderSpinner({size:t?"small":"large"}):null,X("div",{afterCreate:this._onChartContainerAfterCreate,afterRemoved:this._onChartContainerRemoved,bind:this,class:Ho.chartContainer,key:"chart-container"}))}_renderSpinner(t){const e=t.size==="small";return X("calcite-loader",{afterCreate:this._onSpinnerAfterCreate,class:this.classes(Ho.chartSpinner,e&&Ho.chartSpinnerSmall),exitAnimation:this._onSpinnerExit,inline:e,key:"spinner",label:"",scale:"s"})}_onSpinnerAfterCreate(t){requestAnimationFrame(()=>t.classList.add(Ho.chartSpinnerVisible))}_onSpinnerExit(t,e){t.classList.remove(Ho.chartSpinnerVisible),setTimeout(e,200)}_canRenderChart(){const t=this.viewModel.chartData;if(t==null)return!1;if(!this.viewModel.inputIsSketched)return t.refined;let e=0;for(const{samples:i}of t.lines)e+=i!=null?i.length:0;return t.refined||e<=kf().largeChartSamples}_renderActions({actions:t}){const e=t.map(i=>{switch(i.type){case Rh.Sketch:return this.visibleElements.sketchButton&&this._renderAction({action:i,className:Ho.sketchButton,label:this.messages.sketchButtonLabel,onClick:this._onSketchButtonClick,primary:!0});case Rh.SketchCancel:return this.visibleElements.sketchButton&&this._renderAction({action:i,onClick:this._onCancelButtonClick,className:Ho.sketchCancelButton,label:this.messagesCommon.cancel,primary:!1});case Rh.SketchDone:return this.visibleElements.sketchButton&&this._renderAction({action:i,onClick:this._onDoneButtonClick,className:Ho.sketchDoneButton,label:this.messagesCommon.done,primary:!0});case Rh.Select:return this.visibleElements.selectButton&&this._renderAction({action:i,onClick:this._onSelectButtonClick,className:Ho.selectButton,label:this.messages.selectButtonLabel,primary:!1});case Rh.SelectCancel:return this.visibleElements.selectButton&&this._renderAction({action:i,onClick:this._onCancelButtonClick,className:Ho.selectCancelButton,label:this.messagesCommon.cancel,primary:!1})}}).filter(Boolean);return e.length?X("footer",{class:Ho.footer,key:"footer"},e):null}_renderAction({action:t,className:e,label:i,onClick:r,primary:n}){return X("calcite-button",{appearance:n?"solid":"outline-fill",bind:this,class:this.classes(Ho.actionButton,e),disabled:t.disabled,key:`action-${t.type}`,onclick:r},i)}_onSketchButtonClick(){this.viewModel.start({mode:"sketch"})}_onSelectButtonClick(){this.viewModel.start({mode:"select"})}_onCancelButtonClick(){this.viewModel.cancel()}_onDoneButtonClick(){this.viewModel.stop()}_onContentWrapperAfterCreate(t){const e=aB(t,i=>{this._width=i.contentRect.width});this.addHandles(e,c3e)}_onContentWrapperRemoved(){this.removeHandles(c3e)}_updateChart(t){const{data:e,chart:i,messages:r,stationary:n}=t;i!=null&&r!=null&&n&&this._canRenderChart()&&(i.update(t),this._chartIsRefined=e!=null&&e.refined)}_onChartContainerAfterCreate(t){this._chartContainer=t}_onChartContainerRemoved(){this._chartContainer=null}_initializeChart(t){gn(this._chartInitTask),this._chartInitTask=Cc(async e=>{const{createChart:i}=await we(()=>import("./chartUtils-P39aKol1.js"),__vite__mapDeps([295,296,297,298,299,300,301,302,303,304]));St(e);const r=await i({container:t,abortOptions:{signal:e},onRangeChange:(n,s)=>{this._zoomOutButtonVisible=n!==1||s!==1},onCursorPositionChange:n=>{this.viewModel.hoveredChartPosition=n}});if(e.aborted)throw et(r),ur();this._chart=r,this._updateChart(this._chartUpdateParams)})}_destroyChart(){this._chartInitTask=gn(this._chartInitTask),this._chart=et(this._chart),this._chartIsRefined=!1}};y([w({type:QBe})],Ss.prototype,"viewModel",void 0),y([w()],Ss.prototype,"view",null),y([w()],Ss.prototype,"input",null),y([w()],Ss.prototype,"profiles",null),y([w()],Ss.prototype,"unitOptions",null),y([w()],Ss.prototype,"unit",null),y([w()],Ss.prototype,"geodesicDistanceThreshold",null),y([w({type:eje,nonNullable:!0})],Ss.prototype,"visibleElements",void 0),y([w()],Ss.prototype,"iconClass",void 0),y([w()],Ss.prototype,"icon",void 0),y([w()],Ss.prototype,"label",null),y([w()],Ss.prototype,"visible",null),y([w(),Gr("esri/widgets/ElevationProfile/t9n/ElevationProfile")],Ss.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],Ss.prototype,"messagesCommon",void 0),y([w(),Gr("esri/core/t9n/Units")],Ss.prototype,"messagesUnits",void 0),y([w()],Ss.prototype,"_chartContainer",void 0),y([w()],Ss.prototype,"_chart",void 0),y([w()],Ss.prototype,"_chartInitTask",void 0),y([w()],Ss.prototype,"_chartIsRefined",void 0),y([w()],Ss.prototype,"_width",void 0),y([w()],Ss.prototype,"_portrait",null),y([w()],Ss.prototype,"_zoomOutButtonVisible",void 0),y([w()],Ss.prototype,"_chartUpdateParams",null),y([w()],Ss.prototype,"_chartMessages",null),y([w()],Ss.prototype,"_profilesArray",null),Ss=y([Z("esri.widgets.ElevationProfile")],Ss);const vqt=Ss,_qt=t=>new vqt({view:t,container:"elevation-profile-container",profiles:[{type:"ground",title:"Maapind"},{type:"view",title:"Kihid"}],visibleElements:{selectButton:!0}}),bqt=t=>{const e=document.getElementById("distanceButton"),i=document.getElementById("areaButton"),r=document.getElementById("clearButton");e.addEventListener("click",()=>{e.active=!0,i.active=!1,t.activeTool="direct-line"}),i.addEventListener("click",()=>{e.active=!1,i.active=!0,t.activeTool="area"}),r.addEventListener("click",()=>{e.active=!1,i.active=!1,t.clear()})},mf="esri-shadow-cast",Fb={base:mf,widgetIcon:si.measureBuildingHeightShadow,timeRange:`${mf}__time-range`,timeRangeIndicator:`${mf}__time-range__indicator`,datePickerContainer:`${mf}__date-picker-container`,visualization:`${mf}__visualization`,visualizationSelect:`${mf}__visualization__select`,visualizationConfigHidden:`${mf}__visualization__config--hidden`},wqt=`${mf}__label`,u3e=`${mf}__threshold-config`,h3e={base:u3e,valueLabel:`${u3e}__value-label`},d3e=`${mf}__duration-config`,p3e={base:d3e,radioGroup:`${d3e}__radio-group`},xqt=`${mf}__discrete-config`,Sqt={base:xqt},f3e=`${mf}__tooltip`,m3e={base:f3e,content:`${f3e}__content`};var DO;(function(t){t.Disabled="disabled",t.Ready="ready"})(DO||(DO={}));let gM=class extends ze{constructor(){super({}),this.color=new qe([50,50,50,.7]),this.intervalOptions=new it([Gs(15,"minutes","milliseconds"),Gs(30,"minutes","milliseconds"),Gs(1,"hours","milliseconds"),Gs(2,"hours","milliseconds"),Gs(3,"hours","milliseconds")]),this.interval=this.intervalOptions.at(0)}set intervalOptions(e){this._set("intervalOptions",sd(e,this._get("intervalOptions")))}};y([w({type:qe})],gM.prototype,"color",void 0),y([w()],gM.prototype,"interval",void 0),y([w({type:it})],gM.prototype,"intervalOptions",null),gM=y([Z("esri.widgets.ShadowCast.DiscreteOptions")],gM);const rje=gM;var f2;(function(t){t.Continuous="continuous",t.Hourly="hourly"})(f2||(f2={}));let kI=class extends ze{constructor(){super(...arguments),this.color=new qe([0,0,255,.7]),this.mode=f2.Continuous}};y([w({type:qe})],kI.prototype,"color",void 0),y([w()],kI.prototype,"mode",void 0),kI=y([Z("esri.widgets.ShadowCast.DurationOptions")],kI);const nje=kI;var zw;(function(t){t.PointerMove="pointer-move",t.Main="main"})(zw||(zw={}));const Tqt=300;let K0=class extends ze{constructor(e){super(e),this._screenPoint=null,this._accumulatedShadowTime=null,this._shadowTimeTask=null,this._updateAccumulatedShadowTime=(i,r)=>{this._shadowTimeTask=gn(this._shadowTimeTask),this._shadowTimeTask=Cc(async n=>{const{results:s,ground:o}=await i.hitTest(r);if(s.length===0&&!o.mapPoint)return void(this._accumulatedShadowTime=null);const l=await this.getDuration(r,n);this._accumulatedShadowTime=l})},this._throttledUpdateAccumulatedShadowTime=kV(this._updateAccumulatedShadowTime,Tqt)}initialize(){this.addHandles(_e(()=>({enabled:this.enabled,view:this.view}),({enabled:e,view:i})=>{e&&i!=null?this._startTracking(i):this._stopTracking()},kt))}get screenPoint(){return this.enabled?this._screenPoint:null}get accumulatedShadowTime(){return this.enabled?this._accumulatedShadowTime:null}get testData(){return{setThrottleDelay:e=>{this._throttledUpdateAccumulatedShadowTime.remove(),this._throttledUpdateAccumulatedShadowTime=kV(this._updateAccumulatedShadowTime,e)}}}_startTracking(e){if(this.hasHandles(zw.Main))return;const i=()=>{this.hasHandles(zw.PointerMove)||this.addHandles(e.on("pointer-move",n=>{const s=Ku(n.x,n.y);this._screenPoint=s,this._throttledUpdateAccumulatedShadowTime(e,s)}),zw.PointerMove)},r=()=>{this.removeHandles(zw.PointerMove),this._screenPoint=null,this._accumulatedShadowTime=null};this.addHandles([this._throttledUpdateAccumulatedShadowTime,e.on("pointer-enter",i),e.on("pointer-leave",r),e.on("pointer-down",r),e.on("pointer-drag",r),e.on("pointer-up",i),e.on("click",n=>{const s=Ku(n.x,n.y);this._screenPoint=s,this._updateAccumulatedShadowTime(e,s)}),rr(()=>{this._shadowTimeTask=gn(this._shadowTimeTask)})],zw.Main),i()}_stopTracking(){this.removeHandles(zw.Main)}};y([w()],K0.prototype,"getDuration",void 0),y([w()],K0.prototype,"view",void 0),y([w()],K0.prototype,"enabled",void 0),y([w()],K0.prototype,"screenPoint",null),y([w()],K0.prototype,"accumulatedShadowTime",null),y([w()],K0.prototype,"_screenPoint",void 0),y([w()],K0.prototype,"_accumulatedShadowTime",void 0),y([w()],K0.prototype,"_shadowTimeTask",void 0),K0=y([Z("esri.widgets.ShadowCast.ShadowTooltipViewModel")],K0);var qa;(function(t){t.Threshold="threshold",t.Duration="duration",t.Discrete="discrete"})(qa||(qa={}));qa.Threshold,qa.Duration,qa.Discrete;let vS=class extends ze{constructor(){super(...arguments),this.color=new qe([255,0,0,.7]),this.value=Gs(4,"hours","milliseconds"),this.minValue=0,this.maxValue=Gs(8,"hours","milliseconds")}};y([w({type:qe})],vS.prototype,"color",void 0),y([w()],vS.prototype,"value",void 0),y([w()],vS.prototype,"minValue",void 0),y([w()],vS.prototype,"maxValue",void 0),vS=y([Z("esri.widgets.ShadowCast.ThresholdOptions")],vS);const sje=vS,g3e=[],Eqt=W(),y3e=[],v3e=255,Cqt=Gs(1,"hours","milliseconds"),Aqt=500;let an=class extends ze{constructor(t){super(t),this.view=null,this.tooltip=new K0({getDuration:(e,i)=>this.getDuration(e,i)}),this.startTimeOfDay=Gs(10,"hours","milliseconds"),this.endTimeOfDay=Gs(16,"hours","milliseconds"),this.visualizationType=qa.Threshold,this.thresholdOptions=new sje,this.durationOptions=new nje,this.discreteOptions=new rje,this._running=!0,this._stopPreviewingTask=null,this._forcePreview=!1,this._autoRestoreForcePreviewEnabled=!0,this._utcOffset=null,this.date=new Date}initialize(){this.addHandles([_e(()=>({view:this.view,tooltipEnabled:this._tooltipEnabled}),({view:t,tooltipEnabled:e})=>{this.tooltip.view=t,this.tooltip.enabled=e},kt),_e(()=>this._forcePreviewDependencies,()=>{gn(this._stopPreviewingTask),this._forcePreview=!0,this._autoRestoreForcePreviewEnabled&&(this._stopPreviewingTask=Cc(async t=>{await T2(Aqt,t),St(t),this._forcePreview=!1}))},kt),_e(()=>({renderer:this.renderer,parameters:this._visualizationParameters}),t=>YR(t.renderer,t.parameters),kt),_e(()=>({renderer:this.renderer,parameters:{lightDirections:this._lightDirections}}),t=>YR(t.renderer,t.parameters),kt),_e(()=>({renderer:this.renderer,parameters:{enabled:this._running}}),t=>YR(t.renderer,t.parameters),kt),_e(()=>({renderer:this.renderer,parameters:{previewing:this._previewing}}),t=>YR(t.renderer,t.parameters),kt)])}destroy(){this.stop(),YR(this.renderer,{enabled:!1}),et(this.tooltip)}get state(){return this.view!=null&&this.view.ready&&this._referencePosition!=null?DO.Ready:DO.Disabled}set date(t){const e=new Date(t);e.setHours(0,0,0,0),this._set("date",e)}get utcOffset(){return this._utcOffset??this._utcOffsetAuto}set utcOffset(t){this._utcOffset=t}get testData(){return{setAutoRestoreForcedPreviewEnabled:t=>{this._autoRestoreForcePreviewEnabled=t},setForcedPreview:t=>{this._forcePreview=t},isPreviewing:()=>this._previewing}}get _previewing(){const{view:t}=this;return(t==null?void 0:t.allLayerViews)==null||this._forcePreview||!t.stationary||t.allLayerViews.some(e=>Bre(e)&&e.updating)}get _utcOffsetAuto(){const t=this._referencePosition;return t!=null?k4e(t[0],!1):0}get _dateUTCOffset(){let t=this.date;return t=rD(t,-t.getTimezoneOffset(),"minutes"),t=rD(t,-this.utcOffset,"hours"),t}get _startDateTimeUTC(){return rD(this._dateUTCOffset,this.startTimeOfDay)}get _endDateTimeUTC(){return rD(this._dateUTCOffset,this.endTimeOfDay)}get _referencePosition(){var t,e;return(e=(t=this.view)==null?void 0:t.environmentManager)==null?void 0:e.referencePositionWGS84Comparable}get _interval(){const t=this._duration>0?Math.floor(this._duration/v3e):v3e,e=this.discreteOptions.interval;switch(this.visualizationType){case qa.Threshold:case qa.Duration:return t;case qa.Discrete:return e>0?e:t}}get _sampleCount(){return this._lightDirections.length}get _duration(){return this.endTimeOfDay-this.startTimeOfDay}get _lightDirections(){const{view:t}=this;if(t==null)return g3e;const e=t.viewingMode==="global"?Eqt:this._referencePosition;if(e==null)return g3e;const i=this._interval,r=jvt(this._startDateTimeUTC,this._endDateTimeUTC,i,e,t.state.viewingMode),n=r.length;y3e.length=0;const s=HBe(0,n,y3e),o=new Array(n);for(let l=0;l0?t/this._duration:0}}get _durationVisualizationParameters(){const{color:t,mode:e}=this.durationOptions,i=this._duration,r=i>0&&e===f2.Hourly?Cqt/i:0;return{color:qe.toUnitRGBA(t),visualization:s_.Gradient,bandsEnabled:r>0,bandSize:r}}get _discreteVisualizationParameters(){return{color:qe.toUnitRGBA(this.discreteOptions.color),visualization:s_.Gradient,bandsEnabled:!1,bandSize:0}}get _forcePreviewDependencies(){const{view:t}=this;if(t==null)return null;const e=t.slicePlane,i=t.allLayerViews.toArray().filter(Bre),r=i.map(f=>f.layer).filter(ys),n=i.map(f=>f.visible),s=r.map(f=>f.visible),o=r.map(f=>f.opacity),l=r.filter(f=>"definitionExpression"in f).map(f=>f.definitionExpression),c=i.filter(f=>"filter"in f).map(f=>f.filter);return{slicePlane:e,startDateUTC:this._startDateTimeUTC,endDateUTC:this._endDateTimeUTC,layerViewVisibilities:n,layerVisibilities:s,layerOpacities:o,filters:c,definitionExpressions:l}}get renderer(){const{view:t}=this;if(t==null)return null;const e=t._stage;return e==null?null:e.renderer}start(){this.setRunning(!0)}stop(){this.setRunning(!1)}setRunning(t){this._running=t}async getDuration(t,e){const{view:i,renderer:r}=this;if(i==null||r==null)return 0;const n=i.state.camera.screenToRender(ss(t.x,t.y),gse()),s=r.readAccumulatedShadow(n),o=this._sampleCount;return o===0?0:s*o*(this._duration/o)}};function YR(t,e){t!=null&&e!=null&&t.setParameters({shadowCastOptions:e})}function Bre(t){if(t.suspended)return!1;switch(t.type){case"building-scene-3d":case"csv-3d":case"elevation-3d":case"feature-3d":case"geojson-3d":case"graphics-3d":case"integrated-mesh-3d":case"ogc-feature-3d":case"route-3d":case"scene-layer-3d":case"scene-layer-graphics-3d":case"stream-3d":case"wms-3d":return!0;case"base-dynamic-3d":case"dimension-3d":case"imagery-3d":case"imagery-tile-3d":case"line-of-sight-3d":case"map-image-3d":case"point-cloud-3d":case"tile-3d":case"vector-tile-3d":case"voxel-3d":case"wfs-3d":case"wmts-3d":case"media-3d":default:return!1;case"group":return t.layerViews.toArray().some(e=>Bre(e))}}y([w()],an.prototype,"state",null),y([w()],an.prototype,"view",void 0),y([w()],an.prototype,"tooltip",void 0),y([w({nonNullable:!0})],an.prototype,"date",null),y([w({nonNullable:!0})],an.prototype,"utcOffset",null),y([w({nonNullable:!0})],an.prototype,"startTimeOfDay",void 0),y([w({nonNullable:!0})],an.prototype,"endTimeOfDay",void 0),y([w({nonNullable:!0})],an.prototype,"visualizationType",void 0),y([w({type:sje,nonNullable:!0})],an.prototype,"thresholdOptions",void 0),y([w({type:nje,nonNullable:!0})],an.prototype,"durationOptions",void 0),y([w({type:rje,nonNullable:!0})],an.prototype,"discreteOptions",void 0),y([w()],an.prototype,"_running",void 0),y([w()],an.prototype,"_stopPreviewingTask",void 0),y([w()],an.prototype,"_forcePreview",void 0),y([w()],an.prototype,"_autoRestoreForcePreviewEnabled",void 0),y([w()],an.prototype,"_previewing",null),y([w()],an.prototype,"_utcOffset",void 0),y([w()],an.prototype,"_utcOffsetAuto",null),y([w()],an.prototype,"_dateUTCOffset",null),y([w()],an.prototype,"_startDateTimeUTC",null),y([w()],an.prototype,"_endDateTimeUTC",null),y([w()],an.prototype,"_referencePosition",null),y([w()],an.prototype,"_interval",null),y([w()],an.prototype,"_sampleCount",null),y([w()],an.prototype,"_duration",null),y([w()],an.prototype,"_lightDirections",null),y([w()],an.prototype,"_tooltipEnabled",null),y([w()],an.prototype,"_visualizationParameters",null),y([w()],an.prototype,"_thresholdVisualizationParameters",null),y([w()],an.prototype,"_durationVisualizationParameters",null),y([w()],an.prototype,"_discreteVisualizationParameters",null),y([w()],an.prototype,"_forcePreviewDependencies",null),y([w()],an.prototype,"renderer",null),an=y([Z("esri.widgets.ShadowCast.ShadowCastViewModel")],an);const Mqt=an;let _v=class extends ze{constructor(){super(...arguments),this.timeRangeSlider=!0,this.timezone=!0,this.datePicker=!0,this.visualizationOptions=!0,this.colorPicker=!0,this.tooltip=!0}};y([w()],_v.prototype,"timeRangeSlider",void 0),y([w()],_v.prototype,"timezone",void 0),y([w()],_v.prototype,"datePicker",void 0),y([w()],_v.prototype,"visualizationOptions",void 0),y([w()],_v.prototype,"colorPicker",void 0),y([w()],_v.prototype,"tooltip",void 0),_v=y([Z("esri.widgets.ShadowCast.ShadowCastVisibleElements")],_v);const oje=_v;function aje(t,e="milliseconds",i={}){const r={locale:Oqt(),numberingSystem:"latn"};let n;return n=t?hn.fromMillis(Gs(t,e,"milliseconds"),r).rescale():hn.fromObject({seconds:0},r),n.toHuman({listStyle:"narrow",unitDisplay:"long",...i})}function Oqt(){return lne()==="bs"?"hr":fa()}function YG(t,e){const{for:i,label:r,tabIndex:n,...s}=t;return X("div",{class:GS(wqt,s==null?void 0:s.class),key:i,...s},X("calcite-label",{for:i,scale:"s",tabIndex:n},r),e)}const l3="esri-color-picker",c3={base:l3,backgroundPattern:`${l3}__bg-pattern`,toggleButton:`${l3}__toggle-button`,popover:`${l3}__popover`,opacitySliderContainer:`${l3}__opacity-slider-container`,opacitySlider:`${l3}__opacity-slider`,calciteColorPicker:`${l3}__calcite-color-picker`};var Uw;(function(t){t.ColorPickerFocus="hex-input-poll-timeout",t.ButtonFocusTimeout="button-focus-timeout"})(Uw||(Uw={}));let Vd=class extends cn{constructor(t,e){super(t,e),this.value=new qe,this.alphaEnabled=!0,this._containerElement=null,this._popover=null,this._popoverElement=null,this._buttonElement=null,this._colorPickerCreated=!1}initialize(){this.addHandles(_e(()=>({container:this._containerElement,value:this.value}),({container:t,value:e})=>{t==null||t.style.setProperty("--esri-color-picker-value",e.toCss(!0))},kt))}loadDependencies(){return Pl({button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),"color-picker":()=>we(()=>import("./calcite-color-picker-iQ658ZQD.js"),__vite__mapDeps([305,239,245,242,236,237,241,238,240,244,243,306,307,235,246,247,253])),label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238])),slider:()=>we(()=>import("./calcite-slider--uw2bYfU.js"),__vite__mapDeps([308,247,236,237,241,238,239,240,242,307]))})}destroy(){this._destroyPopover(),this._buttonElement=null}render(){const t=this._messages,e=this._popover!=null&&this._popover.open?t.close:t.open;return X("div",{afterCreate:this._onContainerAfterCreate,bind:this,class:this.classes(c3.base,this.class)},X("div",{class:c3.backgroundPattern}),X("calcite-button",{afterCreate:this._onButtonAfterCreate,appearance:"transparent",bind:this,class:c3.toggleButton,id:this.id,kind:"neutral",label:e,onclick:this._togglePopover,scale:"s",tabIndex:-1,title:e}))}_onContainerAfterCreate(t){this._containerElement=t}_onButtonAfterCreate(t){this._destroyPopover(),this._buttonElement=t,this._popover=new kBe({owner:this,anchorElement:t,placement:"bottom-start",renderContentFunction:this._renderPopoverContent})}_destroyPopover(){this.removeHandles(Uw.ColorPickerFocus),this._popover=et(this._popover),this._popoverElement=null}_renderPopoverContent(){const t=this.value,e=this._messages;return X("div",{afterCreate:this._onPopoverAfterCreate,bind:this,class:c3.popover,onfocusout:this._onPopoverFocusOut,onkeydown:this._onPopoverKeyDown,tabIndex:-1},X("calcite-color-picker",{afterCreate:this._onColorPickerAfterCreate,afterRemoved:()=>this._colorPickerCreated=!1,bind:this,class:c3.calciteColorPicker,hideChannels:!0,hideSaved:!0,scale:"m",value:this._colorPickerCreated?t.toCss():null,onCalciteColorPickerInput:this._onColorInput}),this.alphaEnabled?X("section",{class:c3.opacitySliderContainer},X("calcite-label",{scale:"s"},e.opacity,X("calcite-slider",{bind:this,class:c3.opacitySlider,labelHandles:!0,max:1,min:0,step:.01,value:t.a,onCalciteSliderInput:this._onOpacityChange}))):null)}_onColorInput(t){const e=t.target.value,i=typeof e=="string"?new qe(e):new qe;i.a=this.value.a,this._onChange(i)}_onOpacityChange(t){const e=this.value.clone();e.a=t.target.value,this._onChange(e)}_onChange(t){this.value=t,this.onChange!=null&&this.onChange(t)}_onColorPickerAfterCreate(t){this.removeHandles(Uw.ColorPickerFocus);const e=Cc(async i=>{t.componentOnReady&&await t.componentOnReady(),St(i),this._colorPickerCreated=!0,await new Promise(r=>requestAnimationFrame(r)),St(i),t.setFocus()});this.addHandles(rr(()=>{e.abort(),this._colorPickerCreated=!1}),Uw.ColorPickerFocus)}_togglePopover(t){this._popover!=null&&this._popover.open?this._closePopover():this._openPopover()}_openPopover(){const t=this._popover;t&&(t.open=!0)}_closePopover(){this.removeHandles(Uw.ColorPickerFocus);const t=this._popover;t&&(t.open=!1),this._setFocusOnButton()}_setFocusOnButton(){this.removeHandles(Uw.ButtonFocusTimeout),this.addHandles(Pqt(()=>{var t;return(t=this._buttonElement)==null?void 0:t.setFocus()}),Uw.ButtonFocusTimeout)}_onPopoverAfterCreate(t){this._popoverElement=t}_onPopoverFocusOut(t){const e=this._popoverElement;if(e==null)return;const i=t.relatedTarget;i&&i instanceof Node&&(e.contains(i)||i===this._buttonElement||this._isAssociatedLabel(i))||this._closePopover()}_isAssociatedLabel(t){var r;const e=this.id,i=(r=t.tagName)==null?void 0:r.toLowerCase();return i==="calcite-label"&&t.for===e||i==="label"&&t.htmlFor===e}_onPopoverKeyDown(t){t.key!=="Escape"&&t.key!=="Enter"||(t.stopPropagation(),this._closePopover())}};function Pqt(t,e){const i=setTimeout(t,e);return rr(()=>clearTimeout(i))}y([w()],Vd.prototype,"class",void 0),y([w()],Vd.prototype,"value",void 0),y([w()],Vd.prototype,"alphaEnabled",void 0),y([w()],Vd.prototype,"onChange",void 0),y([w()],Vd.prototype,"_containerElement",void 0),y([w()],Vd.prototype,"_popover",void 0),y([w()],Vd.prototype,"_popoverElement",void 0),y([w()],Vd.prototype,"_buttonElement",void 0),y([w(),Gr("esri/widgets/support/t9n/ColorPicker")],Vd.prototype,"_messages",void 0),y([w()],Vd.prototype,"_colorPickerCreated",void 0),Vd=y([Z("esri.widgets.support.ColorPicker")],Vd);function Yue(t){return X(YG,{for:t.id,label:t.label,tabIndex:-1},X(Vd,{id:t.id,value:t.value,onChange:t.onChange}))}let yM=class extends cn{constructor(e){super(e),this.colorPickerVisible=!0,this._selectId=`select-${Vf()}`,this._colorPickerId=`color-picker-${Vf()}`,this._onColorChange=i=>{this.options.color=i}}loadDependencies(){return Pl({label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238])),option:()=>we(()=>import("./calcite-option-LMeeGK3H.js"),__vite__mapDeps([285,242])),select:()=>we(()=>import("./calcite-select-0Yw6DsYN.js"),__vite__mapDeps([286,236,237,238,239,242,243,245]))})}render(){const e=this._messages.discrete,i=e.intervalLabel,{color:r,interval:n,intervalOptions:s}=this.options;return X("div",{class:Sqt.base},X(YG,{for:this._selectId,label:i},X("calcite-select",{bind:this,id:this._selectId,label:i,onCalciteSelectChange:this._onIntervalChange},s.toArray().map(o=>X("calcite-option",{key:o,selected:o===n,value:String(o)},aje(o))))),this.colorPickerVisible?X(Yue,{id:this._colorPickerId,label:e.colorLabel,value:r,onChange:this._onColorChange}):null)}_onIntervalChange(e){var r;const i=parseInt((r=e.target.selectedOption)==null?void 0:r.value,10);Number.isFinite(i)&&(this.options.interval=i)}};y([w()],yM.prototype,"options",void 0),y([w()],yM.prototype,"colorPickerVisible",void 0),y([w(),Gr("esri/widgets/ShadowCast/t9n/ShadowCast")],yM.prototype,"_messages",void 0),yM=y([Z("esri.widgets.ShadowCast.components.DiscreteConfigurator")],yM);let vM=class extends cn{constructor(e){super(e),this.colorPickerVisible=!0,this._modeSelectorId=`mode-selector-${Vf()}`,this._colorPickerId=`color-picker-${Vf()}`,this._onColorChange=i=>{this.options.color=i},this._setContinuous=()=>{this.options.mode=f2.Continuous},this._setHourly=()=>{this.options.mode=f2.Hourly}}loadDependencies(){return Pl({button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238]))})}render(){const e=this._messages.duration,{color:i,mode:r}=this.options;return X("div",{class:p3e.base},X(YG,{for:this._modeSelectorId,label:e.modeLabel},X("div",{class:p3e.radioGroup},X(_3e,{active:r===f2.Continuous,label:e.continuousLabel,onclick:this._setContinuous}),X(_3e,{active:r===f2.Hourly,label:e.hourlyLabel,onclick:this._setHourly}))),this.colorPickerVisible?X(Yue,{id:this._colorPickerId,label:e.colorLabel,value:i,onChange:this._onColorChange}):null)}};function _3e({active:t,label:e,...i}){return X("calcite-button",{alignment:"center",appearance:t?"solid":"outline",scale:"s",width:"half",...i},e)}y([w()],vM.prototype,"options",void 0),y([w()],vM.prototype,"colorPickerVisible",void 0),y([w(),Gr("esri/widgets/ShadowCast/t9n/ShadowCast")],vM.prototype,"_messages",void 0),vM=y([Z("esri.widgets.ShadowCast.components.DurationConfigurator")],vM);const Rqt=Gs(1,"minutes","milliseconds"),b3e=Gs(15,"minutes","milliseconds");let _S=class extends cn{constructor(e,i){super(e,i),this.accumulatedShadowTime=null,this._messages=null}render(){const e=this._formattedContent;return X("div",{class:m3e.base},e?X("div",{class:m3e.content},e):null)}get _formattedContent(){const e=this._messages,i=this.accumulatedShadowTime;if(e==null||i==null)return null;const r=yet(i,i{const e=this._contentContainer,{screenPoint:i,accumulatedShadowTime:r}=this.viewModel.tooltip;return{contentContainer:e,screenPoint:i,accumulatedShadowTime:r}},e=>this._update(e),kt)}destroy(){this._updateHandle=en(this._updateHandle),this._contentWidget=et(this._contentWidget),this.container.contains(this._contentContainer)&&this.container.removeChild(this._contentContainer)}get testData(){var e;return{displayedValue:this._contentContainer.style.display==="none"?null:(e=this._contentWidget.container)==null?void 0:e.innerText}}_update({contentContainer:e,screenPoint:i,accumulatedShadowTime:r}){const{style:n}=e;i!=null?(n.display="block",n.transform=`translate(${i.x}px, ${i.y}px)`,this._contentWidget.accumulatedShadowTime=r):n.display="none"}_createContainer(){const e=document.createElement("div"),{style:i}=e;return i.position="absolute",i.top="0",i.left="0",e}};y([w()],bS.prototype,"viewModel",void 0),y([w()],bS.prototype,"container",void 0),y([w()],bS.prototype,"_contentContainer",void 0),y([w()],bS.prototype,"_contentWidget",void 0),bS=y([Z("esri.widgets.ShadowCast.components.ShadowTooltip")],bS);let Aw=class extends cn{constructor(t){super(t),this.colorPickerVisible=!0,this._valueSliderId=`value-slider-${Vf()}`,this._colorPickerId=`color-picker-${Vf()}`,this._valueSlider=new NG({visibleElements:{labels:!1,rangeLabels:!1},steps:Gs(30,"minutes","milliseconds"),labelFormatFunction:(e,i)=>{const r=Gs(e,"milliseconds","hours");return i==="tick"?nd(r,{maximumFractionDigits:0}):""}}),this._onColorChange=e=>{this.options.color=e}}initialize(){const t=({value:e})=>{this.options.value=e};this.addHandles([_e(()=>{const{value:e,minValue:i,maxValue:r}=this.options;return{value:e,minValue:i,maxValue:r}},({value:e,minValue:i,maxValue:r})=>{const n=this._valueSlider;n.min=i,n.max=r,n.values=[e];const s=r-i,o=Math.floor(Gs(s,"milliseconds","hours"));n.tickConfigs=[{mode:"count",values:2*o+1,labelsVisible:!1},{mode:"count",values:o+1,labelsVisible:!0}]},kt),this._valueSlider.on("thumb-change",t),this._valueSlider.on("thumb-drag",t)])}loadDependencies(){return Pl({label:()=>we(()=>import("./calcite-label-lSeWOYbm.js"),__vite__mapDeps([284,238]))})}destroy(){this._valueSlider=et(this._valueSlider)}render(){const t=this._messages.threshold,{color:e}=this.options;return X("div",{class:h3e.base},X(YG,{class:h3e.valueLabel,for:this._valueSliderId,label:t.valueLabel},this._valueSlider.render()),this.colorPickerVisible?X(Yue,{id:this._colorPickerId,label:t.colorLabel,value:e,onChange:this._onColorChange}):null)}get testData(){return{valueSlider:this._valueSlider}}};y([w()],Aw.prototype,"options",void 0),y([w()],Aw.prototype,"colorPickerVisible",void 0),y([w()],Aw.prototype,"testData",null),y([w()],Aw.prototype,"_valueSlider",void 0),y([w(),Gr("esri/widgets/ShadowCast/t9n/ShadowCast")],Aw.prototype,"_messages",void 0),Aw=y([Z("esri.widgets.ShadowCast.components.ThresholdConfigurator")],Aw);var UV;(function(t){t.Slider="slider"})(UV||(UV={}));const Iqt={hour:"2-digit",minute:"2-digit",timeZone:"UTC"},$qt=/(.*)\s(.*)/,Lqt={labelFormatFunction:Lre,min:0,max:1439,steps:15,rangeLabelInputsEnabled:!1,visibleElements:{labels:!1,rangeLabels:!1},tickConfigs:[{mode:"position",values:[0,360,720,1080,1439],labelsVisible:!0,tickCreatedFunction:(t,e,i)=>{e.classList.add(tt.primaryTick),i.classList.add(tt.primaryTickLabel);const r=i.innerText.match($qt);r&&(i.innerHTML=`${r[1]}
${r[2]}
`)}},{mode:"position",values:[120,240,480,600,840,960,1200,1320],tickCreatedFunction:(t,e)=>{e.classList.add(tt.secondaryTick)}}]};let Eh=class extends cn{constructor(t,e){super(t,e),this.viewModel=null,this.headingLevel=4,this.iconClass=Fb.widgetIcon,this.icon=null,this.visibleElements=new oje,this._defaultViewModel=null,this._timeSlider=new NG({...Lqt,container:document.createElement("div")}),this._tooltip=null,this._onTimezoneChange=i=>{this.viewModel.utcOffset=i},this._onDateChange=i=>{this.viewModel.date=i},t!=null&&t.viewModel||(this._defaultViewModel=new Mqt({view:t==null?void 0:t.view}),this.viewModel=this._defaultViewModel)}initialize(){this.addHandles([_e(()=>({viewModel:this.viewModel,slider:this._timeSlider}),t=>this._connectTimeSlider(t),kt),_e(()=>{var t;return{container:(t=this.view)==null?void 0:t.surface,viewModel:this.viewModel,tooltipVisible:this.visibleElements.tooltip}},({container:t,viewModel:e,tooltipVisible:i})=>{this._tooltip=et(this._tooltip),t!=null&&i&&(this._tooltip=new bS({viewModel:e,container:t}))},kt),_e(()=>({viewModel:this.viewModel,visible:this.visible}),({viewModel:t,visible:e})=>t.setRunning(e),kt)])}destroy(){this._timeSlider=et(this._timeSlider),this._defaultViewModel!=null&&this.viewModel!==this._defaultViewModel&&this._defaultViewModel.destroy()}loadDependencies(){return Pl({select:()=>we(()=>import("./calcite-select-0Yw6DsYN.js"),__vite__mapDeps([286,236,237,238,239,242,243,245])),option:()=>we(()=>import("./calcite-option-LMeeGK3H.js"),__vite__mapDeps([285,242]))})}render(){const{visibleElements:t,viewModel:e}=this,i=e.state===DO.Disabled;return X("div",{class:this.classes(Fb.base,tt.widget,tt.panel,{[tt.widgetDisabled]:i}),key:this},this._renderTimeRangeSection(),t.visualizationOptions?this._renderVisualizationOptionsSection():null)}get view(){var t;return(t=this.viewModel)==null?void 0:t.view}set view(t){this.viewModel&&(this.viewModel.view=t)}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get testData(){return{tooltip:this._tooltip}}_connectTimeSlider({viewModel:t,slider:e}){if(this.removeHandles(UV.Slider),e==null)return;const i=s=>Gs(s,"milliseconds","minutes"),r=s=>Gs(s,"minutes","milliseconds"),n=({index:s,value:o})=>{s===0?t.startTimeOfDay=r(o):t.endTimeOfDay=r(o)};this.addHandles([_e(()=>[t.startTimeOfDay,t.endTimeOfDay],s=>{e.values=s.map(i)},kt),e.on("thumb-change",n),e.on("thumb-drag",n),e.on("segment-drag",()=>{[t.startTimeOfDay,t.endTimeOfDay]=e.values.map(r)})],UV.Slider)}_renderTimeRangeSection(){const{visibleElements:t}=this;return t.timeRangeSlider||t.datePicker?X("section",{class:Fb.timeRange,key:"time-range"},X(Im,{level:this.headingLevel},this.messages.timeLabel),t.timeRangeSlider?this._renderTimeRange():null,t.datePicker?this._renderDatePicker():null):null}_renderTimeRange(){const{messages:t,viewModel:e,visibleElements:i}=this,{startTimeOfDay:r,endTimeOfDay:n}=e,[s,o]=[r,n].map(l=>js(new Date(l),Iqt));return[X("div",{class:Fb.timeRangeIndicator,key:"time-range-indicator"},By(t.timeRange,{start:s,end:o}),i.timezone?X(qd,{value:e.utcOffset,onChange:this._onTimezoneChange}):null),X("div",{afterCreate:this._timeSliderContainerAfterCreate,afterRemoved:this._timeSliderContainerAfterRemoved,bind:this,key:"time-slider-container"})]}_timeSliderContainerAfterCreate(t){var i;const e=(i=this._timeSlider)==null?void 0:i.container;e&&t.appendChild(e)}_timeSliderContainerAfterRemoved(t){var i;const e=(i=this._timeSlider)==null?void 0:i.container;e&&t.removeChild(e)}_renderDatePicker(){return X("div",{class:Fb.datePickerContainer,key:"date-picker"},X(zBe,{value:this.viewModel.date,onChange:this._onDateChange}))}_renderVisualizationOptionsSection(){const{headingLevel:t,messages:e,viewModel:i,visibleElements:r}=this,n=r.colorPicker,s=o=>this.classes(i.visualizationType===o?null:Fb.visualizationConfigHidden);return X("section",{class:Fb.visualization,key:"visualization"},X(Im,{level:t},e.visualizationLabel),this._renderVisualizationSelect(),X("div",{class:s(qa.Threshold),key:"threshold-configurator"},X(Aw,{colorPickerVisible:n,options:i.thresholdOptions})),X("div",{class:s(qa.Duration),key:"duration-configurator"},X(vM,{colorPickerVisible:n,options:i.durationOptions})),X("div",{class:s(qa.Discrete),key:"discrete-configurator"},X(yM,{colorPickerVisible:n,options:i.discreteOptions})))}_renderVisualizationSelect(){const t=this.messages,e=this.viewModel.visualizationType;return X("calcite-select",{bind:this,class:Fb.visualizationSelect,key:"visualization-select",label:t.visualizationLabel,onCalciteSelectChange:this._onVisualizationTypeChange},[{type:qa.Threshold,label:t.threshold.label},{type:qa.Duration,label:t.duration.label},{type:qa.Discrete,label:t.discrete.label}].map(({type:i,label:r})=>X("calcite-option",{selected:i===e,value:i},r)))}_onVisualizationTypeChange(t){var i;const e=(i=t.target.selectedOption)==null?void 0:i.value;this.viewModel.visualizationType=e??qa.Threshold}};y([w()],Eh.prototype,"viewModel",void 0),y([w()],Eh.prototype,"view",null),y([w()],Eh.prototype,"headingLevel",void 0),y([w()],Eh.prototype,"iconClass",void 0),y([w()],Eh.prototype,"icon",void 0),y([w()],Eh.prototype,"label",null),y([w({type:oje,nonNullable:!0})],Eh.prototype,"visibleElements",void 0),y([w(),Gr("esri/widgets/ShadowCast/t9n/ShadowCast")],Eh.prototype,"messages",void 0),y([w()],Eh.prototype,"_defaultViewModel",void 0),y([w()],Eh.prototype,"_timeSlider",void 0),y([w()],Eh.prototype,"_tooltip",void 0),Eh=y([Z("esri.widgets.ShadowCast")],Eh);const Dqt=Eh,Nqt=t=>new Dqt({view:t,visible:!1,container:"shadowcast-container"});let bv=class extends Xs(Ue){constructor(e){super(e),this.type="plane",this.position=null,this.heading=0,this.tilt=0,this.width=10,this.height=10}equals(e){return this.heading===e.heading&&this.tilt===e.tilt&&FO(this.position,e.position)&&this.width===e.width&&this.height===e.height}};y([w({readOnly:!0,json:{read:!1,write:!0}})],bv.prototype,"type",void 0),y([w({type:mt}),Dv()],bv.prototype,"position",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:360}}),Dv(),Ci(t=>d5.normalize(Vh(t),0,!0))],bv.prototype,"heading",void 0),y([w({type:Number,nonNullable:!0,range:{min:0,max:360}}),Dv(),Ci(t=>d5.normalize(Vh(t),0,!0))],bv.prototype,"tilt",void 0),y([w({type:Number,nonNullable:!0}),Dv()],bv.prototype,"width",void 0),y([w({type:Number,nonNullable:!0}),Dv()],bv.prototype,"height",void 0),bv=y([Z("esri.analysis.SlicePlane")],bv);const Fqt=bv;let wv=class extends uVe{constructor(e){super(e),this.type="slice",this.tiltEnabled=!1,this.shape=null,this.excludeGroundSurface=!1}get excludedLayers(){return this._get("excludedLayers")||new it}set excludedLayers(e){this._set("excludedLayers",sd(e,this._get("excludedLayers")))}get requiredPropertiesForEditing(){var e;return[(e=this.shape)==null?void 0:e.position]}clear(){this.shape=null}};y([w({type:["slice"]})],wv.prototype,"type",void 0),y([w()],wv.prototype,"tiltEnabled",void 0),y([w({types:{key:"type",base:null,typeMap:{plane:Fqt},defaultKeyValue:"plane"}})],wv.prototype,"shape",void 0),y([w({cast:nP,clonable:t=>t.slice()})],wv.prototype,"excludedLayers",null),y([w({type:Boolean,nonNullable:!0})],wv.prototype,"excludeGroundSurface",void 0),y([w({readOnly:!0})],wv.prototype,"requiredPropertiesForEditing",null),wv=y([Z("esri.analysis.SliceAnalysis")],wv);const lje=wv,UX=new Set;let Wg=class extends hc{constructor(e){super(e),this.analysis=null,this.supportedViewType="3d",this.unsupportedErrorMessage="SliceViewModel is only supported in 3D views.",UX.add(this)}destroy(){UX.delete(this)}get state(){return this.disabled||!this.ready?"disabled":this.tool==null?"ready":this.tool.state}get shape(){return this.analysis.shape}set shape(e){this.analysis.shape=e}get tiltEnabled(){return this.analysis.tiltEnabled}set tiltEnabled(e){this.analysis.tiltEnabled=e}get layersMode(){var e;return((e=this.tool)==null?void 0:e.layersMode)??"none"}get excludedLayers(){return this.analysis.excludedLayers}set excludedLayers(e){this.analysis.excludedLayers=it.isCollection(e)?e:new it(e)}get excludeGroundSurface(){return this.analysis.excludeGroundSurface}set excludeGroundSurface(e){this.analysis.excludeGroundSurface=e}async start(){await super.start(),UX.forEach(e=>{e.view===this.view&&e!==this&&e.clear()}),this.analysisView!=null&&(this.analysisView.active=!0)}enterExcludeLayerMode(){this.tool!=null&&this.tool.enterExcludeLayerMode()}exitExcludeLayerMode(){this.tool!=null&&this.tool.exitExcludeLayerMode()}onConnectToAnalysisView(e){e.active=!0}constructAnalysis(){return new lje}};y([w({type:lje})],Wg.prototype,"analysis",void 0),y([w({readOnly:!0})],Wg.prototype,"state",null),y([w()],Wg.prototype,"shape",null),y([w()],Wg.prototype,"tiltEnabled",null),y([w()],Wg.prototype,"layersMode",null),y([w()],Wg.prototype,"excludedLayers",null),y([w({nonNullable:!0})],Wg.prototype,"excludeGroundSurface",null),Wg=y([Z("esri.widgets.Slice.SliceViewModel")],Wg);const cje=Wg,Up="esri-slice",vh={base:Up,widgetIcon:si.slice,actions:`${Up}__actions`,cancelButton:`${Up}__cancel-button`,container:`${Up}__container`,error:`${Up}__error`,excludeButton:`${Up}__exclude-button`,hint:`${Up}__hint`,hintText:`${Up}__hint-text`,layerItem:`${Up}__layer-item`,layerList:`${Up}__layer-list`,layerListHeading:`${Up}__layer-list-title`,newSliceButton:`${Up}__clear-button`};let Zc=class extends cn{constructor(e,i){super(e,i),this.headingLevel=3,this.iconClass=vh.widgetIcon,this.icon=null,this.messages=null,this.viewModel=new cje,this._onNewSliceClick=()=>{$m(this.viewModel.start())}}loadDependencies(){return Pl({action:()=>we(()=>import("./calcite-action-mEzyoc-Z.js"),__vite__mapDeps([290,291,247,237,239,240,241,242,243,244,245,246])),button:()=>we(()=>import("./calcite-button-tOn16zeN.js"),__vite__mapDeps([234,235,236,237,238,239,240,241,242,243,244,245,246,247])),"list-item":()=>we(()=>import("./calcite-list-item-OtIyVNHT.js"),__vite__mapDeps([309,237,310,240,241,242,244,239,291,247,243,245,246])),list:()=>we(()=>import("./calcite-list-LJfGqLbO.js"),__vite__mapDeps([311,237,242,310,239,253,240,241,244,245,312,236,238,243,306,246,247,257]))})}get active(){return this.viewModel.active}get analysis(){return this.viewModel.analysis}set analysis(e){this.viewModel.analysis=e}get excludedLayers(){return this.viewModel.excludedLayers}set excludedLayers(e){this.viewModel.excludedLayers=e}get excludeGroundSurface(){return this.viewModel.excludeGroundSurface}set excludeGroundSurface(e){this.viewModel.excludeGroundSurface=e}get label(){var e;return((e=this.messages)==null?void 0:e.widgetLabel)??""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}get hasVoxelLayers(){var i;const e=(i=this.viewModel)==null?void 0:i.view;return e!=null&&e.allLayerViews.some(r=>r.type==="voxel-3d")}render(){return X("div",{class:this.classes(vh.base,tt.widget,tt.panel),role:"presentation"},this.visible?X("div",{class:vh.container},this.viewModel.supported?[this._renderHint(),this._renderLayerList(),this._renderActions()]:this._renderUnsupported()):null)}_renderUnsupported(){return X("div",{class:vh.error,key:"unsupported"},X("p",null,this.messages.unsupported))}_renderHint(){const{hasVoxelLayers:e,messages:i,viewModel:r}=this,{active:n,layersMode:s,state:o}=r;let l=null;return n&&(s==="exclude"?l=i.excludeHint:o==="ready"&&(l=e?i.voxelHint:i.hint)),l?X("div",{class:vh.hint,key:"hint"},X("p",{class:vh.hintText},l),X("p",{class:vh.hintText},i.verticalHint)):null}_renderLayerList(){const{excludedLayers:e,excludeGroundSurface:i,headingLevel:r,messages:n,viewModel:s}=this,{layersMode:o,state:l}=s,c=l==="slicing"||l==="sliced",f=e?e.toArray().map(_=>this._renderLayerItem({uid:_.uid,title:_.title,onClick:()=>(this.excludedLayers.remove(_),!1)})):[];return i&&f.push(this._renderLayerItem({uid:"ground",title:n.ground,onClick:()=>(this.excludeGroundSurface=!1,!1)})),o!=="exclude"&&c&&f.length!==0?X("div",{class:vh.layerList,key:"settings"},X(Im,{class:vh.layerListHeading,level:r},n.excludedLayers),X("calcite-list",{selectionMode:"none"},f)):null}_renderActions(){const{messages:e,viewModel:i}=this,{active:r,state:n}=i,s=n==="disabled",o=n==="slicing"||n==="sliced",l=i.layersMode==="exclude",c=[];return r&&!o||l||c.push(X("calcite-button",{class:vh.newSliceButton,disabled:s,key:"new-slice",onclick:this._onNewSliceClick},e.newSlice)),o&&!l&&c.push(X("calcite-button",{appearance:"outline-fill",class:vh.excludeButton,disabled:s,key:"exclude",onclick:()=>i.enterExcludeLayerMode()},e.excludeLayer)),r&&l&&c.push(X("calcite-button",{appearance:"outline-fill",class:vh.cancelButton,disabled:s,key:"cancel-exclude",onclick:()=>i.exitExcludeLayerMode()},e.cancel)),c.length===0?null:X("div",{class:vh.actions},c)}_renderLayerItem(e){return X("calcite-list-item",{class:vh.layerItem,key:e.uid,label:e.title??""},X("calcite-action",{icon:"x",onclick:e.onClick,scale:"s",slot:"actions-end",text:this.messages.includeLayer}))}};y([w()],Zc.prototype,"active",null),y([w({constructOnly:!0,nonNullable:!0})],Zc.prototype,"analysis",null),y([w()],Zc.prototype,"excludedLayers",null),y([w()],Zc.prototype,"excludeGroundSurface",null),y([w()],Zc.prototype,"headingLevel",void 0),y([w()],Zc.prototype,"iconClass",void 0),y([w()],Zc.prototype,"icon",void 0),y([w()],Zc.prototype,"label",null),y([w(),Gr("esri/widgets/Slice/t9n/Slice")],Zc.prototype,"messages",void 0),y([w()],Zc.prototype,"view",null),y([w({type:cje})],Zc.prototype,"viewModel",void 0),y([w()],Zc.prototype,"visible",null),y([w()],Zc.prototype,"hasVoxelLayers",null),Zc=y([Z("esri.widgets.Slice")],Zc);const kqt=Zc,zqt=t=>new kqt({view:t,container:"slicing-container"}),n1i=it.ofType({key:"type",defaultKeyValue:"button",base:lP,typeMap:{button:cP,toggle:LB}}),s1i=new cP({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:si.zoomInMagnifyingGlass}),Uqt=new cP({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:si.trash}),o1i=new cP({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:si.zoomInMagnifyingGlass}),a1i=new LB({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:si.table,value:!1}),Vqt=2500,uje={type:"CIMPictureMarker",primitiveName:"headingOverride",enable:!0,anchorPoint:{x:0,y:-.5},anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:36,billboardMode3D:"FaceNearPlane",invertBackfaceTexture:!0,scaleX:1,textureFilter:"Picture",url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAkCAYAAACe0YppAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYaSURBVHgBvVfNb1VFFD/nzP16xRYJKYREEiJoDLLShQkrSNzoHv8I2QgxwY8FJWHhxoVxISEu2AordWNiQjAxEBeEsKAmhCCwkPDRAn1t33v33jnH37n3Fam0pa8kTjOde+/MnN/5+J0z85jW08yYTpxgfzx0bS+fO0R0YHqyeb9w7YEtLTv+9rSdOH7ciNleJJJX/Do1JQ3AltdlT35fiN6gG8kD8akdmzO+6w/zM7wdw725rUY78DBXtmATA6PZntFgm9Kjm6o/HFJpdi5Xhp+16sDBC+H+gUmZfjIXHKC+35U42ZHZfpe30BZS7okNFnhu8wTRk2ek5LEV2q+N8nEj6yuNVRjHddftrt4ahyJbOxF+Uppi/Rf47NlA05Pp9vkyRNkkD8sqUJHwOGfSpYFQFXhTJryQBaZSeAxbFus+U1K0gJm2oy3QKwuZzqeuSK5kpW6BEsE6+nCsAHDXQWuaOljzU8uP/ToxUW4KcwKg8QzOSdFL6Swm0hurAC7N2qIW7ncwNgYKF4la3/w7RnzrUK29KseXWqmTKXGl45Zrd9CLrsSjr96fcw4kS46mTsJznSTrVBR6VQJQdDbpZTWexxgCYCFz30cquD8oYVQgtUAUzfo8wGtqGoNRFmFZ1KKulJMQu3Vpm/I8Pup3ekvES57GaabXo4lsszEA6zrkhcmAAkBNshi59O9wVsokBLZUCQAxllXVBkyCDRQuTlLLiLSEqw3gfUqU0kVdsKymsnzyPLm8fXZxDxVZgvUhg9QyaKDI7AhpSlRVEaA83JM+/V8pGO0PMTHyZwra9FQVk4i1e0D6dPK9v5agkmXAhc0Bw5MjlAQQE0lSDbUmbBX4kGfsiiQWuSZtdle1S4F73cUKJgviyw4mmmqlVSoR/FAK2d1noWQZ8N79MySw0tgNzhN00jRFaPM6y3IyLWBxXuOdvMfhaIy1MQctmvnEMGrMq2Y/ekC3dHF14I84gmZP2s0pgiJFHVwYhIIrMC1zgT4fQgsS0CG48LWtslAsgeKZK5U1c5Slj+nEvvJZqOWubr5ks8iE3bVqCMQCz4p5aiUqpMrOdHz2qLFTxAMSPLwY8WpmntNwrXIMCWvESGH+7n9hVi6ZJ6/sR5gnycFFQgsCQEEB8T9TbsCGy4PrZrEBjGyIt4EApoGRXWKP6Mt3fnvOvhWBjR4gdjtJEDmGQQkBSCS6Teys5qECABTPWOBwcPWgAPIU+E2+Rq3J8lsrQawMHNPbqAXvRqasWcMB/mK42N3twM6/FsbJTZK2Fru15K7niPVIp6RHn++9vRKErAg8ta+MFq4LBxAJKY1EajpxLj5KUzFzOMTni4btxoUzXPzIIOwLnEPxGVqlyWoTdO/WNRUXJhDmAgNAJVd0eABj8FTCvLbpEnxdOycJlFNXVq6MDvzthwOQ654LaMGGVofQWIWtXhM9xaCQp85QIZFMPXcpuUPH3uquJj6htVonvySD+KY6c2AulPAzHdVaZElvPCGBgvkIRUECr1J4qmV6LdGyJvAnu+94HZMla1Eg1AuGVyQWnNCwzqsUXK5+AIsUyPRc1Rbpi93X1xK9tsXtkj9U7INWSWvU0DaZ6OlVAmUDiqgbrwY2Z3ThRVKFXrgi/R0x9GMplxAyER6ynAtZin1DQoLVznLMU+/mywMf3dlDpbyMlbjLQDhLw/Sh24sm5dhTrlHKgS/T0X2zLw/sLeGr5OlEbg2uHwAFw5reKuKsJj8kcIj0zq9H5PqAj+z6E8y+YRIaUhnAEOrcWgv9m3shQ1H7mz5duVJtDLhZqZcNlrEDwXKwCzncdFg+PJeVf1m3uPUupLR7Hq6tHNyLhw1TCmdGbm0BmaUjr63LzaMBH943D9f+yO5uZ7HfcLktqdwqMU0jtPUDN6vDOfzgKFrXtta6q83vfHU4M5KoURbT4W3zsPIqrgQFO8GozV8ocZGOTN4dRdRowN6CnOLmKkk5t7H1i+HPNGJj2kj7buYajoRXh2+36eOt+2nENrrF3ozODEmFC0D4hjbQNgYc+DSYjd9qqGSJXqL/tZ16/DWdfvw9bbCt41hcpYn9RAEX9Q22fwC74ny5v9iplQAAAABJRU5ErkJggg=="},Bqt=new nx({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:14,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:17,ymax:17},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[8.5,0],[7.02,.13],[5.59,.51],[4.25,1.14],[3.04,1.99],[1.99,3.04],[1.14,4.25],[.51,5.59],[.13,7.02],[0,8.5],[.13,9.98],[.51,11.41],[1.14,12.75],[1.99,13.96],[3.04,15.01],[4.25,15.86],[5.59,16.49],[7.02,16.87],[8.5,17],[9.98,16.87],[11.41,16.49],[12.75,15.86],[13.96,15.01],[15.01,13.96],[15.86,12.75],[16.49,11.41],[16.87,9.98],[17,8.5],[16.87,7.02],[16.49,5.59],[15.86,4.25],[15.01,3.04],[13.96,1.99],[12.75,1.14],[11.41,.51],[9.98,.13],[8.5,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Round",joinStyle:"Round",lineStyle3D:"Strip",miterLimit:10,width:2,color:[255,255,255,255]},{type:"CIMSolidFill",enable:!0,color:[0,122,194,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:16,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:17,ymax:17},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[8.5,0],[7.02,.13],[5.59,.51],[4.25,1.14],[3.04,1.99],[1.99,3.04],[1.14,4.25],[.51,5.59],[.13,7.02],[0,8.5],[.13,9.98],[.51,11.41],[1.14,12.75],[1.99,13.96],[3.04,15.01],[4.25,15.86],[5.59,16.49],[7.02,16.87],[8.5,17],[9.98,16.87],[11.41,16.49],[12.75,15.86],[13.96,15.01],[15.01,13.96],[15.86,12.75],[16.49,11.41],[16.87,9.98],[17,8.5],[16.87,7.02],[16.49,5.59],[15.86,4.25],[15.01,3.04],[13.96,1.99],[12.75,1.14],[11.41,.51],[9.98,.13],[8.5,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Round",joinStyle:"Round",lineStyle3D:"Strip",miterLimit:10,width:0,color:[255,255,255,255]},{type:"CIMSolidFill",enable:!0,color:[0,0,0,66]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,offsetX:0,offsetY:-1},uje],angleAlignment:"Map"},primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"headingOverride",propertyName:"Rotation",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Rotation override",expression:"360 - $feature.heading",returnType:"Default"}},{type:"CIMPrimitiveOverride",primitiveName:"headingOverride",propertyName:"TintColor",valueExpressionInfo:{type:"CIMExpressionInfo",title:"TintColor override",expression:"IIF(IsEmpty($feature.heading), [255, 255, 255, 0], [255, 255, 255, 1])",returnType:"Default"}}]}});let Yg=class extends LG(Dn.EventedMixin(ze)){constructor(){super(...arguments),this._geolocationUsable=!0,this.geolocationOptions=null,this.goToLocationEnabled=!0,this.graphic=new Ml({symbol:Bqt}),this.scale=null,this.rotationEnabled=!0,this.view=null}initialize(){Are()||(this._geolocationUsable=!1),this.addHandles([_e(()=>{var e;return(e=this.view)==null?void 0:e.type},()=>this._handleViewTypeChange(),ii)])}destroy(){this._clearGraphic(),this.view=null}_clearGraphic(){const{view:e,graphic:i}=this;e&&i&&e.graphics.remove(i)}_addGraphic(){const{view:e,graphic:i}=this;e!=null&&e.graphics&&i&&!e.graphics.includes(i)&&e.graphics.push(i)}_handleViewTypeChange(){var e;uje.enable=((e=this.view)==null?void 0:e.type)==="2d"}_getScaleWithinConstraints(e,i){if(!i)return e;if(i.type==="2d"){const{effectiveMaxScale:r,effectiveMinScale:n}=i.constraints;return Math.min(n,Math.max(r,e))}return e}_getScale(e){const{scale:i}=this,r=typeof i=="number"?i:Vqt;return this._getScaleWithinConstraints(r,e)}_getHeading(e,i){var o;const r=i==null?void 0:i.spatialReference,n=(r==null?void 0:r.isWebMercator)||(r==null?void 0:r.isGeographic),s=(o=e.coords)==null?void 0:o.heading;return!n||typeof s!="number"||isNaN(s)||s<0||s>360?null:s}_addHeading(e){const{heading:i,target:r,view:n}=e;n&&i!==null&&(n.type!=="3d"?n.type==="2d"&&(r.rotation=360-i):r.heading=i)}async _animatePoint(e,i,r,n){const{view:s}=this;if(!this.goToLocationEnabled||!s)return;const o={target:e,scale:i};this.rotationEnabled&&this._addHeading({heading:r,target:o,view:s});const l={signal:n.signal};St(l),await this.callGoTo({target:o,options:l})}async updatePosition(e,i){try{const r=this.view,n=await VVe({position:e,view:r},{signal:i.signal}),{graphic:s}=this,{timestamp:o,coords:l}=e,{accuracy:c,altitude:f,altitudeAccuracy:_,latitude:x,longitude:T,speed:A}=l,M=this._getHeading(e,r),I={timestamp:o,accuracy:c,altitude:f,altitudeAccuracy:_,heading:M,latitude:x,longitude:T,speed:A};s&&(s.geometry=n,s.attributes=I);const L=this._getScale(r);await this._animatePoint(n,L,M,i)}catch(r){if(!sn(r))throw new se("geolocation-positioning:invalid-point","Cannot position invalid point",{error:r})}return e}};y([w()],Yg.prototype,"_geolocationUsable",void 0),y([w()],Yg.prototype,"geolocationOptions",void 0),y([w()],Yg.prototype,"goToLocationEnabled",void 0),y([w({type:Ml,nonNullable:!0})],Yg.prototype,"graphic",void 0),y([w()],Yg.prototype,"scale",void 0),y([w()],Yg.prototype,"rotationEnabled",void 0),y([w()],Yg.prototype,"view",void 0),Yg=y([Z("esri.widgets.support.GeolocationPositioning")],Yg);const jqt=Yg;async function Gqt(){const t=await lE("esri/widgets/Locate/t9n/Locate");return new hE({title:t.currentLocation,fieldInfos:[{fieldName:"timestamp",label:t.timestamp,format:{dateFormat:"short-date-short-time"}},{fieldName:"latitude",label:t.latitude,format:{places:4,digitSeparator:!0}},{fieldName:"longitude",label:t.longitude,format:{places:4,digitSeparator:!0}},{fieldName:"accuracy",label:t.accuracy,format:{places:0,digitSeparator:!0}},{fieldName:"altitude",label:t.altitude,format:{places:0,digitSeparator:!0}},{fieldName:"altitudeAccuracy",label:t.altitudeAccuracy,format:{places:0,digitSeparator:!0}},{fieldName:"heading",label:t.heading,format:{places:0,digitSeparator:!0}},{fieldName:"speed",label:t.speed,format:{places:0,digitSeparator:!0}}],actions:[Uqt.clone()],content:[{type:"fields"}]})}let Mw=class extends jqt{constructor(t){super(t),this._locateController=null,this.popupEnabled=!0,this.locate=this.locate.bind(this)}initialize(){this.addHandles([oE(()=>{var r;const{graphic:t,view:e}=this;if(!t)return;((r=e==null?void 0:e.graphics)==null?void 0:r.includes(t))&&this._updatePopupTemplate(t)})])}destroy(){this.cancelLocate()}get state(){var t;return this._geolocationUsable?(t=this.view)!=null&&t.ready?this._locateController?"locating":"ready":"disabled":"feature-unsupported"}async locate(){if(this.cancelLocate(),this.state==="disabled")throw new se("locate:disabled-state","Cannot locate when disabled.");if(this.state==="feature-unsupported")throw new se("locate:feature-unsupported-state","Cannot locate in unsecure domain.");const t=new AbortController;this._locateController=t;try{const e=await UVe(this.geolocationOptions);if(await this.updatePosition(e,t),this._locateController!==t)return null;const{graphic:i}=this;return i&&await this._updatePopupTemplate(i),this._addGraphic(),this.emit("locate",{position:e}),this._locateController=null,e}catch(e){if(sn(e))return null;throw t===this._locateController&&(this._locateController=null),this.emit("locate-error",{error:e}),e}}cancelLocate(){this._clearGraphic(),this._locateController&&this._locateController.abort(),this._locateController=null}async _updatePopupTemplate(t){if(!this.popupEnabled)return;const e=await Gqt(),i=t!==this.graphic;this.destroyed||i||(t.popupTemplate=e)}};y([w()],Mw.prototype,"_locateController",void 0),y([w()],Mw.prototype,"popupEnabled",void 0),y([w({readOnly:!0})],Mw.prototype,"state",null),y([w()],Mw.prototype,"locate",null),y([w()],Mw.prototype,"cancelLocate",null),Mw=y([Z("esri.widgets.Locate.LocateViewModel")],Mw);const hje=Mw,VX={base:"esri-locate",widgetIcon:si.northNavigation},Hqt="gps-off",dje="esri.widgets.Locate",w3e=Ce.getLogger(dje);let vl=class extends cn{constructor(t,e){super(t,e),this.iconClass=VX.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.viewModel=new hje}loadDependencies(){return Pl({icon:()=>we(()=>import("./calcite-icon-itD416se.js"),__vite__mapDeps([248,245,242])),loader:()=>we(()=>import("./calcite-loader-Z65agR8e.js"),__vite__mapDeps([294,246,247]))})}get geolocationOptions(){return this.viewModel.geolocationOptions}set geolocationOptions(t){this.viewModel.geolocationOptions=t}get goToLocationEnabled(){return this.viewModel.goToLocationEnabled}set goToLocationEnabled(t){this.viewModel.goToLocationEnabled=t}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get graphic(){return this.viewModel.graphic}set graphic(t){this.viewModel.graphic=t}get label(){var t;return((t=this.messages)==null?void 0:t.widgetLabel)??""}set label(t){this._overrideIfSome("label",t)}get popupEnabled(){return this.viewModel.popupEnabled}set popupEnabled(t){this.viewModel.popupEnabled=t}get rotationEnabled(){return this.viewModel.rotationEnabled}set rotationEnabled(t){this.viewModel.rotationEnabled=t}get scale(){return this.viewModel.scale}set scale(t){this.viewModel.scale=t}get useHeadingEnabled(){return pm(w3e,"useHeadingEnabled",{replacement:"rotationEnabled",version:"4.27",warnOnce:!0}),this.viewModel.rotationEnabled}set useHeadingEnabled(t){pm(w3e,"useHeadingEnabled",{replacement:"rotationEnabled",version:"4.27",warnOnce:!0}),this.viewModel.rotationEnabled=t}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}cancelLocate(){this.viewModel.cancelLocate()}locate(){return this.viewModel.locate()}render(){const{state:t}=this.viewModel,e=t==="locating"?this.messagesCommon.cancel:this.messages.title;return X("div",{"aria-label":e,bind:this,class:this.classes(VX.base,tt.widget,tt.widgetButton,{[tt.disabled]:t==="disabled",[tt.hidden]:t==="feature-unsupported"}),hidden:t==="feature-unsupported",onclick:this._locate,onkeydown:this._locate,role:"button",tabIndex:0,title:e},this._renderIcon(),X("span",{class:si.fontFallbackText},this.messages.title))}_renderIcon(){const{icon:t,iconClass:e,viewModel:i}=this;return(i==null?void 0:i.state)==="locating"?X("calcite-loader",{inline:!0,key:"loader",label:"",scale:"s",type:"indeterminate"}):t?this._renderCalciteIcon(t):e&&e!==VX.widgetIcon?this._renderLegacyIcon(e):this._renderCalciteIcon(Hqt)}_renderCalciteIcon(t){return X("calcite-icon",{icon:t,key:"icon",scale:"s"})}_renderLegacyIcon(t){return X("span",{"aria-hidden":"true",class:t,key:"legacy-icon"})}_locate(){const{viewModel:t}=this;t.state==="locating"?t.cancelLocate():t.locate()}};y([w()],vl.prototype,"geolocationOptions",null),y([w()],vl.prototype,"goToLocationEnabled",null),y([w()],vl.prototype,"goToOverride",null),y([w()],vl.prototype,"graphic",null),y([w()],vl.prototype,"iconClass",void 0),y([w()],vl.prototype,"icon",void 0),y([w()],vl.prototype,"label",null),y([w(),Gr("esri/widgets/Locate/t9n/Locate")],vl.prototype,"messages",void 0),y([w(),Gr("esri/t9n/common")],vl.prototype,"messagesCommon",void 0),y([w()],vl.prototype,"popupEnabled",null),y([w()],vl.prototype,"rotationEnabled",null),y([w()],vl.prototype,"scale",null),y([w()],vl.prototype,"useHeadingEnabled",null),y([w()],vl.prototype,"view",null),y([w({type:hje}),Kce(["locate","locate-error"])],vl.prototype,"viewModel",void 0),y([bo()],vl.prototype,"_locate",null),vl=y([Z(dje)],vl);const qqt=vl,Wqt=t=>new qqt({view:t});class Yqt{constructor(e,i=0,r=e.lods[e.lods.length-1].level){this.tileInfo=e,this.minLOD=i,this.maxLOD=r,e.lodAt(i)||(this.minLOD=e.lods[0].level),e.lodAt(r)||(this.maxLOD=e.lods[e.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(e,i,r){var s;const n=(s=this.tileInfo)==null?void 0:s.lodAt(e);return!n||ethis.maxLOD?"unavailable":n.cols&&n.rows?r>=n.cols[0]&&r<=n.cols[1]&&i>=n.rows[0]&&i<=n.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(e,i,r,n){await Hk(n);const s=this.getAvailability(e,i,r);if(s==="unavailable")throw new se("tile-map:tile-unavailable","Tile is not available",{level:e,row:i,col:r});return s}async fetchAvailabilityUpsample(e,i,r,n,s){await Hk(s),n.level=e,n.row=i,n.col=r;const o=this.tileInfo;return o.updateTileInfo(n),this.fetchAvailability(e,i,r,s).catch(l=>{if(sn(l))throw l;if(o.upsampleTile(n))return this.fetchAvailabilityUpsample(n.level,n.row,n.col,n,s);throw l})}}function Xqt(t,e=!1){return t<=td?e?new Array(t).fill(0):new Array(t):new Uint32Array(t)}class l9{constructor(e){this._validateJSON(e);const{location:i,data:r}=e;this.location=Object.freeze(Re(i));const n=this.location.width,s=this.location.height;let o=!0,l=!0;const c=Math.ceil(n*s/32),f=Xqt(c);let _=0;for(let x=0;x>5,o=this._availability;return s<0||s>o.length?"unknown":o[s]&1<f.data).catch(f=>{if(f&&f.details&&f.details.httpStatus===422)return{location:{top:n,left:s,width:o,height:l},valid:!0,data:Mje(o*l,0)};throw f}).then(f=>{if(f.location&&(f.location.top!==n||f.location.left!==s||f.location.width!==o||f.location.height!==l))throw new se("tilemap:location-mismatch","Tilemap response for different location than requested",{response:f,definition:{top:n,left:s,width:o,height:l}});return l9.fromJSON(f)})}static fromJSON(e){return Object.freeze(new l9(e))}_validateJSON(e){if(!(e!=null&&e.location))throw new se("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new se("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new se("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new se("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new se("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function x3e(t){return`${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`}function Zqt(t){var r;let e;if((r=t.service.tileServers)!=null&&r.length){const n=t.service.tileServers;e=`${n&&n.length?n[t.row%n.length]:t.service.url}/tilemap/${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`}else e=`${t.service.url}/tilemap/${t.level}/${t.row}/${t.col}/${t.width}/${t.height}`;const i=t.service.query;return i&&(e=`${e}?${i}`),e}var VS;let Xg=VS=class extends ze{constructor(t){super(t),this._pendingTilemapRequests={},this.request=bi,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new qB(2*N2.MEGABYTES),this.addHandles([_e(()=>{const{layer:t}=this;return[t==null?void 0:t.parsedUrl,t==null?void 0:t.tileServers,t==null?void 0:t.apiKey,t==null?void 0:t.customParameters]},()=>this._initializeTilemapDefinition(),ii)])}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}fetchTilemap(t,e,i,r){if(!this.layer.tileInfo.lodAt(t)||tthis.effectiveMaxLOD)return Promise.reject(new se("tilemap-cache:level-unavailable",`Level ${t} is unavailable in the service`));const n=this._tmpTilemapDefinition,s=this._tilemapFromCache(t,e,i,n);if(s)return Promise.resolve(s);const o=r==null?void 0:r.signal;return r={...r,signal:null},new Promise((l,c)=>{Yl(o,()=>c(ur()));const f=x3e(n);let _=this._pendingTilemapRequests[f];if(!_){_=l9.fromDefinition(n,r).then(T=>(this._tilemapCache.put(f,T,T.byteSize),T));const x=()=>{delete this._pendingTilemapRequests[f]};this._pendingTilemapRequests[f]=_,_.then(x,x)}_.then(l,c)})}getAvailability(t,e,i){if(!this.layer.tileInfo.lodAt(t)||tthis.effectiveMaxLOD)return"unavailable";const r=this._tilemapFromCache(t,e,i,this._tmpTilemapDefinition);return r?r.getAvailability(e,i):"unknown"}fetchAvailability(t,e,i,r){return!this.layer.tileInfo.lodAt(t)||tthis.effectiveMaxLOD?Promise.reject(new se("tile-map:tile-unavailable","Tile is not available",{level:t,row:e,col:i})):this.fetchTilemap(t,e,i,r).catch(n=>n).then(n=>{if(n instanceof l9){const s=n.getAvailability(e,i);if(s==="unavailable")throw new se("tile-map:tile-unavailable","Tile is not available",{level:t,row:e,col:i});return s}if(sn(n))throw n;return"unknown"})}fetchAvailabilityUpsample(t,e,i,r,n){r.level=t,r.row=e,r.col=i;const s=this.layer.tileInfo;s.updateTileInfo(r);const o=this.fetchAvailability(t,e,i,n).catch(l=>{if(sn(l))throw l;if(s.upsampleTile(r))return this.fetchAvailabilityUpsample(r.level,r.row,r.col,r,n);throw l});return this._fetchAvailabilityUpsamplePrefetch(r.id,t,e,i,n,o),o}async _fetchAvailabilityUpsamplePrefetch(t,e,i,r,n,s){if(!this._prefetchingEnabled||t==null)return;const o=`prefetch-${t}`;if(this.hasHandles(o))return;const l=new AbortController;s.then(()=>l.abort(),()=>l.abort());let c=!1;const f=rr(()=>{c||(c=!0,l.abort())});if(this.addHandles(f,o),await OGe(10,l.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),xo(l))return;const _=new Tj(t,e,i,r),x={...n,signal:l.signal},T=this.layer.tileInfo;for(let A=0;VS._prefetches.length{VS._prefetches.removeUnordered(M)};M.then(I,I)}}_initializeTilemapDefinition(){var r;if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:e,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:PT({...t.query,...i,token:e??((r=t.query)==null?void 0:r.token)}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(t,e,i,r){r.level=t,r.row=e-e%this.size,r.col=i-i%this.size;const n=x3e(r);return this._tilemapCache.get(n)}get test(){const t=this;return{get prefetchingEnabled(){return t._prefetchingEnabled},set prefetchingEnabled(e){t._prefetchingEnabled=e},hasTilemap:(e,i,r)=>!!t._tilemapFromCache(e,i,r,t._tmpTilemapDefinition)}}};Xg._maxPrefetch=4,Xg._prefetches=new Pi({initialSize:VS._maxPrefetch}),y([w({constructOnly:!0})],Xg.prototype,"layer",void 0),y([w({constructOnly:!0})],Xg.prototype,"minLOD",void 0),y([w({constructOnly:!0})],Xg.prototype,"maxLOD",void 0),y([w({constructOnly:!0})],Xg.prototype,"request",void 0),y([w({constructOnly:!0})],Xg.prototype,"size",void 0),Xg=VS=y([Z("esri.layers.support.TilemapCache")],Xg);const Jqt=t=>{let e=class extends t{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){var i,r;(r=(i=this.tilemapCache)==null?void 0:i.destroy)==null||r.call(i)}readMinScale(i,r){return r.minLOD!=null&&r.maxLOD!=null?i:0}readMaxScale(i,r){return r.minLOD!=null&&r.maxLOD!=null?i:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(i,r,n){var _;const s=(_=r.capabilities)==null?void 0:_.includes("Tilemap");let{minLOD:o,maxLOD:l,minScale:c,maxScale:f}=r;if(o==null&&l==null&&c!==0&&f!==0){const x=T=>Math.round(1e4*T)/1e4;c=x(c||r.tileInfo.lods[0].scale),f=x(f||r.tileInfo.lods[r.tileInfo.lods.length-1].scale);for(const T of r.tileInfo.lods){const A=x(T.scale);o=A>=c?T.level:o,l=A>=f?T.level:l}}if(s)return new Xg({layer:this,minLOD:o,maxLOD:l});if(r.tileInfo){const x=new pO;return x.read(r.tileInfo,n),new Yqt(x,o,l)}return null}};return y([w({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),y([w()],e.prototype,"minScale",void 0),y([$t("service","minScale")],e.prototype,"readMinScale",null),y([w()],e.prototype,"maxScale",void 0),y([$t("service","maxScale")],e.prototype,"readMaxScale",null),y([w({type:at})],e.prototype,"spatialReference",void 0),y([w({readOnly:!0})],e.prototype,"supportsBlankTile",null),y([w({type:pO})],e.prototype,"tileInfo",void 0),y([w()],e.prototype,"tilemapCache",void 0),y([$t("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),y([w()],e.prototype,"version",void 0),e=y([Z("esri.layers.mixins.ArcGISCachedService")],e),e};let bl=class extends Jqt(m5e(XB(JB(fP(uE))))){constructor(...t){super(...t),this.capabilities={operations:{supportsTileMap:!1}},this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=iFe()}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}destroy(){this._lercDecoder=ir(this._lercDecoder)}readCapabilities(t,e){const i=e.capabilities&&e.capabilities.split(",").map(r=>r.toLowerCase().trim());return i?{operations:{supportsTileMap:i.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(t,e){let i=e.currentVersion;return i||(i=9.3),i}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:i=>{for(let r=0;rthis._fetchImageService(e))),Promise.resolve(this)}fetchTile(t,e,i,r){const n=(r=r||{signal:null}).signal!=null?r.signal:r.signal=new AbortController().signal,s={responseType:"array-buffer",signal:n},o={noDataValue:r.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(t,e,i,r)).then(()=>bi(this.getTileUrl(t,e,i),s)).then(l=>this._lercDecoder.decode(l.data,o,n)).then(l=>new eFe(l))}getTileUrl(t,e,i){const r=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,n=PT({...this.parsedUrl.query,blankTile:!r&&null});return`${this.parsedUrl.path}/tile/${t}/${e}/${i}${n?"?"+n:""}`}async queryElevation(t,e){const{ElevationQuery:i}=await we(()=>Promise.resolve().then(()=>zV),void 0);return St(e),new i().query(this,t,e)}async createElevationSampler(t,e){const{ElevationQuery:i}=await we(()=>Promise.resolve().then(()=>zV),void 0);return St(e),new i().createSampler(this,t,e)}_fetchTileAvailability(t,e,i,r){return this.tilemapCache?this.tilemapCache.fetchAvailability(t,e,i,r):Promise.resolve("unknown")}async _fetchImageService(t){var r;if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:t},i=await bi(this.parsedUrl.path,e);i.ssl&&(this.url=(r=this.url)==null?void 0:r.replace(/^http:/i,"https:")),this.sourceJSON=i.data,this.read(i.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[pje]}};y([w({readOnly:!0})],bl.prototype,"capabilities",void 0),y([$t("service","capabilities",["capabilities"])],bl.prototype,"readCapabilities",null),y([w({json:{read:{source:"copyrightText"}}})],bl.prototype,"copyright",void 0),y([w({readOnly:!0,type:N_})],bl.prototype,"heightModelInfo",void 0),y([w({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],bl.prototype,"path",void 0),y([w({type:["show","hide"]})],bl.prototype,"listMode",void 0),y([w({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],bl.prototype,"minScale",void 0),y([w({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],bl.prototype,"maxScale",void 0),y([w({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],bl.prototype,"opacity",void 0),y([w({type:["ArcGISTiledElevationServiceLayer"]})],bl.prototype,"operationalLayerType",void 0),y([w()],bl.prototype,"sourceJSON",void 0),y([w({json:{read:!1},value:"elevation",readOnly:!0})],bl.prototype,"type",void 0),y([w(soe)],bl.prototype,"url",void 0),y([w()],bl.prototype,"version",void 0),y([$t("version",["currentVersion"])],bl.prototype,"readVersion",null),bl=y([Z("esri.layers.ElevationLayer")],bl);const pje=Symbol("default-fetch-tile");bl.prototype.fetchTile[pje]=!0;const fje=bl,mje=Object.freeze(Object.defineProperty({__proto__:null,default:fje},Symbol.toStringTag,{value:"Module"})),Kqt=t=>{const e=document.getElementById("opacitySlider");e.addEventListener("calciteSliderInput",()=>{const o=e.value/100;t.map.ground.opacity=o});const i=document.getElementById("navigationUnderground");console.log(i);const r=document.getElementById("elevationInput");i.addEventListener("calciteCheckboxChange",o=>{t.map.ground.navigationConstraint.type=o.target.checked?"none":"stay-above"}),r.addEventListener("calciteCheckboxChange",n);function n(o){t.map.ground.layers.forEach(l=>{l.visible=o.target.checked})}const s=document.getElementById("elevationModels");s.addEventListener("calciteRadioButtonGroupChange",()=>{const o=s.selectedItem.value;t.map.ground.layers.forEach(l=>{l.visible=l.id===o})})},gje=(t,e)=>new fje({url:t,title:e,visible:!1}),Qqt=t=>{const e=new URL(window.location.href);new URLSearchParams(e.search).get("underground")==="true"&&(t.map.ground.navigationConstraint.type="none")},eWt=t=>{const e=new URL(window.location.href),r=new URLSearchParams(e.search).get("layers");if(r!==null){const n=r.split(",");t.map.allLayers.items.forEach(s=>{n.includes(s.title)&&(s.visible=!s.visible)})}},tWt=t=>{const e=new URL(window.location.href),r=new URLSearchParams(e.search).get("elevation");if(r!==null){const n=r.split(",");t.map.ground.layers.forEach(s=>{n.includes(s.title)&&(s.visible=!s.visible)})}},iWt=()=>{const t=new URL(window.location.href),i=new URLSearchParams(t.search).get("view");if(i){const[r,n,s,o,l,c,f]=i.split(","),_=parseFloat(r),x=parseFloat(n),T=parseFloat(s),A=parseFloat(o),M=parseFloat(l),I=parseFloat(c),L=parseFloat(f);return[_,x,T,A,M,I,L]}return null},rWt=async t=>{await navigator.clipboard.writeText(t)},nWt=(t,e,i)=>{const r=window.location.href,n=new URL(r.split("?")[0]),s=t.viewpoint,{rotation:o,scale:l}=s,{heading:c,tilt:f}=s.camera,{x:_,y:x,z:T}=s.camera.position,A=new URLSearchParams;if(A.set("view",`${_},${x},${T},${c},${f},${o},${l}`),t.map.ground.navigationConstraint.type==="none"&&A.set("underground","true"),e.length!==0){const M=e.join(",");A.set("layers",M)}if(i.length!==0){const M=i.join(",");A.set("elevation",M)}return n.search=A.toString(),n.toString()},sWt=t=>{const[e,i,r,n,s,o,l]=t;return new ih({camera:new cd({position:new mt({x:e,y:i,z:r,spatialReference:{wkid:3301}}),heading:n,tilt:s}),rotation:o,scale:l})},yje=ddt(),oWt=pdt("66e382030b224ffa999249a4d1cbbf4f","Sidemastid"),aWt=fdt(),vje=Mze("92d29869db444e28beab584f696b86c3",yje,aWt),lWt=Mze("da15a55042b54c31b0208ba98c1647fc"),cWt=Oze(lWt),uWt=gje("https://tiles.arcgis.com/tiles/ZYGCYltwz5ExeoGm/arcgis/rest/services/APR_50m_Eesti_tif/ImageServer","Aluspõhi 50m"),hWt=gje("https://tiles.arcgis.com/tiles/ZYGCYltwz5ExeoGm/arcgis/rest/services/AKR_50m_2/ImageServer","Aluskord 50m"),Fr=Oze(vje);Fr.when(()=>{const t=gdt(cWt),e=t.items.find(Y=>Y.title==="Puurkaevud/puuraugud"),i=t.items.find(Y=>Y.title==="Ehitusgeoloogia"),r=t.items.find(Y=>Y.title==="Geoloogia WMS");r.visible=!1,Fr.map.ground.layers.addMany([uWt,hWt]);const{description:n}=vje.portalItem,s=document.querySelector("#item-description");s.innerHTML=n,Fr.ui.move("zoom","top-right"),Fr.ui.move("navigation-toggle","top-right"),Fr.ui.move("compass","top-right"),PUt();const o=e0e("Taimkate","exclusive");mdt(o,Fr),Fr.map.add(o);const l=jzt(Fr);nxe(l,Fr);const c=Gzt(Fr);nxe(c,Fr);const f=Hzt(Fr);qzt(f,Fr);const _=e0e("Geoloogia","independent");_.addMany([e,i]),Fr.map.add(_),Fr.map.add(r),Kqt(Fr);const x=SUt(Fr),T=TUt();x.formats.add(T),x.conversions.splice(0,0,new BS({format:T})),Fr.ui.add(x,"bottom-right"),OUt(Fr);const A=CBt();ABt(Fr,A),_Ht(Fr),_qt(Fr);const M=new wQe({view:Fr,container:"measurement-container"});bqt(M),zqt(Fr);const I=Wqt(Fr);Fr.ui.add(I,"top-right"),Hjt(Fr,yje),Fr.map.reorder(o,6),Fr.map.reorder(_,6),Fr.map.reorder(r,-1),Fr.map.findLayerById("180fa46104d-layer-35").add(oWt);const F=t0e(Fr),z=Nqt(Fr);let k;const U=({target:Y})=>{if(Y.tagName!=="CALCITE-ACTION")return;k&&(document.querySelector(`[data-action-id=${k}]`).active=!1,document.querySelector(`[data-panel-id=${k}]`).hidden=!0);const Q=Y.dataset.actionId;if(Q!==k?(document.querySelector(`[data-action-id=${Q}]`).active=!0,document.querySelector(`[data-panel-id=${Q}]`).hidden=!1,k=Q):k=null,Q==="shadowCast"&&(z.visible=!z.visible),Q==="share"){const ne=t0e(Fr),[re,he]=ydt(F,ne);console.log(re),console.log(he);const ce=nWt(Fr,re,he);rWt(ce);const be=document.getElementById("share-map-alert");be.open="true"}};document.querySelector("calcite-action-bar").addEventListener("click",U);let j=!1;document.addEventListener("calciteActionBarToggle",Y=>{j=!j,Fr.padding={left:j?135:49}});const H=iWt();if(Qqt(Fr),eWt(Fr),tWt(Fr),H!==null){const Y=sWt(H);Fr.goTo(Y,{animate:!1}),console.log(f)}});const dWt=Object.freeze(Object.defineProperty({__proto__:null,betaRayleigh:fO,build:qIe},Symbol.toStringTag,{value:"Module"})),pWt=Object.freeze(Object.defineProperty({__proto__:null,AtmosphereCompositingPassParameters:_ae,build:d$e},Symbol.toStringTag,{value:"Module"})),fWt=Object.freeze(Object.defineProperty({__proto__:null,build:_$e},Symbol.toStringTag,{value:"Module"})),mWt=Object.freeze(Object.defineProperty({__proto__:null,CloudsDrawParameters:Cae,CloudsPassParameters:Eae,build:C$e},Symbol.toStringTag,{value:"Module"})),gWt=Object.freeze(Object.defineProperty({__proto__:null,NoiseTextureAtlasPassParameters:Aae,build:O$e},Symbol.toStringTag,{value:"Module"})),yWt=Object.freeze(Object.defineProperty({__proto__:null,FogPassParameters:Oae,build:G$e},Symbol.toStringTag,{value:"Module"})),vWt=Object.freeze(Object.defineProperty({__proto__:null,SilhouetteCircle:Iae,SimpleAtmospherePassParameters:Ij,build:K$e},Symbol.toStringTag,{value:"Module"})),_Wt=Object.freeze(Object.defineProperty({__proto__:null,build:TLe},Symbol.toStringTag,{value:"Module"})),bWt=Object.freeze(Object.defineProperty({__proto__:null,build:ALe},Symbol.toStringTag,{value:"Module"})),wWt=Object.freeze(Object.defineProperty({__proto__:null,build:d6e,calculateAnchorPosForRendering:FL},Symbol.toStringTag,{value:"Module"})),xWt=Object.freeze(Object.defineProperty({__proto__:null,build:nDe},Symbol.toStringTag,{value:"Module"})),SWt=Object.freeze(Object.defineProperty({__proto__:null,build:aDe,getRadius:aG},Symbol.toStringTag,{value:"Module"})),TWt=Object.freeze(Object.defineProperty({__proto__:null,build:dDe},Symbol.toStringTag,{value:"Module"})),EWt=Object.freeze(Object.defineProperty({__proto__:null,build:fDe},Symbol.toStringTag,{value:"Module"})),CWt=Object.freeze(Object.defineProperty({__proto__:null,build:ODe},Symbol.toStringTag,{value:"Module"})),AWt=Object.freeze(Object.defineProperty({__proto__:null,build:ONe,ribbonlineNumRoundJoinSubdivisions:jL},Symbol.toStringTag,{value:"Module"})),MWt=Object.freeze(Object.defineProperty({__proto__:null,build:kNe},Symbol.toStringTag,{value:"Module"})),OWt=Object.freeze(Object.defineProperty({__proto__:null,TextureOnlyPassParameters:Ble,build:sNe},Symbol.toStringTag,{value:"Module"})),PWt=Object.freeze(Object.defineProperty({__proto__:null,OverlayCompositingPassParameters:ece,build:HNe},Symbol.toStringTag,{value:"Module"})),RWt=Object.freeze(Object.defineProperty({__proto__:null,build:m8e},Symbol.toStringTag,{value:"Module"})),IWt=Object.freeze(Object.defineProperty({__proto__:null,build:U8e},Symbol.toStringTag,{value:"Module"})),$Wt=Object.freeze(Object.defineProperty({__proto__:null,build:g7e},Symbol.toStringTag,{value:"Module"})),LWt=Object.freeze(Object.defineProperty({__proto__:null,build:S7e},Symbol.toStringTag,{value:"Module"})),DWt=Object.freeze(Object.defineProperty({__proto__:null,build:C7e},Symbol.toStringTag,{value:"Module"})),NWt=Object.freeze(Object.defineProperty({__proto__:null,TerrainPassParameters:Oce,build:xFe},Symbol.toStringTag,{value:"Module"})),FWt=Object.freeze(Object.defineProperty({__proto__:null,get BackgroundMode(){return K2},build:VFe},Symbol.toStringTag,{value:"Module"})),kWt=Object.freeze(Object.defineProperty({__proto__:null,ColorizerHillshadeUniforms:bFe,ColorizerStretchUniforms:_Fe,ColorizerUniforms:p6,build:wFe},Symbol.toStringTag,{value:"Module"})),zWt=Object.freeze(Object.defineProperty({__proto__:null,build:uke},Symbol.toStringTag,{value:"Module"})),UWt=Object.freeze(Object.defineProperty({__proto__:null,CompositingPassParameters:RG,build:_ke},Symbol.toStringTag,{value:"Module"})),VWt=Object.freeze(Object.defineProperty({__proto__:null,HUDCompositingPassParameters:Bce,build:wke},Symbol.toStringTag,{value:"Module"})),BWt=Object.freeze(Object.defineProperty({__proto__:null,OITCompositingPassParameters:jce,build:Tke},Symbol.toStringTag,{value:"Module"})),jWt=Object.freeze(Object.defineProperty({__proto__:null,build:Oke},Symbol.toStringTag,{value:"Module"})),GWt=Object.freeze(Object.defineProperty({__proto__:null,HighlightBlurDrawParameters:qce,build:Ike},Symbol.toStringTag,{value:"Module"})),HWt=Object.freeze(Object.defineProperty({__proto__:null,HighlightDownsampleDrawParameters:Gce,blurSize:Hce,build:Mke,gridCellPixelSize:tm,outlineSize:IG},Symbol.toStringTag,{value:"Module"})),qWt=Object.freeze(Object.defineProperty({__proto__:null,build:Fke},Symbol.toStringTag,{value:"Module"})),WWt=Object.freeze(Object.defineProperty({__proto__:null,build:Uke},Symbol.toStringTag,{value:"Module"})),YWt=Object.freeze(Object.defineProperty({__proto__:null,build:jke},Symbol.toStringTag,{value:"Module"})),XWt=Object.freeze(Object.defineProperty({__proto__:null,build:qke},Symbol.toStringTag,{value:"Module"})),ZWt=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastVisualizePassParameters:Yce,build:Zke},Symbol.toStringTag,{value:"Module"})),JWt=Object.freeze(Object.defineProperty({__proto__:null,ShadowCastMaxSamples:m6,build:Xke},Symbol.toStringTag,{value:"Module"})),KWt=Object.freeze(Object.defineProperty({__proto__:null,build:ize},Symbol.toStringTag,{value:"Module"}));export{Es as $,kt as A,EXt as B,Li as C,mXt as D,se as E,Mo as F,b2 as G,aXt as H,Eyi as I,cu as J,Dn as K,ZVe as L,ZXt as M,xc as N,_t as O,ii as P,jse as Q,Zde as R,Ml as S,mt as T,LHe as U,it as V,eAe as W,Oa as X,Ku as Y,Ce as Z,wxe as _,gn as a,Oj as a$,Ps as a0,sgt as a1,rr as a2,nx as a3,ad as a4,a_ as a5,_be as a6,Sbe as a7,Oc as a8,yt as a9,Fmt as aA,_ue as aB,Nmt as aC,wBt as aD,Ne as aE,Ye as aF,Wt as aG,WVe as aH,Ko as aI,dm as aJ,xZt as aK,ZKt as aL,ele as aM,bE as aN,BKt as aO,_Pe as aP,rt as aQ,ss as aR,N5e as aS,Fi as aT,je as aU,z_ as aV,QKt as aW,Tp as aX,tl as aY,Gw as aZ,ms as a_,W as aa,qe as ab,JJe as ac,oXt as ad,Ni as ae,qO as af,pu as ag,X5 as ah,ni as ai,g5 as aj,en as ak,Zn as al,ma as am,Uxt as an,$m as ao,jG as ap,jr as aq,at as ar,Ie as as,Be as at,De as au,Co as av,iQt as aw,Ve as ax,ud as ay,Sn as az,Cc as b,Xrt as b$,jm as b0,nt as b1,Wn as b2,Doe as b3,rO as b4,mm as b5,zM as b6,$5 as b7,Lri as b8,gT as b9,Qe as bA,Xu as bB,Ao as bC,uNe as bD,X_ as bE,BJt as bF,VJt as bG,Jl as bH,Re as bI,Gnt as bJ,Bnt as bK,C2 as bL,tXt as bM,ILt as bN,FRe as bO,kRe as bP,RZt as bQ,Am as bR,os as bS,Zz as bT,Kz as bU,qs as bV,bi as bW,Bm as bX,t2 as bY,Bse as bZ,aOe as b_,t1t as ba,Sc as bb,Jii as bc,Xii as bd,Zii as be,J as bf,tce as bg,Tei as bh,Mi as bi,EEt as bj,CEt as bk,O5 as bl,Je as bm,el as bn,cp as bo,qxt as bp,VU as bq,xt as br,Rte as bs,qle as bt,$ve as bu,Ka as bv,L9 as bw,$9 as bx,Bo as by,It as bz,Z as c,qWe as c$,fE as c0,mE as c1,ui as c2,T$ as c3,vst as c4,Tai as c5,Eai as c6,uE as c7,Fxt as c8,S_ as c9,WG as cA,Myi as cB,Oyi as cC,Pyi as cD,Ryi as cE,Nyi as cF,Iyi as cG,$yi as cH,Lyi as cI,Dyi as cJ,Fyi as cK,NXt as cL,ao as cM,jl as cN,Rut as cO,El as cP,nQt as cQ,rQt as cR,Zme as cS,pqt as cT,R5 as cU,Kdt as cV,iei as cW,rP as cX,r4t as cY,S9 as cZ,h9 as c_,F_ as ca,qsi as cb,nci as cc,Pi as cd,GX as ce,N3e as cf,oP as cg,fXt as ch,BZe as ci,lXt as cj,TXt as ck,yXt as cl,bCe as cm,nXt as cn,AXt as co,dqt as cp,DXt as cq,LXt as cr,Zf as cs,th as ct,Dct as cu,HKt as cv,s3e as cw,kyi as cx,ex as cy,xyi as cz,_e as d,ox as d$,js as d0,LZt as d1,oA as d2,FFt as d3,CMe as d4,kFt as d5,p_ as d6,Xit as d7,nd as d8,UYt as d9,Bf as dA,Dot as dB,Dk as dC,sE as dD,Vtt as dE,Btt as dF,qat as dG,Wat as dH,Yat as dI,Le as dJ,Sse as dK,zht as dL,XB as dM,JB as dN,OB as dO,fP as dP,zo as dQ,cL as dR,Ar as dS,Vi as dT,_ot as dU,b5e as dV,soe as dW,fd as dX,dP as dY,d6 as dZ,Ec as d_,QWt as da,_Xt as db,wXt as dc,$de as dd,we as de,vE as df,Wst as dg,YYt as dh,uat as di,dPe as dj,fJt as dk,Alt as dl,Uf as dm,rdt as dn,yn as dp,Xs as dq,Ue as dr,yat as ds,$t as dt,Pt as du,qpe as dv,moe as dw,I9 as dx,O2 as dy,xB as dz,y as e,pO as e$,g_ as e0,rl as e1,ws as e2,ys as e3,pp as e4,aL as e5,to as e6,RZ as e7,$Z as e8,Ez as e9,$5e as eA,uT as eB,XZ as eC,bB as eD,sz as eE,LT as eF,v8 as eG,pse as eH,dse as eI,VAe as eJ,fse as eK,dZt as eL,JFe as eM,CQe as eN,rT as eO,foe as eP,Zse as eQ,Vy as eR,dai as eS,WSt as eT,qSt as eU,xKe as eV,PSt as eW,ait as eX,Cse as eY,QT as eZ,J2 as e_,D5e as ea,Dv as eb,U5e as ec,fVe as ed,mVe as ee,sd as ef,pVe as eg,ya as eh,JZt as ei,yai as ej,od as ek,Vht as el,m5e as em,Gst as en,kv as eo,Di as ep,xmi as eq,Fd as er,zfe as es,Cz as et,Ght as eu,D_ as ev,fj as ew,BWe as ex,$n as ey,g2 as ez,sn as f,bG as f$,cm as f0,Jqt as f1,GQt as f2,PT as f3,zJt as f4,Gh as f5,Ci as f6,tx as f7,eYt as f8,UYe as f9,Bi as fA,as as fB,WKt as fC,bfe as fD,qKt as fE,Jct as fF,xRe as fG,hit as fH,Eht as fI,Yit as fJ,dni as fK,NL as fL,pni as fM,Bn as fN,qf as fO,GT as fP,SQt as fQ,kQt as fR,MFt as fS,Upe as fT,cht as fU,_Qt as fV,iZt as fW,BL as fX,Unt as fY,Yl as fZ,_G as f_,UO as fa,Mne as fb,bje as fc,y_ as fd,UAe as fe,PZt as ff,v9 as fg,wi as fh,EIt as fi,hdi as fj,KL as fk,Jr as fl,tRe as fm,DJt as fn,Fy as fo,Mdt as fp,wn as fq,d7 as fr,nP as fs,cie as ft,ds as fu,id as fv,Jre as fw,pd as fx,ca as fy,OE as fz,xo as g,Eje as g$,MT as g0,pft as g1,f6t as g2,m6t as g3,a6t as g4,Yfi as g5,fV as g6,rfi as g7,y6t as g8,L8e as g9,$ue as gA,MP as gB,jKt as gC,Sm as gD,wgi as gE,bgi as gF,oT as gG,ZX as gH,Iue as gI,rci as gJ,Q$ as gK,kf as gL,vYt as gM,yAt as gN,Tr as gO,nl as gP,KCt as gQ,HL as gR,Y$ as gS,Ami as gT,_6 as gU,Kmt as gV,QCt as gW,QPt as gX,eJt as gY,ici as gZ,SZt as g_,Cit as ga,R9 as gb,QDe as gc,hai as gd,uai as ge,Vit as gf,$Zt as gg,kit as gh,Ase as gi,IZt as gj,wc as gk,wet as gl,XR as gm,vn as gn,pn as go,__ as gp,Of as gq,Cp as gr,Bs as gs,Xz as gt,qB as gu,Y6 as gv,Lrt as gw,vjt as gx,_jt as gy,Q2 as gz,HK as h,Ja as h$,tKt as h0,Zot as h1,tfe as h2,mJt as h3,$Ye as h4,ZYe as h5,s0 as h6,rKe as h7,rtt as h8,bt as h9,xHt as hA,tje as hB,Pje as hC,m5 as hD,sl as hE,Fjt as hF,e1 as hG,Ajt as hH,vBe as hI,w5 as hJ,Gu as hK,or as hL,df as hM,pgi as hN,$lt as hO,Qr as hP,GU as hQ,i0 as hR,Dti as hS,hgi as hT,Wl as hU,bjt as hV,Lue as hW,Njt as hX,X0 as hY,Sw as hZ,kO as h_,ix as ha,CJt as hb,eoe as hc,Mst as hd,toe as he,a5e as hf,hce as hg,f_ as hh,l5e as hi,uOt as hj,Cie as hk,cn as hl,Pl as hm,X as hn,Cw as ho,XI as hp,Cm as hq,tj as hr,BB as hs,kKt as ht,Jf as hu,_ze as hv,RT as hw,Ur as hx,By as hy,l3e as hz,Xot as i,qh as i$,A6e as i0,YB as i1,Ln as i2,Rri as i3,bL as i4,my as i5,U9 as i6,uci as i7,wie as i8,Jsi as i9,R2 as iA,P_ as iB,d5 as iC,Vh as iD,QZ as iE,upe as iF,uit as iG,yot as iH,got as iI,hPe as iJ,dfe as iK,kK as iL,Ist as iM,fot as iN,cat as iO,n5 as iP,pfe as iQ,GKt as iR,Ilt as iS,wKe as iT,Woi as iU,FK as iV,AJt as iW,hst as iX,ty as iY,ky as iZ,qye as i_,Zsi as ia,VKt as ib,dU as ic,Y2 as id,r6 as ie,Tj as ig,jJt as ih,Yz as ii,jf as ij,Kot as ik,Llt as il,fat as im,bRe as io,AS as ip,Hp as iq,D4 as ir,F4 as is,$st as it,mot as iu,hE as iv,Vt as iw,Iat as ix,$s as iy,kB as iz,G5e as j,CXt as j$,Xf as j0,s5 as j1,Glt as j2,Toe as j3,ase as j4,gZt as j5,m2 as j6,HYe as j7,jy as j8,Mf as j9,fKt as jA,mKt as jB,gKt as jC,yKt as jD,vKt as jE,Uht as jF,Uv as jG,GJt as jH,_c as jI,qu as jJ,Iri as jK,P9 as jL,Rs as jM,JV as jN,Tn as jO,ur as jP,d_ as jQ,Ju as jR,ko as jS,B0i as jT,WZ as jU,iht as jV,vot as jW,u$t as jX,F8t as jY,Sv as jZ,Za as j_,Ust as ja,TKt as jb,fy as jc,WJt as jd,qJt as je,Z5 as jf,Qse as jg,_Kt as jh,PB as ji,L_ as jj,ioe as jk,HOe as jl,tlt as jm,elt as jn,Qat as jo,not as jp,SKt as jq,Pat as jr,Yst as js,oKt as jt,aKt as ju,lKt as jv,uKt as jw,hKt as jx,dKt as jy,pKt as jz,Rf as k,KAt as k$,eUt as k0,xM as k1,GK as k2,Joi as k3,dJt as k4,Yoi as k5,hp as k6,YXt as k7,pZt as k8,Met as k9,Oee as kA,BG as kB,IBt as kC,vBt as kD,bBt as kE,iBt as kF,RBt as kG,igi as kH,xBt as kI,_Bt as kJ,ZCe as kK,RKe as kL,Gr as kM,tt as kN,si as kO,dL as kP,S5e as kQ,sgi as kR,sf as kS,Gsi as kT,R$ as kU,CL as kV,Ws as kW,Nti as kX,AL as kY,mci as kZ,QAt as k_,eZt as ka,XXt as kb,FZ as kc,co as kd,vut as ke,_m as kf,Sei as kg,Eut as kh,Xr as ki,Wr as kj,Uie as kk,Vie as kl,D8t as km,O_ as kn,jh as ko,xXt as kp,goe as kq,nKe as kr,vXt as ks,yr as kt,wEe as ku,Tse as kv,lE as kw,oE as kx,FB as ky,$ti as kz,Qa as l,bs as l$,xoe as l0,vs as l1,uVe as l2,L5e as l3,sai as l4,tO as l5,gpe as l6,fZt as l7,ZO as l8,KZt as l9,KKe as lA,BO as lB,eai as lC,l_ as lD,Gft as lE,D3e as lF,lht as lG,yP as lH,hae as lI,Ogi as lJ,j9 as lK,gse as lL,tQt as lM,Out as lN,YJe as lO,hXt as lP,qJe as lQ,cXt as lR,uXt as lS,yCe as lT,SOe as lU,Zre as lV,CE as lW,ke as lX,cr as lY,Zr as lZ,vm as l_,Gje as la,$2 as lb,eKt as lc,XV as ld,ene as le,Hy as lf,SA as lg,Zl as lh,Mat as li,zKt as lj,clt as lk,Smi as ll,Bk as lm,bMt as ln,xMt as lo,Ari as lp,Vm as lq,hG as lr,tFe as ls,rp as lt,dht as lu,gQt as lv,wQt as lw,KQt as lx,mRe as ly,yLe as lz,I_ as m,rTt as m$,Gt as m0,Rn as m1,c4t as m2,jft as m3,qw as m4,Zo as m5,iae as m6,F0i as m7,dgi as m8,YDt as m9,$i as mA,WB as mB,J5 as mC,bc as mD,wp as mE,fa as mF,A9 as mG,ose as mH,yH as mI,Sr as mJ,vQt as mK,Mr as mL,Lse as mM,Wme as mN,W8e as mO,X8e as mP,OMt as mQ,Np as mR,P$ as mS,I$ as mT,T8e as mU,HOt as mV,_Mt as mW,tTt as mX,v_ as mY,tNe as mZ,oZt as m_,kV as ma,gci as mb,jli as mc,Bli as md,Uli as me,SM as mf,qCt as mg,Vli as mh,Um as mi,DZ as mj,XYt as mk,UJt as ml,tot as mm,Qst as mn,T2 as mo,JQt as mp,BSe as mq,bKt as mr,wKt as ms,roe as mt,cKt as mu,py as mv,sKt as mw,Wf as mx,bot as my,DB as mz,et as n,uni as n$,_Ot as n0,pOt as n1,fOt as n2,wOt as n3,gOt as n4,yOt as n5,Fm as n6,mOt as n7,Ac as n8,bOt as n9,ae as nA,RXt as nB,u9 as nC,Yqt as nD,OFt as nE,z2e as nF,TRe as nG,fL as nH,td as nI,Qoi as nJ,RB as nK,OZt as nL,EZt as nM,AZt as nN,CZt as nO,MZt as nP,fp as nQ,w6e as nR,MHe as nS,Eat as nT,YV as nU,c_ as nV,XX as nW,U_ as nX,Fqt as nY,m9 as nZ,wE as n_,Y9 as na,Nj as nb,Ea as nc,iTt as nd,vOt as ne,kj as nf,e0 as ng,TE as nh,EO as ni,EC as nj,Uti as nk,kti as nl,zti as nm,gjt as nn,XVe as no,vPe as np,DI as nq,FO as nr,bPe as ns,mk as nt,bLt as nu,YFe as nv,Ms as nw,Oct as nx,gct as ny,RQ as nz,ipe as o,i1 as o$,b_ as o0,fn as o1,Xoe as o2,xp as o3,Loe as o4,AT as o5,Jet as o6,nn as o7,gp as o8,fSe as o9,c$ as oA,oJt as oB,Rat as oC,Yse as oD,EM as oE,EOe as oF,vnt as oG,glt as oH,irt as oI,Vv as oJ,B$ as oK,q3e as oL,xne as oM,HYt as oN,Y5 as oO,bYe as oP,nB as oQ,ZYt as oR,act as oS,_E as oT,cgt as oU,ju as oV,Ji as oW,nZt as oX,mB as oY,yZt as oZ,m_ as o_,_Yt as oa,ZQt as ob,Fti as oc,UPe as od,Uo as oe,OQ as of,rYt as og,vSe as oh,TYt as oi,SYt as oj,fai as ok,pai as ol,EYt as om,N2 as on,IGe as oo,z3e as op,Nje as oq,lZt as or,m4e as os,xft as ot,Xi as ou,V0i as ov,fc as ow,znt as ox,yjt as oy,Ppt as oz,ze as p,dxe as p$,E2 as p0,QMe as p1,JO as p2,Zh as p3,qYt as p4,Vf as p5,pQ as p6,pSe as p7,oQe as p8,G3e as p9,kft as pA,KBt as pB,dBe as pC,XBt as pD,Ayi as pE,Cyi as pF,wSe as pG,ogi as pH,gj as pI,YQe as pJ,dgt as pK,fs as pL,tgt as pM,igt as pN,wJt as pO,Ynt as pP,Xre as pQ,fu as pR,sO as pS,gnt as pT,M2 as pU,KKt as pV,$G as pW,iU as pX,eCt as pY,A8t as pZ,nai as p_,iE as pa,Xg as pb,mEe as pc,One as pd,GYt as pe,Ty as pf,SKe as pg,ide as ph,tOe as pi,i8e as pj,imt as pk,Ei as pl,L8t as pm,ZPe as pn,JXt as po,AQe as pp,WVt as pq,$Bt as pr,ugt as ps,hut as pt,Wue as pu,mqt as pv,$O as pw,w_ as px,fqt as py,Dft as pz,sXt as q,sTt as q$,U0i as q0,z0i as q1,O9 as q2,xn as q3,Olt as q4,mj as q5,uZt as q6,cZt as q7,ime as q8,eme as q9,YQt as qA,pXt as qB,dXt as qC,bXt as qD,Yt as qE,Act as qF,cct as qG,MPe as qH,Bv as qI,gs as qJ,$8e as qK,PMt as qL,Gre as qM,yct as qN,WYt as qO,gai as qP,Hye as qQ,vai as qR,lai as qS,XDe as qT,JDe as qU,WDe as qV,qI as qW,HI as qX,zit as qY,Uit as qZ,Jye as q_,mc as qa,DMe as qb,HJt as qc,D8e as qd,wci as qe,A8e as qf,Eie as qg,oce as qh,Ene as qi,uu as qj,Yf as qk,EMt as ql,M8e as qm,R8e as qn,CMt as qo,TMt as qp,AMt as qq,j_ as qr,SMt as qs,Dme as qt,$ii as qu,zee as qv,wMt as qw,Iii as qx,Aai as qy,XQt as qz,rXt as r,Xl as r$,qoi as r0,kAe as r1,mZt as r2,MQe as r3,QXt as r4,uB as r5,rQe as r6,uQe as r7,KDe as r8,Qne as r9,oj as rA,ggi as rB,lo as rC,y2 as rD,uj as rE,zoe as rF,uRe as rG,UB as rH,k9 as rI,F9 as rJ,uP as rK,lPe as rL,frt as rM,FKt as rN,xRt as rO,_St as rP,ySt as rQ,Bct as rR,Loi as rS,e5 as rT,$oi as rU,x_ as rV,wai as rW,Ya as rX,Hl as rY,shi as rZ,Yle as r_,BXt as ra,qOe as rb,qnt as rc,NB as rd,ou as re,DE as rf,xat as rg,NKe as rh,DKe as ri,vB as rj,DHe as rk,yQe as rl,tme as rm,LEt as rn,Hf as ro,Wre as rp,fti as rq,tMt as rr,eE as rs,Dm as rt,GPe as ru,Qo as rv,zIe as rw,_B as rx,VT as ry,R_ as rz,St as s,So as s$,OYt as s0,gm as s1,ep as s2,iD as s3,rai as s4,efe as s5,Kt as s6,Zoi as s7,c3t as s8,zB as s9,sZt as sA,s0t as sB,LQt as sC,mQt as sD,DQt as sE,D0i as sF,dj as sG,MQt as sH,TQt as sI,EQt as sJ,xQt as sK,i8 as sL,gNe as sM,md as sN,G9t as sO,Qct as sP,lct as sQ,uQt as sR,$Qt as sS,eut as sT,ZJt as sU,$fe as sV,AO as sW,Mri as sX,Py as sY,o5 as sZ,zz as s_,gE as sa,SRt as sb,wle as sc,dUe as sd,To as se,k7e as sf,Cmi as sg,Nz as sh,CAe as si,kRt as sj,Al as sk,Iti as sl,SE as sm,Zmt as sn,g_e as so,Bie as sp,x0 as sq,hV as sr,_L as ss,I5e as st,Lot as su,Oe as sv,Qpe as sw,WMe as sx,Z3e as sy,Ije as sz,JEe as t,dV as t$,tht as t0,ZS as t1,IQt as t2,rs as t3,hP as t4,RQt as t5,Wi as t6,$Oe as t7,LOe as t8,Wsi as t9,YKt as tA,g9 as tB,yYt as tC,OL as tD,uL as tE,Xsi as tF,L$e as tG,vht as tH,yRe as tI,fQt as tJ,c2 as tK,gut as tL,dy as tM,uht as tN,Opt as tO,Afe as tP,yQt as tQ,epe as tR,j0i as tS,h4t as tT,s_e as tU,Cat as tV,L3e as tW,k3e as tX,Hre as tY,JYt as tZ,adi as t_,OQt as ta,bQt as tb,R5e as tc,$ot as td,Qn as te,CM as tf,t5 as tg,X6e as th,Ale as ti,Tyt as tj,z8e as tk,xEe as tl,Noe as tm,t$ as tn,NJt as to,FQt as tp,NQt as tq,a5 as tr,Cut as ts,ir as tt,Jv as tu,sG as tv,UU as tw,mn as tx,Gpi as ty,LYt as tz,X5e as u,gat as u$,zh as u0,Uh as u1,Hie as u2,jie as u3,qie as u4,Gie as u5,y_e as u6,Xst as u7,Emi as u8,PXt as u9,zI as uA,tn as uB,ci as uC,Ai as uD,Qhi as uE,ldi as uF,hDe as uG,kS as uH,v_e as uI,Khi as uJ,tdi as uK,FS as uL,Zhi as uM,cpi as uN,mY as uO,tk as uP,Tc as uQ,ki as uR,sr as uS,Yr as uT,Pr as uU,Qf as uV,xDe as uW,vf as uX,st as uY,G4t as uZ,H4t as u_,au as ua,yue as ub,pP as uc,cnt as ud,unt as ue,OOe as uf,mAt as ug,Pnt as uh,gAt as ui,DOe as uj,Wz as uk,RYt as ul,pm as um,TOe as un,n$ as uo,wL as up,kQe as uq,nj as ur,Rz as us,gB as ut,hre as uu,kXt as uv,FXt as uw,zXt as ux,rHe as uy,Cj as uz,SXt as v,WAe as v$,LMe as v0,zy as v1,N_ as v2,EKt as v3,Zst as v4,Jst as v5,xKt as v6,GS as v7,LKe as v8,IXt as v9,Kit as vA,Omi as vB,Sf as vC,Jit as vD,jz as vE,Hz as vF,gL as vG,nYt as vH,c7t as vI,A7t as vJ,s1i as vK,o1i as vL,a1i as vM,Uqt as vN,LG as vO,n1i as vP,Mmi as vQ,Kce as vR,cP as vS,Mlt as vT,by as vU,Wje as vV,sYt as vW,ZZt as vX,wB as vY,Dri as vZ,Nri as v_,$Xt as va,WI as vb,X8t as vc,yst as vd,rit as ve,Uy as vf,OT as vg,Mrt as vh,_ai as vi,mai as vj,Kpt as vk,RJt as vl,wGe as vm,WFe as vn,gW as vo,yW as vp,ga as vq,cai as vr,oai as vs,wat as vt,kie as vu,iXt as vv,zyi as vw,Im as vx,Ose as vy,c9 as vz,rd as w,B1e as w$,dvt as w0,$ri as w1,Kme as w2,Lti as w3,Qu as w4,WO as w5,MBt as w6,Xn as w7,Tyi as w8,Ooe as w9,Zat as wA,Jat as wB,Kat as wC,vAt as wD,Jzt as wE,tUt as wF,dEe as wG,lbe as wH,rbe as wI,TQe as wJ,nbe as wK,bbe as wL,sbe as wM,hbe as wN,Mbe as wO,Obe as wP,Pbe as wQ,Rbe as wR,tZt as wS,Gli as wT,tci as wU,Jli as wV,Zli as wW,JPt as wX,Kli as wY,Qli as wZ,U1e as w_,KXt as wa,fG as wb,Uoe as wc,ngi as wd,X8 as we,Wh as wf,k2 as wg,pvt as wh,Sp as wi,dut as wj,Oyt as wk,YO as wl,Syi as wm,z2 as wn,kst as wo,uV as wp,sLt as wq,NS as wr,_Lt as ws,uw as wt,MG as wu,AG as wv,U_e as ww,CG as wx,B_e as wy,UCt as wz,YZe as x,yle as x$,V1e as x0,Yli as x1,Xli as x2,Q_e as x3,G_e as x4,H_e as x5,q_e as x6,dbe as x7,zbe as x8,Bbe as x9,ue as xA,Yu as xB,oo as xC,h1 as xD,Kh as xE,gr as xF,S5 as xG,dd as xH,Oi as xI,Cl as xJ,Jt as xK,fe as xL,Rr as xM,hu as xN,Hr as xO,Ir as xP,Ti as xQ,vp as xR,Y_ as xS,Mj as xT,rh as xU,Kj as xV,ji as xW,eG as xX,hx as xY,H9e as xZ,cx as x_,ebe as xa,Ube as xb,JU as xc,eci as xd,BCt as xe,jCt as xf,qli as xg,Wli as xh,KNe as xi,Hli as xj,tRt as xk,GCt as xl,Ese as xm,HZ as xn,$r as xo,ai as xp,Yoe as xq,bZt as xr,Eei as xs,s1 as xt,coe as xu,$Pe as xv,Nm as xw,ft as xx,V as xy,Cr as xz,w as y,D2 as y$,ls as y0,J2t as y1,Xt as y2,vle as y3,XZt as y4,Vo as y5,Er as y6,Ol as y7,_n as y8,Zle as y9,U3 as yA,EU as yB,QZt as yC,Isi as yD,W$e as yE,_s as yF,rDe as yG,ln as yH,yp as yI,XT as yJ,Rj as yK,o0 as yL,dx as yM,$Le as yN,GMe as yO,dQt as yP,pQt as yQ,$se as yR,qm as yS,$0i as yT,Qui as yU,CQt as yV,AQt as yW,tPe as yX,R4 as yY,cRe as yZ,Uee as y_,nh as ya,EP as yb,sCt as yc,xL as yd,wZt as ye,Lbt as yf,Zoe as yg,KPe as yh,Cft as yi,JKt as yj,Zt as yk,hd as yl,px as ym,Jy as yn,Z2 as yo,fx as yp,tG as yq,Qj as yr,wae as ys,$j as yt,Rsi as yu,r6e as yv,cQt as yw,hQt as yx,YZt as yy,Art as yz,gXt as z,eQt as z0,lRe as z1,nO as z2,rZt as z3,kKe as z4,FKe as z5,Zne as z6,Yne as z7,hqt as z8,Kf as z9,yE as zA,SJt as zB,JJt as zC,QJt as zD,nKt as zE,hdt as zF,Hsi as zG,xci as zH,kci as zI,tgi as zJ,oG as za,Pc as zb,lp as zc,PLe as zd,xei as ze,q2t as zf,mft as zg,tai as zh,hZt as zi,iYt as zj,Mdi as zk,aZt as zl,iai as zm,Bu as zn,gYt as zo,fnt as zp,v3t as zq,Bd as zr,Hm as zs,u1 as zt,In as zu,Kv as zv,Xy as zw,zt as zx,EJt as zy,EE as zz}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/AreaMeasurement2D-5lnD5-Sk.js","assets/Draw-DYxsSuyr.js","assets/SnappingVisualizer2D-NnEm1PvQ.js","assets/SnappingContext-6K6JmvvY.js","assets/PointSnappingHint-ULetRXiW.js","assets/EditGeometryOperations-TPE5Wzab.js","assets/SnappingOperation-2U48wt1k.js","assets/surfaceCoordinateSystems-siQq4eBA.js","assets/dehydratedFeatureComparison-hdPq-zad.js","assets/InteractiveToolBase-WDic4GPF.js","assets/drawUtils-woTYaREB.js","assets/SnappingDragPipelineStep-THHIXt-p.js","assets/GraphicManipulator-ku6oRBpa.js","assets/drapedUtils-9db1OpTX.js","assets/MeasurementWidgetContent-d8uX7Gw_.js","assets/AreaMeasurement3D-GOBHGg9B.js","assets/measurementUtils-St7B-HxA.js","assets/SnappingVisualizer3D-KWlqByBu.js","assets/ExtendedLineVisualElement-YbjiXiBG.js","assets/vec4f32-NvfHy9q7.js","assets/EngineVisualElement-eZNKTKsI.js","assets/VisualElement-kjYXz27t.js","assets/Laserlines.glsl-nvjcCsAw.js","assets/PointVisualElement-bX-_4FqS.js","assets/Object3DVisualElement-TMb7y_wl.js","assets/RightAngleQuadVisualElement-y_W8r903.js","assets/dragEventPipeline3D-4CqrlxD2.js","assets/ShadedColorMaterial.glsl-Fp4o6LjC.js","assets/AnalysisToolBase-3A13PdgS.js","assets/SceneSnappingManagerPool-OpebO9Di.js","assets/InteractiveAnalysisViewModel-RI-qFGDH.js","assets/DistanceMeasurement2D-0EP_w-h3.js","assets/DirectLineMeasurement3D-3Pkkgamv.js","assets/interfaces-tkyofe_Z.js","assets/interfaces-lHX1zDRv.js","assets/portalLayers-AqjAd9kT.js","assets/requestPresets-18nzHK5y.js","assets/arcgisLayers-Ja4-CB3n.js","assets/fetchService-wPWKuma6.js","assets/WhereClause-XAMIZ4-B.js","assets/TimeOnly-ljWtUK7N.js","assets/arcadeUtils-OUqwHs4P.js","assets/hash-SS5GKVPY.js","assets/layersLoader-5063dwjn.js","assets/layersCreator-aC1PvuFa.js","assets/jsonContext-cWV_-jAj.js","assets/BuildingSceneLayer-YaRBOuhA.js","assets/BuildingComponentSublayer-j8wian8V.js","assets/FeatureLayer--S4epFk-.js","assets/FeatureLayerBase-jpFp8gE3.js","assets/serviceCapabilitiesUtils-26KpT1VN.js","assets/editsZScale-Wgw9kbYG.js","assets/queryZScale-IaMm02_2.js","assets/FeatureSet-d4S1oKME.js","assets/CustomParametersMixin-Y1bOcayO.js","assets/FeatureEffectLayer-oBa8pIG5.js","assets/FeatureEffect-5bEV-xG1.js","assets/FeatureReductionLayer-RlitE1N6.js","assets/OrderedLayer-M7k5gLgx.js","assets/FeatureTemplate-kUgbbA00.js","assets/FeatureType-MpRe7WJj.js","assets/versionUtils-4v9zIDlv.js","assets/TopFeaturesQuery-E6D2tV-x.js","assets/BuildingGroupSublayer-xf_JzVTh.js","assets/CSVLayer-tIBvmg-7.js","assets/clientSideDefaults-F-CNnR0g.js","assets/QueryEngineCapabilities-PzVpW5yD.js","assets/DimensionLayer-WWUzEsQc.js","assets/LengthDimension-A_HnPDNi.js","assets/GeoJSONLayer-T9kwyVNs.js","assets/ImageryLayer-G7gb-fJC.js","assets/ImageHistogramParameters-sFtZwJ9j.js","assets/dataUtils-s_UKlouc.js","assets/generateRendererUtils-_1jVE02H.js","assets/executeQueryJSON-ACj9qY0y.js","assets/query-rG0aX6cE.js","assets/pbfQueryUtils-pWizwTQZ.js","assets/pbf-o0zzptPp.js","assets/AttachmentInfo-kbEMEIl0.js","assets/executeForIds-wXO8-pll.js","assets/ImageryTileLayer-ce5u7kmi.js","assets/rasterProjectionHelper-KvYWHIT_.js","assets/utils-4xKNo3Tf.js","assets/IntegratedMeshLayer-T6vTIezB.js","assets/SceneModification-dyp2M_Yg.js","assets/KMLLayer-c7r_kLDp.js","assets/LinkChartLayer-uIn6uT3L.js","assets/geohashUtils-U0jvYCSY.js","assets/FeatureStore-X-AIJLo2.js","assets/BoundsStore-wmwfHjhp.js","assets/PooledRBush-o8tLYBG5.js","assets/quickselect-UFB0jJTZ.js","assets/QueryEngine-8tLWlkSE.js","assets/json-v6EOeNTY.js","assets/utils-P5wTOmqv.js","assets/optimizedFeatureQueryEngineAdapter-KnoSHZzG.js","assets/MapImageLayer-qMOOMfH7.js","assets/SublayersOwner-8xrm3MkT.js","assets/QueryTask-91TvtrTt.js","assets/executeQueryPBF-vdaOUMid.js","assets/MapNotesLayer-CdG3vHcH.js","assets/objectIdUtils-GktMsX8e.js","assets/MediaLayer-39dmiD7K.js","assets/MediaElementView-ezYHddnZ.js","assets/normalizeUtilsSync-zfJiThlh.js","assets/OGCFeatureLayer--w0HTnNu.js","assets/ogcFeatureUtils-dtzP0u64.js","assets/geojson-fSjaGZrp.js","assets/date-be_IQzZd.js","assets/OpenStreetMapLayer-6XrQQ-kN.js","assets/WebTileLayer-JxqArsF7.js","assets/OrientedImageryLayer-LKoItije.js","assets/PointCloudLayer-qVzMPRjJ.js","assets/PointCloudUniqueValueRenderer-RbbyNiwC.js","assets/RouteLayer-GamYzZdr.js","assets/Stop-W76EJiT2.js","assets/StreamLayer-KHxHoWyI.js","assets/SubtypeGroupLayer-xK5RtU9X.js","assets/TileLayer-bPSfr5GU.js","assets/VectorTileLayer-0SVRfneU.js","assets/StyleRepository-UhXfhILC.js","assets/TileClipper-NSFZXMR1.js","assets/definitions-DqQMJYPH.js","assets/WFSLayer-VPxAc_vg.js","assets/wfsUtils-6CAR46-c.js","assets/xmlUtils-Q_9cB30b.js","assets/WMTSLayer-Qx8zOTb2.js","assets/groupLayerUtils-ciLlAkrK.js","assets/utils-rBsg-VY8.js","assets/statsWorker-HfKfr9Es.js","assets/geometryEngineWorker-yTomxYzK.js","assets/geometryEngineJSON-FxYgI0L3.js","assets/CSVSourceWorker-GlkXsKJn.js","assets/ElevationSamplerWorker-_kiMcA-u.js","assets/FeatureServiceSnappingSourceWorker-TBw9rhlL.js","assets/symbologySnappingCandidates-Sz0MFOvR.js","assets/GeoJSONSourceWorker-Sd5A35h-.js","assets/sourceUtils-zbywPEXK.js","assets/MemorySourceWorker-K3WXTL5J.js","assets/PBFDecoderWorker--NqrOA1Y.js","assets/Pipeline--6jAENf8.js","assets/StreamFeatureManager-QrKJ84_c.js","assets/labelPoint-ysDT9nFH.js","assets/createConnection-4ppGVnSc.js","assets/enums-uQoFEhYh.js","assets/number-sTjsTbdA.js","assets/PointCloudWorker-UgniuzRB.js","assets/PointCloudWorkerUtil-q8ml4JQu.js","assets/RasterWorker-0s4_fI9v.js","assets/SceneLayerWorker-o7OZRrjZ.js","assets/I3SNode-5SPByfpU.js","assets/WFSSourceWorker-iUwpu94Y.js","assets/WorkerTileHandler-9KieSe2P.js","assets/Rect-bBBxMtVp.js","assets/TurboLine-SWK4qRwh.js","assets/BidiEngine-8z8MVveq.js","assets/Popup-aRK3Vd3w.js","assets/featureUtils-itZGjo5c.js","assets/AnchorElementViewModel-SDYg-P9c.js","assets/ReactiveSet-HLstcUcf.js","assets/TileLayerView3D-5Hf3FIEh.js","assets/LayerView3D-iOx2MD1g.js","assets/TiledLayerView3D-Av58zTxG.js","assets/LayerView-efDufa6j.js","assets/RefreshableLayerView-Pd4dLcWr.js","assets/MapServiceLayerViewHelper-a8WMaeWS.js","assets/ElevationLayerView3D-aDJhr4Zv.js","assets/BaseDynamicLayerView3D-aiAW9HKo.js","assets/DynamicLayerView3D-4lztpXo0.js","assets/projectExtentUtils-TwA6ooHn.js","assets/ImageMaterial.glsl-TdPtjVc_.js","assets/BuildingSceneLayerView3D-jychJ4lg.js","assets/I3SMeshView3D-OXYwZo0p.js","assets/I3SOverrides-5dCbMm3h.js","assets/meshFeatureSet-Mcou8mDC.js","assets/External-GV0jSEES.js","assets/FeatureLayerView3D-t6NDkLO0.js","assets/FeatureLayerViewBase3D-VurTj7t3.js","assets/HeatmapDensity.glsl-y7dUg--m.js","assets/queryForSymbologySnapping-I1fFQTD_.js","assets/Graphics3DObjectStates--mMi4sdi.js","assets/EventedSet-JGlFrfoR.js","assets/I3SQueryFeatureStore-CLo7XXT-.js","assets/DefinitionExpressionSceneLayerView-oAOUEjm-.js","assets/CSVLayerView3D-t0wtEtZq.js","assets/DimensionLayerView3D-sKnmIRMF.js","assets/GeoJSONLayerView3D-4MSCbPJp.js","assets/GraphicsLayerView3D-TqJxY2EU.js","assets/GraphicsProcessor-rh5nA4fc.js","assets/GroupLayerView-do80uFuS.js","assets/ImageryLayerView3D-Ajt9-b41.js","assets/IntegratedMeshLayerView3D-EW3nzBgf.js","assets/LineOfSightLayerView3D-rUjgrEFl.js","assets/MapImageLayerView3D-GIO-oWiM.js","assets/MediaLayerView3D-CIdxGOiQ.js","assets/OGCFeatureLayerView3D-FLI41Ca4.js","assets/PointCloudLayerView3D-KHREaqUZ.js","assets/PopupSceneLayerView-cRxapYqF.js","assets/VoxelLayerView3D-FruX8zyo.js","assets/RouteLayerView3D-tOy-WtTD.js","assets/SceneLayerView3D-7NpyxR5M.js","assets/SceneLayerView-MZstNOoI.js","assets/SceneLayerGraphicsView3D-Abn6jwJk.js","assets/StreamLayerView3D-nu_wqFzJ.js","assets/ImageryTileLayerView3D-kyd0hRhY.js","assets/VectorTileLayerView3D-eexSRj3E.js","assets/rasterizingUtils-6P0UGdzr.js","assets/GeometryUtils-K2DOc0l8.js","assets/WFSLayerView3D-OjHmKjv_.js","assets/WMSLayerView3D-HO_hwLwX.js","assets/WMTSLayerView3D-oO1etwl-.js","assets/AreaMeasurementAnalysisView3D-AasBQOV-.js","assets/AnalysisView3D-jkk3JIRT.js","assets/UnitNormalizer-19C91v_m.js","assets/euclideanAreaMeasurementUtils-zmzttSyV.js","assets/measurementUtils-84-ZBArh.js","assets/LineVisualElement-4BP10o6v.js","assets/quantityFormatUtils-NiAiojad.js","assets/Segment-hN2uWAPW.js","assets/TextOverlayItem-eCjvS6IO.js","assets/DimensionAnalysisView3D-W2fgoQBr.js","assets/euclideanLengthMeasurementUtils-VQw5qWk6.js","assets/Factory-m-O4WAoG.js","assets/VerticesVisualElement-oQAA_hbc.js","assets/analysisViewUtils-AQaQeJpR.js","assets/DirectLineMeasurementAnalysisView3D-AgdgP6Nj.js","assets/LineOfSightAnalysisView3D-lX-OBMBB.js","assets/manipulatorUtils-1y2yxq3d.js","assets/SliceAnalysisView3D--IcVdus9.js","assets/SlicePlaneMaterial.glsl-RxywoUhm.js","assets/CIMSymbolRasterizer-o8gx_uXl.js","assets/cimAnalyzer-DtyBzAGI.js","assets/TerrainTileTree3DDebugger-Or7WvqAU.js","assets/TileTreeDebugger-2DVbY5sQ.js","assets/calcite-button-tOn16zeN.js","assets/button-dkwNndhL.js","assets/form-2Iq0hI3D.js","assets/interactive-NKzPUNL4.js","assets/label2-d2vWQ7x7.js","assets/loadable-sxY2K1G3.js","assets/locale-pfkq1d6A.js","assets/key-qdHumIlA.js","assets/observers-JyBmMU24.js","assets/component-dtiBfYiX.js","assets/t9n-od6MEnI1.js","assets/icon-ZwpY5ksA.js","assets/loader-QqciGs1c.js","assets/guid-6vN-YNJI.js","assets/calcite-icon-itD416se.js","assets/FeatureTileTree3DDebugger-ZBfyCqfy.js","assets/GraphicsView3D-6FUUKif_.js","assets/calcite-tooltip-DucKIjb_.js","assets/floating-ui-McpI0u1Z.js","assets/debounce-HnHf1UOZ.js","assets/openCloseComponent-yw47Oy2q.js","assets/FloatingArrow-BghsONry.js","assets/calcite-scrim-iUD6Tmec.js","assets/scrim-OeyGkB0-.js","assets/calcite-chip-MkTbFpRn.js","assets/conditionalSlot-e55zipTI.js","assets/previewCIMSymbol-ZetpgWRs.js","assets/FeatureServiceSnappingSource-El1DZ1LB.js","assets/queryEngineUtils-0F1SWi13.js","assets/VertexSnappingCandidate-sgrBHAMS.js","assets/FeatureCollectionSnappingSource-AwpfuxVk.js","assets/GraphicsSnappingSource-FqTOI9A3.js","assets/SceneLayerSnappingSource-u6yw_bMd.js","assets/editingTools-1yHclJT1.js","assets/editPlaneUtils-4qxd7h1E.js","assets/Tooltip-ON77BKb3.js","assets/automaticAreaMeasurementUtils-nVd6Y5mX.js","assets/editingTools-eh7FxppI.js","assets/GraphicState-2UcU5UAX.js","assets/TranslateTooltipInfos-J6BygtUO.js","assets/ExtentTooltipInfos-LPjFe37b.js","assets/GraphicMover-DhG5Ib7v.js","assets/Box-gJ8-sOXE.js","assets/settings-YeKUIkGh.js","assets/Reshape-J0NI6bzM.js","assets/calcite-dropdown-caxGPYrb.js","assets/calcite-dropdown-group-bJt5U1w-.js","assets/resources2-gI505pgk.js","assets/calcite-dropdown-item-HvBJs5CH.js","assets/calcite-checkbox-OaFCWd7i.js","assets/calcite-label-lSeWOYbm.js","assets/calcite-option-LMeeGK3H.js","assets/calcite-select-0Yw6DsYN.js","assets/ElevationProfileView2D-KdZmS2un.js","assets/HoveredPoints-BD2phuV6.js","assets/ElevationProfileView3D-bd56oGje.js","assets/calcite-action-mEzyoc-Z.js","assets/action-W5zDPNjG.js","assets/calcite-popover-PeZ1jQob.js","assets/popover-Jm1QI0N1.js","assets/calcite-loader-Z65agR8e.js","assets/chartUtils-P39aKol1.js","assets/Responsive-QKXcW_1q.js","assets/Theme-QNc_77AM.js","assets/chartUtilsAm5-QfmFJ3lc.js","assets/Tooltip-lrFZgXdG.js","assets/DefaultTheme-T7-VnRhA.js","assets/LineSeries-VcEznTH7.js","assets/ColorSet-j9kKRPwP.js","assets/Tick-WQ_bPwW2.js","assets/Button-1STHXt3M.js","assets/calcite-color-picker-iQ658ZQD.js","assets/progress-puB9lhY4.js","assets/math-SoUQJWjz.js","assets/calcite-slider--uw2bYfU.js","assets/calcite-list-item-OtIyVNHT.js","assets/utils3-_ao2jQXg.js","assets/calcite-list-LJfGqLbO.js","assets/input-9jE7tcJD.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/index-PpMPqKeV.css b/dist/assets/index-PpMPqKeV.css new file mode 100644 index 0000000..9e0dd83 --- /dev/null +++ b/dist/assets/index-PpMPqKeV.css @@ -0,0 +1 @@ +@import"https://js.arcgis.com/4.28/@arcgis/core/assets/esri/themes/light/main.css";@import"https://js.arcgis.com/calcite-components/1.11.0/calcite.css";html,body,#viewDiv{padding:0;margin:0;height:100%;width:100%;overflow-y:hidden;font-family:Avenir Next W00,Helvetica Neue,Helvetica,Arial,sans-serif;--calcite-ui-brand: #648880;--calcite-ui-brand-hover: #648880;--calcite-ui-brand-press: #648880}body{display:flex}.esri-view .esri-view-surface--touch-none:focus:after{outline:none!important}#header{display:flex;justify-content:space-between;align-items:center}#header-title{margin-left:1rem;margin-right:1rem;color:#fff}table{margin:1em 0}.center{text-align:center}#sketchPanel{width:300px;padding:10px;background-color:#fffc}.esri-button{margin:2px}#configurationDiv{padding:10px;text-align:left;width:250px}#configurationInfoDiv{padding:7px;text-align:left}#snappingctrlkey{display:inline}#actionbuttons,#edgeoperationbuttons{display:none}.update-options{display:flex;flex-direction:row}.edge-button,.shape-button{flex:1;border-style:solid;border-width:1px;border-image:none}.edge-button-selected,.shape-button-selected{background:#4c4c4c;color:#fff}#topbar{background:#fff;padding:10px}.action-button{font-size:16px;background-color:transparent;border:1px solid #d3d3d3;color:#6e6e6e;height:32px;width:32px;text-align:center;box-shadow:0 0 1px #0000004d}.action-button:hover,.action-button:focus{background:#0079c1;color:#e4e4e4}.active{background:#0079c1;color:#e4e4e4}.hide{display:none}img{border:10px solid white;box-shadow:2px 2px 5px #00000080}.action-button2{padding:.6em;border:1px solid #0079c1;text-align:center;background-color:#fff;cursor:pointer}.action-button2:hover,.action-button2:focus{background:#0079c1;color:#fff}#maskDiv{position:absolute;background:#ff33001a;border:2px dashed rgb(255,51,0)}.shadowcast-button{border:0}.button-container{margin:5px 0;text-align:left}#opacitySliderContainer{text-align:center;padding:1em;margin-bottom:20px}#opacity{margin-bottom:.5em}#opacitySlider{margin:.5em 2em}#elevationInput,#navigationUnderground{margin-left:.5em}#calcite-shell{background:#32774e;background:linear-gradient(to right bottom,#648880,#32774e)}#information-panel{padding:.25em}#in-ads-container{margin-left:1rem;margin-right:1rem;width:350px}.esri-component.esri-coordinate-conversion.esri-widget{width:350px;font-size:11px;background-color:#fffc}.esri-coordinate-conversion__row{padding:0 5px}#elevationModels,#navigationUnderground,#elevationInput{padding:.25em}#daylight-container,#shadowcast-container,#sketchPanel{width:100%;height:100%}.responsive-action-bar{flex-wrap:wrap}#layers-container,#wms-layers-container{overflow-y:auto;display:block;height:50vh} diff --git a/dist/assets/input-9jE7tcJD.js b/dist/assets/input-9jE7tcJD.js new file mode 100644 index 0000000..341b567 --- /dev/null +++ b/dist/assets/input-9jE7tcJD.js @@ -0,0 +1,35 @@ +import{q as k,H as z,r as g,db as y,B as I,dc as x,ch as V,t as n,dd as E,x as H}from"./index-J0iiHjMT.js";import{s as C,c as S,d as D,H as L}from"./form-2Iq0hI3D.js";import{c as N,d as O,u as B}from"./interactive-NKzPUNL4.js";import{n as T}from"./key-qdHumIlA.js";import{c as F,d as A,g as v}from"./label2-d2vWQ7x7.js";import{s as P,a as K,c as U}from"./loadable-sxY2K1G3.js";import{n as o,i as p,p as j,s as M,a as W,c as R,d as q,B as $}from"./locale-pfkq1d6A.js";import{c as _}from"./observers-JyBmMU24.js";import{u as G,c as Y,d as Z,s as J}from"./t9n-od6MEnI1.js";import{g as f}from"./component-dtiBfYiX.js";import{d as Q}from"./icon-ZwpY5ksA.js";import{d as X}from"./progress-puB9lhY4.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const s={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},w={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},ee={action:"action"},te=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-ui-text-1)}calcite-icon{color:var(--calcite-ui-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{padding-inline-start:2rem}:host([icon][scale=m]) input{padding-inline-start:2.5rem}:host([icon][scale=l]) input{padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.icon,.resize-icon-wrapper{z-index:var(--calcite-app-z-index)}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc( + -2px * + calc( + 1 - + 2 * clamp( + 0, + var(--calcite-ui-focus-offset-invert), + 1 + ) + ) + )}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}input[type=number]{-moz-appearance:textfield}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;order:6;box-sizing:border-box;display:flex;flex-direction:column;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}:host([number-button-type=vertical]) .wrapper{flex-direction:row;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:1;max-block-size:100%;min-block-size:100%;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-block-start-width:0px}.number-button-item{max-block-size:50%;min-block-size:50%;pointer-events:initial;margin:0px;box-sizing:border-box;display:flex;cursor:pointer;align-items:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-block:0px;padding-inline:0.5rem;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.number-button-item:disabled{pointer-events:none}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:input::-webkit-calendar-picker-indicator{display:none}input[type=date]::-webkit-input-placeholder{visibility:hidden !important}textarea::-webkit-resizer{position:absolute;inset-block-end:0px;box-sizing:border-box;padding-block:0px;padding-inline:0.25rem;inset-inline-end:0}.resize-icon-wrapper{inset-block-end:2px;inset-inline-end:2px;pointer-events:none;position:absolute;block-size:0.75rem;inline-size:0.75rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3)}.resize-icon-wrapper calcite-icon{inset-block-end:0.25rem;inset-inline-end:0.25rem;transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-block:1px;padding-inline:0.5rem}:host([type=file][scale=m]) input{padding-block:0.25rem;padding-inline:0.75rem}:host([type=file][scale=l]) input{padding-block:0.5rem;padding-inline:1rem}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}input.inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input.inline-child .editing-enabled{background-color:inherit}input.inline-child:not(.editing-enabled){display:flex;cursor:pointer;text-overflow:ellipsis;border-color:transparent;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}:host([hidden]){display:none}[hidden]{display:none}`,ie=k(class extends z{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalInputFocus=g(this,"calciteInternalInputFocus",6),this.calciteInternalInputBlur=g(this,"calciteInternalInputBlur",6),this.calciteInputInput=g(this,"calciteInputInput",7),this.calciteInputChange=g(this,"calciteInputChange",6),this.childElType="input",this.previousValueOrigin="initial",this.mutationObserver=_("mutation",()=>this.setDisabledAction()),this.userChangedValue=!1,this.keyDownHandler=e=>{this.readOnly||this.disabled||(this.isClearable&&e.key==="Escape"&&(this.clearInputValue(e),e.preventDefault()),e.key==="Enter"&&!e.defaultPrevented&&C(this)&&e.preventDefault())},this.clearInputValue=e=>{this.setValue({committing:!0,nativeEvent:e,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{this.previousValueOrigin==="user"&&this.value!==this.previousEmittedValue&&(this.calciteInputChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputBlurHandler=()=>{this.calciteInternalInputBlur.emit(),this.emitChangeIfUserModified()},this.clickHandler=e=>{if(this.disabled)return;const t=y(this.el,"action");e.target!==t&&this.setFocus()},this.inputFocusHandler=()=>{this.calciteInternalInputFocus.emit()},this.inputChangeHandler=()=>{this.type==="file"&&(this.files=this.childEl.files)},this.inputInputHandler=e=>{this.disabled||this.readOnly||this.setValue({nativeEvent:e,origin:"user",value:e.target.value})},this.inputKeyDownHandler=e=>{this.disabled||this.readOnly||e.key==="Enter"&&this.emitChangeIfUserModified()},this.inputNumberInputHandler=e=>{if(this.disabled||this.readOnly)return;const t=e.target.value;o.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator};const i=o.delocalize(t);e.inputType==="insertFromPaste"?(p(i)||e.preventDefault(),this.setValue({nativeEvent:e,origin:"user",value:j(i)}),this.childNumberEl.value=this.localizedValue):this.setValue({nativeEvent:e,origin:"user",value:i})},this.inputNumberKeyDownHandler=e=>{if(this.type!=="number"||this.disabled||this.readOnly)return;if(e.key==="ArrowUp"){e.preventDefault(),this.nudgeNumberValue("up",e);return}if(e.key==="ArrowDown"){this.nudgeNumberValue("down",e);return}const t=[...T,"ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab"];if(e.altKey||e.ctrlKey||e.metaKey)return;const i=e.shiftKey&&e.key==="Tab";if(t.includes(e.key)||i){e.key==="Enter"&&this.emitChangeIfUserModified();return}o.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},!(e.key===o.decimal&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.indexOf(o.decimal)===-1))&&(/[eE]/.test(e.key)&&(!this.value&&!this.childNumberEl.value||this.value&&!/[eE]/.test(this.childNumberEl.value))||e.key==="-"&&(!this.value&&!this.childNumberEl.value||this.value&&this.childNumberEl.value.split("-").length<=2)||e.preventDefault())},this.nudgeNumberValue=(e,t)=>{if(t instanceof KeyboardEvent&&t.repeat||this.type!=="number")return;const i=this.maxString?parseFloat(this.maxString):null,r=this.minString?parseFloat(this.minString):null,a=150;this.incrementOrDecrementNumberValue(e,i,r,t),this.nudgeNumberValueIntervalId&&window.clearInterval(this.nudgeNumberValueIntervalId);let l=!0;this.nudgeNumberValueIntervalId=window.setInterval(()=>{if(l){l=!1;return}this.incrementOrDecrementNumberValue(e,i,r,t)},a)},this.numberButtonPointerUpAndOutHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.numberButtonPointerDownHandler=e=>{if(!I(e))return;e.preventDefault();const t=e.target.dataset.adjustment;this.disabled||this.nudgeNumberValue(t,e)},this.hiddenInputChangeHandler=e=>{e.target.name===this.name&&this.setValue({value:e.target.value,origin:"direct"}),e.stopPropagation()},this.setChildElRef=e=>{this.childEl=e},this.setChildNumberElRef=e=>{this.childNumberEl=e},this.setInputValue=e=>{this.type==="text"&&!this.childEl||this.type==="number"&&!this.childNumberEl||(this[`child${this.type==="number"?"Number":""}El`].value=e)},this.setPreviousEmittedValue=e=>{this.previousEmittedValue=this.normalizeValue(e)},this.setPreviousValue=e=>{this.previousValue=this.normalizeValue(e)},this.setValue=({committing:e=!1,nativeEvent:t,origin:i,previousValue:r,value:a})=>{var l,h;if(this.setPreviousValue(r??this.value),this.previousValueOrigin=i,this.type==="number"){o.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator,signDisplay:"never"};const m=((l=this.previousValue)==null?void 0:l.length)>a.length||((h=this.value)==null?void 0:h.length)>a.length,u=a.charAt(a.length-1)===".",b=u&&m?a:M(a),c=a&&!b?p(this.previousValue)?this.previousValue:"":b;let d=o.localize(c);i!=="connected"&&!u&&(d=W(d,c,o)),this.localizedValue=u&&m?`${d}${o.decimal}`:d,this.userChangedValue=i==="user"&&this.value!==c,this.value=["-","."].includes(c)?"":c}else this.userChangedValue=i==="user"&&this.value!==a,this.value=a;i==="direct"&&(this.setInputValue(a),this.previousEmittedValue=a),t&&(this.calciteInputInput.emit().defaultPrevented?(this.value=this.previousValue,this.localizedValue=this.type==="number"?o.localize(this.previousValue):this.previousValue):e&&this.emitChangeIfUserModified())},this.inputKeyUpHandler=()=>{window.clearInterval(this.nudgeNumberValueIntervalId)},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.form=void 0,this.groupSeparator=!1,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.numberingSystem=void 0,this.localeFormat=!1,this.max=void 0,this.min=void 0,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.numberButtonType="vertical",this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.step=void 0,this.autocomplete=void 0,this.pattern=void 0,this.accept=void 0,this.multiple=!1,this.inputMode="text",this.enterKeyHint=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.type="text",this.value="",this.files=void 0,this.messages=void 0,this.messageOverrides=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.localizedValue=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}maxWatcher(){var e;this.maxString=((e=this.max)==null?void 0:e.toString())||null}minWatcher(){var e;this.minString=((e=this.min)==null?void 0:e.toString())||null}onMessagesChange(){}valueWatcher(e,t){this.userChangedValue||(this.setValue({origin:"direct",previousValue:t,value:e==null||e==""?"":this.type==="number"?p(e)?e:this.previousValue||"":e}),this.warnAboutInvalidNumberValue(e)),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=x(w,this.icon,this.type)}get isClearable(){var e;return!this.isTextarea&&(this.clearable||this.type==="search")&&((e=this.value)==null?void 0:e.length)>0}get isTextarea(){return this.childElType==="textarea"}effectiveLocaleChange(){G(this,this.effectiveLocale)}connectedCallback(){var e;N(this),R(this),Y(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),F(this),S(this),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),this.type==="number"&&(this.warnAboutInvalidNumberValue(this.value),this.setValue({origin:"connected",value:p(this.value)?this.value:""})),(e=this.mutationObserver)==null||e.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){var e;O(this),A(this),D(this),q(this),Z(this),(e=this.mutationObserver)==null||e.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){var e,t;P(this),this.childElType=this.type==="textarea"?"textarea":"input",this.maxString=(e=this.max)==null?void 0:e.toString(),this.minString=(t=this.min)==null?void 0:t.toString(),this.requestedIcon=x(w,this.icon,this.type),await J(this)}componentDidLoad(){K(this)}componentShouldUpdate(e,t,i){return this.type==="number"&&i==="value"&&e&&!p(e)?(this.setValue({origin:"reset",value:t}),!1):!0}componentDidRender(){B(this)}async setFocus(){var e,t;await U(this),this.type==="number"?(e=this.childNumberEl)==null||e.focus():(t=this.childEl)==null||t.focus()}async selectText(){var e,t;this.type==="number"?(e=this.childNumberEl)==null||e.select():(t=this.childEl)==null||t.select()}onLabelClick(){this.setFocus()}incrementOrDecrementNumberValue(e,t,i,r){const{value:a}=this,l=e==="up"?1:-1,h=this.step==="any"?1:Math.abs(this.step||1),u=new $(a!==""?a:"0").add(`${h*l}`),b=()=>typeof i=="number"&&!isNaN(i)&&u.subtract(`${i}`).isNegative,c=()=>typeof t=="number"&&!isNaN(t)&&!u.subtract(`${t}`).isNegative,d=b()?`${i}`:c()?`${t}`:u.toString();this.setValue({committing:!0,nativeEvent:r,origin:"user",value:d})}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(e){var i,r;const{type:t}=this;e.type=t,t==="number"?(e.min=((i=this.min)==null?void 0:i.toString(10))??"",e.max=((r=this.max)==null?void 0:r.toString(10))??""):t==="text"&&(this.minLength!=null&&(e.minLength=this.minLength),this.maxLength!=null&&(e.maxLength=this.maxLength))}setDisabledAction(){const e=y(this.el,"action");e&&(this.disabled?(e.getAttribute("disabled")==null&&(this.slottedActionElDisabledInternally=!0),e.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(e.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}normalizeValue(e){return this.type==="number"?p(e)?e:"":e}warnAboutInvalidNumberValue(e){this.type==="number"&&e&&!p(e)&&console.warn(`The specified value "${e}" cannot be parsed, or is out of range.`)}render(){const e=V(this.el),t=n("div",{class:s.loader},n("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),i=n("button",{"aria-label":this.messages.clear,class:s.clearButton,disabled:this.disabled||this.readOnly,onClick:this.clearInputValue,tabIndex:-1,type:"button"},n("calcite-icon",{icon:"x",scale:f(this.scale)})),r=n("calcite-icon",{class:s.inputIcon,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:f(this.scale)}),a=this.numberButtonType==="horizontal",l=n("button",{"aria-hidden":"true",class:{[s.numberButtonItem]:!0,[s.buttonItemHorizontal]:a},"data-adjustment":"up",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{icon:"chevron-up",scale:f(this.scale)})),h=n("button",{"aria-hidden":"true",class:{[s.numberButtonItem]:!0,[s.buttonItemHorizontal]:a},"data-adjustment":"down",disabled:this.disabled||this.readOnly,onPointerDown:this.numberButtonPointerDownHandler,onPointerOut:this.numberButtonPointerUpAndOutHandler,onPointerUp:this.numberButtonPointerUpAndOutHandler,tabIndex:-1,type:"button"},n("calcite-icon",{icon:"chevron-down",scale:f(this.scale)})),m=n("div",{class:s.numberButtonWrapper},l,h),u=n("div",{class:s.prefix},this.prefixText),b=n("div",{class:s.suffix},this.suffixText),c=this.type==="number"?n("input",{accept:this.accept,"aria-label":v(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,multiple:this.multiple,name:void 0,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,type:"text",value:this.localizedValue,ref:this.setChildNumberElRef}):null,d=this.type!=="number"?[n(this.childElType,{accept:this.accept,"aria-label":v(this),autocomplete:this.autocomplete,autofocus:this.autofocus?!0:null,class:{[s.editingEnabled]:this.editingEnabled,[s.inlineChild]:!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:this.disabled?!0:null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,multiple:this.multiple,name:this.name,onBlur:this.inputBlurHandler,onChange:this.inputChangeHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,onKeyUp:this.inputKeyUpHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,required:this.required?!0:null,step:this.step,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:this.type,value:this.value,ref:this.setChildElRef}),this.isTextarea?n("div",{class:s.resizeIconWrapper},n("calcite-icon",{icon:"chevron-down",scale:f(this.scale)})):null]:null;return n(H,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},n("div",{class:{[s.inputWrapper]:!0,[E.rtl]:e==="rtl"}},this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?h:null,this.prefixText?u:null,n("div",{class:s.wrapper},c,d,this.isClearable?i:null,this.requestedIcon?r:null,this.loading?t:null),n("div",{class:s.actionWrapper},n("slot",{name:ee.action})),this.type==="number"&&this.numberButtonType==="vertical"&&!this.readOnly?m:null,this.suffixText?b:null,this.type==="number"&&this.numberButtonType==="horizontal"&&!this.readOnly?l:null,n(L,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return te}},[1,"calcite-input",{alignment:[513],autofocus:[516],clearable:[516],disabled:[516],form:[513],groupSeparator:[516,"group-separator"],hidden:[516],icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],label:[1],loading:[516],numberingSystem:[513,"numbering-system"],localeFormat:[4,"locale-format"],max:[514],min:[514],maxLength:[514,"max-length"],minLength:[514,"min-length"],name:[513],numberButtonType:[513,"number-button-type"],placeholder:[1],prefixText:[1,"prefix-text"],readOnly:[516,"read-only"],required:[516],scale:[513],status:[513],step:[520],autocomplete:[1],pattern:[1],accept:[1],multiple:[4],inputMode:[1,"input-mode"],enterKeyHint:[1,"enter-key-hint"],suffixText:[1,"suffix-text"],editingEnabled:[1540,"editing-enabled"],type:[513],value:[1025],files:[16],messages:[1040],messageOverrides:[1040],defaultMessages:[32],effectiveLocale:[32],localizedValue:[32],slottedActionElDisabledInternally:[32],setFocus:[64],selectText:[64]}]);function ne(){if(typeof customElements>"u")return;["calcite-input","calcite-icon","calcite-progress"].forEach(t=>{switch(t){case"calcite-input":customElements.get(t)||customElements.define(t,ie);break;case"calcite-icon":customElements.get(t)||Q();break;case"calcite-progress":customElements.get(t)||X();break}})}ne();export{ie as I,ne as d}; diff --git a/dist/assets/interactive-NKzPUNL4.js b/dist/assets/interactive-NKzPUNL4.js new file mode 100644 index 0000000..aebe550 --- /dev/null +++ b/dist/assets/interactive-NKzPUNL4.js @@ -0,0 +1,5 @@ +import"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function o(){return navigator.userAgentData}function g(){const e=o();return e!=null&&e.brands?e.brands.map(({brand:t,version:a})=>`${t}/${a}`).join(" "):navigator.userAgent}const i=/firefox/i.test(g()),r=i?new WeakMap:null;function b(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function s(e){const t=e.target;if(i&&!r.get(t))return;const{disabled:a}=t;a&&e.preventDefault()}const u=["mousedown","mouseup","click"];function l(e){if(i&&!r.get(e.target))return;const{disabled:t}=e.target;t&&(e.stopImmediatePropagation(),e.preventDefault())}const n={capture:!0};function k(e,t=!1){if(e.disabled){e.el.setAttribute("tabindex","-1"),e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),c(e);return}f(e),typeof t=="function"?e.el.setAttribute("tabindex",t.call(e)?"0":"-1"):t===!0?e.el.setAttribute("tabindex","0"):t===!1&&e.el.removeAttribute("tabindex"),e.el.removeAttribute("aria-disabled")}function c(e){e.el.click=b,v(i?d(e):e.el)}function v(e){e&&(e.addEventListener("pointerdown",s,n),u.forEach(t=>e.addEventListener(t,l,n)))}function d(e){return r.get(e.el)}function f(e){delete e.el.click,E(i?d(e):e.el)}function E(e){e&&(e.removeEventListener("pointerdown",s,n),u.forEach(t=>e.removeEventListener(t,l,n)))}function x(e){if(!e.disabled||!i)return;const t=e.el.parentElement||e.el;r.set(e.el,t),c(e)}function L(e){i&&(r.delete(e.el),f(e))}export{x as c,L as d,k as u}; diff --git a/dist/assets/interfaces-lHX1zDRv.js b/dist/assets/interfaces-lHX1zDRv.js new file mode 100644 index 0000000..e8fc691 --- /dev/null +++ b/dist/assets/interfaces-lHX1zDRv.js @@ -0,0 +1 @@ +var o,t;(function(e){e[e.None=0]="None",e[e.Direct=1]="Direct",e[e.Triangle=2]="Triangle",e[e.ProjectedGeodesic=3]="ProjectedGeodesic"})(o||(o={})),function(e){e[e.Auto=0]="Auto",e[e.AboveSegment=1]="AboveSegment",e[e.BelowSegment=2]="BelowSegment"}(t||(t={}));export{o as e,t as o}; diff --git a/dist/assets/interfaces-tkyofe_Z.js b/dist/assets/interfaces-tkyofe_Z.js new file mode 100644 index 0000000..1fc097c --- /dev/null +++ b/dist/assets/interfaces-tkyofe_Z.js @@ -0,0 +1 @@ +var c;(function(o){o[o.Auto=0]="Auto",o[o.Euclidean=1]="Euclidean",o[o.Geodesic=2]="Geodesic"})(c||(c={}));export{c as e}; diff --git a/dist/assets/it_IT-AbCCe__c.js b/dist/assets/it_IT-AbCCe__c.js new file mode 100644 index 0000000..8c96335 --- /dev/null +++ b/dist/assets/it_IT-AbCCe__c.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"HH:mm:ss SSS",_duration_millisecond_day:"d'g' mm:ss SSS",_duration_millisecond_week:"d'g' mm:ss SSS",_duration_millisecond_month:"M'm' dd'g' mm:ss SSS",_duration_millisecond_year:"y'a' MM'm' dd'g' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'g' hh:mm:ss",_duration_second_week:"d'g' hh:mm:ss",_duration_second_month:"M'm' dd'g' hh:mm:ss",_duration_second_year:"y'a' MM'm' dd'g' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'g' hh:mm",_duration_minute_week:"d'g' hh:mm",_duration_minute_month:"M'm' dd'g' hh:mm",_duration_minute_year:"y'a' MM'm' dd'g' hh:mm",_duration_hour:"hh'o'",_duration_hour_day:"d'g' hh'o'",_duration_hour_week:"d'g' hh'o'",_duration_hour_month:"M'm' dd'g' hh'o'",_duration_hour_year:"y'a' MM'm' dd'g' hh'o'",_duration_day:"d'g'",_duration_day_week:"d'g'",_duration_day_month:"M'm' dd'g'",_duration_day_year:"y'a' MM'm' dd'g'",_duration_week:"w's'",_duration_week_month:"w's'",_duration_week_year:"w's'",_duration_month:"M'm'",_duration_month_year:"y'a' MM'm'",_duration_year:"y'a'",_era_ad:"A.C.",_era_bc:"D.C.",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Gennaio",February:"Febbraio",March:"Marzo",April:"Aprile",May:"Maggio",June:"Giugno",July:"Luglio",August:"Agosto",September:"Settembre",October:"Ottobre",November:"Novembre",December:"Dicembre",Jan:"Gen",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Mag",Jun:"Giu",Jul:"Lug",Aug:"Ago",Sep:"Set",Oct:"Ott",Nov:"Nov",Dec:"Dic",Sunday:"Domenica",Monday:"Lunedì",Tuesday:"Martedì",Wednesday:"Mercoledì",Thursday:"Giovedì",Friday:"Venerdì",Saturday:"Sabato",Sun:"Dom",Mon:"Lun",Tue:"Mar",Wed:"Mer",Thu:"Gio",Fri:"Ven",Sat:"Sab",_dateOrd:function(e){return e+"°"},"Zoom Out":"Riduci zoom",Play:"Avvia",Stop:"Ferma",Legend:"Legenda","Press ENTER to toggle":"Clicca, tappa o premi ENTER per attivare",Loading:"Caricamento",Home:"Home",Chart:"Grafico","Serial chart":"Grafico combinato","X/Y chart":"Grafico X/Y","Pie chart":"Grafico a torta","Gauge chart":"Diagramma di livello","Radar chart":"Grafico radar","Sankey diagram":"Diagramma di Sankey","Flow diagram":"Diagramma di flusso","Chord diagram":"Diagramma a corda","TreeMap chart":"Mappa ad albero","Sliced chart":"Grafico a fette",Series:"Serie","Candlestick Series":"Serie a candele","OHLC Series":"Serie OHLC","Column Series":"Serie a colonne","Line Series":"Serie a linee","Pie Slice Series":"Serie a fetta di torta","Funnel Series":"Serie ad imbuto","Pyramid Series":"Serie a piramide","X/Y Series":"Serie X/Y",Map:"Mappa","Press ENTER to zoom in":"Premi ENTER per ingrandire","Press ENTER to zoom out":"Premi ENTER per ridurre","Use arrow keys to zoom in and out":"Usa le frecce per ingrandire e ridurre","Use plus and minus keys on your keyboard to zoom in and out":"Utilizza i tasti più e meno sulla tastiera per ingrandire e ridurre",Export:"Esporta",Image:"Immagine",Data:"Dati",Print:"Stampa","Press ENTER to open":"Clicca, tappa o premi ENTER per aprire","Press ENTER to print.":"Clicca, tappa o premi ENTER per stampare.","Press ENTER to export as %1.":"Clicca, tappa o premi ENTER per esportare come %1.","(Press ESC to close this message)":"(Premere ESC per chiudere questo messaggio)","Image Export Complete":"Esportazione immagine completata","Export operation took longer than expected. Something might have gone wrong.":"L'operazione di esportazione ha richiesto più tempo del previsto. Potrebbe esserci qualche problema.","Saved from":"Salvato da",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o i tasti freccia sinistra e destra per modificare la selezione","Use left and right arrows to move selection":"Utilizzare le frecce sinistra e destra per spostare la selezione","Use left and right arrows to move left selection":"Utilizzare frecce destra e sinistra per spostare la selezione sinistra","Use left and right arrows to move right selection":"Utilizzare frecce destra e sinistra per spostare la selezione destra","Use TAB select grip buttons or up and down arrows to change selection":"Utilizzare TAB per selezionare i punti di ancoraggio o premere le frecce su e giù per modificare la selezione","Use up and down arrows to move selection":"Utilizzare le frecce su e giù per spostare la selezione","Use up and down arrows to move lower selection":"Utilizzare le frecce su e giù per spostare la selezione inferiore","Use up and down arrows to move upper selection":"Utilizzare le frecce su e giù per spostare la selezione superiore","From %1 to %2":"Da %1 a %2","From %1":"Da %1","To %1":"a %1","No parser available for file: %1":"Nessun parser disponibile per il file: %1","Error parsing file: %1":"Errore durante l'analisi del file: %1","Unable to load file: %1":"Impossibile caricare il file: %1","Invalid date":"Data non valida"};export{a as default}; diff --git a/dist/assets/ja_JP-Rlf-hOL0.js b/dist/assets/ja_JP-Rlf-hOL0.js new file mode 100644 index 0000000..5f7dc77 --- /dev/null +++ b/dist/assets/ja_JP-Rlf-hOL0.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西暦",_era_bc:"紀元前",A:"午前",P:"午後",AM:"午前",PM:"午後","A.M.":"午前","P.M.":"午後",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"日曜日",Monday:"月曜日",Tuesday:"火曜日",Wednesday:"水曜日",Thursday:"木曜日",Friday:"金曜日",Saturday:"土曜日",Sun:"日",Mon:"月",Tue:"火",Wed:"水",Thu:"木",Fri:"金",Sat:"土",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"ズーム",Play:"再生",Stop:"停止",Legend:"凡例","Press ENTER to toggle":"",Loading:"読み込んでいます",Home:"ホーム",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"印刷",Image:"イメージ",Data:"データ",Print:"印刷","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"始点 %1 終点 %2","From %1":"始点 %1","To %1":"終点 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/json-v6EOeNTY.js b/dist/assets/json-v6EOeNTY.js new file mode 100644 index 0000000..14ab849 --- /dev/null +++ b/dist/assets/json-v6EOeNTY.js @@ -0,0 +1 @@ +const Z={convertToGEGeometry:a,exportPoint:c,exportPolygon:m,exportPolyline:l,exportMultipoint:M,exportExtent:f};function a(i,t){return t==null?null:i.convertJSONToGeometry(t)}class r{constructor(t,s,n){this.x=t,this.y=s,this.spatialReference=n,this.z=void 0,this.m=void 0}}function c(i,t,s){const n=new r(i.getPointX(t),i.getPointY(t),s),e=i.hasZ(t),o=i.hasM(t);return e&&(n.z=i.getPointZ(t)),o&&(n.m=i.getPointM(t)),n}class x{constructor(t,s,n,e){this.rings=t,this.spatialReference=s,this.hasZ=void 0,this.hasM=void 0,n&&(this.hasZ=n),e&&(this.hasM=e)}}function m(i,t,s){return new x(i.exportPaths(t),s,i.hasZ(t),i.hasM(t))}class u{constructor(t,s,n,e){this.paths=t,this.spatialReference=s,this.hasZ=void 0,this.hasM=void 0,n&&(this.hasZ=n),e&&(this.hasM=e)}}function l(i,t,s){return new u(i.exportPaths(t),s,i.hasZ(t),i.hasM(t))}class v{constructor(t,s,n,e){this.points=t,this.spatialReference=s,this.hasZ=void 0,this.hasM=void 0,n&&(this.hasZ=n),e&&(this.hasM=e)}}function M(i,t,s){return new v(i.exportPoints(t),s,i.hasZ(t),i.hasM(t))}class p{constructor(t,s,n,e,o){this.xmin=t,this.ymin=s,this.xmax=n,this.ymax=e,this.spatialReference=o,this.zmin=void 0,this.zmax=void 0,this.mmin=void 0,this.mmax=void 0}}function f(i,t,s){const n=i.hasZ(t),e=i.hasM(t),o=new p(i.getXMin(t),i.getYMin(t),i.getXMax(t),i.getYMax(t),s);if(n){const h=i.getZExtent(t);o.zmin=h.vmin,o.zmax=h.vmax}if(e){const h=i.getMExtent(t);o.mmin=h.vmin,o.mmax=h.vmax}return o}export{Z as t}; diff --git a/dist/assets/jsonContext-cWV_-jAj.js b/dist/assets/jsonContext-cWV_-jAj.js new file mode 100644 index 0000000..187bd09 --- /dev/null +++ b/dist/assets/jsonContext-cWV_-jAj.js @@ -0,0 +1 @@ +import{bV as e,bS as o}from"./index-J0iiHjMT.js";function i(t){return{origin:"portal-item",url:e(t.itemUrl),portal:t.portal||o.getDefault(),portalItem:t,readResourcePaths:[]}}function n(t){const r=e(t.itemUrl);return{origin:"portal-item",messages:[],writtenProperties:[],url:r,portal:t.portal||o.getDefault(),portalItem:t,verifyItemRelativeUrls:r?{rootPath:r.path,writtenUrls:[]}:null,blockedRelativeUrls:[]}}function p(t){return{origin:"web-map",url:e(t.itemUrl),portal:t.portal||o.getDefault(),portalItem:t,readResourcePaths:[]}}function s(t,r){const l=e(t.itemUrl);return{origin:"web-map",messages:[],writtenProperties:[],url:l,portal:t.portal||o.getDefault(),portalItem:t,initiator:r,verifyItemRelativeUrls:l?{rootPath:l.path,writtenUrls:[]}:null,blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}}}export{s as a,i as e,p as l,n as o}; diff --git a/dist/assets/key-qdHumIlA.js b/dist/assets/key-qdHumIlA.js new file mode 100644 index 0000000..b8bcc08 --- /dev/null +++ b/dist/assets/key-qdHumIlA.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function t(n){return n==="Enter"||n===" "}const e=["0","1","2","3","4","5","6","7","8","9"];export{t as i,e as n}; diff --git a/dist/assets/ko_KR-_v1iWWtT.js b/dist/assets/ko_KR-_v1iWWtT.js new file mode 100644 index 0000000..8078b11 --- /dev/null +++ b/dist/assets/ko_KR-_v1iWWtT.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"AM",P:"PM",AM:"AM",PM:"PM","A.M.":"오전","P.M.":"오후",January:"1월",February:"2월",March:"3월",April:"4월",May:"5월",June:"6월",July:"7월",August:"8월",September:"9월",October:"10월",November:"11월",December:"12월",Jan:"1월",Feb:"2월",Mar:"3월",Apr:"4월","May(short)":"5월",Jun:"6월",Jul:"7월",Aug:"8월",Sep:"9월",Oct:"10월",Nov:"11월",Dec:"12월",Sunday:"일요일",Monday:"월요일",Tuesday:"화요일",Wednesday:"수요일",Thursday:"목요일",Friday:"금요일",Saturday:"토요일",Sun:"일",Mon:"월",Tue:"화",Wed:"수",Thu:"목",Fri:"금",Sat:"토",_dateOrd:function(e){let _="일";if(e<11||e>13)switch(e%10){case 1:case 2:case 3:_="일"}return _},"Zoom Out":"축소",Play:"시작",Stop:"정지",Legend:"범례","Press ENTER to toggle":"켜고 끄려면 클릭, 탭 혹은 엔터를 눌러주세요.",Loading:"불러오는 중",Home:"홈",Chart:"차트","Serial chart":"시리얼 차트","X/Y chart":"X/Y 차트","Pie chart":"파이 차트","Gauge chart":"게이지 차트","Radar chart":"레이더 차트","Sankey diagram":"생키 다이어그램","Flow diagram":"플로우 다이어그램","Chord diagram":"코드 다이어그램","TreeMap chart":"트리맵 차트","Force directed tree":"포스 디렉티드 트리","Sliced chart":"슬라이스 차트",Series:"시리즈","Candlestick Series":"캔들스틱 시리즈","OHLC Series":"OHLC 시리즈","Column Series":"컬럼 시리즈","Line Series":"라인 시리즈","Pie Slice Series":"파이 슬라이스 시리즈","Funnel Series":"퍼널 시리즈","Pyramid Series":"피라미드 시리즈","X/Y Series":"X/Y 시리즈",Map:"맵","Press ENTER to zoom in":"확대하려면 엔터를 누르세요.","Press ENTER to zoom out":"축소하려면 엔터를 누르세요.","Use arrow keys to zoom in and out":"확대 혹은 축소하려면 방향키를 이용하세요.","Use plus and minus keys on your keyboard to zoom in and out":"확대 혹은 축소하려면 키보드의 +/- 키를 이용하세요.",Export:"내보내기",Image:"이미지",Data:"데이터",Print:"인쇄","Press ENTER to open":"열려면, 클릭, 탭 또는 엔터를 누르세요.","Press ENTER to print.":"출력하려면, 클릭, 탭 또는 엔터를 누르세요.","Press ENTER to export as %1.":"%1(으)로 내보내려면 클릭, 탭 또는 엔터를 누르세요.","(Press ESC to close this message)":"(이 메시지를 끄려면 ESC를 누르세요.)","Image Export Complete":"이미지 내보내기 완료","Export operation took longer than expected. Something might have gone wrong.":"내보내기가 지연되고 있습니다. 문제가 없는지 확인이 필요합니다.","Saved from":"다음으로부터 저장됨: ",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 좌우 화살표를 이용하세요.","Use left and right arrows to move selection":"선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move left selection":"왼쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use left and right arrows to move right selection":"오른쪽 선택 범위를 움직이려면 좌우 화살표를 이용하세요.","Use TAB select grip buttons or up and down arrows to change selection":"선택 범위를 변경하려면 선택 버튼이나 상하 화살표를 이용하세요.","Use up and down arrows to move selection":"선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move lower selection":"하단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","Use up and down arrows to move upper selection":"상단 선택 범위를 움직이려면 상하 화살표를 이용하세요.","From %1 to %2":"%1 부터 %2 까지","From %1":"%1 부터","To %1":"%1 까지","No parser available for file: %1":"파일 파싱 불가능: %1","Error parsing file: %1":"파일 파싱 오류: %1","Unable to load file: %1":"파일 로드 불가능: %1","Invalid date":"날짜 올바르지 않음"};export{d as default}; diff --git a/dist/assets/label2-d2vWQ7x7.js b/dist/assets/label2-d2vWQ7x7.js new file mode 100644 index 0000000..6c382e7 --- /dev/null +++ b/dist/assets/label2-d2vWQ7x7.js @@ -0,0 +1,5 @@ +import{co as g,z as k,cm as m}from"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const C="calciteInternalLabelClick",f="calciteInternalLabelConnected",E="calciteInternalLabelDisconnected",L="calcite-label",c=new WeakMap,r=new WeakMap,b=new WeakMap,d=new WeakMap,i=new WeakSet,M=e=>{const{id:t}=e,l=t&&k(e,{selector:`${L}[for="${t}"]`});if(l)return l;const s=m(e,L);return!s||w(s,e)?null:s};function w(e,t){let l;const s="custom-element-ancestor-check",o=a=>{a.stopImmediatePropagation();const n=a.composedPath();l=n.slice(n.indexOf(t),n.indexOf(e))};return e.addEventListener(s,o,{once:!0}),t.dispatchEvent(new CustomEvent(s,{composed:!0,bubbles:!0})),e.removeEventListener(s,o),l.filter(a=>a!==t&&a!==e).filter(a=>{var n;return(n=a.tagName)==null?void 0:n.includes("-")}).length>0}function D(e){const t=M(e.el);if(r.has(t)&&t===e.labelEl||!t&&i.has(e))return;const l=x.bind(e);if(t){e.labelEl=t;const s=c.get(t)||[];s.push(e),c.set(t,s.sort(v)),r.has(e.labelEl)||(r.set(e.labelEl,h),e.labelEl.addEventListener(C,h)),i.delete(e),document.removeEventListener(f,b.get(e)),d.set(e,l),document.addEventListener(E,l)}else i.has(e)||(l(),document.removeEventListener(E,d.get(e)))}function W(e){if(i.delete(e),document.removeEventListener(f,b.get(e)),document.removeEventListener(E,d.get(e)),b.delete(e),d.delete(e),!e.labelEl)return;const t=c.get(e.labelEl);t.length===1&&(e.labelEl.removeEventListener(C,r.get(e.labelEl)),r.delete(e.labelEl)),c.set(e.labelEl,t.filter(l=>l!==e).sort(v)),e.labelEl=null}function v(e,t){return g(e.el,t.el)?-1:1}function y(e){var t,l;return e.label||((l=(t=e.labelEl)==null?void 0:t.textContent)==null?void 0:l.trim())||""}function h(e){const t=e.detail.sourceEvent.target,l=c.get(this),s=l.find(a=>a.el===t);if(l.includes(s))return;const u=l[0];u.disabled||u.onLabelClick(e)}function O(){i.has(this)&&D(this)}function x(){i.add(this);const e=b.get(this)||O.bind(this);b.set(this,e),document.addEventListener(f,e)}export{E as a,D as c,W as d,y as g,f as l}; diff --git a/dist/assets/labelPoint-ysDT9nFH.js b/dist/assets/labelPoint-ysDT9nFH.js new file mode 100644 index 0000000..948baba --- /dev/null +++ b/dist/assets/labelPoint-ysDT9nFH.js @@ -0,0 +1 @@ +import{e_ as $,k7 as H,dz as et,eK as st,eI as it,eJ as ht,eH as nt,bI as K,k8 as rt,k9 as ot,ka as at,ae as Z,kb as pt,kc as ut}from"./index-J0iiHjMT.js";class Q{static fromOptimized(t,e,i=!1,h=!1){return new T().initialize(t,e,i,h,1)}static fromJSON(t,e=!1,i=!1){const[h,n]=Y(t);return new G().initialize(h,n,e,i,1)}static fromOptimizedCIM(t,e,i=!1,h=!1){return new L().initialize(t,e,i,h,1)}static fromJSONCIM(t,e=!1,i=!1){const[h,n]=Y(t);return new X().initialize(h,n,e,i,1)}static fromFeatureSetReader(t){const e=t.readGeometryForDisplay(),i=t.geometryType;return e&&i?this.fromOptimized(e,i):null}static fromFeatureSetReaderCIM(t){const e=t.readGeometryForDisplay(),i=t.geometryType;return e&&i?this.fromOptimizedCIM(e,i):null}static createEmptyOptimized(t,e=!1,i=!1){return new T().initialize(new $,t,e,i,1)}static createEmptyJSON(t,e=!1,i=!1){return new G().initialize([],t,e,i,1)}static createEmptyOptimizedCIM(t,e=!1,i=!1){return new L().initialize(new $,t,e,i,1)}static createEmptyJSONCIM(t,e=!1,i=!1){return new X().initialize([],t,e,i,1)}asJSON(){const t=H(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:t[0][0][0],ymin:t[0][0][1],xmax:t[0][2][0],ymax:t[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:t.flat()}:this.geometryType==="esriGeometryPoint"?{x:t[0][0][0],y:t[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:t}:{paths:t}}getCurrentRingArea(){if(!this||this.pathSize<3)return 0;let t,e,i=0;if(this.seekPathStart(),!this.nextPoint())return 0;t=this.x,e=this.y;const h=t,n=e;for(;this.nextPoint();)i+=(t-this.x)*(e+this.y),t=this.x,e=this.y;return i+=(t-h)*(e+n),-.5*i}invertY(){this.yFactor*=-1}}let T=class U extends Q{constructor(){super(...arguments),this._end=-1}initialize(t,e,i,h,n){return this.hasZ=i,this.hasM=h,this.geometryType=e,this._stride=2+Number(i)+Number(h),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=n,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const e=this._pathOffset+t*this._stride;return e>=0&&e=this._pathOffset}nextPath(){if(this._pathIndex>=0){const e=this._geometry.isPoint?1:this._geometry.lengths[this._pathIndex];this._pathOffset+=this._stride*e}this._pointOffset=this._pathOffset-this._stride;const t=this._geometry.isPoint?1:this._geometry.lengths[this._pathIndex+1];return this._end=this._pointOffset+this._stride+this._stride*t,++this._pathIndex=0}pathLength(){const t=this._end,e=this._stride,i=this._geometry.coords;let h=0;for(let n=this._pathOffset+e;nt.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function _t(s){const t=[s.x,s.y];return s.z&&t.push(s.z),s.m&&t.push(s.m),t}function Y(s){return et(s)?[s.rings,"esriGeometryPolygon"]:st(s)?[s.paths,"esriGeometryPolyline"]:it(s)?[[s.points],"esriGeometryMultipoint"]:ht(s)?[[[[s.xmin,s.ymin],[s.xmin,s.ymax],[s.xmax,s.ymax],[s.xmax,s.ymin],[s.xmin,s.ymin]]],"esriGeometryEnvelope"]:nt(s)?[[[_t(s)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let G=class V extends Q{initialize(t,e,i,h,n){return this._paths=t,this.geometryType=e,this.hasZ=i,this.hasM=h,this._pathIndex=this._pointIndex=-1,this.yFactor=n,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex=0}pathLength(){const t=this._currentPath.length,e=this._currentPath;let i=0;for(let h=1;ht.length).reduce((t,e)=>t+e)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const S=4,M=1;let L=class W extends T{initialize(t,e,i,h,n){return super.initialize(t,e,i,h,n),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new W().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},X=class tt extends G{initialize(t,e,i,h,n){return super.initialize(t,e,i,h,n)}clone(){return new tt().initialize(K(this._paths),this.geometryType,this.hasZ,this.hasM,1)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][S]=M}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][S]===M}setControlPointAt(t){this._paths[this.pathIndex][t][S]=M}getControlPointAt(t){return this._paths[this.pathIndex][t][S]===M}};const ct=100*222045e-21;function mt(s){if(s.totalSize===0)return null;const t=rt(s);if(!t)return null;const e=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*ct;let i=0,h=0;s.reset();for(let m=0;s.nextPath();m++){const g=s.getCurrentRingArea();g>h&&(h=g,i=m)}if(s.seekPath(i),s.pathSize===0)return null;s.seekPathStart();const n=ot(s);if(Math.abs(h)<=2*e*e)return[(n[0]+n[2])/2,(n[1]+n[3])/2];s.seekPathStart();const o=at(s,Z());if(o===null)return null;if(s.totalPoints<4)return o;const r=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],a=[NaN,NaN,NaN,NaN],u=[NaN,NaN,NaN,NaN];let _=!1,p=z(o,s,!0);p.distance===0&&(_=!0,r[0][0]=o[0],r[0][1]=o[1],p=z(o,s,!1)),a[0]=p.distance,u[0]=0;const f=[NaN,NaN];let l=!1,y=.25,d=-1,c=NaN;do if(c=NaN,r[1]=F(s,b(n[0],n[2],y),e,t),isNaN(r[1][0])||isNaN(r[1][1])||(p=z(r[1],s,!1),c=p.distance),!isNaN(c)&&c>e&&C(r[1],s))l=!0,a[1]=c,u[1]=N(r[1],o);else if(!isNaN(c)&&c>d&&(d=c,f[0]=r[1][0],f[1]=r[1][1]),y-=.01,y<.1){if(!(d>=0))break;l=!0,a[1]=d,r[1][0]=f[0],r[1][1]=f[1],u[1]=N(r[1],o)}while(!l);l=!1,y=.5,d=-1;let v=.01,E=1;do if(c=NaN,r[2]=F(s,b(n[0],n[2],y),e,t),isNaN(r[2][0])||isNaN(r[2][1])||(p=z(r[2],s,!1),c=p.distance),!isNaN(c)&&c>e&&C(r[2],s))l=!0,a[2]=c,u[2]=N(r[2],o);else if(!isNaN(c)&&c>d)d=c,f[0]=r[2][0],f[1]=r[2][1];else if(c>d&&(d=c,f[0]=r[2][0],f[1]=r[2][1]),y=.5+v*E,v+=.01,E*=-1,y<.3||y>.7){if(!(d>=0))break;l=!0,a[2]=d,r[2][0]=f[0],r[2][1]=f[1],u[2]=N(r[2],o)}while(!l);l=!1,y=.75,d=-1;do if(c=NaN,r[3]=F(s,b(n[0],n[2],y),e,t),isNaN(r[3][0])||isNaN(r[3][1])||(p=z(r[3],s,!1),c=p.distance),!isNaN(c)&&c>e&&C(r[3],s))l=!0,a[3]=c,u[3]=N(r[3],o);else if(c>d&&(d=c,f[0]=r[3][0],f[1]=r[3][1]),y+=.01,y>.9){if(!(d>=0))break;l=!0,a[3]=d,r[3][0]=f[0],r[3][1]=f[1],u[3]=N(r[3],o)}while(!l);const P=[0,1,2,3],O=_?0:1;let A;for(let m=O;m<4;m++)for(let g=O;g<3;g++){const q=u[g],D=u[g+1];ft(q,D)>0&&(A=P[g],P[g]=P[g+1],P[g+1]=A,u[g]=D,u[g+1]=q)}let J=O,R=0,I=0;for(let m=O;m<4;m++){switch(m){case 0:I=2*a[P[m]];break;case 1:I=1.66666666*a[P[m]];break;case 2:I=1.33333333*a[P[m]];break;case 3:I=a[P[m]]}I>R&&(R=I,J=P[m])}return r[J]}function C(s,t){let e,i,h,n,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(e=t.x,i=t.y;t.nextPoint();e=h,i=n)h=t.x,n=t.y,i>s[1]!=n>s[1]&&((h-e)*(s[1]-i)-(n-i)*(s[0]-e)>0?o++:o--);return o!==0}function z(s,t,e){if(e&&C(s,t))return{coord:s,distance:0};let i=1/0,h=0,n=0,o=[0,0],r=[0,0];const a=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=r){r=[t.x,t.y],pt(a,s,o,r);const u=N(s,a);uo?dp)i&j?(i&k?(t[1]+=p*(n-t[0])/_,t[0]=n):(t[1]+=p*(r-t[0])/_,t[0]=r),i=x(t,s)):h&j?(h&k?(e[1]+=p*(n-e[0])/_,e[0]=n):(e[1]+=p*(r-e[0])/_,e[0]=r),h=x(e,s)):i?(i&w?(t[0]+=_*(o-t[1])/p,t[1]=o):(t[0]+=_*(a-t[1])/p,t[1]=a),i=x(t,s)):(h&w?(e[0]+=_*(o-e[1])/p,e[1]=o):(e[0]+=_*(a-e[1])/p,e[1]=a),h=x(e,s));else if(i&B?(i&w?(t[0]+=_*(o-t[1])/p,t[1]=o):(t[0]+=_*(a-t[1])/p,t[1]=a),i=x(t,s)):h&B?(h&w?(e[0]+=_*(o-e[1])/p,e[1]=o):(e[0]+=_*(a-e[1])/p,e[1]=a),h=x(e,s)):i?(i&k?(t[1]+=p*(n-t[0])/_,t[0]=n):(t[1]+=p*(r-t[0])/_,t[0]=r),i=x(t,s)):(h&k?(e[1]+=p*(n-e[0])/_,e[0]=n):(e[1]+=p*(r-e[0])/_,e[0]=r),h=x(e,s)),i&h)return 0}while(i|h);return u}function x(s,t){return(s[0]t[2]?1:0)<<1|(s[1]t[3]?1:0)<<3}function b(s,t,e){return s+(t-s)*e}function N(s,t){return(s[0]-t[0])*(s[0]-t[0])+(s[1]-t[1])*(s[1]-t[1])}function ft(s,t){if(st)return 1;if(s===t)return 0;const e=isNaN(s),i=isNaN(t);return ei?1:0}export{Q as a,mt as l}; diff --git a/dist/assets/layersCreator-aC1PvuFa.js b/dist/assets/layersCreator-aC1PvuFa.js new file mode 100644 index 0000000..c33253a --- /dev/null +++ b/dist/assets/layersCreator-aC1PvuFa.js @@ -0,0 +1 @@ +import{dl as M,dj as L,bR as I,V as A}from"./index-J0iiHjMT.js";import{L as b,e as v}from"./portalLayers-AqjAd9kT.js";import"./requestPresets-18nzHK5y.js";function w(e){return S(e,"notes")}function h(e){return S(e,"markup")}function F(e){return S(e,"route")}function S(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,a){if(!r)return;const t=[];for(const y of r)t.push(x(y,a));const i=await Promise.allSettled(t);for(const y of i)y.status==="rejected"||y.value&&e.add(y.value)}const W={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},O={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},V={ArcGISFeatureLayer:"FeatureLayer"},k={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",DefaultTileLayer:"TileLayer"},T={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},f={ArcGISFeatureLayer:"FeatureLayer"},G={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"},B={...T,LinkChartLayer:"LinkChartLayer"},D={...f},U={...G};async function x(e,r){return E(await R(e,r),e,r)}async function E(e,r,a){const t=new e;return t.read(r,a.context),t.type==="group"&&(r.layerType==="GroupLayer"?await J(t,r,a):p(r)?K(t,r,a.context):g(r)&&await P(t,r,a.context)),await M(t,a.context),t}async function R(e,r){var c,o;const a=r.context,t=N(a);let i=e.layerType||e.type;!i&&(r!=null&&r.defaultLayerType)&&(i=r.defaultLayerType);const y=t[i];let n=y?L[y]:L.UnknownLayer;if(p(e)){const s=a==null?void 0:a.portal;if(e.itemId){const l=new I({id:e.itemId,portal:s});await l.load();const u=(await b(l,new v)).className||"UnknownLayer";n=L[u]}}else i==="ArcGISFeatureLayer"?w(e)||h(e)?n=L.MapNotesLayer:F(e)?n=L.RouteLayer:g(e)&&(n=L.GroupLayer):(c=e.wmtsInfo)!=null&&c.url&&e.wmtsInfo.layerIdentifier?n=L.WMTSLayer:i==="WFS"&&((o=e.wfsInfo)==null?void 0:o.version)!=="2.0.0"&&(n=L.UnsupportedLayer);return n()}function g(e){var r,a;return e.layerType!=="ArcGISFeatureLayer"||p(e)?!1:(((a=(r=e.featureCollection)==null?void 0:r.layers)==null?void 0:a.length)??0)>1}function p(e){return e.type==="Feature Collection"}function N(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=k;break;case"ground":r=O;break;case"tables":r=V;break;default:r=W}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=U;break;case"tables":r=D;break;default:r=B}break;default:switch(e.layerContainerType){case"basemap":r=G;break;case"tables":r=f;break;default:r=T}}return r}async function J(e,r,a){const t=new A,i=C(t,Array.isArray(r.layers)?r.layers:[],a);try{try{if(await i,e.type==="group")return e.layers.addMany(t),e}catch(y){e.destroy();for(const n of t)n.destroy();throw y}}catch(y){throw y}}function K(e,r,a){r.itemId&&(e.portalItem=new I({id:r.itemId,portal:a==null?void 0:a.portal}),e.when(()=>{var i,y;const t=n=>{var s,l;const c=n.layerId;m(n,e,r,c,a);const o=(l=(s=r.featureCollection)==null?void 0:s.layers)==null?void 0:l[c];o&&n.read(o,a)};(i=e.layers)==null||i.forEach(t),(y=e.tables)==null||y.forEach(t)}))}async function P(e,r,a){var o;const t=L.FeatureLayer,i=await t(),y=r.featureCollection,n=y==null?void 0:y.showLegend,c=(o=y==null?void 0:y.layers)==null?void 0:o.map((s,l)=>{const u=new i;u.read(s,a);const d={...a,ignoreDefaults:!0};return m(u,e,r,l,d),n!=null&&u.read({showLegend:n},d),u});e.layers.addMany(c??[])}function m(e,r,a,t,i){var y;e.read({id:`${r.id}-sublayer-${t}`,visibility:((y=a.visibleLayers)==null?void 0:y.includes(t))??!0},i)}export{J as populateGroupLayer,C as populateOperationalLayers}; diff --git a/dist/assets/layersLoader-5063dwjn.js b/dist/assets/layersLoader-5063dwjn.js new file mode 100644 index 0000000..485ba55 --- /dev/null +++ b/dist/assets/layersLoader-5063dwjn.js @@ -0,0 +1 @@ +import{E as h,dl as F,j,dj as D,bS as k,df as x}from"./index-J0iiHjMT.js";import{t as E}from"./fetchService-wPWKuma6.js";import{a as G,n as S,s as P,i as C,l as T,t as g,r as O,e as $}from"./portalLayers-AqjAd9kT.js";import{populateGroupLayer as R}from"./layersCreator-aC1PvuFa.js";import{e as J,l as N}from"./jsonContext-cWV_-jAj.js";import{t as q}from"./requestPresets-18nzHK5y.js";async function ne(t,a){const r=t.instance.portalItem;if(r!=null&&r.id)return await r.load(a),z(t),A(t,a)}function z(t){const a=t.instance.portalItem;if(!(a!=null&&a.type)||!t.supportedTypes.includes(a.type))throw new h("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a==null?void 0:a.type,expectedType:t.supportedTypes.join(", ")})}async function A(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:s,title:n}=e,i=J(e);if(r.type==="group")return B(r,i,t);s&&r.read({url:s},i);const o=new $,l=await L(t,o,a);return l&&r.read(l,i),r.resourceReferences={portalItem:e,paths:i.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:n},i),F(r,i)}async function B(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:s,type:n}=e;if(n==="Group Layer"){if(!j(e,"Map"))throw new h("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return H(t)}return t.read({title:s},a),K(t,r)}async function H(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=N(a);t.read(r,e),await R(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function K(t,a){let r;const{portalItem:e}=t;if(!e)return;const s=e.type,n=a.layerModuleTypeMap;switch(s){case"Feature Service":case"Feature Collection":r=n.FeatureLayer;break;case"Stream Service":r=n.StreamLayer;break;case"Scene Service":r=n.SceneLayer;break;default:throw new h("portal:unsupported-item-type-as-group",`The item type '${s}' is not supported as a 'IGroupLayer'`)}const i=new $;let[o,l]=await Promise.all([r(),L(a,i)]),u=()=>o;if(s==="Feature Service"){l=e.url?await G(l,e.url,i):{};const y=S(l),c=P(l),f=[];if(y.length||c!=null&&c.length){y.length&&f.push("SubtypeGroupLayer"),c!=null&&c.length&&f.push("OrientedImageryLayer");const w=[];for(const p of f){const d=n[p];w.push(d())}const M=await Promise.all(w),b=new Map;f.forEach((p,d)=>{b.set(p,M[d])}),u=p=>p.layerType?b.get(p.layerType)??o:o}const v=await Y(e.url);return await m(t,u,l,v)}return s==="Scene Service"&&e.url&&(l=await C(e,l,i)),T(l)>0?await m(t,u,l):await Q(t,u)}async function Q(t,a){var s,n;const{portalItem:r}=t;if(!(r!=null&&r.url))return;const e=await q(r.url);e&&m(t,a,{layers:(s=e.layers)==null?void 0:s.map(g),tables:(n=e.tables)==null?void 0:n.map(g)})}async function m(t,a,r,e){var i;let s=r.layers||[];const n=r.tables||[];if(((i=t.portalItem)==null?void 0:i.type)==="Feature Collection"?(s.forEach((o,l)=>{var u;o.id=l,((u=o==null?void 0:o.layerDefinition)==null?void 0:u.type)==="Table"&&n.push(o)}),s=s.filter(o=>{var l;return((l=o==null?void 0:o.layerDefinition)==null?void 0:l.type)!=="Table"})):(s.reverse(),n.reverse()),s.forEach(o=>{const l=e==null?void 0:e(o);if(l||!e){const u=I(t,a(o),r,o,l);t.add(u)}}),n.length){const o=await D.FeatureLayer();n.forEach(l=>{const u=e==null?void 0:e(l);if(u||!e){const y=I(t,o,r,l,u);t.tables.add(y)}})}}function I(t,a,r,e,s){const n=t.portalItem,i={portalItem:n.clone(),layerId:e.id};e.url!=null&&(i.url=e.url);const o=new a(i);if("sourceJSON"in o&&(o.sourceJSON=s),o.type!=="subtype-group"&&(o.sublayerTitleMode="service-name"),n.type==="Feature Collection"){const l={origin:"portal-item",portal:n.portal||k.getDefault()};o.read(e,l);const u=r.showLegend;u!=null&&o.read({showLegend:u},l)}return o}async function L(t,a,r){if(t.supportsData===!1)return;const e=t.instance,s=e.portalItem;if(!s)return;let n=null;try{n=await s.fetchData("json",r)}catch{}if(W(e)){let i=null;const o=await U(s,n,a);if((n!=null&&n.layers||n!=null&&n.tables)&&o>0){if(e.layerId==null){const l=S(n);e.layerId=e.type==="subtype-group"?l==null?void 0:l[0]:O(n)}i=V(n,e),i&&n.showLegend!=null&&(i.showLegend=n.showLegend)}return o>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),i}return n}async function U(t,a,r){var n,i,o,l;if(a!=null&&a.layers&&(a!=null&&a.tables))return T(a);const e=x(t.url);if(!e)return 1;const s=await r.fetchServiceMetadata(e.url.path).catch(()=>null);return(((n=a==null?void 0:a.layers)==null?void 0:n.length)??((i=s==null?void 0:s.layers)==null?void 0:i.length)??0)+(((o=a==null?void 0:a.tables)==null?void 0:o.length)??((l=s==null?void 0:s.tables)==null?void 0:l.length)??0)}function V(t,a){var s,n;const{layerId:r}=a,e=((s=t.layers)==null?void 0:s.find(i=>i.id===r))||((n=t.tables)==null?void 0:n.find(i=>i.id===r));return e&&X(e,a)?e:null}function W(t){return t.type!=="stream"&&"layerId"in t}function X(t,a){return!(a.type==="feature"&&"layerType"in t&&t.layerType==="SubtypeGroupLayer"||a.type==="subtype-group"&&!("layerType"in t))}async function Y(t){const{layersJSON:a}=await E(t);if(!a)return null;const r=[...a.layers,...a.tables];return e=>r.find(s=>s.id===e.id)}export{ne as load}; diff --git a/dist/assets/lclayout-osE6VX-O.js b/dist/assets/lclayout-osE6VX-O.js new file mode 100644 index 0000000..c53af24 --- /dev/null +++ b/dist/assets/lclayout-osE6VX-O.js @@ -0,0 +1,3 @@ +import{cg as Tr}from"./index-J0iiHjMT.js";function Cr(R,Y){for(var x=0;xi[M]})}}}return Object.freeze(Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}))}var Zt,N,$t,it={exports:{}};it.exports,Zt=it,it.exports,N=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(N=N||__filename),$t=function(R){var Y,x,i=(R=R||{})!==void 0?R:{};i.ready=new Promise(function(t,n){Y=t,x=n});var M,D,X,vt=Object.assign({},i),ot="./this.program",_t=typeof window=="object",z=typeof importScripts=="function",at=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",F="";function Qt(t){return i.locateFile?i.locateFile(t,F):F+t}if(at){var wt=require("fs"),ut=require("path");F=z?ut.dirname(F)+"/":__dirname+"/",M=(t,n)=>(t=$(t)?new URL(t):ut.normalize(t),wt.readFileSync(t,n?void 0:"utf8")),X=t=>{var n=M(t,!0);return n.buffer||(n=new Uint8Array(n)),n},D=(t,n,r)=>{t=$(t)?new URL(t):ut.normalize(t),wt.readFile(t,function(e,o){e?r(e):n(o.buffer)})},process.argv.length>1&&(ot=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),process.on("uncaughtException",function(t){if(!(t instanceof hn))throw t}),process.on("unhandledRejection",function(t){throw t}),i.inspect=function(){return"[Emscripten Module object]"}}else(_t||z)&&(z?F=self.location.href:typeof document<"u"&&document.currentScript&&(F=document.currentScript.src),N&&(F=N),F=F.indexOf("blob:")!==0?F.substr(0,F.replace(/[?#].*/,"").lastIndexOf("/")+1):"",M=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.send(null),n.responseText},z&&(X=t=>{var n=new XMLHttpRequest;return n.open("GET",t,!1),n.responseType="arraybuffer",n.send(null),new Uint8Array(n.response)}),D=(t,n,r)=>{var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=()=>{e.status==200||e.status==0&&e.response?n(e.response):r()},e.onerror=r,e.send(null)});i.print||console.log.bind(console);var V,ct,B=i.printErr||console.warn.bind(console);Object.assign(i,vt),vt=null,i.arguments&&i.arguments,i.thisProgram&&(ot=i.thisProgram),i.quit&&i.quit,i.wasmBinary&&(V=i.wasmBinary),i.noExitRuntime,typeof WebAssembly!="object"&&Z("no native wasm support detected");var ft,P,_,U,J,h,g,bt,At,Tt,Ct=!1,Et=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function tn(t,n,r){for(var e=n+r,o=n;t[o]&&!(o>=e);)++o;if(o-n>16&&t.buffer&&Et)return Et.decode(t.subarray(n,o));for(var a="";n>10,56320|1023&p)}}else a+=String.fromCharCode((31&c)<<6|f)}else a+=String.fromCharCode(c)}return a}function st(t,n){return t?tn(_,t,n):""}function Ft(t,n,r,e){if(!(e>0))return 0;for(var o=r,a=r+e-1,c=0;c=55296&&f<=57343&&(f=65536+((1023&f)<<10)|1023&t.charCodeAt(++c)),f<=127){if(r>=a)break;n[r++]=f}else if(f<=2047){if(r+1>=a)break;n[r++]=192|f>>6,n[r++]=128|63&f}else if(f<=65535){if(r+2>=a)break;n[r++]=224|f>>12,n[r++]=128|f>>6&63,n[r++]=128|63&f}else{if(r+3>=a)break;n[r++]=240|f>>18,n[r++]=128|f>>12&63,n[r++]=128|f>>6&63,n[r++]=128|63&f}}return n[r]=0,r-o}function nn(t,n,r){return Ft(t,_,n,r)}function Pt(t){for(var n=0,r=0;r=55296&&e<=57343?(n+=4,++r):n+=3}return n}function St(t){ft=t,i.HEAP8=P=new Int8Array(t),i.HEAP16=U=new Int16Array(t),i.HEAP32=h=new Int32Array(t),i.HEAPU8=_=new Uint8Array(t),i.HEAPU16=J=new Uint16Array(t),i.HEAPU32=g=new Uint32Array(t),i.HEAPF32=bt=new Float32Array(t),i.HEAPF64=At=new Float64Array(t)}i.INITIAL_MEMORY;var Wt=[],Mt=[],jt=[];function rn(){if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)an(i.preRun.shift());lt(Wt)}function en(){lt(Mt)}function on(){if(i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;)cn(i.postRun.shift());lt(jt)}function an(t){Wt.unshift(t)}function un(t){Mt.unshift(t)}function cn(t){jt.unshift(t)}var k=0,q=null;function fn(t){k++,i.monitorRunDependencies&&i.monitorRunDependencies(k)}function sn(t){if(k--,i.monitorRunDependencies&&i.monitorRunDependencies(k),k==0&&q){var n=q;q=null,n()}}function Z(t){i.onAbort&&i.onAbort(t),B(t="Aborted("+t+")"),Ct=!0,t+=". Build with -sASSERTIONS for more info.";var n=new WebAssembly.RuntimeError(t);throw x(n),n}var w,ln="data:application/octet-stream;base64,";function Ot(t){return t.startsWith(ln)}function $(t){return t.startsWith("file://")}function Rt(t){try{if(t==w&&V)return new Uint8Array(V);if(X)return X(t);throw"both async and sync fetching of the wasm failed"}catch(n){Z(n)}}function pn(){if(!V&&(_t||z)){if(typeof fetch=="function"&&!$(w))return fetch(w,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load wasm binary file at '"+w+"'";return t.arrayBuffer()}).catch(function(){return Rt(w)});if(D)return new Promise(function(t,n){D(w,function(r){t(new Uint8Array(r))},n)})}return Promise.resolve().then(function(){return Rt(w)})}function dn(){var t={a:br};function n(a,c){var f=a.exports;i.asm=f,St((ct=i.asm.w).buffer),Tt=i.asm.y,un(i.asm.x),sn()}function r(a){n(a.instance)}function e(a){return pn().then(function(c){return WebAssembly.instantiate(c,t)}).then(function(c){return c}).then(a,function(c){B("failed to asynchronously prepare wasm: "+c),Z(c)})}function o(){return V||typeof WebAssembly.instantiateStreaming!="function"||Ot(w)||$(w)||at||typeof fetch!="function"?e(r):fetch(w,{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,t).then(r,function(c){return B("wasm streaming compile failed: "+c),B("falling back to ArrayBuffer instantiation"),e(r)})})}if(fn(),i.instantiateWasm)try{return i.instantiateWasm(t,n)}catch(a){B("Module.instantiateWasm callback failed with error: "+a),x(a)}return o().catch(x),{}}function hn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function lt(t){for(;t.length>0;)t.shift()(i)}function mn(t){this.excPtr=t,this.ptr=t-24,this.set_type=function(n){g[this.ptr+4>>2]=n},this.get_type=function(){return g[this.ptr+4>>2]},this.set_destructor=function(n){g[this.ptr+8>>2]=n},this.get_destructor=function(){return g[this.ptr+8>>2]},this.set_refcount=function(n){h[this.ptr>>2]=n},this.set_caught=function(n){n=n?1:0,P[this.ptr+12>>0]=n},this.get_caught=function(){return P[this.ptr+12>>0]!=0},this.set_rethrown=function(n){n=n?1:0,P[this.ptr+13>>0]=n},this.get_rethrown=function(){return P[this.ptr+13>>0]!=0},this.init=function(n,r){this.set_adjusted_ptr(0),this.set_type(n),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var n=h[this.ptr>>2];h[this.ptr>>2]=n+1},this.release_ref=function(){var n=h[this.ptr>>2];return h[this.ptr>>2]=n-1,n===1},this.set_adjusted_ptr=function(n){g[this.ptr+16>>2]=n},this.get_adjusted_ptr=function(){return g[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Xt(this.get_type()))return g[this.excPtr>>2];var n=this.get_adjusted_ptr();return n!==0?n:this.excPtr}}function yn(t,n,r){throw new mn(t).init(n,r),t}function gn(t,n,r,e,o){}function pt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}function vn(){for(var t=new Array(256),n=0;n<256;++n)t[n]=String.fromCharCode(n);xt=t}Ot(w="lclayout.wasm")||(w=Qt(w));var xt=void 0;function b(t){for(var n="",r=t;_[r];)n+=xt[_[r++]];return n}var I={},H={},K={},_n=48,wn=57;function bn(t){if(t===void 0)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return n>=_n&&n<=wn?"_"+t:t}function An(t,n){return t=bn(t),function(){return n.apply(this,arguments)}}function dt(t,n){var r=An(n,function(e){this.name=n,this.message=e;var o=new Error(e).stack;o!==void 0&&(this.stack=this.toString()+` +`+o.replace(/^Error(:[^\n]*)?\n/,""))});return r.prototype=Object.create(t.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},r}var Dt=void 0;function A(t){throw new Dt(t)}var kt=void 0;function Ut(t){throw new kt(t)}function It(t,n,r){function e(f){var s=r(f);s.length!==t.length&&Ut("Mismatched type converter count");for(var p=0;p{H.hasOwnProperty(f)?o[s]=H[f]:(a.push(f),I.hasOwnProperty(f)||(I[f]=[]),I[f].push(()=>{o[s]=H[f],++c===a.length&&e(o)}))}),a.length===0&&e(o)}function j(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||A('type "'+e+'" must have a positive integer typeid pointer'),H.hasOwnProperty(t)){if(r.ignoreDuplicateRegistrations)return;A("Cannot register type '"+e+"' twice")}if(H[t]=n,delete K[t],I.hasOwnProperty(t)){var o=I[t];delete I[t],o.forEach(a=>a())}}function Tn(t,n,r,e,o){var a=pt(r);j(t,{name:n=b(n),fromWireType:function(c){return!!c},toWireType:function(c,f){return f?e:o},argPackAdvance:8,readValueFromPointer:function(c){var f;if(r===1)f=P;else if(r===2)f=U;else{if(r!==4)throw new TypeError("Unknown boolean type size: "+n);f=h}return this.fromWireType(f[c>>a])},destructorFunction:null})}function Cn(t,n,r){t=b(t),It([],[n],function(e){return e=e[0],i[t]=e.fromWireType(r),[]})}var ht=[],S=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function En(t){t>4&&--S[t].refcount==0&&(S[t]=void 0,ht.push(t))}function Fn(){for(var t=0,n=5;n(t||A("Cannot use deleted val. handle = "+t),S[t].value),toHandle:t=>{switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=ht.length?ht.pop():S.length;return S[n]={refcount:1,value:t},n}}};function mt(t){return this.fromWireType(h[t>>2])}function Wn(t,n){j(t,{name:n=b(n),fromWireType:function(r){var e=Ht.toValue(r);return En(r),e},toWireType:function(r,e){return Ht.toHandle(e)},argPackAdvance:8,readValueFromPointer:mt,destructorFunction:null})}function Mn(t,n){switch(n){case 2:return function(r){return this.fromWireType(bt[r>>2])};case 3:return function(r){return this.fromWireType(At[r>>3])};default:throw new TypeError("Unknown float type: "+t)}}function jn(t,n,r){var e=pt(r);j(t,{name:n=b(n),fromWireType:function(o){return o},toWireType:function(o,a){return a},argPackAdvance:8,readValueFromPointer:Mn(n,e),destructorFunction:null})}function On(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function Rn(t,n,r,e,o){var a=n.length;a<2&&A("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var c=n[1]!==null&&r!==null,f=!1,s=1;s>2]);return r}function Un(t,n,r){i.hasOwnProperty(t)||Ut("Replacing nonexistant public symbol"),i[t].overloadTable!==void 0&&r!==void 0?i[t].overloadTable[r]=n:(i[t]=n,i[t].argCount=r)}function In(t,n,r){var e=i["dynCall_"+t];return r&&r.length?e.apply(null,[n].concat(r)):e.call(null,n)}var Q=[];function Yt(t){var n=Q[t];return n||(t>=Q.length&&(Q.length=t+1),Q[t]=n=Tt.get(t)),n}function Hn(t,n,r){return t.includes("j")?In(t,n,r):Yt(n).apply(null,r)}function Yn(t,n){var r=[];return function(){return r.length=0,Object.assign(r,arguments),Hn(t,n,r)}}function zn(t,n){function r(){return t.includes("j")?Yn(t,n):Yt(n)}t=b(t);var e=r();return typeof e!="function"&&A("unknown function pointer with signature "+t+": "+n),e}var zt=void 0;function Vn(t){var n=Nt(t),r=b(n);return O(n),r}function Bn(t,n){var r=[],e={};function o(a){e[a]||H[a]||(K[a]?K[a].forEach(o):(r.push(a),e[a]=!0))}throw n.forEach(o),new zt(t+": "+r.map(Vn).join([", "]))}function qn(t,n,r,e,o,a){var c=kn(n,r);t=b(t),o=zn(e,o),Dn(t,function(){Bn("Cannot call "+t+" due to unbound types",c)},n-1),It([],c,function(f){var s=[f[0],null].concat(f.slice(1));return Un(t,Rn(t,s,null,o,a),n-1),[]})}function Ln(t,n,r){switch(n){case 0:return r?function(e){return P[e]}:function(e){return _[e]};case 1:return r?function(e){return U[e>>1]}:function(e){return J[e>>1]};case 2:return r?function(e){return h[e>>2]}:function(e){return g[e>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function Gn(t,n,r,e,o){n=b(n);var a=pt(r),c=d=>d;if(e===0){var f=32-8*r;c=d=>d<>>f}var s=n.includes("unsigned"),p=(d,m)=>{};j(t,{name:n,fromWireType:c,toWireType:s?function(d,m){return p(m,this.name),m>>>0}:function(d,m){return p(m,this.name),m},argPackAdvance:8,readValueFromPointer:Ln(n,a,e!==0),destructorFunction:null})}function Nn(t,n,r){var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];function o(a){var c=g,f=c[a>>=2],s=c[a+1];return new e(ft,s,f)}j(t,{name:r=b(r),fromWireType:o,argPackAdvance:8,readValueFromPointer:o},{ignoreDuplicateRegistrations:!0})}function Xn(t,n){var r=(n=b(n))==="std::string";j(t,{name:n,fromWireType:function(e){var o,a=g[e>>2],c=e+4;if(r)for(var f=c,s=0;s<=a;++s){var p=c+s;if(s==a||_[p]==0){var d=st(f,p-f);o===void 0?o=d:(o+="\0",o+=d),f=p+1}}else{var m=new Array(a);for(s=0;s>2]=a,r&&c)nn(o,s,a+1);else if(c)for(var p=0;p255&&(O(s),A("String has UTF-16 code units that do not fit in 8 bits")),_[s+p]=d}else for(p=0;p>1,o=e+n/2;!(e>=o)&&J[e];)++e;if((r=e<<1)-t>32&&Vt)return Vt.decode(_.subarray(t,r));for(var a="",c=0;!(c>=n/2);++c){var f=U[t+2*c>>1];if(f==0)break;a+=String.fromCharCode(f)}return a}function Zn(t,n,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var e=n,o=(r-=2)<2*t.length?r/2:t.length,a=0;a>1]=c,n+=2}return U[n>>1]=0,n-e}function $n(t){return 2*t.length}function Kn(t,n){for(var r=0,e="";!(r>=n/4);){var o=h[t+4*r>>2];if(o==0)break;if(++r,o>=65536){var a=o-65536;e+=String.fromCharCode(55296|a>>10,56320|1023&a)}else e+=String.fromCharCode(o)}return e}function Qn(t,n,r){if(r===void 0&&(r=2147483647),r<4)return 0;for(var e=n,o=e+r-4,a=0;a=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&t.charCodeAt(++a)),h[n>>2]=c,(n+=4)+4>o)break}return h[n>>2]=0,n-e}function tr(t){for(var n=0,r=0;r=55296&&e<=57343&&++r,n+=4}return n}function nr(t,n,r){var e,o,a,c,f;r=b(r),n===2?(e=Jn,o=Zn,c=$n,a=()=>J,f=1):n===4&&(e=Kn,o=Qn,c=tr,a=()=>g,f=2),j(t,{name:r,fromWireType:function(s){for(var p,d=g[s>>2],m=a(),y=s+4,T=0;T<=d;++T){var W=s+4+T*n;if(T==d||m[W>>f]==0){var C=e(y,W-y);p===void 0?p=C:(p+="\0",p+=C),y=W+n}}return O(s),p},toWireType:function(s,p){typeof p!="string"&&A("Cannot pass non-string to C++ string type "+r);var d=c(p),m=gt(4+d+n);return g[m>>2]=d>>f,o(p,m+4,d+n),s!==null&&s.push(O,m),m},argPackAdvance:8,readValueFromPointer:mt,destructorFunction:function(s){O(s)}})}function rr(t,n){j(t,{isVoid:!0,name:n=b(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(r,e){}})}var Bt,er=!0;function ir(){return er}function or(){Z("")}function ar(){return Date.now()}function qt(){return 2147483648}function ur(){return qt()}function cr(t,n,r){_.copyWithin(t,n,n+r)}function fr(t){try{return ct.grow(t-ft.byteLength+65535>>>16),St(ct.buffer),1}catch{}}function sr(t){var n=_.length;t>>>=0;var r=qt();if(t>r)return!1;let e=(c,f)=>c+(f-c%f)%f;for(var o=1;o<=4;o*=2){var a=n*(1+.2/o);if(a=Math.min(a,t+100663296),fr(Math.min(r,e(Math.max(t,a),65536))))return!0}return!1}Bt=at?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now();var yt={};function lr(){return ot||"./this.program"}function L(){if(!L.strings){var t={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:lr()};for(var n in yt)yt[n]===void 0?delete t[n]:t[n]=yt[n];var r=[];for(var n in t)r.push(n+"="+t[n]);L.strings=r}return L.strings}function pr(t,n,r){for(var e=0;e>0]=t.charCodeAt(e);r||(P[n>>0]=0)}function dr(t,n){var r=0;return L().forEach(function(e,o){var a=n+r;g[t+4*o>>2]=a,pr(e,a),r+=e.length+1}),0}function hr(t,n){var r=L();g[t>>2]=r.length;var e=0;return r.forEach(function(o){e+=o.length+1}),g[n>>2]=e,0}function tt(t){return t%4==0&&(t%100!=0||t%400==0)}function mr(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Lt=[31,29,31,30,31,30,31,31,30,31,30,31],Gt=[31,28,31,30,31,30,31,31,30,31,30,31];function yr(t,n){for(var r=new Date(t.getTime());n>0;){var e=tt(r.getFullYear()),o=r.getMonth(),a=(e?Lt:Gt)[o];if(!(n>a-r.getDate()))return r.setDate(r.getDate()+n),r;n-=a-r.getDate()+1,r.setDate(1),o<11?r.setMonth(o+1):(r.setMonth(0),r.setFullYear(r.getFullYear()+1))}return r}function gr(t,n,r){var e=r>0?r:Pt(t)+1,o=new Array(e),a=Ft(t,o,0,o.length);return n&&(o.length=a),o}function vr(t,n){P.set(t,n)}function _r(t,n,r,e){var o=h[e+40>>2],a={tm_sec:h[e>>2],tm_min:h[e+4>>2],tm_hour:h[e+8>>2],tm_mday:h[e+12>>2],tm_mon:h[e+16>>2],tm_year:h[e+20>>2],tm_wday:h[e+24>>2],tm_yday:h[e+28>>2],tm_isdst:h[e+32>>2],tm_gmtoff:h[e+36>>2],tm_zone:o?st(o):""},c=st(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var s in f)c=c.replace(new RegExp(s,"g"),f[s]);var p=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d=["January","February","March","April","May","June","July","August","September","October","November","December"];function m(u,l,E){for(var v=typeof u=="number"?u.toString():u||"";v.length0?1:0}var v;return(v=E(u.getFullYear()-l.getFullYear()))===0&&(v=E(u.getMonth()-l.getMonth()))===0&&(v=E(u.getDate()-l.getDate())),v}function W(u){switch(u.getDay()){case 0:return new Date(u.getFullYear()-1,11,29);case 1:return u;case 2:return new Date(u.getFullYear(),0,3);case 3:return new Date(u.getFullYear(),0,2);case 4:return new Date(u.getFullYear(),0,1);case 5:return new Date(u.getFullYear()-1,11,31);case 6:return new Date(u.getFullYear()-1,11,30)}}function C(u){var l=yr(new Date(u.tm_year+1900,0,1),u.tm_yday),E=new Date(l.getFullYear(),0,4),v=new Date(l.getFullYear()+1,0,4),et=W(E),Ar=W(v);return T(et,l)<=0?T(Ar,l)<=0?l.getFullYear()+1:l.getFullYear():l.getFullYear()-1}var rt={"%a":function(u){return p[u.tm_wday].substring(0,3)},"%A":function(u){return p[u.tm_wday]},"%b":function(u){return d[u.tm_mon].substring(0,3)},"%B":function(u){return d[u.tm_mon]},"%C":function(u){return y((u.tm_year+1900)/100|0,2)},"%d":function(u){return y(u.tm_mday,2)},"%e":function(u){return m(u.tm_mday,2," ")},"%g":function(u){return C(u).toString().substring(2)},"%G":function(u){return C(u)},"%H":function(u){return y(u.tm_hour,2)},"%I":function(u){var l=u.tm_hour;return l==0?l=12:l>12&&(l-=12),y(l,2)},"%j":function(u){return y(u.tm_mday+mr(tt(u.tm_year+1900)?Lt:Gt,u.tm_mon-1),3)},"%m":function(u){return y(u.tm_mon+1,2)},"%M":function(u){return y(u.tm_min,2)},"%n":function(){return` +`},"%p":function(u){return u.tm_hour>=0&&u.tm_hour<12?"AM":"PM"},"%S":function(u){return y(u.tm_sec,2)},"%t":function(){return" "},"%u":function(u){return u.tm_wday||7},"%U":function(u){var l=u.tm_yday+7-u.tm_wday;return y(Math.floor(l/7),2)},"%V":function(u){var l=Math.floor((u.tm_yday+7-(u.tm_wday+6)%7)/7);if((u.tm_wday+371-u.tm_yday-2)%7<=2&&l++,l){if(l==53){var E=(u.tm_wday+371-u.tm_yday)%7;E==4||E==3&&tt(u.tm_year)||(l=1)}}else{l=52;var v=(u.tm_wday+7-u.tm_yday-1)%7;(v==4||v==5&&tt(u.tm_year%400-1))&&l++}return y(l,2)},"%w":function(u){return u.tm_wday},"%W":function(u){var l=u.tm_yday+7-(u.tm_wday+6)%7;return y(Math.floor(l/7),2)},"%y":function(u){return(u.tm_year+1900).toString().substring(2)},"%Y":function(u){return u.tm_year+1900},"%z":function(u){var l=u.tm_gmtoff,E=l>=0;return l=(l=Math.abs(l)/60)/60*100+l%60,(E?"+":"-")+("0000"+l).slice(-4)},"%Z":function(u){return u.tm_zone},"%%":function(){return"%"}};for(var s in c=c.replace(/%%/g,"\0\0"),rt)c.includes(s)&&(c=c.replace(new RegExp(s,"g"),rt[s](a)));var G=gr(c=c.replace(/\0\0/g,"%"),!1);return G.length>n?0:(vr(G,t),G.length-1)}function wr(t,n,r,e,o){return _r(t,n,r,e)}vn(),Dt=i.BindingError=dt(Error,"BindingError"),kt=i.InternalError=dt(Error,"InternalError"),Sn(),zt=i.UnboundTypeError=dt(Error,"UnboundTypeError");var br={a:yn,m:gn,k:Tn,i:Cn,j:Wn,h:jn,c:qn,d:Gn,b:Nn,g:Xn,e:nr,l:rr,r:ir,f:or,s:ar,n:ur,u:Bt,v:cr,t:sr,p:dr,q:hr,o:wr};dn(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.x).apply(null,arguments)};var Nt=i.___getTypeName=function(){return(Nt=i.___getTypeName=i.asm.z).apply(null,arguments)};i.__embind_initialize_bindings=function(){return(i.__embind_initialize_bindings=i.asm.A).apply(null,arguments)};var nt,gt=i._malloc=function(){return(gt=i._malloc=i.asm.B).apply(null,arguments)},O=i._free=function(){return(O=i._free=i.asm.C).apply(null,arguments)},Xt=i.___cxa_is_pointer_type=function(){return(Xt=i.___cxa_is_pointer_type=i.asm.D).apply(null,arguments)};function Jt(t){function n(){nt||(nt=!0,i.calledRun=!0,Ct||(en(),Y(i),i.onRuntimeInitialized&&i.onRuntimeInitialized(),on()))}k>0||(rn(),k>0||(i.setStatus?(i.setStatus("Running..."),setTimeout(function(){setTimeout(function(){i.setStatus("")},1),n()},1)):n()))}if(i.dynCall_viijii=function(){return(i.dynCall_viijii=i.asm.E).apply(null,arguments)},i.dynCall_iiiiij=function(){return(i.dynCall_iiiiij=i.asm.F).apply(null,arguments)},i.dynCall_iiiiijj=function(){return(i.dynCall_iiiiijj=i.asm.G).apply(null,arguments)},i.dynCall_iiiiiijj=function(){return(i.dynCall_iiiiiijj=i.asm.H).apply(null,arguments)},q=function t(){nt||Jt(),nt||(q=t)},i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Jt(),R.ready},Zt.exports=$t;var Kt=it.exports;const Fr=Cr({__proto__:null,default:Tr(Kt)},[Kt]);export{Fr as l}; diff --git a/dist/assets/lerc-wasm-v7WMG2so.js b/dist/assets/lerc-wasm-v7WMG2so.js new file mode 100644 index 0000000..2c74c0a --- /dev/null +++ b/dist/assets/lerc-wasm-v7WMG2so.js @@ -0,0 +1 @@ +import{cg as Tn}from"./index-J0iiHjMT.js";function Dn(e,g){for(var m=0;mp[f]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var tn,S,rn,T={exports:{}};T.exports,tn=T,T.exports,S=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(S=S||__filename),rn=function(e){var g,m;(e=(e=e||{})!==void 0?e:{}).ready=new Promise(function(n,t){g=n,m=t});var p,f,h,D,P,H,q=Object.assign({},e),C=typeof window=="object",v=typeof importScripts=="function",F=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",c="";function sn(n){return e.locateFile?e.locateFile(n,c):c+n}F?(c=v?require("path").dirname(c)+"/":__dirname+"/",H=()=>{P||(D=require("fs"),P=require("path"))},p=function(n,t){return H(),n=P.normalize(n),D.readFileSync(n,t?void 0:"utf8")},h=n=>{var t=p(n,!0);return t.buffer||(t=new Uint8Array(t)),t},f=(n,t,r)=>{H(),n=P.normalize(n),D.readFile(n,function(o,u){o?r(o):t(u.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(n){if(!(n instanceof jn))throw n}),process.on("unhandledRejection",function(n){throw n}),e.inspect=function(){return"[Emscripten Module object]"}):(C||v)&&(v?c=self.location.href:typeof document<"u"&&document.currentScript&&(c=document.currentScript.src),S&&(c=S),c=c.indexOf("blob:")!==0?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"",p=n=>{var t=new XMLHttpRequest;return t.open("GET",n,!1),t.send(null),t.responseText},v&&(h=n=>{var t=new XMLHttpRequest;return t.open("GET",n,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),f=(n,t,r)=>{var o=new XMLHttpRequest;o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=()=>{o.status==200||o.status==0&&o.response?t(o.response):r()},o.onerror=r,o.send(null)}),e.print||console.log.bind(console);var w,M,b=e.printErr||console.warn.bind(console);Object.assign(e,q),q=null,e.arguments&&e.arguments,e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(w=e.wasmBinary),e.noExitRuntime,typeof WebAssembly!="object"&&x("no native wasm support detected");var B,A,E,y,d,k,z=!1,L=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function un(n,t,r){for(var o=t+r,u=t;n[u]&&!(u>=o);)++u;if(u-t>16&&n.buffer&&L)return L.decode(n.subarray(t,u));for(var s="";t>10,56320|1023&en)}}else s+=String.fromCharCode((31&i)<<6|l)}else s+=String.fromCharCode(i)}return s}function O(n,t){return n?un(E,n,t):""}function G(n){B=n,e.HEAP8=A=new Int8Array(n),e.HEAP16=new Int16Array(n),e.HEAP32=y=new Int32Array(n),e.HEAPU8=E=new Uint8Array(n),e.HEAPU16=new Uint16Array(n),e.HEAPU32=d=new Uint32Array(n),e.HEAPF32=new Float32Array(n),e.HEAPF64=new Float64Array(n)}e.INITIAL_MEMORY;var X=[],N=[],Y=[];function an(){if(e.preRun)for(typeof e.preRun=="function"&&(e.preRun=[e.preRun]);e.preRun.length;)pn(e.preRun.shift());W(X)}function cn(){W(N)}function fn(){if(e.postRun)for(typeof e.postRun=="function"&&(e.postRun=[e.postRun]);e.postRun.length;)hn(e.postRun.shift());W(Y)}function pn(n){X.unshift(n)}function ln(n){N.unshift(n)}function hn(n){Y.unshift(n)}var _=0,R=null;function dn(n){_++,e.monitorRunDependencies&&e.monitorRunDependencies(_)}function mn(n){if(_--,e.monitorRunDependencies&&e.monitorRunDependencies(_),_==0&&R){var t=R;R=null,t()}}function x(n){e.onAbort&&e.onAbort(n),b(n="Aborted("+n+")"),z=!0,n+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(n);throw m(t),t}var a,_n="data:application/octet-stream;base64,";function $(n){return n.startsWith(_n)}function J(n){return n.startsWith("file://")}function K(n){try{if(n==a&&w)return new Uint8Array(w);if(h)return h(n);throw"both async and sync fetching of the wasm failed"}catch(t){x(t)}}function yn(){if(!w&&(C||v)){if(typeof fetch=="function"&&!J(a))return fetch(a,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+a+"'";return n.arrayBuffer()}).catch(function(){return K(a)});if(f)return new Promise(function(n,t){f(a,function(r){n(new Uint8Array(r))},t)})}return Promise.resolve().then(function(){return K(a)})}function gn(){var n={a:In};function t(s,i){var l=s.exports;e.asm=l,G((M=e.asm.g).buffer),k=e.asm.m,ln(e.asm.h),mn()}function r(s){t(s.instance)}function o(s){return yn().then(function(i){return WebAssembly.instantiate(i,n)}).then(function(i){return i}).then(s,function(i){b("failed to asynchronously prepare wasm: "+i),x(i)})}function u(){return w||typeof WebAssembly.instantiateStreaming!="function"||$(a)||J(a)||F||typeof fetch!="function"?o(r):fetch(a,{credentials:"same-origin"}).then(function(s){return WebAssembly.instantiateStreaming(s,n).then(r,function(i){return b("wasm streaming compile failed: "+i),b("falling back to ArrayBuffer instantiation"),o(r)})})}if(dn(),e.instantiateWasm)try{return e.instantiateWasm(n,t)}catch(s){return b("Module.instantiateWasm callback failed with error: "+s),!1}return u().catch(m),{}}function W(n){for(;n.length>0;){var t=n.shift();if(typeof t!="function"){var r=t.func;typeof r=="number"?t.arg===void 0?Q(r)():Q(r)(t.arg):r(t.arg===void 0?null:t.arg)}else t(e)}}$(a="lerc-wasm.wasm")||(a=sn(a));var I=[];function Q(n){var t=I[n];return t||(n>=I.length&&(I.length=n+1),I[n]=t=k.get(n)),t}function vn(n,t,r,o){x("Assertion failed: "+O(n)+", at: "+[t?O(t):"unknown filename",r,o?O(o):"unknown function"])}function wn(n){return V(n+24)+24}function bn(n){this.excPtr=n,this.ptr=n-24,this.set_type=function(t){d[this.ptr+4>>2]=t},this.get_type=function(){return d[this.ptr+4>>2]},this.set_destructor=function(t){d[this.ptr+8>>2]=t},this.get_destructor=function(){return d[this.ptr+8>>2]},this.set_refcount=function(t){y[this.ptr>>2]=t},this.set_caught=function(t){t=t?1:0,A[this.ptr+12>>0]=t},this.get_caught=function(){return A[this.ptr+12>>0]!=0},this.set_rethrown=function(t){t=t?1:0,A[this.ptr+13>>0]=t},this.get_rethrown=function(){return A[this.ptr+13>>0]!=0},this.init=function(t,r){this.set_adjusted_ptr(0),this.set_type(t),this.set_destructor(r),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var t=y[this.ptr>>2];y[this.ptr>>2]=t+1},this.release_ref=function(){var t=y[this.ptr>>2];return y[this.ptr>>2]=t-1,t===1},this.set_adjusted_ptr=function(t){d[this.ptr+16>>2]=t},this.get_adjusted_ptr=function(){return d[this.ptr+16>>2]},this.get_exception_ptr=function(){if(Z(this.get_type()))return d[this.excPtr>>2];var t=this.get_adjusted_ptr();return t!==0?t:this.excPtr}}function An(n,t,r){throw new bn(n).init(t,r),n}function Rn(){x("")}function xn(n,t,r){E.copyWithin(n,t,t+r)}function Sn(){return 2147483648}function Pn(n){try{return M.grow(n-B.byteLength+65535>>>16),G(M.buffer),1}catch{}}function En(n){var t=E.length;n>>>=0;var r=Sn();if(n>r)return!1;let o=(i,l)=>i+(l-i%l)%l;for(var u=1;u<=4;u*=2){var s=t*(1+.2/u);if(s=Math.min(s,n+100663296),Pn(Math.min(r,o(Math.max(n,s),65536))))return!0}return!1}var In={a:vn,c:wn,b:An,d:Rn,f:xn,e:En};gn(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.h).apply(null,arguments)},e._lerc_getBlobInfo=function(){return(e._lerc_getBlobInfo=e.asm.i).apply(null,arguments)},e._lerc_getDataRanges=function(){return(e._lerc_getDataRanges=e.asm.j).apply(null,arguments)},e._lerc_decode=function(){return(e._lerc_decode=e.asm.k).apply(null,arguments)},e._lerc_decode_4D=function(){return(e._lerc_decode_4D=e.asm.l).apply(null,arguments)};var V=e._malloc=function(){return(V=e._malloc=e.asm.n).apply(null,arguments)};e._free=function(){return(e._free=e.asm.o).apply(null,arguments)};var j,Z=e.___cxa_is_pointer_type=function(){return(Z=e.___cxa_is_pointer_type=e.asm.p).apply(null,arguments)};function jn(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function U(n){function t(){j||(j=!0,e.calledRun=!0,z||(cn(),g(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),fn()))}_>0||(an(),_>0||(e.setStatus?(e.setStatus("Running..."),setTimeout(function(){setTimeout(function(){e.setStatus("")},1),t()},1)):t()))}if(R=function n(){j||U(),j||(R=n)},e.run=U,e.preInit)for(typeof e.preInit=="function"&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return U(),e.ready},tn.exports=rn;var on=T.exports;const Mn=Dn({__proto__:null,default:Tn(on)},[on]);export{Mn as l}; diff --git a/dist/assets/libtess-R_Me7Q5k.js b/dist/assets/libtess-R_Me7Q5k.js new file mode 100644 index 0000000..dec8218 --- /dev/null +++ b/dist/assets/libtess-R_Me7Q5k.js @@ -0,0 +1 @@ +import{cg as Zn}from"./index-J0iiHjMT.js";function nt(S,O){for(var T=0;Tf[t]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var $,pn,J={exports:{}};J.exports,$=J,(pn=function(){function S(O){const T=O.locateFile,f={};var t=t!==void 0?t:{};const _=(()=>{let n;return{resolve:e=>n(e),promise:new Promise(e=>n=e)}})(),hn=()=>_.promise;t.locateFile=T,t.onRuntimeInitialized=()=>{_.resolve(f)},f.Module=t,f.whenLoaded=hn;var h,j={};for(h in t)t.hasOwnProperty(h)&&(j[h]=t[h]);var D,W,U,E,R,K=typeof window=="object",x=typeof importScripts=="function",gn=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p="";function dn(n){return t.locateFile?t.locateFile(n,p):p+n}gn?(p=x?require("path").dirname(p)+"/":__dirname+"/",D=function(n,e){return E||(E=require("fs")),R||(R=require("path")),n=R.normalize(n),E.readFileSync(n,e?null:"utf8")},U=function(n){var e=D(n,!0);return e.buffer||(e=new Uint8Array(e)),bn(e.buffer),e},W=function(n,e,r){E||(E=require("fs")),R||(R=require("path")),n=R.normalize(n),E.readFile(n,function(o,i){o?r(o):e(i.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),$.exports=t,process.on("uncaughtException",function(n){if(!(n instanceof $n))throw n}),process.on("unhandledRejection",q),t.inspect=function(){return"[Emscripten Module object]"}):(K||x)&&(x?p=self.location.href:typeof document<"u"&&document.currentScript&&(p=document.currentScript.src),p=p.indexOf("blob:")!==0?p.substr(0,p.lastIndexOf("/")+1):"",D=function(n){var e=new XMLHttpRequest;return e.open("GET",n,!1),e.send(null),e.responseText},x&&(U=function(n){var e=new XMLHttpRequest;return e.open("GET",n,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),W=function(n,e,r){var o=new XMLHttpRequest;o.open("GET",n,!0),o.responseType="arraybuffer",o.onload=function(){o.status==200||o.status==0&&o.response?e(o.response):r()},o.onerror=r,o.send(null)});var yn=t.print||console.log.bind(console),P=t.printErr||console.warn.bind(console);for(h in j)j.hasOwnProperty(h)&&(t[h]=j[h]);j=null,t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.quit&&t.quit;var I,z,Q=0,vn=function(n){Q=n},wn=function(){return Q};t.wasmBinary&&(I=t.wasmBinary),t.noExitRuntime,typeof WebAssembly!="object"&&q("no native wasm support detected");var V=!1;function bn(n,e){n||q("Assertion failed: "+e)}var Z,H,M,m,nn=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function tn(n,e,r){for(var o=e+r,i=e;n[i]&&!(i>=o);)++i;if(i-e>16&&n.subarray&&nn)return nn.decode(n.subarray(e,i));for(var u="";e>10,56320|1023&C)}}else u+=String.fromCharCode((31&a)<<6|l)}else u+=String.fromCharCode(a)}return u}function An(n,e){return n?tn(H,n,e):""}function _n(n,e){return n%e>0&&(n+=e-n%e),n}function en(n){Z=n,t.HEAP8=new Int8Array(n),t.HEAP16=new Int16Array(n),t.HEAP32=M=new Int32Array(n),t.HEAPU8=H=new Uint8Array(n),t.HEAPU16=new Uint16Array(n),t.HEAPU32=new Uint32Array(n),t.HEAPF32=new Float32Array(n),t.HEAPF64=new Float64Array(n)}t.INITIAL_MEMORY;var rn=[],on=[],un=[];function En(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)Sn(t.preRun.shift());N(rn)}function Rn(){N(on)}function Pn(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)jn(t.postRun.shift());N(un)}function Sn(n){rn.unshift(n)}function Tn(n){on.unshift(n)}function jn(n){un.unshift(n)}var y=0,F=null;function xn(n){y++,t.monitorRunDependencies&&t.monitorRunDependencies(y)}function In(n){if(y--,t.monitorRunDependencies&&t.monitorRunDependencies(y),y==0&&F){var e=F;F=null,e()}}function q(n){throw t.onAbort&&t.onAbort(n),P(n+=""),V=!0,n="abort("+n+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(n)}t.preloadedImages={},t.preloadedAudios={};var s,Hn="data:application/octet-stream;base64,";function an(n){return n.startsWith(Hn)}function sn(n){return n.startsWith("file://")}function fn(n){try{if(n==s&&I)return new Uint8Array(I);if(U)return U(n);throw"both async and sync fetching of the wasm failed"}catch(e){q(e)}}function Mn(){if(!I&&(K||x)){if(typeof fetch=="function"&&!sn(s))return fetch(s,{credentials:"same-origin"}).then(function(n){if(!n.ok)throw"failed to load wasm binary file at '"+s+"'";return n.arrayBuffer()}).catch(function(){return fn(s)});if(W)return new Promise(function(n,e){W(s,function(r){n(new Uint8Array(r))},e)})}return Promise.resolve().then(function(){return fn(s)})}function Fn(){var n={a:Bn};function e(u,a){var l=u.exports;t.asm=l,en((z=t.asm.m).buffer),m=t.asm.q,Tn(t.asm.n),In()}function r(u){e(u.instance)}function o(u){return Mn().then(function(a){return WebAssembly.instantiate(a,n)}).then(u,function(a){P("failed to asynchronously prepare wasm: "+a),q(a)})}function i(){return I||typeof WebAssembly.instantiateStreaming!="function"||an(s)||sn(s)||typeof fetch!="function"?o(r):fetch(s,{credentials:"same-origin"}).then(function(u){return WebAssembly.instantiateStreaming(u,n).then(r,function(a){return P("wasm streaming compile failed: "+a),P("falling back to ArrayBuffer instantiation"),o(r)})})}if(xn(),t.instantiateWasm)try{return t.instantiateWasm(n,e)}catch(u){return P("Module.instantiateWasm callback failed with error: "+u),!1}return i(),{}}function N(n){for(;n.length>0;){var e=n.shift();if(typeof e!="function"){var r=e.func;typeof r=="number"?e.arg===void 0?m.get(r)():m.get(r)(e.arg):r(e.arg===void 0?null:e.arg)}else e(t)}}function qn(){throw"longjmp"}function Cn(n,e,r){H.copyWithin(n,e,e+r)}function On(n){try{return z.grow(n-Z.byteLength+65535>>>16),en(z.buffer),1}catch{}}function Wn(n){var e=H.length,r=2147483648;if((n>>>=0)>r)return!1;for(var o=1;o<=4;o*=2){var i=e*(1+.2/o);if(i=Math.min(i,n+100663296),On(Math.min(r,_n(Math.max(n,i),65536))))return!0}return!1}an(s="libtess.wasm")||(s=dn(s));var L={mappings:{},buffers:[null,[],[]],printChar:function(n,e){var r=L.buffers[n];e===0||e===10?((n===1?yn:P)(tn(r,0)),r.length=0):r.push(e)},varargs:void 0,get:function(){return L.varargs+=4,M[L.varargs-4>>2]},getStr:function(n){return An(n)},get64:function(n,e){return n}};function Un(n,e,r,o){for(var i=0,u=0;u>2],l=M[e+(8*u+4)>>2],d=0;d>2]=i,0}function Ln(){return wn()}function kn(n){vn(n)}var Bn={h:qn,l:Cn,g:Wn,f:Un,b:Ln,k:Gn,d:Nn,j:Xn,i:Yn,e:zn,c:Dn,a:kn};Fn(),t.___wasm_call_ctors=function(){return(t.___wasm_call_ctors=t.asm.n).apply(null,arguments)},t._malloc=function(){return(t._malloc=t.asm.o).apply(null,arguments)},t._free=function(){return(t._free=t.asm.p).apply(null,arguments)},t._triangulate=function(){return(t._triangulate=t.asm.r).apply(null,arguments)};var k,v=t.stackSave=function(){return(v=t.stackSave=t.asm.s).apply(null,arguments)},w=t.stackRestore=function(){return(w=t.stackRestore=t.asm.t).apply(null,arguments)},b=t._setThrew=function(){return(b=t._setThrew=t.asm.u).apply(null,arguments)};function Dn(n,e,r){var o=v();try{m.get(n)(e,r)}catch(i){if(w(o),i!==i+0&&i!=="longjmp")throw i;b(1,0)}}function zn(n,e){var r=v();try{m.get(n)(e)}catch(o){if(w(r),o!==o+0&&o!=="longjmp")throw o;b(1,0)}}function Nn(n,e){var r=v();try{return m.get(n)(e)}catch(o){if(w(r),o!==o+0&&o!=="longjmp")throw o;b(1,0)}}function Gn(n){var e=v();try{return m.get(n)()}catch(r){if(w(e),r!==r+0&&r!=="longjmp")throw r;b(1,0)}}function Xn(n,e,r){var o=v();try{return m.get(n)(e,r)}catch(i){if(w(o),i!==i+0&&i!=="longjmp")throw i;b(1,0)}}function Yn(n,e,r,o){var i=v();try{return m.get(n)(e,r,o)}catch(u){if(w(i),u!==u+0&&u!=="longjmp")throw u;b(1,0)}}function $n(n){this.name="ExitStatus",this.message="Program terminated with exit("+n+")",this.status=n}function G(n){function e(){k||(k=!0,t.calledRun=!0,V||(Rn(),t.onRuntimeInitialized&&t.onRuntimeInitialized(),Pn()))}y>0||(En(),y>0||(t.setStatus?(t.setStatus("Running..."),setTimeout(function(){setTimeout(function(){t.setStatus("")},1),e()},1)):e()))}if(F=function n(){k||G(),k||(F=n)},t.run=G,t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.pop()();G();let X=null,g=null,A=null,B=null;const c=f.Module,Jn=2,cn=4e3;let ln=0;const Kn=(n,e,r)=>{X||(X=c._triangulate);let o=c.HEAPF32;const i=c.HEAP32.BYTES_PER_ELEMENT,u=2,a=o.BYTES_PER_ELEMENT;r>ln&&(ln=r,A&&(c._free(A),A=0),g&&(c._free(g),g=0)),A||(A=c._malloc(r*a)),B||(B=c._malloc(cn*i));const l=r*Jn;g||(g=c._malloc(l*a)),o=c.HEAPF32,o.set(n,A/a),c.HEAP32.set(e,B/i);const d=l/u,C=X(A,B,Math.min(e.length,cn),u,g,d),Qn=C*u;o=c.HEAPF32;const Vn=o.slice(g/a,g/a+Qn),Y={};return Y.buffer=Vn,Y.vertexCount=C,Y};return f.triangulate=Kn,f.whenLoaded()}return{load:S}}())!==void 0&&($.exports=pn);var mn=J.exports;const et=nt({__proto__:null,default:Zn(mn)},[mn]);export{et as l}; diff --git a/dist/assets/libtess-asm-MMunuWgb.js b/dist/assets/libtess-asm-MMunuWgb.js new file mode 100644 index 0000000..a734c8f --- /dev/null +++ b/dist/assets/libtess-asm-MMunuWgb.js @@ -0,0 +1 @@ +import{cg as K4}from"./index-J0iiHjMT.js";function Y4(z2,t0){for(var K2=0;K2u2[C]})}}}return Object.freeze(Object.defineProperty(z2,Symbol.toStringTag,{value:"Module"}))}var D0,I1,_1,H0={exports:{}};H0.exports,D0=H0,I1=function(){function z2(t0){const K2=t0.locateFile,u2={};var C=C!==void 0?C:{};const F2=(()=>{let d;return{resolve:y=>d(y),promise:new Promise(y=>d=y)}})(),x1=()=>F2.promise;C.locateFile=K2,C.onRuntimeInitialized=()=>{F2.resolve(u2)},u2.Module=C,u2.whenLoaded=x1;var w2,Y2={};for(w2 in C)C.hasOwnProperty(w2)&&(Y2[w2]=C[w2]);var d0,e0,o0,U2,O2,Q0=typeof window=="object",N2=typeof importScripts=="function",p0=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",A2="";function L1(d){return C.locateFile?C.locateFile(d,A2):A2+d}p0?(A2=N2?require("path").dirname(A2)+"/":__dirname+"/",d0=function(d,y){var I=Q2(d);return I?y?I:I.toString():(U2||(U2=require("fs")),O2||(O2=require("path")),d=O2.normalize(d),U2.readFileSync(d,y?null:"utf8"))},o0=function(d){var y=d0(d,!0);return y.buffer||(y=new Uint8Array(y)),T1(y.buffer),y},e0=function(d,y,I){var x=Q2(d);x&&y(x),U2||(U2=require("fs")),O2||(O2=require("path")),d=O2.normalize(d),U2.readFile(d,function(S,T){S?I(S):y(T.buffer)})},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),D0.exports=C,process.on("uncaughtException",function(d){if(!(d instanceof k4))throw d}),process.on("unhandledRejection",$2),C.inspect=function(){return"[Emscripten Module object]"}):(Q0||N2)&&(N2?A2=self.location.href:typeof document<"u"&&document.currentScript&&(A2=document.currentScript.src),A2=A2.indexOf("blob:")!==0?A2.substr(0,A2.lastIndexOf("/")+1):"",d0=function(d){try{var y=new XMLHttpRequest;return y.open("GET",d,!1),y.send(null),y.responseText}catch(x){var I=Q2(d);if(I)return $1(I);throw x}},N2&&(o0=function(d){try{var y=new XMLHttpRequest;return y.open("GET",d,!1),y.responseType="arraybuffer",y.send(null),new Uint8Array(y.response)}catch(x){var I=Q2(d);if(I)return I;throw x}}),e0=function(d,y,I){var x=new XMLHttpRequest;x.open("GET",d,!0),x.responseType="arraybuffer",x.onload=function(){if(x.status==200||x.status==0&&x.response)y(x.response);else{var S=Q2(d);S?y(S.buffer):I()}},x.onerror=I,x.send(null)});var P1=C.print||console.log.bind(console),D2=C.printErr||console.warn.bind(console);for(w2 in Y2)Y2.hasOwnProperty(w2)&&(C[w2]=Y2[w2]);Y2=null,C.arguments&&C.arguments,C.thisProgram&&C.thisProgram,C.quit&&C.quit;var H2,W0=0,B1=function(d){W0=d},j1=function(){return W0};C.wasmBinary&&(H2=C.wasmBinary),C.noExitRuntime;var V2,g2={Memory:function(d){this.buffer=new ArrayBuffer(65536*d.initial)},Module:function(d){},Instance:function(d,y){this.exports=function(I){function x(Q){return Q.set=function(c2,N){this[c2]=N},Q.get=function(c2){return this[c2]},Q}for(var S,T=new Uint8Array(123),O=25;O>=0;--O)T[48+O]=52+O,T[65+O]=O,T[97+O]=26+O;function D(Q,c2,N){for(var p,r2,i=0,w=c2,L2=N.length,P2=c2+(3*L2>>2)-(N[L2-2]=="=")-(N[L2-1]=="=");i>4,w>2),w>>0<=244){if(3&(f=(b=i[614])>>>(a=(r=n>>>0<11?16:n+11&-8)>>>3|0)|0)){n=(e=i[2504+(f=(t=a+(1&(-1^f))|0)<<3)>>2])+8|0,(0|(a=i[e+8>>2]))!=(0|(f=f+2496|0))?(i[a+12>>2]=f,i[f+8>>2]=a):(h=2456,m=f2(t)&b,i[h>>2]=m),f=t<<3,i[e+4>>2]=3|f,i[4+(f=f+e|0)>>2]=1|i[f+4>>2];break i}if((A=i[616])>>>0>=r>>>0)break s;if(f){a=n=(f=(0-(n=(0-(n=2<>>12&16,a|=n=(f=f>>>n|0)>>>5&8,a|=n=(f=f>>>n|0)>>>2&4,o=i[2504+(n=(a=((a|=n=(f=f>>>n|0)>>>1&2)|(n=(f=f>>>n|0)>>>1&1))+(f>>>n|0)|0)<<3)>>2],(0|(f=i[o+8>>2]))!=(0|(n=n+2496|0))?(i[f+12>>2]=n,i[n+8>>2]=f):(b=f2(a)&b,i[614]=b),n=o+8|0,i[o+4>>2]=3|r,e=(f=a<<3)-r|0,i[4+(t=o+r|0)>>2]=1|e,i[f+o>>2]=e,A&&(a=2496+((f=A>>>3|0)<<3)|0,o=i[619],(f=1<>2]:(i[614]=f|b,f=a),i[a+8>>2]=o,i[f+12>>2]=o,i[o+12>>2]=a,i[o+8>>2]=f),i[619]=t,i[616]=e;break i}if(!(k=i[615]))break s;for(a=n=(f=(k&0-k)-1|0)>>>12&16,a|=n=(f=f>>>n|0)>>>5&8,a|=n=(f=f>>>n|0)>>>2&4,f=i[2760+(((a|=n=(f=f>>>n|0)>>>1&2)|(n=(f=f>>>n|0)>>>1&1))+(f>>>n|0)<<2)>>2],t=(-8&i[f+4>>2])-r|0,a=f;(n=i[a+16>>2])||(n=i[a+20>>2]);)t=(e=(a=(-8&i[n+4>>2])-r|0)>>>0>>0)?a:t,f=e?n:f,a=n;if((s=f+r|0)>>>0<=f>>>0)break A;if(l=i[f+24>>2],(0|(e=i[f+12>>2]))!=(0|f)){n=i[f+8>>2],i[n+12>>2]=e,i[e+8>>2]=n;break f}if(!(n=i[(a=f+20|0)>>2])){if(!(n=i[f+16>>2]))break o;a=f+16|0}for(;o=a,e=n,(n=i[(a=n+20|0)>>2])||(a=e+16|0,n=i[e+16>>2]););i[o>>2]=0;break f}if(r=-1,!(n>>>0>4294967231)&&(r=-8&(n=n+11|0),s=i[615])){t=0-r|0,b=0,r>>>0<256||(b=31,r>>>0>16777215||(n=n>>>8|0,n<<=o=n+1048320>>>16&8,b=28+((n=((n<<=a=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|a|o)|0)<<1|r>>>n+21&1)|0));k:{r:{if(a=i[2760+(b<<2)>>2])for(n=0,f=r<<((0|b)==31?0:25-(b>>>1|0)|0);;){if(!((o=(-8&i[a+4>>2])-r|0)>>>0>=t>>>0||(e=a,t=o))){t=0,n=a;break r}if(o=i[a+20>>2],a=i[16+((f>>>29&4)+a|0)>>2],n=o?(0|o)==(0|a)?n:o:n,f<<=1,!a)break}else n=0;if(!(n|e)){if(e=0,!(n=(0-(n=2<>>12&16,a|=n=(f=f>>>n|0)>>>5&8,a|=n=(f=f>>>n|0)>>>2&4,n=i[2760+(((a|=n=(f=f>>>n|0)>>>1&2)|(n=(f=f>>>n|0)>>>1&1))+(f>>>n|0)<<2)>>2]}if(!n)break k}for(;t=(a=(f=(-8&i[n+4>>2])-r|0)>>>0>>0)?f:t,e=a?n:e,n=(f=i[n+16>>2])||i[n+20>>2];);}if(!(!e|i[616]-r>>>0<=t>>>0)){if((k=e+r|0)>>>0<=e>>>0)break A;if(b=i[e+24>>2],(0|e)!=(0|(f=i[e+12>>2]))){n=i[e+8>>2],i[n+12>>2]=f,i[f+8>>2]=n;break a}if(!(n=i[(a=e+20|0)>>2])){if(!(n=i[e+16>>2]))break u;a=e+16|0}for(;o=a,f=n,(n=i[(a=n+20|0)>>2])||(a=f+16|0,n=i[f+16>>2]););i[o>>2]=0;break a}}}if((a=i[616])>>>0>=r>>>0){t=i[619],(f=a-r|0)>>>0>=16?(i[616]=f,n=t+r|0,i[619]=n,i[n+4>>2]=1|f,i[a+t>>2]=f,i[t+4>>2]=3|r):(i[619]=0,i[616]=0,i[t+4>>2]=3|a,i[4+(n=a+t|0)>>2]=1|i[n+4>>2]),n=t+8|0;break i}if((k=i[617])>>>0>r>>>0){f=k-r|0,i[617]=f,n=(a=i[620])+r|0,i[620]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|r,n=a+8|0;break i}if(n=0,f=s=r+47|0,i[732]?a=i[734]:(i[735]=-1,i[736]=-1,i[733]=4096,i[734]=4096,i[732]=v+12&-16^1431655768,i[737]=0,i[725]=0,a=4096),(a=(o=f+a|0)&(e=0-a|0))>>>0<=r>>>0||(t=i[724])&&t>>>0<(b=(f=i[722])+a|0)>>>0|f>>>0>=b>>>0)break i;if(4&w[2900])break b;s:{k:{if(t=i[620])for(n=2904;;){if(t>>>0<(f=i[n>>2])+i[n+4>>2]>>>0&&f>>>0<=t>>>0)break k;if(!(n=i[n+8>>2]))break}if((0|(f=T2(0)))==-1||(b=a,(n=(t=i[733])-1|0)&f&&(b=(a-f|0)+(n+f&0-t)|0),b>>>0<=r>>>0|b>>>0>2147483646)||(t=i[724])&&t>>>0<(e=(n=i[722])+b|0)>>>0|n>>>0>=e>>>0)break e;if((0|f)!=(0|(n=T2(b))))break s;break t}if((b=e&o-k)>>>0>2147483646)break e;if((0|(f=T2(b)))==(i[n>>2]+i[n+4>>2]|0))break c;n=f}if(!((0|n)==-1|r+48>>>0<=b>>>0)){if((f=(f=i[734])+(s-b|0)&0-f)>>>0>2147483646){f=n;break t}if((0|T2(f))!=-1){b=f+b|0,f=n;break t}T2(0-b|0);break e}if(f=n,(0|n)!=-1)break t;break e}o2()}e=0;break f}f=0;break a}if((0|f)!=-1)break t}i[725]=4|i[725]}if(a>>>0>2147483646||(0|(f=T2(a)))==-1|(0|(n=T2(0)))==-1|n>>>0<=f>>>0||(b=n-f|0)>>>0<=r+40>>>0)break n}n=i[722]+b|0,i[722]=n,n>>>0>P2[723]&&(i[723]=n);t:{b:{e:{if(o=i[620]){for(n=2904;;){if(((t=i[n>>2])+(a=i[n+4>>2])|0)==(0|f))break e;if(!(n=i[n+8>>2]))break}break b}for((n=i[618])>>>0<=f>>>0&&n||(i[618]=f),n=0,i[727]=b,i[726]=f,i[622]=-1,i[623]=i[732],i[729]=0;a=2496+(t=n<<3)|0,i[t+2504>>2]=a,i[t+2508>>2]=a,(0|(n=n+1|0))!=32;);a=(t=b-40|0)-(n=f+8&7?-8-f&7:0)|0,i[617]=a,n=n+f|0,i[620]=n,i[n+4>>2]=1|a,i[4+(f+t|0)>>2]=40,i[621]=i[736];break t}if(!(8&w[n+12|0]|t>>>0>o>>>0|f>>>0<=o>>>0)){i[n+4>>2]=a+b,a=(n=o+8&7?-8-o&7:0)+o|0,i[620]=a,n=(f=i[617]+b|0)-n|0,i[617]=n,i[a+4>>2]=1|n,i[4+(f+o|0)>>2]=40,i[621]=i[736];break t}}P2[618]>f>>>0&&(i[618]=f),a=f+b|0,n=2904;b:{e:{c:{u:{o:{A:{for(;;){if((0|a)!=i[n>>2]){if(n=i[n+8>>2])continue;break A}break}if(!(8&w[n+12|0]))break o}for(n=2904;;){if((a=i[n>>2])>>>0<=o>>>0&&(e=a+i[n+4>>2]|0)>>>0>o>>>0)break u;n=i[n+8>>2]}}if(i[n>>2]=f,i[n+4>>2]=i[n+4>>2]+b,i[4+(s=(f+8&7?-8-f&7:0)+f|0)>>2]=3|r,a=(b=a+(a+8&7?-8-a&7:0)|0)-(k=r+s|0)|0,(0|o)==(0|b)){i[620]=k,n=i[617]+a|0,i[617]=n,i[k+4>>2]=1|n;break e}if(i[619]==(0|b)){i[619]=k,n=i[616]+a|0,i[616]=n,i[k+4>>2]=1|n,i[n+k>>2]=n;break e}if((3&(n=i[b+4>>2]))==1){o=-8&n;o:if(n>>>0<=255){if(t=i[b+8>>2],n=n>>>3|0,(0|(f=i[b+12>>2]))==(0|t)){h=2456,m=i[614]&f2(n),i[h>>2]=m;break o}i[t+12>>2]=f,i[f+8>>2]=t}else{if(r=i[b+24>>2],(0|b)==(0|(f=i[b+12>>2])))if((t=i[(n=b+20|0)>>2])||(t=i[(n=b+16|0)>>2])){for(;e=n,(t=i[(n=(f=t)+20|0)>>2])||(n=f+16|0,t=i[f+16>>2]););i[e>>2]=0}else f=0;else n=i[b+8>>2],i[n+12>>2]=f,i[f+8>>2]=n;if(r){t=i[b+28>>2];A:{if(i[(n=2760+(t<<2)|0)>>2]==(0|b)){if(i[n>>2]=f,f)break A;h=2460,m=i[615]&f2(t),i[h>>2]=m;break o}if(i[r+(i[r+16>>2]==(0|b)?16:20)>>2]=f,!f)break o}i[f+24>>2]=r,(n=i[b+16>>2])&&(i[f+16>>2]=n,i[n+24>>2]=f),(n=i[b+20>>2])&&(i[f+20>>2]=n,i[n+24>>2]=f)}}b=o+b|0,a=a+o|0}if(i[b+4>>2]=-2&i[b+4>>2],i[k+4>>2]=1|a,i[a+k>>2]=a,a>>>0<=255){f=2496+((n=a>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=k,i[n+12>>2]=k,i[k+12>>2]=f,i[k+8>>2]=n;break e}if(n=31,a>>>0<=16777215&&(n=a>>>8|0,n<<=e=n+1048320>>>16&8,n=28+((n=((n<<=t=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|t|e)|0)<<1|a>>>n+21&1)|0),i[k+28>>2]=n,i[k+16>>2]=0,i[k+20>>2]=0,e=2760+(n<<2)|0,(t=i[615])&(f=1<>>1|0)|0),f=i[e>>2];;){if(t=f,(-8&i[f+4>>2])==(0|a))break c;if(f=n>>>29|0,n<<=1,!(f=i[16+(e=t+(4&f)|0)>>2]))break}i[e+16>>2]=k,i[k+24>>2]=t}else i[615]=f|t,i[e>>2]=k,i[k+24>>2]=e;i[k+12>>2]=k,i[k+8>>2]=k;break e}for(a=(t=b-40|0)-(n=f+8&7?-8-f&7:0)|0,i[617]=a,n=n+f|0,i[620]=n,i[n+4>>2]=1|a,i[4+(f+t|0)>>2]=40,i[621]=i[736],i[(a=(n=(e+(e-39&7?39-e&7:0)|0)-47|0)>>>0>>0?o:n)+4>>2]=27,n=i[729],i[a+16>>2]=i[728],i[a+20>>2]=n,n=i[727],i[a+8>>2]=i[726],i[a+12>>2]=n,i[728]=a+8,i[727]=b,i[726]=f,i[729]=0,n=a+24|0;i[n+4>>2]=7,f=n+8|0,n=n+4|0,f>>>0>>0;);if((0|a)==(0|o))break t;if(i[a+4>>2]=-2&i[a+4>>2],e=a-o|0,i[o+4>>2]=1|e,i[a>>2]=e,e>>>0<=255){f=2496+((n=e>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=o,i[n+12>>2]=o,i[o+12>>2]=f,i[o+8>>2]=n;break t}if(n=31,i[o+16>>2]=0,i[o+20>>2]=0,e>>>0<=16777215&&(n=e>>>8|0,n<<=t=n+1048320>>>16&8,n=28+((n=((n<<=a=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|a|t)|0)<<1|e>>>n+21&1)|0),i[o+28>>2]=n,t=2760+(n<<2)|0,(a=i[615])&(f=1<>>1|0)|0),f=i[t>>2];;){if(a=f,(0|e)==(-8&i[f+4>>2]))break b;if(f=n>>>29|0,n<<=1,!(f=i[16+(t=a+(4&f)|0)>>2]))break}i[t+16>>2]=o,i[o+24>>2]=a}else i[615]=f|a,i[t>>2]=o,i[o+24>>2]=t;i[o+12>>2]=o,i[o+8>>2]=o;break t}n=i[t+8>>2],i[n+12>>2]=k,i[t+8>>2]=k,i[k+24>>2]=0,i[k+12>>2]=t,i[k+8>>2]=n}n=s+8|0;break i}n=i[a+8>>2],i[n+12>>2]=o,i[a+8>>2]=o,i[o+24>>2]=0,i[o+12>>2]=a,i[o+8>>2]=n}if(!((n=i[617])>>>0<=r>>>0)){f=n-r|0,i[617]=f,n=(a=i[620])+r|0,i[620]=n,i[n+4>>2]=1|f,i[a+4>>2]=3|r,n=a+8|0;break i}}i[613]=48,n=0;break i}a:if(b){a=i[e+28>>2];n:{if(i[(n=2760+(a<<2)|0)>>2]==(0|e)){if(i[n>>2]=f,f)break n;s=f2(a)&s,i[615]=s;break a}if(i[b+(i[b+16>>2]==(0|e)?16:20)>>2]=f,!f)break a}i[f+24>>2]=b,(n=i[e+16>>2])&&(i[f+16>>2]=n,i[n+24>>2]=f),(n=i[e+20>>2])&&(i[f+20>>2]=n,i[n+24>>2]=f)}a:if(t>>>0<=15)n=t+r|0,i[e+4>>2]=3|n,i[4+(n=n+e|0)>>2]=1|i[n+4>>2];else if(i[e+4>>2]=3|r,i[k+4>>2]=1|t,i[t+k>>2]=t,t>>>0<=255)f=2496+((n=t>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=k,i[n+12>>2]=k,i[k+12>>2]=f,i[k+8>>2]=n;else{n=31,t>>>0<=16777215&&(n=t>>>8|0,n<<=o=n+1048320>>>16&8,n=28+((n=((n<<=a=n+520192>>>16&4)<<(f=n+245760>>>16&2)>>>15|0)-(f|a|o)|0)<<1|t>>>n+21&1)|0),i[k+28>>2]=n,i[k+16>>2]=0,i[k+20>>2]=0,a=2760+(n<<2)|0;n:{if((f=1<>>1|0)|0),r=i[a>>2];;){if((-8&i[(f=r)+4>>2])==(0|t))break n;if(a=n>>>29|0,n<<=1,!(r=i[16+(a=f+(4&a)|0)>>2]))break}i[a+16>>2]=k,i[k+24>>2]=f}else i[615]=f|s,i[a>>2]=k,i[k+24>>2]=a;i[k+12>>2]=k,i[k+8>>2]=k;break a}n=i[f+8>>2],i[n+12>>2]=k,i[f+8>>2]=k,i[k+24>>2]=0,i[k+12>>2]=f,i[k+8>>2]=n}n=e+8|0;break i}f:if(l){a=i[f+28>>2];a:{if(i[(n=2760+(a<<2)|0)>>2]==(0|f)){if(i[n>>2]=e,e)break a;h=2460,m=f2(a)&k,i[h>>2]=m;break f}if(i[(i[l+16>>2]==(0|f)?16:20)+l>>2]=e,!e)break f}i[e+24>>2]=l,(n=i[f+16>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(n=i[f+20>>2])&&(i[e+20>>2]=n,i[n+24>>2]=e)}t>>>0<=15?(n=t+r|0,i[f+4>>2]=3|n,i[4+(n=n+f|0)>>2]=1|i[n+4>>2]):(i[f+4>>2]=3|r,i[s+4>>2]=1|t,i[t+s>>2]=t,A&&(a=2496+((n=A>>>3|0)<<3)|0,e=i[619],(n=1<>2]:(i[614]=n|b,n=a),i[a+8>>2]=e,i[n+12>>2]=e,i[e+12>>2]=a,i[e+8>>2]=n),i[619]=s,i[616]=t),n=f+8|0}return B=v+16|0,0|n}function w4(n,f,a,t,e,b){n|=0,f|=0,a|=0,t|=0,e|=0,b|=0;for(var o=0,k=0,r=0,s=0,A=0,l=u(0),v=0,h=u(0),m=u(0),g=0,E=0,R=0,_=0,L=0,P=0,F=0,U=0;(r=i[2032+(o=k<<2)>>2])&&(i[r>>2]=0),(r=i[2032+(4|o)>>2])&&(i[r>>2]=0),(r=i[2032+(8|o)>>2])&&(i[r>>2]=0),(o=i[2032+(12|o)>>2])&&(i[o>>2]=0),(0|(k=k+4|0))!=100;);if((k=i[608])||(k=H(16),i[608]=k),i[k+8>>2]=b,i[k+4>>2]=0,i[k+12>>2]=t,i[k>>2]=e,(k=i[609])||((e=H(1900))?(i[e+100>>2]=12,i[e+96>>2]=13,i[e+92>>2]=14,i[e+88>>2]=15,r2[e+80>>1]=0,i[e+52>>2]=0,i[e+56>>2]=100130,i[e+16>>2]=0,i[e+20>>2]=0,i[e>>2]=0,i[e+1896>>2]=0,i[e+1736>>2]=8,i[e+1732>>2]=11,i[e+1728>>2]=6,i[e+1724>>2]=5,i[e+1720>>2]=4,i[e+1716>>2]=3,i[e+104>>2]=16,i[e+76>>2]=17,i[e+12>>2]=18,i[e+24>>2]=0):e=0,i[609]=e,W2(e,100107,34),W2(i[609],100100,35),W2(i[609],100102,36),W2(i[609],100105,37),W2(i[609],100103,38),W2(i[609],100104,39),i[i[609]+56>>2]=100130,e=i[609],c[e+16>>2]=0,c[e+24>>2]=1,c[e+20>>2]=0,k=i[609]),e=0,b=i[608],i[k>>2]&&E2(k,0),i[k+112>>2]=0,i[k>>2]=1,p[k+108|0]=0,i[k+1896>>2]=b,i[k+8>>2]=0,(0|a)>0)for(b=0;;){if(g=i[(b<<2)+f>>2],o=i[609],i[o>>2]!=1&&E2(o,1),i[o>>2]=2,i[o+4>>2]=0,i[o+112>>2]>=1&&(p[o+108|0]=1),k=0,(0|g)>0)for(;;){A=E=(W(e+k|0,t)<<2)+n|0,r=i[609],i[r>>2]!=2&&E2(r,2);i:{f:{a:{if(w[r+108|0]){if(o=M0(),i[r+8>>2]=o,!o)break a;if((0|(o=i[r+112>>2]))>=1)for(R=116+(r+(o<<4)|0)|0,s=r+116|0,o=i[r+4>>2];;){U=i[s+12>>2];n:{if(!o){if(!(o=f0(i[r+8>>2])))break a;if(z(o,i[o+4>>2]))break n;break a}if(!n2(o))break a;o=i[o+12>>2]}if(v=i[o+16>>2],i[v+12>>2]=U,c[v+16>>2]=c[s>>2],l=c[s+4>>2],i[v+24>>2]=0,c[v+20>>2]=l,i[o+28>>2]=1,i[i[o+4>>2]+28>>2]=-1,i[r+4>>2]=o,!(R>>>0>(s=s+16|0)>>>0))break}p[r+108|0]=0,i[r+112>>2]=0,i[r+4>>2]=0}s=(L=+(l=(_=+(l=c[A+4>>2]))<-1e37?u(-9999999933815813e21):l))>1e37,v=(F=+(h=(P=+(h=c[A>>2]))<-1e37?u(-9999999933815813e21):h))>1e37,((o=+(m=c[A+8>>2])<-1e37)|(A=+(m=o?u(-9999999933815813e21):m)>1e37)|_<-1e37|L>1e37||F>1e37||P<-1e37)&&((0|(o=i[r+1732>>2]))==11?M[i[r+12>>2]](100155):M[0|o](100155,i[r+1896>>2])),l=s?u(9999999933815813e21):l,h=v?u(9999999933815813e21):h;n:{if(!i[r+8>>2]){if((0|(s=i[r+112>>2]))<=99){c[124+(o=r+(s<<4)|0)>>2]=A?u(9999999933815813e21):m,c[o+120>>2]=l,c[o+116>>2]=h,i[o+128>>2]=E,i[r+112>>2]=s+1;break i}if(o=M0(),i[r+8>>2]=o,!o)break n;if((0|(o=i[r+112>>2]))>=1)for(v=116+(r+(o<<4)|0)|0,s=r+116|0,o=i[r+4>>2];;){R=i[s+12>>2];t:{if(!o){if(!(o=f0(i[r+8>>2])))break n;if(z(o,i[o+4>>2]))break t;break n}if(!n2(o))break n;o=i[o+12>>2]}if(A=i[o+16>>2],i[A+12>>2]=R,c[A+16>>2]=c[s>>2],m=c[s+4>>2],i[A+24>>2]=0,c[A+20>>2]=m,i[o+28>>2]=1,i[i[o+4>>2]+28>>2]=-1,i[r+4>>2]=o,!(v>>>0>(s=s+16|0)>>>0))break}p[r+108|0]=0,i[r+112>>2]=0}t:{b:{if(!(o=i[r+4>>2])){if(!(o=f0(i[r+8>>2])))break t;if(z(o,i[o+4>>2]))break b;break t}if(!n2(o))break t;o=i[o+12>>2]}s=i[o+16>>2],c[s+16>>2]=h,i[s+12>>2]=E,i[s+24>>2]=0,c[s+20>>2]=l,i[o+28>>2]=1,i[i[o+4>>2]+28>>2]=-1,i[r+4>>2]=o;break i}if((0|(o=i[r+1732>>2]))!=11)break f;M[i[r+12>>2]](100902);break i}if((0|(o=i[r+1732>>2]))!=11)break f;M[i[r+12>>2]](100902);break i}if((0|(o=i[r+1732>>2]))==11){M[i[r+12>>2]](100902);break i}}M[0|o](100902,i[r+1896>>2])}if((0|g)==(0|(k=k+1|0)))break}if(o=i[609],i[o>>2]!=2&&E2(o,2),i[o>>2]=1,e=e+g|0,(0|(b=b+1|0))==(0|a))break}a=i[609],n=0,f=H(40),i[f>>2]=0,e=g1(r=a+1740|0,1,f,4),b=0|V();i:{f:{a:{n:{t:{b:for(;;){e:{c:{u:{o:{A:{s:{k:{if(n){if((0|(n=i[a+1732>>2]))!=11){if(f=i[a+1896>>2],i[611]=0,B2(0|n,100902,0|f),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break s;if(f=J(i[n>>2],e,b))break k;break t}if(n=i[a+12>>2],i[611]=0,t1(0|n,100902),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break o;if(f=J(i[n>>2],e,b))break A;break t}if(i[a>>2]==1)break e;if(i[611]=0,B2(19,0|a,1),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break c;if(f=J(i[n>>2],e,b))break u;break t}K(0|t)}if(n=0|V(),(0|f)==1)continue;break i}K(0|t)}if(n=0|V(),(0|f)==1)continue;break i}K(0|t)}if(n=0|V(),(0|f)==1)continue}i[a>>2]=0;e:{c:{u:{if(!i[a+8>>2]){if(!(w[a+80|0]|i[a+104>>2]!=16)){if(i[611]=0,o=0|i0(20,0|a),n=i[611],i[611]=0,f=-1,n&&(t=i[612])){if(!(f=J(i[n>>2],e,b)))break t;K(0|t)}if(n=0|V(),(0|f)==1)continue;if(o){i[a+1896>>2]=0;break i}}if(i[611]=0,t=0|h4(21),n=i[611],i[611]=0,f=-1,n&&(k=i[612])){if(!(f=J(i[n>>2],e,b)))break n;K(0|k)}if(n=0|V(),(0|f)==1)continue;if(i[a+8>>2]=t,!t)break u;if((0|(n=i[a+112>>2]))>=1)for(s=116+(a+(n<<4)|0)|0,t=a+116|0,f=i[a+4>>2];;){g=i[t+12>>2];o:{A:{s:{k:{r:{l:{if(!f){if(n=i[a+8>>2],i[611]=0,f=0|i0(22,0|n),n=i[611],i[611]=0,k=-1,!n||!(o=i[612]))break r;if(k=J(i[n>>2],e,b))break l;break a}if(i[611]=0,A=0|i0(23,0|f),n=i[611],i[611]=0,k=-1,!n||!(o=i[612]))break s;if(k=J(i[n>>2],e,b))break k;break a}K(0|o)}if(n=0|V(),(0|k)!=1)break A;continue b}K(0|o)}if(n=0|V(),(0|k)==1)continue b;if(!A)break u;f=i[f+12>>2];break o}if(!f)break u;if(n=i[f+4>>2],i[611]=0,A=0|p4(24,0|f,0|n),n=i[611],i[611]=0,k=-1,n&&(o=i[612])){if(!(k=J(i[n>>2],e,b)))break a;K(0|o)}if(n=0|V(),(0|k)==1)continue b;if(!A)break u}if(n=i[f+16>>2],i[n+12>>2]=g,c[n+16>>2]=c[t>>2],l=c[t+4>>2],i[n+24>>2]=0,c[n+20>>2]=l,i[f+28>>2]=1,i[i[f+4>>2]+28>>2]=-1,i[a+4>>2]=f,!(s>>>0>(t=t+16|0)>>>0))break}p[a+108|0]=0,i[a+112>>2]=0}if(i[611]=0,b1(a),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break e;if(f=J(i[n>>2],e,b))break c;break t}if(i[611]=0,B2(26,0|r,1),f=i[611],i[611]=0,f&&(n=i[612])){if(!J(i[f>>2],e,b))break f;K(0|n)}n=0|V();continue}K(0|t)}if(n=0|V(),(0|f)!=1){if(i[611]=0,o=0|i0(27,0|a),n=i[611],i[611]=0,f=-1,n&&(t=i[612])){if(!(f=J(i[n>>2],e,b)))break t;K(0|t)}if(n=0|V(),(0|f)!=1){e:{c:{u:{o:{A:{s:{k:{r:{l:{v:{d:{if(!o){if(i[611]=0,B2(26,0|r,1),f=i[611],i[611]=0,!f||!(n=i[612]))break v;if(J(i[f>>2],e,b))break d;break f}if(f=i[a+8>>2],w[a+60|0])break s;if(w[a+81|0]){if(i[611]=0,k=0|d4(28,0|f,1,1),n=i[611],i[611]=0,t=-1,!n||!(o=i[612]))break k;if(t=J(i[n>>2],e,b))break l;break a}if(i[611]=0,k=0|i0(29,0|f),n=i[611],i[611]=0,t=-1,!n||!(o=i[612]))break k;if(t=J(i[n>>2],e,b))break r;break a}K(0|n)}n=0|V();continue}K(0|o);break k}K(0|o)}if(n=0|V(),(0|t)==1)continue;k:{r:{l:{v:{d:{p:{h:{if(!k){if(i[611]=0,B2(26,0|r,1),f=i[611],i[611]=0,!f||!(n=i[612]))break p;if(J(i[f>>2],e,b))break h;break f}if(!(i[a+88>>2]!=15|i[a+100>>2]!=12|i[a+96>>2]!=13|i[a+92>>2]!=14||i[a+1716>>2]!=3|i[a+1728>>2]!=6|i[a+1724>>2]!=5||i[a+1720>>2]!=4))break k;if(w[a+81|0]){if(i[611]=0,B2(30,0|a,0|f),n=i[611],i[611]=0,t=-1,!n||!(k=i[612]))break v;if(t=J(i[n>>2],e,b))break d;break n}if(i[611]=0,B2(31,0|a,0|f),n=i[611],i[611]=0,t=-1,!n||!(k=i[612]))break r;if(t=J(i[n>>2],e,b))break l;break n}K(0|n)}n=0|V();continue}K(0|k)}if(n=0|V(),(0|t)==1)continue;break k}K(0|k)}if(n=0|V(),(0|t)==1)continue}if(i[a+104>>2]!=16){if(i[611]=0,r1(f),n=i[611],i[611]=0,t=-1,!n||!(k=i[612]))break o;if(t=J(i[n>>2],e,b))break A;break n}}if(i[611]=0,_0(f),n=i[611],i[611]=0,f=-1,!n||!(t=i[612]))break c;if(f=J(i[n>>2],e,b))break u;break t}K(0|k)}if(n=0|V(),(0|t)!=1)break e;continue}K(0|t)}if(n=0|V(),(0|f)==1)continue;i[a+8>>2]=0,i[a+1896>>2]=0;break i}if(n=i[a+104>>2],i[611]=0,t1(0|n,0|f),n=i[611],i[611]=0,f=-1,n&&(t=i[612])){if(!(f=J(i[n>>2],e,b)))break t;K(0|t)}if(n=0|V(),(0|f)!=1)break}}}i[a+1896>>2]=0,i[a+8>>2]=0;break i}b2(n,t),o2()}b2(n,k),o2()}b2(n,o),o2()}b2(f,n),o2()}return j(e),i[i[608]+4>>2]}function o1(n,f){var a=u(0),t=u(0),e=0,b=u(0),o=u(0),k=0,r=0,s=u(0),A=0,l=0,v=0,h=u(0),m=u(0),g=u(0),E=0,R=0,_=0,L=0,P=0,F=0,U=0,q=0,Y=0,k2=u(0),m2=0,n0=u(0);B=k=B-144|0,Y=i[i[i[f+4>>2]+8>>2]>>2],U=i[Y>>2],_=i[U+16>>2],P=i[i[U+4>>2]+16>>2],F=i[f>>2],L=i[i[F+4>>2]+16>>2],E=i[F+16>>2],G(L,i[n+72>>2],E)>u(0)&&(a=c[L+28>>2],t=c[L+32>>2],e=i[n+72>>2],b=c[e+28>>2],o=c[e+32>>2],s=c[E+28>>2],X[k+40>>3]=c[E+32>>2],X[k+32>>3]=s,X[k+24>>3]=o,X[k+16>>3]=b,X[k+8>>3]=t,X[k>>3]=a,R1(1098,k));i:{f:{a:if((0|E)!=(0|_)&&!((m=(a=c[E+32>>2])<=(t=c[L+32>>2])?a:t)>((t=c[_+32>>2])>=(b=c[P+32>>2])?t:b))){n:{if(!(!(a<=t)|(b=c[E+28>>2])!=(o=c[_+28>>2]))||bu(0)))break n;break a}if(G(L,_,E)>2])<(t=c[E+28>>2])|(c[A+32>>2]<=c[l+32>>2]?a==t:0)?(r=l,l=A):r=A,(a=c[e+28>>2])>(t=c[v+28>>2])|(c[v+32>>2]<=c[e+32>>2]?a==t:0)?(a=t,A=e,e=v):A=v,a>(t=c[l+28>>2])|(c[l+32>>2]<=c[e+32>>2]?a==t:0)?(t=a,v=A,R=e,A=r,e=l):(v=r,R=l),r=k;n:if((o=c[A+28>>2])>t|(c[R+32>>2]<=c[A+32>>2]?t==o:0))if(h=c[v+28>>2],!(c[A+32>>2]<=c[v+32>>2])|o!=h&&!(h>o))if(t=G(e,R,A),a=G(e,v,A),l=u(t-a)>2],s=c[v+28>>2],a=u(u(o+s)*u(.5)),t==u(0))break n;a=u(o+u(u(b/u(b+t))*u(s-o)))}else a=c[v+28>>2],a=u(a+u(u(t/u(b+t))*u(c[R+28>>2]-a)));else{if(a=u(0),s=u(o-t),b=u(t-c[e+28>>2]),(m=u(s+b))>u(0)&&(a=c[((l=b>2],a=u(u(c[R+32>>2]-a)+u(u((l?b:s)/m)*u(a-c[(l?A:e)+32>>2])))),k2=u(-a),m=a,h=u(h-o),(b=u(s+h))>u(0)&&(g=c[((l=s>2],g=u(u(c[A+32>>2]-g)+u(u((l?s:h)/b)*u(g-c[(l?v:R)+32>>2])))),l=u(a+g)>2]=a,(a=c[e+32>>2])<(t=c[A+32>>2])|(c[e+28>>2]<=c[A+28>>2]?a==t:0)?(r=A,A=e):r=e,(t=c[v+32>>2])>(a=c[R+32>>2])|(c[R+28>>2]<=c[v+28>>2]?a==t:0)?(t=a,e=v,v=R):e=R,(a=c[A+32>>2])>2]<=c[v+28>>2]?a==t:0)?(R=e,l=v,e=r,v=A):(R=r,l=A);n:{t:if((o=c[l+32>>2])<(s=c[e+32>>2])|(c[l+28>>2]<=c[e+28>>2]?o==s:0)){if(g=c[R+32>>2],!(!(c[e+28>>2]<=c[R+28>>2])|s!=g)||g>s){if(a=u(0),t=u(0),h=u(s-o),b=u(o-c[v+32>>2]),(m=u(h+b))>u(0)&&(t=c[((r=b>2],t=u(u(c[l+28>>2]-t)+u(u((r?b:h)/m)*u(t-c[(r?e:v)+28>>2])))),n0=u(-t),m=t,g=u(g-s),(b=u(h+g))>u(0)&&(k2=c[e+28>>2],a=c[((e=h>2],a=u(u(k2-a)+u(u((e?h:g)/b)*u(a-c[(e?R:l)+28>>2])))),e=u(t+a)>2]=o+u(h*u(t/u(t+a)));break n}c[k+88>>2]=s+u(u(o-s)*u(a/u(t+a)));break n}if(a=u(0),t=u(0),b=u(s-o),h=c[v+32>>2],m=u(o-h),u(b+m)>u(0)&&(t=c[l+28>>2],t=u(u(m*u(t-c[e+28>>2]))+u(b*u(t-c[v+28>>2])))),m=u(-t),b=t,s=u(s-g),h=u(g-h),u(s+h)>u(0)&&(a=c[R+28>>2],a=u(u(h*u(a-c[e+28>>2]))+u(s*u(a-c[v+28>>2])))),e=u(t-a)>2]=u(o+g)*u(.5);break n}c[k+88>>2]=o+u(u(g-o)*u(t/u(t+a)));break n}c[k+88>>2]=g+u(u(o-g)*u(a/u(t+a)));break n}c[k+88>>2]=u(o+s)*u(.5)}a=c[k+84>>2],r=i[n+72>>2];n:{if(a<(b=c[r+28>>2]))t=c[r+32>>2];else if(a!=b||!((t=c[r+32>>2])>=c[k+88>>2]))break n;c[k+88>>2]=t,c[k+84>>2]=b,a=b}A=e=E,(t=b=c[e+28>>2])<(o=c[_+28>>2])||b==o&&(t=b,A=E,c[e+32>>2]<=c[_+32>>2])||(t=o,A=_),e=A;n:{if(a>t)o=c[e+32>>2];else if(a!=t||!((o=c[e+32>>2])<=c[k+88>>2]))break n;c[k+88>>2]=o,c[k+84>>2]=t,b=c[E+28>>2],a=t}if(c[_+28>>2]!=a|c[k+88>>2]!=c[_+32>>2]&&(c[k+88>>2]!=c[E+32>>2]||a!=b)){n:{a=c[r+28>>2];t:{if(c[L+32>>2]!=c[r+32>>2]||a!=c[L+28>>2]){if(G(L,r,k+56|0)>=u(0))break t;r=i[n+72>>2],a=c[r+28>>2]}if(c[P+32>>2]==c[r+32>>2]&&a==c[P+28>>2]||!(G(P,r,k+56|0)<=u(0)))break n}if((0|(e=i[n+72>>2]))==(0|P)){if(!n2(i[F+4>>2])||!z(i[U+4>>2],F))break i;for(e=i[i[f>>2]+16>>2];f=i[i[i[f+4>>2]+4>>2]>>2],A=i[f>>2],(0|e)==i[A+16>>2];);if(r=f,w[f+15|0]&&(r=0,(e=d2(i[i[i[i[i[f+4>>2]+8>>2]>>2]>>2]+4>>2],i[A+12>>2]))&&$(i[f>>2])&&(i[f>>2]=e,p[f+15|0]=0,i[e+24>>2]=f,r=i[i[i[f+4>>2]+4>>2]>>2])),!r)break i;e=i[i[i[r+4>>2]+8>>2]>>2],f=i[e>>2],a0(n,e,Y),m2=1,j2(n,r,i[i[f+4>>2]+12>>2],f,f,1);break a}if((0|e)==(0|L)){if(!n2(i[U+4>>2])||!z(i[F+12>>2],i[i[U+4>>2]+12>>2]))break i;for(r=i[i[i[f>>2]+4>>2]+16>>2],e=f;e=i[i[i[e+4>>2]+4>>2]>>2],(0|r)==i[i[i[e>>2]+4>>2]+16>>2];);r=i[i[i[i[i[i[e+4>>2]+8>>2]>>2]>>2]+4>>2]+8>>2],i[f>>2]=i[i[U+4>>2]+12>>2],m2=1,j2(n,e,i[a0(n,f,0)+8>>2],i[i[F+4>>2]+8>>2],r,1);break a}if(G(L,e,k+56|0)>=u(0)){if(p[f+14|0]=1,p[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1,!n2(i[F+4>>2]))break i;r=i[F+16>>2],e=i[n+72>>2],c[r+28>>2]=c[e+28>>2],c[r+32>>2]=c[e+32>>2]}else e=i[n+72>>2];if(!(G(P,e,k+56|0)<=u(0)))break a;if(p[Y+14|0]=1,p[f+14|0]=1,!n2(i[U+4>>2]))break i;f=i[U+16>>2],n=i[n+72>>2],c[f+28>>2]=c[n+28>>2],c[f+32>>2]=c[n+32>>2];break a}if(!n2(i[F+4>>2])||!n2(i[U+4>>2])||!z(i[i[U+4>>2]+12>>2],F))break i;if(e=i[F+16>>2],c[e+28>>2]=c[k+84>>2],c[e+32>>2]=c[k+88>>2],r=s1(i[n+68>>2],e),e=i[F+16>>2],i[e+36>>2]=r,(0|r)==2147483647)break f;i[k+112>>2]=i[E+12>>2],i[k+116>>2]=i[L+12>>2],i[k+120>>2]=i[_+12>>2],i[k+124>>2]=i[P+12>>2],i[e+24>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,a=c[e+28>>2],m=(t=u(c[L+28>>2]-a))>2],b=u(c[L+32>>2]-t),o=u(m+(b>2]-a))>2]-t),s=u(m+(b>2]=b,o=u(.5*+s/q),c[k+100>>2]=o,s=u(u(u(c[E+16>>2]*b)+u(c[L+16>>2]*o))+u(0)),c[e+16>>2]=s,g=u(u(u(c[E+20>>2]*b)+u(c[L+20>>2]*o))+u(0)),c[e+20>>2]=g,o=u(u(u(c[E+24>>2]*b)+u(c[L+24>>2]*o))+u(0)),c[e+24>>2]=o,m=(b=u(c[_+28>>2]-a))>2]-t),b=u(m+(b>2]-a))>2]-t),a=u(m+(a>2]=a,t=u(.5*+b/q),c[k+108>>2]=t,b=u(s+u(u(c[_+16>>2]*a)+u(c[P+16>>2]*t))),c[e+16>>2]=b,s=u(g+u(u(c[_+20>>2]*a)+u(c[P+20>>2]*t))),c[e+20>>2]=s,a=u(o+u(u(c[_+24>>2]*a)+u(c[P+24>>2]*t))),c[e+24>>2]=a,c[k+140>>2]=a,c[k+136>>2]=s,c[k+132>>2]=b,i[e+12>>2]=0,e=e+12|0,(0|(r=i[n+1736>>2]))==8?M[i[n+76>>2]](k+132|0,k+112|0,k+96|0,e):M[0|r](k+132|0,k+112|0,k+96|0,e,i[n+1896>>2]),i[e>>2]|w[n+60|0]||((0|(e=i[n+1732>>2]))==11?M[i[n+12>>2]](100156):M[0|e](100156,i[n+1896>>2]),p[n+60|0]=1),p[Y+14|0]=1,p[f+14|0]=1,p[i[i[i[f+4>>2]+4>>2]>>2]+14|0]=1}else E0(n,f)}return B=k+144|0,m2}L0(i[n+68>>2]),i[n+68>>2]=0}b2(n+1740|0,1),o2()}function g4(n){n|=0;var f=0,a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=u(0),A=u(0),l=0,v=0,h=0,m=0,g=0,E=0,R=0,_=0,L=0,P=0;B=b=B-48|0,p[n+60|0]=0;i:{if(a=i[n+8>>2],(0|(f=i[a+64>>2]))!=(0|(k=a- -64|0)))for(;;){a=i[f+12>>2],e=i[f>>2],o=i[f+16>>2],t=i[i[f+4>>2]+16>>2];f:{if(!(c[o+28>>2]!=c[t+28>>2]|c[o+32>>2]!=c[t+32>>2]|i[a+12>>2]==(0|f))){i[b+24>>2]=0,i[b+28>>2]=0,i[b+16>>2]=0,i[b+20>>2]=0,t=i[287],i[b+8>>2]=i[286],i[b+12>>2]=t,t=i[285],i[b>>2]=i[284],i[b+4>>2]=t,t=i[a+16>>2],i[b+16>>2]=i[t+12>>2],i[b+20>>2]=i[o+12>>2],c[b+36>>2]=c[t+16>>2],c[b+40>>2]=c[t+20>>2],c[b+44>>2]=c[t+24>>2],i[t+12>>2]=0,t=t+12|0,(0|(o=i[n+1736>>2]))==8?M[i[n+76>>2]](b+36|0,b+16|0,b,t):M[0|o](b+36|0,b+16|0,b,t,i[n+1896>>2]),i[t>>2]||(i[t>>2]=i[b+16>>2]);a:{if(z(a,f)){if(!$(f))break a;t=i[a+12>>2];break f}break i}break i}t=a,a=f}if(i[t+12>>2]==(0|a)){if((0|a)!=(0|t)&&(e=i[e+4>>2]!=(0|t)&&(0|t)!=(0|e)?e:i[e>>2],!$(t))||(f=(0|a)==(0|e)|i[e+4>>2]==(0|a)?i[e>>2]:e,!$(a)))break i}else f=e;if((0|f)==(0|k))break}e=n,(f=H(28))?(t=f,(a=H(28))?(i[a+8>>2]=0,i[a+12>>2]=32,o=H(132),i[a>>2]=o,o?(k=H(264),i[a+4>>2]=k,k?(i[a+24>>2]=9,i[a+16>>2]=0,i[a+20>>2]=0,i[o+4>>2]=1,i[k+8>>2]=0):(j(o),j(a),a=0)):(j(a),a=0)):a=0,i[t>>2]=a,a?(t=H(128),i[f+4>>2]=t,t?(i[f+24>>2]=9,i[f+20>>2]=0,i[f+12>>2]=0,i[f+16>>2]=32):(j(i[a+4>>2]),j(i[a>>2]),j(a),j(f),f=0)):(j(f),f=0)):f=0,h=f,i[e+68>>2]=f;f:if(f){a:{a=i[n+8>>2];n:{if((0|(f=i[a>>2]))!=(0|a))for(;;){if(e=s1(h,f),i[f+36>>2]=e,(0|e)==2147483647)break n;if((0|a)==(0|(f=i[f>>2])))break}if(B=E=B-400|0,e=H(4+(f=(g=i[h+12>>2])<<2)|0),i[h+8>>2]=e,B=E+400|0,e){if(!((o=(f+e|0)-4|0)>>>0>>0)){if(a=i[h+4>>2],t=1+((k=(g<<2)-4|0)>>>2|0)&7)for(f=e;i[f>>2]=a,f=f+4|0,a=a+4|0,t=t-1|0;);else f=e;if(!(k>>>0<28))for(;i[f>>2]=a,i[f+28>>2]=a+28,i[f+24>>2]=a+24,i[f+20>>2]=a+20,i[f+16>>2]=a+16,i[f+12>>2]=a+12,i[f+8>>2]=a+8,i[f+4>>2]=a+4,a=a+32|0,o>>>0>=(f=f+32|0)>>>0;);}for(i[E+4>>2]=o,i[E>>2]=e,R=2016473283,r=1;;){if((l=i[((r<<3)+E|0)-4>>2])>>>0>(k=i[(m<<3)+E>>2])+40>>>0)for(;;){for(R=W(R,1539415821)+1|0,L=i[(f=((R>>>0)%(1+(l-k>>2)>>>0)<<2)+k|0)>>2],i[f>>2]=i[k>>2],i[k>>2]=L,t=l+4|0,a=k-4|0;;){e=t,v=i[a+4>>2],o=a,f=a+4|0,t=i[v>>2],s=c[t+28>>2],_=i[L>>2],r=f;t:if(!(s<(A=c[_+28>>2]))){for(;;){if(a=f,r=f,c[t+32>>2]<=c[_+32>>2]&&s==A)break t;if(f=a+4|0,o=a,v=i[a+4>>2],t=i[v>>2],A>(s=c[t+28>>2]))break}r=f}a=r,r=i[(t=e-4|0)>>2],f=i[r>>2];t:if(!(A<(s=c[f+28>>2])))for(;;){if(!(!(c[_+32>>2]<=c[f+32>>2])|s!=A))break t;if(e=t,r=i[(t=t-4|0)>>2],f=i[r>>2],A<(s=c[f+28>>2]))break}if(i[a>>2]=r,i[t>>2]=v,!(a>>>0>>0))break}if(f=i[a>>2],i[a>>2]=v,i[t>>2]=f,(a-k|0)<(l-t|0)?(f=e,t=l,l=o):(f=k,t=o,k=e),i[4+(a=(m<<3)+E|0)>>2]=t,i[a>>2]=f,m=m+1|0,!(k+40>>>0>>0))break}if(r=m,l>>>0>=(e=k+4|0)>>>0)for(;;){t=i[e>>2],a=f=e;t:if(!(k>>>0>=f>>>0))for(;;){if(o=i[t>>2],s=c[o+28>>2],m=i[(a=f-4|0)>>2],v=i[m>>2],s<(A=c[v+28>>2])){a=f;break t}if(!(!(c[o+32>>2]<=c[v+32>>2])|s!=A)){a=f;break t}if(i[f>>2]=m,!(k>>>0<(f=a)>>>0))break}if(i[a>>2]=t,!(l>>>0>=(e=e+4|0)>>>0))break}if(m=r-1|0,!((0|r)>=1))break}if(i[h+20>>2]=1,i[h+16>>2]=g,h=i[h>>2],(0|(e=i[h+8>>2]))>=1)for(l=i[h+4>>2],k=i[h>>2],a=e;;){for(t=a,r=l+((m=i[k+(a<<2)>>2])<<3)|0,f=a;(0|e)<=(0|(a=f<<1))||(v=i[l+(i[k+((o=1|a)<<2)>>2]<<3)>>2],s=c[v+28>>2],g=i[l+(i[k+(a<<2)>>2]<<3)>>2],A=c[g+28>>2],!(c[v+32>>2]<=c[g+32>>2])|s!=A&&!(s(0|e)||(o=i[r>>2],s=c[o+28>>2],v=i[k+(a<<2)>>2],R=i[(g=l+(v<<3)|0)>>2],s<(A=c[R+28>>2])|(c[o+32>>2]<=c[R+32>>2]?s==A:0)));)i[k+(f<<2)>>2]=v,i[g+4>>2]=f,f=a;if(i[k+(f<<2)>>2]=m,i[r+4>>2]=f,a=t-1|0,!((0|t)>1))break}i[h+20>>2]=1,f=1}else f=0;if(f)break a}L0(i[n+68>>2]),i[n+68>>2]=0;break f}if(a=n- -64|0,(f=H(20))?(i[f+16>>2]=10,i[f+12>>2]=n,i[f>>2]=0,i[f+8>>2]=f,i[f+4>>2]=f):f=0,i[a>>2]=f,!f)break i;if(m1(n,u(-3999999973526325e22)),m1(n,u(3999999973526325e22)),a=I0(i[n+68>>2]))for(;;){a:if(f=w1(i[n+68>>2]))for(;;){if(c[f+28>>2]!=c[a+28>>2]|c[f+32>>2]!=c[a+32>>2])break a;if(e=i[I0(i[n+68>>2])+8>>2],t=i[a+8>>2],i[b+24>>2]=0,i[b+28>>2]=0,i[b+16>>2]=0,i[b+20>>2]=0,f=i[287],i[b+8>>2]=i[286],i[b+12>>2]=f,f=i[285],i[b>>2]=i[284],i[b+4>>2]=f,f=i[t+16>>2],i[b+16>>2]=i[f+12>>2],i[b+20>>2]=i[i[e+16>>2]+12>>2],c[b+36>>2]=c[f+16>>2],c[b+40>>2]=c[f+20>>2],c[b+44>>2]=c[f+24>>2],i[f+12>>2]=0,f=f+12|0,(0|(o=i[n+1736>>2]))==8?M[i[n+76>>2]](b+36|0,b+16|0,b,f):M[0|o](b+36|0,b+16|0,b,f,i[n+1896>>2]),i[f>>2]||(i[f>>2]=i[b+16>>2]),!z(t,e))break i;if(!(f=w1(i[n+68>>2])))break}if(A0(n,a),!(a=I0(i[n+68>>2])))break}if(f=i[i[i[(e=n- -64|0)>>2]+4>>2]>>2],a=i[f>>2],i[n+72>>2]=i[a+16>>2],i[a+24>>2]=0,h2(i[f+4>>2]),j(f),a=i[e>>2],f=i[i[a+4>>2]>>2])for(;i[i[f>>2]+24>>2]=0,h2(i[f+4>>2]),j(f),a=i[e>>2],f=i[i[a+4>>2]>>2];);if((0|a)!=(0|(f=i[a+4>>2])))for(;j(f),(0|a)!=(0|(f=i[f+4>>2])););if(j(a),L0(i[n+68>>2]),P=1,n=i[n+8>>2],(0|(a=i[n+40>>2]))!=(0|(e=n+40|0)))for(;;){if(n=i[a+8>>2],a=i[a>>2],(0|n)==i[i[n+12>>2]+12>>2]&&(f=i[n+8>>2],i[f+28>>2]=i[f+28>>2]+i[n+28>>2],f=i[f+4>>2],i[f+28>>2]=i[f+28>>2]+i[i[n+4>>2]+28>>2],!$(n))){P=0;break f}if((0|a)==(0|e))break}}return B=b+48|0,0|P}b2(n+1740|0,1),o2()}function C0(n,f,a,t,e,b){var o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0,g=0,E=0,R=0,_=0,L=0,P=0,F=0,U=0;B=k=B-80|0,i[k+76>>2]=f,P=k+55|0,_=k+56|0,f=0;i:{f:for(;;){(0|m)<0||((2147483647-m|0)<(0|f)?(i[613]=61,m=-1):m=f+m|0);a:{n:{t:{if(A=i[k+76>>2],o=w[0|(f=A)])for(;;){b:{e:if(o&=255){if((0|o)!=37)break b;for(o=f;;){if(w[f+1|0]!=37)break e;if(r=f+2|0,i[k+76>>2]=r,o=o+1|0,l=w[f+2|0],f=r,(0|l)!=37)break}}else o=f;if(f=o-A|0,n&&Z(n,A,f),f)continue f;E=-1,o=1,r=k,f=i[k+76>>2],w[f+2|0]!=36|p[i[k+76>>2]+1|0]-48>>>0>=10||(E=p[f+1|0]-48|0,L=1,o=3),f=o+f|0,i[r+76>>2]=f,g=0;e:if((r=(s=p[0|f])-32|0)>>>0>31)o=f;else if(o=f,75913&(r=1<>2]=o,g|=r,(r=(s=p[f+1|0])-32|0)>>>0>=32)break e;if(f=o,!(75913&(r=1<>2]}else{if(r=k,p[o+1|0]-48>>>0>=10||(f=i[k+76>>2],w[f+2|0]!=36)){if(L)break t;L=0,v=0,n&&(f=i[a>>2],i[a>>2]=f+4,v=i[f>>2]),f=i[k+76>>2]+1|0}else i[((p[f+1|0]<<2)+e|0)-192>>2]=10,v=i[((p[f+1|0]<<3)+t|0)-384>>2],L=1,f=f+3|0;if(i[r+76>>2]=f,(0|v)>-1)break e;v=0-v|0,g|=8192}l=-1;e:if(w[0|f]==46)if(w[f+1|0]!=42)i[k+76>>2]=f+1,l=E1(k+76|0),f=i[k+76>>2];else{if(!(p[f+2|0]-48>>>0>=10)&&(f=i[k+76>>2],w[f+3|0]==36)){i[((p[f+2|0]<<2)+e|0)-192>>2]=10,l=i[((p[f+2|0]<<3)+t|0)-384>>2],f=f+4|0,i[k+76>>2]=f;break e}if(L)break t;n?(f=i[a>>2],i[a>>2]=f+4,l=i[f>>2]):l=0,f=i[k+76>>2]+2|0,i[k+76>>2]=f}for(o=0;;){if(R=o,h=-1,p[0|f]-65>>>0>57)break i;if(s=f+1|0,i[k+76>>2]=s,o=p[0|f],f=s,!((o=w[1103+(o+W(R,58)|0)|0])-1>>>0<8))break}e:{c:{if((0|o)!=19){if(!o)break i;if((0|E)>=0){i[(E<<2)+e>>2]=o,o=i[4+(f=(E<<3)+t|0)>>2],i[k+64>>2]=i[f>>2],i[k+68>>2]=o;break c}if(!n)break a;d1(k- -64|0,o,a),s=i[k+76>>2];break e}if((0|E)>-1)break i}if(f=0,!n)continue f}r=-65537&g,o=8192&g?r:g,h=0,E=1024,g=_;e:{c:{u:{o:{A:{s:{k:{r:{l:{v:{d:{p:{h:{m:{w:{switch(f=p[s-1|0],(f=R&&(15&f)==3?-33&f:f)-88|0){case 11:break e;case 9:case 13:case 14:case 15:break c;case 27:break k;case 12:case 17:break v;case 23:break d;case 0:case 32:break p;case 24:break h;case 22:break m;case 29:break w;case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 10:case 16:case 18:case 19:case 20:case 21:case 25:case 26:case 28:case 30:case 31:break n}switch(f-65|0){case 0:case 4:case 5:case 6:break c;case 2:break A;case 1:case 3:break n}if((0|f)==83)break s;break n}s=i[k+64>>2],r=i[k+68>>2],E=1024;break l}f=0;m:switch(255&R){case 0:case 1:case 6:i[i[k+64>>2]>>2]=m;continue f;case 2:o=i[k+64>>2],i[o>>2]=m,i[o+4>>2]=m>>31;continue f;case 3:r2[i[k+64>>2]>>1]=m;continue f;case 4:p[i[k+64>>2]]=m;continue f;case 7:break m;default:continue f}o=i[k+64>>2],i[o>>2]=m,i[o+4>>2]=m>>31;continue f}l=l>>>0>8?l:8,o|=8,f=120}if(A=_,F=32&f,(r=R=i[k+68>>2])|(s=i[k+64>>2]))for(;p[0|(A=A-1|0)]=F|w[1632+(15&s)|0],U=!r&s>>>0>15|(0|r)!=0,R=r,r=r>>>4|0,s=(15&R)<<28|s>>>4,U;);if(!(i[k+64>>2]|i[k+68>>2])|!(8&o))break r;E=1024+(f>>>4|0)|0,h=2;break r}if(f=_,(r=A=i[k+68>>2])|(s=i[k+64>>2]))for(;p[0|(f=f-1|0)]=7&s|48,R=!r&s>>>0>7|(0|r)!=0,A=r,r=r>>>3|0,s=(7&A)<<29|s>>>3,R;);if(A=f,!(8&o))break r;l=(0|(f=_-A|0))<(0|l)?l:f+1|0;break r}r=f=i[k+68>>2],s=i[k+64>>2],(0|f)<-1||(0|f)<=-1?(r=0-(r+((0|s)!=0)|0)|0,s=0-s|0,i[k+64>>2]=s,i[k+68>>2]=r,h=1,E=1024):2048&o?(h=1,E=1025):E=(h=1&o)?1026:1024}A=q2(s,r,_)}if(o=(0|l)>-1?-65537&o:o,r=f=i[k+68>>2],!(l|(0|(s=i[k+64>>2]))!=0|(0|f)!=0)){l=0,A=_;break n}l=(0|(f=!(r|s)+(_-A|0)|0))<(0|l)?l:f;break n}g=(0|(f=l))!=0;k:{r:{l:{v:if(!(!(3&(o=A=(o=i[k+64>>2])||1071))|!f))for(;;){if(!w[0|o])break l;if(g=(0|(f=f-1|0))!=0,!(3&(o=o+1|0)))break v;if(!f)break}if(!g)break r}l:if(!(!w[0|o]|f>>>0<4))for(;;){if((-1^(s=i[o>>2]))&s-16843009&-2139062144)break l;if(o=o+4|0,!((f=f-4|0)>>>0>3))break}if(f)for(;;){if(s=o,!w[0|o])break k;if(o=o+1|0,!(f=f-1|0))break}}s=0}g=s||l+A|0,o=r,l=s?s-A|0:l;break n}if(r=i[k+64>>2],l)break o;f=0,i2(n,32,v,0,o);break u}i[k+12>>2]=0,i[k+8>>2]=i[k+64>>2],i[k+64>>2]=k+8,l=-1,r=k+8|0}f=0;o:{for(;;){if(!(A=i[r>>2]))break o;if(!((s=(0|(A=h1(k+4|0,A)))<0)|A>>>0>l-f>>>0)){if(r=r+4|0,l>>>0>(f=f+A|0)>>>0)continue;break o}break}if(h=-1,s)break i}if(i2(n,32,v,f,o),f)for(r=0,s=i[k+64>>2];;){if(!(A=i[s>>2])||(0|(r=(A=h1(k+4|0,A))+r|0))>(0|f))break u;if(Z(n,k+4|0,A),s=s+4|0,!(f>>>0>r>>>0))break}else f=0}i2(n,32,v,f,8192^o),f=(0|f)<(0|v)?v:f;continue f}f=0|M[0|b](n,X[k+64>>3],v,l,o,f);continue f}p[k+55|0]=i[k+64>>2],l=1,A=P,o=r;break n}r=f+1|0,i[k+76>>2]=r,o=w[f+1|0],f=r}if(h=m,n)break i;if(!L)break a;for(f=1;;){if(n=i[(f<<2)+e>>2]){if(d1((f<<3)+t|0,n,a),h=1,(0|(f=f+1|0))!=10)continue;break i}break}if(h=1,f>>>0>=10)break i;for(;;){if(i[(f<<2)+e>>2])break t;if((0|(f=f+1|0))==10)break}break i}h=-1;break i}i2(n,32,f=(0|(r=(l=(0|(s=g-A|0))>(0|l)?s:l)+h|0))>(0|v)?r:v,r,o),Z(n,E,h),i2(n,48,f,r,65536^o),i2(n,48,l,s,0),Z(n,A,s),i2(n,32,f,r,8192^o);continue}break}h=0}return B=k+80|0,h}function y4(n,f,a,t,e,b){n|=0,f=+f,a|=0,t|=0,e|=0,b|=0;var o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0,g=0,E=0,R=0,_=0,L=0,P=0,F=0,U=0,q=0,Y=0,k2=0,m2=0;B=s=B-560|0,i[s+44>>2]=0,y0(+f),o=0|l2(1),l2(0),(0|o)<-1||(0|o)<=-1?(P=1,F=1034,y0(+(f=-f)),o=0|l2(1),l2(0)):2048&e?(P=1,F=1037):(F=(P=1&e)?1040:1035,m2=!P);i:if((2146435072&o)!=2146435072){_=s+16|0;f:{a:{n:{if(f=y1(f,s+44|0),(f+=f)!=0){if(o=i[s+44>>2],i[s+44>>2]=o-1,(0|(U=32|b))!=97)break n;break f}if((0|(U=32|b))==97)break f;A=i[s+44>>2],v=(0|t)<0?6:t;break a}A=o-29|0,i[s+44>>2]=A,f*=268435456,v=(0|t)<0?6:t}for(k=E=(0|A)<0?s+48|0:s+336|0;o=f<4294967296&f>=0?~~f>>>0:0,i[(t=k)>>2]=o,k=k+4|0,(f=1e9*(f-+(o>>>0)))!=0;);if((0|A)<1)t=A,o=k,r=E;else for(r=E,t=A;;){if(R=(0|t)<29?t:29,!(r>>>0>(o=k-4|0)>>>0)){for(t=R,m=0;g=o,h=0,Y=m,m=i[o>>2],l=31&t,(63&t)>>>0>=32?(k2=m<>>32-l,l=m<>>0>(m=Y+l|0)>>>0?h+1|0:h,Y=g,g=x0(m=A1(l=m,h,1e9),v2,1e9,0),i[Y>>2]=l-g,r>>>0<=(o=o-4|0)>>>0;);(t=m)&&(i[(r=r-4|0)>>2]=t)}for(;r>>>0<(o=k)>>>0&&!i[(k=o-4|0)>>2];);if(t=i[s+44>>2]-R|0,i[s+44>>2]=t,k=o,!((0|t)>0))break}if(k=(v+25|0)/9|0,(0|t)<=-1)for(R=k+1|0,q=(0|U)==102;;){m=(0|t)<-9?9:0-t|0;a:if(o>>>0>r>>>0){for(g=1e9>>>m|0,l=-1<>2],i[k>>2]=Y+(t>>>m|0),t=W(g,t&l),(k=k+4|0)>>>0>>0;);if(r=i[r>>2]?r:r+4|0,!t)break a;i[o>>2]=t,o=o+4|0}else r=i[r>>2]?r:r+4|0;if(t=i[s+44>>2]+m|0,i[s+44>>2]=t,o=(0|R)>2?k+(R<<2)|0:o,!((0|t)<0))break}if(k=0,!(o>>>0<=r>>>0||(k=W(E-r>>2,9),t=10,(l=i[r>>2])>>>0<10)))for(;k=k+1|0,l>>>0>=(t=W(t,10))>>>0;);if((0|(t=(v-((0|U)==102?0:k)|0)-((0|U)==103&(0|v)!=0)|0))<(W(o-E>>2,9)-9|0)){if(h=(((l=(0|(g=t+9216|0))/9|0)<<2)+((0|A)<0?s+48|4:s+340|0)|0)-4096|0,t=10,(0|(g=g-W(l,9)|0))<=7)for(;t=W(t,10),(0|(g=g+1|0))!=8;);if(R=(g=i[h>>2])-W(t,l=(g>>>0)/(t>>>0)|0)|0,((0|(A=h+4|0))!=(0|o)||R)&&(f=(0|o)==(0|A)?1:1.5,L=(A=t>>>1|0)>>>0>R>>>0?.5:(0|A)==(0|R)?f:1.5,f=1&l?9007199254740994:9007199254740992,w[0|F]!=45|m2||(L=-L,f=-f),A=g-R|0,i[h>>2]=A,f+L!=f)){if(t=t+A|0,i[h>>2]=t,t>>>0>=1e9)for(;i[h>>2]=0,(h=h-4|0)>>>0>>0&&(i[(r=r-4|0)>>2]=0),t=i[h>>2]+1|0,i[h>>2]=t,t>>>0>999999999;);if(k=W(E-r>>2,9),t=10,!((A=i[r>>2])>>>0<10))for(;k=k+1|0,A>>>0>=(t=W(t,10))>>>0;);}o=(t=h+4|0)>>>0>>0?t:o}for(;l=o,!(A=o>>>0<=r>>>0)&&!i[(o=l-4|0)>>2];);if((0|U)==103){if(v=((t=(0|(o=v||1))>(0|k)&(0|k)>-5)?-1^k:-1)+o|0,b=(t?-1:-2)+b|0,!(m=8&e)){if(o=-9,!A&&(A=i[l-4>>2])&&(g=10,o=0,!((A>>>0)%10|0))){for(;t=o,o=o+1|0,!((A>>>0)%((g=W(g,10))>>>0)|0););o=-1^t}t=W(l-E>>2,9),(-33&b)!=70?(m=0,v=(0|(t=(0|(t=((t+k|0)+o|0)-9|0))>0?t:0))>(0|v)?v:t):(m=0,v=(0|(t=(0|(t=(t+o|0)-9|0))>0?t:0))>(0|v)?v:t)}}else m=8&e;if(R=(v|m)!=0,t=n,A=a,(0|(g=-33&b))==70)b=(0|k)>0?k:0;else{if((_-(o=q2((o=k>>31)+k^o,0,_))|0)<=1)for(;p[0|(o=o-1|0)]=48,(_-o|0)<2;);p[0|(q=o-2|0)]=b,p[o-1|0]=(0|k)<0?45:43,b=_-q|0}i2(t,32,A,h=1+(b+(R+(v+P|0)|0)|0)|0,e),Z(n,F,P),i2(n,48,a,h,65536^e);a:{n:{t:{if((0|g)==70){for(t=s+16|8,k=s+16|9,r=b=r>>>0>E>>>0?E:r;;){o=q2(i[r>>2],0,k);b:if((0|b)==(0|r))(0|o)==(0|k)&&(p[s+24|0]=48,o=t);else{if(s+16>>>0>=o>>>0)break b;for(;p[0|(o=o-1|0)]=48,s+16>>>0>>0;);}if(Z(n,o,k-o|0),!(E>>>0>=(r=r+4|0)>>>0))break}if(o=0,!R)break n;if(Z(n,1069,1),(0|v)<1|r>>>0>=l>>>0)break t;for(;;){if((o=q2(i[r>>2],0,k))>>>0>s+16>>>0)for(;p[0|(o=o-1|0)]=48,s+16>>>0>>0;);if(Z(n,o,(0|v)<9?v:9),o=v-9|0,l>>>0<=(r=r+4|0)>>>0)break n;if(t=(0|v)>9,v=o,!t)break}break n}b:if(!((0|v)<0))for(b=r>>>0>>0?l:r+4|0,A=s+16|9,t=s+16|8,k=r;;){(0|A)==(0|(o=q2(i[k>>2],0,A)))&&(p[s+24|0]=48,o=t);e:if((0|k)==(0|r))Z(n,o,1),o=o+1|0,!m&&(0|v)<=0||Z(n,1069,1);else{if(s+16>>>0>=o>>>0)break e;for(;p[0|(o=o-1|0)]=48,s+16>>>0>>0;);}if(Z(n,l=o,(0|(o=A-o|0))<(0|v)?o:v),v=v-o|0,b>>>0<=(k=k+4|0)>>>0)break b;if(!((0|v)>-1))break}i2(n,48,v+18|0,18,0),Z(n,q,_-q|0);break a}o=v}i2(n,48,o+9|0,9,0)}break i}if(E=(A=32&b)?F+9|0:F,!(t>>>0>11)&&(o=12-t|0)){for(L=8;L*=16,o=o-1|0;);f=w[0|E]!=45?f+L-L:-(L+(-f-L))}for((0|_)==(0|(o=q2((k=(o=i[s+44>>2])>>31)^o+k,0,_)))&&(p[s+15|0]=48,o=s+15|0),v=2|P,k=i[s+44>>2],p[0|(l=o-2|0)]=b+15,p[o-1|0]=(0|k)<0?45:43,o=8&e,r=s+16|0;b=r,m=A,k=A4(f)<2147483648?~~f:-2147483648,p[0|r]=m|w[k+1632|0],f=16*(f-+(0|k)),!(o||(0|t)>0|f!=0)|((r=b+1|0)-(s+16|0)|0)!=1||(p[b+1|0]=46,r=b+2|0),f!=0;);i2(b=n,32,o=a,h=(A=!t|((r-s|0)-18|0)>=(0|t)?(_-(l+(s+16|0)|0)|0)+r|0:2+((t+_|0)-l|0)|0)+v|0,e),Z(n,E,v),i2(n,48,a,h,65536^e),Z(n,s+16|0,t=r-(s+16|0)|0),i2(n,48,A-((b=t)+(t=_-l|0)|0)|0,0,0),Z(n,l,t)}else i2(n,32,a,h=P+3|0,-65537&e),Z(n,F,P),t=32&b,Z(n,f!=f?t?1053:1061:t?1057:1065,3);return i2(n,32,a,h,8192^e),B=s+560|0,0|((0|a)>(0|h)?a:h)}function A0(n,f){var a=0,t=0,e=0,b=0,o=0,k=u(0),r=0,s=u(0),A=0,l=0,v=0;B=o=B+-64|0,i[n+72>>2]=f,a=e=i[f+8>>2];i:{f:{a:{for(;;){if(t=i[a+24>>2])break a;if((0|e)==(0|(a=i[a+8>>2])))break}for(i[o>>2]=i[e+4>>2],e=a=i[n- -64>>2];e=i[e+4>>2],(t=i[e>>2])&&!(0|M[i[a+16>>2]](i[a+12>>2],o,t)););if(t=i[e>>2],e=i[i[i[t+4>>2]+8>>2]>>2],r=i[e>>2],b=i[t>>2],G(i[i[b+4>>2]+16>>2],f,i[b+16>>2])==u(0)){if(k=c[f+28>>2],e=i[t>>2],a=i[e+16>>2],!(k!=c[a+28>>2]|c[a+32>>2]!=c[f+32>>2])){if(t=i[f+8>>2],i[o+40>>2]=0,i[o+44>>2]=0,i[o+32>>2]=0,i[o+36>>2]=0,f=i[287],i[o+24>>2]=i[286],i[o+28>>2]=f,f=i[285],i[o+16>>2]=i[284],i[o+20>>2]=f,i[o+32>>2]=i[a+12>>2],i[o+36>>2]=i[i[t+16>>2]+12>>2],c[o+52>>2]=c[a+16>>2],c[o+56>>2]=c[a+20>>2],c[o+60>>2]=c[a+24>>2],i[a+12>>2]=0,f=a+12|0,(0|(a=i[n+1736>>2]))==8?M[i[n+76>>2]](o+52|0,o+32|0,o+16|0,f):M[0|a](o+52|0,o+32|0,o+16|0,f,i[n+1896>>2]),i[f>>2]||(i[f>>2]=i[o+32>>2]),z(e,t))break f;break i}if(b=i[e+4>>2],a=i[b+16>>2],c[a+32>>2]!=c[f+32>>2]||k!=c[a+28>>2]){if(!n2(b))break i;if(w[t+15|0]){if(!$(i[e+8>>2]))break i;p[t+15|0]=0}if(!z(i[f+8>>2],e))break i;A0(n,f);break f}for(;t=i[i[i[t+4>>2]+4>>2]>>2],(0|a)==i[i[i[t>>2]+4>>2]+16>>2];);if(e=i[i[i[t+4>>2]+8>>2]>>2],r=i[e>>2],b=i[r+4>>2],a=i[b+8>>2],w[e+15|0]){if(i[r+24>>2]=0,h2(i[e+4>>2]),j(e),!$(b))break i;b=i[i[a+4>>2]+12>>2]}if(!z(i[f+8>>2],b))break i;A=i[b+8>>2],b=a,f=a,e=i[i[a+4>>2]+16>>2],k=c[e+28>>2],r=i[a+16>>2],k<(s=c[r+28>>2])|(c[e+32>>2]<=c[r+32>>2]?k==s:0)||(f=0),j2(n,t,A,b,f,1);break f}if(l=w[t+12|0],r=i[r+4>>2],A=i[r+16>>2],k=c[A+28>>2],v=i[i[b+4>>2]+16>>2],a=t,k<(s=c[v+28>>2])||k==s&&(a=t,c[A+32>>2]<=c[v+32>>2])||(a=e),w[a+15|0]||l){n:{if((0|a)==(0|t)){if(e=d2(i[i[f+8>>2]+4>>2],i[b+12>>2]))break n;break i}if(!(e=d2(i[i[r+8>>2]+4>>2],i[f+8>>2])))break i;e=i[e+4>>2]}if(w[a+15|0]){if($(i[a>>2])){i[a>>2]=e,p[a+15|0]=0,i[e+24>>2]=a,A0(n,f);break f}break i}if(!(a=H(16))||(i[a>>2]=e,t=S0(i[n- -64>>2],i[t+4>>2],a),i[a+4>>2]=t,!t))break i;p[a+13|0]=0,p[a+14|0]=0,p[a+15|0]=0,i[e+24>>2]=a,b=i[n+56>>2],e=i[i[a>>2]+28>>2]+i[i[i[t+4>>2]>>2]+8>>2]|0,i[a+8>>2]=e;n:{t:switch(b-100130|0){case 0:t=1&e;break n;case 1:t=(0|e)!=0;break n;case 2:t=(0|e)>0;break n;case 3:t=e>>>31|0;break n;case 4:break t;default:break n}t=e+1>>>0>2}p[a+12|0]=t,A0(n,f);break f}j2(a=n,t,n=i[f+8>>2],n,0,1);break f}for(f=i[i[t>>2]+16>>2];t=i[i[i[t+4>>2]+4>>2]>>2],a=i[t>>2],(0|f)==i[a+16>>2];);if(w[t+15|0]&&(!(f=d2(i[i[i[i[i[t+4>>2]+8>>2]>>2]>>2]+4>>2],i[a+12>>2]))||!$(i[t>>2])||(i[t>>2]=f,p[t+15|0]=0,i[f+24>>2]=t,!(t=i[i[i[t+4>>2]+4>>2]>>2]))))break i;if(f=i[i[i[t+4>>2]+8>>2]>>2],a=i[f>>2],f=a0(n,f,0),(0|a)!=(0|(e=i[f+8>>2])))j2(n,t,e,a,a,1);else{if(e=i[t>>2],A=i[i[i[t+4>>2]+8>>2]>>2],r=i[A>>2],i[i[e+4>>2]+16>>2]!=i[i[r+4>>2]+16>>2]&&o1(n,t),v=1,b=i[n+72>>2],k=c[b+28>>2],l=i[e+16>>2],!(k!=c[l+28>>2]|c[l+32>>2]!=c[b+32>>2])){if(!z(i[i[a+4>>2]+12>>2],e))break i;for(a=i[i[t>>2]+16>>2];t=i[i[i[t+4>>2]+4>>2]>>2],b=i[t>>2],(0|a)==i[b+16>>2];);if(w[t+15|0]&&(!(a=d2(i[i[i[i[i[t+4>>2]+8>>2]>>2]>>2]+4>>2],i[b+12>>2]))||!$(i[t>>2])||(i[t>>2]=a,p[t+15|0]=0,i[a+24>>2]=t,!(t=i[i[i[t+4>>2]+4>>2]>>2]))))break i;b=i[i[i[t+4>>2]+8>>2]>>2],a=i[b>>2],a0(n,b,A),b=i[n+72>>2],k=c[b+28>>2],v=0}a:{if(s=k,l=i[r+16>>2],s!=(k=c[l+28>>2])|c[l+32>>2]!=c[b+32>>2]){if(v)break a}else{if(!z(f,i[i[r+4>>2]+12>>2]))break i;f=a0(n,A,0)}j2(n,t,i[f+8>>2],a,a,1);break f}if(a=i[e+16>>2],s=c[a+28>>2],!(c[l+32>>2]<=c[a+32>>2])|k!=s&&!(s>k)||(e=i[i[r+4>>2]+12>>2]),!(f=d2(i[i[f+8>>2]+4>>2],e)))break i;j2(n,t,f,a=i[f+8>>2],a,0),p[i[i[f+4>>2]+24>>2]+15|0]=1,u1(n,t)}}return void(B=o- -64|0)}b2(n+1740|0,1),o2()}function b1(n){n|=0;var f=0,a=0,t=0,e=u(0),b=u(0),o=0,k=0,r=u(0),s=u(0),A=u(0),l=u(0),v=0,h=u(0),m=0,g=u(0),E=u(0),R=u(0),_=u(0),L=u(0),P=u(0),F=u(0),U=0,q=0,Y=u(0),k2=u(0),m2=0,n0=0,B0=0,j0=0,T0=0,F0=0,U0=0,O0=0;m=i[n+8>>2],f=B-80|0,b=c[n+16>>2],c[f+8>>2]=b,E=c[n+20>>2],c[f+12>>2]=E,R=c[n+24>>2],c[f+16>>2]=R;i:if(m2=b==u(0)&E==u(0)&R==u(0)){if(i[f+76>>2]=-42943038,i[f+68>>2]=-42943038,i[f+72>>2]=-42943038,i[f+64>>2]=2104540610,i[f+56>>2]=2104540610,i[f+60>>2]=2104540610,n0=(0|(v=i[m>>2]))==(0|m))g=u(-19999999867631625e21),r=u(19999999867631625e21),s=u(19999999867631625e21),h=u(-19999999867631625e21),A=u(19999999867631625e21),l=u(-19999999867631625e21);else{for(_=u(19999999867631625e21),L=u(-19999999867631625e21),P=u(-19999999867631625e21),F=u(19999999867631625e21),Y=u(-19999999867631625e21),k2=u(19999999867631625e21),g=u(-19999999867631625e21),r=u(19999999867631625e21),l=u(-19999999867631625e21),A=u(19999999867631625e21),h=u(-19999999867631625e21),s=u(19999999867631625e21),a=v;g=(t=(e=c[a+24>>2])>g)?e:g,L=t?e:L,r=(U=e>2])>l)?e:l,P=o?e:P,A=(q=e>2])>h)?e:h,Y=k?e:Y,B0=k?a:B0,s=(k=e>2])););i[f+20>>2]=j0,c[f+56>>2]=k2,c[f+68>>2]=Y,i[f+32>>2]=B0,c[f+60>>2]=F,i[f+24>>2]=O0,c[f+72>>2]=P,i[f+36>>2]=U0,c[f+64>>2]=_,i[f+28>>2]=F0,c[f+76>>2]=L,i[f+40>>2]=T0}if(a=2,t=(o=u(l-A)>u(h-s))<<2,t=u(g-r)>u(c[t+(f+68|0)>>2]-c[t+(f+56|0)>>2])?2:o,c[(o=t<<2)+(f+56|0)>>2]>=c[o+(f+68|0)>>2])i[f+8>>2]=0,i[f+12>>2]=0;else{if(a=i[(t<<=2)+(f+20|0)>>2],t=i[t+(f+32|0)>>2],L=c[t+16>>2],A=u(c[a+16>>2]-L),c[f+44>>2]=A,P=c[t+20>>2],l=u(c[a+20>>2]-P),c[f+48>>2]=l,F=c[t+24>>2],e=u(c[a+24>>2]-F),c[f+52>>2]=e,!n0){for(_=u(0),a=v;r=u(c[a+20>>2]-P),s=u(c[a+16>>2]-L),g=u(u(A*r)-u(l*s)),h=u(c[a+24>>2]-F),r=u(u(l*h)-u(e*r)),s=u(u(e*s)-u(A*h)),(h=u(u(g*g)+u(u(r*r)+u(s*s))))>_&&(R=g,E=s,_=h,b=r),(0|m)!=(0|(a=i[a>>2])););if(c[f+16>>2]=R,c[f+12>>2]=E,c[f+8>>2]=b,!(_<=u(0)))break i}i[f+16>>2]=0,i[f+8>>2]=0,i[f+12>>2]=0,a=(l(A>2],a=(e(b>2]=1065353216,R=c[f+16>>2],b=c[f+8>>2],E=c[f+12>>2]}else v=i[m>>2];if(t=(E(b>2],a=n+28|0,t=(R(b>2]=0,i[(k=(t+1>>>0)%3<<2)+a>>2]=1065353216,i[(t=(t+2>>>0)%3<<2)+a>>2]=0,i[(a=n+40|0)+o>>2]=0,f=c[o+(f+8|0)>>2]>u(0),c[a+k>>2]=u(f?-0:0),c[a+t>>2]=u(f?1:-1),!(t=(0|m)==(0|v)))for(a=v;f=i[a+20>>2],i[a+28>>2]=i[a+16>>2],i[a+32>>2]=f,(0|m)!=(0|(a=i[a>>2])););if(m2&&(0|(f=i[m+40>>2]))!=(0|(o=m+40|0))){for(b=u(0);;){if(k=i[f+8>>2],i[(a=k)+28>>2]>=1)for(;U=i[a+16>>2],q=i[i[a+4>>2]+16>>2],b=u(b+u(u(c[U+28>>2]-c[q+28>>2])*u(c[U+32>>2]+c[q+32>>2]))),(0|k)!=(0|(a=i[a+12>>2])););if((0|o)==(0|(f=i[f>>2])))break}if(b>2]=-c[v+32>>2],(0|(v=i[v>>2]))!=(0|m););c[n+40>>2]=-c[n+40>>2],c[n+44>>2]=-c[n+44>>2],c[n+48>>2]=-c[n+48>>2]}}}function j(n){var f=0,a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;i:if(n|=0){b=(t=n-8|0)+(n=-8&(f=i[n-4>>2]))|0;f:if(!(1&f)){if(!(3&f)||(t=t-(f=i[t>>2])|0)>>>0>2]))==3)return i[616]=n,i[b+4>>2]=-2&f,i[t+4>>2]=1|n,void(i[n+t>>2]=n)}else{if(f>>>0<=255){if(e=i[t+8>>2],f=f>>>3|0,(0|(a=i[t+12>>2]))==(0|e)){r=2456,s=i[614]&f2(f),i[r>>2]=s;break f}i[e+12>>2]=a,i[a+8>>2]=e;break f}if(k=i[t+24>>2],(0|t)==(0|(f=i[t+12>>2])))if((a=i[(e=t+20|0)>>2])||(a=i[(e=t+16|0)>>2])){for(;o=e,(a=i[(e=(f=a)+20|0)>>2])||(e=f+16|0,a=i[f+16>>2]););i[o>>2]=0}else f=0;else a=i[t+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;if(!k)break f;e=i[t+28>>2];a:{if(i[(a=2760+(e<<2)|0)>>2]==(0|t)){if(i[a>>2]=f,f)break a;r=2460,s=i[615]&f2(e),i[r>>2]=s;break f}if(i[k+(i[k+16>>2]==(0|t)?16:20)>>2]=f,!f)break f}if(i[f+24>>2]=k,(a=i[t+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),!(a=i[t+20>>2]))break f;i[f+20>>2]=a,i[a+24>>2]=f}}if(!(t>>>0>=b>>>0)&&1&(f=i[b+4>>2])){f:{if(!(2&f)){if(i[620]==(0|b)){if(i[620]=t,n=i[617]+n|0,i[617]=n,i[t+4>>2]=1|n,i[619]!=(0|t))break i;return i[616]=0,void(i[619]=0)}if(i[619]==(0|b))return i[619]=t,n=i[616]+n|0,i[616]=n,i[t+4>>2]=1|n,void(i[n+t>>2]=n);n=(-8&f)+n|0;a:if(f>>>0<=255){if(e=i[b+8>>2],f=f>>>3|0,(0|(a=i[b+12>>2]))==(0|e)){r=2456,s=i[614]&f2(f),i[r>>2]=s;break a}i[e+12>>2]=a,i[a+8>>2]=e}else{if(k=i[b+24>>2],(0|b)==(0|(f=i[b+12>>2])))if((a=i[(e=b+20|0)>>2])||(a=i[(e=b+16|0)>>2])){for(;o=e,(a=i[(e=(f=a)+20|0)>>2])||(e=f+16|0,a=i[f+16>>2]););i[o>>2]=0}else f=0;else a=i[b+8>>2],i[a+12>>2]=f,i[f+8>>2]=a;if(k){e=i[b+28>>2];n:{if(i[(a=2760+(e<<2)|0)>>2]==(0|b)){if(i[a>>2]=f,f)break n;r=2460,s=i[615]&f2(e),i[r>>2]=s;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=f,!f)break a}i[f+24>>2]=k,(a=i[b+16>>2])&&(i[f+16>>2]=a,i[a+24>>2]=f),(a=i[b+20>>2])&&(i[f+20>>2]=a,i[a+24>>2]=f)}}if(i[t+4>>2]=1|n,i[n+t>>2]=n,i[619]!=(0|t))break f;return void(i[616]=n)}i[b+4>>2]=-2&f,i[t+4>>2]=1|n,i[n+t>>2]=n}if(n>>>0<=255)return f=2496+((n=n>>>3|0)<<3)|0,(a=i[614])&(n=1<>2]:(i[614]=n|a,n=f),i[f+8>>2]=t,i[n+12>>2]=t,i[t+12>>2]=f,void(i[t+8>>2]=n);e=31,i[t+16>>2]=0,i[t+20>>2]=0,n>>>0<=16777215&&(f=n>>>8|0,f<<=o=f+1048320>>>16&8,e=28+((f=((f<<=e=f+520192>>>16&4)<<(a=f+245760>>>16&2)>>>15|0)-(a|e|o)|0)<<1|n>>>f+21&1)|0),i[t+28>>2]=e,o=2760+(e<<2)|0;f:{a:{if((a=i[615])&(f=1<>>1|0)|0),f=i[o>>2];;){if(a=f,(-8&i[f+4>>2])==(0|n))break a;if(f=e>>>29|0,e<<=1,!(f=i[16+(o=a+(4&f)|0)>>2]))break}i[o+16>>2]=t,i[t+24>>2]=a}else i[615]=f|a,i[o>>2]=t,i[t+24>>2]=o;i[t+12>>2]=t,i[t+8>>2]=t;break f}n=i[a+8>>2],i[n+12>>2]=t,i[a+8>>2]=t,i[t+24>>2]=0,i[t+12>>2]=a,i[t+8>>2]=n}n=i[622]-1|0,i[622]=n||-1}}}function C4(n,f){f|=0;var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0,g=0,E=0,R=0,_=0;if(B=k=B-16|0,i[84+(n|=0)>>2]=0,(0|(s=i[f+40>>2]))!=(0|(m=f+40|0)))for(f=s;p[f+20|0]=0,(0|m)!=(0|(f=i[f>>2])););if((0|s)!=(0|m)){for(;;){if(!(w[s+20|0]|!w[s+21|0])){if(o=i[s+8>>2],w[n+80|0])f=1,a=1;else{e=0,t=0,f=0,b=i[(a=o)+20>>2];i:if(w[b+21|0])for(;;){if(w[(f=b)+20|0]){f=t;break i}if(p[f+20|0]=1,i[f+16>>2]=t,e=e+1|0,t=f,a=i[a+8>>2],b=i[a+20>>2],!w[b+21|0])break}t=i[o+4>>2],b=i[t+20>>2];i:{f:if(!w[b+21|0]|w[b+20|0]){if(E=o,!f)break i}else for(a=f;;){if(p[(f=b)+20|0]=1,i[f+16>>2]=a,e=e+1|0,E=i[t+12>>2],t=i[E+4>>2],b=i[t+20>>2],!w[b+21|0])break f;if(a=f,w[b+20|0])break}for(;p[f+20|0]=0,f=i[f+16>>2];);}R=(0|e)>1,b=0,a=0,f=0,v=i[o+12>>2],t=i[(r=v)+20>>2];i:if(w[t+21|0])for(;;){if(w[(f=t)+20|0]){f=a;break i}if(p[f+20|0]=1,i[f+16>>2]=a,b=b+1|0,a=f,r=i[r+8>>2],t=i[r+20>>2],!w[t+21|0])break}g=R?e:1,t=i[v+4>>2],e=i[t+20>>2];i:{f:if(!w[e+21|0]|w[e+20|0]){if(!f)break i}else for(a=f;;){if(p[(f=e)+20|0]=1,i[f+16>>2]=a,b=b+1|0,v=i[t+12>>2],t=i[v+4>>2],e=i[t+20>>2],!w[e+21|0])break f;if(a=f,w[e+20|0])break}for(;p[f+20|0]=0,f=i[f+16>>2];);}_=(0|b)>(0|g),e=0,a=0,f=0,h=i[i[o+8>>2]+4>>2],t=i[(r=h)+20>>2];i:if(w[t+21|0])for(;;){if(w[(f=t)+20|0]){f=a;break i}if(p[f+20|0]=1,i[f+16>>2]=a,e=e+1|0,a=f,r=i[r+8>>2],t=i[r+20>>2],!w[t+21|0])break}A=_?b:g,t=i[h+4>>2],b=i[t+20>>2];i:{f:if(!w[b+21|0]|w[b+20|0]){if(!f)break i}else for(a=f;;){if(p[(f=b)+20|0]=1,i[f+16>>2]=a,e=e+1|0,h=i[t+12>>2],t=i[h+4>>2],b=i[t+20>>2],!w[b+21|0])break f;if(a=f,w[b+20|0])break}for(;p[f+20|0]=0,f=i[f+16>>2];);}R0(k,o),r=i[k+8>>2],g=i[k+4>>2],l=i[k>>2],R0(k,i[o+12>>2]),b=i[k+8>>2],t=i[k+4>>2],a=i[k>>2],R0(k,i[i[o+8>>2]+4>>2]),f=e,(0|(f=(l=(0|(f=(A=(0|(f=(e=(0|e)>(0|A))?f:A))<(0|l))?l:f))<(0|a))?a:f))>=(0|(a=i[k>>2]))?(o=l?t:A?g:e?h:_?v:R?E:o,a=l?b:A?r:e||R|_?2:1):(o=i[k+4>>2],f=a,a=i[k+8>>2])}M[0|a](n,o,f)}if((0|m)==(0|(s=i[s>>2])))break}if(e=i[n+84>>2]){for((0|(f=i[n+1716>>2]))==3?M[i[n+88>>2]](4):M[0|f](4,i[n+1896>>2]),b=-1;;){for(f=i[e+8>>2];w[n+80|0]&&(0|(a=!(o=w[i[i[f+4>>2]+20>>2]+21|0])))!=(0|b)&&((0|(t=i[n+1720>>2]))==4?M[i[n+92>>2]](!o):M[0|t](!o,i[n+1896>>2]),b=a),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[e+8>>2];);if(!(e=i[e+16>>2]))break}(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2]),i[n+84>>2]=0}}B=k+16|0}function k1(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;b=n+f|0;i:{f:if(!(1&(a=i[n+4>>2]))){if(!(3&a))break i;f=(a=i[n>>2])+f|0;a:{if((0|(n=n-a|0))!=i[619]){if(a>>>0<=255){if(e=i[n+8>>2],a=a>>>3|0,(0|(t=i[n+12>>2]))!=(0|e))break a;r=2456,s=i[614]&f2(a),i[r>>2]=s;break f}if(k=i[n+24>>2],(0|(a=i[n+12>>2]))==(0|n))if((t=i[(e=n+20|0)>>2])||(t=i[(e=n+16|0)>>2])){for(;o=e,(t=i[(e=(a=t)+20|0)>>2])||(e=a+16|0,t=i[a+16>>2]););i[o>>2]=0}else a=0;else t=i[n+8>>2],i[t+12>>2]=a,i[a+8>>2]=t;if(!k)break f;e=i[n+28>>2];n:{if(i[(t=2760+(e<<2)|0)>>2]==(0|n)){if(i[t>>2]=a,a)break n;r=2460,s=i[615]&f2(e),i[r>>2]=s;break f}if(i[k+(i[k+16>>2]==(0|n)?16:20)>>2]=a,!a)break f}if(i[a+24>>2]=k,(t=i[n+16>>2])&&(i[a+16>>2]=t,i[t+24>>2]=a),!(t=i[n+20>>2]))break f;i[a+20>>2]=t,i[t+24>>2]=a;break f}if((3&(a=i[b+4>>2]))!=3)break f;return i[616]=f,i[b+4>>2]=-2&a,i[n+4>>2]=1|f,void(i[b>>2]=f)}i[e+12>>2]=t,i[t+8>>2]=e}f:{if(!(2&(a=i[b+4>>2]))){if(i[620]==(0|b)){if(i[620]=n,f=i[617]+f|0,i[617]=f,i[n+4>>2]=1|f,i[619]!=(0|n))break i;return i[616]=0,void(i[619]=0)}if(i[619]==(0|b))return i[619]=n,f=i[616]+f|0,i[616]=f,i[n+4>>2]=1|f,void(i[n+f>>2]=f);f=(-8&a)+f|0;a:if(a>>>0<=255){if(e=i[b+8>>2],a=a>>>3|0,(0|(t=i[b+12>>2]))==(0|e)){r=2456,s=i[614]&f2(a),i[r>>2]=s;break a}i[e+12>>2]=t,i[t+8>>2]=e}else{if(k=i[b+24>>2],(0|b)==(0|(a=i[b+12>>2])))if((e=i[(t=b+20|0)>>2])||(e=i[(t=b+16|0)>>2])){for(;o=t,(e=i[(t=(a=e)+20|0)>>2])||(t=a+16|0,e=i[a+16>>2]););i[o>>2]=0}else a=0;else t=i[b+8>>2],i[t+12>>2]=a,i[a+8>>2]=t;if(k){e=i[b+28>>2];n:{if(i[(t=2760+(e<<2)|0)>>2]==(0|b)){if(i[t>>2]=a,a)break n;r=2460,s=i[615]&f2(e),i[r>>2]=s;break a}if(i[k+(i[k+16>>2]==(0|b)?16:20)>>2]=a,!a)break a}i[a+24>>2]=k,(t=i[b+16>>2])&&(i[a+16>>2]=t,i[t+24>>2]=a),(t=i[b+20>>2])&&(i[a+20>>2]=t,i[t+24>>2]=a)}}if(i[n+4>>2]=1|f,i[n+f>>2]=f,i[619]!=(0|n))break f;return void(i[616]=f)}i[b+4>>2]=-2&a,i[n+4>>2]=1|f,i[n+f>>2]=f}if(f>>>0<=255)return a=2496+((f=f>>>3|0)<<3)|0,(t=i[614])&(f=1<>2]:(i[614]=f|t,f=a),i[a+8>>2]=n,i[f+12>>2]=n,i[n+12>>2]=a,void(i[n+8>>2]=f);e=31,i[n+16>>2]=0,i[n+20>>2]=0,f>>>0<=16777215&&(a=f>>>8|0,a<<=o=a+1048320>>>16&8,e=28+((a=((a<<=e=a+520192>>>16&4)<<(t=a+245760>>>16&2)>>>15|0)-(t|e|o)|0)<<1|f>>>a+21&1)|0),i[n+28>>2]=e,o=2760+(e<<2)|0;f:{if((t=i[615])&(a=1<>>1|0)|0),a=i[o>>2];;){if(t=a,(-8&i[a+4>>2])==(0|f))break f;if(a=e>>>29|0,e<<=1,!(a=i[16+(o=t+(4&a)|0)>>2]))break}i[o+16>>2]=n,i[n+24>>2]=t}else i[615]=a|t,i[o>>2]=n,i[n+24>>2]=o;return i[n+12>>2]=n,void(i[n+8>>2]=n)}f=i[t+8>>2],i[f+12>>2]=n,i[t+8>>2]=n,i[n+24>>2]=0,i[n+12>>2]=t,i[n+8>>2]=f}}function E0(n,f){var a=0,t=0,e=0,b=u(0),o=0,k=0,r=u(0),s=0,A=0,l=0,v=0,h=0,m=0,g=0,E=0,R=0,_=0,L=0,P=0,F=0,U=0;B=e=B-48|0;i:{l=i[f>>2],k=i[l+16>>2],r=c[k+28>>2],a=i[i[i[f+4>>2]+8>>2]>>2],h=i[a>>2],t=i[h+16>>2],b=c[t+28>>2];f:{if(!(!(c[k+32>>2]<=c[t+32>>2])|r!=b)||r>2]+16>>2],k,t)>u(0))break f;if(k=i[l+16>>2],t=i[h+16>>2],c[k+32>>2]!=c[t+32>>2]||c[k+28>>2]!=c[t+28>>2]){if(!n2(i[h+4>>2])||!z(l,i[i[h+4>>2]+12>>2]))break i;_=1,p[a+14|0]=1,p[f+14|0]=1;break f}if(_=1,(0|t)==(0|k))break f;if(o=i[n+68>>2],(0|(f=i[k+36>>2]))>=0){if(m=i[o>>2],s=i[m>>2],k=f,A=i[m+4>>2],f=i[4+(L=A+(f<<3)|0)>>2],R=i[m+8>>2],E=i[s+(R<<2)>>2],i[s+(f<<2)>>2]=E,i[4+(P=(E<<3)+A|0)>>2]=f,F=R-1|0,i[m+8>>2]=F,(0|f)<(0|R)){a:{if((0|f)<2||(a=i[(i[s+(f<<1&-4)>>2]<<3)+A>>2],b=c[a+28>>2],g=i[(E<<3)+A>>2],b<(r=c[g+28>>2])||!(!(c[a+32>>2]<=c[g+32>>2])|r!=b)))for(U=(E<<3)+A|0;;){if((0|F)<=(0|(a=f<<1))||(v=i[(i[s+((t=1|a)<<2)>>2]<<3)+A>>2],r=c[v+28>>2],o=i[(i[s+(a<<2)>>2]<<3)+A>>2],b=c[o+28>>2],!(c[v+32>>2]<=c[o+32>>2])|r!=b&&!(r=(0|R)){a=f;break a}if(g=i[U>>2],r=c[g+28>>2],v=i[s+(a<<2)>>2],t=i[(o=(v<<3)+A|0)>>2],r<(b=c[t+28>>2])){a=f;break a}if(!(!(c[g+32>>2]<=c[t+32>>2])|r!=b)){a=f;break a}i[s+(f<<2)>>2]=v,i[o+4>>2]=f,f=a}for(;;){if(v=i[s+((a=f>>1)<<2)>>2],t=i[(o=(v<<3)+A|0)>>2],(b=c[t+28>>2])>2]<=c[g+32>>2])|r!=b)){a=f;break a}if(i[s+(f<<2)>>2]=v,i[o+4>>2]=f,!((f=a)>>>0>1))break}}i[s+(a<<2)>>2]=E,i[P+4>>2]=a}i[L>>2]=0,i[L+4>>2]=i[m+16>>2],i[m+16>>2]=k}else{i[i[o+4>>2]+((-1^f)<<2)>>2]=0;a:if(!((0|(f=i[o+12>>2]))<1))for(k=i[o+8>>2];;){if(i[i[k+((a=f-1|0)<<2)>>2]>>2])break a;if(i[o+12>>2]=a,t=(0|f)>1,f=a,!t)break}}if(a=i[i[h+4>>2]+12>>2],i[e+24>>2]=0,i[e+28>>2]=0,i[e+16>>2]=0,i[e+20>>2]=0,f=i[287],i[e+8>>2]=i[286],i[e+12>>2]=f,f=i[285],i[e>>2]=i[284],i[e+4>>2]=f,f=i[a+16>>2],i[e+16>>2]=i[f+12>>2],i[e+20>>2]=i[i[l+16>>2]+12>>2],c[e+36>>2]=c[f+16>>2],c[e+40>>2]=c[f+20>>2],c[e+44>>2]=c[f+24>>2],i[f+12>>2]=0,t=f+12|0,(0|(f=i[n+1736>>2]))==8?M[i[n+76>>2]](e+36|0,e+16|0,e,t):M[0|f](e+36|0,e+16|0,e,t,i[n+1896>>2]),i[t>>2]||(i[t>>2]=i[e+16>>2]),z(a,l))break f;break i}if(!(G(i[i[l+4>>2]+16>>2],t,k)>2]+4>>2]>>2]+14|0]=1,!n2(i[l+4>>2])||!z(i[i[h+4>>2]+12>>2],l)))break i}return B=e+48|0,_}b2(n+1740|0,1),o2()}function E4(n){n|=0;var f=0,a=0,t=u(0),e=u(0),b=u(0),o=u(0),k=u(0),r=u(0),s=0,A=0,l=0,v=u(0),h=u(0),m=0,g=u(0),E=u(0),R=u(0),_=u(0),L=u(0),P=0,F=0,U=u(0),q=u(0),Y=u(0);i:{f:if(!((0|(l=i[n+112>>2]))<3)){if(s=(F=n+116|0)+(l<<4)|0,o=c[n+24>>2],k=c[n+16>>2],r=c[n+20>>2],o!=u(0)||k!=u(0)|r!=u(0))g=c[n+124>>2],b=u(c[n+140>>2]-g),E=c[n+120>>2],v=u(c[n+136>>2]-E),R=c[n+116>>2],h=u(c[n+132>>2]-R);else{for(a=n+148|0,o=u(0),r=u(0),k=u(0),f=n+132|0,R=c[n+116>>2],t=h=u(c[f>>2]-R),E=c[n+120>>2],e=v=u(c[n+136>>2]-E),g=c[n+124>>2],_=b=u(c[n+140>>2]-g);L=u(c[f+20>>2]-E),U=u(c[a>>2]-R),q=u(u(t*L)-u(e*U)),Y=u(c[f+24>>2]-g),e=u(u(e*Y)-u(_*L)),t=u(u(_*U)-u(t*Y)),u(u(o*q)+u(u(k*e)+u(r*t)))>=u(0)?(r=u(r+t),k=u(k+e),o=u(o+q)):(r=u(r-t),k=u(k-e),o=u(o-q)),t=U,e=L,_=Y,s>>>0>(a=(f=a)+16|0)>>>0;);if((0|l)<3)break f}for(a=n+148|0,f=m=n+132|0;;){t=b,b=v,P=f,e=h,v=u(c[f+20>>2]-E),h=u(c[(f=a)>>2]-R),L=u(o*u(u(e*v)-u(b*h))),_=b,b=u(c[P+24>>2]-g);a:if((t=u(L+u(u(k*u(u(_*b)-u(t*v)))+u(r*u(u(t*h)-u(e*b))))))!=u(0)){if(t>u(0)){if(a=0,P=(0|A)<0,A=1,!P)break a;break i}if(a=0,P=(0|A)>0,A=-1,P)break i}if(!(s>>>0>(a=f+16|0)>>>0))break}switch(a=0,0|A){case 2:break i;case 0:break f}a=1;a:{n:switch(i[n+56>>2]-100132|0){case 0:if((0|A)>=0)break a;break f;case 2:break i;case 1:break n;default:break a}if((0|A)>0)break f}(0|(f=i[n+1716>>2]))==3?M[i[n+88>>2]](w[n+81|0]?2:(0|l)<4?4:6):M[0|f](w[n+81|0]?2:(0|l)<4?4:6,i[n+1896>>2]),(0|(f=i[n+1724>>2]))==5?M[i[n+96>>2]](i[n+128>>2]):M[0|f](i[n+128>>2],i[n+1896>>2]);a:if((0|A)<=0){if(F>>>0>=(f=s-16|0)>>>0)break a;for(;(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[s-4>>2]):M[0|a](i[s-4>>2],i[n+1896>>2]),s=f,F>>>0<(f=f-16|0)>>>0;);}else if(!((0|l)<2))for(;(0|(f=i[n+1724>>2]))==5?M[i[n+96>>2]](i[m+12>>2]):M[0|f](i[m+12>>2],i[n+1896>>2]),(m=m+16|0)>>>0>>0;);(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}a=1}return 0|a}function l0(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0,A=0,l=0,v=0,h=0,m=0;if(!n)return H(f);if(f>>>0>=4294967232)return i[613]=48,0;o=f>>>0<11?16:f+11&-8,e=-8&(s=i[4+(b=n-8|0)>>2]);i:if(3&s){k=e+b|0;f:if(e>>>0>=o>>>0){if((t=e-o|0)>>>0<16)break f;i[b+4>>2]=1&s|o|2,i[4+(a=b+o|0)>>2]=3|t,i[k+4>>2]=1|i[k+4>>2],k1(a,t)}else if(i[620]!=(0|k))if(i[619]!=(0|k)){if(2&(t=i[k+4>>2])||(A=e+(-8&t)|0)>>>0>>0)break i;v=A-o|0;a:if(t>>>0<=255){if(e=i[k+8>>2],a=t>>>3|0,(0|(t=i[k+12>>2]))==(0|e)){h=2456,m=i[614]&f2(a),i[h>>2]=m;break a}i[e+12>>2]=t,i[t+8>>2]=e}else{if(l=i[k+24>>2],(0|(r=i[k+12>>2]))==(0|k))if((a=i[(e=k+20|0)>>2])||(a=i[(e=k+16|0)>>2])){for(;t=e,r=a,(a=i[(e=a+20|0)>>2])||(e=r+16|0,a=i[r+16>>2]););i[t>>2]=0}else r=0;else a=i[k+8>>2],i[a+12>>2]=r,i[r+8>>2]=a;if(l){t=i[k+28>>2];n:{if(i[(a=2760+(t<<2)|0)>>2]==(0|k)){if(i[a>>2]=r,r)break n;h=2460,m=i[615]&f2(t),i[h>>2]=m;break a}if(i[(i[l+16>>2]==(0|k)?16:20)+l>>2]=r,!r)break a}i[r+24>>2]=l,(a=i[k+16>>2])&&(i[r+16>>2]=a,i[a+24>>2]=r),(a=i[k+20>>2])&&(i[r+20>>2]=a,i[a+24>>2]=r)}}v>>>0<=15?(i[b+4>>2]=1&s|A|2,i[4+(a=b+A|0)>>2]=1|i[a+4>>2]):(i[b+4>>2]=1&s|o|2,i[4+(t=b+o|0)>>2]=3|v,i[4+(a=b+A|0)>>2]=1|i[a+4>>2],k1(t,v))}else{if((t=e+i[616]|0)>>>0>>0)break i;(a=t-o|0)>>>0>=16?(i[b+4>>2]=1&s|o|2,i[4+(e=b+o|0)>>2]=1|a,i[(t=t+b|0)>>2]=a,i[t+4>>2]=-2&i[t+4>>2]):(i[b+4>>2]=t|1&s|2,i[4+(a=t+b|0)>>2]=1|i[a+4>>2],a=0,e=0),i[619]=e,i[616]=a}else{if((e=e+i[617]|0)>>>0<=o>>>0)break i;i[b+4>>2]=1&s|o|2,a=e-o|0,i[4+(t=b+o|0)>>2]=1|a,i[617]=a,i[620]=t}a=b}else{if(o>>>0<256||e>>>0>=o+4>>>0&&(a=b,e-o>>>0<=i[734]<<1>>>0))break i;a=0}return a?a+8|0:(b=H(f))?(c1(b,n,f>>>0>(a=(3&(a=i[n-4>>2])?-4:-8)+(-8&a)|0)>>>0?a:f),j(n),b):0}function u1(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=u(0),s=0,A=u(0);for(t=i[i[i[f+4>>2]+8>>2]>>2];;){i:{if(w[t+14|0])for(;t=i[i[i[(f=t)+4>>2]+8>>2]>>2],w[t+14|0];);f:{a:{n:{t:{if(w[f+14|0])a=f;else if(!(a=i[i[i[f+4>>2]+4>>2]>>2])||(t=f,!w[a+14|0]))break t;p[a+14|0]=0,e=i[a>>2],f=i[i[e+4>>2]+16>>2],o=i[t>>2];b:if((0|f)!=i[i[o+4>>2]+16>>2]){r=c[f+28>>2],s=i[i[i[a+4>>2]+8>>2]>>2],b=i[s>>2],k=i[i[b+4>>2]+16>>2],A=c[k+28>>2];e:{if(!(!(c[f+32>>2]<=c[k+32>>2])|r!=A)||r>2])>2]+4>>2]>>2]+14|0]=1,!(f=n2(e)))break f;if(z(i[b+4>>2],f))break e;break i}if(G(k,f,i[b+16>>2])>u(0)){f=a;break b}if(p[s+14|0]=1,p[a+14|0]=1,!(f=n2(b))||!z(i[e+12>>2],i[b+4>>2]))break i;f=i[f+4>>2]}if(p[i[f+20>>2]+21|0]=w[a+12|0],w[t+15|0]){if(i[i[t>>2]+24>>2]=0,h2(i[t+4>>2]),j(t),!$(o))break i;t=i[i[i[a+4>>2]+8>>2]>>2],o=i[t>>2],f=a}else if(w[a+15|0]){if(i[i[a>>2]+24>>2]=0,h2(i[a+4>>2]),j(a),!$(e))break i;f=i[i[i[t+4>>2]+4>>2]>>2],e=i[f>>2]}else f=a}else f=a;if(i[e+16>>2]==i[o+16>>2])break a;if(a=i[i[e+4>>2]+16>>2],b=i[i[o+4>>2]+16>>2],w[t+15|0]|w[f+15|0]|(0|a)==(0|b)||(k=a,(0|(a=i[n+72>>2]))!=(0|b)&&(0|k)!=(0|a)))break n;if(!o1(n,f))break a}return}E0(n,f)}if(i[e+16>>2]!=i[o+16>>2]||(b=i[e+4>>2],a=i[o+4>>2],i[b+16>>2]!=i[a+16>>2]))continue;if(i[o+28>>2]=i[o+28>>2]+i[e+28>>2],i[a+28>>2]=i[a+28>>2]+i[b+28>>2],i[i[f>>2]+24>>2]=0,h2(i[f+4>>2]),j(f),!$(e))break i;f=i[i[i[t+4>>2]+4>>2]>>2];continue}}break}b2(n+1740|0,1),o2()}function R4(n){n|=0;var f=0,a=0,t=0,e=u(0),b=u(0),o=0,k=0,r=0,s=0;if((0|(f=i[n+40>>2]))!=(0|(r=n+40|0)))for(;;){if(n=i[f>>2],w[f+21|0]){for(f=f+8|0;f=i[f>>2],a=i[i[f+4>>2]+16>>2],e=c[a+28>>2],t=i[f+16>>2],b=c[t+28>>2],!(!(c[a+32>>2]<=c[t+32>>2])|e!=b)||e>2]+4|0;for(;!(!(c[t+32>>2]<=c[a+32>>2])|e!=b)||e>b;)f=i[f+12>>2],t=i[f+16>>2],b=c[t+28>>2],a=i[i[f+4>>2]+16>>2],e=c[a+28>>2];i:{f:if((0|(t=i[i[f+8>>2]+4>>2]))!=i[f+12>>2])for(;;){if(o=i[t+16>>2],b=c[o+28>>2],!(c[a+32>>2]<=c[o+32>>2])|e!=b&&!(b>e)){a:if(i[t+12>>2]!=(0|f))for(;;){if(a=i[i[f+8>>2]+4>>2],o=i[a+16>>2],e=c[o+28>>2],k=i[i[a+4>>2]+16>>2],!(e<(b=c[k+28>>2])|(c[o+32>>2]<=c[k+32>>2]?e==b:0))){if(!(G(i[i[f+4>>2]+16>>2],i[f+16>>2],o)>=u(0)))break a;a=i[i[f+8>>2]+4>>2]}if(f=d2(f,a),a=0,!f)break i;if((0|(f=i[f+4>>2]))==i[t+12>>2])break}f=i[f+12>>2]}else{a:if((0|(a=i[t+12>>2]))!=(0|f))for(o=t+12|0;;){if(k=i[i[a+4>>2]+16>>2],e=c[k+28>>2],s=i[a+16>>2],!(e<(b=c[s+28>>2])|(c[k+32>>2]<=c[s+32>>2]?e==b:0))){if(!(G(i[t+16>>2],i[i[t+4>>2]+16>>2],k)<=u(0)))break a;a=i[o>>2]}if(t=d2(a,t),a=0,!t)break i;if(o=(t=i[t+4>>2])+12|0,(0|(a=i[t+12>>2]))==(0|f))break}t=i[i[t+8>>2]+4>>2]}if(i[f+12>>2]==(0|t))break f;a=i[i[f+4>>2]+16>>2],e=c[a+28>>2]}if(a=i[t+12>>2],i[a+12>>2]!=(0|f))for(;;){if(t=d2(a,t),a=0,!t)break i;if(t=i[t+4>>2],a=i[t+12>>2],i[a+12>>2]==(0|f))break}a=1}if(!a)return 0}if((0|r)==(0|(f=n)))break}return 1}function $(n){var f=0,a=0,t=0,e=0,b=0,o=0;if(e=i[n+4>>2],(0|(o=i[e+20>>2]))!=(0|(a=i[n+20>>2]))){for(f=t=i[a+8>>2];i[f+20>>2]=o,(0|t)!=(0|(f=i[f+12>>2])););f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,j(a)}if((0|(t=i[n+8>>2]))!=(0|n)){if(b=i[n+4>>2],f=i[b+12>>2],i[i[b+20>>2]+8>>2]=f,i[i[n+16>>2]+8>>2]=t,b=i[f+8>>2],i[i[t+4>>2]+12>>2]=f,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[f+8>>2]=t,(0|a)==(0|o)){if(!(a=H(24)))return 0;for(f=i[n+20>>2],t=i[f+4>>2],i[a+4>>2]=t,i[t>>2]=a,i[a>>2]=f,i[f+4>>2]=a,i[a+12>>2]=0,i[a+16>>2]=0,i[a+8>>2]=n,p[a+20|0]=0,p[a+21|0]=w[f+21|0],f=n;i[f+20>>2]=a,(0|(f=i[f+12>>2]))!=(0|n););}}else{for(a=i[n+16>>2],f=t=i[a+8>>2];i[f+16>>2]=0,(0|t)!=(0|(f=i[f+8>>2])););f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,j(a)}if((0|(f=i[e+8>>2]))!=(0|e))a=i[i[e+4>>2]+12>>2],i[i[n+20>>2]+8>>2]=a,i[i[e+16>>2]+8>>2]=f,t=i[a+8>>2],i[i[f+4>>2]+12>>2]=a,i[i[t+4>>2]+12>>2]=e,i[e+8>>2]=t,i[a+8>>2]=f;else{for(a=i[e+16>>2],f=t=i[a+8>>2];i[f+16>>2]=0,(0|t)!=(0|(f=i[f+8>>2])););for(f=i[a>>2],t=i[a+4>>2],i[f+4>>2]=t,i[t>>2]=f,j(a),a=i[e+20>>2],f=e=i[a+8>>2];i[f+20>>2]=0,(0|e)!=(0|(f=i[f+12>>2])););f=i[a>>2],e=i[a+4>>2],i[f+4>>2]=e,i[e>>2]=f,j(a)}return f=i[n+4>>2],f=i[(n=n>>>0>f>>>0?f:n)>>2],a=i[i[n+4>>2]>>2],i[i[f+4>>2]>>2]=a,i[i[a+4>>2]>>2]=f,j(n),1}function d2(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;if(t=0,a=H(64)){if(k=i[n+4>>2],b=i[(t=n>>>0>k>>>0?k:n)+4>>2],e=i[b>>2],i[a+32>>2]=e,i[i[e+4>>2]>>2]=a,i[a>>2]=t,o=a+32|0,i[b>>2]=o,i[a+16>>2]=0,i[a+20>>2]=0,i[a+12>>2]=o,i[a+4>>2]=o,i[a+24>>2]=0,i[a+28>>2]=0,i[a+48>>2]=0,i[a+52>>2]=0,i[a+44>>2]=a,i[a+40>>2]=o,i[a+36>>2]=a,i[a+56>>2]=0,i[a+60>>2]=0,i[a+8>>2]=a,(0|(r=i[n+20>>2]))!=(0|(b=i[f+20>>2]))){for(t=e=i[b+8>>2];i[t+20>>2]=r,(0|e)!=(0|(t=i[t+12>>2])););t=i[b>>2],e=i[b+4>>2],i[t+4>>2]=e,i[e>>2]=t,j(b),k=i[n+4>>2],e=i[a+8>>2],t=i[n+20>>2]}else e=a,t=b;if(n=i[n+12>>2],s=i[n+8>>2],i[i[e+4>>2]+12>>2]=n,i[i[s+4>>2]+12>>2]=a,i[a+8>>2]=s,i[n+8>>2]=e,n=i[f+8>>2],e=i[a+40>>2],i[i[e+4>>2]+12>>2]=f,i[i[n+4>>2]+12>>2]=o,i[a+40>>2]=n,i[f+8>>2]=e,i[a+16>>2]=i[k+16>>2],f=i[f+16>>2],n=t,i[a+52>>2]=n,i[a+48>>2]=f,i[a+20>>2]=n,i[n+8>>2]=o,t=a,(0|b)==(0|r)&&(t=0,f=H(24))){for(t=i[n+4>>2],i[f+4>>2]=t,i[t>>2]=f,i[f>>2]=n,i[n+4>>2]=f,i[f+12>>2]=0,i[f+16>>2]=0,i[f+8>>2]=a,p[f+20|0]=0,p[f+21|0]=w[n+21|0],t=a;i[t+20>>2]=f,(0|(t=i[t+12>>2]))!=(0|a););t=a}}return t}function c1(n,f,a){var t=0,e=0;if(a>>>0>=512)m4(0|n,0|f,0|a);else{t=n+a|0;i:if(3&(n^f))if(t>>>0<4)a=n;else if((e=t-4|0)>>>0>>0)a=n;else for(a=n;p[0|a]=w[0|f],p[a+1|0]=w[f+1|0],p[a+2|0]=w[f+2|0],p[a+3|0]=w[f+3|0],f=f+4|0,e>>>0>=(a=a+4|0)>>>0;);else{f:if(3&n)if((0|a)<1)a=n;else for(a=n;;){if(p[0|a]=w[0|f],f=f+1|0,!(3&(a=a+1|0)))break f;if(!(a>>>0>>0))break}else a=n;if(!((n=-4&t)>>>0<64||(e=n+-64|0)>>>0
>>0))for(;i[a>>2]=i[f>>2],i[a+4>>2]=i[f+4>>2],i[a+8>>2]=i[f+8>>2],i[a+12>>2]=i[f+12>>2],i[a+16>>2]=i[f+16>>2],i[a+20>>2]=i[f+20>>2],i[a+24>>2]=i[f+24>>2],i[a+28>>2]=i[f+28>>2],i[a+32>>2]=i[f+32>>2],i[a+36>>2]=i[f+36>>2],i[a+40>>2]=i[f+40>>2],i[a+44>>2]=i[f+44>>2],i[a+48>>2]=i[f+48>>2],i[a+52>>2]=i[f+52>>2],i[a+56>>2]=i[f+56>>2],i[a+60>>2]=i[f+60>>2],f=f- -64|0,e>>>0>=(a=a- -64|0)>>>0;);if(n>>>0<=a>>>0)break i;for(;i[a>>2]=i[f>>2],f=f+4|0,n>>>0>(a=a+4|0)>>>0;);}if(a>>>0>>0)for(;p[0|a]=w[0|f],f=f+1|0,(0|t)!=(0|(a=a+1|0)););}}function n2(n){var f=0,a=0,t=0,e=0,b=0,o=0;if(b=n|=0,n=0,(f=H(64))&&(t=i[b+4>>2],e=i[(a=t>>>0>>0?t:b)+4>>2],o=i[e>>2],i[f+32>>2]=o,i[i[o+4>>2]>>2]=f,i[f>>2]=a,a=f+32|0,i[e>>2]=a,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=a,i[f+4>>2]=a,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+40>>2]=a,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,e=i[b+12>>2],o=i[e+8>>2],i[f+44>>2]=e,i[i[o+4>>2]+12>>2]=f,i[f+8>>2]=o,i[e+8>>2]=f,e=i[t+16>>2],i[f+16>>2]=e,t=H(40))){for(n=i[e+4>>2],i[t+4>>2]=n,i[n>>2]=t,i[t>>2]=e,i[e+4>>2]=t,i[t+12>>2]=0,i[t+8>>2]=a,n=a;i[n+16>>2]=t,(0|a)!=(0|(n=i[n+8>>2])););n=i[b+20>>2],i[f+20>>2]=n,i[f+52>>2]=n,n=f}return n?(f=i[n+4>>2],n=i[b+4>>2],a=i[i[n+4>>2]+12>>2],t=i[a+8>>2],e=i[n+8>>2],i[i[e+4>>2]+12>>2]=a,i[i[t+4>>2]+12>>2]=n,i[n+8>>2]=t,i[a+8>>2]=e,a=i[f+8>>2],t=i[n+8>>2],i[i[t+4>>2]+12>>2]=f,i[i[a+4>>2]+12>>2]=n,i[n+8>>2]=a,i[f+8>>2]=t,i[n+16>>2]=i[f+16>>2],a=i[f+4>>2],i[i[a+16>>2]+8>>2]=a,i[a+20>>2]=i[n+20>>2],i[f+28>>2]=i[b+28>>2],i[a+28>>2]=i[n+28>>2],0|f):0}function j2(n,f,a,t,e,b){var o=0,k=0,r=0,s=0,A=0;s=f+4|0,r=n- -64|0;i:{for(;;){if(k=i[a+4>>2],!(o=H(16))||(i[o>>2]=k,A=S0(i[r>>2],i[f+4>>2],o),i[o+4>>2]=A,!A))break i;if(p[o+13|0]=0,p[o+14|0]=0,p[o+15|0]=0,i[k+24>>2]=o,(0|t)==(0|(a=i[a+8>>2])))break}if(o=i[i[i[f+4>>2]+8>>2]>>2],a=i[i[o>>2]+4>>2],e=e||i[a+8>>2],i[a+16>>2]==i[e+16>>2])for(r=0;;){if(t=f,f=o,(0|(o=e))!=i[(e=a)+8>>2]&&(!z(i[i[e+4>>2]+12>>2],e)||!z(i[i[o+4>>2]+12>>2],e)))break i;k=i[t+8>>2]-i[e+28>>2]|0,i[f+8>>2]=k;f:{a:switch(i[n+56>>2]-100130|0){case 0:a=1&k;break f;case 1:a=(0|k)!=0;break f;case 2:a=(0|k)>0;break f;case 3:a=k>>>31|0;break f;case 4:break a;default:break f}a=k+1>>>0>2}if(p[f+12|0]=a,p[t+14|0]=1,r&&E0(n,t)&&(i[e+28>>2]=i[e+28>>2]+i[o+28>>2],a=i[e+4>>2],i[a+28>>2]=i[a+28>>2]+i[i[o+4>>2]+28>>2],i[i[t>>2]+24>>2]=0,h2(i[s>>2]),j(t),!$(o)))break i;if(s=f+4|0,r=1,o=i[i[i[f+4>>2]+8>>2]>>2],a=i[i[o>>2]+4>>2],i[a+16>>2]!=i[e+16>>2])break}return p[f+14|0]=1,void(b&&u1(n,f))}b2(n+1740|0,1),o2()}function r1(n){var f=0,a=0,t=0,e=0,b=0,o=0,k=0,r=0,s=0;if((0|(e=i[40+(n|=0)>>2]))!=(0|(k=n+40|0)))for(;;){if(s=i[e>>2],!w[e+21|0]){for(r=i[e+8>>2],n=i[r+12>>2];;){if(i[n+20>>2]=0,o=i[n+12>>2],f=i[n+4>>2],!i[f+20>>2]){if(t=i[n+16>>2],(0|(a=i[n+8>>2]))!=(0|n))i[t+8>>2]=a,t=i[f+12>>2],b=i[t+8>>2],i[i[a+4>>2]+12>>2]=t,i[i[b+4>>2]+12>>2]=n,i[n+8>>2]=b,i[t+8>>2]=a;else{for(f=a=i[t+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[t>>2],a=i[t+4>>2],i[f+4>>2]=a,i[a>>2]=f,j(t),f=i[n+4>>2]}if(t=i[f+16>>2],(0|(a=i[f+8>>2]))!=(0|f))i[t+8>>2]=a,t=i[i[f+4>>2]+12>>2],b=i[t+8>>2],i[i[a+4>>2]+12>>2]=t,i[i[b+4>>2]+12>>2]=f,i[f+8>>2]=b,i[t+8>>2]=a;else{for(f=a=i[t+8>>2];i[f+16>>2]=0,(0|a)!=(0|(f=i[f+8>>2])););f=i[t>>2],a=i[t+4>>2],i[f+4>>2]=a,i[a>>2]=f,j(t),f=i[n+4>>2]}t=i[(f=n>>>0>f>>>0?f:n)>>2],a=i[i[f+4>>2]>>2],i[i[t+4>>2]>>2]=a,i[i[a+4>>2]>>2]=t,j(f)}if(f=(0|n)!=(0|r),n=o,!f)break}n=i[e>>2],o=i[e+4>>2],i[n+4>>2]=o,i[o>>2]=n,j(e)}if((0|k)==(0|(e=s)))break}}function z(n,f){var a=0,t=0,e=0,b=0,o=0,k=0;if((0|(n|=0))!=(0|(f|=0))){if((0|(t=i[f+16>>2]))!=(0|(o=i[n+16>>2]))){for(a=e=i[t+8>>2];i[a+16>>2]=o,(0|e)!=(0|(a=i[a+8>>2])););a=i[t>>2],e=i[t+4>>2],i[a+4>>2]=e,i[e>>2]=a,j(t)}if((0|(k=i[n+20>>2]))!=(0|(e=i[f+20>>2]))){for(a=b=i[e+8>>2];i[a+20>>2]=k,(0|b)!=(0|(a=i[a+12>>2])););a=i[e>>2],b=i[e+4>>2],i[a+4>>2]=b,i[b>>2]=a,j(e)}if(a=i[n+8>>2],b=i[f+8>>2],i[i[b+4>>2]+12>>2]=n,i[i[a+4>>2]+12>>2]=f,i[f+8>>2]=a,i[n+8>>2]=b,(0|t)==(0|o)){if(!(t=H(40)))return 0;for(a=i[n+16>>2],o=i[a+4>>2],i[t+4>>2]=o,i[o>>2]=t,i[t>>2]=a,i[a+4>>2]=t,i[t+12>>2]=0,i[t+8>>2]=f,a=f;i[a+16>>2]=t,(0|(a=i[a+8>>2]))!=(0|f););i[i[n+16>>2]+8>>2]=n}if((0|e)==(0|k)){if(!(t=H(24)))return 0;for(a=i[n+20>>2],e=i[a+4>>2],i[t+4>>2]=e,i[e>>2]=t,i[t>>2]=a,i[a+4>>2]=t,i[t+12>>2]=0,i[t+16>>2]=0,i[t+8>>2]=f,p[t+20|0]=0,p[t+21|0]=w[a+21|0],a=f;i[a+20>>2]=t,(0|(a=i[a+12>>2]))!=(0|f););i[i[n+20>>2]+8>>2]=n}}return 1}function s1(n,f){var a=0,t=0,e=0,b=0,o=0,k=0,r=u(0),s=0,A=0,l=u(0);if(i[n+20>>2]){t=f,a=i[n>>2],n=i[a+8>>2]+1|0,i[a+8>>2]=n;i:{if(!((0|(f=i[a+12>>2]))>=n<<1)){if(i[a+12>>2]=f<<1,e=i[a+4>>2],f=l0(b=i[a>>2],f<<3|4),i[a>>2]=f,!f){i[a>>2]=b,e=2147483647;break i}if(f=l0(i[a+4>>2],8+(i[a+12>>2]<<3)|0),i[a+4>>2]=f,!f){i[a+4>>2]=e,e=2147483647;break i}}if(b=i[a+4>>2],e=n,(f=i[a+16>>2])&&(i[a+16>>2]=i[4+(b+(f<<3)|0)>>2],e=f),o=i[a>>2],i[o+(n<<2)>>2]=e,i[(k=b+(e<<3)|0)>>2]=t,i[k+4>>2]=n,i[a+20>>2]){f:if(n>>>0<2)f=n;else for(r=c[t+28>>2];;){if(a=i[((f=n>>1)<<2)+o>>2],A=i[(s=b+(a<<3)|0)>>2],(l=c[A+28>>2])>2]<=c[t+32>>2])|r!=l)){f=n;break f}if(i[(n<<2)+o>>2]=a,i[s+4>>2]=n,!((n=f)>>>0>1))break}i[(f<<2)+o>>2]=e,i[k+4>>2]=f}}return e}if(t=(a=i[n+12>>2])+1|0,i[n+12>>2]=t,e=i[n+4>>2],(0|(b=t))<(0|(t=i[n+16>>2])))t=e;else if(i[n+16>>2]=t<<1,t=l0(e,t<<3),i[n+4>>2]=t,!t)return i[n+4>>2]=e,2147483647;return i[(a<<2)+t>>2]=f,-1^a}function f0(n){n|=0;var f=0,a=0,t=0,e=0,b=0,o=0,k=0;b=H(40),o=H(40);i:{if(!(t=H(24))||!b|!o){if(b&&j(b),o&&j(o),!t)break i;return j(t),0}if(!(f=H(64)))return 0;for(a=i[n+68>>2],e=i[(a=a>>>0<(e=n- -64|0)>>>0?a:e)+4>>2],k=i[e>>2],i[f+32>>2]=k,i[i[k+4>>2]>>2]=f,i[f>>2]=a,a=e,e=f+32|0,i[a>>2]=e,i[f+16>>2]=0,i[f+20>>2]=0,i[f+12>>2]=e,i[f+4>>2]=e,i[f+24>>2]=0,i[f+28>>2]=0,i[f+48>>2]=0,i[f+52>>2]=0,i[f+44>>2]=f,i[f+40>>2]=e,i[f+36>>2]=f,i[f+56>>2]=0,i[f+60>>2]=0,i[f+8>>2]=f,a=i[n+4>>2],i[b+4>>2]=a,i[a>>2]=b,i[b+12>>2]=0,i[b+8>>2]=f,a=f;i[a+16>>2]=b,(0|(a=i[a+8>>2]))!=(0|f););for(i[o+4>>2]=b,i[b>>2]=o,i[o>>2]=n,i[n+4>>2]=o,i[o+12>>2]=0,i[o+8>>2]=e,a=e;i[a+16>>2]=o,(0|e)!=(0|(a=i[a+8>>2])););for(a=i[n+44>>2],i[t+4>>2]=a,i[a>>2]=t,i[t>>2]=n+40,i[n+44>>2]=t,i[t+12>>2]=0,i[t+16>>2]=0,i[t+8>>2]=f,p[t+20|0]=0,p[t+21|0]=w[n+61|0],a=f;i[a+20>>2]=t,(0|(a=i[a+12>>2]))!=(0|f););}return 0|f}function R0(n,f){var a=0,t=0,e=0,b=0,o=0,k=0;i[n+8>>2]=i[283],a=i[282],i[n>>2]=i[281],i[n+4>>2]=a,a=i[f+20>>2];i:if(w[a+21|0]){e=f;f:{a:{for(;;){if(w[a+20|0])break i;if(p[a+20|0]=1,i[a+16>>2]=t,e=i[i[e+12>>2]+4>>2],t=i[e+20>>2],w[t+21|0]){if(w[t+20|0])break a;if(p[t+20|0]=1,i[t+16>>2]=a,b=b+2|0,e=i[e+8>>2],a=i[e+20>>2],w[a+21|0])continue;break i}break}b|=1;break f}b|=1}t=a}else e=f;o=i[f+4>>2],a=i[o+20>>2];i:if(!(!w[a+21|0]|w[a+20|0])){f:{a:{for(;;){if(p[a+20|0]=1,i[a+16>>2]=t,f=i[o+12>>2],o=i[f+4>>2],t=i[o+20>>2],w[t+21|0]){if(w[t+20|0])break a;if(p[t+20|0]=1,i[t+16>>2]=a,k=k+2|0,f=i[i[o+8>>2]+4>>2],o=i[f+4>>2],a=i[o+20>>2],!w[a+21|0])break i;if(!w[a+20|0])continue;break i}break}k|=1;break f}k|=1}t=a}a=b+k|0,i[n>>2]=a;i:{if(1&b){if(!(1&k))break i;i[n>>2]=a-1,f=f+8|0}else f=e+4|0;f=i[f>>2]}if(i[n+4>>2]=f,t)for(;p[t+20|0]=0,t=i[t+16>>2];);}function M4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?M[i[n+88>>2]](5):M[0|a](5,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0]||(p[a+20|0]=1,f=i[i[f+12>>2]+4>>2],(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0]|w[a+20|0]))break i;if(p[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}function E2(n,f){f|=0;var a=0;if((0|(a=i[(n|=0)>>2]))!=(0|f))for(;;){i:if(f>>>0>a>>>0){f:switch(0|a){case 0:(0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100151):M[0|a](100151,i[n+1896>>2]),i[n>>2]&&E2(n,0),i[n+112>>2]=0,a=1,i[n>>2]=1,p[n+108|0]=0,i[n+1896>>2]=0,i[n+8>>2]=0;break i;case 1:break f;default:break i}if((0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100152):M[0|a](100152,i[n+1896>>2]),i[n>>2]!=1&&E2(n,1),i[n>>2]=2,i[n+4>>2]=0,a=2,i[n+112>>2]<1)break i;p[n+108|0]=1}else{f:switch(a-1|0){case 1:(0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100154):M[0|a](100154,i[n+1896>>2]),i[n>>2]!=2&&E2(n,2),a=1,i[n>>2]=1;break i;case 0:break f;default:break i}(0|(a=i[n+1732>>2]))==11?M[i[n+12>>2]](100153):M[0|a](100153,i[n+1896>>2]),(a=i[n+8>>2])&&_0(a),a=0,i[n+8>>2]=0,i[n>>2]=0,i[n+4>>2]=0}if((0|f)==(0|a))break}}function A1(n,f,a){var t=0,e=0,b=0,o=0,k=0,r=0,s=0,A=0,l=0;i:{f:{a:{n:{t:{b:{e:{c:{u:{o:{if(e=f,f){if(!(t=a))break o;break u}n=(n>>>0)/(a>>>0)|0,v2=0;break i}if(!n)break c;break e}if(!(t-1&t))break b;r=0-(k=(s0(t)+33|0)-s0(e)|0)|0;break n}n=(e>>>0)/0|0,v2=0;break i}if((t=32-s0(e)|0)>>>0<31)break t;break a}if((0|t)==1)break f;a=31&(t=t?31-s0(t-1^t)|0:32),(63&t)>>>0>=32?(e=0,n=f>>>a|0):(e=f>>>a|0,n=((1<>>a),v2=e;break i}k=t+1|0,r=63-t|0}if(t=f,b=31&(e=63&k),e>>>0>=32?(e=0,b=t>>>b|0):(e=t>>>b|0,b=((1<>>b),t=31&(r&=63),r>>>0>=32?(f=n<>>32-t|f<>>31)-(A=a&(o=r-((e=e<<1|b>>>31)+(t>>>0>>0)|0)>>31))|0,e=e-(s>>>0>>0)|0,f=f<<1|n>>>31,n=l|n<<1,l=o&=1,k=k-1|0;);v2=f<<1|n>>>31,n=o|n<<1;break i}n=0,f=0}v2=f}return n}function I4(n,f,a){f|=0,a|=0;var t=0,e=0,b=0,o=0,k=0,r=0,s=0;B=e=B-32|0,b=i[28+(n|=0)>>2],i[e+16>>2]=b,t=i[n+20>>2],i[e+28>>2]=a,i[e+24>>2]=f,f=t-b|0,i[e+20>>2]=f,b=f+a|0,s=2,f=e+16|0;i:{f:{(t=0|e1(i[n+60>>2],e+16|0,2,e+12|0))?(i[613]=t,t=-1):t=0;a:{if(!t)for(;;){if((0|(t=i[e+12>>2]))==(0|b))break a;if((0|t)<=-1)break f;if(o=t-((k=(o=i[f+4>>2])>>>0>>0)?o:0)|0,i[(r=(k<<3)+f|0)>>2]=o+i[r>>2],i[(r=(k?12:4)+f|0)>>2]=i[r>>2]-o,b=b-t|0,f=k?f+8|0:f,s=s-k|0,(t=0|e1(i[n+60>>2],0|f,0|s,e+12|0))?(i[613]=t,t=-1):t=0,t)break}if((0|b)!=-1)break f}f=i[n+44>>2],i[n+28>>2]=f,i[n+20>>2]=f,i[n+16>>2]=f+i[n+48>>2],n=a;break i}i[n+28>>2]=0,i[n+16>>2]=0,i[n+20>>2]=0,i[n>>2]=32|i[n>>2],n=0,(0|s)!=2&&(n=a-i[f+4>>2]|0)}return B=e+32|0,0|n}function l1(n){var f=0,a=0,t=0,e=0,b=0,o=0,k=u(0),r=0,s=u(0),A=0,l=0,v=0,h=0,m=0,g=0;if(e=i[n+4>>2],a=i[n>>2],t=i[a+4>>2],m=i[(f=e+(t<<3)|0)>>2],!((0|(b=i[n+8>>2]))<1)&&(A=i[(b<<2)+a>>2],i[a+4>>2]=A,i[4+(l=(A<<3)+e|0)>>2]=1,i[f>>2]=0,i[f+4>>2]=i[n+16>>2],v=b-1|0,i[n+8>>2]=v,i[n+16>>2]=t,(0|b)!=1)){for(g=(A<<3)+e|0,f=1;(0|v)<=(0|(n=f<<1))||(o=i[(i[((t=1|n)<<2)+a>>2]<<3)+e>>2],k=c[o+28>>2],r=i[(i[(n<<2)+a>>2]<<3)+e>>2],s=c[r+28>>2],!(c[o+32>>2]<=c[r+32>>2])|k!=s&&!(k=(0|b)||(t=i[g>>2],k=c[t+28>>2],o=i[(n<<2)+a>>2],h=i[(r=(o<<3)+e|0)>>2],k<(s=c[h+28>>2])|(c[t+32>>2]<=c[h+32>>2]?k==s:0)));)i[(f<<2)+a>>2]=o,i[r+4>>2]=f,f=n;i[(f<<2)+a>>2]=A,i[l+4>>2]=f}return m}function _4(n,f,a){f|=0,a|=0,(0|(a=i[1716+(n|=0)>>2]))==3?M[i[n+88>>2]](6):M[0|a](6,i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|a](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2];i:if(w[a+21|0])for(;;){if(w[a+20|0])break i;if(p[a+20|0]=1,f=i[f+8>>2],(0|(a=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[i[f+4>>2]+16>>2]+12>>2]):M[0|a](i[i[i[f+4>>2]+16>>2]+12>>2],i[n+1896>>2]),a=i[f+20>>2],!w[a+21|0])break}(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}function v1(n,f,a){var t=0,e=0;if(a&&(p[(t=n+a|0)-1|0]=f,p[0|n]=f,!(a>>>0<3||(p[t-2|0]=f,p[n+1|0]=f,p[t-3|0]=f,p[n+2|0]=f,a>>>0<7||(p[t-4|0]=f,p[n+3|0]=f,a>>>0<9||(t=(t=n)+(n=0-n&3)|0,e=W(255&f,16843009),i[t>>2]=e,i[(f=(n=a-n&-4)+t|0)-4>>2]=e,n>>>0<9||(i[t+8>>2]=e,i[t+4>>2]=e,i[f-8>>2]=e,i[f-12>>2]=e,n>>>0<25||(i[t+24>>2]=e,i[t+20>>2]=e,i[t+16>>2]=e,i[t+12>>2]=e,i[f-16>>2]=e,i[f-20>>2]=e,i[f-24>>2]=e,i[f-28>>2]=e,(a=n-(f=4&t|24)|0)>>>0<32))))))))for(e=x0(e,0,1,1),n=v2,f=f+t|0;i[f+24>>2]=e,t=n,i[f+28>>2]=t,i[f+16>>2]=e,i[f+20>>2]=t,i[f+8>>2]=e,i[f+12>>2]=t,i[f>>2]=e,i[f+4>>2]=t,f=f+32|0,(a=a-32|0)>>>0>31;);}function d1(n,f,a){i:if(!(f>>>0>20)){f:switch(f-9|0){case 0:return f=i[a>>2],i[a>>2]=f+4,void(i[n>>2]=i[f>>2]);case 1:return f=i[a>>2],i[a>>2]=f+4,f=i[f>>2],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 2:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=i[f>>2],void(i[n+4>>2]=0);case 3:return f=i[a>>2]+7&-8,i[a>>2]=f+8,a=i[f+4>>2],i[n>>2]=i[f>>2],void(i[n+4>>2]=a);case 4:return f=i[a>>2],i[a>>2]=f+4,f=r2[f>>1],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 5:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=L2[f>>1],void(i[n+4>>2]=0);case 6:return f=i[a>>2],i[a>>2]=f+4,f=p[0|f],i[n>>2]=f,void(i[n+4>>2]=f>>31);case 7:return f=i[a>>2],i[a>>2]=f+4,i[n>>2]=w[0|f],void(i[n+4>>2]=0);case 8:return f=i[a>>2]+7&-8,i[a>>2]=f+8,void(X[n>>3]=X[f>>3]);case 9:break f;default:break i}M[0](n,a)}}function G(n,f,a){var t=u(0),e=u(0),b=0,o=0,k=u(0),r=u(0),s=0,A=u(0),l=u(0);B=o=B+-64|0,s=(t=c[f+28>>2])>(e=c[n+28>>2]);i:{f:{if(!(!(c[n+32>>2]<=c[f+32>>2])|t!=e)||s){if((k=c[a+28>>2])>t|(c[f+32>>2]<=c[a+32>>2]?t==k:0))break i;if(b=1,s)break f}b=0,t==e&&(b=c[n+32>>2]<=c[f+32>>2])}s=b,b=1,(k=c[a+28>>2])>t||(b=0,t==k&&(b=c[f+32>>2]<=c[a+32>>2])),r=c[n+32>>2],A=c[f+32>>2],l=c[a+32>>2],X[o+40>>3]=k,X[o+24>>3]=t,X[o+48>>3]=l,X[o+32>>3]=A,X[o+16>>3]=r,X[o+8>>3]=e,i[o+4>>2]=b,i[o>>2]=s,R1(1092,o),k=c[a+28>>2],e=c[n+28>>2],t=c[f+28>>2]}return r=u(0),B=o- -64|0,e=u(t-e),t=u(k-t),u(e+t)>u(0)&&(r=e,e=c[f+32>>2],r=u(u(r*u(e-c[a+32>>2]))+u(t*u(e-c[n+32>>2])))),r}function a0(n,f,a){var t=0,e=0,b=0,o=0;t=i[f>>2];i:{if((0|f)!=(0|a))for(;;){if(p[f+15|0]=0,o=i[f+4>>2],b=i[i[o+8>>2]>>2],e=i[b>>2],i[e+16>>2]!=i[t+16>>2]){if(!w[b+15|0])return n=w[f+12|0],a=i[t+20>>2],i[a+8>>2]=t,p[a+21|0]=n,i[t+24>>2]=0,h2(o),j(f),t;if(!(e=d2(i[i[t+8>>2]+4>>2],i[e+4>>2]))||!$(i[b>>2]))break i;i[b>>2]=e,p[b+15|0]=0,i[e+24>>2]=b}if(i[t+8>>2]!=(0|e)&&(!z(i[i[e+4>>2]+12>>2],e)||!z(t,e)))break i;if(e=w[f+12|0],t=i[f>>2],o=i[t+20>>2],i[o+8>>2]=t,p[o+21|0]=e,i[t+24>>2]=0,h2(i[f+4>>2]),j(f),t=i[b>>2],(0|a)==(0|(f=b)))break}return t}b2(n+1740|0,1),o2()}function W2(n,f,a){switch(f-100100|0){case 0:return void(i[n+88>>2]=a||15);case 6:return void(i[n+1716>>2]=a||3);case 4:return p[n+80|0]=(0|a)!=0,void(i[n+92>>2]=a||14);case 10:return p[n+80|0]=(0|a)!=0,void(i[n+1720>>2]=a||4);case 1:return void(i[n+96>>2]=a||13);case 7:return void(i[n+1724>>2]=a||5);case 2:return void(i[n+100>>2]=a||12);case 8:return void(i[n+1728>>2]=a||6);case 3:return void(i[n+12>>2]=a||18);case 9:return void(i[n+1732>>2]=a||11);case 5:return void(i[n+76>>2]=a||17);case 11:return void(i[n+1736>>2]=a||8);case 12:return void(i[n+104>>2]=a||16)}(0|(f=i[n+1732>>2]))==11?M[i[n+12>>2]](100900):M[0|f](100900,i[n+1896>>2])}function Z(n,f,a){var t=0,e=0,b=0;if(!(32&w[0|n]))i:{e=f,t=a;f:{if(!(n=i[(f=n)+16>>2])){if(n=w[f+74|0],p[f+74|0]=n-1|n,8&(n=i[f>>2])?(i[f>>2]=32|n,n=-1):(i[f+4>>2]=0,i[f+8>>2]=0,n=i[f+44>>2],i[f+28>>2]=n,i[f+20>>2]=n,i[f+16>>2]=n+i[f+48>>2],n=0),n)break f;n=i[f+16>>2]}if(n-(b=i[f+20>>2])>>>0>>0){M[i[f+36>>2]](f,e,a);break i}a:if(!(p[f+75|0]<0)){for(n=a;;){if(t=n,!n)break a;if(w[e+(n=t-1|0)|0]==10)break}if(M[i[f+36>>2]](f,e,t)>>>0>>0)break f;e=t+e|0,a=a-t|0,b=i[f+20>>2]}c1(b,e,a),i[f+20>>2]=i[f+20>>2]+a}}}function p1(n,f,a,t){var e=0,b=0;B=e=B-208|0,i[e+204>>2]=a,v1(e+160|0,0,40),i[e+200>>2]=i[e+204>>2],(0|C0(0,f,e+200|0,e+80|0,e+160|0,t))<0||(i[n+76>>2],a=i[n>>2],p[n+74|0]<=0&&(i[n>>2]=-33&a),b=32&a,i[n+48>>2]?C0(n,f,e+200|0,e+80|0,e+160|0,t):(i[n+48>>2]=80,i[n+16>>2]=e+80,i[n+28>>2]=e,i[n+20>>2]=e,a=i[n+44>>2],i[n+44>>2]=e,C0(n,f,e+200|0,e+80|0,e+160|0,t),a&&(M[i[n+36>>2]](n,0,0),i[n+48>>2]=0,i[n+44>>2]=a,i[n+28>>2]=0,i[n+16>>2]=0,i[n+20>>2]=0)),i[n>>2]=i[n>>2]|b),B=e+208|0}function S4(n,f){n|=0;var a=0,t=0,e=0;if((0|(a=i[40+(f|=0)>>2]))!=(0|(t=f+40|0)))for(;;){if(w[a+21|0]){for((0|(f=i[n+1716>>2]))==3?M[i[n+88>>2]](2):M[0|f](2,i[n+1896>>2]),f=i[a+8>>2];(0|(e=i[n+1724>>2]))==5?M[i[n+96>>2]](i[i[f+16>>2]+12>>2]):M[0|e](i[i[f+16>>2]+12>>2],i[n+1896>>2]),(0|(f=i[f+12>>2]))!=i[a+8>>2];);(0|(f=i[n+1728>>2]))==6?M[i[n+100>>2]]():M[0|f](i[n+1896>>2])}if((0|t)==(0|(a=i[a>>2])))break}}function h1(n,f){if(!n)return 0;i:{f:{if(n){if(f>>>0<=127)break f;if(i[i[493]>>2]){if(f>>>0<=2047){p[n+1|0]=63&f|128,p[0|n]=f>>>6|192,n=2;break i}if(!((-8192&f)!=57344&&f>>>0>=55296)){p[n+2|0]=63&f|128,p[0|n]=f>>>12|224,p[n+1|0]=f>>>6&63|128,n=3;break i}if(f-65536>>>0<=1048575){p[n+3|0]=63&f|128,p[0|n]=f>>>18|240,p[n+2|0]=f>>>6&63|128,p[n+1|0]=f>>>12&63|128,n=4;break i}}else if((-128&f)==57216)break f;i[613]=25,n=-1}else n=1;break i}p[0|n]=f,n=1}return n}function M0(){var n=0,f=0,a=0;return(n=H(128))?(i[n+8>>2]=0,i[n+12>>2]=0,f=n+40|0,i[n+44>>2]=f,i[n+48>>2]=0,i[n+52>>2]=0,i[n+40>>2]=f,r2[n+54>>1]=0,r2[n+56>>1]=0,r2[n+58>>1]=0,r2[n+60>>1]=0,i[n+72>>2]=0,i[n+76>>2]=0,f=n+96|0,i[n+68>>2]=f,a=n- -64|0,i[n+64>>2]=a,i[n+80>>2]=0,i[n+84>>2]=0,i[n+88>>2]=0,i[n+92>>2]=0,i[n+104>>2]=0,i[n+108>>2]=0,i[n+100>>2]=a,i[n+96>>2]=f,i[n+112>>2]=0,i[n+116>>2]=0,i[n+120>>2]=0,i[n+124>>2]=0,i[n>>2]=n,i[n+4>>2]=n,0|n):0}function x4(n,f,a){n|=0,f|=0,a|=0;var t=0,e=0,b=u(0),o=u(0);return a=i[a>>2],t=i[i[a+4>>2]+16>>2],f=i[f>>2],(0|(e=i[i[f+4>>2]+16>>2]))==(0|(n=i[n+72>>2]))?(0|n)==(0|t)?(f=i[f+16>>2],b=c[f+28>>2],a=i[a+16>>2],o=c[a+28>>2],!(!(c[f+32>>2]<=c[a+32>>2])|b!=o)||b=u(0)|0):G(t,n,i[a+16>>2])<=u(0)|0:(f=i[f+16>>2],(0|n)==(0|t)?G(e,n,f)>=u(0)|0:C1(e,n,f)>=C1(i[i[a+4>>2]+16>>2],n,i[a+16>>2])|0)}function I0(n){var f=0,a=0,t=0,e=0,b=0,o=u(0),k=u(0),r=0;if(!(f=i[n+12>>2]))return l1(i[n>>2]);if(b=i[n+8>>2],t=i[i[(b+(f<<2)|0)-4>>2]>>2],a=i[n>>2],i[a+8>>2]&&(e=i[i[a+4>>2]+(i[i[a>>2]+4>>2]<<3)>>2],o=c[e+28>>2],k=c[t+28>>2],!(!(c[e+32>>2]<=c[t+32>>2])|o!=k)||o>2]=a,t;if(e=f<<2,f=r=f-1|0,i[i[(e+b|0)-8>>2]>>2])break}return i[n+12>>2]=r,t}function L4(n,f,a){f|=0,a|=0;var t=0,e=0,b=0,o=0;b=1;i:if((0|(t=i[64+(n|=0)>>2]))!=(0|(e=n- -64|0))){if(o=0-f|0,!a){for(;;)if(n=w[i[t+20>>2]+21|0],i[t+28>>2]=(0|n)==w[i[i[t+4>>2]+20>>2]+21|0]?0:n?f:o,(0|e)==(0|(t=i[t>>2])))break i}for(;;){if(n=i[t>>2],(0|(a=w[i[t+20>>2]+21|0]))==w[i[i[t+4>>2]+20>>2]+21|0]){if(!$(t)){b=0;break i}}else i[t+28>>2]=a?f:o;if((0|e)==(0|(t=n)))break}}return 0|b}function m1(n,f){var a=0,t=0,e=0;(a=H(16))&&(e=f0(i[n+8>>2]))&&(t=i[e+16>>2],c[t+32>>2]=f,i[t+28>>2]=2112929218,t=i[i[e+4>>2]+16>>2],c[t+32>>2]=f,i[t+28>>2]=-34554430,i[n+72>>2]=t,p[a+15|0]=0,p[a+12|0]=0,i[a+8>>2]=0,i[a>>2]=e,p[a+13|0]=1,p[a+14|0]=0,t=a,a=S0(e=i[n+64>>2],e,a),i[t+4>>2]=a,a)||(b2(n+1740|0,1),o2())}function _0(n){var f=0,a=0,t=0;if((0|(f=i[40+(n|=0)>>2]))!=(0|(a=n+40|0)))for(;t=i[f>>2],j(f),(0|a)!=(0|(f=t)););if((0|(f=i[n>>2]))!=(0|n))for(;t=i[f>>2],j(f),(0|(f=t))!=(0|n););if((0|(f=i[n+64>>2]))!=(0|(a=n- -64|0)))for(;t=i[f>>2],j(f),(0|a)!=(0|(f=t)););j(n)}function w1(n){var f=0,a=u(0),t=u(0);if(!(f=i[n+12>>2]))return n=i[n>>2],i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2];f=i[i[(i[n+8>>2]+(f<<2)|0)-4>>2]>>2],n=i[n>>2];i:{if(i[n+8>>2]&&(n=i[i[n+4>>2]+(i[i[n>>2]+4>>2]<<3)>>2],(a=c[n+28>>2])<(t=c[f+28>>2])||a==t&&c[n+32>>2]<=c[f+32>>2]))break i;n=f}return n}function P4(n,f,a,t){n|=0,f|=0,a|=0,t|=0,a=0;i:{if(f=i[520]){if(!((a=i[f>>2])>>>0<100001)){f=H(12);break i}}else f=H(1200008),i[f+4>>2]=12,i[f>>2]=0,i[520]=f;i[f>>2]=a+1,f=8+(W(a,12)+f|0)|0}c[f>>2]=c[n>>2],c[f+4>>2]=c[n+4>>2],c[f+8>>2]=c[n+8>>2],i[t>>2]=f}function q2(n,f,a){var t=0,e=0,b=0;if(f>>>0<1)t=n;else for(;t=A1(n,f,10),b=e=v2,e=x0(t,e,10,0),p[0|(a=a-1|0)]=n-e|48,e=f>>>0>9,n=t,f=b,e;);if(t)for(;n=(t>>>0)/10|0,p[0|(a=a-1|0)]=t-W(n,10)|48,f=t>>>0>9,t=n,f;);return a}function g1(n,f,a,t){var e=0,b=0,o=0;if(b=i[610]+1|0,i[610]=b,i[n>>2]=b,t)for(;;){if(!i[(o=(e<<3)+a|0)>>2])return i[o>>2]=b,i[4+(n=(e<<3)+a|0)>>2]=f,i[n+8>>2]=0,K(0|t),a;if((0|(e=e+1|0))==(0|t))break}return e=n,n=t<<1,f=g1(e,f,l0(a,t<<4|8),n),K(0|n),f}function y1(n,f){var a=0,t=0,e=0;if(y0(+n),a=0|l2(1),t=0|l2(0),e=a,(0|(a=a>>>20&2047))!=2047){if(!a)return a=f,n==0?f=0:(n=y1(18446744073709552e3*n,f),f=i[f>>2]+-64|0),i[a>>2]=f,n;i[f>>2]=a-1022,n1(0,0|t),n1(1,-2146435073&e|1071644672),n=+r4()}return n}function C1(n,f,a){var t=u(0),e=u(0),b=u(0),o=u(0),k=u(0);return t=c[f+28>>2],e=u(t-c[n+28>>2]),t=u(c[a+28>>2]-t),(b=u(e+t))>u(0)?(k=c[f+32>>2],o=c[((f=t>e)?n:a)+32>>2],t=u(u(k-o)+u(u((f?e:t)/b)*u(o-c[(f?a:n)+32>>2])))):t=u(0),t}function S0(n,f,a){for(var t=0;f=i[f+8>>2],(t=i[f>>2])&&!(0|M[i[n+16>>2]](i[n+12>>2],t,a)););return(n=H(12))?(i[n>>2]=a,i[n+4>>2]=i[f+4>>2],i[i[f+4>>2]+8>>2]=n,i[n+8>>2]=f,i[f+4>>2]=n,n):0}function x0(n,f,a,t){var e=0,b=0,o=0,k=0,r=0,s=0;return s=W(e=a>>>16|0,b=n>>>16|0),e=(65535&(b=((r=W(o=65535&a,k=65535&n))>>>16|0)+W(b,o)|0))+W(e,k)|0,v2=(W(f,a)+s|0)+W(n,t)+(b>>>16)+(e>>>16)|0,65535&r|e<<16}function i2(n,f,a,t,e){var b=0;if(B=b=B-256|0,!(73728&e|(0|a)<=(0|t))){if(v1(b,255&f,(t=(a=a-t|0)>>>0<256)?a:256),!t)for(;Z(n,b,256),(a=a-256|0)>>>0>255;);Z(n,b,a)}B=b+256|0}function J(n,f,a){var t=0,e=0;i:if(a)for(;;){if(!(e=i[(t<<3)+f>>2]))break i;if((0|n)==(0|e))return i[4+((t<<3)+f|0)>>2];if((0|(t=t+1|0))==(0|a))break}return 0}function T2(n){var f=0,a=0;return(n=(f=i[412])+(a=n+3&-4)|0)>>>0<=f>>>0&&a||n>>>0>M1()<<16>>>0&&!(0|l4(0|n))?(i[613]=48,-1):(i[412]=n,f)}function E1(n){var f=0,a=0,t=0;if(p[i[n>>2]]-48>>>0<10)for(;f=i[n>>2],t=p[0|f],i[n>>2]=f+1,a=(W(a,10)+t|0)-48|0,p[f+1|0]-48>>>0<10;);return a}function B4(n,f){n|=0;var a=0,t=0;(0|(a=i[4+(f|=0)>>2]))>2]&&(t=i[f>>2]+(W(i[f+12>>2],a)<<2)|0,c[t>>2]=c[n>>2],c[t+4>>2]=c[n+4>>2],i[f+4>>2]=a+1)}function j4(n,f){n|=0,f|=0;var a=u(0),t=u(0);if((a=c[n+28>>2])<(t=c[f+28>>2]))n=1;else{if(a!=t)return 0;n=c[n+32>>2]<=c[f+32>>2]}return 0|n}function L0(n){var f=0;(f=i[n>>2])&&(j(i[f+4>>2]),j(i[f>>2]),j(f)),(f=i[n+8>>2])&&j(f),(f=i[n+4>>2])&&j(f),j(n)}function T4(n){n|=0;var f=0;B=f=B-16|0,i[f>>2]=n,B=n=B-16|0,i[n+12>>2]=f,p1(i[288],1078,f,0),B=n+16|0,B=f+16|0}function F4(n,f,a){n|=0,f=i[20+(f|=0)>>2],i[f+16>>2]=i[n+84>>2],i[n+84>>2]=f,p[f+20|0]=1}function h2(n){var f=0;f=i[n+4>>2],i[f+8>>2]=i[n+8>>2],i[i[n+8>>2]+4>>2]=f,j(n)}function R1(n,f){var a=0;B=a=B-16|0,i[a+12>>2]=f,p1(i[288],n,f,43),B=a+16|0}function f2(n){var f=0;return(-1>>>(f=31&n)&-2)<>>n}function b2(n,f){n|=0,f|=0,i[611]||(i[612]=f,i[611]=n),v4()}function U4(n,f){n|=0,f|=0,i[611]||(i[612]=f,i[611]=n)}function O4(n,f,a,t){return v2=0,0}function D4(n,f,a,t,e){}function H4(n,f,a,t){}function Q4(n){return 0}function v0(n,f){}function W4(){return 0|B}function q4(n){B=n|=0}function R2(n){}function P0(){}S=w,a2();var M=x([null,F4,_4,v0,v0,v0,R2,M4,D4,j4,x4,v0,P0,R2,R2,R2,R2,H4,R2,E2,E4,M0,f0,n2,z,b1,b2,g4,L4,R4,S4,C4,r1,_0,B4,R2,P0,P4,T4,R2,Q4,I4,O4,y4]);function M1(){return N.byteLength/65536|0}function z4(n){n|=0;var f=0|M1(),a=f+n|0;if(f=x);)++S;if(S-y>16&&d.subarray&&z0)return z0.decode(d.subarray(y,S));for(var T="";y>10,56320|1023&t2)}}else T+=String.fromCharCode((31&O)<<6|D)}else T+=String.fromCharCode(O)}return T}function F1(d,y){return d?K0(J2,d,y):""}function U1(d,y){return d%y>0&&(d+=y-d%y),d}function Y0(d){G2=d,C.HEAP8=new Int8Array(d),C.HEAP16=new Int16Array(d),C.HEAP32=Z2=new Int32Array(d),C.HEAPU8=J2=new Uint8Array(d),C.HEAPU16=new Uint16Array(d),C.HEAPU32=new Uint32Array(d),C.HEAPF32=new Float32Array(d),C.HEAPF64=new Float64Array(d)}var p2,N0=C.INITIAL_MEMORY||4194304;(V2=C.wasmMemory?C.wasmMemory:new g2.Memory({initial:N0/65536,maximum:32768}))&&(G2=V2.buffer),N0=G2.byteLength,Y0(G2);var V0=[],G0=[],J0=[];function O1(){if(C.preRun)for(typeof C.preRun=="function"&&(C.preRun=[C.preRun]);C.preRun.length;)Q1(C.preRun.shift());m0(V0)}function D1(){m0(G0)}function H1(){if(C.postRun)for(typeof C.postRun=="function"&&(C.postRun=[C.postRun]);C.postRun.length;)q1(C.postRun.shift());m0(J0)}function Q1(d){V0.unshift(d)}function W1(d){G0.unshift(d)}function q1(d){J0.unshift(d)}var M2=0,X2=null;function z1(d){M2++,C.monitorRunDependencies&&C.monitorRunDependencies(M2)}function K1(d){if(M2--,C.monitorRunDependencies&&C.monitorRunDependencies(M2),M2==0&&X2){var y=X2;X2=null,y()}}function $2(d){throw C.onAbort&&C.onAbort(d),D2(d+=""),q0=!0,d="abort("+d+"). Build with -s ASSERTIONS=1 for more info.",new g2.RuntimeError(d)}C.preloadedImages={},C.preloadedAudios={};var e2,Z0="data:application/octet-stream;base64,";function h0(d){return d.startsWith(Z0)}function X0(d){return d.startsWith("file://")}function $0(d){try{if(d==e2&&H2)return new Uint8Array(H2);var y=Q2(d);if(y)return y;if(o0)return o0(d);throw"both async and sync fetching of the wasm failed"}catch(I){$2(I)}}function Y1(){if(!H2&&(Q0||N2)){if(typeof fetch=="function"&&!X0(e2))return fetch(e2,{credentials:"same-origin"}).then(function(d){if(!d.ok)throw"failed to load wasm binary file at '"+e2+"'";return d.arrayBuffer()}).catch(function(){return $0(e2)});if(e0)return new Promise(function(d,y){e0(e2,function(I){d(new Uint8Array(I))},y)})}return Promise.resolve().then(function(){return $0(e2)})}function N1(){var d={a:i1};function y(T,O){var D=T.exports;C.asm=D,p2=C.asm.q,W1(C.asm.n),K1()}function I(T){y(T.instance)}function x(T){return Y1().then(function(O){return g2.instantiate(O,d)}).then(T,function(O){D2("failed to asynchronously prepare wasm: "+O),$2(O)})}function S(){return H2||typeof g2.instantiateStreaming!="function"||h0(e2)||X0(e2)||typeof fetch!="function"?x(I):fetch(e2,{credentials:"same-origin"}).then(function(T){return g2.instantiateStreaming(T,d).then(I,function(O){return D2("wasm streaming compile failed: "+O),D2("falling back to ArrayBuffer instantiation"),x(I)})})}if(z1(),C.instantiateWasm)try{return C.instantiateWasm(d,y)}catch(T){return D2("Module.instantiateWasm callback failed with error: "+T),!1}return S(),{}}function m0(d){for(;d.length>0;){var y=d.shift();if(typeof y!="function"){var I=y.func;typeof I=="number"?y.arg===void 0?p2.get(I)():p2.get(I)(y.arg):I(y.arg===void 0?null:y.arg)}else y(C)}}function V1(){throw"longjmp"}function G1(d,y,I){J2.copyWithin(d,y,y+I)}function J1(d){try{return V2.grow(d-G2.byteLength+65535>>>16),Y0(V2.buffer),1}catch{}}function Z1(d){var y=J2.length,I=2147483648;if((d>>>=0)>I)return!1;for(var x=1;x<=4;x*=2){var S=y*(1+.2/x);if(S=Math.min(S,d+100663296),J1(Math.min(I,U1(Math.max(d,S),65536))))return!0}return!1}h0(e2="libtess-asm.wasm")||(e2=L1(e2));var b0={mappings:{},buffers:[null,[],[]],printChar:function(d,y){var I=b0.buffers[d];y===0||y===10?((d===1?P1:D2)(K0(I,0)),I.length=0):I.push(y)},varargs:void 0,get:function(){return b0.varargs+=4,Z2[b0.varargs-4>>2]},getStr:function(d){return F1(d)},get64:function(d,y){return d}};function X1(d,y,I,x){for(var S=0,T=0;T>2],D=Z2[y+(8*T+4)>>2],a2=0;a2>2]=S,0}function $1(d){for(var y=[],I=0;I255&&(x&=255),y.push(String.fromCharCode(x))}return y.join("")}var i4=typeof atob=="function"?atob:function(d){var y,I,x,S,T,O,D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a2="",t2=0;d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");do y=D.indexOf(d.charAt(t2++))<<2|(S=D.indexOf(d.charAt(t2++)))>>4,I=(15&S)<<4|(T=D.indexOf(d.charAt(t2++)))>>2,x=(3&T)<<6|(O=D.indexOf(d.charAt(t2++))),a2+=String.fromCharCode(y),T!==64&&(a2+=String.fromCharCode(I)),O!==64&&(a2+=String.fromCharCode(x));while(t20||(O1(),M2>0||(C.setStatus?(C.setStatus("Running..."),setTimeout(function(){setTimeout(function(){C.setStatus("")},1),y()},1)):y()))}if(X2=function d(){k0||w0(),k0||(X2=d)},C.run=w0,C.preInit)for(typeof C.preInit=="function"&&(C.preInit=[C.preInit]);C.preInit.length>0;)C.preInit.pop()();w0();let g0=null,y2=null,x2=null,u0=null;const s2=u2.Module,u4=2,f1=4e3;let a1=0;const c4=(d,y,I)=>{g0||(g0=s2._triangulate);let x=s2.HEAPF32;const S=s2.HEAP32.BYTES_PER_ELEMENT,T=2,O=x.BYTES_PER_ELEMENT;I>a1&&(a1=I,x2&&(s2._free(x2),x2=0),y2&&(s2._free(y2),y2=0)),x2||(x2=s2._malloc(I*O)),u0||(u0=s2._malloc(f1*S));const D=I*u4;y2||(y2=s2._malloc(D*O)),x=s2.HEAPF32,x.set(d,x2/O),s2.HEAP32.set(y,u0/S);const a2=D/T,t2=g0(x2,u0,Math.min(y.length,f1),T,y2,a2),c0=t2*T;x=s2.HEAPF32;const r0=x.slice(y2/O,y2/O+c0),l2={};return l2.buffer=r0,l2.vertexCount=t2,l2};return u2.triangulate=c4,u2.whenLoaded()}return{load:z2}},(_1=I1())!==void 0&&(D0.exports=_1);var S1=H0.exports;const V4=Y4({__proto__:null,default:K4(S1)},[S1]);export{V4 as l}; diff --git a/dist/assets/loadGLTFMesh-g6BxZi9G.js b/dist/assets/loadGLTFMesh-g6BxZi9G.js new file mode 100644 index 0000000..1a6cc28 --- /dev/null +++ b/dist/assets/loadGLTFMesh-g6BxZi9G.js @@ -0,0 +1,8 @@ +import{mN as P,mO as z,mP as L,mQ as N,mR as D,bW as q,ld as O,mS as G,mT as Q,ab as B,mU as U,mV as V,mW as W,mX as K,mY as S,fB as A,mZ as X,m_ as C,m$ as Y,n0 as Z,n1 as k,n2 as H,n3 as v,n4 as J,n5 as ee,n6 as I,n7 as E,n8 as j,n9 as te,na as ne,nb as M,nc as F,nd as _,ne as re,nf as oe,fA as w,bi as se,b1 as ae,ng as le,nh as ue,ni as ie,ag as ce,nj as fe}from"./index-J0iiHjMT.js";function me(e,n,t){const u=e.typedBuffer,a=e.typedBufferStride,o=n.typedBuffer,c=n.typedBufferStride,l=t?t.count:n.count;let s=((t==null?void 0:t.dstIndex)??0)*a,f=((t==null?void 0:t.srcIndex)??0)*c;for(let i=0;il.set(h,Te(x))),o.materials.forEach((x,h)=>s.set(h,$e(x,l)));const f=xe(c);for(const x of f.parts)ye(f,x,s);const{position:i,normal:r,tangent:m,color:p,texCoord0:y}=f.vertexAttributes,b={position:i.typedBuffer,normal:r!=null?r.typedBuffer:null,tangent:m!=null?m.typedBuffer:null,uv:y!=null?y.typedBuffer:null,color:p!=null?p.typedBuffer:null},g=N(b,e,u);return{transform:g.transform,vertexSpace:g.vertexSpace,components:f.components,spatialReference:e.spatialReference,vertexAttributes:new D({position:g.vertexAttributes.position,normal:g.vertexAttributes.normal,tangent:g.vertexAttributes.tangent,color:b.color,uv:b.uv})}}function de(e){const n=e==null?void 0:e.resolveFile,t=e==null?void 0:e.requestFile;return n||t?{busy:!1,request:async(u,a,o)=>{const c=(n==null?void 0:n(u))??u;if(t){const s=await t(c,a,o==null?void 0:o.signal);if(s!==void 0)return s}return(await q(c,{responseType:a==="image"?"image":a==="binary"?"array-buffer":"json",signal:o!=null?o.signal:null})).data}}:null}function $(e,n){if(e==null)return"-";const t=e.typedBuffer;return`${O(n,t.buffer,()=>n.size)}/${t.byteOffset}/${t.byteLength}`}function ge(e){return e!=null?e.toString():"-"}function xe(e){let n=0;const t={color:!1,tangent:!1,normal:!1,texCoord0:!1},u=new Map,a=new Map,o=[];for(const c of e.parts){const{attributes:{position:l,normal:s,color:f,tangent:i,texCoord0:r}}=c,m=` + ${$(l,u)}/ + ${$(s,u)}/ + ${$(f,u)}/ + ${$(i,u)}/ + ${$(r,u)}/ + ${ge(c.transform)} + `;let p=!1;const y=O(a,m,()=>(p=!0,{start:n,length:l.count}));p&&(n+=l.count),s&&(t.normal=!0),f&&(t.color=!0),i&&(t.tangent=!0),r&&(t.texCoord0=!0),o.push({gltf:c,writeVertices:p,region:y})}return{vertexAttributes:{position:T(le,n),normal:t.normal?T(F,n):null,tangent:t.tangent?T(I,n):null,color:t.color?T(j,n):null,texCoord0:t.texCoord0?T(ue,n):null},parts:o,components:[]}}function Te(e){return new G({data:(Q(e.data),e.data),wrap:ve(e.parameters.wrap)})}function $e(e,n){const t=new B(we(e.color,e.opacity)),u=e.emissiveFactor?new B(Be(e.emissiveFactor)):null,a=o=>o?new ie({scale:o.scale?[o.scale[0],o.scale[1]]:[1,1],rotation:ce(o.rotation??0),offset:o.offset?[o.offset[0],o.offset[1]]:[0,0]}):null;return new U({color:t,colorTexture:n.get(e.textureColor),normalTexture:n.get(e.textureNormal),emissiveColor:u,emissiveTexture:n.get(e.textureEmissive),occlusionTexture:n.get(e.textureOcclusion),alphaMode:he(e.alphaMode),alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,metallic:e.metallicFactor,roughness:e.roughnessFactor,metallicRoughnessTexture:n.get(e.textureMetallicRoughness),colorTextureTransform:a(e.colorTextureTransform),normalTextureTransform:a(e.normalTextureTransform),occlusionTextureTransform:a(e.occlusionTextureTransform),emissiveTextureTransform:a(e.emissiveTextureTransform),metallicRoughnessTextureTransform:a(e.metallicRoughnessTextureTransform)})}function ye(e,n,t){n.writeVertices&&be(e,n);const{indices:u,attributes:a,primitiveType:o,material:c}=n.gltf;let l=V(u||a.position.count,o);const s=n.region.start;if(s){const f=new Uint32Array(l);for(let i=0;io.set(e,n)))}function i(e){o.get(e)()}function s(e){return a.get(e)}async function p(e){return await s(e),t(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{i as a,p as c,c as s}; diff --git a/dist/assets/loader-QqciGs1c.js b/dist/assets/loader-QqciGs1c.js new file mode 100644 index 0000000..85f90aa --- /dev/null +++ b/dist/assets/loader-QqciGs1c.js @@ -0,0 +1,5 @@ +import{q as y,H as b,t as e,x}from"./index-J0iiHjMT.js";import{g as w}from"./guid-6vN-YNJI.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const E='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-ui-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem)}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--2);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-ui-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{position:absolute;display:block;text-align:center;color:var(--calcite-ui-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);line-height:0.25;transform:scale(1, 1)}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}@supports (display: grid){.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}}:host([type=determinate]){animation:none;stroke:var(--calcite-ui-border-3)}:host([type=determinate]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3{animation:none;stroke:var(--calcite-ui-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-ui-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-ui-brand)}33%{stroke:var(--calcite-ui-brand-press)}66%{stroke:var(--calcite-ui-brand-hover)}100%{stroke:var(--calcite-ui-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',S=y(class extends b{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.inline=!1,this.label=void 0,this.scale="m",this.type=void 0,this.value=0,this.text=""}render(){const{el:a,inline:i,label:u,scale:l,text:c,type:g,value:r}=this,h=a.id||w(),k=.45,t=i?this.getInlineSize(l):this.getSize(l),d=t*k,n=`0 0 ${t} ${t}`,o=g==="determinate",m=2*d*Math.PI,v=r/100*m,p=m-v,f=Math.floor(r),z={"aria-valuenow":f,"aria-valuemin":0,"aria-valuemax":100,complete:f===100},s={r:d,cx:t/2,cy:t/2},_={"stroke-dasharray":`${v} ${p}`};return e(x,{"aria-label":u,id:h,role:"progressbar",...o?z:{}},e("div",{class:"loader__svgs"},e("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--1",viewBox:n},e("circle",{...s})),e("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--2",viewBox:n},e("circle",{...s})),e("svg",{"aria-hidden":"true",class:"loader__svg loader__svg--3",viewBox:n,...o?{style:_}:{}},e("circle",{...s}))),c&&e("div",{class:"loader__text"},c),o&&e("div",{class:"loader__percentage"},r))}getSize(a){return{s:32,m:56,l:80}[a]}getInlineSize(a){return{s:12,m:16,l:20}[a]}get el(){return this}static get style(){return E}},[1,"calcite-loader",{inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1]}]);function C(){if(typeof customElements>"u")return;["calcite-loader"].forEach(i=>{switch(i){case"calcite-loader":customElements.get(i)||customElements.define(i,S);break}})}C();export{S as L,C as d}; diff --git a/dist/assets/locale-pfkq1d6A.js b/dist/assets/locale-pfkq1d6A.js new file mode 100644 index 0000000..3f5b814 --- /dev/null +++ b/dist/assets/locale-pfkq1d6A.js @@ -0,0 +1,5 @@ +import{cl as O,cm as v}from"./index-J0iiHjMT.js";import{n as I}from"./key-qdHumIlA.js";import{c as L}from"./observers-JyBmMU24.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const A=new RegExp("\\.(0+)?$"),C=new RegExp("0+$");class i{constructor(t){if(t instanceof i)return t;const[n,r]=z(t).split(".").concat("");this.value=BigInt(n+r.padEnd(i.DECIMALS,"0").slice(0,i.DECIMALS))+BigInt(i.ROUNDED&&r[i.DECIMALS]>="5"),this.isNegative=t.charAt(0)==="-"}getIntegersAndDecimals(){const t=this.value.toString().replace("-","").padStart(i.DECIMALS+1,"0"),n=t.slice(0,-i.DECIMALS),r=t.slice(-i.DECIMALS).replace(C,"");return{integers:n,decimals:r}}toString(){const{integers:t,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${t}${n.length?"."+n:""}`}formatToParts(t){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),s=t.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&s.unshift({type:"minusSign",value:t.minusSign}),r.length&&(s.push({type:"decimal",value:t.decimal}),r.split("").forEach(a=>s.push({type:"fraction",value:a}))),s}format(t){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),s=`${this.isNegative?t.minusSign:""}${t.numberFormatter.format(BigInt(n))}`,a=r.length?`${t.decimal}${r.split("").map(l=>t.numberFormatter.format(Number(l))).join("")}`:"";return`${s}${a}`}add(t){return i.fromBigInt(this.value+new i(t).value)}subtract(t){return i.fromBigInt(this.value-new i(t).value)}multiply(t){return i._divRound(this.value*new i(t).value,i.SHIFT)}divide(t){return i._divRound(this.value*i.SHIFT,new i(t).value)}}i.DECIMALS=100;i.ROUNDED=!0;i.SHIFT=BigInt("1"+"0".repeat(i.DECIMALS));i._divRound=(e,t)=>i.fromBigInt(e/t+(i.ROUNDED?e*BigInt(2)/t%BigInt(2):BigInt(0)));i.fromBigInt=e=>Object.assign(Object.create(i.prototype),{value:e,isNegative:e{let n=!1;const r=t.split("").filter((s,a)=>s.match(/\./g)&&!n?(n=!0,!0):s.match(/\-/g)&&a===0?!0:I.includes(s)).join("");return b(r)?new i(r).toString():""})}const E=/^([-0])0+(?=\d)/,D=/(?!^\.)\.$/,_=/(?!^-)-/g,x=/^-\b0\b\.?0*$/,R=/0*$/,Q=e=>d(e,t=>{const n=t.replace(_,"").replace(D,"").replace(E,"$1");return b(n)?x.test(n)?n:T(n):t});function T(e){const t=e.split(".")[1],n=new i(e).toString(),[r,s]=n.split(".");return t&&s!==t?`${r}.${t}`:n}function d(e,t){if(!e)return e;const n=e.toLowerCase().indexOf("e")+1;return n?e.replace(/[eE]*$/g,"").substring(0,n).concat(e.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,s)=>t(s===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):t(e)}function z(e){const t=e.split(/[eE]/);if(t.length===1)return e;const n=+e;if(Number.isSafeInteger(n))return`${n}`;const r=e.charAt(0)==="-",s=+t[1],a=t[0].split("."),l=(r?a[0].substring(1):a[0])||"",$=a[1]||"",F=(c,u)=>{const m=Math.abs(u)-c.length,p=m>0?`${"0".repeat(m)}${c}`:c;return`${p.slice(0,u)}.${p.slice(u)}`},w=(c,u)=>{const m=u>c.length?`${c}${"0".repeat(u-c.length)}`:c;return`${m.slice(0,u)}.${m.slice(u)}`},S=s>0?`${l}${w($,s)}`:`${F(l,s)}${$}`;return`${r?"-":""}${S.charAt(0)==="."?"0":""}${S.replace(A,"").replace(E,"")}`}function k(e){return I.some(t=>e.includes(t))}function Y(e,t,n){const r=t.split(".")[1];if(r){const s=r.match(R)[0];if(s&&n.delocalize(e).length!==t.length&&r.indexOf("e")===-1){const a=n.decimal;return e=e.includes(a)?e:`${e}${a}`,e.padEnd(e.length+s.length,n.localize("0"))}}return e}const o="en",M=["ar","bg","bs","ca","cs","da","de","el",o,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",o,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],H=["arab","arabext","bali","beng","deva","fullwide","gujr","guru","hanidec","khmr","knda","laoo","latn","limb","mlym","mong","mymr","orya","tamldec","telu","thai","tibt"],y=e=>H.includes(e),f=new Intl.NumberFormat().resolvedOptions().numberingSystem,N=f==="arab"||!y(f)?"latn":f,P=e=>y(e)?e:N;function Z(e,t="cldr"){const n=t==="cldr"?j:M;return e?n.includes(e)?e:(e=e.toLowerCase(),e==="nb"?"no":t==="t9n"&&e==="pt"?"pt-BR":(e.includes("-")&&(e=e.replace(/(\w+)-(\w+)/,(r,s,a)=>`${s}-${a.toUpperCase()}`),n.includes(e)||(e=e.split("-")[0])),e==="zh"?"zh-CN":n.includes(e)?e:(console.warn(`Translations for the "${e}" locale are not available and will fall back to the default, English (en).`),o))):o}const g=new Set;function V(e){G(e),g.size===0&&(h==null||h.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0})),g.add(e)}function G(e){e.effectiveLocale=U(e)}function tt(e){g.delete(e),g.size===0&&h.disconnect()}const h=L("mutation",e=>{e.forEach(t=>{const n=t.target;g.forEach(r=>{if(!O(n,r.el))return;const a=v(r.el,"[lang]");if(!a){r.effectiveLocale=o;return}const l=a.lang;r.effectiveLocale=a.hasAttribute("lang")&&l===""?o:l})})});function U(e){var t;return e.el.lang||((t=v(e.el,"[lang]"))==null?void 0:t.lang)||document.documentElement.lang||o}class B{constructor(){this.delocalize=t=>this._numberFormatOptions?d(t,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):t,this.localize=t=>this._numberFormatOptions?d(t,n=>b(n.trim())?new i(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):t}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(t){if(t.locale=Z(t==null?void 0:t.locale),t.numberingSystem=P(t==null?void 0:t.numberingSystem),!this._numberFormatOptions&&t.locale===o&&t.numberingSystem===N&&Object.keys(t).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(t))return;this._numberFormatOptions=t,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((s,a)=>[s,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(s=>s.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(s=>s.type==="decimal").value,this._minusSign=r.find(s=>s.type==="minusSign").value,this._getDigitIndex=s=>n.get(s)}}const et=new B;export{i as B,Y as a,V as c,tt as d,Z as g,b as i,et as n,q as p,Q as s}; diff --git a/dist/assets/lt_LT-UBpPtM2w.js b/dist/assets/lt_LT-UBpPtM2w.js new file mode 100644 index 0000000..3e1ea8c --- /dev/null +++ b/dist/assets/lt_LT-UBpPtM2w.js @@ -0,0 +1 @@ +const i={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - yyyy-MM-dd",_date_hour:"HH:mm",_date_hour_full:"HH:mm - yyyy-MM-dd",_date_day:"MMM dd",_date_day_full:"yyyy-MM-dd",_date_week:"ww",_date_week_full:"yyyy-MM-dd",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"m.e.",_era_bc:"p.m.e.",A:"R",P:"V",AM:"ryto",PM:"vakaro","A.M.":"ryto","P.M.":"vakaro",January:"Sausio",February:"Vasario",March:"Kovo",April:"Balandžio",May:"Gegužės",June:"Birželio",July:"Liepos",August:"Rugpjūčio",September:"Rugsėjo",October:"Spalio",November:"Lapkričio",December:"Gruodžio",Jan:"Sau",Feb:"Vas",Mar:"Kov",Apr:"Bal","May(short)":"Geg",Jun:"Bir",Jul:"Lie",Aug:"Rgp",Sep:"Rgs",Oct:"Spa",Nov:"Lap",Dec:"Gru",Sunday:"sekmadienis",Monday:"pirmadienis",Tuesday:"antradienis",Wednesday:"trečiadienis",Thursday:"ketvirtadienis",Friday:"penktadienis",Saturday:"šeštadienis",Sun:"sekm.",Mon:"pirm.",Tue:"antr.",Wed:"treč.",Thu:"ketv.",Fri:"penk.",Sat:"šešt.",_dateOrd:function(a){return"-a"},"Zoom Out":"Rodyti viską",Play:"Paleisti",Stop:"Sustabdyti",Legend:"Legenda","Press ENTER to toggle":"Spragtelkite, palieskite arba spauskite ENTER, kad perjungtumėte",Loading:"Kraunama",Home:"Pradžia",Chart:"Grafikas","Serial chart":"Serijinis grafikas","X/Y chart":"X/Y grafikas","Pie chart":"Pyrago tipo grafikas","Gauge chart":"Daviklio tipo grafikas","Radar chart":"Radaro tipo grafikas","Sankey diagram":"Sankey diagrama","Chord diagram":"Chord diagrama","Flow diagram":"Flow diagrama","TreeMap chart":"TreeMap grafikas",Series:"Serija","Candlestick Series":'"Candlestick" tipo grafiko serija',"Column Series":"Stulpelinio grafiko serija","Line Series":"Linijinio grafiko serija","Pie Slice Series":"Pyrago tipo serija","X/Y Series":"X/Y serija",Map:"Žemėlapis","Press ENTER to zoom in":"Spauskite ENTER, kad pritrauktumėte vaizdą","Press ENTER to zoom out":"Spauskite ENTER, kad atitolintumėte vaizdą","Use arrow keys to zoom in and out":"Naudokitės royklėmis vaizdo pritraukimui ar atitolinimui","Use plus and minus keys on your keyboard to zoom in and out":"Spauskite pliuso arba minuso klavišus ant klaviatūros, kad pritrautumėte arba atitolintumėte vaizdą",Export:"Eksportuoti",Image:"Vaizdas",Data:"Duomenys",Print:"Spausdinti","Press ENTER to open":"Spragtelkite arba spauskite ENTER, kad atidarytumėte","Press ENTER to print.":"Spragtelkite arba spauskite ENTER, kad spausdintumėte.","Press ENTER to export as %1.":"Spragtelkite arba spauskite ENTER, kad eksportuotumėte kaip %1.","Image Export Complete":"Paveiksliuko eksportas baigtas","Export operation took longer than expected. Something might have gone wrong.":"Eksportas užtruko ilgiau negu turėtų. Greičiausiai įvyko klaida.","Saved from":"Išsaugota iš",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba kairė/dešinė klavišus, kad pakeistumėte pasirinkimą","Use left and right arrows to move selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte pasirinkimą","Use left and right arrows to move left selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte kairį žymeklį","Use left and right arrows to move right selection":"Naudokitės klavišais kairė/dešinė, kad pajudintumėte dešinį žymeklį","Use TAB select grip buttons or up and down arrows to change selection":"Spauskite TAB klavišą, kad pasirinktumėte žymeklius, arba aukštyn/žemyn klavišus, kad pakeistumėte pasirinkimą","Use up and down arrows to move selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte pasirinkimą","Use up and down arrows to move lower selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte apatinį žymeklį","Use up and down arrows to move upper selection":"Naudokitės klavišais aukštyn/žemyn, kad pajudintumėte viršutinį žymeklį","From %1 to %2":"Nuo %1 iki %2","From %1":"Nuo %1","To %1":"Iki %1","No parser available for file: %1":"Failui %1 neturime tinkamo dešifruotojo","Error parsing file: %1":"Skaitant failą %1 įvyko klaida","Unable to load file: %1":"Nepavyko užkrauti failo %1","Invalid date":"Klaidinga data"};export{i as default}; diff --git a/dist/assets/lv_LV-Wuccr2bP.js b/dist/assets/lv_LV-Wuccr2bP.js new file mode 100644 index 0000000..5a11479 --- /dev/null +++ b/dist/assets/lv_LV-Wuccr2bP.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"m.ē.",_era_bc:"p.m.ē.",A:"priekšp.",P:"pēcp.",AM:"priekšp.",PM:"pēcp.","A.M.":"priekšpusdienā","P.M.":"pēcpusdienā",January:"janvāris",February:"februāris",March:"marts",April:"aprīlis",May:"maijs",June:"jūnijs",July:"jūlijs",August:"augusts",September:"septembris",October:"oktobris",November:"novembris",December:"decembris",Jan:"janv.",Feb:"febr.",Mar:"marts",Apr:"apr.","May(short)":"maijs",Jun:"jūn.",Jul:"jūl.",Aug:"aug.",Sep:"sept.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"svētdiena",Monday:"pirmdiena",Tuesday:"otrdiena",Wednesday:"trešdiena",Thursday:"ceturtdiena",Friday:"piektdiena",Saturday:"sestdiena",Sun:"svētd.",Mon:"pirmd.",Tue:"otrd.",Wed:"trešd.",Thu:"ceturtd.",Fri:"piektd.",Sat:"sestd.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Tālummaiņa",Play:"Darbināt",Stop:"Apturēt",Legend:"Apzīmējumi","Press ENTER to toggle":"",Loading:"Ielādē",Home:"Sākums",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukāt",Image:"Attēls",Data:"Dati",Print:"Drukāt","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"No %1 līdz %2","From %1":"No %1","To %1":"Līdz %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/dist/assets/manipulatorUtils-1y2yxq3d.js b/dist/assets/manipulatorUtils-1y2yxq3d.js new file mode 100644 index 0000000..bf080ef --- /dev/null +++ b/dist/assets/manipulatorUtils-1y2yxq3d.js @@ -0,0 +1 @@ +import{aP as a,a2 as l}from"./index-J0iiHjMT.js";function u(r,n=a(r)){return n.mode!=="on-the-ground"&&!(r.geometry==null||!r.geometry.hasZ)}function m(r,n){let e=null;const t=r.events.on("grab-changed",o=>{e!=null&&(e.remove(),e=null),o.action==="start"&&(e=r.disableDisplay()),n&&n(o)});return l(()=>{e==null||e.remove(),t.remove()})}export{u as n,m as t}; diff --git a/dist/assets/mask-svg-t31ntHky.js b/dist/assets/mask-svg-t31ntHky.js new file mode 100644 index 0000000..33a85c2 --- /dev/null +++ b/dist/assets/mask-svg-t31ntHky.js @@ -0,0 +1 @@ +const c="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiBzdHlsZT0iZmlsbC1ydWxlOmV2ZW5vZGQ7Y2xpcC1ydWxlOmV2ZW5vZGQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS1taXRlcmxpbWl0OjIiPjxjaXJjbGUgY3g9IjEyOCIgY3k9IjEyOCIgcj0iMTIxIi8+PC9zdmc+";export{c as default}; diff --git a/dist/assets/math-SoUQJWjz.js b/dist/assets/math-SoUQJWjz.js new file mode 100644 index 0000000..8974442 --- /dev/null +++ b/dist/assets/math-SoUQJWjz.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const s=(e,a,t)=>Math.max(a,Math.min(e,t)),r=new RegExp(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/),m=e=>{const a=(""+e).match(r);return!a||parseInt(a[1])===0?0:Math.max(0,(a[1]?a[1].length:0)-(a[2]?+a[2]:0))};function o(e,a,t,n,c){return(e-a)*(c-n)/(t-a)+n}function u(e,a,t){return ea-t?1:0}export{u as a,s as c,m as d,o as r}; diff --git a/dist/assets/measurementUtils-84-ZBArh.js b/dist/assets/measurementUtils-84-ZBArh.js new file mode 100644 index 0000000..38fd223 --- /dev/null +++ b/dist/assets/measurementUtils-84-ZBArh.js @@ -0,0 +1 @@ +import{cs as a,ct as n,cu as o,cv as r}from"./index-J0iiHjMT.js";function m(c){const s=a(c),t=s===o?r:s;return n(c,t)?t:c}export{m as i}; diff --git a/dist/assets/measurementUtils-St7B-HxA.js b/dist/assets/measurementUtils-St7B-HxA.js new file mode 100644 index 0000000..cb24548 --- /dev/null +++ b/dist/assets/measurementUtils-St7B-HxA.js @@ -0,0 +1 @@ +import{l as G,ar as k,aa as l,as as x,at as b,au as v,av as y,aw as z,ax as M,ay as w,az as C,aA as m,aB as P,aC as h,aD as E,aE as g,aF as d,aG as R,aH as q}from"./index-J0iiHjMT.js";function W(t,n){const e=n.center;x(e,0,0,0);for(let a=0;a{if(o[0]===0&&o[1]===0&&o[2]===0)return!1;for(let c=0;cimport("./loadGLTFMesh-g6BxZi9G.js"),__vite__mapDeps([0,1,2])),n),o=await Ht(r,n);fe(n);const i=s(new F({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:Yt(o),requestFile:void 0,useTransform:!0,signal:n==null?void 0:n.signal,expectedType:o.type});i.then(()=>o.dispose(),()=>o.dispose());const{vertexAttributes:l,components:c}=await i;e.vertexAttributes=l,e.components=c}function Yt(e){const t=ot(e.url);return n=>{const r=it(n,t,t),s=r?r.replace(/^ *\.\//,""):null;return(s?e.files.get(s):null)??n}}async function Ht(e,t){if(Array.isArray(e)){if(!e.length)throw new R("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?Kt(e):en(e,t)}return Be(e)}async function Qt(e,t){const{parts:n,assetMimeType:r,assetName:s}=e;if(n.length===1)return new ne(n[0].partUrl);const o=await e.toBlob(t);return fe(t),ne.fromBlob(o,Ye(s,r))}function Be(e){return ne.fromBlob(e,Ye(e.name,e.type))}function Kt(e){return Je(e.map(t=>({name:t.name,mimeType:t.type,source:Be(t)})))}async function en(e,t){const n=await at(e.map(async r=>{const s=await Qt(r);return fe(t),{name:r.assetName,mimeType:r.assetMimeType,source:s}}));if(lt(t))throw n.forEach(r=>r.source.dispose()),ct();return Je(n)}const We=/^model\/gltf\+json$/,Ze=/^model\/gltf-binary$/,ce=/\.gltf$/i,tn=/\.glb$/i;function Je(e){const t=new Map;let n,r=null;for(const{name:s,mimeType:o,source:i}of e)r===null&&(We.test(o)||ce.test(s)?(r=i.url,n="gltf"):(Ze.test(o)||tn.test(s))&&(r=i.url,n="glb")),t.set(s,i.url),i.files.forEach((l,c)=>t.set(c,l));if(r==null)throw new R("mesh-load-external:missing-files","Missing files to load external mesh source");return new ne(r,()=>e.forEach(({source:s})=>s.dispose()),t,n)}let ne=class Xe{constructor(t,n=()=>{},r=new Map,s){this.url=t,this.dispose=n,this.files=r,this.type=s}static fromBlob(t,n){const r=URL.createObjectURL(t);return new Xe(r,()=>URL.revokeObjectURL(r),void 0,n)}};function Ye(e,t){return We.test(t)||ce.test(e)?"gltf":Ze.test(t)||ce.test(e)?"glb":void 0}let _=class extends ut{constructor(){super(),this.externalSources=new pt,this._explicitDisplaySource=null,this.addHandles(ft(()=>this.externalSources,"after-remove",({item:e})=>{e===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!be(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!jt(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>Ot(t,e))}get _implicitDisplaySource(){return this.externalSources.find(be)}};g([y()],_.prototype,"externalSources",void 0),g([y()],_.prototype,"displaySource",null),g([y()],_.prototype,"_implicitDisplaySource",null),g([y()],_.prototype,"_explicitDisplaySource",void 0),_=g([De("esri.geometry.support.meshUtils.Metadata")],_);const nn="esri.geometry.support.meshUtils.offset";function rn(e,t,n){var s;if(!((s=e.vertexAttributes)!=null&&s.position))return;const{vertexSpace:r}=e;r.isRelative?(se(r,nn,n),sn(r,t)):oe(e.spatialReference,n)?on(e,t):an(e,t)}function sn(e,t){const n=e.origin;e.origin=ie(x(),n,t)}function on(e,t){const n=e.spatialReference,r=e.vertexAttributes.position,s=e.vertexAttributes.normal,o=e.vertexAttributes.tangent,i=new Float64Array(r.length),l=s!=null?new Float32Array(s.length):null,c=o!=null?new Float32Array(o.length):null,a=e.extent.center,u=ln;ke(n,[a.x,a.y,a.z],Re,he(n)),Ce(Fe,Re),K(u,t,Fe),me(r,n,i),s!=null&&l!=null&&de(s,r,i,n,l),o!=null&&c!=null&&ge(o,r,i,n,c),He(i,u),ye(i,r,n),s!=null&&l!=null&&xe(l,r,i,n,s),o!=null&&c!=null&&we(c,r,i,n,o),e.vertexAttributesChanged()}function an(e,t){He(e.vertexAttributes.position,t),e.vertexAttributesChanged()}function He(e,t){if(e)for(let n=0;n=o&&u=4,A=h===2||h===4,j=E?n-1:n;for(let $=0;$<=j;$++){const b=$/j*2*Math.PI,M=E?0:.5;d[0]=M*Math.sin(b),d[1]=M*-Math.cos(b),d[2]=h<=2?.5:-.5;for(let O=0;O<3;O++)s[c++]=d[O],o[a++]=G?O===2?h<=1?1:-1:0:O===2?0:d[O]/M;i[u++]=($+(E?.5:0))/n,i[u++]=h<=1?1*h/3:h<=3?1*(h-2)/3+1/3:1*(h-4)/3+2/3,A||h===0||$===n||(h!==5&&(l[p++]=f,l[p++]=f+1,l[p++]=f-n),h!==1&&(l[p++]=f,l[p++]=f-n,l[p++]=f-n-1)),f++}}return{position:s,normal:o,uv:i,faces:l}}function hn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function mn(e){const t=W.facingAxisOrderSwap[e],n=W.position,r=W.normal,s=new Float64Array(n.length),o=new Float32Array(r.length);let i=0;for(let l=0;l<4;l++){const c=i;for(let a=0;a<3;a++){const u=t[a],p=Math.abs(u)-1,f=u>=0?1:-1;s[i]=n[c+p]*f,o[i]=r[c+p]*f,i++}}return{position:s,normal:o,uv:new Float32Array(W.uv),faces:new Uint32Array(W.faces),isPlane:!0}}const D=1,k=2,C=3,W={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[C,D,k],west:[-C,-D,k],north:[-D,C,k],south:[D,-C,k],up:[D,k,C],down:[D,-k,-C]}};function X(e,t,n){e.isPlane||dn(e),gn(e,n==null?void 0:n.size);const{vertexAttributes:r,vertexSpace:s,transform:o}=ht(e,t,n);return{vertexAttributes:new ee({...r,uv:e.uv}),vertexSpace:s,transform:o,components:[new N({faces:e.faces,material:(n==null?void 0:n.material)||null})],spatialReference:t.spatialReference}}function dn(e){for(let t=0;timport("./zipjs-wrapper-Ui4c_elP.js"),__vite__mapDeps([])),s=[];return(await new n(new t(e)).getEntries()).forEach(i=>{var a;if(i.directory||/^__MACOS/i.test(i.filename))return;const l=new r,c=(a=i.getData)==null?void 0:a.call(i,l).then(u=>new File([u],i.filename));c&&s.push(c)}),Promise.all(s)}var v;const P="esri.geometry.Mesh",Ln={base:null,key:"type",defaultKeyValue:"georeferenced",typeMap:{georeferenced:le,"georeferenced-relative":Ne,local:te}};let w=v=class extends wt.LoadableMixin(vt($t)){constructor(e){super(e),this.components=null,this.vertexSpace=new le,this.transform=null,this.metadata=new _,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new ee,this.type="mesh"}initialize(){(this.metadata.externalSources.length===0||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when(()=>{this.addHandles(At(()=>{var e;return{vertexAttributes:this.vertexAttributes,components:(e=this.components)==null?void 0:e.map(t=>t.clone())}},()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){var e;return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):((e=this.metadata.displaySource)==null?void 0:e.extent)!=null}get _transformedExtent(){const{components:e,spatialReference:t,vertexAttributes:n,vertexSpace:r}=this,s=n.position;if(s.length===0||e&&e.length===0)return new pe({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t});if(r.type==="local"){const{_untransformedExtent:o,transform:i}=this;return Nt(o,i,r,t)}if(r.type==="georeferenced-relative"){const{transform:o}=this,i=Oe({positions:s,transform:o,vertexSpace:r,inSpatialReference:t,outSpatialReference:t});return H(i,t)}return H(s,t)}get _untransformedExtent(){return H(this.vertexAttributes.position,this.spatialReference)}get anchor(){const{vertexSpace:e}=this;if(e.isRelative)return e.getOriginPoint(this.spatialReference);const{center:t,zmin:n}=this._transformedExtent;return new F({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get origin(){const{vertexSpace:e}=this;return e.isRelative?e.getOriginPoint(this.spatialReference):this._transformedExtent.center}get extent(){var e,t;return this.loaded||((t=(e=this.metadata)==null?void 0:e.displaySource)==null?void 0:t.extent)==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){if(!this.loaded)return m.getLogger(this).error("addComponent()",new B().message);this.components||(this.components=[]),this.components.push(N.from(e)),this.notifyChange("components")}removeComponent(e){if(!this.loaded)return m.getLogger(this).error("removeComponent()",new B().message);if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}m.getLogger(this).error("removeComponent()",new Ct().message)}rotate(e,t,n,r){return bt(e,t,n,_e),wn(this,_e,r),this}offset(e,t,n,r){return this.loaded?(Y[0]=e,Y[1]=t,Y[2]=n,rn(this,Y,r),this):(m.getLogger(this).error("offset()",new B().message),this)}scale(e,t){return this.loaded?(bn(this,e,t),this):(m.getLogger(this).error("scale()",new B().message),this)}centerAt(e,t){return this.loaded?(Vt(this,e,t),this):(m.getLogger(this).error("centerAt()",new B().message),this)}load(e){const{metadata:{displaySource:t}}=this;return t&&this.addResolvingPromise(Xt(this,t,e)),Promise.resolve(this)}addExternalSources(e){this.metadata.externalSources.addMany(e)}updateDisplaySource(e){this.metadata.displaySource=e}clone(){return this.cloneWithVertexSpace(this.vertexSpace.clone())}cloneWithVertexSpace(e){var r;let t=null;if(this.components){const s=new Map,o=new Map;t=this.components.map(i=>i.cloneWithDeduplication(s,o))}const n={components:t,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),vertexSpace:e,transform:((r=this.transform)==null?void 0:r.clone())??null,metadata:this.metadata.clone()};return new v(n)}cloneShallow(){return new v({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=Q(()=>import("./gltfexport-gleus-sO.js"),__vite__mapDeps([3,1,2])),n=this.load(),r=await Promise.all([t,n]),{toBinaryGLTF:s}=r[0];return s(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}static createBox(e,t){if(!(e instanceof F))return m.getLogger(P).error(".createBox()",new T().message),null;const n=new v(X(cn(),e,t));return t!=null&&t.imageFace&&t.imageFace!=="all"?un(n,t.imageFace):n}static createSphere(e,t){return e instanceof F?new v(X(pn((t==null?void 0:t.densificationFactor)||0),e,t)):(m.getLogger(P).error(".createSphere()",new T().message),null)}static createCylinder(e,t){return e instanceof F?new v(X(fn((t==null?void 0:t.densificationFactor)||0),e,t)):(m.getLogger(P).error(".createCylinder()",new T().message),null)}static createPlane(e,t){if(!(e instanceof F))return m.getLogger(P).error(".createPlane()",new T().message),null;const n=(t==null?void 0:t.facing)??"up",r=hn(n,t==null?void 0:t.size);return new v(X(mn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof St))return m.getLogger(P).error(".createFromPolygon()",new qt().message),null;const n=Rt(e);return new v({vertexAttributes:new ee({position:n.position}),components:[new N({faces:n.faces,shading:"flat",material:(t==null?void 0:t.material)??null})],spatialReference:e.spatialReference,vertexSpace:new le})}static async createFromGLTF(e,t,n){if(!(e instanceof F)){const s=new T;throw m.getLogger(P).error(".createfromGLTF()",s.message),s}const{loadGLTFMesh:r}=await Te(Q(()=>import("./loadGLTFMesh-g6BxZi9G.js"),__vite__mapDeps([0,1,2])),n);return new v(await r(e,t,n))}static async createFromFiles(e,t,n){const r=a=>m.getLogger(P).error(".createFromFiles()",a.message);if(!(e instanceof F)){const a=new T;throw r(a),a}const s=n==null?void 0:n.layer;if(!s){const a=new zt;throw r(a),a}const o=await v.extractAndFilterFiles(t,s),i=o.reduce((a,u)=>Ft(s.infoFor3D,u)?a+1:a,0);if(i===0){const a=new It;throw r(a),a}if(i>1){const a=new Ut;throw r(a),a}const l=v.createWithExternalSource(e,o),[c]=await s.uploadAssets([l],n);return c}static async extractAndFilterFiles(e,t){const n=t==null?void 0:t.infoFor3D;return n?(await En(e)).filter(r=>Et(n,r)):e}static createWithExternalSource(e,t,n){var f;const r=(n==null?void 0:n.extent)??null,{x:s,y:o,z:i,spatialReference:l}=e,c=((f=n==null?void 0:n.transform)==null?void 0:f.clone())??new V,a=(n==null?void 0:n.vertexSpace)??new te({origin:[s,o,i??0]}),u={source:t,extent:r},p=new _;return p.externalSources.push(u),new v({metadata:p,transform:c,vertexSpace:a,spatialReference:l})}static createIncomplete(e,t){var a;const{x:n,y:r,z:s,spatialReference:o}=e,i=((a=t==null?void 0:t.transform)==null?void 0:a.clone())??new V,l=(t==null?void 0:t.vertexSpace)??new te({origin:[n,r,s??0]}),c=new v({transform:i,vertexSpace:l,spatialReference:o});return c.addResolvingPromise(Promise.reject(new R("mesh-incomplete","Mesh resources are not complete"))),c}};g([y({type:[N],json:{write:!0}})],w.prototype,"components",void 0),g([y({nonNullable:!0,types:Ln,constructOnly:!0,json:{write:!0}})],w.prototype,"vertexSpace",void 0),g([y({type:V,json:{write:!0}})],w.prototype,"transform",void 0),g([y({constructOnly:!0})],w.prototype,"metadata",void 0),g([y()],w.prototype,"hasExtent",null),g([y()],w.prototype,"_transformedExtent",null),g([y()],w.prototype,"_untransformedExtent",null),g([y()],w.prototype,"anchor",null),g([y()],w.prototype,"origin",null),g([y({readOnly:!0,json:{read:!1}})],w.prototype,"extent",null),g([y({readOnly:!0,json:{read:!1,write:!0,default:!0}})],w.prototype,"hasZ",void 0),g([y({readOnly:!0,json:{read:!1,write:!0,default:!1}})],w.prototype,"hasM",void 0),g([y({type:ee,nonNullable:!0,json:{write:!0}})],w.prototype,"vertexAttributes",void 0),w=v=g([De(P)],w);const Y=x(),_e=$e(),je=w,ue=()=>m.getLogger("esri.rest.support.meshFeatureSet");function Bn(e,t,n){const r=n.features;n.features=[],delete n.geometryType;const s=kt.fromJSON(n);if(s.geometryType="mesh",!n.assetMaps)return s;const o=Tn(t,n.assetMaps),i=e.sourceSpatialReference??Mt.WGS84,l=n.globalIdFieldName,{outFields:c}=e,a=c!=null&&c.length>0?Pn(c.includes("*")?null:new Set(c)):()=>({});for(const u of r){const p=_n(u,l,i,t,o);p!=null&&s.features.push(new Lt({geometry:p,attributes:a(u)}))}return s}function Pn(e){return({attributes:t})=>{if(!t)return{};if(!e)return t;for(const n in t)e.has(n)||delete t[n];return t}}function _n(e,t,n,r,s){const o=e.attributes[t],i=s.get(o);if(i==null)return ue().error("mesh-feature-set:asset-not-found","Service returned a feature which was not found in the asset map",e),null;if(!e.geometry)return ue().error("mesh-feature-set:no-geometry","Service returned a feature without geometry",e),null;const{originPoint:l,originVector:c}=jn(e,n,r),a=pe.fromJSON(e.geometry);a.spatialReference=n;const u=On(e.attributes,r),p=i.projectVertices?new Ne({origin:c}):new te({origin:c}),f=Dn(i);return f?je.createWithExternalSource(l,f,{extent:a,transform:u,vertexSpace:p}):je.createIncomplete(l,{extent:a,transform:u,vertexSpace:p})}function jn({attributes:e},t,{transformFieldRoles:n}){const r=e[n.originX],s=e[n.originY],o=e[n.originZ];return{originPoint:new F({x:r,y:s,z:o,spatialReference:t}),originVector:Pt(r,s,o)}}function On(e,{transformFieldRoles:t}){return new V({translation:[e[t.translationX],-e[t.translationZ],e[t.translationY]],rotationAxis:[e[t.rotationX],-e[t.rotationZ],e[t.rotationY]],rotationAngle:e[t.rotationDeg],scale:[e[t.scaleX],e[t.scaleZ],e[t.scaleY]]})}var U;function Tn(e,t){const n=new Map;for(const r of t){const s=r.parentGlobalId;if(s==null)continue;const o=r.assetName,i=r.assetType,l=r.assetHash,c=r.assetURL,a=r.conversionStatus,u=r.seqNo,p=_t(i,e.supportedFormats);if(!p){ue().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${i}, but it does not list it as a supported type`);continue}const f=Ae(n,s,()=>({projectVertices:Cn(r.flags).projectVertices,files:new Map}));Ae(f.files,o,()=>({name:o,type:i,mimeType:p,status:kn(a),parts:[]})).parts[u]={hash:l,url:c}}return n}function Dn(e){const t=Array.from(e.files.values()),n=new Array;for(const r of t){if(r.status!==U.COMPLETED)return null;const s=new Array;for(const o of r.parts){if(!o)return null;s.push(new Tt(o.url,o.hash))}n.push(new Dt(r.name,r.mimeType,s))}return n}function kn(e){switch(e){case"COMPLETED":case"SUBMITTED":return U.COMPLETED;case"INPROGRESS":return U.PENDING;default:return U.FAILED}}function Cn(e){return{projectVertices:e.includes("PROJECT_VERTICES")}}(function(e){e[e.FAILED=0]="FAILED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"})(U||(U={}));export{Tn as assetMapFromAssetMapsJSON,_n as extractMesh,Bn as meshFeatureSetFromJSON}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/loadGLTFMesh-g6BxZi9G.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/gltfexport-gleus-sO.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/nb_NO-QiKaA4xA.js b/dist/assets/nb_NO-QiKaA4xA.js new file mode 100644 index 0000000..46e92af --- /dev/null +++ b/dist/assets/nb_NO-QiKaA4xA.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd. MMM yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd. MMM yyyy",_date_day:"dd. MMM",_date_day_full:"dd. MMM yyyy",_date_week:"ww",_date_week_full:"dd. MMM yyyy",_date_month:"MMM",_date_month_full:"MMM yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"a",P:"p",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"januar",February:"februar",March:"mars",April:"april",May:"mai",June:"juni",July:"juli",August:"august",September:"september",October:"oktober",November:"november",December:"desember",Jan:"jan.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"jun.",Jul:"jul.",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"des.",Sunday:"søndag",Monday:"mandag",Tuesday:"tirsdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lørdag",Sun:"søn.",Mon:"man.",Tue:"tir.",Wed:"ons.",Thu:"tor.",Fri:"fre.",Sat:"lør.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Spill av",Stop:"Stopp",Legend:"Tegnforklaring","Press ENTER to toggle":"",Loading:"Laster inn",Home:"Hjem",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Skriv ut",Image:"Bilde",Data:"Data",Print:"Skriv ut","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Fra %1 til %2","From %1":"Fra %1","To %1":"Til %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/dist/assets/nl_NL-YPMyQFKz.js b/dist/assets/nl_NL-YPMyQFKz.js new file mode 100644 index 0000000..1ad71ab --- /dev/null +++ b/dist/assets/nl_NL-YPMyQFKz.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - d MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - d MMM",_date_day:"d MMM",_date_day_full:"d MMM",_date_week:"ww",_date_week_full:"d MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"AD",_era_bc:"v.C.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"a.m.","P.M.":"p.m.",January:"januari",February:"februari",March:"maart",April:"april",May:"mei",June:"juni",July:"juli",August:"augustus",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan",Feb:"feb",Mar:"mrt",Apr:"apr","May(short)":"mei",Jun:"jun",Jul:"jul",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"zondag",Monday:"maandag",Tuesday:"dinsdag",Wednesday:"woensdag",Thursday:"donderdag",Friday:"vrijdag",Saturday:"zaterdag",Sun:"Zo",Mon:"Ma",Tue:"Di",Wed:"Wo",Thu:"Do",Fri:"Vr",Sat:"Za",_dateOrd:function(e){let t="de";return(e==1||e==8||e>19)&&(t="ste"),t},"Zoom Out":"Uitzoomen",Play:"Afspelen",Stop:"Stoppen",Legend:"Legenda","Press ENTER to toggle":"Klik, tik of druk op Enter om aan of uit te zetten",Loading:"Laden",Home:"Home",Chart:"Grafiek","Serial chart":"Periodieke grafiek","X/Y chart":"X-Y grafiek","Pie chart":"Taartdiagram","Gauge chart":"Meterdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankey-diagram","Chord diagram":"Chord-diagram","Flow diagram":"Flow-diagram","TreeMap chart":"Treemap-grafiek",Series:"Reeks","Candlestick Series":"Candlestick-reeks","Column Series":"Kolomreeks","Line Series":"Lijnreeks","Pie Slice Series":"Taartpuntreeks","X/Y Series":"XY reeks",Map:"Kaart","Press ENTER to zoom in":"Druk op Enter om in te zoomen","Press ENTER to zoom out":"Druk op Enter om uit te zoomen","Use arrow keys to zoom in and out":"Zoom in of uit met de pijltjestoetsen","Use plus and minus keys on your keyboard to zoom in and out":"Zoom in of uit met de plus- en minustoetsen",Export:"Exporteren",Image:"Afbeelding",Data:"Data",Print:"Printen","Press ENTER to open":"Klik, tik of druk op Enter om te openen","Press ENTER to print.":"Klik, tik of druk op Enter om te printen","Press ENTER to export as %1.":"Klik, tik of druk op Enter om te exporteren als %1","(Press ESC to close this message)":"(Druk op ESC om dit bericht te sluiten)","Image Export Complete":"Afbeelding exporteren gereed","Export operation took longer than expected. Something might have gone wrong.":"Exportproces duurt langer dan verwacht. Er is misschien iets fout gegaan.","Saved from":"Opgeslagen via:",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Gebruik Tab om de hendels te selecteren of linker- en rechterpijltje om de selectie te veranderen","Use left and right arrows to move selection":"Gebruik linker- en rechterpijltje om de selectie te verplaatsen","Use left and right arrows to move left selection":"Gebruik linker- en rechterpijltje om de linkerselectie te verplaatsen","Use left and right arrows to move right selection":"Gebruik linker- en rechterpijltje om de rechterselectie te verplaatsen","Use TAB select grip buttons or up and down arrows to change selection":"Gebruik Tab om de hendels te selecteren of pijltje omhoog en omlaag om de selectie te veranderen","Use up and down arrows to move selection":"Gebruik pijltje omhoog en omlaag om de selectie te verplaatsen","Use up and down arrows to move lower selection":"Gebruik pijltje omhoog en omlaag om de onderste selectie te verplaatsen","Use up and down arrows to move upper selection":"Gebruik pijltje omhoog en omlaag om de bovenste selectie te verplaatsen","From %1 to %2":"Van %1 tot %2","From %1":"Van %1","To %1":"Tot %2","No parser available for file: %1":"Geen data-parser beschikbaar voor dit bestand: %1","Error parsing file: %1":"Fout tijdens parsen van bestand: %1","Unable to load file: %1":"Kan bestand niet laden: %1","Invalid date":"Ongeldige datum"};export{r as default}; diff --git a/dist/assets/normalizeUtilsSync-zfJiThlh.js b/dist/assets/normalizeUtilsSync-zfJiThlh.js new file mode 100644 index 0000000..a5e1f42 --- /dev/null +++ b/dist/assets/normalizeUtilsSync-zfJiThlh.js @@ -0,0 +1 @@ +import{ae as b,e4 as A,eE as G,eF as J,eG as T,eH as N,eI as X,eJ as z,dz as E,eK as M,eL as F,eM as H,eN as K,eO as p}from"./index-J0iiHjMT.js";function D(e){return k(e,!0)}function Q(e){return k(e,!1)}function k(e,s){if(e==null)return null;const i=e.spatialReference,n=A(i),t=G(e)?e.toJSON():e;if(!n)return t;const h=J(i)?102100:4326,u=T[h].maxX,_=T[h].minX;if(N(t))return S(t,u,_);if(X(t))return t.points=t.points.map(o=>S(o,u,_)),t;if(z(t))return R(t,n);if(E(t)||M(t)){const o=F(j,t),r={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},x=p(r.xmin,_)*(2*u),m=x===0?t:H(t,x);return r.xmin+=x,r.xmax+=x,r.xmax>u?w(m,u,s):r.xmin<_?w(m,_,s):m}return t}function R(e,s){if(!s)return e;const i=$(e,s).map(n=>n.extent);return i.length<2?i[0]||e:i.length>2?(e.xmin=s.valid[0],e.xmax=s.valid[1],e):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(e,s,i){if(Array.isArray(e)){const n=e[0];if(n>s){const t=p(n,s);e[0]=n+t*(-2*s)}else if(ns){const t=p(n,s);e.x+=t*(-2*s)}else if(n0;if(_>2*r){const v={xmin:ha||V?i.push(new l({xmin:x,ymin:n,xmax:r,ymax:t},[m]),new l({xmin:o,ymin:n,xmax:a,ymax:t},[c])):i.push(new l({xmin:x,ymin:n,xmax:a,ymax:t},[m]));return i}function L(e,s){const[i,n]=s.valid,t=2*n;let h,u=0;return e>n?(h=Math.ceil(Math.abs(e-n)/t),e-=h*t,u=h):e=e.xmin&&s<=e.xmax&&i>=e.ymin&&i<=e.ymax}function w(e,s,i=!0){const n=!M(e);if(n&&K(e),i)return new q().cut(e,s);const t=n?e.rings:e.paths,h=n?4:2,u=t.length,_=-2*s;for(let o=0;o=h){const x=[];for(const m of r)x.push([m[0]+_,m[1]]);t.push(x)}}return n?e.rings=t:e.paths=t,e}class l{constructor(s,i){this.extent=s,this.frameIds=i}}const j=b();class q{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.push(h);const t=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=t;n.push(h)}return this._closed?s.rings=n:s.paths=n,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(this._addPolyVertex(this._lineIn,n<=0?s:this._xCut,i),this._addPolyVertex(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_addPolyVertex(s,i,n){const t=s.length;t>1&&s[t-1][0]===i&&s[t-2][0]===i?s[t-1][1]=n:s.push([i,n])}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}export{Q as a,D as p}; diff --git a/dist/assets/number-sTjsTbdA.js b/dist/assets/number-sTjsTbdA.js new file mode 100644 index 0000000..01e70b4 --- /dev/null +++ b/dist/assets/number-sTjsTbdA.js @@ -0,0 +1 @@ +const u=new Float32Array(1);new Uint32Array(u.buffer);function o(r){return[255&r,(65280&r)>>>8,(16711680&r)>>>16,(4278190080&r)>>>24]}function f(r,n){return 65535&r|n<<16}function c(r,n,t,e){return 255&r|(255&n)<<8|(255&t)<<16|e<<24}export{o as M,f as w,c as x}; diff --git a/dist/assets/objectIdUtils-GktMsX8e.js b/dist/assets/objectIdUtils-GktMsX8e.js new file mode 100644 index 0000000..2831ba1 --- /dev/null +++ b/dist/assets/objectIdUtils-GktMsX8e.js @@ -0,0 +1 @@ +const s=1;function c(e,r){var o;let t=0;for(const i of r){const n=(o=i.attributes)==null?void 0:o[e];typeof n=="number"&&isFinite(n)&&(t=Math.max(t,n))}return t}export{c as n,s as t}; diff --git a/dist/assets/observers-JyBmMU24.js b/dist/assets/observers-JyBmMU24.js new file mode 100644 index 0000000..26d896e --- /dev/null +++ b/dist/assets/observers-JyBmMU24.js @@ -0,0 +1,5 @@ +import"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function b(r,n,o){const e=i(r);return new e(n,o)}function i(r){class n extends window.MutationObserver{constructor(e){super(e),this.observedEntry=[],this.callback=e}observe(e,t){return this.observedEntry.push({target:e,options:t}),super.observe(e,t)}unobserve(e){const t=this.observedEntry.filter(s=>s.target!==e);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),t.forEach(s=>this.observe(s.target,s.options))}}return function(){return r==="intersection"?window.IntersectionObserver:r==="mutation"?n:window.ResizeObserver}()}export{b as c}; diff --git a/dist/assets/ogcFeatureUtils-dtzP0u64.js b/dist/assets/ogcFeatureUtils-dtzP0u64.js new file mode 100644 index 0000000..8dd0e12 --- /dev/null +++ b/dist/assets/ogcFeatureUtils-dtzP0u64.js @@ -0,0 +1 @@ +import{Z as L,E as g,bW as F,eP as z,eQ as Q,eR as U,ar as I,eS as V,eT as _,eU as B,cX as O,eV as X,eW as H}from"./index-J0iiHjMT.js";import{E as Y,I as ee,N as ne}from"./geojson-fSjaGZrp.js";import{o as te}from"./clientSideDefaults-F-CNnR0g.js";const $=L.getLogger("esri.layers.graphics.sources.ogcfeature"),C="http://www.opengis.net/def/crs/",fe=`${C}OGC/1.3/CRS84`;async function me(n,t,e={},i=5){const{links:s}=n,l=f(s,"items","application/geo+json")||f(s,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(l==null)throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{data:u}=await F(l.href,{signal:e.signal,query:{limit:i,...e.customParameters,token:e.apiKey},headers:{accept:"application/geo+json"}});Y(u);const o=ee(u,{geometryType:t.geometryType}),d=t.fields||o.fields||[],T=t.hasZ!=null?t.hasZ:o.hasZ,b=o.geometryType,m=t.objectIdField||o.objectIdFieldName||"OBJECTID";let r=t.timeInfo;const j=d.find(({name:a})=>a===m);if(j)j.editable=!1,j.nullable=!1;else{if(!o.objectIdFieldType)throw new g("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");d.unshift({name:m,alias:m,type:o.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(m!==o.objectIdFieldName){const a=d.find(({name:c})=>c===o.objectIdFieldName);a&&(a.type="esriFieldTypeInteger")}d===o.fields&&o.unknownFields.length>0&&$.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:o.unknownFields}});for(const a of d){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),a.type!=="esriFieldTypeOID"&&a.type!=="esriFieldTypeGlobalID"&&(a.editable=a.editable==null||!!a.editable,a.nullable=a.nullable==null||!!a.nullable),!a.name)throw new g("ogc-feature-layer:invalid-field-name","field name is missing",{field:a});if(!z.jsonValues.includes(a.type))throw new g("ogc-feature-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a})}if(r){const a=new Q(d);if(r.startTimeField){const c=a.get(r.startTimeField);c?(r.startTimeField=c.name,c.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const c=a.get(r.endTimeField);c?(r.endTimeField=c.name,c.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const c=a.get(r.trackIdField);c?r.trackIdField=c.name:(r.trackIdField=null,$.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.timeReference||(r.timeReference={timeZoneIANA:U}),r.startTimeField||r.endTimeField||($.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=null)}return{drawingInfo:b?te(b):null,extent:le(n),geometryType:b,fields:d,hasZ:!!T,objectIdField:m,timeInfo:r}}async function pe(n,t={}){const{links:e}=n,i=f(e,"data","application/json")||f(e,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(i==null)throw new g("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:s,customParameters:l,signal:u}=t,{data:o}=await F(i.href,{signal:u,headers:{accept:"application/json"},query:{...l,token:s}});return o}async function ge(n,t={}){const{links:e}=n,i=f(e,"conformance","application/json")||f(e,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(i==null)throw new g("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:s,customParameters:l,signal:u}=t,{data:o}=await F(i.href,{signal:u,headers:{accept:"application/json"},query:{...l,token:s}});return o}async function ye(n,t={}){const{apiKey:e,customParameters:i,signal:s}=t,{data:l}=await F(n,{signal:s,headers:{accept:"application/json"},query:{...i,token:e}});return l}async function we(n,t={}){const e="application/vnd.oai.openapi+json;version=3.0",i=f(n.links,"service-desc",e);if(i==null)return $.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:s,customParameters:l,signal:u}=t,{data:o}=await F(i.href,{signal:u,headers:{accept:e},query:{...l,token:s}});return o}function be(n){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(n),e=t==null?void 0:t.groups;if(!e)return null;const{authority:i,code:s}=e;switch(i.toLowerCase()){case"ogc":switch(s.toLowerCase()){case"crs27":return I.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return I.WGS84.wkid;default:return null}case"esri":case"epsg":{const l=Number.parseInt(s,10);return Number.isNaN(l)?null:l}default:return null}}async function he(n,t,e){const i=await ie(n,t,e);return V(i)}async function ie(n,t,e){const{collection:i,layerDefinition:s,maxRecordCount:l,queryParameters:{apiKey:u,customParameters:o},spatialReference:d,supportedCrs:T}=n,{links:b}=i,m=f(b,"items","application/geo+json")||f(b,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(m==null)throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:r,num:j,start:a,timeExtent:c,where:M}=t;if(t.objectIds)throw new g("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const P=I.fromJSON(d),h=t.outSpatialReference??P,k=h.isWGS84?null:G(h,T),Z=oe(r,T),D=re(c),K=se(M),A=j??(a!=null&&a!==void 0?10:l),{data:y}=await F(m.href,{...e,query:{...o,...Z,crs:k,datetime:D,query:K,limit:A,startindex:a,token:u},headers:{accept:"application/geo+json"}});let x=!1;y.links&&(x=!!y.links.find(N=>N.rel==="next")),!x&&Number.isInteger(y.numberMatched)&&Number.isInteger(y.numberReturned)&&(x=y.numberReturnedi.rel===t&&i.type===e)||n.find(i=>i.rel===t&&!i.type)}export{pe as F,ge as I,he as S,ye as T,C as b,fe as h,me as j,we as k,ie as v,be as x}; diff --git a/dist/assets/openCloseComponent-yw47Oy2q.js b/dist/assets/openCloseComponent-yw47Oy2q.js new file mode 100644 index 0000000..55a7081 --- /dev/null +++ b/dist/assets/openCloseComponent-yw47Oy2q.js @@ -0,0 +1,5 @@ +import{cj as v}from"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */function s(i){return"opened"in i?i.opened:i.open}function E(i,r=!1){(r?i[i.transitionProp]:s(i))?i.onBeforeOpen():i.onBeforeClose(),(r?i[i.transitionProp]:s(i))?i.onOpen():i.onClose()}function L(i,r=!1){v(()=>{if(i.transitionEl){let n=function(a){a.propertyName===i.openTransitionProp&&a.target===i.transitionEl&&(clearTimeout(u),i.transitionEl.removeEventListener("transitionstart",n),(r?i[i.transitionProp]:s(i))?i.onBeforeOpen():i.onBeforeClose())},t=function(a){a.propertyName===i.openTransitionProp&&a.target===i.transitionEl&&((r?i[i.transitionProp]:s(i))?i.onOpen():i.onClose(),i.transitionEl.removeEventListener("transitionend",t),i.transitionEl.removeEventListener("transitioncancel",t))};const{transitionDuration:d,transitionProperty:f}=getComputedStyle(i.transitionEl),e=d.split(","),o=f.split(",").indexOf(i.openTransitionProp),l=e[o]??e[0];if(l==="0s"){E(i,r);return}const u=setTimeout(()=>{i.transitionEl.removeEventListener("transitionstart",n),i.transitionEl.removeEventListener("transitionend",t),i.transitionEl.removeEventListener("transitioncancel",t),E(i,r)},parseFloat(l)*1e3);i.transitionEl.addEventListener("transitionstart",n),i.transitionEl.addEventListener("transitionend",t),i.transitionEl.addEventListener("transitioncancel",t)}})}export{L as o}; diff --git a/dist/assets/optimizedFeatureQueryEngineAdapter-KnoSHZzG.js b/dist/assets/optimizedFeatureQueryEngineAdapter-KnoSHZzG.js new file mode 100644 index 0000000..e27163a --- /dev/null +++ b/dist/assets/optimizedFeatureQueryEngineAdapter-KnoSHZzG.js @@ -0,0 +1 @@ +import{eZ as G,e_ as O}from"./index-J0iiHjMT.js";function Y(t,e){return t?e?4:3:e?3:2}function P(t,e,o,s,c){if(!(e!=null&&e.lengths.length))return null;const l=(c==null?void 0:c.originPosition)==="upperLeft"?-1:1;t.lengths.length&&(t.lengths.length=0),t.coords.length&&(t.coords.length=0);const r=t.coords,I=[],u=o?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:g,coords:T}=e,d=Y(o,s);let m=0;for(const n of g){const i=p(u,T,m,n,o,s,l);i&&I.push(i),m+=n*d}if(I.sort((n,i)=>{let f=l*n[2]-l*i[2];return f===0&&o&&(f=n[4]-i[4]),f}),I.length){let n=6*I[0][2];r[0]=I[0][0]/n,r[1]=I[0][1]/n,o&&(n=6*I[0][4],r[2]=n!==0?I[0][3]/n:0),(r[0]u[1]||r[1]u[3]||o&&(r[2]u[5]))&&(r.length=0)}if(!r.length){const n=e.lengths[0]?S(T,0,g[0],o,s):null;if(!n)return null;r[0]=n[0],r[1]=n[1],o&&n.length>2&&(r[2]=n[2])}return t}function p(t,e,o,s,c,l,r=1){const I=Y(c,l);let u=o,g=o+I,T=0,d=0,m=0,n=0,i=0;for(let V=0,_=s-1;V<_;V++,u+=I,g+=I){const h=e[u],E=e[u+1],N=e[u+2],b=e[g],a=e[g+1],A=e[g+2];let F=h*a-b*E;n+=F,T+=(h+b)*F,d+=(E+a)*F,c&&(F=h*A-b*N,m+=(N+A)*F,i+=F),ht[1]&&(t[1]=h),Et[3]&&(t[3]=E),c&&(Nt[5]&&(t[5]=N))}if(n*r>0&&(n*=-1),i*r>0&&(i*=-1),!n)return null;const f=[T,d,.5*n];return c&&(f[3]=m,f[4]=.5*i),f}function S(t,e,o,s,c){const l=Y(s,c);let r=e,I=e+l,u=0,g=0,T=0,d=0;for(let m=0,n=o-1;m0?s?[g/u,T/u,d/u]:[g/u,T/u]:o>0?s?[t[e],t[e+1],t[e+2]]:[t[e],t[e+1]]:null}function y(t,e,o,s){const c=o-t,l=s-e;return Math.sqrt(c*c+l*l)}function j(t,e,o,s,c,l){const r=s-t,I=c-e,u=l-o;return Math.sqrt(r*r+I*I+u*u)}function M(t,e,o,s){return[t+.5*(o-t),e+.5*(s-e)]}function $(t,e,o,s,c,l){return[t+.5*(s-t),e+.5*(c-e),o+.5*(l-o)]}const w={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new G(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(t.centroid==null&&(t.centroid=P(new O,t.geometry,e.hasZ,e.hasM)),t.centroid)};export{P as n,w as o}; diff --git a/dist/assets/overlay-svg-nrczOnQN.js b/dist/assets/overlay-svg-nrczOnQN.js new file mode 100644 index 0000000..5057fe9 --- /dev/null +++ b/dist/assets/overlay-svg-nrczOnQN.js @@ -0,0 +1 @@ +const I="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbDpzcGFjZT0icHJlc2VydmUiIHN0eWxlPSJmaWxsLXJ1bGU6ZXZlbm9kZDtjbGlwLXJ1bGU6ZXZlbm9kZDtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MS41IiB2aWV3Qm94PSIwIDAgMjU2IDI1NiI+PHBhdGggZD0iTTEyOCA4YzY2LjIzIDAgMTIwIDUzLjc3IDEyMCAxMjAgMCA2Ni4yMy01My43NyAxMjAtMTIwIDEyMEM2MS43NyAyNDggOCAxOTQuMjMgOCAxMjggOCA2MS43NyA2MS43NyA4IDEyOCA4Wm0wIDhjNjEuODE0IDAgMTEyIDUwLjE4NiAxMTIgMTEycy01MC4xODYgMTEyLTExMiAxMTJTMTYgMTg5LjgxNCAxNiAxMjggNjYuMTg2IDE2IDEyOCAxNloiIHN0eWxlPSJmaWxsOnVybCgjYSk7c3Ryb2tlOiMwMDA7c3Ryb2tlLW9wYWNpdHk6LjU7c3Ryb2tlLXdpZHRoOi45NnB4IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtNS4zMzMgLTUuMzMzKSBzY2FsZSgxLjA0MTY3KSIvPjxwYXRoIGQ9Ik0xMjggOGM2Ni4yMyAwIDEyMCA1My43NyAxMjAgMTIwIDAgNjYuMjMtNTMuNzcgMTIwLTEyMCAxMjBDNjEuNzcgMjQ4IDggMTk0LjIzIDggMTI4IDggNjEuNzcgNjEuNzcgOCAxMjggOFptMCA0LjI5OGM2My44NTcgMCAxMTUuNzAyIDUxLjg0NSAxMTUuNzAyIDExNS43MDJTMTkxLjg1NyAyNDMuNzAyIDEyOCAyNDMuNzAyIDEyLjI5OCAxOTEuODU3IDEyLjI5OCAxMjggNjQuMTQzIDEyLjI5OCAxMjggMTIuMjk4WiIgc3R5bGU9ImZpbGw6dXJsKCNiKSIgdHJhbnNmb3JtPSJyb3RhdGUoMTgwIDEyOC41MzQgMTI4LjUzNCkgc2NhbGUoMS4wMDgzNCkiLz48Y2lyY2xlIGN4PSIxMjgiIGN5PSIxMjgiIHI9IjExMiIgc3R5bGU9ImZpbGw6dXJsKCNjKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTUuMzMzIC01LjMzMykgc2NhbGUoMS4wNDE2NykiLz48cGF0aCBkPSJNMTI4IDIwYzkxLjg4NCAxLjgxMSAxMDcgODggMTA3IDg4cy00NS4xODYtMjgtMTA3LTI4LTEwNyAyOC0xMDcgMjggMjEuMjQ0LTg5LjY5IDEwNy04OFoiIHN0eWxlPSJmaWxsOnVybCgjZCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC01LjMzMyAtNS4zMzMpIHNjYWxlKDEuMDQxNjcpIi8+PHBhdGggZD0iTTEyOCAxMzEuNTZWMTU4IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDouOTZweDtzdHJva2UtbGluZWNhcDpidXR0IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCAxMzMuMDc0IDEyNy43NCkgc2NhbGUoMS4wNDE2NykiLz48cGF0aCBkPSJNMTI4IDEyOS42NHYyNi40NCIgc3R5bGU9ImZpbGw6bm9uZTtzdHJva2U6IzAwMDtzdHJva2Utd2lkdGg6Ljk2cHg7c3Ryb2tlLWxpbmVjYXA6YnV0dCIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgMTUwLjA3NCAxNDQuNzQpIHNjYWxlKDEuMDQxNjcpIi8+PHBhdGggZD0iTTEyOCAxMzEuNTZWMTU4IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDouOTZweDtzdHJva2UtbGluZWNhcDpidXR0IiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTMwLjY2OCAxMzAuNDA3KSBzY2FsZSgxLjA0MTY3KSIvPjxwYXRoIGQ9Ik0xMjggMTI5LjY0djI2LjQ0IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS13aWR0aDouOTZweDtzdHJva2UtbGluZWNhcDpidXR0IiB0cmFuc2Zvcm09InJvdGF0ZSgxODAgMTMwLjY2OCAxNDcuNDA3KSBzY2FsZSgxLjA0MTY3KSIvPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9IjAiIHgyPSIxIiB5MT0iMCIgeTI9IjAiIGdyYWRpZW50VHJhbnNmb3JtPSJyb3RhdGUoNDcuNjE3IC0yMS44OCA3NS4xNTYpIHNjYWxlKDIzNy44MzUpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHN0b3Agb2Zmc2V0PSIwIiBzdHlsZT0ic3RvcC1jb2xvcjp3aGl0ZTtzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6I2RhZGFkYTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+PGxpbmVhckdyYWRpZW50IGlkPSJiIiB4MT0iMCIgeDI9IjEiIHkxPSIwIiB5Mj0iMCIgZ3JhZGllbnRUcmFuc2Zvcm09InJvdGF0ZSg0Ny42MTcgLTIxLjg4IDc1LjE1Nikgc2NhbGUoMjM3LjgzNSkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOndoaXRlO3N0b3Atb3BhY2l0eToxIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojOWE5YTlhO3N0b3Atb3BhY2l0eToxIi8+PC9saW5lYXJHcmFkaWVudD48bGluZWFyR3JhZGllbnQgaWQ9ImQiIHgxPSIwIiB4Mj0iMSIgeTE9IjAiIHkyPSIwIiBncmFkaWVudFRyYW5zZm9ybT0icm90YXRlKC05MCAxMDQgLTI0KSBzY2FsZSg2MC4wMjM2KSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPjxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6d2hpdGU7c3RvcC1vcGFjaXR5Oi4wNSIvPjxzdG9wIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6d2hpdGU7c3RvcC1vcGFjaXR5Oi40Ii8+PC9saW5lYXJHcmFkaWVudD48cmFkaWFsR3JhZGllbnQgaWQ9ImMiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRUcmFuc2Zvcm09Im1hdHJpeCgxNjUgLTEgMSAxNjUgMTI4IDIxMSkiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOndoaXRlO3N0b3Atb3BhY2l0eTouNDQiLz48c3RvcCBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOndoaXRlO3N0b3Atb3BhY2l0eTowIi8+PC9yYWRpYWxHcmFkaWVudD48L2RlZnM+PC9zdmc+";export{I as default}; diff --git a/dist/assets/pbf-o0zzptPp.js b/dist/assets/pbf-o0zzptPp.js new file mode 100644 index 0000000..9a704f7 --- /dev/null +++ b/dist/assets/pbf-o0zzptPp.js @@ -0,0 +1 @@ +import{dJ as d,d_ as u}from"./index-J0iiHjMT.js";var h;(function(r){r[r.varint=0]="varint",r[r.fixed64=1]="fixed64",r[r.delimited=2]="delimited",r[r.fixed32=5]="fixed32",r[r.unknown=99]="unknown"})(h||(h={}));const p=4294967296,f=new TextDecoder("utf-8"),c=d("safari")||d("ios")?6:d("ff")?12:32;let g=class o{constructor(t,s,i=0,e=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,s,i,e)}_init(t,s,i,e){this._data=t,this._dataView=s,this._pos=i,this._end=e}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const s=this._decodeVarint();if(this._tag=s>>3,this._dataType=7&s,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;return t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?t:(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?t:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();if(t!==void 0)return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,s=this._pos,i=t.getUint32(s,!0)+t.getUint32(s+4,!0)*p;return this._skip(8),i}getSFixed64(){const t=this._dataView,s=this._pos,i=t.getUint32(s,!0)+t.getInt32(s+4,!0)*p;return this._skip(8),i}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),s=this._pos,i=this._toString(this._data,s,s+t);return this._skip(t),i}getBytes(){const t=this._getLength(),s=this._pos,i=this._toBytes(this._data,s,s+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,s,i,e){const n=this.getMessage(),a=t(n,s,i,e);return n.release(),a}processMessage(t){const s=this.getMessage(),i=t(s);return s.release(),i}getMessage(){const t=this._getLength(),s=o.pool.acquire();return s._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),s}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let s=this._pos,i=0,e=0;if(this._end-s>=10)do{if(e=t[s++],i|=127&e,(128&e)==0||(e=t[s++],i|=(127&e)<<7,(128&e)==0)||(e=t[s++],i|=(127&e)<<14,(128&e)==0)||(e=t[s++],i|=(127&e)<<21,(128&e)==0)||(e=t[s++],i+=268435456*(127&e),(128&e)==0)||(e=t[s++],i+=34359738368*(127&e),(128&e)==0)||(e=t[s++],i+=4398046511104*(127&e),(128&e)==0)||(e=t[s++],i+=562949953421312*(127&e),(128&e)==0)||(e=t[s++],i+=72057594037927940*(127&e),(128&e)==0)||(e=t[s++],i+=9223372036854776e3*(127&e),(128&e)==0))break;throw new Error("Varint too long!")}while(!1);else{let n=1;for(;s!==this._end&&(e=t[s],(128&e)!=0);)++s,i+=(127&e)*n,n*=128;if(s===this._end)throw new Error("Varint overrun!");++s,i+=e*n}return this._pos=s,i}_decodeSVarint(){const t=this._data;let s,i=0,e=0;const n=1&t[this._pos];if(e=t[this._pos++],i|=127&e,(128&e)==0||(e=t[this._pos++],i|=(127&e)<<7,(128&e)==0)||(e=t[this._pos++],i|=(127&e)<<14,(128&e)==0)||(e=t[this._pos++],i|=(127&e)<<21,(128&e)==0)||(e=t[this._pos++],i+=268435456*(127&e),(128&e)==0)||(e=t[this._pos++],i+=34359738368*(127&e),(128&e)==0)||(e=t[this._pos++],i+=4398046511104*(127&e),(128&e)==0))return n?-(i+1)/2:i/2;if(s=BigInt(i),e=t[this._pos++],s+=0x2000000000000n*BigInt(127&e),(128&e)==0||(e=t[this._pos++],s+=0x100000000000000n*BigInt(127&e),(128&e)==0)||(e=t[this._pos++],s+=0x8000000000000000n*BigInt(127&e),(128&e)==0))return Number(n?-(s+1n)/2n:s/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,s,i){if((i=Math.min(this._end,i))-s>c){const a=t.subarray(s,i);return f.decode(a)}let e="",n="";for(let a=s;a{r._data=null,r._dataView=null});export{g as r}; diff --git a/dist/assets/pbfQueryUtils-pWizwTQZ.js b/dist/assets/pbfQueryUtils-pWizwTQZ.js new file mode 100644 index 0000000..6d8ed97 --- /dev/null +++ b/dist/assets/pbfQueryUtils-pWizwTQZ.js @@ -0,0 +1 @@ +import{eW as I,al as w,dA as d,l4 as S,eZ as U,e_ as y,E as G}from"./index-J0iiHjMT.js";import{r as D}from"./pbf-o0zzptPp.js";const F=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let J=class{constructor(e){this._options=e,this.geometryTypes=F,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new I}prepareFeatures(e){this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++}finishFeatureResult(e){if(!(e!=null&&e.features)||!e.hasZ||!this._options.sourceSpatialReference||!e.spatialReference||w(e.spatialReference,this._options.sourceSpatialReference)||e.spatialReference.vcsWkid)return;const a=d(this._options.sourceSpatialReference)/d(e.spatialReference);if(a!==1)for(const n of e.features){if(!S(n))continue;const r=n.geometry.coords;for(let s=2;sa+n,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(e,a){e.coords[this._coordinatePtr++]=a}addCoordinatePoint(e,a){e.coords.push(a)}addLength(e,a){e.lengths.push(a)}addQueryGeometry(e,a){e.queryGeometry=a.queryGeometry,e.queryGeometryType=a.queryGeometryType}createPointGeometry(){return new y}};const h=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],b=["sqlTypeBigInt","sqlTypeBinary","sqlTypeBit","sqlTypeChar","sqlTypeDate","sqlTypeDecimal","sqlTypeDouble","sqlTypeFloat","sqlTypeGeometry","sqlTypeGUID","sqlTypeInteger","sqlTypeLongNVarchar","sqlTypeLongVarbinary","sqlTypeLongVarchar","sqlTypeNChar","sqlTypeNVarchar","sqlTypeOther","sqlTypeReal","sqlTypeSmallInt","sqlTypeSqlXml","sqlTypeTime","sqlTypeTimestamp","sqlTypeTimestamp2","sqlTypeTinyInt","sqlTypeVarbinary","sqlTypeVarchar"],k=["upperLeft","lowerLeft"];function m(t){return t>=h.length?null:h[t]}function R(t){return t>=b.length?null:b[t]}function T(t){return t>=k.length?null:k[t]}function q(t,e){return e>=t.geometryTypes.length?null:t.geometryTypes[e]}function x(t,e,a){const r=t.asUnsafe(),s=e.createPointGeometry(a);for(;r.next();)switch(r.tag()){case 3:{const o=r.getUInt32(),i=r.pos()+o;let c=0;for(;r.pos()t[x]})}}}return Object.freeze(Object.defineProperty(K,Symbol.toStringTag,{value:"Module"}))}var ur,re,dr,ge={exports:{}};ge.exports,ur=ge,ge.exports,re=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,typeof __filename<"u"&&(re=re||__filename),dr=function(K={}){var k,W,t=K;t.ready=new Promise((e,_)=>{k=e,W=_});var x,z,oe,me=Object.assign({},t),Te="./this.program",Oe=typeof window=="object",$=typeof importScripts=="function",Se=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",Y="";function Er(e){return t.locateFile?t.locateFile(e,Y):Y+e}if(Se){var Ne=require("fs"),ye=require("path");Y=$?ye.dirname(Y)+"/":__dirname+"/",x=(e,_)=>(e=Pe(e)?new URL(e):ye.normalize(e),Ne.readFileSync(e,_?void 0:"utf8")),oe=e=>{var _=x(e,!0);return _.buffer||(_=new Uint8Array(_)),_},z=(e,_,r,p=!0)=>{e=Pe(e)?new URL(e):ye.normalize(e),Ne.readFile(e,p?void 0:"utf8",(i,c)=>{i?r(i):_(p?c.buffer:c)})},!t.thisProgram&&process.argv.length>1&&(Te=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),t.inspect=()=>"[Emscripten Module object]"}else(Oe||$)&&($?Y=self.location.href:typeof document<"u"&&document.currentScript&&(Y=document.currentScript.src),re&&(Y=re),Y=Y.indexOf("blob:")!==0?Y.substr(0,Y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",x=e=>{var _=new XMLHttpRequest;return _.open("GET",e,!1),_.send(null),_.responseText},$&&(oe=e=>{var _=new XMLHttpRequest;return _.open("GET",e,!1),_.responseType="arraybuffer",_.send(null),new Uint8Array(_.response)}),z=(e,_,r)=>{var p=new XMLHttpRequest;p.open("GET",e,!0),p.responseType="arraybuffer",p.onload=()=>{p.status==200||p.status==0&&p.response?_(p.response):r()},p.onerror=r,p.send(null)});var ue,ne,br=console.log.bind(console),J=console.error.bind(console);Object.assign(t,me),me=null,typeof WebAssembly!="object"&&q("no native wasm support detected");var Z,V,pe,D,j,ie,ce,he=!1;function de(e,_){e||q(_)}function le(){var e=ne.buffer;t.HEAP8=Z=new Int8Array(e),t.HEAP16=pe=new Int16Array(e),t.HEAPU8=V=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAP32=D=new Int32Array(e),t.HEAPU32=j=new Uint32Array(e),t.HEAPF32=ie=new Float32Array(e),t.HEAPF64=ce=new Float64Array(e)}var mr=[],Me=[],Tr=[];function Or(){fe(mr)}function Sr(){fe(Me)}function Nr(){fe(Tr)}function hr(e){Me.unshift(e)}var se=0,Q=null;function lr(e){se++}function Mr(e){if(--se==0&&Q){var _=Q;Q=null,_()}}function q(e){J(e="Aborted("+e+")"),he=!0,e+=". Build with -sASSERTIONS for more info.";var _=new WebAssembly.RuntimeError(e);throw W(_),_}var ee,vr="data:application/octet-stream;base64,";function ve(e){return e.startsWith(vr)}function Pe(e){return e.startsWith("file://")}function De(e){if(e==ee&&ue)return new Uint8Array(ue);if(oe)return oe(e);throw"both async and sync fetching of the wasm failed"}function Dr(e){if(Oe||$){if(typeof fetch=="function"&&!Pe(e))return fetch(e,{credentials:"same-origin"}).then(_=>{if(!_.ok)throw"failed to load wasm binary file at '"+e+"'";return _.arrayBuffer()}).catch(()=>De(e));if(z)return new Promise((_,r)=>{z(e,p=>_(new Uint8Array(p)),r)})}return Promise.resolve().then(()=>De(e))}function Ae(e,_,r){return Dr(e).then(p=>WebAssembly.instantiate(p,_)).then(p=>p).then(r,p=>{J(`failed to asynchronously prepare wasm: ${p}`),q(p)})}function Ar(e,_,r,p){return e||typeof WebAssembly.instantiateStreaming!="function"||ve(_)||Pe(_)||Se||typeof fetch!="function"?Ae(_,r,p):fetch(_,{credentials:"same-origin"}).then(i=>WebAssembly.instantiateStreaming(i,r).then(p,function(c){return J(`wasm streaming compile failed: ${c}`),J("falling back to ArrayBuffer instantiation"),Ae(_,r,p)}))}function Rr(){var e={a:kr};function _(p,i){return o=p.exports,ne=o.t,le(),hr(o.u),Mr(),o}function r(p){_(p.instance)}return lr(),Ar(ue,ee,e,r).catch(W),{}}ve(ee="pe-wasm.wasm")||(ee=Er(ee));var fe=e=>{for(;e.length>0;)e.shift()(t)};function Gr(e,_="i8"){switch(_.endsWith("*")&&(_="*"),_){case"i1":case"i8":return Z[e>>0];case"i16":return pe[e>>1];case"i32":return D[e>>2];case"i64":q("to do getValue(i64) use WASM_BIGINT");case"float":return ie[e>>2];case"double":return ce[e>>3];case"*":return j[e>>2];default:q(`invalid type for getValue: ${_}`)}}var Re=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,Ge=(e,_,r)=>{for(var p=_+r,i=_;e[i]&&!(i>=p);)++i;if(i-_>16&&e.buffer&&Re)return Re.decode(e.subarray(_,i));for(var c="";_>10,56320|1023&B)}}else c+=String.fromCharCode((31&g)<<6|a)}else c+=String.fromCharCode(g)}return c},L=(e,_)=>e?Ge(V,e,_):"";function Cr(e,_,r){return 0}var Ce=(e,_,r,p)=>{if(!(p>0))return 0;for(var i=r,c=r+p-1,g=0;g=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++g)),a<=127){if(r>=c)break;_[r++]=a}else if(a<=2047){if(r+1>=c)break;_[r++]=192|a>>6,_[r++]=128|63&a}else if(a<=65535){if(r+2>=c)break;_[r++]=224|a>>12,_[r++]=128|a>>6&63,_[r++]=128|63&a}else{if(r+3>=c)break;_[r++]=240|a>>18,_[r++]=128|a>>12&63,_[r++]=128|a>>6&63,_[r++]=128|63&a}}return _[r]=0,r-i},Ir=(e,_,r)=>Ce(e,V,_,r);function jr(e,_,r){return 0}function Ur(e,_,r,p){}var Lr=e=>e%4==0&&(e%100!=0||e%400==0),Fr=[0,31,60,91,121,152,182,213,244,274,305,335],Yr=[0,31,59,90,120,151,181,212,243,273,304,334],wr=e=>(Lr(e.getFullYear())?Fr:Yr)[e.getMonth()]+e.getDate()-1,xr=(e,_)=>_+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*_:NaN;function Hr(e,_,r){var p=xr(e,_),i=new Date(1e3*p);D[r>>2]=i.getSeconds(),D[r+4>>2]=i.getMinutes(),D[r+8>>2]=i.getHours(),D[r+12>>2]=i.getDate(),D[r+16>>2]=i.getMonth(),D[r+20>>2]=i.getFullYear()-1900,D[r+24>>2]=i.getDay();var c=0|wr(i);D[r+28>>2]=c,D[r+36>>2]=-60*i.getTimezoneOffset();var g=new Date(i.getFullYear(),0,1),a=new Date(i.getFullYear(),6,1).getTimezoneOffset(),C=g.getTimezoneOffset(),B=0|(a!=C&&i.getTimezoneOffset()==Math.min(C,a));D[r+32>>2]=B}var Ie=e=>{for(var _=0,r=0;r=55296&&p<=57343?(_+=4,++r):_+=3}return _},je=e=>{var _=Ie(e)+1,r=Ue(_);return r&&Ir(e,r,_),r},Xr=()=>2147483648,zr=e=>{var _=(e-ne.buffer.byteLength+65535)/65536;try{return ne.grow(_),le(),1}catch{}},Ee={},Zr=()=>Te||"./this.program",te=()=>{if(!te.strings){var e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:Zr()};for(var _ in Ee)Ee[_]===void 0?delete e[_]:e[_]=Ee[_];var r=[];for(var _ in e)r.push(`${_}=${e[_]}`);te.strings=r}return te.strings},Wr=(e,_)=>{for(var r=0;r>0]=e.charCodeAt(r);Z[_>>0]=0};function Br(e,_,r,p,i){return 70}var Kr=[null,[],[]],Vr=(e,_)=>{var r=Kr[e];_===0||_===10?((e===1?br:J)(Ge(r,0)),r.length=0):r.push(_)};function qr(e,_,r){var p=r>0?r:Ie(e)+1,i=new Array(p),c=Ce(e,i,0,i.length);return _&&(i.length=c),i}var kr={c:Cr,r:(e,_,r)=>{},h:jr,d:Ur,p:e=>{},o:(e,_)=>{},q:(e,_,r)=>{},j:Hr,n:(e,_,r)=>{var p=new Date().getFullYear(),i=new Date(p,0,1),c=new Date(p,6,1),g=i.getTimezoneOffset(),a=c.getTimezoneOffset(),C=Math.max(g,a);function B(co){var yr=co.toTimeString().match(/\(([A-Za-z ]+)\)$/);return yr?yr[1]:"GMT"}j[e>>2]=60*C,D[_>>2]=+(g!=a);var po=B(i),io=B(c),ar=je(po),gr=je(io);a>2]=ar,j[r+4>>2]=gr):(j[r>>2]=gr,j[r+4>>2]=ar)},l:()=>{q("")},i:()=>Date.now(),s:(e,_,r)=>V.copyWithin(e,_,_+r),m:e=>{var _=V.length;e>>>=0;var r=Xr();if(e>r)return!1;for(var p=(a,C)=>a+(C-a%C)%C,i=1;i<=4;i*=2){var c=_*(1+.2/i);c=Math.min(c,e+100663296);var g=Math.min(r,p(Math.max(e,c),65536));if(zr(g))return!0}return!1},e:(e,_)=>{var r=0;return te().forEach((p,i)=>{var c=_+r;j[e+4*i>>2]=c,Wr(p,c),r+=p.length+1}),0},f:(e,_)=>{var r=te();j[e>>2]=r.length;var p=0;return r.forEach(i=>p+=i.length+1),j[_>>2]=p,0},a:e=>52,g:(e,_,r,p)=>52,k:Br,b:(e,_,r,p)=>{for(var i=0,c=0;c>2],a=j[_+4>>2];_+=8;for(var C=0;C>2]=i,0}},o=Rr();t._webidl_free=e=>(t._webidl_free=o.v)(e),t._webidl_malloc=e=>(t._webidl_malloc=o.w)(e);var ae,Ue=e=>(Ue=o.x)(e),Le=t._emscripten_bind_PeObject_getCode_0=e=>(Le=t._emscripten_bind_PeObject_getCode_0=o.y)(e),Fe=t._emscripten_bind_PeObject_getName_1=(e,_)=>(Fe=t._emscripten_bind_PeObject_getName_1=o.z)(e,_),Ye=t._emscripten_bind_PeObject_getType_0=e=>(Ye=t._emscripten_bind_PeObject_getType_0=o.A)(e),we=t._emscripten_bind_PeCoordsys_getCode_0=e=>(we=t._emscripten_bind_PeCoordsys_getCode_0=o.B)(e),xe=t._emscripten_bind_PeCoordsys_getName_1=(e,_)=>(xe=t._emscripten_bind_PeCoordsys_getName_1=o.C)(e,_),He=t._emscripten_bind_PeCoordsys_getType_0=e=>(He=t._emscripten_bind_PeCoordsys_getType_0=o.D)(e),Xe=t._emscripten_bind_VoidPtr___destroy___0=e=>(Xe=t._emscripten_bind_VoidPtr___destroy___0=o.E)(e),ze=t._emscripten_bind_PeDatum_getSpheroid_0=e=>(ze=t._emscripten_bind_PeDatum_getSpheroid_0=o.F)(e),Ze=t._emscripten_bind_PeDatum_getCode_0=e=>(Ze=t._emscripten_bind_PeDatum_getCode_0=o.G)(e),We=t._emscripten_bind_PeDatum_getName_1=(e,_)=>(We=t._emscripten_bind_PeDatum_getName_1=o.H)(e,_),Be=t._emscripten_bind_PeDatum_getType_0=e=>(Be=t._emscripten_bind_PeDatum_getType_0=o.I)(e),Ke=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=e=>(Ke=t._emscripten_bind_PeDefs_get_PE_BUFFER_MAX_0=o.J)(e),Ve=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=e=>(Ve=t._emscripten_bind_PeDefs_get_PE_NAME_MAX_0=o.K)(e),qe=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=e=>(qe=t._emscripten_bind_PeDefs_get_PE_MGRS_MAX_0=o.L)(e),ke=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=e=>(ke=t._emscripten_bind_PeDefs_get_PE_USNG_MAX_0=o.M)(e),$e=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=e=>($e=t._emscripten_bind_PeDefs_get_PE_DD_MAX_0=o.N)(e),Je=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=e=>(Je=t._emscripten_bind_PeDefs_get_PE_DMS_MAX_0=o.O)(e),Qe=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=e=>(Qe=t._emscripten_bind_PeDefs_get_PE_DDM_MAX_0=o.P)(e),et=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=e=>(et=t._emscripten_bind_PeDefs_get_PE_UTM_MAX_0=o.Q)(e),tt=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=e=>(tt=t._emscripten_bind_PeDefs_get_PE_PARM_MAX_0=o.R)(e),_t=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=e=>(_t=t._emscripten_bind_PeDefs_get_PE_TYPE_NONE_0=o.S)(e),rt=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=e=>(rt=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGCS_0=o.T)(e),ot=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=e=>(ot=t._emscripten_bind_PeDefs_get_PE_TYPE_PROJCS_0=o.U)(e),nt=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=e=>(nt=t._emscripten_bind_PeDefs_get_PE_TYPE_GEOGTRAN_0=o.V)(e),pt=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=e=>(pt=t._emscripten_bind_PeDefs_get_PE_TYPE_COORDSYS_0=o.W)(e),it=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=e=>(it=t._emscripten_bind_PeDefs_get_PE_TYPE_UNIT_0=o.X)(e),ct=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=e=>(ct=t._emscripten_bind_PeDefs_get_PE_TYPE_LINUNIT_0=o.Y)(e),st=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=e=>(st=t._emscripten_bind_PeDefs_get_PE_STR_OPTS_NONE_0=o.Z)(e),Pt=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=e=>(Pt=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_NONE_0=o._)(e),at=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=e=>(at=t._emscripten_bind_PeDefs_get_PE_STR_AUTH_TOP_0=o.$)(e),gt=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=e=>(gt=t._emscripten_bind_PeDefs_get_PE_STR_NAME_CANON_0=o.aa)(e),yt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=e=>(yt=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT_0=o.ba)(e),ut=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=e=>(ut=t._emscripten_bind_PeDefs_get_PE_STR_FMT_WKT2_0=o.ca)(e),dt=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=e=>(dt=t._emscripten_bind_PeDefs_get_PE_PARM_X0_0=o.da)(e),ft=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=e=>(ft=t._emscripten_bind_PeDefs_get_PE_PARM_ND_0=o.ea)(e),Et=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=e=>(Et=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_1_TO_2_0=o.fa)(e),bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=e=>(bt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_2_TO_1_0=o.ga)(e),mt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=e=>(mt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_P_TO_G_0=o.ha)(e),Tt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=e=>(Tt=t._emscripten_bind_PeDefs_get_PE_TRANSFORM_G_TO_P_0=o.ia)(e),Ot=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=e=>(Ot=t._emscripten_bind_PeDefs_get_PE_HORIZON_RECT_0=o.ja)(e),St=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=e=>(St=t._emscripten_bind_PeDefs_get_PE_HORIZON_POLY_0=o.ka)(e),Nt=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=e=>(Nt=t._emscripten_bind_PeDefs_get_PE_HORIZON_LINE_0=o.la)(e),ht=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=e=>(ht=t._emscripten_bind_PeDefs_get_PE_HORIZON_DELTA_0=o.ma)(e),lt=t._emscripten_bind_PeFactory_initialize_1=(e,_)=>(lt=t._emscripten_bind_PeFactory_initialize_1=o.na)(e,_),Mt=t._emscripten_bind_PeFactory_factoryByType_2=(e,_,r)=>(Mt=t._emscripten_bind_PeFactory_factoryByType_2=o.oa)(e,_,r),vt=t._emscripten_bind_PeFactory_fromString_2=(e,_,r)=>(vt=t._emscripten_bind_PeFactory_fromString_2=o.pa)(e,_,r),Dt=t._emscripten_bind_PeFactory_getCode_1=(e,_)=>(Dt=t._emscripten_bind_PeFactory_getCode_1=o.qa)(e,_),At=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=(e,_,r,p,i,c)=>(At=t._emscripten_bind_PeGCSExtent_PeGCSExtent_6=o.ra)(e,_,r,p,i,c),Rt=t._emscripten_bind_PeGCSExtent_getLLon_0=e=>(Rt=t._emscripten_bind_PeGCSExtent_getLLon_0=o.sa)(e),Gt=t._emscripten_bind_PeGCSExtent_getSLat_0=e=>(Gt=t._emscripten_bind_PeGCSExtent_getSLat_0=o.ta)(e),Ct=t._emscripten_bind_PeGCSExtent_getRLon_0=e=>(Ct=t._emscripten_bind_PeGCSExtent_getRLon_0=o.ua)(e),It=t._emscripten_bind_PeGCSExtent_getNLat_0=e=>(It=t._emscripten_bind_PeGCSExtent_getNLat_0=o.va)(e),jt=t._emscripten_bind_PeGCSExtent___destroy___0=e=>(jt=t._emscripten_bind_PeGCSExtent___destroy___0=o.wa)(e),Ut=t._emscripten_bind_PeGeogcs_getDatum_0=e=>(Ut=t._emscripten_bind_PeGeogcs_getDatum_0=o.xa)(e),Lt=t._emscripten_bind_PeGeogcs_getPrimem_0=e=>(Lt=t._emscripten_bind_PeGeogcs_getPrimem_0=o.ya)(e),Ft=t._emscripten_bind_PeGeogcs_getUnit_0=e=>(Ft=t._emscripten_bind_PeGeogcs_getUnit_0=o.za)(e),Yt=t._emscripten_bind_PeGeogcs_getCode_0=e=>(Yt=t._emscripten_bind_PeGeogcs_getCode_0=o.Aa)(e),wt=t._emscripten_bind_PeGeogcs_getName_1=(e,_)=>(wt=t._emscripten_bind_PeGeogcs_getName_1=o.Ba)(e,_),xt=t._emscripten_bind_PeGeogcs_getType_0=e=>(xt=t._emscripten_bind_PeGeogcs_getType_0=o.Ca)(e),Ht=t._emscripten_bind_PeGeogtran_isEqual_1=(e,_)=>(Ht=t._emscripten_bind_PeGeogtran_isEqual_1=o.Da)(e,_),Xt=t._emscripten_bind_PeGeogtran_getGeogcs1_0=e=>(Xt=t._emscripten_bind_PeGeogtran_getGeogcs1_0=o.Ea)(e),zt=t._emscripten_bind_PeGeogtran_getGeogcs2_0=e=>(zt=t._emscripten_bind_PeGeogtran_getGeogcs2_0=o.Fa)(e),Zt=t._emscripten_bind_PeGeogtran_getParameters_0=e=>(Zt=t._emscripten_bind_PeGeogtran_getParameters_0=o.Ga)(e),Wt=t._emscripten_bind_PeGeogtran_loadConstants_0=e=>(Wt=t._emscripten_bind_PeGeogtran_loadConstants_0=o.Ha)(e),Bt=t._emscripten_bind_PeGeogtran_getCode_0=e=>(Bt=t._emscripten_bind_PeGeogtran_getCode_0=o.Ia)(e),Kt=t._emscripten_bind_PeGeogtran_getName_1=(e,_)=>(Kt=t._emscripten_bind_PeGeogtran_getName_1=o.Ja)(e,_),Vt=t._emscripten_bind_PeGeogtran_getType_0=e=>(Vt=t._emscripten_bind_PeGeogtran_getType_0=o.Ka)(e),qt=t._emscripten_bind_PeGTlistExtended_getGTlist_6=(e,_,r,p,i,c,g)=>(qt=t._emscripten_bind_PeGTlistExtended_getGTlist_6=o.La)(e,_,r,p,i,c,g),kt=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=e=>(kt=t._emscripten_bind_PeGTlistExtended_get_PE_GTLIST_OPTS_COMMON_0=o.Ma)(e),$t=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=e=>($t=t._emscripten_bind_PeGTlistExtendedEntry_getEntries_0=o.Na)(e),Jt=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=e=>(Jt=t._emscripten_bind_PeGTlistExtendedEntry_getSteps_0=o.Oa)(e),Qt=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=(e,_)=>(Qt=t._emscripten_bind_PeGTlistExtendedEntry_Delete_1=o.Pa)(e,_),e_=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=e=>(e_=t._emscripten_bind_PeGTlistExtendedGTs_getDirection_0=o.Qa)(e),t_=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=e=>(t_=t._emscripten_bind_PeGTlistExtendedGTs_getGeogtran_0=o.Ra)(e),__=t._emscripten_bind_PeHorizon_getNump_0=e=>(__=t._emscripten_bind_PeHorizon_getNump_0=o.Sa)(e),r_=t._emscripten_bind_PeHorizon_getKind_0=e=>(r_=t._emscripten_bind_PeHorizon_getKind_0=o.Ta)(e),o_=t._emscripten_bind_PeHorizon_getInclusive_0=e=>(o_=t._emscripten_bind_PeHorizon_getInclusive_0=o.Ua)(e),n_=t._emscripten_bind_PeHorizon_getSize_0=e=>(n_=t._emscripten_bind_PeHorizon_getSize_0=o.Va)(e),p_=t._emscripten_bind_PeHorizon_getCoord_0=e=>(p_=t._emscripten_bind_PeHorizon_getCoord_0=o.Wa)(e),i_=t._emscripten_bind_PeInteger_PeInteger_1=e=>(i_=t._emscripten_bind_PeInteger_PeInteger_1=o.Xa)(e),c_=t._emscripten_bind_PeInteger_get_val_0=e=>(c_=t._emscripten_bind_PeInteger_get_val_0=o.Ya)(e),s_=t._emscripten_bind_PeInteger_set_val_1=(e,_)=>(s_=t._emscripten_bind_PeInteger_set_val_1=o.Za)(e,_),P_=t._emscripten_bind_PeInteger___destroy___0=e=>(P_=t._emscripten_bind_PeInteger___destroy___0=o._a)(e),a_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=e=>(a_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_NEW_0=o.$a)(e),g_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=e=>(g_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_OLD_0=o.ab)(e),y_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=e=>(y_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_STYLE_AUTO_0=o.bb)(e),u_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=e=>(u_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_180_ZONE_1_PLUS_0=o.cb)(e),d_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=e=>(d_=t._emscripten_bind_PeNotationMgrs_get_PE_MGRS_ADD_SPACES_0=o.db)(e),f_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=e=>(f_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NONE_0=o.eb)(e),E_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=e=>(E_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_0=o.fb)(e),b_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=e=>(b_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_NS_STRICT_0=o.gb)(e),m_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=e=>(m_=t._emscripten_bind_PeNotationUtm_get_PE_UTM_OPTS_ADD_SPACES_0=o.hb)(e),T_=t._emscripten_bind_PeParameter_getValue_0=e=>(T_=t._emscripten_bind_PeParameter_getValue_0=o.ib)(e),O_=t._emscripten_bind_PeParameter_getCode_0=e=>(O_=t._emscripten_bind_PeParameter_getCode_0=o.jb)(e),S_=t._emscripten_bind_PeParameter_getName_1=(e,_)=>(S_=t._emscripten_bind_PeParameter_getName_1=o.kb)(e,_),N_=t._emscripten_bind_PeParameter_getType_0=e=>(N_=t._emscripten_bind_PeParameter_getType_0=o.lb)(e),h_=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=e=>(h_=t._emscripten_bind_PePCSInfo_getCentralMeridian_0=o.mb)(e),l_=t._emscripten_bind_PePCSInfo_getDomainMinx_0=e=>(l_=t._emscripten_bind_PePCSInfo_getDomainMinx_0=o.nb)(e),M_=t._emscripten_bind_PePCSInfo_getDomainMiny_0=e=>(M_=t._emscripten_bind_PePCSInfo_getDomainMiny_0=o.ob)(e),v_=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=e=>(v_=t._emscripten_bind_PePCSInfo_getDomainMaxx_0=o.pb)(e),D_=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=e=>(D_=t._emscripten_bind_PePCSInfo_getDomainMaxy_0=o.qb)(e),A_=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=e=>(A_=t._emscripten_bind_PePCSInfo_getNorthPoleLocation_0=o.rb)(e),R_=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=e=>(R_=t._emscripten_bind_PePCSInfo_getNorthPoleGeometry_0=o.sb)(e),G_=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=e=>(G_=t._emscripten_bind_PePCSInfo_getSouthPoleLocation_0=o.tb)(e),C_=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=e=>(C_=t._emscripten_bind_PePCSInfo_getSouthPoleGeometry_0=o.ub)(e),I_=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=e=>(I_=t._emscripten_bind_PePCSInfo_isDensificationNeeded_0=o.vb)(e),j_=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=e=>(j_=t._emscripten_bind_PePCSInfo_isGcsHorizonMultiOverlap_0=o.wb)(e),U_=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=e=>(U_=t._emscripten_bind_PePCSInfo_isPannableRectangle_0=o.xb)(e),L_=t._emscripten_bind_PePCSInfo_generate_2=(e,_,r)=>(L_=t._emscripten_bind_PePCSInfo_generate_2=o.yb)(e,_,r),F_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=e=>(F_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_NONE_0=o.zb)(e),Y_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=e=>(Y_=t._emscripten_bind_PePCSInfo_get_PE_PCSINFO_OPTION_DOMAIN_0=o.Ab)(e),w_=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=e=>(w_=t._emscripten_bind_PePCSInfo_get_PE_POLE_OUTSIDE_BOUNDARY_0=o.Bb)(e),x_=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=e=>(x_=t._emscripten_bind_PePCSInfo_get_PE_POLE_POINT_0=o.Cb)(e),H_=t._emscripten_bind_PePrimem_getLongitude_0=e=>(H_=t._emscripten_bind_PePrimem_getLongitude_0=o.Db)(e),X_=t._emscripten_bind_PePrimem_getCode_0=e=>(X_=t._emscripten_bind_PePrimem_getCode_0=o.Eb)(e),z_=t._emscripten_bind_PePrimem_getName_1=(e,_)=>(z_=t._emscripten_bind_PePrimem_getName_1=o.Fb)(e,_),Z_=t._emscripten_bind_PePrimem_getType_0=e=>(Z_=t._emscripten_bind_PePrimem_getType_0=o.Gb)(e),W_=t._emscripten_bind_PeProjcs_getGeogcs_0=e=>(W_=t._emscripten_bind_PeProjcs_getGeogcs_0=o.Hb)(e),B_=t._emscripten_bind_PeProjcs_getParameters_0=e=>(B_=t._emscripten_bind_PeProjcs_getParameters_0=o.Ib)(e),K_=t._emscripten_bind_PeProjcs_getUnit_0=e=>(K_=t._emscripten_bind_PeProjcs_getUnit_0=o.Jb)(e),V_=t._emscripten_bind_PeProjcs_loadConstants_0=e=>(V_=t._emscripten_bind_PeProjcs_loadConstants_0=o.Kb)(e),q_=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=e=>(q_=t._emscripten_bind_PeProjcs_horizonGcsGenerate_0=o.Lb)(e),k_=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=e=>(k_=t._emscripten_bind_PeProjcs_horizonPcsGenerate_0=o.Mb)(e),$_=t._emscripten_bind_PeProjcs_getCode_0=e=>($_=t._emscripten_bind_PeProjcs_getCode_0=o.Nb)(e),J_=t._emscripten_bind_PeProjcs_getName_1=(e,_)=>(J_=t._emscripten_bind_PeProjcs_getName_1=o.Ob)(e,_),Q_=t._emscripten_bind_PeProjcs_getType_0=e=>(Q_=t._emscripten_bind_PeProjcs_getType_0=o.Pb)(e),er=t._emscripten_bind_PeSpheroid_getAxis_0=e=>(er=t._emscripten_bind_PeSpheroid_getAxis_0=o.Qb)(e),tr=t._emscripten_bind_PeSpheroid_getFlattening_0=e=>(tr=t._emscripten_bind_PeSpheroid_getFlattening_0=o.Rb)(e),_r=t._emscripten_bind_PeSpheroid_getCode_0=e=>(_r=t._emscripten_bind_PeSpheroid_getCode_0=o.Sb)(e),rr=t._emscripten_bind_PeSpheroid_getName_1=(e,_)=>(rr=t._emscripten_bind_PeSpheroid_getName_1=o.Tb)(e,_),or=t._emscripten_bind_PeSpheroid_getType_0=e=>(or=t._emscripten_bind_PeSpheroid_getType_0=o.Ub)(e),nr=t._emscripten_bind_PeUnit_getUnitFactor_0=e=>(nr=t._emscripten_bind_PeUnit_getUnitFactor_0=o.Vb)(e),pr=t._emscripten_bind_PeUnit_getCode_0=e=>(pr=t._emscripten_bind_PeUnit_getCode_0=o.Wb)(e),ir=t._emscripten_bind_PeUnit_getName_1=(e,_)=>(ir=t._emscripten_bind_PeUnit_getName_1=o.Xb)(e,_),cr=t._emscripten_bind_PeUnit_getType_0=e=>(cr=t._emscripten_bind_PeUnit_getType_0=o.Yb)(e),sr=t._emscripten_bind_PeVersion_version_string_0=e=>(sr=t._emscripten_bind_PeVersion_version_string_0=o.Zb)(e);function Pr(){function e(){ae||(ae=!0,t.calledRun=!0,he||(Sr(),k(t),Nr()))}se>0||(Or(),se>0||e())}function d(){}function _e(e){return(e||d).__cache__}function T(e,_){var r=_e(_),p=r[e];return p||((p=Object.create((_||d).prototype)).ptr=e,r[e]=p)}function $r(e,_){return T(e.ptr,_)}function Jr(e){if(!e.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";e.__destroy__(),delete _e(e.__class__)[e.ptr]}function Qr(e,_){return e.ptr===_.ptr}function eo(e){return e.ptr}function to(e){return e.__class__}t._pe_getPeGTlistExtendedEntrySize=()=>(t._pe_getPeGTlistExtendedEntrySize=o._b)(),t._pe_getPeGTlistExtendedGTsSize=()=>(t._pe_getPeGTlistExtendedGTsSize=o.$b)(),t._pe_getPeHorizonSize=()=>(t._pe_getPeHorizonSize=o.ac)(),t._pe_geog_to_geog=(e,_,r,p,i)=>(t._pe_geog_to_geog=o.cc)(e,_,r,p,i),t._pe_geog_to_proj=(e,_,r)=>(t._pe_geog_to_proj=o.dc)(e,_,r),t._pe_geog_to_dd=(e,_,r,p,i)=>(t._pe_geog_to_dd=o.ec)(e,_,r,p,i),t._pe_dd_to_geog=(e,_,r,p)=>(t._pe_dd_to_geog=o.fc)(e,_,r,p),t._pe_geog_to_ddm=(e,_,r,p,i)=>(t._pe_geog_to_ddm=o.gc)(e,_,r,p,i),t._pe_ddm_to_geog=(e,_,r,p)=>(t._pe_ddm_to_geog=o.hc)(e,_,r,p),t._pe_geog_to_dms=(e,_,r,p,i)=>(t._pe_geog_to_dms=o.ic)(e,_,r,p,i),t._pe_dms_to_geog=(e,_,r,p)=>(t._pe_dms_to_geog=o.jc)(e,_,r,p),t._pe_geog_to_mgrs_extended=(e,_,r,p,i,c,g)=>(t._pe_geog_to_mgrs_extended=o.kc)(e,_,r,p,i,c,g),t._pe_mgrs_to_geog_extended=(e,_,r,p,i)=>(t._pe_mgrs_to_geog_extended=o.lc)(e,_,r,p,i),t._pe_geog_to_usng=(e,_,r,p,i,c,g)=>(t._pe_geog_to_usng=o.mc)(e,_,r,p,i,c,g),t._pe_usng_to_geog=(e,_,r,p)=>(t._pe_usng_to_geog=o.nc)(e,_,r,p),t._pe_geog_to_utm=(e,_,r,p,i)=>(t._pe_geog_to_utm=o.oc)(e,_,r,p,i),t._pe_utm_to_geog=(e,_,r,p,i)=>(t._pe_utm_to_geog=o.pc)(e,_,r,p,i),t._pe_object_to_string_ext=(e,_,r)=>(t._pe_object_to_string_ext=o.qc)(e,_,r),t._pe_proj_to_geog_center=(e,_,r,p)=>(t._pe_proj_to_geog_center=o.rc)(e,_,r,p),t.___start_em_js=2033306,t.___stop_em_js=2033404,t.getValue=Gr,t.UTF8ToString=L,Q=function e(){ae||Pr(),ae||(Q=e)},Pr(),d.prototype=Object.create(d.prototype),d.prototype.constructor=d,d.prototype.__class__=d,d.__cache__={},t.WrapperObject=d,t.getCache=_e,t.wrapPointer=T,t.castObject=$r,t.NULL=T(0),t.destroy=Jr,t.compare=Qr,t.getPointer=eo,t.getClass=to;var P={buffer:0,size:0,pos:0,temps:[],needed:0,prepare(){if(P.needed){for(var e=0;e=P.size?(de(i>0),P.needed+=i,r=t._webidl_malloc(i),P.temps.push(r)):(r=P.buffer+P.pos,P.pos+=i),r},copy(e,_,r){switch(r>>>=0,_.BYTES_PER_ELEMENT){case 2:r>>>=1;break;case 4:r>>>=2;break;case 8:r>>>=3}for(var p=0;p270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*X(r),s=a*O(r)}}else e||t!="adjusted"||(i=a/2*X(r),s=y/2*O(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Ve=Math.max,fe=Math.min,C=Math.sin,U=Math.sqrt,x=1e-12,q=Math.PI,ne=q/2,ze=2*q;function We(d){return d>1?0:d<-1?q:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function Ue(d){return d.innerRadius}function Ke(d){return d.outerRadius}function Qe(d){return d.startAngle}function qe(d){return d.endAngle}function Ge(d){return d&&d.padAngle}function Je(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,h=g*y-n*o;if(!(h*hk*k+V*V&&(S=Y,I=H),{cx:S,cy:I,x01:-n,y01:-g,x11:S*(s/T-1),y11:I*(s/T-1)}}function $e(){var d=Ue,t=Ke,e=M(0),i=null,s=Qe,r=qe,l=Ge,a=null,y=Ie(o);function o(){var n,g,h=+d.apply(this,arguments),c=+t.apply(this,arguments),m=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-m),b=f>m;if(a||(a=n=y()),cx)if(P>ze-x)a.moveTo(c*B(m),c*C(m)),a.arc(0,0,c,m,f,!b),h>x&&(a.moveTo(h*B(f),h*C(f)),a.arc(0,0,h,f,m,b));else{var u,p,R=m,T=f,w=m,N=f,S=P,I=P,Y=l.apply(this,arguments)/2,H=Y>x&&(i?+i.apply(this,arguments):U(h*h+c*c)),L=fe(Ae(c-h)/2,+e.apply(this,arguments)),D=L,k=L;if(H>x){var V=Pe(H/h*C(Y)),le=Pe(H/c*C(Y));(S-=2*V)>x?(w+=V*=b?1:-1,N-=V):(S=0,w=N=(m+f)/2),(I-=2*le)>x?(R+=le*=b?1:-1,T-=le):(I=0,R=T=(m+f)/2)}var z=c*B(R),W=c*C(R),G=h*B(N),J=h*C(N);if(L>x){var j,$=c*B(T),Z=c*C(T),oe=h*B(w),ue=h*C(w);if(Px?k>x?(u=ee(oe,ue,z,W,c,k,b),p=ee($,Z,G,J,c,k,b),a.moveTo(u.cx+u.x01,u.cy+u.y01),kx&&S>x?D>x?(u=ee(G,J,$,Z,h,-D,b),p=ee(z,W,oe,ue,h,-D,b),a.lineTo(u.cx+u.x01,u.cy+u.y01),D=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=X(l),this.iy=O(l)}if(this.isDirty("shiftRadius")){const t=this.get("shiftRadius",0);this.setRaw("dx",this.ix*t),this.setRaw("dy",this.iy*t),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:je.classNames.concat([se.className])});class Ze extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Ye.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:Xe(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),He(i,"fill",t,"alternativeBackground")}}}class K extends Te{_afterNew(){this._defaultThemes.push(Ze.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([K.className])});class Q extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(me.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this._makeSlices()}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this._makeLabels()}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this._makeTicks()})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return E(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return E(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return E(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(Q,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(Q,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([Q.className])});class _e extends K{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let c=l.value,m=Math.min(y,o);c=Math.max(m*c,m-Math.min(i,e))/m,n=Re(0,0,s,r,c),this.setPrivateRaw("irModifyer",c/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const h=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-h*(a.bottom+a.top)/2,dx:-h*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(c=>{c._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(c=>{c._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([_e.className])});class xe extends Q{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:be(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:be(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>Se._new(this._root,{themeTags:be(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const h=a.get("fill");o._setDefault("fill",h),o._setDefault("stroke",h)}let n=Oe(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let h=r+g.get("radius",0),c=r*O(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:c}),h*=-1,h-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:c}),h+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",h),g.set("y",r*O(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=X(a),o=O(a),n=this.labelsContainer,g=n.get("paddingLeft",0),h=n.get("paddingRight",0);let c=0,m=0;if(c=i.x(),m=i.y(),i.get("textType")=="circular"){const P=i.radius()-i.get("paddingBottom",0),b=i.get("labelAngle",0);c=P*X(b),m=P*O(b)}let f=-h;i.getPrivate("left")&&(f=g),e.set("points",[{x:s.x()+l*y,y:s.y()+l*o},{x:c+f,y:m},{x:c,y:m}])}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:X(l)*a,y:O(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Q.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; diff --git a/dist/assets/pl_PL-1aQ453OS.js b/dist/assets/pl_PL-1aQ453OS.js new file mode 100644 index 0000000..ffb4fd3 --- /dev/null +++ b/dist/assets/pl_PL-1aQ453OS.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n.e.",_era_bc:"p.n.e.",A:"a",P:"p",AM:"AM",PM:"PM","A.M.":"AM","P.M.":"PM",January:"stycznia",February:"lutego",March:"marca",April:"kwietnia",May:"maja",June:"czerwca",July:"lipca",August:"sierpnia",September:"września",October:"października",November:"listopada",December:"grudnia",Jan:"sty",Feb:"lut",Mar:"mar",Apr:"kwi","May(short)":"maj",Jun:"cze",Jul:"lip",Aug:"sie",Sep:"wrz",Oct:"paź",Nov:"lis",Dec:"gru",Sunday:"niedziela",Monday:"poniedziałek",Tuesday:"wtorek",Wednesday:"środa",Thursday:"czwartek",Friday:"piątek",Saturday:"sobota",Sun:"niedz.",Mon:"pon.",Tue:"wt.",Wed:"śr.",Thu:"czw.",Fri:"pt.",Sat:"sob.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zmiana skali",Play:"Odtwarzanie",Stop:"Zatrzymaj",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Wczytywanie",Home:"Strona główna",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Drukuj",Image:"Obraz",Data:"Dane",Print:"Drukuj","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/dist/assets/popover-Jm1QI0N1.js b/dist/assets/popover-Jm1QI0N1.js new file mode 100644 index 0000000..87d863d --- /dev/null +++ b/dist/assets/popover-Jm1QI0N1.js @@ -0,0 +1,16 @@ +import{ac as ve,lO as pe,lP as U,lQ as he,lR as be,lS as T,lT as L,t as y,q as me,H as ge,r as z,v as Z,cn as ye,ks as Ee,z as we,x as Pe,B as ke}from"./index-J0iiHjMT.js";import{f as Fe,c as Te,d as De,a as Ne,r as Ce,F as _}from"./floating-ui-McpI0u1Z.js";import{g as xe}from"./guid-6vN-YNJI.js";import{o as ee}from"./openCloseComponent-yw47Oy2q.js";import{c as Re,d as Oe}from"./locale-pfkq1d6A.js";import{u as Le,c as Ae,s as Be,d as He}from"./t9n-od6MEnI1.js";import{i as ze}from"./key-qdHumIlA.js";import{s as Se,a as Ke,c as Ie}from"./loadable-sxY2K1G3.js";import{c as je}from"./observers-JyBmMU24.js";import{F as Ue}from"./FloatingArrow-BghsONry.js";import{g as Me}from"./component-dtiBfYiX.js";import{d as $e}from"./action-W5zDPNjG.js";import{d as Ge}from"./icon-ZwpY5ksA.js";import{d as qe}from"./loader-QqciGs1c.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + *//*! +* focus-trap 7.5.4 +* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE +*/function te(i,e){var r=Object.keys(i);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(i);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),r.push.apply(r,o)}return r}function ie(i){for(var e=1;e0){var o=e[e.length-1];o!==r&&o.pause()}var l=e.indexOf(r);l===-1||e.splice(l,1),e.push(r)},deactivateTrap:function(e,r){var o=e.indexOf(r);o!==-1&&e.splice(o,1),e.length>0&&e[e.length-1].unpause()}},Ve=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},We=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},B=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},Je=function(e){return B(e)&&!e.shiftKey},Ze=function(e){return B(e)&&e.shiftKey},ae=function(e){return setTimeout(e,0)},re=function(e,r){var o=-1;return e.every(function(l,c){return r(l)?(o=c,!1):!0}),o},A=function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l1?s-1:0),u=1;u=0)n=o.activeElement;else{var t=a.tabbableGroups[0],s=t&&t.firstTabbableNode;n=s||D("fallbackFocus")}if(!n)throw new Error("Your focus-trap needs to have at least one focusable element");return n},C=function(){if(a.containerGroups=a.containers.map(function(n){var t=he(n,c.tabbableOptions),s=be(n,c.tabbableOptions),d=t.length>0?t[0]:void 0,u=t.length>0?t[t.length-1]:void 0,v=s.find(function(h){return T(h)}),p=s.slice().reverse().find(function(h){return T(h)}),m=!!t.find(function(h){return L(h)>0});return{container:n,tabbableNodes:t,focusableNodes:s,posTabIndexesFound:m,firstTabbableNode:d,lastTabbableNode:u,firstDomTabbableNode:v,lastDomTabbableNode:p,nextTabbableNode:function(F){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,P=t.indexOf(F);return P<0?R?s.slice(s.indexOf(F)+1).find(function(O){return T(O)}):s.slice(0,s.indexOf(F)).reverse().find(function(O){return T(O)}):t[P+(R?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(n){return n.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!D("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(n){return n.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},de=function f(n){var t=n.activeElement;if(t)return t.shadowRoot&&t.shadowRoot.activeElement!==null?f(t.shadowRoot):t},k=function f(n){if(n!==!1&&n!==de(document)){if(!n||!n.focus){f(N());return}n.focus({preventScroll:!!c.preventScroll}),a.mostRecentlyFocusedNode=n,Ve(n)&&n.select()}},G=function(n){var t=D("setReturnFocus",n);return t||(t===!1?!1:n)},q=function(n){var t=n.target,s=n.event,d=n.isBackward,u=d===void 0?!1:d;t=t||S(s),C();var v=null;if(a.tabbableGroups.length>0){var p=w(t,s),m=p>=0?a.containerGroups[p]:void 0;if(p<0)u?v=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:v=a.tabbableGroups[0].firstTabbableNode;else if(u){var h=re(a.tabbableGroups,function(I){var j=I.firstTabbableNode;return t===j});if(h<0&&(m.container===t||U(t,c.tabbableOptions)&&!T(t,c.tabbableOptions)&&!m.nextTabbableNode(t,!1))&&(h=p),h>=0){var F=h===0?a.tabbableGroups.length-1:h-1,R=a.tabbableGroups[F];v=L(t)>=0?R.lastTabbableNode:R.lastDomTabbableNode}else B(s)||(v=m.nextTabbableNode(t,!1))}else{var P=re(a.tabbableGroups,function(I){var j=I.lastTabbableNode;return t===j});if(P<0&&(m.container===t||U(t,c.tabbableOptions)&&!T(t,c.tabbableOptions)&&!m.nextTabbableNode(t))&&(P=p),P>=0){var O=P===a.tabbableGroups.length-1?0:P+1,J=a.tabbableGroups[O];v=L(t)>=0?J.firstTabbableNode:J.firstDomTabbableNode}else B(s)||(v=m.nextTabbableNode(t))}}else v=D("fallbackFocus");return v},H=function(n){var t=S(n);if(!(w(t,n)>=0)){if(A(c.clickOutsideDeactivates,n)){g.deactivate({returnFocus:c.returnFocusOnDeactivate});return}A(c.allowOutsideClick,n)||n.preventDefault()}},Y=function(n){var t=S(n),s=w(t,n)>=0;if(s||t instanceof Document)s&&(a.mostRecentlyFocusedNode=t);else{n.stopImmediatePropagation();var d,u=!0;if(a.mostRecentlyFocusedNode)if(L(a.mostRecentlyFocusedNode)>0){var v=w(a.mostRecentlyFocusedNode),p=a.containerGroups[v].tabbableNodes;if(p.length>0){var m=p.findIndex(function(h){return h===a.mostRecentlyFocusedNode});m>=0&&(c.isKeyForward(a.recentNavEvent)?m+1=0&&(d=p[m-1],u=!1))}}else a.containerGroups.some(function(h){return h.tabbableNodes.some(function(F){return L(F)>0})})||(u=!1);else u=!1;u&&(d=q({target:a.mostRecentlyFocusedNode,isBackward:c.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||N())}a.recentNavEvent=void 0},ue=function(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=n;var s=q({event:n,isBackward:t});s&&(B(n)&&n.preventDefault(),k(s))},X=function(n){if(We(n)&&A(c.escapeDeactivates,n)!==!1){n.preventDefault(),g.deactivate();return}(c.isKeyForward(n)||c.isKeyBackward(n))&&ue(n,c.isKeyBackward(n))},Q=function(n){var t=S(n);w(t,n)>=0||A(c.clickOutsideDeactivates,n)||A(c.allowOutsideClick,n)||(n.preventDefault(),n.stopImmediatePropagation())},V=function(){if(a.active)return ne.activateTrap(l,g),a.delayInitialFocusTimer=c.delayInitialFocus?ae(function(){k(N())}):k(N()),o.addEventListener("focusin",Y,!0),o.addEventListener("mousedown",H,{capture:!0,passive:!1}),o.addEventListener("touchstart",H,{capture:!0,passive:!1}),o.addEventListener("click",Q,{capture:!0,passive:!1}),o.addEventListener("keydown",X,{capture:!0,passive:!1}),g},W=function(){if(a.active)return o.removeEventListener("focusin",Y,!0),o.removeEventListener("mousedown",H,!0),o.removeEventListener("touchstart",H,!0),o.removeEventListener("click",Q,!0),o.removeEventListener("keydown",X,!0),g},fe=function(n){var t=n.some(function(s){var d=Array.from(s.removedNodes);return d.some(function(u){return u===a.mostRecentlyFocusedNode})});t&&k(N())},K=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(fe):void 0,x=function(){K&&(K.disconnect(),a.active&&!a.paused&&a.containers.map(function(n){K.observe(n,{subtree:!0,childList:!0})}))};return g={get active(){return a.active},get paused(){return a.paused},activate:function(n){if(a.active)return this;var t=b(n,"onActivate"),s=b(n,"onPostActivate"),d=b(n,"checkCanFocusTrap");d||C(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=o.activeElement,t==null||t();var u=function(){d&&C(),V(),x(),s==null||s()};return d?(d(a.containers.concat()).then(u,u),this):(u(),this)},deactivate:function(n){if(!a.active)return this;var t=ie({onDeactivate:c.onDeactivate,onPostDeactivate:c.onPostDeactivate,checkCanReturnFocus:c.checkCanReturnFocus},n);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,W(),a.active=!1,a.paused=!1,x(),ne.deactivateTrap(l,g);var s=b(t,"onDeactivate"),d=b(t,"onPostDeactivate"),u=b(t,"checkCanReturnFocus"),v=b(t,"returnFocus","returnFocusOnDeactivate");s==null||s();var p=function(){ae(function(){v&&k(G(a.nodeFocusedBeforeActivation)),d==null||d()})};return v&&u?(u(G(a.nodeFocusedBeforeActivation)).then(p,p),this):(p(),this)},pause:function(n){if(a.paused||!a.active)return this;var t=b(n,"onPause"),s=b(n,"onPostPause");return a.paused=!0,t==null||t(),W(),x(),s==null||s(),this},unpause:function(n){if(!a.paused||!a.active)return this;var t=b(n,"onUnpause"),s=b(n,"onPostUnpause");return a.paused=!1,t==null||t(),C(),V(),x(),s==null||s(),this},updateContainerElements:function(n){var t=[].concat(n).filter(Boolean);return a.containers=t.map(function(s){return typeof s=="string"?o.querySelector(s):s}),a.active&&C(),x(),this}},g.updateContainerElements(e),g};const M=globalThis.calciteConfig,tt=(M==null?void 0:M.focusTrapStack)||[];function it(i,e){const{el:r}=i,o=(e==null?void 0:e.focusTrapEl)||r;if(!o)return;const l={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:o,setReturnFocus:c=>(ve(c),!1),...e==null?void 0:e.focusTrapOptions,document:r.ownerDocument,tabbableOptions:pe,trapStack:tt};i.focusTrap=et(o,l)}function oe(i,e){var r;i.focusTrapDisabled||(r=i.focusTrap)==null||r.activate(e)}function $(i,e){var r;(r=i.focusTrap)==null||r.deactivate(e)}function nt(i){var e;(e=i.focusTrap)==null||e.updateContainerElements(i.el)}/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const at=(i,e)=>{const r=i.level?`h${i.level}`:"div";return delete i.level,y(r,{...i},e)};/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContent:"header-content",heading:"heading"},rt="auto",se="aria-controls",ce="aria-expanded";class ot{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=e=>{const{registeredElements:r}=this,o=e.find(l=>r.has(l));return r.get(o)},this.togglePopovers=e=>{const r=e.composedPath(),o=this.queryPopover(r);o&&!o.triggerDisabled&&(o.open=!o.open),Array.from(this.registeredElements.values()).filter(l=>l!==o&&l.autoClose&&l.open&&!r.includes(l)).forEach(l=>l.open=!1)},this.keyHandler=e=>{e.defaultPrevented||(e.key==="Escape"?this.closeAllPopovers():ze(e.key)&&this.togglePopovers(e))},this.clickHandler=e=>{ke(e)&&this.togglePopovers(e)}}registerElement(e,r){this.registeredElementCount++,this.registeredElements.set(e,r),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(e=>e.open=!1)}addListeners(){document.addEventListener("pointerdown",this.clickHandler,{capture:!0}),document.addEventListener("keydown",this.keyHandler,{capture:!0})}removeListeners(){document.removeEventListener("pointerdown",this.clickHandler,{capture:!0}),document.removeEventListener("keydown",this.keyHandler,{capture:!0})}}const st=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-app-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{transform:translateY(-5px)}:host([data-placement^=top]) .calcite-floating-ui-anim{transform:translateY(5px)}:host([data-placement^=left]) .calcite-floating-ui-anim{transform:translateX(5px)}:host([data-placement^=right]) .calcite-floating-ui-anim{transform:translateX(-5px)}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-app-z-index) * -1);fill:var(--calcite-ui-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-ui-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);background-color:var(--calcite-ui-foreground-1)}.arrow::before{outline:1px solid var(--calcite-ui-border-3)}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-ui-border-3)}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1);word-wrap:break-word;word-break:break-word}.container{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-ui-text-1)}.container.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:0.25rem;border-end-end-radius:0.25rem}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",le=new ot,ct=me(class extends ge{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=z(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=z(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=z(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=z(this,"calcitePopoverOpen",6),this.mutationObserver=je("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${xe()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=i=>{this.transitionEl=i},this.setFilteredPlacements=()=>{const{el:i,flipPlacements:e}=this;this.filteredFlipPlacements=e?Fe(e,i):null},this.setUpReferenceElement=(i=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Te(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:r,effectiveReferenceElement:o}=this;i&&r&&!o&&console.warn(`${e.tagName}: reference-element id "${r}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:i,open:e}=this;i&&"setAttribute"in i&&i.setAttribute(ce,Z(e))},this.addReferences=()=>{const{effectiveReferenceElement:i}=this;if(!i)return;const e=this.getId();"setAttribute"in i&&i.setAttribute(se,e),le.registerElement(i,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:i}=this;i&&("removeAttribute"in i&&(i.removeAttribute(se),i.removeAttribute(ce)),le.unregisterElement(i))},this.hide=()=>{this.open=!1},this.storeArrowEl=i=>{this.arrowEl=i,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=De,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=rt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(i){this.open&&(i?$(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(i){ee(this),i&&this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Le(this,this.effectiveLocale)}connectedCallback(){this.setFilteredPlacements(),Re(this),Ae(this),this.setUpReferenceElement(this.hasLoaded),it(this),this.open&&ee(this)}async componentWillLoad(){await Be(this),Se(this)}componentDidLoad(){Ke(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.reposition(),this.hasLoaded=!0}disconnectedCallback(){this.removeReferences(),Oe(this),He(this),Ne(this,this.effectiveReferenceElement,this.el),$(this)}async reposition(i=!1){const{el:e,effectiveReferenceElement:r,placement:o,overlayPositioning:l,flipDisabled:c,filteredFlipPlacements:a,offsetDistance:g,offsetSkidding:b,arrowEl:w}=this;return Ce(this,{floatingEl:e,referenceEl:r,overlayPositioning:l,placement:o,flipDisabled:c,flipPlacements:a,offsetDistance:g,offsetSkidding:b,arrowEl:w,type:"popover"},i)}async setFocus(){await Ie(this),ye(this.el),Ee(this.el)}async updateFocusTrapElements(){nt(this)}getReferenceElement(){const{referenceElement:i,el:e}=this;return(typeof i=="string"?we(e,{id:i}):i)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),$(this)}renderCloseButton(){const{messages:i,closable:e}=this;return e?y("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},y("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,scale:this.scale,text:i.close,ref:r=>this.closeButtonEl=r},y("calcite-icon",{icon:"x",scale:Me(this.scale)}))):null}renderHeader(){const{heading:i,headingLevel:e}=this,r=i?y(at,{class:E.heading,level:e},i):null;return r?y("div",{class:E.header,key:E.header},r,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:i,heading:e,label:r,open:o,pointerDisabled:l,floatingLayout:c}=this,a=i&&o,g=!a,b=l?null:y(Ue,{floatingLayout:c,key:"floating-arrow",ref:this.storeArrowEl});return y(Pe,{"aria-hidden":Z(g),"aria-label":r,"aria-live":"polite","calcite-hydrated-hidden":g,id:this.getId(),role:"dialog"},y("div",{class:{[_.animation]:!0,[_.animationActive]:a},ref:this.setTransitionEl},b,y("div",{class:{[E.hasHeader]:!!e,[E.container]:!0}},this.renderHeader(),y("div",{class:E.content},y("slot",null)),e?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return st}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]}]);function lt(){if(typeof customElements>"u")return;["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ct);break;case"calcite-action":customElements.get(e)||$e();break;case"calcite-icon":customElements.get(e)||Ge();break;case"calcite-loader":customElements.get(e)||qe();break}})}lt();export{at as H,ct as P,lt as d}; diff --git a/dist/assets/portalLayers-AqjAd9kT.js b/dist/assets/portalLayers-AqjAd9kT.js new file mode 100644 index 0000000..c7a3ab6 --- /dev/null +++ b/dist/assets/portalLayers-AqjAd9kT.js @@ -0,0 +1 @@ +import{di as w,bR as L,E as I,dj as v,dk as y,j as f}from"./index-J0iiHjMT.js";import{t as b}from"./requestPresets-18nzHK5y.js";class M{constructor(){this._serviceMetadatas=new Map}async fetchServiceMetadata(a,t){const r=this._serviceMetadatas.get(a);if(r)return r;const n=await b(a,t);return this._serviceMetadatas.set(a,n),n}}function u(e){const a={id:e.id,name:e.name};return e.type==="Oriented Imagery Layer"&&(a.layerType="OrientedImageryLayer"),a}async function g(e,a,t){var r,n;if((e==null?void 0:e.layers)==null||(e==null?void 0:e.tables)==null){const s=await t.fetchServiceMetadata(a);(e=e||{}).layers=e.layers||((r=s==null?void 0:s.layers)==null?void 0:r.map(u)),e.tables=e.tables||((n=s==null?void 0:s.tables)==null?void 0:n.map(u))}return e}function T(e){const a=e.layers;if(a!=null&&a.length)return a[0].id;const t=e.tables;return t!=null&&t.length?t[0].id:null}function p(e){var a,t;return(((a=e==null?void 0:e.layers)==null?void 0:a.length)??0)+(((t=e==null?void 0:e.tables)==null?void 0:t.length)??0)}function G(e){var t;const a=[];return(t=e==null?void 0:e.layers)==null||t.forEach(r=>{r.layerType==="SubtypeGroupLayer"&&a.push(r.id)}),a}function $(e){var a;return(a=e==null?void 0:e.layers)==null?void 0:a.filter(({layerType:t})=>t==="OrientedImageryLayer").map(({id:t})=>t)}async function F(e,a,t){var s,i;if(!(e!=null&&e.url))return a??{};if(a??(a={}),!a.layers){const c=await t.fetchServiceMetadata(e.url);a.layers=(s=c.layers)==null?void 0:s.map(u)}const{serverUrl:r,portalItem:n}=await w(e.url,{sceneLayerItem:e}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return a.tables=[],a;if(!a.tables&&n){const c=await n.fetchData();if(c!=null&&c.tables)a.tables=c.tables.map(u);else{const l=await t.fetchServiceMetadata(r);a.tables=(i=l==null?void 0:l.tables)==null?void 0:i.map(u)}}if(a.tables)for(const c of a.tables)c.url=`${r}/${c.id}`;return a}async function j(e){!e.portalItem||e.portalItem instanceof L||(e={...e,portalItem:new L(e.portalItem)});const a=await C(e.portalItem);return new a.constructor({portalItem:e.portalItem,...a.properties})}async function C(e){await e.load();const a=new M;return O(await S(e,a))}async function S(e,a){switch(e.type){case"Map Service":return V(e,a);case"Feature Service":return W(e,a);case"Feature Collection":return K(e);case"Scene Service":return _(e,a);case"Image Service":return k(e,a);case"Stream Service":return U();case"Vector Tile Service":return D();case"GeoJson":return x();case"CSV":return E();case"KML":return R();case"WFS":return A();case"WMTS":return P();case"WMS":return J();case"Feed":return z();case"Group Layer":return q();default:throw new I("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function O(e){const a=e.className,t=v[a];return{constructor:await t(),properties:e.properties}}async function V(e,a){return await B(e,a)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function W(e,a){const t=await N(e,a);if(typeof t=="object"){const r={};return t.id!=null&&(r.layerId=t.id),{className:t.className||"FeatureLayer",properties:r}}return{className:"GroupLayer"}}async function _(e,a){var r;const t=await N(e,a,async()=>{try{if(!e.url)return[];const{serverUrl:n}=await w(e.url,{sceneLayerItem:e}),s=await a.fetchServiceMetadata(n);return(s==null?void 0:s.tables)??[]}catch{return[]}});if(typeof t=="object"){const n={};let s;if(t.id!=null?(n.layerId=t.id,s=`${e.url}/layers/${t.id}`):s=e.url,(r=e.typeKeywords)==null?void 0:r.length){for(const c of Object.keys(y))if(e.typeKeywords.includes(c))return{className:y[c]}}const i=await a.fetchServiceMetadata(s);return{className:y[i==null?void 0:i.layerType]||"SceneLayer",properties:n}}if(t===!1){const n=await a.fetchServiceMetadata(e.url);if((n==null?void 0:n.layerType)==="Voxel")return{className:"VoxelLayer"}}return{className:"GroupLayer"}}async function K(e){await e.load();const a=f(e,"Map Notes"),t=f(e,"Markup");if(a||t)return{className:"MapNotesLayer"};if(f(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return p(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function k(e,a){var l,o,d;await e.load();const t=((l=e.typeKeywords)==null?void 0:l.map(h=>h.toLowerCase()))??[];if(t.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(t.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await e.fetchData(),n=r==null?void 0:r.layerType;if(n==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(n==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const s=await a.fetchServiceMetadata(e.url),i=(o=s.cacheType)==null?void 0:o.toLowerCase(),c=(d=s.capabilities)==null?void 0:d.toLowerCase().includes("tilesonly");return i==="map"||c?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function U(){return{className:"StreamLayer"}}function D(){return{className:"VectorTileLayer"}}function x(){return{className:"GeoJSONLayer"}}function E(){return{className:"CSVLayer"}}function R(){return{className:"KMLLayer"}}function A(){return{className:"WFSLayer"}}function J(){return{className:"WMSLayer"}}function P(){return{className:"WMTSLayer"}}function z(){return{className:"StreamLayer"}}function q(){return{className:"GroupLayer"}}async function B(e,a){return(await a.fetchServiceMetadata(e.url)).tileInfo}async function N(e,a,t){const r=e.url;if(!r||/\/\d+$/.test(r))return{};await e.load();let n=await e.fetchData();if(e.type==="Feature Service"){const i=await g(n,r,a),c=m(i);if(typeof c=="object"){const l=G(i),o=$(i);c.className=c.id!=null&&l.includes(c.id)?"SubtypeGroupLayer":c.id!=null&&(o!=null&&o.includes(c.id))?"OrientedImageryLayer":"FeatureLayer"}return c}if(e.type==="Scene Service"&&(n=await F(e,n,a)),p(n)>0)return m(n);const s=await a.fetchServiceMetadata(r);return t&&(s.tables=await t()),m(s)}function m(e){return p(e)===1&&{id:T(e)}}const X=Object.freeze(Object.defineProperty({__proto__:null,fromItem:j,selectLayerClassPath:S},Symbol.toStringTag,{value:"Module"}));export{S as L,g as a,M as e,F as i,p as l,G as n,X as p,T as r,$ as s,u as t}; diff --git a/dist/assets/portalUtils-MqaWunxU.js b/dist/assets/portalUtils-MqaWunxU.js new file mode 100644 index 0000000..a7a0bc6 --- /dev/null +++ b/dist/assets/portalUtils-MqaWunxU.js @@ -0,0 +1 @@ +import{bS as u}from"./index-J0iiHjMT.js";function l(r,n){return r===null?n:new u({url:r.field("url")})}export{l}; diff --git a/dist/assets/previewCIMSymbol-ZetpgWRs.js b/dist/assets/previewCIMSymbol-ZetpgWRs.js new file mode 100644 index 0000000..e80bd67 --- /dev/null +++ b/dist/assets/previewCIMSymbol-ZetpgWRs.js @@ -0,0 +1 @@ +import{a4 as w,gP as b,gZ as F,gO as v,gU as j}from"./index-J0iiHjMT.js";import{l as G,n as d}from"./cimAnalyzer-DtyBzAGI.js";import{CIMSymbolRasterizer as R}from"./CIMSymbolRasterizer-o8gx_uXl.js";import"./labelPoint-ysDT9nFH.js";import"./TileClipper-NSFZXMR1.js";import"./definitions-DqQMJYPH.js";import"./number-sTjsTbdA.js";import"./BidiEngine-8z8MVveq.js";import"./rasterizingUtils-6P0UGdzr.js";const h=new R(null,!0),u=w(b.size),S=w(b.maxSize),C=w(b.lineWidth),U=1;async function V(i,e,r){const l=e==null?void 0:e.size;let t=l!=null&&typeof l=="object"&&"width"in l?l.width:l,n=l!=null&&typeof l=="object"&&"height"in l?l.height:l;if(t==null||n==null)if(r==="esriGeometryPolygon")t=u,n=u;else{const a=await $(i,e,r);a&&(t=a.width,n=a.height),r==="esriGeometryPolyline"&&(t=C),t=t!=null&&isFinite(t)?Math.min(t,S):u,n=n!=null&&isFinite(n)?Math.max(Math.min(n,S),U):u}return e.style==="legend"&&r==="esriGeometryPolyline"&&(t=C),{width:t,height:n}}async function $(i,e,r){const{feature:l,fieldMap:t,viewParams:n}=e.cimOptions||e,a=await G.resolveSymbolOverrides(i.data,l,null,t,r,null,n);if(!a)return null;(i=i.clone()).data={type:"CIMSymbolReference",symbol:a},i.data.primitiveOverrides=void 0;const o=[];return d.fetchResources(a,h.resourceManager,o),d.fetchFonts(a,h.resourceManager,o),o.length>0&&await Promise.all(o),d.getEnvelope(a,null,h.resourceManager)}async function H(i,e={}){var M;const{node:r,opacity:l,symbolConfig:t}=e,n=t!=null&&typeof t=="object"&&"isSquareFill"in t&&t.isSquareFill,a=e.cimOptions||e,o=a.geometryType||F((M=i==null?void 0:i.data)==null?void 0:M.symbol),y=await V(i,e,o),{feature:P,fieldMap:I}=a,L=n||o!=="esriGeometryPolygon"?"preview":"legend",f=await h.rasterizeCIMSymbolAsync(i,P,y,L,I,o,null,a.viewParams,a.allowScalingUp);if(!f)return null;const{width:O,height:x}=f,c=document.createElement("canvas");c.width=O,c.height=x,c.getContext("2d").putImageData(f,0,0);const p=v(y.width),g=v(y.height),s=new Image(p,g);s.src=c.toDataURL(),s.ariaLabel=e.ariaLabel??null,s.alt=e.ariaLabel??"",l!=null&&(s.style.opacity=`${l}`);let m=s;if(e.effectView!=null){const z={shape:{type:"image",x:0,y:0,width:p,height:g,src:s.src},fill:null,stroke:null,offset:[0,0]};m=j([[z]],[p,g],{effectView:e.effectView,ariaLabel:e.ariaLabel})}return r&&m&&r.appendChild(m),m}export{H as previewCIMSymbol}; diff --git a/dist/assets/previewSymbol2D-V05bql6S.js b/dist/assets/previewSymbol2D-V05bql6S.js new file mode 100644 index 0000000..9f060be --- /dev/null +++ b/dist/assets/previewSymbol2D-V05bql6S.js @@ -0,0 +1 @@ +import{gP as L,gO as w,gQ as P,gR as Z,gS as V,E as W,gT as j,gU as B,ab as E,gV as T,gW as H,gX as U,gY as x,a4 as Q}from"./index-J0iiHjMT.js";const q="picture-fill",X="picture-marker",Y="simple-fill",G="simple-line",I="simple-marker",J="text",K="Aa",N=L.size,z=L.maxSize,_=L.maxOutlineSize,$=L.lineWidth,D=225,ee=document.createElement("canvas");function A(a,e){const n=ee.getContext("2d"),l=[];return e&&(e.weight&&l.push(e.weight),e.size&&l.push(e.size+"px"),e.family&&l.push(e.family)),n.font=l.join(" "),n.measureText(a).width}const ae=7.2/2.54,le=72/2.54;function ne(a){if(a.length===0)return 0;if(a.length>2){const e=Q(1),n=parseFloat(a);switch(a.slice(-2)){case"px":return n;case"pt":return n*e;case"in":return 72*n*e;case"pc":return 12*n*e;case"mm":return n*ae*e;case"cm":return n*le*e}}return parseFloat(a)}function k(a){const e=a==null?void 0:a.size;return{width:e!=null&&typeof e=="object"&&"width"in e?w(e.width):null,height:e!=null&&typeof e=="object"&&"height"in e?w(e.height):null}}async function ie(a,e){const n=e.fill,l=a.color;if((n==null?void 0:n.type)==="pattern"&&l&&a.type!==q){const c=await H(n.src,l.toCss(!0));n.src=c,e.fill=n}}async function se(a,e,n,l){var p,t,r;if(!("font"in a)||!a.font||e.shape.type!=="text")return;try{await U(a.font)}catch{}const{width:c}=k(l),u=/[\uE600-\uE6FF]/.test(e.shape.text);c!=null||u||(n[0]=A(e.shape.text,{weight:(p=e.font)==null?void 0:p.weight,size:(t=e.font)==null?void 0:t.size,family:(r=e.font)==null?void 0:r.family}))}function oe(a,e,n,l,c){var u;if(a.haloColor!=null&&a.haloSize!=null){c.masking??(c.masking=n.map(()=>[]));const p=w(a.haloSize);l[0]+=p,l[1]+=p,n.unshift([{...e,fill:null,stroke:{color:a.haloColor,width:2*p,join:"round",cap:"round"}}]),c.masking.unshift([{shape:{type:"rect",x:0,y:0,width:l[0]+2*x,height:l[1]+2*x},fill:[255,255,255],stroke:null},{...e,fill:[0,0,0,0],stroke:null}])}a.backgroundColor==null&&a.borderLineColor==null||(l[0]+=2*x,l[1]+=2*x,n.unshift([{shape:{type:"rect",x:0,y:0,width:l[0],height:l[1]},fill:a.backgroundColor,stroke:{color:a.borderLineColor,width:w(a.borderLineSize)}}]),(u=c.masking)==null||u.unshift([]))}function O(a,e){return a>e?"dark":"light"}function te(a,e){var M,S;const n=typeof(e==null?void 0:e.size)=="number"?e==null?void 0:e.size:null,l=n!=null?w(n):null,c=(e==null?void 0:e.maxSize)!=null?w(e.maxSize):null,u=(e==null?void 0:e.rotation)!=null?e.rotation:"angle"in a?a.angle:null,p=P(a);let t=Z(a);ce(a,245)!=="dark"||e!=null&&e.ignoreWhiteSymbols||(t={width:.75,...t,color:"#bdc3c7"});const r={shape:null,fill:p,stroke:t,offset:[0,0]};t!=null&&t.width&&(t.width=Math.min(t.width,_));const d=(t==null?void 0:t.width)||0;let y=(e==null?void 0:e.size)!=null&&((e==null?void 0:e.scale)==null||(e==null?void 0:e.scale)),i=0,s=0,v=!1;switch(a.type){case I:{const h=a.style,{width:m,height:o}=k(e),b=m===o&&m!=null?m:l??Math.min(w(a.size),c||z);switch(i=b,s=b,h){case"circle":r.shape={type:"circle",cx:0,cy:0,r:.5*b},y||(i+=d,s+=d);break;case"cross":r.shape={type:"path",path:[{command:"M",values:[0,.5*s]},{command:"L",values:[i,.5*s]},{command:"M",values:[.5*i,0]},{command:"L",values:[.5*i,s]}]};break;case"diamond":r.shape={type:"path",path:[{command:"M",values:[0,.5*s]},{command:"L",values:[.5*i,0]},{command:"L",values:[i,.5*s]},{command:"L",values:[.5*i,s]},{command:"Z",values:[]}]},y||(i+=d,s+=d);break;case"square":r.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[i,0]},{command:"L",values:[i,s]},{command:"L",values:[0,s]},{command:"Z",values:[]}]},y||(i+=d,s+=d),u&&(v=!0);break;case"triangle":r.shape={type:"path",path:[{command:"M",values:[.5*i,0]},{command:"L",values:[i,s]},{command:"L",values:[0,s]},{command:"Z",values:[]}]},y||(i+=d,s+=d),u&&(v=!0);break;case"x":r.shape={type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[i,s]},{command:"M",values:[i,0]},{command:"L",values:[0,s]}]},u&&(v=!0);break;case"path":r.shape={type:"path",path:a.path||""},y||(i+=d,s+=d),u&&(v=!0),y=!0}break}case G:{const{width:h,height:m}=k(e),o=m??l??d,b=h??$;t&&(t.width=o),i=b,s=o;const g=((M=r==null?void 0:r.stroke)==null?void 0:M.cap)||"butt",f=g==="round";y=!0,r.stroke&&(r.stroke.cap=g==="butt"?"square":g),r.shape={type:"path",path:[{command:"M",values:[f?o/2:0,s/2]},{command:"L",values:[f?i-o/2:i,s/2]}]};break}case q:case Y:{const h=typeof(e==null?void 0:e.symbolConfig)=="object"&&!!((S=e==null?void 0:e.symbolConfig)!=null&&S.isSquareFill),{width:m,height:o}=k(e);i=!h&&m!==o||m==null?l??N:m,s=!h&&m!==o||o==null?i:o,y||(i+=d,s+=d),y=!0,r.shape=h?{type:"path",path:[{command:"M",values:[0,0]},{command:"L",values:[i,0]},{command:"L",values:[i,s]},{command:"L",values:[0,s]},{command:"L",values:[0,0]},{command:"Z",values:[]}]}:V.fill[0];break}case X:{const h=Math.min(w(a.width),c||z),m=Math.min(w(a.height),c||z),{width:o,height:b}=k(e),g=o===b&&o!=null?o:l??Math.max(h,m),f=h/m;i=f<=1?Math.ceil(g*f):g,s=f<=1?g:Math.ceil(g/f),r.shape={type:"image",x:-Math.round(i/2),y:-Math.round(s/2),width:i,height:s,src:a.url||""},u&&(v=!0);break}case J:{const h=a,m=(e==null?void 0:e.overrideText)||h.text||K,o=h.font,{width:b,height:g}=k(e),f=g??l??Math.min(w(o.size),c||z),R=A(m,{weight:o.weight,size:f,family:o.family}),C=/[\uE600-\uE6FF]/.test(m);i=b??(C?f:R),s=f;let F=.25*ne((o?f:0).toString());C&&(F+=5),r.shape={type:"text",text:m,x:h.xoffset||0,y:h.yoffset||F,align:"middle",alignBaseline:h.verticalAlignment,decoration:o&&o.decoration,rotated:h.rotated,kerning:h.kerning},r.font=o&&{size:f,style:o.style,decoration:o.decoration,weight:o.weight,family:o.family};break}}return{shapeDescriptor:r,size:[i,s],renderOptions:{node:e==null?void 0:e.node,scale:y,opacity:e==null?void 0:e.opacity,rotation:u,useRotationSize:v,effectView:e==null?void 0:e.effectView,ariaLabel:e==null?void 0:e.ariaLabel}}}async function ue(a,e){var p;const{shapeDescriptor:n,size:l,renderOptions:c}=te(a,e);if(!n.shape)throw new W("symbolPreview: renderPreviewHTML2D","symbol not supported.");await ie(a,n),await se(a,n,l,e);const u=[[n]];if(typeof(e==null?void 0:e.symbolConfig)=="object"&&((p=e==null?void 0:e.symbolConfig)!=null&&p.applyColorModulation)){const t=.6*l[0];u.unshift([{...n,offset:[-t,0],fill:j(n.fill,-.3)}]),u.push([{...n,offset:[t,0],fill:j(n.fill,.3)}]),l[0]+=2*t,c.scale=!1}return a.type==="text"&&oe(a,n,u,l,c),B(u,l,c)}function ce(a,e=D){const n=P(a),l=Z(a),c=!n||"type"in n?null:new E(n),u=l!=null&&l.color?new E(l==null?void 0:l.color):null,p=c?O(T(c),e):null,t=u?O(T(u),e):null;return t?p?p===t?p:e>=D?"light":"dark":t:p}export{ce as getContrastingBackgroundTheme,te as getRenderSymbolParameters,ue as previewSymbol2D}; diff --git a/dist/assets/previewWebStyleSymbol--GeGTS2s.js b/dist/assets/previewWebStyleSymbol--GeGTS2s.js new file mode 100644 index 0000000..8311002 --- /dev/null +++ b/dist/assets/previewWebStyleSymbol--GeGTS2s.js @@ -0,0 +1 @@ +import{bW as m,gN as u,gO as r,gP as d}from"./index-J0iiHjMT.js";function p(e,i,t){const a=e.thumbnail&&e.thumbnail.url;return a?m(a,{responseType:"image"}).then(s=>{const h=n(s.data,t);return t!=null&&t.node?(t.node.appendChild(h),t.node):h}):u(e).then(s=>s?i(s,t):null)}function n(e,i){const t=!/\\.svg$/i.test(e.src)&&i&&i.disableUpsampling,a=Math.max(e.width,e.height);let s=(i==null?void 0:i.maxSize)!=null?r(i.maxSize):d.maxSize;t&&(s=Math.min(a,s));const h=typeof(i==null?void 0:i.size)=="number"?i==null?void 0:i.size:null,l=Math.min(s,h!=null?r(h):a);if(l!==a){const o=e.width!==0&&e.height!==0?e.width/e.height:1;o>=1?(e.width=l,e.height=l/o):(e.width=l*o,e.height=l)}return e}export{p as previewWebStyleSymbol}; diff --git a/dist/assets/progress-puB9lhY4.js b/dist/assets/progress-puB9lhY4.js new file mode 100644 index 0000000..0ce7917 --- /dev/null +++ b/dist/assets/progress-puB9lhY4.js @@ -0,0 +1,5 @@ +import{q as a,H as n,ch as s,t,dd as o}from"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const l=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-app-z-index);inline-size:100%;overflow:hidden;background:var(--calcite-ui-border-3)}.bar{z-index:var(--calcite-app-z-index);background-color:var(--calcite-ui-brand)}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2)}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",c=a(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},r=s(this.el);return t("div",{"aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},t("div",{class:"track"},t("div",{class:{bar:!0,indeterminate:this.type==="indeterminate",[o.rtl]:r==="rtl",reversed:this.reversed},style:e})),this.text?t("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return l}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function d(){if(typeof customElements>"u")return;["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,c);break}})}d();export{d}; diff --git a/dist/assets/projectExtentUtils-TwA6ooHn.js b/dist/assets/projectExtentUtils-TwA6ooHn.js new file mode 100644 index 0000000..b0e73ca --- /dev/null +++ b/dist/assets/projectExtentUtils-TwA6ooHn.js @@ -0,0 +1 @@ +import{cX as s,cY as a}from"./index-J0iiHjMT.js";function u(l){const r=l.view.spatialReference,e=l.layer.fullExtent,n=e!=null&&e.spatialReference;if(e==null||!n)return Promise.resolve(null);if(n.equals(r))return Promise.resolve(e.clone());const t=s(e,r);return t!=null?Promise.resolve(t):l.view.state.isLocal?a(e,r,l.layer.portalItem).then(o=>!l.destroyed&&o?o:null).catch(()=>null):Promise.resolve(null)}export{u as l}; diff --git a/dist/assets/pt_BR-lyUqGwB2.js b/dist/assets/pt_BR-lyUqGwB2.js new file mode 100644 index 0000000..a22d1ee --- /dev/null +++ b/dist/assets/pt_BR-lyUqGwB2.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(e){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.","(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Não há um interpretador para este arquivo: %1","Error parsing file: %1":"Erro analizando o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"};export{a as default}; diff --git a/dist/assets/pt_PT-o6ZnsHgl.js b/dist/assets/pt_PT-o6ZnsHgl.js new file mode 100644 index 0000000..0177e8f --- /dev/null +++ b/dist/assets/pt_PT-o6ZnsHgl.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"DC",_era_bc:"AC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"Janeiro",February:"Fevereiro",March:"Março",April:"Abril",May:"Maio",June:"Junho",July:"Julho",August:"Agosto",September:"Setembro",October:"Outubro",November:"Novembro",December:"Dezembro",Jan:"Jan",Feb:"Fev",Mar:"Mar",Apr:"Abr","May(short)":"Mai",Jun:"Jun",Jul:"Jul",Aug:"Ago",Sep:"Set",Oct:"Out",Nov:"Nov",Dec:"Dez",Sunday:"Domingo",Monday:"Segunda-feira",Tuesday:"Terça-feira",Wednesday:"Quarta-feira",Thursday:"Quinta-feira",Friday:"Sexta-feira",Saturday:"Sábado",Sun:"Dom",Mon:"Seg",Tue:"Ter",Wed:"Qua",Thu:"Qui",Fri:"Sex",Sat:"Sáb",_dateOrd:function(e){return"º"},"Zoom Out":"Reduzir Zoom",Play:"Play",Stop:"Parar",Legend:"Legenda","Press ENTER to toggle":"Clique, toque ou pressione ENTER para alternar",Loading:"Carregando",Home:"Início",Chart:"Gráfico","Serial chart":"Gráfico Serial","X/Y chart":"Gráfico XY","Pie chart":"Gráfico de Pizza","Gauge chart":"Gráfico Indicador","Radar chart":"Gráfico de Radar","Sankey diagram":"Diagrama Sankey","Chord diagram":"Diagram Chord","Flow diagram":"Diagrama Flow","TreeMap chart":"Gráfico de Mapa de Árvore",Series:"Séries","Candlestick Series":"Séries do Candlestick","Column Series":"Séries de Colunas","Line Series":"Séries de Linhas","Pie Slice Series":"Séries de Fatias de Pizza","X/Y Series":"Séries de XY",Map:"Mapa","Press ENTER to zoom in":"Pressione ENTER para aumentar o zoom","Press ENTER to zoom out":"Pressione ENTER para diminuir o zoom","Use arrow keys to zoom in and out":"Use as setas para diminuir ou aumentar o zoom","Use plus and minus keys on your keyboard to zoom in and out":"Use as teclas mais ou menos no seu teclado para diminuir ou aumentar o zoom",Export:"Exportar",Image:"Imagem",Data:"Dados",Print:"Imprimir","Press ENTER to open":"Clique, toque ou pressione ENTER para abrir","Press ENTER to print.":"Clique, toque ou pressione ENTER para imprimir","Press ENTER to export as %1.":"Clique, toque ou pressione ENTER para exportar como %1.","(Press ESC to close this message)":"(Pressione ESC para fechar esta mensagem)","Image Export Complete":"A exportação da imagem foi completada","Export operation took longer than expected. Something might have gone wrong.":"A exportação da imagem demorou mais do que o experado. Algo deve ter dado errado.","Saved from":"Salvo de",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Use TAB para selecionar os botões ou setas para a direita ou esquerda para mudar a seleção","Use left and right arrows to move selection":"Use as setas para a esquerda ou direita para mover a seleção","Use left and right arrows to move left selection":"Use as setas para a esquerda ou direita para mover a seleção da esquerda","Use left and right arrows to move right selection":"Use as setas para a esquerda ou direita para mover a seleção da direita","Use TAB select grip buttons or up and down arrows to change selection":"Use TAB para selecionar os botões ou setas para cima ou para baixo para mudar a seleção","Use up and down arrows to move selection":"Use as setas para cima ou para baixo para mover a seleção","Use up and down arrows to move lower selection":"Use as setas para cima ou para baixo para mover a seleção de baixo","Use up and down arrows to move upper selection":"Use as setas para cima ou para baixo para mover a seleção de cima","From %1 to %2":"De %1 até %2","From %1":"De %1","To %1":"Até %1","No parser available for file: %1":"Nenhum interpretador está disponível para este arquivo: %1","Error parsing file: %1":"Erro ao analizar o arquivo: %1","Unable to load file: %1":"O arquivo não pôde ser carregado: %1","Invalid date":"Data inválida"};export{a as default}; diff --git a/dist/assets/quantityFormatUtils-NiAiojad.js b/dist/assets/quantityFormatUtils-NiAiojad.js new file mode 100644 index 0000000..94a60a9 --- /dev/null +++ b/dist/assets/quantityFormatUtils-NiAiojad.js @@ -0,0 +1 @@ +import{cw as b,cx as s,cy as f,cz as c,cA as o,cB as l,cC as v,cD as m,cE as $,cF as p,cG as w,cH as d,cI as h,cJ as y,cK as x}from"./index-J0iiHjMT.js";function a(r,u,t,n=2,e="abbr"){return f(r,c(u,t).value,t,n,e)}function i(r,u,t,n=2,e="abbr"){return o(r,c(u,t).value,t,n,e)}function D(r,u,t=2,n="abbr"){return l(r,u.value,u.unit,t,n)}function F(r,u,t=2,n="abbr"){return v(r,u.value,u.unit,t,n)}function T(r,u,t=2,n="abbr"){return m(r,u.value,u.unit,t,n)}function g(r,u,t=2,n="abbr"){return $(r,u.value,u.unit,t,n)}function j(r,u,t=2,n="abbr"){return p(r,u.value,u.unit,t,n)}function B(r,u,t=2,n="abbr"){return w(r,u.value,u.unit,t,n)}function I(r,u,t=2,n="abbr"){return d(r,u.value,u.unit,t,n)}function M(r,u,t=2,n="abbr"){return h(r,u.value,u.unit,t,n)}function U(r,u,t=2,n="abbr"){return y(r,u.value,u.unit,t,n)}function k(r,u,t=2,n="abbr"){return x(r,u.value,u.unit,t,n)}function z(r,u,t){return b(r.value,r.unit,r.rotationType,u,t)}function A(r,u,t){return s(r.value,r.unit,r.rotationType,u,t)}function C(r,u,t,n,e="abbr"){switch(n=n??2,t){case"imperial":return B(r,u,n,e);case"metric":return D(r,u,n,e);default:return a(r,u,t,n,e)}}function E(r,u,t,n=2,e="abbr"){switch(t){case"imperial":return I(r,u,n,e);case"metric":return F(r,u,n,e);default:return i(r,u,t,n,e)}}function G(r,u,t,n=2,e="abbr"){switch(t){case"imperial":return M(r,u,n,e);case"metric":return T(r,u,n,e);default:return a(r,u,t,n,e)}}function H(r,u,t,n=2,e="abbr"){switch(t){case"imperial":return U(r,u,n,e);case"metric":return g(r,u,n,e);default:return i(r,u,t,n,e)}}function J(r,u,t,n=2,e="abbr"){switch(t){case"imperial":return k(r,u,n,e);case"metric":return j(r,u,n,e);default:return a(r,u,t,n,e)}}export{G as F,D as L,B as R,H as S,z as T,A as U,T as d,a as h,J as k,C as q,E as x,M as y}; diff --git a/dist/assets/query-rG0aX6cE.js b/dist/assets/query-rG0aX6cE.js new file mode 100644 index 0000000..4806a0a --- /dev/null +++ b/dist/assets/query-rG0aX6cE.js @@ -0,0 +1 @@ +import{bV as S,bN as x,bW as E,h6 as g,et as f,gb as O}from"./index-J0iiHjMT.js";import{t as R}from"./pbfQueryUtils-pWizwTQZ.js";import{t as b}from"./queryZScale-IaMm02_2.js";function p(r){const e={};for(const i in r){if(i==="declaredClass")continue;const t=r[i];if(t!=null&&typeof t!="function")if(Array.isArray(t)){e[i]=[];for(let n=0;no.data.attachmentGroups)}async function w(n,t,e){const{objectIds:a}=t,o=[];for(const s of a)o.push(p(n.path+"/"+s+"/attachments",e));return Promise.all(o).then(s=>a.map((c,r)=>({parentObjectId:c,attachmentInfos:s[r].data.attachmentInfos})))}export{k as executeAttachmentQuery,w as fetchAttachments,g as processAttachmentQueryResult}; diff --git a/dist/assets/queryEngineUtils-0F1SWi13.js b/dist/assets/queryEngineUtils-0F1SWi13.js new file mode 100644 index 0000000..c44c84a --- /dev/null +++ b/dist/assets/queryEngineUtils-0F1SWi13.js @@ -0,0 +1 @@ +import{gx as a,gy as d,gz as g}from"./index-J0iiHjMT.js";import{r as i}from"./VertexSnappingCandidate-sgrBHAMS.js";function r({x:t,y:e,z:n}){return g(t,e,n??0)}function u(t,e){switch(t.type){case"edge":return t.draped?new a({edgeStart:r(t.start),edgeEnd:r(t.end),targetPoint:r(t.target),objectId:t.objectId,getGroundElevation:e}):new d({edgeStart:r(t.start),edgeEnd:r(t.end),targetPoint:r(t.target),objectId:t.objectId,isDraped:!1});case"vertex":return new i({targetPoint:r(t.target),objectId:t.objectId,isDraped:!1})}}function p(t,e){return t!=null&&t.type==="3d"?(n,o)=>t.elevationProvider.getElevation(n,o,0,e,"ground"):()=>null}export{u as a,p as o}; diff --git a/dist/assets/queryForSymbologySnapping-I1fFQTD_.js b/dist/assets/queryForSymbologySnapping-I1fFQTD_.js new file mode 100644 index 0000000..8086798 --- /dev/null +++ b/dist/assets/queryForSymbologySnapping-I1fFQTD_.js @@ -0,0 +1 @@ +import{bB as O,ar as D,i9 as P,ia as E,s as z,ib as G,ic as B,id as A,bq as H,ie as J,d6 as N}from"./index-J0iiHjMT.js";async function $(a,d,l,p,o){const{elevationProvider:u,renderCoordsHelper:r}=a,{elevationInfo:g}=d,{pointsInFeatures:w,spatialReference:h}=p,y=D.fromJSON(h),I=P(g,!0),b=await E(I,y,o);z(o);const c=[],e=new Set,t=new Set;f.spatialReference=y;const s=a.elevationProvider.spatialReference??a.spatialReference;for(const{objectId:n,points:i}of w){const m=l(n);if(m==null){for(const R of i)c.push(R.z??0);e.add(n);continue}m.isDraped&&t.add(n);const q=m.graphic.geometry;S.setFromElevationInfo(G(q,g)),S.updateFeatureExpressionInfoContext(b,m.graphic,d);for(const{x:R,y:C,z:F}of i)f.x=R,f.y=C,f.z=F??0,await B(f,j,s,0,{signal:o}),A(j,u,S,r,v),c.push(v.z)}return{elevations:c,drapedObjectIds:t,failedObjectIds:e}}const S=new H,f=O(0,0,0,D.WGS84),v=new J,j=[0,0,0];async function k(a,d,l){if(a==null||d.candidates.length===0)return x;const p=a.graphics3DGraphicsByObjectID??a.graphics3DGraphics,o=[],u=[],{renderer:r}=a,g=r!=null&&"arcadeRequired"in r&&r.arcadeRequired?N():null,w=async(e,{graphic:t,graphics3DSymbol:s})=>{const n=await g,i=await a.getRenderingInfoAsync(t,r,n,{signal:l});return i==null?[]:s.queryForSnapping(e,y,i,l)},{candidates:h,spatialReference:y}=d;for(let e=0;e{const r=t.data;if(r.hasOwnProperty("extent"))return t;if(r.features)throw new Error(m);if(r.hasOwnProperty("count"))throw new Error(m);return t})}function R(o,e,n){return e.timeExtent!=null&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):d(o,e,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function d(o,e,n,t={},r={}){const u=typeof o=="string"?p(o):o,y=e.geometry?[e.geometry]:[];return t.responseType=n==="pbf"?"array-buffer":"json",c(y,null,t).then(i=>{const s=i==null?void 0:i[0];s!=null&&((e=e.clone()).geometry=s);const l=j({...u.query,f:n,...r,...g(e,r)});return F(f(u.path,"queryTopFeatures"),{...t,query:{...l,...t.query}})})}export{R as a,I as d,h as m,S as p}; diff --git a/dist/assets/queryZScale-IaMm02_2.js b/dist/assets/queryZScale-IaMm02_2.js new file mode 100644 index 0000000..4d9fc9e --- /dev/null +++ b/dist/assets/queryZScale-IaMm02_2.js @@ -0,0 +1 @@ +import{dB as a}from"./index-J0iiHjMT.js";function u(o,f,e){if(!(e!=null&&e.features)||!e.hasZ)return;const t=a(e.geometryType,f,o.outSpatialReference);if(t!=null)for(const n of e.features)t(n.geometry)}export{u as t}; diff --git a/dist/assets/quickselect-UFB0jJTZ.js b/dist/assets/quickselect-UFB0jJTZ.js new file mode 100644 index 0000000..f5e093a --- /dev/null +++ b/dist/assets/quickselect-UFB0jJTZ.js @@ -0,0 +1 @@ +import{cg as j}from"./index-J0iiHjMT.js";var x,d,q,m={exports:{}};m.exports,x=m,d=function(){function s(t,r,n,o,i){p(t,r,n||0,o||t.length-1,i||b)}function p(t,r,n,o,i){for(;o>n;){if(o-n>600){var c=o-n+1,l=r-n+1,u=Math.log(c),v=.5*Math.exp(2*u/3),g=.5*Math.sqrt(u*v*(c-v)/c)*(l-c/2<0?-1:1);p(t,r,Math.max(n,Math.floor(r-l*v/c+g)),Math.min(o,Math.floor(r+(c-l)*v/c+g)),i)}var a=t[r],e=n,h=o;for(f(t,n,r),i(t[o],a)>0&&f(t,n,o);e0;)h--}i(t[n],a)===0?f(t,n,h):f(t,++h,o),h<=r&&(n=h+1),r<=h&&(o=h-1)}}function f(t,r,n){var o=t[r];t[r]=t[n],t[n]=o}function b(t,r){return tr?1:0}return s},(q=d())!==void 0&&(x.exports=q);const w=j(m.exports);export{w as f}; diff --git a/dist/assets/rasterProjectionHelper-KvYWHIT_.js b/dist/assets/rasterProjectionHelper-KvYWHIT_.js new file mode 100644 index 0000000..177eb14 --- /dev/null +++ b/dist/assets/rasterProjectionHelper-KvYWHIT_.js @@ -0,0 +1 @@ +import{d$ as U,e0 as Rn,dT as W,e1 as v,e2 as O,e3 as Pn,l as un,T as k,e4 as bn,ct as Sn,E as kn,e5 as N,e6 as E,e7 as tn,e8 as En,e9 as Nn,ar as Gn,ea as en}from"./index-J0iiHjMT.js";var D;function xn(n,e,i){return!Sn(n,e,i)}function $(n,e,i){const s=xn(n,e,i);if(s&&!U())throw new kn("rasterprojectionhelper-project","projection engine is not loaded");return s}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(D||(D={}));const on=(n,e,i,s=0)=>{if(i[0]===1)return[0,0];let r=1,t=-1,o=1,c=-1;for(let u=0;un[u]?n[u]:r,t=t>n[u]?t:n[u],o=o>n[u+1]?n[u+1]:o,c=c>n[u+1]?c:n[u+1]);const{cols:f,rows:a}=e,l=(t-r)/f/i[0],d=(c-o)/a/i[1],y=2*s;let x=0,m=!1,h=[0,0];for(let u=0;ux&&(x=M+P,h=[M,P]),y&&x>y){m=!0;break}}if(m)break}return h},Tn={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},I=32,j=4,q=j,J=new Map,K=new Map,B=500;async function Bn(){U()||await Rn()}function Cn(n,e,i){return $(n.spatialReference,e),i?en(e,n.spatialReference,n):en(n.spatialReference,e,n)}function An(n,e,i,s=null){const r=n.spatialReference;if(r.equals(e))return n;$(r,e,s);const t=i.center,o=new W({xmin:t.x-n.x/2,xmax:t.x+n.x/2,ymin:t.y-n.y/2,ymax:t.y+n.y/2,spatialReference:r}),c=v(o,e,s),f=G(e);let a;if(c==null||f!=null&&c.width>=f){const l=O(r)/O(e);a={x:n.x*l,y:n.y*l}}else a={x:c.width,y:c.height};return a}function S(n,e=.01){return O(n)?e/O(n):0}function sn(n,e,i=null,s=!0){const r=n.spatialReference;if(r.equals(e))return n;$(r,e,i);const t=v(n,e,i);return s&&t&&mn([n],[t],r,e),t}function mn(n,e,i,s){const r=A(i,!0),t=A(s,!0),o=S(i,B),c=S(s,B);if(o&&r!=null&&t!=null)for(let f=0;f=t[1]-c&&Math.abs(l-r[0])new k(c[0],c[1],i)),o=v(t,s,r);return r&&mn(t,o,i,s),o.map(c=>c?[c.x,c.y]:[NaN,NaN])}function rn(n){const{inSR:e,outSR:i,datumTransformation:s}=n,r=_(e),{points:t,mask:o}=V(n,r);if(!e.isGeographic){const f=e.wkid?N.coordsys(e.wkid):N.fromString(e.isGeographic?E.PE_TYPE_GEOGCS:E.PE_TYPE_PROJCS,e.wkt2||e.wkt);tn.projToGeog(f,t.length,t)}if(s!=null&&s.steps.length){let f;if(i.isGeographic&&(f=t.map(([l])=>l>179.9955?1:l<-179.9955?-1:0)),s.steps.forEach(l=>{const d=l.wkid?N.geogtran(l.wkid):N.fromString(E.PE_TYPE_GEOGTRAN,l.wkt);En.geogToGeog(d,t.length,t,null,l.isInverse?E.PE_TRANSFORM_2_TO_1:E.PE_TRANSFORM_1_TO_2)}),f)for(let l=0;l179.9955?1:y<-179.9955?-1:0;d&&x&&d!==x&&(t[l][0]=d>0?y+360:y-360)}}if(!i.isGeographic){const f=_(i,!0),a=f!=null&&f.isEnvelope?[f.bbox[1],f.bbox[3]]:[-90,90];zn(t,a);const l=i.wkid?N.coordsys(i.wkid):N.fromString(i.isGeographic?E.PE_TYPE_GEOGCS:E.PE_TYPE_PROJCS,i.wkt2||i.wkt);tn.geogToProj(l,t.length,t)}let c=t;if(o&&t.length!==o.length){c=[];for(let f=0,a=0;fu.getInclusive()===1&&u.getKind()===1);if(!o){if(o=r.find(u=>u.getInclusive()===1&&u.getKind()===0),!o)return null;t=!0}const c=i?0:(s.getNorthPoleLocation()===2?1:0)|(s.getSouthPoleLocation()===2?2:0),f=s.isPannableRectangle(),a=o.getCoord();if(t)return{isEnvelope:t,isPannable:f,vertices:a,coef:null,bbox:[a[0][0]-e,a[0][1]-e,a[1][0]+e,a[1][1]+e],poleLocation:c};let l=0;const d=[];let[y,x]=a[0],[m,h]=a[0];for(let u=0,R=a.length;ug?m:g,h=h>p?h:p}return{isEnvelope:!1,isPannable:f,vertices:a,coef:d,bbox:[y,x,m,h],poleLocation:c}}function V(n,e){const i=[],{cols:s,rows:r,xres:t,yres:o,usePixelCenter:c}=n;let{xmin:f,ymax:a}=n;if(c&&(f+=t/2,a-=o/2),e==null){for(let x=0;x=x&&p<=h;for(let M=0;M=m&&P<=u&&(i.push([p,P]),l[g]=1)}}return{points:i,mask:l}}const d=e.coef,y=[];for(let x=0;x=M&&m<=P){const L=p*m+w;h.push(L),u.push(T)}}let R=h;if(h.length>2){let g=u[0]===2?0:u[0],p=h[0];R=[];for(let w=1;ww-M)}else h[0]>h[1]&&(R=[h[1],h[0]]);y.push(R)}for(let x=0,m=0;x=g[0]&&h<=g[1]&&(i.push([h,R]),l[m]=1);else if(g.length>2){let p=!1;for(let w=0;w=g[w]&&h<=g[w+1]){p=!0;break}p&&(i.push([h,R]),l[m]=1)}}}return{points:i,mask:l}}function zn(n,e){const[i,s]=e;for(let r=0;rs)&&(n[r]=[NaN,NaN])}}function hn(n,e){const i=G(n[0].spatialReference);if(n.length<2||i==null||(e=e??S(n[0].spatialReference),(n=n.filter(c=>c.width>e)).length===1))return n[0];let{xmin:s,xmax:r,ymin:t,ymax:o}=n[0];for(let c=1;cS(r)){const{xmin:a,xmax:l}=n;for(let d=0;d<=t;d++){const y=d===0?a:-o/2,x=d===t?l-o*d:o/2;f[d]=new W({xmin:y,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:r})}}return hn(f.map(a=>ln(a,e,i,s)).filter(Pn))}function Fn(n,e,i){if(n.type==="extent"){const{xmin:s,ymin:r,xmax:t,ymax:o,spatialReference:c}=n;n=new un({rings:[[[s,o],[t,o],[t,r],[s,r],[s,o]]],spatialReference:c})}return n.spatialReference.equals(e)?n:($(n.spatialReference,e,i),v(n,e,i))}function On(n,e){const i=G(e);if(i==null)return null;let{xmin:s,ymin:r,xmax:t,ymax:o}=n;const c=n.spatialReference,f=new un({spatialReference:c,rings:[[[s,r],[t,r],[t,o],[s,o],[s,r]]]}),a=v(f,e);if(a.rings.length!==2||!a.rings[0].length||!a.rings[1].length)return null;const{rings:l}=a,d=S(c),y=new W({spatialReference:e});for(let x=0;x<2;x++){s=t=l[x][0][0],r=o=l[x][0][1];for(let m=0;ml[x][m][0]?l[x][m][0]:s,t=tl[x][m][1]?l[x][m][1]:r,o=o=o.ymax))return null;if(!s||!o)return o;const c=A(t,!0),f=A(e,!0);if(c==null||f==null)return o;const a=S(t,.001),l=S(t,B),d=S(e,.001);if(Math.abs(o.xmin-f[0])l){o.xmin=f[0];const m=[];m.push(new k(n.xmax,n.ymin,t)),m.push(new k(n.xmax,(n.ymin+n.ymax)/2,t)),m.push(new k(n.xmax,n.ymax,t));const h=m.map(u=>sn(u,e,i)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmax=Math.max.apply(null,h)}if(xl){o.xmax=f[1];const m=[];m.push(new k(n.xmin,n.ymin,t)),m.push(new k(n.xmin,(n.ymin+n.ymax)/2,t)),m.push(new k(n.xmin,n.ymax,t));const h=m.map(u=>sn(u,e,i)).filter(u=>!isNaN(u==null?void 0:u.x)).map(u=>u.x);o.xmin=Math.min.apply(null,h)}}else{const y=S(e,.001);Math.abs(o.xmin-f[0])0&&s.outofBoundPointCountq)&&(xn(f,a,n.datumTransformation)&&(f.isGeographic||_(f)),i=[j,j],s=X({...n,spacing:i}),r={cols:s.size[0]+1,rows:s.size[1]+1},o=on(s.offsets,r,i,q)),s.error=o,i[0]>1&&(s.coefficients=fn(s.offsets,r,t)),n.includeGCSGrid&&!f.isGeographic&&!f.isWebMercator)if(a.isGeographic)s.gcsGrid={offsets:s.offsets,coefficients:s.coefficients,spacing:i};else{const l=_(f);if(l!=null&&!l.isEnvelope){const d=Ln(f),y=pn(n.projectedExtent,d),{offsets:x}=X({...n,srcBufferExtent:y,spacing:i}),m=fn(x,r,t);s.gcsGrid={offsets:x,coefficients:m,spacing:i}}}return s}function X(n){const{projectedExtent:e,srcBufferExtent:i,pixelSize:s,datumTransformation:r,rasterTransform:t}=n,o=e.spatialReference,c=i.spatialReference,f=$(o,c),{xmin:a,ymin:l,xmax:d,ymax:y}=e,x=G(c),m=x!=null&&(n.hasWrapAround||(t==null?void 0:t.type)==="gcs-shift"),h=n.spacing||[I,I],u=h[0]*s.x,R=h[1]*s.y,g=h[0]===1,p=Math.ceil((d-a)/u-.1/h[0])+(g?0:1),w=Math.ceil((y-l)/R-.1/h[1])+(g?0:1),M=_n({cols:p,rows:w,xmin:a,ymax:y,xres:u,yres:R,inSR:o,outSR:c,datumTransformation:r,preferPE:h[0]<=j,usePixelCenter:g}),P=[];let T,L=0;const H=g?-1:NaN,{xmin:Q,xmax:F,ymax:gn,width:yn,height:dn}=i,wn=S(c,B),Mn=x!=null&&Q>0&&F>x/2;let Z=!1;if(f){const C=_(o);Z=C!=null&&C.poleLocation>0}for(let C=0;CF&&b[0]>x/2-wn?b[0]-=x:m&&C===0&&b[0]<0&&Mn&&!t&&(b[0]+=x),!b||isNaN(b[0])||isNaN(b[1]))P.push(H),P.push(H),Y.push(null),L++;else{if(t){const nn=t.inverseTransform(new k({x:b[0],y:b[1],spatialReference:c}));b=[nn.x,nn.y]}Y.push(b),C>0&&m&&T[z]&&b[0]F&&b[0]>x&&(b[0]-=x)),P.push((b[0]-Q)/yn),P.push((gn-b[1])/dn)}}T=Y}return{offsets:P,error:null,coefficients:null,outofBoundPointCount:L,spacing:h,size:g?[p,w]:[p-1,w-1]}}function fn(n,e,i){const{cols:s,rows:r}=e,t=new Float32Array((s-1)*(r-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),c=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let f=0;fr){const c=n.xmin-r;o=-Math.ceil(c/t)}return new W({spatialReference:n.spatialReference,xmin:n.xmin+o*t,ymin:n.ymin,xmax:n.xmax+o*t,ymax:n.ymax})}function Kn(n,e,i){var m;const{storageInfo:s,pixelSize:r}=e;let t=0,o=!1;const{pyramidResolutions:c}=s,f=((m=s.tileInfo.format)==null?void 0:m.toLowerCase())==="mixed"?Math.max(1,Math.min(3,s.tileInfo.dpi/96)):1,a=(n.x+n.y)/2/f;if(c!=null&&c.length){const h=c[c.length-1],u=(h.x+h.y)/2,R=(r.x+r.y)/2;if(a<=R)t=0;else if(a>=u)t=c.length,o=a/u>8;else{let p,w=R;for(let M=1;M<=c.length;M++){if(p=(c[M-1].x+c[M-1].y)/2,a<=p){a===p?t=M:i==="down"?(t=M-1,o=a/w>8):t=i==="up"||a-w>p-a||a/w>2?M:M-1;break}w=p}}const g=t===0?r:c[t-1];return o&&Math.min(g.x,g.y)*O(e.spatialReference)>19567&&(o=!1),{pyramidLevel:t,pyramidResolution:new k({x:g.x,y:g.y,spatialReference:e.spatialReference}),excessiveReading:o}}const l=Math.log(n.x/r.x)/Math.LN2,d=Math.log(n.y/r.y)/Math.LN2,y=e.storageInfo.maximumPyramidLevel||0;t=i==="down"?Math.floor(Math.min(l,d)):i==="up"?Math.ceil(Math.max(l,d)):Math.round((l+d)/2),t<0?t=0:t>y&&(o=t>y+3,t=y);const x=2**t;return{pyramidLevel:t,pyramidResolution:new k({x:x*e.nativePixelSize.x,y:x*e.nativePixelSize.y,spatialReference:e.spatialReference}),excessiveReading:o}}function Xn(n,e){const{pixelSize:i,extent:s}=n,r=Cn(s,e,!1);return pn(In(s,(i.x+i.y)/16),e,r)}export{An as C,G as D,pn as J,xn as M,Bn as T,Fn as U,Wn as V,Yn as Z,qn as e,sn as j,Jn as o,Kn as r,Xn as s,Cn as v}; diff --git a/dist/assets/rasterizingUtils-6P0UGdzr.js b/dist/assets/rasterizingUtils-6P0UGdzr.js new file mode 100644 index 0000000..5d5907d --- /dev/null +++ b/dist/assets/rasterizingUtils-6P0UGdzr.js @@ -0,0 +1 @@ +import{fW as x,fX as u}from"./index-J0iiHjMT.js";const C=e=>e==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function k(e,i,T){const F=x(Math.ceil(T)),a=C(i)?8*F:16*F,o=2*F;e.width=a,e.height=a;const t=e.getContext("2d");t.strokeStyle="#FFFFFF",t.lineWidth=F,t.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(t.moveTo(a/2,-o),t.lineTo(a/2,a+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(t.moveTo(-o,a/2),t.lineTo(a+o,a/2)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSForwardDiagonal"||(t.moveTo(-o,-o),t.lineTo(a+o,a+o),t.moveTo(a-o,-o),t.lineTo(a+o,o),t.moveTo(-o,a-o),t.lineTo(o,a+o)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSBackwardDiagonal"&&i!=="esriSFSDiagonalCross"||(t.moveTo(a+o,-o),t.lineTo(-o,a+o),t.moveTo(o,-o),t.lineTo(-o,o),t.moveTo(a+o,a-o),t.lineTo(a-o,a+o)),t.stroke();const d=t.getImageData(0,0,e.width,e.height),s=new Uint8Array(d.data);let l;for(let n=0;n{let n,r,l,u,s;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(n=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await n.text(),t!=="json")))){try{r=JSON.parse(u||null)}catch(i){const b={...i,url:o,requestOptions:a};throw new p("request:server",i.message,b)}if(r.error){const i={...r.error,url:o,requestOptions:a};throw new p("request:server",r.error.message,i)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":s=n;break;case"json":s=r;break;case"native":s=l;break;case"text":s=u;break;default:s=e.data}return{data:s,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{d as execute}; diff --git a/dist/assets/requestPresets-18nzHK5y.js b/dist/assets/requestPresets-18nzHK5y.js new file mode 100644 index 0000000..14d6d7b --- /dev/null +++ b/dist/assets/requestPresets-18nzHK5y.js @@ -0,0 +1 @@ +import{bW as a}from"./index-J0iiHjMT.js";async function s(e,t){const{data:r}=await a(e,{responseType:"json",query:{f:"json",...t==null?void 0:t.customParameters,token:t==null?void 0:t.apiKey}});return r}export{s as t}; diff --git a/dist/assets/resources2-gI505pgk.js b/dist/assets/resources2-gI505pgk.js new file mode 100644 index 0000000..ffe6226 --- /dev/null +++ b/dist/assets/resources2-gI505pgk.js @@ -0,0 +1,5 @@ +/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const n={container:"container",containerLink:"container--link",containerMulti:"container--multi-selection",containerSingle:"container--single-selection",containerNone:"container--none-selection",icon:"dropdown-item-icon",iconEnd:"dropdown-item-icon-end",iconStart:"dropdown-item-icon-start",itemContent:"dropdown-item-content",link:"dropdown-link"};export{n as C}; diff --git a/dist/assets/ro_RO-YIwLBwwg.js b/dist/assets/ro_RO-YIwLBwwg.js new file mode 100644 index 0000000..1094104 --- /dev/null +++ b/dist/assets/ro_RO-YIwLBwwg.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"d.Hr.",_era_bc:"î.Hr.",A:"a.m.",P:"p.m.",AM:"a.m.",PM:"p.m.","A.M.":"a.m.","P.M.":"p.m.",January:"ianuarie",February:"februarie",March:"martie",April:"aprilie",May:"mai",June:"iunie",July:"iulie",August:"august",September:"septembrie",October:"octombrie",November:"noiembrie",December:"decembrie",Jan:"ian.",Feb:"feb.",Mar:"mar.",Apr:"apr.","May(short)":"mai",Jun:"iun.",Jul:"iul.",Aug:"aug.",Sep:"sept.",Oct:"oct.",Nov:"nov.",Dec:"dec.",Sunday:"duminică",Monday:"luni",Tuesday:"marți",Wednesday:"miercuri",Thursday:"joi",Friday:"vineri",Saturday:"sâmbătă",Sun:"dum.",Mon:"lun.",Tue:"mar.",Wed:"mie.",Thu:"joi",Fri:"vin.",Sat:"sâm.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zoom",Play:"Redare",Stop:"Oprire",Legend:"Legendă","Press ENTER to toggle":"",Loading:"Se încarcă",Home:"Pagina principală",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Imprimare",Image:"Imagine",Data:"Date",Print:"Imprimare","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Din %1 la %2","From %1":"Din %1","To %1":"La %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{r as default}; diff --git a/dist/assets/ru_RU-Xn7Ds-ry.js b/dist/assets/ru_RU-Xn7Ds-ry.js new file mode 100644 index 0000000..24d49fb --- /dev/null +++ b/dist/assets/ru_RU-Xn7Ds-ry.js @@ -0,0 +1 @@ +const o={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - dd MMM",_date_hour:"HH:mm",_date_hour_full:"HH:mm - dd MMM",_date_day:"dd MMM",_date_day_full:"dd MMM",_date_week:"ww",_date_week_full:"dd MMM",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"н.э.",_era_bc:"до н.э.",A:"У",P:"В",AM:"утра",PM:"вечера","A.M.":"до полудня","P.M.":"после полудня",January:"января",February:"февраля",March:"марта",April:"апреля",May:"мая",June:"июня",July:"июля",August:"августа",September:"сентября",October:"октября",November:"ноября",December:"декабря",Jan:"янв.",Feb:"февр.",Mar:"март",Apr:"апр.","May(short)":"май",Jun:"июнь",Jul:"июль",Aug:"авг.",Sep:"сент.",Oct:"окт.",Nov:"нояб.",Dec:"дек.",Sunday:"воскресенье",Monday:"понедельник",Tuesday:"вторник",Wednesday:"среда",Thursday:"четверг",Friday:"пятница",Saturday:"суббота",Sun:"вс.",Mon:"пн.",Tue:"вт.",Wed:"ср.",Thu:"чт.",Fri:"пт.",Sat:"сб.",_dateOrd:function(e){return"-ое"},"Zoom Out":"Уменьшить",Play:"Старт",Stop:"Стоп",Legend:"Легенда","Press ENTER to toggle":"Щелкните, коснитесь или нажмите ВВОД, чтобы переключить",Loading:"Идет загрузка",Home:"Начало",Chart:"График","Serial chart":"Серийная диаграмма","X/Y chart":"Диаграмма X/Y","Pie chart":"Круговая диаграмма","Gauge chart":"Датчик-диаграмма","Radar chart":"Лепестковая диаграмма","Sankey diagram":"Диаграмма Сэнки","Chord diagram":"Диаграмма Chord","Flow diagram":"Диаграмма флоу","TreeMap chart":"Иерархическая диаграмма",Series:"Серия","Candlestick Series":"Серия-подсвечник","Column Series":"Столбчатая серия","Line Series":"Линейная серия","Pie Slice Series":"Круговая серия","X/Y Series":"X/Y серия",Map:"Карта","Press ENTER to zoom in":"Нажмите ВВОД чтобу увеличить","Press ENTER to zoom out":"Нажмите ВВОД чтобы уменьшить","Use arrow keys to zoom in and out":"Используйте клавиши-стрелки чтобы увеличить и уменьшить","Use plus and minus keys on your keyboard to zoom in and out":"Используйте клавиши плюс и минус на клавиатуре чтобы увеличить и уменьшить",Export:"Экспортировать",Image:"Изображение",Data:"Данные",Print:"Печатать","Press ENTER to open":"Щелкните, коснитесь или нажмите ВВОД чтобы открыть","Press ENTER to print.":"Щелкните, коснитесь или нажмите ВВОД чтобы распечатать","Press ENTER to export as %1.":"Щелкните, коснитесь или нажмите ВВОД чтобы экспортировать как %1",'To save the image, right-click this link and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на ссылке и выберите "Сохранить изображение как..."','To save the image, right-click thumbnail on the left and choose "Save picture as..."':'Чтобы сохранить изображение, щелкните правой кнопкой на картинке слева и выберите "Сохранить изображение как..."',"(Press ESC to close this message)":"(Нажмите ESC чтобы закрыть это сообщение)","Image Export Complete":"Экспорт изображения завершен","Export operation took longer than expected. Something might have gone wrong.":"Экспортирование заняло дольше, чем планировалось. Возможно что-то пошло не так.","Saved from":"Сохранено из",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Используйте клавишу TAB, чтобы выбрать рукоятки или клавиши стрелок влево и вправо, чтобы изменить выделение","Use left and right arrows to move selection":"Используйте стрелки влево-вправо, чтобы передвинуть выделение","Use left and right arrows to move left selection":"Используйте стрелки влево-вправо, чтобы передвинуть левое выделение","Use left and right arrows to move right selection":"Используйте стрелки влево-вправо, чтобы передвинуть правое выделение","Use TAB select grip buttons or up and down arrows to change selection":"Используйте TAB, чтобы выбрать рукоятки или клавиши вверх-вниз, чтобы изменить выделение","Use up and down arrows to move selection":"Используйте стрелки вверх-вниз, чтобы передвинуть выделение","Use up and down arrows to move lower selection":"Используйте стрелки вверх-вниз, чтобы передвинуть нижнее выделение","Use up and down arrows to move upper selection":"Используйте стрелки вверх-вниз, чтобы передвинуть верхнее выделение","From %1 to %2":"От %1 до %2","From %1":"От %1","To %1":"До %1","No parser available for file: %1":"Нет анализатора для файла: %1","Error parsing file: %1":"Ошибка при разборе файла: %1","Unable to load file: %1":"Не удалось загрузить файл: %1","Invalid date":"Некорректная дата"};export{o as default}; diff --git a/dist/assets/scrim-OeyGkB0-.js b/dist/assets/scrim-OeyGkB0-.js new file mode 100644 index 0000000..db41fb3 --- /dev/null +++ b/dist/assets/scrim-OeyGkB0-.js @@ -0,0 +1,5 @@ +import{q as c,H as o,ck as l,t}from"./index-J0iiHjMT.js";import{c as r,d}from"./locale-pfkq1d6A.js";import{u as h,c as m,s as f,d as g}from"./t9n-od6MEnI1.js";import{c as u}from"./observers-JyBmMU24.js";import{d as p}from"./loader-QqciGs1c.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const i={scrim:"scrim",content:"content"},n={s:72,l:480},v=":host{position:absolute;inset:0px;z-index:var(--calcite-app-z-index-overlay);display:flex;block-size:100%;inline-size:100%;flex-direction:column;align-items:stretch}@keyframes calcite-scrim-fade-in{0%{--tw-bg-opacity:0}100%{--tw-text-opacity:1}}.scrim{position:absolute;inset:0px;display:flex;flex-direction:column;align-content:center;align-items:center;justify-content:center;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background, var(--calcite-scrim-background-internal))}.content{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",C=c(class extends o{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.resizeObserver=u("resize",()=>this.handleResize()),this.handleDefaultSlotChange=e=>{this.hasContent=l(e)},this.storeLoaderEl=e=>{this.loaderEl=e,this.handleResize()},this.loading=!1,this.messages=void 0,this.messageOverrides=void 0,this.loaderScale=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.hasContent=!1}onMessagesChange(){}effectiveLocaleChange(){h(this,this.effectiveLocale)}connectedCallback(){var e;r(this),m(this),(e=this.resizeObserver)==null||e.observe(this.el)}async componentWillLoad(){await f(this)}disconnectedCallback(){var e;d(this),g(this),(e=this.resizeObserver)==null||e.disconnect()}render(){const{hasContent:e,loading:s,messages:a}=this;return t("div",{class:i.scrim},s?t("calcite-loader",{label:a.loading,scale:this.loaderScale,ref:this.storeLoaderEl}):null,t("div",{class:i.content,hidden:!e},t("slot",{onSlotchange:this.handleDefaultSlotChange})))}getScale(e){return e=n.l?"l":"m"}handleResize(){const{loaderEl:e,el:s}=this;e&&(this.loaderScale=this.getScale(Math.min(s.clientHeight,s.clientWidth)??0))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return v}},[1,"calcite-scrim",{loading:[516],messages:[1040],messageOverrides:[1040],loaderScale:[32],defaultMessages:[32],effectiveLocale:[32],hasContent:[32]}]);function b(){if(typeof customElements>"u")return;["calcite-scrim","calcite-loader"].forEach(s=>{switch(s){case"calcite-scrim":customElements.get(s)||customElements.define(s,C);break;case"calcite-loader":customElements.get(s)||p();break}})}b();export{C as S,b as d}; diff --git a/dist/assets/serviceCapabilitiesUtils-26KpT1VN.js b/dist/assets/serviceCapabilitiesUtils-26KpT1VN.js new file mode 100644 index 0000000..c4e4b06 --- /dev/null +++ b/dist/assets/serviceCapabilitiesUtils-26KpT1VN.js @@ -0,0 +1 @@ +import{df as g,dJ as S,dv as A}from"./index-J0iiHjMT.js";function t(s,e,r){return!!h(s,e,r)}function c(s,e,r){return h(s,e,r)}function h(s,e,r){return s&&s.hasOwnProperty(e)?s[e]:r}const Q={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function v(s){var r;const e=(r=s==null?void 0:s.supportedSpatialAggregationStatistics)==null?void 0:r.map(p=>p.toLowerCase());return{envelope:!!(e!=null&&e.includes("envelopeaggregate")),centroid:!!(e!=null&&e.includes("centroidaggregate")),convexHull:!!(e!=null&&e.includes("convexhullaggregate"))}}function d(s,e){var p;const r=(p=s==null?void 0:s.supportedOperationsWithCacheHint)==null?void 0:p.map(o=>o.toLowerCase());return!!(r!=null&&r.includes(e.toLowerCase()))}function b(s,e){return{analytics:R(s),attachment:f(s),data:x(s),metadata:T(s),operations:F(s.capabilities,s,e),query:w(s,e),queryRelated:D(s),queryTopFeatures:E(s),editing:z(s)}}function R(s){return{supportsCacheHint:d(s.advancedQueryCapabilities,"queryAnalytics")}}function f(s){const e=s.attachmentProperties,r={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:d(s.advancedQueryCapabilities,"queryAttachments"),supportsResize:t(s,"supportsAttachmentsResizing",!1)};return e&&Array.isArray(e)&&e.forEach(p=>{const o=Q[p.name];o&&(r[o]=!!p.isEnabled)}),r}function x(s){return{isVersioned:t(s,"isDataVersioned",!1),supportsAttachment:t(s,"hasAttachments",!1),supportsM:t(s,"hasM",!1),supportsZ:t(s,"hasZ",!1)}}function T(s){return{supportsAdvancedFieldProperties:t(s,"supportsFieldDescriptionProperty",!1)}}function F(s,e,r){const p=s?s.toLowerCase().split(",").map(C=>C.trim()):[],o=r?g(r):null,l=p.includes(o!=null&&o.serverType==="MapServer"?"data":"query"),u=p.includes("editing")&&!e.datesInUnknownTimezone;let a=u&&p.includes("create"),n=u&&p.includes("delete"),i=u&&p.includes("update");const y=p.includes("changetracking"),m=e.advancedQueryCapabilities;return u&&!(a||n||i)&&(a=n=i=!0),{supportsCalculate:t(e,"supportsCalculate",!1),supportsTruncate:t(e,"supportsTruncate",!1),supportsValidateSql:t(e,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:n,supportsEditing:u,supportsChangeTracking:y,supportsQuery:l,supportsQueryAnalytics:t(m,"supportsQueryAnalytic",!1),supportsQueryAttachments:t(m,"supportsQueryAttachments",!1),supportsQueryTopFeatures:t(m,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:t(e,"supportsAttachmentsResizing",!1),supportsSync:p.includes("sync"),supportsUpdate:i,supportsExceedsLimitStatistics:t(e,"supportsExceedsLimitStatistics",!1),supportsAsyncConvert3D:t(e,"supportsAsyncConvert3D",!1)}}function w(s,e){const r=s.advancedQueryCapabilities,p=s.ownershipBasedAccessControlForFeatures,o=s.archivingInfo,l=s.currentVersion,u=e==null?void 0:e.includes("MapServer"),a=!u||l>=S("mapserver-pbf-version-support"),n=A(e),i=new Set((s.supportedQueryFormats??"").split(",").map(y=>y.toLowerCase().trim()));return{supportsStatistics:t(r,"supportsStatistics",s.supportsStatistics),supportsPercentileStatistics:t(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:t(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:v(r),supportsCentroid:t(r,"supportsReturningGeometryCentroid",!1),supportsDistance:t(r,"supportsQueryWithDistance",!1),supportsDistinct:t(r,"supportsDistinct",s.supportsAdvancedQueries),supportsExtent:t(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:t(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:t(r,"supportsHavingClause",!1),supportsOrderBy:t(r,"supportsOrderBy",s.supportsAdvancedQueries),supportsPagination:t(r,"supportsPagination",!1),supportsQuantization:t(s,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:t(s,"supportsQuantizationEditMode",!1),supportsQueryGeometry:t(s,"supportsReturningQueryGeometry",!1),supportsResultType:t(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:t(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:t(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:t(s,"useStandardizedQueries",!1),supportsTopFeaturesQuery:t(r,"supportsTopFeaturesQuery",!1),supportsQueryByAnonymous:t(p,"allowAnonymousToQuery",!0),supportsQueryByOthers:t(p,"allowOthersToQuery",!0),supportsHistoricMoment:t(o,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:a&&i.has("pbf"),supportsDisjointSpatialRelationship:t(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:t(r,"supportsQueryWithCacheHint",!1)||d(r,"query"),supportsDefaultSpatialReference:t(r,"supportsDefaultSR",!1),supportsCompactGeometry:n,supportsFullTextSearch:t(r,"supportsFullTextSearch",!1),maxRecordCountFactor:c(s,"maxRecordCountFactor",void 0),maxRecordCount:c(s,"maxRecordCount",void 0),standardMaxRecordCount:c(s,"standardMaxRecordCount",void 0),tileMaxRecordCount:c(s,"tileMaxRecordCount",void 0)}}function D(s){const e=s.advancedQueryCapabilities,r=t(e,"supportsAdvancedQueryRelated",!1);return{supportsPagination:t(e,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r,supportsCacheHint:d(e,"queryRelated")}}function E(s){return{supportsCacheHint:d(s.advancedQueryCapabilities,"queryTopFilter")}}function z(s){const e=s.ownershipBasedAccessControlForFeatures,r=s?s.advancedEditingCapabilities:void 0;return{supportsGeometryUpdate:t(s,"allowGeometryUpdates",!0),supportsGlobalId:t(s,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:t(s,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:t(s,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:t(s,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:t(s,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:t(e,"allowAnonymousToDelete",!0),supportsDeleteByOthers:t(e,"allowOthersToDelete",!0),supportsUpdateByAnonymous:t(e,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:t(e,"allowOthersToUpdate",!0),supportsAsyncApplyEdits:t(r,"supportsAsyncApplyEdits",!1),zDefault:c(s,"zDefault",void 0)}}export{b as a}; diff --git a/dist/assets/settings-YeKUIkGh.js b/dist/assets/settings-YeKUIkGh.js new file mode 100644 index 0000000..dbcecc8 --- /dev/null +++ b/dist/assets/settings-YeKUIkGh.js @@ -0,0 +1 @@ +import{ab as t}from"./index-J0iiHjMT.js";const e={main:new t([255,127,0]),selected:new t([255,255,255]),outline:new t([0,0,0,.5]),selectedOutline:new t([255,255,255]),hoverOutline:new t([255,255,255]),secondary:new t([255,255,255]),secondaryOutline:new t([100,100,100]),transparent:new t([0,0,0,0])};function n(s,o){Object.assign(s,o)}class r{constructor(o){this.size=8,this.hoverSize=10,this.color=e.main,this.hoverColor=e.main,this.outlineColor=e.outline,this.hoverOutlineColor=e.hoverOutline,n(this,o)}}class i{constructor(o){this.color=e.secondary,this.hoverColor=e.main,n(this,o)}}class l{constructor(o){this.color=e.transparent,this.hoverColor=e.transparent,this.outlineColor=e.main,this.hoverOutlineColor=e.main,this.stagedColor=e.transparent,this.stagedOutlineColor=e.secondary,n(this,o)}}class c{constructor(o){this.vertex=new r,this.midpoint=new r({color:e.secondary,outlineColor:e.secondaryOutline,size:6}),this.selected=new r({color:e.selected,hoverColor:e.selected,hoverOutlineColor:e.hoverOutline}),n(this,o)}}class h{constructor(o){this.center=new r({color:e.secondaryOutline}),this.fill=new l,this.line=new i,this.vertex=new r({color:e.selected,outlineColor:e.main,hoverColor:e.selected,hoverOutlineColor:e.secondaryOutline}),n(this,o)}}class a{constructor(o){this.reshapeGraphics=new c,this.transformGraphics=new h,n(this,o)}}const d=new a;export{d}; diff --git a/dist/assets/sk_SK-lW-A9Llp.js b/dist/assets/sk_SK-lW-A9Llp.js new file mode 100644 index 0000000..e6b2e46 --- /dev/null +++ b/dist/assets/sk_SK-lW-A9Llp.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - yyyy-MM-dd",_date_hour:"HH:mm",_date_hour_full:"HH:mm - yyyy-MM-dd",_date_day:"MMM dd",_date_day_full:"yyyy-MM-dd",_date_week:"ww",_date_week_full:"yyyy-MM-dd",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. l.",_era_bc:"pr. n. l.",A:"dop.",P:"odp.",AM:"dop.",PM:"odp.","A.M.":"dop.","P.M.":"odp.",January:"januára",February:"februára",March:"marca",April:"apríla",May:"mája",June:"júna",July:"júla",August:"augusta",September:"septembra",October:"októbra",November:"novembra",December:"decembra",Jan:"jan",Feb:"feb",Mar:"mar",Apr:"apr","May(short)":"máj",Jun:"jún",Jul:"júl",Aug:"aug",Sep:"sep",Oct:"okt",Nov:"nov",Dec:"dec",Sunday:"nedela",Monday:"pondelok",Tuesday:"utorok",Wednesday:"streda",Thursday:"štvrtok",Friday:"piatok",Saturday:"sobota",Sun:"ne",Mon:"po",Tue:"ut",Wed:"st",Thu:"št",Fri:"pi",Sat:"so",_dateOrd:function(e){return"."},"Zoom Out":"Zväčšenie",Play:"Prehrať",Stop:"Ukončiť iteráciu (Stop)",Legend:"Legenda","Click, tap or press ENTER to toggle":"",Loading:"Načítanie",Home:"Domov",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Export",Image:"Obrázok",Data:"Data",Print:"Tlač","Click, tap or press ENTER to open":"","Click, tap or press ENTER to print.":"","Click, tap or press ENTER to export as %1.":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/dist/assets/sl_SL-DJbbPhCy.js b/dist/assets/sl_SL-DJbbPhCy.js new file mode 100644 index 0000000..5baba05 --- /dev/null +++ b/dist/assets/sl_SL-DJbbPhCy.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"n. št.",_era_bc:"pr. n. št.",A:"A",P:"P",AM:"AM",PM:"PM","A.M.":"A.M.","P.M.":"P.M.",January:"Januar",February:"Februar",March:"Marec",April:"April",May:"Maj",June:"Junij",July:"Julij",August:"Avgust",September:"September",October:"Oktober",November:"November",December:"December",Jan:"Jan",Feb:"Feb",Mar:"Mar",Apr:"Apr","May(short)":"Maj",Jun:"Jun",Jul:"Jul",Aug:"Avg",Sep:"Sep",Oct:"Okt",Nov:"Nov",Dec:"Dec",Sunday:"Nedelja",Monday:"Ponedeljek",Tuesday:"Torek",Wednesday:"Sreda",Thursday:"Četrtek",Friday:"Petek",Saturday:"Sobota",Sun:"Ned",Mon:"Pon",Tue:"Tor",Wed:"Sre",Thu:"Čet",Fri:"Pet",Sat:"Sob",_dateOrd:function(e){return"."},"Zoom Out":"Oddalji pogled",Play:"Zaženi",Stop:"Ustavi",Legend:"Legenda","Press ENTER to toggle":"Klikni, tapni ali pritisni ENTER za preklop",Loading:"Nalagam",Home:"Domov",Chart:"Graf","Serial chart":"Serijski graf","X/Y chart":"X/Y graf","Pie chart":"Tortni graf","Gauge chart":"Stevčni graf","Radar chart":"Radar graf","Sankey diagram":"Sankey diagram","Flow diagram":"Prikaz poteka","Chord diagram":"Kolobarni diagram","TreeMap chart":"Drevesi graf","Sliced chart":"Sliced graf",Series:"Serija","Candlestick Series":"Svečna serija","OHLC Series":"OHLC serija","Column Series":"Stolpičasta serija","Line Series":"Črtna serija","Pie Slice Series":"Tortna serija","Funnel Series":"Lijak serija","Pyramid Series":"Piramidna serija","X/Y Series":"X/Y serija",Map:"Mapa","Press ENTER to zoom in":"Pritisni ENTER za približevanje","Press ENTER to zoom out":"Pritisni ENTER za oddaljevanje","Use arrow keys to zoom in and out":"Uporabi smerne tiple za približevanje in oddaljevanje","Use plus and minus keys on your keyboard to zoom in and out":"Uporabi plus in minus tipke na tipkovnici za približevanje in oddaljevanje",Export:"Izvozi",Image:"Slika",Data:"Podatki",Print:"Natisni","Press ENTER to open":"Klikni, tapni ali pritisni ENTER da odpreš.","Press ENTER to print.":"Klikni, tapni ali pritisni ENTER za tiskanje.","Press ENTER to export as %1.":"Klikni, tapni ali pritisni ENTER da izvoziš kot %1.","(Press ESC to close this message)":"(Pritisni ESC da zapreš to sporočilo)","Image Export Complete":"Izvoz slike končan","Export operation took longer than expected. Something might have gone wrong.":"Operacija izvoza je trajala dlje kot pričakovano. Nekaj je šlo narobe.","Saved from":"Shranjeno od",PNG:"PNG",JPG:"JPG",GIF:"GIF",SVG:"SVG",PDF:"PDF",JSON:"JSON",CSV:"CSV",XLSX:"XLSX",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali levo in desno smerno tipko da spremeniš izbiro","Use left and right arrows to move selection":"Uporabi levo in desno smerno tipko za premik izbranega","Use left and right arrows to move left selection":"Uporabi levo in desno smerno tipko za premik leve izbire","Use left and right arrows to move right selection":"Uporabi levo in desno smerno tipko za premik desne izbire","Use TAB select grip buttons or up and down arrows to change selection":"Uporabi TAB za izbiro drsnih gumbov ali gor in dol smerno tipko da spremeniš izbiro","Use up and down arrows to move selection":"Uporabi gor in dol smerne tipke za premik izbire","Use up and down arrows to move lower selection":"Uporabi gor in dol smerne tipke za premik spodnje izbire","Use up and down arrows to move upper selection":"Uporabi gor in dol smerne tipke za premik zgornje izbire","From %1 to %2":"Od %1 do %2","From %1":"Od %1","To %1":"Do %1","No parser available for file: %1":"Nobenega parserja ni na voljo za datoteko: %1","Error parsing file: %1":"Napaka pri parsanju datoteke: %1","Unable to load file: %1":"Ni mogoče naložiti datoteke: %1","Invalid date":"Neveljaven datum"};export{a as default}; diff --git a/dist/assets/sourceUtils-zbywPEXK.js b/dist/assets/sourceUtils-zbywPEXK.js new file mode 100644 index 0000000..3324782 --- /dev/null +++ b/dist/assets/sourceUtils-zbywPEXK.js @@ -0,0 +1,7 @@ +import{gf as d,gg as g,eY as h,gh as m,gi as p,gj as y,gk as a,de as w}from"./index-J0iiHjMT.js";import{n as I}from"./date-be_IQzZd.js";class _{constructor(){this.code=null,this.description=null}}class b{constructor(e){this.error=new _,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=e}}function c(n){return new b(n)}class j{constructor(e){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=e}}function A(n){return new j(n)}const u=new Set;function F(n,e,t,f=!1){u.clear();for(const i in t){const r=n.get(i);if(!r)continue;const o=q(r,t[i]);if(u.add(r.name),r&&(f||r.editable)){const l=d(r,o);if(l)return c(g(l,r,o));e[r.name]=o}}for(const i of(n==null?void 0:n.requiredFields)??[])if(!u.has(i.name))return c(`missing required field "${i.name}"`);return null}function q(n,e){let t=e;return h(n)&&typeof e=="string"?t=parseFloat(e):m(n)&&e!=null&&typeof e!="string"?t=String(e):p(n)&&typeof e=="string"&&(t=I(e)),y(t)}let s;function G(n,e){if(!n||!a(e))return n;if("rings"in n||"paths"in n){if(s==null)throw new TypeError("geometry engine not loaded");return s.simplify(e,n)}return n}async function P(){return s==null&&(s=await w(()=>import("./geometryEngineJSON-FxYgI0L3.js").then(n=>n.g),__vite__mapDeps([0,1,2,3]))),s}async function S(n,e){!a(n)||e!=="esriGeometryPolygon"&&e!=="esriGeometryPolyline"||await P()}export{S as I,A as d,c as f,F as p,G as w}; +function __vite__mapDeps(indexes) { + if (!__vite__mapDeps.viteFileDeps) { + __vite__mapDeps.viteFileDeps = ["assets/geometryEngineJSON-FxYgI0L3.js","assets/index-J0iiHjMT.js","assets/index-PpMPqKeV.css","assets/json-v6EOeNTY.js"] + } + return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/sr_RS-HTzJ9Pkx.js b/dist/assets/sr_RS-HTzJ9Pkx.js new file mode 100644 index 0000000..296aa09 --- /dev/null +++ b/dist/assets/sr_RS-HTzJ9Pkx.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"п. н. е.",A:"a",P:"p",AM:"пре подне",PM:"по подне","A.M.":"пре подне","P.M.":"по подне",January:"јануар",February:"фебруар",March:"март",April:"април",May:"мај",June:"јун",July:"јул",August:"август",September:"септембар",October:"октобар",November:"новембар",December:"децембар",Jan:"јан",Feb:"феб",Mar:"мар",Apr:"апр","May(short)":"мај",Jun:"јун",Jul:"јул",Aug:"авг",Sep:"сеп",Oct:"окт",Nov:"нов",Dec:"дец",Sunday:"недеља",Monday:"понедељак",Tuesday:"уторак",Wednesday:"среда",Thursday:"четвртак",Friday:"петак",Saturday:"субота",Sun:"нед",Mon:"пон",Tue:"уто",Wed:"сре",Thu:"чет",Fri:"пет",Sat:"суб",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Zumiranje",Play:"Reprodukuj",Stop:"Zaustavi",Legend:"Legenda","Press ENTER to toggle":"",Loading:"Učitavanje",Home:"Matična stranica",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Štampaj",Image:"Snimak",Data:"Podaci",Print:"Štampaj","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Iz %1 u %2","From %1":"Iz %1","To %1":"U %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/dist/assets/statsWorker-HfKfr9Es.js b/dist/assets/statsWorker-HfKfr9Es.js new file mode 100644 index 0000000..2259dae --- /dev/null +++ b/dist/assets/statsWorker-HfKfr9Es.js @@ -0,0 +1 @@ +import{b as d,f as z,d as T,p as I,C as x,k as y,$ as V,E as w,P as F,U as P,j as D,x as E}from"./utils-P5wTOmqv.js";import"./index-J0iiHjMT.js";import"./generateRendererUtils-_1jVE02H.js";async function C(s){const{attribute:a,features:r}=s,{normalizationType:i,normalizationField:e,minValue:n,maxValue:t,fieldType:o}=a,l=await d({field:a.field,valueExpression:a.valueExpression,normalizationType:i,normalizationField:e,normalizationTotal:a.normalizationTotal,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},r),m=z({normalizationType:i,normalizationField:e,minValue:n,maxValue:t}),u={value:.5,fieldType:o},f=o==="esriFieldTypeString"?T({values:l,supportsNullCount:m,percentileParams:u}):I({values:l,minValue:n,maxValue:t,useSampleStdDev:!i,supportsNullCount:m,percentileParams:u});return x(f,o==="esriFieldTypeDate")}async function S(s){const{attribute:a,features:r}=s,i=await d({field:a.field,field2:a.field2,field3:a.field3,fieldDelimiter:a.fieldDelimiter,valueExpression:a.valueExpression,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},r,!1),e=y(i);return V(e,a.domains,a.returnAllCodedValues,a.fieldDelimiter)}async function M(s){const{attribute:a,features:r}=s,{field:i,normalizationType:e,normalizationField:n,normalizationTotal:t,classificationMethod:o}=a,l=await d({field:i,valueExpression:a.valueExpression,normalizationType:e,normalizationField:n,normalizationTotal:t,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},r),m=w(l,{field:i,normalizationType:e,normalizationField:n,normalizationTotal:t,classificationMethod:o,standardDeviationInterval:a.standardDeviationInterval,numClasses:a.numClasses,minValue:a.minValue,maxValue:a.maxValue});return F(m,o)}async function $(s){const{attribute:a,features:r}=s,{field:i,normalizationType:e,normalizationField:n,normalizationTotal:t,classificationMethod:o}=a,l=await d({field:i,valueExpression:a.valueExpression,normalizationType:e,normalizationField:n,normalizationTotal:t,viewInfoParams:a.viewInfoParams,timeZone:a.timeZone,fieldInfos:a.fieldInfos},r);return P(l,{field:i,normalizationType:e,normalizationField:n,normalizationTotal:t,classificationMethod:o,standardDeviationInterval:a.standardDeviationInterval,numBins:a.numBins,minValue:a.minValue,maxValue:a.maxValue})}async function g(s){const{attribute:a,features:r}=s,{field:i,radius:e,fieldOffset:n,transform:t,spatialReference:o}=a,l=a.size??[0,0],m=D(r??[],t,o,l),{count:u,min:f,max:p,mean:v,stdDev:c}=E(m,e??void 0,n,i,l[0],l[1]);return{count:u,min:f,max:p,avg:v,stddev:c}}export{M as classBreaks,g as heatmapStatistics,$ as histogram,C as summaryStatistics,S as uniqueValues}; diff --git a/dist/assets/streamLayerUtils-j16jl5bN.js b/dist/assets/streamLayerUtils-j16jl5bN.js new file mode 100644 index 0000000..4fa2204 --- /dev/null +++ b/dist/assets/streamLayerUtils-j16jl5bN.js @@ -0,0 +1 @@ +import{I as o,b as m}from"./utils-rBsg-VY8.js";import{h0 as c,i as u,h as y}from"./index-J0iiHjMT.js";import"./jsonContext-cWV_-jAj.js";const s="Stream Service",f="stream-layer-save",p="stream-layer-save-as";function n(r){return{isValid:r.type==="stream"&&!!r.url&&!r.webSocketUrl,errorMessage:"Stream layer should be created using a url to a stream service"}}function l(r){const e=r.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function v(r,e){const{parsedUrl:a,title:i,fullExtent:t}=r;e.url=a.path,e.title||(e.title=i),e.extent=null,t!=null&&(e.extent=await c(t)),u(e,y.SINGLE_LAYER)}async function S(r,e){return o({layer:r,itemType:s,validateLayer:n,createItemData:l,errorNamePrefix:f},e)}async function h(r,e,a){return m({layer:r,itemType:s,validateLayer:n,createItemData:l,errorNamePrefix:p,newItem:e,setItemProperties:v},a)}export{S as save,h as saveAs}; diff --git a/dist/assets/surfaceCoordinateSystems-siQq4eBA.js b/dist/assets/surfaceCoordinateSystems-siQq4eBA.js new file mode 100644 index 0000000..c95ecbe --- /dev/null +++ b/dist/assets/surfaceCoordinateSystems-siQq4eBA.js @@ -0,0 +1 @@ +import{K as D,p as G,k as z,no as H,L as $,np as L,O as A,d as g,nn as U,n as _,nq as q,hN as B,bI as Y,Y as j,ao as T,e as a,nr as K,A as V,y as p,c as N,c4 as Q,aR as b,bB as R,ns as E,an as F,aO as X,T as m,nt as M,nu as J,nv as ee,aa as d,gr as O,nw as x,au as te,ax as ie,aU as ne,aF as se,aG as re,nx as oe,ny as ae,gq as C,e3 as pe}from"./index-J0iiHjMT.js";import{r as I}from"./dehydratedFeatureComparison-hdPq-zad.js";import{w as le,V as he,p as ce,l as de}from"./EditGeometryOperations-TPE5Wzab.js";import{d as w,C as ue}from"./InteractiveToolBase-WDic4GPF.js";import{e as P}from"./SnappingContext-6K6JmvvY.js";import{f as ge}from"./SnappingDragPipelineStep-THHIXt-p.js";import{p as me}from"./SnappingOperation-2U48wt1k.js";const Ie=["freehand","hybrid","click"],Z="click";class ve{constructor({grabbableForEvent:e}){this.events=new D,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=!0,this.grabbableForEvent=e}destroy(){}intersectionDistance(e,i){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}}const ye="crosshair",fe="progress";let o=class extends D.EventedMixin(G){constructor(t){super(t),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Set,this._stagedScreenPoint=null,this._stagedPointerType=null,this._stagedPointerId=null,this._updatingHandles=new z,this.constraint=void 0,this.isDraped=!0,this.labelOptions=new H,this.tooltipOptions=new $,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.lastVertex=null,t.elevationInfo==null&&(this.elevationInfo=L(!!t.hasZ))}initialize(){const{geometryType:t,view:e}=this,i=e.spatialReference,n="viewingMode"in e.state?e.state.viewingMode:A.Local,l=t==="segment"||t==="multipoint"?"polyline":t;this.coordinateHelper=le(this.hasZ,this.hasM,i),this._editGeometryOperations=new he(new ce(l,this.coordinateHelper)),this._snappingOperation=new me({view:e,constrainResult:s=>{var r;return s?(r=this._getEffectiveDrawSurface())==null?void 0:r.constrainZ(s):void 0}}),this.addHandles([g(()=>this.stagedVertex,s=>{s!=null&&this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(s)}],operation:"apply",type:"vertex-update"})},{sync:!0,equals:(s,r)=>K(s,r,I)}),g(()=>this.view.viewpoint,(s,r)=>{s&&r&&Q(s,r)&&this._onViewpointChange()})]),this._activeComponent=new de(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const h=this.segmentLabels;h!=null&&(h.context={view:e,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles([g(()=>this.labelOptions.enabled,s=>{h.visible=s},V),this.on("cursor-update",()=>{const s=this.stagedVertex;h.stagedVertex=s!=null?this.coordinateHelper.pointToVector(s):null})])),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],s=>{const r=s.vertices.map(u=>({componentIndex:0,vertexIndex:u.index,coordinates:this.coordinateHelper.vectorToArray(u.pos)})),y=r.map(u=>u.coordinates);switch(s.type){case"vertex-add":this.emit(s.type,{...s,added:y,vertices:r});break;case"vertex-update":this.emit(s.type,{...s,updated:y,vertices:r});break;case"vertex-remove":this.emit(s.type,{...s,removed:y,vertices:r})}const S=this._activeComponent.getLastVertex(),f=S!=null?this.coordinateHelper.vectorToDehydratedPoint(S.pos):null;f!=null&&this.lastVertex!=null&&I(this.lastVertex,f)||(this.lastVertex=f)}));const c=this._manipulator=new ve({grabbableForEvent:s=>this.drawingMode!=="click"||s.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(c),c.grabbable=t!=="point",this.addHandles([this._createManipulatorDragPipeline(c),c.events.on("immediate-click",s=>this._onImmediateClick(s)),c.events.on("immediate-double-click",s=>this._onImmediateDoubleClick(s)),g(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:s})=>{c.cursor=s},V)]),U(this,()=>{const s=this.view.inputManager.latestPointerType??"mouse",r=this._getSnappingContext(s);this.snappingManager!=null&&this._updatingHandles.addPromise(T(this._snappingOperation.resnap(this.snappingManager,r)))})}destroy(){_(this.segmentLabels),_(this._snappingOperation),this._editGeometryOperations=_(this._editGeometryOperations),this._updatingHandles.destroy()}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const t=this._getEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==t}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(t=>this.coordinateHelper.vectorToArray(t.pos))}set drawingMode(t){this._set("drawingMode",t??Z)}get effectiveCursor(){return this.loading?fe:this._hideDefaultCursor?null:this.cursor||ye}get interactive(){return this._manipulator.interactive}set interactive(t){this._manipulator.interactive=t}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get numVertices(){return this.stagedVertex!=null?this._activeComponent.vertices.length+1:this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get stagedVertex(){const t=this._snappingOperation.stagedPoint,{constraint:e,elevationInfo:i,view:n}=this;if(!t||!e)return t;const l=q(t,n,i),h=l?e.closestTo(l):void 0;return h?B(h,t.spatialReference):t}set stagedVertex(t){this._snappingOperation.stagedPoint=Y(t)}get updating(){return this._updatingHandles.updating}get vertices(){const t=this.committedVertices;return this.stagedVertex!=null&&t.push(this.coordinateHelper.pointToArray(this.stagedVertex)),t}cancel(){this.complete({aborted:!0})}commitStagedVertex(){if(this._snappingOperation.abort(),this.stagedVertex!=null){const{stagedVertex:t}=this;this.stagedVertex=null,this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(t))}}complete(t){const e=t&&t.aborted||!1;this._snappingOperation.abort(),this.snappingManager!=null&&this.snappingManager.doneSnapping(),this.geometryType==="segment"||this.geometryType==="point"?this.commitStagedVertex():this.stagedVertex=null;const i=this.geometryType==="multipoint"&&this.numVertices===0||this.geometryType==="polyline"&&this.numVertices<2||this.geometryType==="polygon"&&this.numVertices<3;this._createOperationCompleted=!i,(this.isCompleted||e)&&this.emit("complete",{vertices:this.vertices.map((n,l)=>({componentIndex:0,vertexIndex:l,coordinates:n})),aborted:e,type:"complete"})}onInputEvent(t){switch(t.type){case"pointer-down":this._pointerDownStates.add(t.pointerId);break;case"pointer-up":this._pointerDownStates.delete(t.pointerId)}switch(t.type){case"pointer-move":return this._onPointerMove(t);case"hold":return this._onHold(t)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_closeOnClickVertexIndex(t){const e=this._activeComponent;if(this.geometryType==="polygon"&&e.vertices.length>2){if(this._vertexWithinPointerDistance(e.vertices[0].pos,t))return 0;if(this._vertexWithinPointerDistance(e.vertices[e.vertices.length-1].pos,t))return e.vertices.length-1}return null}_createManipulatorDragPipeline(t){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(t);case"freehand":return this._createManipulatorDragPipelineFreehand(t);case"hybrid":return this._createManipulatorDragPipelineHybrid(t)}}_createManipulatorDragPipelineClick(t){return w(t,(e,i,n,l)=>{const h=l==="touch"&&this._snappingEnabled;if(this.isCompleted||!h)return;const{snappingStep:c,cancelSnapping:s}=ge({predicate:()=>h,snappingManager:this.snappingManager,snappingContext:new P({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:l,visualizer:this.snappingVisualizer}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(r=>(h&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),r)).next(s),i.next(this._screenToMapDragEventStep()).next(r=>(r.action==="start"&&(this.stagedVertex=r.mapStart,(this.geometryType==="segment"||h&&this.numVertices===0)&&this.commitStagedVertex()),r)).next(ue(this.view,this.elevationInfo)).next(...c).next(r=>(h&&(this.stagedVertex=r.mapEnd,r.action==="end"&&this.commitStagedVertex()),r)).next(r=>(r.action==="end"&&(this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),r))})}_createManipulatorDragPipelineFreehand(t){return w(t,(e,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this.stagedVertex==null&&(this.stagedVertex=n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this.stagedVertex=n.mapEnd,this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(t){return w(t,(e,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this.stagedVertex==null&&(this.stagedVertex=n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this.stagedVertex=n.mapEnd,this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){return(this.geometryType==="segment"||this.geometryType==="polygon")&&this.numCommittedVertices>0}_getEffectiveDrawSurface(){if(this.elevationDrawSurface==null)return this.drawSurface;if(!this.coordinateHelper.hasZ())return this.elevationDrawSurface.defaultZ=null,this.elevationDrawSurface;let t=this.defaultZ,e=!1;return this.elevationInfo!=null&&this.elevationInfo.mode==="absolute-height"&&(e=!0),this.snapToSceneEnabled!=null&&(e=this.snapToSceneEnabled),this.elevationInfo!=null&&this.elevationInfo.mode==="on-the-ground"&&(e=!1),this._drawAtFixedElevation&&(t=this.coordinateHelper.getZ(this._activeComponent.vertices[0].pos),e=!1),e?this.drawSurface:(this.elevationDrawSurface.defaultZ=t,this.elevationDrawSurface)}_mapToScreen(t){var e;return(e=this._getEffectiveDrawSurface())==null?void 0:e.mapToScreen(t)}_onHold(t){this._snappingOperation.abort(),this.drawingMode==="click"&&t.pointerType==="touch"&&this._snappingEnabled&&(this.stagedVertex=t.mapPoint),t.stopPropagation()}_onImmediateClick(t){if(t.pointerType==="mouse"&&t.button===2||this._manipulator.dragging)return;const e=this._activeComponent;if(this._closeOnClickVertexIndex(t.screenPoint)!=null)return t.stopPropagation(),void this.complete();const i=this._screenToMap(t.screenPoint);if(i!=null)switch(this.drawingMode){case"freehand":this.geometryType==="point"&&(this.stagedVertex!=null?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(i)),this.complete());break;case"click":case"hybrid":this._snappingOperation.abort(),this.stagedVertex!=null?this.commitStagedVertex():this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(i)),(this.geometryType==="point"||this.geometryType==="segment"&&e.vertices.length===2||this.geometryType==="segment"&&this.drawingMode==="hybrid"&&e.vertices.length===1)&&this.complete()}t.stopPropagation()}_onImmediateDoubleClick(t){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),t.stopPropagation())}_onPointerMove(t){const e=j(t.x,t.y);this._stagedScreenPoint=e,this._stagedPointerType=t.pointerType,this._stagedPointerId=t.pointerId;const i=this._snappingOperation,n=this._manipulator;this._pointerDownStates.has(t.pointerId)||n.grabbing||!n.interactive?i.abort():(t.stopPropagation(),this._updateStagedVertexOnPointerMove(e,t.pointerType))}_onViewpointChange(){const t=this._manipulator;this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._pointerDownStates.has(this._stagedPointerId)&&!t.grabbing&&t.interactive?this._updateStagedVertexOnPointerMove(this._stagedScreenPoint,this._stagedPointerType??"mouse"):this._snappingOperation.abort()}_updateStagedVertexOnPointerMove(t,e){var r;const i=this._snappingOperation,n=this._closeOnClickVertexIndex(t);if(n!=null)return this._closeOnVertex(n),void i.abort();const l=this._screenToMap(t),h=this._requiresScenePoint?(r=this.drawSurface)==null?void 0:r.screenToMap(t):null;if(l==null)return this._hideDefaultCursor=!0,void i.abort();this._hideDefaultCursor=!1;const c=this.snappingManager;if(c==null)return this.stagedVertex=l,void i.abort();const s=this._getSnappingContext(e);this._updatingHandles.addPromise(T(i.snap({point:l,scenePoint:h},c,s)))}_closeOnVertex(t){this.stagedVertex=null;const e={componentIndex:0,vertexIndex:t,coordinates:this.coordinateHelper.vectorToArray(this._activeComponent.vertices[t].pos)};this.emit("cursor-update",{updated:null,vertices:[e],operation:"apply",type:"vertex-update"})}_screenToMap(t){var e;return(e=this._getEffectiveDrawSurface())==null?void 0:e.screenToMap(t)}_screenToMapDragEventStep(){let t=null;return e=>{if(e.action==="start"&&(t=this._screenToMap(e.screenStart)),t==null)return null;const i=this._screenToMap(e.screenEnd);return i!=null?{...e,mapStart:t,mapEnd:i}:null}}_vertexWithinPointerDistance(t,e){const n=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(t));return n!=null&&_e(n,e,25)}_getSnappingContext(t){var i;const e=this._drawAtFixedElevation?(i=this.elevationDrawSurface)==null?void 0:i.defaultZ:null;return new P({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:t,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:e!=null?{value:e,elevationInfo:this.elevationInfo}:null})}};function _e(t,e,i){const n=t.x-e.x,l=t.y-e.y;return n*n+l*l<=i}a([p()],o.prototype,"_hideDefaultCursor",void 0),a([p()],o.prototype,"_snappingOperation",void 0),a([p()],o.prototype,"_snappingEnabled",null),a([p({constructOnly:!0})],o.prototype,"graphic",void 0),a([p()],o.prototype,"constraint",void 0),a([p()],o.prototype,"defaultZ",void 0),a([p()],o.prototype,"isDraped",void 0),a([p({value:Z})],o.prototype,"drawingMode",null),a([p({constructOnly:!0})],o.prototype,"elevationDrawSurface",void 0),a([p({constructOnly:!0})],o.prototype,"elevationInfo",void 0),a([p({constructOnly:!0,type:H})],o.prototype,"labelOptions",void 0),a([p({constructOnly:!0,type:$})],o.prototype,"tooltipOptions",void 0),a([p({constructOnly:!0})],o.prototype,"geometryType",void 0),a([p({constructOnly:!0})],o.prototype,"hasM",void 0),a([p({constructOnly:!0})],o.prototype,"hasZ",void 0),a([p()],o.prototype,"cursor",void 0),a([p()],o.prototype,"effectiveCursor",null),a([p()],o.prototype,"loading",void 0),a([p({constructOnly:!0})],o.prototype,"manipulators",void 0),a([p({constructOnly:!0})],o.prototype,"drawSurface",void 0),a([p({constructOnly:!0})],o.prototype,"segmentLabels",void 0),a([p({constructOnly:!0})],o.prototype,"snappingManager",void 0),a([p({constructOnly:!0})],o.prototype,"snappingVisualizer",void 0),a([p()],o.prototype,"snapToSceneEnabled",void 0),a([p()],o.prototype,"stagedVertex",null),a([p()],o.prototype,"lastVertex",void 0),a([p()],o.prototype,"updating",null),a([p({constructOnly:!0})],o.prototype,"view",void 0),o=a([N("esri.views.draw.DrawOperation")],o);class Pe{constructor(e,i,n,l=null){this._elevationInfo=e,this.defaultZ=i,this._view=n,this._excludeGraphics=l}screenToMap(e){if(this.defaultZ!=null)return this._view.sceneIntersectionHelper.intersectElevationFromScreen(b(e.x,e.y),this._elevationInfo,this.defaultZ,this._excludeGraphics);const i=this._view.sceneIntersectionHelper.intersectElevationFromScreen(b(e.x,e.y),this._elevationInfo,0,this._excludeGraphics);return i!=null&&(i.z=void 0),i}mapToScreen(e){const i=R(e.x,e.y,E(this._view,e,this._elevationInfo),e.spatialReference);return this._view.toScreen(i)}constrainZ(e){const{defaultZ:i}=this;return i!=null&&e.z!==i&&((e=F(e)).z=i),e}}class De{constructor(e,i,n=[]){this.view=e,this.elevationInfo=i,this.exclude=n}screenToMap(e){const i=this.view.toMap(e,{exclude:this.exclude});return i!=null&&(i.z=X(i,this.view,this.elevationInfo)),i}mapToScreen(e){let i=e;return this.elevationInfo!=null&&(i=R(e.x,e.y,E(this.view,e,this.elevationInfo),e.spatialReference)),this.view.toScreen(i)}constrainZ(e){return e}}class He{constructor(e,i=!1,n=0){this.view=e,this.hasZ=i,this.defaultZ=n,this.mapToScreen=l=>e.toScreen(l),this.screenToMap=i?l=>{const h=e.toMap(l);return h.z=n,h}:l=>e.toMap(l)}constrainZ(e){const{defaultZ:i}=this;return this.hasZ&&e.z!==i&&((e=F(e)).z=i),e}}function v(t,e,i=null){return i!=null?[t,e,i]:[t,e]}function W(t,e,i=null){return i!=null?{x:t,y:e,z:i}:{x:t,y:e}}class k{constructor(e){this.spatialReference=e}mapToLocalMultiple(e){return e.map(i=>this.mapToLocal(i)).filter(pe)}get doUnnormalization(){return!1}}class xe extends k{constructor(e,i,n=null){super(i),this._defaultZ=n,this.transform=M(),this.transformInv=M(),this.transform=J(e),ee(this.transformInv,this.transform)}makeMapPoint(e,i){return v(e,i,this._defaultZ)}mapToLocal(e){return W(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return v(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}}class we extends k{constructor(e,i){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=d(),this.tangentFrameUpWS=d(),this.tangentFrameRightWS=d(),this.tangentFrameForwardWS=d(),this.localFrameRightWS=d(),this.localFrameUpWS=d(),this.worldToLocalTransform=O(),this.localToWorldTransform=O(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=i,this.defaultZ=i.hasZ?i.z:null;const n=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,x.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,x.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,x.Z,this.tangentFrameForwardWS);const l=d();te(l,this.tangentFrameForwardWS,ie(n,this.tangentFrameForwardWS)),ne(this.localFrameRightWS,n,l),se(this.localFrameRightWS,this.localFrameRightWS),re(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),oe(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),ae(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,i){return v(e,i,this.defaultZ)}mapToLocal(e){const i=d();this.view.renderCoordsHelper.toRenderCoords(new m({x:e[0],y:e[1],spatialReference:this.spatialReference}),i),C(i,i,this.worldToLocalTransform);const n=this.view.renderCoordsHelper.fromRenderCoords(i,this.view.spatialReference);return n!=null?W(n.x/this.scale,n.y/this.scale):null}localToMap(e){const i=d();this.view.renderCoordsHelper.toRenderCoords(new m({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),i),C(i,i,this.localToWorldTransform);const n=this.view.renderCoordsHelper.fromRenderCoords(i,this.view.spatialReference);return n!=null?v(n.x,n.y,this.defaultZ):null}}function $e(t,e){if(t.type==="2d")return new xe(t.state.transform,t.spatialReference,e.length>2?e[2]:null);if(t.type==="3d"){const i=e.length>2?new m({x:e[0],y:e[1],z:e[2],spatialReference:t.spatialReference}):new m({x:e[0],y:e[1],spatialReference:t.spatialReference});return new we(t,i)}return null}export{$e as F,He as a,Ie as c,Z as e,W as g,o as k,De as o,Pe as r}; diff --git a/dist/assets/sv_SE-Z8LyXaIi.js b/dist/assets/sv_SE-Z8LyXaIi.js new file mode 100644 index 0000000..914da77 --- /dev/null +++ b/dist/assets/sv_SE-Z8LyXaIi.js @@ -0,0 +1 @@ +const r={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - yyyy-MM-dd",_date_hour:"HH:mm",_date_hour_full:"HH:mm - yyyy-MM-dd",_date_day:"yyyy-MM-dd",_date_day_full:"yyyy-MM-dd",_date_week:"ww",_date_week_full:"yyyy-MM-dd",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_second:"ss",_duration_minute:"mm",_duration_hour:"hh",_duration_day:"dd",_duration_week:"ww",_duration_month:"MM",_duration_year:"yyyy",_era_ad:"e.Kr.",_era_bc:"f.Kr.",A:"fm",P:"em",AM:"fm",PM:"em","A.M.":"f.m.","P.M.":"e.m.",January:"januari",February:"februari",March:"mars",April:"april",May:"maj",June:"juni",July:"juli",August:"augusti",September:"september",October:"oktober",November:"november",December:"december",Jan:"jan.",Feb:"feb.",Mar:"mars",Apr:"apr.","May(short)":"maj",Jun:"juni",Jul:"juli",Aug:"aug.",Sep:"sep.",Oct:"okt.",Nov:"nov.",Dec:"dec.",Sunday:"söndag",Monday:"måndag",Tuesday:"tisdag",Wednesday:"onsdag",Thursday:"torsdag",Friday:"fredag",Saturday:"lördag",Sun:"sön",Mon:"mån",Tue:"tis",Wed:"ons",Thu:"tor",Fri:"fre",Sat:"lör",_dateOrd:function(e){return""},"Zoom Out":"Zooma ut",Play:"Spela",Stop:"Stoppa",Legend:"Teckenförklaring","Press ENTER to toggle":"Klicka eller tryck ENTER för att ändra",Loading:"Läser in",Home:"Hem",Chart:"Diagram","Serial chart":"Seriediagram","X/Y chart":"XY-diagram","Pie chart":"Tårtdiagram","Gauge chart":"Instrumentdiagram","Radar chart":"Radardiagram","Sankey diagram":"Sankeydiagram","Chord diagram":"Strängdiagram","Flow diagram":"Flödesschema","TreeMap chart":"Träddiagram ",Series:"Serier","Candlestick Series":"Candlestick-serier","Column Series":"Kolumnserier","Line Series":"Linjeserier","Pie Slice Series":"Tårtserier","X/Y Series":"X/Y-serier",Map:"Karta","Press ENTER to zoom in":"Tryck RETUR för att zooma in","Press ENTER to zoom out":"Tryck RETUR för att zooma ut","Use arrow keys to zoom in and out":"Använd pil-knapparna för att zooma in och ut","Use plus and minus keys on your keyboard to zoom in and out":"Använd plus- och minus-knapparna för att zooma in och ut",Export:"Exportera",Image:"Bild",Data:"Data",Print:"Skriv ut","Press ENTER to open":"Klicka eller tryck ENTER för att öppna","Press ENTER to print.":"Klicka eller tryck ENTER för att skriva ut.","Press ENTER to export as %1.":"Klicka eller tryck ENTER för att exportera till %1.","(Press ESC to close this message)":"(Tryck ESC för att stänga)","Image Export Complete":"Bildexport klar","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"Sparad från",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"Använd vänster och höger pilknappar för att flytta urvalet","Use left and right arrows to move left selection":"Använd vänster och höger pilknappar för att flytta vänsterurval","Use left and right arrows to move right selection":"Använd vänster och höger pilknappar för att flytta högerurval","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"Använd upp och ner pilknappar för att flytta urvalet","Use up and down arrows to move lower selection":"Använd upp och ner pilknappar för att flytta nedre urvalet","Use up and down arrows to move upper selection":"Använd upp och ner pilknappar för att flytta övre urvalet","From %1 to %2":"Från %1 till %2","From %1":"Från %1","To %1":"Till %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"Ogiltigt datum"};export{r as default}; diff --git a/dist/assets/symbolLayerUtils-VVngrYnW.js b/dist/assets/symbolLayerUtils-VVngrYnW.js new file mode 100644 index 0000000..9218470 --- /dev/null +++ b/dist/assets/symbolLayerUtils-VVngrYnW.js @@ -0,0 +1,7 @@ +import{gu as v,E as n,bW as y,de as p,gv as c,eh as w,gw as b,aa as l}from"./index-J0iiHjMT.js";let s=h();function h(){return new v(50)}function T(){s=h()}async function x(r,i){var o,t;if((o=r.resource)!=null&&o.href)return g(r.resource.href).then(e=>[e.width,e.height]);if((t=r.resource)!=null&&t.primitive)return i!=null?[i,i]:[256,256];throw new n("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function g(r){return y(r,{responseType:"image"}).then(i=>i.data)}async function B(r,i=null){var t;if(!r.isPrimitive){const e=r.resource.href;if(!e)throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const a=s.get(e);if(a!==void 0)return a;const{fetch:f}=await p(()=>import("./index-J0iiHjMT.js").then(d=>d.zI),__vite__mapDeps([0,1])),m=await f(e,{disableTextures:!0}),u=c(m.referenceBoundingBox,l());return s.put(e,u),u}if(!((t=r.resource)!=null&&t.primitive))throw new n("symbol:invalid-resource","The symbol does not have a valid resource");const o=w(b(r.resource.primitive));if(i!=null)for(let e=0;e __vite__mapDeps.viteFileDeps[i]) +} \ No newline at end of file diff --git a/dist/assets/symbologySnappingCandidates-Sz0MFOvR.js b/dist/assets/symbologySnappingCandidates-Sz0MFOvR.js new file mode 100644 index 0000000..0a857ba --- /dev/null +++ b/dist/assets/symbologySnappingCandidates-Sz0MFOvR.js @@ -0,0 +1 @@ +import{gu as $,dA as z,ld as I,s as x,lU as b,bI as g,lV as y}from"./index-J0iiHjMT.js";function D(a=!1,e){if(a){const{elevationInfo:t,alignPointsInFeatures:n}=e;return new v(t,n)}return new m}let m=class{async alignCandidates(e,t,n){return e}notifyElevationSourceChange(){}};const w=1024;let v=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new $(w),this._cacheVersion=0}async alignCandidates(e,t,n){const s=this._elevationInfo;return s==null||s.mode!=="absolute-height"||s.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,n):(this._alignAbsoluteElevationCandidates(e,t,s),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,t,n){const{offset:s,unit:i}=n;if(s==null)return;const r=z(t),o=s*(b(i??"meters")/r);for(const c of e)switch(c.type){case"edge":c.start.z+=o,c.end.z+=o;continue;case"vertex":c.target.z+=o;continue}}async _alignComputedElevationCandidates(e,t,n){const s=new Map;for(const u of e)I(s,u.objectId,S).push(u);const[i,r,o]=this._prepareQuery(s,t),c=await this._alignPointsInFeatures(i,n);if(x(n),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,n);this._applyCacheAndResponse(i,c,r);const{drapedObjectIds:d,failedObjectIds:f}=c,h=[];for(const u of e){const{objectId:l}=u;d.has(l)&&u.type==="edge"&&(u.draped=!0),f.has(l)||h.push(u)}return h}_prepareQuery(e,t){const n=[],s=[];for(const[i,r]of e){const o=[];for(const c of r)this._addToQueriesOrCachedResult(i,c.target,o,s),c.type==="edge"&&(this._addToQueriesOrCachedResult(i,c.start,o,s),this._addToQueriesOrCachedResult(i,c.end,o,s));o.length!==0&&n.push({objectId:i,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:n},s,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,n,s){const i=_(e,t),r=this._alignmentsCache.get(i);r==null?n.push(t):s.push(new j(t,r))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:n,failedObjectIds:s},i){for(const c of i)c.apply();let r=0;const o=this._alignmentsCache;for(const{objectId:c,points:d}of e.pointsInFeatures){if(s.has(c)){r+=d.length;continue}const f=!n.has(c);for(const h of d){const u=_(c,h),l=t[r++];h.z=l,f&&o.put(u,l,1)}}}};class j{constructor(e,t){this.point=e,this.z=t}apply(){this.point.z=this.z}}function _(a,{x:e,y:t,z:n,spatialReference:s}){return`${a}-${e}-${t}-${n??0}}-wkid:${s==null?void 0:s.wkid}`}function S(){return[]}class E{filter(e,t){return t}notifyElevationSourceChange(){}}let O=class{filter(e,t){const{point:n,distance:s}=e,{z:i}=n;if(i==null||t.length===0)return t;const r=A(s),o=this._updateCandidatesTo3D(t,n,r).filter(V);return o.sort(F),o}_updateCandidatesTo3D(e,t,n){for(const s of e)switch(s.type){case"edge":R(s,t,n);continue;case"vertex":T(s,t,n);continue}return e}};function V(a){return a.distance<=1}function W(a=!1){return a?new O:new E}function R(a,e,{x:t,y:n,z:s}){const{start:i,end:r,target:o}=a;a.draped||Q(o,e,i,r);const c=(e.x-o.x)/t,d=(e.y-o.y)/n,f=(e.z-o.z)/s;a.distance=Math.sqrt(c*c+d*d+f*f)}function Q(a,e,t,n){const s=n.x-t.x,i=n.y-t.y,r=n.z-t.z,o=s*s+i*i+r*r,c=(e.x-t.x)*s+(e.y-t.y)*i+r*(e.z-t.z),d=Math.min(1,Math.max(0,c/o)),f=t.x+s*d,h=t.y+i*d,u=t.z+r*d;a.x=f,a.y=h,a.z=u}function T(a,e,{x:t,y:n,z:s}){const{target:i}=a,r=(e.x-i.x)/t,o=(e.y-i.y)/n,c=(e.z-i.z)/s,d=Math.sqrt(r*r+o*o+c*c);a.distance=d}function A(a){return typeof a=="number"?{x:a,y:a,z:a}:a}function F(a,e){return a.distance-e.distance}function B(a=!1,e){return a?new k(e):new M}class M{async fetch(){return[]}notifySymbologyChange(){}}const P=1024;class k{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new $(P),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const n=[],s=[],i=this._candidatesCache;for(const h of e){const u=C(h),l=i.get(u);if(l)for(const p of l)s.push(g(p));else n.push(h),i.put(u,[],1)}if(n.length===0)return s;const r=this._cacheVersion,{candidates:o,sourceCandidateIndices:c}=await this._getSymbologyCandidates(n,t);if(x(t),r!==this._cacheVersion)return this.fetch(e,t);const d=[],{length:f}=o;for(let h=0;h(n.ok||g(),n.json())).catch(()=>g())),t[a]}function g(){throw new Error("could not fetch component message bundle")}function c(e){e.messages={...e.defaultMessages,...e.messageOverrides}}async function l(e){e.defaultMessages=await o(e,e.effectiveLocale),c(e)}async function o(e,s){const{el:a}=e,r=a.tagName.toLowerCase().replace("calcite-","");return i(f(s,"t9n"),r)}async function m(e,s){e.defaultMessages=await o(e,s),c(e)}function w(e){e.onMessagesChange=d}function y(e){e.onMessagesChange=void 0}function d(){c(this)}export{w as c,y as d,l as s,m as u}; diff --git a/dist/assets/th_TH-4uUl3VxF.js b/dist/assets/th_TH-4uUl3VxF.js new file mode 100644 index 0000000..753186d --- /dev/null +++ b/dist/assets/th_TH-4uUl3VxF.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"ค.ศ.",_era_bc:"ก่อน ค.ศ.",A:"a",P:"p",AM:"ก่อนเที่ยง",PM:"หลังเที่ยง","A.M.":"ก่อนเที่ยง","P.M.":"หลังเที่ยง",January:"มกราคม",February:"กุมภาพันธ์",March:"มีนาคม",April:"เมษายน",May:"พฤษภาคม",June:"มิถุนายน",July:"กรกฎาคม",August:"สิงหาคม",September:"กันยายน",October:"ตุลาคม",November:"พฤศจิกายน",December:"ธันวาคม",Jan:"ม.ค.",Feb:"ก.พ.",Mar:"มี.ค.",Apr:"เม.ย.","May(short)":"พ.ค.",Jun:"มิ.ย.",Jul:"ก.ค.",Aug:"ส.ค.",Sep:"ก.ย.",Oct:"ต.ค.",Nov:"พ.ย.",Dec:"ธ.ค.",Sunday:"วันอาทิตย์",Monday:"วันจันทร์",Tuesday:"วันอังคาร",Wednesday:"วันพุธ",Thursday:"วันพฤหัสบดี",Friday:"วันศุกร์",Saturday:"วันเสาร์",Sun:"อา.",Mon:"จ.",Tue:"อ.",Wed:"พ.",Thu:"พฤ.",Fri:"ศ.",Sat:"ส.",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"ขยาย",Play:"เล่น",Stop:"หยุด",Legend:"คำอธิบายสัญลักษณ์","Press ENTER to toggle":"",Loading:"กำลังโหลด",Home:"หน้าหลัก",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"พิมพ์",Image:"รูปภาพ",Data:"ข้อมูล",Print:"พิมพ์","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"จาก %1 ถึง %2","From %1":"จาก %1","To %1":"ถึง %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/tr_TR-vXXQf5Mr.js b/dist/assets/tr_TR-vXXQf5Mr.js new file mode 100644 index 0000000..4d116f6 --- /dev/null +++ b/dist/assets/tr_TR-vXXQf5Mr.js @@ -0,0 +1 @@ +const a={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:"%",_percentSuffix:null,_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"MS",_era_bc:"MÖ",A:"öö",P:"ös",AM:"ÖÖ",PM:"ÖS","A.M.":"ÖÖ","P.M.":"ÖS",January:"Ocak",February:"Şubat",March:"Mart",April:"Nisan",May:"Mayıs",June:"Haziran",July:"Temmuz",August:"Ağustos",September:"Eylül",October:"Ekim",November:"Kasım",December:"Aralık",Jan:"Oca",Feb:"Şub",Mar:"Mar",Apr:"Nis","May(short)":"May",Jun:"Haz",Jul:"Tem",Aug:"Ağu",Sep:"Eyl",Oct:"Eki",Nov:"Kas",Dec:"Ara",Sunday:"Pazar",Monday:"Pazartesi",Tuesday:"Salı",Wednesday:"Çarşamba",Thursday:"Perşembe",Friday:"Cuma",Saturday:"Cumartesi",Sun:"Paz",Mon:"Pzt",Tue:"Sal",Wed:"Çar",Thu:"Per",Fri:"Cum",Sat:"Cmt",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Yakınlaştır",Play:"Oynat",Stop:"Durdur",Legend:"Gösterge","Press ENTER to toggle":"",Loading:"Yükleniyor",Home:"Giriş Sayfası",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Yazdır",Image:"Görüntü",Data:"Veri",Print:"Yazdır","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Kaynak %1 hedef %2","From %1":"Kaynak %1","To %1":"Hedef %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{a as default}; diff --git a/dist/assets/uk_UA-DutcYu8K.js b/dist/assets/uk_UA-DutcYu8K.js new file mode 100644 index 0000000..b5fa840 --- /dev/null +++ b/dist/assets/uk_UA-DutcYu8K.js @@ -0,0 +1 @@ +const _={_decimalSeparator:",",_thousandSeparator:" ",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"н. е.",_era_bc:"до н. е.",A:"дп",P:"пп",AM:"дп",PM:"пп","A.M.":"дп","P.M.":"пп",January:"січня",February:"лютого",March:"березня",April:"квітня",May:"травня",June:"червня",July:"липня",August:"серпня",September:"вересня",October:"жовтня",November:"листопада",December:"грудня",Jan:"січ.",Feb:"лют.",Mar:"бер.",Apr:"квіт.","May(short)":"трав.",Jun:"черв.",Jul:"лип.",Aug:"серп.",Sep:"вер.",Oct:"жовт.",Nov:"лист.",Dec:"груд.",Sunday:"неділя",Monday:"понеділок",Tuesday:"вівторок",Wednesday:"середа",Thursday:"четвер",Friday:"пʼятниця",Saturday:"субота",Sun:"нд",Mon:"пн",Tue:"вт",Wed:"ср",Thu:"чт",Fri:"пт",Sat:"сб",_dateOrd:function(e){return""},"Zoom Out":"Масштабування",Play:"Відтворювати",Stop:"Зупинка",Legend:"Легенда","Press ENTER to toggle":"",Loading:"Завантажується",Home:"Головна сторінка",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"карта","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"Друк",Image:"Зображення",Data:"Дані",Print:"Друк","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Від %1 до %2","From %1":"Від %1","To %1":"До %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{_ as default}; diff --git a/dist/assets/uploadAssets-aQgp-D__.js b/dist/assets/uploadAssets-aQgp-D__.js new file mode 100644 index 0000000..224567c --- /dev/null +++ b/dist/assets/uploadAssets-aQgp-D__.js @@ -0,0 +1 @@ +import{E as h,dJ as N,ld as es,a2 as ts,o9 as D,gM as v,oa as S,h6 as g,bW as m,s as u,dv as os,bM as as,ob as ns,bO as k,mo as rs,bP as is,dQ as cs,mk as ls,Z as us}from"./index-J0iiHjMT.js";import{h as ps,N as ds,i as U,o as B,A as ms}from"./External-GV0jSEES.js";const w="upload-assets",y=()=>new Error;class fs extends h{constructor(){super(`${w}:unsupported`,"Layer does not support asset uploads.",y())}}class gs extends h{constructor(){super(`${w}:no-glb-support`,"Layer does not support glb.",y())}}let hs=class extends h{constructor(){super(`${w}:no-supported-source`,"No supported external source found",y())}},ws=class extends h{constructor(){super(`${w}:not-base-64`,"Expected gltf data in base64 format after conversion.",y())}},ys=class extends h{constructor(){super(`${w}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",y())}};class bs extends h{constructor(t,s){super(`${w}:bad-response`,`Bad response. Uploaded ${t} items and received ${s} results.`,y())}}let Ps=class extends h{constructor(t,s){super(`${w}-layer:upload-failed`,`Failed to upload mesh file ${t}. Error code: ${(s==null?void 0:s.code)??"-1"}. Error message: ${(s==null?void 0:s.messages)??"unknown"}`,y())}};class O extends h{constructor(t){super(`${w}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${t}, but it does not list it in its supported formats.`,y())}}let Ts=class extends h{constructor(){super(`${w}:convert3D-failed`,"convert3D failed.")}};const M={upload:{createFromFiles:.8,loadMesh:.2},uploadAssetBlobs:{prepareAssetItems:.9,uploadAssetItems:.1},uploadConvertibleSource:{uploadEditSource:.5,serviceAssetsToGlb:.5},uploadLocalMesh:{meshToAssetBlob:.5,uploadAssetBlobs:.5}};function b(e,t=o=>{},s){return new As(e,t,s)}class As{constructor(t,s=a=>{},o){if(this.onProgress=s,this.taskName=o,this._progressMap=new Map,this._startTime=void 0,this._timingsMap=new Map,typeof t=="number"){this._weights={};for(let a=0;a({start:o,end:0}));s===1&&(a.end=o)}this.emitProgress()}simulate(t,s){return q(o=>this.setProgress(t,o),s)}makeOnProgress(t){return s=>this.setProgress(t,s)}}function q(e=s=>{},t=Es){const s=performance.now();e(0);const o=setInterval(()=>{const a=performance.now()-s,n=1-Math.exp(-a/t);e(n)},Fs);return ts(()=>{clearInterval(o),e(1)})}function $s(e,t=vs){return D(S(e*C/t))}function xs(e,t=Ms){return D(S(e*C/t))}const vs=10,Ms=10,C=8e-6,Fs=v(50),Es=v(1e3),L=1e6,_=20*L,js=2e9,Is=3;async function Ns({data:e,name:t,description:s},o,a){let n=null;try{const r=g(o,"uploads"),i=g(r,"info"),{data:c}=await m(i,{query:{f:"json"},responseType:"json"});u(a);const p=os(o),l=c.maxUploadFileSize*L,f=p?js:l,x=p?Math.min(_,l):_;if(e.size>f)throw new Error("Data too large");const J=g(r,"register"),{data:F}=await m(J,{query:{f:"json",itemName:_s(t),description:s},responseType:"json",method:"post"});if(u(a),!F.success)throw new Error("Registration failed");const{itemID:W}=F.item;n=g(r,W);const K=g(n,"uploadPart"),E=Math.ceil(e.size/x),P=new Array;for(let d=0;d{for(;T.length!==0;){const d=P.length-T.length,A=T.pop(),$=new FormData,X=Q.simulate(d,$s(A.size));try{const Y=A;$.append("f","json"),$.append("file",Y),$.append("partId",`${d}`);const{data:ss}=await m(K,{timeout:0,body:$,responseType:"json",method:"post"});if(u(a),!ss.success)throw new Error("Part upload failed")}finally{X.remove()}}};for(let d=0;dA).join(",")},responseType:"json",method:"post"});if(u(a),!I.success)throw new Error("Commit failed");return I.item}catch(r){if(n!=null){const i=g(n,"delete");await m(i,{query:{f:"json"},responseType:"json",method:"post"})}throw r}}function _s(e){return e.replaceAll("/","_").replaceAll("\\","_")}async function re(e,t,s){var n;const o=e.length;if(!o)return(n=s==null?void 0:s.onProgress)==null||n.call(s,1),[];const a=b(o,s==null?void 0:s.onProgress,"uploadAssets");return Promise.all(e.map((r,i)=>Ds(r,t,{...s,onProgress:a.makeOnProgress(i)})))}async function Ds(e,{layer:t,ongoingUploads:s},o){var r;const a=s.get(e);if(a)return a;if(!Vs(t))throw new fs;if(Ss(e,t))return(r=o==null?void 0:o.onProgress)==null||r.call(o,1),e;const n=ks(e,t,o);s.set(e,n);try{await n}finally{s.delete(e)}return e}function Ss(e,t){const{parsedUrl:s}=t;return s!=null&&e.metadata.externalSources.some(o=>ps(o,s))}async function ks(e,t,s){const{metadata:o}=e,{displaySource:a}=o,n=R(a==null?void 0:a.source,t),r=!!n,i=o.externalSources.length>0,c=r?Us(n,t,s):i?Bs(e,t,s):Os(e,t,s),p=await c;return u(s),e.addExternalSources([p]),e}async function Us(e,t,s){return{source:await z(e,t,s),original:!0}}async function Bs(e,t,s){const o=G(t),{externalSources:a}=e.metadata,n=Cs(a,t);if(!n)throw new hs;const r=b(M.uploadConvertibleSource,s==null?void 0:s.onProgress,"uploadConvertibleSource"),i=await z(n,t,{onProgress:r.makeOnProgress("uploadEditSource")});e.addExternalSources([{source:i,original:!0}]);const c=n.reduce((l,{asset:f})=>f instanceof File?l+f.size:l,0),p=r.simulate("serviceAssetsToGlb",xs(c));try{return{source:await Ws(i,t,o)}}finally{p.remove()}}async function Os(e,t,s){const o=b(M.uploadLocalMesh,s==null?void 0:s.onProgress,"uploadLocalMesh"),a=qs(e,t,{...s,onProgress:o.makeOnProgress("meshToAssetBlob")});return{source:await H([a],t,{...s,onProgress:o.makeOnProgress("uploadAssetBlobs")}),extent:e.extent.clone(),original:!0}}async function qs(e,t,s){const o=G(t),a=await e.load(s),n=await a.toBinaryGLTF({ignoreLocalTransform:!0});u(s);const r=await n.buffer();return u(s),{blob:new Blob([r.data],{type:r.type}),assetName:`${as()}.glb`,assetType:o}}function Cs(e,t){for(const s of e){const o=R(s.source,t);if(o)return o}return null}function R(e,t){if(!e)return null;const{infoFor3D:{supportedFormats:s,editFormats:o}}=t,a=ms(e),n=new Array;let r=!1;for(let i=0;iRs(o,s)),t,s)}async function H(e,t,s){const o=b(M.uploadAssetBlobs,s==null?void 0:s.onProgress,"uploadAssetBlobs"),a=await Hs(e,t,{...s,onProgress:o.makeOnProgress("prepareAssetItems")});u(s);const n=a.map(({item:i})=>i),{uploadResults:r}=await Gs(n,t,{...s,onProgress:o.makeOnProgress("uploadAssetItems")});return u(s),e.map((i,c)=>Js(a[c],r[c],t))}async function Rs(e,t){const{asset:s,assetType:o}=e;if(s instanceof File)return{blob:s,assetName:s.name,assetType:o};const a=await s.toBlob(t);return u(t),{blob:a,assetName:s.assetName,assetType:o}}async function zs(e,t,s){const{blob:o,assetType:a,assetName:n}=e;let r=null;try{const i=await Ns({data:o,name:n},t.url,s);u(s),r={assetType:a,assetUploadId:i.itemID}}catch(i){cs(i),Zs().warnOnce(`Service ${t.url} does not support the REST Uploads API.`)}if(!r){const i=await ls(o);if(u(s),!i.isBase64)throw new ws;r={assetType:a,assetData:i.data}}if(!r)throw new ys;return{item:r,assetName:n}}function Hs(e,t,s){const o=b(e.length,s==null?void 0:s.onProgress,"prepareAssetItems");return Promise.all(e.map(async(a,n)=>{const r=zs(await a,t,{...s,onProgress:o.makeOnProgress(n)});return u(s),r}))}async function Gs(e,t,s){const o=q(s==null?void 0:s.onProgress);try{const a=await m(g(t.parsedUrl.path,"uploadAssets"),{timeout:0,query:{f:"json",assets:JSON.stringify(e)},method:"post",responseType:"json"});if(u(s),a.data.uploadResults.length!==e.length)throw new bs(e.length,a.data.uploadResults.length);return a.data}finally{o.remove()}}function Js(e,t,s){const{success:o}=t;if(!o){const{error:p}=t;throw new Ps(e.assetName,p)}const{assetHash:a}=t,{assetName:n,item:{assetType:r}}=e,{infoFor3D:{supportedFormats:i}}=s,c=ns(r,i);if(!c)throw new O(r);return new U(n,c,[new B(`${s.parsedUrl.path}/assets/${a}`,a)])}async function Ws(e,t,s){var p;const o=e.map(({assetName:l,parts:f})=>({assetName:l,assetHash:f[0].partHash})),a=(p=t.capabilities)==null?void 0:p.operations.supportsAsyncConvert3D,n={f:"json",assets:JSON.stringify(o),transportType:"esriTransportTypeUrl",targetFormat:s,async:a},r=g(t.parsedUrl.path,"convert3D");let i;try{i=(await(a?Qs:Ks)(r,{query:n,responseType:"json",timeout:0})).data}catch{throw new Ts}const{supportedFormats:c}=t.infoFor3D;return i.assets.map(l=>{const f=k(l.contentType,c);if(!f)throw new O(f);return new U(l.assetName,l.contentType,[new B(l.assetURL,l.assetHash)])})}function Ks(e,t){return m(e,t)}async function Qs(e,t){const s=(await m(e,t)).data.statusUrl;for(;;){const o=(await m(s,{query:{f:"json"},responseType:"json"})).data;switch(o.status){case"Completed":return m(o.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new Error(o.status);case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new Error}await rs(Xs)}}function Vs(e){return!!e.infoFor3D&&!!e.url}function G(e){const{infoFor3D:t}=e,s=k("model/gltf-binary",t.supportedFormats)??is("glb",t.supportedFormats);if(!s)throw new gs;return s}function Zs(){return us.getLogger("esri.layers.graphics.sources.support.uploadAssets")}const Xs=v(1e3);export{re as uploadAssets}; diff --git a/dist/assets/utils-4xKNo3Tf.js b/dist/assets/utils-4xKNo3Tf.js new file mode 100644 index 0000000..ff9c703 --- /dev/null +++ b/dist/assets/utils-4xKNo3Tf.js @@ -0,0 +1 @@ +import{e as c,y as f,c as A,dr as de,f6 as We,dp as Mt,iw as Z,bI as W,ud as rs,dt as Nt,ue as os,du as Ft,uu as Dt,xn as $t,E as It,sm as Ae,T as Te,dT as is}from"./index-J0iiHjMT.js";import{b as as,u as x,M as us,O as ls,Q as St,S as cs,V as qe,o as Pe,X as ps,Y as hs,Z as fs,_ as ge,$ as Vt,a0 as ms,a1 as Xe,a2 as He,a3 as ds,a4 as K,a5 as gs,a6 as ys,a7 as ws,a8 as bs,a9 as xs,aa as Ut,ab as vs,ac as As,ad as Ts}from"./dataUtils-s_UKlouc.js";let Ot=class extends de{constructor(){super(...arguments),this.raster=void 0}};c([f({json:{write:!0}})],Ot.prototype,"raster",void 0),Ot=c([A("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Ot);const U=Ot;var Lt;let Wt=Lt=class extends U{clone(){return new Lt({raster:this.raster})}};Wt=Lt=c([A("esri.layers.support.rasterFunctions.AspectFunctionArguments")],Wt);const Ps=Wt,$s=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let S=class extends de{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:s}=t;let o=s.rasters||s.raster&&[s.raster];for(;o!=null&&o.length;){e.unshift(...o);const n=[];for(let u=0;u=0;n--)e[n].isNoopProcess&&e.splice(n,1);let r=!1;for(let n=0;n1}const a=e.some(({name:n})=>$s.has(n.toLowerCase()));return{functions:e,hasBranches:r,hasFocalFunction:a}}bind(t,e=!1,s=-1){this.id=s+1;const o=this._getRasterValues();let r=!0;for(let a=0;athis._readRasterValue(o,t));return this._processPixels({...t,pixelBlocks:s})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(n=>n.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((n,u)=>n!==u);const a=t.filter(n=>n.functionName==="ExtractBand");return a.length&&a.forEach((n,u)=>{n.isInputBandIdsSwizzled=!0,n.swizzledBandSelection=[u,u,u]}),this.rawInputBandIds}const s=t[0];if(s){if(e=s.processInputBandIds(),s.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let a=0;ar!==a),this.rawInputBandIds=o,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:s}=this.functionArguments;return s&&Array.isArray(s)&&s.length?(t.rasters=s.map(o=>this._isRasterFunctionValue(o)?o.getWebGLProcessorDefinition():typeof o=="number"?{name:"Constant",parameters:{value:o},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:o},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(o=>o!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_isOutputRoundingNeeded(){const{outputPixelType:t}=this;return((t==null?void 0:t.startsWith("u"))||(t==null?void 0:t.startsWith("s")))??!1}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:s,rasterIds:o}=t;if(e.length===0)return s;const r=e.map(n=>n&&typeof n=="object"&&"bind"in n&&n.rasterInfo?n.rasterInfo:typeof n=="string"&&o.includes(n)?s[o.indexOf(n)]:typeof n!="number"?s[0]:void 0),a=r.find(n=>n)??s[0];return r.forEach((n,u)=>{n===void 0&&(r[u]=a)}),r}_getPrimaryRasterId(t){return t==null?void 0:t.url}_getPrimaryRasters(t,e=[],s=[]){for(let o=0;oe?o.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),s.BAND_COUNT&&Number(s.BAND_COUNT)!==e&&(t.keyProperties={...s,BAND_COUNT:typeof s.BAND_COUNT=="string"?String(e):e})}};c([f({json:{write:!0}})],S.prototype,"functionName",void 0),c([f({json:{write:!0}})],S.prototype,"functionArguments",void 0),c([f()],S.prototype,"rasterArgumentNames",void 0),c([f({json:{write:!0}}),We(i=>i==null?void 0:i.toLowerCase())],S.prototype,"outputPixelType",void 0),c([f({json:{write:!0}})],S.prototype,"mainPrimaryRasterId",void 0),c([f()],S.prototype,"sourceRasters",void 0),c([f({type:[as],json:{write:!0}})],S.prototype,"sourceRasterInfos",void 0),c([f({json:{write:!0}})],S.prototype,"rasterInfo",void 0),c([f({json:{write:!0}})],S.prototype,"readingBufferSize",void 0),c([f({json:{write:!0}})],S.prototype,"id",void 0),c([f()],S.prototype,"isNoopProcess",void 0),c([f()],S.prototype,"supportsGPU",null),c([f()],S.prototype,"rawInputBandIds",void 0),c([f()],S.prototype,"isInputBandIdsSwizzled",void 0),c([f()],S.prototype,"swizzledBandSelection",void 0),c([f()],S.prototype,"isBranch",void 0),c([f()],S.prototype,"flatWebGLFunctionChain",null),c([f()],S.prototype,"_bindingResult",void 0),S=c([A("esri.layers.support.rasterFunctions.BaseRasterFunction")],S);const V=S;let rt=class extends V{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var s;const t=this.sourceRasterInfos[0];this.isGCS=((s=t.spatialReference)==null?void 0:s.isGeographic)??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.histograms=null,e.colormap=null,e.attributeTable=null,e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return null;const{extent:s,primaryPixelSizes:o}=t,r=o==null?void 0:o[0],a=r??(s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1});return us(e,{resolution:a})}};c([f({json:{write:!0,name:"rasterFunction"}})],rt.prototype,"functionName",void 0),c([f({type:Ps,json:{write:!0,name:"rasterFunctionArguments"}})],rt.prototype,"functionArguments",void 0),c([f()],rt.prototype,"rasterArgumentNames",void 0),c([f({json:{write:!0}})],rt.prototype,"isGCS",void 0),rt=c([A("esri.layers.support.rasterFunctions.AspectFunction")],rt);const Ns=rt,Fs=new Set(["+","-","*","/","(",")"]);function Is(i,t){(i=i.replaceAll(" ","")).startsWith("-")&&(i="0"+i),i.startsWith("+")&&(i=i.slice(1,i.length));const e=i.split(""),s=[],o=[];let r="";for(let a=0;a-1)e>0&&(o+=t+1);else{for(let a=0;a0&&(o+=t+1)}let r=0;for(let a=0;a0;){const{numIndex:a,opIndex:n}=Cs(o);if(s=Rs(i,o[n],r[a],r[a+1]),o.length===1)break;o=ks(o,n),r.splice(a,2,s)}return[s]}const js=new Mt({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function _s(i,t){if(!ls(i))return i;const{equation:e,method:s}=t,o=t.bandIndexes.map(p=>p-1),{pixels:r,mask:a}=i;let n;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=$e(a,r[o[0]],r[o[1]]);break;case"ndwi":n=$e(a,r[o[1]],r[o[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=Ms(a,r[o[0]],r[o[1]]);break;case"ci-g":case"ci-re":n=Ds(a,r[o[0]],r[o[1]]);break;case"savi":n=Os(a,r[o[0]],r[o[1]],o[2]+1);break;case"tsavi":n=Es(a,r[o[0]],r[o[1]],o[2]+1,o[3]+1,o[4]+1);break;case"msavi":n=Gs(a,r[o[0]],r[o[1]]);break;case"gemi":n=zs(a,r[o[0]],r[o[1]]);break;case"pvi":n=Us(a,r[o[0]],r[o[1]],o[2]+1,o[3]+1);break;case"gvitm":n=Vs(a,[r[o[0]],r[o[1]],r[o[2]],r[o[3]],r[o[4]],r[o[5]]]);break;case"sultan":n=Ls(a,[r[o[0]],r[o[1]],r[o[2]],r[o[3]],r[o[4]],r[o[5]]]);break;case"vari":n=Ws(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"mtvi2":n=qs(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"rtvi-core":n=Xs(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"evi":n=Hs(a,[r[o[0]],r[o[1]],r[o[2]]]);break;case"wndwi":n=Js(a,[r[o[0]],r[o[1]],r[o[2]]],o[3]?o[3]+1:.5);break;case"bai":n=Ys(a,r[o[0]],r[o[1]]);break;case"custom":n=Bs(a,r,e);break;default:return i}const u=a!=null?new Uint8Array(a.length):null;a!=null&&u!=null&&u.set(a);const l=new x({width:i.width,height:i.height,pixelType:"f32",pixels:n,mask:u});return l.updateStatistics(),l}function Ss(i,t,e,s){const{mask:o,pixels:r,width:a,height:n}=i,u=r[e],l=r[t],p=l.length,h=s?new Uint8Array(p):new Float32Array(p),m=s?100:1,g=s?100.5:0;for(let y=0;yparseFloat(n));return _s(e,{method:s,bandIndexes:r,equation:o})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let s,o;const r=new Float32Array(3),{method:a}=this.functionArguments;switch(a){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":s=O([e[0],e[1],0]),o="ndxi";break;case"ndwi":s=O([e[1],e[0],0]),o="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=O([e[0],e[1],0]),o="sr";break;case"ci-g":case"ci-re":s=O([e[0],e[1],0]),o="ci";break;case"savi":s=O([e[0],e[1],0]),o="savi",r[0]=t[2]+1;break;case"tsavi":s=O([e[0],e[1],0]),o="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":s=O([e[0],e[1],0]),o="msavi";break;case"gemi":s=O([e[0],e[1],0]),o="gemi";break;case"pvi":s=O([e[0],e[1],0]),o="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":s=O([e[0],e[1],e[2]]),o="vari";break;case"mtvi2":s=O([e[0],e[1],e[2]]),o="mtvi2";break;case"rtvi-core":s=O([e[0],e[1],e[2]]),o="rtvicore";break;case"evi":s=O([e[0],e[1],e[2]]),o="evi";break;case"wndwi":s=O([e[0],e[1],0]),o="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":s=O([e[1],e[0],0]),o="bai";break;default:s=O([0,1,2]),o="custom"}return{bandIndexMat3:s,indexType:o,adjustments:r}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(n=>parseFloat(n)-1),s=t.length,o=e.map(n=>n>=s?s-1:n),r=Zs.has(this.functionArguments.method)?3:2,a=o.slice(0,r).map(n=>t[n]);return a.length===2&&a.push(0),a}};c([f({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([f({type:Ks,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([f()],gt.prototype,"rasterArgumentNames",void 0),gt=c([A("esri.layers.support.rasterFunctions.BandArithmeticFunction")],gt);const Qs=gt;var Xt;let J=Xt=class extends U{castColormapName(i){if(!i)return null;const t=i.toLowerCase();return cs.includes(t)?t:null}readColorRamp(i){return os(i)}readColorRampName(i,t){if(!i)return null;const e=St.jsonValues.find(s=>s.toLowerCase()===i.toLowerCase());return e?St.fromJSON(e):null}clone(){var i;return new Xt({colormap:W(this.colormap),colormapName:this.colormapName,colorRamp:(i=this.colorRamp)==null?void 0:i.clone(),colorRampName:this.colorRampName})}};c([f({type:[[Number]],json:{write:!0}})],J.prototype,"colormap",void 0),c([f({type:String,json:{write:!0}})],J.prototype,"colormapName",void 0),c([We("colormapName")],J.prototype,"castColormapName",null),c([f({types:rs,json:{write:!0}})],J.prototype,"colorRamp",void 0),c([Nt("colorRamp")],J.prototype,"readColorRamp",null),c([f({type:St.apiValues,json:{type:St.jsonValues,write:St.write}})],J.prototype,"colorRampName",void 0),c([Nt("colorRampName")],J.prototype,"readColorRampName",null),J=Xt=c([A("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],J);const tn=J,en=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],sn=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function ye(i,t){const e=[],s=[];for(let r=0;r[s,...e]),t):null}let Q=class extends V{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:s,colorRamp:o,colorRampName:r}=this.functionArguments;if(!(e!=null&&e.length))if(o)e=Pe(o,{interpolateAlpha:!0});else if(r){const n=ps(r);n&&(e=Pe(n))}else s&&(e=ln(s));if(!(e!=null&&e.length))return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([f({json:{write:!0,name:"rasterFunction"}})],Q.prototype,"functionName",void 0),c([f({type:tn,json:{write:!0,name:"rasterFunctionArguments"}})],Q.prototype,"functionArguments",void 0),c([f()],Q.prototype,"rasterArgumentNames",void 0),c([f()],Q.prototype,"isNoopProcess",void 0),c([f({json:{write:!0}})],Q.prototype,"indexedColormap",void 0),Q=c([A("esri.layers.support.rasterFunctions.ColormapFunction")],Q);const cn=Q;var Ht;let Ct=Ht=class extends U{constructor(){super(...arguments),this.rasters=[]}writeRasters(i,t){t.rasters=i.map(e=>typeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new Ht({rasters:W(this.rasters)})}};c([f({json:{write:!0}})],Ct.prototype,"rasters",void 0),c([Ft("rasters")],Ct.prototype,"writeRasters",null),Ct=Ht=c([A("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],Ct);const pn=Ct;let yt=class extends V{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();if(s.attributeTable=null,s.colormap=null,s.pixelType=this.outputPixelType,s.bandCount=t.map(({bandCount:r})=>r).reduce((r,a)=>r+a),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:a})=>a!=null&&r.push(...a)),s.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:a})=>a!=null&&r.push(...a)),s.histograms=r}s.bandCount>1&&(s.colormap=null,s.attributeTable=null);const o=t.every(r=>{var a;return(a=r.keyProperties.BandProperties)==null?void 0:a.length})?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return s.keyProperties={...s.keyProperties,BandProperties:o},this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?(e==null?void 0:e[0])==null?null:hs(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([f({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([f({type:pn,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([f()],yt.prototype,"rasterArgumentNames",void 0),yt=c([A("esri.layers.support.rasterFunctions.CompositeBandFunction")],yt);const hn=yt;var Jt;let Bt=Jt=class extends U{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new Jt({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([f({json:{write:!0}})],Bt.prototype,"contrastOffset",void 0),c([f({json:{write:!0}})],Bt.prototype,"brightnessOffset",void 0),Bt=Jt=c([A("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Bt);const fn=Bt;let ot=class extends V{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const s=e.clone();s.colormap=null,s.statistics=null,s.histograms=null,this.rasterInfo=s;const{contrastOffset:o,brightnessOffset:r}=this.functionArguments;return this.lookup=fs(o,r),{success:!0,supportsGPU:!0}}_processPixels(t){var s;const e=(s=t.pixelBlocks)==null?void 0:s[0];return e==null?null:ge(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([f({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([f({type:fn,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([f()],ot.prototype,"rasterArgumentNames",void 0),c([f({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([A("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ot);const mn=ot,N={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},dn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},L={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},H={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},gn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Je={setNull:50,conditional:78},Ne={...dn,...L,...H,...gn,...Je};function we(i,t,e,s,o){const r=Math.floor(s/2);for(let n=0;nu+l);return a!==0&&a!==1&&(s=s.map(u=>u/a)),vn(e,{kernel:s,rows:o,cols:r,outputPixelType:this.outputPixelType})}_getWebGLParameters(){let{kernel:t}=this.functionArguments;const e=t.reduce((o,r)=>o+r);e!==0&&e!==1&&(t=t.map(o=>o/e));const s=new Float32Array(Ie);return s.set(t),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:s,clampRange:Dt(this.outputPixelType)}}};c([f({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([f({type:An,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([f()],wt.prototype,"rasterArgumentNames",void 0),wt=c([A("esri.layers.support.rasterFunctions.ConvolutionFunction")],wt);const Tn=wt;var Kt;const Ye=new Mt({0:"standard",1:"platform",2:"profile"},{useNumericKeys:!0});let bt=Kt=class extends U{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(i,t){return Ye.fromJSON(t.type??t.curvatureType??0)}clone(){return new Kt({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([f({json:{write:{target:"type"}}}),Z(Ye)],bt.prototype,"curvatureType",void 0),c([Nt("curvatureType",["type","curvatureType"])],bt.prototype,"readCurvatureType",null),c([f({type:Number,json:{write:!0}})],bt.prototype,"zFactor",void 0),bt=Kt=c([A("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],bt);const Pn=bt;let at=class extends V{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){var e;this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.bandCount=1,this.rasterInfo=t,this.isGCS=((e=t.spatialReference)==null?void 0:e.isGeographic)??!1,{success:!0,supportsGPU:!0}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{zFactor:s,curvatureType:o}=this.functionArguments,{extent:r,primaryPixelSizes:a}=t,n=a==null?void 0:a[0],u=n??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),l=this.isGCS&&s>=1?s*Vt:s;return ms(e,{zFactor:l,curvatureType:o,resolution:u})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Vt:t}}};c([f({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([f({type:Pn,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([f()],at.prototype,"rasterArgumentNames",void 0),c([f({json:{write:!0}})],at.prototype,"isGCS",void 0),at=c([A("esri.layers.support.rasterFunctions.CurvatureFunction")],at);const $n=at;var Zt;let Y=Zt=class extends U{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Xe.bestMatch}clone(){var i,t,e;return new Zt({bandIds:(i=this.bandIds)==null?void 0:i.slice(),bandNames:(t=this.bandNames)==null?void 0:t.slice(),bandWavelengths:(e=this.bandWavelengths)==null?void 0:e.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([f({json:{write:!0}})],Y.prototype,"bandIds",void 0),c([f({json:{write:!0}})],Y.prototype,"bandNames",void 0),c([f({json:{write:!0}})],Y.prototype,"bandWavelengths",void 0),c([Z({0:"name",1:"wavelength",2:"id"})],Y.prototype,"method",void 0),c([f({json:{write:!0}})],Y.prototype,"missingBandAction",void 0),c([f({json:{write:!0}})],Y.prototype,"wavelengthMatchTolerance",void 0),Y=Zt=c([A("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],Y);const Nn=Y;let xt=class extends V{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){var v;const{functionArguments:t,sourceRasterInfos:e}=this,s=e[0],{method:o,bandNames:r,bandWavelengths:a,bandIds:n,missingBandAction:u}=t,l=(r==null?void 0:r.length)&&(o==="name"||o!=="id"&&!(n!=null&&n.length)),p=(a==null?void 0:a.length)&&(o==="wavelength"||o!=="id"&&!(n!=null&&n.length)),h=u===Xe.fail,m=l?this._matchBandNames(s,r):p?this._matchBandWavelengths(s,a,h):this._matchBandIds(s,n,h);if(m==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${l?"band names":p?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=m,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const g=s.clone();g.pixelType=this.outputPixelType,g.bandCount=m.length;const{statistics:w,histograms:y}=g;w!=null&&w.length&&(g.statistics=m.map(b=>w[b]||w[w.length-1])),y!=null&&y.length&&(g.histograms=m.map(b=>y[b]||y[y.length-1]));let d=(v=g.keyProperties)==null?void 0:v.BandProperties;return d!=null&&d.length&&(d=m.map(b=>b>=d.length?d[d.length-1]:d[b]),g.keyProperties={...g.keyProperties,BandProperties:d}),this.rasterInfo=g,{success:!0,supportsGPU:g.bandCount<=3}}_processPixels(t){var r;const e=(r=t.pixelBlocks)==null?void 0:r[0];if(e==null)return null;const s=e.pixels.length,o=this.functionArguments.bandIds.map(a=>a>=s?s-1:a);return e.extractBands(o)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:O(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(s=>s>=e?e-1:s).map(s=>t[s])}_matchBandNames(t,e){const s=t.bandInfos.map(({name:r})=>r.toLowerCase()),o=[];for(let r=0;ru.startsWith("nearinfrared_1")),n===-1&&(n=s.findIndex(u=>u.startsWith("nearinfrared")))),n===-1)return null;o.push(n)}return o}_matchBandIds(t,e,s){const{bandCount:o}=t;return!(e!=null&&e.length)||s&&e.some(r=>r<0||r>=o)?null:e}_matchBandWavelengths(t,e,s){const{bandInfos:o}=t,r=[];for(let u=0;u=w.minWavelength&&l<=w.maxWavelength,d=Math.abs(l-(w.minWavelength+w.maxWavelength)/2);y?dtypeof e=="number"||typeof e=="string"?e:e.toJSON())}clone(){return new Qt({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:W(this.rasters)})}};c([f({json:{write:!0}})],ut.prototype,"operation",void 0),c([f({json:{write:!0}})],ut.prototype,"rasters",void 0),c([Ft("rasters")],ut.prototype,"writeRasters",null),c([f({json:{write:!0}})],ut.prototype,"processAsMultiband",void 0),ut=Qt=c([A("esri.layers.support.rasterFunctions.LocalFunctionArguments")],ut);const In=ut,E=new Map;function Rn(i){return E.get(i)}E.set(H.acos,[0,Math.PI]),E.set(H.asin,[-Math.PI/2,Math.PI/2]),E.set(H.atan,[-Math.PI/2,Math.PI/2]),E.set(H.cos,[-1,1]),E.set(H.sin,[-1,1]),E.set(L.booleanAnd,[0,1]),E.set(L.booleanNot,[0,1]),E.set(L.booleanOr,[0,1]),E.set(L.booleanXOr,[0,1]),E.set(L.equalTo,[0,1]),E.set(L.notEqual,[0,1]),E.set(L.greaterThan,[0,1]),E.set(L.greaterThanEqual,[0,1]),E.set(L.lessThan,[0,1]),E.set(L.lessThanEqual,[0,1]),E.set(L.isNull,[0,1]);const Re=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function kn(i,t=!1){const e=i.map(n=>n.mask),s=e.filter(n=>n!=null),o=i[0].pixels[0].length;if(s.length===0)return new Uint8Array(o).fill(255);const r=s[0],a=new Uint8Array(r);if(s.length===1)return a;if(!t){for(let n=1;n=1?t[u]=0:a[u]=Math.atanh(l)}return a}const n=s===H.asin?Math.asin:Math.acos;for(let u=0;u1?t[u]=0:a[u]=n(l)}return a}function En(i,t,e,s){const[o]=i,r=o.length,a=x.createEmptyBand(e,r);for(let n=0;n>o[n]);return a}function qn(i,t,e){const[s,o]=i,r=s.length,a=x.createEmptyBand(e,r);for(let n=0;no[n]?1:0);return a}function or(i,t,e){const[s,o]=i,r=s.length,a=x.createEmptyBand(e,r);for(let n=0;n=o[n]?1:0);return a}function ir(i,t,e){const[s,o]=i,r=s.length,a=x.createEmptyBand(e,r);for(let n=0;np&&(u=p)}a[n]=u}return a}function je(i,t,e){const s=i.length;if(s<2)return i[0];const[o]=i,r=o.length,a=x.createEmptyBand(e,r);for(let n=0;nh&&(u=h)}a[n]=l-u}return a}function _e(i,t,e){const s=i.length;if(s<2)return i[0];const[o]=i,r=o.length,a=x.createEmptyBand(e,r);for(let n=0;np&&(p=l,u=h);r[n]=u}return r}function Ee(i,t,e){const s=i.length;if(s<=2)return Ze(i,t,e);const o=i[0].length,r=x.createEmptyBand(e,o),a=new Map;for(let n=0;nr?t[n]=0:s[n]=a?Math.round(u):u}}function dr(i,t,e={}){fr();let s=kn(i,t>=66&&t<=75);const{outputPixelType:o="f32"}=e,r=!_.has(t)||e.processAsMultiband,a=r?i[0].pixels.length:1,n=[];for(let l=0;lg.pixels):i.map(g=>g.pixels[l]);let h,m=!0;if(t===Je.setNull){const g=hr(p,s,o);h=g.band,s=g.mask,m=!1}else T.has(t)?h=T.get(t)(p,s,"f64"):M.has(t)?h=t===H.asin||t===H.acos||t===H.atanh?On(p,s,"f64",t):En(p,s,"f64",M.get(t)):zt.has(t)?h=Gn(p,s,"f64",zt.get(t)):_.has(t)?h=_.get(t)(p,s,"f64"):(h=p[0],m=!1);if(m&&t!==L.isNull&&!E.has(t)){const g=x.createEmptyBand(o,h.length);s||(s=new Uint8Array(h.length).fill(255)),mr(h,s,o,g),h=g}n.push(h)}const u=i[0];return new x({width:u.width,height:u.height,pixelType:o,mask:t===L.isNull?null:s,pixels:n})}let vt=class extends V{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:s}=e,{processAsMultiband:o}=this.functionArguments;if(t.some(p=>p.bandCount!==s))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:a}=this.functionArguments,n=Re[r];if(!(n===999||a.length===n||a.length<=1&&n===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${n}`};this.outputPixelType=this._getOutputPixelType("f32");const u=e.clone();u.pixelType=this.outputPixelType,u.statistics=null,u.histograms=null,u.colormap=null,u.attributeTable=null,u.bandCount=n!==999||o?s:1;const l=Rn(r);if(l){u.statistics=[];for(let p=0;p16)}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(s=>s==null)?null:dr(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){var u;const{operation:t}=this.functionArguments,e=Re[t],s=((u=Object.keys(Ne).find(l=>Ne[l]===t))==null?void 0:u.toLowerCase())??"undefined",o=this.outputPixelType??"f32";let[r,a]=Dt(o);const n=o.startsWith("u")||o.startsWith("s");return n&&(r-=1e-4,a+=1e-4),{imageCount:e,operationName:s,domainRange:[r,a],isOutputRounded:n}}};c([f({json:{write:!0,name:"rasterFunction"}})],vt.prototype,"functionName",void 0),c([f({type:In,json:{write:!0,name:"rasterFunctionArguments"}})],vt.prototype,"functionArguments",void 0),c([f()],vt.prototype,"rasterArgumentNames",void 0),vt=c([A("esri.layers.support.rasterFunctions.LocalFunction")],vt);const gr=vt;var te;let lt=te=class extends U{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=He.matchAny}get normalizedNoDataValues(){const{noDataValues:i}=this;if(!(i!=null&&i.length))return null;let t=!1;const e=i.map(s=>{if(typeof s=="number")return t=!0,[s];if(typeof s=="string"){const o=s.trim().split(" ").filter(r=>r.trim()!=="").map(r=>Number(r));return t=t||o.length>0,o.length===0?null:o}return null});return t?e:null}clone(){var i,t;return new te({includedRanges:((i=this.includedRanges)==null?void 0:i.slice())??[],noDataValues:((t=this.noDataValues)==null?void 0:t.slice())??[],noDataInterpretation:this.noDataInterpretation})}};c([f({json:{write:!0}})],lt.prototype,"includedRanges",void 0),c([f({json:{write:!0}})],lt.prototype,"noDataValues",void 0),c([f()],lt.prototype,"normalizedNoDataValues",null),c([f({json:{write:!0}})],lt.prototype,"noDataInterpretation",void 0),lt=te=c([A("esri.layers.support.rasterFunctions.MaskFunctionArguments")],lt);const yr=lt;let ct=class extends V{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:s,normalizedNoDataValues:o}=this.functionArguments;if(!(s!=null&&s.length)&&!(o!=null&&o.length))return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let n=0;n{var u;return(n==null?void 0:n.length)===((u=o[0])==null?void 0:u.length)});return{success:!0,supportsGPU:(!s||s.length<=2*K)&&(!o||a&&o[0].length<=K)}}_processPixels(t){var l;const e=(l=t.pixelBlocks)==null?void 0:l[0];if(e==null)return null;const{outputPixelType:s,lookups:o}=this,{includedRanges:r,noDataInterpretation:a,normalizedNoDataValues:n}=this.functionArguments,u=a===He.matchAll;return gs(e,{includedRanges:r,noDataValues:n,outputPixelType:s,matchAll:u,lookups:o})}_getWebGLParameters(){var r;const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,s=new Float32Array(K);s.fill($t),(r=e==null?void 0:e[0])!=null&&r.length&&s.set(e[0]);const o=new Float32Array(K);for(let a=0;a=o.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const a=o.clone();a.pixelType=this.outputPixelType,a.colormap=null,a.histograms=null,a.bandCount=1,a.keyProperties={...a.keyProperties,BandProperties:void 0};const[n,u,l,p]=t?[-1,1,0,.1]:[0,200,100,10];return a.statistics=[{min:n,max:u,avg:l,stddev:p}],this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){var a;const e=(a=t.pixelBlocks)==null?void 0:a[0];if(e==null)return null;const{visibleBandID:s,infraredBandID:o,scientificOutput:r}=this.functionArguments;return Ss(e,s,o,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:s}=this.functionArguments,o=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:O(o),scaled:!s}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:s}=this.functionArguments;return[s,e,0].map(o=>t[o])}};c([f({json:{write:!0,name:"rasterFunction"}})],Tt.prototype,"functionName",void 0),c([f({type:br,json:{write:!0,name:"rasterFunctionArguments"}})],Tt.prototype,"functionArguments",void 0),c([f()],Tt.prototype,"rasterArgumentNames",void 0),Tt=c([A("esri.layers.support.rasterFunctions.NDVIFunction")],Tt);const xr=Tt;var se;let tt=se=class extends U{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new se({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([f({json:{write:!0}})],tt.prototype,"inputRanges",void 0),c([f({json:{write:!0}})],tt.prototype,"outputValues",void 0),c([f({json:{write:!0}})],tt.prototype,"noDataRanges",void 0),c([f({json:{write:!0}})],tt.prototype,"allowUnmatched",void 0),c([f({json:{write:!0}})],tt.prototype,"isLastInputRangeInclusive",void 0),tt=se=c([A("esri.layers.support.rasterFunctions.RemapFunctionArguments")],tt);const vr=tt;let pt=class extends V{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null,t.bandCount=1,t.attributeTable=null;const{statistics:s}=t,{allowUnmatched:o,outputValues:r,inputRanges:a,noDataRanges:n,isLastInputRangeInclusive:u}=this.functionArguments;if(s!=null&&s.length&&(r!=null&&r.length))if(o){const l=Math.min.apply(null,[...r,s[0].min]),p=Math.max.apply(null,[...r,s[0].max]);t.statistics=[{...s[0],min:l,max:p}]}else{let l=r[0],p=l;for(let h=0;hr[h]?r[h]:l,p=p>r[h]?p:r[h];t.statistics=[{...s[0],min:l,max:p}]}return this.rasterInfo=t,this.lookup=o?null:ys({srcPixelType:e,inputRanges:a,outputValues:r,noDataRanges:n,allowUnmatched:o,isLastInputRangeInclusive:u,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=K)&&(!n||n.length<=K)}}_processPixels(t){var p;const e=(p=t.pixelBlocks)==null?void 0:p[0];if(e==null)return null;const{lookup:s,outputPixelType:o}=this;if(s){const h=ge(e,{lut:[s.lut],offset:s.offset,outputPixelType:o});return h!=null&&s.mask&&(h.mask=ws(e.pixels[0],e.mask,s.mask,s.offset,"u8")),h}const{inputRanges:r,outputValues:a,noDataRanges:n,allowUnmatched:u,isLastInputRangeInclusive:l}=this.functionArguments;return bs(e,{inputRanges:r,outputValues:a,noDataRanges:n,outputPixelType:o,allowUnmatched:u,isLastInputRangeInclusive:l})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:s}=this.functionArguments,o=new Float32Array(3*K),r=1e-5,a=this.functionArguments.inputRanges??[],n=this.functionArguments.outputValues??[],u=n.length;for(let p=0;p0&&(o[3*p]-=r),(p=1?t*Vt:t,slopeType:e,pixelSizeFactor:s??0,pixelSizePower:o??0}}};c([f({json:{write:!0,name:"rasterFunction"}})],ht.prototype,"functionName",void 0),c([f({type:Pr,json:{write:!0,name:"rasterFunctionArguments"}})],ht.prototype,"functionArguments",void 0),c([f()],ht.prototype,"rasterArgumentNames",void 0),c([f({json:{write:!0}})],ht.prototype,"isGCS",void 0),ht=c([A("esri.layers.support.rasterFunctions.SlopeFunction")],ht);const $r=ht,ze=new Mt({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Nr(i,t){const{fillNoDataOnly:e}=t,{band:s,width:o,height:r,mask:a,outBand:n}=i;if(e&&!a)return void n.set(s);const{statisticsType:u,kernelRows:l,kernelCols:p}=t,h=u==="stddev",m=o*r,g=new Float64Array(m),w=new Float64Array(m),y=new Uint32Array(m);for(let P=0;Pb-R),a?(m[y+d]=v[Math.floor((v.length-1)/2)],g[y+d]=v.length):n[y+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let w=p;wP&&(P=G,k=$);a?(w[v+b]=k,y[v+b]=R.size):n[v+b]=k}}if(a)for(let d=p;d1&&(n==null?void 0:n.length)){b=new Uint8Array(p),b.set(v[0]);for(let k=1;kNumber(i??(t==null?void 0:t.kernelRows)??3)}}})],ft.prototype,"rows",void 0),c([f({json:{write:!0,read:{source:["kernelCols","cols"],reader:(i,t)=>Number(i??(t==null?void 0:t.kernelCols)??3)}}})],ft.prototype,"cols",void 0),c([f({json:{write:!0}})],ft.prototype,"fillNoDataOnly",void 0),c([f({json:{read:{source:["statisticsType","type"],reader:(i,t)=>ze.fromJSON((t==null?void 0:t.statisticsType)??(t==null?void 0:t.type))??"min"},write:{target:"type"}}}),Z(ze)],ft.prototype,"statisticsType",void 0),ft=re=c([A("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],ft);const Cr=ft,Br=new Set(["min","max","mean","median","majority","minority"]);let Pt=class extends V{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();s.pixelType=this.outputPixelType;const{statisticsType:o}=this.functionArguments;return Br.has(o)||(s.statistics=null,s.histograms=null,s.colormap=null,s.attributeTable=null),this.rasterInfo=s,{success:!0,supportsGPU:s.bandCount<=3&&t<5}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return e;const{statisticsType:s,rows:o,cols:r,fillNoDataOnly:a}=this.functionArguments;return kr(e,{kernelRows:o,kernelCols:r,fillNoDataOnly:a,outputPixelType:this.outputPixelType,statisticsType:s,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:s,fillNoDataOnly:o}=this.functionArguments;return{fillNoDataOnly:o,kernelRows:t,kernelCols:e,statisticsType:s,clampRange:Dt(this.outputPixelType)}}};c([f({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([f({type:Cr,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([f()],Pt.prototype,"rasterArgumentNames",void 0),Pt=c([A("esri.layers.support.rasterFunctions.StatisticsFunction")],Pt);const jr=Pt;var oe;let mt=oe=class extends U{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(i,t){if(!(i!=null&&i.length))return null;const e=[];return i.forEach(s=>{const o={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};e.push(o)}),e}writeStatistics(i,t,e){if(!(i!=null&&i.length))return;const s=[];i.forEach(o=>{const r={...o,mean:o.avg,standardDeviation:o.stddev};delete r.avg,delete r.stddev,s.push(r)}),t[e]=s}clone(){return new oe({statistics:W(this.statistics),histograms:W(this.histograms)})}};c([f({json:{write:!0}})],mt.prototype,"statistics",void 0),c([Nt("statistics")],mt.prototype,"readStatistics",null),c([Ft("statistics")],mt.prototype,"writeStatistics",null),c([f({json:{write:!0}})],mt.prototype,"histograms",void 0),mt=oe=c([A("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],mt);const _r=mt;let st=class extends V{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:s,histograms:o}=this.functionArguments;return o&&(e.histograms=o),s&&(e.statistics=s),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([f({json:{write:!0,name:"rasterFunction"}})],st.prototype,"functionName",void 0),c([f({type:_r,json:{write:!0,name:"rasterFunctionArguments"}})],st.prototype,"functionArguments",void 0),c([f()],st.prototype,"rasterArgumentNames",void 0),c([f({json:{write:!0}})],st.prototype,"indexedColormap",void 0),c([f()],st.prototype,"isNoopProcess",void 0),st=c([A("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],st);const Sr=st;var ie;const Mr=new Mt({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let z=ie=class extends U{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(i,t,e){i!=null&&i.length&&(Array.isArray(i[0])||(i=i.map(s=>[s.min,s.max,s.avg,s.stddev])),t[e]=i)}clone(){return new ie({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:W(this.statistics),gamma:W(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:W(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([f({type:Boolean,json:{write:!0}})],z.prototype,"computeGamma",void 0),c([f({type:Boolean,json:{name:"dra",write:!0}})],z.prototype,"dynamicRangeAdjustment",void 0),c([f({type:[Number],json:{write:!0}})],z.prototype,"gamma",void 0),c([f()],z.prototype,"histograms",void 0),c([f({type:Number,json:{write:!0}})],z.prototype,"maxPercent",void 0),c([f({type:Number,json:{write:!0}})],z.prototype,"minPercent",void 0),c([f({type:Number,json:{write:!0}})],z.prototype,"numberOfStandardDeviations",void 0),c([f({type:Number,json:{name:"max",write:!0}})],z.prototype,"outputMax",void 0),c([f({type:Number,json:{name:"min",write:!0}})],z.prototype,"outputMin",void 0),c([f({type:Number,json:{write:!0}})],z.prototype,"sigmoidStrengthLevel",void 0),c([f({json:{type:[[Number]],write:!0}})],z.prototype,"statistics",void 0),c([Ft("statistics")],z.prototype,"writeStatistics",null),c([Z(Mr)],z.prototype,"stretchType",void 0),c([f({type:Boolean,json:{write:!0}})],z.prototype,"useGamma",void 0),z=ie=c([A("esri.layers.support.rasterFunctions.StretchFunctionArguments")],z);const Dr=z;let nt=class extends V{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:e}=t,{functionArguments:s}=this,{dynamicRangeAdjustment:o,gamma:r,useGamma:a}=s;if(!o&&["u8","u16","s8","s16"].includes(e)){const u=Ut(s.toJSON(),{rasterInfo:t}),l=this._isOutputRoundingNeeded()?"round":"float";this.lookup=vs({pixelType:e,...u,gamma:a?r:null,rounding:l}),this.cutOffs=u}else o||(this.cutOffs=Ut(s.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const n=t.clone();return n.pixelType=this.outputPixelType,n.statistics=null,n.histograms=null,n.colormap=null,n.attributeTable=null,this.outputPixelType==="u8"&&(n.keyProperties.DataType="processed"),this.rasterInfo=n,{success:!0,supportsGPU:!o}}_processPixels(t){var n;const e=(n=t.pixelBlocks)==null?void 0:n[0];if(e==null)return e;const{lookup:s}=this;if(s)return ge(e,{...s,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,r=this.cutOffs||Ut(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),a=o.useGamma?o.gamma:null;return As(e,{...r,gamma:a,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:e=255,gamma:s,useGamma:o}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,a=o&&(s!=null&&s.length)?Ts(r,s):[1,1,1],{minCutOff:n,maxCutOff:u}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};n.length===1&&(n[1]=n[2]=n[0],u[1]=u[2]=u[0]);const l=new Float32Array(r);let p;for(p=0;p1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const s=t.clone();return s.pixelType=this.outputPixelType,s.bandCount=1,s.dataType!=="thematic"&&(s.keyProperties=s.keyProperties?{...s.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){var e;return(e=t.pixelBlocks)==null?void 0:e[0]}};c([f({json:{write:!0,name:"rasterFunction"}})],dt.prototype,"functionName",void 0),c([f({type:Er,json:{write:!0,name:"rasterFunctionArguments"}})],dt.prototype,"functionArguments",void 0),c([f()],dt.prototype,"rasterArgumentNames",void 0),c([f()],dt.prototype,"isNoopProcess",void 0),dt=c([A("esri.layers.support.rasterFunctions.TableFunction")],dt);const Gr=dt,D=new Map;function zr(i,t){const{rasterFunctionArguments:e}=i;e&&(e.rasters||[e.raster]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(t.includes(s)||t.push(s)):"rasterFunctionArguments"in s&&zr(s,t))})}function xo(i,t){if(t=t??{},"function"in(i=W(i))&&"arguments"in i&&i.arguments){const e=es(i,new Map,t);if(ce(e),!e.renderingRule)throw new It("raster-function-helper","Unsupported raster function json.");i=e.renderingRule}if("rasterFunction"in i)return Qe(i=ue(i),t);throw new It("raster-function-helper","unsupported raster function json.")}function Ur(i,t){return t[0]==="rasters"&&Array.isArray(i.rasters)?i.rasters:t.map(e=>i[e])}function Ue(i){return!!(i&&typeof i=="object"&&i.rasterFunction&&i.rasterFunctionArguments)}function ue(i){var o;const{rasterFunction:t,rasterFunctionArguments:e}=i,s={};for(const r in e){let a=e[r];const n=r.toLowerCase();if(n==="rasters"&&Array.isArray(a))s.rasters=a.map(u=>Ue(u)?ue(u):u);else switch(Ue(a)&&(a=ue(a)),n){case"dra":s.dra=a;break;case"pspower":s.psPower=a;break;case"pszfactor":s.psZFactor=a;break;case"bandids":s.bandIds=a;break;default:s[r[0].toLowerCase()+r.slice(1)]=a}}return t!=="Local"||(o=s.rasters)!=null&&o.length||(s.rasters=["$$"]),{...i,rasterFunctionArguments:s}}function Qe(i,t){var m,g;const{rasterFunction:e,rasterFunctionArguments:s}=i,o=(m=i.outputPixelType)==null?void 0:m.toLowerCase();if(e==null||!D.has(e))throw new It("raster-function-helper",`unsupported raster function: ${e}`);const r=D.get(e),a=(typeof r.ctor=="function"?r.ctor:r.ctor.default).fromJSON({...i,outputPixelType:o}),{rasterArgumentNames:n}=a,u=[],l=Ur(s,n),p=n[0]==="rasters",h=[];for(let w=0;wtypeof r=="object"&&r.type==="RasterFunctionVariable"?le(r,t):r);if("value"in e&&["number","string","boolean"].includes(typeof e.value))return e.value;if(i.isDataset&&e.type!=="Scalar")return"$$";if(!("type"in e))return e;let s=e;switch(e.type){case"Scalar":s=e.value;break;case"AlgorithmicColorRamp":s=Ve(e);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:e.ArrayOfColorRamp.map(Ve)};break;case"ArgumentArray":if((o=e.elements)!=null&&o.length&&e.elements[0].type!=="RasterStatistics"){const r=[];for(let a=0;a{if(typeof n=="object")if(n._object_ref_id!=null){if(!e.has(n._object_ref_id))throw new It("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const l=e.get(a);l&&typeof l=="object"?Object.assign(n,l):r[u]=l}else ce({renderingRule:n,templates:e})}));else{if(!e.has(a))throw new It("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const n=e.get(a);o!=="_object_ref_id"?s[o]=n:n&&typeof n=="object"&&Object.assign(s,n)}}}function Vr(i){var t;(t=i.Statistics)!=null&&t.length&&typeof i.Statistics=="object"&&(i.Statistics=i.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),i.NumberOfStandardDeviation!=null&&(i.NumberOfStandardDeviations=i.NumberOfStandardDeviation,delete i.NumberOfStandardDeviation)}function Lr(i){var t,e;((e=(t=i.ColorRamp)==null?void 0:t.type)==null?void 0:e.toLowerCase())==="randomcolorramp"&&(delete i.ColorRamp,i.ColormapName="Random"),i.ColorSchemeType===0&&delete i.ColorRamp}function Wr(i){i.ConvolutionType!=null&&(i.Type=i.ConvolutionType,delete i.ConvolutionType)}function qr(i){var t;(t=i.NoDataValues)!=null&&t.length&&typeof i.NoDataValues[0]=="string"&&(i.NoDataValues=i.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}D.set("Aspect",{desc:"Aspect Function",ctor:Ns,rasterArgumentNames:["raster"]}),D.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Qs,rasterArgumentNames:["raster"]}),D.set("Colormap",{desc:"Colormap Function",ctor:cn,rasterArgumentNames:["raster"]}),D.set("CompositeBand",{desc:"CompositeBand Function",ctor:hn,rasterArgumentNames:["rasters"]}),D.set("Convolution",{desc:"Convolution Function",ctor:Tn,rasterArgumentNames:["raster"]}),D.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:mn,rasterArgumentNames:["raster"]}),D.set("ExtractBand",{desc:"ExtractBand Function",ctor:Fn,rasterArgumentNames:["raster"]}),D.set("Curvature",{desc:"Curvature Function",ctor:$n,rasterArgumentNames:["raster"]}),D.set("Local",{desc:"Local Function",ctor:gr,rasterArgumentNames:["rasters"]}),D.set("Mask",{desc:"Mask Function",ctor:wr,rasterArgumentNames:["raster"]}),D.set("NDVI",{desc:"NDVI Function",ctor:xr,rasterArgumentNames:["raster"]}),D.set("Remap",{desc:"Remap Function",ctor:Ar,rasterArgumentNames:["raster"]}),D.set("Slope",{desc:"Slope Function",ctor:$r,rasterArgumentNames:["raster"]}),D.set("Statistics",{desc:"Focal Statistics Function",ctor:jr,rasterArgumentNames:["raster"]}),D.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:Sr,rasterArgumentNames:["raster"]}),D.set("Stretch",{desc:"Stretch Function",ctor:Or,rasterArgumentNames:["raster"]}),D.set("Table",{desc:"Attribute Table Function",ctor:Gr,rasterArgumentNames:["raster"]});let jt=class extends de{get affectsPixelSize(){return!1}forwardTransform(i){return i}inverseTransform(i){return i}};c([f()],jt.prototype,"affectsPixelSize",null),c([f({json:{write:!0}})],jt.prototype,"spatialReference",void 0),jt=c([A("esri.layers.support.rasterTransforms.BaseRasterTransform")],jt);const ve=jt;var pe;let _t=pe=class extends ve{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(i){return(i=i.clone()).type==="point"?(i.x>180+this.tolerance&&(i.x-=360),i):(i.xmin>=180-this.tolerance?(i.xmax-=360,i.xmin-=360):i.xmax>180+this.tolerance&&(i.xmin=-180,i.xmax=180),i)}inverseTransform(i){return(i=i.clone()).type==="point"?(i.x<-this.tolerance&&(i.x+=360),i):(i.xmin<-this.tolerance&&(i.xmin+=360,i.xmax+=360),i)}clone(){return new pe({tolerance:this.tolerance})}};c([Z({GCSShiftXform:"gcs-shift"})],_t.prototype,"type",void 0),c([f()],_t.prototype,"tolerance",void 0),_t=pe=c([A("esri.layers.support.rasterTransforms.GCSShiftTransform")],_t);const Xr=_t;var he;let Gt=he=class extends ve{constructor(){super(...arguments),this.type="identity"}clone(){return new he}};c([Z({IdentityXform:"identity"})],Gt.prototype,"type",void 0),Gt=he=c([A("esri.layers.support.rasterTransforms.IdentityTransform")],Gt);const Hr=Gt;var fe;function me(i,t,e){const{x:s,y:o}=t;if(e<2)return{x:i[0]+s*i[2]+o*i[4],y:i[1]+s*i[3]+o*i[5]};if(e===2){const m=s*s,g=o*o,w=s*o;return{x:i[0]+s*i[2]+o*i[4]+m*i[6]+w*i[8]+g*i[10],y:i[1]+s*i[3]+o*i[5]+m*i[7]+w*i[9]+g*i[11]}}const r=s*s,a=o*o,n=s*o,u=r*s,l=r*o,p=s*a,h=o*a;return{x:i[0]+s*i[2]+o*i[4]+r*i[6]+n*i[8]+a*i[10]+u*i[12]+l*i[14]+p*i[16]+h*i[18],y:i[1]+s*i[3]+o*i[5]+r*i[7]+n*i[9]+a*i[11]+u*i[13]+l*i[15]+p*i[17]+h*i[19]}}function Le(i,t,e){const{xmin:s,ymin:o,xmax:r,ymax:a,spatialReference:n}=t;let u=[];if(e<2)u.push({x:s,y:a}),u.push({x:r,y:a}),u.push({x:s,y:o}),u.push({x:r,y:o});else{let h=10;for(let m=0;mme(i,h,e));const l=u.map(h=>h.x),p=u.map(h=>h.y);return new is({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,p),ymax:Math.max.apply(null,p),spatialReference:n})}function Jr(i){const[t,e,s,o,r,a]=i,n=s*a-r*o,u=r*o-s*a;return[(r*e-t*a)/n,(s*e-t*o)/u,a/n,o/u,-r/n,-s/u]}let X=fe=class extends ve{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(i,t){const{coeffX:e,coeffY:s}=t;if(!(e!=null&&e.length)||!(s!=null&&s.length)||e.length!==s.length)return null;const o=[];for(let r=0;r0}forwardTransform(i){if(i.type==="point"){const t=me(this.forwardCoefficients,i,this.polynomialOrder);return new Te({x:t.x,y:t.y,spatialReference:i.spatialReference})}return Le(this.forwardCoefficients,i,this.polynomialOrder)}inverseTransform(i){if(i.type==="point"){const t=me(this.inverseCoefficients,i,this.polynomialOrder);return new Te({x:t.x,y:t.y,spatialReference:i.spatialReference})}return Le(this.inverseCoefficients,i,this.polynomialOrder)}clone(){return new fe({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([f({json:{write:!0}})],X.prototype,"polynomialOrder",void 0),c([f()],X.prototype,"forwardCoefficients",void 0),c([Nt("forwardCoefficients",["coeffX","coeffY"])],X.prototype,"readForwardCoefficients",null),c([Ft("forwardCoefficients")],X.prototype,"writeForwardCoefficients",null),c([f({json:{write:!0}})],X.prototype,"inverseCoefficients",null),c([Nt("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],X.prototype,"readInverseCoefficients",null),c([Ft("inverseCoefficients")],X.prototype,"writeInverseCoefficients",null),c([f()],X.prototype,"affectsPixelSize",null),c([Z({PolynomialXform:"polynomial"})],X.prototype,"type",void 0),X=fe=c([A("esri.layers.support.rasterTransforms.PolynomialTransform")],X);const Yr=X,ns={GCSShiftXform:Xr,IdentityXform:Hr,PolynomialXform:Yr},Kr=Object.keys(ns);function vo(i){const t=i==null?void 0:i.type;return!i||Kr.includes(t)}function Ao(i){if(!(i==null?void 0:i.type))return null;const e=ns[i==null?void 0:i.type];if(e){const s=new e;return s.read(i),s}return null}export{zr as C,xo as R,vo as f,Ao as i,Xr as n,Yr as y}; diff --git a/dist/assets/utils-P5wTOmqv.js b/dist/assets/utils-P5wTOmqv.js new file mode 100644 index 0000000..cc00e9e --- /dev/null +++ b/dist/assets/utils-P5wTOmqv.js @@ -0,0 +1 @@ +import{iT as B,e4 as L,T as j,iU as A,iV as C,d4 as Y,d3 as _,d6 as Z,ar as R,gO as Q,iW as W,iX as X}from"./index-J0iiHjMT.js";import{a as H,d as J}from"./generateRendererUtils-_1jVE02H.js";const K="",tt="equal-interval",et=1,nt=5,lt=10,it=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,at=new Set(["esriFieldTypeDate","esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeOID","esriFieldTypeBigInteger"]),ot=new Set(["esriFieldTypeTimeOnly","esriFieldTypeDateOnly"]),rt=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function V(t){return t==null||typeof t=="string"&&!t?K:t}function st(t){const e=t.normalizationField!=null||t.normalizationType!=null,n=t.minValue!=null||t.maxValue!=null,l=!!t.sqlExpression&&t.supportsSQLExpression;return!e&&!n&&!l}function St(t){const e=t.returnDistinct?[...new Set(t.values)]:t.values,n=e.filter(a=>a!=null).sort(),l=n.length,i={count:l,min:n[0],max:n[l-1]};return t.supportsNullCount&&(i.nullcount=e.length-l),t.percentileParams&&(i.median=P(e,t.percentileParams)),i}function ut(t){const{values:e,useSampleStdDev:n,supportsNullCount:l}=t;let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=null,r=null,s=null,f=null,c=0;const d=t.minValue==null?-1/0:t.minValue,m=t.maxValue==null?1/0:t.maxValue;for(const u of e)Number.isFinite(u)?u>=d&&u<=m&&(o=o===null?u:o+u,i=Math.min(i,u),a=Math.max(a,u),c++):typeof u=="string"&&c++;if(c&&o!=null){r=o/c;let u=0;for(const v of e)Number.isFinite(v)&&v>=d&&v<=m&&(u+=(v-r)**2);f=n?c>1?u/(c-1):0:c>0?u/c:0,s=Math.sqrt(f)}else i=null,a=null;const h={avg:r,count:c,max:a,min:i,stddev:s,sum:o,variance:f};return l&&(h.nullcount=e.length-c),t.percentileParams&&(h.median=P(e,t.percentileParams)),h}function P(t,e){const{fieldType:n,value:l,orderBy:i,isDiscrete:a}=e,o=mt(n,i==="desc");if((t=[...t].filter(h=>h!=null).sort((h,u)=>o(h,u))).length===0)return null;if(l<=0)return t[0];if(l>=1)return t[t.length-1];const r=(t.length-1)*l,s=Math.floor(r),f=s+1,c=r%1,d=t[s],m=t[f];return f>=t.length||a||typeof d=="string"||typeof m=="string"?d:d*(1-c)+m*c}function mt(t,e){if(t){if(at.has(t))return O(e);if(ot.has(t))return E(e,!1);if(t==="esriFieldTypeTimestampOffset")return pt(e);const a=E(e,!0);if(t==="esriFieldTypeString")return a;if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID")return(o,r)=>a(G(o),G(r))}const n=e?1:-1,l=O(e),i=E(e,!0);return(a,o)=>typeof a=="number"&&typeof o=="number"?l(a,o):typeof a=="string"&&typeof o=="string"?i(a,o):n}const M=(t,e)=>t==null?e==null?0:1:e==null?-1:null,w=(t,e)=>t==null?e==null?0:-1:e==null?1:null;function ct(t){return t?M:w}const ft=(t,e)=>w(t,e)??(t===e?0:new Date(t).getTime()-new Date(e).getTime()),dt=(t,e)=>M(t,e)??(t===e?0:new Date(e).getTime()-new Date(t).getTime());function pt(t){return t?dt:ft}const ht=(t,e)=>w(t,e)??(t===e?0:tM(t,e)??(t===e?0:t{const a=n(l,i);return a??((l=l.toUpperCase())>(i=i.toUpperCase())?-1:l{const a=n(l,i);return a??((l=l.toUpperCase())<(i=i.toUpperCase())?-1:l>i?1:0)}}const yt=(t,e)=>M(t,e)??e-t,Tt=(t,e)=>w(t,e)??t-e;function O(t){return t?yt:Tt}function G(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function Ct(t,e){let n;for(n in t)rt.includes(n)&&(Number.isFinite(t[n])||(t[n]=null));return e&&["avg","stddev","variance"].forEach(l=>{t[l]!=null&&(t[l]=Math.ceil(t[l]??0))}),t}function Et(t){const e={};for(let n of t)(n==null||typeof n=="string"&&n.trim()==="")&&(n=null),e[n]==null?e[n]={count:1,data:n}:e[n].count++;return{count:e}}function k(t){return(t==null?void 0:t.type)!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function kt(t,e,n,l){const i=t.count,a=[];if(n&&e){const o=[],r=k(e[0]);for(const s of r)if(e[1]){const f=k(e[1]);for(const c of f)if(e[2]){const d=k(e[2]);for(const m of d)o.push(`${V(s)}${l}${V(c)}${l}${V(m)}`)}else o.push(`${V(s)}${l}${V(c)}`)}else o.push(s);for(const s of o)i.hasOwnProperty(s)||(i[s]={data:s,count:0})}for(const o in i){const r=i[o];a.push({value:r.data,count:r.count,label:r.label})}return{uniqueValueInfos:a}}function gt(t,e,n,l){let i=null;switch(e){case"log":t!==0&&(i=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(l)&&l!==0&&(i=t/l*100);break;case"field":Number.isFinite(n)&&n!==0&&(i=t/n);break;case"natural-log":t>0&&(i=Math.log(t));break;case"square-root":t>0&&(i=t**.5)}return i}function bt(t,e){const n=Vt({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||nt});return t=xt(t,e.minValue,e.maxValue),H({definition:n,values:t,normalizationTotal:e.normalizationTotal})}function xt(t,e,n){const l=e??-1/0,i=n??1/0;return t.filter(a=>Number.isFinite(a)&&a>=l&&a<=i)}function Vt(t){const{breakCount:e,field:n,normalizationField:l,normalizationType:i}=t,a=t.classificationMethod||tt,o=a==="standard-deviation"?t.standardDeviationInterval||et:void 0;return new J({breakCount:e,classificationField:n,classificationMethod:a,normalizationField:i==="field"?l:void 0,normalizationType:i,standardDeviationInterval:o})}function Ot(t,e){var s,f;let n=t.classBreaks;const l=n.length,i=(s=n[0])==null?void 0:s.minValue,a=(f=n[l-1])==null?void 0:f.maxValue,o=e==="standard-deviation",r=it;return n=n.map(c=>{const d=c.label,m={minValue:c.minValue,maxValue:c.maxValue,label:d};if(o&&d){const h=d.match(r),u=(h==null?void 0:h.map(v=>+v.trim()))??[];u.length===2?(m.minStdDev=u[0],m.maxStdDev=u[1],u[0]<0&&u[1]>0&&(m.hasAvg=!0)):u.length===1&&(d.includes("<")?(m.minStdDev=null,m.maxStdDev=u[0]):d.includes(">")&&(m.minStdDev=u[0],m.maxStdDev=null))}return m}),{minValue:i,maxValue:a,classBreakInfos:n,normalizationTotal:t.normalizationTotal}}function Gt(t,e){const n=Ft(t,e);if(n.min==null&&n.max==null)return{bins:[],minValue:n.min,maxValue:n.max,normalizationTotal:e.normalizationTotal};const l=n.intervals,i=n.min??0,a=n.max??0,o=l.map((r,s)=>({minValue:l[s][0],maxValue:l[s][1],count:0}));for(const r of t)if(r!=null&&r>=i&&r<=a){const s=$t(l,r);s>-1&&o[s].count++}return{bins:o,minValue:i,maxValue:a,normalizationTotal:e.normalizationTotal}}function Ft(t,e){const{field:n,classificationMethod:l,standardDeviationInterval:i,normalizationType:a,normalizationField:o,normalizationTotal:r,minValue:s,maxValue:f}=e,c=e.numBins||lt;let d=null,m=null,h=null;if((!l||l==="equal-interval")&&!a){if(s!=null&&f!=null)d=s,m=f;else{const u=ut({values:t,minValue:s,maxValue:f,useSampleStdDev:!a,supportsNullCount:st({normalizationType:a,normalizationField:o,minValue:s,maxValue:f})});d=u.min??null,m=u.max??null}h=It(d??0,m??0,c)}else{const{classBreaks:u}=bt(t,{field:n,normalizationType:a,normalizationField:o,normalizationTotal:r,classificationMethod:l,standardDeviationInterval:i,minValue:s,maxValue:f,numClasses:c});d=u[0].minValue,m=u[u.length-1].maxValue,h=u.map(v=>[v.minValue,v.maxValue])}return{min:d,max:m,intervals:h}}function $t(t,e){let n=-1;for(let l=t.length-1;l>=0;l--)if(e>=t[l][0]){n=l;break}return n}function It(t,e,n){const l=(e-t)/n,i=[];let a,o=t;for(let r=1;r<=n;r++)a=o+l,a=Number(a.toFixed(16)),i.push([o,r===n?e:a]),o=a;return i}let x=null;const Nt=/^(?([0-1][0-9])|([2][0-3])):(?[0-5][0-9])(:(?[0-5][0-9]))?([.](?\d+))?$/;function zt(t,e,n){return t.x<0?t.x+=e:t.x>n&&(t.x-=e),t}function Pt(t,e,n,l){const i=B(n)?L(n):null,a=i?Math.round((i.valid[1]-i.valid[0])/e.scale[0]):null;return t.map(o=>{const r=new j(o.geometry);return A(e,r,r,r.hasZ,r.hasM),o.geometry=i?zt(r,a??0,l[0]):r,o})}function Ut(t,e=18,n,l,i,a){const o=new Float64Array(i*a);e=Math.round(Q(e));let r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,f=0,c=0,d=0,m=0;const h=W(l,n);for(const{geometry:v,attributes:$}of t){const{x:T,y:F}=v,I=Math.max(0,T-e),N=Math.max(0,F-e),z=Math.min(a,F+e),y=Math.min(i,T+e),g=+h($);for(let p=N;ps&&(s=f),m++}}if(!m)return{mean:0,stddev:0,min:0,max:0,mid:0,count:0};const u=(s-r)/2;return{mean:c/m,stdDev:Math.sqrt((d-c*c/m)/m),min:r,max:s,mid:u,count:m}}function Dt(t){const e=Nt.exec(t);if(!e)return null;const{hh:n,mm:l,ss:i,ms:a}=e.groups;return Number(n)*C.hours+Number(l)*C.minutes+Number(i)*C.seconds+Number(a||0)}async function qt(t,e,n=!0){if(!e)return[];const{field:l,field2:i,field3:a,fieldDelimiter:o,fieldInfos:r,timeZone:s}=t,f=l&&(r==null?void 0:r.find(y=>y.name.toLowerCase()===l.toLowerCase())),c=!!f&&Y(f),d=!!f&&_(f),m=t.valueExpression,h=t.normalizationType,u=t.normalizationField,v=t.normalizationTotal,$=[],T=t.viewInfoParams;let F=null,I=null;if(m){if(!x){const{arcadeUtils:y}=await Z();x=y}x.hasGeometryOperations(m)&&await x.enableGeometryOperations(),F=x.createFunction(m),I=T?x.getViewInfo({viewingMode:T.viewingMode,scale:T.scale,spatialReference:new R(T.spatialReference)}):null}const N=t.fieldInfos,z=!(e[0]&&"declaredClass"in e[0]&&e[0].declaredClass==="esri.Graphic")&&N?{fields:N}:null;return e.forEach(y=>{const g=y.attributes;let p;if(m){const b=z?{...y,layer:z}:y,D=x.createExecContext(b,I,s);p=x.executeFunction(F,D)}else g&&(p=g[l],i?(p=`${V(p)}${o}${V(g[i])}`,a&&(p=`${p}${o}${V(g[a])}`)):typeof p=="string"&&n&&(d?p=p?new Date(p).getTime():null:c&&(p=p?Dt(p):null)));if(h&&typeof p=="number"&&isFinite(p)){const b=g&&parseFloat(g[u]);p=gt(p,h,b,v)}$.push(p)}),$}export{kt as $,gt as B,Ct as C,bt as E,Ot as P,mt as T,Gt as U,qt as b,V as c,St as d,st as f,Pt as j,Et as k,ut as p,P as v,Dt as w,Ut as x}; diff --git a/dist/assets/utils-rBsg-VY8.js b/dist/assets/utils-rBsg-VY8.js new file mode 100644 index 0000000..c369f0f --- /dev/null +++ b/dist/assets/utils-rBsg-VY8.js @@ -0,0 +1 @@ +import{bR as v,bS as I,i as h,h as S,bT as c,E as l,bU as g}from"./index-J0iiHjMT.js";import{o as m}from"./jsonContext-cWV_-jAj.js";function x(t,r,a){const e=a(t);if(!e.isValid)throw new l(`${r}:invalid-parameters`,e.errorMessage,{layer:t})}async function f(t){const{layer:r,errorNamePrefix:a,validateLayer:e}=t;await r.load(),x(r,a,e)}function u(t,r){return`Layer (title: ${t.title}, id: ${t.id}) of type '${t.declaredClass}' ${r}`}function y(t){const{item:r,itemType:a,errorNamePrefix:e,layer:o,validateItem:s}=t;if(g(r),r.type!==a)throw new l(`${e}:portal-item-wrong-type`,`Portal item type should be "${a}"`,{item:r,layer:o});if(s){const i=s(r);if(!i.isValid)throw new l(`${e}:invalid-parameters`,i.errorMessage,{layer:o})}}function N(t){const{layer:r,errorNamePrefix:a}=t,{portalItem:e}=r;if(!e)throw new l(`${a}:portal-item-not-set`,u(r,"requires the portalItem property to be set"));if(!e.loaded)throw new l(`${a}:portal-item-not-loaded`,u(r,"cannot be saved to a portal item that does not exist or is inaccessible"));y({...t,item:e})}function P(t){const{newItem:r,itemType:a}=t;let e=v.from(r);return e.id&&(e=e.clone(),e.id=null),e.type??(e.type=a),e.portal??(e.portal=I.getDefault()),y({...t,item:e}),e}function O(t,r){let a=(t.messages??[]).filter(({type:e})=>e==="error").map(({name:e,message:o,details:s})=>new l(e,o,s));if(t.blockedRelativeUrls&&(a=a.concat(t.blockedRelativeUrls.map(e=>new l("url:unsupported",`Relative url '${e}' is not supported`)))),r!=null&&r.ignoreUnsupported&&(a=a.filter(({name:e})=>e!=="layer:unsupported"&&e!=="symbol:unsupported"&&e!=="symbol-layer:unsupported"&&e!=="property:unsupported"&&e!=="url:unsupported")),a.length>0)throw new l("layer-write:unsupported","Failed to save layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:a})}async function w(t,r,a){var o;"beforeSave"in t&&typeof t.beforeSave=="function"&&await t.beforeSave();const e=t.write({},r);return await Promise.all(((o=r.resources)==null?void 0:o.pendingOperations)??[]),O(r,a),e}function $(t){h(t,S.JSAPI),t.typeKeywords&&(t.typeKeywords=t.typeKeywords.filter((r,a,e)=>e.indexOf(r)===a))}async function R(t,r,a){var o;const e=t.portal;await e.signIn(),await((o=e.user)==null?void 0:o.addItem({item:t,data:r,folder:a==null?void 0:a.folder}))}async function C(t,r){const{layer:a,createItemData:e,createJSONContext:o,saveResources:s}=t;await f(t),N(t);const i=a.portalItem,n=o?o(i):m(i),p=await w(a,n,r),d=await e({layer:a,layerJSON:p},i);return $(i),await i.update({data:d}),c(n),await(s==null?void 0:s(i,n)),i}async function D(t,r){const{layer:a,createItemData:e,createJSONContext:o,setItemProperties:s,saveResources:i}=t;await f(t);const n=P(t),p=o?o(n):m(n),d=await w(a,p,r),b=await e({layer:a,layerJSON:d},n);return await s(a,n),$(n),await R(n,b,r),a.portalItem=n,c(p),await(i==null?void 0:i(n,p)),n}export{C as I,D as b,N as d,x as l,u as m,P as u,R as v,$ as w,w as y}; diff --git a/dist/assets/utils3-_ao2jQXg.js b/dist/assets/utils3-_ao2jQXg.js new file mode 100644 index 0000000..3017e9f --- /dev/null +++ b/dist/assets/utils3-_ao2jQXg.js @@ -0,0 +1,5 @@ +import"./index-J0iiHjMT.js";/*! + * All material copyright ESRI, All Rights Reserved, unless otherwise specified. + * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details. + * v1.11.0 + */const u={container:"container",containerBorderSelected:"container--border-selected",containerBorderUnselected:"container--border-unselected",contentContainer:"content-container",contentContainerSelectable:"content-container--selectable",contentContainerHasCenterContent:"content-container--has-center-content",nestedContainer:"nested-container",nestedContainerHidden:"nested-container--hidden",content:"content",customContent:"custom-content",actionsStart:"actions-start",contentStart:"content-start",label:"label",description:"description",contentEnd:"content-end",contentBottom:"content-bottom",actionsEnd:"actions-end",selectionContainer:"selection-container",openContainer:"open-container",dragContainer:"drag-container"},m={actionsStart:"actions-start",contentStart:"content-start",content:"content",contentBottom:"content-bottom",contentEnd:"content-end",actionsEnd:"actions-end"},S=0,C={selectedMultiple:"check-circle-f",selectedSingle:"circle-f",unselected:"blank",closedLTR:"caret-right",closedRTL:"caret-left",open:"caret-down",blank:"blank",close:"x"},a="calcite-list",i="calcite-list-item-group",r="calcite-list-item";function p(n){const e=n.assignedElements({flatten:!0}),o=e.filter(t=>t==null?void 0:t.matches(i)).map(t=>Array.from(t.querySelectorAll(r))).reduce((t,c)=>[...t,...c],[]),s=e.filter(t=>t==null?void 0:t.matches(r));return[...e.filter(t=>t==null?void 0:t.matches(a)).map(t=>Array.from(t.querySelectorAll(r))).reduce((t,c)=>[...t,...c],[]),...o,...s]}function h(n){n.forEach(e=>{e.setPosition=n.indexOf(e)+1,e.setSize=n.length})}function f(n,e=!1){const o=e?"ancestor::calcite-list-item | ancestor::calcite-list-item-group":"ancestor::calcite-list-item";return document.evaluate(o,n,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength}export{u as C,C as I,S as M,m as S,p as a,f as g,h as u}; diff --git a/dist/assets/vec4f32-NvfHy9q7.js b/dist/assets/vec4f32-NvfHy9q7.js new file mode 100644 index 0000000..164f708 --- /dev/null +++ b/dist/assets/vec4f32-NvfHy9q7.js @@ -0,0 +1 @@ +function o(){return new Float32Array(4)}function y(t){const n=new Float32Array(4);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n}function r(t,n,_,s){const e=new Float32Array(4);return e[0]=t,e[1]=n,e[2]=_,e[3]=s,e}function w(t,n){return new Float32Array(t,n,4)}function u(){return o()}function c(){return r(1,1,1,1)}function i(){return r(1,0,0,0)}function a(){return r(0,1,0,0)}function f(){return r(0,0,1,0)}function l(){return r(0,0,0,1)}const N=u(),T=c(),A=i(),F=a(),I=f(),O=l();Object.freeze(Object.defineProperty({__proto__:null,ONES:T,UNIT_W:O,UNIT_X:A,UNIT_Y:F,UNIT_Z:I,ZEROS:N,clone:y,create:o,createView:w,fromValues:r,ones:c,unitW:l,unitX:i,unitY:a,unitZ:f,zeros:u},Symbol.toStringTag,{value:"Module"}));export{r,y as t}; diff --git a/dist/assets/versionUtils-4v9zIDlv.js b/dist/assets/versionUtils-4v9zIDlv.js new file mode 100644 index 0000000..e554eea --- /dev/null +++ b/dist/assets/versionUtils-4v9zIDlv.js @@ -0,0 +1 @@ +import{dv as f}from"./index-J0iiHjMT.js";const e=[];function l(d,t){if(f(d.url??""))return!0;const{wkid:o}=t;for(const r of e){if((d.version??0)>=r[0])return!0;if(typeof r[1]=="function"&&(r[1]=r[1]()),r[1].has(o))return!1}return!0}e.push([10.91,()=>{const d=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)d.add(t);for(let t=9748;t<=9749;t++)d.add(t);for(let t=20904;t<=20932;t++)d.add(t);for(let t=21004;t<=21032;t++)d.add(t);for(let t=21207;t<=21264;t++)d.add(t);for(let t=21307;t<=21364;t++)d.add(t);for(let t=23301;t<=23333;t++)d.add(t);for(let t=102759;t<=102760;t++)d.add(t);for(let t=102934;t<=102955;t++)d.add(t);return d}]),e.push([10.9,()=>{const d=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)d.add(t);for(let t=9404;t<=9407;t++)d.add(t);for(let t=9476;t<=9482;t++)d.add(t);for(let t=9487;t<=9494;t++)d.add(t);for(let t=9697;t<=9699;t++)d.add(t);return d}]),e.push([10.81,()=>{const d=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)d.add(t);for(let t=9271;t<=9273;t++)d.add(t);for(let t=9284;t<=9285;t++)d.add(t);for(let t=21453;t<=21463;t++)d.add(t);return d}]),e.push([10.8,()=>{const d=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)d.add(t);for(let t=8455;t<=8456;t++)d.add(t);for(let t=8518;t<=8529;t++)d.add(t);for(let t=8533;t<=8536;t++)d.add(t);for(let t=8538;t<=8540;t++)d.add(t);for(let t=8677;t<=8679;t++)d.add(t);for(let t=8902;t<=8903;t++)d.add(t);for(let t=8907;t<=8910;t++)d.add(t);for(let t=8949;t<=8951;t++)d.add(t);for(let t=8972;t<=8987;t++)d.add(t);for(let t=9039;t<=9040;t++)d.add(t);for(let t=9068;t<=9069;t++)d.add(t);for(let t=9140;t<=9141;t++)d.add(t);for(let t=9148;t<=9150;t++)d.add(t);for(let t=9153;t<=9159;t++)d.add(t);for(let t=9205;t<=9218;t++)d.add(t);for(let t=9221;t<=9222;t++)d.add(t);for(let t=54098;t<=54101;t++)d.add(t);return d}]),e.push([10.71,()=>{const d=new Set([6316]);for(let t=8351;t<=8353;t++)d.add(t);for(let t=9294;t<=9297;t++)d.add(t);for(let t=22619;t<=22621;t++)d.add(t);for(let t=103586;t<=103594;t++)d.add(t);return d}]),e.push([10.7,()=>{const d=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)d.add(t);for(let t=8082;t<=8083;t++)d.add(t);for(let t=8379;t<=8385;t++)d.add(t);for(let t=8836;t<=8840;t++)d.add(t);for(let t=8857;t<=8860;t++)d.add(t);for(let t=53035;t<=53037;t++)d.add(t);for(let t=54090;t<=54091;t++)d.add(t);for(let t=102498;t<=102499;t++)d.add(t);return d}]),e.push([10.61,()=>new Set([102497])]),e.push([10.6,()=>{const d=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)d.add(t);for(let t=7791;t<=7795;t++)d.add(t);for(let t=7799;t<=7801;t++)d.add(t);for(let t=7825;t<=7831;t++)d.add(t);for(let t=7877;t<=7878;t++)d.add(t);for(let t=7882;t<=7883;t++)d.add(t);for(let t=7991;t<=7992;t++)d.add(t);for(let t=8042;t<=8043;t++)d.add(t);for(let t=8058;t<=8059;t++)d.add(t);for(let t=8311;t<=8348;t++)d.add(t);for(let t=9060;t<=9067;t++)d.add(t);for(let t=102562;t<=102568;t++)d.add(t);for(let t=102799;t<=102900;t++)d.add(t);return d}]);export{l as e}; diff --git a/dist/assets/vi_VN-bEo-fMOP.js b/dist/assets/vi_VN-bEo-fMOP.js new file mode 100644 index 0000000..8ada724 --- /dev/null +++ b/dist/assets/vi_VN-bEo-fMOP.js @@ -0,0 +1 @@ +const t={_decimalSeparator:",",_thousandSeparator:".",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"sau CN",_era_bc:"Trước CN",A:"s",P:"c",AM:"SA",PM:"CH","A.M.":"SA","P.M.":"CH",January:"tháng 1",February:"tháng 2",March:"tháng 3",April:"tháng 4",May:"tháng 5",June:"tháng 6",July:"tháng 7",August:"tháng 8",September:"tháng 9",October:"tháng 10",November:"tháng 11",December:"tháng 12",Jan:"thg 1",Feb:"thg 2",Mar:"thg 3",Apr:"thg 4","May(short)":"thg 5",Jun:"thg 6",Jul:"thg 7",Aug:"thg 8",Sep:"thg 9",Oct:"thg 10",Nov:"thg 11",Dec:"thg 12",Sunday:"Chủ Nhật",Monday:"Thứ Hai",Tuesday:"Thứ Ba",Wednesday:"Thứ Tư",Thursday:"Thứ Năm",Friday:"Thứ Sáu",Saturday:"Thứ Bảy",Sun:"CN",Mon:"Th 2",Tue:"Th 3",Wed:"Th 4",Thu:"Th 5",Fri:"Th 6",Sat:"Th 7",_dateOrd:function(_){let e="th";if(_<11||_>13)switch(_%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"Thu phóng",Play:"Phát",Stop:"Dừng",Legend:"Chú giải","Press ENTER to toggle":"",Loading:"Đang tải",Home:"Trang chủ",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"In",Image:"Hình ảnh",Data:"Dữ liệu",Print:"In","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"Từ %1 đến %2","From %1":"Từ %1","To %1":"Đến %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{t as default}; diff --git a/dist/assets/vxlLayer-oRewqFuR.js b/dist/assets/vxlLayer-oRewqFuR.js new file mode 100644 index 0000000..ab7311e --- /dev/null +++ b/dist/assets/vxlLayer-oRewqFuR.js @@ -0,0 +1,5 @@ +import{cg as Xo}from"./index-J0iiHjMT.js";function Qo(G,sr){for(var Q=0;Qs[Z]})}}}return Object.freeze(Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}))}var Ae,zr,Pe,Tr={exports:{}};Tr.exports,Ae=Tr,Tr.exports,zr=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0,Pe=function(G){var sr,Q,s=(G=G||{})!==void 0?G:{};s.ready=new Promise(function(r,e){sr=r,Q=e});var Z,tr,Te,Ur=Object.assign({},s),Hr="./this.program",je=!0,Y="";function Be(r){return s.locateFile?s.locateFile(r,Y):Y+r}typeof document<"u"&&document.currentScript&&(Y=document.currentScript.src),zr&&(Y=zr),Y=Y.indexOf("blob:")!==0?Y.substr(0,Y.replace(/[?#].*/,"").lastIndexOf("/")+1):"",Z=r=>{var e=new XMLHttpRequest;return e.open("GET",r,!1),e.send(null),e.responseText},tr=(r,e,n)=>{var t=new XMLHttpRequest;t.open("GET",r,!0),t.responseType="arraybuffer",t.onload=()=>{t.status==200||t.status==0&&t.response?e(t.response):n()},t.onerror=n,t.send(null)};var cr,jr,Br=s.print||console.log.bind(console),R=s.printErr||console.warn.bind(console);Object.assign(s,Ur),Ur=null,s.arguments&&s.arguments,s.thisProgram&&(Hr=s.thisProgram),s.quit&&s.quit,s.wasmBinary&&(cr=s.wasmBinary),s.noExitRuntime,typeof WebAssembly!="object"&&U("no native wasm support detected");var Vr=!1;function Me(r,e){r||U(e)}var hr,D,P,z,or,v,k,ar,qr,J,Gr=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function ir(r,e,n){for(var t=e+n,a=e;r[a]&&!(a>=t);)++a;if(a-e>16&&r.buffer&&Gr)return Gr.decode(r.subarray(e,a));for(var i="";e>10,56320|1023&l)}}else i+=String.fromCharCode((31&u)<<6|c)}else i+=String.fromCharCode(u)}return i}function M(r,e){return r?ir(P,r,e):""}function Mr(r,e,n,t){if(!(t>0))return 0;for(var a=n,i=n+t-1,u=0;u=55296&&c<=57343&&(c=65536+((1023&c)<<10)|1023&r.charCodeAt(++u)),c<=127){if(n>=i)break;e[n++]=c}else if(c<=2047){if(n+1>=i)break;e[n++]=192|c>>6,e[n++]=128|63&c}else if(c<=65535){if(n+2>=i)break;e[n++]=224|c>>12,e[n++]=128|c>>6&63,e[n++]=128|63&c}else{if(n+3>=i)break;e[n++]=240|c>>18,e[n++]=128|c>>12&63,e[n++]=128|c>>6&63,e[n++]=128|63&c}}return e[n]=0,n-a}function Yr(r,e,n){return Mr(r,P,e,n)}function gr(r){for(var e=0,n=0;n=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&r.charCodeAt(++n)),t<=127?++e:e+=t<=2047?2:t<=65535?3:4}return e}function Xr(r){hr=r,s.HEAP8=D=new Int8Array(r),s.HEAP16=z=new Int16Array(r),s.HEAP32=v=new Int32Array(r),s.HEAPU8=P=new Uint8Array(r),s.HEAPU16=or=new Uint16Array(r),s.HEAPU32=k=new Uint32Array(r),s.HEAPF32=ar=new Float32Array(r),s.HEAPF64=qr=new Float64Array(r)}s.INITIAL_MEMORY;var Qr=[],Jr=[],Kr=[];function Ie(){if(s.preRun)for(typeof s.preRun=="function"&&(s.preRun=[s.preRun]);s.preRun.length;)Re(s.preRun.shift());Ir(Qr)}function Ne(){s.noFSInit||o.init.initialized||o.init(),o.ignorePermissions=!1,Ir(Jr)}function Le(){if(s.postRun)for(typeof s.postRun=="function"&&(s.postRun=[s.postRun]);s.postRun.length;)We(s.postRun.shift());Ir(Kr)}function Re(r){Qr.unshift(r)}function Oe(r){Jr.unshift(r)}function We(r){Kr.unshift(r)}var K=0,fr=null;function Jo(r){return r}function _r(r){K++,s.monitorRunDependencies&&s.monitorRunDependencies(K)}function lr(r){if(K--,s.monitorRunDependencies&&s.monitorRunDependencies(K),K==0&&fr){var e=fr;fr=null,e()}}function U(r){s.onAbort&&s.onAbort(r),R(r="Aborted("+r+")"),Vr=!0,r+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(r);throw Q(e),e}var O,C,H,Ze="data:application/octet-stream;base64,";function $r(r){return r.startsWith(Ze)}function re(r){try{if(r==O&&cr)return new Uint8Array(cr);if(!Te)throw"both async and sync fetching of the wasm failed"}catch(e){U(e)}}function ze(){return!cr&&je&&typeof fetch=="function"?fetch(O,{credentials:"same-origin"}).then(function(r){if(!r.ok)throw"failed to load wasm binary file at '"+O+"'";return r.arrayBuffer()}).catch(function(){return re(O)}):Promise.resolve().then(function(){return re(O)})}function Ue(){var r={a:Go};function e(i,u){var c=i.exports;s.asm=c,Xr((jr=s.asm.Za).buffer),J=s.asm.$a,Oe(s.asm._a),lr()}function n(i){e(i.instance)}function t(i){return ze().then(function(u){return WebAssembly.instantiate(u,r)}).then(function(u){return u}).then(i,function(u){R("failed to asynchronously prepare wasm: "+u),U(u)})}function a(){return cr||typeof WebAssembly.instantiateStreaming!="function"||$r(O)||typeof fetch!="function"?t(n):fetch(O,{credentials:"same-origin"}).then(function(i){return WebAssembly.instantiateStreaming(i,r).then(n,function(u){return R("wasm streaming compile failed: "+u),R("falling back to ArrayBuffer instantiation"),t(n)})})}if(_r(),s.instantiateWasm)try{return s.instantiateWasm(r,e)}catch(i){return R("Module.instantiateWasm callback failed with error: "+i),!1}return a().catch(Q),{}}function Ir(r){for(;r.length>0;)r.shift()(s)}function He(r,e){D.set(r,e)}function Ve(r,e,n,t){U("Assertion failed: "+M(r)+", at: "+[e?M(e):"unknown filename",n,t?M(t):"unknown function"])}function qe(r){return Ar(r+24)+24}function Ge(r){this.excPtr=r,this.ptr=r-24,this.set_type=function(e){k[this.ptr+4>>2]=e},this.get_type=function(){return k[this.ptr+4>>2]},this.set_destructor=function(e){k[this.ptr+8>>2]=e},this.get_destructor=function(){return k[this.ptr+8>>2]},this.set_refcount=function(e){v[this.ptr>>2]=e},this.set_caught=function(e){e=e?1:0,D[this.ptr+12>>0]=e},this.get_caught=function(){return D[this.ptr+12>>0]!=0},this.set_rethrown=function(e){e=e?1:0,D[this.ptr+13>>0]=e},this.get_rethrown=function(){return D[this.ptr+13>>0]!=0},this.init=function(e,n){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(n),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var e=v[this.ptr>>2];v[this.ptr>>2]=e+1},this.release_ref=function(){var e=v[this.ptr>>2];return v[this.ptr>>2]=e-1,e===1},this.set_adjusted_ptr=function(e){k[this.ptr+16>>2]=e},this.get_adjusted_ptr=function(){return k[this.ptr+16>>2]},this.get_exception_ptr=function(){if(De(this.get_type()))return k[this.excPtr>>2];var e=this.get_adjusted_ptr();return e!==0?e:this.excPtr}}function Ye(r,e,n){throw new Ge(r).init(e,n),r}function Xe(r){return v[Fe()>>2]=r,r}$r(O="vxlLayer.wasm")||(O=Be(O));var x={isAbs:r=>r.charAt(0)==="/",splitPath:r=>/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(r).slice(1),normalizeArray:(r,e)=>{for(var n=0,t=r.length-1;t>=0;t--){var a=r[t];a==="."?r.splice(t,1):a===".."?(r.splice(t,1),n++):n&&(r.splice(t,1),n--)}if(e)for(;n;n--)r.unshift("..");return r},normalize:r=>{var e=x.isAbs(r),n=r.substr(-1)==="/";return(r=x.normalizeArray(r.split("/").filter(t=>!!t),!e).join("/"))||e||(r="."),r&&n&&(r+="/"),(e?"/":"")+r},dirname:r=>{var e=x.splitPath(r),n=e[0],t=e[1];return n||t?(t&&(t=t.substr(0,t.length-1)),n+t):"."},basename:r=>{if(r==="/")return"/";var e=(r=(r=x.normalize(r)).replace(/\/$/,"")).lastIndexOf("/");return e===-1?r:r.substr(e+1)},join:function(){var r=Array.prototype.slice.call(arguments,0);return x.normalize(r.join("/"))},join2:(r,e)=>x.normalize(r+"/"+e)};function Qe(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var r=new Uint8Array(1);return function(){return crypto.getRandomValues(r),r[0]}}return function(){U("randomDevice")}}var V={resolve:function(){for(var r="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var t=n>=0?arguments[n]:o.cwd();if(typeof t!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";r=t+"/"+r,e=x.isAbs(t)}return(e?"/":"")+(r=x.normalizeArray(r.split("/").filter(a=>!!a),!e).join("/"))||"."},relative:(r,e)=>{function n(l){for(var h=0;h=0&&l[_]==="";_--);return h>_?[]:l.slice(h,_-h+1)}r=V.resolve(r).substr(1),e=V.resolve(e).substr(1);for(var t=n(r.split("/")),a=n(e.split("/")),i=Math.min(t.length,a.length),u=i,c=0;c0?n:gr(r)+1,a=new Array(t),i=Mr(r,a,0,a.length);return e&&(a.length=i),a}var $={ttys:[],init:function(){},shutdown:function(){},register:function(r,e){$.ttys[r]={input:[],output:[],ops:e},o.registerDevice(r,$.stream_ops)},stream_ops:{open:function(r){var e=$.ttys[r.node.rdev];if(!e)throw new o.ErrnoError(43);r.tty=e,r.seekable=!1},close:function(r){r.tty.ops.flush(r.tty)},flush:function(r){r.tty.ops.flush(r.tty)},read:function(r,e,n,t,a){if(!r.tty||!r.tty.ops.get_char)throw new o.ErrnoError(60);for(var i=0,u=0;u0&&(Br(ir(r.output,0)),r.output=[])}},default_tty1_ops:{put_char:function(r,e){e===null||e===10?(R(ir(r.output,0)),r.output=[]):e!=0&&r.output.push(e)},flush:function(r){r.output&&r.output.length>0&&(R(ir(r.output,0)),r.output=[])}}};function ee(r){U()}var y={ops_table:null,mount:function(r){return y.createNode(null,"/",16895,0)},createNode:function(r,e,n,t){if(o.isBlkdev(n)||o.isFIFO(n))throw new o.ErrnoError(63);y.ops_table||(y.ops_table={dir:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr,lookup:y.node_ops.lookup,mknod:y.node_ops.mknod,rename:y.node_ops.rename,unlink:y.node_ops.unlink,rmdir:y.node_ops.rmdir,readdir:y.node_ops.readdir,symlink:y.node_ops.symlink},stream:{llseek:y.stream_ops.llseek}},file:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr},stream:{llseek:y.stream_ops.llseek,read:y.stream_ops.read,write:y.stream_ops.write,allocate:y.stream_ops.allocate,mmap:y.stream_ops.mmap,msync:y.stream_ops.msync}},link:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr,readlink:y.node_ops.readlink},stream:{}},chrdev:{node:{getattr:y.node_ops.getattr,setattr:y.node_ops.setattr},stream:o.chrdev_stream_ops}});var a=o.createNode(r,e,n,t);return o.isDir(a.mode)?(a.node_ops=y.ops_table.dir.node,a.stream_ops=y.ops_table.dir.stream,a.contents={}):o.isFile(a.mode)?(a.node_ops=y.ops_table.file.node,a.stream_ops=y.ops_table.file.stream,a.usedBytes=0,a.contents=null):o.isLink(a.mode)?(a.node_ops=y.ops_table.link.node,a.stream_ops=y.ops_table.link.stream):o.isChrdev(a.mode)&&(a.node_ops=y.ops_table.chrdev.node,a.stream_ops=y.ops_table.chrdev.stream),a.timestamp=Date.now(),r&&(r.contents[e]=a,r.timestamp=a.timestamp),a},getFileDataAsTypedArray:function(r){return r.contents?r.contents.subarray?r.contents.subarray(0,r.usedBytes):new Uint8Array(r.contents):new Uint8Array(0)},expandFileStorage:function(r,e){var n=r.contents?r.contents.length:0;if(!(n>=e)){var t=1048576;e=Math.max(e,n*(n>>0),n!=0&&(e=Math.max(e,256));var a=r.contents;r.contents=new Uint8Array(e),r.usedBytes>0&&r.contents.set(a.subarray(0,r.usedBytes),0)}},resizeFileStorage:function(r,e){if(r.usedBytes!=e)if(e==0)r.contents=null,r.usedBytes=0;else{var n=r.contents;r.contents=new Uint8Array(e),n&&r.contents.set(n.subarray(0,Math.min(e,r.usedBytes))),r.usedBytes=e}},node_ops:{getattr:function(r){var e={};return e.dev=o.isChrdev(r.mode)?r.id:1,e.ino=r.id,e.mode=r.mode,e.nlink=1,e.uid=0,e.gid=0,e.rdev=r.rdev,o.isDir(r.mode)?e.size=4096:o.isFile(r.mode)?e.size=r.usedBytes:o.isLink(r.mode)?e.size=r.link.length:e.size=0,e.atime=new Date(r.timestamp),e.mtime=new Date(r.timestamp),e.ctime=new Date(r.timestamp),e.blksize=4096,e.blocks=Math.ceil(e.size/e.blksize),e},setattr:function(r,e){e.mode!==void 0&&(r.mode=e.mode),e.timestamp!==void 0&&(r.timestamp=e.timestamp),e.size!==void 0&&y.resizeFileStorage(r,e.size)},lookup:function(r,e){throw o.genericErrors[44]},mknod:function(r,e,n,t){return y.createNode(r,e,n,t)},rename:function(r,e,n){if(o.isDir(r.mode)){var t;try{t=o.lookupNode(e,n)}catch{}if(t)for(var a in t.contents)throw new o.ErrnoError(55)}delete r.parent.contents[r.name],r.parent.timestamp=Date.now(),r.name=n,e.contents[n]=r,e.timestamp=r.parent.timestamp,r.parent=e},unlink:function(r,e){delete r.contents[e],r.timestamp=Date.now()},rmdir:function(r,e){var n=o.lookupNode(r,e);for(var t in n.contents)throw new o.ErrnoError(55);delete r.contents[e],r.timestamp=Date.now()},readdir:function(r){var e=[".",".."];for(var n in r.contents)r.contents.hasOwnProperty(n)&&e.push(n);return e},symlink:function(r,e,n){var t=y.createNode(r,e,41471,0);return t.link=n,t},readlink:function(r){if(!o.isLink(r.mode))throw new o.ErrnoError(28);return r.link}},stream_ops:{read:function(r,e,n,t,a){var i=r.node.contents;if(a>=r.node.usedBytes)return 0;var u=Math.min(r.node.usedBytes-a,t);if(u>8&&i.subarray)e.set(i.subarray(a,a+u),n);else for(var c=0;c0||n+e{if(!(r=V.resolve(o.cwd(),r)))return{path:"",node:null};var n={follow_mount:!0,recurse_count:0};if((e=Object.assign(n,e)).recurse_count>8)throw new o.ErrnoError(32);for(var t=x.normalizeArray(r.split("/").filter(h=>!!h),!1),a=o.root,i="/",u=0;u40)throw new o.ErrnoError(32)}}return{path:i,node:a}},getPath:r=>{for(var e;;){if(o.isRoot(r)){var n=r.mount.mountpoint;return e?n[n.length-1]!=="/"?n+"/"+e:n+e:n}e=e?r.name+"/"+e:r.name,r=r.parent}},hashName:(r,e)=>{for(var n=0,t=0;t>>0)%o.nameTable.length},hashAddNode:r=>{var e=o.hashName(r.parent.id,r.name);r.name_next=o.nameTable[e],o.nameTable[e]=r},hashRemoveNode:r=>{var e=o.hashName(r.parent.id,r.name);if(o.nameTable[e]===r)o.nameTable[e]=r.name_next;else for(var n=o.nameTable[e];n;){if(n.name_next===r){n.name_next=r.name_next;break}n=n.name_next}},lookupNode:(r,e)=>{var n=o.mayLookup(r);if(n)throw new o.ErrnoError(n,r);for(var t=o.hashName(r.id,e),a=o.nameTable[t];a;a=a.name_next){var i=a.name;if(a.parent.id===r.id&&i===e)return a}return o.lookup(r,e)},createNode:(r,e,n,t)=>{var a=new o.FSNode(r,e,n,t);return o.hashAddNode(a),a},destroyNode:r=>{o.hashRemoveNode(r)},isRoot:r=>r===r.parent,isMountpoint:r=>!!r.mounted,isFile:r=>(61440&r)==32768,isDir:r=>(61440&r)==16384,isLink:r=>(61440&r)==40960,isChrdev:r=>(61440&r)==8192,isBlkdev:r=>(61440&r)==24576,isFIFO:r=>(61440&r)==4096,isSocket:r=>(49152&r)==49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:r=>{var e=o.flagModes[r];if(e===void 0)throw new Error("Unknown file open mode: "+r);return e},flagsToPermissionString:r=>{var e=["r","w","rw"][3&r];return 512&r&&(e+="w"),e},nodePermissions:(r,e)=>o.ignorePermissions||(!e.includes("r")||292&r.mode)&&(!e.includes("w")||146&r.mode)&&(!e.includes("x")||73&r.mode)?0:2,mayLookup:r=>{var e=o.nodePermissions(r,"x");return e||(r.node_ops.lookup?0:2)},mayCreate:(r,e)=>{try{return o.lookupNode(r,e),20}catch{}return o.nodePermissions(r,"wx")},mayDelete:(r,e,n)=>{var t;try{t=o.lookupNode(r,e)}catch(i){return i.errno}var a=o.nodePermissions(r,"wx");if(a)return a;if(n){if(!o.isDir(t.mode))return 54;if(o.isRoot(t)||o.getPath(t)===o.cwd())return 10}else if(o.isDir(t.mode))return 31;return 0},mayOpen:(r,e)=>r?o.isLink(r.mode)?32:o.isDir(r.mode)&&(o.flagsToPermissionString(e)!=="r"||512&e)?31:o.nodePermissions(r,o.flagsToPermissionString(e)):44,MAX_OPEN_FDS:4096,nextfd:(r=0,e=o.MAX_OPEN_FDS)=>{for(var n=r;n<=e;n++)if(!o.streams[n])return n;throw new o.ErrnoError(33)},getStream:r=>o.streams[r],createStream:(r,e,n)=>{o.FSStream||(o.FSStream=function(){this.shared={}},o.FSStream.prototype={},Object.defineProperties(o.FSStream.prototype,{object:{get:function(){return this.node},set:function(a){this.node=a}},isRead:{get:function(){return(2097155&this.flags)!=1}},isWrite:{get:function(){return(2097155&this.flags)!=0}},isAppend:{get:function(){return 1024&this.flags}},flags:{get:function(){return this.shared.flags},set:function(a){this.shared.flags=a}},position:{get:function(){return this.shared.position},set:function(a){this.shared.position=a}}})),r=Object.assign(new o.FSStream,r);var t=o.nextfd(e,n);return r.fd=t,o.streams[t]=r,r},closeStream:r=>{o.streams[r]=null},chrdev_stream_ops:{open:r=>{var e=o.getDevice(r.node.rdev);r.stream_ops=e.stream_ops,r.stream_ops.open&&r.stream_ops.open(r)},llseek:()=>{throw new o.ErrnoError(70)}},major:r=>r>>8,minor:r=>255&r,makedev:(r,e)=>r<<8|e,registerDevice:(r,e)=>{o.devices[r]={stream_ops:e}},getDevice:r=>o.devices[r],getMounts:r=>{for(var e=[],n=[r];n.length;){var t=n.pop();e.push(t),n.push.apply(n,t.mounts)}return e},syncfs:(r,e)=>{typeof r=="function"&&(e=r,r=!1),o.syncFSRequests++,o.syncFSRequests>1&&R("warning: "+o.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var n=o.getMounts(o.root.mount),t=0;function a(u){return o.syncFSRequests--,e(u)}function i(u){if(u)return i.errored?void 0:(i.errored=!0,a(u));++t>=n.length&&a(null)}n.forEach(u=>{if(!u.type.syncfs)return i(null);u.type.syncfs(u,r,i)})},mount:(r,e,n)=>{var t,a=n==="/",i=!n;if(a&&o.root)throw new o.ErrnoError(10);if(!a&&!i){var u=o.lookupPath(n,{follow_mount:!1});if(n=u.path,t=u.node,o.isMountpoint(t))throw new o.ErrnoError(10);if(!o.isDir(t.mode))throw new o.ErrnoError(54)}var c={type:r,opts:e,mountpoint:n,mounts:[]},f=r.mount(c);return f.mount=c,c.root=f,a?o.root=f:t&&(t.mounted=c,t.mount&&t.mount.mounts.push(c)),f},unmount:r=>{var e=o.lookupPath(r,{follow_mount:!1});if(!o.isMountpoint(e.node))throw new o.ErrnoError(28);var n=e.node,t=n.mounted,a=o.getMounts(t);Object.keys(o.nameTable).forEach(u=>{for(var c=o.nameTable[u];c;){var f=c.name_next;a.includes(c.mount)&&o.destroyNode(c),c=f}}),n.mounted=null;var i=n.mount.mounts.indexOf(t);n.mount.mounts.splice(i,1)},lookup:(r,e)=>r.node_ops.lookup(r,e),mknod:(r,e,n)=>{var t=o.lookupPath(r,{parent:!0}).node,a=x.basename(r);if(!a||a==="."||a==="..")throw new o.ErrnoError(28);var i=o.mayCreate(t,a);if(i)throw new o.ErrnoError(i);if(!t.node_ops.mknod)throw new o.ErrnoError(63);return t.node_ops.mknod(t,a,e,n)},create:(r,e)=>(e=e!==void 0?e:438,e&=4095,e|=32768,o.mknod(r,e,0)),mkdir:(r,e)=>(e=e!==void 0?e:511,e&=1023,e|=16384,o.mknod(r,e,0)),mkdirTree:(r,e)=>{for(var n=r.split("/"),t="",a=0;a(n===void 0&&(n=e,e=438),e|=8192,o.mknod(r,e,n)),symlink:(r,e)=>{if(!V.resolve(r))throw new o.ErrnoError(44);var n=o.lookupPath(e,{parent:!0}).node;if(!n)throw new o.ErrnoError(44);var t=x.basename(e),a=o.mayCreate(n,t);if(a)throw new o.ErrnoError(a);if(!n.node_ops.symlink)throw new o.ErrnoError(63);return n.node_ops.symlink(n,t,r)},rename:(r,e)=>{var n,t,a=x.dirname(r),i=x.dirname(e),u=x.basename(r),c=x.basename(e);if(n=o.lookupPath(r,{parent:!0}).node,t=o.lookupPath(e,{parent:!0}).node,!n||!t)throw new o.ErrnoError(44);if(n.mount!==t.mount)throw new o.ErrnoError(75);var f,l=o.lookupNode(n,u),h=V.relative(r,i);if(h.charAt(0)!==".")throw new o.ErrnoError(28);if((h=V.relative(e,a)).charAt(0)!==".")throw new o.ErrnoError(55);try{f=o.lookupNode(t,c)}catch{}if(l!==f){var _=o.isDir(l.mode),g=o.mayDelete(n,u,_);if(g)throw new o.ErrnoError(g);if(g=f?o.mayDelete(t,c,_):o.mayCreate(t,c))throw new o.ErrnoError(g);if(!n.node_ops.rename)throw new o.ErrnoError(63);if(o.isMountpoint(l)||f&&o.isMountpoint(f))throw new o.ErrnoError(10);if(t!==n&&(g=o.nodePermissions(n,"w")))throw new o.ErrnoError(g);o.hashRemoveNode(l);try{n.node_ops.rename(l,t,c)}catch(b){throw b}finally{o.hashAddNode(l)}}},rmdir:r=>{var e=o.lookupPath(r,{parent:!0}).node,n=x.basename(r),t=o.lookupNode(e,n),a=o.mayDelete(e,n,!0);if(a)throw new o.ErrnoError(a);if(!e.node_ops.rmdir)throw new o.ErrnoError(63);if(o.isMountpoint(t))throw new o.ErrnoError(10);e.node_ops.rmdir(e,n),o.destroyNode(t)},readdir:r=>{var e=o.lookupPath(r,{follow:!0}).node;if(!e.node_ops.readdir)throw new o.ErrnoError(54);return e.node_ops.readdir(e)},unlink:r=>{var e=o.lookupPath(r,{parent:!0}).node;if(!e)throw new o.ErrnoError(44);var n=x.basename(r),t=o.lookupNode(e,n),a=o.mayDelete(e,n,!1);if(a)throw new o.ErrnoError(a);if(!e.node_ops.unlink)throw new o.ErrnoError(63);if(o.isMountpoint(t))throw new o.ErrnoError(10);e.node_ops.unlink(e,n),o.destroyNode(t)},readlink:r=>{var e=o.lookupPath(r).node;if(!e)throw new o.ErrnoError(44);if(!e.node_ops.readlink)throw new o.ErrnoError(28);return V.resolve(o.getPath(e.parent),e.node_ops.readlink(e))},stat:(r,e)=>{var n=o.lookupPath(r,{follow:!e}).node;if(!n)throw new o.ErrnoError(44);if(!n.node_ops.getattr)throw new o.ErrnoError(63);return n.node_ops.getattr(n)},lstat:r=>o.stat(r,!0),chmod:(r,e,n)=>{var t;if(!(t=typeof r=="string"?o.lookupPath(r,{follow:!n}).node:r).node_ops.setattr)throw new o.ErrnoError(63);t.node_ops.setattr(t,{mode:4095&e|-4096&t.mode,timestamp:Date.now()})},lchmod:(r,e)=>{o.chmod(r,e,!0)},fchmod:(r,e)=>{var n=o.getStream(r);if(!n)throw new o.ErrnoError(8);o.chmod(n.node,e)},chown:(r,e,n,t)=>{var a;if(!(a=typeof r=="string"?o.lookupPath(r,{follow:!t}).node:r).node_ops.setattr)throw new o.ErrnoError(63);a.node_ops.setattr(a,{timestamp:Date.now()})},lchown:(r,e,n)=>{o.chown(r,e,n,!0)},fchown:(r,e,n)=>{var t=o.getStream(r);if(!t)throw new o.ErrnoError(8);o.chown(t.node,e,n)},truncate:(r,e)=>{if(e<0)throw new o.ErrnoError(28);var n;if(!(n=typeof r=="string"?o.lookupPath(r,{follow:!0}).node:r).node_ops.setattr)throw new o.ErrnoError(63);if(o.isDir(n.mode))throw new o.ErrnoError(31);if(!o.isFile(n.mode))throw new o.ErrnoError(28);var t=o.nodePermissions(n,"w");if(t)throw new o.ErrnoError(t);n.node_ops.setattr(n,{size:e,timestamp:Date.now()})},ftruncate:(r,e)=>{var n=o.getStream(r);if(!n)throw new o.ErrnoError(8);if(!(2097155&n.flags))throw new o.ErrnoError(28);o.truncate(n.node,e)},utime:(r,e,n)=>{var t=o.lookupPath(r,{follow:!0}).node;t.node_ops.setattr(t,{timestamp:Math.max(e,n)})},open:(r,e,n)=>{if(r==="")throw new o.ErrnoError(44);var t;if(n=n===void 0?438:n,n=64&(e=typeof e=="string"?o.modeStringToFlags(e):e)?4095&n|32768:0,typeof r=="object")t=r;else{r=x.normalize(r);try{t=o.lookupPath(r,{follow:!(131072&e)}).node}catch{}}var a=!1;if(64&e)if(t){if(128&e)throw new o.ErrnoError(20)}else t=o.mknod(r,n,0),a=!0;if(!t)throw new o.ErrnoError(44);if(o.isChrdev(t.mode)&&(e&=-513),65536&e&&!o.isDir(t.mode))throw new o.ErrnoError(54);if(!a){var i=o.mayOpen(t,e);if(i)throw new o.ErrnoError(i)}512&e&&!a&&o.truncate(t,0),e&=-131713;var u=o.createStream({node:t,path:o.getPath(t),flags:e,seekable:!0,position:0,stream_ops:t.stream_ops,ungotten:[],error:!1});return u.stream_ops.open&&u.stream_ops.open(u),!s.logReadFiles||1&e||(o.readFiles||(o.readFiles={}),r in o.readFiles||(o.readFiles[r]=1)),u},close:r=>{if(o.isClosed(r))throw new o.ErrnoError(8);r.getdents&&(r.getdents=null);try{r.stream_ops.close&&r.stream_ops.close(r)}catch(e){throw e}finally{o.closeStream(r.fd)}r.fd=null},isClosed:r=>r.fd===null,llseek:(r,e,n)=>{if(o.isClosed(r))throw new o.ErrnoError(8);if(!r.seekable||!r.stream_ops.llseek)throw new o.ErrnoError(70);if(n!=0&&n!=1&&n!=2)throw new o.ErrnoError(28);return r.position=r.stream_ops.llseek(r,e,n),r.ungotten=[],r.position},read:(r,e,n,t,a)=>{if(t<0||a<0)throw new o.ErrnoError(28);if(o.isClosed(r))throw new o.ErrnoError(8);if((2097155&r.flags)==1)throw new o.ErrnoError(8);if(o.isDir(r.node.mode))throw new o.ErrnoError(31);if(!r.stream_ops.read)throw new o.ErrnoError(28);var i=a!==void 0;if(i){if(!r.seekable)throw new o.ErrnoError(70)}else a=r.position;var u=r.stream_ops.read(r,e,n,t,a);return i||(r.position+=u),u},write:(r,e,n,t,a,i)=>{if(t<0||a<0)throw new o.ErrnoError(28);if(o.isClosed(r))throw new o.ErrnoError(8);if(!(2097155&r.flags))throw new o.ErrnoError(8);if(o.isDir(r.node.mode))throw new o.ErrnoError(31);if(!r.stream_ops.write)throw new o.ErrnoError(28);r.seekable&&1024&r.flags&&o.llseek(r,0,2);var u=a!==void 0;if(u){if(!r.seekable)throw new o.ErrnoError(70)}else a=r.position;var c=r.stream_ops.write(r,e,n,t,a,i);return u||(r.position+=c),c},allocate:(r,e,n)=>{if(o.isClosed(r))throw new o.ErrnoError(8);if(e<0||n<=0)throw new o.ErrnoError(28);if(!(2097155&r.flags))throw new o.ErrnoError(8);if(!o.isFile(r.node.mode)&&!o.isDir(r.node.mode))throw new o.ErrnoError(43);if(!r.stream_ops.allocate)throw new o.ErrnoError(138);r.stream_ops.allocate(r,e,n)},mmap:(r,e,n,t,a)=>{if(2&t&&!(2&a)&&(2097155&r.flags)!=2)throw new o.ErrnoError(2);if((2097155&r.flags)==1)throw new o.ErrnoError(2);if(!r.stream_ops.mmap)throw new o.ErrnoError(43);return r.stream_ops.mmap(r,e,n,t,a)},msync:(r,e,n,t,a)=>r&&r.stream_ops.msync?r.stream_ops.msync(r,e,n,t,a):0,munmap:r=>0,ioctl:(r,e,n)=>{if(!r.stream_ops.ioctl)throw new o.ErrnoError(59);return r.stream_ops.ioctl(r,e,n)},readFile:(r,e={})=>{if(e.flags=e.flags||0,e.encoding=e.encoding||"binary",e.encoding!=="utf8"&&e.encoding!=="binary")throw new Error('Invalid encoding type "'+e.encoding+'"');var n,t=o.open(r,e.flags),a=o.stat(r).size,i=new Uint8Array(a);return o.read(t,i,0,a,0),e.encoding==="utf8"?n=ir(i,0):e.encoding==="binary"&&(n=i),o.close(t),n},writeFile:(r,e,n={})=>{n.flags=n.flags||577;var t=o.open(r,n.flags,n.mode);if(typeof e=="string"){var a=new Uint8Array(gr(e)+1),i=Mr(e,a,0,a.length);o.write(t,a,0,i,void 0,n.canOwn)}else{if(!ArrayBuffer.isView(e))throw new Error("Unsupported data type");o.write(t,e,0,e.byteLength,void 0,n.canOwn)}o.close(t)},cwd:()=>o.currentPath,chdir:r=>{var e=o.lookupPath(r,{follow:!0});if(e.node===null)throw new o.ErrnoError(44);if(!o.isDir(e.node.mode))throw new o.ErrnoError(54);var n=o.nodePermissions(e.node,"x");if(n)throw new o.ErrnoError(n);o.currentPath=e.path},createDefaultDirectories:()=>{o.mkdir("/tmp"),o.mkdir("/home"),o.mkdir("/home/web_user")},createDefaultDevices:()=>{o.mkdir("/dev"),o.registerDevice(o.makedev(1,3),{read:()=>0,write:(e,n,t,a,i)=>a}),o.mkdev("/dev/null",o.makedev(1,3)),$.register(o.makedev(5,0),$.default_tty_ops),$.register(o.makedev(6,0),$.default_tty1_ops),o.mkdev("/dev/tty",o.makedev(5,0)),o.mkdev("/dev/tty1",o.makedev(6,0));var r=Qe();o.createDevice("/dev","random",r),o.createDevice("/dev","urandom",r),o.mkdir("/dev/shm"),o.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{o.mkdir("/proc");var r=o.mkdir("/proc/self");o.mkdir("/proc/self/fd"),o.mount({mount:()=>{var e=o.createNode(r,"fd",16895,73);return e.node_ops={lookup:(n,t)=>{var a=+t,i=o.getStream(a);if(!i)throw new o.ErrnoError(8);var u={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path}};return u.parent=u,u}},e}},{},"/proc/self/fd")},createStandardStreams:()=>{s.stdin?o.createDevice("/dev","stdin",s.stdin):o.symlink("/dev/tty","/dev/stdin"),s.stdout?o.createDevice("/dev","stdout",null,s.stdout):o.symlink("/dev/tty","/dev/stdout"),s.stderr?o.createDevice("/dev","stderr",null,s.stderr):o.symlink("/dev/tty1","/dev/stderr"),o.open("/dev/stdin",0),o.open("/dev/stdout",1),o.open("/dev/stderr",1)},ensureErrnoError:()=>{o.ErrnoError||(o.ErrnoError=function(r,e){this.node=e,this.setErrno=function(n){this.errno=n},this.setErrno(r),this.message="FS error"},o.ErrnoError.prototype=new Error,o.ErrnoError.prototype.constructor=o.ErrnoError,[44].forEach(r=>{o.genericErrors[r]=new o.ErrnoError(r),o.genericErrors[r].stack=""}))},staticInit:()=>{o.ensureErrnoError(),o.nameTable=new Array(4096),o.mount(y,{},"/"),o.createDefaultDirectories(),o.createDefaultDevices(),o.createSpecialDirectories(),o.filesystems={MEMFS:y}},init:(r,e,n)=>{o.init.initialized=!0,o.ensureErrnoError(),s.stdin=r||s.stdin,s.stdout=e||s.stdout,s.stderr=n||s.stderr,o.createStandardStreams()},quit:()=>{o.init.initialized=!1;for(var r=0;r{var n=0;return r&&(n|=365),e&&(n|=146),n},findObject:(r,e)=>{var n=o.analyzePath(r,e);return n.exists?n.object:null},analyzePath:(r,e)=>{try{r=(t=o.lookupPath(r,{follow:!e})).path}catch{}var n={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=o.lookupPath(r,{parent:!0});n.parentExists=!0,n.parentPath=t.path,n.parentObject=t.node,n.name=x.basename(r),t=o.lookupPath(r,{follow:!e}),n.exists=!0,n.path=t.path,n.object=t.node,n.name=t.node.name,n.isRoot=t.path==="/"}catch(a){n.error=a.errno}return n},createPath:(r,e,n,t)=>{r=typeof r=="string"?r:o.getPath(r);for(var a=e.split("/").reverse();a.length;){var i=a.pop();if(i){var u=x.join2(r,i);try{o.mkdir(u)}catch{}r=u}}return u},createFile:(r,e,n,t,a)=>{var i=x.join2(typeof r=="string"?r:o.getPath(r),e),u=o.getMode(t,a);return o.create(i,u)},createDataFile:(r,e,n,t,a,i)=>{var u=e;r&&(r=typeof r=="string"?r:o.getPath(r),u=e?x.join2(r,e):r);var c=o.getMode(t,a),f=o.create(u,c);if(n){if(typeof n=="string"){for(var l=new Array(n.length),h=0,_=n.length;h<_;++h)l[h]=n.charCodeAt(h);n=l}o.chmod(f,146|c);var g=o.open(f,577);o.write(g,n,0,n.length,0,i),o.close(g),o.chmod(f,c)}return f},createDevice:(r,e,n,t)=>{var a=x.join2(typeof r=="string"?r:o.getPath(r),e),i=o.getMode(!!n,!!t);o.createDevice.major||(o.createDevice.major=64);var u=o.makedev(o.createDevice.major++,0);return o.registerDevice(u,{open:c=>{c.seekable=!1},close:c=>{t&&t.buffer&&t.buffer.length&&t(10)},read:(c,f,l,h,_)=>{for(var g=0,b=0;b{for(var g=0;g{if(r.isDevice||r.isFolder||r.link||r.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!Z)throw new Error("Cannot load without read() or XMLHttpRequest.");try{r.contents=Nr(Z(r.url),!0),r.usedBytes=r.contents.length}catch{throw new o.ErrnoError(29)}},createLazyFile:(r,e,n,t,a)=>{if(typeof XMLHttpRequest<"u")throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var i={isDevice:!1,url:n},u=o.createFile(r,e,i,t,a);i.contents?u.contents=i.contents:i.url&&(u.contents=null,u.url=i.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var c={};function f(l,h,_,g,b){var F=l.node.contents;if(b>=F.length)return 0;var A=Math.min(F.length-b,g);if(F.slice)for(var T=0;T{var h=u.stream_ops[l];c[l]=function(){return o.forceLoadFile(u),h.apply(null,arguments)}}),c.read=(l,h,_,g,b)=>(o.forceLoadFile(u),f(l,h,_,g,b)),c.mmap=(l,h,_,g,b)=>{o.forceLoadFile(u);var F=ee();if(!F)throw new o.ErrnoError(48);return f(l,D,F,h,_),{ptr:F,allocated:!0}},u.stream_ops=c,u},createPreloadedFile:(r,e,n,t,a,i,u,c,f,l)=>{var h=e?V.resolve(x.join2(r,e)):r;function _(g){function b(F){l&&l(),c||o.createDataFile(r,e,F,t,a,f),i&&i(),lr()}Browser.handledByPreloadPlugin(g,h,b,()=>{u&&u(),lr()})||b(g)}_r(),typeof n=="string"?Je(n,g=>_(g),u):_(n)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(r,e,n)=>{e=e||(()=>{}),n=n||(()=>{});var t=o.indexedDB();try{var a=t.open(o.DB_NAME(),o.DB_VERSION)}catch(i){return n(i)}a.onupgradeneeded=()=>{Br("creating db"),a.result.createObjectStore(o.DB_STORE_NAME)},a.onsuccess=()=>{var i=a.result.transaction([o.DB_STORE_NAME],"readwrite"),u=i.objectStore(o.DB_STORE_NAME),c=0,f=0,l=r.length;function h(){f==0?e():n()}r.forEach(_=>{var g=u.put(o.analyzePath(_).object.contents,_);g.onsuccess=()=>{++c+f==l&&h()},g.onerror=()=>{f++,c+f==l&&h()}}),i.onerror=n},a.onerror=n},loadFilesFromDB:(r,e,n)=>{e=e||(()=>{}),n=n||(()=>{});var t=o.indexedDB();try{var a=t.open(o.DB_NAME(),o.DB_VERSION)}catch(i){return n(i)}a.onupgradeneeded=n,a.onsuccess=()=>{var i=a.result;try{var u=i.transaction([o.DB_STORE_NAME],"readonly")}catch(g){return void n(g)}var c=u.objectStore(o.DB_STORE_NAME),f=0,l=0,h=r.length;function _(){l==0?e():n()}r.forEach(g=>{var b=c.get(g);b.onsuccess=()=>{o.analyzePath(g).exists&&o.unlink(g),o.createDataFile(x.dirname(g),x.basename(g),b.result,!0,!0,!0),++f+l==h&&_()},b.onerror=()=>{l++,f+l==h&&_()}}),u.onerror=n},a.onerror=n}},S={DEFAULT_POLLMASK:5,calculateAt:function(r,e,n){if(x.isAbs(e))return e;var t;if(r===-100)t=o.cwd();else{var a=o.getStream(r);if(!a)throw new o.ErrnoError(8);t=a.path}if(e.length==0){if(!n)throw new o.ErrnoError(44);return t}return x.join2(t,e)},doStat:function(r,e,n){try{var t=r(e)}catch(a){if(a&&a.node&&x.normalize(e)!==x.normalize(o.getPath(a.node)))return-54;throw a}return v[n>>2]=t.dev,v[n+4>>2]=0,v[n+8>>2]=t.ino,v[n+12>>2]=t.mode,v[n+16>>2]=t.nlink,v[n+20>>2]=t.uid,v[n+24>>2]=t.gid,v[n+28>>2]=t.rdev,v[n+32>>2]=0,H=[t.size>>>0,(C=t.size,+Math.abs(C)>=1?C>0?(0|Math.min(+Math.floor(C/4294967296),4294967295))>>>0:~~+Math.ceil((C-+(~~C>>>0))/4294967296)>>>0:0)],v[n+40>>2]=H[0],v[n+44>>2]=H[1],v[n+48>>2]=4096,v[n+52>>2]=t.blocks,v[n+56>>2]=t.atime.getTime()/1e3|0,v[n+64>>2]=0,v[n+72>>2]=t.mtime.getTime()/1e3|0,v[n+80>>2]=0,v[n+88>>2]=t.ctime.getTime()/1e3|0,v[n+96>>2]=0,H=[t.ino>>>0,(C=t.ino,+Math.abs(C)>=1?C>0?(0|Math.min(+Math.floor(C/4294967296),4294967295))>>>0:~~+Math.ceil((C-+(~~C>>>0))/4294967296)>>>0:0)],v[n+104>>2]=H[0],v[n+108>>2]=H[1],0},doMsync:function(r,e,n,t,a){var i=P.slice(r,r+n);o.msync(e,i,a,n,t)},varargs:void 0,get:function(){return S.varargs+=4,v[S.varargs-4>>2]},getStr:function(r){return M(r)},getStreamFromFD:function(r){var e=o.getStream(r);if(!e)throw new o.ErrnoError(8);return e}};function Ke(r,e,n){S.varargs=n;try{var t=S.getStreamFromFD(r);switch(e){case 0:return(a=S.get())<0?-28:o.createStream(t,a).fd;case 1:case 2:case 6:case 7:return 0;case 3:return t.flags;case 4:var a=S.get();return t.flags|=a,0;case 5:return a=S.get(),z[a+0>>1]=2,0;case 16:case 8:default:return-28;case 9:return Xe(28),-1}}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return-i.errno}}function $e(r,e,n){S.varargs=n;try{var t=S.getStreamFromFD(r);switch(e){case 21509:case 21505:case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:case 21523:case 21524:return t.tty?0:-59;case 21519:if(!t.tty)return-59;var a=S.get();return v[a>>2]=0,0;case 21520:return t.tty?-28:-59;case 21531:return a=S.get(),o.ioctl(t,e,a);default:U("bad ioctl syscall "+e)}}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return-i.errno}}function rn(r,e,n,t){S.varargs=t;try{e=S.getStr(e),e=S.calculateAt(r,e);var a=t?S.get():0;return o.open(e,n,a).fd}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return-i.errno}}var yr={};function ne(r){for(;r.length;){var e=r.pop();r.pop()(e)}}function wr(r){return this.fromWireType(v[r>>2])}var ur={},rr={},Er={},en=48,nn=57;function tn(r){if(r===void 0)return"_unknown";var e=(r=r.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return e>=en&&e<=nn?"_"+r:r}function te(r,e){return r=tn(r),function(){return e.apply(this,arguments)}}function Lr(r,e){var n=te(e,function(t){this.name=e,this.message=t;var a=new Error(t).stack;a!==void 0&&(this.stack=this.toString()+` +`+a.replace(/^Error(:[^\n]*)?\n/,""))});return n.prototype=Object.create(r.prototype),n.prototype.constructor=n,n.prototype.toString=function(){return this.message===void 0?this.name:this.name+": "+this.message},n}var oe=void 0;function ae(r){throw new oe(r)}function ie(r,e,n){function t(c){var f=n(c);f.length!==r.length&&ae("Mismatched type converter count");for(var l=0;l{rr.hasOwnProperty(c)?a[f]=rr[c]:(i.push(c),ur.hasOwnProperty(c)||(ur[c]=[]),ur[c].push(()=>{a[f]=rr[c],++u===i.length&&t(a)}))}),i.length===0&&t(a)}function on(r){var e=yr[r];delete yr[r];var n=e.rawConstructor,t=e.rawDestructor,a=e.fields;ie([r],a.map(i=>i.getterReturnType).concat(a.map(i=>i.setterArgumentType)),i=>{var u={};return a.forEach((c,f)=>{var l=c.fieldName,h=i[f],_=c.getter,g=c.getterContext,b=i[f+a.length],F=c.setter,A=c.setterContext;u[l]={read:T=>h.fromWireType(_(g,T)),write:(T,nr)=>{var d=[];F(A,T,b.toWireType(d,nr)),ne(d)}}}),[{name:e.name,fromWireType:function(c){var f={};for(var l in u)f[l]=u[l].read(c);return t(c),f},toWireType:function(c,f){for(var l in u)if(!(l in f))throw new TypeError('Missing field: "'+l+'"');var h=n();for(l in u)u[l].write(h,f[l]);return c!==null&&c.push(t,h),h},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:t}]})}function an(r,e,n,t,a){}function br(r){switch(r){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+r)}}function un(){for(var r=new Array(256),e=0;e<256;++e)r[e]=String.fromCharCode(e);ue=r}var ue=void 0;function j(r){for(var e="",n=r;P[n];)e+=ue[P[n++]];return e}var se=void 0;function I(r){throw new se(r)}function W(r,e,n={}){if(!("argPackAdvance"in e))throw new TypeError("registerType registeredInstance requires argPackAdvance");var t=e.name;if(r||I('type "'+t+'" must have a positive integer typeid pointer'),rr.hasOwnProperty(r)){if(n.ignoreDuplicateRegistrations)return;I("Cannot register type '"+t+"' twice")}if(rr[r]=e,delete Er[r],ur.hasOwnProperty(r)){var a=ur[r];delete ur[r],a.forEach(i=>i())}}function sn(r,e,n,t,a){var i=br(n);W(r,{name:e=j(e),fromWireType:function(u){return!!u},toWireType:function(u,c){return c?t:a},argPackAdvance:8,readValueFromPointer:function(u){var c;if(n===1)c=D;else if(n===2)c=z;else{if(n!==4)throw new TypeError("Unknown boolean type size: "+e);c=v}return this.fromWireType(c[u>>i])},destructorFunction:null})}var Rr=[],L=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function ce(r){r>4&&--L[r].refcount==0&&(L[r]=void 0,Rr.push(r))}function cn(){for(var r=0,e=5;e(r||I("Cannot use deleted val. handle = "+r),L[r].value),toHandle:r=>{switch(r){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var e=Rr.length?Rr.pop():L.length;return L[e]={refcount:1,value:r},e}}};function dn(r,e){W(r,{name:e=j(e),fromWireType:function(n){var t=X.toValue(n);return ce(n),t},toWireType:function(n,t){return X.toHandle(t)},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:null})}function mn(r,e,n){if(r[e].overloadTable===void 0){var t=r[e];r[e]=function(){return r[e].overloadTable.hasOwnProperty(arguments.length)||I("Function '"+n+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+r[e].overloadTable+")!"),r[e].overloadTable[arguments.length].apply(this,arguments)},r[e].overloadTable=[],r[e].overloadTable[t.argCount]=t}}function fe(r,e,n){s.hasOwnProperty(r)?((n===void 0||s[r].overloadTable!==void 0&&s[r].overloadTable[n]!==void 0)&&I("Cannot register public name '"+r+"' twice"),mn(s,r,r),s.hasOwnProperty(n)&&I("Cannot register multiple overloads of a function with the same number of arguments ("+n+")!"),s[r].overloadTable[n]=e):(s[r]=e,n!==void 0&&(s[r].numArguments=n))}function pn(r,e,n){switch(e){case 0:return function(t){var a=n?D:P;return this.fromWireType(a[t])};case 1:return function(t){var a=n?z:or;return this.fromWireType(a[t>>1])};case 2:return function(t){var a=n?v:k;return this.fromWireType(a[t>>2])};default:throw new TypeError("Unknown integer type: "+r)}}function vn(r,e,n,t){var a=br(n);function i(){}e=j(e),i.values={},W(r,{name:e,constructor:i,fromWireType:function(u){return this.constructor.values[u]},toWireType:function(u,c){return c.value},argPackAdvance:8,readValueFromPointer:pn(e,a,t),destructorFunction:null}),fe(e,i)}function le(r){var e=xe(r),n=j(e);return q(e),n}function de(r,e){var n=rr[r];return n===void 0&&I(e+" has unknown type "+le(r)),n}function hn(r,e,n){var t=de(r,"enum");e=j(e);var a=t.constructor,i=Object.create(t.constructor.prototype,{value:{value:n},constructor:{value:te(t.name+"_"+e,function(){})}});a.values[n]=i,a[e]=i}function gn(r,e){switch(e){case 2:return function(n){return this.fromWireType(ar[n>>2])};case 3:return function(n){return this.fromWireType(qr[n>>3])};default:throw new TypeError("Unknown float type: "+r)}}function _n(r,e,n){var t=br(n);W(r,{name:e=j(e),fromWireType:function(a){return a},toWireType:function(a,i){return i},argPackAdvance:8,readValueFromPointer:gn(e,t),destructorFunction:null})}function yn(r,e,n,t,a){var i=e.length;i<2&&I("argTypes array size mismatch! Must at least get return value and 'this' types!");for(var u=e[1]!==null&&n!==null,c=!1,f=1;f>2]);return n}function En(r,e,n){s.hasOwnProperty(r)||ae("Replacing nonexistant public symbol"),s[r].overloadTable!==void 0&&n!==void 0?s[r].overloadTable[n]=e:(s[r]=e,s[r].argCount=n)}function bn(r,e,n){var t=s["dynCall_"+r];return n&&n.length?t.apply(null,[e].concat(n)):t.call(null,e)}var dr=[];function Or(r){var e=dr[r];return e||(r>=dr.length&&(dr.length=r+1),dr[r]=e=J.get(r)),e}function kn(r,e,n){return r.includes("j")?bn(r,e,n):Or(e).apply(null,n)}function xn(r,e){var n=[];return function(){return n.length=0,Object.assign(n,arguments),kn(r,e,n)}}function mr(r,e){function n(){return r.includes("j")?xn(r,e):Or(e)}r=j(r);var t=n();return typeof t!="function"&&I("unknown function pointer with signature "+r+": "+e),t}var me=void 0;function Fn(r,e){var n=[],t={};function a(i){t[i]||rr[i]||(Er[i]?Er[i].forEach(a):(n.push(i),t[i]=!0))}throw e.forEach(a),new me(r+": "+n.map(le).join([", "]))}function Dn(r,e,n,t,a,i){var u=wn(e,n);r=j(r),a=mr(t,a),fe(r,function(){Fn("Cannot call "+r+" due to unbound types",u)},e-1),ie([],u,function(c){var f=[c[0],null].concat(c.slice(1));return En(r,yn(r,f,null,a,i),e-1),[]})}function Sn(r,e,n){switch(e){case 0:return n?function(t){return D[t]}:function(t){return P[t]};case 1:return n?function(t){return z[t>>1]}:function(t){return or[t>>1]};case 2:return n?function(t){return v[t>>2]}:function(t){return k[t>>2]};default:throw new TypeError("Unknown integer type: "+r)}}function An(r,e,n,t,a){e=j(e);var i=br(n),u=h=>h;if(t===0){var c=32-8*n;u=h=>h<>>c}var f=e.includes("unsigned"),l=(h,_)=>{};W(r,{name:e,fromWireType:u,toWireType:f?function(h,_){return l(_,this.name),_>>>0}:function(h,_){return l(_,this.name),_},argPackAdvance:8,readValueFromPointer:Sn(e,i,t!==0),destructorFunction:null})}function Pn(r,e,n){var t=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][e];function a(i){var u=k,c=u[i>>=2],f=u[i+1];return new t(hr,f,c)}W(r,{name:n=j(n),fromWireType:a,argPackAdvance:8,readValueFromPointer:a},{ignoreDuplicateRegistrations:!0})}function Cn(r,e){var n=(e=j(e))==="std::string";W(r,{name:e,fromWireType:function(t){var a,i=k[t>>2],u=t+4;if(n)for(var c=u,f=0;f<=i;++f){var l=u+f;if(f==i||P[l]==0){var h=M(c,l-c);a===void 0?a=h:(a+="\0",a+=h),c=l+1}}else{var _=new Array(i);for(f=0;f>2]=i,n&&u)Yr(a,f,i+1);else if(u)for(var l=0;l255&&(q(f),I("String has UTF-16 code units that do not fit in 8 bits")),P[f+l]=h}else for(l=0;l>1,a=t+e/2;!(t>=a)&&or[t];)++t;if((n=t<<1)-r>32&&pe)return pe.decode(P.subarray(r,n));for(var i="",u=0;!(u>=e/2);++u){var c=z[r+2*u>>1];if(c==0)break;i+=String.fromCharCode(c)}return i}function jn(r,e,n){if(n===void 0&&(n=2147483647),n<2)return 0;for(var t=e,a=(n-=2)<2*r.length?n/2:r.length,i=0;i>1]=u,e+=2}return z[e>>1]=0,e-t}function Bn(r){return 2*r.length}function Mn(r,e){for(var n=0,t="";!(n>=e/4);){var a=v[r+4*n>>2];if(a==0)break;if(++n,a>=65536){var i=a-65536;t+=String.fromCharCode(55296|i>>10,56320|1023&i)}else t+=String.fromCharCode(a)}return t}function In(r,e,n){if(n===void 0&&(n=2147483647),n<4)return 0;for(var t=e,a=t+n-4,i=0;i=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&r.charCodeAt(++i)),v[e>>2]=u,(e+=4)+4>a)break}return v[e>>2]=0,e-t}function Nn(r){for(var e=0,n=0;n=55296&&t<=57343&&++n,e+=4}return e}function Ln(r,e,n){var t,a,i,u,c;n=j(n),e===2?(t=Tn,a=jn,u=Bn,i=()=>or,c=1):e===4&&(t=Mn,a=In,u=Nn,i=()=>k,c=2),W(r,{name:n,fromWireType:function(f){for(var l,h=k[f>>2],_=i(),g=f+4,b=0;b<=h;++b){var F=f+4+b*e;if(b==h||_[F>>c]==0){var A=t(g,F-g);l===void 0?l=A:(l+="\0",l+=A),g=F+e}}return q(f),l},toWireType:function(f,l){typeof l!="string"&&I("Cannot pass non-string to C++ string type "+n);var h=u(l),_=Ar(4+h+e);return k[_>>2]=h>>c,a(l,_+4,h+e),f!==null&&f.push(q,_),_},argPackAdvance:8,readValueFromPointer:wr,destructorFunction:function(f){q(f)}})}function Rn(r,e,n,t,a,i){yr[r]={name:j(e),rawConstructor:mr(n,t),rawDestructor:mr(a,i),fields:[]}}function On(r,e,n,t,a,i,u,c,f,l){yr[r].fields.push({fieldName:j(e),getterReturnType:n,getter:mr(t,a),getterContext:i,setterArgumentType:u,setter:mr(c,f),setterContext:l})}function Wn(r,e){W(r,{isVoid:!0,name:e=j(e),argPackAdvance:0,fromWireType:function(){},toWireType:function(n,t){}})}function Zn(r){do{var e=k[r>>2],n=k[(r+=4)>>2],t=k[(r+=4)>>2];r+=4;var a=M(e);o.createPath("/",x.dirname(a),!0,!0),o.createDataFile(a,null,D.subarray(t,t+n),!0,!0,!0)}while(k[r>>2])}function zn(r){r>4&&(L[r].refcount+=1)}var Un={};function Hn(r){var e=Un[r];return e===void 0?j(r):e}function Vn(r){return X.toHandle(Hn(r))}function qn(){return X.toHandle({})}function Gn(r,e,n){r=X.toValue(r),e=X.toValue(e),n=X.toValue(n),r[e]=n}function Yn(r,e){var n=(r=de(r,"_emval_take_value")).readValueFromPointer(e);return X.toHandle(n)}function Xn(){U("")}function Qn(r,e,n){P.copyWithin(r,e,e+n)}function Jn(){return 2147483648}function Kn(r){try{return jr.grow(r-hr.byteLength+65535>>>16),Xr(jr.buffer),1}catch{}}function $n(r){var e=P.length;r>>>=0;var n=Jn();if(r>n)return!1;let t=(u,c)=>u+(c-u%c)%c;for(var a=1;a<=4;a*=2){var i=e*(1+.2/a);if(i=Math.min(i,r+100663296),Kn(Math.min(n,t(Math.max(r,i),65536))))return!0}return!1}function rt(r){return!!(r.dibvbi=r.getExtension("WEBGL_draw_instanced_base_vertex_base_instance"))}function et(r){return!!(r.mdibvbi=r.getExtension("WEBGL_multi_draw_instanced_base_vertex_base_instance"))}function nt(r){return!!(r.multiDrawWebgl=r.getExtension("WEBGL_multi_draw"))}var m={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:[],offscreenCanvases:{},queries:[],samplers:[],transformFeedbacks:[],syncs:[],stringCache:{},stringiCache:{},unpackAlignment:4,recordError:function(r){m.lastError||(m.lastError=r)},getNewId:function(r){for(var e=m.counter++,n=r.length;n>2]:-1;a+=M(v[n+4*i>>2],u<0?void 0:u)}return a},createContext:function(r,e){if(s.preinitializedWebGLContext){var n=s.preinitializedWebGLContext;e.majorVersion=typeof WebGL2RenderingContext<"u"&&n instanceof WebGL2RenderingContext?2:1}else{if(!r.getContextSafariWebGL2Fixed){let t=function(a,i){var u=r.getContextSafariWebGL2Fixed(a,i);return a=="webgl"==u instanceof WebGLRenderingContext?u:null};r.getContextSafariWebGL2Fixed=r.getContext,r.getContext=t}n=r.getContext("webgl2",e)}return n?m.registerContext(n,e):0},registerContext:function(r,e){var n=m.getNewId(m.contexts),t={handle:n,attributes:e,version:e.majorVersion,GLctx:r};return r.canvas&&(r.canvas.GLctxObject=t),m.contexts[n]=t,(e.enableExtensionsByDefault===void 0||e.enableExtensionsByDefault)&&m.initExtensions(t),n},makeContextCurrent:function(r){return m.currentContext=m.contexts[r],s.ctx=p=m.currentContext&&m.currentContext.GLctx,!(r&&!p)},getContext:function(r){return m.contexts[r]},deleteContext:function(r){m.currentContext===m.contexts[r]&&(m.currentContext=null),typeof E=="object"&&E.removeAllHandlersOnTarget(m.contexts[r].GLctx.canvas),m.contexts[r]&&m.contexts[r].GLctx.canvas&&(m.contexts[r].GLctx.canvas.GLctxObject=void 0),m.contexts[r]=null},initExtensions:function(r){if(r||(r=m.currentContext),!r.initExtensionsDone){r.initExtensionsDone=!0;var e=r.GLctx;rt(e),et(e),r.version>=2&&(e.disjointTimerQueryExt=e.getExtension("EXT_disjoint_timer_query_webgl2")),(r.version<2||!e.disjointTimerQueryExt)&&(e.disjointTimerQueryExt=e.getExtension("EXT_disjoint_timer_query")),nt(e),(e.getSupportedExtensions()||[]).forEach(function(n){n.includes("lose_context")||n.includes("debug")||e.getExtension(n)})}}},E={inEventHandler:0,removeAllEventListeners:function(){for(var r=E.eventHandlers.length-1;r>=0;--r)E._removeHandler(r);E.eventHandlers=[],E.deferredCalls=[]},registerRemoveEventListeners:function(){E.removeEventListenersRegistered||(E.removeEventListenersRegistered=!0)},deferredCalls:[],deferCall:function(r,e,n){function t(u,c){if(u.length!=c.length)return!1;for(var f in u)if(u[f]!=c[f])return!1;return!0}for(var a in E.deferredCalls){var i=E.deferredCalls[a];if(i.targetFunction==r&&t(i.argsList,n))return}E.deferredCalls.push({targetFunction:r,precedence:e,argsList:n}),E.deferredCalls.sort(function(u,c){return u.precedence2?M(r):r}var at=[0,document,window];function it(r){return r=ot(r),at[r]||document.querySelector(r)}function ut(r){return it(r)}function st(r,e){var n=e>>2,t=v[n+6],a={alpha:!!v[n+0],depth:!!v[n+1],stencil:!!v[n+2],antialias:!!v[n+3],premultipliedAlpha:!!v[n+4],preserveDrawingBuffer:!!v[n+5],powerPreference:tt[t],failIfMajorPerformanceCaveat:!!v[n+7],majorVersion:v[n+8],minorVersion:v[n+9],enableExtensionsByDefault:v[n+10],explicitSwapControl:v[n+11],proxyContextToMainThread:v[n+12],renderViaOffscreenBackBuffer:v[n+13]},i=ut(r);return i?a.explicitSwapControl?0:m.createContext(i,a):0}var ct=st;function ft(r){for(var e=r>>2,n=0;n<14;++n)v[e+n]=0;v[e+0]=v[e+1]=v[e+3]=v[e+4]=v[e+8]=v[e+10]=1}function lt(r){return m.makeContextCurrent(r)?0:-5}var Wr={};function dt(){return Hr||"./this.program"}function pr(){if(!pr.strings){var r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:dt()};for(var e in Wr)Wr[e]===void 0?delete r[e]:r[e]=Wr[e];var n=[];for(var e in r)n.push(e+"="+r[e]);pr.strings=n}return pr.strings}function mt(r,e,n){for(var t=0;t>0]=r.charCodeAt(t);n||(D[e>>0]=0)}function pt(r,e){var n=0;return pr().forEach(function(t,a){var i=e+n;k[r+4*a>>2]=i,mt(t,i),n+=t.length+1}),0}function vt(r,e){var n=pr();k[r>>2]=n.length;var t=0;return n.forEach(function(a){t+=a.length+1}),k[e>>2]=t,0}function ht(r){try{var e=S.getStreamFromFD(r);return o.close(e),0}catch(n){if(o===void 0||!(n instanceof o.ErrnoError))throw n;return n.errno}}function gt(r,e,n,t){for(var a=0,i=0;i>2],c=k[e+4>>2];e+=8;var f=o.read(r,D,u,c,t);if(f<0)return-1;if(a+=f,f>2]=a,0}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return i.errno}}function yt(r,e){return e+2097152>>>0<4194305-!!r?(r>>>0)+4294967296*e:NaN}function wt(r,e,n,t,a){try{var i=yt(e,n);if(isNaN(i))return 61;var u=S.getStreamFromFD(r);return o.llseek(u,i,t),H=[u.position>>>0,(C=u.position,+Math.abs(C)>=1?C>0?(0|Math.min(+Math.floor(C/4294967296),4294967295))>>>0:~~+Math.ceil((C-+(~~C>>>0))/4294967296)>>>0:0)],v[a>>2]=H[0],v[a+4>>2]=H[1],u.getdents&&i===0&&t===0&&(u.getdents=null),0}catch(c){if(o===void 0||!(c instanceof o.ErrnoError))throw c;return c.errno}}function Et(r,e,n,t){for(var a=0,i=0;i>2],c=k[e+4>>2];e+=8;var f=o.write(r,D,u,c,t);if(f<0)return-1;a+=f}return a}function bt(r,e,n,t){try{var a=Et(S.getStreamFromFD(r),e,n);return k[t>>2]=a,0}catch(i){if(o===void 0||!(i instanceof o.ErrnoError))throw i;return i.errno}}function kt(r){p.activeTexture(r)}function xt(r,e){p.attachShader(m.programs[r],m.shaders[e])}function Ft(r,e,n){p.bindAttribLocation(m.programs[r],e,M(n))}function Dt(r,e){r==35051?p.currentPixelPackBufferBinding=e:r==35052&&(p.currentPixelUnpackBufferBinding=e),p.bindBuffer(r,m.buffers[e])}function St(r,e,n){p.bindBufferBase(r,e,m.buffers[n])}function At(r,e,n,t,a){p.bindBufferRange(r,e,m.buffers[n],t,a)}function Pt(r,e){p.bindFramebuffer(r,m.framebuffers[e])}function Ct(r,e){p.bindTexture(r,m.textures[e])}function Tt(r){p.bindVertexArray(m.vaos[r])}function jt(r,e,n,t){n&&e?p.bufferData(r,P,t,n,e):p.bufferData(r,e,t)}function Bt(r,e,n,t){n&&p.bufferSubData(r,e,P,t,n)}function Mt(r){p.clear(r)}function It(r,e,n,t){p.clearBufferfi(r,e,n,t)}function Nt(r,e,n){p.clearBufferfv(r,e,ar,n>>2)}function Lt(r,e,n){p.clearBufferiv(r,e,v,n>>2)}function Rt(r,e,n){p.clearBufferuiv(r,e,k,n>>2)}function Ot(r,e,n,t){p.clearColor(r,e,n,t)}function Wt(r){p.clearDepth(r)}function Zt(r){p.clearStencil(r)}function zt(r,e,n,t){p.colorMask(!!r,!!e,!!n,!!t)}function Ut(r){p.compileShader(m.shaders[r])}function Ht(){var r=m.getNewId(m.programs),e=p.createProgram();return e.name=r,e.maxUniformLength=e.maxAttributeLength=e.maxUniformBlockNameLength=0,e.uniformIdCounter=1,m.programs[r]=e,r}function Vt(r){var e=m.getNewId(m.shaders);return m.shaders[e]=p.createShader(r),e}function qt(r,e){for(var n=0;n>2],a=m.buffers[t];a&&(p.deleteBuffer(a),a.name=0,m.buffers[t]=null,t==p.currentPixelPackBufferBinding&&(p.currentPixelPackBufferBinding=0),t==p.currentPixelUnpackBufferBinding&&(p.currentPixelUnpackBufferBinding=0))}}function Gt(r,e){for(var n=0;n>2],a=m.framebuffers[t];a&&(p.deleteFramebuffer(a),a.name=0,m.framebuffers[t]=null)}}function Yt(r){if(r){var e=m.programs[r];e?(p.deleteProgram(e),e.name=0,m.programs[r]=null):m.recordError(1281)}}function Xt(r,e){for(var n=0;n>2],a=m.queries[t];a&&(p.deleteQuery(a),m.queries[t]=null)}}function Qt(r){if(r){var e=m.shaders[r];e?(p.deleteShader(e),m.shaders[r]=null):m.recordError(1281)}}function Jt(r,e){for(var n=0;n>2],a=m.textures[t];a&&(p.deleteTexture(a),a.name=0,m.textures[t]=null)}}function Kt(r,e){for(var n=0;n>2];p.deleteVertexArray(m.vaos[t]),m.vaos[t]=null}}function $t(r,e,n){p.drawArrays(r,e,n)}var ve=[];function ro(r,e){for(var n=ve[r],t=0;t>2];p.drawBuffers(n)}function eo(r,e,n,t){p.drawElements(r,e,n,t)}function no(r,e,n,t,a){p.drawElementsInstanced(r,e,n,t,a)}function to(r){p.enableVertexAttribArray(r)}function oo(r,e,n,t,a){p.framebufferTexture2D(r,e,n,m.textures[t],a)}function vr(r,e,n,t){for(var a=0;a>2]=u}}function ao(r,e){vr(r,e,"createBuffer",m.buffers)}function io(r,e){vr(r,e,"createFramebuffer",m.framebuffers)}function uo(r,e){vr(r,e,"createQuery",m.queries)}function so(r,e){vr(r,e,"createTexture",m.textures)}function co(r,e){vr(r,e,"createVertexArray",m.vaos)}function fo(r){p.generateMipmap(r)}function he(r,e){k[r>>2]=e,k[r+4>>2]=(e-k[r>>2])/4294967296}function lo(r,e,n){if(e){var t=void 0;switch(r){case 36346:t=1;break;case 36344:return void(n!=0&&n!=1&&m.recordError(1280));case 34814:case 36345:t=0;break;case 34466:var a=p.getParameter(34467);t=a?a.length:0;break;case 33309:if(m.currentContext.version<2)return void m.recordError(1282);t=2*(p.getSupportedExtensions()||[]).length;break;case 33307:case 33308:if(m.currentContext.version<2)return void m.recordError(1280);t=r==33307?3:0}if(t===void 0){var i=p.getParameter(r);switch(typeof i){case"number":t=i;break;case"boolean":t=i?1:0;break;case"string":return void m.recordError(1280);case"object":if(i===null)switch(r){case 34964:case 35725:case 34965:case 36006:case 36007:case 32873:case 34229:case 36662:case 36663:case 35053:case 35055:case 36010:case 35097:case 35869:case 32874:case 36389:case 35983:case 35368:case 34068:t=0;break;default:return void m.recordError(1280)}else{if(i instanceof Float32Array||i instanceof Uint32Array||i instanceof Int32Array||i instanceof Array){for(var u=0;u>2]=i[u];break;case 2:ar[e+4*u>>2]=i[u];break;case 4:D[e+u>>0]=i[u]?1:0}return}try{t=0|i.name}catch(c){return m.recordError(1280),void R("GL_INVALID_ENUM in glGet"+n+"v: Unknown object returned from WebGL getParameter("+r+")! (error: "+c+")")}}break;default:return m.recordError(1280),void R("GL_INVALID_ENUM in glGet"+n+"v: Native code calling glGet"+n+"v("+r+") and it returns "+i+" of type "+typeof i+"!")}}switch(n){case 1:he(e,t);break;case 0:v[e>>2]=t;break;case 2:ar[e>>2]=t;break;case 4:D[e>>0]=t?1:0}}else m.recordError(1281)}function mo(r,e){lo(r,e,0)}function po(r,e,n){if(n){var t,a=m.queries[r];he(n,typeof(t=m.currentContext.version<2?p.disjointTimerQueryExt.getQueryObjectEXT(a,e):p.getQueryParameter(a,e))=="boolean"?t?1:0:t)}else m.recordError(1281)}function vo(r,e,n){if(n){var t,a=m.queries[r],i=p.disjointTimerQueryExt.getQueryObjectEXT(a,e);t=typeof i=="boolean"?i?1:0:i,v[n>>2]=t}else m.recordError(1281)}function ho(r,e){return p.getUniformBlockIndex(m.programs[r],M(e))}function go(r){return parseInt(r)}function ge(r){return r.slice(-1)=="]"&&r.lastIndexOf("[")}function _o(r){var e,n,t=r.uniformLocsById,a=r.uniformSizeAndIdsByName;if(!t)for(r.uniformLocsById=t={},r.uniformArrayNamesById={},e=0;e0?u.slice(0,f):u,h=r.uniformIdCounter;for(r.uniformIdCounter+=c,a[l]=[c,h],n=0;n0&&(t=go(e.slice(i+1))>>>0,a=e.slice(0,i));var u=r.uniformSizeAndIdsByName[a];if(u&&t>xr(c))}}function Fo(r,e,n,t){var a=m.getSource(r,e,n,t);p.shaderSource(m.shaders[r],a)}function Do(r,e,n,t,a,i,u,c,f,l){if(p.currentPixelUnpackBufferBinding)p.texImage3D(r,e,n,t,a,i,u,c,f,l);else if(l){var h=kr(f);p.texImage3D(r,e,n,t,a,i,u,c,f,h,l>>xr(h))}else p.texImage3D(r,e,n,t,a,i,u,c,f,null)}function So(r,e,n){p.texParameteri(r,e,n)}function Ao(r,e,n,t,a){p.texStorage2D(r,e,n,t,a)}function Po(r,e,n,t,a,i,u,c,f){if(p.currentPixelUnpackBufferBinding)p.texSubImage2D(r,e,n,t,a,i,u,c,f);else if(f){var l=kr(c);p.texSubImage2D(r,e,n,t,a,i,u,c,l,f>>xr(l))}else p.texSubImage2D(r,e,n,t,a,i,u,c,null)}function Co(r,e,n,t,a,i,u,c,f,l,h){if(p.currentPixelUnpackBufferBinding)p.texSubImage3D(r,e,n,t,a,i,u,c,f,l,h);else if(h){var _=kr(l);p.texSubImage3D(r,e,n,t,a,i,u,c,f,l,_,h>>xr(_))}else p.texSubImage3D(r,e,n,t,a,i,u,c,f,l,null)}function To(r){var e=p.currentProgram;if(e){var n=e.uniformLocsById[r];return typeof n=="number"&&(e.uniformLocsById[r]=n=p.getUniformLocation(e,e.uniformArrayNamesById[r]+(n>0?"["+n+"]":""))),n}m.recordError(1282)}function jo(r,e){p.uniform1i(To(r),e)}function Bo(r,e,n){r=m.programs[r],p.uniformBlockBinding(r,e,n)}function Mo(r){r=m.programs[r],p.useProgram(r),p.currentProgram=r}function Io(r,e,n,t,a){p.vertexAttribIPointer(r,e,n,t,a)}function No(r,e,n,t,a,i){p.vertexAttribPointer(r,e,n,!!t,a,i)}function Lo(r){}function Fr(r){return r%4==0&&(r%100!=0||r%400==0)}function Ro(r,e){for(var n=0,t=0;t<=e;n+=r[t++]);return n}var _e=[31,29,31,30,31,30,31,31,30,31,30,31],ye=[31,28,31,30,31,30,31,31,30,31,30,31];function Oo(r,e){for(var n=new Date(r.getTime());e>0;){var t=Fr(n.getFullYear()),a=n.getMonth(),i=(t?_e:ye)[a];if(!(e>i-n.getDate()))return n.setDate(n.getDate()+e),n;e-=i-n.getDate()+1,n.setDate(1),a<11?n.setMonth(a+1):(n.setMonth(0),n.setFullYear(n.getFullYear()+1))}return n}function Wo(r,e,n,t){var a=v[t+40>>2],i={tm_sec:v[t>>2],tm_min:v[t+4>>2],tm_hour:v[t+8>>2],tm_mday:v[t+12>>2],tm_mon:v[t+16>>2],tm_year:v[t+20>>2],tm_wday:v[t+24>>2],tm_yday:v[t+28>>2],tm_isdst:v[t+32>>2],tm_gmtoff:v[t+36>>2],tm_zone:a?M(a):""},u=M(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var f in c)u=u.replace(new RegExp(f,"g"),c[f]);var l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],h=["January","February","March","April","May","June","July","August","September","October","November","December"];function _(d,w,N){for(var B=typeof d=="number"?d.toString():d||"";B.length0?1:0}var B;return(B=N(d.getFullYear()-w.getFullYear()))===0&&(B=N(d.getMonth()-w.getMonth()))===0&&(B=N(d.getDate()-w.getDate())),B}function F(d){switch(d.getDay()){case 0:return new Date(d.getFullYear()-1,11,29);case 1:return d;case 2:return new Date(d.getFullYear(),0,3);case 3:return new Date(d.getFullYear(),0,2);case 4:return new Date(d.getFullYear(),0,1);case 5:return new Date(d.getFullYear()-1,11,31);case 6:return new Date(d.getFullYear()-1,11,30)}}function A(d){var w=Oo(new Date(d.tm_year+1900,0,1),d.tm_yday),N=new Date(w.getFullYear(),0,4),B=new Date(w.getFullYear()+1,0,4),Cr=F(N),Yo=F(B);return b(Cr,w)<=0?b(Yo,w)<=0?w.getFullYear()+1:w.getFullYear():w.getFullYear()-1}var T={"%a":function(d){return l[d.tm_wday].substring(0,3)},"%A":function(d){return l[d.tm_wday]},"%b":function(d){return h[d.tm_mon].substring(0,3)},"%B":function(d){return h[d.tm_mon]},"%C":function(d){return g((d.tm_year+1900)/100|0,2)},"%d":function(d){return g(d.tm_mday,2)},"%e":function(d){return _(d.tm_mday,2," ")},"%g":function(d){return A(d).toString().substring(2)},"%G":function(d){return A(d)},"%H":function(d){return g(d.tm_hour,2)},"%I":function(d){var w=d.tm_hour;return w==0?w=12:w>12&&(w-=12),g(w,2)},"%j":function(d){return g(d.tm_mday+Ro(Fr(d.tm_year+1900)?_e:ye,d.tm_mon-1),3)},"%m":function(d){return g(d.tm_mon+1,2)},"%M":function(d){return g(d.tm_min,2)},"%n":function(){return` +`},"%p":function(d){return d.tm_hour>=0&&d.tm_hour<12?"AM":"PM"},"%S":function(d){return g(d.tm_sec,2)},"%t":function(){return" "},"%u":function(d){return d.tm_wday||7},"%U":function(d){var w=d.tm_yday+7-d.tm_wday;return g(Math.floor(w/7),2)},"%V":function(d){var w=Math.floor((d.tm_yday+7-(d.tm_wday+6)%7)/7);if((d.tm_wday+371-d.tm_yday-2)%7<=2&&w++,w){if(w==53){var N=(d.tm_wday+371-d.tm_yday)%7;N==4||N==3&&Fr(d.tm_year)||(w=1)}}else{w=52;var B=(d.tm_wday+7-d.tm_yday-1)%7;(B==4||B==5&&Fr(d.tm_year%400-1))&&w++}return g(w,2)},"%w":function(d){return d.tm_wday},"%W":function(d){var w=d.tm_yday+7-(d.tm_wday+6)%7;return g(Math.floor(w/7),2)},"%y":function(d){return(d.tm_year+1900).toString().substring(2)},"%Y":function(d){return d.tm_year+1900},"%z":function(d){var w=d.tm_gmtoff,N=w>=0;return w=(w=Math.abs(w)/60)/60*100+w%60,(N?"+":"-")+("0000"+w).slice(-4)},"%Z":function(d){return d.tm_zone},"%%":function(){return"%"}};for(var f in u=u.replace(/%%/g,"\0\0"),T)u.includes(f)&&(u=u.replace(new RegExp(f,"g"),T[f](i)));var nr=Nr(u=u.replace(/\0\0/g,"%"),!1);return nr.length>e?0:(He(nr,r),nr.length-1)}function Zo(r,e,n,t){return Wo(r,e,n,t)}function we(r,e){r<128?e.push(r):e.push(r%128|128,r>>7)}function zo(r){for(var e={i:"i32",j:"i64",f:"f32",d:"f64",p:"i32"},n={parameters:[],results:r[0]=="v"?[]:[e[r[0]]]},t=1;t0||(Ie(),K>0||(s.setStatus?(s.setStatus("Running..."),setTimeout(function(){setTimeout(function(){s.setStatus("")},1),e()},1)):e()))}if(s.dynCall_iij=function(){return(s.dynCall_iij=s.asm.Nb).apply(null,arguments)},s.dynCall_jiji=function(){return(s.dynCall_jiji=s.asm.Ob).apply(null,arguments)},s.dynCall_viijii=function(){return(s.dynCall_viijii=s.asm.Pb).apply(null,arguments)},s.dynCall_iiiiij=function(){return(s.dynCall_iiiiij=s.asm.Qb).apply(null,arguments)},s.dynCall_iiiiijj=function(){return(s.dynCall_iiiiijj=s.asm.Rb).apply(null,arguments)},s.dynCall_iiiiiijj=function(){return(s.dynCall_iiiiiijj=s.asm.Sb).apply(null,arguments)},s.___emscripten_embedded_file_data=139184,s.stringToUTF8=Yr,s.lengthBytesUTF8=gr,s.addRunDependency=_r,s.removeRunDependency=lr,s.FS_createPath=o.createPath,s.FS_createDataFile=o.createDataFile,s.FS_createPreloadedFile=o.createPreloadedFile,s.FS_createLazyFile=o.createLazyFile,s.FS_createDevice=o.createDevice,s.FS_unlink=o.unlink,s.addFunction=qo,fr=function r(){Pr||Se(),Pr||(fr=r)},s.preInit)for(typeof s.preInit=="function"&&(s.preInit=[s.preInit]);s.preInit.length>0;)s.preInit.pop()();return Se(),G.ready},Ae.exports=Pe;var Ce=Tr.exports;const $o=Qo({__proto__:null,default:Xo(Ce)},[Ce]);export{$o as v}; diff --git a/dist/assets/webStyleUtils-7PxVkooF.js b/dist/assets/webStyleUtils-7PxVkooF.js new file mode 100644 index 0000000..59c9dd9 --- /dev/null +++ b/dist/assets/webStyleUtils-7PxVkooF.js @@ -0,0 +1 @@ +import{E as c,hc as u,dQ as r,hd as h,he as i,hf as m,bS as b,bV as f,hg as d,hh as p,hi as w,hj as g,hk as $}from"./index-J0iiHjMT.js";async function D(e,t,a){if(!e.name)throw new c("style-symbol-reference-name-missing","Missing name in style symbol reference");if(e.styleName&&e.styleName==="Esri2DPointSymbolsStyle")return S(e,a);try{return j(await u(e,t,a),e.name,t,a)}catch(n){return r(n),null}}async function S(e,t){const a=h.replaceAll(/\{SymbolName\}/gi,e.name);try{const n=await i(a,t);return m(n.data)}catch(n){return r(n),null}}async function j(e,t,a,n){const y={portal:(a==null?void 0:a.portal)!=null?a.portal:b.getDefault(),url:f(e.baseUrl),origin:"portal-item"},o=d(t,e.data);if(!o)throw new c("symbolstyleutils:symbol-name-not-found",`The symbol name '${t}' could not be found`,{symbolName:t});let s=p(w(o,"cimRef"),y);g()&&(s=$(s));try{const l=await i(s,n);return m(l.data)}catch(l){return r(l),null}}export{D as fetchCIMSymbolReference}; diff --git a/dist/assets/wfsUtils-6CAR46-c.js b/dist/assets/wfsUtils-6CAR46-c.js new file mode 100644 index 0000000..7a77f48 --- /dev/null +++ b/dist/assets/wfsUtils-6CAR46-c.js @@ -0,0 +1 @@ +import{bW as h,f8 as I,E as l,f9 as U,fa as R,fb as $,fc as C,ar as k,dT as L,al as M,fd as O,e1 as V,dw as m,fe as W,f4 as X,eV as z,ff as F}from"./index-J0iiHjMT.js";import{u as Y}from"./geojson-fSjaGZrp.js";import{o as S,n as T}from"./xmlUtils-Q_9cB30b.js";const x="xlink:href",d="2.0.0",E="__esri_wfs_id__",q="wfs-layer:getWFSLayerTypeInfo-error",_="wfs-layer:empty-service",A="wfs-layer:feature-type-not-found",H="wfs-layer:geojson-not-supported",J="wfs-layer:kvp-encoding-not-supported",K="wfs-layer:malformed-json",N="wfs-layer:unknown-geometry-type",Q="wfs-layer:unknown-field-type",B="wfs-layer:unsupported-spatial-reference",Z="wfs-layer:unsupported-wfs-version";async function he(r,t){const e=ee((await h(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:d,...t==null?void 0:t.customParameters},signal:t==null?void 0:t.signal})).data);return ne(r,e),e}function ee(r){const t=G(r);ge(t),D(t);const e=t.firstElementChild,a=I(re(e));return{operations:ae(e),get featureTypes(){return Array.from(a())},readFeatureTypes:a}}const te=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function ae(r){let t=!1;const e={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if(S(r,{OperationsMetadata:{Operation:a=>{switch(a.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:n=>{e.GetCapabilities.url=n.getAttribute(x)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:n=>{e.DescribeFeatureType.url=n.getAttribute(x)}}}};case"GetFeature":return{DCP:{HTTP:{Get:n=>{e.GetFeature.url=n.getAttribute(x)}}},Parameter:n=>{if(n.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:s=>{const o=s.textContent;o&&te.has(o.toLowerCase())&&(e.GetFeature.outputFormat=o)}}}}}}},Constraint:a=>{switch(a.getAttribute("name")){case"KVPEncoding":return{DefaultValue:n=>{t=n.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:n=>{e.GetFeature.supportsPagination=n.textContent.toLowerCase()==="true"}}}}}}),!t)throw new l(J,"WFS service doesn't support key/value pair (KVP) encoding");if(e.GetFeature.outputFormat==null)throw new l(H,"WFS service doesn't support GeoJSON output format");return e}function ne(r,t){U(r)&&(R(r,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=$(t.operations.DescribeFeatureType.url)),R(r,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=$(t.operations.GetFeature.url)))}function P(r){var e,a,n;const t=parseInt(((n=(a=(e=r.textContent)==null?void 0:e.match(/(?\d+$)/i))==null?void 0:a.groups)==null?void 0:n.wkid)??"",10);if(!Number.isNaN(t))return t}function re(r){return T(r,{FeatureTypeList:{FeatureType:t=>{const e={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",defaultSpatialReference:4326,supportedSpatialReferences:[]},a=new Set;return S(t,{Name:n=>{const{name:s,prefix:o}=g(n.textContent);e.typeName=`${o}:${s}`,e.name=s,e.namespacePrefix=o,e.namespaceUri=n.lookupNamespaceURI(o)},Abstract:n=>{e.description=n.textContent},Title:n=>{e.title=n.textContent},WGS84BoundingBox:n=>{e.extent=se(n)},DefaultCRS:n=>{const s=P(n);s&&(e.defaultSpatialReference=s,a.add(s))},OtherCRS:n=>{const s=P(n);s&&a.add(s)}}),e.title||(e.title=e.name),a.add(4326),e.supportedSpatialReferences.push(...a),e}}})}function se(r){let t,e,a,n;for(const s of r.children)switch(s.localName){case"LowerCorner":[t,e]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[a,n]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:t,ymin:e,xmax:a,ymax:n,spatialReference:z}}function oe(r,t,e){return C(r,a=>e?a.name===t&&a.namespaceUri===e:a.typeName===t||a.name===t)}async function Se(r,t,e,a={}){const{featureType:n,extent:s}=await ie(r,t,e,a),{spatialReference:o}=we(r.operations.GetFeature.url,n,a.spatialReference),{fields:i,geometryType:p,swapXY:c,objectIdField:u,geometryField:f}=await ue(r,n,o,a);return{url:r.operations.GetCapabilities.url,name:n.name,namespaceUri:n.namespaceUri,fields:i,geometryField:f,geometryType:p,objectIdField:u,spatialReference:a.spatialReference??new k({wkid:n.defaultSpatialReference}),extent:s,swapXY:c,wfsCapabilities:r,customParameters:a.customParameters}}async function ie(r,t,e,a={}){const n=r.readFeatureTypes(),s=t?oe(n,t,e):n.next().value,{spatialReference:o=new k({wkid:s==null?void 0:s.defaultSpatialReference})}=a;if(s==null)throw t?new l(A,`The type '${t}' could not be found in the service`):new l(_,"The service is empty");let i=new L({...s.extent,spatialReference:k.WGS84});if(!M(i.spatialReference,o))try{await O(i.spatialReference,o,void 0,a),i=V(i,o)}catch{throw new l(B,"Projection not supported")}return{extent:i,spatialReference:o,featureType:s}}async function ue(r,t,e,a={}){var y,w,b;const{typeName:n}=t,[s,o]=await Promise.allSettled([ce(r.operations.DescribeFeatureType.url,n,a),le(r,n,e,a)]),i=j=>new l(q,`An error occurred while getting info about the feature type '${n}'`,{error:j});if(s.status==="rejected")throw i(s.reason);if(o.status==="rejected")throw i(o.reason);const{fields:p,errors:c}=s.value??{},u=((y=s.value)==null?void 0:y.geometryType)||((w=o.value)==null?void 0:w.geometryType),f=((b=o.value)==null?void 0:b.swapXY)??!1;if(u==null)throw new l(N,`The geometry type could not be determined for type '${n}`,{typeName:n,geometryType:u,fields:p,errors:c});return{...pe(p??[]),geometryType:u,swapXY:f}}function pe(r){const t=r.find(a=>a.type==="geometry");let e=r.find(a=>a.type==="oid");return r=r.filter(a=>a.type!=="geometry"),e||(e=new m({name:E,type:"oid",alias:E}),r.unshift(e)),{geometryField:(t==null?void 0:t.name)??null,objectIdField:e.name,fields:r}}async function le(r,t,e,a={}){var c;let n,s=!1;const[o,i]=await Promise.all([de(r.operations.GetFeature.url,t,e,r.operations.GetFeature.outputFormat,{...a,count:1}),h(r.operations.GetFeature.url,{responseType:"text",query:v(t,e,void 0,{...a,count:1}),signal:a==null?void 0:a.signal})]),p=o.type==="FeatureCollection"&&((c=o.features[0])==null?void 0:c.geometry);if(p){let u;switch(n=W.fromJSON(Y(p.type)),p.type){case"Point":u=p.coordinates;break;case"LineString":case"MultiPoint":u=p.coordinates[0];break;case"MultiLineString":case"Polygon":u=p.coordinates[0][0];break;case"MultiPolygon":u=p.coordinates[0][0][0]}const f=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(i.data);if(f){const y=u[0].toFixed(3),w=u[1].toFixed(3),b=parseFloat(f[1]).toFixed(3);y===parseFloat(f[2]).toFixed(3)&&w===b&&(s=!0)}}return{geometryType:n,swapXY:s}}async function ce(r,t,e){return fe(t,(await h(r,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:d,TYPENAME:t,...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal})).data)}function fe(r,t){const{name:e}=g(r),a=G(t);D(a);const n=C(T(a.firstElementChild,{element:s=>({name:s.getAttribute("name"),typeName:g(s.getAttribute("type")).name})}),({name:s})=>s===e);if(n!=null){const s=C(T(a.firstElementChild,{complexType:o=>o}),o=>o.getAttribute("name")===n.typeName);if(s!=null)return me(s)}throw new l(A,`Type '${r}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const ye=new Set(["objectid","fid"]);function me(r){const t=[],e=[];let a;const n=T(r,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of n){const o=s.getAttribute("name");if(!o)continue;let i,p;if(s.hasAttribute("type")?i=g(s.getAttribute("type")).name:S(s,{simpleType:{restriction:f=>(i=g(f.getAttribute("base")).name,{maxLength:y=>{p=+y.getAttribute("value")}})}}),!i)continue;const c=s.getAttribute("nillable")==="true";let u=!1;switch(i.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":e.push(new m({name:o,alias:o,type:"integer",nullable:c,length:F("integer")}));break;case"float":case"double":case"decimal":e.push(new m({name:o,alias:o,type:"double",nullable:c,length:F("double")}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":e.push(new m({name:o,alias:o,type:"string",nullable:c,length:p??F("string")}));break;case"datetime":case"date":e.push(new m({name:o,alias:o,type:"date",nullable:c,length:p??F("date")}));break;case"pointpropertytype":a="point",u=!0;break;case"multipointpropertytype":a="multipoint",u=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":a="polyline",u=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":a="polygon",u=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":u=!0,t.push(new l(N,`geometry type '${i}' is not supported`,{type:new XMLSerializer().serializeToString(r)}));break;default:t.push(new l(Q,`Unknown field type '${i}'`,{type:new XMLSerializer().serializeToString(r)}))}u&&e.push(new m({name:o,alias:o,type:"geometry",nullable:c}))}for(const s of e)if(s.type==="integer"&&!s.nullable&&ye.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:a,fields:e,errors:t}}async function de(r,t,e,a,n){let{data:s}=await h(r,{responseType:"text",query:v(t,e,a,n),signal:n==null?void 0:n.signal});s=s.replaceAll(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{return JSON.parse(s)}catch(o){throw new l(K,"Error while parsing the response",{response:s,error:o})}}function v(r,t,e,a){const n=typeof t=="number"?t:t.wkid;return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:d,TYPENAMES:r,OUTPUTFORMAT:e,SRSNAME:"EPSG:"+n,STARTINDEX:a==null?void 0:a.startIndex,COUNT:a==null?void 0:a.count,...a==null?void 0:a.customParameters}}function G(r){return new DOMParser().parseFromString(r.trim(),"text/xml")}function g(r){const[t,e]=r.split(":");return{prefix:e?t:"",name:e??t}}function ge(r){var e;const t=(e=r.firstElementChild)==null?void 0:e.getAttribute("version");if(t&&t!==d)throw new l(Z,`Unsupported WFS version ${t}. Supported version: ${d}`)}function D(r){let t="",e="";if(S(r.firstElementChild,{Exception:a=>(t=a.getAttribute("exceptionCode"),{ExceptionText:n=>{e=n.textContent}})}),t)throw new l(`wfs-layer:${t}`,e)}function we(r,t,e){const a={wkid:t.defaultSpatialReference},n=(e==null?void 0:e.wkid)!=null?{wkid:e.wkid}:a;return{spatialReference:n,getFeatureSpatialReference:X(r)||n.wkid&&t.supportedSpatialReferences.includes(n.wkid)?{wkid:n.wkid}:{wkid:t.defaultSpatialReference}}}export{de as B,E as S,oe as V,Se as W,we as a,pe as q,he as v}; diff --git a/dist/assets/xmlUtils-Q_9cB30b.js b/dist/assets/xmlUtils-Q_9cB30b.js new file mode 100644 index 0000000..282c8f5 --- /dev/null +++ b/dist/assets/xmlUtils-Q_9cB30b.js @@ -0,0 +1 @@ +function e(i,f){if(i&&f){for(const o of i.children)if(o.localName in f){const n=f[o.localName];if(typeof n=="function"){const c=n(o);c&&e(o,c)}else e(o,n)}}}function*l(i,f){for(const o of i.children)if(o.localName in f){const n=f[o.localName];typeof n=="function"?yield n(o):yield*l(o,n)}}export{l as n,e as o}; diff --git a/dist/assets/xyChart-pkay2Qkc.js b/dist/assets/xyChart-pkay2Qkc.js new file mode 100644 index 0000000..c8394df --- /dev/null +++ b/dist/assets/xyChart-pkay2Qkc.js @@ -0,0 +1 @@ +import{d as W,c as $}from"./LineSeries-VcEznTH7.js";import{_ as le,b as he,x as ge,u as de,o as me,r as ce}from"./LineSeries-VcEznTH7.js";import{b as j,m as D,l as A,p as K,a1 as Z,s as z,B,K as O,n as q,a0 as J}from"./Theme-QNc_77AM.js";import{da as E}from"./index-J0iiHjMT.js";import{n as H}from"./Button-1STHXt3M.js";import"./ColorSet-j9kKRPwP.js";import"./DefaultTheme-T7-VnRhA.js";import"./Tick-WQ_bPwW2.js";class k extends W{constructor(){super(...arguments),Object.defineProperty(this,"_ph",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pw",{enumerable:!0,configurable:!0,writable:!0,value:0})}_makeGraphics(e,t){return this.makeColumn(t,e)}_makeFieldNames(){super._makeFieldNames();const e=this.get("xAxis"),t=this.get("yAxis"),i="CategoryAxis",s="ValueAxis";e.isType(i)&&(this.get("openCategoryXField")||(this._xOpenField=this._xField)),e.isType(s)&&(this.get("openValueXField")||(this._xOpenField=this._xField)),t.isType(i)&&(this.get("openCategoryYField")||(this._yOpenField=this._yField)),t.isType(s)&&(this.get("openValueYField")||(this._yOpenField=this._yField))}_prepareChildren(){super._prepareChildren();const e=this.get("xAxis"),t=this.get("yAxis"),i=this.dataItems.length,s=Math.max(0,this.startIndex()-2),a=Math.min(this.endIndex()+2,i-1);if(e.inited&&t.inited)for(let o=s;o<=a;o++){let n=this.dataItems[o];this._createGraphics(n)}}_updateChildren(){const e=this.chart;e&&(this._ph=e.plotContainer.height(),this._pw=e.plotContainer.width());const t=this.get("xAxis"),i=this.get("yAxis"),s=this.get("baseAxis"),a=this.columns.template;this.isDirty("fill")&&a.get("fill")==null&&a.set("fill",this.get("fill")),this.isDirty("stroke")&&a.get("stroke")==null&&a.set("stroke",this.get("stroke"));let o=0,n=0,r=0;D(s.series,h=>{if(h instanceof k){const x=h.get("stacked");x&&r==0&&n++,!x&&h.get("clustered")&&n++}h===this&&(o=n-1),r++}),this.get("clustered")||(o=0,n=1),n===0&&(n=1,o=0);const g=t.get("renderer"),c=i.get("renderer"),p="cellStartLocation",u="cellEndLocation",m=g.get(p,0),f=g.get(u,1),d=c.get(p,0),l=c.get(u,1);if(this._aLocationX0=m+o/n*(f-m),this._aLocationX1=m+(o+1)/n*(f-m),this._aLocationY0=d+o/n*(l-d),this._aLocationY1=d+(o+1)/n*(l-d),t.inited&&i.inited){if(this._axesDirty||this._valuesDirty||this._stackDirty||this.isDirty("vcx")||this.isDirty("vcy")||this._sizeDirty){const h=this.dataItems.length;let x=Math.max(0,this.startIndex()-2),M=Math.min(this.endIndex()+2,h-1);for(let _=0;_0&&x>0)for(let X=_-1;X>=0;X--){let y=this.dataItems[X];if(y.get("valueX")!=null&&y.get("valueY")!=null){F=y;break}}break}this._toggleColumn(T,!1)}for(let _=x;_<=M;_++){let T=this.dataItems[_];this._updateGraphics(T,F),T.get("valueX")!=null&&T.get("valueY")!=null&&(F=T)}for(let _=M+1;_{const a=s.container,o=e.get("rangeGraphics",[]);e.set("rangeGraphics",o);const n=this._makeGraphics(s.columns,e);o.push(n),n.setPrivate("list",s.columns),a.children.push(n)})}}_updateGraphics(e,t){let i=e.get("graphics");const s=this._xField,a=this._yField,o=e.get(s),n=e.get(a);if(o!=null&&n!=null){const r=this._xOpenField,g=this._yOpenField,c=this.get("locationX",e.get("locationX",.5)),p=this.get("locationY",e.get("locationY",.5)),u=this.get("openLocationX",e.get("openLocationX",c)),m=this.get("openLocationY",e.get("openLocationY",p)),f=i.get("width"),d=i.get("height"),l=this.get("stacked"),h=this.get("xAxis"),x=this.get("yAxis"),M=this.get("baseAxis"),F=h.get("start"),_=h.get("end"),T=x.get("start"),X=x.get("end");let y,w,v,C,Y=this.get("vcy",1),L=this.get("vcx",1),R=!1,G=!1;if(x.isType("CategoryAxis")&&h.isType("CategoryAxis")){let P=this._aLocationX0+u-.5,b=this._aLocationX1+c-.5;if(f instanceof O){let I=(b-P)*(1-f.value)/2;P+=I,b-=I}if(y=h.getDataItemPositionX(e,r,P,L),w=h.getDataItemPositionX(e,s,b,L),P=this._aLocationY0+m-.5,b=this._aLocationY1+p-.5,d instanceof O){let I=(b-P)*(1-d.value)/2;P+=I,b-=I}v=x.getDataItemPositionY(e,g,P,Y),C=x.getDataItemPositionY(e,a,b,Y),e.setRaw("point",{x:y+(w-y)/2,y:v+(C-v)/2})}else if(h===M){let P=this._aLocationX0+u-.5,b=this._aLocationX1+c-.5;if(f instanceof O){let I=(b-P)*(1-f.value)/2;P+=I,b-=I}if(y=h.getDataItemPositionX(e,r,P,L),w=h.getDataItemPositionX(e,s,b,L),v=x.getDataItemPositionY(e,a,p,Y),this._yOpenField!==this._yField)C=x.getDataItemPositionY(e,g,m,Y);else if(l){let I=e.get("stackToItemY");C=I?x.getDataItemPositionY(I,a,m,I.component.get("vcy")):x.basePosition()}else C=x.basePosition();e.setRaw("point",{x:y+(w-y)/2,y:v}),G=!0}else if(x===M){let P=this._aLocationY0+m-.5,b=this._aLocationY1+p-.5;if(d instanceof O){let I=(b-P)*(1-d.value)/2;P+=I,b-=I}if(v=x.getDataItemPositionY(e,g,P,Y),C=x.getDataItemPositionY(e,a,b,Y),w=h.getDataItemPositionX(e,s,c,L),this._xOpenField!==this._xField)y=h.getDataItemPositionX(e,r,u,L);else if(l){let I=e.get("stackToItemX");y=I?h.getDataItemPositionX(I,s,u,I.component.get("vcx")):h.basePosition()}else y=h.basePosition();R=!0,e.setRaw("point",{x:w,y:v+(C-v)/2})}this._updateSeriesGraphics(e,i,y,w,v,C,R,G),y_&&w>_||v=X&&C>X||q(y)||q(v)?this._toggleColumn(e,!1):this._toggleColumn(e,!0);let V=e.get("rangeGraphics");V&&D(V,P=>{this._updateSeriesGraphics(e,P,y,w,v,C,R,G)}),this._applyGraphicsStates(e,t)}}_updateSeriesGraphics(e,t,i,s,a,o,n,r){const g=t.get("width"),c=t.get("height"),p=t.get("maxWidth"),u=t.get("maxHeight"),m=this.getPoint(i,a),f=this.getPoint(s,o),d=e.get("point");if(d){const l=this.getPoint(d.x,d.y);d.x=l.x+this._x,d.y=l.y+this._y}if(i=m.x,s=f.x,a=m.y,o=f.y,A(g)){const l=(s-i-g)/2;i+=l,s-=l}if(A(p)&&p{this._toggleColumn(e,!1)})}_applyGraphicsStates(e,t){const i=e.get("graphics"),s=i.states.lookup("dropFromOpen"),a=i.states.lookup("riseFromOpen"),o=i.states.lookup("dropFromPrevious"),n=i.states.lookup("riseFromPrevious");if(s||o||a||n){const r=this.get("xAxis"),g=this.get("yAxis"),c=this.get("baseAxis");let p,u,m;c===r&&g.isType("ValueAxis")?(p=e.get(this._yOpenField),u=e.get(this._yField),m=t.get(this._yField)):c===g&&r.isType("ValueAxis")&&(p=e.get(this._xOpenField),u=e.get(this._xField),m=t.get(this._xField)),A(p)&&A(u)&&(u{const a=s.getPrivate("list");a&&a.removeValue(s),s.dispose()})}hideDataItem(e,t){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return E(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,e,t)],a=e.get("graphics");a&&s.push(a.hide(t));const o=e.get("rangeGraphics");o&&D(o,n=>{s.push(n.hide(t))}),yield Promise.all(s)})}_toggleColumn(e,t){const i=e.get("graphics");i&&i.setPrivate("visible",t);const s=e.get("rangeGraphics");s&&D(s,o=>{o.setPrivate("visible",t)});const a=e.bullets;a&&D(a,o=>{o.setPrivate("hidden",!t)})}showDataItem(e,t){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return E(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,e,t)],a=e.get("graphics");a&&s.push(a.show(t));const o=e.get("rangeGraphics");o&&D(o,n=>{s.push(n.show(t))}),yield Promise.all(s)})}updateLegendMarker(e){let t=this.get("legendDataItem");if(this.get("useLastColorForLegendMarker")&&!e){const i=this.dataItems[this.endIndex()-1];i&&(e=i)}if(t){let i=this.columns.template;if(e){let a=e.get("graphics");a&&(i=a)}const s=t.get("markerRectangle");s&&(t.get("itemContainer").get("disabled")||D(J,a=>{s.set(a,i.get(a,this.get(a)))}))}}_getTooltipTarget(e){return this.get("seriesTooltipTarget")=="bullet"?super._getTooltipTarget(e):e.get("graphics")||this}}Object.defineProperty(k,"className",{enumerable:!0,configurable:!0,writable:!0,value:"BaseColumnSeries"}),Object.defineProperty(k,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:W.classNames.concat([k.className])});class N extends ${constructor(){super(...arguments),Object.defineProperty(this,"_frequency",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_itemMap",{enumerable:!0,configurable:!0,writable:!0,value:{}})}_afterNew(){this._settings.themeTags=j(this._settings.themeTags,["axis"]),this.fields.push("category"),this.setPrivateRaw("name","category"),this.addTag("category"),super._afterNew()}_prepareChildren(){super._prepareChildren();const e=this.dataItems.length;let t=0;this._valuesDirty&&(this._itemMap={},D(this.dataItems,i=>{i.setRaw("index",t),this._itemMap[i.get("category")]=i,t++}),this.setPrivateRaw("maxZoomFactor",e)),this.setPrivateRaw("startIndex",Math.max(Math.round(this.get("start",0)*e),0)),this.setPrivateRaw("endIndex",Math.min(Math.round(this.get("end",1)*e),e)),(this._sizeDirty||this._valuesDirty||this.isDirty("start")||this.isDirty("end")||this.isPrivateDirty("endIndex")||this.isPrivateDirty("startIndex")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&this.dataItems.length>0&&(this._handleRangeChange(),this._prepareAxisItems(),this._updateAxisRanges())}_handleRangeChange(){D(this.series,e=>{let t=this.dataItems[this.startIndex()].get("category"),i=this.dataItems[this.endIndex()-1].get("category"),s=e.get("baseAxis"),a=e.get("xAxis"),o=e.get("yAxis");if(a instanceof N&&o instanceof N)e._markDirtyAxes();else if(s===this){let n,r,g=o;if(a===s?(e.get("categoryXField")&&(n="categoryX"),e.get("openCategoryXField")&&(r="openCategoryX")):o===s&&(e.get("categoryYField")&&(n="categoryY"),e.get("openCategoryYField")&&(r="openCategoryY"),g=a),g.className=="ValueAxis"&&(n||r)){let c,p;for(let d=0,l=e.dataItems.length;d=0;d--){let l=e.dataItems[d];if(n&&l.get(n)===i){p=l;break}if(r&&l.get(r)===i){p=l;break}}let u=0,m=e.dataItems.length;c&&(u=e.dataItems.indexOf(c)),p&&(m=e.dataItems.indexOf(p)+1),e.setPrivate("startIndex",u),e.setPrivate("endIndex",m);let f=!1;for(let d=u;d{l.get(h)!=null&&(f=!0)}),D(e.__valueYShowFields,h=>{l.get(h)!=null&&(f=!0)}),f)break}e.setPrivate("outOfSelection",!f)}e._markDirtyAxes()}})}_prepareAxisItems(){const e=this.get("renderer"),t=this.dataItems.length;let i=this.startIndex();i>0&&i--;let s=this.endIndex();s0){let i=this.getPrivate("name")+this.get("renderer").getPrivate("letter"),s=this.axisPositionToIndex(t),a=e.dataItems[s],o=this.dataItems[s],n=o.get("category");if(a&&o&&a.get(i)===n)return a;for(let r=0,g=e.dataItems.length;rH._new(this._root,{position:"absolute",themeTags:j(this.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template]))})}makeColumn(e,t){const i=this.mainContainer.children.push(t.make());return i._setDataItem(e),t.push(i),i}_processAxisRange(e){super._processAxisRange(e),e.columns=new z(B.new({}),()=>H._new(this._root,{position:"absolute",themeTags:j(e.columns.template.get("themeTags",[]),["series","column"])},[this.columns.template,e.columns.template]))}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColumnSeries"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([S.className])});export{le as AxisRendererXAm5,he as AxisRendererYAm5,N as CategoryAxisAm5,S as ColumnSeriesAm5,ge as LineSeriesAm5,de as ValueAxisAm5,me as XYChartAm5,ce as XYCursorAm5}; diff --git a/dist/assets/zh_Hans-l-imEkFY.js b/dist/assets/zh_Hans-l-imEkFY.js new file mode 100644 index 0000000..29541cd --- /dev/null +++ b/dist/assets/zh_Hans-l-imEkFY.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"公元",_era_bc:"公元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"周日",Mon:"周一",Tue:"周二",Wed:"周三",Thu:"周四",Fri:"周五",Sat:"周六",_dateOrd:function(e){let _="th";if(e<11||e>13)switch(e%10){case 1:case 2:case 3:_="日"}return _},"Zoom Out":"缩放",Play:"播放",Stop:"停靠点",Legend:"图例","Press ENTER to toggle":"",Loading:"加载",Home:"主页",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"打印",Image:"影像",Data:"数据",Print:"打印","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"自 %1 至 %2","From %1":"自 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/zh_Hant-8IW9KGhY.js b/dist/assets/zh_Hant-8IW9KGhY.js new file mode 100644 index 0000000..7a40b95 --- /dev/null +++ b/dist/assets/zh_Hant-8IW9KGhY.js @@ -0,0 +1 @@ +const d={_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"西元",_era_bc:"西元前",A:"上午",P:"下午",AM:"上午",PM:"下午","A.M.":"上午","P.M.":"下午",January:"1月",February:"2月",March:"3月",April:"4月",May:"5月",June:"6月",July:"7月",August:"8月",September:"9月",October:"10月",November:"11月",December:"12月",Jan:"1月",Feb:"2月",Mar:"3月",Apr:"4月","May(short)":"5月",Jun:"6月",Jul:"7月",Aug:"8月",Sep:"9月",Oct:"10月",Nov:"11月",Dec:"12月",Sunday:"星期日",Monday:"星期一",Tuesday:"星期二",Wednesday:"星期三",Thursday:"星期四",Friday:"星期五",Saturday:"星期六",Sun:"週日",Mon:"週一",Tue:"週二",Wed:"週三",Thu:"週四",Fri:"週五",Sat:"週六",_dateOrd:function(e){let _="th";if(e<11||e>13)switch(e%10){case 1:case 2:case 3:_="日"}return _},"Zoom Out":"縮放",Play:"播放",Stop:"停止",Legend:"圖例","Press ENTER to toggle":"",Loading:"正在載入",Home:"首頁",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"列印",Image:"影像",Data:"資料",Print:"列印","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"從 %1 至 %2","From %1":"從 %1","To %1":"至 %1","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":""};export{d as default}; diff --git a/dist/assets/zipjs-wrapper-Ui4c_elP.js b/dist/assets/zipjs-wrapper-Ui4c_elP.js new file mode 100644 index 0000000..2de382c --- /dev/null +++ b/dist/assets/zipjs-wrapper-Ui4c_elP.js @@ -0,0 +1,2 @@ +function _t(t){return xt(t.map(([n,e])=>new Array(n).fill(e,0,n)))}function xt(t){return t.reduce((n,e)=>n.concat(Array.isArray(e)?xt(e):e),[])}const nn=[0,1,2,3].concat(..._t([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function $(){const t=this;function n(r){const s=t.dyn_tree,a=t.stat_desc.static_tree,d=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,_=t.stat_desc.max_length;let u,m,x,y,O,l,c=0;for(y=0;y<=15;y++)r.bl_count[y]=0;for(s[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<573;u++)m=r.heap[u],y=s[s[m*2+1]*2+1]+1,y>_&&(y=_,c++),s[m*2+1]=y,!(m>t.max_code)&&(r.bl_count[y]++,O=0,m>=o&&(O=d[m-o]),l=s[m*2],r.opt_len+=l*(y+O),a&&(r.static_len+=l*(a[m*2+1]+O)));if(c!==0){do{for(y=_-1;r.bl_count[y]===0;)y--;r.bl_count[y]--,r.bl_count[y+1]+=2,r.bl_count[_]--,c-=2}while(c>0);for(y=_;y!==0;y--)for(m=r.bl_count[y];m!==0;)x=r.heap[--u],!(x>t.max_code)&&(s[x*2+1]!=y&&(r.opt_len+=(y-s[x*2+1])*s[x*2],s[x*2+1]=y),m--)}}function e(r,s){let a=0;do a|=r&1,r>>>=1,a<<=1;while(--s>0);return a>>>1}function i(r,s,a){const d=[];let o=0,_,u,m;for(_=1;_<=15;_++)d[_]=o=o+a[_-1]<<1;for(u=0;u<=s;u++)m=r[u*2+1],m!==0&&(r[u*2]=e(d[m]++,m))}t.build_tree=function(r){const s=t.dyn_tree,a=t.stat_desc.static_tree,d=t.stat_desc.elems;let o,_,u=-1,m;for(r.heap_len=0,r.heap_max=573,o=0;o=1;o--)r.pqdownheap(s,o);m=d;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],r.pqdownheap(s,1),_=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=_,s[m*2]=s[o*2]+s[_*2],r.depth[m]=Math.max(r.depth[o],r.depth[_])+1,s[o*2+1]=s[_*2+1]=m,r.heap[1]=m++,r.pqdownheap(s,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],n(r),i(s,t.max_code,r.bl_count)}}$._length_code=[0,1,2,3,4,5,6,7].concat(..._t([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));$.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];$.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];$.d_code=function(t){return t<256?nn[t]:nn[256+(t>>>7)]};$.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];$.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];$.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];$.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Q(t,n,e,i,r){const s=this;s.static_tree=t,s.extra_bits=n,s.extra_base=e,s.elems=i,s.max_length=r}const Ki=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Vi=_t([[144,8],[112,9],[24,7],[8,8]]);Q.static_ltree=xt(Ki.map((t,n)=>[t,Vi[n]]));const Gi=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Xi=_t([[30,5]]);Q.static_dtree=xt(Gi.map((t,n)=>[t,Xi[n]]));Q.static_l_desc=new Q(Q.static_ltree,$.extra_lbits,257,286,15);Q.static_d_desc=new Q(Q.static_dtree,$.extra_dbits,0,30,15);Q.static_bl_desc=new Q(null,$.extra_blbits,0,19,7);const Ji=9,zi=8;function he(t,n,e,i,r){const s=this;s.good_length=t,s.max_lazy=n,s.nice_length=e,s.max_chain=i,s.func=r}const Xn=0,ct=1,Ie=2,_e=[new he(0,0,0,0,Xn),new he(4,4,8,4,ct),new he(4,5,16,8,ct),new he(4,6,32,32,ct),new he(4,4,16,16,Ie),new he(8,16,32,32,Ie),new he(8,16,128,128,Ie),new he(8,32,128,256,Ie),new he(32,128,258,1024,Ie),new he(32,258,258,4096,Ie)],et=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],le=0,tt=1,Ye=2,nt=3,Qi=32,yt=42,it=113,$e=666,kt=8,er=0,Et=1,tr=2,V=3,lt=258,oe=lt+V+1;function rn(t,n,e,i){const r=t[n*2],s=t[e*2];return r=3&&M[$.bl_order[v]*2+1]===0;v--);return t.opt_len+=3*(v+1)+5+5+4,v}function Ne(v){t.pending_buf[t.pending++]=v}function Be(v){Ne(v&255),Ne(v>>>8&255)}function Pi(v){Ne(v>>8&255),Ne(v&255&255)}function ne(v,T){let S;const D=T;X>16-D?(S=v,te|=S<>>16-X,X+=D-16):(te|=v<=8&&(Ne(te&255),te>>>=8,X-=8)}function Zi(){ne(Et<<1,3),me(256,Q.static_ltree),Gt(),1+ye+10-X<9&&(ne(Et<<1,3),me(256,Q.static_ltree),Gt()),ye=7}function He(v,T){let S,D,F;if(t.dist_buf[j]=v,t.lc_buf[j]=T&255,j++,v===0?U[T*2]++:(Y++,v--,U[($._length_code[T]+256+1)*2]++,L[$.d_code(v)*2]++),!(j&8191)&&k>2){for(S=j*8,D=b-f,F=0;F<30;F++)S+=L[F*2]*(5+$.extra_dbits[F]);if(S>>>=3,Y8?Be(te):X>0&&Ne(te&255),te=0,X=0}function ji(v,T,S){Jt(),ye=8,S&&(Be(T),Be(~T)),t.pending_buf.set(o.subarray(v,v+T),t.pending),t.pending+=T}function zt(v,T,S){ne((er<<1)+(S?1:0),3),ji(v,T,!0)}function qi(v,T,S){let D,F,W=0;k>0?(q.build_tree(t),ue.build_tree(t),W=bt(),D=t.opt_len+3+7>>>3,F=t.static_len+3+7>>>3,F<=D&&(D=F)):D=F=T+5,T+4<=D&&v!=-1?zt(v,T,S):F==D?(ne((Et<<1)+(S?1:0),3),Xt(Q.static_ltree,Q.static_dtree)):(ne((tr<<1)+(S?1:0),3),Mi(q.max_code+1,ue.max_code+1,W+1),Xt(U,L)),Ue(),S&&Jt()}function ke(v){qi(f>=0?f:-1,b-f,v),f=b,n.flush_pending()}function gt(){let v,T,S,D;do{if(D=_-g-b,D===0&&b===0&&g===0)D=s;else if(D==-1)D--;else if(b>=s+s-oe){o.set(o.subarray(s,s+s),0),h-=s,b-=s,f-=s,v=y,S=v;do T=m[--S]&65535,m[S]=T>=s?T-s:0;while(--v!==0);v=s,S=v;do T=u[--S]&65535,u[S]=T>=s?T-s:0;while(--v!==0);D+=s}if(n.avail_in===0)return;v=n.read_buf(o,b+g,D),g+=v,g>=V&&(x=o[b]&255,x=(x<i-5&&(T=i-5);;){if(g<=1){if(gt(),g===0&&v==0)return le;if(g===0)break}if(b+=g,g=0,S=f+T,(b===0||b>=S)&&(g=b-S,b=S,ke(!1),n.avail_out===0)||b-f>=s-oe&&(ke(!1),n.avail_out===0))return le}return ke(v==4),n.avail_out===0?v==4?Ye:le:v==4?nt:tt}function Qt(v){let T=C,S=b,D,F,W=E;const B=b>s-oe?b-(s-oe):0;let ie=Z;const pe=d,vt=b+lt;let en=o[S+W-1],tn=o[S+W];E>=I&&(T>>=2),ie>g&&(ie=g);do if(D=v,!(o[D+W]!=tn||o[D+W-1]!=en||o[D]!=o[S]||o[++D]!=o[S+1])){S+=2,D++;do;while(o[++S]==o[++D]&&o[++S]==o[++D]&&o[++S]==o[++D]&&o[++S]==o[++D]&&o[++S]==o[++D]&&o[++S]==o[++D]&&o[++S]==o[++D]&&o[++S]==o[++D]&&SW){if(h=v,W=F,F>=ie)break;en=o[S+W-1],tn=o[S+W]}}while((v=u[v&pe]&65535)>B&&--T!==0);return W<=g?W:g}function Hi(v){let T=0,S;for(;;){if(g=V&&(x=(x<=V)if(S=He(b-h,p-V),g-=p,p<=A&&g>=V){p--;do b++,x=(x<=V&&(x=(x<4096)&&(p=V-1)),E>=V&&p<=E){D=b+g-V,S=He(b-1-w,E-V),g-=E-1,E-=2;do++b<=D&&(x=(x<Ji||D!=kt||S<9||S>15||T<0||T>9||W<0||W>2?-2:(v.dstate=t,a=S,s=1<9||S<0||S>2?-2:(_e[k].func!=_e[T].func&&v.total_in!==0&&(D=v.deflate(1)),k!=T&&(k=T,A=_e[k].max_lazy,I=_e[k].good_length,Z=_e[k].nice_length,C=_e[k].max_chain),N=S,D)},t.deflateSetDictionary=function(v,T,S){let D=S,F,W=0;if(!T||e!=yt)return-2;if(Ds-oe&&(D=s-oe,W=S-D),o.set(T.subarray(W,W+D),0),b=D,f=D,x=o[0]&255,x=(x<4||T<0)return-2;if(!v.next_out||!v.next_in&&v.avail_in!==0||e==$e&&T!=4)return v.msg=et[4],-2;if(v.avail_out===0)return v.msg=et[7],-5;if(n=v,W=r,r=T,e==yt&&(D=kt+(a-8<<4)<<8,F=(k-1&255)>>1,F>3&&(F=3),D|=F<<6,b!==0&&(D|=Qi),D+=31-D%31,e=it,Pi(D)),t.pending!==0){if(n.flush_pending(),n.avail_out===0)return r=-1,0}else if(n.avail_in===0&&T<=W&&T!=4)return n.msg=et[7],-5;if(e==$e&&n.avail_in!==0)return v.msg=et[7],-5;if(n.avail_in!==0||g!==0||T!=0&&e!=$e){switch(B=-1,_e[k].func){case Xn:B=Bi(T);break;case ct:B=Hi(T);break;case Ie:B=Yi(T);break}if((B==Ye||B==nt)&&(e=$e),B==le||B==Ye)return n.avail_out===0&&(r=-1),0;if(B==tt){if(T==1)Zi();else if(zt(0,0,!1),T==3)for(S=0;Se&&(r=e),r===0?0:(i.avail_in-=r,t.set(i.next_in.subarray(i.next_in_index,i.next_in_index+r),n),i.next_in_index+=r,i.total_in+=r,r)},flush_pending(){const t=this;let n=t.dstate.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+n),t.next_out_index),t.next_out_index+=n,t.dstate.pending_out+=n,t.total_out+=n,t.avail_out-=n,t.dstate.pending-=n,t.dstate.pending===0&&(t.dstate.pending_out=0))}};function ir(t){const n=this,e=new Jn,i=rr(t&&t.chunkSize?t.chunkSize:64*1024),r=0,s=new Uint8Array(i);let a=t?t.level:-1;typeof a>"u"&&(a=-1),e.deflateInit(a),e.next_out=s,n.append=function(d,o){let _,u,m=0,x=0,y=0;const O=[];if(d.length){e.next_in_index=0,e.next_in=d,e.avail_in=d.length;do{if(e.next_out_index=0,e.avail_out=i,_=e.deflate(r),_!=0)throw new Error("deflating: "+e.msg);e.next_out_index&&(e.next_out_index==i?O.push(new Uint8Array(s)):O.push(s.subarray(0,e.next_out_index))),y+=e.next_out_index,o&&e.next_in_index>0&&e.next_in_index!=m&&(o(e.next_in_index),m=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return O.length>1?(u=new Uint8Array(y),O.forEach(function(l){u.set(l,x),x+=l.length})):u=O[0]?new Uint8Array(O[0]):new Uint8Array,u}},n.flush=function(){let d,o,_=0,u=0;const m=[];do{if(e.next_out_index=0,e.avail_out=i,d=e.deflate(4),d!=1&&d!=0)throw new Error("deflating: "+e.msg);i-e.avail_out>0&&m.push(s.slice(0,e.next_out_index)),u+=e.next_out_index}while(e.avail_in>0||e.avail_out===0);return e.deflateEnd(),o=new Uint8Array(u),m.forEach(function(x){o.set(x,_),_+=x.length}),o}}function rr(t){return t+5*(Math.floor(t/16383)+1)}const sr=15,H=0,ge=1,ar=2,ae=-2,K=-3,sn=-4,ve=-5,ce=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],zn=1440,or=0,cr=4,lr=9,fr=5,dr=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ur=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],mr=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],_r=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],xr=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ee=15;function Nt(){const t=this;let n,e,i,r,s,a;function d(_,u,m,x,y,O,l,c,f,p,w){let R,b,h,g,E,C,A,k,N,I,Z,U,L,M,q;I=0,E=m;do i[_[u+I]]++,I++,E--;while(E!==0);if(i[0]==m)return l[0]=-1,c[0]=0,H;for(k=c[0],C=1;C<=Ee&&i[C]===0;C++);for(A=C,kE&&(k=E),c[0]=k,M=1<U+k;){if(g++,U+=k,q=h-U,q=q>k?k:q,(b=1<<(C=A-U))>R+1&&(b-=R+1,L=A,Czn)return K;s[g]=Z=p[0],p[0]+=q,g!==0?(a[g]=E,r[0]=C,r[1]=k,C=E>>>U-k,r[2]=Z-s[g-1]-C,f.set(r,(s[g-1]+C)*3)):l[0]=Z}for(r[1]=A-U,I>=m?r[0]=192:w[I]>>U;C>>=1)E^=C;for(E^=C,N=(1<257?(p==K?f.msg="oversubscribed distance tree":p==ve?(f.msg="incomplete distance tree",p=K):p!=sn&&(f.msg="empty distance tree with lengths",p=K),p):H)}}Nt.inflate_trees_fixed=function(t,n,e,i){return t[0]=lr,n[0]=fr,e[0]=dr,i[0]=ur,H};const rt=0,an=1,on=2,cn=3,ln=4,fn=5,dn=6,St=7,un=8,st=9;function hr(){const t=this;let n,e=0,i,r=0,s=0,a=0,d=0,o=0,_=0,u=0,m,x=0,y,O=0;function l(c,f,p,w,R,b,h,g){let E,C,A,k,N,I,Z,U,L,M,q,ue,P,se,j,Y;Z=g.next_in_index,U=g.avail_in,N=h.bitb,I=h.bitk,L=h.write,M=L>=C[Y+1],I-=C[Y+1],h.win[L++]=C[Y+2],M--;continue}do{if(N>>=C[Y+1],I-=C[Y+1],k&16){for(k&=15,P=C[Y+2]+(N&ce[k]),N>>=k,I-=k;I<15;)U--,N|=(g.read_byte(Z++)&255)<>=C[Y+1],I-=C[Y+1],k&16){for(k&=15;I>=k,I-=k,M-=P,L>=se)j=L-se,L-j>0&&2>L-j?(h.win[L++]=h.win[j++],h.win[L++]=h.win[j++],P-=2):(h.win.set(h.win.subarray(j,j+2),L),L+=2,j+=2,P-=2);else{j=L-se;do j+=h.end;while(j<0);if(k=h.end-j,P>k){if(P-=k,L-j>0&&k>L-j)do h.win[L++]=h.win[j++];while(--k!==0);else h.win.set(h.win.subarray(j,j+k),L),L+=k,j+=k,k=0;j=0}}if(L-j>0&&P>L-j)do h.win[L++]=h.win[j++];while(--P!==0);else h.win.set(h.win.subarray(j,j+P),L),L+=P,j+=P,P=0;break}else if(!(k&64))E+=C[Y+2],E+=N&ce[k],Y=(A+E)*3,k=C[Y];else return g.msg="invalid distance code",P=g.avail_in-U,P=I>>3>3:P,U+=P,Z-=P,I-=P<<3,h.bitb=N,h.bitk=I,g.avail_in=U,g.total_in+=Z-g.next_in_index,g.next_in_index=Z,h.write=L,K;while(!0);break}if(k&64)return k&32?(P=g.avail_in-U,P=I>>3>3:P,U+=P,Z-=P,I-=P<<3,h.bitb=N,h.bitk=I,g.avail_in=U,g.total_in+=Z-g.next_in_index,g.next_in_index=Z,h.write=L,ge):(g.msg="invalid literal/length code",P=g.avail_in-U,P=I>>3>3:P,U+=P,Z-=P,I-=P<<3,h.bitb=N,h.bitk=I,g.avail_in=U,g.total_in+=Z-g.next_in_index,g.next_in_index=Z,h.write=L,K);if(E+=C[Y+2],E+=N&ce[k],Y=(A+E)*3,(k=C[Y])===0){N>>=C[Y+1],I-=C[Y+1],h.win[L++]=C[Y+2],M--;break}}while(!0)}while(M>=258&&U>=10);return P=g.avail_in-U,P=I>>3>3:P,U+=P,Z-=P,I-=P<<3,h.bitb=N,h.bitk=I,g.avail_in=U,g.total_in+=Z-g.next_in_index,g.next_in_index=Z,h.write=L,H}t.init=function(c,f,p,w,R,b){n=rt,_=c,u=f,m=p,x=w,y=R,O=b,i=null},t.proc=function(c,f,p){let w,R,b,h=0,g=0,E=0,C,A,k,N;for(E=f.next_in_index,C=f.avail_in,h=c.bitb,g=c.bitk,A=c.write,k=A=258&&C>=10&&(c.bitb=h,c.bitk=g,f.avail_in=C,f.total_in+=E-f.next_in_index,f.next_in_index=E,c.write=A,p=l(_,u,m,x,y,O,c,f),E=f.next_in_index,C=f.avail_in,h=c.bitb,g=c.bitk,A=c.write,k=A>>=i[R+1],g-=i[R+1],b=i[R],b===0){a=i[R+2],n=dn;break}if(b&16){d=b&15,e=i[R+2],n=on;break}if(!(b&64)){s=b,r=R/3+i[R+2];break}if(b&32){n=St;break}return n=st,f.msg="invalid literal/length code",p=K,c.bitb=h,c.bitk=g,f.avail_in=C,f.total_in+=E-f.next_in_index,f.next_in_index=E,c.write=A,c.inflate_flush(f,p);case on:for(w=d;g>=w,g-=w,s=u,i=y,r=O,n=cn;case cn:for(w=s;g>=i[R+1],g-=i[R+1],b=i[R],b&16){d=b&15,o=i[R+2],n=ln;break}if(!(b&64)){s=b,r=R/3+i[R+2];break}return n=st,f.msg="invalid distance code",p=K,c.bitb=h,c.bitk=g,f.avail_in=C,f.total_in+=E-f.next_in_index,f.next_in_index=E,c.write=A,c.inflate_flush(f,p);case ln:for(w=d;g>=w,g-=w,n=fn;case fn:for(N=A-o;N<0;)N+=c.end;for(;e!==0;){if(k===0&&(A==c.end&&c.read!==0&&(A=0,k=A7&&(g-=8,C++,E--),c.write=A,p=c.inflate_flush(f,p),A=c.write,k=Al.avail_out&&(f=l.avail_out),f!==0&&c==ve&&(c=H),l.avail_out-=f,l.total_out+=f,l.next_out.set(e.win.subarray(w,w+f),p),p+=f,w+=f,w==e.end&&(w=0,e.write==e.end&&(e.write=0),f=e.write-w,f>l.avail_out&&(f=l.avail_out),f!==0&&c==ve&&(c=H),l.avail_out-=f,l.total_out+=f,l.next_out.set(e.win.subarray(w,w+f),p),p+=f,w+=f),l.next_out_index=p,e.read=w,c},e.proc=function(l,c){let f,p,w,R,b,h,g,E;for(R=l.next_in_index,b=l.avail_in,p=e.bitb,w=e.bitk,h=e.write,g=h>>1){case 0:p>>>=3,w-=3,f=w&7,p>>>=f,w-=f,i=At;break;case 1:C=[],A=[],k=[[]],N=[[]],Nt.inflate_trees_fixed(C,A,k,N),u.init(C[0],A[0],k[0],0,N[0],0),p>>>=3,w-=3,i=at;break;case 2:p>>>=3,w-=3,i=_n;break;case 3:return p>>>=3,w-=3,i=De,l.msg="invalid block type",c=K,e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c)}break;case At:for(;w<32;){if(b!==0)c=H;else return e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);b--,p|=(l.read_byte(R++)&255)<>>16&65535)!=(p&65535))return i=De,l.msg="invalid stored block lengths",c=K,e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);r=p&65535,p=w=0,i=r!==0?pn:m!==0?ot:We;break;case pn:if(b===0||g===0&&(h==e.end&&e.read!==0&&(h=0,g=hb&&(f=b),f>g&&(f=g),e.win.set(l.read_buf(R,f),h),R+=f,b-=f,h+=f,g-=f,(r-=f)!==0)break;i=m!==0?ot:We;break;case _n:for(;w<14;){if(b!==0)c=H;else return e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);b--,p|=(l.read_byte(R++)&255)<29||(f>>5&31)>29)return i=De,l.msg="too many length or distance symbols",c=K,e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);if(f=258+(f&31)+(f>>5&31),!d||d.length>>=14,w-=14,a=0,i=xn;case xn:for(;a<4+(s>>>10);){for(;w<3;){if(b!==0)c=H;else return e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);b--,p|=(l.read_byte(R++)&255)<>>=3,w-=3}for(;a<19;)d[mn[a++]]=0;if(o[0]=7,f=O.inflate_trees_bits(d,o,_,x,l),f!=H)return c=f,c==K&&(d=null,i=De),e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);a=0,i=hn;case hn:for(;f=s,!(a>=258+(f&31)+(f>>5&31));){let M,q;for(f=o[0];w>>=f,w-=f,d[a++]=q;else{for(E=q==18?7:q-14,M=q==18?11:3;w>>=f,w-=f,M+=p&ce[E],p>>>=E,w-=E,E=a,f=s,E+M>258+(f&31)+(f>>5&31)||q==16&&E<1)return d=null,i=De,l.msg="invalid bit length repeat",c=K,e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);q=q==16?d[E-1]:0;do d[E++]=q;while(--M!==0);a=E}}if(_[0]=-1,I=[],Z=[],U=[],L=[],I[0]=9,Z[0]=6,f=s,f=O.inflate_trees_dynamic(257+(f&31),1+(f>>5&31),d,I,Z,U,L,x,l),f!=H)return f==K&&(d=null,i=De),c=f,e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,e.inflate_flush(l,c);u.init(I[0],Z[0],x,U[0],x,L[0]),i=at;case at:if(e.bitb=p,e.bitk=w,l.avail_in=b,l.total_in+=R-l.next_in_index,l.next_in_index=R,e.write=h,(c=u.proc(e,l,c))!=ge)return e.inflate_flush(l,c);if(c=H,u.free(l),R=l.next_in_index,b=l.avail_in,p=e.bitb,w=e.bitk,h=e.write,g=h15?(t.inflateEnd(e),ae):(t.wbits=i,e.istate.blocks=new wr(e,1<>4)+8>a.wbits){a.mode=Se,e.msg="invalid win size",a.marker=5;break}a.mode=bn;case bn:if(e.avail_in===0)return r;if(r=i,e.avail_in--,e.total_in++,s=e.read_byte(e.next_in_index++)&255,((a.method<<8)+s)%31!==0){a.mode=Se,e.msg="incorrect header check",a.marker=5;break}if(!(s&br)){a.mode=Ke;break}a.mode=gn;case gn:if(e.avail_in===0)return r;r=i,e.avail_in--,e.total_in++,a.need=(e.read_byte(e.next_in_index++)&255)<<24&4278190080,a.mode=vn;case vn:if(e.avail_in===0)return r;r=i,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<16&16711680,a.mode=yn;case yn:if(e.avail_in===0)return r;r=i,e.avail_in--,e.total_in++,a.need+=(e.read_byte(e.next_in_index++)&255)<<8&65280,a.mode=kn;case kn:return e.avail_in===0?r:(r=i,e.avail_in--,e.total_in++,a.need+=e.read_byte(e.next_in_index++)&255,a.mode=Rt,ar);case Rt:return a.mode=Se,e.msg="need dictionary",a.marker=0,ae;case Ke:if(r=a.blocks.proc(e,r),r==K){a.mode=Se,a.marker=0;break}if(r==H&&(r=i),r!=ge)return r;r=i,a.blocks.reset(e,a.was),a.mode=En;case En:return e.avail_in=0,ge;case Se:return K;default:return ae}},t.inflateSetDictionary=function(e,i,r){let s=0,a=r;if(!e||!e.istate||e.istate.mode!=Rt)return ae;const d=e.istate;return a>=1<0&&e.next_in_index!=x&&(o(e.next_in_index),x=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return _.length>1?(m=new Uint8Array(O),_.forEach(function(l){m.set(l,y),y+=l.length})):m=_[0]?new Uint8Array(_[0]):new Uint8Array,m}},n.flush=function(){e.inflateEnd()}}const Fe=4294967295,Te=65535,Sr=8,Ar=0,Rr=99,Tr=67324752,Cr=134695760,Sn=33639248,Dr=101010256,An=101075792,Or=117853008,Pe=22,Tt=20,Ct=56,Ir=1,Fr=39169,Lr=10,Ur=1,Nr=21589,Wr=28789,Pr=25461,Mr=6534,Rn=1,Zr=6,Tn=8,Cn=2048,Dn=16,jr="/",xe=void 0,dt="undefined",ei="function";class On{constructor(n){return class extends TransformStream{constructor(e,i){const r=new n(i);super({transform(s,a){a.enqueue(r.append(s))},flush(s){const a=r.flush();a&&s.enqueue(a)}})}}}}const qr=64;let ti=2;try{typeof navigator!=dt&&navigator.hardwareConcurrency&&(ti=navigator.hardwareConcurrency)}catch{}const Br={chunkSize:512*1024,maxWorkers:ti,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:xe,CompressionStreamNative:typeof CompressionStream!=dt&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=dt&&DecompressionStream},Ce=Object.assign({},Br);function Hr(){return Ce}function Yr(t){return Math.max(t.chunkSize,qr)}function Bt(t){const{baseURL:n,chunkSize:e,maxWorkers:i,terminateWorkerTimeout:r,useCompressionStream:s,useWebWorkers:a,Deflate:d,Inflate:o,CompressionStream:_,DecompressionStream:u,workerScripts:m}=t;if(Ae("baseURL",n),Ae("chunkSize",e),Ae("maxWorkers",i),Ae("terminateWorkerTimeout",r),Ae("useCompressionStream",s),Ae("useWebWorkers",a),d&&(Ce.CompressionStream=new On(d)),o&&(Ce.DecompressionStream=new On(o)),Ae("CompressionStream",_),Ae("DecompressionStream",u),m!==xe){const{deflate:x,inflate:y}=m;if((x||y)&&(Ce.workerScripts||(Ce.workerScripts={})),x){if(!Array.isArray(x))throw new Error("workerScripts.deflate must be an array");Ce.workerScripts.deflate=x}if(y){if(!Array.isArray(y))throw new Error("workerScripts.inflate must be an array");Ce.workerScripts.inflate=y}}}function Ae(t,n){n!==xe&&(Ce[t]=n)}const Dt={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const t={};for(const n of Object.keys(Dt))for(const e of Object.keys(Dt[n])){const i=Dt[n][e];if(typeof i=="string")t[i]=n+"/"+e;else for(let r=0;r>>1^3988292384:n=n>>>1;ni[t]=n}class ut{constructor(n){this.crc=n||-1}append(n){let e=this.crc|0;for(let i=0,r=n.length|0;i>>8^ni[(e^n[i])&255];this.crc=e}get(){return~this.crc}}class ii extends TransformStream{constructor(){let n;const e=new ut;super({transform(i,r){e.append(i),r.enqueue(i)},flush(){const i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,e.get()),n.value=i}}),n=this}}function $r(t){if(typeof TextEncoder>"u"){t=unescape(encodeURIComponent(t));const n=new Uint8Array(t.length);for(let e=0;e0&&n&&(t[e-1]=re.partial(n,t[e-1]&2147483648>>n-1,1)),t},partial(t,n,e){return t===32?n:(e?n|0:n<<32-t)+t*1099511627776},getPartial(t){return Math.round(t/1099511627776)||32},_shiftRight(t,n,e,i){for(i===void 0&&(i=[]);n>=32;n-=32)i.push(e),e=0;if(n===0)return i.concat(t);for(let a=0;a>>n),e=t[a]<<32-n;const r=t.length?t[t.length-1]:0,s=re.getPartial(r);return i.push(re.partial(n+s&31,n+s>32?e:i.pop(),1)),i}},mt={bytes:{fromBits(t){const e=re.bitLength(t)/8,i=new Uint8Array(e);let r;for(let s=0;s>>24,r<<=8;return i},toBits(t){const n=[];let e,i=0;for(e=0;e9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const s=new Uint32Array(e);let a=0;for(let d=n.blockSize+i-(n.blockSize+i&n.blockSize-1);d<=r;d+=n.blockSize)n._block(s.subarray(16*a,16*(a+1))),a+=1;return e.splice(0,16*a),n}finalize(){const t=this;let n=t._buffer;const e=t._h;n=re.concat(n,[re.partial(1,1)]);for(let i=n.length+2;i&15;i++)n.push(0);for(n.push(Math.floor(t._length/4294967296)),n.push(t._length|0);n.length;)t._block(n.splice(0,16));return t.reset(),e}_f(t,n,e,i){if(t<=19)return n&e|~n&i;if(t<=39)return n^e^i;if(t<=59)return n&e|n&i|e&i;if(t<=79)return n^e^i}_S(t,n){return n<>>32-t}_block(t){const n=this,e=n._h,i=Array(80);for(let _=0;_<16;_++)i[_]=t[_];let r=e[0],s=e[1],a=e[2],d=e[3],o=e[4];for(let _=0;_<=79;_++){_>=16&&(i[_]=n._S(1,i[_-3]^i[_-8]^i[_-14]^i[_-16]));const u=n._S(5,r)+n._f(_,s,a,d)+o+i[_]+n._key[Math.floor(_/20)]|0;o=d,d=a,a=n._S(30,s),s=r,r=u}e[0]=e[0]+r|0,e[1]=e[1]+s|0,e[2]=e[2]+a|0,e[3]=e[3]+d|0,e[4]=e[4]+o|0}};const si={};si.aes=class{constructor(t){const n=this;n._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],n._tables[0][0][0]||n._precompute();const e=n._tables[0][4],i=n._tables[1],r=t.length;let s,a,d,o=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(n._key=[a=t.slice(0),d=[]],s=r;s<4*r+28;s++){let _=a[s-1];(s%r===0||r===8&&s%r===4)&&(_=e[_>>>24]<<24^e[_>>16&255]<<16^e[_>>8&255]<<8^e[_&255],s%r===0&&(_=_<<8^_>>>24^o<<24,o=o<<1^(o>>7)*283)),a[s]=a[s-r]^_}for(let _=0;s;_++,s--){const u=a[_&3?s:s-4];s<=4||_<4?d[_]=u:d[_]=i[0][e[u>>>24]]^i[1][e[u>>16&255]]^i[2][e[u>>8&255]]^i[3][e[u&255]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],n=this._tables[1],e=t[4],i=n[4],r=[],s=[];let a,d,o,_;for(let u=0;u<256;u++)s[(r[u]=u<<1^(u>>7)*283)^u]=u;for(let u=a=0;!e[u];u^=d||1,a=s[a]||1){let m=a^a<<1^a<<2^a<<3^a<<4;m=m>>8^m&255^99,e[u]=m,i[m]=u,_=r[o=r[d=r[u]]];let x=_*16843009^o*65537^d*257^u*16843008,y=r[m]*257^m*16843008;for(let O=0;O<4;O++)t[O][u]=y=y<<24^y>>>8,n[O][m]=x=x<<24^x>>>8}for(let u=0;u<5;u++)t[u]=t[u].slice(0),n[u]=n[u].slice(0)}_crypt(t,n){if(t.length!==4)throw new Error("invalid aes block size");const e=this._key[n],i=e.length/4-2,r=[0,0,0,0],s=this._tables[n],a=s[0],d=s[1],o=s[2],_=s[3],u=s[4];let m=t[0]^e[0],x=t[n?3:1]^e[1],y=t[2]^e[2],O=t[n?1:3]^e[3],l=4,c,f,p;for(let w=0;w>>24]^d[x>>16&255]^o[y>>8&255]^_[O&255]^e[l],f=a[x>>>24]^d[y>>16&255]^o[O>>8&255]^_[m&255]^e[l+1],p=a[y>>>24]^d[O>>16&255]^o[m>>8&255]^_[x&255]^e[l+2],O=a[O>>>24]^d[m>>16&255]^o[x>>8&255]^_[y&255]^e[l+3],l+=4,m=c,x=f,y=p;for(let w=0;w<4;w++)r[n?3&-w:w]=u[m>>>24]<<24^u[x>>16&255]<<16^u[y>>8&255]<<8^u[O&255]^e[l++],c=m,m=x,x=y,y=O,O=c;return r}};const Kr={getRandomValues(t){const n=new Uint32Array(t.buffer),e=i=>{let r=987654321;const s=4294967295;return function(){return r=36969*(r&65535)+(r>>16)&s,i=18e3*(i&65535)+(i>>16)&s,(((r<<16)+i&s)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,r;i>24&255)===255){let n=t>>16&255,e=t>>8&255,i=t&255;n===255?(n=0,e===255?(e=0,i===255?i=0:++i):++e):++n,t=0,t+=n<<16,t+=e<<8,t+=i}else t+=1<<24;return t}incCounter(t){(t[0]=this.incWord(t[0]))===0&&(t[1]=this.incWord(t[1]))}calculate(t,n,e){let i;if(!(i=n.length))return[];const r=re.bitLength(n);for(let s=0;s>5)+1<<2;let s,a,d,o,_;const u=new ArrayBuffer(r),m=new DataView(u);let x=0;const y=re;for(n=mt.bytes.toBits(n),_=1;x<(r||1);_++){for(s=a=t.encrypt(y.concat(n,[_])),d=1;dr&&(t=new e().update(t).finalize());for(let s=0;sthis.resolveReady=s),password:n,signed:e,strength:i-1,pending:new Uint8Array})},async transform(s,a){const d=this,{password:o,strength:_,resolveReady:u,ready:m}=d;o?(await as(d,_,o,de(s,0,Ge[_]+2)),s=de(s,Ge[_]+2),r?a.error(new Error(Ht)):u()):await m;const x=new Uint8Array(s.length-Re-(s.length-Re)%Me);a.enqueue(pi(d,s,x,0,Re,!0))},async flush(s){const{signed:a,ctr:d,hmac:o,pending:_,ready:u}=this;if(o&&d){await u;const m=de(_,0,_.length-Re),x=de(_,_.length-Re);let y=new Uint8Array;if(m.length){const O=Je(we,m);o.update(O);const l=d.update(O);y=Xe(we,l)}if(a){const O=de(Xe(we,o.digest()),0,Re);for(let l=0;lthis.resolveReady=r),password:n,strength:e-1,pending:new Uint8Array})},async transform(r,s){const a=this,{password:d,strength:o,resolveReady:_,ready:u}=a;let m=new Uint8Array;d?(m=await os(a,o,d),_()):await u;const x=new Uint8Array(m.length+r.length-r.length%Me);x.set(m,0),s.enqueue(pi(a,r,x,m.length,0))},async flush(r){const{ctr:s,hmac:a,pending:d,ready:o}=this;if(a&&s){await o;let _=new Uint8Array;if(d.length){const u=s.update(Je(we,d));a.update(u),_=Xe(we,u)}i.signature=Xe(we,a.digest()).slice(0,Re),r.enqueue(Yt(_,i.signature))}}}),i=this}}function pi(t,n,e,i,r,s){const{ctr:a,hmac:d,pending:o}=t,_=n.length-r;o.length&&(n=Yt(o,n),e=fs(e,_-_%Me));let u;for(u=0;u<=_-Me;u+=Me){const m=Je(we,de(n,u,u+Me));s&&d.update(m);const x=a.update(m);s||d.update(x),e.set(Xe(we,x),u+i)}return t.pending=de(n,u),e}async function as(t,n,e,i){const r=await _i(t,n,e,de(i,0,Ge[n])),s=de(i,Ge[n]);if(r[0]!=s[0]||r[1]!=s[1])throw new Error(oi)}async function os(t,n,e){const i=li(new Uint8Array(Ge[n])),r=await _i(t,n,e,i);return Yt(i,r)}async function _i(t,n,e,i){t.password=null;const r=$r(e),s=await cs(Gr,r,zr,!1,Qr),a=await ls(Object.assign({salt:i},Wt),s,8*(Ve[n]*2+2)),d=new Uint8Array(a),o=Je(we,de(d,0,Ve[n])),_=Je(we,de(d,Ve[n],Ve[n]*2)),u=de(d,Ve[n]*2);return Object.assign(t,{keys:{key:o,authentication:_,passwordVerification:u},ctr:new ns(new ts(o),Array.from(es)),hmac:new is(_)}),u}async function cs(t,n,e,i,r){if(In)try{return await ze.importKey(t,n,e,i,r)}catch{return In=!1,Le.importKey(n)}else return Le.importKey(n)}async function ls(t,n,e){if(Fn)try{return await ze.deriveBits(t,n,e)}catch{return Fn=!1,Le.pbkdf2(n,t.salt,Wt.iterations,e)}else return Le.pbkdf2(n,t.salt,Wt.iterations,e)}function Yt(t,n){let e=t;return t.length+n.length&&(e=new Uint8Array(t.length+n.length),e.set(t,0),e.set(n,t.length)),e}function fs(t,n){if(n&&n>t.length){const e=t;t=new Uint8Array(n),t.set(e,0)}return t}function de(t,n,e){return t.subarray(n,e)}function Xe(t,n){return t.fromBits(n)}function Je(t,n){return t.toBits(n)}const Ze=12;class ds extends TransformStream{constructor({password:n,passwordVerification:e,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:n,passwordVerification:e}),xi(this,n)},transform(r,s){const a=this;if(a.password){const d=Ln(a,r.subarray(0,Ze));if(a.password=null,d[Ze-1]!=a.passwordVerification)throw new Error(oi);r=r.subarray(Ze)}i?s.error(new Error(Ht)):s.enqueue(Ln(a,r))}})}}class us extends TransformStream{constructor({password:n,passwordVerification:e}){super({start(){Object.assign(this,{password:n,passwordVerification:e}),xi(this,n)},transform(i,r){const s=this;let a,d;if(s.password){s.password=null;const o=li(new Uint8Array(Ze));o[Ze-1]=s.passwordVerification,a=new Uint8Array(i.length+o.length),a.set(Un(s,o),0),d=Ze}else a=new Uint8Array(i.length),d=0;a.set(Un(s,i),d),r.enqueue(a)}})}}function Ln(t,n){const e=new Uint8Array(n.length);for(let i=0;i>>24]),r=~t.crcKey2.get(),t.keys=[e,i,r]}function hi(t){const n=t.keys[2]|2;return wi(Math.imul(n,n^1)>>>8)}function wi(t){return t&255}function Nn(t){return t&4294967295}const Wn="deflate-raw";class ms extends TransformStream{constructor(n,{chunkSize:e,CompressionStream:i,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:a,useCompressionStream:d,zipCrypto:o,signed:_,level:u}=n,m=this;let x,y,O=bi(super.readable);(!a||o)&&_&&(x=new ii,O=be(O,x)),s&&(O=vi(O,d,{level:u,chunkSize:e},r,i)),a&&(o?O=be(O,new us(n)):(y=new ss(n),O=be(O,y))),gi(m,O,()=>{let l;a&&!o&&(l=y.signature),(!a||o)&&_&&(l=new DataView(x.value.buffer).getUint32(0)),m.signature=l})}}class ps extends TransformStream{constructor(n,{chunkSize:e,DecompressionStream:i,DecompressionStreamNative:r}){super({});const{zipCrypto:s,encrypted:a,signed:d,signature:o,compressed:_,useCompressionStream:u}=n;let m,x,y=bi(super.readable);a&&(s?y=be(y,new ds(n)):(x=new rs(n),y=be(y,x))),_&&(y=vi(y,u,{chunkSize:e},r,i)),(!a||s)&&d&&(m=new ii,y=be(y,m)),gi(this,y,()=>{if((!a||s)&&d){const O=new DataView(m.value.buffer);if(o!=O.getUint32(0,!1))throw new Error(ci)}})}}function bi(t){return be(t,new TransformStream({transform(n,e){n&&n.length&&e.enqueue(n)}}))}function gi(t,n,e){n=be(n,new TransformStream({flush:e})),Object.defineProperty(t,"readable",{get(){return n}})}function vi(t,n,e,i,r){try{const s=n&&i?i:r;t=be(t,new s(Wn,e))}catch(s){if(n)t=be(t,new r(Wn,e));else throw s}return t}function be(t,n){return t.pipeThrough(n)}const _s="message",xs="start",hs="pull",Pn="data",ws="ack",bs="close",gs="deflate",yi="inflate";class vs extends TransformStream{constructor(n,e){super({});const i=this,{codecType:r}=n;let s;r.startsWith(gs)?s=ms:r.startsWith(yi)&&(s=ps);let a=0;const d=new s(n,e),o=super.readable,_=new TransformStream({transform(u,m){u&&u.length&&(a+=u.length,m.enqueue(u))},flush(){const{signature:u}=d;Object.assign(i,{signature:u,size:a})}});Object.defineProperty(i,"readable",{get(){return o.pipeThrough(d).pipeThrough(_)}})}}const ys=typeof Worker!=dt;class Ot{constructor(n,{readable:e,writable:i},{options:r,config:s,streamOptions:a,useWebWorkers:d,transferStreams:o,scripts:_},u){const{signal:m}=a;return Object.assign(n,{busy:!0,readable:e.pipeThrough(new ks(e,a,s),{signal:m}),writable:i,options:Object.assign({},r),scripts:_,transferStreams:o,terminate(){const{worker:x,busy:y}=n;x&&!y&&(x.terminate(),n.interface=null)},onTaskFinished(){n.busy=!1,u(n)}}),(d&&ys?Ss:Es)(n,s)}}class ks extends TransformStream{constructor(n,{onstart:e,onprogress:i,size:r,onend:s},{chunkSize:a}){let d=0;super({start(){e&&It(e,r)},async transform(o,_){d+=o.length,i&&await It(i,d,r),_.enqueue(o)},flush(){n.size=d,s&&It(s,d)}},{highWaterMark:1,size:()=>a})}}async function It(t,...n){try{await t(...n)}catch{}}function Es(t,n){return{run:()=>As(t,n)}}function Ss(t,{baseURL:n,chunkSize:e}){return t.interface||Object.assign(t,{worker:Cs(t.scripts[0],n,t),interface:{run:()=>Rs(t,{chunkSize:e})}}),t.interface}async function As({options:t,readable:n,writable:e,onTaskFinished:i},r){const s=new vs(t,r);try{await n.pipeThrough(s).pipeTo(e,{preventClose:!0,preventAbort:!0});const{signature:a,size:d}=s;return{signature:a,size:d}}finally{i()}}async function Rs(t,n){let e,i;const r=new Promise((x,y)=>{e=x,i=y});Object.assign(t,{reader:null,writer:null,resolveResult:e,rejectResult:i,result:r});const{readable:s,options:a,scripts:d}=t,{writable:o,closed:_}=Ts(t.writable);Pt({type:xs,scripts:d.slice(1),options:a,config:n,readable:s,writable:o},t)||Object.assign(t,{reader:s.getReader(),writer:o.getWriter()});const m=await r;try{await o.getWriter().close()}catch{}return await _,m}function Ts(t){const n=t.getWriter();let e;const i=new Promise(s=>e=s);return{writable:new WritableStream({async write(s){await n.ready,await n.write(s)},close(){n.releaseLock(),e()},abort(s){return n.abort(s)}}),closed:i}}let Mn=!0,Zn=!0;function Cs(t,n,e){const i={type:"module"};let r,s;typeof t==ei&&(t=t());try{r=new URL(t,n)}catch{r=t}if(Mn)try{s=new Worker(r)}catch{Mn=!1,s=new Worker(r,i)}else s=new Worker(r,i);return s.addEventListener(_s,a=>Ds(a,e)),s}function Pt(t,{worker:n,writer:e,onTaskFinished:i,transferStreams:r}){try{let{value:s,readable:a,writable:d}=t;const o=[];if(s&&(s.byteLength!p.busy);if(c)qn(c),l=new Ot(c,t,n,f);else if(Oe.lengthFt.push({resolve:p,stream:t,workerOptions:n}));return l.run();function f(p){if(Ft.length){const[{resolve:w,stream:R,workerOptions:b}]=Ft.splice(0,1);w(new Ot(p,R,b,f))}else p.worker?(qn(p),Number.isFinite(y)&&y>=0&&(p.terminateTimeout=setTimeout(()=>{Oe=Oe.filter(w=>w!=p),p.terminate()},y))):Oe=Oe.filter(w=>w!=p)}}function qn(t){const{terminateTimeout:n}=t;n&&(clearTimeout(n),t.terminateTimeout=null)}function Is(t){const n=()=>URL.createObjectURL(new Blob([`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self;class k{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const v=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;v[e]=t}class S{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^v[255&(t^e[n])];this.t=t}get(){return~this.t}}class z extends p{constructor(){let e;const t=new S;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const C={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=C.i(n);return 32===r?e.concat(t):C.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+C.i(n)},u(e,t){if(32*e.length0&&t&&(e[n-1]=C.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=C.i(s);return r.push(C.h(t+i&31,t+i>32?n:r.pop(),1)),r}},x={p:{m(e){const t=C.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)0==(3&s)&&(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},g(e){const t=[];let n,r=0;for(n=0;n9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.I(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.C;const n=e.S;t=C.concat(t,[C.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.I(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}P(e,t){return t<>>32-e}I(t){const n=this,s=n.S,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.P(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.P(5,o)+n.V(e,c,f,a)+l+i[e]+n.v[r.floor(e/20)]|0;l=a,a=f,f=n.P(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},A={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;inew I.R(x.p.g(e)),B(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=C;for(t=x.p.g(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;ad&&fs&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.U[0].update(r[0]),t.U[1].update(r[1]),t.K=new n(t.U[0])}reset(){const e=this;e.K=new e.M(e.U[0]),e.N=!1}update(e){this.N=!0,this.K.update(e)}digest(){const e=this,t=e.K.D(),n=new e.M(e.U[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.N)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},D=void 0!==h&&"function"==typeof h.getRandomValues,V="Invalid password",P="Invalid signature",R="zipjs-abort-check-password";function B(e){return D?h.getRandomValues(e):A.getRandomValues(e)}const E=16,M={name:"PBKDF2"},U=t.assign({hash:{name:"HMAC"}},M),K=t.assign({iterations:1e3,hash:{name:"SHA-1"}},M),N=["deriveBits"],O=[8,12,16],T=[16,24,32],W=10,j=[0,0,0,0],H="undefined",L="function",F=typeof h!=H,q=F&&h.subtle,G=F&&typeof q!=H,J=x.p,Q=class{constructor(e){const t=this;t.O=[[[],[],[],[],[]],[[],[],[],[],[]]],t.O[0][0][0]||t.T();const n=t.O[0][4],r=t.O[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.v=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.W(e,0)}decrypt(e){return this.W(e,1)}T(){const e=this.O[0],t=this.O[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}W(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.v[t],r=n.length/4-2,i=[0,0,0,0],o=this.O[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},X=class{constructor(e,t){this.j=e,this.H=t,this.L=t}reset(){this.L=this.H}update(e){return this.F(this.j,e,this.L)}q(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}G(e){0===(e[0]=this.q(e[0]))&&(e[1]=this.q(e[1]))}F(e,t,n){let r;if(!(r=t.length))return[];const s=C.l(t);for(let s=0;r>s;s+=4){this.G(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return C.u(t,s)}},Y=I.R;let Z=F&&G&&typeof q.importKey==L,$=F&&G&&typeof q.deriveBits==L;class ee extends p{constructor({password:e,signed:n,encryptionStrength:r,checkPasswordOnly:o}){super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:e,signed:n,X:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:c,J:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await re(e,t,n,ie(r,0,O[t])),o=ie(r,O[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(V)})(n,c,r,ie(e,0,O[c]+2)),e=ie(e,O[c]+2),o?t.error(new s(R)):f()):await a;const l=new i(e.length-W-(e.length-W)%E);t.enqueue(ne(n,e,l,0,W,!0))},async flush(e){const{signed:t,Y:n,Z:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ie(o,0,o.length-W),a=ie(o,o.length-W);let l=new i;if(f.length){const e=ce(J,f);r.update(e);const t=n.update(e);l=oe(J,t)}if(t){const e=ie(oe(J,r.digest()),0,W);for(let t=0;W>t;t++)if(e[t]!=a[t])throw new s(P)}e.enqueue(l)}}})}}class te extends p{constructor({password:e,encryptionStrength:n}){let r;super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:e,X:n-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:s,J:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=B(new i(O[t]));return se(r,await re(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%E);a.set(f,0),t.enqueue(ne(n,e,a,f.length,0))},async flush(e){const{Y:t,Z:n,pending:s,ready:o}=this;if(n&&t){await o;let c=new i;if(s.length){const e=t.update(ce(J,s));n.update(e),c=oe(J,e)}r.signature=oe(J,n.digest()).slice(0,W),e.enqueue(se(c,r.signature))}}}),r=this}}function ne(e,t,n,r,s,o){const{Y:c,Z:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=se(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%E)),u=0;l-E>=u;u+=E){const e=ce(J,ie(t,u,u+E));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(oe(J,s),u+r)}return e.pending=ie(t,u),n}async function re(n,r,s,o){n.password=null;const c=(e=>{if(void 0===w){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n{if(!Z)return I.importKey(t);try{return await q.importKey("raw",t,n,!1,s)}catch(e){return Z=!1,I.importKey(t)}})(0,c,U,0,N),a=await(async(e,t,n)=>{if(!$)return I.B(t,e.salt,K.iterations,n);try{return await q.deriveBits(e,t,n)}catch(r){return $=!1,I.B(t,e.salt,K.iterations,n)}})(t.assign({salt:o},K),f,8*(2*T[r]+2)),l=new i(a),u=ce(J,ie(l,0,T[r])),h=ce(J,ie(l,T[r],2*T[r])),d=ie(l,2*T[r]);return t.assign(n,{keys:{key:u,$:h,passwordVerification:d},Y:new X(new Q(u),e.from(j)),Z:new Y(h)}),d}function se(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ie(e,t,n){return e.subarray(t,n)}function oe(e,t){return e.m(t)}function ce(e,t){return e.g(t)}class fe extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),we(this,e)},transform(e,t){const n=this;if(n.password){const t=le(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(V);e=e.subarray(12)}r?t.error(new s(R)):t.enqueue(le(n,e))}})}}class ae extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),we(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=B(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(ue(n,t),0),s=12}else r=new i(e.length),s=0;r.set(ue(n,e),s),t.enqueue(r)}})}}function le(e,t){const n=new i(t.length);for(let r=0;r>>24]),i=~e.te.get(),e.keys=[n,s,i]}function de(e){const t=2|e.keys[2];return pe(r.imul(t,1^t)>>>8)}function pe(e){return 255&e}function ye(e){return 4294967295&e}const me="deflate-raw";class be extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=ke(super.readable);i&&!c||!f||(w=new z,d=ze(d,w)),s&&(d=Se(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=ze(d,new ae(e)):(h=new te(e),d=ze(d,h))),ve(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ge extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=ke(super.readable);o&&(i?d=ze(d,new fe(e)):(h=new ee(e),d=ze(d,h))),a&&(d=Se(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new z,d=ze(d,w)),ve(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(P)}}))}}function ke(e){return ze(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ve(e,n,r){n=ze(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Se(e,t,n,r,s){try{e=ze(e,new(t&&r?r:s)(me,n))}catch(r){if(!t)throw r;e=ze(e,new s(me,n))}return e}function ze(e,t){return e.pipeThrough(t)}const Ce="data";class xe extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=be:s.startsWith("inflate")&&(i=ge);let o=0;const c=new i(e,n),f=super.readable,a=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=c;t.assign(r,{signature:e,size:o})}});t.defineProperty(r,"readable",{get:()=>f.pipeThrough(c).pipeThrough(a)})}}const _e=new a,Ae=new a;let Ie=0;async function De(e){try{const{options:t,scripts:r,config:s}=e;r&&r.length&&importScripts.apply(void 0,r),self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new k(self.Deflate)),self.Inflate&&(s.DecompressionStream=new k(self.Inflate));const i={highWaterMark:1,size:()=>s.chunkSize},o=e.readable||new y({async pull(e){const t=new u((e=>_e.set(Ie,e)));Ve({type:"pull",messageId:Ie}),Ie=(Ie+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ae.set(Ie,t),Ve({type:Ce,value:e,messageId:Ie}),Ie=(Ie+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new xe(t,s);await o.pipeThrough(f).pipeTo(c,{preventClose:!0,preventAbort:!0});try{await c.getWriter().close()}catch(e){}const{signature:a,size:l}=f;Ve({type:"close",result:{signature:a,size:l}})}catch(e){Pe(e)}}function Ve(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Pe(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&De(e),t==Ce){const e=_e.get(n);_e.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ae.get(n);Ae.delete(n),e()}}catch(e){Pe(e)}}));const Re=-2;function Be(t){return Ee(t.map((([t,n])=>new e(t).fill(n,0,t))))}function Ee(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?Ee(n):n)),[])}const Me=[0,1,2,3].concat(...Be([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Ue(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.ne=n=>{const s=e.re,i=e.ie.se,o=e.ie.oe;let c,f,a,l=-1;for(n.ce=0,n.fe=573,c=0;o>c;c++)0!==s[2*c]?(n.ae[++n.ce]=l=c,n.le[c]=0):s[2*c+1]=0;for(;2>n.ce;)a=n.ae[++n.ce]=2>l?++l:0,s[2*a]=1,n.le[a]=0,n.ue--,i&&(n.we-=i[2*a+1]);for(e.he=l,c=r.floor(n.ce/2);c>=1;c--)n.de(s,c);a=o;do{c=n.ae[1],n.ae[1]=n.ae[n.ce--],n.de(s,1),f=n.ae[1],n.ae[--n.fe]=c,n.ae[--n.fe]=f,s[2*a]=s[2*c]+s[2*f],n.le[a]=r.max(n.le[c],n.le[f])+1,s[2*c+1]=s[2*f+1]=a,n.ae[1]=a++,n.de(s,1)}while(n.ce>=2);n.ae[--n.fe]=n.ae[1],(t=>{const n=e.re,r=e.ie.se,s=e.ie.pe,i=e.ie.ye,o=e.ie.me;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.be[l]=0;for(n[2*t.ae[t.fe]+1]=0,c=t.fe+1;573>c;c++)f=t.ae[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.he||(t.be[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.ue+=w*(l+u),r&&(t.we+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.be[l];)l--;t.be[l]--,t.be[l+1]+=2,t.be[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.be[l];0!==f;)a=t.ae[--c],a>e.he||(n[2*a+1]!=l&&(t.ue+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.he,n.be)}}function Ke(e,t,n,r,s){const i=this;i.se=e,i.pe=t,i.ye=n,i.oe=r,i.me=s}Ue.ge=[0,1,2,3,4,5,6,7].concat(...Be([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),Ue.ke=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],Ue.ve=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Ue.Se=e=>256>e?Me[e]:Me[256+(e>>>7)],Ue.ze=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ue.Ce=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ue.xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ue._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Ne=Be([[144,8],[112,9],[24,7],[8,8]]);Ke.Ae=Ee([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Ne[t]])));const Oe=Be([[30,5]]);function Te(e,t,n,r,s){const i=this;i.Ie=e,i.De=t,i.Ve=n,i.Pe=r,i.Re=s}Ke.Be=Ee([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,Oe[t]]))),Ke.Ee=new Ke(Ke.Ae,Ue.ze,257,286,15),Ke.Me=new Ke(Ke.Be,Ue.Ce,0,30,15),Ke.Ue=new Ke(null,Ue.xe,0,19,7);const We=[new Te(0,0,0,0,0),new Te(4,4,8,4,1),new Te(4,5,16,8,1),new Te(4,6,32,32,1),new Te(4,4,16,16,2),new Te(8,16,32,32,2),new Te(8,16,128,128,2),new Te(8,32,128,256,2),new Te(32,128,258,1024,2),new Te(32,258,258,4096,2)],je=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],He=113,Le=666,Fe=262;function qe(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function Ge(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,_,A,I,D,V,P,R,B,E,M,U;const K=new Ue,N=new Ue,O=new Ue;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.ue=e.we=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++ii?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ke[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<>>16-F,F+=r-16):(L|=e<=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Ne[W]=t,e.Oe[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(Ue.ge[n]+256+1)]++,M[2*Ue.Se(t)]++),0==(8191&W)&&V>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+Ue.Ce[o]);if(s>>>=3,jc);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ke.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;V>0?(K.ne(e),N.ne(e),o=(()=>{let t;for(G(E,K.he),G(M,N.he),O.ne(e),t=18;t>=3&&0===U[2*Ue._e[t]+1];t--);return e.ue+=14+3*(t+1),t})(),s=e.ue+3+7>>>3,i=e.we+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Ke.Ae,Ke.Be)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*Ue._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.he+1,N.he+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.Te()}function ie(){let e,n,r,s;do{if(s=w-_-C,0===s&&0===C&&0===_)s=f;else if(-1==s)s--;else if(C>=f+f-Fe){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.We)return;e=t.je(u,C+_,s),_+=e,3>_||(p=255&u[C],p=(p<_&&0!==t.We)}function oe(e){let t,n,r=I,s=C,i=A;const o=C>f-Fe?C-(f-Fe):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>A||(r>>=2),c>_&&(c=_);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>_?_:i}e.le=[],e.be=[],e.ae=[],E=[],M=[],U=[],e.de=(t,n)=>{const r=e.ae,s=r[n];let i=n<<1;for(;i<=e.ce&&(i(W||(W=8),j||(j=8),G||(G=0),t.Le=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Re:(t.Fe=e,a=x,f=1<(t.qe=t.Ge=0,t.Le=null,e.pending=0,e.Je=0,n=He,c=0,K.re=E,K.ie=Ke.Ee,N.re=M,N.ie=Ke.Me,O.re=U,O.ie=Ke.Ue,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;D=We[V].De,R=We[V].Ie,B=We[V].Ve,I=We[V].Pe,C=0,k=0,_=0,v=A=2,z=0,p=0})(),0))(t))),e.Qe=()=>42!=n&&n!=He&&n!=Le?Re:(e.Oe=null,e.Ne=null,e.Ke=null,d=null,h=null,u=null,e.Fe=null,n==He?-3:0),e.Xe=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Re:(We[V].Re!=We[t].Re&&0!==e.qe&&(r=e.Ye(1)),V!=t&&(V=t,D=We[V].De,R=We[V].Ie,B=We[V].Ve,I=We[V].Pe),P=n,r)},e.Ze=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Re;if(3>i)return 0;for(i>f-Fe&&(i=f-Fe,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<=s;s++)p=(p<{let o,w,m,I,R;if(i>4||0>i)return Re;if(!r.$e||!r.et&&0!==r.We||n==Le&&4!=i)return r.Le=je[4],Re;if(0===r.tt)return r.Le=je[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(V-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=He,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.Te(),0===t.tt)return c=-1,0}else if(0===t.We&&I>=i&&4!=i)return t.Le=je[7],-5;if(n==Le&&0!==t.We)return r.Le=je[7],-5;if(0!==t.We||0!==_||0!=i&&n!=Le){switch(R=-1,We[V].Re){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=_){if(ie(),0===_&&0==e)return 0;if(0===_)break}if(C+=_,_=0,n=k+r,(0===C||C>=n)&&(_=C-n,C=n,se(!1),0===t.tt))return 0;if(C-k>=f-Fe&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Fe>_){if(ie(),Fe>_&&0==e)return 0;if(0===_)break}if(3>_||(p=(p<f-Fe||2!=P&&(v=oe(r)),3>v)n=ee(0,255&u[C]),_--,C++;else if(n=ee(C-x,v-3),_-=v,v>D||3>_)C+=v,v=0,p=255&u[C],p=(p<{let n,r,s=0;for(;;){if(Fe>_){if(ie(),Fe>_&&0==e)return 0;if(0===_)break}if(3>_||(p=(p<A&&f-Fe>=(C-s&65535)&&(2!=P&&(v=oe(s)),5>=v&&(1==P||3==v&&C-x>4096)&&(v=2)),3>A||v>A)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,_--,0===t.tt)return 0}else z=1,C++,_--;else{r=C+_-3,n=ee(C-1-S,A-3),_-=A-1,A-=2;do{++C>r||(p=(p<1+H+10-F&&(X(2,3),Y(256,Ke.Ae),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.Te(),0===t.tt)return c=-1,0}}return 4!=i?0:1}}function Je(){const e=this;e.nt=0,e.rt=0,e.We=0,e.qe=0,e.tt=0,e.Ge=0}function Qe(e){const t=new Je,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.He(f),t.$e=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,o=t.Ye(0),0!=o)throw new s("deflating: "+t.Le);t.rt&&(t.rt==n?w.push(new i(c)):w.push(c.subarray(0,t.rt))),u+=t.rt,r&&t.nt>0&&t.nt!=a&&(r(t.nt),a=t.nt)}while(t.We>0||0===t.tt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.rt=0,t.tt=n,e=t.Ye(4),1!=e&&0!=e)throw new s("deflating: "+t.Le);n-t.tt>0&&a.push(c.slice(0,t.rt)),f+=t.rt}while(t.We>0||0===t.tt);return t.Qe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}Je.prototype={He(e,t){const n=this;return n.Fe=new Ge,t||(t=15),n.Fe.He(n,e,t)},Ye(e){const t=this;return t.Fe?t.Fe.Ye(t,e):Re},Qe(){const e=this;if(!e.Fe)return Re;const t=e.Fe.Qe();return e.Fe=null,t},Xe(e,t){const n=this;return n.Fe?n.Fe.Xe(n,e,t):Re},Ze(e,t){const n=this;return n.Fe?n.Fe.Ze(n,e,t):Re},je(e,t,n){const r=this;let s=r.We;return s>n&&(s=n),0===s?0:(r.We-=s,e.set(r.et.subarray(r.nt,r.nt+s),t),r.nt+=s,r.qe+=s,s)},Te(){const e=this;let t=e.Fe.pending;t>e.tt&&(t=e.tt),0!==t&&(e.$e.set(e.Fe.Ke.subarray(e.Fe.Je,e.Fe.Je+t),e.rt),e.rt+=t,e.Fe.Je+=t,e.Ge+=t,e.tt-=t,e.Fe.pending-=t,0===e.Fe.pending&&(e.Fe.Je=0))}};const Xe=-2,Ye=-3,Ze=-5,$e=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],et=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],tt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],nt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],rt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],st=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],it=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ot(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,_,A,I,D;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<k;k++,I<<=1)if(0>(I-=n[k]))return Ye;if(0>(I-=n[g]))return Ye;for(n[g]+=I,i[1]=k=0,C=1,A=2;0!=--g;)i[A]=k+=n[C],A++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g=v;v++)for(p=n[v];0!=p--;){for(;v>_+S;){if(b++,_+=S,D=m-_,D=D>S?S:D,(y=1<<(k=v-_))>p+1&&(y-=p+1,A=v,D>k))for(;++kn[++A];)y-=n[A];if(D=1<1440)return Ye;s[b]=x=h[0],h[0]+=D,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>_-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-_,o>C?d[C]d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<>>_;D>k;k+=y)w.set(r,3*(x+k));for(k=1<>>=1)g^=k;for(g^=k,z=(1<<_)-1;(g&z)!=i[b];)b--,_-=S,z=(1<<_)-1}return 0!==I&&1!=m?Ze:0}function c(o){let c;for(e||(e=[],t=[],n=new f(16),r=[],s=new f(15),i=new f(16)),t.lengthc;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.st=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==Ye?f.Le="oversubscribed dynamic bit lengths tree":a!=Ze&&0!==r[0]||(f.Le="incomplete dynamic bit lengths tree",a=Ye),a},this.it=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,nt,rt,a,i,u,e,t),0!=h||0===i[0]?(h==Ye?w.Le="oversubscribed literal/length tree":-4!=h&&(w.Le="incomplete literal/length tree",h=Ye),h):(c(288),h=o(s,n,r,0,st,it,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==Ye?w.Le="oversubscribed distance tree":h==Ze?(w.Le="incomplete distance tree",h=Ye):-4!=h&&(w.Le="empty distance tree with lengths",h=Ye),h):0)}}function ct(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.nt,p=c.We,w=o.ot,h=o.ct,y=o.write,m=yh;)p--,w|=(255&c.ft(d++))<>=a[z+1],h-=a[z+1],0!=(16&u)){for(u&=15,k=a[z+2]+(w&$e[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ft(d++))<>=a[z+1],h-=a[z+1],0!=(16&u)){for(u&=15;u>h;)p--,w|=(255&c.ft(d++))<>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--u);else o.lt.set(o.lt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.lt[y++]=o.lt[S++],o.lt[y++]=o.lt[S++],k-=2):(o.lt.set(o.lt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--k);else o.lt.set(o.lt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(0!=(64&u))return c.Le="invalid distance code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,Ye;f+=a[z+2],f+=w&$e[u],z=3*(l+f),u=a[z]}break}if(0!=(64&u))return 0!=(32&u)?(k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,1):(c.Le="invalid literal/length code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,Ye);if(f+=a[z+2],f+=w&$e[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ut=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,_=0,A=0;for(A=y.nt,v=y.We,x=e.ot,_=e.ct,S=e.write,z=S=258&&v>=10&&(e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,m=p(u,w,r,h,s,d,e,y),A=y.nt,v=y.We,x=e.ot,_=e.ct,S=e.write,z=S_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}if(g=3*(o+(x&$e[b])),x>>>=n[g+1],_-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(0!=(16&k)){a=15&k,i=n[g+2],t=2;break}if(0==(64&k)){c=k,o=g/3+n[g+2];break}if(0!=(32&k)){t=7;break}return t=9,y.Le="invalid literal/length code",m=Ye,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);case 2:for(b=a;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}i+=x&$e[b],x>>=b,_-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}if(g=3*(o+(x&$e[b])),x>>=n[g+1],_-=n[g+1],k=n[g],0!=(16&k)){a=15&k,l=n[g+2],t=4;break}if(0==(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Le="invalid distance code",m=Ye,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);case 4:for(b=a;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}l+=x&$e[b],x>>=b,_-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S7&&(_-=8,v++,A--),e.write=S,m=e.wt(y,m),S=e.write,z=S{}}ot.dt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=et,r[0]=tt,0);const ft=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function at(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new ct;let h=0,d=new f(4320);const p=new ot;n.ct=0,n.ot=0,n.lt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.ht(e),s=0,n.ct=0,n.ot=0,n.read=n.write=0},n.reset(e,null),n.wt=(e,t)=>{let r,s,i;return s=e.rt,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.tt&&(r=e.tt),0!==r&&t==Ze&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.tt&&(r=e.tt),0!==r&&t==Ze&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r),e.rt=s,n.read=i,t},n.ut=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=gy;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ot.dt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Le="invalid block type",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>16&65535)!=(65535&f))return s=9,e.Le="invalid stored block lengths",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=gb&&(i=b),i>k&&(i=k),n.lt.set(e.je(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<29||(i>>5&31)>29)return s=9,e.Le="too many length or distance symbols",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.lengthv;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>=3,y-=3}for(;19>a;)r[ft[a++]]=0;if(l[0]=7,i=p.st(r,l,u,d,e),0!=i)return(t=i)==Ye&&(r=null,s=9),n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<>>=i,y-=i,o+=f&$e[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Le="invalid bit length repeat",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,_=[],A=[],I=[],D=[],_[0]=9,A[0]=6,i=c,i=p.it(257+(31&i),1+(i>>5&31),r,_,A,I,D,d,e),0!=i)return i==Ye&&(r=null,s=9),t=i,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w.init(_[0],A[0],d,I[0],d,D[0]),s=6;case 6:if(n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,1!=(t=w.ut(n,e,t)))return n.wt(e,t);if(t=0,w.ht(e),m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g{n.reset(e,null),n.lt=null,d=null},n.yt=(e,t,r)=>{n.lt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.bt=()=>1==s?1:0}const lt=13,ut=[0,0,255,255];function wt(){const e=this;function t(e){return e&&e.gt?(e.qe=e.Ge=0,e.Le=null,e.gt.mode=7,e.gt.kt.reset(e,null),0):Xe}e.mode=0,e.method=0,e.vt=[0],e.St=0,e.marker=0,e.zt=0,e.Ct=t=>(e.kt&&e.kt.ht(t),e.kt=null,0),e.xt=(n,r)=>(n.Le=null,e.kt=null,8>r||r>15?(e.Ct(n),Xe):(e.zt=r,n.gt.kt=new at(n,1<{let n,r;if(!e||!e.gt||!e.et)return Xe;const s=e.gt;for(t=4==t?Ze:0,n=Ze;;)switch(s.mode){case 0:if(0===e.We)return n;if(n=t,e.We--,e.qe++,8!=(15&(s.method=e.ft(e.nt++)))){s.mode=lt,e.Le="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.zt){s.mode=lt,e.Le="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.We)return n;if(n=t,e.We--,e.qe++,r=255&e.ft(e.nt++),((s.method<<8)+r)%31!=0){s.mode=lt,e.Le="incorrect header check",s.marker=5;break}if(0==(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St=(255&e.ft(e.nt++))<<24&4278190080,s.mode=3;case 3:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<16&16711680,s.mode=4;case 4:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<8&65280,s.mode=5;case 5:return 0===e.We?n:(n=t,e.We--,e.qe++,s.St+=255&e.ft(e.nt++),s.mode=6,2);case 6:return s.mode=lt,e.Le="need dictionary",s.marker=0,Xe;case 7:if(n=s.kt.ut(e,n),n==Ye){s.mode=lt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.kt.reset(e,s.vt),s.mode=12;case 12:return e.We=0,1;case lt:return Ye;default:return Xe}},e.At=(e,t,n)=>{let r=0,s=n;if(!e||!e.gt||6!=e.gt.mode)return Xe;const i=e.gt;return s<1<{let n,r,s,i,o;if(!e||!e.gt)return Xe;const c=e.gt;if(c.mode!=lt&&(c.mode=lt,c.marker=0),0===(n=e.We))return Ze;for(r=e.nt,s=c.marker;0!==n&&4>s;)e.ft(r)==ut[s]?s++:s=0!==e.ft(r)?0:4-s,r++,n--;return e.qe+=r-e.nt,e.nt=r,e.We=n,c.marker=s,4!=s?Ye:(i=e.qe,o=e.Ge,t(e),e.qe=i,e.Ge=o,c.mode=7,0)},e.Dt=e=>e&&e.gt&&e.gt.kt?e.gt.kt.bt():Xe}function ht(){}function dt(e){const t=new ht,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.xt(),t.$e=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,0!==t.We||c||(t.nt=0,c=!0),a=t._t(0),c&&a===Ze){if(0!==t.We)throw new s("inflating: bad input")}else if(0!==a&&1!==a)throw new s("inflating: "+t.Le);if((c||1===a)&&t.We===e.length)throw new s("inflating: bad input");t.rt&&(t.rt===n?f.push(new i(o)):f.push(o.subarray(0,t.rt))),h+=t.rt,r&&t.nt>0&&t.nt!=u&&(r(t.nt),u=t.nt)}while(t.We>0||0===t.tt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.Ct()}}ht.prototype={xt(e){const t=this;return t.gt=new wt,e||(e=15),t.gt.xt(t,e)},_t(e){const t=this;return t.gt?t.gt._t(t,e):Xe},Ct(){const e=this;if(!e.gt)return Xe;const t=e.gt.Ct(e);return e.gt=null,t},It(){const e=this;return e.gt?e.gt.It(e):Xe},At(e,t){const n=this;return n.gt?n.gt.At(n,e,t):Xe},ft(e){return this.et[e]},je(e,t){return this.et.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=Qe,self.Inflate=dt}; +`],{type:"text/javascript"}));t({workerScripts:{inflate:[n],deflate:[n]}})}const Fs="Writer iterator completed too soon",Ls="Content-Type",Us=64*1024,ki="writable";class Kt{constructor(){this.size=0}init(){this.initialized=!0}}class Ei extends Kt{get readable(){const n=this,{chunkSize:e=Us}=n,i=new ReadableStream({start(){this.chunkOffset=0},async pull(r){const{offset:s=0,size:a,diskNumberStart:d}=i,{chunkOffset:o}=this;r.enqueue(await ee(n,s+o,Math.min(e,a-o),d)),o+e>a?r.close():this.chunkOffset+=e}});return i}}class Ns extends Ei{constructor(n){super(),Object.assign(this,{blob:n,size:n.size})}async readUint8Array(n,e){const i=this,r=n+e;let a=await(n||re&&(a=a.slice(n,r)),new Uint8Array(a)}}class ma extends Kt{constructor(n){super();const e=this,i=new TransformStream,r=[];n&&r.push([Ls,n]),Object.defineProperty(e,ki,{get(){return i.writable}}),e.blob=new Response(i.readable,{headers:r}).blob()}getData(){return this.blob}}class Ws extends Ei{constructor(n){super(),this.readers=n}async init(){const n=this,{readers:e}=n;n.lastDiskNumber=0,n.lastDiskOffset=0,await Promise.all(e.map(async(i,r)=>{await i.init(),r!=e.length-1&&(n.lastDiskOffset+=i.size),n.size+=i.size})),super.init()}async readUint8Array(n,e,i=0){const r=this,{readers:s}=this;let a,d=i;d==-1&&(d=s.length-1);let o=n;for(;o>=s[d].size;)o-=s[d].size,d++;const _=s[d],u=_.size;if(o+e<=u)a=await ee(_,o,e);else{const m=u-o;a=new Uint8Array(e),a.set(await ee(_,o,m)),a.set(await r.readUint8Array(n+m,e-m,i),m)}return r.lastDiskNumber=Math.max(d,r.lastDiskNumber),a}}class Bn extends Kt{constructor(n,e=4294967295){super();const i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});let r,s,a;const d=new WritableStream({async write(u){const{availableSize:m}=i;if(a)u.length>=m?(await o(u.slice(0,m)),await _(),i.diskOffset+=r.size,i.diskNumber++,a=null,await this.write(u.slice(m))):await o(u);else{const{value:x,done:y}=await n.next();if(y&&!x)throw new Error(Fs);r=x,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await pt(r),s=x.writable,a=s.getWriter(),await this.write(u)}},async close(){await a.ready,await _()}});Object.defineProperty(i,ki,{get(){return d}});async function o(u){const m=u.length;m&&(await a.ready,await a.write(u),r.size+=m,i.size+=m,i.availableSize-=m)}async function _(){s.size=r.size,await a.close()}}}async function pt(t,n){t.init&&!t.initialized&&await t.init(n)}function Ps(t){return Array.isArray(t)&&(t=new Ws(t)),t instanceof ReadableStream&&(t={readable:t}),t}function Ms(t){t.writable===xe&&typeof t.next==ei&&(t=new Bn(t)),t instanceof WritableStream&&(t={writable:t});const{writable:n}=t;return n.size===xe&&(n.size=0),t instanceof Bn||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}function ee(t,n,e,i){return t.readUint8Array(n,e,i)}const Si="\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(""),Zs=Si.length==256;function js(t){if(Zs){let n="";for(let e=0;ethis[e]=n[e])}}const Lt="File format is not recognized",Gs="End of central directory not found",Xs="End of Zip64 central directory not found",Js="End of Zip64 central directory locator not found",zs="Central directory header not found",Qs="Local file header not found",ea="Zip64 extra field not found",ta="File contains encrypted entry",na="Encryption method not supported",Yn="Compression method not supported",$n="Split zip file",Kn="utf-8",Vn="cp437",ia=[[Di,Fe],[Oi,Fe],[Ii,Fe],[Zt,Te]],ra={[Te]:{getValue:G,bytes:4},[Fe]:{getValue:ft,bytes:8}};class pa{constructor(n,e={}){Object.assign(this,{reader:Ps(n),options:e,config:Hr()})}async*getEntriesGenerator(n={}){const e=this;let{reader:i}=e;const{config:r}=e;if(await pt(i),(i.size===xe||!i.readUint8Array)&&(i=new Ns(await new Response(i.readable).blob()),await pt(i)),i.size=i.size&&(c=i.size-o-d-Pe,o=i.size-d-Pe),y!=x)throw new Error($n);if(o<0)throw new Error(Lt);let p=0,w=await ee(i,o,d,O),R=z(w);if(d){const A=s.offset-d;if(G(R,p)!=Sn&&o!=A){const k=o;o=A,c+=o-k,w=await ee(i,o,d,O),R=z(w)}}const b=s.offset-o-(i.lastDiskOffset||0);if(d!=b&&b>=0&&(d=b,w=await ee(i,o,d,O),R=z(w)),o<0||o>=i.size)throw new Error(Lt);const h=fe(e,n,"filenameEncoding"),g=fe(e,n,"commentEncoding");for(let A=0;Ak.getData(qe,Ue,bt),p=P;const{onprogress:Qe}=n;if(Qe)try{await Qe(A+1,l,new Hn(k))}catch{}yield Ue}const E=fe(e,n,"extractPrependedData"),C=fe(e,n,"extractAppendedData");return E&&(e.prependedData=f>0?await ee(i,0,f):new Uint8Array),e.comment=u?await ee(i,_+Pe,u):new Uint8Array,C&&(e.appendedData=m>>8&255:x>>>24&255),signature:x,compressed:_!=0,encrypted:R,useWebWorkers:fe(r,i,"useWebWorkers"),useCompressionStream:fe(r,i,"useCompressionStream"),transferStreams:fe(r,i,"transferStreams"),checkPasswordOnly:A},config:u,streamOptions:{signal:C,size:g,onstart:N,onprogress:I,onend:Z}};let L=0;try{({outputSize:L}=await Os({readable:E,writable:k},U))}catch(M){if(!A||M.message!=Ht)throw M}finally{const M=fe(r,i,"preventClose");k.size+=L,!M&&!k.locked&&await k.getWriter().close()}return A?void 0:n.getData?n.getData():k}}function Ui(t,n,e){const i=t.rawBitFlag=J(n,e+2),r=(i&Rn)==Rn,s=G(n,e+6);Object.assign(t,{encrypted:r,version:J(n,e),bitFlag:{level:(i&Zr)>>1,dataDescriptor:(i&Tn)==Tn,languageEncodingFlag:(i&Cn)==Cn},rawLastModDate:s,lastModDate:da(s),filenameLength:J(n,e+22),extraFieldLength:J(n,e+24)})}async function Ni(t,n,e,i,r){const{rawExtraField:s}=n,a=n.extraField=new Map,d=z(new Uint8Array(s));let o=0;try{for(;on[r]==s);for(let r=0,s=0;r=5&&(s.push(jt),a.push(qt));let d=1;s.forEach((o,_)=>{if(t.data.length>=d+4){const u=G(i,d);n[o]=t[o]=new Date(u*1e3);const m=a[_];t[m]=u}d+=4})}async function fa(t,n,e,i,r){const s=new Uint8Array(4),a=z(s);ua(a,0,n);const d=i+r;return await o(i)||await o(Math.min(d,e));async function o(_){const u=e-_,m=await ee(t,u,_);for(let x=m.length-i;x>=0;x--)if(m[x]==s[0]&&m[x+1]==s[1]&&m[x+2]==s[2]&&m[x+3]==s[3])return{offset:u+x,buffer:m.slice(x,x+i).buffer}}}function fe(t,n,e){return n[e]===xe?t.options[e]:n[e]}function da(t){const n=(t&4294901760)>>16,e=t&65535;try{return new Date(1980+((n&65024)>>9),((n&480)>>5)-1,n&31,(e&63488)>>11,(e&2016)>>5,(e&31)*2,0)}catch{}}function Ut(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function je(t,n){return t.getUint8(n)}function J(t,n){return t.getUint16(n,!0)}function G(t,n){return t.getUint32(n,!0)}function ft(t,n){return Number(t.getBigUint64(n,!0))}function ua(t,n,e){t.setUint32(n,e,!0)}function z(t){return new DataView(t.buffer)}let Wi;try{Wi=import.meta.url}catch{}Bt({baseURL:Wi});Is(Bt);Bt({Deflate:ir,Inflate:Er});export{Ns as BlobReader,ma as BlobWriter,pa as ZipReader}; diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..352bdb7 --- /dev/null +++ b/dist/index.html @@ -0,0 +1,222 @@ + + + + + + Maa-amet 3D v2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Share a map + + + + + + +
Copied map location to the clipboard
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+ + + + \ No newline at end of file diff --git a/index.html b/index.html index 66a3c3c..1828fec 100644 --- a/index.html +++ b/index.html @@ -10,9 +10,6 @@ - - - diff --git a/modules/coordinate.js b/modules/coordinate.js index e5c5879..9eb1e0a 100644 --- a/modules/coordinate.js +++ b/modules/coordinate.js @@ -1,63 +1,58 @@ +import CoordinateConversion from "@arcgis/core/widgets/CoordinateConversion.js"; +import Format from "@arcgis/core/widgets/CoordinateConversion/support/Format.js"; +import Point from "@arcgis/core/geometry/Point.js"; + const numberSearchPattern = /-?\d+[\.]?\d*/; -define([ - "esri/widgets/CoordinateConversion", - "esri/widgets/CoordinateConversion/support/Format", - "esri/geometry/Point", - "esri/geometry/support/webMercatorUtils", -], (CoordinateConversion, Format, Point, webMercatorUtils) => ({ - setupCoordinateWidget: (view) => - new CoordinateConversion({ - view, - }), +const setupCoordinateWidget = (view) => { + return new CoordinateConversion({ + view, + }); +}; - setupNewFormat: () => - new Format({ - // The format's name should be unique with respect to other formats used by the widget - name: "XYZ", - conversionInfo: { - // Define a convert function - // Point -> Position - convert: function (point) { - const returnPoint = point; - const x = returnPoint.x.toFixed(2); - const y = returnPoint.y.toFixed(2); - const z = returnPoint.z.toFixed(2); - return { - location: returnPoint, - coordinate: `${x}, ${y}, ${z}`, - }; - }, - // Define a reverse convert function - // String -> Point - reverseConvert: function (string) { - const parts = string.split(","); - return new Point({ - x: parseFloat(parts[0]), - y: parseFloat(parts[1]), - z: parseFloat(parts[2]), - spatialReference: { wkid: 3301 }, - }); - }, +const setupNewFormat = () => { + return new Format({ + name: "XYZ", + conversionInfo: { + convert: function (point) { + const returnPoint = point; + const x = returnPoint.x.toFixed(2); + const y = returnPoint.y.toFixed(2); + const z = returnPoint.z.toFixed(2); + return { + location: returnPoint, + coordinate: `${x}, ${y}, ${z}`, + }; + }, + reverseConvert: function (string) { + const parts = string.split(","); + return new Point({ + x: parseFloat(parts[0]), + y: parseFloat(parts[1]), + z: parseFloat(parts[2]), + spatialReference: { wkid: 3301 }, + }); + }, + }, + coordinateSegments: [ + { + alias: "X", + description: "Longitude", + searchPattern: numberSearchPattern, }, - // Define each segment of the coordinate - coordinateSegments: [ - { - alias: "X", - description: "Longitude", - searchPattern: numberSearchPattern, - }, - { - alias: "Y", - description: "Latitude", - searchPattern: numberSearchPattern, - }, - { - alias: "Z", - description: "Elevation", - searchPattern: numberSearchPattern, - }, - ], - defaultPattern: "X, Y, Z", - }), -})); + { + alias: "Y", + description: "Latitude", + searchPattern: numberSearchPattern, + }, + { + alias: "Z", + description: "Elevation", + searchPattern: numberSearchPattern, + }, + ], + defaultPattern: "X, Y, Z", + }); +}; + +export { setupCoordinateWidget, setupNewFormat }; diff --git a/modules/daylight.js b/modules/daylight.js index fef4805..f2582b7 100644 --- a/modules/daylight.js +++ b/modules/daylight.js @@ -1,8 +1,11 @@ -define(["esri/widgets/Daylight"], (Daylight) => ({ - setupDaylight: (view) => - new Daylight({ - view, - visible: true, - container: "daylight-container" - }), -})); +import Daylight from "@arcgis/core/widgets/Daylight.js"; + +const setupDaylight = (view) => { + return new Daylight({ + view, + visible: true, + container: "daylight-container", + }); +}; + +export { setupDaylight }; diff --git a/modules/elevation.js b/modules/elevation.js index 5ec5947..26b26d6 100644 --- a/modules/elevation.js +++ b/modules/elevation.js @@ -1,54 +1,52 @@ -// TODO kas siin saaks sisendina deklareerida kohe view.map scene asemel, et konstukrutori ülesannet kergemaks teha -define(["esri/layers/ElevationLayer"], (ElevationLayer) => ({ - elevationManipulation: (view) => { - const opacitySlider = document.getElementById("opacitySlider"); - opacitySlider.addEventListener("calciteSliderInput", () => { - const value = opacitySlider.value / 100; - view.map.ground.opacity = value; +import ElevationLayer from "@arcgis/core/layers/ElevationLayer.js"; + +const elevationManipulation = (view) => { + const opacitySlider = document.getElementById("opacitySlider"); + opacitySlider.addEventListener("calciteSliderInput", () => { + const value = opacitySlider.value / 100; + view.map.ground.opacity = value; + }); + + const navigateUndergroundInput = document.getElementById( + "navigationUnderground" + ); + console.log(navigateUndergroundInput); + const elevationInput = document.getElementById("elevationInput"); + + navigateUndergroundInput.addEventListener( + "calciteCheckboxChange", + (event) => { + view.map.ground.navigationConstraint.type = event.target.checked + ? "none" + : "stay-above"; + } + ); + + elevationInput.addEventListener("calciteCheckboxChange", updateElevation); + + function updateElevation(e) { + view.map.ground.layers.forEach((layer) => { + layer.visible = e.target.checked; }); + } - const navigateUndergroundInput = document.getElementById( - "navigationUnderground" - ); - const elevationInput = document.getElementById("elevationInput"); - - navigateUndergroundInput.addEventListener( - "calciteCheckboxChange", - (event) => { - view.map.ground.navigationConstraint.type = event.target.checked - ? "none" - : "stay-above"; - } - ); - - // TODO arrow function ümber teha - elevationInput.addEventListener("calciteCheckboxChange", updateElevation); - - function updateElevation(e) { - // Turn ground layers visibility on/off - view.map.ground.layers.forEach((layer) => { - layer.visible = e.target.checked; - }); - } + const elevationLayerGroup = document.getElementById("elevationModels"); + + elevationLayerGroup.addEventListener("calciteRadioButtonGroupChange", () => { + const selectedItem = elevationLayerGroup.selectedItem.value; - const elevationLayerGroup = document.getElementById("elevationModels"); - - elevationLayerGroup.addEventListener( - "calciteRadioButtonGroupChange", - () => { - const selectedItem = elevationLayerGroup.selectedItem.value; - - view.map.ground.layers.forEach((layer) => { - layer.visible = layer.id === selectedItem; - }); - } - ); - }, - - setupElevationLayer: (url, title) => - new ElevationLayer({ - url, - title, - visible: false, - }), -})); + view.map.ground.layers.forEach((layer) => { + layer.visible = layer.id === selectedItem; + }); + }); +}; + +const setupElevationLayer = (url, title) => { + return new ElevationLayer({ + url, + title, + visible: false, + }); +}; + +export { elevationManipulation, setupElevationLayer }; diff --git a/modules/elevationProfile.js b/modules/elevationProfile.js index 5abdd46..b19c8dd 100644 --- a/modules/elevationProfile.js +++ b/modules/elevationProfile.js @@ -1,25 +1,24 @@ // TODO ürita Maa-ameti DSM/CHM alla tuua? +import ElevationProfile from "@arcgis/core/widgets/ElevationProfile.js"; -define(["esri/widgets/ElevationProfile"], (ElevationProfile) => ({ - setupElevationProfile: (view) => - new ElevationProfile({ - view, - container: "elevation-profile-container", - profiles: [ - { - type: "ground", - title: "Maapind", - }, - { - type: "view", - title: "Kihid", - }, - ], - // hide the select button - // this button can be displayed when there are polylines in the - // scene to select and display the elevation profile for - visibleElements: { - selectButton: true, +const setupElevationProfile = (view) => { + return new ElevationProfile({ + view, + container: "elevation-profile-container", + profiles: [ + { + type: "ground", + title: "Maapind", }, - }), -})); + { + type: "view", + title: "Kihid", + }, + ], + visibleElements: { + selectButton: true, + }, + }); +}; + +export { setupElevationProfile }; diff --git a/modules/goToLocation.js b/modules/goToLocation.js index 8a5fd99..f4b52f0 100644 --- a/modules/goToLocation.js +++ b/modules/goToLocation.js @@ -1,174 +1,136 @@ -define(["esri/Viewpoint", "esri/Camera", "esri/geometry/Point"], ( - Viewpoint, - Camera, - Point -) => ({ - getUndergroundInfo: (view) => { - const urlString = new URL(window.location.href); - - // Create a URL object - const url = new URLSearchParams(urlString.search); - - const undergroundParam = url.get("underground"); - - if (undergroundParam === "true") { - view.map.ground.navigationConstraint.type = "none"; - } - }, - - getLayerVisibility: (view) => { - const urlString = new URL(window.location.href); - - // Create a URL object - const url = new URLSearchParams(urlString.search); - - // TODO mis juhtub, kui on puudu ja kas on mingid probleemid ka id parsimiga? - const layersParamStr = url.get("layers"); - - if (layersParamStr !== null) { - const layersParamArr = layersParamStr.split(","); // Splitting the string at commas - - view.map.allLayers.items.forEach((obj) => { - if (layersParamArr.includes(obj.title)) { - console.log(obj) - obj.visible = !obj.visible; - } - }); - } - }, - - getElevationVisibility: (view) => { - const urlString = new URL(window.location.href); - - // Create a URL object - const url = new URLSearchParams(urlString.search); - - // TODO mis juhtub, kui on puudu ja kas on mingid probleemid ka id parsimiga? - const layersParamStr = url.get("elevation"); - - // Changing layer visibility back and front end - if (layersParamStr !== null) { - const layersParamArr = layersParamStr.split(","); // Splitting the string at commas - - view.map.ground.layers.forEach((obj) => { - if (layersParamArr.includes(obj.title)) { - obj.visible = !obj.visible; - } - }); - - } - }, - - // TODO mis juhtub kui üks element jääb puud, ilmselt kasutada ka ; kui on kaamera parameetrid? - getLocation: () => { - // Sample URL with parameters - const urlString = new URL(window.location.href); - - // Create a URL object - const url = new URLSearchParams(urlString.search); - - // Get the value of the 'view' parameter from the URL - const viewpointParam = url.get("view"); - - // Split the viewpoint parameter to extract x, y, and z values - if (viewpointParam) { - const [x, y, z, heading, tilt, rotation, scale] = - viewpointParam.split(","); - - // Convert strings to numbers if needed - const parsedX = parseFloat(x); - const parsedY = parseFloat(y); - const parsedZ = parseFloat(z); - const parsedHeading = parseFloat(heading); - const parsedTilt = parseFloat(tilt); - const parsedRotation = parseFloat(rotation); - const parsedScale = parseFloat(scale); - - return [ - parsedX, - parsedY, - parsedZ, - parsedHeading, - parsedTilt, - parsedRotation, - parsedScale, - ]; - } - - return null; - }, - - async copyTextToClipboard(text) { - await navigator.clipboard.writeText(text); - }, - - createURL: (view, regularLayers, elevationLayers) => { - // Get the current URL - const currentURL = window.location.href; - - // Remove parameters from the URL - const urlWithoutParams = new URL(currentURL.split("?")[0]); - - const viewpoint = view.viewpoint; - const { rotation, scale } = viewpoint; - const { heading, tilt } = viewpoint.camera; - const { x, y, z } = viewpoint.camera.position; - - // Construct the URL parameters - const queryParams = new URLSearchParams(); - queryParams.set( - "view", - `${x},${y},${z},${heading},${tilt},${rotation},${scale}` - ); - - // Check underground navigation - if (view.map.ground.navigationConstraint.type === "none") { - queryParams.set("underground", "true"); - } - - - if (regularLayers.length !== 0) { - const regularLayerVisibilityJoined = regularLayers.join(","); - queryParams.set("layers", regularLayerVisibilityJoined); - } - - if (elevationLayers.length !== 0) { - const elevationLayerVisibilityJoined = elevationLayers.join(","); - queryParams.set("elevation", elevationLayerVisibilityJoined); - } - - // Append parameters to the URL - urlWithoutParams.search = queryParams.toString(); - - return urlWithoutParams.toString(); - }, - - setupViewPoint: (locationArray) => { - const [ - locationX, - locationY, - locationZ, - locationHeading, - locationTilt, - locationRotate, - locationScale, - ] = locationArray; - const viewpoint = new Viewpoint({ - camera: new Camera({ - position: new Point({ - x: locationX, - y: locationY, - z: locationZ, - spatialReference: { - wkid: 3301, - }, - }), - heading: locationHeading, - tilt: locationTilt, - }), - rotation: locationRotate, - scale: locationScale, +import Viewpoint from "@arcgis/core/Viewpoint.js"; +import Camera from "@arcgis/core/Camera.js"; +import Point from "@arcgis/core/geometry/Point.js"; + +const getUndergroundInfo = (view) => { + const urlString = new URL(window.location.href); + const url = new URLSearchParams(urlString.search); + const undergroundParam = url.get("underground"); + if (undergroundParam === "true") { + view.map.ground.navigationConstraint.type = "none"; + } +}; + +const getLayerVisibility = (view) => { + const urlString = new URL(window.location.href); + const url = new URLSearchParams(urlString.search); + const layersParamStr = url.get("layers"); + if (layersParamStr !== null) { + const layersParamArr = layersParamStr.split(","); + view.map.allLayers.items.forEach((obj) => { + if (layersParamArr.includes(obj.title)) { + obj.visible = !obj.visible; + } }); - return viewpoint; - }, -})); + } +}; + +const getElevationVisibility = (view) => { + const urlString = new URL(window.location.href); + const url = new URLSearchParams(urlString.search); + const layersParamStr = url.get("elevation"); + if (layersParamStr !== null) { + const layersParamArr = layersParamStr.split(","); + view.map.ground.layers.forEach((obj) => { + if (layersParamArr.includes(obj.title)) { + obj.visible = !obj.visible; + } + }); + } +}; + +const getLocation = () => { + const urlString = new URL(window.location.href); + const url = new URLSearchParams(urlString.search); + const viewpointParam = url.get("view"); + if (viewpointParam) { + const [x, y, z, heading, tilt, rotation, scale] = viewpointParam.split(","); + const parsedX = parseFloat(x); + const parsedY = parseFloat(y); + const parsedZ = parseFloat(z); + const parsedHeading = parseFloat(heading); + const parsedTilt = parseFloat(tilt); + const parsedRotation = parseFloat(rotation); + const parsedScale = parseFloat(scale); + return [ + parsedX, + parsedY, + parsedZ, + parsedHeading, + parsedTilt, + parsedRotation, + parsedScale, + ]; + } + return null; +}; + +const copyTextToClipboard = async (text) => { + await navigator.clipboard.writeText(text); +}; + +const createURL = (view, regularLayers, elevationLayers) => { + const currentURL = window.location.href; + const urlWithoutParams = new URL(currentURL.split("?")[0]); + const viewpoint = view.viewpoint; + const { rotation, scale } = viewpoint; + const { heading, tilt } = viewpoint.camera; + const { x, y, z } = viewpoint.camera.position; + const queryParams = new URLSearchParams(); + queryParams.set( + "view", + `${x},${y},${z},${heading},${tilt},${rotation},${scale}` + ); + if (view.map.ground.navigationConstraint.type === "none") { + queryParams.set("underground", "true"); + } + if (regularLayers.length !== 0) { + const regularLayerVisibilityJoined = regularLayers.join(","); + queryParams.set("layers", regularLayerVisibilityJoined); + } + if (elevationLayers.length !== 0) { + const elevationLayerVisibilityJoined = elevationLayers.join(","); + queryParams.set("elevation", elevationLayerVisibilityJoined); + } + urlWithoutParams.search = queryParams.toString(); + return urlWithoutParams.toString(); +}; + +const setupViewPoint = (locationArray) => { + const [ + locationX, + locationY, + locationZ, + locationHeading, + locationTilt, + locationRotate, + locationScale, + ] = locationArray; + const viewpoint = new Viewpoint({ + camera: new Camera({ + position: new Point({ + x: locationX, + y: locationY, + z: locationZ, + spatialReference: { + wkid: 3301, + }, + }), + heading: locationHeading, + tilt: locationTilt, + }), + rotation: locationRotate, + scale: locationScale, + }); + return viewpoint; +}; + +export { + getUndergroundInfo, + getLayerVisibility, + getElevationVisibility, + getLocation, + copyTextToClipboard, + createURL, + setupViewPoint, +}; diff --git a/modules/layerList.js b/modules/layerList.js index dc81e97..b8f170e 100644 --- a/modules/layerList.js +++ b/modules/layerList.js @@ -1,6 +1,14 @@ // TODO siin saaks veel sättida layerList with actions et sättida opacity slideriga ning saada informatsiooni kihi kohta portaalist // TODO selleks peaks aga esmalt listima kõik kihid selle all ära või proovima teha seda esmalt läbi sidemastide +import LayerList from "@arcgis/core/widgets/LayerList.js"; +import Expand from "@arcgis/core/widgets/Expand.js"; +import Basemap from "@arcgis/core/Basemap.js"; +import BasemapGallery from "@arcgis/core/widgets/BasemapGallery.js"; +import { setupSliderStyle } from "./slider.js"; +import { setupLegend, setupLegendStyle } from "./legend.js"; + +//import { setupSliderStyle } from "./modules/slider.js"; const basemapIds = [ "be99602fc02d448eb859a0b426c0d5b6", "b6517d264b8f467fa5b14c382dfdf87a", @@ -11,221 +19,227 @@ const basemapIds = [ "e5c6a086a5ae4d1991d4ca35733fe0ed", ]; -define([ - "esri/widgets/LayerList", - "esri/widgets/Expand", - "esri/Basemap", - "esri/widgets/BasemapGallery", - "./modules/slider.js", - "./modules/legend.js", -], (LayerList, Expand, Basemap, BasemapGallery, initSlider, initLegend) => ({ - // TODO kui seda funktsiooni ei kasuta, siis ilmselt eemaldada - setupLayerListMain: (view) => - new LayerList({ - view, - container: "layers-container", - listItemCreatedFunction: async (e) => { - const item = e.item; - - await item.layer.when(); - - // Slider settings - const [itemPanelDiv, sliderDiv] = initSlider.setupSliderStyle(item); - - // Legend settings - const legendDiv = initLegend.setupLegendStyle(); - initLegend.setupLegend(view, item.layer, legendDiv); - - itemPanelDiv.append(sliderDiv, legendDiv); - - if ( - item.title === "Kataster" || - item.title === "Kitsendused" || - item.title === "Kitsendusi põhjustavad objektid" || - item.title === "Geoloogia WMS" - ) { - item.hidden = true; - } +// TODO ettevaatlikult üle toomine +const setupLayerListMain = (view) => { + return new LayerList({ + view, + container: "layers-container", + listItemCreatedFunction: async (e) => { + const item = e.item; - // TODO kui muuta legendi overflow dünaamiliselt peaks ilmselt trigger-actioni itempaneldivile kirjutama, mis vastavalt muudab viewporti - if ( - item.layer.type !== "group" || - item.title === "Taimkate analüütiline" || - item.title === "Taimkate realistlik" - ) { - item.panel = { - content: itemPanelDiv, - className: "esri-icon-legend", - open: false, - title: "Legend and layer opacity", - }; - } + await item.layer.when(); - sliderDiv.addEventListener("calciteSliderInput", () => { - const value = sliderDiv.value / 100; - item.layer.opacity = value; - }); + // Slider settings + const [itemPanelDiv, sliderDiv] = setupSliderStyle(item); - // Common section for both conditions - - if (item.layer.type !== "group") { - item.actionsSections = [ - [ - { - title: "Layer information", - className: "esri-icon-description", - id: "information", - }, - ], - ]; - } + // Legend settings + const legendDiv = setupLegendStyle(); + setupLegend(view, item.layer, legendDiv); - const extentsNeeded = [ - "Nõmme", - "Pärnu", - "Tallinn", - "Tartu", - "Kuressaare", - "Kohtuhoone tekstuuriga (Tallinn)", - ]; - if (extentsNeeded.includes(item.title)) { - item.actionsSections.items[0].push({ - title: "Zoom to extent", - className: "esri-icon-zoom-out-fixed", - id: "zoomTo", - }); - } - }, - }), - - setupLayerListWMS: (view) => - new LayerList({ - view, - container: "wms-layers-container", - listItemCreatedFunction: async (e) => { - const item = e.item; - - await item.layer.when(); - - // Slider settings - const [itemPanelDiv, sliderDiv] = initSlider.setupSliderStyle(item); - - // Legend settings - const legendDiv = initLegend.setupLegendStyle(); - initLegend.setupLegend(view, item.layer, legendDiv); - - itemPanelDiv.append(sliderDiv, legendDiv); - - if ( - item.title !== "Kataster" && - item.title !== "Kitsendused" && - item.title !== "Kitsendusi põhjustavad objektid" && - item.title !== "Geoloogia WMS" - ) { - item.hidden = true; - } + itemPanelDiv.append(sliderDiv, legendDiv); - if (item.layer.type !== "group") { - item.panel = { - content: itemPanelDiv, - className: "esri-icon-legend", - open: false, - title: "Legend and layer opacity", - }; - } - // when the item is the name of the tree, - // add the layers of the items to the group layer + if ( + item.title === "Kataster" || + item.title === "Kitsendused" || + item.title === "Kitsendusi põhjustavad objektid" || + item.title === "Geoloogia WMS" + ) { + item.hidden = true; + } - sliderDiv.addEventListener("calciteSliderInput", () => { - const value = sliderDiv.value / 100; - item.layer.opacity = value; - }); + // TODO kui muuta legendi overflow dünaamiliselt peaks ilmselt trigger-actioni itempaneldivile kirjutama, mis vastavalt muudab viewporti + if ( + item.layer.type !== "group" || + item.title === "Taimkate analüütiline" || + item.title === "Taimkate realistlik" + ) { + item.panel = { + content: itemPanelDiv, + className: "esri-icon-legend", + open: false, + title: "Legend and layer opacity", + }; + } - if (item.title !== "Geoloogia WMS") { - item.actionsSections = [ - [ - { - title: "Layer information", - className: "esri-icon-description", - id: "information", - }, - ], - ]; - } - }, - }), - - setupElevationExpand: (view, content, container = null) => - new Expand({ - view, - content, - container, - }), - - setupExpand: ( - toolTipText, - view, - content, - expanded, - group, - expandIcon = null, - container = null - ) => - new Expand({ - expandTooltip: toolTipText, - view, - content, - expanded, - group, - expandIcon, - container, - }), - - setupBasemapGallery: (view) => - new BasemapGallery({ - view, - container: "basemaps-container", - icon: "layer-basemap", - source: basemapIds.map( - (id) => - new Basemap({ - portalItem: { - id, + sliderDiv.addEventListener("calciteSliderInput", () => { + const value = sliderDiv.value / 100; + item.layer.opacity = value; + }); + + // Common section for both conditions + + if (item.layer.type !== "group") { + item.actionsSections = [ + [ + { + title: "Layer information", + className: "esri-icon-description", + id: "information", }, - }) - ), - }), - - loadWMStile: (basemaps, view) => { - basemaps.watch("activeBasemap", () => { - const isOrtofoto = basemaps.activeBasemap.title === "Ortofoto"; - - view.watch("zoom", () => { - view.map.layers.forEach((layer) => { - if (layer.title === "Ortofoto WMS") { - layer.visible = isOrtofoto && view.zoom >= 12.5; - } + ], + ]; + } + + const extentsNeeded = [ + "Nõmme", + "Pärnu", + "Tallinn", + "Tartu", + "Kuressaare", + "Kohtuhoone tekstuuriga (Tallinn)", + ]; + if (extentsNeeded.includes(item.title)) { + item.actionsSections.items[0].push({ + title: "Zoom to extent", + className: "esri-icon-zoom-out-fixed", + id: "zoomTo", }); - }); - }); - }, + } + }, + }); +}; + +const setupLayerListWMS = (view) => { + return new LayerList({ + view, + container: "wms-layers-container", + listItemCreatedFunction: async (e) => { + const item = e.item; + + await item.layer.when(); + + // Slider settings + const [itemPanelDiv, sliderDiv] = setupSliderStyle(item); - getLayerInfo: (layerList, view) => { - layerList.on("trigger-action", (e) => { - const layer = e.item.layer; + // Legend settings + const legendDiv = setupLegendStyle(); + setupLegend(view, item.layer, legendDiv); - // Capture the action id. - const id = e.action.id; + itemPanelDiv.append(sliderDiv, legendDiv); - if (id === "information") { - // If the information action is triggered, then - // open the item details page of the service layer. - window.open(layer.url); + if ( + item.title !== "Kataster" && + item.title !== "Kitsendused" && + item.title !== "Kitsendusi põhjustavad objektid" && + item.title !== "Geoloogia WMS" + ) { + item.hidden = true; } - if (id === "zoomTo") { - view.goTo(layer.fullExtent.extent); + if (item.layer.type !== "group") { + item.panel = { + content: itemPanelDiv, + className: "esri-icon-legend", + open: false, + title: "Legend and layer opacity", + }; + } + // when the item is the name of the tree, + // add the layers of the items to the group layer + + sliderDiv.addEventListener("calciteSliderInput", () => { + const value = sliderDiv.value / 100; + item.layer.opacity = value; + }); + + if (item.title !== "Geoloogia WMS") { + item.actionsSections = [ + [ + { + title: "Layer information", + className: "esri-icon-description", + id: "information", + }, + ], + ]; } + }, + }); +}; + +const setupElevationExpand = (view, content, container = null) => { + return new Expand({ + view, + content, + container, + }); +}; + +const setupExpand = ( + toolTipText, + view, + content, + expanded, + group, + expandIcon = null, + container = null +) => { + return new Expand({ + expandTooltip: toolTipText, + view, + content, + expanded, + group, + expandIcon, + container, + }); +}; + +const setupBasemapGallery = (view) => { + return new BasemapGallery({ + view, + container: "basemaps-container", + icon: "layer-basemap", + source: basemapIds.map( + (id) => + new Basemap({ + portalItem: { + id, + }, + }) + ), + }); +}; + +const loadWMStile = (basemaps, view) => { + basemaps.watch("activeBasemap", () => { + const isOrtofoto = basemaps.activeBasemap.title === "Ortofoto"; + + view.watch("zoom", () => { + view.map.layers.forEach((layer) => { + if (layer.title === "Ortofoto WMS") { + layer.visible = isOrtofoto && view.zoom >= 12.5; + } + }); }); - }, -})); + }); +}; + +const getLayerInfo = (layerList, view) => { + layerList.on("trigger-action", (e) => { + const layer = e.item.layer; + + // Capture the action id. + const id = e.action.id; + + if (id === "information") { + // If the information action is triggered, then + // open the item details page of the service layer. + window.open(layer.url); + } + + if (id === "zoomTo") { + view.goTo(layer.fullExtent.extent); + } + }); +}; + +export { + setupLayerListMain, + setupLayerListWMS, + setupElevationExpand, + setupExpand, + setupBasemapGallery, + loadWMStile, + getLayerInfo, +}; diff --git a/modules/layers.js b/modules/layers.js index 67db1c6..3713944 100644 --- a/modules/layers.js +++ b/modules/layers.js @@ -1,112 +1,125 @@ -define([ - "esri/layers/GraphicsLayer", - "esri/layers/SceneLayer", - "esri/layers/WMSLayer", - "esri/layers/GroupLayer", -], (GraphicsLayer, SceneLayer, WMSLayer, GroupLayer) => ({ - setupGraphicsLayer: () => - new GraphicsLayer({ - elevationInfo: { mode: "absolute-height" }, - title: "Joonistatud kihid", - }), - - setupInternalLayer: (id, title) => - new SceneLayer({ - portalItem: { - id, - }, - title, - }), - - setupWMSLayer: () => - new WMSLayer({ - portalItem: { - id: "38a98f83f3a248faaea9ce793e50ddee", - }, - title: "Ortofoto WMS", - visible: false, - listMode: "hide", - }), - - setupGroupLayer: (title, visibilityMode, visible = false) => - new GroupLayer({ - title, - visible, - visibilityMode, - }), - - taimkateWorkaround: (treeGroupLayer, view) => { - const taimkateAnalytical = view.map.allLayers.items.find( - (layer) => layer.title === "Taimkate analüütiline" - ); - taimkateAnalytical.visible = true; - - const taimkateRealistic = view.map.allLayers.items.find( - (layer) => layer.title === "Taimkate realistlik" - ); - - treeGroupLayer.addMany([taimkateAnalytical, taimkateRealistic]); - view.map.removeMany([taimkateAnalytical, taimkateRealistic]); - }, - - getGeologyLayers: (view) => { - const geologyLayerTitles = [ - "Puurkaevud/puuraugud", - "Ehitusgeoloogia", - "Geoloogia WMS", - ]; - - const geologyLayers = {}; - view.map.layers.forEach((layer) => { - const layerTitle = layer.title; - if (geologyLayerTitles.includes(layerTitle)) { - geologyLayers[layerTitle] = layer; +import GraphicsLayer from "@arcgis/core/layers/GraphicsLayer.js"; +import SceneLayer from "@arcgis/core/layers/SceneLayer.js"; +import WMSLayer from "@arcgis/core/layers/WMSLayer.js"; +import GroupLayer from "@arcgis/core/layers/GroupLayer.js"; + +const setupGraphicsLayer = () => { + return new GraphicsLayer({ + elevationInfo: { mode: "absolute-height" }, + title: "Joonistatud kihid", + }); +}; + +const setupInternalLayer = (id, title) => { + return new SceneLayer({ + portalItem: { + id, + }, + title, + }); +}; + +const setupWMSLayer = () => { + return new WMSLayer({ + portalItem: { + id: "38a98f83f3a248faaea9ce793e50ddee", + }, + title: "Ortofoto WMS", + visible: false, + listMode: "hide", + }); +}; + +const setupGroupLayer = (title, visibilityMode, visible = false) => { + return new GroupLayer({ + title, + visible, + visibilityMode, + }); +}; + +const taimkateWorkaround = (treeGroupLayer, view) => { + const taimkateAnalytical = view.map.allLayers.find( + (layer) => layer.title === "Taimkate analüütiline" + ); + taimkateAnalytical.visible = true; + + const taimkateRealistic = view.map.allLayers.find( + (layer) => layer.title === "Taimkate realistlik" + ); + + treeGroupLayer.addMany([taimkateAnalytical, taimkateRealistic]); + view.map.removeMany([taimkateAnalytical, taimkateRealistic]); +}; + +const getGeologyLayers = (view) => { + const geologyLayerTitles = [ + "Puurkaevud/puuraugud", + "Ehitusgeoloogia", + "Geoloogia WMS", + ]; + + const geologyLayers = {}; + view.map.layers.forEach((layer) => { + const layerTitle = layer.title; + if (geologyLayerTitles.includes(layerTitle)) { + geologyLayers[layerTitle] = layer; + } + }); + + const returnLayers = geologyLayerTitles + .map((title) => geologyLayers[title]) + .filter(Boolean); + return { items: returnLayers }; +}; + +const getVisibleLayers = (view) => { + const { items } = view.map.allLayers; + const { initVisible } = items.reduce( + (acc, obj) => { + if (obj.visible === true) { + acc.initVisible.push(obj); } - }); - - const returnLayers = geologyLayerTitles - .map((title) => geologyLayers[title]) - .filter(Boolean); - return { items: returnLayers }; - }, - - getVisibleLayers: (view) => { - const { items } = view.map.allLayers; - const { initVisible } = items.reduce( - (acc, obj) => { - if (obj.visible === true) { - acc.initVisible.push(obj); - } - return acc; - }, - { initVisible: [] } - ); - - return initVisible; - }, - - compareVisibleLayers: (initVisibleLayers, visibleLayersCurrently) => { - const difference1 = initVisibleLayers.filter( - (item) => !visibleLayersCurrently.includes(item) - ); - const difference2 = visibleLayersCurrently.filter( - (item) => !initVisibleLayers.includes(item) - ); - - const getTitle = (obj) => obj.title; - const layerVisibilityChanged = [ - ...difference1.map(getTitle), - ...difference2.map(getTitle), - ]; - - const elevationTitles = ["Kõrgusmudel", "Aluspõhi 50m", "Aluskord 50m"]; - const regularLayers = layerVisibilityChanged.filter( - (item) => !elevationTitles.includes(item) - ); - const elevationChanged = layerVisibilityChanged.filter((item) => - elevationTitles.includes(item) - ); - - return [regularLayers, elevationChanged]; - }, -})); + return acc; + }, + { initVisible: [] } + ); + + return initVisible; +}; + +const compareVisibleLayers = (initVisibleLayers, visibleLayersCurrently) => { + const difference1 = initVisibleLayers.filter( + (item) => !visibleLayersCurrently.includes(item) + ); + const difference2 = visibleLayersCurrently.filter( + (item) => !initVisibleLayers.includes(item) + ); + + const getTitle = (obj) => obj.title; + const layerVisibilityChanged = [ + ...difference1.map(getTitle), + ...difference2.map(getTitle), + ]; + + const elevationTitles = ["Kõrgusmudel", "Aluspõhi 50m", "Aluskord 50m"]; + const regularLayers = layerVisibilityChanged.filter( + (item) => !elevationTitles.includes(item) + ); + const elevationChanged = layerVisibilityChanged.filter((item) => + elevationTitles.includes(item) + ); + + return [regularLayers, elevationChanged]; +}; + +export { + setupGraphicsLayer, + setupInternalLayer, + setupWMSLayer, + setupGroupLayer, + taimkateWorkaround, + getGeologyLayers, + getVisibleLayers, + compareVisibleLayers, +}; diff --git a/modules/legend.js b/modules/legend.js index d3069da..19174f9 100644 --- a/modules/legend.js +++ b/modules/legend.js @@ -1,18 +1,21 @@ -define(["esri/widgets/Legend"], (Legend) => ({ - setupLegend: (view, layer, div) => - new Legend({ - view: view, - layerInfos: [ - { - layer: layer, - }, - ], - container: div, - }), +import Legend from "@arcgis/core/widgets/Legend.js"; - setupLegendStyle: () => { - const legendDiv = document.createElement("div"); - legendDiv.classList.add("esri-widget"); - return legendDiv; - }, -})); +const setupLegend = (view, layer, div) => { + return new Legend({ + view: view, + layerInfos: [ + { + layer: layer, + }, + ], + container: div, + }); +}; + +const setupLegendStyle = () => { + const legendDiv = document.createElement("div"); + legendDiv.classList.add("esri-widget"); + return legendDiv; +}; + +export { setupLegend, setupLegendStyle }; diff --git a/modules/lineOfSight.js b/modules/lineOfSight.js index 30be10d..22aae0c 100644 --- a/modules/lineOfSight.js +++ b/modules/lineOfSight.js @@ -1,24 +1,27 @@ -define(["esri/widgets/LineOfSight"], (LineOfSight) => ({ - setupLoS: (view) => - new LineOfSight({ - view, - container: "line-of-sight-container", - }), +import LineOfSight from "@arcgis/core/widgets/LineOfSight.js"; - getStartPoint: (view) => { - const losStartBtn = document.getElementById("LoSstartBtn"); +const setupLoS = (view) => { + return new LineOfSight({ + view, + container: "line-of-sight-container", + }); +}; - losStartBtn.addEventListener("click", (e) => { - //e.preventDefault(); - // Get values from the form - const xLOSstartValue = document.getElementById('xLOSstart').value; - const yLOSstartValue = document.getElementById('yLOSstart').value; - const zLOSstartValue = document.getElementById('zLoSstart').value; +const getStartPoint = (view) => { + const losStartBtn = document.getElementById("LoSstartBtn"); - // Log the values (You can perform any desired action here) - console.log('X-coordinate:', xLOSstartValue); - console.log('Y-coordinate:', yLOSstartValue); - console.log('Z-coordinate:', zLOSstartValue); - }); - }, -})); + losStartBtn.addEventListener("click", (e) => { + //e.preventDefault(); + // Get values from the form + const xLOSstartValue = document.getElementById("xLOSstart").value; + const yLOSstartValue = document.getElementById("yLOSstart").value; + const zLOSstartValue = document.getElementById("zLoSstart").value; + + // Log the values (You can perform any desired action here) + console.log("X-coordinate:", xLOSstartValue); + console.log("Y-coordinate:", yLOSstartValue); + console.log("Z-coordinate:", zLOSstartValue); + }); +}; + +export { setupLoS, getStartPoint }; diff --git a/modules/locate.js b/modules/locate.js index 463c3e2..5e72d05 100644 --- a/modules/locate.js +++ b/modules/locate.js @@ -1,6 +1,9 @@ -define(["esri/widgets/Locate"], (Locate) => ({ - setupLocate: (view) => - new Locate({ - view, - }), -})); +import Locate from "@arcgis/core/widgets/Locate.js"; + +const setupLocate = (view) => { + return new Locate({ + view, + }); +}; + +export { setupLocate }; diff --git a/modules/measurement.js b/modules/measurement.js index 19ccddc..7315717 100644 --- a/modules/measurement.js +++ b/modules/measurement.js @@ -1,25 +1,25 @@ -define([], () => ({ - setupMeasurement: (measurement) => { - const distanceBtn = document.getElementById("distanceButton"); - const areaBtn = document.getElementById("areaButton"); - const clearBtn = document.getElementById("clearButton"); +const setupMeasurement = (measurement) => { + const distanceBtn = document.getElementById("distanceButton"); + const areaBtn = document.getElementById("areaButton"); + const clearBtn = document.getElementById("clearButton"); - distanceBtn.addEventListener("click", () => { - distanceBtn.active = "true" - areaBtn.active = "false" - measurement.activeTool = "direct-line"; - }); + distanceBtn.addEventListener("click", () => { + distanceBtn.active = true; + areaBtn.active = false; + measurement.activeTool = "direct-line"; + }); - areaBtn.addEventListener("click", () => { - distanceBtn.active = "false" - areaBtn.active = "true" - measurement.activeTool = "area"; - }); + areaBtn.addEventListener("click", () => { + distanceBtn.active = false; + areaBtn.active = true; + measurement.activeTool = "area"; + }); - clearBtn.addEventListener("click", () => { - distanceBtn.active = "false" - areaBtn.active = "false" - measurement.clear(); - }); - }, -})); + clearBtn.addEventListener("click", () => { + distanceBtn.active = false; + areaBtn.active = false; + measurement.clear(); + }); +}; + +export { setupMeasurement }; diff --git a/modules/mediaQuery.js b/modules/mediaQuery.js index 5ad65db..599a61d 100644 --- a/modules/mediaQuery.js +++ b/modules/mediaQuery.js @@ -1,11 +1,11 @@ -define([], () => ({ - handleMediaQueryChange: (mql) => { - const calciteActionBars = document.querySelectorAll('calcite-action'); - if (mql.matches) { - calciteActionBars.forEach(bar => { - console.log(bar) - bar.scale ="m"; - }); - } - }, -})); +const handleMediaQueryChange = (mql) => { + const calciteActionBars = document.querySelectorAll("calcite-action"); + if (mql.matches) { + calciteActionBars.forEach((bar) => { + console.log(bar); + bar.scale = "m"; + }); + } +}; + +export { handleMediaQueryChange }; diff --git a/modules/memoryTest.js b/modules/memoryTest.js deleted file mode 100644 index a928826..0000000 --- a/modules/memoryTest.js +++ /dev/null @@ -1,63 +0,0 @@ -function getMB(bytes) { - const kilobyte = 1024; - const megabyte = kilobyte * 1024; - return Math.round(bytes / megabyte); -} - -define([], () => ({ - updateMemoryTitle: (used, total, quality) => { - const title = document.getElementById("title"); - title.innerHTML = `Memory: ${getMB(used)}MB/${getMB( - total - )}MB - Quality: ${Math.round(100 * quality)} %`; - }, - - updateTables: (stats) => { - const tableMemoryContainer = document.getElementById("memory"); - const tableCountContainer = document.getElementById("count"); - tableMemoryContainer.innerHTML = ` - Resource - Memory(MB) - `; - for (let layerInfo of stats.layerPerformanceInfos) { - if (layerInfo.memory !== 0) { - const row = document.createElement("tr"); - row.innerHTML = `${ - layerInfo.layer.title - }${getMB(layerInfo.memory)}`; - tableMemoryContainer.appendChild(row); - } - } - - tableCountContainer.innerHTML = ` - Layer - Features - Displayed / Max
(count) - Total
(count) - `; - - for (let layerInfo of stats.layerPerformanceInfos) { - if ( - layerInfo.maximumNumberOfFeatures && - layerInfo.displayedNumberOfFeatures !== 0 - ) { - const row = document.createElement("tr"); - row.innerHTML = `${layerInfo.layer.title}`; - row.innerHTML += `${ - layerInfo.displayedNumberOfFeatures - ? layerInfo.displayedNumberOfFeatures - : "-" - } / ${ - layerInfo.maximumNumberOfFeatures - ? layerInfo.maximumNumberOfFeatures - : "-" - }`; - row.innerHTML += `${ - layerInfo.totalNumberOfFeatures - ? layerInfo.totalNumberOfFeatures - : "-" - }`; - tableCountContainer.appendChild(row); - } - } - }, -})); diff --git a/modules/scene.js b/modules/scene.js index f6f60b8..7330189 100644 --- a/modules/scene.js +++ b/modules/scene.js @@ -1,17 +1,22 @@ +import WebScene from "@arcgis/core/WebScene.js"; +import SceneView from "@arcgis/core/views/SceneView.js"; + // TODO vaata kas siin saaks lahtipakkimisega teha -define(["esri/WebScene", "esri/views/SceneView"], (WebScene, SceneView) => ({ - setupWebScene: (id, ...layers) => - new WebScene({ - portalItem: { - id, - }, - layers: [...layers], - }), +const setupWebScene = (id, ...layers) => { + return new WebScene({ + portalItem: { + id, + }, + layers: [...layers], + }); +}; + +const setupWebView = (scene) => { + return new SceneView({ + map: scene, + container: "viewDiv", + qualityProfile: "high", + }); +}; - setupWebView: (scene) => - new SceneView({ - map: scene, - container: "viewDiv", - qualityProfile: "high", - }), -})); +export { setupWebScene, setupWebView }; diff --git a/modules/search.js b/modules/search.js index 36dc729..9ab5f30 100644 --- a/modules/search.js +++ b/modules/search.js @@ -1,82 +1,61 @@ -// TODO muuda kasti natuke suuremaks +import Search from "@arcgis/core/widgets/Search.js"; +import SearchSource from "@arcgis/core/widgets/Search/SearchSource.js"; +import Graphic from "@arcgis/core/Graphic.js"; +import Point from "@arcgis/core/geometry/Point.js"; +import esriRequest from "@arcgis/core/request.js"; +import * as geometryEngine from "@arcgis/core/geometry/geometryEngine.js"; const inAdsUrl = "http://inaadress.maaamet.ee/inaadress/gazetteer/"; -define([ - "esri/widgets/Search", - "esri/widgets/Search/SearchSource", - "esri/Graphic", - "esri/geometry/Point", - "esri/request", - "esri/geometry/geometryEngine", -], (Search, SearchSource, Graphic, Point, esriRequest, geometryEngine) => ({ - setupCustomSearchSource: () => - new SearchSource({ - placeholder: "Search address", - // Provide a getSuggestions method - // to provide suggestions to the Search widget - getSuggestions: (params) => { - const keyword = params.suggestTerm; // keyword input by user - const suggestUrl = `${inAdsUrl}?address=${encodeURIComponent(keyword)}`; - return esriRequest(suggestUrl, { responseType: "json" }).then( - (results) => { - // Return Suggestion results to display - // in the Search widget - return results.data.addresses.map((address) => { - return { - text: address.pikkaadress, - magicKey: address.unik, - }; - }); - } +const setupCustomSearchSource = () => { + return new SearchSource({ + placeholder: "Search address", + getSuggestions: async (params) => { + const keyword = params.suggestTerm; + const suggestUrl = `${inAdsUrl}?address=${encodeURIComponent(keyword)}`; + const results = await esriRequest(suggestUrl, { responseType: "json" }); + return results.data.addresses.map((address) => { + return { + text: address.pikkaadress, + magicKey: address.unik, + }; + }); + }, + getResults: async (params) => { + const key = params.suggestResult.text; + const newUrl = `${inAdsUrl}?address=${encodeURIComponent(key)}`; + const results = await esriRequest(newUrl, { responseType: "json" }); + const searchResults = results.data.addresses.map((address) => { + const graphic = new Graphic({ + geometry: new Point({ + x: address.viitepunkt_l, + y: address.viitepunkt_b, + }), + }); + const buffer = geometryEngine.geodesicBuffer( + graphic.geometry, + 30, + "meters" ); - }, - - //Provide a getResults method to find - //results from the suggestions - getResults: (params) => { - const key = params.suggestResult.text; // keyword input by user - const newUrl = `${inAdsUrl}?address=${encodeURIComponent(key)}`; - return esriRequest(newUrl, { - responseType: "json", - }).then((results) => { - // Parse the results of your custom search - - const searchResults = results.data.addresses.map((address) => { - const graphic = new Graphic({ - geometry: new Point({ - x: address.viitepunkt_l, - y: address.viitepunkt_b, - }), - }); - //Optionally,provide an extent for a point result, so the view can zoom to it - const buffer = geometryEngine.geodesicBuffer( - graphic.geometry, - 30, - "meters" - ); - // Return a Search Result - const searchResult = { - extent: buffer.extent, - feature: graphic, - //name: address.pikkaadress, - name: `${address.pikkaadress}`, - }; + const searchResult = { + extent: buffer.extent, + feature: graphic, + name: `${address.pikkaadress}`, + }; + return searchResult; + }); + return searchResults; + }, + }); +}; - return searchResult; - }); - - // Return an array of Search Results - return searchResults; - }); - }, - }), +const setupSearchWidget = (view, sources) => { + return new Search({ + view: view, + sources: [sources], + includeDefaultSources: false, + container: "in-ads-container", + }); +}; - setupSearchWidget: (view, sources) => - new Search({ - view: view, - sources: [sources], - includeDefaultSources: false, - container: "in-ads-container", - }), -})); +export { setupCustomSearchSource, setupSearchWidget }; diff --git a/modules/shadowCast.js b/modules/shadowCast.js index f422c3f..544ef0a 100644 --- a/modules/shadowCast.js +++ b/modules/shadowCast.js @@ -1,10 +1,11 @@ +import ShadowCast from "@arcgis/core/widgets/ShadowCast.js"; +const setupShadowCast = (view) => { + return new ShadowCast({ + view: view, + visible: false, + container: "shadowcast-container", + }); +}; -define(["esri/widgets/ShadowCast"], (ShadowCast) => ({ - setupShadowCast: (view) => - new ShadowCast({ - view: view, - visible: false, - container: "shadowcast-container", - }), -})); +export { setupShadowCast }; diff --git a/modules/sketch.js b/modules/sketch.js index 8533218..838195b 100644 --- a/modules/sketch.js +++ b/modules/sketch.js @@ -1,6 +1,9 @@ // TODO kui tööle saad, siis interface ära muuta // TODO või proovida sättida default sketch toolbar alguses (esri oma) ja ülejäänud jätta samaks, kuna see draw a building/draw pole optimaalne alati +import SketchViewModel from "@arcgis/core/widgets/Sketch/SketchViewModel.js"; +import Slider from "@arcgis/core/widgets/Slider.js"; + // Graphic UI parameters const blue = [82, 82, 122, 0.9]; const white = [255, 255, 255, 0.8]; @@ -63,211 +66,203 @@ const point = { ], }; -define([ - "esri/widgets/Sketch/SketchViewModel", - "esri/widgets/Slider", - "esri/widgets/Expand", -], (SketchViewModel, Slider, Expand) => ({ - setupSketch: (view, graphicsLayer) => { - /************************************** - * Sketching (1): Init settings - **************************************/ - // Set-up event handlers for buttons and click events - const startbuttons = document.getElementById("startbuttons"); - const actionbuttons = document.getElementById("actionbuttons"); - const edgeoperationbuttons = document.getElementById( - "edgeoperationbuttons" - ); +const setupSketch = (view, graphicsLayer) => { + /************************************** + * Sketching (1): Init settings + **************************************/ + // Set-up event handlers for buttons and click events + const startbuttons = document.getElementById("startbuttons"); + const actionbuttons = document.getElementById("actionbuttons"); + const edgeoperationbuttons = document.getElementById("edgeoperationbuttons"); - const extrudeSliderButton = document.getElementById( - "extrudeSliderContainer" - ); + const extrudeSliderButton = document.getElementById("extrudeSliderContainer"); - const extrudeSlider = new Slider({ - container: "extrudeSlider", - precision: 1, - min: 0, - max: 500, - steps: 1, - values: [10], - visibleElements: { - rangeLabels: true, - }, - }); + const extrudeSlider = new Slider({ + container: "extrudeSlider", + precision: 1, + min: 0, + max: 500, + steps: 1, + values: [10], + visibleElements: { + rangeLabels: true, + }, + }); - const sketchViewModel = new SketchViewModel({ - layer: graphicsLayer, - view: view, - pointSymbol: point, - polygonSymbol: extrudedPolygon, - polylineSymbol: route, - defaultCreateOptions: { - hasZ: true, // default value - }, - snappingOptions: { - enabled: true, - featureSources: [{ layer: graphicsLayer }], - }, - tooltipOptions: { enabled: true }, - labelOptions: { enabled: true }, - defaultUpdateOptions: { - tool: "transform", - enableScaling: true, - enableZ: true, - }, - }); + const sketchViewModel = new SketchViewModel({ + layer: graphicsLayer, + view: view, + pointSymbol: point, + polygonSymbol: extrudedPolygon, + polylineSymbol: route, + defaultCreateOptions: { + hasZ: true, // default value + }, + snappingOptions: { + enabled: true, + featureSources: [{ layer: graphicsLayer }], + }, + tooltipOptions: { enabled: true }, + labelOptions: { enabled: true }, + defaultUpdateOptions: { + tool: "transform", + enableScaling: true, + enableZ: true, + }, + }); - sketchViewModel.on("create", (event) => { - if (event.state === "complete") { - startbuttons.style.display = "inline"; - actionbuttons.style.display = "none"; - sketchViewModel.update(event.graphic); - } - if (event.state === "cancel") { - startbuttons.style.display = "inline"; - actionbuttons.style.display = "none"; - } - }); + sketchViewModel.on("create", (event) => { + if (event.state === "complete") { + startbuttons.style.display = "inline"; + actionbuttons.style.display = "none"; + sketchViewModel.update(event.graphic); + } + if (event.state === "cancel") { + startbuttons.style.display = "inline"; + actionbuttons.style.display = "none"; + } + }); - sketchViewModel.on("update", (event) => { - if (event.state === "start") { - startbuttons.style.display = "none"; - actionbuttons.style.display = "inline"; + sketchViewModel.on("update", (event) => { + if (event.state === "start") { + startbuttons.style.display = "none"; + actionbuttons.style.display = "inline"; - if ( - event.graphics[0].geometry.type === "polygon" || - event.graphics[0].geometry.type === "polyline" - ) { - edgeoperationbuttons.style.display = "inline"; - } - if (event.graphics[0].geometry.type === "polyline") { - extrudeSliderButton.style.display = "none"; - } + if ( + event.graphics[0].geometry.type === "polygon" || + event.graphics[0].geometry.type === "polyline" + ) { + edgeoperationbuttons.style.display = "inline"; } - if (event.state === "complete") { - startbuttons.style.display = "inline"; - actionbuttons.style.display = "none"; - edgeoperationbuttons.style.display = "none"; + if (event.graphics[0].geometry.type === "polyline") { + extrudeSliderButton.style.display = "none"; } - }); + } + if (event.state === "complete") { + startbuttons.style.display = "inline"; + actionbuttons.style.display = "none"; + edgeoperationbuttons.style.display = "none"; + } + }); - /********************************************** - * Sketching (2): Drawing UI with configuration - *********************************************/ + /********************************************** + * Sketching (2): Drawing UI with configuration + *********************************************/ - const drawButtons = Array.prototype.slice.call( - document.getElementsByClassName("starttool") - ); - const cancelBtn = document.getElementById("cancel"); - const doneBtn = document.getElementById("done"); + const drawButtons = Array.prototype.slice.call( + document.getElementsByClassName("starttool") + ); + const cancelBtn = document.getElementById("cancel"); + const doneBtn = document.getElementById("done"); - // set event listeners to activate sketching graphics - drawButtons.forEach((btn) => { - btn.addEventListener("click", (event) => { - // to activate sketching the create method is called passing in the geometry type - // from the data-type attribute of the html element - sketchViewModel.create(event.target.getAttribute("data-type")); - startbuttons.style.display = "none"; - actionbuttons.style.display = "inline"; - }); + // set event listeners to activate sketching graphics + drawButtons.forEach((btn) => { + btn.addEventListener("click", (event) => { + // to activate sketching the create method is called passing in the geometry type + // from the data-type attribute of the html element + sketchViewModel.create(event.target.getAttribute("data-type")); + startbuttons.style.display = "none"; + actionbuttons.style.display = "inline"; }); + }); - cancelBtn.addEventListener("click", (event) => { + cancelBtn.addEventListener("click", (event) => { + sketchViewModel.cancel(); + }); + doneBtn.addEventListener("click", (event) => { + if (sketchViewModel.updateGraphics.length !== 0) { + sketchViewModel.complete(); + } else { sketchViewModel.cancel(); - }); - doneBtn.addEventListener("click", (event) => { - if (sketchViewModel.updateGraphics.length !== 0) { - sketchViewModel.complete(); - } else { - sketchViewModel.cancel(); - } - }); + } + }); - // Update the building layer extrusion - extrudeSlider.on(["thumb-change", "thumb-drag"], extrudeSizeChanged); + // Update the building layer extrusion + extrudeSlider.on(["thumb-change", "thumb-drag"], extrudeSizeChanged); - function extrudeSizeChanged(event) { - const value = event.value; - document.getElementById("extrude").innerHTML = value; - const extrudedPolygon = sketchViewModel.layer.graphics.getItemAt( - sketchViewModel.layer.graphics.length - 1 - ); - const updatedSymbol = extrudedPolygon.symbol.clone(); - updatedSymbol.symbolLayers.items[0].size = value; - extrudedPolygon.symbol = updatedSymbol; - } + function extrudeSizeChanged(event) { + const value = event.value; + document.getElementById("extrude").innerHTML = value; + const extrudedPolygon = sketchViewModel.layer.graphics.getItemAt( + sketchViewModel.layer.graphics.length - 1 + ); + const updatedSymbol = extrudedPolygon.symbol.clone(); + updatedSymbol.symbolLayers.items[0].size = value; + extrudedPolygon.symbol = updatedSymbol; + } - // default values for edge/move operations - let edgeType = "split"; - let shapeType = "move"; + // default values for edge/move operations + let edgeType = "split"; + let shapeType = "move"; - // Handling the configuration for edge operation - const noneEdgeBtn = document.getElementById("none-edge-button"); - const splitEdgeBtn = document.getElementById("split-edge-button"); - const offsetEdgeBtn = document.getElementById("offset-edge-button"); - noneEdgeBtn.onclick = edgeChangedClickHandler; - splitEdgeBtn.onclick = edgeChangedClickHandler; - offsetEdgeBtn.onclick = edgeChangedClickHandler; + // Handling the configuration for edge operation + const noneEdgeBtn = document.getElementById("none-edge-button"); + const splitEdgeBtn = document.getElementById("split-edge-button"); + const offsetEdgeBtn = document.getElementById("offset-edge-button"); + noneEdgeBtn.onclick = edgeChangedClickHandler; + splitEdgeBtn.onclick = edgeChangedClickHandler; + offsetEdgeBtn.onclick = edgeChangedClickHandler; - function edgeChangedClickHandler(event) { - edgeType = event.target.value; + function edgeChangedClickHandler(event) { + edgeType = event.target.value; - // handle the buttons - const buttons = document.getElementsByClassName("edge-button"); - for (const button of buttons) { - button.classList.remove("edge-button-selected"); - } - this.classList.add("edge-button-selected"); - restartUpdateMode({ - reshapeOptions: { - edgeOperation: edgeType, - shapeOperation: shapeType, - }, - }); + // handle the buttons + const buttons = document.getElementsByClassName("edge-button"); + for (const button of buttons) { + button.classList.remove("edge-button-selected"); } + this.classList.add("edge-button-selected"); + restartUpdateMode({ + reshapeOptions: { + edgeOperation: edgeType, + shapeOperation: shapeType, + }, + }); + } - // Handling the configuration for move operation - const noneShapeButton = document.getElementById("none-shape-button"); - const moveShapeButton = document.getElementById("move-shape-button"); - noneShapeButton.onclick = shapeChangedClickHandler; - moveShapeButton.onclick = shapeChangedClickHandler; + // Handling the configuration for move operation + const noneShapeButton = document.getElementById("none-shape-button"); + const moveShapeButton = document.getElementById("move-shape-button"); + noneShapeButton.onclick = shapeChangedClickHandler; + moveShapeButton.onclick = shapeChangedClickHandler; - function shapeChangedClickHandler(event) { - shapeType = event.target.value; + function shapeChangedClickHandler(event) { + shapeType = event.target.value; - // handle the buttons - const buttons = document.getElementsByClassName("shape-button"); - for (const button of buttons) { - button.classList.remove("shape-button-selected"); - } - this.classList.add("shape-button-selected"); - restartUpdateMode({ - reshapeOptions: { - edgeOperation: edgeType, - shapeOperation: shapeType, - }, - }); + // handle the buttons + const buttons = document.getElementsByClassName("shape-button"); + for (const button of buttons) { + button.classList.remove("shape-button-selected"); } + this.classList.add("shape-button-selected"); + restartUpdateMode({ + reshapeOptions: { + edgeOperation: edgeType, + shapeOperation: shapeType, + }, + }); + } - function restartUpdateMode(updateOptions) { - sketchViewModel.defaultUpdateOptions = { - ...sketchViewModel.defaultUpdateOptions, - ...updateOptions, - }; + function restartUpdateMode(updateOptions) { + sketchViewModel.defaultUpdateOptions = { + ...sketchViewModel.defaultUpdateOptions, + ...updateOptions, + }; - if (sketchViewModel.activeTool) { - if ( - sketchViewModel.activeTool === "transform" || - sketchViewModel.activeTool === "move" || - sketchViewModel.activeTool === "reshape" - ) { - updateOptions.tool = sketchViewModel.activeTool; - sketchViewModel.update( - sketchViewModel.updateGraphics.toArray(), - updateOptions - ); - } + if (sketchViewModel.activeTool) { + if ( + sketchViewModel.activeTool === "transform" || + sketchViewModel.activeTool === "move" || + sketchViewModel.activeTool === "reshape" + ) { + updateOptions.tool = sketchViewModel.activeTool; + sketchViewModel.update( + sketchViewModel.updateGraphics.toArray(), + updateOptions + ); } } - }, -})); + } +}; + +export { setupSketch }; diff --git a/modules/slice.js b/modules/slice.js index a51e2c1..17f1eed 100644 --- a/modules/slice.js +++ b/modules/slice.js @@ -1,7 +1,10 @@ -define(["esri/widgets/Slice"], (Slice) => ({ - setupSlice: (view) => - new Slice({ - view: view, - container: "slicing-container" - }), -})); +import Slice from "@arcgis/core/widgets/Slice.js"; + +const setupSlice = (view) => { + return new Slice({ + view: view, + container: "slicing-container", + }); +}; + +export { setupSlice }; diff --git a/modules/slider.js b/modules/slider.js index 2dbdca7..7e1b7bf 100644 --- a/modules/slider.js +++ b/modules/slider.js @@ -1,28 +1,31 @@ -define(["esri/widgets/Slider"], (Slider) => ({ - setupSlider: (container, label) => - new Slider({ - min: 0, - max: 1, - precision: 2, - values: [1], - visibleElements: { - labels: label, - rangeLabels: true, - }, - container: container, - }), +import Slider from "@arcgis/core/widgets/Slider.js"; - setupSliderStyle: () => { - const itemPanelDiv = document.createElement("div"); - const sliderDiv = document.createElement("calcite-slider"); +const setupSlider = (container, label) => { + return new Slider({ + min: 0, + max: 1, + precision: 2, + values: [1], + visibleElements: { + labels: label, + rangeLabels: true, + }, + container: container, + }); +}; - // Set attributes for the slider - sliderDiv.min = 0; - sliderDiv.max = 100; - sliderDiv.step = 1; - sliderDiv.value = 100; - sliderDiv.labelHandles = "true"; +const setupSliderStyle = () => { + const itemPanelDiv = document.createElement("div"); + const sliderDiv = document.createElement("calcite-slider"); - return [itemPanelDiv, sliderDiv]; - }, -})); + // Set attributes for the slider + sliderDiv.min = 0; + sliderDiv.max = 100; + sliderDiv.step = 1; + sliderDiv.value = 100; + sliderDiv.labelHandles = true; + + return [itemPanelDiv, sliderDiv]; +}; + +export { setupSlider, setupSliderStyle }; diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 469c8f9..3954dce 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4,6 +4,21 @@ "lockfileVersion": 3, "requires": true, "packages": { + "node_modules/@arcgis/core": { + "version": "4.28.10", + "resolved": "https://registry.npmjs.org/@arcgis/core/-/core-4.28.10.tgz", + "integrity": "sha512-FKvicMVDwFuKX8JKLqAfukzQU2F3AG7s3tDigTcIC4ApGRbj7Nc/F9dRfPZo+aY1Vl7Sa1FjYlo6tfV93LJ2Eg==", + "dependencies": { + "@esri/arcgis-html-sanitizer": "~3.0.1", + "@esri/calcite-colors": "~6.1.0", + "@esri/calcite-components": "^1.9.2", + "@popperjs/core": "~2.11.8", + "@zip.js/zip.js": "~2.7.29", + "focus-trap": "~7.5.3", + "luxon": "~3.4.3", + "sortablejs": "~1.15.0" + } + }, "node_modules/@esbuild/linux-x64": { "version": "0.19.9", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.9.tgz", @@ -20,6 +35,72 @@ "node": ">=12" } }, + "node_modules/@esri/arcgis-html-sanitizer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@esri/arcgis-html-sanitizer/-/arcgis-html-sanitizer-3.0.1.tgz", + "integrity": "sha512-cwZJwsYCJZwtBQU2AmaiIVFg5nZcVwInPYja1/OgC9iKYO+ytZRoc5h+0S9/ygbFNoS8Nd0RX9A85stLX/BgiA==", + "dependencies": { + "xss": "1.0.13" + } + }, + "node_modules/@esri/calcite-colors": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@esri/calcite-colors/-/calcite-colors-6.1.0.tgz", + "integrity": "sha512-wHQYWFtDa6c328EraXEVZvgOiaQyYr0yuaaZ0G3cB4C3lSkWefW34L/e5TLAhtuG3zJ/wR6pl5X1YYNfBc0/4Q==" + }, + "node_modules/@esri/calcite-components": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@esri/calcite-components/-/calcite-components-1.11.0.tgz", + "integrity": "sha512-H0ZqX3fEv4i0JCBEZ5SarPpd1KeXvqlEpLTtforfifIYbFAQOshP5fC2tFSL7j5pECyhBuB7rRhBiFeFejpRDw==", + "dependencies": { + "@floating-ui/dom": "1.5.3", + "@stencil/core": "2.22.3", + "@types/color": "3.0.5", + "color": "4.2.3", + "composed-offset-position": "0.0.4", + "dayjs": "1.11.10", + "focus-trap": "7.5.4", + "lodash-es": "4.17.21", + "sortablejs": "1.15.0", + "timezone-groups": "0.8.0" + } + }, + "node_modules/@esri/calcite-components/node_modules/sortablejs": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.0.tgz", + "integrity": "sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==" + }, + "node_modules/@floating-ui/core": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.2.tgz", + "integrity": "sha512-Ii3MrfY/GAIN3OhXNzpCKaLxHQfJF9qvwq/kEJYdqDxeIHa01K8sldugal6TmeeXl+WMvhv9cnVzUTaFFJF09A==", + "dependencies": { + "@floating-ui/utils": "^0.1.3" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", + "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", + "dependencies": { + "@floating-ui/core": "^1.4.2", + "@floating-ui/utils": "^0.1.3" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz", + "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.1.tgz", @@ -46,6 +127,106 @@ "linux" ] }, + "node_modules/@stencil/core": { + "version": "2.22.3", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.22.3.tgz", + "integrity": "sha512-kmVA0M/HojwsfkeHsifvHVIYe4l5tin7J5+DLgtl8h6WWfiMClND5K3ifCXXI2ETDNKiEk21p6jql3Fx9o2rng==", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=12.10.0", + "npm": ">=6.0.0" + } + }, + "node_modules/@types/color": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/color/-/color-3.0.5.tgz", + "integrity": "sha512-T9yHCNtd8ap9L/r8KEESu5RDMLkoWXHo7dTureNoI1dbp25NsCN054vOu09iniIjR21MXUL+LU9bkIWrbyg8gg==", + "dependencies": { + "@types/color-convert": "*" + } + }, + "node_modules/@types/color-convert": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.3.tgz", + "integrity": "sha512-2Q6wzrNiuEvYxVQqhh7sXM2mhIhvZR/Paq4FdsQkOMgWsCIkKvSGj8Le1/XalulrmgOzPMqNa0ix+ePY4hTrfg==", + "dependencies": { + "@types/color-name": "*" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-87W6MJCKZYDhLAx/J1ikW8niMvmGRyY+rpUxWpL1cO7F8Uu5CHuQoFv+R0/L5pgNdW4jTyda42kv60uwVIPjLw==" + }, + "node_modules/@zip.js/zip.js": { + "version": "2.7.32", + "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.32.tgz", + "integrity": "sha512-9Ox1meDIvIKE23LLA7Fxd/ewJpKjj2KryH92doHRqx2406LmIzorsiMawL0qIK7dvwN9K+mfk47lauoIE0o1zQ==", + "engines": { + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=16.5.0" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/composed-offset-position": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/composed-offset-position/-/composed-offset-position-0.0.4.tgz", + "integrity": "sha512-vMlvu1RuNegVE0YsCDSV/X4X10j56mq7PCIyOKK74FxkXzGLwhOUmdkJLSdOBOMwWycobGUMgft2lp+YgTe8hw==" + }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/esbuild": { "version": "0.19.9", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.9.tgz", @@ -83,6 +264,32 @@ "@esbuild/win32-x64": "0.19.9" } }, + "node_modules/focus-trap": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.4.tgz", + "integrity": "sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==", + "dependencies": { + "tabbable": "^6.2.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "node_modules/luxon": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", + "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "engines": { + "node": ">=12" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -164,6 +371,19 @@ "fsevents": "~2.3.2" } }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/sortablejs": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.1.tgz", + "integrity": "sha512-P5Cjvb0UG1ZVNiDPj/n4V+DinttXG6K8n7vM/HQf0C25K3YKQTQY6fsr/sEGsJGpQ9exmPxluHxKBc0mLKU1lQ==" + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -173,6 +393,19 @@ "node": ">=0.10.0" } }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, + "node_modules/timezone-groups": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/timezone-groups/-/timezone-groups-0.8.0.tgz", + "integrity": "sha512-t7E/9sPfCU0m0ZbS7Cqw52D6CB/UyeaiIBmyJCokI1SyOyOgA/ESiQ/fbreeFaUG9QSenGlZSSk/7rEbkipbOA==", + "bin": { + "timezone-groups": "dist/cli.cjs" + } + }, "node_modules/vite": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz", @@ -227,6 +460,21 @@ "optional": true } } + }, + "node_modules/xss": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.13.tgz", + "integrity": "sha512-clu7dxTm1e8Mo5fz3n/oW3UCXBfV89xZ72jM8yzo1vR/pIS0w3sgB3XV2H8Vm6zfGnHL0FzvLJPJEBhd86/z4Q==", + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } } } } diff --git a/node_modules/.vite/deps/_metadata.json b/node_modules/.vite/deps/_metadata.json index e406626..fb9b63a 100644 --- a/node_modules/.vite/deps/_metadata.json +++ b/node_modules/.vite/deps/_metadata.json @@ -1,8 +1,3520 @@ { - "hash": "f7fd542a", + "hash": "ad78a400", "configHash": "3ab5ebea", - "lockfileHash": "c30b2c50", - "browserHash": "d7701337", - "optimized": {}, - "chunks": {} + "lockfileHash": "5d285975", + "browserHash": "67904628", + "optimized": { + "@arcgis/core/widgets/CoordinateConversion/support/Conversion.js": { + "src": "../../@arcgis/core/widgets/CoordinateConversion/support/Conversion.js", + "file": "@arcgis_core_widgets_CoordinateConversion_support_Conversion__js.js", + "fileHash": "8f61eb3a", + "needsInterop": false + }, + "@arcgis/core/widgets/Measurement.js": { + "src": "../../@arcgis/core/widgets/Measurement.js", + "file": "@arcgis_core_widgets_Measurement__js.js", + "fileHash": "53b4f0dc", + "needsInterop": false + }, + "@arcgis/core/layers/GraphicsLayer.js": { + "src": "../../@arcgis/core/layers/GraphicsLayer.js", + "file": "@arcgis_core_layers_GraphicsLayer__js.js", + "fileHash": "216bdf80", + "needsInterop": false + }, + "@arcgis/core/layers/SceneLayer.js": { + "src": "../../@arcgis/core/layers/SceneLayer.js", + "file": "@arcgis_core_layers_SceneLayer__js.js", + "fileHash": "db1a0729", + "needsInterop": false + }, + "@arcgis/core/layers/WMSLayer.js": { + "src": "../../@arcgis/core/layers/WMSLayer.js", + "file": "@arcgis_core_layers_WMSLayer__js.js", + "fileHash": "764dd5b3", + "needsInterop": false + }, + "@arcgis/core/layers/GroupLayer.js": { + "src": "../../@arcgis/core/layers/GroupLayer.js", + "file": "@arcgis_core_layers_GroupLayer__js.js", + "fileHash": "20f8a17b", + "needsInterop": false + }, + "@arcgis/core/WebScene.js": { + "src": "../../@arcgis/core/WebScene.js", + "file": "@arcgis_core_WebScene__js.js", + "fileHash": "76e4fdd6", + "needsInterop": false + }, + "@arcgis/core/views/SceneView.js": { + "src": "../../@arcgis/core/views/SceneView.js", + "file": "@arcgis_core_views_SceneView__js.js", + "fileHash": "e6d49416", + "needsInterop": false + }, + "@arcgis/core/widgets/LayerList.js": { + "src": "../../@arcgis/core/widgets/LayerList.js", + "file": "@arcgis_core_widgets_LayerList__js.js", + "fileHash": "ef5c8c85", + "needsInterop": false + }, + "@arcgis/core/widgets/Expand.js": { + "src": "../../@arcgis/core/widgets/Expand.js", + "file": "@arcgis_core_widgets_Expand__js.js", + "fileHash": "706602e0", + "needsInterop": false + }, + "@arcgis/core/Basemap.js": { + "src": "../../@arcgis/core/Basemap.js", + "file": "@arcgis_core_Basemap__js.js", + "fileHash": "45666129", + "needsInterop": false + }, + "@arcgis/core/widgets/BasemapGallery.js": { + "src": "../../@arcgis/core/widgets/BasemapGallery.js", + "file": "@arcgis_core_widgets_BasemapGallery__js.js", + "fileHash": "9e376eec", + "needsInterop": false + }, + "@arcgis/core/widgets/CoordinateConversion.js": { + "src": "../../@arcgis/core/widgets/CoordinateConversion.js", + "file": "@arcgis_core_widgets_CoordinateConversion__js.js", + "fileHash": "beb88484", + "needsInterop": false + }, + "@arcgis/core/widgets/CoordinateConversion/support/Format.js": { + "src": "../../@arcgis/core/widgets/CoordinateConversion/support/Format.js", + "file": "@arcgis_core_widgets_CoordinateConversion_support_Format__js.js", + "fileHash": "71a17c58", + "needsInterop": false + }, + "@arcgis/core/geometry/Point.js": { + "src": "../../@arcgis/core/geometry/Point.js", + "file": "@arcgis_core_geometry_Point__js.js", + "fileHash": "7f0ecf22", + "needsInterop": false + }, + "@arcgis/core/widgets/LineOfSight.js": { + "src": "../../@arcgis/core/widgets/LineOfSight.js", + "file": "@arcgis_core_widgets_LineOfSight__js.js", + "fileHash": "7254c537", + "needsInterop": false + }, + "@arcgis/core/widgets/Search.js": { + "src": "../../@arcgis/core/widgets/Search.js", + "file": "@arcgis_core_widgets_Search__js.js", + "fileHash": "f5cb7f08", + "needsInterop": false + }, + "@arcgis/core/widgets/Search/SearchSource.js": { + "src": "../../@arcgis/core/widgets/Search/SearchSource.js", + "file": "@arcgis_core_widgets_Search_SearchSource__js.js", + "fileHash": "9187276e", + "needsInterop": false + }, + "@arcgis/core/Graphic.js": { + "src": "../../@arcgis/core/Graphic.js", + "file": "@arcgis_core_Graphic__js.js", + "fileHash": "4e0f6c38", + "needsInterop": false + }, + "@arcgis/core/request.js": { + "src": "../../@arcgis/core/request.js", + "file": "@arcgis_core_request__js.js", + "fileHash": "47fd1757", + "needsInterop": false + }, + "@arcgis/core/geometry/geometryEngine.js": { + "src": "../../@arcgis/core/geometry/geometryEngine.js", + "file": "@arcgis_core_geometry_geometryEngine__js.js", + "fileHash": "2f2bb506", + "needsInterop": false + }, + "@arcgis/core/widgets/Sketch/SketchViewModel.js": { + "src": "../../@arcgis/core/widgets/Sketch/SketchViewModel.js", + "file": "@arcgis_core_widgets_Sketch_SketchViewModel__js.js", + "fileHash": "c960d5b9", + "needsInterop": false + }, + "@arcgis/core/widgets/Slider.js": { + "src": "../../@arcgis/core/widgets/Slider.js", + "file": "@arcgis_core_widgets_Slider__js.js", + "fileHash": "316e9730", + "needsInterop": false + }, + "@arcgis/core/widgets/Daylight.js": { + "src": "../../@arcgis/core/widgets/Daylight.js", + "file": "@arcgis_core_widgets_Daylight__js.js", + "fileHash": "cd59cd27", + "needsInterop": false + }, + "@arcgis/core/widgets/ElevationProfile.js": { + "src": "../../@arcgis/core/widgets/ElevationProfile.js", + "file": "@arcgis_core_widgets_ElevationProfile__js.js", + "fileHash": "9458765d", + "needsInterop": false + }, + "@arcgis/core/widgets/ShadowCast.js": { + "src": "../../@arcgis/core/widgets/ShadowCast.js", + "file": "@arcgis_core_widgets_ShadowCast__js.js", + "fileHash": "93c018dd", + "needsInterop": false + }, + "@arcgis/core/widgets/Slice.js": { + "src": "../../@arcgis/core/widgets/Slice.js", + "file": "@arcgis_core_widgets_Slice__js.js", + "fileHash": "bb0f6c0e", + "needsInterop": false + }, + "@arcgis/core/widgets/Locate.js": { + "src": "../../@arcgis/core/widgets/Locate.js", + "file": "@arcgis_core_widgets_Locate__js.js", + "fileHash": "1a9c2df2", + "needsInterop": false + }, + "@arcgis/core/layers/ElevationLayer.js": { + "src": "../../@arcgis/core/layers/ElevationLayer.js", + "file": "@arcgis_core_layers_ElevationLayer__js.js", + "fileHash": "b3019413", + "needsInterop": false + }, + "@arcgis/core/Viewpoint.js": { + "src": "../../@arcgis/core/Viewpoint.js", + "file": "@arcgis_core_Viewpoint__js.js", + "fileHash": "bf4580c7", + "needsInterop": false + }, + "@arcgis/core/Camera.js": { + "src": "../../@arcgis/core/Camera.js", + "file": "@arcgis_core_Camera__js.js", + "fileHash": "8f8a8122", + "needsInterop": false + }, + "@arcgis/core/widgets/Legend.js": { + "src": "../../@arcgis/core/widgets/Legend.js", + "file": "@arcgis_core_widgets_Legend__js.js", + "fileHash": "fd2c7368", + "needsInterop": false + }, + "@arcgis/core/config": { + "src": "../../@arcgis/core/config.js", + "file": "@arcgis_core_config.js", + "fileHash": "23e25716", + "needsInterop": false + }, + "@arcgis/core/config.js": { + "src": "../../@arcgis/core/config.js", + "file": "@arcgis_core_config__js.js", + "fileHash": "964e1c1a", + "needsInterop": false + } + }, + "chunks": { + "calcite-color-picker-BLF6VWMJ": { + "file": "calcite-color-picker-BLF6VWMJ.js" + }, + "calcite-slider-WQT2QDND": { + "file": "calcite-slider-WQT2QDND.js" + }, + "chunk-7J3D4FPA": { + "file": "chunk-7J3D4FPA.js" + }, + "calcite-dropdown-BTBUPHIE": { + "file": "calcite-dropdown-BTBUPHIE.js" + }, + "calcite-dropdown-group-7CVQKC35": { + "file": "calcite-dropdown-group-7CVQKC35.js" + }, + "calcite-dropdown-item-64QP3S2I": { + "file": "calcite-dropdown-item-64QP3S2I.js" + }, + "chunk-ZQPZQY24": { + "file": "chunk-ZQPZQY24.js" + }, + "calcite-checkbox-3AL4JM7X": { + "file": "calcite-checkbox-3AL4JM7X.js" + }, + "ElevationProfileView2D-MDHBQBRA": { + "file": "ElevationProfileView2D-MDHBQBRA.js" + }, + "ElevationProfileView3D-CHBEUMU7": { + "file": "ElevationProfileView3D-CHBEUMU7.js" + }, + "chunk-QH7FHUMW": { + "file": "chunk-QH7FHUMW.js" + }, + "calcite-popover-BLVDJOI6": { + "file": "calcite-popover-BLVDJOI6.js" + }, + "chartUtils-MUPLYZU5": { + "file": "chartUtils-MUPLYZU5.js" + }, + "calcite-scrim-4FT5VTES": { + "file": "calcite-scrim-4FT5VTES.js" + }, + "calcite-chip-Q3DU4MW7": { + "file": "calcite-chip-Q3DU4MW7.js" + }, + "calcite-input-BJGBUQP6": { + "file": "calcite-input-BJGBUQP6.js" + }, + "editingTools-NJFONYEO": { + "file": "editingTools-NJFONYEO.js" + }, + "editingTools-UF6KVPMM": { + "file": "editingTools-UF6KVPMM.js" + }, + "chunk-B7SQ57CI": { + "file": "chunk-B7SQ57CI.js" + }, + "chunk-R4ALIGR5": { + "file": "chunk-R4ALIGR5.js" + }, + "GraphicMover-5BPOBJOE": { + "file": "GraphicMover-5BPOBJOE.js" + }, + "Box-W22BFLUR": { + "file": "Box-W22BFLUR.js" + }, + "chunk-AEZCAA76": { + "file": "chunk-AEZCAA76.js" + }, + "Reshape-NANFMDGP": { + "file": "Reshape-NANFMDGP.js" + }, + "chunk-2CA2XXMJ": { + "file": "chunk-2CA2XXMJ.js" + }, + "chunk-4RIJEHTH": { + "file": "chunk-4RIJEHTH.js" + }, + "chunk-EUY3HPCN": { + "file": "chunk-EUY3HPCN.js" + }, + "chunk-YWA2EILZ": { + "file": "chunk-YWA2EILZ.js" + }, + "chunk-T6GKZ3EQ": { + "file": "chunk-T6GKZ3EQ.js" + }, + "EdgeDetect.glsl-AHXXJAIU": { + "file": "EdgeDetect__glsl-AHXXJAIU.js" + }, + "SMAAData-XJ5Z6ZCN": { + "file": "SMAAData-XJ5Z6ZCN.js" + }, + "ShadowCastVisualize.glsl-MM7IKEHP": { + "file": "ShadowCastVisualize__glsl-MM7IKEHP.js" + }, + "ShadowCastAccumulate.glsl-HRXECFMG": { + "file": "ShadowCastAccumulate__glsl-HRXECFMG.js" + }, + "EdgeShader.glsl-3JYQKYZA": { + "file": "EdgeShader__glsl-3JYQKYZA.js" + }, + "FeatureTileTree3DDebugger-MCBH56P5": { + "file": "FeatureTileTree3DDebugger-MCBH56P5.js" + }, + "GraphicsView3D-P3S57VMY": { + "file": "GraphicsView3D-P3S57VMY.js" + }, + "calcite-tooltip-GJHNSDUK": { + "file": "calcite-tooltip-GJHNSDUK.js" + }, + "mask-svg-WSTXLF5I": { + "file": "mask-svg-WSTXLF5I.js" + }, + "overlay-svg-RJWEHXAH": { + "file": "overlay-svg-RJWEHXAH.js" + }, + "HighlightApply.glsl-3WXUJBQR": { + "file": "HighlightApply__glsl-3WXUJBQR.js" + }, + "HighlightBlur.glsl-KKJGG772": { + "file": "HighlightBlur__glsl-KKJGG772.js" + }, + "HighlightDownsample.glsl-AF4Z6TPA": { + "file": "HighlightDownsample__glsl-AF4Z6TPA.js" + }, + "ShadowHighlight.glsl-3ARTDTCY": { + "file": "ShadowHighlight__glsl-3ARTDTCY.js" + }, + "BlendWeights.glsl-WSLNYT5K": { + "file": "BlendWeights__glsl-WSLNYT5K.js" + }, + "Blur.glsl-IHO6LRJE": { + "file": "Blur__glsl-IHO6LRJE.js" + }, + "Terrain.glsl-TSTTDUQX": { + "file": "Terrain__glsl-TSTTDUQX.js" + }, + "BlendLayers.glsl-LQSHHQI4": { + "file": "BlendLayers__glsl-LQSHHQI4.js" + }, + "RasterColorizer.glsl-LINMNASN": { + "file": "RasterColorizer__glsl-LINMNASN.js" + }, + "TerrainTileTree3DDebugger-RVOQGDUM": { + "file": "TerrainTileTree3DDebugger-RVOQGDUM.js" + }, + "ComponentShader.glsl-4EH3X7VV": { + "file": "ComponentShader__glsl-4EH3X7VV.js" + }, + "Compositing.glsl-GEPOA6VO": { + "file": "Compositing__glsl-GEPOA6VO.js" + }, + "HUDCompositing.glsl-OVVKOXFW": { + "file": "HUDCompositing__glsl-OVVKOXFW.js" + }, + "OITCompositing.glsl-2TFAXNJ7": { + "file": "OITCompositing__glsl-2TFAXNJ7.js" + }, + "AtmosphereCompositing.glsl-VKL4GSAB": { + "file": "AtmosphereCompositing__glsl-VKL4GSAB.js" + }, + "CloudsComposition.glsl-RYZA544B": { + "file": "CloudsComposition__glsl-RYZA544B.js" + }, + "Clouds.glsl-TRMAPLIL": { + "file": "Clouds__glsl-TRMAPLIL.js" + }, + "NoiseTextureAtlas.glsl-5W6MH2IS": { + "file": "NoiseTextureAtlas__glsl-5W6MH2IS.js" + }, + "Fog.glsl-BV244NFK": { + "file": "Fog__glsl-BV244NFK.js" + }, + "SimpleAtmosphere.glsl-LKPBVA4L": { + "file": "SimpleAtmosphere__glsl-LKPBVA4L.js" + }, + "Precipitation.glsl-R7P3LHX5": { + "file": "Precipitation__glsl-R7P3LHX5.js" + }, + "Stars.glsl-FSI6Q33S": { + "file": "Stars__glsl-FSI6Q33S.js" + }, + "WMTSLayerView3D-YPJPRB7J": { + "file": "WMTSLayerView3D-YPJPRB7J.js" + }, + "CheckerBoard.glsl-ZRD2YSQB": { + "file": "CheckerBoard__glsl-ZRD2YSQB.js" + }, + "AreaMeasurementAnalysisView3D-O7C2WHBT": { + "file": "AreaMeasurementAnalysisView3D-O7C2WHBT.js" + }, + "chunk-5T2KAVNU": { + "file": "chunk-5T2KAVNU.js" + }, + "chunk-P54B27RD": { + "file": "chunk-P54B27RD.js" + }, + "MeasurementArrow.glsl-UMHDXFJI": { + "file": "MeasurementArrow__glsl-UMHDXFJI.js" + }, + "DirectLineMeasurementAnalysisView3D-MZAX5M7K": { + "file": "DirectLineMeasurementAnalysisView3D-MZAX5M7K.js" + }, + "chunk-GBLXXUC2": { + "file": "chunk-GBLXXUC2.js" + }, + "chunk-OSMEOGOS": { + "file": "chunk-OSMEOGOS.js" + }, + "SlicePlaneMaterial.glsl-FQRXCPZW": { + "file": "SlicePlaneMaterial__glsl-FQRXCPZW.js" + }, + "SliceAnalysisView3D-TYYTBAAL": { + "file": "SliceAnalysisView3D-TYYTBAAL.js" + }, + "chunk-6I5NTLYQ": { + "file": "chunk-6I5NTLYQ.js" + }, + "chunk-S6KDOW42": { + "file": "chunk-S6KDOW42.js" + }, + "ChapmanAtmosphere.glsl-Q5J7UUIF": { + "file": "ChapmanAtmosphere__glsl-Q5J7UUIF.js" + }, + "RouteLayerView3D-FRTG3QRN": { + "file": "RouteLayerView3D-FRTG3QRN.js" + }, + "SceneLayerView3D-Q4VGVDHH": { + "file": "SceneLayerView3D-Q4VGVDHH.js" + }, + "SceneLayerGraphicsView3D-3A6F5K5D": { + "file": "SceneLayerGraphicsView3D-3A6F5K5D.js" + }, + "chunk-EMFNF3TC": { + "file": "chunk-EMFNF3TC.js" + }, + "StreamLayerView3D-HYAIQD3Z": { + "file": "StreamLayerView3D-HYAIQD3Z.js" + }, + "ImageryTileLayerView3D-XHYDAZBH": { + "file": "ImageryTileLayerView3D-XHYDAZBH.js" + }, + "VectorTileLayerView3D-KAKDTYS4": { + "file": "VectorTileLayerView3D-KAKDTYS4.js" + }, + "WFSLayerView3D-25A4V4PX": { + "file": "WFSLayerView3D-25A4V4PX.js" + }, + "WMSLayerView3D-S53CHQFV": { + "file": "WMSLayerView3D-S53CHQFV.js" + }, + "MapImageLayerView3D-ZPX6TNNF": { + "file": "MapImageLayerView3D-ZPX6TNNF.js" + }, + "MediaLayerView3D-7W6MNM22": { + "file": "MediaLayerView3D-7W6MNM22.js" + }, + "OGCFeatureLayerView3D-APROA3PF": { + "file": "OGCFeatureLayerView3D-APROA3PF.js" + }, + "PointRenderer.glsl-BH3X64FS": { + "file": "PointRenderer__glsl-BH3X64FS.js" + }, + "PointCloudLayerView3D-Y4SRQYOB": { + "file": "PointCloudLayerView3D-Y4SRQYOB.js" + }, + "chunk-JEIXSIWY": { + "file": "chunk-JEIXSIWY.js" + }, + "vxlLayer-WR65QEAT": { + "file": "vxlLayer-WR65QEAT.js" + }, + "VoxelWasmPerSceneView-PTRVQL76": { + "file": "VoxelWasmPerSceneView-PTRVQL76.js" + }, + "VoxelLayerView3D-YFLJVDAL": { + "file": "VoxelLayerView3D-YFLJVDAL.js" + }, + "chunk-M6ISXGDQ": { + "file": "chunk-M6ISXGDQ.js" + }, + "DimensionLayerView3D-YPWP5URH": { + "file": "DimensionLayerView3D-YPWP5URH.js" + }, + "GeoJSONLayerView3D-TQRNX5TA": { + "file": "GeoJSONLayerView3D-TQRNX5TA.js" + }, + "GraphicsLayerView3D-63Z6AR2V": { + "file": "GraphicsLayerView3D-63Z6AR2V.js" + }, + "chunk-QDSDZCIX": { + "file": "chunk-QDSDZCIX.js" + }, + "GroupLayerView-FWCASN7M": { + "file": "GroupLayerView-FWCASN7M.js" + }, + "ImageryLayerView3D-P2NI2TJN": { + "file": "ImageryLayerView3D-P2NI2TJN.js" + }, + "IntegratedMeshLayerView3D-PN6QKMAS": { + "file": "IntegratedMeshLayerView3D-PN6QKMAS.js" + }, + "LineOfSightAnalysisView3D-WVLFKV2H": { + "file": "LineOfSightAnalysisView3D-WVLFKV2H.js" + }, + "chunk-6HLAKGKV": { + "file": "chunk-6HLAKGKV.js" + }, + "LineOfSightLayerView3D-K5IWWG3Y": { + "file": "LineOfSightLayerView3D-K5IWWG3Y.js" + }, + "Pattern.glsl-VCZEIHL4": { + "file": "Pattern__glsl-VCZEIHL4.js" + }, + "Heatmap.glsl-Q4WGPZ5B": { + "file": "Heatmap__glsl-Q4WGPZ5B.js" + }, + "HeatmapDensity.glsl-PX3LNZL4": { + "file": "HeatmapDensity__glsl-PX3LNZL4.js" + }, + "FeatureLayerView3D-FYVXBE2Y": { + "file": "FeatureLayerView3D-FYVXBE2Y.js" + }, + "I3STreeDebugger-2MOYJL6K": { + "file": "I3STreeDebugger-2MOYJL6K.js" + }, + "BuildingSceneLayerView3D-DJFQHSDX": { + "file": "BuildingSceneLayerView3D-DJFQHSDX.js" + }, + "chunk-TQQOXD6R": { + "file": "chunk-TQQOXD6R.js" + }, + "chunk-RQ6P2GGU": { + "file": "chunk-RQ6P2GGU.js" + }, + "chunk-NNOMFAZT": { + "file": "chunk-NNOMFAZT.js" + }, + "chunk-Q5KUBJVI": { + "file": "chunk-Q5KUBJVI.js" + }, + "chunk-F5LQGPCQ": { + "file": "chunk-F5LQGPCQ.js" + }, + "CSVLayerView3D-PSTTEXOZ": { + "file": "CSVLayerView3D-PSTTEXOZ.js" + }, + "chunk-KQKRW54D": { + "file": "chunk-KQKRW54D.js" + }, + "chunk-2RHTC3W2": { + "file": "chunk-2RHTC3W2.js" + }, + "chunk-ZE3CCYWV": { + "file": "chunk-ZE3CCYWV.js" + }, + "chunk-XZFT7ACU": { + "file": "chunk-XZFT7ACU.js" + }, + "chunk-PKAVR7TE": { + "file": "chunk-PKAVR7TE.js" + }, + "chunk-7ALTKR36": { + "file": "chunk-7ALTKR36.js" + }, + "chunk-746KUBIO": { + "file": "chunk-746KUBIO.js" + }, + "DimensionAnalysisView3D-ZWQQP2DQ": { + "file": "DimensionAnalysisView3D-ZWQQP2DQ.js" + }, + "chunk-BM5ILMC7": { + "file": "chunk-BM5ILMC7.js" + }, + "chunk-L36SPKV2": { + "file": "chunk-L36SPKV2.js" + }, + "chunk-7O52W6DR": { + "file": "chunk-7O52W6DR.js" + }, + "chunk-Q3SBDY6A": { + "file": "chunk-Q3SBDY6A.js" + }, + "chunk-L4UZFZSN": { + "file": "chunk-L4UZFZSN.js" + }, + "chunk-P5AHK4MI": { + "file": "chunk-P5AHK4MI.js" + }, + "chunk-BHHA6ZVC": { + "file": "chunk-BHHA6ZVC.js" + }, + "chunk-LXEYZ35O": { + "file": "chunk-LXEYZ35O.js" + }, + "chunk-6PUOBTPQ": { + "file": "chunk-6PUOBTPQ.js" + }, + "chunk-3CKOXAPC": { + "file": "chunk-3CKOXAPC.js" + }, + "TileLayerView3D-GZEZWUKX": { + "file": "TileLayerView3D-GZEZWUKX.js" + }, + "chunk-VLZLLT7V": { + "file": "chunk-VLZLLT7V.js" + }, + "ElevationLayerView3D-PXVE4BOC": { + "file": "ElevationLayerView3D-PXVE4BOC.js" + }, + "chunk-375PZG7D": { + "file": "chunk-375PZG7D.js" + }, + "ImageMaterial.glsl-KYOFXQMF": { + "file": "ImageMaterial__glsl-KYOFXQMF.js" + }, + "BaseDynamicLayerView3D-EG5IOLOK": { + "file": "BaseDynamicLayerView3D-EG5IOLOK.js" + }, + "chunk-ERN2HGGW": { + "file": "chunk-ERN2HGGW.js" + }, + "chunk-V4L5GHKJ": { + "file": "chunk-V4L5GHKJ.js" + }, + "chunk-ZGFFKTWP": { + "file": "chunk-ZGFFKTWP.js" + }, + "chunk-MMRFTW4Z": { + "file": "chunk-MMRFTW4Z.js" + }, + "chunk-VONSFIQQ": { + "file": "chunk-VONSFIQQ.js" + }, + "chunk-FPGYYQWJ": { + "file": "chunk-FPGYYQWJ.js" + }, + "chunk-E6KHA6UZ": { + "file": "chunk-E6KHA6UZ.js" + }, + "LineCallout.glsl-4KAJ2WXF": { + "file": "LineCallout__glsl-4KAJ2WXF.js" + }, + "LineMarker.glsl-JNHXJUJA": { + "file": "LineMarker__glsl-JNHXJUJA.js" + }, + "NativeLine.glsl-BNTPFEYU": { + "file": "NativeLine__glsl-BNTPFEYU.js" + }, + "Path.glsl-53GPBKDP": { + "file": "Path__glsl-53GPBKDP.js" + }, + "previewCIMSymbol-BUD33IER": { + "file": "previewCIMSymbol-BUD33IER.js" + }, + "calcite-action-bar-XAS4ENDH": { + "file": "calcite-action-bar-XAS4ENDH.js" + }, + "calcite-action-group-ZLZXFQER": { + "file": "calcite-action-group-ZLZXFQER.js" + }, + "chunk-YH7STJBD": { + "file": "chunk-YH7STJBD.js" + }, + "calcite-flow-FLKIYKT5": { + "file": "calcite-flow-FLKIYKT5.js" + }, + "calcite-list-item-group-C53FRCIM": { + "file": "calcite-list-item-group-C53FRCIM.js" + }, + "calcite-loader-BKI3J55E": { + "file": "calcite-loader-BKI3J55E.js" + }, + "Popup-UOE7Q5ZH": { + "file": "Popup-UOE7Q5ZH.js" + }, + "chunk-X7SRHVRE": { + "file": "chunk-X7SRHVRE.js" + }, + "chunk-3TYCNK23": { + "file": "chunk-3TYCNK23.js" + }, + "chunk-JRPOAB6F": { + "file": "chunk-JRPOAB6F.js" + }, + "geometryServiceUtils-VQTCEQBN": { + "file": "geometryServiceUtils-VQTCEQBN.js" + }, + "calcite-list-item-WPEIDE3D": { + "file": "calcite-list-item-WPEIDE3D.js" + }, + "calcite-notice-WGA2U3HU": { + "file": "calcite-notice-WGA2U3HU.js" + }, + "chunk-DNE3RC3Q": { + "file": "chunk-DNE3RC3Q.js" + }, + "calcite-action-S3IIOPU3": { + "file": "calcite-action-S3IIOPU3.js" + }, + "calcite-flow-item-PZQ6WNCH": { + "file": "calcite-flow-item-PZQ6WNCH.js" + }, + "chunk-RLSWZAPS": { + "file": "chunk-RLSWZAPS.js" + }, + "chunk-TOHRR7DX": { + "file": "chunk-TOHRR7DX.js" + }, + "chunk-5G6VTMV4": { + "file": "chunk-5G6VTMV4.js" + }, + "chunk-DNWXLAKS": { + "file": "chunk-DNWXLAKS.js" + }, + "chunk-46JPD7Q4": { + "file": "chunk-46JPD7Q4.js" + }, + "chunk-XRQMCFYU": { + "file": "chunk-XRQMCFYU.js" + }, + "previewSymbol3D-PAYGEDWO": { + "file": "previewSymbol3D-PAYGEDWO.js" + }, + "previewWebStyleSymbol-G7J2Q2W2": { + "file": "previewWebStyleSymbol-G7J2Q2W2.js" + }, + "previewSymbol2D-M5LXIL5G": { + "file": "previewSymbol2D-M5LXIL5G.js" + }, + "CIMSymbolRasterizer-RM4YAENN": { + "file": "CIMSymbolRasterizer-RM4YAENN.js" + }, + "chunk-PNLREKKN": { + "file": "chunk-PNLREKKN.js" + }, + "chunk-EKNQBGH7": { + "file": "chunk-EKNQBGH7.js" + }, + "vi_VN-6CGXT35H": { + "file": "vi_VN-6CGXT35H.js" + }, + "zh_Hans-VS2ZRI5Z": { + "file": "zh_Hans-VS2ZRI5Z.js" + }, + "zh_Hant-ZDNSQFJ4": { + "file": "zh_Hant-ZDNSQFJ4.js" + }, + "chartUtilsAm5-URVAVFOW": { + "file": "chartUtilsAm5-URVAVFOW.js" + }, + "chunk-25WOGO2O": { + "file": "chunk-25WOGO2O.js" + }, + "chartCommon-DT63LBNZ": { + "file": "chartCommon-DT63LBNZ.js" + }, + "chunk-YQX6VPXN": { + "file": "chunk-YQX6VPXN.js" + }, + "chunk-FPQ6LOFC": { + "file": "chunk-FPQ6LOFC.js" + }, + "pieChart-YFV4PSD6": { + "file": "pieChart-YFV4PSD6.js" + }, + "xyChart-6ZU47RO6": { + "file": "xyChart-6ZU47RO6.js" + }, + "chunk-X3ICUOC4": { + "file": "chunk-X3ICUOC4.js" + }, + "chunk-HNVSZ6J7": { + "file": "chunk-HNVSZ6J7.js" + }, + "chunk-57EKTZDH": { + "file": "chunk-57EKTZDH.js" + }, + "chunk-X2PHYVXX": { + "file": "chunk-X2PHYVXX.js" + }, + "chunk-SKNRELSX": { + "file": "chunk-SKNRELSX.js" + }, + "chunk-NANHWZVW": { + "file": "chunk-NANHWZVW.js" + }, + "calcite-list-PQ55OG7S": { + "file": "calcite-list-PQ55OG7S.js" + }, + "chunk-DB2ON3JE": { + "file": "chunk-DB2ON3JE.js" + }, + "chunk-5UC5RQZZ": { + "file": "chunk-5UC5RQZZ.js" + }, + "chunk-EWES2AHT": { + "file": "chunk-EWES2AHT.js" + }, + "chunk-MR3AJI2L": { + "file": "chunk-MR3AJI2L.js" + }, + "chunk-N5H2FVVH": { + "file": "chunk-N5H2FVVH.js" + }, + "ru_RU-RILTP7VX": { + "file": "ru_RU-RILTP7VX.js" + }, + "sk_SK-T2FGILUV": { + "file": "sk_SK-T2FGILUV.js" + }, + "sl_SL-J2UZYTJ2": { + "file": "sl_SL-J2UZYTJ2.js" + }, + "sr_RS-O22I77T6": { + "file": "sr_RS-O22I77T6.js" + }, + "sv_SE-CV7BOIHF": { + "file": "sv_SE-CV7BOIHF.js" + }, + "th_TH-LJG52ZEC": { + "file": "th_TH-LJG52ZEC.js" + }, + "tr_TR-DA7NKTZH": { + "file": "tr_TR-DA7NKTZH.js" + }, + "uk_UA-YC7NW4OS": { + "file": "uk_UA-YC7NW4OS.js" + }, + "lt_LT-RSOT6NKT": { + "file": "lt_LT-RSOT6NKT.js" + }, + "lv_LV-MGN4VHXO": { + "file": "lv_LV-MGN4VHXO.js" + }, + "nb_NO-3Y4TDNN2": { + "file": "nb_NO-3Y4TDNN2.js" + }, + "nl_NL-NNJTX4LF": { + "file": "nl_NL-NNJTX4LF.js" + }, + "pl_PL-KDBCNR5C": { + "file": "pl_PL-KDBCNR5C.js" + }, + "pt_BR-I7ZE36WB": { + "file": "pt_BR-I7ZE36WB.js" + }, + "pt_PT-HSUPIYZP": { + "file": "pt_PT-HSUPIYZP.js" + }, + "ro_RO-FSX4GLL3": { + "file": "ro_RO-FSX4GLL3.js" + }, + "fr_FR-UMCHYUJ5": { + "file": "fr_FR-UMCHYUJ5.js" + }, + "he_IL-AULGZAIT": { + "file": "he_IL-AULGZAIT.js" + }, + "hr_HR-QVJWACEJ": { + "file": "hr_HR-QVJWACEJ.js" + }, + "hu_HU-TKOD4OXN": { + "file": "hu_HU-TKOD4OXN.js" + }, + "id_ID-QPU4S747": { + "file": "id_ID-QPU4S747.js" + }, + "it_IT-SSJ3R7EX": { + "file": "it_IT-SSJ3R7EX.js" + }, + "ja_JP-S4FTWSMU": { + "file": "ja_JP-S4FTWSMU.js" + }, + "ko_KR-ZY57F3ER": { + "file": "ko_KR-ZY57F3ER.js" + }, + "de_DE-6CX66O2M": { + "file": "de_DE-6CX66O2M.js" + }, + "de_CH-XJNEKIJN": { + "file": "de_CH-XJNEKIJN.js" + }, + "el_GR-2AXUFMYF": { + "file": "el_GR-2AXUFMYF.js" + }, + "en_US-LL4OKDJ5": { + "file": "en_US-LL4OKDJ5.js" + }, + "en_CA-SMQHXZ42": { + "file": "en_CA-SMQHXZ42.js" + }, + "es_ES-EM2BL664": { + "file": "es_ES-EM2BL664.js" + }, + "et_EE-XEV3VVZ2": { + "file": "et_EE-XEV3VVZ2.js" + }, + "fi_FI-GISYWJEX": { + "file": "fi_FI-GISYWJEX.js" + }, + "viewpointUtils-PMQVBR2T": { + "file": "viewpointUtils-PMQVBR2T.js" + }, + "calcite-icon-CIXL5SZD": { + "file": "calcite-icon-CIXL5SZD.js" + }, + "ar-DGATTLH4": { + "file": "ar-DGATTLH4.js" + }, + "bg_BG-KOJ667I2": { + "file": "bg_BG-KOJ667I2.js" + }, + "bs_BA-4BNTY4WN": { + "file": "bs_BA-4BNTY4WN.js" + }, + "ca_ES-F3F2PZRT": { + "file": "ca_ES-F3F2PZRT.js" + }, + "cs_CZ-JWQSO5K4": { + "file": "cs_CZ-JWQSO5K4.js" + }, + "da_DK-3U7AV7HT": { + "file": "da_DK-3U7AV7HT.js" + }, + "ShadedColorMaterial.glsl-YQXPAHUE": { + "file": "ShadedColorMaterial__glsl-YQXPAHUE.js" + }, + "FeatureServiceSnappingSource-V6PW4H3D": { + "file": "FeatureServiceSnappingSource-V6PW4H3D.js" + }, + "chunk-SITOESX7": { + "file": "chunk-SITOESX7.js" + }, + "FeatureCollectionSnappingSource-UQCZIRHT": { + "file": "FeatureCollectionSnappingSource-UQCZIRHT.js" + }, + "GraphicsSnappingSource-SRNDDWNG": { + "file": "GraphicsSnappingSource-SRNDDWNG.js" + }, + "chunk-CC7NYBA4": { + "file": "chunk-CC7NYBA4.js" + }, + "SceneLayerSnappingSource-7FJY5TIJ": { + "file": "SceneLayerSnappingSource-7FJY5TIJ.js" + }, + "chunk-EAC55MZ6": { + "file": "chunk-EAC55MZ6.js" + }, + "AreaMeasurement3D-GVPRWAAW": { + "file": "AreaMeasurement3D-GVPRWAAW.js" + }, + "DistanceMeasurement2D-QUC5VZJ6": { + "file": "DistanceMeasurement2D-QUC5VZJ6.js" + }, + "DirectLineMeasurement3D-ZZUYIJRW": { + "file": "DirectLineMeasurement3D-ZZUYIJRW.js" + }, + "chunk-MM44GX2G": { + "file": "chunk-MM44GX2G.js" + }, + "chunk-JOQIVIXK": { + "file": "chunk-JOQIVIXK.js" + }, + "chunk-QNBK3NHV": { + "file": "chunk-QNBK3NHV.js" + }, + "chunk-3CX4CMMW": { + "file": "chunk-3CX4CMMW.js" + }, + "chunk-L2Q63MRF": { + "file": "chunk-L2Q63MRF.js" + }, + "chunk-DR57LULW": { + "file": "chunk-DR57LULW.js" + }, + "chunk-UFUWAA26": { + "file": "chunk-UFUWAA26.js" + }, + "chunk-5FEW4LP7": { + "file": "chunk-5FEW4LP7.js" + }, + "chunk-EK5CU5RS": { + "file": "chunk-EK5CU5RS.js" + }, + "chunk-YGW2N2H4": { + "file": "chunk-YGW2N2H4.js" + }, + "chunk-24QZTFDF": { + "file": "chunk-24QZTFDF.js" + }, + "chunk-MQGHMFQG": { + "file": "chunk-MQGHMFQG.js" + }, + "chunk-Y2ONL37M": { + "file": "chunk-Y2ONL37M.js" + }, + "chunk-4I5SAKV7": { + "file": "chunk-4I5SAKV7.js" + }, + "chunk-55R3RR4O": { + "file": "chunk-55R3RR4O.js" + }, + "chunk-XQXQGUFL": { + "file": "chunk-XQXQGUFL.js" + }, + "chunk-4FLHOKIV": { + "file": "chunk-4FLHOKIV.js" + }, + "chunk-C6HTWJ22": { + "file": "chunk-C6HTWJ22.js" + }, + "LaserlinePath.glsl-F6H23U6J": { + "file": "LaserlinePath__glsl-F6H23U6J.js" + }, + "chunk-CPGCDK3R": { + "file": "chunk-CPGCDK3R.js" + }, + "Laserlines.glsl-XV7KLGH2": { + "file": "Laserlines__glsl-XV7KLGH2.js" + }, + "chunk-DCYIQUDF": { + "file": "chunk-DCYIQUDF.js" + }, + "chunk-ZHRVEZUH": { + "file": "chunk-ZHRVEZUH.js" + }, + "RibbonLine.glsl-SYMWWTF5": { + "file": "RibbonLine__glsl-SYMWWTF5.js" + }, + "WaterSurface.glsl-QDLCIWM2": { + "file": "WaterSurface__glsl-QDLCIWM2.js" + }, + "TextureOnly.glsl-CQK42ZLG": { + "file": "TextureOnly__glsl-CQK42ZLG.js" + }, + "OverlayCompositing.glsl-IHX2MWII": { + "file": "OverlayCompositing__glsl-IHX2MWII.js" + }, + "HUDMaterial.glsl-NUNMQOW3": { + "file": "HUDMaterial__glsl-NUNMQOW3.js" + }, + "ColorMaterial.glsl-KNOQM6YE": { + "file": "ColorMaterial__glsl-KNOQM6YE.js" + }, + "WFSLayer-BTRGIYOY": { + "file": "WFSLayer-BTRGIYOY.js" + }, + "WMTSLayer-EAJMA4RH": { + "file": "WMTSLayer-EAJMA4RH.js" + }, + "layersCreator-JJMGFG6G": { + "file": "layersCreator-JJMGFG6G.js" + }, + "calcite-label-M3UIS25O": { + "file": "calcite-label-M3UIS25O.js" + }, + "calcite-option-WKWOBJ4A": { + "file": "calcite-option-WKWOBJ4A.js" + }, + "calcite-select-ZSQ67WXO": { + "file": "calcite-select-ZSQ67WXO.js" + }, + "calcite-button-XYIL7XMI": { + "file": "calcite-button-XYIL7XMI.js" + }, + "chunk-WAQ6GKJK": { + "file": "chunk-WAQ6GKJK.js" + }, + "chunk-CWHWNNEB": { + "file": "chunk-CWHWNNEB.js" + }, + "chunk-32EOHKUT": { + "file": "chunk-32EOHKUT.js" + }, + "chunk-PTDP5H3S": { + "file": "chunk-PTDP5H3S.js" + }, + "chunk-KEBPQSUM": { + "file": "chunk-KEBPQSUM.js" + }, + "chunk-XQXKIXW6": { + "file": "chunk-XQXKIXW6.js" + }, + "chunk-WFSA7QS2": { + "file": "chunk-WFSA7QS2.js" + }, + "chunk-PKPGR36T": { + "file": "chunk-PKPGR36T.js" + }, + "chunk-JBDORJGN": { + "file": "chunk-JBDORJGN.js" + }, + "chunk-AARW7PQM": { + "file": "chunk-AARW7PQM.js" + }, + "chunk-AG5F227F": { + "file": "chunk-AG5F227F.js" + }, + "chunk-YV4ROLRY": { + "file": "chunk-YV4ROLRY.js" + }, + "AreaMeasurement2D-F3MMOP3G": { + "file": "AreaMeasurement2D-F3MMOP3G.js" + }, + "chunk-OBCMLYZD": { + "file": "chunk-OBCMLYZD.js" + }, + "chunk-WYDLNKMS": { + "file": "chunk-WYDLNKMS.js" + }, + "chunk-EMZTB2MI": { + "file": "chunk-EMZTB2MI.js" + }, + "chunk-PLJMMY5W": { + "file": "chunk-PLJMMY5W.js" + }, + "chunk-7SQIKIOX": { + "file": "chunk-7SQIKIOX.js" + }, + "chunk-XAFGSOHT": { + "file": "chunk-XAFGSOHT.js" + }, + "chunk-UQWFBN2Z": { + "file": "chunk-UQWFBN2Z.js" + }, + "chunk-4DIWCZZ4": { + "file": "chunk-4DIWCZZ4.js" + }, + "chunk-YMZPNOYS": { + "file": "chunk-YMZPNOYS.js" + }, + "chunk-YG3FIYDP": { + "file": "chunk-YG3FIYDP.js" + }, + "chunk-WFWKSXIR": { + "file": "chunk-WFWKSXIR.js" + }, + "chunk-TKODSDC7": { + "file": "chunk-TKODSDC7.js" + }, + "chunk-W5PADYIC": { + "file": "chunk-W5PADYIC.js" + }, + "RouteLayer-GP54LWML": { + "file": "RouteLayer-GP54LWML.js" + }, + "chunk-K7ZIRBUJ": { + "file": "chunk-K7ZIRBUJ.js" + }, + "streamLayerUtils-7ID4OQS7": { + "file": "streamLayerUtils-7ID4OQS7.js" + }, + "StreamLayer-37V5OUO6": { + "file": "StreamLayer-37V5OUO6.js" + }, + "TileLayer-7UP3LAFQ": { + "file": "TileLayer-7UP3LAFQ.js" + }, + "UnknownLayer-SBVSDUVA": { + "file": "UnknownLayer-SBVSDUVA.js" + }, + "UnsupportedLayer-CJFLXSSV": { + "file": "UnsupportedLayer-CJFLXSSV.js" + }, + "VectorTileLayer-CVBDQGVL": { + "file": "VectorTileLayer-CVBDQGVL.js" + }, + "VoxelLayer-X5VT37LN": { + "file": "VoxelLayer-X5VT37LN.js" + }, + "MapImageLayer-UN2NMBCH": { + "file": "MapImageLayer-UN2NMBCH.js" + }, + "chunk-64MVVML4": { + "file": "chunk-64MVVML4.js" + }, + "MapNotesLayer-EC7AQ3GM": { + "file": "MapNotesLayer-EC7AQ3GM.js" + }, + "MediaLayer-ZVAP5XST": { + "file": "MediaLayer-ZVAP5XST.js" + }, + "chunk-KD4SNB7X": { + "file": "chunk-KD4SNB7X.js" + }, + "chunk-R3TAUFOM": { + "file": "chunk-R3TAUFOM.js" + }, + "OGCFeatureLayer-TT5552RB": { + "file": "OGCFeatureLayer-TT5552RB.js" + }, + "WebTileLayer-6RQKXCUW": { + "file": "WebTileLayer-6RQKXCUW.js" + }, + "OpenStreetMapLayer-YJQDJXPO": { + "file": "OpenStreetMapLayer-YJQDJXPO.js" + }, + "chunk-SVX6C52H": { + "file": "chunk-SVX6C52H.js" + }, + "OrientedImageryLayer-XMVH4NOK": { + "file": "OrientedImageryLayer-XMVH4NOK.js" + }, + "PointCloudLayer-I6I3U4WI": { + "file": "PointCloudLayer-I6I3U4WI.js" + }, + "ImageryTileLayer-OC6HJPH4": { + "file": "ImageryTileLayer-OC6HJPH4.js" + }, + "IntegratedMeshLayer-34WWY4E4": { + "file": "IntegratedMeshLayer-34WWY4E4.js" + }, + "chunk-LOW7XJHU": { + "file": "chunk-LOW7XJHU.js" + }, + "KMLLayer-VDWIWNIR": { + "file": "KMLLayer-VDWIWNIR.js" + }, + "LineOfSightLayer-QTMKOYLF": { + "file": "LineOfSightLayer-QTMKOYLF.js" + }, + "arcgis-knowledge-client-core-simd-YXLA7YQW": { + "file": "arcgis-knowledge-client-core-simd-YXLA7YQW.js" + }, + "arcgis-knowledge-client-core-QNFRDZHH": { + "file": "arcgis-knowledge-client-core-QNFRDZHH.js" + }, + "lclayout-O4A5ZWDV": { + "file": "lclayout-O4A5ZWDV.js" + }, + "LinkChartLayer-7XPOISGA": { + "file": "LinkChartLayer-7XPOISGA.js" + }, + "SSAOBlur.glsl-G3HRZM5Q": { + "file": "SSAOBlur__glsl-G3HRZM5Q.js" + }, + "SSAO.glsl-3LKYBOWJ": { + "file": "SSAO__glsl-3LKYBOWJ.js" + }, + "DefaultMaterial.glsl-3G5NMMNF": { + "file": "DefaultMaterial__glsl-3G5NMMNF.js" + }, + "RealisticTree.glsl-FH7QE3YC": { + "file": "RealisticTree__glsl-FH7QE3YC.js" + }, + "objectResourceUtils-PMRF23UI": { + "file": "objectResourceUtils-PMRF23UI.js" + }, + "symbolLayerUtils-OWWNLOFQ": { + "file": "symbolLayerUtils-OWWNLOFQ.js" + }, + "imageryUtils-E3INK4IU": { + "file": "imageryUtils-E3INK4IU.js" + }, + "ImageryLayer-M5YXEDQN": { + "file": "ImageryLayer-M5YXEDQN.js" + }, + "chunk-K27XLTOE": { + "file": "chunk-K27XLTOE.js" + }, + "BingMapsLayer-BUOBPGV2": { + "file": "BingMapsLayer-BUOBPGV2.js" + }, + "BuildingSceneLayer-KCPSUBAU": { + "file": "BuildingSceneLayer-KCPSUBAU.js" + }, + "chunk-SQCRGVWL": { + "file": "chunk-SQCRGVWL.js" + }, + "chunk-HXTV2Y4Y": { + "file": "chunk-HXTV2Y4Y.js" + }, + "CSVLayer-2YBWMTQY": { + "file": "CSVLayer-2YBWMTQY.js" + }, + "DimensionLayer-GYFEE3GP": { + "file": "DimensionLayer-GYFEE3GP.js" + }, + "chunk-ZKY5APWG": { + "file": "chunk-ZKY5APWG.js" + }, + "ElevationQuery-SYPJWXTS": { + "file": "ElevationQuery-SYPJWXTS.js" + }, + "GeoJSONLayer-ZWIU3QQZ": { + "file": "GeoJSONLayer-ZWIU3QQZ.js" + }, + "GeoRSSLayer-6CPYV2JH": { + "file": "GeoRSSLayer-6CPYV2JH.js" + }, + "basis_transcoder-EBUNUAMV": { + "file": "basis_transcoder-EBUNUAMV.js" + }, + "featureSetUtils-3HHJF3VC": { + "file": "featureSetUtils-3HHJF3VC.js" + }, + "featuresetbase-DIWAHBHW": { + "file": "featuresetbase-DIWAHBHW.js" + }, + "chunk-43VKMDRS": { + "file": "chunk-43VKMDRS.js" + }, + "featuresetgeom-QN6YUX6Q": { + "file": "featuresetgeom-QN6YUX6Q.js" + }, + "chunk-XW3S4KRB": { + "file": "chunk-XW3S4KRB.js" + }, + "featuresetstats-W57NQ4TO": { + "file": "featuresetstats-W57NQ4TO.js" + }, + "featuresetstring-KY33UFK5": { + "file": "featuresetstring-KY33UFK5.js" + }, + "arcadeUtils-6FBUI47J": { + "file": "arcadeUtils-6FBUI47J.js" + }, + "groupLayerUtils-IARHROQP": { + "file": "groupLayerUtils-IARHROQP.js" + }, + "arcgisLayers-JRSKDYWI": { + "file": "arcgisLayers-JRSKDYWI.js" + }, + "i3s-T7OROI2R": { + "file": "i3s-T7OROI2R.js" + }, + "SceneLayerWorker-I4AKLRLP": { + "file": "SceneLayerWorker-I4AKLRLP.js" + }, + "chunk-MPGTTL3C": { + "file": "chunk-MPGTTL3C.js" + }, + "chunk-6GZBPAG7": { + "file": "chunk-6GZBPAG7.js" + }, + "WFSSourceWorker-ROHPUUDP": { + "file": "WFSSourceWorker-ROHPUUDP.js" + }, + "chunk-XF6FJCZW": { + "file": "chunk-XF6FJCZW.js" + }, + "chunk-CPGPJ736": { + "file": "chunk-CPGPJ736.js" + }, + "WorkerTileHandler-GY6RPGMW": { + "file": "WorkerTileHandler-GY6RPGMW.js" + }, + "chunk-XOJEDCN4": { + "file": "chunk-XOJEDCN4.js" + }, + "geometryEngineAsync-4BQULQB4": { + "file": "geometryEngineAsync-4BQULQB4.js" + }, + "geomasync-336PNOQC": { + "file": "geomasync-336PNOQC.js" + }, + "arcadeAsyncRuntime-7P7SOO3R": { + "file": "arcadeAsyncRuntime-7P7SOO3R.js" + }, + "chunk-DHVM523H": { + "file": "chunk-DHVM523H.js" + }, + "chunk-2MKFN3TB": { + "file": "chunk-2MKFN3TB.js" + }, + "chunk-E7AR3M44": { + "file": "chunk-E7AR3M44.js" + }, + "chunk-4OOIN3QS": { + "file": "chunk-4OOIN3QS.js" + }, + "chunk-DUPASKAC": { + "file": "chunk-DUPASKAC.js" + }, + "chunk-RDVD3T6X": { + "file": "chunk-RDVD3T6X.js" + }, + "chunk-BLNKNFXB": { + "file": "chunk-BLNKNFXB.js" + }, + "chunk-PCLLUZXE": { + "file": "chunk-PCLLUZXE.js" + }, + "chunk-EYCVSV55": { + "file": "chunk-EYCVSV55.js" + }, + "chunk-5EOFLLAO": { + "file": "chunk-5EOFLLAO.js" + }, + "chunk-Y25XKQRP": { + "file": "chunk-Y25XKQRP.js" + }, + "chunk-F7ZPUWIX": { + "file": "chunk-F7ZPUWIX.js" + }, + "SubtypeGroupLayer-56DS2DAW": { + "file": "SubtypeGroupLayer-56DS2DAW.js" + }, + "chunk-UOYZKOK2": { + "file": "chunk-UOYZKOK2.js" + }, + "FeatureLayer-UHNY2NJY": { + "file": "FeatureLayer-UHNY2NJY.js" + }, + "chunk-2LVHGJKF": { + "file": "chunk-2LVHGJKF.js" + }, + "chunk-G5CQXTHO": { + "file": "chunk-G5CQXTHO.js" + }, + "chunk-3ADGGI3C": { + "file": "chunk-3ADGGI3C.js" + }, + "chunk-WZVVVBE3": { + "file": "chunk-WZVVVBE3.js" + }, + "chunk-A4IX5HOE": { + "file": "chunk-A4IX5HOE.js" + }, + "chunk-SAQ4HCLU": { + "file": "chunk-SAQ4HCLU.js" + }, + "chunk-3EVP34VA": { + "file": "chunk-3EVP34VA.js" + }, + "chunk-EA2MW36L": { + "file": "chunk-EA2MW36L.js" + }, + "chunk-5YKXLHJ6": { + "file": "chunk-5YKXLHJ6.js" + }, + "chunk-54KWJO2C": { + "file": "chunk-54KWJO2C.js" + }, + "chunk-UCF3ONDU": { + "file": "chunk-UCF3ONDU.js" + }, + "createConnection-WWE5NVSM": { + "file": "createConnection-WWE5NVSM.js" + }, + "FeatureFilter-DGYLSNAE": { + "file": "FeatureFilter-DGYLSNAE.js" + }, + "Pipeline-AJPWVXBL": { + "file": "Pipeline-AJPWVXBL.js" + }, + "chunk-6V5UJM7P": { + "file": "chunk-6V5UJM7P.js" + }, + "chunk-YR3ZZVU3": { + "file": "chunk-YR3ZZVU3.js" + }, + "chunk-IIRYA6V3": { + "file": "chunk-IIRYA6V3.js" + }, + "chunk-JB6UQZYN": { + "file": "chunk-JB6UQZYN.js" + }, + "chunk-KHPF45J4": { + "file": "chunk-KHPF45J4.js" + }, + "chunk-ODGAHKYT": { + "file": "chunk-ODGAHKYT.js" + }, + "PointCloudWorker-ETMXUOPZ": { + "file": "PointCloudWorker-ETMXUOPZ.js" + }, + "chunk-A664BO4Q": { + "file": "chunk-A664BO4Q.js" + }, + "chunk-A5BU7VVR": { + "file": "chunk-A5BU7VVR.js" + }, + "lerc-wasm-QRAZMMEX": { + "file": "lerc-wasm-QRAZMMEX.js" + }, + "RasterWorker-TIIHISKD": { + "file": "RasterWorker-TIIHISKD.js" + }, + "chunk-WV2Q3LLA": { + "file": "chunk-WV2Q3LLA.js" + }, + "chunk-FKNXERLC": { + "file": "chunk-FKNXERLC.js" + }, + "chunk-5KXASM3I": { + "file": "chunk-5KXASM3I.js" + }, + "SceneLayerSnappingSourceWorker-5KSGGCPQ": { + "file": "SceneLayerSnappingSourceWorker-5KSGGCPQ.js" + }, + "executeRelationshipQuery-HFNZDQQV": { + "file": "executeRelationshipQuery-HFNZDQQV.js" + }, + "queryAttachments-27RVUSSP": { + "file": "queryAttachments-27RVUSSP.js" + }, + "chunk-A7IAY26P": { + "file": "chunk-A7IAY26P.js" + }, + "executeTopFeaturesQuery-7KQJTSEB": { + "file": "executeTopFeaturesQuery-7KQJTSEB.js" + }, + "executeForTopIds-244QCSO7": { + "file": "executeForTopIds-244QCSO7.js" + }, + "executeForTopExtents-H6F6UP3W": { + "file": "executeForTopExtents-H6F6UP3W.js" + }, + "executeForTopCount-4EC3MYHV": { + "file": "executeForTopCount-4EC3MYHV.js" + }, + "chunk-R7ENTP2K": { + "file": "chunk-R7ENTP2K.js" + }, + "chunk-EJDYG6LB": { + "file": "chunk-EJDYG6LB.js" + }, + "uploadAssets-BXOR5R3D": { + "file": "uploadAssets-BXOR5R3D.js" + }, + "FeatureLayerSource-ZCBTAF36": { + "file": "FeatureLayerSource-ZCBTAF36.js" + }, + "chunk-2DAFQEZX": { + "file": "chunk-2DAFQEZX.js" + }, + "chunk-IEMIPK3E": { + "file": "chunk-IEMIPK3E.js" + }, + "chunk-XDBKTQRH": { + "file": "chunk-XDBKTQRH.js" + }, + "chunk-F3IZXXE3": { + "file": "chunk-F3IZXXE3.js" + }, + "chunk-TJOBLX7K": { + "file": "chunk-TJOBLX7K.js" + }, + "layersLoader-GBTTDDCM": { + "file": "layersLoader-GBTTDDCM.js" + }, + "chunk-UJJN2ZYT": { + "file": "chunk-UJJN2ZYT.js" + }, + "featureLayerUtils-TLMXG7HU": { + "file": "featureLayerUtils-TLMXG7HU.js" + }, + "chunk-QY5YBIJE": { + "file": "chunk-QY5YBIJE.js" + }, + "chunk-WM5633FJ": { + "file": "chunk-WM5633FJ.js" + }, + "chunk-CMAXNQIS": { + "file": "chunk-CMAXNQIS.js" + }, + "gif-E3SRRGEA": { + "file": "gif-E3SRRGEA.js" + }, + "apng-YOPL4YRG": { + "file": "apng-YOPL4YRG.js" + }, + "loadGLTFMesh-OQJRSWCT": { + "file": "loadGLTFMesh-OQJRSWCT.js" + }, + "zipjs-wrapper-ZOUN73P7": { + "file": "zipjs-wrapper-ZOUN73P7.js" + }, + "gltfexport-NPBHGSCM": { + "file": "gltfexport-NPBHGSCM.js" + }, + "meshFeatureSet-3MGO36FG": { + "file": "meshFeatureSet-3MGO36FG.js" + }, + "chunk-YD6OEX5R": { + "file": "chunk-YD6OEX5R.js" + }, + "chunk-JIKCZGX5": { + "file": "chunk-JIKCZGX5.js" + }, + "chunk-LL2M6NRH": { + "file": "chunk-LL2M6NRH.js" + }, + "DictionaryLoader-2DHESR4A": { + "file": "DictionaryLoader-2DHESR4A.js" + }, + "SymbolProcessor-NYKNQYIX": { + "file": "SymbolProcessor-NYKNQYIX.js" + }, + "chunk-WK3GWWRP": { + "file": "chunk-WK3GWWRP.js" + }, + "chunk-GJ4RL7QU": { + "file": "chunk-GJ4RL7QU.js" + }, + "chunk-HK5BDPYV": { + "file": "chunk-HK5BDPYV.js" + }, + "chunk-V6HZVEI5": { + "file": "chunk-V6HZVEI5.js" + }, + "labelFormatUtils-U7AAEDN5": { + "file": "labelFormatUtils-U7AAEDN5.js" + }, + "visualVariableUtils-SSR75QNA": { + "file": "visualVariableUtils-SSR75QNA.js" + }, + "deleteForwardEdits-6UCGDQGS": { + "file": "deleteForwardEdits-6UCGDQGS.js" + }, + "DeleteForwardEditsParameters-T3TLKGGO": { + "file": "DeleteForwardEditsParameters-T3TLKGGO.js" + }, + "RelationshipQuery-ECIFYDOH": { + "file": "RelationshipQuery-ECIFYDOH.js" + }, + "editingSupport-4V4DXSWI": { + "file": "editingSupport-4V4DXSWI.js" + }, + "chunk-6LQH6TOJ": { + "file": "chunk-6LQH6TOJ.js" + }, + "MemorySourceWorker-NC3VCXJL": { + "file": "MemorySourceWorker-NC3VCXJL.js" + }, + "chunk-ET42MPVP": { + "file": "chunk-ET42MPVP.js" + }, + "PBFDecoderWorker-ZFTMFXFB": { + "file": "PBFDecoderWorker-ZFTMFXFB.js" + }, + "HeatmapProcessor-V53Z2OAP": { + "file": "HeatmapProcessor-V53Z2OAP.js" + }, + "chunk-MCLZFVSM": { + "file": "chunk-MCLZFVSM.js" + }, + "libtess-asm-V54HPVYV": { + "file": "libtess-asm-V54HPVYV.js" + }, + "libtess-RE23MIOA": { + "file": "libtess-RE23MIOA.js" + }, + "webStyleSymbolUtils-DIMSGWPN": { + "file": "webStyleSymbolUtils-DIMSGWPN.js" + }, + "webStyleUtils-M4SWCT7V": { + "file": "webStyleUtils-M4SWCT7V.js" + }, + "createSymbolSchema-K6HTD2F4": { + "file": "createSymbolSchema-K6HTD2F4.js" + }, + "chunk-W5HSUK7M": { + "file": "chunk-W5HSUK7M.js" + }, + "chunk-JHWVFXWP": { + "file": "chunk-JHWVFXWP.js" + }, + "chunk-7REGXRO2": { + "file": "chunk-7REGXRO2.js" + }, + "chunk-L2VCMOKZ": { + "file": "chunk-L2VCMOKZ.js" + }, + "chunk-PHDOV32N": { + "file": "chunk-PHDOV32N.js" + }, + "chunk-7HFNYBA4": { + "file": "chunk-7HFNYBA4.js" + }, + "chunk-Z26DT4RT": { + "file": "chunk-Z26DT4RT.js" + }, + "chunk-ECI5BS5T": { + "file": "chunk-ECI5BS5T.js" + }, + "chunk-DVPZYQS2": { + "file": "chunk-DVPZYQS2.js" + }, + "geometryEngineJSON-EONUROEQ": { + "file": "geometryEngineJSON-EONUROEQ.js" + }, + "CSVSourceWorker-62U5FZP7": { + "file": "CSVSourceWorker-62U5FZP7.js" + }, + "EdgeProcessingWorker-NXXSWGEP": { + "file": "EdgeProcessingWorker-NXXSWGEP.js" + }, + "georeference-FDJ6EK5F": { + "file": "georeference-FDJ6EK5F.js" + }, + "ElevationSamplerWorker-4RTZIYTL": { + "file": "ElevationSamplerWorker-4RTZIYTL.js" + }, + "FeatureServiceSnappingSourceWorker-TMRJSL2W": { + "file": "FeatureServiceSnappingSourceWorker-TMRJSL2W.js" + }, + "chunk-HFF36PAG": { + "file": "chunk-HFF36PAG.js" + }, + "chunk-E52Q3GIZ": { + "file": "chunk-E52Q3GIZ.js" + }, + "chunk-ZOGVI27V": { + "file": "chunk-ZOGVI27V.js" + }, + "chunk-S6CVQWN7": { + "file": "chunk-S6CVQWN7.js" + }, + "chunk-FKZAOLEX": { + "file": "chunk-FKZAOLEX.js" + }, + "chunk-ZCPUDB2P": { + "file": "chunk-ZCPUDB2P.js" + }, + "GeoJSONSourceWorker-GRHHFGVG": { + "file": "GeoJSONSourceWorker-GRHHFGVG.js" + }, + "chunk-THKJ3CMY": { + "file": "chunk-THKJ3CMY.js" + }, + "chunk-Q3ZUDPDW": { + "file": "chunk-Q3ZUDPDW.js" + }, + "chunk-7SYCRLSC": { + "file": "chunk-7SYCRLSC.js" + }, + "chunk-X4O2MUYS": { + "file": "chunk-X4O2MUYS.js" + }, + "chunk-DLPD2BZR": { + "file": "chunk-DLPD2BZR.js" + }, + "chunk-IY7IE2A7": { + "file": "chunk-IY7IE2A7.js" + }, + "chunk-ZG4I2EA5": { + "file": "chunk-ZG4I2EA5.js" + }, + "chunk-BR6XHYUK": { + "file": "chunk-BR6XHYUK.js" + }, + "chunk-HHH6E4PL": { + "file": "chunk-HHH6E4PL.js" + }, + "chunk-KMTPMPRR": { + "file": "chunk-KMTPMPRR.js" + }, + "chunk-PTBAZKPZ": { + "file": "chunk-PTBAZKPZ.js" + }, + "chunk-X5VYGREB": { + "file": "chunk-X5VYGREB.js" + }, + "LercWorker-3FR4UY5I": { + "file": "LercWorker-3FR4UY5I.js" + }, + "projectBuffer-KKJAFVFD": { + "file": "projectBuffer-KKJAFVFD.js" + }, + "geometryEngineBase-C3X7CXY2": { + "file": "geometryEngineBase-C3X7CXY2.js" + }, + "hydrated-KK5ZIYKL": { + "file": "hydrated-KK5ZIYKL.js" + }, + "projection-FYVONIUC": { + "file": "projection-FYVONIUC.js" + }, + "portalLayers-7JFBH7JZ": { + "file": "portalLayers-7JFBH7JZ.js" + }, + "chunk-3QL4HZJ2": { + "file": "chunk-3QL4HZJ2.js" + }, + "chunk-NTTQDAJU": { + "file": "chunk-NTTQDAJU.js" + }, + "WhereClause-7NZMAZZ3": { + "file": "WhereClause-7NZMAZZ3.js" + }, + "chunk-JHEPZMC5": { + "file": "chunk-JHEPZMC5.js" + }, + "chunk-LDFBHJIE": { + "file": "chunk-LDFBHJIE.js" + }, + "statsWorker-6DYUPZ4K": { + "file": "statsWorker-6DYUPZ4K.js" + }, + "chunk-4H36KOX7": { + "file": "chunk-4H36KOX7.js" + }, + "chunk-K3A67FVC": { + "file": "chunk-K3A67FVC.js" + }, + "geometryEngineWorker-5NCZNKGO": { + "file": "geometryEngineWorker-5NCZNKGO.js" + }, + "chunk-ZWDEFW72": { + "file": "chunk-ZWDEFW72.js" + }, + "chunk-WND35VNG": { + "file": "chunk-WND35VNG.js" + }, + "chunk-3N6A5WIJ": { + "file": "chunk-3N6A5WIJ.js" + }, + "chunk-AKLNWAPV": { + "file": "chunk-AKLNWAPV.js" + }, + "chunk-E6MKAOIM": { + "file": "chunk-E6MKAOIM.js" + }, + "chunk-73CIIGDE": { + "file": "chunk-73CIIGDE.js" + }, + "chunk-WHEB6SAZ": { + "file": "chunk-WHEB6SAZ.js" + }, + "chunk-LBRMXFZJ": { + "file": "chunk-LBRMXFZJ.js" + }, + "chunk-SUNTSHH7": { + "file": "chunk-SUNTSHH7.js" + }, + "chunk-GJVHYXNS": { + "file": "chunk-GJVHYXNS.js" + }, + "chunk-BCEP34LF": { + "file": "chunk-BCEP34LF.js" + }, + "request-IUU57DB7": { + "file": "request-IUU57DB7.js" + }, + "IdentityManager-UAUYZ62A": { + "file": "IdentityManager-UAUYZ62A.js" + }, + "shadow-css-O37XWCMK": { + "file": "shadow-css-O37XWCMK.js" + }, + "pe-wasm-FMADSKH2": { + "file": "pe-wasm-FMADSKH2.js" + }, + "chunk-FFKOPMUR": { + "file": "chunk-FFKOPMUR.js" + }, + "resourceUtils-AVR2WATA": { + "file": "resourceUtils-AVR2WATA.js" + }, + "PortalItem-3D6UEZ4D": { + "file": "PortalItem-3D6UEZ4D.js" + }, + "chunk-T7LRP6P3": { + "file": "chunk-T7LRP6P3.js" + }, + "chunk-GDNQBHEU": { + "file": "chunk-GDNQBHEU.js" + }, + "chunk-F5E6W5NE": { + "file": "chunk-F5E6W5NE.js" + }, + "chunk-6K3INSQM": { + "file": "chunk-6K3INSQM.js" + }, + "chunk-3POAGYHZ": { + "file": "chunk-3POAGYHZ.js" + }, + "chunk-CIWFC4JB": { + "file": "chunk-CIWFC4JB.js" + }, + "chunk-OSKWOCY5": { + "file": "chunk-OSKWOCY5.js" + }, + "chunk-AW7QGHS2": { + "file": "chunk-AW7QGHS2.js" + }, + "chunk-DRBYLQY3": { + "file": "chunk-DRBYLQY3.js" + }, + "chunk-7TKGFSA4": { + "file": "chunk-7TKGFSA4.js" + }, + "chunk-R7QNEYIM": { + "file": "chunk-R7QNEYIM.js" + }, + "chunk-YHD3NP4L": { + "file": "chunk-YHD3NP4L.js" + }, + "chunk-GITZ4B6D": { + "file": "chunk-GITZ4B6D.js" + }, + "chunk-6FWTBUJN": { + "file": "chunk-6FWTBUJN.js" + }, + "chunk-AJHNOEIR": { + "file": "chunk-AJHNOEIR.js" + }, + "chunk-WM5WXTSM": { + "file": "chunk-WM5WXTSM.js" + }, + "chunk-WMKAOLYZ": { + "file": "chunk-WMKAOLYZ.js" + }, + "chunk-DWTCBAHJ": { + "file": "chunk-DWTCBAHJ.js" + }, + "chunk-YFRBDIGH": { + "file": "chunk-YFRBDIGH.js" + }, + "chunk-VN7WQPLU": { + "file": "chunk-VN7WQPLU.js" + }, + "chunk-UGB3O65J": { + "file": "chunk-UGB3O65J.js" + }, + "chunk-LFTNXZ5R": { + "file": "chunk-LFTNXZ5R.js" + }, + "chunk-UATYLUAU": { + "file": "chunk-UATYLUAU.js" + }, + "chunk-H6OQRMAX": { + "file": "chunk-H6OQRMAX.js" + }, + "chunk-B2SLSOEG": { + "file": "chunk-B2SLSOEG.js" + }, + "chunk-2M445O3F": { + "file": "chunk-2M445O3F.js" + }, + "chunk-BG7FLMHM": { + "file": "chunk-BG7FLMHM.js" + }, + "chunk-P5NHW6N5": { + "file": "chunk-P5NHW6N5.js" + }, + "chunk-KP3MPZCB": { + "file": "chunk-KP3MPZCB.js" + }, + "chunk-ZI7WZIEF": { + "file": "chunk-ZI7WZIEF.js" + }, + "chunk-DYMI3S2M": { + "file": "chunk-DYMI3S2M.js" + }, + "chunk-WOWPBFOL": { + "file": "chunk-WOWPBFOL.js" + }, + "chunk-7ZWGUJZY": { + "file": "chunk-7ZWGUJZY.js" + }, + "chunk-WAI5VWXX": { + "file": "chunk-WAI5VWXX.js" + }, + "chunk-OULHWXFQ": { + "file": "chunk-OULHWXFQ.js" + }, + "chunk-6JAJJVA2": { + "file": "chunk-6JAJJVA2.js" + }, + "chunk-2SFJJDN6": { + "file": "chunk-2SFJJDN6.js" + }, + "chunk-5JV7X2OE": { + "file": "chunk-5JV7X2OE.js" + }, + "chunk-I5D2EDET": { + "file": "chunk-I5D2EDET.js" + }, + "chunk-OVPXFEM7": { + "file": "chunk-OVPXFEM7.js" + }, + "chunk-YXZQI4VA": { + "file": "chunk-YXZQI4VA.js" + }, + "chunk-DQY43VXQ": { + "file": "chunk-DQY43VXQ.js" + }, + "chunk-63MRXB4A": { + "file": "chunk-63MRXB4A.js" + }, + "chunk-CVNR3ZFM": { + "file": "chunk-CVNR3ZFM.js" + }, + "chunk-KTSL5PX6": { + "file": "chunk-KTSL5PX6.js" + }, + "chunk-XDEO7UXL": { + "file": "chunk-XDEO7UXL.js" + }, + "chunk-WK7V6OW5": { + "file": "chunk-WK7V6OW5.js" + }, + "chunk-IF76HK5J": { + "file": "chunk-IF76HK5J.js" + }, + "chunk-U4PYIBXU": { + "file": "chunk-U4PYIBXU.js" + }, + "chunk-EGBTVWUE": { + "file": "chunk-EGBTVWUE.js" + }, + "chunk-42PRVWEH": { + "file": "chunk-42PRVWEH.js" + }, + "chunk-G7RLIJ4A": { + "file": "chunk-G7RLIJ4A.js" + }, + "chunk-74PECTTC": { + "file": "chunk-74PECTTC.js" + }, + "chunk-RXKNQ6DL": { + "file": "chunk-RXKNQ6DL.js" + }, + "chunk-NDXXLUWD": { + "file": "chunk-NDXXLUWD.js" + }, + "chunk-5TIOBHS2": { + "file": "chunk-5TIOBHS2.js" + }, + "chunk-TVDO62IQ": { + "file": "chunk-TVDO62IQ.js" + }, + "chunk-5G7LBN7A": { + "file": "chunk-5G7LBN7A.js" + }, + "chunk-KDWIE2TE": { + "file": "chunk-KDWIE2TE.js" + }, + "chunk-A7D5NXWK": { + "file": "chunk-A7D5NXWK.js" + }, + "chunk-XNY4OFYE": { + "file": "chunk-XNY4OFYE.js" + }, + "chunk-I3RZMWL3": { + "file": "chunk-I3RZMWL3.js" + }, + "chunk-EEQUTSNM": { + "file": "chunk-EEQUTSNM.js" + }, + "chunk-YHPJPLKL": { + "file": "chunk-YHPJPLKL.js" + }, + "chunk-ES5JRM4M": { + "file": "chunk-ES5JRM4M.js" + }, + "chunk-L4RZBL5B": { + "file": "chunk-L4RZBL5B.js" + }, + "chunk-DQ4Y3FY4": { + "file": "chunk-DQ4Y3FY4.js" + }, + "chunk-E3LZZQUP": { + "file": "chunk-E3LZZQUP.js" + }, + "chunk-HFRGKAS6": { + "file": "chunk-HFRGKAS6.js" + }, + "chunk-D2WERNNI": { + "file": "chunk-D2WERNNI.js" + }, + "chunk-TC4JVLEL": { + "file": "chunk-TC4JVLEL.js" + }, + "chunk-J7SOZHRY": { + "file": "chunk-J7SOZHRY.js" + }, + "chunk-4DENUU6D": { + "file": "chunk-4DENUU6D.js" + }, + "chunk-TQSULSJZ": { + "file": "chunk-TQSULSJZ.js" + }, + "chunk-UVHYQ43H": { + "file": "chunk-UVHYQ43H.js" + }, + "chunk-R3UYJQV3": { + "file": "chunk-R3UYJQV3.js" + }, + "chunk-TCO5ICXA": { + "file": "chunk-TCO5ICXA.js" + }, + "chunk-74FW2DVI": { + "file": "chunk-74FW2DVI.js" + }, + "chunk-QITISQNE": { + "file": "chunk-QITISQNE.js" + }, + "chunk-CI543U6F": { + "file": "chunk-CI543U6F.js" + }, + "chunk-EHTNRJAQ": { + "file": "chunk-EHTNRJAQ.js" + }, + "chunk-XWYRZESF": { + "file": "chunk-XWYRZESF.js" + }, + "chunk-7TJTPWO3": { + "file": "chunk-7TJTPWO3.js" + }, + "chunk-EXJLIIWX": { + "file": "chunk-EXJLIIWX.js" + }, + "chunk-ZK4EP5DT": { + "file": "chunk-ZK4EP5DT.js" + }, + "chunk-53H32GMG": { + "file": "chunk-53H32GMG.js" + }, + "chunk-CBDKDCJO": { + "file": "chunk-CBDKDCJO.js" + }, + "chunk-PPKWEZOK": { + "file": "chunk-PPKWEZOK.js" + }, + "chunk-N3KVEFYZ": { + "file": "chunk-N3KVEFYZ.js" + }, + "chunk-B22IEEZT": { + "file": "chunk-B22IEEZT.js" + }, + "chunk-6Y52V7GG": { + "file": "chunk-6Y52V7GG.js" + }, + "chunk-H4RGF3F7": { + "file": "chunk-H4RGF3F7.js" + }, + "chunk-TR5M23VA": { + "file": "chunk-TR5M23VA.js" + }, + "chunk-LWCV23FB": { + "file": "chunk-LWCV23FB.js" + }, + "chunk-DNUWM4MR": { + "file": "chunk-DNUWM4MR.js" + }, + "chunk-NFZLZBTI": { + "file": "chunk-NFZLZBTI.js" + }, + "chunk-DINPLFLG": { + "file": "chunk-DINPLFLG.js" + }, + "chunk-MQELLQCY": { + "file": "chunk-MQELLQCY.js" + }, + "chunk-NBORG3GC": { + "file": "chunk-NBORG3GC.js" + }, + "chunk-WXWDGUZB": { + "file": "chunk-WXWDGUZB.js" + }, + "chunk-ZR37OC5P": { + "file": "chunk-ZR37OC5P.js" + }, + "chunk-43K4A7S4": { + "file": "chunk-43K4A7S4.js" + }, + "chunk-QGQNGNNO": { + "file": "chunk-QGQNGNNO.js" + }, + "chunk-VUCYTUV7": { + "file": "chunk-VUCYTUV7.js" + }, + "chunk-UWRGTUZT": { + "file": "chunk-UWRGTUZT.js" + }, + "chunk-PCM6N5PB": { + "file": "chunk-PCM6N5PB.js" + }, + "chunk-LAQDJPXV": { + "file": "chunk-LAQDJPXV.js" + }, + "chunk-HST2JFS7": { + "file": "chunk-HST2JFS7.js" + }, + "chunk-KFPUV7FT": { + "file": "chunk-KFPUV7FT.js" + }, + "chunk-MUE6A2C5": { + "file": "chunk-MUE6A2C5.js" + }, + "chunk-NZKN2FP6": { + "file": "chunk-NZKN2FP6.js" + }, + "chunk-ULGBG72M": { + "file": "chunk-ULGBG72M.js" + }, + "chunk-NVTV5SOB": { + "file": "chunk-NVTV5SOB.js" + }, + "chunk-TQGFBU73": { + "file": "chunk-TQGFBU73.js" + }, + "chunk-LFSRSLZ5": { + "file": "chunk-LFSRSLZ5.js" + }, + "chunk-UULNPMMR": { + "file": "chunk-UULNPMMR.js" + }, + "chunk-QVNTGI76": { + "file": "chunk-QVNTGI76.js" + }, + "chunk-BXD4XWGK": { + "file": "chunk-BXD4XWGK.js" + }, + "chunk-FBDT7JTD": { + "file": "chunk-FBDT7JTD.js" + }, + "chunk-QELXOWGH": { + "file": "chunk-QELXOWGH.js" + }, + "chunk-JOWJI25V": { + "file": "chunk-JOWJI25V.js" + }, + "chunk-DWDGBWLE": { + "file": "chunk-DWDGBWLE.js" + }, + "chunk-QABIBY77": { + "file": "chunk-QABIBY77.js" + }, + "chunk-B7APJ3XI": { + "file": "chunk-B7APJ3XI.js" + }, + "chunk-YI2HCJFN": { + "file": "chunk-YI2HCJFN.js" + }, + "chunk-LUIHQJGM": { + "file": "chunk-LUIHQJGM.js" + }, + "chunk-DPP7XW7J": { + "file": "chunk-DPP7XW7J.js" + }, + "chunk-FDIEJ65Q": { + "file": "chunk-FDIEJ65Q.js" + }, + "chunk-KMVOMB3Z": { + "file": "chunk-KMVOMB3Z.js" + }, + "chunk-J6AM5NJ3": { + "file": "chunk-J6AM5NJ3.js" + }, + "chunk-NL4QU2HR": { + "file": "chunk-NL4QU2HR.js" + }, + "chunk-WOPG7QFU": { + "file": "chunk-WOPG7QFU.js" + }, + "chunk-EM7VZHJC": { + "file": "chunk-EM7VZHJC.js" + }, + "chunk-25LGC6NN": { + "file": "chunk-25LGC6NN.js" + }, + "chunk-YZE3FAJK": { + "file": "chunk-YZE3FAJK.js" + }, + "chunk-SZCSLMJN": { + "file": "chunk-SZCSLMJN.js" + }, + "chunk-74NUA7PH": { + "file": "chunk-74NUA7PH.js" + }, + "chunk-XGNPEZ6G": { + "file": "chunk-XGNPEZ6G.js" + }, + "chunk-KF7NAYIN": { + "file": "chunk-KF7NAYIN.js" + }, + "chunk-HPLJ55BJ": { + "file": "chunk-HPLJ55BJ.js" + }, + "chunk-5PZI75J4": { + "file": "chunk-5PZI75J4.js" + }, + "chunk-QDDKRCK6": { + "file": "chunk-QDDKRCK6.js" + }, + "chunk-QDOAJW7B": { + "file": "chunk-QDOAJW7B.js" + }, + "chunk-4Z2V43ZX": { + "file": "chunk-4Z2V43ZX.js" + }, + "chunk-L47XED2J": { + "file": "chunk-L47XED2J.js" + }, + "chunk-YN65YJ4Y": { + "file": "chunk-YN65YJ4Y.js" + }, + "chunk-DUFU3KTY": { + "file": "chunk-DUFU3KTY.js" + }, + "chunk-R66W7S4U": { + "file": "chunk-R66W7S4U.js" + }, + "chunk-D5Z6XXMP": { + "file": "chunk-D5Z6XXMP.js" + }, + "chunk-AV6EV6NZ": { + "file": "chunk-AV6EV6NZ.js" + }, + "chunk-NU4L24IL": { + "file": "chunk-NU4L24IL.js" + }, + "chunk-UIEJEDFL": { + "file": "chunk-UIEJEDFL.js" + }, + "chunk-L5ZZXDAH": { + "file": "chunk-L5ZZXDAH.js" + }, + "chunk-PBL2AEHV": { + "file": "chunk-PBL2AEHV.js" + }, + "chunk-NZSCON5F": { + "file": "chunk-NZSCON5F.js" + }, + "chunk-FWQYMM2C": { + "file": "chunk-FWQYMM2C.js" + }, + "chunk-PYT27X7L": { + "file": "chunk-PYT27X7L.js" + }, + "chunk-HRN6KCLJ": { + "file": "chunk-HRN6KCLJ.js" + }, + "chunk-EM3S5UCU": { + "file": "chunk-EM3S5UCU.js" + }, + "chunk-26S24HPH": { + "file": "chunk-26S24HPH.js" + }, + "chunk-76KPSQLT": { + "file": "chunk-76KPSQLT.js" + }, + "chunk-JGZYEEJR": { + "file": "chunk-JGZYEEJR.js" + }, + "chunk-6K23J35R": { + "file": "chunk-6K23J35R.js" + }, + "chunk-GFSVRVTF": { + "file": "chunk-GFSVRVTF.js" + }, + "chunk-GJRIKKPY": { + "file": "chunk-GJRIKKPY.js" + }, + "chunk-SOFLPHTL": { + "file": "chunk-SOFLPHTL.js" + }, + "chunk-5VDNJKTB": { + "file": "chunk-5VDNJKTB.js" + }, + "chunk-NN67SEXW": { + "file": "chunk-NN67SEXW.js" + }, + "chunk-LDFSYJHT": { + "file": "chunk-LDFSYJHT.js" + }, + "chunk-JMCW4MUS": { + "file": "chunk-JMCW4MUS.js" + }, + "chunk-YUBECSYQ": { + "file": "chunk-YUBECSYQ.js" + }, + "chunk-4GM3A3WX": { + "file": "chunk-4GM3A3WX.js" + }, + "chunk-DJ3H5D5X": { + "file": "chunk-DJ3H5D5X.js" + }, + "chunk-4CETMBJJ": { + "file": "chunk-4CETMBJJ.js" + }, + "chunk-B4T5P3ZR": { + "file": "chunk-B4T5P3ZR.js" + }, + "chunk-OBLKX7ZO": { + "file": "chunk-OBLKX7ZO.js" + }, + "chunk-XLIFAURW": { + "file": "chunk-XLIFAURW.js" + }, + "chunk-L3H2XAZ3": { + "file": "chunk-L3H2XAZ3.js" + }, + "chunk-GRKHQZ3T": { + "file": "chunk-GRKHQZ3T.js" + }, + "chunk-3G4SPJ47": { + "file": "chunk-3G4SPJ47.js" + }, + "chunk-CWSGEZXP": { + "file": "chunk-CWSGEZXP.js" + }, + "chunk-YCUAC464": { + "file": "chunk-YCUAC464.js" + }, + "chunk-2RWPEOBK": { + "file": "chunk-2RWPEOBK.js" + }, + "chunk-EKUCKOU3": { + "file": "chunk-EKUCKOU3.js" + }, + "chunk-HTOZHF4B": { + "file": "chunk-HTOZHF4B.js" + }, + "chunk-XYRAVS44": { + "file": "chunk-XYRAVS44.js" + }, + "chunk-SYSTZFRH": { + "file": "chunk-SYSTZFRH.js" + }, + "chunk-D4QTHXDJ": { + "file": "chunk-D4QTHXDJ.js" + }, + "chunk-MSVLUQYY": { + "file": "chunk-MSVLUQYY.js" + }, + "chunk-5D5QSL73": { + "file": "chunk-5D5QSL73.js" + }, + "chunk-I6XEMW2W": { + "file": "chunk-I6XEMW2W.js" + }, + "chunk-5ZQFF6WC": { + "file": "chunk-5ZQFF6WC.js" + }, + "chunk-SNYNJZRU": { + "file": "chunk-SNYNJZRU.js" + }, + "chunk-4S3N4PRZ": { + "file": "chunk-4S3N4PRZ.js" + }, + "chunk-HMWK5X3Y": { + "file": "chunk-HMWK5X3Y.js" + }, + "chunk-BYV7KX42": { + "file": "chunk-BYV7KX42.js" + }, + "chunk-PDH4XIG6": { + "file": "chunk-PDH4XIG6.js" + }, + "chunk-2AWJYKUK": { + "file": "chunk-2AWJYKUK.js" + }, + "chunk-FES3PLSL": { + "file": "chunk-FES3PLSL.js" + }, + "chunk-IY7FTPHO": { + "file": "chunk-IY7FTPHO.js" + }, + "chunk-LL46OMFQ": { + "file": "chunk-LL46OMFQ.js" + }, + "chunk-KAYNPBPW": { + "file": "chunk-KAYNPBPW.js" + }, + "chunk-6H5AIWTU": { + "file": "chunk-6H5AIWTU.js" + }, + "chunk-VM3ONB4F": { + "file": "chunk-VM3ONB4F.js" + }, + "chunk-G4EVP4KZ": { + "file": "chunk-G4EVP4KZ.js" + }, + "chunk-QWKBKMIO": { + "file": "chunk-QWKBKMIO.js" + }, + "chunk-PCKNH7L7": { + "file": "chunk-PCKNH7L7.js" + }, + "chunk-XWCPJBS5": { + "file": "chunk-XWCPJBS5.js" + }, + "chunk-OHH57WAF": { + "file": "chunk-OHH57WAF.js" + }, + "chunk-F33XAVTN": { + "file": "chunk-F33XAVTN.js" + }, + "chunk-Y5HF2G7D": { + "file": "chunk-Y5HF2G7D.js" + }, + "chunk-KCHT4PBH": { + "file": "chunk-KCHT4PBH.js" + }, + "chunk-BBALVRJ3": { + "file": "chunk-BBALVRJ3.js" + }, + "chunk-PWAOIHNG": { + "file": "chunk-PWAOIHNG.js" + }, + "chunk-AAXKQSKY": { + "file": "chunk-AAXKQSKY.js" + }, + "chunk-5SDBDQ4I": { + "file": "chunk-5SDBDQ4I.js" + }, + "chunk-VQDCP72F": { + "file": "chunk-VQDCP72F.js" + }, + "chunk-Q2ZSMUF3": { + "file": "chunk-Q2ZSMUF3.js" + }, + "chunk-ZU3FCH2O": { + "file": "chunk-ZU3FCH2O.js" + }, + "chunk-23Q3MBKR": { + "file": "chunk-23Q3MBKR.js" + }, + "chunk-IUKZN3DL": { + "file": "chunk-IUKZN3DL.js" + }, + "chunk-M43CCJHT": { + "file": "chunk-M43CCJHT.js" + }, + "chunk-AF5P7URM": { + "file": "chunk-AF5P7URM.js" + }, + "chunk-CRBLZOYB": { + "file": "chunk-CRBLZOYB.js" + }, + "chunk-HPQYZYNT": { + "file": "chunk-HPQYZYNT.js" + }, + "chunk-WTN44Y3T": { + "file": "chunk-WTN44Y3T.js" + }, + "chunk-5WUHSCMR": { + "file": "chunk-5WUHSCMR.js" + }, + "chunk-GME4N7C2": { + "file": "chunk-GME4N7C2.js" + }, + "chunk-QADYDIOH": { + "file": "chunk-QADYDIOH.js" + }, + "chunk-YJCABCT5": { + "file": "chunk-YJCABCT5.js" + }, + "chunk-IU7YKJIH": { + "file": "chunk-IU7YKJIH.js" + }, + "chunk-M6BWXOA7": { + "file": "chunk-M6BWXOA7.js" + }, + "chunk-Z56L2OW3": { + "file": "chunk-Z56L2OW3.js" + }, + "chunk-BWUPY3GV": { + "file": "chunk-BWUPY3GV.js" + }, + "chunk-43MAAKCB": { + "file": "chunk-43MAAKCB.js" + }, + "chunk-3HCGTFGQ": { + "file": "chunk-3HCGTFGQ.js" + }, + "chunk-I7VGFG6E": { + "file": "chunk-I7VGFG6E.js" + }, + "chunk-QPSCFEL7": { + "file": "chunk-QPSCFEL7.js" + }, + "chunk-3KBAUKGL": { + "file": "chunk-3KBAUKGL.js" + }, + "chunk-WA62JWQC": { + "file": "chunk-WA62JWQC.js" + }, + "chunk-MHQUXCSM": { + "file": "chunk-MHQUXCSM.js" + }, + "chunk-3VX4KOHZ": { + "file": "chunk-3VX4KOHZ.js" + }, + "chunk-5JIGIHKI": { + "file": "chunk-5JIGIHKI.js" + }, + "chunk-SQRQRBWP": { + "file": "chunk-SQRQRBWP.js" + }, + "chunk-5XWG7DVZ": { + "file": "chunk-5XWG7DVZ.js" + }, + "chunk-UREMQV46": { + "file": "chunk-UREMQV46.js" + }, + "chunk-I3MKG3SF": { + "file": "chunk-I3MKG3SF.js" + }, + "chunk-RBS5U4D4": { + "file": "chunk-RBS5U4D4.js" + }, + "chunk-NE7P3SAW": { + "file": "chunk-NE7P3SAW.js" + }, + "chunk-F6LCGRDD": { + "file": "chunk-F6LCGRDD.js" + }, + "chunk-W3TATJ3S": { + "file": "chunk-W3TATJ3S.js" + }, + "chunk-BR2GFEXT": { + "file": "chunk-BR2GFEXT.js" + }, + "chunk-FAQKFQAR": { + "file": "chunk-FAQKFQAR.js" + }, + "chunk-6HGGHV5T": { + "file": "chunk-6HGGHV5T.js" + }, + "chunk-YARPGAZO": { + "file": "chunk-YARPGAZO.js" + }, + "chunk-OTUA5VA5": { + "file": "chunk-OTUA5VA5.js" + }, + "chunk-6M5DUIJQ": { + "file": "chunk-6M5DUIJQ.js" + }, + "chunk-3QU44QWX": { + "file": "chunk-3QU44QWX.js" + }, + "chunk-IIUBOVLN": { + "file": "chunk-IIUBOVLN.js" + }, + "chunk-OALUBITD": { + "file": "chunk-OALUBITD.js" + }, + "chunk-MJY2WEG4": { + "file": "chunk-MJY2WEG4.js" + }, + "chunk-2BXB5PNR": { + "file": "chunk-2BXB5PNR.js" + }, + "chunk-53TKZQ46": { + "file": "chunk-53TKZQ46.js" + }, + "chunk-YS77L635": { + "file": "chunk-YS77L635.js" + }, + "chunk-RLXSHQAW": { + "file": "chunk-RLXSHQAW.js" + }, + "chunk-PPQAHSM4": { + "file": "chunk-PPQAHSM4.js" + }, + "chunk-PWDIEZBU": { + "file": "chunk-PWDIEZBU.js" + }, + "chunk-WM2CJBRC": { + "file": "chunk-WM2CJBRC.js" + }, + "chunk-5VLFCPCQ": { + "file": "chunk-5VLFCPCQ.js" + }, + "chunk-X74Q7PS2": { + "file": "chunk-X74Q7PS2.js" + }, + "chunk-7IJTKJM3": { + "file": "chunk-7IJTKJM3.js" + }, + "chunk-A4AVEXYF": { + "file": "chunk-A4AVEXYF.js" + }, + "chunk-TBKTE5S2": { + "file": "chunk-TBKTE5S2.js" + }, + "chunk-TSYSIWEK": { + "file": "chunk-TSYSIWEK.js" + }, + "chunk-BNUANBMD": { + "file": "chunk-BNUANBMD.js" + }, + "chunk-COJTJB37": { + "file": "chunk-COJTJB37.js" + }, + "chunk-LR5OH67G": { + "file": "chunk-LR5OH67G.js" + }, + "chunk-JVX72D2A": { + "file": "chunk-JVX72D2A.js" + }, + "chunk-MTUL7B3W": { + "file": "chunk-MTUL7B3W.js" + }, + "chunk-4NEWABLH": { + "file": "chunk-4NEWABLH.js" + }, + "chunk-FW2Y26A2": { + "file": "chunk-FW2Y26A2.js" + }, + "chunk-5WG7GACT": { + "file": "chunk-5WG7GACT.js" + }, + "chunk-WL4PRMGT": { + "file": "chunk-WL4PRMGT.js" + }, + "chunk-WAQJL6QT": { + "file": "chunk-WAQJL6QT.js" + }, + "chunk-UYRJACTV": { + "file": "chunk-UYRJACTV.js" + }, + "chunk-JORTWGWK": { + "file": "chunk-JORTWGWK.js" + }, + "chunk-PUGETSPP": { + "file": "chunk-PUGETSPP.js" + }, + "chunk-RCB4CZ33": { + "file": "chunk-RCB4CZ33.js" + }, + "chunk-B7TIRUHV": { + "file": "chunk-B7TIRUHV.js" + }, + "chunk-UNM77OAF": { + "file": "chunk-UNM77OAF.js" + }, + "chunk-FEU6DJHZ": { + "file": "chunk-FEU6DJHZ.js" + }, + "chunk-EDLXT5HY": { + "file": "chunk-EDLXT5HY.js" + }, + "chunk-PSDLZUAR": { + "file": "chunk-PSDLZUAR.js" + }, + "chunk-VRIEYNOA": { + "file": "chunk-VRIEYNOA.js" + }, + "chunk-ZPF76RAZ": { + "file": "chunk-ZPF76RAZ.js" + }, + "chunk-ZTWEZQ3U": { + "file": "chunk-ZTWEZQ3U.js" + }, + "chunk-4DI4LHWA": { + "file": "chunk-4DI4LHWA.js" + }, + "chunk-FWHML2IF": { + "file": "chunk-FWHML2IF.js" + }, + "chunk-5E6O6OE2": { + "file": "chunk-5E6O6OE2.js" + }, + "chunk-YO5FGV3K": { + "file": "chunk-YO5FGV3K.js" + }, + "chunk-PK6YKEXD": { + "file": "chunk-PK6YKEXD.js" + }, + "chunk-TOXUQ7LD": { + "file": "chunk-TOXUQ7LD.js" + }, + "chunk-GLM3MF73": { + "file": "chunk-GLM3MF73.js" + }, + "chunk-T6KJVTE7": { + "file": "chunk-T6KJVTE7.js" + }, + "chunk-AYZY27OB": { + "file": "chunk-AYZY27OB.js" + }, + "chunk-XFKZJIIN": { + "file": "chunk-XFKZJIIN.js" + }, + "chunk-XAWHZBMV": { + "file": "chunk-XAWHZBMV.js" + }, + "chunk-LICYR7HQ": { + "file": "chunk-LICYR7HQ.js" + }, + "chunk-H3O5BFFA": { + "file": "chunk-H3O5BFFA.js" + }, + "chunk-KEW2M5U5": { + "file": "chunk-KEW2M5U5.js" + }, + "chunk-RN5RTM2J": { + "file": "chunk-RN5RTM2J.js" + }, + "chunk-236CRHJ4": { + "file": "chunk-236CRHJ4.js" + }, + "chunk-XMR6C7PP": { + "file": "chunk-XMR6C7PP.js" + }, + "chunk-VYFGA7LQ": { + "file": "chunk-VYFGA7LQ.js" + }, + "chunk-YOCP66N5": { + "file": "chunk-YOCP66N5.js" + }, + "chunk-SSIWKKQU": { + "file": "chunk-SSIWKKQU.js" + }, + "chunk-42NL5DUR": { + "file": "chunk-42NL5DUR.js" + }, + "chunk-6EG2LPUD": { + "file": "chunk-6EG2LPUD.js" + }, + "chunk-CZY6WHZW": { + "file": "chunk-CZY6WHZW.js" + }, + "chunk-IYPTDM5V": { + "file": "chunk-IYPTDM5V.js" + }, + "chunk-VTE4HP52": { + "file": "chunk-VTE4HP52.js" + }, + "chunk-7SEDHBCF": { + "file": "chunk-7SEDHBCF.js" + }, + "chunk-2OD3YJEU": { + "file": "chunk-2OD3YJEU.js" + }, + "chunk-BPUXYV67": { + "file": "chunk-BPUXYV67.js" + }, + "chunk-QUIWNZKA": { + "file": "chunk-QUIWNZKA.js" + }, + "chunk-46BDPT7N": { + "file": "chunk-46BDPT7N.js" + }, + "chunk-EAI6UMGA": { + "file": "chunk-EAI6UMGA.js" + }, + "chunk-H7GN4HC7": { + "file": "chunk-H7GN4HC7.js" + }, + "chunk-P7EZ6BMZ": { + "file": "chunk-P7EZ6BMZ.js" + }, + "chunk-C732J5PH": { + "file": "chunk-C732J5PH.js" + }, + "chunk-6RMEMK4F": { + "file": "chunk-6RMEMK4F.js" + }, + "chunk-GZTU5O23": { + "file": "chunk-GZTU5O23.js" + }, + "chunk-QQ6I635W": { + "file": "chunk-QQ6I635W.js" + }, + "chunk-RKB67A7H": { + "file": "chunk-RKB67A7H.js" + }, + "chunk-SDSUXDLO": { + "file": "chunk-SDSUXDLO.js" + }, + "chunk-7XHTQH4H": { + "file": "chunk-7XHTQH4H.js" + }, + "chunk-WABOKNQ6": { + "file": "chunk-WABOKNQ6.js" + }, + "chunk-KBRQ2EQZ": { + "file": "chunk-KBRQ2EQZ.js" + }, + "chunk-ZSPO5L3W": { + "file": "chunk-ZSPO5L3W.js" + }, + "chunk-BT3PRKL3": { + "file": "chunk-BT3PRKL3.js" + }, + "chunk-A6AWWIDN": { + "file": "chunk-A6AWWIDN.js" + }, + "chunk-GD5DHJAU": { + "file": "chunk-GD5DHJAU.js" + }, + "chunk-TP4OXVPS": { + "file": "chunk-TP4OXVPS.js" + }, + "chunk-B2DDIRKA": { + "file": "chunk-B2DDIRKA.js" + }, + "chunk-E5KBJRBY": { + "file": "chunk-E5KBJRBY.js" + }, + "chunk-PZLE2TTF": { + "file": "chunk-PZLE2TTF.js" + }, + "chunk-P47SSGTE": { + "file": "chunk-P47SSGTE.js" + }, + "chunk-2GWLT2VA": { + "file": "chunk-2GWLT2VA.js" + }, + "chunk-UQ42FJNS": { + "file": "chunk-UQ42FJNS.js" + }, + "chunk-LFRG62GM": { + "file": "chunk-LFRG62GM.js" + }, + "chunk-6YPVLTGQ": { + "file": "chunk-6YPVLTGQ.js" + }, + "chunk-OUOSBATD": { + "file": "chunk-OUOSBATD.js" + }, + "chunk-F3SVUYKX": { + "file": "chunk-F3SVUYKX.js" + }, + "chunk-36U66OUU": { + "file": "chunk-36U66OUU.js" + }, + "chunk-JPJG2BJH": { + "file": "chunk-JPJG2BJH.js" + }, + "chunk-D2ADQN3V": { + "file": "chunk-D2ADQN3V.js" + }, + "chunk-HZYAPISH": { + "file": "chunk-HZYAPISH.js" + }, + "chunk-UCLOK4R5": { + "file": "chunk-UCLOK4R5.js" + }, + "chunk-NQU73J2S": { + "file": "chunk-NQU73J2S.js" + }, + "chunk-COM5V4KY": { + "file": "chunk-COM5V4KY.js" + }, + "chunk-WJFGGM6M": { + "file": "chunk-WJFGGM6M.js" + }, + "chunk-OY457W7Z": { + "file": "chunk-OY457W7Z.js" + }, + "chunk-D7G7CQCF": { + "file": "chunk-D7G7CQCF.js" + }, + "chunk-QWU6TT5N": { + "file": "chunk-QWU6TT5N.js" + }, + "chunk-XUINFGEC": { + "file": "chunk-XUINFGEC.js" + }, + "chunk-A6OICK25": { + "file": "chunk-A6OICK25.js" + }, + "chunk-SS7XIG2F": { + "file": "chunk-SS7XIG2F.js" + }, + "chunk-OMSASJ7P": { + "file": "chunk-OMSASJ7P.js" + }, + "chunk-WT2KRXPN": { + "file": "chunk-WT2KRXPN.js" + }, + "chunk-TQ6VLUYN": { + "file": "chunk-TQ6VLUYN.js" + }, + "chunk-UHDTQGRQ": { + "file": "chunk-UHDTQGRQ.js" + }, + "chunk-BF3TRXKE": { + "file": "chunk-BF3TRXKE.js" + }, + "chunk-P55S6T3U": { + "file": "chunk-P55S6T3U.js" + }, + "chunk-NFRVM55B": { + "file": "chunk-NFRVM55B.js" + }, + "chunk-GVD75U7Y": { + "file": "chunk-GVD75U7Y.js" + }, + "chunk-52RFCBKP": { + "file": "chunk-52RFCBKP.js" + }, + "chunk-QIC3O2CG": { + "file": "chunk-QIC3O2CG.js" + }, + "chunk-7E7AZBR4": { + "file": "chunk-7E7AZBR4.js" + }, + "chunk-NLEVG3L2": { + "file": "chunk-NLEVG3L2.js" + }, + "chunk-ZSOEAHG4": { + "file": "chunk-ZSOEAHG4.js" + }, + "chunk-QJIM2U4M": { + "file": "chunk-QJIM2U4M.js" + }, + "chunk-DVULOQVS": { + "file": "chunk-DVULOQVS.js" + }, + "chunk-XTJXFM2Q": { + "file": "chunk-XTJXFM2Q.js" + }, + "chunk-LC2XMTU6": { + "file": "chunk-LC2XMTU6.js" + }, + "chunk-HFDOQZPQ": { + "file": "chunk-HFDOQZPQ.js" + }, + "chunk-BF7PCQKY": { + "file": "chunk-BF7PCQKY.js" + }, + "chunk-4EHSQ26G": { + "file": "chunk-4EHSQ26G.js" + }, + "chunk-VA4REUQY": { + "file": "chunk-VA4REUQY.js" + }, + "chunk-HMA7BWN6": { + "file": "chunk-HMA7BWN6.js" + }, + "chunk-PWGP3RVE": { + "file": "chunk-PWGP3RVE.js" + }, + "chunk-DT2VHQBL": { + "file": "chunk-DT2VHQBL.js" + }, + "chunk-DW5GZ4KY": { + "file": "chunk-DW5GZ4KY.js" + }, + "chunk-42P5D5XR": { + "file": "chunk-42P5D5XR.js" + }, + "chunk-LJGBQDXH": { + "file": "chunk-LJGBQDXH.js" + }, + "chunk-MTJ2HUP3": { + "file": "chunk-MTJ2HUP3.js" + }, + "chunk-4Y76CZYZ": { + "file": "chunk-4Y76CZYZ.js" + }, + "chunk-WFGYMDOJ": { + "file": "chunk-WFGYMDOJ.js" + }, + "chunk-KRITHZAV": { + "file": "chunk-KRITHZAV.js" + }, + "chunk-IRH22IS7": { + "file": "chunk-IRH22IS7.js" + }, + "chunk-XCLHJKQT": { + "file": "chunk-XCLHJKQT.js" + }, + "chunk-7IBALAI5": { + "file": "chunk-7IBALAI5.js" + }, + "chunk-UURQIMME": { + "file": "chunk-UURQIMME.js" + }, + "chunk-DNC64WX4": { + "file": "chunk-DNC64WX4.js" + }, + "chunk-MTMH54JR": { + "file": "chunk-MTMH54JR.js" + }, + "chunk-NQ7SK7XM": { + "file": "chunk-NQ7SK7XM.js" + }, + "chunk-7THYN2PR": { + "file": "chunk-7THYN2PR.js" + }, + "chunk-PE5IRKAT": { + "file": "chunk-PE5IRKAT.js" + }, + "chunk-GDQR3EAN": { + "file": "chunk-GDQR3EAN.js" + }, + "chunk-L7V6MI7A": { + "file": "chunk-L7V6MI7A.js" + }, + "chunk-AL7KEYJ7": { + "file": "chunk-AL7KEYJ7.js" + }, + "chunk-YZJAOTEM": { + "file": "chunk-YZJAOTEM.js" + }, + "chunk-KH5SCELB": { + "file": "chunk-KH5SCELB.js" + }, + "chunk-EZZDJSZP": { + "file": "chunk-EZZDJSZP.js" + }, + "chunk-R7IFGYH2": { + "file": "chunk-R7IFGYH2.js" + }, + "chunk-NVDLB2PV": { + "file": "chunk-NVDLB2PV.js" + }, + "chunk-M2LXCOON": { + "file": "chunk-M2LXCOON.js" + }, + "chunk-TI6KQJT3": { + "file": "chunk-TI6KQJT3.js" + }, + "chunk-ED5W63C6": { + "file": "chunk-ED5W63C6.js" + }, + "chunk-EIUILQSQ": { + "file": "chunk-EIUILQSQ.js" + }, + "chunk-ZYVCGFIP": { + "file": "chunk-ZYVCGFIP.js" + }, + "chunk-U2KCFCNQ": { + "file": "chunk-U2KCFCNQ.js" + }, + "chunk-5W73DLIB": { + "file": "chunk-5W73DLIB.js" + }, + "chunk-MZNMD3EM": { + "file": "chunk-MZNMD3EM.js" + }, + "chunk-N3PWKJZ3": { + "file": "chunk-N3PWKJZ3.js" + }, + "chunk-ANKPHJ7F": { + "file": "chunk-ANKPHJ7F.js" + }, + "chunk-7RWKUNGE": { + "file": "chunk-7RWKUNGE.js" + }, + "chunk-BR7DYBOB": { + "file": "chunk-BR7DYBOB.js" + }, + "chunk-TL7XU646": { + "file": "chunk-TL7XU646.js" + }, + "chunk-CMMJRE6V": { + "file": "chunk-CMMJRE6V.js" + }, + "chunk-HEXKABIS": { + "file": "chunk-HEXKABIS.js" + }, + "chunk-UWRLRJVL": { + "file": "chunk-UWRLRJVL.js" + }, + "chunk-OUGYPGGH": { + "file": "chunk-OUGYPGGH.js" + }, + "chunk-OZKXKA2J": { + "file": "chunk-OZKXKA2J.js" + }, + "chunk-2AOOVW5U": { + "file": "chunk-2AOOVW5U.js" + }, + "chunk-7U7Y5I2H": { + "file": "chunk-7U7Y5I2H.js" + }, + "chunk-AQNLVN4F": { + "file": "chunk-AQNLVN4F.js" + }, + "chunk-ZLXEFR4W": { + "file": "chunk-ZLXEFR4W.js" + }, + "chunk-R4JSLWA2": { + "file": "chunk-R4JSLWA2.js" + }, + "chunk-A34O4XB5": { + "file": "chunk-A34O4XB5.js" + }, + "chunk-XBKVX7RI": { + "file": "chunk-XBKVX7RI.js" + }, + "chunk-PRM4NGVF": { + "file": "chunk-PRM4NGVF.js" + }, + "chunk-7KLOXQQH": { + "file": "chunk-7KLOXQQH.js" + }, + "chunk-IAQVFPIP": { + "file": "chunk-IAQVFPIP.js" + }, + "chunk-NSVHTHE3": { + "file": "chunk-NSVHTHE3.js" + }, + "chunk-2S422ZEO": { + "file": "chunk-2S422ZEO.js" + }, + "chunk-HJBVHBA3": { + "file": "chunk-HJBVHBA3.js" + }, + "chunk-MCPLXIGG": { + "file": "chunk-MCPLXIGG.js" + }, + "chunk-35WL4MPS": { + "file": "chunk-35WL4MPS.js" + }, + "chunk-PMAKPNYZ": { + "file": "chunk-PMAKPNYZ.js" + }, + "chunk-QVY3T4VD": { + "file": "chunk-QVY3T4VD.js" + }, + "chunk-TDRWUA5E": { + "file": "chunk-TDRWUA5E.js" + }, + "chunk-AFXPVXTM": { + "file": "chunk-AFXPVXTM.js" + }, + "chunk-L4GBZBGI": { + "file": "chunk-L4GBZBGI.js" + }, + "chunk-ERBQFEUI": { + "file": "chunk-ERBQFEUI.js" + }, + "chunk-L5UCHDSQ": { + "file": "chunk-L5UCHDSQ.js" + }, + "chunk-DF7567GR": { + "file": "chunk-DF7567GR.js" + }, + "chunk-YZYM4IRI": { + "file": "chunk-YZYM4IRI.js" + }, + "chunk-J5AVY5MA": { + "file": "chunk-J5AVY5MA.js" + }, + "chunk-OJ65P3EQ": { + "file": "chunk-OJ65P3EQ.js" + }, + "chunk-AXXW7TMJ": { + "file": "chunk-AXXW7TMJ.js" + }, + "chunk-2TGCD2MK": { + "file": "chunk-2TGCD2MK.js" + }, + "chunk-ADDJKTQ7": { + "file": "chunk-ADDJKTQ7.js" + }, + "chunk-FOW36CJD": { + "file": "chunk-FOW36CJD.js" + }, + "chunk-7544LAH3": { + "file": "chunk-7544LAH3.js" + }, + "chunk-UG2MJUFG": { + "file": "chunk-UG2MJUFG.js" + }, + "chunk-DNV3FEZP": { + "file": "chunk-DNV3FEZP.js" + }, + "chunk-BK6LTI4J": { + "file": "chunk-BK6LTI4J.js" + }, + "chunk-3ON6HO7Q": { + "file": "chunk-3ON6HO7Q.js" + }, + "chunk-EVWRN54I": { + "file": "chunk-EVWRN54I.js" + }, + "chunk-FFB4P3JV": { + "file": "chunk-FFB4P3JV.js" + }, + "chunk-3CAYFJKQ": { + "file": "chunk-3CAYFJKQ.js" + }, + "chunk-XJLKESB7": { + "file": "chunk-XJLKESB7.js" + }, + "chunk-QLCCKKQG": { + "file": "chunk-QLCCKKQG.js" + }, + "chunk-F4G4VXDA": { + "file": "chunk-F4G4VXDA.js" + }, + "chunk-JC6GHBZC": { + "file": "chunk-JC6GHBZC.js" + }, + "chunk-7YPQL5SJ": { + "file": "chunk-7YPQL5SJ.js" + }, + "chunk-TWNBDJHC": { + "file": "chunk-TWNBDJHC.js" + }, + "chunk-BLF2L2BA": { + "file": "chunk-BLF2L2BA.js" + }, + "chunk-QDSJD3PN": { + "file": "chunk-QDSJD3PN.js" + }, + "chunk-RPOPZ2RJ": { + "file": "chunk-RPOPZ2RJ.js" + }, + "chunk-XCCJEPDF": { + "file": "chunk-XCCJEPDF.js" + }, + "chunk-FHZZ7HZK": { + "file": "chunk-FHZZ7HZK.js" + }, + "chunk-IHWFCAZF": { + "file": "chunk-IHWFCAZF.js" + }, + "chunk-N2ACXOSX": { + "file": "chunk-N2ACXOSX.js" + }, + "chunk-U4ONWLTG": { + "file": "chunk-U4ONWLTG.js" + }, + "chunk-HFF55FWA": { + "file": "chunk-HFF55FWA.js" + }, + "chunk-W4TIFY65": { + "file": "chunk-W4TIFY65.js" + }, + "chunk-B6KH3FQ2": { + "file": "chunk-B6KH3FQ2.js" + }, + "chunk-TP2WA3QT": { + "file": "chunk-TP2WA3QT.js" + }, + "chunk-PMZ4BA3R": { + "file": "chunk-PMZ4BA3R.js" + }, + "chunk-APYNYYQC": { + "file": "chunk-APYNYYQC.js" + }, + "chunk-RKYRHCIM": { + "file": "chunk-RKYRHCIM.js" + }, + "chunk-YIL7KVTZ": { + "file": "chunk-YIL7KVTZ.js" + }, + "chunk-5NG4NERC": { + "file": "chunk-5NG4NERC.js" + }, + "chunk-USGLJKFQ": { + "file": "chunk-USGLJKFQ.js" + }, + "chunk-R3HJCIKB": { + "file": "chunk-R3HJCIKB.js" + }, + "chunk-BCVLMG45": { + "file": "chunk-BCVLMG45.js" + }, + "chunk-R3RGZPTW": { + "file": "chunk-R3RGZPTW.js" + }, + "chunk-L3LWWUKM": { + "file": "chunk-L3LWWUKM.js" + }, + "chunk-EAZVFJZ4": { + "file": "chunk-EAZVFJZ4.js" + }, + "chunk-QNHIHOAC": { + "file": "chunk-QNHIHOAC.js" + }, + "chunk-TRVUOPG3": { + "file": "chunk-TRVUOPG3.js" + }, + "chunk-DPJBT3WW": { + "file": "chunk-DPJBT3WW.js" + }, + "chunk-AD3CKYW6": { + "file": "chunk-AD3CKYW6.js" + }, + "chunk-PJQIAD5D": { + "file": "chunk-PJQIAD5D.js" + }, + "chunk-47ZVYBX5": { + "file": "chunk-47ZVYBX5.js" + }, + "chunk-BDVCXILY": { + "file": "chunk-BDVCXILY.js" + }, + "chunk-WBN5ACQN": { + "file": "chunk-WBN5ACQN.js" + }, + "chunk-EBR2HEVY": { + "file": "chunk-EBR2HEVY.js" + }, + "chunk-AKXH7ZEA": { + "file": "chunk-AKXH7ZEA.js" + }, + "chunk-LHSZO6GE": { + "file": "chunk-LHSZO6GE.js" + }, + "chunk-2TJRMWV4": { + "file": "chunk-2TJRMWV4.js" + }, + "chunk-FA66SXDB": { + "file": "chunk-FA66SXDB.js" + }, + "chunk-WYBZLWIA": { + "file": "chunk-WYBZLWIA.js" + }, + "chunk-TOMYGYHM": { + "file": "chunk-TOMYGYHM.js" + }, + "chunk-HLDQ5LYC": { + "file": "chunk-HLDQ5LYC.js" + }, + "chunk-VF2IQ7JF": { + "file": "chunk-VF2IQ7JF.js" + }, + "chunk-N4ILRMTY": { + "file": "chunk-N4ILRMTY.js" + }, + "chunk-24YQF2E7": { + "file": "chunk-24YQF2E7.js" + }, + "chunk-AV2DYQR2": { + "file": "chunk-AV2DYQR2.js" + }, + "chunk-IM6N6ZTY": { + "file": "chunk-IM6N6ZTY.js" + }, + "chunk-EPAM2Z3B": { + "file": "chunk-EPAM2Z3B.js" + }, + "chunk-CETTCRNQ": { + "file": "chunk-CETTCRNQ.js" + }, + "chunk-HIJOLL3B": { + "file": "chunk-HIJOLL3B.js" + }, + "chunk-RYMUHAXT": { + "file": "chunk-RYMUHAXT.js" + }, + "chunk-2GW6OAEL": { + "file": "chunk-2GW6OAEL.js" + }, + "chunk-LEXXCE6G": { + "file": "chunk-LEXXCE6G.js" + }, + "chunk-W254FAY2": { + "file": "chunk-W254FAY2.js" + }, + "chunk-AWFMZQCY": { + "file": "chunk-AWFMZQCY.js" + }, + "chunk-KLGGQLJF": { + "file": "chunk-KLGGQLJF.js" + }, + "chunk-KWZGKFKX": { + "file": "chunk-KWZGKFKX.js" + }, + "chunk-WUN4A7QC": { + "file": "chunk-WUN4A7QC.js" + }, + "chunk-OO3HYPGZ": { + "file": "chunk-OO3HYPGZ.js" + }, + "chunk-QTNTJ4TY": { + "file": "chunk-QTNTJ4TY.js" + }, + "chunk-3BUQ6T3G": { + "file": "chunk-3BUQ6T3G.js" + }, + "chunk-DFHCG7HS": { + "file": "chunk-DFHCG7HS.js" + }, + "chunk-J3P6IPFR": { + "file": "chunk-J3P6IPFR.js" + }, + "chunk-4SEO7QJC": { + "file": "chunk-4SEO7QJC.js" + }, + "chunk-HZXZX5WF": { + "file": "chunk-HZXZX5WF.js" + }, + "chunk-6VINDWDB": { + "file": "chunk-6VINDWDB.js" + }, + "chunk-WSUUG4MS": { + "file": "chunk-WSUUG4MS.js" + }, + "chunk-HE5BNKJS": { + "file": "chunk-HE5BNKJS.js" + }, + "chunk-62CXLI6S": { + "file": "chunk-62CXLI6S.js" + }, + "chunk-X4KCTD7P": { + "file": "chunk-X4KCTD7P.js" + }, + "chunk-RGOI6JTE": { + "file": "chunk-RGOI6JTE.js" + }, + "chunk-QBDY5XMU": { + "file": "chunk-QBDY5XMU.js" + }, + "chunk-6RLJDSGT": { + "file": "chunk-6RLJDSGT.js" + }, + "chunk-GZO4RPEF": { + "file": "chunk-GZO4RPEF.js" + }, + "chunk-ZYRJDZ42": { + "file": "chunk-ZYRJDZ42.js" + }, + "chunk-SIWCYG2W": { + "file": "chunk-SIWCYG2W.js" + } + } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 772717d..1d73f9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,10 +7,28 @@ "": { "name": "elb-js-api", "version": "0.1.0", + "dependencies": { + "@arcgis/core": "^4.28.10" + }, "devDependencies": { "vite": "^5.0.8" } }, + "node_modules/@arcgis/core": { + "version": "4.28.10", + "resolved": "https://registry.npmjs.org/@arcgis/core/-/core-4.28.10.tgz", + "integrity": "sha512-FKvicMVDwFuKX8JKLqAfukzQU2F3AG7s3tDigTcIC4ApGRbj7Nc/F9dRfPZo+aY1Vl7Sa1FjYlo6tfV93LJ2Eg==", + "dependencies": { + "@esri/arcgis-html-sanitizer": "~3.0.1", + "@esri/calcite-colors": "~6.1.0", + "@esri/calcite-components": "^1.9.2", + "@popperjs/core": "~2.11.8", + "@zip.js/zip.js": "~2.7.29", + "focus-trap": "~7.5.3", + "luxon": "~3.4.3", + "sortablejs": "~1.15.0" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.9", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.9.tgz", @@ -363,6 +381,72 @@ "node": ">=12" } }, + "node_modules/@esri/arcgis-html-sanitizer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@esri/arcgis-html-sanitizer/-/arcgis-html-sanitizer-3.0.1.tgz", + "integrity": "sha512-cwZJwsYCJZwtBQU2AmaiIVFg5nZcVwInPYja1/OgC9iKYO+ytZRoc5h+0S9/ygbFNoS8Nd0RX9A85stLX/BgiA==", + "dependencies": { + "xss": "1.0.13" + } + }, + "node_modules/@esri/calcite-colors": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@esri/calcite-colors/-/calcite-colors-6.1.0.tgz", + "integrity": "sha512-wHQYWFtDa6c328EraXEVZvgOiaQyYr0yuaaZ0G3cB4C3lSkWefW34L/e5TLAhtuG3zJ/wR6pl5X1YYNfBc0/4Q==" + }, + "node_modules/@esri/calcite-components": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@esri/calcite-components/-/calcite-components-1.11.0.tgz", + "integrity": "sha512-H0ZqX3fEv4i0JCBEZ5SarPpd1KeXvqlEpLTtforfifIYbFAQOshP5fC2tFSL7j5pECyhBuB7rRhBiFeFejpRDw==", + "dependencies": { + "@floating-ui/dom": "1.5.3", + "@stencil/core": "2.22.3", + "@types/color": "3.0.5", + "color": "4.2.3", + "composed-offset-position": "0.0.4", + "dayjs": "1.11.10", + "focus-trap": "7.5.4", + "lodash-es": "4.17.21", + "sortablejs": "1.15.0", + "timezone-groups": "0.8.0" + } + }, + "node_modules/@esri/calcite-components/node_modules/sortablejs": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.0.tgz", + "integrity": "sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==" + }, + "node_modules/@floating-ui/core": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.2.tgz", + "integrity": "sha512-Ii3MrfY/GAIN3OhXNzpCKaLxHQfJF9qvwq/kEJYdqDxeIHa01K8sldugal6TmeeXl+WMvhv9cnVzUTaFFJF09A==", + "dependencies": { + "@floating-ui/utils": "^0.1.3" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz", + "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==", + "dependencies": { + "@floating-ui/core": "^1.4.2", + "@floating-ui/utils": "^0.1.3" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz", + "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==" + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.9.1", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.1.tgz", @@ -532,6 +616,106 @@ "win32" ] }, + "node_modules/@stencil/core": { + "version": "2.22.3", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-2.22.3.tgz", + "integrity": "sha512-kmVA0M/HojwsfkeHsifvHVIYe4l5tin7J5+DLgtl8h6WWfiMClND5K3ifCXXI2ETDNKiEk21p6jql3Fx9o2rng==", + "bin": { + "stencil": "bin/stencil" + }, + "engines": { + "node": ">=12.10.0", + "npm": ">=6.0.0" + } + }, + "node_modules/@types/color": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/color/-/color-3.0.5.tgz", + "integrity": "sha512-T9yHCNtd8ap9L/r8KEESu5RDMLkoWXHo7dTureNoI1dbp25NsCN054vOu09iniIjR21MXUL+LU9bkIWrbyg8gg==", + "dependencies": { + "@types/color-convert": "*" + } + }, + "node_modules/@types/color-convert": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/color-convert/-/color-convert-2.0.3.tgz", + "integrity": "sha512-2Q6wzrNiuEvYxVQqhh7sXM2mhIhvZR/Paq4FdsQkOMgWsCIkKvSGj8Le1/XalulrmgOzPMqNa0ix+ePY4hTrfg==", + "dependencies": { + "@types/color-name": "*" + } + }, + "node_modules/@types/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-87W6MJCKZYDhLAx/J1ikW8niMvmGRyY+rpUxWpL1cO7F8Uu5CHuQoFv+R0/L5pgNdW4jTyda42kv60uwVIPjLw==" + }, + "node_modules/@zip.js/zip.js": { + "version": "2.7.32", + "resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.32.tgz", + "integrity": "sha512-9Ox1meDIvIKE23LLA7Fxd/ewJpKjj2KryH92doHRqx2406LmIzorsiMawL0qIK7dvwN9K+mfk47lauoIE0o1zQ==", + "engines": { + "bun": ">=0.7.0", + "deno": ">=1.0.0", + "node": ">=16.5.0" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/composed-offset-position": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/composed-offset-position/-/composed-offset-position-0.0.4.tgz", + "integrity": "sha512-vMlvu1RuNegVE0YsCDSV/X4X10j56mq7PCIyOKK74FxkXzGLwhOUmdkJLSdOBOMwWycobGUMgft2lp+YgTe8hw==" + }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + }, + "node_modules/dayjs": { + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" + }, "node_modules/esbuild": { "version": "0.19.9", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.9.tgz", @@ -569,6 +753,14 @@ "@esbuild/win32-x64": "0.19.9" } }, + "node_modules/focus-trap": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.4.tgz", + "integrity": "sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==", + "dependencies": { + "tabbable": "^6.2.0" + } + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -583,6 +775,24 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==" + }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, + "node_modules/luxon": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.4.4.tgz", + "integrity": "sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==", + "engines": { + "node": ">=12" + } + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -664,6 +874,19 @@ "fsevents": "~2.3.2" } }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/sortablejs": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.1.tgz", + "integrity": "sha512-P5Cjvb0UG1ZVNiDPj/n4V+DinttXG6K8n7vM/HQf0C25K3YKQTQY6fsr/sEGsJGpQ9exmPxluHxKBc0mLKU1lQ==" + }, "node_modules/source-map-js": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", @@ -673,6 +896,19 @@ "node": ">=0.10.0" } }, + "node_modules/tabbable": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", + "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew==" + }, + "node_modules/timezone-groups": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/timezone-groups/-/timezone-groups-0.8.0.tgz", + "integrity": "sha512-t7E/9sPfCU0m0ZbS7Cqw52D6CB/UyeaiIBmyJCokI1SyOyOgA/ESiQ/fbreeFaUG9QSenGlZSSk/7rEbkipbOA==", + "bin": { + "timezone-groups": "dist/cli.cjs" + } + }, "node_modules/vite": { "version": "5.0.10", "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz", @@ -727,6 +963,21 @@ "optional": true } } + }, + "node_modules/xss": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.13.tgz", + "integrity": "sha512-clu7dxTm1e8Mo5fz3n/oW3UCXBfV89xZ72jM8yzo1vR/pIS0w3sgB3XV2H8Vm6zfGnHL0FzvLJPJEBhd86/z4Q==", + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } } } } diff --git a/package.json b/package.json index cd5eb7a..5b596b5 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,8 @@ }, "devDependencies": { "vite": "^5.0.8" + }, + "dependencies": { + "@arcgis/core": "^4.28.10" } } diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..43bef15 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,5 @@ +import { defineConfig } from "vite"; + +export default defineConfig({ + base: "/elb-js-api/", +});